teleton 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,72 +0,0 @@
1
- var Xf=Object.defineProperty;var Zf=(o,a,u)=>a in o?Xf(o,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[a]=u;var Dt=(o,a,u)=>Zf(o,typeof a!="symbol"?a+"":a,u);function ep(o,a){for(var u=0;u<a.length;u++){const d=a[u];if(typeof d!="string"&&!Array.isArray(d)){for(const p in d)if(p!=="default"&&!(p in o)){const m=Object.getOwnPropertyDescriptor(d,p);m&&Object.defineProperty(o,p,m.get?m:{enumerable:!0,get:()=>d[p]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))d(p);new MutationObserver(p=>{for(const m of p)if(m.type==="childList")for(const S of m.addedNodes)S.tagName==="LINK"&&S.rel==="modulepreload"&&d(S)}).observe(document,{childList:!0,subtree:!0});function u(p){const m={};return p.integrity&&(m.integrity=p.integrity),p.referrerPolicy&&(m.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?m.credentials="include":p.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function d(p){if(p.ep)return;p.ep=!0;const m=u(p);fetch(p.href,m)}})();function tp(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var si={exports:{}},Xr={},oi={exports:{}},he={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var uc;function np(){if(uc)return he;uc=1;var o=Symbol.for("react.element"),a=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),S=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),k=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),j=Symbol.iterator;function I(C){return C===null||typeof C!="object"?null:(C=j&&C[j]||C["@@iterator"],typeof C=="function"?C:null)}var U={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,y={};function N(C,D,fe){this.props=C,this.context=D,this.refs=y,this.updater=fe||U}N.prototype.isReactComponent={},N.prototype.setState=function(C,D){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,D,"setState")},N.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function z(){}z.prototype=N.prototype;function W(C,D,fe){this.props=C,this.context=D,this.refs=y,this.updater=fe||U}var L=W.prototype=new z;L.constructor=W,O(L,N.prototype),L.isPureReactComponent=!0;var P=Array.isArray,M=Object.prototype.hasOwnProperty,b={current:null},ce={key:!0,ref:!0,__self:!0,__source:!0};function ge(C,D,fe){var pe,ve={},xe=null,Ne=null;if(D!=null)for(pe in D.ref!==void 0&&(Ne=D.ref),D.key!==void 0&&(xe=""+D.key),D)M.call(D,pe)&&!ce.hasOwnProperty(pe)&&(ve[pe]=D[pe]);var we=arguments.length-2;if(we===1)ve.children=fe;else if(1<we){for(var Ee=Array(we),Ze=0;Ze<we;Ze++)Ee[Ze]=arguments[Ze+2];ve.children=Ee}if(C&&C.defaultProps)for(pe in we=C.defaultProps,we)ve[pe]===void 0&&(ve[pe]=we[pe]);return{$$typeof:o,type:C,key:xe,ref:Ne,props:ve,_owner:b.current}}function X(C,D){return{$$typeof:o,type:C.type,key:D,ref:C.ref,props:C.props,_owner:C._owner}}function me(C){return typeof C=="object"&&C!==null&&C.$$typeof===o}function De(C){var D={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(fe){return D[fe]})}var Ue=/\/+/g;function J(C,D){return typeof C=="object"&&C!==null&&C.key!=null?De(""+C.key):D.toString(36)}function ie(C,D,fe,pe,ve){var xe=typeof C;(xe==="undefined"||xe==="boolean")&&(C=null);var Ne=!1;if(C===null)Ne=!0;else switch(xe){case"string":case"number":Ne=!0;break;case"object":switch(C.$$typeof){case o:case a:Ne=!0}}if(Ne)return Ne=C,ve=ve(Ne),C=pe===""?"."+J(Ne,0):pe,P(ve)?(fe="",C!=null&&(fe=C.replace(Ue,"$&/")+"/"),ie(ve,D,fe,"",function(Ze){return Ze})):ve!=null&&(me(ve)&&(ve=X(ve,fe+(!ve.key||Ne&&Ne.key===ve.key?"":(""+ve.key).replace(Ue,"$&/")+"/")+C)),D.push(ve)),1;if(Ne=0,pe=pe===""?".":pe+":",P(C))for(var we=0;we<C.length;we++){xe=C[we];var Ee=pe+J(xe,we);Ne+=ie(xe,D,fe,Ee,ve)}else if(Ee=I(C),typeof Ee=="function")for(C=Ee.call(C),we=0;!(xe=C.next()).done;)xe=xe.value,Ee=pe+J(xe,we++),Ne+=ie(xe,D,fe,Ee,ve);else if(xe==="object")throw D=String(C),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return Ne}function V(C,D,fe){if(C==null)return C;var pe=[],ve=0;return ie(C,pe,"","",function(xe){return D.call(fe,xe,ve++)}),pe}function ae(C){if(C._status===-1){var D=C._result;D=D(),D.then(function(fe){(C._status===0||C._status===-1)&&(C._status=1,C._result=fe)},function(fe){(C._status===0||C._status===-1)&&(C._status=2,C._result=fe)}),C._status===-1&&(C._status=0,C._result=D)}if(C._status===1)return C._result.default;throw C._result}var ue={current:null},K={transition:null},re={ReactCurrentDispatcher:ue,ReactCurrentBatchConfig:K,ReactCurrentOwner:b};function G(){throw Error("act(...) is not supported in production builds of React.")}return he.Children={map:V,forEach:function(C,D,fe){V(C,function(){D.apply(this,arguments)},fe)},count:function(C){var D=0;return V(C,function(){D++}),D},toArray:function(C){return V(C,function(D){return D})||[]},only:function(C){if(!me(C))throw Error("React.Children.only expected to receive a single React element child.");return C}},he.Component=N,he.Fragment=u,he.Profiler=p,he.PureComponent=W,he.StrictMode=d,he.Suspense=v,he.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=re,he.act=G,he.cloneElement=function(C,D,fe){if(C==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+C+".");var pe=O({},C.props),ve=C.key,xe=C.ref,Ne=C._owner;if(D!=null){if(D.ref!==void 0&&(xe=D.ref,Ne=b.current),D.key!==void 0&&(ve=""+D.key),C.type&&C.type.defaultProps)var we=C.type.defaultProps;for(Ee in D)M.call(D,Ee)&&!ce.hasOwnProperty(Ee)&&(pe[Ee]=D[Ee]===void 0&&we!==void 0?we[Ee]:D[Ee])}var Ee=arguments.length-2;if(Ee===1)pe.children=fe;else if(1<Ee){we=Array(Ee);for(var Ze=0;Ze<Ee;Ze++)we[Ze]=arguments[Ze+2];pe.children=we}return{$$typeof:o,type:C.type,key:ve,ref:xe,props:pe,_owner:Ne}},he.createContext=function(C){return C={$$typeof:S,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},C.Provider={$$typeof:m,_context:C},C.Consumer=C},he.createElement=ge,he.createFactory=function(C){var D=ge.bind(null,C);return D.type=C,D},he.createRef=function(){return{current:null}},he.forwardRef=function(C){return{$$typeof:w,render:C}},he.isValidElement=me,he.lazy=function(C){return{$$typeof:_,_payload:{_status:-1,_result:C},_init:ae}},he.memo=function(C,D){return{$$typeof:k,type:C,compare:D===void 0?null:D}},he.startTransition=function(C){var D=K.transition;K.transition={};try{C()}finally{K.transition=D}},he.unstable_act=G,he.useCallback=function(C,D){return ue.current.useCallback(C,D)},he.useContext=function(C){return ue.current.useContext(C)},he.useDebugValue=function(){},he.useDeferredValue=function(C){return ue.current.useDeferredValue(C)},he.useEffect=function(C,D){return ue.current.useEffect(C,D)},he.useId=function(){return ue.current.useId()},he.useImperativeHandle=function(C,D,fe){return ue.current.useImperativeHandle(C,D,fe)},he.useInsertionEffect=function(C,D){return ue.current.useInsertionEffect(C,D)},he.useLayoutEffect=function(C,D){return ue.current.useLayoutEffect(C,D)},he.useMemo=function(C,D){return ue.current.useMemo(C,D)},he.useReducer=function(C,D,fe){return ue.current.useReducer(C,D,fe)},he.useRef=function(C){return ue.current.useRef(C)},he.useState=function(C){return ue.current.useState(C)},he.useSyncExternalStore=function(C,D,fe){return ue.current.useSyncExternalStore(C,D,fe)},he.useTransition=function(){return ue.current.useTransition()},he.version="18.3.1",he}var cc;function yi(){return cc||(cc=1,oi.exports=np()),oi.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var dc;function rp(){if(dc)return Xr;dc=1;var o=yi(),a=Symbol.for("react.element"),u=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,p=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function S(w,v,k){var _,j={},I=null,U=null;k!==void 0&&(I=""+k),v.key!==void 0&&(I=""+v.key),v.ref!==void 0&&(U=v.ref);for(_ in v)d.call(v,_)&&!m.hasOwnProperty(_)&&(j[_]=v[_]);if(w&&w.defaultProps)for(_ in v=w.defaultProps,v)j[_]===void 0&&(j[_]=v[_]);return{$$typeof:a,type:w,key:I,ref:U,props:j,_owner:p.current}}return Xr.Fragment=u,Xr.jsx=S,Xr.jsxs=S,Xr}var fc;function lp(){return fc||(fc=1,si.exports=rp()),si.exports}var l=lp(),f=yi();const Mc=tp(f),sp=ep({__proto__:null,default:Mc},[f]);var ps={},ii={exports:{}},ut={},ai={exports:{}},ui={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var pc;function op(){return pc||(pc=1,(function(o){function a(K,re){var G=K.length;K.push(re);e:for(;0<G;){var C=G-1>>>1,D=K[C];if(0<p(D,re))K[C]=re,K[G]=D,G=C;else break e}}function u(K){return K.length===0?null:K[0]}function d(K){if(K.length===0)return null;var re=K[0],G=K.pop();if(G!==re){K[0]=G;e:for(var C=0,D=K.length,fe=D>>>1;C<fe;){var pe=2*(C+1)-1,ve=K[pe],xe=pe+1,Ne=K[xe];if(0>p(ve,G))xe<D&&0>p(Ne,ve)?(K[C]=Ne,K[xe]=G,C=xe):(K[C]=ve,K[pe]=G,C=pe);else if(xe<D&&0>p(Ne,G))K[C]=Ne,K[xe]=G,C=xe;else break e}}return re}function p(K,re){var G=K.sortIndex-re.sortIndex;return G!==0?G:K.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var m=performance;o.unstable_now=function(){return m.now()}}else{var S=Date,w=S.now();o.unstable_now=function(){return S.now()-w}}var v=[],k=[],_=1,j=null,I=3,U=!1,O=!1,y=!1,N=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function L(K){for(var re=u(k);re!==null;){if(re.callback===null)d(k);else if(re.startTime<=K)d(k),re.sortIndex=re.expirationTime,a(v,re);else break;re=u(k)}}function P(K){if(y=!1,L(K),!O)if(u(v)!==null)O=!0,ae(M);else{var re=u(k);re!==null&&ue(P,re.startTime-K)}}function M(K,re){O=!1,y&&(y=!1,z(ge),ge=-1),U=!0;var G=I;try{for(L(re),j=u(v);j!==null&&(!(j.expirationTime>re)||K&&!De());){var C=j.callback;if(typeof C=="function"){j.callback=null,I=j.priorityLevel;var D=C(j.expirationTime<=re);re=o.unstable_now(),typeof D=="function"?j.callback=D:j===u(v)&&d(v),L(re)}else d(v);j=u(v)}if(j!==null)var fe=!0;else{var pe=u(k);pe!==null&&ue(P,pe.startTime-re),fe=!1}return fe}finally{j=null,I=G,U=!1}}var b=!1,ce=null,ge=-1,X=5,me=-1;function De(){return!(o.unstable_now()-me<X)}function Ue(){if(ce!==null){var K=o.unstable_now();me=K;var re=!0;try{re=ce(!0,K)}finally{re?J():(b=!1,ce=null)}}else b=!1}var J;if(typeof W=="function")J=function(){W(Ue)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,V=ie.port2;ie.port1.onmessage=Ue,J=function(){V.postMessage(null)}}else J=function(){N(Ue,0)};function ae(K){ce=K,b||(b=!0,J())}function ue(K,re){ge=N(function(){K(o.unstable_now())},re)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(K){K.callback=null},o.unstable_continueExecution=function(){O||U||(O=!0,ae(M))},o.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<K?Math.floor(1e3/K):5},o.unstable_getCurrentPriorityLevel=function(){return I},o.unstable_getFirstCallbackNode=function(){return u(v)},o.unstable_next=function(K){switch(I){case 1:case 2:case 3:var re=3;break;default:re=I}var G=I;I=re;try{return K()}finally{I=G}},o.unstable_pauseExecution=function(){},o.unstable_requestPaint=function(){},o.unstable_runWithPriority=function(K,re){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var G=I;I=K;try{return re()}finally{I=G}},o.unstable_scheduleCallback=function(K,re,G){var C=o.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?C+G:C):G=C,K){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=G+D,K={id:_++,callback:re,priorityLevel:K,startTime:G,expirationTime:D,sortIndex:-1},G>C?(K.sortIndex=G,a(k,K),u(v)===null&&K===u(k)&&(y?(z(ge),ge=-1):y=!0,ue(P,G-C))):(K.sortIndex=D,a(v,K),O||U||(O=!0,ae(M))),K},o.unstable_shouldYield=De,o.unstable_wrapCallback=function(K){var re=I;return function(){var G=I;I=re;try{return K.apply(this,arguments)}finally{I=G}}}})(ui)),ui}var hc;function ip(){return hc||(hc=1,ai.exports=op()),ai.exports}/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var mc;function ap(){if(mc)return ut;mc=1;var o=yi(),a=ip();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 d=new Set,p={};function m(e,t){S(e,t),S(e+"Capture",t)}function S(e,t){for(p[e]=t,e=0;e<t.length;e++)d.add(t[e])}var w=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,k=/^[: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]*$/,_={},j={};function I(e){return v.call(j,e)?!0:v.call(_,e)?!1:k.test(e)?j[e]=!0:(_[e]=!0,!1)}function U(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function O(e,t,n,r){if(t===null||typeof t>"u"||U(e,t,n,r))return!0;if(r)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 y(e,t,n,r,s,i,c){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=c}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new y(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];N[t]=new y(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new y(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new y(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){N[e]=new y(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new y(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new y(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new y(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new y(e,5,!1,e.toLowerCase(),null,!1,!1)});var z=/[\-:]([a-z])/g;function W(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(z,W);N[t]=new y(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(z,W);N[t]=new y(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(z,W);N[t]=new y(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new y(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new y(e,1,!1,e.toLowerCase(),null,!0,!0)});function L(e,t,n,r){var s=N.hasOwnProperty(t)?N[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(O(t,n,s,r)&&(n=null),r||s===null?I(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var P=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,M=Symbol.for("react.element"),b=Symbol.for("react.portal"),ce=Symbol.for("react.fragment"),ge=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),me=Symbol.for("react.provider"),De=Symbol.for("react.context"),Ue=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),ie=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),ue=Symbol.for("react.offscreen"),K=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var G=Object.assign,C;function D(e){if(C===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);C=t&&t[1]||""}return`
34
- `+C+e}var fe=!1;function pe(e,t){if(!e||fe)return"";fe=!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(R){var r=R}Reflect.construct(e,[],t)}else{try{t.call()}catch(R){r=R}e.call(t.prototype)}else{try{throw Error()}catch(R){r=R}e()}}catch(R){if(R&&r&&typeof R.stack=="string"){for(var s=R.stack.split(`
35
- `),i=r.stack.split(`
36
- `),c=s.length-1,h=i.length-1;1<=c&&0<=h&&s[c]!==i[h];)h--;for(;1<=c&&0<=h;c--,h--)if(s[c]!==i[h]){if(c!==1||h!==1)do if(c--,h--,0>h||s[c]!==i[h]){var g=`
37
- `+s[c].replace(" at new "," at ");return e.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",e.displayName)),g}while(1<=c&&0<=h);break}}}finally{fe=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?D(e):""}function ve(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=pe(e.type,!1),e;case 11:return e=pe(e.type.render,!1),e;case 1:return e=pe(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 ce:return"Fragment";case b:return"Portal";case X:return"Profiler";case ge:return"StrictMode";case J:return"Suspense";case ie:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case De:return(e.displayName||"Context")+".Consumer";case me:return(e._context.displayName||"Context")+".Provider";case Ue:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:xe(e.type)||"Memo";case ae:t=e._payload,e=e._init;try{return xe(e(t))}catch{}}return null}function Ne(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===ge?"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 we(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ze(e){var t=Ee(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(c){r=""+c,i.call(this,c)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(c){r=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rn(e){e._valueTracker||(e._valueTracker=Ze(e))}function nl(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ee(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function zn(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 fr(e,t){var n=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function pr(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=we(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function In(e,t){t=t.checked,t!=null&&L(e,"checked",t,!1)}function Ht(e,t){In(e,t);var n=we(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Y(e,t.type,n):t.hasOwnProperty("defaultValue")&&Y(e,t.type,we(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Q(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="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 Y(e,t,n){(t!=="number"||zn(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var H=Array.isArray;function Le(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+we(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function On(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(u(91));return G({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function mt(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(H(n)){if(1<n.length)throw Error(u(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:we(n)}}function hr(e,t){var n=we(t.value),r=we(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function rl(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function mr(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 Dn(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?mr(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Mn,ll=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Mn=Mn||document.createElement("div"),Mn.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Mn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ke(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Tt={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},An=["Webkit","ms","Moz","O"];Object.keys(Tt).forEach(function(e){An.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tt[t]=Tt[e]})});function sl(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Tt.hasOwnProperty(e)&&Tt[e]?(""+t).trim():t+"px"}function Ni(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=sl(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var nd=G({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 gs(e,t){if(t){if(nd[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 ys(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 vs=null;function xs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ss=null,Fn=null,Bn=null;function Ei(e){if(e=Ar(e)){if(typeof Ss!="function")throw Error(u(280));var t=e.stateNode;t&&(t=Pl(t),Ss(e.stateNode,e.type,t))}}function _i(e){Fn?Bn?Bn.push(e):Bn=[e]:Fn=e}function Pi(){if(Fn){var e=Fn,t=Bn;if(Bn=Fn=null,Ei(e),t)for(e=0;e<t.length;e++)Ei(t[e])}}function Ti(e,t){return e(t)}function Li(){}var js=!1;function Ri(e,t,n){if(js)return e(t,n);js=!0;try{return Ti(e,t,n)}finally{js=!1,(Fn!==null||Bn!==null)&&(Li(),Pi())}}function gr(e,t){var n=e.stateNode;if(n===null)return null;var r=Pl(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var ws=!1;if(w)try{var yr={};Object.defineProperty(yr,"passive",{get:function(){ws=!0}}),window.addEventListener("test",yr,yr),window.removeEventListener("test",yr,yr)}catch{ws=!1}function rd(e,t,n,r,s,i,c,h,g){var R=Array.prototype.slice.call(arguments,3);try{t.apply(n,R)}catch(F){this.onError(F)}}var vr=!1,ol=null,il=!1,ks=null,ld={onError:function(e){vr=!0,ol=e}};function sd(e,t,n,r,s,i,c,h,g){vr=!1,ol=null,rd.apply(ld,arguments)}function od(e,t,n,r,s,i,c,h,g){if(sd.apply(this,arguments),vr){if(vr){var R=ol;vr=!1,ol=null}else throw Error(u(198));il||(il=!0,ks=R)}}function gn(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 zi(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 Ii(e){if(gn(e)!==e)throw Error(u(188))}function id(e){var t=e.alternate;if(!t){if(t=gn(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return Ii(s),e;if(i===r)return Ii(s),t;i=i.sibling}throw Error(u(188))}if(n.return!==r.return)n=s,r=i;else{for(var c=!1,h=s.child;h;){if(h===n){c=!0,n=s,r=i;break}if(h===r){c=!0,r=s,n=i;break}h=h.sibling}if(!c){for(h=i.child;h;){if(h===n){c=!0,n=i,r=s;break}if(h===r){c=!0,r=i,n=s;break}h=h.sibling}if(!c)throw Error(u(189))}}if(n.alternate!==r)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?e:t}function Oi(e){return e=id(e),e!==null?Di(e):null}function Di(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Di(e);if(t!==null)return t;e=e.sibling}return null}var Mi=a.unstable_scheduleCallback,Ai=a.unstable_cancelCallback,ad=a.unstable_shouldYield,ud=a.unstable_requestPaint,Me=a.unstable_now,cd=a.unstable_getCurrentPriorityLevel,Cs=a.unstable_ImmediatePriority,Fi=a.unstable_UserBlockingPriority,al=a.unstable_NormalPriority,dd=a.unstable_LowPriority,Bi=a.unstable_IdlePriority,ul=null,Lt=null;function fd(e){if(Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(ul,e,void 0,(e.current.flags&128)===128)}catch{}}var wt=Math.clz32?Math.clz32:md,pd=Math.log,hd=Math.LN2;function md(e){return e>>>=0,e===0?32:31-(pd(e)/hd|0)|0}var cl=64,dl=4194304;function xr(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 fl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,c=n&268435455;if(c!==0){var h=c&~s;h!==0?r=xr(h):(i&=c,i!==0&&(r=xr(i)))}else c=n&~s,c!==0?r=xr(c):i!==0&&(r=xr(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&s)===0&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-wt(t),s=1<<n,r|=e[n],t&=~s;return r}function gd(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 yd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var c=31-wt(i),h=1<<c,g=s[c];g===-1?((h&n)===0||(h&r)!==0)&&(s[c]=gd(h,t)):g<=t&&(e.expiredLanes|=h),i&=~h}}function Ns(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ui(){var e=cl;return cl<<=1,(cl&4194240)===0&&(cl=64),e}function Es(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Sr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wt(t),e[t]=n}function vd(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 r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-wt(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function _s(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wt(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var Ce=0;function Wi(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var $i,Ps,bi,Vi,Ki,Ts=!1,pl=[],Qt=null,Yt=null,Jt=null,jr=new Map,wr=new Map,qt=[],xd="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 Hi(e,t){switch(e){case"focusin":case"focusout":Qt=null;break;case"dragenter":case"dragleave":Yt=null;break;case"mouseover":case"mouseout":Jt=null;break;case"pointerover":case"pointerout":jr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wr.delete(t.pointerId)}}function kr(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Ar(t),t!==null&&Ps(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Sd(e,t,n,r,s){switch(t){case"focusin":return Qt=kr(Qt,e,t,n,r,s),!0;case"dragenter":return Yt=kr(Yt,e,t,n,r,s),!0;case"mouseover":return Jt=kr(Jt,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return jr.set(i,kr(jr.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,wr.set(i,kr(wr.get(i)||null,e,t,n,r,s)),!0}return!1}function Qi(e){var t=yn(e.target);if(t!==null){var n=gn(t);if(n!==null){if(t=n.tag,t===13){if(t=zi(n),t!==null){e.blockedOn=t,Ki(e.priority,function(){bi(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 hl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Rs(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);vs=r,n.target.dispatchEvent(r),vs=null}else return t=Ar(n),t!==null&&Ps(t),e.blockedOn=n,!1;t.shift()}return!0}function Yi(e,t,n){hl(e)&&n.delete(t)}function jd(){Ts=!1,Qt!==null&&hl(Qt)&&(Qt=null),Yt!==null&&hl(Yt)&&(Yt=null),Jt!==null&&hl(Jt)&&(Jt=null),jr.forEach(Yi),wr.forEach(Yi)}function Cr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ts||(Ts=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,jd)))}function Nr(e){function t(s){return Cr(s,e)}if(0<pl.length){Cr(pl[0],e);for(var n=1;n<pl.length;n++){var r=pl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Qt!==null&&Cr(Qt,e),Yt!==null&&Cr(Yt,e),Jt!==null&&Cr(Jt,e),jr.forEach(t),wr.forEach(t),n=0;n<qt.length;n++)r=qt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<qt.length&&(n=qt[0],n.blockedOn===null);)Qi(n),n.blockedOn===null&&qt.shift()}var Un=P.ReactCurrentBatchConfig,ml=!0;function wd(e,t,n,r){var s=Ce,i=Un.transition;Un.transition=null;try{Ce=1,Ls(e,t,n,r)}finally{Ce=s,Un.transition=i}}function kd(e,t,n,r){var s=Ce,i=Un.transition;Un.transition=null;try{Ce=4,Ls(e,t,n,r)}finally{Ce=s,Un.transition=i}}function Ls(e,t,n,r){if(ml){var s=Rs(e,t,n,r);if(s===null)Ys(e,t,r,gl,n),Hi(e,r);else if(Sd(s,e,t,n,r))r.stopPropagation();else if(Hi(e,r),t&4&&-1<xd.indexOf(e)){for(;s!==null;){var i=Ar(s);if(i!==null&&$i(i),i=Rs(e,t,n,r),i===null&&Ys(e,t,r,gl,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Ys(e,t,r,null,n)}}var gl=null;function Rs(e,t,n,r){if(gl=null,e=xs(r),e=yn(e),e!==null)if(t=gn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=zi(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 gl=e,null}function Ji(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(cd()){case Cs:return 1;case Fi:return 4;case al:case dd:return 16;case Bi:return 536870912;default:return 16}default:return 16}}var Gt=null,zs=null,yl=null;function qi(){if(yl)return yl;var e,t=zs,n=t.length,r,s="value"in Gt?Gt.value:Gt.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var c=n-e;for(r=1;r<=c&&t[n-r]===s[i-r];r++);return yl=s.slice(e,1<r?1-r:void 0)}function vl(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 xl(){return!0}function Gi(){return!1}function ct(e){function t(n,r,s,i,c){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=c,this.currentTarget=null;for(var h in e)e.hasOwnProperty(h)&&(n=e[h],this[h]=n?n(i):i[h]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?xl:Gi,this.isPropagationStopped=Gi,this}return G(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=xl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=xl)},persist:function(){},isPersistent:xl}),t}var Wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Is=ct(Wn),Er=G({},Wn,{view:0,detail:0}),Cd=ct(Er),Os,Ds,_r,Sl=G({},Er,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:As,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!==_r&&(_r&&e.type==="mousemove"?(Os=e.screenX-_r.screenX,Ds=e.screenY-_r.screenY):Ds=Os=0,_r=e),Os)},movementY:function(e){return"movementY"in e?e.movementY:Ds}}),Xi=ct(Sl),Nd=G({},Sl,{dataTransfer:0}),Ed=ct(Nd),_d=G({},Er,{relatedTarget:0}),Ms=ct(_d),Pd=G({},Wn,{animationName:0,elapsedTime:0,pseudoElement:0}),Td=ct(Pd),Ld=G({},Wn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Rd=ct(Ld),zd=G({},Wn,{data:0}),Zi=ct(zd),Id={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Od={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"},Dd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Md(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dd[e])?!!t[e]:!1}function As(){return Md}var Ad=G({},Er,{key:function(e){if(e.key){var t=Id[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=vl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Od[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:As,charCode:function(e){return e.type==="keypress"?vl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Fd=ct(Ad),Bd=G({},Sl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ea=ct(Bd),Ud=G({},Er,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:As}),Wd=ct(Ud),$d=G({},Wn,{propertyName:0,elapsedTime:0,pseudoElement:0}),bd=ct($d),Vd=G({},Sl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Kd=ct(Vd),Hd=[9,13,27,32],Fs=w&&"CompositionEvent"in window,Pr=null;w&&"documentMode"in document&&(Pr=document.documentMode);var Qd=w&&"TextEvent"in window&&!Pr,ta=w&&(!Fs||Pr&&8<Pr&&11>=Pr),na=" ",ra=!1;function la(e,t){switch(e){case"keyup":return Hd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sa(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $n=!1;function Yd(e,t){switch(e){case"compositionend":return sa(t);case"keypress":return t.which!==32?null:(ra=!0,na);case"textInput":return e=t.data,e===na&&ra?null:e;default:return null}}function Jd(e,t){if($n)return e==="compositionend"||!Fs&&la(e,t)?(e=qi(),yl=zs=Gt=null,$n=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ta&&t.locale!=="ko"?null:t.data;default:return null}}var qd={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 oa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!qd[e.type]:t==="textarea"}function ia(e,t,n,r){_i(r),t=Nl(t,"onChange"),0<t.length&&(n=new Is("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Tr=null,Lr=null;function Gd(e){Na(e,0)}function jl(e){var t=Qn(e);if(nl(t))return e}function Xd(e,t){if(e==="change")return t}var aa=!1;if(w){var Bs;if(w){var Us="oninput"in document;if(!Us){var ua=document.createElement("div");ua.setAttribute("oninput","return;"),Us=typeof ua.oninput=="function"}Bs=Us}else Bs=!1;aa=Bs&&(!document.documentMode||9<document.documentMode)}function ca(){Tr&&(Tr.detachEvent("onpropertychange",da),Lr=Tr=null)}function da(e){if(e.propertyName==="value"&&jl(Lr)){var t=[];ia(t,Lr,e,xs(e)),Ri(Gd,t)}}function Zd(e,t,n){e==="focusin"?(ca(),Tr=t,Lr=n,Tr.attachEvent("onpropertychange",da)):e==="focusout"&&ca()}function ef(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return jl(Lr)}function tf(e,t){if(e==="click")return jl(t)}function nf(e,t){if(e==="input"||e==="change")return jl(t)}function rf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:rf;function Rr(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!v.call(t,s)||!kt(e[s],t[s]))return!1}return!0}function fa(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pa(e,t){var n=fa(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fa(n)}}function ha(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ha(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ma(){for(var e=window,t=zn();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=zn(e.document)}return t}function Ws(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 lf(e){var t=ma(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ha(n.ownerDocument.documentElement,n)){if(r!==null&&Ws(n)){if(t=r.start,e=r.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 s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=pa(n,i);var c=pa(n,r);s&&c&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==c.node||e.focusOffset!==c.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(c.node,c.offset)):(t.setEnd(c.node,c.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 sf=w&&"documentMode"in document&&11>=document.documentMode,bn=null,$s=null,zr=null,bs=!1;function ga(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bs||bn==null||bn!==zn(r)||(r=bn,"selectionStart"in r&&Ws(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&Rr(zr,r)||(zr=r,r=Nl($s,"onSelect"),0<r.length&&(t=new Is("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=bn)))}function wl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Vn={animationend:wl("Animation","AnimationEnd"),animationiteration:wl("Animation","AnimationIteration"),animationstart:wl("Animation","AnimationStart"),transitionend:wl("Transition","TransitionEnd")},Vs={},ya={};w&&(ya=document.createElement("div").style,"AnimationEvent"in window||(delete Vn.animationend.animation,delete Vn.animationiteration.animation,delete Vn.animationstart.animation),"TransitionEvent"in window||delete Vn.transitionend.transition);function kl(e){if(Vs[e])return Vs[e];if(!Vn[e])return e;var t=Vn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ya)return Vs[e]=t[n];return e}var va=kl("animationend"),xa=kl("animationiteration"),Sa=kl("animationstart"),ja=kl("transitionend"),wa=new Map,ka="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 Xt(e,t){wa.set(e,t),m(t,[e])}for(var Ks=0;Ks<ka.length;Ks++){var Hs=ka[Ks],of=Hs.toLowerCase(),af=Hs[0].toUpperCase()+Hs.slice(1);Xt(of,"on"+af)}Xt(va,"onAnimationEnd"),Xt(xa,"onAnimationIteration"),Xt(Sa,"onAnimationStart"),Xt("dblclick","onDoubleClick"),Xt("focusin","onFocus"),Xt("focusout","onBlur"),Xt(ja,"onTransitionEnd"),S("onMouseEnter",["mouseout","mouseover"]),S("onMouseLeave",["mouseout","mouseover"]),S("onPointerEnter",["pointerout","pointerover"]),S("onPointerLeave",["pointerout","pointerover"]),m("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),m("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),m("onBeforeInput",["compositionend","keypress","textInput","paste"]),m("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ir="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(" "),uf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ir));function Ca(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,od(r,t,void 0,e),e.currentTarget=null}function Na(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var c=r.length-1;0<=c;c--){var h=r[c],g=h.instance,R=h.currentTarget;if(h=h.listener,g!==i&&s.isPropagationStopped())break e;Ca(s,h,R),i=g}else for(c=0;c<r.length;c++){if(h=r[c],g=h.instance,R=h.currentTarget,h=h.listener,g!==i&&s.isPropagationStopped())break e;Ca(s,h,R),i=g}}}if(il)throw e=ks,il=!1,ks=null,e}function Pe(e,t){var n=t[eo];n===void 0&&(n=t[eo]=new Set);var r=e+"__bubble";n.has(r)||(Ea(t,e,2,!1),n.add(r))}function Qs(e,t,n){var r=0;t&&(r|=4),Ea(n,e,r,t)}var Cl="_reactListening"+Math.random().toString(36).slice(2);function Or(e){if(!e[Cl]){e[Cl]=!0,d.forEach(function(n){n!=="selectionchange"&&(uf.has(n)||Qs(n,!1,e),Qs(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cl]||(t[Cl]=!0,Qs("selectionchange",!1,t))}}function Ea(e,t,n,r){switch(Ji(t)){case 1:var s=wd;break;case 4:s=kd;break;default:s=Ls}n=s.bind(null,t,n,e),s=void 0,!ws||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Ys(e,t,n,r,s){var i=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var c=r.tag;if(c===3||c===4){var h=r.stateNode.containerInfo;if(h===s||h.nodeType===8&&h.parentNode===s)break;if(c===4)for(c=r.return;c!==null;){var g=c.tag;if((g===3||g===4)&&(g=c.stateNode.containerInfo,g===s||g.nodeType===8&&g.parentNode===s))return;c=c.return}for(;h!==null;){if(c=yn(h),c===null)return;if(g=c.tag,g===5||g===6){r=i=c;continue e}h=h.parentNode}}r=r.return}Ri(function(){var R=i,F=xs(n),B=[];e:{var A=wa.get(e);if(A!==void 0){var q=Is,ee=e;switch(e){case"keypress":if(vl(n)===0)break e;case"keydown":case"keyup":q=Fd;break;case"focusin":ee="focus",q=Ms;break;case"focusout":ee="blur",q=Ms;break;case"beforeblur":case"afterblur":q=Ms;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":q=Xi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=Ed;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=Wd;break;case va:case xa:case Sa:q=Td;break;case ja:q=bd;break;case"scroll":q=Cd;break;case"wheel":q=Kd;break;case"copy":case"cut":case"paste":q=Rd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=ea}var te=(t&4)!==0,Ae=!te&&e==="scroll",E=te?A!==null?A+"Capture":null:A;te=[];for(var x=R,T;x!==null;){T=x;var $=T.stateNode;if(T.tag===5&&$!==null&&(T=$,E!==null&&($=gr(x,E),$!=null&&te.push(Dr(x,$,T)))),Ae)break;x=x.return}0<te.length&&(A=new q(A,ee,null,n,F),B.push({event:A,listeners:te}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",A&&n!==vs&&(ee=n.relatedTarget||n.fromElement)&&(yn(ee)||ee[At]))break e;if((q||A)&&(A=F.window===F?F:(A=F.ownerDocument)?A.defaultView||A.parentWindow:window,q?(ee=n.relatedTarget||n.toElement,q=R,ee=ee?yn(ee):null,ee!==null&&(Ae=gn(ee),ee!==Ae||ee.tag!==5&&ee.tag!==6)&&(ee=null)):(q=null,ee=R),q!==ee)){if(te=Xi,$="onMouseLeave",E="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(te=ea,$="onPointerLeave",E="onPointerEnter",x="pointer"),Ae=q==null?A:Qn(q),T=ee==null?A:Qn(ee),A=new te($,x+"leave",q,n,F),A.target=Ae,A.relatedTarget=T,$=null,yn(F)===R&&(te=new te(E,x+"enter",ee,n,F),te.target=T,te.relatedTarget=Ae,$=te),Ae=$,q&&ee)t:{for(te=q,E=ee,x=0,T=te;T;T=Kn(T))x++;for(T=0,$=E;$;$=Kn($))T++;for(;0<x-T;)te=Kn(te),x--;for(;0<T-x;)E=Kn(E),T--;for(;x--;){if(te===E||E!==null&&te===E.alternate)break t;te=Kn(te),E=Kn(E)}te=null}else te=null;q!==null&&_a(B,A,q,te,!1),ee!==null&&Ae!==null&&_a(B,Ae,ee,te,!0)}}e:{if(A=R?Qn(R):window,q=A.nodeName&&A.nodeName.toLowerCase(),q==="select"||q==="input"&&A.type==="file")var ne=Xd;else if(oa(A))if(aa)ne=nf;else{ne=ef;var le=Zd}else(q=A.nodeName)&&q.toLowerCase()==="input"&&(A.type==="checkbox"||A.type==="radio")&&(ne=tf);if(ne&&(ne=ne(e,R))){ia(B,ne,n,F);break e}le&&le(e,A,R),e==="focusout"&&(le=A._wrapperState)&&le.controlled&&A.type==="number"&&Y(A,"number",A.value)}switch(le=R?Qn(R):window,e){case"focusin":(oa(le)||le.contentEditable==="true")&&(bn=le,$s=R,zr=null);break;case"focusout":zr=$s=bn=null;break;case"mousedown":bs=!0;break;case"contextmenu":case"mouseup":case"dragend":bs=!1,ga(B,n,F);break;case"selectionchange":if(sf)break;case"keydown":case"keyup":ga(B,n,F)}var se;if(Fs)e:{switch(e){case"compositionstart":var de="onCompositionStart";break e;case"compositionend":de="onCompositionEnd";break e;case"compositionupdate":de="onCompositionUpdate";break e}de=void 0}else $n?la(e,n)&&(de="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(de="onCompositionStart");de&&(ta&&n.locale!=="ko"&&($n||de!=="onCompositionStart"?de==="onCompositionEnd"&&$n&&(se=qi()):(Gt=F,zs="value"in Gt?Gt.value:Gt.textContent,$n=!0)),le=Nl(R,de),0<le.length&&(de=new Zi(de,e,null,n,F),B.push({event:de,listeners:le}),se?de.data=se:(se=sa(n),se!==null&&(de.data=se)))),(se=Qd?Yd(e,n):Jd(e,n))&&(R=Nl(R,"onBeforeInput"),0<R.length&&(F=new Zi("onBeforeInput","beforeinput",null,n,F),B.push({event:F,listeners:R}),F.data=se))}Na(B,t)})}function Dr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Nl(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=gr(e,n),i!=null&&r.unshift(Dr(e,i,s)),i=gr(e,t),i!=null&&r.push(Dr(e,i,s))),e=e.return}return r}function Kn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _a(e,t,n,r,s){for(var i=t._reactName,c=[];n!==null&&n!==r;){var h=n,g=h.alternate,R=h.stateNode;if(g!==null&&g===r)break;h.tag===5&&R!==null&&(h=R,s?(g=gr(n,i),g!=null&&c.unshift(Dr(n,g,h))):s||(g=gr(n,i),g!=null&&c.push(Dr(n,g,h)))),n=n.return}c.length!==0&&e.push({event:t,listeners:c})}var cf=/\r\n?/g,df=/\u0000|\uFFFD/g;function Pa(e){return(typeof e=="string"?e:""+e).replace(cf,`
38
- `).replace(df,"")}function El(e,t,n){if(t=Pa(t),Pa(e)!==t&&n)throw Error(u(425))}function _l(){}var Js=null,qs=null;function Gs(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 Xs=typeof setTimeout=="function"?setTimeout:void 0,ff=typeof clearTimeout=="function"?clearTimeout:void 0,Ta=typeof Promise=="function"?Promise:void 0,pf=typeof queueMicrotask=="function"?queueMicrotask:typeof Ta<"u"?function(e){return Ta.resolve(null).then(e).catch(hf)}:Xs;function hf(e){setTimeout(function(){throw e})}function Zs(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Nr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Nr(t)}function Zt(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 La(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 Hn=Math.random().toString(36).slice(2),Rt="__reactFiber$"+Hn,Mr="__reactProps$"+Hn,At="__reactContainer$"+Hn,eo="__reactEvents$"+Hn,mf="__reactListeners$"+Hn,gf="__reactHandles$"+Hn;function yn(e){var t=e[Rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[At]||n[Rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=La(e);e!==null;){if(n=e[Rt])return n;e=La(e)}return t}e=n,n=e.parentNode}return null}function Ar(e){return e=e[Rt]||e[At],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Qn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(u(33))}function Pl(e){return e[Mr]||null}var to=[],Yn=-1;function en(e){return{current:e}}function Te(e){0>Yn||(e.current=to[Yn],to[Yn]=null,Yn--)}function _e(e,t){Yn++,to[Yn]=e.current,e.current=t}var tn={},Ye=en(tn),lt=en(!1),vn=tn;function Jn(e,t){var n=e.type.contextTypes;if(!n)return tn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function st(e){return e=e.childContextTypes,e!=null}function Tl(){Te(lt),Te(Ye)}function Ra(e,t,n){if(Ye.current!==tn)throw Error(u(168));_e(Ye,t),_e(lt,n)}function za(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(u(108,Ne(e)||"Unknown",s));return G({},n,r)}function Ll(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tn,vn=Ye.current,_e(Ye,e),_e(lt,lt.current),!0}function Ia(e,t,n){var r=e.stateNode;if(!r)throw Error(u(169));n?(e=za(e,t,vn),r.__reactInternalMemoizedMergedChildContext=e,Te(lt),Te(Ye),_e(Ye,e)):Te(lt),_e(lt,n)}var Ft=null,Rl=!1,no=!1;function Oa(e){Ft===null?Ft=[e]:Ft.push(e)}function yf(e){Rl=!0,Oa(e)}function nn(){if(!no&&Ft!==null){no=!0;var e=0,t=Ce;try{var n=Ft;for(Ce=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ft=null,Rl=!1}catch(s){throw Ft!==null&&(Ft=Ft.slice(e+1)),Mi(Cs,nn),s}finally{Ce=t,no=!1}}return null}var qn=[],Gn=0,zl=null,Il=0,gt=[],yt=0,xn=null,Bt=1,Ut="";function Sn(e,t){qn[Gn++]=Il,qn[Gn++]=zl,zl=e,Il=t}function Da(e,t,n){gt[yt++]=Bt,gt[yt++]=Ut,gt[yt++]=xn,xn=e;var r=Bt;e=Ut;var s=32-wt(r)-1;r&=~(1<<s),n+=1;var i=32-wt(t)+s;if(30<i){var c=s-s%5;i=(r&(1<<c)-1).toString(32),r>>=c,s-=c,Bt=1<<32-wt(t)+s|n<<s|r,Ut=i+e}else Bt=1<<i|n<<s|r,Ut=e}function ro(e){e.return!==null&&(Sn(e,1),Da(e,1,0))}function lo(e){for(;e===zl;)zl=qn[--Gn],qn[Gn]=null,Il=qn[--Gn],qn[Gn]=null;for(;e===xn;)xn=gt[--yt],gt[yt]=null,Ut=gt[--yt],gt[yt]=null,Bt=gt[--yt],gt[yt]=null}var dt=null,ft=null,Re=!1,Ct=null;function Ma(e,t){var n=jt(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 Aa(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,ft=Zt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dt=e,ft=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=xn!==null?{id:Bt,overflow:Ut}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=jt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,dt=e,ft=null,!0):!1;default:return!1}}function so(e){return(e.mode&1)!==0&&(e.flags&128)===0}function oo(e){if(Re){var t=ft;if(t){var n=t;if(!Aa(e,t)){if(so(e))throw Error(u(418));t=Zt(n.nextSibling);var r=dt;t&&Aa(e,t)?Ma(r,n):(e.flags=e.flags&-4097|2,Re=!1,dt=e)}}else{if(so(e))throw Error(u(418));e.flags=e.flags&-4097|2,Re=!1,dt=e}}}function Fa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dt=e}function Ol(e){if(e!==dt)return!1;if(!Re)return Fa(e),Re=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Gs(e.type,e.memoizedProps)),t&&(t=ft)){if(so(e))throw Ba(),Error(u(418));for(;t;)Ma(e,t),t=Zt(t.nextSibling)}if(Fa(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){ft=Zt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ft=null}}else ft=dt?Zt(e.stateNode.nextSibling):null;return!0}function Ba(){for(var e=ft;e;)e=Zt(e.nextSibling)}function Xn(){ft=dt=null,Re=!1}function io(e){Ct===null?Ct=[e]:Ct.push(e)}var vf=P.ReactCurrentBatchConfig;function Fr(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 r=n.stateNode}if(!r)throw Error(u(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(c){var h=s.refs;c===null?delete h[i]:h[i]=c},t._stringRef=i,t)}if(typeof e!="string")throw Error(u(284));if(!n._owner)throw Error(u(290,e))}return e}function Dl(e,t){throw e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ua(e){var t=e._init;return t(e._payload)}function Wa(e){function t(E,x){if(e){var T=E.deletions;T===null?(E.deletions=[x],E.flags|=16):T.push(x)}}function n(E,x){if(!e)return null;for(;x!==null;)t(E,x),x=x.sibling;return null}function r(E,x){for(E=new Map;x!==null;)x.key!==null?E.set(x.key,x):E.set(x.index,x),x=x.sibling;return E}function s(E,x){return E=dn(E,x),E.index=0,E.sibling=null,E}function i(E,x,T){return E.index=T,e?(T=E.alternate,T!==null?(T=T.index,T<x?(E.flags|=2,x):T):(E.flags|=2,x)):(E.flags|=1048576,x)}function c(E){return e&&E.alternate===null&&(E.flags|=2),E}function h(E,x,T,$){return x===null||x.tag!==6?(x=Zo(T,E.mode,$),x.return=E,x):(x=s(x,T),x.return=E,x)}function g(E,x,T,$){var ne=T.type;return ne===ce?F(E,x,T.props.children,$,T.key):x!==null&&(x.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===ae&&Ua(ne)===x.type)?($=s(x,T.props),$.ref=Fr(E,x,T),$.return=E,$):($=ss(T.type,T.key,T.props,null,E.mode,$),$.ref=Fr(E,x,T),$.return=E,$)}function R(E,x,T,$){return x===null||x.tag!==4||x.stateNode.containerInfo!==T.containerInfo||x.stateNode.implementation!==T.implementation?(x=ei(T,E.mode,$),x.return=E,x):(x=s(x,T.children||[]),x.return=E,x)}function F(E,x,T,$,ne){return x===null||x.tag!==7?(x=Pn(T,E.mode,$,ne),x.return=E,x):(x=s(x,T),x.return=E,x)}function B(E,x,T){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Zo(""+x,E.mode,T),x.return=E,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case M:return T=ss(x.type,x.key,x.props,null,E.mode,T),T.ref=Fr(E,null,x),T.return=E,T;case b:return x=ei(x,E.mode,T),x.return=E,x;case ae:var $=x._init;return B(E,$(x._payload),T)}if(H(x)||re(x))return x=Pn(x,E.mode,T,null),x.return=E,x;Dl(E,x)}return null}function A(E,x,T,$){var ne=x!==null?x.key:null;if(typeof T=="string"&&T!==""||typeof T=="number")return ne!==null?null:h(E,x,""+T,$);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case M:return T.key===ne?g(E,x,T,$):null;case b:return T.key===ne?R(E,x,T,$):null;case ae:return ne=T._init,A(E,x,ne(T._payload),$)}if(H(T)||re(T))return ne!==null?null:F(E,x,T,$,null);Dl(E,T)}return null}function q(E,x,T,$,ne){if(typeof $=="string"&&$!==""||typeof $=="number")return E=E.get(T)||null,h(x,E,""+$,ne);if(typeof $=="object"&&$!==null){switch($.$$typeof){case M:return E=E.get($.key===null?T:$.key)||null,g(x,E,$,ne);case b:return E=E.get($.key===null?T:$.key)||null,R(x,E,$,ne);case ae:var le=$._init;return q(E,x,T,le($._payload),ne)}if(H($)||re($))return E=E.get(T)||null,F(x,E,$,ne,null);Dl(x,$)}return null}function ee(E,x,T,$){for(var ne=null,le=null,se=x,de=x=0,Ke=null;se!==null&&de<T.length;de++){se.index>de?(Ke=se,se=null):Ke=se.sibling;var je=A(E,se,T[de],$);if(je===null){se===null&&(se=Ke);break}e&&se&&je.alternate===null&&t(E,se),x=i(je,x,de),le===null?ne=je:le.sibling=je,le=je,se=Ke}if(de===T.length)return n(E,se),Re&&Sn(E,de),ne;if(se===null){for(;de<T.length;de++)se=B(E,T[de],$),se!==null&&(x=i(se,x,de),le===null?ne=se:le.sibling=se,le=se);return Re&&Sn(E,de),ne}for(se=r(E,se);de<T.length;de++)Ke=q(se,E,de,T[de],$),Ke!==null&&(e&&Ke.alternate!==null&&se.delete(Ke.key===null?de:Ke.key),x=i(Ke,x,de),le===null?ne=Ke:le.sibling=Ke,le=Ke);return e&&se.forEach(function(fn){return t(E,fn)}),Re&&Sn(E,de),ne}function te(E,x,T,$){var ne=re(T);if(typeof ne!="function")throw Error(u(150));if(T=ne.call(T),T==null)throw Error(u(151));for(var le=ne=null,se=x,de=x=0,Ke=null,je=T.next();se!==null&&!je.done;de++,je=T.next()){se.index>de?(Ke=se,se=null):Ke=se.sibling;var fn=A(E,se,je.value,$);if(fn===null){se===null&&(se=Ke);break}e&&se&&fn.alternate===null&&t(E,se),x=i(fn,x,de),le===null?ne=fn:le.sibling=fn,le=fn,se=Ke}if(je.done)return n(E,se),Re&&Sn(E,de),ne;if(se===null){for(;!je.done;de++,je=T.next())je=B(E,je.value,$),je!==null&&(x=i(je,x,de),le===null?ne=je:le.sibling=je,le=je);return Re&&Sn(E,de),ne}for(se=r(E,se);!je.done;de++,je=T.next())je=q(se,E,de,je.value,$),je!==null&&(e&&je.alternate!==null&&se.delete(je.key===null?de:je.key),x=i(je,x,de),le===null?ne=je:le.sibling=je,le=je);return e&&se.forEach(function(Gf){return t(E,Gf)}),Re&&Sn(E,de),ne}function Ae(E,x,T,$){if(typeof T=="object"&&T!==null&&T.type===ce&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case M:e:{for(var ne=T.key,le=x;le!==null;){if(le.key===ne){if(ne=T.type,ne===ce){if(le.tag===7){n(E,le.sibling),x=s(le,T.props.children),x.return=E,E=x;break e}}else if(le.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===ae&&Ua(ne)===le.type){n(E,le.sibling),x=s(le,T.props),x.ref=Fr(E,le,T),x.return=E,E=x;break e}n(E,le);break}else t(E,le);le=le.sibling}T.type===ce?(x=Pn(T.props.children,E.mode,$,T.key),x.return=E,E=x):($=ss(T.type,T.key,T.props,null,E.mode,$),$.ref=Fr(E,x,T),$.return=E,E=$)}return c(E);case b:e:{for(le=T.key;x!==null;){if(x.key===le)if(x.tag===4&&x.stateNode.containerInfo===T.containerInfo&&x.stateNode.implementation===T.implementation){n(E,x.sibling),x=s(x,T.children||[]),x.return=E,E=x;break e}else{n(E,x);break}else t(E,x);x=x.sibling}x=ei(T,E.mode,$),x.return=E,E=x}return c(E);case ae:return le=T._init,Ae(E,x,le(T._payload),$)}if(H(T))return ee(E,x,T,$);if(re(T))return te(E,x,T,$);Dl(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,x!==null&&x.tag===6?(n(E,x.sibling),x=s(x,T),x.return=E,E=x):(n(E,x),x=Zo(T,E.mode,$),x.return=E,E=x),c(E)):n(E,x)}return Ae}var Zn=Wa(!0),$a=Wa(!1),Ml=en(null),Al=null,er=null,ao=null;function uo(){ao=er=Al=null}function co(e){var t=Ml.current;Te(Ml),e._currentValue=t}function fo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function tr(e,t){Al=e,ao=er=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ot=!0),e.firstContext=null)}function vt(e){var t=e._currentValue;if(ao!==e)if(e={context:e,memoizedValue:t,next:null},er===null){if(Al===null)throw Error(u(308));er=e,Al.dependencies={lanes:0,firstContext:e}}else er=er.next=e;return t}var jn=null;function po(e){jn===null?jn=[e]:jn.push(e)}function ba(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,po(t)):(n.next=s.next,s.next=n),t.interleaved=n,Wt(e,r)}function Wt(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 ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Va(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 $t(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ln(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Se&2)!==0){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Wt(e,n)}return s=r.interleaved,s===null?(t.next=t,po(r)):(t.next=s.next,s.next=t),r.interleaved=t,Wt(e,n)}function Fl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_s(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var c={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=c:i=i.next=c,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Bl(e,t,n,r){var s=e.updateQueue;rn=!1;var i=s.firstBaseUpdate,c=s.lastBaseUpdate,h=s.shared.pending;if(h!==null){s.shared.pending=null;var g=h,R=g.next;g.next=null,c===null?i=R:c.next=R,c=g;var F=e.alternate;F!==null&&(F=F.updateQueue,h=F.lastBaseUpdate,h!==c&&(h===null?F.firstBaseUpdate=R:h.next=R,F.lastBaseUpdate=g))}if(i!==null){var B=s.baseState;c=0,F=R=g=null,h=i;do{var A=h.lane,q=h.eventTime;if((r&A)===A){F!==null&&(F=F.next={eventTime:q,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,next:null});e:{var ee=e,te=h;switch(A=t,q=n,te.tag){case 1:if(ee=te.payload,typeof ee=="function"){B=ee.call(q,B,A);break e}B=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=te.payload,A=typeof ee=="function"?ee.call(q,B,A):ee,A==null)break e;B=G({},B,A);break e;case 2:rn=!0}}h.callback!==null&&h.lane!==0&&(e.flags|=64,A=s.effects,A===null?s.effects=[h]:A.push(h))}else q={eventTime:q,lane:A,tag:h.tag,payload:h.payload,callback:h.callback,next:null},F===null?(R=F=q,g=B):F=F.next=q,c|=A;if(h=h.next,h===null){if(h=s.shared.pending,h===null)break;A=h,h=A.next,A.next=null,s.lastBaseUpdate=A,s.shared.pending=null}}while(!0);if(F===null&&(g=B),s.baseState=g,s.firstBaseUpdate=R,s.lastBaseUpdate=F,t=s.shared.interleaved,t!==null){s=t;do c|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Cn|=c,e.lanes=c,e.memoizedState=B}}function Ha(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(u(191,s));s.call(r)}}}var Br={},zt=en(Br),Ur=en(Br),Wr=en(Br);function wn(e){if(e===Br)throw Error(u(174));return e}function mo(e,t){switch(_e(Wr,t),_e(Ur,e),_e(zt,Br),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Dn(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Dn(t,e)}Te(zt),_e(zt,t)}function nr(){Te(zt),Te(Ur),Te(Wr)}function Qa(e){wn(Wr.current);var t=wn(zt.current),n=Dn(t,e.type);t!==n&&(_e(Ur,e),_e(zt,n))}function go(e){Ur.current===e&&(Te(zt),Te(Ur))}var ze=en(0);function Ul(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 yo=[];function vo(){for(var e=0;e<yo.length;e++)yo[e]._workInProgressVersionPrimary=null;yo.length=0}var Wl=P.ReactCurrentDispatcher,xo=P.ReactCurrentBatchConfig,kn=0,Ie=null,We=null,be=null,$l=!1,$r=!1,br=0,xf=0;function Je(){throw Error(u(321))}function So(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kt(e[n],t[n]))return!1;return!0}function jo(e,t,n,r,s,i){if(kn=i,Ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Wl.current=e===null||e.memoizedState===null?kf:Cf,e=n(r,s),$r){i=0;do{if($r=!1,br=0,25<=i)throw Error(u(301));i+=1,be=We=null,t.updateQueue=null,Wl.current=Nf,e=n(r,s)}while($r)}if(Wl.current=Kl,t=We!==null&&We.next!==null,kn=0,be=We=Ie=null,$l=!1,t)throw Error(u(300));return e}function wo(){var e=br!==0;return br=0,e}function It(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return be===null?Ie.memoizedState=be=e:be=be.next=e,be}function xt(){if(We===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=be===null?Ie.memoizedState:be.next;if(t!==null)be=t,We=e;else{if(e===null)throw Error(u(310));We=e,e={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},be===null?Ie.memoizedState=be=e:be=be.next=e}return be}function Vr(e,t){return typeof t=="function"?t(e):t}function ko(e){var t=xt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var r=We,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var c=s.next;s.next=i.next,i.next=c}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var h=c=null,g=null,R=i;do{var F=R.lane;if((kn&F)===F)g!==null&&(g=g.next={lane:0,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),r=R.hasEagerState?R.eagerState:e(r,R.action);else{var B={lane:F,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null};g===null?(h=g=B,c=r):g=g.next=B,Ie.lanes|=F,Cn|=F}R=R.next}while(R!==null&&R!==i);g===null?c=r:g.next=h,kt(r,t.memoizedState)||(ot=!0),t.memoizedState=r,t.baseState=c,t.baseQueue=g,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,Ie.lanes|=i,Cn|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Co(e){var t=xt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var c=s=s.next;do i=e(i,c.action),c=c.next;while(c!==s);kt(i,t.memoizedState)||(ot=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Ya(){}function Ja(e,t){var n=Ie,r=xt(),s=t(),i=!kt(r.memoizedState,s);if(i&&(r.memoizedState=s,ot=!0),r=r.queue,No(Xa.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||be!==null&&be.memoizedState.tag&1){if(n.flags|=2048,Kr(9,Ga.bind(null,n,r,s,t),void 0,null),Ve===null)throw Error(u(349));(kn&30)!==0||qa(n,t,s)}return s}function qa(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ie.updateQueue,t===null?(t={lastEffect:null,stores:null},Ie.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ga(e,t,n,r){t.value=n,t.getSnapshot=r,Za(t)&&eu(e)}function Xa(e,t,n){return n(function(){Za(t)&&eu(e)})}function Za(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kt(e,n)}catch{return!0}}function eu(e){var t=Wt(e,1);t!==null&&Pt(t,e,1,-1)}function tu(e){var t=It();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vr,lastRenderedState:e},t.queue=e,e=e.dispatch=wf.bind(null,Ie,e),[t.memoizedState,e]}function Kr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ie.updateQueue,t===null?(t={lastEffect:null,stores:null},Ie.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function nu(){return xt().memoizedState}function bl(e,t,n,r){var s=It();Ie.flags|=e,s.memoizedState=Kr(1|t,n,void 0,r===void 0?null:r)}function Vl(e,t,n,r){var s=xt();r=r===void 0?null:r;var i=void 0;if(We!==null){var c=We.memoizedState;if(i=c.destroy,r!==null&&So(r,c.deps)){s.memoizedState=Kr(t,n,i,r);return}}Ie.flags|=e,s.memoizedState=Kr(1|t,n,i,r)}function ru(e,t){return bl(8390656,8,e,t)}function No(e,t){return Vl(2048,8,e,t)}function lu(e,t){return Vl(4,2,e,t)}function su(e,t){return Vl(4,4,e,t)}function ou(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 iu(e,t,n){return n=n!=null?n.concat([e]):null,Vl(4,4,ou.bind(null,t,e),n)}function Eo(){}function au(e,t){var n=xt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&So(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function uu(e,t){var n=xt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&So(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function cu(e,t,n){return(kn&21)===0?(e.baseState&&(e.baseState=!1,ot=!0),e.memoizedState=n):(kt(n,t)||(n=Ui(),Ie.lanes|=n,Cn|=n,e.baseState=!0),t)}function Sf(e,t){var n=Ce;Ce=n!==0&&4>n?n:4,e(!0);var r=xo.transition;xo.transition={};try{e(!1),t()}finally{Ce=n,xo.transition=r}}function du(){return xt().memoizedState}function jf(e,t,n){var r=un(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fu(e))pu(t,n);else if(n=ba(e,t,n,r),n!==null){var s=tt();Pt(n,e,r,s),hu(n,t,r)}}function wf(e,t,n){var r=un(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fu(e))pu(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var c=t.lastRenderedState,h=i(c,n);if(s.hasEagerState=!0,s.eagerState=h,kt(h,c)){var g=t.interleaved;g===null?(s.next=s,po(t)):(s.next=g.next,g.next=s),t.interleaved=s;return}}catch{}finally{}n=ba(e,t,s,r),n!==null&&(s=tt(),Pt(n,e,r,s),hu(n,t,r))}}function fu(e){var t=e.alternate;return e===Ie||t!==null&&t===Ie}function pu(e,t){$r=$l=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hu(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_s(e,n)}}var Kl={readContext:vt,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useInsertionEffect:Je,useLayoutEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useMutableSource:Je,useSyncExternalStore:Je,useId:Je,unstable_isNewReconciler:!1},kf={readContext:vt,useCallback:function(e,t){return It().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:ru,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bl(4194308,4,ou.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bl(4194308,4,e,t)},useInsertionEffect:function(e,t){return bl(4,2,e,t)},useMemo:function(e,t){var n=It();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=It();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=jf.bind(null,Ie,e),[r.memoizedState,e]},useRef:function(e){var t=It();return e={current:e},t.memoizedState=e},useState:tu,useDebugValue:Eo,useDeferredValue:function(e){return It().memoizedState=e},useTransition:function(){var e=tu(!1),t=e[0];return e=Sf.bind(null,e[1]),It().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ie,s=It();if(Re){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Ve===null)throw Error(u(349));(kn&30)!==0||qa(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,ru(Xa.bind(null,r,i,e),[e]),r.flags|=2048,Kr(9,Ga.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=It(),t=Ve.identifierPrefix;if(Re){var n=Ut,r=Bt;n=(r&~(1<<32-wt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=br++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=xf++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Cf={readContext:vt,useCallback:au,useContext:vt,useEffect:No,useImperativeHandle:iu,useInsertionEffect:lu,useLayoutEffect:su,useMemo:uu,useReducer:ko,useRef:nu,useState:function(){return ko(Vr)},useDebugValue:Eo,useDeferredValue:function(e){var t=xt();return cu(t,We.memoizedState,e)},useTransition:function(){var e=ko(Vr)[0],t=xt().memoizedState;return[e,t]},useMutableSource:Ya,useSyncExternalStore:Ja,useId:du,unstable_isNewReconciler:!1},Nf={readContext:vt,useCallback:au,useContext:vt,useEffect:No,useImperativeHandle:iu,useInsertionEffect:lu,useLayoutEffect:su,useMemo:uu,useReducer:Co,useRef:nu,useState:function(){return Co(Vr)},useDebugValue:Eo,useDeferredValue:function(e){var t=xt();return We===null?t.memoizedState=e:cu(t,We.memoizedState,e)},useTransition:function(){var e=Co(Vr)[0],t=xt().memoizedState;return[e,t]},useMutableSource:Ya,useSyncExternalStore:Ja,useId:du,unstable_isNewReconciler:!1};function Nt(e,t){if(e&&e.defaultProps){t=G({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function _o(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:G({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Hl={isMounted:function(e){return(e=e._reactInternals)?gn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=tt(),s=un(e),i=$t(r,s);i.payload=t,n!=null&&(i.callback=n),t=ln(e,i,s),t!==null&&(Pt(t,e,s,r),Fl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=tt(),s=un(e),i=$t(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ln(e,i,s),t!==null&&(Pt(t,e,s,r),Fl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=tt(),r=un(e),s=$t(n,r);s.tag=2,t!=null&&(s.callback=t),t=ln(e,s,r),t!==null&&(Pt(t,e,r,n),Fl(t,e,r))}};function mu(e,t,n,r,s,i,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,c):t.prototype&&t.prototype.isPureReactComponent?!Rr(n,r)||!Rr(s,i):!0}function gu(e,t,n){var r=!1,s=tn,i=t.contextType;return typeof i=="object"&&i!==null?i=vt(i):(s=st(t)?vn:Ye.current,r=t.contextTypes,i=(r=r!=null)?Jn(e,s):tn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Hl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function yu(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Hl.enqueueReplaceState(t,t.state,null)}function Po(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},ho(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=vt(i):(i=st(t)?vn:Ye.current,s.context=Jn(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(_o(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Hl.enqueueReplaceState(s,s.state,null),Bl(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function rr(e,t){try{var n="",r=t;do n+=ve(r),r=r.return;while(r);var s=n}catch(i){s=`
39
- Error generating stack: `+i.message+`
40
- `+i.stack}return{value:e,source:t,stack:s,digest:null}}function To(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Lo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ef=typeof WeakMap=="function"?WeakMap:Map;function vu(e,t,n){n=$t(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Zl||(Zl=!0,Ko=r),Lo(e,t)},n}function xu(e,t,n){n=$t(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Lo(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Lo(e,t),typeof r!="function"&&(on===null?on=new Set([this]):on.add(this));var c=t.stack;this.componentDidCatch(t.value,{componentStack:c!==null?c:""})}),n}function Su(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ef;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Uf.bind(null,e,t,n),t.then(e,e))}function ju(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 wu(e,t,n,r,s){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=$t(-1,1),t.tag=2,ln(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=s,e)}var _f=P.ReactCurrentOwner,ot=!1;function et(e,t,n,r){t.child=e===null?$a(t,null,n,r):Zn(t,e.child,n,r)}function ku(e,t,n,r,s){n=n.render;var i=t.ref;return tr(t,s),r=jo(e,t,n,r,i,s),n=wo(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,bt(e,t,s)):(Re&&n&&ro(t),t.flags|=1,et(e,t,r,s),t.child)}function Cu(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Xo(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Nu(e,t,i,r,s)):(e=ss(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,(e.lanes&s)===0){var c=i.memoizedProps;if(n=n.compare,n=n!==null?n:Rr,n(c,r)&&e.ref===t.ref)return bt(e,t,s)}return t.flags|=1,e=dn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Nu(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Rr(i,r)&&e.ref===t.ref)if(ot=!1,t.pendingProps=r=i,(e.lanes&s)!==0)(e.flags&131072)!==0&&(ot=!0);else return t.lanes=e.lanes,bt(e,t,s)}return Ro(e,t,n,r,s)}function Eu(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_e(sr,pt),pt|=n;else{if((n&1073741824)===0)return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,_e(sr,pt),pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,_e(sr,pt),pt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,_e(sr,pt),pt|=r;return et(e,t,s,n),t.child}function _u(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ro(e,t,n,r,s){var i=st(n)?vn:Ye.current;return i=Jn(t,i),tr(t,s),n=jo(e,t,n,r,i,s),r=wo(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,bt(e,t,s)):(Re&&r&&ro(t),t.flags|=1,et(e,t,n,s),t.child)}function Pu(e,t,n,r,s){if(st(n)){var i=!0;Ll(t)}else i=!1;if(tr(t,s),t.stateNode===null)Yl(e,t),gu(t,n,r),Po(t,n,r,s),r=!0;else if(e===null){var c=t.stateNode,h=t.memoizedProps;c.props=h;var g=c.context,R=n.contextType;typeof R=="object"&&R!==null?R=vt(R):(R=st(n)?vn:Ye.current,R=Jn(t,R));var F=n.getDerivedStateFromProps,B=typeof F=="function"||typeof c.getSnapshotBeforeUpdate=="function";B||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==r||g!==R)&&yu(t,c,r,R),rn=!1;var A=t.memoizedState;c.state=A,Bl(t,r,c,s),g=t.memoizedState,h!==r||A!==g||lt.current||rn?(typeof F=="function"&&(_o(t,n,F,r),g=t.memoizedState),(h=rn||mu(t,n,h,r,A,g,R))?(B||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=g),c.props=r,c.state=g,c.context=R,r=h):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{c=t.stateNode,Va(e,t),h=t.memoizedProps,R=t.type===t.elementType?h:Nt(t.type,h),c.props=R,B=t.pendingProps,A=c.context,g=n.contextType,typeof g=="object"&&g!==null?g=vt(g):(g=st(n)?vn:Ye.current,g=Jn(t,g));var q=n.getDerivedStateFromProps;(F=typeof q=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==B||A!==g)&&yu(t,c,r,g),rn=!1,A=t.memoizedState,c.state=A,Bl(t,r,c,s);var ee=t.memoizedState;h!==B||A!==ee||lt.current||rn?(typeof q=="function"&&(_o(t,n,q,r),ee=t.memoizedState),(R=rn||mu(t,n,R,r,A,ee,g)||!1)?(F||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(r,ee,g),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(r,ee,g)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=ee),c.props=r,c.state=ee,c.context=g,r=R):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),r=!1)}return zo(e,t,n,r,i,s)}function zo(e,t,n,r,s,i){_u(e,t);var c=(t.flags&128)!==0;if(!r&&!c)return s&&Ia(t,n,!1),bt(e,t,i);r=t.stateNode,_f.current=t;var h=c&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&c?(t.child=Zn(t,e.child,null,i),t.child=Zn(t,null,h,i)):et(e,t,h,i),t.memoizedState=r.state,s&&Ia(t,n,!0),t.child}function Tu(e){var t=e.stateNode;t.pendingContext?Ra(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ra(e,t.context,!1),mo(e,t.containerInfo)}function Lu(e,t,n,r,s){return Xn(),io(s),t.flags|=256,et(e,t,n,r),t.child}var Io={dehydrated:null,treeContext:null,retryLane:0};function Oo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ru(e,t,n){var r=t.pendingProps,s=ze.current,i=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(s&2)!==0),h?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),_e(ze,s&1),e===null)return oo(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):(c=r.children,e=r.fallback,i?(r=t.mode,i=t.child,c={mode:"hidden",children:c},(r&1)===0&&i!==null?(i.childLanes=0,i.pendingProps=c):i=os(c,r,0,null),e=Pn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Oo(n),t.memoizedState=Io,e):Do(t,c));if(s=e.memoizedState,s!==null&&(h=s.dehydrated,h!==null))return Pf(e,t,c,r,h,s,n);if(i){i=r.fallback,c=t.mode,s=e.child,h=s.sibling;var g={mode:"hidden",children:r.children};return(c&1)===0&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=g,t.deletions=null):(r=dn(s,g),r.subtreeFlags=s.subtreeFlags&14680064),h!==null?i=dn(h,i):(i=Pn(i,c,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,c=e.child.memoizedState,c=c===null?Oo(n):{baseLanes:c.baseLanes|n,cachePool:null,transitions:c.transitions},i.memoizedState=c,i.childLanes=e.childLanes&~n,t.memoizedState=Io,r}return i=e.child,e=i.sibling,r=dn(i,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Do(e,t){return t=os({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ql(e,t,n,r){return r!==null&&io(r),Zn(t,e.child,null,n),e=Do(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pf(e,t,n,r,s,i,c){if(n)return t.flags&256?(t.flags&=-257,r=To(Error(u(422))),Ql(e,t,c,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=os({mode:"visible",children:r.children},s,0,null),i=Pn(i,s,c,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,(t.mode&1)!==0&&Zn(t,e.child,null,c),t.child.memoizedState=Oo(c),t.memoizedState=Io,i);if((t.mode&1)===0)return Ql(e,t,c,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var h=r.dgst;return r=h,i=Error(u(419)),r=To(i,r,void 0),Ql(e,t,c,r)}if(h=(c&e.childLanes)!==0,ot||h){if(r=Ve,r!==null){switch(c&-c){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=(s&(r.suspendedLanes|c))!==0?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Wt(e,s),Pt(r,e,s,-1))}return Go(),r=To(Error(u(421))),Ql(e,t,c,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Wf.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,ft=Zt(s.nextSibling),dt=t,Re=!0,Ct=null,e!==null&&(gt[yt++]=Bt,gt[yt++]=Ut,gt[yt++]=xn,Bt=e.id,Ut=e.overflow,xn=t),t=Do(t,r.children),t.flags|=4096,t)}function zu(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),fo(e.return,t,n)}function Mo(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function Iu(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(et(e,t,r.children,n),r=ze.current,(r&2)!==0)r=r&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&&zu(e,n,t);else if(e.tag===19)zu(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}r&=1}if(_e(ze,r),(t.mode&1)===0)t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Ul(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Mo(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Ul(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Mo(t,!0,n,null,i);break;case"together":Mo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Yl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function bt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Cn|=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=dn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=dn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Tf(e,t,n){switch(t.tag){case 3:Tu(t),Xn();break;case 5:Qa(t);break;case 1:st(t.type)&&Ll(t);break;case 4:mo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;_e(Ml,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(_e(ze,ze.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Ru(e,t,n):(_e(ze,ze.current&1),e=bt(e,t,n),e!==null?e.sibling:null);_e(ze,ze.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Iu(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),_e(ze,ze.current),r)break;return null;case 22:case 23:return t.lanes=0,Eu(e,t,n)}return bt(e,t,n)}var Ou,Ao,Du,Mu;Ou=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}},Ao=function(){},Du=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,wn(zt.current);var i=null;switch(n){case"input":s=fr(e,s),r=fr(e,r),i=[];break;case"select":s=G({},s,{value:void 0}),r=G({},r,{value:void 0}),i=[];break;case"textarea":s=On(e,s),r=On(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=_l)}gs(n,r);var c;n=null;for(R in s)if(!r.hasOwnProperty(R)&&s.hasOwnProperty(R)&&s[R]!=null)if(R==="style"){var h=s[R];for(c in h)h.hasOwnProperty(c)&&(n||(n={}),n[c]="")}else R!=="dangerouslySetInnerHTML"&&R!=="children"&&R!=="suppressContentEditableWarning"&&R!=="suppressHydrationWarning"&&R!=="autoFocus"&&(p.hasOwnProperty(R)?i||(i=[]):(i=i||[]).push(R,null));for(R in r){var g=r[R];if(h=s!=null?s[R]:void 0,r.hasOwnProperty(R)&&g!==h&&(g!=null||h!=null))if(R==="style")if(h){for(c in h)!h.hasOwnProperty(c)||g&&g.hasOwnProperty(c)||(n||(n={}),n[c]="");for(c in g)g.hasOwnProperty(c)&&h[c]!==g[c]&&(n||(n={}),n[c]=g[c])}else n||(i||(i=[]),i.push(R,n)),n=g;else R==="dangerouslySetInnerHTML"?(g=g?g.__html:void 0,h=h?h.__html:void 0,g!=null&&h!==g&&(i=i||[]).push(R,g)):R==="children"?typeof g!="string"&&typeof g!="number"||(i=i||[]).push(R,""+g):R!=="suppressContentEditableWarning"&&R!=="suppressHydrationWarning"&&(p.hasOwnProperty(R)?(g!=null&&R==="onScroll"&&Pe("scroll",e),i||h===g||(i=[])):(i=i||[]).push(R,g))}n&&(i=i||[]).push("style",n);var R=i;(t.updateQueue=R)&&(t.flags|=4)}},Mu=function(e,t,n,r){n!==r&&(t.flags|=4)};function Hr(e,t){if(!Re)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lf(e,t,n){var r=t.pendingProps;switch(lo(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 st(t.type)&&Tl(),qe(t),null;case 3:return r=t.stateNode,nr(),Te(lt),Te(Ye),vo(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ol(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ct!==null&&(Yo(Ct),Ct=null))),Ao(e,t),qe(t),null;case 5:go(t);var s=wn(Wr.current);if(n=t.type,e!==null&&t.stateNode!=null)Du(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(u(166));return qe(t),null}if(e=wn(zt.current),Ol(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Rt]=t,r[Mr]=i,e=(t.mode&1)!==0,n){case"dialog":Pe("cancel",r),Pe("close",r);break;case"iframe":case"object":case"embed":Pe("load",r);break;case"video":case"audio":for(s=0;s<Ir.length;s++)Pe(Ir[s],r);break;case"source":Pe("error",r);break;case"img":case"image":case"link":Pe("error",r),Pe("load",r);break;case"details":Pe("toggle",r);break;case"input":pr(r,i),Pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Pe("invalid",r);break;case"textarea":mt(r,i),Pe("invalid",r)}gs(n,i),s=null;for(var c in i)if(i.hasOwnProperty(c)){var h=i[c];c==="children"?typeof h=="string"?r.textContent!==h&&(i.suppressHydrationWarning!==!0&&El(r.textContent,h,e),s=["children",h]):typeof h=="number"&&r.textContent!==""+h&&(i.suppressHydrationWarning!==!0&&El(r.textContent,h,e),s=["children",""+h]):p.hasOwnProperty(c)&&h!=null&&c==="onScroll"&&Pe("scroll",r)}switch(n){case"input":Rn(r),Q(r,i,!0);break;case"textarea":Rn(r),rl(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=_l)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{c=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=mr(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),n==="select"&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[Rt]=t,e[Mr]=r,Ou(e,t,!1,!1),t.stateNode=e;e:{switch(c=ys(n,r),n){case"dialog":Pe("cancel",e),Pe("close",e),s=r;break;case"iframe":case"object":case"embed":Pe("load",e),s=r;break;case"video":case"audio":for(s=0;s<Ir.length;s++)Pe(Ir[s],e);s=r;break;case"source":Pe("error",e),s=r;break;case"img":case"image":case"link":Pe("error",e),Pe("load",e),s=r;break;case"details":Pe("toggle",e),s=r;break;case"input":pr(e,r),s=fr(e,r),Pe("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=G({},r,{value:void 0}),Pe("invalid",e);break;case"textarea":mt(e,r),s=On(e,r),Pe("invalid",e);break;default:s=r}gs(n,s),h=s;for(i in h)if(h.hasOwnProperty(i)){var g=h[i];i==="style"?Ni(e,g):i==="dangerouslySetInnerHTML"?(g=g?g.__html:void 0,g!=null&&ll(e,g)):i==="children"?typeof g=="string"?(n!=="textarea"||g!=="")&&ke(e,g):typeof g=="number"&&ke(e,""+g):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(p.hasOwnProperty(i)?g!=null&&i==="onScroll"&&Pe("scroll",e):g!=null&&L(e,i,g,c))}switch(n){case"input":Rn(e),Q(e,r,!1);break;case"textarea":Rn(e),rl(e);break;case"option":r.value!=null&&e.setAttribute("value",""+we(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Le(e,!!r.multiple,i,!1):r.defaultValue!=null&&Le(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=_l)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return qe(t),null;case 6:if(e&&t.stateNode!=null)Mu(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(u(166));if(n=wn(Wr.current),wn(zt.current),Ol(t)){if(r=t.stateNode,n=t.memoizedProps,r[Rt]=t,(i=r.nodeValue!==n)&&(e=dt,e!==null))switch(e.tag){case 3:El(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&El(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Rt]=t,t.stateNode=r}return qe(t),null;case 13:if(Te(ze),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Re&&ft!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Ba(),Xn(),t.flags|=98560,i=!1;else if(i=Ol(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(u(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(u(317));i[Rt]=t}else Xn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),i=!1}else Ct!==null&&(Yo(Ct),Ct=null),i=!0;if(!i)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(ze.current&1)!==0?$e===0&&($e=3):Go())),t.updateQueue!==null&&(t.flags|=4),qe(t),null);case 4:return nr(),Ao(e,t),e===null&&Or(t.stateNode.containerInfo),qe(t),null;case 10:return co(t.type._context),qe(t),null;case 17:return st(t.type)&&Tl(),qe(t),null;case 19:if(Te(ze),i=t.memoizedState,i===null)return qe(t),null;if(r=(t.flags&128)!==0,c=i.rendering,c===null)if(r)Hr(i,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Ul(e),c!==null){for(t.flags|=128,Hr(i,!1),r=c.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,c=i.alternate,c===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,e=c.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _e(ze,ze.current&1|2),t.child}e=e.sibling}i.tail!==null&&Me()>or&&(t.flags|=128,r=!0,Hr(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ul(c),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Hr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!c.alternate&&!Re)return qe(t),null}else 2*Me()-i.renderingStartTime>or&&n!==1073741824&&(t.flags|=128,r=!0,Hr(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(n=i.last,n!==null?n.sibling=c:t.child=c,i.last=c)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Me(),t.sibling=null,n=ze.current,_e(ze,r?n&1|2:n&1),t):(qe(t),null);case 22:case 23:return qo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(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 Rf(e,t){switch(lo(t),t.tag){case 1:return st(t.type)&&Tl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nr(),Te(lt),Te(Ye),vo(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return go(t),null;case 13:if(Te(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Xn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Te(ze),null;case 4:return nr(),null;case 10:return co(t.type._context),null;case 22:case 23:return qo(),null;case 24:return null;default:return null}}var Jl=!1,Ge=!1,zf=typeof WeakSet=="function"?WeakSet:Set,Z=null;function lr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Oe(e,t,r)}else n.current=null}function Fo(e,t,n){try{n()}catch(r){Oe(e,t,r)}}var Au=!1;function If(e,t){if(Js=ml,e=ma(),Ws(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var c=0,h=-1,g=-1,R=0,F=0,B=e,A=null;t:for(;;){for(var q;B!==n||s!==0&&B.nodeType!==3||(h=c+s),B!==i||r!==0&&B.nodeType!==3||(g=c+r),B.nodeType===3&&(c+=B.nodeValue.length),(q=B.firstChild)!==null;)A=B,B=q;for(;;){if(B===e)break t;if(A===n&&++R===s&&(h=c),A===i&&++F===r&&(g=c),(q=B.nextSibling)!==null)break;B=A,A=B.parentNode}B=q}n=h===-1||g===-1?null:{start:h,end:g}}else n=null}n=n||{start:0,end:0}}else n=null;for(qs={focusedElem:e,selectionRange:n},ml=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var ee=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ee!==null){var te=ee.memoizedProps,Ae=ee.memoizedState,E=t.stateNode,x=E.getSnapshotBeforeUpdate(t.elementType===t.type?te:Nt(t.type,te),Ae);E.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch($){Oe(t,t.return,$)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return ee=Au,Au=!1,ee}function Qr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Fo(t,n,i)}s=s.next}while(s!==r)}}function ql(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 r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Bo(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 Fu(e){var t=e.alternate;t!==null&&(e.alternate=null,Fu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rt],delete t[Mr],delete t[eo],delete t[mf],delete t[gf])),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 Bu(e){return e.tag===5||e.tag===3||e.tag===4}function Uu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bu(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 Uo(e,t,n){var r=e.tag;if(r===5||r===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=_l));else if(r!==4&&(e=e.child,e!==null))for(Uo(e,t,n),e=e.sibling;e!==null;)Uo(e,t,n),e=e.sibling}function Wo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Wo(e,t,n),e=e.sibling;e!==null;)Wo(e,t,n),e=e.sibling}var He=null,Et=!1;function sn(e,t,n){for(n=n.child;n!==null;)Wu(e,t,n),n=n.sibling}function Wu(e,t,n){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(ul,n)}catch{}switch(n.tag){case 5:Ge||lr(n,t);case 6:var r=He,s=Et;He=null,sn(e,t,n),He=r,Et=s,He!==null&&(Et?(e=He,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):He.removeChild(n.stateNode));break;case 18:He!==null&&(Et?(e=He,n=n.stateNode,e.nodeType===8?Zs(e.parentNode,n):e.nodeType===1&&Zs(e,n),Nr(e)):Zs(He,n.stateNode));break;case 4:r=He,s=Et,He=n.stateNode.containerInfo,Et=!0,sn(e,t,n),He=r,Et=s;break;case 0:case 11:case 14:case 15:if(!Ge&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,c=i.destroy;i=i.tag,c!==void 0&&((i&2)!==0||(i&4)!==0)&&Fo(n,t,c),s=s.next}while(s!==r)}sn(e,t,n);break;case 1:if(!Ge&&(lr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(h){Oe(n,t,h)}sn(e,t,n);break;case 21:sn(e,t,n);break;case 22:n.mode&1?(Ge=(r=Ge)||n.memoizedState!==null,sn(e,t,n),Ge=r):sn(e,t,n);break;default:sn(e,t,n)}}function $u(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new zf),t.forEach(function(r){var s=$f.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function _t(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,c=t,h=c;e:for(;h!==null;){switch(h.tag){case 5:He=h.stateNode,Et=!1;break e;case 3:He=h.stateNode.containerInfo,Et=!0;break e;case 4:He=h.stateNode.containerInfo,Et=!0;break e}h=h.return}if(He===null)throw Error(u(160));Wu(i,c,s),He=null,Et=!1;var g=s.alternate;g!==null&&(g.return=null),s.return=null}catch(R){Oe(s,t,R)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bu(t,e),t=t.sibling}function bu(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(_t(t,e),Ot(e),r&4){try{Qr(3,e,e.return),ql(3,e)}catch(te){Oe(e,e.return,te)}try{Qr(5,e,e.return)}catch(te){Oe(e,e.return,te)}}break;case 1:_t(t,e),Ot(e),r&512&&n!==null&&lr(n,n.return);break;case 5:if(_t(t,e),Ot(e),r&512&&n!==null&&lr(n,n.return),e.flags&32){var s=e.stateNode;try{ke(s,"")}catch(te){Oe(e,e.return,te)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,c=n!==null?n.memoizedProps:i,h=e.type,g=e.updateQueue;if(e.updateQueue=null,g!==null)try{h==="input"&&i.type==="radio"&&i.name!=null&&In(s,i),ys(h,c);var R=ys(h,i);for(c=0;c<g.length;c+=2){var F=g[c],B=g[c+1];F==="style"?Ni(s,B):F==="dangerouslySetInnerHTML"?ll(s,B):F==="children"?ke(s,B):L(s,F,B,R)}switch(h){case"input":Ht(s,i);break;case"textarea":hr(s,i);break;case"select":var A=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var q=i.value;q!=null?Le(s,!!i.multiple,q,!1):A!==!!i.multiple&&(i.defaultValue!=null?Le(s,!!i.multiple,i.defaultValue,!0):Le(s,!!i.multiple,i.multiple?[]:"",!1))}s[Mr]=i}catch(te){Oe(e,e.return,te)}}break;case 6:if(_t(t,e),Ot(e),r&4){if(e.stateNode===null)throw Error(u(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(te){Oe(e,e.return,te)}}break;case 3:if(_t(t,e),Ot(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Nr(t.containerInfo)}catch(te){Oe(e,e.return,te)}break;case 4:_t(t,e),Ot(e);break;case 13:_t(t,e),Ot(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Vo=Me())),r&4&&$u(e);break;case 22:if(F=n!==null&&n.memoizedState!==null,e.mode&1?(Ge=(R=Ge)||F,_t(t,e),Ge=R):_t(t,e),Ot(e),r&8192){if(R=e.memoizedState!==null,(e.stateNode.isHidden=R)&&!F&&(e.mode&1)!==0)for(Z=e,F=e.child;F!==null;){for(B=Z=F;Z!==null;){switch(A=Z,q=A.child,A.tag){case 0:case 11:case 14:case 15:Qr(4,A,A.return);break;case 1:lr(A,A.return);var ee=A.stateNode;if(typeof ee.componentWillUnmount=="function"){r=A,n=A.return;try{t=r,ee.props=t.memoizedProps,ee.state=t.memoizedState,ee.componentWillUnmount()}catch(te){Oe(r,n,te)}}break;case 5:lr(A,A.return);break;case 22:if(A.memoizedState!==null){Hu(B);continue}}q!==null?(q.return=A,Z=q):Hu(B)}F=F.sibling}e:for(F=null,B=e;;){if(B.tag===5){if(F===null){F=B;try{s=B.stateNode,R?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(h=B.stateNode,g=B.memoizedProps.style,c=g!=null&&g.hasOwnProperty("display")?g.display:null,h.style.display=sl("display",c))}catch(te){Oe(e,e.return,te)}}}else if(B.tag===6){if(F===null)try{B.stateNode.nodeValue=R?"":B.memoizedProps}catch(te){Oe(e,e.return,te)}}else if((B.tag!==22&&B.tag!==23||B.memoizedState===null||B===e)&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===e)break e;for(;B.sibling===null;){if(B.return===null||B.return===e)break e;F===B&&(F=null),B=B.return}F===B&&(F=null),B.sibling.return=B.return,B=B.sibling}}break;case 19:_t(t,e),Ot(e),r&4&&$u(e);break;case 21:break;default:_t(t,e),Ot(e)}}function Ot(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Bu(n)){var r=n;break e}n=n.return}throw Error(u(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(ke(s,""),r.flags&=-33);var i=Uu(e);Wo(e,i,s);break;case 3:case 4:var c=r.stateNode.containerInfo,h=Uu(e);Uo(e,h,c);break;default:throw Error(u(161))}}catch(g){Oe(e,e.return,g)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Of(e,t,n){Z=e,Vu(e)}function Vu(e,t,n){for(var r=(e.mode&1)!==0;Z!==null;){var s=Z,i=s.child;if(s.tag===22&&r){var c=s.memoizedState!==null||Jl;if(!c){var h=s.alternate,g=h!==null&&h.memoizedState!==null||Ge;h=Jl;var R=Ge;if(Jl=c,(Ge=g)&&!R)for(Z=s;Z!==null;)c=Z,g=c.child,c.tag===22&&c.memoizedState!==null?Qu(s):g!==null?(g.return=c,Z=g):Qu(s);for(;i!==null;)Z=i,Vu(i),i=i.sibling;Z=s,Jl=h,Ge=R}Ku(e)}else(s.subtreeFlags&8772)!==0&&i!==null?(i.return=s,Z=i):Ku(e)}}function Ku(e){for(;Z!==null;){var t=Z;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Ge||ql(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ge)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Nt(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ha(t,i,r);break;case 3:var c=t.updateQueue;if(c!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Ha(t,c,n)}break;case 5:var h=t.stateNode;if(n===null&&t.flags&4){n=h;var g=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":g.autoFocus&&n.focus();break;case"img":g.src&&(n.src=g.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var R=t.alternate;if(R!==null){var F=R.memoizedState;if(F!==null){var B=F.dehydrated;B!==null&&Nr(B)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(u(163))}Ge||t.flags&512&&Bo(t)}catch(A){Oe(t,t.return,A)}}if(t===e){Z=null;break}if(n=t.sibling,n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Hu(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Z=n;break}Z=t.return}}function Qu(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ql(4,t)}catch(g){Oe(t,n,g)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(g){Oe(t,s,g)}}var i=t.return;try{Bo(t)}catch(g){Oe(t,i,g)}break;case 5:var c=t.return;try{Bo(t)}catch(g){Oe(t,c,g)}}}catch(g){Oe(t,t.return,g)}if(t===e){Z=null;break}var h=t.sibling;if(h!==null){h.return=t.return,Z=h;break}Z=t.return}}var Df=Math.ceil,Gl=P.ReactCurrentDispatcher,$o=P.ReactCurrentOwner,St=P.ReactCurrentBatchConfig,Se=0,Ve=null,Be=null,Qe=0,pt=0,sr=en(0),$e=0,Yr=null,Cn=0,Xl=0,bo=0,Jr=null,it=null,Vo=0,or=1/0,Vt=null,Zl=!1,Ko=null,on=null,es=!1,an=null,ts=0,qr=0,Ho=null,ns=-1,rs=0;function tt(){return(Se&6)!==0?Me():ns!==-1?ns:ns=Me()}function un(e){return(e.mode&1)===0?1:(Se&2)!==0&&Qe!==0?Qe&-Qe:vf.transition!==null?(rs===0&&(rs=Ui()),rs):(e=Ce,e!==0||(e=window.event,e=e===void 0?16:Ji(e.type)),e)}function Pt(e,t,n,r){if(50<qr)throw qr=0,Ho=null,Error(u(185));Sr(e,n,r),((Se&2)===0||e!==Ve)&&(e===Ve&&((Se&2)===0&&(Xl|=n),$e===4&&cn(e,Qe)),at(e,r),n===1&&Se===0&&(t.mode&1)===0&&(or=Me()+500,Rl&&nn()))}function at(e,t){var n=e.callbackNode;yd(e,t);var r=fl(e,e===Ve?Qe:0);if(r===0)n!==null&&Ai(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ai(n),t===1)e.tag===0?yf(Ju.bind(null,e)):Oa(Ju.bind(null,e)),pf(function(){(Se&6)===0&&nn()}),n=null;else{switch(Wi(r)){case 1:n=Cs;break;case 4:n=Fi;break;case 16:n=al;break;case 536870912:n=Bi;break;default:n=al}n=rc(n,Yu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Yu(e,t){if(ns=-1,rs=0,(Se&6)!==0)throw Error(u(327));var n=e.callbackNode;if(ir()&&e.callbackNode!==n)return null;var r=fl(e,e===Ve?Qe:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=ls(e,r);else{t=r;var s=Se;Se|=2;var i=Gu();(Ve!==e||Qe!==t)&&(Vt=null,or=Me()+500,En(e,t));do try{Ff();break}catch(h){qu(e,h)}while(!0);uo(),Gl.current=i,Se=s,Be!==null?t=0:(Ve=null,Qe=0,t=$e)}if(t!==0){if(t===2&&(s=Ns(e),s!==0&&(r=s,t=Qo(e,s))),t===1)throw n=Yr,En(e,0),cn(e,r),at(e,Me()),n;if(t===6)cn(e,r);else{if(s=e.current.alternate,(r&30)===0&&!Mf(s)&&(t=ls(e,r),t===2&&(i=Ns(e),i!==0&&(r=i,t=Qo(e,i))),t===1))throw n=Yr,En(e,0),cn(e,r),at(e,Me()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(u(345));case 2:_n(e,it,Vt);break;case 3:if(cn(e,r),(r&130023424)===r&&(t=Vo+500-Me(),10<t)){if(fl(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){tt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Xs(_n.bind(null,e,it,Vt),t);break}_n(e,it,Vt);break;case 4:if(cn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var c=31-wt(r);i=1<<c,c=t[c],c>s&&(s=c),r&=~i}if(r=s,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Df(r/1960))-r,10<r){e.timeoutHandle=Xs(_n.bind(null,e,it,Vt),r);break}_n(e,it,Vt);break;case 5:_n(e,it,Vt);break;default:throw Error(u(329))}}}return at(e,Me()),e.callbackNode===n?Yu.bind(null,e):null}function Qo(e,t){var n=Jr;return e.current.memoizedState.isDehydrated&&(En(e,t).flags|=256),e=ls(e,t),e!==2&&(t=it,it=n,t!==null&&Yo(t)),e}function Yo(e){it===null?it=e:it.push.apply(it,e)}function Mf(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!kt(i(),s))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 cn(e,t){for(t&=~bo,t&=~Xl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-wt(t),r=1<<n;e[n]=-1,t&=~r}}function Ju(e){if((Se&6)!==0)throw Error(u(327));ir();var t=fl(e,0);if((t&1)===0)return at(e,Me()),null;var n=ls(e,t);if(e.tag!==0&&n===2){var r=Ns(e);r!==0&&(t=r,n=Qo(e,r))}if(n===1)throw n=Yr,En(e,0),cn(e,t),at(e,Me()),n;if(n===6)throw Error(u(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,_n(e,it,Vt),at(e,Me()),null}function Jo(e,t){var n=Se;Se|=1;try{return e(t)}finally{Se=n,Se===0&&(or=Me()+500,Rl&&nn())}}function Nn(e){an!==null&&an.tag===0&&(Se&6)===0&&ir();var t=Se;Se|=1;var n=St.transition,r=Ce;try{if(St.transition=null,Ce=1,e)return e()}finally{Ce=r,St.transition=n,Se=t,(Se&6)===0&&nn()}}function qo(){pt=sr.current,Te(sr)}function En(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ff(n)),Be!==null)for(n=Be.return;n!==null;){var r=n;switch(lo(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Tl();break;case 3:nr(),Te(lt),Te(Ye),vo();break;case 5:go(r);break;case 4:nr();break;case 13:Te(ze);break;case 19:Te(ze);break;case 10:co(r.type._context);break;case 22:case 23:qo()}n=n.return}if(Ve=e,Be=e=dn(e.current,null),Qe=pt=t,$e=0,Yr=null,bo=Xl=Cn=0,it=Jr=null,jn!==null){for(t=0;t<jn.length;t++)if(n=jn[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var c=i.next;i.next=s,r.next=c}n.pending=r}jn=null}return e}function qu(e,t){do{var n=Be;try{if(uo(),Wl.current=Kl,$l){for(var r=Ie.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}$l=!1}if(kn=0,be=We=Ie=null,$r=!1,br=0,$o.current=null,n===null||n.return===null){$e=1,Yr=t,Be=null;break}e:{var i=e,c=n.return,h=n,g=t;if(t=Qe,h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){var R=g,F=h,B=F.tag;if((F.mode&1)===0&&(B===0||B===11||B===15)){var A=F.alternate;A?(F.updateQueue=A.updateQueue,F.memoizedState=A.memoizedState,F.lanes=A.lanes):(F.updateQueue=null,F.memoizedState=null)}var q=ju(c);if(q!==null){q.flags&=-257,wu(q,c,h,i,t),q.mode&1&&Su(i,R,t),t=q,g=R;var ee=t.updateQueue;if(ee===null){var te=new Set;te.add(g),t.updateQueue=te}else ee.add(g);break e}else{if((t&1)===0){Su(i,R,t),Go();break e}g=Error(u(426))}}else if(Re&&h.mode&1){var Ae=ju(c);if(Ae!==null){(Ae.flags&65536)===0&&(Ae.flags|=256),wu(Ae,c,h,i,t),io(rr(g,h));break e}}i=g=rr(g,h),$e!==4&&($e=2),Jr===null?Jr=[i]:Jr.push(i),i=c;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var E=vu(i,g,t);Ka(i,E);break e;case 1:h=g;var x=i.type,T=i.stateNode;if((i.flags&128)===0&&(typeof x.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(on===null||!on.has(T)))){i.flags|=65536,t&=-t,i.lanes|=t;var $=xu(i,h,t);Ka(i,$);break e}}i=i.return}while(i!==null)}Zu(n)}catch(ne){t=ne,Be===n&&n!==null&&(Be=n=n.return);continue}break}while(!0)}function Gu(){var e=Gl.current;return Gl.current=Kl,e===null?Kl:e}function Go(){($e===0||$e===3||$e===2)&&($e=4),Ve===null||(Cn&268435455)===0&&(Xl&268435455)===0||cn(Ve,Qe)}function ls(e,t){var n=Se;Se|=2;var r=Gu();(Ve!==e||Qe!==t)&&(Vt=null,En(e,t));do try{Af();break}catch(s){qu(e,s)}while(!0);if(uo(),Se=n,Gl.current=r,Be!==null)throw Error(u(261));return Ve=null,Qe=0,$e}function Af(){for(;Be!==null;)Xu(Be)}function Ff(){for(;Be!==null&&!ad();)Xu(Be)}function Xu(e){var t=nc(e.alternate,e,pt);e.memoizedProps=e.pendingProps,t===null?Zu(e):Be=t,$o.current=null}function Zu(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Lf(n,t,pt),n!==null){Be=n;return}}else{if(n=Rf(n,t),n!==null){n.flags&=32767,Be=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{$e=6,Be=null;return}}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);$e===0&&($e=5)}function _n(e,t,n){var r=Ce,s=St.transition;try{St.transition=null,Ce=1,Bf(e,t,n,r)}finally{St.transition=s,Ce=r}return null}function Bf(e,t,n,r){do ir();while(an!==null);if((Se&6)!==0)throw Error(u(327));n=e.finishedWork;var s=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 i=n.lanes|n.childLanes;if(vd(e,i),e===Ve&&(Be=Ve=null,Qe=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||es||(es=!0,rc(al,function(){return ir(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=St.transition,St.transition=null;var c=Ce;Ce=1;var h=Se;Se|=4,$o.current=null,If(e,n),bu(n,e),lf(qs),ml=!!Js,qs=Js=null,e.current=n,Of(n),ud(),Se=h,Ce=c,St.transition=i}else e.current=n;if(es&&(es=!1,an=e,ts=s),i=e.pendingLanes,i===0&&(on=null),fd(n.stateNode),at(e,Me()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Zl)throw Zl=!1,e=Ko,Ko=null,e;return(ts&1)!==0&&e.tag!==0&&ir(),i=e.pendingLanes,(i&1)!==0?e===Ho?qr++:(qr=0,Ho=e):qr=0,nn(),null}function ir(){if(an!==null){var e=Wi(ts),t=St.transition,n=Ce;try{if(St.transition=null,Ce=16>e?16:e,an===null)var r=!1;else{if(e=an,an=null,ts=0,(Se&6)!==0)throw Error(u(331));var s=Se;for(Se|=4,Z=e.current;Z!==null;){var i=Z,c=i.child;if((Z.flags&16)!==0){var h=i.deletions;if(h!==null){for(var g=0;g<h.length;g++){var R=h[g];for(Z=R;Z!==null;){var F=Z;switch(F.tag){case 0:case 11:case 15:Qr(8,F,i)}var B=F.child;if(B!==null)B.return=F,Z=B;else for(;Z!==null;){F=Z;var A=F.sibling,q=F.return;if(Fu(F),F===R){Z=null;break}if(A!==null){A.return=q,Z=A;break}Z=q}}}var ee=i.alternate;if(ee!==null){var te=ee.child;if(te!==null){ee.child=null;do{var Ae=te.sibling;te.sibling=null,te=Ae}while(te!==null)}}Z=i}}if((i.subtreeFlags&2064)!==0&&c!==null)c.return=i,Z=c;else e:for(;Z!==null;){if(i=Z,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:Qr(9,i,i.return)}var E=i.sibling;if(E!==null){E.return=i.return,Z=E;break e}Z=i.return}}var x=e.current;for(Z=x;Z!==null;){c=Z;var T=c.child;if((c.subtreeFlags&2064)!==0&&T!==null)T.return=c,Z=T;else e:for(c=x;Z!==null;){if(h=Z,(h.flags&2048)!==0)try{switch(h.tag){case 0:case 11:case 15:ql(9,h)}}catch(ne){Oe(h,h.return,ne)}if(h===c){Z=null;break e}var $=h.sibling;if($!==null){$.return=h.return,Z=$;break e}Z=h.return}}if(Se=s,nn(),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(ul,e)}catch{}r=!0}return r}finally{Ce=n,St.transition=t}}return!1}function ec(e,t,n){t=rr(n,t),t=vu(e,t,1),e=ln(e,t,1),t=tt(),e!==null&&(Sr(e,1,t),at(e,t))}function Oe(e,t,n){if(e.tag===3)ec(e,e,n);else for(;t!==null;){if(t.tag===3){ec(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(on===null||!on.has(r))){e=rr(n,e),e=xu(t,e,1),t=ln(t,e,1),e=tt(),t!==null&&(Sr(t,1,e),at(t,e));break}}t=t.return}}function Uf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=tt(),e.pingedLanes|=e.suspendedLanes&n,Ve===e&&(Qe&n)===n&&($e===4||$e===3&&(Qe&130023424)===Qe&&500>Me()-Vo?En(e,0):bo|=n),at(e,t)}function tc(e,t){t===0&&((e.mode&1)===0?t=1:(t=dl,dl<<=1,(dl&130023424)===0&&(dl=4194304)));var n=tt();e=Wt(e,t),e!==null&&(Sr(e,t,n),at(e,n))}function Wf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),tc(e,n)}function $f(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(u(314))}r!==null&&r.delete(t),tc(e,n)}var nc;nc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||lt.current)ot=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ot=!1,Tf(e,t,n);ot=(e.flags&131072)!==0}else ot=!1,Re&&(t.flags&1048576)!==0&&Da(t,Il,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Yl(e,t),e=t.pendingProps;var s=Jn(t,Ye.current);tr(t,n),s=jo(null,t,r,e,s,n);var i=wo();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,st(r)?(i=!0,Ll(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,ho(t),s.updater=Hl,t.stateNode=s,s._reactInternals=t,Po(t,r,e,n),t=zo(null,t,r,!0,i,n)):(t.tag=0,Re&&i&&ro(t),et(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Yl(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Vf(r),e=Nt(r,e),s){case 0:t=Ro(null,t,r,e,n);break e;case 1:t=Pu(null,t,r,e,n);break e;case 11:t=ku(null,t,r,e,n);break e;case 14:t=Cu(null,t,r,Nt(r.type,e),n);break e}throw Error(u(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nt(r,s),Ro(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nt(r,s),Pu(e,t,r,s,n);case 3:e:{if(Tu(t),e===null)throw Error(u(387));r=t.pendingProps,i=t.memoizedState,s=i.element,Va(e,t),Bl(t,r,null,n);var c=t.memoizedState;if(r=c.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=rr(Error(u(423)),t),t=Lu(e,t,r,n,s);break e}else if(r!==s){s=rr(Error(u(424)),t),t=Lu(e,t,r,n,s);break e}else for(ft=Zt(t.stateNode.containerInfo.firstChild),dt=t,Re=!0,Ct=null,n=$a(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Xn(),r===s){t=bt(e,t,n);break e}et(e,t,r,n)}t=t.child}return t;case 5:return Qa(t),e===null&&oo(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,c=s.children,Gs(r,s)?c=null:i!==null&&Gs(r,i)&&(t.flags|=32),_u(e,t),et(e,t,c,n),t.child;case 6:return e===null&&oo(t),null;case 13:return Ru(e,t,n);case 4:return mo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zn(t,null,r,n):et(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nt(r,s),ku(e,t,r,s,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,c=s.value,_e(Ml,r._currentValue),r._currentValue=c,i!==null)if(kt(i.value,c)){if(i.children===s.children&&!lt.current){t=bt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var h=i.dependencies;if(h!==null){c=i.child;for(var g=h.firstContext;g!==null;){if(g.context===r){if(i.tag===1){g=$t(-1,n&-n),g.tag=2;var R=i.updateQueue;if(R!==null){R=R.shared;var F=R.pending;F===null?g.next=g:(g.next=F.next,F.next=g),R.pending=g}}i.lanes|=n,g=i.alternate,g!==null&&(g.lanes|=n),fo(i.return,n,t),h.lanes|=n;break}g=g.next}}else if(i.tag===10)c=i.type===t.type?null:i.child;else if(i.tag===18){if(c=i.return,c===null)throw Error(u(341));c.lanes|=n,h=c.alternate,h!==null&&(h.lanes|=n),fo(c,n,t),c=i.sibling}else c=i.child;if(c!==null)c.return=i;else for(c=i;c!==null;){if(c===t){c=null;break}if(i=c.sibling,i!==null){i.return=c.return,c=i;break}c=c.return}i=c}et(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,tr(t,n),s=vt(s),r=r(s),t.flags|=1,et(e,t,r,n),t.child;case 14:return r=t.type,s=Nt(r,t.pendingProps),s=Nt(r.type,s),Cu(e,t,r,s,n);case 15:return Nu(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nt(r,s),Yl(e,t),t.tag=1,st(r)?(e=!0,Ll(t)):e=!1,tr(t,n),gu(t,r,s),Po(t,r,s,n),zo(null,t,r,!0,e,n);case 19:return Iu(e,t,n);case 22:return Eu(e,t,n)}throw Error(u(156,t.tag))};function rc(e,t){return Mi(e,t)}function bf(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jt(e,t,n,r){return new bf(e,t,n,r)}function Xo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vf(e){if(typeof e=="function")return Xo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ue)return 11;if(e===V)return 14}return 2}function dn(e,t){var n=e.alternate;return n===null?(n=jt(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 ss(e,t,n,r,s,i){var c=2;if(r=e,typeof e=="function")Xo(e)&&(c=1);else if(typeof e=="string")c=5;else e:switch(e){case ce:return Pn(n.children,s,i,t);case ge:c=8,s|=8;break;case X:return e=jt(12,n,t,s|2),e.elementType=X,e.lanes=i,e;case J:return e=jt(13,n,t,s),e.elementType=J,e.lanes=i,e;case ie:return e=jt(19,n,t,s),e.elementType=ie,e.lanes=i,e;case ue:return os(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case me:c=10;break e;case De:c=9;break e;case Ue:c=11;break e;case V:c=14;break e;case ae:c=16,r=null;break e}throw Error(u(130,e==null?e:typeof e,""))}return t=jt(c,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Pn(e,t,n,r){return e=jt(7,e,r,t),e.lanes=n,e}function os(e,t,n,r){return e=jt(22,e,r,t),e.elementType=ue,e.lanes=n,e.stateNode={isHidden:!1},e}function Zo(e,t,n){return e=jt(6,e,null,t),e.lanes=n,e}function ei(e,t,n){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Kf(e,t,n,r,s){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=Es(0),this.expirationTimes=Es(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Es(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ti(e,t,n,r,s,i,c,h,g){return e=new Kf(e,t,n,h,g),t===1?(t=1,i===!0&&(t|=8)):t=0,i=jt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ho(i),e}function Hf(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:b,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function lc(e){if(!e)return tn;e=e._reactInternals;e:{if(gn(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(st(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(st(n))return za(e,n,t)}return t}function sc(e,t,n,r,s,i,c,h,g){return e=ti(n,r,!0,e,s,i,c,h,g),e.context=lc(null),n=e.current,r=tt(),s=un(n),i=$t(r,s),i.callback=t??null,ln(n,i,s),e.current.lanes=s,Sr(e,s,r),at(e,r),e}function is(e,t,n,r){var s=t.current,i=tt(),c=un(s);return n=lc(n),t.context===null?t.context=n:t.pendingContext=n,t=$t(i,c),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ln(s,t,c),e!==null&&(Pt(e,s,c,i),Fl(e,s,c)),c}function as(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 oc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ni(e,t){oc(e,t),(e=e.alternate)&&oc(e,t)}function Qf(){return null}var ic=typeof reportError=="function"?reportError:function(e){console.error(e)};function ri(e){this._internalRoot=e}us.prototype.render=ri.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));is(e,t,null,null)},us.prototype.unmount=ri.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nn(function(){is(null,e,null,null)}),t[At]=null}};function us(e){this._internalRoot=e}us.prototype.unstable_scheduleHydration=function(e){if(e){var t=Vi();e={blockedOn:null,target:e,priority:t};for(var n=0;n<qt.length&&t!==0&&t<qt[n].priority;n++);qt.splice(n,0,e),n===0&&Qi(e)}};function li(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function cs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ac(){}function Yf(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var R=as(c);i.call(R)}}var c=sc(t,r,e,0,null,!1,!1,"",ac);return e._reactRootContainer=c,e[At]=c.current,Or(e.nodeType===8?e.parentNode:e),Nn(),c}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var h=r;r=function(){var R=as(g);h.call(R)}}var g=ti(e,0,!1,null,null,!1,!1,"",ac);return e._reactRootContainer=g,e[At]=g.current,Or(e.nodeType===8?e.parentNode:e),Nn(function(){is(t,g,n,r)}),g}function ds(e,t,n,r,s){var i=n._reactRootContainer;if(i){var c=i;if(typeof s=="function"){var h=s;s=function(){var g=as(c);h.call(g)}}is(t,c,e,s)}else c=Yf(n,t,e,s,r);return as(c)}$i=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=xr(t.pendingLanes);n!==0&&(_s(t,n|1),at(t,Me()),(Se&6)===0&&(or=Me()+500,nn()))}break;case 13:Nn(function(){var r=Wt(e,1);if(r!==null){var s=tt();Pt(r,e,1,s)}}),ni(e,1)}},Ps=function(e){if(e.tag===13){var t=Wt(e,134217728);if(t!==null){var n=tt();Pt(t,e,134217728,n)}ni(e,134217728)}},bi=function(e){if(e.tag===13){var t=un(e),n=Wt(e,t);if(n!==null){var r=tt();Pt(n,e,t,r)}ni(e,t)}},Vi=function(){return Ce},Ki=function(e,t){var n=Ce;try{return Ce=e,t()}finally{Ce=n}},Ss=function(e,t,n){switch(t){case"input":if(Ht(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 r=n[t];if(r!==e&&r.form===e.form){var s=Pl(r);if(!s)throw Error(u(90));nl(r),Ht(r,s)}}}break;case"textarea":hr(e,n);break;case"select":t=n.value,t!=null&&Le(e,!!n.multiple,t,!1)}},Ti=Jo,Li=Nn;var Jf={usingClientEntryPoint:!1,Events:[Ar,Qn,Pl,_i,Pi,Jo]},Gr={findFiberByHostInstance:yn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},qf={bundleType:Gr.bundleType,version:Gr.version,rendererPackageName:Gr.rendererPackageName,rendererConfig:Gr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Oi(e),e===null?null:e.stateNode},findFiberByHostInstance:Gr.findFiberByHostInstance||Qf,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 fs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fs.isDisabled&&fs.supportsFiber)try{ul=fs.inject(qf),Lt=fs}catch{}}return ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jf,ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!li(t))throw Error(u(200));return Hf(e,t,null,n)},ut.createRoot=function(e,t){if(!li(e))throw Error(u(299));var n=!1,r="",s=ic;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=ti(e,1,!1,null,null,n,!1,r,s),e[At]=t.current,Or(e.nodeType===8?e.parentNode:e),new ri(t)},ut.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=Oi(t),e=e===null?null:e.stateNode,e},ut.flushSync=function(e){return Nn(e)},ut.hydrate=function(e,t,n){if(!cs(t))throw Error(u(200));return ds(null,e,t,!0,n)},ut.hydrateRoot=function(e,t,n){if(!li(e))throw Error(u(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",c=ic;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(c=n.onRecoverableError)),t=sc(t,null,e,1,n??null,s,!1,i,c),e[At]=t.current,Or(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new us(t)},ut.render=function(e,t,n){if(!cs(t))throw Error(u(200));return ds(null,e,t,!1,n)},ut.unmountComponentAtNode=function(e){if(!cs(e))throw Error(u(40));return e._reactRootContainer?(Nn(function(){ds(null,null,e,!1,function(){e._reactRootContainer=null,e[At]=null})}),!0):!1},ut.unstable_batchedUpdates=Jo,ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!cs(n))throw Error(u(200));if(e==null||e._reactInternals===void 0)throw Error(u(38));return ds(e,t,n,!1,r)},ut.version="18.3.1-next-f1338f8080-20240426",ut}var gc;function Ac(){if(gc)return ii.exports;gc=1;function o(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(a){console.error(a)}}return o(),ii.exports=ap(),ii.exports}var yc;function up(){if(yc)return ps;yc=1;var o=Ac();return ps.createRoot=o.createRoot,ps.hydrateRoot=o.hydrateRoot,ps}var cp=up(),dp=Ac();/**
41
- * @remix-run/router v1.23.2
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */function Zr(){return Zr=Object.assign?Object.assign.bind():function(o){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(o[d]=u[d])}return o},Zr.apply(this,arguments)}var pn;(function(o){o.Pop="POP",o.Push="PUSH",o.Replace="REPLACE"})(pn||(pn={}));const vc="popstate";function fp(o){o===void 0&&(o={});function a(d,p){let{pathname:m,search:S,hash:w}=d.location;return pi("",{pathname:m,search:S,hash:w},p.state&&p.state.usr||null,p.state&&p.state.key||"default")}function u(d,p){return typeof p=="string"?p:hs(p)}return hp(a,u,null,o)}function Fe(o,a){if(o===!1||o===null||typeof o>"u")throw new Error(a)}function vi(o,a){if(!o){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function pp(){return Math.random().toString(36).substr(2,8)}function xc(o,a){return{usr:o.state,key:o.key,idx:a}}function pi(o,a,u,d){return u===void 0&&(u=null),Zr({pathname:typeof o=="string"?o:o.pathname,search:"",hash:""},typeof a=="string"?ur(a):a,{state:u,key:a&&a.key||d||pp()})}function hs(o){let{pathname:a="/",search:u="",hash:d=""}=o;return u&&u!=="?"&&(a+=u.charAt(0)==="?"?u:"?"+u),d&&d!=="#"&&(a+=d.charAt(0)==="#"?d:"#"+d),a}function ur(o){let a={};if(o){let u=o.indexOf("#");u>=0&&(a.hash=o.substr(u),o=o.substr(0,u));let d=o.indexOf("?");d>=0&&(a.search=o.substr(d),o=o.substr(0,d)),o&&(a.pathname=o)}return a}function hp(o,a,u,d){d===void 0&&(d={});let{window:p=document.defaultView,v5Compat:m=!1}=d,S=p.history,w=pn.Pop,v=null,k=_();k==null&&(k=0,S.replaceState(Zr({},S.state,{idx:k}),""));function _(){return(S.state||{idx:null}).idx}function j(){w=pn.Pop;let N=_(),z=N==null?null:N-k;k=N,v&&v({action:w,location:y.location,delta:z})}function I(N,z){w=pn.Push;let W=pi(y.location,N,z);k=_()+1;let L=xc(W,k),P=y.createHref(W);try{S.pushState(L,"",P)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;p.location.assign(P)}m&&v&&v({action:w,location:y.location,delta:1})}function U(N,z){w=pn.Replace;let W=pi(y.location,N,z);k=_();let L=xc(W,k),P=y.createHref(W);S.replaceState(L,"",P),m&&v&&v({action:w,location:y.location,delta:0})}function O(N){let z=p.location.origin!=="null"?p.location.origin:p.location.href,W=typeof N=="string"?N:hs(N);return W=W.replace(/ $/,"%20"),Fe(z,"No window.location.(origin|href) available to create URL for href: "+W),new URL(W,z)}let y={get action(){return w},get location(){return o(p,S)},listen(N){if(v)throw new Error("A history only accepts one active listener");return p.addEventListener(vc,j),v=N,()=>{p.removeEventListener(vc,j),v=null}},createHref(N){return a(p,N)},createURL:O,encodeLocation(N){let z=O(N);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:I,replace:U,go(N){return S.go(N)}};return y}var Sc;(function(o){o.data="data",o.deferred="deferred",o.redirect="redirect",o.error="error"})(Sc||(Sc={}));function mp(o,a,u){return u===void 0&&(u="/"),gp(o,a,u)}function gp(o,a,u,d){let p=typeof a=="string"?ur(a):a,m=xi(p.pathname||"/",u);if(m==null)return null;let S=Fc(o);yp(S);let w=null;for(let v=0;w==null&&v<S.length;++v){let k=Tp(m);w=Ep(S[v],k)}return w}function Fc(o,a,u,d){a===void 0&&(a=[]),u===void 0&&(u=[]),d===void 0&&(d="");let p=(m,S,w)=>{let v={relativePath:w===void 0?m.path||"":w,caseSensitive:m.caseSensitive===!0,childrenIndex:S,route:m};v.relativePath.startsWith("/")&&(Fe(v.relativePath.startsWith(d),'Absolute route path "'+v.relativePath+'" nested under path '+('"'+d+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),v.relativePath=v.relativePath.slice(d.length));let k=hn([d,v.relativePath]),_=u.concat(v);m.children&&m.children.length>0&&(Fe(m.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+k+'".')),Fc(m.children,a,_,k)),!(m.path==null&&!m.index)&&a.push({path:k,score:Cp(k,m.index),routesMeta:_})};return o.forEach((m,S)=>{var w;if(m.path===""||!((w=m.path)!=null&&w.includes("?")))p(m,S);else for(let v of Bc(m.path))p(m,S,v)}),a}function Bc(o){let a=o.split("/");if(a.length===0)return[];let[u,...d]=a,p=u.endsWith("?"),m=u.replace(/\?$/,"");if(d.length===0)return p?[m,""]:[m];let S=Bc(d.join("/")),w=[];return w.push(...S.map(v=>v===""?m:[m,v].join("/"))),p&&w.push(...S),w.map(v=>o.startsWith("/")&&v===""?"/":v)}function yp(o){o.sort((a,u)=>a.score!==u.score?u.score-a.score:Np(a.routesMeta.map(d=>d.childrenIndex),u.routesMeta.map(d=>d.childrenIndex)))}const vp=/^:[\w-]+$/,xp=3,Sp=2,jp=1,wp=10,kp=-2,jc=o=>o==="*";function Cp(o,a){let u=o.split("/"),d=u.length;return u.some(jc)&&(d+=kp),a&&(d+=Sp),u.filter(p=>!jc(p)).reduce((p,m)=>p+(vp.test(m)?xp:m===""?jp:wp),d)}function Np(o,a){return o.length===a.length&&o.slice(0,-1).every((d,p)=>d===a[p])?o[o.length-1]-a[a.length-1]:0}function Ep(o,a,u){let{routesMeta:d}=o,p={},m="/",S=[];for(let w=0;w<d.length;++w){let v=d[w],k=w===d.length-1,_=m==="/"?a:a.slice(m.length)||"/",j=_p({path:v.relativePath,caseSensitive:v.caseSensitive,end:k},_),I=v.route;if(!j)return null;Object.assign(p,j.params),S.push({params:p,pathname:hn([m,j.pathname]),pathnameBase:Op(hn([m,j.pathnameBase])),route:I}),j.pathnameBase!=="/"&&(m=hn([m,j.pathnameBase]))}return S}function _p(o,a){typeof o=="string"&&(o={path:o,caseSensitive:!1,end:!0});let[u,d]=Pp(o.path,o.caseSensitive,o.end),p=a.match(u);if(!p)return null;let m=p[0],S=m.replace(/(.)\/+$/,"$1"),w=p.slice(1);return{params:d.reduce((k,_,j)=>{let{paramName:I,isOptional:U}=_;if(I==="*"){let y=w[j]||"";S=m.slice(0,m.length-y.length).replace(/(.)\/+$/,"$1")}const O=w[j];return U&&!O?k[I]=void 0:k[I]=(O||"").replace(/%2F/g,"/"),k},{}),pathname:m,pathnameBase:S,pattern:o}}function Pp(o,a,u){a===void 0&&(a=!1),u===void 0&&(u=!0),vi(o==="*"||!o.endsWith("*")||o.endsWith("/*"),'Route path "'+o+'" will be treated as if it were '+('"'+o.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+o.replace(/\*$/,"/*")+'".'));let d=[],p="^"+o.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(S,w,v)=>(d.push({paramName:w,isOptional:v!=null}),v?"/?([^\\/]+)?":"/([^\\/]+)"));return o.endsWith("*")?(d.push({paramName:"*"}),p+=o==="*"||o==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):u?p+="\\/*$":o!==""&&o!=="/"&&(p+="(?:(?=\\/|$))"),[new RegExp(p,a?void 0:"i"),d]}function Tp(o){try{return o.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return vi(!1,'The URL path "'+o+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),o}}function xi(o,a){if(a==="/")return o;if(!o.toLowerCase().startsWith(a.toLowerCase()))return null;let u=a.endsWith("/")?a.length-1:a.length,d=o.charAt(u);return d&&d!=="/"?null:o.slice(u)||"/"}const Lp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rp=o=>Lp.test(o);function zp(o,a){a===void 0&&(a="/");let{pathname:u,search:d="",hash:p=""}=typeof o=="string"?ur(o):o,m;if(u)if(Rp(u))m=u;else{if(u.includes("//")){let S=u;u=u.replace(/\/\/+/g,"/"),vi(!1,"Pathnames cannot have embedded double slashes - normalizing "+(S+" -> "+u))}u.startsWith("/")?m=wc(u.substring(1),"/"):m=wc(u,a)}else m=a;return{pathname:m,search:Dp(d),hash:Mp(p)}}function wc(o,a){let u=a.replace(/\/+$/,"").split("/");return o.split("/").forEach(p=>{p===".."?u.length>1&&u.pop():p!=="."&&u.push(p)}),u.length>1?u.join("/"):"/"}function ci(o,a,u,d){return"Cannot include a '"+o+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(d)+"]. Please separate it out to the ")+("`to."+u+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ip(o){return o.filter((a,u)=>u===0||a.route.path&&a.route.path.length>0)}function Si(o,a){let u=Ip(o);return a?u.map((d,p)=>p===u.length-1?d.pathname:d.pathnameBase):u.map(d=>d.pathnameBase)}function ji(o,a,u,d){d===void 0&&(d=!1);let p;typeof o=="string"?p=ur(o):(p=Zr({},o),Fe(!p.pathname||!p.pathname.includes("?"),ci("?","pathname","search",p)),Fe(!p.pathname||!p.pathname.includes("#"),ci("#","pathname","hash",p)),Fe(!p.search||!p.search.includes("#"),ci("#","search","hash",p)));let m=o===""||p.pathname==="",S=m?"/":p.pathname,w;if(S==null)w=u;else{let j=a.length-1;if(!d&&S.startsWith("..")){let I=S.split("/");for(;I[0]==="..";)I.shift(),j-=1;p.pathname=I.join("/")}w=j>=0?a[j]:"/"}let v=zp(p,w),k=S&&S!=="/"&&S.endsWith("/"),_=(m||S===".")&&u.endsWith("/");return!v.pathname.endsWith("/")&&(k||_)&&(v.pathname+="/"),v}const hn=o=>o.join("/").replace(/\/\/+/g,"/"),Op=o=>o.replace(/\/+$/,"").replace(/^\/*/,"/"),Dp=o=>!o||o==="?"?"":o.startsWith("?")?o:"?"+o,Mp=o=>!o||o==="#"?"":o.startsWith("#")?o:"#"+o;function Ap(o){return o!=null&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.internal=="boolean"&&"data"in o}const Uc=["post","put","patch","delete"];new Set(Uc);const Fp=["get",...Uc];new Set(Fp);/**
50
- * React Router v6.30.3
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */function el(){return el=Object.assign?Object.assign.bind():function(o){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(o[d]=u[d])}return o},el.apply(this,arguments)}const wi=f.createContext(null),Bp=f.createContext(null),mn=f.createContext(null),ms=f.createContext(null),Kt=f.createContext({outlet:null,matches:[],isDataRoute:!1}),Wc=f.createContext(null);function Up(o,a){let{relative:u}=a===void 0?{}:a;cr()||Fe(!1);let{basename:d,navigator:p}=f.useContext(mn),{hash:m,pathname:S,search:w}=Vc(o,{relative:u}),v=S;return d!=="/"&&(v=S==="/"?d:hn([d,S])),p.createHref({pathname:v,search:w,hash:m})}function cr(){return f.useContext(ms)!=null}function dr(){return cr()||Fe(!1),f.useContext(ms).location}function $c(o){f.useContext(mn).static||f.useLayoutEffect(o)}function bc(){let{isDataRoute:o}=f.useContext(Kt);return o?th():Wp()}function Wp(){cr()||Fe(!1);let o=f.useContext(wi),{basename:a,future:u,navigator:d}=f.useContext(mn),{matches:p}=f.useContext(Kt),{pathname:m}=dr(),S=JSON.stringify(Si(p,u.v7_relativeSplatPath)),w=f.useRef(!1);return $c(()=>{w.current=!0}),f.useCallback(function(k,_){if(_===void 0&&(_={}),!w.current)return;if(typeof k=="number"){d.go(k);return}let j=ji(k,JSON.parse(S),m,_.relative==="path");o==null&&a!=="/"&&(j.pathname=j.pathname==="/"?a:hn([a,j.pathname])),(_.replace?d.replace:d.push)(j,_.state,_)},[a,d,S,m,o])}const $p=f.createContext(null);function bp(o){let a=f.useContext(Kt).outlet;return a&&f.createElement($p.Provider,{value:o},a)}function Vc(o,a){let{relative:u}=a===void 0?{}:a,{future:d}=f.useContext(mn),{matches:p}=f.useContext(Kt),{pathname:m}=dr(),S=JSON.stringify(Si(p,d.v7_relativeSplatPath));return f.useMemo(()=>ji(o,JSON.parse(S),m,u==="path"),[o,S,m,u])}function Vp(o,a){return Kp(o,a)}function Kp(o,a,u,d){cr()||Fe(!1);let{navigator:p}=f.useContext(mn),{matches:m}=f.useContext(Kt),S=m[m.length-1],w=S?S.params:{};S&&S.pathname;let v=S?S.pathnameBase:"/";S&&S.route;let k=dr(),_;if(a){var j;let N=typeof a=="string"?ur(a):a;v==="/"||(j=N.pathname)!=null&&j.startsWith(v)||Fe(!1),_=N}else _=k;let I=_.pathname||"/",U=I;if(v!=="/"){let N=v.replace(/^\//,"").split("/");U="/"+I.replace(/^\//,"").split("/").slice(N.length).join("/")}let O=mp(o,{pathname:U}),y=qp(O&&O.map(N=>Object.assign({},N,{params:Object.assign({},w,N.params),pathname:hn([v,p.encodeLocation?p.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?v:hn([v,p.encodeLocation?p.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),m,u,d);return a&&y?f.createElement(ms.Provider,{value:{location:el({pathname:"/",search:"",hash:"",state:null,key:"default"},_),navigationType:pn.Pop}},y):y}function Hp(){let o=eh(),a=Ap(o)?o.status+" "+o.statusText:o instanceof Error?o.message:JSON.stringify(o),u=o instanceof Error?o.stack:null,p={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},a),u?f.createElement("pre",{style:p},u):null,null)}const Qp=f.createElement(Hp,null);class Yp extends f.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,u){return u.location!==a.location||u.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:u.error,location:u.location,revalidation:a.revalidation||u.revalidation}}componentDidCatch(a,u){console.error("React Router caught the following error during render",a,u)}render(){return this.state.error!==void 0?f.createElement(Kt.Provider,{value:this.props.routeContext},f.createElement(Wc.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Jp(o){let{routeContext:a,match:u,children:d}=o,p=f.useContext(wi);return p&&p.static&&p.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(p.staticContext._deepestRenderedBoundaryId=u.route.id),f.createElement(Kt.Provider,{value:a},d)}function qp(o,a,u,d){var p;if(a===void 0&&(a=[]),u===void 0&&(u=null),d===void 0&&(d=null),o==null){var m;if(!u)return null;if(u.errors)o=u.matches;else if((m=d)!=null&&m.v7_partialHydration&&a.length===0&&!u.initialized&&u.matches.length>0)o=u.matches;else return null}let S=o,w=(p=u)==null?void 0:p.errors;if(w!=null){let _=S.findIndex(j=>j.route.id&&(w==null?void 0:w[j.route.id])!==void 0);_>=0||Fe(!1),S=S.slice(0,Math.min(S.length,_+1))}let v=!1,k=-1;if(u&&d&&d.v7_partialHydration)for(let _=0;_<S.length;_++){let j=S[_];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(k=_),j.route.id){let{loaderData:I,errors:U}=u,O=j.route.loader&&I[j.route.id]===void 0&&(!U||U[j.route.id]===void 0);if(j.route.lazy||O){v=!0,k>=0?S=S.slice(0,k+1):S=[S[0]];break}}}return S.reduceRight((_,j,I)=>{let U,O=!1,y=null,N=null;u&&(U=w&&j.route.id?w[j.route.id]:void 0,y=j.route.errorElement||Qp,v&&(k<0&&I===0?(nh("route-fallback"),O=!0,N=null):k===I&&(O=!0,N=j.route.hydrateFallbackElement||null)));let z=a.concat(S.slice(0,I+1)),W=()=>{let L;return U?L=y:O?L=N:j.route.Component?L=f.createElement(j.route.Component,null):j.route.element?L=j.route.element:L=_,f.createElement(Jp,{match:j,routeContext:{outlet:_,matches:z,isDataRoute:u!=null},children:L})};return u&&(j.route.ErrorBoundary||j.route.errorElement||I===0)?f.createElement(Yp,{location:u.location,revalidation:u.revalidation,component:y,error:U,children:W(),routeContext:{outlet:null,matches:z,isDataRoute:!0}}):W()},null)}var Kc=(function(o){return o.UseBlocker="useBlocker",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o})(Kc||{}),Hc=(function(o){return o.UseBlocker="useBlocker",o.UseLoaderData="useLoaderData",o.UseActionData="useActionData",o.UseRouteError="useRouteError",o.UseNavigation="useNavigation",o.UseRouteLoaderData="useRouteLoaderData",o.UseMatches="useMatches",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o.UseRouteId="useRouteId",o})(Hc||{});function Gp(o){let a=f.useContext(wi);return a||Fe(!1),a}function Xp(o){let a=f.useContext(Bp);return a||Fe(!1),a}function Zp(o){let a=f.useContext(Kt);return a||Fe(!1),a}function Qc(o){let a=Zp(),u=a.matches[a.matches.length-1];return u.route.id||Fe(!1),u.route.id}function eh(){var o;let a=f.useContext(Wc),u=Xp(),d=Qc();return a!==void 0?a:(o=u.errors)==null?void 0:o[d]}function th(){let{router:o}=Gp(Kc.UseNavigateStable),a=Qc(Hc.UseNavigateStable),u=f.useRef(!1);return $c(()=>{u.current=!0}),f.useCallback(function(p,m){m===void 0&&(m={}),u.current&&(typeof p=="number"?o.navigate(p):o.navigate(p,el({fromRouteId:a},m)))},[o,a])}const kc={};function nh(o,a,u){kc[o]||(kc[o]=!0)}function rh(o,a){o==null||o.v7_startTransition,o==null||o.v7_relativeSplatPath}function lh(o){let{to:a,replace:u,state:d,relative:p}=o;cr()||Fe(!1);let{future:m,static:S}=f.useContext(mn),{matches:w}=f.useContext(Kt),{pathname:v}=dr(),k=bc(),_=ji(a,Si(w,m.v7_relativeSplatPath),v,p==="path"),j=JSON.stringify(_);return f.useEffect(()=>k(JSON.parse(j),{replace:u,state:d,relative:p}),[k,j,p,u,d]),null}function Yc(o){return bp(o.context)}function rt(o){Fe(!1)}function sh(o){let{basename:a="/",children:u=null,location:d,navigationType:p=pn.Pop,navigator:m,static:S=!1,future:w}=o;cr()&&Fe(!1);let v=a.replace(/^\/*/,"/"),k=f.useMemo(()=>({basename:v,navigator:m,static:S,future:el({v7_relativeSplatPath:!1},w)}),[v,w,m,S]);typeof d=="string"&&(d=ur(d));let{pathname:_="/",search:j="",hash:I="",state:U=null,key:O="default"}=d,y=f.useMemo(()=>{let N=xi(_,v);return N==null?null:{location:{pathname:N,search:j,hash:I,state:U,key:O},navigationType:p}},[v,_,j,I,U,O,p]);return y==null?null:f.createElement(mn.Provider,{value:k},f.createElement(ms.Provider,{children:u,value:y}))}function Jc(o){let{children:a,location:u}=o;return Vp(hi(a),u)}new Promise(()=>{});function hi(o,a){a===void 0&&(a=[]);let u=[];return f.Children.forEach(o,(d,p)=>{if(!f.isValidElement(d))return;let m=[...a,p];if(d.type===f.Fragment){u.push.apply(u,hi(d.props.children,m));return}d.type!==rt&&Fe(!1),!d.props.index||!d.props.children||Fe(!1);let S={id:d.props.id||m.join("-"),caseSensitive:d.props.caseSensitive,element:d.props.element,Component:d.props.Component,index:d.props.index,path:d.props.path,loader:d.props.loader,action:d.props.action,errorElement:d.props.errorElement,ErrorBoundary:d.props.ErrorBoundary,hasErrorBoundary:d.props.ErrorBoundary!=null||d.props.errorElement!=null,shouldRevalidate:d.props.shouldRevalidate,handle:d.props.handle,lazy:d.props.lazy};d.props.children&&(S.children=hi(d.props.children,m)),u.push(S)}),u}/**
59
- * React Router DOM v6.30.3
60
- *
61
- * Copyright (c) Remix Software Inc.
62
- *
63
- * This source code is licensed under the MIT license found in the
64
- * LICENSE.md file in the root directory of this source tree.
65
- *
66
- * @license MIT
67
- */function mi(){return mi=Object.assign?Object.assign.bind():function(o){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(o[d]=u[d])}return o},mi.apply(this,arguments)}function oh(o,a){if(o==null)return{};var u={},d=Object.keys(o),p,m;for(m=0;m<d.length;m++)p=d[m],!(a.indexOf(p)>=0)&&(u[p]=o[p]);return u}function ih(o){return!!(o.metaKey||o.altKey||o.ctrlKey||o.shiftKey)}function ah(o,a){return o.button===0&&(!a||a==="_self")&&!ih(o)}const uh=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ch="6";try{window.__reactRouterVersion=ch}catch{}const dh="startTransition",Cc=sp[dh];function qc(o){let{basename:a,children:u,future:d,window:p}=o,m=f.useRef();m.current==null&&(m.current=fp({window:p,v5Compat:!0}));let S=m.current,[w,v]=f.useState({action:S.action,location:S.location}),{v7_startTransition:k}=d||{},_=f.useCallback(j=>{k&&Cc?Cc(()=>v(j)):v(j)},[v,k]);return f.useLayoutEffect(()=>S.listen(_),[S,_]),f.useEffect(()=>rh(d),[d]),f.createElement(sh,{basename:a,children:u,location:w.location,navigationType:w.action,navigator:S,future:d})}const fh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ph=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mt=f.forwardRef(function(a,u){let{onClick:d,relative:p,reloadDocument:m,replace:S,state:w,target:v,to:k,preventScrollReset:_,viewTransition:j}=a,I=oh(a,uh),{basename:U}=f.useContext(mn),O,y=!1;if(typeof k=="string"&&ph.test(k)&&(O=k,fh))try{let L=new URL(window.location.href),P=k.startsWith("//")?new URL(L.protocol+k):new URL(k),M=xi(P.pathname,U);P.origin===L.origin&&M!=null?k=M+P.search+P.hash:y=!0}catch{}let N=Up(k,{relative:p}),z=hh(k,{replace:S,state:w,target:v,preventScrollReset:_,relative:p,viewTransition:j});function W(L){d&&d(L),L.defaultPrevented||z(L)}return f.createElement("a",mi({},I,{href:O||N,onClick:y||m?d:W,ref:u,target:v}))});var Nc;(function(o){o.UseScrollRestoration="useScrollRestoration",o.UseSubmit="useSubmit",o.UseSubmitFetcher="useSubmitFetcher",o.UseFetcher="useFetcher",o.useViewTransitionState="useViewTransitionState"})(Nc||(Nc={}));var Ec;(function(o){o.UseFetcher="useFetcher",o.UseFetchers="useFetchers",o.UseScrollRestoration="useScrollRestoration"})(Ec||(Ec={}));function hh(o,a){let{target:u,replace:d,state:p,preventScrollReset:m,relative:S,viewTransition:w}=a===void 0?{}:a,v=bc(),k=dr(),_=Vc(o,{relative:S});return f.useCallback(j=>{if(ah(j,u)){j.preventDefault();let I=d!==void 0?d:hs(k)===hs(_);v(o,{replace:I,state:p,preventScrollReset:m,relative:S,viewTransition:w})}},[k,v,_,d,p,u,o,m,S,w])}function Gc({sidebar:o,children:a}){return l.jsxs("div",{className:"container",children:[l.jsxs("aside",{className:"sidebar",children:[l.jsx("div",{className:"sidebar-brand",children:l.jsx("img",{src:"/logo_dark.png",alt:"Teleton",style:{height:"64px"}})}),o]}),l.jsx("main",{className:"main",children:a??l.jsx(Yc,{})})]})}const mh="/api/agent/events",gh="/api/agent/status",yh=5,vh=3e4,xh=3e3;function Sh(o){const a=Math.min(1e3*2**o,vh),u=a*.3*Math.random();return a+u}function jh(){const[o,a]=f.useState("stopped"),[u,d]=f.useState(null),p=f.useRef(!0),m=f.useRef(null),S=f.useRef(0),w=f.useRef(null),v=f.useRef(null),k=f.useRef(!1);return f.useEffect(()=>{p.current=!0;function _(N){if(p.current)try{const z=JSON.parse(N.data);a(z.state),d(z.error??null),S.current=0}catch{}}function j(){m.current&&(m.current.removeEventListener("status",_),m.current.close(),m.current=null)}function I(){v.current&&(clearInterval(v.current),v.current=null)}function U(){if(v.current)return;const N=async()=>{if(p.current)try{const z=await fetch(gh,{credentials:"include"});if(!z.ok)return;const W=await z.json(),L=W.data??W;p.current&&(a(L.state),d(L.error??null))}catch{}};N(),v.current=setInterval(N,xh)}function O(){if(!p.current)return;j();const N=new EventSource(mh,{withCredentials:!0});m.current=N,N.addEventListener("status",_),N.addEventListener("open",()=>{S.current=0,k.current=!1,I()}),N.onerror=()=>{if(j(),!!p.current)if(S.current+=1,S.current<=yh){const z=Sh(S.current-1);w.current=setTimeout(O,z)}else k.current=!0,U()}}function y(){document.hidden?(j(),I(),w.current&&(clearTimeout(w.current),w.current=null)):(S.current=0,k.current=!1,O())}return O(),document.addEventListener("visibilitychange",y),()=>{p.current=!1,j(),I(),w.current&&(clearTimeout(w.current),w.current=null),document.removeEventListener("visibilitychange",y)}},[]),{state:o,error:u}}const _c="/api",wh=3,kh=[1e3,2e3,4e3];function Ch(o){return o+o*.3*Math.random()}const Nh={stopped:{dot:"var(--text-tertiary)",label:"Stopped",pulse:!1},starting:{dot:"#FFD60A",label:"Starting...",pulse:!0},running:{dot:"var(--green)",label:"Running",pulse:!0},stopping:{dot:"#FF9F0A",label:"Stopping...",pulse:!0},error:{dot:"var(--red)",label:"Error",pulse:!1}};function Eh(){const{state:o,error:a}=jh(),[u,d]=f.useState(!1),[p,m]=f.useState(!1),[S,w]=f.useState(null),[v,k]=f.useState(!1),_=f.useRef(null),j=f.useRef(null),I=a&&o==="stopped"?"error":o,U=Nh[I],O=f.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),k(!1)},[]),y=f.useCallback(async(M=0)=>{d(!0),w(null),j.current=new AbortController;try{const b=await fetch(`${_c}/agent/start`,{method:"POST",credentials:"include",signal:AbortSignal.timeout(1e4)}),ce=await b.json();if(!b.ok&&ce.error)throw new Error(ce.error)}catch(b){if(!_.current&&M<wh){k(!0);const ce=Ch(kh[M]??4e3);_.current=setTimeout(()=>{_.current=null,y(M+1)},ce),w(b instanceof Error?b.message:String(b)),d(!1);return}w(b instanceof Error?b.message:String(b)),k(!1)}finally{d(!1),j.current=null}},[]),N=f.useCallback(async()=>{m(!1),d(!0),w(null),O();try{const M=await fetch(`${_c}/agent/stop`,{method:"POST",credentials:"include",signal:AbortSignal.timeout(1e4)}),b=await M.json();if(!M.ok&&b.error)throw new Error(b.error)}catch(M){w(M instanceof Error?M.message:String(M))}finally{d(!1)}},[O]),z=()=>{O(),y(0)},W=()=>{m(!0)},L=I==="stopped"||I==="error",P=I==="running";return l.jsxs("div",{style:{padding:"0 12px",marginBottom:"8px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},children:[l.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:U.dot,animation:U.pulse?"agent-pulse 2s ease-in-out infinite":"none",flexShrink:0}}),l.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"var(--text-secondary)"},children:U.label})]}),L&&!v&&l.jsx("button",{onClick:z,disabled:u,style:{width:"100%",background:"var(--green-dim)",color:"var(--green)",border:"1px solid rgba(48, 209, 88, 0.2)",fontSize:"12px",padding:"6px 12px"},children:u?"Starting...":"Start Agent"}),P&&l.jsx("button",{onClick:W,disabled:u,className:"btn-danger",style:{width:"100%",fontSize:"12px",padding:"6px 12px"},children:u?"Stopping...":"Stop Agent"}),v&&l.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:"Retrying..."}),S&&!v&&l.jsx("div",{style:{fontSize:"11px",color:"var(--red)",marginTop:"4px",lineHeight:"1.4",wordBreak:"break-word"},children:S}),p&&dp.createPortal(l.jsx("div",{className:"modal-overlay",onClick:()=>m(!1),children:l.jsxs("div",{className:"modal",onClick:M=>M.stopPropagation(),style:{maxWidth:"360px"},children:[l.jsx("h2",{style:{fontSize:"15px",fontWeight:600,marginBottom:"8px"},children:"Stop Agent?"}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",marginBottom:"20px",lineHeight:"1.5"},children:"Active Telegram sessions will be interrupted."}),l.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[l.jsx("button",{className:"btn-ghost",onClick:()=>m(!1),style:{fontSize:"13px"},children:"Cancel"}),l.jsx("button",{className:"btn-danger",onClick:N,style:{fontSize:"13px"},children:"Stop"})]})]})}),document.body),l.jsx("style",{children:`
68
- @keyframes agent-pulse {
69
- 0%, 100% { opacity: 1; }
70
- 50% { opacity: 0.4; }
71
- }
72
- `})]})}const ki="/api";async function nt(o,a){const u={"Content-Type":"application/json",...a==null?void 0:a.headers},d=await fetch(`${ki}${o}`,{...a,headers:u});if(!d.ok){const m=await d.json().catch(()=>({error:d.statusText}));throw new Error(m.error||`HTTP ${d.status}`)}const p=await d.json();return p.data!==void 0?p.data:p}async function ye(o,a){const u={"Content-Type":"application/json",...a==null?void 0:a.headers},d=await fetch(`${ki}${o}`,{...a,headers:u,credentials:"include"});if(!d.ok){const p=await d.json().catch(()=>({error:d.statusText}));throw new Error(p.error||`HTTP ${d.status}`)}return d.json()}async function _h(){var o;try{const u=await(await fetch("/auth/check",{credentials:"include"})).json();return u.success&&((o=u.data)==null?void 0:o.authenticated)}catch{return!1}}async function Pc(o){try{return(await fetch("/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:o}),credentials:"include"})).ok}catch{return!1}}async function Ph(){await fetch("/auth/logout",{method:"POST",credentials:"include"}).catch(()=>{})}const oe={async getStatus(){return ye("/status")},async getTools(){return ye("/tools")},async getMemoryStats(){return ye("/memory/stats")},async searchKnowledge(o,a=10){return ye(`/memory/search?q=${encodeURIComponent(o)}&limit=${a}`)},async getSoulFile(o){return ye(`/soul/${o}`)},async updateSoulFile(o,a){return ye(`/soul/${o}`,{method:"PUT",body:JSON.stringify({content:a})})},async getPlugins(){return ye("/plugins")},async getToolRag(){return ye("/tools/rag")},async updateToolRag(o){return ye("/tools/rag",{method:"PUT",body:JSON.stringify(o)})},async getMcpServers(){return ye("/mcp")},async addMcpServer(o){return ye("/mcp",{method:"POST",body:JSON.stringify(o)})},async removeMcpServer(o){return ye(`/mcp/${encodeURIComponent(o)}`,{method:"DELETE"})},async updateToolConfig(o,a){return ye(`/tools/${o}`,{method:"PUT",body:JSON.stringify(a)})},async workspaceList(o="",a=!1){const u=new URLSearchParams;o&&u.set("path",o),a&&u.set("recursive","true");const d=u.toString();return ye(`/workspace${d?`?${d}`:""}`)},async workspaceRead(o){return ye(`/workspace/read?path=${encodeURIComponent(o)}`)},async workspaceWrite(o,a){return ye("/workspace/write",{method:"POST",body:JSON.stringify({path:o,content:a})})},async workspaceMkdir(o){return ye("/workspace/mkdir",{method:"POST",body:JSON.stringify({path:o})})},async workspaceDelete(o,a=!1){return ye("/workspace",{method:"DELETE",body:JSON.stringify({path:o,recursive:a})})},async workspaceRename(o,a){return ye("/workspace/rename",{method:"POST",body:JSON.stringify({from:o,to:a})})},async workspaceInfo(){return ye("/workspace/info")},async tasksList(o){const a=o?`?status=${o}`:"";return ye(`/tasks${a}`)},async tasksGet(o){return ye(`/tasks/${o}`)},async tasksDelete(o){return ye(`/tasks/${o}`,{method:"DELETE"})},async tasksCancel(o){return ye(`/tasks/${o}/cancel`,{method:"POST"})},async tasksCleanDone(){return ye("/tasks/clean-done",{method:"POST"})},async getConfigKeys(){return ye("/config")},async setConfigKey(o,a){return ye(`/config/${o}`,{method:"PUT",body:JSON.stringify({value:a})})},async unsetConfigKey(o){return ye(`/config/${o}`,{method:"DELETE"})},async getMarketplace(o=!1){return ye(`/marketplace${o?"?refresh=true":""}`)},async installPlugin(o){return ye("/marketplace/install",{method:"POST",body:JSON.stringify({id:o})})},async uninstallPlugin(o){return ye("/marketplace/uninstall",{method:"POST",body:JSON.stringify({id:o})})},async updatePlugin(o){return ye("/marketplace/update",{method:"POST",body:JSON.stringify({id:o})})},async getPluginSecrets(o){return ye(`/marketplace/secrets/${encodeURIComponent(o)}`)},async setPluginSecret(o,a,u){return ye(`/marketplace/secrets/${encodeURIComponent(o)}/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({value:u})})},async unsetPluginSecret(o,a){return ye(`/marketplace/secrets/${encodeURIComponent(o)}/${encodeURIComponent(a)}`,{method:"DELETE"})},connectLogs(o,a){const u=`${ki}/logs/stream`,d=new EventSource(u);return d.addEventListener("log",p=>{try{const m=JSON.parse(p.data);o(m)}catch(m){console.error("Failed to parse log entry:",m)}}),d.onerror=p=>{a==null||a(p)},()=>d.close()}},Xe={getStatus:()=>nt("/setup/status"),getProviders:()=>nt("/setup/providers"),getModels:o=>nt(`/setup/models/${encodeURIComponent(o)}`),validateApiKey:(o,a)=>nt("/setup/validate/api-key",{method:"POST",body:JSON.stringify({provider:o,apiKey:a})}),validateBotToken:o=>nt("/setup/validate/bot-token",{method:"POST",body:JSON.stringify({token:o})}),initWorkspace:o=>nt("/setup/workspace/init",{method:"POST",body:JSON.stringify({agentName:o})}),getWalletStatus:()=>nt("/setup/wallet/status"),generateWallet:()=>nt("/setup/wallet/generate",{method:"POST"}),importWallet:o=>nt("/setup/wallet/import",{method:"POST",body:JSON.stringify({mnemonic:o})}),sendCode:(o,a,u)=>nt("/setup/telegram/send-code",{method:"POST",body:JSON.stringify({apiId:o,apiHash:a,phone:u})}),verifyCode:(o,a)=>nt("/setup/telegram/verify-code",{method:"POST",body:JSON.stringify({authSessionId:o,code:a})}),verifyPassword:(o,a)=>nt("/setup/telegram/verify-password",{method:"POST",body:JSON.stringify({authSessionId:o,password:a})}),resendCode:o=>nt("/setup/telegram/resend-code",{method:"POST",body:JSON.stringify({authSessionId:o})}),saveConfig:o=>nt("/setup/config/save",{method:"POST",body:JSON.stringify(o)}),launch:()=>nt("/setup/launch",{method:"POST"}),pollHealth:async(o=3e4)=>{const a=Date.now(),u=1e3;for(await new Promise(d=>setTimeout(d,1500));Date.now()-a<o;){try{const d=await fetch("/auth/check",{signal:AbortSignal.timeout(2e3)});if(d.ok){const p=await d.json();if(p.success&&p.data&&!p.data.setup)return}}catch{}await new Promise(d=>setTimeout(d,u))}throw new Error("Agent did not start within the expected time")}};function Th(){const o=dr(),a=d=>o.pathname===d,u=async()=>{await Ph(),window.location.href="/"};return l.jsxs(l.Fragment,{children:[l.jsxs("nav",{children:[l.jsx(Mt,{to:"/",className:a("/")?"active":"",children:"Dashboard"}),l.jsx(Mt,{to:"/tools",className:a("/tools")?"active":"",children:"Tools"}),l.jsx(Mt,{to:"/plugins",className:a("/plugins")?"active":"",children:"Plugins"}),l.jsx(Mt,{to:"/soul",className:a("/soul")?"active":"",children:"Soul"}),l.jsx(Mt,{to:"/memory",className:a("/memory")?"active":"",children:"Memory"}),l.jsx(Mt,{to:"/logs",className:a("/logs")?"active":"",children:"Logs"}),l.jsx(Mt,{to:"/workspace",className:a("/workspace")?"active":"",children:"Workspace"}),l.jsx(Mt,{to:"/tasks",className:a("/tasks")?"active":"",children:"Tasks"}),l.jsx(Mt,{to:"/mcp",className:a("/mcp")?"active":"",children:"MCP"}),l.jsx(Mt,{to:"/config",className:a("/config")?"active":"",children:"Config"})]}),l.jsxs("div",{style:{marginTop:"auto"},children:[l.jsx(Eh,{}),l.jsx("div",{style:{padding:"0 12px 14px"},children:l.jsx("button",{onClick:u,style:{width:"100%",opacity:.7,fontSize:"13px"},children:"Logout"})})]})]})}function Lh(){return l.jsx(Gc,{sidebar:l.jsx(Th,{})})}class Xc extends f.Component{constructor(){super(...arguments);Dt(this,"state",{hasError:!1,error:null})}static getDerivedStateFromError(u){return{hasError:!0,error:u.message}}render(){return this.state.hasError?l.jsxs("div",{className:"card",style:{textAlign:"center",padding:"40px 20px"},children:[l.jsx("h2",{style:{color:"var(--red)",marginBottom:"8px"},children:"Something went wrong"}),l.jsx("p",{style:{color:"var(--text-secondary)",marginBottom:"16px"},children:this.state.error}),l.jsx("button",{onClick:()=>this.setState({hasError:!1,error:null}),children:"Try Again"})]}):this.props.children}}function ht({value:o,options:a,labels:u,onChange:d,style:p}){const[m,S]=f.useState(!1),[w,v]=f.useState(-1),k=f.useRef(null),_=f.useRef(null),j=f.useRef(Math.random().toString(36).slice(2));f.useEffect(()=>{if(!m)return;const O=y=>{k.current&&!k.current.contains(y.target)&&S(!1)};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[m]),f.useEffect(()=>{if(m){const O=a.indexOf(o);v(O>=0?O:0)}},[m,a,o]),f.useEffect(()=>{if(!m||w<0||!_.current)return;const O=_.current.children[w];O==null||O.scrollIntoView({block:"nearest"})},[m,w]);const I=f.useCallback(O=>{if(!m){(O.key==="Enter"||O.key===" "||O.key==="ArrowDown")&&(O.preventDefault(),S(!0));return}switch(O.key){case"ArrowDown":O.preventDefault(),v(y=>(y+1)%a.length);break;case"ArrowUp":O.preventDefault(),v(y=>(y-1+a.length)%a.length);break;case"Enter":case" ":O.preventDefault(),w>=0&&w<a.length&&(d(a[w]),S(!1));break;case"Escape":O.preventDefault(),S(!1);break;case"Home":O.preventDefault(),v(0);break;case"End":O.preventDefault(),v(a.length-1);break}},[m,w,a,d]),U=`select-menu-${j.current}`;return l.jsxs("div",{ref:k,className:"custom-select",style:p,children:[l.jsxs("button",{type:"button",className:"custom-select-trigger",onClick:()=>S(!m),onKeyDown:I,"aria-haspopup":"listbox","aria-expanded":m,"aria-controls":m?U:void 0,children:[l.jsx("span",{children:u?u[a.indexOf(o)]??o:o}),l.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l.jsx("path",{d:"M6 9l6 6 6-6"})})]}),m&&l.jsx("div",{ref:_,id:U,className:"custom-select-menu",role:"listbox","aria-activedescendant":w>=0?`${U}-opt-${w}`:void 0,children:a.map((O,y)=>l.jsx("div",{id:`${U}-opt-${y}`,role:"option","aria-selected":O===o,className:`custom-select-option${O===o?" active":""}${y===w?" focused":""}`,onClick:()=>{d(O),S(!1)},onMouseEnter:()=>v(y),children:u?u[y]??O:O},O))})]})}function Rh(){const[o,a]=f.useState(null),[u,d]=f.useState(null),[p,m]=f.useState(null),[S,w]=f.useState(!0),[v,k]=f.useState(null),[_,j]=f.useState(null),[I,U]=f.useState({}),O=f.useCallback(()=>{Promise.all([oe.getStatus(),oe.getMemoryStats(),oe.getConfigKeys(),oe.getToolRag()]).then(([P,M,b,ce])=>{a(P.data),d(M.data),m(ce.data);const ge={};for(const X of b.data)X.value!=null&&(ge[X.key]=X.value);U(ge),w(!1)}).catch(P=>{k(P.message),w(!1)})},[]);f.useEffect(()=>{O()},[O]);const y=P=>I[P]??"",N=(P,M)=>{U(b=>({...b,[P]:M}))},z=async(P,M)=>{if(M.trim())try{k(null),await oe.setConfigKey(P,M.trim()),await O(),L(`Saved ${P.split(".").pop()}`)}catch(b){k(b instanceof Error?b.message:String(b))}},W=async P=>{try{const M=await oe.updateToolRag(P);m(M.data),L("Tool RAG updated")}catch(M){k(M instanceof Error?M.message:String(M))}},L=P=>{j(P),setTimeout(()=>j(null),2e3)};return S?l.jsx("div",{className:"loading",children:"Loading..."}):!o||!u?l.jsx("div",{className:"alert error",children:"Failed to load dashboard data"}):l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Dashboard"}),l.jsx("p",{children:"System status and settings"})]}),v&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px"},children:[v,l.jsx("button",{onClick:()=>k(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),_&&l.jsx("div",{className:"alert success",style:{marginBottom:"16px"},children:_}),l.jsxs("div",{className:"stats",children:[l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Uptime"}),l.jsxs("div",{className:"value",children:[Math.floor(o.uptime/60),"m"]})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Model"}),l.jsx("div",{className:"value",style:{fontSize:"14px"},children:o.model})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Sessions"}),l.jsx("div",{className:"value",children:o.sessionCount})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Tools"}),l.jsx("div",{className:"value",children:o.toolCount})]})]}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"section-title",children:"Memory"}),l.jsxs("div",{className:"stats",style:{marginBottom:0},children:[l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Knowledge"}),l.jsx("div",{className:"value",children:u.knowledge})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Messages"}),l.jsx("div",{className:"value",children:u.messages})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Chats"}),l.jsx("div",{className:"value",children:u.chats})]})]})]}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"section-title",children:"Agent"}),l.jsxs("div",{style:{display:"grid",gap:"16px"},children:[l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Provider"}),l.jsx(ht,{value:y("agent.provider"),options:["anthropic","openai","google","xai","groq","openrouter"],onChange:P=>z("agent.provider",P)})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Model"}),l.jsx("input",{type:"text",value:y("agent.model"),onChange:P=>N("agent.model",P.target.value),onBlur:P=>z("agent.model",P.target.value),onKeyDown:P=>P.key==="Enter"&&z("agent.model",P.currentTarget.value),style:{width:"100%"}})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"16px"},children:[l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Temperature (0-2)"}),l.jsx("input",{type:"number",min:"0",max:"2",step:"0.1",value:y("agent.temperature"),onChange:P=>N("agent.temperature",P.target.value),onBlur:P=>z("agent.temperature",P.target.value),onKeyDown:P=>P.key==="Enter"&&z("agent.temperature",P.currentTarget.value)})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Max Tokens"}),l.jsx("input",{type:"number",min:"1",value:y("agent.max_tokens"),onChange:P=>N("agent.max_tokens",P.target.value),onBlur:P=>z("agent.max_tokens",P.target.value),onKeyDown:P=>P.key==="Enter"&&z("agent.max_tokens",P.currentTarget.value)})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Max Iterations (1-20)"}),l.jsx("input",{type:"number",min:"1",max:"20",value:y("agent.max_agentic_iterations"),onChange:P=>N("agent.max_agentic_iterations",P.target.value),onBlur:P=>z("agent.max_agentic_iterations",P.target.value),onKeyDown:P=>P.key==="Enter"&&z("agent.max_agentic_iterations",P.currentTarget.value)})]})]})]})]}),p&&l.jsxs("div",{className:"card",children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[l.jsxs("div",{children:[l.jsx("div",{className:"section-title",style:{marginBottom:"4px"},children:"Tool RAG"}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",margin:0},children:"Semantic tool selection — sends only the most relevant tools to the LLM per message."})]}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{type:"checkbox",checked:p.enabled,onChange:()=>W({enabled:!p.enabled})}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"13px",color:"var(--text-secondary)"},children:[l.jsxs("span",{children:["Indexed: ",p.indexed?"Yes":"No"]}),l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Top-K:",l.jsx(ht,{value:String(p.topK),options:["10","15","20","25","30","40","50"],onChange:P=>W({topK:Number(P)}),style:{display:"inline-block",minWidth:"70px"}})]}),l.jsxs("span",{children:["Total: ",p.totalTools]})]})]}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"section-title",children:"Telegram"}),l.jsxs("div",{style:{display:"grid",gap:"16px"},children:[l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"DM Policy"}),l.jsx(ht,{value:y("telegram.dm_policy"),options:["open","pairing","admin"],onChange:P=>z("telegram.dm_policy",P)})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Group Policy"}),l.jsx(ht,{value:y("telegram.group_policy"),options:["open","admin","disabled"],onChange:P=>z("telegram.group_policy",P)})]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsx("label",{style:{fontSize:"13px",color:"var(--text-secondary)",cursor:"pointer"},htmlFor:"require-mention",children:"Require Mention"}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{id:"require-mention",type:"checkbox",checked:y("telegram.require_mention")==="true",onChange:P=>z("telegram.require_mention",String(P.target.checked))}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsx("label",{style:{fontSize:"13px",color:"var(--text-secondary)",cursor:"pointer"},htmlFor:"typing-sim",children:"Typing Simulation"}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{id:"typing-sim",type:"checkbox",checked:y("telegram.typing_simulation")==="true",onChange:P=>z("telegram.typing_simulation",String(P.target.checked))}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Debounce (ms)"}),l.jsx("input",{type:"number",min:"0",value:y("telegram.debounce_ms"),onChange:P=>N("telegram.debounce_ms",P.target.value),onBlur:P=>z("telegram.debounce_ms",P.target.value),onKeyDown:P=>P.key==="Enter"&&z("telegram.debounce_ms",P.currentTarget.value),style:{width:"100%"}})]})]})]}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"section-title",children:"Session"}),l.jsxs("div",{style:{display:"grid",gap:"16px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsx("label",{style:{fontSize:"13px",color:"var(--text-secondary)",cursor:"pointer"},htmlFor:"daily-reset",children:"Daily Reset"}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{id:"daily-reset",type:"checkbox",checked:y("agent.session_reset_policy.daily_reset_enabled")==="true",onChange:P=>z("agent.session_reset_policy.daily_reset_enabled",String(P.target.checked))}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Reset Hour (0-23)"}),l.jsx(ht,{value:y("agent.session_reset_policy.daily_reset_hour"),options:Array.from({length:24},(P,M)=>String(M)),onChange:P=>z("agent.session_reset_policy.daily_reset_hour",P)})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsx("label",{style:{fontSize:"13px",color:"var(--text-secondary)",cursor:"pointer"},htmlFor:"idle-expiry",children:"Idle Expiry"}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{id:"idle-expiry",type:"checkbox",checked:y("agent.session_reset_policy.idle_expiry_enabled")==="true",onChange:P=>z("agent.session_reset_policy.idle_expiry_enabled",String(P.target.checked))}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{children:"Idle Minutes"}),l.jsx("input",{type:"number",min:"1",value:y("agent.session_reset_policy.idle_expiry_minutes"),onChange:P=>N("agent.session_reset_policy.idle_expiry_minutes",P.target.value),onBlur:P=>z("agent.session_reset_policy.idle_expiry_minutes",P.target.value),onKeyDown:P=>P.key==="Enter"&&z("agent.session_reset_policy.idle_expiry_minutes",P.currentTarget.value),style:{width:"100%"}})]})]})]})]})}function Zc({tool:o,updating:a,onToggle:u,onScope:d}){return l.jsxs("div",{className:"tool-row",style:{opacity:o.enabled?1:.5,display:"grid",gridTemplateColumns:"1fr auto auto",gap:"10px",alignItems:"center"},children:[l.jsxs("div",{style:{minWidth:0},children:[l.jsx("div",{className:"tool-name",children:o.name}),l.jsx("div",{className:"tool-desc",children:o.description})]}),l.jsx("div",{className:`scope-seg${!o.enabled||a===o.name?" disabled":""}`,children:["always","dm-only","group-only","admin-only"].map(p=>l.jsx("button",{className:o.scope===p?"active":"",disabled:!o.enabled||a===o.name,onClick:()=>d(o.name,p),children:p==="always"?"All":p==="dm-only"?"DM":p==="group-only"?"Group":"Admin"},p))}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{type:"checkbox",checked:o.enabled,onChange:()=>u(o.name,o.enabled),disabled:a===o.name}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]})}function zh(){const[o,a]=f.useState([]),[u,d]=f.useState(!0),[p,m]=f.useState(null),[S,w]=f.useState(null),[v,k]=f.useState(null),_=()=>(d(!0),oe.getTools().then(z=>{a(z.data),d(!1)}).catch(z=>{m(z instanceof Error?z.message:String(z)),d(!1)}));f.useEffect(()=>{_()},[]);const j=async(z,W)=>{w(z);try{await oe.updateToolConfig(z,{enabled:!W}),await _()}catch(L){m(L instanceof Error?L.message:String(L))}finally{w(null)}},I=async(z,W)=>{w(z);try{await oe.updateToolConfig(z,{scope:W}),await _()}catch(L){m(L instanceof Error?L.message:String(L))}finally{w(null)}},U=async(z,W)=>{w(z.name);try{for(const L of z.tools)L.enabled!==W&&await oe.updateToolConfig(L.name,{enabled:W});await _()}catch(L){m(L instanceof Error?L.message:String(L))}finally{w(null)}},O=async(z,W)=>{w(z.name);try{for(const L of z.tools)L.scope!==W&&await oe.updateToolConfig(L.name,{scope:W});await _()}catch(L){m(L instanceof Error?L.message:String(L))}finally{w(null)}};if(u)return l.jsx("div",{className:"loading",children:"Loading..."});const y=o.filter(z=>!z.isPlugin),N=y.reduce((z,W)=>z+W.toolCount,0);return l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Tools"}),l.jsxs("p",{children:[N," built-in tools across ",y.length," modules"]})]}),p&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsx("span",{children:p}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[l.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>m(null),children:"Dismiss"}),l.jsx("button",{className:"btn-sm",onClick:()=>{m(null),_()},children:"Retry"})]})]}),y.map(z=>{const W=v===z.name,L=z.tools.some(X=>X.enabled),P=z.tools.every(X=>!X.enabled),M=new Set(z.tools.map(X=>X.scope)),b=M.size>1,ce=b?"":M.values().next().value??"always",ge=S===z.name;return l.jsxs("div",{className:"card",style:{padding:0},children:[l.jsxs("div",{onClick:()=>k(W?null:z.name),className:"accordion-header",children:[l.jsx("span",{className:"accordion-chevron",children:W?"▼":"▶"}),l.jsx("div",{style:{flex:1,minWidth:0},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("h2",{style:{margin:0},children:z.name}),l.jsxs("span",{className:"badge count",children:[z.toolCount," tools"]}),P&&l.jsx("span",{className:"badge warn",children:"Disabled"})]})}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},onClick:X=>X.stopPropagation(),children:[l.jsx(ht,{value:ce,options:["","always","dm-only","group-only","admin-only"],labels:[b?"Mixed":"Scope","All","DM only","Group only","Admin only"],onChange:X=>X&&O(z,X),style:{minWidth:"110px"}}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{type:"checkbox",checked:L,onChange:()=>U(z,!L),disabled:ge}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]})]}),W&&l.jsx("div",{style:{borderTop:"1px solid var(--separator)",padding:"10px 16px 16px"},children:l.jsx("div",{style:{display:"grid",gap:"6px"},children:z.tools.map(X=>l.jsx(Zc,{tool:X,updating:S,onToggle:j,onScope:I},X.name))})})]},z.name)})]})}function Ih(){const[o,a]=f.useState("installed"),[u,d]=f.useState([]),[p,m]=f.useState([]),[S,w]=f.useState(!0),[v,k]=f.useState(null),[_,j]=f.useState(null),[I,U]=f.useState([]),[O,y]=f.useState(!1),[N,z]=f.useState(null),[W,L]=f.useState(""),[P,M]=f.useState(""),[b,ce]=f.useState(null),[ge,X]=f.useState({}),[me,De]=f.useState(!1),[Ue,J]=f.useState(null),[ie,V]=f.useState(null),[ae,ue]=f.useState(null),[K,re]=f.useState(null),[G,C]=f.useState(""),D=()=>(w(!0),Promise.all([oe.getPlugins(),oe.getTools()]).then(([Q,Y])=>{d(Q.data),m(Y.data.filter(H=>H.isPlugin)),w(!1)}).catch(Q=>{k(Q.message),w(!1)})),fe=(Q=!1)=>(y(!0),oe.getMarketplace(Q).then(Y=>{U(Y.data),y(!1)}).catch(Y=>{k(Y.message),y(!1)}));f.useEffect(()=>{D(),fe()},[]);const pe=async(Q,Y)=>{j(Q);try{await oe.updateToolConfig(Q,{enabled:!Y}),await D()}catch(H){k(H instanceof Error?H.message:String(H))}finally{j(null)}},ve=async(Q,Y)=>{j(Q);try{await oe.updateToolConfig(Q,{scope:Y}),await D()}catch(H){k(H instanceof Error?H.message:String(H))}finally{j(null)}},xe=async(Q,Y)=>{j(Q.name);try{for(const H of Q.tools)H.enabled!==Y&&await oe.updateToolConfig(H.name,{enabled:Y});await D()}catch(H){k(H instanceof Error?H.message:String(H))}finally{j(null)}},Ne=async(Q,Y)=>{j(Q.name);try{for(const H of Q.tools)H.scope!==Y&&await oe.updateToolConfig(H.name,{scope:Y});await D()}catch(H){k(H instanceof Error?H.message:String(H))}finally{j(null)}},we=async Q=>{const Y=I.find(H=>H.id===Q);z(Q);try{if(await oe.installPlugin(Q),await Promise.all([fe(),D()]),Y!=null&&Y.secrets&&Object.keys(Y.secrets).length>0){try{const H=await oe.getPluginSecrets(Q),Le=Object.entries(Y.secrets).filter(([,mt])=>mt.required).map(([mt])=>mt);if(Le.every(mt=>H.data.configured.includes(mt))&&Le.length>0)return}catch{}ce({pluginId:Q,pluginName:Y.name,secrets:Y.secrets}),X({})}}catch(H){k(H instanceof Error?H.message:String(H))}finally{z(null)}},Ee=async Q=>{if(confirm(`Uninstall plugin "${Q}"? This will remove its files.`)){z(Q);try{await oe.uninstallPlugin(Q),await Promise.all([fe(),D()])}catch(Y){k(Y instanceof Error?Y.message:String(Y))}finally{z(null)}}},Ze=async Q=>{z(Q);try{await oe.updatePlugin(Q),await Promise.all([fe(),D()])}catch(Y){k(Y instanceof Error?Y.message:String(Y))}finally{z(null)}},Rn=async()=>{const Q=I.filter(Y=>Y.status==="updatable");for(const Y of Q){z(Y.id);try{await oe.updatePlugin(Y.id)}catch(H){k(H instanceof Error?H.message:String(H));break}}z(null),await Promise.all([fe(),D()])},nl=async Q=>{if(ie===Q){V(null),re(null);return}try{const Y=await oe.getPluginSecrets(Q);ue(Y.data),V(Q),re(null)}catch(Y){k(Y instanceof Error?Y.message:String(Y))}},zn=async(Q,Y)=>{if(G.trim())try{await oe.setPluginSecret(Q,Y,G.trim()),re(null),C("");const H=await oe.getPluginSecrets(Q);ue(H.data)}catch(H){k(H instanceof Error?H.message:String(H))}},fr=async(Q,Y)=>{try{await oe.unsetPluginSecret(Q,Y);const H=await oe.getPluginSecrets(Q);ue(H.data)}catch(H){k(H instanceof Error?H.message:String(H))}},pr=I.filter(Q=>{if(W){const Y=W.toLowerCase();if(!Q.name.toLowerCase().includes(Y)&&!Q.description.toLowerCase().includes(Y))return!1}return!(P&&!Q.tags.includes(P))}),In=Array.from(new Set(I.flatMap(Q=>Q.tags))).sort(),Ht=I.filter(Q=>Q.status==="updatable").length;return S?l.jsx("div",{className:"loading",children:"Loading..."}):l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Plugins"}),l.jsx("p",{children:"Manage installed plugins and browse the community marketplace"})]}),v&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsx("span",{children:v}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[l.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>k(null),children:"Dismiss"}),l.jsx("button",{className:"btn-sm",onClick:()=>{k(null),D()},children:"Retry"})]})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center",marginBottom:"16px",flexWrap:"wrap"},children:[l.jsxs("div",{className:"tabs",style:{marginBottom:0,flexShrink:0},children:[l.jsxs("button",{className:`tab ${o==="installed"?"active":""}`,onClick:()=>a("installed"),children:["Installed",l.jsx("span",{className:"tab-count",children:u.length})]}),l.jsxs("button",{className:`tab ${o==="marketplace"?"active":""}`,onClick:()=>a("marketplace"),children:["Marketplace",Ht>0&&l.jsx("span",{className:"tab-count",style:{background:"rgba(255,255,255,0.08)",color:"var(--text-secondary)"},children:Ht})]})]}),l.jsxs("div",{style:{position:"relative",flex:1,minWidth:"120px"},children:[l.jsx("input",{type:"text",placeholder:"Search plugins...",value:W,onChange:Q=>L(Q.target.value),style:{width:"100%",paddingLeft:"34px"}}),l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"var(--text-tertiary)",pointerEvents:"none"},children:[l.jsx("circle",{cx:"11",cy:"11",r:"8"}),l.jsx("path",{d:"M21 21l-4.35-4.35"})]})]}),In.length>0&&l.jsx(ht,{value:P,options:["",...In],labels:["All tags",...In],onChange:Q=>M(Q),style:{minWidth:"140px"}}),o==="marketplace"&&l.jsxs(l.Fragment,{children:[Ht>0?l.jsx("button",{className:"btn-sm",onClick:Rn,disabled:!!N||O,style:{whiteSpace:"nowrap"},children:N?"Updating...":`Update All (${Ht})`}):I.length>0?l.jsx("span",{style:{fontSize:"12px",color:"var(--text-tertiary)",whiteSpace:"nowrap"},children:"All up to date"}):null,l.jsx("button",{className:"btn-ghost",onClick:()=>fe(!0),disabled:O,style:{whiteSpace:"nowrap"},children:O?"Refreshing...":"Refresh"})]})]}),o==="installed"&&(()=>{const Q=u.filter(Y=>{if(W){const H=W.toLowerCase();if(!Y.name.toLowerCase().includes(H)&&!(Y.description??"").toLowerCase().includes(H))return!1}if(P){const H=I.find(Le=>Le.name===Y.name);if(!H||!H.tags.includes(P))return!1}return!0});return l.jsx(l.Fragment,{children:u.length===0?l.jsxs("div",{className:"card",style:{textAlign:"center",padding:"40px 20px"},children:[l.jsx("p",{style:{color:"var(--text-secondary)",marginBottom:"12px"},children:"No plugins installed yet"}),l.jsx("button",{className:"btn-sm",onClick:()=>a("marketplace"),children:"Browse Marketplace"})]}):Q.length===0?l.jsx("div",{className:"card",style:{textAlign:"center",padding:"20px",color:"var(--text-secondary)"},children:"No installed plugins match your search"}):Q.map(Y=>{const H=p.find(ke=>ke.name===Y.name),Le=I.find(ke=>ke.name===Y.name),On=(Le==null?void 0:Le.secrets)&&Object.keys(Le.secrets).length>0,mt=Ue===Y.name,hr=H?H.tools.some(ke=>ke.enabled):!1,rl=H?H.tools.every(ke=>!ke.enabled):!0,mr=H?new Set(H.tools.map(ke=>ke.scope)):new Set,Dn=mr.size>1,Mn=Dn?"":mr.values().next().value??"always",ll=_===Y.name;return l.jsxs("div",{className:"card",style:{padding:0},children:[l.jsxs("div",{onClick:()=>J(mt?null:Y.name),className:"accordion-header",children:[l.jsx("span",{className:"accordion-chevron",children:mt?"▼":"▶"}),l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[l.jsx("h2",{style:{margin:0},children:Y.name}),H&&l.jsxs("span",{className:"badge count",children:[H.toolCount," tools"]}),l.jsxs("span",{style:{fontSize:"12px",color:"var(--text-tertiary)"},children:["v",Y.version]}),rl&&H&&H.tools.length>0&&l.jsx("span",{className:"badge warn",children:"Disabled"})]}),Y.description&&l.jsx("p",{style:{fontSize:"12px",color:"var(--text-secondary)",margin:"4px 0 0"},children:Y.description})]}),H&&H.tools.length>0&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},onClick:ke=>ke.stopPropagation(),children:[l.jsx(ht,{value:Mn,options:["","always","dm-only","group-only","admin-only"],labels:[Dn?"Mixed":"Scope","All","DM only","Group only","Admin only"],onChange:ke=>ke&&Ne(H,ke),style:{minWidth:"110px"}}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{type:"checkbox",checked:hr,onChange:()=>xe(H,!hr),disabled:ll}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]})]}),mt&&l.jsxs("div",{style:{borderTop:"1px solid var(--separator)",padding:"10px 16px 16px"},children:[H&&H.tools.length>0&&l.jsx("div",{style:{display:"grid",gap:"6px"},children:H.tools.map(ke=>l.jsx(Zc,{tool:ke,updating:_,onToggle:pe,onScope:ve},ke.name))}),On&&Le&&l.jsxs("div",{style:{marginTop:"10px",borderTop:"1px solid var(--separator)",paddingTop:"10px"},children:[l.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>nl(Le.id),children:ie===Le.id?"Hide Secrets":"Manage Secrets"}),ie===Le.id&&ae&&l.jsx("div",{style:{marginTop:"8px",display:"grid",gap:"6px"},children:Object.entries(ae.declared).map(([ke,Tt])=>{const An=ae.configured.includes(ke);return l.jsxs("div",{className:"tool-row",style:{padding:"8px 12px",flexWrap:"wrap"},children:[l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsx("span",{style:{fontWeight:600,fontSize:"13px"},children:ke}),Tt.required&&l.jsx("span",{style:{color:"var(--text-secondary)",marginLeft:"4px",fontSize:"11px"},children:"required"}),l.jsx("span",{className:`badge ${An?"always":"warn"}`,style:{marginLeft:"8px",fontSize:"10px"},children:An?"Set":"Not set"}),l.jsx("p",{style:{fontSize:"12px",color:"var(--text-tertiary)",margin:"2px 0 0 0"},children:Tt.description}),Tt.env&&l.jsxs("code",{style:{fontSize:"11px",color:"var(--text-tertiary)",opacity:.7},children:["Env: ",Tt.env]})]}),l.jsx("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:K===ke?l.jsxs(l.Fragment,{children:[l.jsx("input",{type:"password",value:G,onChange:sl=>C(sl.target.value),placeholder:"Enter value...",style:{width:"200px"}}),l.jsx("button",{className:"btn-sm",onClick:()=>zn(Le.id,ke),children:"Save"}),l.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>re(null),children:"Cancel"})]}):l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>{re(ke),C("")},children:An?"Change":"Set"}),An&&l.jsx("button",{className:"btn-danger btn-sm",onClick:()=>fr(Le.id,ke),children:"Remove"})]})})]},ke)})})]})]})]},Y.name)})})})(),b&&l.jsx("div",{className:"modal-overlay",onClick:()=>!me&&ce(null),children:l.jsxs("div",{className:"modal",onClick:Q=>Q.stopPropagation(),children:[l.jsxs("h2",{style:{marginBottom:"4px"},children:["Configure ",b.pluginName]}),l.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"13px",marginBottom:"16px"},children:"This plugin needs API keys to work. You can configure them now or later."}),Object.entries(b.secrets).map(([Q,Y])=>l.jsxs("div",{style:{marginBottom:"12px"},children:[l.jsxs("label",{style:{display:"block",fontSize:"13px",fontWeight:600,marginBottom:"4px"},children:[Q," ",Y.required&&l.jsx("span",{style:{color:"var(--text-secondary)"},children:"*"})]}),l.jsx("p",{style:{fontSize:"12px",color:"var(--text-tertiary)",margin:"0 0 4px 0"},children:Y.description}),Y.env&&l.jsxs("code",{style:{display:"block",fontSize:"11px",color:"var(--text-tertiary)",opacity:.7,marginBottom:"6px"},children:["Env: ",Y.env]}),l.jsx("input",{type:"password",placeholder:`Enter ${Q}...`,value:ge[Q]||"",onChange:H=>X(Le=>({...Le,[Q]:H.target.value})),style:{width:"100%"}})]},Q)),l.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end",marginTop:"16px"},children:[l.jsx("button",{className:"btn-ghost",onClick:()=>ce(null),children:"Skip"}),l.jsx("button",{className:"btn-sm",disabled:me,onClick:async()=>{De(!0);try{for(const[Q,Y]of Object.entries(ge))Y.trim()&&await oe.setPluginSecret(b.pluginId,Q,Y.trim());ce(null)}catch(Q){k(Q instanceof Error?Q.message:String(Q))}finally{De(!1)}},children:me?"Saving...":"Save"})]})]})}),o==="marketplace"&&l.jsx(l.Fragment,{children:O&&I.length===0?l.jsx("div",{className:"loading",children:"Loading marketplace..."}):pr.length===0?l.jsx("div",{className:"empty",children:W||P?"No plugins match your search":"Marketplace is empty"}):l.jsx("div",{style:{display:"grid",gap:"10px"},children:pr.map(Q=>l.jsx(Oh,{plugin:Q,operating:N,onInstall:we,onUninstall:Ee,onUpdate:Ze},Q.id))})})]})}function Oh({plugin:o,operating:a,onInstall:u,onUninstall:d,onUpdate:p}){const m=a===o.id,S=!!a,w=o.secrets&&Object.values(o.secrets).some(v=>v.required);return l.jsx("div",{className:"card",style:{marginBottom:"0"},children:l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"16px"},children:[l.jsxs("div",{style:{flex:1,minWidth:0},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"4px",flexWrap:"wrap"},children:[l.jsx("h2",{style:{margin:0},children:o.name}),o.status==="installed"&&l.jsx("span",{className:"badge always",style:{fontSize:"10px"},children:"Installed"}),o.status==="updatable"&&l.jsx("span",{className:"badge warn",style:{fontSize:"10px"},children:"Update available"}),w&&o.status==="available"&&l.jsx("span",{className:"badge warn",style:{fontSize:"10px"},children:"Requires API Key"})]}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",margin:"0 0 8px 0",lineHeight:"1.5"},children:o.description}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[o.tags.map(v=>l.jsx("span",{className:"badge",style:{background:"var(--surface)",color:"var(--text-tertiary)"},children:v},v)),l.jsxs("span",{style:{fontSize:"12px",color:"var(--text-tertiary)"},children:["by ",o.author," · v",o.remoteVersion," · ",o.toolCount," tools"]})]})]}),l.jsxs("div",{style:{flexShrink:0,display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"},children:[o.status==="available"&&l.jsx("button",{className:"btn-sm",onClick:()=>u(o.id),disabled:S,children:m?"Installing...":"Install"}),o.status==="installed"&&l.jsx("button",{className:"btn-danger btn-sm",onClick:()=>d(o.id),disabled:S,children:m?"Removing...":"Uninstall"}),o.status==="updatable"&&l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"btn-sm",onClick:()=>p(o.id),disabled:S,children:m?"Updating...":`Update to v${o.remoteVersion}`}),l.jsx("button",{className:"btn-danger btn-sm",onClick:()=>d(o.id),disabled:S,children:"Uninstall"})]})]})]})})}const Tc=["SOUL.md","SECURITY.md","STRATEGY.md","MEMORY.md"];function Dh(){const[o,a]=f.useState(Tc[0]),[u,d]=f.useState(""),[p,m]=f.useState(""),[S,w]=f.useState(!1),[v,k]=f.useState(!1),[_,j]=f.useState(null),I=u!==p,U=f.useCallback(async N=>{w(!0),j(null);try{const z=await oe.getSoulFile(N);d(z.data.content),m(z.data.content)}catch(z){j({type:"error",text:z instanceof Error?z.message:String(z)})}finally{w(!1)}},[]),O=async()=>{k(!0),j(null);try{const N=await oe.updateSoulFile(o,u);m(u),j({type:"success",text:N.data.message})}catch(N){j({type:"error",text:N instanceof Error?N.message:String(N)})}finally{k(!1)}};f.useEffect(()=>{const N=z=>{I&&z.preventDefault()};return window.addEventListener("beforeunload",N),()=>window.removeEventListener("beforeunload",N)},[I]);const y=N=>{N!==o&&(I&&!window.confirm("You have unsaved changes. Discard them?")||a(N))};return f.useEffect(()=>{U(o)},[o,U]),l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Soul Editor"}),l.jsx("p",{children:"Edit system prompt files"})]}),_&&l.jsx("div",{className:`alert ${_.type}`,children:_.text}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"tabs",children:Tc.map(N=>l.jsxs("button",{className:`tab ${o===N?"active":""}`,onClick:()=>y(N),children:[N,o===N&&I?" *":""]},N))}),S?l.jsx("div",{className:"loading",children:"Loading..."}):l.jsxs(l.Fragment,{children:[l.jsx("textarea",{value:u,onChange:N=>d(N.target.value),placeholder:`Edit ${o}...`}),l.jsxs("div",{style:{marginTop:"14px",display:"flex",alignItems:"center",gap:"10px"},children:[l.jsx("button",{onClick:O,disabled:v||!I,children:v?"Saving...":"Save"}),I&&l.jsx("span",{style:{color:"var(--text-secondary)",fontSize:"13px"},children:"Unsaved changes"})]})]})]})]})}function Mh(){const[o,a]=f.useState(""),[u,d]=f.useState([]),[p,m]=f.useState(!1),[S,w]=f.useState(null),[v,k]=f.useState(!1),_=async()=>{if(o.trim()){m(!0),w(null);try{const j=await oe.searchKnowledge(o);d(j.data),k(!0)}catch(j){w(j instanceof Error?j.message:String(j))}finally{m(!1)}}};return l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Memory"}),l.jsx("p",{children:"Search knowledge base"})]}),l.jsxs("div",{className:"card",children:[l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Search query"}),l.jsxs("div",{style:{display:"flex",gap:"8px"},children:[l.jsx("input",{type:"text",value:o,onChange:j=>a(j.target.value),onKeyDown:j=>j.key==="Enter"&&_(),placeholder:"Enter search query...",style:{flex:1}}),l.jsx("button",{onClick:_,disabled:p,children:p?"Searching...":"Search"})]})]}),S&&l.jsx("div",{className:"alert error",children:S}),v&&u.length===0&&!S&&l.jsx("div",{style:{marginTop:"16px",color:"var(--text-secondary)",textAlign:"center"},children:"No results found"}),u.length>0&&l.jsxs("div",{style:{marginTop:"16px"},children:[l.jsxs("div",{className:"section-title",children:["Results (",u.length,")"]}),u.map((j,I)=>{var U;return l.jsxs("div",{className:"result-item",children:[l.jsxs("div",{className:"result-meta",children:[j.source," · Score: ",((U=j.score)==null?void 0:U.toFixed(3))??"—"]}),l.jsx("div",{className:"result-text",children:j.text})]},j.id||I)})]})]})]})}const Lc=2e3,di=1e3,Ah=3e4;class Fh{constructor(){Dt(this,"logs",[]);Dt(this,"snapshot",[]);Dt(this,"listeners",new Set);Dt(this,"disconnect",null);Dt(this,"_connected",!1);Dt(this,"reconnectTimer",null);Dt(this,"reconnectDelay",di);Dt(this,"shouldReconnect",!1)}connect(){this.disconnect||(this.shouldReconnect=!0,this.reconnectDelay=di,this.doConnect())}doConnect(){this.disconnect||(this.disconnect=oe.connectLogs(a=>{this.logs.push(a),this.logs.length>Lc&&(this.logs=this.logs.slice(-Lc)),this._connected=!0,this.reconnectDelay=di,this.snapshot=[...this.logs],this.notify()},()=>{this._connected=!1,this.disconnect&&(this.disconnect(),this.disconnect=null),this.notify(),this.scheduleReconnect()}))}scheduleReconnect(){!this.shouldReconnect||this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.shouldReconnect&&!this.disconnect&&this.doConnect()},this.reconnectDelay),this.reconnectDelay=Math.min(this.reconnectDelay*2,Ah))}stop(){this.shouldReconnect=!1,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.disconnect&&(this.disconnect(),this.disconnect=null),this._connected=!1,this.notify()}getLogs(){return this.snapshot}isConnected(){return this._connected}clear(){this.logs=[],this.snapshot=[],this.notify()}subscribe(a){return this.listeners.add(a),()=>this.listeners.delete(a)}notify(){for(const a of this.listeners)a()}}const Tn=new Fh;function Bh(){const o=f.useSyncExternalStore(d=>Tn.subscribe(d),()=>Tn.getLogs()),a=f.useSyncExternalStore(d=>Tn.subscribe(d),()=>Tn.isConnected()),u=f.useRef(null);return f.useEffect(()=>{Tn.connect()},[]),f.useEffect(()=>{var d;(d=u.current)==null||d.scrollIntoView({behavior:"smooth"})},[o]),l.jsxs("div",{children:[l.jsx("div",{className:"header",children:l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{children:[l.jsx("h1",{children:"Live Logs"}),l.jsxs("p",{children:[l.jsx("span",{className:`status-dot ${a?"connected":"disconnected"}`}),a?"Connected":"Disconnected"]})]}),l.jsx("button",{onClick:()=>Tn.clear(),children:"Clear"})]})}),l.jsxs("div",{className:"card",style:{maxHeight:"70vh",overflow:"auto",padding:"14px"},children:[o.length===0?l.jsx("div",{className:"empty",children:"Waiting for logs..."}):o.map((d,p)=>l.jsxs("div",{className:"log-entry",children:[l.jsx("span",{className:`badge ${d.level==="warn"?"warn":d.level==="error"?"error":"info"}`,children:d.level.toUpperCase()})," ",l.jsx("span",{style:{color:"var(--text-tertiary)"},children:new Date(d.timestamp).toLocaleTimeString()})," ",d.message]},p)),l.jsx("div",{ref:u})]})]})}function Rc(o){return o===0?"—":o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(1)} MB`}function Uh(o){return new Date(o).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Wh(){const[o,a]=f.useState(""),[u,d]=f.useState([]),[p,m]=f.useState(null),[S,w]=f.useState(!0),[v,k]=f.useState(null),[_,j]=f.useState(null),[I,U]=f.useState(""),[O,y]=f.useState(!1),[N,z]=f.useState(!1),[W,L]=f.useState(null),[P,M]=f.useState(""),b=f.useCallback(async V=>{w(!0),k(null);try{const ae=await oe.workspaceList(V);d(ae.data??[]),a(V)}catch(ae){k(ae instanceof Error?ae.message:String(ae))}finally{w(!1)}},[]),ce=f.useCallback(async()=>{try{const V=await oe.workspaceInfo();m(V.data??null)}catch{}},[]);f.useEffect(()=>{b(""),ce()},[b,ce]);const ge=V=>{De()&&b(V)},X=o?o.split("/"):[],me=async V=>{var ae;try{k(null);const ue=await oe.workspaceRead(V);j(V),U(((ae=ue.data)==null?void 0:ae.content)??""),y(!1)}catch(ue){k(ue instanceof Error?ue.message:String(ue))}},De=()=>O&&!confirm("You have unsaved changes. Discard?")?!1:(j(null),U(""),y(!1),!0),Ue=async()=>{if(_){z(!0);try{await oe.workspaceWrite(_,I),y(!1),b(o)}catch(V){k(V instanceof Error?V.message:String(V))}finally{z(!1)}}},J=async V=>{const ae=V.isDirectory?"directory":"file";if(confirm(`Delete ${ae} "${V.name}"?`))try{await oe.workspaceDelete(V.path,V.isDirectory),_===V.path&&(j(null),U(""),y(!1)),b(o),ce()}catch(ue){k(ue instanceof Error?ue.message:String(ue))}},ie=async()=>{const V=P.trim();if(!V||!W)return;const ae=o?`${o}/${V}`:V;try{if(W.type==="newFile")await oe.workspaceWrite(ae,"");else if(W.type==="newFolder")await oe.workspaceMkdir(ae);else if(W.type==="rename"&&W.target){const ue=o?`${o}/${V}`:V;await oe.workspaceRename(W.target,ue),_===W.target&&(j(null),U(""),y(!1))}L(null),M(""),b(o),ce()}catch(ue){k(ue instanceof Error?ue.message:String(ue))}};return l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Workspace"}),l.jsxs("p",{children:["Browse and manage agent workspace files",p&&l.jsxs("span",{style:{marginLeft:"12px",fontSize:"12px",color:"var(--text-secondary)"},children:[p.totalFiles," files · ",Rc(p.totalSize)]})]})]}),v&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px"},children:[v,l.jsx("button",{onClick:()=>k(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),l.jsxs("div",{className:"card",style:{padding:"8px 14px",marginBottom:"14px",display:"flex",alignItems:"center",gap:"4px",flexWrap:"wrap"},children:[l.jsx("span",{onClick:()=>ge(""),style:{cursor:"pointer",fontWeight:o?"normal":"bold",color:"var(--accent)"},children:"workspace"}),X.map((V,ae)=>{const ue=X.slice(0,ae+1).join("/"),K=ae===X.length-1;return l.jsxs("span",{children:[l.jsx("span",{style:{color:"var(--text-secondary)",margin:"0 2px"},children:"/"}),l.jsx("span",{onClick:()=>!K&&ge(ue),style:{cursor:K?"default":"pointer",fontWeight:K?"bold":"normal",color:K?"var(--text)":"var(--accent)"},children:V})]},ue)}),l.jsxs("div",{style:{marginLeft:"auto",display:"flex",gap:"6px"},children:[l.jsx("button",{style:{padding:"3px 10px",fontSize:"12px"},onClick:()=>{L({type:"newFile"}),M("")},children:"+ File"}),l.jsx("button",{style:{padding:"3px 10px",fontSize:"12px"},onClick:()=>{L({type:"newFolder"}),M("")},children:"+ Folder"})]})]}),W&&l.jsxs("div",{className:"card",style:{padding:"10px 14px",marginBottom:"14px",display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"13px",whiteSpace:"nowrap"},children:W.type==="newFile"?"New file:":W.type==="newFolder"?"New folder:":"Rename to:"}),l.jsx("input",{type:"text",value:P,onChange:V=>M(V.target.value),onKeyDown:V=>V.key==="Enter"&&ie(),placeholder:"name...",autoFocus:!0,style:{flex:1,padding:"4px 8px",fontSize:"13px"}}),l.jsx("button",{style:{padding:"4px 10px",fontSize:"12px"},onClick:ie,children:"OK"}),l.jsx("button",{style:{padding:"4px 10px",fontSize:"12px",opacity:.7},onClick:()=>L(null),children:"Cancel"})]}),l.jsx("div",{className:"card",style:{padding:0},children:S?l.jsx("div",{style:{padding:"20px",textAlign:"center"},children:"Loading..."}):u.length===0?l.jsx("div",{style:{padding:"20px",textAlign:"center",color:"var(--text-secondary)"},children:"Empty directory"}):l.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[l.jsx("thead",{children:l.jsxs("tr",{style:{borderBottom:"1px solid var(--separator)",color:"var(--text-secondary)",fontSize:"11px",textTransform:"uppercase"},children:[l.jsx("th",{style:{textAlign:"left",padding:"8px 14px"},children:"Name"}),l.jsx("th",{style:{textAlign:"right",padding:"8px 14px",width:"80px"},children:"Size"}),l.jsx("th",{style:{textAlign:"right",padding:"8px 14px",width:"140px"},children:"Modified"}),l.jsx("th",{style:{textAlign:"right",padding:"8px 14px",width:"70px"}})]})}),l.jsxs("tbody",{children:[o&&l.jsxs("tr",{onClick:()=>{const V=o.split("/");V.pop(),ge(V.join("/"))},style:{cursor:"pointer",borderBottom:"1px solid var(--separator)"},className:"file-row",children:[l.jsxs("td",{style:{padding:"6px 14px"},children:[l.jsx("span",{style:{marginRight:"8px"},children:"📂"}),".."]}),l.jsx("td",{}),l.jsx("td",{}),l.jsx("td",{})]}),u.map(V=>l.jsxs("tr",{onClick:()=>V.isDirectory?ge(V.path):me(V.path),style:{cursor:"pointer",borderBottom:"1px solid var(--separator)"},className:"file-row",children:[l.jsxs("td",{style:{padding:"6px 14px"},children:[l.jsx("span",{style:{marginRight:"8px"},children:V.isDirectory?"📂":"📄"}),V.name]}),l.jsx("td",{style:{textAlign:"right",padding:"6px 14px",color:"var(--text-secondary)"},children:V.isDirectory?"":Rc(V.size)}),l.jsx("td",{style:{textAlign:"right",padding:"6px 14px",color:"var(--text-secondary)"},children:Uh(V.mtime)}),l.jsxs("td",{style:{textAlign:"right",padding:"6px 14px",whiteSpace:"nowrap"},onClick:ae=>ae.stopPropagation(),children:[l.jsx("button",{className:"icon-button",onClick:()=>{L({type:"rename",target:V.path}),M(V.name)},title:"Rename",children:"✎"}),l.jsx("button",{className:"icon-button",onClick:()=>J(V),title:"Delete",children:"🗑"})]})]},V.path))]})]})}),_&&l.jsxs("div",{className:"card",style:{marginTop:"14px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:[l.jsxs("h2",{style:{margin:0,fontSize:"14px"},children:[_,O&&l.jsx("span",{style:{color:"var(--accent)",marginLeft:"6px"},children:"*"})]}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[l.jsx("button",{style:{padding:"4px 12px",fontSize:"12px"},onClick:Ue,disabled:N||!O,children:N?"Saving...":"Save"}),l.jsx("button",{style:{padding:"4px 12px",fontSize:"12px",opacity:.7},onClick:De,children:"Close"})]})]}),l.jsx("textarea",{value:I,onChange:V=>{U(V.target.value),y(!0)},onKeyDown:V=>{(V.ctrlKey||V.metaKey)&&V.key==="s"&&(V.preventDefault(),Ue())},style:{width:"100%",minHeight:"300px",fontFamily:"monospace",fontSize:"13px",padding:"10px",border:"1px solid var(--separator)",borderRadius:"4px",backgroundColor:"var(--surface)",color:"var(--text)",resize:"vertical",tabSize:2},spellCheck:!1})]})]})}const ed={pending:"#f0ad4e",in_progress:"#5bc0de",done:"#5cb85c",failed:"#d9534f",cancelled:"#777"},gi={pending:"Pending",in_progress:"Running",done:"Done",failed:"Failed",cancelled:"Cancelled"};function zc({status:o}){return l.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"10px",fontSize:"11px",fontWeight:600,color:"#fff",backgroundColor:ed[o]},children:gi[o]})}function ar(o){return o?new Date(o).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function $h({priority:o}){if(o===0)return l.jsx("span",{style:{color:"var(--text-secondary)",fontSize:"11px"},children:"—"});const a=Math.min(o,10);return l.jsxs("span",{title:`Priority: ${o}/10`,style:{fontSize:"11px",letterSpacing:"1px"},children:["●".repeat(Math.min(a,5)),"○".repeat(Math.max(0,5-a))]})}function fi(o,a){return o?o.length>a?o.slice(0,a)+"...":o:""}function bh(){const[o,a]=f.useState([]),[u,d]=f.useState(!0),[p,m]=f.useState(null),[S,w]=f.useState(""),[v,k]=f.useState(null),_=f.useCallback(async()=>{d(!0),m(null);try{const N=(await oe.tasksList()).data??[];a(N),k(z=>z?N.find(W=>W.id===z.id)??null:null)}catch(y){m(y instanceof Error?y.message:String(y))}finally{d(!1)}},[]);f.useEffect(()=>{_()},[_]);const j=async y=>{if(confirm("Cancel this task?"))try{await oe.tasksCancel(y),_(),(v==null?void 0:v.id)===y&&k(null)}catch(N){m(N instanceof Error?N.message:String(N))}},I=async y=>{if(confirm("Permanently delete this task?"))try{await oe.tasksDelete(y),_(),(v==null?void 0:v.id)===y&&k(null)}catch(N){m(N instanceof Error?N.message:String(N))}},U=o.reduce((y,N)=>(y[N.status]=(y[N.status]||0)+1,y),{}),O=S?o.filter(y=>y.status===S):o;return l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Tasks"}),l.jsx("p",{children:"Scheduled and queued agent tasks"})]}),p&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px"},children:[p,l.jsx("button",{onClick:()=>m(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),l.jsxs("div",{className:"card",style:{padding:"10px 14px",marginBottom:"14px",display:"flex",gap:"16px",alignItems:"center",flexWrap:"wrap"},children:[l.jsxs("span",{onClick:()=>w(""),style:{cursor:"pointer",fontWeight:S===""?"bold":"normal",color:S===""?"var(--text)":"var(--text-secondary)",fontSize:"13px"},children:["All (",o.length,")"]}),["pending","in_progress","done","failed","cancelled"].map(y=>l.jsxs("span",{onClick:()=>w(S===y?"":y),style:{cursor:"pointer",fontWeight:S===y?"bold":"normal",color:S===y?ed[y]:"var(--text-secondary)",fontSize:"13px"},children:[gi[y]," (",U[y]||0,")"]},y)),(U.done||0)>0&&l.jsxs("button",{style:{marginLeft:"auto",padding:"4px 12px",fontSize:"12px",opacity:.7},onClick:async()=>{if(confirm(`Delete all ${U.done} done tasks?`))try{await oe.tasksCleanDone(),m(null),_(),k(null)}catch(y){m(y instanceof Error?y.message:String(y))}},children:["Clean done (",U.done,")"]}),l.jsx("button",{style:{marginLeft:U.done?void 0:"auto",padding:"4px 12px",fontSize:"12px",opacity:.7},onClick:_,children:"Refresh"})]}),l.jsx("div",{className:"card",style:{padding:0},children:u?l.jsx("div",{style:{padding:"20px",textAlign:"center"},children:"Loading..."}):O.length===0?l.jsx("div",{style:{padding:"20px",textAlign:"center",color:"var(--text-secondary)"},children:S?`No ${gi[S].toLowerCase()} tasks`:"No tasks yet"}):l.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px",tableLayout:"fixed"},children:[l.jsx("thead",{children:l.jsxs("tr",{style:{borderBottom:"1px solid var(--separator)",color:"var(--text-secondary)",fontSize:"11px",textTransform:"uppercase"},children:[l.jsx("th",{style:{textAlign:"left",padding:"8px 14px"},children:"Description"}),l.jsx("th",{style:{textAlign:"center",padding:"8px 10px",width:80},children:"Status"}),l.jsx("th",{style:{textAlign:"center",padding:"8px 10px",width:60},children:"Priority"}),l.jsx("th",{style:{textAlign:"right",padding:"8px 14px",width:120},children:"Scheduled"}),l.jsx("th",{style:{textAlign:"right",padding:"8px 14px",width:120},children:"Created"}),l.jsx("th",{style:{textAlign:"right",padding:"8px 14px",width:70}})]})}),l.jsx("tbody",{children:O.map(y=>{const N=(v==null?void 0:v.id)===y.id;return l.jsxs(Mc.Fragment,{children:[l.jsxs("tr",{onClick:()=>k(N?null:y),style:{cursor:"pointer",borderBottom:N?"none":"1px solid var(--separator)",backgroundColor:N?"rgba(255,255,255,0.03)":void 0},className:"file-row",children:[l.jsxs("td",{style:{padding:"8px 14px"},children:[l.jsxs("div",{children:[l.jsx("span",{style:{display:"inline-block",width:"14px",fontSize:"10px",color:"var(--text-secondary)"},children:N?"▼":"▶"}),fi(y.description,80)]}),y.reason&&l.jsx("div",{style:{fontSize:"11px",color:"var(--text-secondary)",marginTop:"2px",paddingLeft:"14px"},children:fi(y.reason,60)})]}),l.jsx("td",{style:{textAlign:"center",padding:"8px 10px"},children:l.jsx(zc,{status:y.status})}),l.jsx("td",{style:{textAlign:"center",padding:"8px 10px"},children:l.jsx($h,{priority:y.priority})}),l.jsx("td",{style:{textAlign:"right",padding:"8px 14px",color:"var(--text-secondary)"},children:ar(y.scheduledFor)}),l.jsx("td",{style:{textAlign:"right",padding:"8px 14px",color:"var(--text-secondary)"},children:ar(y.createdAt)}),l.jsxs("td",{style:{textAlign:"right",padding:"8px 14px",whiteSpace:"nowrap"},onClick:z=>z.stopPropagation(),children:[(y.status==="pending"||y.status==="in_progress")&&l.jsx("button",{className:"icon-button",onClick:()=>j(y.id),title:"Cancel",children:"✖"}),l.jsx("button",{className:"icon-button",onClick:()=>I(y.id),title:"Delete",children:"🗑"})]})]}),N&&v&&l.jsx("tr",{style:{backgroundColor:"rgba(255,255,255,0.03)",borderBottom:"1px solid var(--separator)"},children:l.jsxs("td",{colSpan:6,style:{padding:"0 14px 14px 14px",overflow:"hidden"},children:[l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr",gap:"6px 12px",fontSize:"13px",padding:"10px 0"},children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"ID"}),l.jsx("code",{style:{fontSize:"11px",wordBreak:"break-all"},children:v.id}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Status"}),l.jsx("span",{children:l.jsx(zc,{status:v.status})}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Priority"}),l.jsxs("span",{children:[v.priority,"/10"]}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Description"}),l.jsx("span",{children:v.description}),v.reason&&l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Reason"}),l.jsx("span",{children:v.reason})]}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Created by"}),l.jsx("span",{children:v.createdBy||"—"}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Created"}),l.jsx("span",{children:ar(v.createdAt)}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Scheduled for"}),l.jsx("span",{children:ar(v.scheduledFor)}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Started"}),l.jsx("span",{children:ar(v.startedAt)}),l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Completed"}),l.jsx("span",{children:ar(v.completedAt)}),v.dependencies.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Depends on"}),l.jsxs("span",{style:{fontSize:"11px"},children:[v.dependencies.length," task(s)"]})]}),v.dependents.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Dependents"}),l.jsxs("span",{style:{fontSize:"11px"},children:[v.dependents.length," task(s)"]})]})]}),v.payload&&l.jsxs("div",{style:{marginTop:"4px"},children:[l.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"Payload"}),l.jsx("pre",{style:{padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.2)",fontSize:"11px",overflow:"auto",maxHeight:"150px",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(()=>{try{return JSON.stringify(JSON.parse(v.payload),null,2)}catch{return v.payload}})()})]}),v.result&&l.jsxs("div",{style:{marginTop:"12px"},children:[l.jsx("div",{style:{fontSize:"12px",color:"#5cb85c",marginBottom:"4px"},children:"Result"}),l.jsx("pre",{style:{padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,0,0,0.2)",fontSize:"11px",overflow:"auto",maxHeight:"200px",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:fi(v.result,2e3)})]}),v.error&&l.jsxs("div",{style:{marginTop:"12px"},children:[l.jsx("div",{style:{fontSize:"12px",color:"#d9534f",marginBottom:"4px"},children:"Error"}),l.jsx("pre",{style:{padding:"8px",borderRadius:"4px",backgroundColor:"rgba(100,0,0,0.15)",fontSize:"11px",overflow:"auto",maxHeight:"150px",margin:0,color:"#f99"},children:v.error})]})]})})]},y.id)})})]})})]})}function Vh(){const[o,a]=f.useState([]),[u,d]=f.useState(!0),[p,m]=f.useState(null),[S,w]=f.useState(new Set),[v,k]=f.useState(!1),[_,j]=f.useState(""),[I,U]=f.useState(""),[O,y]=f.useState(""),[N,z]=f.useState([]),[W,L]=f.useState(!1),[P,M]=f.useState(null),[b,ce]=f.useState(null),ge=(J=!1)=>{J&&d(!0),oe.getMcpServers().then(ie=>{a(ie.data),d(!1)}).catch(ie=>{m(ie instanceof Error?ie.message:String(ie)),d(!1)})};f.useEffect(()=>{ge(!0)},[]);const X=J=>{w(ie=>{const V=new Set(ie);return V.has(J)?V.delete(J):V.add(J),V})},me=async()=>{if(_.trim()){L(!0),m(null);try{const J=I.trim()?I.trim().split(/\s+/):void 0,ie=_.startsWith("http://")||_.startsWith("https://"),V={};for(const ue of N)ue.key.trim()&&(V[ue.key.trim()]=ue.value);const ae=await oe.addMcpServer({...ie?{url:_.trim()}:{package:_.trim()},name:O.trim()||void 0,args:ie?void 0:J,env:Object.keys(V).length>0?V:void 0});ce(ae.data.message),j(""),U(""),y(""),z([]),k(!1),ge()}catch(J){m(J instanceof Error?J.message:String(J))}finally{L(!1)}}},De=async J=>{if(confirm(`Remove MCP server "${J}"?`)){M(J),m(null);try{const ie=await oe.removeMcpServer(J);ce(ie.data.message),ge()}catch(ie){m(ie instanceof Error?ie.message:String(ie))}finally{M(null)}}};if(u)return l.jsx("div",{className:"loading",children:"Loading..."});const Ue=o.filter(J=>J.connected).length;return l.jsxs("div",{children:[l.jsx("div",{className:"header",children:l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{children:[l.jsx("h1",{children:"MCP Servers"}),l.jsx("p",{children:"External tool servers connected via Model Context Protocol"})]}),l.jsx("button",{onClick:()=>k(!v),style:{fontSize:"13px"},children:v?"Cancel":"+ Add Server"})]})}),p&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px"},children:[p,l.jsx("button",{onClick:()=>m(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),b&&l.jsxs("div",{className:"alert success",style:{marginBottom:"14px"},children:[b,l.jsx("button",{onClick:()=>ce(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),v&&l.jsxs("div",{className:"card",style:{marginBottom:"14px"},children:[l.jsx("h2",{style:{margin:"0 0 10px"},children:"Add MCP Server"}),l.jsxs("div",{style:{display:"grid",gap:"8px"},children:[l.jsxs("div",{children:[l.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"Package or URL *"}),l.jsx("input",{type:"text",value:_,onChange:J=>j(J.target.value),placeholder:"@modelcontextprotocol/server-filesystem or http://localhost:3001/mcp",style:{width:"100%",fontSize:"13px"}})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px"},children:[l.jsxs("div",{children:[l.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"Arguments (space-separated)"}),l.jsx("input",{type:"text",value:I,onChange:J=>U(J.target.value),placeholder:"/tmp /home/user/docs",style:{width:"100%",fontSize:"13px"}})]}),l.jsxs("div",{children:[l.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"Name (auto-derived if empty)"}),l.jsx("input",{type:"text",value:O,onChange:J=>y(J.target.value),placeholder:"filesystem",style:{width:"100%",fontSize:"13px"}})]})]}),l.jsxs("div",{children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"4px"},children:[l.jsx("label",{style:{fontSize:"12px",color:"var(--text-secondary)"},children:"Environment Variables"}),l.jsx("button",{type:"button",onClick:()=>z([...N,{key:"",value:"",id:crypto.randomUUID()}]),style:{fontSize:"11px",padding:"1px 6px",opacity:.7},children:"+ Add"})]}),N.map((J,ie)=>l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 2fr auto",gap:"6px",marginBottom:"4px"},children:[l.jsx("input",{type:"text",value:J.key,onChange:V=>{const ae=[...N];ae[ie]={...ae[ie],key:V.target.value},z(ae)},placeholder:"BRAVE_API_KEY",style:{fontSize:"12px",fontFamily:"monospace"}}),l.jsx("input",{type:"password",value:J.value,onChange:V=>{const ae=[...N];ae[ie]={...ae[ie],value:V.target.value},z(ae)},placeholder:"sk-xxx...",style:{fontSize:"12px",fontFamily:"monospace"}}),l.jsx("button",{type:"button",onClick:()=>z(N.filter((V,ae)=>ae!==ie)),style:{fontSize:"11px",padding:"2px 6px",opacity:.6},children:"×"})]},J.id))]}),l.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"4px"},children:[l.jsx("button",{onClick:()=>k(!1),style:{fontSize:"13px",opacity:.7},children:"Cancel"}),l.jsx("button",{onClick:me,disabled:W||!_.trim(),style:{fontSize:"13px"},children:W?"Adding...":"Add Server"})]})]}),l.jsx("p",{style:{fontSize:"11px",color:"var(--text-secondary)",margin:"8px 0 0"},children:"Changes are saved to config.yaml. Restart teleton to connect."})]}),o.length===0&&!v&&l.jsxs("div",{className:"empty",children:[l.jsx("p",{children:"No MCP servers configured"}),l.jsxs("p",{style:{fontSize:"13px",color:"var(--text-secondary)",marginTop:"8px"},children:['Click "+ Add Server" above or use CLI: ',l.jsx("code",{children:"teleton mcp add @modelcontextprotocol/server-filesystem /tmp"})]})]}),o.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{fontSize:"13px",color:"var(--text-secondary)",marginBottom:"14px"},children:[Ue,"/",o.length," connected · ",o.reduce((J,ie)=>J+ie.toolCount,0)," tools total"]}),o.map(J=>l.jsxs("div",{className:"card",style:{marginBottom:"10px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("h2",{style:{margin:0},children:J.name}),l.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"3px",background:"var(--surface)",color:"var(--text-secondary)"},children:J.type}),J.scope!=="always"&&l.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"3px",background:"var(--surface)",color:"var(--text-secondary)"},children:J.scope})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"12px",color:J.connected?"var(--green)":"var(--red)"},children:[l.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:J.connected?"var(--green)":"var(--red)"}}),J.connected?"Connected":"Disconnected"]}),!J.enabled&&l.jsx("span",{style:{fontSize:"11px",color:"var(--text-secondary)"},children:"disabled"}),l.jsx("button",{onClick:()=>De(J.name),disabled:P===J.name,style:{fontSize:"11px",padding:"2px 8px",opacity:.6,cursor:P===J.name?"wait":"pointer"},children:P===J.name?"...":"Remove"})]})]}),l.jsx("div",{style:{fontSize:"12px",fontFamily:"monospace",color:"var(--text-secondary)",marginBottom:"8px"},children:J.target}),J.envKeys.length>0&&l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",marginBottom:"8px"},children:J.envKeys.map(ie=>l.jsxs("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"3px",background:"var(--surface)",color:"var(--text-secondary)",fontFamily:"monospace"},children:[ie,"=••••"]},ie))}),J.toolCount>0&&l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>X(J.name),style:{background:"none",border:"none",padding:0,fontSize:"12px",color:"var(--accent)",cursor:"pointer"},children:[S.has(J.name)?"▾":"▸"," ",J.toolCount," tools"]}),S.has(J.name)&&l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",marginTop:"8px"},children:J.tools.map(ie=>l.jsx("span",{style:{fontSize:"11px",padding:"2px 6px",borderRadius:"3px",background:"var(--surface)",color:"var(--text-secondary)"},children:ie},ie))})]})]},J.name))]})]})}const Kh=["API Keys","Agent","Telegram","Embedding","WebUI","Deals","Developer"];function Hh(o){const a=new Map;for(const d of o){const p=d.category||"Other";a.has(p)||a.set(p,[]),a.get(p).push(d)}const u=new Map;for(const d of Kh)a.has(d)&&(u.set(d,a.get(d)),a.delete(d));for(const[d,p]of a)u.set(d,p);return u}function Qh(){const[o,a]=f.useState([]),[u,d]=f.useState(!0),[p,m]=f.useState(null),[S,w]=f.useState(null),[v,k]=f.useState(null),[_,j]=f.useState(""),[I,U]=f.useState(!1),O=(P=!1)=>{P&&d(!0),oe.getConfigKeys().then(M=>{a(M.data),d(!1)}).catch(M=>{m(M instanceof Error?M.message:String(M)),d(!1)})};f.useEffect(()=>{O(!0)},[]);const y=P=>{var M;k(P.key),P.type==="boolean"?j(P.set&&P.value!==null?P.value:"true"):P.type==="enum"&&((M=P.options)!=null&&M.length)?j(P.set&&P.value!==null?P.value:P.options[0]):j("")},N=async P=>{const M=o.find(ce=>ce.key===P);if(!(!((M==null?void 0:M.type)==="boolean"||(M==null?void 0:M.type)==="enum")&&!_.trim())){U(!0),m(null),w(null);try{await oe.setConfigKey(P,_.trim()),k(null),j(""),w(`${P} updated successfully`),O()}catch(ce){m(ce instanceof Error?ce.message:String(ce))}finally{U(!1)}}},z=async P=>{U(!0),m(null),w(null);try{await oe.unsetConfigKey(P),w(`${P} removed`),O()}catch(M){m(M instanceof Error?M.message:String(M))}finally{U(!1)}},W=()=>{k(null),j("")};if(u)return l.jsx("div",{className:"loading",children:"Loading..."});const L=Hh(o);return l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Configuration"}),l.jsx("p",{children:"Manage API keys and settings"})]}),p&&l.jsxs("div",{className:"alert error",style:{marginBottom:"14px"},children:[p,l.jsx("button",{onClick:()=>m(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),S&&l.jsxs("div",{className:"alert success",style:{marginBottom:"14px"},children:[S,l.jsx("button",{onClick:()=>w(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),Array.from(L.entries()).map(([P,M])=>l.jsxs("div",{className:"card",style:{marginBottom:"10px"},children:[l.jsx("h2",{style:{marginBottom:"8px"},children:P}),M.map((b,ce)=>l.jsxs("div",{style:{padding:"12px 0",borderBottom:ce<M.length-1?"1px solid var(--separator)":"none"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{children:[l.jsx("strong",{style:{fontFamily:"monospace"},children:b.key}),l.jsx("span",{style:{marginLeft:"10px",fontSize:"11px",padding:"2px 8px",borderRadius:"4px",background:b.set?"var(--accent)":"var(--surface)",color:b.set?"var(--text-on-accent)":"var(--text-secondary)"},children:b.set?"Set":"Not set"}),b.sensitive&&l.jsx("span",{style:{marginLeft:"6px",fontSize:"11px",color:"var(--text-secondary)"},children:"sensitive"})]}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[l.jsx("button",{onClick:()=>y(b),style:{padding:"4px 12px",fontSize:"12px"},disabled:I,children:"Edit"}),b.set&&l.jsx("button",{onClick:()=>z(b.key),style:{padding:"4px 12px",fontSize:"12px",opacity:.7},disabled:I,children:"Remove"})]})]}),l.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginTop:"4px"},children:b.description}),b.set&&b.value&&v!==b.key&&l.jsx("div",{style:{marginTop:"6px",fontSize:"13px",color:"var(--text-secondary)",fontFamily:"monospace"},children:b.value}),v===b.key&&l.jsxs("div",{className:"form-group",style:{marginTop:"10px",marginBottom:0},children:[b.type==="boolean"?l.jsx(ht,{value:_,options:["true","false"],onChange:j,style:{width:"100%",marginBottom:"8px"}}):b.type==="enum"&&b.options?l.jsx(ht,{value:_,options:b.options,onChange:j,style:{width:"100%",marginBottom:"8px"}}):l.jsx("input",{type:b.type==="number"?"number":b.sensitive?"password":"text",value:_,onChange:ge=>j(ge.target.value),onKeyDown:ge=>ge.key==="Enter"&&N(b.key),placeholder:`Enter value for ${b.key}...`,autoFocus:!0,style:{width:"100%",marginBottom:"8px"}}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[l.jsx("button",{onClick:()=>N(b.key),disabled:I||b.type!=="boolean"&&b.type!=="enum"&&!_.trim(),children:I?"Saving...":"Save"}),l.jsx("button",{onClick:W,style:{opacity:.7},disabled:I,children:"Cancel"})]})]})]},b.key))]},P))]})}function Yh({data:o,onChange:a}){const[u,d]=f.useState(null),[p,m]=f.useState(!0),[S,w]=f.useState(""),[v,k]=f.useState(!1);f.useEffect(()=>{Xe.getStatus().then(j=>d(j)).catch(j=>w(j instanceof Error?j.message:String(j))).finally(()=>m(!1))},[]);const _=async j=>{if(a({...o,riskAccepted:j}),j&&!v)try{await Xe.initWorkspace(o.agentName||void 0),k(!0)}catch(I){w(I instanceof Error?I.message:String(I))}};return l.jsxs("div",{className:"step-content",children:[l.jsx("h2",{className:"step-title",children:"Welcome to Teleton Setup"}),l.jsx("p",{className:"step-description",children:"Configure your autonomous Telegram agent in a few steps."}),l.jsxs("details",{className:"guide-dropdown",children:[l.jsx("summary",{children:"Security Notice"}),l.jsxs("div",{className:"guide-content",children:["This software is an autonomous AI agent that can:",l.jsxs("ul",{style:{margin:"8px 0 8px 20px"},children:[l.jsx("li",{children:"Send and receive Telegram messages on your behalf"}),l.jsx("li",{children:"Execute cryptocurrency transactions using your wallet"}),l.jsx("li",{children:"Access and store conversation data"}),l.jsx("li",{children:"Make decisions and take actions autonomously"})]}),"You are solely responsible for all actions taken by this agent. By proceeding, you acknowledge that you understand these risks and accept full responsibility for the agent's behavior.",l.jsx("br",{}),l.jsx("br",{}),l.jsx("strong",{children:"Never share your API keys, wallet mnemonics, or session files."})]})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Agent Name"}),l.jsx("input",{type:"text",value:o.agentName,onChange:j=>a({...o,agentName:j.target.value}),placeholder:"Nova",className:"w-full"}),l.jsx("div",{className:"helper-text",children:"Your agent's display name in conversations."})]}),(u==null?void 0:u.configExists)&&l.jsx("div",{className:"info-box",children:"Existing configuration detected. It will be overwritten when setup completes."}),S&&l.jsx("div",{className:"alert error",children:S}),l.jsx("div",{className:"form-group",children:l.jsxs("label",{className:"label-inline",children:[l.jsx("input",{type:"checkbox",checked:o.riskAccepted,onChange:j=>_(j.target.checked)}),l.jsx("span",{children:"I understand the risks and accept full responsibility"})]})}),p&&l.jsx("div",{className:"loading",children:"Checking workspace..."})]})}function Jh({data:o,onChange:a}){const[u,d]=f.useState([]),[p,m]=f.useState(!0),[S,w]=f.useState(""),[v,k]=f.useState(null),[_,j]=f.useState(""),[I,U]=f.useState(!1),O=f.useRef(null);f.useEffect(()=>{Xe.getProviders().then(L=>d(L)).catch(L=>w(L instanceof Error?L.message:String(L))).finally(()=>m(!1))},[]);const y=u.find(L=>L.id===o.provider),N=L=>{a({...o,provider:L,apiKey:"",model:"",customModel:""}),k(null),j(""),O.current&&clearTimeout(O.current)},z=async(L,P)=>{if(!(!P||!L)){U(!0);try{const M=await Xe.validateApiKey(L,P);k(M.valid),j(M.error||"")}catch{k(null),j("")}finally{U(!1)}}},W=L=>{a({...o,apiKey:L}),k(null),j(""),O.current&&clearTimeout(O.current),L.length>0&&o.provider&&(O.current=setTimeout(()=>z(o.provider,L),500))};return p?l.jsx("div",{className:"loading",children:"Loading providers..."}):S?l.jsx("div",{className:"alert error",children:S}):l.jsxs("div",{className:"step-content",children:[l.jsx("h2",{className:"step-title",children:"Choose Your LLM Provider"}),l.jsx("p",{className:"step-description",children:"This is the AI model that powers your agent's intelligence. Pick the one you have an API key for."}),l.jsx("div",{className:"provider-grid",children:u.map(L=>l.jsxs("div",{className:`provider-card${o.provider===L.id?" selected":""}`,onClick:()=>N(L.id),children:[l.jsx("h3",{children:L.displayName}),l.jsx("div",{className:"provider-meta",children:L.defaultModel}),L.toolLimit===null&&l.jsx("span",{className:"badge always",style:{marginTop:"6px"},children:"Recommended"})]},L.id))}),y&&y.toolLimit!==null&&l.jsxs("div",{className:"info-box",style:{marginTop:"16px"},children:["Teleton has ~116 tools. With a ",y.toolLimit,"-tool limit, some tools may be truncated or unavailable."]}),y&&y.requiresApiKey&&l.jsxs("div",{className:"form-group",style:{marginTop:"16px"},children:[l.jsx("label",{children:"API Key"}),l.jsx("input",{type:"password",value:o.apiKey,onChange:L=>W(L.target.value),placeholder:y.keyPrefix?`${y.keyPrefix}...`:"Enter API key",className:"w-full"}),I&&l.jsxs("div",{className:"helper-text",children:[l.jsx("span",{className:"spinner sm"})," Validating..."]}),!I&&v===!0&&l.jsx("div",{className:"helper-text success",children:"Key format looks valid."}),!I&&v===!1&&_&&l.jsx("div",{className:"helper-text error",children:_}),y.consoleUrl&&l.jsxs("div",{className:"helper-text",children:["Get your key at:"," ",l.jsx("a",{href:y.consoleUrl,target:"_blank",rel:"noopener noreferrer",children:y.consoleUrl})]})]}),y&&!y.requiresApiKey&&y.id==="cocoon"&&l.jsxs("div",{style:{marginTop:"16px"},children:[l.jsx("div",{className:"info-panel",children:"Cocoon Network uses a local proxy. No API key required."}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Cocoon Proxy Port"}),l.jsx("input",{type:"number",value:o.cocoonPort,onChange:L=>a({...o,cocoonPort:parseInt(L.target.value)||0}),min:1,max:65535,className:"w-full"}),l.jsx("div",{className:"helper-text",children:"Port where the Cocoon client proxy is running (1-65535)."})]})]}),y&&y.id==="local"&&l.jsxs("div",{style:{marginTop:"16px"},children:[l.jsx("div",{className:"info-panel",children:"Connect to any OpenAI-compatible server (Ollama, vLLM, LM Studio, llama.cpp). No API key required."}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Server URL"}),l.jsx("input",{type:"url",value:o.localUrl,onChange:L=>a({...o,localUrl:L.target.value}),placeholder:"http://localhost:11434/v1",className:"w-full"}),l.jsx("div",{className:"helper-text",children:"Ollama :11434 · vLLM :8000 · LM Studio :1234 · llama.cpp :8080"})]})]})]})}function qh({data:o,onChange:a}){return l.jsxs("div",{className:"step-content",children:[l.jsx("h2",{className:"step-title",children:"Telegram Credentials"}),l.jsx("p",{className:"step-description",children:"These credentials allow your agent to use your Telegram account to send and receive messages."}),l.jsxs("details",{className:"guide-dropdown",children:[l.jsx("summary",{children:"How to get these credentials"}),l.jsxs("div",{className:"guide-content",children:[l.jsxs("div",{className:"guide-section",children:[l.jsx("strong",{children:"API ID & API Hash"}),l.jsxs("ol",{children:[l.jsxs("li",{children:["Open ",l.jsx("a",{href:"https://my.telegram.org",target:"_blank",rel:"noopener noreferrer",children:"my.telegram.org"})," in your browser"]}),l.jsx("li",{children:"Log in with your phone number (the one linked to your Telegram account)"}),l.jsxs("li",{children:["Click ",l.jsx("strong",{children:"API development tools"})]}),l.jsx("li",{children:`If prompted, create a new app — the name and platform don't matter (e.g. "MyApp", Desktop)`}),l.jsxs("li",{children:["Copy ",l.jsx("strong",{children:"App api_id"})," (a number) and ",l.jsx("strong",{children:"App api_hash"})," (a hex string)"]})]})]}),l.jsxs("div",{className:"guide-section",children:[l.jsx("strong",{children:"Phone Number"}),l.jsx("p",{children:"The phone number linked to your Telegram account, with country code (e.g. +33612345678)."})]}),l.jsxs("div",{className:"guide-section",children:[l.jsx("strong",{children:"User ID"}),l.jsxs("ol",{children:[l.jsxs("li",{children:["Open Telegram and search for ",l.jsx("a",{href:"https://t.me/userinfobot",target:"_blank",rel:"noopener noreferrer",children:"@userinfobot"})]}),l.jsxs("li",{children:["Send ",l.jsx("code",{children:"/start"})," — the bot will reply with your numeric User ID"]})]})]})]})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"API ID"}),l.jsx("input",{type:"number",value:o.apiId||"",onChange:u=>a({...o,apiId:parseInt(u.target.value)||0}),placeholder:"12345678",className:"w-full"})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"API Hash"}),l.jsx("input",{type:"text",value:o.apiHash,onChange:u=>a({...o,apiHash:u.target.value}),placeholder:"abcdef0123456789abcdef0123456789",className:"w-full"}),o.apiHash.length>0&&o.apiHash.length<10&&l.jsx("div",{className:"helper-text",children:"API Hash should be at least 10 characters."})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Phone Number"}),l.jsx("input",{type:"text",value:o.phone,onChange:u=>a({...o,phone:u.target.value}),placeholder:"+33612345678",className:"w-full"}),o.phone.length>0&&!o.phone.startsWith("+")&&l.jsx("div",{className:"helper-text",children:'Phone number must start with "+"'})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Admin User ID"}),l.jsx("input",{type:"number",value:o.userId||"",onChange:u=>a({...o,userId:parseInt(u.target.value)||0}),placeholder:"123456789",className:"w-full"}),l.jsxs("div",{className:"helper-text",children:["This account will have admin control over the agent in DMs and groups. Get your ID from ",l.jsx("a",{href:"https://t.me/userinfobot",target:"_blank",rel:"noopener noreferrer",children:"@userinfobot"})," on Telegram."]})]})]})}function Gh({data:o,onChange:a}){const[u,d]=f.useState([]),[p,m]=f.useState(!1),[S,w]=f.useState(!1),[v,k]=f.useState(null),[_,j]=f.useState(!1),[I,U]=f.useState(""),O=async()=>{if(o.botToken){w(!0),U(""),k(null),j(!1);try{const L=await Xe.validateBotToken(o.botToken);L.valid&&L.bot?(k(!0),a({...o,botUsername:L.bot.username})):L.networkError?j(!0):(k(!1),U(L.error||"Invalid bot token"))}catch(L){U(L instanceof Error?L.message:String(L))}finally{w(!1)}}};f.useEffect(()=>{o.provider==="cocoon"||o.provider==="local"||!o.provider||(m(!0),Xe.getModels(o.provider).then(L=>{d(L),!o.model&&L.length>0&&a({...o,model:L[0].value})}).catch(()=>d([])).finally(()=>m(!1)))},[o.provider]);const y=["open","allowlist","disabled"],N=["Open","Allowlist","Disabled"],z={open:"Anyone can message the agent in DMs.",allowlist:"Only admin users can DM the agent.",disabled:"Agent ignores all DMs."},W={open:"Agent responds in any group it's added to.",allowlist:"Agent only responds in groups explicitly allowed by admins.",disabled:"Agent ignores all group messages."};return l.jsxs("div",{className:"step-content",children:[l.jsx("h2",{className:"step-title",children:"Configuration"}),l.jsx("p",{className:"step-description",children:"Configure your agent's model and behavior. Defaults are pre-filled — adjust what you need."}),o.provider==="cocoon"||o.provider==="local"?l.jsxs("div",{className:"info-panel",children:["Model is auto-discovered from the ",o.provider==="local"?"local server":"Cocoon proxy"," at startup."]}):l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Model"}),p?l.jsxs("div",{className:"text-muted",children:[l.jsx("span",{className:"spinner sm"})," Loading models..."]}):l.jsx(ht,{value:o.model,options:u.map(L=>L.value),labels:u.map(L=>L.isCustom?"Custom...":`${L.name} - ${L.description}`),onChange:L=>a({...o,model:L}),style:{width:"100%"}}),o.model==="__custom__"&&l.jsx("input",{type:"text",value:o.customModel,onChange:L=>a({...o,customModel:L.target.value}),placeholder:"Enter custom model ID",className:"w-full",style:{marginTop:"8px"}})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"DM Policy"}),l.jsx(ht,{value:o.dmPolicy,options:y,labels:N,onChange:L=>a({...o,dmPolicy:L}),style:{width:"100%"}}),l.jsx("div",{className:"helper-text",children:z[o.dmPolicy]||""})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Group Policy"}),l.jsx(ht,{value:o.groupPolicy,options:y,labels:N,onChange:L=>a({...o,groupPolicy:L}),style:{width:"100%"}}),l.jsx("div",{className:"helper-text",children:W[o.groupPolicy]||""})]}),l.jsxs("div",{className:"form-group",children:[l.jsxs("div",{className:"card-toggle",children:[l.jsx("span",{style:{fontSize:"13px",fontWeight:500},children:"Require @mention in groups"}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{type:"checkbox",checked:o.requireMention,onChange:L=>a({...o,requireMention:L.target.checked})}),l.jsx("div",{className:"toggle-track"}),l.jsx("div",{className:"toggle-thumb"})]})]}),l.jsx("div",{className:"helper-text",children:"When enabled, the agent only responds when mentioned by name in group chats."})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Max Agentic Iterations"}),l.jsx("input",{type:"number",value:o.maxIterations,onChange:L=>a({...o,maxIterations:parseInt(L.target.value)||1}),min:1,max:50,className:"w-full"}),l.jsx("div",{className:"helper-text",children:"Maximum tool-call loops per message (1-50). Higher values allow more complex tasks."})]}),l.jsx("h3",{style:{fontSize:"14px",fontWeight:600,marginTop:"24px",marginBottom:"12px"},children:"Optional API Keys"}),l.jsxs("div",{className:"module-list",children:[l.jsxs("div",{className:"module-item",children:[l.jsxs("div",{className:"form-row",style:{gap:"12px",alignItems:"center"},children:[l.jsxs("div",{style:{flex:1},children:[l.jsx("strong",{style:{fontSize:"var(--font-md)"},children:"Bot Token"}),l.jsx("span",{className:"module-desc",style:{marginLeft:"8px"},children:"(recommended)"})]}),l.jsx("input",{type:"password",value:o.botToken,onChange:L=>{a({...o,botToken:L.target.value,botUsername:""}),k(null),j(!1),U("")},placeholder:"123456:ABC-DEF...",style:{flex:1}}),l.jsx("button",{onClick:O,disabled:S||!o.botToken,type:"button",children:S?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Validating"]}):"Validate"})]}),v&&o.botUsername&&l.jsxs("div",{className:"alert success",children:["Bot verified: @",o.botUsername]}),_&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"info-box",children:"Could not reach Telegram API. Enter the bot username manually."}),l.jsxs("div",{className:"form-row",style:{gap:"12px",alignItems:"center",marginTop:"8px"},children:[l.jsx("div",{style:{flex:1},children:l.jsx("strong",{style:{fontSize:"var(--font-md)"},children:"Bot Username"})}),l.jsx("input",{type:"text",value:o.botUsername,onChange:L=>a({...o,botUsername:L.target.value}),placeholder:"my_bot",style:{flex:1}})]})]}),v===!1&&I&&l.jsx("div",{className:"alert error",children:I}),l.jsxs("div",{className:"helper-text",children:["Inline buttons and rich interactions. Create via ",l.jsx("a",{href:"https://t.me/BotFather",target:"_blank",rel:"noopener noreferrer",children:"@BotFather"}),"."]})]}),l.jsxs("div",{className:"module-item",children:[l.jsxs("div",{className:"form-row",style:{gap:"12px",alignItems:"center"},children:[l.jsxs("div",{style:{flex:1},children:[l.jsx("strong",{style:{fontSize:"var(--font-md)"},children:"TonAPI Key"}),l.jsx("span",{className:"module-desc",style:{marginLeft:"8px"},children:"(optional)"})]}),l.jsx("input",{type:"text",value:o.tonapiKey,onChange:L=>a({...o,tonapiKey:L.target.value}),placeholder:"Your TonAPI key",style:{flex:1}})]}),l.jsxs("div",{className:"helper-text",children:["Enhanced blockchain queries. Free key from ",l.jsx("a",{href:"https://t.me/tonapibot",target:"_blank",rel:"noopener noreferrer",children:"@tonapibot"}),"."]})]}),l.jsxs("div",{className:"module-item",children:[l.jsxs("div",{className:"form-row",style:{gap:"12px",alignItems:"center"},children:[l.jsxs("div",{style:{flex:1},children:[l.jsx("strong",{style:{fontSize:"var(--font-md)"},children:"Web Search"}),l.jsx("span",{className:"module-desc",style:{marginLeft:"8px"},children:"(optional)"})]}),l.jsx("input",{type:"text",value:o.tavilyKey,onChange:L=>a({...o,tavilyKey:L.target.value}),placeholder:"tvly-...",style:{flex:1}})]}),l.jsxs("div",{className:"helper-text",children:["Tavily web search. Free plan at ",l.jsx("a",{href:"https://tavily.com",target:"_blank",rel:"noopener noreferrer",children:"tavily.com"}),"."]})]})]})]})}function Ic({text:o}){const[a,u]=f.useState(!1),d=f.useCallback(()=>{navigator.clipboard.writeText(o).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)})},[o]);return l.jsx("button",{type:"button",className:"btn-ghost btn-sm",onClick:d,style:{marginLeft:"8px"},children:a?"Copied":"Copy"})}function Xh({data:o,onChange:a}){const[u,d]=f.useState(null),[p,m]=f.useState(!0),[S,w]=f.useState(!1),[v,k]=f.useState(""),[_,j]=f.useState([]);f.useEffect(()=>{Xe.getWalletStatus().then(y=>{d(y),y.exists&&y.address&&a({...o,walletAddress:y.address,walletAction:"keep"})}).catch(y=>k(y instanceof Error?y.message:String(y))).finally(()=>m(!1))},[]);const I=async()=>{w(!0),k("");try{if(o.walletAction==="import"){const y=o.mnemonic.trim().split(/\s+/);if(y.length!==24){k("Mnemonic must be exactly 24 words."),w(!1);return}const N=await Xe.importWallet(o.mnemonic.trim());a({...o,walletAddress:N.address}),j(y)}else{const y=await Xe.generateWallet();a({...o,walletAddress:y.address}),j(y.mnemonic)}}catch(y){k(y instanceof Error?y.message:String(y))}finally{w(!1)}};if(p)return l.jsx("div",{className:"loading",children:"Checking wallet..."});const U=_.length>0,O=o.walletAction!=="keep"&&!U;return l.jsxs("div",{className:"step-content",children:[l.jsx("h2",{className:"step-title",children:"TON Wallet"}),l.jsx("p",{className:"step-description",children:"Your agent needs a TON wallet to send and receive crypto. You can create a new one or import an existing wallet."}),v&&l.jsx("div",{className:"alert error",children:v}),(u==null?void 0:u.exists)&&u.address&&!U&&l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"helper-text",style:{marginTop:0,marginBottom:"4px"},children:"Current wallet"}),l.jsx("div",{className:"mono",style:{fontSize:"13px",wordBreak:"break-all"},children:u.address})]}),!U&&l.jsx("div",{className:"form-group",children:(u!=null&&u.exists?["keep","generate","import"]:["generate","import"]).map(y=>l.jsxs("label",{className:"label-inline",style:{marginBottom:"8px"},children:[l.jsx("input",{type:"radio",name:"walletAction",value:y,checked:o.walletAction===y,onChange:()=>{a({...o,walletAction:y,mnemonic:"",mnemonicSaved:!1})}}),l.jsxs("span",{children:[y==="keep"&&"Keep existing wallet",y==="generate"&&"Generate new wallet",y==="import"&&"Import from mnemonic"]})]},y))}),o.walletAction==="import"&&!U&&l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Recovery Phrase (24 words)"}),l.jsx("textarea",{value:o.mnemonic,onChange:y=>a({...o,mnemonic:y.target.value}),placeholder:"word1 word2 word3 ... word24",className:"w-full mono",style:{minHeight:"80px"}})]}),O&&o.walletAction!=="keep"&&l.jsx("button",{onClick:I,disabled:S||o.walletAction==="import"&&o.mnemonic.trim().split(/\s+/).length!==24,type:"button",children:S?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Working..."]}):o.walletAction==="generate"?"Generate Wallet":"Import Wallet"}),U&&l.jsxs(l.Fragment,{children:[o.walletAddress&&l.jsxs("div",{className:"card",style:{marginBottom:"16px"},children:[l.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"Wallet Address"}),l.jsxs("div",{className:"form-row",style:{alignItems:"center"},children:[l.jsx("span",{className:"mono",style:{fontWeight:600,fontSize:"14px",wordBreak:"break-all",color:"var(--text)"},children:o.walletAddress}),l.jsx(Ic,{text:o.walletAddress})]})]}),l.jsxs("div",{className:"warning-card",children:[l.jsx("strong",{children:"WRITE DOWN THESE 24 WORDS"}),l.jsx("br",{}),"This is your only way to recover your wallet. Store them securely offline. Never share them."]}),l.jsx("ol",{className:"mnemonic-grid",children:_.map((y,N)=>l.jsxs("li",{className:"mnemonic-word",children:[l.jsxs("span",{className:"num",children:[N+1,"."]}),y]},N))}),l.jsx("div",{className:"form-row",style:{justifyContent:"flex-end",marginBottom:"8px"},children:l.jsx(Ic,{text:_.join(" ")})}),l.jsx("div",{className:"form-group",style:{marginTop:"16px"},children:l.jsxs("label",{className:"label-inline",style:{color:"var(--text)"},children:[l.jsx("input",{type:"checkbox",checked:o.mnemonicSaved,onChange:y=>a({...o,mnemonicSaved:y.target.checked})}),l.jsx("span",{style:{fontWeight:500},children:"I have saved my recovery phrase"})]})})]})]})}const Zh="modulepreload",em=function(o){return"/"+o},Oc={},tl=function(a,u,d){let p=Promise.resolve();if(u&&u.length>0){let S=function(k){return Promise.all(k.map(_=>Promise.resolve(_).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};document.getElementsByTagName("link");const w=document.querySelector("meta[property=csp-nonce]"),v=(w==null?void 0:w.nonce)||(w==null?void 0:w.getAttribute("nonce"));p=S(u.map(k=>{if(k=em(k),k in Oc)return;Oc[k]=!0;const _=k.endsWith(".css"),j=_?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${k}"]${j}`))return;const I=document.createElement("link");if(I.rel=_?"stylesheet":Zh,_||(I.as="script"),I.crossOrigin="",I.href=k,v&&I.setAttribute("nonce",v),document.head.appendChild(I),_)return new Promise((U,O)=>{I.addEventListener("load",U),I.addEventListener("error",()=>O(new Error(`Unable to preload CSS for ${k}`)))})}))}function m(S){const w=new Event("vite:preloadError",{cancelable:!0});if(w.payload=S,window.dispatchEvent(w),!w.defaultPrevented)throw S}return p.then(S=>{for(const w of S||[])w.status==="rejected"&&m(w.reason);return a().catch(m)})},tm=f.lazy(()=>tl(()=>import("./index.es-D81xLR29.js"),[])),nm=()=>tl(()=>import("./run-DOrDowjK.js"),[]).then(o=>o.default),rm=()=>tl(()=>import("./login-telegram-BP7CJDmx.js"),[]).then(o=>o.default);function Dc({loader:o,size:a}){const[u,d]=f.useState(null);return f.useEffect(()=>{o().then(d)},[]),u?l.jsx(f.Suspense,{fallback:l.jsx("div",{style:{width:a,height:a,margin:"0 auto 16px"}}),children:l.jsx(tm,{animationData:u,loop:!0,style:{width:a,height:a,margin:"0 auto 16px"}})}):l.jsx("div",{style:{width:a,height:a,margin:"0 auto 16px"}})}function lm({data:o,onChange:a}){const[u,d]=f.useState("idle"),[p,m]=f.useState(!1),[S,w]=f.useState(""),[v,k]=f.useState(""),[_,j]=f.useState(""),[I,U]=f.useState(""),[O,y]=f.useState(!1),[N,z]=f.useState(!1),[W,L]=f.useState(0),P=f.useRef(null);f.useEffect(()=>{if(!(W<=0))return P.current=setInterval(()=>{L(X=>X<=1?(P.current&&clearInterval(P.current),0):X-1)},1e3),()=>{P.current&&clearInterval(P.current)}},[W>0]),f.useEffect(()=>{if(u!=="code_sent")return;const X=setTimeout(()=>z(!0),3e4);return()=>clearTimeout(X)},[u]),f.useEffect(()=>{o.telegramUser&&d("done")},[]);const M=async()=>{var X;m(!0),w("");try{const me=await Xe.sendCode(o.apiId,o.apiHash,o.phone);a({...o,authSessionId:me.authSessionId}),y(me.codeViaApp),d("code_sent"),z(!1)}catch(me){const De=me instanceof Error?me.message:String(me);if(De.includes("FLOOD")){const Ue=parseInt(((X=De.match(/(\d+)/))==null?void 0:X[1])||"60");L(Ue)}w(De)}finally{m(!1)}},b=async X=>{if(k(X),!(X.length<5)){m(!0),w("");try{const me=await Xe.verifyCode(o.authSessionId,X);me.status==="authenticated"&&me.user?(a({...o,telegramUser:me.user,skipConnect:!1}),d("done")):me.status==="2fa_required"&&(U(me.passwordHint||""),d("2fa"))}catch(me){const De=me instanceof Error?me.message:String(me);w(De)}finally{m(!1)}}},ce=async()=>{m(!0),w("");try{const X=await Xe.verifyPassword(o.authSessionId,_);X.status==="authenticated"&&X.user&&(a({...o,telegramUser:X.user,skipConnect:!1}),d("done"))}catch(X){w(X instanceof Error?X.message:String(X))}finally{m(!1)}},ge=async()=>{m(!0),w("");try{const X=await Xe.resendCode(o.authSessionId);y(X.codeViaApp),k(""),z(!1)}catch(X){w(X instanceof Error?X.message:String(X))}finally{m(!1)}};return l.jsxs("div",{className:"step-content",children:[l.jsx("h2",{className:"step-title",children:"Connect to Telegram"}),l.jsx("p",{className:"step-description",children:"Authenticate with your Telegram account. This lets the agent send and receive messages as you."}),S&&l.jsx("div",{className:"alert error",children:S}),u==="idle"&&l.jsxs("div",{className:"text-center",style:{padding:"20px 0"},children:[l.jsx(Dc,{loader:nm,size:200}),l.jsx("button",{onClick:M,disabled:p||W>0,type:"button",className:"btn-lg",children:p?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Connecting..."]}):W>0?`Wait ${W}s`:"Connect to Telegram"})]}),u==="code_sent"&&l.jsxs("div",{className:"text-center",style:{padding:"20px 0"},children:[l.jsx(Dc,{loader:rm,size:180}),l.jsxs("div",{className:"text-muted",style:{marginBottom:"16px"},children:["Code sent via ",O?"Telegram app":"SMS"]}),l.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:"16px"},children:l.jsx("input",{className:"code-input",type:"text",inputMode:"numeric",value:v,onChange:X=>{const me=X.target.value.replace(/\D/g,"").slice(0,5);b(me)},placeholder:"12345",maxLength:5,autoFocus:!0,disabled:p})}),p&&l.jsxs("div",{className:"text-muted",children:[l.jsx("span",{className:"spinner sm"})," Verifying..."]}),N&&!p&&l.jsx("button",{type:"button",className:"btn-ghost",onClick:ge,children:"Resend code"})]}),u==="2fa"&&l.jsxs("div",{style:{padding:"20px 0"},children:[l.jsx("div",{className:"text-muted text-center",style:{marginBottom:"12px"},children:"Two-factor authentication required"}),I&&l.jsxs("div",{className:"info-panel text-center",children:["Hint: ",I]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Password"}),l.jsx("input",{type:"password",value:_,onChange:X=>j(X.target.value),onKeyDown:X=>X.key==="Enter"&&ce(),placeholder:"Enter your 2FA password",className:"w-full",autoFocus:!0})]}),l.jsx("button",{onClick:ce,disabled:p||!_,type:"button",children:p?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Verifying..."]}):"Submit"})]}),u==="done"&&o.telegramUser&&l.jsxs("div",{className:"alert success text-center",style:{padding:"20px"},children:["Connected as ",l.jsx("strong",{children:o.telegramUser.firstName}),o.telegramUser.username&&l.jsxs(l.Fragment,{children:[" (@",o.telegramUser.username,")"]})]})]})}const Ln=[{id:"welcome",label:"Welcome"},{id:"provider",label:"Provider"},{id:"telegram",label:"Telegram"},{id:"config",label:"Config"},{id:"wallet",label:"Wallet"},{id:"connect",label:"Connect"}],sm={riskAccepted:!1,agentName:"Nova",provider:"",apiKey:"",cocoonPort:11435,localUrl:"http://localhost:11434/v1",apiId:0,apiHash:"",phone:"",userId:0,mode:"quick",model:"",customModel:"",dmPolicy:"open",groupPolicy:"allowlist",requireMention:!0,maxIterations:5,botToken:"",botUsername:"",tonapiKey:"",tavilyKey:"",customizeThresholds:!1,buyMaxFloor:100,sellMinFloor:105,walletAction:"generate",mnemonic:"",walletAddress:"",mnemonicSaved:!1,authSessionId:"",telegramUser:null,skipConnect:!1,webuiEnabled:!1};function om(o,a){switch(o){case 0:return a.riskAccepted;case 1:if(!a.provider)return!1;if(a.provider==="cocoon")return a.cocoonPort>=1&&a.cocoonPort<=65535;if(a.provider==="local")try{return new URL(a.localUrl),!0}catch{return!1}return a.apiKey.length>0;case 2:return a.apiId>0&&a.apiHash.length>=10&&a.phone.startsWith("+")&&a.userId>0;case 3:return a.provider!=="cocoon"&&a.provider!=="local"&&!(a.model==="__custom__"?a.customModel:a.model)?!1:a.maxIterations>=1&&a.maxIterations<=50;case 4:return a.walletAction==="keep"?!0:a.walletAddress?a.mnemonicSaved:!1;case 5:return a.telegramUser!==null||a.skipConnect;default:return!1}}const td=f.createContext(null);function Ci(){const o=f.useContext(td);if(!o)throw new Error("useSetup must be used inside SetupProvider");return o}function im({children:o}){const[a,u]=f.useState(0),[d,p]=f.useState(sm),[m,S]=f.useState(!1),[w,v]=f.useState(""),[k,_]=f.useState(!1),[j,I]=f.useState(!1),[U,O]=f.useState(""),y=om(a,d),N=f.useCallback(()=>{y&&u(M=>Math.min(M+1,Ln.length-1))},[y]),z=f.useCallback(()=>{u(M=>Math.max(M-1,0))},[]),W=f.useCallback(async()=>{S(!0),v("");try{const M=d.model==="__custom__"?d.customModel:d.model||void 0,b={agent:{provider:d.provider,...d.provider!=="cocoon"&&d.provider!=="local"&&d.apiKey?{api_key:d.apiKey}:{},...d.provider==="local"?{base_url:d.localUrl}:{},...M?{model:M}:{},max_agentic_iterations:d.maxIterations},telegram:{api_id:d.apiId,api_hash:d.apiHash,phone:d.phone,admin_ids:[d.userId],owner_id:d.userId,dm_policy:d.dmPolicy,group_policy:d.groupPolicy,require_mention:d.requireMention,...d.botToken?{bot_token:d.botToken}:{},...d.botUsername?{bot_username:d.botUsername}:{}},...d.provider==="cocoon"?{cocoon:{port:d.cocoonPort}}:{},...d.customizeThresholds?{deals:{buy_max_floor_percent:d.buyMaxFloor,sell_min_floor_percent:d.sellMinFloor}}:{},...d.tonapiKey?{tonapi_key:d.tonapiKey}:{},...d.tavilyKey?{tavily_api_key:d.tavilyKey}:{},webui:{enabled:!0}};await Xe.saveConfig(b),_(!0)}catch(M){v(M instanceof Error?M.message:String(M))}finally{S(!1)}},[d]),L=f.useCallback(async()=>{I(!0),O("");try{const{token:M}=await Xe.launch();await Xe.pollHealth(3e4),window.location.href=`/auth/exchange?token=${encodeURIComponent(M)}`}catch(M){O(M instanceof Error?M.message:String(M))}finally{I(!1)}},[]),P=f.useRef(W);return P.current=W,f.useEffect(()=>{a===Ln.length-1&&d.telegramUser&&!k&&!m&&P.current()},[a,d.telegramUser,k,m]),l.jsx(td.Provider,{value:{step:a,data:d,loading:m,error:w,saved:k,launching:j,launchError:U,canAdvance:y,setData:p,next:N,prev:z,handleSave:W,handleLaunch:L},children:o})}const am=f.lazy(()=>tl(()=>import("./index.es-D81xLR29.js"),[])),um=()=>tl(()=>import("./complete-fZLnb5Ot.js"),[]).then(o=>o.default);function cm(){const[o,a]=f.useState(null);f.useEffect(()=>{um().then(a)},[]);const u=200;return o?l.jsx(f.Suspense,{fallback:l.jsx("div",{style:{width:u,height:u,margin:"0 auto 24px"}}),children:l.jsx(am,{animationData:o,loop:!0,style:{width:u,height:u,margin:"0 auto 24px"}})}):l.jsx("div",{style:{width:u,height:u,margin:"0 auto 24px"}})}function dm(){const{launching:o,launchError:a,handleLaunch:u}=Ci();return l.jsxs("div",{className:"step-content text-center",style:{paddingTop:"40px"},children:[l.jsx(cm,{}),l.jsx("h2",{style:{fontSize:"20px",fontWeight:600,letterSpacing:"-0.3px",marginBottom:"8px"},children:"Your Agent is ready"}),l.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"14px",marginBottom:"32px"},children:"Configuration saved. Start your agent to begin."}),l.jsx("button",{onClick:u,disabled:o,className:"btn-lg",style:{minWidth:"200px"},children:o?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Starting..."]}):"Start Agent"}),o&&l.jsx("p",{className:"helper-text",style:{marginTop:"16px"},children:"Booting your agent... this may take a few seconds."}),a&&l.jsxs("div",{style:{marginTop:"20px"},children:[l.jsx("div",{className:"alert error",children:a}),l.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"13px",marginTop:"8px"},children:"Start manually:"}),l.jsx("code",{className:"code-block",style:{marginTop:"8px"},children:"teleton start"})]})]})}const fm=[Yh,Jh,qh,Gh,Xh,lm];function pm(){const{step:o,data:a,loading:u,error:d,saved:p,canAdvance:m,setData:S,next:w,prev:v,handleSave:k}=Ci();if(p)return l.jsx(dm,{});const _=fm[o],j=o<Ln.length-1?Ln[o+1].label:"";return l.jsxs(l.Fragment,{children:[l.jsx(_,{data:a,onChange:S}),d&&l.jsx("div",{className:"alert error",children:d}),l.jsxs("div",{className:"setup-nav",children:[o>0&&l.jsx("button",{className:"btn-ghost",onClick:v,type:"button",children:"Back"}),l.jsx("div",{style:{flex:1}}),o<Ln.length-1&&l.jsx("button",{onClick:w,disabled:!m||u,type:"button",children:u?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Next"]}):`Next: ${j}`})]})]})}function hm(){const{step:o}=Ci();return l.jsx("div",{className:"step-indicator",children:Ln.map((a,u)=>{const d=u<o,p=u===o;return l.jsxs("div",{className:"step-cell",children:[l.jsxs("div",{className:"step-cell-top",children:[l.jsx("div",{className:`step-dot${p?" active":""}${d?" completed":""}`,children:d?l.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("polyline",{points:"20 6 9 17 4 12"})}):l.jsx("span",{children:u+1})}),u<Ln.length-1&&l.jsx("div",{className:`step-line${d?" completed":""}`})]}),l.jsx("div",{className:`step-label${p?" active":""}${d?" completed":""}`,children:a.label})]},a.id)})})}const mm=[{label:"Dashboard",path:"/"},{label:"Tools",path:"/tools"},{label:"Plugins",path:"/plugins"},{label:"Soul",path:"/soul"},{label:"Memory",path:"/memory"},{label:"Logs",path:"/logs"},{label:"Workspace",path:"/workspace"},{label:"Tasks",path:"/tasks"},{label:"MCP",path:"/mcp"},{label:"Config",path:"/config"}];function gm(){return l.jsx("nav",{children:mm.map(o=>l.jsx("span",{className:"sidebar-link-disabled",children:o.label},o.path))})}function ym(){return l.jsxs(l.Fragment,{children:[l.jsx(hm,{}),l.jsx(Yc,{})]})}function vm(){return l.jsx(im,{children:l.jsx(Gc,{sidebar:l.jsx(gm,{}),children:l.jsx(ym,{})})})}function xm(){return window.location.pathname.startsWith("/setup")?l.jsx(qc,{children:l.jsx(Xc,{children:l.jsx(Jc,{children:l.jsx(rt,{path:"/setup",element:l.jsx(vm,{}),children:l.jsx(rt,{index:!0,element:l.jsx(pm,{})})})})})}):l.jsx(Sm,{})}function Sm(){const[o,a]=f.useState(!1),[u,d]=f.useState(!0),[p,m]=f.useState(""),[S,w]=f.useState("");f.useEffect(()=>{const _=new URLSearchParams(window.location.search).get("token");if(window.location.pathname==="/auth/exchange"&&_){Pc(_).then(j=>{j?window.location.href="/":(d(!1),w("Token exchange failed"))});return}_h().then(j=>{a(j),d(!1)})},[]),f.useEffect(()=>{o&&Tn.connect()},[o]);const v=async()=>{const k=p.trim();if(!k)return;w(""),await Pc(k)?a(!0):w("Invalid token")};return u?l.jsx("div",{className:"login-container",children:l.jsx("div",{className:"login-card",children:l.jsx("p",{children:"Loading..."})})}):o?l.jsx(qc,{children:l.jsx(Xc,{children:l.jsx(Jc,{children:l.jsxs(rt,{path:"/",element:l.jsx(Lh,{}),children:[l.jsx(rt,{index:!0,element:l.jsx(Rh,{})}),l.jsx(rt,{path:"tools",element:l.jsx(zh,{})}),l.jsx(rt,{path:"plugins",element:l.jsx(Ih,{})}),l.jsx(rt,{path:"soul",element:l.jsx(Dh,{})}),l.jsx(rt,{path:"memory",element:l.jsx(Mh,{})}),l.jsx(rt,{path:"logs",element:l.jsx(Bh,{})}),l.jsx(rt,{path:"workspace",element:l.jsx(Wh,{})}),l.jsx(rt,{path:"tasks",element:l.jsx(bh,{})}),l.jsx(rt,{path:"mcp",element:l.jsx(Vh,{})}),l.jsx(rt,{path:"config",element:l.jsx(Qh,{})}),l.jsx(rt,{path:"*",element:l.jsx(lh,{to:"/",replace:!0})})]})})})}):l.jsx("div",{className:"login-container",children:l.jsxs("div",{className:"login-card",children:[l.jsx("h1",{children:"Teleton"}),l.jsx("p",{children:"Enter your authentication token to access the dashboard."}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Token"}),l.jsx("input",{type:"password",value:p,onChange:k=>m(k.target.value),onKeyDown:k=>k.key==="Enter"&&v(),placeholder:"Paste token from config...",style:{width:"100%"}})]}),S&&l.jsx("div",{className:"alert error",style:{marginBottom:"1rem"},children:S}),l.jsx("button",{onClick:v,style:{width:"100%"},children:"Sign In"})]})})}cp.createRoot(document.getElementById("root")).render(l.jsx(f.StrictMode,{children:l.jsx(xm,{})}));export{Mc as R,tp as g,f as r};