teleton 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -26
- package/dist/{chunk-D5I7GBV7.js → chunk-FNV5FF35.js} +22 -13
- package/dist/chunk-LRCPA7SC.js +149 -0
- package/dist/{chunk-ADCMUNYU.js → chunk-N3F7E7DR.js} +58 -53
- package/dist/chunk-ND2X5FWB.js +368 -0
- package/dist/chunk-NERLQY2H.js +421 -0
- package/dist/{chunk-YBA6IBGT.js → chunk-OCLG5GKI.js} +24 -24
- package/dist/{chunk-6L6KGATM.js → chunk-OGIG552S.js} +1397 -1688
- package/dist/chunk-RCMD3U65.js +141 -0
- package/dist/{chunk-4IPJ25HE.js → chunk-TCD4NZDA.js} +1045 -658
- package/dist/{chunk-ECSCVEQQ.js → chunk-UCN6TI25.js} +7 -3
- package/dist/{chunk-WL2Q3VRD.js → chunk-UDD7FYOU.js} +12 -4
- package/dist/chunk-VAUJSSD3.js +20 -0
- package/dist/chunk-XBE4JB7C.js +8 -0
- package/dist/{chunk-GDCODBNO.js → chunk-XBKSS6DM.js} +2 -16
- package/dist/cli/index.js +878 -433
- package/dist/client-3VWE7NC4.js +29 -0
- package/dist/{get-my-gifts-KVULMBJ3.js → get-my-gifts-RI7FAXAL.js} +3 -1
- package/dist/index.js +17 -11
- package/dist/{memory-TVDOGQXS.js → memory-RD7ZSTRV.js} +7 -5
- package/dist/{migrate-QIEMPOMT.js → migrate-GO4NOBT7.js} +14 -9
- package/dist/{server-RSWVCVY3.js → server-OWVEZTR3.js} +81 -84
- package/dist/setup-server-C7ZTPHD5.js +934 -0
- package/dist/{task-dependency-resolver-72DLY2HV.js → task-dependency-resolver-WKZWJLLM.js} +19 -15
- package/dist/{task-executor-VXB6DAV2.js → task-executor-PD3H4MLO.js} +4 -1
- package/dist/tool-adapter-Y3TCEQOC.js +145 -0
- package/dist/{tool-index-DKI2ZNOU.js → tool-index-MIVK3D7H.js} +14 -9
- package/dist/{transcript-7V4UNID4.js → transcript-UDJZP6NK.js} +2 -1
- package/dist/web/assets/complete-fZLnb5Ot.js +1 -0
- package/dist/web/assets/index-B_FcaX5D.css +1 -0
- package/dist/web/assets/index-CbeAP4_n.js +67 -0
- package/dist/web/assets/index.es-oXiZF7Hc.js +11 -0
- package/dist/web/assets/login-telegram-BP7CJDmx.js +1 -0
- package/dist/web/assets/run-DOrDowjK.js +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +7 -3
- package/dist/chunk-2QUJLHCZ.js +0 -362
- package/dist/web/assets/index-BNhrx9S1.js +0 -67
- package/dist/web/assets/index-CqrrRLOh.css +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var Gf=Object.defineProperty;var Xf=(i,a,u)=>a in i?Gf(i,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[a]=u;var Dt=(i,a,u)=>Xf(i,typeof a!="symbol"?a+"":a,u);function Zf(i,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 i)){const m=Object.getOwnPropertyDescriptor(d,p);m&&Object.defineProperty(i,p,m.get?m:{enumerable:!0,get:()=>d[p]})}}}return Object.freeze(Object.defineProperty(i,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 j of m.addedNodes)j.tagName==="LINK"&&j.rel==="modulepreload"&&d(j)}).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 ep(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var lo={exports:{}},Xr={},so={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 tp(){if(uc)return he;uc=1;var i=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"),j=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),k=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),S=Symbol.iterator;function I(C){return C===null||typeof C!="object"?null:(C=S&&C[S]||C["@@iterator"],typeof C=="function"?C:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,y={};function P(C,O,de){this.props=C,this.context=O,this.refs=y,this.updater=de||B}P.prototype.isReactComponent={},P.prototype.setState=function(C,O){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,O,"setState")},P.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function z(){}z.prototype=P.prototype;function $(C,O,de){this.props=C,this.context=O,this.refs=y,this.updater=de||B}var L=$.prototype=new z;L.constructor=$,D(L,P.prototype),L.isPureReactComponent=!0;var _=Array.isArray,U=Object.prototype.hasOwnProperty,Y={current:null},fe={key:!0,ref:!0,__self:!0,__source:!0};function ge(C,O,de){var pe,ve={},xe=null,Ne=null;if(O!=null)for(pe in O.ref!==void 0&&(Ne=O.ref),O.key!==void 0&&(xe=""+O.key),O)U.call(O,pe)&&!fe.hasOwnProperty(pe)&&(ve[pe]=O[pe]);var we=arguments.length-2;if(we===1)ve.children=de;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:i,type:C,key:xe,ref:Ne,props:ve,_owner:Y.current}}function X(C,O){return{$$typeof:i,type:C.type,key:O,ref:C.ref,props:C.props,_owner:C._owner}}function me(C){return typeof C=="object"&&C!==null&&C.$$typeof===i}function De(C){var O={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(de){return O[de]})}var Be=/\/+/g;function J(C,O){return typeof C=="object"&&C!==null&&C.key!=null?De(""+C.key):O.toString(36)}function oe(C,O,de,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 i:case a:Ne=!0}}if(Ne)return Ne=C,ve=ve(Ne),C=pe===""?"."+J(Ne,0):pe,_(ve)?(de="",C!=null&&(de=C.replace(Be,"$&/")+"/"),oe(ve,O,de,"",function(Ze){return Ze})):ve!=null&&(me(ve)&&(ve=X(ve,de+(!ve.key||Ne&&Ne.key===ve.key?"":(""+ve.key).replace(Be,"$&/")+"/")+C)),O.push(ve)),1;if(Ne=0,pe=pe===""?".":pe+":",_(C))for(var we=0;we<C.length;we++){xe=C[we];var Ee=pe+J(xe,we);Ne+=oe(xe,O,de,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+=oe(xe,O,de,Ee,ve);else if(xe==="object")throw O=String(C),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.");return Ne}function V(C,O,de){if(C==null)return C;var pe=[],ve=0;return oe(C,pe,"","",function(xe){return O.call(de,xe,ve++)}),pe}function ae(C){if(C._status===-1){var O=C._result;O=O(),O.then(function(de){(C._status===0||C._status===-1)&&(C._status=1,C._result=de)},function(de){(C._status===0||C._status===-1)&&(C._status=2,C._result=de)}),C._status===-1&&(C._status=0,C._result=O)}if(C._status===1)return C._result.default;throw C._result}var ue={current:null},b={transition:null},re={ReactCurrentDispatcher:ue,ReactCurrentBatchConfig:b,ReactCurrentOwner:Y};function G(){throw Error("act(...) is not supported in production builds of React.")}return he.Children={map:V,forEach:function(C,O,de){V(C,function(){O.apply(this,arguments)},de)},count:function(C){var O=0;return V(C,function(){O++}),O},toArray:function(C){return V(C,function(O){return O})||[]},only:function(C){if(!me(C))throw Error("React.Children.only expected to receive a single React element child.");return C}},he.Component=P,he.Fragment=u,he.Profiler=p,he.PureComponent=$,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,O,de){if(C==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+C+".");var pe=D({},C.props),ve=C.key,xe=C.ref,Ne=C._owner;if(O!=null){if(O.ref!==void 0&&(xe=O.ref,Ne=Y.current),O.key!==void 0&&(ve=""+O.key),C.type&&C.type.defaultProps)var we=C.type.defaultProps;for(Ee in O)U.call(O,Ee)&&!fe.hasOwnProperty(Ee)&&(pe[Ee]=O[Ee]===void 0&&we!==void 0?we[Ee]:O[Ee])}var Ee=arguments.length-2;if(Ee===1)pe.children=de;else if(1<Ee){we=Array(Ee);for(var Ze=0;Ze<Ee;Ze++)we[Ze]=arguments[Ze+2];pe.children=we}return{$$typeof:i,type:C.type,key:ve,ref:xe,props:pe,_owner:Ne}},he.createContext=function(C){return C={$$typeof:j,_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 O=ge.bind(null,C);return O.type=C,O},he.createRef=function(){return{current:null}},he.forwardRef=function(C){return{$$typeof:w,render:C}},he.isValidElement=me,he.lazy=function(C){return{$$typeof:T,_payload:{_status:-1,_result:C},_init:ae}},he.memo=function(C,O){return{$$typeof:k,type:C,compare:O===void 0?null:O}},he.startTransition=function(C){var O=b.transition;b.transition={};try{C()}finally{b.transition=O}},he.unstable_act=G,he.useCallback=function(C,O){return ue.current.useCallback(C,O)},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,O){return ue.current.useEffect(C,O)},he.useId=function(){return ue.current.useId()},he.useImperativeHandle=function(C,O,de){return ue.current.useImperativeHandle(C,O,de)},he.useInsertionEffect=function(C,O){return ue.current.useInsertionEffect(C,O)},he.useLayoutEffect=function(C,O){return ue.current.useLayoutEffect(C,O)},he.useMemo=function(C,O){return ue.current.useMemo(C,O)},he.useReducer=function(C,O,de){return ue.current.useReducer(C,O,de)},he.useRef=function(C){return ue.current.useRef(C)},he.useState=function(C){return ue.current.useState(C)},he.useSyncExternalStore=function(C,O,de){return ue.current.useSyncExternalStore(C,O,de)},he.useTransition=function(){return ue.current.useTransition()},he.version="18.3.1",he}var cc;function yo(){return cc||(cc=1,so.exports=tp()),so.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 np(){if(dc)return Xr;dc=1;var i=yo(),a=Symbol.for("react.element"),u=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,p=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function j(w,v,k){var T,S={},I=null,B=null;k!==void 0&&(I=""+k),v.key!==void 0&&(I=""+v.key),v.ref!==void 0&&(B=v.ref);for(T in v)d.call(v,T)&&!m.hasOwnProperty(T)&&(S[T]=v[T]);if(w&&w.defaultProps)for(T in v=w.defaultProps,v)S[T]===void 0&&(S[T]=v[T]);return{$$typeof:a,type:w,key:I,ref:B,props:S,_owner:p.current}}return Xr.Fragment=u,Xr.jsx=j,Xr.jsxs=j,Xr}var fc;function rp(){return fc||(fc=1,lo.exports=np()),lo.exports}var l=rp(),h=yo();const Dc=ep(h),lp=Zf({__proto__:null,default:Dc},[h]);var ps={},io={exports:{}},ut={},oo={exports:{}},ao={};/**
|
|
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 sp(){return pc||(pc=1,(function(i){function a(b,re){var G=b.length;b.push(re);e:for(;0<G;){var C=G-1>>>1,O=b[C];if(0<p(O,re))b[C]=re,b[G]=O,G=C;else break e}}function u(b){return b.length===0?null:b[0]}function d(b){if(b.length===0)return null;var re=b[0],G=b.pop();if(G!==re){b[0]=G;e:for(var C=0,O=b.length,de=O>>>1;C<de;){var pe=2*(C+1)-1,ve=b[pe],xe=pe+1,Ne=b[xe];if(0>p(ve,G))xe<O&&0>p(Ne,ve)?(b[C]=Ne,b[xe]=G,C=xe):(b[C]=ve,b[pe]=G,C=pe);else if(xe<O&&0>p(Ne,G))b[C]=Ne,b[xe]=G,C=xe;else break e}}return re}function p(b,re){var G=b.sortIndex-re.sortIndex;return G!==0?G:b.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var j=Date,w=j.now();i.unstable_now=function(){return j.now()-w}}var v=[],k=[],T=1,S=null,I=3,B=!1,D=!1,y=!1,P=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,$=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(b){for(var re=u(k);re!==null;){if(re.callback===null)d(k);else if(re.startTime<=b)d(k),re.sortIndex=re.expirationTime,a(v,re);else break;re=u(k)}}function _(b){if(y=!1,L(b),!D)if(u(v)!==null)D=!0,ae(U);else{var re=u(k);re!==null&&ue(_,re.startTime-b)}}function U(b,re){D=!1,y&&(y=!1,z(ge),ge=-1),B=!0;var G=I;try{for(L(re),S=u(v);S!==null&&(!(S.expirationTime>re)||b&&!De());){var C=S.callback;if(typeof C=="function"){S.callback=null,I=S.priorityLevel;var O=C(S.expirationTime<=re);re=i.unstable_now(),typeof O=="function"?S.callback=O:S===u(v)&&d(v),L(re)}else d(v);S=u(v)}if(S!==null)var de=!0;else{var pe=u(k);pe!==null&&ue(_,pe.startTime-re),de=!1}return de}finally{S=null,I=G,B=!1}}var Y=!1,fe=null,ge=-1,X=5,me=-1;function De(){return!(i.unstable_now()-me<X)}function Be(){if(fe!==null){var b=i.unstable_now();me=b;var re=!0;try{re=fe(!0,b)}finally{re?J():(Y=!1,fe=null)}}else Y=!1}var J;if(typeof $=="function")J=function(){$(Be)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,V=oe.port2;oe.port1.onmessage=Be,J=function(){V.postMessage(null)}}else J=function(){P(Be,0)};function ae(b){fe=b,Y||(Y=!0,J())}function ue(b,re){ge=P(function(){b(i.unstable_now())},re)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(b){b.callback=null},i.unstable_continueExecution=function(){D||B||(D=!0,ae(U))},i.unstable_forceFrameRate=function(b){0>b||125<b?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<b?Math.floor(1e3/b):5},i.unstable_getCurrentPriorityLevel=function(){return I},i.unstable_getFirstCallbackNode=function(){return u(v)},i.unstable_next=function(b){switch(I){case 1:case 2:case 3:var re=3;break;default:re=I}var G=I;I=re;try{return b()}finally{I=G}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(b,re){switch(b){case 1:case 2:case 3:case 4:case 5:break;default:b=3}var G=I;I=b;try{return re()}finally{I=G}},i.unstable_scheduleCallback=function(b,re,G){var C=i.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?C+G:C):G=C,b){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=G+O,b={id:T++,callback:re,priorityLevel:b,startTime:G,expirationTime:O,sortIndex:-1},G>C?(b.sortIndex=G,a(k,b),u(v)===null&&b===u(k)&&(y?(z(ge),ge=-1):y=!0,ue(_,G-C))):(b.sortIndex=O,a(v,b),D||B||(D=!0,ae(U))),b},i.unstable_shouldYield=De,i.unstable_wrapCallback=function(b){var re=I;return function(){var G=I;I=re;try{return b.apply(this,arguments)}finally{I=G}}}})(ao)),ao}var hc;function ip(){return hc||(hc=1,oo.exports=sp()),oo.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 op(){if(mc)return ut;mc=1;var i=yo(),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){j(e,t),j(e+"Capture",t)}function j(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]*$/,T={},S={};function I(e){return v.call(S,e)?!0:v.call(T,e)?!1:k.test(e)?S[e]=!0:(T[e]=!0,!1)}function B(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 D(e,t,n,r){if(t===null||typeof t>"u"||B(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,o,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=o,this.removeEmptyString=c}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){P[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];P[t]=new y(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){P[e]=new y(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){P[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){P[e]=new y(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){P[e]=new y(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){P[e]=new y(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){P[e]=new y(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){P[e]=new y(e,5,!1,e.toLowerCase(),null,!1,!1)});var z=/[\-:]([a-z])/g;function $(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,$);P[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,$);P[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,$);P[t]=new y(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){P[e]=new y(e,1,!1,e.toLowerCase(),null,!1,!1)}),P.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){P[e]=new y(e,1,!1,e.toLowerCase(),null,!0,!0)});function L(e,t,n,r){var s=P.hasOwnProperty(t)?P[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(D(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 _=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,U=Symbol.for("react.element"),Y=Symbol.for("react.portal"),fe=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"),Be=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),oe=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),ue=Symbol.for("react.offscreen"),b=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=b&&e[b]||e["@@iterator"],typeof e=="function"?e:null)}var G=Object.assign,C;function O(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 de=!1;function pe(e,t){if(!e||de)return"";de=!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
|
+
`),o=r.stack.split(`
|
|
36
|
+
`),c=s.length-1,f=o.length-1;1<=c&&0<=f&&s[c]!==o[f];)f--;for(;1<=c&&0<=f;c--,f--)if(s[c]!==o[f]){if(c!==1||f!==1)do if(c--,f--,0>f||s[c]!==o[f]){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<=f);break}}}finally{de=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?O(e):""}function ve(e){switch(e.tag){case 5:return O(e.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("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 fe:return"Fragment";case Y:return"Portal";case X:return"Profiler";case ge:return"StrictMode";case J:return"Suspense";case oe: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 Be: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,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(c){r=""+c,o.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")?Q(e,t.type,n):t.hasOwnProperty("defaultValue")&&Q(e,t.type,we(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function H(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 Q(e,t,n){(t!=="number"||zn(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var K=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(K(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 No(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 td=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(td[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,Un=null;function Eo(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 _o(e){Fn?Un?Un.push(e):Un=[e]:Fn=e}function Po(){if(Fn){var e=Fn,t=Un;if(Un=Fn=null,Eo(e),t)for(e=0;e<t.length;e++)Eo(t[e])}}function To(e,t){return e(t)}function Lo(){}var js=!1;function Ro(e,t,n){if(js)return e(t,n);js=!0;try{return To(e,t,n)}finally{js=!1,(Fn!==null||Un!==null)&&(Lo(),Po())}}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 nd(e,t,n,r,s,o,c,f,g){var R=Array.prototype.slice.call(arguments,3);try{t.apply(n,R)}catch(A){this.onError(A)}}var vr=!1,il=null,ol=!1,ks=null,rd={onError:function(e){vr=!0,il=e}};function ld(e,t,n,r,s,o,c,f,g){vr=!1,il=null,nd.apply(rd,arguments)}function sd(e,t,n,r,s,o,c,f,g){if(ld.apply(this,arguments),vr){if(vr){var R=il;vr=!1,il=null}else throw Error(u(198));ol||(ol=!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 zo(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 Io(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 o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return Io(s),e;if(o===r)return Io(s),t;o=o.sibling}throw Error(u(188))}if(n.return!==r.return)n=s,r=o;else{for(var c=!1,f=s.child;f;){if(f===n){c=!0,n=s,r=o;break}if(f===r){c=!0,r=s,n=o;break}f=f.sibling}if(!c){for(f=o.child;f;){if(f===n){c=!0,n=o,r=s;break}if(f===r){c=!0,r=o,n=s;break}f=f.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 Oo(e){return e=id(e),e!==null?Do(e):null}function Do(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Do(e);if(t!==null)return t;e=e.sibling}return null}var Mo=a.unstable_scheduleCallback,Ao=a.unstable_cancelCallback,od=a.unstable_shouldYield,ad=a.unstable_requestPaint,Me=a.unstable_now,ud=a.unstable_getCurrentPriorityLevel,Cs=a.unstable_ImmediatePriority,Fo=a.unstable_UserBlockingPriority,al=a.unstable_NormalPriority,cd=a.unstable_LowPriority,Uo=a.unstable_IdlePriority,ul=null,Lt=null;function dd(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:hd,fd=Math.log,pd=Math.LN2;function hd(e){return e>>>=0,e===0?32:31-(fd(e)/pd|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,o=e.pingedLanes,c=n&268435455;if(c!==0){var f=c&~s;f!==0?r=xr(f):(o&=c,o!==0&&(r=xr(o)))}else c=n&~s,c!==0?r=xr(c):o!==0&&(r=xr(o));if(r===0)return 0;if(t!==0&&t!==r&&(t&s)===0&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&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 md(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 gd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var c=31-wt(o),f=1<<c,g=s[c];g===-1?((f&n)===0||(f&r)!==0)&&(s[c]=md(f,t)):g<=t&&(e.expiredLanes|=f),o&=~f}}function Ns(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Bo(){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 yd(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),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}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 Wo(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var $o,Ps,Vo,bo,Ko,Ts=!1,pl=[],Qt=null,Yt=null,Jt=null,jr=new Map,wr=new Map,qt=[],vd="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 Ho(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,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,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 xd(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 o=s.pointerId;return jr.set(o,kr(jr.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,wr.set(o,kr(wr.get(o)||null,e,t,n,r,s)),!0}return!1}function Qo(e){var t=yn(e.target);if(t!==null){var n=gn(t);if(n!==null){if(t=n.tag,t===13){if(t=zo(n),t!==null){e.blockedOn=t,Ko(e.priority,function(){Vo(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 Yo(e,t,n){hl(e)&&n.delete(t)}function Sd(){Ts=!1,Qt!==null&&hl(Qt)&&(Qt=null),Yt!==null&&hl(Yt)&&(Yt=null),Jt!==null&&hl(Jt)&&(Jt=null),jr.forEach(Yo),wr.forEach(Yo)}function Cr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ts||(Ts=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Sd)))}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);)Qo(n),n.blockedOn===null&&qt.shift()}var Bn=_.ReactCurrentBatchConfig,ml=!0;function jd(e,t,n,r){var s=Ce,o=Bn.transition;Bn.transition=null;try{Ce=1,Ls(e,t,n,r)}finally{Ce=s,Bn.transition=o}}function wd(e,t,n,r){var s=Ce,o=Bn.transition;Bn.transition=null;try{Ce=4,Ls(e,t,n,r)}finally{Ce=s,Bn.transition=o}}function Ls(e,t,n,r){if(ml){var s=Rs(e,t,n,r);if(s===null)Ys(e,t,r,gl,n),Ho(e,r);else if(xd(s,e,t,n,r))r.stopPropagation();else if(Ho(e,r),t&4&&-1<vd.indexOf(e)){for(;s!==null;){var o=Ar(s);if(o!==null&&$o(o),o=Rs(e,t,n,r),o===null&&Ys(e,t,r,gl,n),o===s)break;s=o}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=zo(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 Jo(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(ud()){case Cs:return 1;case Fo:return 4;case al:case cd:return 16;case Uo:return 536870912;default:return 16}default:return 16}}var Gt=null,zs=null,yl=null;function qo(){if(yl)return yl;var e,t=zs,n=t.length,r,s="value"in Gt?Gt.value:Gt.textContent,o=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[o-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 Go(){return!1}function ct(e){function t(n,r,s,o,c){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=c,this.currentTarget=null;for(var f in e)e.hasOwnProperty(f)&&(n=e[f],this[f]=n?n(o):o[f]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?xl:Go,this.isPropagationStopped=Go,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}),kd=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}}),Xo=ct(Sl),Cd=G({},Sl,{dataTransfer:0}),Nd=ct(Cd),Ed=G({},Er,{relatedTarget:0}),Ms=ct(Ed),_d=G({},Wn,{animationName:0,elapsedTime:0,pseudoElement:0}),Pd=ct(_d),Td=G({},Wn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ld=ct(Td),Rd=G({},Wn,{data:0}),Zo=ct(Rd),zd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Id={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"},Od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Dd(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Od[e])?!!t[e]:!1}function As(){return Dd}var Md=G({},Er,{key:function(e){if(e.key){var t=zd[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"?Id[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}}),Ad=ct(Md),Fd=G({},Sl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ea=ct(Fd),Ud=G({},Er,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:As}),Bd=ct(Ud),Wd=G({},Wn,{propertyName:0,elapsedTime:0,pseudoElement:0}),$d=ct(Wd),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}),bd=ct(Vd),Kd=[9,13,27,32],Fs=w&&"CompositionEvent"in window,Pr=null;w&&"documentMode"in document&&(Pr=document.documentMode);var Hd=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 Kd.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 Qd(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 Yd(e,t){if($n)return e==="compositionend"||!Fs&&la(e,t)?(e=qo(),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 Jd={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 ia(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jd[e.type]:t==="textarea"}function oa(e,t,n,r){_o(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 qd(e){Na(e,0)}function jl(e){var t=Qn(e);if(nl(t))return e}function Gd(e,t){if(e==="change")return t}var aa=!1;if(w){var Us;if(w){var Bs="oninput"in document;if(!Bs){var ua=document.createElement("div");ua.setAttribute("oninput","return;"),Bs=typeof ua.oninput=="function"}Us=Bs}else Us=!1;aa=Us&&(!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=[];oa(t,Lr,e,xs(e)),Ro(qd,t)}}function Xd(e,t,n){e==="focusin"?(ca(),Tr=t,Lr=n,Tr.attachEvent("onpropertychange",da)):e==="focusout"&&ca()}function Zd(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return jl(Lr)}function ef(e,t){if(e==="click")return jl(t)}function tf(e,t){if(e==="input"||e==="change")return jl(t)}function nf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:nf;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 rf(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,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=pa(n,o);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(),o>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 lf=w&&"documentMode"in document&&11>=document.documentMode,Vn=null,$s=null,zr=null,Vs=!1;function ga(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vs||Vn==null||Vn!==zn(r)||(r=Vn,"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=Vn)))}function wl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var bn={animationend:wl("Animation","AnimationEnd"),animationiteration:wl("Animation","AnimationIteration"),animationstart:wl("Animation","AnimationStart"),transitionend:wl("Transition","TransitionEnd")},bs={},ya={};w&&(ya=document.createElement("div").style,"AnimationEvent"in window||(delete bn.animationend.animation,delete bn.animationiteration.animation,delete bn.animationstart.animation),"TransitionEvent"in window||delete bn.transitionend.transition);function kl(e){if(bs[e])return bs[e];if(!bn[e])return e;var t=bn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ya)return bs[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],sf=Hs.toLowerCase(),of=Hs[0].toUpperCase()+Hs.slice(1);Xt(sf,"on"+of)}Xt(va,"onAnimationEnd"),Xt(xa,"onAnimationIteration"),Xt(Sa,"onAnimationStart"),Xt("dblclick","onDoubleClick"),Xt("focusin","onFocus"),Xt("focusout","onBlur"),Xt(ja,"onTransitionEnd"),j("onMouseEnter",["mouseout","mouseover"]),j("onMouseLeave",["mouseout","mouseover"]),j("onPointerEnter",["pointerout","pointerover"]),j("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(" "),af=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,sd(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 o=void 0;if(t)for(var c=r.length-1;0<=c;c--){var f=r[c],g=f.instance,R=f.currentTarget;if(f=f.listener,g!==o&&s.isPropagationStopped())break e;Ca(s,f,R),o=g}else for(c=0;c<r.length;c++){if(f=r[c],g=f.instance,R=f.currentTarget,f=f.listener,g!==o&&s.isPropagationStopped())break e;Ca(s,f,R),o=g}}}if(ol)throw e=ks,ol=!1,ks=null,e}function Pe(e,t){var n=t[ei];n===void 0&&(n=t[ei]=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"&&(af.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(Jo(t)){case 1:var s=jd;break;case 4:s=wd;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 o=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 f=r.stateNode.containerInfo;if(f===s||f.nodeType===8&&f.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(;f!==null;){if(c=yn(f),c===null)return;if(g=c.tag,g===5||g===6){r=o=c;continue e}f=f.parentNode}}r=r.return}Ro(function(){var R=o,A=xs(n),F=[];e:{var M=wa.get(e);if(M!==void 0){var q=Is,ee=e;switch(e){case"keypress":if(vl(n)===0)break e;case"keydown":case"keyup":q=Ad;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=Xo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=Nd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=Bd;break;case va:case xa:case Sa:q=Pd;break;case ja:q=$d;break;case"scroll":q=kd;break;case"wheel":q=bd;break;case"copy":case"cut":case"paste":q=Ld;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",N=te?M!==null?M+"Capture":null:M;te=[];for(var x=R,E;x!==null;){E=x;var W=E.stateNode;if(E.tag===5&&W!==null&&(E=W,N!==null&&(W=gr(x,N),W!=null&&te.push(Dr(x,W,E)))),Ae)break;x=x.return}0<te.length&&(M=new q(M,ee,null,n,A),F.push({event:M,listeners:te}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",M&&n!==vs&&(ee=n.relatedTarget||n.fromElement)&&(yn(ee)||ee[At]))break e;if((q||M)&&(M=A.window===A?A:(M=A.ownerDocument)?M.defaultView||M.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=Xo,W="onMouseLeave",N="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(te=ea,W="onPointerLeave",N="onPointerEnter",x="pointer"),Ae=q==null?M:Qn(q),E=ee==null?M:Qn(ee),M=new te(W,x+"leave",q,n,A),M.target=Ae,M.relatedTarget=E,W=null,yn(A)===R&&(te=new te(N,x+"enter",ee,n,A),te.target=E,te.relatedTarget=Ae,W=te),Ae=W,q&&ee)t:{for(te=q,N=ee,x=0,E=te;E;E=Kn(E))x++;for(E=0,W=N;W;W=Kn(W))E++;for(;0<x-E;)te=Kn(te),x--;for(;0<E-x;)N=Kn(N),E--;for(;x--;){if(te===N||N!==null&&te===N.alternate)break t;te=Kn(te),N=Kn(N)}te=null}else te=null;q!==null&&_a(F,M,q,te,!1),ee!==null&&Ae!==null&&_a(F,Ae,ee,te,!0)}}e:{if(M=R?Qn(R):window,q=M.nodeName&&M.nodeName.toLowerCase(),q==="select"||q==="input"&&M.type==="file")var ne=Gd;else if(ia(M))if(aa)ne=tf;else{ne=Zd;var le=Xd}else(q=M.nodeName)&&q.toLowerCase()==="input"&&(M.type==="checkbox"||M.type==="radio")&&(ne=ef);if(ne&&(ne=ne(e,R))){oa(F,ne,n,A);break e}le&&le(e,M,R),e==="focusout"&&(le=M._wrapperState)&&le.controlled&&M.type==="number"&&Q(M,"number",M.value)}switch(le=R?Qn(R):window,e){case"focusin":(ia(le)||le.contentEditable==="true")&&(Vn=le,$s=R,zr=null);break;case"focusout":zr=$s=Vn=null;break;case"mousedown":Vs=!0;break;case"contextmenu":case"mouseup":case"dragend":Vs=!1,ga(F,n,A);break;case"selectionchange":if(lf)break;case"keydown":case"keyup":ga(F,n,A)}var se;if(Fs)e:{switch(e){case"compositionstart":var ce="onCompositionStart";break e;case"compositionend":ce="onCompositionEnd";break e;case"compositionupdate":ce="onCompositionUpdate";break e}ce=void 0}else $n?la(e,n)&&(ce="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(ce="onCompositionStart");ce&&(ta&&n.locale!=="ko"&&($n||ce!=="onCompositionStart"?ce==="onCompositionEnd"&&$n&&(se=qo()):(Gt=A,zs="value"in Gt?Gt.value:Gt.textContent,$n=!0)),le=Nl(R,ce),0<le.length&&(ce=new Zo(ce,e,null,n,A),F.push({event:ce,listeners:le}),se?ce.data=se:(se=sa(n),se!==null&&(ce.data=se)))),(se=Hd?Qd(e,n):Yd(e,n))&&(R=Nl(R,"onBeforeInput"),0<R.length&&(A=new Zo("onBeforeInput","beforeinput",null,n,A),F.push({event:A,listeners:R}),A.data=se))}Na(F,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,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=gr(e,n),o!=null&&r.unshift(Dr(e,o,s)),o=gr(e,t),o!=null&&r.push(Dr(e,o,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 o=t._reactName,c=[];n!==null&&n!==r;){var f=n,g=f.alternate,R=f.stateNode;if(g!==null&&g===r)break;f.tag===5&&R!==null&&(f=R,s?(g=gr(n,o),g!=null&&c.unshift(Dr(n,g,f))):s||(g=gr(n,o),g!=null&&c.push(Dr(n,g,f)))),n=n.return}c.length!==0&&e.push({event:t,listeners:c})}var uf=/\r\n?/g,cf=/\u0000|\uFFFD/g;function Pa(e){return(typeof e=="string"?e:""+e).replace(uf,`
|
|
38
|
+
`).replace(cf,"")}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,df=typeof clearTimeout=="function"?clearTimeout:void 0,Ta=typeof Promise=="function"?Promise:void 0,ff=typeof queueMicrotask=="function"?queueMicrotask:typeof Ta<"u"?function(e){return Ta.resolve(null).then(e).catch(pf)}:Xs;function pf(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,ei="__reactEvents$"+Hn,hf="__reactListeners$"+Hn,mf="__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 ti=[],Yn=-1;function en(e){return{current:e}}function Te(e){0>Yn||(e.current=ti[Yn],ti[Yn]=null,Yn--)}function _e(e,t){Yn++,ti[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={},o;for(o in n)s[o]=t[o];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,ni=!1;function Oa(e){Ft===null?Ft=[e]:Ft.push(e)}function gf(e){Rl=!0,Oa(e)}function nn(){if(!ni&&Ft!==null){ni=!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)),Mo(Cs,nn),s}finally{Ce=t,ni=!1}}return null}var qn=[],Gn=0,zl=null,Il=0,gt=[],yt=0,xn=null,Ut=1,Bt="";function Sn(e,t){qn[Gn++]=Il,qn[Gn++]=zl,zl=e,Il=t}function Da(e,t,n){gt[yt++]=Ut,gt[yt++]=Bt,gt[yt++]=xn,xn=e;var r=Ut;e=Bt;var s=32-wt(r)-1;r&=~(1<<s),n+=1;var o=32-wt(t)+s;if(30<o){var c=s-s%5;o=(r&(1<<c)-1).toString(32),r>>=c,s-=c,Ut=1<<32-wt(t)+s|n<<s|r,Bt=o+e}else Ut=1<<o|n<<s|r,Bt=e}function ri(e){e.return!==null&&(Sn(e,1),Da(e,1,0))}function li(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,Bt=gt[--yt],gt[yt]=null,Ut=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:Ut,overflow:Bt}: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 si(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ii(e){if(Re){var t=ft;if(t){var n=t;if(!Aa(e,t)){if(si(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(si(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(si(e))throw Ua(),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 Ua(){for(var e=ft;e;)e=Zt(e.nextSibling)}function Xn(){ft=dt=null,Re=!1}function oi(e){Ct===null?Ct=[e]:Ct.push(e)}var yf=_.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,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(c){var f=s.refs;c===null?delete f[o]:f[o]=c},t._stringRef=o,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 Ba(e){var t=e._init;return t(e._payload)}function Wa(e){function t(N,x){if(e){var E=N.deletions;E===null?(N.deletions=[x],N.flags|=16):E.push(x)}}function n(N,x){if(!e)return null;for(;x!==null;)t(N,x),x=x.sibling;return null}function r(N,x){for(N=new Map;x!==null;)x.key!==null?N.set(x.key,x):N.set(x.index,x),x=x.sibling;return N}function s(N,x){return N=dn(N,x),N.index=0,N.sibling=null,N}function o(N,x,E){return N.index=E,e?(E=N.alternate,E!==null?(E=E.index,E<x?(N.flags|=2,x):E):(N.flags|=2,x)):(N.flags|=1048576,x)}function c(N){return e&&N.alternate===null&&(N.flags|=2),N}function f(N,x,E,W){return x===null||x.tag!==6?(x=Xi(E,N.mode,W),x.return=N,x):(x=s(x,E),x.return=N,x)}function g(N,x,E,W){var ne=E.type;return ne===fe?A(N,x,E.props.children,W,E.key):x!==null&&(x.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===ae&&Ba(ne)===x.type)?(W=s(x,E.props),W.ref=Fr(N,x,E),W.return=N,W):(W=ss(E.type,E.key,E.props,null,N.mode,W),W.ref=Fr(N,x,E),W.return=N,W)}function R(N,x,E,W){return x===null||x.tag!==4||x.stateNode.containerInfo!==E.containerInfo||x.stateNode.implementation!==E.implementation?(x=Zi(E,N.mode,W),x.return=N,x):(x=s(x,E.children||[]),x.return=N,x)}function A(N,x,E,W,ne){return x===null||x.tag!==7?(x=Pn(E,N.mode,W,ne),x.return=N,x):(x=s(x,E),x.return=N,x)}function F(N,x,E){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Xi(""+x,N.mode,E),x.return=N,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case U:return E=ss(x.type,x.key,x.props,null,N.mode,E),E.ref=Fr(N,null,x),E.return=N,E;case Y:return x=Zi(x,N.mode,E),x.return=N,x;case ae:var W=x._init;return F(N,W(x._payload),E)}if(K(x)||re(x))return x=Pn(x,N.mode,E,null),x.return=N,x;Dl(N,x)}return null}function M(N,x,E,W){var ne=x!==null?x.key:null;if(typeof E=="string"&&E!==""||typeof E=="number")return ne!==null?null:f(N,x,""+E,W);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case U:return E.key===ne?g(N,x,E,W):null;case Y:return E.key===ne?R(N,x,E,W):null;case ae:return ne=E._init,M(N,x,ne(E._payload),W)}if(K(E)||re(E))return ne!==null?null:A(N,x,E,W,null);Dl(N,E)}return null}function q(N,x,E,W,ne){if(typeof W=="string"&&W!==""||typeof W=="number")return N=N.get(E)||null,f(x,N,""+W,ne);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case U:return N=N.get(W.key===null?E:W.key)||null,g(x,N,W,ne);case Y:return N=N.get(W.key===null?E:W.key)||null,R(x,N,W,ne);case ae:var le=W._init;return q(N,x,E,le(W._payload),ne)}if(K(W)||re(W))return N=N.get(E)||null,A(x,N,W,ne,null);Dl(x,W)}return null}function ee(N,x,E,W){for(var ne=null,le=null,se=x,ce=x=0,Ke=null;se!==null&&ce<E.length;ce++){se.index>ce?(Ke=se,se=null):Ke=se.sibling;var je=M(N,se,E[ce],W);if(je===null){se===null&&(se=Ke);break}e&&se&&je.alternate===null&&t(N,se),x=o(je,x,ce),le===null?ne=je:le.sibling=je,le=je,se=Ke}if(ce===E.length)return n(N,se),Re&&Sn(N,ce),ne;if(se===null){for(;ce<E.length;ce++)se=F(N,E[ce],W),se!==null&&(x=o(se,x,ce),le===null?ne=se:le.sibling=se,le=se);return Re&&Sn(N,ce),ne}for(se=r(N,se);ce<E.length;ce++)Ke=q(se,N,ce,E[ce],W),Ke!==null&&(e&&Ke.alternate!==null&&se.delete(Ke.key===null?ce:Ke.key),x=o(Ke,x,ce),le===null?ne=Ke:le.sibling=Ke,le=Ke);return e&&se.forEach(function(fn){return t(N,fn)}),Re&&Sn(N,ce),ne}function te(N,x,E,W){var ne=re(E);if(typeof ne!="function")throw Error(u(150));if(E=ne.call(E),E==null)throw Error(u(151));for(var le=ne=null,se=x,ce=x=0,Ke=null,je=E.next();se!==null&&!je.done;ce++,je=E.next()){se.index>ce?(Ke=se,se=null):Ke=se.sibling;var fn=M(N,se,je.value,W);if(fn===null){se===null&&(se=Ke);break}e&&se&&fn.alternate===null&&t(N,se),x=o(fn,x,ce),le===null?ne=fn:le.sibling=fn,le=fn,se=Ke}if(je.done)return n(N,se),Re&&Sn(N,ce),ne;if(se===null){for(;!je.done;ce++,je=E.next())je=F(N,je.value,W),je!==null&&(x=o(je,x,ce),le===null?ne=je:le.sibling=je,le=je);return Re&&Sn(N,ce),ne}for(se=r(N,se);!je.done;ce++,je=E.next())je=q(se,N,ce,je.value,W),je!==null&&(e&&je.alternate!==null&&se.delete(je.key===null?ce:je.key),x=o(je,x,ce),le===null?ne=je:le.sibling=je,le=je);return e&&se.forEach(function(qf){return t(N,qf)}),Re&&Sn(N,ce),ne}function Ae(N,x,E,W){if(typeof E=="object"&&E!==null&&E.type===fe&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case U:e:{for(var ne=E.key,le=x;le!==null;){if(le.key===ne){if(ne=E.type,ne===fe){if(le.tag===7){n(N,le.sibling),x=s(le,E.props.children),x.return=N,N=x;break e}}else if(le.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===ae&&Ba(ne)===le.type){n(N,le.sibling),x=s(le,E.props),x.ref=Fr(N,le,E),x.return=N,N=x;break e}n(N,le);break}else t(N,le);le=le.sibling}E.type===fe?(x=Pn(E.props.children,N.mode,W,E.key),x.return=N,N=x):(W=ss(E.type,E.key,E.props,null,N.mode,W),W.ref=Fr(N,x,E),W.return=N,N=W)}return c(N);case Y:e:{for(le=E.key;x!==null;){if(x.key===le)if(x.tag===4&&x.stateNode.containerInfo===E.containerInfo&&x.stateNode.implementation===E.implementation){n(N,x.sibling),x=s(x,E.children||[]),x.return=N,N=x;break e}else{n(N,x);break}else t(N,x);x=x.sibling}x=Zi(E,N.mode,W),x.return=N,N=x}return c(N);case ae:return le=E._init,Ae(N,x,le(E._payload),W)}if(K(E))return ee(N,x,E,W);if(re(E))return te(N,x,E,W);Dl(N,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,x!==null&&x.tag===6?(n(N,x.sibling),x=s(x,E),x.return=N,N=x):(n(N,x),x=Xi(E,N.mode,W),x.return=N,N=x),c(N)):n(N,x)}return Ae}var Zn=Wa(!0),$a=Wa(!1),Ml=en(null),Al=null,er=null,ai=null;function ui(){ai=er=Al=null}function ci(e){var t=Ml.current;Te(Ml),e._currentValue=t}function di(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,ai=er=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(it=!0),e.firstContext=null)}function vt(e){var t=e._currentValue;if(ai!==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 fi(e){jn===null?jn=[e]:jn.push(e)}function Va(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,fi(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 pi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ba(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,fi(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,o=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};o===null?s=o=c:o=o.next=c,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,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 Ul(e,t,n,r){var s=e.updateQueue;rn=!1;var o=s.firstBaseUpdate,c=s.lastBaseUpdate,f=s.shared.pending;if(f!==null){s.shared.pending=null;var g=f,R=g.next;g.next=null,c===null?o=R:c.next=R,c=g;var A=e.alternate;A!==null&&(A=A.updateQueue,f=A.lastBaseUpdate,f!==c&&(f===null?A.firstBaseUpdate=R:f.next=R,A.lastBaseUpdate=g))}if(o!==null){var F=s.baseState;c=0,A=R=g=null,f=o;do{var M=f.lane,q=f.eventTime;if((r&M)===M){A!==null&&(A=A.next={eventTime:q,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,next:null});e:{var ee=e,te=f;switch(M=t,q=n,te.tag){case 1:if(ee=te.payload,typeof ee=="function"){F=ee.call(q,F,M);break e}F=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=te.payload,M=typeof ee=="function"?ee.call(q,F,M):ee,M==null)break e;F=G({},F,M);break e;case 2:rn=!0}}f.callback!==null&&f.lane!==0&&(e.flags|=64,M=s.effects,M===null?s.effects=[f]:M.push(f))}else q={eventTime:q,lane:M,tag:f.tag,payload:f.payload,callback:f.callback,next:null},A===null?(R=A=q,g=F):A=A.next=q,c|=M;if(f=f.next,f===null){if(f=s.shared.pending,f===null)break;M=f,f=M.next,M.next=null,s.lastBaseUpdate=M,s.shared.pending=null}}while(!0);if(A===null&&(g=F),s.baseState=g,s.firstBaseUpdate=R,s.lastBaseUpdate=A,t=s.shared.interleaved,t!==null){s=t;do c|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Cn|=c,e.lanes=c,e.memoizedState=F}}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 Ur={},zt=en(Ur),Br=en(Ur),Wr=en(Ur);function wn(e){if(e===Ur)throw Error(u(174));return e}function hi(e,t){switch(_e(Wr,t),_e(Br,e),_e(zt,Ur),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(Br),Te(Wr)}function Qa(e){wn(Wr.current);var t=wn(zt.current),n=Dn(t,e.type);t!==n&&(_e(Br,e),_e(zt,n))}function mi(e){Br.current===e&&(Te(zt),Te(Br))}var ze=en(0);function Bl(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 gi=[];function yi(){for(var e=0;e<gi.length;e++)gi[e]._workInProgressVersionPrimary=null;gi.length=0}var Wl=_.ReactCurrentDispatcher,vi=_.ReactCurrentBatchConfig,kn=0,Ie=null,We=null,Ve=null,$l=!1,$r=!1,Vr=0,vf=0;function Je(){throw Error(u(321))}function xi(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 Si(e,t,n,r,s,o){if(kn=o,Ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Wl.current=e===null||e.memoizedState===null?wf:kf,e=n(r,s),$r){o=0;do{if($r=!1,Vr=0,25<=o)throw Error(u(301));o+=1,Ve=We=null,t.updateQueue=null,Wl.current=Cf,e=n(r,s)}while($r)}if(Wl.current=Kl,t=We!==null&&We.next!==null,kn=0,Ve=We=Ie=null,$l=!1,t)throw Error(u(300));return e}function ji(){var e=Vr!==0;return Vr=0,e}function It(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ve===null?Ie.memoizedState=Ve=e:Ve=Ve.next=e,Ve}function xt(){if(We===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=We.next;var t=Ve===null?Ie.memoizedState:Ve.next;if(t!==null)Ve=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},Ve===null?Ie.memoizedState=Ve=e:Ve=Ve.next=e}return Ve}function br(e,t){return typeof t=="function"?t(e):t}function wi(e){var t=xt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var r=We,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var c=s.next;s.next=o.next,o.next=c}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var f=c=null,g=null,R=o;do{var A=R.lane;if((kn&A)===A)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 F={lane:A,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null};g===null?(f=g=F,c=r):g=g.next=F,Ie.lanes|=A,Cn|=A}R=R.next}while(R!==null&&R!==o);g===null?c=r:g.next=f,kt(r,t.memoizedState)||(it=!0),t.memoizedState=r,t.baseState=c,t.baseQueue=g,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,Ie.lanes|=o,Cn|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ki(e){var t=xt(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var c=s=s.next;do o=e(o,c.action),c=c.next;while(c!==s);kt(o,t.memoizedState)||(it=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ya(){}function Ja(e,t){var n=Ie,r=xt(),s=t(),o=!kt(r.memoizedState,s);if(o&&(r.memoizedState=s,it=!0),r=r.queue,Ci(Xa.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Ve!==null&&Ve.memoizedState.tag&1){if(n.flags|=2048,Kr(9,Ga.bind(null,n,r,s,t),void 0,null),be===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:br,lastRenderedState:e},t.queue=e,e=e.dispatch=jf.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 Vl(e,t,n,r){var s=It();Ie.flags|=e,s.memoizedState=Kr(1|t,n,void 0,r===void 0?null:r)}function bl(e,t,n,r){var s=xt();r=r===void 0?null:r;var o=void 0;if(We!==null){var c=We.memoizedState;if(o=c.destroy,r!==null&&xi(r,c.deps)){s.memoizedState=Kr(t,n,o,r);return}}Ie.flags|=e,s.memoizedState=Kr(1|t,n,o,r)}function ru(e,t){return Vl(8390656,8,e,t)}function Ci(e,t){return bl(2048,8,e,t)}function lu(e,t){return bl(4,2,e,t)}function su(e,t){return bl(4,4,e,t)}function iu(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 ou(e,t,n){return n=n!=null?n.concat([e]):null,bl(4,4,iu.bind(null,t,e),n)}function Ni(){}function au(e,t){var n=xt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&xi(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&&xi(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,it=!0),e.memoizedState=n):(kt(n,t)||(n=Bo(),Ie.lanes|=n,Cn|=n,e.baseState=!0),t)}function xf(e,t){var n=Ce;Ce=n!==0&&4>n?n:4,e(!0);var r=vi.transition;vi.transition={};try{e(!1),t()}finally{Ce=n,vi.transition=r}}function du(){return xt().memoizedState}function Sf(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=Va(e,t,n,r),n!==null){var s=tt();Pt(n,e,r,s),hu(n,t,r)}}function jf(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 o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var c=t.lastRenderedState,f=o(c,n);if(s.hasEagerState=!0,s.eagerState=f,kt(f,c)){var g=t.interleaved;g===null?(s.next=s,fi(t)):(s.next=g.next,g.next=s),t.interleaved=s;return}}catch{}finally{}n=Va(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},wf={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,Vl(4194308,4,iu.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Vl(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=Sf.bind(null,Ie,e),[r.memoizedState,e]},useRef:function(e){var t=It();return e={current:e},t.memoizedState=e},useState:tu,useDebugValue:Ni,useDeferredValue:function(e){return It().memoizedState=e},useTransition:function(){var e=tu(!1),t=e[0];return e=xf.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(),be===null)throw Error(u(349));(kn&30)!==0||qa(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,ru(Xa.bind(null,r,o,e),[e]),r.flags|=2048,Kr(9,Ga.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=It(),t=be.identifierPrefix;if(Re){var n=Bt,r=Ut;n=(r&~(1<<32-wt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Vr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=vf++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},kf={readContext:vt,useCallback:au,useContext:vt,useEffect:Ci,useImperativeHandle:ou,useInsertionEffect:lu,useLayoutEffect:su,useMemo:uu,useReducer:wi,useRef:nu,useState:function(){return wi(br)},useDebugValue:Ni,useDeferredValue:function(e){var t=xt();return cu(t,We.memoizedState,e)},useTransition:function(){var e=wi(br)[0],t=xt().memoizedState;return[e,t]},useMutableSource:Ya,useSyncExternalStore:Ja,useId:du,unstable_isNewReconciler:!1},Cf={readContext:vt,useCallback:au,useContext:vt,useEffect:Ci,useImperativeHandle:ou,useInsertionEffect:lu,useLayoutEffect:su,useMemo:uu,useReducer:ki,useRef:nu,useState:function(){return ki(br)},useDebugValue:Ni,useDeferredValue:function(e){var t=xt();return We===null?t.memoizedState=e:cu(t,We.memoizedState,e)},useTransition:function(){var e=ki(br)[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 Ei(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),o=$t(r,s);o.payload=t,n!=null&&(o.callback=n),t=ln(e,o,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),o=$t(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=ln(e,o,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,o,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,c):t.prototype&&t.prototype.isPureReactComponent?!Rr(n,r)||!Rr(s,o):!0}function gu(e,t,n){var r=!1,s=tn,o=t.contextType;return typeof o=="object"&&o!==null?o=vt(o):(s=st(t)?vn:Ye.current,r=t.contextTypes,o=(r=r!=null)?Jn(e,s):tn),t=new t(n,o),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=o),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 _i(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},pi(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=vt(o):(o=st(t)?vn:Ye.current,s.context=Jn(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Ei(e,t,o,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),Ul(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(o){s=`
|
|
39
|
+
Error generating stack: `+o.message+`
|
|
40
|
+
`+o.stack}return{value:e,source:t,stack:s,digest:null}}function Pi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ti(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Nf=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,bi=r),Ti(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(){Ti(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Ti(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 Nf;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 Ef=_.ReactCurrentOwner,it=!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 o=t.ref;return tr(t,s),r=Si(e,t,n,r,o,s),n=ji(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Vt(e,t,s)):(Re&&n&&ri(t),t.flags|=1,et(e,t,r,s),t.child)}function Cu(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Gi(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Nu(e,t,o,r,s)):(e=ss(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,(e.lanes&s)===0){var c=o.memoizedProps;if(n=n.compare,n=n!==null?n:Rr,n(c,r)&&e.ref===t.ref)return Vt(e,t,s)}return t.flags|=1,e=dn(o,r),e.ref=t.ref,e.return=t,t.child=e}function Nu(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(Rr(o,r)&&e.ref===t.ref)if(it=!1,t.pendingProps=r=o,(e.lanes&s)!==0)(e.flags&131072)!==0&&(it=!0);else return t.lanes=e.lanes,Vt(e,t,s)}return Li(e,t,n,r,s)}function Eu(e,t,n){var r=t.pendingProps,s=r.children,o=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=o!==null?o.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=o!==null?o.baseLanes:n,_e(sr,pt),pt|=r}else o!==null?(r=o.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 Li(e,t,n,r,s){var o=st(n)?vn:Ye.current;return o=Jn(t,o),tr(t,s),n=Si(e,t,n,r,o,s),r=ji(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Vt(e,t,s)):(Re&&r&&ri(t),t.flags|=1,et(e,t,n,s),t.child)}function Pu(e,t,n,r,s){if(st(n)){var o=!0;Ll(t)}else o=!1;if(tr(t,s),t.stateNode===null)Yl(e,t),gu(t,n,r),_i(t,n,r,s),r=!0;else if(e===null){var c=t.stateNode,f=t.memoizedProps;c.props=f;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 A=n.getDerivedStateFromProps,F=typeof A=="function"||typeof c.getSnapshotBeforeUpdate=="function";F||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(f!==r||g!==R)&&yu(t,c,r,R),rn=!1;var M=t.memoizedState;c.state=M,Ul(t,r,c,s),g=t.memoizedState,f!==r||M!==g||lt.current||rn?(typeof A=="function"&&(Ei(t,n,A,r),g=t.memoizedState),(f=rn||mu(t,n,f,r,M,g,R))?(F||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=f):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{c=t.stateNode,ba(e,t),f=t.memoizedProps,R=t.type===t.elementType?f:Nt(t.type,f),c.props=R,F=t.pendingProps,M=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;(A=typeof q=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(f!==F||M!==g)&&yu(t,c,r,g),rn=!1,M=t.memoizedState,c.state=M,Ul(t,r,c,s);var ee=t.memoizedState;f!==F||M!==ee||lt.current||rn?(typeof q=="function"&&(Ei(t,n,q,r),ee=t.memoizedState),(R=rn||mu(t,n,R,r,M,ee,g)||!1)?(A||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"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&M===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"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),r=!1)}return Ri(e,t,n,r,o,s)}function Ri(e,t,n,r,s,o){_u(e,t);var c=(t.flags&128)!==0;if(!r&&!c)return s&&Ia(t,n,!1),Vt(e,t,o);r=t.stateNode,Ef.current=t;var f=c&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&c?(t.child=Zn(t,e.child,null,o),t.child=Zn(t,null,f,o)):et(e,t,f,o),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),hi(e,t.containerInfo)}function Lu(e,t,n,r,s){return Xn(),oi(s),t.flags|=256,et(e,t,n,r),t.child}var zi={dehydrated:null,treeContext:null,retryLane:0};function Ii(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ru(e,t,n){var r=t.pendingProps,s=ze.current,o=!1,c=(t.flags&128)!==0,f;if((f=c)||(f=e!==null&&e.memoizedState===null?!1:(s&2)!==0),f?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),_e(ze,s&1),e===null)return ii(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,o?(r=t.mode,o=t.child,c={mode:"hidden",children:c},(r&1)===0&&o!==null?(o.childLanes=0,o.pendingProps=c):o=is(c,r,0,null),e=Pn(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Ii(n),t.memoizedState=zi,e):Oi(t,c));if(s=e.memoizedState,s!==null&&(f=s.dehydrated,f!==null))return _f(e,t,c,r,f,s,n);if(o){o=r.fallback,c=t.mode,s=e.child,f=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),f!==null?o=dn(f,o):(o=Pn(o,c,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,c=e.child.memoizedState,c=c===null?Ii(n):{baseLanes:c.baseLanes|n,cachePool:null,transitions:c.transitions},o.memoizedState=c,o.childLanes=e.childLanes&~n,t.memoizedState=zi,r}return o=e.child,e=o.sibling,r=dn(o,{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 Oi(e,t){return t=is({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ql(e,t,n,r){return r!==null&&oi(r),Zn(t,e.child,null,n),e=Oi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _f(e,t,n,r,s,o,c){if(n)return t.flags&256?(t.flags&=-257,r=Pi(Error(u(422))),Ql(e,t,c,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=is({mode:"visible",children:r.children},s,0,null),o=Pn(o,s,c,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,(t.mode&1)!==0&&Zn(t,e.child,null,c),t.child.memoizedState=Ii(c),t.memoizedState=zi,o);if((t.mode&1)===0)return Ql(e,t,c,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var f=r.dgst;return r=f,o=Error(u(419)),r=Pi(o,r,void 0),Ql(e,t,c,r)}if(f=(c&e.childLanes)!==0,it||f){if(r=be,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!==o.retryLane&&(o.retryLane=s,Wt(e,s),Pt(r,e,s,-1))}return qi(),r=Pi(Error(u(421))),Ql(e,t,c,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Bf.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,ft=Zt(s.nextSibling),dt=t,Re=!0,Ct=null,e!==null&&(gt[yt++]=Ut,gt[yt++]=Bt,gt[yt++]=xn,Ut=e.id,Bt=e.overflow,xn=t),t=Oi(t,r.children),t.flags|=4096,t)}function zu(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),di(e.return,t,n)}function Di(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function Iu(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=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&&Bl(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Di(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Bl(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Di(t,!0,n,null,o);break;case"together":Di(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 Vt(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 Pf(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:hi(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=Vt(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 Vt(e,t,n)}var Ou,Mi,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}},Mi=function(){},Du=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,wn(zt.current);var o=null;switch(n){case"input":s=fr(e,s),r=fr(e,r),o=[];break;case"select":s=G({},s,{value:void 0}),r=G({},r,{value:void 0}),o=[];break;case"textarea":s=On(e,s),r=On(e,r),o=[];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 f=s[R];for(c in f)f.hasOwnProperty(c)&&(n||(n={}),n[c]="")}else R!=="dangerouslySetInnerHTML"&&R!=="children"&&R!=="suppressContentEditableWarning"&&R!=="suppressHydrationWarning"&&R!=="autoFocus"&&(p.hasOwnProperty(R)?o||(o=[]):(o=o||[]).push(R,null));for(R in r){var g=r[R];if(f=s!=null?s[R]:void 0,r.hasOwnProperty(R)&&g!==f&&(g!=null||f!=null))if(R==="style")if(f){for(c in f)!f.hasOwnProperty(c)||g&&g.hasOwnProperty(c)||(n||(n={}),n[c]="");for(c in g)g.hasOwnProperty(c)&&f[c]!==g[c]&&(n||(n={}),n[c]=g[c])}else n||(o||(o=[]),o.push(R,n)),n=g;else R==="dangerouslySetInnerHTML"?(g=g?g.__html:void 0,f=f?f.__html:void 0,g!=null&&f!==g&&(o=o||[]).push(R,g)):R==="children"?typeof g!="string"&&typeof g!="number"||(o=o||[]).push(R,""+g):R!=="suppressContentEditableWarning"&&R!=="suppressHydrationWarning"&&(p.hasOwnProperty(R)?(g!=null&&R==="onScroll"&&Pe("scroll",e),o||f===g||(o=[])):(o=o||[]).push(R,g))}n&&(o=o||[]).push("style",n);var R=o;(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 Tf(e,t,n){var r=t.pendingProps;switch(li(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),yi(),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&&(Qi(Ct),Ct=null))),Mi(e,t),qe(t),null;case 5:mi(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 o=t.memoizedProps;switch(r[Rt]=t,r[Mr]=o,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,o),Pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Pe("invalid",r);break;case"textarea":mt(r,o),Pe("invalid",r)}gs(n,o),s=null;for(var c in o)if(o.hasOwnProperty(c)){var f=o[c];c==="children"?typeof f=="string"?r.textContent!==f&&(o.suppressHydrationWarning!==!0&&El(r.textContent,f,e),s=["children",f]):typeof f=="number"&&r.textContent!==""+f&&(o.suppressHydrationWarning!==!0&&El(r.textContent,f,e),s=["children",""+f]):p.hasOwnProperty(c)&&f!=null&&c==="onScroll"&&Pe("scroll",r)}switch(n){case"input":Rn(r),H(r,o,!0);break;case"textarea":Rn(r),rl(r);break;case"select":case"option":break;default:typeof o.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),f=s;for(o in f)if(f.hasOwnProperty(o)){var g=f[o];o==="style"?No(e,g):o==="dangerouslySetInnerHTML"?(g=g?g.__html:void 0,g!=null&&ll(e,g)):o==="children"?typeof g=="string"?(n!=="textarea"||g!=="")&&ke(e,g):typeof g=="number"&&ke(e,""+g):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(p.hasOwnProperty(o)?g!=null&&o==="onScroll"&&Pe("scroll",e):g!=null&&L(e,o,g,c))}switch(n){case"input":Rn(e),H(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,o=r.value,o!=null?Le(e,!!r.multiple,o,!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,(o=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)}o&&(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)Ua(),Xn(),t.flags|=98560,o=!1;else if(o=Ol(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[Rt]=t}else Xn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qe(t),o=!1}else Ct!==null&&(Qi(Ct),Ct=null),o=!0;if(!o)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):qi())),t.updateQueue!==null&&(t.flags|=4),qe(t),null);case 4:return nr(),Mi(e,t),e===null&&Or(t.stateNode.containerInfo),qe(t),null;case 10:return ci(t.type._context),qe(t),null;case 17:return st(t.type)&&Tl(),qe(t),null;case 19:if(Te(ze),o=t.memoizedState,o===null)return qe(t),null;if(r=(t.flags&128)!==0,c=o.rendering,c===null)if(r)Hr(o,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Bl(e),c!==null){for(t.flags|=128,Hr(o,!1),r=c.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,c=o.alternate,c===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=c.childLanes,o.lanes=c.lanes,o.child=c.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=c.memoizedProps,o.memoizedState=c.memoizedState,o.updateQueue=c.updateQueue,o.type=c.type,e=c.dependencies,o.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}o.tail!==null&&Me()>ir&&(t.flags|=128,r=!0,Hr(o,!1),t.lanes=4194304)}else{if(!r)if(e=Bl(c),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Hr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!c.alternate&&!Re)return qe(t),null}else 2*Me()-o.renderingStartTime>ir&&n!==1073741824&&(t.flags|=128,r=!0,Hr(o,!1),t.lanes=4194304);o.isBackwards?(c.sibling=t.child,t.child=c):(n=o.last,n!==null?n.sibling=c:t.child=c,o.last=c)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.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 Ji(),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 Lf(e,t){switch(li(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),yi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return mi(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 ci(t.type._context),null;case 22:case 23:return Ji(),null;case 24:return null;default:return null}}var Jl=!1,Ge=!1,Rf=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 Ai(e,t,n){try{n()}catch(r){Oe(e,t,r)}}var Au=!1;function zf(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,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var c=0,f=-1,g=-1,R=0,A=0,F=e,M=null;t:for(;;){for(var q;F!==n||s!==0&&F.nodeType!==3||(f=c+s),F!==o||r!==0&&F.nodeType!==3||(g=c+r),F.nodeType===3&&(c+=F.nodeValue.length),(q=F.firstChild)!==null;)M=F,F=q;for(;;){if(F===e)break t;if(M===n&&++R===s&&(f=c),M===o&&++A===r&&(g=c),(q=F.nextSibling)!==null)break;F=M,M=F.parentNode}F=q}n=f===-1||g===-1?null:{start:f,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,N=t.stateNode,x=N.getSnapshotBeforeUpdate(t.elementType===t.type?te:Nt(t.type,te),Ae);N.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(W){Oe(t,t.return,W)}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 o=s.destroy;s.destroy=void 0,o!==void 0&&Ai(t,n,o)}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 Fi(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[ei],delete t[hf],delete t[mf])),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 Uu(e){return e.tag===5||e.tag===3||e.tag===4}function Bu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Uu(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 Ui(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(Ui(e,t,n),e=e.sibling;e!==null;)Ui(e,t,n),e=e.sibling}function Bi(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(Bi(e,t,n),e=e.sibling;e!==null;)Bi(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 o=s,c=o.destroy;o=o.tag,c!==void 0&&((o&2)!==0||(o&4)!==0)&&Ai(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(f){Oe(n,t,f)}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 Rf),t.forEach(function(r){var s=Wf.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 o=e,c=t,f=c;e:for(;f!==null;){switch(f.tag){case 5:He=f.stateNode,Et=!1;break e;case 3:He=f.stateNode.containerInfo,Et=!0;break e;case 4:He=f.stateNode.containerInfo,Et=!0;break e}f=f.return}if(He===null)throw Error(u(160));Wu(o,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;)Vu(t,e),t=t.sibling}function Vu(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 o=e.memoizedProps,c=n!==null?n.memoizedProps:o,f=e.type,g=e.updateQueue;if(e.updateQueue=null,g!==null)try{f==="input"&&o.type==="radio"&&o.name!=null&&In(s,o),ys(f,c);var R=ys(f,o);for(c=0;c<g.length;c+=2){var A=g[c],F=g[c+1];A==="style"?No(s,F):A==="dangerouslySetInnerHTML"?ll(s,F):A==="children"?ke(s,F):L(s,A,F,R)}switch(f){case"input":Ht(s,o);break;case"textarea":hr(s,o);break;case"select":var M=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var q=o.value;q!=null?Le(s,!!o.multiple,q,!1):M!==!!o.multiple&&(o.defaultValue!=null?Le(s,!!o.multiple,o.defaultValue,!0):Le(s,!!o.multiple,o.multiple?[]:"",!1))}s[Mr]=o}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,o=e.memoizedProps;try{s.nodeValue=o}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&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Vi=Me())),r&4&&$u(e);break;case 22:if(A=n!==null&&n.memoizedState!==null,e.mode&1?(Ge=(R=Ge)||A,_t(t,e),Ge=R):_t(t,e),Ot(e),r&8192){if(R=e.memoizedState!==null,(e.stateNode.isHidden=R)&&!A&&(e.mode&1)!==0)for(Z=e,A=e.child;A!==null;){for(F=Z=A;Z!==null;){switch(M=Z,q=M.child,M.tag){case 0:case 11:case 14:case 15:Qr(4,M,M.return);break;case 1:lr(M,M.return);var ee=M.stateNode;if(typeof ee.componentWillUnmount=="function"){r=M,n=M.return;try{t=r,ee.props=t.memoizedProps,ee.state=t.memoizedState,ee.componentWillUnmount()}catch(te){Oe(r,n,te)}}break;case 5:lr(M,M.return);break;case 22:if(M.memoizedState!==null){Hu(F);continue}}q!==null?(q.return=M,Z=q):Hu(F)}A=A.sibling}e:for(A=null,F=e;;){if(F.tag===5){if(A===null){A=F;try{s=F.stateNode,R?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(f=F.stateNode,g=F.memoizedProps.style,c=g!=null&&g.hasOwnProperty("display")?g.display:null,f.style.display=sl("display",c))}catch(te){Oe(e,e.return,te)}}}else if(F.tag===6){if(A===null)try{F.stateNode.nodeValue=R?"":F.memoizedProps}catch(te){Oe(e,e.return,te)}}else if((F.tag!==22&&F.tag!==23||F.memoizedState===null||F===e)&&F.child!==null){F.child.return=F,F=F.child;continue}if(F===e)break e;for(;F.sibling===null;){if(F.return===null||F.return===e)break e;A===F&&(A=null),F=F.return}A===F&&(A=null),F.sibling.return=F.return,F=F.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(Uu(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 o=Bu(e);Bi(e,o,s);break;case 3:case 4:var c=r.stateNode.containerInfo,f=Bu(e);Ui(e,f,c);break;default:throw Error(u(161))}}catch(g){Oe(e,e.return,g)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function If(e,t,n){Z=e,bu(e)}function bu(e,t,n){for(var r=(e.mode&1)!==0;Z!==null;){var s=Z,o=s.child;if(s.tag===22&&r){var c=s.memoizedState!==null||Jl;if(!c){var f=s.alternate,g=f!==null&&f.memoizedState!==null||Ge;f=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(;o!==null;)Z=o,bu(o),o=o.sibling;Z=s,Jl=f,Ge=R}Ku(e)}else(s.subtreeFlags&8772)!==0&&o!==null?(o.return=s,Z=o):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 o=t.updateQueue;o!==null&&Ha(t,o,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 f=t.stateNode;if(n===null&&t.flags&4){n=f;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 A=R.memoizedState;if(A!==null){var F=A.dehydrated;F!==null&&Nr(F)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(u(163))}Ge||t.flags&512&&Fi(t)}catch(M){Oe(t,t.return,M)}}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 o=t.return;try{Fi(t)}catch(g){Oe(t,o,g)}break;case 5:var c=t.return;try{Fi(t)}catch(g){Oe(t,c,g)}}}catch(g){Oe(t,t.return,g)}if(t===e){Z=null;break}var f=t.sibling;if(f!==null){f.return=t.return,Z=f;break}Z=t.return}}var Of=Math.ceil,Gl=_.ReactCurrentDispatcher,Wi=_.ReactCurrentOwner,St=_.ReactCurrentBatchConfig,Se=0,be=null,Ue=null,Qe=0,pt=0,sr=en(0),$e=0,Yr=null,Cn=0,Xl=0,$i=0,Jr=null,ot=null,Vi=0,ir=1/0,bt=null,Zl=!1,bi=null,on=null,es=!1,an=null,ts=0,qr=0,Ki=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:yf.transition!==null?(rs===0&&(rs=Bo()),rs):(e=Ce,e!==0||(e=window.event,e=e===void 0?16:Jo(e.type)),e)}function Pt(e,t,n,r){if(50<qr)throw qr=0,Ki=null,Error(u(185));Sr(e,n,r),((Se&2)===0||e!==be)&&(e===be&&((Se&2)===0&&(Xl|=n),$e===4&&cn(e,Qe)),at(e,r),n===1&&Se===0&&(t.mode&1)===0&&(ir=Me()+500,Rl&&nn()))}function at(e,t){var n=e.callbackNode;gd(e,t);var r=fl(e,e===be?Qe:0);if(r===0)n!==null&&Ao(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ao(n),t===1)e.tag===0?gf(Ju.bind(null,e)):Oa(Ju.bind(null,e)),ff(function(){(Se&6)===0&&nn()}),n=null;else{switch(Wo(r)){case 1:n=Cs;break;case 4:n=Fo;break;case 16:n=al;break;case 536870912:n=Uo;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(or()&&e.callbackNode!==n)return null;var r=fl(e,e===be?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 o=Gu();(be!==e||Qe!==t)&&(bt=null,ir=Me()+500,En(e,t));do try{Af();break}catch(f){qu(e,f)}while(!0);ui(),Gl.current=o,Se=s,Ue!==null?t=0:(be=null,Qe=0,t=$e)}if(t!==0){if(t===2&&(s=Ns(e),s!==0&&(r=s,t=Hi(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&&!Df(s)&&(t=ls(e,r),t===2&&(o=Ns(e),o!==0&&(r=o,t=Hi(e,o))),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,ot,bt);break;case 3:if(cn(e,r),(r&130023424)===r&&(t=Vi+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,ot,bt),t);break}_n(e,ot,bt);break;case 4:if(cn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var c=31-wt(r);o=1<<c,c=t[c],c>s&&(s=c),r&=~o}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*Of(r/1960))-r,10<r){e.timeoutHandle=Xs(_n.bind(null,e,ot,bt),r);break}_n(e,ot,bt);break;case 5:_n(e,ot,bt);break;default:throw Error(u(329))}}}return at(e,Me()),e.callbackNode===n?Yu.bind(null,e):null}function Hi(e,t){var n=Jr;return e.current.memoizedState.isDehydrated&&(En(e,t).flags|=256),e=ls(e,t),e!==2&&(t=ot,ot=n,t!==null&&Qi(t)),e}function Qi(e){ot===null?ot=e:ot.push.apply(ot,e)}function Df(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],o=s.getSnapshot;s=s.value;try{if(!kt(o(),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&=~$i,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));or();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=Hi(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,ot,bt),at(e,Me()),null}function Yi(e,t){var n=Se;Se|=1;try{return e(t)}finally{Se=n,Se===0&&(ir=Me()+500,Rl&&nn())}}function Nn(e){an!==null&&an.tag===0&&(Se&6)===0&&or();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 Ji(){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,df(n)),Ue!==null)for(n=Ue.return;n!==null;){var r=n;switch(li(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Tl();break;case 3:nr(),Te(lt),Te(Ye),yi();break;case 5:mi(r);break;case 4:nr();break;case 13:Te(ze);break;case 19:Te(ze);break;case 10:ci(r.type._context);break;case 22:case 23:Ji()}n=n.return}if(be=e,Ue=e=dn(e.current,null),Qe=pt=t,$e=0,Yr=null,$i=Xl=Cn=0,ot=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,o=n.pending;if(o!==null){var c=o.next;o.next=s,r.next=c}n.pending=r}jn=null}return e}function qu(e,t){do{var n=Ue;try{if(ui(),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,Ve=We=Ie=null,$r=!1,Vr=0,Wi.current=null,n===null||n.return===null){$e=1,Yr=t,Ue=null;break}e:{var o=e,c=n.return,f=n,g=t;if(t=Qe,f.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){var R=g,A=f,F=A.tag;if((A.mode&1)===0&&(F===0||F===11||F===15)){var M=A.alternate;M?(A.updateQueue=M.updateQueue,A.memoizedState=M.memoizedState,A.lanes=M.lanes):(A.updateQueue=null,A.memoizedState=null)}var q=ju(c);if(q!==null){q.flags&=-257,wu(q,c,f,o,t),q.mode&1&&Su(o,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(o,R,t),qi();break e}g=Error(u(426))}}else if(Re&&f.mode&1){var Ae=ju(c);if(Ae!==null){(Ae.flags&65536)===0&&(Ae.flags|=256),wu(Ae,c,f,o,t),oi(rr(g,f));break e}}o=g=rr(g,f),$e!==4&&($e=2),Jr===null?Jr=[o]:Jr.push(o),o=c;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var N=vu(o,g,t);Ka(o,N);break e;case 1:f=g;var x=o.type,E=o.stateNode;if((o.flags&128)===0&&(typeof x.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(on===null||!on.has(E)))){o.flags|=65536,t&=-t,o.lanes|=t;var W=xu(o,f,t);Ka(o,W);break e}}o=o.return}while(o!==null)}Zu(n)}catch(ne){t=ne,Ue===n&&n!==null&&(Ue=n=n.return);continue}break}while(!0)}function Gu(){var e=Gl.current;return Gl.current=Kl,e===null?Kl:e}function qi(){($e===0||$e===3||$e===2)&&($e=4),be===null||(Cn&268435455)===0&&(Xl&268435455)===0||cn(be,Qe)}function ls(e,t){var n=Se;Se|=2;var r=Gu();(be!==e||Qe!==t)&&(bt=null,En(e,t));do try{Mf();break}catch(s){qu(e,s)}while(!0);if(ui(),Se=n,Gl.current=r,Ue!==null)throw Error(u(261));return be=null,Qe=0,$e}function Mf(){for(;Ue!==null;)Xu(Ue)}function Af(){for(;Ue!==null&&!od();)Xu(Ue)}function Xu(e){var t=nc(e.alternate,e,pt);e.memoizedProps=e.pendingProps,t===null?Zu(e):Ue=t,Wi.current=null}function Zu(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Tf(n,t,pt),n!==null){Ue=n;return}}else{if(n=Lf(n,t),n!==null){n.flags&=32767,Ue=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{$e=6,Ue=null;return}}if(t=t.sibling,t!==null){Ue=t;return}Ue=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,Ff(e,t,n,r)}finally{St.transition=s,Ce=r}return null}function Ff(e,t,n,r){do or();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 o=n.lanes|n.childLanes;if(yd(e,o),e===be&&(Ue=be=null,Qe=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||es||(es=!0,rc(al,function(){return or(),null})),o=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||o){o=St.transition,St.transition=null;var c=Ce;Ce=1;var f=Se;Se|=4,Wi.current=null,zf(e,n),Vu(n,e),rf(qs),ml=!!Js,qs=Js=null,e.current=n,If(n),ad(),Se=f,Ce=c,St.transition=o}else e.current=n;if(es&&(es=!1,an=e,ts=s),o=e.pendingLanes,o===0&&(on=null),dd(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=bi,bi=null,e;return(ts&1)!==0&&e.tag!==0&&or(),o=e.pendingLanes,(o&1)!==0?e===Ki?qr++:(qr=0,Ki=e):qr=0,nn(),null}function or(){if(an!==null){var e=Wo(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 o=Z,c=o.child;if((Z.flags&16)!==0){var f=o.deletions;if(f!==null){for(var g=0;g<f.length;g++){var R=f[g];for(Z=R;Z!==null;){var A=Z;switch(A.tag){case 0:case 11:case 15:Qr(8,A,o)}var F=A.child;if(F!==null)F.return=A,Z=F;else for(;Z!==null;){A=Z;var M=A.sibling,q=A.return;if(Fu(A),A===R){Z=null;break}if(M!==null){M.return=q,Z=M;break}Z=q}}}var ee=o.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=o}}if((o.subtreeFlags&2064)!==0&&c!==null)c.return=o,Z=c;else e:for(;Z!==null;){if(o=Z,(o.flags&2048)!==0)switch(o.tag){case 0:case 11:case 15:Qr(9,o,o.return)}var N=o.sibling;if(N!==null){N.return=o.return,Z=N;break e}Z=o.return}}var x=e.current;for(Z=x;Z!==null;){c=Z;var E=c.child;if((c.subtreeFlags&2064)!==0&&E!==null)E.return=c,Z=E;else e:for(c=x;Z!==null;){if(f=Z,(f.flags&2048)!==0)try{switch(f.tag){case 0:case 11:case 15:ql(9,f)}}catch(ne){Oe(f,f.return,ne)}if(f===c){Z=null;break e}var W=f.sibling;if(W!==null){W.return=f.return,Z=W;break e}Z=f.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,be===e&&(Qe&n)===n&&($e===4||$e===3&&(Qe&130023424)===Qe&&500>Me()-Vi?En(e,0):$i|=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 Bf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),tc(e,n)}function Wf(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)it=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return it=!1,Pf(e,t,n);it=(e.flags&131072)!==0}else it=!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=Si(null,t,r,e,s,n);var o=ji();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)?(o=!0,Ll(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,pi(t),s.updater=Hl,t.stateNode=s,s._reactInternals=t,_i(t,r,e,n),t=Ri(null,t,r,!0,o,n)):(t.tag=0,Re&&o&&ri(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=Li(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),Li(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,o=t.memoizedState,s=o.element,ba(e,t),Ul(t,r,null,n);var c=t.memoizedState;if(r=c.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},t.updateQueue.baseState=o,t.memoizedState=o,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=Vt(e,t,n);break e}et(e,t,r,n)}t=t.child}return t;case 5:return Qa(t),e===null&&ii(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,c=s.children,Gs(r,s)?c=null:o!==null&&Gs(r,o)&&(t.flags|=32),_u(e,t),et(e,t,c,n),t.child;case 6:return e===null&&ii(t),null;case 13:return Ru(e,t,n);case 4:return hi(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,o=t.memoizedProps,c=s.value,_e(Ml,r._currentValue),r._currentValue=c,o!==null)if(kt(o.value,c)){if(o.children===s.children&&!lt.current){t=Vt(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var f=o.dependencies;if(f!==null){c=o.child;for(var g=f.firstContext;g!==null;){if(g.context===r){if(o.tag===1){g=$t(-1,n&-n),g.tag=2;var R=o.updateQueue;if(R!==null){R=R.shared;var A=R.pending;A===null?g.next=g:(g.next=A.next,A.next=g),R.pending=g}}o.lanes|=n,g=o.alternate,g!==null&&(g.lanes|=n),di(o.return,n,t),f.lanes|=n;break}g=g.next}}else if(o.tag===10)c=o.type===t.type?null:o.child;else if(o.tag===18){if(c=o.return,c===null)throw Error(u(341));c.lanes|=n,f=c.alternate,f!==null&&(f.lanes|=n),di(c,n,t),c=o.sibling}else c=o.child;if(c!==null)c.return=o;else for(c=o;c!==null;){if(c===t){c=null;break}if(o=c.sibling,o!==null){o.return=c.return,c=o;break}c=c.return}o=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),_i(t,r,s,n),Ri(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 Mo(e,t)}function $f(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 $f(e,t,n,r)}function Gi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vf(e){if(typeof e=="function")return Gi(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Be)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,o){var c=2;if(r=e,typeof e=="function")Gi(e)&&(c=1);else if(typeof e=="string")c=5;else e:switch(e){case fe:return Pn(n.children,s,o,t);case ge:c=8,s|=8;break;case X:return e=jt(12,n,t,s|2),e.elementType=X,e.lanes=o,e;case J:return e=jt(13,n,t,s),e.elementType=J,e.lanes=o,e;case oe:return e=jt(19,n,t,s),e.elementType=oe,e.lanes=o,e;case ue:return is(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case me:c=10;break e;case De:c=9;break e;case Be: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=o,t}function Pn(e,t,n,r){return e=jt(7,e,r,t),e.lanes=n,e}function is(e,t,n,r){return e=jt(22,e,r,t),e.elementType=ue,e.lanes=n,e.stateNode={isHidden:!1},e}function Xi(e,t,n){return e=jt(6,e,null,t),e.lanes=n,e}function Zi(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 bf(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 eo(e,t,n,r,s,o,c,f,g){return e=new bf(e,t,n,f,g),t===1?(t=1,o===!0&&(t|=8)):t=0,o=jt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pi(o),e}function Kf(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Y,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,o,c,f,g){return e=eo(n,r,!0,e,s,o,c,f,g),e.context=lc(null),n=e.current,r=tt(),s=un(n),o=$t(r,s),o.callback=t??null,ln(n,o,s),e.current.lanes=s,Sr(e,s,r),at(e,r),e}function os(e,t,n,r){var s=t.current,o=tt(),c=un(s);return n=lc(n),t.context===null?t.context=n:t.pendingContext=n,t=$t(o,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,o),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 ic(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function to(e,t){ic(e,t),(e=e.alternate)&&ic(e,t)}function Hf(){return null}var oc=typeof reportError=="function"?reportError:function(e){console.error(e)};function no(e){this._internalRoot=e}us.prototype.render=no.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));os(e,t,null,null)},us.prototype.unmount=no.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nn(function(){os(null,e,null,null)}),t[At]=null}};function us(e){this._internalRoot=e}us.prototype.unstable_scheduleHydration=function(e){if(e){var t=bo();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&&Qo(e)}};function ro(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 Qf(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var R=as(c);o.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 f=r;r=function(){var R=as(g);f.call(R)}}var g=eo(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(){os(t,g,n,r)}),g}function ds(e,t,n,r,s){var o=n._reactRootContainer;if(o){var c=o;if(typeof s=="function"){var f=s;s=function(){var g=as(c);f.call(g)}}os(t,c,e,s)}else c=Qf(n,t,e,s,r);return as(c)}$o=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&&(ir=Me()+500,nn()))}break;case 13:Nn(function(){var r=Wt(e,1);if(r!==null){var s=tt();Pt(r,e,1,s)}}),to(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)}to(e,134217728)}},Vo=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)}to(e,t)}},bo=function(){return Ce},Ko=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)}},To=Yi,Lo=Nn;var Yf={usingClientEntryPoint:!1,Events:[Ar,Qn,Pl,_o,Po,Yi]},Gr={findFiberByHostInstance:yn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Jf={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:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Oo(e),e===null?null:e.stateNode},findFiberByHostInstance:Gr.findFiberByHostInstance||Hf,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(Jf),Lt=fs}catch{}}return ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yf,ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ro(t))throw Error(u(200));return Kf(e,t,null,n)},ut.createRoot=function(e,t){if(!ro(e))throw Error(u(299));var n=!1,r="",s=oc;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=eo(e,1,!1,null,null,n,!1,r,s),e[At]=t.current,Or(e.nodeType===8?e.parentNode:e),new no(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=Oo(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(!ro(e))throw Error(u(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",c=oc;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(c=n.onRecoverableError)),t=sc(t,null,e,1,n??null,s,!1,o,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=Yi,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 Mc(){if(gc)return io.exports;gc=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(a){console.error(a)}}return i(),io.exports=op(),io.exports}var yc;function ap(){if(yc)return ps;yc=1;var i=Mc();return ps.createRoot=i.createRoot,ps.hydrateRoot=i.hydrateRoot,ps}var up=ap();Mc();/**
|
|
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(i){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(i[d]=u[d])}return i},Zr.apply(this,arguments)}var pn;(function(i){i.Pop="POP",i.Push="PUSH",i.Replace="REPLACE"})(pn||(pn={}));const vc="popstate";function cp(i){i===void 0&&(i={});function a(d,p){let{pathname:m,search:j,hash:w}=d.location;return po("",{pathname:m,search:j,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 fp(a,u,null,i)}function Fe(i,a){if(i===!1||i===null||typeof i>"u")throw new Error(a)}function vo(i,a){if(!i){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function dp(){return Math.random().toString(36).substr(2,8)}function xc(i,a){return{usr:i.state,key:i.key,idx:a}}function po(i,a,u,d){return u===void 0&&(u=null),Zr({pathname:typeof i=="string"?i:i.pathname,search:"",hash:""},typeof a=="string"?ur(a):a,{state:u,key:a&&a.key||d||dp()})}function hs(i){let{pathname:a="/",search:u="",hash:d=""}=i;return u&&u!=="?"&&(a+=u.charAt(0)==="?"?u:"?"+u),d&&d!=="#"&&(a+=d.charAt(0)==="#"?d:"#"+d),a}function ur(i){let a={};if(i){let u=i.indexOf("#");u>=0&&(a.hash=i.substr(u),i=i.substr(0,u));let d=i.indexOf("?");d>=0&&(a.search=i.substr(d),i=i.substr(0,d)),i&&(a.pathname=i)}return a}function fp(i,a,u,d){d===void 0&&(d={});let{window:p=document.defaultView,v5Compat:m=!1}=d,j=p.history,w=pn.Pop,v=null,k=T();k==null&&(k=0,j.replaceState(Zr({},j.state,{idx:k}),""));function T(){return(j.state||{idx:null}).idx}function S(){w=pn.Pop;let P=T(),z=P==null?null:P-k;k=P,v&&v({action:w,location:y.location,delta:z})}function I(P,z){w=pn.Push;let $=po(y.location,P,z);k=T()+1;let L=xc($,k),_=y.createHref($);try{j.pushState(L,"",_)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;p.location.assign(_)}m&&v&&v({action:w,location:y.location,delta:1})}function B(P,z){w=pn.Replace;let $=po(y.location,P,z);k=T();let L=xc($,k),_=y.createHref($);j.replaceState(L,"",_),m&&v&&v({action:w,location:y.location,delta:0})}function D(P){let z=p.location.origin!=="null"?p.location.origin:p.location.href,$=typeof P=="string"?P:hs(P);return $=$.replace(/ $/,"%20"),Fe(z,"No window.location.(origin|href) available to create URL for href: "+$),new URL($,z)}let y={get action(){return w},get location(){return i(p,j)},listen(P){if(v)throw new Error("A history only accepts one active listener");return p.addEventListener(vc,S),v=P,()=>{p.removeEventListener(vc,S),v=null}},createHref(P){return a(p,P)},createURL:D,encodeLocation(P){let z=D(P);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:I,replace:B,go(P){return j.go(P)}};return y}var Sc;(function(i){i.data="data",i.deferred="deferred",i.redirect="redirect",i.error="error"})(Sc||(Sc={}));function pp(i,a,u){return u===void 0&&(u="/"),hp(i,a,u)}function hp(i,a,u,d){let p=typeof a=="string"?ur(a):a,m=xo(p.pathname||"/",u);if(m==null)return null;let j=Ac(i);mp(j);let w=null;for(let v=0;w==null&&v<j.length;++v){let k=_p(m);w=Cp(j[v],k)}return w}function Ac(i,a,u,d){a===void 0&&(a=[]),u===void 0&&(u=[]),d===void 0&&(d="");let p=(m,j,w)=>{let v={relativePath:w===void 0?m.path||"":w,caseSensitive:m.caseSensitive===!0,childrenIndex:j,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]),T=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+'".')),Ac(m.children,a,T,k)),!(m.path==null&&!m.index)&&a.push({path:k,score:wp(k,m.index),routesMeta:T})};return i.forEach((m,j)=>{var w;if(m.path===""||!((w=m.path)!=null&&w.includes("?")))p(m,j);else for(let v of Fc(m.path))p(m,j,v)}),a}function Fc(i){let a=i.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 j=Fc(d.join("/")),w=[];return w.push(...j.map(v=>v===""?m:[m,v].join("/"))),p&&w.push(...j),w.map(v=>i.startsWith("/")&&v===""?"/":v)}function mp(i){i.sort((a,u)=>a.score!==u.score?u.score-a.score:kp(a.routesMeta.map(d=>d.childrenIndex),u.routesMeta.map(d=>d.childrenIndex)))}const gp=/^:[\w-]+$/,yp=3,vp=2,xp=1,Sp=10,jp=-2,jc=i=>i==="*";function wp(i,a){let u=i.split("/"),d=u.length;return u.some(jc)&&(d+=jp),a&&(d+=vp),u.filter(p=>!jc(p)).reduce((p,m)=>p+(gp.test(m)?yp:m===""?xp:Sp),d)}function kp(i,a){return i.length===a.length&&i.slice(0,-1).every((d,p)=>d===a[p])?i[i.length-1]-a[a.length-1]:0}function Cp(i,a,u){let{routesMeta:d}=i,p={},m="/",j=[];for(let w=0;w<d.length;++w){let v=d[w],k=w===d.length-1,T=m==="/"?a:a.slice(m.length)||"/",S=Np({path:v.relativePath,caseSensitive:v.caseSensitive,end:k},T),I=v.route;if(!S)return null;Object.assign(p,S.params),j.push({params:p,pathname:hn([m,S.pathname]),pathnameBase:zp(hn([m,S.pathnameBase])),route:I}),S.pathnameBase!=="/"&&(m=hn([m,S.pathnameBase]))}return j}function Np(i,a){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[u,d]=Ep(i.path,i.caseSensitive,i.end),p=a.match(u);if(!p)return null;let m=p[0],j=m.replace(/(.)\/+$/,"$1"),w=p.slice(1);return{params:d.reduce((k,T,S)=>{let{paramName:I,isOptional:B}=T;if(I==="*"){let y=w[S]||"";j=m.slice(0,m.length-y.length).replace(/(.)\/+$/,"$1")}const D=w[S];return B&&!D?k[I]=void 0:k[I]=(D||"").replace(/%2F/g,"/"),k},{}),pathname:m,pathnameBase:j,pattern:i}}function Ep(i,a,u){a===void 0&&(a=!1),u===void 0&&(u=!0),vo(i==="*"||!i.endsWith("*")||i.endsWith("/*"),'Route path "'+i+'" will be treated as if it were '+('"'+i.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+i.replace(/\*$/,"/*")+'".'));let d=[],p="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(j,w,v)=>(d.push({paramName:w,isOptional:v!=null}),v?"/?([^\\/]+)?":"/([^\\/]+)"));return i.endsWith("*")?(d.push({paramName:"*"}),p+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):u?p+="\\/*$":i!==""&&i!=="/"&&(p+="(?:(?=\\/|$))"),[new RegExp(p,a?void 0:"i"),d]}function _p(i){try{return i.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return vo(!1,'The URL path "'+i+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),i}}function xo(i,a){if(a==="/")return i;if(!i.toLowerCase().startsWith(a.toLowerCase()))return null;let u=a.endsWith("/")?a.length-1:a.length,d=i.charAt(u);return d&&d!=="/"?null:i.slice(u)||"/"}const Pp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tp=i=>Pp.test(i);function Lp(i,a){a===void 0&&(a="/");let{pathname:u,search:d="",hash:p=""}=typeof i=="string"?ur(i):i,m;if(u)if(Tp(u))m=u;else{if(u.includes("//")){let j=u;u=u.replace(/\/\/+/g,"/"),vo(!1,"Pathnames cannot have embedded double slashes - normalizing "+(j+" -> "+u))}u.startsWith("/")?m=wc(u.substring(1),"/"):m=wc(u,a)}else m=a;return{pathname:m,search:Ip(d),hash:Op(p)}}function wc(i,a){let u=a.replace(/\/+$/,"").split("/");return i.split("/").forEach(p=>{p===".."?u.length>1&&u.pop():p!=="."&&u.push(p)}),u.length>1?u.join("/"):"/"}function uo(i,a,u,d){return"Cannot include a '"+i+"' 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 Rp(i){return i.filter((a,u)=>u===0||a.route.path&&a.route.path.length>0)}function So(i,a){let u=Rp(i);return a?u.map((d,p)=>p===u.length-1?d.pathname:d.pathnameBase):u.map(d=>d.pathnameBase)}function jo(i,a,u,d){d===void 0&&(d=!1);let p;typeof i=="string"?p=ur(i):(p=Zr({},i),Fe(!p.pathname||!p.pathname.includes("?"),uo("?","pathname","search",p)),Fe(!p.pathname||!p.pathname.includes("#"),uo("#","pathname","hash",p)),Fe(!p.search||!p.search.includes("#"),uo("#","search","hash",p)));let m=i===""||p.pathname==="",j=m?"/":p.pathname,w;if(j==null)w=u;else{let S=a.length-1;if(!d&&j.startsWith("..")){let I=j.split("/");for(;I[0]==="..";)I.shift(),S-=1;p.pathname=I.join("/")}w=S>=0?a[S]:"/"}let v=Lp(p,w),k=j&&j!=="/"&&j.endsWith("/"),T=(m||j===".")&&u.endsWith("/");return!v.pathname.endsWith("/")&&(k||T)&&(v.pathname+="/"),v}const hn=i=>i.join("/").replace(/\/\/+/g,"/"),zp=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),Ip=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,Op=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i;function Dp(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}const Uc=["post","put","patch","delete"];new Set(Uc);const Mp=["get",...Uc];new Set(Mp);/**
|
|
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(i){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(i[d]=u[d])}return i},el.apply(this,arguments)}const wo=h.createContext(null),Ap=h.createContext(null),mn=h.createContext(null),ms=h.createContext(null),Kt=h.createContext({outlet:null,matches:[],isDataRoute:!1}),Bc=h.createContext(null);function Fp(i,a){let{relative:u}=a===void 0?{}:a;cr()||Fe(!1);let{basename:d,navigator:p}=h.useContext(mn),{hash:m,pathname:j,search:w}=Vc(i,{relative:u}),v=j;return d!=="/"&&(v=j==="/"?d:hn([d,j])),p.createHref({pathname:v,search:w,hash:m})}function cr(){return h.useContext(ms)!=null}function dr(){return cr()||Fe(!1),h.useContext(ms).location}function Wc(i){h.useContext(mn).static||h.useLayoutEffect(i)}function $c(){let{isDataRoute:i}=h.useContext(Kt);return i?Zp():Up()}function Up(){cr()||Fe(!1);let i=h.useContext(wo),{basename:a,future:u,navigator:d}=h.useContext(mn),{matches:p}=h.useContext(Kt),{pathname:m}=dr(),j=JSON.stringify(So(p,u.v7_relativeSplatPath)),w=h.useRef(!1);return Wc(()=>{w.current=!0}),h.useCallback(function(k,T){if(T===void 0&&(T={}),!w.current)return;if(typeof k=="number"){d.go(k);return}let S=jo(k,JSON.parse(j),m,T.relative==="path");i==null&&a!=="/"&&(S.pathname=S.pathname==="/"?a:hn([a,S.pathname])),(T.replace?d.replace:d.push)(S,T.state,T)},[a,d,j,m,i])}const Bp=h.createContext(null);function Wp(i){let a=h.useContext(Kt).outlet;return a&&h.createElement(Bp.Provider,{value:i},a)}function Vc(i,a){let{relative:u}=a===void 0?{}:a,{future:d}=h.useContext(mn),{matches:p}=h.useContext(Kt),{pathname:m}=dr(),j=JSON.stringify(So(p,d.v7_relativeSplatPath));return h.useMemo(()=>jo(i,JSON.parse(j),m,u==="path"),[i,j,m,u])}function $p(i,a){return Vp(i,a)}function Vp(i,a,u,d){cr()||Fe(!1);let{navigator:p}=h.useContext(mn),{matches:m}=h.useContext(Kt),j=m[m.length-1],w=j?j.params:{};j&&j.pathname;let v=j?j.pathnameBase:"/";j&&j.route;let k=dr(),T;if(a){var S;let P=typeof a=="string"?ur(a):a;v==="/"||(S=P.pathname)!=null&&S.startsWith(v)||Fe(!1),T=P}else T=k;let I=T.pathname||"/",B=I;if(v!=="/"){let P=v.replace(/^\//,"").split("/");B="/"+I.replace(/^\//,"").split("/").slice(P.length).join("/")}let D=pp(i,{pathname:B}),y=Yp(D&&D.map(P=>Object.assign({},P,{params:Object.assign({},w,P.params),pathname:hn([v,p.encodeLocation?p.encodeLocation(P.pathname).pathname:P.pathname]),pathnameBase:P.pathnameBase==="/"?v:hn([v,p.encodeLocation?p.encodeLocation(P.pathnameBase).pathname:P.pathnameBase])})),m,u,d);return a&&y?h.createElement(ms.Provider,{value:{location:el({pathname:"/",search:"",hash:"",state:null,key:"default"},T),navigationType:pn.Pop}},y):y}function bp(){let i=Xp(),a=Dp(i)?i.status+" "+i.statusText:i instanceof Error?i.message:JSON.stringify(i),u=i instanceof Error?i.stack:null,p={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},a),u?h.createElement("pre",{style:p},u):null,null)}const Kp=h.createElement(bp,null);class Hp extends h.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?h.createElement(Kt.Provider,{value:this.props.routeContext},h.createElement(Bc.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Qp(i){let{routeContext:a,match:u,children:d}=i,p=h.useContext(wo);return p&&p.static&&p.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(p.staticContext._deepestRenderedBoundaryId=u.route.id),h.createElement(Kt.Provider,{value:a},d)}function Yp(i,a,u,d){var p;if(a===void 0&&(a=[]),u===void 0&&(u=null),d===void 0&&(d=null),i==null){var m;if(!u)return null;if(u.errors)i=u.matches;else if((m=d)!=null&&m.v7_partialHydration&&a.length===0&&!u.initialized&&u.matches.length>0)i=u.matches;else return null}let j=i,w=(p=u)==null?void 0:p.errors;if(w!=null){let T=j.findIndex(S=>S.route.id&&(w==null?void 0:w[S.route.id])!==void 0);T>=0||Fe(!1),j=j.slice(0,Math.min(j.length,T+1))}let v=!1,k=-1;if(u&&d&&d.v7_partialHydration)for(let T=0;T<j.length;T++){let S=j[T];if((S.route.HydrateFallback||S.route.hydrateFallbackElement)&&(k=T),S.route.id){let{loaderData:I,errors:B}=u,D=S.route.loader&&I[S.route.id]===void 0&&(!B||B[S.route.id]===void 0);if(S.route.lazy||D){v=!0,k>=0?j=j.slice(0,k+1):j=[j[0]];break}}}return j.reduceRight((T,S,I)=>{let B,D=!1,y=null,P=null;u&&(B=w&&S.route.id?w[S.route.id]:void 0,y=S.route.errorElement||Kp,v&&(k<0&&I===0?(eh("route-fallback"),D=!0,P=null):k===I&&(D=!0,P=S.route.hydrateFallbackElement||null)));let z=a.concat(j.slice(0,I+1)),$=()=>{let L;return B?L=y:D?L=P:S.route.Component?L=h.createElement(S.route.Component,null):S.route.element?L=S.route.element:L=T,h.createElement(Qp,{match:S,routeContext:{outlet:T,matches:z,isDataRoute:u!=null},children:L})};return u&&(S.route.ErrorBoundary||S.route.errorElement||I===0)?h.createElement(Hp,{location:u.location,revalidation:u.revalidation,component:y,error:B,children:$(),routeContext:{outlet:null,matches:z,isDataRoute:!0}}):$()},null)}var bc=(function(i){return i.UseBlocker="useBlocker",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i})(bc||{}),Kc=(function(i){return i.UseBlocker="useBlocker",i.UseLoaderData="useLoaderData",i.UseActionData="useActionData",i.UseRouteError="useRouteError",i.UseNavigation="useNavigation",i.UseRouteLoaderData="useRouteLoaderData",i.UseMatches="useMatches",i.UseRevalidator="useRevalidator",i.UseNavigateStable="useNavigate",i.UseRouteId="useRouteId",i})(Kc||{});function Jp(i){let a=h.useContext(wo);return a||Fe(!1),a}function qp(i){let a=h.useContext(Ap);return a||Fe(!1),a}function Gp(i){let a=h.useContext(Kt);return a||Fe(!1),a}function Hc(i){let a=Gp(),u=a.matches[a.matches.length-1];return u.route.id||Fe(!1),u.route.id}function Xp(){var i;let a=h.useContext(Bc),u=qp(),d=Hc();return a!==void 0?a:(i=u.errors)==null?void 0:i[d]}function Zp(){let{router:i}=Jp(bc.UseNavigateStable),a=Hc(Kc.UseNavigateStable),u=h.useRef(!1);return Wc(()=>{u.current=!0}),h.useCallback(function(p,m){m===void 0&&(m={}),u.current&&(typeof p=="number"?i.navigate(p):i.navigate(p,el({fromRouteId:a},m)))},[i,a])}const kc={};function eh(i,a,u){kc[i]||(kc[i]=!0)}function th(i,a){i==null||i.v7_startTransition,i==null||i.v7_relativeSplatPath}function nh(i){let{to:a,replace:u,state:d,relative:p}=i;cr()||Fe(!1);let{future:m,static:j}=h.useContext(mn),{matches:w}=h.useContext(Kt),{pathname:v}=dr(),k=$c(),T=jo(a,So(w,m.v7_relativeSplatPath),v,p==="path"),S=JSON.stringify(T);return h.useEffect(()=>k(JSON.parse(S),{replace:u,state:d,relative:p}),[k,S,p,u,d]),null}function Qc(i){return Wp(i.context)}function rt(i){Fe(!1)}function rh(i){let{basename:a="/",children:u=null,location:d,navigationType:p=pn.Pop,navigator:m,static:j=!1,future:w}=i;cr()&&Fe(!1);let v=a.replace(/^\/*/,"/"),k=h.useMemo(()=>({basename:v,navigator:m,static:j,future:el({v7_relativeSplatPath:!1},w)}),[v,w,m,j]);typeof d=="string"&&(d=ur(d));let{pathname:T="/",search:S="",hash:I="",state:B=null,key:D="default"}=d,y=h.useMemo(()=>{let P=xo(T,v);return P==null?null:{location:{pathname:P,search:S,hash:I,state:B,key:D},navigationType:p}},[v,T,S,I,B,D,p]);return y==null?null:h.createElement(mn.Provider,{value:k},h.createElement(ms.Provider,{children:u,value:y}))}function Yc(i){let{children:a,location:u}=i;return $p(ho(a),u)}new Promise(()=>{});function ho(i,a){a===void 0&&(a=[]);let u=[];return h.Children.forEach(i,(d,p)=>{if(!h.isValidElement(d))return;let m=[...a,p];if(d.type===h.Fragment){u.push.apply(u,ho(d.props.children,m));return}d.type!==rt&&Fe(!1),!d.props.index||!d.props.children||Fe(!1);let j={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&&(j.children=ho(d.props.children,m)),u.push(j)}),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 mo(){return mo=Object.assign?Object.assign.bind():function(i){for(var a=1;a<arguments.length;a++){var u=arguments[a];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(i[d]=u[d])}return i},mo.apply(this,arguments)}function lh(i,a){if(i==null)return{};var u={},d=Object.keys(i),p,m;for(m=0;m<d.length;m++)p=d[m],!(a.indexOf(p)>=0)&&(u[p]=i[p]);return u}function sh(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function ih(i,a){return i.button===0&&(!a||a==="_self")&&!sh(i)}const oh=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ah="6";try{window.__reactRouterVersion=ah}catch{}const uh="startTransition",Cc=lp[uh];function Jc(i){let{basename:a,children:u,future:d,window:p}=i,m=h.useRef();m.current==null&&(m.current=cp({window:p,v5Compat:!0}));let j=m.current,[w,v]=h.useState({action:j.action,location:j.location}),{v7_startTransition:k}=d||{},T=h.useCallback(S=>{k&&Cc?Cc(()=>v(S)):v(S)},[v,k]);return h.useLayoutEffect(()=>j.listen(T),[j,T]),h.useEffect(()=>th(d),[d]),h.createElement(rh,{basename:a,children:u,location:w.location,navigationType:w.action,navigator:j,future:d})}const ch=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Mt=h.forwardRef(function(a,u){let{onClick:d,relative:p,reloadDocument:m,replace:j,state:w,target:v,to:k,preventScrollReset:T,viewTransition:S}=a,I=lh(a,oh),{basename:B}=h.useContext(mn),D,y=!1;if(typeof k=="string"&&dh.test(k)&&(D=k,ch))try{let L=new URL(window.location.href),_=k.startsWith("//")?new URL(L.protocol+k):new URL(k),U=xo(_.pathname,B);_.origin===L.origin&&U!=null?k=U+_.search+_.hash:y=!0}catch{}let P=Fp(k,{relative:p}),z=fh(k,{replace:j,state:w,target:v,preventScrollReset:T,relative:p,viewTransition:S});function $(L){d&&d(L),L.defaultPrevented||z(L)}return h.createElement("a",mo({},I,{href:D||P,onClick:y||m?d:$,ref:u,target:v}))});var Nc;(function(i){i.UseScrollRestoration="useScrollRestoration",i.UseSubmit="useSubmit",i.UseSubmitFetcher="useSubmitFetcher",i.UseFetcher="useFetcher",i.useViewTransitionState="useViewTransitionState"})(Nc||(Nc={}));var Ec;(function(i){i.UseFetcher="useFetcher",i.UseFetchers="useFetchers",i.UseScrollRestoration="useScrollRestoration"})(Ec||(Ec={}));function fh(i,a){let{target:u,replace:d,state:p,preventScrollReset:m,relative:j,viewTransition:w}=a===void 0?{}:a,v=$c(),k=dr(),T=Vc(i,{relative:j});return h.useCallback(S=>{if(ih(S,u)){S.preventDefault();let I=d!==void 0?d:hs(k)===hs(T);v(i,{replace:I,state:p,preventScrollReset:m,relative:j,viewTransition:w})}},[k,v,T,d,p,u,i,m,j,w])}function qc({sidebar:i,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"}})}),i]}),l.jsx("main",{className:"main",children:a??l.jsx(Qc,{})})]})}const ko="/api";async function nt(i,a){const u={"Content-Type":"application/json",...a==null?void 0:a.headers},d=await fetch(`${ko}${i}`,{...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(i,a){const u={"Content-Type":"application/json",...a==null?void 0:a.headers},d=await fetch(`${ko}${i}`,{...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 ph(){var i;try{const u=await(await fetch("/auth/check",{credentials:"include"})).json();return u.success&&((i=u.data)==null?void 0:i.authenticated)}catch{return!1}}async function _c(i){try{return(await fetch("/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:i}),credentials:"include"})).ok}catch{return!1}}async function hh(){await fetch("/auth/logout",{method:"POST",credentials:"include"}).catch(()=>{})}const ie={async getStatus(){return ye("/status")},async getTools(){return ye("/tools")},async getMemoryStats(){return ye("/memory/stats")},async searchKnowledge(i,a=10){return ye(`/memory/search?q=${encodeURIComponent(i)}&limit=${a}`)},async getSoulFile(i){return ye(`/soul/${i}`)},async updateSoulFile(i,a){return ye(`/soul/${i}`,{method:"PUT",body:JSON.stringify({content:a})})},async getPlugins(){return ye("/plugins")},async getToolRag(){return ye("/tools/rag")},async updateToolRag(i){return ye("/tools/rag",{method:"PUT",body:JSON.stringify(i)})},async getMcpServers(){return ye("/mcp")},async addMcpServer(i){return ye("/mcp",{method:"POST",body:JSON.stringify(i)})},async removeMcpServer(i){return ye(`/mcp/${encodeURIComponent(i)}`,{method:"DELETE"})},async updateToolConfig(i,a){return ye(`/tools/${i}`,{method:"PUT",body:JSON.stringify(a)})},async workspaceList(i="",a=!1){const u=new URLSearchParams;i&&u.set("path",i),a&&u.set("recursive","true");const d=u.toString();return ye(`/workspace${d?`?${d}`:""}`)},async workspaceRead(i){return ye(`/workspace/read?path=${encodeURIComponent(i)}`)},async workspaceWrite(i,a){return ye("/workspace/write",{method:"POST",body:JSON.stringify({path:i,content:a})})},async workspaceMkdir(i){return ye("/workspace/mkdir",{method:"POST",body:JSON.stringify({path:i})})},async workspaceDelete(i,a=!1){return ye("/workspace",{method:"DELETE",body:JSON.stringify({path:i,recursive:a})})},async workspaceRename(i,a){return ye("/workspace/rename",{method:"POST",body:JSON.stringify({from:i,to:a})})},async workspaceInfo(){return ye("/workspace/info")},async tasksList(i){const a=i?`?status=${i}`:"";return ye(`/tasks${a}`)},async tasksGet(i){return ye(`/tasks/${i}`)},async tasksDelete(i){return ye(`/tasks/${i}`,{method:"DELETE"})},async tasksCancel(i){return ye(`/tasks/${i}/cancel`,{method:"POST"})},async tasksCleanDone(){return ye("/tasks/clean-done",{method:"POST"})},async getConfigKeys(){return ye("/config")},async setConfigKey(i,a){return ye(`/config/${i}`,{method:"PUT",body:JSON.stringify({value:a})})},async unsetConfigKey(i){return ye(`/config/${i}`,{method:"DELETE"})},async getMarketplace(i=!1){return ye(`/marketplace${i?"?refresh=true":""}`)},async installPlugin(i){return ye("/marketplace/install",{method:"POST",body:JSON.stringify({id:i})})},async uninstallPlugin(i){return ye("/marketplace/uninstall",{method:"POST",body:JSON.stringify({id:i})})},async updatePlugin(i){return ye("/marketplace/update",{method:"POST",body:JSON.stringify({id:i})})},async getPluginSecrets(i){return ye(`/marketplace/secrets/${encodeURIComponent(i)}`)},async setPluginSecret(i,a,u){return ye(`/marketplace/secrets/${encodeURIComponent(i)}/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify({value:u})})},async unsetPluginSecret(i,a){return ye(`/marketplace/secrets/${encodeURIComponent(i)}/${encodeURIComponent(a)}`,{method:"DELETE"})},connectLogs(i,a){const u=`${ko}/logs/stream`,d=new EventSource(u);return d.addEventListener("log",p=>{try{const m=JSON.parse(p.data);i(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:i=>nt(`/setup/models/${encodeURIComponent(i)}`),validateApiKey:(i,a)=>nt("/setup/validate/api-key",{method:"POST",body:JSON.stringify({provider:i,apiKey:a})}),validateBotToken:i=>nt("/setup/validate/bot-token",{method:"POST",body:JSON.stringify({token:i})}),initWorkspace:i=>nt("/setup/workspace/init",{method:"POST",body:JSON.stringify({agentName:i})}),getWalletStatus:()=>nt("/setup/wallet/status"),generateWallet:()=>nt("/setup/wallet/generate",{method:"POST"}),importWallet:i=>nt("/setup/wallet/import",{method:"POST",body:JSON.stringify({mnemonic:i})}),sendCode:(i,a,u)=>nt("/setup/telegram/send-code",{method:"POST",body:JSON.stringify({apiId:i,apiHash:a,phone:u})}),verifyCode:(i,a)=>nt("/setup/telegram/verify-code",{method:"POST",body:JSON.stringify({authSessionId:i,code:a})}),verifyPassword:(i,a)=>nt("/setup/telegram/verify-password",{method:"POST",body:JSON.stringify({authSessionId:i,password:a})}),resendCode:i=>nt("/setup/telegram/resend-code",{method:"POST",body:JSON.stringify({authSessionId:i})}),saveConfig:i=>nt("/setup/config/save",{method:"POST",body:JSON.stringify(i)}),launch:()=>nt("/setup/launch",{method:"POST"}),pollHealth:async(i=3e4)=>{const a=Date.now(),u=1e3;for(await new Promise(d=>setTimeout(d,1500));Date.now()-a<i;){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 mh(){const i=dr(),a=d=>i.pathname===d,u=async()=>{await hh(),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.jsx("div",{style:{marginTop:"auto",padding:"14px"},children:l.jsx("button",{onClick:u,style:{width:"100%",opacity:.7,fontSize:"13px"},children:"Logout"})})]})}function gh(){return l.jsx(qc,{sidebar:l.jsx(mh,{})})}class Gc extends h.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:i,options:a,labels:u,onChange:d,style:p}){const[m,j]=h.useState(!1),[w,v]=h.useState(-1),k=h.useRef(null),T=h.useRef(null),S=h.useRef(Math.random().toString(36).slice(2));h.useEffect(()=>{if(!m)return;const D=y=>{k.current&&!k.current.contains(y.target)&&j(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[m]),h.useEffect(()=>{if(m){const D=a.indexOf(i);v(D>=0?D:0)}},[m,a,i]),h.useEffect(()=>{if(!m||w<0||!T.current)return;const D=T.current.children[w];D==null||D.scrollIntoView({block:"nearest"})},[m,w]);const I=h.useCallback(D=>{if(!m){(D.key==="Enter"||D.key===" "||D.key==="ArrowDown")&&(D.preventDefault(),j(!0));return}switch(D.key){case"ArrowDown":D.preventDefault(),v(y=>(y+1)%a.length);break;case"ArrowUp":D.preventDefault(),v(y=>(y-1+a.length)%a.length);break;case"Enter":case" ":D.preventDefault(),w>=0&&w<a.length&&(d(a[w]),j(!1));break;case"Escape":D.preventDefault(),j(!1);break;case"Home":D.preventDefault(),v(0);break;case"End":D.preventDefault(),v(a.length-1);break}},[m,w,a,d]),B=`select-menu-${S.current}`;return l.jsxs("div",{ref:k,className:"custom-select",style:p,children:[l.jsxs("button",{type:"button",className:"custom-select-trigger",onClick:()=>j(!m),onKeyDown:I,"aria-haspopup":"listbox","aria-expanded":m,"aria-controls":m?B:void 0,children:[l.jsx("span",{children:u?u[a.indexOf(i)]??i:i}),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:T,id:B,className:"custom-select-menu",role:"listbox","aria-activedescendant":w>=0?`${B}-opt-${w}`:void 0,children:a.map((D,y)=>l.jsx("div",{id:`${B}-opt-${y}`,role:"option","aria-selected":D===i,className:`custom-select-option${D===i?" active":""}${y===w?" focused":""}`,onClick:()=>{d(D),j(!1)},onMouseEnter:()=>v(y),children:u?u[y]??D:D},D))})]})}function yh(){const[i,a]=h.useState(null),[u,d]=h.useState(null),[p,m]=h.useState(null),[j,w]=h.useState(!0),[v,k]=h.useState(null),[T,S]=h.useState(null),[I,B]=h.useState({}),D=h.useCallback(()=>{Promise.all([ie.getStatus(),ie.getMemoryStats(),ie.getConfigKeys(),ie.getToolRag()]).then(([_,U,Y,fe])=>{a(_.data),d(U.data),m(fe.data);const ge={};for(const X of Y.data)X.value!=null&&(ge[X.key]=X.value);B(ge),w(!1)}).catch(_=>{k(_.message),w(!1)})},[]);h.useEffect(()=>{D()},[D]);const y=_=>I[_]??"",P=(_,U)=>{B(Y=>({...Y,[_]:U}))},z=async(_,U)=>{if(U.trim())try{k(null),await ie.setConfigKey(_,U.trim()),await D(),L(`Saved ${_.split(".").pop()}`)}catch(Y){k(Y instanceof Error?Y.message:String(Y))}},$=async _=>{try{const U=await ie.updateToolRag(_);m(U.data),L("Tool RAG updated")}catch(U){k(U instanceof Error?U.message:String(U))}},L=_=>{S(_),setTimeout(()=>S(null),2e3)};return j?l.jsx("div",{className:"loading",children:"Loading..."}):!i||!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"})]}),T&&l.jsx("div",{className:"alert success",style:{marginBottom:"16px"},children:T}),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(i.uptime/60),"m"]})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Model"}),l.jsx("div",{className:"value",style:{fontSize:"14px"},children:i.model})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Sessions"}),l.jsx("div",{className:"value",children:i.sessionCount})]}),l.jsxs("div",{className:"stat-card",children:[l.jsx("h3",{children:"Tools"}),l.jsx("div",{className:"value",children:i.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:_=>z("agent.provider",_)})]}),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("agent.model",_.target.value),onBlur:_=>z("agent.model",_.target.value),onKeyDown:_=>_.key==="Enter"&&z("agent.model",_.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("agent.temperature",_.target.value),onBlur:_=>z("agent.temperature",_.target.value),onKeyDown:_=>_.key==="Enter"&&z("agent.temperature",_.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("agent.max_tokens",_.target.value),onBlur:_=>z("agent.max_tokens",_.target.value),onKeyDown:_=>_.key==="Enter"&&z("agent.max_tokens",_.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("agent.max_agentic_iterations",_.target.value),onBlur:_=>z("agent.max_agentic_iterations",_.target.value),onKeyDown:_=>_.key==="Enter"&&z("agent.max_agentic_iterations",_.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:()=>$({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:_=>$({topK:Number(_)}),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:_=>z("telegram.dm_policy",_)})]}),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:_=>z("telegram.group_policy",_)})]})]}),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:_=>z("telegram.require_mention",String(_.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:_=>z("telegram.typing_simulation",String(_.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("telegram.debounce_ms",_.target.value),onBlur:_=>z("telegram.debounce_ms",_.target.value),onKeyDown:_=>_.key==="Enter"&&z("telegram.debounce_ms",_.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:_=>z("agent.session_reset_policy.daily_reset_enabled",String(_.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},(_,U)=>String(U)),onChange:_=>z("agent.session_reset_policy.daily_reset_hour",_)})]}),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:_=>z("agent.session_reset_policy.idle_expiry_enabled",String(_.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("agent.session_reset_policy.idle_expiry_minutes",_.target.value),onBlur:_=>z("agent.session_reset_policy.idle_expiry_minutes",_.target.value),onKeyDown:_=>_.key==="Enter"&&z("agent.session_reset_policy.idle_expiry_minutes",_.currentTarget.value),style:{width:"100%"}})]})]})]})]})}function Xc({tool:i,updating:a,onToggle:u,onScope:d}){return l.jsxs("div",{className:"tool-row",style:{opacity:i.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:i.name}),l.jsx("div",{className:"tool-desc",children:i.description})]}),l.jsx("div",{className:`scope-seg${!i.enabled||a===i.name?" disabled":""}`,children:["always","dm-only","group-only","admin-only"].map(p=>l.jsx("button",{className:i.scope===p?"active":"",disabled:!i.enabled||a===i.name,onClick:()=>d(i.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:i.enabled,onChange:()=>u(i.name,i.enabled),disabled:a===i.name}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]})}function vh(){const[i,a]=h.useState([]),[u,d]=h.useState(!0),[p,m]=h.useState(null),[j,w]=h.useState(null),[v,k]=h.useState(null),T=()=>(d(!0),ie.getTools().then(z=>{a(z.data),d(!1)}).catch(z=>{m(z instanceof Error?z.message:String(z)),d(!1)}));h.useEffect(()=>{T()},[]);const S=async(z,$)=>{w(z);try{await ie.updateToolConfig(z,{enabled:!$}),await T()}catch(L){m(L instanceof Error?L.message:String(L))}finally{w(null)}},I=async(z,$)=>{w(z);try{await ie.updateToolConfig(z,{scope:$}),await T()}catch(L){m(L instanceof Error?L.message:String(L))}finally{w(null)}},B=async(z,$)=>{w(z.name);try{for(const L of z.tools)L.enabled!==$&&await ie.updateToolConfig(L.name,{enabled:$});await T()}catch(L){m(L instanceof Error?L.message:String(L))}finally{w(null)}},D=async(z,$)=>{w(z.name);try{for(const L of z.tools)L.scope!==$&&await ie.updateToolConfig(L.name,{scope:$});await T()}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=i.filter(z=>!z.isPlugin),P=y.reduce((z,$)=>z+$.toolCount,0);return l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Tools"}),l.jsxs("p",{children:[P," 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),T()},children:"Retry"})]})]}),y.map(z=>{const $=v===z.name,L=z.tools.some(X=>X.enabled),_=z.tools.every(X=>!X.enabled),U=new Set(z.tools.map(X=>X.scope)),Y=U.size>1,fe=Y?"":U.values().next().value??"always",ge=j===z.name;return l.jsxs("div",{className:"card",style:{padding:0},children:[l.jsxs("div",{onClick:()=>k($?null:z.name),className:"accordion-header",children:[l.jsx("span",{className:"accordion-chevron",children:$?"▼":"▶"}),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"]}),_&&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:fe,options:["","always","dm-only","group-only","admin-only"],labels:[Y?"Mixed":"Scope","All","DM only","Group only","Admin only"],onChange:X=>X&&D(z,X),style:{minWidth:"110px"}}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{type:"checkbox",checked:L,onChange:()=>B(z,!L),disabled:ge}),l.jsx("span",{className:"toggle-track"}),l.jsx("span",{className:"toggle-thumb"})]})]})]}),$&&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(Xc,{tool:X,updating:j,onToggle:S,onScope:I},X.name))})})]},z.name)})]})}function xh(){const[i,a]=h.useState("installed"),[u,d]=h.useState([]),[p,m]=h.useState([]),[j,w]=h.useState(!0),[v,k]=h.useState(null),[T,S]=h.useState(null),[I,B]=h.useState([]),[D,y]=h.useState(!1),[P,z]=h.useState(null),[$,L]=h.useState(""),[_,U]=h.useState(""),[Y,fe]=h.useState(null),[ge,X]=h.useState({}),[me,De]=h.useState(!1),[Be,J]=h.useState(null),[oe,V]=h.useState(null),[ae,ue]=h.useState(null),[b,re]=h.useState(null),[G,C]=h.useState(""),O=()=>(w(!0),Promise.all([ie.getPlugins(),ie.getTools()]).then(([H,Q])=>{d(H.data),m(Q.data.filter(K=>K.isPlugin)),w(!1)}).catch(H=>{k(H.message),w(!1)})),de=(H=!1)=>(y(!0),ie.getMarketplace(H).then(Q=>{B(Q.data),y(!1)}).catch(Q=>{k(Q.message),y(!1)}));h.useEffect(()=>{O(),de()},[]);const pe=async(H,Q)=>{S(H);try{await ie.updateToolConfig(H,{enabled:!Q}),await O()}catch(K){k(K instanceof Error?K.message:String(K))}finally{S(null)}},ve=async(H,Q)=>{S(H);try{await ie.updateToolConfig(H,{scope:Q}),await O()}catch(K){k(K instanceof Error?K.message:String(K))}finally{S(null)}},xe=async(H,Q)=>{S(H.name);try{for(const K of H.tools)K.enabled!==Q&&await ie.updateToolConfig(K.name,{enabled:Q});await O()}catch(K){k(K instanceof Error?K.message:String(K))}finally{S(null)}},Ne=async(H,Q)=>{S(H.name);try{for(const K of H.tools)K.scope!==Q&&await ie.updateToolConfig(K.name,{scope:Q});await O()}catch(K){k(K instanceof Error?K.message:String(K))}finally{S(null)}},we=async H=>{const Q=I.find(K=>K.id===H);z(H);try{if(await ie.installPlugin(H),await Promise.all([de(),O()]),Q!=null&&Q.secrets&&Object.keys(Q.secrets).length>0){try{const K=await ie.getPluginSecrets(H),Le=Object.entries(Q.secrets).filter(([,mt])=>mt.required).map(([mt])=>mt);if(Le.every(mt=>K.data.configured.includes(mt))&&Le.length>0)return}catch{}fe({pluginId:H,pluginName:Q.name,secrets:Q.secrets}),X({})}}catch(K){k(K instanceof Error?K.message:String(K))}finally{z(null)}},Ee=async H=>{if(confirm(`Uninstall plugin "${H}"? This will remove its files.`)){z(H);try{await ie.uninstallPlugin(H),await Promise.all([de(),O()])}catch(Q){k(Q instanceof Error?Q.message:String(Q))}finally{z(null)}}},Ze=async H=>{z(H);try{await ie.updatePlugin(H),await Promise.all([de(),O()])}catch(Q){k(Q instanceof Error?Q.message:String(Q))}finally{z(null)}},Rn=async()=>{const H=I.filter(Q=>Q.status==="updatable");for(const Q of H){z(Q.id);try{await ie.updatePlugin(Q.id)}catch(K){k(K instanceof Error?K.message:String(K));break}}z(null),await Promise.all([de(),O()])},nl=async H=>{if(oe===H){V(null),re(null);return}try{const Q=await ie.getPluginSecrets(H);ue(Q.data),V(H),re(null)}catch(Q){k(Q instanceof Error?Q.message:String(Q))}},zn=async(H,Q)=>{if(G.trim())try{await ie.setPluginSecret(H,Q,G.trim()),re(null),C("");const K=await ie.getPluginSecrets(H);ue(K.data)}catch(K){k(K instanceof Error?K.message:String(K))}},fr=async(H,Q)=>{try{await ie.unsetPluginSecret(H,Q);const K=await ie.getPluginSecrets(H);ue(K.data)}catch(K){k(K instanceof Error?K.message:String(K))}},pr=I.filter(H=>{if($){const Q=$.toLowerCase();if(!H.name.toLowerCase().includes(Q)&&!H.description.toLowerCase().includes(Q))return!1}return!(_&&!H.tags.includes(_))}),In=Array.from(new Set(I.flatMap(H=>H.tags))).sort(),Ht=I.filter(H=>H.status==="updatable").length;return j?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),O()},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 ${i==="installed"?"active":""}`,onClick:()=>a("installed"),children:["Installed",l.jsx("span",{className:"tab-count",children:u.length})]}),l.jsxs("button",{className:`tab ${i==="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:$,onChange:H=>L(H.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:_,options:["",...In],labels:["All tags",...In],onChange:H=>U(H),style:{minWidth:"140px"}}),i==="marketplace"&&l.jsxs(l.Fragment,{children:[Ht>0?l.jsx("button",{className:"btn-sm",onClick:Rn,disabled:!!P||D,style:{whiteSpace:"nowrap"},children:P?"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:()=>de(!0),disabled:D,style:{whiteSpace:"nowrap"},children:D?"Refreshing...":"Refresh"})]})]}),i==="installed"&&(()=>{const H=u.filter(Q=>{if($){const K=$.toLowerCase();if(!Q.name.toLowerCase().includes(K)&&!(Q.description??"").toLowerCase().includes(K))return!1}if(_){const K=I.find(Le=>Le.name===Q.name);if(!K||!K.tags.includes(_))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"})]}):H.length===0?l.jsx("div",{className:"card",style:{textAlign:"center",padding:"20px",color:"var(--text-secondary)"},children:"No installed plugins match your search"}):H.map(Q=>{const K=p.find(ke=>ke.name===Q.name),Le=I.find(ke=>ke.name===Q.name),On=(Le==null?void 0:Le.secrets)&&Object.keys(Le.secrets).length>0,mt=Be===Q.name,hr=K?K.tools.some(ke=>ke.enabled):!1,rl=K?K.tools.every(ke=>!ke.enabled):!0,mr=K?new Set(K.tools.map(ke=>ke.scope)):new Set,Dn=mr.size>1,Mn=Dn?"":mr.values().next().value??"always",ll=T===Q.name;return l.jsxs("div",{className:"card",style:{padding:0},children:[l.jsxs("div",{onClick:()=>J(mt?null:Q.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:Q.name}),K&&l.jsxs("span",{className:"badge count",children:[K.toolCount," tools"]}),l.jsxs("span",{style:{fontSize:"12px",color:"var(--text-tertiary)"},children:["v",Q.version]}),rl&&K&&K.tools.length>0&&l.jsx("span",{className:"badge warn",children:"Disabled"})]}),Q.description&&l.jsx("p",{style:{fontSize:"12px",color:"var(--text-secondary)",margin:"4px 0 0"},children:Q.description})]}),K&&K.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(K,ke),style:{minWidth:"110px"}}),l.jsxs("label",{className:"toggle",children:[l.jsx("input",{type:"checkbox",checked:hr,onChange:()=>xe(K,!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:[K&&K.tools.length>0&&l.jsx("div",{style:{display:"grid",gap:"6px"},children:K.tools.map(ke=>l.jsx(Xc,{tool:ke,updating:T,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:oe===Le.id?"Hide Secrets":"Manage Secrets"}),oe===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:b===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)})})]})]})]},Q.name)})})})(),Y&&l.jsx("div",{className:"modal-overlay",onClick:()=>!me&&fe(null),children:l.jsxs("div",{className:"modal",onClick:H=>H.stopPropagation(),children:[l.jsxs("h2",{style:{marginBottom:"4px"},children:["Configure ",Y.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(Y.secrets).map(([H,Q])=>l.jsxs("div",{style:{marginBottom:"12px"},children:[l.jsxs("label",{style:{display:"block",fontSize:"13px",fontWeight:600,marginBottom:"4px"},children:[H," ",Q.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:Q.description}),Q.env&&l.jsxs("code",{style:{display:"block",fontSize:"11px",color:"var(--text-tertiary)",opacity:.7,marginBottom:"6px"},children:["Env: ",Q.env]}),l.jsx("input",{type:"password",placeholder:`Enter ${H}...`,value:ge[H]||"",onChange:K=>X(Le=>({...Le,[H]:K.target.value})),style:{width:"100%"}})]},H)),l.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end",marginTop:"16px"},children:[l.jsx("button",{className:"btn-ghost",onClick:()=>fe(null),children:"Skip"}),l.jsx("button",{className:"btn-sm",disabled:me,onClick:async()=>{De(!0);try{for(const[H,Q]of Object.entries(ge))Q.trim()&&await ie.setPluginSecret(Y.pluginId,H,Q.trim());fe(null)}catch(H){k(H instanceof Error?H.message:String(H))}finally{De(!1)}},children:me?"Saving...":"Save"})]})]})}),i==="marketplace"&&l.jsx(l.Fragment,{children:D&&I.length===0?l.jsx("div",{className:"loading",children:"Loading marketplace..."}):pr.length===0?l.jsx("div",{className:"empty",children:$||_?"No plugins match your search":"Marketplace is empty"}):l.jsx("div",{style:{display:"grid",gap:"10px"},children:pr.map(H=>l.jsx(Sh,{plugin:H,operating:P,onInstall:we,onUninstall:Ee,onUpdate:Ze},H.id))})})]})}function Sh({plugin:i,operating:a,onInstall:u,onUninstall:d,onUpdate:p}){const m=a===i.id,j=!!a,w=i.secrets&&Object.values(i.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:i.name}),i.status==="installed"&&l.jsx("span",{className:"badge always",style:{fontSize:"10px"},children:"Installed"}),i.status==="updatable"&&l.jsx("span",{className:"badge warn",style:{fontSize:"10px"},children:"Update available"}),w&&i.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:i.description}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[i.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 ",i.author," · v",i.remoteVersion," · ",i.toolCount," tools"]})]})]}),l.jsxs("div",{style:{flexShrink:0,display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"},children:[i.status==="available"&&l.jsx("button",{className:"btn-sm",onClick:()=>u(i.id),disabled:j,children:m?"Installing...":"Install"}),i.status==="installed"&&l.jsx("button",{className:"btn-danger btn-sm",onClick:()=>d(i.id),disabled:j,children:m?"Removing...":"Uninstall"}),i.status==="updatable"&&l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"btn-sm",onClick:()=>p(i.id),disabled:j,children:m?"Updating...":`Update to v${i.remoteVersion}`}),l.jsx("button",{className:"btn-danger btn-sm",onClick:()=>d(i.id),disabled:j,children:"Uninstall"})]})]})]})})}const Pc=["SOUL.md","SECURITY.md","STRATEGY.md","MEMORY.md"];function jh(){const[i,a]=h.useState(Pc[0]),[u,d]=h.useState(""),[p,m]=h.useState(""),[j,w]=h.useState(!1),[v,k]=h.useState(!1),[T,S]=h.useState(null),I=u!==p,B=h.useCallback(async P=>{w(!0),S(null);try{const z=await ie.getSoulFile(P);d(z.data.content),m(z.data.content)}catch(z){S({type:"error",text:z instanceof Error?z.message:String(z)})}finally{w(!1)}},[]),D=async()=>{k(!0),S(null);try{const P=await ie.updateSoulFile(i,u);m(u),S({type:"success",text:P.data.message})}catch(P){S({type:"error",text:P instanceof Error?P.message:String(P)})}finally{k(!1)}};h.useEffect(()=>{const P=z=>{I&&z.preventDefault()};return window.addEventListener("beforeunload",P),()=>window.removeEventListener("beforeunload",P)},[I]);const y=P=>{P!==i&&(I&&!window.confirm("You have unsaved changes. Discard them?")||a(P))};return h.useEffect(()=>{B(i)},[i,B]),l.jsxs("div",{children:[l.jsxs("div",{className:"header",children:[l.jsx("h1",{children:"Soul Editor"}),l.jsx("p",{children:"Edit system prompt files"})]}),T&&l.jsx("div",{className:`alert ${T.type}`,children:T.text}),l.jsxs("div",{className:"card",children:[l.jsx("div",{className:"tabs",children:Pc.map(P=>l.jsxs("button",{className:`tab ${i===P?"active":""}`,onClick:()=>y(P),children:[P,i===P&&I?" *":""]},P))}),j?l.jsx("div",{className:"loading",children:"Loading..."}):l.jsxs(l.Fragment,{children:[l.jsx("textarea",{value:u,onChange:P=>d(P.target.value),placeholder:`Edit ${i}...`}),l.jsxs("div",{style:{marginTop:"14px",display:"flex",alignItems:"center",gap:"10px"},children:[l.jsx("button",{onClick:D,disabled:v||!I,children:v?"Saving...":"Save"}),I&&l.jsx("span",{style:{color:"var(--text-secondary)",fontSize:"13px"},children:"Unsaved changes"})]})]})]})]})}function wh(){const[i,a]=h.useState(""),[u,d]=h.useState([]),[p,m]=h.useState(!1),[j,w]=h.useState(null),[v,k]=h.useState(!1),T=async()=>{if(i.trim()){m(!0),w(null);try{const S=await ie.searchKnowledge(i);d(S.data),k(!0)}catch(S){w(S instanceof Error?S.message:String(S))}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:i,onChange:S=>a(S.target.value),onKeyDown:S=>S.key==="Enter"&&T(),placeholder:"Enter search query...",style:{flex:1}}),l.jsx("button",{onClick:T,disabled:p,children:p?"Searching...":"Search"})]})]}),j&&l.jsx("div",{className:"alert error",children:j}),v&&u.length===0&&!j&&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((S,I)=>{var B;return l.jsxs("div",{className:"result-item",children:[l.jsxs("div",{className:"result-meta",children:[S.source," · Score: ",((B=S.score)==null?void 0:B.toFixed(3))??"—"]}),l.jsx("div",{className:"result-text",children:S.text})]},S.id||I)})]})]})]})}const Tc=2e3,co=1e3,kh=3e4;class Ch{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",co);Dt(this,"shouldReconnect",!1)}connect(){this.disconnect||(this.shouldReconnect=!0,this.reconnectDelay=co,this.doConnect())}doConnect(){this.disconnect||(this.disconnect=ie.connectLogs(a=>{this.logs.push(a),this.logs.length>Tc&&(this.logs=this.logs.slice(-Tc)),this._connected=!0,this.reconnectDelay=co,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,kh))}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 Ch;function Nh(){const i=h.useSyncExternalStore(d=>Tn.subscribe(d),()=>Tn.getLogs()),a=h.useSyncExternalStore(d=>Tn.subscribe(d),()=>Tn.isConnected()),u=h.useRef(null);return h.useEffect(()=>{Tn.connect()},[]),h.useEffect(()=>{var d;(d=u.current)==null||d.scrollIntoView({behavior:"smooth"})},[i]),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:[i.length===0?l.jsx("div",{className:"empty",children:"Waiting for logs..."}):i.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 Lc(i){return i===0?"—":i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:`${(i/(1024*1024)).toFixed(1)} MB`}function Eh(i){return new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function _h(){const[i,a]=h.useState(""),[u,d]=h.useState([]),[p,m]=h.useState(null),[j,w]=h.useState(!0),[v,k]=h.useState(null),[T,S]=h.useState(null),[I,B]=h.useState(""),[D,y]=h.useState(!1),[P,z]=h.useState(!1),[$,L]=h.useState(null),[_,U]=h.useState(""),Y=h.useCallback(async V=>{w(!0),k(null);try{const ae=await ie.workspaceList(V);d(ae.data??[]),a(V)}catch(ae){k(ae instanceof Error?ae.message:String(ae))}finally{w(!1)}},[]),fe=h.useCallback(async()=>{try{const V=await ie.workspaceInfo();m(V.data??null)}catch{}},[]);h.useEffect(()=>{Y(""),fe()},[Y,fe]);const ge=V=>{De()&&Y(V)},X=i?i.split("/"):[],me=async V=>{var ae;try{k(null);const ue=await ie.workspaceRead(V);S(V),B(((ae=ue.data)==null?void 0:ae.content)??""),y(!1)}catch(ue){k(ue instanceof Error?ue.message:String(ue))}},De=()=>D&&!confirm("You have unsaved changes. Discard?")?!1:(S(null),B(""),y(!1),!0),Be=async()=>{if(T){z(!0);try{await ie.workspaceWrite(T,I),y(!1),Y(i)}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 ie.workspaceDelete(V.path,V.isDirectory),T===V.path&&(S(null),B(""),y(!1)),Y(i),fe()}catch(ue){k(ue instanceof Error?ue.message:String(ue))}},oe=async()=>{const V=_.trim();if(!V||!$)return;const ae=i?`${i}/${V}`:V;try{if($.type==="newFile")await ie.workspaceWrite(ae,"");else if($.type==="newFolder")await ie.workspaceMkdir(ae);else if($.type==="rename"&&$.target){const ue=i?`${i}/${V}`:V;await ie.workspaceRename($.target,ue),T===$.target&&(S(null),B(""),y(!1))}L(null),U(""),Y(i),fe()}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 · ",Lc(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:i?"normal":"bold",color:"var(--accent)"},children:"workspace"}),X.map((V,ae)=>{const ue=X.slice(0,ae+1).join("/"),b=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:()=>!b&&ge(ue),style:{cursor:b?"default":"pointer",fontWeight:b?"bold":"normal",color:b?"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"}),U("")},children:"+ File"}),l.jsx("button",{style:{padding:"3px 10px",fontSize:"12px"},onClick:()=>{L({type:"newFolder"}),U("")},children:"+ Folder"})]})]}),$&&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:$.type==="newFile"?"New file:":$.type==="newFolder"?"New folder:":"Rename to:"}),l.jsx("input",{type:"text",value:_,onChange:V=>U(V.target.value),onKeyDown:V=>V.key==="Enter"&&oe(),placeholder:"name...",autoFocus:!0,style:{flex:1,padding:"4px 8px",fontSize:"13px"}}),l.jsx("button",{style:{padding:"4px 10px",fontSize:"12px"},onClick:oe,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:j?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:[i&&l.jsxs("tr",{onClick:()=>{const V=i.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?"":Lc(V.size)}),l.jsx("td",{style:{textAlign:"right",padding:"6px 14px",color:"var(--text-secondary)"},children:Eh(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}),U(V.name)},title:"Rename",children:"✎"}),l.jsx("button",{className:"icon-button",onClick:()=>J(V),title:"Delete",children:"🗑"})]})]},V.path))]})]})}),T&&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:[T,D&&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:Be,disabled:P||!D,children:P?"Saving...":"Save"}),l.jsx("button",{style:{padding:"4px 12px",fontSize:"12px",opacity:.7},onClick:De,children:"Close"})]})]}),l.jsx("textarea",{value:I,onChange:V=>{B(V.target.value),y(!0)},onKeyDown:V=>{(V.ctrlKey||V.metaKey)&&V.key==="s"&&(V.preventDefault(),Be())},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 Zc={pending:"#f0ad4e",in_progress:"#5bc0de",done:"#5cb85c",failed:"#d9534f",cancelled:"#777"},go={pending:"Pending",in_progress:"Running",done:"Done",failed:"Failed",cancelled:"Cancelled"};function Rc({status:i}){return l.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"10px",fontSize:"11px",fontWeight:600,color:"#fff",backgroundColor:Zc[i]},children:go[i]})}function ar(i){return i?new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function Ph({priority:i}){if(i===0)return l.jsx("span",{style:{color:"var(--text-secondary)",fontSize:"11px"},children:"—"});const a=Math.min(i,10);return l.jsxs("span",{title:`Priority: ${i}/10`,style:{fontSize:"11px",letterSpacing:"1px"},children:["●".repeat(Math.min(a,5)),"○".repeat(Math.max(0,5-a))]})}function fo(i,a){return i?i.length>a?i.slice(0,a)+"...":i:""}function Th(){const[i,a]=h.useState([]),[u,d]=h.useState(!0),[p,m]=h.useState(null),[j,w]=h.useState(""),[v,k]=h.useState(null),T=h.useCallback(async()=>{d(!0),m(null);try{const P=(await ie.tasksList()).data??[];a(P),k(z=>z?P.find($=>$.id===z.id)??null:null)}catch(y){m(y instanceof Error?y.message:String(y))}finally{d(!1)}},[]);h.useEffect(()=>{T()},[T]);const S=async y=>{if(confirm("Cancel this task?"))try{await ie.tasksCancel(y),T(),(v==null?void 0:v.id)===y&&k(null)}catch(P){m(P instanceof Error?P.message:String(P))}},I=async y=>{if(confirm("Permanently delete this task?"))try{await ie.tasksDelete(y),T(),(v==null?void 0:v.id)===y&&k(null)}catch(P){m(P instanceof Error?P.message:String(P))}},B=i.reduce((y,P)=>(y[P.status]=(y[P.status]||0)+1,y),{}),D=j?i.filter(y=>y.status===j):i;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:j===""?"bold":"normal",color:j===""?"var(--text)":"var(--text-secondary)",fontSize:"13px"},children:["All (",i.length,")"]}),["pending","in_progress","done","failed","cancelled"].map(y=>l.jsxs("span",{onClick:()=>w(j===y?"":y),style:{cursor:"pointer",fontWeight:j===y?"bold":"normal",color:j===y?Zc[y]:"var(--text-secondary)",fontSize:"13px"},children:[go[y]," (",B[y]||0,")"]},y)),(B.done||0)>0&&l.jsxs("button",{style:{marginLeft:"auto",padding:"4px 12px",fontSize:"12px",opacity:.7},onClick:async()=>{if(confirm(`Delete all ${B.done} done tasks?`))try{await ie.tasksCleanDone(),m(null),T(),k(null)}catch(y){m(y instanceof Error?y.message:String(y))}},children:["Clean done (",B.done,")"]}),l.jsx("button",{style:{marginLeft:B.done?void 0:"auto",padding:"4px 12px",fontSize:"12px",opacity:.7},onClick:T,children:"Refresh"})]}),l.jsx("div",{className:"card",style:{padding:0},children:u?l.jsx("div",{style:{padding:"20px",textAlign:"center"},children:"Loading..."}):D.length===0?l.jsx("div",{style:{padding:"20px",textAlign:"center",color:"var(--text-secondary)"},children:j?`No ${go[j].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:D.map(y=>{const P=(v==null?void 0:v.id)===y.id;return l.jsxs(Dc.Fragment,{children:[l.jsxs("tr",{onClick:()=>k(P?null:y),style:{cursor:"pointer",borderBottom:P?"none":"1px solid var(--separator)",backgroundColor:P?"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:P?"▼":"▶"}),fo(y.description,80)]}),y.reason&&l.jsx("div",{style:{fontSize:"11px",color:"var(--text-secondary)",marginTop:"2px",paddingLeft:"14px"},children:fo(y.reason,60)})]}),l.jsx("td",{style:{textAlign:"center",padding:"8px 10px"},children:l.jsx(Rc,{status:y.status})}),l.jsx("td",{style:{textAlign:"center",padding:"8px 10px"},children:l.jsx(Ph,{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:()=>S(y.id),title:"Cancel",children:"✖"}),l.jsx("button",{className:"icon-button",onClick:()=>I(y.id),title:"Delete",children:"🗑"})]})]}),P&&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(Rc,{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:fo(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 Lh(){const[i,a]=h.useState([]),[u,d]=h.useState(!0),[p,m]=h.useState(null),[j,w]=h.useState(new Set),[v,k]=h.useState(!1),[T,S]=h.useState(""),[I,B]=h.useState(""),[D,y]=h.useState(""),[P,z]=h.useState([]),[$,L]=h.useState(!1),[_,U]=h.useState(null),[Y,fe]=h.useState(null),ge=(J=!1)=>{J&&d(!0),ie.getMcpServers().then(oe=>{a(oe.data),d(!1)}).catch(oe=>{m(oe instanceof Error?oe.message:String(oe)),d(!1)})};h.useEffect(()=>{ge(!0)},[]);const X=J=>{w(oe=>{const V=new Set(oe);return V.has(J)?V.delete(J):V.add(J),V})},me=async()=>{if(T.trim()){L(!0),m(null);try{const J=I.trim()?I.trim().split(/\s+/):void 0,oe=T.startsWith("http://")||T.startsWith("https://"),V={};for(const ue of P)ue.key.trim()&&(V[ue.key.trim()]=ue.value);const ae=await ie.addMcpServer({...oe?{url:T.trim()}:{package:T.trim()},name:D.trim()||void 0,args:oe?void 0:J,env:Object.keys(V).length>0?V:void 0});fe(ae.data.message),S(""),B(""),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}"?`)){U(J),m(null);try{const oe=await ie.removeMcpServer(J);fe(oe.data.message),ge()}catch(oe){m(oe instanceof Error?oe.message:String(oe))}finally{U(null)}}};if(u)return l.jsx("div",{className:"loading",children:"Loading..."});const Be=i.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"})]}),Y&&l.jsxs("div",{className:"alert success",style:{marginBottom:"14px"},children:[Y,l.jsx("button",{onClick:()=>fe(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:T,onChange:J=>S(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=>B(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:D,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([...P,{key:"",value:"",id:crypto.randomUUID()}]),style:{fontSize:"11px",padding:"1px 6px",opacity:.7},children:"+ Add"})]}),P.map((J,oe)=>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=[...P];ae[oe]={...ae[oe],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=[...P];ae[oe]={...ae[oe],value:V.target.value},z(ae)},placeholder:"sk-xxx...",style:{fontSize:"12px",fontFamily:"monospace"}}),l.jsx("button",{type:"button",onClick:()=>z(P.filter((V,ae)=>ae!==oe)),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:$||!T.trim(),style:{fontSize:"13px"},children:$?"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."})]}),i.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"})]})]}),i.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{fontSize:"13px",color:"var(--text-secondary)",marginBottom:"14px"},children:[Be,"/",i.length," connected · ",i.reduce((J,oe)=>J+oe.toolCount,0)," tools total"]}),i.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:_===J.name,style:{fontSize:"11px",padding:"2px 8px",opacity:.6,cursor:_===J.name?"wait":"pointer"},children:_===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(oe=>l.jsxs("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"3px",background:"var(--surface)",color:"var(--text-secondary)",fontFamily:"monospace"},children:[oe,"=••••"]},oe))}),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:[j.has(J.name)?"▾":"▸"," ",J.toolCount," tools"]}),j.has(J.name)&&l.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",marginTop:"8px"},children:J.tools.map(oe=>l.jsx("span",{style:{fontSize:"11px",padding:"2px 6px",borderRadius:"3px",background:"var(--surface)",color:"var(--text-secondary)"},children:oe},oe))})]})]},J.name))]})]})}const Rh=["API Keys","Agent","Telegram","Embedding","WebUI","Deals","Developer"];function zh(i){const a=new Map;for(const d of i){const p=d.category||"Other";a.has(p)||a.set(p,[]),a.get(p).push(d)}const u=new Map;for(const d of Rh)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 Ih(){const[i,a]=h.useState([]),[u,d]=h.useState(!0),[p,m]=h.useState(null),[j,w]=h.useState(null),[v,k]=h.useState(null),[T,S]=h.useState(""),[I,B]=h.useState(!1),D=(_=!1)=>{_&&d(!0),ie.getConfigKeys().then(U=>{a(U.data),d(!1)}).catch(U=>{m(U instanceof Error?U.message:String(U)),d(!1)})};h.useEffect(()=>{D(!0)},[]);const y=_=>{var U;k(_.key),_.type==="boolean"?S(_.set&&_.value!==null?_.value:"true"):_.type==="enum"&&((U=_.options)!=null&&U.length)?S(_.set&&_.value!==null?_.value:_.options[0]):S("")},P=async _=>{const U=i.find(fe=>fe.key===_);if(!(!((U==null?void 0:U.type)==="boolean"||(U==null?void 0:U.type)==="enum")&&!T.trim())){B(!0),m(null),w(null);try{await ie.setConfigKey(_,T.trim()),k(null),S(""),w(`${_} updated successfully`),D()}catch(fe){m(fe instanceof Error?fe.message:String(fe))}finally{B(!1)}}},z=async _=>{B(!0),m(null),w(null);try{await ie.unsetConfigKey(_),w(`${_} removed`),D()}catch(U){m(U instanceof Error?U.message:String(U))}finally{B(!1)}},$=()=>{k(null),S("")};if(u)return l.jsx("div",{className:"loading",children:"Loading..."});const L=zh(i);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"})]}),j&&l.jsxs("div",{className:"alert success",style:{marginBottom:"14px"},children:[j,l.jsx("button",{onClick:()=>w(null),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},children:"Dismiss"})]}),Array.from(L.entries()).map(([_,U])=>l.jsxs("div",{className:"card",style:{marginBottom:"10px"},children:[l.jsx("h2",{style:{marginBottom:"8px"},children:_}),U.map((Y,fe)=>l.jsxs("div",{style:{padding:"12px 0",borderBottom:fe<U.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:Y.key}),l.jsx("span",{style:{marginLeft:"10px",fontSize:"11px",padding:"2px 8px",borderRadius:"4px",background:Y.set?"var(--accent)":"var(--surface)",color:Y.set?"var(--text-on-accent)":"var(--text-secondary)"},children:Y.set?"Set":"Not set"}),Y.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(Y),style:{padding:"4px 12px",fontSize:"12px"},disabled:I,children:"Edit"}),Y.set&&l.jsx("button",{onClick:()=>z(Y.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:Y.description}),Y.set&&Y.value&&v!==Y.key&&l.jsx("div",{style:{marginTop:"6px",fontSize:"13px",color:"var(--text-secondary)",fontFamily:"monospace"},children:Y.value}),v===Y.key&&l.jsxs("div",{className:"form-group",style:{marginTop:"10px",marginBottom:0},children:[Y.type==="boolean"?l.jsx(ht,{value:T,options:["true","false"],onChange:S,style:{width:"100%",marginBottom:"8px"}}):Y.type==="enum"&&Y.options?l.jsx(ht,{value:T,options:Y.options,onChange:S,style:{width:"100%",marginBottom:"8px"}}):l.jsx("input",{type:Y.type==="number"?"number":Y.sensitive?"password":"text",value:T,onChange:ge=>S(ge.target.value),onKeyDown:ge=>ge.key==="Enter"&&P(Y.key),placeholder:`Enter value for ${Y.key}...`,autoFocus:!0,style:{width:"100%",marginBottom:"8px"}}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[l.jsx("button",{onClick:()=>P(Y.key),disabled:I||Y.type!=="boolean"&&Y.type!=="enum"&&!T.trim(),children:I?"Saving...":"Save"}),l.jsx("button",{onClick:$,style:{opacity:.7},disabled:I,children:"Cancel"})]})]})]},Y.key))]},_))]})}function Oh({data:i,onChange:a}){const[u,d]=h.useState(null),[p,m]=h.useState(!0),[j,w]=h.useState(""),[v,k]=h.useState(!1);h.useEffect(()=>{Xe.getStatus().then(S=>d(S)).catch(S=>w(S instanceof Error?S.message:String(S))).finally(()=>m(!1))},[]);const T=async S=>{if(a({...i,riskAccepted:S}),S&&!v)try{await Xe.initWorkspace(i.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("div",{className:"form-group",children:[l.jsx("label",{children:"Agent Name"}),l.jsx("input",{type:"text",value:i.agentName,onChange:S=>a({...i,agentName:S.target.value}),placeholder:"Nova",className:"w-full"}),l.jsx("div",{className:"helper-text",children:"Your agent's display name in conversations."})]}),l.jsx("div",{className:"info-box",style:{marginBottom:"16px"},children:l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[l.jsxs("div",{children:[l.jsx("strong",{children:"1."})," Connect an LLM provider (Anthropic, OpenAI, etc.)"]}),l.jsxs("div",{children:[l.jsx("strong",{children:"2."})," Link your Telegram account"]}),l.jsxs("div",{children:[l.jsx("strong",{children:"3."})," Set up a TON wallet for crypto operations"]}),l.jsxs("div",{children:[l.jsx("strong",{children:"4."})," Configure behavior and optional modules"]})]})}),l.jsxs("div",{className:"warning-card",children:[l.jsx("strong",{children:"IMPORTANT SECURITY NOTICE"}),l.jsx("br",{}),l.jsx("br",{}),"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."})]}),(u==null?void 0:u.configExists)&&l.jsx("div",{className:"info-box",children:"Existing configuration detected. It will be overwritten when setup completes."}),j&&l.jsx("div",{className:"alert error",children:j}),l.jsx("div",{className:"form-group",children:l.jsxs("label",{className:"label-inline",children:[l.jsx("input",{type:"checkbox",checked:i.riskAccepted,onChange:S=>T(S.target.checked)}),l.jsx("span",{children:"I understand the risks and accept full responsibility"})]})}),p&&l.jsx("div",{className:"loading",children:"Checking workspace..."})]})}function Dh({data:i,onChange:a}){const[u,d]=h.useState([]),[p,m]=h.useState(!0),[j,w]=h.useState(""),[v,k]=h.useState(null),[T,S]=h.useState(""),[I,B]=h.useState(!1),D=h.useRef(null);h.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===i.provider),P=L=>{a({...i,provider:L,apiKey:"",model:"",customModel:""}),k(null),S(""),D.current&&clearTimeout(D.current)},z=async(L,_)=>{if(!(!_||!L)){B(!0);try{const U=await Xe.validateApiKey(L,_);k(U.valid),S(U.error||"")}catch{k(null),S("")}finally{B(!1)}}},$=L=>{a({...i,apiKey:L}),k(null),S(""),D.current&&clearTimeout(D.current),L.length>0&&i.provider&&(D.current=setTimeout(()=>z(i.provider,L),500))};return p?l.jsx("div",{className:"loading",children:"Loading providers..."}):j?l.jsx("div",{className:"alert error",children:j}):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${i.provider===L.id?" selected":""}`,onClick:()=>P(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:i.apiKey,onChange:L=>$(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&&T&&l.jsx("div",{className:"helper-text error",children:T}),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:i.cocoonPort,onChange:L=>a({...i,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:i.localUrl,onChange:L=>a({...i,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 Mh({data:i,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:i.apiId||"",onChange:u=>a({...i,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:i.apiHash,onChange:u=>a({...i,apiHash:u.target.value}),placeholder:"abcdef0123456789abcdef0123456789",className:"w-full"}),i.apiHash.length>0&&i.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:i.phone,onChange:u=>a({...i,phone:u.target.value}),placeholder:"+33612345678",className:"w-full"}),i.phone.length>0&&!i.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:i.userId||"",onChange:u=>a({...i,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 Ah({data:i,onChange:a}){const[u,d]=h.useState([]),[p,m]=h.useState(!1),[j,w]=h.useState(!1),[v,k]=h.useState(null),[T,S]=h.useState(!1),[I,B]=h.useState(""),D=async()=>{if(i.botToken){w(!0),B(""),k(null),S(!1);try{const L=await Xe.validateBotToken(i.botToken);L.valid&&L.bot?(k(!0),a({...i,botUsername:L.bot.username})):L.networkError?S(!0):(k(!1),B(L.error||"Invalid bot token"))}catch(L){B(L instanceof Error?L.message:String(L))}finally{w(!1)}}};h.useEffect(()=>{i.provider==="cocoon"||i.provider==="local"||!i.provider||(m(!0),Xe.getModels(i.provider).then(L=>{d(L),!i.model&&L.length>0&&a({...i,model:L[0].value})}).catch(()=>d([])).finally(()=>m(!1)))},[i.provider]);const y=["open","allowlist","disabled"],P=["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."},$={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."}),i.provider==="cocoon"||i.provider==="local"?l.jsxs("div",{className:"info-panel",children:["Model is auto-discovered from the ",i.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:i.model,options:u.map(L=>L.value),labels:u.map(L=>L.isCustom?"Custom...":`${L.name} - ${L.description}`),onChange:L=>a({...i,model:L}),style:{width:"100%"}}),i.model==="__custom__"&&l.jsx("input",{type:"text",value:i.customModel,onChange:L=>a({...i,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:i.dmPolicy,options:y,labels:P,onChange:L=>a({...i,dmPolicy:L}),style:{width:"100%"}}),l.jsx("div",{className:"helper-text",children:z[i.dmPolicy]||""})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Group Policy"}),l.jsx(ht,{value:i.groupPolicy,options:y,labels:P,onChange:L=>a({...i,groupPolicy:L}),style:{width:"100%"}}),l.jsx("div",{className:"helper-text",children:$[i.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:i.requireMention,onChange:L=>a({...i,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:i.maxIterations,onChange:L=>a({...i,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 Integrations"}),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:"(optional)"})]}),l.jsx("input",{type:"password",value:i.botToken,onChange:L=>{a({...i,botToken:L.target.value,botUsername:""}),k(null),S(!1),B("")},placeholder:"123456:ABC-DEF...",style:{flex:1}}),l.jsx("button",{onClick:D,disabled:j||!i.botToken,type:"button",children:j?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Validating"]}):"Validate"})]}),v&&i.botUsername&&l.jsxs("div",{className:"alert success",children:["Bot verified: @",i.botUsername]}),T&&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:i.botUsername,onChange:L=>a({...i,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:i.tonapiKey,onChange:L=>a({...i,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:i.tavilyKey,onChange:L=>a({...i,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 zc({text:i}){const[a,u]=h.useState(!1),d=h.useCallback(()=>{navigator.clipboard.writeText(i).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)})},[i]);return l.jsx("button",{type:"button",className:"btn-ghost btn-sm",onClick:d,style:{marginLeft:"8px"},children:a?"Copied":"Copy"})}function Fh({data:i,onChange:a}){const[u,d]=h.useState(null),[p,m]=h.useState(!0),[j,w]=h.useState(!1),[v,k]=h.useState(""),[T,S]=h.useState([]);h.useEffect(()=>{Xe.getWalletStatus().then(y=>{d(y),y.exists&&y.address&&a({...i,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(i.walletAction==="import"){const y=i.mnemonic.trim().split(/\s+/);if(y.length!==24){k("Mnemonic must be exactly 24 words."),w(!1);return}const P=await Xe.importWallet(i.mnemonic.trim());a({...i,walletAddress:P.address}),S(y)}else{const y=await Xe.generateWallet();a({...i,walletAddress:y.address}),S(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 B=T.length>0,D=i.walletAction!=="keep"&&!B;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&&!B&&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})]}),!B&&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:i.walletAction===y,onChange:()=>{a({...i,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))}),i.walletAction==="import"&&!B&&l.jsxs("div",{className:"form-group",children:[l.jsx("label",{children:"Recovery Phrase (24 words)"}),l.jsx("textarea",{value:i.mnemonic,onChange:y=>a({...i,mnemonic:y.target.value}),placeholder:"word1 word2 word3 ... word24",className:"w-full mono",style:{minHeight:"80px"}})]}),D&&i.walletAction!=="keep"&&l.jsx("button",{onClick:I,disabled:j||i.walletAction==="import"&&i.mnemonic.trim().split(/\s+/).length!==24,type:"button",children:j?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Working..."]}):i.walletAction==="generate"?"Generate Wallet":"Import Wallet"}),B&&l.jsxs(l.Fragment,{children:[i.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:i.walletAddress}),l.jsx(zc,{text:i.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:T.map((y,P)=>l.jsxs("li",{className:"mnemonic-word",children:[l.jsxs("span",{className:"num",children:[P+1,"."]}),y]},P))}),l.jsx("div",{className:"form-row",style:{justifyContent:"flex-end",marginBottom:"8px"},children:l.jsx(zc,{text:T.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:i.mnemonicSaved,onChange:y=>a({...i,mnemonicSaved:y.target.checked})}),l.jsx("span",{style:{fontWeight:500},children:"I have saved my recovery phrase"})]})})]})]})}const Uh="modulepreload",Bh=function(i){return"/"+i},Ic={},tl=function(a,u,d){let p=Promise.resolve();if(u&&u.length>0){let j=function(k){return Promise.all(k.map(T=>Promise.resolve(T).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};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=j(u.map(k=>{if(k=Bh(k),k in Ic)return;Ic[k]=!0;const T=k.endsWith(".css"),S=T?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${k}"]${S}`))return;const I=document.createElement("link");if(I.rel=T?"stylesheet":Uh,T||(I.as="script"),I.crossOrigin="",I.href=k,v&&I.setAttribute("nonce",v),document.head.appendChild(I),T)return new Promise((B,D)=>{I.addEventListener("load",B),I.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${k}`)))})}))}function m(j){const w=new Event("vite:preloadError",{cancelable:!0});if(w.payload=j,window.dispatchEvent(w),!w.defaultPrevented)throw j}return p.then(j=>{for(const w of j||[])w.status==="rejected"&&m(w.reason);return a().catch(m)})},Wh=h.lazy(()=>tl(()=>import("./index.es-oXiZF7Hc.js"),[])),$h=()=>tl(()=>import("./run-DOrDowjK.js"),[]).then(i=>i.default),Vh=()=>tl(()=>import("./login-telegram-BP7CJDmx.js"),[]).then(i=>i.default);function Oc({loader:i,size:a}){const[u,d]=h.useState(null);return h.useEffect(()=>{i().then(d)},[]),u?l.jsx(h.Suspense,{fallback:l.jsx("div",{style:{width:a,height:a,margin:"0 auto 16px"}}),children:l.jsx(Wh,{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 bh({data:i,onChange:a}){const[u,d]=h.useState("idle"),[p,m]=h.useState(!1),[j,w]=h.useState(""),[v,k]=h.useState(""),[T,S]=h.useState(""),[I,B]=h.useState(""),[D,y]=h.useState(!1),[P,z]=h.useState(!1),[$,L]=h.useState(0),_=h.useRef(null);h.useEffect(()=>{if(!($<=0))return _.current=setInterval(()=>{L(X=>X<=1?(_.current&&clearInterval(_.current),0):X-1)},1e3),()=>{_.current&&clearInterval(_.current)}},[$>0]),h.useEffect(()=>{if(u!=="code_sent")return;const X=setTimeout(()=>z(!0),3e4);return()=>clearTimeout(X)},[u]),h.useEffect(()=>{i.telegramUser&&d("done")},[]);const U=async()=>{var X;m(!0),w("");try{const me=await Xe.sendCode(i.apiId,i.apiHash,i.phone);a({...i,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 Be=parseInt(((X=De.match(/(\d+)/))==null?void 0:X[1])||"60");L(Be)}w(De)}finally{m(!1)}},Y=async X=>{if(k(X),!(X.length<5)){m(!0),w("");try{const me=await Xe.verifyCode(i.authSessionId,X);me.status==="authenticated"&&me.user?(a({...i,telegramUser:me.user,skipConnect:!1}),d("done")):me.status==="2fa_required"&&(B(me.passwordHint||""),d("2fa"))}catch(me){const De=me instanceof Error?me.message:String(me);w(De)}finally{m(!1)}}},fe=async()=>{m(!0),w("");try{const X=await Xe.verifyPassword(i.authSessionId,T);X.status==="authenticated"&&X.user&&(a({...i,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(i.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."}),j&&l.jsx("div",{className:"alert error",children:j}),u==="idle"&&l.jsxs("div",{className:"text-center",style:{padding:"20px 0"},children:[l.jsx(Oc,{loader:$h,size:200}),l.jsx("button",{onClick:U,disabled:p||$>0,type:"button",className:"btn-lg",children:p?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Connecting..."]}):$>0?`Wait ${$}s`:"Connect to Telegram"})]}),u==="code_sent"&&l.jsxs("div",{className:"text-center",style:{padding:"20px 0"},children:[l.jsx(Oc,{loader:Vh,size:180}),l.jsxs("div",{className:"text-muted",style:{marginBottom:"16px"},children:["Code sent via ",D?"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);Y(me)},placeholder:"12345",maxLength:5,autoFocus:!0,disabled:p})}),p&&l.jsxs("div",{className:"text-muted",children:[l.jsx("span",{className:"spinner sm"})," Verifying..."]}),P&&!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:T,onChange:X=>S(X.target.value),onKeyDown:X=>X.key==="Enter"&&fe(),placeholder:"Enter your 2FA password",className:"w-full",autoFocus:!0})]}),l.jsx("button",{onClick:fe,disabled:p||!T,type:"button",children:p?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Verifying..."]}):"Submit"})]}),u==="done"&&i.telegramUser&&l.jsxs("div",{className:"alert success text-center",style:{padding:"20px"},children:["Connected as ",l.jsx("strong",{children:i.telegramUser.firstName}),i.telegramUser.username&&l.jsxs(l.Fragment,{children:[" (@",i.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"}],Kh={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 Hh(i,a){switch(i){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 ed=h.createContext(null);function Co(){const i=h.useContext(ed);if(!i)throw new Error("useSetup must be used inside SetupProvider");return i}function Qh({children:i}){const[a,u]=h.useState(0),[d,p]=h.useState(Kh),[m,j]=h.useState(!1),[w,v]=h.useState(""),[k,T]=h.useState(!1),[S,I]=h.useState(!1),[B,D]=h.useState(""),y=Hh(a,d),P=h.useCallback(()=>{y&&u(U=>Math.min(U+1,Ln.length-1))},[y]),z=h.useCallback(()=>{u(U=>Math.max(U-1,0))},[]),$=h.useCallback(async()=>{j(!0),v("");try{const U=d.model==="__custom__"?d.customModel:d.model||void 0,Y={agent:{provider:d.provider,...d.provider!=="cocoon"&&d.provider!=="local"&&d.apiKey?{api_key:d.apiKey}:{},...d.provider==="local"?{base_url:d.localUrl}:{},...U?{model:U}:{},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(Y),T(!0)}catch(U){v(U instanceof Error?U.message:String(U))}finally{j(!1)}},[d]),L=h.useCallback(async()=>{I(!0),D("");try{const{token:U}=await Xe.launch();await Xe.pollHealth(3e4),window.location.href=`/auth/exchange?token=${encodeURIComponent(U)}`}catch(U){D(U instanceof Error?U.message:String(U))}finally{I(!1)}},[]),_=h.useRef($);return _.current=$,h.useEffect(()=>{a===Ln.length-1&&d.telegramUser&&!k&&!m&&_.current()},[a,d.telegramUser,k,m]),l.jsx(ed.Provider,{value:{step:a,data:d,loading:m,error:w,saved:k,launching:S,launchError:B,canAdvance:y,setData:p,next:P,prev:z,handleSave:$,handleLaunch:L},children:i})}const Yh=h.lazy(()=>tl(()=>import("./index.es-oXiZF7Hc.js"),[])),Jh=()=>tl(()=>import("./complete-fZLnb5Ot.js"),[]).then(i=>i.default);function qh(){const[i,a]=h.useState(null);h.useEffect(()=>{Jh().then(a)},[]);const u=200;return i?l.jsx(h.Suspense,{fallback:l.jsx("div",{style:{width:u,height:u,margin:"0 auto 24px"}}),children:l.jsx(Yh,{animationData:i,loop:!0,style:{width:u,height:u,margin:"0 auto 24px"}})}):l.jsx("div",{style:{width:u,height:u,margin:"0 auto 24px"}})}function Gh(){const{launching:i,launchError:a,handleLaunch:u}=Co();return l.jsxs("div",{className:"step-content text-center",style:{paddingTop:"40px"},children:[l.jsx(qh,{}),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:i,className:"btn-lg",style:{minWidth:"200px"},children:i?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"spinner sm"})," Starting..."]}):"Start Agent"}),i&&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 Xh=[Oh,Dh,Mh,Ah,Fh,bh];function Zh(){const{step:i,data:a,loading:u,error:d,saved:p,canAdvance:m,setData:j,next:w,prev:v,handleSave:k}=Co();if(p)return l.jsx(Gh,{});const T=Xh[i],S=i<Ln.length-1?Ln[i+1].label:"";return l.jsxs(l.Fragment,{children:[l.jsx(T,{data:a,onChange:j}),d&&l.jsx("div",{className:"alert error",children:d}),l.jsxs("div",{className:"setup-nav",children:[i>0&&l.jsx("button",{className:"btn-ghost",onClick:v,type:"button",children:"Back"}),l.jsx("div",{style:{flex:1}}),i<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: ${S}`})]})]})}function em(){const{step:i}=Co();return l.jsx("div",{className:"step-indicator",children:Ln.map((a,u)=>{const d=u<i,p=u===i;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 tm=[{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 nm(){return l.jsx("nav",{children:tm.map(i=>l.jsx("span",{className:"sidebar-link-disabled",children:i.label},i.path))})}function rm(){return l.jsxs(l.Fragment,{children:[l.jsx(em,{}),l.jsx(Qc,{})]})}function lm(){return l.jsx(Qh,{children:l.jsx(qc,{sidebar:l.jsx(nm,{}),children:l.jsx(rm,{})})})}function sm(){return window.location.pathname.startsWith("/setup")?l.jsx(Jc,{children:l.jsx(Gc,{children:l.jsx(Yc,{children:l.jsx(rt,{path:"/setup",element:l.jsx(lm,{}),children:l.jsx(rt,{index:!0,element:l.jsx(Zh,{})})})})})}):l.jsx(im,{})}function im(){const[i,a]=h.useState(!1),[u,d]=h.useState(!0),[p,m]=h.useState(""),[j,w]=h.useState("");h.useEffect(()=>{const T=new URLSearchParams(window.location.search).get("token");if(window.location.pathname==="/auth/exchange"&&T){_c(T).then(S=>{S?window.location.href="/":(d(!1),w("Token exchange failed"))});return}ph().then(S=>{a(S),d(!1)})},[]),h.useEffect(()=>{i&&Tn.connect()},[i]);const v=async()=>{const k=p.trim();if(!k)return;w(""),await _c(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..."})})}):i?l.jsx(Jc,{children:l.jsx(Gc,{children:l.jsx(Yc,{children:l.jsxs(rt,{path:"/",element:l.jsx(gh,{}),children:[l.jsx(rt,{index:!0,element:l.jsx(yh,{})}),l.jsx(rt,{path:"tools",element:l.jsx(vh,{})}),l.jsx(rt,{path:"plugins",element:l.jsx(xh,{})}),l.jsx(rt,{path:"soul",element:l.jsx(jh,{})}),l.jsx(rt,{path:"memory",element:l.jsx(wh,{})}),l.jsx(rt,{path:"logs",element:l.jsx(Nh,{})}),l.jsx(rt,{path:"workspace",element:l.jsx(_h,{})}),l.jsx(rt,{path:"tasks",element:l.jsx(Th,{})}),l.jsx(rt,{path:"mcp",element:l.jsx(Lh,{})}),l.jsx(rt,{path:"config",element:l.jsx(Ih,{})}),l.jsx(rt,{path:"*",element:l.jsx(nh,{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%"}})]}),j&&l.jsx("div",{className:"alert error",style:{marginBottom:"1rem"},children:j}),l.jsx("button",{onClick:v,style:{width:"100%"},children:"Sign In"})]})})}up.createRoot(document.getElementById("root")).render(l.jsx(h.StrictMode,{children:l.jsx(sm,{})}));export{Dc as R,ep as g,h as r};
|