@samanhappy/mcphub 0.9.0 → 0.9.2

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.
@@ -1,203 +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"]'))i(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function l(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(d){if(d.ep)return;d.ep=!0;const f=l(d);fetch(d.href,f)}})();function eg(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var qc={exports:{}},Os={};/**
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 uh;function fx(){if(uh)return Os;uh=1;var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function l(i,d,f){var m=null;if(f!==void 0&&(m=""+f),d.key!==void 0&&(m=""+d.key),"key"in d){f={};for(var p in d)p!=="key"&&(f[p]=d[p])}else f=d;return d=f.ref,{$$typeof:s,type:i,key:m,ref:d!==void 0?d:null,props:f}}return Os.Fragment=o,Os.jsx=l,Os.jsxs=l,Os}var dh;function mx(){return dh||(dh=1,qc.exports=fx()),qc.exports}var r=mx(),Pc={exports:{}},ke={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var fh;function hx(){if(fh)return ke;fh=1;var s=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),S=Symbol.iterator;function w(j){return j===null||typeof j!="object"?null:(j=S&&j[S]||j["@@iterator"],typeof j=="function"?j:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,k={};function R(j,I,le){this.props=j,this.context=I,this.refs=k,this.updater=le||A}R.prototype.isReactComponent={},R.prototype.setState=function(j,I){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,I,"setState")},R.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function N(){}N.prototype=R.prototype;function E(j,I,le){this.props=j,this.context=I,this.refs=k,this.updater=le||A}var U=E.prototype=new N;U.constructor=E,C(U,R.prototype),U.isPureReactComponent=!0;var X=Array.isArray,L={H:null,A:null,T:null,S:null,V:null},ee=Object.prototype.hasOwnProperty;function ae(j,I,le,B,V,me){return le=me.ref,{$$typeof:s,type:j,key:I,ref:le!==void 0?le:null,props:me}}function K(j,I){return ae(j.type,I,void 0,void 0,void 0,j.props)}function oe(j){return typeof j=="object"&&j!==null&&j.$$typeof===s}function de(j){var I={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(le){return I[le]})}var z=/\/+/g;function O(j,I){return typeof j=="object"&&j!==null&&j.key!=null?de(""+j.key):I.toString(36)}function J(){}function $(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(J,J):(j.status="pending",j.then(function(I){j.status==="pending"&&(j.status="fulfilled",j.value=I)},function(I){j.status==="pending"&&(j.status="rejected",j.reason=I)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function F(j,I,le,B,V){var me=typeof j;(me==="undefined"||me==="boolean")&&(j=null);var W=!1;if(j===null)W=!0;else switch(me){case"bigint":case"string":case"number":W=!0;break;case"object":switch(j.$$typeof){case s:case o:W=!0;break;case y:return W=j._init,F(W(j._payload),I,le,B,V)}}if(W)return V=V(j),W=B===""?"."+O(j,0):B,X(V)?(le="",W!=null&&(le=W.replace(z,"$&/")+"/"),F(V,I,le,"",function(be){return be})):V!=null&&(oe(V)&&(V=K(V,le+(V.key==null||j&&j.key===V.key?"":(""+V.key).replace(z,"$&/")+"/")+W)),I.push(V)),1;W=0;var Y=B===""?".":B+":";if(X(j))for(var ue=0;ue<j.length;ue++)B=j[ue],me=Y+O(B,ue),W+=F(B,I,le,me,V);else if(ue=w(j),typeof ue=="function")for(j=ue.call(j),ue=0;!(B=j.next()).done;)B=B.value,me=Y+O(B,ue++),W+=F(B,I,le,me,V);else if(me==="object"){if(typeof j.then=="function")return F($(j),I,le,B,V);throw I=String(j),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return W}function T(j,I,le){if(j==null)return j;var B=[],V=0;return F(j,B,"","",function(me){return I.call(le,me,V++)}),B}function q(j){if(j._status===-1){var I=j._result;I=I(),I.then(function(le){(j._status===0||j._status===-1)&&(j._status=1,j._result=le)},function(le){(j._status===0||j._status===-1)&&(j._status=2,j._result=le)}),j._status===-1&&(j._status=0,j._result=I)}if(j._status===1)return j._result.default;throw j._result}var Z=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)};function re(){}return ke.Children={map:T,forEach:function(j,I,le){T(j,function(){I.apply(this,arguments)},le)},count:function(j){var I=0;return T(j,function(){I++}),I},toArray:function(j){return T(j,function(I){return I})||[]},only:function(j){if(!oe(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},ke.Component=R,ke.Fragment=l,ke.Profiler=d,ke.PureComponent=E,ke.StrictMode=i,ke.Suspense=g,ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,ke.__COMPILER_RUNTIME={__proto__:null,c:function(j){return L.H.useMemoCache(j)}},ke.cache=function(j){return function(){return j.apply(null,arguments)}},ke.cloneElement=function(j,I,le){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var B=C({},j.props),V=j.key,me=void 0;if(I!=null)for(W in I.ref!==void 0&&(me=void 0),I.key!==void 0&&(V=""+I.key),I)!ee.call(I,W)||W==="key"||W==="__self"||W==="__source"||W==="ref"&&I.ref===void 0||(B[W]=I[W]);var W=arguments.length-2;if(W===1)B.children=le;else if(1<W){for(var Y=Array(W),ue=0;ue<W;ue++)Y[ue]=arguments[ue+2];B.children=Y}return ae(j.type,V,void 0,void 0,me,B)},ke.createContext=function(j){return j={$$typeof:m,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:f,_context:j},j},ke.createElement=function(j,I,le){var B,V={},me=null;if(I!=null)for(B in I.key!==void 0&&(me=""+I.key),I)ee.call(I,B)&&B!=="key"&&B!=="__self"&&B!=="__source"&&(V[B]=I[B]);var W=arguments.length-2;if(W===1)V.children=le;else if(1<W){for(var Y=Array(W),ue=0;ue<W;ue++)Y[ue]=arguments[ue+2];V.children=Y}if(j&&j.defaultProps)for(B in W=j.defaultProps,W)V[B]===void 0&&(V[B]=W[B]);return ae(j,me,void 0,void 0,null,V)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(j){return{$$typeof:p,render:j}},ke.isValidElement=oe,ke.lazy=function(j){return{$$typeof:y,_payload:{_status:-1,_result:j},_init:q}},ke.memo=function(j,I){return{$$typeof:h,type:j,compare:I===void 0?null:I}},ke.startTransition=function(j){var I=L.T,le={};L.T=le;try{var B=j(),V=L.S;V!==null&&V(le,B),typeof B=="object"&&B!==null&&typeof B.then=="function"&&B.then(re,Z)}catch(me){Z(me)}finally{L.T=I}},ke.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},ke.use=function(j){return L.H.use(j)},ke.useActionState=function(j,I,le){return L.H.useActionState(j,I,le)},ke.useCallback=function(j,I){return L.H.useCallback(j,I)},ke.useContext=function(j){return L.H.useContext(j)},ke.useDebugValue=function(){},ke.useDeferredValue=function(j,I){return L.H.useDeferredValue(j,I)},ke.useEffect=function(j,I,le){var B=L.H;if(typeof le=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return B.useEffect(j,I)},ke.useId=function(){return L.H.useId()},ke.useImperativeHandle=function(j,I,le){return L.H.useImperativeHandle(j,I,le)},ke.useInsertionEffect=function(j,I){return L.H.useInsertionEffect(j,I)},ke.useLayoutEffect=function(j,I){return L.H.useLayoutEffect(j,I)},ke.useMemo=function(j,I){return L.H.useMemo(j,I)},ke.useOptimistic=function(j,I){return L.H.useOptimistic(j,I)},ke.useReducer=function(j,I,le){return L.H.useReducer(j,I,le)},ke.useRef=function(j){return L.H.useRef(j)},ke.useState=function(j){return L.H.useState(j)},ke.useSyncExternalStore=function(j,I,le){return L.H.useSyncExternalStore(j,I,le)},ke.useTransition=function(){return L.H.useTransition()},ke.version="19.1.0",ke}var mh;function cu(){return mh||(mh=1,Pc.exports=hx()),Pc.exports}var b=cu();const Mr=eg(b);var Vc={exports:{}},zs={},Gc={exports:{}},Kc={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var hh;function gx(){return hh||(hh=1,function(s){function o(T,q){var Z=T.length;T.push(q);e:for(;0<Z;){var re=Z-1>>>1,j=T[re];if(0<d(j,q))T[re]=q,T[Z]=j,Z=re;else break e}}function l(T){return T.length===0?null:T[0]}function i(T){if(T.length===0)return null;var q=T[0],Z=T.pop();if(Z!==q){T[0]=Z;e:for(var re=0,j=T.length,I=j>>>1;re<I;){var le=2*(re+1)-1,B=T[le],V=le+1,me=T[V];if(0>d(B,Z))V<j&&0>d(me,B)?(T[re]=me,T[V]=Z,re=V):(T[re]=B,T[le]=Z,re=le);else if(V<j&&0>d(me,Z))T[re]=me,T[V]=Z,re=V;else break e}}return q}function d(T,q){var Z=T.sortIndex-q.sortIndex;return Z!==0?Z:T.id-q.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,S=null,w=3,A=!1,C=!1,k=!1,R=!1,N=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function X(T){for(var q=l(h);q!==null;){if(q.callback===null)i(h);else if(q.startTime<=T)i(h),q.sortIndex=q.expirationTime,o(g,q);else break;q=l(h)}}function L(T){if(k=!1,X(T),!C)if(l(g)!==null)C=!0,ee||(ee=!0,O());else{var q=l(h);q!==null&&F(L,q.startTime-T)}}var ee=!1,ae=-1,K=5,oe=-1;function de(){return R?!0:!(s.unstable_now()-oe<K)}function z(){if(R=!1,ee){var T=s.unstable_now();oe=T;var q=!0;try{e:{C=!1,k&&(k=!1,E(ae),ae=-1),A=!0;var Z=w;try{t:{for(X(T),S=l(g);S!==null&&!(S.expirationTime>T&&de());){var re=S.callback;if(typeof re=="function"){S.callback=null,w=S.priorityLevel;var j=re(S.expirationTime<=T);if(T=s.unstable_now(),typeof j=="function"){S.callback=j,X(T),q=!0;break t}S===l(g)&&i(g),X(T)}else i(g);S=l(g)}if(S!==null)q=!0;else{var I=l(h);I!==null&&F(L,I.startTime-T),q=!1}}break e}finally{S=null,w=Z,A=!1}q=void 0}}finally{q?O():ee=!1}}}var O;if(typeof U=="function")O=function(){U(z)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,$=J.port2;J.port1.onmessage=z,O=function(){$.postMessage(null)}}else O=function(){N(z,0)};function F(T,q){ae=N(function(){T(s.unstable_now())},q)}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(T){T.callback=null},s.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<T?Math.floor(1e3/T):5},s.unstable_getCurrentPriorityLevel=function(){return w},s.unstable_next=function(T){switch(w){case 1:case 2:case 3:var q=3;break;default:q=w}var Z=w;w=q;try{return T()}finally{w=Z}},s.unstable_requestPaint=function(){R=!0},s.unstable_runWithPriority=function(T,q){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var Z=w;w=T;try{return q()}finally{w=Z}},s.unstable_scheduleCallback=function(T,q,Z){var re=s.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?re+Z:re):Z=re,T){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=Z+j,T={id:y++,callback:q,priorityLevel:T,startTime:Z,expirationTime:j,sortIndex:-1},Z>re?(T.sortIndex=Z,o(h,T),l(g)===null&&T===l(h)&&(k?(E(ae),ae=-1):k=!0,F(L,Z-re))):(T.sortIndex=j,o(g,T),C||A||(C=!0,ee||(ee=!0,O()))),T},s.unstable_shouldYield=de,s.unstable_wrapCallback=function(T){var q=w;return function(){var Z=w;w=q;try{return T.apply(this,arguments)}finally{w=Z}}}}(Kc)),Kc}var gh;function px(){return gh||(gh=1,Gc.exports=gx()),Gc.exports}var $c={exports:{}},jt={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var ph;function xx(){if(ph)return jt;ph=1;var s=cu();function o(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var i={d:{f:l,r:function(){throw Error(o(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},d=Symbol.for("react.portal");function f(g,h,y){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:S==null?null:""+S,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 jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,jt.createPortal=function(g,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(o(299));return f(g,h,null,y)},jt.flushSync=function(g){var h=m.T,y=i.p;try{if(m.T=null,i.p=2,g)return g()}finally{m.T=h,i.p=y,i.d.f()}},jt.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(g,h))},jt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},jt.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var y=h.as,S=p(y,h.crossOrigin),w=typeof h.integrity=="string"?h.integrity:void 0,A=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?i.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:S,integrity:w,fetchPriority:A}):y==="script"&&i.d.X(g,{crossOrigin:S,integrity:w,fetchPriority:A,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},jt.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=p(h.as,h.crossOrigin);i.d.M(g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(g)},jt.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,S=p(y,h.crossOrigin);i.d.L(g,y,{crossOrigin:S,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},jt.preloadModule=function(g,h){if(typeof g=="string")if(h){var y=p(h.as,h.crossOrigin);i.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(g)},jt.requestFormReset=function(g){i.d.r(g)},jt.unstable_batchedUpdates=function(g,h){return g(h)},jt.useFormState=function(g,h,y){return m.H.useFormState(g,h,y)},jt.useFormStatus=function(){return m.H.useHostTransitionStatus()},jt.version="19.1.0",jt}var xh;function yx(){if(xh)return $c.exports;xh=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(),$c.exports=xx(),$c.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var yh;function bx(){if(yh)return zs;yh=1;var s=px(),o=cu(),l=yx();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(f(e)!==e)throw Error(i(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(i(188));return t!==e?null:e}for(var a=e,n=t;;){var c=a.return;if(c===null)break;var u=c.alternate;if(u===null){if(n=c.return,n!==null){a=n;continue}break}if(c.child===u.child){for(u=c.child;u;){if(u===a)return p(c),e;if(u===n)return p(c),t;u=u.sibling}throw Error(i(188))}if(a.return!==n.return)a=c,n=u;else{for(var x=!1,v=c.child;v;){if(v===a){x=!0,a=c,n=u;break}if(v===n){x=!0,n=c,a=u;break}v=v.sibling}if(!x){for(v=u.child;v;){if(v===a){x=!0,a=u,n=c;break}if(v===n){x=!0,n=u,a=c;break}v=v.sibling}if(!x)throw Error(i(189))}}if(a.alternate!==n)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?e:t}function h(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=h(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),E=Symbol.for("react.consumer"),U=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),ae=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),de=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function O(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var J=Symbol.for("react.client.reference");function $(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===J?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case R:return"Profiler";case k:return"StrictMode";case L:return"Suspense";case ee:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case U:return(e.displayName||"Context")+".Provider";case E:return(e._context.displayName||"Context")+".Consumer";case X:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return t=e.displayName||null,t!==null?t:$(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return $(e(t))}catch{}}return null}var F=Array.isArray,T=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},re=[],j=-1;function I(e){return{current:e}}function le(e){0>j||(e.current=re[j],re[j]=null,j--)}function B(e,t){j++,re[j]=e.current,e.current=t}var V=I(null),me=I(null),W=I(null),Y=I(null);function ue(e,t){switch(B(W,t),B(me,e),B(V,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Bm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Bm(t),e=Hm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}le(V),B(V,e)}function be(){le(V),le(me),le(W)}function je(e){e.memoizedState!==null&&B(Y,e);var t=V.current,a=Hm(t,e.type);t!==a&&(B(me,e),B(V,a))}function xe(e){me.current===e&&(le(V),le(me)),Y.current===e&&(le(Y),ks._currentValue=Z)}var Te=Object.prototype.hasOwnProperty,Be=s.unstable_scheduleCallback,st=s.unstable_cancelCallback,wa=s.unstable_shouldYield,ca=s.unstable_requestPaint,De=s.unstable_now,bt=s.unstable_getCurrentPriorityLevel,ua=s.unstable_ImmediatePriority,da=s.unstable_UserBlockingPriority,Gt=s.unstable_NormalPriority,fa=s.unstable_LowPriority,gn=s.unstable_IdlePriority,Ye=s.log,pn=s.unstable_setDisableYieldValue,Ot=null,lt=null;function kt(e){if(typeof Ye=="function"&&pn(e),lt&&typeof lt.setStrictMode=="function")try{lt.setStrictMode(Ot,e)}catch{}}var at=Math.clz32?Math.clz32:Bn,_n=Math.log,Ka=Math.LN2;function Bn(e){return e>>>=0,e===0?32:31-(_n(e)/Ka|0)|0}var zt=256,ja=4194304;function vt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Se(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var c=0,u=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var v=n&134217727;return v!==0?(n=v&~u,n!==0?c=vt(n):(x&=v,x!==0?c=vt(x):a||(a=v&~e,a!==0&&(c=vt(a))))):(v=n&~u,v!==0?c=vt(v):x!==0?c=vt(x):a||(a=n&~e,a!==0&&(c=vt(a)))),c===0?0:t!==0&&t!==c&&(t&u)===0&&(u=c&-c,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:c}function ie(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ce(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fe(){var e=zt;return zt<<=1,(zt&4194048)===0&&(zt=256),e}function dt(){var e=ja;return ja<<=1,(ja&62914560)===0&&(ja=4194304),e}function aa(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function na(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xn(e,t,a,n,c,u){var x=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var v=e.entanglements,M=e.expirationTimes,P=e.hiddenUpdates;for(a=x&~a;0<a;){var te=31-at(a),se=1<<te;v[te]=0,M[te]=-1;var G=P[te];if(G!==null)for(P[te]=null,te=0;te<G.length;te++){var Q=G[te];Q!==null&&(Q.lane&=-536870913)}a&=~se}n!==0&&Xs(e,n,0),u!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=u&~(x&~t))}function Xs(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-at(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&4194090}function Ut(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-at(a),c=1<<n;c&t|e[n]&t&&(e[n]|=t),a&=~c}}function ma(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Hn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function _r(){var e=q.p;return e!==0?e:(e=window.event,e===void 0?32:rh(e.type))}function Qs(e,t){var a=q.p;try{return q.p=e,t()}finally{q.p=a}}var ra=Math.random().toString(36).slice(2),ot="__reactFiber$"+ra,St="__reactProps$"+ra,qn="__reactContainer$"+ra,Oo="__reactEvents$"+ra,a0="__reactListeners$"+ra,n0="__reactHandles$"+ra,Cu="__reactResources$"+ra,Br="__reactMarker$"+ra;function zo(e){delete e[ot],delete e[St],delete e[Oo],delete e[a0],delete e[n0]}function Pn(e){var t=e[ot];if(t)return t;for(var a=e.parentNode;a;){if(t=a[qn]||a[ot]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Gm(e);e!==null;){if(a=e[ot])return a;e=Gm(e)}return t}e=a,a=e.parentNode}return null}function Vn(e){if(e=e[ot]||e[qn]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Hr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Gn(e){var t=e[Cu];return t||(t=e[Cu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ft(e){e[Br]=!0}var Eu=new Set,ku={};function yn(e,t){Kn(e,t),Kn(e+"Capture",t)}function Kn(e,t){for(ku[e]=t,e=0;e<t.length;e++)Eu.add(t[e])}var r0=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]*$"),Tu={},Au={};function s0(e){return Te.call(Au,e)?!0:Te.call(Tu,e)?!1:r0.test(e)?Au[e]=!0:(Tu[e]=!0,!1)}function Zs(e,t,a){if(s0(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 Is(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Na(e,t,a,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 Uo,Ru;function $n(e){if(Uo===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Uo=t&&t[1]||"",Ru=-1<a.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Uo+e+Ru}var Do=!1;function Lo(e,t){if(!e||Do)return"";Do=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(Q){var G=Q}Reflect.construct(e,[],se)}else{try{se.call()}catch(Q){G=Q}e.call(se.prototype)}}else{try{throw Error()}catch(Q){G=Q}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(Q){if(Q&&G&&typeof Q.stack=="string")return[Q.stack,G.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=n.DetermineComponentFrameRoot(),x=u[0],v=u[1];if(x&&v){var M=x.split(`
44
- `),P=v.split(`
45
- `);for(c=n=0;n<M.length&&!M[n].includes("DetermineComponentFrameRoot");)n++;for(;c<P.length&&!P[c].includes("DetermineComponentFrameRoot");)c++;if(n===M.length||c===P.length)for(n=M.length-1,c=P.length-1;1<=n&&0<=c&&M[n]!==P[c];)c--;for(;1<=n&&0<=c;n--,c--)if(M[n]!==P[c]){if(n!==1||c!==1)do if(n--,c--,0>c||M[n]!==P[c]){var te=`
46
- `+M[n].replace(" at new "," at ");return e.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",e.displayName)),te}while(1<=n&&0<=c);break}}}finally{Do=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?$n(a):""}function l0(e){switch(e.tag){case 26:case 27:case 5:return $n(e.type);case 16:return $n("Lazy");case 13:return $n("Suspense");case 19:return $n("SuspenseList");case 0:case 15:return Lo(e.type,!1);case 11:return Lo(e.type.render,!1);case 1:return Lo(e.type,!0);case 31:return $n("Activity");default:return""}}function Mu(e){try{var t="";do t+=l0(e),e=e.return;while(e);return t}catch(a){return`
47
- Error generating stack: `+a.message+`
48
- `+a.stack}}function Kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ou(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function o0(e){var t=Ou(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 c=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.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 Js(e){e._valueTracker||(e._valueTracker=o0(e))}function zu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Ou(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Ws(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 i0=/[\n"\\]/g;function $t(e){return e.replace(i0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function _o(e,t,a,n,c,u,x,v){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Kt(t)):e.value!==""+Kt(t)&&(e.value=""+Kt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?Bo(e,x,Kt(t)):a!=null?Bo(e,x,Kt(a)):n!=null&&e.removeAttribute("value"),c==null&&u!=null&&(e.defaultChecked=!!u),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+Kt(v):e.removeAttribute("name")}function Uu(e,t,a,n,c,u,x,v){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null))return;a=a!=null?""+Kt(a):"",t=t!=null?""+Kt(t):a,v||t===e.value||(e.value=t),e.defaultValue=t}n=n??c,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=v?e.checked:!!n,e.defaultChecked=!!n,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x)}function Bo(e,t,a){t==="number"&&Ws(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Yn(e,t,a,n){if(e=e.options,t){t={};for(var c=0;c<a.length;c++)t["$"+a[c]]=!0;for(a=0;a<e.length;a++)c=t.hasOwnProperty("$"+e[a].value),e[a].selected!==c&&(e[a].selected=c),c&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Kt(a),t=null,c=0;c<e.length;c++){if(e[c].value===a){e[c].selected=!0,n&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Du(e,t,a){if(t!=null&&(t=""+Kt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Kt(a):""}function Lu(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(i(92));if(F(n)){if(1<n.length)throw Error(i(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Kt(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n)}function Fn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var c0=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 _u(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||c0.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Bu(e,t,a){if(t!=null&&typeof t!="object")throw Error(i(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 c in t)n=t[c],t.hasOwnProperty(c)&&a[c]!==n&&_u(e,c,n)}else for(var u in t)t.hasOwnProperty(u)&&_u(e,u,t[u])}function Ho(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var u0=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"]]),d0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function el(e){return d0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var qo=null;function Po(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xn=null,Qn=null;function Hu(e){var t=Vn(e);if(t&&(e=t.stateNode)){var a=e[St]||null;e:switch(e=t.stateNode,t.type){case"input":if(_o(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+$t(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var c=n[St]||null;if(!c)throw Error(i(90));_o(n,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&zu(n)}break e;case"textarea":Du(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Yn(e,!!a.multiple,t,!1)}}}var Vo=!1;function qu(e,t,a){if(Vo)return e(t,a);Vo=!0;try{var n=e(t);return n}finally{if(Vo=!1,(Xn!==null||Qn!==null)&&(Hl(),Xn&&(t=Xn,e=Qn,Qn=Xn=null,Hu(t),e)))for(t=0;t<e.length;t++)Hu(e[t])}}function qr(e,t){var a=e.stateNode;if(a===null)return null;var n=a[St]||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(i(231,t,typeof a));return a}var Sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Go=!1;if(Sa)try{var Pr={};Object.defineProperty(Pr,"passive",{get:function(){Go=!0}}),window.addEventListener("test",Pr,Pr),window.removeEventListener("test",Pr,Pr)}catch{Go=!1}var $a=null,Ko=null,tl=null;function Pu(){if(tl)return tl;var e,t=Ko,a=t.length,n,c="value"in $a?$a.value:$a.textContent,u=c.length;for(e=0;e<a&&t[e]===c[e];e++);var x=a-e;for(n=1;n<=x&&t[a-n]===c[u-n];n++);return tl=c.slice(e,1<n?1-n:void 0)}function al(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function nl(){return!0}function Vu(){return!1}function Tt(e){function t(a,n,c,u,x){this._reactName=a,this._targetInst=c,this.type=n,this.nativeEvent=u,this.target=x,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(a=e[v],this[v]=a?a(u):u[v]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?nl:Vu,this.isPropagationStopped=Vu,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=nl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=nl)},persist:function(){},isPersistent:nl}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rl=Tt(bn),Vr=y({},bn,{view:0,detail:0}),f0=Tt(Vr),$o,Yo,Gr,sl=y({},Vr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Gr&&(Gr&&e.type==="mousemove"?($o=e.screenX-Gr.screenX,Yo=e.screenY-Gr.screenY):Yo=$o=0,Gr=e),$o)},movementY:function(e){return"movementY"in e?e.movementY:Yo}}),Gu=Tt(sl),m0=y({},sl,{dataTransfer:0}),h0=Tt(m0),g0=y({},Vr,{relatedTarget:0}),Fo=Tt(g0),p0=y({},bn,{animationName:0,elapsedTime:0,pseudoElement:0}),x0=Tt(p0),y0=y({},bn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),b0=Tt(y0),v0=y({},bn,{data:0}),Ku=Tt(v0),w0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j0={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"},N0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function S0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=N0[e])?!!t[e]:!1}function Xo(){return S0}var C0=y({},Vr,{key:function(e){if(e.key){var t=w0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=al(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?j0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xo,charCode:function(e){return e.type==="keypress"?al(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?al(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),E0=Tt(C0),k0=y({},sl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$u=Tt(k0),T0=y({},Vr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xo}),A0=Tt(T0),R0=y({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0}),M0=Tt(R0),O0=y({},sl,{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}),z0=Tt(O0),U0=y({},bn,{newState:0,oldState:0}),D0=Tt(U0),L0=[9,13,27,32],Qo=Sa&&"CompositionEvent"in window,Kr=null;Sa&&"documentMode"in document&&(Kr=document.documentMode);var _0=Sa&&"TextEvent"in window&&!Kr,Yu=Sa&&(!Qo||Kr&&8<Kr&&11>=Kr),Fu=" ",Xu=!1;function Qu(e,t){switch(e){case"keyup":return L0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zn=!1;function B0(e,t){switch(e){case"compositionend":return Zu(t);case"keypress":return t.which!==32?null:(Xu=!0,Fu);case"textInput":return e=t.data,e===Fu&&Xu?null:e;default:return null}}function H0(e,t){if(Zn)return e==="compositionend"||!Qo&&Qu(e,t)?(e=Pu(),tl=Ko=$a=null,Zn=!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 Yu&&t.locale!=="ko"?null:t.data;default:return null}}var q0={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 Iu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!q0[e.type]:t==="textarea"}function Ju(e,t,a,n){Xn?Qn?Qn.push(n):Qn=[n]:Xn=n,t=$l(t,"onChange"),0<t.length&&(a=new rl("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var $r=null,Yr=null;function P0(e){zm(e,0)}function ll(e){var t=Hr(e);if(zu(t))return e}function Wu(e,t){if(e==="change")return t}var ed=!1;if(Sa){var Zo;if(Sa){var Io="oninput"in document;if(!Io){var td=document.createElement("div");td.setAttribute("oninput","return;"),Io=typeof td.oninput=="function"}Zo=Io}else Zo=!1;ed=Zo&&(!document.documentMode||9<document.documentMode)}function ad(){$r&&($r.detachEvent("onpropertychange",nd),Yr=$r=null)}function nd(e){if(e.propertyName==="value"&&ll(Yr)){var t=[];Ju(t,Yr,e,Po(e)),qu(P0,t)}}function V0(e,t,a){e==="focusin"?(ad(),$r=t,Yr=a,$r.attachEvent("onpropertychange",nd)):e==="focusout"&&ad()}function G0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ll(Yr)}function K0(e,t){if(e==="click")return ll(t)}function $0(e,t){if(e==="input"||e==="change")return ll(t)}function Y0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dt=typeof Object.is=="function"?Object.is:Y0;function Fr(e,t){if(Dt(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 c=a[n];if(!Te.call(t,c)||!Dt(e[c],t[c]))return!1}return!0}function rd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sd(e,t){var a=rd(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=rd(a)}}function ld(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ld(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function od(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ws(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=Ws(e.document)}return t}function Jo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var F0=Sa&&"documentMode"in document&&11>=document.documentMode,In=null,Wo=null,Xr=null,ei=!1;function id(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ei||In==null||In!==Ws(n)||(n=In,"selectionStart"in n&&Jo(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}),Xr&&Fr(Xr,n)||(Xr=n,n=$l(Wo,"onSelect"),0<n.length&&(t=new rl("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=In)))}function vn(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Jn={animationend:vn("Animation","AnimationEnd"),animationiteration:vn("Animation","AnimationIteration"),animationstart:vn("Animation","AnimationStart"),transitionrun:vn("Transition","TransitionRun"),transitionstart:vn("Transition","TransitionStart"),transitioncancel:vn("Transition","TransitionCancel"),transitionend:vn("Transition","TransitionEnd")},ti={},cd={};Sa&&(cd=document.createElement("div").style,"AnimationEvent"in window||(delete Jn.animationend.animation,delete Jn.animationiteration.animation,delete Jn.animationstart.animation),"TransitionEvent"in window||delete Jn.transitionend.transition);function wn(e){if(ti[e])return ti[e];if(!Jn[e])return e;var t=Jn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in cd)return ti[e]=t[a];return e}var ud=wn("animationend"),dd=wn("animationiteration"),fd=wn("animationstart"),X0=wn("transitionrun"),Q0=wn("transitionstart"),Z0=wn("transitioncancel"),md=wn("transitionend"),hd=new Map,ai="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ai.push("scrollEnd");function sa(e,t){hd.set(e,t),yn(t,[e])}var gd=new WeakMap;function Yt(e,t){if(typeof e=="object"&&e!==null){var a=gd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Mu(t)},gd.set(e,t),t)}return{value:e,source:t,stack:Mu(t)}}var Ft=[],Wn=0,ni=0;function ol(){for(var e=Wn,t=ni=Wn=0;t<e;){var a=Ft[t];Ft[t++]=null;var n=Ft[t];Ft[t++]=null;var c=Ft[t];Ft[t++]=null;var u=Ft[t];if(Ft[t++]=null,n!==null&&c!==null){var x=n.pending;x===null?c.next=c:(c.next=x.next,x.next=c),n.pending=c}u!==0&&pd(a,c,u)}}function il(e,t,a,n){Ft[Wn++]=e,Ft[Wn++]=t,Ft[Wn++]=a,Ft[Wn++]=n,ni|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function ri(e,t,a,n){return il(e,t,a,n),cl(e)}function er(e,t){return il(e,null,null,t),cl(e)}function pd(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var c=!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||(c=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,c&&t!==null&&(c=31-at(a),e=u.hiddenUpdates,n=e[c],n===null?e[c]=[t]:n.push(t),t.lane=a|536870912),u):null}function cl(e){if(50<bs)throw bs=0,uc=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var tr={};function I0(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 Lt(e,t,a,n){return new I0(e,t,a,n)}function si(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ca(e,t){var a=e.alternate;return a===null?(a=Lt(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 xd(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ul(e,t,a,n,c,u){var x=0;if(n=e,typeof e=="function")si(e)&&(x=1);else if(typeof e=="string")x=Wp(e,a,V.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case oe:return e=Lt(31,a,t,c),e.elementType=oe,e.lanes=u,e;case C:return jn(a.children,c,u,t);case k:x=8,c|=24;break;case R:return e=Lt(12,a,t,c|2),e.elementType=R,e.lanes=u,e;case L:return e=Lt(13,a,t,c),e.elementType=L,e.lanes=u,e;case ee:return e=Lt(19,a,t,c),e.elementType=ee,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:case U:x=10;break e;case E:x=9;break e;case X:x=11;break e;case ae:x=14;break e;case K:x=16,n=null;break e}x=29,a=Error(i(130,e===null?"null":typeof e,"")),n=null}return t=Lt(x,a,t,c),t.elementType=e,t.type=n,t.lanes=u,t}function jn(e,t,a,n){return e=Lt(7,e,n,t),e.lanes=a,e}function li(e,t,a){return e=Lt(6,e,null,t),e.lanes=a,e}function oi(e,t,a){return t=Lt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ar=[],nr=0,dl=null,fl=0,Xt=[],Qt=0,Nn=null,Ea=1,ka="";function Sn(e,t){ar[nr++]=fl,ar[nr++]=dl,dl=e,fl=t}function yd(e,t,a){Xt[Qt++]=Ea,Xt[Qt++]=ka,Xt[Qt++]=Nn,Nn=e;var n=Ea;e=ka;var c=32-at(n)-1;n&=~(1<<c),a+=1;var u=32-at(t)+c;if(30<u){var x=c-c%5;u=(n&(1<<x)-1).toString(32),n>>=x,c-=x,Ea=1<<32-at(t)+c|a<<c|n,ka=u+e}else Ea=1<<u|a<<c|n,ka=e}function ii(e){e.return!==null&&(Sn(e,1),yd(e,1,0))}function ci(e){for(;e===dl;)dl=ar[--nr],ar[nr]=null,fl=ar[--nr],ar[nr]=null;for(;e===Nn;)Nn=Xt[--Qt],Xt[Qt]=null,ka=Xt[--Qt],Xt[Qt]=null,Ea=Xt[--Qt],Xt[Qt]=null}var Ct=null,Ie=null,_e=!1,Cn=null,ha=!1,ui=Error(i(519));function En(e){var t=Error(i(418,""));throw Ir(Yt(t,e)),ui}function bd(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[ot]=e,t[St]=n,a){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(a=0;a<ws.length;a++)ze(ws[a],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),Uu(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0),Js(t);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),Lu(t,n.value,n.defaultValue,n.children),Js(t)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||_m(t.textContent,a)?(n.popover!=null&&(ze("beforetoggle",t),ze("toggle",t)),n.onScroll!=null&&ze("scroll",t),n.onScrollEnd!=null&&ze("scrollend",t),n.onClick!=null&&(t.onclick=Yl),t=!0):t=!1,t||En(e)}function vd(e){for(Ct=e.return;Ct;)switch(Ct.tag){case 5:case 13:ha=!1;return;case 27:case 3:ha=!0;return;default:Ct=Ct.return}}function Qr(e){if(e!==Ct)return!1;if(!_e)return vd(e),_e=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Ec(e.type,e.memoizedProps)),a=!a),a&&Ie&&En(e),vd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(a=e.data,a==="/$"){if(t===0){Ie=oa(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++;e=e.nextSibling}Ie=null}}else t===27?(t=Ie,on(e.type)?(e=Rc,Rc=null,Ie=e):Ie=t):Ie=Ct?oa(e.stateNode.nextSibling):null;return!0}function Zr(){Ie=Ct=null,_e=!1}function wd(){var e=Cn;return e!==null&&(Mt===null?Mt=e:Mt.push.apply(Mt,e),Cn=null),e}function Ir(e){Cn===null?Cn=[e]:Cn.push(e)}var di=I(null),kn=null,Ta=null;function Ya(e,t,a){B(di,t._currentValue),t._currentValue=a}function Aa(e){e._currentValue=di.current,le(di)}function fi(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 mi(e,t,a,n){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var u=c.dependencies;if(u!==null){var x=c.child;u=u.firstContext;e:for(;u!==null;){var v=u;u=c;for(var M=0;M<t.length;M++)if(v.context===t[M]){u.lanes|=a,v=u.alternate,v!==null&&(v.lanes|=a),fi(u.return,a,e),n||(x=null);break e}u=v.next}}else if(c.tag===18){if(x=c.return,x===null)throw Error(i(341));x.lanes|=a,u=x.alternate,u!==null&&(u.lanes|=a),fi(x,a,e),x=null}else x=c.child;if(x!==null)x.return=c;else for(x=c;x!==null;){if(x===e){x=null;break}if(c=x.sibling,c!==null){c.return=x.return,x=c;break}x=x.return}c=x}}function Jr(e,t,a,n){e=null;for(var c=t,u=!1;c!==null;){if(!u){if((c.flags&524288)!==0)u=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var x=c.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var v=c.type;Dt(c.pendingProps.value,x.value)||(e!==null?e.push(v):e=[v])}}else if(c===Y.current){if(x=c.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ks):e=[ks])}c=c.return}e!==null&&mi(t,e,a,n),t.flags|=262144}function ml(e){for(e=e.firstContext;e!==null;){if(!Dt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Tn(e){kn=e,Ta=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function wt(e){return jd(kn,e)}function hl(e,t){return kn===null&&Tn(e),jd(e,t)}function jd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Ta===null){if(e===null)throw Error(i(308));Ta=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ta=Ta.next=t;return a}var J0=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()})}},W0=s.unstable_scheduleCallback,ep=s.unstable_NormalPriority,it={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hi(){return{controller:new J0,data:new Map,refCount:0}}function Wr(e){e.refCount--,e.refCount===0&&W0(ep,function(){e.controller.abort()})}var es=null,gi=0,rr=0,sr=null;function tp(e,t){if(es===null){var a=es=[];gi=0,rr=xc(),sr={status:"pending",value:void 0,then:function(n){a.push(n)}}}return gi++,t.then(Nd,Nd),t}function Nd(){if(--gi===0&&es!==null){sr!==null&&(sr.status="fulfilled");var e=es;es=null,rr=0,sr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ap(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(c){a.push(c)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var c=0;c<a.length;c++)(0,a[c])(t)},function(c){for(n.status="rejected",n.reason=c,c=0;c<a.length;c++)(0,a[c])(void 0)}),n}var Sd=T.S;T.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&tp(e,t),Sd!==null&&Sd(e,t)};var An=I(null);function pi(){var e=An.current;return e!==null?e:$e.pooledCache}function gl(e,t){t===null?B(An,An.current):B(An,t.pool)}function Cd(){var e=pi();return e===null?null:{parent:it._currentValue,pool:e}}var ts=Error(i(460)),Ed=Error(i(474)),pl=Error(i(542)),xi={then:function(){}};function kd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xl(){}function Td(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(xl,xl),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rd(e),e;default:if(typeof t.status=="string")t.then(xl,xl);else{if(e=$e,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=n}},function(n){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rd(e),e}throw as=t,ts}}var as=null;function Ad(){if(as===null)throw Error(i(459));var e=as;return as=null,e}function Rd(e){if(e===ts||e===pl)throw Error(i(483))}var Fa=!1;function yi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Xa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(He&2)!==0){var c=n.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),n.pending=t,t=cl(e),pd(e,null,a),t}return il(e,n,t,a),cl(e)}function ns(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,Ut(e,a)}}function vi(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var c=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var x={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?c=u=x:u=u.next=x,a=a.next}while(a!==null);u===null?c=u=t:u=u.next=t}else c=u=t;a={baseState:n.baseState,firstBaseUpdate:c,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 wi=!1;function rs(){if(wi){var e=sr;if(e!==null)throw e}}function ss(e,t,a,n){wi=!1;var c=e.updateQueue;Fa=!1;var u=c.firstBaseUpdate,x=c.lastBaseUpdate,v=c.shared.pending;if(v!==null){c.shared.pending=null;var M=v,P=M.next;M.next=null,x===null?u=P:x.next=P,x=M;var te=e.alternate;te!==null&&(te=te.updateQueue,v=te.lastBaseUpdate,v!==x&&(v===null?te.firstBaseUpdate=P:v.next=P,te.lastBaseUpdate=M))}if(u!==null){var se=c.baseState;x=0,te=P=M=null,v=u;do{var G=v.lane&-536870913,Q=G!==v.lane;if(Q?(Ue&G)===G:(n&G)===G){G!==0&&G===rr&&(wi=!0),te!==null&&(te=te.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var Ne=e,ve=v;G=t;var Ge=a;switch(ve.tag){case 1:if(Ne=ve.payload,typeof Ne=="function"){se=Ne.call(Ge,se,G);break e}se=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=ve.payload,G=typeof Ne=="function"?Ne.call(Ge,se,G):Ne,G==null)break e;se=y({},se,G);break e;case 2:Fa=!0}}G=v.callback,G!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=c.callbacks,Q===null?c.callbacks=[G]:Q.push(G))}else Q={lane:G,tag:v.tag,payload:v.payload,callback:v.callback,next:null},te===null?(P=te=Q,M=se):te=te.next=Q,x|=G;if(v=v.next,v===null){if(v=c.shared.pending,v===null)break;Q=v,v=Q.next,Q.next=null,c.lastBaseUpdate=Q,c.shared.pending=null}}while(!0);te===null&&(M=se),c.baseState=M,c.firstBaseUpdate=P,c.lastBaseUpdate=te,u===null&&(c.shared.lanes=0),nn|=x,e.lanes=x,e.memoizedState=se}}function Md(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function Od(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Md(a[e],t)}var lr=I(null),yl=I(0);function zd(e,t){e=La,B(yl,e),B(lr,t),La=e|t.baseLanes}function ji(){B(yl,La),B(lr,lr.current)}function Ni(){La=yl.current,le(lr),le(yl)}var Za=0,Ae=null,Pe=null,nt=null,bl=!1,or=!1,Rn=!1,vl=0,ls=0,ir=null,np=0;function et(){throw Error(i(321))}function Si(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Dt(e[a],t[a]))return!1;return!0}function Ci(e,t,a,n,c,u){return Za=u,Ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,T.H=e===null||e.memoizedState===null?xf:yf,Rn=!1,u=a(n,c),Rn=!1,or&&(u=Dd(t,a,n,c)),Ud(e),u}function Ud(e){T.H=El;var t=Pe!==null&&Pe.next!==null;if(Za=0,nt=Pe=Ae=null,bl=!1,ls=0,ir=null,t)throw Error(i(300));e===null||mt||(e=e.dependencies,e!==null&&ml(e)&&(mt=!0))}function Dd(e,t,a,n){Ae=e;var c=0;do{if(or&&(ir=null),ls=0,or=!1,25<=c)throw Error(i(301));if(c+=1,nt=Pe=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}T.H=up,u=t(a,n)}while(or);return u}function rp(){var e=T.H,t=e.useState()[0];return t=typeof t.then=="function"?os(t):t,e=e.useState()[0],(Pe!==null?Pe.memoizedState:null)!==e&&(Ae.flags|=1024),t}function Ei(){var e=vl!==0;return vl=0,e}function ki(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Ti(e){if(bl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}bl=!1}Za=0,nt=Pe=Ae=null,or=!1,ls=vl=0,ir=null}function At(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nt===null?Ae.memoizedState=nt=e:nt=nt.next=e,nt}function rt(){if(Pe===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=Pe.next;var t=nt===null?Ae.memoizedState:nt.next;if(t!==null)nt=t,Pe=e;else{if(e===null)throw Ae.alternate===null?Error(i(467)):Error(i(310));Pe=e,e={memoizedState:Pe.memoizedState,baseState:Pe.baseState,baseQueue:Pe.baseQueue,queue:Pe.queue,next:null},nt===null?Ae.memoizedState=nt=e:nt=nt.next=e}return nt}function Ai(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function os(e){var t=ls;return ls+=1,ir===null&&(ir=[]),e=Td(ir,e,t),t=Ae,(nt===null?t.memoizedState:nt.next)===null&&(t=t.alternate,T.H=t===null||t.memoizedState===null?xf:yf),e}function wl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return os(e);if(e.$$typeof===U)return wt(e)}throw Error(i(438,String(e)))}function Ri(e){var t=null,a=Ae.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Ae.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ai(),Ae.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=de;return t.index++,a}function Ra(e,t){return typeof t=="function"?t(e):t}function jl(e){var t=rt();return Mi(t,Pe,e)}function Mi(e,t,a){var n=e.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=a;var c=e.baseQueue,u=n.pending;if(u!==null){if(c!==null){var x=c.next;c.next=u.next,u.next=x}t.baseQueue=c=u,n.pending=null}if(u=e.baseState,c===null)e.memoizedState=u;else{t=c.next;var v=x=null,M=null,P=t,te=!1;do{var se=P.lane&-536870913;if(se!==P.lane?(Ue&se)===se:(Za&se)===se){var G=P.revertLane;if(G===0)M!==null&&(M=M.next={lane:0,revertLane:0,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),se===rr&&(te=!0);else if((Za&G)===G){P=P.next,G===rr&&(te=!0);continue}else se={lane:0,revertLane:P.revertLane,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},M===null?(v=M=se,x=u):M=M.next=se,Ae.lanes|=G,nn|=G;se=P.action,Rn&&a(u,se),u=P.hasEagerState?P.eagerState:a(u,se)}else G={lane:se,revertLane:P.revertLane,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},M===null?(v=M=G,x=u):M=M.next=G,Ae.lanes|=se,nn|=se;P=P.next}while(P!==null&&P!==t);if(M===null?x=u:M.next=v,!Dt(u,e.memoizedState)&&(mt=!0,te&&(a=sr,a!==null)))throw a;e.memoizedState=u,e.baseState=x,e.baseQueue=M,n.lastRenderedState=u}return c===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Oi(e){var t=rt(),a=t.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=e;var n=a.dispatch,c=a.pending,u=t.memoizedState;if(c!==null){a.pending=null;var x=c=c.next;do u=e(u,x.action),x=x.next;while(x!==c);Dt(u,t.memoizedState)||(mt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),a.lastRenderedState=u}return[u,n]}function Ld(e,t,a){var n=Ae,c=rt(),u=_e;if(u){if(a===void 0)throw Error(i(407));a=a()}else a=t();var x=!Dt((Pe||c).memoizedState,a);x&&(c.memoizedState=a,mt=!0),c=c.queue;var v=Hd.bind(null,n,c,e);if(is(2048,8,v,[e]),c.getSnapshot!==t||x||nt!==null&&nt.memoizedState.tag&1){if(n.flags|=2048,cr(9,Nl(),Bd.bind(null,n,c,a,t),null),$e===null)throw Error(i(349));u||(Za&124)!==0||_d(n,t,a)}return a}function _d(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ae.updateQueue,t===null?(t=Ai(),Ae.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Bd(e,t,a,n){t.value=a,t.getSnapshot=n,qd(t)&&Pd(e)}function Hd(e,t,a){return a(function(){qd(t)&&Pd(e)})}function qd(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Dt(e,a)}catch{return!0}}function Pd(e){var t=er(e,2);t!==null&&Pt(t,e,2)}function zi(e){var t=At();if(typeof e=="function"){var a=e;if(e=a(),Rn){kt(!0);try{a()}finally{kt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:e},t}function Vd(e,t,a,n){return e.baseState=a,Mi(e,Pe,typeof n=="function"?n:Ra)}function sp(e,t,a,n,c){if(Cl(e))throw Error(i(485));if(e=t.action,e!==null){var u={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){u.listeners.push(x)}};T.T!==null?a(!0):u.isTransition=!1,n(u),a=t.pending,a===null?(u.next=t.pending=u,Gd(t,u)):(u.next=a.next,t.pending=a.next=u)}}function Gd(e,t){var a=t.action,n=t.payload,c=e.state;if(t.isTransition){var u=T.T,x={};T.T=x;try{var v=a(c,n),M=T.S;M!==null&&M(x,v),Kd(e,t,v)}catch(P){Ui(e,t,P)}finally{T.T=u}}else try{u=a(c,n),Kd(e,t,u)}catch(P){Ui(e,t,P)}}function Kd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){$d(e,t,n)},function(n){return Ui(e,t,n)}):$d(e,t,a)}function $d(e,t,a){t.status="fulfilled",t.value=a,Yd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Gd(e,a)))}function Ui(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,Yd(t),t=t.next;while(t!==n)}e.action=null}function Yd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fd(e,t){return t}function Xd(e,t){if(_e){var a=$e.formState;if(a!==null){e:{var n=Ae;if(_e){if(Ie){t:{for(var c=Ie,u=ha;c.nodeType!==8;){if(!u){c=null;break t}if(c=oa(c.nextSibling),c===null){c=null;break t}}u=c.data,c=u==="F!"||u==="F"?c:null}if(c){Ie=oa(c.nextSibling),n=c.data==="F!";break e}}En(n)}n=!1}n&&(t=a[0])}}return a=At(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fd,lastRenderedState:t},a.queue=n,a=hf.bind(null,Ae,n),n.dispatch=a,n=zi(!1),u=Hi.bind(null,Ae,!1,n.queue),n=At(),c={state:t,dispatch:null,action:e,pending:null},n.queue=c,a=sp.bind(null,Ae,c,u,a),c.dispatch=a,n.memoizedState=e,[t,a,!1]}function Qd(e){var t=rt();return Zd(t,Pe,e)}function Zd(e,t,a){if(t=Mi(e,t,Fd)[0],e=jl(Ra)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=os(t)}catch(x){throw x===ts?pl:x}else n=t;t=rt();var c=t.queue,u=c.dispatch;return a!==t.memoizedState&&(Ae.flags|=2048,cr(9,Nl(),lp.bind(null,c,a),null)),[n,u,e]}function lp(e,t){e.action=t}function Id(e){var t=rt(),a=Pe;if(a!==null)return Zd(t,a,e);rt(),t=t.memoizedState,a=rt();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function cr(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Ae.updateQueue,t===null&&(t=Ai(),Ae.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 Nl(){return{destroy:void 0,resource:void 0}}function Jd(){return rt().memoizedState}function Sl(e,t,a,n){var c=At();n=n===void 0?null:n,Ae.flags|=e,c.memoizedState=cr(1|t,Nl(),a,n)}function is(e,t,a,n){var c=rt();n=n===void 0?null:n;var u=c.memoizedState.inst;Pe!==null&&n!==null&&Si(n,Pe.memoizedState.deps)?c.memoizedState=cr(t,u,a,n):(Ae.flags|=e,c.memoizedState=cr(1|t,u,a,n))}function Wd(e,t){Sl(8390656,8,e,t)}function ef(e,t){is(2048,8,e,t)}function tf(e,t){return is(4,2,e,t)}function af(e,t){return is(4,4,e,t)}function nf(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 rf(e,t,a){a=a!=null?a.concat([e]):null,is(4,4,nf.bind(null,t,e),a)}function Di(){}function sf(e,t){var a=rt();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&Si(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function lf(e,t){var a=rt();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&Si(t,n[1]))return n[0];if(n=e(),Rn){kt(!0);try{e()}finally{kt(!1)}}return a.memoizedState=[n,t],n}function Li(e,t,a){return a===void 0||(Za&1073741824)!==0?e.memoizedState=t:(e.memoizedState=a,e=um(),Ae.lanes|=e,nn|=e,a)}function of(e,t,a,n){return Dt(a,t)?a:lr.current!==null?(e=Li(e,a,n),Dt(e,t)||(mt=!0),e):(Za&42)===0?(mt=!0,e.memoizedState=a):(e=um(),Ae.lanes|=e,nn|=e,t)}function cf(e,t,a,n,c){var u=q.p;q.p=u!==0&&8>u?u:8;var x=T.T,v={};T.T=v,Hi(e,!1,t,a);try{var M=c(),P=T.S;if(P!==null&&P(v,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var te=ap(M,n);cs(e,t,te,qt(e))}else cs(e,t,n,qt(e))}catch(se){cs(e,t,{then:function(){},status:"rejected",reason:se},qt())}finally{q.p=u,T.T=x}}function op(){}function _i(e,t,a,n){if(e.tag!==5)throw Error(i(476));var c=uf(e).queue;cf(e,c,t,Z,a===null?op:function(){return df(e),a(n)})}function uf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:Z},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function df(e){var t=uf(e).next.queue;cs(e,t,{},qt())}function Bi(){return wt(ks)}function ff(){return rt().memoizedState}function mf(){return rt().memoizedState}function ip(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=qt();e=Xa(a);var n=Qa(t,e,a);n!==null&&(Pt(n,t,a),ns(n,t,a)),t={cache:hi()},e.payload=t;return}t=t.return}}function cp(e,t,a){var n=qt();a={lane:n,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Cl(e)?gf(t,a):(a=ri(e,t,a,n),a!==null&&(Pt(a,e,n),pf(a,t,n)))}function hf(e,t,a){var n=qt();cs(e,t,a,n)}function cs(e,t,a,n){var c={lane:n,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Cl(e))gf(t,c);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var x=t.lastRenderedState,v=u(x,a);if(c.hasEagerState=!0,c.eagerState=v,Dt(v,x))return il(e,t,c,0),$e===null&&ol(),!1}catch{}finally{}if(a=ri(e,t,c,n),a!==null)return Pt(a,e,n),pf(a,t,n),!0}return!1}function Hi(e,t,a,n){if(n={lane:2,revertLane:xc(),action:n,hasEagerState:!1,eagerState:null,next:null},Cl(e)){if(t)throw Error(i(479))}else t=ri(e,a,n,2),t!==null&&Pt(t,e,2)}function Cl(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function gf(e,t){or=bl=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function pf(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Ut(e,a)}}var El={readContext:wt,use:wl,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useLayoutEffect:et,useInsertionEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useSyncExternalStore:et,useId:et,useHostTransitionStatus:et,useFormState:et,useActionState:et,useOptimistic:et,useMemoCache:et,useCacheRefresh:et},xf={readContext:wt,use:wl,useCallback:function(e,t){return At().memoizedState=[e,t===void 0?null:t],e},useContext:wt,useEffect:Wd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Sl(4194308,4,nf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Sl(4194308,4,e,t)},useInsertionEffect:function(e,t){Sl(4,2,e,t)},useMemo:function(e,t){var a=At();t=t===void 0?null:t;var n=e();if(Rn){kt(!0);try{e()}finally{kt(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=At();if(a!==void 0){var c=a(t);if(Rn){kt(!0);try{a(t)}finally{kt(!1)}}}else c=t;return n.memoizedState=n.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},n.queue=e,e=e.dispatch=cp.bind(null,Ae,e),[n.memoizedState,e]},useRef:function(e){var t=At();return e={current:e},t.memoizedState=e},useState:function(e){e=zi(e);var t=e.queue,a=hf.bind(null,Ae,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Di,useDeferredValue:function(e,t){var a=At();return Li(a,e,t)},useTransition:function(){var e=zi(!1);return e=cf.bind(null,Ae,e.queue,!0,!1),At().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Ae,c=At();if(_e){if(a===void 0)throw Error(i(407));a=a()}else{if(a=t(),$e===null)throw Error(i(349));(Ue&124)!==0||_d(n,t,a)}c.memoizedState=a;var u={value:a,getSnapshot:t};return c.queue=u,Wd(Hd.bind(null,n,u,e),[e]),n.flags|=2048,cr(9,Nl(),Bd.bind(null,n,u,a,t),null),a},useId:function(){var e=At(),t=$e.identifierPrefix;if(_e){var a=ka,n=Ea;a=(n&~(1<<32-at(n)-1)).toString(32)+a,t="«"+t+"R"+a,a=vl++,0<a&&(t+="H"+a.toString(32)),t+="»"}else a=np++,t="«"+t+"r"+a.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Bi,useFormState:Xd,useActionState:Xd,useOptimistic:function(e){var t=At();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Hi.bind(null,Ae,!0,a),a.dispatch=t,[e,t]},useMemoCache:Ri,useCacheRefresh:function(){return At().memoizedState=ip.bind(null,Ae)}},yf={readContext:wt,use:wl,useCallback:sf,useContext:wt,useEffect:ef,useImperativeHandle:rf,useInsertionEffect:tf,useLayoutEffect:af,useMemo:lf,useReducer:jl,useRef:Jd,useState:function(){return jl(Ra)},useDebugValue:Di,useDeferredValue:function(e,t){var a=rt();return of(a,Pe.memoizedState,e,t)},useTransition:function(){var e=jl(Ra)[0],t=rt().memoizedState;return[typeof e=="boolean"?e:os(e),t]},useSyncExternalStore:Ld,useId:ff,useHostTransitionStatus:Bi,useFormState:Qd,useActionState:Qd,useOptimistic:function(e,t){var a=rt();return Vd(a,Pe,e,t)},useMemoCache:Ri,useCacheRefresh:mf},up={readContext:wt,use:wl,useCallback:sf,useContext:wt,useEffect:ef,useImperativeHandle:rf,useInsertionEffect:tf,useLayoutEffect:af,useMemo:lf,useReducer:Oi,useRef:Jd,useState:function(){return Oi(Ra)},useDebugValue:Di,useDeferredValue:function(e,t){var a=rt();return Pe===null?Li(a,e,t):of(a,Pe.memoizedState,e,t)},useTransition:function(){var e=Oi(Ra)[0],t=rt().memoizedState;return[typeof e=="boolean"?e:os(e),t]},useSyncExternalStore:Ld,useId:ff,useHostTransitionStatus:Bi,useFormState:Id,useActionState:Id,useOptimistic:function(e,t){var a=rt();return Pe!==null?Vd(a,Pe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Ri,useCacheRefresh:mf},ur=null,us=0;function kl(e){var t=us;return us+=1,ur===null&&(ur=[]),Td(ur,e,t)}function ds(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Tl(e,t){throw t.$$typeof===S?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function bf(e){var t=e._init;return t(e._payload)}function vf(e){function t(_,D){if(e){var H=_.deletions;H===null?(_.deletions=[D],_.flags|=16):H.push(D)}}function a(_,D){if(!e)return null;for(;D!==null;)t(_,D),D=D.sibling;return null}function n(_){for(var D=new Map;_!==null;)_.key!==null?D.set(_.key,_):D.set(_.index,_),_=_.sibling;return D}function c(_,D){return _=Ca(_,D),_.index=0,_.sibling=null,_}function u(_,D,H){return _.index=H,e?(H=_.alternate,H!==null?(H=H.index,H<D?(_.flags|=67108866,D):H):(_.flags|=67108866,D)):(_.flags|=1048576,D)}function x(_){return e&&_.alternate===null&&(_.flags|=67108866),_}function v(_,D,H,ne){return D===null||D.tag!==6?(D=li(H,_.mode,ne),D.return=_,D):(D=c(D,H),D.return=_,D)}function M(_,D,H,ne){var he=H.type;return he===C?te(_,D,H.props.children,ne,H.key):D!==null&&(D.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===K&&bf(he)===D.type)?(D=c(D,H.props),ds(D,H),D.return=_,D):(D=ul(H.type,H.key,H.props,null,_.mode,ne),ds(D,H),D.return=_,D)}function P(_,D,H,ne){return D===null||D.tag!==4||D.stateNode.containerInfo!==H.containerInfo||D.stateNode.implementation!==H.implementation?(D=oi(H,_.mode,ne),D.return=_,D):(D=c(D,H.children||[]),D.return=_,D)}function te(_,D,H,ne,he){return D===null||D.tag!==7?(D=jn(H,_.mode,ne,he),D.return=_,D):(D=c(D,H),D.return=_,D)}function se(_,D,H){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=li(""+D,_.mode,H),D.return=_,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case w:return H=ul(D.type,D.key,D.props,null,_.mode,H),ds(H,D),H.return=_,H;case A:return D=oi(D,_.mode,H),D.return=_,D;case K:var ne=D._init;return D=ne(D._payload),se(_,D,H)}if(F(D)||O(D))return D=jn(D,_.mode,H,null),D.return=_,D;if(typeof D.then=="function")return se(_,kl(D),H);if(D.$$typeof===U)return se(_,hl(_,D),H);Tl(_,D)}return null}function G(_,D,H,ne){var he=D!==null?D.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return he!==null?null:v(_,D,""+H,ne);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case w:return H.key===he?M(_,D,H,ne):null;case A:return H.key===he?P(_,D,H,ne):null;case K:return he=H._init,H=he(H._payload),G(_,D,H,ne)}if(F(H)||O(H))return he!==null?null:te(_,D,H,ne,null);if(typeof H.then=="function")return G(_,D,kl(H),ne);if(H.$$typeof===U)return G(_,D,hl(_,H),ne);Tl(_,H)}return null}function Q(_,D,H,ne,he){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return _=_.get(H)||null,v(D,_,""+ne,he);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:return _=_.get(ne.key===null?H:ne.key)||null,M(D,_,ne,he);case A:return _=_.get(ne.key===null?H:ne.key)||null,P(D,_,ne,he);case K:var Me=ne._init;return ne=Me(ne._payload),Q(_,D,H,ne,he)}if(F(ne)||O(ne))return _=_.get(H)||null,te(D,_,ne,he,null);if(typeof ne.then=="function")return Q(_,D,H,kl(ne),he);if(ne.$$typeof===U)return Q(_,D,H,hl(D,ne),he);Tl(D,ne)}return null}function Ne(_,D,H,ne){for(var he=null,Me=null,ye=D,we=D=0,gt=null;ye!==null&&we<H.length;we++){ye.index>we?(gt=ye,ye=null):gt=ye.sibling;var Le=G(_,ye,H[we],ne);if(Le===null){ye===null&&(ye=gt);break}e&&ye&&Le.alternate===null&&t(_,ye),D=u(Le,D,we),Me===null?he=Le:Me.sibling=Le,Me=Le,ye=gt}if(we===H.length)return a(_,ye),_e&&Sn(_,we),he;if(ye===null){for(;we<H.length;we++)ye=se(_,H[we],ne),ye!==null&&(D=u(ye,D,we),Me===null?he=ye:Me.sibling=ye,Me=ye);return _e&&Sn(_,we),he}for(ye=n(ye);we<H.length;we++)gt=Q(ye,_,we,H[we],ne),gt!==null&&(e&&gt.alternate!==null&&ye.delete(gt.key===null?we:gt.key),D=u(gt,D,we),Me===null?he=gt:Me.sibling=gt,Me=gt);return e&&ye.forEach(function(mn){return t(_,mn)}),_e&&Sn(_,we),he}function ve(_,D,H,ne){if(H==null)throw Error(i(151));for(var he=null,Me=null,ye=D,we=D=0,gt=null,Le=H.next();ye!==null&&!Le.done;we++,Le=H.next()){ye.index>we?(gt=ye,ye=null):gt=ye.sibling;var mn=G(_,ye,Le.value,ne);if(mn===null){ye===null&&(ye=gt);break}e&&ye&&mn.alternate===null&&t(_,ye),D=u(mn,D,we),Me===null?he=mn:Me.sibling=mn,Me=mn,ye=gt}if(Le.done)return a(_,ye),_e&&Sn(_,we),he;if(ye===null){for(;!Le.done;we++,Le=H.next())Le=se(_,Le.value,ne),Le!==null&&(D=u(Le,D,we),Me===null?he=Le:Me.sibling=Le,Me=Le);return _e&&Sn(_,we),he}for(ye=n(ye);!Le.done;we++,Le=H.next())Le=Q(ye,_,we,Le.value,ne),Le!==null&&(e&&Le.alternate!==null&&ye.delete(Le.key===null?we:Le.key),D=u(Le,D,we),Me===null?he=Le:Me.sibling=Le,Me=Le);return e&&ye.forEach(function(dx){return t(_,dx)}),_e&&Sn(_,we),he}function Ge(_,D,H,ne){if(typeof H=="object"&&H!==null&&H.type===C&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case w:e:{for(var he=H.key;D!==null;){if(D.key===he){if(he=H.type,he===C){if(D.tag===7){a(_,D.sibling),ne=c(D,H.props.children),ne.return=_,_=ne;break e}}else if(D.elementType===he||typeof he=="object"&&he!==null&&he.$$typeof===K&&bf(he)===D.type){a(_,D.sibling),ne=c(D,H.props),ds(ne,H),ne.return=_,_=ne;break e}a(_,D);break}else t(_,D);D=D.sibling}H.type===C?(ne=jn(H.props.children,_.mode,ne,H.key),ne.return=_,_=ne):(ne=ul(H.type,H.key,H.props,null,_.mode,ne),ds(ne,H),ne.return=_,_=ne)}return x(_);case A:e:{for(he=H.key;D!==null;){if(D.key===he)if(D.tag===4&&D.stateNode.containerInfo===H.containerInfo&&D.stateNode.implementation===H.implementation){a(_,D.sibling),ne=c(D,H.children||[]),ne.return=_,_=ne;break e}else{a(_,D);break}else t(_,D);D=D.sibling}ne=oi(H,_.mode,ne),ne.return=_,_=ne}return x(_);case K:return he=H._init,H=he(H._payload),Ge(_,D,H,ne)}if(F(H))return Ne(_,D,H,ne);if(O(H)){if(he=O(H),typeof he!="function")throw Error(i(150));return H=he.call(H),ve(_,D,H,ne)}if(typeof H.then=="function")return Ge(_,D,kl(H),ne);if(H.$$typeof===U)return Ge(_,D,hl(_,H),ne);Tl(_,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,D!==null&&D.tag===6?(a(_,D.sibling),ne=c(D,H),ne.return=_,_=ne):(a(_,D),ne=li(H,_.mode,ne),ne.return=_,_=ne),x(_)):a(_,D)}return function(_,D,H,ne){try{us=0;var he=Ge(_,D,H,ne);return ur=null,he}catch(ye){if(ye===ts||ye===pl)throw ye;var Me=Lt(29,ye,null,_.mode);return Me.lanes=ne,Me.return=_,Me}finally{}}}var dr=vf(!0),wf=vf(!1),Zt=I(null),ga=null;function Ia(e){var t=e.alternate;B(ct,ct.current&1),B(Zt,e),ga===null&&(t===null||lr.current!==null||t.memoizedState!==null)&&(ga=e)}function jf(e){if(e.tag===22){if(B(ct,ct.current),B(Zt,e),ga===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(ga=e)}}else Ja()}function Ja(){B(ct,ct.current),B(Zt,Zt.current)}function Ma(e){le(Zt),ga===e&&(ga=null),le(ct)}var ct=I(0);function Al(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||Ac(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function qi(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 Pi={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=qt(),c=Xa(n);c.payload=t,a!=null&&(c.callback=a),t=Qa(e,c,n),t!==null&&(Pt(t,e,n),ns(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=qt(),c=Xa(n);c.tag=1,c.payload=t,a!=null&&(c.callback=a),t=Qa(e,c,n),t!==null&&(Pt(t,e,n),ns(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=qt(),n=Xa(a);n.tag=2,t!=null&&(n.callback=t),t=Qa(e,n,a),t!==null&&(Pt(t,e,a),ns(t,e,a))}};function Nf(e,t,a,n,c,u,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,u,x):t.prototype&&t.prototype.isPureReactComponent?!Fr(a,n)||!Fr(c,u):!0}function Sf(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&&Pi.enqueueReplaceState(t,t.state,null)}function Mn(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 c in e)a[c]===void 0&&(a[c]=e[c])}return a}var Rl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Cf(e){Rl(e)}function Ef(e){console.error(e)}function kf(e){Rl(e)}function Ml(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Tf(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Vi(e,t,a){return a=Xa(a),a.tag=3,a.payload={element:null},a.callback=function(){Ml(e,t)},a}function Af(e){return e=Xa(e),e.tag=3,e}function Rf(e,t,a,n){var c=a.type.getDerivedStateFromError;if(typeof c=="function"){var u=n.value;e.payload=function(){return c(u)},e.callback=function(){Tf(t,a,n)}}var x=a.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Tf(t,a,n),typeof c!="function"&&(rn===null?rn=new Set([this]):rn.add(this));var v=n.stack;this.componentDidCatch(n.value,{componentStack:v!==null?v:""})})}function dp(e,t,a,n,c){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Jr(t,a,c,!0),a=Zt.current,a!==null){switch(a.tag){case 13:return ga===null?fc():a.alternate===null&&Je===0&&(Je=3),a.flags&=-257,a.flags|=65536,a.lanes=c,n===xi?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),hc(e,n,c)),!1;case 22:return a.flags|=65536,n===xi?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)),hc(e,n,c)),!1}throw Error(i(435,a.tag))}return hc(e,n,c),fc(),!1}if(_e)return t=Zt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,n!==ui&&(e=Error(i(422),{cause:n}),Ir(Yt(e,a)))):(n!==ui&&(t=Error(i(423),{cause:n}),Ir(Yt(t,a))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,n=Yt(n,a),c=Vi(e.stateNode,n,c),vi(e,c),Je!==4&&(Je=2)),!1;var u=Error(i(520),{cause:n});if(u=Yt(u,a),ys===null?ys=[u]:ys.push(u),Je!==4&&(Je=2),t===null)return!0;n=Yt(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=c&-c,a.lanes|=e,e=Vi(a.stateNode,n,e),vi(a,e),!1;case 1:if(t=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(rn===null||!rn.has(u))))return a.flags|=65536,c&=-c,a.lanes|=c,c=Af(c),Rf(c,e,a,n),vi(a,c),!1}a=a.return}while(a!==null);return!1}var Mf=Error(i(461)),mt=!1;function pt(e,t,a,n){t.child=e===null?wf(t,null,a,n):dr(t,e.child,a,n)}function Of(e,t,a,n,c){a=a.render;var u=t.ref;if("ref"in n){var x={};for(var v in n)v!=="ref"&&(x[v]=n[v])}else x=n;return Tn(t),n=Ci(e,t,a,x,u,c),v=Ei(),e!==null&&!mt?(ki(e,t,c),Oa(e,t,c)):(_e&&v&&ii(t),t.flags|=1,pt(e,t,n,c),t.child)}function zf(e,t,a,n,c){if(e===null){var u=a.type;return typeof u=="function"&&!si(u)&&u.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=u,Uf(e,t,u,n,c)):(e=ul(a.type,null,n,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Zi(e,c)){var x=u.memoizedProps;if(a=a.compare,a=a!==null?a:Fr,a(x,n)&&e.ref===t.ref)return Oa(e,t,c)}return t.flags|=1,e=Ca(u,n),e.ref=t.ref,e.return=t,t.child=e}function Uf(e,t,a,n,c){if(e!==null){var u=e.memoizedProps;if(Fr(u,n)&&e.ref===t.ref)if(mt=!1,t.pendingProps=n=u,Zi(e,c))(e.flags&131072)!==0&&(mt=!0);else return t.lanes=e.lanes,Oa(e,t,c)}return Gi(e,t,a,n,c)}function Df(e,t,a){var n=t.pendingProps,c=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(c=t.child=e.child,u=0;c!==null;)u=u|c.lanes|c.childLanes,c=c.sibling;t.childLanes=u&~n}else t.childLanes=0,t.child=null;return Lf(e,t,n,a)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gl(t,u!==null?u.cachePool:null),u!==null?zd(t,u):ji(),jf(t);else return t.lanes=t.childLanes=536870912,Lf(e,t,u!==null?u.baseLanes|a:a,a)}else u!==null?(gl(t,u.cachePool),zd(t,u),Ja(),t.memoizedState=null):(e!==null&&gl(t,null),ji(),Ja());return pt(e,t,c,a),t.child}function Lf(e,t,a,n){var c=pi();return c=c===null?null:{parent:it._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&gl(t,null),ji(),jf(t),e!==null&&Jr(e,t,n,!0),null}function Ol(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Gi(e,t,a,n,c){return Tn(t),a=Ci(e,t,a,n,void 0,c),n=Ei(),e!==null&&!mt?(ki(e,t,c),Oa(e,t,c)):(_e&&n&&ii(t),t.flags|=1,pt(e,t,a,c),t.child)}function _f(e,t,a,n,c,u){return Tn(t),t.updateQueue=null,a=Dd(t,n,a,c),Ud(e),n=Ei(),e!==null&&!mt?(ki(e,t,u),Oa(e,t,u)):(_e&&n&&ii(t),t.flags|=1,pt(e,t,a,u),t.child)}function Bf(e,t,a,n,c){if(Tn(t),t.stateNode===null){var u=tr,x=a.contextType;typeof x=="object"&&x!==null&&(u=wt(x)),u=new a(n,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Pi,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=n,u.state=t.memoizedState,u.refs={},yi(t),x=a.contextType,u.context=typeof x=="object"&&x!==null?wt(x):tr,u.state=t.memoizedState,x=a.getDerivedStateFromProps,typeof x=="function"&&(qi(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&&Pi.enqueueReplaceState(u,u.state,null),ss(t,n,u,c),rs(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){u=t.stateNode;var v=t.memoizedProps,M=Mn(a,v);u.props=M;var P=u.context,te=a.contextType;x=tr,typeof te=="object"&&te!==null&&(x=wt(te));var se=a.getDerivedStateFromProps;te=typeof se=="function"||typeof u.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,te||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(v||P!==x)&&Sf(t,u,n,x),Fa=!1;var G=t.memoizedState;u.state=G,ss(t,n,u,c),rs(),P=t.memoizedState,v||G!==P||Fa?(typeof se=="function"&&(qi(t,a,se,n),P=t.memoizedState),(M=Fa||Nf(t,a,M,n,G,P,x))?(te||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=P),u.props=n,u.state=P,u.context=x,n=M):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{u=t.stateNode,bi(e,t),x=t.memoizedProps,te=Mn(a,x),u.props=te,se=t.pendingProps,G=u.context,P=a.contextType,M=tr,typeof P=="object"&&P!==null&&(M=wt(P)),v=a.getDerivedStateFromProps,(P=typeof v=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(x!==se||G!==M)&&Sf(t,u,n,M),Fa=!1,G=t.memoizedState,u.state=G,ss(t,n,u,c),rs();var Q=t.memoizedState;x!==se||G!==Q||Fa||e!==null&&e.dependencies!==null&&ml(e.dependencies)?(typeof v=="function"&&(qi(t,a,v,n),Q=t.memoizedState),(te=Fa||Nf(t,a,te,n,G,Q,M)||e!==null&&e.dependencies!==null&&ml(e.dependencies))?(P||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(n,Q,M),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(n,Q,M)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=Q),u.props=n,u.state=Q,u.context=M,n=te):(typeof u.componentDidUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),n=!1)}return u=n,Ol(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=dr(t,e.child,null,c),t.child=dr(t,null,a,c)):pt(e,t,a,c),t.memoizedState=u.state,e=t.child):e=Oa(e,t,c),e}function Hf(e,t,a,n){return Zr(),t.flags|=256,pt(e,t,a,n),t.child}var Ki={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $i(e){return{baseLanes:e,cachePool:Cd()}}function Yi(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=It),e}function qf(e,t,a){var n=t.pendingProps,c=!1,u=(t.flags&128)!==0,x;if((x=u)||(x=e!==null&&e.memoizedState===null?!1:(ct.current&2)!==0),x&&(c=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(_e){if(c?Ia(t):Ja(),_e){var v=Ie,M;if(M=v){e:{for(M=v,v=ha;M.nodeType!==8;){if(!v){v=null;break e}if(M=oa(M.nextSibling),M===null){v=null;break e}}v=M}v!==null?(t.memoizedState={dehydrated:v,treeContext:Nn!==null?{id:Ea,overflow:ka}:null,retryLane:536870912,hydrationErrors:null},M=Lt(18,null,null,0),M.stateNode=v,M.return=t,t.child=M,Ct=t,Ie=null,M=!0):M=!1}M||En(t)}if(v=t.memoizedState,v!==null&&(v=v.dehydrated,v!==null))return Ac(v)?t.lanes=32:t.lanes=536870912,null;Ma(t)}return v=n.children,n=n.fallback,c?(Ja(),c=t.mode,v=zl({mode:"hidden",children:v},c),n=jn(n,c,a,null),v.return=t,n.return=t,v.sibling=n,t.child=v,c=t.child,c.memoizedState=$i(a),c.childLanes=Yi(e,x,a),t.memoizedState=Ki,n):(Ia(t),Fi(t,v))}if(M=e.memoizedState,M!==null&&(v=M.dehydrated,v!==null)){if(u)t.flags&256?(Ia(t),t.flags&=-257,t=Xi(e,t,a)):t.memoizedState!==null?(Ja(),t.child=e.child,t.flags|=128,t=null):(Ja(),c=n.fallback,v=t.mode,n=zl({mode:"visible",children:n.children},v),c=jn(c,v,a,null),c.flags|=2,n.return=t,c.return=t,n.sibling=c,t.child=n,dr(t,e.child,null,a),n=t.child,n.memoizedState=$i(a),n.childLanes=Yi(e,x,a),t.memoizedState=Ki,t=c);else if(Ia(t),Ac(v)){if(x=v.nextSibling&&v.nextSibling.dataset,x)var P=x.dgst;x=P,n=Error(i(419)),n.stack="",n.digest=x,Ir({value:n,source:null,stack:null}),t=Xi(e,t,a)}else if(mt||Jr(e,t,a,!1),x=(a&e.childLanes)!==0,mt||x){if(x=$e,x!==null&&(n=a&-a,n=(n&42)!==0?1:ma(n),n=(n&(x.suspendedLanes|a))!==0?0:n,n!==0&&n!==M.retryLane))throw M.retryLane=n,er(e,n),Pt(x,e,n),Mf;v.data==="$?"||fc(),t=Xi(e,t,a)}else v.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=M.treeContext,Ie=oa(v.nextSibling),Ct=t,_e=!0,Cn=null,ha=!1,e!==null&&(Xt[Qt++]=Ea,Xt[Qt++]=ka,Xt[Qt++]=Nn,Ea=e.id,ka=e.overflow,Nn=t),t=Fi(t,n.children),t.flags|=4096);return t}return c?(Ja(),c=n.fallback,v=t.mode,M=e.child,P=M.sibling,n=Ca(M,{mode:"hidden",children:n.children}),n.subtreeFlags=M.subtreeFlags&65011712,P!==null?c=Ca(P,c):(c=jn(c,v,a,null),c.flags|=2),c.return=t,n.return=t,n.sibling=c,t.child=n,n=c,c=t.child,v=e.child.memoizedState,v===null?v=$i(a):(M=v.cachePool,M!==null?(P=it._currentValue,M=M.parent!==P?{parent:P,pool:P}:M):M=Cd(),v={baseLanes:v.baseLanes|a,cachePool:M}),c.memoizedState=v,c.childLanes=Yi(e,x,a),t.memoizedState=Ki,n):(Ia(t),a=e.child,e=a.sibling,a=Ca(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 Fi(e,t){return t=zl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function zl(e,t){return e=Lt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Xi(e,t,a){return dr(t,e.child,null,a),e=Fi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pf(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),fi(e.return,t,a)}function Qi(e,t,a,n,c){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:c}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=n,u.tail=a,u.tailMode=c)}function Vf(e,t,a){var n=t.pendingProps,c=n.revealOrder,u=n.tail;if(pt(e,t,n.children,a),n=ct.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&&Pf(e,a,t);else if(e.tag===19)Pf(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(B(ct,n),c){case"forwards":for(a=t.child,c=null;a!==null;)e=a.alternate,e!==null&&Al(e)===null&&(c=a),a=a.sibling;a=c,a===null?(c=t.child,t.child=null):(c=a.sibling,a.sibling=null),Qi(t,!1,c,a,u);break;case"backwards":for(a=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Al(e)===null){t.child=c;break}e=c.sibling,c.sibling=a,a=c,c=e}Qi(t,!0,a,null,u);break;case"together":Qi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Oa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),nn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Jr(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,a=Ca(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ca(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Zi(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ml(e)))}function fp(e,t,a){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Ya(t,it,e.memoizedState.cache),Zr();break;case 27:case 5:je(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Ya(t,t.type,t.memoizedProps.value);break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Ia(t),t.flags|=128,null):(a&t.child.childLanes)!==0?qf(e,t,a):(Ia(t),e=Oa(e,t,a),e!==null?e.sibling:null);Ia(t);break;case 19:var c=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Jr(e,t,a,!1),n=(a&t.childLanes)!==0),c){if(n)return Vf(e,t,a);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),B(ct,ct.current),n)break;return null;case 22:case 23:return t.lanes=0,Df(e,t,a);case 24:Ya(t,it,e.memoizedState.cache)}return Oa(e,t,a)}function Gf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)mt=!0;else{if(!Zi(e,a)&&(t.flags&128)===0)return mt=!1,fp(e,t,a);mt=(e.flags&131072)!==0}else mt=!1,_e&&(t.flags&1048576)!==0&&yd(t,fl,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var n=t.elementType,c=n._init;if(n=c(n._payload),t.type=n,typeof n=="function")si(n)?(e=Mn(n,e),t.tag=1,t=Bf(null,t,n,e,a)):(t.tag=0,t=Gi(null,t,n,e,a));else{if(n!=null){if(c=n.$$typeof,c===X){t.tag=11,t=Of(null,t,n,e,a);break e}else if(c===ae){t.tag=14,t=zf(null,t,n,e,a);break e}}throw t=$(n)||n,Error(i(306,t,""))}}return t;case 0:return Gi(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,c=Mn(n,t.pendingProps),Bf(e,t,n,c,a);case 3:e:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(i(387));n=t.pendingProps;var u=t.memoizedState;c=u.element,bi(e,t),ss(t,n,null,a);var x=t.memoizedState;if(n=x.cache,Ya(t,it,n),n!==u.cache&&mi(t,[it],a,!0),rs(),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=Hf(e,t,n,a);break e}else if(n!==c){c=Yt(Error(i(424)),t),Ir(c),t=Hf(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(Ie=oa(e.firstChild),Ct=t,_e=!0,Cn=null,ha=!0,a=wf(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Zr(),n===c){t=Oa(e,t,a);break e}pt(e,t,n,a)}t=t.child}return t;case 26:return Ol(e,t),e===null?(a=Fm(t.type,null,t.pendingProps,null))?t.memoizedState=a:_e||(a=t.type,e=t.pendingProps,n=Fl(W.current).createElement(a),n[ot]=t,n[St]=e,yt(n,a,e),ft(n),t.stateNode=n):t.memoizedState=Fm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return je(t),e===null&&_e&&(n=t.stateNode=Km(t.type,t.pendingProps,W.current),Ct=t,ha=!0,c=Ie,on(t.type)?(Rc=c,Ie=oa(n.firstChild)):Ie=c),pt(e,t,t.pendingProps.children,a),Ol(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&_e&&((c=n=Ie)&&(n=qp(n,t.type,t.pendingProps,ha),n!==null?(t.stateNode=n,Ct=t,Ie=oa(n.firstChild),ha=!1,c=!0):c=!1),c||En(t)),je(t),c=t.type,u=t.pendingProps,x=e!==null?e.memoizedProps:null,n=u.children,Ec(c,u)?n=null:x!==null&&Ec(c,x)&&(t.flags|=32),t.memoizedState!==null&&(c=Ci(e,t,rp,null,null,a),ks._currentValue=c),Ol(e,t),pt(e,t,n,a),t.child;case 6:return e===null&&_e&&((e=a=Ie)&&(a=Pp(a,t.pendingProps,ha),a!==null?(t.stateNode=a,Ct=t,Ie=null,e=!0):e=!1),e||En(t)),null;case 13:return qf(e,t,a);case 4:return ue(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=dr(t,null,n,a):pt(e,t,n,a),t.child;case 11:return Of(e,t,t.type,t.pendingProps,a);case 7:return pt(e,t,t.pendingProps,a),t.child;case 8:return pt(e,t,t.pendingProps.children,a),t.child;case 12:return pt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,Ya(t,t.type,n.value),pt(e,t,n.children,a),t.child;case 9:return c=t.type._context,n=t.pendingProps.children,Tn(t),c=wt(c),n=n(c),t.flags|=1,pt(e,t,n,a),t.child;case 14:return zf(e,t,t.type,t.pendingProps,a);case 15:return Uf(e,t,t.type,t.pendingProps,a);case 19:return Vf(e,t,a);case 31:return n=t.pendingProps,a=t.mode,n={mode:n.mode,children:n.children},e===null?(a=zl(n,a),a.ref=t.ref,t.child=a,a.return=t,t=a):(a=Ca(e.child,n),a.ref=t.ref,t.child=a,a.return=t,t=a),t;case 22:return Df(e,t,a);case 24:return Tn(t),n=wt(it),e===null?(c=pi(),c===null&&(c=$e,u=hi(),c.pooledCache=u,u.refCount++,u!==null&&(c.pooledCacheLanes|=a),c=u),t.memoizedState={parent:n,cache:c},yi(t),Ya(t,it,c)):((e.lanes&a)!==0&&(bi(e,t),ss(t,null,null,a),rs()),c=e.memoizedState,u=t.memoizedState,c.parent!==n?(c={parent:n,cache:n},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Ya(t,it,n)):(n=u.cache,Ya(t,it,n),n!==c.cache&&mi(t,[it],a,!0))),pt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function za(e){e.flags|=4}function Kf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Jm(t)){if(t=Zt.current,t!==null&&((Ue&4194048)===Ue?ga!==null:(Ue&62914560)!==Ue&&(Ue&536870912)===0||t!==ga))throw as=xi,Ed;e.flags|=8192}}function Ul(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?dt():536870912,e.lanes|=t,gr|=t)}function fs(e,t){if(!_e)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var 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 Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var c=e.child;c!==null;)a|=c.lanes|c.childLanes,n|=c.subtreeFlags&65011712,n|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)a|=c.lanes|c.childLanes,n|=c.subtreeFlags,n|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function mp(e,t,a){var n=t.pendingProps;switch(ci(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return Ze(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Aa(it),be(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Qr(t)?za(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wd())),Ze(t),null;case 26:return a=t.memoizedState,e===null?(za(t),a!==null?(Ze(t),Kf(t,a)):(Ze(t),t.flags&=-16777217)):a?a!==e.memoizedState?(za(t),Ze(t),Kf(t,a)):(Ze(t),t.flags&=-16777217):(e.memoizedProps!==n&&za(t),Ze(t),t.flags&=-16777217),null;case 27:xe(t),a=W.current;var c=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==n&&za(t);else{if(!n){if(t.stateNode===null)throw Error(i(166));return Ze(t),null}e=V.current,Qr(t)?bd(t):(e=Km(c,n,a),t.stateNode=e,za(t))}return Ze(t),null;case 5:if(xe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&za(t);else{if(!n){if(t.stateNode===null)throw Error(i(166));return Ze(t),null}if(e=V.current,Qr(t))bd(t);else{switch(c=Fl(W.current),e){case 1:e=c.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=c.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=c.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof n.is=="string"?c.createElement("select",{is:n.is}):c.createElement("select"),n.multiple?e.multiple=!0:n.size&&(e.size=n.size);break;default:e=typeof n.is=="string"?c.createElement(a,{is:n.is}):c.createElement(a)}}e[ot]=t,e[St]=n;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)e.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=e;e:switch(yt(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&&za(t)}}return Ze(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&za(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(i(166));if(e=W.current,Qr(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,c=Ct,c!==null)switch(c.tag){case 27:case 5:n=c.memoizedProps}e[ot]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||_m(e.nodeValue,a)),e||En(t)}else e=Fl(e).createTextNode(n),e[ot]=t,t.stateNode=e}return Ze(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Qr(t),n!==null&&n.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[ot]=t}else Zr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),c=!1}else c=wd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Ma(t),t):(Ma(t),null)}if(Ma(t),(t.flags&128)!==0)return t.lanes=a,t;if(a=n!==null,e=e!==null&&e.memoizedState!==null,a){n=t.child,c=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(c=n.alternate.memoizedState.cachePool.pool);var u=null;n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==c&&(n.flags|=2048)}return a!==e&&a&&(t.child.flags|=8192),Ul(t,t.updateQueue),Ze(t),null;case 4:return be(),e===null&&wc(t.stateNode.containerInfo),Ze(t),null;case 10:return Aa(t.type),Ze(t),null;case 19:if(le(ct),c=t.memoizedState,c===null)return Ze(t),null;if(n=(t.flags&128)!==0,u=c.rendering,u===null)if(n)fs(c,!1);else{if(Je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Al(e),u!==null){for(t.flags|=128,fs(c,!1),e=u.updateQueue,t.updateQueue=e,Ul(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)xd(a,e),a=a.sibling;return B(ct,ct.current&1|2),t.child}e=e.sibling}c.tail!==null&&De()>_l&&(t.flags|=128,n=!0,fs(c,!1),t.lanes=4194304)}else{if(!n)if(e=Al(u),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Ul(t,e),fs(c,!0),c.tail===null&&c.tailMode==="hidden"&&!u.alternate&&!_e)return Ze(t),null}else 2*De()-c.renderingStartTime>_l&&a!==536870912&&(t.flags|=128,n=!0,fs(c,!1),t.lanes=4194304);c.isBackwards?(u.sibling=t.child,t.child=u):(e=c.last,e!==null?e.sibling=u:t.child=u,c.last=u)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=De(),t.sibling=null,e=ct.current,B(ct,n?e&1|2:e&1),t):(Ze(t),null);case 22:case 23:return Ma(t),Ni(),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&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),a=t.updateQueue,a!==null&&Ul(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(An),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Aa(it),Ze(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function hp(e,t){switch(ci(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Aa(it),be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 13:if(Ma(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Zr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(ct),null;case 4:return be(),null;case 10:return Aa(t.type),null;case 22:case 23:return Ma(t),Ni(),e!==null&&le(An),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Aa(it),null;case 25:return null;default:return null}}function $f(e,t){switch(ci(t),t.tag){case 3:Aa(it),be();break;case 26:case 27:case 5:xe(t);break;case 4:be();break;case 13:Ma(t);break;case 19:le(ct);break;case 10:Aa(t.type);break;case 22:case 23:Ma(t),Ni(),e!==null&&le(An);break;case 24:Aa(it)}}function ms(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var c=n.next;a=c;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!==c)}}catch(v){Ke(t,t.return,v)}}function Wa(e,t,a){try{var n=t.updateQueue,c=n!==null?n.lastEffect:null;if(c!==null){var u=c.next;n=u;do{if((n.tag&e)===e){var x=n.inst,v=x.destroy;if(v!==void 0){x.destroy=void 0,c=t;var M=a,P=v;try{P()}catch(te){Ke(c,M,te)}}}n=n.next}while(n!==u)}}catch(te){Ke(t,t.return,te)}}function Yf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Od(t,a)}catch(n){Ke(e,e.return,n)}}}function Ff(e,t,a){a.props=Mn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){Ke(e,t,n)}}function hs(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(c){Ke(e,t,c)}}function pa(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(c){Ke(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(c){Ke(e,t,c)}else a.current=null}function Xf(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(c){Ke(e,e.return,c)}}function Ii(e,t,a){try{var n=e.stateNode;Dp(n,e.type,a,t),n[St]=t}catch(c){Ke(e,e.return,c)}}function Qf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&on(e.type)||e.tag===4}function Ji(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&on(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wi(e,t,a){var 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=Yl));else if(n!==4&&(n===27&&on(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Wi(e,t,a),e=e.sibling;e!==null;)Wi(e,t,a),e=e.sibling}function Dl(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&&on(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Dl(e,t,a),e=e.sibling;e!==null;)Dl(e,t,a),e=e.sibling}function Zf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);yt(t,n,a),t[ot]=e,t[St]=a}catch(u){Ke(e,e.return,u)}}var Ua=!1,tt=!1,ec=!1,If=typeof WeakSet=="function"?WeakSet:Set,ht=null;function gp(e,t){if(e=e.containerInfo,Sc=Wl,e=od(e),Jo(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var c=n.anchorOffset,u=n.focusNode;n=n.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var x=0,v=-1,M=-1,P=0,te=0,se=e,G=null;t:for(;;){for(var Q;se!==a||c!==0&&se.nodeType!==3||(v=x+c),se!==u||n!==0&&se.nodeType!==3||(M=x+n),se.nodeType===3&&(x+=se.nodeValue.length),(Q=se.firstChild)!==null;)G=se,se=Q;for(;;){if(se===e)break t;if(G===a&&++P===c&&(v=x),G===u&&++te===n&&(M=x),(Q=se.nextSibling)!==null)break;se=G,G=se.parentNode}se=Q}a=v===-1||M===-1?null:{start:v,end:M}}else a=null}a=a||{start:0,end:0}}else a=null;for(Cc={focusedElem:e,selectionRange:a},Wl=!1,ht=t;ht!==null;)if(t=ht,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,ht=e;else for(;ht!==null;){switch(t=ht,u=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,a=t,c=u.memoizedProps,u=u.memoizedState,n=a.stateNode;try{var Ne=Mn(a.type,c,a.elementType===a.type);e=n.getSnapshotBeforeUpdate(Ne,u),n.__reactInternalSnapshotBeforeUpdate=e}catch(ve){Ke(a,a.return,ve)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Tc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Tc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ht=e;break}ht=t.return}}function Jf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:en(e,a),n&4&&ms(5,a);break;case 1:if(en(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(x){Ke(a,a.return,x)}else{var c=Mn(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){Ke(a,a.return,x)}}n&64&&Yf(a),n&512&&hs(a,a.return);break;case 3:if(en(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{Od(e,t)}catch(x){Ke(a,a.return,x)}}break;case 27:t===null&&n&4&&Zf(a);case 26:case 5:en(e,a),t===null&&n&4&&Xf(a),n&512&&hs(a,a.return);break;case 12:en(e,a);break;case 13:en(e,a),n&4&&tm(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Sp.bind(null,a),Vp(e,a))));break;case 22:if(n=a.memoizedState!==null||Ua,!n){t=t!==null&&t.memoizedState!==null||tt,c=Ua;var u=tt;Ua=n,(tt=t)&&!u?tn(e,a,(a.subtreeFlags&8772)!==0):en(e,a),Ua=c,tt=u}break;case 30:break;default:en(e,a)}}function Wf(e){var t=e.alternate;t!==null&&(e.alternate=null,Wf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&zo(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Fe=null,Rt=!1;function Da(e,t,a){for(a=a.child;a!==null;)em(e,t,a),a=a.sibling}function em(e,t,a){if(lt&&typeof lt.onCommitFiberUnmount=="function")try{lt.onCommitFiberUnmount(Ot,a)}catch{}switch(a.tag){case 26:tt||pa(a,t),Da(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:tt||pa(a,t);var n=Fe,c=Rt;on(a.type)&&(Fe=a.stateNode,Rt=!1),Da(e,t,a),Ns(a.stateNode),Fe=n,Rt=c;break;case 5:tt||pa(a,t);case 6:if(n=Fe,c=Rt,Fe=null,Da(e,t,a),Fe=n,Rt=c,Fe!==null)if(Rt)try{(Fe.nodeType===9?Fe.body:Fe.nodeName==="HTML"?Fe.ownerDocument.body:Fe).removeChild(a.stateNode)}catch(u){Ke(a,t,u)}else try{Fe.removeChild(a.stateNode)}catch(u){Ke(a,t,u)}break;case 18:Fe!==null&&(Rt?(e=Fe,Vm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Ms(e)):Vm(Fe,a.stateNode));break;case 4:n=Fe,c=Rt,Fe=a.stateNode.containerInfo,Rt=!0,Da(e,t,a),Fe=n,Rt=c;break;case 0:case 11:case 14:case 15:tt||Wa(2,a,t),tt||Wa(4,a,t),Da(e,t,a);break;case 1:tt||(pa(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&Ff(a,t,n)),Da(e,t,a);break;case 21:Da(e,t,a);break;case 22:tt=(n=tt)||a.memoizedState!==null,Da(e,t,a),tt=n;break;default:Da(e,t,a)}}function tm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ms(e)}catch(a){Ke(t,t.return,a)}}function pp(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new If),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new If),t;default:throw Error(i(435,e.tag))}}function tc(e,t){var a=pp(e);t.forEach(function(n){var c=Cp.bind(null,e,n);a.has(n)||(a.add(n),n.then(c,c))})}function _t(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var c=a[n],u=e,x=t,v=x;e:for(;v!==null;){switch(v.tag){case 27:if(on(v.type)){Fe=v.stateNode,Rt=!1;break e}break;case 5:Fe=v.stateNode,Rt=!1;break e;case 3:case 4:Fe=v.stateNode.containerInfo,Rt=!0;break e}v=v.return}if(Fe===null)throw Error(i(160));em(u,x,c),Fe=null,Rt=!1,u=c.alternate,u!==null&&(u.return=null),c.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)am(t,e),t=t.sibling}var la=null;function am(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:_t(t,e),Bt(e),n&4&&(Wa(3,e,e.return),ms(3,e),Wa(5,e,e.return));break;case 1:_t(t,e),Bt(e),n&512&&(tt||a===null||pa(a,a.return)),n&64&&Ua&&(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 c=la;if(_t(t,e),Bt(e),n&512&&(tt||a===null||pa(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,c=c.ownerDocument||c;t:switch(n){case"title":u=c.getElementsByTagName("title")[0],(!u||u[Br]||u[ot]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=c.createElement(n),c.head.insertBefore(u,c.querySelector("head > title"))),yt(u,n,a),u[ot]=e,ft(u),n=u;break e;case"link":var x=Zm("link","href",c).get(n+(a.href||""));if(x){for(var v=0;v<x.length;v++)if(u=x[v],u.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&u.getAttribute("rel")===(a.rel==null?null:a.rel)&&u.getAttribute("title")===(a.title==null?null:a.title)&&u.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){x.splice(v,1);break t}}u=c.createElement(n),yt(u,n,a),c.head.appendChild(u);break;case"meta":if(x=Zm("meta","content",c).get(n+(a.content||""))){for(v=0;v<x.length;v++)if(u=x[v],u.getAttribute("content")===(a.content==null?null:""+a.content)&&u.getAttribute("name")===(a.name==null?null:a.name)&&u.getAttribute("property")===(a.property==null?null:a.property)&&u.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&u.getAttribute("charset")===(a.charSet==null?null:a.charSet)){x.splice(v,1);break t}}u=c.createElement(n),yt(u,n,a),c.head.appendChild(u);break;default:throw Error(i(468,n))}u[ot]=e,ft(u),n=u}e.stateNode=n}else Im(c,e.type,e.stateNode);else e.stateNode=Qm(c,n,e.memoizedProps);else u!==n?(u===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):u.count--,n===null?Im(c,e.type,e.stateNode):Qm(c,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Ii(e,e.memoizedProps,a.memoizedProps)}break;case 27:_t(t,e),Bt(e),n&512&&(tt||a===null||pa(a,a.return)),a!==null&&n&4&&Ii(e,e.memoizedProps,a.memoizedProps);break;case 5:if(_t(t,e),Bt(e),n&512&&(tt||a===null||pa(a,a.return)),e.flags&32){c=e.stateNode;try{Fn(c,"")}catch(Q){Ke(e,e.return,Q)}}n&4&&e.stateNode!=null&&(c=e.memoizedProps,Ii(e,c,a!==null?a.memoizedProps:c)),n&1024&&(ec=!0);break;case 6:if(_t(t,e),Bt(e),n&4){if(e.stateNode===null)throw Error(i(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(Q){Ke(e,e.return,Q)}}break;case 3:if(Zl=null,c=la,la=Xl(t.containerInfo),_t(t,e),la=c,Bt(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Ms(t.containerInfo)}catch(Q){Ke(e,e.return,Q)}ec&&(ec=!1,nm(e));break;case 4:n=la,la=Xl(e.stateNode.containerInfo),_t(t,e),Bt(e),la=n;break;case 12:_t(t,e),Bt(e);break;case 13:_t(t,e),Bt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(oc=De()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,tc(e,n)));break;case 22:c=e.memoizedState!==null;var M=a!==null&&a.memoizedState!==null,P=Ua,te=tt;if(Ua=P||c,tt=te||M,_t(t,e),tt=te,Ua=P,Bt(e),n&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(a===null||M||Ua||tt||On(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){M=a=t;try{if(u=M.stateNode,c)x=u.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{v=M.stateNode;var se=M.memoizedProps.style,G=se!=null&&se.hasOwnProperty("display")?se.display:null;v.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(Q){Ke(M,M.return,Q)}}}else if(t.tag===6){if(a===null){M=t;try{M.stateNode.nodeValue=c?"":M.memoizedProps}catch(Q){Ke(M,M.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,tc(e,a))));break;case 19:_t(t,e),Bt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,tc(e,n)));break;case 30:break;case 21:break;default:_t(t,e),Bt(e)}}function Bt(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(Qf(n)){a=n;break}n=n.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var c=a.stateNode,u=Ji(e);Dl(e,u,c);break;case 5:var x=a.stateNode;a.flags&32&&(Fn(x,""),a.flags&=-33);var v=Ji(e);Dl(e,v,x);break;case 3:case 4:var M=a.stateNode.containerInfo,P=Ji(e);Wi(e,P,M);break;default:throw Error(i(161))}}catch(te){Ke(e,e.return,te)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function nm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;nm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function en(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Jf(e,t.alternate,t),t=t.sibling}function On(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Wa(4,t,t.return),On(t);break;case 1:pa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Ff(t,t.return,a),On(t);break;case 27:Ns(t.stateNode);case 26:case 5:pa(t,t.return),On(t);break;case 22:t.memoizedState===null&&On(t);break;case 30:On(t);break;default:On(t)}e=e.sibling}}function tn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,c=e,u=t,x=u.flags;switch(u.tag){case 0:case 11:case 15:tn(c,u,a),ms(4,u);break;case 1:if(tn(c,u,a),n=u,c=n.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(P){Ke(n,n.return,P)}if(n=u,c=n.updateQueue,c!==null){var v=n.stateNode;try{var M=c.shared.hiddenCallbacks;if(M!==null)for(c.shared.hiddenCallbacks=null,c=0;c<M.length;c++)Md(M[c],v)}catch(P){Ke(n,n.return,P)}}a&&x&64&&Yf(u),hs(u,u.return);break;case 27:Zf(u);case 26:case 5:tn(c,u,a),a&&n===null&&x&4&&Xf(u),hs(u,u.return);break;case 12:tn(c,u,a);break;case 13:tn(c,u,a),a&&x&4&&tm(c,u);break;case 22:u.memoizedState===null&&tn(c,u,a),hs(u,u.return);break;case 30:break;default:tn(c,u,a)}t=t.sibling}}function ac(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Wr(a))}function nc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wr(e))}function xa(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rm(e,t,a,n),t=t.sibling}function rm(e,t,a,n){var c=t.flags;switch(t.tag){case 0:case 11:case 15:xa(e,t,a,n),c&2048&&ms(9,t);break;case 1:xa(e,t,a,n);break;case 3:xa(e,t,a,n),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wr(e)));break;case 12:if(c&2048){xa(e,t,a,n),e=t.stateNode;try{var u=t.memoizedProps,x=u.id,v=u.onPostCommit;typeof v=="function"&&v(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){Ke(t,t.return,M)}}else xa(e,t,a,n);break;case 13:xa(e,t,a,n);break;case 23:break;case 22:u=t.stateNode,x=t.alternate,t.memoizedState!==null?u._visibility&2?xa(e,t,a,n):gs(e,t):u._visibility&2?xa(e,t,a,n):(u._visibility|=2,fr(e,t,a,n,(t.subtreeFlags&10256)!==0)),c&2048&&ac(x,t);break;case 24:xa(e,t,a,n),c&2048&&nc(t.alternate,t);break;default:xa(e,t,a,n)}}function fr(e,t,a,n,c){for(c=c&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var u=e,x=t,v=a,M=n,P=x.flags;switch(x.tag){case 0:case 11:case 15:fr(u,x,v,M,c),ms(8,x);break;case 23:break;case 22:var te=x.stateNode;x.memoizedState!==null?te._visibility&2?fr(u,x,v,M,c):gs(u,x):(te._visibility|=2,fr(u,x,v,M,c)),c&&P&2048&&ac(x.alternate,x);break;case 24:fr(u,x,v,M,c),c&&P&2048&&nc(x.alternate,x);break;default:fr(u,x,v,M,c)}t=t.sibling}}function gs(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,c=n.flags;switch(n.tag){case 22:gs(a,n),c&2048&&ac(n.alternate,n);break;case 24:gs(a,n),c&2048&&nc(n.alternate,n);break;default:gs(a,n)}t=t.sibling}}var ps=8192;function mr(e){if(e.subtreeFlags&ps)for(e=e.child;e!==null;)sm(e),e=e.sibling}function sm(e){switch(e.tag){case 26:mr(e),e.flags&ps&&e.memoizedState!==null&&tx(la,e.memoizedState,e.memoizedProps);break;case 5:mr(e);break;case 3:case 4:var t=la;la=Xl(e.stateNode.containerInfo),mr(e),la=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ps,ps=16777216,mr(e),ps=t):mr(e));break;default:mr(e)}}function lm(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 xs(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];ht=n,im(n,e)}lm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)om(e),e=e.sibling}function om(e){switch(e.tag){case 0:case 11:case 15:xs(e),e.flags&2048&&Wa(9,e,e.return);break;case 3:xs(e);break;case 12:xs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ll(e)):xs(e);break;default:xs(e)}}function Ll(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];ht=n,im(n,e)}lm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Wa(8,t,t.return),Ll(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ll(t));break;default:Ll(t)}e=e.sibling}}function im(e,t){for(;ht!==null;){var a=ht;switch(a.tag){case 0:case 11:case 15:Wa(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Wr(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,ht=n;else e:for(a=e;ht!==null;){n=ht;var c=n.sibling,u=n.return;if(Wf(n),n===a){ht=null;break e}if(c!==null){c.return=u,ht=c;break e}ht=u}}}var xp={getCacheForType:function(e){var t=wt(it),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a}},yp=typeof WeakMap=="function"?WeakMap:Map,He=0,$e=null,Oe=null,Ue=0,qe=0,Ht=null,an=!1,hr=!1,rc=!1,La=0,Je=0,nn=0,zn=0,sc=0,It=0,gr=0,ys=null,Mt=null,lc=!1,oc=0,_l=1/0,Bl=null,rn=null,xt=0,sn=null,pr=null,xr=0,ic=0,cc=null,cm=null,bs=0,uc=null;function qt(){if((He&2)!==0&&Ue!==0)return Ue&-Ue;if(T.T!==null){var e=rr;return e!==0?e:xc()}return _r()}function um(){It===0&&(It=(Ue&536870912)===0||_e?fe():536870912);var e=Zt.current;return e!==null&&(e.flags|=32),It}function Pt(e,t,a){(e===$e&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(yr(e,0),ln(e,Ue,It,!1)),na(e,a),((He&2)===0||e!==$e)&&(e===$e&&((He&2)===0&&(zn|=a),Je===4&&ln(e,Ue,It,!1)),ya(e))}function dm(e,t,a){if((He&6)!==0)throw Error(i(327));var n=!a&&(t&124)===0&&(t&e.expiredLanes)===0||ie(e,t),c=n?wp(e,t):mc(e,t,!0),u=n;do{if(c===0){hr&&!n&&ln(e,t,0,!1);break}else{if(a=e.current.alternate,u&&!bp(a)){c=mc(e,t,!1),u=!1;continue}if(c===2){if(u=t,e.errorRecoveryDisabledLanes&u)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var v=e;c=ys;var M=v.current.memoizedState.isDehydrated;if(M&&(yr(v,x).flags|=256),x=mc(v,x,!1),x!==2){if(rc&&!M){v.errorRecoveryDisabledLanes|=u,zn|=u,c=4;break e}u=Mt,Mt=c,u!==null&&(Mt===null?Mt=u:Mt.push.apply(Mt,u))}c=x}if(u=!1,c!==2)continue}}if(c===1){yr(e,0),ln(e,t,0,!0);break}e:{switch(n=e,u=c,u){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:ln(n,t,It,!an);break e;case 2:Mt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=oc+300-De(),10<c)){if(ln(n,t,It,!an),Se(n,0,!0)!==0)break e;n.timeoutHandle=qm(fm.bind(null,n,a,Mt,Bl,lc,t,It,zn,gr,an,u,2,-0,0),c);break e}fm(n,a,Mt,Bl,lc,t,It,zn,gr,an,u,0,-0,0)}}break}while(!0);ya(e)}function fm(e,t,a,n,c,u,x,v,M,P,te,se,G,Q){if(e.timeoutHandle=-1,se=t.subtreeFlags,(se&8192||(se&16785408)===16785408)&&(Es={stylesheets:null,count:0,unsuspend:ex},sm(t),se=ax(),se!==null)){e.cancelPendingCommit=se(bm.bind(null,e,t,u,a,n,c,x,v,M,te,1,G,Q)),ln(e,u,x,!P);return}bm(e,t,u,a,n,c,x,v,M)}function bp(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 c=a[n],u=c.getSnapshot;c=c.value;try{if(!Dt(u(),c))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ln(e,t,a,n){t&=~sc,t&=~zn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var c=t;0<c;){var u=31-at(c),x=1<<u;n[u]=-1,c&=~x}a!==0&&Xs(e,a,t)}function Hl(){return(He&6)===0?(vs(0),!1):!0}function dc(){if(Oe!==null){if(qe===0)var e=Oe.return;else e=Oe,Ta=kn=null,Ti(e),ur=null,us=0,e=Oe;for(;e!==null;)$f(e.alternate,e),e=e.return;Oe=null}}function yr(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,_p(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),dc(),$e=e,Oe=a=Ca(e.current,null),Ue=t,qe=0,Ht=null,an=!1,hr=ie(e,t),rc=!1,gr=It=sc=zn=nn=Je=0,Mt=ys=null,lc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var c=31-at(n),u=1<<c;t|=e[c],n&=~u}return La=t,ol(),a}function mm(e,t){Ae=null,T.H=El,t===ts||t===pl?(t=Ad(),qe=3):t===Ed?(t=Ad(),qe=4):qe=t===Mf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ht=t,Oe===null&&(Je=1,Ml(e,Yt(t,e.current)))}function hm(){var e=T.H;return T.H=El,e===null?El:e}function gm(){var e=T.A;return T.A=xp,e}function fc(){Je=4,an||(Ue&4194048)!==Ue&&Zt.current!==null||(hr=!0),(nn&134217727)===0&&(zn&134217727)===0||$e===null||ln($e,Ue,It,!1)}function mc(e,t,a){var n=He;He|=2;var c=hm(),u=gm();($e!==e||Ue!==t)&&(Bl=null,yr(e,t)),t=!1;var x=Je;e:do try{if(qe!==0&&Oe!==null){var v=Oe,M=Ht;switch(qe){case 8:dc(),x=6;break e;case 3:case 2:case 9:case 6:Zt.current===null&&(t=!0);var P=qe;if(qe=0,Ht=null,br(e,v,M,P),a&&hr){x=0;break e}break;default:P=qe,qe=0,Ht=null,br(e,v,M,P)}}vp(),x=Je;break}catch(te){mm(e,te)}while(!0);return t&&e.shellSuspendCounter++,Ta=kn=null,He=n,T.H=c,T.A=u,Oe===null&&($e=null,Ue=0,ol()),x}function vp(){for(;Oe!==null;)pm(Oe)}function wp(e,t){var a=He;He|=2;var n=hm(),c=gm();$e!==e||Ue!==t?(Bl=null,_l=De()+500,yr(e,t)):hr=ie(e,t);e:do try{if(qe!==0&&Oe!==null){t=Oe;var u=Ht;t:switch(qe){case 1:qe=0,Ht=null,br(e,t,u,1);break;case 2:case 9:if(kd(u)){qe=0,Ht=null,xm(t);break}t=function(){qe!==2&&qe!==9||$e!==e||(qe=7),ya(e)},u.then(t,t);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:kd(u)?(qe=0,Ht=null,xm(t)):(qe=0,Ht=null,br(e,t,u,7));break;case 5:var x=null;switch(Oe.tag){case 26:x=Oe.memoizedState;case 5:case 27:var v=Oe;if(!x||Jm(x)){qe=0,Ht=null;var M=v.sibling;if(M!==null)Oe=M;else{var P=v.return;P!==null?(Oe=P,ql(P)):Oe=null}break t}}qe=0,Ht=null,br(e,t,u,5);break;case 6:qe=0,Ht=null,br(e,t,u,6);break;case 8:dc(),Je=6;break e;default:throw Error(i(462))}}jp();break}catch(te){mm(e,te)}while(!0);return Ta=kn=null,T.H=n,T.A=c,He=a,Oe!==null?0:($e=null,Ue=0,ol(),Je)}function jp(){for(;Oe!==null&&!wa();)pm(Oe)}function pm(e){var t=Gf(e.alternate,e,La);e.memoizedProps=e.pendingProps,t===null?ql(e):Oe=t}function xm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=_f(a,t,t.pendingProps,t.type,void 0,Ue);break;case 11:t=_f(a,t,t.pendingProps,t.type.render,t.ref,Ue);break;case 5:Ti(t);default:$f(a,t),t=Oe=xd(t,La),t=Gf(a,t,La)}e.memoizedProps=e.pendingProps,t===null?ql(e):Oe=t}function br(e,t,a,n){Ta=kn=null,Ti(t),ur=null,us=0;var c=t.return;try{if(dp(e,c,t,a,Ue)){Je=1,Ml(e,Yt(a,e.current)),Oe=null;return}}catch(u){if(c!==null)throw Oe=c,u;Je=1,Ml(e,Yt(a,e.current)),Oe=null;return}t.flags&32768?(_e||n===1?e=!0:hr||(Ue&536870912)!==0?e=!1:(an=e=!0,(n===2||n===9||n===3||n===6)&&(n=Zt.current,n!==null&&n.tag===13&&(n.flags|=16384))),ym(t,e)):ql(t)}function ql(e){var t=e;do{if((t.flags&32768)!==0){ym(t,an);return}e=t.return;var a=mp(t.alternate,t,La);if(a!==null){Oe=a;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);Je===0&&(Je=5)}function ym(e,t){do{var a=hp(e.alternate,e);if(a!==null){a.flags&=32767,Oe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=a}while(e!==null);Je=6,Oe=null}function bm(e,t,a,n,c,u,x,v,M){e.cancelPendingCommit=null;do Pl();while(xt!==0);if((He&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(u=t.lanes|t.childLanes,u|=ni,xn(e,a,u,x,v,M),e===$e&&(Oe=$e=null,Ue=0),pr=t,sn=e,xr=a,ic=u,cc=c,cm=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ep(Gt,function(){return Sm(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=T.T,T.T=null,c=q.p,q.p=2,x=He,He|=4;try{gp(e,t,a)}finally{He=x,q.p=c,T.T=n}}xt=1,vm(),wm(),jm()}}function vm(){if(xt===1){xt=0;var e=sn,t=pr,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=T.T,T.T=null;var n=q.p;q.p=2;var c=He;He|=4;try{am(t,e);var u=Cc,x=od(e.containerInfo),v=u.focusedElem,M=u.selectionRange;if(x!==v&&v&&v.ownerDocument&&ld(v.ownerDocument.documentElement,v)){if(M!==null&&Jo(v)){var P=M.start,te=M.end;if(te===void 0&&(te=P),"selectionStart"in v)v.selectionStart=P,v.selectionEnd=Math.min(te,v.value.length);else{var se=v.ownerDocument||document,G=se&&se.defaultView||window;if(G.getSelection){var Q=G.getSelection(),Ne=v.textContent.length,ve=Math.min(M.start,Ne),Ge=M.end===void 0?ve:Math.min(M.end,Ne);!Q.extend&&ve>Ge&&(x=Ge,Ge=ve,ve=x);var _=sd(v,ve),D=sd(v,Ge);if(_&&D&&(Q.rangeCount!==1||Q.anchorNode!==_.node||Q.anchorOffset!==_.offset||Q.focusNode!==D.node||Q.focusOffset!==D.offset)){var H=se.createRange();H.setStart(_.node,_.offset),Q.removeAllRanges(),ve>Ge?(Q.addRange(H),Q.extend(D.node,D.offset)):(H.setEnd(D.node,D.offset),Q.addRange(H))}}}}for(se=[],Q=v;Q=Q.parentNode;)Q.nodeType===1&&se.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<se.length;v++){var ne=se[v];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}Wl=!!Sc,Cc=Sc=null}finally{He=c,q.p=n,T.T=a}}e.current=t,xt=2}}function wm(){if(xt===2){xt=0;var e=sn,t=pr,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=T.T,T.T=null;var n=q.p;q.p=2;var c=He;He|=4;try{Jf(e,t.alternate,t)}finally{He=c,q.p=n,T.T=a}}xt=3}}function jm(){if(xt===4||xt===3){xt=0,ca();var e=sn,t=pr,a=xr,n=cm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?xt=5:(xt=0,pr=sn=null,Nm(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(rn=null),Hn(a),t=t.stateNode,lt&&typeof lt.onCommitFiberRoot=="function")try{lt.onCommitFiberRoot(Ot,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=T.T,c=q.p,q.p=2,T.T=null;try{for(var u=e.onRecoverableError,x=0;x<n.length;x++){var v=n[x];u(v.value,{componentStack:v.stack})}}finally{T.T=t,q.p=c}}(xr&3)!==0&&Pl(),ya(e),c=e.pendingLanes,(a&4194090)!==0&&(c&42)!==0?e===uc?bs++:(bs=0,uc=e):bs=0,vs(0)}}function Nm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Wr(t)))}function Pl(e){return vm(),wm(),jm(),Sm()}function Sm(){if(xt!==5)return!1;var e=sn,t=ic;ic=0;var a=Hn(xr),n=T.T,c=q.p;try{q.p=32>a?32:a,T.T=null,a=cc,cc=null;var u=sn,x=xr;if(xt=0,pr=sn=null,xr=0,(He&6)!==0)throw Error(i(331));var v=He;if(He|=4,om(u.current),rm(u,u.current,x,a),He=v,vs(0,!1),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot(Ot,u)}catch{}return!0}finally{q.p=c,T.T=n,Nm(e,t)}}function Cm(e,t,a){t=Yt(a,t),t=Vi(e.stateNode,t,2),e=Qa(e,t,2),e!==null&&(na(e,2),ya(e))}function Ke(e,t,a){if(e.tag===3)Cm(e,e,a);else for(;t!==null;){if(t.tag===3){Cm(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(rn===null||!rn.has(n))){e=Yt(a,e),a=Af(2),n=Qa(t,a,2),n!==null&&(Rf(a,n,t,e),na(n,2),ya(n));break}}t=t.return}}function hc(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new yp;var c=new Set;n.set(t,c)}else c=n.get(t),c===void 0&&(c=new Set,n.set(t,c));c.has(a)||(rc=!0,c.add(a),e=Np.bind(null,e,t,a),t.then(e,e))}function Np(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,$e===e&&(Ue&a)===a&&(Je===4||Je===3&&(Ue&62914560)===Ue&&300>De()-oc?(He&2)===0&&yr(e,0):sc|=a,gr===Ue&&(gr=0)),ya(e)}function Em(e,t){t===0&&(t=dt()),e=er(e,t),e!==null&&(na(e,t),ya(e))}function Sp(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Em(e,a)}function Cp(e,t){var a=0;switch(e.tag){case 13:var n=e.stateNode,c=e.memoizedState;c!==null&&(a=c.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(i(314))}n!==null&&n.delete(t),Em(e,a)}function Ep(e,t){return Be(e,t)}var Vl=null,vr=null,gc=!1,Gl=!1,pc=!1,Un=0;function ya(e){e!==vr&&e.next===null&&(vr===null?Vl=vr=e:vr=vr.next=e),Gl=!0,gc||(gc=!0,Tp())}function vs(e,t){if(!pc&&Gl){pc=!0;do for(var a=!1,n=Vl;n!==null;){if(e!==0){var c=n.pendingLanes;if(c===0)var u=0;else{var x=n.suspendedLanes,v=n.pingedLanes;u=(1<<31-at(42|e)+1)-1,u&=c&~(x&~v),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,Rm(n,u))}else u=Ue,u=Se(n,n===$e?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(u&3)===0||ie(n,u)||(a=!0,Rm(n,u));n=n.next}while(a);pc=!1}}function kp(){km()}function km(){Gl=gc=!1;var e=0;Un!==0&&(Lp()&&(e=Un),Un=0);for(var t=De(),a=null,n=Vl;n!==null;){var c=n.next,u=Tm(n,t);u===0?(n.next=null,a===null?Vl=c:a.next=c,c===null&&(vr=a)):(a=n,(e!==0||(u&3)!==0)&&(Gl=!0)),n=c}vs(e)}function Tm(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,c=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var x=31-at(u),v=1<<x,M=c[x];M===-1?((v&a)===0||(v&n)!==0)&&(c[x]=ce(v,t)):M<=t&&(e.expiredLanes|=v),u&=~v}if(t=$e,a=Ue,a=Se(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&st(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||ie(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&st(n),Hn(a)){case 2:case 8:a=da;break;case 32:a=Gt;break;case 268435456:a=gn;break;default:a=Gt}return n=Am.bind(null,e),a=Be(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&st(n),e.callbackPriority=2,e.callbackNode=null,2}function Am(e,t){if(xt!==0&&xt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Pl()&&e.callbackNode!==a)return null;var n=Ue;return n=Se(e,e===$e?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(dm(e,n,t),Tm(e,De()),e.callbackNode!=null&&e.callbackNode===a?Am.bind(null,e):null)}function Rm(e,t){if(Pl())return null;dm(e,t,!0)}function Tp(){Bp(function(){(He&6)!==0?Be(ua,kp):km()})}function xc(){return Un===0&&(Un=fe()),Un}function Mm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:el(""+e)}function Om(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 Ap(e,t,a,n,c){if(t==="submit"&&a&&a.stateNode===c){var u=Mm((c[St]||null).action),x=n.submitter;x&&(t=(t=x[St]||null)?Mm(t.formAction):x.getAttribute("formAction"),t!==null&&(u=t,x=null));var v=new rl("action","action",null,n,c);e.push({event:v,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Un!==0){var M=x?Om(c,x):new FormData(c);_i(a,{pending:!0,data:M,method:c.method,action:u},null,M)}}else typeof u=="function"&&(v.preventDefault(),M=x?Om(c,x):new FormData(c),_i(a,{pending:!0,data:M,method:c.method,action:u},u,M))},currentTarget:c}]})}}for(var yc=0;yc<ai.length;yc++){var bc=ai[yc],Rp=bc.toLowerCase(),Mp=bc[0].toUpperCase()+bc.slice(1);sa(Rp,"on"+Mp)}sa(ud,"onAnimationEnd"),sa(dd,"onAnimationIteration"),sa(fd,"onAnimationStart"),sa("dblclick","onDoubleClick"),sa("focusin","onFocus"),sa("focusout","onBlur"),sa(X0,"onTransitionRun"),sa(Q0,"onTransitionStart"),sa(Z0,"onTransitionCancel"),sa(md,"onTransitionEnd"),Kn("onMouseEnter",["mouseout","mouseover"]),Kn("onMouseLeave",["mouseout","mouseover"]),Kn("onPointerEnter",["pointerout","pointerover"]),Kn("onPointerLeave",["pointerout","pointerover"]),yn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),yn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),yn("onBeforeInput",["compositionend","keypress","textInput","paste"]),yn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),yn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),yn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ws="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(" "),Op=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ws));function zm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],c=n.event;n=n.listeners;e:{var u=void 0;if(t)for(var x=n.length-1;0<=x;x--){var v=n[x],M=v.instance,P=v.currentTarget;if(v=v.listener,M!==u&&c.isPropagationStopped())break e;u=v,c.currentTarget=P;try{u(c)}catch(te){Rl(te)}c.currentTarget=null,u=M}else for(x=0;x<n.length;x++){if(v=n[x],M=v.instance,P=v.currentTarget,v=v.listener,M!==u&&c.isPropagationStopped())break e;u=v,c.currentTarget=P;try{u(c)}catch(te){Rl(te)}c.currentTarget=null,u=M}}}}function ze(e,t){var a=t[Oo];a===void 0&&(a=t[Oo]=new Set);var n=e+"__bubble";a.has(n)||(Um(t,e,2,!1),a.add(n))}function vc(e,t,a){var n=0;t&&(n|=4),Um(a,e,n,t)}var Kl="_reactListening"+Math.random().toString(36).slice(2);function wc(e){if(!e[Kl]){e[Kl]=!0,Eu.forEach(function(a){a!=="selectionchange"&&(Op.has(a)||vc(a,!1,e),vc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Kl]||(t[Kl]=!0,vc("selectionchange",!1,t))}}function Um(e,t,a,n){switch(rh(t)){case 2:var c=sx;break;case 8:c=lx;break;default:c=Dc}a=c.bind(null,t,a,e),c=void 0,!Go||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),n?c!==void 0?e.addEventListener(t,a,{capture:!0,passive:c}):e.addEventListener(t,a,!0):c!==void 0?e.addEventListener(t,a,{passive:c}):e.addEventListener(t,a,!1)}function jc(e,t,a,n,c){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 v=n.stateNode.containerInfo;if(v===c)break;if(x===4)for(x=n.return;x!==null;){var M=x.tag;if((M===3||M===4)&&x.stateNode.containerInfo===c)return;x=x.return}for(;v!==null;){if(x=Pn(v),x===null)return;if(M=x.tag,M===5||M===6||M===26||M===27){n=u=x;continue e}v=v.parentNode}}n=n.return}qu(function(){var P=u,te=Po(a),se=[];e:{var G=hd.get(e);if(G!==void 0){var Q=rl,Ne=e;switch(e){case"keypress":if(al(a)===0)break e;case"keydown":case"keyup":Q=E0;break;case"focusin":Ne="focus",Q=Fo;break;case"focusout":Ne="blur",Q=Fo;break;case"beforeblur":case"afterblur":Q=Fo;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=Gu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=h0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=A0;break;case ud:case dd:case fd:Q=x0;break;case md:Q=M0;break;case"scroll":case"scrollend":Q=f0;break;case"wheel":Q=z0;break;case"copy":case"cut":case"paste":Q=b0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=$u;break;case"toggle":case"beforetoggle":Q=D0}var ve=(t&4)!==0,Ge=!ve&&(e==="scroll"||e==="scrollend"),_=ve?G!==null?G+"Capture":null:G;ve=[];for(var D=P,H;D!==null;){var ne=D;if(H=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||H===null||_===null||(ne=qr(D,_),ne!=null&&ve.push(js(D,ne,H))),Ge)break;D=D.return}0<ve.length&&(G=new Q(G,Ne,null,a,te),se.push({event:G,listeners:ve}))}}if((t&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",G&&a!==qo&&(Ne=a.relatedTarget||a.fromElement)&&(Pn(Ne)||Ne[qn]))break e;if((Q||G)&&(G=te.window===te?te:(G=te.ownerDocument)?G.defaultView||G.parentWindow:window,Q?(Ne=a.relatedTarget||a.toElement,Q=P,Ne=Ne?Pn(Ne):null,Ne!==null&&(Ge=f(Ne),ve=Ne.tag,Ne!==Ge||ve!==5&&ve!==27&&ve!==6)&&(Ne=null)):(Q=null,Ne=P),Q!==Ne)){if(ve=Gu,ne="onMouseLeave",_="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(ve=$u,ne="onPointerLeave",_="onPointerEnter",D="pointer"),Ge=Q==null?G:Hr(Q),H=Ne==null?G:Hr(Ne),G=new ve(ne,D+"leave",Q,a,te),G.target=Ge,G.relatedTarget=H,ne=null,Pn(te)===P&&(ve=new ve(_,D+"enter",Ne,a,te),ve.target=H,ve.relatedTarget=Ge,ne=ve),Ge=ne,Q&&Ne)t:{for(ve=Q,_=Ne,D=0,H=ve;H;H=wr(H))D++;for(H=0,ne=_;ne;ne=wr(ne))H++;for(;0<D-H;)ve=wr(ve),D--;for(;0<H-D;)_=wr(_),H--;for(;D--;){if(ve===_||_!==null&&ve===_.alternate)break t;ve=wr(ve),_=wr(_)}ve=null}else ve=null;Q!==null&&Dm(se,G,Q,ve,!1),Ne!==null&&Ge!==null&&Dm(se,Ge,Ne,ve,!0)}}e:{if(G=P?Hr(P):window,Q=G.nodeName&&G.nodeName.toLowerCase(),Q==="select"||Q==="input"&&G.type==="file")var he=Wu;else if(Iu(G))if(ed)he=$0;else{he=G0;var Me=V0}else Q=G.nodeName,!Q||Q.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?P&&Ho(P.elementType)&&(he=Wu):he=K0;if(he&&(he=he(e,P))){Ju(se,he,a,te);break e}Me&&Me(e,G,P),e==="focusout"&&P&&G.type==="number"&&P.memoizedProps.value!=null&&Bo(G,"number",G.value)}switch(Me=P?Hr(P):window,e){case"focusin":(Iu(Me)||Me.contentEditable==="true")&&(In=Me,Wo=P,Xr=null);break;case"focusout":Xr=Wo=In=null;break;case"mousedown":ei=!0;break;case"contextmenu":case"mouseup":case"dragend":ei=!1,id(se,a,te);break;case"selectionchange":if(F0)break;case"keydown":case"keyup":id(se,a,te)}var ye;if(Qo)e:{switch(e){case"compositionstart":var we="onCompositionStart";break e;case"compositionend":we="onCompositionEnd";break e;case"compositionupdate":we="onCompositionUpdate";break e}we=void 0}else Zn?Qu(e,a)&&(we="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(we="onCompositionStart");we&&(Yu&&a.locale!=="ko"&&(Zn||we!=="onCompositionStart"?we==="onCompositionEnd"&&Zn&&(ye=Pu()):($a=te,Ko="value"in $a?$a.value:$a.textContent,Zn=!0)),Me=$l(P,we),0<Me.length&&(we=new Ku(we,e,null,a,te),se.push({event:we,listeners:Me}),ye?we.data=ye:(ye=Zu(a),ye!==null&&(we.data=ye)))),(ye=_0?B0(e,a):H0(e,a))&&(we=$l(P,"onBeforeInput"),0<we.length&&(Me=new Ku("onBeforeInput","beforeinput",null,a,te),se.push({event:Me,listeners:we}),Me.data=ye)),Ap(se,e,P,a,te)}zm(se,t)})}function js(e,t,a){return{instance:e,listener:t,currentTarget:a}}function $l(e,t){for(var a=t+"Capture",n=[];e!==null;){var c=e,u=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||u===null||(c=qr(e,a),c!=null&&n.unshift(js(e,c,u)),c=qr(e,t),c!=null&&n.push(js(e,c,u))),e.tag===3)return n;e=e.return}return[]}function wr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dm(e,t,a,n,c){for(var u=t._reactName,x=[];a!==null&&a!==n;){var v=a,M=v.alternate,P=v.stateNode;if(v=v.tag,M!==null&&M===n)break;v!==5&&v!==26&&v!==27||P===null||(M=P,c?(P=qr(a,u),P!=null&&x.unshift(js(a,P,M))):c||(P=qr(a,u),P!=null&&x.push(js(a,P,M)))),a=a.return}x.length!==0&&e.push({event:t,listeners:x})}var zp=/\r\n?/g,Up=/\u0000|\uFFFD/g;function Lm(e){return(typeof e=="string"?e:""+e).replace(zp,`
49
- `).replace(Up,"")}function _m(e,t){return t=Lm(t),Lm(e)===t}function Yl(){}function Ve(e,t,a,n,c,u){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Fn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Fn(e,""+n);break;case"className":Is(e,"class",n);break;case"tabIndex":Is(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Is(e,a,n);break;case"style":Bu(e,n,u);break;case"data":if(t!=="object"){Is(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=el(""+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"&&Ve(e,t,"name",c.name,c,null),Ve(e,t,"formEncType",c.formEncType,c,null),Ve(e,t,"formMethod",c.formMethod,c,null),Ve(e,t,"formTarget",c.formTarget,c,null)):(Ve(e,t,"encType",c.encType,c,null),Ve(e,t,"method",c.method,c,null),Ve(e,t,"target",c.target,c,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=el(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Yl);break;case"onScroll":n!=null&&ze("scroll",e);break;case"onScrollEnd":n!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(i(61));if(a=n.__html,a!=null){if(c.children!=null)throw Error(i(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=el(""+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":ze("beforetoggle",e),ze("toggle",e),Zs(e,"popover",n);break;case"xlinkActuate":Na(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Na(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Na(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Na(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Na(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Na(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Na(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Na(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Na(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Zs(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=u0.get(a)||a,Zs(e,a,n))}}function Nc(e,t,a,n,c,u){switch(a){case"style":Bu(e,n,u);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(i(61));if(a=n.__html,a!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Fn(e,n):(typeof n=="number"||typeof n=="bigint")&&Fn(e,""+n);break;case"onScroll":n!=null&&ze("scroll",e);break;case"onScrollEnd":n!=null&&ze("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Yl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ku.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(c=a.endsWith("Capture"),t=a.slice(2,c?a.length-7:void 0),u=e[St]||null,u=u!=null?u[a]:null,typeof u=="function"&&e.removeEventListener(t,u,c),typeof n=="function")){typeof u!="function"&&u!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,c);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Zs(e,a,n)}}}function yt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var n=!1,c=!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":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ve(e,t,u,x,a,null)}}c&&Ve(e,t,"srcSet",a.srcSet,a,null),n&&Ve(e,t,"src",a.src,a,null);return;case"input":ze("invalid",e);var v=u=x=c=null,M=null,P=null;for(n in a)if(a.hasOwnProperty(n)){var te=a[n];if(te!=null)switch(n){case"name":c=te;break;case"type":x=te;break;case"checked":M=te;break;case"defaultChecked":P=te;break;case"value":u=te;break;case"defaultValue":v=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(i(137,t));break;default:Ve(e,t,n,te,a,null)}}Uu(e,u,v,M,P,x,c,!1),Js(e);return;case"select":ze("invalid",e),n=x=u=null;for(c in a)if(a.hasOwnProperty(c)&&(v=a[c],v!=null))switch(c){case"value":u=v;break;case"defaultValue":x=v;break;case"multiple":n=v;default:Ve(e,t,c,v,a,null)}t=u,a=x,e.multiple=!!n,t!=null?Yn(e,!!n,t,!1):a!=null&&Yn(e,!!n,a,!0);return;case"textarea":ze("invalid",e),u=c=n=null;for(x in a)if(a.hasOwnProperty(x)&&(v=a[x],v!=null))switch(x){case"value":n=v;break;case"defaultValue":c=v;break;case"children":u=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(i(91));break;default:Ve(e,t,x,v,a,null)}Lu(e,n,c,u),Js(e);return;case"option":for(M in a)if(a.hasOwnProperty(M)&&(n=a[M],n!=null))switch(M){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Ve(e,t,M,n,a,null)}return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(n=0;n<ws.length;n++)ze(ws[n],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in a)if(a.hasOwnProperty(P)&&(n=a[P],n!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Ve(e,t,P,n,a,null)}return;default:if(Ho(t)){for(te in a)a.hasOwnProperty(te)&&(n=a[te],n!==void 0&&Nc(e,t,te,n,a,void 0));return}}for(v in a)a.hasOwnProperty(v)&&(n=a[v],n!=null&&Ve(e,t,v,n,a,null))}function Dp(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 c=null,u=null,x=null,v=null,M=null,P=null,te=null;for(Q in a){var se=a[Q];if(a.hasOwnProperty(Q)&&se!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":M=se;default:n.hasOwnProperty(Q)||Ve(e,t,Q,null,n,se)}}for(var G in n){var Q=n[G];if(se=a[G],n.hasOwnProperty(G)&&(Q!=null||se!=null))switch(G){case"type":u=Q;break;case"name":c=Q;break;case"checked":P=Q;break;case"defaultChecked":te=Q;break;case"value":x=Q;break;case"defaultValue":v=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,t));break;default:Q!==se&&Ve(e,t,G,Q,n,se)}}_o(e,x,v,M,P,te,u,c);return;case"select":Q=x=v=G=null;for(u in a)if(M=a[u],a.hasOwnProperty(u)&&M!=null)switch(u){case"value":break;case"multiple":Q=M;default:n.hasOwnProperty(u)||Ve(e,t,u,null,n,M)}for(c in n)if(u=n[c],M=a[c],n.hasOwnProperty(c)&&(u!=null||M!=null))switch(c){case"value":G=u;break;case"defaultValue":v=u;break;case"multiple":x=u;default:u!==M&&Ve(e,t,c,u,n,M)}t=v,a=x,n=Q,G!=null?Yn(e,!!a,G,!1):!!n!=!!a&&(t!=null?Yn(e,!!a,t,!0):Yn(e,!!a,a?[]:"",!1));return;case"textarea":Q=G=null;for(v in a)if(c=a[v],a.hasOwnProperty(v)&&c!=null&&!n.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Ve(e,t,v,null,n,c)}for(x in n)if(c=n[x],u=a[x],n.hasOwnProperty(x)&&(c!=null||u!=null))switch(x){case"value":G=c;break;case"defaultValue":Q=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==u&&Ve(e,t,x,c,n,u)}Du(e,G,Q);return;case"option":for(var Ne in a)if(G=a[Ne],a.hasOwnProperty(Ne)&&G!=null&&!n.hasOwnProperty(Ne))switch(Ne){case"selected":e.selected=!1;break;default:Ve(e,t,Ne,null,n,G)}for(M in n)if(G=n[M],Q=a[M],n.hasOwnProperty(M)&&G!==Q&&(G!=null||Q!=null))switch(M){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:Ve(e,t,M,G,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 ve in a)G=a[ve],a.hasOwnProperty(ve)&&G!=null&&!n.hasOwnProperty(ve)&&Ve(e,t,ve,null,n,G);for(P in n)if(G=n[P],Q=a[P],n.hasOwnProperty(P)&&G!==Q&&(G!=null||Q!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,t));break;default:Ve(e,t,P,G,n,Q)}return;default:if(Ho(t)){for(var Ge in a)G=a[Ge],a.hasOwnProperty(Ge)&&G!==void 0&&!n.hasOwnProperty(Ge)&&Nc(e,t,Ge,void 0,n,G);for(te in n)G=n[te],Q=a[te],!n.hasOwnProperty(te)||G===Q||G===void 0&&Q===void 0||Nc(e,t,te,G,n,Q);return}}for(var _ in a)G=a[_],a.hasOwnProperty(_)&&G!=null&&!n.hasOwnProperty(_)&&Ve(e,t,_,null,n,G);for(se in n)G=n[se],Q=a[se],!n.hasOwnProperty(se)||G===Q||G==null&&Q==null||Ve(e,t,se,G,n,Q)}var Sc=null,Cc=null;function Fl(e){return e.nodeType===9?e:e.ownerDocument}function Bm(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 Hm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Ec(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var kc=null;function Lp(){var e=window.event;return e&&e.type==="popstate"?e===kc?!1:(kc=e,!0):(kc=null,!1)}var qm=typeof setTimeout=="function"?setTimeout:void 0,_p=typeof clearTimeout=="function"?clearTimeout:void 0,Pm=typeof Promise=="function"?Promise:void 0,Bp=typeof queueMicrotask=="function"?queueMicrotask:typeof Pm<"u"?function(e){return Pm.resolve(null).then(e).catch(Hp)}:qm;function Hp(e){setTimeout(function(){throw e})}function on(e){return e==="head"}function Vm(e,t){var a=t,n=0,c=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&&Ns(x.documentElement),a&2&&Ns(x.body),a&4)for(a=x.head,Ns(a),x=a.firstChild;x;){var v=x.nextSibling,M=x.nodeName;x[Br]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&x.rel.toLowerCase()==="stylesheet"||a.removeChild(x),x=v}}if(c===0){e.removeChild(u),Ms(t);return}c--}else a==="$"||a==="$?"||a==="$!"?c++:n=a.charCodeAt(0)-48;else n=0;a=u}while(a);Ms(t)}function Tc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Tc(a),zo(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function qp(e,t,a,n){for(;e.nodeType===1;){var c=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Br])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=oa(e.nextSibling),e===null)break}return null}function Pp(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=oa(e.nextSibling),e===null))return null;return e}function Ac(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function Vp(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 oa(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var Rc=null;function Gm(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 Km(e,t,a){switch(t=Fl(a),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Ns(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);zo(e)}var Jt=new Map,$m=new Set;function Xl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _a=q.d;q.d={f:Gp,r:Kp,D:$p,C:Yp,L:Fp,m:Xp,X:Zp,S:Qp,M:Ip};function Gp(){var e=_a.f(),t=Hl();return e||t}function Kp(e){var t=Vn(e);t!==null&&t.tag===5&&t.type==="form"?df(t):_a.r(e)}var jr=typeof document>"u"?null:document;function Ym(e,t,a){var n=jr;if(n&&typeof t=="string"&&t){var c=$t(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof a=="string"&&(c+='[crossorigin="'+a+'"]'),$m.has(c)||($m.add(c),e={rel:e,crossOrigin:a,href:t},n.querySelector(c)===null&&(t=n.createElement("link"),yt(t,"link",e),ft(t),n.head.appendChild(t)))}}function $p(e){_a.D(e),Ym("dns-prefetch",e,null)}function Yp(e,t){_a.C(e,t),Ym("preconnect",e,t)}function Fp(e,t,a){_a.L(e,t,a);var n=jr;if(n&&e&&t){var c='link[rel="preload"][as="'+$t(t)+'"]';t==="image"&&a&&a.imageSrcSet?(c+='[imagesrcset="'+$t(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(c+='[imagesizes="'+$t(a.imageSizes)+'"]')):c+='[href="'+$t(e)+'"]';var u=c;switch(t){case"style":u=Nr(e);break;case"script":u=Sr(e)}Jt.has(u)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Jt.set(u,e),n.querySelector(c)!==null||t==="style"&&n.querySelector(Ss(u))||t==="script"&&n.querySelector(Cs(u))||(t=n.createElement("link"),yt(t,"link",e),ft(t),n.head.appendChild(t)))}}function Xp(e,t){_a.m(e,t);var a=jr;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+$t(n)+'"][href="'+$t(e)+'"]',u=c;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Sr(e)}if(!Jt.has(u)&&(e=y({rel:"modulepreload",href:e},t),Jt.set(u,e),a.querySelector(c)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Cs(u)))return}n=a.createElement("link"),yt(n,"link",e),ft(n),a.head.appendChild(n)}}}function Qp(e,t,a){_a.S(e,t,a);var n=jr;if(n&&e){var c=Gn(n).hoistableStyles,u=Nr(e);t=t||"default";var x=c.get(u);if(!x){var v={loading:0,preload:null};if(x=n.querySelector(Ss(u)))v.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Jt.get(u))&&Mc(e,a);var M=x=n.createElement("link");ft(M),yt(M,"link",e),M._p=new Promise(function(P,te){M.onload=P,M.onerror=te}),M.addEventListener("load",function(){v.loading|=1}),M.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Ql(x,t,n)}x={type:"stylesheet",instance:x,count:1,state:v},c.set(u,x)}}}function Zp(e,t){_a.X(e,t);var a=jr;if(a&&e){var n=Gn(a).hoistableScripts,c=Sr(e),u=n.get(c);u||(u=a.querySelector(Cs(c)),u||(e=y({src:e,async:!0},t),(t=Jt.get(c))&&Oc(e,t),u=a.createElement("script"),ft(u),yt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(c,u))}}function Ip(e,t){_a.M(e,t);var a=jr;if(a&&e){var n=Gn(a).hoistableScripts,c=Sr(e),u=n.get(c);u||(u=a.querySelector(Cs(c)),u||(e=y({src:e,async:!0,type:"module"},t),(t=Jt.get(c))&&Oc(e,t),u=a.createElement("script"),ft(u),yt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(c,u))}}function Fm(e,t,a,n){var c=(c=W.current)?Xl(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Nr(a.href),a=Gn(c).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=Nr(a.href);var u=Gn(c).hoistableStyles,x=u.get(e);if(x||(c=c.ownerDocument||c,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,x),(u=c.querySelector(Ss(e)))&&!u._p&&(x.instance=u,x.state.loading=5),Jt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Jt.set(e,a),u||Jp(c,e,a,x.state))),t&&n===null)throw Error(i(528,""));return x}if(t&&n!==null)throw Error(i(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Sr(a),a=Gn(c).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(i(444,e))}}function Nr(e){return'href="'+$t(e)+'"'}function Ss(e){return'link[rel="stylesheet"]['+e+"]"}function Xm(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Jp(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}),yt(t,"link",a),ft(t),e.head.appendChild(t))}function Sr(e){return'[src="'+$t(e)+'"]'}function Cs(e){return"script[async]"+e}function Qm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+$t(a.href)+'"]');if(n)return t.instance=n,ft(n),n;var c=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ft(n),yt(n,"style",c),Ql(n,a.precedence,e),t.instance=n;case"stylesheet":c=Nr(a.href);var u=e.querySelector(Ss(c));if(u)return t.state.loading|=4,t.instance=u,ft(u),u;n=Xm(a),(c=Jt.get(c))&&Mc(n,c),u=(e.ownerDocument||e).createElement("link"),ft(u);var x=u;return x._p=new Promise(function(v,M){x.onload=v,x.onerror=M}),yt(u,"link",n),t.state.loading|=4,Ql(u,a.precedence,e),t.instance=u;case"script":return u=Sr(a.src),(c=e.querySelector(Cs(u)))?(t.instance=c,ft(c),c):(n=a,(c=Jt.get(u))&&(n=y({},a),Oc(n,c)),e=e.ownerDocument||e,c=e.createElement("script"),ft(c),yt(c,"link",n),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Ql(n,a.precedence,e));return t.instance}function Ql(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=n.length?n[n.length-1]:null,u=c,x=0;x<n.length;x++){var v=n[x];if(v.dataset.precedence===t)u=v;else if(u!==c)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Mc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Oc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Zl=null;function Zm(e,t,a){if(Zl===null){var n=new Map,c=Zl=new Map;c.set(a,n)}else c=Zl,n=c.get(a),n||(n=new Map,c.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),c=0;c<a.length;c++){var u=a[c];if(!(u[Br]||u[ot]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var x=u.getAttribute(t)||"";x=e+x;var v=n.get(x);v?v.push(u):n.set(x,[u])}}return n}function Im(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Wp(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 Jm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var Es=null;function ex(){}function tx(e,t,a){if(Es===null)throw Error(i(475));var n=Es;if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var c=Nr(a.href),u=e.querySelector(Ss(c));if(u){e=u._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(n.count++,n=Il.bind(n),e.then(n,n)),t.state.loading|=4,t.instance=u,ft(u);return}u=e.ownerDocument||e,a=Xm(a),(c=Jt.get(c))&&Mc(a,c),u=u.createElement("link"),ft(u);var x=u;x._p=new Promise(function(v,M){x.onload=v,x.onerror=M}),yt(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=Il.bind(n),e.addEventListener("load",t),e.addEventListener("error",t))}}function ax(){if(Es===null)throw Error(i(475));var e=Es;return e.stylesheets&&e.count===0&&zc(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&zc(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a)}}:null}function Il(){if(this.count--,this.count===0){if(this.stylesheets)zc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Jl=null;function zc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Jl=new Map,t.forEach(nx,e),Jl=null,Il.call(e))}function nx(e,t){if(!(t.state.loading&4)){var a=Jl.get(e);if(a)var n=a.get(null);else{a=new Map,Jl.set(e,a);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<c.length;u++){var x=c[u];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(a.set(x.dataset.precedence,x),n=x)}n&&a.set(null,n)}c=t.instance,x=c.getAttribute("data-precedence"),u=a.get(x)||n,u===n&&a.set(null,c),a.set(x,c),this.count++,n=Il.bind(this),c.addEventListener("load",n),c.addEventListener("error",n),u?u.parentNode.insertBefore(c,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ks={$$typeof:U,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function rx(e,t,a,n,c,u,x,v){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=aa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=aa(0),this.hiddenUpdates=aa(null),this.identifierPrefix=n,this.onUncaughtError=c,this.onCaughtError=u,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=v,this.incompleteTransitions=new Map}function Wm(e,t,a,n,c,u,x,v,M,P,te,se){return e=new rx(e,t,a,x,v,M,P,se),t=1,u===!0&&(t|=24),u=Lt(3,null,null,t),e.current=u,u.stateNode=e,t=hi(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:n,isDehydrated:a,cache:t},yi(u),e}function eh(e){return e?(e=tr,e):tr}function th(e,t,a,n,c,u){c=eh(c),n.context===null?n.context=c:n.pendingContext=c,n=Xa(t),n.payload={element:a},u=u===void 0?null:u,u!==null&&(n.callback=u),a=Qa(e,n,t),a!==null&&(Pt(a,e,t),ns(a,e,t))}function ah(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Uc(e,t){ah(e,t),(e=e.alternate)&&ah(e,t)}function nh(e){if(e.tag===13){var t=er(e,67108864);t!==null&&Pt(t,e,67108864),Uc(e,67108864)}}var Wl=!0;function sx(e,t,a,n){var c=T.T;T.T=null;var u=q.p;try{q.p=2,Dc(e,t,a,n)}finally{q.p=u,T.T=c}}function lx(e,t,a,n){var c=T.T;T.T=null;var u=q.p;try{q.p=8,Dc(e,t,a,n)}finally{q.p=u,T.T=c}}function Dc(e,t,a,n){if(Wl){var c=Lc(n);if(c===null)jc(e,t,n,eo,a),sh(e,n);else if(ix(c,e,t,a,n))n.stopPropagation();else if(sh(e,n),t&4&&-1<ox.indexOf(e)){for(;c!==null;){var u=Vn(c);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var x=vt(u.pendingLanes);if(x!==0){var v=u;for(v.pendingLanes|=2,v.entangledLanes|=2;x;){var M=1<<31-at(x);v.entanglements[1]|=M,x&=~M}ya(u),(He&6)===0&&(_l=De()+500,vs(0))}}break;case 13:v=er(u,2),v!==null&&Pt(v,u,2),Hl(),Uc(u,2)}if(u=Lc(n),u===null&&jc(e,t,n,eo,a),u===c)break;c=u}c!==null&&n.stopPropagation()}else jc(e,t,n,null,a)}}function Lc(e){return e=Po(e),_c(e)}var eo=null;function _c(e){if(eo=null,e=Pn(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return eo=e,null}function rh(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(bt()){case ua:return 2;case da:return 8;case Gt:case fa:return 32;case gn:return 268435456;default:return 32}default:return 32}}var Bc=!1,cn=null,un=null,dn=null,Ts=new Map,As=new Map,fn=[],ox="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 sh(e,t){switch(e){case"focusin":case"focusout":cn=null;break;case"dragenter":case"dragleave":un=null;break;case"mouseover":case"mouseout":dn=null;break;case"pointerover":case"pointerout":Ts.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":As.delete(t.pointerId)}}function Rs(e,t,a,n,c,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:u,targetContainers:[c]},t!==null&&(t=Vn(t),t!==null&&nh(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function ix(e,t,a,n,c){switch(t){case"focusin":return cn=Rs(cn,e,t,a,n,c),!0;case"dragenter":return un=Rs(un,e,t,a,n,c),!0;case"mouseover":return dn=Rs(dn,e,t,a,n,c),!0;case"pointerover":var u=c.pointerId;return Ts.set(u,Rs(Ts.get(u)||null,e,t,a,n,c)),!0;case"gotpointercapture":return u=c.pointerId,As.set(u,Rs(As.get(u)||null,e,t,a,n,c)),!0}return!1}function lh(e){var t=Pn(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,Qs(e.priority,function(){if(a.tag===13){var n=qt();n=ma(n);var c=er(a,n);c!==null&&Pt(c,a,n),Uc(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 to(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Lc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);qo=n,a.target.dispatchEvent(n),qo=null}else return t=Vn(a),t!==null&&nh(t),e.blockedOn=a,!1;t.shift()}return!0}function oh(e,t,a){to(e)&&a.delete(t)}function cx(){Bc=!1,cn!==null&&to(cn)&&(cn=null),un!==null&&to(un)&&(un=null),dn!==null&&to(dn)&&(dn=null),Ts.forEach(oh),As.forEach(oh)}function ao(e,t){e.blockedOn===t&&(e.blockedOn=null,Bc||(Bc=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,cx)))}var no=null;function ih(e){no!==e&&(no=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){no===e&&(no=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],c=e[t+2];if(typeof n!="function"){if(_c(n||a)===null)continue;break}var u=Vn(a);u!==null&&(e.splice(t,3),t-=3,_i(u,{pending:!0,data:c,method:a.method,action:n},n,c))}}))}function Ms(e){function t(M){return ao(M,e)}cn!==null&&ao(cn,e),un!==null&&ao(un,e),dn!==null&&ao(dn,e),Ts.forEach(t),As.forEach(t);for(var a=0;a<fn.length;a++){var n=fn[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<fn.length&&(a=fn[0],a.blockedOn===null);)lh(a),a.blockedOn===null&&fn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var c=a[n],u=a[n+1],x=c[St]||null;if(typeof u=="function")x||ih(a);else if(x){var v=null;if(u&&u.hasAttribute("formAction")){if(c=u,x=u[St]||null)v=x.formAction;else if(_c(c)!==null)continue}else v=x.action;typeof v=="function"?a[n+1]=v:(a.splice(n,3),n-=3),ih(a)}}}function Hc(e){this._internalRoot=e}ro.prototype.render=Hc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var a=t.current,n=qt();th(a,n,e,t,null,null)},ro.prototype.unmount=Hc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;th(e.current,2,null,e,null,null),Hl(),t[qn]=null}};function ro(e){this._internalRoot=e}ro.prototype.unstable_scheduleHydration=function(e){if(e){var t=_r();e={blockedOn:null,target:e,priority:t};for(var a=0;a<fn.length&&t!==0&&t<fn[a].priority;a++);fn.splice(a,0,e),a===0&&lh(e)}};var ch=o.version;if(ch!=="19.1.0")throw Error(i(527,ch,"19.1.0"));q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=g(t),e=e!==null?h(e):null,e=e===null?null:e.stateNode,e};var ux={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var so=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!so.isDisabled&&so.supportsFiber)try{Ot=so.inject(ux),lt=so}catch{}}return zs.createRoot=function(e,t){if(!d(e))throw Error(i(299));var a=!1,n="",c=Cf,u=Ef,x=kf,v=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(v=t.unstable_transitionCallbacks)),t=Wm(e,1,!1,null,null,a,n,c,u,x,v,null),e[qn]=t.current,wc(e),new Hc(t)},zs.hydrateRoot=function(e,t,a){if(!d(e))throw Error(i(299));var n=!1,c="",u=Cf,x=Ef,v=kf,M=null,P=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(M=a.unstable_transitionCallbacks),a.formState!==void 0&&(P=a.formState)),t=Wm(e,1,!0,t,a??null,n,c,u,x,v,M,P),t.context=eh(null),a=t.current,n=qt(),n=ma(n),c=Xa(n),c.callback=null,Qa(a,c,n),a=n,t.current.lanes=a,na(t,a),ya(t),e[qn]=t.current,wc(e),new ro(t)},zs.version="19.1.0",zs}var bh;function vx(){if(bh)return Vc.exports;bh=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(),Vc.exports=bx(),Vc.exports}var wx=vx();const vh=eg(wx);var Us={},wh;function jx(){if(wh)return Us;wh=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.parse=m,Us.serialize=h;const s=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,o=/^[\u0021-\u003A\u003C-\u007E]*$/,l=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,i=/^[\u0020-\u003A\u003D-\u007E]*$/,d=Object.prototype.toString,f=(()=>{const w=function(){};return w.prototype=Object.create(null),w})();function m(w,A){const C=new f,k=w.length;if(k<2)return C;const R=(A==null?void 0:A.decode)||y;let N=0;do{const E=w.indexOf("=",N);if(E===-1)break;const U=w.indexOf(";",N),X=U===-1?k:U;if(E>X){N=w.lastIndexOf(";",E-1)+1;continue}const L=p(w,N,E),ee=g(w,E,L),ae=w.slice(L,ee);if(C[ae]===void 0){let K=p(w,E+1,X),oe=g(w,X,K);const de=R(w.slice(K,oe));C[ae]=de}N=X+1}while(N<k);return C}function p(w,A,C){do{const k=w.charCodeAt(A);if(k!==32&&k!==9)return A}while(++A<C);return C}function g(w,A,C){for(;A>C;){const k=w.charCodeAt(--A);if(k!==32&&k!==9)return A+1}return C}function h(w,A,C){const k=(C==null?void 0:C.encode)||encodeURIComponent;if(!s.test(w))throw new TypeError(`argument name is invalid: ${w}`);const R=k(A);if(!o.test(R))throw new TypeError(`argument val is invalid: ${A}`);let N=w+"="+R;if(!C)return N;if(C.maxAge!==void 0){if(!Number.isInteger(C.maxAge))throw new TypeError(`option maxAge is invalid: ${C.maxAge}`);N+="; Max-Age="+C.maxAge}if(C.domain){if(!l.test(C.domain))throw new TypeError(`option domain is invalid: ${C.domain}`);N+="; Domain="+C.domain}if(C.path){if(!i.test(C.path))throw new TypeError(`option path is invalid: ${C.path}`);N+="; Path="+C.path}if(C.expires){if(!S(C.expires)||!Number.isFinite(C.expires.valueOf()))throw new TypeError(`option expires is invalid: ${C.expires}`);N+="; Expires="+C.expires.toUTCString()}if(C.httpOnly&&(N+="; HttpOnly"),C.secure&&(N+="; Secure"),C.partitioned&&(N+="; Partitioned"),C.priority)switch(typeof C.priority=="string"?C.priority.toLowerCase():void 0){case"low":N+="; Priority=Low";break;case"medium":N+="; Priority=Medium";break;case"high":N+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${C.priority}`)}if(C.sameSite)switch(typeof C.sameSite=="string"?C.sameSite.toLowerCase():C.sameSite){case!0:case"strict":N+="; SameSite=Strict";break;case"lax":N+="; SameSite=Lax";break;case"none":N+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${C.sameSite}`)}return N}function y(w){if(w.indexOf("%")===-1)return w;try{return decodeURIComponent(w)}catch{return w}}function S(w){return d.call(w)==="[object Date]"}return Us}jx();var jh="popstate";function Nx(s={}){function o(i,d){let{pathname:f,search:m,hash:p}=i.location;return Ic("",{pathname:f,search:m,hash:p},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function l(i,d){return typeof d=="string"?d:Hs(d)}return Cx(o,l,null,s)}function Qe(s,o){if(s===!1||s===null||typeof s>"u")throw new Error(o)}function ea(s,o){if(!s){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function Sx(){return Math.random().toString(36).substring(2,10)}function Nh(s,o){return{usr:s.state,key:s.key,idx:o}}function Ic(s,o,l=null,i){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof o=="string"?Or(o):o,state:l,key:o&&o.key||i||Sx()}}function Hs({pathname:s="/",search:o="",hash:l=""}){return o&&o!=="?"&&(s+=o.charAt(0)==="?"?o:"?"+o),l&&l!=="#"&&(s+=l.charAt(0)==="#"?l:"#"+l),s}function Or(s){let o={};if(s){let l=s.indexOf("#");l>=0&&(o.hash=s.substring(l),s=s.substring(0,l));let i=s.indexOf("?");i>=0&&(o.search=s.substring(i),s=s.substring(0,i)),s&&(o.pathname=s)}return o}function Cx(s,o,l,i={}){let{window:d=document.defaultView,v5Compat:f=!1}=i,m=d.history,p="POP",g=null,h=y();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function y(){return(m.state||{idx:null}).idx}function S(){p="POP";let R=y(),N=R==null?null:R-h;h=R,g&&g({action:p,location:k.location,delta:N})}function w(R,N){p="PUSH";let E=Ic(k.location,R,N);h=y()+1;let U=Nh(E,h),X=k.createHref(E);try{m.pushState(U,"",X)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;d.location.assign(X)}f&&g&&g({action:p,location:k.location,delta:1})}function A(R,N){p="REPLACE";let E=Ic(k.location,R,N);h=y();let U=Nh(E,h),X=k.createHref(E);m.replaceState(U,"",X),f&&g&&g({action:p,location:k.location,delta:0})}function C(R){return Ex(R)}let k={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(jh,S),g=R,()=>{d.removeEventListener(jh,S),g=null}},createHref(R){return o(d,R)},createURL:C,encodeLocation(R){let N=C(R);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:w,replace:A,go(R){return m.go(R)}};return k}function Ex(s,o=!1){let l="http://localhost";typeof window<"u"&&(l=window.location.origin!=="null"?window.location.origin:window.location.href),Qe(l,"No window.location.(origin|href) available to create URL");let i=typeof s=="string"?s:Hs(s);return i=i.replace(/ $/,"%20"),!o&&i.startsWith("//")&&(i=l+i),new URL(i,l)}function tg(s,o,l="/"){return kx(s,o,l,!1)}function kx(s,o,l,i){let d=typeof o=="string"?Or(o):o,f=Pa(d.pathname||"/",l);if(f==null)return null;let m=ag(s);Tx(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=Hx(f);p=_x(m[g],h,i)}return p}function ag(s,o=[],l=[],i=""){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("/")&&(Qe(g.relativePath.startsWith(i),`Absolute route path "${g.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(i.length));let h=Ha([i,g.relativePath]),y=l.concat(g);f.children&&f.children.length>0&&(Qe(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),ag(f.children,o,y,h)),!(f.path==null&&!f.index)&&o.push({path:h,score:Dx(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 ng(f.path))d(f,m,g)}),o}function ng(s){let o=s.split("/");if(o.length===0)return[];let[l,...i]=o,d=l.endsWith("?"),f=l.replace(/\?$/,"");if(i.length===0)return d?[f,""]:[f];let m=ng(i.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 Tx(s){s.sort((o,l)=>o.score!==l.score?l.score-o.score:Lx(o.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}var Ax=/^:[\w-]+$/,Rx=3,Mx=2,Ox=1,zx=10,Ux=-2,Sh=s=>s==="*";function Dx(s,o){let l=s.split("/"),i=l.length;return l.some(Sh)&&(i+=Ux),o&&(i+=Mx),l.filter(d=>!Sh(d)).reduce((d,f)=>d+(Ax.test(f)?Rx:f===""?Ox:zx),i)}function Lx(s,o){return s.length===o.length&&s.slice(0,-1).every((i,d)=>i===o[d])?s[s.length-1]-o[o.length-1]:0}function _x(s,o,l=!1){let{routesMeta:i}=s,d={},f="/",m=[];for(let p=0;p<i.length;++p){let g=i[p],h=p===i.length-1,y=f==="/"?o:o.slice(f.length)||"/",S=yo({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},y),w=g.route;if(!S&&h&&l&&!i[i.length-1].route.index&&(S=yo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},y)),!S)return null;Object.assign(d,S.params),m.push({params:d,pathname:Ha([f,S.pathname]),pathnameBase:Gx(Ha([f,S.pathnameBase])),route:w}),S.pathnameBase!=="/"&&(f=Ha([f,S.pathnameBase]))}return m}function yo(s,o){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[l,i]=Bx(s.path,s.caseSensitive,s.end),d=o.match(l);if(!d)return null;let f=d[0],m=f.replace(/(.)\/+$/,"$1"),p=d.slice(1);return{params:i.reduce((h,{paramName:y,isOptional:S},w)=>{if(y==="*"){let C=p[w]||"";m=f.slice(0,f.length-C.length).replace(/(.)\/+$/,"$1")}const A=p[w];return S&&!A?h[y]=void 0:h[y]=(A||"").replace(/%2F/g,"/"),h},{}),pathname:f,pathnameBase:m,pattern:s}}function Bx(s,o=!1,l=!0){ea(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 i=[],d="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,p,g)=>(i.push({paramName:p,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(i.push({paramName:"*"}),d+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?d+="\\/*$":s!==""&&s!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,o?void 0:"i"),i]}function Hx(s){try{return s.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return ea(!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 Pa(s,o){if(o==="/")return s;if(!s.toLowerCase().startsWith(o.toLowerCase()))return null;let l=o.endsWith("/")?o.length-1:o.length,i=s.charAt(l);return i&&i!=="/"?null:s.slice(l)||"/"}function qx(s,o="/"){let{pathname:l,search:i="",hash:d=""}=typeof s=="string"?Or(s):s;return{pathname:l?l.startsWith("/")?l:Px(l,o):o,search:Kx(i),hash:$x(d)}}function Px(s,o){let l=o.replace(/\/+$/,"").split("/");return s.split("/").forEach(d=>{d===".."?l.length>1&&l.pop():d!=="."&&l.push(d)}),l.length>1?l.join("/"):"/"}function Yc(s,o,l,i){return`Cannot include a '${s}' character in a manually specified \`to.${o}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Vx(s){return s.filter((o,l)=>l===0||o.route.path&&o.route.path.length>0)}function uu(s){let o=Vx(s);return o.map((l,i)=>i===o.length-1?l.pathname:l.pathnameBase)}function du(s,o,l,i=!1){let d;typeof s=="string"?d=Or(s):(d={...s},Qe(!d.pathname||!d.pathname.includes("?"),Yc("?","pathname","search",d)),Qe(!d.pathname||!d.pathname.includes("#"),Yc("#","pathname","hash",d)),Qe(!d.search||!d.search.includes("#"),Yc("#","search","hash",d)));let f=s===""||d.pathname==="",m=f?"/":d.pathname,p;if(m==null)p=l;else{let S=o.length-1;if(!i&&m.startsWith("..")){let w=m.split("/");for(;w[0]==="..";)w.shift(),S-=1;d.pathname=w.join("/")}p=S>=0?o[S]:"/"}let g=qx(d,p),h=m&&m!=="/"&&m.endsWith("/"),y=(f||m===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(h||y)&&(g.pathname+="/"),g}var Ha=s=>s.join("/").replace(/\/\/+/g,"/"),Gx=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),Kx=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,$x=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function Yx(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}var rg=["POST","PUT","PATCH","DELETE"];new Set(rg);var Fx=["GET",...rg];new Set(Fx);var zr=b.createContext(null);zr.displayName="DataRouter";var Eo=b.createContext(null);Eo.displayName="DataRouterState";var sg=b.createContext({isTransitioning:!1});sg.displayName="ViewTransition";var Xx=b.createContext(new Map);Xx.displayName="Fetchers";var Qx=b.createContext(null);Qx.displayName="Await";var ia=b.createContext(null);ia.displayName="Navigation";var Vs=b.createContext(null);Vs.displayName="Location";var ta=b.createContext({outlet:null,matches:[],isDataRoute:!1});ta.displayName="Route";var fu=b.createContext(null);fu.displayName="RouteError";function Zx(s,{relative:o}={}){Qe(Ur(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:i}=b.useContext(ia),{hash:d,pathname:f,search:m}=Gs(s,{relative:o}),p=f;return l!=="/"&&(p=f==="/"?l:Ha([l,f])),i.createHref({pathname:p,search:m,hash:d})}function Ur(){return b.useContext(Vs)!=null}function Va(){return Qe(Ur(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Vs).location}var lg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function og(s){b.useContext(ia).static||b.useLayoutEffect(s)}function Ga(){let{isDataRoute:s}=b.useContext(ta);return s?dy():Ix()}function Ix(){Qe(Ur(),"useNavigate() may be used only in the context of a <Router> component.");let s=b.useContext(zr),{basename:o,navigator:l}=b.useContext(ia),{matches:i}=b.useContext(ta),{pathname:d}=Va(),f=JSON.stringify(uu(i)),m=b.useRef(!1);return og(()=>{m.current=!0}),b.useCallback((g,h={})=>{if(ea(m.current,lg),!m.current)return;if(typeof g=="number"){l.go(g);return}let y=du(g,JSON.parse(f),d,h.relative==="path");s==null&&o!=="/"&&(y.pathname=y.pathname==="/"?o:Ha([o,y.pathname])),(h.replace?l.replace:l.push)(y,h.state,h)},[o,l,f,d,s])}var Jx=b.createContext(null);function Wx(s){let o=b.useContext(ta).outlet;return o&&b.createElement(Jx.Provider,{value:s},o)}function ig(){let{matches:s}=b.useContext(ta),o=s[s.length-1];return o?o.params:{}}function Gs(s,{relative:o}={}){let{matches:l}=b.useContext(ta),{pathname:i}=Va(),d=JSON.stringify(uu(l));return b.useMemo(()=>du(s,JSON.parse(d),i,o==="path"),[s,d,i,o])}function ey(s,o){return cg(s,o)}function cg(s,o,l,i){var N;Qe(Ur(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=b.useContext(ia),{matches:f}=b.useContext(ta),m=f[f.length-1],p=m?m.params:{},g=m?m.pathname:"/",h=m?m.pathnameBase:"/",y=m&&m.route;{let E=y&&y.path||"";ug(g,!y||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${E}">) 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="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let S=Va(),w;if(o){let E=typeof o=="string"?Or(o):o;Qe(h==="/"||((N=E.pathname)==null?void 0:N.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 "${E.pathname}" was given in the \`location\` prop.`),w=E}else w=S;let A=w.pathname||"/",C=A;if(h!=="/"){let E=h.replace(/^\//,"").split("/");C="/"+A.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=tg(s,{pathname:C});ea(y||k!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),ea(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.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=sy(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},p,E.params),pathname:Ha([h,d.encodeLocation?d.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?h:Ha([h,d.encodeLocation?d.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),f,l,i);return o&&R?b.createElement(Vs.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...w},navigationType:"POP"}},R):R}function ty(){let s=uy(),o=Yx(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),l=s instanceof Error?s.stack:null,i="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:i},f={padding:"2px 4px",backgroundColor:i},m=null;return console.error("Error handled by React Router default ErrorBoundary:",s),m=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:f},"ErrorBoundary")," or"," ",b.createElement("code",{style:f},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},o),l?b.createElement("pre",{style:d},l):null,m)}var ay=b.createElement(ty,null),ny=class extends b.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?b.createElement(ta.Provider,{value:this.props.routeContext},b.createElement(fu.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function ry({routeContext:s,match:o,children:l}){let i=b.useContext(zr);return i&&i.static&&i.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=o.route.id),b.createElement(ta.Provider,{value:s},l)}function sy(s,o=[],l=null,i=null){if(s==null){if(!l)return null;if(l.errors)s=l.matches;else if(o.length===0&&!l.initialized&&l.matches.length>0)s=l.matches;else return null}let d=s,f=l==null?void 0:l.errors;if(f!=null){let g=d.findIndex(h=>h.route.id&&(f==null?void 0:f[h.route.id])!==void 0);Qe(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(l)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:S}=l,w=h.route.loader&&!y.hasOwnProperty(h.route.id)&&(!S||S[h.route.id]===void 0);if(h.route.lazy||w){m=!0,p>=0?d=d.slice(0,p+1):d=[d[0]];break}}}return d.reduceRight((g,h,y)=>{let S,w=!1,A=null,C=null;l&&(S=f&&h.route.id?f[h.route.id]:void 0,A=h.route.errorElement||ay,m&&(p<0&&y===0?(ug("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,C=null):p===y&&(w=!0,C=h.route.hydrateFallbackElement||null)));let k=o.concat(d.slice(0,y+1)),R=()=>{let N;return S?N=A:w?N=C:h.route.Component?N=b.createElement(h.route.Component,null):h.route.element?N=h.route.element:N=g,b.createElement(ry,{match:h,routeContext:{outlet:g,matches:k,isDataRoute:l!=null},children:N})};return l&&(h.route.ErrorBoundary||h.route.errorElement||y===0)?b.createElement(ny,{location:l.location,revalidation:l.revalidation,component:A,error:S,children:R(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):R()},null)}function mu(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ly(s){let o=b.useContext(zr);return Qe(o,mu(s)),o}function oy(s){let o=b.useContext(Eo);return Qe(o,mu(s)),o}function iy(s){let o=b.useContext(ta);return Qe(o,mu(s)),o}function hu(s){let o=iy(s),l=o.matches[o.matches.length-1];return Qe(l.route.id,`${s} can only be used on routes that contain a unique "id"`),l.route.id}function cy(){return hu("useRouteId")}function uy(){var i;let s=b.useContext(fu),o=oy("useRouteError"),l=hu("useRouteError");return s!==void 0?s:(i=o.errors)==null?void 0:i[l]}function dy(){let{router:s}=ly("useNavigate"),o=hu("useNavigate"),l=b.useRef(!1);return og(()=>{l.current=!0}),b.useCallback(async(d,f={})=>{ea(l.current,lg),l.current&&(typeof d=="number"?s.navigate(d):await s.navigate(d,{fromRouteId:o,...f}))},[s,o])}var Ch={};function ug(s,o,l){!o&&!Ch[s]&&(Ch[s]=!0,ea(!1,l))}b.memo(fy);function fy({routes:s,future:o,state:l}){return cg(s,void 0,l,o)}function bo({to:s,replace:o,state:l,relative:i}){Qe(Ur(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d}=b.useContext(ia);ea(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=b.useContext(ta),{pathname:m}=Va(),p=Ga(),g=du(s,uu(f),m,i==="path"),h=JSON.stringify(g);return b.useEffect(()=>{p(JSON.parse(h),{replace:o,state:l,relative:i})},[p,h,i,o,l]),null}function dg(s){return Wx(s.context)}function Et(s){Qe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function my({basename:s="/",children:o=null,location:l,navigationType:i="POP",navigator:d,static:f=!1}){Qe(!Ur(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=s.replace(/^\/*/,"/"),p=b.useMemo(()=>({basename:m,navigator:d,static:f,future:{}}),[m,d,f]);typeof l=="string"&&(l=Or(l));let{pathname:g="/",search:h="",hash:y="",state:S=null,key:w="default"}=l,A=b.useMemo(()=>{let C=Pa(g,m);return C==null?null:{location:{pathname:C,search:h,hash:y,state:S,key:w},navigationType:i}},[m,g,h,y,S,w,i]);return ea(A!=null,`<Router basename="${m}"> is not able to match the URL "${g}${h}${y}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:b.createElement(ia.Provider,{value:p},b.createElement(Vs.Provider,{children:o,value:A}))}function hy({children:s,location:o}){return ey(Jc(s),o)}function Jc(s,o=[]){let l=[];return b.Children.forEach(s,(i,d)=>{if(!b.isValidElement(i))return;let f=[...o,d];if(i.type===b.Fragment){l.push.apply(l,Jc(i.props.children,f));return}Qe(i.type===Et,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Qe(!i.props.index||!i.props.children,"An index route cannot have child routes.");let m={id:i.props.id||f.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(m.children=Jc(i.props.children,f)),l.push(m)}),l}var go="get",po="application/x-www-form-urlencoded";function ko(s){return s!=null&&typeof s.tagName=="string"}function gy(s){return ko(s)&&s.tagName.toLowerCase()==="button"}function py(s){return ko(s)&&s.tagName.toLowerCase()==="form"}function xy(s){return ko(s)&&s.tagName.toLowerCase()==="input"}function yy(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function by(s,o){return s.button===0&&(!o||o==="_self")&&!yy(s)}function Wc(s=""){return new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((o,l)=>{let i=s[l];return o.concat(Array.isArray(i)?i.map(d=>[l,d]):[[l,i]])},[]))}function vy(s,o){let l=Wc(s);return o&&o.forEach((i,d)=>{l.has(d)||o.getAll(d).forEach(f=>{l.append(d,f)})}),l}var lo=null;function wy(){if(lo===null)try{new FormData(document.createElement("form"),0),lo=!1}catch{lo=!0}return lo}var jy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Fc(s){return s!=null&&!jy.has(s)?(ea(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${po}"`),null):s}function Ny(s,o){let l,i,d,f,m;if(py(s)){let p=s.getAttribute("action");i=p?Pa(p,o):null,l=s.getAttribute("method")||go,d=Fc(s.getAttribute("enctype"))||po,f=new FormData(s)}else if(gy(s)||xy(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(i=g?Pa(g,o):null,l=s.getAttribute("formmethod")||p.getAttribute("method")||go,d=Fc(s.getAttribute("formenctype"))||Fc(p.getAttribute("enctype"))||po,f=new FormData(p,s),!wy()){let{name:h,type:y,value:S}=s;if(y==="image"){let w=h?`${h}.`:"";f.append(`${w}x`,"0"),f.append(`${w}y`,"0")}else h&&f.append(h,S)}}else{if(ko(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=go,i=null,d=po,m=s}return f&&d==="text/plain"&&(m=f,f=void 0),{action:i,method:l.toLowerCase(),encType:d,formData:f,body:m}}function gu(s,o){if(s===!1||s===null||typeof s>"u")throw new Error(o)}async function Sy(s,o){if(s.id in o)return o[s.id];try{let l=await import(s.module);return o[s.id]=l,l}catch(l){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Cy(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 Ey(s,o,l){let i=await Promise.all(s.map(async d=>{let f=o.routes[d.route.id];if(f){let m=await Sy(f,l);return m.links?m.links():[]}return[]}));return Ry(i.flat(1).filter(Cy).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Eh(s,o,l,i,d,f){let m=(g,h)=>l[h]?g.route.id!==l[h].route.id:!0,p=(g,h)=>{var y;return l[h].pathname!==g.pathname||((y=l[h].route.path)==null?void 0:y.endsWith("*"))&&l[h].params["*"]!==g.params["*"]};return f==="assets"?o.filter((g,h)=>m(g,h)||p(g,h)):f==="data"?o.filter((g,h)=>{var S;let y=i.routes[g.route.id];if(!y||!y.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let w=g.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((S=l[0])==null?void 0:S.params)||{},nextUrl:new URL(s,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function ky(s,o,{includeHydrateFallback:l}={}){return Ty(s.map(i=>{let d=o.routes[i.route.id];if(!d)return[];let f=[d.module];return d.clientActionModule&&(f=f.concat(d.clientActionModule)),d.clientLoaderModule&&(f=f.concat(d.clientLoaderModule)),l&&d.hydrateFallbackModule&&(f=f.concat(d.hydrateFallbackModule)),d.imports&&(f=f.concat(d.imports)),f}).flat(1))}function Ty(s){return[...new Set(s)]}function Ay(s){let o={},l=Object.keys(s).sort();for(let i of l)o[i]=s[i];return o}function Ry(s,o){let l=new Set;return new Set(o),s.reduce((i,d)=>{let f=JSON.stringify(Ay(d));return l.has(f)||(l.add(f),i.push({key:f,link:d})),i},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var My=new Set([100,101,204,205]);function Oy(s,o){let l=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return l.pathname==="/"?l.pathname="_root.data":o&&Pa(l.pathname,o)==="/"?l.pathname=`${o.replace(/\/$/,"")}/_root.data`:l.pathname=`${l.pathname.replace(/\/$/,"")}.data`,l}function fg(){let s=b.useContext(zr);return gu(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function zy(){let s=b.useContext(Eo);return gu(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var pu=b.createContext(void 0);pu.displayName="FrameworkContext";function mg(){let s=b.useContext(pu);return gu(s,"You must render this element inside a <HydratedRouter> element"),s}function Uy(s,o){let l=b.useContext(pu),[i,d]=b.useState(!1),[f,m]=b.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:y,onTouchStart:S}=o,w=b.useRef(null);b.useEffect(()=>{if(s==="render"&&m(!0),s==="viewport"){let k=N=>{N.forEach(E=>{m(E.isIntersecting)})},R=new IntersectionObserver(k,{threshold:.5});return w.current&&R.observe(w.current),()=>{R.disconnect()}}},[s]),b.useEffect(()=>{if(i){let k=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(k)}}},[i]);let A=()=>{d(!0)},C=()=>{d(!1),m(!1)};return l?s!=="intent"?[f,w,{}]:[f,w,{onFocus:Ds(p,A),onBlur:Ds(g,C),onMouseEnter:Ds(h,A),onMouseLeave:Ds(y,C),onTouchStart:Ds(S,A)}]:[!1,w,{}]}function Ds(s,o){return l=>{s&&s(l),l.defaultPrevented||o(l)}}function Dy({page:s,...o}){let{router:l}=fg(),i=b.useMemo(()=>tg(l.routes,s,l.basename),[l.routes,s,l.basename]);return i?b.createElement(_y,{page:s,matches:i,...o}):null}function Ly(s){let{manifest:o,routeModules:l}=mg(),[i,d]=b.useState([]);return b.useEffect(()=>{let f=!1;return Ey(s,o,l).then(m=>{f||d(m)}),()=>{f=!0}},[s,o,l]),i}function _y({page:s,matches:o,...l}){let i=Va(),{manifest:d,routeModules:f}=mg(),{basename:m}=fg(),{loaderData:p,matches:g}=zy(),h=b.useMemo(()=>Eh(s,o,g,d,i,"data"),[s,o,g,d,i]),y=b.useMemo(()=>Eh(s,o,g,d,i,"assets"),[s,o,g,d,i]),S=b.useMemo(()=>{if(s===i.pathname+i.search+i.hash)return[];let C=new Set,k=!1;if(o.forEach(N=>{var U;let E=d.routes[N.route.id];!E||!E.hasLoader||(!h.some(X=>X.route.id===N.route.id)&&N.route.id in p&&((U=f[N.route.id])!=null&&U.shouldRevalidate)||E.hasClientLoader?k=!0:C.add(N.route.id))}),C.size===0)return[];let R=Oy(s,m);return k&&C.size>0&&R.searchParams.set("_routes",o.filter(N=>C.has(N.route.id)).map(N=>N.route.id).join(",")),[R.pathname+R.search]},[m,p,i,d,h,o,s,f]),w=b.useMemo(()=>ky(y,d),[y,d]),A=Ly(y);return b.createElement(b.Fragment,null,S.map(C=>b.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...l})),w.map(C=>b.createElement("link",{key:C,rel:"modulepreload",href:C,...l})),A.map(({key:C,link:k})=>b.createElement("link",{key:C,...k})))}function By(...s){return o=>{s.forEach(l=>{typeof l=="function"?l(o):l!=null&&(l.current=o)})}}var hg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{hg&&(window.__reactRouterVersion="7.6.3")}catch{}function Hy({basename:s,children:o,window:l}){let i=b.useRef();i.current==null&&(i.current=Nx({window:l,v5Compat:!0}));let d=i.current,[f,m]=b.useState({action:d.action,location:d.location}),p=b.useCallback(g=>{b.startTransition(()=>m(g))},[m]);return b.useLayoutEffect(()=>d.listen(p),[d,p]),b.createElement(my,{basename:s,children:o,location:f.location,navigationType:f.action,navigator:d})}var gg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pg=b.forwardRef(function({onClick:o,discover:l="render",prefetch:i="none",relative:d,reloadDocument:f,replace:m,state:p,target:g,to:h,preventScrollReset:y,viewTransition:S,...w},A){let{basename:C}=b.useContext(ia),k=typeof h=="string"&&gg.test(h),R,N=!1;if(typeof h=="string"&&k&&(R=h,hg))try{let oe=new URL(window.location.href),de=h.startsWith("//")?new URL(oe.protocol+h):new URL(h),z=Pa(de.pathname,C);de.origin===oe.origin&&z!=null?h=z+de.search+de.hash:N=!0}catch{ea(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let E=Zx(h,{relative:d}),[U,X,L]=Uy(i,w),ee=Vy(h,{replace:m,state:p,target:g,preventScrollReset:y,relative:d,viewTransition:S});function ae(oe){o&&o(oe),oe.defaultPrevented||ee(oe)}let K=b.createElement("a",{...w,...L,href:R||E,onClick:N||f?o:ae,ref:By(A,X),target:g,"data-discover":!k&&l==="render"?"true":void 0});return U&&!k?b.createElement(b.Fragment,null,K,b.createElement(Dy,{page:E})):K});pg.displayName="Link";var xg=b.forwardRef(function({"aria-current":o="page",caseSensitive:l=!1,className:i="",end:d=!1,style:f,to:m,viewTransition:p,children:g,...h},y){let S=Gs(m,{relative:h.relative}),w=Va(),A=b.useContext(Eo),{navigator:C,basename:k}=b.useContext(ia),R=A!=null&&Xy(S)&&p===!0,N=C.encodeLocation?C.encodeLocation(S).pathname:S.pathname,E=w.pathname,U=A&&A.navigation&&A.navigation.location?A.navigation.location.pathname:null;l||(E=E.toLowerCase(),U=U?U.toLowerCase():null,N=N.toLowerCase()),U&&k&&(U=Pa(U,k)||U);const X=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let L=E===N||!d&&E.startsWith(N)&&E.charAt(X)==="/",ee=U!=null&&(U===N||!d&&U.startsWith(N)&&U.charAt(N.length)==="/"),ae={isActive:L,isPending:ee,isTransitioning:R},K=L?o:void 0,oe;typeof i=="function"?oe=i(ae):oe=[i,L?"active":null,ee?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let de=typeof f=="function"?f(ae):f;return b.createElement(pg,{...h,"aria-current":K,className:oe,ref:y,style:de,to:m,viewTransition:p},typeof g=="function"?g(ae):g)});xg.displayName="NavLink";var qy=b.forwardRef(({discover:s="render",fetcherKey:o,navigate:l,reloadDocument:i,replace:d,state:f,method:m=go,action:p,onSubmit:g,relative:h,preventScrollReset:y,viewTransition:S,...w},A)=>{let C=Yy(),k=Fy(p,{relative:h}),R=m.toLowerCase()==="get"?"get":"post",N=typeof p=="string"&&gg.test(p),E=U=>{if(g&&g(U),U.defaultPrevented)return;U.preventDefault();let X=U.nativeEvent.submitter,L=(X==null?void 0:X.getAttribute("formmethod"))||m;C(X||U.currentTarget,{fetcherKey:o,method:L,navigate:l,replace:d,state:f,relative:h,preventScrollReset:y,viewTransition:S})};return b.createElement("form",{ref:A,method:R,action:k,onSubmit:i?g:E,...w,"data-discover":!N&&s==="render"?"true":void 0})});qy.displayName="Form";function Py(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yg(s){let o=b.useContext(zr);return Qe(o,Py(s)),o}function Vy(s,{target:o,replace:l,state:i,preventScrollReset:d,relative:f,viewTransition:m}={}){let p=Ga(),g=Va(),h=Gs(s,{relative:f});return b.useCallback(y=>{if(by(y,o)){y.preventDefault();let S=l!==void 0?l:Hs(g)===Hs(h);p(s,{replace:S,state:i,preventScrollReset:d,relative:f,viewTransition:m})}},[g,p,h,l,i,o,s,d,f,m])}function Gy(s){ea(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let o=b.useRef(Wc(s)),l=b.useRef(!1),i=Va(),d=b.useMemo(()=>vy(i.search,l.current?null:o.current),[i.search]),f=Ga(),m=b.useCallback((p,g)=>{const h=Wc(typeof p=="function"?p(d):p);l.current=!0,f("?"+h,g)},[f,d]);return[d,m]}var Ky=0,$y=()=>`__${String(++Ky)}__`;function Yy(){let{router:s}=yg("useSubmit"),{basename:o}=b.useContext(ia),l=cy();return b.useCallback(async(i,d={})=>{let{action:f,method:m,encType:p,formData:g,body:h}=Ny(i,o);if(d.navigate===!1){let y=d.fetcherKey||$y();await s.fetch(y,l,d.action||f,{preventScrollReset:d.preventScrollReset,formData:g,body:h,formMethod:d.method||m,formEncType:d.encType||p,flushSync:d.flushSync})}else await 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:l,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,o,l])}function Fy(s,{relative:o}={}){let{basename:l}=b.useContext(ia),i=b.useContext(ta);Qe(i,"useFormAction must be used inside a RouteContext");let[d]=i.matches.slice(-1),f={...Gs(s||".",{relative:o})},m=Va();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(S=>S).forEach(S=>p.append("index",S));let y=p.toString();f.search=y?`?${y}`:""}}return(!s||s===".")&&d.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(f.pathname=f.pathname==="/"?l:Ha([l,f.pathname])),Hs(f)}function Xy(s,o={}){let l=b.useContext(sg);Qe(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=yg("useViewTransitionState"),d=Gs(s,{relative:o.relative});if(!l.isTransitioning)return!1;let f=Pa(l.currentLocation.pathname,i)||l.currentLocation.pathname,m=Pa(l.nextLocation.pathname,i)||l.nextLocation.pathname;return yo(d.pathname,m)!=null||yo(d.pathname,f)!=null}[...My];const Qy=()=>window.__MCPHUB_CONFIG__||{basePath:"",version:"dev",name:"mcphub"},xu=()=>{const o=Qy().basePath||"";return o&&!o.startsWith("/")?"/"+o:o},Zy=()=>xu()+"/api",yu=s=>{const o=Zy(),l=s.startsWith("/")?s:"/"+s;return o+l},Iy=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 l of o)try{const i=await fetch(l,{method:"GET",headers:{Accept:"application/json","Cache-Control":"no-cache"}});if(i.ok){const d=await i.json();if(d.success&&d.data)return d.data}}catch(i){console.debug(`Failed to load config from ${l}:`,i)}return console.warn("Could not load runtime config from server, using defaults"),{basePath:"",version:"dev",name:"mcphub"}}catch(s){return console.error("Error loading runtime config:",s),{basePath:"",version:"dev",name:"mcphub"}}},xo=[],Jy=s=>{xo.push(s)},bu=async(s,o={})=>{let l=s.toString(),i={...o};try{for(const f of xo)if(f.request){const m=await f.request(l,i);l=m.url,i=m.config}let d=await fetch(l,i);for(const f of xo)f.response&&(d=await f.response(d));return d}catch(d){let f=d;for(const m of xo)m.error&&(f=await m.error(f));throw f}},To=async(s,o={})=>{try{const l=yu(s),i=await bu(l,o);let d;try{d=await i.json()}catch{d={success:i.ok,message:i.ok?"Request successful":`HTTP ${i.status}: ${i.statusText}`}}if(!i.ok&&typeof d=="object"&&d!==null){const f=d;f.success!==!1&&(f.success=!1,f.message=f.message||`HTTP ${i.status}: ${i.statusText}`)}return d}catch(l){return console.error("API request error:",l),{success:!1,message:l instanceof Error?l.message:"An unknown error occurred"}}},Xe=(s,o={})=>To(s,{...o,method:"GET"}),Vt=(s,o,l={})=>To(s,{...l,method:"POST",headers:{"Content-Type":"application/json",...l.headers},body:o?JSON.stringify(o):void 0}),Wt=(s,o,l={})=>To(s,{...l,method:"PUT",headers:{"Content-Type":"application/json",...l.headers},body:o?JSON.stringify(o):void 0}),vo=(s,o={})=>To(s,{...o,method:"DELETE"}),vu="mcphub_token",Ks=()=>localStorage.getItem(vu),bg=s=>{localStorage.setItem(vu,s)},wo=()=>{localStorage.removeItem(vu)},Wy={request:async(s,o)=>{const l=new Headers(o.headers),i=localStorage.getItem("i18nextLng")||"en";l.set("Accept-Language",i);const d=Ks();return d&&l.set("x-auth-token",d),{url:s,config:{...o,headers:l}}},response:async s=>(s.status===401&&wo(),s),error:async s=>(console.error("Auth interceptor error:",s),s)},eb=()=>{Jy(Wy)},tb=async s=>{try{const o=await Vt("/auth/login",s);return o.success&&o.token?(bg(o.token),o):{success:!1,message:o.message||"Login failed"}}catch(o){return console.error("Login error:",o),{success:!1,message:"An error occurred during login"}}},ab=async s=>{try{const o=await Vt("/auth/register",s);return o.success&&o.token?(bg(o.token),o):{success:!1,message:o.message||"Registration failed"}}catch(o){return console.error("Register error:",o),{success:!1,message:"An error occurred during registration"}}},nb=async()=>{if(!Ks())return{success:!1,message:"No authentication token"};try{return await Xe("/auth/user")}catch(o){return console.error("Get current user error:",o),{success:!1,message:"An error occurred while fetching user data"}}},rb=async s=>{if(!Ks())return{success:!1,message:"No authentication token"};try{return await Vt("/auth/change-password",s)}catch(l){return console.error("Change password error:",l),{success:!1,message:"An error occurred while changing password"}}},sb=()=>{wo()},lb=async()=>{var s,o;try{const l=xu(),i=await bu(`${l}/public-config`,{method:"GET",headers:{"Content-Type":"application/json"}});if(i.ok){const d=await i.json();return{skipAuth:((s=d.data)==null?void 0:s.skipAuth)===!0,permissions:((o=d.data)==null?void 0:o.permissions)||{}}}return{skipAuth:!1}}catch(l){return console.debug("Failed to get public config:",l),{skipAuth:!1}}},ba={isAuthenticated:!1,loading:!0,user:null,error:null},vg=b.createContext({auth:ba,login:async()=>!1,register:async()=>!1,logout:()=>{}}),ob=({children:s})=>{const[o,l]=b.useState(ba);b.useEffect(()=>{(async()=>{const{skipAuth:p,permissions:g}=await lb();if(p){l({isAuthenticated:!0,loading:!1,user:{username:"guest",isAdmin:!0,permissions:g},error:null});return}if(!Ks()){l({...ba,loading:!1});return}try{const y=await nb();y.success&&y.user?l({isAuthenticated:!0,loading:!1,user:y.user,error:null}):(wo(),l({...ba,loading:!1}))}catch{wo(),l({...ba,loading:!1})}})()},[]);const i=async(m,p)=>{try{const g=await tb({username:m,password:p});return g.success&&g.token&&g.user?(l({isAuthenticated:!0,loading:!1,user:g.user,error:null}),!0):(l({...ba,loading:!1,error:g.message||"Authentication failed"}),!1)}catch{return l({...ba,loading:!1,error:"Authentication failed"}),!1}},d=async(m,p,g=!1)=>{try{const h=await ab({username:m,password:p,isAdmin:g});return h.success&&h.token&&h.user?(l({isAuthenticated:!0,loading:!1,user:h.user,error:null}),!0):(l({...ba,loading:!1,error:h.message||"Registration failed"}),!1)}catch{return l({...ba,loading:!1,error:"Registration failed"}),!1}},f=()=>{sb(),l({...ba,loading:!1})};return r.jsx(vg.Provider,{value:{auth:o,login:i,register:d,logout:f},children:s})},$s=()=>b.useContext(vg);/**
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 ib=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cb=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,l,i)=>i?i.toUpperCase():l.toLowerCase()),kh=s=>{const o=cb(s);return o.charAt(0).toUpperCase()+o.slice(1)},wg=(...s)=>s.filter((o,l,i)=>!!o&&o.trim()!==""&&i.indexOf(o)===l).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 ub={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 db=b.forwardRef(({color:s="currentColor",size:o=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:d="",children:f,iconNode:m,...p},g)=>b.createElement("svg",{ref:g,...ub,width:o,height:o,stroke:s,strokeWidth:i?Number(l)*24/Number(o):l,className:wg("lucide",d),...p},[...m.map(([h,y])=>b.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 We=(s,o)=>{const l=b.forwardRef(({className:i,...d},f)=>b.createElement(db,{ref:f,iconNode:o,className:wg(`lucide-${ib(kh(s))}`,`lucide-${s}`,i),...d}));return l.displayName=kh(s),l};/**
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 fb=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ao=We("check",fb);/**
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 mb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],wu=We("chevron-down",mb);/**
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 hb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],jg=We("chevron-right",hb);/**
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 gb=[["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"}]],Ng=We("circle-alert",gb);/**
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 pb=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],xb=We("circle-check-big",pb);/**
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 yb=[["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"}]],bb=We("circle-x",yb);/**
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 vb=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],eu=We("copy",vb);/**
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 wb=[["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"}]],jb=We("file-code",wb);/**
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 Nb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Sb=We("info",Nb);/**
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 Cb=[["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"}]],Eb=We("link",Cb);/**
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 kb=[["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"}]],Tb=We("loader",kb);/**
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 Ab=[["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"}]],Rb=We("log-out",Ab);/**
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 Mb=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Ob=We("moon",Mb);/**
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 zb=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Ub=We("play",zb);/**
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 Db=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Lb=We("refresh-cw",Db);/**
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 _b=[["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"}]],Bb=We("settings",_b);/**
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 Hb=[["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"}]],Sg=We("square-pen",Hb);/**
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 qb=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Pb=We("sun",qb);/**
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 Vb=[["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"}]],Gb=We("trash",Vb);/**
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 Kb=[["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"}]],$b=We("user",Kb);/**
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 Yb=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],Fb=We("wrench",Yb);/**
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 Xb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],qs=We("x",Xb);function Cg(s){var o,l,i="";if(typeof s=="string"||typeof s=="number")i+=s;else if(typeof s=="object")if(Array.isArray(s)){var d=s.length;for(o=0;o<d;o++)s[o]&&(l=Cg(s[o]))&&(i&&(i+=" "),i+=l)}else for(l in s)s[l]&&(i&&(i+=" "),i+=l);return i}function Qb(){for(var s,o,l=0,i="",d=arguments.length;l<d;l++)(s=arguments[l])&&(o=Cg(s))&&(i&&(i+=" "),i+=o);return i}const ju="-",Zb=s=>{const o=Jb(s),{conflictingClassGroups:l,conflictingClassGroupModifiers:i}=s;return{getClassGroupId:m=>{const p=m.split(ju);return p[0]===""&&p.length!==1&&p.shift(),Eg(p,o)||Ib(m)},getConflictingClassGroupIds:(m,p)=>{const g=l[m]||[];return p&&i[m]?[...g,...i[m]]:g}}},Eg=(s,o)=>{var m;if(s.length===0)return o.classGroupId;const l=s[0],i=o.nextPart.get(l),d=i?Eg(s.slice(1),i):void 0;if(d)return d;if(o.validators.length===0)return;const f=s.join(ju);return(m=o.validators.find(({validator:p})=>p(f)))==null?void 0:m.classGroupId},Th=/^\[(.+)\]$/,Ib=s=>{if(Th.test(s)){const o=Th.exec(s)[1],l=o==null?void 0:o.substring(0,o.indexOf(":"));if(l)return"arbitrary.."+l}},Jb=s=>{const{theme:o,classGroups:l}=s,i={nextPart:new Map,validators:[]};for(const d in l)tu(l[d],i,d,o);return i},tu=(s,o,l,i)=>{s.forEach(d=>{if(typeof d=="string"){const f=d===""?o:Ah(o,d);f.classGroupId=l;return}if(typeof d=="function"){if(Wb(d)){tu(d(i),o,l,i);return}o.validators.push({validator:d,classGroupId:l});return}Object.entries(d).forEach(([f,m])=>{tu(m,Ah(o,f),l,i)})})},Ah=(s,o)=>{let l=s;return o.split(ju).forEach(i=>{l.nextPart.has(i)||l.nextPart.set(i,{nextPart:new Map,validators:[]}),l=l.nextPart.get(i)}),l},Wb=s=>s.isThemeGetter,e1=s=>{if(s<1)return{get:()=>{},set:()=>{}};let o=0,l=new Map,i=new Map;const d=(f,m)=>{l.set(f,m),o++,o>s&&(o=0,i=l,l=new Map)};return{get(f){let m=l.get(f);if(m!==void 0)return m;if((m=i.get(f))!==void 0)return d(f,m),m},set(f,m){l.has(f)?l.set(f,m):d(f,m)}}},au="!",nu=":",t1=nu.length,a1=s=>{const{prefix:o,experimentalParseClassName:l}=s;let i=d=>{const f=[];let m=0,p=0,g=0,h;for(let C=0;C<d.length;C++){let k=d[C];if(m===0&&p===0){if(k===nu){f.push(d.slice(g,C)),g=C+t1;continue}if(k==="/"){h=C;continue}}k==="["?m++:k==="]"?m--:k==="("?p++:k===")"&&p--}const y=f.length===0?d:d.substring(g),S=n1(y),w=S!==y,A=h&&h>g?h-g:void 0;return{modifiers:f,hasImportantModifier:w,baseClassName:S,maybePostfixModifierPosition:A}};if(o){const d=o+nu,f=i;i=m=>m.startsWith(d)?f(m.substring(d.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:m,maybePostfixModifierPosition:void 0}}if(l){const d=i;i=f=>l({className:f,parseClassName:d})}return i},n1=s=>s.endsWith(au)?s.substring(0,s.length-1):s.startsWith(au)?s.substring(1):s,r1=s=>{const o=Object.fromEntries(s.orderSensitiveModifiers.map(i=>[i,!0]));return i=>{if(i.length<=1)return i;const d=[];let f=[];return i.forEach(m=>{m[0]==="["||o[m]?(d.push(...f.sort(),m),f=[]):f.push(m)}),d.push(...f.sort()),d}},s1=s=>({cache:e1(s.cacheSize),parseClassName:a1(s),sortModifiers:r1(s),...Zb(s)}),l1=/\s+/,o1=(s,o)=>{const{parseClassName:l,getClassGroupId:i,getConflictingClassGroupIds:d,sortModifiers:f}=o,m=[],p=s.trim().split(l1);let g="";for(let h=p.length-1;h>=0;h-=1){const y=p[h],{isExternal:S,modifiers:w,hasImportantModifier:A,baseClassName:C,maybePostfixModifierPosition:k}=l(y);if(S){g=y+(g.length>0?" "+g:g);continue}let R=!!k,N=i(R?C.substring(0,k):C);if(!N){if(!R){g=y+(g.length>0?" "+g:g);continue}if(N=i(C),!N){g=y+(g.length>0?" "+g:g);continue}R=!1}const E=f(w).join(":"),U=A?E+au:E,X=U+N;if(m.includes(X))continue;m.push(X);const L=d(N,R);for(let ee=0;ee<L.length;++ee){const ae=L[ee];m.push(U+ae)}g=y+(g.length>0?" "+g:g)}return g};function i1(){let s=0,o,l,i="";for(;s<arguments.length;)(o=arguments[s++])&&(l=kg(o))&&(i&&(i+=" "),i+=l);return i}const kg=s=>{if(typeof s=="string")return s;let o,l="";for(let i=0;i<s.length;i++)s[i]&&(o=kg(s[i]))&&(l&&(l+=" "),l+=o);return l};function c1(s,...o){let l,i,d,f=m;function m(g){const h=o.reduce((y,S)=>S(y),s());return l=s1(h),i=l.cache.get,d=l.cache.set,f=p,p(g)}function p(g){const h=i(g);if(h)return h;const y=o1(g,l);return d(g,y),y}return function(){return f(i1.apply(null,arguments))}}const ut=s=>{const o=l=>l[s]||[];return o.isThemeGetter=!0,o},Tg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ag=/^\((?:(\w[\w-]*):)?(.+)\)$/i,u1=/^\d+\/\d+$/,d1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,f1=/\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$/,m1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,h1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,g1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Cr=s=>u1.test(s),Re=s=>!!s&&!Number.isNaN(Number(s)),hn=s=>!!s&&Number.isInteger(Number(s)),Xc=s=>s.endsWith("%")&&Re(s.slice(0,-1)),Ba=s=>d1.test(s),p1=()=>!0,x1=s=>f1.test(s)&&!m1.test(s),Rg=()=>!1,y1=s=>h1.test(s),b1=s=>g1.test(s),v1=s=>!ge(s)&&!pe(s),w1=s=>Dr(s,zg,Rg),ge=s=>Tg.test(s),Dn=s=>Dr(s,Ug,x1),Qc=s=>Dr(s,E1,Re),Rh=s=>Dr(s,Mg,Rg),j1=s=>Dr(s,Og,b1),oo=s=>Dr(s,Dg,y1),pe=s=>Ag.test(s),Ls=s=>Lr(s,Ug),N1=s=>Lr(s,k1),Mh=s=>Lr(s,Mg),S1=s=>Lr(s,zg),C1=s=>Lr(s,Og),io=s=>Lr(s,Dg,!0),Dr=(s,o,l)=>{const i=Tg.exec(s);return i?i[1]?o(i[1]):l(i[2]):!1},Lr=(s,o,l=!1)=>{const i=Ag.exec(s);return i?i[1]?o(i[1]):l:!1},Mg=s=>s==="position"||s==="percentage",Og=s=>s==="image"||s==="url",zg=s=>s==="length"||s==="size"||s==="bg-size",Ug=s=>s==="length",E1=s=>s==="number",k1=s=>s==="family-name",Dg=s=>s==="shadow",T1=()=>{const s=ut("color"),o=ut("font"),l=ut("text"),i=ut("font-weight"),d=ut("tracking"),f=ut("leading"),m=ut("breakpoint"),p=ut("container"),g=ut("spacing"),h=ut("radius"),y=ut("shadow"),S=ut("inset-shadow"),w=ut("text-shadow"),A=ut("drop-shadow"),C=ut("blur"),k=ut("perspective"),R=ut("aspect"),N=ut("ease"),E=ut("animate"),U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...X(),pe,ge],ee=()=>["auto","hidden","clip","visible","scroll"],ae=()=>["auto","contain","none"],K=()=>[pe,ge,g],oe=()=>[Cr,"full","auto",...K()],de=()=>[hn,"none","subgrid",pe,ge],z=()=>["auto",{span:["full",hn,pe,ge]},hn,pe,ge],O=()=>[hn,"auto",pe,ge],J=()=>["auto","min","max","fr",pe,ge],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...K()],q=()=>[Cr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...K()],Z=()=>[s,pe,ge],re=()=>[...X(),Mh,Rh,{position:[pe,ge]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",S1,w1,{size:[pe,ge]}],le=()=>[Xc,Ls,Dn],B=()=>["","none","full",h,pe,ge],V=()=>["",Re,Ls,Dn],me=()=>["solid","dashed","dotted","double"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[Re,Xc,Mh,Rh],ue=()=>["","none",C,pe,ge],be=()=>["none",Re,pe,ge],je=()=>["none",Re,pe,ge],xe=()=>[Re,pe,ge],Te=()=>[Cr,"full",...K()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ba],breakpoint:[Ba],color:[p1],container:[Ba],"drop-shadow":[Ba],ease:["in","out","in-out"],font:[v1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ba],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ba],shadow:[Ba],spacing:["px",Re],text:[Ba],"text-shadow":[Ba],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Cr,ge,pe,R]}],container:["container"],columns:[{columns:[Re,ge,pe,p]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"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:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:ae()}],"overscroll-x":[{"overscroll-x":ae()}],"overscroll-y":[{"overscroll-y":ae()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:oe()}],"inset-x":[{"inset-x":oe()}],"inset-y":[{"inset-y":oe()}],start:[{start:oe()}],end:[{end:oe()}],top:[{top:oe()}],right:[{right:oe()}],bottom:[{bottom:oe()}],left:[{left:oe()}],visibility:["visible","invisible","collapse"],z:[{z:[hn,"auto",pe,ge]}],basis:[{basis:[Cr,"full","auto",p,...K()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Re,Cr,"auto","initial","none",ge]}],grow:[{grow:["",Re,pe,ge]}],shrink:[{shrink:["",Re,pe,ge]}],order:[{order:[hn,"first","last","none",pe,ge]}],"grid-cols":[{"grid-cols":de()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":de()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:K()}],"gap-x":[{"gap-x":K()}],"gap-y":[{"gap-y":K()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:K()}],px:[{px:K()}],py:[{py:K()}],ps:[{ps:K()}],pe:[{pe:K()}],pt:[{pt:K()}],pr:[{pr:K()}],pb:[{pb:K()}],pl:[{pl:K()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":K()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":K()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[p,"screen",...q()]}],"min-w":[{"min-w":[p,"screen","none",...q()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[m]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",l,Ls,Dn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,pe,Qc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xc,ge]}],"font-family":[{font:[N1,ge,o]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,pe,ge]}],"line-clamp":[{"line-clamp":[Re,"none",pe,Qc]}],leading:[{leading:[f,...K()]}],"list-image":[{"list-image":["none",pe,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[Re,"from-font","auto",pe,Dn]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[Re,"auto",pe,ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:K()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:j()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},hn,pe,ge],radial:["",pe,ge],conic:[hn,pe,ge]},C1,j1]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Re,pe,ge]}],"outline-w":[{outline:["",Re,Ls,Dn]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",y,io,oo]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",S,io,oo]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[Re,Dn]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",w,io,oo]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[Re,pe,ge]}],"mix-blend":[{"mix-blend":[...W(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":W()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Re]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[pe,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"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":X()}],"mask-image-conic-pos":[{"mask-conic":[Re]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:j()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,ge]}],filter:[{filter:["","none",pe,ge]}],blur:[{blur:ue()}],brightness:[{brightness:[Re,pe,ge]}],contrast:[{contrast:[Re,pe,ge]}],"drop-shadow":[{"drop-shadow":["","none",A,io,oo]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",Re,pe,ge]}],"hue-rotate":[{"hue-rotate":[Re,pe,ge]}],invert:[{invert:["",Re,pe,ge]}],saturate:[{saturate:[Re,pe,ge]}],sepia:[{sepia:["",Re,pe,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,ge]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Re,pe,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Re,pe,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Re,pe,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Re,pe,ge]}],"backdrop-invert":[{"backdrop-invert":["",Re,pe,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Re,pe,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Re,pe,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Re,pe,ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":K()}],"border-spacing-x":[{"border-spacing-x":K()}],"border-spacing-y":[{"border-spacing-y":K()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Re,"initial",pe,ge]}],ease:[{ease:["linear","initial",N,pe,ge]}],delay:[{delay:[Re,pe,ge]}],animate:[{animate:["none",E,pe,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,pe,ge]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:je()}],"scale-x":[{"scale-x":je()}],"scale-y":[{"scale-y":je()}],"scale-z":[{"scale-z":je()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[pe,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":["translate-none"],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pe,ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":K()}],"scroll-mx":[{"scroll-mx":K()}],"scroll-my":[{"scroll-my":K()}],"scroll-ms":[{"scroll-ms":K()}],"scroll-me":[{"scroll-me":K()}],"scroll-mt":[{"scroll-mt":K()}],"scroll-mr":[{"scroll-mr":K()}],"scroll-mb":[{"scroll-mb":K()}],"scroll-ml":[{"scroll-ml":K()}],"scroll-p":[{"scroll-p":K()}],"scroll-px":[{"scroll-px":K()}],"scroll-py":[{"scroll-py":K()}],"scroll-ps":[{"scroll-ps":K()}],"scroll-pe":[{"scroll-pe":K()}],"scroll-pt":[{"scroll-pt":K()}],"scroll-pr":[{"scroll-pr":K()}],"scroll-pb":[{"scroll-pb":K()}],"scroll-pl":[{"scroll-pl":K()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe,ge]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[Re,Ls,Dn,Qc]}],stroke:[{stroke:["none",...Z()]}],"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"]}},A1=c1(T1);function qa(...s){return A1(Qb(s))}const R1=({message:s,type:o="info",duration:l=3e3,onClose:i,visible:d})=>{b.useEffect(()=>{if(d){const g=setTimeout(()=>{i()},l);return()=>clearTimeout(g)}},[d,l,i]);const f={success:r.jsx(Ao,{className:"w-5 h-5 text-green-500"}),error:r.jsx(qs,{className:"w-5 h-5 text-red-500"}),info:r.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),warning:r.jsx("svg",{className:"w-5 h-5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})},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 r.jsx("div",{className:qa("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:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:f[o]}),r.jsx("div",{className:"ml-3",children:r.jsx("p",{className:qa("text-sm font-medium",p[o]),children:s})}),r.jsx("div",{className:"ml-auto pl-3",children:r.jsx("div",{className:"-mx-1.5 -my-1.5",children:r.jsxs("button",{onClick:i,className:qa("inline-flex rounded-md p-1.5",`hover:bg-${o}-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${o}-500`),children:[r.jsx("span",{className:"sr-only",children:"Dismiss"}),r.jsx(qs,{className:"h-5 w-5"})]})})})]})})},Lg=b.createContext(void 0),Ys=()=>{const s=b.useContext(Lg);if(!s)throw new Error("useToast must be used within a ToastProvider");return s},M1=({children:s})=>{const[o,l]=b.useState({message:"",type:"info",visible:!1,duration:3e3}),i=b.useCallback((f,m="info",p=3e3)=>{l({message:f,type:m,visible:!0,duration:p})},[]),d=b.useCallback(()=>{l(f=>({...f,visible:!1}))},[]);return r.jsxs(Lg.Provider,{value:{showToast:i},children:[s,r.jsx(R1,{message:o.message,type:o.type,duration:o.duration,onClose:d,visible:o.visible})]})},_g=b.createContext(void 0),O1=()=>{const s=b.useContext(_g);if(!s)throw new Error("useTheme must be used within a ThemeProvider");return s},z1=({children:s})=>{const[o,l]=b.useState(()=>localStorage.getItem("theme")||"system"),[i,d]=b.useState("light"),f=m=>{l(m),localStorage.setItem("theme",m)};return b.useEffect(()=>{const m=()=>{const g=window.document.documentElement,h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",y=o==="system"?h:o;d(y),y==="dark"?(console.log("Applying dark mode to HTML root element"),g.classList.add("dark"),document.body.style.backgroundColor="#111827"):(console.log("Removing dark mode from HTML root element"),g.classList.remove("dark"),document.body.style.backgroundColor="")},p=window.matchMedia("(prefers-color-scheme: dark)");return p.addEventListener("change",m),m(),()=>{p.removeEventListener("change",m)}},[o]),r.jsx(_g.Provider,{value:{theme:o,setTheme:f,resolvedTheme:i},children:s})},U1=(s,o,l,i)=>{var f,m,p,g;const d=[l,{code:o,...i||{}}];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);Ln(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)},Oh={},ru=(s,o,l,i)=>{Ln(l)&&Oh[l]||(Ln(l)&&(Oh[l]=new Date),U1(s,o,l,i))},Bg=(s,o)=>()=>{if(s.isInitialized)o();else{const l=()=>{setTimeout(()=>{s.off("initialized",l)},0),o()};s.on("initialized",l)}},su=(s,o,l)=>{s.loadNamespaces(o,Bg(s,l))},zh=(s,o,l,i)=>{if(Ln(l)&&(l=[l]),s.options.preload&&s.options.preload.indexOf(o)>-1)return su(s,l,i);l.forEach(d=>{s.options.ns.indexOf(d)<0&&s.options.ns.push(d)}),s.loadLanguages(o,Bg(s,i))},D1=(s,o,l={})=>!o.languages||!o.languages.length?(ru(o,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:o.languages}),!0):o.hasLoadedNamespace(s,{lng:l.lng,precheck:(i,d)=>{var f;if(((f=l.bindI18n)==null?void 0:f.indexOf("languageChanging"))>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!d(i.isLanguageChangingTo,s))return!1}}),Ln=s=>typeof s=="string",L1=s=>typeof s=="object"&&s!==null,_1=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,B1={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},H1=s=>B1[s],q1=s=>s.replace(_1,H1);let lu={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:q1};const P1=(s={})=>{lu={...lu,...s}},V1=()=>lu;let Hg;const G1=s=>{Hg=s},K1=()=>Hg,$1={type:"3rdParty",init(s){P1(s.options.react),G1(s)}},Y1=b.createContext();class F1{constructor(){this.usedNamespaces={}}addUsedNamespaces(o){o.forEach(l=>{this.usedNamespaces[l]||(this.usedNamespaces[l]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const X1=(s,o)=>{const l=b.useRef();return b.useEffect(()=>{l.current=s},[s,o]),l.current},qg=(s,o,l,i)=>s.getFixedT(o,l,i),Q1=(s,o,l,i)=>b.useCallback(qg(s,o,l,i),[s,o,l,i]),Ee=(s,o={})=>{var X,L,ee,ae;const{i18n:l}=o,{i18n:i,defaultNS:d}=b.useContext(Y1)||{},f=l||i||K1();if(f&&!f.reportNamespaces&&(f.reportNamespaces=new F1),!f){ru(f,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const K=(de,z)=>Ln(z)?z:L1(z)&&Ln(z.defaultValue)?z.defaultValue:Array.isArray(de)?de[de.length-1]:de,oe=[K,{},!1];return oe.t=K,oe.i18n={},oe.ready=!1,oe}(X=f.options.react)!=null&&X.wait&&ru(f,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const m={...V1(),...f.options.react,...o},{useSuspense:p,keyPrefix:g}=m;let h=d||((L=f.options)==null?void 0:L.defaultNS);h=Ln(h)?[h]:h||["translation"],(ae=(ee=f.reportNamespaces).addUsedNamespaces)==null||ae.call(ee,h);const y=(f.isInitialized||f.initializedStoreOnce)&&h.every(K=>D1(K,f,m)),S=Q1(f,o.lng||null,m.nsMode==="fallback"?h:h[0],g),w=()=>S,A=()=>qg(f,o.lng||null,m.nsMode==="fallback"?h:h[0],g),[C,k]=b.useState(w);let R=h.join();o.lng&&(R=`${o.lng}${R}`);const N=X1(R),E=b.useRef(!0);b.useEffect(()=>{const{bindI18n:K,bindI18nStore:oe}=m;E.current=!0,!y&&!p&&(o.lng?zh(f,o.lng,h,()=>{E.current&&k(A)}):su(f,h,()=>{E.current&&k(A)})),y&&N&&N!==R&&E.current&&k(A);const de=()=>{E.current&&k(A)};return K&&(f==null||f.on(K,de)),oe&&(f==null||f.store.on(oe,de)),()=>{E.current=!1,f&&(K==null||K.split(" ").forEach(z=>f.off(z,de))),oe&&f&&oe.split(" ").forEach(z=>f.store.off(z,de))}},[f,R]),b.useEffect(()=>{E.current&&y&&k(w)},[f,g,y]);const U=[C,f,y];if(U.t=C,U.i18n=f,U.ready=y,y||!y&&!p)return U;throw new Promise(K=>{o.lng?zh(f,o.lng,h,()=>K()):su(f,h,()=>K())})},Pg=()=>{const{t:s}=Ee(),{theme:o,setTheme:l}=O1(),i=()=>{l(o==="light"?"dark":"light")};return r.jsx("button",{onClick:i,className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none",title:s(o==="light"?"theme.dark":"theme.light"),"aria-label":s(o==="light"?"theme.dark":"theme.light"),children:o==="light"?r.jsx(Ob,{className:"h-5 w-5"}):r.jsx(Pb,{className:"h-5 w-5"})})},Z1=s=>{const{t:o}=Ee();return r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:2,...s,children:[r.jsx("title",{children:o("common.language")}),r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2 12h20"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"})]})},Vg=()=>{const{i18n:s}=Ee(),[o,l]=b.useState(!1),[i,d]=b.useState(s.language),f=[{code:"en",label:"English"},{code:"zh",label:"中文"}];b.useEffect(()=>{d(s.language)},[s.language]),b.useEffect(()=>{const g=h=>{h.target.closest(".language-dropdown")||l(!1)};return o&&document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[o]);const m=g=>{localStorage.setItem("i18nextLng",g),l(!1),window.location.reload()},p=()=>{l(!o)};return r.jsxs("div",{className:"relative language-dropdown",children:[r.jsx("button",{onClick:p,className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none","aria-label":"Language Switcher",children:r.jsx(Z1,{className:"h-5 w-5"})}),o&&r.jsx("div",{className:"absolute right-0 mt-2 w-24 bg-white dark:bg-gray-800 rounded-md shadow-lg border border-gray-200 dark:border-gray-700 z-50",children:r.jsx("div",{children:f.map(g=>r.jsx("button",{onClick:()=>m(g.code),className:`flex items-center w-full px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${i.startsWith(g.code)?"bg-blue-50 text-blue-700":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-100"}`,children:g.label},g.code))})})]})},I1=s=>r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[r.jsx("title",{children:"GitHub"}),r.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]}),J1=({onToggleSidebar:s})=>{const{t:o}=Ee();return r.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-sm z-10",children:r.jsxs("div",{className:"flex justify-between items-center px-3 py-3",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("button",{onClick: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:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),r.jsx("h1",{className:"ml-4 text-xl font-bold text-gray-900 dark:text-white",children:o("app.title")})]}),r.jsxs("div",{className:"flex items-center space-x-1",children:[r.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 mr-2",children:"v0.9.0"}),r.jsx("a",{href:"https://github.com/samanhappy/mcphub",target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700","aria-label":"GitHub Repository",children:r.jsx(I1,{className:"h-5 w-5"})}),r.jsx(Pg,{}),r.jsx(Vg,{})]})]})})},co=({permissions:s,fallback:o=null,children:l})=>Gg(s)?r.jsx(r.Fragment,{children:l}):r.jsx(r.Fragment,{children:o}),Gg=s=>{const{auth:o}=$s();if(!o.isAuthenticated||!o.user)return!1;const l=o.user.permissions||[];return s==="x"&&!l.includes("x")?!1:l.includes("*")||o.user.isAdmin?!0:(Array.isArray(s)?s:[s]).some(d=>l.includes(d))},W1="https://registry.npmjs.org",ev="@samanhappy/mcphub",Kg=async()=>{try{const s=await fetch(`${W1}/${ev}/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}},$g=(s,o)=>{if(s==="dev")return-1;const l=s.split(".").map(Number),i=o.split(".").map(Number);for(let d=0;d<3;d++){const f=l[d]||0,m=i[d]||0;if(f>m)return-1;if(f<m)return 1}return 0},tv=({isOpen:s,onClose:o,version:l})=>{const{t:i}=Ee(),[d,f]=b.useState(!1),[m,p]=b.useState(""),[g,h]=b.useState(!1),y=async()=>{h(!0);try{const S=await Kg();S&&(p(S),f($g(l,S)>0))}catch(S){console.error("Failed to check for updates:",S)}finally{h(!1)}};return b.useEffect(()=>{s&&y()},[s,l]),s?r.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:r.jsxs("div",{className:"p-6 relative",children:[r.jsx("button",{onClick:o,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400","aria-label":i("common.close"),children:r.jsx(qs,{className:"h-5 w-5"})}),r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:i("about.title")}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-gray-700 dark:text-gray-300",children:[i("about.currentVersion"),":"]}),r.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:l})]}),d&&m&&r.jsx("div",{className:"bg-blue-50 dark:bg-blue-900 p-3 rounded",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsxs("div",{className:"ml-3 flex-1 text-sm text-blue-700 dark:text-blue-300",children:[r.jsx("p",{children:i("about.newVersionAvailable",{version:m})}),r.jsx("p",{className:"mt-1",children:r.jsx("a",{href:"https://github.com/samanhappy/mcphub",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 hover:underline",children:i("about.viewOnGitHub")})})]})]})}),r.jsxs("button",{onClick:y,disabled:g,className:`mt-4 inline-flex items-center px-4 py-2 border border-gray-200 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium btn-secondary
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:[r.jsx(Lb,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),i(g?"about.checking":"about.checkForUpdates")]})]})]})})}):null},av=({open:s,onOpenChange:o})=>{const{i18n:l,t:i}=Ee();return s?r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:r.jsxs("div",{className:"p-6 relative",children:[r.jsx("button",{onClick:()=>o(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400","aria-label":i("common.close"),children:r.jsx(qs,{className:"h-5 w-5"})}),r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:i("sponsor.title")}),r.jsx("div",{className:"flex flex-col items-center justify-center py-4",children:l.language==="zh"?r.jsx("img",{src:"./assets/reward.png",alt:i("sponsor.rewardAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}):r.jsxs("div",{className:"text-center",children:[r.jsx("p",{className:"mb-4 text-gray-700 dark:text-gray-300",children:i("sponsor.supportMessage")}),r.jsx("a",{href:"https://ko-fi.com/samanhappy",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center bg-[#13C3FF] text-white px-4 py-2 rounded-md hover:bg-[#00A5E5] transition-colors",children:i("sponsor.supportButton")})]})})]})})}):null},nv=({open:s,onOpenChange:o})=>{const{t:l}=Ee();return s?r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:r.jsxs("div",{className:"p-6 relative",children:[r.jsx("button",{onClick:()=>o(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400","aria-label":l("common.close"),children:r.jsx(qs,{className:"h-5 w-5"})}),r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:l("wechat.title")}),r.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[r.jsx("img",{src:"./assets/wexin.png",alt:l("wechat.qrCodeAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}),r.jsx("p",{className:"mt-4 text-center text-gray-700 dark:text-gray-300",children:l("wechat.scanMessage")})]})]})})}):null},rv=s=>r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[r.jsx("title",{children:"WeChat"}),r.jsx("path",{d:"M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.864.864 0 0 1 .717-.098 10.16 10.16 0 0 0 2.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178 1.17 1.17 0 0 1-1.162-1.178c0-.651.52-1.18 1.162-1.18zm5.34 2.867c-1.797-.052-3.746.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22.942 2.453 3.666 4.229 6.884 4.229.826 0 1.622-.12 2.361-.336a.722.722 0 0 1 .598.082l1.584.926a.272.272 0 0 0 .14.047c.134 0 .24-.111.24-.247 0-.06-.023-.12-.038-.177l-.327-1.233a.582.582 0 0 1-.023-.156.49.49 0 0 1 .201-.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53 3.274c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.969-.982z"})]}),sv=s=>r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[r.jsx("title",{children:"Discord"}),r.jsx("path",{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"})]}),lv=s=>r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[r.jsx("title",{children:"Sponsor"}),r.jsx("path",{d:"M17.625 1.499c-2.32 0-4.354 1.203-5.625 3.03-1.271-1.827-3.305-3.03-5.625-3.03C3.129 1.499 0 4.253 0 8.249c0 4.275 3.068 7.847 5.828 10.227a33.14 33.14 0 0 0 5.616 3.876l.028.017.008.003-.001.003c.163.085.342.126.521.125.179.001.358-.041.521-.125l-.001-.003.008-.003.028-.017a33.14 33.14 0 0 0 5.616-3.876C20.932 16.096 24 12.524 24 8.249c0-3.996-3.129-6.75-6.375-6.75zm-.919 15.275a30.766 30.766 0 0 1-4.703 3.316l-.004-.002-.004.002a30.955 30.955 0 0 1-4.703-3.316c-2.677-2.307-5.047-5.298-5.047-8.523 0-2.754 2.121-4.5 4.125-4.5 2.06 0 3.914 1.479 4.544 3.684.143.495.596.797 1.086.796.49.001.943-.302 1.085-.796.63-2.205 2.484-3.684 4.544-3.684 2.004 0 4.125 1.746 4.125 4.5 0 3.225-2.37 6.216-5.048 8.523z"})]}),ov=({collapsed:s,version:o})=>{var ae;const{t:l,i18n:i}=Ee(),d=Ga(),{auth:f,logout:m}=$s(),[p,g]=b.useState(!1),[h,y]=b.useState(!1),[S,w]=b.useState(!1),[A,C]=b.useState(!1),[k,R]=b.useState(!1),N=b.useRef(null);b.useEffect(()=>{(async()=>{try{const oe=await Kg();oe&&y($g(o,oe)>0)}catch(oe){console.error("Error checking for new version:",oe)}})()},[o]),b.useEffect(()=>{const K=oe=>{N.current&&!N.current.contains(oe.target)&&g(!1)};return document.addEventListener("mousedown",K),()=>{document.removeEventListener("mousedown",K)}},[]);const E=()=>{d("/settings"),g(!1)},U=()=>{m(),d("/login")},X=()=>{w(!0),g(!1)},L=()=>{C(!0),g(!1)},ee=()=>{R(!0),g(!1)};return r.jsxs("div",{ref:N,className:"relative",children:[r.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:[r.jsxs("div",{className:"flex-shrink-0 relative",children:[r.jsx("div",{className:"w-5 h-5 flex items-center justify-center rounded-full border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-700",children:r.jsx($b,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),h&&r.jsx("span",{className:"absolute -top-1 -right-1 block w-2 h-2 bg-red-500 rounded-full"})]}),!s&&r.jsx("div",{className:"ml-3 flex flex-col items-start",children:r.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:((ae=f.user)==null?void 0:ae.username)||l("auth.user")})})]}),p&&r.jsxs("div",{className:"absolute top-0 transform -translate-y-full left-0 w-full min-w-max bg-white border border-gray-200 dark:bg-gray-800 z-50",children:[r.jsxs("button",{onClick: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:[r.jsx(lv,{className:"h-4 w-4 mr-2"}),l("sponsor.label")]}),i.language==="zh"?r.jsxs("button",{onClick:ee,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(rv,{className:"h-4 w-4 mr-2"}),l("wechat.label")]}):r.jsxs("a",{href:"https://discord.gg/qMKNsn5Q",target:"_blank",rel:"noopener noreferrer",className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(sv,{className:"h-4 w-4 mr-2"}),l("discord.label")]}),r.jsxs("button",{onClick:E,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(Bb,{className:"h-4 w-4 mr-2"}),l("nav.settings")]}),r.jsxs("button",{onClick:X,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 relative",children:[r.jsx(Sb,{className:"h-4 w-4 mr-2"}),l("about.title"),h&&r.jsx("span",{className:"absolute top-2 right-4 block w-2 h-2 bg-red-500 rounded-full"})]}),r.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600"}),r.jsxs("button",{onClick:U,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(Rb,{className:"h-4 w-4 mr-2"}),l("app.logout")]})]}),r.jsx(tv,{isOpen:S,onClose:()=>w(!1),version:o}),r.jsx(av,{open:A,onOpenChange:C}),r.jsx(nv,{open:k,onOpenChange:R})]})},iv=({collapsed:s})=>{var f;const{t:o}=Ee(),{auth:l}=$s(),i="0.9.0",d=[{path:"/",label:o("nav.dashboard"),icon:r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[r.jsx("path",{d:"M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"}),r.jsx("path",{d:"M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"})]})},{path:"/servers",label:o("nav.servers"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm14 1a1 1 0 11-2 0 1 1 0 012 0zM2 13a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2zm14 1a1 1 0 11-2 0 1 1 0 012 0z",clipRule:"evenodd"})})},{path:"/groups",label:o("nav.groups"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"})})},...(f=l.user)!=null&&f.isAdmin&&Gg("x")?[{path:"/users",label:o("nav.users"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M9 6a3 3 0 11-6 0 3 3 0 016 0zM17 6a3 3 0 11-6 0 3 3 0 016 0zM12.93 17c.046-.327.07-.66.07-1a6.97 6.97 0 00-1.5-4.33A5 5 0 0119 16v1h-6.07zM6 11a5 5 0 015 5v1H1v-1a5 5 0 015-5z"})})}]:[],{path:"/market",label:o("nav.market"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"})})},{path:"/logs",label:o("nav.logs"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"})})}];return r.jsxs("aside",{className:`bg-white dark:bg-gray-800 shadow-sm transition-all duration-300 ease-in-out flex flex-col h-full relative ${s?"w-16":"w-64"}`,children:[r.jsx("div",{className:"overflow-y-auto flex-grow",children:r.jsx("nav",{className:"p-3 space-y-1",children:d.map(m=>r.jsxs(xg,{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:[r.jsx("span",{className:"flex-shrink-0",children:m.icon}),!s&&r.jsx("span",{className:"ml-3",children:m.label})]},m.path))})}),r.jsx("div",{className:"p-3 bg-white dark:bg-gray-800",children:r.jsx(ov,{collapsed:s,version:i})})]})},cv=({children:s})=>r.jsx("main",{className:"flex-1 overflow-auto p-6 bg-gray-100 dark:bg-gray-900",children:r.jsx("div",{className:"container mx-auto",children:s})}),uv=()=>{const[s,o]=Mr.useState(!1),l=()=>{o(!s)};return r.jsxs("div",{className:"flex flex-col h-screen bg-gray-100 dark:bg-gray-900",children:[r.jsx(J1,{onToggleSidebar:l}),r.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[r.jsx(iv,{collapsed:s}),r.jsx(cv,{children:r.jsx(dg,{})})]})]})},dv=({redirectPath:s="/login"})=>{const{t:o}=Ee(),{auth:l}=$s();return l.loading?r.jsx("div",{className:"flex items-center justify-center h-screen",children:o("app.loading")}):l.isAuthenticated?r.jsx(dg,{}):r.jsx(bo,{to:s,replace:!0})},fv=()=>{const{t:s}=Ee(),[o,l]=b.useState(""),[i,d]=b.useState(""),[f,m]=b.useState(null),[p,g]=b.useState(!1),{login:h}=$s(),y=Ga(),S=async w=>{w.preventDefault(),m(null),g(!0);try{if(!o||!i){m(s("auth.emptyFields")),g(!1);return}await h(o,i)?y("/"):m(s("auth.loginFailed"))}catch{m(s("auth.loginError"))}finally{g(!1)}};return r.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:[r.jsxs("div",{className:"absolute top-4 right-4 w-full max-w-xs flex justify-end",children:[r.jsx(Pg,{}),r.jsx(Vg,{})]}),r.jsxs("div",{className:"max-w-md w-full space-y-8 login-card p-8",children:[r.jsx("div",{children:r.jsx("h2",{className:"mt-6 text-center text-3xl font-extrabold text-gray-900 dark:text-white",children:s("auth.loginTitle")})}),r.jsxs("form",{className:"mt-8 space-y-6",onSubmit:S,children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"username",className:"sr-only",children:s("auth.username")}),r.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:w=>l(w.target.value)})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"password",className:"sr-only",children:s("auth.password")}),r.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:i,onChange:w=>d(w.target.value)})]})]}),f&&r.jsx("div",{className:"text-red-500 dark:text-red-400 text-sm text-center error-box p-2 rounded",children:f}),r.jsx("div",{children:r.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")})})]})]})]})},uo={startup:{maxAttempts:60,pollingInterval:3e3},normal:{pollingInterval:1e4}},Fs=()=>{const{t:s}=Ee(),[o,l]=b.useState([]),[i,d]=b.useState(null),[f,m]=b.useState(0),[p,g]=b.useState(!0),[h,y]=b.useState(0),S=b.useRef(null),w=b.useRef(0),A=()=>{S.current&&(clearInterval(S.current),S.current=null)},C=b.useCallback(()=>{A();const X=async()=>{try{const L=await Xe("/servers");L&&L.success&&Array.isArray(L.data)?l(L.data):L&&Array.isArray(L)?l(L):(console.error("Invalid server data format:",L),l([])),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"))}};X(),S.current=setInterval(X,uo.normal.pollingInterval)},[s]);return b.useEffect(()=>{f>0&&(w.current=0,y(0));const X=async()=>{try{const L=await Xe("/servers");return L&&L.success&&Array.isArray(L.data)?(l(L.data),g(!1),C(),!0):L&&Array.isArray(L)?(l(L),g(!1),C(),!0):(console.error("Invalid server data format:",L),l([]),g(!1),C(),!0)}catch(L){return w.current+=1,console.error(`Initial loading attempt ${w.current} failed:`,L),y(w.current),navigator.onLine?d(s("errors.initialStartup")):d(s("errors.network")),w.current>=uo.startup.maxAttempts&&(console.log("Maximum startup attempts reached, switching to normal polling"),g(!1),A(),C()),!1}};return p?(A(),X(),S.current=setInterval(X,uo.startup.pollingInterval),console.log(`Started initial polling with interval: ${uo.startup.pollingInterval}ms`)):C(),()=>{A()}},[f,s,p,C]),{servers:o,error:i,setError:d,isLoading:p,fetchAttempts:h,triggerRefresh:()=>{A(),p&&(g(!0),w.current=0,y(0)),m(X=>X+1)},handleServerAdd:()=>{m(X=>X+1)},handleServerEdit:async X=>{try{const L=await Xe("/settings");if(L&&L.success&&L.data&&L.data.mcpServers&&L.data.mcpServers[X.name]){const ee=L.data.mcpServers[X.name];return{name:X.name,status:X.status,tools:X.tools||[],config:ee}}else return console.error("Failed to get server config from settings:",L),d(s("server.invalidConfig",{serverName:X.name})),null}catch(L){return console.error("Error fetching server settings:",L),d(L instanceof Error?L.message:String(L)),null}},handleServerRemove:async X=>{try{const L=await vo(`/servers/${X}`);return!L||!L.success?(d((L==null?void 0:L.message)||s("server.deleteError",{serverName:X})),!1):(m(ee=>ee+1),!0)}catch(L){return d(s("errors.general")+": "+(L instanceof Error?L.message:String(L))),!1}},handleServerToggle:async(X,L)=>{try{const ee=await Vt(`/servers/${X.name}/toggle`,{enabled:L});return!ee||!ee.success?(console.error("Failed to toggle server:",ee),d((ee==null?void 0:ee.message)||s("server.toggleError",{serverName:X.name})),!1):(m(ae=>ae+1),!0)}catch(ee){return console.error("Error toggling server:",ee),d(ee instanceof Error?ee.message:String(ee)),!1}}}},mv=()=>{const{t:s}=Ee(),{servers:o,error:l,setError:i,isLoading:d}=Fs(),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 r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:s("pages.dashboard.title")}),l&&r.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-status-red text-lg font-medium",children:s("app.error")}),r.jsx("p",{className:"text-gray-600 mt-1",children:l})]}),r.jsx("button",{onClick:()=>i(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200","aria-label":s("app.closeButton"),children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 111.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z",clipRule:"evenodd"})})})]})}),d&&r.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}),!d&&r.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4",children:[r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"p-3 rounded-full bg-blue-100 text-blue-800 icon-container status-icon-blue",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"})})}),r.jsxs("div",{className:"ml-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.totalServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.total})]})]})}),r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"p-3 rounded-full bg-green-100 text-green-800 icon-container status-icon-green",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsxs("div",{className:"ml-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.onlineServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.online})]})]})}),r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"p-3 rounded-full bg-red-100 text-red-800 icon-container status-icon-red",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsxs("div",{className:"ml-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.offlineServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.offline})]})]})}),r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"p-3 rounded-full bg-yellow-100 text-yellow-800 icon-container status-icon-yellow",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsxs("div",{className:"ml-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:s("pages.dashboard.connectingServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:f.connecting})]})]})})]}),o.length>0&&!d&&r.jsxs("div",{className:"mt-8",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:s("pages.dashboard.recentServers")}),r.jsx("div",{className:"bg-white shadow rounded-lg overflow-hidden table-container",children:r.jsxs("table",{className:"min-w-full",children:[r.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.name")}),r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.status")}),r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.tools")}),r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.enabled")})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:o.slice(0,5).map((p,g)=>{var h;return r.jsxs("tr",{children:[r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:p.name}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:r.jsx("span",{className:`px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ${p.status==="connected"?"status-badge-online":p.status==="disconnected"?"status-badge-offline":"status-badge-connecting"}`,children:s(m[p.status]||p.status)})}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((h=p.tools)==null?void 0:h.length)||0}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:p.enabled!==!1?r.jsx("span",{className:"text-green-600",children:"✓"}):r.jsx("span",{className:"text-status-red",children:"✗"})})]},g)})})]})})]})]})},hv="modulepreload",gv=function(s,o){return new URL(s,o).href},Uh={},pv=function(o,l,i){let d=Promise.resolve();if(l&&l.length>0){let m=function(y){return Promise.all(y.map(S=>Promise.resolve(S).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),h=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));d=m(l.map(y=>{if(y=gv(y,i),y in Uh)return;Uh[y]=!0;const S=y.endsWith(".css"),w=S?'[rel="stylesheet"]':"";if(!!i)for(let k=p.length-1;k>=0;k--){const R=p[k];if(R.href===y&&(!S||R.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${w}`))return;const C=document.createElement("link");if(C.rel=S?"stylesheet":hv,S||(C.as="script"),C.crossOrigin="",C.href=y,h&&C.setAttribute("nonce",h),document.head.appendChild(C),S)return new Promise((k,R)=>{C.addEventListener("load",k),C.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)})},xv={default:"bg-blue-500 text-white hover:bg-blue-600",secondary:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600",outline:"bg-transparent border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800",destructive:"bg-red-500 text-white hover:bg-red-600"};function fo({children:s,variant:o="default",className:l,onClick:i}){return r.jsx("span",{className:qa("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",xv[o],i?"cursor-pointer":"",l),onClick:i,children:s})}const yv=({status:s})=>{const{t:o}=Ee(),l={connecting:"status-badge-connecting",connected:"status-badge-online",disconnected:"status-badge-offline"},i={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting"};return r.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${l[s]}`,children:o(i[s]||s)})},Yg=async(s,o)=>{var l;try{const i=o?`/tools/call/${o}`:"/tools/call",d=await Vt(i,{toolName:s.toolName,arguments:s.arguments},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return d.success?{success:!0,content:((l=d.data)==null?void 0:l.content)||[]}:{success:!1,error:d.message||"Tool call failed"}}catch(i){return console.error("Error calling tool:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}},bv=async(s,o,l)=>{try{const i=await Vt(`/servers/${s}/tools/${o}/toggle`,{enabled:l},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:i.success,error:i.success?void 0:i.message}}catch(i){return console.error("Error toggling tool:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}},Fg=async(s,o,l)=>{try{const i=await Wt(`/servers/${s}/tools/${o}/description`,{description:l},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:i.success,error:i.success?void 0:i.message}}catch(i){return console.error("Error updating tool description:",i),{success:!1,error:i instanceof Error?i.message:"Unknown error occurred"}}},vv=Object.freeze(Object.defineProperty({__proto__:null,callTool:Yg,toggleTool:bv,updateToolDescription:Fg},Symbol.toStringTag,{value:"Module"})),Rr=({checked:s,onCheckedChange:o,disabled:l=!1})=>r.jsx("button",{type:"button",role:"switch","aria-checked":s,disabled:l,className:qa("relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",s?"bg-blue-200":"bg-gray-100",l?"opacity-50 cursor-not-allowed":"cursor-pointer"),onClick:()=>!l&&o(!s),children:r.jsx("span",{className:qa("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",s?"translate-x-6":"translate-x-1")})}),wv=({schema:s,onSubmit:o,onCancel:l,loading:i=!1,storageKey:d,title:f})=>{const{t:m}=Ee(),[p,g]=b.useState({}),[h,y]=b.useState({}),[S,w]=b.useState(!1),[A,C]=b.useState(""),[k,R]=b.useState(""),N=b.useMemo(()=>(O=>{const J=$=>{if(typeof $=="object"&&$!==null){const F=$;return{type:F.type||"string",description:F.description,enum:F.enum,default:F.default,properties:F.properties?Object.fromEntries(Object.entries(F.properties).map(([T,q])=>[T,J(q)])):void 0,required:F.required,items:F.items?J(F.items):void 0}}return{type:"string"}};return{type:O.type,properties:O.properties?Object.fromEntries(Object.entries(O.properties).map(([$,F])=>[$,J(F)])):void 0,required:O.required}})(s),[s]);b.useEffect(()=>{const z=(J,$="")=>{const F={};return J.type==="object"&&J.properties&&Object.entries(J.properties).forEach(([T,q])=>{const Z=$?`${$}.${T}`:T;q.default!==void 0?F[T]=q.default:q.type==="string"?F[T]="":q.type==="number"||q.type==="integer"?F[T]=0:q.type==="boolean"?F[T]=!1:q.type==="array"?F[T]=[]:q.type==="object"&&(q.properties?F[T]=z(q,Z):F[T]={})}),F};let O=z(N);if(d)try{const J=localStorage.getItem(d);if(J){const $=JSON.parse(J);O={...O,...$}}}catch(J){console.warn("Failed to load saved form data:",J)}g(O)},[N,d]),b.useEffect(()=>{S&&Object.keys(p).length>0&&(C(JSON.stringify(p,null,2)),R(""))},[S,p]);const E=z=>{C(z),R("");try{const O=JSON.parse(z);if(g(O),d)try{localStorage.setItem(d,JSON.stringify(O))}catch(J){console.warn("Failed to save form data to localStorage:",J)}}catch{R(m("tool.invalidJsonFormat"))}},U=()=>{C(JSON.stringify(p,null,2)),R(""),w(!0)},X=()=>{if(A.trim())try{const z=JSON.parse(A);g(z),R(""),w(!1)}catch{R(m("tool.fixJsonBeforeSwitching"));return}else w(!1)},L=(z,O)=>{g(J=>{const $={...J},F=z.split(".");let T=$;for(let q=0;q<F.length-1;q++)T[F[q]]||(T[F[q]]={}),T=T[F[q]];if(T[F[F.length-1]]=O,d)try{localStorage.setItem(d,JSON.stringify($))}catch(q){console.warn("Failed to save form data to localStorage:",q)}return $}),h[z]&&y(J=>{const $={...J};return delete $[z],$})},ee=()=>{const z={},O=(J,$,F="")=>{J.type==="object"&&J.properties&&Object.entries(J.properties).forEach(([T,q])=>{var j;const Z=F?`${F}.${T}`:T,re=K($,Z);if((j=J.required)!=null&&j.includes(T)&&(re==null||re==="")){z[Z]=`${T} is required`;return}re!=null&&re!==""&&(q.type==="string"&&typeof re!="string"?z[Z]=`${T} must be a string`:q.type==="number"&&typeof re!="number"?z[Z]=`${T} must be a number`:q.type==="integer"&&(!Number.isInteger(re)||typeof re!="number")?z[Z]=`${T} must be an integer`:q.type==="boolean"&&typeof re!="boolean"?z[Z]=`${T} must be a boolean`:q.type==="array"&&Array.isArray(re)?q.items&&re.forEach((I,le)=>{var B;((B=q.items)==null?void 0:B.type)==="object"&&q.items.properties&&O(q.items,I,`${Z}.${le}`)}):q.type==="object"&&typeof re=="object"&&O(q,re,Z))})};return O(N,p),y(z),Object.keys(z).length===0},ae=z=>{z.preventDefault(),ee()&&o(p)},K=(z,O)=>O.split(".").reduce((J,$)=>J==null?void 0:J[$],z),oe=(z,O,J,$)=>{const F=J==null?void 0:J[z];return O.type==="string"?O.enum?r.jsxs("select",{value:F||"",onChange:T=>$(T.target.value),className:"w-full border rounded-md px-2 py-1 text-sm border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500",children:[r.jsx("option",{value:"",children:m("tool.selectOption")}),O.enum.map((T,q)=>r.jsx("option",{value:T,children:T},q))]}):r.jsx("input",{type:"text",value:F||"",onChange:T=>$(T.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:O.description||m("tool.enterKey",{key:z})}):O.type==="number"||O.type==="integer"?r.jsx("input",{type:"number",step:O.type==="integer"?"1":"any",value:F??"",onChange:T=>{const q=T.target.value===""?"":O.type==="integer"?parseInt(T.target.value):parseFloat(T.target.value);$(q)},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"}):O.type==="boolean"?r.jsx("input",{type:"checkbox",checked:F||!1,onChange:T=>$(T.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}):r.jsx("input",{type:"text",value:F||"",onChange:T=>$(T.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:O.description||m("tool.enterKey",{key:z})})},de=(z,O,J="")=>{var q,Z,re,j,I,le,B,V,me,W,Y,ue,be,je;const $=J?`${J}.${z}`:z,F=K(p,$),T=h[$];if(O.type==="array"){const xe=K(p,$)||[];return r.jsxs("div",{className:"mb-6",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?(Z=(q=K(N,J))==null?void 0:q.required)==null?void 0:Z.includes(z):(re=N.required)==null?void 0:re.includes(z))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),O.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:O.description}),r.jsxs("div",{className:"border border-gray-200 rounded-md p-3 bg-gray-50",children:[xe.map((Te,Be)=>{var st,wa,ca;return r.jsxs("div",{className:"mb-3 p-3 bg-white border rounded-md",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("span",{className:"text-sm font-medium text-gray-600",children:m("tool.item",{index:Be+1})}),r.jsx("button",{type:"button",onClick:()=>{const De=[...xe];De.splice(Be,1),L($,De)},className:"text-status-red hover:text-red-700 text-sm",children:m("common.remove")})]}),((st=O.items)==null?void 0:st.type)==="string"&&O.items.enum?r.jsxs("select",{value:Te||"",onChange:De=>{const bt=[...xe];bt[Be]=De.target.value,L($,bt)},className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[r.jsx("option",{value:"",children:m("tool.selectOption")}),O.items.enum.map((De,bt)=>r.jsx("option",{value:De,children:De},bt))]}):((wa=O.items)==null?void 0:wa.type)==="object"&&O.items.properties?r.jsx("div",{className:"space-y-3",children:Object.entries(O.items.properties).map(([De,bt])=>{var ua,da;return r.jsxs("div",{children:[r.jsxs("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[De,((da=(ua=O.items)==null?void 0:ua.required)==null?void 0:da.includes(De))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),oe(De,bt,Te,Gt=>{const fa=[...xe];fa[Be]={...fa[Be],[De]:Gt},L($,fa)})]},De)})}):r.jsx("input",{type:"text",value:Te||"",onChange:De=>{const bt=[...xe];bt[Be]=De.target.value,L($,bt)},className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",placeholder:m("tool.enterValue",{type:((ca=O.items)==null?void 0:ca.type)||"value"})})]},Be)}),r.jsx("button",{type:"button",onClick:()=>{var Be;const Te=((Be=O.items)==null?void 0:Be.type)==="object"?{}:"";L($,[...xe,Te])},className:"w-full mt-2 px-3 py-2 text-sm text-blue-600 border border-blue-300 rounded-md hover:bg-blue-50",children:m("tool.addItem",{key:z})})]}),T&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:T})]},$)}return O.type==="object"?O.properties?r.jsxs("div",{className:"mb-6",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?(I=(j=K(N,J))==null?void 0:j.required)==null?void 0:I.includes(z):(le=N.required)==null?void 0:le.includes(z))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),O.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:O.description}),r.jsx("div",{className:"border border-gray-200 rounded-md p-4 bg-gray-50",children:Object.entries(O.properties).map(([xe,Te])=>de(xe,Te,$))}),T&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:T})]},$):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?(V=(B=K(N,J))==null?void 0:B.required)==null?void 0:V.includes(z):(me=N.required)==null?void 0:me.includes(z))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"}),r.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(JSON object)"})]}),O.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:O.description}),r.jsx("textarea",{value:typeof F=="object"?JSON.stringify(F,null,2):F||"{}",onChange:xe=>{try{const Te=JSON.parse(xe.target.value);L($,Te)}catch{L($,xe.target.value)}},placeholder:`{
184
- "key": "value"
185
- }`,className:`w-full border rounded-md px-3 py-2 font-mono text-sm ${T?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,rows:4}),T&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:T})]},$):O.type==="string"?O.enum?r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?!1:(W=N.required)==null?void 0:W.includes(z))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),O.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:O.description}),r.jsxs("select",{value:F||"",onChange:xe=>L($,xe.target.value),className:`w-full border rounded-md px-3 py-2 ${T?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[r.jsx("option",{value:"",children:m("tool.selectOption")}),O.enum.map((xe,Te)=>r.jsx("option",{value:xe,children:xe},Te))]}),T&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:T})]},$):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?!1:(Y=N.required)==null?void 0:Y.includes(z))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),O.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:O.description}),r.jsx("input",{type:"text",value:F||"",onChange:xe=>L($,xe.target.value),className:`w-full border rounded-md px-3 py-2 ${T?"border-red":"border-gray-200"} focus:outline-none form-input`}),T&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:T})]},$):O.type==="number"||O.type==="integer"?r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?!1:(ue=N.required)==null?void 0:ue.includes(z))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),O.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:O.description}),r.jsx("input",{type:"number",step:O.type==="integer"?"1":"any",value:F??"",onChange:xe=>{const Te=xe.target.value===""?"":O.type==="integer"?parseInt(xe.target.value):parseFloat(xe.target.value);L($,Te)},className:`w-full border rounded-md px-3 py-2 form-input ${T?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),T&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:T})]},$):O.type==="boolean"?r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("input",{type:"checkbox",checked:F||!1,onChange:xe=>L($,xe.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),r.jsxs("label",{className:"ml-2 block text-sm text-gray-700",children:[z,(J?!1:(be=N.required)==null?void 0:be.includes(z))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]})]}),O.description&&r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:O.description}),T&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:T})]},$):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[z,(J?!1:(je=N.required)==null?void 0:je.includes(z))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"}),r.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",O.type,")"]})]}),O.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:O.description}),r.jsx("input",{type:"text",value:F||"",onChange:xe=>L($,xe.target.value),placeholder:m("tool.enterValue",{type:O.type}),className:`w-full border rounded-md px-3 py-2 ${T?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500 form-input`}),T&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:T})]},$)};return N.properties?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex justify-between items-center pb-3",children:[r.jsx("h6",{className:"text-md font-medium text-gray-900",children:f}),r.jsxs("div",{className:"flex space-x-2",children:[r.jsx("button",{type:"button",onClick:X,className:`px-3 py-1 text-sm rounded-md transition-colors ${S?"text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary":"bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary"}`,children:m("tool.formMode")}),r.jsx("button",{type:"button",onClick:U,className:`px-3 py-1 text-sm rounded-md transition-colors ${S?"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")})]})]}),S?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:m("tool.jsonConfiguration")}),r.jsx("textarea",{value:A,onChange:z=>E(z.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 ${k?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),k&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:k})]}),r.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-1 text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:m("tool.cancel")}),r.jsx("button",{onClick:()=>{try{const z=JSON.parse(A);o(z)}catch{R(m("tool.invalidJsonFormat"))}},disabled:i||!!k,className:"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m(i?"tool.running":"tool.runTool")})]})]}):r.jsxs("form",{onSubmit:ae,className:"space-y-4",children:[Object.entries(N.properties||{}).map(([z,O])=>de(z,O)),r.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-1 text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:m("tool.cancel")}),r.jsx("button",{type:"submit",disabled:i,className:"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m(i?"tool.running":"tool.runTool")})]})]})]}):r.jsxs("div",{className:"p-4 bg-gray-50 rounded-md",children:[r.jsx("p",{className:"text-sm text-gray-600",children:m("tool.noParameters")}),r.jsxs("div",{className:"flex justify-end space-x-2 mt-4",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 text-sm text-gray-600 bg-gray-100 rounded-md hover:bg-gray-200",children:m("tool.cancel")}),r.jsx("button",{onClick:()=>o({}),disabled:i,className:"px-4 py-2 text-sm text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",children:m(i?"tool.running":"tool.runTool")})]})]})},jv=({result:s,onClose:o})=>{const{t:l}=Ee(),i=s.content,d=m=>Array.isArray(m)?m.map((p,g)=>r.jsx("div",{className:"mb-3 last:mb-0",children:f(p)},g)):f(m),f=m=>{if(typeof m=="string")return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:m})});if(typeof m=="object"&&m!==null){if(m.type==="text"&&m.text)return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:m.text})});if(m.type==="image"&&m.data)return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("img",{src:`data:${m.mimeType||"image/png"};base64,${m.data}`,alt:l("tool.toolResult"),className:"max-w-full h-auto rounded-md"})});try{const p=typeof m=="string"?JSON.parse(m):m;return r.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[r.jsx("div",{className:"text-xs text-gray-500 mb-2",children:l("tool.jsonResponse")}),r.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(p,null,2)})]})}catch{return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(m)})})}}return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(m)})})};return r.jsxs("div",{className:"border border-gray-300 rounded-lg bg-white shadow-sm",children:[r.jsx("div",{className:"border-b border-gray-300 px-4 py-3 bg-gray-50 rounded-t-lg",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[s.success?r.jsx(xb,{size:20,className:"text-status-green"}):r.jsx(bb,{size:20,className:"text-status-red"}),r.jsx("div",{children:r.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[l("tool.execution")," ",s.success?l("tool.successful"):l("tool.failed")]})})]}),r.jsx("button",{onClick:o,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),r.jsx("div",{className:"p-4",children:s.success?r.jsx("div",{children:s.content&&s.content.length>0?r.jsxs("div",{children:[r.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("tool.result")}),d(s.content)]}):r.jsx("div",{className:"text-sm text-gray-500 italic",children:l("tool.noContent")})}):r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[r.jsx(Ng,{size:16,className:"text-red-500"}),r.jsx("span",{className:"text-sm font-medium text-red-700",children:l("tool.error")})]}),i&&i.length>0?r.jsxs("div",{children:[r.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("tool.errorDetails")}),d(i)]}):r.jsx("div",{className:"bg-red-50 border border-red-300 rounded-md p-3",children:r.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap",children:s.error||s.message||l("tool.unknownError")})})]})})]})},Nv=({tool:s,server:o,onToggle:l,onDescriptionUpdate:i})=>{const{t:d}=Ee(),[f,m]=b.useState(!1),[p,g]=b.useState(!1),[h,y]=b.useState(!1),[S,w]=b.useState(null),[A,C]=b.useState(!1),[k,R]=b.useState(s.description||""),N=b.useRef(null),E=b.useRef(null),[U,X]=b.useState(0);b.useEffect(()=>{A&&N.current&&(N.current.focus(),U>0&&(N.current.style.width=`${U+20}px`))},[A,U]),b.useEffect(()=>{!A&&E.current&&X(E.current.offsetWidth)},[A,k]);const L=b.useCallback(()=>`mcphub_tool_form_${o?`${o}_`:""}${s.name}`,[s.name,o]),ee=b.useCallback(()=>{localStorage.removeItem(L())},[L]),ae=F=>{l&&l(s.name,F)},K=()=>{C(!0)},oe=async()=>{try{const F=await Fg(o,s.name,k);F.success?(C(!1),i&&i(s.name,k)):(R(s.description||""),console.error("Failed to update tool description:",F.error))}catch(F){console.error("Error updating tool description:",F),R(s.description||""),C(!1)}},de=F=>{R(F.target.value)},z=F=>{F.key==="Enter"?oe():F.key==="Escape"&&(R(s.description||""),C(!1))},O=async F=>{y(!0);try{const T=await Yg({toolName:s.name,arguments:F},o);w(T)}catch(T){w({success:!1,error:T instanceof Error?T.message:"Unknown error occurred"})}finally{y(!1)}},J=()=>{g(!1),ee(),w(null)},$=()=>{w(null)};return r.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg p-4 mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>m(!f),children:[r.jsx("div",{className:"flex-1",children:r.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:[s.name.replace(o+"-",""),r.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600 inline-flex items-center",children:A?r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:N,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:k,onChange:de,onKeyDown:z,onClick:F=>F.stopPropagation(),style:{minWidth:"100px",width:U>0?`${U+20}px`:"auto"}}),r.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:F=>{F.stopPropagation(),oe()},children:r.jsx(Ao,{size:16})})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:E,children:k||d("tool.noDescription")}),r.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:F=>{F.stopPropagation(),K()},children:r.jsx(Sg,{size:14})})]})})]})}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("div",{className:"flex items-center space-x-2",onClick:F=>F.stopPropagation(),children:r.jsx(Rr,{checked:s.enabled??!0,onCheckedChange:ae,disabled:h})}),r.jsxs("button",{onClick:F=>{F.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?r.jsx(Tb,{size:14,className:"animate-spin"}):r.jsx(Ub,{size:14}),r.jsx("span",{children:d(h?"tool.running":"tool.run")})]}),r.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:f?r.jsx(wu,{size:18}):r.jsx(jg,{size:18})})]})]}),f&&r.jsxs("div",{className:"mt-4 space-y-4",children:[!p&&r.jsxs("div",{className:"bg-gray-50 rounded p-3 border border-gray-300",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:d("tool.inputSchema")}),r.jsx("pre",{className:"text-xs text-gray-600 overflow-auto",children:JSON.stringify(s.inputSchema,null,2)})]}),p&&r.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[r.jsx(wv,{schema:s.inputSchema||{type:"object"},onSubmit:O,onCancel:J,loading:h,storageKey:L(),title:d("tool.runToolWithName",{name:s.name.replace(o+"-","")})}),S&&r.jsx("div",{className:"mt-4",children:r.jsx(jv,{result:S,onClose:$})})]})]})]})},Xg=({isOpen:s,onClose:o,onConfirm:l,serverName:i,isGroup:d=!1,isUser:f=!1})=>{const{t:m}=Ee();return s?r.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white rounded-lg shadow-lg max-w-md w-full",children:r.jsxs("div",{className:"p-6",children:[r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:m(f?"users.confirmDelete":d?"groups.confirmDelete":"server.confirmDelete")}),r.jsx("p",{className:"text-gray-500 mb-6",children:f?m("users.deleteWarning",{username:i}):d?m("groups.deleteWarning",{name:i}):m("server.deleteWarning",{name:i})}),r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx("button",{onClick:o,className:"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary",children:m("common.cancel")}),r.jsx("button",{onClick:l,className:"px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600 btn-danger",children:m("common.delete")})]})]})})}):null},Sv=({server:s,onRemove:o,onEdit:l,onToggle:i,onRefresh:d})=>{var oe;const{t:f}=Ee(),{showToast:m}=Ys(),[p,g]=b.useState(!1),[h,y]=b.useState(!1),[S,w]=b.useState(!1),[A,C]=b.useState(!1),[k,R]=b.useState(!1),N=b.useRef(null);b.useEffect(()=>{const de=z=>{N.current&&!N.current.contains(z.target)&&C(!1)};return document.addEventListener("mousedown",de),()=>{document.removeEventListener("mousedown",de)}},[]);const E=de=>{de.stopPropagation(),y(!0)},U=de=>{de.stopPropagation(),l(s)},X=async de=>{if(de.stopPropagation(),!(S||!i)){w(!0);try{await i(s,s.enabled===!1)}finally{w(!1)}}},L=de=>{de.stopPropagation(),C(!A)},ee=de=>{if(de.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 z=document.createElement("textarea");z.value=s.error,z.style.position="fixed",z.style.left="-9999px",document.body.appendChild(z),z.focus(),z.select();try{document.execCommand("copy"),R(!0),m(f("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>R(!1),2e3)}catch(O){m(f("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",O)}document.body.removeChild(z)}},ae=()=>{o(s.name),y(!1)},K=async(de,z)=>{try{const{toggleTool:O}=await pv(async()=>{const{toggleTool:$}=await Promise.resolve().then(()=>vv);return{toggleTool:$}},[],import.meta.url),J=await O(s.name,de,z);J.success?(m(f(z?"tool.enableSuccess":"tool.disableSuccess",{name:de}),"success"),d&&d()):m(J.error||f("tool.toggleFailed"),"error")}catch(O){console.error("Error toggling tool:",O),m(f("tool.toggleFailed"),"error")}};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`bg-white shadow rounded-lg p-6 mb-6 page-card transition-all duration-200 ${s.enabled===!1?"opacity-60":""}`,children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>g(!p),children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("h2",{className:`text-xl font-semibold ${s.enabled===!1?"text-gray-600":"text-gray-900"}`,children:s.name}),r.jsx(yv,{status:s.status}),r.jsxs("div",{className:"flex items-center px-2 py-1 bg-blue-50 text-blue-700 rounded-full text-sm btn-primary",children:[r.jsx("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"})}),r.jsxs("span",{children:[((oe=s.tools)==null?void 0:oe.length)||0," ",f("server.tools")]})]}),s.error&&r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"cursor-pointer",onClick:L,"aria-label":f("server.viewErrorDetails"),children:r.jsx(Ng,{className:"text-red-500 hover:text-red-600",size:18})}),A&&r.jsxs("div",{ref:N,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:de=>de.stopPropagation(),children:[r.jsxs("div",{className:"flex justify-between items-center sticky top-0 bg-white py-2 px-4 border-b border-gray-200 z-20 shadow-sm",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("h4",{className:"text-sm font-medium text-red-600",children:f("server.errorDetails")}),r.jsx("button",{onClick:ee,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors btn-secondary",title:f("common.copy"),children:k?r.jsx(Ao,{size:14,className:"text-green-500"}):r.jsx(eu,{size:14})})]}),r.jsx("button",{onClick:de=>{de.stopPropagation(),C(!1)},className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),r.jsx("div",{className:"p-4 pt-2",children:r.jsx("pre",{className:"text-sm text-gray-700 break-words whitespace-pre-wrap",children:s.error})})]})]})]}),r.jsxs("div",{className:"flex space-x-2",children:[r.jsx("button",{onClick:U,className:"px-3 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:f("server.edit")}),r.jsx("div",{className:"flex items-center",children:r.jsx("button",{onClick:X,className:`px-3 py-1 text-sm rounded transition-colors ${S?"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:S,children:S?f("common.processing"):s.enabled!==!1?f("server.disable"):f("server.enable")})}),r.jsx("button",{onClick:E,className:"px-3 py-1 bg-red-100 text-red-800 rounded hover:bg-red-200 text-sm btn-danger",children:f("server.delete")}),r.jsx("button",{className:"text-gray-400 hover:text-gray-600 btn-secondary",children:p?r.jsx(wu,{size:18}):r.jsx(jg,{size:18})})]})]}),p&&s.tools&&r.jsxs("div",{className:"mt-6",children:[r.jsx("h6",{className:`font-medium ${s.enabled===!1?"text-gray-600":"text-gray-900"} mb-4`,children:f("server.tools")}),r.jsx("div",{className:"space-y-4",children:s.tools.map((de,z)=>r.jsx(Nv,{server:s.name,tool:de,onToggle:K},z))})]})]}),r.jsx(Xg,{isOpen:h,onClose:()=>y(!1),onConfirm:ae,serverName:s.name})]})},Ro=({onSubmit:s,onCancel:o,initialData:l=null,modalTitle:i,formError:d=null})=>{var F,T,q,Z,re,j,I,le,B,V,me,W,Y,ue,be,je,xe,Te,Be,st,wa,ca,De,bt,ua,da,Gt,fa,gn,Ye,pn,Ot,lt,kt,at,_n,Ka,Bn,zt,ja,vt,Se;const{t:f}=Ee(),m=()=>!l||!l.config?"stdio":l.config.type?l.config.type:l.config.url?"sse":"stdio",[p,g]=b.useState(m()),[h,y]=b.useState({name:l&&l.name||"",url:l&&l.config&&l.config.url||"",command:l&&l.config&&l.config.command||"",arguments:l&&l.config&&l.config.args?Array.isArray(l.config.args)?l.config.args.join(" "):String(l.config.args):"",args:l&&l.config&&l.config.args||[],type:m(),env:[],headers:[],options:{timeout:l&&l.config&&l.config.options&&l.config.options.timeout||6e4,resetTimeoutOnProgress:l&&l.config&&l.config.options&&l.config.options.resetTimeoutOnProgress||!1,maxTotalTimeout:l&&l.config&&l.config.options&&l.config.options.maxTotalTimeout||void 0},openapi:l&&l.config&&l.config.openapi?{url:l.config.openapi.url||"",schema:l.config.openapi.schema?JSON.stringify(l.config.openapi.schema,null,2):"",inputMode:l.config.openapi.url?"url":l.config.openapi.schema?"schema":"url",version:l.config.openapi.version||"3.1.0",securityType:((F=l.config.openapi.security)==null?void 0:F.type)||"none",apiKeyName:((q=(T=l.config.openapi.security)==null?void 0:T.apiKey)==null?void 0:q.name)||"",apiKeyIn:((re=(Z=l.config.openapi.security)==null?void 0:Z.apiKey)==null?void 0:re.in)||"header",apiKeyValue:((I=(j=l.config.openapi.security)==null?void 0:j.apiKey)==null?void 0:I.value)||"",httpScheme:((B=(le=l.config.openapi.security)==null?void 0:le.http)==null?void 0:B.scheme)||"bearer",httpCredentials:((me=(V=l.config.openapi.security)==null?void 0:V.http)==null?void 0:me.credentials)||"",oauth2Token:((Y=(W=l.config.openapi.security)==null?void 0:W.oauth2)==null?void 0:Y.token)||"",openIdConnectUrl:((be=(ue=l.config.openapi.security)==null?void 0:ue.openIdConnect)==null?void 0:be.url)||"",openIdConnectToken:((xe=(je=l.config.openapi.security)==null?void 0:je.openIdConnect)==null?void 0:xe.token)||""}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none"}}),[S,w]=b.useState(l&&l.config&&l.config.env?Object.entries(l.config.env).map(([ie,ce])=>({key:ie,value:ce})):[]),[A,C]=b.useState(l&&l.config&&l.config.headers?Object.entries(l.config.headers).map(([ie,ce])=>({key:ie,value:ce})):[]),[k,R]=b.useState(!1),[N,E]=b.useState(null),U=!!l,X=ie=>{const{name:ce,value:fe}=ie.target;y({...h,[ce]:fe})},L=ie=>{const ce=ie.split(" ").filter(fe=>fe.trim()!=="");y({...h,arguments:ie,args:ce})},ee=ie=>{g(ie),y(ce=>({...ce,type:ie}))},ae=(ie,ce,fe)=>{const dt=[...S];dt[ie][ce]=fe,w(dt)},K=()=>{w([...S,{key:"",value:""}])},oe=ie=>{const ce=[...S];ce.splice(ie,1),w(ce)},de=(ie,ce,fe)=>{const dt=[...A];dt[ie][ce]=fe,C(dt)},z=()=>{C([...A,{key:"",value:""}])},O=ie=>{const ce=[...A];ce.splice(ie,1),C(ce)},J=(ie,ce)=>{y(fe=>({...fe,options:{...fe.options,[ie]:ce}}))},$=async ie=>{var ce,fe,dt;ie.preventDefault(),E(null);try{const aa={};S.forEach(({key:Ut,value:ma})=>{Ut.trim()&&(aa[Ut.trim()]=ma)});const na={};A.forEach(({key:Ut,value:ma})=>{Ut.trim()&&(na[Ut.trim()]=ma)});const xn={};(ce=h.options)!=null&&ce.timeout&&h.options.timeout!==6e4&&(xn.timeout=h.options.timeout),(fe=h.options)!=null&&fe.resetTimeoutOnProgress&&(xn.resetTimeoutOnProgress=h.options.resetTimeoutOnProgress),(dt=h.options)!=null&&dt.maxTotalTimeout&&(xn.maxTotalTimeout=h.options.maxTotalTimeout);const Xs={name:h.name,config:{type:p,...p==="openapi"?{openapi:(()=>{var ma,Hn,_r,Qs,ra,ot;const Ut={version:((ma=h.openapi)==null?void 0:ma.version)||"3.1.0"};if(((Hn=h.openapi)==null?void 0:Hn.inputMode)==="url")Ut.url=((_r=h.openapi)==null?void 0:_r.url)||"";else if(((Qs=h.openapi)==null?void 0:Qs.inputMode)==="schema"&&((ra=h.openapi)!=null&&ra.schema))try{Ut.schema=JSON.parse(h.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(ot=h.openapi)!=null&&ot.securityType&&h.openapi.securityType!=="none"&&(Ut.security={type:h.openapi.securityType,...h.openapi.securityType==="apiKey"&&{apiKey:{name:h.openapi.apiKeyName||"",in:h.openapi.apiKeyIn||"header",value:h.openapi.apiKeyValue||""}},...h.openapi.securityType==="http"&&{http:{scheme:h.openapi.httpScheme||"bearer",credentials:h.openapi.httpCredentials||""}},...h.openapi.securityType==="oauth2"&&{oauth2:{token:h.openapi.oauth2Token||""}},...h.openapi.securityType==="openIdConnect"&&{openIdConnect:{url:h.openapi.openIdConnectUrl||"",token:h.openapi.openIdConnectToken||""}}}),Ut})(),...Object.keys(na).length>0?{headers:na}:{}}:p==="sse"||p==="streamable-http"?{url:h.url,...Object.keys(na).length>0?{headers:na}:{}}:{command:h.command,args:h.args,env:Object.keys(aa).length>0?aa:void 0},...Object.keys(xn).length>0?{options:xn}:{}}};s(Xs)}catch(aa){E(`Error: ${aa instanceof Error?aa.message:String(aa)}`)}};return r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-xl max-h-screen overflow-y-auto",children:[r.jsxs("div",{className:"flex justify-between items-center mb-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:i}),r.jsx("button",{onClick:o,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),(N||d)&&r.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:d||N}),r.jsxs("form",{onSubmit:$,children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:f("server.name")}),r.jsx("input",{type:"text",name:"name",id:"name",value:h.name,onChange:X,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:U})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.type")}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"command",name:"serverType",value:"command",checked:p==="stdio",onChange:()=>ee("stdio"),className:"mr-1"}),r.jsx("label",{htmlFor:"command",children:"STDIO"})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"url",name:"serverType",value:"url",checked:p==="sse",onChange:()=>ee("sse"),className:"mr-1"}),r.jsx("label",{htmlFor:"url",children:"SSE"})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"streamable-http",name:"serverType",value:"streamable-http",checked:p==="streamable-http",onChange:()=>ee("streamable-http"),className:"mr-1"}),r.jsx("label",{htmlFor:"streamable-http",children:"Streamable HTTP"})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"openapi",name:"serverType",value:"openapi",checked:p==="openapi",onChange:()=>ee("openapi"),className:"mr-1"}),r.jsx("label",{htmlFor:"openapi",children:"OpenAPI"})]})]})]}),p==="openapi"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.openapi.inputMode")}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"input-mode-url",name:"inputMode",value:"url",checked:((Te=h.openapi)==null?void 0:Te.inputMode)==="url",onChange:()=>y(ie=>({...ie,openapi:{...ie.openapi,inputMode:"url"}})),className:"mr-1"}),r.jsx("label",{htmlFor:"input-mode-url",children:f("server.openapi.inputModeUrl")})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"input-mode-schema",name:"inputMode",value:"schema",checked:((Be=h.openapi)==null?void 0:Be.inputMode)==="schema",onChange:()=>y(ie=>({...ie,openapi:{...ie.openapi,inputMode:"schema"}})),className:"mr-1"}),r.jsx("label",{htmlFor:"input-mode-schema",children:f("server.openapi.inputModeSchema")})]})]})]}),((st=h.openapi)==null?void 0:st.inputMode)==="url"&&r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-url",children:f("server.openapi.specUrl")}),r.jsx("input",{type:"url",name:"openapi-url",id:"openapi-url",value:((wa=h.openapi)==null?void 0:wa.url)||"",onChange:ie=>y(ce=>({...ce,openapi:{...ce.openapi,url:ie.target.value}})),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: https://api.example.com/openapi.json",required:p==="openapi"&&((ca=h.openapi)==null?void 0:ca.inputMode)==="url"})]}),((De=h.openapi)==null?void 0:De.inputMode)==="schema"&&r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-schema",children:f("server.openapi.schema")}),r.jsx("textarea",{name:"openapi-schema",id:"openapi-schema",rows:10,value:((bt=h.openapi)==null?void 0:bt.schema)||"",onChange:ie=>y(ce=>({...ce,openapi:{...ce.openapi,schema:ie.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"&&((ua=h.openapi)==null?void 0:ua.inputMode)==="schema"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.openapi.schemaHelp")})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:f("server.openapi.security")}),r.jsxs("select",{value:((da=h.openapi)==null?void 0:da.securityType)||"none",onChange:ie=>y(ce=>{var fe;return{...ce,openapi:{...ce.openapi,securityType:ie.target.value,url:((fe=ce.openapi)==null?void 0:fe.url)||""}}}),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",children:[r.jsx("option",{value:"none",children:f("server.openapi.securityNone")}),r.jsx("option",{value:"apiKey",children:f("server.openapi.securityApiKey")}),r.jsx("option",{value:"http",children:f("server.openapi.securityHttp")}),r.jsx("option",{value:"oauth2",children:f("server.openapi.securityOAuth2")}),r.jsx("option",{value:"openIdConnect",children:f("server.openapi.securityOpenIdConnect")})]})]}),((Gt=h.openapi)==null?void 0:Gt.securityType)==="apiKey"&&r.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.apiKeyConfig")}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyName")}),r.jsx("input",{type:"text",value:((fa=h.openapi)==null?void 0:fa.apiKeyName)||"",onChange:ie=>y(ce=>{var fe;return{...ce,openapi:{...ce.openapi,apiKeyName:ie.target.value,url:((fe=ce.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm form-input focus:outline-none",placeholder:"Authorization"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyIn")}),r.jsxs("select",{value:((gn=h.openapi)==null?void 0:gn.apiKeyIn)||"header",onChange:ie=>y(ce=>{var fe;return{...ce,openapi:{...ce.openapi,apiKeyIn:ie.target.value,url:((fe=ce.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[r.jsx("option",{value:"header",children:"Header"}),r.jsx("option",{value:"query",children:"Query"}),r.jsx("option",{value:"cookie",children:"Cookie"})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.apiKeyValue")}),r.jsx("input",{type:"password",value:((Ye=h.openapi)==null?void 0:Ye.apiKeyValue)||"",onChange:ie=>y(ce=>{var fe;return{...ce,openapi:{...ce.openapi,apiKeyValue:ie.target.value,url:((fe=ce.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"your-api-key"})]})]})]}),((pn=h.openapi)==null?void 0:pn.securityType)==="http"&&r.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.httpAuthConfig")}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.httpScheme")}),r.jsxs("select",{value:((Ot=h.openapi)==null?void 0:Ot.httpScheme)||"bearer",onChange:ie=>y(ce=>{var fe;return{...ce,openapi:{...ce.openapi,httpScheme:ie.target.value,url:((fe=ce.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[r.jsx("option",{value:"basic",children:"Basic"}),r.jsx("option",{value:"bearer",children:"Bearer"}),r.jsx("option",{value:"digest",children:"Digest"})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.httpCredentials")}),r.jsx("input",{type:"password",value:((lt=h.openapi)==null?void 0:lt.httpCredentials)||"",onChange:ie=>y(ce=>{var fe;return{...ce,openapi:{...ce.openapi,httpCredentials:ie.target.value,url:((fe=ce.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:((kt=h.openapi)==null?void 0:kt.httpScheme)==="basic"?"base64-encoded-credentials":"bearer-token"})]})]})]}),((at=h.openapi)==null?void 0:at.securityType)==="oauth2"&&r.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.oauth2Config")}),r.jsx("div",{className:"grid grid-cols-1 gap-3",children:r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.oauth2Token")}),r.jsx("input",{type:"password",value:((_n=h.openapi)==null?void 0:_n.oauth2Token)||"",onChange:ie=>y(ce=>{var fe;return{...ce,openapi:{...ce.openapi,oauth2Token:ie.target.value,url:((fe=ce.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"access-token"})]})})]}),((Ka=h.openapi)==null?void 0:Ka.securityType)==="openIdConnect"&&r.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:f("server.openapi.openIdConnectConfig")}),r.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.openIdConnectUrl")}),r.jsx("input",{type:"url",value:((Bn=h.openapi)==null?void 0:Bn.openIdConnectUrl)||"",onChange:ie=>y(ce=>{var fe;return{...ce,openapi:{...ce.openapi,openIdConnectUrl:ie.target.value,url:((fe=ce.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"https://example.com/.well-known/openid_configuration"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:f("server.openapi.openIdConnectToken")}),r.jsx("input",{type:"password",value:((zt=h.openapi)==null?void 0:zt.openIdConnectToken)||"",onChange:ie=>y(ce=>{var fe;return{...ce,openapi:{...ce.openapi,openIdConnectToken:ie.target.value,url:((fe=ce.openapi)==null?void 0:fe.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"id-token"})]})]})]}),r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.headers")}),r.jsx("button",{type:"button",onClick:z,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),A.map((ie,ce)=>r.jsxs("div",{className:"flex items-center mb-2",children:[r.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[r.jsx("input",{type:"text",value:ie.key,onChange:fe=>de(ce,"key",fe.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:"Authorization"}),r.jsx("span",{className:"flex items-center",children:":"}),r.jsx("input",{type:"text",value:ie.value,onChange:fe=>de(ce,"value",fe.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:"Bearer token..."})]}),r.jsx("button",{type:"button",onClick:()=>O(ce),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:"-"})]},ce))]})]}):p==="sse"||p==="streamable-http"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"url",children:f("server.url")}),r.jsx("input",{type:"url",name:"url",id:"url",value:h.url,onChange:X,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:p==="streamable-http"?"e.g.: http://localhost:3000/mcp":"e.g.: http://localhost:3000/sse",required:p==="sse"||p==="streamable-http"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.headers")}),r.jsx("button",{type:"button",onClick:z,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),A.map((ie,ce)=>r.jsxs("div",{className:"flex items-center mb-2",children:[r.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[r.jsx("input",{type:"text",value:ie.key,onChange:fe=>de(ce,"key",fe.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:"Authorization"}),r.jsx("span",{className:"flex items-center",children:":"}),r.jsx("input",{type:"text",value:ie.value,onChange:fe=>de(ce,"value",fe.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:"Bearer token..."})]}),r.jsx("button",{type:"button",onClick:()=>O(ce),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:"-"})]},ce))]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"command",children:f("server.command")}),r.jsx("input",{type:"text",name:"command",id:"command",value:h.command,onChange:X,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: npx",required:p==="stdio"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"arguments",children:f("server.arguments")}),r.jsx("input",{type:"text",name:"arguments",id:"arguments",value:h.arguments,onChange:ie=>L(ie.target.value),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: -y time-mcp",required:p==="stdio"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:f("server.envVars")}),r.jsx("button",{type:"button",onClick:K,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),S.map((ie,ce)=>r.jsxs("div",{className:"flex items-center mb-2",children:[r.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[r.jsx("input",{type:"text",value:ie.key,onChange:fe=>ae(ce,"key",fe.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:f("server.key")}),r.jsx("span",{className:"flex items-center",children:":"}),r.jsx("input",{type:"text",value:ie.value,onChange:fe=>ae(ce,"value",fe.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:f("server.value")})]}),r.jsx("button",{type:"button",onClick:()=>oe(ce),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:"-"})]},ce))]})]}),p!=="openapi"&&r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex items-center justify-between cursor-pointer bg-gray-50 hover:bg-gray-100 p-3 rounded border border-gray-200",onClick:()=>R(!k),children:[r.jsx("label",{className:"text-gray-700 text-sm font-bold",children:f("server.requestOptions")}),r.jsx("span",{className:"text-gray-500 text-sm",children:k?"▼":"▶"})]}),k&&r.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"timeout",children:f("server.timeout")}),r.jsx("input",{type:"number",id:"timeout",value:((ja=h.options)==null?void 0:ja.timeout)||6e4,onChange:ie=>J("timeout",parseInt(ie.target.value)||6e4),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"30000",min:"1000",max:"300000"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.timeoutDescription")})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"maxTotalTimeout",children:f("server.maxTotalTimeout")}),r.jsx("input",{type:"number",id:"maxTotalTimeout",value:((vt=h.options)==null?void 0:vt.maxTotalTimeout)||"",onChange:ie=>J("maxTotalTimeout",ie.target.value?parseInt(ie.target.value):void 0),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"Optional",min:"1000"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:f("server.maxTotalTimeoutDescription")})]})]}),r.jsxs("div",{className:"mt-3",children:[r.jsxs("label",{className:"flex items-center",children:[r.jsx("input",{type:"checkbox",checked:((Se=h.options)==null?void 0:Se.resetTimeoutOnProgress)||!1,onChange:ie=>J("resetTimeoutOnProgress",ie.target.checked),className:"mr-2"}),r.jsx("span",{className:"text-gray-600 text-sm",children:f("server.resetTimeoutOnProgress")})]}),r.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:f("server.resetTimeoutOnProgressDescription")})]})]})]}),r.jsxs("div",{className:"flex justify-end mt-6",children:[r.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")}),r.jsx("button",{type:"submit",className:"bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded btn-primary",children:f(U?"server.save":"server.add")})]})]})]})},Qg=s=>{const o=new Set,l=/\$\{([^}]+)\}/g,i=f=>{let m;for(;(m=l.exec(f))!==null;)o.add(m[1])},d=(f,m="")=>{typeof f=="string"?i(f):Array.isArray(f)?f.forEach((p,g)=>d(p,`${m}[${g}]`)):f&&typeof f=="object"&&Object.entries(f).forEach(([p,g])=>{d(g,m?`${m}.${p}`:p)})};return d(s),Array.from(o)},Cv=({onAdd:s})=>{const{t:o}=Ee(),[l,i]=b.useState(!1),[d,f]=b.useState(null),[m,p]=b.useState(!1),[g,h]=b.useState(null),[y,S]=b.useState([]),w=()=>{i(!l),f(null),p(!1),h(null)},A=async()=>{g&&(await C(g),p(!1),h(null))},C=async R=>{try{f(null);const N=await Vt("/servers",R);if(!N.success){N&&N.message?f(N.message):f(o("server.addError"));return}i(!1),s()}catch(N){console.error("Error adding server:",N),navigator.onLine?N instanceof TypeError&&(N.message.includes("NetworkError")||N.message.includes("Failed to fetch"))?f(o("errors.serverConnection")):f(o("errors.serverAdd")):f(o("errors.network"))}},k=async R=>{try{const N=Qg(R);N.length>0?(S(N),h(R),p(!0)):await C(R)}catch(N){console.error("Error processing server submission:",N),f(o("errors.serverAdd"))}};return r.jsxs("div",{children:[r.jsxs("button",{onClick:w,className:"w-full bg-blue-100 text-blue-800 rounded hover:bg-blue-200 py-2 px-4 flex items-center justify-center btn-primary",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"})}),o("server.add")]}),l&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Ro,{onSubmit:k,onCancel:w,modalTitle:o("server.addServer"),formError:d})}),m&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[r.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:o("server.confirmVariables")}),r.jsx("p",{className:"text-gray-600 mb-4",children:o("server.variablesDetected")}),r.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),r.jsxs("div",{className:"ml-3",children:[r.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[o("server.detectedVariables"),":"]}),r.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:y.map((R,N)=>r.jsxs("li",{className:"font-mono",children:["$",`{${R}}`]},N))})]})]})}),r.jsx("p",{className:"text-gray-600 text-sm mb-6",children:o("server.confirmVariablesMessage")}),r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx("button",{onClick:()=>{p(!1),h(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:o("common.cancel")}),r.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")})]})]})})]})},Ev=({server:s,onEdit:o,onCancel:l})=>{const{t:i}=Ee(),[d,f]=b.useState(null),m=async p=>{try{f(null);const g=await Wt(`/servers/${s.name}`,p);if(!g.success){g&&g.message?f(g.message):f(i("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(i("errors.serverConnection")):f(i("errors.serverUpdate",{serverName:s.name})):f(i("errors.network"))}};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Ro,{onSubmit:m,onCancel:l,initialData:s,modalTitle:i("server.editTitle",{serverName:s.name}),formError:d})})},kv=({isOpen:s,onClose:o,onConfirm:l,title:i,message:d,confirmText:f,cancelText:m,variant:p="warning"})=>{const{t:g}=Ee();if(!s)return null;const h=()=>{switch(p){case"danger":return{icon:r.jsx("svg",{className:"w-6 h-6 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),confirmClass:"bg-red-600 hover:bg-red-700 text-white"};case"warning":return{icon:r.jsx("svg",{className:"w-6 h-6 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),confirmClass:"bg-yellow-600 hover:bg-yellow-700 text-white"};case"info":return{icon:r.jsx("svg",{className:"w-6 h-6 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),confirmClass:"bg-blue-600 hover:bg-blue-700 text-white"};default:return{icon:null,confirmClass:"bg-blue-600 hover:bg-blue-700 text-white"}}},{icon:y,confirmClass:S}=h(),w=C=>{C.target===C.currentTarget&&o()},A=C=>{C.key==="Escape"?o():C.key==="Enter"&&l()};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:w,onKeyDown:A,tabIndex:-1,children:r.jsx("div",{className:"bg-white rounded-lg shadow-xl max-w-md w-full transform transition-all duration-200 ease-out",role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-message",children:r.jsxs("div",{className:"p-6",children:[r.jsxs("div",{className:"flex items-start space-x-3",children:[y&&r.jsx("div",{className:"flex-shrink-0",children:y}),r.jsxs("div",{className:"flex-1",children:[i&&r.jsx("h3",{id:"confirm-dialog-title",className:"text-lg font-medium text-gray-900 mb-2",children:i}),r.jsx("p",{id:"confirm-dialog-message",className:"text-gray-600 leading-relaxed",children:d})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.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")}),r.jsx("button",{onClick:l,className:`px-4 py-2 rounded-md transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-offset-2 ${S} ${p==="danger"?"btn-danger":p==="warning"?"btn-warning":"btn-primary"}`,children:f||g("common.confirm")})]})]})})})},Tv=({onSuccess:s,onCancel:o})=>{const{t:l}=Ee(),[i,d]=b.useState(!1),[f,m]=b.useState(!1),[p,g]=b.useState(null),[h,y]=b.useState(null),[S,w]=b.useState(!1),[A,C]=b.useState(null),[k,R]=b.useState(""),[N,E]=b.useState(!1),[U,X]=b.useState(""),L=$=>{$.preventDefault(),d(!0)},ee=$=>{$.preventDefault(),d(!1)},ae=$=>{$.preventDefault(),d(!1);const F=$.dataTransfer.files;if(F.length>0){const T=F[0];T.name.endsWith(".dxt")?(y(T),g(null)):g(l("dxt.invalidFileType"))}},K=$=>{const F=$.target.files;if(F&&F.length>0){const T=F[0];T.name.endsWith(".dxt")?(y(T),g(null)):g(l("dxt.invalidFileType"))}},oe=async()=>{if(!h){g(l("dxt.noFileSelected"));return}m(!0),g(null);try{const $=new FormData;$.append("dxtFile",h);const F=await bu(yu("/dxt/upload"),{method:"POST",body:$}),T=await F.json();if(!F.ok)throw new Error(T.message||`HTTP error! Status: ${F.status}`);if(T.success&&T.data)C(T.data.manifest),R(T.data.extractDir),w(!0);else throw new Error(T.message||l("dxt.uploadFailed"))}catch($){console.error("DXT upload error:",$),g($ instanceof Error?$.message:l("dxt.uploadFailed"))}finally{m(!1)}},de=async($,F=!1)=>{var T;m(!0),g(null);try{const q=J(A,k,$);if(!F){const re=await Xe("/servers");if(re.success&&((T=re.data)==null?void 0:T.find(I=>I.name===$))){X($),E(!0),m(!1);return}}let Z;if(F?Z=await Wt(`/servers/${encodeURIComponent($)}`,{name:$,config:q}):Z=await Vt("/servers",{name:$,config:q}),Z.success)s(q);else throw new Error(Z.message||l("dxt.installFailed"))}catch(q){console.error("DXT install error:",q),g(q instanceof Error?q.message:l("dxt.installFailed")),m(!1)}},z=()=>{E(!1),U&&de(U,!0)},O=()=>{E(!1),X(""),m(!1)},J=($,F,T)=>{var re;const q=((re=$.server)==null?void 0:re.mcp_config)||{},Z={type:"stdio",command:q.command||"node",args:(q.args||[]).map(j=>j.replace("${__dirname}",F))};return q.env&&Object.keys(q.env).length>0&&(Z.env={...q.env},Object.keys(Z.env).forEach(j=>{typeof Z.env[j]=="string"&&(Z.env[j]=Z.env[j].replace("${__dirname}",F))})),Z};return S&&A?r.jsxs(r.Fragment,{children:[r.jsx(kv,{isOpen:N,onClose:O,onConfirm:z,title:l("dxt.serverExistsTitle"),message:l("dxt.serverExistsConfirm",{serverName:U}),confirmText:l("dxt.override"),cancelText:l("common.cancel"),variant:"warning"}),r.jsx("div",{className:`fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4 ${N?"opacity-50 pointer-events-none":""}`,children:r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-2xl max-h-screen overflow-y-auto",children:[r.jsxs("div",{className:"flex justify-between items-center mb-6",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("dxt.installServer")}),r.jsx("button",{onClick:o,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),p&&r.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:r.jsx("p",{className:"text-red-700",children:p})}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[r.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:l("dxt.extensionInfo")}),r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs("div",{children:[r.jsxs("strong",{children:[l("dxt.name"),":"]})," ",A.display_name||A.name]}),r.jsxs("div",{children:[r.jsxs("strong",{children:[l("dxt.version"),":"]})," ",A.version]}),r.jsxs("div",{children:[r.jsxs("strong",{children:[l("dxt.description"),":"]})," ",A.description]}),A.author&&r.jsxs("div",{children:[r.jsxs("strong",{children:[l("dxt.author"),":"]})," ",A.author.name]}),A.tools&&A.tools.length>0&&r.jsxs("div",{children:[r.jsxs("strong",{children:[l("dxt.tools"),":"]}),r.jsx("ul",{className:"list-disc list-inside ml-4",children:A.tools.map(($,F)=>r.jsxs("li",{children:[$.name," - ",$.description]},F))})]})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:l("dxt.serverName")}),r.jsx("input",{type:"text",id:"serverName",defaultValue:A.name,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",placeholder:l("dxt.serverNamePlaceholder")})]}),r.jsxs("div",{className:"flex justify-end space-x-4",children:[r.jsx("button",{onClick:o,disabled:f,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:l("common.cancel")}),r.jsx("button",{onClick:()=>{const $=document.getElementById("serverName"),F=($==null?void 0:$.value.trim())||A.name;de(F)},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?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("dxt.installing")]}):l("dxt.install")})]})]})]})})]}):r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-lg",children:[r.jsxs("div",{className:"flex justify-between items-center mb-6",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("dxt.uploadTitle")}),r.jsx("button",{onClick:o,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),p&&r.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:r.jsx("p",{className:"text-red-700",children:p})}),r.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-8 text-center transition-colors ${i?"border-blue-500 bg-blue-50":h?"border-gray-500 ":"border-gray-300 hover:border-gray-400"}`,onDragOver:L,onDragLeave:ee,onDrop:ae,children:[h?r.jsxs("div",{className:"space-y-2",children:[r.jsx("svg",{className:"mx-auto h-12 w-12 text-green-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),r.jsx("p",{className:"text-sm text-gray-900 font-medium",children:h.name}),r.jsxs("p",{className:"text-xs text-gray-500",children:[(h.size/1024/1024).toFixed(2)," MB"]})]}):r.jsxs("div",{className:"space-y-2",children:[r.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-gray-900",children:l("dxt.dropFileHere")}),r.jsx("p",{className:"text-xs text-gray-500",children:l("dxt.orClickToSelect")})]})]}),r.jsx("input",{type:"file",accept:".dxt",onChange:K,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"})]}),r.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[r.jsx("button",{onClick:o,disabled:f,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:l("common.cancel")}),r.jsx("button",{onClick:oe,disabled:!h||f,className:"px-4 py-2 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:f?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("dxt.uploading")]}):l("dxt.upload")})]})]})})},Av=()=>{const{t:s}=Ee(),o=Ga(),{servers:l,error:i,setError:d,isLoading:f,handleServerAdd:m,handleServerEdit:p,handleServerRemove:g,handleServerToggle:h,triggerRefresh:y}=Fs(),[S,w]=b.useState(null),[A,C]=b.useState(!1),[k,R]=b.useState(!1),N=async L=>{const ee=await p(L);ee&&w(ee)},E=()=>{w(null),y()},U=async()=>{C(!0);try{y(),await new Promise(L=>setTimeout(L,500))}finally{C(!1)}},X=L=>{R(!1),y()};return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-8",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.servers.title")}),r.jsxs("div",{className:"flex space-x-4",children:[r.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:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3z"})}),s("nav.market")]}),r.jsx(Cv,{onAdd:m}),r.jsxs("button",{onClick:()=>R(!0),className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M5.5 13a3.5 3.5 0 01-.369-6.98 4 4 0 117.753-1.977A4.5 4.5 0 1113.5 13H11V9.413l1.293 1.293a1 1 0 001.414-1.414l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.413V13H5.5z"})}),s("dxt.upload")]}),r.jsxs("button",{onClick:U,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?r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"})}),s("common.refresh")]})]})]}),i&&r.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{children:r.jsx("p",{className:"text-gray-600 mt-1",children:i})}),r.jsx("button",{onClick:()=>d(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200 btn-secondary","aria-label":s("app.closeButton"),children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 111.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z",clipRule:"evenodd"})})})]})}),f?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):l.length===0?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:r.jsx("p",{className:"text-gray-600",children:s("app.noServers")})}):r.jsx("div",{className:"space-y-6",children:l.map((L,ee)=>r.jsx(Sv,{server:L,onRemove:g,onEdit:N,onToggle:h,onRefresh:y},ee))}),S&&r.jsx(Ev,{server:S,onEdit:E,onCancel:()=>w(null)}),k&&r.jsx(Tv,{onSuccess:X,onCancel:()=>R(!1)})]})},Nu=()=>{const{t:s}=Ee(),[o,l]=b.useState([]),[i,d]=b.useState(!0),[f,m]=b.useState(null),[p,g]=b.useState(0),h=b.useCallback(async()=>{try{d(!0);const N=await Xe("/groups");N&&N.success&&Array.isArray(N.data)?l(N.data):(console.error("Invalid group data format:",N),l([])),m(null)}catch(N){console.error("Error fetching groups:",N),m(N instanceof Error?N.message:"Failed to fetch groups"),l([])}finally{d(!1)}},[]),y=b.useCallback(()=>{g(N=>N+1)},[]),S=async(N,E,U=[])=>{try{const X=await Vt("/groups",{name:N,description:E,servers:U});return console.log("Group created successfully:",X),!X||!X.success?(m((X==null?void 0:X.message)||s("groups.createError")),X):(y(),X||null)}catch(X){return m(X instanceof Error?X.message:"Failed to create group"),null}},w=async(N,E)=>{try{const U=await Wt(`/groups/${N}`,E);return!U||!U.success?(m((U==null?void 0:U.message)||s("groups.updateError")),U):(y(),U||null)}catch(U){return m(U instanceof Error?U.message:"Failed to update group"),null}},A=async(N,E)=>{try{const U=await Wt(`/groups/${N}/servers/batch`,{servers:E});return!U||!U.success?(m((U==null?void 0:U.message)||s("groups.updateError")),null):(y(),U.data||null)}catch(U){return m(U instanceof Error?U.message:"Failed to update group servers"),null}},C=async N=>{try{const E=await vo(`/groups/${N}`);return!E||!E.success?(m((E==null?void 0:E.message)||s("groups.deleteError")),E):(y(),E)}catch(E){return m(E instanceof Error?E.message:"Failed to delete group"),null}},k=async(N,E)=>{try{const U=await Vt(`/groups/${N}/servers`,{serverName:E});return!U||!U.success?(m((U==null?void 0:U.message)||s("groups.serverAddError")),null):(y(),U.data||null)}catch(U){return m(U instanceof Error?U.message:"Failed to add server to group"),null}},R=async(N,E)=>{try{const U=await vo(`/groups/${N}/servers/${E}`);return!U||!U.success?(m((U==null?void 0:U.message)||s("groups.serverRemoveError")),null):(y(),U.data||null)}catch(U){return m(U instanceof Error?U.message:"Failed to remove server from group"),null}};return b.useEffect(()=>{h()},[h,p]),{groups:o,loading:i,error:f,setError:m,triggerRefresh:y,createGroup:S,updateGroup:w,updateGroupServers:A,deleteGroup:C,addServerToGroup:k,removeServerFromGroup:R}},Zg=({servers:s,value:o,onChange:l,className:i})=>{const{t:d}=Ee(),[f,m]=b.useState(new Set),p=Mr.useMemo(()=>o.map(N=>typeof N=="string"?{name:N,tools:"all"}:{...N,tools:N.tools||"all"}),[o]),g=Mr.useMemo(()=>s.filter(N=>N.enabled!==!1),[s]);Mr.useEffect(()=>{const N=new Set(p.map(U=>U.name)),E=new Set(g.map(U=>U.name));m(U=>{const X=new Set;return U.forEach(L=>{(N.has(L)||E.has(L))&&X.add(L)}),X})},[p,g]);const h=N=>{if(p.findIndex(U=>U.name===N)>=0){const U=p.filter(X=>X.name!==N);l(U)}else{const U=[...p,{name:N,tools:"all"}];l(U)}},y=N=>{m(E=>{const U=new Set(E);return U.has(N)?U.delete(N):U.add(N),U})},S=(N,E,U=!1)=>{if(Array.isArray(E)&&E.length===0){const X=p.filter(L=>L.name!==N);l(X),U||m(L=>{const ee=new Set(L);return ee.delete(N),ee})}else if(p.findIndex(L=>L.name===N)>=0){const L=p.map(ee=>ee.name===N?{...ee,tools:E}:ee);l(L)}else{const L=[...p,{name:N,tools:E}];l(L)}},w=(N,E)=>{var ee;const U=g.find(ae=>ae.name===N);if(!U)return;const X=((ee=U.tools)==null?void 0:ee.map(ae=>ae.name.replace(`${N}-`,"")))||[],L=p.find(ae=>ae.name===N);if(!L){const ae=[...p,{name:N,tools:[E]}];l(ae);return}if(L.tools==="all"){const ae=X.filter(K=>K!==E);S(N,ae)}else if(Array.isArray(L.tools)){const ae=L.tools;if(ae.includes(E)){const K=ae.filter(oe=>oe!==E);S(N,K)}else{const K=[...ae,E];K.length===X.length?S(N,"all"):S(N,K)}}},A=N=>{const E=p.find(U=>U.name===N);return E?E.tools==="all":!1},C=N=>{const E=p.find(U=>U.name===N);return E?Array.isArray(E.tools)&&E.tools.length>0:!1},k=(N,E)=>{const U=p.find(X=>X.name===N);return U?U.tools==="all"?!0:Array.isArray(U.tools)?U.tools.includes(E):!1:!1},R=N=>{const E=g.find(U=>U.name===N);return(E==null?void 0:E.tools)||[]};return r.jsxs("div",{className:qa("space-y-4",i),children:[r.jsx("div",{className:"space-y-3",children:g.map(N=>{const E=A(N.name),U=C(N.name),X=f.has(N.name),L=R(N.name),ee=p.find(ae=>ae.name===N.name);return r.jsxs("div",{className:"border border-gray-200 rounded-lg hover:border-gray-300 hover:bg-gray-50 transition-colors",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer rounded-lg transition-colors",onClick:()=>y(N.name),children:[r.jsxs("div",{className:"flex items-center space-x-3",onClick:ae=>{ae.stopPropagation(),h(N.name)},children:[r.jsx("input",{type:"checkbox",checked:E||U,onChange:()=>h(N.name),className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),r.jsx("span",{className:"font-medium text-gray-900 cursor-pointer select-none",children:N.name})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[ee&&ee.tools!=="all"&&Array.isArray(ee.tools)&&r.jsxs("span",{className:"text-sm text-green-600",children:["(",d("groups.toolsSelected")," ",ee.tools.length,"/",L.length,")"]}),ee&&ee.tools==="all"&&r.jsxs("span",{className:"text-sm text-green-600",children:["(",d("groups.allTools")," ",L.length,"/",L.length,")"]}),L.length>0&&r.jsx("button",{type:"button",className:"p-1 text-gray-400 hover:text-gray-600 transition-colors",children:r.jsx("svg",{className:qa("w-5 h-5 transition-transform",X&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),X&&L.length>0&&r.jsxs("div",{className:"border-t border-gray-200 bg-gray-50 p-3",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("span",{className:"text-sm font-medium text-gray-700",children:d("groups.toolSelection")}),r.jsx("button",{type:"button",onClick:()=>{(ee==null?void 0:ee.tools)==="all"||Array.isArray(ee==null?void 0:ee.tools)&&ee.tools.length===L.length?S(N.name,[],!0):S(N.name,"all")},className:"text-sm text-blue-600 hover:text-blue-800 transition-colors",children:(ee==null?void 0:ee.tools)==="all"||Array.isArray(ee==null?void 0:ee.tools)&&ee.tools.length===L.length?d("groups.selectNone"):d("groups.selectAll")})]}),r.jsx("div",{className:"grid grid-cols-1 gap-2 max-h-32 overflow-y-auto",children:L.map(ae=>{const K=ae.name.replace(`${N.name}-`,""),oe=k(N.name,K);return r.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[r.jsx("input",{type:"checkbox",checked:oe,onChange:()=>w(N.name,K),className:"w-3 h-3 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),r.jsx("span",{className:"text-gray-700",children:K}),ae.description&&r.jsx("span",{className:"text-gray-400 text-xs truncate",children:ae.description})]},ae.name)})})]})]},N.name)})}),g.length===0&&r.jsx("p",{className:"text-gray-500 text-sm",children:d("groups.noServerOptions")})]})},Rv=({onAdd:s,onCancel:o})=>{const{t:l}=Ee(),{createGroup:i}=Nu(),{servers:d}=Fs(),[f,m]=b.useState([]),[p,g]=b.useState(null),[h,y]=b.useState(!1),[S,w]=b.useState({name:"",description:"",servers:[]});b.useEffect(()=>{m(d.filter(k=>k.enabled!==!1))},[d]);const A=k=>{const{name:R,value:N}=k.target;w(E=>({...E,[R]:N}))},C=async k=>{k.preventDefault(),y(!0),g(null);try{if(!S.name.trim()){g(l("groups.nameRequired")),y(!1);return}const R=await i(S.name,S.description,S.servers);if(!R||!R.success){g((R==null?void 0:R.message)||l("groups.createError")),y(!1);return}s()}catch(R){g(R instanceof Error?R.message:String(R)),y(!1)}};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full max-h-[90vh] flex flex-col",children:[r.jsxs("div",{className:"p-6 flex-shrink-0",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:l("groups.addNew")}),p&&r.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:p})]}),r.jsxs("form",{onSubmit:C,className:"flex flex-col flex-1 min-h-0",children:[r.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[l("groups.name")," *"]}),r.jsx("input",{type:"text",id:"name",name:"name",value:S.name,onChange:A,className:"w-full border border-gray-300 rounded-md px-3 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:l("groups.namePlaceholder"),required:!0})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:l("groups.configureTools")}),r.jsx(Zg,{servers:f,value:S.servers,onChange:k=>w(R=>({...R,servers:k})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[r.jsx("button",{type:"button",onClick:o,className:"px-4 py-2 text-gray-600 hover:text-gray-800 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors",disabled:h,children:l("common.cancel")}),r.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 transition-colors",disabled:h,children:l(h?"common.submitting":"common.create")})]})]})]})})},Mv=({group:s,onEdit:o,onCancel:l})=>{const{t:i}=Ee(),{updateGroup:d}=Nu(),{servers:f}=Fs(),[m,p]=b.useState([]),[g,h]=b.useState(null),[y,S]=b.useState(!1),[w,A]=b.useState({name:s.name,description:s.description||"",servers:s.servers||[]});b.useEffect(()=>{p(f.filter(R=>R.enabled!==!1))},[f]);const C=R=>{const{name:N,value:E}=R.target;A(U=>({...U,[N]:E}))},k=async R=>{R.preventDefault(),S(!0),h(null);try{if(!w.name.trim()){h(i("groups.nameRequired")),S(!1);return}const N=await d(s.id,{name:w.name,description:w.description,servers:w.servers});if(!N||!N.success){h((N==null?void 0:N.message)||i("groups.updateError")),S(!1);return}o()}catch(N){h(N instanceof Error?N.message:String(N)),S(!1)}};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full max-h-[90vh] flex flex-col",children:[r.jsxs("div",{className:"p-6 flex-shrink-0",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:i("groups.edit")}),g&&r.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:g})]}),r.jsxs("form",{onSubmit:k,className:"flex flex-col flex-1 min-h-0",children:[r.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[i("groups.name")," *"]}),r.jsx("input",{type:"text",id:"name",name:"name",value:w.name,onChange:C,className:"w-full border border-gray-300 rounded-md px-3 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:i("groups.namePlaceholder"),required:!0})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:i("groups.configureTools")}),r.jsx(Zg,{servers:m,value:w.servers,onChange:R=>A(N=>({...N,servers:R})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 text-gray-600 hover:text-gray-800 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors",disabled:y,children:i("common.cancel")}),r.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 transition-colors",disabled:y,children:i(y?"common.submitting":"common.save")})]})]})]})})},Su=()=>{const{t:s}=Ee(),{showToast:o}=Ys(),[l,i]=b.useState({enableGlobalRoute:!0,enableGroupNameRoute:!0,enableBearerAuth:!1,bearerAuthKey:"",skipAuth:!1}),[d,f]=b.useState({bearerAuthKey:""}),[m,p]=b.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[g,h]=b.useState({enabled:!1,dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[y,S]=b.useState({apiKey:"",referer:"https://mcphub.app",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),[w,A]=b.useState(!1),[C,k]=b.useState(null),[R,N]=b.useState(0),E=b.useCallback(()=>{N(z=>z+1)},[]),U=b.useCallback(async()=>{var z,O,J,$,F,T,q,Z;A(!0),k(null);try{const re=await Xe("/settings");re.success&&((O=(z=re.data)==null?void 0:z.systemConfig)!=null&&O.routing)&&i({enableGlobalRoute:re.data.systemConfig.routing.enableGlobalRoute??!0,enableGroupNameRoute:re.data.systemConfig.routing.enableGroupNameRoute??!0,enableBearerAuth:re.data.systemConfig.routing.enableBearerAuth??!1,bearerAuthKey:re.data.systemConfig.routing.bearerAuthKey||"",skipAuth:re.data.systemConfig.routing.skipAuth??!1}),re.success&&(($=(J=re.data)==null?void 0:J.systemConfig)!=null&&$.install)&&p({pythonIndexUrl:re.data.systemConfig.install.pythonIndexUrl||"",npmRegistry:re.data.systemConfig.install.npmRegistry||"",baseUrl:re.data.systemConfig.install.baseUrl||"http://localhost:3000"}),re.success&&((T=(F=re.data)==null?void 0:F.systemConfig)!=null&&T.smartRouting)&&h({enabled:re.data.systemConfig.smartRouting.enabled??!1,dbUrl:re.data.systemConfig.smartRouting.dbUrl||"",openaiApiBaseUrl:re.data.systemConfig.smartRouting.openaiApiBaseUrl||"",openaiApiKey:re.data.systemConfig.smartRouting.openaiApiKey||"",openaiApiEmbeddingModel:re.data.systemConfig.smartRouting.openaiApiEmbeddingModel||""}),re.success&&((Z=(q=re.data)==null?void 0:q.systemConfig)!=null&&Z.mcpRouter)&&S({apiKey:re.data.systemConfig.mcpRouter.apiKey||"",referer:re.data.systemConfig.mcpRouter.referer||"https://mcphub.app",title:re.data.systemConfig.mcpRouter.title||"MCPHub",baseUrl:re.data.systemConfig.mcpRouter.baseUrl||"https://api.mcprouter.to/v1"})}catch(re){console.error("Failed to fetch settings:",re),k(re instanceof Error?re.message:"Failed to fetch settings"),o(s("errors.failedToFetchSettings"))}finally{A(!1)}},[s]),X=async(z,O)=>{A(!0),k(null);try{const J=await Wt("/system-config",{routing:{[z]:O}});return J.success?(i({...l,[z]:O}),o(s("settings.systemConfigUpdated")),!0):(o(J.message||s("errors.failedToUpdateRouteConfig")),!1)}catch(J){return console.error("Failed to update routing config:",J),k(J instanceof Error?J.message:"Failed to update routing config"),o(s("errors.failedToUpdateRouteConfig")),!1}finally{A(!1)}},L=async(z,O)=>{A(!0),k(null);try{const J=await Wt("/system-config",{install:{[z]:O}});return J.success?(p({...m,[z]:O}),o(s("settings.systemConfigUpdated")),!0):(o(J.message||s("errors.failedToUpdateSystemConfig")),!1)}catch(J){return console.error("Failed to update system config:",J),k(J instanceof Error?J.message:"Failed to update system config"),o(s("errors.failedToUpdateSystemConfig")),!1}finally{A(!1)}},ee=async(z,O)=>{A(!0),k(null);try{const J=await Wt("/system-config",{smartRouting:{[z]:O}});return J.success?(h({...g,[z]:O}),o(s("settings.systemConfigUpdated")),!0):(o(J.message||s("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(J){console.error("Failed to update smart routing config:",J);const $=J instanceof Error?J.message:"Failed to update smart routing config";return k($),o($),!1}finally{A(!1)}},ae=async z=>{A(!0),k(null);try{const O=await Wt("/system-config",{smartRouting:z});return O.success?(h({...g,...z}),o(s("settings.systemConfigUpdated")),!0):(o(O.message||s("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(O){console.error("Failed to update smart routing config:",O);const J=O instanceof Error?O.message:"Failed to update smart routing config";return k(J),o(J),!1}finally{A(!1)}},K=async z=>{A(!0),k(null);try{const O=await Wt("/system-config",{routing:z});return O.success?(i({...l,...z}),o(s("settings.systemConfigUpdated")),!0):(o(O.message||s("errors.failedToUpdateRouteConfig")),!1)}catch(O){return console.error("Failed to update routing config:",O),k(O instanceof Error?O.message:"Failed to update routing config"),o(s("errors.failedToUpdateRouteConfig")),!1}finally{A(!1)}},oe=async(z,O)=>{A(!0),k(null);try{const J=await Wt("/system-config",{mcpRouter:{[z]:O}});return J.success?(S({...y,[z]:O}),o(s("settings.systemConfigUpdated")),!0):(o(J.message||s("errors.failedToUpdateSystemConfig")),!1)}catch(J){console.error("Failed to update MCPRouter config:",J);const $=J instanceof Error?J.message:"Failed to update MCPRouter config";return k($),o($),!1}finally{A(!1)}},de=async z=>{A(!0),k(null);try{const O=await Wt("/system-config",{mcpRouter:z});return O.success?(S({...y,...z}),o(s("settings.systemConfigUpdated")),!0):(o(O.message||s("errors.failedToUpdateSystemConfig")),!1)}catch(O){console.error("Failed to update MCPRouter config:",O);const J=O instanceof Error?O.message:"Failed to update MCPRouter config";return k(J),o(J),!1}finally{A(!1)}};return b.useEffect(()=>{U()},[U,R]),b.useEffect(()=>{l&&f({bearerAuthKey:l.bearerAuthKey})},[l]),{routingConfig:l,tempRoutingConfig:d,setTempRoutingConfig:f,installConfig:m,smartRoutingConfig:g,mcpRouterConfig:y,loading:w,error:C,setError:k,triggerRefresh:E,fetchSettings:U,updateRoutingConfig:X,updateInstallConfig:L,updateSmartRoutingConfig:ee,updateSmartRoutingConfigBatch:ae,updateRoutingConfigBatch:K,updateMCPRouterConfig:oe,updateMCPRouterConfigBatch:de}},Ov=({group:s,servers:o,onEdit:l,onDelete:i})=>{const{t:d}=Ee(),{showToast:f}=Ys(),{installConfig:m}=Su(),[p,g]=b.useState(!1),[h,y]=b.useState(!1),[S,w]=b.useState(!1),[A,C]=b.useState(null),k=b.useRef(null);b.useEffect(()=>{const z=O=>{k.current&&!k.current.contains(O.target)&&w(!1)};return document.addEventListener("mousedown",z),()=>{document.removeEventListener("mousedown",z)}},[]);const R=()=>{l(s)},N=()=>{g(!0)},E=()=>{i(s.id),g(!1)},U=z=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(z).then(()=>{y(!0),w(!1),f(d("common.copySuccess"),"success"),setTimeout(()=>y(!1),2e3)});else{const O=document.createElement("textarea");O.value=z,O.style.position="fixed",O.style.left="-9999px",document.body.appendChild(O),O.focus(),O.select();try{document.execCommand("copy"),y(!0),w(!1),f(d("common.copySuccess"),"success"),setTimeout(()=>y(!1),2e3)}catch(J){f(d("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",J)}document.body.removeChild(O)}},X=()=>{U(s.id)},L=()=>{U(`${m.baseUrl}/mcp/${s.id}`)},ee=()=>{const z={mcpServers:{mcphub:{url:`${m.baseUrl}/mcp/${s.id}`,headers:{Authorization:"Bearer <your-access-token>"}}}};U(JSON.stringify(z,null,2))},ae=z=>z.map(O=>typeof O=="string"?O:O.name),K=z=>{const O=s.servers.find(J=>typeof J=="string"?J===z:J.name===z);return typeof O=="string"?{name:O,tools:"all"}:O},oe=ae(s.servers),de=o.filter(z=>oe.includes(z.name));return r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 ",children:[r.jsxs("div",{className:"flex justify-between items-center mb-4",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:s.name}),r.jsxs("div",{className:"flex items-center ml-3",children:[r.jsx("span",{className:"text-xs text-gray-500 mr-1",children:s.id}),r.jsxs("div",{className:"relative",ref:k,children:[r.jsxs("button",{onClick:()=>w(!S),className:"p-1 text-gray-400 hover:text-gray-600 transition-colors flex items-center",title:d("common.copy"),children:[h?r.jsx(Ao,{size:14,className:"text-green-500"}):r.jsx(eu,{size:14}),r.jsx(wu,{size:12,className:"ml-1"})]}),S&&r.jsxs("div",{className:"absolute top-full left-0 mt-1 bg-white shadow-lg rounded-md border border-gray-200 py-1 z-10 min-w-[140px]",children:[r.jsxs("button",{onClick:X,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[r.jsx(eu,{size:12,className:"mr-2"}),d("common.copyId")]}),r.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:[r.jsx(Eb,{size:12,className:"mr-2"}),d("common.copyUrl")]}),r.jsxs("button",{onClick:ee,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[r.jsx(jb,{size:12,className:"mr-2"}),d("common.copyJson")]})]})]})]})]}),s.description&&r.jsx("p",{className:"text-gray-600 text-sm mt-1",children:s.description})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"bg-blue-50 text-blue-700 px-3 py-1 rounded-full text-sm btn-secondary",children:d("groups.serverCount",{count:s.servers.length})}),r.jsx("button",{onClick:R,className:"text-gray-500 hover:text-gray-700",title:d("groups.edit"),children:r.jsx(Sg,{size:18})}),r.jsx("button",{onClick:N,className:"text-gray-500 hover:text-red-600",title:d("groups.delete"),children:r.jsx(Gb,{size:18})})]})]}),r.jsx("div",{className:"mt-4",children:de.length===0?r.jsx("p",{className:"text-gray-500 italic",children:d("groups.noServers")}):r.jsx("div",{className:"flex flex-wrap gap-2",children:de.map(z=>{var Z;const O=K(z.name),J=O&&O.tools!=="all"&&Array.isArray(O.tools),$=J&&Array.isArray(O==null?void 0:O.tools)?O.tools.length:((Z=z.tools)==null?void 0:Z.length)||0,F=A===z.name,T=()=>J&&Array.isArray(O==null?void 0:O.tools)?O.tools:z.tools&&z.tools.length>0?z.tools.map(re=>re.name):[],q=()=>{C(F?null:z.name)};return r.jsxs("div",{className:"relative",children:[r.jsxs("div",{className:"flex items-center space-x-2 bg-gray-50 rounded-lg px-3 py-2 cursor-pointer hover:bg-gray-100 transition-colors",onClick:q,children:[r.jsx("span",{className:"font-medium text-gray-700 text-sm",children:z.name}),r.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${z.status==="connected"?"bg-green-500":z.status==="connecting"?"bg-yellow-500":"bg-red-500"}`}),$>0&&r.jsxs("span",{className:"text-xs text-blue-600 bg-blue-100 px-2 py-0.5 rounded flex items-center gap-1",children:[r.jsx(Fb,{size:12}),$]})]}),F&&r.jsxs("div",{className:"absolute top-full left-0 mt-1 bg-white shadow-lg rounded-md border border-gray-200 p-3 z-10 min-w-[300px] max-w-[400px]",children:[r.jsxs("div",{className:"text-gray-600 text-xs mb-2",children:[d(J?"groups.selectedTools":"groups.allTools"),":"]}),r.jsx("div",{className:"flex flex-wrap gap-1",children:T().map((re,j)=>r.jsx("span",{className:"inline-block bg-gray-100 text-gray-700 px-2 py-1 rounded text-xs",children:re},j))})]})]},z.name)})})}),r.jsx(Xg,{isOpen:p,onClose:()=>g(!1),onConfirm:E,serverName:s.name,isGroup:!0})]})},zv=()=>{const{t:s}=Ee(),{groups:o,loading:l,error:i,setError:d,deleteGroup:f,triggerRefresh:m}=Nu(),{servers:p}=Fs(),[g,h]=b.useState(null),[y,S]=b.useState(!1),w=N=>{h(N)},A=()=>{h(null),m()},C=async N=>{const E=await f(N);(!E||!E.success)&&d((E==null?void 0:E.message)||s("groups.deleteError"))},k=()=>{S(!0)},R=()=>{S(!1),m()};return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-8",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.groups.title")}),r.jsx("div",{className:"flex space-x-4",children:r.jsxs("button",{onClick:k,className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 00-1 1v5H4a1 1 0 100 2h5v5a1 1 0 102 0v-5h5a1 1 0 100-2h-5V4a1 1 0 00-1-1z",clipRule:"evenodd"})}),s("groups.add")]})})]}),i&&r.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:r.jsx("p",{children:i})}),l?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 loading-container",children:r.jsxs("div",{className:"flex flex-col items-center justify-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):o.length===0?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:r.jsx("p",{className:"text-gray-600",children:s("groups.noGroups")})}):r.jsx("div",{className:"space-y-6",children:o.map(N=>r.jsx(Ov,{group:N,servers:p,onEdit:w,onDelete:C},N.id))}),y&&r.jsx(Rv,{onAdd:R,onCancel:R}),g&&r.jsx(Mv,{group:g,onEdit:A,onCancel:()=>h(null)})]})},Uv=()=>r.jsx("div",{}),Dv=({onSuccess:s,onCancel:o})=>{const{t:l}=Ee(),[i,d]=b.useState({currentPassword:"",newPassword:""}),[f,m]=b.useState(""),[p,g]=b.useState(!1),[h,y]=b.useState(null),[S,w]=b.useState(!1),A=k=>{const{name:R,value:N}=k.target;R==="confirmPassword"?m(N):d(E=>({...E,[R]:N}))},C=async k=>{if(k.preventDefault(),y(null),i.newPassword!==f){y(l("auth.passwordsNotMatch"));return}g(!0);try{const R=await rb(i);R.success?(w(!0),s&&s()):y(R.message||l("auth.changePasswordError"))}catch{y(l("auth.changePasswordError"))}finally{g(!1)}};return r.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-md",children:[r.jsx("h2",{className:"text-xl font-bold mb-4",children:l("auth.changePassword")}),S?r.jsx("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4",children:l("auth.changePasswordSuccess")}):r.jsxs("form",{onSubmit:C,children:[h&&r.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4",children:h}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"currentPassword",children:l("auth.currentPassword")}),r.jsx("input",{type:"password",id:"currentPassword",name:"currentPassword",className:"w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",value:i.currentPassword,onChange:A,required:!0})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"newPassword",children:l("auth.newPassword")}),r.jsx("input",{type:"password",id:"newPassword",name:"newPassword",className:"w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",value:i.newPassword,onChange:A,required:!0,minLength:6})]}),r.jsxs("div",{className:"mb-6",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"confirmPassword",children:l("auth.confirmPassword")}),r.jsx("input",{type:"password",id:"confirmPassword",name:"confirmPassword",className:"w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",value:f,onChange:A,required:!0,minLength:6})]}),r.jsxs("div",{className:"flex justify-end space-x-2",children:[o&&r.jsx("button",{type:"button",onClick:o,disabled:p,className:"py-2 px-4 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:l("common.cancel")}),r.jsx("button",{type:"submit",disabled:p,className:"py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 btn-primary",children:p?r.jsxs("span",{className:"flex items-center",children:[r.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("common.save")]}):l("common.save")})]})]})]})};function Lv(s=32){const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",l=new Uint8Array(s);return crypto.getRandomValues(l),Array.from(l).map(i=>o.charAt(i%o.length)).join("")}const mo={SETTINGS_SMART_ROUTING:"settings:smart_routing",SETTINGS_SKIP_AUTH:"settings:skip_auth",SETTINGS_INSTALL_CONFIG:"settings:install_config"},_v=()=>{const{t:s}=Ee(),o=Ga(),{showToast:l}=Ys(),[i,d]=b.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[f,m]=b.useState({dbUrl:"",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:""}),[p,g]=b.useState({apiKey:"",referer:"https://mcphub.app",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),{routingConfig:h,tempRoutingConfig:y,setTempRoutingConfig:S,installConfig:w,smartRoutingConfig:A,mcpRouterConfig:C,loading:k,updateRoutingConfig:R,updateRoutingConfigBatch:N,updateInstallConfig:E,updateSmartRoutingConfig:U,updateSmartRoutingConfigBatch:X,updateMCPRouterConfig:L}=Su();b.useEffect(()=>{w&&d(w)},[w]),b.useEffect(()=>{A&&m({dbUrl:A.dbUrl||"",openaiApiBaseUrl:A.openaiApiBaseUrl||"",openaiApiKey:A.openaiApiKey||"",openaiApiEmbeddingModel:A.openaiApiEmbeddingModel||""})},[A]),b.useEffect(()=>{C&&g({apiKey:C.apiKey||"",referer:C.referer||"https://mcphub.app",title:C.title||"MCPHub",baseUrl:C.baseUrl||"https://api.mcprouter.to/v1"})},[C]);const[ee,ae]=b.useState({routingConfig:!1,installConfig:!1,smartRoutingConfig:!1,mcpRouterConfig:!1,password:!1}),K=j=>{ae(I=>({...I,[j]:!I[j]}))},oe=async(j,I)=>{if(j==="enableBearerAuth"&&I===!0&&!y.bearerAuthKey&&!h.bearerAuthKey){const le=Lv();de(le),await N({enableBearerAuth:!0,bearerAuthKey:le})&&S(V=>({...V,bearerAuthKey:le}));return}await R(j,I)},de=j=>{S(I=>({...I,bearerAuthKey:j}))},z=async()=>{await R("bearerAuthKey",y.bearerAuthKey)},O=(j,I)=>{d({...i,[j]:I})},J=async j=>{await E(j,i[j])},$=(j,I)=>{m({...f,[j]:I})},F=async j=>{await U(j,f[j])},T=(j,I)=>{g({...p,[j]:I})},q=async j=>{await L(j,p[j])},Z=async j=>{if(j){const I=f.dbUrl||A.dbUrl,le=f.openaiApiKey||A.openaiApiKey;if(!I||!le){const V=[];I||V.push(s("settings.dbUrl")),le||V.push(s("settings.openaiApiKey")),l(s("settings.smartRoutingValidationError",{fields:V.join(", ")}));return}const B={enabled:j};f.dbUrl!==A.dbUrl&&(B.dbUrl=f.dbUrl),f.openaiApiBaseUrl!==A.openaiApiBaseUrl&&(B.openaiApiBaseUrl=f.openaiApiBaseUrl),f.openaiApiKey!==A.openaiApiKey&&(B.openaiApiKey=f.openaiApiKey),f.openaiApiEmbeddingModel!==A.openaiApiEmbeddingModel&&(B.openaiApiEmbeddingModel=f.openaiApiEmbeddingModel),await X(B)}else await U("enabled",j)},re=()=>{setTimeout(()=>{o("/")},2e3)};return r.jsxs("div",{className:"container mx-auto",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:s("pages.settings.title")}),r.jsx(co,{permissions:mo.SETTINGS_SMART_ROUTING,children:r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 page-card dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600",onClick:()=>K("smartRoutingConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:s("pages.settings.smartRouting")}),r.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:ee.smartRoutingConfig?"▼":"►"})]}),ee.smartRoutingConfig&&r.jsxs("div",{className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableSmartRouting")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableSmartRoutingDescription")})]}),r.jsx(Rr,{disabled:k,checked:A.enabled,onCheckedChange:j=>Z(j)})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsxs("h3",{className:"font-medium text-gray-700",children:[r.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.dbUrl")]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:f.dbUrl,onChange:j=>$("dbUrl",j.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:k}),r.jsx("button",{onClick:()=>F("dbUrl"),disabled:k,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")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsxs("h3",{className:"font-medium text-gray-700",children:[r.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.openaiApiKey")]})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"password",value:f.openaiApiKey,onChange:j=>$("openaiApiKey",j.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:k}),r.jsx("button",{onClick:()=>F("openaiApiKey"),disabled:k,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")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.openaiApiBaseUrl")})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:f.openaiApiBaseUrl,onChange:j=>$("openaiApiBaseUrl",j.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:k}),r.jsx("button",{onClick:()=>F("openaiApiBaseUrl"),disabled:k,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")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.openaiApiEmbeddingModel")})}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:f.openaiApiEmbeddingModel,onChange:j=>$("openaiApiEmbeddingModel",j.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:k}),r.jsx("button",{onClick:()=>F("openaiApiEmbeddingModel"),disabled:k,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")})]})]})]})]})}),r.jsx(co,{permissions:mo.SETTINGS_INSTALL_CONFIG,children:r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 page-card dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600",onClick:()=>K("mcpRouterConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:s("settings.mcpRouterConfig")}),r.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:ee.mcpRouterConfig?"▼":"►"})]}),ee.mcpRouterConfig&&r.jsxs("div",{className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.mcpRouterApiKey")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.mcpRouterApiKeyDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"password",value:p.apiKey,onChange:j=>T("apiKey",j.target.value),placeholder:s("settings.mcpRouterApiKeyPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm border-gray-300 form-input",disabled:k}),r.jsx("button",{onClick:()=>q("apiKey"),disabled:k,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")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.mcpRouterReferer")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.mcpRouterRefererDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:p.referer,onChange:j=>T("referer",j.target.value),placeholder:s("settings.mcpRouterRefererPlaceholder"),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:k}),r.jsx("button",{onClick:()=>q("referer"),disabled:k,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")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.mcpRouterTitle")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.mcpRouterTitleDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:p.title,onChange:j=>T("title",j.target.value),placeholder:s("settings.mcpRouterTitlePlaceholder"),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:k}),r.jsx("button",{onClick:()=>q("title"),disabled:k,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")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.mcpRouterBaseUrl")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.mcpRouterBaseUrlDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:p.baseUrl,onChange:j=>T("baseUrl",j.target.value),placeholder:s("settings.mcpRouterBaseUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:k}),r.jsx("button",{onClick:()=>q("baseUrl"),disabled:k,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")})]})]})]})]})}),r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>K("routingConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:s("pages.settings.routeConfig")}),r.jsx("span",{className:"text-gray-500",children:ee.routingConfig?"▼":"►"})]}),ee.routingConfig&&r.jsxs("div",{className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableBearerAuth")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableBearerAuthDescription")})]}),r.jsx(Rr,{disabled:k,checked:h.enableBearerAuth,onCheckedChange:j=>oe("enableBearerAuth",j)})]}),h.enableBearerAuth&&r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.bearerAuthKey")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.bearerAuthKeyDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:y.bearerAuthKey,onChange:j=>de(j.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:k||!h.enableBearerAuth}),r.jsx("button",{onClick:z,disabled:k||!h.enableBearerAuth,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:s("common.save")})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableGlobalRoute")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableGlobalRouteDescription")})]}),r.jsx(Rr,{disabled:k,checked:h.enableGlobalRoute,onCheckedChange:j=>oe("enableGlobalRoute",j)})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableGroupNameRoute")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableGroupNameRouteDescription")})]}),r.jsx(Rr,{disabled:k,checked:h.enableGroupNameRoute,onCheckedChange:j=>oe("enableGroupNameRoute",j)})]}),r.jsx(co,{permissions:mo.SETTINGS_SKIP_AUTH,children:r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.skipAuth")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.skipAuthDescription")})]}),r.jsx(Rr,{disabled:k,checked:h.skipAuth,onCheckedChange:j=>oe("skipAuth",j)})]})})]})]}),r.jsx(co,{permissions:mo.SETTINGS_INSTALL_CONFIG,children:r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>K("installConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:s("settings.installConfig")}),r.jsx("span",{className:"text-gray-500",children:ee.installConfig?"▼":"►"})]}),ee.installConfig&&r.jsxs("div",{className:"space-y-4 mt-4",children:[r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.baseUrl")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.baseUrlDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:i.baseUrl,onChange:j=>O("baseUrl",j.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:k}),r.jsx("button",{onClick:()=>J("baseUrl"),disabled:k,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")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.pythonIndexUrl")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.pythonIndexUrlDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:i.pythonIndexUrl,onChange:j=>O("pythonIndexUrl",j.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:k}),r.jsx("button",{onClick:()=>J("pythonIndexUrl"),disabled:k,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")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.npmRegistry")}),r.jsx("p",{className:"text-sm text-gray-500",children:s("settings.npmRegistryDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:i.npmRegistry,onChange:j=>O("npmRegistry",j.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:k}),r.jsx("button",{onClick:()=>J("npmRegistry"),disabled:k,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")})]})]})]})]})}),r.jsxs("div",{className:"bg-white shadow rounded-lg py-4 px-6 mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer",onClick:()=>K("password"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:s("auth.changePassword")}),r.jsx("span",{className:"text-gray-500",children:ee.password?"▼":"►"})]}),ee.password&&r.jsx("div",{className:"max-w-lg mt-4",children:r.jsx(Dv,{onSuccess:re})})]})]})},Bv=()=>{const{t:s}=Ee(),[o,l]=b.useState([]),[i,d]=b.useState([]),[f,m]=b.useState([]),[p,g]=b.useState([]),[h,y]=b.useState(""),[S,w]=b.useState(""),[A,C]=b.useState(""),[k,R]=b.useState(!0),[N,E]=b.useState(null),[U,X]=b.useState(null),[L,ee]=b.useState([]),[ae,K]=b.useState(1),[oe,de]=b.useState(9),[z,O]=b.useState(1),J=b.useCallback(async()=>{try{R(!0);const W=await Xe("/market/servers");W&&W.success&&Array.isArray(W.data)?(d(W.data),$(W.data,ae)):(console.error("Invalid market servers data format:",W),E(s("market.fetchError")))}catch(W){console.error("Error fetching market servers:",W),E(W instanceof Error?W.message:String(W))}finally{R(!1)}},[s]),$=b.useCallback((W,Y,ue=oe)=>{const be=W.length,je=Math.ceil(be/ue);O(je);const xe=Math.max(1,Math.min(Y,je));xe!==Y&&K(xe);const Te=(xe-1)*ue,Be=W.slice(Te,Te+ue);l(Be)},[oe]),F=b.useCallback(W=>{K(W),$(i,W,oe)},[i,$,oe]),T=b.useCallback(async()=>{try{const W=await Xe("/market/categories");W&&W.success&&Array.isArray(W.data)?m(W.data):console.error("Invalid categories data format:",W)}catch(W){console.error("Error fetching categories:",W)}},[]),q=b.useCallback(async()=>{try{const W=await Xe("/market/tags");W&&W.success&&Array.isArray(W.data)?g(W.data):console.error("Invalid tags data format:",W)}catch(W){console.error("Error fetching tags:",W)}},[]),Z=b.useCallback(async W=>{try{R(!0);const Y=await Xe(`/market/servers/${W}`);return Y&&Y.success&&Y.data?(X(Y.data),Y.data):(console.error("Invalid server data format:",Y),E(s("market.serverNotFound")),null)}catch(Y){return console.error(`Error fetching server ${W}:`,Y),E(Y instanceof Error?Y.message:String(Y)),null}finally{R(!1)}},[s]),re=b.useCallback(async W=>{try{if(R(!0),C(W),!W.trim()){J();return}const Y=await Xe(`/market/servers/search?query=${encodeURIComponent(W)}`);Y&&Y.success&&Array.isArray(Y.data)?(d(Y.data),K(1),$(Y.data,1)):(console.error("Invalid search results format:",Y),E(s("market.searchError")))}catch(Y){console.error("Error searching servers:",Y),E(Y instanceof Error?Y.message:String(Y))}finally{R(!1)}},[s,i,$,J]),j=b.useCallback(async W=>{try{if(R(!0),y(W),w(""),!W){J();return}const Y=await Xe(`/market/categories/${encodeURIComponent(W)}`);Y&&Y.success&&Array.isArray(Y.data)?(d(Y.data),K(1),$(Y.data,1)):(console.error("Invalid category filter results format:",Y),E(s("market.filterError")))}catch(Y){console.error("Error filtering servers by category:",Y),E(Y instanceof Error?Y.message:String(Y))}finally{R(!1)}},[s,J,$]),I=b.useCallback(async W=>{try{if(R(!0),w(W),y(""),!W){J();return}const Y=await Xe(`/market/tags/${encodeURIComponent(W)}`);Y&&Y.success&&Array.isArray(Y.data)?(d(Y.data),K(1),$(Y.data,1)):(console.error("Invalid tag filter results format:",Y),E(s("market.tagFilterError")))}catch(Y){console.error("Error filtering servers by tag:",Y),E(Y instanceof Error?Y.message:String(Y))}finally{R(!1)}},[s,J,$]),le=b.useCallback(async()=>{try{const W=await Xe("/servers");if(W&&W.success&&Array.isArray(W.data)){const Y=W.data.map(ue=>ue.name);ee(Y)}}catch(W){console.error("Error fetching installed servers:",W)}},[]),B=b.useCallback(W=>L.includes(W),[L]),V=b.useCallback(async(W,Y)=>{var ue,be;try{const je=(ue=W.installations)!=null&&ue.npm?"npm":Object.keys(W.installations||{}).length>0?Object.keys(W.installations)[0]:null;if(!je||!((be=W.installations)!=null&&be[je]))return E(s("market.noInstallationMethod")),!1;const xe=W.installations[je],Te={name:W.name,config:Y.type==="stdio"?{command:Y.command||xe.command||"",args:Y.args||xe.args||[],env:{...xe.env,...Y.env}}:Y},Be=await Vt("/servers",Te);if(!Be.success)throw new Error(Be.message||"Failed to install server");return await le(),!0}catch(je){return console.error("Error installing server:",je),E(je instanceof Error?je.message:String(je)),!1}},[s,le]),me=b.useCallback(W=>{de(W),K(1),$(i,1,W)},[i,$]);return b.useEffect(()=>{J(),T(),q(),le()},[J,T,q,le]),{servers:o,allServers:i,categories:f,tags:p,selectedCategory:h,selectedTag:S,searchQuery:A,loading:k,error:N,setError:E,currentServer:U,fetchMarketServers:J,fetchServerByName:Z,searchServers:re,filterByCategory:j,filterByTag:I,installServer:V,currentPage:ae,totalPages:z,serversPerPage:oe,changePage:F,changeServersPerPage:me,isServerInstalled:B}},Hv=()=>{const{t:s}=Ee(),[o,l]=b.useState([]),[i,d]=b.useState([]),[f,m]=b.useState([]),[p,g]=b.useState([]),[h,y]=b.useState(""),[S,w]=b.useState(""),[A,C]=b.useState(""),[k,R]=b.useState(!0),[N,E]=b.useState(null),[U,X]=b.useState(null),[L,ee]=b.useState(1),[ae,K]=b.useState(9),[oe,de]=b.useState(1),z=b.useCallback(async()=>{try{R(!0);const B=await Xe("/cloud/servers");B&&B.success&&Array.isArray(B.data)?(d(B.data),O(B.data,L)):(console.error("Invalid cloud market servers data format:",B),E(s("cloud.fetchError")))}catch(B){console.error("Error fetching cloud market servers:",B);const V=B instanceof Error?B.message:String(B);V==="MCPROUTER_API_KEY_NOT_CONFIGURED"||V.toLowerCase().includes("mcprouter api key not configured"),E(V)}finally{R(!1)}},[s]),O=b.useCallback((B,V,me=ae)=>{const W=B.length,Y=Math.ceil(W/me);de(Y);const ue=Math.max(1,Math.min(V,Y));ue!==V&&ee(ue);const be=(ue-1)*me,je=B.slice(be,be+me);l(je)},[ae]),J=b.useCallback(B=>{ee(B),O(i,B,ae)},[i,O,ae]),$=b.useCallback(async()=>{try{const B=await Xe("/cloud/categories");B&&B.success&&Array.isArray(B.data)?m(B.data):console.error("Invalid cloud market categories data format:",B)}catch(B){console.error("Error fetching cloud market categories:",B)}},[]),F=b.useCallback(async()=>{try{const B=await Xe("/cloud/tags");B&&B.success&&Array.isArray(B.data)?g(B.data):console.error("Invalid cloud market tags data format:",B)}catch(B){console.error("Error fetching cloud market tags:",B)}},[]),T=b.useCallback(async B=>{try{R(!0);const V=await Xe(`/cloud/servers/${B}`);return V&&V.success&&V.data?(X(V.data),V.data):(console.error("Invalid cloud server data format:",V),E(s("cloud.serverNotFound")),null)}catch(V){console.error(`Error fetching cloud server ${B}:`,V);const me=V instanceof Error?V.message:String(V);return me==="MCPROUTER_API_KEY_NOT_CONFIGURED"||me.toLowerCase().includes("mcprouter api key not configured"),E(me),null}finally{R(!1)}},[s]),q=b.useCallback(async B=>{try{if(R(!0),C(B),!B.trim()){z();return}const V=await Xe(`/cloud/servers/search?query=${encodeURIComponent(B)}`);V&&V.success&&Array.isArray(V.data)?(d(V.data),ee(1),O(V.data,1)):(console.error("Invalid cloud search results format:",V),E(s("cloud.searchError")))}catch(V){console.error("Error searching cloud servers:",V),E(V instanceof Error?V.message:String(V))}finally{R(!1)}},[s,i,O,z]),Z=b.useCallback(async B=>{try{if(R(!0),y(B),w(""),!B){z();return}const V=await Xe(`/cloud/categories/${encodeURIComponent(B)}`);V&&V.success&&Array.isArray(V.data)?(d(V.data),ee(1),O(V.data,1)):(console.error("Invalid cloud category filter results format:",V),E(s("cloud.filterError")))}catch(V){console.error("Error filtering cloud servers by category:",V),E(V instanceof Error?V.message:String(V))}finally{R(!1)}},[s,z,O]),re=b.useCallback(async B=>{try{if(R(!0),w(B),y(""),!B){z();return}const V=await Xe(`/cloud/tags/${encodeURIComponent(B)}`);V&&V.success&&Array.isArray(V.data)?(d(V.data),ee(1),O(V.data,1)):(console.error("Invalid cloud tag filter results format:",V),E(s("cloud.tagFilterError")))}catch(V){console.error("Error filtering cloud servers by tag:",V),E(V instanceof Error?V.message:String(V))}finally{R(!1)}},[s,z,O]),j=b.useCallback(async B=>{try{const V=await Xe(`/cloud/servers/${B}/tools`);if(!V.success)throw console.error("Failed to fetch cloud server tools:",V),new Error(V.message||"Failed to fetch cloud server tools");return V&&V.success&&Array.isArray(V.data)?V.data:(console.error("Invalid cloud server tools data format:",V),[])}catch(V){console.error(`Error fetching tools for cloud server ${B}:`,V);const me=V instanceof Error?V.message:String(V);if(me==="MCPROUTER_API_KEY_NOT_CONFIGURED"||me.toLowerCase().includes("mcprouter api key not configured"))throw V;return[]}},[]),I=b.useCallback(async(B,V,me)=>{try{const W=await Vt(`/cloud/servers/${B}/tools/${V}/call`,{arguments:me});if(W&&W.success)return W.data;throw new Error(W.message||"Failed to call tool")}catch(W){throw console.error(`Error calling tool ${V} on cloud server ${B}:`,W),W}},[]),le=b.useCallback(B=>{K(B),ee(1),O(i,1,B)},[i,O]);return b.useEffect(()=>{z(),$(),F()},[z,$,F]),{servers:o,allServers:i,categories:f,tags:p,selectedCategory:h,selectedTag:S,searchQuery:A,loading:k,error:N,setError:E,currentServer:U,fetchCloudServers:z,fetchServerByName:T,searchServers:q,filterByCategory:Z,filterByTag:re,fetchServerTools:j,callServerTool:I,currentPage:L,totalPages:oe,serversPerPage:ae,changePage:J,changeServersPerPage:le}},qv=({server:s,onClick:o})=>{var g,h,y,S;const{t:l}=Ee(),i=w=>w.split(" ").map(A=>A.charAt(0)).join("").toUpperCase().slice(0,2),d=()=>{if(!s.tags||s.tags.length===0)return{tagsToShow:[],hasMore:!1,moreCount:0};const w=28,A=U=>U.length+3;let C=0,k=0;const R=[...s.tags].sort((U,X)=>U.length-X.length);for(k=0;k<R.length;k++){const U=A(R[k]);if(C+U>w)break;if(C+=U,k===R.length-1)return{tagsToShow:R,hasMore:!1,moreCount:0}}k===0&&R.length>0&&(k=1);const N=R.length-k,E=3+String(N).length+l("market.moreTags").length;return C+E<=w||k<1?{tagsToShow:R.slice(0,k),hasMore:!0,moreCount:N}:{tagsToShow:R.slice(0,Math.max(1,k-1)),hasMore:!0,moreCount:N+1}},{tagsToShow:f,hasMore:m,moreCount:p}=d();return r.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-4 hover:shadow-lg hover:border-blue-400 hover:-translate-y-1 transition-all duration-300 cursor-pointer group relative overflow-hidden h-full flex flex-col",onClick:()=>o(s),children:[r.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-50/0 to-purple-50/0 group-hover:from-blue-50/30 group-hover:to-purple-50/30 transition-all duration-300 pointer-events-none"}),r.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[r.jsxs("div",{className:"flex items-start justify-between mb-2",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"text-lg font-bold text-gray-900 group-hover:text-blue-600 transition-colors duration-200 mb-1 line-clamp-1 mr-2",children:s.display_name}),r.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[r.jsx("div",{className:"w-6 h-6 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white text-xs font-semibold",children:i(((g=s.author)==null?void 0:g.name)||l("market.unknown"))}),r.jsx("div",{children:r.jsx("p",{className:"text-xs font-medium text-gray-700",children:((h=s.author)==null?void 0:h.name)||l("market.unknown")})})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2",children:s.is_official&&r.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:l("market.official")})})]}),r.jsx("div",{className:"mb-2 flex-1",children:r.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-2 min-h-[36px]",children:s.description})}),r.jsx("div",{className:"mb-2",children:r.jsx("div",{className:"flex flex-wrap gap-1 min-h-[24px]",children:((y=s.categories)==null?void 0:y.length)>0?s.categories.map((w,A)=>r.jsx("span",{className:"bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded whitespace-nowrap",children:w},A)):r.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})})}),r.jsx("div",{className:"mb-2",children:r.jsx("div",{className:"relative min-h-[24px] overflow-x-auto",children:((S=s.tags)==null?void 0:S.length)>0?r.jsxs("div",{className:"flex gap-1 items-center whitespace-nowrap",children:[f.map((w,A)=>r.jsxs("span",{className:"bg-green-50 text-green-700 text-xs px-2 py-1 rounded flex-shrink-0",children:["#",w]},A)),m&&r.jsxs("span",{className:"bg-gray-100 text-gray-600 text-xs px-1.5 py-1 rounded flex-shrink-0",children:["+",p," ",l("market.moreTags")]})]}):r.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})})})]})]})},Pv=({server:s,onBack:o,onInstall:l,installing:i=!1,isInstalled:d=!1})=>{var oe,de;const{t:f}=Ee(),[m,p]=b.useState(!1),[g,h]=b.useState(null),[y,S]=b.useState(!1),[w,A]=b.useState(null),[C,k]=b.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")}:i?{className:"bg-gray-400 cursor-not-allowed px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:f("market.installing")}:{className:"bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded text-sm font-medium text-white btn-primary",disabled:!1,text:f("market.install")},N=()=>{p(!m),h(null),S(!1),A(null)},E=async()=>{w&&(await U(w),S(!1),A(null))},U=async z=>{try{h(null),l(s,z.config),p(!1)}catch(O){console.error("Error installing server:",O),h(f("errors.serverInstall"))}},X=()=>{d||N()},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 z=Object.keys(s.installations);if(z.length>0)return s.installations[z[0]]},ee=async z=>{try{const O=Qg(z);O.length>0?(k(O),A(z),S(!0)):await U(z)}catch(O){console.error("Error processing server installation:",O),h(f("errors.serverInstall"))}},ae=R(),K=L();return r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[r.jsx("div",{className:"mb-4",children:r.jsxs("button",{onClick:o,className:"text-gray-600 hover:text-gray-900 flex items-center",children:[r.jsx("svg",{className:"h-5 w-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"})}),f("market.backToList")]})}),r.jsxs("div",{className:"flex justify-between items-start mb-4",children:[r.jsx("div",{children:r.jsxs("h2",{className:"text-2xl font-bold text-gray-900 flex items-center flex-wrap",children:[s.display_name,r.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",s.name,")"]}),r.jsxs("span",{className:"text-sm font-normal text-gray-600 ml-4",children:[f("market.author"),": ",s.author.name," • ",f("market.license"),": ",s.license," •",r.jsx("a",{href:s.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline ml-1",children:f("market.repository")})]})]})}),r.jsxs("div",{className:"flex items-center",children:[s.is_official&&r.jsx("span",{className:"bg-blue-100 text-blue-800 text-sm font-normal px-4 py-2 rounded mr-2 flex items-center label-primary",children:f("market.official")}),r.jsx("button",{onClick:X,disabled:ae.disabled,className:ae.className,children:ae.text})]})]}),r.jsx("p",{className:"text-gray-700 mb-6",children:s.description}),r.jsxs("div",{className:"mb-6",children:[r.jsxs("h3",{className:"text-lg font-semibold mb-3",children:[f("market.categories")," & ",f("market.tags")]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[(oe=s.categories)==null?void 0:oe.map((z,O)=>r.jsx("span",{className:"bg-gray-100 text-gray-800 px-3 py-1 rounded",children:z},`cat-${O}`)),s.tags&&s.tags.map((z,O)=>r.jsxs("span",{className:"bg-gray-100 text-green-700 px-2 py-1 rounded text-sm",children:["#",z]},`tag-${O}`))]})]}),s.arguments&&Object.keys(s.arguments).length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.arguments")}),r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[r.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:r.jsxs("tr",{children:[r.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.argumentName")}),r.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.description")}),r.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.required")}),r.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:f("market.example")})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:Object.entries(s.arguments).map(([z,O],J)=>r.jsxs("tr",{children:[r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:z}),r.jsx("td",{className:"px-6 py-4 text-sm text-gray-500",children:O.description}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:O.required?r.jsx("span",{className:"text-green-600",children:"✓"}):r.jsx("span",{className:"text-gray-600",children:"✗"})}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:r.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:O.example})})]},J))})]})})]}),r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.tools")}),r.jsx("div",{className:"space-y-4",children:(de=s.tools)==null?void 0:de.map((z,O)=>r.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[r.jsxs("h4",{className:"font-medium mb-2",children:[z.name,r.jsx("button",{type:"button",onClick:()=>{const J=document.getElementById(`schema-${O}`);J&&J.classList.toggle("hidden")},className:"text-sm text-blue-500 font-normal hover:underline focus:outline-none ml-2",children:f("market.viewSchema")})]}),r.jsx("p",{className:"text-gray-600 mb-2",children:z.description}),r.jsx("div",{className:"mt-2",children:r.jsx("pre",{id:`schema-${O}`,className:"hidden bg-gray-50 p-3 rounded text-sm overflow-auto mt-2",children:JSON.stringify(z.inputSchema,null,2)})})]},O))})]}),s.examples&&s.examples.length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-semibold mb-3",children:f("market.examples")}),r.jsx("div",{className:"space-y-4",children:s.examples.map((z,O)=>r.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[r.jsx("h4",{className:"font-medium mb-2",children:z.title}),r.jsx("p",{className:"text-gray-600 mb-2",children:z.description}),r.jsx("pre",{className:"bg-gray-50 p-3 rounded text-sm overflow-auto",children:z.prompt})]},O))})]}),r.jsx("div",{className:"mt-6 flex justify-end",children:r.jsx("button",{onClick:X,disabled:ae.disabled,className:ae.className,children:ae.text})}),m&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Ro,{onSubmit:ee,onCancel:N,modalTitle:f("market.installServer",{name:s.display_name}),formError:g,initialData:{name:s.name,status:"disconnected",config:K?{command:K.command||"",args:K.args||[],env:K.env||{}}:void 0}})}),y&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[r.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:f("server.confirmVariables")}),r.jsx("p",{className:"text-gray-600 mb-4",children:f("server.variablesDetected")}),r.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),r.jsxs("div",{className:"ml-3",children:[r.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[f("server.detectedVariables"),":"]}),r.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:C.map((z,O)=>r.jsxs("li",{className:"font-mono",children:["$",`{${z}}`]},O))})]})]})}),r.jsx("p",{className:"text-gray-600 text-sm mb-6",children:f("market.confirmVariablesMessage")}),r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx("button",{onClick:()=>{S(!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")}),r.jsx("button",{onClick:E,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:f("market.confirmAndInstall")})]})]})})]})},Vv=({server:s,onClick:o})=>{const{t:l}=Ee(),i=()=>{o(s)},d=()=>{if(s.description&&s.description.length<=150)return s.description;if(s.content){const p=s.content.split(`
202
- `).filter(g=>g.trim());for(const g of p)if(g.length>50&&g.length<=150)return g}return s.description?s.description.slice(0,150)+"...":l("cloud.noDescription")},f=p=>{try{const g=new Date(p),h=g.getFullYear(),y=(g.getMonth()+1).toString().padStart(2,"0"),S=g.getDate().toString().padStart(2,"0");return`${h}/${y}/${S}`}catch{return""}},m=p=>p.split(" ").map(g=>g.charAt(0)).join("").toUpperCase().slice(0,2);return r.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-4 hover:shadow-lg hover:border-blue-400 hover:-translate-y-1 transition-all duration-300 cursor-pointer group relative overflow-hidden h-full flex flex-col",onClick:i,children:[r.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-50/0 to-purple-50/0 group-hover:from-blue-50/30 group-hover:to-purple-50/30 transition-all duration-300 pointer-events-none"}),r.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"text-lg font-bold text-gray-900 group-hover:text-blue-600 transition-colors duration-200 mb-2 line-clamp-2",children:s.title||s.name}),r.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[r.jsx("div",{className:"w-7 h-7 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white text-xs font-semibold",children:m(s.author_name)}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-gray-700",children:s.author_name}),s.updated_at&&r.jsxs("p",{className:"text-xs text-gray-500",children:[l("cloud.updated")," ",f(s.updated_at)]})]})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2",children:r.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:"MCP Server"})})]}),r.jsx("div",{className:"mb-3 flex-1",children:r.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-2",children:d()})}),s.tools&&s.tools.length>0&&r.jsx("div",{className:"mb-3",children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),r.jsxs("span",{className:"text-sm text-gray-600 font-medium",children:[s.tools.length," ",s.tools.length===1?l("cloud.tool"):l("cloud.tools")]})]})}),r.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-gray-100 mt-auto",children:[r.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500",children:[r.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"})}),r.jsx("span",{children:f(s.created_at)})]}),r.jsxs("div",{className:"flex items-center text-blue-600 text-sm font-medium group-hover:text-blue-700 transition-colors",children:[r.jsx("span",{children:l("cloud.viewDetails")}),r.jsx("svg",{className:"w-4 h-4 ml-1 transform group-hover:translate-x-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})]})},ou=()=>{const{t:s}=Ee(),o=Ga(),l=()=>{o("/settings")},i=()=>{window.open("https://mcprouter.co","_blank","noopener,noreferrer")};return r.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-6 mb-6",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("svg",{className:"h-5 w-5 text-amber-400",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),r.jsxs("div",{className:"ml-3 flex-1",children:[r.jsx("h3",{className:"text-sm font-medium text-amber-800",children:s("cloud.apiKeyNotConfigured")}),r.jsx("div",{className:"mt-2 text-sm text-amber-700",children:r.jsx("p",{children:s("cloud.apiKeyNotConfiguredDescription")})}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.jsxs("button",{onClick:i,className:"inline-flex items-center px-3 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors duration-200",children:[r.jsx("svg",{className:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),s("cloud.getApiKey")]}),r.jsxs("button",{onClick:l,className:"inline-flex items-center px-3 py-2 text-sm font-medium text-amber-800 bg-amber-100 border border-amber-300 rounded-md hover:bg-amber-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-amber-500 transition-colors duration-200",children:[r.jsxs("svg",{className:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),s("cloud.configureInSettings")]})]})]})]})})},Gv=({serverName:s,onBack:o,onCallTool:l,fetchServerTools:i,onInstall:d,installing:f=!1,isInstalled:m=!1})=>{const{t:p}=Ee(),{mcpRouterConfig:g}=Su(),[h,y]=b.useState(null),[S,w]=b.useState(!0),[A,C]=b.useState(null),[k,R]=b.useState([]),[N,E]=b.useState(!1),[U,X]=b.useState(!1),[L,ee]=b.useState(null),[ae,K]=b.useState({}),[oe,de]=b.useState({}),[z,O]=b.useState({}),[J,$]=b.useState(!1),[F,T]=b.useState(null),q=Y=>(console.error("Checking for MCPRouter API key error:",Y),Y==="MCPROUTER_API_KEY_NOT_CONFIGURED"||Y.toLowerCase().includes("mcprouter api key not configured")),Z=()=>m?{className:"bg-green-600 cursor-default px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:p("market.installed")}:f?{className:"bg-gray-400 cursor-not-allowed px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:p("market.installing")}:{className:"bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded text-sm font-medium text-white transition-colors",disabled:!1,text:p("market.install")},re=()=>{!m&&d&&($(!0),T(null))},j=()=>{$(!1),T(null)},I=async Y=>{try{if(!h||!d)return;T(null),d(h,Y.config),$(!1)}catch(ue){console.error("Error installing server:",ue),T(p("errors.serverInstall"))}};b.useEffect(()=>{(async()=>{try{w(!0),C(null);const ue=await Xe(`/cloud/servers/${s}`);ue&&ue.success&&ue.data?(y(ue.data),R(ue.data.tools||[])):C(p("cloud.serverNotFound"))}catch(ue){console.error("Failed to load server details:",ue),C(ue instanceof Error?ue.message:String(ue))}finally{w(!1)}})()},[s,p]),b.useEffect(()=>{(async()=>{if(h&&(!h.tools||h.tools.length===0)&&i){E(!0),X(!1);try{const ue=await i(h.name);R(ue)}catch(ue){console.error("Failed to load tools:",ue);const be=ue instanceof Error?ue.message:String(ue);q(be)&&X(!0)}finally{E(!1)}}})()},[h==null?void 0:h.name,h==null?void 0:h.tools,i]);const le=Y=>{try{const ue=new Date(Y),be=ue.getFullYear(),je=String(ue.getMonth()+1).padStart(2,"0"),xe=String(ue.getDate()).padStart(2,"0"),Te=String(ue.getHours()).padStart(2,"0"),Be=String(ue.getMinutes()).padStart(2,"0"),st=String(ue.getSeconds()).padStart(2,"0");return`${be}-${je}-${xe} ${Te}:${Be}:${st}`}catch{return Y}},B=(Y,ue,be)=>{de(je=>({...je,[Y]:{...je[Y],[ue]:be}}))},V=async Y=>{if(!(!l||!h)){ee(Y);try{const ue=oe[Y]||{},be=await l(h.server_key,Y,ue);K(je=>({...je,[Y]:be}))}catch(ue){console.error("Tool call failed:",ue);const be=ue instanceof Error?ue.message:String(ue);K(je=>({...je,[Y]:{error:be}}))}finally{ee(null)}}},me=Y=>{O(ue=>({...ue,[Y]:!ue[Y]}))},W=(Y,ue,be)=>{var Te;const je=((Te=oe[Y.name])==null?void 0:Te[ue])||"",xe=Be=>{let st=Be.target.value;be.type==="number"||be.type==="integer"?st=st===""?void 0:Number(st):be.type==="boolean"&&(st=Be.target.value==="true"),B(Y.name,ue,st)};return be.type==="boolean"?r.jsxs("select",{value:je===!0?"true":je===!1?"false":"",onChange:xe,className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",children:[r.jsx("option",{value:""}),r.jsx("option",{value:"true",children:"True"}),r.jsx("option",{value:"false",children:"False"})]}):be.type==="number"||be.type==="integer"?r.jsx("input",{type:"number",step:be.type==="integer"?"1":"any",value:je||"",onChange:xe,className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 form-input"}):r.jsx("input",{type:"text",value:je||"",onChange:xe,className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 form-input"})};return r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[r.jsx("div",{className:"mb-6",children:r.jsxs("button",{onClick:o,className:"inline-flex items-center text-gray-600 hover:text-gray-900 transition-colors group",children:[r.jsx("svg",{className:"h-5 w-5 mr-2 transform group-hover:-translate-x-1 transition-transform",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"})}),p("cloud.backToList")]})}),S?r.jsx("div",{className:"bg-white rounded-xl shadow-sm p-12",children:r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsxs("svg",{className:"animate-spin h-12 w-12 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600 text-lg",children:p("app.loading")})]})}):A&&!q(A)?r.jsx("div",{className:"bg-white rounded-xl shadow-sm p-6",children:r.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("svg",{className:"h-5 w-5 text-red-400 mr-3",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),r.jsx("p",{className:"text-red-700",children:A})]})})}):h?r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"bg-white rounded-xl shadow-sm overflow-hidden",children:r.jsx("div",{className:"bg-gradient-to-r from-gray-100 to-gray-200 px-6 py-4",children:r.jsxs("div",{className:"flex justify-between items-end",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-800 mb-2",children:h.title||h.name}),r.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-gray-600",children:[r.jsx("span",{className:"text-sm bg-white/60 text-gray-700 px-3 py-1 rounded-full",children:h.name}),r.jsxs("div",{className:"flex items-center",children:[r.jsx("svg",{className:"h-4 w-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})}),p("cloud.by")," ",h.author_name]})]})]}),r.jsxs("div",{className:"text-right flex flex-col items-end gap-3",children:[r.jsxs("div",{className:"text-xs text-gray-500",children:[p("cloud.updated"),": ",le(h.updated_at)]}),d&&!q(A||"")&&!U&&r.jsx("button",{onClick:re,disabled:Z().disabled,className:Z().className,children:Z().text})]})]})})}),r.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[r.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[r.jsx("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),p("cloud.description")]}),r.jsx("p",{className:"text-gray-700 leading-relaxed",children:h.description})]}),h.content&&r.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[r.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[r.jsx("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})}),p("cloud.details")]}),r.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 overflow-auto",children:r.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:h.content})})]}),r.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[r.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[r.jsxs("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),p("cloud.tools"),k.length>0&&r.jsx("span",{className:"ml-2 bg-blue-100 text-blue-800 text-sm font-medium px-2.5 py-0.5 rounded-full",children:k.length})]}),U&&r.jsx(ou,{}),N?r.jsxs("div",{className:"flex items-center justify-center py-12",children:[r.jsxs("svg",{className:"animate-spin h-8 w-8 text-blue-500 mr-3",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("span",{className:"text-gray-600",children:p("cloud.loadingTools")})]}):k.length===0&&!U?r.jsxs("div",{className:"text-center py-12",children:[r.jsx("svg",{className:"h-12 w-12 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),r.jsx("p",{className:"text-gray-600",children:p("cloud.noTools")})]}):k.length>0?r.jsx("div",{className:"space-y-4",children:k.map((Y,ue)=>r.jsxs("div",{className:"border border-gray-200 rounded-lg p-6 hover:border-gray-300 transition-colors",children:[r.jsxs("div",{className:"flex justify-between items-start mb-4",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-2 flex items-center",children:[r.jsx("span",{className:"bg-blue-100 text-blue-800 text-xs font-medium px-2 py-1 rounded mr-3",children:"TOOL"}),Y.name]}),r.jsx("p",{className:"text-gray-600 leading-relaxed whitespace-pre-wrap",children:Y.description})]}),l&&r.jsx("button",{onClick:()=>V(Y.name),disabled:L===Y.name,className:"ml-4 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center min-w-[100px] justify-center",children:L===Y.name?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),p("cloud.calling")]}):r.jsxs(r.Fragment,{children:[r.jsx("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h6m2 8l4-4H7l4 4z"})}),p("cloud.callTool")]})})]}),Y.inputSchema&&Y.inputSchema.properties&&Object.keys(Y.inputSchema.properties).length>0&&r.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700",children:p("cloud.parameters")}),r.jsxs("button",{onClick:()=>me(Y.name),className:"text-sm text-blue-600 hover:text-blue-800 focus:outline-none flex items-center gap-1 transition-colors",children:[p("cloud.viewSchema"),r.jsx("svg",{className:`h-3 w-3 transition-transform duration-200 ${z[Y.name]?"rotate-90":"rotate-0"}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})]}),z[Y.name]&&r.jsx("div",{className:"mb-4",children:r.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-3 overflow-auto",children:r.jsx("pre",{className:"text-sm text-gray-800",children:JSON.stringify(Y.inputSchema,null,2)})})}),r.jsx("div",{className:"space-y-4",children:Object.entries(Y.inputSchema.properties).map(([be,je])=>{var xe;return r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:[be,((xe=Y.inputSchema.required)==null?void 0:xe.includes(be))&&r.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),je.description&&r.jsx("p",{className:"text-xs text-gray-500",children:je.description}),W(Y,be,je)]},be)})})]}),ae[Y.name]&&r.jsx("div",{className:"border-t border-gray-100 pt-4 mt-4",children:ae[Y.name].error?r.jsx(r.Fragment,{children:q(ae[Y.name].error)?r.jsx(ou,{}):r.jsxs(r.Fragment,{children:[r.jsxs("h4",{className:"text-sm font-medium text-red-600 mb-3 flex items-center",children:[r.jsx("svg",{className:"h-4 w-4 text-red-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),p("cloud.error")]}),r.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:r.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap overflow-auto",children:ae[Y.name].error})})]})}):r.jsxs(r.Fragment,{children:[r.jsxs("h4",{className:"text-sm font-medium text-gray-700 mb-3 flex items-center",children:[r.jsx("svg",{className:"h-4 w-4 text-green-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),p("cloud.result")]}),r.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4",children:r.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap overflow-auto",children:JSON.stringify(ae[Y.name],null,2)})})]})})]},ue))}):null]})]}):r.jsx("div",{className:"bg-white rounded-xl shadow-sm p-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx("svg",{className:"h-12 w-12 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M9.172 16.172a4 4 0 015.656 0M9 12h6m-6-4h6m2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})}),r.jsx("p",{className:"text-gray-600 text-lg",children:p("cloud.serverNotFound")})]})}),J&&h&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Ro,{onSubmit:I,onCancel:j,modalTitle:p("cloud.installServer",{name:h.title||h.name}),formError:F,initialData:{name:h.name,status:"disconnected",config:{type:"streamable-http",url:h.server_url,headers:{Authorization:`Bearer ${g.apiKey||"<MCPROUTER_API_KEY>"}`,"HTTP-Referer":g.referer||"<YOUR_APP_URL>","X-Title":g.title||"<YOUR_APP_NAME>"}}}})})]})},Kv=({currentPage:s,totalPages:o,onPageChange:l})=>{const i=()=>{const d=[];d.push(r.jsx("button",{onClick:()=>l(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(r.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis1"));for(let p=m;p<=Math.min(o-1,m+5-3);p++)d.push(r.jsx("button",{onClick:()=>l(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(r.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis2")),o>1&&d.push(r.jsx("button",{onClick:()=>l(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:r.jsxs("div",{className:"flex justify-center items-center my-6",children:[r.jsx("button",{onClick:()=>l(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"}),r.jsx("div",{className:"flex",children:i()}),r.jsx("button",{onClick:()=>l(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 »"})]})},Dh=()=>{const{t:s}=Ee(),o=Ga(),{serverName:l}=ig(),{showToast:i}=Ys(),[d,f]=Gy(),m=d.get("tab")||"cloud",{servers:p,allServers:g,categories:h,loading:y,error:S,setError:w,searchServers:A,filterByCategory:C,filterByTag:k,selectedCategory:R,selectedTag:N,installServer:E,fetchServerByName:U,isServerInstalled:X,currentPage:L,totalPages:ee,changePage:ae,serversPerPage:K,changeServersPerPage:oe}=Bv(),{servers:de,allServers:z,loading:O,error:J,setError:$,fetchServerTools:F,callServerTool:T,currentPage:q,totalPages:Z,changePage:re,serversPerPage:j,changeServersPerPage:I}=Hv(),[le,B]=b.useState(null),[V,me]=b.useState(null),[W,Y]=b.useState(""),[ue,be]=b.useState(!1),[je,xe]=b.useState(new Set);b.useEffect(()=>{(async()=>{if(l)if(m==="cloud"){const ie=de.find(ce=>ce.name===l);ie?me(ie):o("/market?tab=cloud")}else{const ie=await U(l);ie?B(ie):o("/market?tab=local")}else B(null),me(null)})()},[l,m,de,U,o]);const Te=Se=>{const ie=new URLSearchParams(d);ie.set("tab",Se),f(ie),l&&o("/market?"+ie.toString())},Be=Se=>{Se.preventDefault(),m==="local"&&A(W)},st=Se=>{m==="local"&&C(Se)},wa=()=>{Y(""),m==="local"&&(C(""),k(""))},ca=Se=>{o(m==="cloud"?`/market/${Se.name}?tab=cloud`:`/market/${Se.name}?tab=local`)},De=()=>{o(`/market?tab=${m}`)},bt=async(Se,ie)=>{try{be(!0),await E(Se,ie)&&i(s("market.installSuccess",{serverName:Se.display_name}),"success")}finally{be(!1)}},ua=async(Se,ie)=>{try{be(!0);const ce={name:Se.name,config:ie},fe=await Vt("/servers",ce);if(!fe.success){const dt=(fe==null?void 0:fe.message)||s("server.addError");i(dt,"error");return}xe(dt=>new Set(dt).add(Se.name)),i(s("cloud.installSuccess",{name:Se.title||Se.name}),"success")}catch(ce){console.error("Error installing cloud server:",ce);const fe=ce instanceof Error?ce.message:String(ce);i(s("cloud.installError",{error:fe}),"error")}finally{be(!1)}},da=async(Se,ie,ce)=>{try{const fe=await T(Se,ie,ce);return i(s("cloud.toolCallSuccess",{toolName:ie}),"success"),fe}catch(fe){const dt=fe instanceof Error?fe.message:String(fe);throw Gt(dt)||i(s("cloud.toolCallError",{toolName:ie,error:dt}),"error"),fe}},Gt=Se=>Se==="MCPROUTER_API_KEY_NOT_CONFIGURED"||Se.toLowerCase().includes("mcprouter api key not configured"),fa=Se=>{m==="local"?ae(Se):re(Se),window.scrollTo({top:0,behavior:"smooth"})},gn=Se=>{const ie=parseInt(Se.target.value,10);m==="local"?oe(ie):I(ie)};if(le)return r.jsx(Pv,{server:le,onBack:De,onInstall:bt,installing:ue,isInstalled:X(le.name)});if(V)return r.jsx(Gv,{serverName:V.name,onBack:De,onCallTool:da,fetchServerTools:F,onInstall:ua,installing:ue,isInstalled:je.has(V.name)});const Ye=m==="local",pn=Ye?p:de,Ot=Ye?g:z,lt=Ye?h:[],kt=Ye?y:O,at=Ye?S:J,_n=Ye?w:$,Ka=Ye?R:"",Bn=Ye?N:"",zt=Ye?L:q,ja=Ye?ee:Z,vt=Ye?K:j;return r.jsxs("div",{children:[r.jsx("div",{className:"mb-6",children:r.jsx("div",{className:"border-b border-gray-200",children:r.jsxs("nav",{className:"-mb-px flex space-x-3",children:[r.jsxs("button",{onClick:()=>Te("cloud"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${Ye?"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300":"border-blue-500 text-blue-600"}`,children:[s("cloud.title"),r.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",r.jsx("a",{href:"https://mcprouter.co",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:"MCPRouter"}),")"]})]}),r.jsxs("button",{onClick:()=>Te("local"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${Ye?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[s("market.title"),r.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",r.jsx("a",{href:"https://mcpm.sh",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:"MCPM"}),")"]})]})]})})}),at&&r.jsx(r.Fragment,{children:!Ye&&Gt(at)?r.jsx(ou,{}):r.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("p",{children:at}),r.jsx("button",{onClick:()=>_n(null),className:"text-red-700 hover:text-red-900 transition-colors duration-200",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 01.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z",clipRule:"evenodd"})})})]})})}),Ye&&r.jsx("div",{className:"bg-white shadow rounded-lg p-6 mb-6 page-card",children:r.jsxs("form",{onSubmit:Be,className:"flex space-x-4 mb-0",children:[r.jsx("div",{className:"flex-grow",children:r.jsx("input",{type:"text",value:W,onChange:Se=>Y(Se.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"})}),r.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:s("market.search")}),(W||Ka||Bn)&&r.jsx("button",{type:"button",onClick:wa,className:"border border-gray-300 text-gray-700 font-medium py-2 px-4 rounded hover:bg-gray-50 btn-secondary transition-all duration-200",children:s("market.clearFilters")})]})}),r.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[Ye&&r.jsx("div",{className:"md:w-48 flex-shrink-0",children:r.jsx("div",{className:"bg-white shadow rounded-lg p-4 mb-6 sticky top-4 page-card",children:lt.length>0?r.jsxs("div",{className:"mb-6",children:[r.jsxs("div",{className:"flex justify-between items-center mb-3",children:[r.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")}),Ka&&r.jsx("span",{className:"text-xs text-blue-600 cursor-pointer hover:underline transition-colors duration-200",onClick:()=>C(""),children:s("market.clearCategoryFilter")})]}),r.jsx("div",{className:"flex flex-col gap-2",children:lt.map(Se=>r.jsx("button",{onClick:()=>st(Se),className:`px-3 py-2 rounded text-sm text-left transition-all duration-200 ${Ka===Se?"bg-blue-100 text-blue-800 font-medium btn-primary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-secondary"}`,children:Se},Se))})]}):kt?r.jsxs("div",{className:"mb-6",children:[r.jsx("div",{className:"mb-3",children:r.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")})}),r.jsxs("div",{className:"flex flex-col gap-2 items-center py-4 loading-container",children:[r.jsxs("svg",{className:"animate-spin h-6 w-6 text-blue-500 mb-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-sm text-gray-600",children:s("app.loading")})]})]}):r.jsxs("div",{className:"mb-6",children:[r.jsx("div",{className:"mb-3",children:r.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")})}),r.jsx("p",{className:"text-sm text-gray-600 py-2",children:s("market.noCategories")})]})})}),r.jsx("div",{className:"flex-grow",children:kt?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):pn.length===0?r.jsx("div",{className:"bg-white shadow rounded-lg p-6",children:r.jsx("p",{className:"text-gray-600",children:s(Ye?"market.noServers":"cloud.noServers")})}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:pn.map((Se,ie)=>Ye?r.jsx(qv,{server:Se,onClick:ca},ie):r.jsx(Vv,{server:Se,onClick:ca},ie))}),r.jsxs("div",{className:"flex justify-between items-center mb-4",children:[r.jsx("div",{className:"text-sm text-gray-500",children:Ye?s("market.showing",{from:(zt-1)*vt+1,to:Math.min(zt*vt,Ot.length),total:Ot.length}):s("cloud.showing",{from:(zt-1)*vt+1,to:Math.min(zt*vt,Ot.length),total:Ot.length})}),r.jsx(Kv,{currentPage:zt,totalPages:ja,onPageChange:fa}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-600",children:[s(Ye?"market.perPage":"cloud.perPage"),":"]}),r.jsxs("select",{id:"perPage",value:vt,onChange:gn,className:"border rounded p-1 text-sm btn-secondary outline-none",children:[r.jsx("option",{value:"6",children:"6"}),r.jsx("option",{value:"9",children:"9"}),r.jsx("option",{value:"12",children:"12"}),r.jsx("option",{value:"24",children:"24"})]})]})]}),r.jsx("div",{className:"mt-6"})]})})]})]})},$v={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"},Yv={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 Fv({variant:s="default",size:o="default",className:l,disabled:i,children:d,...f}){return r.jsx("button",{className:qa("rounded-md inline-flex items-center justify-center font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none",$v[s],Yv[o],l),disabled:i,...f,children:d})}const Xv=({logs:s,isLoading:o=!1,error:l=null,onClear:i})=>{const{t:d}=Ee(),f=b.useRef(null),[m,p]=b.useState(!0),[g,h]=b.useState(""),[y,S]=b.useState(["info","error","warn","debug"]),[w,A]=b.useState(["main","child"]);b.useEffect(()=>{m&&f.current&&(f.current.scrollTop=f.current.scrollHeight)},[s,m]);const C=s.filter(E=>{const U=g?E.message.toLowerCase().includes(g.toLowerCase()):!0,X=y.includes(E.type),L=w.includes(E.source);return U&&X&&L}),k=E=>new Date(E).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),R=E=>{switch(E){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"}},N=E=>{switch(E){case"main":return"bg-green-400/80 text-white";case"child":return"bg-orange-400/80 text-white";default:return"bg-gray-400/80 text-white"}};return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"bg-card p-3 rounded-t-md flex flex-wrap items-center justify-between gap-2",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("span",{className:"font-semibold text-sm",children:[d("logs.filters"),":"]}),r.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:E=>h(E.target.value)}),r.jsx("div",{className:"flex gap-1 items-center",children:["debug","info","error","warn"].map(E=>r.jsx(fo,{variant:y.includes(E)?"default":"outline",className:`cursor-pointer ${y.includes(E)?R(E):""}`,onClick:()=>{y.includes(E)?S(U=>U.filter(X=>X!==E)):S(U=>[...U,E])},children:E},E))}),r.jsx("div",{className:"flex gap-1 items-center ml-2",children:["main","child"].map(E=>r.jsx(fo,{variant:w.includes(E)?"default":"outline",className:`cursor-pointer ${w.includes(E)?N(E):""}`,onClick:()=>{w.includes(E)?A(U=>U.filter(X=>X!==E)):A(U=>[...U,E])},children:d(E==="main"?"logs.mainProcess":"logs.childProcess")},E))})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("label",{className:"flex items-center gap-1 text-sm",children:[r.jsx("input",{type:"checkbox",checked:m,onChange:()=>p(!m),className:"form-checkbox h-4 w-4"}),d("logs.autoScroll")]}),r.jsx(Fv,{variant:"outline",size:"sm",onClick:i,className:"btn-secondary",disabled:o||s.length===0,children:d("logs.clearLogs")})]})]}),r.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?r.jsx("div",{className:"flex justify-center items-center h-full",children:r.jsx("span",{children:d("logs.loading")})}):l?r.jsx("div",{className:"text-red-500 p-2",children:l.message}):C.length===0?r.jsx("div",{className:"text-center text-muted-foreground p-8",children:g||y.length<4||w.length<2?d("logs.noMatch"):d("logs.noLogs")}):C.map((E,U)=>r.jsxs("div",{className:`py-1 ${E.type==="error"?"text-red-500":E.type==="warn"?"text-yellow-500":""}`,children:[r.jsxs("span",{className:"text-gray-400",children:["[",k(E.timestamp),"]"]}),r.jsx(fo,{className:`ml-2 mr-1 ${R(E.type)}`,children:E.type}),r.jsxs(fo,{variant:"default",className:`mr-2 ${N(E.source)}`,children:[E.source==="main"?d("logs.main"):d("logs.child"),E.processId?` (${E.processId})`:""]}),r.jsx("span",{className:"whitespace-pre-wrap",children:E.message})]},`${E.timestamp}-${U}`))})]})},Qv=async()=>{try{const s=await vo("/logs");if(!s.success)throw new Error(s.error||"Failed to clear logs")}catch(s){throw console.error("Error clearing logs:",s),s}},Zv=()=>{const[s,o]=b.useState([]),[l,i]=b.useState(!0),[d,f]=b.useState(null);return b.useEffect(()=>{let p=null,g=!0;const h=()=>{try{p&&p.close();const y=Ks();p=new EventSource(yu(`/logs/stream?token=${y}`)),p.onmessage=S=>{if(g)try{const w=JSON.parse(S.data);w.type==="initial"?(o(w.logs),i(!1)):w.type==="log"&&o(A=>[...A,w.log])}catch(w){console.error("Error parsing SSE message:",w)}},p.onerror=()=>{g&&(p&&(p.close(),setTimeout(h,5e3)),f(new Error("Connection to log stream lost, attempting to reconnect...")))}}catch(y){if(!g)return;f(y instanceof Error?y:new Error("Failed to connect to log stream")),i(!1)}};return h(),()=>{g=!1,p&&p.close()}},[]),{logs:s,loading:l,error:d,clearLogs:async()=>{try{await Qv(),o([])}catch(p){f(p instanceof Error?p:new Error("Failed to clear logs"))}}}},Iv=()=>{const{t:s}=Ee(),{logs:o,loading:l,error:i,clearLogs:d}=Zv();return r.jsxs("div",{className:"container mx-auto p-4",children:[r.jsx("div",{className:"flex justify-between items-center mb-4",children:r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.logs.title")})}),r.jsx("div",{className:"bg-card rounded-md shadow-sm border border-gray-200 page-card",children:r.jsx(Xv,{logs:o,isLoading:l,error:i,onClear:d})})]})},Jv=()=>{const{serverName:s}=ig();return r.jsx(bo,{to:`/market/${s}?tab=cloud`,replace:!0})};function Lh(){const s=xu();return r.jsx(z1,{children:r.jsx(ob,{children:r.jsx(M1,{children:r.jsx(Hy,{basename:s,children:r.jsxs(hy,{children:[r.jsx(Et,{path:"/login",element:r.jsx(fv,{})}),r.jsx(Et,{element:r.jsx(dv,{}),children:r.jsxs(Et,{element:r.jsx(uv,{}),children:[r.jsx(Et,{path:"/",element:r.jsx(mv,{})}),r.jsx(Et,{path:"/servers",element:r.jsx(Av,{})}),r.jsx(Et,{path:"/groups",element:r.jsx(zv,{})}),r.jsx(Et,{path:"/users",element:r.jsx(Uv,{})}),r.jsx(Et,{path:"/market",element:r.jsx(Dh,{})}),r.jsx(Et,{path:"/market/:serverName",element:r.jsx(Dh,{})}),r.jsx(Et,{path:"/cloud",element:r.jsx(bo,{to:"/market?tab=cloud",replace:!0})}),r.jsx(Et,{path:"/cloud/:serverName",element:r.jsx(Jv,{})}),r.jsx(Et,{path:"/logs",element:r.jsx(Iv,{})}),r.jsx(Et,{path:"/settings",element:r.jsx(_v,{})})]})}),r.jsx(Et,{path:"*",element:r.jsx(bo,{to:"/"})})]})})})})})}const Ce=s=>typeof s=="string",_s=()=>{let s,o;const l=new Promise((i,d)=>{s=i,o=d});return l.resolve=s,l.reject=o,l},_h=s=>s==null?"":""+s,Wv=(s,o,l)=>{s.forEach(i=>{o[i]&&(l[i]=o[i])})},e2=/###/g,Bh=s=>s&&s.indexOf("###")>-1?s.replace(e2,"."):s,Hh=s=>!s||Ce(s),Bs=(s,o,l)=>{const i=Ce(o)?o.split("."):o;let d=0;for(;d<i.length-1;){if(Hh(s))return{};const f=Bh(i[d]);!s[f]&&l&&(s[f]=new l),Object.prototype.hasOwnProperty.call(s,f)?s=s[f]:s={},++d}return Hh(s)?{}:{obj:s,k:Bh(i[d])}},qh=(s,o,l)=>{const{obj:i,k:d}=Bs(s,o,Object);if(i!==void 0||o.length===1){i[d]=l;return}let f=o[o.length-1],m=o.slice(0,o.length-1),p=Bs(s,m,Object);for(;p.obj===void 0&&m.length;)f=`${m[m.length-1]}.${f}`,m=m.slice(0,m.length-1),p=Bs(s,m,Object),p!=null&&p.obj&&typeof p.obj[`${p.k}.${f}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${f}`]=l},t2=(s,o,l,i)=>{const{obj:d,k:f}=Bs(s,o,Object);d[f]=d[f]||[],d[f].push(l)},jo=(s,o)=>{const{obj:l,k:i}=Bs(s,o);if(l&&Object.prototype.hasOwnProperty.call(l,i))return l[i]},a2=(s,o,l)=>{const i=jo(s,l);return i!==void 0?i:jo(o,l)},Ig=(s,o,l)=>{for(const i in o)i!=="__proto__"&&i!=="constructor"&&(i in s?Ce(s[i])||s[i]instanceof String||Ce(o[i])||o[i]instanceof String?l&&(s[i]=o[i]):Ig(s[i],o[i],l):s[i]=o[i]);return s},Er=s=>s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var n2={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const r2=s=>Ce(s)?s.replace(/[&<>"'\/]/g,o=>n2[o]):s;class s2{constructor(o){this.capacity=o,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(o){const l=this.regExpMap.get(o);if(l!==void 0)return l;const i=new RegExp(o);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(o,i),this.regExpQueue.push(o),i}}const l2=[" ",",","?","!",";"],o2=new s2(20),i2=(s,o,l)=>{o=o||"",l=l||"";const i=l2.filter(m=>o.indexOf(m)<0&&l.indexOf(m)<0);if(i.length===0)return!0;const d=o2.getRegExp(`(${i.map(m=>m==="?"?"\\?":m).join("|")})`);let f=!d.test(s);if(!f){const m=s.indexOf(l);m>0&&!d.test(s.substring(0,m))&&(f=!0)}return f},iu=function(s,o){let l=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 i=o.split(l);let d=s;for(let f=0;f<i.length;){if(!d||typeof d!="object")return;let m,p="";for(let g=f;g<i.length;++g)if(g!==f&&(p+=l),p+=i[g],m=d[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<i.length-1)continue;f+=g-f+1;break}d=m}return d},No=s=>s==null?void 0:s.replace("_","-"),c2={type:"logger",log(s){this.output("log",s)},warn(s){this.output("warn",s)},error(s){this.output("error",s)},output(s,o){var l,i;(i=(l=console==null?void 0:console[s])==null?void 0:l.apply)==null||i.call(l,console,o)}};class So{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(o,l)}init(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=l.prefix||"i18next:",this.logger=o||c2,this.options=l,this.debug=l.debug}log(){for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return this.forward(l,"log","",!0)}warn(){for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return this.forward(l,"warn","",!0)}error(){for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return this.forward(l,"error","")}deprecate(){for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return this.forward(l,"warn","WARNING DEPRECATED: ",!0)}forward(o,l,i,d){return d&&!this.debug?null:(Ce(o[0])&&(o[0]=`${i}${this.prefix} ${o[0]}`),this.logger[l](o))}create(o){return new So(this.logger,{prefix:`${this.prefix}:${o}:`,...this.options})}clone(o){return o=o||this.options,o.prefix=o.prefix||this.prefix,new So(this.logger,o)}}var va=new So;class Mo{constructor(){this.observers={}}on(o,l){return o.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const d=this.observers[i].get(l)||0;this.observers[i].set(l,d+1)}),this}off(o,l){if(this.observers[o]){if(!l){delete this.observers[o];return}this.observers[o].delete(l)}}emit(o){for(var l=arguments.length,i=new Array(l>1?l-1:0),d=1;d<l;d++)i[d-1]=arguments[d];this.observers[o]&&Array.from(this.observers[o].entries()).forEach(m=>{let[p,g]=m;for(let h=0;h<g;h++)p(...i)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(m=>{let[p,g]=m;for(let h=0;h<g;h++)p.apply(p,[o,...i])})}}class Ph extends Mo{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=o||{},this.options=l,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}removeNamespaces(o){const l=this.options.ns.indexOf(o);l>-1&&this.options.ns.splice(l,1)}getResource(o,l,i){var h,y;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator,m=d.ignoreJSONStructure!==void 0?d.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;o.indexOf(".")>-1?p=o.split("."):(p=[o,l],i&&(Array.isArray(i)?p.push(...i):Ce(i)&&f?p.push(...i.split(f)):p.push(i)));const g=jo(this.data,p);return!g&&!l&&!i&&o.indexOf(".")>-1&&(o=p[0],l=p[1],i=p.slice(2).join(".")),g||!m||!Ce(i)?g:iu((y=(h=this.data)==null?void 0:h[o])==null?void 0:y[l],i,f)}addResource(o,l,i,d){let f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const m=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let p=[o,l];i&&(p=p.concat(m?i.split(m):i)),o.indexOf(".")>-1&&(p=o.split("."),d=l,l=p[1]),this.addNamespaces(l),qh(this.data,p,d),f.silent||this.emit("added",o,l,i,d)}addResources(o,l,i){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const f in i)(Ce(i[f])||Array.isArray(i[f]))&&this.addResource(o,l,f,i[f],{silent:!0});d.silent||this.emit("added",o,l,i)}addResourceBundle(o,l,i,d,f){let m=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},p=[o,l];o.indexOf(".")>-1&&(p=o.split("."),d=i,i=l,l=p[1]),this.addNamespaces(l);let g=jo(this.data,p)||{};m.skipCopy||(i=JSON.parse(JSON.stringify(i))),d?Ig(g,i,f):g={...g,...i},qh(this.data,p,g),m.silent||this.emit("added",o,l,i)}removeResourceBundle(o,l){this.hasResourceBundle(o,l)&&delete this.data[o][l],this.removeNamespaces(l),this.emit("removed",o,l)}hasResourceBundle(o,l){return this.getResource(o,l)!==void 0}getResourceBundle(o,l){return l||(l=this.options.defaultNS),this.getResource(o,l)}getDataByLanguage(o){return this.data[o]}hasLanguageSomeTranslations(o){const l=this.getDataByLanguage(o);return!!(l&&Object.keys(l)||[]).find(d=>l[d]&&Object.keys(l[d]).length>0)}toJSON(){return this.data}}var Jg={processors:{},addPostProcessor(s){this.processors[s.name]=s},handle(s,o,l,i,d){return s.forEach(f=>{var m;o=((m=this.processors[f])==null?void 0:m.process(o,l,i,d))??o}),o}};const Vh={},Gh=s=>!Ce(s)&&typeof s!="boolean"&&typeof s!="number";class Co extends Mo{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Wv(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],o,this),this.options=l,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=va.create("translator")}changeLanguage(o){o&&(this.language=o)}exists(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;const i=this.resolve(o,l);return(i==null?void 0:i.res)!==void 0}extractFromKey(o,l){let i=l.nsSeparator!==void 0?l.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const d=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let f=l.ns||this.options.defaultNS||[];const m=i&&o.indexOf(i)>-1,p=!this.options.userDefinedKeySeparator&&!l.keySeparator&&!this.options.userDefinedNsSeparator&&!l.nsSeparator&&!i2(o,i,d);if(m&&!p){const g=o.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:o,namespaces:Ce(f)?[f]:f};const h=o.split(i);(i!==d||i===d&&this.options.ns.indexOf(h[0])>-1)&&(f=h.shift()),o=h.join(d)}return{key:o,namespaces:Ce(f)?[f]:f}}translate(o,l,i){if(typeof l!="object"&&this.options.overloadTranslationOptionHandler&&(l=this.options.overloadTranslationOptionHandler(arguments)),typeof l=="object"&&(l={...l}),l||(l={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);const d=l.returnDetails!==void 0?l.returnDetails:this.options.returnDetails,f=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,{key:m,namespaces:p}=this.extractFromKey(o[o.length-1],l),g=p[p.length-1],h=l.lng||this.language,y=l.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode"){if(y){const z=l.nsSeparator||this.options.nsSeparator;return d?{res:`${g}${z}${m}`,usedKey:m,exactUsedKey:m,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(l)}:`${g}${z}${m}`}return d?{res:m,usedKey:m,exactUsedKey:m,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(l)}:m}const S=this.resolve(o,l);let w=S==null?void 0:S.res;const A=(S==null?void 0:S.usedKey)||m,C=(S==null?void 0:S.exactUsedKey)||m,k=["[object Number]","[object Function]","[object RegExp]"],R=l.joinArrays!==void 0?l.joinArrays:this.options.joinArrays,N=!this.i18nFormat||this.i18nFormat.handleAsObject,E=l.count!==void 0&&!Ce(l.count),U=Co.hasDefaultValue(l),X=E?this.pluralResolver.getSuffix(h,l.count,l):"",L=l.ordinal&&E?this.pluralResolver.getSuffix(h,l.count,{ordinal:!1}):"",ee=E&&!l.ordinal&&l.count===0,ae=ee&&l[`defaultValue${this.options.pluralSeparator}zero`]||l[`defaultValue${X}`]||l[`defaultValue${L}`]||l.defaultValue;let K=w;N&&!w&&U&&(K=ae);const oe=Gh(K),de=Object.prototype.toString.apply(K);if(N&&K&&oe&&k.indexOf(de)<0&&!(Ce(R)&&Array.isArray(K))){if(!l.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const z=this.options.returnedObjectHandler?this.options.returnedObjectHandler(A,K,{...l,ns:p}):`key '${m} (${this.language})' returned an object instead of string.`;return d?(S.res=z,S.usedParams=this.getUsedParamsDetails(l),S):z}if(f){const z=Array.isArray(K),O=z?[]:{},J=z?C:A;for(const $ in K)if(Object.prototype.hasOwnProperty.call(K,$)){const F=`${J}${f}${$}`;U&&!w?O[$]=this.translate(F,{...l,defaultValue:Gh(ae)?ae[$]:void 0,joinArrays:!1,ns:p}):O[$]=this.translate(F,{...l,joinArrays:!1,ns:p}),O[$]===F&&(O[$]=K[$])}w=O}}else if(N&&Ce(R)&&Array.isArray(w))w=w.join(R),w&&(w=this.extendTranslation(w,o,l,i));else{let z=!1,O=!1;!this.isValidLookup(w)&&U&&(z=!0,w=ae),this.isValidLookup(w)||(O=!0,w=m);const $=(l.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&O?void 0:w,F=U&&ae!==w&&this.options.updateMissing;if(O||z||F){if(this.logger.log(F?"updateKey":"missingKey",h,g,m,F?ae:w),f){const re=this.resolve(m,{...l,keySeparator:!1});re&&re.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 T=[];const q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,l.lng||this.language);if(this.options.saveMissingTo==="fallback"&&q&&q[0])for(let re=0;re<q.length;re++)T.push(q[re]);else this.options.saveMissingTo==="all"?T=this.languageUtils.toResolveHierarchy(l.lng||this.language):T.push(l.lng||this.language);const Z=(re,j,I)=>{var B;const le=U&&I!==w?I:$;this.options.missingKeyHandler?this.options.missingKeyHandler(re,g,j,le,F,l):(B=this.backendConnector)!=null&&B.saveMissing&&this.backendConnector.saveMissing(re,g,j,le,F,l),this.emit("missingKey",re,g,j,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?T.forEach(re=>{const j=this.pluralResolver.getSuffixes(re,l);ee&&l[`defaultValue${this.options.pluralSeparator}zero`]&&j.indexOf(`${this.options.pluralSeparator}zero`)<0&&j.push(`${this.options.pluralSeparator}zero`),j.forEach(I=>{Z([re],m+I,l[`defaultValue${I}`]||ae)})}):Z(T,m,ae))}w=this.extendTranslation(w,o,l,S,i),O&&w===m&&this.options.appendNamespaceToMissingKey&&(w=`${g}:${m}`),(O||z)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}:${m}`:m,z?w:void 0))}return d?(S.res=w,S.usedParams=this.getUsedParamsDetails(l),S):w}extendTranslation(o,l,i,d,f){var h,y;var m=this;if((h=this.i18nFormat)!=null&&h.parse)o=this.i18nFormat.parse(o,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||d.usedLng,d.usedNS,d.usedKey,{resolved:d});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const S=Ce(o)&&(((y=i==null?void 0:i.interpolation)==null?void 0:y.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let w;if(S){const C=o.match(this.interpolator.nestingRegexp);w=C&&C.length}let A=i.replace&&!Ce(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(A={...this.options.interpolation.defaultVariables,...A}),o=this.interpolator.interpolate(o,A,i.lng||this.language||d.usedLng,i),S){const C=o.match(this.interpolator.nestingRegexp),k=C&&C.length;w<k&&(i.nest=!1)}!i.lng&&d&&d.res&&(i.lng=this.language||d.usedLng),i.nest!==!1&&(o=this.interpolator.nest(o,function(){for(var C=arguments.length,k=new Array(C),R=0;R<C;R++)k[R]=arguments[R];return(f==null?void 0:f[0])===k[0]&&!i.context?(m.logger.warn(`It seems you are nesting recursively key: ${k[0]} in key: ${l[0]}`),null):m.translate(...k,l)},i)),i.interpolation&&this.interpolator.reset()}const p=i.postProcess||this.options.postProcess,g=Ce(p)?[p]:p;return o!=null&&(g!=null&&g.length)&&i.applyPostProcessor!==!1&&(o=Jg.handle(g,o,l,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...d,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),o}resolve(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i,d,f,m,p;return Ce(o)&&(o=[o]),o.forEach(g=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(g,l),y=h.key;d=y;let S=h.namespaces;this.options.fallbackNS&&(S=S.concat(this.options.fallbackNS));const w=l.count!==void 0&&!Ce(l.count),A=w&&!l.ordinal&&l.count===0,C=l.context!==void 0&&(Ce(l.context)||typeof l.context=="number")&&l.context!=="",k=l.lngs?l.lngs:this.languageUtils.toResolveHierarchy(l.lng||this.language,l.fallbackLng);S.forEach(R=>{var N,E;this.isValidLookup(i)||(p=R,!Vh[`${k[0]}-${R}`]&&((N=this.utils)!=null&&N.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(p))&&(Vh[`${k[0]}-${R}`]=!0,this.logger.warn(`key "${d}" for languages "${k.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!!!")),k.forEach(U=>{var ee;if(this.isValidLookup(i))return;m=U;const X=[y];if((ee=this.i18nFormat)!=null&&ee.addLookupKeys)this.i18nFormat.addLookupKeys(X,y,U,R,l);else{let ae;w&&(ae=this.pluralResolver.getSuffix(U,l.count,l));const K=`${this.options.pluralSeparator}zero`,oe=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(w&&(X.push(y+ae),l.ordinal&&ae.indexOf(oe)===0&&X.push(y+ae.replace(oe,this.options.pluralSeparator)),A&&X.push(y+K)),C){const de=`${y}${this.options.contextSeparator}${l.context}`;X.push(de),w&&(X.push(de+ae),l.ordinal&&ae.indexOf(oe)===0&&X.push(de+ae.replace(oe,this.options.pluralSeparator)),A&&X.push(de+K))}}let L;for(;L=X.pop();)this.isValidLookup(i)||(f=L,i=this.getResource(U,R,L,l))}))})}),{res:i,usedKey:d,exactUsedKey:f,usedLng:m,usedNS:p}}isValidLookup(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}getResource(o,l,i){var f;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(f=this.i18nFormat)!=null&&f.getResource?this.i18nFormat.getResource(o,l,i,d):this.resourceStore.getResource(o,l,i,d)}getUsedParamsDetails(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const l=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=o.replace&&!Ce(o.replace);let d=i?o.replace:o;if(i&&typeof o.count<"u"&&(d.count=o.count),this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),!i){d={...d};for(const f of l)delete d[f]}return d}static hasDefaultValue(o){const l="defaultValue";for(const i in o)if(Object.prototype.hasOwnProperty.call(o,i)&&l===i.substring(0,l.length)&&o[i]!==void 0)return!0;return!1}}class Kh{constructor(o){this.options=o,this.supportedLngs=this.options.supportedLngs||!1,this.logger=va.create("languageUtils")}getScriptPartFromCode(o){if(o=No(o),!o||o.indexOf("-")<0)return null;const l=o.split("-");return l.length===2||(l.pop(),l[l.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(l.join("-"))}getLanguagePartFromCode(o){if(o=No(o),!o||o.indexOf("-")<0)return o;const l=o.split("-");return this.formatLanguageCode(l[0])}formatLanguageCode(o){if(Ce(o)&&o.indexOf("-")>-1){let l;try{l=Intl.getCanonicalLocales(o)[0]}catch{}return l&&this.options.lowerCaseLng&&(l=l.toLowerCase()),l||(this.options.lowerCaseLng?o.toLowerCase():o)}return this.options.cleanCode||this.options.lowerCaseLng?o.toLowerCase():o}isSupportedCode(o){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(o=this.getLanguagePartFromCode(o)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(o)>-1}getBestMatchFromCodes(o){if(!o)return null;let l;return o.forEach(i=>{if(l)return;const d=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(d))&&(l=d)}),!l&&this.options.supportedLngs&&o.forEach(i=>{if(l)return;const d=this.getLanguagePartFromCode(i);if(this.isSupportedCode(d))return l=d;l=this.options.supportedLngs.find(f=>{if(f===d)return f;if(!(f.indexOf("-")<0&&d.indexOf("-")<0)&&(f.indexOf("-")>0&&d.indexOf("-")<0&&f.substring(0,f.indexOf("-"))===d||f.indexOf(d)===0&&d.length>1))return f})}),l||(l=this.getFallbackCodes(this.options.fallbackLng)[0]),l}getFallbackCodes(o,l){if(!o)return[];if(typeof o=="function"&&(o=o(l)),Ce(o)&&(o=[o]),Array.isArray(o))return o;if(!l)return o.default||[];let i=o[l];return i||(i=o[this.getScriptPartFromCode(l)]),i||(i=o[this.formatLanguageCode(l)]),i||(i=o[this.getLanguagePartFromCode(l)]),i||(i=o.default),i||[]}toResolveHierarchy(o,l){const i=this.getFallbackCodes(l||this.options.fallbackLng||[],o),d=[],f=m=>{m&&(this.isSupportedCode(m)?d.push(m):this.logger.warn(`rejecting language code not found in supportedLngs: ${m}`))};return Ce(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))):Ce(o)&&f(this.formatLanguageCode(o)),i.forEach(m=>{d.indexOf(m)<0&&f(this.formatLanguageCode(m))}),d}}const $h={zero:0,one:1,two:2,few:3,many:4,other:5},Yh={select:s=>s===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class u2{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=o,this.options=l,this.logger=va.create("pluralResolver"),this.pluralRulesCache={}}addRule(o,l){this.rules[o]=l}clearCache(){this.pluralRulesCache={}}getRule(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=No(o==="dev"?"en":o),d=l.ordinal?"ordinal":"cardinal",f=JSON.stringify({cleanedCode:i,type:d});if(f in this.pluralRulesCache)return this.pluralRulesCache[f];let m;try{m=new Intl.PluralRules(i,{type:d})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Yh;if(!o.match(/-|_/))return Yh;const g=this.languageUtils.getLanguagePartFromCode(o);m=this.getRule(g,l)}return this.pluralRulesCache[f]=m,m}needsPlural(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(o,l);return i||(i=this.getRule("dev",l)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(o,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(o,i).map(d=>`${l}${d}`)}getSuffixes(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(o,l);return i||(i=this.getRule("dev",l)),i?i.resolvedOptions().pluralCategories.sort((d,f)=>$h[d]-$h[f]).map(d=>`${this.options.prepend}${l.ordinal?`ordinal${this.options.prepend}`:""}${d}`):[]}getSuffix(o,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const d=this.getRule(o,i);return d?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${d.select(l)}`:(this.logger.warn(`no plural rule found for: ${o}`),this.getSuffix("dev",l,i))}}const Fh=function(s,o,l){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,f=a2(s,o,l);return!f&&d&&Ce(l)&&(f=iu(s,l,i),f===void 0&&(f=iu(o,l,i))),f},Zc=s=>s.replace(/\$/g,"$$$$");class d2{constructor(){var l;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=va.create("interpolator"),this.options=o,this.format=((l=o==null?void 0:o.interpolation)==null?void 0:l.format)||(i=>i),this.init(o)}init(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};o.interpolation||(o.interpolation={escapeValue:!0});const{escape:l,escapeValue:i,useRawValueToEscape:d,prefix:f,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:y,unescapePrefix:S,nestingPrefix:w,nestingPrefixEscaped:A,nestingSuffix:C,nestingSuffixEscaped:k,nestingOptionsSeparator:R,maxReplaces:N,alwaysFormat:E}=o.interpolation;this.escape=l!==void 0?l:r2,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=d!==void 0?d:!1,this.prefix=f?Er(f):m||"{{",this.suffix=p?Er(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=y?"":S||"-",this.unescapeSuffix=this.unescapePrefix?"":y||"",this.nestingPrefix=w?Er(w):A||Er("$t("),this.nestingSuffix=C?Er(C):k||Er(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=N||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const o=(l,i)=>(l==null?void 0:l.source)===i?(l.lastIndex=0,l):new RegExp(i,"g");this.regexp=o(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=o(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=o(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(o,l,i,d){var A;let f,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=C=>{if(C.indexOf(this.formatSeparator)<0){const E=Fh(l,g,C,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,i,{...d,...l,interpolationkey:C}):E}const k=C.split(this.formatSeparator),R=k.shift().trim(),N=k.join(this.formatSeparator).trim();return this.format(Fh(l,g,R,this.options.keySeparator,this.options.ignoreJSONStructure),N,i,{...d,...l,interpolationkey:R})};this.resetRegExp();const y=(d==null?void 0:d.missingInterpolationHandler)||this.options.missingInterpolationHandler,S=((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:C=>Zc(C)},{regex:this.regexp,safeValue:C=>this.escapeValue?Zc(this.escape(C)):Zc(C)}].forEach(C=>{for(p=0;f=C.regex.exec(o);){const k=f[1].trim();if(m=h(k),m===void 0)if(typeof y=="function"){const N=y(o,f,d);m=Ce(N)?N:""}else if(d&&Object.prototype.hasOwnProperty.call(d,k))m="";else if(S){m=f[0];continue}else this.logger.warn(`missed to pass in variable ${k} for interpolating ${o}`),m="";else!Ce(m)&&!this.useRawValueToEscape&&(m=_h(m));const R=C.safeValue(m);if(o=o.replace(f[0],R),S?(C.regex.lastIndex+=m.length,C.regex.lastIndex-=f[0].length):C.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),o}nest(o,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d,f,m;const p=(g,h)=>{const y=this.nestingOptionsSeparator;if(g.indexOf(y)<0)return g;const S=g.split(new RegExp(`${y}[ ]*{`));let w=`{${S[1]}`;g=S[0],w=this.interpolate(w,m);const A=w.match(/'/g),C=w.match(/"/g);(((A==null?void 0:A.length)??0)%2===0&&!C||C.length%2!==0)&&(w=w.replace(/'/g,'"'));try{m=JSON.parse(w),h&&(m={...h,...m})}catch(k){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,k),`${g}${y}${w}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;d=this.nestingRegexp.exec(o);){let g=[];m={...i},m=m.replace&&!Ce(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(S=>S.trim());d[1]=y.shift(),g=y,h=!0}if(f=l(p.call(this,d[1].trim(),m),m),f&&d[0]===o&&!Ce(f))return f;Ce(f)||(f=_h(f)),f||(this.logger.warn(`missed to resolve ${d[1]} for nesting ${o}`),f=""),h&&(f=g.reduce((y,S)=>this.format(y,S,i.lng,{...i,interpolationkey:d[1].trim()}),f.trim())),o=o.replace(d[0],f),this.regexp.lastIndex=0}return o}}const f2=s=>{let o=s.toLowerCase().trim();const l={};if(s.indexOf("(")>-1){const i=s.split("(");o=i[0].toLowerCase().trim();const d=i[1].substring(0,i[1].length-1);o==="currency"&&d.indexOf(":")<0?l.currency||(l.currency=d.trim()):o==="relativetime"&&d.indexOf(":")<0?l.range||(l.range=d.trim()):d.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),y=p.trim();l[y]||(l[y]=h),h==="false"&&(l[y]=!1),h==="true"&&(l[y]=!0),isNaN(h)||(l[y]=parseInt(h,10))}})}return{formatName:o,formatOptions:l}},kr=s=>{const o={};return(l,i,d)=>{let f=d;d&&d.interpolationkey&&d.formatParams&&d.formatParams[d.interpolationkey]&&d[d.interpolationkey]&&(f={...f,[d.interpolationkey]:void 0});const m=i+JSON.stringify(f);let p=o[m];return p||(p=s(No(i),d),o[m]=p),p(l)}};class m2{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=va.create("formatter"),this.options=o,this.formats={number:kr((l,i)=>{const d=new Intl.NumberFormat(l,{...i});return f=>d.format(f)}),currency:kr((l,i)=>{const d=new Intl.NumberFormat(l,{...i,style:"currency"});return f=>d.format(f)}),datetime:kr((l,i)=>{const d=new Intl.DateTimeFormat(l,{...i});return f=>d.format(f)}),relativetime:kr((l,i)=>{const d=new Intl.RelativeTimeFormat(l,{...i});return f=>d.format(f,i.range||"day")}),list:kr((l,i)=>{const d=new Intl.ListFormat(l,{...i});return f=>d.format(f)})},this.init(o)}init(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=l.interpolation.formatSeparator||","}add(o,l){this.formats[o.toLowerCase().trim()]=l}addCached(o,l){this.formats[o.toLowerCase().trim()]=kr(l)}format(o,l,i){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f=l.split(this.formatSeparator);if(f.length>1&&f[0].indexOf("(")>1&&f[0].indexOf(")")<0&&f.find(p=>p.indexOf(")")>-1)){const p=f.findIndex(g=>g.indexOf(")")>-1);f[0]=[f[0],...f.splice(1,p)].join(this.formatSeparator)}return f.reduce((p,g)=>{var S;const{formatName:h,formatOptions:y}=f2(g);if(this.formats[h]){let w=p;try{const A=((S=d==null?void 0:d.formatParams)==null?void 0:S[d.interpolationkey])||{},C=A.locale||A.lng||d.locale||d.lng||i;w=this.formats[h](p,C,{...y,...d,...A})}catch(A){this.logger.warn(A)}return w}else this.logger.warn(`there was no format function for ${h}`);return p},o)}}const h2=(s,o)=>{s.pending[o]!==void 0&&(delete s.pending[o],s.pendingCount--)};class g2 extends Mo{constructor(o,l,i){var f,m;let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=o,this.store=l,this.services=i,this.languageUtils=i.languageUtils,this.options=d,this.logger=va.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=d.maxParallelReads||10,this.readingCalls=0,this.maxRetries=d.maxRetries>=0?d.maxRetries:5,this.retryTimeout=d.retryTimeout>=1?d.retryTimeout:350,this.state={},this.queue=[],(m=(f=this.backend)==null?void 0:f.init)==null||m.call(f,i,d.backend,d)}queueLoad(o,l,i,d){const f={},m={},p={},g={};return o.forEach(h=>{let y=!0;l.forEach(S=>{const w=`${h}|${S}`;!i.reload&&this.store.hasResourceBundle(h,S)?this.state[w]=2:this.state[w]<0||(this.state[w]===1?m[w]===void 0&&(m[w]=!0):(this.state[w]=1,y=!1,m[w]===void 0&&(m[w]=!0),f[w]===void 0&&(f[w]=!0),g[S]===void 0&&(g[S]=!0)))}),y||(p[h]=!0)}),(Object.keys(f).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:d}),{toLoad:Object.keys(f),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(o,l,i){const d=o.split("|"),f=d[0],m=d[1];l&&this.emit("failedLoading",f,m,l),!l&&i&&this.store.addResourceBundle(f,m,i,void 0,void 0,{skipCopy:!0}),this.state[o]=l?-1:2,l&&i&&(this.state[o]=0);const p={};this.queue.forEach(g=>{t2(g.loaded,[f],m),h2(g,o),l&&g.errors.push(l),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const y=g.loaded[h];y.length&&y.forEach(S=>{p[h][S]===void 0&&(p[h][S]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",p),this.queue=this.queue.filter(g=>!g.done)}read(o,l,i){let d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,m=arguments.length>5?arguments[5]:void 0;if(!o.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:l,fcName:i,tried:d,wait:f,callback:m});return}this.readingCalls++;const p=(h,y)=>{if(this.readingCalls--,this.waitingReads.length>0){const S=this.waitingReads.shift();this.read(S.lng,S.ns,S.fcName,S.tried,S.wait,S.callback)}if(h&&y&&d<this.maxRetries){setTimeout(()=>{this.read.call(this,o,l,i,d+1,f*2,m)},f);return}m(h,y)},g=this.backend[i].bind(this.backend);if(g.length===2){try{const h=g(o,l);h&&typeof h.then=="function"?h.then(y=>p(null,y)).catch(p):p(null,h)}catch(h){p(h)}return}return g(o,l,p)}prepareLoading(o,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),d&&d();Ce(o)&&(o=this.languageUtils.toResolveHierarchy(o)),Ce(l)&&(l=[l]);const f=this.queueLoad(o,l,i,d);if(!f.toLoad.length)return f.pending.length||d(),null;f.toLoad.forEach(m=>{this.loadOne(m)})}load(o,l,i){this.prepareLoading(o,l,{},i)}reload(o,l,i){this.prepareLoading(o,l,{reload:!0},i)}loadOne(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const i=o.split("|"),d=i[0],f=i[1];this.read(d,f,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${l}loading namespace ${f} for language ${d} failed`,m),!m&&p&&this.logger.log(`${l}loaded namespace ${f} for language ${d}`,p),this.loaded(o,m,p)})}saveMissing(o,l,i,d,f){var g,h,y,S,w;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&&!((S=(y=this.services)==null?void 0:y.utils)!=null&&S.hasLoadedNamespace(l))){this.logger.warn(`did not save key "${i}" as the namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((w=this.backend)!=null&&w.create){const A={...m,isUpdate:f},C=this.backend.create.bind(this.backend);if(C.length<6)try{let k;C.length===5?k=C(o,l,i,d,A):k=C(o,l,i,d),k&&typeof k.then=="function"?k.then(R=>p(null,R)).catch(p):p(null,k)}catch(k){p(k)}else C(o,l,i,d,p,A)}!o||!o[0]||this.store.addResource(o[0],l,i,d)}}}const Xh=()=>({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]),Ce(s[1])&&(o.defaultValue=s[1]),Ce(s[2])&&(o.tDescription=s[2]),typeof s[2]=="object"||typeof s[3]=="object"){const l=s[3]||s[2];Object.keys(l).forEach(i=>{o[i]=l[i]})}return o},interpolation:{escapeValue:!0,format:s=>s,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Qh=s=>{var o,l;return Ce(s.ns)&&(s.ns=[s.ns]),Ce(s.fallbackLng)&&(s.fallbackLng=[s.fallbackLng]),Ce(s.fallbackNS)&&(s.fallbackNS=[s.fallbackNS]),((l=(o=s.supportedLngs)==null?void 0:o.indexOf)==null?void 0:l.call(o,"cimode"))<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),typeof s.initImmediate=="boolean"&&(s.initAsync=s.initImmediate),s},ho=()=>{},p2=s=>{Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(l=>{typeof s[l]=="function"&&(s[l]=s[l].bind(s))})};class Ps extends Mo{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Qh(o),this.services={},this.logger=va,this.modules={external:[]},p2(this),l&&!this.isInitialized&&!o.isClone){if(!this.options.initAsync)return this.init(o,l),this;setTimeout(()=>{this.init(o,l)},0)}}init(){var o=this;let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof l=="function"&&(i=l,l={}),l.defaultNS==null&&l.ns&&(Ce(l.ns)?l.defaultNS=l.ns:l.ns.indexOf("translation")<0&&(l.defaultNS=l.ns[0]));const d=Xh();this.options={...d,...this.options,...Qh(l)},this.options.interpolation={...d.interpolation,...this.options.interpolation},l.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=l.keySeparator),l.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=l.nsSeparator);const f=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?va.init(f(this.modules.logger),this.options):va.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=m2;const S=new Kh(this.options);this.store=new Ph(this.options.resources,this.options);const w=this.services;w.logger=va,w.resourceStore=this.store,w.languageUtils=S,w.pluralResolver=new u2(S,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),y&&(!this.options.interpolation.format||this.options.interpolation.format===d.interpolation.format)&&(w.formatter=f(y),w.formatter.init(w,this.options),this.options.interpolation.format=w.formatter.format.bind(w.formatter)),w.interpolator=new d2(this.options),w.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},w.backendConnector=new g2(f(this.modules.backend),w.resourceStore,w,this.options),w.backendConnector.on("*",function(A){for(var C=arguments.length,k=new Array(C>1?C-1:0),R=1;R<C;R++)k[R-1]=arguments[R];o.emit(A,...k)}),this.modules.languageDetector&&(w.languageDetector=f(this.modules.languageDetector),w.languageDetector.init&&w.languageDetector.init(w,this.options.detection,this.options)),this.modules.i18nFormat&&(w.i18nFormat=f(this.modules.i18nFormat),w.i18nFormat.init&&w.i18nFormat.init(this)),this.translator=new Co(this.services,this.options),this.translator.on("*",function(A){for(var C=arguments.length,k=new Array(C>1?C-1:0),R=1;R<C;R++)k[R-1]=arguments[R];o.emit(A,...k)}),this.modules.external.forEach(A=>{A.init&&A.init(this)})}if(this.format=this.options.interpolation.format,i||(i=ho),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.length>0&&y[0]!=="dev"&&(this.options.lng=y[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(y=>{this[y]=function(){return o.store[y](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=function(){return o.store[y](...arguments),o}});const g=_s(),h=()=>{const y=(S,w)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),g.resolve(w),i(S,w)};if(this.languages&&!this.isInitialized)return y(null,this.t.bind(this));this.changeLanguage(this.options.lng,y)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),g}loadResources(o){var f,m;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ho;const d=Ce(o)?o:this.language;if(typeof o=="function"&&(i=o),!this.options.resources||this.options.partialBundledLanguages){if((d==null?void 0:d.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const p=[],g=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(S=>{S!=="cimode"&&p.indexOf(S)<0&&p.push(S)})};d?g(d):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(y=>g(y)),(m=(f=this.options.preload)==null?void 0:f.forEach)==null||m.call(f,h=>g(h)),this.services.backendConnector.load(p,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(h)})}else i(null)}reloadResources(o,l,i){const d=_s();return typeof o=="function"&&(i=o,o=void 0),typeof l=="function"&&(i=l,l=void 0),o||(o=this.languages),l||(l=this.options.ns),i||(i=ho),this.services.backendConnector.reload(o,l,f=>{d.resolve(),i(f)}),d}use(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&Jg.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}setResolvedLanguage(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(let l=0;l<this.languages.length;l++){const i=this.languages[l];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}changeLanguage(o,l){var i=this;this.isLanguageChangingTo=o;const d=_s();this.emit("languageChanging",o);const f=g=>{this.language=g,this.languages=this.services.languageUtils.toResolveHierarchy(g),this.resolvedLanguage=void 0,this.setResolvedLanguage(g)},m=(g,h)=>{h?(f(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,d.resolve(function(){return i.t(...arguments)}),l&&l(g,function(){return i.t(...arguments)})},p=g=>{var y,S;!o&&!g&&this.services.languageDetector&&(g=[]);const h=Ce(g)?g:this.services.languageUtils.getBestMatchFromCodes(g);h&&(this.language||f(h),this.translator.language||this.translator.changeLanguage(h),(S=(y=this.services.languageDetector)==null?void 0:y.cacheUserLanguage)==null||S.call(y,h)),this.loadResources(h,w=>{m(w,h)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?p(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(p):this.services.languageDetector.detect(p):p(o),d}getFixedT(o,l,i){var d=this;const f=function(m,p){let g;if(typeof p!="object"){for(var h=arguments.length,y=new Array(h>2?h-2:0),S=2;S<h;S++)y[S-2]=arguments[S];g=d.options.overloadTranslationOptionHandler([m,p].concat(y))}else g={...p};g.lng=g.lng||f.lng,g.lngs=g.lngs||f.lngs,g.ns=g.ns||f.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||i||f.keyPrefix);const w=d.options.keySeparator||".";let A;return g.keyPrefix&&Array.isArray(m)?A=m.map(C=>`${g.keyPrefix}${w}${C}`):A=g.keyPrefix?`${g.keyPrefix}${w}${m}`:m,d.t(A,g)};return Ce(o)?f.lng=o:f.lngs=o,f.ns=l,f.keyPrefix=i,f}t(){var d;for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return(d=this.translator)==null?void 0:d.translate(...l)}exists(){var d;for(var o=arguments.length,l=new Array(o),i=0;i<o;i++)l[i]=arguments[i];return(d=this.translator)==null?void 0:d.exists(...l)}setDefaultNamespace(o){this.options.defaultNS=o}hasLoadedNamespace(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=l.lng||this.resolvedLanguage||this.languages[0],d=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const m=(p,g)=>{const h=this.services.backendConnector.state[`${p}|${g}`];return h===-1||h===0||h===2};if(l.precheck){const p=l.precheck(this,m);if(p!==void 0)return p}return!!(this.hasResourceBundle(i,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(i,o)&&(!d||m(f,o)))}loadNamespaces(o,l){const i=_s();return this.options.ns?(Ce(o)&&(o=[o]),o.forEach(d=>{this.options.ns.indexOf(d)<0&&this.options.ns.push(d)}),this.loadResources(d=>{i.resolve(),l&&l(d)}),i):(l&&l(),Promise.resolve())}loadLanguages(o,l){const i=_s();Ce(o)&&(o=[o]);const d=this.options.preload||[],f=o.filter(m=>d.indexOf(m)<0&&this.services.languageUtils.isSupportedCode(m));return f.length?(this.options.preload=d.concat(f),this.loadResources(m=>{i.resolve(),l&&l(m)}),i):(l&&l(),Promise.resolve())}dir(o){var d,f;if(o||(o=this.resolvedLanguage||(((d=this.languages)==null?void 0:d.length)>0?this.languages[0]:this.language)),!o)return"rtl";const l=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((f=this.services)==null?void 0:f.languageUtils)||new Kh(Xh());return l.indexOf(i.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;return new Ps(o,l)}cloneInstance(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ho;const i=o.forkResourceStore;i&&delete o.forkResourceStore;const d={...this.options,...o,isClone:!0},f=new Ps(d);if((o.debug!==void 0||o.prefix!==void 0)&&(f.logger=f.logger.clone(o)),["store","services","language"].forEach(p=>{f[p]=this[p]}),f.services={...this.services},f.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},i){const p=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},Object.keys(g[h]).reduce((y,S)=>(y[S]={...g[h][S]},y),{})),{});f.store=new Ph(p,d),f.services.resourceStore=f.store}return f.translator=new Co(f.services,d),f.translator.on("*",function(p){for(var g=arguments.length,h=new Array(g>1?g-1:0),y=1;y<g;y++)h[y-1]=arguments[y];f.emit(p,...h)}),f.init(d,l),f.translator.options=d,f.translator.backendConnector.services.utils={hasLoadedNamespace:f.hasLoadedNamespace.bind(f)},f}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Nt=Ps.createInstance();Nt.createInstance=Ps.createInstance;Nt.createInstance;Nt.dir;Nt.init;Nt.loadResources;Nt.reloadResources;Nt.use;Nt.changeLanguage;Nt.getFixedT;Nt.t;Nt.exists;Nt.setDefaultNamespace;Nt.hasLoadedNamespace;Nt.loadNamespaces;Nt.loadLanguages;const{slice:x2,forEach:y2}=[];function b2(s){return y2.call(x2.call(arguments,1),o=>{if(o)for(const l in o)s[l]===void 0&&(s[l]=o[l])}),s}function v2(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(l=>l.test(s))}const Zh=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,w2=function(s,o){const i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},d=encodeURIComponent(o);let f=`${s}=${d}`;if(i.maxAge>0){const m=i.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");f+=`; Max-Age=${Math.floor(m)}`}if(i.domain){if(!Zh.test(i.domain))throw new TypeError("option domain is invalid");f+=`; Domain=${i.domain}`}if(i.path){if(!Zh.test(i.path))throw new TypeError("option path is invalid");f+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");f+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(f+="; HttpOnly"),i.secure&&(f+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:f+="; SameSite=Strict";break;case"lax":f+="; SameSite=Lax";break;case"strict":f+="; SameSite=Strict";break;case"none":f+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(f+="; Partitioned"),f},Ih={create(s,o,l,i){let d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};l&&(d.expires=new Date,d.expires.setTime(d.expires.getTime()+l*60*1e3)),i&&(d.domain=i),document.cookie=w2(s,o,d)},read(s){const o=`${s}=`,l=document.cookie.split(";");for(let i=0;i<l.length;i++){let d=l[i];for(;d.charAt(0)===" ";)d=d.substring(1,d.length);if(d.indexOf(o)===0)return d.substring(o.length,d.length)}return null},remove(s,o){this.create(s,"",-1,o)}};var j2={name:"cookie",lookup(s){let{lookupCookie:o}=s;if(o&&typeof document<"u")return Ih.read(o)||void 0},cacheUserLanguage(s,o){let{lookupCookie:l,cookieMinutes:i,cookieDomain:d,cookieOptions:f}=o;l&&typeof document<"u"&&Ih.create(l,s,i,d,f)}},N2={name:"querystring",lookup(s){var i;let{lookupQuerystring:o}=s,l;if(typeof window<"u"){let{search:d}=window.location;!window.location.search&&((i=window.location.hash)==null?void 0:i.indexOf("?"))>-1&&(d=window.location.hash.substring(window.location.hash.indexOf("?")));const m=d.substring(1).split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===o&&(l=m[p].substring(g+1))}}return l}},S2={name:"hash",lookup(s){var d;let{lookupHash:o,lookupFromHashIndex:l}=s,i;if(typeof window<"u"){const{hash:f}=window.location;if(f&&f.length>2){const m=f.substring(1);if(o){const p=m.split("&");for(let g=0;g<p.length;g++){const h=p[g].indexOf("=");h>0&&p[g].substring(0,h)===o&&(i=p[g].substring(h+1))}}if(i)return i;if(!i&&l>-1){const p=f.match(/\/([a-zA-Z-]*)/g);return Array.isArray(p)?(d=p[typeof l=="number"?l:0])==null?void 0:d.replace("/",""):void 0}}}return i}};let Tr=null;const Jh=()=>{if(Tr!==null)return Tr;try{if(Tr=typeof window<"u"&&window.localStorage!==null,!Tr)return!1;const s="i18next.translate.boo";window.localStorage.setItem(s,"foo"),window.localStorage.removeItem(s)}catch{Tr=!1}return Tr};var C2={name:"localStorage",lookup(s){let{lookupLocalStorage:o}=s;if(o&&Jh())return window.localStorage.getItem(o)||void 0},cacheUserLanguage(s,o){let{lookupLocalStorage:l}=o;l&&Jh()&&window.localStorage.setItem(l,s)}};let Ar=null;const Wh=()=>{if(Ar!==null)return Ar;try{if(Ar=typeof window<"u"&&window.sessionStorage!==null,!Ar)return!1;const s="i18next.translate.boo";window.sessionStorage.setItem(s,"foo"),window.sessionStorage.removeItem(s)}catch{Ar=!1}return Ar};var E2={name:"sessionStorage",lookup(s){let{lookupSessionStorage:o}=s;if(o&&Wh())return window.sessionStorage.getItem(o)||void 0},cacheUserLanguage(s,o){let{lookupSessionStorage:l}=o;l&&Wh()&&window.sessionStorage.setItem(l,s)}},k2={name:"navigator",lookup(s){const o=[];if(typeof navigator<"u"){const{languages:l,userLanguage:i,language:d}=navigator;if(l)for(let f=0;f<l.length;f++)o.push(l[f]);i&&o.push(i),d&&o.push(d)}return o.length>0?o:void 0}},T2={name:"htmlTag",lookup(s){let{htmlTag:o}=s,l;const i=o||(typeof document<"u"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(l=i.getAttribute("lang")),l}},A2={name:"path",lookup(s){var d;let{lookupFromPathIndex:o}=s;if(typeof window>"u")return;const l=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?(d=l[typeof o=="number"?o:0])==null?void 0:d.replace("/",""):void 0}},R2={name:"subdomain",lookup(s){var d,f;let{lookupFromSubdomainIndex:o}=s;const l=typeof o=="number"?o+1:1,i=typeof window<"u"&&((f=(d=window.location)==null?void 0:d.hostname)==null?void 0:f.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(i)return i[l]}};let Wg=!1;try{document.cookie,Wg=!0}catch{}const e0=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Wg||e0.splice(1,1);const M2=()=>({order:e0,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:s=>s});class t0{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(o,l)}init(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=o,this.options=b2(l,this.options||{},M2()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=d=>d.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(j2),this.addDetector(N2),this.addDetector(C2),this.addDetector(E2),this.addDetector(k2),this.addDetector(T2),this.addDetector(A2),this.addDetector(R2),this.addDetector(S2)}addDetector(o){return this.detectors[o.name]=o,this}detect(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,l=[];return o.forEach(i=>{if(this.detectors[i]){let d=this.detectors[i].lookup(this.options);d&&typeof d=="string"&&(d=[d]),d&&(l=l.concat(d))}}),l=l.filter(i=>i!=null&&!v2(i)).map(i=>this.options.convertDetectedLanguage(i)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?l:l.length>0?l[0]:null}cacheUserLanguage(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;l&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(o)>-1||l.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(o,this.options)}))}}t0.type="languageDetector";const O2={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"},z2={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..."},U2={viewProfile:"View profile",userCenter:"User Center"},D2={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"},L2={label:"WeChat",title:"Connect via WeChat",qrCodeAlt:"WeChat QR Code",scanMessage:"Scan this QR code to connect with us on WeChat"},_2={label:"Discord",title:"Join our Discord server",community:"Join our growing community on Discord for support, discussions, and updates!"},B2={title:"Theme",light:"Light",dark:"Dark",system:"System"},H2={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"},q2={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"}},P2={online:"Online",offline:"Offline",connecting:"Connecting"},V2={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"},G2={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"},K2={dashboard:"Dashboard",servers:"Servers",groups:"Groups",users:"Users",settings:"Settings",changePassword:"Change Password",market:"Market",cloud:"Cloud Market",logs:"Logs"},$2={dashboard:{title:"Dashboard",totalServers:"Total",onlineServers:"Online",offlineServers:"Offline",connectingServers:"Connecting",recentServers:"Recent Servers"},servers:{title:"Servers Management"},groups:{title:"Group Management"},users:{title:"User Management"},settings:{title:"Settings",language:"Language",account:"Account Settings",password:"Change Password",appearance:"Appearance",routeConfig:"Security",installConfig:"Installation",smartRouting:"Smart Routing"},market:{title:"Market Hub - Local and Cloud Markets"},logs:{title:"System Logs"}},Y2={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"},F2={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"},X2={title:"Local Installation",official:"Official",by:"By",unknown:"Unknown",tools:"tools",search:"Search",searchPlaceholder:"Search for servers by name, category, or tags",clearFilters:"Clear",clearCategoryFilter:"",clearTagFilter:"",categories:"Categories",tags:"Tags",showTags:"Show tags",hideTags:"Hide tags",moreTags:"",noServers:"No servers found matching your search",backToList:"Back to list",install:"Install",installing:"Installing...",installed:"Installed",installServer:"Install Server: {{name}}",installSuccess:"Server {{serverName}} installed successfully",author:"Author",license:"License",repository:"Repository",examples:"Examples",arguments:"Arguments",argumentName:"Name",description:"Description",required:"Required",example:"Example",viewSchema:"View schema",fetchError:"Error fetching market servers",serverNotFound:"Server not found",searchError:"Error searching servers",filterError:"Error filtering servers by category",tagFilterError:"Error filtering servers by tag",noInstallationMethod:"No installation method available for this server",showing:"Showing {{from}}-{{to}} of {{total}} servers",perPage:"Per page",confirmVariablesMessage:"Please ensure these variables are properly defined in your runtime environment. Continue installing server?",confirmAndInstall:"Confirm and Install"},Q2={title:"Cloud Support",subtitle:"Powered by MCPRouter",by:"By",server:"Server",config:"Config",created:"Created",updated:"Updated",available:"Available",description:"Description",details:"Details",tools:"Tools",tool:"tool",toolsAvailable:"{{count}} tool available||{{count}} tools available",loadingTools:"Loading tools...",noTools:"No tools available for this server",noDescription:"No description available",viewDetails:"View Details",parameters:"Parameters",result:"Result",error:"Error",callTool:"Call",calling:"Calling...",toolCallSuccess:"Tool {{toolName}} executed successfully",toolCallError:"Failed to call tool {{toolName}}: {{error}}",viewSchema:"View Schema",backToList:"Back to Cloud Market",search:"Search",searchPlaceholder:"Search cloud servers by name, title, or author",clearFilters:"Clear Filters",clearCategoryFilter:"Clear",clearTagFilter:"Clear",categories:"Categories",tags:"Tags",noCategories:"No categories found",noTags:"No tags found",noServers:"No cloud servers found",fetchError:"Error fetching cloud servers",serverNotFound:"Cloud server not found",searchError:"Error searching cloud servers",filterError:"Error filtering cloud servers by category",tagFilterError:"Error filtering cloud servers by tag",showing:"Showing {{from}}-{{to}} of {{total}} cloud servers",perPage:"Per page",apiKeyNotConfigured:"MCPRouter API key not configured",apiKeyNotConfiguredDescription:"To use cloud servers, you need to configure your MCPRouter API key.",getApiKey:"Get API Key",configureInSettings:"Configure in Settings",installServer:"Install {{name}}",installSuccess:"Server {{name}} installed successfully",installError:"Failed to install server: {{error}}"},Z2={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}}"},I2={enableGlobalRoute:"Enable Global Route",enableGlobalRouteDescription:"Allow connections to /sse endpoint without specifying a group ID",enableGroupNameRoute:"Enable Group Name Route",enableGroupNameRouteDescription:"Allow connections to /sse endpoint using group names instead of just group IDs",enableBearerAuth:"Enable Bearer Authentication",enableBearerAuthDescription:"Require bearer token authentication for MCP requests",bearerAuthKey:"Bearer Authentication Key",bearerAuthKeyDescription:"The authentication key that will be required in the Bearer token",bearerAuthKeyPlaceholder:"Enter bearer authentication key",skipAuth:"Skip Authentication",skipAuthDescription:"Bypass login requirement for frontend and API access (DEFAULT OFF for security)",pythonIndexUrl:"Python Package Repository URL",pythonIndexUrlDescription:"Set UV_DEFAULT_INDEX environment variable for Python package installation",pythonIndexUrlPlaceholder:"e.g. https://pypi.org/simple",npmRegistry:"NPM Registry URL",npmRegistryDescription:"Set npm_config_registry environment variable for NPM package installation",npmRegistryPlaceholder:"e.g. https://registry.npmjs.org/",baseUrl:"Base URL",baseUrlDescription:"Base URL for MCP requests",baseUrlPlaceholder:"e.g. http://localhost:3000",installConfig:"Installation",systemConfigUpdated:"System configuration updated successfully",enableSmartRouting:"Enable Smart Routing",enableSmartRoutingDescription:"Enable smart routing feature to search the most suitable tool based on input (using $smart group name)",dbUrl:"PostgreSQL URL (requires pgvector support)",dbUrlPlaceholder:"e.g. postgresql://user:password@localhost:5432/dbname",openaiApiBaseUrl:"OpenAI API Base URL",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"OpenAI API Key",openaiApiKeyPlaceholder:"Enter OpenAI API key",openaiApiEmbeddingModel:"OpenAI Embedding Model",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",smartRoutingConfigUpdated:"Smart routing configuration updated successfully",smartRoutingRequiredFields:"Database URL and OpenAI API Key are required to enable smart routing",smartRoutingValidationError:"Please fill in the required fields before enabling Smart Routing: {{fields}}",mcpRouterConfig:"Cloud Market",mcpRouterApiKey:"MCPRouter API Key",mcpRouterApiKeyDescription:"API key for accessing MCPRouter cloud market services",mcpRouterApiKeyPlaceholder:"Enter MCPRouter API key",mcpRouterReferer:"Referer",mcpRouterRefererDescription:"Referer header for MCPRouter API requests",mcpRouterRefererPlaceholder:"https://mcphub.app",mcpRouterTitle:"Title",mcpRouterTitleDescription:"Title header for MCPRouter API requests",mcpRouterTitlePlaceholder:"MCPHub",mcpRouterBaseUrl:"Base URL",mcpRouterBaseUrlDescription:"Base URL for MCPRouter API",mcpRouterBaseUrlPlaceholder:"https://api.mcprouter.to/v1"},J2={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"},W2={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."},ew={errors:{readonly:"Readonly for demo environment",serverNameRequired:"Server name is required",serverConfigRequired:"Server configuration is required",serverConfigInvalid:"Server configuration must include either a URL, OpenAPI specification URL or schema, or command with arguments",serverTypeInvalid:"Server type must be one of: stdio, sse, streamable-http, openapi",urlRequiredForType:"URL is required for {{type}} server type",openapiSpecRequired:"OpenAPI specification URL or schema is required for openapi server type",headersInvalidFormat:"Headers must be an object",headersNotSupportedForStdio:"Headers are not supported for stdio server type",serverNotFound:"Server not found",failedToRemoveServer:"Server not found or failed to remove",internalServerError:"Internal server error",failedToGetServers:"Failed to get servers information",failedToGetServerSettings:"Failed to get server settings",failedToGetServerConfig:"Failed to get server configuration",failedToSaveSettings:"Failed to save settings",toolNameRequired:"Server name and tool name are required",descriptionMustBeString:"Description must be a string",groupIdRequired:"Group ID is required",groupNameRequired:"Group name is required",groupNotFound:"Group not found",groupIdAndServerNameRequired:"Group ID and server name are required",groupOrServerNotFound:"Group or server not found",toolsMustBeAllOrArray:'Tools must be "all" or an array of strings',serverNameAndToolNameRequired:"Server name and tool name are required",usernameRequired:"Username is required",userNotFound:"User not found",failedToGetUsers:"Failed to get users information",failedToGetUserInfo:"Failed to get user information",failedToGetUserStats:"Failed to get user statistics",marketServerNameRequired:"Server name is required",marketServerNotFound:"Market server not found",failedToGetMarketServers:"Failed to get market servers information",failedToGetMarketServer:"Failed to get market server information",failedToGetMarketCategories:"Failed to get market categories",failedToGetMarketTags:"Failed to get market tags",failedToSearchMarketServers:"Failed to search market servers",failedToFilterMarketServers:"Failed to filter market servers",failedToProcessDxtFile:"Failed to process DXT file"},success:{serverCreated:"Server created successfully",serverUpdated:"Server updated successfully",serverRemoved:"Server removed successfully",serverToggled:"Server status toggled successfully",toolToggled:"Tool {{name}} {{action}} successfully",toolDescriptionUpdated:"Tool {{name}} description updated successfully",systemConfigUpdated:"System configuration updated successfully",groupCreated:"Group created successfully",groupUpdated:"Group updated successfully",groupDeleted:"Group deleted successfully",serverAddedToGroup:"Server added to group successfully",serverRemovedFromGroup:"Server removed from group successfully",serverToolsUpdated:"Server tools updated successfully"}},tw={app:O2,about:z2,profile:U2,sponsor:D2,wechat:L2,discord:_2,theme:B2,auth:H2,server:q2,status:P2,errors:V2,common:G2,nav:K2,pages:$2,logs:Y2,groups:F2,market:X2,cloud:Q2,tool:Z2,settings:I2,dxt:J2,users:W2,api:ew},aw={title:"MCP Hub 控制面板",error:"错误",closeButton:"关闭",noServers:"没有可用的 MCP 服务器",loading:"加载中...",logout:"退出登录",profile:"个人资料",changePassword:"修改密码",toggleSidebar:"切换侧边栏",welcomeUser:"欢迎, {{username}}",name:"MCP Hub"},nw={title:"关于",versionInfo:"MCP Hub 版本: {{version}}",newVersion:"有新版本可用!",currentVersion:"当前版本",newVersionAvailable:"新版本 {{version}} 已发布",viewOnGitHub:"在 GitHub 上查看",checkForUpdates:"检查更新",checking:"检查更新中..."},rw={viewProfile:"查看个人中心",userCenter:"个人中心"},sw={label:"赞助",title:"支持项目",rewardAlt:"赞赏码",supportMessage:"通过捐赠支持 MCP Hub 的开发!",supportButton:"在 Ko-fi 上支持"},lw={label:"微信",title:"微信联系",qrCodeAlt:"微信二维码",scanMessage:"扫描二维码添加微信"},ow={label:"Discord",title:"加入我们的 Discord 服务器",community:"加入我们不断壮大的 Discord 社区,获取支持、参与讨论并了解最新动态!"},iw={title:"主题",light:"浅色",dark:"深色",system:"系统"},cw={login:"登录",loginTitle:"登录 MCP Hub",username:"用户名",password:"密码",loggingIn:"登录中...",emptyFields:"用户名和密码不能为空",loginFailed:"登录失败,请检查用户名和密码",loginError:"登录过程中出现错误",currentPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认密码",passwordsNotMatch:"新密码与确认密码不一致",changePasswordSuccess:"密码修改成功",changePasswordError:"修改密码失败",changePassword:"修改密码",passwordChanged:"密码修改成功",passwordChangeError:"修改密码失败"},uw={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 令牌"}},dw={online:"在线",offline:"离线",connecting:"连接中"},fw={general:"发生错误",network:"网络连接错误,请检查您的互联网连接",serverConnection:"无法连接到服务器,请检查服务器是否正在运行",serverAdd:"添加服务器失败,请检查服务器状态",serverUpdate:"编辑服务器 {{serverName}} 失败,请检查服务器状态",serverFetch:"获取服务器数据失败,请稍后重试",initialStartup:"服务器可能正在启动中。首次启动可能需要一些时间,请耐心等候...",serverInstall:"安装服务器失败",failedToFetchSettings:"获取设置失败",failedToUpdateSystemConfig:"更新系统配置失败",failedToUpdateRouteConfig:"更新路由配置失败",failedToUpdateSmartRoutingConfig:"更新智能路由配置失败"},mw={processing:"处理中...",save:"保存",cancel:"取消",refresh:"刷新",create:"创建",creating:"创建中...",update:"更新",updating:"更新中...",submitting:"提交中...",delete:"删除",remove:"移除",copy:"复制",copyId:"复制ID",copyUrl:"复制URL",copyJson:"复制JSON",copySuccess:"已复制到剪贴板",copyFailed:"复制失败",close:"关闭",confirm:"确认",language:"语言"},hw={dashboard:"仪表盘",servers:"服务器",settings:"设置",changePassword:"修改密码",groups:"分组",users:"用户",market:"市场",cloud:"云端市场",logs:"日志"},gw={dashboard:{title:"仪表盘",totalServers:"总数",onlineServers:"在线",offlineServers:"离线",connectingServers:"连接中",recentServers:"最近的服务器"},servers:{title:"服务器管理"},settings:{title:"设置",language:"语言",account:"账户设置",password:"修改密码",appearance:"外观",routeConfig:"安全配置",installConfig:"安装",smartRouting:"智能路由"},groups:{title:"分组管理"},users:{title:"用户管理"},market:{title:"市场中心 - 本地市场和云端市场"},logs:{title:"系统日志"}},pw={filters:"筛选",search:"搜索日志...",autoScroll:"自动滚动",clearLogs:"清除日志",loading:"加载日志中...",noLogs:"暂无日志。",noMatch:"没有匹配当前筛选条件的日志。",mainProcess:"主进程",childProcess:"子进程",main:"主",child:"子"},xw={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:"配置工具"},yw={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:"确认并安装"},bw={title:"云端支持",subtitle:"由 MCPRouter 提供支持",by:"作者",server:"服务器",config:"配置",created:"创建时间",updated:"更新时间",available:"可用",description:"描述",details:"详细信息",tools:"工具",tool:"个工具",toolsAvailable:"{{count}} 个工具可用",loadingTools:"加载工具中...",noTools:"该服务器没有可用工具",noDescription:"无描述信息",viewDetails:"查看详情",parameters:"参数",result:"结果",error:"错误",callTool:"调用",calling:"调用中...",toolCallSuccess:"工具 {{toolName}} 执行成功",toolCallError:"调用工具 {{toolName}} 失败:{{error}}",viewSchema:"查看结构",backToList:"返回云端市场",search:"搜索",searchPlaceholder:"搜索云端服务器名称、标题或作者",clearFilters:"清除筛选",clearCategoryFilter:"清除",clearTagFilter:"清除",categories:"分类",tags:"标签",noCategories:"未找到分类",noTags:"未找到标签",noServers:"未找到云端服务器",fetchError:"获取云端服务器失败",serverNotFound:"未找到云端服务器",searchError:"搜索云端服务器失败",filterError:"按分类筛选云端服务器失败",tagFilterError:"按标签筛选云端服务器失败",showing:"显示 {{from}}-{{to}}/{{total}} 个云端服务器",perPage:"每页显示",apiKeyNotConfigured:"MCPRouter API 密钥未配置",apiKeyNotConfiguredDescription:"要使用云端服务器,您需要配置 MCPRouter API 密钥。",getApiKey:"获取 API 密钥",configureInSettings:"在设置中配置",installServer:"安装 {{name}}",installSuccess:"服务器 {{name}} 安装成功",installError:"安装服务器失败:{{error}}"},vw={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}}"},ww={enableGlobalRoute:"启用全局路由",enableGlobalRouteDescription:"允许不指定组 ID 就连接到 /sse 端点",enableGroupNameRoute:"启用组名路由",enableGroupNameRouteDescription:"允许使用组名而不仅仅是组 ID 连接到 /sse 端点",enableBearerAuth:"启用 Bearer 认证",enableBearerAuthDescription:"对 MCP 请求启用 Bearer 令牌认证",bearerAuthKey:"Bearer 认证密钥",bearerAuthKeyDescription:"Bearer 令牌中需要携带的认证密钥",bearerAuthKeyPlaceholder:"请输入 Bearer 认证密钥",skipAuth:"免登录开关",skipAuthDescription:"跳过前端和 API 访问的登录要求(默认关闭确保安全性)",pythonIndexUrl:"Python 包仓库地址",pythonIndexUrlDescription:"设置 UV_DEFAULT_INDEX 环境变量,用于 Python 包安装",pythonIndexUrlPlaceholder:"例如: https://mirrors.aliyun.com/pypi/simple",npmRegistry:"NPM 仓库地址",npmRegistryDescription:"设置 npm_config_registry 环境变量,用于 NPM 包安装",npmRegistryPlaceholder:"例如: https://registry.npmmirror.com/",baseUrl:"基础地址",baseUrlDescription:"用于 MCP 请求的基础地址",baseUrlPlaceholder:"例如: http://localhost:3000",installConfig:"安装配置",systemConfigUpdated:"系统配置更新成功",enableSmartRouting:"启用智能路由",enableSmartRoutingDescription:"开启智能路由功能,根据输入自动搜索最合适的工具(使用 $smart 分组)",dbUrl:"PostgreSQL 连接地址(必须支持 pgvector)",dbUrlPlaceholder:"例如: postgresql://user:password@localhost:5432/dbname",openaiApiBaseUrl:"OpenAI API 基础地址",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"OpenAI API 密钥",openaiApiKeyDescription:"用于访问 OpenAI API 的密钥",openaiApiKeyPlaceholder:"请输入 OpenAI API 密钥",openaiApiEmbeddingModel:"OpenAI 嵌入模型",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",smartRoutingConfigUpdated:"智能路由配置更新成功",smartRoutingRequiredFields:"启用智能路由需要填写数据库连接地址和 OpenAI API 密钥",smartRoutingValidationError:"启用智能路由前请先填写必要字段:{{fields}}",mcpRouterConfig:"云端市场",mcpRouterApiKey:"MCPRouter API 密钥",mcpRouterApiKeyDescription:"用于访问 MCPRouter 云端市场服务的 API 密钥",mcpRouterApiKeyPlaceholder:"请输入 MCPRouter API 密钥",mcpRouterReferer:"引用地址",mcpRouterRefererDescription:"MCPRouter API 请求的引用地址头",mcpRouterRefererPlaceholder:"https://mcphub.app",mcpRouterTitle:"标题",mcpRouterTitleDescription:"MCPRouter API 请求的标题头",mcpRouterTitlePlaceholder:"MCPHub",mcpRouterBaseUrl:"基础地址",mcpRouterBaseUrlDescription:"MCPRouter API 的基础地址",mcpRouterBaseUrlPlaceholder:"https://api.mcprouter.to/v1"},jw={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={errors:{readonly:"演示环境无法修改数据",serverNameRequired:"服务器名称是必需的",serverConfigRequired:"服务器配置是必需的",serverConfigInvalid:"服务器配置必须包含 URL、OpenAPI 规范 URL 或模式,或者带参数的命令",serverTypeInvalid:"服务器类型必须是以下之一:stdio、sse、streamable-http、openapi",urlRequiredForType:"{{type}} 服务器类型需要 URL",openapiSpecRequired:"openapi 服务器类型需要 OpenAPI 规范 URL 或模式",headersInvalidFormat:"请求头必须是对象格式",headersNotSupportedForStdio:"stdio 服务器类型不支持请求头",serverNotFound:"找不到服务器",failedToRemoveServer:"找不到服务器或删除失败",internalServerError:"服务器内部错误",failedToGetServers:"获取服务器信息失败",failedToGetServerSettings:"获取服务器设置失败",failedToGetServerConfig:"获取服务器配置失败",failedToSaveSettings:"保存设置失败",toolNameRequired:"服务器名称和工具名称是必需的",descriptionMustBeString:"描述必须是字符串",groupIdRequired:"分组 ID 是必需的",groupNameRequired:"分组名称是必需的",groupNotFound:"找不到分组",groupIdAndServerNameRequired:"分组 ID 和服务器名称是必需的",groupOrServerNotFound:"找不到分组或服务器",toolsMustBeAllOrArray:'工具必须是 "all" 或字符串数组',serverNameAndToolNameRequired:"服务器名称和工具名称是必需的",usernameRequired:"用户名是必需的",userNotFound:"找不到用户",failedToGetUsers:"获取用户信息失败",failedToGetUserInfo:"获取用户信息失败",failedToGetUserStats:"获取用户统计信息失败",marketServerNameRequired:"服务器名称是必需的",marketServerNotFound:"找不到市场服务器",failedToGetMarketServers:"获取市场服务器信息失败",failedToGetMarketServer:"获取市场服务器信息失败",failedToGetMarketCategories:"获取市场类别失败",failedToGetMarketTags:"获取市场标签失败",failedToSearchMarketServers:"搜索市场服务器失败",failedToFilterMarketServers:"过滤市场服务器失败",failedToProcessDxtFile:"处理 DXT 文件失败"},success:{serverCreated:"服务器创建成功",serverUpdated:"服务器更新成功",serverRemoved:"服务器删除成功",serverToggled:"服务器状态切换成功",toolToggled:"工具 {{name}} {{action}} 成功",toolDescriptionUpdated:"工具 {{name}} 描述更新成功",systemConfigUpdated:"系统配置更新成功",groupCreated:"分组创建成功",groupUpdated:"分组更新成功",groupDeleted:"分组删除成功",serverAddedToGroup:"服务器添加到分组成功",serverRemovedFromGroup:"服务器从分组移除成功",serverToolsUpdated:"服务器工具更新成功"}},Cw={app:aw,about:nw,profile:rw,sponsor:sw,wechat:lw,discord:ow,theme:iw,auth:cw,server:uw,status:dw,errors:fw,common:mw,nav:hw,pages:gw,logs:pw,groups:xw,market:yw,cloud:bw,tool:vw,settings:ww,dxt:jw,users:Nw,api:Sw};Nt.use(t0).use($1).init({resources:{en:{translation:tw},zh:{translation:Cw}},fallbackLng:"en",debug:!1,defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","cookie","htmlTag","navigator"],caches:["localStorage","cookie"]}});const Ew=()=>{eb()};Ew();async function kw(){try{console.log("Loading runtime configuration...");const s=await Iy();console.log("Runtime configuration loaded:",s),window.__MCPHUB_CONFIG__=s,vh.createRoot(document.getElementById("root")).render(r.jsx(Mr.StrictMode,{children:r.jsx(Lh,{})}))}catch(s){console.error("Failed to initialize app:",s),console.log("Starting app with default configuration..."),window.__MCPHUB_CONFIG__={basePath:"",version:"dev",name:"mcphub"},vh.createRoot(document.getElementById("root")).render(r.jsx(Mr.StrictMode,{children:r.jsx(Lh,{})}))}}kw();
203
- //# sourceMappingURL=index-Di8bumN2.js.map