@samanhappy/mcphub 0.8.6 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/index.js +5 -4
- package/dist/config/index.js.map +1 -1
- package/dist/controllers/authController.js +27 -5
- package/dist/controllers/authController.js.map +1 -1
- package/dist/controllers/cloudController.js +245 -0
- package/dist/controllers/cloudController.js.map +1 -0
- package/dist/controllers/configController.js +12 -0
- package/dist/controllers/configController.js.map +1 -1
- package/dist/controllers/healthController.js +34 -0
- package/dist/controllers/healthController.js.map +1 -0
- package/dist/controllers/serverController.js +38 -4
- package/dist/controllers/serverController.js.map +1 -1
- package/dist/controllers/userController.js +5 -0
- package/dist/controllers/userController.js.map +1 -1
- package/dist/middlewares/auth.js +18 -0
- package/dist/middlewares/auth.js.map +1 -1
- package/dist/middlewares/i18n.js +36 -0
- package/dist/middlewares/i18n.js.map +1 -0
- package/dist/middlewares/index.js +5 -2
- package/dist/middlewares/index.js.map +1 -1
- package/dist/routes/index.js +14 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/server.js +4 -0
- package/dist/server.js.map +1 -1
- package/dist/services/cloudService.js +218 -0
- package/dist/services/cloudService.js.map +1 -0
- package/dist/services/dataService.js +3 -3
- package/dist/services/dataService.js.map +1 -1
- package/dist/services/mcpService.js +23 -12
- package/dist/services/mcpService.js.map +1 -1
- package/dist/services/registry.js +26 -10
- package/dist/services/registry.js.map +1 -1
- package/dist/utils/i18n.js +34 -0
- package/dist/utils/i18n.js.map +1 -0
- package/frontend/dist/assets/index-DHL_5Rv9.css +1 -0
- package/frontend/dist/assets/index-Di8bumN2.js +203 -0
- package/frontend/dist/assets/index-Di8bumN2.js.map +1 -0
- package/frontend/dist/index.html +2 -2
- package/package.json +3 -1
- package/frontend/dist/assets/index-CjT98mwq.css +0 -1
- package/frontend/dist/assets/index-Pdqvi7T6.js +0 -202
- package/frontend/dist/assets/index-Pdqvi7T6.js.map +0 -1
|
@@ -1,202 +0,0 @@
|
|
|
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"]'))c(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&c(m)}).observe(document,{childList:!0,subtree:!0});function r(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(d){if(d.ep)return;d.ep=!0;const f=r(d);fetch(d.href,f)}})();function $h(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Rc={exports:{}},kl={};/**
|
|
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 Wm;function ax(){if(Wm)return kl;Wm=1;var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function r(c,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var p in d)p!=="key"&&(f[p]=d[p])}else f=d;return d=f.ref,{$$typeof:s,type:c,key:m,ref:d!==void 0?d:null,props:f}}return kl.Fragment=o,kl.jsx=r,kl.jsxs=r,kl}var eh;function nx(){return eh||(eh=1,Rc.exports=ax()),Rc.exports}var l=nx(),Oc={exports:{}},Ce={};/**
|
|
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 th;function sx(){if(th)return Ce;th=1;var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),j=Symbol.iterator;function v(E){return E===null||typeof E!="object"?null:(E=j&&E[j]||E["@@iterator"],typeof E=="function"?E:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,O={};function R(E,X,le){this.props=E,this.context=X,this.refs=O,this.updater=le||A}R.prototype.isReactComponent={},R.prototype.setState=function(E,X){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,X,"setState")},R.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function S(){}S.prototype=R.prototype;function C(E,X,le){this.props=E,this.context=X,this.refs=O,this.updater=le||A}var z=C.prototype=new S;z.constructor=C,N(z,R.prototype),z.isPureReactComponent=!0;var P=Array.isArray,L={H:null,A:null,T:null,S:null,V:null},I=Object.prototype.hasOwnProperty;function K(E,X,le,ne,de,we){return le=we.ref,{$$typeof:s,type:E,key:X,ref:le!==void 0?le:null,props:we}}function B(E,X){return K(E.type,X,void 0,void 0,void 0,E.props)}function Z(E){return typeof E=="object"&&E!==null&&E.$$typeof===s}function te(E){var X={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(le){return X[le]})}var D=/\/+/g;function U(E,X){return typeof E=="object"&&E!==null&&E.key!=null?te(""+E.key):X.toString(36)}function se(){}function _(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(se,se):(E.status="pending",E.then(function(X){E.status==="pending"&&(E.status="fulfilled",E.value=X)},function(X){E.status==="pending"&&(E.status="rejected",E.reason=X)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function V(E,X,le,ne,de){var we=typeof E;(we==="undefined"||we==="boolean")&&(E=null);var ae=!1;if(E===null)ae=!0;else switch(we){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(E.$$typeof){case s:case o:ae=!0;break;case y:return ae=E._init,V(ae(E._payload),X,le,ne,de)}}if(ae)return de=de(E),ae=ne===""?"."+U(E,0):ne,P(de)?(le="",ae!=null&&(le=ae.replace(D,"$&/")+"/"),V(de,X,le,"",function(xe){return xe})):de!=null&&(Z(de)&&(de=B(de,le+(de.key==null||E&&E.key===de.key?"":(""+de.key).replace(D,"$&/")+"/")+ae)),X.push(de)),1;ae=0;var re=ne===""?".":ne+":";if(P(E))for(var ie=0;ie<E.length;ie++)ne=E[ie],we=re+U(ne,ie),ae+=V(ne,X,le,we,de);else if(ie=v(E),typeof ie=="function")for(E=ie.call(E),ie=0;!(ne=E.next()).done;)ne=ne.value,we=re+U(ne,ie++),ae+=V(ne,X,le,we,de);else if(we==="object"){if(typeof E.then=="function")return V(_(E),X,le,ne,de);throw X=String(E),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return ae}function k(E,X,le){if(E==null)return E;var ne=[],de=0;return V(E,ne,"","",function(we){return X.call(le,we,de++)}),ne}function G(E){if(E._status===-1){var X=E._result;X=X(),X.then(function(le){(E._status===0||E._status===-1)&&(E._status=1,E._result=le)},function(le){(E._status===0||E._status===-1)&&(E._status=2,E._result=le)}),E._status===-1&&(E._status=0,E._result=X)}if(E._status===1)return E._result.default;throw E._result}var F=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=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(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)};function ce(){}return Ce.Children={map:k,forEach:function(E,X,le){k(E,function(){X.apply(this,arguments)},le)},count:function(E){var X=0;return k(E,function(){X++}),X},toArray:function(E){return k(E,function(X){return X})||[]},only:function(E){if(!Z(E))throw Error("React.Children.only expected to receive a single React element child.");return E}},Ce.Component=R,Ce.Fragment=r,Ce.Profiler=d,Ce.PureComponent=C,Ce.StrictMode=c,Ce.Suspense=g,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(E){return L.H.useMemoCache(E)}},Ce.cache=function(E){return function(){return E.apply(null,arguments)}},Ce.cloneElement=function(E,X,le){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var ne=N({},E.props),de=E.key,we=void 0;if(X!=null)for(ae in X.ref!==void 0&&(we=void 0),X.key!==void 0&&(de=""+X.key),X)!I.call(X,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&X.ref===void 0||(ne[ae]=X[ae]);var ae=arguments.length-2;if(ae===1)ne.children=le;else if(1<ae){for(var re=Array(ae),ie=0;ie<ae;ie++)re[ie]=arguments[ie+2];ne.children=re}return K(E.type,de,void 0,void 0,we,ne)},Ce.createContext=function(E){return E={$$typeof:m,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:f,_context:E},E},Ce.createElement=function(E,X,le){var ne,de={},we=null;if(X!=null)for(ne in X.key!==void 0&&(we=""+X.key),X)I.call(X,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(de[ne]=X[ne]);var ae=arguments.length-2;if(ae===1)de.children=le;else if(1<ae){for(var re=Array(ae),ie=0;ie<ae;ie++)re[ie]=arguments[ie+2];de.children=re}if(E&&E.defaultProps)for(ne in ae=E.defaultProps,ae)de[ne]===void 0&&(de[ne]=ae[ne]);return K(E,we,void 0,void 0,null,de)},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(E){return{$$typeof:p,render:E}},Ce.isValidElement=Z,Ce.lazy=function(E){return{$$typeof:y,_payload:{_status:-1,_result:E},_init:G}},Ce.memo=function(E,X){return{$$typeof:h,type:E,compare:X===void 0?null:X}},Ce.startTransition=function(E){var X=L.T,le={};L.T=le;try{var ne=E(),de=L.S;de!==null&&de(le,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(ce,F)}catch(we){F(we)}finally{L.T=X}},Ce.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Ce.use=function(E){return L.H.use(E)},Ce.useActionState=function(E,X,le){return L.H.useActionState(E,X,le)},Ce.useCallback=function(E,X){return L.H.useCallback(E,X)},Ce.useContext=function(E){return L.H.useContext(E)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(E,X){return L.H.useDeferredValue(E,X)},Ce.useEffect=function(E,X,le){var ne=L.H;if(typeof le=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ne.useEffect(E,X)},Ce.useId=function(){return L.H.useId()},Ce.useImperativeHandle=function(E,X,le){return L.H.useImperativeHandle(E,X,le)},Ce.useInsertionEffect=function(E,X){return L.H.useInsertionEffect(E,X)},Ce.useLayoutEffect=function(E,X){return L.H.useLayoutEffect(E,X)},Ce.useMemo=function(E,X){return L.H.useMemo(E,X)},Ce.useOptimistic=function(E,X){return L.H.useOptimistic(E,X)},Ce.useReducer=function(E,X,le){return L.H.useReducer(E,X,le)},Ce.useRef=function(E){return L.H.useRef(E)},Ce.useState=function(E){return L.H.useState(E)},Ce.useSyncExternalStore=function(E,X,le){return L.H.useSyncExternalStore(E,X,le)},Ce.useTransition=function(){return L.H.useTransition()},Ce.version="19.1.0",Ce}var ah;function eu(){return ah||(ah=1,Oc.exports=sx()),Oc.exports}var w=eu();const Ns=$h(w);var Mc={exports:{}},El={},zc={exports:{}},Dc={};/**
|
|
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 nh;function lx(){return nh||(nh=1,function(s){function o(k,G){var F=k.length;k.push(G);e:for(;0<F;){var ce=F-1>>>1,E=k[ce];if(0<d(E,G))k[ce]=G,k[F]=E,F=ce;else break e}}function r(k){return k.length===0?null:k[0]}function c(k){if(k.length===0)return null;var G=k[0],F=k.pop();if(F!==G){k[0]=F;e:for(var ce=0,E=k.length,X=E>>>1;ce<X;){var le=2*(ce+1)-1,ne=k[le],de=le+1,we=k[de];if(0>d(ne,F))de<E&&0>d(we,ne)?(k[ce]=we,k[de]=F,ce=de):(k[ce]=ne,k[le]=F,ce=le);else if(de<E&&0>d(we,F))k[ce]=we,k[de]=F,ce=de;else break e}}return G}function d(k,G){var F=k.sortIndex-G.sortIndex;return F!==0?F:k.id-G.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var m=Date,p=m.now();s.unstable_now=function(){return m.now()-p}}var g=[],h=[],y=1,j=null,v=3,A=!1,N=!1,O=!1,R=!1,S=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function P(k){for(var G=r(h);G!==null;){if(G.callback===null)c(h);else if(G.startTime<=k)c(h),G.sortIndex=G.expirationTime,o(g,G);else break;G=r(h)}}function L(k){if(O=!1,P(k),!N)if(r(g)!==null)N=!0,I||(I=!0,U());else{var G=r(h);G!==null&&V(L,G.startTime-k)}}var I=!1,K=-1,B=5,Z=-1;function te(){return R?!0:!(s.unstable_now()-Z<B)}function D(){if(R=!1,I){var k=s.unstable_now();Z=k;var G=!0;try{e:{N=!1,O&&(O=!1,C(K),K=-1),A=!0;var F=v;try{t:{for(P(k),j=r(g);j!==null&&!(j.expirationTime>k&&te());){var ce=j.callback;if(typeof ce=="function"){j.callback=null,v=j.priorityLevel;var E=ce(j.expirationTime<=k);if(k=s.unstable_now(),typeof E=="function"){j.callback=E,P(k),G=!0;break t}j===r(g)&&c(g),P(k)}else c(g);j=r(g)}if(j!==null)G=!0;else{var X=r(h);X!==null&&V(L,X.startTime-k),G=!1}}break e}finally{j=null,v=F,A=!1}G=void 0}}finally{G?U():I=!1}}}var U;if(typeof z=="function")U=function(){z(D)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,_=se.port2;se.port1.onmessage=D,U=function(){_.postMessage(null)}}else U=function(){S(D,0)};function V(k,G){K=S(function(){k(s.unstable_now())},G)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(k){k.callback=null},s.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<k?Math.floor(1e3/k):5},s.unstable_getCurrentPriorityLevel=function(){return v},s.unstable_next=function(k){switch(v){case 1:case 2:case 3:var G=3;break;default:G=v}var F=v;v=G;try{return k()}finally{v=F}},s.unstable_requestPaint=function(){R=!0},s.unstable_runWithPriority=function(k,G){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var F=v;v=k;try{return G()}finally{v=F}},s.unstable_scheduleCallback=function(k,G,F){var ce=s.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?ce+F:ce):F=ce,k){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=F+E,k={id:y++,callback:G,priorityLevel:k,startTime:F,expirationTime:E,sortIndex:-1},F>ce?(k.sortIndex=F,o(h,k),r(g)===null&&k===r(h)&&(O?(C(K),K=-1):O=!0,V(L,F-ce))):(k.sortIndex=E,o(g,k),N||A||(N=!0,I||(I=!0,U()))),k},s.unstable_shouldYield=te,s.unstable_wrapCallback=function(k){var G=v;return function(){var F=v;v=G;try{return k.apply(this,arguments)}finally{v=F}}}}(Dc)),Dc}var sh;function rx(){return sh||(sh=1,zc.exports=lx()),zc.exports}var Uc={exports:{}},pt={};/**
|
|
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 lh;function ox(){if(lh)return pt;lh=1;var s=eu();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 r(){}var c={d:{f:r,r:function(){throw Error(o(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(g,h,y){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:j==null?null:""+j,children:g,containerInfo:h,implementation:y}}var m=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,pt.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)},pt.flushSync=function(g){var h=m.T,y=c.p;try{if(m.T=null,c.p=2,g)return g()}finally{m.T=h,c.p=y,c.d.f()}},pt.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,c.d.C(g,h))},pt.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},pt.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var y=h.as,j=p(y,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,A=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?c.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:A}):y==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:A,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},pt.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=p(h.as,h.crossOrigin);c.d.M(g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&c.d.M(g)},pt.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,j=p(y,h.crossOrigin);c.d.L(g,y,{crossOrigin:j,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})}},pt.preloadModule=function(g,h){if(typeof g=="string")if(h){var y=p(h.as,h.crossOrigin);c.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else c.d.m(g)},pt.requestFormReset=function(g){c.d.r(g)},pt.unstable_batchedUpdates=function(g,h){return g(h)},pt.useFormState=function(g,h,y){return m.H.useFormState(g,h,y)},pt.useFormStatus=function(){return m.H.useHostTransitionStatus()},pt.version="19.1.0",pt}var rh;function ix(){if(rh)return Uc.exports;rh=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(o){console.error(o)}}return s(),Uc.exports=ox(),Uc.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 oh;function cx(){if(oh)return El;oh=1;var s=rx(),o=eu(),r=ix();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(f(e)!==e)throw Error(c(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var a=e,n=t;;){var i=a.return;if(i===null)break;var u=i.alternate;if(u===null){if(n=i.return,n!==null){a=n;continue}break}if(i.child===u.child){for(u=i.child;u;){if(u===a)return p(i),e;if(u===n)return p(i),t;u=u.sibling}throw Error(c(188))}if(a.return!==n.return)a=i,n=u;else{for(var x=!1,b=i.child;b;){if(b===a){x=!0,a=i,n=u;break}if(b===n){x=!0,n=i,a=u;break}b=b.sibling}if(!x){for(b=u.child;b;){if(b===a){x=!0,a=u,n=i;break}if(b===n){x=!0,n=u,a=i;break}b=b.sibling}if(!x)throw Error(c(189))}}if(a.alternate!==n)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?e:t}function h(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=h(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,j=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.consumer"),z=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),D=Symbol.iterator;function U(e){return e===null||typeof e!="object"?null:(e=D&&e[D]||e["@@iterator"],typeof e=="function"?e:null)}var se=Symbol.for("react.client.reference");function _(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case R:return"Profiler";case O:return"StrictMode";case L:return"Suspense";case I:return"SuspenseList";case Z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case z:return(e.displayName||"Context")+".Provider";case C:return(e._context.displayName||"Context")+".Consumer";case P:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return t=e.displayName||null,t!==null?t:_(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return _(e(t))}catch{}}return null}var V=Array.isArray,k=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},ce=[],E=-1;function X(e){return{current:e}}function le(e){0>E||(e.current=ce[E],ce[E]=null,E--)}function ne(e,t){E++,ce[E]=e.current,e.current=t}var de=X(null),we=X(null),ae=X(null),re=X(null);function ie(e,t){switch(ne(ae,t),ne(we,e),ne(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Em(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Em(t),e=Tm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}le(de),ne(de,e)}function xe(){le(de),le(we),le(ae)}function Be(e){e.memoizedState!==null&&ne(re,e);var t=de.current,a=Tm(t,e.type);t!==a&&(ne(we,e),ne(de,a))}function je(e){we.current===e&&(le(de),le(we)),re.current===e&&(le(re),wl._currentValue=F)}var De=Object.prototype.hasOwnProperty,Je=s.unstable_scheduleCallback,Ct=s.unstable_cancelCallback,ua=s.unstable_shouldYield,rn=s.unstable_requestPaint,Le=s.unstable_now,vt=s.unstable_getCurrentPriorityLevel,Oa=s.unstable_ImmediatePriority,Ma=s.unstable_UserBlockingPriority,da=s.unstable_NormalPriority,za=s.unstable_LowPriority,Rs=s.unstable_IdlePriority,ql=s.log,Gl=s.unstable_setDisableYieldValue,Da=null,mt=null;function Yt(e){if(typeof ql=="function"&&Gl(e),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(Da,e)}catch{}}var ht=Math.clz32?Math.clz32:Yl,$l=Math.log,Kl=Math.LN2;function Yl(e){return e>>>=0,e===0?32:31-($l(e)/Kl|0)|0}var on=256,cn=4194304;function ta(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function un(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var i=0,u=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var b=n&134217727;return b!==0?(n=b&~u,n!==0?i=ta(n):(x&=b,x!==0?i=ta(x):a||(a=b&~e,a!==0&&(i=ta(a))))):(b=n&~u,b!==0?i=ta(b):x!==0?i=ta(x):a||(a=n&~e,a!==0&&(i=ta(a)))),i===0?0:t!==0&&t!==i&&(t&u)===0&&(u=i&-i,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:i}function ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function oe(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 pe(){var e=on;return on<<=1,(on&4194048)===0&&(on=256),e}function Pt(){var e=cn;return cn<<=1,(cn&62914560)===0&&(cn=4194304),e}function Xt(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Qt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dn(e,t,a,n,i,u){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var b=e.entanglements,T=e.expirationTimes,$=e.hiddenUpdates;for(a=x&~a;0<a;){var J=31-ht(a),ee=1<<J;b[J]=0,T[J]=-1;var Y=$[J];if(Y!==null)for($[J]=null,J=0;J<Y.length;J++){var Q=Y[J];Q!==null&&(Q.lane&=-536870913)}a&=~ee}n!==0&&Pl(e,n,0),u!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=u&~(x&~t))}function Pl(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-ht(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&4194090}function kt(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-ht(a),i=1<<n;i&t|e[n]&t&&(e[n]|=t),a&=~i}}function aa(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Mn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Os(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:Xm(e.type))}function Xl(e,t){var a=G.p;try{return G.p=e,t()}finally{G.p=a}}var Ft=Math.random().toString(36).slice(2),at="__reactFiber$"+Ft,yt="__reactProps$"+Ft,zn="__reactContainer$"+Ft,jo="__reactEvents$"+Ft,Pg="__reactListeners$"+Ft,Xg="__reactHandles$"+Ft,hu="__reactResources$"+Ft,Ms="__reactMarker$"+Ft;function So(e){delete e[at],delete e[yt],delete e[jo],delete e[Pg],delete e[Xg]}function Dn(e){var t=e[at];if(t)return t;for(var a=e.parentNode;a;){if(t=a[zn]||a[at]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Mm(e);e!==null;){if(a=e[at])return a;e=Mm(e)}return t}e=a,a=e.parentNode}return null}function Un(e){if(e=e[at]||e[zn]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function zs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Ln(e){var t=e[hu];return t||(t=e[hu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function rt(e){e[Ms]=!0}var gu=new Set,pu={};function fn(e,t){_n(e,t),_n(e+"Capture",t)}function _n(e,t){for(pu[e]=t,e=0;e<t.length;e++)gu.add(t[e])}var Qg=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]*$"),xu={},yu={};function Fg(e){return De.call(yu,e)?!0:De.call(xu,e)?!1:Qg.test(e)?yu[e]=!0:(xu[e]=!0,!1)}function Ql(e,t,a){if(Fg(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Fl(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 fa(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}var No,bu;function Hn(e){if(No===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);No=t&&t[1]||"",bu=-1<a.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+No+e+bu}var Co=!1;function ko(e,t){if(!e||Co)return"";Co=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(Q){var Y=Q}Reflect.construct(e,[],ee)}else{try{ee.call()}catch(Q){Y=Q}e.call(ee.prototype)}}else{try{throw Error()}catch(Q){Y=Q}(ee=e())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(Q){if(Q&&Y&&typeof Q.stack=="string")return[Q.stack,Y.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=n.DetermineComponentFrameRoot(),x=u[0],b=u[1];if(x&&b){var T=x.split(`
|
|
44
|
-
`),$=b.split(`
|
|
45
|
-
`);for(i=n=0;n<T.length&&!T[n].includes("DetermineComponentFrameRoot");)n++;for(;i<$.length&&!$[i].includes("DetermineComponentFrameRoot");)i++;if(n===T.length||i===$.length)for(n=T.length-1,i=$.length-1;1<=n&&0<=i&&T[n]!==$[i];)i--;for(;1<=n&&0<=i;n--,i--)if(T[n]!==$[i]){if(n!==1||i!==1)do if(n--,i--,0>i||T[n]!==$[i]){var J=`
|
|
46
|
-
`+T[n].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=n&&0<=i);break}}}finally{Co=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Hn(a):""}function Zg(e){switch(e.tag){case 26:case 27:case 5:return Hn(e.type);case 16:return Hn("Lazy");case 13:return Hn("Suspense");case 19:return Hn("SuspenseList");case 0:case 15:return ko(e.type,!1);case 11:return ko(e.type.render,!1);case 1:return ko(e.type,!0);case 31:return Hn("Activity");default:return""}}function vu(e){try{var t="";do t+=Zg(e),e=e.return;while(e);return t}catch(a){return`
|
|
47
|
-
Error generating stack: `+a.message+`
|
|
48
|
-
`+a.stack}}function Ut(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jg(e){var t=wu(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var i=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(x){n=""+x,u.call(this,x)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(x){n=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zl(e){e._valueTracker||(e._valueTracker=Jg(e))}function ju(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=wu(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Jl(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 Ig=/[\n"\\]/g;function Lt(e){return e.replace(Ig,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Eo(e,t,a,n,i,u,x,b){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ut(t)):e.value!==""+Ut(t)&&(e.value=""+Ut(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?To(e,x,Ut(t)):a!=null?To(e,x,Ut(a)):n!=null&&e.removeAttribute("value"),i==null&&u!=null&&(e.defaultChecked=!!u),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+Ut(b):e.removeAttribute("name")}function Su(e,t,a,n,i,u,x,b){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null))return;a=a!=null?""+Ut(a):"",t=t!=null?""+Ut(t):a,b||t===e.value||(e.value=t),e.defaultValue=t}n=n??i,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=b?e.checked:!!n,e.defaultChecked=!!n,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x)}function To(e,t,a){t==="number"&&Jl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Bn(e,t,a,n){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Ut(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Nu(e,t,a){if(t!=null&&(t=""+Ut(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Ut(a):""}function Cu(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(c(92));if(V(n)){if(1<n.length)throw Error(c(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Ut(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n)}function Vn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Wg=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 ku(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||Wg.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Eu(e,t,a){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var i in t)n=t[i],t.hasOwnProperty(i)&&a[i]!==n&&ku(e,i,n)}else for(var u in t)t.hasOwnProperty(u)&&ku(e,u,t[u])}function Ao(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 ep=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"]]),tp=/^[\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 Il(e){return tp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Ro=null;function Oo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qn=null,Gn=null;function Tu(e){var t=Un(e);if(t&&(e=t.stateNode)){var a=e[yt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Eo(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="'+Lt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var i=n[yt]||null;if(!i)throw Error(c(90));Eo(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&ju(n)}break e;case"textarea":Nu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Bn(e,!!a.multiple,t,!1)}}}var Mo=!1;function Au(e,t,a){if(Mo)return e(t,a);Mo=!0;try{var n=e(t);return n}finally{if(Mo=!1,(qn!==null||Gn!==null)&&(_r(),qn&&(t=qn,e=Gn,Gn=qn=null,Tu(t),e)))for(t=0;t<e.length;t++)Tu(e[t])}}function Ds(e,t){var a=e.stateNode;if(a===null)return null;var n=a[yt]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(c(231,t,typeof a));return a}var ma=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zo=!1;if(ma)try{var Us={};Object.defineProperty(Us,"passive",{get:function(){zo=!0}}),window.addEventListener("test",Us,Us),window.removeEventListener("test",Us,Us)}catch{zo=!1}var Ua=null,Do=null,Wl=null;function Ru(){if(Wl)return Wl;var e,t=Do,a=t.length,n,i="value"in Ua?Ua.value:Ua.textContent,u=i.length;for(e=0;e<a&&t[e]===i[e];e++);var x=a-e;for(n=1;n<=x&&t[a-n]===i[u-n];n++);return Wl=i.slice(e,1<n?1-n:void 0)}function er(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 tr(){return!0}function Ou(){return!1}function wt(e){function t(a,n,i,u,x){this._reactName=a,this._targetInst=i,this.type=n,this.nativeEvent=u,this.target=x,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(a=e[b],this[b]=a?a(u):u[b]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?tr:Ou,this.isPropagationStopped=Ou,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=tr)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=tr)},persist:function(){},isPersistent:tr}),t}var mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ar=wt(mn),Ls=y({},mn,{view:0,detail:0}),ap=wt(Ls),Uo,Lo,_s,nr=y({},Ls,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ho,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!==_s&&(_s&&e.type==="mousemove"?(Uo=e.screenX-_s.screenX,Lo=e.screenY-_s.screenY):Lo=Uo=0,_s=e),Uo)},movementY:function(e){return"movementY"in e?e.movementY:Lo}}),Mu=wt(nr),np=y({},nr,{dataTransfer:0}),sp=wt(np),lp=y({},Ls,{relatedTarget:0}),_o=wt(lp),rp=y({},mn,{animationName:0,elapsedTime:0,pseudoElement:0}),op=wt(rp),ip=y({},mn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cp=wt(ip),up=y({},mn,{data:0}),zu=wt(up),dp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fp={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"},mp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=mp[e])?!!t[e]:!1}function Ho(){return hp}var gp=y({},Ls,{key:function(e){if(e.key){var t=dp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=er(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ho,charCode:function(e){return e.type==="keypress"?er(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?er(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pp=wt(gp),xp=y({},nr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Du=wt(xp),yp=y({},Ls,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ho}),bp=wt(yp),vp=y({},mn,{propertyName:0,elapsedTime:0,pseudoElement:0}),wp=wt(vp),jp=y({},nr,{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}),Sp=wt(jp),Np=y({},mn,{newState:0,oldState:0}),Cp=wt(Np),kp=[9,13,27,32],Bo=ma&&"CompositionEvent"in window,Hs=null;ma&&"documentMode"in document&&(Hs=document.documentMode);var Ep=ma&&"TextEvent"in window&&!Hs,Uu=ma&&(!Bo||Hs&&8<Hs&&11>=Hs),Lu=" ",_u=!1;function Hu(e,t){switch(e){case"keyup":return kp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $n=!1;function Tp(e,t){switch(e){case"compositionend":return Bu(t);case"keypress":return t.which!==32?null:(_u=!0,Lu);case"textInput":return e=t.data,e===Lu&&_u?null:e;default:return null}}function Ap(e,t){if($n)return e==="compositionend"||!Bo&&Hu(e,t)?(e=Ru(),Wl=Do=Ua=null,$n=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Uu&&t.locale!=="ko"?null:t.data;default:return null}}var Rp={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 Vu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Rp[e.type]:t==="textarea"}function qu(e,t,a,n){qn?Gn?Gn.push(n):Gn=[n]:qn=n,t=$r(t,"onChange"),0<t.length&&(a=new ar("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Bs=null,Vs=null;function Op(e){jm(e,0)}function sr(e){var t=zs(e);if(ju(t))return e}function Gu(e,t){if(e==="change")return t}var $u=!1;if(ma){var Vo;if(ma){var qo="oninput"in document;if(!qo){var Ku=document.createElement("div");Ku.setAttribute("oninput","return;"),qo=typeof Ku.oninput=="function"}Vo=qo}else Vo=!1;$u=Vo&&(!document.documentMode||9<document.documentMode)}function Yu(){Bs&&(Bs.detachEvent("onpropertychange",Pu),Vs=Bs=null)}function Pu(e){if(e.propertyName==="value"&&sr(Vs)){var t=[];qu(t,Vs,e,Oo(e)),Au(Op,t)}}function Mp(e,t,a){e==="focusin"?(Yu(),Bs=t,Vs=a,Bs.attachEvent("onpropertychange",Pu)):e==="focusout"&&Yu()}function zp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return sr(Vs)}function Dp(e,t){if(e==="click")return sr(t)}function Up(e,t){if(e==="input"||e==="change")return sr(t)}function Lp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Et=typeof Object.is=="function"?Object.is:Lp;function qs(e,t){if(Et(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var i=a[n];if(!De.call(t,i)||!Et(e[i],t[i]))return!1}return!0}function Xu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qu(e,t){var a=Xu(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Xu(a)}}function Fu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Jl(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=Jl(e.document)}return t}function Go(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var _p=ma&&"documentMode"in document&&11>=document.documentMode,Kn=null,$o=null,Gs=null,Ko=!1;function Ju(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ko||Kn==null||Kn!==Jl(n)||(n=Kn,"selectionStart"in n&&Go(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Gs&&qs(Gs,n)||(Gs=n,n=$r($o,"onSelect"),0<n.length&&(t=new ar("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Kn)))}function hn(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Yn={animationend:hn("Animation","AnimationEnd"),animationiteration:hn("Animation","AnimationIteration"),animationstart:hn("Animation","AnimationStart"),transitionrun:hn("Transition","TransitionRun"),transitionstart:hn("Transition","TransitionStart"),transitioncancel:hn("Transition","TransitionCancel"),transitionend:hn("Transition","TransitionEnd")},Yo={},Iu={};ma&&(Iu=document.createElement("div").style,"AnimationEvent"in window||(delete Yn.animationend.animation,delete Yn.animationiteration.animation,delete Yn.animationstart.animation),"TransitionEvent"in window||delete Yn.transitionend.transition);function gn(e){if(Yo[e])return Yo[e];if(!Yn[e])return e;var t=Yn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Iu)return Yo[e]=t[a];return e}var Wu=gn("animationend"),ed=gn("animationiteration"),td=gn("animationstart"),Hp=gn("transitionrun"),Bp=gn("transitionstart"),Vp=gn("transitioncancel"),ad=gn("transitionend"),nd=new Map,Po="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(" ");Po.push("scrollEnd");function Zt(e,t){nd.set(e,t),fn(t,[e])}var sd=new WeakMap;function _t(e,t){if(typeof e=="object"&&e!==null){var a=sd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:vu(t)},sd.set(e,t),t)}return{value:e,source:t,stack:vu(t)}}var Ht=[],Pn=0,Xo=0;function lr(){for(var e=Pn,t=Xo=Pn=0;t<e;){var a=Ht[t];Ht[t++]=null;var n=Ht[t];Ht[t++]=null;var i=Ht[t];Ht[t++]=null;var u=Ht[t];if(Ht[t++]=null,n!==null&&i!==null){var x=n.pending;x===null?i.next=i:(i.next=x.next,x.next=i),n.pending=i}u!==0&&ld(a,i,u)}}function rr(e,t,a,n){Ht[Pn++]=e,Ht[Pn++]=t,Ht[Pn++]=a,Ht[Pn++]=n,Xo|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Qo(e,t,a,n){return rr(e,t,a,n),or(e)}function Xn(e,t){return rr(e,null,null,t),or(e)}function ld(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var i=!1,u=e.return;u!==null;)u.childLanes|=a,n=u.alternate,n!==null&&(n.childLanes|=a),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(i=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,i&&t!==null&&(i=31-ht(a),e=u.hiddenUpdates,n=e[i],n===null?e[i]=[t]:n.push(t),t.lane=a|536870912),u):null}function or(e){if(50<ml)throw ml=0,ec=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qn={};function qp(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(e,t,a,n){return new qp(e,t,a,n)}function Fo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ha(e,t){var a=e.alternate;return a===null?(a=Tt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function rd(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 ir(e,t,a,n,i,u){var x=0;if(n=e,typeof e=="function")Fo(e)&&(x=1);else if(typeof e=="string")x=$0(e,a,de.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Z:return e=Tt(31,a,t,i),e.elementType=Z,e.lanes=u,e;case N:return pn(a.children,i,u,t);case O:x=8,i|=24;break;case R:return e=Tt(12,a,t,i|2),e.elementType=R,e.lanes=u,e;case L:return e=Tt(13,a,t,i),e.elementType=L,e.lanes=u,e;case I:return e=Tt(19,a,t,i),e.elementType=I,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S:case z:x=10;break e;case C:x=9;break e;case P:x=11;break e;case K:x=14;break e;case B:x=16,n=null;break e}x=29,a=Error(c(130,e===null?"null":typeof e,"")),n=null}return t=Tt(x,a,t,i),t.elementType=e,t.type=n,t.lanes=u,t}function pn(e,t,a,n){return e=Tt(7,e,n,t),e.lanes=a,e}function Zo(e,t,a){return e=Tt(6,e,null,t),e.lanes=a,e}function Jo(e,t,a){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fn=[],Zn=0,cr=null,ur=0,Bt=[],Vt=0,xn=null,ga=1,pa="";function yn(e,t){Fn[Zn++]=ur,Fn[Zn++]=cr,cr=e,ur=t}function od(e,t,a){Bt[Vt++]=ga,Bt[Vt++]=pa,Bt[Vt++]=xn,xn=e;var n=ga;e=pa;var i=32-ht(n)-1;n&=~(1<<i),a+=1;var u=32-ht(t)+i;if(30<u){var x=i-i%5;u=(n&(1<<x)-1).toString(32),n>>=x,i-=x,ga=1<<32-ht(t)+i|a<<i|n,pa=u+e}else ga=1<<u|a<<i|n,pa=e}function Io(e){e.return!==null&&(yn(e,1),od(e,1,0))}function Wo(e){for(;e===cr;)cr=Fn[--Zn],Fn[Zn]=null,ur=Fn[--Zn],Fn[Zn]=null;for(;e===xn;)xn=Bt[--Vt],Bt[Vt]=null,pa=Bt[--Vt],Bt[Vt]=null,ga=Bt[--Vt],Bt[Vt]=null}var bt=null,Qe=null,Ue=!1,bn=null,na=!1,ei=Error(c(519));function vn(e){var t=Error(c(418,""));throw Ys(_t(t,e)),ei}function id(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[at]=e,t[yt]=n,a){case"dialog":Oe("cancel",t),Oe("close",t);break;case"iframe":case"object":case"embed":Oe("load",t);break;case"video":case"audio":for(a=0;a<gl.length;a++)Oe(gl[a],t);break;case"source":Oe("error",t);break;case"img":case"image":case"link":Oe("error",t),Oe("load",t);break;case"details":Oe("toggle",t);break;case"input":Oe("invalid",t),Su(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0),Zl(t);break;case"select":Oe("invalid",t);break;case"textarea":Oe("invalid",t),Cu(t,n.value,n.defaultValue,n.children),Zl(t)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||km(t.textContent,a)?(n.popover!=null&&(Oe("beforetoggle",t),Oe("toggle",t)),n.onScroll!=null&&Oe("scroll",t),n.onScrollEnd!=null&&Oe("scrollend",t),n.onClick!=null&&(t.onclick=Kr),t=!0):t=!1,t||vn(e)}function cd(e){for(bt=e.return;bt;)switch(bt.tag){case 5:case 13:na=!1;return;case 27:case 3:na=!0;return;default:bt=bt.return}}function $s(e){if(e!==bt)return!1;if(!Ue)return cd(e),Ue=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||pc(e.type,e.memoizedProps)),a=!a),a&&Qe&&vn(e),cd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(a=e.data,a==="/$"){if(t===0){Qe=It(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++;e=e.nextSibling}Qe=null}}else t===27?(t=Qe,Ja(e.type)?(e=vc,vc=null,Qe=e):Qe=t):Qe=bt?It(e.stateNode.nextSibling):null;return!0}function Ks(){Qe=bt=null,Ue=!1}function ud(){var e=bn;return e!==null&&(Nt===null?Nt=e:Nt.push.apply(Nt,e),bn=null),e}function Ys(e){bn===null?bn=[e]:bn.push(e)}var ti=X(null),wn=null,xa=null;function La(e,t,a){ne(ti,t._currentValue),t._currentValue=a}function ya(e){e._currentValue=ti.current,le(ti)}function ai(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function ni(e,t,a,n){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var u=i.dependencies;if(u!==null){var x=i.child;u=u.firstContext;e:for(;u!==null;){var b=u;u=i;for(var T=0;T<t.length;T++)if(b.context===t[T]){u.lanes|=a,b=u.alternate,b!==null&&(b.lanes|=a),ai(u.return,a,e),n||(x=null);break e}u=b.next}}else if(i.tag===18){if(x=i.return,x===null)throw Error(c(341));x.lanes|=a,u=x.alternate,u!==null&&(u.lanes|=a),ai(x,a,e),x=null}else x=i.child;if(x!==null)x.return=i;else for(x=i;x!==null;){if(x===e){x=null;break}if(i=x.sibling,i!==null){i.return=x.return,x=i;break}x=x.return}i=x}}function Ps(e,t,a,n){e=null;for(var i=t,u=!1;i!==null;){if(!u){if((i.flags&524288)!==0)u=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var x=i.alternate;if(x===null)throw Error(c(387));if(x=x.memoizedProps,x!==null){var b=i.type;Et(i.pendingProps.value,x.value)||(e!==null?e.push(b):e=[b])}}else if(i===re.current){if(x=i.alternate,x===null)throw Error(c(387));x.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(wl):e=[wl])}i=i.return}e!==null&&ni(t,e,a,n),t.flags|=262144}function dr(e){for(e=e.firstContext;e!==null;){if(!Et(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function jn(e){wn=e,xa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function gt(e){return dd(wn,e)}function fr(e,t){return wn===null&&jn(e),dd(e,t)}function dd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},xa===null){if(e===null)throw Error(c(308));xa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else xa=xa.next=t;return a}var Gp=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},$p=s.unstable_scheduleCallback,Kp=s.unstable_NormalPriority,nt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function si(){return{controller:new Gp,data:new Map,refCount:0}}function Xs(e){e.refCount--,e.refCount===0&&$p(Kp,function(){e.controller.abort()})}var Qs=null,li=0,Jn=0,In=null;function Yp(e,t){if(Qs===null){var a=Qs=[];li=0,Jn=oc(),In={status:"pending",value:void 0,then:function(n){a.push(n)}}}return li++,t.then(fd,fd),t}function fd(){if(--li===0&&Qs!==null){In!==null&&(In.status="fulfilled");var e=Qs;Qs=null,Jn=0,In=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Pp(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(n.status="rejected",n.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),n}var md=k.S;k.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&Yp(e,t),md!==null&&md(e,t)};var Sn=X(null);function ri(){var e=Sn.current;return e!==null?e:Ke.pooledCache}function mr(e,t){t===null?ne(Sn,Sn.current):ne(Sn,t.pool)}function hd(){var e=ri();return e===null?null:{parent:nt._currentValue,pool:e}}var Fs=Error(c(460)),gd=Error(c(474)),hr=Error(c(542)),oi={then:function(){}};function pd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function gr(){}function xd(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(gr,gr),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,bd(e),e;default:if(typeof t.status=="string")t.then(gr,gr);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=n}},function(n){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,bd(e),e}throw Zs=t,Fs}}var Zs=null;function yd(){if(Zs===null)throw Error(c(459));var e=Zs;return Zs=null,e}function bd(e){if(e===Fs||e===hr)throw Error(c(483))}var _a=!1;function ii(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ci(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 Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(_e&2)!==0){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,t=or(e),ld(e,null,a),t}return rr(e,n,t,a),or(e)}function Js(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,kt(e,a)}}function ui(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var i=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?i=u=x:u=u.next=x,a=a.next}while(a!==null);u===null?i=u=t:u=u.next=t}else i=u=t;a={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:u,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var di=!1;function Is(){if(di){var e=In;if(e!==null)throw e}}function Ws(e,t,a,n){di=!1;var i=e.updateQueue;_a=!1;var u=i.firstBaseUpdate,x=i.lastBaseUpdate,b=i.shared.pending;if(b!==null){i.shared.pending=null;var T=b,$=T.next;T.next=null,x===null?u=$:x.next=$,x=T;var J=e.alternate;J!==null&&(J=J.updateQueue,b=J.lastBaseUpdate,b!==x&&(b===null?J.firstBaseUpdate=$:b.next=$,J.lastBaseUpdate=T))}if(u!==null){var ee=i.baseState;x=0,J=$=T=null,b=u;do{var Y=b.lane&-536870913,Q=Y!==b.lane;if(Q?(Me&Y)===Y:(n&Y)===Y){Y!==0&&Y===Jn&&(di=!0),J!==null&&(J=J.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ve=e,ye=b;Y=t;var Ge=a;switch(ye.tag){case 1:if(ve=ye.payload,typeof ve=="function"){ee=ve.call(Ge,ee,Y);break e}ee=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=ye.payload,Y=typeof ve=="function"?ve.call(Ge,ee,Y):ve,Y==null)break e;ee=y({},ee,Y);break e;case 2:_a=!0}}Y=b.callback,Y!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=i.callbacks,Q===null?i.callbacks=[Y]:Q.push(Y))}else Q={lane:Y,tag:b.tag,payload:b.payload,callback:b.callback,next:null},J===null?($=J=Q,T=ee):J=J.next=Q,x|=Y;if(b=b.next,b===null){if(b=i.shared.pending,b===null)break;Q=b,b=Q.next,Q.next=null,i.lastBaseUpdate=Q,i.shared.pending=null}}while(!0);J===null&&(T=ee),i.baseState=T,i.firstBaseUpdate=$,i.lastBaseUpdate=J,u===null&&(i.shared.lanes=0),Xa|=x,e.lanes=x,e.memoizedState=ee}}function vd(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function wd(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)vd(a[e],t)}var Wn=X(null),pr=X(0);function jd(e,t){e=Ca,ne(pr,e),ne(Wn,t),Ca=e|t.baseLanes}function fi(){ne(pr,Ca),ne(Wn,Wn.current)}function mi(){Ca=pr.current,le(Wn),le(pr)}var Va=0,Ee=null,Ve=null,et=null,xr=!1,es=!1,Nn=!1,yr=0,el=0,ts=null,Xp=0;function Ie(){throw Error(c(321))}function hi(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Et(e[a],t[a]))return!1;return!0}function gi(e,t,a,n,i,u){return Va=u,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?lf:rf,Nn=!1,u=a(n,i),Nn=!1,es&&(u=Nd(t,a,n,i)),Sd(e),u}function Sd(e){k.H=Nr;var t=Ve!==null&&Ve.next!==null;if(Va=0,et=Ve=Ee=null,xr=!1,el=0,ts=null,t)throw Error(c(300));e===null||ot||(e=e.dependencies,e!==null&&dr(e)&&(ot=!0))}function Nd(e,t,a,n){Ee=e;var i=0;do{if(es&&(ts=null),el=0,es=!1,25<=i)throw Error(c(301));if(i+=1,et=Ve=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}k.H=e0,u=t(a,n)}while(es);return u}function Qp(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?tl(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Ee.flags|=1024),t}function pi(){var e=yr!==0;return yr=0,e}function xi(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function yi(e){if(xr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xr=!1}Va=0,et=Ve=Ee=null,es=!1,el=yr=0,ts=null}function jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?Ee.memoizedState=et=e:et=et.next=e,et}function tt(){if(Ve===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=et===null?Ee.memoizedState:et.next;if(t!==null)et=t,Ve=e;else{if(e===null)throw Ee.alternate===null?Error(c(467)):Error(c(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},et===null?Ee.memoizedState=et=e:et=et.next=e}return et}function bi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tl(e){var t=el;return el+=1,ts===null&&(ts=[]),e=xd(ts,e,t),t=Ee,(et===null?t.memoizedState:et.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?lf:rf),e}function br(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return tl(e);if(e.$$typeof===z)return gt(e)}throw Error(c(438,String(e)))}function vi(e){var t=null,a=Ee.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Ee.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=bi(),Ee.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=te;return t.index++,a}function ba(e,t){return typeof t=="function"?t(e):t}function vr(e){var t=tt();return wi(t,Ve,e)}function wi(e,t,a){var n=e.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=a;var i=e.baseQueue,u=n.pending;if(u!==null){if(i!==null){var x=i.next;i.next=u.next,u.next=x}t.baseQueue=i=u,n.pending=null}if(u=e.baseState,i===null)e.memoizedState=u;else{t=i.next;var b=x=null,T=null,$=t,J=!1;do{var ee=$.lane&-536870913;if(ee!==$.lane?(Me&ee)===ee:(Va&ee)===ee){var Y=$.revertLane;if(Y===0)T!==null&&(T=T.next={lane:0,revertLane:0,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),ee===Jn&&(J=!0);else if((Va&Y)===Y){$=$.next,Y===Jn&&(J=!0);continue}else ee={lane:0,revertLane:$.revertLane,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},T===null?(b=T=ee,x=u):T=T.next=ee,Ee.lanes|=Y,Xa|=Y;ee=$.action,Nn&&a(u,ee),u=$.hasEagerState?$.eagerState:a(u,ee)}else Y={lane:ee,revertLane:$.revertLane,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},T===null?(b=T=Y,x=u):T=T.next=Y,Ee.lanes|=ee,Xa|=ee;$=$.next}while($!==null&&$!==t);if(T===null?x=u:T.next=b,!Et(u,e.memoizedState)&&(ot=!0,J&&(a=In,a!==null)))throw a;e.memoizedState=u,e.baseState=x,e.baseQueue=T,n.lastRenderedState=u}return i===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function ji(e){var t=tt(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var n=a.dispatch,i=a.pending,u=t.memoizedState;if(i!==null){a.pending=null;var x=i=i.next;do u=e(u,x.action),x=x.next;while(x!==i);Et(u,t.memoizedState)||(ot=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),a.lastRenderedState=u}return[u,n]}function Cd(e,t,a){var n=Ee,i=tt(),u=Ue;if(u){if(a===void 0)throw Error(c(407));a=a()}else a=t();var x=!Et((Ve||i).memoizedState,a);x&&(i.memoizedState=a,ot=!0),i=i.queue;var b=Td.bind(null,n,i,e);if(al(2048,8,b,[e]),i.getSnapshot!==t||x||et!==null&&et.memoizedState.tag&1){if(n.flags|=2048,as(9,wr(),Ed.bind(null,n,i,a,t),null),Ke===null)throw Error(c(349));u||(Va&124)!==0||kd(n,t,a)}return a}function kd(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ee.updateQueue,t===null?(t=bi(),Ee.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Ed(e,t,a,n){t.value=a,t.getSnapshot=n,Ad(t)&&Rd(e)}function Td(e,t,a){return a(function(){Ad(t)&&Rd(e)})}function Ad(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Et(e,a)}catch{return!0}}function Rd(e){var t=Xn(e,2);t!==null&&zt(t,e,2)}function Si(e){var t=jt();if(typeof e=="function"){var a=e;if(e=a(),Nn){Yt(!0);try{a()}finally{Yt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:e},t}function Od(e,t,a,n){return e.baseState=a,wi(e,Ve,typeof n=="function"?n:ba)}function Fp(e,t,a,n,i){if(Sr(e))throw Error(c(485));if(e=t.action,e!==null){var u={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){u.listeners.push(x)}};k.T!==null?a(!0):u.isTransition=!1,n(u),a=t.pending,a===null?(u.next=t.pending=u,Md(t,u)):(u.next=a.next,t.pending=a.next=u)}}function Md(e,t){var a=t.action,n=t.payload,i=e.state;if(t.isTransition){var u=k.T,x={};k.T=x;try{var b=a(i,n),T=k.S;T!==null&&T(x,b),zd(e,t,b)}catch($){Ni(e,t,$)}finally{k.T=u}}else try{u=a(i,n),zd(e,t,u)}catch($){Ni(e,t,$)}}function zd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Dd(e,t,n)},function(n){return Ni(e,t,n)}):Dd(e,t,a)}function Dd(e,t,a){t.status="fulfilled",t.value=a,Ud(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Md(e,a)))}function Ni(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,Ud(t),t=t.next;while(t!==n)}e.action=null}function Ud(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ld(e,t){return t}function _d(e,t){if(Ue){var a=Ke.formState;if(a!==null){e:{var n=Ee;if(Ue){if(Qe){t:{for(var i=Qe,u=na;i.nodeType!==8;){if(!u){i=null;break t}if(i=It(i.nextSibling),i===null){i=null;break t}}u=i.data,i=u==="F!"||u==="F"?i:null}if(i){Qe=It(i.nextSibling),n=i.data==="F!";break e}}vn(n)}n=!1}n&&(t=a[0])}}return a=jt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ld,lastRenderedState:t},a.queue=n,a=af.bind(null,Ee,n),n.dispatch=a,n=Si(!1),u=Ai.bind(null,Ee,!1,n.queue),n=jt(),i={state:t,dispatch:null,action:e,pending:null},n.queue=i,a=Fp.bind(null,Ee,i,u,a),i.dispatch=a,n.memoizedState=e,[t,a,!1]}function Hd(e){var t=tt();return Bd(t,Ve,e)}function Bd(e,t,a){if(t=wi(e,t,Ld)[0],e=vr(ba)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=tl(t)}catch(x){throw x===Fs?hr:x}else n=t;t=tt();var i=t.queue,u=i.dispatch;return a!==t.memoizedState&&(Ee.flags|=2048,as(9,wr(),Zp.bind(null,i,a),null)),[n,u,e]}function Zp(e,t){e.action=t}function Vd(e){var t=tt(),a=Ve;if(a!==null)return Bd(t,a,e);tt(),t=t.memoizedState,a=tt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function as(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=bi(),Ee.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function wr(){return{destroy:void 0,resource:void 0}}function qd(){return tt().memoizedState}function jr(e,t,a,n){var i=jt();n=n===void 0?null:n,Ee.flags|=e,i.memoizedState=as(1|t,wr(),a,n)}function al(e,t,a,n){var i=tt();n=n===void 0?null:n;var u=i.memoizedState.inst;Ve!==null&&n!==null&&hi(n,Ve.memoizedState.deps)?i.memoizedState=as(t,u,a,n):(Ee.flags|=e,i.memoizedState=as(1|t,u,a,n))}function Gd(e,t){jr(8390656,8,e,t)}function $d(e,t){al(2048,8,e,t)}function Kd(e,t){return al(4,2,e,t)}function Yd(e,t){return al(4,4,e,t)}function Pd(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 Xd(e,t,a){a=a!=null?a.concat([e]):null,al(4,4,Pd.bind(null,t,e),a)}function Ci(){}function Qd(e,t){var a=tt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&hi(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function Fd(e,t){var a=tt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&hi(t,n[1]))return n[0];if(n=e(),Nn){Yt(!0);try{e()}finally{Yt(!1)}}return a.memoizedState=[n,t],n}function ki(e,t,a){return a===void 0||(Va&1073741824)!==0?e.memoizedState=t:(e.memoizedState=a,e=Wf(),Ee.lanes|=e,Xa|=e,a)}function Zd(e,t,a,n){return Et(a,t)?a:Wn.current!==null?(e=ki(e,a,n),Et(e,t)||(ot=!0),e):(Va&42)===0?(ot=!0,e.memoizedState=a):(e=Wf(),Ee.lanes|=e,Xa|=e,t)}function Jd(e,t,a,n,i){var u=G.p;G.p=u!==0&&8>u?u:8;var x=k.T,b={};k.T=b,Ai(e,!1,t,a);try{var T=i(),$=k.S;if($!==null&&$(b,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var J=Pp(T,n);nl(e,t,J,Mt(e))}else nl(e,t,n,Mt(e))}catch(ee){nl(e,t,{then:function(){},status:"rejected",reason:ee},Mt())}finally{G.p=u,k.T=x}}function Jp(){}function Ei(e,t,a,n){if(e.tag!==5)throw Error(c(476));var i=Id(e).queue;Jd(e,i,t,F,a===null?Jp:function(){return Wd(e),a(n)})}function Id(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:F},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Wd(e){var t=Id(e).next.queue;nl(e,t,{},Mt())}function Ti(){return gt(wl)}function ef(){return tt().memoizedState}function tf(){return tt().memoizedState}function Ip(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Mt();e=Ha(a);var n=Ba(t,e,a);n!==null&&(zt(n,t,a),Js(n,t,a)),t={cache:si()},e.payload=t;return}t=t.return}}function Wp(e,t,a){var n=Mt();a={lane:n,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Sr(e)?nf(t,a):(a=Qo(e,t,a,n),a!==null&&(zt(a,e,n),sf(a,t,n)))}function af(e,t,a){var n=Mt();nl(e,t,a,n)}function nl(e,t,a,n){var i={lane:n,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Sr(e))nf(t,i);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var x=t.lastRenderedState,b=u(x,a);if(i.hasEagerState=!0,i.eagerState=b,Et(b,x))return rr(e,t,i,0),Ke===null&&lr(),!1}catch{}finally{}if(a=Qo(e,t,i,n),a!==null)return zt(a,e,n),sf(a,t,n),!0}return!1}function Ai(e,t,a,n){if(n={lane:2,revertLane:oc(),action:n,hasEagerState:!1,eagerState:null,next:null},Sr(e)){if(t)throw Error(c(479))}else t=Qo(e,a,n,2),t!==null&&zt(t,e,2)}function Sr(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function nf(e,t){es=xr=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function sf(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,kt(e,a)}}var Nr={readContext:gt,use:br,useCallback:Ie,useContext:Ie,useEffect:Ie,useImperativeHandle:Ie,useLayoutEffect:Ie,useInsertionEffect:Ie,useMemo:Ie,useReducer:Ie,useRef:Ie,useState:Ie,useDebugValue:Ie,useDeferredValue:Ie,useTransition:Ie,useSyncExternalStore:Ie,useId:Ie,useHostTransitionStatus:Ie,useFormState:Ie,useActionState:Ie,useOptimistic:Ie,useMemoCache:Ie,useCacheRefresh:Ie},lf={readContext:gt,use:br,useCallback:function(e,t){return jt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:Gd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,jr(4194308,4,Pd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return jr(4194308,4,e,t)},useInsertionEffect:function(e,t){jr(4,2,e,t)},useMemo:function(e,t){var a=jt();t=t===void 0?null:t;var n=e();if(Nn){Yt(!0);try{e()}finally{Yt(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=jt();if(a!==void 0){var i=a(t);if(Nn){Yt(!0);try{a(t)}finally{Yt(!1)}}}else i=t;return n.memoizedState=n.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},n.queue=e,e=e.dispatch=Wp.bind(null,Ee,e),[n.memoizedState,e]},useRef:function(e){var t=jt();return e={current:e},t.memoizedState=e},useState:function(e){e=Si(e);var t=e.queue,a=af.bind(null,Ee,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Ci,useDeferredValue:function(e,t){var a=jt();return ki(a,e,t)},useTransition:function(){var e=Si(!1);return e=Jd.bind(null,Ee,e.queue,!0,!1),jt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Ee,i=jt();if(Ue){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),Ke===null)throw Error(c(349));(Me&124)!==0||kd(n,t,a)}i.memoizedState=a;var u={value:a,getSnapshot:t};return i.queue=u,Gd(Td.bind(null,n,u,e),[e]),n.flags|=2048,as(9,wr(),Ed.bind(null,n,u,a,t),null),a},useId:function(){var e=jt(),t=Ke.identifierPrefix;if(Ue){var a=pa,n=ga;a=(n&~(1<<32-ht(n)-1)).toString(32)+a,t="«"+t+"R"+a,a=yr++,0<a&&(t+="H"+a.toString(32)),t+="»"}else a=Xp++,t="«"+t+"r"+a.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Ti,useFormState:_d,useActionState:_d,useOptimistic:function(e){var t=jt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Ai.bind(null,Ee,!0,a),a.dispatch=t,[e,t]},useMemoCache:vi,useCacheRefresh:function(){return jt().memoizedState=Ip.bind(null,Ee)}},rf={readContext:gt,use:br,useCallback:Qd,useContext:gt,useEffect:$d,useImperativeHandle:Xd,useInsertionEffect:Kd,useLayoutEffect:Yd,useMemo:Fd,useReducer:vr,useRef:qd,useState:function(){return vr(ba)},useDebugValue:Ci,useDeferredValue:function(e,t){var a=tt();return Zd(a,Ve.memoizedState,e,t)},useTransition:function(){var e=vr(ba)[0],t=tt().memoizedState;return[typeof e=="boolean"?e:tl(e),t]},useSyncExternalStore:Cd,useId:ef,useHostTransitionStatus:Ti,useFormState:Hd,useActionState:Hd,useOptimistic:function(e,t){var a=tt();return Od(a,Ve,e,t)},useMemoCache:vi,useCacheRefresh:tf},e0={readContext:gt,use:br,useCallback:Qd,useContext:gt,useEffect:$d,useImperativeHandle:Xd,useInsertionEffect:Kd,useLayoutEffect:Yd,useMemo:Fd,useReducer:ji,useRef:qd,useState:function(){return ji(ba)},useDebugValue:Ci,useDeferredValue:function(e,t){var a=tt();return Ve===null?ki(a,e,t):Zd(a,Ve.memoizedState,e,t)},useTransition:function(){var e=ji(ba)[0],t=tt().memoizedState;return[typeof e=="boolean"?e:tl(e),t]},useSyncExternalStore:Cd,useId:ef,useHostTransitionStatus:Ti,useFormState:Vd,useActionState:Vd,useOptimistic:function(e,t){var a=tt();return Ve!==null?Od(a,Ve,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:vi,useCacheRefresh:tf},ns=null,sl=0;function Cr(e){var t=sl;return sl+=1,ns===null&&(ns=[]),xd(ns,e,t)}function ll(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function kr(e,t){throw t.$$typeof===j?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function of(e){var t=e._init;return t(e._payload)}function cf(e){function t(H,M){if(e){var q=H.deletions;q===null?(H.deletions=[M],H.flags|=16):q.push(M)}}function a(H,M){if(!e)return null;for(;M!==null;)t(H,M),M=M.sibling;return null}function n(H){for(var M=new Map;H!==null;)H.key!==null?M.set(H.key,H):M.set(H.index,H),H=H.sibling;return M}function i(H,M){return H=ha(H,M),H.index=0,H.sibling=null,H}function u(H,M,q){return H.index=q,e?(q=H.alternate,q!==null?(q=q.index,q<M?(H.flags|=67108866,M):q):(H.flags|=67108866,M)):(H.flags|=1048576,M)}function x(H){return e&&H.alternate===null&&(H.flags|=67108866),H}function b(H,M,q,W){return M===null||M.tag!==6?(M=Zo(q,H.mode,W),M.return=H,M):(M=i(M,q),M.return=H,M)}function T(H,M,q,W){var fe=q.type;return fe===N?J(H,M,q.props.children,W,q.key):M!==null&&(M.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===B&&of(fe)===M.type)?(M=i(M,q.props),ll(M,q),M.return=H,M):(M=ir(q.type,q.key,q.props,null,H.mode,W),ll(M,q),M.return=H,M)}function $(H,M,q,W){return M===null||M.tag!==4||M.stateNode.containerInfo!==q.containerInfo||M.stateNode.implementation!==q.implementation?(M=Jo(q,H.mode,W),M.return=H,M):(M=i(M,q.children||[]),M.return=H,M)}function J(H,M,q,W,fe){return M===null||M.tag!==7?(M=pn(q,H.mode,W,fe),M.return=H,M):(M=i(M,q),M.return=H,M)}function ee(H,M,q){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=Zo(""+M,H.mode,q),M.return=H,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case v:return q=ir(M.type,M.key,M.props,null,H.mode,q),ll(q,M),q.return=H,q;case A:return M=Jo(M,H.mode,q),M.return=H,M;case B:var W=M._init;return M=W(M._payload),ee(H,M,q)}if(V(M)||U(M))return M=pn(M,H.mode,q,null),M.return=H,M;if(typeof M.then=="function")return ee(H,Cr(M),q);if(M.$$typeof===z)return ee(H,fr(H,M),q);kr(H,M)}return null}function Y(H,M,q,W){var fe=M!==null?M.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return fe!==null?null:b(H,M,""+q,W);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return q.key===fe?T(H,M,q,W):null;case A:return q.key===fe?$(H,M,q,W):null;case B:return fe=q._init,q=fe(q._payload),Y(H,M,q,W)}if(V(q)||U(q))return fe!==null?null:J(H,M,q,W,null);if(typeof q.then=="function")return Y(H,M,Cr(q),W);if(q.$$typeof===z)return Y(H,M,fr(H,q),W);kr(H,q)}return null}function Q(H,M,q,W,fe){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return H=H.get(q)||null,b(M,H,""+W,fe);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case v:return H=H.get(W.key===null?q:W.key)||null,T(M,H,W,fe);case A:return H=H.get(W.key===null?q:W.key)||null,$(M,H,W,fe);case B:var Ae=W._init;return W=Ae(W._payload),Q(H,M,q,W,fe)}if(V(W)||U(W))return H=H.get(q)||null,J(M,H,W,fe,null);if(typeof W.then=="function")return Q(H,M,q,Cr(W),fe);if(W.$$typeof===z)return Q(H,M,q,fr(M,W),fe);kr(M,W)}return null}function ve(H,M,q,W){for(var fe=null,Ae=null,ge=M,be=M=0,ct=null;ge!==null&&be<q.length;be++){ge.index>be?(ct=ge,ge=null):ct=ge.sibling;var ze=Y(H,ge,q[be],W);if(ze===null){ge===null&&(ge=ct);break}e&&ge&&ze.alternate===null&&t(H,ge),M=u(ze,M,be),Ae===null?fe=ze:Ae.sibling=ze,Ae=ze,ge=ct}if(be===q.length)return a(H,ge),Ue&&yn(H,be),fe;if(ge===null){for(;be<q.length;be++)ge=ee(H,q[be],W),ge!==null&&(M=u(ge,M,be),Ae===null?fe=ge:Ae.sibling=ge,Ae=ge);return Ue&&yn(H,be),fe}for(ge=n(ge);be<q.length;be++)ct=Q(ge,H,be,q[be],W),ct!==null&&(e&&ct.alternate!==null&&ge.delete(ct.key===null?be:ct.key),M=u(ct,M,be),Ae===null?fe=ct:Ae.sibling=ct,Ae=ct);return e&&ge.forEach(function(an){return t(H,an)}),Ue&&yn(H,be),fe}function ye(H,M,q,W){if(q==null)throw Error(c(151));for(var fe=null,Ae=null,ge=M,be=M=0,ct=null,ze=q.next();ge!==null&&!ze.done;be++,ze=q.next()){ge.index>be?(ct=ge,ge=null):ct=ge.sibling;var an=Y(H,ge,ze.value,W);if(an===null){ge===null&&(ge=ct);break}e&&ge&&an.alternate===null&&t(H,ge),M=u(an,M,be),Ae===null?fe=an:Ae.sibling=an,Ae=an,ge=ct}if(ze.done)return a(H,ge),Ue&&yn(H,be),fe;if(ge===null){for(;!ze.done;be++,ze=q.next())ze=ee(H,ze.value,W),ze!==null&&(M=u(ze,M,be),Ae===null?fe=ze:Ae.sibling=ze,Ae=ze);return Ue&&yn(H,be),fe}for(ge=n(ge);!ze.done;be++,ze=q.next())ze=Q(ge,H,be,ze.value,W),ze!==null&&(e&&ze.alternate!==null&&ge.delete(ze.key===null?be:ze.key),M=u(ze,M,be),Ae===null?fe=ze:Ae.sibling=ze,Ae=ze);return e&&ge.forEach(function(tx){return t(H,tx)}),Ue&&yn(H,be),fe}function Ge(H,M,q,W){if(typeof q=="object"&&q!==null&&q.type===N&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case v:e:{for(var fe=q.key;M!==null;){if(M.key===fe){if(fe=q.type,fe===N){if(M.tag===7){a(H,M.sibling),W=i(M,q.props.children),W.return=H,H=W;break e}}else if(M.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===B&&of(fe)===M.type){a(H,M.sibling),W=i(M,q.props),ll(W,q),W.return=H,H=W;break e}a(H,M);break}else t(H,M);M=M.sibling}q.type===N?(W=pn(q.props.children,H.mode,W,q.key),W.return=H,H=W):(W=ir(q.type,q.key,q.props,null,H.mode,W),ll(W,q),W.return=H,H=W)}return x(H);case A:e:{for(fe=q.key;M!==null;){if(M.key===fe)if(M.tag===4&&M.stateNode.containerInfo===q.containerInfo&&M.stateNode.implementation===q.implementation){a(H,M.sibling),W=i(M,q.children||[]),W.return=H,H=W;break e}else{a(H,M);break}else t(H,M);M=M.sibling}W=Jo(q,H.mode,W),W.return=H,H=W}return x(H);case B:return fe=q._init,q=fe(q._payload),Ge(H,M,q,W)}if(V(q))return ve(H,M,q,W);if(U(q)){if(fe=U(q),typeof fe!="function")throw Error(c(150));return q=fe.call(q),ye(H,M,q,W)}if(typeof q.then=="function")return Ge(H,M,Cr(q),W);if(q.$$typeof===z)return Ge(H,M,fr(H,q),W);kr(H,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,M!==null&&M.tag===6?(a(H,M.sibling),W=i(M,q),W.return=H,H=W):(a(H,M),W=Zo(q,H.mode,W),W.return=H,H=W),x(H)):a(H,M)}return function(H,M,q,W){try{sl=0;var fe=Ge(H,M,q,W);return ns=null,fe}catch(ge){if(ge===Fs||ge===hr)throw ge;var Ae=Tt(29,ge,null,H.mode);return Ae.lanes=W,Ae.return=H,Ae}finally{}}}var ss=cf(!0),uf=cf(!1),qt=X(null),sa=null;function qa(e){var t=e.alternate;ne(st,st.current&1),ne(qt,e),sa===null&&(t===null||Wn.current!==null||t.memoizedState!==null)&&(sa=e)}function df(e){if(e.tag===22){if(ne(st,st.current),ne(qt,e),sa===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(sa=e)}}else Ga()}function Ga(){ne(st,st.current),ne(qt,qt.current)}function va(e){le(qt),sa===e&&(sa=null),le(st)}var st=X(0);function Er(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==="$?"||bc(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 Ri(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Oi={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Mt(),i=Ha(n);i.payload=t,a!=null&&(i.callback=a),t=Ba(e,i,n),t!==null&&(zt(t,e,n),Js(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Mt(),i=Ha(n);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=Ba(e,i,n),t!==null&&(zt(t,e,n),Js(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Mt(),n=Ha(a);n.tag=2,t!=null&&(n.callback=t),t=Ba(e,n,a),t!==null&&(zt(t,e,a),Js(t,e,a))}};function ff(e,t,a,n,i,u,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,u,x):t.prototype&&t.prototype.isPureReactComponent?!qs(a,n)||!qs(i,u):!0}function mf(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Oi.enqueueReplaceState(t,t.state,null)}function Cn(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}var Tr=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 hf(e){Tr(e)}function gf(e){console.error(e)}function pf(e){Tr(e)}function Ar(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function xf(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Mi(e,t,a){return a=Ha(a),a.tag=3,a.payload={element:null},a.callback=function(){Ar(e,t)},a}function yf(e){return e=Ha(e),e.tag=3,e}function bf(e,t,a,n){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var u=n.value;e.payload=function(){return i(u)},e.callback=function(){xf(t,a,n)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){xf(t,a,n),typeof i!="function"&&(Qa===null?Qa=new Set([this]):Qa.add(this));var b=n.stack;this.componentDidCatch(n.value,{componentStack:b!==null?b:""})})}function t0(e,t,a,n,i){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Ps(t,a,i,!0),a=qt.current,a!==null){switch(a.tag){case 13:return sa===null?ac():a.alternate===null&&Fe===0&&(Fe=3),a.flags&=-257,a.flags|=65536,a.lanes=i,n===oi?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),sc(e,n,i)),!1;case 22:return a.flags|=65536,n===oi?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),sc(e,n,i)),!1}throw Error(c(435,a.tag))}return sc(e,n,i),ac(),!1}if(Ue)return t=qt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,n!==ei&&(e=Error(c(422),{cause:n}),Ys(_t(e,a)))):(n!==ei&&(t=Error(c(423),{cause:n}),Ys(_t(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,n=_t(n,a),i=Mi(e.stateNode,n,i),ui(e,i),Fe!==4&&(Fe=2)),!1;var u=Error(c(520),{cause:n});if(u=_t(u,a),fl===null?fl=[u]:fl.push(u),Fe!==4&&(Fe=2),t===null)return!0;n=_t(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=Mi(a.stateNode,n,e),ui(a,e),!1;case 1:if(t=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Qa===null||!Qa.has(u))))return a.flags|=65536,i&=-i,a.lanes|=i,i=yf(i),bf(i,e,a,n),ui(a,i),!1}a=a.return}while(a!==null);return!1}var vf=Error(c(461)),ot=!1;function ut(e,t,a,n){t.child=e===null?uf(t,null,a,n):ss(t,e.child,a,n)}function wf(e,t,a,n,i){a=a.render;var u=t.ref;if("ref"in n){var x={};for(var b in n)b!=="ref"&&(x[b]=n[b])}else x=n;return jn(t),n=gi(e,t,a,x,u,i),b=pi(),e!==null&&!ot?(xi(e,t,i),wa(e,t,i)):(Ue&&b&&Io(t),t.flags|=1,ut(e,t,n,i),t.child)}function jf(e,t,a,n,i){if(e===null){var u=a.type;return typeof u=="function"&&!Fo(u)&&u.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=u,Sf(e,t,u,n,i)):(e=ir(a.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Vi(e,i)){var x=u.memoizedProps;if(a=a.compare,a=a!==null?a:qs,a(x,n)&&e.ref===t.ref)return wa(e,t,i)}return t.flags|=1,e=ha(u,n),e.ref=t.ref,e.return=t,t.child=e}function Sf(e,t,a,n,i){if(e!==null){var u=e.memoizedProps;if(qs(u,n)&&e.ref===t.ref)if(ot=!1,t.pendingProps=n=u,Vi(e,i))(e.flags&131072)!==0&&(ot=!0);else return t.lanes=e.lanes,wa(e,t,i)}return zi(e,t,a,n,i)}function Nf(e,t,a){var n=t.pendingProps,i=n.children,u=e!==null?e.memoizedState:null;if(n.mode==="hidden"){if((t.flags&128)!==0){if(n=u!==null?u.baseLanes|a:a,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;t.childLanes=u&~n}else t.childLanes=0,t.child=null;return Cf(e,t,n,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&mr(t,u!==null?u.cachePool:null),u!==null?jd(t,u):fi(),df(t);else return t.lanes=t.childLanes=536870912,Cf(e,t,u!==null?u.baseLanes|a:a,a)}else u!==null?(mr(t,u.cachePool),jd(t,u),Ga(),t.memoizedState=null):(e!==null&&mr(t,null),fi(),Ga());return ut(e,t,i,a),t.child}function Cf(e,t,a,n){var i=ri();return i=i===null?null:{parent:nt._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&mr(t,null),fi(),df(t),e!==null&&Ps(e,t,n,!0),null}function Rr(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(c(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function zi(e,t,a,n,i){return jn(t),a=gi(e,t,a,n,void 0,i),n=pi(),e!==null&&!ot?(xi(e,t,i),wa(e,t,i)):(Ue&&n&&Io(t),t.flags|=1,ut(e,t,a,i),t.child)}function kf(e,t,a,n,i,u){return jn(t),t.updateQueue=null,a=Nd(t,n,a,i),Sd(e),n=pi(),e!==null&&!ot?(xi(e,t,u),wa(e,t,u)):(Ue&&n&&Io(t),t.flags|=1,ut(e,t,a,u),t.child)}function Ef(e,t,a,n,i){if(jn(t),t.stateNode===null){var u=Qn,x=a.contextType;typeof x=="object"&&x!==null&&(u=gt(x)),u=new a(n,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Oi,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=n,u.state=t.memoizedState,u.refs={},ii(t),x=a.contextType,u.context=typeof x=="object"&&x!==null?gt(x):Qn,u.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(Ri(t,a,x,n),u.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(x=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),x!==u.state&&Oi.enqueueReplaceState(u,u.state,null),Ws(t,n,u,i),Is(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){u=t.stateNode;var b=t.memoizedProps,T=Cn(a,b);u.props=T;var $=u.context,J=a.contextType;x=Qn,typeof J=="object"&&J!==null&&(x=gt(J));var ee=a.getDerivedStateFromProps;J=typeof ee=="function"||typeof u.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,J||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(b||$!==x)&&mf(t,u,n,x),_a=!1;var Y=t.memoizedState;u.state=Y,Ws(t,n,u,i),Is(),$=t.memoizedState,b||Y!==$||_a?(typeof ee=="function"&&(Ri(t,a,ee,n),$=t.memoizedState),(T=_a||ff(t,a,T,n,Y,$,x))?(J||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=$),u.props=n,u.state=$,u.context=x,n=T):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{u=t.stateNode,ci(e,t),x=t.memoizedProps,J=Cn(a,x),u.props=J,ee=t.pendingProps,Y=u.context,$=a.contextType,T=Qn,typeof $=="object"&&$!==null&&(T=gt($)),b=a.getDerivedStateFromProps,($=typeof b=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(x!==ee||Y!==T)&&mf(t,u,n,T),_a=!1,Y=t.memoizedState,u.state=Y,Ws(t,n,u,i),Is();var Q=t.memoizedState;x!==ee||Y!==Q||_a||e!==null&&e.dependencies!==null&&dr(e.dependencies)?(typeof b=="function"&&(Ri(t,a,b,n),Q=t.memoizedState),(J=_a||ff(t,a,J,n,Y,Q,T)||e!==null&&e.dependencies!==null&&dr(e.dependencies))?($||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(n,Q,T),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(n,Q,T)),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=n,t.memoizedState=Q),u.props=n,u.state=Q,u.context=T,n=J):(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),n=!1)}return u=n,Rr(e,t),n=(t.flags&128)!==0,u||n?(u=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&n?(t.child=ss(t,e.child,null,i),t.child=ss(t,null,a,i)):ut(e,t,a,i),t.memoizedState=u.state,e=t.child):e=wa(e,t,i),e}function Tf(e,t,a,n){return Ks(),t.flags|=256,ut(e,t,a,n),t.child}var Di={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ui(e){return{baseLanes:e,cachePool:hd()}}function Li(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Gt),e}function Af(e,t,a){var n=t.pendingProps,i=!1,u=(t.flags&128)!==0,x;if((x=u)||(x=e!==null&&e.memoizedState===null?!1:(st.current&2)!==0),x&&(i=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ue){if(i?qa(t):Ga(),Ue){var b=Qe,T;if(T=b){e:{for(T=b,b=na;T.nodeType!==8;){if(!b){b=null;break e}if(T=It(T.nextSibling),T===null){b=null;break e}}b=T}b!==null?(t.memoizedState={dehydrated:b,treeContext:xn!==null?{id:ga,overflow:pa}:null,retryLane:536870912,hydrationErrors:null},T=Tt(18,null,null,0),T.stateNode=b,T.return=t,t.child=T,bt=t,Qe=null,T=!0):T=!1}T||vn(t)}if(b=t.memoizedState,b!==null&&(b=b.dehydrated,b!==null))return bc(b)?t.lanes=32:t.lanes=536870912,null;va(t)}return b=n.children,n=n.fallback,i?(Ga(),i=t.mode,b=Or({mode:"hidden",children:b},i),n=pn(n,i,a,null),b.return=t,n.return=t,b.sibling=n,t.child=b,i=t.child,i.memoizedState=Ui(a),i.childLanes=Li(e,x,a),t.memoizedState=Di,n):(qa(t),_i(t,b))}if(T=e.memoizedState,T!==null&&(b=T.dehydrated,b!==null)){if(u)t.flags&256?(qa(t),t.flags&=-257,t=Hi(e,t,a)):t.memoizedState!==null?(Ga(),t.child=e.child,t.flags|=128,t=null):(Ga(),i=n.fallback,b=t.mode,n=Or({mode:"visible",children:n.children},b),i=pn(i,b,a,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,ss(t,e.child,null,a),n=t.child,n.memoizedState=Ui(a),n.childLanes=Li(e,x,a),t.memoizedState=Di,t=i);else if(qa(t),bc(b)){if(x=b.nextSibling&&b.nextSibling.dataset,x)var $=x.dgst;x=$,n=Error(c(419)),n.stack="",n.digest=x,Ys({value:n,source:null,stack:null}),t=Hi(e,t,a)}else if(ot||Ps(e,t,a,!1),x=(a&e.childLanes)!==0,ot||x){if(x=Ke,x!==null&&(n=a&-a,n=(n&42)!==0?1:aa(n),n=(n&(x.suspendedLanes|a))!==0?0:n,n!==0&&n!==T.retryLane))throw T.retryLane=n,Xn(e,n),zt(x,e,n),vf;b.data==="$?"||ac(),t=Hi(e,t,a)}else b.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=T.treeContext,Qe=It(b.nextSibling),bt=t,Ue=!0,bn=null,na=!1,e!==null&&(Bt[Vt++]=ga,Bt[Vt++]=pa,Bt[Vt++]=xn,ga=e.id,pa=e.overflow,xn=t),t=_i(t,n.children),t.flags|=4096);return t}return i?(Ga(),i=n.fallback,b=t.mode,T=e.child,$=T.sibling,n=ha(T,{mode:"hidden",children:n.children}),n.subtreeFlags=T.subtreeFlags&65011712,$!==null?i=ha($,i):(i=pn(i,b,a,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,b=e.child.memoizedState,b===null?b=Ui(a):(T=b.cachePool,T!==null?($=nt._currentValue,T=T.parent!==$?{parent:$,pool:$}:T):T=hd(),b={baseLanes:b.baseLanes|a,cachePool:T}),i.memoizedState=b,i.childLanes=Li(e,x,a),t.memoizedState=Di,n):(qa(t),a=e.child,e=a.sibling,a=ha(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=a,t.memoizedState=null,a)}function _i(e,t){return t=Or({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Or(e,t){return e=Tt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Hi(e,t,a){return ss(t,e.child,null,a),e=_i(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rf(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),ai(e.return,t,a)}function Bi(e,t,a,n,i){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:i}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=n,u.tail=a,u.tailMode=i)}function Of(e,t,a){var n=t.pendingProps,i=n.revealOrder,u=n.tail;if(ut(e,t,n.children,a),n=st.current,(n&2)!==0)n=n&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rf(e,a,t);else if(e.tag===19)Rf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}switch(ne(st,n),i){case"forwards":for(a=t.child,i=null;a!==null;)e=a.alternate,e!==null&&Er(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),Bi(t,!1,i,a,u);break;case"backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Er(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}Bi(t,!0,a,null,u);break;case"together":Bi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Xa|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Ps(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,a=ha(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ha(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Vi(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&dr(e)))}function a0(e,t,a){switch(t.tag){case 3:ie(t,t.stateNode.containerInfo),La(t,nt,e.memoizedState.cache),Ks();break;case 27:case 5:Be(t);break;case 4:ie(t,t.stateNode.containerInfo);break;case 10:La(t,t.type,t.memoizedProps.value);break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(qa(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Af(e,t,a):(qa(t),e=wa(e,t,a),e!==null?e.sibling:null);qa(t);break;case 19:var i=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Ps(e,t,a,!1),n=(a&t.childLanes)!==0),i){if(n)return Of(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ne(st,st.current),n)break;return null;case 22:case 23:return t.lanes=0,Nf(e,t,a);case 24:La(t,nt,e.memoizedState.cache)}return wa(e,t,a)}function Mf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)ot=!0;else{if(!Vi(e,a)&&(t.flags&128)===0)return ot=!1,a0(e,t,a);ot=(e.flags&131072)!==0}else ot=!1,Ue&&(t.flags&1048576)!==0&&od(t,ur,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var n=t.elementType,i=n._init;if(n=i(n._payload),t.type=n,typeof n=="function")Fo(n)?(e=Cn(n,e),t.tag=1,t=Ef(null,t,n,e,a)):(t.tag=0,t=zi(null,t,n,e,a));else{if(n!=null){if(i=n.$$typeof,i===P){t.tag=11,t=wf(null,t,n,e,a);break e}else if(i===K){t.tag=14,t=jf(null,t,n,e,a);break e}}throw t=_(n)||n,Error(c(306,t,""))}}return t;case 0:return zi(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,i=Cn(n,t.pendingProps),Ef(e,t,n,i,a);case 3:e:{if(ie(t,t.stateNode.containerInfo),e===null)throw Error(c(387));n=t.pendingProps;var u=t.memoizedState;i=u.element,ci(e,t),Ws(t,n,null,a);var x=t.memoizedState;if(n=x.cache,La(t,nt,n),n!==u.cache&&ni(t,[nt],a,!0),Is(),n=x.element,u.isDehydrated)if(u={element:n,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Tf(e,t,n,a);break e}else if(n!==i){i=_t(Error(c(424)),t),Ys(i),t=Tf(e,t,n,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Qe=It(e.firstChild),bt=t,Ue=!0,bn=null,na=!0,a=uf(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Ks(),n===i){t=wa(e,t,a);break e}ut(e,t,n,a)}t=t.child}return t;case 26:return Rr(e,t),e===null?(a=Lm(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ue||(a=t.type,e=t.pendingProps,n=Yr(ae.current).createElement(a),n[at]=t,n[yt]=e,ft(n,a,e),rt(n),t.stateNode=n):t.memoizedState=Lm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Be(t),e===null&&Ue&&(n=t.stateNode=zm(t.type,t.pendingProps,ae.current),bt=t,na=!0,i=Qe,Ja(t.type)?(vc=i,Qe=It(n.firstChild)):Qe=i),ut(e,t,t.pendingProps.children,a),Rr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ue&&((i=n=Qe)&&(n=R0(n,t.type,t.pendingProps,na),n!==null?(t.stateNode=n,bt=t,Qe=It(n.firstChild),na=!1,i=!0):i=!1),i||vn(t)),Be(t),i=t.type,u=t.pendingProps,x=e!==null?e.memoizedProps:null,n=u.children,pc(i,u)?n=null:x!==null&&pc(i,x)&&(t.flags|=32),t.memoizedState!==null&&(i=gi(e,t,Qp,null,null,a),wl._currentValue=i),Rr(e,t),ut(e,t,n,a),t.child;case 6:return e===null&&Ue&&((e=a=Qe)&&(a=O0(a,t.pendingProps,na),a!==null?(t.stateNode=a,bt=t,Qe=null,e=!0):e=!1),e||vn(t)),null;case 13:return Af(e,t,a);case 4:return ie(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ss(t,null,n,a):ut(e,t,n,a),t.child;case 11:return wf(e,t,t.type,t.pendingProps,a);case 7:return ut(e,t,t.pendingProps,a),t.child;case 8:return ut(e,t,t.pendingProps.children,a),t.child;case 12:return ut(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,La(t,t.type,n.value),ut(e,t,n.children,a),t.child;case 9:return i=t.type._context,n=t.pendingProps.children,jn(t),i=gt(i),n=n(i),t.flags|=1,ut(e,t,n,a),t.child;case 14:return jf(e,t,t.type,t.pendingProps,a);case 15:return Sf(e,t,t.type,t.pendingProps,a);case 19:return Of(e,t,a);case 31:return n=t.pendingProps,a=t.mode,n={mode:n.mode,children:n.children},e===null?(a=Or(n,a),a.ref=t.ref,t.child=a,a.return=t,t=a):(a=ha(e.child,n),a.ref=t.ref,t.child=a,a.return=t,t=a),t;case 22:return Nf(e,t,a);case 24:return jn(t),n=gt(nt),e===null?(i=ri(),i===null&&(i=Ke,u=si(),i.pooledCache=u,u.refCount++,u!==null&&(i.pooledCacheLanes|=a),i=u),t.memoizedState={parent:n,cache:i},ii(t),La(t,nt,i)):((e.lanes&a)!==0&&(ci(e,t),Ws(t,null,null,a),Is()),i=e.memoizedState,u=t.memoizedState,i.parent!==n?(i={parent:n,cache:n},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),La(t,nt,n)):(n=u.cache,La(t,nt,n),n!==i.cache&&ni(t,[nt],a,!0))),ut(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function ja(e){e.flags|=4}function zf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!qm(t)){if(t=qt.current,t!==null&&((Me&4194048)===Me?sa!==null:(Me&62914560)!==Me&&(Me&536870912)===0||t!==sa))throw Zs=oi,gd;e.flags|=8192}}function Mr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Pt():536870912,e.lanes|=t,is|=t)}function rl(e,t){if(!Ue)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,n|=i.subtreeFlags&65011712,n|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function n0(e,t,a){var n=t.pendingProps;switch(Wo(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return Xe(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ya(nt),xe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&($s(t)?ja(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ud())),Xe(t),null;case 26:return a=t.memoizedState,e===null?(ja(t),a!==null?(Xe(t),zf(t,a)):(Xe(t),t.flags&=-16777217)):a?a!==e.memoizedState?(ja(t),Xe(t),zf(t,a)):(Xe(t),t.flags&=-16777217):(e.memoizedProps!==n&&ja(t),Xe(t),t.flags&=-16777217),null;case 27:je(t),a=ae.current;var i=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==n&&ja(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return Xe(t),null}e=de.current,$s(t)?id(t):(e=zm(i,n,a),t.stateNode=e,ja(t))}return Xe(t),null;case 5:if(je(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&ja(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return Xe(t),null}if(e=de.current,$s(t))id(t);else{switch(i=Yr(ae.current),e){case 1:e=i.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=i.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=i.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=i.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof n.is=="string"?i.createElement("select",{is:n.is}):i.createElement("select"),n.multiple?e.multiple=!0:n.size&&(e.size=n.size);break;default:e=typeof n.is=="string"?i.createElement(a,{is:n.is}):i.createElement(a)}}e[at]=t,e[yt]=n;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=e;e:switch(ft(e,a,n),a){case"button":case"input":case"select":case"textarea":e=!!n.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&ja(t)}}return Xe(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&ja(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(c(166));if(e=ae.current,$s(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,i=bt,i!==null)switch(i.tag){case 27:case 5:n=i.memoizedProps}e[at]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||km(e.nodeValue,a)),e||vn(t)}else e=Yr(e).createTextNode(n),e[at]=t,t.stateNode=e}return Xe(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=$s(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(c(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(c(317));i[at]=t}else Ks(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),i=!1}else i=ud(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(va(t),t):(va(t),null)}if(va(t),(t.flags&128)!==0)return t.lanes=a,t;if(a=n!==null,e=e!==null&&e.memoizedState!==null,a){n=t.child,i=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(i=n.alternate.memoizedState.cachePool.pool);var u=null;n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==i&&(n.flags|=2048)}return a!==e&&a&&(t.child.flags|=8192),Mr(t,t.updateQueue),Xe(t),null;case 4:return xe(),e===null&&dc(t.stateNode.containerInfo),Xe(t),null;case 10:return ya(t.type),Xe(t),null;case 19:if(le(st),i=t.memoizedState,i===null)return Xe(t),null;if(n=(t.flags&128)!==0,u=i.rendering,u===null)if(n)rl(i,!1);else{if(Fe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Er(e),u!==null){for(t.flags|=128,rl(i,!1),e=u.updateQueue,t.updateQueue=e,Mr(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)rd(a,e),a=a.sibling;return ne(st,st.current&1|2),t.child}e=e.sibling}i.tail!==null&&Le()>Ur&&(t.flags|=128,n=!0,rl(i,!1),t.lanes=4194304)}else{if(!n)if(e=Er(u),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Mr(t,e),rl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!u.alternate&&!Ue)return Xe(t),null}else 2*Le()-i.renderingStartTime>Ur&&a!==536870912&&(t.flags|=128,n=!0,rl(i,!1),t.lanes=4194304);i.isBackwards?(u.sibling=t.child,t.child=u):(e=i.last,e!==null?e.sibling=u:t.child=u,i.last=u)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Le(),t.sibling=null,e=st.current,ne(st,n?e&1|2:e&1),t):(Xe(t),null);case 22:case 23:return va(t),mi(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),a=t.updateQueue,a!==null&&Mr(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&le(Sn),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ya(nt),Xe(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function s0(e,t){switch(Wo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(nt),xe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return je(t),null;case 13:if(va(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ks()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(st),null;case 4:return xe(),null;case 10:return ya(t.type),null;case 22:case 23:return va(t),mi(),e!==null&&le(Sn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ya(nt),null;case 25:return null;default:return null}}function Df(e,t){switch(Wo(t),t.tag){case 3:ya(nt),xe();break;case 26:case 27:case 5:je(t);break;case 4:xe();break;case 13:va(t);break;case 19:le(st);break;case 10:ya(t.type);break;case 22:case 23:va(t),mi(),e!==null&&le(Sn);break;case 24:ya(nt)}}function ol(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var i=n.next;a=i;do{if((a.tag&e)===e){n=void 0;var u=a.create,x=a.inst;n=u(),x.destroy=n}a=a.next}while(a!==i)}}catch(b){$e(t,t.return,b)}}function $a(e,t,a){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var u=i.next;n=u;do{if((n.tag&e)===e){var x=n.inst,b=x.destroy;if(b!==void 0){x.destroy=void 0,i=t;var T=a,$=b;try{$()}catch(J){$e(i,T,J)}}}n=n.next}while(n!==u)}}catch(J){$e(t,t.return,J)}}function Uf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{wd(t,a)}catch(n){$e(e,e.return,n)}}}function Lf(e,t,a){a.props=Cn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){$e(e,t,n)}}function il(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(i){$e(e,t,i)}}function la(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(i){$e(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){$e(e,t,i)}else a.current=null}function _f(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(i){$e(e,e.return,i)}}function qi(e,t,a){try{var n=e.stateNode;C0(n,e.type,a,t),n[yt]=t}catch(i){$e(e,e.return,i)}}function Hf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ja(e.type)||e.tag===4}function Gi(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hf(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&&Ja(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 $i(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Kr));else if(n!==4&&(n===27&&Ja(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for($i(e,t,a),e=e.sibling;e!==null;)$i(e,t,a),e=e.sibling}function zr(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Ja(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(zr(e,t,a),e=e.sibling;e!==null;)zr(e,t,a),e=e.sibling}function Bf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ft(t,n,a),t[at]=e,t[yt]=a}catch(u){$e(e,e.return,u)}}var Sa=!1,We=!1,Ki=!1,Vf=typeof WeakSet=="function"?WeakSet:Set,it=null;function l0(e,t){if(e=e.containerInfo,hc=Jr,e=Zu(e),Go(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var i=n.anchorOffset,u=n.focusNode;n=n.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var x=0,b=-1,T=-1,$=0,J=0,ee=e,Y=null;t:for(;;){for(var Q;ee!==a||i!==0&&ee.nodeType!==3||(b=x+i),ee!==u||n!==0&&ee.nodeType!==3||(T=x+n),ee.nodeType===3&&(x+=ee.nodeValue.length),(Q=ee.firstChild)!==null;)Y=ee,ee=Q;for(;;){if(ee===e)break t;if(Y===a&&++$===i&&(b=x),Y===u&&++J===n&&(T=x),(Q=ee.nextSibling)!==null)break;ee=Y,Y=ee.parentNode}ee=Q}a=b===-1||T===-1?null:{start:b,end:T}}else a=null}a=a||{start:0,end:0}}else a=null;for(gc={focusedElem:e,selectionRange:a},Jr=!1,it=t;it!==null;)if(t=it,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,it=e;else for(;it!==null;){switch(t=it,u=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,a=t,i=u.memoizedProps,u=u.memoizedState,n=a.stateNode;try{var ve=Cn(a.type,i,a.elementType===a.type);e=n.getSnapshotBeforeUpdate(ve,u),n.__reactInternalSnapshotBeforeUpdate=e}catch(ye){$e(a,a.return,ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)yc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":yc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,it=e;break}it=t.return}}function qf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Ka(e,a),n&4&&ol(5,a);break;case 1:if(Ka(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){$e(a,a.return,x)}else{var i=Cn(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){$e(a,a.return,x)}}n&64&&Uf(a),n&512&&il(a,a.return);break;case 3:if(Ka(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{wd(e,t)}catch(x){$e(a,a.return,x)}}break;case 27:t===null&&n&4&&Bf(a);case 26:case 5:Ka(e,a),t===null&&n&4&&_f(a),n&512&&il(a,a.return);break;case 12:Ka(e,a);break;case 13:Ka(e,a),n&4&&Kf(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=h0.bind(null,a),M0(e,a))));break;case 22:if(n=a.memoizedState!==null||Sa,!n){t=t!==null&&t.memoizedState!==null||We,i=Sa;var u=We;Sa=n,(We=t)&&!u?Ya(e,a,(a.subtreeFlags&8772)!==0):Ka(e,a),Sa=i,We=u}break;case 30:break;default:Ka(e,a)}}function Gf(e){var t=e.alternate;t!==null&&(e.alternate=null,Gf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&So(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,St=!1;function Na(e,t,a){for(a=a.child;a!==null;)$f(e,t,a),a=a.sibling}function $f(e,t,a){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(Da,a)}catch{}switch(a.tag){case 26:We||la(a,t),Na(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:We||la(a,t);var n=Ye,i=St;Ja(a.type)&&(Ye=a.stateNode,St=!1),Na(e,t,a),xl(a.stateNode),Ye=n,St=i;break;case 5:We||la(a,t);case 6:if(n=Ye,i=St,Ye=null,Na(e,t,a),Ye=n,St=i,Ye!==null)if(St)try{(Ye.nodeType===9?Ye.body:Ye.nodeName==="HTML"?Ye.ownerDocument.body:Ye).removeChild(a.stateNode)}catch(u){$e(a,t,u)}else try{Ye.removeChild(a.stateNode)}catch(u){$e(a,t,u)}break;case 18:Ye!==null&&(St?(e=Ye,Om(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Cl(e)):Om(Ye,a.stateNode));break;case 4:n=Ye,i=St,Ye=a.stateNode.containerInfo,St=!0,Na(e,t,a),Ye=n,St=i;break;case 0:case 11:case 14:case 15:We||$a(2,a,t),We||$a(4,a,t),Na(e,t,a);break;case 1:We||(la(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&Lf(a,t,n)),Na(e,t,a);break;case 21:Na(e,t,a);break;case 22:We=(n=We)||a.memoizedState!==null,Na(e,t,a),We=n;break;default:Na(e,t,a)}}function Kf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Cl(e)}catch(a){$e(t,t.return,a)}}function r0(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Vf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Vf),t;default:throw Error(c(435,e.tag))}}function Yi(e,t){var a=r0(e);t.forEach(function(n){var i=g0.bind(null,e,n);a.has(n)||(a.add(n),n.then(i,i))})}function At(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var i=a[n],u=e,x=t,b=x;e:for(;b!==null;){switch(b.tag){case 27:if(Ja(b.type)){Ye=b.stateNode,St=!1;break e}break;case 5:Ye=b.stateNode,St=!1;break e;case 3:case 4:Ye=b.stateNode.containerInfo,St=!0;break e}b=b.return}if(Ye===null)throw Error(c(160));$f(u,x,i),Ye=null,St=!1,u=i.alternate,u!==null&&(u.return=null),i.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Yf(t,e),t=t.sibling}var Jt=null;function Yf(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:At(t,e),Rt(e),n&4&&($a(3,e,e.return),ol(3,e),$a(5,e,e.return));break;case 1:At(t,e),Rt(e),n&512&&(We||a===null||la(a,a.return)),n&64&&Sa&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var i=Jt;if(At(t,e),Rt(e),n&512&&(We||a===null||la(a,a.return)),n&4){var u=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,i=i.ownerDocument||i;t:switch(n){case"title":u=i.getElementsByTagName("title")[0],(!u||u[Ms]||u[at]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=i.createElement(n),i.head.insertBefore(u,i.querySelector("head > title"))),ft(u,n,a),u[at]=e,rt(u),n=u;break e;case"link":var x=Bm("link","href",i).get(n+(a.href||""));if(x){for(var b=0;b<x.length;b++)if(u=x[b],u.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&u.getAttribute("rel")===(a.rel==null?null:a.rel)&&u.getAttribute("title")===(a.title==null?null:a.title)&&u.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(b,1);break t}}u=i.createElement(n),ft(u,n,a),i.head.appendChild(u);break;case"meta":if(x=Bm("meta","content",i).get(n+(a.content||""))){for(b=0;b<x.length;b++)if(u=x[b],u.getAttribute("content")===(a.content==null?null:""+a.content)&&u.getAttribute("name")===(a.name==null?null:a.name)&&u.getAttribute("property")===(a.property==null?null:a.property)&&u.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&u.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(b,1);break t}}u=i.createElement(n),ft(u,n,a),i.head.appendChild(u);break;default:throw Error(c(468,n))}u[at]=e,rt(u),n=u}e.stateNode=n}else Vm(i,e.type,e.stateNode);else e.stateNode=Hm(i,n,e.memoizedProps);else u!==n?(u===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):u.count--,n===null?Vm(i,e.type,e.stateNode):Hm(i,n,e.memoizedProps)):n===null&&e.stateNode!==null&&qi(e,e.memoizedProps,a.memoizedProps)}break;case 27:At(t,e),Rt(e),n&512&&(We||a===null||la(a,a.return)),a!==null&&n&4&&qi(e,e.memoizedProps,a.memoizedProps);break;case 5:if(At(t,e),Rt(e),n&512&&(We||a===null||la(a,a.return)),e.flags&32){i=e.stateNode;try{Vn(i,"")}catch(Q){$e(e,e.return,Q)}}n&4&&e.stateNode!=null&&(i=e.memoizedProps,qi(e,i,a!==null?a.memoizedProps:i)),n&1024&&(Ki=!0);break;case 6:if(At(t,e),Rt(e),n&4){if(e.stateNode===null)throw Error(c(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(Q){$e(e,e.return,Q)}}break;case 3:if(Qr=null,i=Jt,Jt=Pr(t.containerInfo),At(t,e),Jt=i,Rt(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Cl(t.containerInfo)}catch(Q){$e(e,e.return,Q)}Ki&&(Ki=!1,Pf(e));break;case 4:n=Jt,Jt=Pr(e.stateNode.containerInfo),At(t,e),Rt(e),Jt=n;break;case 12:At(t,e),Rt(e);break;case 13:At(t,e),Rt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ji=Le()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Yi(e,n)));break;case 22:i=e.memoizedState!==null;var T=a!==null&&a.memoizedState!==null,$=Sa,J=We;if(Sa=$||i,We=J||T,At(t,e),We=J,Sa=$,Rt(e),n&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||T||Sa||We||kn(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){T=a=t;try{if(u=T.stateNode,i)x=u.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{b=T.stateNode;var ee=T.memoizedProps.style,Y=ee!=null&&ee.hasOwnProperty("display")?ee.display:null;b.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(Q){$e(T,T.return,Q)}}}else if(t.tag===6){if(a===null){T=t;try{T.stateNode.nodeValue=i?"":T.memoizedProps}catch(Q){$e(T,T.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}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,Yi(e,a))));break;case 19:At(t,e),Rt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Yi(e,n)));break;case 30:break;case 21:break;default:At(t,e),Rt(e)}}function Rt(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(Hf(n)){a=n;break}n=n.return}if(a==null)throw Error(c(160));switch(a.tag){case 27:var i=a.stateNode,u=Gi(e);zr(e,u,i);break;case 5:var x=a.stateNode;a.flags&32&&(Vn(x,""),a.flags&=-33);var b=Gi(e);zr(e,b,x);break;case 3:case 4:var T=a.stateNode.containerInfo,$=Gi(e);$i(e,$,T);break;default:throw Error(c(161))}}catch(J){$e(e,e.return,J)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ka(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)qf(e,t.alternate,t),t=t.sibling}function kn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:$a(4,t,t.return),kn(t);break;case 1:la(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Lf(t,t.return,a),kn(t);break;case 27:xl(t.stateNode);case 26:case 5:la(t,t.return),kn(t);break;case 22:t.memoizedState===null&&kn(t);break;case 30:kn(t);break;default:kn(t)}e=e.sibling}}function Ya(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,i=e,u=t,x=u.flags;switch(u.tag){case 0:case 11:case 15:Ya(i,u,a),ol(4,u);break;case 1:if(Ya(i,u,a),n=u,i=n.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch($){$e(n,n.return,$)}if(n=u,i=n.updateQueue,i!==null){var b=n.stateNode;try{var T=i.shared.hiddenCallbacks;if(T!==null)for(i.shared.hiddenCallbacks=null,i=0;i<T.length;i++)vd(T[i],b)}catch($){$e(n,n.return,$)}}a&&x&64&&Uf(u),il(u,u.return);break;case 27:Bf(u);case 26:case 5:Ya(i,u,a),a&&n===null&&x&4&&_f(u),il(u,u.return);break;case 12:Ya(i,u,a);break;case 13:Ya(i,u,a),a&&x&4&&Kf(i,u);break;case 22:u.memoizedState===null&&Ya(i,u,a),il(u,u.return);break;case 30:break;default:Ya(i,u,a)}t=t.sibling}}function Pi(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Xs(a))}function Xi(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xs(e))}function ra(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Xf(e,t,a,n),t=t.sibling}function Xf(e,t,a,n){var i=t.flags;switch(t.tag){case 0:case 11:case 15:ra(e,t,a,n),i&2048&&ol(9,t);break;case 1:ra(e,t,a,n);break;case 3:ra(e,t,a,n),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xs(e)));break;case 12:if(i&2048){ra(e,t,a,n),e=t.stateNode;try{var u=t.memoizedProps,x=u.id,b=u.onPostCommit;typeof b=="function"&&b(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(T){$e(t,t.return,T)}}else ra(e,t,a,n);break;case 13:ra(e,t,a,n);break;case 23:break;case 22:u=t.stateNode,x=t.alternate,t.memoizedState!==null?u._visibility&2?ra(e,t,a,n):cl(e,t):u._visibility&2?ra(e,t,a,n):(u._visibility|=2,ls(e,t,a,n,(t.subtreeFlags&10256)!==0)),i&2048&&Pi(x,t);break;case 24:ra(e,t,a,n),i&2048&&Xi(t.alternate,t);break;default:ra(e,t,a,n)}}function ls(e,t,a,n,i){for(i=i&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var u=e,x=t,b=a,T=n,$=x.flags;switch(x.tag){case 0:case 11:case 15:ls(u,x,b,T,i),ol(8,x);break;case 23:break;case 22:var J=x.stateNode;x.memoizedState!==null?J._visibility&2?ls(u,x,b,T,i):cl(u,x):(J._visibility|=2,ls(u,x,b,T,i)),i&&$&2048&&Pi(x.alternate,x);break;case 24:ls(u,x,b,T,i),i&&$&2048&&Xi(x.alternate,x);break;default:ls(u,x,b,T,i)}t=t.sibling}}function cl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,i=n.flags;switch(n.tag){case 22:cl(a,n),i&2048&&Pi(n.alternate,n);break;case 24:cl(a,n),i&2048&&Xi(n.alternate,n);break;default:cl(a,n)}t=t.sibling}}var ul=8192;function rs(e){if(e.subtreeFlags&ul)for(e=e.child;e!==null;)Qf(e),e=e.sibling}function Qf(e){switch(e.tag){case 26:rs(e),e.flags&ul&&e.memoizedState!==null&&Y0(Jt,e.memoizedState,e.memoizedProps);break;case 5:rs(e);break;case 3:case 4:var t=Jt;Jt=Pr(e.stateNode.containerInfo),rs(e),Jt=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ul,ul=16777216,rs(e),ul=t):rs(e));break;default:rs(e)}}function Ff(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 dl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];it=n,Jf(n,e)}Ff(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zf(e),e=e.sibling}function Zf(e){switch(e.tag){case 0:case 11:case 15:dl(e),e.flags&2048&&$a(9,e,e.return);break;case 3:dl(e);break;case 12:dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Dr(e)):dl(e);break;default:dl(e)}}function Dr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];it=n,Jf(n,e)}Ff(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:$a(8,t,t.return),Dr(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Dr(t));break;default:Dr(t)}e=e.sibling}}function Jf(e,t){for(;it!==null;){var a=it;switch(a.tag){case 0:case 11:case 15:$a(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Xs(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,it=n;else e:for(a=e;it!==null;){n=it;var i=n.sibling,u=n.return;if(Gf(n),n===a){it=null;break e}if(i!==null){i.return=u,it=i;break e}it=u}}}var o0={getCacheForType:function(e){var t=gt(nt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a}},i0=typeof WeakMap=="function"?WeakMap:Map,_e=0,Ke=null,Re=null,Me=0,He=0,Ot=null,Pa=!1,os=!1,Qi=!1,Ca=0,Fe=0,Xa=0,En=0,Fi=0,Gt=0,is=0,fl=null,Nt=null,Zi=!1,Ji=0,Ur=1/0,Lr=null,Qa=null,dt=0,Fa=null,cs=null,us=0,Ii=0,Wi=null,If=null,ml=0,ec=null;function Mt(){if((_e&2)!==0&&Me!==0)return Me&-Me;if(k.T!==null){var e=Jn;return e!==0?e:oc()}return Os()}function Wf(){Gt===0&&(Gt=(Me&536870912)===0||Ue?pe():536870912);var e=qt.current;return e!==null&&(e.flags|=32),Gt}function zt(e,t,a){(e===Ke&&(He===2||He===9)||e.cancelPendingCommit!==null)&&(ds(e,0),Za(e,Me,Gt,!1)),Qt(e,a),((_e&2)===0||e!==Ke)&&(e===Ke&&((_e&2)===0&&(En|=a),Fe===4&&Za(e,Me,Gt,!1)),oa(e))}function em(e,t,a){if((_e&6)!==0)throw Error(c(327));var n=!a&&(t&124)===0&&(t&e.expiredLanes)===0||ue(e,t),i=n?d0(e,t):nc(e,t,!0),u=n;do{if(i===0){os&&!n&&Za(e,t,0,!1);break}else{if(a=e.current.alternate,u&&!c0(a)){i=nc(e,t,!1),u=!1;continue}if(i===2){if(u=t,e.errorRecoveryDisabledLanes&u)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var b=e;i=fl;var T=b.current.memoizedState.isDehydrated;if(T&&(ds(b,x).flags|=256),x=nc(b,x,!1),x!==2){if(Qi&&!T){b.errorRecoveryDisabledLanes|=u,En|=u,i=4;break e}u=Nt,Nt=i,u!==null&&(Nt===null?Nt=u:Nt.push.apply(Nt,u))}i=x}if(u=!1,i!==2)continue}}if(i===1){ds(e,0),Za(e,t,0,!0);break}e:{switch(n=e,u=i,u){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Za(n,t,Gt,!Pa);break e;case 2:Nt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(i=Ji+300-Le(),10<i)){if(Za(n,t,Gt,!Pa),un(n,0,!0)!==0)break e;n.timeoutHandle=Am(tm.bind(null,n,a,Nt,Lr,Zi,t,Gt,En,is,Pa,u,2,-0,0),i);break e}tm(n,a,Nt,Lr,Zi,t,Gt,En,is,Pa,u,0,-0,0)}}break}while(!0);oa(e)}function tm(e,t,a,n,i,u,x,b,T,$,J,ee,Y,Q){if(e.timeoutHandle=-1,ee=t.subtreeFlags,(ee&8192||(ee&16785408)===16785408)&&(vl={stylesheets:null,count:0,unsuspend:K0},Qf(t),ee=P0(),ee!==null)){e.cancelPendingCommit=ee(im.bind(null,e,t,u,a,n,i,x,b,T,J,1,Y,Q)),Za(e,u,x,!$);return}im(e,t,u,a,n,i,x,b,T)}function c0(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var i=a[n],u=i.getSnapshot;i=i.value;try{if(!Et(u(),i))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 Za(e,t,a,n){t&=~Fi,t&=~En,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var i=t;0<i;){var u=31-ht(i),x=1<<u;n[u]=-1,i&=~x}a!==0&&Pl(e,a,t)}function _r(){return(_e&6)===0?(hl(0),!1):!0}function tc(){if(Re!==null){if(He===0)var e=Re.return;else e=Re,xa=wn=null,yi(e),ns=null,sl=0,e=Re;for(;e!==null;)Df(e.alternate,e),e=e.return;Re=null}}function ds(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,E0(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),tc(),Ke=e,Re=a=ha(e.current,null),Me=t,He=0,Ot=null,Pa=!1,os=ue(e,t),Qi=!1,is=Gt=Fi=En=Xa=Fe=0,Nt=fl=null,Zi=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var i=31-ht(n),u=1<<i;t|=e[i],n&=~u}return Ca=t,lr(),a}function am(e,t){Ee=null,k.H=Nr,t===Fs||t===hr?(t=yd(),He=3):t===gd?(t=yd(),He=4):He=t===vf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ot=t,Re===null&&(Fe=1,Ar(e,_t(t,e.current)))}function nm(){var e=k.H;return k.H=Nr,e===null?Nr:e}function sm(){var e=k.A;return k.A=o0,e}function ac(){Fe=4,Pa||(Me&4194048)!==Me&&qt.current!==null||(os=!0),(Xa&134217727)===0&&(En&134217727)===0||Ke===null||Za(Ke,Me,Gt,!1)}function nc(e,t,a){var n=_e;_e|=2;var i=nm(),u=sm();(Ke!==e||Me!==t)&&(Lr=null,ds(e,t)),t=!1;var x=Fe;e:do try{if(He!==0&&Re!==null){var b=Re,T=Ot;switch(He){case 8:tc(),x=6;break e;case 3:case 2:case 9:case 6:qt.current===null&&(t=!0);var $=He;if(He=0,Ot=null,fs(e,b,T,$),a&&os){x=0;break e}break;default:$=He,He=0,Ot=null,fs(e,b,T,$)}}u0(),x=Fe;break}catch(J){am(e,J)}while(!0);return t&&e.shellSuspendCounter++,xa=wn=null,_e=n,k.H=i,k.A=u,Re===null&&(Ke=null,Me=0,lr()),x}function u0(){for(;Re!==null;)lm(Re)}function d0(e,t){var a=_e;_e|=2;var n=nm(),i=sm();Ke!==e||Me!==t?(Lr=null,Ur=Le()+500,ds(e,t)):os=ue(e,t);e:do try{if(He!==0&&Re!==null){t=Re;var u=Ot;t:switch(He){case 1:He=0,Ot=null,fs(e,t,u,1);break;case 2:case 9:if(pd(u)){He=0,Ot=null,rm(t);break}t=function(){He!==2&&He!==9||Ke!==e||(He=7),oa(e)},u.then(t,t);break e;case 3:He=7;break e;case 4:He=5;break e;case 7:pd(u)?(He=0,Ot=null,rm(t)):(He=0,Ot=null,fs(e,t,u,7));break;case 5:var x=null;switch(Re.tag){case 26:x=Re.memoizedState;case 5:case 27:var b=Re;if(!x||qm(x)){He=0,Ot=null;var T=b.sibling;if(T!==null)Re=T;else{var $=b.return;$!==null?(Re=$,Hr($)):Re=null}break t}}He=0,Ot=null,fs(e,t,u,5);break;case 6:He=0,Ot=null,fs(e,t,u,6);break;case 8:tc(),Fe=6;break e;default:throw Error(c(462))}}f0();break}catch(J){am(e,J)}while(!0);return xa=wn=null,k.H=n,k.A=i,_e=a,Re!==null?0:(Ke=null,Me=0,lr(),Fe)}function f0(){for(;Re!==null&&!ua();)lm(Re)}function lm(e){var t=Mf(e.alternate,e,Ca);e.memoizedProps=e.pendingProps,t===null?Hr(e):Re=t}function rm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=kf(a,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=kf(a,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:yi(t);default:Df(a,t),t=Re=rd(t,Ca),t=Mf(a,t,Ca)}e.memoizedProps=e.pendingProps,t===null?Hr(e):Re=t}function fs(e,t,a,n){xa=wn=null,yi(t),ns=null,sl=0;var i=t.return;try{if(t0(e,i,t,a,Me)){Fe=1,Ar(e,_t(a,e.current)),Re=null;return}}catch(u){if(i!==null)throw Re=i,u;Fe=1,Ar(e,_t(a,e.current)),Re=null;return}t.flags&32768?(Ue||n===1?e=!0:os||(Me&536870912)!==0?e=!1:(Pa=e=!0,(n===2||n===9||n===3||n===6)&&(n=qt.current,n!==null&&n.tag===13&&(n.flags|=16384))),om(t,e)):Hr(t)}function Hr(e){var t=e;do{if((t.flags&32768)!==0){om(t,Pa);return}e=t.return;var a=n0(t.alternate,t,Ca);if(a!==null){Re=a;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);Fe===0&&(Fe=5)}function om(e,t){do{var a=s0(e.alternate,e);if(a!==null){a.flags&=32767,Re=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Re=e;return}Re=e=a}while(e!==null);Fe=6,Re=null}function im(e,t,a,n,i,u,x,b,T){e.cancelPendingCommit=null;do Br();while(dt!==0);if((_e&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(u=t.lanes|t.childLanes,u|=Xo,dn(e,a,u,x,b,T),e===Ke&&(Re=Ke=null,Me=0),cs=t,Fa=e,us=a,Ii=u,Wi=i,If=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,p0(da,function(){return mm(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=k.T,k.T=null,i=G.p,G.p=2,x=_e,_e|=4;try{l0(e,t,a)}finally{_e=x,G.p=i,k.T=n}}dt=1,cm(),um(),dm()}}function cm(){if(dt===1){dt=0;var e=Fa,t=cs,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var n=G.p;G.p=2;var i=_e;_e|=4;try{Yf(t,e);var u=gc,x=Zu(e.containerInfo),b=u.focusedElem,T=u.selectionRange;if(x!==b&&b&&b.ownerDocument&&Fu(b.ownerDocument.documentElement,b)){if(T!==null&&Go(b)){var $=T.start,J=T.end;if(J===void 0&&(J=$),"selectionStart"in b)b.selectionStart=$,b.selectionEnd=Math.min(J,b.value.length);else{var ee=b.ownerDocument||document,Y=ee&&ee.defaultView||window;if(Y.getSelection){var Q=Y.getSelection(),ve=b.textContent.length,ye=Math.min(T.start,ve),Ge=T.end===void 0?ye:Math.min(T.end,ve);!Q.extend&&ye>Ge&&(x=Ge,Ge=ye,ye=x);var H=Qu(b,ye),M=Qu(b,Ge);if(H&&M&&(Q.rangeCount!==1||Q.anchorNode!==H.node||Q.anchorOffset!==H.offset||Q.focusNode!==M.node||Q.focusOffset!==M.offset)){var q=ee.createRange();q.setStart(H.node,H.offset),Q.removeAllRanges(),ye>Ge?(Q.addRange(q),Q.extend(M.node,M.offset)):(q.setEnd(M.node,M.offset),Q.addRange(q))}}}}for(ee=[],Q=b;Q=Q.parentNode;)Q.nodeType===1&&ee.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<ee.length;b++){var W=ee[b];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}Jr=!!hc,gc=hc=null}finally{_e=i,G.p=n,k.T=a}}e.current=t,dt=2}}function um(){if(dt===2){dt=0;var e=Fa,t=cs,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var n=G.p;G.p=2;var i=_e;_e|=4;try{qf(e,t.alternate,t)}finally{_e=i,G.p=n,k.T=a}}dt=3}}function dm(){if(dt===4||dt===3){dt=0,rn();var e=Fa,t=cs,a=us,n=If;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?dt=5:(dt=0,cs=Fa=null,fm(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Qa=null),Mn(a),t=t.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(Da,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=k.T,i=G.p,G.p=2,k.T=null;try{for(var u=e.onRecoverableError,x=0;x<n.length;x++){var b=n[x];u(b.value,{componentStack:b.stack})}}finally{k.T=t,G.p=i}}(us&3)!==0&&Br(),oa(e),i=e.pendingLanes,(a&4194090)!==0&&(i&42)!==0?e===ec?ml++:(ml=0,ec=e):ml=0,hl(0)}}function fm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Xs(t)))}function Br(e){return cm(),um(),dm(),mm()}function mm(){if(dt!==5)return!1;var e=Fa,t=Ii;Ii=0;var a=Mn(us),n=k.T,i=G.p;try{G.p=32>a?32:a,k.T=null,a=Wi,Wi=null;var u=Fa,x=us;if(dt=0,cs=Fa=null,us=0,(_e&6)!==0)throw Error(c(331));var b=_e;if(_e|=4,Zf(u.current),Xf(u,u.current,x,a),_e=b,hl(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(Da,u)}catch{}return!0}finally{G.p=i,k.T=n,fm(e,t)}}function hm(e,t,a){t=_t(a,t),t=Mi(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(Qt(e,2),oa(e))}function $e(e,t,a){if(e.tag===3)hm(e,e,a);else for(;t!==null;){if(t.tag===3){hm(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Qa===null||!Qa.has(n))){e=_t(a,e),a=yf(2),n=Ba(t,a,2),n!==null&&(bf(a,n,t,e),Qt(n,2),oa(n));break}}t=t.return}}function sc(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new i0;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(a)||(Qi=!0,i.add(a),e=m0.bind(null,e,t,a),t.then(e,e))}function m0(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ke===e&&(Me&a)===a&&(Fe===4||Fe===3&&(Me&62914560)===Me&&300>Le()-Ji?(_e&2)===0&&ds(e,0):Fi|=a,is===Me&&(is=0)),oa(e)}function gm(e,t){t===0&&(t=Pt()),e=Xn(e,t),e!==null&&(Qt(e,t),oa(e))}function h0(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),gm(e,a)}function g0(e,t){var a=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(c(314))}n!==null&&n.delete(t),gm(e,a)}function p0(e,t){return Je(e,t)}var Vr=null,ms=null,lc=!1,qr=!1,rc=!1,Tn=0;function oa(e){e!==ms&&e.next===null&&(ms===null?Vr=ms=e:ms=ms.next=e),qr=!0,lc||(lc=!0,y0())}function hl(e,t){if(!rc&&qr){rc=!0;do for(var a=!1,n=Vr;n!==null;){if(e!==0){var i=n.pendingLanes;if(i===0)var u=0;else{var x=n.suspendedLanes,b=n.pingedLanes;u=(1<<31-ht(42|e)+1)-1,u&=i&~(x&~b),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,bm(n,u))}else u=Me,u=un(n,n===Ke?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(u&3)===0||ue(n,u)||(a=!0,bm(n,u));n=n.next}while(a);rc=!1}}function x0(){pm()}function pm(){qr=lc=!1;var e=0;Tn!==0&&(k0()&&(e=Tn),Tn=0);for(var t=Le(),a=null,n=Vr;n!==null;){var i=n.next,u=xm(n,t);u===0?(n.next=null,a===null?Vr=i:a.next=i,i===null&&(ms=a)):(a=n,(e!==0||(u&3)!==0)&&(qr=!0)),n=i}hl(e)}function xm(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var x=31-ht(u),b=1<<x,T=i[x];T===-1?((b&a)===0||(b&n)!==0)&&(i[x]=oe(b,t)):T<=t&&(e.expiredLanes|=b),u&=~b}if(t=Ke,a=Me,a=un(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(He===2||He===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Ct(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ue(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&Ct(n),Mn(a)){case 2:case 8:a=Ma;break;case 32:a=da;break;case 268435456:a=Rs;break;default:a=da}return n=ym.bind(null,e),a=Je(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&Ct(n),e.callbackPriority=2,e.callbackNode=null,2}function ym(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Br()&&e.callbackNode!==a)return null;var n=Me;return n=un(e,e===Ke?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(em(e,n,t),xm(e,Le()),e.callbackNode!=null&&e.callbackNode===a?ym.bind(null,e):null)}function bm(e,t){if(Br())return null;em(e,t,!0)}function y0(){T0(function(){(_e&6)!==0?Je(Oa,x0):pm()})}function oc(){return Tn===0&&(Tn=pe()),Tn}function vm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Il(""+e)}function wm(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function b0(e,t,a,n,i){if(t==="submit"&&a&&a.stateNode===i){var u=vm((i[yt]||null).action),x=n.submitter;x&&(t=(t=x[yt]||null)?vm(t.formAction):x.getAttribute("formAction"),t!==null&&(u=t,x=null));var b=new ar("action","action",null,n,i);e.push({event:b,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Tn!==0){var T=x?wm(i,x):new FormData(i);Ei(a,{pending:!0,data:T,method:i.method,action:u},null,T)}}else typeof u=="function"&&(b.preventDefault(),T=x?wm(i,x):new FormData(i),Ei(a,{pending:!0,data:T,method:i.method,action:u},u,T))},currentTarget:i}]})}}for(var ic=0;ic<Po.length;ic++){var cc=Po[ic],v0=cc.toLowerCase(),w0=cc[0].toUpperCase()+cc.slice(1);Zt(v0,"on"+w0)}Zt(Wu,"onAnimationEnd"),Zt(ed,"onAnimationIteration"),Zt(td,"onAnimationStart"),Zt("dblclick","onDoubleClick"),Zt("focusin","onFocus"),Zt("focusout","onBlur"),Zt(Hp,"onTransitionRun"),Zt(Bp,"onTransitionStart"),Zt(Vp,"onTransitionCancel"),Zt(ad,"onTransitionEnd"),_n("onMouseEnter",["mouseout","mouseover"]),_n("onMouseLeave",["mouseout","mouseover"]),_n("onPointerEnter",["pointerout","pointerover"]),_n("onPointerLeave",["pointerout","pointerover"]),fn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fn("onBeforeInput",["compositionend","keypress","textInput","paste"]),fn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gl="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(" "),j0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gl));function jm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],i=n.event;n=n.listeners;e:{var u=void 0;if(t)for(var x=n.length-1;0<=x;x--){var b=n[x],T=b.instance,$=b.currentTarget;if(b=b.listener,T!==u&&i.isPropagationStopped())break e;u=b,i.currentTarget=$;try{u(i)}catch(J){Tr(J)}i.currentTarget=null,u=T}else for(x=0;x<n.length;x++){if(b=n[x],T=b.instance,$=b.currentTarget,b=b.listener,T!==u&&i.isPropagationStopped())break e;u=b,i.currentTarget=$;try{u(i)}catch(J){Tr(J)}i.currentTarget=null,u=T}}}}function Oe(e,t){var a=t[jo];a===void 0&&(a=t[jo]=new Set);var n=e+"__bubble";a.has(n)||(Sm(t,e,2,!1),a.add(n))}function uc(e,t,a){var n=0;t&&(n|=4),Sm(a,e,n,t)}var Gr="_reactListening"+Math.random().toString(36).slice(2);function dc(e){if(!e[Gr]){e[Gr]=!0,gu.forEach(function(a){a!=="selectionchange"&&(j0.has(a)||uc(a,!1,e),uc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Gr]||(t[Gr]=!0,uc("selectionchange",!1,t))}}function Sm(e,t,a,n){switch(Xm(t)){case 2:var i=F0;break;case 8:i=Z0;break;default:i=Cc}a=i.bind(null,t,a,e),i=void 0,!zo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function fc(e,t,a,n,i){var u=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var x=n.tag;if(x===3||x===4){var b=n.stateNode.containerInfo;if(b===i)break;if(x===4)for(x=n.return;x!==null;){var T=x.tag;if((T===3||T===4)&&x.stateNode.containerInfo===i)return;x=x.return}for(;b!==null;){if(x=Dn(b),x===null)return;if(T=x.tag,T===5||T===6||T===26||T===27){n=u=x;continue e}b=b.parentNode}}n=n.return}Au(function(){var $=u,J=Oo(a),ee=[];e:{var Y=nd.get(e);if(Y!==void 0){var Q=ar,ve=e;switch(e){case"keypress":if(er(a)===0)break e;case"keydown":case"keyup":Q=pp;break;case"focusin":ve="focus",Q=_o;break;case"focusout":ve="blur",Q=_o;break;case"beforeblur":case"afterblur":Q=_o;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=Mu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=sp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=bp;break;case Wu:case ed:case td:Q=op;break;case ad:Q=wp;break;case"scroll":case"scrollend":Q=ap;break;case"wheel":Q=Sp;break;case"copy":case"cut":case"paste":Q=cp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Du;break;case"toggle":case"beforetoggle":Q=Cp}var ye=(t&4)!==0,Ge=!ye&&(e==="scroll"||e==="scrollend"),H=ye?Y!==null?Y+"Capture":null:Y;ye=[];for(var M=$,q;M!==null;){var W=M;if(q=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||q===null||H===null||(W=Ds(M,H),W!=null&&ye.push(pl(M,W,q))),Ge)break;M=M.return}0<ye.length&&(Y=new Q(Y,ve,null,a,J),ee.push({event:Y,listeners:ye}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",Y&&a!==Ro&&(ve=a.relatedTarget||a.fromElement)&&(Dn(ve)||ve[zn]))break e;if((Q||Y)&&(Y=J.window===J?J:(Y=J.ownerDocument)?Y.defaultView||Y.parentWindow:window,Q?(ve=a.relatedTarget||a.toElement,Q=$,ve=ve?Dn(ve):null,ve!==null&&(Ge=f(ve),ye=ve.tag,ve!==Ge||ye!==5&&ye!==27&&ye!==6)&&(ve=null)):(Q=null,ve=$),Q!==ve)){if(ye=Mu,W="onMouseLeave",H="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ye=Du,W="onPointerLeave",H="onPointerEnter",M="pointer"),Ge=Q==null?Y:zs(Q),q=ve==null?Y:zs(ve),Y=new ye(W,M+"leave",Q,a,J),Y.target=Ge,Y.relatedTarget=q,W=null,Dn(J)===$&&(ye=new ye(H,M+"enter",ve,a,J),ye.target=q,ye.relatedTarget=Ge,W=ye),Ge=W,Q&&ve)t:{for(ye=Q,H=ve,M=0,q=ye;q;q=hs(q))M++;for(q=0,W=H;W;W=hs(W))q++;for(;0<M-q;)ye=hs(ye),M--;for(;0<q-M;)H=hs(H),q--;for(;M--;){if(ye===H||H!==null&&ye===H.alternate)break t;ye=hs(ye),H=hs(H)}ye=null}else ye=null;Q!==null&&Nm(ee,Y,Q,ye,!1),ve!==null&&Ge!==null&&Nm(ee,Ge,ve,ye,!0)}}e:{if(Y=$?zs($):window,Q=Y.nodeName&&Y.nodeName.toLowerCase(),Q==="select"||Q==="input"&&Y.type==="file")var fe=Gu;else if(Vu(Y))if($u)fe=Up;else{fe=zp;var Ae=Mp}else Q=Y.nodeName,!Q||Q.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?$&&Ao($.elementType)&&(fe=Gu):fe=Dp;if(fe&&(fe=fe(e,$))){qu(ee,fe,a,J);break e}Ae&&Ae(e,Y,$),e==="focusout"&&$&&Y.type==="number"&&$.memoizedProps.value!=null&&To(Y,"number",Y.value)}switch(Ae=$?zs($):window,e){case"focusin":(Vu(Ae)||Ae.contentEditable==="true")&&(Kn=Ae,$o=$,Gs=null);break;case"focusout":Gs=$o=Kn=null;break;case"mousedown":Ko=!0;break;case"contextmenu":case"mouseup":case"dragend":Ko=!1,Ju(ee,a,J);break;case"selectionchange":if(_p)break;case"keydown":case"keyup":Ju(ee,a,J)}var ge;if(Bo)e:{switch(e){case"compositionstart":var be="onCompositionStart";break e;case"compositionend":be="onCompositionEnd";break e;case"compositionupdate":be="onCompositionUpdate";break e}be=void 0}else $n?Hu(e,a)&&(be="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(be="onCompositionStart");be&&(Uu&&a.locale!=="ko"&&($n||be!=="onCompositionStart"?be==="onCompositionEnd"&&$n&&(ge=Ru()):(Ua=J,Do="value"in Ua?Ua.value:Ua.textContent,$n=!0)),Ae=$r($,be),0<Ae.length&&(be=new zu(be,e,null,a,J),ee.push({event:be,listeners:Ae}),ge?be.data=ge:(ge=Bu(a),ge!==null&&(be.data=ge)))),(ge=Ep?Tp(e,a):Ap(e,a))&&(be=$r($,"onBeforeInput"),0<be.length&&(Ae=new zu("onBeforeInput","beforeinput",null,a,J),ee.push({event:Ae,listeners:be}),Ae.data=ge)),b0(ee,e,$,a,J)}jm(ee,t)})}function pl(e,t,a){return{instance:e,listener:t,currentTarget:a}}function $r(e,t){for(var a=t+"Capture",n=[];e!==null;){var i=e,u=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||u===null||(i=Ds(e,a),i!=null&&n.unshift(pl(e,i,u)),i=Ds(e,t),i!=null&&n.push(pl(e,i,u))),e.tag===3)return n;e=e.return}return[]}function hs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nm(e,t,a,n,i){for(var u=t._reactName,x=[];a!==null&&a!==n;){var b=a,T=b.alternate,$=b.stateNode;if(b=b.tag,T!==null&&T===n)break;b!==5&&b!==26&&b!==27||$===null||(T=$,i?($=Ds(a,u),$!=null&&x.unshift(pl(a,$,T))):i||($=Ds(a,u),$!=null&&x.push(pl(a,$,T)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var S0=/\r\n?/g,N0=/\u0000|\uFFFD/g;function Cm(e){return(typeof e=="string"?e:""+e).replace(S0,`
|
|
49
|
-
`).replace(N0,"")}function km(e,t){return t=Cm(t),Cm(e)===t}function Kr(){}function qe(e,t,a,n,i,u){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Vn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Vn(e,""+n);break;case"className":Fl(e,"class",n);break;case"tabIndex":Fl(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Fl(e,a,n);break;case"style":Eu(e,n,u);break;case"data":if(t!=="object"){Fl(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Il(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(a==="formAction"?(t!=="input"&&qe(e,t,"name",i.name,i,null),qe(e,t,"formEncType",i.formEncType,i,null),qe(e,t,"formMethod",i.formMethod,i,null),qe(e,t,"formTarget",i.formTarget,i,null)):(qe(e,t,"encType",i.encType,i,null),qe(e,t,"method",i.method,i,null),qe(e,t,"target",i.target,i,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Il(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Kr);break;case"onScroll":n!=null&&Oe("scroll",e);break;case"onScrollEnd":n!=null&&Oe("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=Il(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":Oe("beforetoggle",e),Oe("toggle",e),Ql(e,"popover",n);break;case"xlinkActuate":fa(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":fa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":fa(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":fa(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":fa(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":fa(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":fa(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":fa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":fa(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Ql(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ep.get(a)||a,Ql(e,a,n))}}function mc(e,t,a,n,i,u){switch(a){case"style":Eu(e,n,u);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Vn(e,n):(typeof n=="number"||typeof n=="bigint")&&Vn(e,""+n);break;case"onScroll":n!=null&&Oe("scroll",e);break;case"onScrollEnd":n!=null&&Oe("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Kr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!pu.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),u=e[yt]||null,u=u!=null?u[a]:null,typeof u=="function"&&e.removeEventListener(t,u,i),typeof n=="function")){typeof u!="function"&&u!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,i);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Ql(e,a,n)}}}function ft(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Oe("error",e),Oe("load",e);var n=!1,i=!1,u;for(u in a)if(a.hasOwnProperty(u)){var x=a[u];if(x!=null)switch(u){case"src":n=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:qe(e,t,u,x,a,null)}}i&&qe(e,t,"srcSet",a.srcSet,a,null),n&&qe(e,t,"src",a.src,a,null);return;case"input":Oe("invalid",e);var b=u=x=i=null,T=null,$=null;for(n in a)if(a.hasOwnProperty(n)){var J=a[n];if(J!=null)switch(n){case"name":i=J;break;case"type":x=J;break;case"checked":T=J;break;case"defaultChecked":$=J;break;case"value":u=J;break;case"defaultValue":b=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(c(137,t));break;default:qe(e,t,n,J,a,null)}}Su(e,u,b,T,$,x,i,!1),Zl(e);return;case"select":Oe("invalid",e),n=x=u=null;for(i in a)if(a.hasOwnProperty(i)&&(b=a[i],b!=null))switch(i){case"value":u=b;break;case"defaultValue":x=b;break;case"multiple":n=b;default:qe(e,t,i,b,a,null)}t=u,a=x,e.multiple=!!n,t!=null?Bn(e,!!n,t,!1):a!=null&&Bn(e,!!n,a,!0);return;case"textarea":Oe("invalid",e),u=i=n=null;for(x in a)if(a.hasOwnProperty(x)&&(b=a[x],b!=null))switch(x){case"value":n=b;break;case"defaultValue":i=b;break;case"children":u=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(c(91));break;default:qe(e,t,x,b,a,null)}Cu(e,n,i,u),Zl(e);return;case"option":for(T in a)if(a.hasOwnProperty(T)&&(n=a[T],n!=null))switch(T){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:qe(e,t,T,n,a,null)}return;case"dialog":Oe("beforetoggle",e),Oe("toggle",e),Oe("cancel",e),Oe("close",e);break;case"iframe":case"object":Oe("load",e);break;case"video":case"audio":for(n=0;n<gl.length;n++)Oe(gl[n],e);break;case"image":Oe("error",e),Oe("load",e);break;case"details":Oe("toggle",e);break;case"embed":case"source":case"link":Oe("error",e),Oe("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($ in a)if(a.hasOwnProperty($)&&(n=a[$],n!=null))switch($){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:qe(e,t,$,n,a,null)}return;default:if(Ao(t)){for(J in a)a.hasOwnProperty(J)&&(n=a[J],n!==void 0&&mc(e,t,J,n,a,void 0));return}}for(b in a)a.hasOwnProperty(b)&&(n=a[b],n!=null&&qe(e,t,b,n,a,null))}function C0(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,u=null,x=null,b=null,T=null,$=null,J=null;for(Q in a){var ee=a[Q];if(a.hasOwnProperty(Q)&&ee!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":T=ee;default:n.hasOwnProperty(Q)||qe(e,t,Q,null,n,ee)}}for(var Y in n){var Q=n[Y];if(ee=a[Y],n.hasOwnProperty(Y)&&(Q!=null||ee!=null))switch(Y){case"type":u=Q;break;case"name":i=Q;break;case"checked":$=Q;break;case"defaultChecked":J=Q;break;case"value":x=Q;break;case"defaultValue":b=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(c(137,t));break;default:Q!==ee&&qe(e,t,Y,Q,n,ee)}}Eo(e,x,b,T,$,J,u,i);return;case"select":Q=x=b=Y=null;for(u in a)if(T=a[u],a.hasOwnProperty(u)&&T!=null)switch(u){case"value":break;case"multiple":Q=T;default:n.hasOwnProperty(u)||qe(e,t,u,null,n,T)}for(i in n)if(u=n[i],T=a[i],n.hasOwnProperty(i)&&(u!=null||T!=null))switch(i){case"value":Y=u;break;case"defaultValue":b=u;break;case"multiple":x=u;default:u!==T&&qe(e,t,i,u,n,T)}t=b,a=x,n=Q,Y!=null?Bn(e,!!a,Y,!1):!!n!=!!a&&(t!=null?Bn(e,!!a,t,!0):Bn(e,!!a,a?[]:"",!1));return;case"textarea":Q=Y=null;for(b in a)if(i=a[b],a.hasOwnProperty(b)&&i!=null&&!n.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:qe(e,t,b,null,n,i)}for(x in n)if(i=n[x],u=a[x],n.hasOwnProperty(x)&&(i!=null||u!=null))switch(x){case"value":Y=i;break;case"defaultValue":Q=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(c(91));break;default:i!==u&&qe(e,t,x,i,n,u)}Nu(e,Y,Q);return;case"option":for(var ve in a)if(Y=a[ve],a.hasOwnProperty(ve)&&Y!=null&&!n.hasOwnProperty(ve))switch(ve){case"selected":e.selected=!1;break;default:qe(e,t,ve,null,n,Y)}for(T in n)if(Y=n[T],Q=a[T],n.hasOwnProperty(T)&&Y!==Q&&(Y!=null||Q!=null))switch(T){case"selected":e.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:qe(e,t,T,Y,n,Q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ye in a)Y=a[ye],a.hasOwnProperty(ye)&&Y!=null&&!n.hasOwnProperty(ye)&&qe(e,t,ye,null,n,Y);for($ in n)if(Y=n[$],Q=a[$],n.hasOwnProperty($)&&Y!==Q&&(Y!=null||Q!=null))switch($){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(c(137,t));break;default:qe(e,t,$,Y,n,Q)}return;default:if(Ao(t)){for(var Ge in a)Y=a[Ge],a.hasOwnProperty(Ge)&&Y!==void 0&&!n.hasOwnProperty(Ge)&&mc(e,t,Ge,void 0,n,Y);for(J in n)Y=n[J],Q=a[J],!n.hasOwnProperty(J)||Y===Q||Y===void 0&&Q===void 0||mc(e,t,J,Y,n,Q);return}}for(var H in a)Y=a[H],a.hasOwnProperty(H)&&Y!=null&&!n.hasOwnProperty(H)&&qe(e,t,H,null,n,Y);for(ee in n)Y=n[ee],Q=a[ee],!n.hasOwnProperty(ee)||Y===Q||Y==null&&Q==null||qe(e,t,ee,Y,n,Q)}var hc=null,gc=null;function Yr(e){return e.nodeType===9?e:e.ownerDocument}function Em(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 Tm(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 pc(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 xc=null;function k0(){var e=window.event;return e&&e.type==="popstate"?e===xc?!1:(xc=e,!0):(xc=null,!1)}var Am=typeof setTimeout=="function"?setTimeout:void 0,E0=typeof clearTimeout=="function"?clearTimeout:void 0,Rm=typeof Promise=="function"?Promise:void 0,T0=typeof queueMicrotask=="function"?queueMicrotask:typeof Rm<"u"?function(e){return Rm.resolve(null).then(e).catch(A0)}:Am;function A0(e){setTimeout(function(){throw e})}function Ja(e){return e==="head"}function Om(e,t){var a=t,n=0,i=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"){if(0<n&&8>n){a=n;var x=e.ownerDocument;if(a&1&&xl(x.documentElement),a&2&&xl(x.body),a&4)for(a=x.head,xl(a),x=a.firstChild;x;){var b=x.nextSibling,T=x.nodeName;x[Ms]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&x.rel.toLowerCase()==="stylesheet"||a.removeChild(x),x=b}}if(i===0){e.removeChild(u),Cl(t);return}i--}else a==="$"||a==="$?"||a==="$!"?i++:n=a.charCodeAt(0)-48;else n=0;a=u}while(a);Cl(t)}function yc(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":yc(a),So(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function R0(e,t,a,n){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Ms])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=It(e.nextSibling),e===null)break}return null}function O0(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=It(e.nextSibling),e===null))return null;return e}function bc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function M0(e,t){var a=e.ownerDocument;if(e.data!=="$?"||a.readyState==="complete")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function It(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 vc=null;function Mm(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 zm(e,t,a){switch(t=Yr(a),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function xl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);So(e)}var $t=new Map,Dm=new Set;function Pr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ka=G.d;G.d={f:z0,r:D0,D:U0,C:L0,L:_0,m:H0,X:V0,S:B0,M:q0};function z0(){var e=ka.f(),t=_r();return e||t}function D0(e){var t=Un(e);t!==null&&t.tag===5&&t.type==="form"?Wd(t):ka.r(e)}var gs=typeof document>"u"?null:document;function Um(e,t,a){var n=gs;if(n&&typeof t=="string"&&t){var i=Lt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),Dm.has(i)||(Dm.add(i),e={rel:e,crossOrigin:a,href:t},n.querySelector(i)===null&&(t=n.createElement("link"),ft(t,"link",e),rt(t),n.head.appendChild(t)))}}function U0(e){ka.D(e),Um("dns-prefetch",e,null)}function L0(e,t){ka.C(e,t),Um("preconnect",e,t)}function _0(e,t,a){ka.L(e,t,a);var n=gs;if(n&&e&&t){var i='link[rel="preload"][as="'+Lt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+Lt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+Lt(a.imageSizes)+'"]')):i+='[href="'+Lt(e)+'"]';var u=i;switch(t){case"style":u=ps(e);break;case"script":u=xs(e)}$t.has(u)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),$t.set(u,e),n.querySelector(i)!==null||t==="style"&&n.querySelector(yl(u))||t==="script"&&n.querySelector(bl(u))||(t=n.createElement("link"),ft(t,"link",e),rt(t),n.head.appendChild(t)))}}function H0(e,t){ka.m(e,t);var a=gs;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Lt(n)+'"][href="'+Lt(e)+'"]',u=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=xs(e)}if(!$t.has(u)&&(e=y({rel:"modulepreload",href:e},t),$t.set(u,e),a.querySelector(i)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(bl(u)))return}n=a.createElement("link"),ft(n,"link",e),rt(n),a.head.appendChild(n)}}}function B0(e,t,a){ka.S(e,t,a);var n=gs;if(n&&e){var i=Ln(n).hoistableStyles,u=ps(e);t=t||"default";var x=i.get(u);if(!x){var b={loading:0,preload:null};if(x=n.querySelector(yl(u)))b.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=$t.get(u))&&wc(e,a);var T=x=n.createElement("link");rt(T),ft(T,"link",e),T._p=new Promise(function($,J){T.onload=$,T.onerror=J}),T.addEventListener("load",function(){b.loading|=1}),T.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Xr(x,t,n)}x={type:"stylesheet",instance:x,count:1,state:b},i.set(u,x)}}}function V0(e,t){ka.X(e,t);var a=gs;if(a&&e){var n=Ln(a).hoistableScripts,i=xs(e),u=n.get(i);u||(u=a.querySelector(bl(i)),u||(e=y({src:e,async:!0},t),(t=$t.get(i))&&jc(e,t),u=a.createElement("script"),rt(u),ft(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(i,u))}}function q0(e,t){ka.M(e,t);var a=gs;if(a&&e){var n=Ln(a).hoistableScripts,i=xs(e),u=n.get(i);u||(u=a.querySelector(bl(i)),u||(e=y({src:e,async:!0,type:"module"},t),(t=$t.get(i))&&jc(e,t),u=a.createElement("script"),rt(u),ft(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(i,u))}}function Lm(e,t,a,n){var i=(i=ae.current)?Pr(i):null;if(!i)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=ps(a.href),a=Ln(i).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=ps(a.href);var u=Ln(i).hoistableStyles,x=u.get(e);if(x||(i=i.ownerDocument||i,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,x),(u=i.querySelector(yl(e)))&&!u._p&&(x.instance=u,x.state.loading=5),$t.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},$t.set(e,a),u||G0(i,e,a,x.state))),t&&n===null)throw Error(c(528,""));return x}if(t&&n!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=xs(a),a=Ln(i).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function ps(e){return'href="'+Lt(e)+'"'}function yl(e){return'link[rel="stylesheet"]['+e+"]"}function _m(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function G0(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),ft(t,"link",a),rt(t),e.head.appendChild(t))}function xs(e){return'[src="'+Lt(e)+'"]'}function bl(e){return"script[async]"+e}function Hm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Lt(a.href)+'"]');if(n)return t.instance=n,rt(n),n;var i=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),rt(n),ft(n,"style",i),Xr(n,a.precedence,e),t.instance=n;case"stylesheet":i=ps(a.href);var u=e.querySelector(yl(i));if(u)return t.state.loading|=4,t.instance=u,rt(u),u;n=_m(a),(i=$t.get(i))&&wc(n,i),u=(e.ownerDocument||e).createElement("link"),rt(u);var x=u;return x._p=new Promise(function(b,T){x.onload=b,x.onerror=T}),ft(u,"link",n),t.state.loading|=4,Xr(u,a.precedence,e),t.instance=u;case"script":return u=xs(a.src),(i=e.querySelector(bl(u)))?(t.instance=i,rt(i),i):(n=a,(i=$t.get(u))&&(n=y({},a),jc(n,i)),e=e.ownerDocument||e,i=e.createElement("script"),rt(i),ft(i,"link",n),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Xr(n,a.precedence,e));return t.instance}function Xr(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=n.length?n[n.length-1]:null,u=i,x=0;x<n.length;x++){var b=n[x];if(b.dataset.precedence===t)u=b;else if(u!==i)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function wc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Qr=null;function Bm(e,t,a){if(Qr===null){var n=new Map,i=Qr=new Map;i.set(a,n)}else i=Qr,n=i.get(a),n||(n=new Map,i.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var u=a[i];if(!(u[Ms]||u[at]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var x=u.getAttribute(t)||"";x=e+x;var b=n.get(x);b?b.push(u):n.set(x,[u])}}return n}function Vm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function $0(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 qm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var vl=null;function K0(){}function Y0(e,t,a){if(vl===null)throw Error(c(475));var n=vl;if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var i=ps(a.href),u=e.querySelector(yl(i));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(n.count++,n=Fr.bind(n),e.then(n,n)),t.state.loading|=4,t.instance=u,rt(u);return}u=e.ownerDocument||e,a=_m(a),(i=$t.get(i))&&wc(a,i),u=u.createElement("link"),rt(u);var x=u;x._p=new Promise(function(b,T){x.onload=b,x.onerror=T}),ft(u,"link",a),t.instance=u}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(n.count++,t=Fr.bind(n),e.addEventListener("load",t),e.addEventListener("error",t))}}function P0(){if(vl===null)throw Error(c(475));var e=vl;return e.stylesheets&&e.count===0&&Sc(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&Sc(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a)}}:null}function Fr(){if(this.count--,this.count===0){if(this.stylesheets)Sc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zr=null;function Sc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zr=new Map,t.forEach(X0,e),Zr=null,Fr.call(e))}function X0(e,t){if(!(t.state.loading&4)){var a=Zr.get(e);if(a)var n=a.get(null);else{a=new Map,Zr.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<i.length;u++){var x=i[u];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),n=x)}n&&a.set(null,n)}i=t.instance,x=i.getAttribute("data-precedence"),u=a.get(x)||n,u===n&&a.set(null,i),a.set(x,i),this.count++,n=Fr.bind(this),i.addEventListener("load",n),i.addEventListener("error",n),u?u.parentNode.insertBefore(i,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var wl={$$typeof:z,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function Q0(e,t,a,n,i,u,x,b){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Xt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xt(0),this.hiddenUpdates=Xt(null),this.identifierPrefix=n,this.onUncaughtError=i,this.onCaughtError=u,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function Gm(e,t,a,n,i,u,x,b,T,$,J,ee){return e=new Q0(e,t,a,x,b,T,$,ee),t=1,u===!0&&(t|=24),u=Tt(3,null,null,t),e.current=u,u.stateNode=e,t=si(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:n,isDehydrated:a,cache:t},ii(u),e}function $m(e){return e?(e=Qn,e):Qn}function Km(e,t,a,n,i,u){i=$m(i),n.context===null?n.context=i:n.pendingContext=i,n=Ha(t),n.payload={element:a},u=u===void 0?null:u,u!==null&&(n.callback=u),a=Ba(e,n,t),a!==null&&(zt(a,e,t),Js(a,e,t))}function Ym(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Nc(e,t){Ym(e,t),(e=e.alternate)&&Ym(e,t)}function Pm(e){if(e.tag===13){var t=Xn(e,67108864);t!==null&&zt(t,e,67108864),Nc(e,67108864)}}var Jr=!0;function F0(e,t,a,n){var i=k.T;k.T=null;var u=G.p;try{G.p=2,Cc(e,t,a,n)}finally{G.p=u,k.T=i}}function Z0(e,t,a,n){var i=k.T;k.T=null;var u=G.p;try{G.p=8,Cc(e,t,a,n)}finally{G.p=u,k.T=i}}function Cc(e,t,a,n){if(Jr){var i=kc(n);if(i===null)fc(e,t,n,Ir,a),Qm(e,n);else if(I0(i,e,t,a,n))n.stopPropagation();else if(Qm(e,n),t&4&&-1<J0.indexOf(e)){for(;i!==null;){var u=Un(i);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var x=ta(u.pendingLanes);if(x!==0){var b=u;for(b.pendingLanes|=2,b.entangledLanes|=2;x;){var T=1<<31-ht(x);b.entanglements[1]|=T,x&=~T}oa(u),(_e&6)===0&&(Ur=Le()+500,hl(0))}}break;case 13:b=Xn(u,2),b!==null&&zt(b,u,2),_r(),Nc(u,2)}if(u=kc(n),u===null&&fc(e,t,n,Ir,a),u===i)break;i=u}i!==null&&n.stopPropagation()}else fc(e,t,n,null,a)}}function kc(e){return e=Oo(e),Ec(e)}var Ir=null;function Ec(e){if(Ir=null,e=Dn(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 Ir=e,null}function Xm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(vt()){case Oa:return 2;case Ma:return 8;case da:case za:return 32;case Rs:return 268435456;default:return 32}default:return 32}}var Tc=!1,Ia=null,Wa=null,en=null,jl=new Map,Sl=new Map,tn=[],J0="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 Qm(e,t){switch(e){case"focusin":case"focusout":Ia=null;break;case"dragenter":case"dragleave":Wa=null;break;case"mouseover":case"mouseout":en=null;break;case"pointerover":case"pointerout":jl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sl.delete(t.pointerId)}}function Nl(e,t,a,n,i,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:u,targetContainers:[i]},t!==null&&(t=Un(t),t!==null&&Pm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function I0(e,t,a,n,i){switch(t){case"focusin":return Ia=Nl(Ia,e,t,a,n,i),!0;case"dragenter":return Wa=Nl(Wa,e,t,a,n,i),!0;case"mouseover":return en=Nl(en,e,t,a,n,i),!0;case"pointerover":var u=i.pointerId;return jl.set(u,Nl(jl.get(u)||null,e,t,a,n,i)),!0;case"gotpointercapture":return u=i.pointerId,Sl.set(u,Nl(Sl.get(u)||null,e,t,a,n,i)),!0}return!1}function Fm(e){var t=Dn(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,Xl(e.priority,function(){if(a.tag===13){var n=Mt();n=aa(n);var i=Xn(a,n);i!==null&&zt(i,a,n),Nc(a,n)}});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=kc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);Ro=n,a.target.dispatchEvent(n),Ro=null}else return t=Un(a),t!==null&&Pm(t),e.blockedOn=a,!1;t.shift()}return!0}function Zm(e,t,a){Wr(e)&&a.delete(t)}function W0(){Tc=!1,Ia!==null&&Wr(Ia)&&(Ia=null),Wa!==null&&Wr(Wa)&&(Wa=null),en!==null&&Wr(en)&&(en=null),jl.forEach(Zm),Sl.forEach(Zm)}function eo(e,t){e.blockedOn===t&&(e.blockedOn=null,Tc||(Tc=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,W0)))}var to=null;function Jm(e){to!==e&&(to=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){to===e&&(to=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],i=e[t+2];if(typeof n!="function"){if(Ec(n||a)===null)continue;break}var u=Un(a);u!==null&&(e.splice(t,3),t-=3,Ei(u,{pending:!0,data:i,method:a.method,action:n},n,i))}}))}function Cl(e){function t(T){return eo(T,e)}Ia!==null&&eo(Ia,e),Wa!==null&&eo(Wa,e),en!==null&&eo(en,e),jl.forEach(t),Sl.forEach(t);for(var a=0;a<tn.length;a++){var n=tn[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<tn.length&&(a=tn[0],a.blockedOn===null);)Fm(a),a.blockedOn===null&&tn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var i=a[n],u=a[n+1],x=i[yt]||null;if(typeof u=="function")x||Jm(a);else if(x){var b=null;if(u&&u.hasAttribute("formAction")){if(i=u,x=u[yt]||null)b=x.formAction;else if(Ec(i)!==null)continue}else b=x.action;typeof b=="function"?a[n+1]=b:(a.splice(n,3),n-=3),Jm(a)}}}function Ac(e){this._internalRoot=e}ao.prototype.render=Ac.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,n=Mt();Km(a,n,e,t,null,null)},ao.prototype.unmount=Ac.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Km(e.current,2,null,e,null,null),_r(),t[zn]=null}};function ao(e){this._internalRoot=e}ao.prototype.unstable_scheduleHydration=function(e){if(e){var t=Os();e={blockedOn:null,target:e,priority:t};for(var a=0;a<tn.length&&t!==0&&t<tn[a].priority;a++);tn.splice(a,0,e),a===0&&Fm(e)}};var Im=o.version;if(Im!=="19.1.0")throw Error(c(527,Im,"19.1.0"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=g(t),e=e!==null?h(e):null,e=e===null?null:e.stateNode,e};var ex={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var no=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!no.isDisabled&&no.supportsFiber)try{Da=no.inject(ex),mt=no}catch{}}return El.createRoot=function(e,t){if(!d(e))throw Error(c(299));var a=!1,n="",i=hf,u=gf,x=pf,b=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(b=t.unstable_transitionCallbacks)),t=Gm(e,1,!1,null,null,a,n,i,u,x,b,null),e[zn]=t.current,dc(e),new Ac(t)},El.hydrateRoot=function(e,t,a){if(!d(e))throw Error(c(299));var n=!1,i="",u=hf,x=gf,b=pf,T=null,$=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(T=a.unstable_transitionCallbacks),a.formState!==void 0&&($=a.formState)),t=Gm(e,1,!0,t,a??null,n,i,u,x,b,T,$),t.context=$m(null),a=t.current,n=Mt(),n=aa(n),i=Ha(n),i.callback=null,Ba(a,i,n),a=n,t.current.lanes=a,Qt(t,a),oa(t),e[zn]=t.current,dc(e),new ao(t)},El.version="19.1.0",El}var ih;function ux(){if(ih)return Mc.exports;ih=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(o){console.error(o)}}return s(),Mc.exports=cx(),Mc.exports}var dx=ux();const ch=$h(dx);var Tl={},uh;function fx(){if(uh)return Tl;uh=1,Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.parse=m,Tl.serialize=h;const s=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,o=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,c=/^[\u0020-\u003A\u003D-\u007E]*$/,d=Object.prototype.toString,f=(()=>{const v=function(){};return v.prototype=Object.create(null),v})();function m(v,A){const N=new f,O=v.length;if(O<2)return N;const R=(A==null?void 0:A.decode)||y;let S=0;do{const C=v.indexOf("=",S);if(C===-1)break;const z=v.indexOf(";",S),P=z===-1?O:z;if(C>P){S=v.lastIndexOf(";",C-1)+1;continue}const L=p(v,S,C),I=g(v,C,L),K=v.slice(L,I);if(N[K]===void 0){let B=p(v,C+1,P),Z=g(v,P,B);const te=R(v.slice(B,Z));N[K]=te}S=P+1}while(S<O);return N}function p(v,A,N){do{const O=v.charCodeAt(A);if(O!==32&&O!==9)return A}while(++A<N);return N}function g(v,A,N){for(;A>N;){const O=v.charCodeAt(--A);if(O!==32&&O!==9)return A+1}return N}function h(v,A,N){const O=(N==null?void 0:N.encode)||encodeURIComponent;if(!s.test(v))throw new TypeError(`argument name is invalid: ${v}`);const R=O(A);if(!o.test(R))throw new TypeError(`argument val is invalid: ${A}`);let S=v+"="+R;if(!N)return S;if(N.maxAge!==void 0){if(!Number.isInteger(N.maxAge))throw new TypeError(`option maxAge is invalid: ${N.maxAge}`);S+="; Max-Age="+N.maxAge}if(N.domain){if(!r.test(N.domain))throw new TypeError(`option domain is invalid: ${N.domain}`);S+="; Domain="+N.domain}if(N.path){if(!c.test(N.path))throw new TypeError(`option path is invalid: ${N.path}`);S+="; Path="+N.path}if(N.expires){if(!j(N.expires)||!Number.isFinite(N.expires.valueOf()))throw new TypeError(`option expires is invalid: ${N.expires}`);S+="; Expires="+N.expires.toUTCString()}if(N.httpOnly&&(S+="; HttpOnly"),N.secure&&(S+="; Secure"),N.partitioned&&(S+="; Partitioned"),N.priority)switch(typeof N.priority=="string"?N.priority.toLowerCase():void 0){case"low":S+="; Priority=Low";break;case"medium":S+="; Priority=Medium";break;case"high":S+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${N.priority}`)}if(N.sameSite)switch(typeof N.sameSite=="string"?N.sameSite.toLowerCase():N.sameSite){case!0:case"strict":S+="; SameSite=Strict";break;case"lax":S+="; SameSite=Lax";break;case"none":S+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${N.sameSite}`)}return S}function y(v){if(v.indexOf("%")===-1)return v;try{return decodeURIComponent(v)}catch{return v}}function j(v){return d.call(v)==="[object Date]"}return Tl}fx();var dh="popstate";function mx(s={}){function o(c,d){let{pathname:f,search:m,hash:p}=c.location;return $c("",{pathname:f,search:m,hash:p},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function r(c,d){return typeof d=="string"?d:zl(d)}return gx(o,r,null,s)}function Pe(s,o){if(s===!1||s===null||typeof s>"u")throw new Error(o)}function Wt(s,o){if(!s){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function hx(){return Math.random().toString(36).substring(2,10)}function fh(s,o){return{usr:s.state,key:s.key,idx:o}}function $c(s,o,r=null,c){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof o=="string"?Cs(o):o,state:r,key:o&&o.key||c||hx()}}function zl({pathname:s="/",search:o="",hash:r=""}){return o&&o!=="?"&&(s+=o.charAt(0)==="?"?o:"?"+o),r&&r!=="#"&&(s+=r.charAt(0)==="#"?r:"#"+r),s}function Cs(s){let o={};if(s){let r=s.indexOf("#");r>=0&&(o.hash=s.substring(r),s=s.substring(0,r));let c=s.indexOf("?");c>=0&&(o.search=s.substring(c),s=s.substring(0,c)),s&&(o.pathname=s)}return o}function gx(s,o,r,c={}){let{window:d=document.defaultView,v5Compat:f=!1}=c,m=d.history,p="POP",g=null,h=y();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function y(){return(m.state||{idx:null}).idx}function j(){p="POP";let R=y(),S=R==null?null:R-h;h=R,g&&g({action:p,location:O.location,delta:S})}function v(R,S){p="PUSH";let C=$c(O.location,R,S);h=y()+1;let z=fh(C,h),P=O.createHref(C);try{m.pushState(z,"",P)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;d.location.assign(P)}f&&g&&g({action:p,location:O.location,delta:1})}function A(R,S){p="REPLACE";let C=$c(O.location,R,S);h=y();let z=fh(C,h),P=O.createHref(C);m.replaceState(z,"",P),f&&g&&g({action:p,location:O.location,delta:0})}function N(R){return px(R)}let O={get action(){return p},get location(){return s(d,m)},listen(R){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(dh,j),g=R,()=>{d.removeEventListener(dh,j),g=null}},createHref(R){return o(d,R)},createURL:N,encodeLocation(R){let S=N(R);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:v,replace:A,go(R){return m.go(R)}};return O}function px(s,o=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),Pe(r,"No window.location.(origin|href) available to create URL");let c=typeof s=="string"?s:zl(s);return c=c.replace(/ $/,"%20"),!o&&c.startsWith("//")&&(c=r+c),new URL(c,r)}function Kh(s,o,r="/"){return xx(s,o,r,!1)}function xx(s,o,r,c){let d=typeof o=="string"?Cs(o):o,f=Ra(d.pathname||"/",r);if(f==null)return null;let m=Yh(s);yx(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=Ax(f);p=Ex(m[g],h,c)}return p}function Yh(s,o=[],r=[],c=""){let d=(f,m,p)=>{let g={relativePath:p===void 0?f.path||"":p,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};g.relativePath.startsWith("/")&&(Pe(g.relativePath.startsWith(c),`Absolute route path "${g.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(c.length));let h=Ta([c,g.relativePath]),y=r.concat(g);f.children&&f.children.length>0&&(Pe(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),Yh(f.children,o,y,h)),!(f.path==null&&!f.index)&&o.push({path:h,score:Cx(h,f.index),routesMeta:y})};return s.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))d(f,m);else for(let g of Ph(f.path))d(f,m,g)}),o}function Ph(s){let o=s.split("/");if(o.length===0)return[];let[r,...c]=o,d=r.endsWith("?"),f=r.replace(/\?$/,"");if(c.length===0)return d?[f,""]:[f];let m=Ph(c.join("/")),p=[];return p.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&p.push(...m),p.map(g=>s.startsWith("/")&&g===""?"/":g)}function yx(s){s.sort((o,r)=>o.score!==r.score?r.score-o.score:kx(o.routesMeta.map(c=>c.childrenIndex),r.routesMeta.map(c=>c.childrenIndex)))}var bx=/^:[\w-]+$/,vx=3,wx=2,jx=1,Sx=10,Nx=-2,mh=s=>s==="*";function Cx(s,o){let r=s.split("/"),c=r.length;return r.some(mh)&&(c+=Nx),o&&(c+=wx),r.filter(d=>!mh(d)).reduce((d,f)=>d+(bx.test(f)?vx:f===""?jx:Sx),c)}function kx(s,o){return s.length===o.length&&s.slice(0,-1).every((c,d)=>c===o[d])?s[s.length-1]-o[o.length-1]:0}function Ex(s,o,r=!1){let{routesMeta:c}=s,d={},f="/",m=[];for(let p=0;p<c.length;++p){let g=c[p],h=p===c.length-1,y=f==="/"?o:o.slice(f.length)||"/",j=mo({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},y),v=g.route;if(!j&&h&&r&&!c[c.length-1].route.index&&(j=mo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!j)return null;Object.assign(d,j.params),m.push({params:d,pathname:Ta([f,j.pathname]),pathnameBase:zx(Ta([f,j.pathnameBase])),route:v}),j.pathnameBase!=="/"&&(f=Ta([f,j.pathnameBase]))}return m}function mo(s,o){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[r,c]=Tx(s.path,s.caseSensitive,s.end),d=o.match(r);if(!d)return null;let f=d[0],m=f.replace(/(.)\/+$/,"$1"),p=d.slice(1);return{params:c.reduce((h,{paramName:y,isOptional:j},v)=>{if(y==="*"){let N=p[v]||"";m=f.slice(0,f.length-N.length).replace(/(.)\/+$/,"$1")}const A=p[v];return j&&!A?h[y]=void 0:h[y]=(A||"").replace(/%2F/g,"/"),h},{}),pathname:f,pathnameBase:m,pattern:s}}function Tx(s,o=!1,r=!0){Wt(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let c=[],d="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,p,g)=>(c.push({paramName:p,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(c.push({paramName:"*"}),d+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?d+="\\/*$":s!==""&&s!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,o?void 0:"i"),c]}function Ax(s){try{return s.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return Wt(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),s}}function Ra(s,o){if(o==="/")return s;if(!s.toLowerCase().startsWith(o.toLowerCase()))return null;let r=o.endsWith("/")?o.length-1:o.length,c=s.charAt(r);return c&&c!=="/"?null:s.slice(r)||"/"}function Rx(s,o="/"){let{pathname:r,search:c="",hash:d=""}=typeof s=="string"?Cs(s):s;return{pathname:r?r.startsWith("/")?r:Ox(r,o):o,search:Dx(c),hash:Ux(d)}}function Ox(s,o){let r=o.replace(/\/+$/,"").split("/");return s.split("/").forEach(d=>{d===".."?r.length>1&&r.pop():d!=="."&&r.push(d)}),r.length>1?r.join("/"):"/"}function Lc(s,o,r,c){return`Cannot include a '${s}' character in a manually specified \`to.${o}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Mx(s){return s.filter((o,r)=>r===0||o.route.path&&o.route.path.length>0)}function tu(s){let o=Mx(s);return o.map((r,c)=>c===o.length-1?r.pathname:r.pathnameBase)}function au(s,o,r,c=!1){let d;typeof s=="string"?d=Cs(s):(d={...s},Pe(!d.pathname||!d.pathname.includes("?"),Lc("?","pathname","search",d)),Pe(!d.pathname||!d.pathname.includes("#"),Lc("#","pathname","hash",d)),Pe(!d.search||!d.search.includes("#"),Lc("#","search","hash",d)));let f=s===""||d.pathname==="",m=f?"/":d.pathname,p;if(m==null)p=r;else{let j=o.length-1;if(!c&&m.startsWith("..")){let v=m.split("/");for(;v[0]==="..";)v.shift(),j-=1;d.pathname=v.join("/")}p=j>=0?o[j]:"/"}let g=Rx(d,p),h=m&&m!=="/"&&m.endsWith("/"),y=(f||m===".")&&r.endsWith("/");return!g.pathname.endsWith("/")&&(h||y)&&(g.pathname+="/"),g}var Ta=s=>s.join("/").replace(/\/\/+/g,"/"),zx=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),Dx=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,Ux=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function Lx(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}var Xh=["POST","PUT","PATCH","DELETE"];new Set(Xh);var _x=["GET",...Xh];new Set(_x);var ks=w.createContext(null);ks.displayName="DataRouter";var yo=w.createContext(null);yo.displayName="DataRouterState";var Qh=w.createContext({isTransitioning:!1});Qh.displayName="ViewTransition";var Hx=w.createContext(new Map);Hx.displayName="Fetchers";var Bx=w.createContext(null);Bx.displayName="Await";var ea=w.createContext(null);ea.displayName="Navigation";var Ll=w.createContext(null);Ll.displayName="Location";var Kt=w.createContext({outlet:null,matches:[],isDataRoute:!1});Kt.displayName="Route";var nu=w.createContext(null);nu.displayName="RouteError";function Vx(s,{relative:o}={}){Pe(Es(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:c}=w.useContext(ea),{hash:d,pathname:f,search:m}=_l(s,{relative:o}),p=f;return r!=="/"&&(p=f==="/"?r:Ta([r,f])),c.createHref({pathname:p,search:m,hash:d})}function Es(){return w.useContext(Ll)!=null}function sn(){return Pe(Es(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(Ll).location}var Fh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Zh(s){w.useContext(ea).static||w.useLayoutEffect(s)}function On(){let{isDataRoute:s}=w.useContext(Kt);return s?ay():qx()}function qx(){Pe(Es(),"useNavigate() may be used only in the context of a <Router> component.");let s=w.useContext(ks),{basename:o,navigator:r}=w.useContext(ea),{matches:c}=w.useContext(Kt),{pathname:d}=sn(),f=JSON.stringify(tu(c)),m=w.useRef(!1);return Zh(()=>{m.current=!0}),w.useCallback((g,h={})=>{if(Wt(m.current,Fh),!m.current)return;if(typeof g=="number"){r.go(g);return}let y=au(g,JSON.parse(f),d,h.relative==="path");s==null&&o!=="/"&&(y.pathname=y.pathname==="/"?o:Ta([o,y.pathname])),(h.replace?r.replace:r.push)(y,h.state,h)},[o,r,f,d,s])}var Gx=w.createContext(null);function $x(s){let o=w.useContext(Kt).outlet;return o&&w.createElement(Gx.Provider,{value:s},o)}function Kx(){let{matches:s}=w.useContext(Kt),o=s[s.length-1];return o?o.params:{}}function _l(s,{relative:o}={}){let{matches:r}=w.useContext(Kt),{pathname:c}=sn(),d=JSON.stringify(tu(r));return w.useMemo(()=>au(s,JSON.parse(d),c,o==="path"),[s,d,c,o])}function Yx(s,o){return Jh(s,o)}function Jh(s,o,r,c){var S;Pe(Es(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=w.useContext(ea),{matches:f}=w.useContext(Kt),m=f[f.length-1],p=m?m.params:{},g=m?m.pathname:"/",h=m?m.pathnameBase:"/",y=m&&m.route;{let C=y&&y.path||"";Ih(g,!y||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
50
|
-
|
|
51
|
-
Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let j=sn(),v;if(o){let C=typeof o=="string"?Cs(o):o;Pe(h==="/"||((S=C.pathname)==null?void 0:S.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${C.pathname}" was given in the \`location\` prop.`),v=C}else v=j;let A=v.pathname||"/",N=A;if(h!=="/"){let C=h.replace(/^\//,"").split("/");N="/"+A.replace(/^\//,"").split("/").slice(C.length).join("/")}let O=Kh(s,{pathname:N});Wt(y||O!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Wt(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let R=Zx(O&&O.map(C=>Object.assign({},C,{params:Object.assign({},p,C.params),pathname:Ta([h,d.encodeLocation?d.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?h:Ta([h,d.encodeLocation?d.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),f,r,c);return o&&R?w.createElement(Ll.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},R):R}function Px(){let s=ty(),o=Lx(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),r=s instanceof Error?s.stack:null,c="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:c},f={padding:"2px 4px",backgroundColor:c},m=null;return console.error("Error handled by React Router default ErrorBoundary:",s),m=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:f},"ErrorBoundary")," or"," ",w.createElement("code",{style:f},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},o),r?w.createElement("pre",{style:d},r):null,m)}var Xx=w.createElement(Px,null),Qx=class extends w.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,o){return o.location!==s.location||o.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:o.error,location:o.location,revalidation:s.revalidation||o.revalidation}}componentDidCatch(s,o){console.error("React Router caught the following error during render",s,o)}render(){return this.state.error!==void 0?w.createElement(Kt.Provider,{value:this.props.routeContext},w.createElement(nu.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Fx({routeContext:s,match:o,children:r}){let c=w.useContext(ks);return c&&c.static&&c.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=o.route.id),w.createElement(Kt.Provider,{value:s},r)}function Zx(s,o=[],r=null,c=null){if(s==null){if(!r)return null;if(r.errors)s=r.matches;else if(o.length===0&&!r.initialized&&r.matches.length>0)s=r.matches;else return null}let d=s,f=r==null?void 0:r.errors;if(f!=null){let g=d.findIndex(h=>h.route.id&&(f==null?void 0:f[h.route.id])!==void 0);Pe(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),d=d.slice(0,Math.min(d.length,g+1))}let m=!1,p=-1;if(r)for(let g=0;g<d.length;g++){let h=d[g];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(p=g),h.route.id){let{loaderData:y,errors:j}=r,v=h.route.loader&&!y.hasOwnProperty(h.route.id)&&(!j||j[h.route.id]===void 0);if(h.route.lazy||v){m=!0,p>=0?d=d.slice(0,p+1):d=[d[0]];break}}}return d.reduceRight((g,h,y)=>{let j,v=!1,A=null,N=null;r&&(j=f&&h.route.id?f[h.route.id]:void 0,A=h.route.errorElement||Xx,m&&(p<0&&y===0?(Ih("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,N=null):p===y&&(v=!0,N=h.route.hydrateFallbackElement||null)));let O=o.concat(d.slice(0,y+1)),R=()=>{let S;return j?S=A:v?S=N:h.route.Component?S=w.createElement(h.route.Component,null):h.route.element?S=h.route.element:S=g,w.createElement(Fx,{match:h,routeContext:{outlet:g,matches:O,isDataRoute:r!=null},children:S})};return r&&(h.route.ErrorBoundary||h.route.errorElement||y===0)?w.createElement(Qx,{location:r.location,revalidation:r.revalidation,component:A,error:j,children:R(),routeContext:{outlet:null,matches:O,isDataRoute:!0}}):R()},null)}function su(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Jx(s){let o=w.useContext(ks);return Pe(o,su(s)),o}function Ix(s){let o=w.useContext(yo);return Pe(o,su(s)),o}function Wx(s){let o=w.useContext(Kt);return Pe(o,su(s)),o}function lu(s){let o=Wx(s),r=o.matches[o.matches.length-1];return Pe(r.route.id,`${s} can only be used on routes that contain a unique "id"`),r.route.id}function ey(){return lu("useRouteId")}function ty(){var c;let s=w.useContext(nu),o=Ix("useRouteError"),r=lu("useRouteError");return s!==void 0?s:(c=o.errors)==null?void 0:c[r]}function ay(){let{router:s}=Jx("useNavigate"),o=lu("useNavigate"),r=w.useRef(!1);return Zh(()=>{r.current=!0}),w.useCallback(async(d,f={})=>{Wt(r.current,Fh),r.current&&(typeof d=="number"?s.navigate(d):await s.navigate(d,{fromRouteId:o,...f}))},[s,o])}var hh={};function Ih(s,o,r){!o&&!hh[s]&&(hh[s]=!0,Wt(!1,r))}w.memo(ny);function ny({routes:s,future:o,state:r}){return Jh(s,void 0,r,o)}function Wh({to:s,replace:o,state:r,relative:c}){Pe(Es(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=w.useContext(ea);Wt(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=w.useContext(Kt),{pathname:m}=sn(),p=On(),g=au(s,tu(f),m,c==="path"),h=JSON.stringify(g);return w.useEffect(()=>{p(JSON.parse(h),{replace:o,state:r,relative:c})},[p,h,c,o,r]),null}function eg(s){return $x(s.context)}function Dt(s){Pe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function sy({basename:s="/",children:o=null,location:r,navigationType:c="POP",navigator:d,static:f=!1}){Pe(!Es(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=s.replace(/^\/*/,"/"),p=w.useMemo(()=>({basename:m,navigator:d,static:f,future:{}}),[m,d,f]);typeof r=="string"&&(r=Cs(r));let{pathname:g="/",search:h="",hash:y="",state:j=null,key:v="default"}=r,A=w.useMemo(()=>{let N=Ra(g,m);return N==null?null:{location:{pathname:N,search:h,hash:y,state:j,key:v},navigationType:c}},[m,g,h,y,j,v,c]);return Wt(A!=null,`<Router basename="${m}"> is not able to match the URL "${g}${h}${y}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:w.createElement(ea.Provider,{value:p},w.createElement(Ll.Provider,{children:o,value:A}))}function ly({children:s,location:o}){return Yx(Kc(s),o)}function Kc(s,o=[]){let r=[];return w.Children.forEach(s,(c,d)=>{if(!w.isValidElement(c))return;let f=[...o,d];if(c.type===w.Fragment){r.push.apply(r,Kc(c.props.children,f));return}Pe(c.type===Dt,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Pe(!c.props.index||!c.props.children,"An index route cannot have child routes.");let m={id:c.props.id||f.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(m.children=Kc(c.props.children,f)),r.push(m)}),r}var uo="get",fo="application/x-www-form-urlencoded";function bo(s){return s!=null&&typeof s.tagName=="string"}function ry(s){return bo(s)&&s.tagName.toLowerCase()==="button"}function oy(s){return bo(s)&&s.tagName.toLowerCase()==="form"}function iy(s){return bo(s)&&s.tagName.toLowerCase()==="input"}function cy(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function uy(s,o){return s.button===0&&(!o||o==="_self")&&!cy(s)}var so=null;function dy(){if(so===null)try{new FormData(document.createElement("form"),0),so=!1}catch{so=!0}return so}var fy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function _c(s){return s!=null&&!fy.has(s)?(Wt(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${fo}"`),null):s}function my(s,o){let r,c,d,f,m;if(oy(s)){let p=s.getAttribute("action");c=p?Ra(p,o):null,r=s.getAttribute("method")||uo,d=_c(s.getAttribute("enctype"))||fo,f=new FormData(s)}else if(ry(s)||iy(s)&&(s.type==="submit"||s.type==="image")){let p=s.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=s.getAttribute("formaction")||p.getAttribute("action");if(c=g?Ra(g,o):null,r=s.getAttribute("formmethod")||p.getAttribute("method")||uo,d=_c(s.getAttribute("formenctype"))||_c(p.getAttribute("enctype"))||fo,f=new FormData(p,s),!dy()){let{name:h,type:y,value:j}=s;if(y==="image"){let v=h?`${h}.`:"";f.append(`${v}x`,"0"),f.append(`${v}y`,"0")}else h&&f.append(h,j)}}else{if(bo(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=uo,c=null,d=fo,m=s}return f&&d==="text/plain"&&(m=f,f=void 0),{action:c,method:r.toLowerCase(),encType:d,formData:f,body:m}}function ru(s,o){if(s===!1||s===null||typeof s>"u")throw new Error(o)}async function hy(s,o){if(s.id in o)return o[s.id];try{let r=await import(s.module);return o[s.id]=r,r}catch(r){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function gy(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function py(s,o,r){let c=await Promise.all(s.map(async d=>{let f=o.routes[d.route.id];if(f){let m=await hy(f,r);return m.links?m.links():[]}return[]}));return vy(c.flat(1).filter(gy).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function gh(s,o,r,c,d,f){let m=(g,h)=>r[h]?g.route.id!==r[h].route.id:!0,p=(g,h)=>{var y;return r[h].pathname!==g.pathname||((y=r[h].route.path)==null?void 0:y.endsWith("*"))&&r[h].params["*"]!==g.params["*"]};return f==="assets"?o.filter((g,h)=>m(g,h)||p(g,h)):f==="data"?o.filter((g,h)=>{var j;let y=c.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let v=g.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((j=r[0])==null?void 0:j.params)||{},nextUrl:new URL(s,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function xy(s,o,{includeHydrateFallback:r}={}){return yy(s.map(c=>{let d=o.routes[c.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),r&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function yy(s){return[...new Set(s)]}function by(s){let o={},r=Object.keys(s).sort();for(let c of r)o[c]=s[c];return o}function vy(s,o){let r=new Set;return new Set(o),s.reduce((c,d)=>{let f=JSON.stringify(by(d));return r.has(f)||(r.add(f),c.push({key:f,link:d})),c},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var wy=new Set([100,101,204,205]);function jy(s,o){let r=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return r.pathname==="/"?r.pathname="_root.data":o&&Ra(r.pathname,o)==="/"?r.pathname=`${o.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}function tg(){let s=w.useContext(ks);return ru(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function Sy(){let s=w.useContext(yo);return ru(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var ou=w.createContext(void 0);ou.displayName="FrameworkContext";function ag(){let s=w.useContext(ou);return ru(s,"You must render this element inside a <HydratedRouter> element"),s}function Ny(s,o){let r=w.useContext(ou),[c,d]=w.useState(!1),[f,m]=w.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:y,onTouchStart:j}=o,v=w.useRef(null);w.useEffect(()=>{if(s==="render"&&m(!0),s==="viewport"){let O=S=>{S.forEach(C=>{m(C.isIntersecting)})},R=new IntersectionObserver(O,{threshold:.5});return v.current&&R.observe(v.current),()=>{R.disconnect()}}},[s]),w.useEffect(()=>{if(c){let O=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(O)}}},[c]);let A=()=>{d(!0)},N=()=>{d(!1),m(!1)};return r?s!=="intent"?[f,v,{}]:[f,v,{onFocus:Al(p,A),onBlur:Al(g,N),onMouseEnter:Al(h,A),onMouseLeave:Al(y,N),onTouchStart:Al(j,A)}]:[!1,v,{}]}function Al(s,o){return r=>{s&&s(r),r.defaultPrevented||o(r)}}function Cy({page:s,...o}){let{router:r}=tg(),c=w.useMemo(()=>Kh(r.routes,s,r.basename),[r.routes,s,r.basename]);return c?w.createElement(Ey,{page:s,matches:c,...o}):null}function ky(s){let{manifest:o,routeModules:r}=ag(),[c,d]=w.useState([]);return w.useEffect(()=>{let f=!1;return py(s,o,r).then(m=>{f||d(m)}),()=>{f=!0}},[s,o,r]),c}function Ey({page:s,matches:o,...r}){let c=sn(),{manifest:d,routeModules:f}=ag(),{basename:m}=tg(),{loaderData:p,matches:g}=Sy(),h=w.useMemo(()=>gh(s,o,g,d,c,"data"),[s,o,g,d,c]),y=w.useMemo(()=>gh(s,o,g,d,c,"assets"),[s,o,g,d,c]),j=w.useMemo(()=>{if(s===c.pathname+c.search+c.hash)return[];let N=new Set,O=!1;if(o.forEach(S=>{var z;let C=d.routes[S.route.id];!C||!C.hasLoader||(!h.some(P=>P.route.id===S.route.id)&&S.route.id in p&&((z=f[S.route.id])!=null&&z.shouldRevalidate)||C.hasClientLoader?O=!0:N.add(S.route.id))}),N.size===0)return[];let R=jy(s,m);return O&&N.size>0&&R.searchParams.set("_routes",o.filter(S=>N.has(S.route.id)).map(S=>S.route.id).join(",")),[R.pathname+R.search]},[m,p,c,d,h,o,s,f]),v=w.useMemo(()=>xy(y,d),[y,d]),A=ky(y);return w.createElement(w.Fragment,null,j.map(N=>w.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...r})),v.map(N=>w.createElement("link",{key:N,rel:"modulepreload",href:N,...r})),A.map(({key:N,link:O})=>w.createElement("link",{key:N,...O})))}function Ty(...s){return o=>{s.forEach(r=>{typeof r=="function"?r(o):r!=null&&(r.current=o)})}}var ng=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ng&&(window.__reactRouterVersion="7.6.3")}catch{}function Ay({basename:s,children:o,window:r}){let c=w.useRef();c.current==null&&(c.current=mx({window:r,v5Compat:!0}));let d=c.current,[f,m]=w.useState({action:d.action,location:d.location}),p=w.useCallback(g=>{w.startTransition(()=>m(g))},[m]);return w.useLayoutEffect(()=>d.listen(p),[d,p]),w.createElement(sy,{basename:s,children:o,location:f.location,navigationType:f.action,navigator:d})}var sg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lg=w.forwardRef(function({onClick:o,discover:r="render",prefetch:c="none",relative:d,reloadDocument:f,replace:m,state:p,target:g,to:h,preventScrollReset:y,viewTransition:j,...v},A){let{basename:N}=w.useContext(ea),O=typeof h=="string"&&sg.test(h),R,S=!1;if(typeof h=="string"&&O&&(R=h,ng))try{let Z=new URL(window.location.href),te=h.startsWith("//")?new URL(Z.protocol+h):new URL(h),D=Ra(te.pathname,N);te.origin===Z.origin&&D!=null?h=D+te.search+te.hash:S=!0}catch{Wt(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let C=Vx(h,{relative:d}),[z,P,L]=Ny(c,v),I=My(h,{replace:m,state:p,target:g,preventScrollReset:y,relative:d,viewTransition:j});function K(Z){o&&o(Z),Z.defaultPrevented||I(Z)}let B=w.createElement("a",{...v,...L,href:R||C,onClick:S||f?o:K,ref:Ty(A,P),target:g,"data-discover":!O&&r==="render"?"true":void 0});return z&&!O?w.createElement(w.Fragment,null,B,w.createElement(Cy,{page:C})):B});lg.displayName="Link";var rg=w.forwardRef(function({"aria-current":o="page",caseSensitive:r=!1,className:c="",end:d=!1,style:f,to:m,viewTransition:p,children:g,...h},y){let j=_l(m,{relative:h.relative}),v=sn(),A=w.useContext(yo),{navigator:N,basename:O}=w.useContext(ea),R=A!=null&&_y(j)&&p===!0,S=N.encodeLocation?N.encodeLocation(j).pathname:j.pathname,C=v.pathname,z=A&&A.navigation&&A.navigation.location?A.navigation.location.pathname:null;r||(C=C.toLowerCase(),z=z?z.toLowerCase():null,S=S.toLowerCase()),z&&O&&(z=Ra(z,O)||z);const P=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let L=C===S||!d&&C.startsWith(S)&&C.charAt(P)==="/",I=z!=null&&(z===S||!d&&z.startsWith(S)&&z.charAt(S.length)==="/"),K={isActive:L,isPending:I,isTransitioning:R},B=L?o:void 0,Z;typeof c=="function"?Z=c(K):Z=[c,L?"active":null,I?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let te=typeof f=="function"?f(K):f;return w.createElement(lg,{...h,"aria-current":B,className:Z,ref:y,style:te,to:m,viewTransition:p},typeof g=="function"?g(K):g)});rg.displayName="NavLink";var Ry=w.forwardRef(({discover:s="render",fetcherKey:o,navigate:r,reloadDocument:c,replace:d,state:f,method:m=uo,action:p,onSubmit:g,relative:h,preventScrollReset:y,viewTransition:j,...v},A)=>{let N=Uy(),O=Ly(p,{relative:h}),R=m.toLowerCase()==="get"?"get":"post",S=typeof p=="string"&&sg.test(p),C=z=>{if(g&&g(z),z.defaultPrevented)return;z.preventDefault();let P=z.nativeEvent.submitter,L=(P==null?void 0:P.getAttribute("formmethod"))||m;N(P||z.currentTarget,{fetcherKey:o,method:L,navigate:r,replace:d,state:f,relative:h,preventScrollReset:y,viewTransition:j})};return w.createElement("form",{ref:A,method:R,action:O,onSubmit:c?g:C,...v,"data-discover":!S&&s==="render"?"true":void 0})});Ry.displayName="Form";function Oy(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function og(s){let o=w.useContext(ks);return Pe(o,Oy(s)),o}function My(s,{target:o,replace:r,state:c,preventScrollReset:d,relative:f,viewTransition:m}={}){let p=On(),g=sn(),h=_l(s,{relative:f});return w.useCallback(y=>{if(uy(y,o)){y.preventDefault();let j=r!==void 0?r:zl(g)===zl(h);p(s,{replace:j,state:c,preventScrollReset:d,relative:f,viewTransition:m})}},[g,p,h,r,c,o,s,d,f,m])}var zy=0,Dy=()=>`__${String(++zy)}__`;function Uy(){let{router:s}=og("useSubmit"),{basename:o}=w.useContext(ea),r=ey();return w.useCallback(async(c,d={})=>{let{action:f,method:m,encType:p,formData:g,body:h}=my(c,o);if(d.navigate===!1){let y=d.fetcherKey||Dy();await s.fetch(y,r,d.action||f,{preventScrollReset:d.preventScrollReset,formData:g,body:h,formMethod:d.method||m,formEncType:d.encType||p,flushSync:d.flushSync})}else await s.navigate(d.action||f,{preventScrollReset:d.preventScrollReset,formData:g,body:h,formMethod:d.method||m,formEncType:d.encType||p,replace:d.replace,state:d.state,fromRouteId:r,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,o,r])}function Ly(s,{relative:o}={}){let{basename:r}=w.useContext(ea),c=w.useContext(Kt);Pe(c,"useFormAction must be used inside a RouteContext");let[d]=c.matches.slice(-1),f={..._l(s||".",{relative:o})},m=sn();if(s==null){f.search=m.search;let p=new URLSearchParams(f.search),g=p.getAll("index");if(g.some(y=>y==="")){p.delete("index"),g.filter(j=>j).forEach(j=>p.append("index",j));let y=p.toString();f.search=y?`?${y}`:""}}return(!s||s===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:Ta([r,f.pathname])),zl(f)}function _y(s,o={}){let r=w.useContext(Qh);Pe(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=og("useViewTransitionState"),d=_l(s,{relative:o.relative});if(!r.isTransitioning)return!1;let f=Ra(r.currentLocation.pathname,c)||r.currentLocation.pathname,m=Ra(r.nextLocation.pathname,c)||r.nextLocation.pathname;return mo(d.pathname,m)!=null||mo(d.pathname,f)!=null}[...wy];const Hy=()=>window.__MCPHUB_CONFIG__||{basePath:"",version:"dev",name:"mcphub"},iu=()=>{const o=Hy().basePath||"";return o&&!o.startsWith("/")?"/"+o:o},By=()=>iu()+"/api",Ne=s=>{const o=By(),r=s.startsWith("/")?s:"/"+s;return o+r},Vy=async()=>{try{const s=window.location.pathname,o=[s.replace(/\/[^/]*$/,"")+"/config","/config",...s.includes("/")?[s.split("/")[1]?`/${s.split("/")[1]}/config`:"/config"]:["/config"]];for(const r of o)try{const c=await fetch(r,{method:"GET",headers:{Accept:"application/json","Cache-Control":"no-cache"}});if(c.ok){const d=await c.json();if(d.success&&d.data)return d.data}}catch(c){console.debug(`Failed to load config from ${r}:`,c)}return console.warn("Could not load runtime config from server, using defaults"),{basePath:"",version:"dev",name:"mcphub"}}catch(s){return console.error("Error loading runtime config:",s),{basePath:"",version:"dev",name:"mcphub"}}},cu="mcphub_token",ln=()=>localStorage.getItem(cu),ig=s=>{localStorage.setItem(cu,s)},Yc=()=>{localStorage.removeItem(cu)},qy=async s=>{try{console.log(Ne("/auth/login"));const r=await(await fetch(Ne("/auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).json();return r.success&&r.token&&ig(r.token),r}catch(o){return console.error("Login error:",o),{success:!1,message:"An error occurred during login"}}},Gy=async s=>{try{const r=await(await fetch(Ne("/auth/register"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})).json();return r.success&&r.token&&ig(r.token),r}catch(o){return console.error("Register error:",o),{success:!1,message:"An error occurred during registration"}}},$y=async()=>{const s=ln();if(!s)return{success:!1,message:"No authentication token"};try{return await(await fetch(Ne("/auth/user"),{method:"GET",headers:{"x-auth-token":s}})).json()}catch(o){return console.error("Get current user error:",o),{success:!1,message:"An error occurred while fetching user data"}}},Ky=async s=>{const o=ln();if(!o)return{success:!1,message:"No authentication token"};try{return await(await fetch(Ne("/auth/change-password"),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":o},body:JSON.stringify(s)})).json()}catch(r){return console.error("Change password error:",r),{success:!1,message:"An error occurred while changing password"}}},Yy=()=>{Yc()},Py=async()=>{var s;try{const o=iu(),r=await fetch(`${o}/public-config`,{method:"GET",headers:{"Content-Type":"application/json"}});return r.ok?{skipAuth:((s=(await r.json()).data)==null?void 0:s.skipAuth)===!0}:{skipAuth:!1}}catch(o){return console.debug("Failed to get public config:",o),{skipAuth:!1}}},Xy=async()=>{try{return(await Py()).skipAuth}catch(s){return console.debug("Failed to check skipAuth setting:",s),!1}},ia={isAuthenticated:!1,loading:!0,user:null,error:null},cg=w.createContext({auth:ia,login:async()=>!1,register:async()=>!1,logout:()=>{}}),Qy=({children:s})=>{const[o,r]=w.useState(ia);w.useEffect(()=>{(async()=>{if(await Xy()){r({isAuthenticated:!0,loading:!1,user:{username:"guest",isAdmin:!0},error:null});return}if(!ln()){r({...ia,loading:!1});return}try{const h=await $y();h.success&&h.user?r({isAuthenticated:!0,loading:!1,user:h.user,error:null}):(Yc(),r({...ia,loading:!1}))}catch{Yc(),r({...ia,loading:!1})}})()},[]);const c=async(m,p)=>{try{const g=await qy({username:m,password:p});return g.success&&g.token&&g.user?(r({isAuthenticated:!0,loading:!1,user:g.user,error:null}),!0):(r({...ia,loading:!1,error:g.message||"Authentication failed"}),!1)}catch{return r({...ia,loading:!1,error:"Authentication failed"}),!1}},d=async(m,p,g=!1)=>{try{const h=await Gy({username:m,password:p,isAdmin:g});return h.success&&h.token&&h.user?(r({isAuthenticated:!0,loading:!1,user:h.user,error:null}),!0):(r({...ia,loading:!1,error:h.message||"Registration failed"}),!1)}catch{return r({...ia,loading:!1,error:"Registration failed"}),!1}},f=()=>{Yy(),r({...ia,loading:!1})};return l.jsx(cg.Provider,{value:{auth:o,login:c,register:d,logout:f},children:s})},Hl=()=>w.useContext(cg);/**
|
|
52
|
-
* @license lucide-react v0.486.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const Fy=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Zy=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,r,c)=>c?c.toUpperCase():r.toLowerCase()),ph=s=>{const o=Zy(s);return o.charAt(0).toUpperCase()+o.slice(1)},ug=(...s)=>s.filter((o,r,c)=>!!o&&o.trim()!==""&&c.indexOf(o)===r).join(" ").trim();/**
|
|
57
|
-
* @license lucide-react v0.486.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/var Jy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
62
|
-
* @license lucide-react v0.486.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const Iy=w.forwardRef(({color:s="currentColor",size:o=24,strokeWidth:r=2,absoluteStrokeWidth:c,className:d="",children:f,iconNode:m,...p},g)=>w.createElement("svg",{ref:g,...Jy,width:o,height:o,stroke:s,strokeWidth:c?Number(r)*24/Number(o):r,className:ug("lucide",d),...p},[...m.map(([h,y])=>w.createElement(h,y)),...Array.isArray(f)?f:[f]]));/**
|
|
67
|
-
* @license lucide-react v0.486.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const Ze=(s,o)=>{const r=w.forwardRef(({className:c,...d},f)=>w.createElement(Iy,{ref:f,iconNode:o,className:ug(`lucide-${Fy(ph(s))}`,`lucide-${s}`,c),...d}));return r.displayName=ph(s),r};/**
|
|
72
|
-
* @license lucide-react v0.486.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const Wy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vo=Ze("check",Wy);/**
|
|
77
|
-
* @license lucide-react v0.486.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const eb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],uu=Ze("chevron-down",eb);/**
|
|
82
|
-
* @license lucide-react v0.486.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const tb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],dg=Ze("chevron-right",tb);/**
|
|
87
|
-
* @license lucide-react v0.486.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const ab=[["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"}]],fg=Ze("circle-alert",ab);/**
|
|
92
|
-
* @license lucide-react v0.486.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const nb=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],sb=Ze("circle-check-big",nb);/**
|
|
97
|
-
* @license lucide-react v0.486.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const lb=[["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"}]],rb=Ze("circle-x",lb);/**
|
|
102
|
-
* @license lucide-react v0.486.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const ob=[["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"}]],Pc=Ze("copy",ob);/**
|
|
107
|
-
* @license lucide-react v0.486.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const ib=[["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=Ze("file-code",ib);/**
|
|
112
|
-
* @license lucide-react v0.486.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const ub=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],db=Ze("info",ub);/**
|
|
117
|
-
* @license lucide-react v0.486.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const fb=[["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"}]],mb=Ze("link",fb);/**
|
|
122
|
-
* @license lucide-react v0.486.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const hb=[["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"}]],gb=Ze("loader",hb);/**
|
|
127
|
-
* @license lucide-react v0.486.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const pb=[["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"}]],xb=Ze("log-out",pb);/**
|
|
132
|
-
* @license lucide-react v0.486.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const yb=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],bb=Ze("moon",yb);/**
|
|
137
|
-
* @license lucide-react v0.486.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const vb=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],wb=Ze("play",vb);/**
|
|
142
|
-
* @license lucide-react v0.486.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const jb=[["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"}]],Sb=Ze("refresh-cw",jb);/**
|
|
147
|
-
* @license lucide-react v0.486.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const Nb=[["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"}]],Cb=Ze("settings",Nb);/**
|
|
152
|
-
* @license lucide-react v0.486.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const kb=[["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"}]],mg=Ze("square-pen",kb);/**
|
|
157
|
-
* @license lucide-react v0.486.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const Eb=[["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"}]],Tb=Ze("sun",Eb);/**
|
|
162
|
-
* @license lucide-react v0.486.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const Ab=[["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"}]],Rb=Ze("trash",Ab);/**
|
|
167
|
-
* @license lucide-react v0.486.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const Ob=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Mb=Ze("user",Ob);/**
|
|
172
|
-
* @license lucide-react v0.486.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const zb=[["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"}]],Db=Ze("wrench",zb);/**
|
|
177
|
-
* @license lucide-react v0.486.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const Ub=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Dl=Ze("x",Ub);function hg(s){var o,r,c="";if(typeof s=="string"||typeof s=="number")c+=s;else if(typeof s=="object")if(Array.isArray(s)){var d=s.length;for(o=0;o<d;o++)s[o]&&(r=hg(s[o]))&&(c&&(c+=" "),c+=r)}else for(r in s)s[r]&&(c&&(c+=" "),c+=r);return c}function Lb(){for(var s,o,r=0,c="",d=arguments.length;r<d;r++)(s=arguments[r])&&(o=hg(s))&&(c&&(c+=" "),c+=o);return c}const du="-",_b=s=>{const o=Bb(s),{conflictingClassGroups:r,conflictingClassGroupModifiers:c}=s;return{getClassGroupId:m=>{const p=m.split(du);return p[0]===""&&p.length!==1&&p.shift(),gg(p,o)||Hb(m)},getConflictingClassGroupIds:(m,p)=>{const g=r[m]||[];return p&&c[m]?[...g,...c[m]]:g}}},gg=(s,o)=>{var m;if(s.length===0)return o.classGroupId;const r=s[0],c=o.nextPart.get(r),d=c?gg(s.slice(1),c):void 0;if(d)return d;if(o.validators.length===0)return;const f=s.join(du);return(m=o.validators.find(({validator:p})=>p(f)))==null?void 0:m.classGroupId},xh=/^\[(.+)\]$/,Hb=s=>{if(xh.test(s)){const o=xh.exec(s)[1],r=o==null?void 0:o.substring(0,o.indexOf(":"));if(r)return"arbitrary.."+r}},Bb=s=>{const{theme:o,classGroups:r}=s,c={nextPart:new Map,validators:[]};for(const d in r)Xc(r[d],c,d,o);return c},Xc=(s,o,r,c)=>{s.forEach(d=>{if(typeof d=="string"){const f=d===""?o:yh(o,d);f.classGroupId=r;return}if(typeof d=="function"){if(Vb(d)){Xc(d(c),o,r,c);return}o.validators.push({validator:d,classGroupId:r});return}Object.entries(d).forEach(([f,m])=>{Xc(m,yh(o,f),r,c)})})},yh=(s,o)=>{let r=s;return o.split(du).forEach(c=>{r.nextPart.has(c)||r.nextPart.set(c,{nextPart:new Map,validators:[]}),r=r.nextPart.get(c)}),r},Vb=s=>s.isThemeGetter,qb=s=>{if(s<1)return{get:()=>{},set:()=>{}};let o=0,r=new Map,c=new Map;const d=(f,m)=>{r.set(f,m),o++,o>s&&(o=0,c=r,r=new Map)};return{get(f){let m=r.get(f);if(m!==void 0)return m;if((m=c.get(f))!==void 0)return d(f,m),m},set(f,m){r.has(f)?r.set(f,m):d(f,m)}}},Qc="!",Fc=":",Gb=Fc.length,$b=s=>{const{prefix:o,experimentalParseClassName:r}=s;let c=d=>{const f=[];let m=0,p=0,g=0,h;for(let N=0;N<d.length;N++){let O=d[N];if(m===0&&p===0){if(O===Fc){f.push(d.slice(g,N)),g=N+Gb;continue}if(O==="/"){h=N;continue}}O==="["?m++:O==="]"?m--:O==="("?p++:O===")"&&p--}const y=f.length===0?d:d.substring(g),j=Kb(y),v=j!==y,A=h&&h>g?h-g:void 0;return{modifiers:f,hasImportantModifier:v,baseClassName:j,maybePostfixModifierPosition:A}};if(o){const d=o+Fc,f=c;c=m=>m.startsWith(d)?f(m.substring(d.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:m,maybePostfixModifierPosition:void 0}}if(r){const d=c;c=f=>r({className:f,parseClassName:d})}return c},Kb=s=>s.endsWith(Qc)?s.substring(0,s.length-1):s.startsWith(Qc)?s.substring(1):s,Yb=s=>{const o=Object.fromEntries(s.orderSensitiveModifiers.map(c=>[c,!0]));return c=>{if(c.length<=1)return c;const d=[];let f=[];return c.forEach(m=>{m[0]==="["||o[m]?(d.push(...f.sort(),m),f=[]):f.push(m)}),d.push(...f.sort()),d}},Pb=s=>({cache:qb(s.cacheSize),parseClassName:$b(s),sortModifiers:Yb(s),..._b(s)}),Xb=/\s+/,Qb=(s,o)=>{const{parseClassName:r,getClassGroupId:c,getConflictingClassGroupIds:d,sortModifiers:f}=o,m=[],p=s.trim().split(Xb);let g="";for(let h=p.length-1;h>=0;h-=1){const y=p[h],{isExternal:j,modifiers:v,hasImportantModifier:A,baseClassName:N,maybePostfixModifierPosition:O}=r(y);if(j){g=y+(g.length>0?" "+g:g);continue}let R=!!O,S=c(R?N.substring(0,O):N);if(!S){if(!R){g=y+(g.length>0?" "+g:g);continue}if(S=c(N),!S){g=y+(g.length>0?" "+g:g);continue}R=!1}const C=f(v).join(":"),z=A?C+Qc:C,P=z+S;if(m.includes(P))continue;m.push(P);const L=d(S,R);for(let I=0;I<L.length;++I){const K=L[I];m.push(z+K)}g=y+(g.length>0?" "+g:g)}return g};function Fb(){let s=0,o,r,c="";for(;s<arguments.length;)(o=arguments[s++])&&(r=pg(o))&&(c&&(c+=" "),c+=r);return c}const pg=s=>{if(typeof s=="string")return s;let o,r="";for(let c=0;c<s.length;c++)s[c]&&(o=pg(s[c]))&&(r&&(r+=" "),r+=o);return r};function Zb(s,...o){let r,c,d,f=m;function m(g){const h=o.reduce((y,j)=>j(y),s());return r=Pb(h),c=r.cache.get,d=r.cache.set,f=p,p(g)}function p(g){const h=c(g);if(h)return h;const y=Qb(g,r);return d(g,y),y}return function(){return f(Fb.apply(null,arguments))}}const lt=s=>{const o=r=>r[s]||[];return o.isThemeGetter=!0,o},xg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Jb=/^\d+\/\d+$/,Ib=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Wb=/\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$/,ev=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,av=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ys=s=>Jb.test(s),Te=s=>!!s&&!Number.isNaN(Number(s)),nn=s=>!!s&&Number.isInteger(Number(s)),Hc=s=>s.endsWith("%")&&Te(s.slice(0,-1)),Ea=s=>Ib.test(s),nv=()=>!0,sv=s=>Wb.test(s)&&!ev.test(s),bg=()=>!1,lv=s=>tv.test(s),rv=s=>av.test(s),ov=s=>!me(s)&&!he(s),iv=s=>Ts(s,jg,bg),me=s=>xg.test(s),An=s=>Ts(s,Sg,sv),Bc=s=>Ts(s,mv,Te),bh=s=>Ts(s,vg,bg),cv=s=>Ts(s,wg,rv),lo=s=>Ts(s,Ng,lv),he=s=>yg.test(s),Rl=s=>As(s,Sg),uv=s=>As(s,hv),vh=s=>As(s,vg),dv=s=>As(s,jg),fv=s=>As(s,wg),ro=s=>As(s,Ng,!0),Ts=(s,o,r)=>{const c=xg.exec(s);return c?c[1]?o(c[1]):r(c[2]):!1},As=(s,o,r=!1)=>{const c=yg.exec(s);return c?c[1]?o(c[1]):r:!1},vg=s=>s==="position"||s==="percentage",wg=s=>s==="image"||s==="url",jg=s=>s==="length"||s==="size"||s==="bg-size",Sg=s=>s==="length",mv=s=>s==="number",hv=s=>s==="family-name",Ng=s=>s==="shadow",gv=()=>{const s=lt("color"),o=lt("font"),r=lt("text"),c=lt("font-weight"),d=lt("tracking"),f=lt("leading"),m=lt("breakpoint"),p=lt("container"),g=lt("spacing"),h=lt("radius"),y=lt("shadow"),j=lt("inset-shadow"),v=lt("text-shadow"),A=lt("drop-shadow"),N=lt("blur"),O=lt("perspective"),R=lt("aspect"),S=lt("ease"),C=lt("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...P(),he,me],I=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto","contain","none"],B=()=>[he,me,g],Z=()=>[ys,"full","auto",...B()],te=()=>[nn,"none","subgrid",he,me],D=()=>["auto",{span:["full",nn,he,me]},nn,he,me],U=()=>[nn,"auto",he,me],se=()=>["auto","min","max","fr",he,me],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...B()],G=()=>[ys,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],F=()=>[s,he,me],ce=()=>[...P(),vh,bh,{position:[he,me]}],E=()=>["no-repeat",{repeat:["","x","y","space","round"]}],X=()=>["auto","cover","contain",dv,iv,{size:[he,me]}],le=()=>[Hc,Rl,An],ne=()=>["","none","full",h,he,me],de=()=>["",Te,Rl,An],we=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Te,Hc,vh,bh],ie=()=>["","none",N,he,me],xe=()=>["none",Te,he,me],Be=()=>["none",Te,he,me],je=()=>[Te,he,me],De=()=>[ys,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ea],breakpoint:[Ea],color:[nv],container:[Ea],"drop-shadow":[Ea],ease:["in","out","in-out"],font:[ov],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ea],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ea],shadow:[Ea],spacing:["px",Te],text:[Ea],"text-shadow":[Ea],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ys,me,he,R]}],container:["container"],columns:[{columns:[Te,me,he,p]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:L()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{start:Z()}],end:[{end:Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[nn,"auto",he,me]}],basis:[{basis:[ys,"full","auto",p,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,ys,"auto","initial","none",me]}],grow:[{grow:["",Te,he,me]}],shrink:[{shrink:["",Te,he,me]}],order:[{order:[nn,"first","last","none",he,me]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":se()}],"auto-rows":[{"auto-rows":se()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[p,"screen",...G()]}],"min-w":[{"min-w":[p,"screen","none",...G()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[m]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",r,Rl,An]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[c,he,Bc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Hc,me]}],"font-family":[{font:[uv,me,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,he,me]}],"line-clamp":[{"line-clamp":[Te,"none",he,Bc]}],leading:[{leading:[f,...B()]}],"list-image":[{"list-image":["none",he,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",he,An]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[Te,"auto",he,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,me]}],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",he,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:E()}],"bg-size":[{bg:X()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},nn,he,me],radial:["",he,me],conic:[nn,he,me]},fv,cv]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,he,me]}],"outline-w":[{outline:["",Te,Rl,An]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",y,ro,lo]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",j,ro,lo]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[Te,An]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",v,ro,lo]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[Te,he,me]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"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":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[he,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"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":P()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:E()}],"mask-size":[{mask:X()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,me]}],filter:[{filter:["","none",he,me]}],blur:[{blur:ie()}],brightness:[{brightness:[Te,he,me]}],contrast:[{contrast:[Te,he,me]}],"drop-shadow":[{"drop-shadow":["","none",A,ro,lo]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",Te,he,me]}],"hue-rotate":[{"hue-rotate":[Te,he,me]}],invert:[{invert:["",Te,he,me]}],saturate:[{saturate:[Te,he,me]}],sepia:[{sepia:["",Te,he,me]}],"backdrop-filter":[{"backdrop-filter":["","none",he,me]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Te,he,me]}],"backdrop-contrast":[{"backdrop-contrast":[Te,he,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,he,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,he,me]}],"backdrop-invert":[{"backdrop-invert":["",Te,he,me]}],"backdrop-opacity":[{"backdrop-opacity":[Te,he,me]}],"backdrop-saturate":[{"backdrop-saturate":[Te,he,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,he,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",he,me]}],ease:[{ease:["linear","initial",S,he,me]}],delay:[{delay:[Te,he,me]}],animate:[{animate:["none",C,he,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[O,he,me]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:Be()}],"scale-x":[{"scale-x":Be()}],"scale-y":[{"scale-y":Be()}],"scale-z":[{"scale-z":Be()}],"scale-3d":["scale-3d"],skew:[{skew:je()}],"skew-x":[{"skew-x":je()}],"skew-y":[{"skew-y":je()}],transform:[{transform:[he,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:De()}],"translate-x":[{"translate-x":De()}],"translate-y":[{"translate-y":De()}],"translate-z":[{"translate-z":De()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"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",he,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,me]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[Te,Rl,An,Bc]}],stroke:[{stroke:["none",...F()]}],"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"]}},pv=Zb(gv);function Aa(...s){return pv(Lb(s))}const xv=({message:s,type:o="info",duration:r=3e3,onClose:c,visible:d})=>{w.useEffect(()=>{if(d){const g=setTimeout(()=>{c()},r);return()=>clearTimeout(g)}},[d,r,c]);const f={success:l.jsx(vo,{className:"w-5 h-5 text-green-500"}),error:l.jsx(Dl,{className:"w-5 h-5 text-red-500"}),info:l.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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:l.jsx("svg",{className:"w-5 h-5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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 l.jsx("div",{className:Aa("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:l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"flex-shrink-0",children:f[o]}),l.jsx("div",{className:"ml-3",children:l.jsx("p",{className:Aa("text-sm font-medium",p[o]),children:s})}),l.jsx("div",{className:"ml-auto pl-3",children:l.jsx("div",{className:"-mx-1.5 -my-1.5",children:l.jsxs("button",{onClick:c,className:Aa("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:[l.jsx("span",{className:"sr-only",children:"Dismiss"}),l.jsx(Dl,{className:"h-5 w-5"})]})})})]})})},Cg=w.createContext(void 0),Bl=()=>{const s=w.useContext(Cg);if(!s)throw new Error("useToast must be used within a ToastProvider");return s},yv=({children:s})=>{const[o,r]=w.useState({message:"",type:"info",visible:!1,duration:3e3}),c=w.useCallback((f,m="info",p=3e3)=>{r({message:f,type:m,visible:!0,duration:p})},[]),d=w.useCallback(()=>{r(f=>({...f,visible:!1}))},[]);return l.jsxs(Cg.Provider,{value:{showToast:c},children:[s,l.jsx(xv,{message:o.message,type:o.type,duration:o.duration,onClose:d,visible:o.visible})]})},kg=w.createContext(void 0),bv=()=>{const s=w.useContext(kg);if(!s)throw new Error("useTheme must be used within a ThemeProvider");return s},vv=({children:s})=>{const[o,r]=w.useState(()=>localStorage.getItem("theme")||"system"),[c,d]=w.useState("light"),f=m=>{r(m),localStorage.setItem("theme",m)};return w.useEffect(()=>{const m=()=>{const g=window.document.documentElement,h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",y=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]),l.jsx(kg.Provider,{value:{theme:o,setTheme:f,resolvedTheme:c},children:s})},wv=(s,o,r,c)=>{var f,m,p,g;const d=[r,{code:o,...c||{}}];if((m=(f=s==null?void 0:s.services)==null?void 0:f.logger)!=null&&m.forward)return s.services.logger.forward(d,"warn","react-i18next::",!0);Rn(d[0])&&(d[0]=`react-i18next:: ${d[0]}`),(g=(p=s==null?void 0:s.services)==null?void 0:p.logger)!=null&&g.warn?s.services.logger.warn(...d):console!=null&&console.warn&&console.warn(...d)},wh={},Zc=(s,o,r,c)=>{Rn(r)&&wh[r]||(Rn(r)&&(wh[r]=new Date),wv(s,o,r,c))},Eg=(s,o)=>()=>{if(s.isInitialized)o();else{const r=()=>{setTimeout(()=>{s.off("initialized",r)},0),o()};s.on("initialized",r)}},Jc=(s,o,r)=>{s.loadNamespaces(o,Eg(s,r))},jh=(s,o,r,c)=>{if(Rn(r)&&(r=[r]),s.options.preload&&s.options.preload.indexOf(o)>-1)return Jc(s,r,c);r.forEach(d=>{s.options.ns.indexOf(d)<0&&s.options.ns.push(d)}),s.loadLanguages(o,Eg(s,c))},jv=(s,o,r={})=>!o.languages||!o.languages.length?(Zc(o,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:o.languages}),!0):o.hasLoadedNamespace(s,{lng:r.lng,precheck:(c,d)=>{var f;if(((f=r.bindI18n)==null?void 0:f.indexOf("languageChanging"))>-1&&c.services.backendConnector.backend&&c.isLanguageChangingTo&&!d(c.isLanguageChangingTo,s))return!1}}),Rn=s=>typeof s=="string",Sv=s=>typeof s=="object"&&s!==null,Nv=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Cv={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},kv=s=>Cv[s],Ev=s=>s.replace(Nv,kv);let Ic={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Ev};const Tv=(s={})=>{Ic={...Ic,...s}},Av=()=>Ic;let Tg;const Rv=s=>{Tg=s},Ov=()=>Tg,Mv={type:"3rdParty",init(s){Tv(s.options.react),Rv(s)}},zv=w.createContext();class Dv{constructor(){this.usedNamespaces={}}addUsedNamespaces(o){o.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Uv=(s,o)=>{const r=w.useRef();return w.useEffect(()=>{r.current=s},[s,o]),r.current},Ag=(s,o,r,c)=>s.getFixedT(o,r,c),Lv=(s,o,r,c)=>w.useCallback(Ag(s,o,r,c),[s,o,r,c]),ke=(s,o={})=>{var P,L,I,K;const{i18n:r}=o,{i18n:c,defaultNS:d}=w.useContext(zv)||{},f=r||c||Ov();if(f&&!f.reportNamespaces&&(f.reportNamespaces=new Dv),!f){Zc(f,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const B=(te,D)=>Rn(D)?D:Sv(D)&&Rn(D.defaultValue)?D.defaultValue:Array.isArray(te)?te[te.length-1]:te,Z=[B,{},!1];return Z.t=B,Z.i18n={},Z.ready=!1,Z}(P=f.options.react)!=null&&P.wait&&Zc(f,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const m={...Av(),...f.options.react,...o},{useSuspense:p,keyPrefix:g}=m;let h=d||((L=f.options)==null?void 0:L.defaultNS);h=Rn(h)?[h]:h||["translation"],(K=(I=f.reportNamespaces).addUsedNamespaces)==null||K.call(I,h);const y=(f.isInitialized||f.initializedStoreOnce)&&h.every(B=>jv(B,f,m)),j=Lv(f,o.lng||null,m.nsMode==="fallback"?h:h[0],g),v=()=>j,A=()=>Ag(f,o.lng||null,m.nsMode==="fallback"?h:h[0],g),[N,O]=w.useState(v);let R=h.join();o.lng&&(R=`${o.lng}${R}`);const S=Uv(R),C=w.useRef(!0);w.useEffect(()=>{const{bindI18n:B,bindI18nStore:Z}=m;C.current=!0,!y&&!p&&(o.lng?jh(f,o.lng,h,()=>{C.current&&O(A)}):Jc(f,h,()=>{C.current&&O(A)})),y&&S&&S!==R&&C.current&&O(A);const te=()=>{C.current&&O(A)};return B&&(f==null||f.on(B,te)),Z&&(f==null||f.store.on(Z,te)),()=>{C.current=!1,f&&(B==null||B.split(" ").forEach(D=>f.off(D,te))),Z&&f&&Z.split(" ").forEach(D=>f.store.off(D,te))}},[f,R]),w.useEffect(()=>{C.current&&y&&O(v)},[f,g,y]);const z=[N,f,y];if(z.t=N,z.i18n=f,z.ready=y,y||!y&&!p)return z;throw new Promise(B=>{o.lng?jh(f,o.lng,h,()=>B()):Jc(f,h,()=>B())})},Rg=()=>{const{t:s}=ke(),{theme:o,setTheme:r}=bv(),c=()=>{r(o==="light"?"dark":"light")};return l.jsx("button",{onClick:c,className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none",title:s(o==="light"?"theme.dark":"theme.light"),"aria-label":s(o==="light"?"theme.dark":"theme.light"),children:o==="light"?l.jsx(bb,{className:"h-5 w-5"}):l.jsx(Tb,{className:"h-5 w-5"})})},_v=s=>{const{t:o}=ke();return l.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:2,...s,children:[l.jsx("title",{children:o("common.language")}),l.jsx("circle",{cx:"12",cy:"12",r:"10"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2 12h20"}),l.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"})]})},Og=()=>{const{i18n:s}=ke(),[o,r]=w.useState(!1),[c,d]=w.useState(s.language),f=[{code:"en",label:"English"},{code:"zh",label:"中文"}];w.useEffect(()=>{d(s.language)},[s.language]),w.useEffect(()=>{const g=h=>{h.target.closest(".language-dropdown")||r(!1)};return o&&document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[o]);const m=g=>{localStorage.setItem("i18nextLng",g),r(!1),window.location.reload()},p=()=>{r(!o)};return l.jsxs("div",{className:"relative language-dropdown",children:[l.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:l.jsx(_v,{className:"h-5 w-5"})}),o&&l.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:l.jsx("div",{children:f.map(g=>l.jsx("button",{onClick:()=>m(g.code),className:`flex items-center w-full px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${c.startsWith(g.code)?"bg-blue-50 text-blue-700":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-100"}`,children:g.label},g.code))})})]})},Hv=s=>l.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[l.jsx("title",{children:"GitHub"}),l.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"})]}),Bv=({onToggleSidebar:s})=>{const{t:o}=ke();return l.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-sm z-10",children:l.jsxs("div",{className:"flex justify-between items-center px-3 py-3",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("button",{onClick:s,className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none","aria-label":o("app.toggleSidebar"),children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),l.jsx("h1",{className:"ml-4 text-xl font-bold text-gray-900 dark:text-white",children:o("app.title")})]}),l.jsxs("div",{className:"flex items-center space-x-1",children:[l.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 mr-2",children:"v0.8.6"}),l.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:l.jsx(Hv,{className:"h-5 w-5"})}),l.jsx(Rg,{}),l.jsx(Og,{})]})]})})},Vc=({permissions:s,fallback:o=null,children:r})=>Mg(s)?l.jsx(l.Fragment,{children:r}):l.jsx(l.Fragment,{children:o}),Mg=s=>{const{auth:o}=Hl();if(!o.isAuthenticated||!o.user)return!1;const r=o.user.permissions||[];return s==="x"&&!r.includes("x")?!1:r.includes("*")||o.user.isAdmin?!0:(Array.isArray(s)?s:[s]).some(d=>r.includes(d))},Vv="https://registry.npmjs.org",qv="@samanhappy/mcphub",zg=async()=>{try{const s=await fetch(`${Vv}/${qv}/latest`);if(!s.ok)throw new Error(`Failed to fetch latest version: ${s.status}`);return(await s.json()).version||null}catch(s){return console.error("Error checking for latest version:",s),null}},Dg=(s,o)=>{if(s==="dev")return-1;const r=s.split(".").map(Number),c=o.split(".").map(Number);for(let d=0;d<3;d++){const f=r[d]||0,m=c[d]||0;if(f>m)return-1;if(f<m)return 1}return 0},Gv=({isOpen:s,onClose:o,version:r})=>{const{t:c}=ke(),[d,f]=w.useState(!1),[m,p]=w.useState(""),[g,h]=w.useState(!1),y=async()=>{h(!0);try{const j=await zg();j&&(p(j),f(Dg(r,j)>0))}catch(j){console.error("Failed to check for updates:",j)}finally{h(!1)}};return w.useEffect(()=>{s&&y()},[s,r]),s?l.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:l.jsxs("div",{className:"p-6 relative",children:[l.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":c("common.close"),children:l.jsx(Dl,{className:"h-5 w-5"})}),l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("about.title")}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-gray-700 dark:text-gray-300",children:[c("about.currentVersion"),":"]}),l.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:r})]}),d&&m&&l.jsx("div",{className:"bg-blue-50 dark:bg-blue-900 p-3 rounded",children:l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"ml-3 flex-1 text-sm text-blue-700 dark:text-blue-300",children:[l.jsx("p",{children:c("about.newVersionAvailable",{version:m})}),l.jsx("p",{className:"mt-1",children:l.jsx("a",{href:"https://github.com/samanhappy/mcphub",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 hover:underline",children:c("about.viewOnGitHub")})})]})]})}),l.jsxs("button",{onClick:y,disabled:g,className:`mt-4 inline-flex items-center px-4 py-2 border border-gray-200 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium btn-secondary
|
|
182
|
-
${g?"text-gray-400 dark:text-gray-500 bg-gray-100 dark:bg-gray-800":"text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600"} focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500`,children:[l.jsx(Sb,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),c(g?"about.checking":"about.checkForUpdates")]})]})]})})}):null},$v=({open:s,onOpenChange:o})=>{const{i18n:r,t:c}=ke();return s?l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:l.jsxs("div",{className:"p-6 relative",children:[l.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":c("common.close"),children:l.jsx(Dl,{className:"h-5 w-5"})}),l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("sponsor.title")}),l.jsx("div",{className:"flex flex-col items-center justify-center py-4",children:r.language==="zh"?l.jsx("img",{src:"./assets/reward.png",alt:c("sponsor.rewardAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}):l.jsxs("div",{className:"text-center",children:[l.jsx("p",{className:"mb-4 text-gray-700 dark:text-gray-300",children:c("sponsor.supportMessage")}),l.jsx("a",{href:"https://ko-fi.com/samanhappy",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center bg-[#13C3FF] text-white px-4 py-2 rounded-md hover:bg-[#00A5E5] transition-colors",children:c("sponsor.supportButton")})]})})]})})}):null},Kv=({open:s,onOpenChange:o})=>{const{t:r}=ke();return s?l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:l.jsxs("div",{className:"p-6 relative",children:[l.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":r("common.close"),children:l.jsx(Dl,{className:"h-5 w-5"})}),l.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:r("wechat.title")}),l.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[l.jsx("img",{src:"./assets/wexin.png",alt:r("wechat.qrCodeAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}),l.jsx("p",{className:"mt-4 text-center text-gray-700 dark:text-gray-300",children:r("wechat.scanMessage")})]})]})})}):null},Yv=s=>l.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[l.jsx("title",{children:"WeChat"}),l.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"})]}),Pv=s=>l.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[l.jsx("title",{children:"Discord"}),l.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"})]}),Xv=s=>l.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[l.jsx("title",{children:"Sponsor"}),l.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"})]}),Qv=({collapsed:s,version:o})=>{var K;const{t:r,i18n:c}=ke(),d=On(),{auth:f,logout:m}=Hl(),[p,g]=w.useState(!1),[h,y]=w.useState(!1),[j,v]=w.useState(!1),[A,N]=w.useState(!1),[O,R]=w.useState(!1),S=w.useRef(null);w.useEffect(()=>{(async()=>{try{const Z=await zg();Z&&y(Dg(o,Z)>0)}catch(Z){console.error("Error checking for new version:",Z)}})()},[o]),w.useEffect(()=>{const B=Z=>{S.current&&!S.current.contains(Z.target)&&g(!1)};return document.addEventListener("mousedown",B),()=>{document.removeEventListener("mousedown",B)}},[]);const C=()=>{d("/settings"),g(!1)},z=()=>{m(),d("/login")},P=()=>{v(!0),g(!1)},L=()=>{N(!0),g(!1)},I=()=>{R(!0),g(!1)};return l.jsxs("div",{ref:S,className:"relative",children:[l.jsxs("button",{onClick:()=>g(!p),className:`flex ${s?"justify-center":"items-center"} w-full p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors rounded-md ${p?"bg-gray-100 dark:bg-gray-700":""}`,children:[l.jsxs("div",{className:"flex-shrink-0 relative",children:[l.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:l.jsx(Mb,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),h&&l.jsx("span",{className:"absolute -top-1 -right-1 block w-2 h-2 bg-red-500 rounded-full"})]}),!s&&l.jsx("div",{className:"ml-3 flex flex-col items-start",children:l.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:((K=f.user)==null?void 0:K.username)||r("auth.user")})})]}),p&&l.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:[l.jsxs("button",{onClick:L,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:[l.jsx(Xv,{className:"h-4 w-4 mr-2"}),r("sponsor.label")]}),c.language==="zh"?l.jsxs("button",{onClick:I,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:[l.jsx(Yv,{className:"h-4 w-4 mr-2"}),r("wechat.label")]}):l.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:[l.jsx(Pv,{className:"h-4 w-4 mr-2"}),r("discord.label")]}),l.jsxs("button",{onClick:C,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[l.jsx(Cb,{className:"h-4 w-4 mr-2"}),r("nav.settings")]}),l.jsxs("button",{onClick:P,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:[l.jsx(db,{className:"h-4 w-4 mr-2"}),r("about.title"),h&&l.jsx("span",{className:"absolute top-2 right-4 block w-2 h-2 bg-red-500 rounded-full"})]}),l.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600"}),l.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:[l.jsx(xb,{className:"h-4 w-4 mr-2"}),r("app.logout")]})]}),l.jsx(Gv,{isOpen:j,onClose:()=>v(!1),version:o}),l.jsx($v,{open:A,onOpenChange:N}),l.jsx(Kv,{open:O,onOpenChange:R})]})},Fv=({collapsed:s})=>{var f;const{t:o}=ke(),{auth:r}=Hl(),c="0.8.6",d=[{path:"/",label:o("nav.dashboard"),icon:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[l.jsx("path",{d:"M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"}),l.jsx("path",{d:"M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"})]})},{path:"/servers",label:o("nav.servers"),icon:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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=r.user)!=null&&f.isAdmin&&Mg("x")?[{path:"/users",label:o("nav.users"),icon:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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 l.jsxs("aside",{className:`bg-white dark:bg-gray-800 shadow-sm transition-all duration-300 ease-in-out flex flex-col h-full relative ${s?"w-16":"w-64"}`,children:[l.jsx("div",{className:"overflow-y-auto flex-grow",children:l.jsx("nav",{className:"p-3 space-y-1",children:d.map(m=>l.jsxs(rg,{to:m.path,className:({isActive:p})=>`flex items-center px-2.5 py-2 rounded-lg transition-colors duration-200
|
|
183
|
-
${p?"bg-blue-50 text-blue-700":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-100"}`,end:m.path==="/",children:[l.jsx("span",{className:"flex-shrink-0",children:m.icon}),!s&&l.jsx("span",{className:"ml-3",children:m.label})]},m.path))})}),l.jsx("div",{className:"p-3 bg-white dark:bg-gray-800",children:l.jsx(Qv,{collapsed:s,version:c})})]})},Zv=({children:s})=>l.jsx("main",{className:"flex-1 overflow-auto p-6 bg-gray-100 dark:bg-gray-900",children:l.jsx("div",{className:"container mx-auto",children:s})}),Jv=()=>{const[s,o]=Ns.useState(!1),r=()=>{o(!s)};return l.jsxs("div",{className:"flex flex-col h-screen bg-gray-100 dark:bg-gray-900",children:[l.jsx(Bv,{onToggleSidebar:r}),l.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[l.jsx(Fv,{collapsed:s}),l.jsx(Zv,{children:l.jsx(eg,{})})]})]})},Iv=({redirectPath:s="/login"})=>{const{t:o}=ke(),{auth:r}=Hl();return r.loading?l.jsx("div",{className:"flex items-center justify-center h-screen",children:o("app.loading")}):r.isAuthenticated?l.jsx(eg,{}):l.jsx(Wh,{to:s,replace:!0})},Wv=()=>{const{t:s}=ke(),[o,r]=w.useState(""),[c,d]=w.useState(""),[f,m]=w.useState(null),[p,g]=w.useState(!1),{login:h}=Hl(),y=On(),j=async v=>{v.preventDefault(),m(null),g(!0);try{if(!o||!c){m(s("auth.emptyFields")),g(!1);return}await h(o,c)?y("/"):m(s("auth.loginFailed"))}catch{m(s("auth.loginError"))}finally{g(!1)}};return l.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 py-12 px-4 sm:px-6 lg:px-8 login-container",children:[l.jsxs("div",{className:"absolute top-4 right-4 w-full max-w-xs flex justify-end",children:[l.jsx(Rg,{}),l.jsx(Og,{})]}),l.jsxs("div",{className:"max-w-md w-full space-y-8 login-card p-8",children:[l.jsx("div",{children:l.jsx("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white",children:s("auth.loginTitle")})}),l.jsxs("form",{className:"mt-8 space-y-6",onSubmit:j,children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"username",className:"sr-only",children:s("auth.username")}),l.jsx("input",{id:"username",name:"username",type:"text",autoComplete:"username",required:!0,className:"appearance-none relative block w-full px-3 py-3 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white dark:bg-gray-800 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm transition-all duration-200 form-input shadow-sm",placeholder:s("auth.username"),value:o,onChange:v=>r(v.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"password",className:"sr-only",children:s("auth.password")}),l.jsx("input",{id:"password",name:"password",type:"password",autoComplete:"current-password",required:!0,className:"appearance-none relative block w-full px-3 py-3 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white dark:bg-gray-800 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm login-input transition-all duration-200 form-input shadow-sm",placeholder:s("auth.password"),value:c,onChange:v=>d(v.target.value)})]})]}),f&&l.jsx("div",{className:"text-red-500 dark:text-red-400 text-sm text-center error-box p-2 rounded",children:f}),l.jsx("div",{children:l.jsx("button",{type:"submit",disabled:p,className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 login-button transition-all duration-200 btn-primary",children:s(p?"auth.loggingIn":"auth.login")})})]})]})]})},oo={startup:{maxAttempts:60,pollingInterval:3e3},normal:{pollingInterval:1e4}},Vl=()=>{const{t:s}=ke(),[o,r]=w.useState([]),[c,d]=w.useState(null),[f,m]=w.useState(0),[p,g]=w.useState(!0),[h,y]=w.useState(0),j=w.useRef(null),v=w.useRef(0),A=()=>{j.current&&(clearInterval(j.current),j.current=null)},N=w.useCallback(()=>{A();const P=async()=>{try{const L=localStorage.getItem("mcphub_token"),K=await(await fetch(Ne("/servers"),{headers:{"x-auth-token":L||""}})).json();K&&K.success&&Array.isArray(K.data)?r(K.data):K&&Array.isArray(K)?r(K):(console.error("Invalid server data format:",K),r([])),d(null)}catch(L){console.error("Error fetching servers during normal polling:",L),navigator.onLine?L instanceof TypeError&&(L.message.includes("NetworkError")||L.message.includes("Failed to fetch"))?d(s("errors.serverConnection")):d(s("errors.serverFetch")):d(s("errors.network"))}};P(),j.current=setInterval(P,oo.normal.pollingInterval)},[s]);return w.useEffect(()=>{f>0&&(v.current=0,y(0));const P=async()=>{try{const L=localStorage.getItem("mcphub_token"),K=await(await fetch(Ne("/servers"),{headers:{"x-auth-token":L||""}})).json();return K&&K.success&&Array.isArray(K.data)?(r(K.data),g(!1),N(),!0):K&&Array.isArray(K)?(r(K),g(!1),N(),!0):(console.error("Invalid server data format:",K),r([]),g(!1),N(),!0)}catch(L){return v.current+=1,console.error(`Initial loading attempt ${v.current} failed:`,L),y(v.current),navigator.onLine?d(s("errors.initialStartup")):d(s("errors.network")),v.current>=oo.startup.maxAttempts&&(console.log("Maximum startup attempts reached, switching to normal polling"),g(!1),A(),N()),!1}};return p?(A(),P(),j.current=setInterval(P,oo.startup.pollingInterval),console.log(`Started initial polling with interval: ${oo.startup.pollingInterval}ms`)):N(),()=>{A()}},[f,s,p,N]),{servers:o,error:c,setError:d,isLoading:p,fetchAttempts:h,triggerRefresh:()=>{A(),p&&(g(!0),v.current=0,y(0)),m(P=>P+1)},handleServerAdd:()=>{m(P=>P+1)},handleServerEdit:async P=>{try{const L=localStorage.getItem("mcphub_token"),K=await(await fetch(Ne("/settings"),{headers:{"x-auth-token":L||""}})).json();if(K&&K.success&&K.data&&K.data.mcpServers&&K.data.mcpServers[P.name]){const B=K.data.mcpServers[P.name];return{name:P.name,status:P.status,tools:P.tools||[],config:B}}else return console.error("Failed to get server config from settings:",K),d(s("server.invalidConfig",{serverName:P.name})),null}catch(L){return console.error("Error fetching server settings:",L),d(L instanceof Error?L.message:String(L)),null}},handleServerRemove:async P=>{try{const L=localStorage.getItem("mcphub_token"),I=await fetch(Ne(`/servers/${P}`),{method:"DELETE",headers:{"x-auth-token":L||""}}),K=await I.json();return I.ok?(m(B=>B+1),!0):(d(K.message||s("server.deleteError",{serverName:P})),!1)}catch(L){return d(s("errors.general")+": "+(L instanceof Error?L.message:String(L))),!1}},handleServerToggle:async(P,L)=>{try{const I=localStorage.getItem("mcphub_token"),K=await fetch(Ne(`/servers/${P.name}/toggle`),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":I||""},body:JSON.stringify({enabled:L})}),B=await K.json();return K.ok?(m(Z=>Z+1),!0):(console.error("Failed to toggle server:",B),d(s("server.toggleError",{serverName:P.name})),!1)}catch(I){return console.error("Error toggling server:",I),d(I instanceof Error?I.message:String(I)),!1}}}},e1=()=>{const{t:s}=ke(),{servers:o,error:r,setError:c,isLoading:d}=Vl(),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 l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:s("pages.dashboard.title")}),r&&l.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-status-red text-lg font-medium",children:s("app.error")}),l.jsx("p",{className:"text-gray-600 mt-1",children:r})]}),l.jsx("button",{onClick:()=>c(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200","aria-label":s("app.closeButton"),children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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&&l.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:l.jsxs("div",{className:"flex flex-col items-center",children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}),!d&&l.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4",children:[l.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-3 rounded-full bg-blue-100 text-blue-800 icon-container status-icon-blue",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"ml-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.totalServers")}),l.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.total})]})]})}),l.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-3 rounded-full bg-green-100 text-green-800 icon-container status-icon-green",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"ml-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.onlineServers")}),l.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.online})]})]})}),l.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-3 rounded-full bg-red-100 text-red-800 icon-container status-icon-red",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"ml-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.offlineServers")}),l.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.offline})]})]})}),l.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:l.jsxs("div",{className:"flex items-center",children:[l.jsx("div",{className:"p-3 rounded-full bg-yellow-100 text-yellow-800 icon-container status-icon-yellow",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),l.jsxs("div",{className:"ml-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.connectingServers")}),l.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.connecting})]})]})})]}),o.length>0&&!d&&l.jsxs("div",{className:"mt-8",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:s("pages.dashboard.recentServers")}),l.jsx("div",{className:"bg-white shadow rounded-lg overflow-hidden table-container",children:l.jsxs("table",{className:"min-w-full",children:[l.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:l.jsxs("tr",{children:[l.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.name")}),l.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.status")}),l.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.tools")}),l.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.enabled")})]})}),l.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:o.slice(0,5).map((p,g)=>{var h;return l.jsxs("tr",{children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:p.name}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:l.jsx("span",{className:`px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ${p.status==="connected"?"status-badge-online":p.status==="disconnected"?"status-badge-offline":"status-badge-connecting"}`,children:s(m[p.status]||p.status)})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((h=p.tools)==null?void 0:h.length)||0}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:p.enabled!==!1?l.jsx("span",{className:"text-green-600",children:"✓"}):l.jsx("span",{className:"text-status-red",children:"✗"})})]},g)})})]})})]})]})},t1="modulepreload",a1=function(s,o){return new URL(s,o).href},Sh={},n1=function(o,r,c){let d=Promise.resolve();if(r&&r.length>0){let m=function(y){return Promise.all(y.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),h=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));d=m(r.map(y=>{if(y=a1(y,c),y in Sh)return;Sh[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let O=p.length-1;O>=0;O--){const R=p[O];if(R.href===y&&(!j||R.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const N=document.createElement("link");if(N.rel=j?"stylesheet":t1,j||(N.as="script"),N.crossOrigin="",N.href=y,h&&N.setAttribute("nonce",h),document.head.appendChild(N),j)return new Promise((O,R)=>{N.addEventListener("load",O),N.addEventListener("error",()=>R(new Error(`Unable to preload CSS for ${y}`)))})}))}function f(m){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=m,window.dispatchEvent(p),!p.defaultPrevented)throw m}return d.then(m=>{for(const p of m||[])p.status==="rejected"&&f(p.reason);return o().catch(f)})},s1={default:"bg-blue-500 text-white hover:bg-blue-600",secondary:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600",outline:"bg-transparent border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800",destructive:"bg-red-500 text-white hover:bg-red-600"};function io({children:s,variant:o="default",className:r,onClick:c}){return l.jsx("span",{className:Aa("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",s1[o],c?"cursor-pointer":"",r),onClick:c,children:s})}const l1=({status:s})=>{const{t:o}=ke(),r={connecting:"status-badge-connecting",connected:"status-badge-online",disconnected:"status-badge-offline"},c={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting"};return l.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${r[s]}`,children:o(c[s]||s)})},Ug=async(s,o)=>{try{const r=ln(),c=o?`/tools/call/${o}`:"/tools/call",d=await fetch(Ne(c),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":r||"",Authorization:`Bearer ${r}`},body:JSON.stringify({toolName:s.toolName,arguments:s.arguments})});if(!d.ok)throw new Error(`HTTP ${d.status}: ${d.statusText}`);const f=await d.json();return f.success?{success:!0,content:f.data.content||[]}:{success:!1,error:f.message||"Tool call failed"}}catch(r){return console.error("Error calling tool:",r),{success:!1,error:r instanceof Error?r.message:"Unknown error occurred"}}},r1=async(s,o,r)=>{try{const c=ln(),d=await fetch(Ne(`/servers/${s}/tools/${o}/toggle`),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":c||"",Authorization:`Bearer ${c}`},body:JSON.stringify({enabled:r})});if(!d.ok)throw new Error(`HTTP ${d.status}: ${d.statusText}`);const f=await d.json();return{success:f.success,error:f.success?void 0:f.message}}catch(c){return console.error("Error toggling tool:",c),{success:!1,error:c instanceof Error?c.message:"Unknown error occurred"}}},Lg=async(s,o,r)=>{try{const c=ln(),d=await fetch(Ne(`/servers/${s}/tools/${o}/description`),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":c||"",Authorization:`Bearer ${c||""}`},body:JSON.stringify({description:r})});if(!d.ok)throw new Error(`HTTP ${d.status}: ${d.statusText}`);const f=await d.json();return{success:f.success,error:f.success?void 0:f.message}}catch(c){return console.error("Error updating tool description:",c),{success:!1,error:c instanceof Error?c.message:"Unknown error occurred"}}},o1=Object.freeze(Object.defineProperty({__proto__:null,callTool:Ug,toggleTool:r1,updateToolDescription:Lg},Symbol.toStringTag,{value:"Module"})),Ss=({checked:s,onCheckedChange:o,disabled:r=!1})=>l.jsx("button",{type:"button",role:"switch","aria-checked":s,disabled:r,className:Aa("relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",s?"bg-blue-200":"bg-gray-100",r?"opacity-50 cursor-not-allowed":"cursor-pointer"),onClick:()=>!r&&o(!s),children:l.jsx("span",{className:Aa("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",s?"translate-x-6":"translate-x-1")})}),i1=({schema:s,onSubmit:o,onCancel:r,loading:c=!1,storageKey:d,title:f})=>{const{t:m}=ke(),[p,g]=w.useState({}),[h,y]=w.useState({}),[j,v]=w.useState(!1),[A,N]=w.useState(""),[O,R]=w.useState(""),S=w.useMemo(()=>(U=>{const se=_=>{if(typeof _=="object"&&_!==null){const V=_;return{type:V.type||"string",description:V.description,enum:V.enum,default:V.default,properties:V.properties?Object.fromEntries(Object.entries(V.properties).map(([k,G])=>[k,se(G)])):void 0,required:V.required,items:V.items?se(V.items):void 0}}return{type:"string"}};return{type:U.type,properties:U.properties?Object.fromEntries(Object.entries(U.properties).map(([_,V])=>[_,se(V)])):void 0,required:U.required}})(s),[s]);w.useEffect(()=>{const D=(se,_="")=>{const V={};return se.type==="object"&&se.properties&&Object.entries(se.properties).forEach(([k,G])=>{const F=_?`${_}.${k}`:k;G.default!==void 0?V[k]=G.default:G.type==="string"?V[k]="":G.type==="number"||G.type==="integer"?V[k]=0:G.type==="boolean"?V[k]=!1:G.type==="array"?V[k]=[]:G.type==="object"&&(G.properties?V[k]=D(G,F):V[k]={})}),V};let U=D(S);if(d)try{const se=localStorage.getItem(d);if(se){const _=JSON.parse(se);U={...U,..._}}}catch(se){console.warn("Failed to load saved form data:",se)}g(U)},[S,d]),w.useEffect(()=>{j&&Object.keys(p).length>0&&(N(JSON.stringify(p,null,2)),R(""))},[j,p]);const C=D=>{N(D),R("");try{const U=JSON.parse(D);if(g(U),d)try{localStorage.setItem(d,JSON.stringify(U))}catch(se){console.warn("Failed to save form data to localStorage:",se)}}catch{R(m("tool.invalidJsonFormat"))}},z=()=>{N(JSON.stringify(p,null,2)),R(""),v(!0)},P=()=>{if(A.trim())try{const D=JSON.parse(A);g(D),R(""),v(!1)}catch{R(m("tool.fixJsonBeforeSwitching"));return}else v(!1)},L=(D,U)=>{g(se=>{const _={...se},V=D.split(".");let k=_;for(let G=0;G<V.length-1;G++)k[V[G]]||(k[V[G]]={}),k=k[V[G]];if(k[V[V.length-1]]=U,d)try{localStorage.setItem(d,JSON.stringify(_))}catch(G){console.warn("Failed to save form data to localStorage:",G)}return _}),h[D]&&y(se=>{const _={...se};return delete _[D],_})},I=()=>{const D={},U=(se,_,V="")=>{se.type==="object"&&se.properties&&Object.entries(se.properties).forEach(([k,G])=>{var E;const F=V?`${V}.${k}`:k,ce=B(_,F);if((E=se.required)!=null&&E.includes(k)&&(ce==null||ce==="")){D[F]=`${k} is required`;return}ce!=null&&ce!==""&&(G.type==="string"&&typeof ce!="string"?D[F]=`${k} must be a string`:G.type==="number"&&typeof ce!="number"?D[F]=`${k} must be a number`:G.type==="integer"&&(!Number.isInteger(ce)||typeof ce!="number")?D[F]=`${k} must be an integer`:G.type==="boolean"&&typeof ce!="boolean"?D[F]=`${k} must be a boolean`:G.type==="array"&&Array.isArray(ce)?G.items&&ce.forEach((X,le)=>{var ne;((ne=G.items)==null?void 0:ne.type)==="object"&&G.items.properties&&U(G.items,X,`${F}.${le}`)}):G.type==="object"&&typeof ce=="object"&&U(G,ce,F))})};return U(S,p),y(D),Object.keys(D).length===0},K=D=>{D.preventDefault(),I()&&o(p)},B=(D,U)=>U.split(".").reduce((se,_)=>se==null?void 0:se[_],D),Z=(D,U,se,_)=>{const V=se==null?void 0:se[D];return U.type==="string"?U.enum?l.jsxs("select",{value:V||"",onChange:k=>_(k.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:[l.jsx("option",{value:"",children:m("tool.selectOption")}),U.enum.map((k,G)=>l.jsx("option",{value:k,children:k},G))]}):l.jsx("input",{type:"text",value:V||"",onChange:k=>_(k.target.value),className:"w-full border rounded-md px-2 py-1 text-sm border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500 form-input",placeholder:U.description||m("tool.enterKey",{key:D})}):U.type==="number"||U.type==="integer"?l.jsx("input",{type:"number",step:U.type==="integer"?"1":"any",value:V||"",onChange:k=>{const G=k.target.value===""?"":U.type==="integer"?parseInt(k.target.value):parseFloat(k.target.value);_(G)},className:"w-full border rounded-md px-2 py-1 text-sm border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500 form-input"}):U.type==="boolean"?l.jsx("input",{type:"checkbox",checked:V||!1,onChange:k=>_(k.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}):l.jsx("input",{type:"text",value:V||"",onChange:k=>_(k.target.value),className:"w-full border rounded-md px-2 py-1 text-sm border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500 form-input",placeholder:U.description||m("tool.enterKey",{key:D})})},te=(D,U,se="")=>{var G,F,ce,E,X,le,ne,de,we,ae,re,ie,xe,Be;const _=se?`${se}.${D}`:D,V=B(p,_),k=h[_];if(U.type==="array"){const je=B(p,_)||[];return l.jsxs("div",{className:"mb-6",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[D,(se?(F=(G=B(S,se))==null?void 0:G.required)==null?void 0:F.includes(D):(ce=S.required)==null?void 0:ce.includes(D))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),U.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),l.jsxs("div",{className:"border border-gray-200 rounded-md p-3 bg-gray-50",children:[je.map((De,Je)=>{var Ct,ua,rn;return l.jsxs("div",{className:"mb-3 p-3 bg-white border rounded-md",children:[l.jsxs("div",{className:"flex justify-between items-center mb-2",children:[l.jsx("span",{className:"text-sm font-medium text-gray-600",children:m("tool.item",{index:Je+1})}),l.jsx("button",{type:"button",onClick:()=>{const Le=[...je];Le.splice(Je,1),L(_,Le)},className:"text-status-red hover:text-red-700 text-sm",children:m("common.remove")})]}),((Ct=U.items)==null?void 0:Ct.type)==="string"&&U.items.enum?l.jsxs("select",{value:De||"",onChange:Le=>{const vt=[...je];vt[Je]=Le.target.value,L(_,vt)},className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[l.jsx("option",{value:"",children:m("tool.selectOption")}),U.items.enum.map((Le,vt)=>l.jsx("option",{value:Le,children:Le},vt))]}):((ua=U.items)==null?void 0:ua.type)==="object"&&U.items.properties?l.jsx("div",{className:"space-y-3",children:Object.entries(U.items.properties).map(([Le,vt])=>{var Oa,Ma;return l.jsxs("div",{children:[l.jsxs("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Le,((Ma=(Oa=U.items)==null?void 0:Oa.required)==null?void 0:Ma.includes(Le))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),Z(Le,vt,De,da=>{const za=[...je];za[Je]={...za[Je],[Le]:da},L(_,za)})]},Le)})}):l.jsx("input",{type:"text",value:De||"",onChange:Le=>{const vt=[...je];vt[Je]=Le.target.value,L(_,vt)},className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",placeholder:m("tool.enterValue",{type:((rn=U.items)==null?void 0:rn.type)||"value"})})]},Je)}),l.jsx("button",{type:"button",onClick:()=>{var Je;const De=((Je=U.items)==null?void 0:Je.type)==="object"?{}:"";L(_,[...je,De])},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:D})})]}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},_)}return U.type==="object"?U.properties?l.jsxs("div",{className:"mb-6",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[D,(se?(X=(E=B(S,se))==null?void 0:E.required)==null?void 0:X.includes(D):(le=S.required)==null?void 0:le.includes(D))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),U.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),l.jsx("div",{className:"border border-gray-200 rounded-md p-4 bg-gray-50",children:Object.entries(U.properties).map(([je,De])=>te(je,De,_))}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},_):l.jsxs("div",{className:"mb-4",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[D,(se?(de=(ne=B(S,se))==null?void 0:ne.required)==null?void 0:de.includes(D):(we=S.required)==null?void 0:we.includes(D))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"}),l.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(JSON object)"})]}),U.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),l.jsx("textarea",{value:typeof V=="object"?JSON.stringify(V,null,2):V||"{}",onChange:je=>{try{const De=JSON.parse(je.target.value);L(_,De)}catch{L(_,je.target.value)}},placeholder:`{
|
|
184
|
-
"key": "value"
|
|
185
|
-
}`,className:`w-full border rounded-md px-3 py-2 font-mono text-sm ${k?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,rows:4}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},_):U.type==="string"?U.enum?l.jsxs("div",{className:"mb-4",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[D,(se?!1:(ae=S.required)==null?void 0:ae.includes(D))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),U.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),l.jsxs("select",{value:V||"",onChange:je=>L(_,je.target.value),className:`w-full border rounded-md px-3 py-2 ${k?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[l.jsx("option",{value:"",children:m("tool.selectOption")}),U.enum.map((je,De)=>l.jsx("option",{value:je,children:je},De))]}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},_):l.jsxs("div",{className:"mb-4",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[D,(se?!1:(re=S.required)==null?void 0:re.includes(D))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),U.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),l.jsx("input",{type:"text",value:V||"",onChange:je=>L(_,je.target.value),className:`w-full border rounded-md px-3 py-2 ${k?"border-red":"border-gray-200"} focus:outline-none form-input`}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},_):U.type==="number"||U.type==="integer"?l.jsxs("div",{className:"mb-4",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[D,(se?!1:(ie=S.required)==null?void 0:ie.includes(D))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),U.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),l.jsx("input",{type:"number",step:U.type==="integer"?"1":"any",value:V||"",onChange:je=>{const De=je.target.value===""?"":U.type==="integer"?parseInt(je.target.value):parseFloat(je.target.value);L(_,De)},className:`w-full border rounded-md px-3 py-2 form-input ${k?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},_):U.type==="boolean"?l.jsxs("div",{className:"mb-4",children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("input",{type:"checkbox",checked:V||!1,onChange:je=>L(_,je.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),l.jsxs("label",{className:"ml-2 block text-sm text-gray-700",children:[D,(se?!1:(xe=S.required)==null?void 0:xe.includes(D))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"})]})]}),U.description&&l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:U.description}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},_):l.jsxs("div",{className:"mb-4",children:[l.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[D,(se?!1:(Be=S.required)==null?void 0:Be.includes(D))&&l.jsx("span",{className:"text-status-red ml-1",children:"*"}),l.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",U.type,")"]})]}),U.description&&l.jsx("p",{className:"text-xs text-gray-500 mb-2",children:U.description}),l.jsx("input",{type:"text",value:V||"",onChange:je=>L(_,je.target.value),placeholder:m("tool.enterValue",{type:U.type}),className:`w-full border rounded-md px-3 py-2 ${k?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500 form-input`}),k&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]},_)};return S.properties?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex justify-between items-center pb-3",children:[l.jsx("h6",{className:"text-md font-medium text-gray-900",children:f}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx("button",{type:"button",onClick:P,className:`px-3 py-1 text-sm rounded-md transition-colors ${j?"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")}),l.jsx("button",{type:"button",onClick:z,className:`px-3 py-1 text-sm rounded-md transition-colors ${j?"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")})]})]}),j?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:m("tool.jsonConfiguration")}),l.jsx("textarea",{value:A,onChange:D=>C(D.target.value),placeholder:`{
|
|
186
|
-
"key": "value"
|
|
187
|
-
}`,className:`w-full h-64 border rounded-md px-3 py-2 font-mono text-sm resize-y form-input ${O?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),O&&l.jsx("p",{className:"text-status-red text-xs mt-1",children:O})]}),l.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[l.jsx("button",{type:"button",onClick:r,className:"px-4 py-1 text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:m("tool.cancel")}),l.jsx("button",{onClick:()=>{try{const D=JSON.parse(A);o(D)}catch{R(m("tool.invalidJsonFormat"))}},disabled:c||!!O,className:"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m(c?"tool.running":"tool.runTool")})]})]}):l.jsxs("form",{onSubmit:K,className:"space-y-4",children:[Object.entries(S.properties||{}).map(([D,U])=>te(D,U)),l.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[l.jsx("button",{type:"button",onClick:r,className:"px-4 py-1 text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:m("tool.cancel")}),l.jsx("button",{type:"submit",disabled:c,className:"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m(c?"tool.running":"tool.runTool")})]})]})]}):l.jsxs("div",{className:"p-4 bg-gray-50 rounded-md",children:[l.jsx("p",{className:"text-sm text-gray-600",children:m("tool.noParameters")}),l.jsxs("div",{className:"flex justify-end space-x-2 mt-4",children:[l.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 text-sm text-gray-600 bg-gray-100 rounded-md hover:bg-gray-200",children:m("tool.cancel")}),l.jsx("button",{onClick:()=>o({}),disabled:c,className:"px-4 py-2 text-sm text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",children:m(c?"tool.running":"tool.runTool")})]})]})},c1=({result:s,onClose:o})=>{const{t:r}=ke(),c=s.content,d=m=>Array.isArray(m)?m.map((p,g)=>l.jsx("div",{className:"mb-3 last:mb-0",children:f(p)},g)):f(m),f=m=>{if(typeof m=="string")return l.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:l.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 l.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:l.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:m.text})});if(m.type==="image"&&m.data)return l.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:l.jsx("img",{src:`data:${m.mimeType||"image/png"};base64,${m.data}`,alt:r("tool.toolResult"),className:"max-w-full h-auto rounded-md"})});try{const p=typeof m=="string"?JSON.parse(m):m;return l.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[l.jsx("div",{className:"text-xs text-gray-500 mb-2",children:r("tool.jsonResponse")}),l.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(p,null,2)})]})}catch{return l.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:l.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(m)})})}}return l.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:l.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(m)})})};return l.jsxs("div",{className:"border border-gray-300 rounded-lg bg-white shadow-sm",children:[l.jsx("div",{className:"border-b border-gray-300 px-4 py-3 bg-gray-50 rounded-t-lg",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[s.success?l.jsx(sb,{size:20,className:"text-status-green"}):l.jsx(rb,{size:20,className:"text-status-red"}),l.jsx("div",{children:l.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[r("tool.execution")," ",s.success?r("tool.successful"):r("tool.failed")]})})]}),l.jsx("button",{onClick:o,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),l.jsx("div",{className:"p-4",children:s.success?l.jsx("div",{children:s.content&&s.content.length>0?l.jsxs("div",{children:[l.jsx("div",{className:"text-sm text-gray-600 mb-3",children:r("tool.result")}),d(s.content)]}):l.jsx("div",{className:"text-sm text-gray-500 italic",children:r("tool.noContent")})}):l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[l.jsx(fg,{size:16,className:"text-red-500"}),l.jsx("span",{className:"text-sm font-medium text-red-700",children:r("tool.error")})]}),c&&c.length>0?l.jsxs("div",{children:[l.jsx("div",{className:"text-sm text-gray-600 mb-3",children:r("tool.errorDetails")}),d(c)]}):l.jsx("div",{className:"bg-red-50 border border-red-300 rounded-md p-3",children:l.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap",children:s.error||s.message||r("tool.unknownError")})})]})})]})},u1=({tool:s,server:o,onToggle:r,onDescriptionUpdate:c})=>{const{t:d}=ke(),[f,m]=w.useState(!1),[p,g]=w.useState(!1),[h,y]=w.useState(!1),[j,v]=w.useState(null),[A,N]=w.useState(!1),[O,R]=w.useState(s.description||""),S=w.useRef(null),C=w.useRef(null),[z,P]=w.useState(0);w.useEffect(()=>{A&&S.current&&(S.current.focus(),z>0&&(S.current.style.width=`${z+20}px`))},[A,z]),w.useEffect(()=>{!A&&C.current&&P(C.current.offsetWidth)},[A,O]);const L=w.useCallback(()=>`mcphub_tool_form_${o?`${o}_`:""}${s.name}`,[s.name,o]),I=w.useCallback(()=>{localStorage.removeItem(L())},[L]),K=V=>{r&&r(s.name,V)},B=()=>{N(!0)},Z=async()=>{try{const V=await Lg(o,s.name,O);V.success?(N(!1),c&&c(s.name,O)):(R(s.description||""),console.error("Failed to update tool description:",V.error))}catch(V){console.error("Error updating tool description:",V),R(s.description||""),N(!1)}},te=V=>{R(V.target.value)},D=V=>{V.key==="Enter"?Z():V.key==="Escape"&&(R(s.description||""),N(!1))},U=async V=>{y(!0);try{const k=await Ug({toolName:s.name,arguments:V},o);v(k)}catch(k){v({success:!1,error:k instanceof Error?k.message:"Unknown error occurred"})}finally{y(!1)}},se=()=>{g(!1),I(),v(null)},_=()=>{v(null)};return l.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg p-4 mb-4",children:[l.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>m(!f),children:[l.jsx("div",{className:"flex-1",children:l.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:[s.name.replace(o+"-",""),l.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600 inline-flex items-center",children:A?l.jsxs(l.Fragment,{children:[l.jsx("input",{ref:S,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:O,onChange:te,onKeyDown:D,onClick:V=>V.stopPropagation(),style:{minWidth:"100px",width:z>0?`${z+20}px`:"auto"}}),l.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:V=>{V.stopPropagation(),Z()},children:l.jsx(vo,{size:16})})]}):l.jsxs(l.Fragment,{children:[l.jsx("span",{ref:C,children:O||d("tool.noDescription")}),l.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:V=>{V.stopPropagation(),B()},children:l.jsx(mg,{size:14})})]})})]})}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("div",{className:"flex items-center space-x-2",onClick:V=>V.stopPropagation(),children:l.jsx(Ss,{checked:s.enabled??!0,onCheckedChange:K,disabled:h})}),l.jsxs("button",{onClick:V=>{V.stopPropagation(),m(!0),g(!0)},className:"flex items-center space-x-1 px-3 py-1 text-sm text-blue-600 bg-blue-50 hover:bg-blue-100 rounded-md transition-colors btn-primary",disabled:h||!s.enabled,children:[h?l.jsx(gb,{size:14,className:"animate-spin"}):l.jsx(wb,{size:14}),l.jsx("span",{children:d(h?"tool.running":"tool.run")})]}),l.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:f?l.jsx(uu,{size:18}):l.jsx(dg,{size:18})})]})]}),f&&l.jsxs("div",{className:"mt-4 space-y-4",children:[!p&&l.jsxs("div",{className:"bg-gray-50 rounded p-3 border border-gray-300",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:d("tool.inputSchema")}),l.jsx("pre",{className:"text-xs text-gray-600 overflow-auto",children:JSON.stringify(s.inputSchema,null,2)})]}),p&&l.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[l.jsx(i1,{schema:s.inputSchema||{type:"object"},onSubmit:U,onCancel:se,loading:h,storageKey:L(),title:d("tool.runToolWithName",{name:s.name.replace(o+"-","")})}),j&&l.jsx("div",{className:"mt-4",children:l.jsx(c1,{result:j,onClose:_})})]})]})]})},_g=({isOpen:s,onClose:o,onConfirm:r,serverName:c,isGroup:d=!1,isUser:f=!1})=>{const{t:m}=ke();return s?l.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:l.jsx("div",{className:"bg-white rounded-lg shadow-lg max-w-md w-full",children:l.jsxs("div",{className:"p-6",children:[l.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:m(f?"users.confirmDelete":d?"groups.confirmDelete":"server.confirmDelete")}),l.jsx("p",{className:"text-gray-500 mb-6",children:f?m("users.deleteWarning",{username:c}):d?m("groups.deleteWarning",{name:c}):m("server.deleteWarning",{name:c})}),l.jsxs("div",{className:"flex justify-end space-x-3",children:[l.jsx("button",{onClick:o,className:"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary",children:m("common.cancel")}),l.jsx("button",{onClick:r,className:"px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600 btn-danger",children:m("common.delete")})]})]})})}):null},d1=({server:s,onRemove:o,onEdit:r,onToggle:c,onRefresh:d})=>{var Z;const{t:f}=ke(),{showToast:m}=Bl(),[p,g]=w.useState(!1),[h,y]=w.useState(!1),[j,v]=w.useState(!1),[A,N]=w.useState(!1),[O,R]=w.useState(!1),S=w.useRef(null);w.useEffect(()=>{const te=D=>{S.current&&!S.current.contains(D.target)&&N(!1)};return document.addEventListener("mousedown",te),()=>{document.removeEventListener("mousedown",te)}},[]);const C=te=>{te.stopPropagation(),y(!0)},z=te=>{te.stopPropagation(),r(s)},P=async te=>{if(te.stopPropagation(),!(j||!c)){v(!0);try{await c(s,s.enabled===!1)}finally{v(!1)}}},L=te=>{te.stopPropagation(),N(!A)},I=te=>{if(te.stopPropagation(),!!s.error)if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(s.error).then(()=>{R(!0),m(f("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>R(!1),2e3)});else{const D=document.createElement("textarea");D.value=s.error,D.style.position="fixed",D.style.left="-9999px",document.body.appendChild(D),D.focus(),D.select();try{document.execCommand("copy"),R(!0),m(f("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>R(!1),2e3)}catch(U){m(f("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",U)}document.body.removeChild(D)}},K=()=>{o(s.name),y(!1)},B=async(te,D)=>{try{const{toggleTool:U}=await n1(async()=>{const{toggleTool:_}=await Promise.resolve().then(()=>o1);return{toggleTool:_}},[],import.meta.url),se=await U(s.name,te,D);se.success?(m(f(D?"tool.enableSuccess":"tool.disableSuccess",{name:te}),"success"),d&&d()):m(se.error||f("tool.toggleFailed"),"error")}catch(U){console.error("Error toggling tool:",U),m(f("tool.toggleFailed"),"error")}};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`bg-white shadow rounded-lg p-6 mb-6 page-card transition-all duration-200 ${s.enabled===!1?"opacity-60":""}`,children:[l.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>g(!p),children:[l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx("h2",{className:`text-xl font-semibold ${s.enabled===!1?"text-gray-600":"text-gray-900"}`,children:s.name}),l.jsx(l1,{status:s.status}),l.jsxs("div",{className:"flex items-center px-2 py-1 bg-blue-50 text-blue-700 rounded-full text-sm btn-primary",children:[l.jsx("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:l.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"})}),l.jsxs("span",{children:[((Z=s.tools)==null?void 0:Z.length)||0," ",f("server.tools")]})]}),s.error&&l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"cursor-pointer",onClick:L,"aria-label":f("server.viewErrorDetails"),children:l.jsx(fg,{className:"text-red-500 hover:text-red-600",size:18})}),A&&l.jsxs("div",{ref:S,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:te=>te.stopPropagation(),children:[l.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:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx("h4",{className:"text-sm font-medium text-red-600",children:f("server.errorDetails")}),l.jsx("button",{onClick:I,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors btn-secondary",title:f("common.copy"),children:O?l.jsx(vo,{size:14,className:"text-green-500"}):l.jsx(Pc,{size:14})})]}),l.jsx("button",{onClick:te=>{te.stopPropagation(),N(!1)},className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),l.jsx("div",{className:"p-4 pt-2",children:l.jsx("pre",{className:"text-sm text-gray-700 break-words whitespace-pre-wrap",children:s.error})})]})]})]}),l.jsxs("div",{className:"flex space-x-2",children:[l.jsx("button",{onClick:z,className:"px-3 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:f("server.edit")}),l.jsx("div",{className:"flex items-center",children:l.jsx("button",{onClick:P,className:`px-3 py-1 text-sm rounded transition-colors ${j?"bg-gray-200 text-gray-500":s.enabled!==!1?"bg-green-100 text-green-800 hover:bg-green-200 btn-secondary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-primary"}`,disabled:j,children:j?f("common.processing"):s.enabled!==!1?f("server.disable"):f("server.enable")})}),l.jsx("button",{onClick:C,className:"px-3 py-1 bg-red-100 text-red-800 rounded hover:bg-red-200 text-sm btn-danger",children:f("server.delete")}),l.jsx("button",{className:"text-gray-400 hover:text-gray-600 btn-secondary",children:p?l.jsx(uu,{size:18}):l.jsx(dg,{size:18})})]})]}),p&&s.tools&&l.jsxs("div",{className:"mt-6",children:[l.jsx("h6",{className:`font-medium ${s.enabled===!1?"text-gray-600":"text-gray-900"} mb-4`,children:f("server.tools")}),l.jsx("div",{className:"space-y-4",children:s.tools.map((te,D)=>l.jsx(u1,{server:s.name,tool:te,onToggle:B},D))})]})]}),l.jsx(_g,{isOpen:h,onClose:()=>y(!1),onConfirm:K,serverName:s.name})]})},fu=({onSubmit:s,onCancel:o,initialData:r=null,modalTitle:c,formError:d=null})=>{var V,k,G,F,ce,E,X,le,ne,de,we,ae,re,ie,xe,Be,je,De,Je,Ct,ua,rn,Le,vt,Oa,Ma,da,za,Rs,ql,Gl,Da,mt,Yt,ht,$l,Kl,Yl,on,cn,ta,un;const{t:f}=ke(),m=()=>!r||!r.config?"stdio":r.config.type?r.config.type:r.config.url?"sse":"stdio",[p,g]=w.useState(m()),[h,y]=w.useState({name:r&&r.name||"",url:r&&r.config&&r.config.url||"",command:r&&r.config&&r.config.command||"",arguments:r&&r.config&&r.config.args?Array.isArray(r.config.args)?r.config.args.join(" "):String(r.config.args):"",args:r&&r.config&&r.config.args||[],type:m(),env:[],headers:[],options:{timeout:r&&r.config&&r.config.options&&r.config.options.timeout||6e4,resetTimeoutOnProgress:r&&r.config&&r.config.options&&r.config.options.resetTimeoutOnProgress||!1,maxTotalTimeout:r&&r.config&&r.config.options&&r.config.options.maxTotalTimeout||void 0},openapi:r&&r.config&&r.config.openapi?{url:r.config.openapi.url||"",schema:r.config.openapi.schema?JSON.stringify(r.config.openapi.schema,null,2):"",inputMode:r.config.openapi.url?"url":r.config.openapi.schema?"schema":"url",version:r.config.openapi.version||"3.1.0",securityType:((V=r.config.openapi.security)==null?void 0:V.type)||"none",apiKeyName:((G=(k=r.config.openapi.security)==null?void 0:k.apiKey)==null?void 0:G.name)||"",apiKeyIn:((ce=(F=r.config.openapi.security)==null?void 0:F.apiKey)==null?void 0:ce.in)||"header",apiKeyValue:((X=(E=r.config.openapi.security)==null?void 0:E.apiKey)==null?void 0:X.value)||"",httpScheme:((ne=(le=r.config.openapi.security)==null?void 0:le.http)==null?void 0:ne.scheme)||"bearer",httpCredentials:((we=(de=r.config.openapi.security)==null?void 0:de.http)==null?void 0:we.credentials)||"",oauth2Token:((re=(ae=r.config.openapi.security)==null?void 0:ae.oauth2)==null?void 0:re.token)||"",openIdConnectUrl:((xe=(ie=r.config.openapi.security)==null?void 0:ie.openIdConnect)==null?void 0:xe.url)||"",openIdConnectToken:((je=(Be=r.config.openapi.security)==null?void 0:Be.openIdConnect)==null?void 0:je.token)||""}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none"}}),[j,v]=w.useState(r&&r.config&&r.config.env?Object.entries(r.config.env).map(([ue,oe])=>({key:ue,value:oe})):[]),[A,N]=w.useState(r&&r.config&&r.config.headers?Object.entries(r.config.headers).map(([ue,oe])=>({key:ue,value:oe})):[]),[O,R]=w.useState(!1),[S,C]=w.useState(null),z=!!r,P=ue=>{const{name:oe,value:pe}=ue.target;y({...h,[oe]:pe})},L=ue=>{const oe=ue.split(" ").filter(pe=>pe.trim()!=="");y({...h,arguments:ue,args:oe})},I=ue=>{g(ue),y(oe=>({...oe,type:ue}))},K=(ue,oe,pe)=>{const Pt=[...j];Pt[ue][oe]=pe,v(Pt)},B=()=>{v([...j,{key:"",value:""}])},Z=ue=>{const oe=[...j];oe.splice(ue,1),v(oe)},te=(ue,oe,pe)=>{const Pt=[...A];Pt[ue][oe]=pe,N(Pt)},D=()=>{N([...A,{key:"",value:""}])},U=ue=>{const oe=[...A];oe.splice(ue,1),N(oe)},se=(ue,oe)=>{y(pe=>({...pe,options:{...pe.options,[ue]:oe}}))},_=async ue=>{var oe,pe,Pt;ue.preventDefault(),C(null);try{const Xt={};j.forEach(({key:kt,value:aa})=>{kt.trim()&&(Xt[kt.trim()]=aa)});const Qt={};A.forEach(({key:kt,value:aa})=>{kt.trim()&&(Qt[kt.trim()]=aa)});const dn={};(oe=h.options)!=null&&oe.timeout&&h.options.timeout!==6e4&&(dn.timeout=h.options.timeout),(pe=h.options)!=null&&pe.resetTimeoutOnProgress&&(dn.resetTimeoutOnProgress=h.options.resetTimeoutOnProgress),(Pt=h.options)!=null&&Pt.maxTotalTimeout&&(dn.maxTotalTimeout=h.options.maxTotalTimeout);const Pl={name:h.name,config:{type:p,...p==="openapi"?{openapi:(()=>{var aa,Mn,Os,Xl,Ft,at;const kt={version:((aa=h.openapi)==null?void 0:aa.version)||"3.1.0"};if(((Mn=h.openapi)==null?void 0:Mn.inputMode)==="url")kt.url=((Os=h.openapi)==null?void 0:Os.url)||"";else if(((Xl=h.openapi)==null?void 0:Xl.inputMode)==="schema"&&((Ft=h.openapi)!=null&&Ft.schema))try{kt.schema=JSON.parse(h.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(at=h.openapi)!=null&&at.securityType&&h.openapi.securityType!=="none"&&(kt.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||""}}}),kt})(),...Object.keys(Qt).length>0?{headers:Qt}:{}}:p==="sse"||p==="streamable-http"?{url:h.url,...Object.keys(Qt).length>0?{headers:Qt}:{}}:{command:h.command,args:h.args,env:Object.keys(Xt).length>0?Xt:void 0},...Object.keys(dn).length>0?{options:dn}:{}}};s(Pl)}catch(Xt){C(`Error: ${Xt instanceof Error?Xt.message:String(Xt)}`)}};return l.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-xl max-h-screen overflow-y-auto",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:c}),l.jsx("button",{onClick:o,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),(S||d)&&l.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:d||S}),l.jsxs("form",{onSubmit:_,children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:f("server.name")}),l.jsx("input",{type:"text",name:"name",id:"name",value:h.name,onChange:P,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:z})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.type")}),l.jsxs("div",{className:"flex space-x-4",children:[l.jsxs("div",{children:[l.jsx("input",{type:"radio",id:"command",name:"serverType",value:"command",checked:p==="stdio",onChange:()=>I("stdio"),className:"mr-1"}),l.jsx("label",{htmlFor:"command",children:"STDIO"})]}),l.jsxs("div",{children:[l.jsx("input",{type:"radio",id:"url",name:"serverType",value:"url",checked:p==="sse",onChange:()=>I("sse"),className:"mr-1"}),l.jsx("label",{htmlFor:"url",children:"SSE"})]}),l.jsxs("div",{children:[l.jsx("input",{type:"radio",id:"streamable-http",name:"serverType",value:"streamable-http",checked:p==="streamable-http",onChange:()=>I("streamable-http"),className:"mr-1"}),l.jsx("label",{htmlFor:"streamable-http",children:"Streamable HTTP"})]}),l.jsxs("div",{children:[l.jsx("input",{type:"radio",id:"openapi",name:"serverType",value:"openapi",checked:p==="openapi",onChange:()=>I("openapi"),className:"mr-1"}),l.jsx("label",{htmlFor:"openapi",children:"OpenAPI"})]})]})]}),p==="openapi"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.openapi.inputMode")}),l.jsxs("div",{className:"flex space-x-4",children:[l.jsxs("div",{children:[l.jsx("input",{type:"radio",id:"input-mode-url",name:"inputMode",value:"url",checked:((De=h.openapi)==null?void 0:De.inputMode)==="url",onChange:()=>y(ue=>({...ue,openapi:{...ue.openapi,inputMode:"url"}})),className:"mr-1"}),l.jsx("label",{htmlFor:"input-mode-url",children:f("server.openapi.inputModeUrl")})]}),l.jsxs("div",{children:[l.jsx("input",{type:"radio",id:"input-mode-schema",name:"inputMode",value:"schema",checked:((Je=h.openapi)==null?void 0:Je.inputMode)==="schema",onChange:()=>y(ue=>({...ue,openapi:{...ue.openapi,inputMode:"schema"}})),className:"mr-1"}),l.jsx("label",{htmlFor:"input-mode-schema",children:f("server.openapi.inputModeSchema")})]})]})]}),((Ct=h.openapi)==null?void 0:Ct.inputMode)==="url"&&l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-url",children:f("server.openapi.specUrl")}),l.jsx("input",{type:"url",name:"openapi-url",id:"openapi-url",value:((ua=h.openapi)==null?void 0:ua.url)||"",onChange:ue=>y(oe=>({...oe,openapi:{...oe.openapi,url:ue.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"&&((rn=h.openapi)==null?void 0:rn.inputMode)==="url"})]}),((Le=h.openapi)==null?void 0:Le.inputMode)==="schema"&&l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-schema",children:f("server.openapi.schema")}),l.jsx("textarea",{name:"openapi-schema",id:"openapi-schema",rows:10,value:((vt=h.openapi)==null?void 0:vt.schema)||"",onChange:ue=>y(oe=>({...oe,openapi:{...oe.openapi,schema:ue.target.value}})),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline font-mono text-sm",placeholder:`{
|
|
188
|
-
"openapi": "3.1.0",
|
|
189
|
-
"info": {
|
|
190
|
-
"title": "API",
|
|
191
|
-
"version": "1.0.0"
|
|
192
|
-
},
|
|
193
|
-
"servers": [
|
|
194
|
-
{
|
|
195
|
-
"url": "https://api.example.com"
|
|
196
|
-
}
|
|
197
|
-
],
|
|
198
|
-
"paths": {
|
|
199
|
-
...
|
|
200
|
-
}
|
|
201
|
-
}`,required:p==="openapi"&&((Oa=h.openapi)==null?void 0:Oa.inputMode)==="schema"}),l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.openapi.schemaHelp")})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.openapi.security")}),l.jsxs("select",{value:((Ma=h.openapi)==null?void 0:Ma.securityType)||"none",onChange:ue=>y(oe=>{var pe;return{...oe,openapi:{...oe.openapi,securityType:ue.target.value,url:((pe=oe.openapi)==null?void 0:pe.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:[l.jsx("option",{value:"none",children:f("server.openapi.securityNone")}),l.jsx("option",{value:"apiKey",children:f("server.openapi.securityApiKey")}),l.jsx("option",{value:"http",children:f("server.openapi.securityHttp")}),l.jsx("option",{value:"oauth2",children:f("server.openapi.securityOAuth2")}),l.jsx("option",{value:"openIdConnect",children:f("server.openapi.securityOpenIdConnect")})]})]}),((da=h.openapi)==null?void 0:da.securityType)==="apiKey"&&l.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.apiKeyConfig")}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyName")}),l.jsx("input",{type:"text",value:((za=h.openapi)==null?void 0:za.apiKeyName)||"",onChange:ue=>y(oe=>{var pe;return{...oe,openapi:{...oe.openapi,apiKeyName:ue.target.value,url:((pe=oe.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm form-input focus:outline-none",placeholder:"Authorization"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyIn")}),l.jsxs("select",{value:((Rs=h.openapi)==null?void 0:Rs.apiKeyIn)||"header",onChange:ue=>y(oe=>{var pe;return{...oe,openapi:{...oe.openapi,apiKeyIn:ue.target.value,url:((pe=oe.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[l.jsx("option",{value:"header",children:"Header"}),l.jsx("option",{value:"query",children:"Query"}),l.jsx("option",{value:"cookie",children:"Cookie"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyValue")}),l.jsx("input",{type:"password",value:((ql=h.openapi)==null?void 0:ql.apiKeyValue)||"",onChange:ue=>y(oe=>{var pe;return{...oe,openapi:{...oe.openapi,apiKeyValue:ue.target.value,url:((pe=oe.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"your-api-key"})]})]})]}),((Gl=h.openapi)==null?void 0:Gl.securityType)==="http"&&l.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.httpAuthConfig")}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.httpScheme")}),l.jsxs("select",{value:((Da=h.openapi)==null?void 0:Da.httpScheme)||"bearer",onChange:ue=>y(oe=>{var pe;return{...oe,openapi:{...oe.openapi,httpScheme:ue.target.value,url:((pe=oe.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[l.jsx("option",{value:"basic",children:"Basic"}),l.jsx("option",{value:"bearer",children:"Bearer"}),l.jsx("option",{value:"digest",children:"Digest"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.httpCredentials")}),l.jsx("input",{type:"password",value:((mt=h.openapi)==null?void 0:mt.httpCredentials)||"",onChange:ue=>y(oe=>{var pe;return{...oe,openapi:{...oe.openapi,httpCredentials:ue.target.value,url:((pe=oe.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:((Yt=h.openapi)==null?void 0:Yt.httpScheme)==="basic"?"base64-encoded-credentials":"bearer-token"})]})]})]}),((ht=h.openapi)==null?void 0:ht.securityType)==="oauth2"&&l.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.oauth2Config")}),l.jsx("div",{className:"grid grid-cols-1 gap-3",children:l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.oauth2Token")}),l.jsx("input",{type:"password",value:(($l=h.openapi)==null?void 0:$l.oauth2Token)||"",onChange:ue=>y(oe=>{var pe;return{...oe,openapi:{...oe.openapi,oauth2Token:ue.target.value,url:((pe=oe.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"access-token"})]})})]}),((Kl=h.openapi)==null?void 0:Kl.securityType)==="openIdConnect"&&l.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.openIdConnectConfig")}),l.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.openIdConnectUrl")}),l.jsx("input",{type:"url",value:((Yl=h.openapi)==null?void 0:Yl.openIdConnectUrl)||"",onChange:ue=>y(oe=>{var pe;return{...oe,openapi:{...oe.openapi,openIdConnectUrl:ue.target.value,url:((pe=oe.openapi)==null?void 0:pe.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"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.openIdConnectToken")}),l.jsx("input",{type:"password",value:((on=h.openapi)==null?void 0:on.openIdConnectToken)||"",onChange:ue=>y(oe=>{var pe;return{...oe,openapi:{...oe.openapi,openIdConnectToken:ue.target.value,url:((pe=oe.openapi)==null?void 0:pe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"id-token"})]})]})]}),l.jsxs("div",{className:"mb-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-2",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.headers")}),l.jsx("button",{type:"button",onClick:D,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((ue,oe)=>l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[l.jsx("input",{type:"text",value:ue.key,onChange:pe=>te(oe,"key",pe.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"}),l.jsx("span",{className:"flex items-center",children:":"}),l.jsx("input",{type:"text",value:ue.value,onChange:pe=>te(oe,"value",pe.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..."})]}),l.jsx("button",{type:"button",onClick:()=>U(oe),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:"-"})]},oe))]})]}):p==="sse"||p==="streamable-http"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"url",children:f("server.url")}),l.jsx("input",{type:"url",name:"url",id:"url",value:h.url,onChange:P,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"})]}),l.jsxs("div",{className:"mb-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-2",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.headers")}),l.jsx("button",{type:"button",onClick:D,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((ue,oe)=>l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[l.jsx("input",{type:"text",value:ue.key,onChange:pe=>te(oe,"key",pe.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"}),l.jsx("span",{className:"flex items-center",children:":"}),l.jsx("input",{type:"text",value:ue.value,onChange:pe=>te(oe,"value",pe.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..."})]}),l.jsx("button",{type:"button",onClick:()=>U(oe),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:"-"})]},oe))]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"command",children:f("server.command")}),l.jsx("input",{type:"text",name:"command",id:"command",value:h.command,onChange:P,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"})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"arguments",children:f("server.arguments")}),l.jsx("input",{type:"text",name:"arguments",id:"arguments",value:h.arguments,onChange:ue=>L(ue.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"})]}),l.jsxs("div",{className:"mb-4",children:[l.jsxs("div",{className:"flex justify-between items-center mb-2",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.envVars")}),l.jsx("button",{type:"button",onClick:B,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),j.map((ue,oe)=>l.jsxs("div",{className:"flex items-center mb-2",children:[l.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[l.jsx("input",{type:"text",value:ue.key,onChange:pe=>K(oe,"key",pe.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")}),l.jsx("span",{className:"flex items-center",children:":"}),l.jsx("input",{type:"text",value:ue.value,onChange:pe=>K(oe,"value",pe.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")})]}),l.jsx("button",{type:"button",onClick:()=>Z(oe),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:"-"})]},oe))]})]}),p!=="openapi"&&l.jsxs("div",{className:"mb-4",children:[l.jsxs("div",{className:"flex items-center justify-between cursor-pointer bg-gray-50 hover:bg-gray-100 p-3 rounded border border-gray-200",onClick:()=>R(!O),children:[l.jsx("label",{className:"text-gray-700 text-sm font-bold",children:f("server.requestOptions")}),l.jsx("span",{className:"text-gray-500 text-sm",children:O?"▼":"▶"})]}),O&&l.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"timeout",children:f("server.timeout")}),l.jsx("input",{type:"number",id:"timeout",value:((cn=h.options)==null?void 0:cn.timeout)||6e4,onChange:ue=>se("timeout",parseInt(ue.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"}),l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.timeoutDescription")})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"maxTotalTimeout",children:f("server.maxTotalTimeout")}),l.jsx("input",{type:"number",id:"maxTotalTimeout",value:((ta=h.options)==null?void 0:ta.maxTotalTimeout)||"",onChange:ue=>se("maxTotalTimeout",ue.target.value?parseInt(ue.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"}),l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.maxTotalTimeoutDescription")})]})]}),l.jsxs("div",{className:"mt-3",children:[l.jsxs("label",{className:"flex items-center",children:[l.jsx("input",{type:"checkbox",checked:((un=h.options)==null?void 0:un.resetTimeoutOnProgress)||!1,onChange:ue=>se("resetTimeoutOnProgress",ue.target.checked),className:"mr-2"}),l.jsx("span",{className:"text-gray-600 text-sm",children:f("server.resetTimeoutOnProgress")})]}),l.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:f("server.resetTimeoutOnProgressDescription")})]})]})]}),l.jsxs("div",{className:"flex justify-end mt-6",children:[l.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")}),l.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(z?"server.save":"server.add")})]})]})]})},Hg=s=>{const o=new Set,r=/\$\{([^}]+)\}/g,c=f=>{let m;for(;(m=r.exec(f))!==null;)o.add(m[1])},d=(f,m="")=>{typeof f=="string"?c(f):Array.isArray(f)?f.forEach((p,g)=>d(p,`${m}[${g}]`)):f&&typeof f=="object"&&Object.entries(f).forEach(([p,g])=>{d(g,m?`${m}.${p}`:p)})};return d(s),Array.from(o)},f1=({onAdd:s})=>{const{t:o}=ke(),[r,c]=w.useState(!1),[d,f]=w.useState(null),[m,p]=w.useState(!1),[g,h]=w.useState(null),[y,j]=w.useState([]),v=()=>{c(!r),f(null),p(!1),h(null)},A=async()=>{g&&(await N(g),p(!1),h(null))},N=async R=>{try{f(null);const S=localStorage.getItem("mcphub_token"),C=await fetch(Ne("/servers"),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":S||""},body:JSON.stringify(R)}),z=await C.json();if(!C.ok){z&&z.message?f(z.message):C.status===400?f(o("server.invalidData")):C.status===409?f(o("server.alreadyExists",{serverName:R.name})):f(o("server.addError"));return}c(!1),s()}catch(S){console.error("Error adding server:",S),navigator.onLine?S instanceof TypeError&&(S.message.includes("NetworkError")||S.message.includes("Failed to fetch"))?f(o("errors.serverConnection")):f(o("errors.serverAdd")):f(o("errors.network"))}},O=async R=>{try{const S=Hg(R);S.length>0?(j(S),h(R),p(!0)):await N(R)}catch(S){console.error("Error processing server submission:",S),f(o("errors.serverAdd"))}};return l.jsxs("div",{children:[l.jsxs("button",{onClick:v,className:"w-full bg-blue-100 text-blue-800 rounded hover:bg-blue-200 py-2 px-4 flex items-center justify-center btn-primary",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:l.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")]}),r&&l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsx(fu,{onSubmit:O,onCancel:v,modalTitle:o("server.addServer"),formError:d})}),m&&l.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:l.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:o("server.confirmVariables")}),l.jsx("p",{className:"text-gray-600 mb-4",children:o("server.variablesDetected")}),l.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"ml-3",children:[l.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[o("server.detectedVariables"),":"]}),l.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:y.map((R,S)=>l.jsxs("li",{className:"font-mono",children:["$",`{${R}}`]},S))})]})]})}),l.jsx("p",{className:"text-gray-600 text-sm mb-6",children:o("server.confirmVariablesMessage")}),l.jsxs("div",{className:"flex justify-end space-x-3",children:[l.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")}),l.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")})]})]})})]})},m1=({server:s,onEdit:o,onCancel:r})=>{const{t:c}=ke(),[d,f]=w.useState(null),m=async p=>{try{f(null);const g=localStorage.getItem("mcphub_token"),h=await fetch(Ne(`/servers/${s.name}`),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":g||""},body:JSON.stringify(p)}),y=await h.json();if(!h.ok){y&&y.message?f(y.message):h.status===404?f(c("server.notFound",{serverName:s.name})):h.status===400?f(c("server.invalidData")):f(c("server.updateError",{serverName:s.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(c("errors.serverConnection")):f(c("errors.serverUpdate",{serverName:s.name})):f(c("errors.network"))}};return l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsx(fu,{onSubmit:m,onCancel:r,initialData:s,modalTitle:c("server.editTitle",{serverName:s.name}),formError:d})})},h1=({isOpen:s,onClose:o,onConfirm:r,title:c,message:d,confirmText:f,cancelText:m,variant:p="warning"})=>{const{t:g}=ke();if(!s)return null;const h=()=>{switch(p){case"danger":return{icon:l.jsx("svg",{className:"w-6 h-6 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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:l.jsx("svg",{className:"w-6 h-6 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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:l.jsx("svg",{className:"w-6 h-6 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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:j}=h(),v=N=>{N.target===N.currentTarget&&o()},A=N=>{N.key==="Escape"?o():N.key==="Enter"&&r()};return l.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:v,onKeyDown:A,tabIndex:-1,children:l.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:l.jsxs("div",{className:"p-6",children:[l.jsxs("div",{className:"flex items-start space-x-3",children:[y&&l.jsx("div",{className:"flex-shrink-0",children:y}),l.jsxs("div",{className:"flex-1",children:[c&&l.jsx("h3",{id:"confirm-dialog-title",className:"text-lg font-medium text-gray-900 mb-2",children:c}),l.jsx("p",{id:"confirm-dialog-message",className:"text-gray-600 leading-relaxed",children:d})]})]}),l.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[l.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")}),l.jsx("button",{onClick:r,className:`px-4 py-2 rounded-md transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-offset-2 ${j} ${p==="danger"?"btn-danger":p==="warning"?"btn-warning":"btn-primary"}`,children:f||g("common.confirm")})]})]})})})},g1=({onSuccess:s,onCancel:o})=>{const{t:r}=ke(),[c,d]=w.useState(!1),[f,m]=w.useState(!1),[p,g]=w.useState(null),[h,y]=w.useState(null),[j,v]=w.useState(!1),[A,N]=w.useState(null),[O,R]=w.useState(""),[S,C]=w.useState(!1),[z,P]=w.useState(""),L=_=>{_.preventDefault(),d(!0)},I=_=>{_.preventDefault(),d(!1)},K=_=>{_.preventDefault(),d(!1);const V=_.dataTransfer.files;if(V.length>0){const k=V[0];k.name.endsWith(".dxt")?(y(k),g(null)):g(r("dxt.invalidFileType"))}},B=_=>{const V=_.target.files;if(V&&V.length>0){const k=V[0];k.name.endsWith(".dxt")?(y(k),g(null)):g(r("dxt.invalidFileType"))}},Z=async()=>{if(!h){g(r("dxt.noFileSelected"));return}m(!0),g(null);try{const _=new FormData;_.append("dxtFile",h);const V=localStorage.getItem("mcphub_token"),k=await fetch(Ne("/dxt/upload"),{method:"POST",headers:{"x-auth-token":V||""},body:_}),G=await k.json();if(!k.ok)throw new Error(G.message||`HTTP error! Status: ${k.status}`);if(G.success&&G.data)N(G.data.manifest),R(G.data.extractDir),v(!0);else throw new Error(G.message||r("dxt.uploadFailed"))}catch(_){console.error("DXT upload error:",_),g(_ instanceof Error?_.message:r("dxt.uploadFailed"))}finally{m(!1)}},te=async(_,V=!1)=>{var k;m(!0),g(null);try{const G=se(A,O,_),F=localStorage.getItem("mcphub_token");if(!V){const ne=await fetch(Ne("/servers"),{method:"GET",headers:{"x-auth-token":F||""}});if(ne.ok&&((k=(await ne.json()).data)==null?void 0:k.find(ae=>ae.name===_))){P(_),C(!0),m(!1);return}}const ce=V?"PUT":"POST",E=Ne(V?`/servers/${encodeURIComponent(_)}`:"/servers"),X=await fetch(E,{method:ce,headers:{"Content-Type":"application/json","x-auth-token":F||""},body:JSON.stringify({name:_,config:G})}),le=await X.json();if(!X.ok)throw new Error(le.message||`HTTP error! Status: ${X.status}`);if(le.success)s(G);else throw new Error(le.message||r("dxt.installFailed"))}catch(G){console.error("DXT install error:",G),g(G instanceof Error?G.message:r("dxt.installFailed")),m(!1)}},D=()=>{C(!1),z&&te(z,!0)},U=()=>{C(!1),P(""),m(!1)},se=(_,V,k)=>{var ce;const G=((ce=_.server)==null?void 0:ce.mcp_config)||{},F={type:"stdio",command:G.command||"node",args:(G.args||[]).map(E=>E.replace("${__dirname}",V))};return G.env&&Object.keys(G.env).length>0&&(F.env={...G.env},Object.keys(F.env).forEach(E=>{typeof F.env[E]=="string"&&(F.env[E]=F.env[E].replace("${__dirname}",V))})),F};return j&&A?l.jsxs(l.Fragment,{children:[l.jsx(h1,{isOpen:S,onClose:U,onConfirm:D,title:r("dxt.serverExistsTitle"),message:r("dxt.serverExistsConfirm",{serverName:z}),confirmText:r("dxt.override"),cancelText:r("common.cancel"),variant:"warning"}),l.jsx("div",{className:`fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4 ${S?"opacity-50 pointer-events-none":""}`,children:l.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-2xl max-h-screen overflow-y-auto",children:[l.jsxs("div",{className:"flex justify-between items-center mb-6",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:r("dxt.installServer")}),l.jsx("button",{onClick:o,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),p&&l.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:l.jsx("p",{className:"text-red-700",children:p})}),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[l.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:r("dxt.extensionInfo")}),l.jsxs("div",{className:"space-y-2 text-sm",children:[l.jsxs("div",{children:[l.jsxs("strong",{children:[r("dxt.name"),":"]})," ",A.display_name||A.name]}),l.jsxs("div",{children:[l.jsxs("strong",{children:[r("dxt.version"),":"]})," ",A.version]}),l.jsxs("div",{children:[l.jsxs("strong",{children:[r("dxt.description"),":"]})," ",A.description]}),A.author&&l.jsxs("div",{children:[l.jsxs("strong",{children:[r("dxt.author"),":"]})," ",A.author.name]}),A.tools&&A.tools.length>0&&l.jsxs("div",{children:[l.jsxs("strong",{children:[r("dxt.tools"),":"]}),l.jsx("ul",{className:"list-disc list-inside ml-4",children:A.tools.map((_,V)=>l.jsxs("li",{children:[_.name," - ",_.description]},V))})]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:r("dxt.serverName")}),l.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:r("dxt.serverNamePlaceholder")})]}),l.jsxs("div",{className:"flex justify-end space-x-4",children:[l.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:r("common.cancel")}),l.jsx("button",{onClick:()=>{const _=document.getElementById("serverName"),V=(_==null?void 0:_.value.trim())||A.name;te(V)},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?l.jsxs(l.Fragment,{children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r("dxt.installing")]}):r("dxt.install")})]})]})]})})]}):l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-lg",children:[l.jsxs("div",{className:"flex justify-between items-center mb-6",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:r("dxt.uploadTitle")}),l.jsx("button",{onClick:o,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),p&&l.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:l.jsx("p",{className:"text-red-700",children:p})}),l.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-8 text-center transition-colors ${c?"border-blue-500 bg-blue-50":h?"border-gray-500 ":"border-gray-300 hover:border-gray-400"}`,onDragOver:L,onDragLeave:I,onDrop:K,children:[h?l.jsxs("div",{className:"space-y-2",children:[l.jsx("svg",{className:"mx-auto h-12 w-12 text-green-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})}),l.jsx("p",{className:"text-sm text-gray-900 font-medium",children:h.name}),l.jsxs("p",{className:"text-xs text-gray-500",children:[(h.size/1024/1024).toFixed(2)," MB"]})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-gray-900",children:r("dxt.dropFileHere")}),l.jsx("p",{className:"text-xs text-gray-500",children:r("dxt.orClickToSelect")})]})]}),l.jsx("input",{type:"file",accept:".dxt",onChange:B,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"})]}),l.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[l.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:r("common.cancel")}),l.jsx("button",{onClick:Z,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?l.jsxs(l.Fragment,{children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r("dxt.uploading")]}):r("dxt.upload")})]})]})})},p1=()=>{const{t:s}=ke(),o=On(),{servers:r,error:c,setError:d,isLoading:f,handleServerAdd:m,handleServerEdit:p,handleServerRemove:g,handleServerToggle:h,triggerRefresh:y}=Vl(),[j,v]=w.useState(null),[A,N]=w.useState(!1),[O,R]=w.useState(!1),S=async L=>{const I=await p(L);I&&v(I)},C=()=>{v(null),y()},z=async()=>{N(!0);try{y(),await new Promise(L=>setTimeout(L,500))}finally{N(!1)}},P=L=>{R(!1),y()};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between items-center mb-8",children:[l.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.servers.title")}),l.jsxs("div",{className:"flex space-x-4",children:[l.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:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3z"})}),s("nav.market")]}),l.jsx(f1,{onAdd:m}),l.jsxs("button",{onClick:()=>R(!0),className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{d:"M5.5 13a3.5 3.5 0 01-.369-6.98 4 4 0 117.753-1.977A4.5 4.5 0 1113.5 13H11V9.413l1.293 1.293a1 1 0 001.414-1.414l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.413V13H5.5z"})}),s("dxt.upload")]}),l.jsxs("button",{onClick:z,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?l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"})}),s("common.refresh")]})]})]}),c&&l.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-red-600 text-lg font-medium",children:s("app.error")}),l.jsx("p",{className:"text-gray-600 mt-1",children:c})]}),l.jsx("button",{onClick:()=>d(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200 btn-secondary","aria-label":s("app.closeButton"),children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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?l.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:l.jsxs("div",{className:"flex flex-col items-center",children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):r.length===0?l.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:l.jsx("p",{className:"text-gray-600",children:s("app.noServers")})}):l.jsx("div",{className:"space-y-6",children:r.map((L,I)=>l.jsx(d1,{server:L,onRemove:g,onEdit:S,onToggle:h,onRefresh:y},I))}),j&&l.jsx(m1,{server:j,onEdit:C,onCancel:()=>v(null)}),O&&l.jsx(g1,{onSuccess:P,onCancel:()=>R(!1)})]})},mu=()=>{const{t:s}=ke(),[o,r]=w.useState([]),[c,d]=w.useState(!0),[f,m]=w.useState(null),[p,g]=w.useState(0),h=w.useCallback(async()=>{try{d(!0);const S=localStorage.getItem("mcphub_token"),C=await fetch(Ne("/groups"),{headers:{"x-auth-token":S||""}});if(!C.ok)throw new Error(`Status: ${C.status}`);const z=await C.json();z&&z.success&&Array.isArray(z.data)?r(z.data):(console.error("Invalid group data format:",z),r([])),m(null)}catch(S){console.error("Error fetching groups:",S),m(S instanceof Error?S.message:"Failed to fetch groups"),r([])}finally{d(!1)}},[]),y=w.useCallback(()=>{g(S=>S+1)},[]),j=async(S,C,z=[])=>{try{const P=localStorage.getItem("mcphub_token"),L=await fetch(Ne("/groups"),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":P||""},body:JSON.stringify({name:S,description:C,servers:z})}),I=await L.json();return L.ok?(y(),I.data||null):(m(I.message||s("groups.createError")),null)}catch(P){return m(P instanceof Error?P.message:"Failed to create group"),null}},v=async(S,C)=>{try{const z=localStorage.getItem("mcphub_token"),P=await fetch(Ne(`/groups/${S}`),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":z||""},body:JSON.stringify(C)}),L=await P.json();return P.ok?(y(),L.data||null):(m(L.message||s("groups.updateError")),null)}catch(z){return m(z instanceof Error?z.message:"Failed to update group"),null}},A=async(S,C)=>{try{const z=localStorage.getItem("mcphub_token"),P=await fetch(Ne(`/groups/${S}/servers/batch`),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":z||""},body:JSON.stringify({servers:C})}),L=await P.json();return P.ok?(y(),L.data||null):(m(L.message||s("groups.updateError")),null)}catch(z){return m(z instanceof Error?z.message:"Failed to update group servers"),null}},N=async S=>{try{const C=localStorage.getItem("mcphub_token"),z=await fetch(Ne(`/groups/${S}`),{method:"DELETE",headers:{"x-auth-token":C||""}}),P=await z.json();return z.ok?(y(),!0):(m(P.message||s("groups.deleteError")),!1)}catch(C){return m(C instanceof Error?C.message:"Failed to delete group"),!1}},O=async(S,C)=>{try{const z=localStorage.getItem("mcphub_token"),P=await fetch(Ne(`/groups/${S}/servers`),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":z||""},body:JSON.stringify({serverName:C})}),L=await P.json();return P.ok?(y(),L.data||null):(m(L.message||s("groups.serverAddError")),null)}catch(z){return m(z instanceof Error?z.message:"Failed to add server to group"),null}},R=async(S,C)=>{try{const z=localStorage.getItem("mcphub_token"),P=await fetch(Ne(`/groups/${S}/servers/${C}`),{method:"DELETE",headers:{"x-auth-token":z||""}}),L=await P.json();return P.ok?(y(),L.data||null):(m(L.message||s("groups.serverRemoveError")),null)}catch(z){return m(z instanceof Error?z.message:"Failed to remove server from group"),null}};return w.useEffect(()=>{h()},[h,p]),{groups:o,loading:c,error:f,setError:m,triggerRefresh:y,createGroup:j,updateGroup:v,updateGroupServers:A,deleteGroup:N,addServerToGroup:O,removeServerFromGroup:R}},Bg=({servers:s,value:o,onChange:r,className:c})=>{const{t:d}=ke(),[f,m]=w.useState(new Set),p=Ns.useMemo(()=>o.map(S=>typeof S=="string"?{name:S,tools:"all"}:{...S,tools:S.tools||"all"}),[o]),g=Ns.useMemo(()=>s.filter(S=>S.enabled!==!1),[s]);Ns.useEffect(()=>{const S=new Set(p.map(z=>z.name)),C=new Set(g.map(z=>z.name));m(z=>{const P=new Set;return z.forEach(L=>{(S.has(L)||C.has(L))&&P.add(L)}),P})},[p,g]);const h=S=>{if(p.findIndex(z=>z.name===S)>=0){const z=p.filter(P=>P.name!==S);r(z)}else{const z=[...p,{name:S,tools:"all"}];r(z)}},y=S=>{m(C=>{const z=new Set(C);return z.has(S)?z.delete(S):z.add(S),z})},j=(S,C,z=!1)=>{if(Array.isArray(C)&&C.length===0){const P=p.filter(L=>L.name!==S);r(P),z||m(L=>{const I=new Set(L);return I.delete(S),I})}else if(p.findIndex(L=>L.name===S)>=0){const L=p.map(I=>I.name===S?{...I,tools:C}:I);r(L)}else{const L=[...p,{name:S,tools:C}];r(L)}},v=(S,C)=>{var I;const z=g.find(K=>K.name===S);if(!z)return;const P=((I=z.tools)==null?void 0:I.map(K=>K.name.replace(`${S}-`,"")))||[],L=p.find(K=>K.name===S);if(!L){const K=[...p,{name:S,tools:[C]}];r(K);return}if(L.tools==="all"){const K=P.filter(B=>B!==C);j(S,K)}else if(Array.isArray(L.tools)){const K=L.tools;if(K.includes(C)){const B=K.filter(Z=>Z!==C);j(S,B)}else{const B=[...K,C];B.length===P.length?j(S,"all"):j(S,B)}}},A=S=>{const C=p.find(z=>z.name===S);return C?C.tools==="all":!1},N=S=>{const C=p.find(z=>z.name===S);return C?Array.isArray(C.tools)&&C.tools.length>0:!1},O=(S,C)=>{const z=p.find(P=>P.name===S);return z?z.tools==="all"?!0:Array.isArray(z.tools)?z.tools.includes(C):!1:!1},R=S=>{const C=g.find(z=>z.name===S);return(C==null?void 0:C.tools)||[]};return l.jsxs("div",{className:Aa("space-y-4",c),children:[l.jsx("div",{className:"space-y-3",children:g.map(S=>{const C=A(S.name),z=N(S.name),P=f.has(S.name),L=R(S.name),I=p.find(K=>K.name===S.name);return l.jsxs("div",{className:"border border-gray-200 rounded-lg hover:border-gray-300 hover:bg-gray-50 transition-colors",children:[l.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer rounded-lg transition-colors",onClick:()=>y(S.name),children:[l.jsxs("div",{className:"flex items-center space-x-3",onClick:K=>{K.stopPropagation(),h(S.name)},children:[l.jsx("input",{type:"checkbox",checked:C||z,onChange:()=>h(S.name),className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),l.jsx("span",{className:"font-medium text-gray-900 cursor-pointer select-none",children:S.name})]}),l.jsxs("div",{className:"flex items-center space-x-3",children:[I&&I.tools!=="all"&&Array.isArray(I.tools)&&l.jsxs("span",{className:"text-sm text-green-600",children:["(",d("groups.toolsSelected")," ",I.tools.length,"/",L.length,")"]}),I&&I.tools==="all"&&l.jsxs("span",{className:"text-sm text-green-600",children:["(",d("groups.allTools")," ",L.length,"/",L.length,")"]}),L.length>0&&l.jsx("button",{type:"button",className:"p-1 text-gray-400 hover:text-gray-600 transition-colors",children:l.jsx("svg",{className:Aa("w-5 h-5 transition-transform",P&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),P&&L.length>0&&l.jsxs("div",{className:"border-t border-gray-200 bg-gray-50 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-sm font-medium text-gray-700",children:d("groups.toolSelection")}),l.jsx("button",{type:"button",onClick:()=>{(I==null?void 0:I.tools)==="all"||Array.isArray(I==null?void 0:I.tools)&&I.tools.length===L.length?j(S.name,[],!0):j(S.name,"all")},className:"text-sm text-blue-600 hover:text-blue-800 transition-colors",children:(I==null?void 0:I.tools)==="all"||Array.isArray(I==null?void 0:I.tools)&&I.tools.length===L.length?d("groups.selectNone"):d("groups.selectAll")})]}),l.jsx("div",{className:"grid grid-cols-1 gap-2 max-h-32 overflow-y-auto",children:L.map(K=>{const B=K.name.replace(`${S.name}-`,""),Z=O(S.name,B);return l.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[l.jsx("input",{type:"checkbox",checked:Z,onChange:()=>v(S.name,B),className:"w-3 h-3 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),l.jsx("span",{className:"text-gray-700",children:B}),K.description&&l.jsx("span",{className:"text-gray-400 text-xs truncate",children:K.description})]},K.name)})})]})]},S.name)})}),g.length===0&&l.jsx("p",{className:"text-gray-500 text-sm",children:d("groups.noServerOptions")})]})},x1=({onAdd:s,onCancel:o})=>{const{t:r}=ke(),{createGroup:c}=mu(),{servers:d}=Vl(),[f,m]=w.useState([]),[p,g]=w.useState(null),[h,y]=w.useState(!1),[j,v]=w.useState({name:"",description:"",servers:[]});w.useEffect(()=>{m(d.filter(O=>O.enabled!==!1))},[d]);const A=O=>{const{name:R,value:S}=O.target;v(C=>({...C,[R]:S}))},N=async O=>{O.preventDefault(),y(!0),g(null);try{if(!j.name.trim()){g(r("groups.nameRequired")),y(!1);return}if(!await c(j.name,j.description,j.servers)){g(r("groups.createError")),y(!1);return}s()}catch(R){g(R instanceof Error?R.message:String(R)),y(!1)}};return l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full max-h-[90vh] flex flex-col",children:[l.jsxs("div",{className:"p-6 flex-shrink-0",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:r("groups.addNew")}),p&&l.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:p})]}),l.jsxs("form",{onSubmit:N,className:"flex flex-col flex-1 min-h-0",children:[l.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[r("groups.name")," *"]}),l.jsx("input",{type:"text",id:"name",name:"name",value:j.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:r("groups.namePlaceholder"),required:!0})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:r("groups.configureTools")}),l.jsx(Bg,{servers:f,value:j.servers,onChange:O=>v(R=>({...R,servers:O})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),l.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[l.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:r("common.cancel")}),l.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:r(h?"common.submitting":"common.create")})]})]})]})})},y1=({group:s,onEdit:o,onCancel:r})=>{const{t:c}=ke(),{updateGroup:d}=mu(),{servers:f}=Vl(),[m,p]=w.useState([]),[g,h]=w.useState(null),[y,j]=w.useState(!1),[v,A]=w.useState({name:s.name,description:s.description||"",servers:s.servers||[]});w.useEffect(()=>{p(f.filter(R=>R.enabled!==!1))},[f]);const N=R=>{const{name:S,value:C}=R.target;A(z=>({...z,[S]:C}))},O=async R=>{R.preventDefault(),j(!0),h(null);try{if(!v.name.trim()){h(c("groups.nameRequired")),j(!1);return}if(!await d(s.id,{name:v.name,description:v.description,servers:v.servers})){h(c("groups.updateError")),j(!1);return}o()}catch(S){h(S instanceof Error?S.message:String(S)),j(!1)}};return l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full max-h-[90vh] flex flex-col",children:[l.jsxs("div",{className:"p-6 flex-shrink-0",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:c("groups.edit")}),g&&l.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:g})]}),l.jsxs("form",{onSubmit:O,className:"flex flex-col flex-1 min-h-0",children:[l.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[c("groups.name")," *"]}),l.jsx("input",{type:"text",id:"name",name:"name",value:v.name,onChange:N,className:"w-full border border-gray-300 rounded-md px-3 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:c("groups.namePlaceholder"),required:!0})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:c("groups.configureTools")}),l.jsx(Bg,{servers:m,value:v.servers,onChange:R=>A(S=>({...S,servers:R})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),l.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[l.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 text-gray-600 hover:text-gray-800 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors",disabled:y,children:c("common.cancel")}),l.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 transition-colors",disabled:y,children:c(y?"common.submitting":"common.save")})]})]})]})})},Vg=()=>{const{t:s}=ke(),{showToast:o}=Bl(),[r,c]=w.useState({enableGlobalRoute:!0,enableGroupNameRoute:!0,enableBearerAuth:!1,bearerAuthKey:"",skipAuth:!1}),[d,f]=w.useState({bearerAuthKey:""}),[m,p]=w.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[g,h]=w.useState({enabled:!1,dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[y,j]=w.useState(!1),[v,A]=w.useState(null),[N,O]=w.useState(0),R=w.useCallback(()=>{O(K=>K+1)},[]),S=w.useCallback(async()=>{var K,B,Z,te,D,U;j(!0),A(null);try{const se=localStorage.getItem("mcphub_token"),_=await fetch(Ne("/settings"),{headers:{"x-auth-token":se||""}});if(!_.ok)throw new Error(`HTTP error! Status: ${_.status}`);const V=await _.json();V.success&&((B=(K=V.data)==null?void 0:K.systemConfig)!=null&&B.routing)&&c({enableGlobalRoute:V.data.systemConfig.routing.enableGlobalRoute??!0,enableGroupNameRoute:V.data.systemConfig.routing.enableGroupNameRoute??!0,enableBearerAuth:V.data.systemConfig.routing.enableBearerAuth??!1,bearerAuthKey:V.data.systemConfig.routing.bearerAuthKey||"",skipAuth:V.data.systemConfig.routing.skipAuth??!1}),V.success&&((te=(Z=V.data)==null?void 0:Z.systemConfig)!=null&&te.install)&&p({pythonIndexUrl:V.data.systemConfig.install.pythonIndexUrl||"",npmRegistry:V.data.systemConfig.install.npmRegistry||"",baseUrl:V.data.systemConfig.install.baseUrl||"http://localhost:3000"}),V.success&&((U=(D=V.data)==null?void 0:D.systemConfig)!=null&&U.smartRouting)&&h({enabled:V.data.systemConfig.smartRouting.enabled??!1,dbUrl:V.data.systemConfig.smartRouting.dbUrl||"",openaiApiBaseUrl:V.data.systemConfig.smartRouting.openaiApiBaseUrl||"",openaiApiKey:V.data.systemConfig.smartRouting.openaiApiKey||"",openaiApiEmbeddingModel:V.data.systemConfig.smartRouting.openaiApiEmbeddingModel||""})}catch(se){console.error("Failed to fetch settings:",se),A(se instanceof Error?se.message:"Failed to fetch settings"),o(s("errors.failedToFetchSettings"))}finally{j(!1)}},[s]),C=async(K,B)=>{j(!0),A(null);try{const Z=localStorage.getItem("mcphub_token"),te=await fetch(Ne("/system-config"),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":Z||""},body:JSON.stringify({routing:{[K]:B}})});if(!te.ok)throw new Error(`HTTP error! Status: ${te.status}`);return(await te.json()).success?(c({...r,[K]:B}),o(s("settings.systemConfigUpdated")),!0):(o(s("errors.failedToUpdateRouteConfig")),!1)}catch(Z){return console.error("Failed to update routing config:",Z),A(Z instanceof Error?Z.message:"Failed to update routing config"),o(s("errors.failedToUpdateRouteConfig")),!1}finally{j(!1)}},z=async(K,B)=>{j(!0),A(null);try{const Z=localStorage.getItem("mcphub_token"),te=await fetch(Ne("/system-config"),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":Z||""},body:JSON.stringify({install:{[K]:B}})});if(!te.ok)throw new Error(`HTTP error! Status: ${te.status}`);return(await te.json()).success?(p({...m,[K]:B}),o(s("settings.systemConfigUpdated")),!0):(o(s("errors.failedToUpdateSystemConfig")),!1)}catch(Z){return console.error("Failed to update system config:",Z),A(Z instanceof Error?Z.message:"Failed to update system config"),o(s("errors.failedToUpdateSystemConfig")),!1}finally{j(!1)}},P=async(K,B)=>{j(!0),A(null);try{const Z=localStorage.getItem("mcphub_token"),te=await fetch(Ne("/system-config"),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":Z||""},body:JSON.stringify({smartRouting:{[K]:B}})});if(!te.ok){const U=await te.json();throw new Error(U.message||`HTTP error! Status: ${te.status}`)}const D=await te.json();return D.success?(h({...g,[K]:B}),o(s("settings.systemConfigUpdated")),!0):(o(D.message||s("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(Z){console.error("Failed to update smart routing config:",Z);const te=Z instanceof Error?Z.message:"Failed to update smart routing config";return A(te),o(te),!1}finally{j(!1)}},L=async K=>{j(!0),A(null);try{const B=localStorage.getItem("mcphub_token"),Z=await fetch(Ne("/system-config"),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":B||""},body:JSON.stringify({smartRouting:K})});if(!Z.ok){const D=await Z.json();throw new Error(D.message||`HTTP error! Status: ${Z.status}`)}const te=await Z.json();return te.success?(h({...g,...K}),o(s("settings.systemConfigUpdated")),!0):(o(te.message||s("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(B){console.error("Failed to update smart routing config:",B);const Z=B instanceof Error?B.message:"Failed to update smart routing config";return A(Z),o(Z),!1}finally{j(!1)}},I=async K=>{j(!0),A(null);try{const B=localStorage.getItem("mcphub_token"),Z=await fetch(Ne("/system-config"),{method:"PUT",headers:{"Content-Type":"application/json","x-auth-token":B||""},body:JSON.stringify({routing:K})});if(!Z.ok)throw new Error(`HTTP error! Status: ${Z.status}`);return(await Z.json()).success?(c({...r,...K}),o(s("settings.systemConfigUpdated")),!0):(o(s("errors.failedToUpdateRouteConfig")),!1)}catch(B){return console.error("Failed to update routing config:",B),A(B instanceof Error?B.message:"Failed to update routing config"),o(s("errors.failedToUpdateRouteConfig")),!1}finally{j(!1)}};return w.useEffect(()=>{S()},[S,N]),w.useEffect(()=>{r&&f({bearerAuthKey:r.bearerAuthKey})},[r]),{routingConfig:r,tempRoutingConfig:d,setTempRoutingConfig:f,installConfig:m,smartRoutingConfig:g,loading:y,error:v,setError:A,triggerRefresh:R,fetchSettings:S,updateRoutingConfig:C,updateInstallConfig:z,updateSmartRoutingConfig:P,updateSmartRoutingConfigBatch:L,updateRoutingConfigBatch:I}},b1=({group:s,servers:o,onEdit:r,onDelete:c})=>{const{t:d}=ke(),{showToast:f}=Bl(),{installConfig:m}=Vg(),[p,g]=w.useState(!1),[h,y]=w.useState(!1),[j,v]=w.useState(!1),[A,N]=w.useState(null),O=w.useRef(null);w.useEffect(()=>{const D=U=>{O.current&&!O.current.contains(U.target)&&v(!1)};return document.addEventListener("mousedown",D),()=>{document.removeEventListener("mousedown",D)}},[]);const R=()=>{r(s)},S=()=>{g(!0)},C=()=>{c(s.id),g(!1)},z=D=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(D).then(()=>{y(!0),v(!1),f(d("common.copySuccess"),"success"),setTimeout(()=>y(!1),2e3)});else{const U=document.createElement("textarea");U.value=D,U.style.position="fixed",U.style.left="-9999px",document.body.appendChild(U),U.focus(),U.select();try{document.execCommand("copy"),y(!0),v(!1),f(d("common.copySuccess"),"success"),setTimeout(()=>y(!1),2e3)}catch(se){f(d("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",se)}document.body.removeChild(U)}},P=()=>{z(s.id)},L=()=>{z(`${m.baseUrl}/mcp/${s.id}`)},I=()=>{const D={mcpServers:{mcphub:{url:`${m.baseUrl}/mcp/${s.id}`,headers:{Authorization:"Bearer <your-access-token>"}}}};z(JSON.stringify(D,null,2))},K=D=>D.map(U=>typeof U=="string"?U:U.name),B=D=>{const U=s.servers.find(se=>typeof se=="string"?se===D:se.name===D);return typeof U=="string"?{name:U,tools:"all"}:U},Z=K(s.servers),te=o.filter(D=>Z.includes(D.name));return l.jsxs("div",{className:"bg-white shadow rounded-lg p-6 ",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center",children:[l.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:s.name}),l.jsxs("div",{className:"flex items-center ml-3",children:[l.jsx("span",{className:"text-xs text-gray-500 mr-1",children:s.id}),l.jsxs("div",{className:"relative",ref:O,children:[l.jsxs("button",{onClick:()=>v(!j),className:"p-1 text-gray-400 hover:text-gray-600 transition-colors flex items-center",title:d("common.copy"),children:[h?l.jsx(vo,{size:14,className:"text-green-500"}):l.jsx(Pc,{size:14}),l.jsx(uu,{size:12,className:"ml-1"})]}),j&&l.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:[l.jsxs("button",{onClick:P,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[l.jsx(Pc,{size:12,className:"mr-2"}),d("common.copyId")]}),l.jsxs("button",{onClick:L,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[l.jsx(mb,{size:12,className:"mr-2"}),d("common.copyUrl")]}),l.jsxs("button",{onClick:I,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[l.jsx(cb,{size:12,className:"mr-2"}),d("common.copyJson")]})]})]})]})]}),s.description&&l.jsx("p",{className:"text-gray-600 text-sm mt-1",children:s.description})]}),l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx("div",{className:"bg-blue-50 text-blue-700 px-3 py-1 rounded-full text-sm btn-secondary",children:d("groups.serverCount",{count:s.servers.length})}),l.jsx("button",{onClick:R,className:"text-gray-500 hover:text-gray-700",title:d("groups.edit"),children:l.jsx(mg,{size:18})}),l.jsx("button",{onClick:S,className:"text-gray-500 hover:text-red-600",title:d("groups.delete"),children:l.jsx(Rb,{size:18})})]})]}),l.jsx("div",{className:"mt-4",children:te.length===0?l.jsx("p",{className:"text-gray-500 italic",children:d("groups.noServers")}):l.jsx("div",{className:"flex flex-wrap gap-2",children:te.map(D=>{var F;const U=B(D.name),se=U&&U.tools!=="all"&&Array.isArray(U.tools),_=se&&Array.isArray(U==null?void 0:U.tools)?U.tools.length:((F=D.tools)==null?void 0:F.length)||0,V=A===D.name,k=()=>se&&Array.isArray(U==null?void 0:U.tools)?U.tools:D.tools&&D.tools.length>0?D.tools.map(ce=>ce.name):[],G=()=>{N(V?null:D.name)};return l.jsxs("div",{className:"relative",children:[l.jsxs("div",{className:"flex items-center space-x-2 bg-gray-50 rounded-lg px-3 py-2 cursor-pointer hover:bg-gray-100 transition-colors",onClick:G,children:[l.jsx("span",{className:"font-medium text-gray-700 text-sm",children:D.name}),l.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${D.status==="connected"?"bg-green-500":D.status==="connecting"?"bg-yellow-500":"bg-red-500"}`}),_>0&&l.jsxs("span",{className:"text-xs text-blue-600 bg-blue-100 px-2 py-0.5 rounded flex items-center gap-1",children:[l.jsx(Db,{size:12}),_]})]}),V&&l.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:[l.jsxs("div",{className:"text-gray-600 text-xs mb-2",children:[d(se?"groups.selectedTools":"groups.allTools"),":"]}),l.jsx("div",{className:"flex flex-wrap gap-1",children:k().map((ce,E)=>l.jsx("span",{className:"inline-block bg-gray-100 text-gray-700 px-2 py-1 rounded text-xs",children:ce},E))})]})]},D.name)})})}),l.jsx(_g,{isOpen:p,onClose:()=>g(!1),onConfirm:C,serverName:s.name,isGroup:!0})]})},v1=()=>{const{t:s}=ke(),{groups:o,loading:r,error:c,setError:d,deleteGroup:f,triggerRefresh:m}=mu(),{servers:p}=Vl(),[g,h]=w.useState(null),[y,j]=w.useState(!1),v=S=>{h(S)},A=()=>{h(null),m()},N=async S=>{await f(S)||d(s("groups.deleteError"))},O=()=>{j(!0)},R=()=>{j(!1),m()};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex justify-between items-center mb-8",children:[l.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.groups.title")}),l.jsx("div",{className:"flex space-x-4",children:l.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:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 00-1 1v5H4a1 1 0 100 2h5v5a1 1 0 102 0v-5h5a1 1 0 100-2h-5V4a1 1 0 00-1-1z",clipRule:"evenodd"})}),s("groups.add")]})})]}),c&&l.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:l.jsx("p",{children:c})}),r?l.jsx("div",{className:"bg-white shadow rounded-lg p-6 loading-container",children:l.jsxs("div",{className:"flex flex-col items-center justify-center",children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):o.length===0?l.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:l.jsx("p",{className:"text-gray-600",children:s("groups.noGroups")})}):l.jsx("div",{className:"space-y-6",children:o.map(S=>l.jsx(b1,{group:S,servers:p,onEdit:v,onDelete:N},S.id))}),y&&l.jsx(x1,{onAdd:R,onCancel:R}),g&&l.jsx(y1,{group:g,onEdit:A,onCancel:()=>h(null)})]})},w1=()=>l.jsx("div",{}),j1=({onSuccess:s,onCancel:o})=>{const{t:r}=ke(),[c,d]=w.useState({currentPassword:"",newPassword:""}),[f,m]=w.useState(""),[p,g]=w.useState(!1),[h,y]=w.useState(null),[j,v]=w.useState(!1),A=O=>{const{name:R,value:S}=O.target;R==="confirmPassword"?m(S):d(C=>({...C,[R]:S}))},N=async O=>{if(O.preventDefault(),y(null),c.newPassword!==f){y(r("auth.passwordsNotMatch"));return}g(!0);try{const R=await Ky(c);R.success?(v(!0),s&&s()):y(R.message||r("auth.changePasswordError"))}catch{y(r("auth.changePasswordError"))}finally{g(!1)}};return l.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-md",children:[l.jsx("h2",{className:"text-xl font-bold mb-4",children:r("auth.changePassword")}),j?l.jsx("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4",children:r("auth.changePasswordSuccess")}):l.jsxs("form",{onSubmit:N,children:[h&&l.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4",children:h}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"currentPassword",children:r("auth.currentPassword")}),l.jsx("input",{type:"password",id:"currentPassword",name:"currentPassword",className:"w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",value:c.currentPassword,onChange:A,required:!0})]}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"newPassword",children:r("auth.newPassword")}),l.jsx("input",{type:"password",id:"newPassword",name:"newPassword",className:"w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",value:c.newPassword,onChange:A,required:!0,minLength:6})]}),l.jsxs("div",{className:"mb-6",children:[l.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"confirmPassword",children:r("auth.confirmPassword")}),l.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})]}),l.jsxs("div",{className:"flex justify-end space-x-2",children:[o&&l.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:r("common.cancel")}),l.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?l.jsxs("span",{className:"flex items-center",children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r("common.save")]}):r("common.save")})]})]})]})};function S1(s=32){const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=new Uint8Array(s);return crypto.getRandomValues(r),Array.from(r).map(c=>o.charAt(c%o.length)).join("")}const qc={SETTINGS_SMART_ROUTING:"settings:smart_routing",SETTINGS_SKIP_AUTH:"settings:skip_auth",SETTINGS_INSTALL_CONFIG:"settings:install_config"},N1=()=>{const{t:s}=ke(),o=On(),{showToast:r}=Bl(),[c,d]=w.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[f,m]=w.useState({dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),{routingConfig:p,tempRoutingConfig:g,setTempRoutingConfig:h,installConfig:y,smartRoutingConfig:j,loading:v,updateRoutingConfig:A,updateRoutingConfigBatch:N,updateInstallConfig:O,updateSmartRoutingConfig:R,updateSmartRoutingConfigBatch:S}=Vg();w.useEffect(()=>{y&&d(y)},[y]),w.useEffect(()=>{j&&m({dbUrl:j.dbUrl||"",openaiApiBaseUrl:j.openaiApiBaseUrl||"",openaiApiKey:j.openaiApiKey||"",openaiApiEmbeddingModel:j.openaiApiEmbeddingModel||""})},[j]);const[C,z]=w.useState({routingConfig:!1,installConfig:!1,smartRoutingConfig:!1,password:!1}),P=_=>{z(V=>({...V,[_]:!V[_]}))},L=async(_,V)=>{if(_==="enableBearerAuth"&&V===!0&&!g.bearerAuthKey&&!p.bearerAuthKey){const k=S1();I(k),await N({enableBearerAuth:!0,bearerAuthKey:k})&&h(F=>({...F,bearerAuthKey:k}));return}await A(_,V)},I=_=>{h(V=>({...V,bearerAuthKey:_}))},K=async()=>{await A("bearerAuthKey",g.bearerAuthKey)},B=(_,V)=>{d({...c,[_]:V})},Z=async _=>{await O(_,c[_])},te=(_,V)=>{m({...f,[_]:V})},D=async _=>{await R(_,f[_])},U=async _=>{if(_){const V=f.dbUrl||j.dbUrl,k=f.openaiApiKey||j.openaiApiKey;if(!V||!k){const F=[];V||F.push(s("settings.dbUrl")),k||F.push(s("settings.openaiApiKey")),r(s("settings.smartRoutingValidationError",{fields:F.join(", ")}));return}const G={enabled:_};f.dbUrl!==j.dbUrl&&(G.dbUrl=f.dbUrl),f.openaiApiBaseUrl!==j.openaiApiBaseUrl&&(G.openaiApiBaseUrl=f.openaiApiBaseUrl),f.openaiApiKey!==j.openaiApiKey&&(G.openaiApiKey=f.openaiApiKey),f.openaiApiEmbeddingModel!==j.openaiApiEmbeddingModel&&(G.openaiApiEmbeddingModel=f.openaiApiEmbeddingModel),await S(G)}else await R("enabled",_)},se=()=>{setTimeout(()=>{o("/")},2e3)};return l.jsxs("div",{className:"container mx-auto",children:[l.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:s("pages.settings.title")}),l.jsx(Vc,{permissions:qc.SETTINGS_SMART_ROUTING,children:l.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 page-card",children:[l.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600",onClick:()=>P("smartRoutingConfig"),children:[l.jsx("h2",{className:"font-semibold text-gray-800",children:s("pages.settings.smartRouting")}),l.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:C.smartRoutingConfig?"▼":"►"})]}),C.smartRoutingConfig&&l.jsxs("div",{className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableSmartRouting")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableSmartRoutingDescription")})]}),l.jsx(Ss,{disabled:v,checked:j.enabled,onCheckedChange:_=>U(_)})]}),l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsx("div",{className:"mb-2",children:l.jsxs("h3",{className:"font-medium text-gray-700",children:[l.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.dbUrl")]})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:f.dbUrl,onChange:_=>te("dbUrl",_.target.value),placeholder:s("settings.dbUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm border-gray-300 form-input",disabled:v}),l.jsx("button",{onClick:()=>D("dbUrl"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsx("div",{className:"mb-2",children:l.jsxs("h3",{className:"font-medium text-gray-700",children:[l.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.openaiApiKey")]})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"password",value:f.openaiApiKey,onChange:_=>te("openaiApiKey",_.target.value),placeholder:s("settings.openaiApiKeyPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm border-gray-300",disabled:v}),l.jsx("button",{onClick:()=>D("openaiApiKey"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsx("div",{className:"mb-2",children:l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.openaiApiBaseUrl")})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:f.openaiApiBaseUrl,onChange:_=>te("openaiApiBaseUrl",_.target.value),placeholder:s("settings.openaiApiBaseUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:v}),l.jsx("button",{onClick:()=>D("openaiApiBaseUrl"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsx("div",{className:"mb-2",children:l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.openaiApiEmbeddingModel")})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:f.openaiApiEmbeddingModel,onChange:_=>te("openaiApiEmbeddingModel",_.target.value),placeholder:s("settings.openaiApiEmbeddingModelPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:v}),l.jsx("button",{onClick:()=>D("openaiApiEmbeddingModel"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]})]})]})}),l.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6",children:[l.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>P("routingConfig"),children:[l.jsx("h2",{className:"font-semibold text-gray-800",children:s("pages.settings.routeConfig")}),l.jsx("span",{className:"text-gray-500",children:C.routingConfig?"▼":"►"})]}),C.routingConfig&&l.jsxs("div",{className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableBearerAuth")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableBearerAuthDescription")})]}),l.jsx(Ss,{disabled:v,checked:p.enableBearerAuth,onCheckedChange:_=>L("enableBearerAuth",_)})]}),p.enableBearerAuth&&l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{className:"mb-2",children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.bearerAuthKey")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.bearerAuthKeyDescription")})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:g.bearerAuthKey,onChange:_=>I(_.target.value),placeholder:s("settings.bearerAuthKeyPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:v||!p.enableBearerAuth}),l.jsx("button",{onClick:K,disabled:v||!p.enableBearerAuth,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableGlobalRoute")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableGlobalRouteDescription")})]}),l.jsx(Ss,{disabled:v,checked:p.enableGlobalRoute,onCheckedChange:_=>L("enableGlobalRoute",_)})]}),l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableGroupNameRoute")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableGroupNameRouteDescription")})]}),l.jsx(Ss,{disabled:v,checked:p.enableGroupNameRoute,onCheckedChange:_=>L("enableGroupNameRoute",_)})]}),l.jsx(Vc,{permissions:qc.SETTINGS_SKIP_AUTH,children:l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.skipAuth")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.skipAuthDescription")})]}),l.jsx(Ss,{disabled:v,checked:p.skipAuth,onCheckedChange:_=>L("skipAuth",_)})]})})]})]}),l.jsx(Vc,{permissions:qc.SETTINGS_INSTALL_CONFIG,children:l.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6",children:[l.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>P("installConfig"),children:[l.jsx("h2",{className:"font-semibold text-gray-800",children:s("settings.installConfig")}),l.jsx("span",{className:"text-gray-500",children:C.installConfig?"▼":"►"})]}),C.installConfig&&l.jsxs("div",{className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{className:"mb-2",children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.baseUrl")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.baseUrlDescription")})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:c.baseUrl,onChange:_=>B("baseUrl",_.target.value),placeholder:s("settings.baseUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:v}),l.jsx("button",{onClick:()=>Z("baseUrl"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{className:"mb-2",children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.pythonIndexUrl")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.pythonIndexUrlDescription")})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:c.pythonIndexUrl,onChange:_=>B("pythonIndexUrl",_.target.value),placeholder:s("settings.pythonIndexUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:v}),l.jsx("button",{onClick:()=>Z("pythonIndexUrl"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),l.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[l.jsxs("div",{className:"mb-2",children:[l.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.npmRegistry")}),l.jsx("p",{className:"text-sm text-gray-500",children:s("settings.npmRegistryDescription")})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"text",value:c.npmRegistry,onChange:_=>B("npmRegistry",_.target.value),placeholder:s("settings.npmRegistryPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:v}),l.jsx("button",{onClick:()=>Z("npmRegistry"),disabled:v,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]})]})]})}),l.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6",children:[l.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>P("password"),children:[l.jsx("h2",{className:"font-semibold text-gray-800",children:s("auth.changePassword")}),l.jsx("span",{className:"text-gray-500",children:C.password?"▼":"►"})]}),C.password&&l.jsx("div",{className:"max-w-lg mt-4",children:l.jsx(j1,{onSuccess:se})})]})]})},C1=()=>{const{t:s}=ke(),[o,r]=w.useState([]),[c,d]=w.useState([]),[f,m]=w.useState([]),[p,g]=w.useState([]),[h,y]=w.useState(""),[j,v]=w.useState(""),[A,N]=w.useState(""),[O,R]=w.useState(!0),[S,C]=w.useState(null),[z,P]=w.useState(null),[L,I]=w.useState([]),[K,B]=w.useState(1),[Z,te]=w.useState(9),[D,U]=w.useState(1),se=w.useCallback(async()=>{try{R(!0);const ae=localStorage.getItem("mcphub_token"),re=await fetch(Ne("/market/servers"),{headers:{"x-auth-token":ae||""}});if(!re.ok)throw new Error(`Status: ${re.status}`);const ie=await re.json();ie&&ie.success&&Array.isArray(ie.data)?(d(ie.data),_(ie.data,K)):(console.error("Invalid market servers data format:",ie),C(s("market.fetchError")))}catch(ae){console.error("Error fetching market servers:",ae),C(ae instanceof Error?ae.message:String(ae))}finally{R(!1)}},[s]),_=w.useCallback((ae,re,ie=Z)=>{const xe=ae.length,Be=Math.ceil(xe/ie);U(Be);const je=Math.max(1,Math.min(re,Be));je!==re&&B(je);const De=(je-1)*ie,Je=ae.slice(De,De+ie);r(Je)},[Z]),V=w.useCallback(ae=>{B(ae),_(c,ae,Z)},[c,_,Z]),k=w.useCallback(async()=>{try{const ae=localStorage.getItem("mcphub_token"),re=await fetch(Ne("/market/categories"),{headers:{"x-auth-token":ae||""}});if(!re.ok)throw new Error(`Status: ${re.status}`);const ie=await re.json();ie&&ie.success&&Array.isArray(ie.data)?m(ie.data):console.error("Invalid categories data format:",ie)}catch(ae){console.error("Error fetching categories:",ae)}},[]),G=w.useCallback(async()=>{try{const ae=localStorage.getItem("mcphub_token"),re=await fetch(Ne("/market/tags"),{headers:{"x-auth-token":ae||""}});if(!re.ok)throw new Error(`Status: ${re.status}`);const ie=await re.json();ie&&ie.success&&Array.isArray(ie.data)?g(ie.data):console.error("Invalid tags data format:",ie)}catch(ae){console.error("Error fetching tags:",ae)}},[]),F=w.useCallback(async ae=>{try{R(!0);const re=localStorage.getItem("mcphub_token"),ie=await fetch(Ne(`/market/servers/${ae}`),{headers:{"x-auth-token":re||""}});if(!ie.ok)throw new Error(`Status: ${ie.status}`);const xe=await ie.json();return xe&&xe.success&&xe.data?(P(xe.data),xe.data):(console.error("Invalid server data format:",xe),C(s("market.serverNotFound")),null)}catch(re){return console.error(`Error fetching server ${ae}:`,re),C(re instanceof Error?re.message:String(re)),null}finally{R(!1)}},[s]),ce=w.useCallback(async ae=>{try{if(R(!0),N(ae),!ae.trim()){se();return}const re=localStorage.getItem("mcphub_token"),ie=await fetch(Ne(`/market/servers/search?query=${encodeURIComponent(ae)}`),{headers:{"x-auth-token":re||""}});if(!ie.ok)throw new Error(`Status: ${ie.status}`);const xe=await ie.json();xe&&xe.success&&Array.isArray(xe.data)?(d(xe.data),B(1),_(xe.data,1)):(console.error("Invalid search results format:",xe),C(s("market.searchError")))}catch(re){console.error("Error searching servers:",re),C(re instanceof Error?re.message:String(re))}finally{R(!1)}},[s,c,_,se]),E=w.useCallback(async ae=>{try{if(R(!0),y(ae),v(""),!ae){se();return}const re=localStorage.getItem("mcphub_token"),ie=await fetch(Ne(`/market/categories/${encodeURIComponent(ae)}`),{headers:{"x-auth-token":re||""}});if(!ie.ok)throw new Error(`Status: ${ie.status}`);const xe=await ie.json();xe&&xe.success&&Array.isArray(xe.data)?(d(xe.data),B(1),_(xe.data,1)):(console.error("Invalid category filter results format:",xe),C(s("market.filterError")))}catch(re){console.error("Error filtering servers by category:",re),C(re instanceof Error?re.message:String(re))}finally{R(!1)}},[s,se,_]),X=w.useCallback(async ae=>{try{if(R(!0),v(ae),y(""),!ae){se();return}const re=localStorage.getItem("mcphub_token"),ie=await fetch(Ne(`/market/tags/${encodeURIComponent(ae)}`),{headers:{"x-auth-token":re||""}});if(!ie.ok)throw new Error(`Status: ${ie.status}`);const xe=await ie.json();xe&&xe.success&&Array.isArray(xe.data)?(d(xe.data),B(1),_(xe.data,1)):(console.error("Invalid tag filter results format:",xe),C(s("market.tagFilterError")))}catch(re){console.error("Error filtering servers by tag:",re),C(re instanceof Error?re.message:String(re))}finally{R(!1)}},[s,se,_]),le=w.useCallback(async()=>{try{const ae=localStorage.getItem("mcphub_token"),re=await fetch(Ne("/servers"),{headers:{"x-auth-token":ae||""}});if(!re.ok)throw new Error(`Status: ${re.status}`);const ie=await re.json();if(ie&&ie.success&&Array.isArray(ie.data)){const xe=ie.data.map(Be=>Be.name);I(xe)}}catch(ae){console.error("Error fetching installed servers:",ae)}},[]),ne=w.useCallback(ae=>L.includes(ae),[L]),de=w.useCallback(async(ae,re)=>{var ie,xe;try{const Be=(ie=ae.installations)!=null&&ie.npm?"npm":Object.keys(ae.installations||{}).length>0?Object.keys(ae.installations)[0]:null;if(!Be||!((xe=ae.installations)!=null&&xe[Be]))return C(s("market.noInstallationMethod")),!1;const je=ae.installations[Be],De={name:ae.name,config:re.type==="stdio"?{command:re.command||je.command||"",args:re.args||je.args||[],env:{...je.env,...re.env}}:re},Je=localStorage.getItem("mcphub_token"),Ct=await fetch(Ne("/servers"),{method:"POST",headers:{"Content-Type":"application/json","x-auth-token":Je||""},body:JSON.stringify(De)});if(!Ct.ok){const ua=await Ct.json();throw new Error(ua.message||`Status: ${Ct.status}`)}return await le(),!0}catch(Be){return console.error("Error installing server:",Be),C(Be instanceof Error?Be.message:String(Be)),!1}},[s,le]),we=w.useCallback(ae=>{te(ae),B(1),_(c,1,ae)},[c,_]);return w.useEffect(()=>{se(),k(),G(),le()},[se,k,G,le]),{servers:o,allServers:c,categories:f,tags:p,selectedCategory:h,selectedTag:j,searchQuery:A,loading:O,error:S,setError:C,currentServer:z,fetchMarketServers:se,fetchServerByName:F,searchServers:ce,filterByCategory:E,filterByTag:X,installServer:de,currentPage:K,totalPages:D,serversPerPage:Z,changePage:V,changeServersPerPage:we,isServerInstalled:ne}},k1=({server:s,onClick:o})=>{var p,g,h,y;const{t:r}=ke(),c=()=>{if(!s.tags||s.tags.length===0)return{tagsToShow:[],hasMore:!1,moreCount:0};const j=28,v=C=>C.length+3;let A=0,N=0;const O=[...s.tags].sort((C,z)=>C.length-z.length);for(N=0;N<O.length;N++){const C=v(O[N]);if(A+C>j)break;if(A+=C,N===O.length-1)return{tagsToShow:O,hasMore:!1,moreCount:0}}N===0&&O.length>0&&(N=1);const R=O.length-N,S=3+String(R).length+r("market.moreTags").length;return A+S<=j||N<1?{tagsToShow:O.slice(0,N),hasMore:!0,moreCount:R}:{tagsToShow:O.slice(0,Math.max(1,N-1)),hasMore:!0,moreCount:R+1}},{tagsToShow:d,hasMore:f,moreCount:m}=c();return l.jsxs("div",{className:"bg-white rounded-lg shadow-md p-5 hover:shadow-lg transition-all duration-200 cursor-pointer flex flex-col h-full page-card",onClick:()=>o(s),children:[l.jsxs("div",{className:"flex justify-between items-start mb-3",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 line-clamp-1 mr-2",children:s.display_name}),s.is_official&&l.jsx("span",{className:"text-xs font-medium px-2.5 py-0.5 rounded flex-shrink-0 label-primary",children:r("market.official")})]}),l.jsx("p",{className:"text-gray-600 text-sm mb-4 line-clamp-2 min-h-[40px]",children:s.description}),l.jsx("div",{className:"flex flex-wrap gap-1 mb-2 min-h-[28px]",children:((p=s.categories)==null?void 0:p.length)>0?s.categories.map((j,v)=>l.jsx("span",{className:"bg-gray-100 text-gray-800 text-xs px-2 py-1.5 rounded whitespace-nowrap",children:j},v)):l.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})}),l.jsx("div",{className:"relative mb-3 min-h-[28px] overflow-x-auto",children:((g=s.tags)==null?void 0:g.length)>0?l.jsxs("div",{className:"flex gap-1 items-center whitespace-nowrap",children:[d.map((j,v)=>l.jsxs("span",{className:"bg-green-50 text-green-700 text-xs px-2 py-1 rounded flex-shrink-0 label-secondary",children:["#",j]},v)),f&&l.jsxs("span",{className:"bg-gray-100 text-gray-600 text-xs px-1.5 py-1 rounded flex-shrink-0",children:["+",m," ",r("market.moreTags")]})]}):l.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})}),l.jsxs("div",{className:"flex justify-between items-center mt-auto pt-2 text-xs text-gray-500",children:[l.jsxs("div",{className:"overflow-hidden",children:[l.jsxs("span",{className:"whitespace-nowrap",children:[r("market.by")," "]}),l.jsx("span",{className:"font-medium whitespace-nowrap overflow-hidden text-ellipsis max-w-[120px] inline-block align-bottom",children:((h=s.author)==null?void 0:h.name)||r("market.unknown")})]}),l.jsxs("div",{className:"flex items-center flex-shrink-0",children:[l.jsx("svg",{className:"h-4 w-4 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:l.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"})}),l.jsxs("span",{children:[((y=s.tools)==null?void 0:y.length)||0," ",r("market.tools")]})]})]})]})},E1=({server:s,onBack:o,onInstall:r,installing:c=!1,isInstalled:d=!1})=>{var Z,te;const{t:f}=ke(),[m,p]=w.useState(!1),[g,h]=w.useState(null),[y,j]=w.useState(!1),[v,A]=w.useState(null),[N,O]=w.useState([]),R=()=>d?{className:"bg-green-600 cursor-default px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:f("market.installed")}:c?{className:"bg-gray-400 cursor-not-allowed px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:f("market.installing")}:{className:"bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded text-sm font-medium text-white btn-primary",disabled:!1,text:f("market.install")},S=()=>{p(!m),h(null),j(!1),A(null)},C=async()=>{v&&(await z(v),j(!1),A(null))},z=async D=>{try{h(null),r(s,D.config),p(!1)}catch(U){console.error("Error installing server:",U),h(f("errors.serverInstall"))}},P=()=>{d||S()},L=()=>{if(!s.installations)return;if(s.installations.npm)return s.installations.npm;if(s.installations.uvx)return s.installations.uvx;if(s.installations.default)return s.installations.default;const D=Object.keys(s.installations);if(D.length>0)return s.installations[D[0]]},I=async D=>{try{const U=Hg(D);U.length>0?(O(U),A(D),j(!0)):await z(D)}catch(U){console.error("Error processing server installation:",U),h(f("errors.serverInstall"))}},K=R(),B=L();return l.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[l.jsx("div",{className:"mb-4",children:l.jsxs("button",{onClick:o,className:"text-gray-600 hover:text-gray-900 flex items-center",children:[l.jsx("svg",{className:"h-5 w-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:l.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")]})}),l.jsxs("div",{className:"flex justify-between items-start mb-4",children:[l.jsx("div",{children:l.jsxs("h2",{className:"text-2xl font-bold text-gray-900 flex items-center flex-wrap",children:[s.display_name,l.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",s.name,")"]}),l.jsxs("span",{className:"text-sm font-normal text-gray-600 ml-4",children:[f("market.author"),": ",s.author.name," • ",f("market.license"),": ",s.license," •",l.jsx("a",{href:s.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline ml-1",children:f("market.repository")})]})]})}),l.jsxs("div",{className:"flex items-center",children:[s.is_official&&l.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")}),l.jsx("button",{onClick:P,disabled:K.disabled,className:K.className,children:K.text})]})]}),l.jsx("p",{className:"text-gray-700 mb-6",children:s.description}),l.jsxs("div",{className:"mb-6",children:[l.jsxs("h3",{className:"text-lg font-semibold mb-3",children:[f("market.categories")," & ",f("market.tags")]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[(Z=s.categories)==null?void 0:Z.map((D,U)=>l.jsx("span",{className:"bg-gray-100 text-gray-800 px-3 py-1 rounded",children:D},`cat-${U}`)),s.tags&&s.tags.map((D,U)=>l.jsxs("span",{className:"bg-gray-100 text-green-700 px-2 py-1 rounded text-sm",children:["#",D]},`tag-${U}`))]})]}),s.arguments&&Object.keys(s.arguments).length>0&&l.jsxs("div",{className:"mb-6",children:[l.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.arguments")}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[l.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:l.jsxs("tr",{children:[l.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")}),l.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")}),l.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")}),l.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")})]})}),l.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:Object.entries(s.arguments).map(([D,U],se)=>l.jsxs("tr",{children:[l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:D}),l.jsx("td",{className:"px-6 py-4 text-sm text-gray-500",children:U.description}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:U.required?l.jsx("span",{className:"text-green-600",children:"✓"}):l.jsx("span",{className:"text-gray-600",children:"✗"})}),l.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:l.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:U.example})})]},se))})]})})]}),l.jsxs("div",{className:"mb-6",children:[l.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.tools")}),l.jsx("div",{className:"space-y-4",children:(te=s.tools)==null?void 0:te.map((D,U)=>l.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[l.jsxs("h4",{className:"font-medium mb-2",children:[D.name,l.jsx("button",{type:"button",onClick:()=>{const se=document.getElementById(`schema-${U}`);se&&se.classList.toggle("hidden")},className:"text-sm text-blue-500 font-normal hover:underline focus:outline-none ml-2",children:f("market.viewSchema")})]}),l.jsx("p",{className:"text-gray-600 mb-2",children:D.description}),l.jsx("div",{className:"mt-2",children:l.jsx("pre",{id:`schema-${U}`,className:"hidden bg-gray-50 p-3 rounded text-sm overflow-auto mt-2",children:JSON.stringify(D.inputSchema,null,2)})})]},U))})]}),s.examples&&s.examples.length>0&&l.jsxs("div",{className:"mb-6",children:[l.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.examples")}),l.jsx("div",{className:"space-y-4",children:s.examples.map((D,U)=>l.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[l.jsx("h4",{className:"font-medium mb-2",children:D.title}),l.jsx("p",{className:"text-gray-600 mb-2",children:D.description}),l.jsx("pre",{className:"bg-gray-50 p-3 rounded text-sm overflow-auto",children:D.prompt})]},U))})]}),l.jsx("div",{className:"mt-6 flex justify-end",children:l.jsx("button",{onClick:P,disabled:K.disabled,className:K.className,children:K.text})}),m&&l.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:l.jsx(fu,{onSubmit:I,onCancel:S,modalTitle:f("market.installServer",{name:s.display_name}),formError:g,initialData:{name:s.name,status:"disconnected",config:B?{command:B.command||"",args:B.args||[],env:B.env||{}}:void 0}})}),y&&l.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:l.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[l.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:f("server.confirmVariables")}),l.jsx("p",{className:"text-gray-600 mb-4",children:f("server.variablesDetected")}),l.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:l.jsxs("div",{className:"flex items-start",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"ml-3",children:[l.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[f("server.detectedVariables"),":"]}),l.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:N.map((D,U)=>l.jsxs("li",{className:"font-mono",children:["$",`{${D}}`]},U))})]})]})}),l.jsx("p",{className:"text-gray-600 text-sm mb-6",children:f("market.confirmVariablesMessage")}),l.jsxs("div",{className:"flex justify-end space-x-3",children:[l.jsx("button",{onClick:()=>{j(!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")}),l.jsx("button",{onClick:C,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:f("market.confirmAndInstall")})]})]})})]})},T1=({currentPage:s,totalPages:o,onPageChange:r})=>{const c=()=>{const d=[];d.push(l.jsx("button",{onClick:()=>r(1),className:`px-3 py-1 mx-1 rounded ${s===1?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"1"},"first"));const m=Math.max(2,s-Math.floor(5/2));m>2&&d.push(l.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis1"));for(let p=m;p<=Math.min(o-1,m+5-3);p++)d.push(l.jsx("button",{onClick:()=>r(p),className:`px-3 py-1 mx-1 rounded ${s===p?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:p},p));return m+5-3<o-1&&d.push(l.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis2")),o>1&&d.push(l.jsx("button",{onClick:()=>r(o),className:`px-3 py-1 mx-1 rounded ${s===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:l.jsxs("div",{className:"flex justify-center items-center my-6",children:[l.jsx("button",{onClick:()=>r(Math.max(1,s-1)),disabled:s===1,className:`px-3 py-1 rounded mr-2 ${s===1?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"« Prev"}),l.jsx("div",{className:"flex",children:c()}),l.jsx("button",{onClick:()=>r(Math.min(o,s+1)),disabled:s===o,className:`px-3 py-1 rounded ml-2 ${s===o?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"Next »"})]})},Nh=()=>{const{t:s}=ke(),o=On(),{serverName:r}=Kx(),{showToast:c}=Bl(),{servers:d,allServers:f,categories:m,loading:p,error:g,setError:h,searchServers:y,filterByCategory:j,filterByTag:v,selectedCategory:A,selectedTag:N,installServer:O,fetchServerByName:R,isServerInstalled:S,currentPage:C,totalPages:z,changePage:P,serversPerPage:L,changeServersPerPage:I}=C1(),[K,B]=w.useState(null),[Z,te]=w.useState(""),[D,U]=w.useState(!1);w.useEffect(()=>{(async()=>{if(r){const le=await R(r);le?B(le):o("/market")}else B(null)})()},[r,R,o]);const se=X=>{X.preventDefault(),y(Z)},_=X=>{j(X)},V=()=>{te(""),j(""),v("")},k=X=>{o(`/market/${X.name}`)},G=()=>{o("/market")},F=async(X,le)=>{try{U(!0),await O(X,le)&&c(s("market.installSuccess",{serverName:X.display_name}),"success")}finally{U(!1)}},ce=X=>{P(X),window.scrollTo({top:0,behavior:"smooth"})},E=X=>{const le=parseInt(X.target.value,10);I(le)};return K?l.jsx(E1,{server:K,onBack:G,onInstall:F,installing:D,isInstalled:S(K.name)}):l.jsxs("div",{children:[l.jsx("div",{className:"flex justify-between items-center mb-8",children:l.jsx("div",{children:l.jsxs("h1",{className:"text-2xl font-bold text-gray-900 flex items-center",children:[s("market.title"),l.jsx("span",{className:"text-sm text-gray-500 font-normal ml-2",children:s("pages.market.title").split(" - ")[1]})]})})}),g&&l.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("p",{children:g}),l.jsx("button",{onClick:()=>h(null),className:"text-red-700 hover:text-red-900 transition-colors duration-200",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:l.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"})})})]})}),l.jsx("div",{className:"bg-white shadow rounded-lg p-6 mb-6 page-card",children:l.jsxs("form",{onSubmit:se,className:"flex space-x-4 mb-0",children:[l.jsx("div",{className:"flex-grow",children:l.jsx("input",{type:"text",value:Z,onChange:X=>te(X.target.value),placeholder:s("market.searchPlaceholder"),className:"shadow appearance-none border border-gray-200 rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input"})}),l.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:s("market.search")}),(Z||A||N)&&l.jsx("button",{type:"button",onClick:V,className:"border border-gray-300 text-gray-700 font-medium py-2 px-4 rounded hover:bg-gray-50 btn-secondary transition-all duration-200",children:s("market.clearFilters")})]})}),l.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[l.jsx("div",{className:"md:w-48 flex-shrink-0",children:l.jsx("div",{className:"bg-white shadow rounded-lg p-4 mb-6 sticky top-4 page-card",children:m.length>0?l.jsxs("div",{className:"mb-6",children:[l.jsxs("div",{className:"flex justify-between items-center mb-3",children:[l.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")}),A&&l.jsx("span",{className:"text-xs text-blue-600 cursor-pointer hover:underline transition-colors duration-200",onClick:()=>j(""),children:s("market.clearCategoryFilter")})]}),l.jsx("div",{className:"flex flex-col gap-2",children:m.map(X=>l.jsx("button",{onClick:()=>_(X),className:`px-3 py-2 rounded text-sm text-left transition-all duration-200 ${A===X?"bg-blue-100 text-blue-800 font-medium btn-primary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-secondary"}`,children:X},X))})]}):p?l.jsxs("div",{className:"mb-6",children:[l.jsx("div",{className:"mb-3",children:l.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")})}),l.jsxs("div",{className:"flex flex-col gap-2 items-center py-4 loading-container",children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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.jsx("p",{className:"text-sm text-gray-600",children:s("app.loading")})]})]}):l.jsxs("div",{className:"mb-6",children:[l.jsx("div",{className:"mb-3",children:l.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")})}),l.jsx("p",{className:"text-sm text-gray-600 py-2",children:s("market.noCategories")})]})})}),l.jsx("div",{className:"flex-grow",children:p?l.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center",children:l.jsxs("div",{className:"flex flex-col items-center",children:[l.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:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):d.length===0?l.jsx("div",{className:"bg-white shadow rounded-lg p-6",children:l.jsx("p",{className:"text-gray-600",children:s("market.noServers")})}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:d.map((X,le)=>l.jsx(k1,{server:X,onClick:k},le))}),l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("div",{className:"text-sm text-gray-500",children:s("market.showing",{from:(C-1)*L+1,to:Math.min(C*L,f.length),total:f.length})}),l.jsx(T1,{currentPage:C,totalPages:z,onPageChange:ce}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-600",children:[s("market.perPage"),":"]}),l.jsxs("select",{id:"perPage",value:L,onChange:E,className:"border rounded p-1 text-sm btn-secondary outline-none",children:[l.jsx("option",{value:"6",children:"6"}),l.jsx("option",{value:"9",children:"9"}),l.jsx("option",{value:"12",children:"12"}),l.jsx("option",{value:"24",children:"24"})]})]})]}),l.jsx("div",{className:"mt-6"})]})})]})]})},A1={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"},R1={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 O1({variant:s="default",size:o="default",className:r,disabled:c,children:d,...f}){return l.jsx("button",{className:Aa("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",A1[s],R1[o],r),disabled:c,...f,children:d})}const M1=({logs:s,isLoading:o=!1,error:r=null,onClear:c})=>{const{t:d}=ke(),f=w.useRef(null),[m,p]=w.useState(!0),[g,h]=w.useState(""),[y,j]=w.useState(["info","error","warn","debug"]),[v,A]=w.useState(["main","child"]);w.useEffect(()=>{m&&f.current&&(f.current.scrollTop=f.current.scrollHeight)},[s,m]);const N=s.filter(C=>{const z=g?C.message.toLowerCase().includes(g.toLowerCase()):!0,P=y.includes(C.type),L=v.includes(C.source);return z&&P&&L}),O=C=>new Date(C).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),R=C=>{switch(C){case"error":return"bg-red-400/80 text-white";case"warn":return"bg-yellow-400/80 text-gray-900";case"debug":return"bg-purple-400/80 text-white";case"info":return"bg-blue-400/80 text-white";default:return"bg-blue-400/80 text-white"}},S=C=>{switch(C){case"main":return"bg-green-400/80 text-white";case"child":return"bg-orange-400/80 text-white";default:return"bg-gray-400/80 text-white"}};return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"bg-card p-3 rounded-t-md flex flex-wrap items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("span",{className:"font-semibold text-sm",children:[d("logs.filters"),":"]}),l.jsx("input",{type:"text",placeholder:d("logs.search"),className:"shadow appearance-none border border-gray-200 rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",value:g,onChange:C=>h(C.target.value)}),l.jsx("div",{className:"flex gap-1 items-center",children:["debug","info","error","warn"].map(C=>l.jsx(io,{variant:y.includes(C)?"default":"outline",className:`cursor-pointer ${y.includes(C)?R(C):""}`,onClick:()=>{y.includes(C)?j(z=>z.filter(P=>P!==C)):j(z=>[...z,C])},children:C},C))}),l.jsx("div",{className:"flex gap-1 items-center ml-2",children:["main","child"].map(C=>l.jsx(io,{variant:v.includes(C)?"default":"outline",className:`cursor-pointer ${v.includes(C)?S(C):""}`,onClick:()=>{v.includes(C)?A(z=>z.filter(P=>P!==C)):A(z=>[...z,C])},children:d(C==="main"?"logs.mainProcess":"logs.childProcess")},C))})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("label",{className:"flex items-center gap-1 text-sm",children:[l.jsx("input",{type:"checkbox",checked:m,onChange:()=>p(!m),className:"form-checkbox h-4 w-4"}),d("logs.autoScroll")]}),l.jsx(O1,{variant:"outline",size:"sm",onClick:c,className:"btn-secondary",disabled:o||s.length===0,children:d("logs.clearLogs")})]})]}),l.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?l.jsx("div",{className:"flex justify-center items-center h-full",children:l.jsx("span",{children:d("logs.loading")})}):r?l.jsx("div",{className:"text-red-500 p-2",children:r.message}):N.length===0?l.jsx("div",{className:"text-center text-muted-foreground p-8",children:g||y.length<4||v.length<2?d("logs.noMatch"):d("logs.noLogs")}):N.map((C,z)=>l.jsxs("div",{className:`py-1 ${C.type==="error"?"text-red-500":C.type==="warn"?"text-yellow-500":""}`,children:[l.jsxs("span",{className:"text-gray-400",children:["[",O(C.timestamp),"]"]}),l.jsx(io,{className:`ml-2 mr-1 ${R(C.type)}`,children:C.type}),l.jsxs(io,{variant:"default",className:`mr-2 ${S(C.source)}`,children:[C.source==="main"?d("logs.main"):d("logs.child"),C.processId?` (${C.processId})`:""]}),l.jsx("span",{className:"whitespace-pre-wrap",children:C.message})]},`${C.timestamp}-${z}`))})]})},z1=async()=>{try{const s=ln(),r=await(await fetch(Ne("/logs"),{method:"DELETE",headers:{"x-auth-token":s||""}})).json();if(!r.success)throw new Error(r.error||"Failed to clear logs")}catch(s){throw console.error("Error clearing logs:",s),s}},D1=()=>{const[s,o]=w.useState([]),[r,c]=w.useState(!0),[d,f]=w.useState(null);return w.useEffect(()=>{let p=null,g=!0;const h=()=>{try{p&&p.close();const y=ln();p=new EventSource(Ne(`/logs/stream?token=${y}`)),p.onmessage=j=>{if(g)try{const v=JSON.parse(j.data);v.type==="initial"?(o(v.logs),c(!1)):v.type==="log"&&o(A=>[...A,v.log])}catch(v){console.error("Error parsing SSE message:",v)}},p.onerror=()=>{g&&(p&&(p.close(),setTimeout(h,5e3)),f(new Error("Connection to log stream lost, attempting to reconnect...")))}}catch(y){if(!g)return;f(y instanceof Error?y:new Error("Failed to connect to log stream")),c(!1)}};return h(),()=>{g=!1,p&&p.close()}},[]),{logs:s,loading:r,error:d,clearLogs:async()=>{try{await z1(),o([])}catch(p){f(p instanceof Error?p:new Error("Failed to clear logs"))}}}},U1=()=>{const{t:s}=ke(),{logs:o,loading:r,error:c,clearLogs:d}=D1();return l.jsxs("div",{className:"container mx-auto p-4",children:[l.jsx("div",{className:"flex justify-between items-center mb-4",children:l.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.logs.title")})}),l.jsx("div",{className:"bg-card rounded-md shadow-sm border border-gray-200 page-card",children:l.jsx(M1,{logs:o,isLoading:r,error:c,onClear:d})})]})};function Ch(){const s=iu();return l.jsx(vv,{children:l.jsx(Qy,{children:l.jsx(yv,{children:l.jsx(Ay,{basename:s,children:l.jsxs(ly,{children:[l.jsx(Dt,{path:"/login",element:l.jsx(Wv,{})}),l.jsx(Dt,{element:l.jsx(Iv,{}),children:l.jsxs(Dt,{element:l.jsx(Jv,{}),children:[l.jsx(Dt,{path:"/",element:l.jsx(e1,{})}),l.jsx(Dt,{path:"/servers",element:l.jsx(p1,{})}),l.jsx(Dt,{path:"/groups",element:l.jsx(v1,{})}),l.jsx(Dt,{path:"/users",element:l.jsx(w1,{})}),l.jsx(Dt,{path:"/market",element:l.jsx(Nh,{})}),l.jsx(Dt,{path:"/market/:serverName",element:l.jsx(Nh,{})}),l.jsx(Dt,{path:"/logs",element:l.jsx(U1,{})}),l.jsx(Dt,{path:"/settings",element:l.jsx(N1,{})})]})}),l.jsx(Dt,{path:"*",element:l.jsx(Wh,{to:"/"})})]})})})})})}const Se=s=>typeof s=="string",Ol=()=>{let s,o;const r=new Promise((c,d)=>{s=c,o=d});return r.resolve=s,r.reject=o,r},kh=s=>s==null?"":""+s,L1=(s,o,r)=>{s.forEach(c=>{o[c]&&(r[c]=o[c])})},_1=/###/g,Eh=s=>s&&s.indexOf("###")>-1?s.replace(_1,"."):s,Th=s=>!s||Se(s),Ml=(s,o,r)=>{const c=Se(o)?o.split("."):o;let d=0;for(;d<c.length-1;){if(Th(s))return{};const f=Eh(c[d]);!s[f]&&r&&(s[f]=new r),Object.prototype.hasOwnProperty.call(s,f)?s=s[f]:s={},++d}return Th(s)?{}:{obj:s,k:Eh(c[d])}},Ah=(s,o,r)=>{const{obj:c,k:d}=Ml(s,o,Object);if(c!==void 0||o.length===1){c[d]=r;return}let f=o[o.length-1],m=o.slice(0,o.length-1),p=Ml(s,m,Object);for(;p.obj===void 0&&m.length;)f=`${m[m.length-1]}.${f}`,m=m.slice(0,m.length-1),p=Ml(s,m,Object),p!=null&&p.obj&&typeof p.obj[`${p.k}.${f}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${f}`]=r},H1=(s,o,r,c)=>{const{obj:d,k:f}=Ml(s,o,Object);d[f]=d[f]||[],d[f].push(r)},ho=(s,o)=>{const{obj:r,k:c}=Ml(s,o);if(r&&Object.prototype.hasOwnProperty.call(r,c))return r[c]},B1=(s,o,r)=>{const c=ho(s,r);return c!==void 0?c:ho(o,r)},qg=(s,o,r)=>{for(const c in o)c!=="__proto__"&&c!=="constructor"&&(c in s?Se(s[c])||s[c]instanceof String||Se(o[c])||o[c]instanceof String?r&&(s[c]=o[c]):qg(s[c],o[c],r):s[c]=o[c]);return s},bs=s=>s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var V1={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const q1=s=>Se(s)?s.replace(/[&<>"'\/]/g,o=>V1[o]):s;class G1{constructor(o){this.capacity=o,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(o){const r=this.regExpMap.get(o);if(r!==void 0)return r;const c=new RegExp(o);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(o,c),this.regExpQueue.push(o),c}}const $1=[" ",",","?","!",";"],K1=new G1(20),Y1=(s,o,r)=>{o=o||"",r=r||"";const c=$1.filter(m=>o.indexOf(m)<0&&r.indexOf(m)<0);if(c.length===0)return!0;const d=K1.getRegExp(`(${c.map(m=>m==="?"?"\\?":m).join("|")})`);let f=!d.test(s);if(!f){const m=s.indexOf(r);m>0&&!d.test(s.substring(0,m))&&(f=!0)}return f},Wc=function(s,o){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!s)return;if(s[o])return Object.prototype.hasOwnProperty.call(s,o)?s[o]:void 0;const c=o.split(r);let d=s;for(let f=0;f<c.length;){if(!d||typeof d!="object")return;let m,p="";for(let g=f;g<c.length;++g)if(g!==f&&(p+=r),p+=c[g],m=d[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<c.length-1)continue;f+=g-f+1;break}d=m}return d},go=s=>s==null?void 0:s.replace("_","-"),P1={type:"logger",log(s){this.output("log",s)},warn(s){this.output("warn",s)},error(s){this.output("error",s)},output(s,o){var r,c;(c=(r=console==null?void 0:console[s])==null?void 0:r.apply)==null||c.call(r,console,o)}};class po{constructor(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(o,r)}init(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=o||P1,this.options=r,this.debug=r.debug}log(){for(var o=arguments.length,r=new Array(o),c=0;c<o;c++)r[c]=arguments[c];return this.forward(r,"log","",!0)}warn(){for(var o=arguments.length,r=new Array(o),c=0;c<o;c++)r[c]=arguments[c];return this.forward(r,"warn","",!0)}error(){for(var o=arguments.length,r=new Array(o),c=0;c<o;c++)r[c]=arguments[c];return this.forward(r,"error","")}deprecate(){for(var o=arguments.length,r=new Array(o),c=0;c<o;c++)r[c]=arguments[c];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(o,r,c,d){return d&&!this.debug?null:(Se(o[0])&&(o[0]=`${c}${this.prefix} ${o[0]}`),this.logger[r](o))}create(o){return new po(this.logger,{prefix:`${this.prefix}:${o}:`,...this.options})}clone(o){return o=o||this.options,o.prefix=o.prefix||this.prefix,new po(this.logger,o)}}var ca=new po;class wo{constructor(){this.observers={}}on(o,r){return o.split(" ").forEach(c=>{this.observers[c]||(this.observers[c]=new Map);const d=this.observers[c].get(r)||0;this.observers[c].set(r,d+1)}),this}off(o,r){if(this.observers[o]){if(!r){delete this.observers[o];return}this.observers[o].delete(r)}}emit(o){for(var r=arguments.length,c=new Array(r>1?r-1:0),d=1;d<r;d++)c[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(...c)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(m=>{let[p,g]=m;for(let h=0;h<g;h++)p.apply(p,[o,...c])})}}class Rh extends wo{constructor(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=o||{},this.options=r,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 r=this.options.ns.indexOf(o);r>-1&&this.options.ns.splice(r,1)}getResource(o,r,c){var h,y;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator,m=d.ignoreJSONStructure!==void 0?d.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;o.indexOf(".")>-1?p=o.split("."):(p=[o,r],c&&(Array.isArray(c)?p.push(...c):Se(c)&&f?p.push(...c.split(f)):p.push(c)));const g=ho(this.data,p);return!g&&!r&&!c&&o.indexOf(".")>-1&&(o=p[0],r=p[1],c=p.slice(2).join(".")),g||!m||!Se(c)?g:Wc((y=(h=this.data)==null?void 0:h[o])==null?void 0:y[r],c,f)}addResource(o,r,c,d){let f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const m=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let p=[o,r];c&&(p=p.concat(m?c.split(m):c)),o.indexOf(".")>-1&&(p=o.split("."),d=r,r=p[1]),this.addNamespaces(r),Ah(this.data,p,d),f.silent||this.emit("added",o,r,c,d)}addResources(o,r,c){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const f in c)(Se(c[f])||Array.isArray(c[f]))&&this.addResource(o,r,f,c[f],{silent:!0});d.silent||this.emit("added",o,r,c)}addResourceBundle(o,r,c,d,f){let m=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},p=[o,r];o.indexOf(".")>-1&&(p=o.split("."),d=c,c=r,r=p[1]),this.addNamespaces(r);let g=ho(this.data,p)||{};m.skipCopy||(c=JSON.parse(JSON.stringify(c))),d?qg(g,c,f):g={...g,...c},Ah(this.data,p,g),m.silent||this.emit("added",o,r,c)}removeResourceBundle(o,r){this.hasResourceBundle(o,r)&&delete this.data[o][r],this.removeNamespaces(r),this.emit("removed",o,r)}hasResourceBundle(o,r){return this.getResource(o,r)!==void 0}getResourceBundle(o,r){return r||(r=this.options.defaultNS),this.getResource(o,r)}getDataByLanguage(o){return this.data[o]}hasLanguageSomeTranslations(o){const r=this.getDataByLanguage(o);return!!(r&&Object.keys(r)||[]).find(d=>r[d]&&Object.keys(r[d]).length>0)}toJSON(){return this.data}}var Gg={processors:{},addPostProcessor(s){this.processors[s.name]=s},handle(s,o,r,c,d){return s.forEach(f=>{var m;o=((m=this.processors[f])==null?void 0:m.process(o,r,c,d))??o}),o}};const Oh={},Mh=s=>!Se(s)&&typeof s!="boolean"&&typeof s!="number";class xo extends wo{constructor(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),L1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],o,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ca.create("translator")}changeLanguage(o){o&&(this.language=o)}exists(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;const c=this.resolve(o,r);return(c==null?void 0:c.res)!==void 0}extractFromKey(o,r){let c=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const d=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let f=r.ns||this.options.defaultNS||[];const m=c&&o.indexOf(c)>-1,p=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!Y1(o,c,d);if(m&&!p){const g=o.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:o,namespaces:Se(f)?[f]:f};const h=o.split(c);(c!==d||c===d&&this.options.ns.indexOf(h[0])>-1)&&(f=h.shift()),o=h.join(d)}return{key:o,namespaces:Se(f)?[f]:f}}translate(o,r,c){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);const d=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,f=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:m,namespaces:p}=this.extractFromKey(o[o.length-1],r),g=p[p.length-1],h=r.lng||this.language,y=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode"){if(y){const D=r.nsSeparator||this.options.nsSeparator;return d?{res:`${g}${D}${m}`,usedKey:m,exactUsedKey:m,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(r)}:`${g}${D}${m}`}return d?{res:m,usedKey:m,exactUsedKey:m,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(r)}:m}const j=this.resolve(o,r);let v=j==null?void 0:j.res;const A=(j==null?void 0:j.usedKey)||m,N=(j==null?void 0:j.exactUsedKey)||m,O=["[object Number]","[object Function]","[object RegExp]"],R=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,C=r.count!==void 0&&!Se(r.count),z=xo.hasDefaultValue(r),P=C?this.pluralResolver.getSuffix(h,r.count,r):"",L=r.ordinal&&C?this.pluralResolver.getSuffix(h,r.count,{ordinal:!1}):"",I=C&&!r.ordinal&&r.count===0,K=I&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${P}`]||r[`defaultValue${L}`]||r.defaultValue;let B=v;S&&!v&&z&&(B=K);const Z=Mh(B),te=Object.prototype.toString.apply(B);if(S&&B&&Z&&O.indexOf(te)<0&&!(Se(R)&&Array.isArray(B))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(A,B,{...r,ns:p}):`key '${m} (${this.language})' returned an object instead of string.`;return d?(j.res=D,j.usedParams=this.getUsedParamsDetails(r),j):D}if(f){const D=Array.isArray(B),U=D?[]:{},se=D?N:A;for(const _ in B)if(Object.prototype.hasOwnProperty.call(B,_)){const V=`${se}${f}${_}`;z&&!v?U[_]=this.translate(V,{...r,defaultValue:Mh(K)?K[_]:void 0,joinArrays:!1,ns:p}):U[_]=this.translate(V,{...r,joinArrays:!1,ns:p}),U[_]===V&&(U[_]=B[_])}v=U}}else if(S&&Se(R)&&Array.isArray(v))v=v.join(R),v&&(v=this.extendTranslation(v,o,r,c));else{let D=!1,U=!1;!this.isValidLookup(v)&&z&&(D=!0,v=K),this.isValidLookup(v)||(U=!0,v=m);const _=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&U?void 0:v,V=z&&K!==v&&this.options.updateMissing;if(U||D||V){if(this.logger.log(V?"updateKey":"missingKey",h,g,m,V?K:v),f){const ce=this.resolve(m,{...r,keySeparator:!1});ce&&ce.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 k=[];const G=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&G&&G[0])for(let ce=0;ce<G.length;ce++)k.push(G[ce]);else this.options.saveMissingTo==="all"?k=this.languageUtils.toResolveHierarchy(r.lng||this.language):k.push(r.lng||this.language);const F=(ce,E,X)=>{var ne;const le=z&&X!==v?X:_;this.options.missingKeyHandler?this.options.missingKeyHandler(ce,g,E,le,V,r):(ne=this.backendConnector)!=null&&ne.saveMissing&&this.backendConnector.saveMissing(ce,g,E,le,V,r),this.emit("missingKey",ce,g,E,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?k.forEach(ce=>{const E=this.pluralResolver.getSuffixes(ce,r);I&&r[`defaultValue${this.options.pluralSeparator}zero`]&&E.indexOf(`${this.options.pluralSeparator}zero`)<0&&E.push(`${this.options.pluralSeparator}zero`),E.forEach(X=>{F([ce],m+X,r[`defaultValue${X}`]||K)})}):F(k,m,K))}v=this.extendTranslation(v,o,r,j,c),U&&v===m&&this.options.appendNamespaceToMissingKey&&(v=`${g}:${m}`),(U||D)&&this.options.parseMissingKeyHandler&&(v=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}:${m}`:m,D?v:void 0))}return d?(j.res=v,j.usedParams=this.getUsedParamsDetails(r),j):v}extendTranslation(o,r,c,d,f){var h,y;var m=this;if((h=this.i18nFormat)!=null&&h.parse)o=this.i18nFormat.parse(o,{...this.options.interpolation.defaultVariables,...c},c.lng||this.language||d.usedLng,d.usedNS,d.usedKey,{resolved:d});else if(!c.skipInterpolation){c.interpolation&&this.interpolator.init({...c,interpolation:{...this.options.interpolation,...c.interpolation}});const j=Se(o)&&(((y=c==null?void 0:c.interpolation)==null?void 0:y.skipOnVariables)!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let v;if(j){const N=o.match(this.interpolator.nestingRegexp);v=N&&N.length}let A=c.replace&&!Se(c.replace)?c.replace:c;if(this.options.interpolation.defaultVariables&&(A={...this.options.interpolation.defaultVariables,...A}),o=this.interpolator.interpolate(o,A,c.lng||this.language||d.usedLng,c),j){const N=o.match(this.interpolator.nestingRegexp),O=N&&N.length;v<O&&(c.nest=!1)}!c.lng&&d&&d.res&&(c.lng=this.language||d.usedLng),c.nest!==!1&&(o=this.interpolator.nest(o,function(){for(var N=arguments.length,O=new Array(N),R=0;R<N;R++)O[R]=arguments[R];return(f==null?void 0:f[0])===O[0]&&!c.context?(m.logger.warn(`It seems you are nesting recursively key: ${O[0]} in key: ${r[0]}`),null):m.translate(...O,r)},c)),c.interpolation&&this.interpolator.reset()}const p=c.postProcess||this.options.postProcess,g=Se(p)?[p]:p;return o!=null&&(g!=null&&g.length)&&c.applyPostProcessor!==!1&&(o=Gg.handle(g,o,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...d,usedParams:this.getUsedParamsDetails(c)},...c}:c,this)),o}resolve(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c,d,f,m,p;return Se(o)&&(o=[o]),o.forEach(g=>{if(this.isValidLookup(c))return;const h=this.extractFromKey(g,r),y=h.key;d=y;let j=h.namespaces;this.options.fallbackNS&&(j=j.concat(this.options.fallbackNS));const v=r.count!==void 0&&!Se(r.count),A=v&&!r.ordinal&&r.count===0,N=r.context!==void 0&&(Se(r.context)||typeof r.context=="number")&&r.context!=="",O=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);j.forEach(R=>{var S,C;this.isValidLookup(c)||(p=R,!Oh[`${O[0]}-${R}`]&&((S=this.utils)!=null&&S.hasLoadedNamespace)&&!((C=this.utils)!=null&&C.hasLoadedNamespace(p))&&(Oh[`${O[0]}-${R}`]=!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(z=>{var I;if(this.isValidLookup(c))return;m=z;const P=[y];if((I=this.i18nFormat)!=null&&I.addLookupKeys)this.i18nFormat.addLookupKeys(P,y,z,R,r);else{let K;v&&(K=this.pluralResolver.getSuffix(z,r.count,r));const B=`${this.options.pluralSeparator}zero`,Z=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(P.push(y+K),r.ordinal&&K.indexOf(Z)===0&&P.push(y+K.replace(Z,this.options.pluralSeparator)),A&&P.push(y+B)),N){const te=`${y}${this.options.contextSeparator}${r.context}`;P.push(te),v&&(P.push(te+K),r.ordinal&&K.indexOf(Z)===0&&P.push(te+K.replace(Z,this.options.pluralSeparator)),A&&P.push(te+B))}}let L;for(;L=P.pop();)this.isValidLookup(c)||(f=L,c=this.getResource(z,R,L,r))}))})}),{res:c,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,r,c){var f;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(f=this.i18nFormat)!=null&&f.getResource?this.i18nFormat.getResource(o,r,c,d):this.resourceStore.getResource(o,r,c,d)}getUsedParamsDetails(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],c=o.replace&&!Se(o.replace);let d=c?o.replace:o;if(c&&typeof o.count<"u"&&(d.count=o.count),this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),!c){d={...d};for(const f of r)delete d[f]}return d}static hasDefaultValue(o){const r="defaultValue";for(const c in o)if(Object.prototype.hasOwnProperty.call(o,c)&&r===c.substring(0,r.length)&&o[c]!==void 0)return!0;return!1}}class zh{constructor(o){this.options=o,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ca.create("languageUtils")}getScriptPartFromCode(o){if(o=go(o),!o||o.indexOf("-")<0)return null;const r=o.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(o){if(o=go(o),!o||o.indexOf("-")<0)return o;const r=o.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(o){if(Se(o)&&o.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(o)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(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 r;return o.forEach(c=>{if(r)return;const d=this.formatLanguageCode(c);(!this.options.supportedLngs||this.isSupportedCode(d))&&(r=d)}),!r&&this.options.supportedLngs&&o.forEach(c=>{if(r)return;const d=this.getLanguagePartFromCode(c);if(this.isSupportedCode(d))return r=d;r=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})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(o,r){if(!o)return[];if(typeof o=="function"&&(o=o(r)),Se(o)&&(o=[o]),Array.isArray(o))return o;if(!r)return o.default||[];let c=o[r];return c||(c=o[this.getScriptPartFromCode(r)]),c||(c=o[this.formatLanguageCode(r)]),c||(c=o[this.getLanguagePartFromCode(r)]),c||(c=o.default),c||[]}toResolveHierarchy(o,r){const c=this.getFallbackCodes(r||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 Se(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))):Se(o)&&f(this.formatLanguageCode(o)),c.forEach(m=>{d.indexOf(m)<0&&f(this.formatLanguageCode(m))}),d}}const Dh={zero:0,one:1,two:2,few:3,many:4,other:5},Uh={select:s=>s===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class X1{constructor(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=o,this.options=r,this.logger=ca.create("pluralResolver"),this.pluralRulesCache={}}addRule(o,r){this.rules[o]=r}clearCache(){this.pluralRulesCache={}}getRule(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const c=go(o==="dev"?"en":o),d=r.ordinal?"ordinal":"cardinal",f=JSON.stringify({cleanedCode:c,type:d});if(f in this.pluralRulesCache)return this.pluralRulesCache[f];let m;try{m=new Intl.PluralRules(c,{type:d})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Uh;if(!o.match(/-|_/))return Uh;const g=this.languageUtils.getLanguagePartFromCode(o);m=this.getRule(g,r)}return this.pluralRulesCache[f]=m,m}needsPlural(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=this.getRule(o,r);return c||(c=this.getRule("dev",r)),(c==null?void 0:c.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(o,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(o,c).map(d=>`${r}${d}`)}getSuffixes(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=this.getRule(o,r);return c||(c=this.getRule("dev",r)),c?c.resolvedOptions().pluralCategories.sort((d,f)=>Dh[d]-Dh[f]).map(d=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${d}`):[]}getSuffix(o,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const d=this.getRule(o,c);return d?`${this.options.prepend}${c.ordinal?`ordinal${this.options.prepend}`:""}${d.select(r)}`:(this.logger.warn(`no plural rule found for: ${o}`),this.getSuffix("dev",r,c))}}const Lh=function(s,o,r){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,f=B1(s,o,r);return!f&&d&&Se(r)&&(f=Wc(s,r,c),f===void 0&&(f=Wc(o,r,c))),f},Gc=s=>s.replace(/\$/g,"$$$$");class Q1{constructor(){var r;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ca.create("interpolator"),this.options=o,this.format=((r=o==null?void 0:o.interpolation)==null?void 0:r.format)||(c=>c),this.init(o)}init(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};o.interpolation||(o.interpolation={escapeValue:!0});const{escape:r,escapeValue:c,useRawValueToEscape:d,prefix:f,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:y,unescapePrefix:j,nestingPrefix:v,nestingPrefixEscaped:A,nestingSuffix:N,nestingSuffixEscaped:O,nestingOptionsSeparator:R,maxReplaces:S,alwaysFormat:C}=o.interpolation;this.escape=r!==void 0?r:q1,this.escapeValue=c!==void 0?c:!0,this.useRawValueToEscape=d!==void 0?d:!1,this.prefix=f?bs(f):m||"{{",this.suffix=p?bs(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=y?"":j||"-",this.unescapeSuffix=this.unescapePrefix?"":y||"",this.nestingPrefix=v?bs(v):A||bs("$t("),this.nestingSuffix=N?bs(N):O||bs(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=S||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const o=(r,c)=>(r==null?void 0:r.source)===c?(r.lastIndex=0,r):new RegExp(c,"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,r,c,d){var A;let f,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=N=>{if(N.indexOf(this.formatSeparator)<0){const C=Lh(r,g,N,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,c,{...d,...r,interpolationkey:N}):C}const O=N.split(this.formatSeparator),R=O.shift().trim(),S=O.join(this.formatSeparator).trim();return this.format(Lh(r,g,R,this.options.keySeparator,this.options.ignoreJSONStructure),S,c,{...d,...r,interpolationkey:R})};this.resetRegExp();const y=(d==null?void 0:d.missingInterpolationHandler)||this.options.missingInterpolationHandler,j=((A=d==null?void 0:d.interpolation)==null?void 0:A.skipOnVariables)!==void 0?d.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:N=>Gc(N)},{regex:this.regexp,safeValue:N=>this.escapeValue?Gc(this.escape(N)):Gc(N)}].forEach(N=>{for(p=0;f=N.regex.exec(o);){const O=f[1].trim();if(m=h(O),m===void 0)if(typeof y=="function"){const S=y(o,f,d);m=Se(S)?S:""}else if(d&&Object.prototype.hasOwnProperty.call(d,O))m="";else if(j){m=f[0];continue}else this.logger.warn(`missed to pass in variable ${O} for interpolating ${o}`),m="";else!Se(m)&&!this.useRawValueToEscape&&(m=kh(m));const R=N.safeValue(m);if(o=o.replace(f[0],R),j?(N.regex.lastIndex+=m.length,N.regex.lastIndex-=f[0].length):N.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),o}nest(o,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d,f,m;const p=(g,h)=>{const y=this.nestingOptionsSeparator;if(g.indexOf(y)<0)return g;const j=g.split(new RegExp(`${y}[ ]*{`));let v=`{${j[1]}`;g=j[0],v=this.interpolate(v,m);const A=v.match(/'/g),N=v.match(/"/g);(((A==null?void 0:A.length)??0)%2===0&&!N||N.length%2!==0)&&(v=v.replace(/'/g,'"'));try{m=JSON.parse(v),h&&(m={...h,...m})}catch(O){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,O),`${g}${y}${v}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;d=this.nestingRegexp.exec(o);){let g=[];m={...c},m=m.replace&&!Se(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(j=>j.trim());d[1]=y.shift(),g=y,h=!0}if(f=r(p.call(this,d[1].trim(),m),m),f&&d[0]===o&&!Se(f))return f;Se(f)||(f=kh(f)),f||(this.logger.warn(`missed to resolve ${d[1]} for nesting ${o}`),f=""),h&&(f=g.reduce((y,j)=>this.format(y,j,c.lng,{...c,interpolationkey:d[1].trim()}),f.trim())),o=o.replace(d[0],f),this.regexp.lastIndex=0}return o}}const F1=s=>{let o=s.toLowerCase().trim();const r={};if(s.indexOf("(")>-1){const c=s.split("(");o=c[0].toLowerCase().trim();const d=c[1].substring(0,c[1].length-1);o==="currency"&&d.indexOf(":")<0?r.currency||(r.currency=d.trim()):o==="relativetime"&&d.indexOf(":")<0?r.range||(r.range=d.trim()):d.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),y=p.trim();r[y]||(r[y]=h),h==="false"&&(r[y]=!1),h==="true"&&(r[y]=!0),isNaN(h)||(r[y]=parseInt(h,10))}})}return{formatName:o,formatOptions:r}},vs=s=>{const o={};return(r,c,d)=>{let f=d;d&&d.interpolationkey&&d.formatParams&&d.formatParams[d.interpolationkey]&&d[d.interpolationkey]&&(f={...f,[d.interpolationkey]:void 0});const m=c+JSON.stringify(f);let p=o[m];return p||(p=s(go(c),d),o[m]=p),p(r)}};class Z1{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ca.create("formatter"),this.options=o,this.formats={number:vs((r,c)=>{const d=new Intl.NumberFormat(r,{...c});return f=>d.format(f)}),currency:vs((r,c)=>{const d=new Intl.NumberFormat(r,{...c,style:"currency"});return f=>d.format(f)}),datetime:vs((r,c)=>{const d=new Intl.DateTimeFormat(r,{...c});return f=>d.format(f)}),relativetime:vs((r,c)=>{const d=new Intl.RelativeTimeFormat(r,{...c});return f=>d.format(f,c.range||"day")}),list:vs((r,c)=>{const d=new Intl.ListFormat(r,{...c});return f=>d.format(f)})},this.init(o)}init(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=r.interpolation.formatSeparator||","}add(o,r){this.formats[o.toLowerCase().trim()]=r}addCached(o,r){this.formats[o.toLowerCase().trim()]=vs(r)}format(o,r,c){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f=r.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 j;const{formatName:h,formatOptions:y}=F1(g);if(this.formats[h]){let v=p;try{const A=((j=d==null?void 0:d.formatParams)==null?void 0:j[d.interpolationkey])||{},N=A.locale||A.lng||d.locale||d.lng||c;v=this.formats[h](p,N,{...y,...d,...A})}catch(A){this.logger.warn(A)}return v}else this.logger.warn(`there was no format function for ${h}`);return p},o)}}const J1=(s,o)=>{s.pending[o]!==void 0&&(delete s.pending[o],s.pendingCount--)};class I1 extends wo{constructor(o,r,c){var f,m;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=o,this.store=r,this.services=c,this.languageUtils=c.languageUtils,this.options=d,this.logger=ca.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=d.maxParallelReads||10,this.readingCalls=0,this.maxRetries=d.maxRetries>=0?d.maxRetries:5,this.retryTimeout=d.retryTimeout>=1?d.retryTimeout:350,this.state={},this.queue=[],(m=(f=this.backend)==null?void 0:f.init)==null||m.call(f,c,d.backend,d)}queueLoad(o,r,c,d){const f={},m={},p={},g={};return o.forEach(h=>{let y=!0;r.forEach(j=>{const v=`${h}|${j}`;!c.reload&&this.store.hasResourceBundle(h,j)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?m[v]===void 0&&(m[v]=!0):(this.state[v]=1,y=!1,m[v]===void 0&&(m[v]=!0),f[v]===void 0&&(f[v]=!0),g[j]===void 0&&(g[j]=!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,r,c){const d=o.split("|"),f=d[0],m=d[1];r&&this.emit("failedLoading",f,m,r),!r&&c&&this.store.addResourceBundle(f,m,c,void 0,void 0,{skipCopy:!0}),this.state[o]=r?-1:2,r&&c&&(this.state[o]=0);const p={};this.queue.forEach(g=>{H1(g.loaded,[f],m),J1(g,o),r&&g.errors.push(r),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const y=g.loaded[h];y.length&&y.forEach(j=>{p[h][j]===void 0&&(p[h][j]=!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,r,c){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,m=arguments.length>5?arguments[5]:void 0;if(!o.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:r,fcName:c,tried:d,wait:f,callback:m});return}this.readingCalls++;const p=(h,y)=>{if(this.readingCalls--,this.waitingReads.length>0){const j=this.waitingReads.shift();this.read(j.lng,j.ns,j.fcName,j.tried,j.wait,j.callback)}if(h&&y&&d<this.maxRetries){setTimeout(()=>{this.read.call(this,o,r,c,d+1,f*2,m)},f);return}m(h,y)},g=this.backend[c].bind(this.backend);if(g.length===2){try{const h=g(o,r);h&&typeof h.then=="function"?h.then(y=>p(null,y)).catch(p):p(null,h)}catch(h){p(h)}return}return g(o,r,p)}prepareLoading(o,r){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),d&&d();Se(o)&&(o=this.languageUtils.toResolveHierarchy(o)),Se(r)&&(r=[r]);const f=this.queueLoad(o,r,c,d);if(!f.toLoad.length)return f.pending.length||d(),null;f.toLoad.forEach(m=>{this.loadOne(m)})}load(o,r,c){this.prepareLoading(o,r,{},c)}reload(o,r,c){this.prepareLoading(o,r,{reload:!0},c)}loadOne(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const c=o.split("|"),d=c[0],f=c[1];this.read(d,f,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${r}loading namespace ${f} for language ${d} failed`,m),!m&&p&&this.logger.log(`${r}loaded namespace ${f} for language ${d}`,p),this.loaded(o,m,p)})}saveMissing(o,r,c,d,f){var g,h,y,j,v;let m=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},p=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((h=(g=this.services)==null?void 0:g.utils)!=null&&h.hasLoadedNamespace&&!((j=(y=this.services)==null?void 0:y.utils)!=null&&j.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${c}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(c==null||c==="")){if((v=this.backend)!=null&&v.create){const A={...m,isUpdate:f},N=this.backend.create.bind(this.backend);if(N.length<6)try{let O;N.length===5?O=N(o,r,c,d,A):O=N(o,r,c,d),O&&typeof O.then=="function"?O.then(R=>p(null,R)).catch(p):p(null,O)}catch(O){p(O)}else N(o,r,c,d,p,A)}!o||!o[0]||this.store.addResource(o[0],r,c,d)}}}const _h=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:s=>{let o={};if(typeof s[1]=="object"&&(o=s[1]),Se(s[1])&&(o.defaultValue=s[1]),Se(s[2])&&(o.tDescription=s[2]),typeof s[2]=="object"||typeof s[3]=="object"){const r=s[3]||s[2];Object.keys(r).forEach(c=>{o[c]=r[c]})}return o},interpolation:{escapeValue:!0,format:s=>s,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Hh=s=>{var o,r;return Se(s.ns)&&(s.ns=[s.ns]),Se(s.fallbackLng)&&(s.fallbackLng=[s.fallbackLng]),Se(s.fallbackNS)&&(s.fallbackNS=[s.fallbackNS]),((r=(o=s.supportedLngs)==null?void 0:o.indexOf)==null?void 0:r.call(o,"cimode"))<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),typeof s.initImmediate=="boolean"&&(s.initAsync=s.initImmediate),s},co=()=>{},W1=s=>{Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(r=>{typeof s[r]=="function"&&(s[r]=s[r].bind(s))})};class Ul extends wo{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Hh(o),this.services={},this.logger=ca,this.modules={external:[]},W1(this),r&&!this.isInitialized&&!o.isClone){if(!this.options.initAsync)return this.init(o,r),this;setTimeout(()=>{this.init(o,r)},0)}}init(){var o=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(c=r,r={}),r.defaultNS==null&&r.ns&&(Se(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const d=_h();this.options={...d,...this.options,...Hh(r)},this.options.interpolation={...d.interpolation,...this.options.interpolation},r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);const f=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?ca.init(f(this.modules.logger),this.options):ca.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=Z1;const j=new zh(this.options);this.store=new Rh(this.options.resources,this.options);const v=this.services;v.logger=ca,v.resourceStore=this.store,v.languageUtils=j,v.pluralResolver=new X1(j,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),y&&(!this.options.interpolation.format||this.options.interpolation.format===d.interpolation.format)&&(v.formatter=f(y),v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new Q1(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new I1(f(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",function(A){for(var N=arguments.length,O=new Array(N>1?N-1:0),R=1;R<N;R++)O[R-1]=arguments[R];o.emit(A,...O)}),this.modules.languageDetector&&(v.languageDetector=f(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=f(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new xo(this.services,this.options),this.translator.on("*",function(A){for(var N=arguments.length,O=new Array(N>1?N-1:0),R=1;R<N;R++)O[R-1]=arguments[R];o.emit(A,...O)}),this.modules.external.forEach(A=>{A.init&&A.init(this)})}if(this.format=this.options.interpolation.format,c||(c=co),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=Ol(),h=()=>{const y=(j,v)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),g.resolve(v),c(j,v)};if(this.languages&&!this.isInitialized)return y(null,this.t.bind(this));this.changeLanguage(this.options.lng,y)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),g}loadResources(o){var f,m;let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:co;const d=Se(o)?o:this.language;if(typeof o=="function"&&(c=o),!this.options.resources||this.options.partialBundledLanguages){if((d==null?void 0:d.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return c();const p=[],g=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(j=>{j!=="cimode"&&p.indexOf(j)<0&&p.push(j)})};d?g(d):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(y=>g(y)),(m=(f=this.options.preload)==null?void 0:f.forEach)==null||m.call(f,h=>g(h)),this.services.backendConnector.load(p,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),c(h)})}else c(null)}reloadResources(o,r,c){const d=Ol();return typeof o=="function"&&(c=o,o=void 0),typeof r=="function"&&(c=r,r=void 0),o||(o=this.languages),r||(r=this.options.ns),c||(c=co),this.services.backendConnector.reload(o,r,f=>{d.resolve(),c(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"&&Gg.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 r=0;r<this.languages.length;r++){const c=this.languages[r];if(!(["cimode","dev"].indexOf(c)>-1)&&this.store.hasLanguageSomeTranslations(c)){this.resolvedLanguage=c;break}}}changeLanguage(o,r){var c=this;this.isLanguageChangingTo=o;const d=Ol();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 c.t(...arguments)}),r&&r(g,function(){return c.t(...arguments)})},p=g=>{var y,j;!o&&!g&&this.services.languageDetector&&(g=[]);const h=Se(g)?g:this.services.languageUtils.getBestMatchFromCodes(g);h&&(this.language||f(h),this.translator.language||this.translator.changeLanguage(h),(j=(y=this.services.languageDetector)==null?void 0:y.cacheUserLanguage)==null||j.call(y,h)),this.loadResources(h,v=>{m(v,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,r,c){var d=this;const f=function(m,p){let g;if(typeof p!="object"){for(var h=arguments.length,y=new Array(h>2?h-2:0),j=2;j<h;j++)y[j-2]=arguments[j];g=d.options.overloadTranslationOptionHandler([m,p].concat(y))}else g={...p};g.lng=g.lng||f.lng,g.lngs=g.lngs||f.lngs,g.ns=g.ns||f.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||c||f.keyPrefix);const v=d.options.keySeparator||".";let A;return g.keyPrefix&&Array.isArray(m)?A=m.map(N=>`${g.keyPrefix}${v}${N}`):A=g.keyPrefix?`${g.keyPrefix}${v}${m}`:m,d.t(A,g)};return Se(o)?f.lng=o:f.lngs=o,f.ns=r,f.keyPrefix=c,f}t(){var d;for(var o=arguments.length,r=new Array(o),c=0;c<o;c++)r[c]=arguments[c];return(d=this.translator)==null?void 0:d.translate(...r)}exists(){var d;for(var o=arguments.length,r=new Array(o),c=0;c<o;c++)r[c]=arguments[c];return(d=this.translator)==null?void 0:d.exists(...r)}setDefaultNamespace(o){this.options.defaultNS=o}hasLoadedNamespace(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const c=r.lng||this.resolvedLanguage||this.languages[0],d=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(c.toLowerCase()==="cimode")return!0;const m=(p,g)=>{const h=this.services.backendConnector.state[`${p}|${g}`];return h===-1||h===0||h===2};if(r.precheck){const p=r.precheck(this,m);if(p!==void 0)return p}return!!(this.hasResourceBundle(c,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(c,o)&&(!d||m(f,o)))}loadNamespaces(o,r){const c=Ol();return this.options.ns?(Se(o)&&(o=[o]),o.forEach(d=>{this.options.ns.indexOf(d)<0&&this.options.ns.push(d)}),this.loadResources(d=>{c.resolve(),r&&r(d)}),c):(r&&r(),Promise.resolve())}loadLanguages(o,r){const c=Ol();Se(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=>{c.resolve(),r&&r(m)}),c):(r&&r(),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 r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],c=((f=this.services)==null?void 0:f.languageUtils)||new zh(_h());return r.indexOf(c.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Ul(o,r)}cloneInstance(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:co;const c=o.forkResourceStore;c&&delete o.forkResourceStore;const d={...this.options,...o,isClone:!0},f=new Ul(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)},c){const p=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},Object.keys(g[h]).reduce((y,j)=>(y[j]={...g[h][j]},y),{})),{});f.store=new Rh(p,d),f.services.resourceStore=f.store}return f.translator=new xo(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,r),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 xt=Ul.createInstance();xt.createInstance=Ul.createInstance;xt.createInstance;xt.dir;xt.init;xt.loadResources;xt.reloadResources;xt.use;xt.changeLanguage;xt.getFixedT;xt.t;xt.exists;xt.setDefaultNamespace;xt.hasLoadedNamespace;xt.loadNamespaces;xt.loadLanguages;const{slice:e2,forEach:t2}=[];function a2(s){return t2.call(e2.call(arguments,1),o=>{if(o)for(const r in o)s[r]===void 0&&(s[r]=o[r])}),s}function n2(s){return typeof s!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(r=>r.test(s))}const Bh=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,s2=function(s,o){const c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},d=encodeURIComponent(o);let f=`${s}=${d}`;if(c.maxAge>0){const m=c.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");f+=`; Max-Age=${Math.floor(m)}`}if(c.domain){if(!Bh.test(c.domain))throw new TypeError("option domain is invalid");f+=`; Domain=${c.domain}`}if(c.path){if(!Bh.test(c.path))throw new TypeError("option path is invalid");f+=`; Path=${c.path}`}if(c.expires){if(typeof c.expires.toUTCString!="function")throw new TypeError("option expires is invalid");f+=`; Expires=${c.expires.toUTCString()}`}if(c.httpOnly&&(f+="; HttpOnly"),c.secure&&(f+="; Secure"),c.sameSite)switch(typeof c.sameSite=="string"?c.sameSite.toLowerCase():c.sameSite){case!0:f+="; SameSite=Strict";break;case"lax":f+="; SameSite=Lax";break;case"strict":f+="; SameSite=Strict";break;case"none":f+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return c.partitioned&&(f+="; Partitioned"),f},Vh={create(s,o,r,c){let d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(d.expires=new Date,d.expires.setTime(d.expires.getTime()+r*60*1e3)),c&&(d.domain=c),document.cookie=s2(s,o,d)},read(s){const o=`${s}=`,r=document.cookie.split(";");for(let c=0;c<r.length;c++){let d=r[c];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(s,o){this.create(s,"",-1,o)}};var l2={name:"cookie",lookup(s){let{lookupCookie:o}=s;if(o&&typeof document<"u")return Vh.read(o)||void 0},cacheUserLanguage(s,o){let{lookupCookie:r,cookieMinutes:c,cookieDomain:d,cookieOptions:f}=o;r&&typeof document<"u"&&Vh.create(r,s,c,d,f)}},r2={name:"querystring",lookup(s){var c;let{lookupQuerystring:o}=s,r;if(typeof window<"u"){let{search:d}=window.location;!window.location.search&&((c=window.location.hash)==null?void 0:c.indexOf("?"))>-1&&(d=window.location.hash.substring(window.location.hash.indexOf("?")));const m=d.substring(1).split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===o&&(r=m[p].substring(g+1))}}return r}},o2={name:"hash",lookup(s){var d;let{lookupHash:o,lookupFromHashIndex:r}=s,c;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&&(c=p[g].substring(h+1))}}if(c)return c;if(!c&&r>-1){const p=f.match(/\/([a-zA-Z-]*)/g);return Array.isArray(p)?(d=p[typeof r=="number"?r:0])==null?void 0:d.replace("/",""):void 0}}}return c}};let ws=null;const qh=()=>{if(ws!==null)return ws;try{if(ws=typeof window<"u"&&window.localStorage!==null,!ws)return!1;const s="i18next.translate.boo";window.localStorage.setItem(s,"foo"),window.localStorage.removeItem(s)}catch{ws=!1}return ws};var i2={name:"localStorage",lookup(s){let{lookupLocalStorage:o}=s;if(o&&qh())return window.localStorage.getItem(o)||void 0},cacheUserLanguage(s,o){let{lookupLocalStorage:r}=o;r&&qh()&&window.localStorage.setItem(r,s)}};let js=null;const Gh=()=>{if(js!==null)return js;try{if(js=typeof window<"u"&&window.sessionStorage!==null,!js)return!1;const s="i18next.translate.boo";window.sessionStorage.setItem(s,"foo"),window.sessionStorage.removeItem(s)}catch{js=!1}return js};var c2={name:"sessionStorage",lookup(s){let{lookupSessionStorage:o}=s;if(o&&Gh())return window.sessionStorage.getItem(o)||void 0},cacheUserLanguage(s,o){let{lookupSessionStorage:r}=o;r&&Gh()&&window.sessionStorage.setItem(r,s)}},u2={name:"navigator",lookup(s){const o=[];if(typeof navigator<"u"){const{languages:r,userLanguage:c,language:d}=navigator;if(r)for(let f=0;f<r.length;f++)o.push(r[f]);c&&o.push(c),d&&o.push(d)}return o.length>0?o:void 0}},d2={name:"htmlTag",lookup(s){let{htmlTag:o}=s,r;const c=o||(typeof document<"u"?document.documentElement:null);return c&&typeof c.getAttribute=="function"&&(r=c.getAttribute("lang")),r}},f2={name:"path",lookup(s){var d;let{lookupFromPathIndex:o}=s;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?(d=r[typeof o=="number"?o:0])==null?void 0:d.replace("/",""):void 0}},m2={name:"subdomain",lookup(s){var d,f;let{lookupFromSubdomainIndex:o}=s;const r=typeof o=="number"?o+1:1,c=typeof window<"u"&&((f=(d=window.location)==null?void 0:d.hostname)==null?void 0:f.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(c)return c[r]}};let $g=!1;try{document.cookie,$g=!0}catch{}const Kg=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];$g||Kg.splice(1,1);const h2=()=>({order:Kg,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:s=>s});class Yg{constructor(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(o,r)}init(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=o,this.options=a2(r,this.options||{},h2()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=d=>d.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=c,this.addDetector(l2),this.addDetector(r2),this.addDetector(i2),this.addDetector(c2),this.addDetector(u2),this.addDetector(d2),this.addDetector(f2),this.addDetector(m2),this.addDetector(o2)}addDetector(o){return this.detectors[o.name]=o,this}detect(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return o.forEach(c=>{if(this.detectors[c]){let d=this.detectors[c].lookup(this.options);d&&typeof d=="string"&&(d=[d]),d&&(r=r.concat(d))}}),r=r.filter(c=>c!=null&&!n2(c)).map(c=>this.options.convertDetectedLanguage(c)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(o){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(o)>-1||r.forEach(c=>{this.detectors[c]&&this.detectors[c].cacheUserLanguage(o,this.options)}))}}Yg.type="languageDetector";const g2={title:"MCP Hub Dashboard",error:"Error",closeButton:"Close",noServers:"No MCP servers available",loading:"Loading...",logout:"Logout",profile:"Profile",changePassword:"Change Password",toggleSidebar:"Toggle Sidebar",welcomeUser:"Welcome, {{username}}",name:"MCP Hub"},p2={title:"About",versionInfo:"MCP Hub Version: {{version}}",newVersion:"New version available!",currentVersion:"Current version",newVersionAvailable:"New version {{version}} is available",viewOnGitHub:"View on GitHub",checkForUpdates:"Check for Updates",checking:"Checking for updates..."},x2={viewProfile:"View profile",userCenter:"User Center"},y2={label:"Sponsor",title:"Support the Project",rewardAlt:"Reward QR Code",supportMessage:"Support the development of MCP Hub by buying me a coffee!",supportButton:"Support on Ko-fi"},b2={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!"},w2={title:"Theme",light:"Light",dark:"Dark",system:"System"},j2={login:"Login",loginTitle:"Login to MCP Hub",username:"Username",password:"Password",loggingIn:"Logging in...",emptyFields:"Username and password cannot be empty",loginFailed:"Login failed, please check your username and password",loginError:"An error occurred during login",currentPassword:"Current Password",newPassword:"New Password",confirmPassword:"Confirm Password",passwordsNotMatch:"New password and confirmation do not match",changePasswordSuccess:"Password changed successfully",changePasswordError:"Failed to change password",changePassword:"Change Password",passwordChanged:"Password changed successfully",passwordChangeError:"Failed to change password"},S2={addServer:"Add Server",add:"Add",edit:"Edit",delete:"Delete",confirmDelete:"Are you sure you want to delete this server?",deleteWarning:"Deleting server '{{name}}' will remove it and all its data. This action cannot be undone.",status:"Status",tools:"Tools",name:"Server Name",url:"Server URL",apiKey:"API Key",save:"Save",cancel:"Cancel",invalidConfig:"Could not find configuration data for {{serverName}}",addError:"Failed to add server",editError:"Failed to edit server {{serverName}}",deleteError:"Failed to delete server {{serverName}}",updateError:"Failed to update server",editTitle:"Edit Server: {{serverName}}",type:"Server Type",command:"Command",arguments:"Arguments",envVars:"Environment Variables",headers:"HTTP Headers",key:"key",value:"value",enabled:"Enabled",enable:"Enable",disable:"Disable",requestOptions:"Configuration",timeout:"Request Timeout",timeoutDescription:"Timeout for requests to the MCP server (ms)",maxTotalTimeout:"Maximum Total Timeout",maxTotalTimeoutDescription:"Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications)",resetTimeoutOnProgress:"Reset Timeout on Progress",resetTimeoutOnProgressDescription:"Reset timeout on progress notifications",remove:"Remove",toggleError:"Failed to toggle server {{serverName}}",alreadyExists:"Server {{serverName}} already exists",invalidData:"Invalid server data provided",notFound:"Server {{serverName}} not found",namePlaceholder:"Enter server name",urlPlaceholder:"Enter server URL",commandPlaceholder:"Enter command",argumentsPlaceholder:"Enter arguments",errorDetails:"Error Details",viewErrorDetails:"View error details",confirmVariables:"Confirm Variable Configuration",variablesDetected:"Variables detected in configuration. Please confirm these variables are properly configured:",detectedVariables:"Detected Variables",confirmVariablesMessage:"Please ensure these variables are properly defined in your runtime environment. Continue adding server?",confirmAndAdd:"Confirm and Add",openapi:{inputMode:"Input Mode",inputModeUrl:"Specification URL",inputModeSchema:"JSON Schema",specUrl:"OpenAPI Specification URL",schema:"OpenAPI JSON Schema",schemaHelp:"Paste your complete OpenAPI JSON schema here",security:"Security Type",securityNone:"None",securityApiKey:"API Key",securityHttp:"HTTP Authentication",securityOAuth2:"OAuth 2.0",securityOpenIdConnect:"OpenID Connect",apiKeyConfig:"API Key Configuration",apiKeyName:"Header/Parameter Name",apiKeyIn:"Location",apiKeyValue:"API Key Value",httpAuthConfig:"HTTP Authentication Configuration",httpScheme:"Authentication Scheme",httpCredentials:"Credentials",oauth2Config:"OAuth 2.0 Configuration",oauth2Token:"Access Token",openIdConnectConfig:"OpenID Connect Configuration",openIdConnectUrl:"Discovery URL",openIdConnectToken:"ID Token"}},N2={online:"Online",offline:"Offline",connecting:"Connecting"},C2={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"},k2={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"},E2={dashboard:"Dashboard",servers:"Servers",groups:"Groups",users:"Users",settings:"Settings",changePassword:"Change Password",market:"Market",logs:"Logs"},T2={dashboard:{title:"Dashboard",totalServers:"Total",onlineServers:"Online",offlineServers:"Offline",connectingServers:"Connecting",recentServers:"Recent Servers"},servers:{title:"Servers Management"},groups:{title:"Group Management"},users:{title:"User Management"},settings:{title:"Settings",language:"Language",account:"Account Settings",password:"Change Password",appearance:"Appearance",routeConfig:"Security",installConfig:"Installation",smartRouting:"Smart Routing"},market:{title:"Server Market - (Data from mcpm.sh)"},logs:{title:"System Logs"}},A2={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"},R2={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"},O2={title:"Server Market",official:"Official",by:"By",unknown:"Unknown",tools:"tools",search:"Search",searchPlaceholder:"Search for servers by name, category, or tags",clearFilters:"Clear",clearCategoryFilter:"",clearTagFilter:"",categories:"Categories",tags:"Tags",showTags:"Show tags",hideTags:"Hide tags",moreTags:"",noServers:"No servers found matching your search",backToList:"Back to list",install:"Install",installing:"Installing...",installed:"Installed",installServer:"Install Server: {{name}}",installSuccess:"Server {{serverName}} installed successfully",author:"Author",license:"License",repository:"Repository",examples:"Examples",arguments:"Arguments",argumentName:"Name",description:"Description",required:"Required",example:"Example",viewSchema:"View schema",fetchError:"Error fetching market servers",serverNotFound:"Server not found",searchError:"Error searching servers",filterError:"Error filtering servers by category",tagFilterError:"Error filtering servers by tag",noInstallationMethod:"No installation method available for this server",showing:"Showing {{from}}-{{to}} of {{total}} servers",perPage:"Per page",confirmVariablesMessage:"Please ensure these variables are properly defined in your runtime environment. Continue installing server?",confirmAndInstall:"Confirm and Install"},M2={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}}"},z2={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}}"},D2={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"},U2={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."},L2={app:g2,about:p2,profile:x2,sponsor:y2,wechat:b2,discord:v2,theme:w2,auth:j2,server:S2,status:N2,errors:C2,common:k2,nav:E2,pages:T2,logs:A2,groups:R2,market:O2,tool:M2,settings:z2,dxt:D2,users:U2},_2={title:"MCP Hub 控制面板",error:"错误",closeButton:"关闭",noServers:"没有可用的 MCP 服务器",loading:"加载中...",logout:"退出登录",profile:"个人资料",changePassword:"修改密码",toggleSidebar:"切换侧边栏",welcomeUser:"欢迎, {{username}}",name:"MCP Hub"},H2={title:"关于",versionInfo:"MCP Hub 版本: {{version}}",newVersion:"有新版本可用!",currentVersion:"当前版本",newVersionAvailable:"新版本 {{version}} 已发布",viewOnGitHub:"在 GitHub 上查看",checkForUpdates:"检查更新",checking:"检查更新中..."},B2={viewProfile:"查看个人中心",userCenter:"个人中心"},V2={label:"赞助",title:"支持项目",rewardAlt:"赞赏码",supportMessage:"通过捐赠支持 MCP Hub 的开发!",supportButton:"在 Ko-fi 上支持"},q2={label:"微信",title:"微信联系",qrCodeAlt:"微信二维码",scanMessage:"扫描二维码添加微信"},G2={label:"Discord",title:"加入我们的 Discord 服务器",community:"加入我们不断壮大的 Discord 社区,获取支持、参与讨论并了解最新动态!"},$2={title:"主题",light:"浅色",dark:"深色",system:"系统"},K2={login:"登录",loginTitle:"登录 MCP Hub",username:"用户名",password:"密码",loggingIn:"登录中...",emptyFields:"用户名和密码不能为空",loginFailed:"登录失败,请检查用户名和密码",loginError:"登录过程中出现错误",currentPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认密码",passwordsNotMatch:"新密码与确认密码不一致",changePasswordSuccess:"密码修改成功",changePasswordError:"修改密码失败",changePassword:"修改密码",passwordChanged:"密码修改成功",passwordChangeError:"修改密码失败"},Y2={addServer:"添加服务器",add:"添加",edit:"编辑",delete:"删除",confirmDelete:"您确定要删除此服务器吗?",deleteWarning:"删除服务器 '{{name}}' 将会移除该服务器及其所有数据。此操作无法撤销。",status:"状态",tools:"工具",name:"服务器名称",url:"服务器 URL",apiKey:"API 密钥",save:"保存",cancel:"取消",addError:"添加服务器失败",editError:"编辑服务器 {{serverName}} 失败",invalidConfig:"无法找到 {{serverName}} 的配置数据",deleteError:"删除服务器 {{serverName}} 失败",updateError:"更新服务器失败",editTitle:"编辑服务器: {{serverName}}",type:"服务器类型",command:"命令",arguments:"参数",envVars:"环境变量",headers:"HTTP 请求头",key:"键",value:"值",enabled:"已启用",enable:"启用",disable:"禁用",requestOptions:"配置",timeout:"请求超时",timeoutDescription:"请求超时时间(毫秒)",maxTotalTimeout:"最大总超时",maxTotalTimeoutDescription:"无论是否有进度通知的最大总超时时间(毫秒)",resetTimeoutOnProgress:"收到进度通知时重置超时",resetTimeoutOnProgressDescription:"适用于发送周期性进度更新的长时间运行操作",remove:"移除",toggleError:"切换服务器 {{serverName}} 状态失败",alreadyExists:"服务器 {{serverName}} 已经存在",invalidData:"提供的服务器数据无效",notFound:"找不到服务器 {{serverName}}",namePlaceholder:"请输入服务器名称",urlPlaceholder:"请输入服务器URL",commandPlaceholder:"请输入命令",argumentsPlaceholder:"请输入参数",errorDetails:"错误详情",viewErrorDetails:"查看错误详情",confirmVariables:"确认变量配置",variablesDetected:"检测到配置中包含变量,请确认这些变量是否已正确配置:",detectedVariables:"检测到的变量",confirmVariablesMessage:"请确保这些变量在运行环境中已正确定义。是否继续添加服务器?",confirmAndAdd:"确认并添加",openapi:{inputMode:"输入模式",inputModeUrl:"规范 URL",inputModeSchema:"JSON 模式",specUrl:"OpenAPI 规范 URL",schema:"OpenAPI JSON 模式",schemaHelp:"请在此处粘贴完整的 OpenAPI JSON 模式",security:"安全类型",securityNone:"无",securityApiKey:"API 密钥",securityHttp:"HTTP 认证",securityOAuth2:"OAuth 2.0",securityOpenIdConnect:"OpenID Connect",apiKeyConfig:"API 密钥配置",apiKeyName:"请求头/参数名称",apiKeyIn:"位置",apiKeyValue:"API 密钥值",httpAuthConfig:"HTTP 认证配置",httpScheme:"认证方案",httpCredentials:"凭据",oauth2Config:"OAuth 2.0 配置",oauth2Token:"访问令牌",openIdConnectConfig:"OpenID Connect 配置",openIdConnectUrl:"发现 URL",openIdConnectToken:"ID 令牌"}},P2={online:"在线",offline:"离线",connecting:"连接中"},X2={general:"发生错误",network:"网络连接错误,请检查您的互联网连接",serverConnection:"无法连接到服务器,请检查服务器是否正在运行",serverAdd:"添加服务器失败,请检查服务器状态",serverUpdate:"编辑服务器 {{serverName}} 失败,请检查服务器状态",serverFetch:"获取服务器数据失败,请稍后重试",initialStartup:"服务器可能正在启动中。首次启动可能需要一些时间,请耐心等候...",serverInstall:"安装服务器失败",failedToFetchSettings:"获取设置失败",failedToUpdateSystemConfig:"更新系统配置失败",failedToUpdateRouteConfig:"更新路由配置失败",failedToUpdateSmartRoutingConfig:"更新智能路由配置失败"},Q2={processing:"处理中...",save:"保存",cancel:"取消",refresh:"刷新",create:"创建",creating:"创建中...",update:"更新",updating:"更新中...",submitting:"提交中...",delete:"删除",remove:"移除",copy:"复制",copyId:"复制ID",copyUrl:"复制URL",copyJson:"复制JSON",copySuccess:"已复制到剪贴板",copyFailed:"复制失败",close:"关闭",confirm:"确认",language:"语言"},F2={dashboard:"仪表盘",servers:"服务器",settings:"设置",changePassword:"修改密码",groups:"分组",users:"用户",market:"市场",logs:"日志"},Z2={dashboard:{title:"仪表盘",totalServers:"总数",onlineServers:"在线",offlineServers:"离线",connectingServers:"连接中",recentServers:"最近的服务器"},servers:{title:"服务器管理"},settings:{title:"设置",language:"语言",account:"账户设置",password:"修改密码",appearance:"外观",routeConfig:"安全配置",installConfig:"安装",smartRouting:"智能路由"},groups:{title:"分组管理"},users:{title:"用户管理"},market:{title:"服务器市场 - (数据来源于 mcpm.sh)"},logs:{title:"系统日志"}},J2={filters:"筛选",search:"搜索日志...",autoScroll:"自动滚动",clearLogs:"清除日志",loading:"加载日志中...",noLogs:"暂无日志。",noMatch:"没有匹配当前筛选条件的日志。",mainProcess:"主进程",childProcess:"子进程",main:"主",child:"子"},I2={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:"配置工具"},W2={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:"确认并安装"},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}}"},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}}"},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:"覆盖"},nw={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}}' 吗?此操作无法撤消。"},sw={app:_2,about:H2,profile:B2,sponsor:V2,wechat:q2,discord:G2,theme:$2,auth:K2,server:Y2,status:P2,errors:X2,common:Q2,nav:F2,pages:Z2,logs:J2,groups:I2,market:W2,tool:ew,settings:tw,dxt:aw,users:nw};xt.use(Yg).use(Mv).init({resources:{en:{translation:L2},zh:{translation:sw}},fallbackLng:"en",debug:!1,defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","cookie","htmlTag","navigator"],caches:["localStorage","cookie"]}});async function lw(){try{console.log("Loading runtime configuration...");const s=await Vy();console.log("Runtime configuration loaded:",s),window.__MCPHUB_CONFIG__=s,ch.createRoot(document.getElementById("root")).render(l.jsx(Ns.StrictMode,{children:l.jsx(Ch,{})}))}catch(s){console.error("Failed to initialize app:",s),console.log("Starting app with default configuration..."),window.__MCPHUB_CONFIG__={basePath:"",version:"dev",name:"mcphub"},ch.createRoot(document.getElementById("root")).render(l.jsx(Ns.StrictMode,{children:l.jsx(Ch,{})}))}}lw();
|
|
202
|
-
//# sourceMappingURL=index-Pdqvi7T6.js.map
|