@mcp-shark/mcp-shark 1.5.8 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/core/configs/environment.js +10 -7
- package/core/configs/index.js +0 -1
- package/core/constants/Defaults.js +2 -0
- package/core/libraries/TransportLibrary.js +3 -1
- package/core/mcp-server/index.js +22 -6
- package/core/mcp-server/server/external/single/transport.js +2 -2
- package/core/services/ConfigDetectionService.js +35 -22
- package/core/services/ServerManagementService.js +25 -4
- package/package.json +2 -2
- package/ui/dist/assets/index-D1MNKhKd.js +44 -0
- package/ui/dist/index.html +1 -1
- package/ui/server/controllers/ServerManagementController.js +3 -0
- package/ui/src/App.jsx +13 -5
- package/ui/src/ShutdownPage.jsx +91 -0
- package/ui/src/components/App/ActionMenu.jsx +179 -0
- package/ui/src/components/App/ApiDocsButton.jsx +56 -35
- package/ui/src/components/App/HelpButton.jsx +57 -35
- package/ui/src/components/App/ShutdownButton.jsx +142 -0
- package/ui/src/components/ShuttingDownModal.jsx +100 -0
- package/core/configs/codex.js +0 -68
- package/ui/dist/assets/index-CArYxKxS.js +0 -35
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))c(p);new MutationObserver(p=>{for(const f of p)if(f.type==="childList")for(const g of f.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&c(g)}).observe(document,{childList:!0,subtree:!0});function u(p){const f={};return p.integrity&&(f.integrity=p.integrity),p.referrerPolicy&&(f.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?f.credentials="include":p.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(p){if(p.ep)return;p.ep=!0;const f=u(p);fetch(p.href,f)}})();function Xd(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var is={exports:{}},Ar={},ls={exports:{}},ge={};var Td;function Ef(){if(Td)return ge;Td=1;var r=Symbol.for("react.element"),s=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),g=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),T=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),w=Symbol.iterator;function b(j){return j===null||typeof j!="object"?null:(j=w&&j[w]||j["@@iterator"],typeof j=="function"?j:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,E={};function L(j,N,ie){this.props=j,this.context=N,this.refs=E,this.updater=ie||_}L.prototype.isReactComponent={},L.prototype.setState=function(j,N){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,N,"setState")},L.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function F(){}F.prototype=L.prototype;function D(j,N,ie){this.props=j,this.context=N,this.refs=E,this.updater=ie||_}var U=D.prototype=new F;U.constructor=D,M(U,L.prototype),U.isPureReactComponent=!0;var W=Array.isArray,$=Object.prototype.hasOwnProperty,A={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function V(j,N,ie){var de,pe={},xe=null,we=null;if(N!=null)for(de in N.ref!==void 0&&(we=N.ref),N.key!==void 0&&(xe=""+N.key),N)$.call(N,de)&&!K.hasOwnProperty(de)&&(pe[de]=N[de]);var ke=arguments.length-2;if(ke===1)pe.children=ie;else if(1<ke){for(var ce=Array(ke),Le=0;Le<ke;Le++)ce[Le]=arguments[Le+2];pe.children=ce}if(j&&j.defaultProps)for(de in ke=j.defaultProps,ke)pe[de]===void 0&&(pe[de]=ke[de]);return{$$typeof:r,type:j,key:xe,ref:we,props:pe,_owner:A.current}}function G(j,N){return{$$typeof:r,type:j.type,key:N,ref:j.ref,props:j.props,_owner:j._owner}}function Y(j){return typeof j=="object"&&j!==null&&j.$$typeof===r}function ue(j){var N={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ie){return N[ie]})}var ve=/\/+/g;function me(j,N){return typeof j=="object"&&j!==null&&j.key!=null?ue(""+j.key):N.toString(36)}function Ee(j,N,ie,de,pe){var xe=typeof j;(xe==="undefined"||xe==="boolean")&&(j=null);var we=!1;if(j===null)we=!0;else switch(xe){case"string":case"number":we=!0;break;case"object":switch(j.$$typeof){case r:case s:we=!0}}if(we)return we=j,pe=pe(we),j=de===""?"."+me(we,0):de,W(pe)?(ie="",j!=null&&(ie=j.replace(ve,"$&/")+"/"),Ee(pe,N,ie,"",function(Le){return Le})):pe!=null&&(Y(pe)&&(pe=G(pe,ie+(!pe.key||we&&we.key===pe.key?"":(""+pe.key).replace(ve,"$&/")+"/")+j)),N.push(pe)),1;if(we=0,de=de===""?".":de+":",W(j))for(var ke=0;ke<j.length;ke++){xe=j[ke];var ce=de+me(xe,ke);we+=Ee(xe,N,ie,ce,pe)}else if(ce=b(j),typeof ce=="function")for(j=ce.call(j),ke=0;!(xe=j.next()).done;)xe=xe.value,ce=de+me(xe,ke++),we+=Ee(xe,N,ie,ce,pe);else if(xe==="object")throw N=String(j),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.");return we}function Ne(j,N,ie){if(j==null)return j;var de=[],pe=0;return Ee(j,de,"","",function(xe){return N.call(ie,xe,pe++)}),de}function Re(j){if(j._status===-1){var N=j._result;N=N(),N.then(function(ie){(j._status===0||j._status===-1)&&(j._status=1,j._result=ie)},function(ie){(j._status===0||j._status===-1)&&(j._status=2,j._result=ie)}),j._status===-1&&(j._status=0,j._result=N)}if(j._status===1)return j._result.default;throw j._result}var he={current:null},J={transition:null},q={ReactCurrentDispatcher:he,ReactCurrentBatchConfig:J,ReactCurrentOwner:A};function X(){throw Error("act(...) is not supported in production builds of React.")}return ge.Children={map:Ne,forEach:function(j,N,ie){Ne(j,function(){N.apply(this,arguments)},ie)},count:function(j){var N=0;return Ne(j,function(){N++}),N},toArray:function(j){return Ne(j,function(N){return N})||[]},only:function(j){if(!Y(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},ge.Component=L,ge.Fragment=u,ge.Profiler=p,ge.PureComponent=D,ge.StrictMode=c,ge.Suspense=x,ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,ge.act=X,ge.cloneElement=function(j,N,ie){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var de=M({},j.props),pe=j.key,xe=j.ref,we=j._owner;if(N!=null){if(N.ref!==void 0&&(xe=N.ref,we=A.current),N.key!==void 0&&(pe=""+N.key),j.type&&j.type.defaultProps)var ke=j.type.defaultProps;for(ce in N)$.call(N,ce)&&!K.hasOwnProperty(ce)&&(de[ce]=N[ce]===void 0&&ke!==void 0?ke[ce]:N[ce])}var ce=arguments.length-2;if(ce===1)de.children=ie;else if(1<ce){ke=Array(ce);for(var Le=0;Le<ce;Le++)ke[Le]=arguments[Le+2];de.children=ke}return{$$typeof:r,type:j.type,key:pe,ref:xe,props:de,_owner:we}},ge.createContext=function(j){return j={$$typeof:g,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:f,_context:j},j.Consumer=j},ge.createElement=V,ge.createFactory=function(j){var N=V.bind(null,j);return N.type=j,N},ge.createRef=function(){return{current:null}},ge.forwardRef=function(j){return{$$typeof:y,render:j}},ge.isValidElement=Y,ge.lazy=function(j){return{$$typeof:v,_payload:{_status:-1,_result:j},_init:Re}},ge.memo=function(j,N){return{$$typeof:T,type:j,compare:N===void 0?null:N}},ge.startTransition=function(j){var N=J.transition;J.transition={};try{j()}finally{J.transition=N}},ge.unstable_act=X,ge.useCallback=function(j,N){return he.current.useCallback(j,N)},ge.useContext=function(j){return he.current.useContext(j)},ge.useDebugValue=function(){},ge.useDeferredValue=function(j){return he.current.useDeferredValue(j)},ge.useEffect=function(j,N){return he.current.useEffect(j,N)},ge.useId=function(){return he.current.useId()},ge.useImperativeHandle=function(j,N,ie){return he.current.useImperativeHandle(j,N,ie)},ge.useInsertionEffect=function(j,N){return he.current.useInsertionEffect(j,N)},ge.useLayoutEffect=function(j,N){return he.current.useLayoutEffect(j,N)},ge.useMemo=function(j,N){return he.current.useMemo(j,N)},ge.useReducer=function(j,N,ie){return he.current.useReducer(j,N,ie)},ge.useRef=function(j){return he.current.useRef(j)},ge.useState=function(j){return he.current.useState(j)},ge.useSyncExternalStore=function(j,N,ie){return he.current.useSyncExternalStore(j,N,ie)},ge.useTransition=function(){return he.current.useTransition()},ge.version="18.3.1",ge}var Pd;function hs(){return Pd||(Pd=1,ls.exports=Ef()),ls.exports}var _d;function Rf(){if(_d)return Ar;_d=1;var r=hs(),s=Symbol.for("react.element"),u=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,p=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function g(y,x,T){var v,w={},b=null,_=null;T!==void 0&&(b=""+T),x.key!==void 0&&(b=""+x.key),x.ref!==void 0&&(_=x.ref);for(v in x)c.call(x,v)&&!f.hasOwnProperty(v)&&(w[v]=x[v]);if(y&&y.defaultProps)for(v in x=y.defaultProps,x)w[v]===void 0&&(w[v]=x[v]);return{$$typeof:s,type:y,key:b,ref:_,props:w,_owner:p.current}}return Ar.Fragment=u,Ar.jsx=g,Ar.jsxs=g,Ar}var Ld;function Ff(){return Ld||(Ld=1,is.exports=Rf()),is.exports}var i=Ff(),P=hs();const ri=Xd(P);var ni={},ss={exports:{}},at={},as={exports:{}},us={};var Md;function If(){return Md||(Md=1,(function(r){function s(J,q){var X=J.length;J.push(q);e:for(;0<X;){var j=X-1>>>1,N=J[j];if(0<p(N,q))J[j]=q,J[X]=N,X=j;else break e}}function u(J){return J.length===0?null:J[0]}function c(J){if(J.length===0)return null;var q=J[0],X=J.pop();if(X!==q){J[0]=X;e:for(var j=0,N=J.length,ie=N>>>1;j<ie;){var de=2*(j+1)-1,pe=J[de],xe=de+1,we=J[xe];if(0>p(pe,X))xe<N&&0>p(we,pe)?(J[j]=we,J[xe]=X,j=xe):(J[j]=pe,J[de]=X,j=de);else if(xe<N&&0>p(we,X))J[j]=we,J[xe]=X,j=xe;else break e}}return q}function p(J,q){var X=J.sortIndex-q.sortIndex;return X!==0?X:J.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var g=Date,y=g.now();r.unstable_now=function(){return g.now()-y}}var x=[],T=[],v=1,w=null,b=3,_=!1,M=!1,E=!1,L=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function U(J){for(var q=u(T);q!==null;){if(q.callback===null)c(T);else if(q.startTime<=J)c(T),q.sortIndex=q.expirationTime,s(x,q);else break;q=u(T)}}function W(J){if(E=!1,U(J),!M)if(u(x)!==null)M=!0,Re($);else{var q=u(T);q!==null&&he(W,q.startTime-J)}}function $(J,q){M=!1,E&&(E=!1,F(V),V=-1),_=!0;var X=b;try{for(U(q),w=u(x);w!==null&&(!(w.expirationTime>q)||J&&!ue());){var j=w.callback;if(typeof j=="function"){w.callback=null,b=w.priorityLevel;var N=j(w.expirationTime<=q);q=r.unstable_now(),typeof N=="function"?w.callback=N:w===u(x)&&c(x),U(q)}else c(x);w=u(x)}if(w!==null)var ie=!0;else{var de=u(T);de!==null&&he(W,de.startTime-q),ie=!1}return ie}finally{w=null,b=X,_=!1}}var A=!1,K=null,V=-1,G=5,Y=-1;function ue(){return!(r.unstable_now()-Y<G)}function ve(){if(K!==null){var J=r.unstable_now();Y=J;var q=!0;try{q=K(!0,J)}finally{q?me():(A=!1,K=null)}}else A=!1}var me;if(typeof D=="function")me=function(){D(ve)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,Ne=Ee.port2;Ee.port1.onmessage=ve,me=function(){Ne.postMessage(null)}}else me=function(){L(ve,0)};function Re(J){K=J,A||(A=!0,me())}function he(J,q){V=L(function(){J(r.unstable_now())},q)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(J){J.callback=null},r.unstable_continueExecution=function(){M||_||(M=!0,Re($))},r.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<J?Math.floor(1e3/J):5},r.unstable_getCurrentPriorityLevel=function(){return b},r.unstable_getFirstCallbackNode=function(){return u(x)},r.unstable_next=function(J){switch(b){case 1:case 2:case 3:var q=3;break;default:q=b}var X=b;b=q;try{return J()}finally{b=X}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(J,q){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var X=b;b=J;try{return q()}finally{b=X}},r.unstable_scheduleCallback=function(J,q,X){var j=r.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?j+X:j):X=j,J){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=X+N,J={id:v++,callback:q,priorityLevel:J,startTime:X,expirationTime:N,sortIndex:-1},X>j?(J.sortIndex=X,s(T,J),u(x)===null&&J===u(T)&&(E?(F(V),V=-1):E=!0,he(W,X-j))):(J.sortIndex=N,s(x,J),M||_||(M=!0,Re($))),J},r.unstable_shouldYield=ue,r.unstable_wrapCallback=function(J){var q=b;return function(){var X=b;b=q;try{return J.apply(this,arguments)}finally{b=X}}}})(us)),us}var zd;function $f(){return zd||(zd=1,as.exports=If()),as.exports}var Ed;function Nf(){if(Ed)return at;Ed=1;var r=hs(),s=$f();function u(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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."}var c=new Set,p={};function f(e,t){g(e,t),g(e+"Capture",t)}function g(e,t){for(p[e]=t,e=0;e<t.length;e++)c.add(t[e])}var y=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x=Object.prototype.hasOwnProperty,T=/^[: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]*$/,v={},w={};function b(e){return x.call(w,e)?!0:x.call(v,e)?!1:T.test(e)?w[e]=!0:(v[e]=!0,!1)}function _(e,t,n,l){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function M(e,t,n,l){if(t===null||typeof t>"u"||_(e,t,n,l))return!0;if(l)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function E(e,t,n,l,a,d,h){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=d,this.removeEmptyString=h}var L={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){L[e]=new E(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];L[t]=new E(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){L[e]=new E(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){L[e]=new E(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){L[e]=new E(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){L[e]=new E(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){L[e]=new E(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){L[e]=new E(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){L[e]=new E(e,5,!1,e.toLowerCase(),null,!1,!1)});var F=/[\-:]([a-z])/g;function D(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(F,D);L[t]=new E(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(F,D);L[t]=new E(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(F,D);L[t]=new E(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){L[e]=new E(e,1,!1,e.toLowerCase(),null,!1,!1)}),L.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){L[e]=new E(e,1,!1,e.toLowerCase(),null,!0,!0)});function U(e,t,n,l){var a=L.hasOwnProperty(t)?L[t]:null;(a!==null?a.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(M(t,n,a,l)&&(n=null),l||a===null?b(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,l=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,l?e.setAttributeNS(l,t,n):e.setAttribute(t,n))))}var W=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$=Symbol.for("react.element"),A=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),Y=Symbol.for("react.provider"),ue=Symbol.for("react.context"),ve=Symbol.for("react.forward_ref"),me=Symbol.for("react.suspense"),Ee=Symbol.for("react.suspense_list"),Ne=Symbol.for("react.memo"),Re=Symbol.for("react.lazy"),he=Symbol.for("react.offscreen"),J=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var X=Object.assign,j;function N(e){if(j===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);j=t&&t[1]||""}return`
|
|
2
|
+
`+j+e}var ie=!1;function de(e,t){if(!e||ie)return"";ie=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(I){var l=I}Reflect.construct(e,[],t)}else{try{t.call()}catch(I){l=I}e.call(t.prototype)}else{try{throw Error()}catch(I){l=I}e()}}catch(I){if(I&&l&&typeof I.stack=="string"){for(var a=I.stack.split(`
|
|
3
|
+
`),d=l.stack.split(`
|
|
4
|
+
`),h=a.length-1,S=d.length-1;1<=h&&0<=S&&a[h]!==d[S];)S--;for(;1<=h&&0<=S;h--,S--)if(a[h]!==d[S]){if(h!==1||S!==1)do if(h--,S--,0>S||a[h]!==d[S]){var k=`
|
|
5
|
+
`+a[h].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),k}while(1<=h&&0<=S);break}}}finally{ie=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?N(e):""}function pe(e){switch(e.tag){case 5:return N(e.type);case 16:return N("Lazy");case 13:return N("Suspense");case 19:return N("SuspenseList");case 0:case 2:case 15:return e=de(e.type,!1),e;case 11:return e=de(e.type.render,!1),e;case 1:return e=de(e.type,!0),e;default:return""}}function xe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case A:return"Portal";case G:return"Profiler";case V:return"StrictMode";case me:return"Suspense";case Ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ue:return(e.displayName||"Context")+".Consumer";case Y:return(e._context.displayName||"Context")+".Provider";case ve:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ne:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case Re:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}function we(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xe(t);case 8:return t===V?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ke(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ce(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Le(e){var t=ce(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,d=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(h){l=""+h,d.call(this,h)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(h){l=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _t(e){e._valueTracker||(e._valueTracker=Le(e))}function Vt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=ce(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Qt(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}}function Se(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function De(e,t){var n=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;n=ke(t.value!=null?t.value:n),e._wrapperState={initialChecked:l,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Je(e,t){t=t.checked,t!=null&&U(e,"checked",t,!1)}function vt(e,t){Je(e,t);var n=ke(t.value),l=t.type;if(n!=null)l==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?gi(e,t.type,n):t.hasOwnProperty("defaultValue")&&gi(e,t.type,ke(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Is(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function gi(e,t,n){(t!=="number"||Qt(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var rr=Array.isArray;function Ln(e,t,n,l){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&l&&(e[n].defaultSelected=!0)}else{for(n=""+ke(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function hi(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(u(91));return X({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function $s(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(u(92));if(rr(n)){if(1<n.length)throw Error(u(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ke(n)}}function Ns(e,t){var n=ke(t.value),l=ke(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),l!=null&&(e.defaultValue=""+l)}function Ds(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Os(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function xi(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Os(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Yr,Bs=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,l,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,l,a)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Yr=Yr||document.createElement("div"),Yr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Yr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function or(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ir={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ic=["Webkit","ms","Moz","O"];Object.keys(ir).forEach(function(e){Ic.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ir[t]=ir[e]})});function Ws(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ir.hasOwnProperty(e)&&ir[e]?(""+t).trim():t+"px"}function As(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var l=n.indexOf("--")===0,a=Ws(n,t[n],l);n==="float"&&(n="cssFloat"),l?e.setProperty(n,a):e[n]=a}}var $c=X({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yi(e,t){if(t){if($c[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(u(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(u(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(u(61))}if(t.style!=null&&typeof t.style!="object")throw Error(u(62))}}function mi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 vi=null;function Si(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bi=null,Mn=null,zn=null;function Hs(e){if(e=Pr(e)){if(typeof bi!="function")throw Error(u(280));var t=e.stateNode;t&&(t=yo(t),bi(e.stateNode,e.type,t))}}function Us(e){Mn?zn?zn.push(e):zn=[e]:Mn=e}function Vs(){if(Mn){var e=Mn,t=zn;if(zn=Mn=null,Hs(e),t)for(e=0;e<t.length;e++)Hs(t[e])}}function Qs(e,t){return e(t)}function Ys(){}var wi=!1;function Js(e,t,n){if(wi)return e(t,n);wi=!0;try{return Qs(e,t,n)}finally{wi=!1,(Mn!==null||zn!==null)&&(Ys(),Vs())}}function lr(e,t){var n=e.stateNode;if(n===null)return null;var l=yo(n);if(l===null)return null;n=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var ki=!1;if(y)try{var sr={};Object.defineProperty(sr,"passive",{get:function(){ki=!0}}),window.addEventListener("test",sr,sr),window.removeEventListener("test",sr,sr)}catch{ki=!1}function Nc(e,t,n,l,a,d,h,S,k){var I=Array.prototype.slice.call(arguments,3);try{t.apply(n,I)}catch(B){this.onError(B)}}var ar=!1,Jr=null,Kr=!1,ji=null,Dc={onError:function(e){ar=!0,Jr=e}};function Oc(e,t,n,l,a,d,h,S,k){ar=!1,Jr=null,Nc.apply(Dc,arguments)}function Bc(e,t,n,l,a,d,h,S,k){if(Oc.apply(this,arguments),ar){if(ar){var I=Jr;ar=!1,Jr=null}else throw Error(u(198));Kr||(Kr=!0,ji=I)}}function hn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Ks(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 Gs(e){if(hn(e)!==e)throw Error(u(188))}function Wc(e){var t=e.alternate;if(!t){if(t=hn(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var d=a.alternate;if(d===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===d.child){for(d=a.child;d;){if(d===n)return Gs(a),e;if(d===l)return Gs(a),t;d=d.sibling}throw Error(u(188))}if(n.return!==l.return)n=a,l=d;else{for(var h=!1,S=a.child;S;){if(S===n){h=!0,n=a,l=d;break}if(S===l){h=!0,l=a,n=d;break}S=S.sibling}if(!h){for(S=d.child;S;){if(S===n){h=!0,n=d,l=a;break}if(S===l){h=!0,l=d,n=a;break}S=S.sibling}if(!h)throw Error(u(189))}}if(n.alternate!==l)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function Xs(e){return e=Wc(e),e!==null?Zs(e):null}function Zs(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Zs(e);if(t!==null)return t;e=e.sibling}return null}var qs=s.unstable_scheduleCallback,ea=s.unstable_cancelCallback,Ac=s.unstable_shouldYield,Hc=s.unstable_requestPaint,Be=s.unstable_now,Uc=s.unstable_getCurrentPriorityLevel,Ci=s.unstable_ImmediatePriority,ta=s.unstable_UserBlockingPriority,Gr=s.unstable_NormalPriority,Vc=s.unstable_LowPriority,na=s.unstable_IdlePriority,Xr=null,Lt=null;function Qc(e){if(Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(Xr,e,void 0,(e.current.flags&128)===128)}catch{}}var St=Math.clz32?Math.clz32:Kc,Yc=Math.log,Jc=Math.LN2;function Kc(e){return e>>>=0,e===0?32:31-(Yc(e)/Jc|0)|0}var Zr=64,qr=4194304;function ur(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function eo(e,t){var n=e.pendingLanes;if(n===0)return 0;var l=0,a=e.suspendedLanes,d=e.pingedLanes,h=n&268435455;if(h!==0){var S=h&~a;S!==0?l=ur(S):(d&=h,d!==0&&(l=ur(d)))}else h=n&~a,h!==0?l=ur(h):d!==0&&(l=ur(d));if(l===0)return 0;if(t!==0&&t!==l&&(t&a)===0&&(a=l&-l,d=t&-t,a>=d||a===16&&(d&4194240)!==0))return t;if((l&4)!==0&&(l|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)n=31-St(t),a=1<<n,l|=e[n],t&=~a;return l}function Gc(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xc(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,d=e.pendingLanes;0<d;){var h=31-St(d),S=1<<h,k=a[h];k===-1?((S&n)===0||(S&l)!==0)&&(a[h]=Gc(S,t)):k<=t&&(e.expiredLanes|=S),d&=~S}}function Ti(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ra(){var e=Zr;return Zr<<=1,(Zr&4194240)===0&&(Zr=64),e}function Pi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function dr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=n}function Zc(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-St(n),d=1<<a;t[a]=0,l[a]=-1,e[a]=-1,n&=~d}}function _i(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-St(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}var Te=0;function oa(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var ia,Li,la,sa,aa,Mi=!1,to=[],Yt=null,Jt=null,Kt=null,cr=new Map,pr=new Map,Gt=[],qc="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 submit".split(" ");function ua(e,t){switch(e){case"focusin":case"focusout":Yt=null;break;case"dragenter":case"dragleave":Jt=null;break;case"mouseover":case"mouseout":Kt=null;break;case"pointerover":case"pointerout":cr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pr.delete(t.pointerId)}}function fr(e,t,n,l,a,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:d,targetContainers:[a]},t!==null&&(t=Pr(t),t!==null&&Li(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function ep(e,t,n,l,a){switch(t){case"focusin":return Yt=fr(Yt,e,t,n,l,a),!0;case"dragenter":return Jt=fr(Jt,e,t,n,l,a),!0;case"mouseover":return Kt=fr(Kt,e,t,n,l,a),!0;case"pointerover":var d=a.pointerId;return cr.set(d,fr(cr.get(d)||null,e,t,n,l,a)),!0;case"gotpointercapture":return d=a.pointerId,pr.set(d,fr(pr.get(d)||null,e,t,n,l,a)),!0}return!1}function da(e){var t=xn(e.target);if(t!==null){var n=hn(t);if(n!==null){if(t=n.tag,t===13){if(t=Ks(n),t!==null){e.blockedOn=t,aa(e.priority,function(){la(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function no(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ei(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);vi=l,n.target.dispatchEvent(l),vi=null}else return t=Pr(n),t!==null&&Li(t),e.blockedOn=n,!1;t.shift()}return!0}function ca(e,t,n){no(e)&&n.delete(t)}function tp(){Mi=!1,Yt!==null&&no(Yt)&&(Yt=null),Jt!==null&&no(Jt)&&(Jt=null),Kt!==null&&no(Kt)&&(Kt=null),cr.forEach(ca),pr.forEach(ca)}function gr(e,t){e.blockedOn===t&&(e.blockedOn=null,Mi||(Mi=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,tp)))}function hr(e){function t(a){return gr(a,e)}if(0<to.length){gr(to[0],e);for(var n=1;n<to.length;n++){var l=to[n];l.blockedOn===e&&(l.blockedOn=null)}}for(Yt!==null&&gr(Yt,e),Jt!==null&&gr(Jt,e),Kt!==null&&gr(Kt,e),cr.forEach(t),pr.forEach(t),n=0;n<Gt.length;n++)l=Gt[n],l.blockedOn===e&&(l.blockedOn=null);for(;0<Gt.length&&(n=Gt[0],n.blockedOn===null);)da(n),n.blockedOn===null&&Gt.shift()}var En=W.ReactCurrentBatchConfig,ro=!0;function np(e,t,n,l){var a=Te,d=En.transition;En.transition=null;try{Te=1,zi(e,t,n,l)}finally{Te=a,En.transition=d}}function rp(e,t,n,l){var a=Te,d=En.transition;En.transition=null;try{Te=4,zi(e,t,n,l)}finally{Te=a,En.transition=d}}function zi(e,t,n,l){if(ro){var a=Ei(e,t,n,l);if(a===null)Ki(e,t,l,oo,n),ua(e,l);else if(ep(a,e,t,n,l))l.stopPropagation();else if(ua(e,l),t&4&&-1<qc.indexOf(e)){for(;a!==null;){var d=Pr(a);if(d!==null&&ia(d),d=Ei(e,t,n,l),d===null&&Ki(e,t,l,oo,n),d===a)break;a=d}a!==null&&l.stopPropagation()}else Ki(e,t,l,null,n)}}var oo=null;function Ei(e,t,n,l){if(oo=null,e=Si(l),e=xn(e),e!==null)if(t=hn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ks(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return oo=e,null}function pa(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Uc()){case Ci:return 1;case ta:return 4;case Gr:case Vc:return 16;case na:return 536870912;default:return 16}default:return 16}}var Xt=null,Ri=null,io=null;function fa(){if(io)return io;var e,t=Ri,n=t.length,l,a="value"in Xt?Xt.value:Xt.textContent,d=a.length;for(e=0;e<n&&t[e]===a[e];e++);var h=n-e;for(l=1;l<=h&&t[n-l]===a[d-l];l++);return io=a.slice(e,1<l?1-l:void 0)}function lo(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 so(){return!0}function ga(){return!1}function ut(e){function t(n,l,a,d,h){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=d,this.target=h,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(n=e[S],this[S]=n?n(d):d[S]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?so:ga,this.isPropagationStopped=ga,this}return X(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=so)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=so)},persist:function(){},isPersistent:so}),t}var Rn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fi=ut(Rn),xr=X({},Rn,{view:0,detail:0}),op=ut(xr),Ii,$i,yr,ao=X({},xr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Di,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!==yr&&(yr&&e.type==="mousemove"?(Ii=e.screenX-yr.screenX,$i=e.screenY-yr.screenY):$i=Ii=0,yr=e),Ii)},movementY:function(e){return"movementY"in e?e.movementY:$i}}),ha=ut(ao),ip=X({},ao,{dataTransfer:0}),lp=ut(ip),sp=X({},xr,{relatedTarget:0}),Ni=ut(sp),ap=X({},Rn,{animationName:0,elapsedTime:0,pseudoElement:0}),up=ut(ap),dp=X({},Rn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cp=ut(dp),pp=X({},Rn,{data:0}),xa=ut(pp),fp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gp={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"},hp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hp[e])?!!t[e]:!1}function Di(){return xp}var yp=X({},xr,{key:function(e){if(e.key){var t=fp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=lo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?gp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Di,charCode:function(e){return e.type==="keypress"?lo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?lo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mp=ut(yp),vp=X({},ao,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ya=ut(vp),Sp=X({},xr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Di}),bp=ut(Sp),wp=X({},Rn,{propertyName:0,elapsedTime:0,pseudoElement:0}),kp=ut(wp),jp=X({},ao,{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}),Cp=ut(jp),Tp=[9,13,27,32],Oi=y&&"CompositionEvent"in window,mr=null;y&&"documentMode"in document&&(mr=document.documentMode);var Pp=y&&"TextEvent"in window&&!mr,ma=y&&(!Oi||mr&&8<mr&&11>=mr),va=" ",Sa=!1;function ba(e,t){switch(e){case"keyup":return Tp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wa(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fn=!1;function _p(e,t){switch(e){case"compositionend":return wa(t);case"keypress":return t.which!==32?null:(Sa=!0,va);case"textInput":return e=t.data,e===va&&Sa?null:e;default:return null}}function Lp(e,t){if(Fn)return e==="compositionend"||!Oi&&ba(e,t)?(e=fa(),io=Ri=Xt=null,Fn=!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 ma&&t.locale!=="ko"?null:t.data;default:return null}}var Mp={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 ka(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mp[e.type]:t==="textarea"}function ja(e,t,n,l){Us(l),t=go(t,"onChange"),0<t.length&&(n=new Fi("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var vr=null,Sr=null;function zp(e){Aa(e,0)}function uo(e){var t=On(e);if(Vt(t))return e}function Ep(e,t){if(e==="change")return t}var Ca=!1;if(y){var Bi;if(y){var Wi="oninput"in document;if(!Wi){var Ta=document.createElement("div");Ta.setAttribute("oninput","return;"),Wi=typeof Ta.oninput=="function"}Bi=Wi}else Bi=!1;Ca=Bi&&(!document.documentMode||9<document.documentMode)}function Pa(){vr&&(vr.detachEvent("onpropertychange",_a),Sr=vr=null)}function _a(e){if(e.propertyName==="value"&&uo(Sr)){var t=[];ja(t,Sr,e,Si(e)),Js(zp,t)}}function Rp(e,t,n){e==="focusin"?(Pa(),vr=t,Sr=n,vr.attachEvent("onpropertychange",_a)):e==="focusout"&&Pa()}function Fp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return uo(Sr)}function Ip(e,t){if(e==="click")return uo(t)}function $p(e,t){if(e==="input"||e==="change")return uo(t)}function Np(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bt=typeof Object.is=="function"?Object.is:Np;function br(e,t){if(bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!x.call(t,a)||!bt(e[a],t[a]))return!1}return!0}function La(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ma(e,t){var n=La(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=La(n)}}function za(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?za(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ea(){for(var e=window,t=Qt();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qt(e.document)}return t}function Ai(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")}function Dp(e){var t=Ea(),n=e.focusedElem,l=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&za(n.ownerDocument.documentElement,n)){if(l!==null&&Ai(n)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,d=Math.min(l.start,a);l=l.end===void 0?d:Math.min(l.end,a),!e.extend&&d>l&&(a=l,l=d,d=a),a=Ma(n,d);var h=Ma(n,l);a&&h&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==h.node||e.focusOffset!==h.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),d>l?(e.addRange(t),e.extend(h.node,h.offset)):(t.setEnd(h.node,h.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Op=y&&"documentMode"in document&&11>=document.documentMode,In=null,Hi=null,wr=null,Ui=!1;function Ra(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ui||In==null||In!==Qt(l)||(l=In,"selectionStart"in l&&Ai(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),wr&&br(wr,l)||(wr=l,l=go(Hi,"onSelect"),0<l.length&&(t=new Fi("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=In)))}function co(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $n={animationend:co("Animation","AnimationEnd"),animationiteration:co("Animation","AnimationIteration"),animationstart:co("Animation","AnimationStart"),transitionend:co("Transition","TransitionEnd")},Vi={},Fa={};y&&(Fa=document.createElement("div").style,"AnimationEvent"in window||(delete $n.animationend.animation,delete $n.animationiteration.animation,delete $n.animationstart.animation),"TransitionEvent"in window||delete $n.transitionend.transition);function po(e){if(Vi[e])return Vi[e];if(!$n[e])return e;var t=$n[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fa)return Vi[e]=t[n];return e}var Ia=po("animationend"),$a=po("animationiteration"),Na=po("animationstart"),Da=po("transitionend"),Oa=new Map,Ba="abort auxClick 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(" ");function Zt(e,t){Oa.set(e,t),f(t,[e])}for(var Qi=0;Qi<Ba.length;Qi++){var Yi=Ba[Qi],Bp=Yi.toLowerCase(),Wp=Yi[0].toUpperCase()+Yi.slice(1);Zt(Bp,"on"+Wp)}Zt(Ia,"onAnimationEnd"),Zt($a,"onAnimationIteration"),Zt(Na,"onAnimationStart"),Zt("dblclick","onDoubleClick"),Zt("focusin","onFocus"),Zt("focusout","onBlur"),Zt(Da,"onTransitionEnd"),g("onMouseEnter",["mouseout","mouseover"]),g("onMouseLeave",["mouseout","mouseover"]),g("onPointerEnter",["pointerout","pointerover"]),g("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var kr="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(" "),Ap=new Set("cancel close invalid load scroll toggle".split(" ").concat(kr));function Wa(e,t,n){var l=e.type||"unknown-event";e.currentTarget=n,Bc(l,t,void 0,e),e.currentTarget=null}function Aa(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var d=void 0;if(t)for(var h=l.length-1;0<=h;h--){var S=l[h],k=S.instance,I=S.currentTarget;if(S=S.listener,k!==d&&a.isPropagationStopped())break e;Wa(a,S,I),d=k}else for(h=0;h<l.length;h++){if(S=l[h],k=S.instance,I=S.currentTarget,S=S.listener,k!==d&&a.isPropagationStopped())break e;Wa(a,S,I),d=k}}}if(Kr)throw e=ji,Kr=!1,ji=null,e}function Me(e,t){var n=t[tl];n===void 0&&(n=t[tl]=new Set);var l=e+"__bubble";n.has(l)||(Ha(t,e,2,!1),n.add(l))}function Ji(e,t,n){var l=0;t&&(l|=4),Ha(n,e,l,t)}var fo="_reactListening"+Math.random().toString(36).slice(2);function jr(e){if(!e[fo]){e[fo]=!0,c.forEach(function(n){n!=="selectionchange"&&(Ap.has(n)||Ji(n,!1,e),Ji(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fo]||(t[fo]=!0,Ji("selectionchange",!1,t))}}function Ha(e,t,n,l){switch(pa(t)){case 1:var a=np;break;case 4:a=rp;break;default:a=zi}n=a.bind(null,t,n,e),a=void 0,!ki||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function Ki(e,t,n,l,a){var d=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var h=l.tag;if(h===3||h===4){var S=l.stateNode.containerInfo;if(S===a||S.nodeType===8&&S.parentNode===a)break;if(h===4)for(h=l.return;h!==null;){var k=h.tag;if((k===3||k===4)&&(k=h.stateNode.containerInfo,k===a||k.nodeType===8&&k.parentNode===a))return;h=h.return}for(;S!==null;){if(h=xn(S),h===null)return;if(k=h.tag,k===5||k===6){l=d=h;continue e}S=S.parentNode}}l=l.return}Js(function(){var I=d,B=Si(n),H=[];e:{var O=Oa.get(e);if(O!==void 0){var Z=Fi,te=e;switch(e){case"keypress":if(lo(n)===0)break e;case"keydown":case"keyup":Z=mp;break;case"focusin":te="focus",Z=Ni;break;case"focusout":te="blur",Z=Ni;break;case"beforeblur":case"afterblur":Z=Ni;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=ha;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=lp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=bp;break;case Ia:case $a:case Na:Z=up;break;case Da:Z=kp;break;case"scroll":Z=op;break;case"wheel":Z=Cp;break;case"copy":case"cut":case"paste":Z=cp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=ya}var ne=(t&4)!==0,We=!ne&&e==="scroll",z=ne?O!==null?O+"Capture":null:O;ne=[];for(var C=I,R;C!==null;){R=C;var Q=R.stateNode;if(R.tag===5&&Q!==null&&(R=Q,z!==null&&(Q=lr(C,z),Q!=null&&ne.push(Cr(C,Q,R)))),We)break;C=C.return}0<ne.length&&(O=new Z(O,te,null,n,B),H.push({event:O,listeners:ne}))}}if((t&7)===0){e:{if(O=e==="mouseover"||e==="pointerover",Z=e==="mouseout"||e==="pointerout",O&&n!==vi&&(te=n.relatedTarget||n.fromElement)&&(xn(te)||te[$t]))break e;if((Z||O)&&(O=B.window===B?B:(O=B.ownerDocument)?O.defaultView||O.parentWindow:window,Z?(te=n.relatedTarget||n.toElement,Z=I,te=te?xn(te):null,te!==null&&(We=hn(te),te!==We||te.tag!==5&&te.tag!==6)&&(te=null)):(Z=null,te=I),Z!==te)){if(ne=ha,Q="onMouseLeave",z="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(ne=ya,Q="onPointerLeave",z="onPointerEnter",C="pointer"),We=Z==null?O:On(Z),R=te==null?O:On(te),O=new ne(Q,C+"leave",Z,n,B),O.target=We,O.relatedTarget=R,Q=null,xn(B)===I&&(ne=new ne(z,C+"enter",te,n,B),ne.target=R,ne.relatedTarget=We,Q=ne),We=Q,Z&&te)t:{for(ne=Z,z=te,C=0,R=ne;R;R=Nn(R))C++;for(R=0,Q=z;Q;Q=Nn(Q))R++;for(;0<C-R;)ne=Nn(ne),C--;for(;0<R-C;)z=Nn(z),R--;for(;C--;){if(ne===z||z!==null&&ne===z.alternate)break t;ne=Nn(ne),z=Nn(z)}ne=null}else ne=null;Z!==null&&Ua(H,O,Z,ne,!1),te!==null&&We!==null&&Ua(H,We,te,ne,!0)}}e:{if(O=I?On(I):window,Z=O.nodeName&&O.nodeName.toLowerCase(),Z==="select"||Z==="input"&&O.type==="file")var re=Ep;else if(ka(O))if(Ca)re=$p;else{re=Fp;var le=Rp}else(Z=O.nodeName)&&Z.toLowerCase()==="input"&&(O.type==="checkbox"||O.type==="radio")&&(re=Ip);if(re&&(re=re(e,I))){ja(H,re,n,B);break e}le&&le(e,O,I),e==="focusout"&&(le=O._wrapperState)&&le.controlled&&O.type==="number"&&gi(O,"number",O.value)}switch(le=I?On(I):window,e){case"focusin":(ka(le)||le.contentEditable==="true")&&(In=le,Hi=I,wr=null);break;case"focusout":wr=Hi=In=null;break;case"mousedown":Ui=!0;break;case"contextmenu":case"mouseup":case"dragend":Ui=!1,Ra(H,n,B);break;case"selectionchange":if(Op)break;case"keydown":case"keyup":Ra(H,n,B)}var se;if(Oi)e:{switch(e){case"compositionstart":var ae="onCompositionStart";break e;case"compositionend":ae="onCompositionEnd";break e;case"compositionupdate":ae="onCompositionUpdate";break e}ae=void 0}else Fn?ba(e,n)&&(ae="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ae="onCompositionStart");ae&&(ma&&n.locale!=="ko"&&(Fn||ae!=="onCompositionStart"?ae==="onCompositionEnd"&&Fn&&(se=fa()):(Xt=B,Ri="value"in Xt?Xt.value:Xt.textContent,Fn=!0)),le=go(I,ae),0<le.length&&(ae=new xa(ae,e,null,n,B),H.push({event:ae,listeners:le}),se?ae.data=se:(se=wa(n),se!==null&&(ae.data=se)))),(se=Pp?_p(e,n):Lp(e,n))&&(I=go(I,"onBeforeInput"),0<I.length&&(B=new xa("onBeforeInput","beforeinput",null,n,B),H.push({event:B,listeners:I}),B.data=se))}Aa(H,t)})}function Cr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function go(e,t){for(var n=t+"Capture",l=[];e!==null;){var a=e,d=a.stateNode;a.tag===5&&d!==null&&(a=d,d=lr(e,n),d!=null&&l.unshift(Cr(e,d,a)),d=lr(e,t),d!=null&&l.push(Cr(e,d,a))),e=e.return}return l}function Nn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ua(e,t,n,l,a){for(var d=t._reactName,h=[];n!==null&&n!==l;){var S=n,k=S.alternate,I=S.stateNode;if(k!==null&&k===l)break;S.tag===5&&I!==null&&(S=I,a?(k=lr(n,d),k!=null&&h.unshift(Cr(n,k,S))):a||(k=lr(n,d),k!=null&&h.push(Cr(n,k,S)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Hp=/\r\n?/g,Up=/\u0000|\uFFFD/g;function Va(e){return(typeof e=="string"?e:""+e).replace(Hp,`
|
|
6
|
+
`).replace(Up,"")}function ho(e,t,n){if(t=Va(t),Va(e)!==t&&n)throw Error(u(425))}function xo(){}var Gi=null,Xi=null;function Zi(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qi=typeof setTimeout=="function"?setTimeout:void 0,Vp=typeof clearTimeout=="function"?clearTimeout:void 0,Qa=typeof Promise=="function"?Promise:void 0,Qp=typeof queueMicrotask=="function"?queueMicrotask:typeof Qa<"u"?function(e){return Qa.resolve(null).then(e).catch(Yp)}:qi;function Yp(e){setTimeout(function(){throw e})}function el(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(l===0){e.removeChild(a),hr(t);return}l--}else n!=="$"&&n!=="$?"&&n!=="$!"||l++;n=a}while(n);hr(t)}function qt(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==="$?")break;if(t==="/$")return null}}return e}function Ya(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Dn=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Dn,Tr="__reactProps$"+Dn,$t="__reactContainer$"+Dn,tl="__reactEvents$"+Dn,Jp="__reactListeners$"+Dn,Kp="__reactHandles$"+Dn;function xn(e){var t=e[Mt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[$t]||n[Mt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ya(e);e!==null;){if(n=e[Mt])return n;e=Ya(e)}return t}e=n,n=e.parentNode}return null}function Pr(e){return e=e[Mt]||e[$t],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function On(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(u(33))}function yo(e){return e[Tr]||null}var nl=[],Bn=-1;function en(e){return{current:e}}function ze(e){0>Bn||(e.current=nl[Bn],nl[Bn]=null,Bn--)}function _e(e,t){Bn++,nl[Bn]=e.current,e.current=t}var tn={},Xe=en(tn),rt=en(!1),yn=tn;function Wn(e,t){var n=e.type.contextTypes;if(!n)return tn;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var a={},d;for(d in n)a[d]=t[d];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function ot(e){return e=e.childContextTypes,e!=null}function mo(){ze(rt),ze(Xe)}function Ja(e,t,n){if(Xe.current!==tn)throw Error(u(168));_e(Xe,t),_e(rt,n)}function Ka(e,t,n){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return n;l=l.getChildContext();for(var a in l)if(!(a in t))throw Error(u(108,we(e)||"Unknown",a));return X({},n,l)}function vo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tn,yn=Xe.current,_e(Xe,e),_e(rt,rt.current),!0}function Ga(e,t,n){var l=e.stateNode;if(!l)throw Error(u(169));n?(e=Ka(e,t,yn),l.__reactInternalMemoizedMergedChildContext=e,ze(rt),ze(Xe),_e(Xe,e)):ze(rt),_e(rt,n)}var Nt=null,So=!1,rl=!1;function Xa(e){Nt===null?Nt=[e]:Nt.push(e)}function Gp(e){So=!0,Xa(e)}function nn(){if(!rl&&Nt!==null){rl=!0;var e=0,t=Te;try{var n=Nt;for(Te=1;e<n.length;e++){var l=n[e];do l=l(!0);while(l!==null)}Nt=null,So=!1}catch(a){throw Nt!==null&&(Nt=Nt.slice(e+1)),qs(Ci,nn),a}finally{Te=t,rl=!1}}return null}var An=[],Hn=0,bo=null,wo=0,ft=[],gt=0,mn=null,Dt=1,Ot="";function vn(e,t){An[Hn++]=wo,An[Hn++]=bo,bo=e,wo=t}function Za(e,t,n){ft[gt++]=Dt,ft[gt++]=Ot,ft[gt++]=mn,mn=e;var l=Dt;e=Ot;var a=32-St(l)-1;l&=~(1<<a),n+=1;var d=32-St(t)+a;if(30<d){var h=a-a%5;d=(l&(1<<h)-1).toString(32),l>>=h,a-=h,Dt=1<<32-St(t)+a|n<<a|l,Ot=d+e}else Dt=1<<d|n<<a|l,Ot=e}function ol(e){e.return!==null&&(vn(e,1),Za(e,1,0))}function il(e){for(;e===bo;)bo=An[--Hn],An[Hn]=null,wo=An[--Hn],An[Hn]=null;for(;e===mn;)mn=ft[--gt],ft[gt]=null,Ot=ft[--gt],ft[gt]=null,Dt=ft[--gt],ft[gt]=null}var dt=null,ct=null,Fe=!1,wt=null;function qa(e,t){var n=mt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function eu(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,dt=e,ct=qt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dt=e,ct=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=mn!==null?{id:Dt,overflow:Ot}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=mt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,dt=e,ct=null,!0):!1;default:return!1}}function ll(e){return(e.mode&1)!==0&&(e.flags&128)===0}function sl(e){if(Fe){var t=ct;if(t){var n=t;if(!eu(e,t)){if(ll(e))throw Error(u(418));t=qt(n.nextSibling);var l=dt;t&&eu(e,t)?qa(l,n):(e.flags=e.flags&-4097|2,Fe=!1,dt=e)}}else{if(ll(e))throw Error(u(418));e.flags=e.flags&-4097|2,Fe=!1,dt=e}}}function tu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dt=e}function ko(e){if(e!==dt)return!1;if(!Fe)return tu(e),Fe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Zi(e.type,e.memoizedProps)),t&&(t=ct)){if(ll(e))throw nu(),Error(u(418));for(;t;)qa(e,t),t=qt(t.nextSibling)}if(tu(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ct=qt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ct=null}}else ct=dt?qt(e.stateNode.nextSibling):null;return!0}function nu(){for(var e=ct;e;)e=qt(e.nextSibling)}function Un(){ct=dt=null,Fe=!1}function al(e){wt===null?wt=[e]:wt.push(e)}var Xp=W.ReactCurrentBatchConfig;function _r(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(u(309));var l=n.stateNode}if(!l)throw Error(u(147,e));var a=l,d=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===d?t.ref:(t=function(h){var S=a.refs;h===null?delete S[d]:S[d]=h},t._stringRef=d,t)}if(typeof e!="string")throw Error(u(284));if(!n._owner)throw Error(u(290,e))}return e}function jo(e,t){throw e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ru(e){var t=e._init;return t(e._payload)}function ou(e){function t(z,C){if(e){var R=z.deletions;R===null?(z.deletions=[C],z.flags|=16):R.push(C)}}function n(z,C){if(!e)return null;for(;C!==null;)t(z,C),C=C.sibling;return null}function l(z,C){for(z=new Map;C!==null;)C.key!==null?z.set(C.key,C):z.set(C.index,C),C=C.sibling;return z}function a(z,C){return z=cn(z,C),z.index=0,z.sibling=null,z}function d(z,C,R){return z.index=R,e?(R=z.alternate,R!==null?(R=R.index,R<C?(z.flags|=2,C):R):(z.flags|=2,C)):(z.flags|=1048576,C)}function h(z){return e&&z.alternate===null&&(z.flags|=2),z}function S(z,C,R,Q){return C===null||C.tag!==6?(C=ql(R,z.mode,Q),C.return=z,C):(C=a(C,R),C.return=z,C)}function k(z,C,R,Q){var re=R.type;return re===K?B(z,C,R.props.children,Q,R.key):C!==null&&(C.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===Re&&ru(re)===C.type)?(Q=a(C,R.props),Q.ref=_r(z,C,R),Q.return=z,Q):(Q=Jo(R.type,R.key,R.props,null,z.mode,Q),Q.ref=_r(z,C,R),Q.return=z,Q)}function I(z,C,R,Q){return C===null||C.tag!==4||C.stateNode.containerInfo!==R.containerInfo||C.stateNode.implementation!==R.implementation?(C=es(R,z.mode,Q),C.return=z,C):(C=a(C,R.children||[]),C.return=z,C)}function B(z,C,R,Q,re){return C===null||C.tag!==7?(C=Pn(R,z.mode,Q,re),C.return=z,C):(C=a(C,R),C.return=z,C)}function H(z,C,R){if(typeof C=="string"&&C!==""||typeof C=="number")return C=ql(""+C,z.mode,R),C.return=z,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case $:return R=Jo(C.type,C.key,C.props,null,z.mode,R),R.ref=_r(z,null,C),R.return=z,R;case A:return C=es(C,z.mode,R),C.return=z,C;case Re:var Q=C._init;return H(z,Q(C._payload),R)}if(rr(C)||q(C))return C=Pn(C,z.mode,R,null),C.return=z,C;jo(z,C)}return null}function O(z,C,R,Q){var re=C!==null?C.key:null;if(typeof R=="string"&&R!==""||typeof R=="number")return re!==null?null:S(z,C,""+R,Q);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case $:return R.key===re?k(z,C,R,Q):null;case A:return R.key===re?I(z,C,R,Q):null;case Re:return re=R._init,O(z,C,re(R._payload),Q)}if(rr(R)||q(R))return re!==null?null:B(z,C,R,Q,null);jo(z,R)}return null}function Z(z,C,R,Q,re){if(typeof Q=="string"&&Q!==""||typeof Q=="number")return z=z.get(R)||null,S(C,z,""+Q,re);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case $:return z=z.get(Q.key===null?R:Q.key)||null,k(C,z,Q,re);case A:return z=z.get(Q.key===null?R:Q.key)||null,I(C,z,Q,re);case Re:var le=Q._init;return Z(z,C,R,le(Q._payload),re)}if(rr(Q)||q(Q))return z=z.get(R)||null,B(C,z,Q,re,null);jo(C,Q)}return null}function te(z,C,R,Q){for(var re=null,le=null,se=C,ae=C=0,Ye=null;se!==null&&ae<R.length;ae++){se.index>ae?(Ye=se,se=null):Ye=se.sibling;var je=O(z,se,R[ae],Q);if(je===null){se===null&&(se=Ye);break}e&&se&&je.alternate===null&&t(z,se),C=d(je,C,ae),le===null?re=je:le.sibling=je,le=je,se=Ye}if(ae===R.length)return n(z,se),Fe&&vn(z,ae),re;if(se===null){for(;ae<R.length;ae++)se=H(z,R[ae],Q),se!==null&&(C=d(se,C,ae),le===null?re=se:le.sibling=se,le=se);return Fe&&vn(z,ae),re}for(se=l(z,se);ae<R.length;ae++)Ye=Z(se,z,ae,R[ae],Q),Ye!==null&&(e&&Ye.alternate!==null&&se.delete(Ye.key===null?ae:Ye.key),C=d(Ye,C,ae),le===null?re=Ye:le.sibling=Ye,le=Ye);return e&&se.forEach(function(pn){return t(z,pn)}),Fe&&vn(z,ae),re}function ne(z,C,R,Q){var re=q(R);if(typeof re!="function")throw Error(u(150));if(R=re.call(R),R==null)throw Error(u(151));for(var le=re=null,se=C,ae=C=0,Ye=null,je=R.next();se!==null&&!je.done;ae++,je=R.next()){se.index>ae?(Ye=se,se=null):Ye=se.sibling;var pn=O(z,se,je.value,Q);if(pn===null){se===null&&(se=Ye);break}e&&se&&pn.alternate===null&&t(z,se),C=d(pn,C,ae),le===null?re=pn:le.sibling=pn,le=pn,se=Ye}if(je.done)return n(z,se),Fe&&vn(z,ae),re;if(se===null){for(;!je.done;ae++,je=R.next())je=H(z,je.value,Q),je!==null&&(C=d(je,C,ae),le===null?re=je:le.sibling=je,le=je);return Fe&&vn(z,ae),re}for(se=l(z,se);!je.done;ae++,je=R.next())je=Z(se,z,ae,je.value,Q),je!==null&&(e&&je.alternate!==null&&se.delete(je.key===null?ae:je.key),C=d(je,C,ae),le===null?re=je:le.sibling=je,le=je);return e&&se.forEach(function(zf){return t(z,zf)}),Fe&&vn(z,ae),re}function We(z,C,R,Q){if(typeof R=="object"&&R!==null&&R.type===K&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case $:e:{for(var re=R.key,le=C;le!==null;){if(le.key===re){if(re=R.type,re===K){if(le.tag===7){n(z,le.sibling),C=a(le,R.props.children),C.return=z,z=C;break e}}else if(le.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===Re&&ru(re)===le.type){n(z,le.sibling),C=a(le,R.props),C.ref=_r(z,le,R),C.return=z,z=C;break e}n(z,le);break}else t(z,le);le=le.sibling}R.type===K?(C=Pn(R.props.children,z.mode,Q,R.key),C.return=z,z=C):(Q=Jo(R.type,R.key,R.props,null,z.mode,Q),Q.ref=_r(z,C,R),Q.return=z,z=Q)}return h(z);case A:e:{for(le=R.key;C!==null;){if(C.key===le)if(C.tag===4&&C.stateNode.containerInfo===R.containerInfo&&C.stateNode.implementation===R.implementation){n(z,C.sibling),C=a(C,R.children||[]),C.return=z,z=C;break e}else{n(z,C);break}else t(z,C);C=C.sibling}C=es(R,z.mode,Q),C.return=z,z=C}return h(z);case Re:return le=R._init,We(z,C,le(R._payload),Q)}if(rr(R))return te(z,C,R,Q);if(q(R))return ne(z,C,R,Q);jo(z,R)}return typeof R=="string"&&R!==""||typeof R=="number"?(R=""+R,C!==null&&C.tag===6?(n(z,C.sibling),C=a(C,R),C.return=z,z=C):(n(z,C),C=ql(R,z.mode,Q),C.return=z,z=C),h(z)):n(z,C)}return We}var Vn=ou(!0),iu=ou(!1),Co=en(null),To=null,Qn=null,ul=null;function dl(){ul=Qn=To=null}function cl(e){var t=Co.current;ze(Co),e._currentValue=t}function pl(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function Yn(e,t){To=e,ul=Qn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(it=!0),e.firstContext=null)}function ht(e){var t=e._currentValue;if(ul!==e)if(e={context:e,memoizedValue:t,next:null},Qn===null){if(To===null)throw Error(u(308));Qn=e,To.dependencies={lanes:0,firstContext:e}}else Qn=Qn.next=e;return t}var Sn=null;function fl(e){Sn===null?Sn=[e]:Sn.push(e)}function lu(e,t,n,l){var a=t.interleaved;return a===null?(n.next=n,fl(t)):(n.next=a.next,a.next=n),t.interleaved=n,Bt(e,l)}function Bt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var rn=!1;function gl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function su(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Wt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function on(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(be&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,Bt(e,n)}return a=l.interleaved,a===null?(t.next=t,fl(l)):(t.next=a.next,a.next=t),l.interleaved=t,Bt(e,n)}function Po(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,_i(e,n)}}function au(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,d=null;if(n=n.firstBaseUpdate,n!==null){do{var h={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};d===null?a=d=h:d=d.next=h,n=n.next}while(n!==null);d===null?a=d=t:d=d.next=t}else a=d=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:d,shared:l.shared,effects:l.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function _o(e,t,n,l){var a=e.updateQueue;rn=!1;var d=a.firstBaseUpdate,h=a.lastBaseUpdate,S=a.shared.pending;if(S!==null){a.shared.pending=null;var k=S,I=k.next;k.next=null,h===null?d=I:h.next=I,h=k;var B=e.alternate;B!==null&&(B=B.updateQueue,S=B.lastBaseUpdate,S!==h&&(S===null?B.firstBaseUpdate=I:S.next=I,B.lastBaseUpdate=k))}if(d!==null){var H=a.baseState;h=0,B=I=k=null,S=d;do{var O=S.lane,Z=S.eventTime;if((l&O)===O){B!==null&&(B=B.next={eventTime:Z,lane:0,tag:S.tag,payload:S.payload,callback:S.callback,next:null});e:{var te=e,ne=S;switch(O=t,Z=n,ne.tag){case 1:if(te=ne.payload,typeof te=="function"){H=te.call(Z,H,O);break e}H=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=ne.payload,O=typeof te=="function"?te.call(Z,H,O):te,O==null)break e;H=X({},H,O);break e;case 2:rn=!0}}S.callback!==null&&S.lane!==0&&(e.flags|=64,O=a.effects,O===null?a.effects=[S]:O.push(S))}else Z={eventTime:Z,lane:O,tag:S.tag,payload:S.payload,callback:S.callback,next:null},B===null?(I=B=Z,k=H):B=B.next=Z,h|=O;if(S=S.next,S===null){if(S=a.shared.pending,S===null)break;O=S,S=O.next,O.next=null,a.lastBaseUpdate=O,a.shared.pending=null}}while(!0);if(B===null&&(k=H),a.baseState=k,a.firstBaseUpdate=I,a.lastBaseUpdate=B,t=a.shared.interleaved,t!==null){a=t;do h|=a.lane,a=a.next;while(a!==t)}else d===null&&(a.shared.lanes=0);kn|=h,e.lanes=h,e.memoizedState=H}}function uu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],a=l.callback;if(a!==null){if(l.callback=null,l=n,typeof a!="function")throw Error(u(191,a));a.call(l)}}}var Lr={},zt=en(Lr),Mr=en(Lr),zr=en(Lr);function bn(e){if(e===Lr)throw Error(u(174));return e}function hl(e,t){switch(_e(zr,t),_e(Mr,e),_e(zt,Lr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:xi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=xi(t,e)}ze(zt),_e(zt,t)}function Jn(){ze(zt),ze(Mr),ze(zr)}function du(e){bn(zr.current);var t=bn(zt.current),n=xi(t,e.type);t!==n&&(_e(Mr,e),_e(zt,n))}function xl(e){Mr.current===e&&(ze(zt),ze(Mr))}var Ie=en(0);function Lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))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}var yl=[];function ml(){for(var e=0;e<yl.length;e++)yl[e]._workInProgressVersionPrimary=null;yl.length=0}var Mo=W.ReactCurrentDispatcher,vl=W.ReactCurrentBatchConfig,wn=0,$e=null,He=null,Ve=null,zo=!1,Er=!1,Rr=0,Zp=0;function Ze(){throw Error(u(321))}function Sl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!bt(e[n],t[n]))return!1;return!0}function bl(e,t,n,l,a,d){if(wn=d,$e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Mo.current=e===null||e.memoizedState===null?nf:rf,e=n(l,a),Er){d=0;do{if(Er=!1,Rr=0,25<=d)throw Error(u(301));d+=1,Ve=He=null,t.updateQueue=null,Mo.current=of,e=n(l,a)}while(Er)}if(Mo.current=Fo,t=He!==null&&He.next!==null,wn=0,Ve=He=$e=null,zo=!1,t)throw Error(u(300));return e}function wl(){var e=Rr!==0;return Rr=0,e}function Et(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ve===null?$e.memoizedState=Ve=e:Ve=Ve.next=e,Ve}function xt(){if(He===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=Ve===null?$e.memoizedState:Ve.next;if(t!==null)Ve=t,He=e;else{if(e===null)throw Error(u(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},Ve===null?$e.memoizedState=Ve=e:Ve=Ve.next=e}return Ve}function Fr(e,t){return typeof t=="function"?t(e):t}function kl(e){var t=xt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var l=He,a=l.baseQueue,d=n.pending;if(d!==null){if(a!==null){var h=a.next;a.next=d.next,d.next=h}l.baseQueue=a=d,n.pending=null}if(a!==null){d=a.next,l=l.baseState;var S=h=null,k=null,I=d;do{var B=I.lane;if((wn&B)===B)k!==null&&(k=k.next={lane:0,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),l=I.hasEagerState?I.eagerState:e(l,I.action);else{var H={lane:B,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null};k===null?(S=k=H,h=l):k=k.next=H,$e.lanes|=B,kn|=B}I=I.next}while(I!==null&&I!==d);k===null?h=l:k.next=S,bt(l,t.memoizedState)||(it=!0),t.memoizedState=l,t.baseState=h,t.baseQueue=k,n.lastRenderedState=l}if(e=n.interleaved,e!==null){a=e;do d=a.lane,$e.lanes|=d,kn|=d,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function jl(e){var t=xt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,d=t.memoizedState;if(a!==null){n.pending=null;var h=a=a.next;do d=e(d,h.action),h=h.next;while(h!==a);bt(d,t.memoizedState)||(it=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),n.lastRenderedState=d}return[d,l]}function cu(){}function pu(e,t){var n=$e,l=xt(),a=t(),d=!bt(l.memoizedState,a);if(d&&(l.memoizedState=a,it=!0),l=l.queue,Cl(hu.bind(null,n,l,e),[e]),l.getSnapshot!==t||d||Ve!==null&&Ve.memoizedState.tag&1){if(n.flags|=2048,Ir(9,gu.bind(null,n,l,a,t),void 0,null),Qe===null)throw Error(u(349));(wn&30)!==0||fu(n,t,a)}return a}function fu(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$e.updateQueue,t===null?(t={lastEffect:null,stores:null},$e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gu(e,t,n,l){t.value=n,t.getSnapshot=l,xu(t)&&yu(e)}function hu(e,t,n){return n(function(){xu(t)&&yu(e)})}function xu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bt(e,n)}catch{return!0}}function yu(e){var t=Bt(e,1);t!==null&&Tt(t,e,1,-1)}function mu(e){var t=Et();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:e},t.queue=e,e=e.dispatch=tf.bind(null,$e,e),[t.memoizedState,e]}function Ir(e,t,n,l){return e={tag:e,create:t,destroy:n,deps:l,next:null},t=$e.updateQueue,t===null?(t={lastEffect:null,stores:null},$e.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e)),e}function vu(){return xt().memoizedState}function Eo(e,t,n,l){var a=Et();$e.flags|=e,a.memoizedState=Ir(1|t,n,void 0,l===void 0?null:l)}function Ro(e,t,n,l){var a=xt();l=l===void 0?null:l;var d=void 0;if(He!==null){var h=He.memoizedState;if(d=h.destroy,l!==null&&Sl(l,h.deps)){a.memoizedState=Ir(t,n,d,l);return}}$e.flags|=e,a.memoizedState=Ir(1|t,n,d,l)}function Su(e,t){return Eo(8390656,8,e,t)}function Cl(e,t){return Ro(2048,8,e,t)}function bu(e,t){return Ro(4,2,e,t)}function wu(e,t){return Ro(4,4,e,t)}function ku(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ju(e,t,n){return n=n!=null?n.concat([e]):null,Ro(4,4,ku.bind(null,t,e),n)}function Tl(){}function Cu(e,t){var n=xt();t=t===void 0?null:t;var l=n.memoizedState;return l!==null&&t!==null&&Sl(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Tu(e,t){var n=xt();t=t===void 0?null:t;var l=n.memoizedState;return l!==null&&t!==null&&Sl(t,l[1])?l[0]:(e=e(),n.memoizedState=[e,t],e)}function Pu(e,t,n){return(wn&21)===0?(e.baseState&&(e.baseState=!1,it=!0),e.memoizedState=n):(bt(n,t)||(n=ra(),$e.lanes|=n,kn|=n,e.baseState=!0),t)}function qp(e,t){var n=Te;Te=n!==0&&4>n?n:4,e(!0);var l=vl.transition;vl.transition={};try{e(!1),t()}finally{Te=n,vl.transition=l}}function _u(){return xt().memoizedState}function ef(e,t,n){var l=un(e);if(n={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null},Lu(e))Mu(t,n);else if(n=lu(e,t,n,l),n!==null){var a=nt();Tt(n,e,l,a),zu(n,t,l)}}function tf(e,t,n){var l=un(e),a={lane:l,action:n,hasEagerState:!1,eagerState:null,next:null};if(Lu(e))Mu(t,a);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var h=t.lastRenderedState,S=d(h,n);if(a.hasEagerState=!0,a.eagerState=S,bt(S,h)){var k=t.interleaved;k===null?(a.next=a,fl(t)):(a.next=k.next,k.next=a),t.interleaved=a;return}}catch{}n=lu(e,t,a,l),n!==null&&(a=nt(),Tt(n,e,l,a),zu(n,t,l))}}function Lu(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function Mu(e,t){Er=zo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zu(e,t,n){if((n&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,_i(e,n)}}var Fo={readContext:ht,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useInsertionEffect:Ze,useLayoutEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useMutableSource:Ze,useSyncExternalStore:Ze,useId:Ze,unstable_isNewReconciler:!1},nf={readContext:ht,useCallback:function(e,t){return Et().memoizedState=[e,t===void 0?null:t],e},useContext:ht,useEffect:Su,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Eo(4194308,4,ku.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Eo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Eo(4,2,e,t)},useMemo:function(e,t){var n=Et();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var l=Et();return t=n!==void 0?n(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=ef.bind(null,$e,e),[l.memoizedState,e]},useRef:function(e){var t=Et();return e={current:e},t.memoizedState=e},useState:mu,useDebugValue:Tl,useDeferredValue:function(e){return Et().memoizedState=e},useTransition:function(){var e=mu(!1),t=e[0];return e=qp.bind(null,e[1]),Et().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var l=$e,a=Et();if(Fe){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Qe===null)throw Error(u(349));(wn&30)!==0||fu(l,t,n)}a.memoizedState=n;var d={value:n,getSnapshot:t};return a.queue=d,Su(hu.bind(null,l,d,e),[e]),l.flags|=2048,Ir(9,gu.bind(null,l,d,n,t),void 0,null),n},useId:function(){var e=Et(),t=Qe.identifierPrefix;if(Fe){var n=Ot,l=Dt;n=(l&~(1<<32-St(l)-1)).toString(32)+n,t=":"+t+"R"+n,n=Rr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Zp++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rf={readContext:ht,useCallback:Cu,useContext:ht,useEffect:Cl,useImperativeHandle:ju,useInsertionEffect:bu,useLayoutEffect:wu,useMemo:Tu,useReducer:kl,useRef:vu,useState:function(){return kl(Fr)},useDebugValue:Tl,useDeferredValue:function(e){var t=xt();return Pu(t,He.memoizedState,e)},useTransition:function(){var e=kl(Fr)[0],t=xt().memoizedState;return[e,t]},useMutableSource:cu,useSyncExternalStore:pu,useId:_u,unstable_isNewReconciler:!1},of={readContext:ht,useCallback:Cu,useContext:ht,useEffect:Cl,useImperativeHandle:ju,useInsertionEffect:bu,useLayoutEffect:wu,useMemo:Tu,useReducer:jl,useRef:vu,useState:function(){return jl(Fr)},useDebugValue:Tl,useDeferredValue:function(e){var t=xt();return He===null?t.memoizedState=e:Pu(t,He.memoizedState,e)},useTransition:function(){var e=jl(Fr)[0],t=xt().memoizedState;return[e,t]},useMutableSource:cu,useSyncExternalStore:pu,useId:_u,unstable_isNewReconciler:!1};function kt(e,t){if(e&&e.defaultProps){t=X({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Pl(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:X({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Io={isMounted:function(e){return(e=e._reactInternals)?hn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var l=nt(),a=un(e),d=Wt(l,a);d.payload=t,n!=null&&(d.callback=n),t=on(e,d,a),t!==null&&(Tt(t,e,a,l),Po(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=nt(),a=un(e),d=Wt(l,a);d.tag=1,d.payload=t,n!=null&&(d.callback=n),t=on(e,d,a),t!==null&&(Tt(t,e,a,l),Po(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=nt(),l=un(e),a=Wt(n,l);a.tag=2,t!=null&&(a.callback=t),t=on(e,a,l),t!==null&&(Tt(t,e,l,n),Po(t,e,l))}};function Eu(e,t,n,l,a,d,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,d,h):t.prototype&&t.prototype.isPureReactComponent?!br(n,l)||!br(a,d):!0}function Ru(e,t,n){var l=!1,a=tn,d=t.contextType;return typeof d=="object"&&d!==null?d=ht(d):(a=ot(t)?yn:Xe.current,l=t.contextTypes,d=(l=l!=null)?Wn(e,a):tn),t=new t(n,d),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Io,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=d),t}function Fu(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Io.enqueueReplaceState(t,t.state,null)}function _l(e,t,n,l){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},gl(e);var d=t.contextType;typeof d=="object"&&d!==null?a.context=ht(d):(d=ot(t)?yn:Xe.current,a.context=Wn(e,d)),a.state=e.memoizedState,d=t.getDerivedStateFromProps,typeof d=="function"&&(Pl(e,t,d,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Io.enqueueReplaceState(a,a.state,null),_o(e,n,a,l),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Kn(e,t){try{var n="",l=t;do n+=pe(l),l=l.return;while(l);var a=n}catch(d){a=`
|
|
7
|
+
Error generating stack: `+d.message+`
|
|
8
|
+
`+d.stack}return{value:e,source:t,stack:a,digest:null}}function Ll(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ml(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var lf=typeof WeakMap=="function"?WeakMap:Map;function Iu(e,t,n){n=Wt(-1,n),n.tag=3,n.payload={element:null};var l=t.value;return n.callback=function(){Ao||(Ao=!0,Vl=l),Ml(e,t)},n}function $u(e,t,n){n=Wt(-1,n),n.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var a=t.value;n.payload=function(){return l(a)},n.callback=function(){Ml(e,t)}}var d=e.stateNode;return d!==null&&typeof d.componentDidCatch=="function"&&(n.callback=function(){Ml(e,t),typeof l!="function"&&(sn===null?sn=new Set([this]):sn.add(this));var h=t.stack;this.componentDidCatch(t.value,{componentStack:h!==null?h:""})}),n}function Nu(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new lf;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(a.add(n),e=Sf.bind(null,e,t,n),t.then(e,e))}function Du(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ou(e,t,n,l,a){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Wt(-1,1),t.tag=2,on(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}var sf=W.ReactCurrentOwner,it=!1;function tt(e,t,n,l){t.child=e===null?iu(t,null,n,l):Vn(t,e.child,n,l)}function Bu(e,t,n,l,a){n=n.render;var d=t.ref;return Yn(t,a),l=bl(e,t,n,l,d,a),n=wl(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,At(e,t,a)):(Fe&&n&&ol(t),t.flags|=1,tt(e,t,l,a),t.child)}function Wu(e,t,n,l,a){if(e===null){var d=n.type;return typeof d=="function"&&!Zl(d)&&d.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=d,Au(e,t,d,l,a)):(e=Jo(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,(e.lanes&a)===0){var h=d.memoizedProps;if(n=n.compare,n=n!==null?n:br,n(h,l)&&e.ref===t.ref)return At(e,t,a)}return t.flags|=1,e=cn(d,l),e.ref=t.ref,e.return=t,t.child=e}function Au(e,t,n,l,a){if(e!==null){var d=e.memoizedProps;if(br(d,l)&&e.ref===t.ref)if(it=!1,t.pendingProps=l=d,(e.lanes&a)!==0)(e.flags&131072)!==0&&(it=!0);else return t.lanes=e.lanes,At(e,t,a)}return zl(e,t,n,l,a)}function Hu(e,t,n){var l=t.pendingProps,a=l.children,d=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_e(Xn,pt),pt|=n;else{if((n&1073741824)===0)return e=d!==null?d.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,_e(Xn,pt),pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=d!==null?d.baseLanes:n,_e(Xn,pt),pt|=l}else d!==null?(l=d.baseLanes|n,t.memoizedState=null):l=n,_e(Xn,pt),pt|=l;return tt(e,t,a,n),t.child}function Uu(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function zl(e,t,n,l,a){var d=ot(n)?yn:Xe.current;return d=Wn(t,d),Yn(t,a),n=bl(e,t,n,l,d,a),l=wl(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,At(e,t,a)):(Fe&&l&&ol(t),t.flags|=1,tt(e,t,n,a),t.child)}function Vu(e,t,n,l,a){if(ot(n)){var d=!0;vo(t)}else d=!1;if(Yn(t,a),t.stateNode===null)No(e,t),Ru(t,n,l),_l(t,n,l,a),l=!0;else if(e===null){var h=t.stateNode,S=t.memoizedProps;h.props=S;var k=h.context,I=n.contextType;typeof I=="object"&&I!==null?I=ht(I):(I=ot(n)?yn:Xe.current,I=Wn(t,I));var B=n.getDerivedStateFromProps,H=typeof B=="function"||typeof h.getSnapshotBeforeUpdate=="function";H||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S!==l||k!==I)&&Fu(t,h,l,I),rn=!1;var O=t.memoizedState;h.state=O,_o(t,l,h,a),k=t.memoizedState,S!==l||O!==k||rt.current||rn?(typeof B=="function"&&(Pl(t,n,B,l),k=t.memoizedState),(S=rn||Eu(t,n,S,l,O,k,I))?(H||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=k),h.props=l,h.state=k,h.context=I,l=S):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{h=t.stateNode,su(e,t),S=t.memoizedProps,I=t.type===t.elementType?S:kt(t.type,S),h.props=I,H=t.pendingProps,O=h.context,k=n.contextType,typeof k=="object"&&k!==null?k=ht(k):(k=ot(n)?yn:Xe.current,k=Wn(t,k));var Z=n.getDerivedStateFromProps;(B=typeof Z=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S!==H||O!==k)&&Fu(t,h,l,k),rn=!1,O=t.memoizedState,h.state=O,_o(t,l,h,a);var te=t.memoizedState;S!==H||O!==te||rt.current||rn?(typeof Z=="function"&&(Pl(t,n,Z,l),te=t.memoizedState),(I=rn||Eu(t,n,I,l,O,te,k)||!1)?(B||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,te,k),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,te,k)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=te),h.props=l,h.state=te,h.context=k,l=I):(typeof h.componentDidUpdate!="function"||S===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),l=!1)}return El(e,t,n,l,d,a)}function El(e,t,n,l,a,d){Uu(e,t);var h=(t.flags&128)!==0;if(!l&&!h)return a&&Ga(t,n,!1),At(e,t,d);l=t.stateNode,sf.current=t;var S=h&&typeof n.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&h?(t.child=Vn(t,e.child,null,d),t.child=Vn(t,null,S,d)):tt(e,t,S,d),t.memoizedState=l.state,a&&Ga(t,n,!0),t.child}function Qu(e){var t=e.stateNode;t.pendingContext?Ja(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ja(e,t.context,!1),hl(e,t.containerInfo)}function Yu(e,t,n,l,a){return Un(),al(a),t.flags|=256,tt(e,t,n,l),t.child}var Rl={dehydrated:null,treeContext:null,retryLane:0};function Fl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ju(e,t,n){var l=t.pendingProps,a=Ie.current,d=!1,h=(t.flags&128)!==0,S;if((S=h)||(S=e!==null&&e.memoizedState===null?!1:(a&2)!==0),S?(d=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),_e(Ie,a&1),e===null)return sl(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(h=l.children,e=l.fallback,d?(l=t.mode,d=t.child,h={mode:"hidden",children:h},(l&1)===0&&d!==null?(d.childLanes=0,d.pendingProps=h):d=Ko(h,l,0,null),e=Pn(e,l,n,null),d.return=t,e.return=t,d.sibling=e,t.child=d,t.child.memoizedState=Fl(n),t.memoizedState=Rl,e):Il(t,h));if(a=e.memoizedState,a!==null&&(S=a.dehydrated,S!==null))return af(e,t,h,l,S,a,n);if(d){d=l.fallback,h=t.mode,a=e.child,S=a.sibling;var k={mode:"hidden",children:l.children};return(h&1)===0&&t.child!==a?(l=t.child,l.childLanes=0,l.pendingProps=k,t.deletions=null):(l=cn(a,k),l.subtreeFlags=a.subtreeFlags&14680064),S!==null?d=cn(S,d):(d=Pn(d,h,n,null),d.flags|=2),d.return=t,l.return=t,l.sibling=d,t.child=l,l=d,d=t.child,h=e.child.memoizedState,h=h===null?Fl(n):{baseLanes:h.baseLanes|n,cachePool:null,transitions:h.transitions},d.memoizedState=h,d.childLanes=e.childLanes&~n,t.memoizedState=Rl,l}return d=e.child,e=d.sibling,l=cn(d,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=n),l.return=t,l.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=l,t.memoizedState=null,l}function Il(e,t){return t=Ko({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function $o(e,t,n,l){return l!==null&&al(l),Vn(t,e.child,null,n),e=Il(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function af(e,t,n,l,a,d,h){if(n)return t.flags&256?(t.flags&=-257,l=Ll(Error(u(422))),$o(e,t,h,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(d=l.fallback,a=t.mode,l=Ko({mode:"visible",children:l.children},a,0,null),d=Pn(d,a,h,null),d.flags|=2,l.return=t,d.return=t,l.sibling=d,t.child=l,(t.mode&1)!==0&&Vn(t,e.child,null,h),t.child.memoizedState=Fl(h),t.memoizedState=Rl,d);if((t.mode&1)===0)return $o(e,t,h,null);if(a.data==="$!"){if(l=a.nextSibling&&a.nextSibling.dataset,l)var S=l.dgst;return l=S,d=Error(u(419)),l=Ll(d,l,void 0),$o(e,t,h,l)}if(S=(h&e.childLanes)!==0,it||S){if(l=Qe,l!==null){switch(h&-h){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(l.suspendedLanes|h))!==0?0:a,a!==0&&a!==d.retryLane&&(d.retryLane=a,Bt(e,a),Tt(l,e,a,-1))}return Xl(),l=Ll(Error(u(421))),$o(e,t,h,l)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=bf.bind(null,e),a._reactRetry=t,null):(e=d.treeContext,ct=qt(a.nextSibling),dt=t,Fe=!0,wt=null,e!==null&&(ft[gt++]=Dt,ft[gt++]=Ot,ft[gt++]=mn,Dt=e.id,Ot=e.overflow,mn=t),t=Il(t,l.children),t.flags|=4096,t)}function Ku(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),pl(e.return,t,n)}function $l(e,t,n,l,a){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=a)}function Gu(e,t,n){var l=t.pendingProps,a=l.revealOrder,d=l.tail;if(tt(e,t,l.children,n),l=Ie.current,(l&2)!==0)l=l&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&&Ku(e,n,t);else if(e.tag===19)Ku(e,n,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}l&=1}if(_e(Ie,l),(t.mode&1)===0)t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Lo(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),$l(t,!1,a,n,d);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Lo(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}$l(t,!0,n,null,d);break;case"together":$l(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function No(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function At(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),kn|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=cn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=cn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function uf(e,t,n){switch(t.tag){case 3:Qu(t),Un();break;case 5:du(t);break;case 1:ot(t.type)&&vo(t);break;case 4:hl(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,a=t.memoizedProps.value;_e(Co,l._currentValue),l._currentValue=a;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(_e(Ie,Ie.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Ju(e,t,n):(_e(Ie,Ie.current&1),e=At(e,t,n),e!==null?e.sibling:null);_e(Ie,Ie.current&1);break;case 19:if(l=(n&t.childLanes)!==0,(e.flags&128)!==0){if(l)return Gu(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),_e(Ie,Ie.current),l)break;return null;case 22:case 23:return t.lanes=0,Hu(e,t,n)}return At(e,t,n)}var Xu,Nl,Zu,qu;Xu=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Nl=function(){},Zu=function(e,t,n,l){var a=e.memoizedProps;if(a!==l){e=t.stateNode,bn(zt.current);var d=null;switch(n){case"input":a=Se(e,a),l=Se(e,l),d=[];break;case"select":a=X({},a,{value:void 0}),l=X({},l,{value:void 0}),d=[];break;case"textarea":a=hi(e,a),l=hi(e,l),d=[];break;default:typeof a.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=xo)}yi(n,l);var h;n=null;for(I in a)if(!l.hasOwnProperty(I)&&a.hasOwnProperty(I)&&a[I]!=null)if(I==="style"){var S=a[I];for(h in S)S.hasOwnProperty(h)&&(n||(n={}),n[h]="")}else I!=="dangerouslySetInnerHTML"&&I!=="children"&&I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&I!=="autoFocus"&&(p.hasOwnProperty(I)?d||(d=[]):(d=d||[]).push(I,null));for(I in l){var k=l[I];if(S=a?.[I],l.hasOwnProperty(I)&&k!==S&&(k!=null||S!=null))if(I==="style")if(S){for(h in S)!S.hasOwnProperty(h)||k&&k.hasOwnProperty(h)||(n||(n={}),n[h]="");for(h in k)k.hasOwnProperty(h)&&S[h]!==k[h]&&(n||(n={}),n[h]=k[h])}else n||(d||(d=[]),d.push(I,n)),n=k;else I==="dangerouslySetInnerHTML"?(k=k?k.__html:void 0,S=S?S.__html:void 0,k!=null&&S!==k&&(d=d||[]).push(I,k)):I==="children"?typeof k!="string"&&typeof k!="number"||(d=d||[]).push(I,""+k):I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&(p.hasOwnProperty(I)?(k!=null&&I==="onScroll"&&Me("scroll",e),d||S===k||(d=[])):(d=d||[]).push(I,k))}n&&(d=d||[]).push("style",n);var I=d;(t.updateQueue=I)&&(t.flags|=4)}},qu=function(e,t,n,l){n!==l&&(t.flags|=4)};function $r(e,t){if(!Fe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&14680064,l|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function df(e,t,n){var l=t.pendingProps;switch(il(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return ot(t.type)&&mo(),qe(t),null;case 3:return l=t.stateNode,Jn(),ze(rt),ze(Xe),ml(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ko(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wt!==null&&(Jl(wt),wt=null))),Nl(e,t),qe(t),null;case 5:xl(t);var a=bn(zr.current);if(n=t.type,e!==null&&t.stateNode!=null)Zu(e,t,n,l,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(u(166));return qe(t),null}if(e=bn(zt.current),ko(t)){l=t.stateNode,n=t.type;var d=t.memoizedProps;switch(l[Mt]=t,l[Tr]=d,e=(t.mode&1)!==0,n){case"dialog":Me("cancel",l),Me("close",l);break;case"iframe":case"object":case"embed":Me("load",l);break;case"video":case"audio":for(a=0;a<kr.length;a++)Me(kr[a],l);break;case"source":Me("error",l);break;case"img":case"image":case"link":Me("error",l),Me("load",l);break;case"details":Me("toggle",l);break;case"input":De(l,d),Me("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!d.multiple},Me("invalid",l);break;case"textarea":$s(l,d),Me("invalid",l)}yi(n,d),a=null;for(var h in d)if(d.hasOwnProperty(h)){var S=d[h];h==="children"?typeof S=="string"?l.textContent!==S&&(d.suppressHydrationWarning!==!0&&ho(l.textContent,S,e),a=["children",S]):typeof S=="number"&&l.textContent!==""+S&&(d.suppressHydrationWarning!==!0&&ho(l.textContent,S,e),a=["children",""+S]):p.hasOwnProperty(h)&&S!=null&&h==="onScroll"&&Me("scroll",l)}switch(n){case"input":_t(l),Is(l,d,!0);break;case"textarea":_t(l),Ds(l);break;case"select":case"option":break;default:typeof d.onClick=="function"&&(l.onclick=xo)}l=a,t.updateQueue=l,l!==null&&(t.flags|=4)}else{h=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Os(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=h.createElement(n,{is:l.is}):(e=h.createElement(n),n==="select"&&(h=e,l.multiple?h.multiple=!0:l.size&&(h.size=l.size))):e=h.createElementNS(e,n),e[Mt]=t,e[Tr]=l,Xu(e,t,!1,!1),t.stateNode=e;e:{switch(h=mi(n,l),n){case"dialog":Me("cancel",e),Me("close",e),a=l;break;case"iframe":case"object":case"embed":Me("load",e),a=l;break;case"video":case"audio":for(a=0;a<kr.length;a++)Me(kr[a],e);a=l;break;case"source":Me("error",e),a=l;break;case"img":case"image":case"link":Me("error",e),Me("load",e),a=l;break;case"details":Me("toggle",e),a=l;break;case"input":De(e,l),a=Se(e,l),Me("invalid",e);break;case"option":a=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},a=X({},l,{value:void 0}),Me("invalid",e);break;case"textarea":$s(e,l),a=hi(e,l),Me("invalid",e);break;default:a=l}yi(n,a),S=a;for(d in S)if(S.hasOwnProperty(d)){var k=S[d];d==="style"?As(e,k):d==="dangerouslySetInnerHTML"?(k=k?k.__html:void 0,k!=null&&Bs(e,k)):d==="children"?typeof k=="string"?(n!=="textarea"||k!=="")&&or(e,k):typeof k=="number"&&or(e,""+k):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(p.hasOwnProperty(d)?k!=null&&d==="onScroll"&&Me("scroll",e):k!=null&&U(e,d,k,h))}switch(n){case"input":_t(e),Is(e,l,!1);break;case"textarea":_t(e),Ds(e);break;case"option":l.value!=null&&e.setAttribute("value",""+ke(l.value));break;case"select":e.multiple=!!l.multiple,d=l.value,d!=null?Ln(e,!!l.multiple,d,!1):l.defaultValue!=null&&Ln(e,!!l.multiple,l.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=xo)}switch(n){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return qe(t),null;case 6:if(e&&t.stateNode!=null)qu(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(u(166));if(n=bn(zr.current),bn(zt.current),ko(t)){if(l=t.stateNode,n=t.memoizedProps,l[Mt]=t,(d=l.nodeValue!==n)&&(e=dt,e!==null))switch(e.tag){case 3:ho(l.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ho(l.nodeValue,n,(e.mode&1)!==0)}d&&(t.flags|=4)}else l=(n.nodeType===9?n:n.ownerDocument).createTextNode(l),l[Mt]=t,t.stateNode=l}return qe(t),null;case 13:if(ze(Ie),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Fe&&ct!==null&&(t.mode&1)!==0&&(t.flags&128)===0)nu(),Un(),t.flags|=98560,d=!1;else if(d=ko(t),l!==null&&l.dehydrated!==null){if(e===null){if(!d)throw Error(u(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(u(317));d[Mt]=t}else Un(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),d=!1}else wt!==null&&(Jl(wt),wt=null),d=!0;if(!d)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ie.current&1)!==0?Ue===0&&(Ue=3):Xl())),t.updateQueue!==null&&(t.flags|=4),qe(t),null);case 4:return Jn(),Nl(e,t),e===null&&jr(t.stateNode.containerInfo),qe(t),null;case 10:return cl(t.type._context),qe(t),null;case 17:return ot(t.type)&&mo(),qe(t),null;case 19:if(ze(Ie),d=t.memoizedState,d===null)return qe(t),null;if(l=(t.flags&128)!==0,h=d.rendering,h===null)if(l)$r(d,!1);else{if(Ue!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Lo(e),h!==null){for(t.flags|=128,$r(d,!1),l=h.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=n,n=t.child;n!==null;)d=n,e=l,d.flags&=14680066,h=d.alternate,h===null?(d.childLanes=0,d.lanes=e,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=h.childLanes,d.lanes=h.lanes,d.child=h.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=h.memoizedProps,d.memoizedState=h.memoizedState,d.updateQueue=h.updateQueue,d.type=h.type,e=h.dependencies,d.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _e(Ie,Ie.current&1|2),t.child}e=e.sibling}d.tail!==null&&Be()>Zn&&(t.flags|=128,l=!0,$r(d,!1),t.lanes=4194304)}else{if(!l)if(e=Lo(h),e!==null){if(t.flags|=128,l=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),$r(d,!0),d.tail===null&&d.tailMode==="hidden"&&!h.alternate&&!Fe)return qe(t),null}else 2*Be()-d.renderingStartTime>Zn&&n!==1073741824&&(t.flags|=128,l=!0,$r(d,!1),t.lanes=4194304);d.isBackwards?(h.sibling=t.child,t.child=h):(n=d.last,n!==null?n.sibling=h:t.child=h,d.last=h)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=Be(),t.sibling=null,n=Ie.current,_e(Ie,l?n&1|2:n&1),t):(qe(t),null);case 22:case 23:return Gl(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(pt&1073741824)!==0&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),null;case 24:return null;case 25:return null}throw Error(u(156,t.tag))}function cf(e,t){switch(il(t),t.tag){case 1:return ot(t.type)&&mo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jn(),ze(rt),ze(Xe),ml(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return xl(t),null;case 13:if(ze(Ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Un()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ze(Ie),null;case 4:return Jn(),null;case 10:return cl(t.type._context),null;case 22:case 23:return Gl(),null;case 24:return null;default:return null}}var Do=!1,et=!1,pf=typeof WeakSet=="function"?WeakSet:Set,ee=null;function Gn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(l){Oe(e,t,l)}else n.current=null}function Dl(e,t,n){try{n()}catch(l){Oe(e,t,l)}}var ed=!1;function ff(e,t){if(Gi=ro,e=Ea(),Ai(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,d=l.focusNode;l=l.focusOffset;try{n.nodeType,d.nodeType}catch{n=null;break e}var h=0,S=-1,k=-1,I=0,B=0,H=e,O=null;t:for(;;){for(var Z;H!==n||a!==0&&H.nodeType!==3||(S=h+a),H!==d||l!==0&&H.nodeType!==3||(k=h+l),H.nodeType===3&&(h+=H.nodeValue.length),(Z=H.firstChild)!==null;)O=H,H=Z;for(;;){if(H===e)break t;if(O===n&&++I===a&&(S=h),O===d&&++B===l&&(k=h),(Z=H.nextSibling)!==null)break;H=O,O=H.parentNode}H=Z}n=S===-1||k===-1?null:{start:S,end:k}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xi={focusedElem:e,selectionRange:n},ro=!1,ee=t;ee!==null;)if(t=ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ee=e;else for(;ee!==null;){t=ee;try{var te=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(te!==null){var ne=te.memoizedProps,We=te.memoizedState,z=t.stateNode,C=z.getSnapshotBeforeUpdate(t.elementType===t.type?ne:kt(t.type,ne),We);z.__reactInternalSnapshotBeforeUpdate=C}break;case 3:var R=t.stateNode.containerInfo;R.nodeType===1?R.textContent="":R.nodeType===9&&R.documentElement&&R.removeChild(R.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(Q){Oe(t,t.return,Q)}if(e=t.sibling,e!==null){e.return=t.return,ee=e;break}ee=t.return}return te=ed,ed=!1,te}function Nr(e,t,n){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var a=l=l.next;do{if((a.tag&e)===e){var d=a.destroy;a.destroy=void 0,d!==void 0&&Dl(t,n,d)}a=a.next}while(a!==l)}}function Oo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var l=n.create;n.destroy=l()}n=n.next}while(n!==t)}}function Ol(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function td(e){var t=e.alternate;t!==null&&(e.alternate=null,td(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Mt],delete t[Tr],delete t[tl],delete t[Jp],delete t[Kp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nd(e){return e.tag===5||e.tag===3||e.tag===4}function rd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nd(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.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 Bl(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=xo));else if(l!==4&&(e=e.child,e!==null))for(Bl(e,t,n),e=e.sibling;e!==null;)Bl(e,t,n),e=e.sibling}function Wl(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Wl(e,t,n),e=e.sibling;e!==null;)Wl(e,t,n),e=e.sibling}var Ke=null,jt=!1;function ln(e,t,n){for(n=n.child;n!==null;)od(e,t,n),n=n.sibling}function od(e,t,n){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(Xr,n)}catch{}switch(n.tag){case 5:et||Gn(n,t);case 6:var l=Ke,a=jt;Ke=null,ln(e,t,n),Ke=l,jt=a,Ke!==null&&(jt?(e=Ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ke.removeChild(n.stateNode));break;case 18:Ke!==null&&(jt?(e=Ke,n=n.stateNode,e.nodeType===8?el(e.parentNode,n):e.nodeType===1&&el(e,n),hr(e)):el(Ke,n.stateNode));break;case 4:l=Ke,a=jt,Ke=n.stateNode.containerInfo,jt=!0,ln(e,t,n),Ke=l,jt=a;break;case 0:case 11:case 14:case 15:if(!et&&(l=n.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){a=l=l.next;do{var d=a,h=d.destroy;d=d.tag,h!==void 0&&((d&2)!==0||(d&4)!==0)&&Dl(n,t,h),a=a.next}while(a!==l)}ln(e,t,n);break;case 1:if(!et&&(Gn(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=n.memoizedProps,l.state=n.memoizedState,l.componentWillUnmount()}catch(S){Oe(n,t,S)}ln(e,t,n);break;case 21:ln(e,t,n);break;case 22:n.mode&1?(et=(l=et)||n.memoizedState!==null,ln(e,t,n),et=l):ln(e,t,n);break;default:ln(e,t,n)}}function id(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new pf),t.forEach(function(l){var a=wf.bind(null,e,l);n.has(l)||(n.add(l),l.then(a,a))})}}function Ct(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l];try{var d=e,h=t,S=h;e:for(;S!==null;){switch(S.tag){case 5:Ke=S.stateNode,jt=!1;break e;case 3:Ke=S.stateNode.containerInfo,jt=!0;break e;case 4:Ke=S.stateNode.containerInfo,jt=!0;break e}S=S.return}if(Ke===null)throw Error(u(160));od(d,h,a),Ke=null,jt=!1;var k=a.alternate;k!==null&&(k.return=null),a.return=null}catch(I){Oe(a,t,I)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ld(t,e),t=t.sibling}function ld(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ct(t,e),Rt(e),l&4){try{Nr(3,e,e.return),Oo(3,e)}catch(ne){Oe(e,e.return,ne)}try{Nr(5,e,e.return)}catch(ne){Oe(e,e.return,ne)}}break;case 1:Ct(t,e),Rt(e),l&512&&n!==null&&Gn(n,n.return);break;case 5:if(Ct(t,e),Rt(e),l&512&&n!==null&&Gn(n,n.return),e.flags&32){var a=e.stateNode;try{or(a,"")}catch(ne){Oe(e,e.return,ne)}}if(l&4&&(a=e.stateNode,a!=null)){var d=e.memoizedProps,h=n!==null?n.memoizedProps:d,S=e.type,k=e.updateQueue;if(e.updateQueue=null,k!==null)try{S==="input"&&d.type==="radio"&&d.name!=null&&Je(a,d),mi(S,h);var I=mi(S,d);for(h=0;h<k.length;h+=2){var B=k[h],H=k[h+1];B==="style"?As(a,H):B==="dangerouslySetInnerHTML"?Bs(a,H):B==="children"?or(a,H):U(a,B,H,I)}switch(S){case"input":vt(a,d);break;case"textarea":Ns(a,d);break;case"select":var O=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!d.multiple;var Z=d.value;Z!=null?Ln(a,!!d.multiple,Z,!1):O!==!!d.multiple&&(d.defaultValue!=null?Ln(a,!!d.multiple,d.defaultValue,!0):Ln(a,!!d.multiple,d.multiple?[]:"",!1))}a[Tr]=d}catch(ne){Oe(e,e.return,ne)}}break;case 6:if(Ct(t,e),Rt(e),l&4){if(e.stateNode===null)throw Error(u(162));a=e.stateNode,d=e.memoizedProps;try{a.nodeValue=d}catch(ne){Oe(e,e.return,ne)}}break;case 3:if(Ct(t,e),Rt(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{hr(t.containerInfo)}catch(ne){Oe(e,e.return,ne)}break;case 4:Ct(t,e),Rt(e);break;case 13:Ct(t,e),Rt(e),a=e.child,a.flags&8192&&(d=a.memoizedState!==null,a.stateNode.isHidden=d,!d||a.alternate!==null&&a.alternate.memoizedState!==null||(Ul=Be())),l&4&&id(e);break;case 22:if(B=n!==null&&n.memoizedState!==null,e.mode&1?(et=(I=et)||B,Ct(t,e),et=I):Ct(t,e),Rt(e),l&8192){if(I=e.memoizedState!==null,(e.stateNode.isHidden=I)&&!B&&(e.mode&1)!==0)for(ee=e,B=e.child;B!==null;){for(H=ee=B;ee!==null;){switch(O=ee,Z=O.child,O.tag){case 0:case 11:case 14:case 15:Nr(4,O,O.return);break;case 1:Gn(O,O.return);var te=O.stateNode;if(typeof te.componentWillUnmount=="function"){l=O,n=O.return;try{t=l,te.props=t.memoizedProps,te.state=t.memoizedState,te.componentWillUnmount()}catch(ne){Oe(l,n,ne)}}break;case 5:Gn(O,O.return);break;case 22:if(O.memoizedState!==null){ud(H);continue}}Z!==null?(Z.return=O,ee=Z):ud(H)}B=B.sibling}e:for(B=null,H=e;;){if(H.tag===5){if(B===null){B=H;try{a=H.stateNode,I?(d=a.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"):(S=H.stateNode,k=H.memoizedProps.style,h=k!=null&&k.hasOwnProperty("display")?k.display:null,S.style.display=Ws("display",h))}catch(ne){Oe(e,e.return,ne)}}}else if(H.tag===6){if(B===null)try{H.stateNode.nodeValue=I?"":H.memoizedProps}catch(ne){Oe(e,e.return,ne)}}else if((H.tag!==22&&H.tag!==23||H.memoizedState===null||H===e)&&H.child!==null){H.child.return=H,H=H.child;continue}if(H===e)break e;for(;H.sibling===null;){if(H.return===null||H.return===e)break e;B===H&&(B=null),H=H.return}B===H&&(B=null),H.sibling.return=H.return,H=H.sibling}}break;case 19:Ct(t,e),Rt(e),l&4&&id(e);break;case 21:break;default:Ct(t,e),Rt(e)}}function Rt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(nd(n)){var l=n;break e}n=n.return}throw Error(u(160))}switch(l.tag){case 5:var a=l.stateNode;l.flags&32&&(or(a,""),l.flags&=-33);var d=rd(e);Wl(e,d,a);break;case 3:case 4:var h=l.stateNode.containerInfo,S=rd(e);Bl(e,S,h);break;default:throw Error(u(161))}}catch(k){Oe(e,e.return,k)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gf(e,t,n){ee=e,sd(e)}function sd(e,t,n){for(var l=(e.mode&1)!==0;ee!==null;){var a=ee,d=a.child;if(a.tag===22&&l){var h=a.memoizedState!==null||Do;if(!h){var S=a.alternate,k=S!==null&&S.memoizedState!==null||et;S=Do;var I=et;if(Do=h,(et=k)&&!I)for(ee=a;ee!==null;)h=ee,k=h.child,h.tag===22&&h.memoizedState!==null?dd(a):k!==null?(k.return=h,ee=k):dd(a);for(;d!==null;)ee=d,sd(d),d=d.sibling;ee=a,Do=S,et=I}ad(e)}else(a.subtreeFlags&8772)!==0&&d!==null?(d.return=a,ee=d):ad(e)}}function ad(e){for(;ee!==null;){var t=ee;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:et||Oo(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!et)if(n===null)l.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:kt(t.type,n.memoizedProps);l.componentDidUpdate(a,n.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var d=t.updateQueue;d!==null&&uu(t,d,l);break;case 3:var h=t.updateQueue;if(h!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}uu(t,h,n)}break;case 5:var S=t.stateNode;if(n===null&&t.flags&4){n=S;var k=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":k.autoFocus&&n.focus();break;case"img":k.src&&(n.src=k.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var I=t.alternate;if(I!==null){var B=I.memoizedState;if(B!==null){var H=B.dehydrated;H!==null&&hr(H)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(u(163))}et||t.flags&512&&Ol(t)}catch(O){Oe(t,t.return,O)}}if(t===e){ee=null;break}if(n=t.sibling,n!==null){n.return=t.return,ee=n;break}ee=t.return}}function ud(e){for(;ee!==null;){var t=ee;if(t===e){ee=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ee=n;break}ee=t.return}}function dd(e){for(;ee!==null;){var t=ee;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Oo(4,t)}catch(k){Oe(t,n,k)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var a=t.return;try{l.componentDidMount()}catch(k){Oe(t,a,k)}}var d=t.return;try{Ol(t)}catch(k){Oe(t,d,k)}break;case 5:var h=t.return;try{Ol(t)}catch(k){Oe(t,h,k)}}}catch(k){Oe(t,t.return,k)}if(t===e){ee=null;break}var S=t.sibling;if(S!==null){S.return=t.return,ee=S;break}ee=t.return}}var hf=Math.ceil,Bo=W.ReactCurrentDispatcher,Al=W.ReactCurrentOwner,yt=W.ReactCurrentBatchConfig,be=0,Qe=null,Ae=null,Ge=0,pt=0,Xn=en(0),Ue=0,Dr=null,kn=0,Wo=0,Hl=0,Or=null,lt=null,Ul=0,Zn=1/0,Ht=null,Ao=!1,Vl=null,sn=null,Ho=!1,an=null,Uo=0,Br=0,Ql=null,Vo=-1,Qo=0;function nt(){return(be&6)!==0?Be():Vo!==-1?Vo:Vo=Be()}function un(e){return(e.mode&1)===0?1:(be&2)!==0&&Ge!==0?Ge&-Ge:Xp.transition!==null?(Qo===0&&(Qo=ra()),Qo):(e=Te,e!==0||(e=window.event,e=e===void 0?16:pa(e.type)),e)}function Tt(e,t,n,l){if(50<Br)throw Br=0,Ql=null,Error(u(185));dr(e,n,l),((be&2)===0||e!==Qe)&&(e===Qe&&((be&2)===0&&(Wo|=n),Ue===4&&dn(e,Ge)),st(e,l),n===1&&be===0&&(t.mode&1)===0&&(Zn=Be()+500,So&&nn()))}function st(e,t){var n=e.callbackNode;Xc(e,t);var l=eo(e,e===Qe?Ge:0);if(l===0)n!==null&&ea(n),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(n!=null&&ea(n),t===1)e.tag===0?Gp(pd.bind(null,e)):Xa(pd.bind(null,e)),Qp(function(){(be&6)===0&&nn()}),n=null;else{switch(oa(l)){case 1:n=Ci;break;case 4:n=ta;break;case 16:n=Gr;break;case 536870912:n=na;break;default:n=Gr}n=Sd(n,cd.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function cd(e,t){if(Vo=-1,Qo=0,(be&6)!==0)throw Error(u(327));var n=e.callbackNode;if(qn()&&e.callbackNode!==n)return null;var l=eo(e,e===Qe?Ge:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=Yo(e,l);else{t=l;var a=be;be|=2;var d=gd();(Qe!==e||Ge!==t)&&(Ht=null,Zn=Be()+500,Cn(e,t));do try{mf();break}catch(S){fd(e,S)}while(!0);dl(),Bo.current=d,be=a,Ae!==null?t=0:(Qe=null,Ge=0,t=Ue)}if(t!==0){if(t===2&&(a=Ti(e),a!==0&&(l=a,t=Yl(e,a))),t===1)throw n=Dr,Cn(e,0),dn(e,l),st(e,Be()),n;if(t===6)dn(e,l);else{if(a=e.current.alternate,(l&30)===0&&!xf(a)&&(t=Yo(e,l),t===2&&(d=Ti(e),d!==0&&(l=d,t=Yl(e,d))),t===1))throw n=Dr,Cn(e,0),dn(e,l),st(e,Be()),n;switch(e.finishedWork=a,e.finishedLanes=l,t){case 0:case 1:throw Error(u(345));case 2:Tn(e,lt,Ht);break;case 3:if(dn(e,l),(l&130023424)===l&&(t=Ul+500-Be(),10<t)){if(eo(e,0)!==0)break;if(a=e.suspendedLanes,(a&l)!==l){nt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=qi(Tn.bind(null,e,lt,Ht),t);break}Tn(e,lt,Ht);break;case 4:if(dn(e,l),(l&4194240)===l)break;for(t=e.eventTimes,a=-1;0<l;){var h=31-St(l);d=1<<h,h=t[h],h>a&&(a=h),l&=~d}if(l=a,l=Be()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*hf(l/1960))-l,10<l){e.timeoutHandle=qi(Tn.bind(null,e,lt,Ht),l);break}Tn(e,lt,Ht);break;case 5:Tn(e,lt,Ht);break;default:throw Error(u(329))}}}return st(e,Be()),e.callbackNode===n?cd.bind(null,e):null}function Yl(e,t){var n=Or;return e.current.memoizedState.isDehydrated&&(Cn(e,t).flags|=256),e=Yo(e,t),e!==2&&(t=lt,lt=n,t!==null&&Jl(t)),e}function Jl(e){lt===null?lt=e:lt.push.apply(lt,e)}function xf(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var l=0;l<n.length;l++){var a=n[l],d=a.getSnapshot;a=a.value;try{if(!bt(d(),a))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 dn(e,t){for(t&=~Hl,t&=~Wo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-St(t),l=1<<n;e[n]=-1,t&=~l}}function pd(e){if((be&6)!==0)throw Error(u(327));qn();var t=eo(e,0);if((t&1)===0)return st(e,Be()),null;var n=Yo(e,t);if(e.tag!==0&&n===2){var l=Ti(e);l!==0&&(t=l,n=Yl(e,l))}if(n===1)throw n=Dr,Cn(e,0),dn(e,t),st(e,Be()),n;if(n===6)throw Error(u(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Tn(e,lt,Ht),st(e,Be()),null}function Kl(e,t){var n=be;be|=1;try{return e(t)}finally{be=n,be===0&&(Zn=Be()+500,So&&nn())}}function jn(e){an!==null&&an.tag===0&&(be&6)===0&&qn();var t=be;be|=1;var n=yt.transition,l=Te;try{if(yt.transition=null,Te=1,e)return e()}finally{Te=l,yt.transition=n,be=t,(be&6)===0&&nn()}}function Gl(){pt=Xn.current,ze(Xn)}function Cn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Vp(n)),Ae!==null)for(n=Ae.return;n!==null;){var l=n;switch(il(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&mo();break;case 3:Jn(),ze(rt),ze(Xe),ml();break;case 5:xl(l);break;case 4:Jn();break;case 13:ze(Ie);break;case 19:ze(Ie);break;case 10:cl(l.type._context);break;case 22:case 23:Gl()}n=n.return}if(Qe=e,Ae=e=cn(e.current,null),Ge=pt=t,Ue=0,Dr=null,Hl=Wo=kn=0,lt=Or=null,Sn!==null){for(t=0;t<Sn.length;t++)if(n=Sn[t],l=n.interleaved,l!==null){n.interleaved=null;var a=l.next,d=n.pending;if(d!==null){var h=d.next;d.next=a,l.next=h}n.pending=l}Sn=null}return e}function fd(e,t){do{var n=Ae;try{if(dl(),Mo.current=Fo,zo){for(var l=$e.memoizedState;l!==null;){var a=l.queue;a!==null&&(a.pending=null),l=l.next}zo=!1}if(wn=0,Ve=He=$e=null,Er=!1,Rr=0,Al.current=null,n===null||n.return===null){Ue=1,Dr=t,Ae=null;break}e:{var d=e,h=n.return,S=n,k=t;if(t=Ge,S.flags|=32768,k!==null&&typeof k=="object"&&typeof k.then=="function"){var I=k,B=S,H=B.tag;if((B.mode&1)===0&&(H===0||H===11||H===15)){var O=B.alternate;O?(B.updateQueue=O.updateQueue,B.memoizedState=O.memoizedState,B.lanes=O.lanes):(B.updateQueue=null,B.memoizedState=null)}var Z=Du(h);if(Z!==null){Z.flags&=-257,Ou(Z,h,S,d,t),Z.mode&1&&Nu(d,I,t),t=Z,k=I;var te=t.updateQueue;if(te===null){var ne=new Set;ne.add(k),t.updateQueue=ne}else te.add(k);break e}else{if((t&1)===0){Nu(d,I,t),Xl();break e}k=Error(u(426))}}else if(Fe&&S.mode&1){var We=Du(h);if(We!==null){(We.flags&65536)===0&&(We.flags|=256),Ou(We,h,S,d,t),al(Kn(k,S));break e}}d=k=Kn(k,S),Ue!==4&&(Ue=2),Or===null?Or=[d]:Or.push(d),d=h;do{switch(d.tag){case 3:d.flags|=65536,t&=-t,d.lanes|=t;var z=Iu(d,k,t);au(d,z);break e;case 1:S=k;var C=d.type,R=d.stateNode;if((d.flags&128)===0&&(typeof C.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(sn===null||!sn.has(R)))){d.flags|=65536,t&=-t,d.lanes|=t;var Q=$u(d,S,t);au(d,Q);break e}}d=d.return}while(d!==null)}xd(n)}catch(re){t=re,Ae===n&&n!==null&&(Ae=n=n.return);continue}break}while(!0)}function gd(){var e=Bo.current;return Bo.current=Fo,e===null?Fo:e}function Xl(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),Qe===null||(kn&268435455)===0&&(Wo&268435455)===0||dn(Qe,Ge)}function Yo(e,t){var n=be;be|=2;var l=gd();(Qe!==e||Ge!==t)&&(Ht=null,Cn(e,t));do try{yf();break}catch(a){fd(e,a)}while(!0);if(dl(),be=n,Bo.current=l,Ae!==null)throw Error(u(261));return Qe=null,Ge=0,Ue}function yf(){for(;Ae!==null;)hd(Ae)}function mf(){for(;Ae!==null&&!Ac();)hd(Ae)}function hd(e){var t=vd(e.alternate,e,pt);e.memoizedProps=e.pendingProps,t===null?xd(e):Ae=t,Al.current=null}function xd(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=df(n,t,pt),n!==null){Ae=n;return}}else{if(n=cf(n,t),n!==null){n.flags&=32767,Ae=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ue=6,Ae=null;return}}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);Ue===0&&(Ue=5)}function Tn(e,t,n){var l=Te,a=yt.transition;try{yt.transition=null,Te=1,vf(e,t,n,l)}finally{yt.transition=a,Te=l}return null}function vf(e,t,n,l){do qn();while(an!==null);if((be&6)!==0)throw Error(u(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(u(177));e.callbackNode=null,e.callbackPriority=0;var d=n.lanes|n.childLanes;if(Zc(e,d),e===Qe&&(Ae=Qe=null,Ge=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Ho||(Ho=!0,Sd(Gr,function(){return qn(),null})),d=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||d){d=yt.transition,yt.transition=null;var h=Te;Te=1;var S=be;be|=4,Al.current=null,ff(e,n),ld(n,e),Dp(Xi),ro=!!Gi,Xi=Gi=null,e.current=n,gf(n),Hc(),be=S,Te=h,yt.transition=d}else e.current=n;if(Ho&&(Ho=!1,an=e,Uo=a),d=e.pendingLanes,d===0&&(sn=null),Qc(n.stateNode),st(e,Be()),t!==null)for(l=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],l(a.value,{componentStack:a.stack,digest:a.digest});if(Ao)throw Ao=!1,e=Vl,Vl=null,e;return(Uo&1)!==0&&e.tag!==0&&qn(),d=e.pendingLanes,(d&1)!==0?e===Ql?Br++:(Br=0,Ql=e):Br=0,nn(),null}function qn(){if(an!==null){var e=oa(Uo),t=yt.transition,n=Te;try{if(yt.transition=null,Te=16>e?16:e,an===null)var l=!1;else{if(e=an,an=null,Uo=0,(be&6)!==0)throw Error(u(331));var a=be;for(be|=4,ee=e.current;ee!==null;){var d=ee,h=d.child;if((ee.flags&16)!==0){var S=d.deletions;if(S!==null){for(var k=0;k<S.length;k++){var I=S[k];for(ee=I;ee!==null;){var B=ee;switch(B.tag){case 0:case 11:case 15:Nr(8,B,d)}var H=B.child;if(H!==null)H.return=B,ee=H;else for(;ee!==null;){B=ee;var O=B.sibling,Z=B.return;if(td(B),B===I){ee=null;break}if(O!==null){O.return=Z,ee=O;break}ee=Z}}}var te=d.alternate;if(te!==null){var ne=te.child;if(ne!==null){te.child=null;do{var We=ne.sibling;ne.sibling=null,ne=We}while(ne!==null)}}ee=d}}if((d.subtreeFlags&2064)!==0&&h!==null)h.return=d,ee=h;else e:for(;ee!==null;){if(d=ee,(d.flags&2048)!==0)switch(d.tag){case 0:case 11:case 15:Nr(9,d,d.return)}var z=d.sibling;if(z!==null){z.return=d.return,ee=z;break e}ee=d.return}}var C=e.current;for(ee=C;ee!==null;){h=ee;var R=h.child;if((h.subtreeFlags&2064)!==0&&R!==null)R.return=h,ee=R;else e:for(h=C;ee!==null;){if(S=ee,(S.flags&2048)!==0)try{switch(S.tag){case 0:case 11:case 15:Oo(9,S)}}catch(re){Oe(S,S.return,re)}if(S===h){ee=null;break e}var Q=S.sibling;if(Q!==null){Q.return=S.return,ee=Q;break e}ee=S.return}}if(be=a,nn(),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(Xr,e)}catch{}l=!0}return l}finally{Te=n,yt.transition=t}}return!1}function yd(e,t,n){t=Kn(n,t),t=Iu(e,t,1),e=on(e,t,1),t=nt(),e!==null&&(dr(e,1,t),st(e,t))}function Oe(e,t,n){if(e.tag===3)yd(e,e,n);else for(;t!==null;){if(t.tag===3){yd(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(sn===null||!sn.has(l))){e=Kn(n,e),e=$u(t,e,1),t=on(t,e,1),e=nt(),t!==null&&(dr(t,1,e),st(t,e));break}}t=t.return}}function Sf(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),t=nt(),e.pingedLanes|=e.suspendedLanes&n,Qe===e&&(Ge&n)===n&&(Ue===4||Ue===3&&(Ge&130023424)===Ge&&500>Be()-Ul?Cn(e,0):Hl|=n),st(e,t)}function md(e,t){t===0&&((e.mode&1)===0?t=1:(t=qr,qr<<=1,(qr&130023424)===0&&(qr=4194304)));var n=nt();e=Bt(e,t),e!==null&&(dr(e,t,n),st(e,n))}function bf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),md(e,n)}function wf(e,t){var n=0;switch(e.tag){case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(u(314))}l!==null&&l.delete(t),md(e,n)}var vd;vd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rt.current)it=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return it=!1,uf(e,t,n);it=(e.flags&131072)!==0}else it=!1,Fe&&(t.flags&1048576)!==0&&Za(t,wo,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;No(e,t),e=t.pendingProps;var a=Wn(t,Xe.current);Yn(t,n),a=bl(null,t,l,e,a,n);var d=wl();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ot(l)?(d=!0,vo(t)):d=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,gl(t),a.updater=Io,t.stateNode=a,a._reactInternals=t,_l(t,l,e,n),t=El(null,t,l,!0,d,n)):(t.tag=0,Fe&&d&&ol(t),tt(null,t,a,n),t=t.child),t;case 16:l=t.elementType;e:{switch(No(e,t),e=t.pendingProps,a=l._init,l=a(l._payload),t.type=l,a=t.tag=jf(l),e=kt(l,e),a){case 0:t=zl(null,t,l,e,n);break e;case 1:t=Vu(null,t,l,e,n);break e;case 11:t=Bu(null,t,l,e,n);break e;case 14:t=Wu(null,t,l,kt(l.type,e),n);break e}throw Error(u(306,l,""))}return t;case 0:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:kt(l,a),zl(e,t,l,a,n);case 1:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:kt(l,a),Vu(e,t,l,a,n);case 3:e:{if(Qu(t),e===null)throw Error(u(387));l=t.pendingProps,d=t.memoizedState,a=d.element,su(e,t),_o(t,l,null,n);var h=t.memoizedState;if(l=h.element,d.isDehydrated)if(d={element:l,isDehydrated:!1,cache:h.cache,pendingSuspenseBoundaries:h.pendingSuspenseBoundaries,transitions:h.transitions},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){a=Kn(Error(u(423)),t),t=Yu(e,t,l,n,a);break e}else if(l!==a){a=Kn(Error(u(424)),t),t=Yu(e,t,l,n,a);break e}else for(ct=qt(t.stateNode.containerInfo.firstChild),dt=t,Fe=!0,wt=null,n=iu(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Un(),l===a){t=At(e,t,n);break e}tt(e,t,l,n)}t=t.child}return t;case 5:return du(t),e===null&&sl(t),l=t.type,a=t.pendingProps,d=e!==null?e.memoizedProps:null,h=a.children,Zi(l,a)?h=null:d!==null&&Zi(l,d)&&(t.flags|=32),Uu(e,t),tt(e,t,h,n),t.child;case 6:return e===null&&sl(t),null;case 13:return Ju(e,t,n);case 4:return hl(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Vn(t,null,l,n):tt(e,t,l,n),t.child;case 11:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:kt(l,a),Bu(e,t,l,a,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(l=t.type._context,a=t.pendingProps,d=t.memoizedProps,h=a.value,_e(Co,l._currentValue),l._currentValue=h,d!==null)if(bt(d.value,h)){if(d.children===a.children&&!rt.current){t=At(e,t,n);break e}}else for(d=t.child,d!==null&&(d.return=t);d!==null;){var S=d.dependencies;if(S!==null){h=d.child;for(var k=S.firstContext;k!==null;){if(k.context===l){if(d.tag===1){k=Wt(-1,n&-n),k.tag=2;var I=d.updateQueue;if(I!==null){I=I.shared;var B=I.pending;B===null?k.next=k:(k.next=B.next,B.next=k),I.pending=k}}d.lanes|=n,k=d.alternate,k!==null&&(k.lanes|=n),pl(d.return,n,t),S.lanes|=n;break}k=k.next}}else if(d.tag===10)h=d.type===t.type?null:d.child;else if(d.tag===18){if(h=d.return,h===null)throw Error(u(341));h.lanes|=n,S=h.alternate,S!==null&&(S.lanes|=n),pl(h,n,t),h=d.sibling}else h=d.child;if(h!==null)h.return=d;else for(h=d;h!==null;){if(h===t){h=null;break}if(d=h.sibling,d!==null){d.return=h.return,h=d;break}h=h.return}d=h}tt(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,l=t.pendingProps.children,Yn(t,n),a=ht(a),l=l(a),t.flags|=1,tt(e,t,l,n),t.child;case 14:return l=t.type,a=kt(l,t.pendingProps),a=kt(l.type,a),Wu(e,t,l,a,n);case 15:return Au(e,t,t.type,t.pendingProps,n);case 17:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:kt(l,a),No(e,t),t.tag=1,ot(l)?(e=!0,vo(t)):e=!1,Yn(t,n),Ru(t,l,a),_l(t,l,a,n),El(null,t,l,!0,e,n);case 19:return Gu(e,t,n);case 22:return Hu(e,t,n)}throw Error(u(156,t.tag))};function Sd(e,t){return qs(e,t)}function kf(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mt(e,t,n,l){return new kf(e,t,n,l)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jf(e){if(typeof e=="function")return Zl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ve)return 11;if(e===Ne)return 14}return 2}function cn(e,t){var n=e.alternate;return n===null?(n=mt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Jo(e,t,n,l,a,d){var h=2;if(l=e,typeof e=="function")Zl(e)&&(h=1);else if(typeof e=="string")h=5;else e:switch(e){case K:return Pn(n.children,a,d,t);case V:h=8,a|=8;break;case G:return e=mt(12,n,t,a|2),e.elementType=G,e.lanes=d,e;case me:return e=mt(13,n,t,a),e.elementType=me,e.lanes=d,e;case Ee:return e=mt(19,n,t,a),e.elementType=Ee,e.lanes=d,e;case he:return Ko(n,a,d,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:h=10;break e;case ue:h=9;break e;case ve:h=11;break e;case Ne:h=14;break e;case Re:h=16,l=null;break e}throw Error(u(130,e==null?e:typeof e,""))}return t=mt(h,n,t,a),t.elementType=e,t.type=l,t.lanes=d,t}function Pn(e,t,n,l){return e=mt(7,e,l,t),e.lanes=n,e}function Ko(e,t,n,l){return e=mt(22,e,l,t),e.elementType=he,e.lanes=n,e.stateNode={isHidden:!1},e}function ql(e,t,n){return e=mt(6,e,null,t),e.lanes=n,e}function es(e,t,n){return t=mt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Cf(e,t,n,l,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Pi(0),this.expirationTimes=Pi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pi(0),this.identifierPrefix=l,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function ts(e,t,n,l,a,d,h,S,k){return e=new Cf(e,t,n,S,k),t===1?(t=1,d===!0&&(t|=8)):t=0,d=mt(3,null,null,t),e.current=d,d.stateNode=e,d.memoizedState={element:l,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},gl(d),e}function Tf(e,t,n){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:l==null?null:""+l,children:e,containerInfo:t,implementation:n}}function bd(e){if(!e)return tn;e=e._reactInternals;e:{if(hn(e)!==e||e.tag!==1)throw Error(u(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ot(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(u(171))}if(e.tag===1){var n=e.type;if(ot(n))return Ka(e,n,t)}return t}function wd(e,t,n,l,a,d,h,S,k){return e=ts(n,l,!0,e,a,d,h,S,k),e.context=bd(null),n=e.current,l=nt(),a=un(n),d=Wt(l,a),d.callback=t??null,on(n,d,a),e.current.lanes=a,dr(e,a,l),st(e,l),e}function Go(e,t,n,l){var a=t.current,d=nt(),h=un(a);return n=bd(n),t.context===null?t.context=n:t.pendingContext=n,t=Wt(d,h),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=on(a,t,h),e!==null&&(Tt(e,a,h,d),Po(e,a,h)),h}function Xo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function kd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ns(e,t){kd(e,t),(e=e.alternate)&&kd(e,t)}function Pf(){return null}var jd=typeof reportError=="function"?reportError:function(e){console.error(e)};function rs(e){this._internalRoot=e}Zo.prototype.render=rs.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));Go(e,t,null,null)},Zo.prototype.unmount=rs.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jn(function(){Go(null,e,null,null)}),t[$t]=null}};function Zo(e){this._internalRoot=e}Zo.prototype.unstable_scheduleHydration=function(e){if(e){var t=sa();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Gt.length&&t!==0&&t<Gt[n].priority;n++);Gt.splice(n,0,e),n===0&&da(e)}};function os(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function qo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Cd(){}function _f(e,t,n,l,a){if(a){if(typeof l=="function"){var d=l;l=function(){var I=Xo(h);d.call(I)}}var h=wd(t,l,e,0,null,!1,!1,"",Cd);return e._reactRootContainer=h,e[$t]=h.current,jr(e.nodeType===8?e.parentNode:e),jn(),h}for(;a=e.lastChild;)e.removeChild(a);if(typeof l=="function"){var S=l;l=function(){var I=Xo(k);S.call(I)}}var k=ts(e,0,!1,null,null,!1,!1,"",Cd);return e._reactRootContainer=k,e[$t]=k.current,jr(e.nodeType===8?e.parentNode:e),jn(function(){Go(t,k,n,l)}),k}function ei(e,t,n,l,a){var d=n._reactRootContainer;if(d){var h=d;if(typeof a=="function"){var S=a;a=function(){var k=Xo(h);S.call(k)}}Go(t,h,e,a)}else h=_f(n,t,e,a,l);return Xo(h)}ia=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ur(t.pendingLanes);n!==0&&(_i(t,n|1),st(t,Be()),(be&6)===0&&(Zn=Be()+500,nn()))}break;case 13:jn(function(){var l=Bt(e,1);if(l!==null){var a=nt();Tt(l,e,1,a)}}),ns(e,1)}},Li=function(e){if(e.tag===13){var t=Bt(e,134217728);if(t!==null){var n=nt();Tt(t,e,134217728,n)}ns(e,134217728)}},la=function(e){if(e.tag===13){var t=un(e),n=Bt(e,t);if(n!==null){var l=nt();Tt(n,e,t,l)}ns(e,t)}},sa=function(){return Te},aa=function(e,t){var n=Te;try{return Te=e,t()}finally{Te=n}},bi=function(e,t,n){switch(t){case"input":if(vt(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=yo(l);if(!a)throw Error(u(90));Vt(l),vt(l,a)}}}break;case"textarea":Ns(e,n);break;case"select":t=n.value,t!=null&&Ln(e,!!n.multiple,t,!1)}},Qs=Kl,Ys=jn;var Lf={usingClientEntryPoint:!1,Events:[Pr,On,yo,Us,Vs,Kl]},Wr={findFiberByHostInstance:xn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Mf={bundleType:Wr.bundleType,version:Wr.version,rendererPackageName:Wr.rendererPackageName,rendererConfig:Wr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:W.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Xs(e),e===null?null:e.stateNode},findFiberByHostInstance:Wr.findFiberByHostInstance||Pf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ti=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ti.isDisabled&&ti.supportsFiber)try{Xr=ti.inject(Mf),Lt=ti}catch{}}return at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lf,at.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!os(t))throw Error(u(200));return Tf(e,t,null,n)},at.createRoot=function(e,t){if(!os(e))throw Error(u(299));var n=!1,l="",a=jd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=ts(e,1,!1,null,null,n,!1,l,a),e[$t]=t.current,jr(e.nodeType===8?e.parentNode:e),new rs(t)},at.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=Xs(t),e=e===null?null:e.stateNode,e},at.flushSync=function(e){return jn(e)},at.hydrate=function(e,t,n){if(!qo(t))throw Error(u(200));return ei(null,e,t,!0,n)},at.hydrateRoot=function(e,t,n){if(!os(e))throw Error(u(405));var l=n!=null&&n.hydratedSources||null,a=!1,d="",h=jd;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(d=n.identifierPrefix),n.onRecoverableError!==void 0&&(h=n.onRecoverableError)),t=wd(t,null,e,1,n??null,a,!1,d,h),e[$t]=t.current,jr(e),l)for(e=0;e<l.length;e++)n=l[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Zo(t)},at.render=function(e,t,n){if(!qo(t))throw Error(u(200));return ei(null,e,t,!1,n)},at.unmountComponentAtNode=function(e){if(!qo(e))throw Error(u(40));return e._reactRootContainer?(jn(function(){ei(null,null,e,!1,function(){e._reactRootContainer=null,e[$t]=null})}),!0):!1},at.unstable_batchedUpdates=Kl,at.unstable_renderSubtreeIntoContainer=function(e,t,n,l){if(!qo(n))throw Error(u(200));if(e==null||e._reactInternals===void 0)throw Error(u(38));return ei(e,t,n,!1,l)},at.version="18.3.1-next-f1338f8080-20240426",at}var Rd;function Df(){if(Rd)return ss.exports;Rd=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(s){console.error(s)}}return r(),ss.exports=Nf(),ss.exports}var Fd;function Of(){if(Fd)return ni;Fd=1;var r=Df();return ni.createRoot=r.createRoot,ni.hydrateRoot=r.hydrateRoot,ni}var Bf=Of();const Wf=Xd(Bf),o={bgPrimary:"#ffffff",bgSecondary:"#f8f9fa",bgTertiary:"#f1f3f4",bgCard:"#ffffff",bgHover:"#f1f3f4",bgSelected:"#e8f0fe",bgUnpaired:"#fef7e0",textPrimary:"#202124",textSecondary:"#5f6368",textTertiary:"#80868b",textInverse:"#ffffff",borderLight:"#dadce0",borderMedium:"#bdc1c6",accentBlue:"#1a73e8",accentBlueHover:"#1557b0",accentGreen:"#34a853",accentOrange:"#ea8600",success:"#34a853",warning:"#fbbc04",error:"#ea4335",info:"#1a73e8",buttonPrimary:"#4285f4",buttonPrimaryHover:"#3367d6",buttonSecondary:"#f1f3f4",buttonSecondaryHover:"#e8eaed",buttonDanger:"#ea4335",buttonDangerHover:"#d33b2c",shadowSm:"rgba(60, 64, 67, 0.08)",shadowMd:"rgba(60, 64, 67, 0.12)",shadowLg:"rgba(60, 64, 67, 0.16)"};function tr(r,s){const u=r.replace("#",""),c=Number.parseInt(u.substring(0,2),16),p=Number.parseInt(u.substring(2,4),16),f=Number.parseInt(u.substring(4,6),16);return`rgba(${c}, ${p}, ${f}, ${s})`}const m={body:"'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",mono:"'Roboto Mono', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace"};function Af({logs:r,filteredLogs:s,logEndRef:u,getLogColor:c}){return i.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px",fontFamily:m.mono,fontSize:"12px",background:o.bgCard},children:s.length===0?i.jsx("div",{style:{color:o.textSecondary,padding:"40px",textAlign:"center",fontFamily:m.body},children:r.length===0?"No logs available. Start the MCP Shark server to see logs here.":"No logs match the current filter."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{ref:u}),s.map((p,f)=>i.jsxs("div",{style:{display:"flex",gap:"12px",padding:"12px 16px",borderBottom:`1px solid ${o.borderLight}`,background:o.bgCard,transition:"background-color 0.15s ease"},onMouseEnter:g=>{g.currentTarget.style.background=o.bgHover},onMouseLeave:g=>{g.currentTarget.style.background=o.bgCard},children:[i.jsx("span",{style:{color:o.textTertiary,minWidth:"140px",flexShrink:0,fontFamily:m.mono,fontSize:"11px"},children:new Date(p.timestamp).toLocaleTimeString()}),i.jsx("span",{style:{color:o.textTertiary,minWidth:"70px",flexShrink:0,textTransform:"uppercase",fontFamily:m.body,fontSize:"10px",fontWeight:"600",letterSpacing:"0.05em"},children:p.type}),i.jsx("span",{style:{color:c(p.type),whiteSpace:"pre-wrap",wordBreak:"break-word",flex:1,fontFamily:m.mono,fontSize:"12px",lineHeight:"1.5"},children:p.line})]},`${p.timestamp}-${f}`))]})})}var Hf={outline:{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"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const Ce=(r,s,u,c)=>{const p=P.forwardRef(({color:f="currentColor",size:g=24,stroke:y=2,title:x,className:T,children:v,...w},b)=>P.createElement("svg",{ref:b,...Hf[r],width:g,height:g,className:["tabler-icon",`tabler-icon-${s}`,T].join(" "),strokeWidth:y,stroke:f,...w},[x&&P.createElement("title",{key:"svg-title"},x),...c.map(([_,M])=>P.createElement(_,M)),...Array.isArray(v)?v:[v]]));return p.displayName=`${u}`,p};const Uf=[["path",{d:"M12 9v4",key:"svg-0"}],["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],Vf=Ce("outline","alert-triangle","AlertTriangle",Uf);const Qf=[["path",{d:"M4 13h5",key:"svg-0"}],["path",{d:"M12 16v-8h3a2 2 0 0 1 2 2v1a2 2 0 0 1 -2 2h-3",key:"svg-1"}],["path",{d:"M20 8v8",key:"svg-2"}],["path",{d:"M9 16v-5.5a2.5 2.5 0 0 0 -5 0v5.5",key:"svg-3"}]],Yf=Ce("outline","api","Api",Qf);const Jf=[["path",{d:"M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6",key:"svg-0"}],["path",{d:"M9 17v1a3 3 0 0 0 6 0v-1",key:"svg-1"}]],Kf=Ce("outline","bell","Bell",Jf);const Gf=[["path",{d:"M4 17v1a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M8 16h8",key:"svg-1"}],["path",{d:"M8.322 12.582l7.956 .836",key:"svg-2"}],["path",{d:"M8.787 9.168l7.826 1.664",key:"svg-3"}],["path",{d:"M10.096 5.764l7.608 2.472",key:"svg-4"}]],Xf=Ce("outline","brand-stackoverflow","BrandStackoverflow",Gf);const Zf=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],qf=Ce("outline","check","Check",Zf);const eg=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],xs=Ce("outline","chevron-down","ChevronDown",eg);const tg=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],Zd=Ce("outline","clock","Clock",tg);const ng=[["path",{d:"M7 8l-4 4l4 4",key:"svg-0"}],["path",{d:"M17 8l4 4l-4 4",key:"svg-1"}],["path",{d:"M14 4l-4 16",key:"svg-2"}]],rg=Ce("outline","code","Code",ng);const og=[["path",{d:"M12 6m-8 0a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 6v6a8 3 0 0 0 16 0v-6",key:"svg-1"}],["path",{d:"M4 12v6a8 3 0 0 0 16 0v-6",key:"svg-2"}]],ig=Ce("outline","database","Database",og);const lg=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],qd=Ce("outline","download","Download",lg);const sg=[["path",{d:"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6",key:"svg-0"}],["path",{d:"M11 13l9 -9",key:"svg-1"}],["path",{d:"M15 4h5v5",key:"svg-2"}]],ec=Ce("outline","external-link","ExternalLink",sg);const ag=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],ys=Ce("outline","eye","Eye",ag);const ug=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M9 9l1 0",key:"svg-2"}],["path",{d:"M9 13l6 0",key:"svg-3"}],["path",{d:"M9 17l6 0",key:"svg-4"}]],dg=Ce("outline","file-text","FileText",ug);const cg=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11v6",key:"svg-2"}],["path",{d:"M9.5 13.5l2.5 -2.5l2.5 2.5",key:"svg-3"}]],pg=Ce("outline","file-upload","FileUpload",cg);const fg=[["path",{d:"M9 6l11 0",key:"svg-0"}],["path",{d:"M9 12l11 0",key:"svg-1"}],["path",{d:"M9 18l11 0",key:"svg-2"}],["path",{d:"M5 6l0 .01",key:"svg-3"}],["path",{d:"M5 12l0 .01",key:"svg-4"}],["path",{d:"M5 18l0 .01",key:"svg-5"}]],gg=Ce("outline","list","List",fg);const hg=[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]],xg=Ce("outline","loader-2","Loader2",hg);const yg=[["path",{d:"M4 6l16 0",key:"svg-0"}],["path",{d:"M4 12l16 0",key:"svg-1"}],["path",{d:"M4 18l16 0",key:"svg-2"}]],tc=Ce("outline","menu-2","Menu2",yg);const mg=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]],vg=Ce("outline","message","Message",mg);const Sg=[["path",{d:"M6 9a6 6 0 1 0 12 0a6 6 0 0 0 -12 0",key:"svg-0"}],["path",{d:"M12 3c1.333 .333 2 2.333 2 6s-.667 5.667 -2 6",key:"svg-1"}],["path",{d:"M12 3c-1.333 .333 -2 2.333 -2 6s.667 5.667 2 6",key:"svg-2"}],["path",{d:"M6 9h12",key:"svg-3"}],["path",{d:"M3 20h7",key:"svg-4"}],["path",{d:"M14 20h7",key:"svg-5"}],["path",{d:"M10 20a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-6"}],["path",{d:"M12 15v3",key:"svg-7"}]],nc=Ce("outline","network","Network",Sg);const bg=[["path",{d:"M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5",key:"svg-0"}],["path",{d:"M12 12l8 -4.5",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}],["path",{d:"M12 12l-8 -4.5",key:"svg-3"}],["path",{d:"M16 5.25l-8 4.5",key:"svg-4"}]],Id=Ce("outline","package","Package",bg);const wg=[["path",{d:"M7 6a7.75 7.75 0 1 0 10 0",key:"svg-0"}],["path",{d:"M12 4l0 8",key:"svg-1"}]],kg=Ce("outline","power","Power",wg);const jg=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],oi=Ce("outline","refresh","Refresh",jg);const Cg=[["path",{d:"M3.06 13a9 9 0 1 0 .49 -4.087",key:"svg-0"}],["path",{d:"M3 4.001v5h5",key:"svg-1"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],Tg=Ce("outline","restore","Restore",Cg);const Pg=[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],rc=Ce("outline","search","Search",Pg);const _g=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],Lg=Ce("outline","settings","Settings",_g);const Mg=[["path",{d:"M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3",key:"svg-0"}]],oc=Ce("outline","shield","Shield",Mg);const zg=[["path",{d:"M7 10h3v-3l-3.5 -3.5a6 6 0 0 1 8 8l6 6a2 2 0 0 1 -3 3l-6 -6a6 6 0 0 1 -8 -8l3.5 3.5",key:"svg-0"}]],Eg=Ce("outline","tool","Tool",zg);const Rg=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],ai=Ce("outline","trash","Trash",Rg);const Fg=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]],Ig=Ce("outline","user","User",Fg);const $g=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],ms=Ce("outline","x","X",$g);function Ng({filter:r,setFilter:s,logType:u,setLogType:c,autoScroll:p,setAutoScroll:f,onClearLogs:g,onExportLogs:y,filteredCount:x,totalCount:T}){return i.jsxs("div",{style:{padding:"12px 16px",borderBottom:`1px solid ${o.borderLight}`,background:o.bgCard,display:"flex",gap:"10px",alignItems:"center",flexWrap:"wrap",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[i.jsxs("div",{style:{position:"relative",width:"300px"},children:[i.jsx(rc,{size:16,stroke:1.5,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:o.textTertiary,pointerEvents:"none"}}),i.jsx("input",{type:"text",placeholder:"Filter logs...",value:r,onChange:v=>s(v.target.value),style:{padding:"8px 12px 8px 36px",background:o.bgCard,border:`1px solid ${o.borderLight}`,color:o.textPrimary,fontSize:"13px",fontFamily:m.body,width:"100%",borderRadius:"8px",transition:"all 0.2s"},onFocus:v=>{v.currentTarget.style.borderColor=o.accentBlue,v.currentTarget.style.boxShadow=`0 0 0 3px ${o.accentBlue}20`},onBlur:v=>{v.currentTarget.style.borderColor=o.borderLight,v.currentTarget.style.boxShadow="none"}})]}),i.jsxs("select",{value:u,onChange:v=>c(v.target.value),style:{padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderLight}`,color:o.textPrimary,fontSize:"13px",fontFamily:m.body,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s"},onFocus:v=>{v.currentTarget.style.borderColor=o.accentBlue,v.currentTarget.style.boxShadow=`0 0 0 3px ${o.accentBlue}20`},onBlur:v=>{v.currentTarget.style.borderColor=o.borderLight,v.currentTarget.style.boxShadow="none"},children:[i.jsx("option",{value:"all",children:"All Types"}),i.jsx("option",{value:"stdout",children:"Stdout"}),i.jsx("option",{value:"stderr",children:"Stderr"}),i.jsx("option",{value:"error",children:"Errors"}),i.jsx("option",{value:"exit",children:"Exit"})]}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",color:o.textPrimary,fontSize:"13px",fontFamily:m.body,cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:p,onChange:v=>f(v.target.checked),style:{cursor:"pointer"}}),"Auto-scroll"]}),i.jsxs("button",{type:"button",onClick:g,style:{padding:"8px 14px",background:o.buttonDanger,border:"none",color:o.textInverse,fontSize:"12px",fontFamily:m.body,fontWeight:"500",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`,display:"flex",alignItems:"center",gap:"6px"},onMouseEnter:v=>{v.currentTarget.style.background=o.buttonDangerHover,v.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:v=>{v.currentTarget.style.background=o.buttonDanger,v.currentTarget.style.transform="translateY(0)"},children:[i.jsx(ai,{size:14,stroke:1.5}),"Clear Logs"]}),i.jsxs("button",{type:"button",onClick:y,style:{padding:"8px 14px",background:o.buttonPrimary,border:"none",color:o.textInverse,fontSize:"12px",fontFamily:m.body,fontWeight:"500",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`,display:"flex",alignItems:"center",gap:"6px"},onMouseEnter:v=>{v.currentTarget.style.background=o.buttonPrimaryHover,v.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:v=>{v.currentTarget.style.background=o.buttonPrimary,v.currentTarget.style.transform="translateY(0)"},children:[i.jsx(qd,{size:14,stroke:1.5}),"Export Logs"]}),i.jsxs("div",{style:{marginLeft:"auto",color:o.textSecondary,fontSize:"12px",fontFamily:m.body},children:[x," / ",T," lines"]})]})}function Dg(){const[r,s]=P.useState([]),[u,c]=P.useState(!0),[p,f]=P.useState(""),[g,y]=P.useState("all"),x=P.useRef(null),T=P.useRef(null);P.useEffect(()=>{u&&x.current&&x.current.scrollIntoView({behavior:"smooth",block:"start"})},[u]),P.useEffect(()=>{(async()=>{try{const D=await(await fetch("/api/composite/logs?limit=5000")).json();s(D)}catch(F){console.error("Failed to load logs:",F)}})();const E=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,L=new WebSocket(E);return T.current=L,L.onopen=()=>{console.log("WebSocket connected for logs")},L.onerror=F=>{console.error("WebSocket error:",F)},L.onmessage=F=>{try{const D=JSON.parse(F.data);D.type==="log"&&s(U=>[D.data,...U].slice(0,5e3))}catch(D){console.error("Failed to parse WebSocket message:",D)}},L.onclose=()=>{console.log("WebSocket closed, attempting to reconnect..."),setTimeout(()=>{T.current?.readyState===WebSocket.CLOSED&&console.log("WebSocket reconnection needed")},3e3)},()=>{(L.readyState===WebSocket.OPEN||L.readyState===WebSocket.CONNECTING)&&L.close()}},[]);const v=async()=>{try{await fetch("/api/composite/logs/clear",{method:"POST"}),s([])}catch(M){console.error("Failed to clear logs:",M)}},w=M=>{switch(M){case"stderr":case"error":return o.error;case"stdout":return o.textPrimary;case"exit":return o.accentOrange;default:return o.textSecondary}},b=r.filter(M=>!(g!=="all"&&M.type!==g||p&&!M.line.toLowerCase().includes(p.toLowerCase()))),_=async()=>{try{const E=await(await fetch("/api/composite/logs/export")).blob(),L=window.URL.createObjectURL(E),F=document.createElement("a");F.href=L,F.download=`mcp-shark-logs-${new Date().toISOString().replace(/[:.]/g,"-")}.txt`,document.body.appendChild(F),F.click(),window.URL.revokeObjectURL(L),document.body.removeChild(F)}catch(M){console.error("Failed to export logs:",M)}};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",background:o.bgPrimary,overflow:"hidden"},children:[i.jsx(Ng,{filter:p,setFilter:f,logType:g,setLogType:y,autoScroll:u,setAutoScroll:c,onClearLogs:v,onExportLogs:_,filteredCount:b.length,totalCount:r.length}),i.jsx(Af,{logs:r,filteredLogs:b,logEndRef:x,getLogColor:w})]})}function Vr({isOpen:r,onClose:s,onConfirm:u,title:c,message:p,confirmText:f="Confirm",cancelText:g="Cancel",danger:y=!1}){return r?i.jsx("dialog",{open:!0,"aria-modal":"true",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,border:"none",margin:0,width:"100%",height:"100%"},onClick:s,onKeyDown:x=>{x.key==="Escape"&&s()},children:i.jsxs("div",{role:"document",style:{background:o.bgCard,borderRadius:"12px",padding:"24px",maxWidth:"500px",width:"90%",boxShadow:`0 4px 20px ${o.shadowLg}`,fontFamily:m.body},onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),children:[i.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:"18px",fontWeight:"600",color:o.textPrimary},children:c}),i.jsx("p",{style:{margin:"0 0 24px 0",fontSize:"14px",color:o.textSecondary,lineHeight:"1.5"},children:p}),i.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:[i.jsx("button",{type:"button",onClick:s,style:{padding:"10px 20px",background:o.buttonSecondary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",color:o.textPrimary,fontSize:"14px",fontWeight:"500",fontFamily:m.body,cursor:"pointer",transition:"all 0.2s"},onMouseEnter:x=>{x.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:x=>{x.currentTarget.style.background=o.buttonSecondary},children:g}),i.jsx("button",{type:"button",onClick:()=>{u(),s()},style:{padding:"10px 20px",background:y?o.buttonDanger:o.buttonPrimary,border:"none",borderRadius:"8px",color:o.textInverse,fontSize:"14px",fontWeight:"500",fontFamily:m.body,cursor:"pointer",transition:"all 0.2s"},onMouseEnter:x=>{x.currentTarget.style.background=y?o.buttonDangerHover:o.buttonPrimaryHover},onMouseLeave:x=>{x.currentTarget.style.background=y?o.buttonDanger:o.buttonPrimary},children:f})]})]})}):null}function Og({backups:r,loadingBackups:s,onRefresh:u,onRestore:c,onView:p,onDelete:f}){const[g,y]=P.useState(!1),[x,T]=P.useState(null);return r.length===0?null:i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"20px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[i.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body},children:"Backup Files"}),i.jsxs("button",{type:"button",onClick:u,disabled:s,style:{padding:"4px 8px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:s?"not-allowed":"pointer",fontSize:"11px",borderRadius:"8px",opacity:s?.5:1},title:"Refresh backups",children:[i.jsx(oi,{size:14,stroke:1.5,style:{marginRight:"4px"}}),s?"Loading...":"Refresh"]})]}),i.jsx("p",{style:{fontSize:"12px",color:o.textSecondary,marginBottom:"12px",lineHeight:"1.4"},children:"View, restore, or delete backups of your MCP configuration files. Backups are created automatically when starting MCP Shark."}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((v,w)=>i.jsxs("div",{style:{padding:"12px",background:o.bgPrimary,border:`1px solid ${o.borderMedium}`,borderRadius:"8px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[i.jsxs("div",{style:{flex:1},children:[i.jsx("div",{style:{color:o.textPrimary,fontSize:"12px",fontWeight:"500",marginBottom:"4px"},children:v.displayPath}),i.jsxs("div",{style:{color:o.textTertiary,fontSize:"11px",fontFamily:m.body},children:["Created: ",new Date(v.modifiedAt||v.createdAt).toLocaleString()," • Size:"," ",(v.size/1024).toFixed(2)," KB"]})]}),i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.jsxs("button",{type:"button",onClick:()=>p(v.backupPath),style:{padding:"6px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:"pointer",fontSize:"12px",borderRadius:"8px",fontWeight:"500"},onMouseEnter:b=>{b.currentTarget.style.background=o.bgCard,b.currentTarget.style.borderColor=o.borderLight},onMouseLeave:b=>{b.currentTarget.style.background="transparent",b.currentTarget.style.borderColor=o.borderMedium},title:"View backup content",children:[i.jsx(ys,{size:14,stroke:1.5,style:{marginRight:"4px"}}),"View"]}),i.jsxs("button",{type:"button",onClick:()=>{T(v.backupPath),y(!0)},style:{padding:"6px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.error,cursor:"pointer",fontSize:"12px",borderRadius:"8px",fontWeight:"500",fontFamily:m.body,display:"flex",alignItems:"center",gap:"4px"},onMouseEnter:b=>{b.currentTarget.style.background=tr(o.error,.15),b.currentTarget.style.borderColor=o.error},onMouseLeave:b=>{b.currentTarget.style.background="transparent",b.currentTarget.style.borderColor=o.borderMedium},title:"Delete backup",children:[i.jsx(ai,{size:14,stroke:1.5}),"Delete"]}),i.jsxs("button",{type:"button",onClick:()=>c(v.backupPath,v.originalPath),style:{padding:"6px 12px",background:o.buttonPrimary,border:`1px solid ${o.buttonPrimary}`,color:o.textInverse,cursor:"pointer",fontSize:"12px",borderRadius:"8px",fontWeight:"500",fontFamily:m.body,display:"flex",alignItems:"center",gap:"4px"},onMouseEnter:b=>{b.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:b=>{b.currentTarget.style.background=o.buttonPrimary},title:"Restore this backup",children:[i.jsx(Tg,{size:14,stroke:1.5}),"Restore"]})]})]},v.backupPath||`backup-${w}`))}),i.jsx(Vr,{isOpen:g,onClose:()=>{y(!1),T(null)},onConfirm:()=>{x&&f(x),y(!1),T(null)},title:"Delete Backup",message:"Are you sure you want to delete this backup? This action cannot be undone.",confirmText:"Delete",cancelText:"Cancel",danger:!0})]})}function Bg({detectedPaths:r,detecting:s,onDetect:u,onSelect:c,onView:p}){return r.length===0?null:i.jsxs("div",{style:{marginBottom:"8px"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[i.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontWeight:"600",fontFamily:m.body},children:"Detected Configuration Files:"}),i.jsx("button",{type:"button",onClick:u,disabled:s,title:"Refresh detection",style:{padding:"4px 8px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:s?"not-allowed":"pointer",fontSize:"11px",borderRadius:"8px",opacity:s?.5:1,display:"flex",alignItems:"center",gap:"4px"},children:s?i.jsxs(i.Fragment,{children:[i.jsx(oi,{size:12,stroke:1.5,style:{animation:"spin 1s linear infinite"}}),i.jsx("span",{children:"Detecting..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(oi,{size:12,stroke:1.5}),i.jsx("span",{children:"Refresh"})]})})]}),i.jsx("div",{"data-tour":"detected-editors",style:{display:"flex",flexDirection:"column",gap:"6px"},children:r.map((f,g)=>i.jsxs("button",{type:"button","data-tour":g===0?"first-detected-editor":void 0,onClick:()=>c(f.path),onDoubleClick:()=>{f.exists&&p(f.path)},style:{padding:"8px 12px",background:f.exists?`${o.accentBlue}20`:o.bgSecondary,border:`1px solid ${f.exists?o.accentBlue:o.borderMedium}`,color:o.textPrimary,cursor:"pointer",fontSize:"12px",borderRadius:"8px",textAlign:"left",display:"flex",justifyContent:"space-between",alignItems:"center",transition:"all 0.2s"},onMouseEnter:y=>{y.currentTarget.style.background=f.exists?`${o.accentBlue}30`:o.bgHover},onMouseLeave:y=>{y.currentTarget.style.background=f.exists?`${o.accentBlue}20`:o.bgSecondary},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("span",{style:{display:"inline-flex",alignItems:"center"},children:f.editor==="Cursor"?i.jsx(rg,{size:14,stroke:1.5}):i.jsx(Zd,{size:14,stroke:1.5})}),i.jsxs("div",{children:[i.jsx("div",{style:{fontWeight:"500"},children:f.editor}),i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:m.body},children:f.displayPath})]})]}),i.jsx("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:f.exists&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{fontSize:"10px",padding:"2px 6px",background:o.success,color:o.textInverse,borderRadius:"6px",fontWeight:"500"},children:"Found"}),i.jsxs("button",{type:"button",onClick:y=>{y.stopPropagation(),p(f.path)},title:"View file content",style:{fontSize:"10px",padding:"2px 6px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,borderRadius:"6px",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px"},children:[i.jsx(ys,{size:10,stroke:1.5}),i.jsx("span",{children:"View"})]})]})})]},`${f.editor}-${f.path}-${g}`))})]})}function Wg({filePath:r,fileContent:s,updatePath:u,onFileSelect:c,onPathChange:p,onUpdatePathChange:f}){return i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.jsxs("label",{"data-tour":"select-file",style:{padding:"8px 16px",background:o.buttonPrimary,border:`1px solid ${o.buttonPrimary}`,color:o.textInverse,cursor:"pointer",fontSize:"13px",borderRadius:"8px",fontWeight:"500",whiteSpace:"nowrap",transition:"background 0.2s"},onMouseEnter:g=>{g.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:g=>{g.currentTarget.style.background=o.buttonPrimary},children:[i.jsx(pg,{size:14,stroke:1.5,style:{marginRight:"6px",display:"inline-block"}}),"Select File",i.jsx("input",{type:"file",accept:".json",onChange:c,style:{display:"none"}})]}),i.jsx("span",{style:{color:o.textTertiary,fontSize:"13px",fontWeight:"500",fontFamily:m.body},children:"OR"}),i.jsx("input",{type:"text",placeholder:"Enter file path (e.g., ~/.cursor/mcp.json)",value:r,onChange:p,style:{flex:1,padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderMedium}`,color:o.textPrimary,fontSize:"13px",borderRadius:"8px"}})]}),s&&!r&&i.jsxs("div",{children:[i.jsx("label",{htmlFor:"update-path-input",style:{display:"block",fontSize:"12px",color:o.textSecondary,marginBottom:"6px"},children:"Optional: File Path to Update"}),i.jsx("input",{id:"update-path-input",type:"text",placeholder:"Enter file path to update (e.g., ~/.cursor/mcp.json)",value:u,onChange:f,style:{width:"100%",padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderMedium}`,color:o.textPrimary,fontSize:"13px",borderRadius:"8px"}}),i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,marginTop:"6px",fontFamily:m.body},children:"Provide the file path if you want to update the original config file (backup will be created)"})]}),s&&i.jsxs("div",{style:{marginTop:"8px"},children:[i.jsx("div",{style:{color:o.textSecondary,fontSize:"12px",marginBottom:"6px",fontWeight:"500"},children:"File Content Preview"}),i.jsx("pre",{style:{background:o.bgCard,padding:"12px",borderRadius:"8px",fontSize:"12px",fontFamily:"monospace",color:o.textPrimary,maxHeight:"200px",overflow:"auto",border:`1px solid ${o.borderLight}`,lineHeight:"1.5"},children:s})]})]})}function Ag({services:r,selectedServices:s,onSelectionChange:u}){return r.length===0?null:i.jsxs("div",{style:{marginTop:"16px"},children:[i.jsxs("div",{style:{marginBottom:"12px"},children:[i.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"8px",color:o.textPrimary,fontFamily:m.body},children:"Select Services"}),i.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,lineHeight:"1.5",fontFamily:m.body},children:"Choose which services to include in the MCP Shark server. Only selected services will be available."})]}),i.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"12px",flexWrap:"wrap"},children:[i.jsx("button",{type:"button",onClick:()=>{u(new Set(r.map(c=>c.name)))},style:{padding:"4px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:"pointer",fontSize:"12px",borderRadius:"8px"},children:"Select All"}),i.jsx("button",{type:"button",onClick:()=>{u(new Set)},style:{padding:"4px 12px",background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,cursor:"pointer",fontSize:"12px",borderRadius:"8px"},children:"Deselect All"}),i.jsxs("div",{style:{marginLeft:"auto",fontSize:"12px",color:o.textSecondary,display:"flex",alignItems:"center"},children:[s.size," of ",r.length," selected"]})]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"300px",overflowY:"auto",padding:"8px",background:o.bgPrimary,borderRadius:"4px",border:`1px solid ${o.borderLight}`},children:r.map(c=>{const p=s.has(c.name);return i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px",background:p?o.bgSelected:"transparent",border:`1px solid ${p?o.accentBlue:o.borderMedium}`,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:f=>{p||(f.currentTarget.style.background=o.bgHover)},onMouseLeave:f=>{p||(f.currentTarget.style.background="transparent")},children:[i.jsx("input",{type:"checkbox",checked:p,onChange:f=>{const g=new Set(s);f.target.checked?g.add(c.name):g.delete(c.name),u(g)},style:{width:"18px",height:"18px",cursor:"pointer"}}),i.jsxs("div",{style:{flex:1},children:[i.jsx("div",{style:{fontWeight:"500",color:o.textPrimary,fontSize:"13px",marginBottom:"4px"},children:c.name}),i.jsxs("div",{style:{fontSize:"11px",color:o.textSecondary,display:"flex",gap:"12px",flexWrap:"wrap"},children:[i.jsx("span",{style:{padding:"2px 6px",background:c.type==="http"?"#0e639c":"#4a9e5f",color:o.textInverse,borderRadius:"6px",fontSize:"10px",fontWeight:"500"},children:c.type.toUpperCase()}),c.url&&i.jsx("span",{style:{fontFamily:"monospace",fontSize:"11px"},children:c.url}),c.command&&i.jsxs("span",{style:{fontFamily:"monospace",fontSize:"11px"},children:[c.command," ",c.args?.join(" ")||""]})]})]})]},c.name)})}),s.size===0&&i.jsx("div",{style:{marginTop:"8px",padding:"8px 12px",background:tr(o.error,.15),border:`1px solid ${o.error}`,borderRadius:"8px",color:o.error,fontSize:"12px"},children:"⚠️ Please select at least one service to start the server"})]})}function Hg({detectedPaths:r,detecting:s,onDetect:u,onPathSelect:c,onViewConfig:p,filePath:f,fileContent:g,updatePath:y,onFileSelect:x,onPathChange:T,onUpdatePathChange:v,services:w,selectedServices:b,onSelectionChange:_}){return i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"20px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[i.jsxs("div",{style:{marginBottom:"16px"},children:[i.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"8px",color:o.textPrimary,fontFamily:m.body},children:"Configuration File"}),i.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,lineHeight:"1.5",fontFamily:m.body},children:"Select your MCP configuration file or provide a file path. The file will be converted to MCP Shark format and used to start the server."})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsx(Bg,{detectedPaths:r,detecting:s,onDetect:u,onSelect:c,onView:p}),i.jsx(Wg,{filePath:f,fileContent:g,updatePath:y,onFileSelect:x,onPathChange:T,onUpdatePathChange:v}),i.jsx(Ag,{services:w,selectedServices:b,onSelectionChange:_})]})]})}function Ug({viewingConfig:r,configContent:s,loadingConfig:u,onClose:c,viewingBackup:p,backupContent:f,loadingBackup:g}){const y=p!==null;if(!(r!==null)&&!y)return null;const T=y?f:s,v=y?g:u,w=y?"Backup File":"MCP Configuration File";return i.jsx("dialog",{open:!0,"aria-modal":"true",style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,padding:"20px",border:"none",margin:0,width:"100%",height:"100%"},onClick:c,onKeyDown:b=>{b.key==="Escape"&&c()},children:i.jsxs("div",{role:"document",style:{background:o.bgPrimary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",width:"100%",maxWidth:"800px",maxHeight:"90vh",display:"flex",flexDirection:"column",overflow:"hidden"},onClick:b=>b.stopPropagation(),onKeyDown:b=>b.stopPropagation(),children:[i.jsxs("div",{style:{padding:"16px",borderBottom:"1px solid #333",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[i.jsxs("div",{children:[i.jsx("h3",{style:{fontSize:"16px",fontWeight:"500",marginBottom:"4px",color:o.textPrimary},children:w}),T&&i.jsxs("div",{style:{fontSize:"12px",color:"#858585"},children:[T.displayPath,y&&T.createdAt&&i.jsxs("span",{style:{marginLeft:"12px",color:"#666"},children:["Created: ",new Date(T.createdAt).toLocaleString()]})]})]}),i.jsx("button",{type:"button",onClick:c,style:{background:"transparent",border:"none",color:o.textPrimary,cursor:"pointer",fontSize:"24px",padding:"0",width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center"},children:"×"})]}),i.jsx("div",{style:{flex:1,overflow:"auto",padding:"20px"},children:v?i.jsx("div",{style:{color:"#858585",textAlign:"center",padding:"40px"},children:"Loading..."}):T?i.jsx("pre",{style:{background:o.bgPrimary,padding:"16px",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",color:o.textPrimary,overflow:"auto",border:`1px solid ${o.borderLight}`,lineHeight:"1.6",margin:0},children:T.content}):i.jsx("div",{style:{color:"#f48771",textAlign:"center",padding:"40px"},children:"Failed to load file content"})})]})})}function Vg({message:r,error:s}){return!r&&!s?null:i.jsx("div",{style:{marginBottom:"20px",padding:"12px 16px",background:tr(r?o.info:o.error,.15),border:`1px solid ${r?o.info:o.error}`,borderRadius:"8px",color:r?o.textPrimary:o.error,fontSize:"13px",lineHeight:"1.6",fontFamily:m.body,boxShadow:`0 2px 4px ${o.shadowSm}`},children:r||s})}function Qg({status:r,loading:s,onStart:u,onStop:c,canStart:p}){return i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"20px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[i.jsx("div",{style:{marginBottom:"16px"},children:i.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"8px",color:o.textPrimary,fontFamily:m.body},children:"Server Control"})}),i.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center",flexWrap:"wrap"},children:[r.running?i.jsx("button",{type:"button",onClick:c,disabled:s,style:{padding:"10px 20px",background:o.buttonDanger,border:`1px solid ${o.buttonDanger}`,color:o.textInverse,cursor:s?"not-allowed":"pointer",fontSize:"13px",fontFamily:m.body,fontWeight:"500",borderRadius:"8px",opacity:s?.5:1,transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`},onMouseEnter:f=>{s||(f.currentTarget.style.background=o.buttonDangerHover,f.currentTarget.style.transform="translateY(-1px)")},onMouseLeave:f=>{f.currentTarget.style.background=o.buttonDanger,f.currentTarget.style.transform="translateY(0)"},children:s?"Stopping...":"Stop MCP Shark"}):i.jsx("button",{type:"button","data-tour":"start-button",onClick:u,disabled:s||!p,style:{padding:"10px 20px",background:o.buttonPrimary,border:`1px solid ${o.buttonPrimary}`,color:o.textInverse,cursor:s||!p?"not-allowed":"pointer",fontSize:"13px",fontFamily:m.body,fontWeight:"500",borderRadius:"8px",opacity:s||!p?.5:1,transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`},onMouseEnter:f=>{!s&&p&&(f.currentTarget.style.background=o.buttonPrimaryHover,f.currentTarget.style.transform="translateY(-1px)")},onMouseLeave:f=>{f.currentTarget.style.background=o.buttonPrimary,f.currentTarget.style.transform="translateY(0)"},children:s?"Processing...":"Start MCP Shark"}),i.jsxs("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"10px",padding:"8px 16px",background:o.bgPrimary,border:`1px solid ${o.borderLight}`,borderRadius:"8px"},children:[i.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:r.running?o.success:o.textTertiary,boxShadow:r.running?`0 0 8px ${o.success}80`:"none",transition:"all 0.3s"}}),i.jsx("span",{style:{color:o.textPrimary,fontSize:"13px",fontWeight:"500",fontFamily:m.body},children:r.running?r.pid?`Running (PID: ${r.pid})`:"Running":"Stopped"})]})]})]})}function Yg(){return i.jsxs("div",{style:{marginBottom:"24px"},children:[i.jsx("h2",{style:{fontSize:"24px",fontWeight:"700",marginBottom:"12px",color:o.textPrimary,fontFamily:m.body},children:"MCP Shark Server Setup"}),i.jsx("p",{style:{fontSize:"15px",color:o.textSecondary,lineHeight:"1.6",fontFamily:m.body},children:"Convert your MCP configuration file and start the MCP Shark server to aggregate multiple MCP servers into a single endpoint."})]})}function Jg({filePath:r,updatePath:s}){return i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:[i.jsx("h3",{style:{fontSize:"15px",fontWeight:"600",marginBottom:"12px",color:o.textPrimary,fontFamily:m.body},children:"What This Does"}),i.jsxs("ul",{style:{margin:0,paddingLeft:"20px",fontSize:"13px",color:o.textSecondary,lineHeight:"1.8",fontFamily:m.body},children:[i.jsxs("li",{children:["Converts your MCP config (",i.jsx("code",{style:{color:o.accentOrange,fontFamily:m.mono},children:"mcpServers"}),") to MCP Shark format (",i.jsx("code",{style:{color:o.accentOrange,fontFamily:m.mono},children:"servers"}),")"]}),i.jsxs("li",{children:["Starts the MCP Shark server on"," ",i.jsx("code",{style:{color:o.accentBlue,fontFamily:m.mono},children:"http://localhost:9851/mcp"})]}),i.jsx("li",{children:r||s?"Updates your original config file to point to the MCP Shark server (creates a backup first)":"Note: Provide a file path to update your original config file automatically"}),(r||s)&&i.jsx("li",{style:{color:o.success,marginTop:"4px",fontWeight:"500"},children:"✓ Original config will be automatically restored when you stop the server or close the UI"})]})]})}function Kg(){const[r,s]=P.useState([]),[u,c]=P.useState(!0),[p,f]=P.useState([]),[g,y]=P.useState(!1),[x,T]=P.useState(null),[v,w]=P.useState(null),[b,_]=P.useState(!1),[M,E]=P.useState(null),[L,F]=P.useState(null),[D,U]=P.useState(!1),W=P.useCallback(async()=>{c(!0);try{const Y=await(await fetch("/api/config/detect")).json();s(Y.detected||[])}catch(G){console.error("Failed to detect config paths:",G)}finally{c(!1)}},[]),$=P.useCallback(async()=>{y(!0);try{const Y=await(await fetch("/api/config/backups")).json();f(Y.backups||[])}catch(G){console.error("Failed to load backups:",G)}finally{y(!1)}},[]),A=async G=>{_(!0),T(G);try{const Y=await fetch(`/api/config/read?filePath=${encodeURIComponent(G)}`),ue=await Y.json();Y.ok?w(ue):w(null)}catch{w(null)}finally{_(!1)}},K=async G=>{U(!0),E(G);try{const Y=await fetch(`/api/config/backup/view?backupPath=${encodeURIComponent(G)}`),ue=await Y.json();Y.ok?F(ue):F(null)}catch{F(null)}finally{U(!1)}},V=async G=>{try{return(await fetch("/api/config/backup/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupPath:G})})).ok?(await $(),!0):!1}catch(Y){return console.error("Failed to delete backup:",Y),!1}};return P.useEffect(()=>{W(),$()},[W,$]),{detectedPaths:r,detecting:u,detectConfigPaths:W,backups:p,loadingBackups:g,loadBackups:$,viewingConfig:x,configContent:v,loadingConfig:b,handleViewConfig:A,setViewingConfig:T,setConfigContent:w,viewingBackup:M,backupContent:L,loadingBackup:D,handleViewBackup:K,handleDeleteBackup:V,setViewingBackup:E,setBackupContent:F}}function Gg(r,s){const[u,c]=P.useState([]),[p,f]=P.useState(new Set),[g,y]=P.useState(!1),x=P.useCallback(async()=>{if(!r&&!s){c([]),f(new Set);return}y(!0);try{const v=await fetch("/api/config/services",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r?{fileContent:r}:{filePath:s})}),w=await v.json();v.ok&&w.services?(c(w.services),f(new Set(w.services.map(b=>b.name)))):(c([]),f(new Set))}catch(T){console.error("Failed to extract services:",T),c([]),f(new Set)}finally{y(!1)}},[r,s]);return P.useEffect(()=>{r||s?x():(c([]),f(new Set))},[r,s,x]),{services:u,selectedServices:p,setSelectedServices:f,loadingServices:g}}function Xg(){const[r,s]=P.useState(""),[u,c]=P.useState(""),[p,f]=P.useState(""),[g,y]=P.useState({running:!1,pid:null}),[x,T]=P.useState(!1),[v,w]=P.useState(null),[b,_]=P.useState(null),[M,E]=P.useState(!1),[L,F]=P.useState({backupPath:null,originalPath:null}),{services:D,selectedServices:U,setSelectedServices:W}=Gg(r,u),{detectedPaths:$,detecting:A,detectConfigPaths:K,backups:V,loadingBackups:G,loadBackups:Y,viewingConfig:ue,configContent:ve,loadingConfig:me,handleViewConfig:Ee,setViewingConfig:Ne,setConfigContent:Re,viewingBackup:he,backupContent:J,loadingBackup:q,handleViewBackup:X,handleDeleteBackup:j,setViewingBackup:N,setBackupContent:ie}=Kg();P.useEffect(()=>{we();const Se=setInterval(we,2e3);return()=>clearInterval(Se)},[]);const de=(Se,De)=>{F({backupPath:Se,originalPath:De}),E(!0)},pe=async()=>{const{backupPath:Se,originalPath:De}=L;E(!1);try{const Je=await fetch("/api/config/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({backupPath:Se,originalPath:De})}),vt=await Je.json();Je.ok?(w(vt.message||"Config restored successfully"),_(null),Y(),K()):(_(vt.error||"Failed to restore backup"),w(null))}catch(Je){_(Je.message||"Failed to restore backup"),w(null)}},xe=async Se=>{await j(Se)?(w("Backup deleted successfully"),_(null)):(_("Failed to delete backup"),w(null))},we=async()=>{try{const De=await(await fetch("/api/composite/status")).json();y(De)}catch(Se){console.error("Failed to fetch status:",Se)}},ke=Se=>{const De=Se.target.files[0];if(De){const Je=new FileReader;Je.onload=vt=>{s(vt.target.result)},Je.readAsText(De)}},ce=Se=>{const De=Se.target.value;c(De),De&&s("")},Le=Se=>{f(Se.target.value)},_t=async()=>{T(!0),_(null),w(null);try{const Se=r?{fileContent:r,filePath:p||null}:{filePath:u};U.size>0&&(Se.selectedServices=Array.from(U));const De=await fetch("/api/composite/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Se)}),Je=await De.json();if(De.ok){const vt=Je.message||"MCP Shark server started successfully";w(Je.backupPath?`${vt} (Backup saved to ${Je.backupPath})`:vt),s(""),c(""),f(""),W(new Set),setTimeout(we,1e3)}else _(Je.error||"Failed to setup MCP Shark server")}catch(Se){_(Se.message||"Failed to setup MCP Shark server")}finally{T(!1)}},Vt=async()=>{T(!0),_(null),w(null);try{const Se=await fetch("/api/composite/stop",{method:"POST"}),De=await Se.json();if(Se.ok){const Je=De.message||"MCP Shark server stopped";w(De.message?.includes("restored")?"MCP Shark server stopped and original config file restored":Je),setTimeout(we,1e3)}else _(De.error||"Failed to stop MCP Shark server")}catch(Se){_(Se.message||"Failed to stop MCP Shark server")}finally{T(!1)}},Qt=(r||u)&&(D.length===0||U.size>0);return i.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",background:o.bgPrimary,overflow:"auto"},children:[i.jsxs("div",{style:{width:"100%",maxWidth:"1200px",margin:"0 auto",padding:"32px",minHeight:"100%",boxSizing:"border-box"},children:[i.jsx(Yg,{}),i.jsx(Hg,{detectedPaths:$,detecting:A,onDetect:K,onPathSelect:Se=>{c(Se),s(""),f(Se)},onViewConfig:Ee,filePath:u,fileContent:r,updatePath:p,onFileSelect:ke,onPathChange:ce,onUpdatePathChange:Le,services:D,selectedServices:U,onSelectionChange:W}),i.jsx(Qg,{status:g,loading:x,onStart:_t,onStop:Vt,canStart:Qt}),i.jsx(Vg,{message:v,error:b}),i.jsx(Og,{backups:V,loadingBackups:G,onRefresh:Y,onRestore:de,onView:X,onDelete:xe}),i.jsx(Jg,{filePath:u,updatePath:p})]}),i.jsx(Vr,{isOpen:M,onClose:()=>E(!1),onConfirm:pe,title:"Restore Backup",message:"Are you sure you want to restore this backup? This will overwrite the current config file.",confirmText:"Restore",cancelText:"Cancel",danger:!1}),i.jsx(Ug,{viewingConfig:ue,configContent:ve,loadingConfig:me,viewingBackup:he,backupContent:J,loadingBackup:q,onClose:()=>{Ne(null),Re(null),N(null),ie(null)}})]})}function Zg({elementRect:r,_onClick:s}){if(!r)return i.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.8)"}});const u=8,c=3;return i.jsxs(i.Fragment,{children:[r.top>0&&i.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,height:`${r.top-u}px`,background:"rgba(0, 0, 0, 0.8)",zIndex:9999}}),r.bottom<window.innerHeight&&i.jsx("div",{style:{position:"fixed",bottom:0,left:0,right:0,height:`${window.innerHeight-r.bottom-u}px`,background:"rgba(0, 0, 0, 0.8)",zIndex:9999}}),r.left>0&&i.jsx("div",{style:{position:"fixed",top:`${Math.max(0,r.top-u)}px`,left:0,width:`${r.left-u}px`,height:`${r.height+u*2}px`,background:"rgba(0, 0, 0, 0.8)",zIndex:9999}}),r.right<window.innerWidth&&i.jsx("div",{style:{position:"fixed",top:`${Math.max(0,r.top-u)}px`,right:0,width:`${window.innerWidth-r.right-u}px`,height:`${r.height+u*2}px`,background:"rgba(0, 0, 0, 0.8)",zIndex:9999}}),i.jsx("div",{style:{position:"fixed",left:r.left-u-c,top:r.top-u-c,width:r.width+(u+c)*2,height:r.height+(u+c)*2,border:`${c}px solid #4ec9b0`,borderRadius:"8px",boxShadow:"0 0 0 2px rgba(78, 201, 176, 0.3), 0 0 20px rgba(78, 201, 176, 0.5), 0 0 40px rgba(78, 201, 176, 0.3), inset 0 0 20px rgba(78, 201, 176, 0.1)",zIndex:1e4,pointerEvents:"none",animation:"pulse 2s ease-in-out infinite"}}),i.jsx("style",{children:`
|
|
9
|
+
@keyframes pulse {
|
|
10
|
+
0%, 100% {
|
|
11
|
+
box-shadow:
|
|
12
|
+
0 0 0 2px rgba(78, 201, 176, 0.3),
|
|
13
|
+
0 0 20px rgba(78, 201, 176, 0.5),
|
|
14
|
+
0 0 40px rgba(78, 201, 176, 0.3),
|
|
15
|
+
inset 0 0 20px rgba(78, 201, 176, 0.1);
|
|
16
|
+
}
|
|
17
|
+
50% {
|
|
18
|
+
box-shadow:
|
|
19
|
+
0 0 0 3px rgba(78, 201, 176, 0.4),
|
|
20
|
+
0 0 30px rgba(78, 201, 176, 0.7),
|
|
21
|
+
0 0 60px rgba(78, 201, 176, 0.5),
|
|
22
|
+
inset 0 0 30px rgba(78, 201, 176, 0.2);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`})]})}const qg=({size:r=16,color:s="currentColor"})=>i.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"Close icon",children:[i.jsx("title",{children:"Close icon"}),i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),eh=({size:r=16,color:s="currentColor"})=>i.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"Chevron right icon",children:[i.jsx("title",{children:"Chevron right icon"}),i.jsx("polyline",{points:"9 18 15 12 9 6"})]}),th=({size:r=16,color:s="currentColor"})=>i.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"Chevron left icon",children:[i.jsx("title",{children:"Chevron left icon"}),i.jsx("polyline",{points:"15 18 9 12 15 6"})]});function nh({currentStep:r,totalSteps:s,onNext:u,onPrevious:c,onSkip:p}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",pointerEvents:"none"},children:[i.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),p()},onMouseDown:f=>f.stopPropagation(),style:{background:"transparent",border:`1px solid ${o.borderMedium}`,color:o.textSecondary,padding:"8px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",fontFamily:m.body,flex:1,pointerEvents:"auto"},onMouseEnter:f=>{f.currentTarget.style.background=o.bgHover,f.currentTarget.style.color=o.textPrimary,f.currentTarget.style.borderColor=o.borderMedium},onMouseLeave:f=>{f.currentTarget.style.background="transparent",f.currentTarget.style.color=o.textSecondary,f.currentTarget.style.borderColor=o.borderMedium},children:"Skip Tour"}),i.jsxs("div",{style:{display:"flex",gap:"8px",pointerEvents:"auto"},children:[r>0&&i.jsxs("button",{type:"button",onClick:f=>{f.stopPropagation(),c()},onMouseDown:f=>f.stopPropagation(),style:{background:o.buttonSecondary,border:`1px solid ${o.borderMedium}`,color:o.textPrimary,padding:"8px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",fontFamily:m.body,display:"flex",alignItems:"center",gap:"4px"},onMouseEnter:f=>{f.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:f=>{f.currentTarget.style.background=o.buttonSecondary},children:[i.jsx(th,{size:14}),"Previous"]}),i.jsxs("button",{type:"button",onClick:f=>{f.stopPropagation(),u()},onMouseDown:f=>f.stopPropagation(),style:{background:o.buttonPrimary,border:"none",color:o.textInverse,padding:"8px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",fontFamily:m.body,display:"flex",alignItems:"center",gap:"4px",fontWeight:"500"},onMouseEnter:f=>{f.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:f=>{f.currentTarget.style.background=o.buttonPrimary},children:[r===s-1?"Finish":"Next",r<s-1&&i.jsx(eh,{size:14})]})]})]})}function rh({step:r,currentStep:s,totalSteps:u,isDragging:c,onSkip:p}){return i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:"12px"},children:[i.jsxs("div",{style:{flex:1,pointerEvents:"none"},children:[i.jsx("h3",{style:{margin:0,color:o.accentBlue,fontSize:"16px",fontWeight:"600",fontFamily:m.body},children:r.title}),i.jsxs("p",{style:{margin:"4px 0 0 0",color:o.textTertiary,fontSize:"12px",fontFamily:m.body},children:["Step ",s+1," of ",u,c&&i.jsx("span",{style:{marginLeft:"8px",fontSize:"11px"},children:"• Dragging"})]})]}),i.jsx("button",{type:"button",onClick:f=>{f.stopPropagation(),p()},onMouseDown:f=>f.stopPropagation(),style:{background:"transparent",border:"none",color:o.textTertiary,cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",borderRadius:"8px",marginLeft:"12px",pointerEvents:"auto"},onMouseEnter:f=>{f.currentTarget.style.background=o.bgHover,f.currentTarget.style.color=o.textPrimary},onMouseLeave:f=>{f.currentTarget.style.background="transparent",f.currentTarget.style.color=o.textTertiary},title:"Skip tour",children:i.jsx(qg,{size:18})})]})}function oh(r,s,u){const[c,p]=P.useState({x:0,y:0}),[f,g]=P.useState(!1),[y,x]=P.useState({x:0,y:0});P.useEffect(()=>{p({x:0,y:0})},[]);const T=(w,b)=>{if(w.preventDefault(),w.stopPropagation(),b.current){const _=b.current.getBoundingClientRect();x({x:w.clientX-_.left,y:w.clientY-_.top}),g(!0)}};return P.useEffect(()=>{if(!f)return;const w=_=>{p({x:_.clientX-y.x,y:_.clientY-y.y})},b=()=>{g(!1)};return window.addEventListener("mousemove",w),window.addEventListener("mouseup",b),()=>{window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",b)}},[f,y]),{position:(()=>{if(!r)return{left:0,top:0,transform:"none"};const w=350,b=200,_=20;if(c.x!==0||c.y!==0){const U=Math.max(10,Math.min(c.x,window.innerWidth-w-10)),W=Math.max(10,Math.min(c.y,window.innerHeight-b-10));return{left:U,top:W,transform:"none"}}const M=s.position||"bottom",L=((U,W,$,A,K)=>{if(U==="left"){const Y=W.left-$-K;return{left:Y<10?W.right+K:Y,top:W.top+W.height/2,transform:"translateY(-50%)"}}if(U==="right"){const Y=W.right+K;return{left:Y+$>window.innerWidth-10?W.left-$-K:Y,top:W.top+W.height/2,transform:"translateY(-50%)"}}if(U==="top"){const Y=W.top-A-K,ue=Y<10?W.bottom+K:Y;return{left:W.left+W.width/2,top:ue,transform:"translate(-50%, 0)"}}const V=W.bottom+K,G=V+A>window.innerHeight-10?W.top-A-K:V;return{left:W.left+W.width/2,top:G,transform:"translate(-50%, 0)"}})(M,r,w,b,_),F=Math.max(10,Math.min(L.left,window.innerWidth-w-10)),D=Math.max(10,Math.min(L.top,window.innerHeight-b-10));return{left:F,top:D,transform:L.transform}})(),isDragging:f,handleMouseDown:T}}function ih({elementRect:r,step:s,currentStep:u,totalSteps:c,onNext:p,onPrevious:f,onSkip:g}){const y=P.useRef(null),{position:x,isDragging:T,handleMouseDown:v}=oh(r,s);return r?i.jsxs("button",{type:"button",ref:y,onMouseDown:w=>v(w,y),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),v(w,y))},"aria-label":"Draggable tooltip",style:{position:"fixed",left:`${x.left}px`,top:`${x.top}px`,transform:x.transform,background:o.bgCard,border:`2px solid ${o.accentBlue}`,borderRadius:"12px",padding:"20px",maxWidth:"350px",minWidth:"300px",boxShadow:`0 4px 20px ${o.shadowLg}`,zIndex:10001,pointerEvents:"auto",cursor:T?"grabbing":"grab",userSelect:"none"},onClick:w=>{const b=w.target;b.tagName!=="BUTTON"&&b.tagName!=="INPUT"&&!b.closest("button")&&w.stopPropagation()},children:[i.jsx(rh,{step:s,currentStep:u,totalSteps:c,isDragging:T,onSkip:g}),i.jsx("div",{style:{color:o.textPrimary,fontSize:"14px",lineHeight:"1.6",marginBottom:"20px",pointerEvents:"none",fontFamily:m.body},children:s.content}),i.jsx(nh,{currentStep:u,totalSteps:c,onNext:p,onPrevious:f,onSkip:g})]}):null}function lh({steps:r,onComplete:s,onSkip:u,onStepChange:c}){const[p,f]=P.useState(0),[g,y]=P.useState(null),[x,T]=P.useState(null),v=P.useRef(null);P.useEffect(()=>{if(!g)return;const L=()=>{if(g){const D=g.getBoundingClientRect();T(D)}};L();const F={passive:!0,capture:!0};return window.addEventListener("scroll",L,F),window.addEventListener("resize",L,{passive:!0}),()=>{window.removeEventListener("scroll",L,F),window.removeEventListener("resize",L,{passive:!0})}},[g]),P.useEffect(()=>{if(r.length===0)return;const L=r[p];if(!L)return;c&&c(p);const F=setTimeout(()=>{const D=document.querySelector(L.target);D?(y(D),D.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),setTimeout(()=>{const U=D.getBoundingClientRect();T(U)},300)):(y(null),T(null))},200);return()=>clearTimeout(F)},[p,r,c]);const w=()=>{if(p<r.length-1){const L=p+1;f(L),c&&c(L)}else _()},b=()=>{if(p>0){const L=p-1;f(L),c&&c(L)}},_=async()=>{try{await fetch("/api/help/dismiss",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tourCompleted:!0})})}catch(L){console.error("Failed to save tour state:",L)}s()},M=()=>{_(),u&&u()};if(r.length===0||p>=r.length)return null;const E=r[p];return i.jsxs(i.Fragment,{children:[i.jsx("div",{ref:v,role:"presentation",style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9998,pointerEvents:"auto"},onClick:M,onKeyDown:L=>{L.key==="Escape"&&M()},children:i.jsx(Zg,{elementRect:x})}),x&&i.jsx(ih,{elementRect:x,step:E,currentStep:p,totalSteps:r.length,onNext:w,onPrevious:b,onSkip:M})]})}function sh(){const[r,s]=P.useState(3);return P.useEffect(()=>{const u=setInterval(()=>{s(c=>c<=1?(clearInterval(u),window.location.href="/",0):c-1)},1e3);return()=>clearInterval(u)},[]),i.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",background:o.bgPrimary,fontFamily:m.body,padding:"20px",textAlign:"center"},children:i.jsxs("div",{style:{maxWidth:"500px",width:"100%"},children:[i.jsx("h1",{style:{fontSize:"32px",fontWeight:"600",color:o.textPrimary,margin:"0 0 16px 0"},children:"MCP Shark Shutdown"}),i.jsx("p",{style:{fontSize:"16px",color:o.textSecondary,margin:"0 0 32px 0",lineHeight:"1.6"},children:"MCP Shark has been shut down."}),i.jsx("div",{style:{padding:"24px",background:o.bgCard,borderRadius:"12px",border:`1px solid ${o.borderLight}`,boxShadow:`0 4px 12px ${o.shadowMd}`},children:i.jsxs("p",{style:{fontSize:"14px",color:o.textSecondary,margin:"0 0 16px 0",lineHeight:"1.6"},children:["The MCP Shark server has been stopped. Redirecting in ",r," second",r!==1?"s":"","..."]})})]})})}function er({title:r,count:s,children:u,defaultExpanded:c=!1}){const[p,f]=P.useState(c);return i.jsxs("div",{style:{background:o.bgTertiary,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden"},children:[i.jsxs("button",{type:"button",onClick:()=>f(!p),style:{width:"100%",padding:"8px 12px",display:"flex",alignItems:"center",justifyContent:"space-between",background:"transparent",border:"none",cursor:"pointer",fontFamily:m.body,transition:"background 0.15s"},onMouseEnter:g=>{g.currentTarget.style.background=o.bgCard},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"12px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body},children:r}),s!==void 0&&i.jsx("span",{style:{padding:"2px 6px",background:o.bgCard,borderRadius:"4px",fontSize:"10px",fontWeight:"500",color:o.textSecondary,border:`1px solid ${o.borderLight}`,fontFamily:m.body},children:s})]}),i.jsxs("svg",{style:{width:"14px",height:"14px",color:o.textSecondary,transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",role:"img","aria-label":"Chevron icon",children:[i.jsx("title",{children:"Chevron icon"}),i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})]})]}),p&&i.jsx("div",{style:{padding:"12px",borderTop:`1px solid ${o.borderLight}`,background:o.bgCard},children:u})]})}function Qr(r){if(!r)return o.textTertiary;switch(r.toLowerCase()){case"none":return o.accentGreen;case"low":return o.accentBlue;case"medium":return o.accentOrange;case"high":return o.error;case"critical":return o.error;default:return o.textTertiary}}function ds({findings:r,type:s}){return i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",fontSize:"12px",fontFamily:m.body},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{borderBottom:`1px solid ${o.borderLight}`,background:o.bgTertiary},children:[i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Name"}),i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Risk Level"}),i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Risk Score"}),i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Tags"}),i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Reasons"}),i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Safe Use Notes"}),s==="tool"&&i.jsx("th",{style:{textAlign:"left",padding:"6px 8px",fontSize:"10px",fontWeight:"600",color:o.textTertiary,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Poisoned"})]})}),i.jsx("tbody",{children:r.map((u,c)=>i.jsxs("tr",{style:{borderBottom:`1px solid ${o.borderLight}`,transition:"background 0.15s"},onMouseEnter:p=>{p.currentTarget.style.background=o.bgTertiary},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:[i.jsx("td",{style:{padding:"8px",fontSize:"12px",color:o.textPrimary,fontWeight:"500",fontFamily:m.body},children:u.name}),i.jsx("td",{style:{padding:"8px"},children:i.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",borderRadius:"4px",fontSize:"10px",fontWeight:"700",color:o.textInverse,background:Qr(u.risk_level),fontFamily:m.body},children:u.risk_level?.toUpperCase()})}),i.jsx("td",{style:{padding:"8px",fontSize:"12px",color:o.textSecondary,fontFamily:m.body},children:u.risk_score}),i.jsx("td",{style:{padding:"8px"},children:i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"2px"},children:u.risk_tags?.map((p,f)=>i.jsx("span",{style:{padding:"2px 6px",background:o.bgCard,borderRadius:"4px",fontSize:"10px",color:o.textSecondary,border:`1px solid ${o.borderLight}`,fontFamily:m.body},children:p},`tag-${String(p)}-${f}`))})}),i.jsx("td",{style:{padding:"8px",fontSize:"12px",color:o.textSecondary,fontFamily:m.body},children:i.jsx("ul",{style:{listStyle:"disc",listStylePosition:"inside",margin:0,padding:0},children:u.reasons?.map((p,f)=>i.jsx("li",{style:{fontSize:"10px",marginBottom:"2px"},children:p},`reason-${f}-${p.substring(0,20)}`))})}),i.jsx("td",{style:{padding:"8px",fontSize:"10px",color:o.textSecondary,maxWidth:"200px",fontFamily:m.body},children:u.safe_use_notes}),s==="tool"&&Object.prototype.hasOwnProperty.call(u,"is_potentially_poisoned")&&i.jsx("td",{style:{padding:"8px"},children:u.is_potentially_poisoned?i.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",fontSize:"10px",fontWeight:"500",borderRadius:"4px",background:`${o.error}20`,color:o.error,border:`1px solid ${o.error}40`,fontFamily:m.body},children:"Yes"}):i.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 6px",fontSize:"10px",fontWeight:"500",borderRadius:"4px",background:`${o.accentGreen}20`,color:o.accentGreen,border:`1px solid ${o.accentGreen}40`,fontFamily:m.body},children:"No"})})]},`finding-${u.id||u.name||c}-${c}`))})]})})}function ah({patterns:r}){return!r||r.length===0?null:i.jsx(er,{title:"Notable Patterns",count:r.length,defaultExpanded:!1,children:i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((s,u)=>i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"8px",background:`${o.accentOrange}10`,borderRadius:"6px",border:`1px solid ${o.accentOrange}20`,transition:"all 0.15s"},onMouseEnter:c=>{c.currentTarget.style.background=`${o.accentOrange}15`,c.currentTarget.style.borderColor=`${o.accentOrange}40`},onMouseLeave:c=>{c.currentTarget.style.background=`${o.accentOrange}10`,c.currentTarget.style.borderColor=`${o.accentOrange}20`},children:[i.jsx("div",{style:{flexShrink:0,marginTop:"2px",width:"16px",height:"16px",borderRadius:"50%",background:`${o.accentOrange}30`,border:`1px solid ${o.accentOrange}60`,display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsxs("svg",{style:{width:"10px",height:"10px",color:o.accentOrange},fill:"currentColor",viewBox:"0 0 20 20",role:"img","aria-label":"Pattern icon",children:[i.jsx("title",{children:"Pattern icon"}),i.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"})]})}),i.jsx("p",{style:{fontSize:"12px",color:o.textPrimary,lineHeight:"1.5",flex:1,margin:0,fontFamily:m.body},children:s})]},`pattern-${s.type||u}-${u}`))})})}function uh(r){const s=r.includes(`
|
|
26
|
+
`)?`
|
|
27
|
+
`:r.includes(" | ")?" | ":null;return s?i.jsx("ul",{style:{listStyle:"disc",listStylePosition:"inside",margin:0,paddingLeft:"8px"},children:r.split(s).map((u,c)=>i.jsx("li",{style:{fontSize:"12px",marginBottom:"2px"},children:u.trim()},`reason-${c}-${u.trim().substring(0,20)}`))}):i.jsx("p",{style:{fontSize:"12px"},children:r})}function dh({overallRiskLevel:r,overallReason:s}){return r?i.jsx(er,{title:"Overall Summary",count:s?1:0,defaultExpanded:!0,children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"12px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body},children:"Overall Risk Level:"}),i.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"4px",fontSize:"10px",fontWeight:"700",color:o.textInverse,background:Qr(r),fontFamily:m.body},children:r.toUpperCase()})]}),s&&i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:m.body},children:uh(s)})]})}):null}function ch({recommendations:r}){return!r||r.length===0?null:i.jsx(er,{title:"Recommendations",count:r.length,defaultExpanded:!1,children:i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((s,u)=>i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px",padding:"8px",background:`${o.accentBlue}10`,borderRadius:"6px",border:`1px solid ${o.accentBlue}20`,transition:"all 0.15s"},onMouseEnter:c=>{c.currentTarget.style.background=`${o.accentBlue}15`,c.currentTarget.style.borderColor=`${o.accentBlue}40`},onMouseLeave:c=>{c.currentTarget.style.background=`${o.accentBlue}10`,c.currentTarget.style.borderColor=`${o.accentBlue}20`},children:[i.jsx("div",{style:{flexShrink:0,marginTop:"2px",width:"16px",height:"16px",borderRadius:"50%",background:`${o.accentBlue}30`,border:`1px solid ${o.accentBlue}60`,display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx("span",{style:{fontSize:"10px",fontWeight:"600",color:o.accentBlue,fontFamily:m.body},children:u+1})}),i.jsx("p",{style:{fontSize:"12px",color:o.textPrimary,lineHeight:"1.5",flex:1,margin:0,fontFamily:m.body},children:s})]},`recommendation-${s.type||u}-${u}`))})})}function ph({analysis:r}){if(!r)return i.jsx("div",{style:{padding:"12px",background:`${o.bgTertiary}80`,borderRadius:"6px",border:`1px solid ${o.borderLight}`,fontSize:"12px",color:o.textSecondary,fontFamily:m.body},children:"No analysis data available."});const s=r.tool_findings||[],u=r.prompt_findings||[],c=r.resource_findings||[];return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsx(dh,{overallRiskLevel:r.overall_risk_level,overallReason:r.overall_reason}),s.length>0&&i.jsx(er,{title:"Tool Findings",count:s.length,defaultExpanded:!0,children:i.jsx(ds,{findings:s,type:"tool"})}),u.length>0&&i.jsx(er,{title:"Prompt Findings",count:u.length,defaultExpanded:!0,children:i.jsx(ds,{findings:u,type:"prompt"})}),c.length>0&&i.jsx(er,{title:"Resource Findings",count:c.length,defaultExpanded:!0,children:i.jsx(ds,{findings:c,type:"resource"})}),i.jsx(ch,{recommendations:r.recommendations}),i.jsx(ah,{patterns:r.notable_patterns})]})}function fh({scan:r,scanId:s,serverName:u,analysisResult:c}){return i.jsxs("details",{style:{marginBottom:"16px"},children:[i.jsx("summary",{style:{cursor:"pointer",padding:"8px 12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontFamily:m.body,color:o.textSecondary,border:`1px solid ${o.borderLight}`,userSelect:"none"},onMouseEnter:p=>{p.currentTarget.style.background=o.bgSecondary,p.currentTarget.style.color=o.textPrimary},onMouseLeave:p=>{p.currentTarget.style.background=o.bgTertiary,p.currentTarget.style.color=o.textSecondary},children:"Debug Info (click to expand)"}),i.jsx("div",{style:{marginTop:"8px",padding:"12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontFamily:"monospace",border:`1px solid ${o.borderLight}`},children:i.jsxs("div",{style:{fontSize:"10px",color:o.textSecondary,lineHeight:"1.6"},children:[i.jsxs("div",{children:["scanId: ",s?`"${s}"`:"missing"]}),i.jsxs("div",{children:['serverName: "',u,'"']}),i.jsxs("div",{children:["analysisResult: ",c?"found":"missing"]}),i.jsxs("div",{children:["has scan.result: ",r.result?"yes":"no"]}),i.jsxs("div",{children:["has scan.data: ",r.data?"yes":"no"]}),i.jsxs("div",{children:["scan keys: ",Object.keys(r||{}).join(", ")]}),r.result&&i.jsxs("div",{children:["scan.result keys: ",Object.keys(r.result||{}).join(", ")]}),r.data&&i.jsxs("div",{children:["scan.data keys: ",Object.keys(r.data||{}).join(", ")]})]})})]})}function gh({scan:r}){return i.jsxs("div",{style:{marginBottom:"24px"},children:[i.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body,marginBottom:"12px",paddingBottom:"8px",borderBottom:`1px solid ${o.borderLight}`},children:"Raw Data"}),i.jsxs("details",{children:[i.jsx("summary",{style:{cursor:"pointer",padding:"8px",background:o.bgTertiary,borderRadius:"4px",fontSize:"11px",color:o.textSecondary,fontFamily:m.body,marginBottom:"8px"},children:"Click to view raw JSON data"}),i.jsx("pre",{style:{padding:"12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontFamily:"monospace",color:o.textPrimary,overflow:"auto",maxHeight:"400px",margin:0},children:JSON.stringify(r,null,2)})]})]})}function hh({scanId:r,serverName:s,onClose:u}){return i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[i.jsxs("div",{children:[i.jsx("h2",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body,margin:0,marginBottom:"8px"},children:s}),r&&i.jsxs("div",{style:{fontSize:"12px",color:o.textTertiary,fontFamily:m.body},children:["ID: ",r]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[r&&i.jsxs("a",{href:`https://smart.mcpshark.sh/scan-results?id=${r}`,target:"_blank",rel:"noopener noreferrer",style:{padding:"6px 12px",background:o.buttonPrimary,border:"none",color:o.textInverse,borderRadius:"6px",fontSize:"12px",fontFamily:m.body,fontWeight:"500",textDecoration:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"},children:[i.jsx(ec,{size:14,stroke:1.5}),"View on Smart Scan"]}),i.jsx("button",{type:"button",onClick:u,style:{padding:"6px",background:"transparent",border:"none",color:o.textSecondary,cursor:"pointer",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:c=>{c.currentTarget.style.background=o.bgTertiary,c.currentTarget.style.color=o.textPrimary},onMouseLeave:c=>{c.currentTarget.style.background="transparent",c.currentTarget.style.color=o.textSecondary},children:i.jsx(ms,{size:20,stroke:1.5})})]})]})}function xh({status:r,overallRiskLevel:s,createdAt:u,updatedAt:c}){const p=f=>f?new Date(f).toLocaleString():"N/A";return i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"16px",padding:"16px",background:o.bgTertiary,borderRadius:"8px"},children:[r&&i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:m.body,marginBottom:"4px"},children:"Status"}),i.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontFamily:m.body,fontWeight:"500"},children:r})]}),s&&i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:m.body,marginBottom:"4px"},children:"Overall Risk Level"}),i.jsx("span",{style:{padding:"4px 10px",borderRadius:"6px",fontSize:"11px",fontWeight:"700",fontFamily:m.body,background:Qr(s),color:o.textInverse,display:"inline-block"},children:s.toLowerCase()})]}),u&&i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:m.body,marginBottom:"4px"},children:"Created At"}),i.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontFamily:m.body,fontWeight:"500"},children:p(u)})]}),c&&i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:"11px",color:o.textTertiary,fontFamily:m.body,marginBottom:"4px"},children:"Updated At"}),i.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontFamily:m.body,fontWeight:"500"},children:p(c)})]})]})}function yh({serverData:r}){return r?i.jsxs("div",{style:{marginBottom:"24px"},children:[i.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body,marginBottom:"12px",paddingBottom:"8px",borderBottom:`1px solid ${o.borderLight}`},children:"Server Information"}),i.jsxs("div",{style:{padding:"12px",background:o.bgTertiary,borderRadius:"6px",fontSize:"12px",fontFamily:m.body},children:[i.jsxs("div",{style:{marginBottom:"8px"},children:[i.jsx("strong",{style:{color:o.textTertiary},children:"Name: "}),i.jsx("span",{style:{color:o.textPrimary},children:r.name||"N/A"})]}),r.description&&i.jsxs("div",{children:[i.jsx("strong",{style:{color:o.textTertiary},children:"Description: "}),i.jsx("span",{style:{color:o.textPrimary},children:r.description})]})]})]}):null}function ye(r,s){return s.split(".").reduce((c,p)=>c&&typeof c=="object"&&p in c?c[p]:null,r)}function mh(r){const s=r.result||r.data||r,u=ye(r,"result.id")||ye(r,"id")||ye(r,"scan_id")||ye(r,"data.id")||ye(r,"data.scan_id")||s?.id||s?.scan_id,c=r.serverName||r.server_name||ye(r,"result.mcp_server_data.server.name")||ye(r,"mcp_server_data.server.name")||ye(r,"server.name")||ye(r,"data.server.name")||ye(r,"data.data.server.name")||r.server?.name||"Unknown Server",p=ye(r,"result.status")||ye(r,"status")||ye(r,"data.status"),f=ye(r,"result.overall_risk_level")||ye(r,"overall_risk_level")||ye(r,"data.overall_risk_level")||ye(r,"data.data.overall_risk_level"),g=ye(r,"result.created_at")||ye(r,"created_at")||ye(r,"data.created_at")||ye(r,"data.data.created_at"),y=ye(r,"result.updated_at")||ye(r,"updated_at")||ye(r,"data.updated_at")||ye(r,"data.data.updated_at"),x=ye(r,"result.analysis_result")||ye(r,"analysis_result")||ye(r,"data.analysis_result")||ye(r,"data.data.analysis_result")||ye(r,"data.data.data.analysis_result"),v=((b,_)=>{if(b)return b;if(_&&typeof _=="object"){if(_.tool_findings||_.prompt_findings||_.resource_findings)return _;if(_.analysis_result)return _.analysis_result}return null})(x,s),w=ye(r,"result.mcp_server_data.server")||ye(r,"mcp_server_data.server")||ye(r,"server")||ye(r,"data.server")||ye(r,"data.data.server")||ye(r,"mcp_server_data");return{scanId:u,serverName:c,status:p,overallRiskLevel:f,createdAt:g,updatedAt:y,analysisResult:v,serverData:w}}function ic({scan:r,loading:s,onClose:u}){if(s)return i.jsx("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"24px",textAlign:"center"},children:i.jsx("p",{style:{color:o.textSecondary,fontFamily:m.body},children:"Loading scan details..."})});if(!r)return i.jsx("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"24px",textAlign:"center"},children:i.jsx("p",{style:{color:o.textSecondary,fontFamily:m.body},children:"No scan data available"})});const{scanId:c,serverName:p,status:f,overallRiskLevel:g,createdAt:y,updatedAt:x,analysisResult:T,serverData:v}=mh(r);return i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"24px",boxShadow:`0 1px 3px ${o.shadowSm}`,position:"relative"},children:[i.jsx(hh,{scanId:c,serverName:p,onClose:u}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[i.jsx(fh,{scan:r,scanId:c,serverName:p,analysisResult:T}),i.jsx(xh,{status:f,overallRiskLevel:g,createdAt:y,updatedAt:x}),i.jsx(yh,{serverData:v}),T?i.jsxs("div",{style:{marginBottom:"24px"},children:[i.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body,marginBottom:"12px",paddingBottom:"8px",borderBottom:`1px solid ${o.borderLight}`},children:"Analysis Result"}),i.jsx(ph,{analysis:T})]}):i.jsxs("div",{style:{marginBottom:"24px"},children:[i.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body,marginBottom:"12px",paddingBottom:"8px",borderBottom:`1px solid ${o.borderLight}`},children:"Analysis Result"}),i.jsx("div",{style:{padding:"12px",background:`${o.bgTertiary}80`,borderRadius:"6px",border:`1px solid ${o.borderLight}`,fontSize:"12px",color:o.textSecondary,fontFamily:m.body},children:"No analysis result available for this scan. Check the Raw Data section below to see the scan structure."})]}),i.jsx(gh,{scan:r})]})]})}const lc=({size:r=24,color:s="currentColor"})=>i.jsx(oc,{size:r,stroke:1.5,color:s}),ui=({size:r=16,color:s="currentColor"})=>i.jsx(ec,{size:r,stroke:1.5,color:s}),vh=({size:r=16,color:s="currentColor"})=>i.jsx(Vf,{size:r,stroke:1.5,color:s}),Hr=({size:r=16,color:s="currentColor"})=>i.jsx(qf,{size:r,stroke:1.5,color:s}),sc=({size:r=16,color:s="currentColor"})=>i.jsx(Zd,{size:r,stroke:1.5,color:s}),ii=({size:r=16,color:s=o.accentBlue})=>i.jsx("div",{style:{width:r,height:r,border:`2px solid ${o.borderLight}`,borderTop:`2px solid ${s}`,borderRadius:"50%",animation:"spin 0.8s linear infinite"}});function Sh({result:r,onViewScan:s}){const u=r.serverName||r.server_name||r.server?.name||"Unknown Server";return console.log("[BatchResultItem] Rendering with result:",{serverName:r.serverName,extractedServerName:u,hasServerName:!!r.serverName,resultKeys:Object.keys(r)}),i.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${r.success?o.borderLight:o.error}`,borderRadius:"8px",padding:"10px 16px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flex:1,minWidth:0},children:[i.jsx("h3",{style:{fontSize:"13px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body,margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:u}),r.success&&i.jsxs(i.Fragment,{children:[r.data?.data?.overall_risk_level&&i.jsxs("span",{style:{padding:"4px 10px",borderRadius:"6px",fontSize:"10px",fontWeight:"700",fontFamily:m.body,background:Qr(r.data.data.overall_risk_level),color:o.textInverse,whiteSpace:"nowrap"},children:[r.data.data.overall_risk_level.toLowerCase()," risk"]}),s&&r.data&&i.jsxs("button",{type:"button",onClick:()=>s(r.data),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 10px",borderRadius:"6px",background:o.buttonPrimary,border:"none",color:o.textInverse,cursor:"pointer",transition:"all 0.2s",fontSize:"11px",fontWeight:"500",fontFamily:m.body,whiteSpace:"nowrap"},onMouseEnter:c=>{c.currentTarget.style.background=o.buttonPrimaryHover},onMouseLeave:c=>{c.currentTarget.style.background=o.buttonPrimary},children:[i.jsx(ys,{size:12,stroke:1.5}),i.jsx("span",{children:"View"})]}),r.data?.scan_id&&i.jsxs("a",{href:`https://smart.mcpshark.sh/scan-results?id=${r.data.scan_id}`,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 10px",borderRadius:"6px",background:o.bgSecondary,border:`1px solid ${o.borderLight}`,color:o.accentBlue,textDecoration:"none",cursor:"pointer",transition:"all 0.2s",fontSize:"11px",fontWeight:"500",fontFamily:m.body,whiteSpace:"nowrap"},onMouseEnter:c=>{c.currentTarget.style.background=o.bgTertiary,c.currentTarget.style.borderColor=o.accentBlue},onMouseLeave:c=>{c.currentTarget.style.background=o.bgSecondary,c.currentTarget.style.borderColor=o.borderLight},children:[i.jsx("span",{children:"open"}),i.jsx(ui,{size:12,color:o.accentBlue})]})]})]}),i.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:r.success?i.jsxs(i.Fragment,{children:[r.cached&&i.jsxs("span",{style:{padding:"4px 8px",borderRadius:"6px",fontSize:"10px",fontWeight:"600",fontFamily:m.body,background:o.bgSecondary,color:o.textSecondary,border:`1px solid ${o.borderLight}`,display:"inline-flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap"},title:"This result was retrieved from cache",children:[i.jsx(sc,{size:10,color:o.textSecondary}),i.jsx("span",{children:"Cached"})]}),i.jsxs("span",{style:{padding:"4px 8px",borderRadius:"6px",fontSize:"10px",fontWeight:"700",fontFamily:m.body,background:o.accentGreen,color:o.textInverse,display:"inline-flex",alignItems:"center",gap:"4px",whiteSpace:"nowrap"},children:[i.jsx(Hr,{size:10,color:o.textInverse}),i.jsx("span",{children:"Success"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{padding:"4px 8px",borderRadius:"6px",fontSize:"10px",fontWeight:"700",fontFamily:m.body,background:o.error,color:o.textInverse,whiteSpace:"nowrap"},children:"✗ Failed"}),r.error&&i.jsx("span",{style:{fontSize:"11px",color:o.error,fontFamily:m.body,whiteSpace:"nowrap",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis"},title:r.error,children:r.error})]})})]})}function bh({scanResults:r}){const s=r.filter(p=>p.cached).length,u=r.filter(p=>p.success&&!p.cached).length,c=r.every(p=>p.cached);return i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[i.jsxs("div",{children:[i.jsxs("h2",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body,margin:0,marginBottom:"4px"},children:["Scan Results (",r.length," server",r.length!==1?"s":"",")"]}),c&&i.jsx("p",{style:{fontSize:"12px",color:o.textTertiary,fontFamily:m.body,margin:0},children:"Showing cached results. Run a new scan to get the latest analysis."})]}),r.length>0&&i.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center",fontSize:"13px",color:o.textSecondary,fontFamily:m.body},children:[s>0&&i.jsxs("span",{style:{padding:"6px 10px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontWeight:"600",display:"inline-flex",alignItems:"center",gap:"4px",fontFamily:m.body},children:[i.jsx(sc,{size:12,color:o.textSecondary}),i.jsxs("span",{children:[s," cached"]})]}),u>0&&i.jsxs("span",{style:{padding:"6px 10px",background:o.bgTertiary,borderRadius:"6px",fontSize:"11px",fontWeight:"600",display:"inline-flex",alignItems:"center",gap:"4px"},children:[i.jsx(Hr,{size:12,color:o.accentGreen}),i.jsxs("span",{children:[u," scanned"]})]})]})]})}function wh({scanResults:r,onViewScan:s}){return r.length===0?null:i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"20px",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[i.jsx(bh,{scanResults:r}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:r.map((u,c)=>i.jsx(Sh,{result:u,onViewScan:s},u.scanId||`batch-result-${c}`))})]})}function kh(){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"400px",textAlign:"center",padding:"40px"},children:[i.jsx("div",{style:{marginBottom:"24px",opacity:.6},children:i.jsxs("svg",{width:64,height:64,viewBox:"0 0 24 24",fill:"none",stroke:o.textTertiary,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:.5},role:"img","aria-label":"Empty state icon",children:[i.jsx("title",{children:"Empty state icon"}),i.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),i.jsx("path",{d:"M9 12l2 2 4-4"})]})}),i.jsx("h3",{style:{fontSize:"20px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body,marginBottom:"8px"},children:"Ready to Scan"}),i.jsx("p",{style:{fontSize:"14px",color:o.textSecondary,fontFamily:m.body,maxWidth:"400px",lineHeight:"1.6"},children:"Configure your API token and discover MCP servers to start security scanning. Results will appear here."})]})}function jh({error:r}){return r?i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.error}`,borderRadius:"12px",padding:"16px 20px",marginBottom:"24px",display:"flex",gap:"12px",alignItems:"flex-start"},children:[i.jsx(vh,{size:20,color:o.error,style:{flexShrink:0,marginTop:"2px"}}),i.jsxs("div",{style:{flex:1},children:[i.jsx("p",{style:{fontSize:"14px",color:o.error,fontFamily:m.body,margin:0,fontWeight:"600",marginBottom:"4px"},children:"Error"}),i.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,fontFamily:m.body,margin:0,lineHeight:"1.5"},children:r})]})]}):null}function Ch({scanning:r,selectedServers:s}){return r?i.jsx("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"12px",padding:"24px",marginBottom:"24px",boxShadow:`0 2px 8px ${o.shadowSm}`},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[i.jsx(ii,{size:20}),i.jsxs("div",{style:{flex:1},children:[i.jsxs("p",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body,margin:0,marginBottom:"4px"},children:["Scanning ",s.size," server",s.size!==1?"s":"","..."]}),i.jsx("p",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:m.body,margin:0},children:"Analyzing security vulnerabilities and risks"})]})]})}):null}function Th({scanResult:r}){return r?i.jsxs("div",{style:{background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"20px",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[i.jsx("h2",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body,marginBottom:"16px"},children:"Scan Results"}),r.data?.overall_risk_level&&i.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"16px",marginBottom:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"8px"},children:[i.jsx("span",{style:{padding:"4px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:"700",fontFamily:m.body,background:Qr(r.data.overall_risk_level),color:o.textInverse},children:r.data.overall_risk_level.toUpperCase()}),i.jsx("span",{style:{fontSize:"14px",color:o.textSecondary,fontFamily:m.body},children:"Overall Risk Level"})]}),r.data.overall_reason&&i.jsx("p",{style:{fontSize:"13px",color:o.textSecondary,fontFamily:m.body,margin:0},children:r.data.overall_reason})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"12px",marginBottom:"20px"},children:[r.data?.tool_findings?.length>0&&i.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"12px"},children:[i.jsx("div",{style:{fontSize:"24px",fontWeight:"700",color:o.textPrimary,fontFamily:m.body},children:r.data.tool_findings.length}),i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:m.body},children:"Tool Findings"})]}),r.data?.resource_findings?.length>0&&i.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"12px"},children:[i.jsx("div",{style:{fontSize:"24px",fontWeight:"700",color:o.textPrimary,fontFamily:m.body},children:r.data.resource_findings.length}),i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:m.body},children:"Resource Findings"})]}),r.data?.prompt_findings?.length>0&&i.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"12px"},children:[i.jsx("div",{style:{fontSize:"24px",fontWeight:"700",color:o.textPrimary,fontFamily:m.body},children:r.data.prompt_findings.length}),i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,fontFamily:m.body},children:"Prompt Findings"})]})]}),r.data?.recommendations?.length>0&&i.jsxs("div",{style:{background:o.bgTertiary,border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"16px",marginBottom:"20px"},children:[i.jsx("h3",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body,marginBottom:"12px"},children:"Recommendations"}),i.jsx("ul",{style:{margin:0,paddingLeft:"20px",fontSize:"13px",color:o.textSecondary,fontFamily:m.body,lineHeight:"1.8"},children:r.data.recommendations.map((s,u)=>i.jsx("li",{children:s},`recommendation-${u}-${s.substring(0,30)}`))})]}),r.scan_id&&i.jsx("div",{style:{marginTop:"20px",paddingTop:"20px",borderTop:`1px solid ${o.borderLight}`},children:i.jsxs("a",{href:`https://smart.mcpshark.sh/scan-results?id=${r.scan_id}`,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"10px 20px",background:o.buttonSecondary,color:o.textPrimary,border:`1px solid ${o.borderMedium}`,borderRadius:"8px",textDecoration:"none",fontSize:"13px",fontWeight:"600",fontFamily:m.body,transition:"all 0.2s ease"},onMouseEnter:s=>{s.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:s=>{s.currentTarget.style.background=o.buttonSecondary},children:[i.jsx("span",{children:"View Full Results"}),i.jsx(ui,{size:14,color:o.textPrimary})]})})]}):null}function ac({error:r,scanning:s,selectedServers:u,scanResults:c,scanResult:p,onViewScan:f}){return i.jsxs("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"24px",background:o.bgPrimary},children:[!r&&c.length===0&&!p&&!s&&i.jsx(kh,{}),i.jsx(jh,{error:r}),i.jsx(Ch,{scanning:s,selectedServers:u}),c.length>0&&i.jsx(wh,{scanResults:c,onViewScan:f}),p&&c.length===0&&i.jsx(Th,{scanResult:p})]})}function Ph({error:r,loadingScans:s,selectedScan:u,loadingScanDetail:c,allScans:p,setSelectedScan:f,loadScanDetail:g,onViewScan:y}){return s?i.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",background:o.bgPrimary},children:i.jsx("p",{style:{color:o.textSecondary,fontFamily:m.body},children:"Loading cached scans..."})}):u?i.jsx(ic,{scan:u,loading:c,onClose:()=>{f(null),g(null)}}):i.jsxs(i.Fragment,{children:[r&&i.jsx("div",{style:{padding:"12px 16px",background:`${o.error}20`,border:`1px solid ${o.error}`,borderRadius:"8px",marginBottom:"16px",color:o.error,fontSize:"13px",fontFamily:m.body},children:r}),i.jsx(ac,{error:r,scanning:!1,selectedServers:[],scanResults:p,scanResult:null,onViewScan:y})]})}function _h({discoveredServers:r,selectedServers:s,setSelectedServers:u,runScan:c,scanning:p,apiToken:f}){const g=()=>{s.size===r.length?u(new Set):u(new Set(r.map(y=>y.name)))};return i.jsx("div",{style:{background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,padding:"12px 24px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px",flexWrap:"wrap"},children:[i.jsx("div",{style:{fontSize:"12px",fontWeight:"600",color:o.textSecondary,fontFamily:m.body,whiteSpace:"nowrap"},children:"Select servers to scan:"}),i.jsx("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap",flex:1},children:r.map((y,x)=>{const T=s.has(y.name);return i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:T?o.bgCard:o.bgTertiary,border:`1px solid ${T?o.accentBlue:o.borderLight}`,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s ease",fontSize:"12px",fontFamily:m.body,fontWeight:T?"600":"500",color:T?o.textPrimary:o.textSecondary},onMouseEnter:v=>{v.currentTarget.style.borderColor=o.accentBlue,v.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`},onMouseLeave:v=>{T||(v.currentTarget.style.borderColor=o.borderLight,v.currentTarget.style.boxShadow="none")},children:[i.jsx("input",{type:"checkbox",checked:T,onChange:v=>{const w=new Set(s);v.target.checked?w.add(y.name):w.delete(y.name),u(w)},style:{width:"16px",height:"16px",cursor:"pointer",accentColor:o.accentBlue}}),i.jsx("span",{children:y.name}),i.jsxs("span",{style:{fontSize:"10px",color:o.textTertiary,fontWeight:"400"},children:["(",y.tools?.length||0," tools, ",y.resources?.length||0," resources,"," ",y.prompts?.length||0," prompts)"]})]},y.name||`server-${x}`)})}),i.jsx("button",{type:"button",onClick:g,style:{padding:"6px 12px",background:o.buttonSecondary,color:o.textPrimary,border:`1px solid ${o.borderMedium}`,borderRadius:"6px",fontSize:"11px",fontWeight:"600",fontFamily:m.body,cursor:"pointer",transition:"all 0.2s ease",whiteSpace:"nowrap"},onMouseEnter:y=>{y.currentTarget.style.background=o.buttonSecondaryHover},onMouseLeave:y=>{y.currentTarget.style.background=o.buttonSecondary},children:s.size===r.length?"Deselect All":"Select All"}),i.jsx("button",{type:"button",onClick:c,disabled:!f||s.size===0||p,style:{padding:"8px 16px",background:f&&s.size>0&&!p?o.buttonPrimary:o.buttonSecondary,color:f&&s.size>0&&!p?o.textInverse:o.textTertiary,border:"none",borderRadius:"6px",fontSize:"13px",fontWeight:"600",fontFamily:m.body,cursor:f&&s.size>0&&!p?"pointer":"not-allowed",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap"},onMouseEnter:y=>{f&&s.size>0&&!p&&(y.currentTarget.style.background=o.buttonPrimaryHover,y.currentTarget.style.transform="translateY(-1px)",y.currentTarget.style.boxShadow=`0 4px 12px ${o.shadowMd}`)},onMouseLeave:y=>{f&&s.size>0&&!p&&(y.currentTarget.style.background=o.buttonPrimary,y.currentTarget.style.transform="translateY(0)",y.currentTarget.style.boxShadow="none")},children:p?i.jsxs(i.Fragment,{children:[i.jsx(ii,{size:14,color:o.textInverse}),i.jsxs("span",{children:["Scanning ",s.size," server",s.size!==1?"s":"","..."]})]}):i.jsxs(i.Fragment,{children:[i.jsx(lc,{size:14,color:f&&s.size>0?o.textInverse:o.textTertiary}),i.jsxs("span",{children:["Run Scan (",s.size,")"]})]})})]})})}function Lh({discoveredServers:r,selectedServers:s,setSelectedServers:u,runScan:c,scanning:p,apiToken:f,error:g,scanResults:y,scanResult:x,selectedScan:T,loadingScanDetail:v,setSelectedScan:w,loadScanDetail:b,onViewScan:_}){return T?i.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"24px",background:o.bgPrimary},children:i.jsx(ic,{scan:T,loading:v,onClose:()=>{w(null),b(null)}})}):i.jsxs(i.Fragment,{children:[r.length>0&&i.jsx(_h,{discoveredServers:r,selectedServers:s,setSelectedServers:u,runScan:c,scanning:p,apiToken:f}),i.jsx(ac,{error:g,scanning:p,selectedServers:s,scanResults:y,scanResult:x,onViewScan:_})]})}function Mh({apiToken:r,setApiToken:s,saveToken:u,loadingData:c,discoverMcpData:p,discoveredServers:f,_selectedServers:g,_setSelectedServers:y,scanning:x,clearCache:T,clearingCache:v,...w}){const{runScan:b}=w,_=P.useRef(null),[M,E]=P.useState(!1),L=F=>{s(F),_.current&&clearTimeout(_.current),F?_.current=setTimeout(()=>{u(F)},1e3):u("")};return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"20px",flexWrap:"wrap",flex:1,justifyContent:"flex-end"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("label",{htmlFor:"api-token-input",style:{fontSize:"12px",fontWeight:"600",color:o.textSecondary,fontFamily:m.body,whiteSpace:"nowrap"},children:"API Token:"}),i.jsxs("div",{style:{position:"relative",width:"200px"},children:[i.jsx("input",{id:"api-token-input",type:"password",value:r,onChange:F=>L(F.target.value),placeholder:"sk_...",style:{width:"100%",padding:"8px 10px",paddingRight:r?"28px":"10px",border:`1px solid ${r?o.accentGreen:o.borderMedium}`,borderRadius:"8px",fontSize:"12px",fontFamily:m.body,background:o.bgCard,color:o.textPrimary,boxSizing:"border-box",transition:"all 0.2s ease"},onFocus:F=>{F.currentTarget.style.borderColor=o.accentBlue,F.currentTarget.style.boxShadow=`0 0 0 2px ${o.accentBlue}20`},onBlur:F=>{F.currentTarget.style.borderColor=r?o.accentGreen:o.borderMedium,F.currentTarget.style.boxShadow="none"}}),r&&i.jsx("div",{style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)"},children:i.jsx(Hr,{size:12,color:o.accentGreen})})]}),i.jsxs("a",{href:"https://smart.mcpshark.sh/tokens",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",color:o.accentBlue,textDecoration:"none",fontFamily:m.body,fontWeight:"500",whiteSpace:"nowrap"},onMouseEnter:F=>{F.currentTarget.style.textDecoration="underline"},onMouseLeave:F=>{F.currentTarget.style.textDecoration="none"},children:[i.jsx("span",{children:"Get token"}),i.jsx(ui,{size:10,color:o.accentBlue})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("label",{htmlFor:"servers-label",style:{fontSize:"12px",fontWeight:"600",color:o.textSecondary,fontFamily:m.body,whiteSpace:"nowrap"},children:"Servers:"}),i.jsx("button",{type:"button",onClick:p,disabled:c,style:{padding:"8px 14px",background:c?o.buttonSecondary:o.buttonPrimary,color:c?o.textTertiary:o.textInverse,border:"none",borderRadius:"6px",fontSize:"12px",fontWeight:"600",fontFamily:m.body,cursor:c?"not-allowed":"pointer",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",whiteSpace:"nowrap"},onMouseEnter:F=>{c||(F.currentTarget.style.background=o.buttonPrimaryHover,F.currentTarget.style.transform="translateY(-1px)")},onMouseLeave:F=>{c||(F.currentTarget.style.background=o.buttonPrimary,F.currentTarget.style.transform="translateY(0)")},children:c?i.jsxs(i.Fragment,{children:[i.jsx(ii,{size:12}),i.jsx("span",{children:"Discovering..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(Hr,{size:12,color:o.textInverse}),i.jsx("span",{children:"Discover"})]})}),f.length>0&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 10px",background:o.bgTertiary,borderRadius:"8px",fontSize:"11px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body},children:[i.jsx(Hr,{size:12,color:o.accentGreen}),i.jsxs("span",{children:[f.length," server",f.length!==1?"s":""]})]})]}),i.jsx("button",{type:"button",onClick:()=>E(!0),disabled:v,style:{padding:"8px 14px",background:o.buttonSecondary,border:`1px solid ${o.borderLight}`,color:o.textSecondary,cursor:v?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",fontFamily:m.body,borderRadius:"8px",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",whiteSpace:"nowrap",opacity:v?.5:1},onMouseEnter:F=>{v||(F.currentTarget.style.background=o.buttonSecondaryHover,F.currentTarget.style.color=o.textPrimary)},onMouseLeave:F=>{v||(F.currentTarget.style.background=o.buttonSecondary,F.currentTarget.style.color=o.textSecondary)},title:"Clear cached scan results",children:v?i.jsxs(i.Fragment,{children:[i.jsx(ii,{size:12}),i.jsx("span",{children:"Clearing..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(ai,{size:14,stroke:1.5}),i.jsx("span",{children:"Clear Cache"})]})}),i.jsx(Vr,{isOpen:M,onClose:()=>E(!1),onConfirm:async()=>{(await T()).success&&E(!1)},title:"Clear Scan Cache?",message:"Are you sure you want to clear all cached scan results? This will force fresh scans for all servers on the next scan.",confirmText:"Clear Cache",cancelText:"Cancel",danger:!1})]})}function zh(){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginRight:"auto"},children:[i.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"10px",background:`linear-gradient(135deg, ${o.accentBlue}20, ${o.accentGreen}20)`,border:`2px solid ${o.accentBlue}40`,flexShrink:0},children:i.jsx(lc,{size:20,color:o.accentBlue})}),i.jsxs("div",{children:[i.jsx("h1",{style:{fontSize:"18px",fontWeight:"700",color:o.textPrimary,fontFamily:m.body,margin:0,letterSpacing:"-0.2px"},children:i.jsxs("a",{href:"https://smart.mcpshark.sh/#get-started",target:"_blank",rel:"noopener noreferrer",style:{color:o.textPrimary,textDecoration:"none",display:"inline-flex",alignItems:"center",gap:"6px",transition:"color 0.2s ease"},onMouseEnter:r=>{r.currentTarget.style.color=o.accentBlue},onMouseLeave:r=>{r.currentTarget.style.color=o.textPrimary},children:["Smart Scan",i.jsx(ui,{size:12,color:"currentColor"})]})}),i.jsx("p",{style:{fontSize:"11px",color:o.textSecondary,fontFamily:m.body,margin:0,lineHeight:"1.3"},children:"AI-powered security analysis for Model Context Protocol (MCP) servers"})]})]})}function Eh({viewMode:r,setViewMode:s,onSwitchToScan:u,onSwitchToList:c}){return i.jsxs("div",{style:{display:"flex",gap:"8px",border:`1px solid ${o.borderLight}`,borderRadius:"8px",padding:"4px",background:o.bgSecondary},children:[i.jsx("button",{type:"button",onClick:()=>{s("scan"),u?.()},style:{padding:"6px 14px",background:r==="scan"?o.bgCard:"transparent",border:"none",color:r==="scan"?o.textPrimary:o.textSecondary,borderRadius:"6px",fontSize:"12px",fontFamily:m.body,fontWeight:r==="scan"?"600":"400",cursor:"pointer",transition:"all 0.2s"},children:"Scan Servers"}),i.jsx("button",{type:"button",onClick:()=>{s("list"),c?.()},style:{padding:"6px 14px",background:r==="list"?o.bgCard:"transparent",border:"none",color:r==="list"?o.textPrimary:o.textSecondary,borderRadius:"6px",fontSize:"12px",fontFamily:m.body,fontWeight:r==="list"?"600":"400",cursor:"pointer",transition:"all 0.2s"},children:"View All Scans"})]})}function Rh(r,s,u){const[c,p]=P.useState(!1);return{clearingCache:c,clearCache:async()=>{p(!0),u(null);try{const g=await fetch("/api/smartscan/cache/clear",{method:"POST"}),y=await g.json();if(g.ok)return r.length>0&&await s(),{success:!0,message:y.message};throw new Error(y.error||"Failed to clear cache")}catch(g){return u(g.message||"Failed to clear cache"),{success:!1,error:g.message}}finally{p(!1)}}}}function Fh(r){const[s,u]=P.useState(null),[c,p]=P.useState([]),[f,g]=P.useState(new Set),[y,x]=P.useState(!1),[T,v]=P.useState(null);return{mcpData:s,discoveredServers:c,selectedServers:f,setSelectedServers:g,loadingData:y,discoverMcpData:async()=>{x(!0),r(null),u(null),p([]);try{const _=await fetch("/api/smartscan/discover");if(!_.ok){const E=await _.json();throw new Error(E.message||"Failed to discover servers")}const M=await _.json();if(!M.success||!M.servers||M.servers.length===0)throw new Error("No MCP servers found in config. Please configure servers in the Setup tab.");if(p(M.servers),M.servers.length>0){g(new Set(M.servers.map(E=>E.name)));try{const E=await fetch("/api/smartscan/cached-results",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({servers:M.servers})});if(E.ok){const L=await E.json();L.success&&L.results&&L.results.filter(D=>D.success&&D.cached).length>0}}catch(E){console.debug("Could not load cached results:",E)}}if(M.servers.length>0){const E=M.servers[0];u({server:{name:E.name,description:"Discovered from MCP config"},tools:E.tools||[],resources:E.resources||[],prompts:E.prompts||[]})}}catch(_){r(_.message||"Failed to discover MCP server data")}finally{x(!1)}},makeMcpRequest:async(_,M={})=>{const E={"Content-Type":"application/json"};T&&(E["Mcp-Session-Id"]=T);const L=await fetch("/api/playground/proxy",{method:"POST",headers:E,body:JSON.stringify({method:_,params:M})}),F=await L.json(),D=L.headers.get("Mcp-Session-Id")||L.headers.get("mcp-session-id")||F._sessionId;if(D&&D!==T&&v(D),!L.ok)throw new Error(F.error?.message||F.message||"Request failed");return F.result||F}}}function Ih(r,s){const[u,c]=P.useState([]),[p,f]=P.useState(!1),[g,y]=P.useState(null),[x,T]=P.useState(!1);return{allScans:u,loadingScans:p,loadAllScans:async()=>{f(!0),s(null);try{console.log("Loading cached scans from local storage...");const b=await fetch("/api/smartscan/scans?cache=true"),_=await b.json();if(console.log("Cache response:",{status:b.status,ok:b.ok,cacheData:_}),b.ok){const M=_.scans||[];console.log(`[useScanList] Loaded ${M.length} cached scans from API`),console.log("[useScanList] Full cacheData:",_),M.length>0&&console.log("[useScanList] First scan structure:",{keys:Object.keys(M[0]),serverName:M[0].serverName,server_name:M[0].server_name,server:M[0].server,fullScan:M[0]});const E=M.map((L,F)=>{console.log(`[useScanList] Transforming scan ${F}:`,{scanId:L.id||L.scan_id,serverName:L.serverName,server_name:L.server_name,server:L.server,hasServerName:!!L.serverName,hasServerNameAlt:!!L.server_name,hasServer:!!L.server});const D=L.serverName?.trim()||L.server_name?.trim()||L.server?.name?.trim()||"Unknown Server";console.log(`[useScanList] Extracted serverName for scan ${F}: "${D}"`),D==="Unknown Server"&&console.error("[useScanList] Could not find server name in scan:",{scanId:L.id||L.scan_id,hasServerName:!!L.serverName,hasServerNameAlt:!!L.server_name,hasServer:!!L.server,serverNameValue:L.serverName,serverNameAltValue:L.server_name,serverNameFromServer:L.server?.name,scanKeys:Object.keys(L),fullScanObject:L});const U=L.data||L.result||L,W=U?.data&&typeof U.data=="object"?U.data:U,$={serverName:D,success:!0,cached:!0,data:{scan_id:L.scan_id||L.id,data:W}};return console.log(`[useScanList] Transformed result ${F}:`,{serverName:$.serverName,scan_id:$.data.scan_id}),$});console.log("[useScanList] Final transformed scanResults:",E.map(L=>({serverName:L.serverName,scan_id:L.data.scan_id}))),console.log("[useScanList] Setting allScans state with:",E.length,"items"),console.log("[useScanList] First item serverName:",E[0]?.serverName),console.log("[useScanList] Second item serverName:",E[1]?.serverName),c(E),E.length===0&&s("No cached scans found. Please run a scan first to see results here.")}else s(_.error||_.message||"Failed to load cached scans")}catch(b){s(b.message||"Failed to load cached scans")}finally{f(!1)}},selectedScan:g,setSelectedScan:y,loadingScanDetail:x,loadScanDetail:async b=>{if(!b){y(null);return}const _=u.find(M=>M.data?.scan_id===b||M.data?.data?.id===b||M.data?.data?.scan_id===b);if(_?.cached&&_.data?.data){const M=_.data.data;y({...M,scan_id:_.data.scan_id||M.id||M.scan_id});return}if(!r){s("Please enter your API token to view scan details");return}T(!0),s(null);try{const M=await fetch(`/api/smartscan/scans/${b}`,{headers:{Authorization:`Bearer ${r}`}}),E=await M.json();M.ok?y(E.result||E):s(E.error||E.message||"Failed to load scan details")}catch(M){s(M.message||"Failed to load scan details")}finally{T(!1)}}}}function $h(r,s,u,c){const[p,f]=P.useState(!1),[g,y]=P.useState(null),[x,T]=P.useState([]);return{scanning:p,scanResult:g,scanResults:x,runScan:async()=>{if(!r){c("Please enter your API token");return}if(!s||s.length===0){c("Please discover MCP servers first");return}if(u.size===0){c("Please select at least one server to scan");return}f(!0),c(null),y(null),T([]);const w=s.filter(b=>u.has(b.name));try{const b=await fetch("/api/smartscan/scans/batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiToken:r,servers:w})}),_=await b.json();if(!b.ok){const M=L=>Array.isArray(L)?`Validation failed: ${L.map(F=>typeof F=="string"?F:F.field&&F.message?`${F.field}: ${F.message}`:JSON.stringify(F)).join("; ")}`:null,E=b.status===400&&_.details?M(_.details)||_.error||_.message||`API error: ${b.status}`:_.error||_.message||`API error: ${b.status}`;c(E);return}if(_.results&&Array.isArray(_.results)){T(_.results);const M=_.results.find(E=>E.success);M&&y(M.data)}}catch(b){c(b.message||"Failed to run scan")}finally{f(!1)}}}}function Nh(){const[r,s]=P.useState(null);P.useEffect(()=>{u();const c=setInterval(u,2e3);return()=>clearInterval(c)},[]);const u=async()=>{try{const c=await fetch("/api/composite/status");if(!c.ok)throw new Error("Server not available");const p=await c.json();s(p)}catch{s({running:!1})}};return{serverStatus:r}}function Dh(){const[r,s]=P.useState(""),u=P.useRef(null);P.useEffect(()=>(c(),()=>{u.current&&clearTimeout(u.current)}),[]);const c=async()=>{try{const f=await fetch("/api/smartscan/token");if(f.ok){const g=await f.json();g.token&&s(g.token)}}catch{console.debug("No stored token found")}};return{apiToken:r,setApiToken:s,saveToken:async f=>{try{(await fetch("/api/smartscan/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:f})})).ok||console.error("Failed to save token")}catch(g){console.error("Error saving token:",g)}},saveTokenTimeoutRef:u}}function Oh(){const[r,s]=P.useState(null),{apiToken:u,setApiToken:c,saveToken:p,saveTokenTimeoutRef:f}=Dh(),{serverStatus:g}=Nh(),{mcpData:y,discoveredServers:x,selectedServers:T,setSelectedServers:v,loadingData:w,discoverMcpData:b,makeMcpRequest:_}=Fh(s),{scanning:M,scanResult:E,scanResults:L,runScan:F}=$h(u,x,T,s),{allScans:D,loadingScans:U,loadAllScans:W,selectedScan:$,setSelectedScan:A,loadingScanDetail:K,loadScanDetail:V}=Ih(u,s),{clearingCache:G,clearCache:Y}=Rh(x,b,s);return{apiToken:u,setApiToken:c,serverStatus:g,mcpData:y,discoveredServers:x,selectedServers:T,setSelectedServers:v,loadingData:w,scanning:M,scanResult:E,scanResults:L,error:r,saveToken:p,discoverMcpData:b,runScan:F,clearCache:Y,clearingCache:G,saveTokenTimeoutRef:f,allScans:D,loadingScans:U,loadAllScans:W,selectedScan:$,setSelectedScan:A,loadingScanDetail:K,loadScanDetail:V,makeMcpRequest:_}}function Bh(){const[r,s]=P.useState("scan"),{apiToken:u,setApiToken:c,discoveredServers:p,selectedServers:f,setSelectedServers:g,loadingData:y,scanning:x,scanResult:T,scanResults:v,error:w,saveToken:b,discoverMcpData:_,runScan:M,clearCache:E,clearingCache:L,allScans:F,loadingScans:D,loadAllScans:U,selectedScan:W,setSelectedScan:$,loadingScanDetail:A,loadScanDetail:K}=Oh();return i.jsxs("div",{"data-tab-content":!0,style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column",background:o.bgPrimary},children:[i.jsx("div",{style:{background:o.bgCard,borderBottom:`1px solid ${o.borderLight}`,padding:"16px 24px",boxShadow:`0 2px 4px ${o.shadowSm}`},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"24px",flexWrap:"wrap"},children:[i.jsx(zh,{}),i.jsx(Eh,{viewMode:r,setViewMode:s,onSwitchToScan:()=>$(null),onSwitchToList:()=>{$(null),F.length===0&&U()}}),r==="scan"&&i.jsx(Mh,{apiToken:u,setApiToken:c,saveToken:b,loadingData:y,discoverMcpData:_,discoveredServers:p,selectedServers:f,setSelectedServers:g,runScan:M,scanning:x,clearCache:E,clearingCache:L})]})}),r==="scan"?i.jsx(Lh,{discoveredServers:p,selectedServers:f,setSelectedServers:g,runScan:M,scanning:x,apiToken:u,error:w,scanResults:v,scanResult:T,selectedScan:W,loadingScanDetail:A,setSelectedScan:$,loadScanDetail:K,onViewScan:V=>{if(console.log("onViewScan - scanData:",V),V.scan_id&&u)K(V.scan_id);else if(V.data&&typeof V.data=="object"){const G=V.data;$({...G,scan_id:V.scan_id||G.id||G.scan_id})}else $(V)}}):i.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"24px",background:o.bgPrimary},children:i.jsx(Ph,{error:w,loadingScans:D,selectedScan:W,loadingScanDetail:A,allScans:F,setSelectedScan:$,loadScanDetail:K,onViewScan:V=>{console.log("onViewScan - scanData:",V);const G=V.scan_id||V.id||V.hash,ue=F.find(ve=>ve.data?.scan_id===G||ve.data?.data?.scan_id===G)?.serverName||V.serverName||"Unknown Server";if(V?.data&&typeof V.data=="object"){const ve=V.data;$({...ve,scan_id:G||ve.id||ve.scan_id||ve.hash,serverName:ue})}else V&&typeof V=="object"?$({...V,scan_id:G||V.id||V.hash,serverName:ue}):console.warn("Invalid scanData structure:",V)}})})]})}const Wh=({size:r=32,className:s="",style:u={}})=>i.jsx("img",{src:"/og-image.png",alt:"MCP Shark Logo",width:r,height:r,className:s,style:{width:`${r}px`,height:`${r}px`,objectFit:"contain",...u},"aria-label":"MCP Shark Logo"});var uc={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},vs={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},Ah=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],li={CSS:{},springs:{}};function Ft(r,s,u){return Math.min(Math.max(r,s),u)}function Ur(r,s){return r.indexOf(s)>-1}function cs(r,s){return r.apply(null,s)}var oe={arr:function(r){return Array.isArray(r)},obj:function(r){return Ur(Object.prototype.toString.call(r),"Object")},pth:function(r){return oe.obj(r)&&r.hasOwnProperty("totalLength")},svg:function(r){return r instanceof SVGElement},inp:function(r){return r instanceof HTMLInputElement},dom:function(r){return r.nodeType||oe.svg(r)},str:function(r){return typeof r=="string"},fnc:function(r){return typeof r=="function"},und:function(r){return typeof r>"u"},nil:function(r){return oe.und(r)||r===null},hex:function(r){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(r)},rgb:function(r){return/^rgb/.test(r)},hsl:function(r){return/^hsl/.test(r)},col:function(r){return oe.hex(r)||oe.rgb(r)||oe.hsl(r)},key:function(r){return!uc.hasOwnProperty(r)&&!vs.hasOwnProperty(r)&&r!=="targets"&&r!=="keyframes"}};function dc(r){var s=/\(([^)]+)\)/.exec(r);return s?s[1].split(",").map(function(u){return parseFloat(u)}):[]}function cc(r,s){var u=dc(r),c=Ft(oe.und(u[0])?1:u[0],.1,100),p=Ft(oe.und(u[1])?100:u[1],.1,100),f=Ft(oe.und(u[2])?10:u[2],.1,100),g=Ft(oe.und(u[3])?0:u[3],.1,100),y=Math.sqrt(p/c),x=f/(2*Math.sqrt(p*c)),T=x<1?y*Math.sqrt(1-x*x):0,v=1,w=x<1?(x*y+-g)/T:-g+y;function b(M){var E=s?s*M/1e3:M;return x<1?E=Math.exp(-E*x*y)*(v*Math.cos(T*E)+w*Math.sin(T*E)):E=(v+w*E)*Math.exp(-E*y),M===0||M===1?M:1-E}function _(){var M=li.springs[r];if(M)return M;for(var E=1/6,L=0,F=0;;)if(L+=E,b(L)===1){if(F++,F>=16)break}else F=0;var D=L*E*1e3;return li.springs[r]=D,D}return s?b:_}function Hh(r){return r===void 0&&(r=10),function(s){return Math.ceil(Ft(s,1e-6,1)*r)*(1/r)}}var Uh=(function(){var r=11,s=1/(r-1);function u(v,w){return 1-3*w+3*v}function c(v,w){return 3*w-6*v}function p(v){return 3*v}function f(v,w,b){return((u(w,b)*v+c(w,b))*v+p(w))*v}function g(v,w,b){return 3*u(w,b)*v*v+2*c(w,b)*v+p(w)}function y(v,w,b,_,M){var E,L,F=0;do L=w+(b-w)/2,E=f(L,_,M)-v,E>0?b=L:w=L;while(Math.abs(E)>1e-7&&++F<10);return L}function x(v,w,b,_){for(var M=0;M<4;++M){var E=g(w,b,_);if(E===0)return w;var L=f(w,b,_)-v;w-=L/E}return w}function T(v,w,b,_){if(!(0<=v&&v<=1&&0<=b&&b<=1))return;var M=new Float32Array(r);if(v!==w||b!==_)for(var E=0;E<r;++E)M[E]=f(E*s,v,b);function L(F){for(var D=0,U=1,W=r-1;U!==W&&M[U]<=F;++U)D+=s;--U;var $=(F-M[U])/(M[U+1]-M[U]),A=D+$*s,K=g(A,v,b);return K>=.001?x(F,A,v,b):K===0?A:y(F,D,D+s,v,b)}return function(F){return v===w&&b===_||F===0||F===1?F:f(L(F),w,_)}}return T})(),pc=(function(){var r={linear:function(){return function(c){return c}}},s={Sine:function(){return function(c){return 1-Math.cos(c*Math.PI/2)}},Expo:function(){return function(c){return c?Math.pow(2,10*c-10):0}},Circ:function(){return function(c){return 1-Math.sqrt(1-c*c)}},Back:function(){return function(c){return c*c*(3*c-2)}},Bounce:function(){return function(c){for(var p,f=4;c<((p=Math.pow(2,--f))-1)/11;);return 1/Math.pow(4,3-f)-7.5625*Math.pow((p*3-2)/22-c,2)}},Elastic:function(c,p){c===void 0&&(c=1),p===void 0&&(p=.5);var f=Ft(c,1,10),g=Ft(p,.1,2);return function(y){return y===0||y===1?y:-f*Math.pow(2,10*(y-1))*Math.sin((y-1-g/(Math.PI*2)*Math.asin(1/f))*(Math.PI*2)/g)}}},u=["Quad","Cubic","Quart","Quint"];return u.forEach(function(c,p){s[c]=function(){return function(f){return Math.pow(f,p+2)}}}),Object.keys(s).forEach(function(c){var p=s[c];r["easeIn"+c]=p,r["easeOut"+c]=function(f,g){return function(y){return 1-p(f,g)(1-y)}},r["easeInOut"+c]=function(f,g){return function(y){return y<.5?p(f,g)(y*2)/2:1-p(f,g)(y*-2+2)/2}},r["easeOutIn"+c]=function(f,g){return function(y){return y<.5?(1-p(f,g)(1-y*2))/2:(p(f,g)(y*2-1)+1)/2}}}),r})();function Ss(r,s){if(oe.fnc(r))return r;var u=r.split("(")[0],c=pc[u],p=dc(r);switch(u){case"spring":return cc(r,s);case"cubicBezier":return cs(Uh,p);case"steps":return cs(Hh,p);default:return cs(c,p)}}function fc(r){try{var s=document.querySelectorAll(r);return s}catch{return}}function di(r,s){for(var u=r.length,c=arguments.length>=2?arguments[1]:void 0,p=[],f=0;f<u;f++)if(f in r){var g=r[f];s.call(c,g,f,r)&&p.push(g)}return p}function ci(r){return r.reduce(function(s,u){return s.concat(oe.arr(u)?ci(u):u)},[])}function $d(r){return oe.arr(r)?r:(oe.str(r)&&(r=fc(r)||r),r instanceof NodeList||r instanceof HTMLCollection?[].slice.call(r):[r])}function bs(r,s){return r.some(function(u){return u===s})}function ws(r){var s={};for(var u in r)s[u]=r[u];return s}function fs(r,s){var u=ws(r);for(var c in r)u[c]=s.hasOwnProperty(c)?s[c]:r[c];return u}function pi(r,s){var u=ws(r);for(var c in s)u[c]=oe.und(r[c])?s[c]:r[c];return u}function Vh(r){var s=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(r);return s?"rgba("+s[1]+",1)":r}function Qh(r){var s=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,u=r.replace(s,function(y,x,T,v){return x+x+T+T+v+v}),c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(u),p=parseInt(c[1],16),f=parseInt(c[2],16),g=parseInt(c[3],16);return"rgba("+p+","+f+","+g+",1)"}function Yh(r){var s=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(r)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(r),u=parseInt(s[1],10)/360,c=parseInt(s[2],10)/100,p=parseInt(s[3],10)/100,f=s[4]||1;function g(b,_,M){return M<0&&(M+=1),M>1&&(M-=1),M<1/6?b+(_-b)*6*M:M<1/2?_:M<2/3?b+(_-b)*(2/3-M)*6:b}var y,x,T;if(c==0)y=x=T=p;else{var v=p<.5?p*(1+c):p+c-p*c,w=2*p-v;y=g(w,v,u+1/3),x=g(w,v,u),T=g(w,v,u-1/3)}return"rgba("+y*255+","+x*255+","+T*255+","+f+")"}function Jh(r){if(oe.rgb(r))return Vh(r);if(oe.hex(r))return Qh(r);if(oe.hsl(r))return Yh(r)}function Ut(r){var s=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(r);if(s)return s[1]}function Kh(r){if(Ur(r,"translate")||r==="perspective")return"px";if(Ur(r,"rotate")||Ur(r,"skew"))return"deg"}function gs(r,s){return oe.fnc(r)?r(s.target,s.id,s.total):r}function It(r,s){return r.getAttribute(s)}function ks(r,s,u){var c=Ut(s);if(bs([u,"deg","rad","turn"],c))return s;var p=li.CSS[s+u];if(!oe.und(p))return p;var f=100,g=document.createElement(r.tagName),y=r.parentNode&&r.parentNode!==document?r.parentNode:document.body;y.appendChild(g),g.style.position="absolute",g.style.width=f+u;var x=f/g.offsetWidth;y.removeChild(g);var T=x*parseFloat(s);return li.CSS[s+u]=T,T}function gc(r,s,u){if(s in r.style){var c=s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),p=r.style[s]||getComputedStyle(r).getPropertyValue(c)||"0";return u?ks(r,p,u):p}}function js(r,s){if(oe.dom(r)&&!oe.inp(r)&&(!oe.nil(It(r,s))||oe.svg(r)&&r[s]))return"attribute";if(oe.dom(r)&&bs(Ah,s))return"transform";if(oe.dom(r)&&s!=="transform"&&gc(r,s))return"css";if(r[s]!=null)return"object"}function hc(r){if(oe.dom(r)){for(var s=r.style.transform||"",u=/(\w+)\(([^)]*)\)/g,c=new Map,p;p=u.exec(s);)c.set(p[1],p[2]);return c}}function Gh(r,s,u,c){var p=Ur(s,"scale")?1:0+Kh(s),f=hc(r).get(s)||p;return u&&(u.transforms.list.set(s,f),u.transforms.last=s),c?ks(r,f,c):f}function Cs(r,s,u,c){switch(js(r,s)){case"transform":return Gh(r,s,c,u);case"css":return gc(r,s,u);case"attribute":return It(r,s);default:return r[s]||0}}function Ts(r,s){var u=/^(\*=|\+=|-=)/.exec(r);if(!u)return r;var c=Ut(r)||0,p=parseFloat(s),f=parseFloat(r.replace(u[0],""));switch(u[0][0]){case"+":return p+f+c;case"-":return p-f+c;case"*":return p*f+c}}function xc(r,s){if(oe.col(r))return Jh(r);if(/\s/g.test(r))return r;var u=Ut(r),c=u?r.substr(0,r.length-u.length):r;return s?c+s:c}function Ps(r,s){return Math.sqrt(Math.pow(s.x-r.x,2)+Math.pow(s.y-r.y,2))}function Xh(r){return Math.PI*2*It(r,"r")}function Zh(r){return It(r,"width")*2+It(r,"height")*2}function qh(r){return Ps({x:It(r,"x1"),y:It(r,"y1")},{x:It(r,"x2"),y:It(r,"y2")})}function yc(r){for(var s=r.points,u=0,c,p=0;p<s.numberOfItems;p++){var f=s.getItem(p);p>0&&(u+=Ps(c,f)),c=f}return u}function ex(r){var s=r.points;return yc(r)+Ps(s.getItem(s.numberOfItems-1),s.getItem(0))}function mc(r){if(r.getTotalLength)return r.getTotalLength();switch(r.tagName.toLowerCase()){case"circle":return Xh(r);case"rect":return Zh(r);case"line":return qh(r);case"polyline":return yc(r);case"polygon":return ex(r)}}function tx(r){var s=mc(r);return r.setAttribute("stroke-dasharray",s),s}function nx(r){for(var s=r.parentNode;oe.svg(s)&&oe.svg(s.parentNode);)s=s.parentNode;return s}function vc(r,s){var u=s||{},c=u.el||nx(r),p=c.getBoundingClientRect(),f=It(c,"viewBox"),g=p.width,y=p.height,x=u.viewBox||(f?f.split(" "):[0,0,g,y]);return{el:c,viewBox:x,x:x[0]/1,y:x[1]/1,w:g,h:y,vW:x[2],vH:x[3]}}function rx(r,s){var u=oe.str(r)?fc(r)[0]:r,c=s||100;return function(p){return{property:p,el:u,svg:vc(u),totalLength:mc(u)*(c/100)}}}function ox(r,s,u){function c(v){v===void 0&&(v=0);var w=s+v>=1?s+v:0;return r.el.getPointAtLength(w)}var p=vc(r.el,r.svg),f=c(),g=c(-1),y=c(1),x=u?1:p.w/p.vW,T=u?1:p.h/p.vH;switch(r.property){case"x":return(f.x-p.x)*x;case"y":return(f.y-p.y)*T;case"angle":return Math.atan2(y.y-g.y,y.x-g.x)*180/Math.PI}}function Nd(r,s){var u=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,c=xc(oe.pth(r)?r.totalLength:r,s)+"";return{original:c,numbers:c.match(u)?c.match(u).map(Number):[0],strings:oe.str(r)||s?c.split(u):[]}}function _s(r){var s=r?ci(oe.arr(r)?r.map($d):$d(r)):[];return di(s,function(u,c,p){return p.indexOf(u)===c})}function Sc(r){var s=_s(r);return s.map(function(u,c){return{target:u,id:c,total:s.length,transforms:{list:hc(u)}}})}function ix(r,s){var u=ws(s);if(/^spring/.test(u.easing)&&(u.duration=cc(u.easing)),oe.arr(r)){var c=r.length,p=c===2&&!oe.obj(r[0]);p?r={value:r}:oe.fnc(s.duration)||(u.duration=s.duration/c)}var f=oe.arr(r)?r:[r];return f.map(function(g,y){var x=oe.obj(g)&&!oe.pth(g)?g:{value:g};return oe.und(x.delay)&&(x.delay=y?0:s.delay),oe.und(x.endDelay)&&(x.endDelay=y===f.length-1?s.endDelay:0),x}).map(function(g){return pi(g,u)})}function lx(r){for(var s=di(ci(r.map(function(f){return Object.keys(f)})),function(f){return oe.key(f)}).reduce(function(f,g){return f.indexOf(g)<0&&f.push(g),f},[]),u={},c=function(f){var g=s[f];u[g]=r.map(function(y){var x={};for(var T in y)oe.key(T)?T==g&&(x.value=y[T]):x[T]=y[T];return x})},p=0;p<s.length;p++)c(p);return u}function sx(r,s){var u=[],c=s.keyframes;c&&(s=pi(lx(c),s));for(var p in s)oe.key(p)&&u.push({name:p,tweens:ix(s[p],r)});return u}function ax(r,s){var u={};for(var c in r){var p=gs(r[c],s);oe.arr(p)&&(p=p.map(function(f){return gs(f,s)}),p.length===1&&(p=p[0])),u[c]=p}return u.duration=parseFloat(u.duration),u.delay=parseFloat(u.delay),u}function ux(r,s){var u;return r.tweens.map(function(c){var p=ax(c,s),f=p.value,g=oe.arr(f)?f[1]:f,y=Ut(g),x=Cs(s.target,r.name,y,s),T=u?u.to.original:x,v=oe.arr(f)?f[0]:T,w=Ut(v)||Ut(x),b=y||w;return oe.und(g)&&(g=T),p.from=Nd(v,b),p.to=Nd(Ts(g,v),b),p.start=u?u.end:0,p.end=p.start+p.delay+p.duration+p.endDelay,p.easing=Ss(p.easing,p.duration),p.isPath=oe.pth(f),p.isPathTargetInsideSVG=p.isPath&&oe.svg(s.target),p.isColor=oe.col(p.from.original),p.isColor&&(p.round=1),u=p,p})}var bc={css:function(r,s,u){return r.style[s]=u},attribute:function(r,s,u){return r.setAttribute(s,u)},object:function(r,s,u){return r[s]=u},transform:function(r,s,u,c,p){if(c.list.set(s,u),s===c.last||p){var f="";c.list.forEach(function(g,y){f+=y+"("+g+") "}),r.style.transform=f}}};function wc(r,s){var u=Sc(r);u.forEach(function(c){for(var p in s){var f=gs(s[p],c),g=c.target,y=Ut(f),x=Cs(g,p,y,c),T=y||Ut(x),v=Ts(xc(f,T),x),w=js(g,p);bc[w](g,p,v,c.transforms,!0)}})}function dx(r,s){var u=js(r.target,s.name);if(u){var c=ux(s,r),p=c[c.length-1];return{type:u,property:s.name,animatable:r,tweens:c,duration:p.end,delay:c[0].delay,endDelay:p.endDelay}}}function cx(r,s){return di(ci(r.map(function(u){return s.map(function(c){return dx(u,c)})})),function(u){return!oe.und(u)})}function kc(r,s){var u=r.length,c=function(f){return f.timelineOffset?f.timelineOffset:0},p={};return p.duration=u?Math.max.apply(Math,r.map(function(f){return c(f)+f.duration})):s.duration,p.delay=u?Math.min.apply(Math,r.map(function(f){return c(f)+f.delay})):s.delay,p.endDelay=u?p.duration-Math.max.apply(Math,r.map(function(f){return c(f)+f.duration-f.endDelay})):s.endDelay,p}var Dd=0;function px(r){var s=fs(uc,r),u=fs(vs,r),c=sx(u,r),p=Sc(r.targets),f=cx(p,c),g=kc(f,u),y=Dd;return Dd++,pi(s,{id:y,children:[],animatables:p,animations:f,duration:g.duration,delay:g.delay,endDelay:g.endDelay})}var Pt=[],jc=(function(){var r;function s(){!r&&(!Od()||!fe.suspendWhenDocumentHidden)&&Pt.length>0&&(r=requestAnimationFrame(u))}function u(p){for(var f=Pt.length,g=0;g<f;){var y=Pt[g];y.paused?(Pt.splice(g,1),f--):(y.tick(p),g++)}r=g>0?requestAnimationFrame(u):void 0}function c(){fe.suspendWhenDocumentHidden&&(Od()?r=cancelAnimationFrame(r):(Pt.forEach(function(p){return p._onDocumentVisibility()}),jc()))}return typeof document<"u"&&document.addEventListener("visibilitychange",c),s})();function Od(){return!!document&&document.hidden}function fe(r){r===void 0&&(r={});var s=0,u=0,c=0,p,f=0,g=null;function y(D){var U=window.Promise&&new Promise(function(W){return g=W});return D.finished=U,U}var x=px(r);y(x);function T(){var D=x.direction;D!=="alternate"&&(x.direction=D!=="normal"?"normal":"reverse"),x.reversed=!x.reversed,p.forEach(function(U){return U.reversed=x.reversed})}function v(D){return x.reversed?x.duration-D:D}function w(){s=0,u=v(x.currentTime)*(1/fe.speed)}function b(D,U){U&&U.seek(D-U.timelineOffset)}function _(D){if(x.reversePlayback)for(var W=f;W--;)b(D,p[W]);else for(var U=0;U<f;U++)b(D,p[U])}function M(D){for(var U=0,W=x.animations,$=W.length;U<$;){var A=W[U],K=A.animatable,V=A.tweens,G=V.length-1,Y=V[G];G&&(Y=di(V,function(xe){return D<xe.end})[0]||Y);for(var ue=Ft(D-Y.start-Y.delay,0,Y.duration)/Y.duration,ve=isNaN(ue)?1:Y.easing(ue),me=Y.to.strings,Ee=Y.round,Ne=[],Re=Y.to.numbers.length,he=void 0,J=0;J<Re;J++){var q=void 0,X=Y.to.numbers[J],j=Y.from.numbers[J]||0;Y.isPath?q=ox(Y.value,ve*X,Y.isPathTargetInsideSVG):q=j+ve*(X-j),Ee&&(Y.isColor&&J>2||(q=Math.round(q*Ee)/Ee)),Ne.push(q)}var N=me.length;if(!N)he=Ne[0];else{he=me[0];for(var ie=0;ie<N;ie++){me[ie];var de=me[ie+1],pe=Ne[ie];isNaN(pe)||(de?he+=pe+de:he+=pe+" ")}}bc[A.type](K.target,A.property,he,K.transforms),A.currentValue=he,U++}}function E(D){x[D]&&!x.passThrough&&x[D](x)}function L(){x.remaining&&x.remaining!==!0&&x.remaining--}function F(D){var U=x.duration,W=x.delay,$=U-x.endDelay,A=v(D);x.progress=Ft(A/U*100,0,100),x.reversePlayback=A<x.currentTime,p&&_(A),!x.began&&x.currentTime>0&&(x.began=!0,E("begin")),!x.loopBegan&&x.currentTime>0&&(x.loopBegan=!0,E("loopBegin")),A<=W&&x.currentTime!==0&&M(0),(A>=$&&x.currentTime!==U||!U)&&M(U),A>W&&A<$?(x.changeBegan||(x.changeBegan=!0,x.changeCompleted=!1,E("changeBegin")),E("change"),M(A)):x.changeBegan&&(x.changeCompleted=!0,x.changeBegan=!1,E("changeComplete")),x.currentTime=Ft(A,0,U),x.began&&E("update"),D>=U&&(u=0,L(),x.remaining?(s=c,E("loopComplete"),x.loopBegan=!1,x.direction==="alternate"&&T()):(x.paused=!0,x.completed||(x.completed=!0,E("loopComplete"),E("complete"),!x.passThrough&&"Promise"in window&&(g(),y(x)))))}return x.reset=function(){var D=x.direction;x.passThrough=!1,x.currentTime=0,x.progress=0,x.paused=!0,x.began=!1,x.loopBegan=!1,x.changeBegan=!1,x.completed=!1,x.changeCompleted=!1,x.reversePlayback=!1,x.reversed=D==="reverse",x.remaining=x.loop,p=x.children,f=p.length;for(var U=f;U--;)x.children[U].reset();(x.reversed&&x.loop!==!0||D==="alternate"&&x.loop===1)&&x.remaining++,M(x.reversed?x.duration:0)},x._onDocumentVisibility=w,x.set=function(D,U){return wc(D,U),x},x.tick=function(D){c=D,s||(s=c),F((c+(u-s))*fe.speed)},x.seek=function(D){F(v(D))},x.pause=function(){x.paused=!0,w()},x.play=function(){x.paused&&(x.completed&&x.reset(),x.paused=!1,Pt.push(x),w(),jc())},x.reverse=function(){T(),x.completed=!x.reversed,w()},x.restart=function(){x.reset(),x.play()},x.remove=function(D){var U=_s(D);Cc(U,x)},x.reset(),x.autoplay&&x.play(),x}function Bd(r,s){for(var u=s.length;u--;)bs(r,s[u].animatable.target)&&s.splice(u,1)}function Cc(r,s){var u=s.animations,c=s.children;Bd(r,u);for(var p=c.length;p--;){var f=c[p],g=f.animations;Bd(r,g),!g.length&&!f.children.length&&c.splice(p,1)}!u.length&&!c.length&&s.pause()}function fx(r){for(var s=_s(r),u=Pt.length;u--;){var c=Pt[u];Cc(s,c)}}function gx(r,s){s===void 0&&(s={});var u=s.direction||"normal",c=s.easing?Ss(s.easing):null,p=s.grid,f=s.axis,g=s.from||0,y=g==="first",x=g==="center",T=g==="last",v=oe.arr(r),w=parseFloat(v?r[0]:r),b=v?parseFloat(r[1]):0,_=Ut(v?r[1]:r)||0,M=s.start||0+(v?w:0),E=[],L=0;return function(F,D,U){if(y&&(g=0),x&&(g=(U-1)/2),T&&(g=U-1),!E.length){for(var W=0;W<U;W++){if(!p)E.push(Math.abs(g-W));else{var $=x?(p[0]-1)/2:g%p[0],A=x?(p[1]-1)/2:Math.floor(g/p[0]),K=W%p[0],V=Math.floor(W/p[0]),G=$-K,Y=A-V,ue=Math.sqrt(G*G+Y*Y);f==="x"&&(ue=-G),f==="y"&&(ue=-Y),E.push(ue)}L=Math.max.apply(Math,E)}c&&(E=E.map(function(me){return c(me/L)*L})),u==="reverse"&&(E=E.map(function(me){return f?me<0?me*-1:-me:Math.abs(L-me)}))}var ve=v?(b-w)/L:w;return M+ve*(Math.round(E[D]*100)/100)+_}}function hx(r){r===void 0&&(r={});var s=fe(r);return s.duration=0,s.add=function(u,c){var p=Pt.indexOf(s),f=s.children;p>-1&&Pt.splice(p,1);function g(b){b.passThrough=!0}for(var y=0;y<f.length;y++)g(f[y]);var x=pi(u,fs(vs,r));x.targets=x.targets||r.targets;var T=s.duration;x.autoplay=!1,x.direction=s.direction,x.timelineOffset=oe.und(c)?T:Ts(c,T),g(s),s.seek(x.timelineOffset);var v=fe(x);g(v),f.push(v);var w=kc(f,r);return s.delay=w.delay,s.endDelay=w.endDelay,s.duration=w.duration,s.seek(0),s.reset(),s.autoplay&&s.play(),s},s}fe.version="3.2.1";fe.speed=1;fe.suspendWhenDocumentHidden=!0;fe.running=Pt;fe.remove=fx;fe.get=Cs;fe.set=wc;fe.convertPx=ks;fe.path=rx;fe.setDashoffset=tx;fe.stagger=gx;fe.timeline=hx;fe.easing=Ss;fe.penner=pc;fe.random=function(r,s){return Math.floor(Math.random()*(s-r+1))+r};function xx({tabs:r,activeTab:s,onTabChange:u,tabRefs:c,indicatorRef:p}){return P.useEffect(()=>{const f=c.current[s];if(f&&p.current){const{offsetLeft:g,offsetWidth:y}=f;fe({targets:p.current,left:g,width:y,duration:400,easing:"easeOutExpo"})}},[s,c,p]),i.jsxs("div",{style:{position:"relative",display:"flex",flex:1},children:[r.map(f=>i.jsxs("button",{type:"button",ref:g=>{g&&(c.current[f.id]=g)},"data-tour":f.id==="traffic"?"traffic-tab":f.id==="logs"?"logs-tab":f.id==="setup"?"setup-tab":f.id==="playground"?"playground-tab":"smart-scan-tab",onClick:()=>u(f.id),style:{padding:"14px 24px",background:s===f.id?o.bgSecondary:"transparent",border:"none",borderBottom:"3px solid transparent",color:s===f.id?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"13px",fontFamily:m.body,fontWeight:s===f.id?"600":"400",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",position:"relative",borderRadius:"8px 8px 0 0",zIndex:1},onMouseEnter:g=>{s!==f.id&&fe({targets:g.currentTarget,background:o.bgHover,color:o.textPrimary,duration:200,easing:"easeOutQuad"})},onMouseLeave:g=>{s!==f.id&&fe({targets:g.currentTarget,background:"transparent",color:o.textSecondary,duration:200,easing:"easeOutQuad"})},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("div",{style:{display:"flex",alignItems:"center",color:"currentColor"},children:i.jsx(f.icon,{size:16})}),i.jsx("span",{children:f.label})]}),i.jsx("div",{style:{fontSize:"11px",color:s===f.id?o.textSecondary:o.textTertiary,fontWeight:"400",fontFamily:m.body},children:f.description})]},f.id)),i.jsx("div",{ref:p,style:{position:"absolute",bottom:0,height:"3px",background:o.accentBlue,borderRadius:"3px 3px 0 0",zIndex:2,pointerEvents:"none"}})]})}const yx=({size:r=16,color:s="currentColor"})=>i.jsx(nc,{size:r,stroke:1.5,color:s}),mx=({size:r=16,color:s="currentColor"})=>i.jsx(dg,{size:r,stroke:1.5,color:s}),vx=({size:r=16,color:s="currentColor"})=>i.jsx(Lg,{size:r,stroke:1.5,color:s}),Sx=({size:r=16,color:s="currentColor"})=>i.jsx(Xf,{size:r,stroke:1.5,color:s}),bx=({size:r=16,color:s="currentColor"})=>i.jsx(oc,{size:r,stroke:1.5,color:s}),wx=({size:r=16,color:s="currentColor"})=>i.jsx(tc,{size:r,stroke:1.5,color:s}),kx=({size:r=16,color:s="currentColor"})=>i.jsx(xs,{size:r,stroke:1.5,color:s});function jx({tabs:r,activeTab:s,onTabChange:u,isDropdownOpen:c,setIsDropdownOpen:p,dropdownRef:f}){return i.jsxs("div",{style:{position:"relative",flex:1,display:"flex",justifyContent:"flex-end"},ref:f,children:[i.jsxs("button",{type:"button",onClick:()=>p(!c),style:{display:"flex",alignItems:"center",gap:"8px",padding:"10px 16px",background:c?o.bgSecondary:"transparent",border:"none",borderRadius:"8px",color:o.textPrimary,cursor:"pointer",fontSize:"14px",fontFamily:m.body,fontWeight:"500"},onMouseEnter:g=>{c||(g.currentTarget.style.background=o.bgHover)},onMouseLeave:g=>{c||(g.currentTarget.style.background="transparent")},children:[i.jsx(wx,{size:18,color:o.textPrimary}),i.jsx("span",{children:r.find(g=>g.id===s)?.label||"Menu"}),i.jsx("div",{style:{transform:c?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",display:"flex",alignItems:"center"},children:i.jsx(kx,{size:14,color:o.textPrimary})})]}),c&&i.jsx("div",{style:{position:"absolute",top:"100%",right:0,marginTop:"8px",background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"8px",boxShadow:`0 4px 12px ${o.shadowSm}`,minWidth:"280px",zIndex:1e3,overflow:"hidden"},children:r.map(g=>{const y=g.icon;return i.jsxs("button",{type:"button",onClick:()=>{u(g.id),p(!1)},style:{width:"100%",padding:"14px 16px",background:s===g.id?o.bgSecondary:"transparent",border:"none",borderLeft:s===g.id?`3px solid ${o.accentBlue}`:"3px solid transparent",color:s===g.id?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"13px",fontFamily:m.body,fontWeight:s===g.id?"600":"400",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"4px",textAlign:"left",transition:"all 0.2s"},onMouseEnter:x=>{s!==g.id&&(x.currentTarget.style.background=o.bgHover,x.currentTarget.style.color=o.textPrimary)},onMouseLeave:x=>{s!==g.id&&(x.currentTarget.style.background="transparent",x.currentTarget.style.color=o.textSecondary)},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",width:"100%"},children:[i.jsx("div",{style:{display:"flex",alignItems:"center",color:"currentColor"},children:i.jsx(y,{size:16})}),i.jsx("span",{style:{flex:1},children:g.label})]}),i.jsx("div",{style:{fontSize:"11px",color:s===g.id?o.textSecondary:o.textTertiary,fontWeight:"400",fontFamily:m.body,marginLeft:"26px"},children:g.description})]},g.id)})})]})}function Cx({activeTab:r,onTabChange:s}){const u=[{id:"traffic",label:"Traffic Capture",icon:yx,description:"Wireshark-like HTTP request/response analysis for forensic investigation"},{id:"logs",label:"MCP Shark Logs",icon:mx,description:"View MCP Shark server console output and debug logs"},{id:"setup",label:"MCP Server Setup",icon:vx,description:"Configure and manage MCP Shark server"},{id:"playground",label:"MCP Playground",icon:Sx,description:"Test and interact with MCP tools, prompts, and resources"},{id:"smart-scan",label:"Smart Scan",icon:bx,description:"AI-powered security analysis for MCP servers"}],c=P.useRef({}),p=P.useRef(null),[f,g]=P.useState(!1),[y,x]=P.useState(!1),T=P.useRef(null);return P.useEffect(()=>{const v=()=>{g(window.innerWidth<1200)};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]),P.useEffect(()=>{const v=w=>{T.current&&!T.current.contains(w.target)&&x(!1)};return y&&document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[y]),i.jsx("div",{style:{borderBottom:`1px solid ${o.borderLight}`,background:o.bgCard,boxShadow:`0 1px 3px ${o.shadowSm}`},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 16px",gap:"12px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",paddingRight:"12px",borderRight:`1px solid ${o.borderLight}`},children:[i.jsx(Wh,{size:24}),i.jsx("span",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body},children:"MCP Shark"})]}),f?i.jsx(jx,{tabs:u,activeTab:r,onTabChange:s,isDropdownOpen:y,setIsDropdownOpen:x,dropdownRef:T}):i.jsx(xx,{tabs:u,activeTab:r,onTabChange:s,tabRefs:c,indicatorRef:p})]})})}function Tx({style:r,onClick:s,onMouseEnter:u,onMouseLeave:c}){const p=()=>{window.open("/api-docs","_blank"),s&&s()},f={position:"fixed",bottom:"20px",right:"80px",background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"50%",width:"48px",height:"48px",padding:0,color:o.textSecondary,cursor:"pointer",fontFamily:m.body,boxShadow:`0 4px 12px ${o.shadowMd}`,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,transition:"all 0.2s ease",...r},g=x=>{x.currentTarget.style.background=o.bgHover,x.currentTarget.style.color=o.textPrimary,x.currentTarget.style.borderColor=o.borderMedium,x.currentTarget.style.transform="scale(1.1)",x.currentTarget.style.boxShadow=`0 6px 16px ${o.shadowLg}`,u&&u(x)},y=x=>{x.currentTarget.style.background=o.bgCard,x.currentTarget.style.color=o.textSecondary,x.currentTarget.style.borderColor=o.borderLight,x.currentTarget.style.transform="scale(1)",x.currentTarget.style.boxShadow=`0 4px 12px ${o.shadowMd}`,c&&c(x)};return i.jsx("button",{type:"button",onClick:p,"data-tour":"api-docs-button",style:f,onMouseEnter:g,onMouseLeave:y,title:"View API Documentation",children:i.jsx(Yf,{size:20,stroke:1.5})})}const Px=({size:r=16,color:s="currentColor"})=>i.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"Tour icon",children:[i.jsx("title",{children:"Tour icon"}),i.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),i.jsx("path",{d:"M2 17l10 5 10-5"}),i.jsx("path",{d:"M2 12l10 5 10-5"})]});function _x({onClick:r,style:s,onMouseEnter:u,onMouseLeave:c}){const p={position:"fixed",bottom:"20px",right:"20px",background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"50%",width:"48px",height:"48px",padding:0,color:o.textSecondary,cursor:"pointer",fontFamily:m.body,boxShadow:`0 4px 12px ${o.shadowMd}`,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,transition:"all 0.2s ease",...s},f=y=>{y.currentTarget.style.background=o.bgHover,y.currentTarget.style.color=o.textPrimary,y.currentTarget.style.borderColor=o.borderMedium,y.currentTarget.style.transform="scale(1.1)",y.currentTarget.style.boxShadow=`0 6px 16px ${o.shadowLg}`,u&&u(y)},g=y=>{y.currentTarget.style.background=o.bgCard,y.currentTarget.style.color=o.textSecondary,y.currentTarget.style.borderColor=o.borderLight,y.currentTarget.style.transform="scale(1)",y.currentTarget.style.boxShadow=`0 4px 12px ${o.shadowMd}`,c&&c(y)};return i.jsx("button",{type:"button",onClick:r,"data-tour":"help-button",style:p,onMouseEnter:f,onMouseLeave:g,title:"Start tour",children:i.jsx(Px,{size:20})})}function Tc({isOpen:r,onClose:s,title:u,message:c,type:p="error"}){if(!r)return null;const f=p==="error";return i.jsx("dialog",{open:!0,"aria-modal":"true",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,border:"none",margin:0,width:"100%",height:"100%"},onClick:s,onKeyDown:g=>{(g.key==="Escape"||g.key==="Enter")&&s()},children:i.jsxs("div",{role:"document",style:{background:o.bgCard,borderRadius:"12px",padding:"24px",maxWidth:"500px",width:"90%",boxShadow:`0 4px 20px ${o.shadowLg}`,fontFamily:m.body},onClick:g=>g.stopPropagation(),onKeyDown:g=>g.stopPropagation(),children:[i.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:"18px",fontWeight:"600",color:f?o.error:o.textPrimary},children:u||(f?"Error":"Information")}),i.jsx("p",{style:{margin:"0 0 24px 0",fontSize:"14px",color:o.textSecondary,lineHeight:"1.5"},children:c}),i.jsx("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:i.jsx("button",{type:"button",onClick:s,style:{padding:"10px 20px",background:f?o.buttonDanger:o.buttonPrimary,border:"none",borderRadius:"8px",color:o.textInverse,fontSize:"14px",fontWeight:"500",fontFamily:m.body,cursor:"pointer",transition:"all 0.2s"},onMouseEnter:g=>{g.currentTarget.style.background=f?o.buttonDangerHover:o.buttonPrimaryHover},onMouseLeave:g=>{g.currentTarget.style.background=f?o.buttonDanger:o.buttonPrimary},children:"OK"})})]})})}function Lx({isOpen:r}){return r?i.jsx("dialog",{open:!0,"aria-modal":"true",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,border:"none",margin:0,width:"100%",height:"100%"},children:i.jsxs("div",{role:"document",style:{background:o.bgCard,borderRadius:"12px",padding:"32px",maxWidth:"400px",width:"90%",boxShadow:`0 4px 20px ${o.shadowLg}`,fontFamily:m.body,textAlign:"center"},children:[i.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"20px",fontWeight:"600",color:o.textPrimary},children:"Shutting Down..."}),i.jsx("p",{style:{margin:"0 0 24px 0",fontSize:"14px",color:o.textSecondary,lineHeight:"1.5"},children:"MCP Shark is shutting down. The server will stop in a moment."}),i.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",marginBottom:"16px"},children:i.jsx(xg,{size:48,stroke:2,color:o.error,style:{animation:"shutdown-spin 1s linear infinite"}})}),i.jsx("style",{children:`
|
|
28
|
+
@keyframes shutdown-spin {
|
|
29
|
+
from {
|
|
30
|
+
transform: rotate(0deg);
|
|
31
|
+
}
|
|
32
|
+
to {
|
|
33
|
+
transform: rotate(360deg);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`})]})}):null}function Mx({style:r,onClick:s,onMouseEnter:u,onMouseLeave:c}){const[p,f]=P.useState(!1),[g,y]=P.useState(!1),[x,T]=P.useState(!1),[v,w]=P.useState(""),b=async()=>{T(!0);const{success:F,message:D}=await zx();F?(console.log("Shutdown successful"),window.location.reload()):(T(!1),w(D),y(!0))},_=()=>{f(!0),s&&s()},M={position:"fixed",bottom:"20px",left:"20px",background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"50%",width:"48px",height:"48px",padding:0,color:o.textSecondary,cursor:"pointer",fontFamily:m.body,boxShadow:`0 4px 12px ${o.shadowMd}`,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,transition:"all 0.2s ease",...r},E=F=>{F.currentTarget.style.background=o.bgHover,F.currentTarget.style.color=o.error,F.currentTarget.style.borderColor=o.borderMedium,F.currentTarget.style.transform="scale(1.1)",F.currentTarget.style.boxShadow=`0 6px 16px ${o.shadowLg}`,u&&u(F)},L=F=>{F.currentTarget.style.background=o.bgCard,F.currentTarget.style.color=o.textSecondary,F.currentTarget.style.borderColor=o.borderLight,F.currentTarget.style.transform="scale(1)",F.currentTarget.style.boxShadow=`0 4px 12px ${o.shadowMd}`,c&&c(F)};return i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",onClick:_,"data-tour":"shutdown-button",style:M,onMouseEnter:E,onMouseLeave:L,title:"Shutdown MCP Shark",children:i.jsx(kg,{size:20,stroke:1.5})}),i.jsx(Vr,{isOpen:p,onClose:()=>f(!1),onConfirm:b,title:"Shutdown MCP Shark",message:"Are you sure you want to shutdown MCP Shark? This will stop the server and all services.",confirmText:"Shutdown",cancelText:"Cancel",danger:!0}),i.jsx(Tc,{isOpen:g,onClose:()=>y(!1),title:"Shutdown Failed",message:v,type:"error"}),i.jsx(Lx,{isOpen:x})]})}async function zx(){return Promise.race([Rx(),Ex(3e3)])}async function Ex(r){return new Promise(s=>setTimeout(()=>s({success:!0,message:"Shutdown timed out"}),r))}async function Rx(){try{const r=await fetch("/api/composite/shutdown",{method:"POST"});return{success:r.ok,message:r.message}}catch(r){return console.error("Shutdown error:",r),{success:!1,message:r.message||"Failed to shutdown server"}}}function Fx({onHelpClick:r}){const[s,u]=P.useState(!1),c=P.useRef(null);P.useEffect(()=>{const g=y=>{c.current&&!c.current.contains(y.target)&&u(!1)};if(s)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[s]);const p={position:"fixed",bottom:"20px",right:"20px",background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"50%",width:"48px",height:"48px",padding:0,color:o.textSecondary,cursor:"pointer",fontFamily:m.body,boxShadow:`0 4px 12px ${o.shadowMd}`,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,transition:"all 0.2s ease"},f={position:"absolute",right:"0",background:o.bgCard,border:`1px solid ${o.borderLight}`,borderRadius:"50%",width:"48px",height:"48px",padding:0,color:o.textSecondary,cursor:"pointer",fontFamily:m.body,boxShadow:`0 4px 12px ${o.shadowMd}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",opacity:s?1:0,pointerEvents:s?"auto":"none",transform:s?"scale(1) translateY(0)":"scale(0.8) translateY(10px)"};return i.jsxs("div",{ref:c,style:{position:"fixed",bottom:"20px",right:"20px",zIndex:9999},children:[i.jsx(Tx,{style:{...f,bottom:s?"180px":"0",position:"absolute",left:"auto"},onClick:()=>u(!1),onMouseEnter:g=>{s&&(g.currentTarget.style.transform="scale(1.1) translateY(0)",g.currentTarget.style.boxShadow=`0 6px 16px ${o.shadowLg}`)},onMouseLeave:g=>{s&&(g.currentTarget.style.transform="scale(1) translateY(0)",g.currentTarget.style.boxShadow=`0 4px 12px ${o.shadowMd}`)}}),i.jsx(_x,{onClick:()=>{r(),u(!1)},style:{...f,bottom:s?"120px":"0",position:"absolute",left:"auto"},onMouseEnter:g=>{s&&(g.currentTarget.style.transform="scale(1.1) translateY(0)",g.currentTarget.style.boxShadow=`0 6px 16px ${o.shadowLg}`)},onMouseLeave:g=>{s&&(g.currentTarget.style.transform="scale(1) translateY(0)",g.currentTarget.style.boxShadow=`0 4px 12px ${o.shadowMd}`)}}),i.jsx(Mx,{style:{...f,bottom:s?"60px":"0",position:"absolute",left:"auto"},onClick:()=>u(!1),onMouseEnter:g=>{s&&(g.currentTarget.style.transform="scale(1.1) translateY(0)",g.currentTarget.style.boxShadow=`0 6px 16px ${o.shadowLg}`)},onMouseLeave:g=>{s&&(g.currentTarget.style.transform="scale(1) translateY(0)",g.currentTarget.style.boxShadow=`0 4px 12px ${o.shadowMd}`)}}),i.jsx("button",{type:"button",onClick:()=>u(!s),style:{...p,background:s?o.accentBlue:o.bgCard,color:s?o.textInverse:o.textSecondary},onMouseEnter:g=>{s||(g.currentTarget.style.background=o.bgHover,g.currentTarget.style.color=o.textPrimary,g.currentTarget.style.borderColor=o.borderMedium,g.currentTarget.style.transform="scale(1.1)",g.currentTarget.style.boxShadow=`0 6px 16px ${o.shadowLg}`)},onMouseLeave:g=>{s||(g.currentTarget.style.background=o.bgCard,g.currentTarget.style.color=o.textSecondary,g.currentTarget.style.borderColor=o.borderLight,g.currentTarget.style.transform="scale(1)",g.currentTarget.style.boxShadow=`0 4px 12px ${o.shadowMd}`)},title:s?"Close menu":"Open menu",children:s?i.jsx(ms,{size:20,stroke:1.5}):i.jsx(tc,{size:20,stroke:1.5})})]})}const Ix=({size:r=12,color:s="currentColor"})=>i.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle",marginRight:"4px"},role:"img","aria-label":"Chevron icon",children:[i.jsx("title",{children:"Chevron icon"}),i.jsx("polyline",{points:"6 9 12 15 18 9"})]});function gn({title:r,children:s,titleColor:u=o.accentBlue,defaultExpanded:c=!0}){const[p,f]=P.useState(c);return i.jsxs("div",{style:{marginBottom:"16px"},children:[i.jsxs("button",{type:"button",style:{color:u,fontWeight:"600",fontFamily:m.body,fontSize:"12px",marginBottom:"8px",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",gap:"6px",padding:"4px 0",transition:"color 0.15s ease",background:"transparent",border:"none",textAlign:"left",width:"100%"},onClick:()=>f(!p),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),f(!p))},onMouseEnter:g=>{g.currentTarget.style.color=u===o.accentBlue?o.accentBlueHover:u},onMouseLeave:g=>{g.currentTarget.style.color=u},children:[i.jsx("span",{style:{transform:p?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease",display:"inline-block"},children:i.jsx(Ix,{size:12,color:u})}),r]}),p&&i.jsx("div",{style:{paddingLeft:"20px",color:o.textPrimary,fontFamily:m.body,fontSize:"12px",lineHeight:"1.6"},children:s})]})}function Pc({body:r,title:s,titleColor:u}){return r?i.jsx(gn,{title:s||"Body",titleColor:u,children:i.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:m.mono,maxHeight:"400px",border:`1px solid ${o.borderLight}`,color:o.textPrimary,lineHeight:"1.5"},children:typeof r=="object"?JSON.stringify(r,null,2):r})}):null}function _c({title:r,titleColor:s,children:u,defaultExpanded:c=!0}){const[p,f]=P.useState(c);return i.jsxs("div",{style:{background:o.bgCard,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden",marginBottom:"20px"},children:[i.jsx("button",{type:"button",onClick:()=>f(!p),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),f(!p))},"aria-label":`Toggle ${r} section`,style:{padding:"16px 20px",background:p?o.bgCard:o.bgSecondary,borderBottom:p?`1px solid ${o.borderLight}`:"none",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.15s ease",width:"100%",border:"none",textAlign:"left"},onMouseEnter:g=>{g.currentTarget.style.background=o.bgHover},onMouseLeave:g=>{g.currentTarget.style.background=p?o.bgCard:o.bgSecondary},children:i.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:s,textTransform:"uppercase",letterSpacing:"0.05em",fontFamily:m.body,display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx(xs,{size:14,stroke:1.5,style:{transform:p?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease"}}),r]})}),p&&i.jsx("div",{style:{padding:"20px"},children:u})]})}function Lc({headers:r,titleColor:s}){return!r||Object.keys(r).length===0?null:i.jsx(gn,{title:"Headers",children:Object.entries(r).map(([u,c])=>i.jsxs("div",{style:{marginBottom:"6px",fontSize:"12px",fontFamily:m.body},children:[i.jsxs("span",{style:{color:s,fontWeight:"500",fontFamily:m.mono},children:[u,":"]})," ",i.jsx("span",{style:{color:o.textPrimary},children:String(c)})]},u))})}function Wd(r,s){if(!(r.session_id===s.session_id))return!1;const c=si(r),p=si(s);return!c||!p?r.jsonrpc_id&&s.jsonrpc_id?r.jsonrpc_id===s.jsonrpc_id:!1:c===p?r.jsonrpc_id&&s.jsonrpc_id?r.jsonrpc_id===s.jsonrpc_id:!0:!1}function Mc(r){const s=[],u=new Set;return r.forEach(c=>{if(!u.has(c.frame_number))if(c.direction==="request"){const p=r.find(f=>f.direction==="response"&&!u.has(f.frame_number)&&Wd(c,f)&&f.frame_number>c.frame_number);p?(s.push({request:c,response:p,frame_number:c.frame_number}),u.add(c.frame_number),u.add(p.frame_number)):(s.push({request:c,response:null,frame_number:c.frame_number}),u.add(c.frame_number))}else c.direction==="response"&&(r.find(f=>f.direction==="request"&&!u.has(f.frame_number)&&Wd(f,c)&&f.frame_number<c.frame_number)||(s.push({request:null,response:c,frame_number:c.frame_number}),u.add(c.frame_number)))}),s.sort((c,p)=>p.frame_number-c.frame_number)}const Ad="LLM Server";function Ls(r,s){return s?((new Date(r)-new Date(s))/1e3).toFixed(6):"0.000000"}function Ms(r){if(!r)return"-";try{return new Date(r).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return r}}function zs(r){return r.direction==="request"?{source:Ad,dest:r.remote_address||"Unknown MCP Client"}:{source:r.remote_address||"Unknown MCP Server",dest:Ad}}function fi(r){if(r.direction==="request"){if(r.body_json)try{const s=typeof r.body_json=="string"?JSON.parse(r.body_json):r.body_json;if(s&&typeof s=="object"&&s.method)return s.method}catch{}if(r.body_raw)try{const s=typeof r.body_raw=="string"?JSON.parse(r.body_raw):r.body_raw;if(s&&typeof s=="object"&&s.method)return s.method}catch{}if(r.jsonrpc_method)return r.jsonrpc_method;if(r.url)try{const s=new URL(r.url);return s.pathname+(s.search||"")}catch{const u=r.url,c=u.match(/^https?:\/\/[^\/]+(\/.*)$/);return c?c[1]:u}}return"-"}function $x(r){if(r.direction==="request"){const c=fi(r),p=r.method||"",f=r.url||"";return c&&c!=="-"?p&&f?`${p} ${c}`:p?`${p} ${c}`:c:p&&f?`${p} ${f}`:p||f||"Request"}const s=r.status_code||"",u=r.jsonrpc_method||si(r);return s&&u?`${s} ${u}`:s?`Status: ${s}`:u||"Response"}function si(r){if(r.jsonrpc_method)return r.jsonrpc_method;if(r.direction==="request"){if(r.body_json)try{const s=typeof r.body_json=="string"?JSON.parse(r.body_json):r.body_json;if(s&&typeof s=="object"&&s.method)return s.method}catch{}if(r.body_raw)try{const s=typeof r.body_raw=="string"?JSON.parse(r.body_raw):r.body_raw;if(s&&typeof s=="object"&&s.method)return s.method}catch{}}if(r.direction==="response"&&r.body_json)try{const s=typeof r.body_json=="string"?JSON.parse(r.body_json):r.body_json}catch{}return null}function zc({data:r,titleColor:s}){if(!r)return null;const u=$x(r);return i.jsx(gn,{title:"Info",titleColor:s,defaultExpanded:!1,children:i.jsx("div",{style:{background:o.bgSecondary,padding:"12px 16px",borderRadius:"6px",border:`1px solid ${o.borderLight}`,fontFamily:m.mono,fontSize:"12px",color:s,wordBreak:"break-word"},children:u})})}function Ec({data:r,showUserAgent:s=!1}){return i.jsxs(gn,{title:"Network Information",children:[i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:m.body,marginBottom:"4px"},children:["Remote Address:"," ",i.jsx("span",{style:{color:o.textSecondary,fontFamily:m.mono},children:r.remote_address||"N/A"})]}),i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:m.body,marginBottom:"4px"},children:["Host:"," ",i.jsx("span",{style:{color:o.textSecondary,fontFamily:m.mono},children:r.host||"N/A"})]}),s&&r.user_agent&&i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:m.body,marginBottom:"4px"},children:["User Agent:"," ",i.jsx("span",{style:{color:o.textSecondary,fontSize:"11px"},children:r.user_agent})]}),r.session_id&&i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:m.body,marginBottom:"4px"},children:["Session ID:"," ",i.jsx("span",{style:{color:o.textSecondary,fontFamily:m.mono},children:r.session_id})]})]})}function Rc({data:r,titleColor:s}){return i.jsxs(gn,{title:`${r.protocol||"HTTP"} Protocol`,children:[i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:m.body,marginBottom:"4px"},children:["Direction: ",i.jsx("span",{style:{color:s,fontWeight:"500"},children:r.direction})]}),r.status_code&&i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:m.body,marginBottom:"4px"},children:["Status Code:"," ",i.jsx("span",{style:{color:r.status_code>=400?o.error:r.status_code>=300?o.warning:o.success,fontFamily:m.mono,fontWeight:"600"},children:r.status_code})]}),r.jsonrpc_method&&i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:m.body,marginBottom:"4px"},children:["JSON-RPC Method:"," ",i.jsx("span",{style:{color:o.textSecondary,fontFamily:m.mono},children:r.jsonrpc_method})]}),r.jsonrpc_id&&i.jsxs("div",{style:{fontSize:"12px",color:o.textPrimary,fontFamily:m.body,marginBottom:"4px"},children:["JSON-RPC ID:"," ",i.jsx("span",{style:{color:o.textSecondary,fontFamily:m.mono},children:r.jsonrpc_id})]})]})}function Nx({request:r,requestHeaders:s,requestBody:u}){return r?i.jsxs(_c,{title:"Request",titleColor:o.accentBlue,defaultExpanded:!0,children:[i.jsx(zc,{data:r,titleColor:o.accentBlue}),i.jsx(Ec,{data:r,showUserAgent:!0}),i.jsx(Rc,{data:r,titleColor:o.accentBlue}),i.jsx(Lc,{headers:s,titleColor:o.accentBlue}),i.jsx(Pc,{body:u,titleColor:o.accentBlue}),r.jsonrpc_params&&i.jsx(gn,{title:"JSON-RPC Params",titleColor:o.accentBlue,children:i.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:"monospace",maxHeight:"400px",border:`1px solid ${o.borderLight}`,color:o.textPrimary,lineHeight:"1.5"},children:JSON.stringify(JSON.parse(r.jsonrpc_params),null,2)})})]}):null}function Dx({response:r,responseHeaders:s,responseBody:u}){return r?i.jsxs(_c,{title:"Response",titleColor:o.accentGreen,defaultExpanded:!0,children:[i.jsx(zc,{data:r,titleColor:o.accentGreen}),i.jsx(Ec,{data:r}),i.jsx(Rc,{data:r,titleColor:o.accentGreen}),i.jsx(Lc,{headers:s,titleColor:o.accentGreen}),i.jsx(Pc,{body:u,titleColor:o.accentGreen}),r.jsonrpc_result&&i.jsx(gn,{title:"JSON-RPC Result",titleColor:o.accentGreen,children:i.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:m.mono,maxHeight:"400px",border:`1px solid ${o.borderLight}`,color:o.textPrimary,lineHeight:"1.5"},children:JSON.stringify(JSON.parse(r.jsonrpc_result),null,2)})}),r.jsonrpc_error&&i.jsx(gn,{title:"JSON-RPC Error",titleColor:o.error,children:i.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:m.mono,maxHeight:"400px",border:`1px solid ${o.borderLight}`,color:o.error,lineHeight:"1.5"},children:JSON.stringify(JSON.parse(r.jsonrpc_error),null,2)})})]}):null}function Ox({request:r,response:s,requestHeaders:u,requestBody:c,responseHeaders:p,responseBody:f}){return i.jsx("div",{style:{padding:"20px",overflow:"auto",flex:1,background:o.bgPrimary},children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[i.jsx(Nx,{request:r,requestHeaders:u,requestBody:c}),i.jsx(Dx,{response:s,responseHeaders:p,responseBody:f})]})})}const Bx=({size:r=14,color:s="currentColor",rotated:u=!1})=>i.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle",transform:u?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s ease"},role:"img","aria-label":"Chevron down icon",children:[i.jsx("title",{children:"Chevron down icon"}),i.jsx("polyline",{points:"6 9 12 15 18 9"})]});function Hd({title:r,titleColor:s,children:u,defaultExpanded:c=!0}){const[p,f]=P.useState(c);return i.jsxs("div",{style:{background:o.bgCard,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden",marginBottom:"20px"},children:[i.jsx("button",{type:"button",onClick:()=>f(!p),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),f(!p))},style:{padding:"16px 20px",background:p?o.bgCard:o.bgSecondary,borderBottom:p?`1px solid ${o.borderLight}`:"none",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.15s ease",width:"100%",border:"none",textAlign:"left"},onMouseEnter:g=>{g.currentTarget.style.background=o.bgHover},onMouseLeave:g=>{g.currentTarget.style.background=p?o.bgCard:o.bgSecondary},children:i.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:s,textTransform:"uppercase",letterSpacing:"0.05em",fontFamily:m.body,display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx(Bx,{size:14,color:s,rotated:!p}),r]})}),p&&i.jsx("div",{style:{padding:"20px"},children:u})]})}function Wx({requestHexLines:r,responseHexLines:s,hasRequest:u,hasResponse:c}){return i.jsx("div",{style:{padding:"20px",overflow:"auto",flex:1,background:o.bgPrimary},children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[u&&i.jsx(Hd,{title:"Request Hex Dump",titleColor:o.accentBlue,defaultExpanded:!0,children:i.jsx("div",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",border:`1px solid ${o.borderLight}`,maxHeight:"calc(100vh - 300px)",overflow:"auto"},children:r.length>0?r.map((p,f)=>i.jsxs("div",{style:{display:"flex",gap:"16px",padding:"4px 0",color:o.textPrimary,fontFamily:m.mono,fontSize:"12px",lineHeight:"1.5"},children:[i.jsx("span",{style:{color:o.textTertiary,minWidth:"80px"},children:p.offset}),i.jsx("span",{style:{minWidth:"400px",color:o.textPrimary},children:p.hex.padEnd(48)}),i.jsx("span",{style:{color:o.textSecondary},children:p.ascii})]},`request-${p.offset}-${f}`)):i.jsx("div",{style:{color:o.textTertiary,fontFamily:m.body,fontSize:"12px"},children:"(empty)"})})}),c&&i.jsx(Hd,{title:"Response Hex Dump",titleColor:o.accentGreen,defaultExpanded:!0,children:i.jsx("div",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",border:`1px solid ${o.borderLight}`,maxHeight:"calc(100vh - 300px)",overflow:"auto"},children:s.length>0?s.map((p,f)=>i.jsxs("div",{style:{display:"flex",gap:"16px",padding:"4px 0",color:o.textPrimary,fontFamily:m.mono,fontSize:"12px",lineHeight:"1.5"},children:[i.jsx("span",{style:{color:o.textTertiary,minWidth:"80px"},children:p.offset}),i.jsx("span",{style:{minWidth:"400px",color:o.textPrimary},children:p.hex.padEnd(48)}),i.jsx("span",{style:{color:o.textSecondary},children:p.ascii})]},`response-${p.offset}-${f}`)):i.jsx("div",{style:{color:o.textTertiary,fontFamily:m.body,fontSize:"12px"},children:"(empty)"})})})]})})}function Ax({request:r,onClose:s,matchingPair:u}){const c=p=>p<1024?`${p} B`:p<1048576?`${(p/1024).toFixed(2)} KB`:`${(p/1048576).toFixed(2)} MB`;return i.jsxs("div",{style:{padding:"12px 16px",borderBottom:`1px solid ${o.borderLight}`,display:"flex",justifyContent:"space-between",alignItems:"center",background:o.bgCard,boxShadow:`0 1px 3px ${o.shadowSm}`},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[i.jsxs("h3",{style:{fontSize:"14px",fontWeight:"600",color:o.textPrimary,margin:0,fontFamily:m.body},children:["#",r.frame_number,":"," ",r.direction==="request"?"HTTP Request":"HTTP Response",u&&i.jsxs("span",{style:{fontSize:"11px",color:o.textTertiary,fontWeight:"400",marginLeft:"8px"},children:["(with #",u.frame_number,")"]})]}),i.jsxs("span",{style:{fontSize:"11px",color:o.textSecondary,padding:"4px 8px",background:o.bgSecondary,borderRadius:"8px",fontFamily:m.mono},children:[c(r.length)," bytes"]})]}),i.jsx("button",{type:"button",onClick:s,style:{background:"none",border:"none",color:o.textSecondary,cursor:"pointer",fontSize:"20px",padding:"4px 8px",borderRadius:"8px",transition:"all 0.2s"},onMouseEnter:p=>{p.currentTarget.style.background=o.bgHover,p.currentTarget.style.color=o.textPrimary},onMouseLeave:p=>{p.currentTarget.style.background="none",p.currentTarget.style.color=o.textSecondary},children:i.jsx(ms,{size:20,stroke:1.5})})]})}const Hx=({size:r=14,color:s="currentColor",rotated:u=!1})=>i.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle",transform:u?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s ease"},role:"img","aria-label":"Chevron down icon",children:[i.jsx("title",{children:"Chevron down icon"}),i.jsx("polyline",{points:"6 9 12 15 18 9"})]});function Ud({title:r,titleColor:s,children:u,defaultExpanded:c=!0}){const[p,f]=P.useState(c);return i.jsxs("div",{style:{background:o.bgCard,borderRadius:"8px",border:`1px solid ${o.borderLight}`,overflow:"hidden",marginBottom:"20px"},children:[i.jsx("button",{type:"button",onClick:()=>f(!p),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),f(!p))},style:{padding:"16px 20px",background:p?o.bgCard:o.bgSecondary,borderBottom:p?`1px solid ${o.borderLight}`:"none",cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.15s ease",width:"100%",border:"none",textAlign:"left"},onMouseEnter:g=>{g.currentTarget.style.background=o.bgHover},onMouseLeave:g=>{g.currentTarget.style.background=p?o.bgCard:o.bgSecondary},children:i.jsxs("div",{style:{fontSize:"13px",fontWeight:"600",color:s,textTransform:"uppercase",letterSpacing:"0.05em",fontFamily:m.body,display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx(Hx,{size:14,color:s,rotated:!p}),r]})}),p&&i.jsx("div",{style:{padding:"20px"},children:u})]})}function Ux({requestFullText:r,responseFullText:s,hasRequest:u,hasResponse:c}){return i.jsx("div",{style:{padding:"20px",overflow:"auto",flex:1,background:o.bgPrimary},children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[u&&i.jsx(Ud,{title:"Raw Request Data",titleColor:o.accentBlue,defaultExpanded:!0,children:i.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:m.mono,color:o.textPrimary,border:`1px solid ${o.borderLight}`,whiteSpace:"pre-wrap",wordBreak:"break-all",lineHeight:"1.5",maxHeight:"calc(100vh - 300px)"},children:r||"(empty)"})}),c&&i.jsx(Ud,{title:"Raw Response Data",titleColor:o.accentGreen,defaultExpanded:!0,children:i.jsx("pre",{style:{background:o.bgSecondary,padding:"16px",borderRadius:"8px",overflow:"auto",fontSize:"12px",fontFamily:m.mono,color:o.textPrimary,border:`1px solid ${o.borderLight}`,whiteSpace:"pre-wrap",wordBreak:"break-all",lineHeight:"1.5",maxHeight:"calc(100vh - 300px)"},children:s||"(empty)"})})]})})}function Vx({tabs:r,activeTab:s,onTabChange:u}){const c=P.useRef({}),p=P.useRef(null);return P.useEffect(()=>{const f=c.current[s];if(f&&p.current){const{offsetLeft:g,offsetWidth:y}=f;fe({targets:p.current,left:g,width:y,duration:300,easing:"easeOutExpo"})}},[s]),i.jsxs("div",{style:{display:"flex",borderBottom:`1px solid ${o.borderLight}`,background:`${o.bgCard}CC`,backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",position:"relative",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[r.map(f=>i.jsx("button",{type:"button",ref:g=>{g&&(c.current[f]=g)},onClick:()=>u(f),style:{padding:"10px 18px",background:s===f?o.bgSecondary:"transparent",border:"none",borderBottom:"2px solid transparent",color:s===f?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"13px",fontFamily:m.body,fontWeight:s===f?"500":"400",textTransform:"capitalize",borderRadius:"8px 8px 0 0",transition:"all 0.2s",position:"relative",zIndex:1},onMouseEnter:g=>{s!==f&&fe({targets:g.currentTarget,background:o.bgHover,color:o.textPrimary,duration:200,easing:"easeOutQuad"})},onMouseLeave:g=>{s!==f&&fe({targets:g.currentTarget,background:"transparent",color:o.textSecondary,duration:200,easing:"easeOutQuad"})},children:f},f)),i.jsx("div",{ref:p,style:{position:"absolute",bottom:0,height:"2px",background:o.accentBlue,borderRadius:"2px 2px 0 0",zIndex:2}})]})}const Vd=(r,s={})=>fe({targets:r,opacity:[0,1],translateY:[20,0],duration:s.duration||400,delay:fe.stagger(s.delay||50),easing:s.easing||"easeOutExpo",...s}),Es=(r,s={})=>fe({targets:r,opacity:[0,1],duration:s.duration||300,easing:s.easing||"easeOutQuad",...s}),Qx=(r,s={})=>fe({targets:r,translateX:[s.width||600,0],opacity:[0,1],duration:s.duration||400,easing:s.easing||"easeOutExpo",...s});function Qd(r){if(!r)return[];const s=new TextEncoder().encode(r),u=[],c=16,p=Math.ceil(s.length/c);for(const f of Array.from({length:p},(g,y)=>y)){const g=f*c,y=s.slice(g,g+c),x=Array.from(y).map(w=>w.toString(16).padStart(2,"0")).join(" "),T=Array.from(y).map(w=>w>=32&&w<127?String.fromCharCode(w):".").join(""),v=g.toString(16).padStart(8,"0");u.push({offset:v,hex:x,ascii:T})}return u}function Yd(r,s){return Object.entries(r).map(([c,p])=>`${c}: ${p}`).join(`\r
|
|
37
|
+
`)+(s?`\r
|
|
38
|
+
\r
|
|
39
|
+
${s}`:"")}function Yx({request:r,onClose:s,requests:u=[]}){const[c,p]=P.useState("details"),f=P.useRef(null),g=P.useRef(c);if(P.useEffect(()=>{g.current!==c&&f.current&&(Es(f.current,{duration:300}),g.current=c)},[c]),!r)return null;const y=W=>{if(W.jsonrpc_method)return W.jsonrpc_method;if(W.direction==="request"){if(W.body_json)try{const $=typeof W.body_json=="string"?JSON.parse(W.body_json):W.body_json;if($&&typeof $=="object"&&$.method)return $.method}catch{}if(W.body_raw)try{const $=typeof W.body_raw=="string"?JSON.parse(W.body_raw):W.body_raw;if($&&typeof $=="object"&&$.method)return $.method}catch{}}return null},T=(()=>{const W=($,A)=>{if($.session_id!==A.session_id)return!1;const K=y($),V=y(A);return!K||!V?$.jsonrpc_id&&A.jsonrpc_id?$.jsonrpc_id===A.jsonrpc_id:!1:K!==V?!1:$.jsonrpc_id&&A.jsonrpc_id?$.jsonrpc_id===A.jsonrpc_id:!0};return r.direction==="request"?u.find($=>$.direction==="response"&&W(r,$)&&$.frame_number>r.frame_number):u.find($=>$.direction==="request"&&W($,r)&&$.frame_number<r.frame_number)})(),v=r.direction==="request"?r:T||r,w=r.direction==="response"?r:T,b=v?.headers_json?JSON.parse(v.headers_json):{},_=v?.body_json?JSON.parse(v.body_json):v?.body_raw,M=v?Yd(b,v.body_raw):"",E=v?Qd(M):[],L=w?.headers_json?JSON.parse(w.headers_json):{},F=w?.body_json?JSON.parse(w.body_json):w?.body_raw,D=w?Yd(L,w.body_raw):"",U=w?Qd(D):[];return i.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",background:o.bgPrimary},children:[i.jsx(Ax,{request:r,onClose:s,matchingPair:T}),i.jsx(Vx,{tabs:["details","hex","raw"],activeTab:c,onTabChange:p}),i.jsxs("div",{ref:f,style:{flex:1,overflow:"auto",background:o.bgPrimary},children:[c==="details"&&i.jsx(Ox,{request:v,response:w,requestHeaders:b,requestBody:_,responseHeaders:L,responseBody:F}),c==="hex"&&i.jsx(Wx,{requestHexLines:E,responseHexLines:U,hasRequest:!!v,hasResponse:!!w}),c==="raw"&&i.jsx(Ux,{requestFullText:M,responseFullText:D,hasRequest:!!v,hasResponse:!!w})]})]})}function Jx({stats:r,onExport:s}){return i.jsxs("div",{style:{display:"flex",gap:"16px",alignItems:"center",marginLeft:"auto"},children:[r&&i.jsxs(i.Fragment,{children:[i.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:m.body},children:["Total:"," ",i.jsx("span",{style:{color:o.textPrimary,fontWeight:"500"},children:r.total_packets||0})]}),i.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:m.body},children:["Requests:"," ",i.jsx("span",{style:{color:o.accentBlue,fontWeight:"500"},children:r.total_requests||0})]}),i.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:m.body},children:["Responses:"," ",i.jsx("span",{style:{color:o.accentGreen,fontWeight:"500"},children:r.total_responses||0})]}),i.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:m.body},children:["Errors:"," ",i.jsx("span",{style:{color:o.error,fontWeight:"500"},children:r.total_errors||0})]}),i.jsxs("span",{style:{color:o.textSecondary,fontSize:"12px",fontFamily:m.body},children:["Sessions:"," ",i.jsx("span",{style:{color:o.textPrimary,fontWeight:"500"},children:r.unique_sessions||0})]})]}),i.jsxs("div",{style:{display:"flex",gap:"6px",alignItems:"center",marginLeft:"12px",paddingLeft:"12px",borderLeft:`1px solid ${o.borderLight}`},children:[i.jsxs("button",{type:"button",onClick:()=>s("json"),style:{padding:"8px 14px",background:o.buttonPrimary,border:"none",color:o.textInverse,fontSize:"12px",fontFamily:m.body,fontWeight:"500",borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`},onMouseEnter:u=>{fe({targets:u.currentTarget,background:o.buttonPrimaryHover,translateY:-1,boxShadow:[`0 2px 4px ${o.shadowSm}`,`0 4px 8px ${o.shadowMd}`],duration:200,easing:"easeOutQuad"})},onMouseLeave:u=>{fe({targets:u.currentTarget,background:o.buttonPrimary,translateY:0,boxShadow:[`0 4px 8px ${o.shadowMd}`,`0 2px 4px ${o.shadowSm}`],duration:200,easing:"easeOutQuad"})},title:"Export as JSON",children:[i.jsx(qd,{size:14,stroke:1.5}),"Export"]}),i.jsxs("select",{onChange:u=>s(u.target.value),value:"",style:{padding:"8px 10px",background:o.bgCard,border:`1px solid ${o.borderLight}`,color:o.textPrimary,fontSize:"11px",fontFamily:m.body,borderRadius:"8px",cursor:"pointer",transition:"all 0.2s"},onFocus:u=>{u.currentTarget.style.borderColor=o.accentBlue},onBlur:u=>{u.currentTarget.style.borderColor=o.borderLight},children:[i.jsx("option",{value:"",disabled:!0,children:"Format"}),i.jsx("option",{value:"json",children:"JSON"}),i.jsx("option",{value:"csv",children:"CSV"}),i.jsx("option",{value:"txt",children:"TXT"})]})]})]})}function _n({type:r="text",placeholder:s,value:u,onChange:c,style:p={},...f}){const g={padding:"8px 12px",background:o.bgCard,border:`1px solid ${o.borderLight}`,color:o.textPrimary,fontSize:"13px",fontFamily:r==="number"||s?.includes("JSON-RPC")||s?.includes("HTTP")?m.mono:m.body,borderRadius:"8px",transition:"all 0.2s",...p},y=T=>{fe({targets:T.currentTarget,borderColor:o.accentBlue,boxShadow:[`0 0 0 0px ${o.accentBlue}20`,`0 0 0 3px ${o.accentBlue}20`],duration:200,easing:"easeOutQuad"})},x=T=>{fe({targets:T.currentTarget,borderColor:o.borderLight,boxShadow:"none",duration:200,easing:"easeOutQuad"})};return i.jsx("input",{type:r,placeholder:s,value:u||"",onChange:c,style:g,onFocus:y,onBlur:x,...f})}function Kx({filters:r,onFilterChange:s,stats:u,onClear:c}){const p=P.useRef(null),[f,g]=P.useState(!1),[y,x]=P.useState(!1),[T,v]=P.useState("");P.useEffect(()=>{p.current&&Es(p.current,{duration:400})},[]);const w=async(b="json")=>{try{const _=new URLSearchParams;r.search&&_.append("search",r.search),r.serverName&&_.append("serverName",r.serverName),r.sessionId&&_.append("sessionId",r.sessionId),r.method&&_.append("method",r.method),r.jsonrpcMethod&&_.append("jsonrpcMethod",r.jsonrpcMethod),r.statusCode&&_.append("statusCode",r.statusCode),r.jsonrpcId&&_.append("jsonrpcId",r.jsonrpcId),_.append("format",b);const E=await(await fetch(`/api/requests/export?${_}`)).blob(),L=window.URL.createObjectURL(E),F=document.createElement("a");F.href=L;const D=b==="csv"?"csv":b==="txt"?"txt":"json";F.download=`mcp-shark-traffic-${new Date().toISOString().replace(/[:.]/g,"-")}.${D}`,document.body.appendChild(F),F.click(),window.URL.revokeObjectURL(L),document.body.removeChild(F)}catch(_){console.error("Failed to export traffic:",_),v("Failed to export traffic. Please try again."),x(!0)}};return i.jsxs("div",{ref:p,"data-tour":"filters",style:{padding:"12px 16px",borderBottom:`1px solid ${o.borderLight}`,background:o.bgSecondary,display:"flex",gap:"10px",alignItems:"center",flexWrap:"wrap",boxShadow:`0 1px 3px ${o.shadowSm}`},children:[i.jsxs("div",{style:{position:"relative",width:"300px"},children:[i.jsx(rc,{size:16,stroke:1.5,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:o.textTertiary,pointerEvents:"none",zIndex:1}}),i.jsx(_n,{type:"text",placeholder:"Search everything (partial match)...",value:r.search||"",onChange:b=>s({...r,search:b.target.value||null}),style:{width:"100%",fontWeight:r.search?"500":"400",paddingLeft:"36px"}})]}),i.jsx(_n,{type:"text",placeholder:"MCP Server Name...",value:r.serverName||"",onChange:b=>s({...r,serverName:b.target.value||null}),style:{width:"200px"}}),i.jsx(_n,{type:"text",placeholder:"Session ID...",value:r.sessionId||"",onChange:b=>s({...r,sessionId:b.target.value||null}),style:{width:"200px"}}),i.jsx(_n,{type:"text",placeholder:"HTTP Method...",value:r.method||"",onChange:b=>s({...r,method:b.target.value||null}),style:{width:"150px"}}),i.jsx(_n,{type:"text",placeholder:"JSON-RPC Method...",value:r.jsonrpcMethod||"",onChange:b=>s({...r,jsonrpcMethod:b.target.value||null}),style:{width:"200px"}}),i.jsx(_n,{type:"number",placeholder:"Status Code...",value:r.statusCode||"",onChange:b=>s({...r,statusCode:b.target.value?Number.parseInt(b.target.value):null}),style:{width:"120px"}}),i.jsx(_n,{type:"text",placeholder:"JSON-RPC ID...",value:r.jsonrpcId||"",onChange:b=>s({...r,jsonrpcId:b.target.value||null}),style:{width:"150px"}}),i.jsx(Jx,{stats:u,onExport:w}),i.jsxs("button",{type:"button",onClick:()=>g(!0),style:{padding:"8px 14px",background:o.buttonDanger,border:"none",color:o.textInverse,fontSize:"12px",fontFamily:m.body,fontWeight:"500",borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",transition:"all 0.2s",boxShadow:`0 2px 4px ${o.shadowSm}`,marginLeft:"12px"},onMouseEnter:b=>{fe({targets:b.currentTarget,background:o.buttonDangerHover,translateY:-1,boxShadow:[`0 2px 4px ${o.shadowSm}`,`0 4px 8px ${o.shadowMd}`],duration:200,easing:"easeOutQuad"})},onMouseLeave:b=>{fe({targets:b.currentTarget,background:o.buttonDanger,translateY:0,boxShadow:[`0 4px 8px ${o.shadowMd}`,`0 2px 4px ${o.shadowSm}`],duration:200,easing:"easeOutQuad"})},title:"Clear all captured traffic",children:[i.jsx(ai,{size:14,stroke:1.5}),"Clear"]}),i.jsx(Vr,{isOpen:f,onClose:()=>g(!1),onConfirm:async()=>{try{const b=await fetch("/api/requests/clear",{method:"POST"});if(b.ok)c&&c();else{const _=await b.json();v(`Failed to clear traffic: ${_.error||"Unknown error"}`),x(!0)}}catch(b){console.error("Failed to clear traffic:",b),v("Failed to clear traffic. Please try again."),x(!0)}},title:"Clear All Captured Traffic",message:"Are you sure you want to delete all captured traffic? This action cannot be undone and will permanently remove all requests and responses from the database.",confirmText:"Clear All",cancelText:"Cancel",danger:!0}),i.jsx(Tc,{isOpen:y,onClose:()=>x(!1),title:"Error",message:T,type:"error"})]})}const Pe={LIFECYCLE:"lifecycle",TOOLS:"tools",RESOURCES:"resources",PROMPTS:"prompts",NOTIFICATIONS:"notifications",CLIENT_FEATURES:"client-features",OTHER:"other"};function Gx(r){return r?r==="initialize"||r==="notifications/initialized"?Pe.LIFECYCLE:r.startsWith("tools/")?Pe.TOOLS:r.startsWith("resources/")?Pe.RESOURCES:r.startsWith("prompts/")?Pe.PROMPTS:r.startsWith("notifications/")?Pe.NOTIFICATIONS:r.startsWith("elicitation/")||r.startsWith("sampling/")||r.startsWith("logging/")?Pe.CLIENT_FEATURES:Pe.OTHER:Pe.OTHER}function Xx(r){return{[Pe.LIFECYCLE]:"Lifecycle",[Pe.TOOLS]:"Tools",[Pe.RESOURCES]:"Resources",[Pe.PROMPTS]:"Prompts",[Pe.NOTIFICATIONS]:"Notifications",[Pe.CLIENT_FEATURES]:"Client Features",[Pe.OTHER]:"Other"}[r]||"Unknown"}function Zx(r){return{[Pe.LIFECYCLE]:oi,[Pe.TOOLS]:Eg,[Pe.RESOURCES]:ig,[Pe.PROMPTS]:vg,[Pe.NOTIFICATIONS]:Kf,[Pe.CLIENT_FEATURES]:Ig,[Pe.OTHER]:Id}[r]||Id}function qx(r){const s=Mc(r),u=new Map;return s.forEach(c=>{const p=c.request||c.response;if(!p)return;const f=p.session_id||"__NO_SESSION__",g=si(p),y=Gx(g||"");u.has(f)||u.set(f,{sessionId:f==="__NO_SESSION__"?null:f,categories:new Map,firstTimestamp:p.timestamp_iso});const x=u.get(f);x.categories.has(y)||x.categories.set(y,[]),x.categories.get(y).push(c),new Date(p.timestamp_iso)<new Date(x.firstTimestamp)&&(x.firstTimestamp=p.timestamp_iso)}),Array.from(u.entries()).map(([c,p])=>({sessionId:p.sessionId,firstTimestamp:p.firstTimestamp,categories:Array.from(p.categories.entries()).map(([f,g])=>({category:f,label:Xx(f),pairs:g.sort((y,x)=>{const T=(y.request||y.response)?.timestamp_iso||"",v=(x.request||x.response)?.timestamp_iso||"";return new Date(T)-new Date(v)})})).sort((f,g)=>{const y=[Pe.LIFECYCLE,Pe.TOOLS,Pe.RESOURCES,Pe.PROMPTS,Pe.NOTIFICATIONS,Pe.CLIENT_FEATURES,Pe.OTHER],x=y.indexOf(f.category),T=y.indexOf(g.category);return x-T})})).sort((c,p)=>new Date(p.firstTimestamp)-new Date(c.firstTimestamp))}const ey=({size:r=12,color:s="currentColor"})=>i.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle"},role:"img","aria-label":"Chevron down icon",children:[i.jsx("title",{children:"Chevron down icon"}),i.jsx("polyline",{points:"6 9 12 15 18 9"})]}),ty=({size:r=12,color:s="currentColor"})=>i.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"inline-block",verticalAlign:"middle"},role:"img","aria-label":"Chevron right icon",children:[i.jsx("title",{children:"Chevron right icon"}),i.jsx("polyline",{points:"9 18 15 12 9 6"})]});function Jd({children:r,onClick:s,isExpanded:u,indent:c=0}){return i.jsx("tr",{onClick:s,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),s())},tabIndex:0,"aria-label":`Toggle group ${r}`,style:{cursor:"pointer",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,borderTop:`1px solid ${o.borderLight}`},onMouseEnter:p=>{p.currentTarget.style.background=o.bgCard},onMouseLeave:p=>{p.currentTarget.style.background=o.bgSecondary},children:i.jsxs("td",{colSpan:11,style:{padding:c>0?"12px 16px 12px 40px":"12px 16px",color:o.textPrimary,fontFamily:m.body,fontWeight:"600",fontSize:c>0?"11px":"12px"},children:[i.jsx("span",{style:{marginRight:"8px",userSelect:"none",display:"inline-flex",alignItems:"center"},children:u?i.jsx(ey,{size:12}):i.jsx(ty,{size:12})}),r]})})}function ny({response:r,selected:s,firstRequestTime:u,onSelect:c}){const p=s?.frame_number===r.frame_number,{source:f,dest:g}=zs(r),y=Ls(r.timestamp_iso,u);return i.jsxs("tr",{onClick:()=>c(r),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),c(r))},tabIndex:0,"aria-label":`Select orphaned response ${r.frame_number}`,style:{cursor:"pointer",background:p?o.bgSelected:o.bgUnpaired,borderBottom:`1px solid ${o.borderLight}`,fontFamily:m.body,transition:"background-color 0.15s ease",opacity:.85},onMouseEnter:x=>{p||(x.currentTarget.style.background=tr(o.accentOrange,.1))},onMouseLeave:x=>{p||(x.currentTarget.style.background=o.bgUnpaired)},children:[i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,textAlign:"right",fontFamily:m.mono,fontSize:"12px"},children:i.jsxs("span",{style:{color:o.accentOrange,fontWeight:"500"},children:["#",r.frame_number," (orphaned)"]})}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:m.mono,fontSize:"12px"},children:y}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:m.body,fontSize:"12px"},children:Ms(r.timestamp_iso)}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentOrange,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:f}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentOrange,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:g}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:r.protocol||"HTTP"}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textSecondary,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:"-"}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:i.jsx("div",{style:{color:r.status_code>=400?o.error:r.status_code>=300?o.warning:o.success,fontWeight:"600"},children:r.status_code||"-"})}),i.jsx("td",{style:{padding:"16px",color:o.textPrimary,fontFamily:m.mono,fontSize:"12px"},children:fi(r)})]})}const ry=({size:r=12,rotated:s=!1})=>i.jsx(xs,{size:r,stroke:1.5,style:{display:"inline-block",verticalAlign:"middle",transform:s?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s ease"}});function oy({request:r,response:s,selected:u,firstRequestTime:c,onSelect:p,isExpanded:f,onToggleExpand:g,isUnpaired:y}){const x=u?.frame_number===r.frame_number,{source:T,dest:v}=zs(r),w=Ls(r.timestamp_iso,c),b=!!s;return i.jsx(i.Fragment,{children:i.jsxs("tr",{onClick:()=>p(r),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),p(r))},tabIndex:0,"aria-label":`Select request ${r.frame_number}`,style:{cursor:"pointer",background:x?o.bgSelected:y?o.bgUnpaired:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontFamily:m.body,transition:"background-color 0.15s ease",opacity:y?.85:1},onMouseEnter:_=>{x||(_.currentTarget.style.background=y?tr(o.accentOrange,.1):o.bgCard)},onMouseLeave:_=>{x||(_.currentTarget.style.background=y?o.bgUnpaired:o.bgSecondary)},children:[i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,textAlign:"right",fontFamily:m.mono,fontSize:"12px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"flex-end"},children:[b&&i.jsx("button",{type:"button",onClick:_=>{_.stopPropagation(),g()},style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",color:o.textSecondary},onMouseEnter:_=>{_.currentTarget.style.color=o.textPrimary},onMouseLeave:_=>{_.currentTarget.style.color=o.textSecondary},children:i.jsx(ry,{size:14,rotated:!f})}),i.jsxs("span",{style:{color:y?o.accentOrange:o.accentBlue,fontWeight:"500"},children:["#",r.frame_number,y&&i.jsx("span",{style:{fontSize:"10px",color:o.textSecondary,marginLeft:"4px",fontStyle:"italic"},children:"(no response)"})]})]})}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:m.mono,fontSize:"12px"},children:w}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:m.body,fontSize:"12px"},children:Ms(r.timestamp_iso)}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentBlue,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:T}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentBlue,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:v}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:r.protocol||"HTTP"}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:i.jsx("div",{style:{color:o.accentBlue},children:r.method||"REQ"})}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:b&&i.jsx("div",{style:{color:s.status_code>=400?o.error:s.status_code>=300?o.warning:o.success,fontWeight:"600"},children:s.status_code||"-"})}),i.jsx("td",{style:{padding:"16px",color:o.textPrimary,fontFamily:m.mono,fontSize:"12px"},children:fi(r)})]})})}function iy({response:r,selected:s,firstRequestTime:u,onSelect:c}){const p=s?.frame_number===r.frame_number,{source:f,dest:g}=zs(r),y=Ls(r.timestamp_iso,u);return i.jsxs("tr",{onClick:()=>c(r),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),c(r))},tabIndex:0,"aria-label":`Select response ${r.frame_number}`,style:{cursor:"pointer",background:p&&s?.frame_number===r.frame_number?o.bgSelected:o.bgTertiary,borderBottom:`1px solid ${o.borderLight}`,fontFamily:m.body,transition:"background-color 0.15s ease"},onMouseEnter:x=>{p&&s?.frame_number===r.frame_number||(x.currentTarget.style.background=o.bgSecondary)},onMouseLeave:x=>{p&&s?.frame_number===r.frame_number||(x.currentTarget.style.background=o.bgTertiary)},children:[i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,textAlign:"right",fontFamily:m.mono,fontSize:"12px",paddingLeft:"40px"},children:i.jsxs("span",{style:{color:o.accentGreen,fontWeight:"500"},children:["#",r.frame_number]})}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:m.mono,fontSize:"12px"},children:y}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:m.body,fontSize:"12px"},children:Ms(r.timestamp_iso)}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentGreen,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:f}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.accentGreen,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:g}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textPrimary,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:r.protocol||"HTTP"}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,color:o.textSecondary,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:"-"}),i.jsx("td",{style:{padding:"16px",borderRight:`1px solid ${o.borderLight}`,fontFamily:m.mono,fontSize:"12px",fontWeight:"500"},children:i.jsx("div",{style:{color:r.status_code>=400?o.error:r.status_code>=300?o.warning:o.success,fontWeight:"600"},children:r.status_code||"-"})}),i.jsx("td",{style:{padding:"16px",color:o.textPrimary,fontFamily:m.mono,fontSize:"12px"},children:fi(r)})]})}function Fc({pair:r,request:s,selected:u,firstRequestTime:c,onSelect:p,isExpanded:f=!1,onToggleExpand:g=()=>{}}){const x=((_,M)=>_?{request:_.request,response:_.response}:M?{request:M,response:null}:null)(r,s);if(!x)return null;const{request:T,response:v}=x,w=!T||!v;if(!T&&v)return i.jsx(ny,{response:v,selected:u,firstRequestTime:c,onSelect:p});if(!T)return null;const b=!!v;return i.jsxs(i.Fragment,{children:[i.jsx(oy,{request:T,response:v,selected:u,firstRequestTime:c,onSelect:p,isExpanded:f,onToggleExpand:g,isUnpaired:w}),b&&f&&i.jsx(iy,{response:v,selected:u,firstRequestTime:c,onSelect:p,request:T})]})}function ly({groupedData:r,selected:s,firstRequestTime:u,onSelect:c,expandedSessions:p,expandedCategories:f,onToggleSession:g,onToggleCategory:y}){return i.jsx("tbody",{children:r.map(x=>{const T=x.sessionId||"__NO_SESSION__",v=p.has(T);return i.jsxs(ri.Fragment,{children:[i.jsxs(Jd,{onClick:()=>g(T),isExpanded:v,indent:0,children:[i.jsxs("span",{style:{color:o.accentBlue,marginRight:"8px"},children:["Session: ",x.sessionId||"No Session"]}),i.jsxs("span",{style:{color:o.textTertiary,fontSize:"11px",fontWeight:"400"},children:["(",x.categories.reduce((w,b)=>w+b.pairs.length,0)," ","operations)"]})]}),v&&x.categories.map(w=>{const b=`${T}::${w.category}`,_=f.has(b);return i.jsxs(ri.Fragment,{children:[i.jsxs(Jd,{onClick:()=>y(b),isExpanded:_,indent:1,children:[i.jsx("span",{style:{marginRight:"8px",display:"inline-flex",alignItems:"center"},children:ri.createElement(Zx(w.category),{size:16,stroke:1.5,color:o.accentBlue})}),i.jsx("span",{style:{color:o.textPrimary},children:w.label}),i.jsxs("span",{style:{color:o.textTertiary,fontSize:"11px",fontWeight:"400",marginLeft:"8px"},children:["(",w.pairs.length," ",w.pairs.length===1?"operation":"operations",")"]})]}),_&&w.pairs.map(M=>i.jsx(Fc,{pair:M,selected:s,firstRequestTime:u,onSelect:c,isExpanded:!1,onToggleExpand:()=>{}},M.frame_number))]},b)})]},T)})})}function sy({columnWidths:r}){return i.jsx("thead",{style:{position:"sticky",top:0,background:o.bgSecondary,zIndex:10,boxShadow:`0 2px 4px ${o.shadowSm}`},children:i.jsxs("tr",{children:[i.jsx("th",{style:{padding:"12px 16px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.frame}px`,minWidth:`${r.frame}px`,color:o.textSecondary,fontWeight:"600",fontFamily:m.body,fontSize:"11px",textTransform:"uppercase",letterSpacing:"0.05em",background:o.bgSecondary},children:"No."}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.time}px`,minWidth:`${r.time}px`,color:o.textPrimary,fontWeight:"600",fontFamily:m.body,fontSize:"11px"},children:"Time"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.datetime}px`,minWidth:`${r.datetime}px`,color:o.textPrimary,fontWeight:"600",fontFamily:m.body,fontSize:"11px"},children:"Date/Time"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.source}px`,minWidth:`${r.source}px`,color:o.textPrimary,fontWeight:"600",fontFamily:m.body,fontSize:"11px"},children:"Source"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.destination}px`,minWidth:`${r.destination}px`,color:o.textPrimary,fontWeight:"600",fontFamily:m.body,fontSize:"11px"},children:"Destination"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.protocol}px`,minWidth:`${r.protocol}px`,color:o.textPrimary,fontWeight:"600",fontFamily:m.body,fontSize:"11px"},children:"Protocol"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.method}px`,minWidth:`${r.method}px`,color:o.textPrimary,fontWeight:"600",fontFamily:m.body,fontSize:"11px"},children:"Method"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,borderRight:`1px solid ${o.borderLight}`,width:`${r.status}px`,minWidth:`${r.status}px`,color:o.textPrimary,fontWeight:"600",fontFamily:m.body,fontSize:"11px"},children:"Status"}),i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:`1px solid ${o.borderLight}`,color:o.textPrimary,fontWeight:"600",fontFamily:m.body,fontSize:"11px"},children:"Endpoint"})]})})}function ay({viewMode:r,onViewModeChange:s}){return i.jsxs("div",{"data-tour":"view-modes",style:{display:"flex",borderBottom:`1px solid ${o.borderLight}`,background:o.bgSecondary,padding:"0 12px",boxShadow:`0 1px 3px ${o.shadowSm}`,flexShrink:0},children:[i.jsxs("button",{type:"button",onClick:()=>s("general"),style:{padding:"10px 18px",background:r==="general"?o.bgCard:"transparent",fontFamily:m.body,border:"none",borderBottom:r==="general"?`2px solid ${o.accentBlue}`:"2px solid transparent",color:r==="general"?o.textPrimary:o.textSecondary,borderRadius:"8px 8px 0 0",cursor:"pointer",fontSize:"12px",fontWeight:r==="general"?"500":"normal",display:"flex",alignItems:"center",gap:"6px"},onMouseEnter:u=>{r!=="general"&&(u.currentTarget.style.background=o.bgHover,u.currentTarget.style.color=o.textPrimary)},onMouseLeave:u=>{r!=="general"&&(u.currentTarget.style.background="transparent",u.currentTarget.style.color=o.textSecondary)},children:[i.jsx(gg,{size:16,stroke:1.5}),"General List"]}),i.jsxs("button",{type:"button",onClick:()=>s("groupedByMcp"),style:{padding:"10px 18px",background:r==="groupedByMcp"?o.bgCard:"transparent",fontFamily:m.body,border:"none",borderBottom:r==="groupedByMcp"?`2px solid ${o.accentBlue}`:"2px solid transparent",color:r==="groupedByMcp"?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"12px",fontWeight:r==="groupedByMcp"?"500":"normal",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",gap:"6px"},onMouseEnter:u=>{r!=="groupedByMcp"&&(u.currentTarget.style.background=o.bgHover,u.currentTarget.style.color=o.textPrimary)},onMouseLeave:u=>{r!=="groupedByMcp"&&(u.currentTarget.style.background="transparent",u.currentTarget.style.color=o.textSecondary)},children:[i.jsx(nc,{size:16,stroke:1.5}),"MCP Protocol View"]})]})}function uy({requests:r,selected:s,onSelect:u,firstRequestTime:c}){const[p,f]=P.useState("general"),[g]=P.useState({frame:90,time:120,datetime:180,source:200,destination:200,protocol:90,method:90,status:80,endpoint:500}),[y,x]=P.useState(new Set),[T,v]=P.useState(new Set),[w,b]=P.useState(new Set),_=P.useRef(null),M=P.useRef(0),E=P.useMemo(()=>qx(r),[r]);P.useEffect(()=>{if(_.current&&r.length>0){const $=_.current.querySelectorAll("tr");if($.length>0){if(r.length>M.current){const A=Array.from($).slice(M.current);A.length>0&&Vd(A,{delay:30,duration:300})}else Vd($,{delay:20,duration:300});M.current=r.length}}},[r]),P.useEffect(()=>{if(p==="groupedByMcp"){const $=new Set(E.map(A=>A.sessionId||"__NO_SESSION__"));v(A=>{const K=new Set(A);return $.forEach(V=>K.add(V)),K}),b(A=>{const K=new Set(A);return E.forEach(V=>{const G=V.sessionId||"__NO_SESSION__";V.categories.forEach(Y=>{K.add(`${G}::${Y.category}`)})}),K})}},[E,p]);const L=$=>{v(A=>{const K=new Set(A);return K.has($)?K.delete($):K.add($),K})},F=$=>{b(A=>{const K=new Set(A);return K.has($)?K.delete($):K.add($),K})},D=P.useMemo(()=>Mc(r),[r]),U=$=>{x(A=>{const K=new Set(A);return K.has($)?K.delete($):K.add($),K})},W=()=>i.jsx("tbody",{ref:_,children:D.map($=>i.jsx(Fc,{pair:$,selected:s,firstRequestTime:c,onSelect:u,isExpanded:y.has($.frame_number),onToggleExpand:()=>U($.frame_number)},$.frame_number))});return i.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",background:o.bgPrimary,minHeight:0,overflow:"hidden"},children:[i.jsx(ay,{viewMode:p,onViewModeChange:f}),i.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"auto",minHeight:0,WebkitOverflowScrolling:"touch"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0,fontSize:"12px",fontFamily:m.body,background:o.bgPrimary},children:[i.jsx(sy,{columnWidths:g}),p==="general"?W():i.jsx(ly,{groupedData:E,expandedSessions:T,expandedCategories:w,onToggleSession:L,onToggleCategory:F,selected:s,firstRequestTime:c,onSelect:u})]})})]})}function dy({requests:r,selected:s,onSelect:u,filters:c,onFilterChange:p,stats:f,firstRequestTime:g,onClear:y}){const x=P.useRef(null);return P.useEffect(()=>{s&&x.current&&setTimeout(()=>{x.current&&(x.current.style.opacity="0",x.current.style.transform="translateX(600px)",Qx(x.current,{width:600}))},10)},[s]),i.jsxs("div",{"data-tab-content":!0,style:{display:"flex",flex:1,overflow:"hidden",minHeight:0},children:[i.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,minHeight:0},children:[i.jsx(Kx,{filters:c,onFilterChange:p,stats:f,onExport:()=>{},onClear:y}),i.jsx(uy,{requests:r,selected:s,onSelect:u,firstRequestTime:g})]}),s&&i.jsx("div",{ref:x,style:{width:"40%",minWidth:"500px",maxWidth:"700px",borderLeft:`1px solid ${o.borderLight}`,overflow:"hidden",display:"flex",flexDirection:"column",background:o.bgCard,flexShrink:0},children:i.jsx(Yx,{request:s,onClose:()=>u(null),requests:r})})]})}function fn(r,s){s.search&&r.append("search",s.search),s.serverName&&r.append("serverName",s.serverName),s.sessionId&&r.append("sessionId",s.sessionId),s.method&&r.append("method",s.method),s.jsonrpcMethod&&r.append("jsonrpcMethod",s.jsonrpcMethod),s.statusCode&&r.append("statusCode",s.statusCode),s.jsonrpcId&&r.append("jsonrpcId",s.jsonrpcId)}const cy=["traffic","logs","setup","playground","smart-scan"],py="traffic";function ps(){const r=window.location.hash.slice(1),s=r.startsWith("/")?r.slice(1):r;return cy.includes(s)?s:py}function Kd(r){const s=`#/${r}`;window.location.hash!==s&&window.history.replaceState(null,"",s)}function fy(){const[r,s]=P.useState(()=>ps()),[u,c]=P.useState([]),[p,f]=P.useState(null),[g,y]=P.useState({}),[x,T]=P.useState(null),[v,w]=P.useState(null),[b,_]=P.useState(!1),[M,E]=P.useState(!0),L=P.useRef(null),F=P.useRef(r),D=P.useRef(g);P.useEffect(()=>{if(!window.location.hash||window.location.hash==="#"){const $=ps();Kd($)}},[]),P.useEffect(()=>{Kd(r)},[r]),P.useEffect(()=>{const $=()=>{const A=ps();A!==r&&s(A)};return window.addEventListener("hashchange",$),()=>window.removeEventListener("hashchange",$)},[r]);const U=async()=>{try{const $=new URLSearchParams;fn($,g);const K=await(await fetch(`/api/statistics?${$}`)).json();T(K)}catch($){console.error("Failed to load statistics:",$)}},W=async()=>{try{const $=new URLSearchParams;fn($,g),$.append("limit","5000");const K=await(await fetch(`/api/requests?${$}`)).json();if(c(K),K.length>0){const V=K[K.length-1]?.timestamp_iso;V&&w(V)}await U()}catch($){console.error("Failed to load requests:",$)}};return P.useEffect(()=>{const $=async()=>{try{const G=await(await fetch("/api/help/state")).json();E(G.dismissed||G.tourCompleted),!G.dismissed&&!G.tourCompleted&&setTimeout(()=>{_(!0)},500)}catch(V){console.error("Failed to load tour state:",V),setTimeout(()=>{_(!0)},500),E(!1)}},A=async()=>{try{const V=new URLSearchParams;fn(V,g),V.append("limit","5000");const Y=await(await fetch(`/api/requests?${V}`)).json();if(c(Y),Y.length>0){const Ee=Y[Y.length-1]?.timestamp_iso;Ee&&w(Ee)}const ue=new URLSearchParams;fn(ue,g);const me=await(await fetch(`/api/statistics?${ue}`)).json();T(me)}catch(V){console.error("Failed to load requests:",V)}};$(),A();const K=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`;try{const V=new WebSocket(K);L.current=V,V.onmessage=async G=>{const Y=JSON.parse(G.data);if(Y.type==="update"){if(c(Y.data),Y.data.length>0){const ue=Y.data[Y.data.length-1]?.timestamp_iso;ue&&w(ue)}try{const ue=new URLSearchParams;fn(ue,g);const me=await(await fetch(`/api/statistics?${ue}`)).json();T(me)}catch(ue){console.error("Failed to load statistics:",ue)}}},V.onerror=()=>{},V.onclose=()=>{}}catch{}return()=>{L.current&&L.current.readyState===WebSocket.OPEN&&L.current.close()}},[g]),P.useEffect(()=>{(async()=>{try{const A=new URLSearchParams;fn(A,g),A.append("limit","5000");const V=await(await fetch(`/api/requests?${A}`)).json();if(c(V),V.length>0){const ve=V[V.length-1]?.timestamp_iso;ve&&w(ve)}const G=new URLSearchParams;fn(G,g);const ue=await(await fetch(`/api/statistics?${G}`)).json();T(ue)}catch(A){console.error("Failed to load requests:",A)}})()},[g]),P.useEffect(()=>{D.current=g},[g]),P.useEffect(()=>{if(r!=="traffic")return;const $=setInterval(async()=>{try{const A=new URLSearchParams;fn(A,D.current);const V=await(await fetch(`/api/statistics?${A}`)).json();T(V)}catch(A){console.error("Failed to load statistics:",A)}},2e3);return()=>clearInterval($)},[r]),{activeTab:r,setActiveTab:s,requests:u,selected:p,setSelected:f,filters:g,setFilters:y,stats:x,firstRequestTime:v,showTour:b,setShowTour:_,tourDismissed:M,prevTabRef:F,wsRef:L,loadRequests:W}}function gy({show:r}){const s=P.useRef(null),u=P.useRef([]);return P.useEffect(()=>{r&&s.current?(fe({targets:s.current,opacity:[0,1],scale:[.9,1],duration:400,easing:"easeOutExpo"}),u.current.length>0&&fe({targets:u.current,translateY:[0,-10,0],duration:1200,delay:fe.stagger(200),loop:!0,easing:"easeInOutQuad"})):!r&&s.current&&fe({targets:s.current,opacity:[1,0],scale:[1,.9],duration:300,easing:"easeInExpo",complete:()=>{s.current&&(s.current.style.display="none")}})},[r]),r?i.jsx("div",{ref:s,style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(245, 243, 240, 0.9)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,borderRadius:"8px",backdropFilter:"blur(2px)"},children:i.jsxs("div",{style:{background:o.bgCard,borderRadius:"16px",padding:"32px",boxShadow:`0 8px 32px ${o.shadowMd}`,maxWidth:"320px",width:"90%",textAlign:"center"},children:[i.jsx("h3",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,fontFamily:m.body,marginBottom:"20px"},children:"Waiting for MCP server to start"}),i.jsx("div",{style:{display:"flex",justifyContent:"center",gap:"8px"},children:[0,1,2].map(c=>i.jsx("div",{ref:p=>{p&&(u.current[c]=p)},style:{width:"12px",height:"12px",borderRadius:"50%",background:o.accentBlue}},c))})]})}):null}function hy({prompt:r,promptArgs:s,onPromptArgsChange:u,promptResult:c,onGetPrompt:p,loading:f}){return i.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.jsxs("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:["Get Prompt: ",r.name]}),i.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"prompt-args-textarea",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Arguments (JSON)"}),i.jsx("textarea",{id:"prompt-args-textarea",value:s,onChange:g=>u(g.target.value),style:{width:"100%",minHeight:"150px",padding:"10px",border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontFamily:m.mono,fontSize:"12px",background:o.bgCard,color:o.textPrimary,resize:"vertical"}})]}),i.jsx("button",{type:"button",onClick:p,disabled:f,style:{padding:"10px 20px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:f?"not-allowed":"pointer",fontFamily:m.body,fontSize:"13px",fontWeight:"500",opacity:f?.6:1},children:f?"Getting...":"Get Prompt"}),c&&i.jsxs("div",{children:[i.jsx("label",{htmlFor:"prompt-result-pre",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Result"}),i.jsx("pre",{id:"prompt-result-pre",style:{padding:"12px",background:o.bgSecondary,border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontSize:"12px",fontFamily:m.mono,color:c.error?o.error:o.textPrimary,overflow:"auto",maxHeight:"300px",margin:0},children:JSON.stringify(c,null,2)})]})]})]})}function Rs({message:r}){return i.jsx("div",{style:{padding:"40px",textAlign:"center",color:o.textSecondary,fontFamily:m.body,fontSize:"13px"},children:r})}function Fs({message:r}){return i.jsx("div",{style:{padding:"40px",textAlign:"center",color:o.error,fontFamily:m.body,fontSize:"13px"},children:r})}function nr({message:r}){return i.jsx("div",{style:{padding:"40px",textAlign:"center",color:o.textSecondary,fontFamily:m.body,fontSize:"13px"},children:r})}function xy({prompt:r,isSelected:s,onClick:u}){return i.jsx("button",{type:"button",onClick:u,"aria-label":`Select prompt ${r.name}`,style:{padding:"16px 20px",margin:"4px 8px",borderRadius:"8px",cursor:"pointer",background:s?o.bgSelected:o.bgCard,border:s?`2px solid ${o.accentBlue}`:`1px solid ${o.borderLight}`,boxShadow:s?`0 2px 4px ${o.shadowSm}`:"none",transition:"all 0.2s ease",position:"relative",width:"100%",textAlign:"left"},onMouseEnter:c=>{s||(c.currentTarget.style.background=o.bgHover,c.currentTarget.style.borderColor=o.borderMedium,c.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:c=>{s||(c.currentTarget.style.background=o.bgCard,c.currentTarget.style.borderColor=o.borderLight,c.currentTarget.style.boxShadow="none")},children:i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[i.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:s?o.accentBlue:o.textTertiary,marginTop:"6px",flexShrink:0,transition:"background 0.2s"}}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("div",{style:{fontWeight:s?"600":"500",fontSize:"14px",color:o.textPrimary,marginBottom:r.description?"6px":"0",lineHeight:"1.4"},children:r.name}),r.description&&i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,lineHeight:"1.5",marginTop:"4px"},children:r.description})]})]})})}function yy({serverStatus:r,promptsLoading:s,promptsLoaded:u,error:c,prompts:p,selectedPrompt:f,onSelectPrompt:g}){return i.jsx("div",{style:{flex:1,overflow:"auto",background:o.bgCard,position:"relative"},children:r?.running?s||!u?i.jsx(nr,{message:"Loading prompts..."}):c?.includes("prompts:")?i.jsx(Fs,{message:`Error loading prompts: ${c.replace("prompts: ","")}`}):p.length===0?i.jsx(Rs,{message:"No prompts available."}):i.jsx("div",{style:{padding:"8px 0"},children:p.map((y,x)=>i.jsx(xy,{prompt:y,isSelected:f?.name===y.name,onClick:()=>g(y)},y.name||`prompt-${x}`))}):i.jsx(nr,{message:"Waiting for MCP server to start..."})})}function my({prompts:r,selectedPrompt:s,onSelectPrompt:u,promptArgs:c,onPromptArgsChange:p,promptResult:f,onGetPrompt:g,loading:y,promptsLoading:x,promptsLoaded:T,serverStatus:v,error:w,onRefresh:b}){const _=M=>{u(M);const E=M.arguments?M.arguments.reduce((L,F)=>(L[F.name]=F.default!==void 0?F.default:"",L),{}):{};p(JSON.stringify(E,null,2))};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.jsx("button",{type:"button",onClick:b,disabled:y||x,style:{padding:"8px 16px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:y||x?"not-allowed":"pointer",fontFamily:m.body,fontSize:"13px",fontWeight:"500",opacity:y||x?.6:1},children:x?"Loading...":"Refresh Prompts"}),i.jsx("span",{style:{color:o.textSecondary,fontSize:"13px"},children:x?"Loading prompts...":`${r.length} prompt${r.length!==1?"s":""} available`})]}),i.jsxs("div",{style:{display:"flex",gap:"16px",flex:1,minHeight:0},children:[i.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.jsx("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:"Available Prompts"}),i.jsx(yy,{serverStatus:v,promptsLoading:x,promptsLoaded:T,error:w,prompts:r,selectedPrompt:s,onSelectPrompt:_})]}),s&&i.jsx(hy,{prompt:s,promptArgs:c,onPromptArgsChange:p,promptResult:f,onGetPrompt:g,loading:y})]})]})}function vy({resource:r,resourceResult:s,onReadResource:u,loading:c}){return i.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.jsxs("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:["Read Resource: ",r.uri]}),i.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsx("button",{type:"button",onClick:u,disabled:c,style:{padding:"10px 20px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:c?"not-allowed":"pointer",fontFamily:m.body,fontSize:"13px",fontWeight:"500",opacity:c?.6:1},children:c?"Reading...":"Read Resource"}),s&&i.jsxs("div",{children:[i.jsx("label",{htmlFor:"resource-result-pre",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Result"}),i.jsx("pre",{id:"resource-result-pre",style:{padding:"12px",background:o.bgSecondary,border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontSize:"12px",fontFamily:m.mono,color:s.error?o.error:o.textPrimary,overflow:"auto",maxHeight:"400px",margin:0},children:JSON.stringify(s,null,2)})]})]})]})}function Sy({resource:r,isSelected:s,onClick:u}){return i.jsx("button",{type:"button",onClick:u,"aria-label":`Select resource ${r.uri}`,style:{padding:"16px 20px",margin:"4px 8px",borderRadius:"8px",cursor:"pointer",background:s?o.bgSelected:o.bgCard,border:s?`2px solid ${o.accentBlue}`:`1px solid ${o.borderLight}`,boxShadow:s?`0 2px 4px ${o.shadowSm}`:"none",transition:"all 0.2s ease",position:"relative",width:"100%",textAlign:"left"},onMouseEnter:c=>{s||(c.currentTarget.style.background=o.bgHover,c.currentTarget.style.borderColor=o.borderMedium,c.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:c=>{s||(c.currentTarget.style.background=o.bgCard,c.currentTarget.style.borderColor=o.borderLight,c.currentTarget.style.boxShadow="none")},children:i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[i.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:s?o.accentBlue:o.textTertiary,marginTop:"6px",flexShrink:0,transition:"background 0.2s"}}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("div",{style:{fontWeight:s?"600":"500",fontSize:"14px",color:o.textPrimary,marginBottom:r.name||r.description?"6px":"0",lineHeight:"1.4",wordBreak:"break-word"},children:r.uri}),r.name&&i.jsx("div",{style:{fontSize:"13px",color:o.textPrimary,fontWeight:"500",lineHeight:"1.5",marginTop:"4px"},children:r.name}),r.description&&i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,lineHeight:"1.5",marginTop:r.name?"2px":"4px"},children:r.description})]})]})})}function by({serverStatus:r,resourcesLoading:s,resourcesLoaded:u,error:c,resources:p,selectedResource:f,onSelectResource:g}){return i.jsx("div",{style:{flex:1,overflow:"auto",background:o.bgCard,position:"relative"},children:r?.running?s||!u?i.jsx(nr,{message:"Loading resources..."}):c?.includes("resources:")?i.jsx(Fs,{message:`Error loading resources: ${c.replace("resources: ","")}`}):p.length===0?i.jsx(Rs,{message:"No resources available."}):i.jsx("div",{style:{padding:"8px 0"},children:p.map((y,x)=>i.jsx(Sy,{resource:y,isSelected:f?.uri===y.uri,onClick:()=>g(y)},y.uri||`resource-${x}`))}):i.jsx(nr,{message:"Waiting for MCP server to start..."})})}function wy({resources:r,selectedResource:s,onSelectResource:u,resourceResult:c,onReadResource:p,loading:f,resourcesLoading:g,resourcesLoaded:y,serverStatus:x,error:T,onRefresh:v}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.jsx("button",{type:"button",onClick:v,disabled:f||g,style:{padding:"8px 16px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:f||g?"not-allowed":"pointer",fontFamily:m.body,fontSize:"13px",fontWeight:"500",opacity:f||g?.6:1},children:g?"Loading...":"Refresh Resources"}),i.jsx("span",{style:{color:o.textSecondary,fontSize:"13px"},children:g?"Loading resources...":`${r.length} resource${r.length!==1?"s":""} available`})]}),i.jsxs("div",{style:{display:"flex",gap:"16px",flex:1,minHeight:0},children:[i.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.jsx("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:"Available Resources"}),i.jsx(by,{serverStatus:x,resourcesLoading:g,resourcesLoaded:y,error:T,resources:r,selectedResource:s,onSelectResource:u})]}),s&&i.jsx(vy,{resource:s,resourceResult:c,onReadResource:p,loading:f})]})]})}function ky({tool:r,toolArgs:s,onToolArgsChange:u,toolResult:c,onCallTool:p,loading:f}){return i.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.jsxs("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:["Call Tool: ",r.name]}),i.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("label",{htmlFor:"tool-args-textarea",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Arguments (JSON)"}),i.jsx("textarea",{id:"tool-args-textarea",value:s,onChange:g=>u(g.target.value),style:{width:"100%",minHeight:"150px",padding:"10px",border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontFamily:m.mono,fontSize:"12px",background:o.bgCard,color:o.textPrimary,resize:"vertical"}})]}),i.jsx("button",{type:"button",onClick:p,disabled:f,style:{padding:"10px 20px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:f?"not-allowed":"pointer",fontFamily:m.body,fontSize:"13px",fontWeight:"500",opacity:f?.6:1},children:f?"Calling...":"Call Tool"}),c&&i.jsxs("div",{children:[i.jsx("label",{htmlFor:"tool-result-pre",style:{display:"block",fontSize:"12px",fontWeight:"500",color:o.textSecondary,marginBottom:"6px"},children:"Result"}),i.jsx("pre",{id:"tool-result-pre",style:{padding:"12px",background:o.bgSecondary,border:`1px solid ${o.borderLight}`,borderRadius:"6px",fontSize:"12px",fontFamily:m.mono,color:c.error?o.error:o.textPrimary,overflow:"auto",maxHeight:"300px",margin:0},children:JSON.stringify(c,null,2)})]})]})]})}function jy({tool:r,isSelected:s,onClick:u}){return i.jsx("button",{type:"button",onClick:u,"aria-label":`Select tool ${r.name}`,style:{padding:"16px 20px",margin:"4px 8px",borderRadius:"8px",cursor:"pointer",background:s?o.bgSelected:o.bgCard,border:s?`2px solid ${o.accentBlue}`:`1px solid ${o.borderLight}`,boxShadow:s?`0 2px 4px ${o.shadowSm}`:"none",transition:"all 0.2s ease",position:"relative",width:"100%",textAlign:"left"},onMouseEnter:c=>{s||(c.currentTarget.style.background=o.bgHover,c.currentTarget.style.borderColor=o.borderMedium,c.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:c=>{s||(c.currentTarget.style.background=o.bgCard,c.currentTarget.style.borderColor=o.borderLight,c.currentTarget.style.boxShadow="none")},children:i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[i.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:s?o.accentBlue:o.textTertiary,marginTop:"6px",flexShrink:0,transition:"background 0.2s"}}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("div",{style:{fontWeight:s?"600":"500",fontSize:"14px",color:o.textPrimary,marginBottom:r.description?"6px":"0",lineHeight:"1.4"},children:r.name}),r.description&&i.jsx("div",{style:{fontSize:"12px",color:o.textSecondary,lineHeight:"1.5",marginTop:"4px"},children:r.description})]})]})})}function Cy({serverStatus:r,toolsLoading:s,toolsLoaded:u,error:c,tools:p,selectedTool:f,onSelectTool:g}){return i.jsx("div",{style:{flex:1,overflow:"auto",background:o.bgCard,position:"relative"},children:r?.running?s||!u?i.jsx(nr,{message:"Loading tools..."}):c?.includes("tools:")?i.jsx(Fs,{message:`Error loading tools: ${c.replace("tools: ","")}`}):p.length===0?i.jsx(Rs,{message:"No tools available."}):i.jsx("div",{style:{padding:"8px 0"},children:p.map((y,x)=>i.jsx(jy,{tool:y,isSelected:f?.name===y.name,onClick:()=>g(y)},y.name||`tool-${x}`))}):i.jsx(nr,{message:"Waiting for MCP server to start..."})})}function Ty({tools:r,selectedTool:s,onSelectTool:u,toolArgs:c,onToolArgsChange:p,toolResult:f,onCallTool:g,loading:y,toolsLoading:x,toolsLoaded:T,serverStatus:v,error:w,onRefresh:b}){const _=M=>{u(M);const E=M.inputSchema?.properties?Object.keys(M.inputSchema.properties).reduce((L,F)=>{const D=M.inputSchema.properties[F];return L[F]=D.default!==void 0?D.default:"",L},{}):{};p(JSON.stringify(E,null,2))};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.jsx("button",{type:"button",onClick:b,disabled:y||x,style:{padding:"8px 16px",background:o.buttonPrimary,color:o.textInverse,border:"none",borderRadius:"6px",cursor:y||x?"not-allowed":"pointer",fontFamily:m.body,fontSize:"13px",fontWeight:"500",opacity:y||x?.6:1},children:x?"Loading...":"Refresh Tools"}),i.jsx("span",{style:{color:o.textSecondary,fontSize:"13px"},children:x?"Loading tools...":`${r.length} tool${r.length!==1?"s":""} available`})]}),i.jsxs("div",{style:{display:"flex",gap:"16px",flex:1,minHeight:0},children:[i.jsxs("div",{style:{flex:1,border:`1px solid ${o.borderLight}`,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.jsx("div",{style:{padding:"12px",background:o.bgSecondary,borderBottom:`1px solid ${o.borderLight}`,fontWeight:"500",fontSize:"14px",color:o.textPrimary},children:"Available Tools"}),i.jsx(Cy,{serverStatus:v,toolsLoading:x,toolsLoaded:T,error:w,tools:r,selectedTool:s,onSelectTool:_})]}),s&&i.jsx(ky,{tool:s,toolArgs:c,onToolArgsChange:p,toolResult:f,onCallTool:g,loading:y})]})]})}function Py(r,s,u){const[c,p]=P.useState([]),[f,g]=P.useState([]),[y,x]=P.useState([]),[T,v]=P.useState(!1),[w,b]=P.useState(!1),[_,M]=P.useState(!1),[E,L]=P.useState(!1),[F,D]=P.useState(!1),[U,W]=P.useState(!1),$=P.useCallback(async()=>{if(!s){u("tools: No server selected"),L(!0);return}v(!0),u(null);try{const G=await r("tools/list");p(G?.tools||[]),L(!0)}catch(G){const Y=G.message||"Failed to load tools";u(`tools: ${Y}`),L(!0),console.error("Failed to load tools:",G)}finally{v(!1)}},[s,r,u]),A=P.useCallback(async()=>{if(!s){u("prompts: No server selected"),D(!0);return}b(!0),u(null);try{const G=await r("prompts/list");g(G?.prompts||[]),D(!0)}catch(G){const Y=G.message||"Failed to load prompts";u(`prompts: ${Y}`),D(!0),console.error("Failed to load prompts:",G)}finally{b(!1)}},[s,r,u]),K=P.useCallback(async()=>{if(!s){u("resources: No server selected"),W(!0);return}M(!0),u(null);try{const G=await r("resources/list");x(G?.resources||[]),W(!0)}catch(G){const Y=G.message||"Failed to load resources";u(`resources: ${Y}`),W(!0),console.error("Failed to load resources:",G)}finally{M(!1)}},[s,r,u]),V=P.useCallback(()=>{L(!1),D(!1),W(!1),p([]),g([]),x([])},[]);return{tools:c,prompts:f,resources:y,toolsLoading:T,promptsLoading:w,resourcesLoading:_,toolsLoaded:E,promptsLoaded:F,resourcesLoaded:U,loadTools:$,loadPrompts:A,loadResources:K,resetData:V}}function _y(r){const[s,u]=P.useState(!1),[c,p]=P.useState(null),[f,g]=P.useState(null),y=P.useRef(f);y.current=f;const x=P.useCallback(async(v,w={})=>{if(!r)throw new Error("No server selected");p(null),u(!0);try{const b={"Content-Type":"application/json"},_=y.current;_&&(b["Mcp-Session-Id"]=_);const M=await fetch("/api/playground/proxy",{method:"POST",headers:b,body:JSON.stringify({method:v,params:w,serverName:r})}),E=await M.json(),L=M.headers.get("Mcp-Session-Id")||M.headers.get("mcp-session-id")||E._sessionId;if(L&&L!==_&&g(L),!M.ok)throw new Error(E.error?.message||E.message||"Request failed");return E.result||E}catch(b){throw p(b.message),b}finally{u(!1)}},[r]),T=P.useCallback(()=>{g(null)},[]);return{makeMcpRequest:x,loading:s,error:c,setError:p,resetSession:T}}function Ly(){const[r,s]=P.useState(null),[u,c]=P.useState(!1),[p,f]=P.useState([]),[g,y]=P.useState(null),x=P.useCallback(async()=>{try{const v=await fetch("/api/composite/status");if(!v.ok)throw new Error("Server not available");const w=await v.json();s(b=>{const _=b?.running;return w.running?c(M=>M&&!1):c(M=>!M||_?!0:M),w})}catch{s({running:!1}),c(w=>w||!0)}},[]),T=P.useCallback(async()=>{try{const v=await fetch("/api/composite/servers");if(v.ok){const w=await v.json();f(w.servers||[]),y(b=>!b&&w.servers&&w.servers.length>0?w.servers[0]:b)}}catch(v){console.error("Failed to load servers:",v)}},[]);return P.useEffect(()=>{T()},[T]),P.useEffect(()=>{x();const v=setInterval(x,2e3);return()=>clearInterval(v)},[x]),P.useEffect(()=>{p.length>0&&!g&&y(p[0])},[p,g]),{serverStatus:r,showLoadingModal:u,availableServers:p,selectedServer:g,setSelectedServer:y,checkServerStatus:x}}function My(){const[r,s]=P.useState("tools"),[u,c]=P.useState(null),[p,f]=P.useState("{}"),[g,y]=P.useState(null),[x,T]=P.useState(null),[v,w]=P.useState("{}"),[b,_]=P.useState(null),[M,E]=P.useState(null),[L,F]=P.useState(null),{serverStatus:D,showLoadingModal:U,availableServers:W,selectedServer:$,setSelectedServer:A}=Ly(),{makeMcpRequest:K,loading:V,error:G,setError:Y,resetSession:ue}=_y($),{tools:ve,prompts:me,resources:Ee,toolsLoading:Ne,promptsLoading:Re,resourcesLoading:he,toolsLoaded:J,promptsLoaded:q,resourcesLoaded:X,loadTools:j,loadPrompts:N,loadResources:ie,resetData:de}=Py(K,$,Y),pe=P.useRef(r);return pe.current=r,P.useEffect(()=>{if(!$||!D?.running)return;de(),c(null),T(null),E(null),y(null),_(null),F(null),f("{}"),w("{}"),ue(),Y(null);const ce=setTimeout(()=>{const Le=pe.current;Le==="tools"?j():Le==="prompts"?N():Le==="resources"&&ie()},100);return()=>clearTimeout(ce)},[$,D?.running,de,j,N,ie,ue,Y]),P.useEffect(()=>{if(!(!D?.running||!$)){if(r==="tools"&&!J&&!Ne){const ce=setTimeout(()=>{j()},100);return()=>clearTimeout(ce)}if(r==="prompts"&&!q&&!Re){const ce=setTimeout(()=>{N()},100);return()=>clearTimeout(ce)}if(r==="resources"&&!X&&!he){const ce=setTimeout(()=>{ie()},100);return()=>clearTimeout(ce)}}},[r,D?.running,$,J,Ne,q,Re,X,he,j,N,ie]),{activeSection:r,setActiveSection:s,tools:ve,prompts:me,resources:Ee,loading:V,error:G,selectedTool:u,setSelectedTool:c,toolArgs:p,setToolArgs:f,toolResult:g,selectedPrompt:x,setSelectedPrompt:T,promptArgs:v,setPromptArgs:w,promptResult:b,selectedResource:M,setSelectedResource:E,resourceResult:L,serverStatus:D,showLoadingModal:U,toolsLoading:Ne,promptsLoading:Re,resourcesLoading:he,toolsLoaded:J,promptsLoaded:q,resourcesLoaded:X,loadTools:j,loadPrompts:N,loadResources:ie,handleCallTool:async()=>{if(u)try{const Le=(Vt=>{try{return JSON.parse(Vt)}catch{return null}})(p);if(Le===null){Y("Invalid JSON in arguments");return}const _t=await K("tools/call",{name:u.name,arguments:Le});y(_t)}catch(ce){y({error:ce.message})}},handleGetPrompt:async()=>{if(x)try{const Le=(Vt=>{try{return JSON.parse(Vt)}catch{return null}})(v);if(Le===null){Y("Invalid JSON in arguments");return}const _t=await K("prompts/get",{name:x.name,arguments:Le});_(_t)}catch(ce){_({error:ce.message})}},handleReadResource:async()=>{if(M)try{const ce=await K("resources/read",{uri:M.uri});F(ce)}catch(ce){F({error:ce.message})}},availableServers:W,selectedServer:$,setSelectedServer:A}}function zy(){const{activeSection:r,setActiveSection:s,tools:u,prompts:c,resources:p,loading:f,error:g,selectedTool:y,setSelectedTool:x,toolArgs:T,setToolArgs:v,toolResult:w,selectedPrompt:b,setSelectedPrompt:_,promptArgs:M,setPromptArgs:E,promptResult:L,selectedResource:F,setSelectedResource:D,resourceResult:U,serverStatus:W,showLoadingModal:$,toolsLoading:A,promptsLoading:K,resourcesLoading:V,toolsLoaded:G,promptsLoaded:Y,resourcesLoaded:ue,loadTools:ve,loadPrompts:me,loadResources:Ee,handleCallTool:Ne,handleGetPrompt:Re,handleReadResource:he,availableServers:J,selectedServer:q,setSelectedServer:X}=My();return i.jsxs(i.Fragment,{children:[i.jsx("style",{children:`
|
|
40
|
+
@keyframes spin {
|
|
41
|
+
from { transform: rotate(0deg); }
|
|
42
|
+
to { transform: rotate(360deg); }
|
|
43
|
+
}
|
|
44
|
+
`}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:o.bgPrimary,padding:"20px",gap:"16px",position:"relative"},children:[i.jsx(gy,{show:$}),g&&!g.includes(":")&&i.jsxs("div",{style:{padding:"12px 16px",background:o.error,color:o.textInverse,borderRadius:"6px",fontSize:"13px",fontFamily:m.body},children:["Error: ",g]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[J.length>0&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[i.jsx("label",{htmlFor:"mcp-server-select",style:{fontSize:"13px",fontFamily:m.body,color:o.textSecondary,fontWeight:"500"},children:"Server:"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:J.map(j=>i.jsx("button",{type:"button",onClick:()=>X(j),style:{padding:"10px 18px",background:q===j?o.accentBlue:o.bgSecondary,border:q===j?`2px solid ${o.accentBlue}`:`1px solid ${o.borderLight}`,borderRadius:"8px",color:q===j?o.textInverse:o.textPrimary,fontSize:"13px",fontFamily:m.body,fontWeight:q===j?"600":"500",cursor:"pointer",transition:"all 0.2s ease",boxShadow:q===j?`0 2px 4px ${o.shadowSm}`:"none"},onMouseEnter:N=>{q!==j&&(N.currentTarget.style.background=o.bgHover,N.currentTarget.style.borderColor=o.borderMedium,N.currentTarget.style.boxShadow=`0 2px 4px ${o.shadowSm}`)},onMouseLeave:N=>{q!==j&&(N.currentTarget.style.background=o.bgSecondary,N.currentTarget.style.borderColor=o.borderLight,N.currentTarget.style.boxShadow="none")},children:j},j))})]}),i.jsx("div",{style:{display:"flex",gap:"8px",borderBottom:`1px solid ${o.borderLight}`},children:["tools","prompts","resources"].map(j=>i.jsx("button",{type:"button",onClick:()=>s(j),style:{padding:"10px 18px",background:r===j?o.bgSecondary:"transparent",border:"none",borderBottom:`2px solid ${r===j?o.accentBlue:"transparent"}`,color:r===j?o.textPrimary:o.textSecondary,cursor:"pointer",fontSize:"13px",fontFamily:m.body,fontWeight:r===j?"500":"400",textTransform:"capitalize",borderRadius:"6px 6px 0 0",transition:"all 0.2s"},children:j},j))})]}),i.jsxs("div",{style:{flex:1,overflow:"hidden",minHeight:0},children:[r==="tools"&&i.jsx(Ty,{tools:u,selectedTool:y,onSelectTool:x,toolArgs:T,onToolArgsChange:v,toolResult:w,onCallTool:Ne,loading:f,toolsLoading:A,toolsLoaded:G,serverStatus:W,error:g,onRefresh:ve}),r==="prompts"&&i.jsx(my,{prompts:c,selectedPrompt:b,onSelectPrompt:_,promptArgs:M,onPromptArgsChange:E,promptResult:L,onGetPrompt:Re,loading:f,promptsLoading:K,promptsLoaded:Y,serverStatus:W,error:g,onRefresh:me}),r==="resources"&&i.jsx(wy,{resources:p,selectedResource:F,onSelectResource:D,resourceResult:U,onReadResource:he,loading:f,resourcesLoading:V,resourcesLoaded:ue,serverStatus:W,error:g,onRefresh:Ee})]})]})]})}const Gd=[{target:'[data-tour="tabs"]',title:"Welcome to MCP Shark!",content:i.jsxs("div",{children:[i.jsx("p",{style:{margin:"0 0 12px 0"},children:"MCP Shark is a powerful tool for monitoring and analyzing Model Context Protocol (MCP) communications. Let's get you started!"}),i.jsxs("p",{style:{margin:0},children:["First, you'll need to set up the MCP Shark server. Click on the"," ",i.jsx("strong",{children:"MCP Server Setup"})," tab to begin."]})]}),position:"bottom"},{target:'[data-tour="setup-tab"]',title:"Step 1: Open MCP Server Setup",content:i.jsxs("div",{children:[i.jsxs("p",{style:{margin:"0 0 8px 0"},children:["Click on the ",i.jsx("strong",{children:"MCP Server Setup"})," tab to configure and start the MCP Shark server."]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"This is where you'll configure your MCP servers and start monitoring."})]}),position:"bottom"},{target:'[data-tour="detected-editors"]',title:"Step 2: Select Your Configuration",content:i.jsxs("div",{children:[i.jsx("p",{style:{margin:"0 0 8px 0"},children:"MCP Shark automatically detects your IDE's MCP configuration files. You have two options:"}),i.jsxs("ul",{style:{margin:"0 0 8px 0",paddingLeft:"20px",fontSize:"13px"},children:[i.jsxs("li",{children:["Click on any ",i.jsx("strong",{children:"detected editor"})," (like Cursor or Windsurf) to use its config"]}),i.jsxs("li",{children:["Or click ",i.jsx("strong",{children:'"Select File"'})," to upload your own config file"]})]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"When you click a detected editor, the file path will automatically populate in the text box."})]}),position:"bottom"},{target:'[data-tour="select-file"]',title:"Alternative: Upload Your Config",content:i.jsxs("div",{children:[i.jsxs("p",{style:{margin:"0 0 8px 0"},children:["If you prefer, you can click ",i.jsx("strong",{children:'"Select File"'})," to upload your MCP configuration file directly."]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"Or manually enter the file path in the text box next to it."})]}),position:"bottom"},{target:'[data-tour="start-button"]',title:"Step 3: Start MCP Shark",content:i.jsxs("div",{children:[i.jsxs("p",{style:{margin:"0 0 8px 0"},children:["Once you've selected a configuration file (either from detected editors or uploaded), click ",i.jsx("strong",{children:'"Start MCP Shark"'})," to begin monitoring."]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"The server will start and begin capturing all MCP traffic between your IDE and servers."})]}),position:"top"},{target:'[data-tour="traffic-tab"]',title:"View Your Traffic",content:i.jsxs("div",{children:[i.jsxs("p",{style:{margin:"0 0 8px 0"},children:["After starting the server, switch to the ",i.jsx("strong",{children:"Traffic Capture"})," tab to see all HTTP requests and responses in real-time."]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"You can view traffic as a flat list, grouped by session, or grouped by server."})]}),position:"bottom"},{target:'[data-tour="smart-scan-tab"]',title:"Smart Scan - Security Analysis",content:i.jsxs("div",{children:[i.jsxs("p",{style:{margin:"0 0 8px 0"},children:["The ",i.jsx("strong",{children:"Smart Scan"})," tab provides AI-powered security analysis for your MCP servers. Discover servers, run security scans, and get detailed vulnerability reports."]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"Scan results are cached automatically, so you won't waste API calls on unchanged servers."})]}),position:"bottom"},{target:'[data-tour="help-button"]',title:"Need Help?",content:i.jsxs("div",{children:[i.jsxs("p",{style:{margin:"0 0 8px 0"},children:["Click the ",i.jsx("strong",{children:"Start Tour"})," button anytime to restart this guide or get help."]}),i.jsx("p",{style:{margin:0,fontSize:"12px",color:"#858585"},children:"You're all set! Start by configuring your MCP server, then watch the traffic flow."})]}),position:"left"}];function Ey(){const{activeTab:r,setActiveTab:s,requests:u,selected:c,setSelected:p,filters:f,setFilters:g,stats:y,firstRequestTime:x,showTour:T,setShowTour:v,prevTabRef:w,loadRequests:b}=fy(),[_,M]=P.useState(0);return P.useEffect(()=>{if(w.current!==r){const E=document.querySelector("[data-tab-content]");E&&Es(E,{duration:300}),w.current=r}},[r,w]),i.jsxs("div",{style:{display:"flex",height:"100vh",flexDirection:"column",background:o.bgPrimary},children:[T&&i.jsx(lh,{steps:Gd,onComplete:()=>v(!1),onSkip:()=>v(!1),onStepChange:E=>{const L=Gd[E];L&&(L.target==='[data-tour="setup-tab"]'||L.target==='[data-tour="detected-editors"]'||L.target==='[data-tour="select-file"]'||L.target==='[data-tour="start-button"]'?r!=="setup"&&s("setup"):L.target==='[data-tour="traffic-tab"]'?r!=="traffic"&&s("traffic"):L.target==='[data-tour="smart-scan-tab"]'&&r!=="smart-scan"&&s("smart-scan"))}},_),i.jsx("div",{style:{position:"relative"},"data-tour":"tabs",children:i.jsx(Cx,{activeTab:r,onTabChange:s})}),i.jsx(Fx,{onHelpClick:()=>{T?(v(!1),M(E=>E+1),setTimeout(()=>{v(!0)},100)):(M(E=>E+1),v(!0))}}),r==="traffic"&&i.jsx(dy,{requests:u,selected:c,onSelect:p,filters:f,onFilterChange:g,stats:y,firstRequestTime:x,onClear:()=>{p(null),b()}}),r==="logs"&&i.jsx("div",{"data-tab-content":!0,style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:i.jsx(Dg,{})}),r==="setup"&&i.jsx("div",{"data-tab-content":!0,style:{flex:1,overflow:"hidden",width:"100%",height:"100%"},children:i.jsx(Xg,{})}),r==="playground"&&i.jsx("div",{"data-tab-content":!0,style:{flex:1,overflow:"hidden",width:"100%",height:"100%"},children:i.jsx(zy,{})}),r==="smart-scan"&&i.jsx("div",{"data-tab-content":!0,style:{flex:1,overflow:"auto",width:"100%",height:"100%"},children:i.jsx(Bh,{})}),r==="shutdown"&&i.jsx("div",{"data-tab-content":!0,style:{flex:1,overflow:"hidden",width:"100%",height:"100%"},children:i.jsx(sh,{})})]})}Wf.createRoot(document.getElementById("root")).render(i.jsx(ri.StrictMode,{children:i.jsx(Ey,{})}));
|