(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))o(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(u){if(u.ep)return;u.ep=!0;const d=s(u);fetch(u.href,d)}})();function Zi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var vu={exports:{}},$r={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var zh;function Qb(){if(zh)return $r;zh=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(o,u,d){var f=null;if(d!==void 0&&(f=""+d),u.key!==void 0&&(f=""+u.key),"key"in u){d={};for(var x in u)x!=="key"&&(d[x]=u[x])}else d=u;return u=d.ref,{$$typeof:n,type:o,key:f,ref:u!==void 0?u:null,props:d}}return $r.Fragment=r,$r.jsx=s,$r.jsxs=s,$r}var Oh;function Xb(){return Oh||(Oh=1,vu.exports=Qb()),vu.exports}var a=Xb(),ju={exports:{}},je={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Dh;function Fb(){if(Dh)return je;Dh=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function j(_){return _===null||typeof _!="object"?null:(_=v&&_[v]||_["@@iterator"],typeof _=="function"?_:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,S={};function T(_,F,w){this.props=_,this.context=F,this.refs=S,this.updater=w||k}T.prototype.isReactComponent={},T.prototype.setState=function(_,F){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,F,"setState")},T.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function V(){}V.prototype=T.prototype;function H(_,F,w){this.props=_,this.context=F,this.refs=S,this.updater=w||k}var I=H.prototype=new V;I.constructor=H,R(I,T.prototype),I.isPureReactComponent=!0;var z=Array.isArray;function U(){}var $={H:null,A:null,T:null,S:null},fe=Object.prototype.hasOwnProperty;function J(_,F,w){var oe=w.ref;return{$$typeof:n,type:_,key:F,ref:oe!==void 0?oe:null,props:w}}function M(_,F){return J(_.type,F,_.props)}function ne(_){return typeof _=="object"&&_!==null&&_.$$typeof===n}function re(_){var F={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(w){return F[w]})}var Z=/\/+/g;function Q(_,F){return typeof _=="object"&&_!==null&&_.key!=null?re(""+_.key):F.toString(36)}function ee(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(U,U):(_.status="pending",_.then(function(F){_.status==="pending"&&(_.status="fulfilled",_.value=F)},function(F){_.status==="pending"&&(_.status="rejected",_.reason=F)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function A(_,F,w,oe,xe){var pe=typeof _;(pe==="undefined"||pe==="boolean")&&(_=null);var Ee=!1;if(_===null)Ee=!0;else switch(pe){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(_.$$typeof){case n:case r:Ee=!0;break;case y:return Ee=_._init,A(Ee(_._payload),F,w,oe,xe)}}if(Ee)return xe=xe(_),Ee=oe===""?"."+Q(_,0):oe,z(xe)?(w="",Ee!=null&&(w=Ee.replace(Z,"$&/")+"/"),A(xe,F,w,"",function(Xt){return Xt})):xe!=null&&(ne(xe)&&(xe=M(xe,w+(xe.key==null||_&&_.key===xe.key?"":(""+xe.key).replace(Z,"$&/")+"/")+Ee)),F.push(xe)),1;Ee=0;var Pe=oe===""?".":oe+":";if(z(_))for(var Ye=0;Ye<_.length;Ye++)oe=_[Ye],pe=Pe+Q(oe,Ye),Ee+=A(oe,F,w,pe,xe);else if(Ye=j(_),typeof Ye=="function")for(_=Ye.call(_),Ye=0;!(oe=_.next()).done;)oe=oe.value,pe=Pe+Q(oe,Ye++),Ee+=A(oe,F,w,pe,xe);else if(pe==="object"){if(typeof _.then=="function")return A(ee(_),F,w,oe,xe);throw F=String(_),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function O(_,F,w){if(_==null)return _;var oe=[],xe=0;return A(_,oe,"","",function(pe){return F.call(w,pe,xe++)}),oe}function le(_){if(_._status===-1){var F=_._result;F=F(),F.then(function(w){(_._status===0||_._status===-1)&&(_._status=1,_._result=w)},function(w){(_._status===0||_._status===-1)&&(_._status=2,_._result=w)}),_._status===-1&&(_._status=0,_._result=F)}if(_._status===1)return _._result.default;throw _._result}var ie=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},C={map:O,forEach:function(_,F,w){O(_,function(){F.apply(this,arguments)},w)},count:function(_){var F=0;return O(_,function(){F++}),F},toArray:function(_){return O(_,function(F){return F})||[]},only:function(_){if(!ne(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return je.Activity=g,je.Children=C,je.Component=T,je.Fragment=s,je.Profiler=u,je.PureComponent=H,je.StrictMode=o,je.Suspense=p,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,je.__COMPILER_RUNTIME={__proto__:null,c:function(_){return $.H.useMemoCache(_)}},je.cache=function(_){return function(){return _.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(_,F,w){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var oe=R({},_.props),xe=_.key;if(F!=null)for(pe in F.key!==void 0&&(xe=""+F.key),F)!fe.call(F,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&F.ref===void 0||(oe[pe]=F[pe]);var pe=arguments.length-2;if(pe===1)oe.children=w;else if(1<pe){for(var Ee=Array(pe),Pe=0;Pe<pe;Pe++)Ee[Pe]=arguments[Pe+2];oe.children=Ee}return J(_.type,xe,oe)},je.createContext=function(_){return _={$$typeof:f,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:d,_context:_},_},je.createElement=function(_,F,w){var oe,xe={},pe=null;if(F!=null)for(oe in F.key!==void 0&&(pe=""+F.key),F)fe.call(F,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(xe[oe]=F[oe]);var Ee=arguments.length-2;if(Ee===1)xe.children=w;else if(1<Ee){for(var Pe=Array(Ee),Ye=0;Ye<Ee;Ye++)Pe[Ye]=arguments[Ye+2];xe.children=Pe}if(_&&_.defaultProps)for(oe in Ee=_.defaultProps,Ee)xe[oe]===void 0&&(xe[oe]=Ee[oe]);return J(_,pe,xe)},je.createRef=function(){return{current:null}},je.forwardRef=function(_){return{$$typeof:x,render:_}},je.isValidElement=ne,je.lazy=function(_){return{$$typeof:y,_payload:{_status:-1,_result:_},_init:le}},je.memo=function(_,F){return{$$typeof:h,type:_,compare:F===void 0?null:F}},je.startTransition=function(_){var F=$.T,w={};$.T=w;try{var oe=_(),xe=$.S;xe!==null&&xe(w,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(U,ie)}catch(pe){ie(pe)}finally{F!==null&&w.types!==null&&(F.types=w.types),$.T=F}},je.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},je.use=function(_){return $.H.use(_)},je.useActionState=function(_,F,w){return $.H.useActionState(_,F,w)},je.useCallback=function(_,F){return $.H.useCallback(_,F)},je.useContext=function(_){return $.H.useContext(_)},je.useDebugValue=function(){},je.useDeferredValue=function(_,F){return $.H.useDeferredValue(_,F)},je.useEffect=function(_,F){return $.H.useEffect(_,F)},je.useEffectEvent=function(_){return $.H.useEffectEvent(_)},je.useId=function(){return $.H.useId()},je.useImperativeHandle=function(_,F,w){return $.H.useImperativeHandle(_,F,w)},je.useInsertionEffect=function(_,F){return $.H.useInsertionEffect(_,F)},je.useLayoutEffect=function(_,F){return $.H.useLayoutEffect(_,F)},je.useMemo=function(_,F){return $.H.useMemo(_,F)},je.useOptimistic=function(_,F){return $.H.useOptimistic(_,F)},je.useReducer=function(_,F,w){return $.H.useReducer(_,F,w)},je.useRef=function(_){return $.H.useRef(_)},je.useState=function(_){return $.H.useState(_)},je.useSyncExternalStore=function(_,F,w){return $.H.useSyncExternalStore(_,F,w)},je.useTransition=function(){return $.H.useTransition()},je.version="19.2.4",je}var Rh;function od(){return Rh||(Rh=1,ju.exports=Fb()),ju.exports}var D=od();const Jr=Zi(D);var Nu={exports:{}},Qr={},wu={exports:{}},ku={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Lh;function Zb(){return Lh||(Lh=1,(function(n){function r(A,O){var le=A.length;A.push(O);e:for(;0<le;){var ie=le-1>>>1,C=A[ie];if(0<u(C,O))A[ie]=O,A[le]=C,le=ie;else break e}}function s(A){return A.length===0?null:A[0]}function o(A){if(A.length===0)return null;var O=A[0],le=A.pop();if(le!==O){A[0]=le;e:for(var ie=0,C=A.length,_=C>>>1;ie<_;){var F=2*(ie+1)-1,w=A[F],oe=F+1,xe=A[oe];if(0>u(w,le))oe<C&&0>u(xe,w)?(A[ie]=xe,A[oe]=le,ie=oe):(A[ie]=w,A[F]=le,ie=F);else if(oe<C&&0>u(xe,le))A[ie]=xe,A[oe]=le,ie=oe;else break e}}return O}function u(A,O){var le=A.sortIndex-O.sortIndex;return le!==0?le:A.id-O.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,x=f.now();n.unstable_now=function(){return f.now()-x}}var p=[],h=[],y=1,g=null,v=3,j=!1,k=!1,R=!1,S=!1,T=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function I(A){for(var O=s(h);O!==null;){if(O.callback===null)o(h);else if(O.startTime<=A)o(h),O.sortIndex=O.expirationTime,r(p,O);else break;O=s(h)}}function z(A){if(R=!1,I(A),!k)if(s(p)!==null)k=!0,U||(U=!0,re());else{var O=s(h);O!==null&&ee(z,O.startTime-A)}}var U=!1,$=-1,fe=5,J=-1;function M(){return S?!0:!(n.unstable_now()-J<fe)}function ne(){if(S=!1,U){var A=n.unstable_now();J=A;var O=!0;try{e:{k=!1,R&&(R=!1,V($),$=-1),j=!0;var le=v;try{t:{for(I(A),g=s(p);g!==null&&!(g.expirationTime>A&&M());){var ie=g.callback;if(typeof ie=="function"){g.callback=null,v=g.priorityLevel;var C=ie(g.expirationTime<=A);if(A=n.unstable_now(),typeof C=="function"){g.callback=C,I(A),O=!0;break t}g===s(p)&&o(p),I(A)}else o(p);g=s(p)}if(g!==null)O=!0;else{var _=s(h);_!==null&&ee(z,_.startTime-A),O=!1}}break e}finally{g=null,v=le,j=!1}O=void 0}}finally{O?re():U=!1}}}var re;if(typeof H=="function")re=function(){H(ne)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,Q=Z.port2;Z.port1.onmessage=ne,re=function(){Q.postMessage(null)}}else re=function(){T(ne,0)};function ee(A,O){$=T(function(){A(n.unstable_now())},O)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):fe=0<A?Math.floor(1e3/A):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(A){switch(v){case 1:case 2:case 3:var O=3;break;default:O=v}var le=v;v=O;try{return A()}finally{v=le}},n.unstable_requestPaint=function(){S=!0},n.unstable_runWithPriority=function(A,O){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var le=v;v=A;try{return O()}finally{v=le}},n.unstable_scheduleCallback=function(A,O,le){var ie=n.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?ie+le:ie):le=ie,A){case 1:var C=-1;break;case 2:C=250;break;case 5:C=1073741823;break;case 4:C=1e4;break;default:C=5e3}return C=le+C,A={id:y++,callback:O,priorityLevel:A,startTime:le,expirationTime:C,sortIndex:-1},le>ie?(A.sortIndex=le,r(h,A),s(p)===null&&A===s(h)&&(R?(V($),$=-1):R=!0,ee(z,le-ie))):(A.sortIndex=C,r(p,A),k||j||(k=!0,U||(U=!0,re()))),A},n.unstable_shouldYield=M,n.unstable_wrapCallback=function(A){var O=v;return function(){var le=v;v=O;try{return A.apply(this,arguments)}finally{v=le}}}})(ku)),ku}var Uh;function Kb(){return Uh||(Uh=1,wu.exports=Zb()),wu.exports}var Su={exports:{}},yt={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Hh;function Ib(){if(Hh)return yt;Hh=1;var n=od();function r(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var o={d:{f:s,r:function(){throw Error(r(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},u=Symbol.for("react.portal");function d(p,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:g==null?null:""+g,children:p,containerInfo:h,implementation:y}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,yt.createPortal=function(p,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return d(p,h,null,y)},yt.flushSync=function(p){var h=f.T,y=o.p;try{if(f.T=null,o.p=2,p)return p()}finally{f.T=h,o.p=y,o.d.f()}},yt.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(p,h))},yt.prefetchDNS=function(p){typeof p=="string"&&o.d.D(p)},yt.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var y=h.as,g=x(y,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,j=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?o.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:j}):y==="script"&&o.d.X(p,{crossOrigin:g,integrity:v,fetchPriority:j,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},yt.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=x(h.as,h.crossOrigin);o.d.M(p,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(p)},yt.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=x(y,h.crossOrigin);o.d.L(p,y,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},yt.preloadModule=function(p,h){if(typeof p=="string")if(h){var y=x(h.as,h.crossOrigin);o.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(p)},yt.requestFormReset=function(p){o.d.r(p)},yt.unstable_batchedUpdates=function(p,h){return p(h)},yt.useFormState=function(p,h,y){return f.H.useFormState(p,h,y)},yt.useFormStatus=function(){return f.H.useHostTransitionStatus()},yt.version="19.2.4",yt}var Bh;function Jb(){if(Bh)return Su.exports;Bh=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Su.exports=Ib(),Su.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var qh;function Pb(){if(qh)return Qr;qh=1;var n=Kb(),r=od(),s=Jb();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function f(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 x(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(d(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(o(188));return t!==e?null:e}for(var l=e,i=t;;){var c=l.return;if(c===null)break;var m=c.alternate;if(m===null){if(i=c.return,i!==null){l=i;continue}break}if(c.child===m.child){for(m=c.child;m;){if(m===l)return p(c),e;if(m===i)return p(c),t;m=m.sibling}throw Error(o(188))}if(l.return!==i.return)l=c,i=m;else{for(var b=!1,N=c.child;N;){if(N===l){b=!0,l=c,i=m;break}if(N===i){b=!0,i=c,l=m;break}N=N.sibling}if(!b){for(N=m.child;N;){if(N===l){b=!0,l=m,i=c;break}if(N===i){b=!0,i=m,l=c;break}N=N.sibling}if(!b)throw Error(o(189))}}if(l.alternate!==i)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),H=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=ne&&e[ne]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case T:return"Profiler";case S:return"StrictMode";case z:return"Suspense";case U:return"SuspenseList";case J:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case H:return e.displayName||"Context";case V:return(e._context.displayName||"Context")+".Consumer";case I:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return t=e.displayName||null,t!==null?t:Q(e.type)||"Memo";case fe:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}var ee=Array.isArray,A=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ie=[],C=-1;function _(e){return{current:e}}function F(e){0>C||(e.current=ie[C],ie[C]=null,C--)}function w(e,t){C++,ie[C]=e.current,e.current=t}var oe=_(null),xe=_(null),pe=_(null),Ee=_(null);function Pe(e,t){switch(w(pe,t),w(xe,e),w(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?th(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=th(t),e=nh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}F(oe),w(oe,e)}function Ye(){F(oe),F(xe),F(pe)}function Xt(e){e.memoizedState!==null&&w(Ee,e);var t=oe.current,l=nh(t,e.type);t!==l&&(w(xe,e),w(oe,l))}function Nn(e){xe.current===e&&(F(oe),F(xe)),Ee.current===e&&(F(Ee),qr._currentValue=le)}var Ja,xs;function wn(e){if(Ja===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Ja=t&&t[1]||"",xs=-1<l.stack.indexOf(`
    at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Ja+e+xs}var Zl=!1;function Kl(e,t){if(!e||Zl)return"";Zl=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(X){var G=X}Reflect.construct(e,[],te)}else{try{te.call()}catch(X){G=X}e.call(te.prototype)}}else{try{throw Error()}catch(X){G=X}(te=e())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(X){if(X&&G&&typeof X.stack=="string")return[X.stack,G.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=i.DetermineComponentFrameRoot(),b=m[0],N=m[1];if(b&&N){var E=b.split(`
`),Y=N.split(`
`);for(c=i=0;i<E.length&&!E[i].includes("DetermineComponentFrameRoot");)i++;for(;c<Y.length&&!Y[c].includes("DetermineComponentFrameRoot");)c++;if(i===E.length||c===Y.length)for(i=E.length-1,c=Y.length-1;1<=i&&0<=c&&E[i]!==Y[c];)c--;for(;1<=i&&0<=c;i--,c--)if(E[i]!==Y[c]){if(i!==1||c!==1)do if(i--,c--,0>c||E[i]!==Y[c]){var K=`
`+E[i].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=i&&0<=c);break}}}finally{Zl=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?wn(l):""}function ps(e,t){switch(e.tag){case 26:case 27:case 5:return wn(e.type);case 16:return wn("Lazy");case 13:return e.child!==t&&t!==null?wn("Suspense Fallback"):wn("Suspense");case 19:return wn("SuspenseList");case 0:case 15:return Kl(e.type,!1);case 11:return Kl(e.type.render,!1);case 1:return Kl(e.type,!0);case 31:return wn("Activity");default:return""}}function gs(e){try{var t="",l=null;do t+=ps(e,l),l=e,e=e.return;while(e);return t}catch(i){return`
Error generating stack: `+i.message+`
`+i.stack}}var Il=Object.prototype.hasOwnProperty,Jl=n.unstable_scheduleCallback,Pa=n.unstable_cancelCallback,ao=n.unstable_shouldYield,ro=n.unstable_requestPaint,jt=n.unstable_now,so=n.unstable_getCurrentPriorityLevel,P=n.unstable_ImmediatePriority,ce=n.unstable_UserBlockingPriority,ve=n.unstable_NormalPriority,Se=n.unstable_LowPriority,Ue=n.unstable_IdlePriority,Rt=n.log,kn=n.unstable_setDisableYieldValue,Nt=null,ct=null;function St(e){if(typeof Rt=="function"&&kn(e),ct&&typeof ct.setStrictMode=="function")try{ct.setStrictMode(Nt,e)}catch{}}var Xe=Math.clz32?Math.clz32:Mg,Qn=Math.log,sn=Math.LN2;function Mg(e){return e>>>=0,e===0?32:31-(Qn(e)/sn|0)|0}var ys=256,bs=262144,vs=4194304;function jl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function js(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var c=0,m=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var N=i&134217727;return N!==0?(i=N&~m,i!==0?c=jl(i):(b&=N,b!==0?c=jl(b):l||(l=N&~e,l!==0&&(c=jl(l))))):(N=i&~m,N!==0?c=jl(N):b!==0?c=jl(b):l||(l=i&~e,l!==0&&(c=jl(l)))),c===0?0:t!==0&&t!==c&&(t&m)===0&&(m=c&-c,l=t&-t,m>=l||m===32&&(l&4194048)!==0)?t:c}function Wa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function zg(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rd(){var e=vs;return vs<<=1,(vs&62914560)===0&&(vs=4194304),e}function io(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function er(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Og(e,t,l,i,c,m){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var N=e.entanglements,E=e.expirationTimes,Y=e.hiddenUpdates;for(l=b&~l;0<l;){var K=31-Xe(l),te=1<<K;N[K]=0,E[K]=-1;var G=Y[K];if(G!==null)for(Y[K]=null,K=0;K<G.length;K++){var X=G[K];X!==null&&(X.lane&=-536870913)}l&=~te}i!==0&&Ld(e,i,0),m!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=m&~(b&~t))}function Ld(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Xe(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|l&261930}function Ud(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var i=31-Xe(l),c=1<<i;c&t|e[i]&t&&(e[i]|=t),l&=~c}}function Hd(e,t){var l=t&-t;return l=(l&42)!==0?1:oo(l),(l&(e.suspendedLanes|t))!==0?0:l}function oo(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function co(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Bd(){var e=O.p;return e!==0?e:(e=window.event,e===void 0?32:Sh(e.type))}function qd(e,t){var l=O.p;try{return O.p=e,t()}finally{O.p=l}}var Xn=Math.random().toString(36).slice(2),mt="__reactFiber$"+Xn,Ct="__reactProps$"+Xn,Pl="__reactContainer$"+Xn,uo="__reactEvents$"+Xn,Dg="__reactListeners$"+Xn,Rg="__reactHandles$"+Xn,Yd="__reactResources$"+Xn,tr="__reactMarker$"+Xn;function fo(e){delete e[mt],delete e[Ct],delete e[uo],delete e[Dg],delete e[Rg]}function Wl(e){var t=e[mt];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Pl]||l[mt]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=ch(e);e!==null;){if(l=e[mt])return l;e=ch(e)}return t}e=l,l=e.parentNode}return null}function ea(e){if(e=e[mt]||e[Pl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function nr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function ta(e){var t=e[Yd];return t||(t=e[Yd]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function dt(e){e[tr]=!0}var Vd=new Set,Gd={};function Nl(e,t){na(e,t),na(e+"Capture",t)}function na(e,t){for(Gd[e]=t,e=0;e<t.length;e++)Vd.add(t[e])}var Lg=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),$d={},Qd={};function Ug(e){return Il.call(Qd,e)?!0:Il.call($d,e)?!1:Lg.test(e)?Qd[e]=!0:($d[e]=!0,!1)}function Ns(e,t,l){if(Ug(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function ws(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Sn(e,t,l,i){if(i===null)e.removeAttribute(l);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+i)}}function Ft(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hg(e,t,l){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var c=i.get,m=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function mo(e){if(!e._valueTracker){var t=Xd(e)?"checked":"value";e._valueTracker=Hg(e,t,""+e[t])}}function Fd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),i="";return e&&(i=Xd(e)?e.checked?"true":"false":e.value),e=i,e!==l?(t.setValue(e),!0):!1}function ks(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Bg=/[\n"\\]/g;function Zt(e){return e.replace(Bg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ho(e,t,l,i,c,m,b,N){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ft(t)):e.value!==""+Ft(t)&&(e.value=""+Ft(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?xo(e,b,Ft(t)):l!=null?xo(e,b,Ft(l)):i!=null&&e.removeAttribute("value"),c==null&&m!=null&&(e.defaultChecked=!!m),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+Ft(N):e.removeAttribute("name")}function Zd(e,t,l,i,c,m,b,N){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),t!=null||l!=null){if(!(m!=="submit"&&m!=="reset"||t!=null)){mo(e);return}l=l!=null?""+Ft(l):"",t=t!=null?""+Ft(t):l,N||t===e.value||(e.value=t),e.defaultValue=t}i=i??c,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=N?e.checked:!!i,e.defaultChecked=!!i,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),mo(e)}function xo(e,t,l){t==="number"&&ks(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function la(e,t,l,i){if(e=e.options,t){t={};for(var c=0;c<l.length;c++)t["$"+l[c]]=!0;for(l=0;l<e.length;l++)c=t.hasOwnProperty("$"+e[l].value),e[l].selected!==c&&(e[l].selected=c),c&&i&&(e[l].defaultSelected=!0)}else{for(l=""+Ft(l),t=null,c=0;c<e.length;c++){if(e[c].value===l){e[c].selected=!0,i&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Kd(e,t,l){if(t!=null&&(t=""+Ft(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Ft(l):""}function Id(e,t,l,i){if(t==null){if(i!=null){if(l!=null)throw Error(o(92));if(ee(i)){if(1<i.length)throw Error(o(93));i=i[0]}l=i}l==null&&(l=""),t=l}l=Ft(t),e.defaultValue=l,i=e.textContent,i===l&&i!==""&&i!==null&&(e.value=i),mo(e)}function aa(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var qg=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Jd(e,t,l){var i=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,l):typeof l!="number"||l===0||qg.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Pd(e,t,l){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,l!=null){for(var i in l)!l.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var c in t)i=t[c],t.hasOwnProperty(c)&&l[c]!==i&&Jd(e,c,i)}else for(var m in t)t.hasOwnProperty(m)&&Jd(e,m,t[m])}function po(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Yg=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Vg=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ss(e){return Vg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Cn(){}var go=null;function yo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ra=null,sa=null;function Wd(e){var t=ea(e);if(t&&(e=t.stateNode)){var l=e[Ct]||null;e:switch(e=t.stateNode,t.type){case"input":if(ho(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Zt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var i=l[t];if(i!==e&&i.form===e.form){var c=i[Ct]||null;if(!c)throw Error(o(90));ho(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<l.length;t++)i=l[t],i.form===e.form&&Fd(i)}break e;case"textarea":Kd(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&la(e,!!l.multiple,t,!1)}}}var bo=!1;function ef(e,t,l){if(bo)return e(t,l);bo=!0;try{var i=e(t);return i}finally{if(bo=!1,(ra!==null||sa!==null)&&(fi(),ra&&(t=ra,e=sa,sa=ra=null,Wd(t),e)))for(t=0;t<e.length;t++)Wd(e[t])}}function lr(e,t){var l=e.stateNode;if(l===null)return null;var i=l[Ct]||null;if(i===null)return null;l=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(o(231,t,typeof l));return l}var _n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vo=!1;if(_n)try{var ar={};Object.defineProperty(ar,"passive",{get:function(){vo=!0}}),window.addEventListener("test",ar,ar),window.removeEventListener("test",ar,ar)}catch{vo=!1}var Fn=null,jo=null,Cs=null;function tf(){if(Cs)return Cs;var e,t=jo,l=t.length,i,c="value"in Fn?Fn.value:Fn.textContent,m=c.length;for(e=0;e<l&&t[e]===c[e];e++);var b=l-e;for(i=1;i<=b&&t[l-i]===c[m-i];i++);return Cs=c.slice(e,1<i?1-i:void 0)}function _s(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 Ts(){return!0}function nf(){return!1}function _t(e){function t(l,i,c,m,b){this._reactName=l,this._targetInst=c,this.type=i,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(l=e[N],this[N]=l?l(m):m[N]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Ts:nf,this.isPropagationStopped=nf,this}return g(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ts)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ts)},persist:function(){},isPersistent:Ts}),t}var wl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Es=_t(wl),rr=g({},wl,{view:0,detail:0}),Gg=_t(rr),No,wo,sr,As=g({},rr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:So,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!==sr&&(sr&&e.type==="mousemove"?(No=e.screenX-sr.screenX,wo=e.screenY-sr.screenY):wo=No=0,sr=e),No)},movementY:function(e){return"movementY"in e?e.movementY:wo}}),lf=_t(As),$g=g({},As,{dataTransfer:0}),Qg=_t($g),Xg=g({},rr,{relatedTarget:0}),ko=_t(Xg),Fg=g({},wl,{animationName:0,elapsedTime:0,pseudoElement:0}),Zg=_t(Fg),Kg=g({},wl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ig=_t(Kg),Jg=g({},wl,{data:0}),af=_t(Jg),Pg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Wg={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"},ey={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ty(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ey[e])?!!t[e]:!1}function So(){return ty}var ny=g({},rr,{key:function(e){if(e.key){var t=Pg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=_s(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Wg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:So,charCode:function(e){return e.type==="keypress"?_s(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_s(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ly=_t(ny),ay=g({},As,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rf=_t(ay),ry=g({},rr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:So}),sy=_t(ry),iy=g({},wl,{propertyName:0,elapsedTime:0,pseudoElement:0}),oy=_t(iy),cy=g({},As,{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}),uy=_t(cy),dy=g({},wl,{newState:0,oldState:0}),fy=_t(dy),my=[9,13,27,32],Co=_n&&"CompositionEvent"in window,ir=null;_n&&"documentMode"in document&&(ir=document.documentMode);var hy=_n&&"TextEvent"in window&&!ir,sf=_n&&(!Co||ir&&8<ir&&11>=ir),of=" ",cf=!1;function uf(e,t){switch(e){case"keyup":return my.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function df(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ia=!1;function xy(e,t){switch(e){case"compositionend":return df(t);case"keypress":return t.which!==32?null:(cf=!0,of);case"textInput":return e=t.data,e===of&&cf?null:e;default:return null}}function py(e,t){if(ia)return e==="compositionend"||!Co&&uf(e,t)?(e=tf(),Cs=jo=Fn=null,ia=!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 sf&&t.locale!=="ko"?null:t.data;default:return null}}var gy={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 ff(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!gy[e.type]:t==="textarea"}function mf(e,t,l,i){ra?sa?sa.push(i):sa=[i]:ra=i,t=bi(t,"onChange"),0<t.length&&(l=new Es("onChange","change",null,l,i),e.push({event:l,listeners:t}))}var or=null,cr=null;function yy(e){Km(e,0)}function Ms(e){var t=nr(e);if(Fd(t))return e}function hf(e,t){if(e==="change")return t}var xf=!1;if(_n){var _o;if(_n){var To="oninput"in document;if(!To){var pf=document.createElement("div");pf.setAttribute("oninput","return;"),To=typeof pf.oninput=="function"}_o=To}else _o=!1;xf=_o&&(!document.documentMode||9<document.documentMode)}function gf(){or&&(or.detachEvent("onpropertychange",yf),cr=or=null)}function yf(e){if(e.propertyName==="value"&&Ms(cr)){var t=[];mf(t,cr,e,yo(e)),ef(yy,t)}}function by(e,t,l){e==="focusin"?(gf(),or=t,cr=l,or.attachEvent("onpropertychange",yf)):e==="focusout"&&gf()}function vy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ms(cr)}function jy(e,t){if(e==="click")return Ms(t)}function Ny(e,t){if(e==="input"||e==="change")return Ms(t)}function wy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lt=typeof Object.is=="function"?Object.is:wy;function ur(e,t){if(Lt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),i=Object.keys(t);if(l.length!==i.length)return!1;for(i=0;i<l.length;i++){var c=l[i];if(!Il.call(t,c)||!Lt(e[c],t[c]))return!1}return!0}function bf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vf(e,t){var l=bf(e);e=0;for(var i;l;){if(l.nodeType===3){if(i=e+l.textContent.length,e<=t&&i>=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=bf(l)}}function jf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ks(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=ks(e.document)}return t}function Eo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var ky=_n&&"documentMode"in document&&11>=document.documentMode,oa=null,Ao=null,dr=null,Mo=!1;function wf(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Mo||oa==null||oa!==ks(i)||(i=oa,"selectionStart"in i&&Eo(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),dr&&ur(dr,i)||(dr=i,i=bi(Ao,"onSelect"),0<i.length&&(t=new Es("onSelect","select",null,t,l),e.push({event:t,listeners:i}),t.target=oa)))}function kl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var ca={animationend:kl("Animation","AnimationEnd"),animationiteration:kl("Animation","AnimationIteration"),animationstart:kl("Animation","AnimationStart"),transitionrun:kl("Transition","TransitionRun"),transitionstart:kl("Transition","TransitionStart"),transitioncancel:kl("Transition","TransitionCancel"),transitionend:kl("Transition","TransitionEnd")},zo={},kf={};_n&&(kf=document.createElement("div").style,"AnimationEvent"in window||(delete ca.animationend.animation,delete ca.animationiteration.animation,delete ca.animationstart.animation),"TransitionEvent"in window||delete ca.transitionend.transition);function Sl(e){if(zo[e])return zo[e];if(!ca[e])return e;var t=ca[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in kf)return zo[e]=t[l];return e}var Sf=Sl("animationend"),Cf=Sl("animationiteration"),_f=Sl("animationstart"),Sy=Sl("transitionrun"),Cy=Sl("transitionstart"),_y=Sl("transitioncancel"),Tf=Sl("transitionend"),Ef=new Map,Oo="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Oo.push("scrollEnd");function on(e,t){Ef.set(e,t),Nl(t,[e])}var zs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Kt=[],ua=0,Do=0;function Os(){for(var e=ua,t=Do=ua=0;t<e;){var l=Kt[t];Kt[t++]=null;var i=Kt[t];Kt[t++]=null;var c=Kt[t];Kt[t++]=null;var m=Kt[t];if(Kt[t++]=null,i!==null&&c!==null){var b=i.pending;b===null?c.next=c:(c.next=b.next,b.next=c),i.pending=c}m!==0&&Af(l,c,m)}}function Ds(e,t,l,i){Kt[ua++]=e,Kt[ua++]=t,Kt[ua++]=l,Kt[ua++]=i,Do|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Ro(e,t,l,i){return Ds(e,t,l,i),Rs(e)}function Cl(e,t){return Ds(e,null,null,t),Rs(e)}function Af(e,t,l){e.lanes|=l;var i=e.alternate;i!==null&&(i.lanes|=l);for(var c=!1,m=e.return;m!==null;)m.childLanes|=l,i=m.alternate,i!==null&&(i.childLanes|=l),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(c=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,c&&t!==null&&(c=31-Xe(l),e=m.hiddenUpdates,i=e[c],i===null?e[c]=[t]:i.push(t),t.lane=l|536870912),m):null}function Rs(e){if(50<Or)throw Or=0,$c=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var da={};function Ty(e,t,l,i){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ut(e,t,l,i){return new Ty(e,t,l,i)}function Lo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Tn(e,t){var l=e.alternate;return l===null?(l=Ut(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Mf(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ls(e,t,l,i,c,m){var b=0;if(i=e,typeof e=="function")Lo(e)&&(b=1);else if(typeof e=="string")b=Ob(e,l,oe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case J:return e=Ut(31,l,t,c),e.elementType=J,e.lanes=m,e;case R:return _l(l.children,c,m,t);case S:b=8,c|=24;break;case T:return e=Ut(12,l,t,c|2),e.elementType=T,e.lanes=m,e;case z:return e=Ut(13,l,t,c),e.elementType=z,e.lanes=m,e;case U:return e=Ut(19,l,t,c),e.elementType=U,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:b=10;break e;case V:b=9;break e;case I:b=11;break e;case $:b=14;break e;case fe:b=16,i=null;break e}b=29,l=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=Ut(b,l,t,c),t.elementType=e,t.type=i,t.lanes=m,t}function _l(e,t,l,i){return e=Ut(7,e,i,t),e.lanes=l,e}function Uo(e,t,l){return e=Ut(6,e,null,t),e.lanes=l,e}function zf(e){var t=Ut(18,null,null,0);return t.stateNode=e,t}function Ho(e,t,l){return t=Ut(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Of=new WeakMap;function It(e,t){if(typeof e=="object"&&e!==null){var l=Of.get(e);return l!==void 0?l:(t={value:e,source:t,stack:gs(t)},Of.set(e,t),t)}return{value:e,source:t,stack:gs(t)}}var fa=[],ma=0,Us=null,fr=0,Jt=[],Pt=0,Zn=null,fn=1,mn="";function En(e,t){fa[ma++]=fr,fa[ma++]=Us,Us=e,fr=t}function Df(e,t,l){Jt[Pt++]=fn,Jt[Pt++]=mn,Jt[Pt++]=Zn,Zn=e;var i=fn;e=mn;var c=32-Xe(i)-1;i&=~(1<<c),l+=1;var m=32-Xe(t)+c;if(30<m){var b=c-c%5;m=(i&(1<<b)-1).toString(32),i>>=b,c-=b,fn=1<<32-Xe(t)+c|l<<c|i,mn=m+e}else fn=1<<m|l<<c|i,mn=e}function Bo(e){e.return!==null&&(En(e,1),Df(e,1,0))}function qo(e){for(;e===Us;)Us=fa[--ma],fa[ma]=null,fr=fa[--ma],fa[ma]=null;for(;e===Zn;)Zn=Jt[--Pt],Jt[Pt]=null,mn=Jt[--Pt],Jt[Pt]=null,fn=Jt[--Pt],Jt[Pt]=null}function Rf(e,t){Jt[Pt++]=fn,Jt[Pt++]=mn,Jt[Pt++]=Zn,fn=t.id,mn=t.overflow,Zn=e}var ht=null,Ie=null,ze=!1,Kn=null,Wt=!1,Yo=Error(o(519));function In(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mr(It(t,e)),Yo}function Lf(e){var t=e.stateNode,l=e.type,i=e.memoizedProps;switch(t[mt]=e,t[Ct]=i,l){case"dialog":_e("cancel",t),_e("close",t);break;case"iframe":case"object":case"embed":_e("load",t);break;case"video":case"audio":for(l=0;l<Rr.length;l++)_e(Rr[l],t);break;case"source":_e("error",t);break;case"img":case"image":case"link":_e("error",t),_e("load",t);break;case"details":_e("toggle",t);break;case"input":_e("invalid",t),Zd(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":_e("invalid",t);break;case"textarea":_e("invalid",t),Id(t,i.value,i.defaultValue,i.children)}l=i.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||i.suppressHydrationWarning===!0||Wm(t.textContent,l)?(i.popover!=null&&(_e("beforetoggle",t),_e("toggle",t)),i.onScroll!=null&&_e("scroll",t),i.onScrollEnd!=null&&_e("scrollend",t),i.onClick!=null&&(t.onclick=Cn),t=!0):t=!1,t||In(e,!0)}function Uf(e){for(ht=e.return;ht;)switch(ht.tag){case 5:case 31:case 13:Wt=!1;return;case 27:case 3:Wt=!0;return;default:ht=ht.return}}function ha(e){if(e!==ht)return!1;if(!ze)return Uf(e),ze=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||ru(e.type,e.memoizedProps)),l=!l),l&&Ie&&In(e),Uf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ie=oh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ie=oh(e)}else t===27?(t=Ie,ul(e.type)?(e=uu,uu=null,Ie=e):Ie=t):Ie=ht?tn(e.stateNode.nextSibling):null;return!0}function Tl(){Ie=ht=null,ze=!1}function Vo(){var e=Kn;return e!==null&&(Mt===null?Mt=e:Mt.push.apply(Mt,e),Kn=null),e}function mr(e){Kn===null?Kn=[e]:Kn.push(e)}var Go=_(null),El=null,An=null;function Jn(e,t,l){w(Go,t._currentValue),t._currentValue=l}function Mn(e){e._currentValue=Go.current,F(Go)}function $o(e,t,l){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===l)break;e=e.return}}function Qo(e,t,l,i){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var m=c.dependencies;if(m!==null){var b=c.child;m=m.firstContext;e:for(;m!==null;){var N=m;m=c;for(var E=0;E<t.length;E++)if(N.context===t[E]){m.lanes|=l,N=m.alternate,N!==null&&(N.lanes|=l),$o(m.return,l,e),i||(b=null);break e}m=N.next}}else if(c.tag===18){if(b=c.return,b===null)throw Error(o(341));b.lanes|=l,m=b.alternate,m!==null&&(m.lanes|=l),$o(b,l,e),b=null}else b=c.child;if(b!==null)b.return=c;else for(b=c;b!==null;){if(b===e){b=null;break}if(c=b.sibling,c!==null){c.return=b.return,b=c;break}b=b.return}c=b}}function xa(e,t,l,i){e=null;for(var c=t,m=!1;c!==null;){if(!m){if((c.flags&524288)!==0)m=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var b=c.alternate;if(b===null)throw Error(o(387));if(b=b.memoizedProps,b!==null){var N=c.type;Lt(c.pendingProps.value,b.value)||(e!==null?e.push(N):e=[N])}}else if(c===Ee.current){if(b=c.alternate,b===null)throw Error(o(387));b.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(qr):e=[qr])}c=c.return}e!==null&&Qo(t,e,l,i),t.flags|=262144}function Hs(e){for(e=e.firstContext;e!==null;){if(!Lt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Al(e){El=e,An=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xt(e){return Hf(El,e)}function Bs(e,t){return El===null&&Al(e),Hf(e,t)}function Hf(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},An===null){if(e===null)throw Error(o(308));An=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else An=An.next=t;return l}var Ey=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Ay=n.unstable_scheduleCallback,My=n.unstable_NormalPriority,at={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xo(){return{controller:new Ey,data:new Map,refCount:0}}function hr(e){e.refCount--,e.refCount===0&&Ay(My,function(){e.controller.abort()})}var xr=null,Fo=0,pa=0,ga=null;function zy(e,t){if(xr===null){var l=xr=[];Fo=0,pa=Ic(),ga={status:"pending",value:void 0,then:function(i){l.push(i)}}}return Fo++,t.then(Bf,Bf),t}function Bf(){if(--Fo===0&&xr!==null){ga!==null&&(ga.status="fulfilled");var e=xr;xr=null,pa=0,ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Oy(e,t){var l=[],i={status:"pending",value:null,reason:null,then:function(c){l.push(c)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var c=0;c<l.length;c++)(0,l[c])(t)},function(c){for(i.status="rejected",i.reason=c,c=0;c<l.length;c++)(0,l[c])(void 0)}),i}var qf=A.S;A.S=function(e,t){wm=jt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&zy(e,t),qf!==null&&qf(e,t)};var Ml=_(null);function Zo(){var e=Ml.current;return e!==null?e:Fe.pooledCache}function qs(e,t){t===null?w(Ml,Ml.current):w(Ml,t.pool)}function Yf(){var e=Zo();return e===null?null:{parent:at._currentValue,pool:e}}var ya=Error(o(460)),Ko=Error(o(474)),Ys=Error(o(542)),Vs={then:function(){}};function Vf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Gf(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Cn,Cn),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Qf(e),e;default:if(typeof t.status=="string")t.then(Cn,Cn);else{if(e=Fe,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=i}},function(i){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Qf(e),e}throw Ol=t,ya}}function zl(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ol=l,ya):l}}var Ol=null;function $f(){if(Ol===null)throw Error(o(459));var e=Ol;return Ol=null,e}function Qf(e){if(e===ya||e===Ys)throw Error(o(483))}var ba=null,pr=0;function Gs(e){var t=pr;return pr+=1,ba===null&&(ba=[]),Gf(ba,e,t)}function gr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function $s(e,t){throw t.$$typeof===v?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Xf(e){function t(B,L){if(e){var q=B.deletions;q===null?(B.deletions=[L],B.flags|=16):q.push(L)}}function l(B,L){if(!e)return null;for(;L!==null;)t(B,L),L=L.sibling;return null}function i(B){for(var L=new Map;B!==null;)B.key!==null?L.set(B.key,B):L.set(B.index,B),B=B.sibling;return L}function c(B,L){return B=Tn(B,L),B.index=0,B.sibling=null,B}function m(B,L,q){return B.index=q,e?(q=B.alternate,q!==null?(q=q.index,q<L?(B.flags|=67108866,L):q):(B.flags|=67108866,L)):(B.flags|=1048576,L)}function b(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function N(B,L,q,W){return L===null||L.tag!==6?(L=Uo(q,B.mode,W),L.return=B,L):(L=c(L,q),L.return=B,L)}function E(B,L,q,W){var ge=q.type;return ge===R?K(B,L,q.props.children,W,q.key):L!==null&&(L.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===fe&&zl(ge)===L.type)?(L=c(L,q.props),gr(L,q),L.return=B,L):(L=Ls(q.type,q.key,q.props,null,B.mode,W),gr(L,q),L.return=B,L)}function Y(B,L,q,W){return L===null||L.tag!==4||L.stateNode.containerInfo!==q.containerInfo||L.stateNode.implementation!==q.implementation?(L=Ho(q,B.mode,W),L.return=B,L):(L=c(L,q.children||[]),L.return=B,L)}function K(B,L,q,W,ge){return L===null||L.tag!==7?(L=_l(q,B.mode,W,ge),L.return=B,L):(L=c(L,q),L.return=B,L)}function te(B,L,q){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Uo(""+L,B.mode,q),L.return=B,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case j:return q=Ls(L.type,L.key,L.props,null,B.mode,q),gr(q,L),q.return=B,q;case k:return L=Ho(L,B.mode,q),L.return=B,L;case fe:return L=zl(L),te(B,L,q)}if(ee(L)||re(L))return L=_l(L,B.mode,q,null),L.return=B,L;if(typeof L.then=="function")return te(B,Gs(L),q);if(L.$$typeof===H)return te(B,Bs(B,L),q);$s(B,L)}return null}function G(B,L,q,W){var ge=L!==null?L.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return ge!==null?null:N(B,L,""+q,W);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case j:return q.key===ge?E(B,L,q,W):null;case k:return q.key===ge?Y(B,L,q,W):null;case fe:return q=zl(q),G(B,L,q,W)}if(ee(q)||re(q))return ge!==null?null:K(B,L,q,W,null);if(typeof q.then=="function")return G(B,L,Gs(q),W);if(q.$$typeof===H)return G(B,L,Bs(B,q),W);$s(B,q)}return null}function X(B,L,q,W,ge){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return B=B.get(q)||null,N(L,B,""+W,ge);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case j:return B=B.get(W.key===null?q:W.key)||null,E(L,B,W,ge);case k:return B=B.get(W.key===null?q:W.key)||null,Y(L,B,W,ge);case fe:return W=zl(W),X(B,L,q,W,ge)}if(ee(W)||re(W))return B=B.get(q)||null,K(L,B,W,ge,null);if(typeof W.then=="function")return X(B,L,q,Gs(W),ge);if(W.$$typeof===H)return X(B,L,q,Bs(L,W),ge);$s(L,W)}return null}function me(B,L,q,W){for(var ge=null,De=null,he=L,we=L=0,Me=null;he!==null&&we<q.length;we++){he.index>we?(Me=he,he=null):Me=he.sibling;var Re=G(B,he,q[we],W);if(Re===null){he===null&&(he=Me);break}e&&he&&Re.alternate===null&&t(B,he),L=m(Re,L,we),De===null?ge=Re:De.sibling=Re,De=Re,he=Me}if(we===q.length)return l(B,he),ze&&En(B,we),ge;if(he===null){for(;we<q.length;we++)he=te(B,q[we],W),he!==null&&(L=m(he,L,we),De===null?ge=he:De.sibling=he,De=he);return ze&&En(B,we),ge}for(he=i(he);we<q.length;we++)Me=X(he,B,we,q[we],W),Me!==null&&(e&&Me.alternate!==null&&he.delete(Me.key===null?we:Me.key),L=m(Me,L,we),De===null?ge=Me:De.sibling=Me,De=Me);return e&&he.forEach(function(xl){return t(B,xl)}),ze&&En(B,we),ge}function be(B,L,q,W){if(q==null)throw Error(o(151));for(var ge=null,De=null,he=L,we=L=0,Me=null,Re=q.next();he!==null&&!Re.done;we++,Re=q.next()){he.index>we?(Me=he,he=null):Me=he.sibling;var xl=G(B,he,Re.value,W);if(xl===null){he===null&&(he=Me);break}e&&he&&xl.alternate===null&&t(B,he),L=m(xl,L,we),De===null?ge=xl:De.sibling=xl,De=xl,he=Me}if(Re.done)return l(B,he),ze&&En(B,we),ge;if(he===null){for(;!Re.done;we++,Re=q.next())Re=te(B,Re.value,W),Re!==null&&(L=m(Re,L,we),De===null?ge=Re:De.sibling=Re,De=Re);return ze&&En(B,we),ge}for(he=i(he);!Re.done;we++,Re=q.next())Re=X(he,B,we,Re.value,W),Re!==null&&(e&&Re.alternate!==null&&he.delete(Re.key===null?we:Re.key),L=m(Re,L,we),De===null?ge=Re:De.sibling=Re,De=Re);return e&&he.forEach(function($b){return t(B,$b)}),ze&&En(B,we),ge}function $e(B,L,q,W){if(typeof q=="object"&&q!==null&&q.type===R&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case j:e:{for(var ge=q.key;L!==null;){if(L.key===ge){if(ge=q.type,ge===R){if(L.tag===7){l(B,L.sibling),W=c(L,q.props.children),W.return=B,B=W;break e}}else if(L.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===fe&&zl(ge)===L.type){l(B,L.sibling),W=c(L,q.props),gr(W,q),W.return=B,B=W;break e}l(B,L);break}else t(B,L);L=L.sibling}q.type===R?(W=_l(q.props.children,B.mode,W,q.key),W.return=B,B=W):(W=Ls(q.type,q.key,q.props,null,B.mode,W),gr(W,q),W.return=B,B=W)}return b(B);case k:e:{for(ge=q.key;L!==null;){if(L.key===ge)if(L.tag===4&&L.stateNode.containerInfo===q.containerInfo&&L.stateNode.implementation===q.implementation){l(B,L.sibling),W=c(L,q.children||[]),W.return=B,B=W;break e}else{l(B,L);break}else t(B,L);L=L.sibling}W=Ho(q,B.mode,W),W.return=B,B=W}return b(B);case fe:return q=zl(q),$e(B,L,q,W)}if(ee(q))return me(B,L,q,W);if(re(q)){if(ge=re(q),typeof ge!="function")throw Error(o(150));return q=ge.call(q),be(B,L,q,W)}if(typeof q.then=="function")return $e(B,L,Gs(q),W);if(q.$$typeof===H)return $e(B,L,Bs(B,q),W);$s(B,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,L!==null&&L.tag===6?(l(B,L.sibling),W=c(L,q),W.return=B,B=W):(l(B,L),W=Uo(q,B.mode,W),W.return=B,B=W),b(B)):l(B,L)}return function(B,L,q,W){try{pr=0;var ge=$e(B,L,q,W);return ba=null,ge}catch(he){if(he===ya||he===Ys)throw he;var De=Ut(29,he,null,B.mode);return De.lanes=W,De.return=B,De}finally{}}}var Dl=Xf(!0),Ff=Xf(!1),Pn=!1;function Io(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function el(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Le&2)!==0){var c=i.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),i.pending=t,t=Rs(e),Af(e,null,l),t}return Ds(e,i,t,l),Rs(e)}function yr(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Ud(e,l)}}function Po(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var c=null,m=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};m===null?c=m=b:m=m.next=b,l=l.next}while(l!==null);m===null?c=m=t:m=m.next=t}else c=m=t;l={baseState:i.baseState,firstBaseUpdate:c,lastBaseUpdate:m,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Wo=!1;function br(){if(Wo){var e=ga;if(e!==null)throw e}}function vr(e,t,l,i){Wo=!1;var c=e.updateQueue;Pn=!1;var m=c.firstBaseUpdate,b=c.lastBaseUpdate,N=c.shared.pending;if(N!==null){c.shared.pending=null;var E=N,Y=E.next;E.next=null,b===null?m=Y:b.next=Y,b=E;var K=e.alternate;K!==null&&(K=K.updateQueue,N=K.lastBaseUpdate,N!==b&&(N===null?K.firstBaseUpdate=Y:N.next=Y,K.lastBaseUpdate=E))}if(m!==null){var te=c.baseState;b=0,K=Y=E=null,N=m;do{var G=N.lane&-536870913,X=G!==N.lane;if(X?(Ae&G)===G:(i&G)===G){G!==0&&G===pa&&(Wo=!0),K!==null&&(K=K.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var me=e,be=N;G=t;var $e=l;switch(be.tag){case 1:if(me=be.payload,typeof me=="function"){te=me.call($e,te,G);break e}te=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=be.payload,G=typeof me=="function"?me.call($e,te,G):me,G==null)break e;te=g({},te,G);break e;case 2:Pn=!0}}G=N.callback,G!==null&&(e.flags|=64,X&&(e.flags|=8192),X=c.callbacks,X===null?c.callbacks=[G]:X.push(G))}else X={lane:G,tag:N.tag,payload:N.payload,callback:N.callback,next:null},K===null?(Y=K=X,E=te):K=K.next=X,b|=G;if(N=N.next,N===null){if(N=c.shared.pending,N===null)break;X=N,N=X.next,X.next=null,c.lastBaseUpdate=X,c.shared.pending=null}}while(!0);K===null&&(E=te),c.baseState=E,c.firstBaseUpdate=Y,c.lastBaseUpdate=K,m===null&&(c.shared.lanes=0),rl|=b,e.lanes=b,e.memoizedState=te}}function Zf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Kf(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Zf(l[e],t)}var va=_(null),Qs=_(0);function If(e,t){e=qn,w(Qs,e),w(va,t),qn=e|t.baseLanes}function ec(){w(Qs,qn),w(va,va.current)}function tc(){qn=Qs.current,F(va),F(Qs)}var Ht=_(null),en=null;function tl(e){var t=e.alternate;w(nt,nt.current&1),w(Ht,e),en===null&&(t===null||va.current!==null||t.memoizedState!==null)&&(en=e)}function nc(e){w(nt,nt.current),w(Ht,e),en===null&&(en=e)}function Jf(e){e.tag===22?(w(nt,nt.current),w(Ht,e),en===null&&(en=e)):nl()}function nl(){w(nt,nt.current),w(Ht,Ht.current)}function Bt(e){F(Ht),en===e&&(en=null),F(nt)}var nt=_(0);function Xs(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||ou(l)||cu(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){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 zn=0,Ne=null,Ve=null,rt=null,Fs=!1,ja=!1,Rl=!1,Zs=0,jr=0,Na=null,Dy=0;function et(){throw Error(o(321))}function lc(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Lt(e[l],t[l]))return!1;return!0}function ac(e,t,l,i,c,m){return zn=m,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?D0:bc,Rl=!1,m=l(i,c),Rl=!1,ja&&(m=Wf(t,l,i,c)),Pf(e),m}function Pf(e){A.H=kr;var t=Ve!==null&&Ve.next!==null;if(zn=0,rt=Ve=Ne=null,Fs=!1,jr=0,Na=null,t)throw Error(o(300));e===null||st||(e=e.dependencies,e!==null&&Hs(e)&&(st=!0))}function Wf(e,t,l,i){Ne=e;var c=0;do{if(ja&&(Na=null),jr=0,ja=!1,25<=c)throw Error(o(301));if(c+=1,rt=Ve=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}A.H=R0,m=t(l,i)}while(ja);return m}function Ry(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?Nr(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(Ne.flags|=1024),t}function rc(){var e=Zs!==0;return Zs=0,e}function sc(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function ic(e){if(Fs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Fs=!1}zn=0,rt=Ve=Ne=null,ja=!1,jr=Zs=0,Na=null}function wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?Ne.memoizedState=rt=e:rt=rt.next=e,rt}function lt(){if(Ve===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=rt===null?Ne.memoizedState:rt.next;if(t!==null)rt=t,Ve=e;else{if(e===null)throw Ne.alternate===null?Error(o(467)):Error(o(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},rt===null?Ne.memoizedState=rt=e:rt=rt.next=e}return rt}function Ks(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Nr(e){var t=jr;return jr+=1,Na===null&&(Na=[]),e=Gf(Na,e,t),t=Ne,(rt===null?t.memoizedState:rt.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?D0:bc),e}function Is(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Nr(e);if(e.$$typeof===H)return xt(e)}throw Error(o(438,String(e)))}function oc(e){var t=null,l=Ne.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var i=Ne.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Ks(),Ne.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),i=0;i<e;i++)l[i]=M;return t.index++,l}function On(e,t){return typeof t=="function"?t(e):t}function Js(e){var t=lt();return cc(t,Ve,e)}function cc(e,t,l){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=l;var c=e.baseQueue,m=i.pending;if(m!==null){if(c!==null){var b=c.next;c.next=m.next,m.next=b}t.baseQueue=c=m,i.pending=null}if(m=e.baseState,c===null)e.memoizedState=m;else{t=c.next;var N=b=null,E=null,Y=t,K=!1;do{var te=Y.lane&-536870913;if(te!==Y.lane?(Ae&te)===te:(zn&te)===te){var G=Y.revertLane;if(G===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),te===pa&&(K=!0);else if((zn&G)===G){Y=Y.next,G===pa&&(K=!0);continue}else te={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},E===null?(N=E=te,b=m):E=E.next=te,Ne.lanes|=G,rl|=G;te=Y.action,Rl&&l(m,te),m=Y.hasEagerState?Y.eagerState:l(m,te)}else G={lane:te,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},E===null?(N=E=G,b=m):E=E.next=G,Ne.lanes|=te,rl|=te;Y=Y.next}while(Y!==null&&Y!==t);if(E===null?b=m:E.next=N,!Lt(m,e.memoizedState)&&(st=!0,K&&(l=ga,l!==null)))throw l;e.memoizedState=m,e.baseState=b,e.baseQueue=E,i.lastRenderedState=m}return c===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function uc(e){var t=lt(),l=t.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=e;var i=l.dispatch,c=l.pending,m=t.memoizedState;if(c!==null){l.pending=null;var b=c=c.next;do m=e(m,b.action),b=b.next;while(b!==c);Lt(m,t.memoizedState)||(st=!0),t.memoizedState=m,t.baseQueue===null&&(t.baseState=m),l.lastRenderedState=m}return[m,i]}function e0(e,t,l){var i=Ne,c=lt(),m=ze;if(m){if(l===void 0)throw Error(o(407));l=l()}else l=t();var b=!Lt((Ve||c).memoizedState,l);if(b&&(c.memoizedState=l,st=!0),c=c.queue,mc(l0.bind(null,i,c,e),[e]),c.getSnapshot!==t||b||rt!==null&&rt.memoizedState.tag&1){if(i.flags|=2048,wa(9,{destroy:void 0},n0.bind(null,i,c,l,t),null),Fe===null)throw Error(o(349));m||(zn&127)!==0||t0(i,t,l)}return l}function t0(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=Ne.updateQueue,t===null?(t=Ks(),Ne.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function n0(e,t,l,i){t.value=l,t.getSnapshot=i,a0(t)&&r0(e)}function l0(e,t,l){return l(function(){a0(t)&&r0(e)})}function a0(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Lt(e,l)}catch{return!0}}function r0(e){var t=Cl(e,2);t!==null&&zt(t,e,2)}function dc(e){var t=wt();if(typeof e=="function"){var l=e;if(e=l(),Rl){St(!0);try{l()}finally{St(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:On,lastRenderedState:e},t}function s0(e,t,l,i){return e.baseState=l,cc(e,Ve,typeof i=="function"?i:On)}function Ly(e,t,l,i,c){if(ei(e))throw Error(o(485));if(e=t.action,e!==null){var m={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};A.T!==null?l(!0):m.isTransition=!1,i(m),l=t.pending,l===null?(m.next=t.pending=m,i0(t,m)):(m.next=l.next,t.pending=l.next=m)}}function i0(e,t){var l=t.action,i=t.payload,c=e.state;if(t.isTransition){var m=A.T,b={};A.T=b;try{var N=l(c,i),E=A.S;E!==null&&E(b,N),o0(e,t,N)}catch(Y){fc(e,t,Y)}finally{m!==null&&b.types!==null&&(m.types=b.types),A.T=m}}else try{m=l(c,i),o0(e,t,m)}catch(Y){fc(e,t,Y)}}function o0(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(i){c0(e,t,i)},function(i){return fc(e,t,i)}):c0(e,t,l)}function c0(e,t,l){t.status="fulfilled",t.value=l,u0(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,i0(e,l)))}function fc(e,t,l){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=l,u0(t),t=t.next;while(t!==i)}e.action=null}function u0(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function d0(e,t){return t}function f0(e,t){if(ze){var l=Fe.formState;if(l!==null){e:{var i=Ne;if(ze){if(Ie){t:{for(var c=Ie,m=Wt;c.nodeType!==8;){if(!m){c=null;break t}if(c=tn(c.nextSibling),c===null){c=null;break t}}m=c.data,c=m==="F!"||m==="F"?c:null}if(c){Ie=tn(c.nextSibling),i=c.data==="F!";break e}}In(i)}i=!1}i&&(t=l[0])}}return l=wt(),l.memoizedState=l.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:d0,lastRenderedState:t},l.queue=i,l=M0.bind(null,Ne,i),i.dispatch=l,i=dc(!1),m=yc.bind(null,Ne,!1,i.queue),i=wt(),c={state:t,dispatch:null,action:e,pending:null},i.queue=c,l=Ly.bind(null,Ne,c,m,l),c.dispatch=l,i.memoizedState=e,[t,l,!1]}function m0(e){var t=lt();return h0(t,Ve,e)}function h0(e,t,l){if(t=cc(e,t,d0)[0],e=Js(On)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Nr(t)}catch(b){throw b===ya?Ys:b}else i=t;t=lt();var c=t.queue,m=c.dispatch;return l!==t.memoizedState&&(Ne.flags|=2048,wa(9,{destroy:void 0},Uy.bind(null,c,l),null)),[i,m,e]}function Uy(e,t){e.action=t}function x0(e){var t=lt(),l=Ve;if(l!==null)return h0(t,l,e);lt(),t=t.memoizedState,l=lt();var i=l.queue.dispatch;return l.memoizedState=e,[t,i,!1]}function wa(e,t,l,i){return e={tag:e,create:l,deps:i,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=Ks(),Ne.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(i=l.next,l.next=e,e.next=i,t.lastEffect=e),e}function p0(){return lt().memoizedState}function Ps(e,t,l,i){var c=wt();Ne.flags|=e,c.memoizedState=wa(1|t,{destroy:void 0},l,i===void 0?null:i)}function Ws(e,t,l,i){var c=lt();i=i===void 0?null:i;var m=c.memoizedState.inst;Ve!==null&&i!==null&&lc(i,Ve.memoizedState.deps)?c.memoizedState=wa(t,m,l,i):(Ne.flags|=e,c.memoizedState=wa(1|t,m,l,i))}function g0(e,t){Ps(8390656,8,e,t)}function mc(e,t){Ws(2048,8,e,t)}function Hy(e){Ne.flags|=4;var t=Ne.updateQueue;if(t===null)t=Ks(),Ne.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function y0(e){var t=lt().memoizedState;return Hy({ref:t,nextImpl:e}),function(){if((Le&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function b0(e,t){return Ws(4,2,e,t)}function v0(e,t){return Ws(4,4,e,t)}function j0(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function N0(e,t,l){l=l!=null?l.concat([e]):null,Ws(4,4,j0.bind(null,t,e),l)}function hc(){}function w0(e,t){var l=lt();t=t===void 0?null:t;var i=l.memoizedState;return t!==null&&lc(t,i[1])?i[0]:(l.memoizedState=[e,t],e)}function k0(e,t){var l=lt();t=t===void 0?null:t;var i=l.memoizedState;if(t!==null&&lc(t,i[1]))return i[0];if(i=e(),Rl){St(!0);try{e()}finally{St(!1)}}return l.memoizedState=[i,t],i}function xc(e,t,l){return l===void 0||(zn&1073741824)!==0&&(Ae&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=Sm(),Ne.lanes|=e,rl|=e,l)}function S0(e,t,l,i){return Lt(l,t)?l:va.current!==null?(e=xc(e,l,i),Lt(e,t)||(st=!0),e):(zn&42)===0||(zn&1073741824)!==0&&(Ae&261930)===0?(st=!0,e.memoizedState=l):(e=Sm(),Ne.lanes|=e,rl|=e,t)}function C0(e,t,l,i,c){var m=O.p;O.p=m!==0&&8>m?m:8;var b=A.T,N={};A.T=N,yc(e,!1,t,l);try{var E=c(),Y=A.S;if(Y!==null&&Y(N,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var K=Oy(E,i);wr(e,t,K,Vt(e))}else wr(e,t,i,Vt(e))}catch(te){wr(e,t,{then:function(){},status:"rejected",reason:te},Vt())}finally{O.p=m,b!==null&&N.types!==null&&(b.types=N.types),A.T=b}}function By(){}function pc(e,t,l,i){if(e.tag!==5)throw Error(o(476));var c=_0(e).queue;C0(e,c,t,le,l===null?By:function(){return T0(e),l(i)})}function _0(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:On,lastRenderedState:le},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:On,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function T0(e){var t=_0(e);t.next===null&&(t=e.alternate.memoizedState),wr(e,t.next.queue,{},Vt())}function gc(){return xt(qr)}function E0(){return lt().memoizedState}function A0(){return lt().memoizedState}function qy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Vt();e=Wn(l);var i=el(t,e,l);i!==null&&(zt(i,t,l),yr(i,t,l)),t={cache:Xo()},e.payload=t;return}t=t.return}}function Yy(e,t,l){var i=Vt();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ei(e)?z0(t,l):(l=Ro(e,t,l,i),l!==null&&(zt(l,e,i),O0(l,t,i)))}function M0(e,t,l){var i=Vt();wr(e,t,l,i)}function wr(e,t,l,i){var c={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ei(e))z0(t,c);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=t.lastRenderedReducer,m!==null))try{var b=t.lastRenderedState,N=m(b,l);if(c.hasEagerState=!0,c.eagerState=N,Lt(N,b))return Ds(e,t,c,0),Fe===null&&Os(),!1}catch{}finally{}if(l=Ro(e,t,c,i),l!==null)return zt(l,e,i),O0(l,t,i),!0}return!1}function yc(e,t,l,i){if(i={lane:2,revertLane:Ic(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ei(e)){if(t)throw Error(o(479))}else t=Ro(e,l,i,2),t!==null&&zt(t,e,2)}function ei(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function z0(e,t){ja=Fs=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function O0(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Ud(e,l)}}var kr={readContext:xt,use:Is,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useLayoutEffect:et,useInsertionEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useSyncExternalStore:et,useId:et,useHostTransitionStatus:et,useFormState:et,useActionState:et,useOptimistic:et,useMemoCache:et,useCacheRefresh:et};kr.useEffectEvent=et;var D0={readContext:xt,use:Is,useCallback:function(e,t){return wt().memoizedState=[e,t===void 0?null:t],e},useContext:xt,useEffect:g0,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Ps(4194308,4,j0.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){Ps(4,2,e,t)},useMemo:function(e,t){var l=wt();t=t===void 0?null:t;var i=e();if(Rl){St(!0);try{e()}finally{St(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=wt();if(l!==void 0){var c=l(t);if(Rl){St(!0);try{l(t)}finally{St(!1)}}}else c=t;return i.memoizedState=i.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},i.queue=e,e=e.dispatch=Yy.bind(null,Ne,e),[i.memoizedState,e]},useRef:function(e){var t=wt();return e={current:e},t.memoizedState=e},useState:function(e){e=dc(e);var t=e.queue,l=M0.bind(null,Ne,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:hc,useDeferredValue:function(e,t){var l=wt();return xc(l,e,t)},useTransition:function(){var e=dc(!1);return e=C0.bind(null,Ne,e.queue,!0,!1),wt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=Ne,c=wt();if(ze){if(l===void 0)throw Error(o(407));l=l()}else{if(l=t(),Fe===null)throw Error(o(349));(Ae&127)!==0||t0(i,t,l)}c.memoizedState=l;var m={value:l,getSnapshot:t};return c.queue=m,g0(l0.bind(null,i,m,e),[e]),i.flags|=2048,wa(9,{destroy:void 0},n0.bind(null,i,m,l,t),null),l},useId:function(){var e=wt(),t=Fe.identifierPrefix;if(ze){var l=mn,i=fn;l=(i&~(1<<32-Xe(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Zs++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Dy++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:gc,useFormState:f0,useActionState:f0,useOptimistic:function(e){var t=wt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=yc.bind(null,Ne,!0,l),l.dispatch=t,[e,t]},useMemoCache:oc,useCacheRefresh:function(){return wt().memoizedState=qy.bind(null,Ne)},useEffectEvent:function(e){var t=wt(),l={impl:e};return t.memoizedState=l,function(){if((Le&2)!==0)throw Error(o(440));return l.impl.apply(void 0,arguments)}}},bc={readContext:xt,use:Is,useCallback:w0,useContext:xt,useEffect:mc,useImperativeHandle:N0,useInsertionEffect:b0,useLayoutEffect:v0,useMemo:k0,useReducer:Js,useRef:p0,useState:function(){return Js(On)},useDebugValue:hc,useDeferredValue:function(e,t){var l=lt();return S0(l,Ve.memoizedState,e,t)},useTransition:function(){var e=Js(On)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:Nr(e),t]},useSyncExternalStore:e0,useId:E0,useHostTransitionStatus:gc,useFormState:m0,useActionState:m0,useOptimistic:function(e,t){var l=lt();return s0(l,Ve,e,t)},useMemoCache:oc,useCacheRefresh:A0};bc.useEffectEvent=y0;var R0={readContext:xt,use:Is,useCallback:w0,useContext:xt,useEffect:mc,useImperativeHandle:N0,useInsertionEffect:b0,useLayoutEffect:v0,useMemo:k0,useReducer:uc,useRef:p0,useState:function(){return uc(On)},useDebugValue:hc,useDeferredValue:function(e,t){var l=lt();return Ve===null?xc(l,e,t):S0(l,Ve.memoizedState,e,t)},useTransition:function(){var e=uc(On)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:Nr(e),t]},useSyncExternalStore:e0,useId:E0,useHostTransitionStatus:gc,useFormState:x0,useActionState:x0,useOptimistic:function(e,t){var l=lt();return Ve!==null?s0(l,Ve,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:oc,useCacheRefresh:A0};R0.useEffectEvent=y0;function vc(e,t,l,i){t=e.memoizedState,l=l(i,t),l=l==null?t:g({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var jc={enqueueSetState:function(e,t,l){e=e._reactInternals;var i=Vt(),c=Wn(i);c.payload=t,l!=null&&(c.callback=l),t=el(e,c,i),t!==null&&(zt(t,e,i),yr(t,e,i))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var i=Vt(),c=Wn(i);c.tag=1,c.payload=t,l!=null&&(c.callback=l),t=el(e,c,i),t!==null&&(zt(t,e,i),yr(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Vt(),i=Wn(l);i.tag=2,t!=null&&(i.callback=t),t=el(e,i,l),t!==null&&(zt(t,e,l),yr(t,e,l))}};function L0(e,t,l,i,c,m,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,m,b):t.prototype&&t.prototype.isPureReactComponent?!ur(l,i)||!ur(c,m):!0}function U0(e,t,l,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,i),t.state!==e&&jc.enqueueReplaceState(t,t.state,null)}function Ll(e,t){var l=t;if("ref"in t){l={};for(var i in t)i!=="ref"&&(l[i]=t[i])}if(e=e.defaultProps){l===t&&(l=g({},l));for(var c in e)l[c]===void 0&&(l[c]=e[c])}return l}function H0(e){zs(e)}function B0(e){console.error(e)}function q0(e){zs(e)}function ti(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Y0(e,t,l){try{var i=e.onCaughtError;i(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Nc(e,t,l){return l=Wn(l),l.tag=3,l.payload={element:null},l.callback=function(){ti(e,t)},l}function V0(e){return e=Wn(e),e.tag=3,e}function G0(e,t,l,i){var c=l.type.getDerivedStateFromError;if(typeof c=="function"){var m=i.value;e.payload=function(){return c(m)},e.callback=function(){Y0(t,l,i)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Y0(t,l,i),typeof c!="function"&&(sl===null?sl=new Set([this]):sl.add(this));var N=i.stack;this.componentDidCatch(i.value,{componentStack:N!==null?N:""})})}function Vy(e,t,l,i,c){if(l.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=l.alternate,t!==null&&xa(t,l,c,!0),l=Ht.current,l!==null){switch(l.tag){case 31:case 13:return en===null?mi():l.alternate===null&&tt===0&&(tt=3),l.flags&=-257,l.flags|=65536,l.lanes=c,i===Vs?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([i]):t.add(i),Fc(e,i,c)),!1;case 22:return l.flags|=65536,i===Vs?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([i]):l.add(i)),Fc(e,i,c)),!1}throw Error(o(435,l.tag))}return Fc(e,i,c),mi(),!1}if(ze)return t=Ht.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,i!==Yo&&(e=Error(o(422),{cause:i}),mr(It(e,l)))):(i!==Yo&&(t=Error(o(423),{cause:i}),mr(It(t,l))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,i=It(i,l),c=Nc(e.stateNode,i,c),Po(e,c),tt!==4&&(tt=2)),!1;var m=Error(o(520),{cause:i});if(m=It(m,l),zr===null?zr=[m]:zr.push(m),tt!==4&&(tt=2),t===null)return!0;i=It(i,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=c&-c,l.lanes|=e,e=Nc(l.stateNode,i,e),Po(l,e),!1;case 1:if(t=l.type,m=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(sl===null||!sl.has(m))))return l.flags|=65536,c&=-c,l.lanes|=c,c=V0(c),G0(c,e,l,i),Po(l,c),!1}l=l.return}while(l!==null);return!1}var wc=Error(o(461)),st=!1;function pt(e,t,l,i){t.child=e===null?Ff(t,null,l,i):Dl(t,e.child,l,i)}function $0(e,t,l,i,c){l=l.render;var m=t.ref;if("ref"in i){var b={};for(var N in i)N!=="ref"&&(b[N]=i[N])}else b=i;return Al(t),i=ac(e,t,l,b,m,c),N=rc(),e!==null&&!st?(sc(e,t,c),Dn(e,t,c)):(ze&&N&&Bo(t),t.flags|=1,pt(e,t,i,c),t.child)}function Q0(e,t,l,i,c){if(e===null){var m=l.type;return typeof m=="function"&&!Lo(m)&&m.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=m,X0(e,t,m,i,c)):(e=Ls(l.type,null,i,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,!Mc(e,c)){var b=m.memoizedProps;if(l=l.compare,l=l!==null?l:ur,l(b,i)&&e.ref===t.ref)return Dn(e,t,c)}return t.flags|=1,e=Tn(m,i),e.ref=t.ref,e.return=t,t.child=e}function X0(e,t,l,i,c){if(e!==null){var m=e.memoizedProps;if(ur(m,i)&&e.ref===t.ref)if(st=!1,t.pendingProps=i=m,Mc(e,c))(e.flags&131072)!==0&&(st=!0);else return t.lanes=e.lanes,Dn(e,t,c)}return kc(e,t,l,i,c)}function F0(e,t,l,i){var c=i.children,m=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(m=m!==null?m.baseLanes|l:l,e!==null){for(i=t.child=e.child,c=0;i!==null;)c=c|i.lanes|i.childLanes,i=i.sibling;i=c&~m}else i=0,t.child=null;return Z0(e,t,m,l,i)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qs(t,m!==null?m.cachePool:null),m!==null?If(t,m):ec(),Jf(t);else return i=t.lanes=536870912,Z0(e,t,m!==null?m.baseLanes|l:l,l,i)}else m!==null?(qs(t,m.cachePool),If(t,m),nl(),t.memoizedState=null):(e!==null&&qs(t,null),ec(),nl());return pt(e,t,c,l),t.child}function Sr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Z0(e,t,l,i,c){var m=Zo();return m=m===null?null:{parent:at._currentValue,pool:m},t.memoizedState={baseLanes:l,cachePool:m},e!==null&&qs(t,null),ec(),Jf(t),e!==null&&xa(e,t,i,!0),t.childLanes=c,null}function ni(e,t){return t=ai({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function K0(e,t,l){return Dl(t,e.child,null,l),e=ni(t,t.pendingProps),e.flags|=2,Bt(t),t.memoizedState=null,e}function Gy(e,t,l){var i=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ze){if(i.mode==="hidden")return e=ni(t,i),t.lanes=536870912,Sr(null,e);if(nc(t),(e=Ie)?(e=ih(e,Wt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zn!==null?{id:fn,overflow:mn}:null,retryLane:536870912,hydrationErrors:null},l=zf(e),l.return=t,t.child=l,ht=t,Ie=null)):e=null,e===null)throw In(t);return t.lanes=536870912,null}return ni(t,i)}var m=e.memoizedState;if(m!==null){var b=m.dehydrated;if(nc(t),c)if(t.flags&256)t.flags&=-257,t=K0(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(st||xa(e,t,l,!1),c=(l&e.childLanes)!==0,st||c){if(i=Fe,i!==null&&(b=Hd(i,l),b!==0&&b!==m.retryLane))throw m.retryLane=b,Cl(e,b),zt(i,e,b),wc;mi(),t=K0(e,t,l)}else e=m.treeContext,Ie=tn(b.nextSibling),ht=t,ze=!0,Kn=null,Wt=!1,e!==null&&Rf(t,e),t=ni(t,i),t.flags|=4096;return t}return e=Tn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function li(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(o(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function kc(e,t,l,i,c){return Al(t),l=ac(e,t,l,i,void 0,c),i=rc(),e!==null&&!st?(sc(e,t,c),Dn(e,t,c)):(ze&&i&&Bo(t),t.flags|=1,pt(e,t,l,c),t.child)}function I0(e,t,l,i,c,m){return Al(t),t.updateQueue=null,l=Wf(t,i,l,c),Pf(e),i=rc(),e!==null&&!st?(sc(e,t,m),Dn(e,t,m)):(ze&&i&&Bo(t),t.flags|=1,pt(e,t,l,m),t.child)}function J0(e,t,l,i,c){if(Al(t),t.stateNode===null){var m=da,b=l.contextType;typeof b=="object"&&b!==null&&(m=xt(b)),m=new l(i,m),t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=jc,t.stateNode=m,m._reactInternals=t,m=t.stateNode,m.props=i,m.state=t.memoizedState,m.refs={},Io(t),b=l.contextType,m.context=typeof b=="object"&&b!==null?xt(b):da,m.state=t.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(vc(t,l,b,i),m.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&jc.enqueueReplaceState(m,m.state,null),vr(t,i,m,c),br(),m.state=t.memoizedState),typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){m=t.stateNode;var N=t.memoizedProps,E=Ll(l,N);m.props=E;var Y=m.context,K=l.contextType;b=da,typeof K=="object"&&K!==null&&(b=xt(K));var te=l.getDerivedStateFromProps;K=typeof te=="function"||typeof m.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,K||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(N||Y!==b)&&U0(t,m,i,b),Pn=!1;var G=t.memoizedState;m.state=G,vr(t,i,m,c),br(),Y=t.memoizedState,N||G!==Y||Pn?(typeof te=="function"&&(vc(t,l,te,i),Y=t.memoizedState),(E=Pn||L0(t,l,E,i,G,Y,b))?(K||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=Y),m.props=i,m.state=Y,m.context=b,i=E):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{m=t.stateNode,Jo(e,t),b=t.memoizedProps,K=Ll(l,b),m.props=K,te=t.pendingProps,G=m.context,Y=l.contextType,E=da,typeof Y=="object"&&Y!==null&&(E=xt(Y)),N=l.getDerivedStateFromProps,(Y=typeof N=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==te||G!==E)&&U0(t,m,i,E),Pn=!1,G=t.memoizedState,m.state=G,vr(t,i,m,c),br();var X=t.memoizedState;b!==te||G!==X||Pn||e!==null&&e.dependencies!==null&&Hs(e.dependencies)?(typeof N=="function"&&(vc(t,l,N,i),X=t.memoizedState),(K=Pn||L0(t,l,K,i,G,X,E)||e!==null&&e.dependencies!==null&&Hs(e.dependencies))?(Y||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(i,X,E),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(i,X,E)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=X),m.props=i,m.state=X,m.context=E,i=K):(typeof m.componentDidUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),i=!1)}return m=i,li(e,t),i=(t.flags&128)!==0,m||i?(m=t.stateNode,l=i&&typeof l.getDerivedStateFromError!="function"?null:m.render(),t.flags|=1,e!==null&&i?(t.child=Dl(t,e.child,null,c),t.child=Dl(t,null,l,c)):pt(e,t,l,c),t.memoizedState=m.state,e=t.child):e=Dn(e,t,c),e}function P0(e,t,l,i){return Tl(),t.flags|=256,pt(e,t,l,i),t.child}var Sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cc(e){return{baseLanes:e,cachePool:Yf()}}function _c(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Yt),e}function W0(e,t,l){var i=t.pendingProps,c=!1,m=(t.flags&128)!==0,b;if((b=m)||(b=e!==null&&e.memoizedState===null?!1:(nt.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(c?tl(t):nl(),(e=Ie)?(e=ih(e,Wt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Zn!==null?{id:fn,overflow:mn}:null,retryLane:536870912,hydrationErrors:null},l=zf(e),l.return=t,t.child=l,ht=t,Ie=null)):e=null,e===null)throw In(t);return cu(e)?t.lanes=32:t.lanes=536870912,null}var N=i.children;return i=i.fallback,c?(nl(),c=t.mode,N=ai({mode:"hidden",children:N},c),i=_l(i,c,l,null),N.return=t,i.return=t,N.sibling=i,t.child=N,i=t.child,i.memoizedState=Cc(l),i.childLanes=_c(e,b,l),t.memoizedState=Sc,Sr(null,i)):(tl(t),Tc(t,N))}var E=e.memoizedState;if(E!==null&&(N=E.dehydrated,N!==null)){if(m)t.flags&256?(tl(t),t.flags&=-257,t=Ec(e,t,l)):t.memoizedState!==null?(nl(),t.child=e.child,t.flags|=128,t=null):(nl(),N=i.fallback,c=t.mode,i=ai({mode:"visible",children:i.children},c),N=_l(N,c,l,null),N.flags|=2,i.return=t,N.return=t,i.sibling=N,t.child=i,Dl(t,e.child,null,l),i=t.child,i.memoizedState=Cc(l),i.childLanes=_c(e,b,l),t.memoizedState=Sc,t=Sr(null,i));else if(tl(t),cu(N)){if(b=N.nextSibling&&N.nextSibling.dataset,b)var Y=b.dgst;b=Y,i=Error(o(419)),i.stack="",i.digest=b,mr({value:i,source:null,stack:null}),t=Ec(e,t,l)}else if(st||xa(e,t,l,!1),b=(l&e.childLanes)!==0,st||b){if(b=Fe,b!==null&&(i=Hd(b,l),i!==0&&i!==E.retryLane))throw E.retryLane=i,Cl(e,i),zt(b,e,i),wc;ou(N)||mi(),t=Ec(e,t,l)}else ou(N)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,Ie=tn(N.nextSibling),ht=t,ze=!0,Kn=null,Wt=!1,e!==null&&Rf(t,e),t=Tc(t,i.children),t.flags|=4096);return t}return c?(nl(),N=i.fallback,c=t.mode,E=e.child,Y=E.sibling,i=Tn(E,{mode:"hidden",children:i.children}),i.subtreeFlags=E.subtreeFlags&65011712,Y!==null?N=Tn(Y,N):(N=_l(N,c,l,null),N.flags|=2),N.return=t,i.return=t,i.sibling=N,t.child=i,Sr(null,i),i=t.child,N=e.child.memoizedState,N===null?N=Cc(l):(c=N.cachePool,c!==null?(E=at._currentValue,c=c.parent!==E?{parent:E,pool:E}:c):c=Yf(),N={baseLanes:N.baseLanes|l,cachePool:c}),i.memoizedState=N,i.childLanes=_c(e,b,l),t.memoizedState=Sc,Sr(e.child,i)):(tl(t),l=e.child,e=l.sibling,l=Tn(l,{mode:"visible",children:i.children}),l.return=t,l.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=l,t.memoizedState=null,l)}function Tc(e,t){return t=ai({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ai(e,t){return e=Ut(22,e,null,t),e.lanes=0,e}function Ec(e,t,l){return Dl(t,e.child,null,l),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function em(e,t,l){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),$o(e.return,t,l)}function Ac(e,t,l,i,c,m){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:l,tailMode:c,treeForkCount:m}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=i,b.tail=l,b.tailMode=c,b.treeForkCount=m)}function tm(e,t,l){var i=t.pendingProps,c=i.revealOrder,m=i.tail;i=i.children;var b=nt.current,N=(b&2)!==0;if(N?(b=b&1|2,t.flags|=128):b&=1,w(nt,b),pt(e,t,i,l),i=ze?fr:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&em(e,l,t);else if(e.tag===19)em(e,l,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}switch(c){case"forwards":for(l=t.child,c=null;l!==null;)e=l.alternate,e!==null&&Xs(e)===null&&(c=l),l=l.sibling;l=c,l===null?(c=t.child,t.child=null):(c=l.sibling,l.sibling=null),Ac(t,!1,c,l,m,i);break;case"backwards":case"unstable_legacy-backwards":for(l=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Xs(e)===null){t.child=c;break}e=c.sibling,c.sibling=l,l=c,c=e}Ac(t,!0,l,null,m,i);break;case"together":Ac(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function Dn(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),rl|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(xa(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,l=Tn(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Tn(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Mc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Hs(e)))}function $y(e,t,l){switch(t.tag){case 3:Pe(t,t.stateNode.containerInfo),Jn(t,at,e.memoizedState.cache),Tl();break;case 27:case 5:Xt(t);break;case 4:Pe(t,t.stateNode.containerInfo);break;case 10:Jn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,nc(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(tl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?W0(e,t,l):(tl(t),e=Dn(e,t,l),e!==null?e.sibling:null);tl(t);break;case 19:var c=(e.flags&128)!==0;if(i=(l&t.childLanes)!==0,i||(xa(e,t,l,!1),i=(l&t.childLanes)!==0),c){if(i)return tm(e,t,l);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),w(nt,nt.current),i)break;return null;case 22:return t.lanes=0,F0(e,t,l,t.pendingProps);case 24:Jn(t,at,e.memoizedState.cache)}return Dn(e,t,l)}function nm(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)st=!0;else{if(!Mc(e,l)&&(t.flags&128)===0)return st=!1,$y(e,t,l);st=(e.flags&131072)!==0}else st=!1,ze&&(t.flags&1048576)!==0&&Df(t,fr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=zl(t.elementType),t.type=e,typeof e=="function")Lo(e)?(i=Ll(e,i),t.tag=1,t=J0(null,t,e,i,l)):(t.tag=0,t=kc(null,t,e,i,l));else{if(e!=null){var c=e.$$typeof;if(c===I){t.tag=11,t=$0(null,t,e,i,l);break e}else if(c===$){t.tag=14,t=Q0(null,t,e,i,l);break e}}throw t=Q(e)||e,Error(o(306,t,""))}}return t;case 0:return kc(e,t,t.type,t.pendingProps,l);case 1:return i=t.type,c=Ll(i,t.pendingProps),J0(e,t,i,c,l);case 3:e:{if(Pe(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var m=t.memoizedState;c=m.element,Jo(e,t),vr(t,i,null,l);var b=t.memoizedState;if(i=b.cache,Jn(t,at,i),i!==m.cache&&Qo(t,[at],l,!0),br(),i=b.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=m,t.memoizedState=m,t.flags&256){t=P0(e,t,i,l);break e}else if(i!==c){c=It(Error(o(424)),t),mr(c),t=P0(e,t,i,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ie=tn(e.firstChild),ht=t,ze=!0,Kn=null,Wt=!0,l=Ff(t,null,i,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Tl(),i===c){t=Dn(e,t,l);break e}pt(e,t,i,l)}t=t.child}return t;case 26:return li(e,t),e===null?(l=mh(t.type,null,t.pendingProps,null))?t.memoizedState=l:ze||(l=t.type,e=t.pendingProps,i=vi(pe.current).createElement(l),i[mt]=t,i[Ct]=e,gt(i,l,e),dt(i),t.stateNode=i):t.memoizedState=mh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Xt(t),e===null&&ze&&(i=t.stateNode=uh(t.type,t.pendingProps,pe.current),ht=t,Wt=!0,c=Ie,ul(t.type)?(uu=c,Ie=tn(i.firstChild)):Ie=c),pt(e,t,t.pendingProps.children,l),li(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((c=i=Ie)&&(i=vb(i,t.type,t.pendingProps,Wt),i!==null?(t.stateNode=i,ht=t,Ie=tn(i.firstChild),Wt=!1,c=!0):c=!1),c||In(t)),Xt(t),c=t.type,m=t.pendingProps,b=e!==null?e.memoizedProps:null,i=m.children,ru(c,m)?i=null:b!==null&&ru(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=ac(e,t,Ry,null,null,l),qr._currentValue=c),li(e,t),pt(e,t,i,l),t.child;case 6:return e===null&&ze&&((e=l=Ie)&&(l=jb(l,t.pendingProps,Wt),l!==null?(t.stateNode=l,ht=t,Ie=null,e=!0):e=!1),e||In(t)),null;case 13:return W0(e,t,l);case 4:return Pe(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Dl(t,null,i,l):pt(e,t,i,l),t.child;case 11:return $0(e,t,t.type,t.pendingProps,l);case 7:return pt(e,t,t.pendingProps,l),t.child;case 8:return pt(e,t,t.pendingProps.children,l),t.child;case 12:return pt(e,t,t.pendingProps.children,l),t.child;case 10:return i=t.pendingProps,Jn(t,t.type,i.value),pt(e,t,i.children,l),t.child;case 9:return c=t.type._context,i=t.pendingProps.children,Al(t),c=xt(c),i=i(c),t.flags|=1,pt(e,t,i,l),t.child;case 14:return Q0(e,t,t.type,t.pendingProps,l);case 15:return X0(e,t,t.type,t.pendingProps,l);case 19:return tm(e,t,l);case 31:return Gy(e,t,l);case 22:return F0(e,t,l,t.pendingProps);case 24:return Al(t),i=xt(at),e===null?(c=Zo(),c===null&&(c=Fe,m=Xo(),c.pooledCache=m,m.refCount++,m!==null&&(c.pooledCacheLanes|=l),c=m),t.memoizedState={parent:i,cache:c},Io(t),Jn(t,at,c)):((e.lanes&l)!==0&&(Jo(e,t),vr(t,null,null,l),br()),c=e.memoizedState,m=t.memoizedState,c.parent!==i?(c={parent:i,cache:i},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Jn(t,at,i)):(i=m.cache,Jn(t,at,i),i!==c.cache&&Qo(t,[at],l,!0))),pt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Rn(e){e.flags|=4}function zc(e,t,l,i,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Em())e.flags|=8192;else throw Ol=Vs,Ko}else e.flags&=-16777217}function lm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!yh(t))if(Em())e.flags|=8192;else throw Ol=Vs,Ko}function ri(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Rd():536870912,e.lanes|=t,_a|=t)}function Cr(e,t){if(!ze)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var i=null;l!==null;)l.alternate!==null&&(i=l),l=l.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,i=0;if(t)for(var c=e.child;c!==null;)l|=c.lanes|c.childLanes,i|=c.subtreeFlags&65011712,i|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)l|=c.lanes|c.childLanes,i|=c.subtreeFlags,i|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=i,e.childLanes=l,t}function Qy(e,t,l){var i=t.pendingProps;switch(qo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return Je(t),null;case 3:return l=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Mn(at),Ye(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(ha(t)?Rn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Vo())),Je(t),null;case 26:var c=t.type,m=t.memoizedState;return e===null?(Rn(t),m!==null?(Je(t),lm(t,m)):(Je(t),zc(t,c,null,i,l))):m?m!==e.memoizedState?(Rn(t),Je(t),lm(t,m)):(Je(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Rn(t),Je(t),zc(t,c,e,i,l)),null;case 27:if(Nn(t),l=pe.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Rn(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return Je(t),null}e=oe.current,ha(t)?Lf(t):(e=uh(c,i,l),t.stateNode=e,Rn(t))}return Je(t),null;case 5:if(Nn(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Rn(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return Je(t),null}if(m=oe.current,ha(t))Lf(t);else{var b=vi(pe.current);switch(m){case 1:m=b.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:m=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":m=b.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":m=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":m=b.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?m.multiple=!0:i.size&&(m.size=i.size);break;default:m=typeof i.is=="string"?b.createElement(c,{is:i.is}):b.createElement(c)}}m[mt]=t,m[Ct]=i;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)m.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=m;e:switch(gt(m,c,i),c){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Rn(t)}}return Je(t),zc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Rn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(e=pe.current,ha(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,c=ht,c!==null)switch(c.tag){case 27:case 5:i=c.memoizedProps}e[mt]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||Wm(e.nodeValue,l)),e||In(t,!0)}else e=vi(e).createTextNode(i),e[mt]=t,t.stateNode=e}return Je(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=ha(t),l!==null){if(e===null){if(!i)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[mt]=t}else Tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),e=!1}else l=Vo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Bt(t),t):(Bt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return Je(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ha(t),i!==null&&i.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[mt]=t}else Tl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),c=!1}else c=Vo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Bt(t),t):(Bt(t),null)}return Bt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,c=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(c=i.alternate.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==c&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),ri(t,t.updateQueue),Je(t),null);case 4:return Ye(),e===null&&eu(t.stateNode.containerInfo),Je(t),null;case 10:return Mn(t.type),Je(t),null;case 19:if(F(nt),i=t.memoizedState,i===null)return Je(t),null;if(c=(t.flags&128)!==0,m=i.rendering,m===null)if(c)Cr(i,!1);else{if(tt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=Xs(e),m!==null){for(t.flags|=128,Cr(i,!1),e=m.updateQueue,t.updateQueue=e,ri(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Mf(l,e),l=l.sibling;return w(nt,nt.current&1|2),ze&&En(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&jt()>ui&&(t.flags|=128,c=!0,Cr(i,!1),t.lanes=4194304)}else{if(!c)if(e=Xs(m),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,ri(t,e),Cr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!m.alternate&&!ze)return Je(t),null}else 2*jt()-i.renderingStartTime>ui&&l!==536870912&&(t.flags|=128,c=!0,Cr(i,!1),t.lanes=4194304);i.isBackwards?(m.sibling=t.child,t.child=m):(e=i.last,e!==null?e.sibling=m:t.child=m,i.last=m)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=jt(),e.sibling=null,l=nt.current,w(nt,c?l&1|2:l&1),ze&&En(t,i.treeForkCount),e):(Je(t),null);case 22:case 23:return Bt(t),tc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),l=t.updateQueue,l!==null&&ri(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&F(Ml),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Mn(at),Je(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Xy(e,t){switch(qo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Mn(at),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Nn(t),null;case 31:if(t.memoizedState!==null){if(Bt(t),t.alternate===null)throw Error(o(340));Tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Tl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(nt),null;case 4:return Ye(),null;case 10:return Mn(t.type),null;case 22:case 23:return Bt(t),tc(),e!==null&&F(Ml),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Mn(at),null;case 25:return null;default:return null}}function am(e,t){switch(qo(t),t.tag){case 3:Mn(at),Ye();break;case 26:case 27:case 5:Nn(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&Bt(t);break;case 13:Bt(t);break;case 19:F(nt);break;case 10:Mn(t.type);break;case 22:case 23:Bt(t),tc(),e!==null&&F(Ml);break;case 24:Mn(at)}}function _r(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var c=i.next;l=c;do{if((l.tag&e)===e){i=void 0;var m=l.create,b=l.inst;i=m(),b.destroy=i}l=l.next}while(l!==c)}}catch(N){Be(t,t.return,N)}}function ll(e,t,l){try{var i=t.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var m=c.next;i=m;do{if((i.tag&e)===e){var b=i.inst,N=b.destroy;if(N!==void 0){b.destroy=void 0,c=t;var E=l,Y=N;try{Y()}catch(K){Be(c,E,K)}}}i=i.next}while(i!==m)}}catch(K){Be(t,t.return,K)}}function rm(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Kf(t,l)}catch(i){Be(e,e.return,i)}}}function sm(e,t,l){l.props=Ll(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){Be(e,t,i)}}function Tr(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof l=="function"?e.refCleanup=l(i):l.current=i}}catch(c){Be(e,t,c)}}function hn(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(c){Be(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(c){Be(e,t,c)}else l.current=null}function im(e){var t=e.type,l=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&i.focus();break e;case"img":l.src?i.src=l.src:l.srcSet&&(i.srcset=l.srcSet)}}catch(c){Be(e,e.return,c)}}function Oc(e,t,l){try{var i=e.stateNode;hb(i,e.type,l,t),i[Ct]=t}catch(c){Be(e,e.return,c)}}function om(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ul(e.type)||e.tag===4}function Dc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||om(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ul(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rc(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Cn));else if(i!==4&&(i===27&&ul(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Rc(e,t,l),e=e.sibling;e!==null;)Rc(e,t,l),e=e.sibling}function si(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(i!==4&&(i===27&&ul(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(si(e,t,l),e=e.sibling;e!==null;)si(e,t,l),e=e.sibling}function cm(e){var t=e.stateNode,l=e.memoizedProps;try{for(var i=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);gt(t,i,l),t[mt]=e,t[Ct]=l}catch(m){Be(e,e.return,m)}}var Ln=!1,it=!1,Lc=!1,um=typeof WeakSet=="function"?WeakSet:Set,ft=null;function Fy(e,t){if(e=e.containerInfo,lu=_i,e=Nf(e),Eo(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var c=i.anchorOffset,m=i.focusNode;i=i.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var b=0,N=-1,E=-1,Y=0,K=0,te=e,G=null;t:for(;;){for(var X;te!==l||c!==0&&te.nodeType!==3||(N=b+c),te!==m||i!==0&&te.nodeType!==3||(E=b+i),te.nodeType===3&&(b+=te.nodeValue.length),(X=te.firstChild)!==null;)G=te,te=X;for(;;){if(te===e)break t;if(G===l&&++Y===c&&(N=b),G===m&&++K===i&&(E=b),(X=te.nextSibling)!==null)break;te=G,G=te.parentNode}te=X}l=N===-1||E===-1?null:{start:N,end:E}}else l=null}l=l||{start:0,end:0}}else l=null;for(au={focusedElem:e,selectionRange:l},_i=!1,ft=t;ft!==null;)if(t=ft,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ft=e;else for(;ft!==null;){switch(t=ft,m=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)c=e[l],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,l=t,c=m.memoizedProps,m=m.memoizedState,i=l.stateNode;try{var me=Ll(l.type,c);e=i.getSnapshotBeforeUpdate(me,m),i.__reactInternalSnapshotBeforeUpdate=e}catch(be){Be(l,l.return,be)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)iu(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":iu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,ft=e;break}ft=t.return}}function dm(e,t,l){var i=l.flags;switch(l.tag){case 0:case 11:case 15:Hn(e,l),i&4&&_r(5,l);break;case 1:if(Hn(e,l),i&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(b){Be(l,l.return,b)}else{var c=Ll(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Be(l,l.return,b)}}i&64&&rm(l),i&512&&Tr(l,l.return);break;case 3:if(Hn(e,l),i&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Kf(e,t)}catch(b){Be(l,l.return,b)}}break;case 27:t===null&&i&4&&cm(l);case 26:case 5:Hn(e,l),t===null&&i&4&&im(l),i&512&&Tr(l,l.return);break;case 12:Hn(e,l);break;case 31:Hn(e,l),i&4&&hm(e,l);break;case 13:Hn(e,l),i&4&&xm(e,l),i&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=nb.bind(null,l),Nb(e,l))));break;case 22:if(i=l.memoizedState!==null||Ln,!i){t=t!==null&&t.memoizedState!==null||it,c=Ln;var m=it;Ln=i,(it=t)&&!m?Bn(e,l,(l.subtreeFlags&8772)!==0):Hn(e,l),Ln=c,it=m}break;case 30:break;default:Hn(e,l)}}function fm(e){var t=e.alternate;t!==null&&(e.alternate=null,fm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&fo(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var We=null,Tt=!1;function Un(e,t,l){for(l=l.child;l!==null;)mm(e,t,l),l=l.sibling}function mm(e,t,l){if(ct&&typeof ct.onCommitFiberUnmount=="function")try{ct.onCommitFiberUnmount(Nt,l)}catch{}switch(l.tag){case 26:it||hn(l,t),Un(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:it||hn(l,t);var i=We,c=Tt;ul(l.type)&&(We=l.stateNode,Tt=!1),Un(e,t,l),Ur(l.stateNode),We=i,Tt=c;break;case 5:it||hn(l,t);case 6:if(i=We,c=Tt,We=null,Un(e,t,l),We=i,Tt=c,We!==null)if(Tt)try{(We.nodeType===9?We.body:We.nodeName==="HTML"?We.ownerDocument.body:We).removeChild(l.stateNode)}catch(m){Be(l,t,m)}else try{We.removeChild(l.stateNode)}catch(m){Be(l,t,m)}break;case 18:We!==null&&(Tt?(e=We,rh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Ra(e)):rh(We,l.stateNode));break;case 4:i=We,c=Tt,We=l.stateNode.containerInfo,Tt=!0,Un(e,t,l),We=i,Tt=c;break;case 0:case 11:case 14:case 15:ll(2,l,t),it||ll(4,l,t),Un(e,t,l);break;case 1:it||(hn(l,t),i=l.stateNode,typeof i.componentWillUnmount=="function"&&sm(l,t,i)),Un(e,t,l);break;case 21:Un(e,t,l);break;case 22:it=(i=it)||l.memoizedState!==null,Un(e,t,l),it=i;break;default:Un(e,t,l)}}function hm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ra(e)}catch(l){Be(t,t.return,l)}}}function xm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ra(e)}catch(l){Be(t,t.return,l)}}function Zy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new um),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new um),t;default:throw Error(o(435,e.tag))}}function ii(e,t){var l=Zy(e);t.forEach(function(i){if(!l.has(i)){l.add(i);var c=lb.bind(null,e,i);i.then(c,c)}})}function Et(e,t){var l=t.deletions;if(l!==null)for(var i=0;i<l.length;i++){var c=l[i],m=e,b=t,N=b;e:for(;N!==null;){switch(N.tag){case 27:if(ul(N.type)){We=N.stateNode,Tt=!1;break e}break;case 5:We=N.stateNode,Tt=!1;break e;case 3:case 4:We=N.stateNode.containerInfo,Tt=!0;break e}N=N.return}if(We===null)throw Error(o(160));mm(m,b,c),We=null,Tt=!1,m=c.alternate,m!==null&&(m.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pm(t,e),t=t.sibling}var cn=null;function pm(e,t){var l=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Et(t,e),At(e),i&4&&(ll(3,e,e.return),_r(3,e),ll(5,e,e.return));break;case 1:Et(t,e),At(e),i&512&&(it||l===null||hn(l,l.return)),i&64&&Ln&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?i:l.concat(i))));break;case 26:var c=cn;if(Et(t,e),At(e),i&512&&(it||l===null||hn(l,l.return)),i&4){var m=l!==null?l.memoizedState:null;if(i=e.memoizedState,l===null)if(i===null)if(e.stateNode===null){e:{i=e.type,l=e.memoizedProps,c=c.ownerDocument||c;t:switch(i){case"title":m=c.getElementsByTagName("title")[0],(!m||m[tr]||m[mt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=c.createElement(i),c.head.insertBefore(m,c.querySelector("head > title"))),gt(m,i,l),m[mt]=e,dt(m),i=m;break e;case"link":var b=ph("link","href",c).get(i+(l.href||""));if(b){for(var N=0;N<b.length;N++)if(m=b[N],m.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&m.getAttribute("rel")===(l.rel==null?null:l.rel)&&m.getAttribute("title")===(l.title==null?null:l.title)&&m.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){b.splice(N,1);break t}}m=c.createElement(i),gt(m,i,l),c.head.appendChild(m);break;case"meta":if(b=ph("meta","content",c).get(i+(l.content||""))){for(N=0;N<b.length;N++)if(m=b[N],m.getAttribute("content")===(l.content==null?null:""+l.content)&&m.getAttribute("name")===(l.name==null?null:l.name)&&m.getAttribute("property")===(l.property==null?null:l.property)&&m.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&m.getAttribute("charset")===(l.charSet==null?null:l.charSet)){b.splice(N,1);break t}}m=c.createElement(i),gt(m,i,l),c.head.appendChild(m);break;default:throw Error(o(468,i))}m[mt]=e,dt(m),i=m}e.stateNode=i}else gh(c,e.type,e.stateNode);else e.stateNode=xh(c,i,e.memoizedProps);else m!==i?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,i===null?gh(c,e.type,e.stateNode):xh(c,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Oc(e,e.memoizedProps,l.memoizedProps)}break;case 27:Et(t,e),At(e),i&512&&(it||l===null||hn(l,l.return)),l!==null&&i&4&&Oc(e,e.memoizedProps,l.memoizedProps);break;case 5:if(Et(t,e),At(e),i&512&&(it||l===null||hn(l,l.return)),e.flags&32){c=e.stateNode;try{aa(c,"")}catch(me){Be(e,e.return,me)}}i&4&&e.stateNode!=null&&(c=e.memoizedProps,Oc(e,c,l!==null?l.memoizedProps:c)),i&1024&&(Lc=!0);break;case 6:if(Et(t,e),At(e),i&4){if(e.stateNode===null)throw Error(o(162));i=e.memoizedProps,l=e.stateNode;try{l.nodeValue=i}catch(me){Be(e,e.return,me)}}break;case 3:if(wi=null,c=cn,cn=ji(t.containerInfo),Et(t,e),cn=c,At(e),i&4&&l!==null&&l.memoizedState.isDehydrated)try{Ra(t.containerInfo)}catch(me){Be(e,e.return,me)}Lc&&(Lc=!1,gm(e));break;case 4:i=cn,cn=ji(e.stateNode.containerInfo),Et(t,e),At(e),cn=i;break;case 12:Et(t,e),At(e);break;case 31:Et(t,e),At(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,ii(e,i)));break;case 13:Et(t,e),At(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(ci=jt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,ii(e,i)));break;case 22:c=e.memoizedState!==null;var E=l!==null&&l.memoizedState!==null,Y=Ln,K=it;if(Ln=Y||c,it=K||E,Et(t,e),it=K,Ln=Y,At(e),i&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(l===null||E||Ln||it||Ul(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){E=l=t;try{if(m=E.stateNode,c)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{N=E.stateNode;var te=E.memoizedProps.style,G=te!=null&&te.hasOwnProperty("display")?te.display:null;N.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(me){Be(E,E.return,me)}}}else if(t.tag===6){if(l===null){E=t;try{E.stateNode.nodeValue=c?"":E.memoizedProps}catch(me){Be(E,E.return,me)}}}else if(t.tag===18){if(l===null){E=t;try{var X=E.stateNode;c?sh(X,!0):sh(E.stateNode,!1)}catch(me){Be(E,E.return,me)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(l=i.retryQueue,l!==null&&(i.retryQueue=null,ii(e,l))));break;case 19:Et(t,e),At(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,ii(e,i)));break;case 30:break;case 21:break;default:Et(t,e),At(e)}}function At(e){var t=e.flags;if(t&2){try{for(var l,i=e.return;i!==null;){if(om(i)){l=i;break}i=i.return}if(l==null)throw Error(o(160));switch(l.tag){case 27:var c=l.stateNode,m=Dc(e);si(e,m,c);break;case 5:var b=l.stateNode;l.flags&32&&(aa(b,""),l.flags&=-33);var N=Dc(e);si(e,N,b);break;case 3:case 4:var E=l.stateNode.containerInfo,Y=Dc(e);Rc(e,Y,E);break;default:throw Error(o(161))}}catch(K){Be(e,e.return,K)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;gm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Hn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dm(e,t.alternate,t),t=t.sibling}function Ul(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ll(4,t,t.return),Ul(t);break;case 1:hn(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&sm(t,t.return,l),Ul(t);break;case 27:Ur(t.stateNode);case 26:case 5:hn(t,t.return),Ul(t);break;case 22:t.memoizedState===null&&Ul(t);break;case 30:Ul(t);break;default:Ul(t)}e=e.sibling}}function Bn(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,c=e,m=t,b=m.flags;switch(m.tag){case 0:case 11:case 15:Bn(c,m,l),_r(4,m);break;case 1:if(Bn(c,m,l),i=m,c=i.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(Y){Be(i,i.return,Y)}if(i=m,c=i.updateQueue,c!==null){var N=i.stateNode;try{var E=c.shared.hiddenCallbacks;if(E!==null)for(c.shared.hiddenCallbacks=null,c=0;c<E.length;c++)Zf(E[c],N)}catch(Y){Be(i,i.return,Y)}}l&&b&64&&rm(m),Tr(m,m.return);break;case 27:cm(m);case 26:case 5:Bn(c,m,l),l&&i===null&&b&4&&im(m),Tr(m,m.return);break;case 12:Bn(c,m,l);break;case 31:Bn(c,m,l),l&&b&4&&hm(c,m);break;case 13:Bn(c,m,l),l&&b&4&&xm(c,m);break;case 22:m.memoizedState===null&&Bn(c,m,l),Tr(m,m.return);break;case 30:break;default:Bn(c,m,l)}t=t.sibling}}function Uc(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&hr(l))}function Hc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&hr(e))}function un(e,t,l,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ym(e,t,l,i),t=t.sibling}function ym(e,t,l,i){var c=t.flags;switch(t.tag){case 0:case 11:case 15:un(e,t,l,i),c&2048&&_r(9,t);break;case 1:un(e,t,l,i);break;case 3:un(e,t,l,i),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&hr(e)));break;case 12:if(c&2048){un(e,t,l,i),e=t.stateNode;try{var m=t.memoizedProps,b=m.id,N=m.onPostCommit;typeof N=="function"&&N(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){Be(t,t.return,E)}}else un(e,t,l,i);break;case 31:un(e,t,l,i);break;case 13:un(e,t,l,i);break;case 23:break;case 22:m=t.stateNode,b=t.alternate,t.memoizedState!==null?m._visibility&2?un(e,t,l,i):Er(e,t):m._visibility&2?un(e,t,l,i):(m._visibility|=2,ka(e,t,l,i,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Uc(b,t);break;case 24:un(e,t,l,i),c&2048&&Hc(t.alternate,t);break;default:un(e,t,l,i)}}function ka(e,t,l,i,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var m=e,b=t,N=l,E=i,Y=b.flags;switch(b.tag){case 0:case 11:case 15:ka(m,b,N,E,c),_r(8,b);break;case 23:break;case 22:var K=b.stateNode;b.memoizedState!==null?K._visibility&2?ka(m,b,N,E,c):Er(m,b):(K._visibility|=2,ka(m,b,N,E,c)),c&&Y&2048&&Uc(b.alternate,b);break;case 24:ka(m,b,N,E,c),c&&Y&2048&&Hc(b.alternate,b);break;default:ka(m,b,N,E,c)}t=t.sibling}}function Er(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,i=t,c=i.flags;switch(i.tag){case 22:Er(l,i),c&2048&&Uc(i.alternate,i);break;case 24:Er(l,i),c&2048&&Hc(i.alternate,i);break;default:Er(l,i)}t=t.sibling}}var Ar=8192;function Sa(e,t,l){if(e.subtreeFlags&Ar)for(e=e.child;e!==null;)bm(e,t,l),e=e.sibling}function bm(e,t,l){switch(e.tag){case 26:Sa(e,t,l),e.flags&Ar&&e.memoizedState!==null&&Db(l,cn,e.memoizedState,e.memoizedProps);break;case 5:Sa(e,t,l);break;case 3:case 4:var i=cn;cn=ji(e.stateNode.containerInfo),Sa(e,t,l),cn=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Ar,Ar=16777216,Sa(e,t,l),Ar=i):Sa(e,t,l));break;default:Sa(e,t,l)}}function vm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Mr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var i=t[l];ft=i,Nm(i,e)}vm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jm(e),e=e.sibling}function jm(e){switch(e.tag){case 0:case 11:case 15:Mr(e),e.flags&2048&&ll(9,e,e.return);break;case 3:Mr(e);break;case 12:Mr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,oi(e)):Mr(e);break;default:Mr(e)}}function oi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var i=t[l];ft=i,Nm(i,e)}vm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ll(8,t,t.return),oi(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,oi(t));break;default:oi(t)}e=e.sibling}}function Nm(e,t){for(;ft!==null;){var l=ft;switch(l.tag){case 0:case 11:case 15:ll(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var i=l.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:hr(l.memoizedState.cache)}if(i=l.child,i!==null)i.return=l,ft=i;else e:for(l=e;ft!==null;){i=ft;var c=i.sibling,m=i.return;if(fm(i),i===l){ft=null;break e}if(c!==null){c.return=m,ft=c;break e}ft=m}}}var Ky={getCacheForType:function(e){var t=xt(at),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return xt(at).controller.signal}},Iy=typeof WeakMap=="function"?WeakMap:Map,Le=0,Fe=null,Ce=null,Ae=0,He=0,qt=null,al=!1,Ca=!1,Bc=!1,qn=0,tt=0,rl=0,Hl=0,qc=0,Yt=0,_a=0,zr=null,Mt=null,Yc=!1,ci=0,wm=0,ui=1/0,di=null,sl=null,ut=0,il=null,Ta=null,Yn=0,Vc=0,Gc=null,km=null,Or=0,$c=null;function Vt(){return(Le&2)!==0&&Ae!==0?Ae&-Ae:A.T!==null?Ic():Bd()}function Sm(){if(Yt===0)if((Ae&536870912)===0||ze){var e=bs;bs<<=1,(bs&3932160)===0&&(bs=262144),Yt=e}else Yt=536870912;return e=Ht.current,e!==null&&(e.flags|=32),Yt}function zt(e,t,l){(e===Fe&&(He===2||He===9)||e.cancelPendingCommit!==null)&&(Ea(e,0),ol(e,Ae,Yt,!1)),er(e,l),((Le&2)===0||e!==Fe)&&(e===Fe&&((Le&2)===0&&(Hl|=l),tt===4&&ol(e,Ae,Yt,!1)),xn(e))}function Cm(e,t,l){if((Le&6)!==0)throw Error(o(327));var i=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Wa(e,t),c=i?Wy(e,t):Xc(e,t,!0),m=i;do{if(c===0){Ca&&!i&&ol(e,t,0,!1);break}else{if(l=e.current.alternate,m&&!Jy(l)){c=Xc(e,t,!1),m=!1;continue}if(c===2){if(m=t,e.errorRecoveryDisabledLanes&m)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var N=e;c=zr;var E=N.current.memoizedState.isDehydrated;if(E&&(Ea(N,b).flags|=256),b=Xc(N,b,!1),b!==2){if(Bc&&!E){N.errorRecoveryDisabledLanes|=m,Hl|=m,c=4;break e}m=Mt,Mt=c,m!==null&&(Mt===null?Mt=m:Mt.push.apply(Mt,m))}c=b}if(m=!1,c!==2)continue}}if(c===1){Ea(e,0),ol(e,t,0,!0);break}e:{switch(i=e,m=c,m){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:ol(i,t,Yt,!al);break e;case 2:Mt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=ci+300-jt(),10<c)){if(ol(i,t,Yt,!al),js(i,0,!0)!==0)break e;Yn=t,i.timeoutHandle=lh(_m.bind(null,i,l,Mt,di,Yc,t,Yt,Hl,_a,al,m,"Throttled",-0,0),c);break e}_m(i,l,Mt,di,Yc,t,Yt,Hl,_a,al,m,null,-0,0)}}break}while(!0);xn(e)}function _m(e,t,l,i,c,m,b,N,E,Y,K,te,G,X){if(e.timeoutHandle=-1,te=t.subtreeFlags,te&8192||(te&16785408)===16785408){te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Cn},bm(t,m,te);var me=(m&62914560)===m?ci-jt():(m&4194048)===m?wm-jt():0;if(me=Rb(te,me),me!==null){Yn=m,e.cancelPendingCommit=me(Rm.bind(null,e,t,m,l,i,c,b,N,E,K,te,null,G,X)),ol(e,m,b,!Y);return}}Rm(e,t,m,l,i,c,b,N,E)}function Jy(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var i=0;i<l.length;i++){var c=l[i],m=c.getSnapshot;c=c.value;try{if(!Lt(m(),c))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;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 ol(e,t,l,i){t&=~qc,t&=~Hl,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var c=t;0<c;){var m=31-Xe(c),b=1<<m;i[m]=-1,c&=~b}l!==0&&Ld(e,l,t)}function fi(){return(Le&6)===0?(Dr(0),!1):!0}function Qc(){if(Ce!==null){if(He===0)var e=Ce.return;else e=Ce,An=El=null,ic(e),ba=null,pr=0,e=Ce;for(;e!==null;)am(e.alternate,e),e=e.return;Ce=null}}function Ea(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,gb(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Yn=0,Qc(),Fe=e,Ce=l=Tn(e.current,null),Ae=t,He=0,qt=null,al=!1,Ca=Wa(e,t),Bc=!1,_a=Yt=qc=Hl=rl=tt=0,Mt=zr=null,Yc=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var c=31-Xe(i),m=1<<c;t|=e[c],i&=~m}return qn=t,Os(),l}function Tm(e,t){Ne=null,A.H=kr,t===ya||t===Ys?(t=$f(),He=3):t===Ko?(t=$f(),He=4):He=t===wc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,qt=t,Ce===null&&(tt=1,ti(e,It(t,e.current)))}function Em(){var e=Ht.current;return e===null?!0:(Ae&4194048)===Ae?en===null:(Ae&62914560)===Ae||(Ae&536870912)!==0?e===en:!1}function Am(){var e=A.H;return A.H=kr,e===null?kr:e}function Mm(){var e=A.A;return A.A=Ky,e}function mi(){tt=4,al||(Ae&4194048)!==Ae&&Ht.current!==null||(Ca=!0),(rl&134217727)===0&&(Hl&134217727)===0||Fe===null||ol(Fe,Ae,Yt,!1)}function Xc(e,t,l){var i=Le;Le|=2;var c=Am(),m=Mm();(Fe!==e||Ae!==t)&&(di=null,Ea(e,t)),t=!1;var b=tt;e:do try{if(He!==0&&Ce!==null){var N=Ce,E=qt;switch(He){case 8:Qc(),b=6;break e;case 3:case 2:case 9:case 6:Ht.current===null&&(t=!0);var Y=He;if(He=0,qt=null,Aa(e,N,E,Y),l&&Ca){b=0;break e}break;default:Y=He,He=0,qt=null,Aa(e,N,E,Y)}}Py(),b=tt;break}catch(K){Tm(e,K)}while(!0);return t&&e.shellSuspendCounter++,An=El=null,Le=i,A.H=c,A.A=m,Ce===null&&(Fe=null,Ae=0,Os()),b}function Py(){for(;Ce!==null;)zm(Ce)}function Wy(e,t){var l=Le;Le|=2;var i=Am(),c=Mm();Fe!==e||Ae!==t?(di=null,ui=jt()+500,Ea(e,t)):Ca=Wa(e,t);e:do try{if(He!==0&&Ce!==null){t=Ce;var m=qt;t:switch(He){case 1:He=0,qt=null,Aa(e,t,m,1);break;case 2:case 9:if(Vf(m)){He=0,qt=null,Om(t);break}t=function(){He!==2&&He!==9||Fe!==e||(He=7),xn(e)},m.then(t,t);break e;case 3:He=7;break e;case 4:He=5;break e;case 7:Vf(m)?(He=0,qt=null,Om(t)):(He=0,qt=null,Aa(e,t,m,7));break;case 5:var b=null;switch(Ce.tag){case 26:b=Ce.memoizedState;case 5:case 27:var N=Ce;if(b?yh(b):N.stateNode.complete){He=0,qt=null;var E=N.sibling;if(E!==null)Ce=E;else{var Y=N.return;Y!==null?(Ce=Y,hi(Y)):Ce=null}break t}}He=0,qt=null,Aa(e,t,m,5);break;case 6:He=0,qt=null,Aa(e,t,m,6);break;case 8:Qc(),tt=6;break e;default:throw Error(o(462))}}eb();break}catch(K){Tm(e,K)}while(!0);return An=El=null,A.H=i,A.A=c,Le=l,Ce!==null?0:(Fe=null,Ae=0,Os(),tt)}function eb(){for(;Ce!==null&&!ao();)zm(Ce)}function zm(e){var t=nm(e.alternate,e,qn);e.memoizedProps=e.pendingProps,t===null?hi(e):Ce=t}function Om(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=I0(l,t,t.pendingProps,t.type,void 0,Ae);break;case 11:t=I0(l,t,t.pendingProps,t.type.render,t.ref,Ae);break;case 5:ic(t);default:am(l,t),t=Ce=Mf(t,qn),t=nm(l,t,qn)}e.memoizedProps=e.pendingProps,t===null?hi(e):Ce=t}function Aa(e,t,l,i){An=El=null,ic(t),ba=null,pr=0;var c=t.return;try{if(Vy(e,c,t,l,Ae)){tt=1,ti(e,It(l,e.current)),Ce=null;return}}catch(m){if(c!==null)throw Ce=c,m;tt=1,ti(e,It(l,e.current)),Ce=null;return}t.flags&32768?(ze||i===1?e=!0:Ca||(Ae&536870912)!==0?e=!1:(al=e=!0,(i===2||i===9||i===3||i===6)&&(i=Ht.current,i!==null&&i.tag===13&&(i.flags|=16384))),Dm(t,e)):hi(t)}function hi(e){var t=e;do{if((t.flags&32768)!==0){Dm(t,al);return}e=t.return;var l=Qy(t.alternate,t,qn);if(l!==null){Ce=l;return}if(t=t.sibling,t!==null){Ce=t;return}Ce=t=e}while(t!==null);tt===0&&(tt=5)}function Dm(e,t){do{var l=Xy(e.alternate,e);if(l!==null){l.flags&=32767,Ce=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){Ce=e;return}Ce=e=l}while(e!==null);tt=6,Ce=null}function Rm(e,t,l,i,c,m,b,N,E){e.cancelPendingCommit=null;do xi();while(ut!==0);if((Le&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(m=t.lanes|t.childLanes,m|=Do,Og(e,l,m,b,N,E),e===Fe&&(Ce=Fe=null,Ae=0),Ta=t,il=e,Yn=l,Vc=m,Gc=c,km=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ab(ve,function(){return qm(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=A.T,A.T=null,c=O.p,O.p=2,b=Le,Le|=4;try{Fy(e,t,l)}finally{Le=b,O.p=c,A.T=i}}ut=1,Lm(),Um(),Hm()}}function Lm(){if(ut===1){ut=0;var e=il,t=Ta,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=A.T,A.T=null;var i=O.p;O.p=2;var c=Le;Le|=4;try{pm(t,e);var m=au,b=Nf(e.containerInfo),N=m.focusedElem,E=m.selectionRange;if(b!==N&&N&&N.ownerDocument&&jf(N.ownerDocument.documentElement,N)){if(E!==null&&Eo(N)){var Y=E.start,K=E.end;if(K===void 0&&(K=Y),"selectionStart"in N)N.selectionStart=Y,N.selectionEnd=Math.min(K,N.value.length);else{var te=N.ownerDocument||document,G=te&&te.defaultView||window;if(G.getSelection){var X=G.getSelection(),me=N.textContent.length,be=Math.min(E.start,me),$e=E.end===void 0?be:Math.min(E.end,me);!X.extend&&be>$e&&(b=$e,$e=be,be=b);var B=vf(N,be),L=vf(N,$e);if(B&&L&&(X.rangeCount!==1||X.anchorNode!==B.node||X.anchorOffset!==B.offset||X.focusNode!==L.node||X.focusOffset!==L.offset)){var q=te.createRange();q.setStart(B.node,B.offset),X.removeAllRanges(),be>$e?(X.addRange(q),X.extend(L.node,L.offset)):(q.setEnd(L.node,L.offset),X.addRange(q))}}}}for(te=[],X=N;X=X.parentNode;)X.nodeType===1&&te.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<te.length;N++){var W=te[N];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}_i=!!lu,au=lu=null}finally{Le=c,O.p=i,A.T=l}}e.current=t,ut=2}}function Um(){if(ut===2){ut=0;var e=il,t=Ta,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=A.T,A.T=null;var i=O.p;O.p=2;var c=Le;Le|=4;try{dm(e,t.alternate,t)}finally{Le=c,O.p=i,A.T=l}}ut=3}}function Hm(){if(ut===4||ut===3){ut=0,ro();var e=il,t=Ta,l=Yn,i=km;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ut=5:(ut=0,Ta=il=null,Bm(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(sl=null),co(l),t=t.stateNode,ct&&typeof ct.onCommitFiberRoot=="function")try{ct.onCommitFiberRoot(Nt,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=A.T,c=O.p,O.p=2,A.T=null;try{for(var m=e.onRecoverableError,b=0;b<i.length;b++){var N=i[b];m(N.value,{componentStack:N.stack})}}finally{A.T=t,O.p=c}}(Yn&3)!==0&&xi(),xn(e),c=e.pendingLanes,(l&261930)!==0&&(c&42)!==0?e===$c?Or++:(Or=0,$c=e):Or=0,Dr(0)}}function Bm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,hr(t)))}function xi(){return Lm(),Um(),Hm(),qm()}function qm(){if(ut!==5)return!1;var e=il,t=Vc;Vc=0;var l=co(Yn),i=A.T,c=O.p;try{O.p=32>l?32:l,A.T=null,l=Gc,Gc=null;var m=il,b=Yn;if(ut=0,Ta=il=null,Yn=0,(Le&6)!==0)throw Error(o(331));var N=Le;if(Le|=4,jm(m.current),ym(m,m.current,b,l),Le=N,Dr(0,!1),ct&&typeof ct.onPostCommitFiberRoot=="function")try{ct.onPostCommitFiberRoot(Nt,m)}catch{}return!0}finally{O.p=c,A.T=i,Bm(e,t)}}function Ym(e,t,l){t=It(l,t),t=Nc(e.stateNode,t,2),e=el(e,t,2),e!==null&&(er(e,2),xn(e))}function Be(e,t,l){if(e.tag===3)Ym(e,e,l);else for(;t!==null;){if(t.tag===3){Ym(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(sl===null||!sl.has(i))){e=It(l,e),l=V0(2),i=el(t,l,2),i!==null&&(G0(l,i,t,e),er(i,2),xn(i));break}}t=t.return}}function Fc(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new Iy;var c=new Set;i.set(t,c)}else c=i.get(t),c===void 0&&(c=new Set,i.set(t,c));c.has(l)||(Bc=!0,c.add(l),e=tb.bind(null,e,t,l),t.then(e,e))}function tb(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Fe===e&&(Ae&l)===l&&(tt===4||tt===3&&(Ae&62914560)===Ae&&300>jt()-ci?(Le&2)===0&&Ea(e,0):qc|=l,_a===Ae&&(_a=0)),xn(e)}function Vm(e,t){t===0&&(t=Rd()),e=Cl(e,t),e!==null&&(er(e,t),xn(e))}function nb(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Vm(e,l)}function lb(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,c=e.memoizedState;c!==null&&(l=c.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(o(314))}i!==null&&i.delete(t),Vm(e,l)}function ab(e,t){return Jl(e,t)}var pi=null,Ma=null,Zc=!1,gi=!1,Kc=!1,cl=0;function xn(e){e!==Ma&&e.next===null&&(Ma===null?pi=Ma=e:Ma=Ma.next=e),gi=!0,Zc||(Zc=!0,sb())}function Dr(e,t){if(!Kc&&gi){Kc=!0;do for(var l=!1,i=pi;i!==null;){if(e!==0){var c=i.pendingLanes;if(c===0)var m=0;else{var b=i.suspendedLanes,N=i.pingedLanes;m=(1<<31-Xe(42|e)+1)-1,m&=c&~(b&~N),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,Xm(i,m))}else m=Ae,m=js(i,i===Fe?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(m&3)===0||Wa(i,m)||(l=!0,Xm(i,m));i=i.next}while(l);Kc=!1}}function rb(){Gm()}function Gm(){gi=Zc=!1;var e=0;cl!==0&&pb()&&(e=cl);for(var t=jt(),l=null,i=pi;i!==null;){var c=i.next,m=$m(i,t);m===0?(i.next=null,l===null?pi=c:l.next=c,c===null&&(Ma=l)):(l=i,(e!==0||(m&3)!==0)&&(gi=!0)),i=c}ut!==0&&ut!==5||Dr(e),cl!==0&&(cl=0)}function $m(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,c=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var b=31-Xe(m),N=1<<b,E=c[b];E===-1?((N&l)===0||(N&i)!==0)&&(c[b]=zg(N,t)):E<=t&&(e.expiredLanes|=N),m&=~N}if(t=Fe,l=Ae,l=js(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,l===0||e===t&&(He===2||He===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Pa(i),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Wa(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(i!==null&&Pa(i),co(l)){case 2:case 8:l=ce;break;case 32:l=ve;break;case 268435456:l=Ue;break;default:l=ve}return i=Qm.bind(null,e),l=Jl(l,i),e.callbackPriority=t,e.callbackNode=l,t}return i!==null&&i!==null&&Pa(i),e.callbackPriority=2,e.callbackNode=null,2}function Qm(e,t){if(ut!==0&&ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(xi()&&e.callbackNode!==l)return null;var i=Ae;return i=js(e,e===Fe?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Cm(e,i,t),$m(e,jt()),e.callbackNode!=null&&e.callbackNode===l?Qm.bind(null,e):null)}function Xm(e,t){if(xi())return null;Cm(e,t,!0)}function sb(){yb(function(){(Le&6)!==0?Jl(P,rb):Gm()})}function Ic(){if(cl===0){var e=pa;e===0&&(e=ys,ys<<=1,(ys&261888)===0&&(ys=256)),cl=e}return cl}function Fm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ss(""+e)}function Zm(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function ib(e,t,l,i,c){if(t==="submit"&&l&&l.stateNode===c){var m=Fm((c[Ct]||null).action),b=i.submitter;b&&(t=(t=b[Ct]||null)?Fm(t.formAction):b.getAttribute("formAction"),t!==null&&(m=t,b=null));var N=new Es("action","action",null,i,c);e.push({event:N,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(cl!==0){var E=b?Zm(c,b):new FormData(c);pc(l,{pending:!0,data:E,method:c.method,action:m},null,E)}}else typeof m=="function"&&(N.preventDefault(),E=b?Zm(c,b):new FormData(c),pc(l,{pending:!0,data:E,method:c.method,action:m},m,E))},currentTarget:c}]})}}for(var Jc=0;Jc<Oo.length;Jc++){var Pc=Oo[Jc],ob=Pc.toLowerCase(),cb=Pc[0].toUpperCase()+Pc.slice(1);on(ob,"on"+cb)}on(Sf,"onAnimationEnd"),on(Cf,"onAnimationIteration"),on(_f,"onAnimationStart"),on("dblclick","onDoubleClick"),on("focusin","onFocus"),on("focusout","onBlur"),on(Sy,"onTransitionRun"),on(Cy,"onTransitionStart"),on(_y,"onTransitionCancel"),on(Tf,"onTransitionEnd"),na("onMouseEnter",["mouseout","mouseover"]),na("onMouseLeave",["mouseout","mouseover"]),na("onPointerEnter",["pointerout","pointerover"]),na("onPointerLeave",["pointerout","pointerover"]),Nl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Nl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Nl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Nl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Nl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Nl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rr="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(" "),ub=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rr));function Km(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var i=e[l],c=i.event;i=i.listeners;e:{var m=void 0;if(t)for(var b=i.length-1;0<=b;b--){var N=i[b],E=N.instance,Y=N.currentTarget;if(N=N.listener,E!==m&&c.isPropagationStopped())break e;m=N,c.currentTarget=Y;try{m(c)}catch(K){zs(K)}c.currentTarget=null,m=E}else for(b=0;b<i.length;b++){if(N=i[b],E=N.instance,Y=N.currentTarget,N=N.listener,E!==m&&c.isPropagationStopped())break e;m=N,c.currentTarget=Y;try{m(c)}catch(K){zs(K)}c.currentTarget=null,m=E}}}}function _e(e,t){var l=t[uo];l===void 0&&(l=t[uo]=new Set);var i=e+"__bubble";l.has(i)||(Im(t,e,2,!1),l.add(i))}function Wc(e,t,l){var i=0;t&&(i|=4),Im(l,e,i,t)}var yi="_reactListening"+Math.random().toString(36).slice(2);function eu(e){if(!e[yi]){e[yi]=!0,Vd.forEach(function(l){l!=="selectionchange"&&(ub.has(l)||Wc(l,!1,e),Wc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[yi]||(t[yi]=!0,Wc("selectionchange",!1,t))}}function Im(e,t,l,i){switch(Sh(t)){case 2:var c=Hb;break;case 8:c=Bb;break;default:c=xu}l=c.bind(null,t,l,e),c=void 0,!vo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),i?c!==void 0?e.addEventListener(t,l,{capture:!0,passive:c}):e.addEventListener(t,l,!0):c!==void 0?e.addEventListener(t,l,{passive:c}):e.addEventListener(t,l,!1)}function tu(e,t,l,i,c){var m=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var b=i.tag;if(b===3||b===4){var N=i.stateNode.containerInfo;if(N===c)break;if(b===4)for(b=i.return;b!==null;){var E=b.tag;if((E===3||E===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;N!==null;){if(b=Wl(N),b===null)return;if(E=b.tag,E===5||E===6||E===26||E===27){i=m=b;continue e}N=N.parentNode}}i=i.return}ef(function(){var Y=m,K=yo(l),te=[];e:{var G=Ef.get(e);if(G!==void 0){var X=Es,me=e;switch(e){case"keypress":if(_s(l)===0)break e;case"keydown":case"keyup":X=ly;break;case"focusin":me="focus",X=ko;break;case"focusout":me="blur",X=ko;break;case"beforeblur":case"afterblur":X=ko;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":X=lf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=Qg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=sy;break;case Sf:case Cf:case _f:X=Zg;break;case Tf:X=oy;break;case"scroll":case"scrollend":X=Gg;break;case"wheel":X=uy;break;case"copy":case"cut":case"paste":X=Ig;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=rf;break;case"toggle":case"beforetoggle":X=fy}var be=(t&4)!==0,$e=!be&&(e==="scroll"||e==="scrollend"),B=be?G!==null?G+"Capture":null:G;be=[];for(var L=Y,q;L!==null;){var W=L;if(q=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||q===null||B===null||(W=lr(L,B),W!=null&&be.push(Lr(L,W,q))),$e)break;L=L.return}0<be.length&&(G=new X(G,me,null,l,K),te.push({event:G,listeners:be}))}}if((t&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",X=e==="mouseout"||e==="pointerout",G&&l!==go&&(me=l.relatedTarget||l.fromElement)&&(Wl(me)||me[Pl]))break e;if((X||G)&&(G=K.window===K?K:(G=K.ownerDocument)?G.defaultView||G.parentWindow:window,X?(me=l.relatedTarget||l.toElement,X=Y,me=me?Wl(me):null,me!==null&&($e=d(me),be=me.tag,me!==$e||be!==5&&be!==27&&be!==6)&&(me=null)):(X=null,me=Y),X!==me)){if(be=lf,W="onMouseLeave",B="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(be=rf,W="onPointerLeave",B="onPointerEnter",L="pointer"),$e=X==null?G:nr(X),q=me==null?G:nr(me),G=new be(W,L+"leave",X,l,K),G.target=$e,G.relatedTarget=q,W=null,Wl(K)===Y&&(be=new be(B,L+"enter",me,l,K),be.target=q,be.relatedTarget=$e,W=be),$e=W,X&&me)t:{for(be=db,B=X,L=me,q=0,W=B;W;W=be(W))q++;W=0;for(var ge=L;ge;ge=be(ge))W++;for(;0<q-W;)B=be(B),q--;for(;0<W-q;)L=be(L),W--;for(;q--;){if(B===L||L!==null&&B===L.alternate){be=B;break t}B=be(B),L=be(L)}be=null}else be=null;X!==null&&Jm(te,G,X,be,!1),me!==null&&$e!==null&&Jm(te,$e,me,be,!0)}}e:{if(G=Y?nr(Y):window,X=G.nodeName&&G.nodeName.toLowerCase(),X==="select"||X==="input"&&G.type==="file")var De=hf;else if(ff(G))if(xf)De=Ny;else{De=vy;var he=by}else X=G.nodeName,!X||X.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?Y&&po(Y.elementType)&&(De=hf):De=jy;if(De&&(De=De(e,Y))){mf(te,De,l,K);break e}he&&he(e,G,Y),e==="focusout"&&Y&&G.type==="number"&&Y.memoizedProps.value!=null&&xo(G,"number",G.value)}switch(he=Y?nr(Y):window,e){case"focusin":(ff(he)||he.contentEditable==="true")&&(oa=he,Ao=Y,dr=null);break;case"focusout":dr=Ao=oa=null;break;case"mousedown":Mo=!0;break;case"contextmenu":case"mouseup":case"dragend":Mo=!1,wf(te,l,K);break;case"selectionchange":if(ky)break;case"keydown":case"keyup":wf(te,l,K)}var we;if(Co)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else ia?uf(e,l)&&(Me="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Me="onCompositionStart");Me&&(sf&&l.locale!=="ko"&&(ia||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&ia&&(we=tf()):(Fn=K,jo="value"in Fn?Fn.value:Fn.textContent,ia=!0)),he=bi(Y,Me),0<he.length&&(Me=new af(Me,e,null,l,K),te.push({event:Me,listeners:he}),we?Me.data=we:(we=df(l),we!==null&&(Me.data=we)))),(we=hy?xy(e,l):py(e,l))&&(Me=bi(Y,"onBeforeInput"),0<Me.length&&(he=new af("onBeforeInput","beforeinput",null,l,K),te.push({event:he,listeners:Me}),he.data=we)),ib(te,e,Y,l,K)}Km(te,t)})}function Lr(e,t,l){return{instance:e,listener:t,currentTarget:l}}function bi(e,t){for(var l=t+"Capture",i=[];e!==null;){var c=e,m=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||m===null||(c=lr(e,l),c!=null&&i.unshift(Lr(e,c,m)),c=lr(e,t),c!=null&&i.push(Lr(e,c,m))),e.tag===3)return i;e=e.return}return[]}function db(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Jm(e,t,l,i,c){for(var m=t._reactName,b=[];l!==null&&l!==i;){var N=l,E=N.alternate,Y=N.stateNode;if(N=N.tag,E!==null&&E===i)break;N!==5&&N!==26&&N!==27||Y===null||(E=Y,c?(Y=lr(l,m),Y!=null&&b.unshift(Lr(l,Y,E))):c||(Y=lr(l,m),Y!=null&&b.push(Lr(l,Y,E)))),l=l.return}b.length!==0&&e.push({event:t,listeners:b})}var fb=/\r\n?/g,mb=/\u0000|\uFFFD/g;function Pm(e){return(typeof e=="string"?e:""+e).replace(fb,`
`).replace(mb,"")}function Wm(e,t){return t=Pm(t),Pm(e)===t}function Ge(e,t,l,i,c,m){switch(l){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||aa(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&aa(e,""+i);break;case"className":ws(e,"class",i);break;case"tabIndex":ws(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":ws(e,l,i);break;case"style":Pd(e,i,m);break;case"data":if(t!=="object"){ws(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(l);break}i=Ss(""+i),e.setAttribute(l,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(l==="formAction"?(t!=="input"&&Ge(e,t,"name",c.name,c,null),Ge(e,t,"formEncType",c.formEncType,c,null),Ge(e,t,"formMethod",c.formMethod,c,null),Ge(e,t,"formTarget",c.formTarget,c,null)):(Ge(e,t,"encType",c.encType,c,null),Ge(e,t,"method",c.method,c,null),Ge(e,t,"target",c.target,c,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(l);break}i=Ss(""+i),e.setAttribute(l,i);break;case"onClick":i!=null&&(e.onclick=Cn);break;case"onScroll":i!=null&&_e("scroll",e);break;case"onScrollEnd":i!=null&&_e("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(l=i.__html,l!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}l=Ss(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,""+i):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":i===!0?e.setAttribute(l,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,i):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(l,i):e.removeAttribute(l);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(l):e.setAttribute(l,i);break;case"popover":_e("beforetoggle",e),_e("toggle",e),Ns(e,"popover",i);break;case"xlinkActuate":Sn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Sn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Sn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Sn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Sn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Sn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Sn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Sn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Sn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ns(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Yg.get(l)||l,Ns(e,l,i))}}function nu(e,t,l,i,c,m){switch(l){case"style":Pd(e,i,m);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(l=i.__html,l!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=l}}break;case"children":typeof i=="string"?aa(e,i):(typeof i=="number"||typeof i=="bigint")&&aa(e,""+i);break;case"onScroll":i!=null&&_e("scroll",e);break;case"onScrollEnd":i!=null&&_e("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Cn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Gd.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(c=l.endsWith("Capture"),t=l.slice(2,c?l.length-7:void 0),m=e[Ct]||null,m=m!=null?m[l]:null,typeof m=="function"&&e.removeEventListener(t,m,c),typeof i=="function")){typeof m!="function"&&m!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,i,c);break e}l in e?e[l]=i:i===!0?e.setAttribute(l,""):Ns(e,l,i)}}}function gt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_e("error",e),_e("load",e);var i=!1,c=!1,m;for(m in l)if(l.hasOwnProperty(m)){var b=l[m];if(b!=null)switch(m){case"src":i=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ge(e,t,m,b,l,null)}}c&&Ge(e,t,"srcSet",l.srcSet,l,null),i&&Ge(e,t,"src",l.src,l,null);return;case"input":_e("invalid",e);var N=m=b=c=null,E=null,Y=null;for(i in l)if(l.hasOwnProperty(i)){var K=l[i];if(K!=null)switch(i){case"name":c=K;break;case"type":b=K;break;case"checked":E=K;break;case"defaultChecked":Y=K;break;case"value":m=K;break;case"defaultValue":N=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(o(137,t));break;default:Ge(e,t,i,K,l,null)}}Zd(e,m,N,E,Y,b,c,!1);return;case"select":_e("invalid",e),i=b=m=null;for(c in l)if(l.hasOwnProperty(c)&&(N=l[c],N!=null))switch(c){case"value":m=N;break;case"defaultValue":b=N;break;case"multiple":i=N;default:Ge(e,t,c,N,l,null)}t=m,l=b,e.multiple=!!i,t!=null?la(e,!!i,t,!1):l!=null&&la(e,!!i,l,!0);return;case"textarea":_e("invalid",e),m=c=i=null;for(b in l)if(l.hasOwnProperty(b)&&(N=l[b],N!=null))switch(b){case"value":i=N;break;case"defaultValue":c=N;break;case"children":m=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(o(91));break;default:Ge(e,t,b,N,l,null)}Id(e,i,c,m);return;case"option":for(E in l)if(l.hasOwnProperty(E)&&(i=l[E],i!=null))switch(E){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Ge(e,t,E,i,l,null)}return;case"dialog":_e("beforetoggle",e),_e("toggle",e),_e("cancel",e),_e("close",e);break;case"iframe":case"object":_e("load",e);break;case"video":case"audio":for(i=0;i<Rr.length;i++)_e(Rr[i],e);break;case"image":_e("error",e),_e("load",e);break;case"details":_e("toggle",e);break;case"embed":case"source":case"link":_e("error",e),_e("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in l)if(l.hasOwnProperty(Y)&&(i=l[Y],i!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ge(e,t,Y,i,l,null)}return;default:if(po(t)){for(K in l)l.hasOwnProperty(K)&&(i=l[K],i!==void 0&&nu(e,t,K,i,l,void 0));return}}for(N in l)l.hasOwnProperty(N)&&(i=l[N],i!=null&&Ge(e,t,N,i,l,null))}function hb(e,t,l,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,m=null,b=null,N=null,E=null,Y=null,K=null;for(X in l){var te=l[X];if(l.hasOwnProperty(X)&&te!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":E=te;default:i.hasOwnProperty(X)||Ge(e,t,X,null,i,te)}}for(var G in i){var X=i[G];if(te=l[G],i.hasOwnProperty(G)&&(X!=null||te!=null))switch(G){case"type":m=X;break;case"name":c=X;break;case"checked":Y=X;break;case"defaultChecked":K=X;break;case"value":b=X;break;case"defaultValue":N=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(o(137,t));break;default:X!==te&&Ge(e,t,G,X,i,te)}}ho(e,b,N,E,Y,K,m,c);return;case"select":X=b=N=G=null;for(m in l)if(E=l[m],l.hasOwnProperty(m)&&E!=null)switch(m){case"value":break;case"multiple":X=E;default:i.hasOwnProperty(m)||Ge(e,t,m,null,i,E)}for(c in i)if(m=i[c],E=l[c],i.hasOwnProperty(c)&&(m!=null||E!=null))switch(c){case"value":G=m;break;case"defaultValue":N=m;break;case"multiple":b=m;default:m!==E&&Ge(e,t,c,m,i,E)}t=N,l=b,i=X,G!=null?la(e,!!l,G,!1):!!i!=!!l&&(t!=null?la(e,!!l,t,!0):la(e,!!l,l?[]:"",!1));return;case"textarea":X=G=null;for(N in l)if(c=l[N],l.hasOwnProperty(N)&&c!=null&&!i.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Ge(e,t,N,null,i,c)}for(b in i)if(c=i[b],m=l[b],i.hasOwnProperty(b)&&(c!=null||m!=null))switch(b){case"value":G=c;break;case"defaultValue":X=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==m&&Ge(e,t,b,c,i,m)}Kd(e,G,X);return;case"option":for(var me in l)if(G=l[me],l.hasOwnProperty(me)&&G!=null&&!i.hasOwnProperty(me))switch(me){case"selected":e.selected=!1;break;default:Ge(e,t,me,null,i,G)}for(E in i)if(G=i[E],X=l[E],i.hasOwnProperty(E)&&G!==X&&(G!=null||X!=null))switch(E){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:Ge(e,t,E,G,i,X)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var be in l)G=l[be],l.hasOwnProperty(be)&&G!=null&&!i.hasOwnProperty(be)&&Ge(e,t,be,null,i,G);for(Y in i)if(G=i[Y],X=l[Y],i.hasOwnProperty(Y)&&G!==X&&(G!=null||X!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(o(137,t));break;default:Ge(e,t,Y,G,i,X)}return;default:if(po(t)){for(var $e in l)G=l[$e],l.hasOwnProperty($e)&&G!==void 0&&!i.hasOwnProperty($e)&&nu(e,t,$e,void 0,i,G);for(K in i)G=i[K],X=l[K],!i.hasOwnProperty(K)||G===X||G===void 0&&X===void 0||nu(e,t,K,G,i,X);return}}for(var B in l)G=l[B],l.hasOwnProperty(B)&&G!=null&&!i.hasOwnProperty(B)&&Ge(e,t,B,null,i,G);for(te in i)G=i[te],X=l[te],!i.hasOwnProperty(te)||G===X||G==null&&X==null||Ge(e,t,te,G,i,X)}function eh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),i=0;i<l.length;i++){var c=l[i],m=c.transferSize,b=c.initiatorType,N=c.duration;if(m&&N&&eh(b)){for(b=0,N=c.responseEnd,i+=1;i<l.length;i++){var E=l[i],Y=E.startTime;if(Y>N)break;var K=E.transferSize,te=E.initiatorType;K&&eh(te)&&(E=E.responseEnd,b+=K*(E<N?1:(N-Y)/(E-Y)))}if(--i,t+=8*(m+b)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var lu=null,au=null;function vi(e){return e.nodeType===9?e:e.ownerDocument}function th(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nh(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function ru(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var su=null;function pb(){var e=window.event;return e&&e.type==="popstate"?e===su?!1:(su=e,!0):(su=null,!1)}var lh=typeof setTimeout=="function"?setTimeout:void 0,gb=typeof clearTimeout=="function"?clearTimeout:void 0,ah=typeof Promise=="function"?Promise:void 0,yb=typeof queueMicrotask=="function"?queueMicrotask:typeof ah<"u"?function(e){return ah.resolve(null).then(e).catch(bb)}:lh;function bb(e){setTimeout(function(){throw e})}function ul(e){return e==="head"}function rh(e,t){var l=t,i=0;do{var c=l.nextSibling;if(e.removeChild(l),c&&c.nodeType===8)if(l=c.data,l==="/$"||l==="/&"){if(i===0){e.removeChild(c),Ra(t);return}i--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")i++;else if(l==="html")Ur(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Ur(l);for(var m=l.firstChild;m;){var b=m.nextSibling,N=m.nodeName;m[tr]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=b}}else l==="body"&&Ur(e.ownerDocument.body);l=c}while(l);Ra(t)}function sh(e,t){var l=e;e=0;do{var i=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),i&&i.nodeType===8)if(l=i.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=i}while(l)}function iu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":iu(l),fo(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function vb(e,t,l,i){for(;e.nodeType===1;){var c=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[tr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var m=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=tn(e.nextSibling),e===null)break}return null}function jb(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=tn(e.nextSibling),e===null))return null;return e}function ih(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=tn(e.nextSibling),e===null))return null;return e}function ou(e){return e.data==="$?"||e.data==="$~"}function cu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Nb(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var i=function(){t(),l.removeEventListener("DOMContentLoaded",i)};l.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function tn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var uu=null;function oh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return tn(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function ch(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function uh(e,t,l){switch(t=vi(l),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Ur(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);fo(e)}var nn=new Map,dh=new Set;function ji(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Vn=O.d;O.d={f:wb,r:kb,D:Sb,C:Cb,L:_b,m:Tb,X:Ab,S:Eb,M:Mb};function wb(){var e=Vn.f(),t=fi();return e||t}function kb(e){var t=ea(e);t!==null&&t.tag===5&&t.type==="form"?T0(t):Vn.r(e)}var za=typeof document>"u"?null:document;function fh(e,t,l){var i=za;if(i&&typeof t=="string"&&t){var c=Zt(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof l=="string"&&(c+='[crossorigin="'+l+'"]'),dh.has(c)||(dh.add(c),e={rel:e,crossOrigin:l,href:t},i.querySelector(c)===null&&(t=i.createElement("link"),gt(t,"link",e),dt(t),i.head.appendChild(t)))}}function Sb(e){Vn.D(e),fh("dns-prefetch",e,null)}function Cb(e,t){Vn.C(e,t),fh("preconnect",e,t)}function _b(e,t,l){Vn.L(e,t,l);var i=za;if(i&&e&&t){var c='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(c+='[imagesrcset="'+Zt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(c+='[imagesizes="'+Zt(l.imageSizes)+'"]')):c+='[href="'+Zt(e)+'"]';var m=c;switch(t){case"style":m=Oa(e);break;case"script":m=Da(e)}nn.has(m)||(e=g({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),nn.set(m,e),i.querySelector(c)!==null||t==="style"&&i.querySelector(Hr(m))||t==="script"&&i.querySelector(Br(m))||(t=i.createElement("link"),gt(t,"link",e),dt(t),i.head.appendChild(t)))}}function Tb(e,t){Vn.m(e,t);var l=za;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Zt(i)+'"][href="'+Zt(e)+'"]',m=c;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Da(e)}if(!nn.has(m)&&(e=g({rel:"modulepreload",href:e},t),nn.set(m,e),l.querySelector(c)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Br(m)))return}i=l.createElement("link"),gt(i,"link",e),dt(i),l.head.appendChild(i)}}}function Eb(e,t,l){Vn.S(e,t,l);var i=za;if(i&&e){var c=ta(i).hoistableStyles,m=Oa(e);t=t||"default";var b=c.get(m);if(!b){var N={loading:0,preload:null};if(b=i.querySelector(Hr(m)))N.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},l),(l=nn.get(m))&&du(e,l);var E=b=i.createElement("link");dt(E),gt(E,"link",e),E._p=new Promise(function(Y,K){E.onload=Y,E.onerror=K}),E.addEventListener("load",function(){N.loading|=1}),E.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Ni(b,t,i)}b={type:"stylesheet",instance:b,count:1,state:N},c.set(m,b)}}}function Ab(e,t){Vn.X(e,t);var l=za;if(l&&e){var i=ta(l).hoistableScripts,c=Da(e),m=i.get(c);m||(m=l.querySelector(Br(c)),m||(e=g({src:e,async:!0},t),(t=nn.get(c))&&fu(e,t),m=l.createElement("script"),dt(m),gt(m,"link",e),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(c,m))}}function Mb(e,t){Vn.M(e,t);var l=za;if(l&&e){var i=ta(l).hoistableScripts,c=Da(e),m=i.get(c);m||(m=l.querySelector(Br(c)),m||(e=g({src:e,async:!0,type:"module"},t),(t=nn.get(c))&&fu(e,t),m=l.createElement("script"),dt(m),gt(m,"link",e),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(c,m))}}function mh(e,t,l,i){var c=(c=pe.current)?ji(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Oa(l.href),l=ta(c).hoistableStyles,i=l.get(t),i||(i={type:"style",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Oa(l.href);var m=ta(c).hoistableStyles,b=m.get(e);if(b||(c=c.ownerDocument||c,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,b),(m=c.querySelector(Hr(e)))&&!m._p&&(b.instance=m,b.state.loading=5),nn.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},nn.set(e,l),m||zb(c,e,l,b.state))),t&&i===null)throw Error(o(528,""));return b}if(t&&i!==null)throw Error(o(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Da(l),l=ta(c).hoistableScripts,i=l.get(t),i||(i={type:"script",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Oa(e){return'href="'+Zt(e)+'"'}function Hr(e){return'link[rel="stylesheet"]['+e+"]"}function hh(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function zb(e,t,l,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),gt(t,"link",l),dt(t),e.head.appendChild(t))}function Da(e){return'[src="'+Zt(e)+'"]'}function Br(e){return"script[async]"+e}function xh(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Zt(l.href)+'"]');if(i)return t.instance=i,dt(i),i;var c=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),dt(i),gt(i,"style",c),Ni(i,l.precedence,e),t.instance=i;case"stylesheet":c=Oa(l.href);var m=e.querySelector(Hr(c));if(m)return t.state.loading|=4,t.instance=m,dt(m),m;i=hh(l),(c=nn.get(c))&&du(i,c),m=(e.ownerDocument||e).createElement("link"),dt(m);var b=m;return b._p=new Promise(function(N,E){b.onload=N,b.onerror=E}),gt(m,"link",i),t.state.loading|=4,Ni(m,l.precedence,e),t.instance=m;case"script":return m=Da(l.src),(c=e.querySelector(Br(m)))?(t.instance=c,dt(c),c):(i=l,(c=nn.get(m))&&(i=g({},l),fu(i,c)),e=e.ownerDocument||e,c=e.createElement("script"),dt(c),gt(c,"link",i),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Ni(i,l.precedence,e));return t.instance}function Ni(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=i.length?i[i.length-1]:null,m=c,b=0;b<i.length;b++){var N=i[b];if(N.dataset.precedence===t)m=N;else if(m!==c)break}m?m.parentNode.insertBefore(e,m.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function du(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function fu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var wi=null;function ph(e,t,l){if(wi===null){var i=new Map,c=wi=new Map;c.set(l,i)}else c=wi,i=c.get(l),i||(i=new Map,c.set(l,i));if(i.has(e))return i;for(i.set(e,null),l=l.getElementsByTagName(e),c=0;c<l.length;c++){var m=l[c];if(!(m[tr]||m[mt]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(t)||"";b=e+b;var N=i.get(b);N?N.push(m):i.set(b,[m])}}return i}function gh(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Ob(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function yh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Db(e,t,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var c=Oa(i.href),m=t.querySelector(Hr(c));if(m){t=m._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ki.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=m,dt(m);return}m=t.ownerDocument||t,i=hh(i),(c=nn.get(c))&&du(i,c),m=m.createElement("link"),dt(m);var b=m;b._p=new Promise(function(N,E){b.onload=N,b.onerror=E}),gt(m,"link",i),l.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=ki.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var mu=0;function Rb(e,t){return e.stylesheets&&e.count===0&&Ci(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var i=setTimeout(function(){if(e.stylesheets&&Ci(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+t);0<e.imgBytes&&mu===0&&(mu=62500*xb());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ci(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>mu?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(c)}}:null}function ki(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ci(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Si=null;function Ci(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Si=new Map,t.forEach(Lb,e),Si=null,ki.call(e))}function Lb(e,t){if(!(t.state.loading&4)){var l=Si.get(e);if(l)var i=l.get(null);else{l=new Map,Si.set(e,l);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<c.length;m++){var b=c[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(l.set(b.dataset.precedence,b),i=b)}i&&l.set(null,i)}c=t.instance,b=c.getAttribute("data-precedence"),m=l.get(b)||i,m===i&&l.set(null,c),l.set(b,c),this.count++,i=ki.bind(this),c.addEventListener("load",i),c.addEventListener("error",i),m?m.parentNode.insertBefore(c,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var qr={$$typeof:H,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function Ub(e,t,l,i,c,m,b,N,E){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=io(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=io(0),this.hiddenUpdates=io(null),this.identifierPrefix=i,this.onUncaughtError=c,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function bh(e,t,l,i,c,m,b,N,E,Y,K,te){return e=new Ub(e,t,l,b,E,Y,K,te,N),t=1,m===!0&&(t|=24),m=Ut(3,null,null,t),e.current=m,m.stateNode=e,t=Xo(),t.refCount++,e.pooledCache=t,t.refCount++,m.memoizedState={element:i,isDehydrated:l,cache:t},Io(m),e}function vh(e){return e?(e=da,e):da}function jh(e,t,l,i,c,m){c=vh(c),i.context===null?i.context=c:i.pendingContext=c,i=Wn(t),i.payload={element:l},m=m===void 0?null:m,m!==null&&(i.callback=m),l=el(e,i,t),l!==null&&(zt(l,e,t),yr(l,e,t))}function Nh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function hu(e,t){Nh(e,t),(e=e.alternate)&&Nh(e,t)}function wh(e){if(e.tag===13||e.tag===31){var t=Cl(e,67108864);t!==null&&zt(t,e,67108864),hu(e,67108864)}}function kh(e){if(e.tag===13||e.tag===31){var t=Vt();t=oo(t);var l=Cl(e,t);l!==null&&zt(l,e,t),hu(e,t)}}var _i=!0;function Hb(e,t,l,i){var c=A.T;A.T=null;var m=O.p;try{O.p=2,xu(e,t,l,i)}finally{O.p=m,A.T=c}}function Bb(e,t,l,i){var c=A.T;A.T=null;var m=O.p;try{O.p=8,xu(e,t,l,i)}finally{O.p=m,A.T=c}}function xu(e,t,l,i){if(_i){var c=pu(i);if(c===null)tu(e,t,i,Ti,l),Ch(e,i);else if(Yb(c,e,t,l,i))i.stopPropagation();else if(Ch(e,i),t&4&&-1<qb.indexOf(e)){for(;c!==null;){var m=ea(c);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=jl(m.pendingLanes);if(b!==0){var N=m;for(N.pendingLanes|=2,N.entangledLanes|=2;b;){var E=1<<31-Xe(b);N.entanglements[1]|=E,b&=~E}xn(m),(Le&6)===0&&(ui=jt()+500,Dr(0))}}break;case 31:case 13:N=Cl(m,2),N!==null&&zt(N,m,2),fi(),hu(m,2)}if(m=pu(i),m===null&&tu(e,t,i,Ti,l),m===c)break;c=m}c!==null&&i.stopPropagation()}else tu(e,t,i,null,l)}}function pu(e){return e=yo(e),gu(e)}var Ti=null;function gu(e){if(Ti=null,e=Wl(e),e!==null){var t=d(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=f(t),e!==null)return e;e=null}else if(l===31){if(e=x(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ti=e,null}function Sh(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(so()){case P:return 2;case ce:return 8;case ve:case Se:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var yu=!1,dl=null,fl=null,ml=null,Yr=new Map,Vr=new Map,hl=[],qb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ch(e,t){switch(e){case"focusin":case"focusout":dl=null;break;case"dragenter":case"dragleave":fl=null;break;case"mouseover":case"mouseout":ml=null;break;case"pointerover":case"pointerout":Yr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vr.delete(t.pointerId)}}function Gr(e,t,l,i,c,m){return e===null||e.nativeEvent!==m?(e={blockedOn:t,domEventName:l,eventSystemFlags:i,nativeEvent:m,targetContainers:[c]},t!==null&&(t=ea(t),t!==null&&wh(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Yb(e,t,l,i,c){switch(t){case"focusin":return dl=Gr(dl,e,t,l,i,c),!0;case"dragenter":return fl=Gr(fl,e,t,l,i,c),!0;case"mouseover":return ml=Gr(ml,e,t,l,i,c),!0;case"pointerover":var m=c.pointerId;return Yr.set(m,Gr(Yr.get(m)||null,e,t,l,i,c)),!0;case"gotpointercapture":return m=c.pointerId,Vr.set(m,Gr(Vr.get(m)||null,e,t,l,i,c)),!0}return!1}function _h(e){var t=Wl(e.target);if(t!==null){var l=d(t);if(l!==null){if(t=l.tag,t===13){if(t=f(l),t!==null){e.blockedOn=t,qd(e.priority,function(){kh(l)});return}}else if(t===31){if(t=x(l),t!==null){e.blockedOn=t,qd(e.priority,function(){kh(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ei(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=pu(e.nativeEvent);if(l===null){l=e.nativeEvent;var i=new l.constructor(l.type,l);go=i,l.target.dispatchEvent(i),go=null}else return t=ea(l),t!==null&&wh(t),e.blockedOn=l,!1;t.shift()}return!0}function Th(e,t,l){Ei(e)&&l.delete(t)}function Vb(){yu=!1,dl!==null&&Ei(dl)&&(dl=null),fl!==null&&Ei(fl)&&(fl=null),ml!==null&&Ei(ml)&&(ml=null),Yr.forEach(Th),Vr.forEach(Th)}function Ai(e,t){e.blockedOn===t&&(e.blockedOn=null,yu||(yu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Vb)))}var Mi=null;function Eh(e){Mi!==e&&(Mi=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Mi===e&&(Mi=null);for(var t=0;t<e.length;t+=3){var l=e[t],i=e[t+1],c=e[t+2];if(typeof i!="function"){if(gu(i||l)===null)continue;break}var m=ea(l);m!==null&&(e.splice(t,3),t-=3,pc(m,{pending:!0,data:c,method:l.method,action:i},i,c))}}))}function Ra(e){function t(E){return Ai(E,e)}dl!==null&&Ai(dl,e),fl!==null&&Ai(fl,e),ml!==null&&Ai(ml,e),Yr.forEach(t),Vr.forEach(t);for(var l=0;l<hl.length;l++){var i=hl[l];i.blockedOn===e&&(i.blockedOn=null)}for(;0<hl.length&&(l=hl[0],l.blockedOn===null);)_h(l),l.blockedOn===null&&hl.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(i=0;i<l.length;i+=3){var c=l[i],m=l[i+1],b=c[Ct]||null;if(typeof m=="function")b||Eh(l);else if(b){var N=null;if(m&&m.hasAttribute("formAction")){if(c=m,b=m[Ct]||null)N=b.formAction;else if(gu(c)!==null)continue}else N=b.action;typeof N=="function"?l[i+1]=N:(l.splice(i,3),i-=3),Eh(l)}}}function Ah(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(b){return c=b})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),i||setTimeout(l,20)}function l(){if(!i&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function bu(e){this._internalRoot=e}zi.prototype.render=bu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var l=t.current,i=Vt();jh(l,i,e,t,null,null)},zi.prototype.unmount=bu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jh(e.current,2,null,e,null,null),fi(),t[Pl]=null}};function zi(e){this._internalRoot=e}zi.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bd();e={blockedOn:null,target:e,priority:t};for(var l=0;l<hl.length&&t!==0&&t<hl[l].priority;l++);hl.splice(l,0,e),l===0&&_h(e)}};var Mh=r.version;if(Mh!=="19.2.4")throw Error(o(527,Mh,"19.2.4"));O.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Gb={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Oi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Oi.isDisabled&&Oi.supportsFiber)try{Nt=Oi.inject(Gb),ct=Oi}catch{}}return Qr.createRoot=function(e,t){if(!u(e))throw Error(o(299));var l=!1,i="",c=H0,m=B0,b=q0;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(m=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=bh(e,1,!1,null,null,l,i,null,c,m,b,Ah),e[Pl]=t.current,eu(e),new bu(t)},Qr.hydrateRoot=function(e,t,l){if(!u(e))throw Error(o(299));var i=!1,c="",m=H0,b=B0,N=q0,E=null;return l!=null&&(l.unstable_strictMode===!0&&(i=!0),l.identifierPrefix!==void 0&&(c=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(N=l.onRecoverableError),l.formState!==void 0&&(E=l.formState)),t=bh(e,1,!0,t,l??null,i,c,E,m,b,N,Ah),t.context=vh(null),l=t.current,i=Vt(),i=oo(i),c=Wn(i),c.callback=null,el(l,c,i),l=i,t.current.lanes=l,er(t,l),xn(t),e[Pl]=t.current,eu(e),new zi(t)},Qr.version="19.2.4",Qr}var Yh;function Wb(){if(Yh)return Nu.exports;Yh=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Nu.exports=Pb(),Nu.exports}var e1=Wb();const t1=Zi(e1),Vh=n=>{let r;const s=new Set,o=(h,y)=>{const g=typeof h=="function"?h(r):h;if(!Object.is(g,r)){const v=r;r=y??(typeof g!="object"||g===null)?g:Object.assign({},r,g),s.forEach(j=>j(r,v))}},u=()=>r,x={setState:o,getState:u,getInitialState:()=>p,subscribe:h=>(s.add(h),()=>s.delete(h))},p=r=n(o,u,x);return x},n1=(n=>n?Vh(n):Vh),l1=n=>n;function a1(n,r=l1){const s=Jr.useSyncExternalStore(n.subscribe,Jr.useCallback(()=>r(n.getState()),[n,r]),Jr.useCallback(()=>r(n.getInitialState()),[n,r]));return Jr.useDebugValue(s),s}const Gh=n=>{const r=n1(n),s=o=>a1(r,o);return Object.assign(s,r),s},r1=(n=>n?Gh(n):Gh),Px="plutus-theme";function s1(){return localStorage.getItem(Px)||"dark"}function Xu(n){const r=n==="dark"||n==="system"&&window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.classList.toggle("dark",r),localStorage.setItem(Px,n)}function i1(n){D.useEffect(()=>{Xu(n)},[n]),D.useEffect(()=>{if(n!=="system")return;const r=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>Xu("system");return r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[n])}const Qe=r1(n=>({view:"chat",setView:r=>n({view:r}),messages:[],addMessage:r=>n(s=>({messages:[...s.messages,r]})),appendToLastAssistant:r=>n(s=>{const o=[...s.messages],u=o[o.length-1];return u&&u.role==="assistant"&&(o[o.length-1]={...u,content:(u.content||"")+r}),{messages:o}}),clearMessages:()=>n({messages:[]}),isProcessing:!1,setProcessing:r=>n({isProcessing:r}),conversationId:null,setConversationId:r=>n({conversationId:r}),currentTier:"assistant",setCurrentTier:r=>n({currentTier:r}),pendingApprovals:[],addApproval:r=>n(s=>({pendingApprovals:[...s.pendingApprovals,r]})),removeApproval:r=>n(s=>({pendingApprovals:s.pendingApprovals.filter(o=>o.id!==r)})),keyConfigured:!0,setKeyConfigured:r=>n({keyConfigured:r}),connected:!1,setConnected:r=>n({connected:r}),onboardingCompleted:null,setOnboardingCompleted:r=>n({onboardingCompleted:r}),historyPanelOpen:!1,setHistoryPanelOpen:r=>n({historyPanelOpen:r}),toggleHistoryPanel:()=>n(r=>({historyPanelOpen:!r.historyPanelOpen})),theme:s1(),setTheme:r=>n({theme:r}),updateInfo:null,setUpdateInfo:r=>n({updateInfo:r})}));function o1(n){const r=D.useRef(null),[s,o]=D.useState(!1),u=D.useRef(n);return u.current=n,D.useEffect(()=>{const x=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;function p(){const h=new WebSocket(x);h.onopen=()=>{o(!0);const y=setInterval(()=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({type:"ping"}))},3e4);h.addEventListener("close",()=>clearInterval(y))},h.onmessage=y=>{try{const g=JSON.parse(y.data);u.current(g)}catch{}},h.onclose=()=>{o(!1),setTimeout(p,2e3)},h.onerror=()=>{h.close()},r.current=h}return p(),()=>{var h;(h=r.current)==null||h.close()}},[]),{send:D.useCallback(f=>{var x;((x=r.current)==null?void 0:x.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify(f))},[]),connected:s}}/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const c1=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wx=(...n)=>n.filter((r,s,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===s).join(" ").trim();/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var u1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const d1=D.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:u="",children:d,iconNode:f,...x},p)=>D.createElement("svg",{ref:p,...u1,width:r,height:r,stroke:n,strokeWidth:o?Number(s)*24/Number(r):s,className:Wx("lucide",u),...x},[...f.map(([h,y])=>D.createElement(h,y)),...Array.isArray(d)?d:[d]]));/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ae=(n,r)=>{const s=D.forwardRef(({className:o,...u},d)=>D.createElement(d1,{ref:d,iconNode:r,className:Wx(`lucide-${c1(n)}`,o),...u}));return s.displayName=`${n}`,s};/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pr=ae("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ep=ae("AppWindow",[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cd=ae("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const f1=ae("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const m1=ae("BatteryCharging",[["path",{d:"M15 7h1a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-2",key:"1sdynx"}],["path",{d:"M6 7H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h1",key:"1gkd3k"}],["path",{d:"m11 7-3 5h4l-3 5",key:"b4a64w"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wr=ae("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const es=ae("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tp=ae("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const h1=ae("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const an=ae("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qa=ae("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const np=ae("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lp=ae("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ql=ae("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $l=ae("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ts=ae("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gn=ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ap=ae("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rp=ae("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const x1=ae("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qe=ae("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yn=ae("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sp=ae("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gn=ae("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ki=ae("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const p1=ae("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ya=ae("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bl=ae("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ip=ae("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const g1=ae("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const y1=ae("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const op=ae("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ud=ae("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ql=ae("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dd=ae("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $h=ae("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const b1=ae("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cp=ae("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ii=ae("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const up=ae("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ji=ae("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ns=ae("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qa=ae("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const v1=ae("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ss=ae("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dp=ae("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const j1=ae("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qh=ae("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yi=ae("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const N1=ae("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xr=ae("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const w1=ae("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fp=ae("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const k1=ae("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mp=ae("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hp=ae("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xl=ae("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fu=ae("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const S1=ae("MousePointer",[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",key:"277e5u"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zu=ae("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const C1=ae("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xp=ae("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _1=ae("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const T1=ae("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fa=ae("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const is=ae("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pp=ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const E1=ae("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const A1=ae("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gp=ae("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Va=ae("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M1=ae("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yp=ae("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const os=ae("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fd=ae("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bp=ae("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vp=ae("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jp=ae("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bn=ae("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xh=ae("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const md=ae("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pi=ae("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Np=ae("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ga=ae("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rn=ae("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Za=ae("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yl=ae("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z1=ae("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const O1=ae("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const D1=ae("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fh=ae("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vn=ae("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vl=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
 * @license lucide-react v0.460.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $t=ae("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),R1=[{label:"Main",items:[{id:"chat",label:"Chat",icon:mp},{id:"skills",label:"Skills",icon:an,badge:"New"},{id:"dashboard",label:"Dashboard",icon:j1}]},{label:"Agent",collapsible:!0,items:[{id:"memory",label:"Memory & Plans",icon:an},{id:"tools",label:"Tools",icon:vn},{id:"workers",label:"Workers",icon:bl},{id:"tool-creator",label:"Tool Creator",icon:md}]},{label:"System",collapsible:!0,items:[{id:"connectors",label:"Connectors",icon:is,badge:"New"},{id:"guardrails",label:"Guardrails",icon:bn},{id:"settings",label:"Settings",icon:jp}]}];function L1({send:n}){const{view:r,setView:s,connected:o,currentTier:u,historyPanelOpen:d,toggleHistoryPanel:f}=Qe(),[x,p]=D.useState(new Set),h=g=>{p(v=>{const j=new Set(v);return j.has(g)?j.delete(g):j.add(g),j})},y=()=>{Qe.getState().clearMessages(),Qe.getState().setConversationId(null),s("chat"),n&&n({type:"new_conversation"})};return a.jsxs("aside",{className:"w-72 bg-gray-950 border-r border-gray-800/60 flex flex-col h-full",children:[a.jsx("div",{className:"px-4 pt-5 pb-4",children:a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-plutus-500 to-plutus-700 flex items-center justify-center font-bold text-base shadow-lg shadow-plutus-600/20 ring-1 ring-white/10",children:"P"}),a.jsxs("div",{children:[a.jsx("h1",{className:"font-semibold text-[15px] leading-none text-gray-100",children:"Plutus"}),a.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${o?"bg-emerald-400 shadow-sm shadow-emerald-400/60":"bg-red-400"}`}),a.jsx("span",{className:"text-[10px] text-gray-500",children:o?"Online":"Offline"}),a.jsx("span",{className:"text-gray-800 text-[10px]",children:"·"}),a.jsx("span",{className:"text-[10px] text-gray-500 capitalize",children:u})]})]})]})})}),a.jsxs("div",{className:"px-3 pb-4 flex items-center gap-2",children:[a.jsxs("button",{onClick:y,className:`flex-1 flex items-center justify-center gap-2 px-3 py-2.5 rounded-xl
                     bg-plutus-600 hover:bg-plutus-500 text-white text-sm font-medium
                     transition-all duration-200 shadow-md shadow-plutus-600/20
                     hover:shadow-lg hover:shadow-plutus-500/25 active:scale-[0.98]`,children:[a.jsx(pp,{className:"w-4 h-4"}),"New Chat"]}),r==="chat"&&a.jsx("button",{onClick:f,title:d?"Hide history":"Show history",className:`p-2.5 rounded-xl transition-all duration-200 ${d?"bg-plutus-500/15 text-plutus-400 ring-1 ring-plutus-500/20":"bg-gray-800/60 text-gray-500 hover:text-gray-300 hover:bg-gray-800"}`,children:a.jsx(ns,{className:"w-4 h-4"})})]}),a.jsx("nav",{className:"flex-1 p-3 space-y-2 overflow-y-auto sidebar-scroll min-h-0",children:R1.map(g=>{const v=x.has(g.label),j=g.items.some(k=>k.id===r);return a.jsxs("div",{children:[g.collapsible?a.jsxs("button",{onClick:()=>h(g.label),className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-[11px] font-semibold text-gray-600 uppercase tracking-wider hover:text-gray-400 transition-colors",children:[v?a.jsx(gn,{className:"w-3 h-3"}):a.jsx($l,{className:"w-3 h-3"}),a.jsx("span",{children:g.label}),v&&j&&a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-plutus-500 ml-auto"})]}):a.jsx("p",{className:"px-3 py-1.5 text-[11px] font-semibold text-gray-600 uppercase tracking-wider",children:g.label}),!v&&a.jsx("div",{className:"space-y-0.5",children:g.items.map(k=>{const R=k.icon,S=r===k.id;return a.jsxs("button",{onClick:()=>s(k.id),className:`w-full relative flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-150 ${S?"bg-gray-800/80 text-gray-100":"text-gray-500 hover:text-gray-300 hover:bg-gray-800/40"}`,children:[S&&a.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[3px] h-5 rounded-r-full bg-plutus-500"}),a.jsx(R,{className:`w-[18px] h-[18px] ${S?"text-plutus-400":""}`}),a.jsx("span",{className:"flex-1 text-left",children:k.label}),k.badge&&a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-plutus-500/15 text-plutus-400 font-semibold ring-1 ring-plutus-500/20",children:k.badge})]},k.id)})})]},g.label)})})]})}const U1={chat:{title:"Chat",subtitle:"Talk to Plutus"},dashboard:{title:"Dashboard",subtitle:"Activity overview"},guardrails:{title:"Guardrails",subtitle:"Safety & permissions"},settings:{title:"Settings",subtitle:"Configuration"},tools:{title:"Tools",subtitle:"Agent capabilities"},workers:{title:"Workers & Automation",subtitle:"Workers, schedules & model routing"},"tool-creator":{title:"Tool Creator",subtitle:"Build custom tools"},skills:{title:"Skills",subtitle:"Browse, import, and share skills"},memory:{title:"Memory & Plans",subtitle:"What Plutus remembers"},connectors:{title:"Connectors",subtitle:"Link Plutus with external apps"}};function H1(){const{view:n,currentTier:r,pendingApprovals:s,isProcessing:o,keyConfigured:u}=Qe(),d=U1[n]||{title:"Plutus",subtitle:""};return a.jsxs("header",{className:"h-14 border-b border-gray-800 bg-gray-900/50 backdrop-blur-sm flex items-center justify-between px-6",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold text-gray-200",children:d.title}),d.subtitle&&a.jsx("p",{className:"text-[10px] text-gray-500 -mt-0.5",children:d.subtitle})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[!u&&a.jsxs("button",{onClick:()=>Qe.getState().setView("settings"),className:"flex items-center gap-1.5 px-3 py-1 rounded-full bg-amber-500/20 text-amber-400 text-xs font-medium animate-gentle-pulse",children:[a.jsx(ss,{className:"w-3 h-3"}),"No API key — click to configure"]}),o&&a.jsxs("div",{className:"flex items-center gap-2 text-xs text-plutus-400",children:[a.jsx(Pr,{className:"w-3.5 h-3.5 animate-pulse"}),a.jsx("span",{children:"Processing..."})]}),s.length>0&&a.jsxs("button",{onClick:()=>Qe.getState().setView("chat"),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-amber-500/20 text-amber-400 text-xs font-medium animate-gentle-pulse",children:[a.jsx(bn,{className:"w-3 h-3"}),s.length," pending"]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-gray-800 text-xs",children:[a.jsx(bn,{className:"w-3 h-3 text-plutus-400"}),a.jsx("span",{className:"text-gray-300 capitalize",children:r})]})]})]})}function B1({message:n,send:r,approvalId:s}){const[o,u]=D.useState(null),d=()=>{r({type:"approve",approval_id:s,approved:!0}),u("approved")},f=()=>{r({type:"approve",approval_id:s,approved:!1}),u("denied")};return a.jsxs("div",{className:"flex gap-3 animate-fade-in",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-amber-500/20 flex items-center justify-center flex-shrink-0 animate-gentle-pulse",children:a.jsx(bn,{className:"w-4 h-4 text-amber-400"})}),a.jsx("div",{className:"max-w-2xl w-full",children:a.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-xl px-4 py-3",children:[a.jsx("p",{className:"text-sm text-amber-200 mb-3",children:n}),o?a.jsx("p",{className:`text-xs font-medium ${o==="approved"?"text-emerald-400":"text-red-400"}`,children:o==="approved"?"Approved":"Denied"}):a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("button",{onClick:d,className:"btn-success flex items-center gap-1.5 text-xs py-1.5 px-3",children:[a.jsx(ql,{className:"w-3.5 h-3.5"}),"Approve"]}),a.jsxs("button",{onClick:f,className:"btn-danger flex items-center gap-1.5 text-xs py-1.5 px-3",children:[a.jsx(Vl,{className:"w-3.5 h-3.5"}),"Deny"]})]})]})})]})}function q1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const Y1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,V1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,G1={};function Zh(n,r){return(G1.jsx?V1:Y1).test(n)}const $1=/[ \t\n\f\r]/g;function Q1(n){return typeof n=="object"?n.type==="text"?Kh(n.value):!1:Kh(n)}function Kh(n){return n.replace($1,"")===""}class ds{constructor(r,s,o){this.normal=s,this.property=r,o&&(this.space=o)}}ds.prototype.normal={};ds.prototype.property={};ds.prototype.space=void 0;function wp(n,r){const s={},o={};for(const u of n)Object.assign(s,u.property),Object.assign(o,u.normal);return new ds(s,o,r)}function Ku(n){return n.toLowerCase()}class Dt{constructor(r,s){this.attribute=s,this.property=r}}Dt.prototype.attribute="";Dt.prototype.booleanish=!1;Dt.prototype.boolean=!1;Dt.prototype.commaOrSpaceSeparated=!1;Dt.prototype.commaSeparated=!1;Dt.prototype.defined=!1;Dt.prototype.mustUseProperty=!1;Dt.prototype.number=!1;Dt.prototype.overloadedBoolean=!1;Dt.prototype.property="";Dt.prototype.spaceSeparated=!1;Dt.prototype.space=void 0;let X1=0;const ke=Fl(),ot=Fl(),Iu=Fl(),se=Fl(),Ke=Fl(),$a=Fl(),Gt=Fl();function Fl(){return 2**++X1}const Ju=Object.freeze(Object.defineProperty({__proto__:null,boolean:ke,booleanish:ot,commaOrSpaceSeparated:Gt,commaSeparated:$a,number:se,overloadedBoolean:Iu,spaceSeparated:Ke},Symbol.toStringTag,{value:"Module"})),Cu=Object.keys(Ju);class hd extends Dt{constructor(r,s,o,u){let d=-1;if(super(r,s),Ih(this,"space",u),typeof o=="number")for(;++d<Cu.length;){const f=Cu[d];Ih(this,Cu[d],(o&Ju[f])===Ju[f])}}}hd.prototype.defined=!0;function Ih(n,r,s){s&&(n[r]=s)}function Ka(n){const r={},s={};for(const[o,u]of Object.entries(n.properties)){const d=new hd(o,n.transform(n.attributes||{},o),u,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(d.mustUseProperty=!0),r[o]=d,s[Ku(o)]=o,s[Ku(d.attribute)]=o}return new ds(r,s,n.space)}const kp=Ka({properties:{ariaActiveDescendant:null,ariaAtomic:ot,ariaAutoComplete:null,ariaBusy:ot,ariaChecked:ot,ariaColCount:se,ariaColIndex:se,ariaColSpan:se,ariaControls:Ke,ariaCurrent:null,ariaDescribedBy:Ke,ariaDetails:null,ariaDisabled:ot,ariaDropEffect:Ke,ariaErrorMessage:null,ariaExpanded:ot,ariaFlowTo:Ke,ariaGrabbed:ot,ariaHasPopup:null,ariaHidden:ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ke,ariaLevel:se,ariaLive:null,ariaModal:ot,ariaMultiLine:ot,ariaMultiSelectable:ot,ariaOrientation:null,ariaOwns:Ke,ariaPlaceholder:null,ariaPosInSet:se,ariaPressed:ot,ariaReadOnly:ot,ariaRelevant:null,ariaRequired:ot,ariaRoleDescription:Ke,ariaRowCount:se,ariaRowIndex:se,ariaRowSpan:se,ariaSelected:ot,ariaSetSize:se,ariaSort:null,ariaValueMax:se,ariaValueMin:se,ariaValueNow:se,ariaValueText:null,role:null},transform(n,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function Sp(n,r){return r in n?n[r]:r}function Cp(n,r){return Sp(n,r.toLowerCase())}const F1=Ka({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$a,acceptCharset:Ke,accessKey:Ke,action:null,allow:null,allowFullScreen:ke,allowPaymentRequest:ke,allowUserMedia:ke,alt:null,as:null,async:ke,autoCapitalize:null,autoComplete:Ke,autoFocus:ke,autoPlay:ke,blocking:Ke,capture:null,charSet:null,checked:ke,cite:null,className:Ke,cols:se,colSpan:null,content:null,contentEditable:ot,controls:ke,controlsList:Ke,coords:se|$a,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ke,defer:ke,dir:null,dirName:null,disabled:ke,download:Iu,draggable:ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ke,formTarget:null,headers:Ke,height:se,hidden:Iu,high:se,href:null,hrefLang:null,htmlFor:Ke,httpEquiv:Ke,id:null,imageSizes:null,imageSrcSet:null,inert:ke,inputMode:null,integrity:null,is:null,isMap:ke,itemId:null,itemProp:Ke,itemRef:Ke,itemScope:ke,itemType:Ke,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ke,low:se,manifest:null,max:null,maxLength:se,media:null,method:null,min:null,minLength:se,multiple:ke,muted:ke,name:null,nonce:null,noModule:ke,noValidate:ke,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ke,optimum:se,pattern:null,ping:Ke,placeholder:null,playsInline:ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ke,referrerPolicy:null,rel:Ke,required:ke,reversed:ke,rows:se,rowSpan:se,sandbox:Ke,scope:null,scoped:ke,seamless:ke,selected:ke,shadowRootClonable:ke,shadowRootDelegatesFocus:ke,shadowRootMode:null,shape:null,size:se,sizes:null,slot:null,span:se,spellCheck:ot,src:null,srcDoc:null,srcLang:null,srcSet:null,start:se,step:null,style:null,tabIndex:se,target:null,title:null,translate:null,type:null,typeMustMatch:ke,useMap:null,value:ot,width:se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ke,axis:null,background:null,bgColor:null,border:se,borderColor:null,bottomMargin:se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ke,declare:ke,event:null,face:null,frame:null,frameBorder:null,hSpace:se,leftMargin:se,link:null,longDesc:null,lowSrc:null,marginHeight:se,marginWidth:se,noResize:ke,noHref:ke,noShade:ke,noWrap:ke,object:null,profile:null,prompt:null,rev:null,rightMargin:se,rules:null,scheme:null,scrolling:ot,standby:null,summary:null,text:null,topMargin:se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ke,disableRemotePlayback:ke,prefix:null,property:null,results:se,security:null,unselectable:null},space:"html",transform:Cp}),Z1=Ka({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Gt,accentHeight:se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:se,amplitude:se,arabicForm:null,ascent:se,attributeName:null,attributeType:null,azimuth:se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:se,by:null,calcMode:null,capHeight:se,className:Ke,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:se,diffuseConstant:se,direction:null,display:null,dur:null,divisor:se,dominantBaseline:null,download:ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:se,enableBackground:null,end:null,event:null,exponent:se,externalResourcesRequired:null,fill:null,fillOpacity:se,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$a,g2:$a,glyphName:$a,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:se,horizOriginX:se,horizOriginY:se,id:null,ideographic:se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:se,k:se,k1:se,k2:se,k3:se,k4:se,kernelMatrix:Gt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:se,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:se,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:se,overlineThickness:se,paintOrder:null,panose1:null,path:null,pathLength:se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ke,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:se,pointsAtY:se,pointsAtZ:se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gt,rev:Gt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gt,requiredFeatures:Gt,requiredFonts:Gt,requiredFormats:Gt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:se,specularExponent:se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:se,strikethroughThickness:se,string:null,stroke:null,strokeDashArray:Gt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:se,strokeOpacity:se,strokeWidth:null,style:null,surfaceScale:se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gt,tabIndex:se,tableValues:null,target:null,targetX:se,targetY:se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:se,underlineThickness:se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:se,values:null,vAlphabetic:se,vMathematical:se,vectorEffect:null,vHanging:se,vIdeographic:se,version:null,vertAdvY:se,vertOriginX:se,vertOriginY:se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Sp}),_p=Ka({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,r){return"xlink:"+r.slice(5).toLowerCase()}}),Tp=Ka({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Cp}),Ep=Ka({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,r){return"xml:"+r.slice(3).toLowerCase()}}),K1={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},I1=/[A-Z]/g,Jh=/-[a-z]/g,J1=/^data[-\w.:]+$/i;function P1(n,r){const s=Ku(r);let o=r,u=Dt;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&J1.test(r)){if(r.charAt(4)==="-"){const d=r.slice(5).replace(Jh,ev);o="data"+d.charAt(0).toUpperCase()+d.slice(1)}else{const d=r.slice(4);if(!Jh.test(d)){let f=d.replace(I1,W1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}u=hd}return new u(o,r)}function W1(n){return"-"+n.toLowerCase()}function ev(n){return n.charAt(1).toUpperCase()}const tv=wp([kp,F1,_p,Tp,Ep],"html"),xd=wp([kp,Z1,_p,Tp,Ep],"svg");function nv(n){return n.join(" ").trim()}var La={},_u,Ph;function lv(){if(Ph)return _u;Ph=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,d=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,x=/^\s+|\s+$/g,p=`
`,h="/",y="*",g="",v="comment",j="declaration";function k(S,T){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];T=T||{};var V=1,H=1;function I(Q){var ee=Q.match(r);ee&&(V+=ee.length);var A=Q.lastIndexOf(p);H=~A?Q.length-A:H+Q.length}function z(){var Q={line:V,column:H};return function(ee){return ee.position=new U(Q),J(),ee}}function U(Q){this.start=Q,this.end={line:V,column:H},this.source=T.source}U.prototype.content=S;function $(Q){var ee=new Error(T.source+":"+V+":"+H+": "+Q);if(ee.reason=Q,ee.filename=T.source,ee.line=V,ee.column=H,ee.source=S,!T.silent)throw ee}function fe(Q){var ee=Q.exec(S);if(ee){var A=ee[0];return I(A),S=S.slice(A.length),ee}}function J(){fe(s)}function M(Q){var ee;for(Q=Q||[];ee=ne();)ee!==!1&&Q.push(ee);return Q}function ne(){var Q=z();if(!(h!=S.charAt(0)||y!=S.charAt(1))){for(var ee=2;g!=S.charAt(ee)&&(y!=S.charAt(ee)||h!=S.charAt(ee+1));)++ee;if(ee+=2,g===S.charAt(ee-1))return $("End of comment missing");var A=S.slice(2,ee-2);return H+=2,I(A),S=S.slice(ee),H+=2,Q({type:v,comment:A})}}function re(){var Q=z(),ee=fe(o);if(ee){if(ne(),!fe(u))return $("property missing ':'");var A=fe(d),O=Q({type:j,property:R(ee[0].replace(n,g)),value:A?R(A[0].replace(n,g)):g});return fe(f),O}}function Z(){var Q=[];M(Q);for(var ee;ee=re();)ee!==!1&&(Q.push(ee),M(Q));return Q}return J(),Z()}function R(S){return S?S.replace(x,g):g}return _u=k,_u}var Wh;function av(){if(Wh)return La;Wh=1;var n=La&&La.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(La,"__esModule",{value:!0}),La.default=s;const r=n(lv());function s(o,u){let d=null;if(!o||typeof o!="string")return d;const f=(0,r.default)(o),x=typeof u=="function";return f.forEach(p=>{if(p.type!=="declaration")return;const{property:h,value:y}=p;x?u(h,y,p):y&&(d=d||{},d[h]=y)}),d}return La}var Fr={},ex;function rv(){if(ex)return Fr;ex=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,d=function(h){return!h||s.test(h)||n.test(h)},f=function(h,y){return y.toUpperCase()},x=function(h,y){return"".concat(y,"-")},p=function(h,y){return y===void 0&&(y={}),d(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(u,x):h=h.replace(o,x),h.replace(r,f))};return Fr.camelCase=p,Fr}var Zr,tx;function sv(){if(tx)return Zr;tx=1;var n=Zr&&Zr.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},r=n(av()),s=rv();function o(u,d){var f={};return!u||typeof u!="string"||(0,r.default)(u,function(x,p){x&&p&&(f[(0,s.camelCase)(x,d)]=p)}),f}return o.default=o,Zr=o,Zr}var iv=sv();const ov=Zi(iv),Ap=Mp("end"),pd=Mp("start");function Mp(n){return r;function r(s){const o=s&&s.position&&s.position[n]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function cv(n){const r=pd(n),s=Ap(n);if(r&&s)return{start:r,end:s}}function ls(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?nx(n.position):"start"in n||"end"in n?nx(n):"line"in n||"column"in n?Pu(n):""}function Pu(n){return lx(n&&n.line)+":"+lx(n&&n.column)}function nx(n){return Pu(n&&n.start)+"-"+Pu(n&&n.end)}function lx(n){return n&&typeof n=="number"?n:1}class vt extends Error{constructor(r,s,o){super(),typeof s=="string"&&(o=s,s=void 0);let u="",d={},f=!1;if(s&&("line"in s&&"column"in s?d={place:s}:"start"in s&&"end"in s?d={place:s}:"type"in s?d={ancestors:[s],place:s.position}:d={...s}),typeof r=="string"?u=r:!d.cause&&r&&(f=!0,u=r.message,d.cause=r),!d.ruleId&&!d.source&&typeof o=="string"){const p=o.indexOf(":");p===-1?d.ruleId=o:(d.source=o.slice(0,p),d.ruleId=o.slice(p+1))}if(!d.place&&d.ancestors&&d.ancestors){const p=d.ancestors[d.ancestors.length-1];p&&(d.place=p.position)}const x=d.place&&"start"in d.place?d.place.start:d.place;this.ancestors=d.ancestors||void 0,this.cause=d.cause||void 0,this.column=x?x.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=x?x.line:void 0,this.name=ls(d.place)||"1:1",this.place=d.place||void 0,this.reason=this.message,this.ruleId=d.ruleId||void 0,this.source=d.source||void 0,this.stack=f&&d.cause&&typeof d.cause.stack=="string"?d.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vt.prototype.file="";vt.prototype.name="";vt.prototype.reason="";vt.prototype.message="";vt.prototype.stack="";vt.prototype.column=void 0;vt.prototype.line=void 0;vt.prototype.ancestors=void 0;vt.prototype.cause=void 0;vt.prototype.fatal=void 0;vt.prototype.place=void 0;vt.prototype.ruleId=void 0;vt.prototype.source=void 0;const gd={}.hasOwnProperty,uv=new Map,dv=/[A-Z]/g,fv=new Set(["table","tbody","thead","tfoot","tr"]),mv=new Set(["td","th"]),zp="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hv(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let o;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=Nv(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=jv(s,r.jsx,r.jsxs)}const u={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:o,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?xd:tv,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},d=Op(u,n,void 0);return d&&typeof d!="string"?d:u.create(n,u.Fragment,{children:d||void 0},void 0)}function Op(n,r,s){if(r.type==="element")return xv(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return pv(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return yv(n,r,s);if(r.type==="mdxjsEsm")return gv(n,r);if(r.type==="root")return bv(n,r,s);if(r.type==="text")return vv(n,r)}function xv(n,r,s){const o=n.schema;let u=o;r.tagName.toLowerCase()==="svg"&&o.space==="html"&&(u=xd,n.schema=u),n.ancestors.push(r);const d=Rp(n,r.tagName,!1),f=wv(n,r);let x=bd(n,r);return fv.has(r.tagName)&&(x=x.filter(function(p){return typeof p=="string"?!Q1(p):!0})),Dp(n,f,d,r),yd(f,x),n.ancestors.pop(),n.schema=o,n.create(r,d,f,s)}function pv(n,r){if(r.data&&r.data.estree&&n.evaluater){const o=r.data.estree.body[0];return o.type,n.evaluater.evaluateExpression(o.expression)}cs(n,r.position)}function gv(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);cs(n,r.position)}function yv(n,r,s){const o=n.schema;let u=o;r.name==="svg"&&o.space==="html"&&(u=xd,n.schema=u),n.ancestors.push(r);const d=r.name===null?n.Fragment:Rp(n,r.name,!0),f=kv(n,r),x=bd(n,r);return Dp(n,f,d,r),yd(f,x),n.ancestors.pop(),n.schema=o,n.create(r,d,f,s)}function bv(n,r,s){const o={};return yd(o,bd(n,r)),n.create(r,n.Fragment,o,s)}function vv(n,r){return r.value}function Dp(n,r,s,o){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=o)}function yd(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function jv(n,r,s){return o;function o(u,d,f,x){const h=Array.isArray(f.children)?s:r;return x?h(d,f,x):h(d,f)}}function Nv(n,r){return s;function s(o,u,d,f){const x=Array.isArray(d.children),p=pd(o);return r(u,d,f,x,{columnNumber:p?p.column-1:void 0,fileName:n,lineNumber:p?p.line:void 0},void 0)}}function wv(n,r){const s={};let o,u;for(u in r.properties)if(u!=="children"&&gd.call(r.properties,u)){const d=Sv(n,u,r.properties[u]);if(d){const[f,x]=d;n.tableCellAlignToStyle&&f==="align"&&typeof x=="string"&&mv.has(r.tagName)?o=x:s[f]=x}}if(o){const d=s.style||(s.style={});d[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return s}function kv(n,r){const s={};for(const o of r.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&n.evaluater){const d=o.data.estree.body[0];d.type;const f=d.expression;f.type;const x=f.properties[0];x.type,Object.assign(s,n.evaluater.evaluateExpression(x.argument))}else cs(n,r.position);else{const u=o.name;let d;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&n.evaluater){const x=o.value.data.estree.body[0];x.type,d=n.evaluater.evaluateExpression(x.expression)}else cs(n,r.position);else d=o.value===null?!0:o.value;s[u]=d}return s}function bd(n,r){const s=[];let o=-1;const u=n.passKeys?new Map:uv;for(;++o<r.children.length;){const d=r.children[o];let f;if(n.passKeys){const p=d.type==="element"?d.tagName:d.type==="mdxJsxFlowElement"||d.type==="mdxJsxTextElement"?d.name:void 0;if(p){const h=u.get(p)||0;f=p+"-"+h,u.set(p,h+1)}}const x=Op(n,d,f);x!==void 0&&s.push(x)}return s}function Sv(n,r,s){const o=P1(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=o.commaSeparated?q1(s):nv(s)),o.property==="style"){let u=typeof s=="object"?s:Cv(n,String(s));return n.stylePropertyNameCase==="css"&&(u=_v(u)),["style",u]}return[n.elementAttributeNameCase==="react"&&o.space?K1[o.property]||o.property:o.attribute,s]}}function Cv(n,r){try{return ov(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const o=s,u=new vt("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=n.filePath||void 0,u.url=zp+"#cannot-parse-style-attribute",u}}function Rp(n,r,s){let o;if(!s)o={type:"Literal",value:r};else if(r.includes(".")){const u=r.split(".");let d=-1,f;for(;++d<u.length;){const x=Zh(u[d])?{type:"Identifier",name:u[d]}:{type:"Literal",value:u[d]};f=f?{type:"MemberExpression",object:f,property:x,computed:!!(d&&x.type==="Literal"),optional:!1}:x}o=f}else o=Zh(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(o.type==="Literal"){const u=o.value;return gd.call(n.components,u)?n.components[u]:u}if(n.evaluater)return n.evaluater.evaluateExpression(o);cs(n)}function cs(n,r){const s=new vt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=n.filePath||void 0,s.url=zp+"#cannot-handle-mdx-estrees-without-createevaluater",s}function _v(n){const r={};let s;for(s in n)gd.call(n,s)&&(r[Tv(s)]=n[s]);return r}function Tv(n){let r=n.replace(dv,Ev);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function Ev(n){return"-"+n.toLowerCase()}const Tu={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Av={};function vd(n,r){const s=Av,o=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,u=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return Lp(n,o,u)}function Lp(n,r,s){if(Mv(n)){if("value"in n)return n.type==="html"&&!s?"":n.value;if(r&&"alt"in n&&n.alt)return n.alt;if("children"in n)return ax(n.children,r,s)}return Array.isArray(n)?ax(n,r,s):""}function ax(n,r,s){const o=[];let u=-1;for(;++u<n.length;)o[u]=Lp(n[u],r,s);return o.join("")}function Mv(n){return!!(n&&typeof n=="object")}const rx=document.createElement("i");function jd(n){const r="&"+n+";";rx.innerHTML=r;const s=rx.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function Qt(n,r,s,o){const u=n.length;let d=0,f;if(r<0?r=-r>u?0:u+r:r=r>u?u:r,s=s>0?s:0,o.length<1e4)f=Array.from(o),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);d<o.length;)f=o.slice(d,d+1e4),f.unshift(r,0),n.splice(...f),d+=1e4,r+=1e4}function ln(n,r){return n.length>0?(Qt(n,n.length,0,r),n):r}const sx={}.hasOwnProperty;function Up(n){const r={};let s=-1;for(;++s<n.length;)zv(r,n[s]);return r}function zv(n,r){let s;for(s in r){const u=(sx.call(n,s)?n[s]:void 0)||(n[s]={}),d=r[s];let f;if(d)for(f in d){sx.call(u,f)||(u[f]=[]);const x=d[f];Ov(u[f],Array.isArray(x)?x:x?[x]:[])}}}function Ov(n,r){let s=-1;const o=[];for(;++s<r.length;)(r[s].add==="after"?n:o).push(r[s]);Qt(n,0,0,o)}function Hp(n,r){const s=Number.parseInt(n,r);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function dn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kt=vl(/[A-Za-z]/),bt=vl(/[\dA-Za-z]/),Dv=vl(/[#-'*+\--9=?A-Z^-~]/);function $i(n){return n!==null&&(n<32||n===127)}const Wu=vl(/\d/),Rv=vl(/[\dA-Fa-f]/),Lv=vl(/[!-/:-@[-`{-~]/);function ye(n){return n!==null&&n<-2}function Ze(n){return n!==null&&(n<0||n===32)}function Te(n){return n===-2||n===-1||n===32}const Wi=vl(new RegExp("\\p{P}|\\p{S}","u")),Gl=vl(/\s/);function vl(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function Ia(n){const r=[];let s=-1,o=0,u=0;for(;++s<n.length;){const d=n.charCodeAt(s);let f="";if(d===37&&bt(n.charCodeAt(s+1))&&bt(n.charCodeAt(s+2)))u=2;else if(d<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(d))||(f=String.fromCharCode(d));else if(d>55295&&d<57344){const x=n.charCodeAt(s+1);d<56320&&x>56319&&x<57344?(f=String.fromCharCode(d,x),u=1):f="�"}else f=String.fromCharCode(d);f&&(r.push(n.slice(o,s),encodeURIComponent(f)),o=s+u+1,f=""),u&&(s+=u,u=0)}return r.join("")+n.slice(o)}function Oe(n,r,s,o){const u=o?o-1:Number.POSITIVE_INFINITY;let d=0;return f;function f(p){return Te(p)?(n.enter(s),x(p)):r(p)}function x(p){return Te(p)&&d++<u?(n.consume(p),x):(n.exit(s),r(p))}}const Uv={tokenize:Hv};function Hv(n){const r=n.attempt(this.parser.constructs.contentInitial,o,u);let s;return r;function o(x){if(x===null){n.consume(x);return}return n.enter("lineEnding"),n.consume(x),n.exit("lineEnding"),Oe(n,r,"linePrefix")}function u(x){return n.enter("paragraph"),d(x)}function d(x){const p=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=p),s=p,f(x)}function f(x){if(x===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(x);return}return ye(x)?(n.consume(x),n.exit("chunkText"),d):(n.consume(x),f)}}const Bv={tokenize:qv},ix={tokenize:Yv};function qv(n){const r=this,s=[];let o=0,u,d,f;return x;function x(H){if(o<s.length){const I=s[o];return r.containerState=I[1],n.attempt(I[0].continuation,p,h)(H)}return h(H)}function p(H){if(o++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,u&&V();const I=r.events.length;let z=I,U;for(;z--;)if(r.events[z][0]==="exit"&&r.events[z][1].type==="chunkFlow"){U=r.events[z][1].end;break}T(o);let $=I;for(;$<r.events.length;)r.events[$][1].end={...U},$++;return Qt(r.events,z+1,0,r.events.slice(I)),r.events.length=$,h(H)}return x(H)}function h(H){if(o===s.length){if(!u)return v(H);if(u.currentConstruct&&u.currentConstruct.concrete)return k(H);r.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(ix,y,g)(H)}function y(H){return u&&V(),T(o),v(H)}function g(H){return r.parser.lazy[r.now().line]=o!==s.length,f=r.now().offset,k(H)}function v(H){return r.containerState={},n.attempt(ix,j,k)(H)}function j(H){return o++,s.push([r.currentConstruct,r.containerState]),v(H)}function k(H){if(H===null){u&&V(),T(0),n.consume(H);return}return u=u||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:d}),R(H)}function R(H){if(H===null){S(n.exit("chunkFlow"),!0),T(0),n.consume(H);return}return ye(H)?(n.consume(H),S(n.exit("chunkFlow")),o=0,r.interrupt=void 0,x):(n.consume(H),R)}function S(H,I){const z=r.sliceStream(H);if(I&&z.push(null),H.previous=d,d&&(d.next=H),d=H,u.defineSkip(H.start),u.write(z),r.parser.lazy[H.start.line]){let U=u.events.length;for(;U--;)if(u.events[U][1].start.offset<f&&(!u.events[U][1].end||u.events[U][1].end.offset>f))return;const $=r.events.length;let fe=$,J,M;for(;fe--;)if(r.events[fe][0]==="exit"&&r.events[fe][1].type==="chunkFlow"){if(J){M=r.events[fe][1].end;break}J=!0}for(T(o),U=$;U<r.events.length;)r.events[U][1].end={...M},U++;Qt(r.events,fe+1,0,r.events.slice($)),r.events.length=U}}function T(H){let I=s.length;for(;I-- >H;){const z=s[I];r.containerState=z[1],z[0].exit.call(r,n)}s.length=H}function V(){u.write([null]),d=void 0,u=void 0,r.containerState._closeFlow=void 0}}function Yv(n,r,s){return Oe(n,n.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xa(n){if(n===null||Ze(n)||Gl(n))return 1;if(Wi(n))return 2}function eo(n,r,s){const o=[];let u=-1;for(;++u<n.length;){const d=n[u].resolveAll;d&&!o.includes(d)&&(r=d(r,s),o.push(d))}return r}const ed={name:"attention",resolveAll:Vv,tokenize:Gv};function Vv(n,r){let s=-1,o,u,d,f,x,p,h,y;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(o=s;o--;)if(n[o][0]==="exit"&&n[o][1].type==="attentionSequence"&&n[o][1]._open&&r.sliceSerialize(n[o][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[o][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[o][1].end.offset-n[o][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;p=n[o][1].end.offset-n[o][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const g={...n[o][1].end},v={...n[s][1].start};ox(g,-p),ox(v,p),f={type:p>1?"strongSequence":"emphasisSequence",start:g,end:{...n[o][1].end}},x={type:p>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:v},d={type:p>1?"strongText":"emphasisText",start:{...n[o][1].end},end:{...n[s][1].start}},u={type:p>1?"strong":"emphasis",start:{...f.start},end:{...x.end}},n[o][1].end={...f.start},n[s][1].start={...x.end},h=[],n[o][1].end.offset-n[o][1].start.offset&&(h=ln(h,[["enter",n[o][1],r],["exit",n[o][1],r]])),h=ln(h,[["enter",u,r],["enter",f,r],["exit",f,r],["enter",d,r]]),h=ln(h,eo(r.parser.constructs.insideSpan.null,n.slice(o+1,s),r)),h=ln(h,[["exit",d,r],["enter",x,r],["exit",x,r],["exit",u,r]]),n[s][1].end.offset-n[s][1].start.offset?(y=2,h=ln(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):y=0,Qt(n,o-1,s-o+3,h),s=o+h.length-y-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="attentionSequence"&&(n[s][1].type="data");return n}function Gv(n,r){const s=this.parser.constructs.attentionMarkers.null,o=this.previous,u=Xa(o);let d;return f;function f(p){return d=p,n.enter("attentionSequence"),x(p)}function x(p){if(p===d)return n.consume(p),x;const h=n.exit("attentionSequence"),y=Xa(p),g=!y||y===2&&u||s.includes(p),v=!u||u===2&&y||s.includes(o);return h._open=!!(d===42?g:g&&(u||!v)),h._close=!!(d===42?v:v&&(y||!g)),r(p)}}function ox(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const $v={name:"autolink",tokenize:Qv};function Qv(n,r,s){let o=0;return u;function u(j){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(j),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),d}function d(j){return kt(j)?(n.consume(j),f):j===64?s(j):h(j)}function f(j){return j===43||j===45||j===46||bt(j)?(o=1,x(j)):h(j)}function x(j){return j===58?(n.consume(j),o=0,p):(j===43||j===45||j===46||bt(j))&&o++<32?(n.consume(j),x):(o=0,h(j))}function p(j){return j===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(j),n.exit("autolinkMarker"),n.exit("autolink"),r):j===null||j===32||j===60||$i(j)?s(j):(n.consume(j),p)}function h(j){return j===64?(n.consume(j),y):Dv(j)?(n.consume(j),h):s(j)}function y(j){return bt(j)?g(j):s(j)}function g(j){return j===46?(n.consume(j),o=0,y):j===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(j),n.exit("autolinkMarker"),n.exit("autolink"),r):v(j)}function v(j){if((j===45||bt(j))&&o++<63){const k=j===45?v:g;return n.consume(j),k}return s(j)}}const fs={partial:!0,tokenize:Xv};function Xv(n,r,s){return o;function o(d){return Te(d)?Oe(n,u,"linePrefix")(d):u(d)}function u(d){return d===null||ye(d)?r(d):s(d)}}const Bp={continuation:{tokenize:Zv},exit:Kv,name:"blockQuote",tokenize:Fv};function Fv(n,r,s){const o=this;return u;function u(f){if(f===62){const x=o.containerState;return x.open||(n.enter("blockQuote",{_container:!0}),x.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),d}return s(f)}function d(f){return Te(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function Zv(n,r,s){const o=this;return u;function u(f){return Te(f)?Oe(n,d,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):d(f)}function d(f){return n.attempt(Bp,r,s)(f)}}function Kv(n){n.exit("blockQuote")}const qp={name:"characterEscape",tokenize:Iv};function Iv(n,r,s){return o;function o(d){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(d),n.exit("escapeMarker"),u}function u(d){return Lv(d)?(n.enter("characterEscapeValue"),n.consume(d),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(d)}}const Yp={name:"characterReference",tokenize:Jv};function Jv(n,r,s){const o=this;let u=0,d,f;return x;function x(g){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(g),n.exit("characterReferenceMarker"),p}function p(g){return g===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(g),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),d=31,f=bt,y(g))}function h(g){return g===88||g===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(g),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),d=6,f=Rv,y):(n.enter("characterReferenceValue"),d=7,f=Wu,y(g))}function y(g){if(g===59&&u){const v=n.exit("characterReferenceValue");return f===bt&&!jd(o.sliceSerialize(v))?s(g):(n.enter("characterReferenceMarker"),n.consume(g),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(g)&&u++<d?(n.consume(g),y):s(g)}}const cx={partial:!0,tokenize:Wv},ux={concrete:!0,name:"codeFenced",tokenize:Pv};function Pv(n,r,s){const o=this,u={partial:!0,tokenize:z};let d=0,f=0,x;return p;function p(U){return h(U)}function h(U){const $=o.events[o.events.length-1];return d=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,x=U,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),y(U)}function y(U){return U===x?(f++,n.consume(U),y):f<3?s(U):(n.exit("codeFencedFenceSequence"),Te(U)?Oe(n,g,"whitespace")(U):g(U))}function g(U){return U===null||ye(U)?(n.exit("codeFencedFence"),o.interrupt?r(U):n.check(cx,R,I)(U)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),v(U))}function v(U){return U===null||ye(U)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),g(U)):Te(U)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Oe(n,j,"whitespace")(U)):U===96&&U===x?s(U):(n.consume(U),v)}function j(U){return U===null||ye(U)?g(U):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),k(U))}function k(U){return U===null||ye(U)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),g(U)):U===96&&U===x?s(U):(n.consume(U),k)}function R(U){return n.attempt(u,I,S)(U)}function S(U){return n.enter("lineEnding"),n.consume(U),n.exit("lineEnding"),T}function T(U){return d>0&&Te(U)?Oe(n,V,"linePrefix",d+1)(U):V(U)}function V(U){return U===null||ye(U)?n.check(cx,R,I)(U):(n.enter("codeFlowValue"),H(U))}function H(U){return U===null||ye(U)?(n.exit("codeFlowValue"),V(U)):(n.consume(U),H)}function I(U){return n.exit("codeFenced"),r(U)}function z(U,$,fe){let J=0;return M;function M(ee){return U.enter("lineEnding"),U.consume(ee),U.exit("lineEnding"),ne}function ne(ee){return U.enter("codeFencedFence"),Te(ee)?Oe(U,re,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):re(ee)}function re(ee){return ee===x?(U.enter("codeFencedFenceSequence"),Z(ee)):fe(ee)}function Z(ee){return ee===x?(J++,U.consume(ee),Z):J>=f?(U.exit("codeFencedFenceSequence"),Te(ee)?Oe(U,Q,"whitespace")(ee):Q(ee)):fe(ee)}function Q(ee){return ee===null||ye(ee)?(U.exit("codeFencedFence"),$(ee)):fe(ee)}}}function Wv(n,r,s){const o=this;return u;function u(f){return f===null?s(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d)}function d(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}const Eu={name:"codeIndented",tokenize:t2},e2={partial:!0,tokenize:n2};function t2(n,r,s){const o=this;return u;function u(h){return n.enter("codeIndented"),Oe(n,d,"linePrefix",5)(h)}function d(h){const y=o.events[o.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?f(h):s(h)}function f(h){return h===null?p(h):ye(h)?n.attempt(e2,f,p)(h):(n.enter("codeFlowValue"),x(h))}function x(h){return h===null||ye(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),x)}function p(h){return n.exit("codeIndented"),r(h)}}function n2(n,r,s){const o=this;return u;function u(f){return o.parser.lazy[o.now().line]?s(f):ye(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),u):Oe(n,d,"linePrefix",5)(f)}function d(f){const x=o.events[o.events.length-1];return x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?r(f):ye(f)?u(f):s(f)}}const l2={name:"codeText",previous:r2,resolve:a2,tokenize:s2};function a2(n){let r=n.length-4,s=3,o,u;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(o=s;++o<r;)if(n[o][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(o=s-1,r++;++o<=r;)u===void 0?o!==r&&n[o][1].type!=="lineEnding"&&(u=o):(o===r||n[o][1].type==="lineEnding")&&(n[u][1].type="codeTextData",o!==u+2&&(n[u][1].end=n[o-1][1].end,n.splice(u+2,o-u-2),r-=o-u-2,o=u+2),u=void 0);return n}function r2(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function s2(n,r,s){let o=0,u,d;return f;function f(g){return n.enter("codeText"),n.enter("codeTextSequence"),x(g)}function x(g){return g===96?(n.consume(g),o++,x):(n.exit("codeTextSequence"),p(g))}function p(g){return g===null?s(g):g===32?(n.enter("space"),n.consume(g),n.exit("space"),p):g===96?(d=n.enter("codeTextSequence"),u=0,y(g)):ye(g)?(n.enter("lineEnding"),n.consume(g),n.exit("lineEnding"),p):(n.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||ye(g)?(n.exit("codeTextData"),p(g)):(n.consume(g),h)}function y(g){return g===96?(n.consume(g),u++,y):u===o?(n.exit("codeTextSequence"),n.exit("codeText"),r(g)):(d.type="codeTextData",h(g))}}class i2{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const o=s??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(r,o):r>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(r,s,o){const u=s||0;this.setCursor(Math.trunc(r));const d=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return o&&Kr(this.left,o),d.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Kr(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Kr(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const s=this.left.splice(r,Number.POSITIVE_INFINITY);Kr(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Kr(this.left,s.reverse())}}}function Kr(n,r){let s=0;if(r.length<1e4)n.push(...r);else for(;s<r.length;)n.push(...r.slice(s,s+1e4)),s+=1e4}function Vp(n){const r={};let s=-1,o,u,d,f,x,p,h;const y=new i2(n);for(;++s<y.length;){for(;s in r;)s=r[s];if(o=y.get(s),s&&o[1].type==="chunkFlow"&&y.get(s-1)[1].type==="listItemPrefix"&&(p=o[1]._tokenizer.events,d=0,d<p.length&&p[d][1].type==="lineEndingBlank"&&(d+=2),d<p.length&&p[d][1].type==="content"))for(;++d<p.length&&p[d][1].type!=="content";)p[d][1].type==="chunkText"&&(p[d][1]._isInFirstContentOfListItem=!0,d++);if(o[0]==="enter")o[1].contentType&&(Object.assign(r,o2(y,s)),s=r[s],h=!0);else if(o[1]._container){for(d=s,u=void 0;d--;)if(f=y.get(d),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(u&&(y.get(u)[1].type="lineEndingBlank"),f[1].type="lineEnding",u=d);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;u&&(o[1].end={...y.get(u)[1].start},x=y.slice(u,s),x.unshift(o),y.splice(u,s-u+1,x))}}return Qt(n,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function o2(n,r){const s=n.get(r)[1],o=n.get(r)[2];let u=r-1;const d=[];let f=s._tokenizer;f||(f=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const x=f.events,p=[],h={};let y,g,v=-1,j=s,k=0,R=0;const S=[R];for(;j;){for(;n.get(++u)[1]!==j;);d.push(u),j._tokenizer||(y=o.sliceStream(j),j.next||y.push(null),g&&f.defineSkip(j.start),j._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(y),j._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),g=j,j=j.next}for(j=s;++v<x.length;)x[v][0]==="exit"&&x[v-1][0]==="enter"&&x[v][1].type===x[v-1][1].type&&x[v][1].start.line!==x[v][1].end.line&&(R=v+1,S.push(R),j._tokenizer=void 0,j.previous=void 0,j=j.next);for(f.events=[],j?(j._tokenizer=void 0,j.previous=void 0):S.pop(),v=S.length;v--;){const T=x.slice(S[v],S[v+1]),V=d.pop();p.push([V,V+T.length-1]),n.splice(V,2,T)}for(p.reverse(),v=-1;++v<p.length;)h[k+p[v][0]]=k+p[v][1],k+=p[v][1]-p[v][0]-1;return h}const c2={resolve:d2,tokenize:f2},u2={partial:!0,tokenize:m2};function d2(n){return Vp(n),n}function f2(n,r){let s;return o;function o(x){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),u(x)}function u(x){return x===null?d(x):ye(x)?n.check(u2,f,d)(x):(n.consume(x),u)}function d(x){return n.exit("chunkContent"),n.exit("content"),r(x)}function f(x){return n.consume(x),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,u}}function m2(n,r,s){const o=this;return u;function u(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Oe(n,d,"linePrefix")}function d(f){if(f===null||ye(f))return s(f);const x=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?r(f):n.interrupt(o.parser.constructs.flow,s,r)(f)}}function Gp(n,r,s,o,u,d,f,x,p){const h=p||Number.POSITIVE_INFINITY;let y=0;return g;function g(T){return T===60?(n.enter(o),n.enter(u),n.enter(d),n.consume(T),n.exit(d),v):T===null||T===32||T===41||$i(T)?s(T):(n.enter(o),n.enter(f),n.enter(x),n.enter("chunkString",{contentType:"string"}),R(T))}function v(T){return T===62?(n.enter(d),n.consume(T),n.exit(d),n.exit(u),n.exit(o),r):(n.enter(x),n.enter("chunkString",{contentType:"string"}),j(T))}function j(T){return T===62?(n.exit("chunkString"),n.exit(x),v(T)):T===null||T===60||ye(T)?s(T):(n.consume(T),T===92?k:j)}function k(T){return T===60||T===62||T===92?(n.consume(T),j):j(T)}function R(T){return!y&&(T===null||T===41||Ze(T))?(n.exit("chunkString"),n.exit(x),n.exit(f),n.exit(o),r(T)):y<h&&T===40?(n.consume(T),y++,R):T===41?(n.consume(T),y--,R):T===null||T===32||T===40||$i(T)?s(T):(n.consume(T),T===92?S:R)}function S(T){return T===40||T===41||T===92?(n.consume(T),R):R(T)}}function $p(n,r,s,o,u,d){const f=this;let x=0,p;return h;function h(j){return n.enter(o),n.enter(u),n.consume(j),n.exit(u),n.enter(d),y}function y(j){return x>999||j===null||j===91||j===93&&!p||j===94&&!x&&"_hiddenFootnoteSupport"in f.parser.constructs?s(j):j===93?(n.exit(d),n.enter(u),n.consume(j),n.exit(u),n.exit(o),r):ye(j)?(n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),y):(n.enter("chunkString",{contentType:"string"}),g(j))}function g(j){return j===null||j===91||j===93||ye(j)||x++>999?(n.exit("chunkString"),y(j)):(n.consume(j),p||(p=!Te(j)),j===92?v:g)}function v(j){return j===91||j===92||j===93?(n.consume(j),x++,g):g(j)}}function Qp(n,r,s,o,u,d){let f;return x;function x(v){return v===34||v===39||v===40?(n.enter(o),n.enter(u),n.consume(v),n.exit(u),f=v===40?41:v,p):s(v)}function p(v){return v===f?(n.enter(u),n.consume(v),n.exit(u),n.exit(o),r):(n.enter(d),h(v))}function h(v){return v===f?(n.exit(d),p(f)):v===null?s(v):ye(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),Oe(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),y(v))}function y(v){return v===f||v===null||ye(v)?(n.exit("chunkString"),h(v)):(n.consume(v),v===92?g:y)}function g(v){return v===f||v===92?(n.consume(v),y):y(v)}}function as(n,r){let s;return o;function o(u){return ye(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),s=!0,o):Te(u)?Oe(n,o,s?"linePrefix":"lineSuffix")(u):r(u)}}const h2={name:"definition",tokenize:p2},x2={partial:!0,tokenize:g2};function p2(n,r,s){const o=this;let u;return d;function d(j){return n.enter("definition"),f(j)}function f(j){return $p.call(o,n,x,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(j)}function x(j){return u=dn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),j===58?(n.enter("definitionMarker"),n.consume(j),n.exit("definitionMarker"),p):s(j)}function p(j){return Ze(j)?as(n,h)(j):h(j)}function h(j){return Gp(n,y,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(j)}function y(j){return n.attempt(x2,g,g)(j)}function g(j){return Te(j)?Oe(n,v,"whitespace")(j):v(j)}function v(j){return j===null||ye(j)?(n.exit("definition"),o.parser.defined.push(u),r(j)):s(j)}}function g2(n,r,s){return o;function o(x){return Ze(x)?as(n,u)(x):s(x)}function u(x){return Qp(n,d,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(x)}function d(x){return Te(x)?Oe(n,f,"whitespace")(x):f(x)}function f(x){return x===null||ye(x)?r(x):s(x)}}const y2={name:"hardBreakEscape",tokenize:b2};function b2(n,r,s){return o;function o(d){return n.enter("hardBreakEscape"),n.consume(d),u}function u(d){return ye(d)?(n.exit("hardBreakEscape"),r(d)):s(d)}}const v2={name:"headingAtx",resolve:j2,tokenize:N2};function j2(n,r){let s=n.length-2,o=3,u,d;return n[o][1].type==="whitespace"&&(o+=2),s-2>o&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(o===s-1||s-4>o&&n[s-2][1].type==="whitespace")&&(s-=o+1===s?2:4),s>o&&(u={type:"atxHeadingText",start:n[o][1].start,end:n[s][1].end},d={type:"chunkText",start:n[o][1].start,end:n[s][1].end,contentType:"text"},Qt(n,o,s-o+1,[["enter",u,r],["enter",d,r],["exit",d,r],["exit",u,r]])),n}function N2(n,r,s){let o=0;return u;function u(y){return n.enter("atxHeading"),d(y)}function d(y){return n.enter("atxHeadingSequence"),f(y)}function f(y){return y===35&&o++<6?(n.consume(y),f):y===null||Ze(y)?(n.exit("atxHeadingSequence"),x(y)):s(y)}function x(y){return y===35?(n.enter("atxHeadingSequence"),p(y)):y===null||ye(y)?(n.exit("atxHeading"),r(y)):Te(y)?Oe(n,x,"whitespace")(y):(n.enter("atxHeadingText"),h(y))}function p(y){return y===35?(n.consume(y),p):(n.exit("atxHeadingSequence"),x(y))}function h(y){return y===null||y===35||Ze(y)?(n.exit("atxHeadingText"),x(y)):(n.consume(y),h)}}const w2=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],dx=["pre","script","style","textarea"],k2={concrete:!0,name:"htmlFlow",resolveTo:_2,tokenize:T2},S2={partial:!0,tokenize:A2},C2={partial:!0,tokenize:E2};function _2(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function T2(n,r,s){const o=this;let u,d,f,x,p;return h;function h(w){return y(w)}function y(w){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(w),g}function g(w){return w===33?(n.consume(w),v):w===47?(n.consume(w),d=!0,R):w===63?(n.consume(w),u=3,o.interrupt?r:C):kt(w)?(n.consume(w),f=String.fromCharCode(w),S):s(w)}function v(w){return w===45?(n.consume(w),u=2,j):w===91?(n.consume(w),u=5,x=0,k):kt(w)?(n.consume(w),u=4,o.interrupt?r:C):s(w)}function j(w){return w===45?(n.consume(w),o.interrupt?r:C):s(w)}function k(w){const oe="CDATA[";return w===oe.charCodeAt(x++)?(n.consume(w),x===oe.length?o.interrupt?r:re:k):s(w)}function R(w){return kt(w)?(n.consume(w),f=String.fromCharCode(w),S):s(w)}function S(w){if(w===null||w===47||w===62||Ze(w)){const oe=w===47,xe=f.toLowerCase();return!oe&&!d&&dx.includes(xe)?(u=1,o.interrupt?r(w):re(w)):w2.includes(f.toLowerCase())?(u=6,oe?(n.consume(w),T):o.interrupt?r(w):re(w)):(u=7,o.interrupt&&!o.parser.lazy[o.now().line]?s(w):d?V(w):H(w))}return w===45||bt(w)?(n.consume(w),f+=String.fromCharCode(w),S):s(w)}function T(w){return w===62?(n.consume(w),o.interrupt?r:re):s(w)}function V(w){return Te(w)?(n.consume(w),V):M(w)}function H(w){return w===47?(n.consume(w),M):w===58||w===95||kt(w)?(n.consume(w),I):Te(w)?(n.consume(w),H):M(w)}function I(w){return w===45||w===46||w===58||w===95||bt(w)?(n.consume(w),I):z(w)}function z(w){return w===61?(n.consume(w),U):Te(w)?(n.consume(w),z):H(w)}function U(w){return w===null||w===60||w===61||w===62||w===96?s(w):w===34||w===39?(n.consume(w),p=w,$):Te(w)?(n.consume(w),U):fe(w)}function $(w){return w===p?(n.consume(w),p=null,J):w===null||ye(w)?s(w):(n.consume(w),$)}function fe(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Ze(w)?z(w):(n.consume(w),fe)}function J(w){return w===47||w===62||Te(w)?H(w):s(w)}function M(w){return w===62?(n.consume(w),ne):s(w)}function ne(w){return w===null||ye(w)?re(w):Te(w)?(n.consume(w),ne):s(w)}function re(w){return w===45&&u===2?(n.consume(w),A):w===60&&u===1?(n.consume(w),O):w===62&&u===4?(n.consume(w),_):w===63&&u===3?(n.consume(w),C):w===93&&u===5?(n.consume(w),ie):ye(w)&&(u===6||u===7)?(n.exit("htmlFlowData"),n.check(S2,F,Z)(w)):w===null||ye(w)?(n.exit("htmlFlowData"),Z(w)):(n.consume(w),re)}function Z(w){return n.check(C2,Q,F)(w)}function Q(w){return n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),ee}function ee(w){return w===null||ye(w)?Z(w):(n.enter("htmlFlowData"),re(w))}function A(w){return w===45?(n.consume(w),C):re(w)}function O(w){return w===47?(n.consume(w),f="",le):re(w)}function le(w){if(w===62){const oe=f.toLowerCase();return dx.includes(oe)?(n.consume(w),_):re(w)}return kt(w)&&f.length<8?(n.consume(w),f+=String.fromCharCode(w),le):re(w)}function ie(w){return w===93?(n.consume(w),C):re(w)}function C(w){return w===62?(n.consume(w),_):w===45&&u===2?(n.consume(w),C):re(w)}function _(w){return w===null||ye(w)?(n.exit("htmlFlowData"),F(w)):(n.consume(w),_)}function F(w){return n.exit("htmlFlow"),r(w)}}function E2(n,r,s){const o=this;return u;function u(f){return ye(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):s(f)}function d(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}function A2(n,r,s){return o;function o(u){return n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),n.attempt(fs,r,s)}}const M2={name:"htmlText",tokenize:z2};function z2(n,r,s){const o=this;let u,d,f;return x;function x(C){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(C),p}function p(C){return C===33?(n.consume(C),h):C===47?(n.consume(C),z):C===63?(n.consume(C),H):kt(C)?(n.consume(C),fe):s(C)}function h(C){return C===45?(n.consume(C),y):C===91?(n.consume(C),d=0,k):kt(C)?(n.consume(C),V):s(C)}function y(C){return C===45?(n.consume(C),j):s(C)}function g(C){return C===null?s(C):C===45?(n.consume(C),v):ye(C)?(f=g,O(C)):(n.consume(C),g)}function v(C){return C===45?(n.consume(C),j):g(C)}function j(C){return C===62?A(C):C===45?v(C):g(C)}function k(C){const _="CDATA[";return C===_.charCodeAt(d++)?(n.consume(C),d===_.length?R:k):s(C)}function R(C){return C===null?s(C):C===93?(n.consume(C),S):ye(C)?(f=R,O(C)):(n.consume(C),R)}function S(C){return C===93?(n.consume(C),T):R(C)}function T(C){return C===62?A(C):C===93?(n.consume(C),T):R(C)}function V(C){return C===null||C===62?A(C):ye(C)?(f=V,O(C)):(n.consume(C),V)}function H(C){return C===null?s(C):C===63?(n.consume(C),I):ye(C)?(f=H,O(C)):(n.consume(C),H)}function I(C){return C===62?A(C):H(C)}function z(C){return kt(C)?(n.consume(C),U):s(C)}function U(C){return C===45||bt(C)?(n.consume(C),U):$(C)}function $(C){return ye(C)?(f=$,O(C)):Te(C)?(n.consume(C),$):A(C)}function fe(C){return C===45||bt(C)?(n.consume(C),fe):C===47||C===62||Ze(C)?J(C):s(C)}function J(C){return C===47?(n.consume(C),A):C===58||C===95||kt(C)?(n.consume(C),M):ye(C)?(f=J,O(C)):Te(C)?(n.consume(C),J):A(C)}function M(C){return C===45||C===46||C===58||C===95||bt(C)?(n.consume(C),M):ne(C)}function ne(C){return C===61?(n.consume(C),re):ye(C)?(f=ne,O(C)):Te(C)?(n.consume(C),ne):J(C)}function re(C){return C===null||C===60||C===61||C===62||C===96?s(C):C===34||C===39?(n.consume(C),u=C,Z):ye(C)?(f=re,O(C)):Te(C)?(n.consume(C),re):(n.consume(C),Q)}function Z(C){return C===u?(n.consume(C),u=void 0,ee):C===null?s(C):ye(C)?(f=Z,O(C)):(n.consume(C),Z)}function Q(C){return C===null||C===34||C===39||C===60||C===61||C===96?s(C):C===47||C===62||Ze(C)?J(C):(n.consume(C),Q)}function ee(C){return C===47||C===62||Ze(C)?J(C):s(C)}function A(C){return C===62?(n.consume(C),n.exit("htmlTextData"),n.exit("htmlText"),r):s(C)}function O(C){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(C),n.exit("lineEnding"),le}function le(C){return Te(C)?Oe(n,ie,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):ie(C)}function ie(C){return n.enter("htmlTextData"),f(C)}}const Nd={name:"labelEnd",resolveAll:L2,resolveTo:U2,tokenize:H2},O2={tokenize:B2},D2={tokenize:q2},R2={tokenize:Y2};function L2(n){let r=-1;const s=[];for(;++r<n.length;){const o=n[r][1];if(s.push(n[r]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const u=o.type==="labelImage"?4:2;o.type="data",r+=u}}return n.length!==s.length&&Qt(n,0,n.length,s),n}function U2(n,r){let s=n.length,o=0,u,d,f,x;for(;s--;)if(u=n[s][1],d){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;n[s][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(f){if(n[s][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(d=s,u.type!=="labelLink")){o=2;break}}else u.type==="labelEnd"&&(f=s);const p={type:n[d][1].type==="labelLink"?"link":"image",start:{...n[d][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[d][1].start},end:{...n[f][1].end}},y={type:"labelText",start:{...n[d+o+2][1].end},end:{...n[f-2][1].start}};return x=[["enter",p,r],["enter",h,r]],x=ln(x,n.slice(d+1,d+o+3)),x=ln(x,[["enter",y,r]]),x=ln(x,eo(r.parser.constructs.insideSpan.null,n.slice(d+o+4,f-3),r)),x=ln(x,[["exit",y,r],n[f-2],n[f-1],["exit",h,r]]),x=ln(x,n.slice(f+1)),x=ln(x,[["exit",p,r]]),Qt(n,d,n.length,x),n}function H2(n,r,s){const o=this;let u=o.events.length,d,f;for(;u--;)if((o.events[u][1].type==="labelImage"||o.events[u][1].type==="labelLink")&&!o.events[u][1]._balanced){d=o.events[u][1];break}return x;function x(v){return d?d._inactive?g(v):(f=o.parser.defined.includes(dn(o.sliceSerialize({start:d.end,end:o.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(v),n.exit("labelMarker"),n.exit("labelEnd"),p):s(v)}function p(v){return v===40?n.attempt(O2,y,f?y:g)(v):v===91?n.attempt(D2,y,f?h:g)(v):f?y(v):g(v)}function h(v){return n.attempt(R2,y,g)(v)}function y(v){return r(v)}function g(v){return d._balanced=!0,s(v)}}function B2(n,r,s){return o;function o(g){return n.enter("resource"),n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),u}function u(g){return Ze(g)?as(n,d)(g):d(g)}function d(g){return g===41?y(g):Gp(n,f,x,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return Ze(g)?as(n,p)(g):y(g)}function x(g){return s(g)}function p(g){return g===34||g===39||g===40?Qp(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return Ze(g)?as(n,y)(g):y(g)}function y(g){return g===41?(n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),n.exit("resource"),r):s(g)}}function q2(n,r,s){const o=this;return u;function u(x){return $p.call(o,n,d,f,"reference","referenceMarker","referenceString")(x)}function d(x){return o.parser.defined.includes(dn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?r(x):s(x)}function f(x){return s(x)}}function Y2(n,r,s){return o;function o(d){return n.enter("reference"),n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),u}function u(d){return d===93?(n.enter("referenceMarker"),n.consume(d),n.exit("referenceMarker"),n.exit("reference"),r):s(d)}}const V2={name:"labelStartImage",resolveAll:Nd.resolveAll,tokenize:G2};function G2(n,r,s){const o=this;return u;function u(x){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(x),n.exit("labelImageMarker"),d}function d(x){return x===91?(n.enter("labelMarker"),n.consume(x),n.exit("labelMarker"),n.exit("labelImage"),f):s(x)}function f(x){return x===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(x):r(x)}}const $2={name:"labelStartLink",resolveAll:Nd.resolveAll,tokenize:Q2};function Q2(n,r,s){const o=this;return u;function u(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),d}function d(f){return f===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(f):r(f)}}const Au={name:"lineEnding",tokenize:X2};function X2(n,r){return s;function s(o){return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Oe(n,r,"linePrefix")}}const Vi={name:"thematicBreak",tokenize:F2};function F2(n,r,s){let o=0,u;return d;function d(h){return n.enter("thematicBreak"),f(h)}function f(h){return u=h,x(h)}function x(h){return h===u?(n.enter("thematicBreakSequence"),p(h)):o>=3&&(h===null||ye(h))?(n.exit("thematicBreak"),r(h)):s(h)}function p(h){return h===u?(n.consume(h),o++,p):(n.exit("thematicBreakSequence"),Te(h)?Oe(n,x,"whitespace")(h):x(h))}}const Ot={continuation:{tokenize:J2},exit:W2,name:"list",tokenize:I2},Z2={partial:!0,tokenize:e5},K2={partial:!0,tokenize:P2};function I2(n,r,s){const o=this,u=o.events[o.events.length-1];let d=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,f=0;return x;function x(j){const k=o.containerState.type||(j===42||j===43||j===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!o.containerState.marker||j===o.containerState.marker:Wu(j)){if(o.containerState.type||(o.containerState.type=k,n.enter(k,{_container:!0})),k==="listUnordered")return n.enter("listItemPrefix"),j===42||j===45?n.check(Vi,s,h)(j):h(j);if(!o.interrupt||j===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),p(j)}return s(j)}function p(j){return Wu(j)&&++f<10?(n.consume(j),p):(!o.interrupt||f<2)&&(o.containerState.marker?j===o.containerState.marker:j===41||j===46)?(n.exit("listItemValue"),h(j)):s(j)}function h(j){return n.enter("listItemMarker"),n.consume(j),n.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||j,n.check(fs,o.interrupt?s:y,n.attempt(Z2,v,g))}function y(j){return o.containerState.initialBlankLine=!0,d++,v(j)}function g(j){return Te(j)?(n.enter("listItemPrefixWhitespace"),n.consume(j),n.exit("listItemPrefixWhitespace"),v):s(j)}function v(j){return o.containerState.size=d+o.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(j)}}function J2(n,r,s){const o=this;return o.containerState._closeFlow=void 0,n.check(fs,u,d);function u(x){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Oe(n,r,"listItemIndent",o.containerState.size+1)(x)}function d(x){return o.containerState.furtherBlankLines||!Te(x)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,f(x)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,n.attempt(K2,r,f)(x))}function f(x){return o.containerState._closeFlow=!0,o.interrupt=void 0,Oe(n,n.attempt(Ot,r,s),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x)}}function P2(n,r,s){const o=this;return Oe(n,u,"listItemIndent",o.containerState.size+1);function u(d){const f=o.events[o.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===o.containerState.size?r(d):s(d)}}function W2(n){n.exit(this.containerState.type)}function e5(n,r,s){const o=this;return Oe(n,u,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(d){const f=o.events[o.events.length-1];return!Te(d)&&f&&f[1].type==="listItemPrefixWhitespace"?r(d):s(d)}}const fx={name:"setextUnderline",resolveTo:t5,tokenize:n5};function t5(n,r){let s=n.length,o,u,d;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){o=s;break}n[s][1].type==="paragraph"&&(u=s)}else n[s][1].type==="content"&&n.splice(s,1),!d&&n[s][1].type==="definition"&&(d=s);const f={type:"setextHeading",start:{...n[o][1].start},end:{...n[n.length-1][1].end}};return n[u][1].type="setextHeadingText",d?(n.splice(u,0,["enter",f,r]),n.splice(d+1,0,["exit",n[o][1],r]),n[o][1].end={...n[d][1].end}):n[o][1]=f,n.push(["exit",f,r]),n}function n5(n,r,s){const o=this;let u;return d;function d(h){let y=o.events.length,g;for(;y--;)if(o.events[y][1].type!=="lineEnding"&&o.events[y][1].type!=="linePrefix"&&o.events[y][1].type!=="content"){g=o.events[y][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||g)?(n.enter("setextHeadingLine"),u=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),x(h)}function x(h){return h===u?(n.consume(h),x):(n.exit("setextHeadingLineSequence"),Te(h)?Oe(n,p,"lineSuffix")(h):p(h))}function p(h){return h===null||ye(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const l5={tokenize:a5};function a5(n){const r=this,s=n.attempt(fs,o,n.attempt(this.parser.constructs.flowInitial,u,Oe(n,n.attempt(this.parser.constructs.flow,u,n.attempt(c2,u)),"linePrefix")));return s;function o(d){if(d===null){n.consume(d);return}return n.enter("lineEndingBlank"),n.consume(d),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function u(d){if(d===null){n.consume(d);return}return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const r5={resolveAll:Fp()},s5=Xp("string"),i5=Xp("text");function Xp(n){return{resolveAll:Fp(n==="text"?o5:void 0),tokenize:r};function r(s){const o=this,u=this.parser.constructs[n],d=s.attempt(u,f,x);return f;function f(y){return h(y)?d(y):x(y)}function x(y){if(y===null){s.consume(y);return}return s.enter("data"),s.consume(y),p}function p(y){return h(y)?(s.exit("data"),d(y)):(s.consume(y),p)}function h(y){if(y===null)return!0;const g=u[y];let v=-1;if(g)for(;++v<g.length;){const j=g[v];if(!j.previous||j.previous.call(o,o.previous))return!0}return!1}}}function Fp(n){return r;function r(s,o){let u=-1,d;for(;++u<=s.length;)d===void 0?s[u]&&s[u][1].type==="data"&&(d=u,u++):(!s[u]||s[u][1].type!=="data")&&(u!==d+2&&(s[d][1].end=s[u-1][1].end,s.splice(d+2,u-d-2),u=d+2),d=void 0);return n?n(s,o):s}}function o5(n,r){let s=0;for(;++s<=n.length;)if((s===n.length||n[s][1].type==="lineEnding")&&n[s-1][1].type==="data"){const o=n[s-1][1],u=r.sliceStream(o);let d=u.length,f=-1,x=0,p;for(;d--;){const h=u[d];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)x++,f--;if(f)break;f=-1}else if(h===-2)p=!0,x++;else if(h!==-1){d++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(x=0),x){const h={type:s===n.length||p||x<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:d?f:o.start._bufferIndex+f,_index:o.start._index+d,line:o.end.line,column:o.end.column-x,offset:o.end.offset-x},end:{...o.end}};o.end={...h.start},o.start.offset===o.end.offset?Object.assign(o,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const c5={42:Ot,43:Ot,45:Ot,48:Ot,49:Ot,50:Ot,51:Ot,52:Ot,53:Ot,54:Ot,55:Ot,56:Ot,57:Ot,62:Bp},u5={91:h2},d5={[-2]:Eu,[-1]:Eu,32:Eu},f5={35:v2,42:Vi,45:[fx,Vi],60:k2,61:fx,95:Vi,96:ux,126:ux},m5={38:Yp,92:qp},h5={[-5]:Au,[-4]:Au,[-3]:Au,33:V2,38:Yp,42:ed,60:[$v,M2],91:$2,92:[y2,qp],93:Nd,95:ed,96:l2},x5={null:[ed,r5]},p5={null:[42,95]},g5={null:[]},y5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:p5,contentInitial:u5,disable:g5,document:c5,flow:f5,flowInitial:d5,insideSpan:x5,string:m5,text:h5},Symbol.toStringTag,{value:"Module"}));function b5(n,r,s){let o={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const u={},d=[];let f=[],x=[];const p={attempt:$(z),check:$(U),consume:V,enter:H,exit:I,interrupt:$(U,{interrupt:!0})},h={code:null,containerState:{},defineSkip:R,events:[],now:k,parser:n,previous:null,sliceSerialize:v,sliceStream:j,write:g};let y=r.tokenize.call(h,p);return r.resolveAll&&d.push(r),h;function g(ne){return f=ln(f,ne),S(),f[f.length-1]!==null?[]:(fe(r,0),h.events=eo(d,h.events,h),h.events)}function v(ne,re){return j5(j(ne),re)}function j(ne){return v5(f,ne)}function k(){const{_bufferIndex:ne,_index:re,line:Z,column:Q,offset:ee}=o;return{_bufferIndex:ne,_index:re,line:Z,column:Q,offset:ee}}function R(ne){u[ne.line]=ne.column,M()}function S(){let ne;for(;o._index<f.length;){const re=f[o._index];if(typeof re=="string")for(ne=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===ne&&o._bufferIndex<re.length;)T(re.charCodeAt(o._bufferIndex));else T(re)}}function T(ne){y=y(ne)}function V(ne){ye(ne)?(o.line++,o.column=1,o.offset+=ne===-3?2:1,M()):ne!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===f[o._index].length&&(o._bufferIndex=-1,o._index++)),h.previous=ne}function H(ne,re){const Z=re||{};return Z.type=ne,Z.start=k(),h.events.push(["enter",Z,h]),x.push(Z),Z}function I(ne){const re=x.pop();return re.end=k(),h.events.push(["exit",re,h]),re}function z(ne,re){fe(ne,re.from)}function U(ne,re){re.restore()}function $(ne,re){return Z;function Z(Q,ee,A){let O,le,ie,C;return Array.isArray(Q)?F(Q):"tokenize"in Q?F([Q]):_(Q);function _(pe){return Ee;function Ee(Pe){const Ye=Pe!==null&&pe[Pe],Xt=Pe!==null&&pe.null,Nn=[...Array.isArray(Ye)?Ye:Ye?[Ye]:[],...Array.isArray(Xt)?Xt:Xt?[Xt]:[]];return F(Nn)(Pe)}}function F(pe){return O=pe,le=0,pe.length===0?A:w(pe[le])}function w(pe){return Ee;function Ee(Pe){return C=J(),ie=pe,pe.partial||(h.currentConstruct=pe),pe.name&&h.parser.constructs.disable.null.includes(pe.name)?xe():pe.tokenize.call(re?Object.assign(Object.create(h),re):h,p,oe,xe)(Pe)}}function oe(pe){return ne(ie,C),ee}function xe(pe){return C.restore(),++le<O.length?w(O[le]):A}}}function fe(ne,re){ne.resolveAll&&!d.includes(ne)&&d.push(ne),ne.resolve&&Qt(h.events,re,h.events.length-re,ne.resolve(h.events.slice(re),h)),ne.resolveTo&&(h.events=ne.resolveTo(h.events,h))}function J(){const ne=k(),re=h.previous,Z=h.currentConstruct,Q=h.events.length,ee=Array.from(x);return{from:Q,restore:A};function A(){o=ne,h.previous=re,h.currentConstruct=Z,h.events.length=Q,x=ee,M()}}function M(){o.line in u&&o.column<2&&(o.column=u[o.line],o.offset+=u[o.line]-1)}}function v5(n,r){const s=r.start._index,o=r.start._bufferIndex,u=r.end._index,d=r.end._bufferIndex;let f;if(s===u)f=[n[s].slice(o,d)];else{if(f=n.slice(s,u),o>-1){const x=f[0];typeof x=="string"?f[0]=x.slice(o):f.shift()}d>0&&f.push(n[u].slice(0,d))}return f}function j5(n,r){let s=-1;const o=[];let u;for(;++s<n.length;){const d=n[s];let f;if(typeof d=="string")f=d;else switch(d){case-5:{f="\r";break}case-4:{f=`
`;break}case-3:{f=`\r
`;break}case-2:{f=r?" ":"	";break}case-1:{if(!r&&u)continue;f=" ";break}default:f=String.fromCharCode(d)}u=d===-2,o.push(f)}return o.join("")}function N5(n){const o={constructs:Up([y5,...(n||{}).extensions||[]]),content:u(Uv),defined:[],document:u(Bv),flow:u(l5),lazy:{},string:u(s5),text:u(i5)};return o;function u(d){return f;function f(x){return b5(o,d,x)}}}function w5(n){for(;!Vp(n););return n}const mx=/[\0\t\n\r]/g;function k5(){let n=1,r="",s=!0,o;return u;function u(d,f,x){const p=[];let h,y,g,v,j;for(d=r+(typeof d=="string"?d.toString():new TextDecoder(f||void 0).decode(d)),g=0,r="",s&&(d.charCodeAt(0)===65279&&g++,s=void 0);g<d.length;){if(mx.lastIndex=g,h=mx.exec(d),v=h&&h.index!==void 0?h.index:d.length,j=d.charCodeAt(v),!h){r=d.slice(g);break}if(j===10&&g===v&&o)p.push(-3),o=void 0;else switch(o&&(p.push(-5),o=void 0),g<v&&(p.push(d.slice(g,v)),n+=v-g),j){case 0:{p.push(65533),n++;break}case 9:{for(y=Math.ceil(n/4)*4,p.push(-2);n++<y;)p.push(-1);break}case 10:{p.push(-4),n=1;break}default:o=!0,n=1}g=v+1}return x&&(o&&p.push(-5),r&&p.push(r),p.push(null)),p}}const S5=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function C5(n){return n.replace(S5,_5)}function _5(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const u=s.charCodeAt(1),d=u===120||u===88;return Hp(s.slice(d?2:1),d?16:10)}return jd(s)||n}const Zp={}.hasOwnProperty;function T5(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),E5(s)(w5(N5(s).document().write(k5()(n,r,!0))))}function E5(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:d(Il),autolinkProtocol:J,autolinkEmail:J,atxHeading:d(Zl),blockQuote:d(Xt),characterEscape:J,characterReference:J,codeFenced:d(Nn),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:d(Nn,f),codeText:d(Ja,f),codeTextData:J,data:J,codeFlowValue:J,definition:d(xs),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:d(wn),hardBreakEscape:d(Kl),hardBreakTrailing:d(Kl),htmlFlow:d(ps,f),htmlFlowData:J,htmlText:d(ps,f),htmlTextData:J,image:d(gs),label:f,link:d(Il),listItem:d(Pa),listItemValue:v,listOrdered:d(Jl,g),listUnordered:d(Jl),paragraph:d(ao),reference:w,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:d(Zl),strong:d(ro),thematicBreak:d(so)},exit:{atxHeading:p(),atxHeadingSequence:z,autolink:p(),autolinkEmail:Ye,autolinkProtocol:Pe,blockQuote:p(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:xe,characterReferenceMarkerNumeric:xe,characterReferenceValue:pe,characterReference:Ee,codeFenced:p(S),codeFencedFence:R,codeFencedFenceInfo:j,codeFencedFenceMeta:k,codeFlowValue:M,codeIndented:p(T),codeText:p(ee),codeTextData:M,data:M,definition:p(),definitionDestinationString:I,definitionLabelString:V,definitionTitleString:H,emphasis:p(),hardBreakEscape:p(re),hardBreakTrailing:p(re),htmlFlow:p(Z),htmlFlowData:M,htmlText:p(Q),htmlTextData:M,image:p(O),label:ie,labelText:le,lineEnding:ne,link:p(A),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:oe,resourceDestinationString:C,resourceTitleString:_,resource:F,setextHeading:p(fe),setextHeadingLineSequence:$,setextHeadingText:U,strong:p(),thematicBreak:p()}};Kp(r,(n||{}).mdastExtensions||[]);const s={};return o;function o(P){let ce={type:"root",children:[]};const ve={stack:[ce],tokenStack:[],config:r,enter:x,exit:h,buffer:f,resume:y,data:s},Se=[];let Ue=-1;for(;++Ue<P.length;)if(P[Ue][1].type==="listOrdered"||P[Ue][1].type==="listUnordered")if(P[Ue][0]==="enter")Se.push(Ue);else{const Rt=Se.pop();Ue=u(P,Rt,Ue)}for(Ue=-1;++Ue<P.length;){const Rt=r[P[Ue][0]];Zp.call(Rt,P[Ue][1].type)&&Rt[P[Ue][1].type].call(Object.assign({sliceSerialize:P[Ue][2].sliceSerialize},ve),P[Ue][1])}if(ve.tokenStack.length>0){const Rt=ve.tokenStack[ve.tokenStack.length-1];(Rt[1]||hx).call(ve,void 0,Rt[0])}for(ce.position={start:pl(P.length>0?P[0][1].start:{line:1,column:1,offset:0}),end:pl(P.length>0?P[P.length-2][1].end:{line:1,column:1,offset:0})},Ue=-1;++Ue<r.transforms.length;)ce=r.transforms[Ue](ce)||ce;return ce}function u(P,ce,ve){let Se=ce-1,Ue=-1,Rt=!1,kn,Nt,ct,St;for(;++Se<=ve;){const Xe=P[Se];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?Ue++:Ue--,St=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(kn&&!St&&!Ue&&!ct&&(ct=Se),St=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:St=void 0}if(!Ue&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||Ue===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(kn){let Qn=Se;for(Nt=void 0;Qn--;){const sn=P[Qn];if(sn[1].type==="lineEnding"||sn[1].type==="lineEndingBlank"){if(sn[0]==="exit")continue;Nt&&(P[Nt][1].type="lineEndingBlank",Rt=!0),sn[1].type="lineEnding",Nt=Qn}else if(!(sn[1].type==="linePrefix"||sn[1].type==="blockQuotePrefix"||sn[1].type==="blockQuotePrefixWhitespace"||sn[1].type==="blockQuoteMarker"||sn[1].type==="listItemIndent"))break}ct&&(!Nt||ct<Nt)&&(kn._spread=!0),kn.end=Object.assign({},Nt?P[Nt][1].start:Xe[1].end),P.splice(Nt||Se,0,["exit",kn,Xe[2]]),Se++,ve++}if(Xe[1].type==="listItemPrefix"){const Qn={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};kn=Qn,P.splice(Se,0,["enter",Qn,Xe[2]]),Se++,ve++,ct=void 0,St=!0}}}return P[ce][1]._spread=Rt,ve}function d(P,ce){return ve;function ve(Se){x.call(this,P(Se),Se),ce&&ce.call(this,Se)}}function f(){this.stack.push({type:"fragment",children:[]})}function x(P,ce,ve){this.stack[this.stack.length-1].children.push(P),this.stack.push(P),this.tokenStack.push([ce,ve||void 0]),P.position={start:pl(ce.start),end:void 0}}function p(P){return ce;function ce(ve){P&&P.call(this,ve),h.call(this,ve)}}function h(P,ce){const ve=this.stack.pop(),Se=this.tokenStack.pop();if(Se)Se[0].type!==P.type&&(ce?ce.call(this,P,Se[0]):(Se[1]||hx).call(this,P,Se[0]));else throw new Error("Cannot close `"+P.type+"` ("+ls({start:P.start,end:P.end})+"): it’s not open");ve.position.end=pl(P.end)}function y(){return vd(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function v(P){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(P),10),this.data.expectingFirstListItemValue=void 0}}function j(){const P=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=P}function k(){const P=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=P}function R(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const P=this.resume(),ce=this.stack[this.stack.length-1];ce.value=P.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const P=this.resume(),ce=this.stack[this.stack.length-1];ce.value=P.replace(/(\r?\n|\r)$/g,"")}function V(P){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.label=ce,ve.identifier=dn(this.sliceSerialize(P)).toLowerCase()}function H(){const P=this.resume(),ce=this.stack[this.stack.length-1];ce.title=P}function I(){const P=this.resume(),ce=this.stack[this.stack.length-1];ce.url=P}function z(P){const ce=this.stack[this.stack.length-1];if(!ce.depth){const ve=this.sliceSerialize(P).length;ce.depth=ve}}function U(){this.data.setextHeadingSlurpLineEnding=!0}function $(P){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(P).codePointAt(0)===61?1:2}function fe(){this.data.setextHeadingSlurpLineEnding=void 0}function J(P){const ve=this.stack[this.stack.length-1].children;let Se=ve[ve.length-1];(!Se||Se.type!=="text")&&(Se=jt(),Se.position={start:pl(P.start),end:void 0},ve.push(Se)),this.stack.push(Se)}function M(P){const ce=this.stack.pop();ce.value+=this.sliceSerialize(P),ce.position.end=pl(P.end)}function ne(P){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ve=ce.children[ce.children.length-1];ve.position.end=pl(P.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(ce.type)&&(J.call(this,P),M.call(this,P))}function re(){this.data.atHardBreak=!0}function Z(){const P=this.resume(),ce=this.stack[this.stack.length-1];ce.value=P}function Q(){const P=this.resume(),ce=this.stack[this.stack.length-1];ce.value=P}function ee(){const P=this.resume(),ce=this.stack[this.stack.length-1];ce.value=P}function A(){const P=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=ce,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function O(){const P=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";P.type+="Reference",P.referenceType=ce,delete P.url,delete P.title}else delete P.identifier,delete P.label;this.data.referenceType=void 0}function le(P){const ce=this.sliceSerialize(P),ve=this.stack[this.stack.length-2];ve.label=C5(ce),ve.identifier=dn(ce).toLowerCase()}function ie(){const P=this.stack[this.stack.length-1],ce=this.resume(),ve=this.stack[this.stack.length-1];if(this.data.inReference=!0,ve.type==="link"){const Se=P.children;ve.children=Se}else ve.alt=ce}function C(){const P=this.resume(),ce=this.stack[this.stack.length-1];ce.url=P}function _(){const P=this.resume(),ce=this.stack[this.stack.length-1];ce.title=P}function F(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function oe(P){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.label=ce,ve.identifier=dn(this.sliceSerialize(P)).toLowerCase(),this.data.referenceType="full"}function xe(P){this.data.characterReferenceType=P.type}function pe(P){const ce=this.sliceSerialize(P),ve=this.data.characterReferenceType;let Se;ve?(Se=Hp(ce,ve==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Se=jd(ce);const Ue=this.stack[this.stack.length-1];Ue.value+=Se}function Ee(P){const ce=this.stack.pop();ce.position.end=pl(P.end)}function Pe(P){M.call(this,P);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(P)}function Ye(P){M.call(this,P);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(P)}function Xt(){return{type:"blockquote",children:[]}}function Nn(){return{type:"code",lang:null,meta:null,value:""}}function Ja(){return{type:"inlineCode",value:""}}function xs(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function wn(){return{type:"emphasis",children:[]}}function Zl(){return{type:"heading",depth:0,children:[]}}function Kl(){return{type:"break"}}function ps(){return{type:"html",value:""}}function gs(){return{type:"image",title:null,url:"",alt:null}}function Il(){return{type:"link",title:null,url:"",children:[]}}function Jl(P){return{type:"list",ordered:P.type==="listOrdered",start:null,spread:P._spread,children:[]}}function Pa(P){return{type:"listItem",spread:P._spread,checked:null,children:[]}}function ao(){return{type:"paragraph",children:[]}}function ro(){return{type:"strong",children:[]}}function jt(){return{type:"text",value:""}}function so(){return{type:"thematicBreak"}}}function pl(n){return{line:n.line,column:n.column,offset:n.offset}}function Kp(n,r){let s=-1;for(;++s<r.length;){const o=r[s];Array.isArray(o)?Kp(n,o):A5(n,o)}}function A5(n,r){let s;for(s in r)if(Zp.call(r,s))switch(s){case"canContainEols":{const o=r[s];o&&n[s].push(...o);break}case"transforms":{const o=r[s];o&&n[s].push(...o);break}case"enter":case"exit":{const o=r[s];o&&Object.assign(n[s],o);break}}}function hx(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+ls({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+ls({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+ls({start:r.start,end:r.end})+") is still open")}function M5(n){const r=this;r.parser=s;function s(o){return T5(o,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function z5(n,r){const s={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(r),!0)};return n.patch(r,s),n.applyData(r,s)}function O5(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
`}]}function D5(n,r){const s=r.value?r.value+`
`:"",o={},u=r.lang?r.lang.split(/\s+/):[];u.length>0&&(o.className=["language-"+u[0]]);let d={type:"element",tagName:"code",properties:o,children:[{type:"text",value:s}]};return r.meta&&(d.data={meta:r.meta}),n.patch(r,d),d=n.applyData(r,d),d={type:"element",tagName:"pre",properties:{},children:[d]},n.patch(r,d),d}function R5(n,r){const s={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function L5(n,r){const s={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function U5(n,r){const s=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",o=String(r.identifier).toUpperCase(),u=Ia(o.toLowerCase()),d=n.footnoteOrder.indexOf(o);let f,x=n.footnoteCounts.get(o);x===void 0?(x=0,n.footnoteOrder.push(o),f=n.footnoteOrder.length):f=d+1,x+=1,n.footnoteCounts.set(o,x);const p={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+u,id:s+"fnref-"+u+(x>1?"-"+x:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(r,p);const h={type:"element",tagName:"sup",properties:{},children:[p]};return n.patch(r,h),n.applyData(r,h)}function H5(n,r){const s={type:"element",tagName:"h"+r.depth,properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function B5(n,r){if(n.options.allowDangerousHtml){const s={type:"raw",value:r.value};return n.patch(r,s),n.applyData(r,s)}}function Ip(n,r){const s=r.referenceType;let o="]";if(s==="collapsed"?o+="[]":s==="full"&&(o+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+o}];const u=n.all(r),d=u[0];d&&d.type==="text"?d.value="["+d.value:u.unshift({type:"text",value:"["});const f=u[u.length-1];return f&&f.type==="text"?f.value+=o:u.push({type:"text",value:o}),u}function q5(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return Ip(n,r);const u={src:Ia(o.url||""),alt:r.alt};o.title!==null&&o.title!==void 0&&(u.title=o.title);const d={type:"element",tagName:"img",properties:u,children:[]};return n.patch(r,d),n.applyData(r,d)}function Y5(n,r){const s={src:Ia(r.url)};r.alt!==null&&r.alt!==void 0&&(s.alt=r.alt),r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,o),n.applyData(r,o)}function V5(n,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,s);const o={type:"element",tagName:"code",properties:{},children:[s]};return n.patch(r,o),n.applyData(r,o)}function G5(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return Ip(n,r);const u={href:Ia(o.url||"")};o.title!==null&&o.title!==void 0&&(u.title=o.title);const d={type:"element",tagName:"a",properties:u,children:n.all(r)};return n.patch(r,d),n.applyData(r,d)}function $5(n,r){const s={href:Ia(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,o),n.applyData(r,o)}function Q5(n,r,s){const o=n.all(r),u=s?X5(s):Jp(r),d={},f=[];if(typeof r.checked=="boolean"){const y=o[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},o.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let x=-1;for(;++x<o.length;){const y=o[x];(u||x!==0||y.type!=="element"||y.tagName!=="p")&&f.push({type:"text",value:`
`}),y.type==="element"&&y.tagName==="p"&&!u?f.push(...y.children):f.push(y)}const p=o[o.length-1];p&&(u||p.type!=="element"||p.tagName!=="p")&&f.push({type:"text",value:`
`});const h={type:"element",tagName:"li",properties:d,children:f};return n.patch(r,h),n.applyData(r,h)}function X5(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const s=n.children;let o=-1;for(;!r&&++o<s.length;)r=Jp(s[o])}return r}function Jp(n){const r=n.spread;return r??n.children.length>1}function F5(n,r){const s={},o=n.all(r);let u=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++u<o.length;){const f=o[u];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const d={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:n.wrap(o,!0)};return n.patch(r,d),n.applyData(r,d)}function Z5(n,r){const s={type:"element",tagName:"p",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function K5(n,r){const s={type:"root",children:n.wrap(n.all(r))};return n.patch(r,s),n.applyData(r,s)}function I5(n,r){const s={type:"element",tagName:"strong",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function J5(n,r){const s=n.all(r),o=s.shift(),u=[];if(o){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([o],!0)};n.patch(r.children[0],f),u.push(f)}if(s.length>0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(s,!0)},x=pd(r.children[1]),p=Ap(r.children[r.children.length-1]);x&&p&&(f.position={start:x,end:p}),u.push(f)}const d={type:"element",tagName:"table",properties:{},children:n.wrap(u,!0)};return n.patch(r,d),n.applyData(r,d)}function P5(n,r,s){const o=s?s.children:void 0,d=(o?o.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,x=f?f.length:r.children.length;let p=-1;const h=[];for(;++p<x;){const g=r.children[p],v={},j=f?f[p]:void 0;j&&(v.align=j);let k={type:"element",tagName:d,properties:v,children:[]};g&&(k.children=n.all(g),n.patch(g,k),k=n.applyData(g,k)),h.push(k)}const y={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(r,y),n.applyData(r,y)}function W5(n,r){const s={type:"element",tagName:"td",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}const xx=9,px=32;function ej(n){const r=String(n),s=/\r?\n|\r/g;let o=s.exec(r),u=0;const d=[];for(;o;)d.push(gx(r.slice(u,o.index),u>0,!0),o[0]),u=o.index+o[0].length,o=s.exec(r);return d.push(gx(r.slice(u),u>0,!1)),d.join("")}function gx(n,r,s){let o=0,u=n.length;if(r){let d=n.codePointAt(o);for(;d===xx||d===px;)o++,d=n.codePointAt(o)}if(s){let d=n.codePointAt(u-1);for(;d===xx||d===px;)u--,d=n.codePointAt(u-1)}return u>o?n.slice(o,u):""}function tj(n,r){const s={type:"text",value:ej(String(r.value))};return n.patch(r,s),n.applyData(r,s)}function nj(n,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,s),n.applyData(r,s)}const lj={blockquote:z5,break:O5,code:D5,delete:R5,emphasis:L5,footnoteReference:U5,heading:H5,html:B5,imageReference:q5,image:Y5,inlineCode:V5,linkReference:G5,link:$5,listItem:Q5,list:F5,paragraph:Z5,root:K5,strong:I5,table:J5,tableCell:W5,tableRow:P5,text:tj,thematicBreak:nj,toml:Di,yaml:Di,definition:Di,footnoteDefinition:Di};function Di(){}const Pp=-1,to=0,rs=1,Qi=2,wd=3,kd=4,Sd=5,Cd=6,Wp=7,eg=8,yx=typeof self=="object"?self:globalThis,aj=(n,r)=>{const s=(u,d)=>(n.set(d,u),u),o=u=>{if(n.has(u))return n.get(u);const[d,f]=r[u];switch(d){case to:case Pp:return s(f,u);case rs:{const x=s([],u);for(const p of f)x.push(o(p));return x}case Qi:{const x=s({},u);for(const[p,h]of f)x[o(p)]=o(h);return x}case wd:return s(new Date(f),u);case kd:{const{source:x,flags:p}=f;return s(new RegExp(x,p),u)}case Sd:{const x=s(new Map,u);for(const[p,h]of f)x.set(o(p),o(h));return x}case Cd:{const x=s(new Set,u);for(const p of f)x.add(o(p));return x}case Wp:{const{name:x,message:p}=f;return s(new yx[x](p),u)}case eg:return s(BigInt(f),u);case"BigInt":return s(Object(BigInt(f)),u);case"ArrayBuffer":return s(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:x}=new Uint8Array(f);return s(new DataView(x),f)}}return s(new yx[d](f),u)};return o},bx=n=>aj(new Map,n)(0),Ua="",{toString:rj}={},{keys:sj}=Object,Ir=n=>{const r=typeof n;if(r!=="object"||!n)return[to,r];const s=rj.call(n).slice(8,-1);switch(s){case"Array":return[rs,Ua];case"Object":return[Qi,Ua];case"Date":return[wd,Ua];case"RegExp":return[kd,Ua];case"Map":return[Sd,Ua];case"Set":return[Cd,Ua];case"DataView":return[rs,s]}return s.includes("Array")?[rs,s]:s.includes("Error")?[Wp,s]:[Qi,s]},Ri=([n,r])=>n===to&&(r==="function"||r==="symbol"),ij=(n,r,s,o)=>{const u=(f,x)=>{const p=o.push(f)-1;return s.set(x,p),p},d=f=>{if(s.has(f))return s.get(f);let[x,p]=Ir(f);switch(x){case to:{let y=f;switch(p){case"bigint":x=eg,y=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return u([Pp],f)}return u([x,y],f)}case rs:{if(p){let v=f;return p==="DataView"?v=new Uint8Array(f.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(f)),u([p,[...v]],f)}const y=[],g=u([x,y],f);for(const v of f)y.push(d(v));return g}case Qi:{if(p)switch(p){case"BigInt":return u([p,f.toString()],f);case"Boolean":case"Number":case"String":return u([p,f.valueOf()],f)}if(r&&"toJSON"in f)return d(f.toJSON());const y=[],g=u([x,y],f);for(const v of sj(f))(n||!Ri(Ir(f[v])))&&y.push([d(v),d(f[v])]);return g}case wd:return u([x,f.toISOString()],f);case kd:{const{source:y,flags:g}=f;return u([x,{source:y,flags:g}],f)}case Sd:{const y=[],g=u([x,y],f);for(const[v,j]of f)(n||!(Ri(Ir(v))||Ri(Ir(j))))&&y.push([d(v),d(j)]);return g}case Cd:{const y=[],g=u([x,y],f);for(const v of f)(n||!Ri(Ir(v)))&&y.push(d(v));return g}}const{message:h}=f;return u([x,{name:p,message:h}],f)};return d},vx=(n,{json:r,lossy:s}={})=>{const o=[];return ij(!(r||s),!!r,new Map,o)(n),o},Xi=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?bx(vx(n,r)):structuredClone(n):(n,r)=>bx(vx(n,r));function oj(n,r){const s=[{type:"text",value:"↩"}];return r>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),s}function cj(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function uj(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",s=n.options.footnoteBackContent||oj,o=n.options.footnoteBackLabel||cj,u=n.options.footnoteLabel||"Footnotes",d=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},x=[];let p=-1;for(;++p<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[p]);if(!h)continue;const y=n.all(h),g=String(h.identifier).toUpperCase(),v=Ia(g.toLowerCase());let j=0;const k=[],R=n.footnoteCounts.get(g);for(;R!==void 0&&++j<=R;){k.length>0&&k.push({type:"text",value:" "});let V=typeof s=="string"?s:s(p,j);typeof V=="string"&&(V={type:"text",value:V}),k.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+v+(j>1?"-"+j:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(p,j),className:["data-footnote-backref"]},children:Array.isArray(V)?V:[V]})}const S=y[y.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const V=S.children[S.children.length-1];V&&V.type==="text"?V.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...k)}else y.push(...k);const T={type:"element",tagName:"li",properties:{id:r+"fn-"+v},children:n.wrap(y,!0)};n.patch(h,T),x.push(T)}if(x.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:d,properties:{...Xi(f),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:n.wrap(x,!0)},{type:"text",value:`
`}]}}const no=(function(n){if(n==null)return hj;if(typeof n=="function")return lo(n);if(typeof n=="object")return Array.isArray(n)?dj(n):fj(n);if(typeof n=="string")return mj(n);throw new Error("Expected function, string, or object as test")});function dj(n){const r=[];let s=-1;for(;++s<n.length;)r[s]=no(n[s]);return lo(o);function o(...u){let d=-1;for(;++d<r.length;)if(r[d].apply(this,u))return!0;return!1}}function fj(n){const r=n;return lo(s);function s(o){const u=o;let d;for(d in n)if(u[d]!==r[d])return!1;return!0}}function mj(n){return lo(r);function r(s){return s&&s.type===n}}function lo(n){return r;function r(s,o,u){return!!(xj(s)&&n.call(this,s,typeof o=="number"?o:void 0,u||void 0))}}function hj(){return!0}function xj(n){return n!==null&&typeof n=="object"&&"type"in n}const tg=[],pj=!0,td=!1,gj="skip";function ng(n,r,s,o){let u;typeof r=="function"&&typeof s!="function"?(o=s,s=r):u=r;const d=no(u),f=o?-1:1;x(n,void 0,[])();function x(p,h,y){const g=p&&typeof p=="object"?p:{};if(typeof g.type=="string"){const j=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(p.type+(j?"<"+j+">":""))+")"})}return v;function v(){let j=tg,k,R,S;if((!r||d(p,h,y[y.length-1]||void 0))&&(j=yj(s(p,y)),j[0]===td))return j;if("children"in p&&p.children){const T=p;if(T.children&&j[0]!==gj)for(R=(o?T.children.length:-1)+f,S=y.concat(T);R>-1&&R<T.children.length;){const V=T.children[R];if(k=x(V,R,S)(),k[0]===td)return k;R=typeof k[1]=="number"?k[1]:R+f}}return j}}}function yj(n){return Array.isArray(n)?n:typeof n=="number"?[pj,n]:n==null?tg:[n]}function _d(n,r,s,o){let u,d,f;typeof r=="function"&&typeof s!="function"?(d=void 0,f=r,u=s):(d=r,f=s,u=o),ng(n,d,x,u);function x(p,h){const y=h[h.length-1],g=y?y.children.indexOf(p):void 0;return f(p,g,y)}}const nd={}.hasOwnProperty,bj={};function vj(n,r){const s=r||bj,o=new Map,u=new Map,d=new Map,f={...lj,...s.handlers},x={all:h,applyData:Nj,definitionById:o,footnoteById:u,footnoteCounts:d,footnoteOrder:[],handlers:f,one:p,options:s,patch:jj,wrap:kj};return _d(n,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?o:u,v=String(y.identifier).toUpperCase();g.has(v)||g.set(v,y)}}),x;function p(y,g){const v=y.type,j=x.handlers[v];if(nd.call(x.handlers,v)&&j)return j(x,y,g);if(x.options.passThrough&&x.options.passThrough.includes(v)){if("children"in y){const{children:R,...S}=y,T=Xi(S);return T.children=x.all(y),T}return Xi(y)}return(x.options.unknownHandler||wj)(x,y,g)}function h(y){const g=[];if("children"in y){const v=y.children;let j=-1;for(;++j<v.length;){const k=x.one(v[j],y);if(k){if(j&&v[j-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=jx(k.value)),!Array.isArray(k)&&k.type==="element")){const R=k.children[0];R&&R.type==="text"&&(R.value=jx(R.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function jj(n,r){n.position&&(r.position=cv(n))}function Nj(n,r){let s=r;if(n&&n.data){const o=n.data.hName,u=n.data.hChildren,d=n.data.hProperties;if(typeof o=="string")if(s.type==="element")s.tagName=o;else{const f="children"in s?s.children:[s];s={type:"element",tagName:o,properties:{},children:f}}s.type==="element"&&d&&Object.assign(s.properties,Xi(d)),"children"in s&&s.children&&u!==null&&u!==void 0&&(s.children=u)}return s}function wj(n,r){const s=r.data||{},o="value"in r&&!(nd.call(s,"hProperties")||nd.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:n.all(r)};return n.patch(r,o),n.applyData(r,o)}function kj(n,r){const s=[];let o=-1;for(r&&s.push({type:"text",value:`
`});++o<n.length;)o&&s.push({type:"text",value:`
`}),s.push(n[o]);return r&&n.length>0&&s.push({type:"text",value:`
`}),s}function jx(n){let r=0,s=n.charCodeAt(r);for(;s===9||s===32;)r++,s=n.charCodeAt(r);return n.slice(r)}function Nx(n,r){const s=vj(n,r),o=s.one(n,void 0),u=uj(s),d=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return u&&d.children.push({type:"text",value:`
`},u),d}function Sj(n,r){return n&&"run"in n?async function(s,o){const u=Nx(s,{file:o,...r});await n.run(u,o)}:function(s,o){return Nx(s,{file:o,...n||r})}}function wx(n){if(n)throw n}var Mu,kx;function Cj(){if(kx)return Mu;kx=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,u=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},d=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var y=n.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!g)return!1;var v;for(v in h);return typeof v>"u"||n.call(h,v)},f=function(h,y){s&&y.name==="__proto__"?s(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},x=function(h,y){if(y==="__proto__")if(n.call(h,y)){if(o)return o(h,y).value}else return;return h[y]};return Mu=function p(){var h,y,g,v,j,k,R=arguments[0],S=1,T=arguments.length,V=!1;for(typeof R=="boolean"&&(V=R,R=arguments[1]||{},S=2),(R==null||typeof R!="object"&&typeof R!="function")&&(R={});S<T;++S)if(h=arguments[S],h!=null)for(y in h)g=x(R,y),v=x(h,y),R!==v&&(V&&v&&(d(v)||(j=u(v)))?(j?(j=!1,k=g&&u(g)?g:[]):k=g&&d(g)?g:{},f(R,{name:y,newValue:p(V,k,v)})):typeof v<"u"&&f(R,{name:y,newValue:v}));return R},Mu}var _j=Cj();const zu=Zi(_j);function ld(n){if(typeof n!="object"||n===null)return!1;const r=Object.getPrototypeOf(n);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function Tj(){const n=[],r={run:s,use:o};return r;function s(...u){let d=-1;const f=u.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);x(null,...u);function x(p,...h){const y=n[++d];let g=-1;if(p){f(p);return}for(;++g<u.length;)(h[g]===null||h[g]===void 0)&&(h[g]=u[g]);u=h,y?Ej(y,x)(...h):f(null,...h)}}function o(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return n.push(u),r}}function Ej(n,r){let s;return o;function o(...f){const x=n.length>f.length;let p;x&&f.push(u);try{p=n.apply(this,f)}catch(h){const y=h;if(x&&s)throw y;return u(y)}x||(p&&p.then&&typeof p.then=="function"?p.then(d,u):p instanceof Error?u(p):d(p))}function u(f,...x){s||(s=!0,r(f,...x))}function d(f){u(null,f)}}const pn={basename:Aj,dirname:Mj,extname:zj,join:Oj,sep:"/"};function Aj(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');ms(n);let s=0,o=-1,u=n.length,d;if(r===void 0||r.length===0||r.length>n.length){for(;u--;)if(n.codePointAt(u)===47){if(d){s=u+1;break}}else o<0&&(d=!0,o=u+1);return o<0?"":n.slice(s,o)}if(r===n)return"";let f=-1,x=r.length-1;for(;u--;)if(n.codePointAt(u)===47){if(d){s=u+1;break}}else f<0&&(d=!0,f=u+1),x>-1&&(n.codePointAt(u)===r.codePointAt(x--)?x<0&&(o=u):(x=-1,o=f));return s===o?o=f:o<0&&(o=n.length),n.slice(s,o)}function Mj(n){if(ms(n),n.length===0)return".";let r=-1,s=n.length,o;for(;--s;)if(n.codePointAt(s)===47){if(o){r=s;break}}else o||(o=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function zj(n){ms(n);let r=n.length,s=-1,o=0,u=-1,d=0,f;for(;r--;){const x=n.codePointAt(r);if(x===47){if(f){o=r+1;break}continue}s<0&&(f=!0,s=r+1),x===46?u<0?u=r:d!==1&&(d=1):u>-1&&(d=-1)}return u<0||s<0||d===0||d===1&&u===s-1&&u===o+1?"":n.slice(u,s)}function Oj(...n){let r=-1,s;for(;++r<n.length;)ms(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":Dj(s)}function Dj(n){ms(n);const r=n.codePointAt(0)===47;let s=Rj(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function Rj(n,r){let s="",o=0,u=-1,d=0,f=-1,x,p;for(;++f<=n.length;){if(f<n.length)x=n.codePointAt(f);else{if(x===47)break;x=47}if(x===47){if(!(u===f-1||d===1))if(u!==f-1&&d===2){if(s.length<2||o!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(p=s.lastIndexOf("/"),p!==s.length-1){p<0?(s="",o=0):(s=s.slice(0,p),o=s.length-1-s.lastIndexOf("/")),u=f,d=0;continue}}else if(s.length>0){s="",o=0,u=f,d=0;continue}}r&&(s=s.length>0?s+"/..":"..",o=2)}else s.length>0?s+="/"+n.slice(u+1,f):s=n.slice(u+1,f),o=f-u-1;u=f,d=0}else x===46&&d>-1?d++:d=-1}return s}function ms(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const Lj={cwd:Uj};function Uj(){return"/"}function ad(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function Hj(n){if(typeof n=="string")n=new URL(n);else if(!ad(n)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(n.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return Bj(n)}function Bj(n){if(n.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const o=r.codePointAt(s+2);if(o===70||o===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(r)}const Ou=["history","path","basename","stem","extname","dirname"];class lg{constructor(r){let s;r?ad(r)?s={path:r}:typeof r=="string"||qj(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":Lj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<Ou.length;){const d=Ou[o];d in s&&s[d]!==void 0&&s[d]!==null&&(this[d]=d==="history"?[...s[d]]:s[d])}let u;for(u in s)Ou.includes(u)||(this[u]=s[u])}get basename(){return typeof this.path=="string"?pn.basename(this.path):void 0}set basename(r){Ru(r,"basename"),Du(r,"basename"),this.path=pn.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?pn.dirname(this.path):void 0}set dirname(r){Sx(this.basename,"dirname"),this.path=pn.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?pn.extname(this.path):void 0}set extname(r){if(Du(r,"extname"),Sx(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pn.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){ad(r)&&(r=Hj(r)),Ru(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?pn.basename(this.path,this.extname):void 0}set stem(r){Ru(r,"stem"),Du(r,"stem"),this.path=pn.join(this.dirname||"",r+(this.extname||""))}fail(r,s,o){const u=this.message(r,s,o);throw u.fatal=!0,u}info(r,s,o){const u=this.message(r,s,o);return u.fatal=void 0,u}message(r,s,o){const u=new vt(r,s,o);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function Du(n,r){if(n&&n.includes(pn.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+pn.sep+"`")}function Ru(n,r){if(!n)throw new Error("`"+r+"` cannot be empty")}function Sx(n,r){if(!n)throw new Error("Setting `"+r+"` requires `path` to be set too")}function qj(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Yj=(function(n){const o=this.constructor.prototype,u=o[n],d=function(){return u.apply(d,arguments)};return Object.setPrototypeOf(d,o),d}),Vj={}.hasOwnProperty;class Td extends Yj{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Tj()}copy(){const r=new Td;let s=-1;for(;++s<this.attachers.length;){const o=this.attachers[s];r.use(...o)}return r.data(zu(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(Hu("data",this.frozen),this.namespace[r]=s,this):Vj.call(this.namespace,r)&&this.namespace[r]||void 0:r?(Hu("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const u=s.call(r,...o);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=Li(r),o=this.parser||this.Parser;return Lu("parse",o),o(String(s),s)}process(r,s){const o=this;return this.freeze(),Lu("process",this.parser||this.Parser),Uu("process",this.compiler||this.Compiler),s?u(void 0,s):new Promise(u);function u(d,f){const x=Li(r),p=o.parse(x);o.run(p,x,function(y,g,v){if(y||!g||!v)return h(y);const j=g,k=o.stringify(j,v);Qj(k)?v.value=k:v.result=k,h(y,v)});function h(y,g){y||!g?f(y):d?d(g):s(void 0,g)}}}processSync(r){let s=!1,o;return this.freeze(),Lu("processSync",this.parser||this.Parser),Uu("processSync",this.compiler||this.Compiler),this.process(r,u),_x("processSync","process",s),o;function u(d,f){s=!0,wx(d),o=f}}run(r,s,o){Cx(r),this.freeze();const u=this.transformers;return!o&&typeof s=="function"&&(o=s,s=void 0),o?d(void 0,o):new Promise(d);function d(f,x){const p=Li(s);u.run(r,p,h);function h(y,g,v){const j=g||r;y?x(y):f?f(j):o(void 0,j,v)}}}runSync(r,s){let o=!1,u;return this.run(r,s,d),_x("runSync","run",o),u;function d(f,x){wx(f),u=x,o=!0}}stringify(r,s){this.freeze();const o=Li(s),u=this.compiler||this.Compiler;return Uu("stringify",u),Cx(r),u(r,o)}use(r,...s){const o=this.attachers,u=this.namespace;if(Hu("use",this.frozen),r!=null)if(typeof r=="function")p(r,s);else if(typeof r=="object")Array.isArray(r)?x(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function d(h){if(typeof h=="function")p(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...g]=h;p(y,g)}else f(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function f(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");x(h.plugins),h.settings&&(u.settings=zu(!0,u.settings,h.settings))}function x(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const g=h[y];d(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function p(h,y){let g=-1,v=-1;for(;++g<o.length;)if(o[g][0]===h){v=g;break}if(v===-1)o.push([h,...y]);else if(y.length>0){let[j,...k]=y;const R=o[v][1];ld(R)&&ld(j)&&(j=zu(!0,R,j)),o[v]=[h,j,...k]}}}}const Gj=new Td().freeze();function Lu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Uu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function Hu(n,r){if(r)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Cx(n){if(!ld(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function _x(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function Li(n){return $j(n)?n:new lg(n)}function $j(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function Qj(n){return typeof n=="string"||Xj(n)}function Xj(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Fj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Tx=[],Ex={allowDangerousHtml:!0},Zj=/^(https?|ircs?|mailto|xmpp)$/i,Kj=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ij(n){const r=Jj(n),s=Pj(n);return Wj(r.runSync(r.parse(s),s),n)}function Jj(n){const r=n.rehypePlugins||Tx,s=n.remarkPlugins||Tx,o=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Ex}:Ex;return Gj().use(M5).use(s).use(Sj,o).use(r)}function Pj(n){const r=n.children||"",s=new lg;return typeof r=="string"&&(s.value=r),s}function Wj(n,r){const s=r.allowedElements,o=r.allowElement,u=r.components,d=r.disallowedElements,f=r.skipHtml,x=r.unwrapDisallowed,p=r.urlTransform||eN;for(const y of Kj)Object.hasOwn(r,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+Fj+y.id,void 0);return _d(n,h),hv(n,{Fragment:a.Fragment,components:u,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function h(y,g,v){if(y.type==="raw"&&v&&typeof g=="number")return f?v.children.splice(g,1):v.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let j;for(j in Tu)if(Object.hasOwn(Tu,j)&&Object.hasOwn(y.properties,j)){const k=y.properties[j],R=Tu[j];(R===null||R.includes(y.tagName))&&(y.properties[j]=p(String(k||""),j,y))}}if(y.type==="element"){let j=s?!s.includes(y.tagName):d?d.includes(y.tagName):!1;if(!j&&o&&typeof g=="number"&&(j=!o(y,g,v)),j&&v&&typeof g=="number")return x&&y.children?v.children.splice(g,1,...y.children):v.children.splice(g,1),g}}}function eN(n){const r=n.indexOf(":"),s=n.indexOf("?"),o=n.indexOf("#"),u=n.indexOf("/");return r===-1||u!==-1&&r>u||s!==-1&&r>s||o!==-1&&r>o||Zj.test(n.slice(0,r))?n:""}function Ax(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let o=0,u=s.indexOf(r);for(;u!==-1;)o++,u=s.indexOf(r,u+r.length);return o}function tN(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function nN(n,r,s){const u=no((s||{}).ignore||[]),d=lN(r);let f=-1;for(;++f<d.length;)ng(n,"text",x);function x(h,y){let g=-1,v;for(;++g<y.length;){const j=y[g],k=v?v.children:void 0;if(u(j,k?k.indexOf(j):void 0,v))return;v=j}if(v)return p(h,y)}function p(h,y){const g=y[y.length-1],v=d[f][0],j=d[f][1];let k=0;const S=g.children.indexOf(h);let T=!1,V=[];v.lastIndex=0;let H=v.exec(h.value);for(;H;){const I=H.index,z={index:H.index,input:H.input,stack:[...y,h]};let U=j(...H,z);if(typeof U=="string"&&(U=U.length>0?{type:"text",value:U}:void 0),U===!1?v.lastIndex=I+1:(k!==I&&V.push({type:"text",value:h.value.slice(k,I)}),Array.isArray(U)?V.push(...U):U&&V.push(U),k=I+H[0].length,T=!0),!v.global)break;H=v.exec(h.value)}return T?(k<h.value.length&&V.push({type:"text",value:h.value.slice(k)}),g.children.splice(S,1,...V)):V=[h],S+V.length}}function lN(n){const r=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const s=!n[0]||Array.isArray(n[0])?n:[n];let o=-1;for(;++o<s.length;){const u=s[o];r.push([aN(u[0]),rN(u[1])])}return r}function aN(n){return typeof n=="string"?new RegExp(tN(n),"g"):n}function rN(n){return typeof n=="function"?n:function(){return n}}const Bu="phrasing",qu=["autolink","link","image","label"];function sN(){return{transforms:[mN],enter:{literalAutolink:oN,literalAutolinkEmail:Yu,literalAutolinkHttp:Yu,literalAutolinkWww:Yu},exit:{literalAutolink:fN,literalAutolinkEmail:dN,literalAutolinkHttp:cN,literalAutolinkWww:uN}}}function iN(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Bu,notInConstruct:qu},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Bu,notInConstruct:qu},{character:":",before:"[ps]",after:"\\/",inConstruct:Bu,notInConstruct:qu}]}}function oN(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function Yu(n){this.config.enter.autolinkProtocol.call(this,n)}function cN(n){this.config.exit.autolinkProtocol.call(this,n)}function uN(n){this.config.exit.data.call(this,n);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(n)}function dN(n){this.config.exit.autolinkEmail.call(this,n)}function fN(n){this.exit(n)}function mN(n){nN(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,hN],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),xN]],{ignore:["link","linkReference"]})}function hN(n,r,s,o,u){let d="";if(!ag(u)||(/^w/i.test(r)&&(s=r+s,r="",d="http://"),!pN(s)))return!1;const f=gN(s+o);if(!f[0])return!1;const x={type:"link",title:null,url:d+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[x,{type:"text",value:f[1]}]:x}function xN(n,r,s,o){return!ag(o,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function pN(n){const r=n.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function gN(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],o=s.indexOf(")");const u=Ax(n,"(");let d=Ax(n,")");for(;o!==-1&&u>d;)n+=s.slice(0,o+1),s=s.slice(o+1),o=s.indexOf(")"),d++;return[n,s]}function ag(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||Gl(s)||Wi(s))&&(!r||s!==47)}rg.peek=CN;function yN(){this.buffer()}function bN(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function vN(){this.buffer()}function jN(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function NN(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=dn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function wN(n){this.exit(n)}function kN(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=dn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function SN(n){this.exit(n)}function CN(){return"["}function rg(n,r,s,o){const u=s.createTracker(o);let d=u.move("[^");const f=s.enter("footnoteReference"),x=s.enter("reference");return d+=u.move(s.safe(s.associationId(n),{after:"]",before:d})),x(),f(),d+=u.move("]"),d}function _N(){return{enter:{gfmFootnoteCallString:yN,gfmFootnoteCall:bN,gfmFootnoteDefinitionLabelString:vN,gfmFootnoteDefinition:jN},exit:{gfmFootnoteCallString:NN,gfmFootnoteCall:wN,gfmFootnoteDefinitionLabelString:kN,gfmFootnoteDefinition:SN}}}function TN(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:rg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(o,u,d,f){const x=d.createTracker(f);let p=x.move("[^");const h=d.enter("footnoteDefinition"),y=d.enter("label");return p+=x.move(d.safe(d.associationId(o),{before:p,after:"]"})),y(),p+=x.move("]:"),o.children&&o.children.length>0&&(x.shift(4),p+=x.move((r?`
`:" ")+d.indentLines(d.containerFlow(o,x.current()),r?sg:EN))),h(),p}}function EN(n,r,s){return r===0?n:sg(n,r,s)}function sg(n,r,s){return(s?"":"    ")+n}const AN=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ig.peek=RN;function MN(){return{canContainEols:["delete"],enter:{strikethrough:ON},exit:{strikethrough:DN}}}function zN(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:AN}],handlers:{delete:ig}}}function ON(n){this.enter({type:"delete",children:[]},n)}function DN(n){this.exit(n)}function ig(n,r,s,o){const u=s.createTracker(o),d=s.enter("strikethrough");let f=u.move("~~");return f+=s.containerPhrasing(n,{...u.current(),before:f,after:"~"}),f+=u.move("~~"),d(),f}function RN(){return"~"}function LN(n){return n.length}function UN(n,r){const s=r||{},o=(s.align||[]).concat(),u=s.stringLength||LN,d=[],f=[],x=[],p=[];let h=0,y=-1;for(;++y<n.length;){const R=[],S=[];let T=-1;for(n[y].length>h&&(h=n[y].length);++T<n[y].length;){const V=HN(n[y][T]);if(s.alignDelimiters!==!1){const H=u(V);S[T]=H,(p[T]===void 0||H>p[T])&&(p[T]=H)}R.push(V)}f[y]=R,x[y]=S}let g=-1;if(typeof o=="object"&&"length"in o)for(;++g<h;)d[g]=Mx(o[g]);else{const R=Mx(o);for(;++g<h;)d[g]=R}g=-1;const v=[],j=[];for(;++g<h;){const R=d[g];let S="",T="";R===99?(S=":",T=":"):R===108?S=":":R===114&&(T=":");let V=s.alignDelimiters===!1?1:Math.max(1,p[g]-S.length-T.length);const H=S+"-".repeat(V)+T;s.alignDelimiters!==!1&&(V=S.length+V+T.length,V>p[g]&&(p[g]=V),j[g]=V),v[g]=H}f.splice(1,0,v),x.splice(1,0,j),y=-1;const k=[];for(;++y<f.length;){const R=f[y],S=x[y];g=-1;const T=[];for(;++g<h;){const V=R[g]||"";let H="",I="";if(s.alignDelimiters!==!1){const z=p[g]-(S[g]||0),U=d[g];U===114?H=" ".repeat(z):U===99?z%2?(H=" ".repeat(z/2+.5),I=" ".repeat(z/2-.5)):(H=" ".repeat(z/2),I=H):I=" ".repeat(z)}s.delimiterStart!==!1&&!g&&T.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&V==="")&&(s.delimiterStart!==!1||g)&&T.push(" "),s.alignDelimiters!==!1&&T.push(H),T.push(V),s.alignDelimiters!==!1&&T.push(I),s.padding!==!1&&T.push(" "),(s.delimiterEnd!==!1||g!==h-1)&&T.push("|")}k.push(s.delimiterEnd===!1?T.join("").replace(/ +$/,""):T.join(""))}return k.join(`
`)}function HN(n){return n==null?"":String(n)}function Mx(n){const r=typeof n=="string"?n.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function BN(n,r,s,o){const u=s.enter("blockquote"),d=s.createTracker(o);d.move("> "),d.shift(2);const f=s.indentLines(s.containerFlow(n,d.current()),qN);return u(),f}function qN(n,r,s){return">"+(s?"":" ")+n}function YN(n,r){return zx(n,r.inConstruct,!0)&&!zx(n,r.notInConstruct,!1)}function zx(n,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let o=-1;for(;++o<r.length;)if(n.includes(r[o]))return!0;return!1}function Ox(n,r,s,o){let u=-1;for(;++u<s.unsafe.length;)if(s.unsafe[u].character===`
`&&YN(s.stack,s.unsafe[u]))return/[ \t]/.test(o.before)?"":" ";return`\\
`}function VN(n,r){const s=String(n);let o=s.indexOf(r),u=o,d=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;o!==-1;)o===u?++d>f&&(f=d):d=1,u=o+r.length,o=s.indexOf(r,u);return f}function GN(n,r){return!!(r.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function $N(n){const r=n.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function QN(n,r,s,o){const u=$N(s),d=n.value||"",f=u==="`"?"GraveAccent":"Tilde";if(GN(n,s)){const g=s.enter("codeIndented"),v=s.indentLines(d,XN);return g(),v}const x=s.createTracker(o),p=u.repeat(Math.max(VN(d,u)+1,3)),h=s.enter("codeFenced");let y=x.move(p);if(n.lang){const g=s.enter(`codeFencedLang${f}`);y+=x.move(s.safe(n.lang,{before:y,after:" ",encode:["`"],...x.current()})),g()}if(n.lang&&n.meta){const g=s.enter(`codeFencedMeta${f}`);y+=x.move(" "),y+=x.move(s.safe(n.meta,{before:y,after:`
`,encode:["`"],...x.current()})),g()}return y+=x.move(`
`),d&&(y+=x.move(d+`
`)),y+=x.move(p),h(),y}function XN(n,r,s){return(s?"":"    ")+n}function Ed(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function FN(n,r,s,o){const u=Ed(s),d=u==='"'?"Quote":"Apostrophe",f=s.enter("definition");let x=s.enter("label");const p=s.createTracker(o);let h=p.move("[");return h+=p.move(s.safe(s.associationId(n),{before:h,after:"]",...p.current()})),h+=p.move("]: "),x(),!n.url||/[\0- \u007F]/.test(n.url)?(x=s.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(s.safe(n.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(x=s.enter("destinationRaw"),h+=p.move(s.safe(n.url,{before:h,after:n.title?" ":`
`,...p.current()}))),x(),n.title&&(x=s.enter(`title${d}`),h+=p.move(" "+u),h+=p.move(s.safe(n.title,{before:h,after:u,...p.current()})),h+=p.move(u),x()),f(),h}function ZN(n){const r=n.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function us(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Fi(n,r,s){const o=Xa(n),u=Xa(r);return o===void 0?u===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===1?u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}og.peek=KN;function og(n,r,s,o){const u=ZN(s),d=s.enter("emphasis"),f=s.createTracker(o),x=f.move(u);let p=f.move(s.containerPhrasing(n,{after:u,before:x,...f.current()}));const h=p.charCodeAt(0),y=Fi(o.before.charCodeAt(o.before.length-1),h,u);y.inside&&(p=us(h)+p.slice(1));const g=p.charCodeAt(p.length-1),v=Fi(o.after.charCodeAt(0),g,u);v.inside&&(p=p.slice(0,-1)+us(g));const j=f.move(u);return d(),s.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},x+p+j}function KN(n,r,s){return s.options.emphasis||"*"}function IN(n,r){let s=!1;return _d(n,function(o){if("value"in o&&/\r?\n|\r/.test(o.value)||o.type==="break")return s=!0,td}),!!((!n.depth||n.depth<3)&&vd(n)&&(r.options.setext||s))}function JN(n,r,s,o){const u=Math.max(Math.min(6,n.depth||1),1),d=s.createTracker(o);if(IN(n,s)){const y=s.enter("headingSetext"),g=s.enter("phrasing"),v=s.containerPhrasing(n,{...d.current(),before:`
`,after:`
`});return g(),y(),v+`
`+(u===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
`))+1))}const f="#".repeat(u),x=s.enter("headingAtx"),p=s.enter("phrasing");d.move(f+" ");let h=s.containerPhrasing(n,{before:"# ",after:`
`,...d.current()});return/^[\t ]/.test(h)&&(h=us(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),p(),x(),h}cg.peek=PN;function cg(n){return n.value||""}function PN(){return"<"}ug.peek=WN;function ug(n,r,s,o){const u=Ed(s),d=u==='"'?"Quote":"Apostrophe",f=s.enter("image");let x=s.enter("label");const p=s.createTracker(o);let h=p.move("![");return h+=p.move(s.safe(n.alt,{before:h,after:"]",...p.current()})),h+=p.move("]("),x(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(x=s.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(s.safe(n.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(x=s.enter("destinationRaw"),h+=p.move(s.safe(n.url,{before:h,after:n.title?" ":")",...p.current()}))),x(),n.title&&(x=s.enter(`title${d}`),h+=p.move(" "+u),h+=p.move(s.safe(n.title,{before:h,after:u,...p.current()})),h+=p.move(u),x()),h+=p.move(")"),f(),h}function WN(){return"!"}dg.peek=e4;function dg(n,r,s,o){const u=n.referenceType,d=s.enter("imageReference");let f=s.enter("label");const x=s.createTracker(o);let p=x.move("![");const h=s.safe(n.alt,{before:p,after:"]",...x.current()});p+=x.move(h+"]["),f();const y=s.stack;s.stack=[],f=s.enter("reference");const g=s.safe(s.associationId(n),{before:p,after:"]",...x.current()});return f(),s.stack=y,d(),u==="full"||!h||h!==g?p+=x.move(g+"]"):u==="shortcut"?p=p.slice(0,-1):p+=x.move("]"),p}function e4(){return"!"}fg.peek=t4;function fg(n,r,s){let o=n.value||"",u="`",d=-1;for(;new RegExp("(^|[^`])"+u+"([^`]|$)").test(o);)u+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++d<s.unsafe.length;){const f=s.unsafe[d],x=s.compilePattern(f);let p;if(f.atBreak)for(;p=x.exec(o);){let h=p.index;o.charCodeAt(h)===10&&o.charCodeAt(h-1)===13&&h--,o=o.slice(0,h)+" "+o.slice(p.index+1)}}return u+o+u}function t4(){return"`"}function mg(n,r){const s=vd(n);return!!(!r.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(s===n.url||"mailto:"+s===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}hg.peek=n4;function hg(n,r,s,o){const u=Ed(s),d=u==='"'?"Quote":"Apostrophe",f=s.createTracker(o);let x,p;if(mg(n,s)){const y=s.stack;s.stack=[],x=s.enter("autolink");let g=f.move("<");return g+=f.move(s.containerPhrasing(n,{before:g,after:">",...f.current()})),g+=f.move(">"),x(),s.stack=y,g}x=s.enter("link"),p=s.enter("label");let h=f.move("[");return h+=f.move(s.containerPhrasing(n,{before:h,after:"](",...f.current()})),h+=f.move("]("),p(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(p=s.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(s.safe(n.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(p=s.enter("destinationRaw"),h+=f.move(s.safe(n.url,{before:h,after:n.title?" ":")",...f.current()}))),p(),n.title&&(p=s.enter(`title${d}`),h+=f.move(" "+u),h+=f.move(s.safe(n.title,{before:h,after:u,...f.current()})),h+=f.move(u),p()),h+=f.move(")"),x(),h}function n4(n,r,s){return mg(n,s)?"<":"["}xg.peek=l4;function xg(n,r,s,o){const u=n.referenceType,d=s.enter("linkReference");let f=s.enter("label");const x=s.createTracker(o);let p=x.move("[");const h=s.containerPhrasing(n,{before:p,after:"]",...x.current()});p+=x.move(h+"]["),f();const y=s.stack;s.stack=[],f=s.enter("reference");const g=s.safe(s.associationId(n),{before:p,after:"]",...x.current()});return f(),s.stack=y,d(),u==="full"||!h||h!==g?p+=x.move(g+"]"):u==="shortcut"?p=p.slice(0,-1):p+=x.move("]"),p}function l4(){return"["}function Ad(n){const r=n.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function a4(n){const r=Ad(n),s=n.options.bulletOther;if(!s)return r==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+s+"`) to be different");return s}function r4(n){const r=n.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function pg(n){const r=n.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function s4(n,r,s,o){const u=s.enter("list"),d=s.bulletCurrent;let f=n.ordered?r4(s):Ad(s);const x=n.ordered?f==="."?")":".":a4(s);let p=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!n.ordered){const y=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(p=!0),pg(s)===f&&y){let g=-1;for(;++g<n.children.length;){const v=n.children[g];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(f=x),s.bulletCurrent=f;const h=s.containerFlow(n,o);return s.bulletLastUsed=f,s.bulletCurrent=d,u(),h}function i4(n){const r=n.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function o4(n,r,s,o){const u=i4(s);let d=s.bulletCurrent||Ad(s);r&&r.type==="list"&&r.ordered&&(d=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(n))+d);let f=d.length+1;(u==="tab"||u==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const x=s.createTracker(o);x.move(d+" ".repeat(f-d.length)),x.shift(f);const p=s.enter("listItem"),h=s.indentLines(s.containerFlow(n,x.current()),y);return p(),h;function y(g,v,j){return v?(j?"":" ".repeat(f))+g:(j?d:d+" ".repeat(f-d.length))+g}}function c4(n,r,s,o){const u=s.enter("paragraph"),d=s.enter("phrasing"),f=s.containerPhrasing(n,o);return d(),u(),f}const u4=no(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function d4(n,r,s,o){return(n.children.some(function(f){return u4(f)})?s.containerPhrasing:s.containerFlow).call(s,n,o)}function f4(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}gg.peek=m4;function gg(n,r,s,o){const u=f4(s),d=s.enter("strong"),f=s.createTracker(o),x=f.move(u+u);let p=f.move(s.containerPhrasing(n,{after:u,before:x,...f.current()}));const h=p.charCodeAt(0),y=Fi(o.before.charCodeAt(o.before.length-1),h,u);y.inside&&(p=us(h)+p.slice(1));const g=p.charCodeAt(p.length-1),v=Fi(o.after.charCodeAt(0),g,u);v.inside&&(p=p.slice(0,-1)+us(g));const j=f.move(u+u);return d(),s.attentionEncodeSurroundingInfo={after:v.outside,before:y.outside},x+p+j}function m4(n,r,s){return s.options.strong||"*"}function h4(n,r,s,o){return s.safe(n.value,o)}function x4(n){const r=n.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function p4(n,r,s){const o=(pg(s)+(s.options.ruleSpaces?" ":"")).repeat(x4(s));return s.options.ruleSpaces?o.slice(0,-1):o}const yg={blockquote:BN,break:Ox,code:QN,definition:FN,emphasis:og,hardBreak:Ox,heading:JN,html:cg,image:ug,imageReference:dg,inlineCode:fg,link:hg,linkReference:xg,list:s4,listItem:o4,paragraph:c4,root:d4,strong:gg,text:h4,thematicBreak:p4};function g4(){return{enter:{table:y4,tableData:Dx,tableHeader:Dx,tableRow:v4},exit:{codeText:j4,table:b4,tableData:Vu,tableHeader:Vu,tableRow:Vu}}}function y4(n){const r=n._align;this.enter({type:"table",align:r.map(function(s){return s==="none"?null:s}),children:[]},n),this.data.inTable=!0}function b4(n){this.exit(n),this.data.inTable=void 0}function v4(n){this.enter({type:"tableRow",children:[]},n)}function Vu(n){this.exit(n)}function Dx(n){this.enter({type:"tableCell",children:[]},n)}function j4(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,N4));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(n)}function N4(n,r){return r==="|"?r:n}function w4(n){const r=n||{},s=r.tableCellPadding,o=r.tablePipeAlign,u=r.stringLength,d=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:f,tableCell:p,tableRow:x}};function f(j,k,R,S){return h(y(j,R,S),j.align)}function x(j,k,R,S){const T=g(j,R,S),V=h([T]);return V.slice(0,V.indexOf(`
`))}function p(j,k,R,S){const T=R.enter("tableCell"),V=R.enter("phrasing"),H=R.containerPhrasing(j,{...S,before:d,after:d});return V(),T(),H}function h(j,k){return UN(j,{align:k,alignDelimiters:o,padding:s,stringLength:u})}function y(j,k,R){const S=j.children;let T=-1;const V=[],H=k.enter("table");for(;++T<S.length;)V[T]=g(S[T],k,R);return H(),V}function g(j,k,R){const S=j.children;let T=-1;const V=[],H=k.enter("tableRow");for(;++T<S.length;)V[T]=p(S[T],j,k,R);return H(),V}function v(j,k,R){let S=yg.inlineCode(j,k,R);return R.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function k4(){return{exit:{taskListCheckValueChecked:Rx,taskListCheckValueUnchecked:Rx,paragraph:C4}}}function S4(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:_4}}}function Rx(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function C4(n){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const o=s.children[0];if(o&&o.type==="text"){const u=r.children;let d=-1,f;for(;++d<u.length;){const x=u[d];if(x.type==="paragraph"){f=x;break}}f===s&&(o.value=o.value.slice(1),o.value.length===0?s.children.shift():s.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,s.position.start=Object.assign({},o.position.start)))}}this.exit(n)}function _4(n,r,s,o){const u=n.children[0],d=typeof n.checked=="boolean"&&u&&u.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",x=s.createTracker(o);d&&x.move(f);let p=yg.listItem(n,r,s,{...o,...x.current()});return d&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),p;function h(y){return y+f}}function T4(){return[sN(),_N(),MN(),g4(),k4()]}function E4(n){return{extensions:[iN(),TN(n),zN(),w4(n),S4()]}}const A4={tokenize:L4,partial:!0},bg={tokenize:U4,partial:!0},vg={tokenize:H4,partial:!0},jg={tokenize:B4,partial:!0},M4={tokenize:q4,partial:!0},Ng={name:"wwwAutolink",tokenize:D4,previous:kg},wg={name:"protocolAutolink",tokenize:R4,previous:Sg},$n={name:"emailAutolink",tokenize:O4,previous:Cg},jn={};function z4(){return{text:jn}}let Bl=48;for(;Bl<123;)jn[Bl]=$n,Bl++,Bl===58?Bl=65:Bl===91&&(Bl=97);jn[43]=$n;jn[45]=$n;jn[46]=$n;jn[95]=$n;jn[72]=[$n,wg];jn[104]=[$n,wg];jn[87]=[$n,Ng];jn[119]=[$n,Ng];function O4(n,r,s){const o=this;let u,d;return f;function f(g){return!rd(g)||!Cg.call(o,o.previous)||Md(o.events)?s(g):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),x(g))}function x(g){return rd(g)?(n.consume(g),x):g===64?(n.consume(g),p):s(g)}function p(g){return g===46?n.check(M4,y,h)(g):g===45||g===95||bt(g)?(d=!0,n.consume(g),p):y(g)}function h(g){return n.consume(g),u=!0,p}function y(g){return d&&u&&kt(o.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(g)):s(g)}}function D4(n,r,s){const o=this;return u;function u(f){return f!==87&&f!==119||!kg.call(o,o.previous)||Md(o.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(A4,n.attempt(bg,n.attempt(vg,d),s),s)(f))}function d(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function R4(n,r,s){const o=this;let u="",d=!1;return f;function f(g){return(g===72||g===104)&&Sg.call(o,o.previous)&&!Md(o.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),u+=String.fromCodePoint(g),n.consume(g),x):s(g)}function x(g){if(kt(g)&&u.length<5)return u+=String.fromCodePoint(g),n.consume(g),x;if(g===58){const v=u.toLowerCase();if(v==="http"||v==="https")return n.consume(g),p}return s(g)}function p(g){return g===47?(n.consume(g),d?h:(d=!0,p)):s(g)}function h(g){return g===null||$i(g)||Ze(g)||Gl(g)||Wi(g)?s(g):n.attempt(bg,n.attempt(vg,y),s)(g)}function y(g){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(g)}}function L4(n,r,s){let o=0;return u;function u(f){return(f===87||f===119)&&o<3?(o++,n.consume(f),u):f===46&&o===3?(n.consume(f),d):s(f)}function d(f){return f===null?s(f):r(f)}}function U4(n,r,s){let o,u,d;return f;function f(h){return h===46||h===95?n.check(jg,p,x)(h):h===null||Ze(h)||Gl(h)||h!==45&&Wi(h)?p(h):(d=!0,n.consume(h),f)}function x(h){return h===95?o=!0:(u=o,o=void 0),n.consume(h),f}function p(h){return u||o||!d?s(h):r(h)}}function H4(n,r){let s=0,o=0;return u;function u(f){return f===40?(s++,n.consume(f),u):f===41&&o<s?d(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(jg,r,d)(f):f===null||Ze(f)||Gl(f)?r(f):(n.consume(f),u)}function d(f){return f===41&&o++,n.consume(f),u}}function B4(n,r,s){return o;function o(x){return x===33||x===34||x===39||x===41||x===42||x===44||x===46||x===58||x===59||x===63||x===95||x===126?(n.consume(x),o):x===38?(n.consume(x),d):x===93?(n.consume(x),u):x===60||x===null||Ze(x)||Gl(x)?r(x):s(x)}function u(x){return x===null||x===40||x===91||Ze(x)||Gl(x)?r(x):o(x)}function d(x){return kt(x)?f(x):s(x)}function f(x){return x===59?(n.consume(x),o):kt(x)?(n.consume(x),f):s(x)}}function q4(n,r,s){return o;function o(d){return n.consume(d),u}function u(d){return bt(d)?s(d):r(d)}}function kg(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||Ze(n)}function Sg(n){return!kt(n)}function Cg(n){return!(n===47||rd(n))}function rd(n){return n===43||n===45||n===46||n===95||bt(n)}function Md(n){let r=n.length,s=!1;for(;r--;){const o=n[r][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){s=!0;break}if(o._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const Y4={tokenize:K4,partial:!0};function V4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:X4,continuation:{tokenize:F4},exit:Z4}},text:{91:{name:"gfmFootnoteCall",tokenize:Q4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:G4,resolveTo:$4}}}}function G4(n,r,s){const o=this;let u=o.events.length;const d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let f;for(;u--;){const p=o.events[u][1];if(p.type==="labelImage"){f=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return x;function x(p){if(!f||!f._balanced)return s(p);const h=dn(o.sliceSerialize({start:f.end,end:o.now()}));return h.codePointAt(0)!==94||!d.includes(h.slice(1))?s(p):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(p),n.exit("gfmFootnoteCallLabelMarker"),r(p))}}function $4(n,r){let s=n.length;for(;s--;)if(n[s][1].type==="labelImage"&&n[s][0]==="enter"){n[s][1];break}n[s+1][1].type="data",n[s+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},n[s+3][1].start),end:Object.assign({},n[n.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},n[s+3][1].end),end:Object.assign({},n[s+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const d={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},d.start),end:Object.assign({},d.end)},x=[n[s+1],n[s+2],["enter",o,r],n[s+3],n[s+4],["enter",u,r],["exit",u,r],["enter",d,r],["enter",f,r],["exit",f,r],["exit",d,r],n[n.length-2],n[n.length-1],["exit",o,r]];return n.splice(s,n.length-s+1,...x),n}function Q4(n,r,s){const o=this,u=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let d=0,f;return x;function x(g){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?s(g):(n.enter("gfmFootnoteCallMarker"),n.consume(g),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(g){if(d>999||g===93&&!f||g===null||g===91||Ze(g))return s(g);if(g===93){n.exit("chunkString");const v=n.exit("gfmFootnoteCallString");return u.includes(dn(o.sliceSerialize(v)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(g)}return Ze(g)||(f=!0),d++,n.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(n.consume(g),d++,h):h(g)}}function X4(n,r,s){const o=this,u=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let d,f=0,x;return p;function p(k){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",y):s(k)}function y(k){if(f>999||k===93&&!x||k===null||k===91||Ze(k))return s(k);if(k===93){n.exit("chunkString");const R=n.exit("gfmFootnoteDefinitionLabelString");return d=dn(o.sliceSerialize(R)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),v}return Ze(k)||(x=!0),f++,n.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(n.consume(k),f++,y):y(k)}function v(k){return k===58?(n.enter("definitionMarker"),n.consume(k),n.exit("definitionMarker"),u.includes(d)||u.push(d),Oe(n,j,"gfmFootnoteDefinitionWhitespace")):s(k)}function j(k){return r(k)}}function F4(n,r,s){return n.check(fs,r,n.attempt(Y4,r,s))}function Z4(n){n.exit("gfmFootnoteDefinition")}function K4(n,r,s){const o=this;return Oe(n,u,"gfmFootnoteDefinitionIndent",5);function u(d){const f=o.events[o.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(d):s(d)}}function I4(n){let s=(n||{}).singleTilde;const o={name:"strikethrough",tokenize:d,resolveAll:u};return s==null&&(s=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function u(f,x){let p=-1;for(;++p<f.length;)if(f[p][0]==="enter"&&f[p][1].type==="strikethroughSequenceTemporary"&&f[p][1]._close){let h=p;for(;h--;)if(f[h][0]==="exit"&&f[h][1].type==="strikethroughSequenceTemporary"&&f[h][1]._open&&f[p][1].end.offset-f[p][1].start.offset===f[h][1].end.offset-f[h][1].start.offset){f[p][1].type="strikethroughSequence",f[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},f[h][1].start),end:Object.assign({},f[p][1].end)},g={type:"strikethroughText",start:Object.assign({},f[h][1].end),end:Object.assign({},f[p][1].start)},v=[["enter",y,x],["enter",f[h][1],x],["exit",f[h][1],x],["enter",g,x]],j=x.parser.constructs.insideSpan.null;j&&Qt(v,v.length,0,eo(j,f.slice(h+1,p),x)),Qt(v,v.length,0,[["exit",g,x],["enter",f[p][1],x],["exit",f[p][1],x],["exit",y,x]]),Qt(f,h-1,p-h+3,v),p=h+v.length-2;break}}for(p=-1;++p<f.length;)f[p][1].type==="strikethroughSequenceTemporary"&&(f[p][1].type="data");return f}function d(f,x,p){const h=this.previous,y=this.events;let g=0;return v;function v(k){return h===126&&y[y.length-1][1].type!=="characterEscape"?p(k):(f.enter("strikethroughSequenceTemporary"),j(k))}function j(k){const R=Xa(h);if(k===126)return g>1?p(k):(f.consume(k),g++,j);if(g<2&&!s)return p(k);const S=f.exit("strikethroughSequenceTemporary"),T=Xa(k);return S._open=!T||T===2&&!!R,S._close=!R||R===2&&!!T,x(k)}}}class J4{constructor(){this.map=[]}add(r,s,o){P4(this,r,s,o)}consume(r){if(this.map.sort(function(d,f){return d[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const o=[];for(;s>0;)s-=1,o.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];o.push(r.slice()),r.length=0;let u=o.pop();for(;u;){for(const d of u)r.push(d);u=o.pop()}this.map.length=0}}function P4(n,r,s,o){let u=0;if(!(s===0&&o.length===0)){for(;u<n.map.length;){if(n.map[u][0]===r){n.map[u][1]+=s,n.map[u][2].push(...o);return}u+=1}n.map.push([r,s,o])}}function W4(n,r){let s=!1;const o=[];for(;r<n.length;){const u=n[r];if(s){if(u[0]==="enter")u[1].type==="tableContent"&&o.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const d=o.length-1;o[d]=o[d]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return o}function e3(){return{flow:{null:{name:"table",tokenize:t3,resolveAll:n3}}}}function t3(n,r,s){const o=this;let u=0,d=0,f;return x;function x(M){let ne=o.events.length-1;for(;ne>-1;){const Q=o.events[ne][1].type;if(Q==="lineEnding"||Q==="linePrefix")ne--;else break}const re=ne>-1?o.events[ne][1].type:null,Z=re==="tableHead"||re==="tableRow"?U:p;return Z===U&&o.parser.lazy[o.now().line]?s(M):Z(M)}function p(M){return n.enter("tableHead"),n.enter("tableRow"),h(M)}function h(M){return M===124||(f=!0,d+=1),y(M)}function y(M){return M===null?s(M):ye(M)?d>1?(d=0,o.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(M),n.exit("lineEnding"),j):s(M):Te(M)?Oe(n,y,"whitespace")(M):(d+=1,f&&(f=!1,u+=1),M===124?(n.enter("tableCellDivider"),n.consume(M),n.exit("tableCellDivider"),f=!0,y):(n.enter("data"),g(M)))}function g(M){return M===null||M===124||Ze(M)?(n.exit("data"),y(M)):(n.consume(M),M===92?v:g)}function v(M){return M===92||M===124?(n.consume(M),g):g(M)}function j(M){return o.interrupt=!1,o.parser.lazy[o.now().line]?s(M):(n.enter("tableDelimiterRow"),f=!1,Te(M)?Oe(n,k,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):k(M))}function k(M){return M===45||M===58?S(M):M===124?(f=!0,n.enter("tableCellDivider"),n.consume(M),n.exit("tableCellDivider"),R):z(M)}function R(M){return Te(M)?Oe(n,S,"whitespace")(M):S(M)}function S(M){return M===58?(d+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(M),n.exit("tableDelimiterMarker"),T):M===45?(d+=1,T(M)):M===null||ye(M)?I(M):z(M)}function T(M){return M===45?(n.enter("tableDelimiterFiller"),V(M)):z(M)}function V(M){return M===45?(n.consume(M),V):M===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(M),n.exit("tableDelimiterMarker"),H):(n.exit("tableDelimiterFiller"),H(M))}function H(M){return Te(M)?Oe(n,I,"whitespace")(M):I(M)}function I(M){return M===124?k(M):M===null||ye(M)?!f||u!==d?z(M):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(M)):z(M)}function z(M){return s(M)}function U(M){return n.enter("tableRow"),$(M)}function $(M){return M===124?(n.enter("tableCellDivider"),n.consume(M),n.exit("tableCellDivider"),$):M===null||ye(M)?(n.exit("tableRow"),r(M)):Te(M)?Oe(n,$,"whitespace")(M):(n.enter("data"),fe(M))}function fe(M){return M===null||M===124||Ze(M)?(n.exit("data"),$(M)):(n.consume(M),M===92?J:fe)}function J(M){return M===92||M===124?(n.consume(M),fe):fe(M)}}function n3(n,r){let s=-1,o=!0,u=0,d=[0,0,0,0],f=[0,0,0,0],x=!1,p=0,h,y,g;const v=new J4;for(;++s<n.length;){const j=n[s],k=j[1];j[0]==="enter"?k.type==="tableHead"?(x=!1,p!==0&&(Lx(v,r,p,h,y),y=void 0,p=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},v.add(s,0,[["enter",h,r]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(o=!0,g=void 0,d=[0,0,0,0],f=[0,s+1,0,0],x&&(x=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},v.add(s,0,[["enter",y,r]])),u=k.type==="tableDelimiterRow"?2:y?3:1):u&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(o=!1,f[2]===0&&(d[1]!==0&&(f[0]=f[1],g=Ui(v,r,d,u,void 0,g),d=[0,0,0,0]),f[2]=s)):k.type==="tableCellDivider"&&(o?o=!1:(d[1]!==0&&(f[0]=f[1],g=Ui(v,r,d,u,void 0,g)),d=f,f=[d[1],s,0,0])):k.type==="tableHead"?(x=!0,p=s):k.type==="tableRow"||k.type==="tableDelimiterRow"?(p=s,d[1]!==0?(f[0]=f[1],g=Ui(v,r,d,u,s,g)):f[1]!==0&&(g=Ui(v,r,f,u,s,g)),u=0):u&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(f[3]=s)}for(p!==0&&Lx(v,r,p,h,y),v.consume(r.events),s=-1;++s<r.events.length;){const j=r.events[s];j[0]==="enter"&&j[1].type==="table"&&(j[1]._align=W4(r.events,s))}return n}function Ui(n,r,s,o,u,d){const f=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",x="tableContent";s[0]!==0&&(d.end=Object.assign({},Ba(r.events,s[0])),n.add(s[0],0,[["exit",d,r]]));const p=Ba(r.events,s[1]);if(d={type:f,start:Object.assign({},p),end:Object.assign({},p)},n.add(s[1],0,[["enter",d,r]]),s[2]!==0){const h=Ba(r.events,s[2]),y=Ba(r.events,s[3]),g={type:x,start:Object.assign({},h),end:Object.assign({},y)};if(n.add(s[2],0,[["enter",g,r]]),o!==2){const v=r.events[s[2]],j=r.events[s[3]];if(v[1].end=Object.assign({},j[1].end),v[1].type="chunkText",v[1].contentType="text",s[3]>s[2]+1){const k=s[2]+1,R=s[3]-s[2]-1;n.add(k,R,[])}}n.add(s[3]+1,0,[["exit",g,r]])}return u!==void 0&&(d.end=Object.assign({},Ba(r.events,u)),n.add(u,0,[["exit",d,r]]),d=void 0),d}function Lx(n,r,s,o,u){const d=[],f=Ba(r.events,s);u&&(u.end=Object.assign({},f),d.push(["exit",u,r])),o.end=Object.assign({},f),d.push(["exit",o,r]),n.add(s+1,0,d)}function Ba(n,r){const s=n[r],o=s[0]==="enter"?"start":"end";return s[1][o]}const l3={name:"tasklistCheck",tokenize:r3};function a3(){return{text:{91:l3}}}function r3(n,r,s){const o=this;return u;function u(p){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?s(p):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),d)}function d(p){return Ze(p)?(n.enter("taskListCheckValueUnchecked"),n.consume(p),n.exit("taskListCheckValueUnchecked"),f):p===88||p===120?(n.enter("taskListCheckValueChecked"),n.consume(p),n.exit("taskListCheckValueChecked"),f):s(p)}function f(p){return p===93?(n.enter("taskListCheckMarker"),n.consume(p),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),x):s(p)}function x(p){return ye(p)?r(p):Te(p)?n.check({tokenize:s3},r,s)(p):s(p)}}function s3(n,r,s){return Oe(n,o,"whitespace");function o(u){return u===null?s(u):r(u)}}function i3(n){return Up([z4(),V4(),I4(n),e3(),a3()])}const o3={};function c3(n){const r=this,s=n||o3,o=r.data(),u=o.micromarkExtensions||(o.micromarkExtensions=[]),d=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),f=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);u.push(i3(s)),d.push(T4()),f.push(E4(s))}function u3({className:n,children:r}){const[s,o]=D.useState(!1),u=/language-(\w+)/.exec(n||""),d=u?u[1]:"",f=String(r).replace(/\n$/,""),x=()=>{navigator.clipboard.writeText(f),o(!0),setTimeout(()=>o(!1),2e3)};return a.jsxs("div",{className:"my-3 bg-gray-950 rounded-xl overflow-hidden border border-gray-800/80",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-900/80 border-b border-gray-800/50",children:[a.jsx("span",{className:"text-[11px] text-gray-500 font-mono",children:d||"code"}),a.jsx("button",{onClick:x,className:"text-gray-500 hover:text-gray-300 transition-colors",title:"Copy code",children:s?a.jsx(ql,{className:"w-3.5 h-3.5 text-emerald-400"}):a.jsx(Ya,{className:"w-3.5 h-3.5"})})]}),a.jsx("pre",{className:"px-4 py-3 text-[13px] font-mono text-gray-300 overflow-x-auto leading-relaxed",children:a.jsx("code",{children:f})})]})}const d3={h1:({children:n})=>a.jsx("h1",{className:"text-xl font-semibold text-gray-100 mt-5 mb-2 pb-1.5 border-b border-gray-800/50",children:n}),h2:({children:n})=>a.jsx("h2",{className:"text-lg font-semibold text-gray-100 mt-4 mb-2 pb-1 border-b border-gray-800/40",children:n}),h3:({children:n})=>a.jsx("h3",{className:"text-base font-semibold text-gray-100 mt-3 mb-1",children:n}),h4:({children:n})=>a.jsx("h4",{className:"text-sm font-semibold text-gray-200 mt-2.5 mb-1",children:n}),h5:({children:n})=>a.jsx("h5",{className:"text-sm font-medium text-gray-200 mt-2 mb-1",children:n}),h6:({children:n})=>a.jsx("h6",{className:"text-xs font-medium text-gray-300 mt-2 mb-1 uppercase tracking-wide",children:n}),p:({children:n})=>a.jsx("p",{className:"mb-2.5 last:mb-0 leading-relaxed",children:n}),strong:({children:n})=>a.jsx("strong",{className:"font-semibold text-gray-100",children:n}),em:({children:n})=>a.jsx("em",{className:"italic text-gray-300",children:n}),a:({href:n,children:r})=>a.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-plutus-400 hover:text-plutus-300 underline underline-offset-2 decoration-plutus-400/30 hover:decoration-plutus-300/50 transition-colors",children:r}),ul:({children:n})=>a.jsx("ul",{className:"list-disc list-outside ml-5 mb-3 space-y-1",children:n}),ol:({children:n})=>a.jsx("ol",{className:"list-decimal list-outside ml-5 mb-3 space-y-1",children:n}),li:({children:n})=>a.jsx("li",{className:"text-gray-200 leading-relaxed pl-1",children:n}),code:({className:n,children:r,...s})=>(n==null?void 0:n.includes("language-"))||String(r).includes(`
`)?a.jsx(u3,{className:n,children:r}):a.jsx("code",{className:"px-1.5 py-0.5 bg-gray-800/80 border border-gray-700/40 rounded-md text-plutus-300 text-[13px] font-mono",children:r}),pre:({children:n})=>a.jsx(a.Fragment,{children:n}),blockquote:({children:n})=>a.jsx("blockquote",{className:"border-l-2 border-plutus-500/30 pl-4 my-3 text-gray-400 italic",children:n}),hr:()=>a.jsx("hr",{className:"my-4 border-gray-800/50"}),table:({children:n})=>a.jsx("div",{className:"my-3 overflow-x-auto rounded-xl border border-gray-800",children:a.jsx("table",{className:"w-full text-xs",children:n})}),thead:({children:n})=>a.jsx("thead",{className:"bg-gray-900/60",children:n}),tbody:({children:n})=>a.jsx("tbody",{children:n}),tr:({children:n})=>a.jsx("tr",{className:"border-b border-gray-800/50 last:border-0",children:n}),th:({children:n})=>a.jsx("th",{className:"px-3 py-2 text-left font-semibold text-gray-300",children:n}),td:({children:n})=>a.jsx("td",{className:"px-3 py-2 text-gray-400",children:n}),img:({src:n,alt:r})=>a.jsx("img",{src:n,alt:r||"",className:"max-w-full rounded-xl my-3 border border-gray-800"}),input:({checked:n,...r})=>a.jsx("input",{type:"checkbox",checked:n,readOnly:!0,className:"mr-1.5 accent-plutus-500 rounded",...r}),del:({children:n})=>a.jsx("del",{className:"text-gray-500 line-through",children:n})};function Ux({content:n}){return a.jsx("div",{className:"markdown-content",children:a.jsx(Ij,{remarkPlugins:[c3],components:d3,children:n})})}const f3={code_editor:b1,code_analysis:cp,subprocess:$t,tool_creator:vn,shell:rn,filesystem:dd,browser:os,pc:Xl,connector:fd},m3={code_editor:"text-emerald-400 bg-emerald-500/8 border-emerald-500/15",code_analysis:"text-blue-400 bg-blue-500/8 border-blue-500/15",subprocess:"text-violet-400 bg-violet-500/8 border-violet-500/15",tool_creator:"text-pink-400 bg-pink-500/8 border-pink-500/15",shell:"text-amber-400 bg-amber-500/8 border-amber-500/15",filesystem:"text-cyan-400 bg-cyan-500/8 border-cyan-500/15",pc:"text-blue-400 bg-blue-500/8 border-blue-500/15",connector:"text-violet-400 bg-violet-500/8 border-violet-500/15"},Hx={read:"Reading file",write:"Writing file",edit:"Editing file",append:"Appending to file",delete:"Deleting file",move:"Moving file",copy:"Copying file",find:"Finding files",grep:"Searching in files",diff:"Comparing files",list:"Listing directory",mkdir:"Creating directory",analyze:"Analyzing code",find_functions:"Finding functions",find_classes:"Finding classes",find_imports:"Finding imports",complexity:"Checking complexity",summarize:"Summarizing code",call_graph:"Building call graph",find_todos:"Finding TODOs",symbols:"Listing symbols",spawn:"Running subprocess",spawn_many:"Running parallel tasks",create:"Creating tool",validate:"Validating tool",run:"Running tool",open_app:"Opening app",close_app:"Closing app",open_url:"Opening URL",shell_exec:"Running command",list_processes:"Listing processes",system_info:"Getting system info",snapshot:"Reading page elements",click_ref:"Clicking element",type_ref:"Typing into element",select_ref:"Selecting option",check_ref:"Toggling checkbox",hover_ref:"Hovering element",navigate:"Navigating to URL",browser_back:"Going back",browser_forward:"Going forward",browser_refresh:"Refreshing page",new_tab:"Opening new tab",close_tab:"Closing tab",switch_tab:"Switching tab",list_tabs:"Listing tabs",page_content:"Reading page content",scroll_page:"Scrolling page",keyboard_type:"Typing text",keyboard_press:"Pressing key",keyboard_shortcut:"Using shortcut",mouse_click:"Clicking",mouse_move:"Moving mouse",take_screenshot:"Taking screenshot",send:"Sending message",send_file:"Sending file",run_skill:"Running skill",list_skills:"Listing skills",create_skill:"Creating skill",update_skill:"Updating skill",delete_skill:"Deleting skill"};function h3({name:n,args:r}){const[s,o]=D.useState(!1),u=f3[n]||rn,d=m3[n]||"text-gray-400 bg-gray-500/8 border-gray-500/15",[f,x,p]=d.split(" "),h=r.operation,y=r.action,g=h?Hx[h]||h.replace(/_/g," "):y?Hx[y]||y.replace(/_/g," "):n.replace(/_/g," "),v=r.path||r.file_path||r.directory||"",j=r.command||"",k=r.text||r.value||"",R=r.ref,S=r.url||"",T=r.app_name||"",V=r.skill_name||"";let H="";return R!==void 0?(H=`[ref=${R}]`,k&&(H+=` "${k.slice(0,30)}${k.length>30?"...":""}"`)):S?H=S.length>50?S.slice(0,47)+"...":S:T?H=T:V?H=V:v?H=v.length>50?"..."+v.slice(-47):v:j?H=`$ ${j.slice(0,50)}`:k&&(H=k.length>40?`"${k.slice(0,37)}..."`:`"${k}"`),a.jsxs("div",{className:`border rounded-xl overflow-hidden transition-all ${p}`,children:[a.jsxs("button",{onClick:()=>o(!s),className:`w-full flex items-center gap-3 px-3.5 py-2.5 ${x} hover:brightness-110 transition-all`,children:[a.jsx(u,{className:`w-4 h-4 ${f} flex-shrink-0`}),a.jsxs("div",{className:"flex-1 text-left min-w-0",children:[a.jsx("span",{className:`text-xs font-medium ${f}`,children:g}),H&&a.jsx("span",{className:"text-[11px] text-gray-500 ml-2 font-mono truncate",children:H})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Gn,{className:"w-3 h-3 text-gray-600 animate-pulse"}),s?a.jsx(ap,{className:"w-3.5 h-3.5 text-gray-500"}):a.jsx($l,{className:"w-3.5 h-3.5 text-gray-500"})]})]}),s&&a.jsxs("div",{className:"px-3.5 py-3 bg-gray-950/60 border-t border-gray-800/50 animate-fade-in",children:[a.jsx("p",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Parameters"}),a.jsx("div",{className:"space-y-1.5",children:Object.entries(r).map(([I,z])=>a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("span",{className:"text-[11px] text-gray-500 font-mono w-20 flex-shrink-0",children:I}),a.jsx("span",{className:"text-[11px] text-gray-300 font-mono break-all",children:typeof z=="string"?z.length>200?z.slice(0,200)+"...":z:JSON.stringify(z,null,2).slice(0,200)})]},I))})]})]})}function x3({base64:n}){const[r,s]=D.useState(!1);return a.jsxs("div",{className:"bg-gray-950 border border-blue-500/15 rounded-xl overflow-hidden",children:[a.jsxs("button",{onClick:()=>s(!r),className:"w-full flex items-center justify-between px-3.5 py-2 bg-blue-500/8 hover:bg-blue-500/12 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(np,{className:"w-3.5 h-3.5 text-blue-400"}),a.jsx("span",{className:"text-xs font-medium text-blue-400",children:"Screenshot"})]}),r?a.jsx(hp,{className:"w-3.5 h-3.5 text-gray-500"}):a.jsx(fp,{className:"w-3.5 h-3.5 text-gray-500"})]}),a.jsx("div",{className:`transition-all duration-300 ${r?"max-h-[600px]":"max-h-48"} overflow-hidden`,children:a.jsx("img",{src:`data:image/png;base64,${n}`,alt:"Screenshot",className:"w-full h-auto cursor-pointer",onClick:()=>s(!r)})})]})}function p3({base64:n,fileName:r,caption:s}){var x;const[o,u]=D.useState(!1),d=((x=r.split(".").pop())==null?void 0:x.toLowerCase())||"png",f=d==="jpg"||d==="jpeg"?"image/jpeg":d==="gif"?"image/gif":d==="webp"?"image/webp":"image/png";return a.jsxs("div",{className:"bg-gray-950 border border-violet-500/15 rounded-xl overflow-hidden",children:[a.jsxs("button",{onClick:()=>u(!o),className:"w-full flex items-center justify-between px-3.5 py-2 bg-violet-500/8 hover:bg-violet-500/12 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(np,{className:"w-3.5 h-3.5 text-violet-400"}),a.jsx("span",{className:"text-xs font-medium text-violet-400",children:s||r})]}),o?a.jsx(hp,{className:"w-3.5 h-3.5 text-gray-500"}):a.jsx(fp,{className:"w-3.5 h-3.5 text-gray-500"})]}),a.jsx("div",{className:`transition-all duration-300 ${o?"max-h-[600px]":"max-h-48"} overflow-hidden`,children:a.jsx("img",{src:`data:${f};base64,${n}`,alt:s||r,className:"w-full h-auto cursor-pointer",onClick:()=>u(!o)})})]})}function g3({fileName:n,sizeKB:r,filePath:s,caption:o}){const u=parseInt(r)>=1024?`${(parseInt(r)/1024).toFixed(1)} MB`:`${r} KB`,d=`/api/files?path=${encodeURIComponent(s)}`;return a.jsx("div",{className:"bg-gray-950 border border-gray-800 rounded-xl overflow-hidden",children:a.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-lg bg-gray-900 border border-gray-800 flex items-center justify-center flex-shrink-0",children:a.jsx($h,{className:"w-5 h-5 text-gray-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-gray-200 truncate",children:n}),a.jsxs("p",{className:"text-xs text-gray-500",children:[u,o?` — ${o}`:""]})]}),a.jsxs("a",{href:d,download:n,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-gray-800 hover:bg-gray-700 text-gray-300 text-xs font-medium transition-colors border border-gray-700/50",children:[a.jsx($h,{className:"w-3.5 h-3.5"})," Download"]})]})})}function y3({content:n}){const[r,s]=D.useState(!1),[o,u]=D.useState(!1),d=n.split(`
`),f=d.slice(0,15),x=d.length>15,p=y=>{y.stopPropagation(),navigator.clipboard.writeText(n),u(!0),setTimeout(()=>u(!1),2e3)},h=(y,g)=>{var R,S;const v=y.match(/\[ref=(\d+)\]/),j=((S=(R=y.match(/^(\s*)/))==null?void 0:R[1])==null?void 0:S.length)||0;let k="text-gray-400";if(y.includes("button")?k="text-violet-400":y.includes("link")?k="text-blue-400":y.includes("textbox")||y.includes("input")||y.includes("textarea")?k="text-emerald-400":y.includes("heading")?k="text-amber-400":y.includes("img")||y.includes("image")?k="text-pink-400":y.includes("checkbox")||y.includes("radio")?k="text-cyan-400":(y.includes("select")||y.includes("combobox"))&&(k="text-orange-400"),v){const T=v[1],V=y.slice(0,y.indexOf("[ref=")),H=y.slice(y.indexOf("]")+1);return a.jsxs("div",{className:`${k} whitespace-pre hover:bg-white/5 px-1 rounded`,style:{paddingLeft:`${j*8+4}px`},children:[V.trim(),a.jsxs("span",{className:"bg-blue-500/15 text-blue-300 px-1 rounded font-bold text-[10px] mx-1",children:["ref=",T]}),H]},g)}return a.jsx("div",{className:`${k} whitespace-pre px-1`,style:{paddingLeft:`${j*8+4}px`},children:y.trim()},g)};return a.jsxs("div",{className:"bg-gray-950 border border-blue-500/15 rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2 bg-blue-500/8 border-b border-blue-500/10",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-medium text-blue-400",children:"Accessibility Tree"}),a.jsxs("span",{className:"text-[10px] text-gray-500",children:[d.length," elements"]})]}),a.jsx("button",{onClick:p,className:"text-gray-500 hover:text-gray-300 transition-colors",children:o?a.jsx(ql,{className:"w-3 h-3 text-emerald-400"}):a.jsx(Ya,{className:"w-3 h-3"})})]}),a.jsx("div",{className:"py-2 text-xs font-mono overflow-x-auto max-h-80 overflow-y-auto",children:(r?d:f).map((y,g)=>h(y,g))}),x&&a.jsx("button",{onClick:()=>s(!r),className:"w-full px-3.5 py-2 text-[11px] text-blue-400 hover:text-blue-300 bg-blue-500/5 border-t border-blue-500/10 transition-colors",children:r?"Show less":`Show all ${d.length} elements`})]})}function b3({content:n}){const[r,s]=D.useState(!1),[o,u]=D.useState(!1);if(n.startsWith("__SCREENSHOT__:"))return a.jsx(x3,{base64:n.replace("__SCREENSHOT__:","")});if(n.startsWith("__ATTACHMENT_IMAGE__:")){const v=n.replace("__ATTACHMENT_IMAGE__:",""),j=v.indexOf(":"),k=v.slice(0,j),R=v.slice(j+1),S=R.indexOf(`
`),T=S>=0?R.slice(0,S):R,V=S>=0?R.slice(S+1):"";return a.jsx(p3,{base64:T,fileName:k,caption:V})}if(n.startsWith("__ATTACHMENT_FILE__:")){const j=n.replace("__ATTACHMENT_FILE__:","").split(":"),k=j[0]||"file",R=j[1]||"0",S=j.slice(2).join(":"),T=S.indexOf(" — "),V=T>=0?S.slice(0,T):S,H=T>=0?S.slice(T+3):"";return a.jsx(g3,{fileName:k,sizeKB:R,filePath:V,caption:H})}if(n.includes("[ref=")&&(n.includes("button")||n.includes("link")||n.includes("textbox")||n.includes("heading")))return a.jsx(y3,{content:n});const f=n.length>300,x=n.includes("@@")||n.includes("--- ")||n.includes("+++ "),p=n.trim().startsWith("{")||n.trim().startsWith("["),h=n.startsWith("[ERROR]")||n.toLowerCase().includes("error:"),y=v=>{v.stopPropagation(),navigator.clipboard.writeText(n),u(!0),setTimeout(()=>u(!1),2e3)};if(x)return a.jsxs("div",{className:"bg-gray-950 border border-gray-800 rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2 bg-gray-900/80 border-b border-gray-800/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ki,{className:"w-3.5 h-3.5 text-gray-500"}),a.jsx("span",{className:"text-[11px] font-medium text-gray-400",children:"File Changes"})]}),a.jsx("button",{onClick:y,className:"text-gray-500 hover:text-gray-300 transition-colors",children:o?a.jsx(ql,{className:"w-3 h-3 text-emerald-400"}):a.jsx(Ya,{className:"w-3 h-3"})})]}),a.jsx("pre",{className:"px-3.5 py-2.5 text-xs font-mono overflow-x-auto max-h-64 overflow-y-auto",children:n.split(`
`).map((v,j)=>{let k="text-gray-400";return v.startsWith("+")&&!v.startsWith("+++")?k="text-emerald-400 bg-emerald-500/5":v.startsWith("-")&&!v.startsWith("---")?k="text-red-400 bg-red-500/5":v.startsWith("@@")?k="text-blue-400":(v.startsWith("---")||v.startsWith("+++"))&&(k="text-gray-500 font-bold"),a.jsx("div",{className:`${k} px-1 whitespace-pre-wrap`,children:v},j)})})]});if(h)return a.jsx("div",{className:"bg-red-500/5 border border-red-500/15 rounded-xl px-4 py-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(yn,{className:"w-4 h-4 text-red-400 flex-shrink-0 mt-0.5"}),a.jsx("pre",{className:"text-xs text-red-300 font-mono whitespace-pre-wrap",children:n})]})});if(p){let v;try{v=JSON.parse(n)}catch{v=null}if(v){const j=JSON.stringify(v,null,2),k=r?j:j.slice(0,300);return a.jsxs("div",{className:"bg-gray-950 border border-gray-800 rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2 bg-gray-900/80 border-b border-gray-800/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(qe,{className:"w-3.5 h-3.5 text-emerald-400"}),a.jsx("span",{className:"text-[11px] font-medium text-gray-400",children:"Result"})]}),a.jsx("button",{onClick:y,className:"text-gray-500 hover:text-gray-300 transition-colors",children:o?a.jsx(ql,{className:"w-3 h-3 text-emerald-400"}):a.jsx(Ya,{className:"w-3 h-3"})})]}),a.jsxs("pre",{className:"px-3.5 py-2.5 text-xs font-mono text-gray-300 overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap",children:[k,!r&&j.length>300&&"..."]}),j.length>300&&a.jsx("button",{onClick:()=>s(!r),className:"w-full px-3.5 py-2 text-[11px] text-gray-500 hover:text-gray-300 bg-gray-900/50 border-t border-gray-800/50 transition-colors",children:r?"Show less":"Show more"})]})}}const g=r?n:n.slice(0,300);return a.jsxs("div",{className:"bg-gray-950 border border-gray-800 rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2 bg-gray-900/80 border-b border-gray-800/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Fa,{className:"w-3.5 h-3.5 text-gray-500"}),a.jsx("span",{className:"text-[11px] font-medium text-gray-400",children:"Output"})]}),a.jsx("button",{onClick:y,className:"text-gray-500 hover:text-gray-300 transition-colors",children:o?a.jsx(ql,{className:"w-3 h-3 text-emerald-400"}):a.jsx(Ya,{className:"w-3 h-3"})})]}),a.jsxs("pre",{className:"px-3.5 py-2.5 text-xs font-mono text-gray-300 overflow-x-auto max-h-64 overflow-y-auto whitespace-pre-wrap",children:[g,!r&&f&&"..."]}),f&&a.jsx("button",{onClick:()=>s(!r),className:"w-full px-3.5 py-2 text-[11px] text-gray-500 hover:text-gray-300 bg-gray-900/50 border-t border-gray-800/50 transition-colors",children:r?"Show less":`Show more (${n.length} chars)`})]})}function v3({message:n,send:r}){const{role:s,content:o,tool_calls:u}=n;if(s==="user")return a.jsx("div",{className:"flex justify-end py-2 animate-slide-up",children:a.jsx("div",{className:"max-w-xl",children:a.jsx("div",{className:"bg-plutus-600 text-white px-4 py-3 rounded-2xl rounded-br-lg text-sm leading-relaxed",children:o})})});if(s==="assistant"){const d=typeof o=="string"?o:String(o||"");if(d.startsWith("__WORKER_RESULT__:")){const f=d.replace("__WORKER_RESULT__:",""),x=f.indexOf(":"),p=x>=0?f.slice(0,x):"Worker",h=x>=0?f.slice(x+1):f,y=h.indexOf(":"),g=y>=0?h.slice(0,y):"",v=y>=0?h.slice(y+1):h;return a.jsx("div",{className:"py-2 animate-slide-up",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-7 h-7 rounded-lg bg-amber-500/10 border border-amber-500/20 flex items-center justify-center flex-shrink-0 mt-0.5",children:a.jsx(bl,{className:"w-3.5 h-3.5 text-amber-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[a.jsx("span",{className:"text-xs font-semibold text-amber-300",children:p}),g&&a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-md bg-amber-500/10 text-amber-400/70 font-mono",children:g})]}),a.jsx("div",{className:"text-sm leading-relaxed text-gray-200",children:a.jsx(Ux,{content:v})})]})]})})}return a.jsx("div",{className:"py-2 animate-slide-up",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-7 h-7 rounded-lg bg-plutus-600/10 border border-plutus-500/15 flex items-center justify-center flex-shrink-0 mt-0.5",children:a.jsx(tp,{className:"w-3.5 h-3.5 text-plutus-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[o&&a.jsx("div",{className:"text-sm leading-relaxed text-gray-200",children:a.jsx(Ux,{content:typeof o=="string"?o:String(o)})}),u&&u.length>0&&a.jsx("div",{className:`${o?"mt-3":""} space-y-2`,children:u.map(f=>a.jsx(h3,{name:f.name,args:f.arguments,id:f.id},f.id))})]})]})})}if(s==="tool")return a.jsx("div",{className:"py-1 pl-10 animate-fade-in",children:a.jsx(b3,{content:o||""})});if(s==="system"){if(o!=null&&o.startsWith("Approval needed"))return a.jsx(B1,{message:o,send:r,approvalId:n.approval_id??void 0});if(o!=null&&o.includes("Computer Use mode")||o!=null&&o.includes("Standard mode")){const d=o.includes("Computer Use mode");return a.jsx("div",{className:"flex items-center justify-center py-2 animate-fade-in",children:a.jsxs("div",{className:`px-3 py-1.5 rounded-full text-[11px] font-medium flex items-center gap-1.5 ${d?"bg-blue-500/8 text-blue-400 border border-blue-500/15":"bg-emerald-500/8 text-emerald-400 border border-emerald-500/15"}`,children:[d?a.jsx(Xl,{className:"w-3 h-3"}):a.jsx(rn,{className:"w-3 h-3"}),o]})})}if(typeof o=="string"&&o.startsWith("__WORKER_STARTED__:")){const d=o.replace("__WORKER_STARTED__:",""),f=d.indexOf(":"),x=f>=0?d.slice(0,f):d,p=f>=0?d.slice(f+1):"";return a.jsx("div",{className:"flex items-center justify-center py-2 animate-fade-in",children:a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-[11px] font-medium flex items-center gap-2 bg-amber-500/8 text-amber-400/80 border border-amber-500/12",children:[a.jsx(bl,{className:"w-3 h-3"}),a.jsxs("span",{children:["Worker ",a.jsx("strong",{children:x})," dispatched"]}),a.jsx("span",{className:"text-[10px] font-mono text-amber-400/50",children:p})]})})}if(typeof o=="string"&&o.startsWith("[HEARTBEAT]"))return a.jsx("div",{className:"flex items-center justify-center py-2 animate-fade-in",children:a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-[11px] font-medium flex items-center gap-1.5 bg-rose-500/8 text-rose-400/80 border border-rose-500/12",children:[a.jsx(Ji,{className:"w-3 h-3"}),a.jsx("span",{children:"Heartbeat"})]})});if(typeof o=="string"&&o.startsWith("[SYSTEM NOTIFICATION]")){const d=o.replace(`[SYSTEM NOTIFICATION]
`,"").replace("[SYSTEM NOTIFICATION]","").trim();return a.jsx("div",{className:"flex items-center justify-center py-2 animate-fade-in",children:a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-[11px] font-medium flex items-center gap-1.5 bg-blue-500/8 text-blue-400/80 border border-blue-500/12 max-w-lg truncate",children:[a.jsx(Qa,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{className:"truncate",children:d||"System notification"})]})})}if(typeof o=="string"&&o.startsWith("[SYSTEM]")){const d=o.replace("[SYSTEM]","").trim();return a.jsx("div",{className:"flex items-center justify-center py-2 animate-fade-in",children:a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-[11px] font-medium flex items-center gap-1.5 bg-gray-500/8 text-gray-400 border border-gray-500/12 max-w-lg",children:[a.jsx(Qa,{className:"w-3 h-3 shrink-0"}),a.jsx("span",{className:"truncate",children:d})]})})}return o!=null&&o.startsWith("Step ")?a.jsx("div",{className:"flex items-center justify-center py-1 animate-fade-in",children:a.jsx("span",{className:"text-[10px] text-gray-600 font-mono",children:o})}):a.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 animate-fade-in",children:[a.jsx(Yl,{className:"w-3.5 h-3.5 text-amber-400"}),a.jsx("span",{className:"text-xs text-gray-500",children:o})]})}return null}const j3="/api";async function ue(n,r){const s=await fetch(`${j3}${n}`,{headers:{"Content-Type":"application/json"},...r});if(!s.ok){const o=await s.text();throw new Error(`API error ${s.status}: ${o}`)}return s.json()}const de={getStatus:()=>ue("/status"),getGuardrails:()=>ue("/guardrails"),setTier:n=>ue("/guardrails/tier",{method:"PUT",body:JSON.stringify({tier:n})}),setToolOverride:(n,r,s)=>ue("/guardrails/override",{method:"PUT",body:JSON.stringify({tool_name:n,enabled:r,require_approval:s})}),getApprovals:()=>ue("/approvals"),resolveApproval:(n,r)=>ue("/approvals/resolve",{method:"POST",body:JSON.stringify({approval_id:n,approved:r})}),getAudit:(n=50,r=0)=>ue(`/audit?limit=${n}&offset=${r}`),getConversations:(n=50)=>ue(`/conversations?limit=${n}`),deleteConversation:n=>ue(`/conversations/${n}`,{method:"DELETE"}),renameConversation:(n,r)=>ue(`/conversations/${n}`,{method:"PATCH",body:JSON.stringify({title:r})}),getMessages:n=>ue(`/conversations/${n}/messages`),cleanupConversations:()=>ue("/conversations/cleanup",{method:"POST"}),getTools:()=>ue("/tools"),getToolsDetails:()=>ue("/tools/details"),getWorkers:()=>ue("/workers"),getWorkerStatus:n=>ue(`/workers/${n}`),cancelWorker:n=>ue(`/workers/${n}/cancel`,{method:"POST"}),updateWorkerConfig:n=>ue("/workers/config",{method:"PATCH",body:JSON.stringify({patch:n})}),getScheduler:()=>ue("/scheduler"),getScheduledJobs:()=>ue("/scheduler/jobs"),getScheduledJob:n=>ue(`/scheduler/jobs/${n}`),pauseJob:n=>ue(`/scheduler/jobs/${n}/pause`,{method:"POST"}),resumeJob:n=>ue(`/scheduler/jobs/${n}/resume`,{method:"POST"}),deleteJob:n=>ue(`/scheduler/jobs/${n}`,{method:"DELETE"}),getSchedulerHistory:(n=50,r)=>ue(`/scheduler/history?limit=${n}${r?`&job_id=${r}`:""}`),getModelRouting:()=>ue("/models"),updateModelRouting:n=>ue("/models/config",{method:"PATCH",body:JSON.stringify({patch:n})}),getCustomTools:()=>ue("/custom-tools"),createCustomTool:(n,r,s,o=!0)=>ue("/custom-tools",{method:"POST",body:JSON.stringify({tool_name:n,description:r,code:s,register:o})}),deleteCustomTool:n=>ue(`/custom-tools/${n}`,{method:"DELETE"}),getKeyStatus:()=>ue("/keys/status"),setKey:(n,r)=>ue("/keys",{method:"POST",body:JSON.stringify({provider:n,key:r})}),deleteKey:n=>ue(`/keys/${n}`,{method:"DELETE"}),completeSetup:()=>ue("/setup/complete",{method:"POST"}),getConfig:()=>ue("/config"),updateConfig:n=>ue("/config",{method:"PATCH",body:JSON.stringify({patch:n})}),getHeartbeatStatus:()=>ue("/heartbeat"),updateHeartbeat:n=>ue("/heartbeat",{method:"PUT",body:JSON.stringify(n)}),startHeartbeat:()=>ue("/heartbeat/start",{method:"POST"}),stopHeartbeat:()=>ue("/heartbeat/stop",{method:"POST"}),getKeepAliveStatus:()=>ue("/keep-alive"),setKeepAlive:n=>ue("/keep-alive",{method:"PUT",body:JSON.stringify({enabled:n})}),getPlans:(n,r=20)=>ue(`/plans?limit=${r}${n?`&conversation_id=${n}`:""}`),getActivePlan:n=>ue(`/plans/active${n?`?conversation_id=${n}`:""}`),getPlan:n=>ue(`/plans/${n}`),deletePlan:n=>ue(`/plans/${n}`,{method:"DELETE"}),getPCStatus:()=>ue("/pc/status"),getPCContext:()=>ue("/pc/context"),getPCWorkflows:()=>ue("/pc/workflows"),getPCShortcuts:()=>ue("/pc/shortcuts"),getSkills:n=>ue(n?`/skills?category=${n}`:"/skills"),getSkillDetail:n=>ue(`/skills/${n}`),exportSkill:n=>ue(`/skills/${n}/export`),importSkill:n=>ue("/skills/import",{method:"POST",body:JSON.stringify({skill_data:n})}),deleteSkill:n=>ue(`/skills/${n}`,{method:"DELETE"}),getSavedSkills:()=>ue("/skills/saved"),getMemoryStats:()=>ue("/memory/stats"),getFacts:(n,r=50)=>ue(`/memory/facts?limit=${r}${n?`&category=${n}`:""}`),deleteFact:n=>ue(`/memory/facts/${n}`,{method:"DELETE"}),getGoals:(n,r=50)=>ue(`/memory/goals?limit=${r}${n?`&conversation_id=${n}`:""}`),getActiveGoals:n=>ue(`/memory/goals/active${n?`?conversation_id=${n}`:""}`),getConversationSummary:n=>ue(`/conversations/${n}/summary`),getCheckpoints:(n,r=10)=>ue(`/conversations/${n}/checkpoints?limit=${r}`),getImprovementLog:(n=50)=>ue(`/improvement/log?limit=${n}`),getImprovementStats:()=>ue("/improvement/stats"),getConnectors:()=>ue("/connectors"),getConnector:n=>ue(`/connectors/${n}`),updateConnectorConfig:(n,r)=>ue(`/connectors/${n}/config`,{method:"PUT",body:JSON.stringify({config:r})}),testConnector:n=>ue(`/connectors/${n}/test`,{method:"POST"}),sendConnectorMessage:(n,r,s={})=>ue(`/connectors/${n}/send`,{method:"POST",body:JSON.stringify({text:r,params:s})}),startConnector:n=>ue(`/connectors/${n}/start`,{method:"POST"}),stopConnector:n=>ue(`/connectors/${n}/stop`,{method:"POST"}),disconnectConnector:n=>ue(`/connectors/${n}`,{method:"DELETE"}),getBridgeStatus:n=>ue(`/connectors/${n}/bridge-status`),setConnectorAutoStart:(n,r)=>ue(`/connectors/${n}/auto-start`,{method:"PUT",body:JSON.stringify({auto_start:r})}),getWSLStatus:()=>ue("/wsl/status"),enableWSL:n=>ue("/wsl/enable",{method:"PUT",body:JSON.stringify({enabled:n})}),completeWSLSetup:()=>ue("/wsl/setup-complete",{method:"POST"}),getWSLSetupGuide:()=>ue("/wsl/setup-guide"),checkForUpdate:()=>ue("/updates/check"),dismissUpdate:n=>ue("/updates/dismiss",{method:"POST",body:JSON.stringify({version:n})}),applyUpdate:()=>ue("/updates/apply",{method:"POST"})},N3=[{id:"anthropic",label:"Anthropic",icon:"A",color:"from-orange-500 to-amber-600"},{id:"openai",label:"OpenAI",icon:"O",color:"from-emerald-500 to-teal-600"},{id:"ollama",label:"Ollama",icon:"L",color:"from-blue-500 to-indigo-600"}],Bx={anthropic:[{id:"claude-opus-4-6",label:"Opus 4-6"},{id:"claude-sonnet-4-6",label:"Sonnet 4-6"},{id:"claude-haiku-4-5",label:"Haiku 4-5"}],openai:[{id:"gpt-5.2",label:"GPT-5.2"},{id:"gpt-5",label:"GPT-5"},{id:"gpt-4.1",label:"GPT-4.1"},{id:"gpt-4.1-mini",label:"GPT-4.1 Mini"},{id:"o3",label:"o3"},{id:"o4-mini",label:"o4-mini"}],ollama:[{id:"llama3.2",label:"Llama 3.2"},{id:"mistral",label:"Mistral"}]},w3=[{id:"observer",label:"Observer",color:"text-gray-400 bg-gray-500/10 border-gray-500/30"},{id:"assistant",label:"Assistant",color:"text-blue-400 bg-blue-500/10 border-blue-500/30"},{id:"operator",label:"Operator",color:"text-amber-400 bg-amber-500/10 border-amber-500/30"},{id:"autonomous",label:"Autonomous",color:"text-red-400 bg-red-500/10 border-red-500/30"}];function k3(){var U,$,fe,J;const[n,r]=D.useState(!1),[s,o]=D.useState(null),[u,d]=D.useState(null),[f,x]=D.useState(!1),[p,h]=D.useState(!1),y=D.useRef(null),{currentTier:g,setCurrentTier:v}=Qe(),j=D.useCallback(()=>{de.getConfig().then(o).catch(()=>{}),de.getHeartbeatStatus().then(M=>d(M)).catch(()=>{})},[]);D.useEffect(()=>{if(n){j();const M=window.setInterval(()=>{de.getHeartbeatStatus().then(ne=>d(ne)).catch(()=>{})},5e3);return()=>window.clearInterval(M)}},[n,j]),D.useEffect(()=>{if(!n)return;const M=ne=>{y.current&&!y.current.contains(ne.target)&&r(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[n]),D.useEffect(()=>{if(!n)return;const M=ne=>{ne.key==="Escape"&&r(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[n]);const k=async M=>{x(!0),h(!1);try{await de.updateConfig(M),h(!0);const ne=await de.getConfig();o(ne),setTimeout(()=>h(!1),2e3)}catch(ne){console.error("Failed to save:",ne)}finally{x(!1)}},R=async M=>{try{await de.setTier(M),v(M)}catch(ne){console.error("Failed to set tier:",ne)}},S=async()=>{try{if(u!=null&&u.running){const M=await de.stopHeartbeat();d(M)}else{const M=await de.startHeartbeat();d(M)}}catch(M){console.error("Failed to toggle heartbeat:",M)}},T=((U=s==null?void 0:s.model)==null?void 0:U.provider)||"anthropic",V=(($=s==null?void 0:s.model)==null?void 0:$.model)||"",H=((fe=s==null?void 0:s.model)==null?void 0:fe.temperature)??.7,I=((J=s==null?void 0:s.agent)==null?void 0:J.max_tool_rounds)||25,z=Bx[T]||[];return a.jsxs("div",{className:"relative",ref:y,children:[a.jsx("button",{onClick:()=>r(!n),className:`flex-shrink-0 w-8 h-8 rounded-lg flex items-center justify-center transition-colors ${n?"bg-plutus-600 text-white":"bg-gray-700/50 hover:bg-gray-700 text-gray-400 hover:text-gray-200"}`,title:"Command Center",children:a.jsx(jp,{className:"w-4 h-4"})}),n&&s&&a.jsxs("div",{className:"absolute bottom-12 left-0 w-[380px] bg-surface-alt border border-gray-800/80 rounded-2xl shadow-2xl shadow-black/40 overflow-hidden z-50 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-800/60",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Xh,{className:"w-4 h-4 text-plutus-400"}),a.jsx("span",{className:"text-sm font-semibold text-gray-200",children:"Command Center"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[p&&a.jsxs("span",{className:"text-xs text-emerald-400 flex items-center gap-1",children:[a.jsx(qe,{className:"w-3 h-3"}),"Saved"]}),a.jsx("button",{onClick:()=>r(!1),className:"text-gray-500 hover:text-gray-300 p-0.5 rounded transition-colors",children:a.jsx(Vl,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"max-h-[480px] overflow-y-auto p-4 space-y-4",children:[a.jsxs(Hi,{icon:an,iconColor:"text-plutus-400 bg-plutus-500/10",title:"Model",children:[a.jsx("div",{className:"flex gap-1.5 mb-3",children:N3.map(M=>a.jsxs("button",{onClick:()=>{var Z;const ne=Bx[M.id],re=((Z=ne==null?void 0:ne[0])==null?void 0:Z.id)||V;k({model:{provider:M.id,model:re}})},className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${T===M.id?"bg-plutus-500/15 text-plutus-300 border border-plutus-500/30":"bg-gray-800/40 text-gray-400 border border-gray-800/40 hover:border-gray-700/60 hover:text-gray-300"}`,children:[a.jsx("span",{className:`w-4 h-4 rounded text-[9px] font-bold bg-gradient-to-br ${M.color} text-white flex items-center justify-center`,children:M.icon}),M.label]},M.id))}),a.jsxs("div",{className:"relative mb-3",children:[a.jsx("select",{value:V,onChange:M=>k({model:{model:M.target.value}}),className:"w-full appearance-none bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 pr-8 text-sm text-gray-200 focus:outline-none focus:border-plutus-500/50 cursor-pointer",children:z.map(M=>a.jsx("option",{value:M.id,children:M.label},M.id))}),a.jsx($l,{className:"w-3.5 h-3.5 text-gray-500 absolute right-2.5 top-1/2 -translate-y-1/2 pointer-events-none"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[a.jsx("span",{className:"text-xs text-gray-500",children:"Temperature"}),a.jsx("span",{className:"text-xs font-mono text-plutus-400 bg-plutus-500/10 px-2 py-0.5 rounded",children:H})]}),a.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:H,onChange:M=>k({model:{temperature:parseFloat(M.target.value)}}),className:"w-full accent-plutus-500 h-1.5 rounded-full"}),a.jsxs("div",{className:"flex justify-between text-[9px] text-gray-600 mt-1",children:[a.jsx("span",{children:"Precise"}),a.jsx("span",{children:"Creative"})]})]})]}),a.jsx(Hi,{icon:bn,iconColor:"text-amber-400 bg-amber-500/10",title:"Guardrails",children:a.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:w3.map(M=>a.jsx("button",{onClick:()=>R(M.id),className:`px-2 py-1.5 rounded-lg text-xs font-medium border transition-all ${g===M.id?M.color:"text-gray-500 bg-gray-800/30 border-gray-800/40 hover:border-gray-700/50 hover:text-gray-400"}`,children:M.label},M.id))})}),a.jsx(Hi,{icon:Ji,iconColor:"text-rose-400 bg-rose-500/10",title:"Heartbeat",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[(u==null?void 0:u.running)&&!(u!=null&&u.paused)&&a.jsxs("span",{className:"flex items-center gap-1 text-xs text-emerald-400",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),"Active",a.jsxs("span",{className:"text-gray-500 ml-1",children:[u.consecutive_beats,"/",u.max_consecutive]})]}),(u==null?void 0:u.paused)&&a.jsx("span",{className:"text-xs text-amber-400",children:"Paused"}),u&&!u.running&&!u.paused&&a.jsx("span",{className:"text-xs text-gray-500",children:"Off"})]}),a.jsx("button",{onClick:S,className:`flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg border transition-colors ${u!=null&&u.running?"border-red-500/30 bg-red-500/10 text-red-400 hover:bg-red-500/20":"border-emerald-500/30 bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20"}`,children:u!=null&&u.running?a.jsxs(a.Fragment,{children:[a.jsx(Pi,{className:"w-3 h-3"})," Stop"]}):a.jsxs(a.Fragment,{children:[a.jsx(Fa,{className:"w-3 h-3"})," Start"]})})]})}),a.jsx(Hi,{icon:Xh,iconColor:"text-blue-400 bg-blue-500/10",title:"Agent",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[a.jsx("span",{className:"text-xs text-gray-300",children:"Max Tool Rounds"}),a.jsx("span",{className:"text-xs font-mono text-plutus-400 bg-plutus-500/10 px-2 py-0.5 rounded",children:I})]}),a.jsx("input",{type:"range",min:"5",max:"100",step:"5",value:I,onChange:M=>k({agent:{max_tool_rounds:parseInt(M.target.value)||25}}),className:"w-full accent-plutus-500 h-1.5 rounded-full"}),a.jsxs("div",{className:"flex justify-between text-[9px] text-gray-600 mt-1",children:[a.jsx("span",{children:"5"}),a.jsx("span",{children:"50"}),a.jsx("span",{children:"100"})]})]})})]}),a.jsxs("div",{className:"px-4 py-2.5 border-t border-gray-800/60 flex items-center justify-between",children:[a.jsx("button",{onClick:()=>{r(!1),Qe.getState().setView("settings")},className:"text-xs text-gray-500 hover:text-plutus-400 transition-colors",children:"Open full settings"}),f&&a.jsx("span",{className:"text-xs text-gray-500",children:"Saving..."})]})]})]})}function Hi({icon:n,iconColor:r,title:s,children:o}){const[u,d]=r.split(" ").length>=2?[r.split(" ")[1],r.split(" ")[0]]:["bg-gray-500/10","text-gray-400"];return a.jsxs("div",{className:"bg-gray-800/20 rounded-xl border border-gray-800/40 p-3",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx("div",{className:`w-6 h-6 rounded-md ${u} flex items-center justify-center`,children:a.jsx(n,{className:`w-3.5 h-3.5 ${d}`})}),a.jsx("span",{className:"text-xs font-semibold text-gray-300",children:s})]}),o]})}function S3({onSend:n,onStop:r,disabled:s}){const[o,u]=D.useState(""),d=D.useRef(null),{isProcessing:f}=Qe();D.useEffect(()=>{const g=d.current;if(!g)return;g.style.height="24px";const v=g.scrollHeight;g.style.height=Math.min(v,160)+"px"},[o]),D.useEffect(()=>{var g;(g=d.current)==null||g.focus()},[]);const x=()=>{const g=o.trim();!g||s||(n(g),u(""),d.current&&(d.current.style.height="24px"))},p=g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),x())},h=()=>{r&&r()},y=o.trim().length>0;return a.jsx("div",{className:"bg-gray-950/80 backdrop-blur-md px-4 pt-2 pb-4",children:a.jsx("div",{className:"max-w-3xl mx-auto",children:a.jsxs("div",{className:"relative bg-gray-900 border border-gray-800 rounded-2xl shadow-lg shadow-black/20 transition-all focus-within:border-gray-700 focus-within:shadow-xl focus-within:shadow-black/30",children:[a.jsx("textarea",{ref:d,value:o,onChange:g=>u(g.target.value),onKeyDown:p,placeholder:f?"Plutus is working...":"Message Plutus...",disabled:s,rows:1,className:"w-full bg-transparent border-none outline-none text-sm text-gray-100 placeholder-gray-600 resize-none leading-6 px-4 pt-3.5 pb-12",style:{height:"24px",minHeight:"24px",maxHeight:"160px"}}),a.jsxs("div",{className:"absolute bottom-0 left-0 right-0 flex items-center justify-between px-3 pb-2.5",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(k3,{}),a.jsx("span",{className:"text-[11px] text-gray-600 ml-1 select-none",children:f?"Working on your task":"Enter to send"})]}),f?a.jsx("button",{onClick:h,className:"w-7 h-7 rounded-lg bg-red-500/90 hover:bg-red-500 flex items-center justify-center transition-colors",title:"Stop current task",children:a.jsx(Pi,{className:"w-3 h-3 text-white fill-white"})}):a.jsx("button",{onClick:x,disabled:s||!y,className:`w-7 h-7 rounded-lg flex items-center justify-center transition-all ${y?"bg-plutus-600 hover:bg-plutus-500 text-white shadow-sm shadow-plutus-600/30":"bg-gray-800 text-gray-600 cursor-not-allowed"}`,children:a.jsx(f1,{className:"w-4 h-4",strokeWidth:2.5})})]})]})})})}function C3({send:n}){const{messages:r,isProcessing:s,keyConfigured:o}=Qe(),u=D.useRef(null);D.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[r]);const d=x=>{Qe.getState().addMessage({role:"user",content:x}),n({type:"chat",content:x})},f=()=>{n({type:"stop_task"})};return a.jsxs("div",{className:"flex h-full flex-col flex-1 min-h-0",children:[a.jsx("div",{ref:u,className:"flex-1 overflow-y-auto",children:a.jsxs("div",{className:"max-w-3xl mx-auto px-6 py-6 space-y-1",children:[r.length===0?o?a.jsx(T3,{onSend:d}):a.jsx(_3,{}):r.map((x,p)=>a.jsx(v3,{message:x,send:n},p)),s&&a.jsxs("div",{className:"flex items-center gap-3 py-4 px-1 animate-fade-in",children:[a.jsx("div",{className:"w-7 h-7 rounded-full bg-plutus-600/15 flex items-center justify-center flex-shrink-0",children:a.jsxs("div",{className:"dot-pulse flex items-center gap-1",children:[a.jsx("span",{className:"w-1.5 h-1.5 bg-plutus-400 rounded-full"}),a.jsx("span",{className:"w-1.5 h-1.5 bg-plutus-400 rounded-full"}),a.jsx("span",{className:"w-1.5 h-1.5 bg-plutus-400 rounded-full"})]})}),a.jsx("span",{className:"text-sm text-gray-500",children:"Thinking..."})]})]})}),a.jsx(S3,{onSend:d,onStop:f,disabled:s||!o})]})}function _3(){return a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center py-24",children:[a.jsx("div",{className:"w-14 h-14 rounded-2xl bg-amber-500/10 border border-amber-500/20 flex items-center justify-center mb-5",children:a.jsx(v1,{className:"w-7 h-7 text-amber-400"})}),a.jsx("h3",{className:"text-xl font-semibold text-gray-100 mb-2",children:"API Key Required"}),a.jsx("p",{className:"text-gray-400 max-w-sm text-sm leading-relaxed mb-2",children:"Configure your API key in Settings to get started."}),a.jsx("p",{className:"text-gray-600 max-w-sm text-xs leading-relaxed mb-6",children:"Your key is stored locally and never leaves your machine."}),a.jsx("button",{onClick:()=>Qe.getState().setView("settings"),className:"px-5 py-2.5 rounded-lg bg-plutus-600 hover:bg-plutus-500 text-white text-sm font-medium transition-colors",children:"Go to Settings"})]})}function T3({onSend:n}){const r=[{icon:Ii,color:"text-blue-400",bg:"bg-blue-500/8 border-blue-500/10",label:"Browse the Web",description:"Navigate sites, read content, fill forms"},{icon:S1,color:"text-violet-400",bg:"bg-violet-500/8 border-violet-500/10",label:"Control Your PC",description:"Click, type, open apps, manage files"},{icon:an,color:"text-emerald-400",bg:"bg-emerald-500/8 border-emerald-500/10",label:"Learn & Improve",description:"Creates reusable skills over time"},{icon:ep,color:"text-amber-400",bg:"bg-amber-500/8 border-amber-500/10",label:"Automate Anything",description:"Chain actions, schedule tasks"}],s=["Open Chrome and search for the latest AI news","Send a message on Telegram","Open Notepad and write a quick to-do list","Find and organize my Downloads folder","Check my email for anything important","Help me research a topic and summarize it"];return a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center py-16",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-plutus-500/20 to-violet-500/20 border border-plutus-500/10 flex items-center justify-center mb-6",children:a.jsx($t,{className:"w-6 h-6 text-plutus-400"})}),a.jsx("h2",{className:"text-2xl font-semibold text-gray-100 mb-2 tracking-tight",children:"What can I help you with?"}),a.jsx("p",{className:"text-gray-500 max-w-md text-sm leading-relaxed mb-10",children:"Describe what you need in plain English. I can browse the web, control apps, manage files, and automate tasks."}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 max-w-2xl w-full mb-10",children:r.map(o=>{const u=o.icon;return a.jsxs("div",{className:`flex flex-col items-center gap-2.5 p-4 rounded-xl border ${o.bg} transition-colors hover:bg-gray-800/40`,children:[a.jsx(u,{className:`w-5 h-5 ${o.color}`}),a.jsxs("div",{children:[a.jsx("span",{className:"text-xs font-medium text-gray-200 block",children:o.label}),a.jsx("span",{className:"text-[11px] text-gray-500 leading-snug mt-0.5 block",children:o.description})]})]},o.label)})}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 max-w-2xl w-full",children:s.map(o=>a.jsxs("button",{onClick:()=>n(o),className:"group text-left px-4 py-3 rounded-xl border border-gray-800/60 bg-gray-900/40 hover:bg-gray-800/50 hover:border-gray-700/60 text-sm text-gray-400 hover:text-gray-200 transition-all flex items-center gap-3",children:[a.jsx("span",{className:"flex-1",children:o}),a.jsx(cd,{className:"w-3.5 h-3.5 text-gray-600 group-hover:text-gray-400 transition-colors flex-shrink-0 opacity-0 group-hover:opacity-100"})]},o))})]})}const qx={emerald:{icon:"bg-emerald-500/10 text-emerald-400",glow:"shadow-emerald-500/5"},red:{icon:"bg-red-500/10 text-red-400",glow:"shadow-red-500/5"},plutus:{icon:"bg-plutus-500/10 text-plutus-400",glow:"shadow-plutus-500/5"},blue:{icon:"bg-blue-500/10 text-blue-400",glow:"shadow-blue-500/5"},gray:{icon:"bg-gray-500/10 text-gray-400",glow:""},amber:{icon:"bg-amber-500/10 text-amber-400",glow:"shadow-amber-500/5"},purple:{icon:"bg-purple-500/10 text-purple-400",glow:"shadow-purple-500/5"},rose:{icon:"bg-rose-500/10 text-rose-400",glow:"shadow-rose-500/5"}};function Bi({icon:n,label:r,value:s,sublabel:o,color:u,capitalize:d}){const f=qx[u]||qx.gray;return a.jsxs("div",{className:`bg-surface rounded-xl border border-gray-800/60 p-4 ${f.glow}`,children:[a.jsx("div",{className:"flex items-center justify-between mb-3",children:a.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center ${f.icon}`,children:a.jsx(n,{className:"w-4.5 h-4.5"})})}),a.jsx("p",{className:`text-2xl font-bold text-gray-100 tracking-tight ${d?"capitalize":""}`,children:s}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:r}),o&&a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:o})]})}const Yx={allowed:{icon:qe,color:"text-emerald-400",bg:"bg-emerald-500/10",label:"Allowed"},denied:{icon:yn,color:"text-red-400",bg:"bg-red-500/10",label:"Denied"},pending_approval:{icon:Gn,color:"text-amber-400",bg:"bg-amber-500/10",label:"Pending"},approved:{icon:qe,color:"text-blue-400",bg:"bg-blue-500/10",label:"Approved"},rejected:{icon:bn,color:"text-red-400",bg:"bg-red-500/10",label:"Rejected"}};function E3(n){const s=Date.now()/1e3-n;return s<60?"just now":s<3600?`${Math.floor(s/60)}m ago`:s<86400?`${Math.floor(s/3600)}h ago`:new Date(n*1e3).toLocaleDateString()}function A3({entries:n}){const r=Array.isArray(n)?n:[];return r.length===0?a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-gray-500/10 flex items-center justify-center",children:a.jsx($t,{className:"w-5 h-5 text-gray-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Recent Activity"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Tool calls and system events"})]})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center py-10",children:[a.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800/50 flex items-center justify-center mb-3",children:a.jsx($t,{className:"w-6 h-6 text-gray-600"})}),a.jsx("p",{className:"text-sm text-gray-500",children:"No activity yet"}),a.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"Start a conversation to see actions here"})]})]}):a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-gray-500/10 flex items-center justify-center",children:a.jsx($t,{className:"w-5 h-5 text-gray-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Recent Activity"}),a.jsxs("p",{className:"text-xs text-gray-500",children:["Last ",Math.min(r.length,10)," tool calls"]})]}),a.jsxs("span",{className:"text-xs text-gray-600 bg-gray-800/50 px-2.5 py-1 rounded-full",children:[r.length," total"]})]}),a.jsx("div",{className:"space-y-1",children:r.slice(0,10).map((s,o)=>{const u=Yx[s.decision]||Yx.allowed,d=u.icon;return a.jsxs("div",{className:"flex items-center gap-3 py-2.5 px-3 rounded-lg hover:bg-gray-800/30 transition-colors group",children:[a.jsx("div",{className:`w-7 h-7 rounded-lg flex items-center justify-center shrink-0 ${u.bg}`,children:a.jsx(d,{className:`w-3.5 h-3.5 ${u.color}`})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-gray-300",children:s.tool_name}),s.operation&&a.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:[".",s.operation]})]}),s.reason&&a.jsx("p",{className:"text-xs text-gray-500 truncate mt-0.5",children:s.reason})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded ${u.bg} ${u.color}`,children:u.label}),a.jsx("span",{className:"text-[10px] text-gray-600",children:E3(s.timestamp)})]})]},s.id||o)})})]})}function M3(){var J,M,ne,re;const{currentTier:n,connected:r}=Qe(),[s,o]=D.useState(null),[u,d]=D.useState(null),[f,x]=D.useState([]),[p,h]=D.useState(null),[y,g]=D.useState(null),[v,j]=D.useState(null),k=D.useCallback(()=>{de.getStatus().then(o).catch(()=>{}),de.getAudit(20).then(Z=>{Z&&!Array.isArray(Z.entries)&&(Z.entries=[]),d(Z)}).catch(()=>{}),de.getConversations(5).then(x).catch(()=>{}),de.getConnectors().then(h).catch(()=>{}),de.getSkills().then(g).catch(()=>{}),de.getMemoryStats().then(j).catch(()=>{})},[]);D.useEffect(()=>{k();const Z=setInterval(k,15e3);return()=>clearInterval(Z)},[k]);const R=(J=s==null?void 0:s.guardrails)==null?void 0:J.audit_summary,S=s==null?void 0:s.worker_pool,T=s==null?void 0:s.scheduler,V=s==null?void 0:s.heartbeat,H=((M=s==null?void 0:s.tools)==null?void 0:M.length)??0,I=(R==null?void 0:R.total_entries)??0,z=p?Object.values(p):[],U=z.filter(Z=>(Z==null?void 0:Z.connected)||(Z==null?void 0:Z.running)).length,$=((ne=y==null?void 0:y.skills)==null?void 0:ne.length)??(Array.isArray(y)?y.length:0),fe=(v==null?void 0:v.total_facts)??(v==null?void 0:v.facts)??0;return a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsxs("div",{className:"max-w-5xl mx-auto p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-gray-100",children:"Dashboard"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"System overview and real-time metrics"})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium ${r?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:[r?a.jsx(Fh,{className:"w-3.5 h-3.5"}):a.jsx(D1,{className:"w-3.5 h-3.5"}),r?"Connected":"Disconnected"]}),a.jsxs("span",{className:"text-xs text-gray-600 font-mono bg-gray-800/50 px-2.5 py-1.5 rounded-lg",children:["v",(s==null?void 0:s.version)||"0.3.2"]})]})]}),a.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[a.jsx(Bi,{icon:Pr,label:"System Status",value:r?"Online":"Offline",color:r?"emerald":"red"}),a.jsx(Bi,{icon:bn,label:"Guardrail Tier",value:n,color:"plutus",capitalize:!0}),a.jsx(Bi,{icon:rn,label:"Tools Available",value:String(H),sublabel:`${I} total actions`,color:"blue"}),a.jsx(Bi,{icon:O1,label:"Active Workers",value:String((S==null?void 0:S.active)??0),sublabel:`of ${(S==null?void 0:S.max_workers)??5} max`,color:"purple"})]}),a.jsx("div",{className:"grid grid-cols-5 gap-3",children:[{icon:mp,label:"Conversations",value:String((f==null?void 0:f.length)??0),color:"text-blue-400",bg:"bg-blue-500/10"},{icon:qa,label:"Scheduled Jobs",value:String((T==null?void 0:T.total_jobs)??(T==null?void 0:T.jobs)??0),color:"text-amber-400",bg:"bg-amber-500/10"},{icon:dp,label:"Skills",value:String($),color:"text-emerald-400",bg:"bg-emerald-500/10"},{icon:Fh,label:"Connectors",value:`${U}/${z.length}`,color:"text-purple-400",bg:"bg-purple-500/10"},{icon:an,label:"Memory Facts",value:String(fe),color:"text-rose-400",bg:"bg-rose-500/10"}].map(({icon:Z,label:Q,value:ee,color:A,bg:O})=>a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-3.5 flex items-center gap-3",children:[a.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center ${O}`,children:a.jsx(Z,{className:`w-4 h-4 ${A}`})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-lg font-bold text-gray-200 leading-none",children:ee}),a.jsx("p",{className:"text-[10px] text-gray-500 mt-0.5",children:Q})]})]},Q))}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsxs("div",{className:"col-span-2 bg-surface rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-500/10 flex items-center justify-center",children:a.jsx(lp,{className:"w-5 h-5 text-blue-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Action Decisions"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Guardrail outcomes for tool calls"})]})]}),R!=null&&R.by_decision?a.jsx("div",{className:"space-y-3",children:[{key:"allowed",label:"Allowed",icon:qe,color:"emerald"},{key:"denied",label:"Denied",icon:yn,color:"red"},{key:"approved",label:"Approved",icon:qe,color:"blue"},{key:"rejected",label:"Rejected",icon:Yl,color:"amber"}].map(({key:Z,label:Q,icon:ee,color:A})=>{const O=R.by_decision[Z]??0,ie=Math.round(O/(I||1)*100);return a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ee,{className:`w-4 h-4 text-${A}-400 shrink-0`}),a.jsx("span",{className:"text-sm text-gray-400 w-20",children:Q}),a.jsx("div",{className:"flex-1 bg-gray-800/50 rounded-full h-2 overflow-hidden",children:a.jsx("div",{className:`h-full rounded-full bg-${A}-500/60 transition-all`,style:{width:`${Math.max(ie,O>0?2:0)}%`}})}),a.jsx("span",{className:"text-sm font-mono text-gray-300 w-10 text-right",children:O})]},Z)})}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[a.jsx("p",{className:"text-sm text-gray-500",children:"No action data yet"}),a.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"Tool calls will appear here as you use Plutus"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-4",children:[a.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-rose-500/10 flex items-center justify-center",children:a.jsx(Ji,{className:"w-4 h-4 text-rose-400"})}),a.jsx("div",{className:"flex-1",children:a.jsx("h3",{className:"text-xs font-semibold text-gray-300",children:"Heartbeat"})}),V!=null&&V.running?a.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-emerald-400 bg-emerald-500/10 px-2 py-0.5 rounded-full",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),"Active"]}):a.jsx("span",{className:"text-[10px] text-gray-500 bg-gray-500/10 px-2 py-0.5 rounded-full",children:"Off"})]}),(V==null?void 0:V.running)&&a.jsxs("div",{className:"text-xs text-gray-500 space-y-1",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Beats"}),a.jsxs("span",{className:"text-gray-300",children:[V.consecutive_beats,"/",V.max_consecutive]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Interval"}),a.jsx("span",{className:"text-gray-300",children:V.interval_seconds<60?`${V.interval_seconds}s`:`${Math.floor(V.interval_seconds/60)}m`})]})]}),!(V!=null&&V.running)&&a.jsx("p",{className:"text-xs text-gray-600",children:"Configure in Settings to enable autonomous operation"})]}),a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-4",children:[a.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-plutus-500/10 flex items-center justify-center",children:a.jsx(an,{className:"w-4 h-4 text-plutus-400"})}),a.jsx("h3",{className:"text-xs font-semibold text-gray-300",children:"Coordinator"})]}),a.jsxs("div",{className:"text-xs text-gray-500 space-y-1",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Model"}),a.jsx("span",{className:"text-gray-300 font-mono text-[10px]",children:((re=s==null?void 0:s.model_routing)==null?void 0:re.default_worker_model)||"claude-sonnet-4-6"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Planner"}),a.jsx("span",{className:`${s!=null&&s.planner_enabled?"text-emerald-400":"text-gray-500"}`,children:s!=null&&s.planner_enabled?"Enabled":"Disabled"})]})]})]})]})]}),(R==null?void 0:R.by_tool)&&Object.keys(R.by_tool).length>0&&a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-emerald-500/10 flex items-center justify-center",children:a.jsx(rn,{className:"w-5 h-5 text-emerald-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Tool Usage"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Distribution of tool calls"})]}),a.jsxs("span",{className:"text-xs text-gray-600 bg-gray-800/50 px-2.5 py-1 rounded-full",children:[Object.keys(R.by_tool).length," tools used"]})]}),a.jsx("div",{className:"space-y-2.5",children:Object.entries(R.by_tool).sort(([,Z],[,Q])=>Q-Z).slice(0,10).map(([Z,Q])=>{const ee=Math.max(...Object.values(R.by_tool)),A=Q/ee*100;return a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-sm text-gray-400 w-28 truncate font-mono text-xs",children:Z}),a.jsx("div",{className:"flex-1 bg-gray-800/50 rounded-full h-2 overflow-hidden",children:a.jsx("div",{className:"bg-gradient-to-r from-plutus-500/80 to-plutus-400/60 rounded-full h-2 transition-all",style:{width:`${A}%`}})}),a.jsx("span",{className:"text-xs text-gray-400 font-mono w-10 text-right",children:Q})]},Z)})})]}),a.jsx(A3,{entries:(u==null?void 0:u.entries)??[]})]})})}const z3={observer:Ql,assistant:z1,operator:p1,autonomous:$t},Vx={observer:{ring:"ring-gray-500",bg:"bg-gray-500/10",text:"text-gray-400"},assistant:{ring:"ring-blue-500",bg:"bg-blue-500/10",text:"text-blue-400"},operator:{ring:"ring-plutus-500",bg:"bg-plutus-500/10",text:"text-plutus-400"},autonomous:{ring:"ring-amber-500",bg:"bg-amber-500/10",text:"text-amber-400"}};function O3({tiers:n,currentTier:r,onSelect:s}){return a.jsx("div",{className:"grid grid-cols-4 gap-3",children:n.map(o=>{const u=z3[o.id]||Ql,d=Vx[o.id]||Vx.observer,f=o.id===r;return a.jsxs("button",{onClick:()=>s(o.id),className:`relative flex flex-col items-center gap-3 p-4 rounded-xl border-2 transition-all ${f?`border-transparent ring-2 ${d.ring} ${d.bg}`:"border-gray-800 hover:border-gray-700 bg-gray-900"}`,children:[f&&a.jsx("div",{className:"absolute top-2 right-2 w-2 h-2 rounded-full bg-emerald-400"}),a.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${d.bg}`,children:a.jsx(u,{className:`w-5 h-5 ${d.text}`})}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:`text-sm font-semibold ${f?d.text:"text-gray-300"}`,children:o.label}),a.jsx("p",{className:"text-xs text-gray-500 mt-1 leading-relaxed",children:o.description})]}),a.jsx("div",{className:"flex gap-1",children:[0,1,2,3].map(x=>a.jsx("div",{className:`w-6 h-1.5 rounded-full ${x<=o.level?d.bg.replace("/10","/40"):"bg-gray-800"}`},x))})]},o.id)})})}const D3={shell:rn,filesystem:up,browser:Ii,process:bl,system_info:Xl,clipboard:sp},Gx={allowed:{label:"Allowed",color:"text-emerald-400"},requires_approval:{label:"Needs Approval",color:"text-amber-400"},denied:{label:"Denied",color:"text-red-400"}};function R3({toolName:n,description:r,defaultPermission:s,override:o,onOverride:u}){const d=D3[n]||rn,f=o?o.enabled:s!=="denied",x=o?o.require_approval:s==="requires_approval",h=Gx[f?x?"requires_approval":"allowed":"denied"]||Gx.denied;return a.jsxs("div",{className:"flex items-center gap-4 p-3 bg-gray-800/50 rounded-lg border border-gray-800",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-gray-800 flex items-center justify-center flex-shrink-0",children:a.jsx(d,{className:"w-4.5 h-4.5 text-gray-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-gray-200",children:n}),a.jsx("span",{className:`text-xs ${h.color}`,children:h.label})]}),a.jsx("p",{className:"text-xs text-gray-500 truncate",children:r})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f&&a.jsx("button",{onClick:()=>u(!0,!x),className:`text-xs px-2.5 py-1 rounded-md border transition-colors ${x?"border-amber-500/30 bg-amber-500/10 text-amber-400":"border-gray-700 bg-gray-800 text-gray-500 hover:text-gray-300"}`,children:x?"Approval ON":"Approval OFF"}),a.jsx("button",{onClick:()=>u(!f,x),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${f?"bg-plutus-600":"bg-gray-700"}`,children:a.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${f?"translate-x-6":"translate-x-1"}`})})]})]})}function L3(){const{currentTier:n,setCurrentTier:r}=Qe(),[s,o]=D.useState([]),[u,d]=D.useState([]),[f,x]=D.useState({});D.useEffect(()=>{de.getGuardrails().then(g=>{o(g.tier_info||[]),x(g.overrides||{}),g.current_tier&&r(g.current_tier)}).catch(()=>{}),de.getTools().then(g=>d(g||[])).catch(()=>{})},[r]);const p=async g=>{try{await de.setTier(g),r(g)}catch(v){console.error("Failed to set tier:",v)}},h=async(g,v,j)=>{try{await de.setToolOverride(g,v,j),x(k=>({...k,[g]:{enabled:v,require_approval:j}}))}catch(k){console.error("Failed to set override:",k)}},y=s.find(g=>g.id===n);return a.jsxs("div",{className:"h-full overflow-y-auto p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-gray-100 mb-1",children:"Guardrails"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Control how much access Plutus has to your system"})]}),a.jsxs("div",{className:"flex items-start gap-3 p-4 bg-plutus-600/10 border border-plutus-500/20 rounded-xl",children:[a.jsx(Qa,{className:"w-5 h-5 text-plutus-400 flex-shrink-0 mt-0.5"}),a.jsxs("div",{className:"text-sm text-plutus-200",children:[a.jsx("p",{className:"font-medium mb-1",children:"How guardrails work"}),a.jsx("p",{className:"text-plutus-300/80",children:"Choose a tier to set the baseline permissions, then fine-tune individual tools below. Higher tiers give the AI more autonomy. Every action is logged to the audit trail regardless of tier."})]})]}),a.jsxs("div",{className:"card",children:[a.jsxs("h3",{className:"text-sm font-semibold text-gray-300 mb-4 flex items-center gap-2",children:[a.jsx(bn,{className:"w-4 h-4 text-plutus-400"}),"Access Tier"]}),a.jsx(O3,{tiers:s,currentTier:n,onSelect:p})]}),a.jsxs("div",{className:"card",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Tool Permissions"}),a.jsxs("p",{className:"text-xs text-gray-500 mb-4",children:["Override the default permissions for the ",a.jsx("strong",{className:"text-gray-400 capitalize",children:n})," tier. These overrides take priority over tier defaults."]}),a.jsx("div",{className:"space-y-3",children:u.map(g=>{const v=y==null?void 0:y.tools[g.name],j=f[g.name];return a.jsx(R3,{toolName:g.name,description:g.description,defaultPermission:(v==null?void 0:v.permission)||"denied",override:j,onOverride:(k,R)=>h(g.name,k,R)},g.name)})})]})]})}const $x=[{id:"anthropic",label:"Anthropic",sublabel:"Claude",icon:"A",color:"from-orange-500 to-amber-600"},{id:"openai",label:"OpenAI",sublabel:"GPT",icon:"O",color:"from-emerald-500 to-teal-600"},{id:"ollama",label:"Ollama",sublabel:"Local",icon:"L",color:"from-blue-500 to-indigo-600"},{id:"custom",label:"Custom",sublabel:"Endpoint",icon:"C",color:"from-gray-500 to-gray-600"}],U3={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY",ollama:"",custom:"API_KEY"},Qx={anthropic:[{id:"claude-opus-4-6",label:"Claude Opus 4-6",desc:"Most capable — complex reasoning & analysis"},{id:"claude-sonnet-4-6",label:"Claude Sonnet 4-6",desc:"Balanced — great for most tasks"},{id:"claude-haiku-4-5",label:"Claude Haiku 4-5",desc:"Fast & efficient — simple tasks"}],openai:[{id:"gpt-5.2",label:"GPT-5.2",desc:"Latest flagship model"},{id:"gpt-5",label:"GPT-5",desc:"Previous generation flagship"},{id:"gpt-4.1",label:"GPT-4.1",desc:"Reliable general purpose"},{id:"gpt-4.1-mini",label:"GPT-4.1 Mini",desc:"Fast & affordable"},{id:"o3",label:"o3",desc:"Advanced reasoning"},{id:"o4-mini",label:"o4-mini",desc:"Fast reasoning"}],ollama:[{id:"llama3.2",label:"Llama 3.2",desc:"Meta's open model"},{id:"mistral",label:"Mistral",desc:"Efficient open model"},{id:"codellama",label:"Code Llama",desc:"Optimized for code"},{id:"phi3",label:"Phi-3",desc:"Microsoft's compact model"}]};function H3({config:n,onSave:r,saving:s,keyStatus:o,onKeyStatusChange:u}){var ee;const[d,f]=D.useState(n.provider||"anthropic"),[x,p]=D.useState(n.model||""),[h,y]=D.useState(n.base_url||""),[g,v]=D.useState(n.temperature??.7),[j,k]=D.useState(n.max_tokens??4096),[R,S]=D.useState(""),[T,V]=D.useState(""),[H,I]=D.useState(!1),[z,U]=D.useState(!1),[$,fe]=D.useState(!1),J=o[d]??!1,M=d!=="ollama",ne=Qx[d]||[];ne.find(A=>A.id===x);const re=()=>{const A=U3[d]||"API_KEY";r({provider:d,model:x||R,api_key_env:A,base_url:h||null,temperature:g,max_tokens:j})},Z=async()=>{if(T.trim()){U(!0),fe(!1);try{const A=await de.setKey(d,T.trim());fe(!0),V(""),I(!1),u(),A.key_configured&&Qe.getState().setKeyConfigured(!0),setTimeout(()=>fe(!1),3e3)}catch(A){console.error("Failed to save key:",A)}finally{U(!1)}}},Q=async()=>{try{await de.deleteKey(d),u()}catch(A){console.error("Failed to delete key:",A)}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-plutus-500/10 flex items-center justify-center",children:a.jsx(an,{className:"w-5 h-5 text-plutus-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Coordinator Model"}),a.jsx("p",{className:"text-xs text-gray-500",children:"The main AI brain that talks to you and orchestrates workers"})]}),J&&M&&a.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400 bg-emerald-500/10 px-2.5 py-1 rounded-full",children:[a.jsx(qe,{className:"w-3 h-3"}),"Connected"]}),!J&&M&&a.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-amber-400 bg-amber-500/10 px-2.5 py-1 rounded-full",children:[a.jsx(Yl,{className:"w-3 h-3"}),"Key needed"]})]}),a.jsxs("div",{className:"mb-5",children:[a.jsx("label",{className:"text-xs text-gray-500 mb-2 block",children:"Provider"}),a.jsx("div",{className:"grid grid-cols-4 gap-2",children:$x.map(A=>a.jsxs("button",{onClick:()=>{f(A.id);const O=Qx[A.id];O!=null&&O.length&&p(O[0].id),V(""),fe(!1)},className:`relative flex flex-col items-center gap-1.5 p-3 rounded-xl border transition-all ${d===A.id?"border-plutus-500/50 bg-plutus-500/5 shadow-sm shadow-plutus-500/10":"border-gray-800/60 bg-gray-800/20 hover:border-gray-700/60 hover:bg-gray-800/40"}`,children:[a.jsx("div",{className:`w-8 h-8 rounded-lg bg-gradient-to-br ${A.color} flex items-center justify-center text-white text-xs font-bold shadow-sm`,children:A.icon}),a.jsx("span",{className:"text-xs font-medium text-gray-300",children:A.label}),a.jsx("span",{className:"text-[10px] text-gray-500",children:A.sublabel}),d===A.id&&a.jsx("div",{className:"absolute -top-px -right-px w-3 h-3 bg-plutus-500 rounded-full rounded-tl-none border-2 border-[#1a1a2e]"})]},A.id))})]}),a.jsxs("div",{className:"mb-5",children:[a.jsx("label",{className:"text-xs text-gray-500 mb-2 block",children:"Model"}),ne.length>0?a.jsxs("div",{className:"space-y-1.5",children:[ne.map(A=>a.jsxs("button",{onClick:()=>{p(A.id),S("")},className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-all text-left ${x===A.id?"border-plutus-500/40 bg-plutus-500/5":"border-gray-800/40 bg-gray-800/20 hover:border-gray-700/40"}`,children:[a.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${x===A.id?"bg-plutus-400":"bg-gray-600"}`}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("span",{className:"text-sm font-medium text-gray-200",children:A.label}),a.jsx("span",{className:"text-xs text-gray-500 ml-2",children:A.desc})]}),a.jsx("span",{className:"text-[10px] text-gray-600 font-mono shrink-0",children:A.id})]},A.id)),a.jsxs("button",{onClick:()=>{p("")},className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-all text-left ${x===""?"border-plutus-500/40 bg-plutus-500/5":"border-gray-800/40 bg-gray-800/20 hover:border-gray-700/40"}`,children:[a.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${x===""?"bg-plutus-400":"bg-gray-600"}`}),a.jsx("span",{className:"text-sm text-gray-400",children:"Custom model..."})]}),x===""&&a.jsx("input",{type:"text",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20 ml-5",value:R,onChange:A=>S(A.target.value),placeholder:"Enter custom model name"})]}):a.jsx("input",{type:"text",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:x||R,onChange:A=>{p(A.target.value),S(A.target.value)},placeholder:"Enter model name"})]}),(d==="custom"||d==="ollama")&&a.jsxs("div",{className:"mb-5",children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1.5 block",children:"Base URL"}),a.jsx("input",{type:"text",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:h,onChange:A=>y(A.target.value),placeholder:d==="ollama"?"http://localhost:11434":"https://your-api-endpoint.com/v1"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-5",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[a.jsx("label",{className:"text-xs text-gray-500",children:"Temperature"}),a.jsx("span",{className:"text-xs font-mono text-gray-400",children:g})]}),a.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:g,onChange:A=>v(parseFloat(A.target.value)),className:"w-full accent-plutus-500 h-1.5 rounded-full"}),a.jsxs("div",{className:"flex justify-between text-[9px] text-gray-600 mt-1",children:[a.jsx("span",{children:"Precise"}),a.jsx("span",{children:"Creative"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1.5 block",children:"Max Tokens"}),a.jsx("input",{type:"number",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:j,onChange:A=>k(parseInt(A.target.value)||4096)})]})]}),a.jsxs("button",{onClick:re,disabled:s,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg bg-plutus-600 hover:bg-plutus-500 disabled:opacity-50 text-white text-sm font-medium transition-colors",children:[a.jsx(yp,{className:"w-4 h-4"}),s?"Saving...":"Save Model Settings"]})]}),M&&a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-amber-500/10 flex items-center justify-center",children:a.jsx(ss,{className:"w-5 h-5 text-amber-400"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"API Key"}),a.jsx("p",{className:"text-xs text-gray-500",children:J?"Your key is securely stored":`Required for ${(ee=$x.find(A=>A.id===d))==null?void 0:ee.label}`})]}),J&&a.jsxs("button",{onClick:Q,className:"flex items-center gap-1.5 text-xs text-red-400 hover:text-red-300 bg-red-500/10 hover:bg-red-500/15 px-2.5 py-1.5 rounded-lg transition-colors",children:[a.jsx(Za,{className:"w-3 h-3"}),"Remove"]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx("input",{type:H?"text":"password",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2.5 pr-10 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:T,onChange:A=>V(A.target.value),placeholder:J?"Enter new key to update...":"sk-...",onKeyDown:A=>{A.key==="Enter"&&Z()}}),a.jsx("button",{onClick:()=>I(!H),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 p-0.5",children:H?a.jsx(ud,{className:"w-4 h-4"}):a.jsx(Ql,{className:"w-4 h-4"})})]}),a.jsxs("button",{onClick:Z,disabled:z||!T.trim(),className:"flex items-center gap-1.5 px-4 py-2.5 rounded-lg bg-amber-600 hover:bg-amber-500 disabled:opacity-50 disabled:hover:bg-amber-600 text-white text-sm font-medium transition-colors whitespace-nowrap",children:[a.jsx(ss,{className:"w-4 h-4"}),z?"...":"Save"]})]}),$&&a.jsxs("p",{className:"text-xs text-emerald-400 mt-2 flex items-center gap-1.5",children:[a.jsx(qe,{className:"w-3.5 h-3.5"}),"API key saved securely"]}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-3",children:"Stored locally at ~/.plutus/.secrets.json — never leaves your machine."})]})]})}function B3({config:n,onSave:r,saving:s}){const[o,u]=D.useState(null),[d,f]=D.useState(n.enabled??!1),[x,p]=D.useState(n.interval_seconds??300),[h,y]=D.useState(n.max_consecutive??50),[g,v]=D.useState(n.quiet_hours_start??""),[j,k]=D.useState(n.quiet_hours_end??""),[R,S]=D.useState(n.prompt??""),[T,V]=D.useState(!1),H=()=>{de.getHeartbeatStatus().then($=>u($)).catch(()=>{})};D.useEffect(()=>{H();const $=window.setInterval(H,5e3);return()=>window.clearInterval($)},[]);const I=async()=>{try{if(o!=null&&o.running){const $=await de.stopHeartbeat();u($),f(!1)}else{const $=await de.startHeartbeat();u($),f(!0)}}catch($){console.error("Failed to toggle heartbeat:",$)}},z=()=>{r({heartbeat:{enabled:d,interval_seconds:x,max_consecutive:h,quiet_hours_start:g||null,quiet_hours_end:j||null,prompt:R||""}}),de.updateHeartbeat({enabled:d,interval_seconds:x,max_consecutive:h,quiet_hours_start:g||null,quiet_hours_end:j||null,prompt:R||""}).then($=>u($)).catch(()=>{})},U=$=>$<60?`${$}s`:$<3600?`${Math.floor($/60)}m`:`${Math.floor($/3600)}h ${Math.floor($%3600/60)}m`;return a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-rose-500/10 flex items-center justify-center",children:a.jsx(Ji,{className:"w-5 h-5 text-rose-400"})}),a.jsxs("div",{children:[a.jsxs("h3",{className:"text-sm font-semibold text-gray-200 flex items-center gap-2",children:["Heartbeat",(o==null?void 0:o.running)&&!(o!=null&&o.paused)&&a.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400 font-normal bg-emerald-500/10 px-2 py-0.5 rounded-full",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),"Active"]}),(o==null?void 0:o.paused)&&a.jsx("span",{className:"text-xs text-amber-400 font-normal bg-amber-500/10 px-2 py-0.5 rounded-full",children:"Paused"}),o&&!o.running&&!o.paused&&a.jsx("span",{className:"text-xs text-gray-500 font-normal bg-gray-500/10 px-2 py-0.5 rounded-full",children:"Off"})]}),a.jsx("p",{className:"text-xs text-gray-500",children:"Autonomous wake-up for continuous task execution"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>V(!T),className:"text-xs text-gray-500 hover:text-gray-300 px-2 py-1 rounded transition-colors",children:T?"Collapse":"Configure"}),a.jsx("button",{onClick:I,className:`flex items-center gap-1.5 text-xs px-3 py-1.5 rounded-lg border transition-colors ${o!=null&&o.running?"border-red-500/30 bg-red-500/10 text-red-400 hover:bg-red-500/20":"border-emerald-500/30 bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20"}`,children:o!=null&&o.running?a.jsxs(a.Fragment,{children:[a.jsx(Pi,{className:"w-3 h-3"})," Stop"]}):a.jsxs(a.Fragment,{children:[a.jsx(Fa,{className:"w-3 h-3"})," Start"]})})]})]}),(o==null?void 0:o.running)&&a.jsxs("div",{className:"mt-4 bg-gray-800/40 rounded-lg p-3 flex items-center gap-5 text-xs text-gray-400",children:[a.jsxs("span",{children:["Beats: ",a.jsx("span",{className:"text-gray-200 font-medium",children:o.consecutive_beats}),a.jsxs("span",{className:"text-gray-600",children:["/",o.max_consecutive]})]}),a.jsxs("span",{children:["Interval: ",a.jsx("span",{className:"text-gray-200 font-medium",children:U(o.interval_seconds)})]}),o.quiet_hours_start&&o.quiet_hours_end&&a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Fu,{className:"w-3 h-3"}),"Quiet: ",o.quiet_hours_start," – ",o.quiet_hours_end]})]}),T&&a.jsxs("div",{className:"mt-5 pt-5 border-t border-gray-800/40 space-y-5",children:[a.jsxs("div",{className:"bg-gray-800/30 rounded-lg p-3 flex gap-2.5",children:[a.jsx(Qa,{className:"w-4 h-4 text-gray-500 shrink-0 mt-0.5"}),a.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:"The heartbeat periodically wakes Plutus so it can continue working on tasks autonomously. Each beat sends a check-in that lets the agent review its plan and pick up where it left off."})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("label",{className:"text-xs text-gray-500 flex items-center gap-1.5",children:[a.jsx(Gn,{className:"w-3 h-3"}),"Wake-up interval"]}),a.jsx("span",{className:"text-xs font-mono text-plutus-400 bg-plutus-500/10 px-2 py-0.5 rounded-md",children:U(x)})]}),a.jsx("input",{type:"range",min:"30",max:"3600",step:"30",value:x,onChange:$=>p(parseInt($.target.value)),className:"w-full accent-plutus-500 h-2 rounded-full"}),a.jsxs("div",{className:"flex justify-between text-[10px] text-gray-600 mt-1.5 px-0.5",children:[a.jsx("span",{children:"30s"}),a.jsx("span",{children:"5m"}),a.jsx("span",{children:"15m"}),a.jsx("span",{children:"30m"}),a.jsx("span",{children:"1h"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1.5 block",children:"Max consecutive beats (safety limit)"}),a.jsx("input",{type:"number",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:h,min:1,max:1e3,onChange:$=>y(parseInt($.target.value)||50)}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Auto-pauses after this many beats with no user interaction."})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"text-xs text-gray-500 mb-2 block flex items-center gap-1.5",children:[a.jsx(Fu,{className:"w-3 h-3"}),"Quiet hours (optional)"]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] text-gray-600 mb-1 block",children:"Start"}),a.jsx("input",{type:"time",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:g,onChange:$=>v($.target.value),placeholder:"23:00"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] text-gray-600 mb-1 block",children:"End"}),a.jsx("input",{type:"time",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:j,onChange:$=>k($.target.value),placeholder:"07:00"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1.5 block",children:"Custom heartbeat prompt (optional)"}),a.jsx("textarea",{className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20 min-h-[60px] resize-y",value:R,onChange:$=>S($.target.value),placeholder:"Leave empty for default: review plan and continue working...",rows:2})]}),a.jsxs("button",{onClick:z,disabled:s,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg bg-plutus-600 hover:bg-plutus-500 disabled:opacity-50 text-white text-sm font-medium transition-colors",children:[a.jsx(yp,{className:"w-4 h-4"}),s?"Saving...":"Save Heartbeat Settings"]})]})]})}function q3(){var v,j,k,R,S,T,V,H,I;const[n,r]=D.useState(null),[s,o]=D.useState(!1),[u,d]=D.useState(!1),[f,x]=D.useState({}),[p,h]=D.useState(null),y=D.useCallback(()=>{de.getKeyStatus().then(z=>{x(z.providers||{}),Qe.getState().setKeyConfigured(z.current_provider_configured)}).catch(()=>{})},[]);D.useEffect(()=>{de.getConfig().then(r).catch(()=>{}),y(),de.getKeepAliveStatus().then(z=>h(z)).catch(()=>{})},[y]);const g=async z=>{o(!0),d(!1);try{await de.updateConfig(z),d(!0);const U=await de.getConfig();r(U),setTimeout(()=>d(!1),2500)}catch(U){console.error("Failed to save:",U)}finally{o(!1)}};return n?a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsxs("div",{className:"max-w-3xl mx-auto p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-gray-100",children:"Settings"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Configure your AI provider, model, and system preferences"})]}),u&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-3 py-1.5 rounded-lg animate-fade-in",children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Saved"]})]}),a.jsx(V3,{}),a.jsx(H3,{config:n.model||{},onSave:z=>g({model:z}),saving:s,keyStatus:f,onKeyStatusChange:y}),a.jsx(B3,{config:n.heartbeat||{},onSave:g,saving:s}),a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-purple-500/10 flex items-center justify-center",children:a.jsx(tp,{className:"w-5 h-5 text-purple-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Agent Behavior"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Control how the coordinator processes tasks"})]})]}),a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("label",{className:"text-sm text-gray-300",children:"Max Tool Rounds"}),a.jsx("span",{className:"text-sm font-mono text-plutus-400 bg-plutus-500/10 px-2.5 py-0.5 rounded-md",children:((v=n.agent)==null?void 0:v.max_tool_rounds)||25})]}),a.jsx("input",{type:"range",min:"5",max:"100",step:"5",className:"w-full accent-plutus-500 h-2 rounded-full",defaultValue:((j=n.agent)==null?void 0:j.max_tool_rounds)||25,onChange:z=>g({agent:{max_tool_rounds:parseInt(z.target.value)||25}})}),a.jsxs("div",{className:"flex justify-between text-[10px] text-gray-600 mt-1.5 px-0.5",children:[a.jsx("span",{children:"5"}),a.jsx("span",{children:"25"}),a.jsx("span",{children:"50"}),a.jsx("span",{children:"75"}),a.jsx("span",{children:"100"})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Maximum tool calls (browser, shell, etc.) per message before the agent pauses."})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-t border-gray-800/40",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-300",children:"Scheduler"}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"Allow Plutus to create and run cron jobs"})]}),a.jsx("button",{onClick:()=>{var z;return g({scheduler:{enabled:!(((z=n.scheduler)==null?void 0:z.enabled)??!0)}})},className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors duration-200 ${((k=n.scheduler)==null?void 0:k.enabled)!==!1?"bg-plutus-500":"bg-gray-700"}`,children:a.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform duration-200 ${((R=n.scheduler)==null?void 0:R.enabled)!==!1?"translate-x-6":"translate-x-1"}`})})]}),a.jsxs("div",{className:"flex items-center justify-between py-3 border-t border-gray-800/40",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-emerald-500/10 flex items-center justify-center",children:a.jsx(m1,{className:"w-5 h-5 text-emerald-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-300",children:"Keep Alive"}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"Prevent system sleep while Plutus is running"}),(p==null?void 0:p.active)&&a.jsxs("p",{className:"text-[10px] text-emerald-400 mt-0.5",children:["Active on ",p.platform]})]})]}),a.jsx("button",{onClick:async()=>{const z=!((p==null?void 0:p.enabled)??!1);try{const U=await de.setKeepAlive(z);h(U)}catch(U){console.error("Failed to toggle keep-alive:",U)}},className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors duration-200 ${p!=null&&p.enabled?"bg-emerald-500":"bg-gray-700"}`,children:a.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform duration-200 ${p!=null&&p.enabled?"translate-x-6":"translate-x-1"}`})})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-500/10 flex items-center justify-center",children:a.jsx(bp,{className:"w-5 h-5 text-blue-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Gateway"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Network settings"})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1 block",children:"Host"}),a.jsx("div",{className:"bg-gray-800/50 rounded-lg px-3 py-2 text-sm text-gray-400 font-mono",children:((S=n.gateway)==null?void 0:S.host)||"127.0.0.1"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1 block",children:"Port"}),a.jsx("div",{className:"bg-gray-800/50 rounded-lg px-3 py-2 text-sm text-gray-400 font-mono",children:((T=n.gateway)==null?void 0:T.port)||7777})]}),a.jsxs("div",{className:"flex items-start gap-1.5 pt-1",children:[a.jsx(Qa,{className:"w-3 h-3 text-gray-600 mt-0.5 shrink-0"}),a.jsx("p",{className:"text-[10px] text-gray-600",children:"Restart Plutus to change these values"})]})]})]}),a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-amber-500/10 flex items-center justify-center",children:a.jsx(ip,{className:"w-5 h-5 text-amber-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Memory"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Context & history"})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1 block",children:"Context Window"}),a.jsx("input",{type:"number",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",defaultValue:((V=n.memory)==null?void 0:V.context_window_messages)||20,onChange:z=>g({memory:{context_window_messages:parseInt(z.target.value)||20}})}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Messages kept in active context"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1 block",children:"Max History"}),a.jsx("input",{type:"number",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",defaultValue:((H=n.memory)==null?void 0:H.max_conversation_history)||100,onChange:z=>g({memory:{max_conversation_history:parseInt(z.target.value)||100}})}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Total messages stored per conversation"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500 mb-1 block",children:"Auto-Delete After (days)"}),a.jsx("input",{type:"number",min:"0",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-lg px-3 py-2 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",defaultValue:((I=n.memory)==null?void 0:I.conversation_auto_delete_days)??30,onChange:z=>g({memory:{conversation_auto_delete_days:parseInt(z.target.value)||0}})}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Conversations with no activity for this many days are automatically deleted. Set to 0 to disable."})]})]})]})]})]})}):a.jsx("div",{className:"h-full flex items-center justify-center",children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 border-2 border-plutus-500/30 border-t-plutus-500 rounded-full animate-spin"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Loading settings..."})]})})}const Y3=[{value:"light",label:"Light",icon:Np,description:"Always use light theme"},{value:"dark",label:"Dark",icon:Fu,description:"Always use dark theme"},{value:"system",label:"System",icon:Xl,description:"Follow your OS setting"}];function V3(){const{theme:n,setTheme:r}=Qe(),s=o=>{r(o),Xu(o)};return a.jsxs("div",{className:"bg-surface rounded-xl border border-gray-800/60 p-5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[a.jsx("div",{className:"w-9 h-9 rounded-lg bg-plutus-500/10 flex items-center justify-center",children:a.jsx(Np,{className:"w-5 h-5 text-plutus-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Appearance"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Choose your preferred color theme"})]})]}),a.jsx("div",{className:"grid grid-cols-3 gap-3",children:Y3.map(o=>{const u=o.icon,d=n===o.value;return a.jsxs("button",{onClick:()=>s(o.value),className:`flex flex-col items-center gap-2.5 p-4 rounded-xl border transition-all duration-150 ${d?"border-plutus-500/40 bg-plutus-500/10 ring-1 ring-plutus-500/20":"border-gray-800/60 hover:border-gray-700 hover:bg-gray-800/40"}`,children:[a.jsx(u,{className:`w-5 h-5 ${d?"text-plutus-400":"text-gray-500"}`}),a.jsxs("div",{className:"text-center",children:[a.jsx("span",{className:`text-xs font-medium block ${d?"text-gray-100":"text-gray-400"}`,children:o.label}),a.jsx("span",{className:"text-[10px] text-gray-500 mt-0.5 block",children:o.description})]})]},o.value)})})]})}function _g(n,r=[]){const[s,o]=D.useState(null),[u,d]=D.useState(!0),[f,x]=D.useState(null),p=D.useCallback(async()=>{d(!0),x(null);try{const h=await n();o(h)}catch(h){x(h instanceof Error?h.message:"Unknown error")}finally{d(!1)}},r);return D.useEffect(()=>{p()},[p]),{data:s,loading:u,error:f,refetch:p}}const Xx={terminal:rn,code:Ki,cpu:bl,monitor:Xl,puzzle:A1},G3={shell:rn,filesystem:up,process:bl,system_info:Qa,code_editor:dd,code_analysis:cp,subprocess:$t,tool_creator:vn,browser:Ii,clipboard:sp,desktop:Xl,app_manager:ep},$3={shell:"Runs commands on your computer, like installing software or running scripts.",filesystem:"Reads, writes, and manages files and folders on your system.",process:"Shows what programs are running and can start or stop them.",system_info:"Checks your computer's health — CPU, memory, disk space, and more.",code_editor:"Creates and edits code files with smart find-and-replace editing.",code_analysis:"Analyzes code to find functions, classes, complexity, and potential issues.",subprocess:"Runs multiple tasks at the same time in isolated processes.",tool_creator:"Creates brand new tools on the fly when the AI needs a new capability.",browser:"Opens websites, fills forms, clicks buttons — like a virtual web assistant.",clipboard:"Reads and writes to your clipboard (copy/paste).",desktop:"Interacts with desktop windows and applications.",app_manager:"Installs, updates, and manages applications on your system."},Q3={core:"from-blue-500/20 to-blue-600/10 border-blue-500/30",code:"from-emerald-500/20 to-emerald-600/10 border-emerald-500/30",subprocess:"from-purple-500/20 to-purple-600/10 border-purple-500/30",desktop:"from-amber-500/20 to-amber-600/10 border-amber-500/30",custom:"from-pink-500/20 to-pink-600/10 border-pink-500/30"},sd={core:"text-blue-400",code:"text-emerald-400",subprocess:"text-purple-400",desktop:"text-amber-400",custom:"text-pink-400"};function X3({tool:n,category:r}){var x,p,h,y;const[s,o]=D.useState(!1),u=G3[n.name]||vn,d=sd[r]||"text-gray-400",f=$3[n.name];return a.jsxs("div",{className:`card hover:border-gray-700 transition-all duration-200 cursor-pointer ${s?"ring-1 ring-gray-700":""}`,onClick:()=>o(!s),children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0 bg-gradient-to-br ${Q3[r]}`,children:a.jsx(u,{className:`w-5 h-5 ${d}`})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:n.name.replace(/_/g," ").replace(/\b\w/g,g=>g.toUpperCase())}),a.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full ${d} bg-gray-800`,children:r})]}),a.jsx("p",{className:"text-xs text-gray-400 mt-1 line-clamp-2",children:f||n.description})]}),a.jsx("button",{className:"text-gray-500 hover:text-gray-300 p-1",children:s?a.jsx(ap,{className:"w-4 h-4"}):a.jsx($l,{className:"w-4 h-4"})})]}),s&&a.jsx("div",{className:"mt-4 pt-3 border-t border-gray-800 animate-fade-in",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"What it does"}),a.jsx("p",{className:"text-xs text-gray-300",children:n.description})]}),((x=n.parameters)==null?void 0:x.properties)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Available Options"}),a.jsx("div",{className:"space-y-1.5",children:Object.entries(n.parameters.properties).map(([g,v])=>a.jsxs("div",{className:"flex items-start gap-2 bg-gray-800/50 rounded-lg px-3 py-2",children:[a.jsx("code",{className:"text-[11px] text-plutus-400 font-mono flex-shrink-0",children:g}),a.jsx("span",{className:"text-[11px] text-gray-400",children:v.description||v.type||"—"})]},g))})]}),((y=(h=(p=n.parameters)==null?void 0:p.properties)==null?void 0:h.operation)==null?void 0:y.enum)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Operations"}),a.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.parameters.properties.operation.enum.map(g=>a.jsx("span",{className:`text-[10px] px-2 py-1 rounded-md bg-gray-800 ${d}`,children:g},g))})]})]})})]})}function F3(){const{data:n,loading:r,error:s,refetch:o}=_g(()=>de.getToolsDetails(),[]),[u,d]=D.useState(""),[f,x]=D.useState(null);if(r)return a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsxs("div",{className:"flex items-center gap-3 text-gray-400",children:[a.jsx(Va,{className:"w-5 h-5 animate-spin"}),a.jsx("span",{children:"Loading tools..."})]})});if(s)return a.jsxs("div",{className:"card text-center py-8",children:[a.jsx("p",{className:"text-red-400 mb-2",children:"Failed to load tools"}),a.jsx("p",{className:"text-xs text-gray-500",children:s}),a.jsx("button",{onClick:o,className:"btn-primary mt-4 text-sm",children:"Retry"})]});const p=(n==null?void 0:n.categories)||{},h=(n==null?void 0:n.total)||0,y=Object.entries(p).reduce((g,[v,j])=>{if(!j.tools||j.tools.length===0)return g;const k=j.tools.filter(R=>R.name.toLowerCase().includes(u.toLowerCase())||R.description.toLowerCase().includes(u.toLowerCase()));return k.length>0&&(g[v]={...j,tools:k}),g},{});return a.jsxs("div",{className:"h-full overflow-y-auto space-y-6 max-w-4xl mx-auto",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-100",children:"Tools"}),a.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"These are all the capabilities your AI agent has. Each tool lets it perform specific actions on your computer."})]}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-3",children:Object.entries(p).map(([g,v])=>{var R;const j=Xx[v.icon]||vn,k=sd[g]||"text-gray-400";return a.jsxs("button",{onClick:()=>x(f===g?null:g),className:`card flex items-center gap-3 hover:border-gray-700 transition-all ${f===g?"ring-1 ring-plutus-500/50":""}`,children:[a.jsx(j,{className:`w-5 h-5 ${k}`}),a.jsxs("div",{className:"text-left",children:[a.jsx("p",{className:"text-lg font-bold text-gray-200",children:((R=v.tools)==null?void 0:R.length)||0}),a.jsx("p",{className:"text-[10px] text-gray-500",children:v.label})]})]},g)})}),a.jsxs("div",{className:"relative",children:[a.jsx(os,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),a.jsx("input",{type:"text",placeholder:"Search tools... (e.g., 'edit files', 'analyze code')",value:u,onChange:g=>d(g.target.value),className:"input pl-10"})]}),Object.entries(y).map(([g,v])=>{const j=Xx[v.icon]||vn,k=sd[g]||"text-gray-400",R=f===null||f===g;return a.jsxs("div",{className:R?"":"hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(j,{className:`w-4 h-4 ${k}`}),a.jsx("h2",{className:"text-sm font-semibold text-gray-300",children:v.label}),a.jsxs("span",{className:"text-xs text-gray-500",children:["— ",v.description]}),a.jsxs("span",{className:"text-xs text-gray-600 ml-auto",children:[v.tools.length," tool",v.tools.length!==1?"s":""]})]}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:v.tools.map(S=>a.jsx(X3,{tool:S,category:g},S.name))})]},g)}),Object.keys(y).length===0&&a.jsxs("div",{className:"card text-center py-12",children:[a.jsx(os,{className:"w-8 h-8 text-gray-600 mx-auto mb-3"}),a.jsx("p",{className:"text-gray-400",children:"No tools match your search."}),a.jsx("button",{onClick:()=>d(""),className:"text-plutus-400 text-sm mt-2 hover:underline",children:"Clear search"})]}),a.jsxs("div",{className:"text-center text-xs text-gray-600 pb-4",children:[h," tools available · Tools are used automatically by the AI during conversations"]})]})}function hs({status:n}){const r={running:{color:"text-blue-400",bg:"bg-blue-500/10 border border-blue-500/20",label:"Running",pulse:!0},completed:{color:"text-emerald-400",bg:"bg-emerald-500/10 border border-emerald-500/20",label:"Completed"},failed:{color:"text-red-400",bg:"bg-red-500/10 border border-red-500/20",label:"Failed"},cancelled:{color:"text-gray-400",bg:"bg-gray-500/10 border border-gray-500/20",label:"Cancelled"},queued:{color:"text-amber-400",bg:"bg-amber-500/10 border border-amber-500/20",label:"Queued"},timeout:{color:"text-orange-400",bg:"bg-orange-500/10 border border-orange-500/20",label:"Timeout"},active:{color:"text-blue-400",bg:"bg-blue-500/10 border border-blue-500/20",label:"Active",pulse:!0},paused:{color:"text-amber-400",bg:"bg-amber-500/10 border border-amber-500/20",label:"Paused"},idle:{color:"text-gray-400",bg:"bg-gray-500/10 border border-gray-500/20",label:"Idle"}},s=r[n]||r.idle;return a.jsxs("span",{className:`inline-flex items-center gap-1.5 text-[11px] font-medium px-2.5 py-1 rounded-lg ${s.bg} ${s.color}`,children:[s.pulse&&a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current animate-pulse"}),s.label]})}function gl({icon:n,label:r,value:s,color:o}){const u={blue:"bg-blue-500/10 text-blue-400 border-blue-500/20",emerald:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",red:"bg-red-500/10 text-red-400 border-red-500/20",purple:"bg-purple-500/10 text-purple-400 border-purple-500/20",amber:"bg-amber-500/10 text-amber-400 border-amber-500/20",cyan:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20"};return a.jsxs("div",{className:"bg-surface-alt border border-gray-800/50 rounded-xl p-4 flex items-center gap-3.5",children:[a.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center border ${u[o]}`,children:a.jsx(n,{className:"w-5 h-5"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-bold text-gray-100 leading-none",children:s}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-1",children:r})]})]})}function Gi({icon:n,title:r,count:s,pulse:o,action:u}){return a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsxs("div",{className:"relative",children:[a.jsx(n,{className:"w-4 h-4 text-gray-400"}),o&&s&&s>0&&a.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-blue-400 animate-ping"})]}),a.jsx("h2",{className:"text-sm font-semibold text-gray-300",children:r}),s!==void 0&&a.jsx("span",{className:"text-[10px] text-gray-500 bg-gray-800/60 px-2 py-0.5 rounded-full font-medium",children:s})]}),u]})}function id({icon:n,text:r,sub:s}){return a.jsxs("div",{className:"bg-surface-alt border border-gray-800/40 border-dashed rounded-xl text-center py-12",children:[a.jsx(n,{className:"w-8 h-8 text-gray-700 mx-auto mb-3"}),a.jsx("p",{className:"text-sm text-gray-500",children:r}),s&&a.jsx("p",{className:"text-xs text-gray-600 mt-2 max-w-sm mx-auto leading-relaxed",children:s})]})}function Tg({text:n}){return a.jsx("div",{className:"flex items-center justify-center h-48",children:a.jsxs("div",{className:"flex items-center gap-3 text-gray-400",children:[a.jsx(Va,{className:"w-5 h-5 animate-spin"}),a.jsx("span",{className:"text-sm",children:n})]})})}function zd(n){return!n||n<.001?"—":n<1?`${Math.round(n*1e3)}ms`:n<60?`${n.toFixed(1)}s`:n<3600?`${Math.floor(n/60)}m ${Math.round(n%60)}s`:`${Math.floor(n/3600)}h ${Math.floor(n%3600/60)}m`}function Gu(n){return n?new Date(typeof n=="number"?n*1e3:n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"—"}function yl(n){if(!n)return"—";const r=new Date(typeof n=="number"?n*1e3:n),s=new Date;if(r.toDateString()===s.toDateString())return`Today ${Gu(n)}`;const u=new Date(s);return u.setDate(u.getDate()-1),r.toDateString()===u.toDateString()?`Yesterday ${Gu(n)}`:r.toLocaleDateString([],{month:"short",day:"numeric"})+" "+Gu(n)}function Od(n){return n?{"claude-opus":"Opus","claude-sonnet":"Sonnet","claude-haiku":"Haiku","gpt-5.2":"GPT-5.2"}[n]||n:"Auto"}function Dd(n){return n?n.includes("opus")?"text-purple-400":n.includes("sonnet")?"text-blue-400":n.includes("haiku")?"text-emerald-400":n.includes("gpt")?"text-cyan-400":"text-gray-400":"text-gray-400"}function Fx({active:n,onClick:r,icon:s,label:o,badge:u}){return a.jsxs("button",{onClick:r,className:`flex items-center justify-center gap-2 px-5 py-2.5 text-sm font-medium rounded-xl transition-all duration-200 min-w-[160px] ${n?"bg-blue-500/15 text-blue-400 border border-blue-500/30 shadow-lg shadow-blue-500/5":"text-gray-500 hover:text-gray-300 hover:bg-gray-800/40 border border-transparent"}`,children:[a.jsx(s,{className:"w-4 h-4"}),o,u!==void 0&&u>0&&a.jsx("span",{className:"text-[10px] bg-blue-500/20 text-blue-400 px-1.5 py-0.5 rounded-full min-w-[18px] text-center font-bold",children:u})]})}function Z3(){const[n,r]=D.useState(null),[s,o]=D.useState(null),[u,d]=D.useState(!0),[f,x]=D.useState(!0),[p,h]=D.useState(5),[y,g]=D.useState(!1),v=D.useCallback(async()=>{var J;try{const[M,ne]=await Promise.all([de.getWorkers(),de.getModelRouting().catch(()=>null)]);r(M),o(ne),(J=M==null?void 0:M.stats)!=null&&J.max_workers&&h(M.stats.max_workers)}catch{}finally{d(!1)}},[]);D.useEffect(()=>{v()},[v]),D.useEffect(()=>{if(!f)return;const J=setInterval(v,3e3);return()=>clearInterval(J)},[f,v]);const j=async J=>{try{await de.cancelWorker(J),v()}catch{}},k=async J=>{h(J);try{await de.updateWorkerConfig({max_concurrent_workers:J}),v()}catch{}},R=async()=>{var M;const J=((M=s==null?void 0:s.routing)==null?void 0:M.cost_conscious)??!1;try{await de.updateModelRouting({cost_conscious:!J}),v()}catch{}};if(u)return a.jsx(Tg,{text:"Loading workers..."});const S=(n==null?void 0:n.stats)||{},T=Array.isArray(n==null?void 0:n.running)?n.running:[],V=Array.isArray(n==null?void 0:n.queued)?n.queued:[],H=Array.isArray(n==null?void 0:n.completed)?n.completed:[],I=(s==null?void 0:s.routing)||{},z=S.active_count||T.length,U=S.queued_count||V.length,$=S.max_workers||p,fe=$>0?Math.min(z/$*100,100):0;return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[a.jsx(gl,{icon:$t,label:"Active Workers",value:z,color:"blue"}),a.jsx(gl,{icon:Gn,label:"In Queue",value:U,color:"amber"}),a.jsx(gl,{icon:qe,label:"Completed",value:S.total_completed||0,color:"emerald"}),a.jsx(gl,{icon:yn,label:"Failed",value:S.total_failed||0,color:"red"})]}),a.jsxs("div",{className:"bg-surface-alt border border-gray-800/50 rounded-xl p-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsxs("span",{className:"text-sm text-gray-300 flex items-center gap-2",children:[a.jsx(dp,{className:"w-4 h-4 text-blue-400"}),"Worker Capacity"]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"text-sm font-mono text-gray-400",children:[z," ",a.jsx("span",{className:"text-gray-600",children:"/"})," ",$,U>0&&a.jsxs("span",{className:"text-amber-400 ml-2",children:["+",U," queued"]})]}),a.jsx("button",{onClick:()=>g(!y),className:`p-1.5 rounded-lg transition-colors ${y?"bg-blue-500/15 text-blue-400":"text-gray-500 hover:text-gray-300 hover:bg-gray-800/50"}`,title:"Worker settings",children:a.jsx(vp,{className:"w-4 h-4"})})]})]}),a.jsx("div",{className:"w-full bg-gray-800/80 rounded-full h-3 overflow-hidden",children:a.jsx("div",{className:`rounded-full h-3 transition-all duration-700 ease-out ${fe>80?"bg-gradient-to-r from-red-500 to-orange-500":fe>50?"bg-gradient-to-r from-amber-500 to-yellow-500":"bg-gradient-to-r from-blue-500 to-cyan-500"}`,style:{width:`${Math.max(fe,fe>0?4:0)}%`}})}),y&&a.jsxs("div",{className:"mt-5 pt-5 border-t border-gray-800/60 space-y-5",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("label",{className:"text-sm text-gray-300",children:"Maximum Concurrent Workers"}),a.jsx("span",{className:"text-sm font-mono font-bold text-blue-400 bg-blue-500/10 px-2.5 py-1 rounded-lg",children:p})]}),a.jsx("input",{type:"range",min:1,max:20,value:p,onChange:J=>k(Number(J.target.value)),className:`w-full h-2 bg-gray-800 rounded-full appearance-none cursor-pointer
                  [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:h-5
                  [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-blue-500
                  [&::-webkit-slider-thumb]:shadow-lg [&::-webkit-slider-thumb]:shadow-blue-500/30
                  [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:transition-all
                  [&::-webkit-slider-thumb]:hover:bg-blue-400 [&::-webkit-slider-thumb]:hover:scale-110`}),a.jsxs("div",{className:"flex justify-between text-[10px] text-gray-600 mt-1.5 px-0.5",children:[a.jsx("span",{children:"1"}),a.jsx("span",{children:"5"}),a.jsx("span",{children:"10"}),a.jsx("span",{children:"15"}),a.jsx("span",{children:"20"})]}),a.jsx("p",{className:"text-[11px] text-gray-600 mt-2",children:"Controls the maximum number of workers that can run simultaneously. Tasks beyond this limit are automatically queued."})]}),a.jsxs("div",{className:"flex items-center justify-between bg-surface-deep rounded-xl p-4 border border-gray-800/40",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center ${I.cost_conscious?"bg-emerald-500/10 border border-emerald-500/20":"bg-gray-800/50 border border-gray-700/30"}`,children:a.jsx(bn,{className:`w-4 h-4 ${I.cost_conscious?"text-emerald-400":"text-gray-500"}`})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-gray-200",children:"Cost-Conscious Mode"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:I.cost_conscious?"Workers prefer cheaper, faster models to save costs":"Workers use the best model for each task regardless of cost"})]})]}),a.jsx("button",{onClick:R,className:`relative inline-flex items-center h-6 w-11 rounded-full transition-colors duration-300 shrink-0 ml-4 ${I.cost_conscious?"bg-emerald-500":"bg-gray-700"}`,children:a.jsx("span",{className:`inline-block w-4 h-4 rounded-full bg-white shadow-md transition-transform duration-300 ${I.cost_conscious?"translate-x-6":"translate-x-1"}`})})]})]})]}),a.jsxs("div",{children:[a.jsx(Gi,{icon:Pr,title:"Active Tasks",count:z,pulse:z>0}),T.length===0?a.jsxs("div",{className:"bg-surface-alt border border-gray-800/40 border-dashed rounded-xl py-8 text-center",children:[a.jsx(Pr,{className:"w-6 h-6 text-gray-700 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"No active tasks"}),a.jsx("p",{className:"text-[11px] text-gray-600 mt-1",children:"Workers will appear here when Plutus assigns tasks"})]}):a.jsx("div",{className:"space-y-2",children:T.map(J=>a.jsx(K3,{worker:J,onCancel:j},J.task_id||J.id))})]}),V.length>0&&a.jsxs("div",{children:[a.jsx(Gi,{icon:N1,title:"Job Queue",count:U}),a.jsx("div",{className:"bg-surface-alt border border-amber-500/10 rounded-xl overflow-hidden divide-y divide-gray-800/40",children:V.map((J,M)=>a.jsxs("div",{className:"flex items-center gap-3 py-3 px-4",children:[a.jsx("span",{className:"text-[11px] font-mono text-gray-600 w-6 text-center",children:M+1}),a.jsx(Gn,{className:"w-3.5 h-3.5 text-amber-400 shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm text-gray-300 truncate",children:J.name||J.task||J.prompt||J.task_id}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[J.model_key&&a.jsx("span",{className:`text-[10px] font-medium ${Dd(J.model_key)}`,children:Od(J.model_key)}),J.created_at&&a.jsxs("span",{className:"text-[10px] text-gray-600",children:["Queued ",yl(J.created_at)]})]})]}),a.jsx(hs,{status:"queued"}),a.jsx("button",{onClick:()=>j(J.task_id||J.id),className:"p-1.5 rounded-lg text-gray-600 hover:text-red-400 hover:bg-red-500/10 transition-colors shrink-0",title:"Remove from queue",children:a.jsx(yn,{className:"w-3.5 h-3.5"})})]},J.task_id||J.id||M))})]}),a.jsxs("div",{children:[a.jsx(Gi,{icon:ns,title:"Task History",count:H.length}),H.length===0?a.jsx(id,{icon:lp,text:"No completed tasks yet",sub:"Completed worker tasks will appear here with their results, model used, and duration"}):a.jsx("div",{className:"bg-surface-alt border border-gray-800/50 rounded-xl overflow-hidden divide-y divide-gray-800/40",children:H.slice(0,25).map((J,M)=>a.jsx(I3,{task:J},J.task_id||M))})]}),a.jsx("div",{className:"flex justify-center pt-2 pb-4",children:a.jsxs("button",{onClick:()=>x(!f),className:`text-xs px-4 py-2 rounded-xl flex items-center gap-2 transition-all duration-200 ${f?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700/50 hover:text-gray-400"}`,children:[a.jsx(Pr,{className:`w-3.5 h-3.5 ${f?"animate-pulse":""}`}),f?"Live Updates On":"Live Updates Paused"]})})]})}function K3({worker:n,onCancel:r}){const[s,o]=D.useState(!1),u=n.task_id||n.id,d=n.progress_pct||0;return a.jsxs("div",{className:"bg-surface-alt border border-blue-500/20 rounded-xl p-4 shadow-lg shadow-blue-500/5",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"relative shrink-0",children:[a.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-400 animate-pulse"}),a.jsx("div",{className:"absolute inset-0 w-3 h-3 rounded-full bg-blue-400 animate-ping opacity-20"})]}),a.jsxs("div",{className:"flex-1 min-w-0 cursor-pointer",onClick:()=>o(!s),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-gray-200 truncate",children:n.name||n.task||n.prompt||(u==null?void 0:u.slice(0,20))}),a.jsx(hs,{status:"running"})]}),a.jsxs("div",{className:"flex items-center gap-3 mt-1.5 text-[11px] text-gray-500",children:[n.model_used&&a.jsxs("span",{className:`flex items-center gap-1 font-medium ${Dd(n.model_used)}`,children:[a.jsx(an,{className:"w-3 h-3"}),Od(n.model_used)]}),n.current_step&&a.jsx("span",{className:"text-gray-400 truncate max-w-[200px]",children:n.current_step}),n.started_at&&a.jsxs("span",{children:["Started ",yl(n.started_at)]}),n.steps_completed>0&&a.jsxs("span",{children:[n.steps_completed," steps"]})]})]}),a.jsx("button",{onClick:()=>r(u),className:"p-2 rounded-lg text-red-400/60 hover:text-red-400 hover:bg-red-500/10 transition-colors shrink-0",title:"Cancel worker",children:a.jsx(yn,{className:"w-4 h-4"})})]}),d>0&&a.jsxs("div",{className:"mt-3",children:[a.jsx("div",{className:"w-full bg-gray-800/80 rounded-full h-1.5 overflow-hidden",children:a.jsx("div",{className:"rounded-full h-1.5 bg-gradient-to-r from-blue-500 to-cyan-400 transition-all duration-500",style:{width:`${d}%`}})}),a.jsxs("div",{className:"flex justify-between mt-1",children:[a.jsx("span",{className:"text-[10px] text-gray-600",children:n.current_step||"Processing..."}),a.jsxs("span",{className:"text-[10px] text-blue-400 font-mono",children:[d.toFixed(0),"%"]})]})]}),s&&a.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-800/60 text-xs text-gray-400 space-y-1.5",children:[a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Task ID:"})," ",u]}),n.prompt&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Prompt:"})," ",n.prompt]}),n.model_key&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Assigned Model:"})," ",n.model_key]}),n.started_at&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Started:"})," ",yl(n.started_at)]})]})]})}function I3({task:n}){var u;const[r,s]=D.useState(!1),o=n.state||n.status||"completed";return a.jsxs("div",{className:`transition-colors ${r?"bg-gray-800/20":"hover:bg-gray-800/10"}`,children:[a.jsxs("div",{className:"flex items-center gap-3 py-3 px-4 cursor-pointer",onClick:()=>s(!r),children:[r?a.jsx($l,{className:"w-3.5 h-3.5 text-gray-600 shrink-0"}):a.jsx(gn,{className:"w-3.5 h-3.5 text-gray-600 shrink-0"}),a.jsx(hs,{status:o}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("span",{className:"text-sm text-gray-300 truncate block",children:n.name||n.task||n.prompt||((u=n.task_id)==null?void 0:u.slice(0,20))})}),a.jsxs("div",{className:"flex items-center gap-4 text-[11px] text-gray-600 shrink-0",children:[n.model_used&&a.jsxs("span",{className:`flex items-center gap-1 font-medium ${Dd(n.model_used)}`,children:[a.jsx(an,{className:"w-3 h-3"}),Od(n.model_used)]}),a.jsx("span",{className:"font-mono",children:zd(n.duration||0)}),a.jsx("span",{children:yl(n.completed_at||n.started_at)})]})]}),r&&a.jsxs("div",{className:"px-4 pb-3 space-y-2",children:[n.result&&a.jsxs("div",{className:"bg-gray-900/50 rounded-lg p-3",children:[a.jsx("p",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider mb-1.5",children:"Result"}),a.jsx("pre",{className:"text-xs text-gray-300 font-mono whitespace-pre-wrap max-h-32 overflow-y-auto leading-relaxed",children:typeof n.result=="string"?n.result:JSON.stringify(n.result,null,2)})]}),n.error&&a.jsx("div",{className:"bg-red-500/5 border border-red-500/20 rounded-lg p-3",children:a.jsx("p",{className:"text-xs text-red-400 font-mono whitespace-pre-wrap",children:n.error})})]})]})}function J3(){const[n,r]=D.useState(null),[s,o]=D.useState([]),[u,d]=D.useState(!0),[f,x]=D.useState(!1),p=D.useCallback(async()=>{try{const[S,T]=await Promise.all([de.getScheduler(),de.getSchedulerHistory(20)]);r(S),o((T==null?void 0:T.executions)||[])}catch{}finally{d(!1)}},[]);D.useEffect(()=>{p()},[p]),D.useEffect(()=>{const S=setInterval(p,5e3);return()=>clearInterval(S)},[p]);const h=async S=>{try{await de.pauseJob(S),p()}catch{}},y=async S=>{try{await de.resumeJob(S),p()}catch{}},g=async S=>{if(confirm("Delete this scheduled job?"))try{await de.deleteJob(S),p()}catch{}};if(u)return a.jsx(Tg,{text:"Loading scheduler..."});const v=(n==null?void 0:n.jobs)||[],j=(n==null?void 0:n.stats)||{},k=v.filter(S=>S.status==="active"),R=v.filter(S=>S.status==="paused");return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[a.jsx(gl,{icon:qa,label:"Total Jobs",value:j.total_jobs||v.length,color:"purple"}),a.jsx(gl,{icon:Fa,label:"Active",value:j.active_jobs||k.length,color:"emerald"}),a.jsx(gl,{icon:xp,label:"Paused",value:j.paused_jobs||R.length,color:"amber"}),a.jsx(gl,{icon:ns,label:"Executions",value:j.total_executions||s.length,color:"cyan"})]}),a.jsxs("div",{children:[a.jsx(Gi,{icon:qa,title:"Scheduled Jobs",count:v.length}),v.length===0?a.jsx(id,{icon:qa,text:"No scheduled jobs",sub:'Tell Plutus something like "Every day at 6 AM, write a blog post" and it will create a scheduled job'}):a.jsx("div",{className:"space-y-2",children:v.map(S=>a.jsx(P3,{job:S,onPause:h,onResume:y,onDelete:g},S.id||S.job_id))})]}),a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>x(!f),className:"flex items-center gap-2 text-sm text-gray-400 hover:text-gray-300 mb-3 transition-colors",children:[f?a.jsx($l,{className:"w-4 h-4"}):a.jsx(gn,{className:"w-4 h-4"}),a.jsx(ns,{className:"w-4 h-4"}),"Execution History",a.jsx("span",{className:"text-[10px] text-gray-500 bg-gray-800/50 px-2 py-0.5 rounded-full",children:s.length})]}),f&&(s.length===0?a.jsx(id,{icon:ns,text:"No executions yet",sub:"History will appear after scheduled jobs run"}):a.jsx("div",{className:"bg-surface-alt border border-gray-800/50 rounded-xl overflow-hidden divide-y divide-gray-800/40",children:s.map((S,T)=>a.jsxs("div",{className:"flex items-center gap-3 py-3 px-4 hover:bg-gray-800/10 transition-colors",children:[a.jsx(hs,{status:S.status||"completed"}),a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx("p",{className:"text-sm text-gray-300 truncate",children:S.job_name||S.job_id})}),a.jsxs("div",{className:"text-[11px] text-gray-600 flex items-center gap-4",children:[a.jsx("span",{className:"font-mono",children:zd(S.duration||0)}),a.jsx("span",{children:yl(S.executed_at||S.timestamp)})]})]},T))}))]})]})}function P3({job:n,onPause:r,onResume:s,onDelete:o}){const[u,d]=D.useState(!1),f=n.id||n.job_id,x=n.status==="paused",p=n.status==="active";return a.jsxs("div",{className:`bg-surface-alt border rounded-xl p-4 transition-colors ${p?"border-emerald-500/20":x?"border-amber-500/20 opacity-75":"border-gray-800/50"}`,children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(qa,{className:`w-4 h-4 shrink-0 ${p?"text-emerald-400":"text-gray-500"}`}),a.jsxs("div",{className:"flex-1 min-w-0 cursor-pointer",onClick:()=>d(!u),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-gray-200 truncate",children:n.name||n.task||f}),a.jsx(hs,{status:n.status})]}),a.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[11px] text-gray-500",children:[n.schedule&&a.jsx("span",{className:"font-mono bg-gray-800/50 px-1.5 py-0.5 rounded",children:n.schedule}),n.cron&&a.jsx("span",{className:"font-mono bg-gray-800/50 px-1.5 py-0.5 rounded",children:n.cron}),n.interval&&a.jsxs("span",{children:["Every ",zd(n.interval)]}),n.next_run&&a.jsxs("span",{children:["Next: ",yl(n.next_run)]}),n.last_run&&a.jsxs("span",{children:["Last: ",yl(n.last_run)]}),n.run_count!==void 0&&a.jsxs("span",{children:["Runs: ",n.run_count]})]})]}),a.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p?a.jsx("button",{onClick:()=>r(f),className:"p-2 rounded-lg text-amber-400 hover:bg-amber-500/10 transition-colors",title:"Pause",children:a.jsx(xp,{className:"w-4 h-4"})}):x?a.jsx("button",{onClick:()=>s(f),className:"p-2 rounded-lg text-emerald-400 hover:bg-emerald-500/10 transition-colors",title:"Resume",children:a.jsx(Fa,{className:"w-4 h-4"})}):null,a.jsx("button",{onClick:()=>o(f),className:"p-2 rounded-lg text-red-400/60 hover:text-red-400 hover:bg-red-500/10 transition-colors",title:"Delete",children:a.jsx(Za,{className:"w-4 h-4"})})]})]}),u&&a.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-800/60 text-xs text-gray-400 space-y-1.5",children:[n.task&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Task:"})," ",n.task]}),n.description&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Description:"})," ",n.description]}),n.model&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Model:"})," ",n.model]}),n.created_at&&a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-600",children:"Created:"})," ",yl(n.created_at)]})]})]})}function W3(){const[n,r]=D.useState("workers"),[s,o]=D.useState(0),[u,d]=D.useState(0);return D.useEffect(()=>{const f=async()=>{var p,h,y;try{const[g,v]=await Promise.all([de.getWorkers().catch(()=>null),de.getScheduler().catch(()=>null)]);o(((p=g==null?void 0:g.stats)==null?void 0:p.active_count)||0),d(((h=v==null?void 0:v.stats)==null?void 0:h.active_jobs)||((y=v==null?void 0:v.jobs)==null?void 0:y.length)||0)}catch{}};f();const x=setInterval(f,5e3);return()=>clearInterval(x)},[]),a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsxs("div",{className:"max-w-4xl mx-auto px-1",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-100",children:"Workers & Automation"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Monitor active workers, job queue, scheduled tasks, and task history."})]}),a.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[a.jsx(Fx,{active:n==="workers",onClick:()=>r("workers"),icon:bl,label:"Workers",badge:s}),a.jsx(Fx,{active:n==="scheduler",onClick:()=>r("scheduler"),icon:qa,label:"Scheduler",badge:u})]}),a.jsxs("div",{className:"min-h-[500px]",children:[n==="workers"&&a.jsx(Z3,{}),n==="scheduler"&&a.jsx(J3,{})]})]})})}function ew({steps:n,currentStep:r}){return a.jsx("div",{className:"flex items-center gap-1 mb-6",children:n.map((s,o)=>a.jsxs("div",{className:"flex items-center",children:[a.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-medium transition-all ${o===r?"bg-plutus-500/20 text-plutus-400 border border-plutus-500/30":o<r?"bg-emerald-500/10 text-emerald-400":"bg-gray-800 text-gray-500"}`,children:[o<r?a.jsx(qe,{className:"w-3.5 h-3.5"}):a.jsx("span",{className:"w-4 h-4 rounded-full bg-gray-700 flex items-center justify-center text-[10px]",children:o+1}),a.jsx("span",{className:"hidden sm:inline",children:s})]}),o<n.length-1&&a.jsx(gn,{className:"w-4 h-4 text-gray-700 mx-1"})]},o))})}const tw=[{name:"Word Counter",description:"Count words, lines, and characters in a file",icon:dd,toolName:"word_counter",code:`"""Count words, lines, and characters in a file."""

def main(args: dict) -> dict:
    path = args.get("path", "")
    if not path:
        return {"success": False, "result": "Please provide a file path"}
    
    try:
        with open(path, "r") as f:
            content = f.read()
        
        lines = content.split("\\n")
        words = content.split()
        
        return {
            "success": True,
            "result": {
                "file": path,
                "lines": len(lines),
                "words": len(words),
                "characters": len(content),
                "non_empty_lines": sum(1 for l in lines if l.strip()),
            }
        }
    except FileNotFoundError:
        return {"success": False, "result": f"File not found: {path}"}
    except Exception as e:
        return {"success": False, "result": str(e)}
`},{name:"JSON Formatter",description:"Pretty-print and validate JSON files",icon:Ki,toolName:"json_formatter",code:`"""Format and validate JSON files."""
import json

def main(args: dict) -> dict:
    path = args.get("path", "")
    indent = args.get("indent", 2)
    
    if not path:
        return {"success": False, "result": "Please provide a file path"}
    
    try:
        with open(path, "r") as f:
            data = json.load(f)
        
        formatted = json.dumps(data, indent=indent, sort_keys=True)
        
        # Optionally write back
        if args.get("write_back", False):
            with open(path, "w") as f:
                f.write(formatted)
        
        return {
            "success": True,
            "result": {
                "valid": True,
                "keys": len(data) if isinstance(data, dict) else None,
                "items": len(data) if isinstance(data, list) else None,
                "formatted": formatted[:500],
            }
        }
    except json.JSONDecodeError as e:
        return {"success": False, "result": f"Invalid JSON: {e}"}
    except Exception as e:
        return {"success": False, "result": str(e)}
`},{name:"File Search",description:"Search for files by name or content pattern",icon:Ql,toolName:"file_search",code:`"""Search for files by name or content."""
import os
import re

def main(args: dict) -> dict:
    directory = args.get("directory", ".")
    pattern = args.get("pattern", "")
    content_pattern = args.get("content", "")
    max_results = args.get("max_results", 20)
    
    if not pattern and not content_pattern:
        return {"success": False, "result": "Provide a 'pattern' or 'content' to search for"}
    
    results = []
    
    try:
        for root, dirs, files in os.walk(directory):
            # Skip hidden directories
            dirs[:] = [d for d in dirs if not d.startswith(".")]
            
            for fname in files:
                if len(results) >= max_results:
                    break
                
                full_path = os.path.join(root, fname)
                
                # Match filename
                if pattern and re.search(pattern, fname, re.IGNORECASE):
                    results.append({"path": full_path, "match": "filename"})
                    continue
                
                # Match content
                if content_pattern:
                    try:
                        with open(full_path, "r", errors="ignore") as f:
                            for i, line in enumerate(f, 1):
                                if re.search(content_pattern, line):
                                    results.append({
                                        "path": full_path,
                                        "match": "content",
                                        "line": i,
                                        "text": line.strip()[:100],
                                    })
                                    break
                    except (PermissionError, IsADirectoryError):
                        pass
        
        return {"success": True, "result": {"matches": results, "count": len(results)}}
    except Exception as e:
        return {"success": False, "result": str(e)}
`},{name:"Start from Scratch",description:"Write your own tool from a blank template",icon:md,toolName:"my_tool",code:`"""Describe what your tool does here."""

def main(args: dict) -> dict:
    """
    Main entry point for the tool.
    
    Args:
        args: Dictionary of arguments passed to the tool.
              Access them with args.get("key", default_value)
    
    Returns:
        Dictionary with "success" (bool) and "result" (any) keys.
    """
    # Your code here
    name = args.get("name", "World")
    
    return {
        "success": True,
        "result": f"Hello, {name}! Your tool is working."
    }
`}];function nw(){var I;const[n,r]=D.useState(0),[s,o]=D.useState(""),[u,d]=D.useState(""),[f,x]=D.useState(""),[p,h]=D.useState(!1),[y,g]=D.useState(null),{data:v,loading:j,refetch:k}=_g(()=>de.getCustomTools(),[]),R=["Choose Template","Name & Describe","Write Code","Create"],S=z=>{o(z.toolName),d(z.description),x(z.code),r(1)},T=async()=>{h(!0),g(null);try{const z=await de.createCustomTool(s,u,f,!0);g({success:!0,message:`Tool "${z.tool_name}" created successfully! ${z.registered?"It's now registered and the AI can use it immediately.":"Saved to disk — it will be available after restart."} (${z.code_lines} lines)`}),k()}catch(z){const $=(z instanceof Error?z.message:"Failed to create tool").replace(/^API error \d+: /,"").replace(/^"|"$/g,"");g({success:!1,message:$})}finally{h(!1)}},V=async z=>{if(confirm(`Delete tool "${z}"? This cannot be undone.`))try{await de.deleteCustomTool(z),k()}catch(U){console.error("Failed to delete tool:",U)}},H=()=>{r(0),o(""),d(""),x(""),g(null)};return a.jsxs("div",{className:"h-full overflow-y-auto space-y-6 max-w-4xl mx-auto",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-100",children:"Tool Creator"}),a.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"Create custom tools that extend what the AI can do. Tools are small Python scripts that the AI can call during conversations."})]}),a.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[a.jsx("div",{className:"lg:col-span-2 space-y-4",children:a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("h2",{className:"text-sm font-semibold text-gray-300 flex items-center gap-2",children:[a.jsx(pp,{className:"w-4 h-4 text-plutus-400"}),"Create New Tool"]}),n>0&&a.jsx("button",{onClick:H,className:"text-xs text-gray-500 hover:text-gray-300",children:"Start over"})]}),a.jsx(ew,{steps:R,currentStep:n}),n===0&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-xs text-gray-400 mb-4",children:"Pick a starting template or start from scratch. Don't worry — you can customize everything in the next steps."}),a.jsx("div",{className:"grid sm:grid-cols-2 gap-3",children:tw.map(z=>{const U=z.icon;return a.jsxs("button",{onClick:()=>S(z),className:"text-left p-4 rounded-xl border border-gray-800 hover:border-plutus-500/50 hover:bg-gray-800/50 transition-all group",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-plutus-500/10 flex items-center justify-center group-hover:bg-plutus-500/20 transition-colors",children:a.jsx(U,{className:"w-4 h-4 text-plutus-400"})}),a.jsx("h3",{className:"text-sm font-medium text-gray-200",children:z.name})]}),a.jsx("p",{className:"text-xs text-gray-500",children:z.description})]},z.name)})})]}),n===1&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-400 mb-1.5 block",children:"Tool Name"}),a.jsx("input",{type:"text",className:"input font-mono",value:s,onChange:z=>o(z.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")),placeholder:"my_awesome_tool"}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Use lowercase letters, numbers, and underscores only."})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-400 mb-1.5 block",children:"Description"}),a.jsx("textarea",{className:"input min-h-[80px] resize-y",value:u,onChange:z=>d(z.target.value),placeholder:"Describe what this tool does in plain English...",rows:3}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"This helps the AI understand when to use your tool."})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("button",{onClick:()=>r(0),className:"btn-secondary flex items-center gap-2",children:[a.jsx(ts,{className:"w-4 h-4"}),"Back"]}),a.jsxs("button",{onClick:()=>r(2),disabled:!s.trim(),className:"btn-primary flex items-center gap-2",children:["Next",a.jsx(gn,{className:"w-4 h-4"})]})]})]}),n===2&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"text-xs text-gray-400",children:"Python Code"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(f)},className:"text-xs text-gray-500 hover:text-gray-300 flex items-center gap-1",children:[a.jsx(Ya,{className:"w-3 h-3"}),"Copy"]})})]}),a.jsx("div",{className:"relative",children:a.jsx("textarea",{className:"input font-mono text-xs min-h-[300px] resize-y leading-relaxed",value:f,onChange:z=>x(z.target.value),spellCheck:!1,style:{tabSize:4}})}),a.jsx("div",{className:"bg-blue-500/5 border border-blue-500/20 rounded-lg p-3",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Qh,{className:"w-4 h-4 text-blue-400 mt-0.5 flex-shrink-0"}),a.jsxs("div",{className:"text-xs text-blue-300/80",children:[a.jsx("p",{className:"font-medium mb-1",children:"How tools work:"}),a.jsxs("ul",{className:"space-y-1 text-blue-300/60",children:[a.jsxs("li",{children:["• Your tool must have a"," ",a.jsx("code",{className:"text-blue-400",children:"main(args: dict) → dict"})," ","function"]}),a.jsxs("li",{children:["• Return"," ",a.jsx("code",{className:"text-blue-400",children:'{"success": True, "result": ...}'})]}),a.jsxs("li",{children:["• Access arguments with"," ",a.jsx("code",{className:"text-blue-400",children:'args.get("key", default)'})]}),a.jsx("li",{children:"• The AI will call your tool automatically when needed"})]})]})]})}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("button",{onClick:()=>r(1),className:"btn-secondary flex items-center gap-2",children:[a.jsx(ts,{className:"w-4 h-4"}),"Back"]}),a.jsxs("button",{onClick:()=>r(3),disabled:!f.trim(),className:"btn-primary flex items-center gap-2",children:["Review & Create",a.jsx(gn,{className:"w-4 h-4"})]})]})]}),n===3&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-gray-800/50 rounded-xl p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-lg bg-plutus-500/10 flex items-center justify-center",children:a.jsx(Zu,{className:"w-5 h-5 text-plutus-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:s}),a.jsx("p",{className:"text-xs text-gray-400",children:u})]})]}),a.jsxs("div",{className:"border-t border-gray-700 pt-3",children:[a.jsx("p",{className:"text-[10px] font-semibold text-gray-500 uppercase tracking-wider mb-2",children:"Code Preview"}),a.jsxs("pre",{className:"text-xs text-gray-300 font-mono bg-gray-900 rounded-lg p-3 max-h-40 overflow-y-auto",children:[f.slice(0,500),f.length>500?`
...`:""]})]}),a.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500",children:[a.jsxs("span",{children:[f.split(`
`).length," lines"]}),a.jsxs("span",{children:[f.length," characters"]})]})]}),y&&a.jsx("div",{className:`rounded-lg p-4 ${y.success?"bg-emerald-500/10 border border-emerald-500/20":"bg-red-500/10 border border-red-500/20"}`,children:a.jsxs("div",{className:"flex items-start gap-2",children:[y.success?a.jsx(qe,{className:"w-5 h-5 text-emerald-400 flex-shrink-0"}):a.jsx(Yl,{className:"w-5 h-5 text-red-400 flex-shrink-0"}),a.jsx("p",{className:`text-sm ${y.success?"text-emerald-300":"text-red-300"}`,children:y.message})]})}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("button",{onClick:()=>r(2),className:"btn-secondary flex items-center gap-2",children:[a.jsx(ts,{className:"w-4 h-4"}),"Edit Code"]}),a.jsxs("button",{onClick:T,disabled:p,className:"btn-primary flex items-center gap-2",children:[p?a.jsx(Va,{className:"w-4 h-4 animate-spin"}):a.jsx(md,{className:"w-4 h-4"}),p?"Creating...":"Create Tool"]}),(y==null?void 0:y.success)&&a.jsx("button",{onClick:H,className:"btn-secondary",children:"Create Another"})]})]})]})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("h2",{className:"text-sm font-semibold text-gray-300 flex items-center gap-2",children:[a.jsx(vn,{className:"w-4 h-4 text-gray-400"}),"Your Custom Tools"]}),a.jsx("button",{onClick:k,className:"text-gray-500 hover:text-gray-300",children:a.jsx(Va,{className:"w-3.5 h-3.5"})})]}),j?a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx(Va,{className:"w-4 h-4 animate-spin text-gray-500"})}):(I=v==null?void 0:v.tools)!=null&&I.length?a.jsx("div",{className:"space-y-2",children:v.tools.map(z=>a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-gray-800/50 hover:bg-gray-800 transition-colors group",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-pink-500/10 flex items-center justify-center flex-shrink-0",children:a.jsx(vn,{className:"w-4 h-4 text-pink-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"text-xs font-medium text-gray-200",children:z.name}),a.jsx("p",{className:"text-[10px] text-gray-500 line-clamp-2 mt-0.5",children:z.description||"No description"}),z.code_lines&&a.jsxs("span",{className:"text-[10px] text-gray-600",children:[z.code_lines," lines"]})]}),a.jsx("button",{onClick:()=>V(z.name),className:"opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-300 p-1 transition-opacity",title:"Delete tool",children:a.jsx(Za,{className:"w-3.5 h-3.5"})})]},z.name))}):a.jsxs("div",{className:"text-center py-8",children:[a.jsx(Zu,{className:"w-8 h-8 text-gray-700 mx-auto mb-3"}),a.jsx("p",{className:"text-sm text-gray-400",children:"No custom tools yet"}),a.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"Create one using the wizard, or ask the AI to create one during a conversation."})]})]}),a.jsx("div",{className:"card bg-gradient-to-br from-plutus-500/5 to-purple-500/5 border-plutus-500/20",children:a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(Qh,{className:"w-4 h-4 text-plutus-400 mt-0.5 flex-shrink-0"}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-xs font-semibold text-gray-300 mb-2",children:"Pro Tips"}),a.jsxs("ul",{className:"space-y-1.5 text-[11px] text-gray-400",children:[a.jsxs("li",{children:["💬 You can ask the AI: ",a.jsx("em",{children:'"Create a tool that..."'})," and it will write the code for you"]}),a.jsx("li",{children:"🔄 Custom tools persist across sessions and are available immediately"}),a.jsx("li",{children:"🛡️ Each tool runs in an isolated subprocess for safety"}),a.jsx("li",{children:"📦 Tools can import standard Python libraries (os, json, re, etc.)"})]})]})]})})]})]})]})}const lw={messaging:{icon:"💬",color:"text-green-400",bg:"bg-green-500/10",border:"border-green-500/20"},calendar:{icon:"📅",color:"text-blue-400",bg:"bg-blue-500/10",border:"border-blue-500/20"},email:{icon:"📧",color:"text-cyan-400",bg:"bg-cyan-500/10",border:"border-cyan-500/20"},music:{icon:"🎵",color:"text-pink-400",bg:"bg-pink-500/10",border:"border-pink-500/20"},files:{icon:"📁",color:"text-amber-400",bg:"bg-amber-500/10",border:"border-amber-500/20"},browser:{icon:"🌐",color:"text-indigo-400",bg:"bg-indigo-500/10",border:"border-indigo-500/20"},productivity:{icon:"⚡",color:"text-yellow-400",bg:"bg-yellow-500/10",border:"border-yellow-500/20"},social:{icon:"👥",color:"text-violet-400",bg:"bg-violet-500/10",border:"border-violet-500/20"},development:{icon:"💻",color:"text-emerald-400",bg:"bg-emerald-500/10",border:"border-emerald-500/20"},system:{icon:"⚙️",color:"text-gray-400",bg:"bg-gray-500/10",border:"border-gray-500/20"},custom:{icon:"🧩",color:"text-rose-400",bg:"bg-rose-500/10",border:"border-rose-500/20"}},aw={icon:"📦",color:"text-gray-400",bg:"bg-gray-800/40",border:"border-gray-800/60"};function qi(n){return lw[n]||aw}function rw(){const[n,r]=D.useState([]),[s,o]=D.useState([]),[u,d]=D.useState([]),[f,x]=D.useState(!0),[p,h]=D.useState("all"),[y,g]=D.useState(""),[v,j]=D.useState(null),[k,R]=D.useState("browse"),[S,T]=D.useState(""),[V,H]=D.useState(null),[I,z]=D.useState(null),[U,$]=D.useState(null),fe=D.useRef(null),J=D.useCallback(async()=>{try{const[O,le]=await Promise.all([de.getSkills().catch(()=>({skills:[],categories:[]})),de.getSavedSkills().catch(()=>({skills:[]}))]),ie=Array.isArray(O.skills)?O.skills:[],C=Array.isArray(O.categories)?O.categories:[],_=Array.isArray(le.skills)?le.skills:[];r(ie),d(C),o(_)}catch{}finally{x(!1)}},[]);D.useEffect(()=>{J()},[J]);const M=n.filter(O=>{const le=p==="all"||O.category===p,ie=!y||O.name.toLowerCase().includes(y.toLowerCase())||O.description.toLowerCase().includes(y.toLowerCase())||O.app.toLowerCase().includes(y.toLowerCase())||O.triggers.some(C=>C.toLowerCase().includes(y.toLowerCase()));return le&&ie}),ne=async O=>{H(null);try{const le=JSON.parse(O),ie=await de.importSkill(le);H({type:"success",msg:ie.message||`Imported skill: ${ie.skill_name}`}),T(""),J()}catch(le){H({type:"error",msg:le.message||"Invalid JSON or import failed"})}},re=O=>{var C;const le=(C=O.target.files)==null?void 0:C[0];if(!le)return;const ie=new FileReader;ie.onload=_=>{var w;const F=(w=_.target)==null?void 0:w.result;T(F),ne(F)},ie.readAsText(le),O.target.value=""},Z=async O=>{z(O),$(null);try{const le=await de.exportSkill(O);$(JSON.stringify(le,null,2))}catch(le){$(`Error: ${le.message}`)}},Q=async O=>{try{await de.deleteSkill(O),J()}catch{}},ee=O=>{navigator.clipboard.writeText(O).catch(()=>{})},A=[{id:"browse",label:"Browse All",icon:"🔍",count:n.length},{id:"my-skills",label:"My Skills",icon:"⭐",count:s.length},{id:"import",label:"Import / Upload",icon:"📥"},{id:"community",label:"Community",icon:"🌍"}];return a.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[a.jsx("div",{className:"bg-gradient-to-br from-violet-600/10 via-purple-600/5 to-fuchsia-600/10 border border-violet-500/20 rounded-2xl p-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl font-bold text-gray-100 flex items-center gap-3",children:[a.jsx("span",{className:"text-3xl",children:"🧠"})," Skills"]}),a.jsx("p",{className:"text-gray-100/50 text-sm mt-1 max-w-xl",children:"Skills are step-by-step recipes that teach Plutus how to use apps on your computer. Browse built-in skills, import community skills, or let Plutus create new ones automatically."})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-violet-400",children:n.length}),a.jsx("div",{className:"text-gray-500 text-[10px]",children:"Total"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-emerald-400",children:s.length}),a.jsx("div",{className:"text-gray-500 text-[10px]",children:"Custom"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-2xl font-bold text-amber-400",children:u.length}),a.jsx("div",{className:"text-gray-500 text-[10px]",children:"Categories"})]})]})]})}),a.jsx("div",{className:"flex gap-1 bg-surface-deep border border-gray-800/60 rounded-xl p-1",children:A.map(O=>a.jsxs("button",{onClick:()=>R(O.id),className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium transition-all ${k===O.id?"bg-violet-500/20 text-violet-400 border border-violet-500/30":"text-gray-500 hover:text-gray-400 hover:bg-gray-800/40 border border-transparent"}`,children:[a.jsx("span",{children:O.icon}),a.jsx("span",{children:O.label}),O.count!==void 0&&a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-gray-800/40",children:O.count})]},O.id))}),k==="browse"&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex gap-3",children:a.jsxs("div",{className:"flex-1 relative",children:[a.jsx("input",{type:"text",value:y,onChange:O=>g(O.target.value),placeholder:"Search skills by name, app, or trigger...",className:"w-full bg-surface border border-gray-800/60 rounded-xl px-4 py-2.5 text-sm text-gray-100 placeholder-white/30 focus:outline-none focus:border-violet-500/50"}),y&&a.jsx("button",{onClick:()=>g(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-400 text-xs",children:"✕"})]})}),a.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[a.jsxs("button",{onClick:()=>h("all"),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${p==="all"?"bg-violet-500/20 text-violet-400 border border-violet-500/30":"bg-gray-800/40 text-gray-500 border border-gray-800/60 hover:bg-white/10"}`,children:["All (",n.length,")"]}),u.map(O=>{const le=qi(O),ie=n.filter(C=>C.category===O).length;return a.jsxs("button",{onClick:()=>h(O),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors capitalize flex items-center gap-1.5 ${p===O?`${le.bg} ${le.color} border ${le.border}`:"bg-gray-800/40 text-gray-500 border border-gray-800/60 hover:bg-white/10"}`,children:[le.icon," ",O," (",ie,")"]},O)})]}),f?a.jsx("div",{className:"text-center py-12 text-gray-500",children:"Loading skills..."}):M.length===0?a.jsxs("div",{className:"text-center py-12 text-gray-500",children:[a.jsx("div",{className:"text-3xl mb-2",children:"🔍"}),"No skills found matching your search."]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:M.map(O=>{const le=qi(O.category),ie=v===O.name;return a.jsxs("div",{className:`bg-surface border rounded-xl overflow-hidden transition-all cursor-pointer ${ie?`${le.border} shadow-lg`:"border-gray-800/60 hover:border-white/20"}`,onClick:()=>j(ie?null:O.name),children:[a.jsxs("div",{className:"p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:`text-xl w-8 h-8 rounded-lg ${le.bg} flex items-center justify-center`,children:le.icon}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-100",children:O.app}),a.jsx("code",{className:"text-[10px] font-mono text-violet-400/70",children:O.name})]})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[O.dynamic&&a.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-rose-500/10 text-rose-400",children:"Custom"}),a.jsx("span",{className:"text-gray-600 text-xs",children:ie?"▲":"▼"})]})]}),a.jsx("p",{className:"text-gray-100/50 text-xs leading-relaxed",children:O.description})]}),ie&&a.jsxs("div",{className:"border-t border-gray-800/60 p-4 bg-white/[0.02] space-y-3",children:[O.required_params.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-500 text-[10px] uppercase tracking-wider mb-1",children:"Required Parameters"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:O.required_params.map(C=>a.jsx("span",{className:`text-xs ${le.bg} ${le.color} px-2 py-0.5 rounded font-mono`,children:C},C))})]}),O.optional_params.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-500 text-[10px] uppercase tracking-wider mb-1",children:"Optional"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:O.optional_params.map(C=>a.jsx("span",{className:"text-xs bg-gray-800/40 text-gray-500 px-2 py-0.5 rounded font-mono",children:C},C))})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-500 text-[10px] uppercase tracking-wider mb-1",children:"Triggers"}),a.jsxs("div",{className:"flex flex-wrap gap-1",children:[O.triggers.slice(0,6).map(C=>a.jsxs("span",{className:"text-[10px] bg-gray-800/40 text-gray-500 px-1.5 py-0.5 rounded",children:['"',C,'"']},C)),O.triggers.length>6&&a.jsxs("span",{className:"text-[10px] text-gray-600",children:["+",O.triggers.length-6," more"]})]})]}),a.jsxs("div",{className:"flex gap-2 pt-1",children:[a.jsx("button",{onClick:C=>{C.stopPropagation(),Z(O.name)},className:"flex-1 text-xs py-1.5 rounded-lg bg-violet-500/10 text-violet-400 border border-violet-500/20 hover:bg-violet-500/20 transition-colors",children:"📤 Export"}),a.jsx("button",{onClick:C=>{C.stopPropagation(),Qe.getState().setView("chat")},className:"flex-1 text-xs py-1.5 rounded-lg bg-blue-500/10 text-blue-400 border border-blue-500/20 hover:bg-blue-500/20 transition-colors",children:"💬 Try in Chat"})]})]})]},O.name)})})]}),k==="my-skills"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-gray-500 text-sm",children:"Skills created by you or by Plutus during conversations. These are saved permanently on your machine."}),a.jsx("button",{onClick:()=>R("import"),className:"text-xs px-3 py-1.5 rounded-lg bg-violet-500/10 text-violet-400 border border-violet-500/20 hover:bg-violet-500/20 transition-colors",children:"+ Import Skill"})]}),s.length===0?a.jsxs("div",{className:"text-center py-16 bg-surface border border-gray-800/60 rounded-xl",children:[a.jsx("div",{className:"text-4xl mb-3",children:"🌱"}),a.jsx("h3",{className:"text-gray-300 font-semibold mb-1",children:"No custom skills yet"}),a.jsx("p",{className:"text-gray-500 text-sm max-w-md mx-auto",children:"As you use Plutus, it will automatically create skills for tasks it learns. You can also import skills from the community or create them manually."}),a.jsxs("div",{className:"flex gap-3 justify-center mt-4",children:[a.jsx("button",{onClick:()=>R("import"),className:"text-xs px-4 py-2 rounded-lg bg-violet-500/10 text-violet-400 border border-violet-500/20 hover:bg-violet-500/20",children:"📥 Import a Skill"}),a.jsx("button",{onClick:()=>R("community"),className:"text-xs px-4 py-2 rounded-lg bg-blue-500/10 text-blue-400 border border-blue-500/20 hover:bg-blue-500/20",children:"🌍 Browse Community"})]})]}):a.jsx("div",{className:"space-y-2",children:s.map(O=>{const le=qi(O.category);return a.jsxs("div",{className:"bg-surface border border-gray-800/60 rounded-xl p-4 flex items-center gap-4",children:[a.jsx("span",{className:`text-xl w-10 h-10 rounded-lg ${le.bg} flex items-center justify-center flex-shrink-0`,children:le.icon}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-100",children:O.name}),a.jsxs("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-gray-800/40 text-gray-500",children:["v",O.version||1]}),a.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded ${le.bg} ${le.color} capitalize`,children:O.category})]}),a.jsx("p",{className:"text-gray-500 text-xs mt-0.5 truncate",children:O.description}),O.reason&&a.jsxs("p",{className:"text-gray-600 text-[10px] mt-0.5 italic",children:["Created because: ",O.reason]})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[a.jsxs("span",{className:"text-gray-600 text-xs",children:[O.steps_count||"?"," steps"]}),a.jsx("button",{onClick:()=>Z(O.name),className:"text-xs px-2.5 py-1.5 rounded-lg bg-violet-500/10 text-violet-400 border border-violet-500/20 hover:bg-violet-500/20 transition-colors",children:"📤 Export"}),a.jsx("button",{onClick:()=>Q(O.name),className:"text-xs px-2.5 py-1.5 rounded-lg bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition-colors",children:"🗑️"})]})]},O.name)})})]}),k==="import"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-surface border border-dashed border-violet-500/30 rounded-xl p-8 text-center",children:[a.jsx("div",{className:"text-4xl mb-3",children:"📁"}),a.jsx("h3",{className:"text-gray-100/80 font-semibold mb-1",children:"Upload a Skill File"}),a.jsxs("p",{className:"text-gray-500 text-sm mb-4",children:["Drop a ",a.jsx("code",{className:"text-violet-400/70",children:".json"})," skill file here or click to browse"]}),a.jsx("input",{ref:fe,type:"file",accept:".json",onChange:re,className:"hidden"}),a.jsx("button",{onClick:()=>{var O;return(O=fe.current)==null?void 0:O.click()},className:"px-6 py-2.5 rounded-xl bg-violet-500/20 text-violet-400 border border-violet-500/30 hover:bg-violet-500/30 transition-colors text-sm font-medium",children:"Choose File"})]}),a.jsxs("div",{className:"bg-surface border border-gray-800/60 rounded-xl p-6",children:[a.jsxs("h3",{className:"text-gray-100/80 font-semibold mb-1 flex items-center gap-2",children:[a.jsx("span",{children:"📋"})," Paste Skill JSON"]}),a.jsx("p",{className:"text-gray-500 text-sm mb-3",children:"Paste a skill JSON exported from another Plutus instance or from the community"}),a.jsx("textarea",{value:S,onChange:O=>T(O.target.value),placeholder:`{
  "plutus_skill": true,
  "skill": {
    "name": "my_skill",
    "description": "What this skill does",
    "app": "MyApp",
    "category": "custom",
    "triggers": ["my trigger"],
    "required_params": ["param1"],
    "optional_params": [],
    "steps": [
      {
        "description": "Step 1",
        "operation": "open_app",
        "params": { "app_name": "{{param1}}" }
      }
    ]
  }
}`,className:"w-full h-48 bg-surface-deep border border-gray-800/60 rounded-xl p-4 text-xs font-mono text-gray-300 placeholder-gray-600 focus:outline-none focus:border-violet-500/50 resize-none"}),a.jsxs("div",{className:"flex items-center justify-between mt-3",children:[a.jsx("div",{children:V&&a.jsxs("div",{className:`text-xs px-3 py-1.5 rounded-lg ${V.type==="success"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:[V.type==="success"?"✅":"❌"," ",V.msg]})}),a.jsx("button",{onClick:()=>ne(S),disabled:!S.trim(),className:"px-5 py-2 rounded-xl bg-violet-500/20 text-violet-400 border border-violet-500/30 hover:bg-violet-500/30 transition-colors text-sm font-medium disabled:opacity-30 disabled:cursor-not-allowed",children:"Import Skill"})]})]}),a.jsxs("div",{className:"bg-surface border border-gray-800/60 rounded-xl p-6",children:[a.jsxs("h3",{className:"text-gray-100/80 font-semibold mb-3 flex items-center gap-2",children:[a.jsx("span",{children:"📖"})," Skill Format Guide"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-xs",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-gray-100/50 font-semibold",children:"Required Fields"}),a.jsx("div",{className:"space-y-1",children:[{field:"name",desc:"Unique identifier (snake_case)"},{field:"description",desc:"What the skill does"},{field:"steps",desc:"Array of step objects"}].map(O=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"text-violet-400/80 bg-violet-500/10 px-1.5 py-0.5 rounded",children:O.field}),a.jsx("span",{className:"text-gray-500",children:O.desc})]},O.field))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-gray-100/50 font-semibold",children:"Optional Fields"}),a.jsx("div",{className:"space-y-1",children:[{field:"app",desc:"App name (e.g., WhatsApp)"},{field:"category",desc:"Category (messaging, calendar, etc.)"},{field:"triggers",desc:"Keywords that activate this skill"},{field:"required_params",desc:"Parameters the user must provide"},{field:"optional_params",desc:"Parameters that are optional"}].map(O=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"text-blue-400/80 bg-blue-500/10 px-1.5 py-0.5 rounded",children:O.field}),a.jsx("span",{className:"text-gray-500",children:O.desc})]},O.field))})]})]}),a.jsxs("div",{className:"mt-4 text-gray-500 text-xs",children:["Each step needs: ",a.jsx("code",{className:"text-violet-400/60",children:"operation"}),' (like "open_app", "browser_click"),'," ",a.jsx("code",{className:"text-violet-400/60",children:"description"}),", and"," ",a.jsx("code",{className:"text-violet-400/60",children:"params"}),". Use ",a.jsx("code",{className:"text-amber-400/60",children:"{{param_name}}"})," for dynamic values."]})]})]}),k==="community"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-gradient-to-br from-blue-600/10 via-indigo-600/5 to-violet-600/10 border border-blue-500/20 rounded-2xl p-8 text-center",children:[a.jsx("div",{className:"text-5xl mb-4",children:"🌍"}),a.jsx("h2",{className:"text-xl font-bold text-gray-100 mb-2",children:"Plutus Skill Community"}),a.jsx("p",{className:"text-gray-500 text-sm max-w-lg mx-auto",children:"Share your skills with other Plutus users and discover skills created by the community. Every skill you share helps make Plutus smarter for everyone."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"bg-surface border border-gray-800/60 rounded-xl p-5",children:[a.jsx("div",{className:"text-2xl mb-2",children:"📤"}),a.jsx("h3",{className:"text-gray-100/80 font-semibold text-sm mb-1",children:"Export & Share"}),a.jsxs("p",{className:"text-gray-500 text-xs leading-relaxed",children:["Go to ",a.jsx("strong",{className:"text-gray-100/50",children:"My Skills"}),", click ",a.jsx("strong",{className:"text-violet-400",children:"Export"})," on any skill, and share the JSON file on GitHub, Discord, or any community platform."]})]}),a.jsxs("div",{className:"bg-surface border border-gray-800/60 rounded-xl p-5",children:[a.jsx("div",{className:"text-2xl mb-2",children:"📥"}),a.jsx("h3",{className:"text-gray-100/80 font-semibold text-sm mb-1",children:"Import from Others"}),a.jsxs("p",{className:"text-gray-500 text-xs leading-relaxed",children:["Download a ",a.jsx("code",{className:"text-violet-400/60",children:".json"})," skill file from the community, then use the ",a.jsx("strong",{className:"text-gray-100/50",children:"Import"})," tab to add it to your Plutus."]})]}),a.jsxs("div",{className:"bg-surface border border-gray-800/60 rounded-xl p-5",children:[a.jsx("div",{className:"text-2xl mb-2",children:"🤖"}),a.jsx("h3",{className:"text-gray-100/80 font-semibold text-sm mb-1",children:"AI-Created Skills"}),a.jsxs("p",{className:"text-gray-500 text-xs leading-relaxed",children:["When Plutus creates a skill for you, it appears in ",a.jsx("strong",{className:"text-gray-100/50",children:"My Skills"}),". Export it and share it so others can benefit from what your Plutus learned!"]})]})]}),a.jsxs("div",{className:"bg-surface border border-gray-800/60 rounded-xl p-6",children:[a.jsxs("h3",{className:"text-gray-100/80 font-semibold mb-4 flex items-center gap-2",children:[a.jsx("span",{children:"🔗"})," Community Channels"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[a.jsxs("a",{href:"https://github.com/Crypt0nly/plutus/discussions",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-4 rounded-xl bg-white/[0.03] border border-gray-800/60 hover:border-white/20 transition-colors group",children:[a.jsx("span",{className:"text-2xl",children:"💬"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-300 text-sm font-semibold group-hover:text-gray-100 transition-colors",children:"GitHub Discussions"}),a.jsx("div",{className:"text-gray-500 text-xs",children:"Share skills, ask questions, suggest features"})]})]}),a.jsxs("a",{href:"https://github.com/Crypt0nly/plutus/tree/main/community-skills",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-4 rounded-xl bg-white/[0.03] border border-gray-800/60 hover:border-white/20 transition-colors group",children:[a.jsx("span",{className:"text-2xl",children:"📂"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-300 text-sm font-semibold group-hover:text-gray-100 transition-colors",children:"Skill Repository"}),a.jsx("div",{className:"text-gray-500 text-xs",children:"Browse and download community-created skills"})]})]}),a.jsxs("a",{href:"https://github.com/Crypt0nly/plutus/issues/new?template=skill-request.md",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-4 rounded-xl bg-white/[0.03] border border-gray-800/60 hover:border-white/20 transition-colors group",children:[a.jsx("span",{className:"text-2xl",children:"💡"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-300 text-sm font-semibold group-hover:text-gray-100 transition-colors",children:"Request a Skill"}),a.jsx("div",{className:"text-gray-500 text-xs",children:"Can't find what you need? Request it from the community"})]})]}),a.jsxs("a",{href:"https://github.com/Crypt0nly/plutus/blob/main/CONTRIBUTING.md",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-4 rounded-xl bg-white/[0.03] border border-gray-800/60 hover:border-white/20 transition-colors group",children:[a.jsx("span",{className:"text-2xl",children:"🤝"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-300 text-sm font-semibold group-hover:text-gray-100 transition-colors",children:"Contributing Guide"}),a.jsx("div",{className:"text-gray-500 text-xs",children:"Learn how to contribute skills to the official repo"})]})]})]})]}),a.jsxs("div",{className:"bg-surface border border-gray-800/60 rounded-xl p-6",children:[a.jsxs("h3",{className:"text-gray-100/80 font-semibold mb-3 flex items-center gap-2",children:[a.jsx("span",{children:"⭐"})," Featured Community Skills"]}),a.jsx("p",{className:"text-gray-500 text-sm mb-4",children:"Popular skills shared by the community. Click to import directly."}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:[{name:"slack_send_message",app:"Slack",cat:"messaging",desc:"Send a message in any Slack channel or DM",author:"community"},{name:"notion_create_page",app:"Notion",cat:"productivity",desc:"Create a new page in Notion with title and content",author:"community"},{name:"zoom_join_meeting",app:"Zoom",cat:"communication",desc:"Join a Zoom meeting by meeting ID",author:"community"},{name:"twitter_post",app:"Twitter/X",cat:"social",desc:"Post a tweet from your account",author:"community"},{name:"google_docs_create",app:"Google Docs",cat:"productivity",desc:"Create a new Google Doc with content",author:"community"},{name:"youtube_search_play",app:"YouTube",cat:"media",desc:"Search YouTube and play the first result",author:"community"}].map(O=>{const le=qi(O.cat);return a.jsxs("div",{className:"bg-white/[0.03] border border-gray-800/60 rounded-xl p-4 hover:border-violet-500/30 transition-colors cursor-pointer group",onClick:()=>{R("import"),T(JSON.stringify({plutus_skill:!0,skill:{name:O.name,description:O.desc,app:O.app,category:O.cat,triggers:[O.app.toLowerCase(),O.name.replace(/_/g," ")],required_params:[],optional_params:[],steps:[{description:`Open ${O.app}`,operation:"open_app",params:{app_name:O.app}}],reason:`Community skill for ${O.app}`}},null,2))},children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("span",{className:`text-lg w-7 h-7 rounded-lg ${le.bg} flex items-center justify-center`,children:le.icon}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-gray-300 group-hover:text-gray-100",children:O.app}),a.jsx("code",{className:"text-[9px] text-violet-400/50",children:O.name})]})]}),a.jsx("p",{className:"text-gray-500 text-[11px] leading-relaxed",children:O.desc}),a.jsxs("div",{className:"flex items-center justify-between mt-2",children:[a.jsxs("span",{className:"text-[9px] text-gray-600",children:["by ",O.author]}),a.jsx("span",{className:"text-[9px] text-violet-400/50 opacity-0 group-hover:opacity-100 transition-opacity",children:"Click to import →"})]})]},O.name)})})]})]}),I&&U&&a.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"bg-surface border border-gray-800/60 rounded-2xl max-w-2xl w-full max-h-[80vh] overflow-hidden",children:[a.jsxs("div",{className:"p-6 border-b border-gray-800/60 flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-gray-100 font-semibold",children:"Export Skill"}),a.jsx("code",{className:"text-violet-400/70 text-xs",children:I})]}),a.jsx("button",{onClick:()=>{z(null),$(null)},className:"text-gray-500 hover:text-gray-400 text-lg",children:"✕"})]}),a.jsx("div",{className:"p-6 overflow-y-auto max-h-[50vh]",children:a.jsx("pre",{className:"text-xs font-mono text-gray-400 bg-surface-deep rounded-xl p-4 overflow-x-auto",children:U})}),a.jsxs("div",{className:"p-6 border-t border-gray-800/60 flex gap-3",children:[a.jsx("button",{onClick:()=>ee(U),className:"flex-1 py-2.5 rounded-xl bg-violet-500/20 text-violet-400 border border-violet-500/30 hover:bg-violet-500/30 transition-colors text-sm font-medium",children:"📋 Copy to Clipboard"}),a.jsx("button",{onClick:()=>{const O=new Blob([U],{type:"application/json"}),le=URL.createObjectURL(O),ie=document.createElement("a");ie.href=le,ie.download=`${I}.json`,ie.click(),URL.revokeObjectURL(le)},className:"flex-1 py-2.5 rounded-xl bg-blue-500/20 text-blue-400 border border-blue-500/30 hover:bg-blue-500/30 transition-colors text-sm font-medium",children:"💾 Download .json"})]})]})})]})}function Ha({icon:n,label:r,value:s,color:o}){const u={blue:"text-blue-400 bg-blue-500/10",emerald:"text-emerald-400 bg-emerald-500/10",amber:"text-amber-400 bg-amber-500/10",purple:"text-purple-400 bg-purple-500/10",plutus:"text-plutus-400 bg-plutus-500/10",gray:"text-gray-400 bg-gray-500/10"},d=u[o]||u.gray;return a.jsxs("div",{className:"card flex items-center gap-4",children:[a.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${d}`,children:a.jsx(n,{className:"w-5 h-5"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-lg font-bold text-gray-200",children:s}),a.jsx("p",{className:"text-xs text-gray-500",children:r})]})]})}function $u({plan:n}){const[r,s]=D.useState(n.status==="active"),o={active:"text-blue-400 bg-blue-500/10",completed:"text-emerald-400 bg-emerald-500/10",cancelled:"text-gray-400 bg-gray-500/10",failed:"text-red-400 bg-red-500/10"},u={done:qe,in_progress:Gn,failed:yn,skipped:rp,pending:Gn},d={done:"text-emerald-400",in_progress:"text-blue-400 animate-pulse",failed:"text-red-400",skipped:"text-gray-500",pending:"text-gray-600"},f=n.steps||[],x=f.filter(h=>h.status==="done"||h.status==="skipped").length,p=f.length>0?Math.round(x/f.length*100):0;return a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center gap-3 cursor-pointer",onClick:()=>s(!r),children:[r?a.jsx($l,{className:"w-4 h-4 text-gray-500"}):a.jsx(gn,{className:"w-4 h-4 text-gray-500"}),a.jsx(Yi,{className:"w-5 h-5 text-blue-400"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"text-sm font-semibold text-gray-200",children:n.title}),n.goal&&a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:n.goal})]}),a.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${o[n.status]||o.active}`,children:n.status}),a.jsxs("span",{className:"text-xs text-gray-500",children:[x,"/",f.length]})]}),a.jsx("div",{className:"mt-3 bg-gray-800 rounded-full h-1.5",children:a.jsx("div",{className:"bg-blue-500 rounded-full h-1.5 transition-all duration-500",style:{width:`${p}%`}})}),r&&f.length>0&&a.jsx("div",{className:"mt-3 space-y-1.5 ml-6",children:f.map((h,y)=>{const g=u[h.status]||Gn,v=d[h.status]||"text-gray-600";return a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(g,{className:`w-4 h-4 mt-0.5 flex-shrink-0 ${v}`}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:`text-sm ${h.status==="done"?"text-gray-400 line-through":h.status==="in_progress"?"text-blue-300 font-medium":"text-gray-400"}`,children:h.description}),h.result&&a.jsx("p",{className:"text-xs text-gray-600 mt-0.5",children:h.result})]})]},y)})})]})}function Zx({goal:n}){const r={active:Ga,completed:qe,failed:yn,cancelled:rp},s={active:"text-blue-400",completed:"text-emerald-400",failed:"text-red-400",cancelled:"text-gray-500"},o=r[n.status]||Ga,u=s[n.status]||"text-gray-400";return a.jsxs("div",{className:"flex items-start gap-3 py-2",children:[a.jsx(o,{className:`w-4 h-4 mt-0.5 flex-shrink-0 ${u}`}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:`text-sm ${n.status==="completed"?"text-gray-500 line-through":"text-gray-300"}`,children:n.description}),a.jsxs("p",{className:"text-xs text-gray-600 mt-0.5",children:[n.status," · priority ",n.priority??0]})]})]})}function sw({fact:n,onDelete:r}){const s={task_context:"bg-blue-500/20 text-blue-400",decision:"bg-purple-500/20 text-purple-400",progress:"bg-emerald-500/20 text-emerald-400",file_path:"bg-amber-500/20 text-amber-400",technical:"bg-cyan-500/20 text-cyan-400",user_preference:"bg-pink-500/20 text-pink-400",environment:"bg-orange-500/20 text-orange-400",credential:"bg-red-500/20 text-red-400",general:"bg-gray-500/20 text-gray-400"},o=s[n.category]||s.general;return a.jsxs("div",{className:"flex items-start gap-3 py-2 group",children:[a.jsx(es,{className:"w-4 h-4 mt-0.5 flex-shrink-0 text-gray-600"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"flex items-center gap-2 mb-0.5",children:a.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${o}`,children:n.category})}),a.jsx("p",{className:"text-sm text-gray-300",children:n.content})]}),a.jsx("button",{onClick:()=>r(n.id),className:"opacity-0 group-hover:opacity-100 transition-opacity text-gray-600 hover:text-red-400",children:a.jsx(Za,{className:"w-3.5 h-3.5"})})]})}function Kx({summary:n}){return n?a.jsxs("div",{className:"card space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Wr,{className:"w-4 h-4 text-purple-400"}),a.jsx("h4",{className:"text-sm font-semibold text-gray-300",children:"Conversation Summary"}),a.jsxs("span",{className:"text-xs text-gray-600 ml-auto",children:[n.summarized_count??0," messages compressed"]})]}),n.goals&&n.goals.length>0&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"Goals"}),a.jsx("ul",{className:"space-y-1",children:n.goals.map((r,s)=>a.jsxs("li",{className:"text-sm text-blue-300 flex items-start gap-2",children:[a.jsx(Ga,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),r]},s))})]}),n.current_state&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"Current State"}),a.jsx("p",{className:"text-sm text-gray-300",children:n.current_state})]}),n.progress&&n.progress.length>0&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"Progress"}),a.jsx("ul",{className:"space-y-1",children:n.progress.map((r,s)=>a.jsxs("li",{className:"text-sm text-emerald-300 flex items-start gap-2",children:[a.jsx(qe,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),r]},s))})]}),n.key_facts&&n.key_facts.length>0&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"Key Facts"}),a.jsx("ul",{className:"space-y-1",children:n.key_facts.map((r,s)=>a.jsxs("li",{className:"text-sm text-gray-400 flex items-start gap-2",children:[a.jsx(es,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0 text-gray-600"}),r]},s))})]}),n.next_steps&&n.next_steps.length>0&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"Next Steps"}),a.jsx("ul",{className:"space-y-1",children:n.next_steps.map((r,s)=>a.jsxs("li",{className:"text-sm text-amber-300 flex items-start gap-2",children:[a.jsx(Gn,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),r]},s))})]}),n.summary&&a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1",children:"Full Summary"}),a.jsx("p",{className:"text-sm text-gray-400 whitespace-pre-wrap",children:n.summary})]})]}):a.jsxs("div",{className:"card",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(Wr,{className:"w-4 h-4 text-gray-500"}),a.jsx("h4",{className:"text-sm font-semibold text-gray-400",children:"Conversation Summary"})]}),a.jsx("p",{className:"text-sm text-gray-600 italic",children:"No summary yet — conversation is short enough to fit in context."})]})}function iw(){const{conversationId:n}=Qe(),[r,s]=D.useState(null),[o,u]=D.useState([]),[d,f]=D.useState([]),[x,p]=D.useState([]),[h,y]=D.useState(null),[g,v]=D.useState(!0),[j,k]=D.useState("overview"),R=D.useCallback(async()=>{v(!0);try{const[z,U,$,fe]=await Promise.all([de.getMemoryStats().catch(()=>null),de.getPlans(n??void 0).catch(()=>[]),de.getGoals(n??void 0).catch(()=>({goals:[]})),de.getFacts().catch(()=>({facts:[]}))]);if(s(z),u(Array.isArray(U)?U:[]),f(($==null?void 0:$.goals)||[]),p((fe==null?void 0:fe.facts)||[]),n){const J=await de.getConversationSummary(n).catch(()=>({summary:null}));y((J==null?void 0:J.summary)||null)}}catch(z){console.error("Failed to load memory data:",z)}finally{v(!1)}},[n]);D.useEffect(()=>{R()},[R]);const S=async z=>{try{await de.deleteFact(z),p(U=>U.filter($=>$.id!==z))}catch(U){console.error("Failed to delete fact:",U)}},T=o.filter(z=>z.status==="active"),V=o.filter(z=>z.status==="completed"),H=d.filter(z=>z.status==="active"),I=[{id:"overview",label:"Overview",icon:an},{id:"plans",label:"Plans",icon:Yi,count:T.length},{id:"goals",label:"Goals",icon:Ga,count:H.length},{id:"facts",label:"Facts",icon:es,count:x.length},{id:"summary",label:"Summary",icon:Wr}];return a.jsxs("div",{className:"h-full overflow-y-auto space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-gray-100 mb-1",children:"Memory & Plans"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Persistent memory, goals, and execution plans — the agent never forgets"})]}),a.jsxs("button",{onClick:R,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-800 hover:bg-gray-700 text-gray-300 text-sm transition-colors",children:[a.jsx(Va,{className:`w-4 h-4 ${g?"animate-spin":""}`}),"Refresh"]})]}),a.jsx("div",{className:"flex gap-1 bg-gray-900 rounded-lg p-1",children:I.map(z=>{const U=z.icon;return a.jsxs("button",{onClick:()=>k(z.id),className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-all ${j===z.id?"bg-gray-800 text-gray-200 shadow-sm":"text-gray-500 hover:text-gray-300"}`,children:[a.jsx(U,{className:"w-4 h-4"}),z.label,z.count!==void 0&&z.count>0&&a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-blue-500/20 text-blue-400 font-semibold",children:z.count})]},z.id)})}),j==="overview"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-4 lg:grid-cols-6",children:[a.jsx(Ha,{icon:ip,label:"Messages",value:(r==null?void 0:r.messages)??0,color:"blue"}),a.jsx(Ha,{icon:an,label:"Conversations",value:(r==null?void 0:r.conversations)??0,color:"purple"}),a.jsx(Ha,{icon:es,label:"Facts",value:(r==null?void 0:r.facts)??0,color:"amber"}),a.jsx(Ha,{icon:Ga,label:"Active Goals",value:(r==null?void 0:r.active_goals)??0,color:"emerald"}),a.jsx(Ha,{icon:Wr,label:"Summaries",value:(r==null?void 0:r.summaries)??0,color:"plutus"}),a.jsx(Ha,{icon:Yi,label:"Checkpoints",value:(r==null?void 0:r.checkpoints)??0,color:"gray"})]}),T.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Active Plans"}),a.jsx("div",{className:"space-y-3",children:T.map(z=>a.jsx($u,{plan:z},z.id))})]}),H.length>0&&a.jsxs("div",{className:"card",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Active Goals"}),a.jsx("div",{className:"divide-y divide-gray-800",children:H.slice(0,5).map(z=>a.jsx(Zx,{goal:z},z.id))})]}),n&&a.jsx(Kx,{summary:h})]}),j==="plans"&&a.jsx("div",{className:"space-y-4",children:o.length===0?a.jsxs("div",{className:"card text-center py-8",children:[a.jsx(Yi,{className:"w-8 h-8 text-gray-600 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"No plans yet. The agent creates plans for complex tasks."})]}):a.jsxs(a.Fragment,{children:[T.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Active"}),a.jsx("div",{className:"space-y-3",children:T.map(z=>a.jsx($u,{plan:z},z.id))})]}),V.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Completed"}),a.jsx("div",{className:"space-y-3",children:V.map(z=>a.jsx($u,{plan:z},z.id))})]})]})}),j==="goals"&&a.jsx("div",{className:"card",children:d.length===0?a.jsxs("div",{className:"text-center py-8",children:[a.jsx(Ga,{className:"w-8 h-8 text-gray-600 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"No goals tracked yet."})]}):a.jsx("div",{className:"divide-y divide-gray-800",children:d.map(z=>a.jsx(Zx,{goal:z},z.id))})}),j==="facts"&&a.jsx("div",{className:"card",children:x.length===0?a.jsxs("div",{className:"text-center py-8",children:[a.jsx(es,{className:"w-8 h-8 text-gray-600 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"No facts stored yet. The agent saves important information here."})]}):a.jsx("div",{className:"divide-y divide-gray-800",children:x.map(z=>a.jsx(sw,{fact:z,onDelete:S},z.id))})}),j==="summary"&&a.jsx("div",{children:n?a.jsx(Kx,{summary:h}):a.jsxs("div",{className:"card text-center py-8",children:[a.jsx(Wr,{className:"w-8 h-8 text-gray-600 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Start a conversation to see summaries here."})]})})]})}const Eg={Send:fd,Mail:w1,MessageCircle:k1};function Ix({connector:n,onConfigure:r}){const s=Eg[n.icon]||is,o=n.name==="telegram"&&n.configured&&n.connected;return a.jsx("div",{className:`group relative rounded-2xl border transition-all duration-200 hover:shadow-lg ${n.configured?o?"border-blue-500/25 bg-blue-500/[0.03] hover:border-blue-500/40 hover:shadow-blue-500/5":"border-emerald-500/25 bg-emerald-500/[0.03] hover:border-emerald-500/40 hover:shadow-emerald-500/5":"border-gray-800/60 bg-surface hover:border-gray-700/80 hover:shadow-gray-900/20"}`,children:a.jsxs("div",{className:"p-5",children:[a.jsxs("div",{className:"flex items-start justify-between mb-4",children:[a.jsx("div",{className:`w-12 h-12 rounded-xl flex items-center justify-center transition-colors ${o?"bg-blue-500/15 text-blue-400":n.configured?"bg-emerald-500/15 text-emerald-400":"bg-gray-800/80 text-gray-500 group-hover:bg-gray-800 group-hover:text-gray-400"}`,children:a.jsx(s,{className:"w-6 h-6"})}),o?a.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold px-2.5 py-1 rounded-full bg-blue-500/15 text-blue-400 ring-1 ring-blue-500/20",children:[a.jsx(gp,{className:"w-3 h-3 animate-pulse"}),"Listening"]}):n.configured?a.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold px-2.5 py-1 rounded-full bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/20",children:[a.jsx(qe,{className:"w-3 h-3"}),"Connected"]}):a.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] font-semibold px-2.5 py-1 rounded-full bg-gray-800/60 text-gray-500 ring-1 ring-gray-700/30",children:[a.jsx(E1,{className:"w-3 h-3"}),"Not configured"]})]}),a.jsx("h3",{className:"text-[15px] font-semibold text-gray-100 mb-1",children:n.display_name}),a.jsx("p",{className:"text-xs text-gray-500 leading-relaxed line-clamp-2 mb-5",children:n.description}),a.jsx("button",{onClick:()=>r(n),className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all duration-200 ${n.configured?"bg-gray-800/60 hover:bg-gray-800 text-gray-300 hover:text-gray-100":"bg-plutus-600 hover:bg-plutus-500 text-white shadow-md shadow-plutus-600/15 hover:shadow-lg hover:shadow-plutus-500/20 active:scale-[0.98]"}`,children:n.configured?a.jsxs(a.Fragment,{children:[a.jsx(vp,{className:"w-4 h-4"}),"Manage"]}):a.jsxs(a.Fragment,{children:["Configure",a.jsx(cd,{className:"w-4 h-4"})]})})]})})}function ow({connector:n,onClose:r,onRefresh:s}){var F;const[o,u]=D.useState({}),[d,f]=D.useState(!1),[x,p]=D.useState(!1),[h,y]=D.useState(null),[g,v]=D.useState(!1),[j,k]=D.useState(null),[R,S]=D.useState(""),[T,V]=D.useState({}),[H,I]=D.useState(!1),[z,U]=D.useState(!1),[$,fe]=D.useState(!1),[J,M]=D.useState(n.auto_start||!1),[ne,re]=D.useState(!1),Z=Eg[n.icon]||is,Q=n.name==="telegram";D.useEffect(()=>{const w={};n.config_schema.forEach(oe=>{w[oe.name]=n.config[oe.name]||""}),u(w)},[n]),D.useEffect(()=>{if(!Q||!n.configured)return;const w=async()=>{try{const xe=await de.getBridgeStatus(n.name);U(xe.listening||!1),xe.auto_start!==void 0&&M(xe.auto_start)}catch{}};w();const oe=setInterval(w,5e3);return()=>clearInterval(oe)},[n.name,n.configured,Q]),D.useEffect(()=>{const w=oe=>{oe.key==="Escape"&&r()};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[r]);const ee=async()=>{f(!0),y(null);try{await de.updateConnectorConfig(n.name,o),s(),y({success:!0,message:"Configuration saved!"}),setTimeout(()=>y(null),3e3)}catch(w){y({success:!1,message:`Failed to save: ${w.message}`})}finally{f(!1)}},A=async()=>{p(!0),y(null);try{const w=await de.testConnector(n.name);y({success:w.success,message:w.message}),w.success&&s()}catch(w){y({success:!1,message:`Test failed: ${w.message}`})}finally{p(!1)}},O=async()=>{if(R.trim()){v(!0),k(null);try{const w=await de.sendConnectorMessage(n.name,R);k({success:w.success,message:w.message}),w.success&&S("")}catch(w){k({success:!1,message:`Send failed: ${w.message}`})}finally{v(!1)}}},le=async()=>{I(!0);try{z&&(await de.stopConnector(n.name),U(!1)),await de.disconnectConnector(n.name),s(),r()}catch(w){console.error("Disconnect failed:",w)}finally{I(!1)}},ie=w=>{V(oe=>({...oe,[w]:!oe[w]}))},C=async()=>{fe(!0);try{if(z)await de.stopConnector(n.name),U(!1);else{const w=await de.startConnector(n.name);U(w.listening||!1)}}catch(w){console.error("Toggle listener failed:",w)}finally{fe(!1)}},_=async()=>{re(!0);try{const w=!J;await de.setConnectorAutoStart(n.name,w),M(w)}catch(w){console.error("Toggle auto-start failed:",w)}finally{re(!1)}};return a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[a.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:r}),a.jsxs("div",{className:"relative w-full max-w-lg mx-4 max-h-[85vh] flex flex-col bg-gray-950 border border-gray-800/60 rounded-2xl shadow-2xl shadow-black/40 animate-fade-in",children:[a.jsxs("div",{className:"flex items-center gap-4 px-6 pt-6 pb-4 border-b border-gray-800/40",children:[a.jsx("div",{className:`w-11 h-11 rounded-xl flex items-center justify-center ${z?"bg-blue-500/15 text-blue-400":n.configured?"bg-emerald-500/15 text-emerald-400":"bg-plutus-500/10 text-plutus-400"}`,children:a.jsx(Z,{className:"w-5 h-5"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"text-base font-semibold text-gray-100",children:n.display_name}),a.jsx("p",{className:"text-xs text-gray-500 truncate",children:n.description})]}),a.jsx("button",{onClick:r,className:"p-2 rounded-xl text-gray-500 hover:text-gray-300 hover:bg-gray-800/60 transition-colors",children:a.jsx(Vl,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-5 space-y-5",children:[Q&&n.configured&&a.jsxs("div",{className:"rounded-xl bg-gray-900/80 border border-gray-800/40 p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`w-9 h-9 rounded-lg flex items-center justify-center ${z?"bg-blue-500/15 text-blue-400":"bg-gray-800 text-gray-500"}`,children:a.jsx(T1,{className:"w-4 h-4"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-semibold text-gray-200",children:"Two-Way Messaging"}),a.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:z?"Listening for incoming messages":"Chat with Plutus from Telegram"})]})]}),a.jsxs("button",{onClick:C,disabled:$,className:`flex items-center gap-1.5 px-3.5 py-2 rounded-lg text-xs font-semibold transition-all disabled:opacity-50 ${z?"bg-red-500/10 hover:bg-red-500/20 text-red-400 ring-1 ring-red-500/20":"bg-blue-600 hover:bg-blue-500 text-white"}`,children:[$?a.jsx(Xr,{className:"w-3.5 h-3.5 animate-spin"}):z?a.jsx(Pi,{className:"w-3 h-3"}):a.jsx(Fa,{className:"w-3 h-3"}),z?"Stop":"Start"]})]}),z&&a.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-blue-400/70 pl-12",children:[a.jsx(gp,{className:"w-3 h-3 animate-pulse"}),"Messages sent to the bot will be processed automatically"]}),a.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-gray-800/30",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-medium text-gray-300",children:"Start on launch"}),a.jsx("p",{className:"text-[10px] text-gray-600 mt-0.5",children:"Auto-start when Plutus boots"})]}),a.jsx("button",{onClick:_,disabled:ne,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${J?"bg-blue-600":"bg-gray-700"} ${ne?"opacity-50":""}`,children:a.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform ${J?"translate-x-[18px]":"translate-x-[3px]"}`})})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider mb-3",children:"Configuration"}),a.jsx("div",{className:"space-y-3",children:n.config_schema.map(w=>a.jsxs("div",{children:[a.jsxs("label",{className:"text-xs font-medium text-gray-400 mb-1.5 block",children:[w.label,w.required&&a.jsx("span",{className:"text-red-400 ml-0.5",children:"*"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:w.type==="password"&&!T[w.name]?"password":w.type==="number"?"number":"text",className:"w-full bg-gray-900/80 border border-gray-800/60 rounded-xl px-3.5 py-2.5 text-sm text-gray-200 placeholder-gray-600 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20 transition-all",placeholder:w.placeholder,value:o[w.name]||"",onChange:oe=>u(xe=>({...xe,[w.name]:oe.target.value}))}),w.type==="password"&&a.jsx("button",{type:"button",onClick:()=>ie(w.name),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-600 hover:text-gray-400 transition-colors",children:T[w.name]?a.jsx(ud,{className:"w-4 h-4"}):a.jsx(Ql,{className:"w-4 h-4"})})]}),w.help&&a.jsx("p",{className:"text-[10px] text-gray-600 mt-1.5 pl-0.5",children:w.help})]},w.name))})]}),h&&a.jsxs("div",{className:`flex items-start gap-2.5 p-3.5 rounded-xl text-sm ${h.success?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:[h.success?a.jsx(qe,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}):a.jsx(yn,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:h.message})]}),n.configured&&n.name!=="whatsapp"&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider mb-3",children:"Send Test Message"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:"text",className:"flex-1 bg-gray-900/80 border border-gray-800/60 rounded-xl px-3.5 py-2.5 text-sm text-gray-200 placeholder-gray-600 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20 transition-all",placeholder:`Message via ${n.display_name}...`,value:R,onChange:w=>S(w.target.value),onKeyDown:w=>w.key==="Enter"&&O()}),a.jsx("button",{onClick:O,disabled:g||!R.trim(),className:"flex items-center gap-1.5 px-4 py-2.5 rounded-xl bg-blue-600 hover:bg-blue-500 text-white text-sm font-medium transition-colors disabled:opacity-50",children:g?a.jsx(Xr,{className:"w-3.5 h-3.5 animate-spin"}):a.jsx(fd,{className:"w-3.5 h-3.5"})})]}),j&&a.jsxs("div",{className:`flex items-center gap-2 mt-2 text-xs ${j.success?"text-emerald-400":"text-red-400"}`,children:[j.success?a.jsx(qe,{className:"w-3.5 h-3.5"}):a.jsx(yn,{className:"w-3.5 h-3.5"}),a.jsx("span",{children:j.message})]})]}),n.name==="telegram"&&n.config.bot_username&&a.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[a.jsx(op,{className:"w-3.5 h-3.5"}),a.jsxs("span",{children:["Bot:"," ",a.jsx("a",{href:`https://t.me/${(F=n.config.bot_username)==null?void 0:F.replace("@","")}`,target:"_blank",rel:"noopener noreferrer",className:"text-plutus-400 hover:text-plutus-300 transition-colors",children:n.config.bot_username})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 px-6 py-4 border-t border-gray-800/40",children:[a.jsxs("button",{onClick:ee,disabled:d,className:"flex items-center gap-2 px-5 py-2.5 rounded-xl bg-plutus-600 hover:bg-plutus-500 text-white text-sm font-medium transition-all disabled:opacity-50 shadow-md shadow-plutus-600/15 active:scale-[0.98]",children:[d?a.jsx(Xr,{className:"w-3.5 h-3.5 animate-spin"}):a.jsx(is,{className:"w-3.5 h-3.5"}),"Save"]}),a.jsxs("button",{onClick:A,disabled:x,className:"flex items-center gap-2 px-5 py-2.5 rounded-xl bg-gray-800/80 hover:bg-gray-800 text-gray-300 hover:text-gray-100 text-sm font-medium transition-all disabled:opacity-50",children:[x?a.jsx(Xr,{className:"w-3.5 h-3.5 animate-spin"}):a.jsx($t,{className:"w-3.5 h-3.5"}),"Test Connection"]}),a.jsx("div",{className:"flex-1"}),n.configured&&a.jsxs("button",{onClick:le,disabled:H,className:"flex items-center gap-2 px-4 py-2.5 rounded-xl bg-red-500/10 hover:bg-red-500/20 text-red-400 text-sm font-medium transition-all disabled:opacity-50 ring-1 ring-red-500/20",children:[H?a.jsx(Xr,{className:"w-3.5 h-3.5 animate-spin"}):a.jsx(Za,{className:"w-3.5 h-3.5"}),"Disconnect"]})]})]})]})}function cw(){const[n,r]=D.useState([]),[s,o]=D.useState(!0),[u,d]=D.useState(null),f=D.useCallback(async()=>{try{const y=await de.getConnectors();r(y.connectors||[])}catch(y){console.error("Failed to load connectors:",y)}finally{o(!1)}},[]);D.useEffect(()=>{f()},[f]);const x=D.useCallback(()=>{f(),u&&de.getConnector(u.name).then(y=>d(y)).catch(()=>{})},[f,u]);if(s)return a.jsx("div",{className:"h-full flex items-center justify-center",children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 border-2 border-plutus-500/30 border-t-plutus-500 rounded-full animate-spin"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Loading connectors..."})]})});const p=n.filter(y=>y.configured),h=n.filter(y=>!y.configured);return a.jsxs("div",{className:"h-full overflow-y-auto",children:[a.jsxs("div",{className:"max-w-4xl mx-auto p-6 space-y-8",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-gray-100 mb-1",children:"Connectors"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Link Plutus with external services for notifications and two-way communication"})]}),p.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("h3",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Connected"}),a.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full bg-emerald-500/10 text-emerald-400 ring-1 ring-emerald-500/20",children:p.length})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:p.map(y=>a.jsx(Ix,{connector:y,onConfigure:d},y.name))})]}),h.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("h3",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Available"}),a.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full bg-gray-800/60 text-gray-500 ring-1 ring-gray-700/30",children:h.length})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:h.map(y=>a.jsx(Ix,{connector:y,onConfigure:d},y.name))})]}),n.length===0&&a.jsxs("div",{className:"text-center py-16",children:[a.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gray-800/60 flex items-center justify-center mx-auto mb-4",children:a.jsx(is,{className:"w-7 h-7 text-gray-600"})}),a.jsx("h3",{className:"text-sm font-semibold text-gray-300 mb-1",children:"No connectors available"}),a.jsx("p",{className:"text-xs text-gray-500 max-w-sm mx-auto",children:"Connectors let Plutus communicate through external services like Telegram, email, and more."})]}),a.jsxs("div",{className:"rounded-2xl bg-surface border border-gray-800/60 p-5",children:[a.jsx("h4",{className:"text-sm font-semibold text-gray-300 mb-3",children:"How Connectors Work"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[{step:"1",text:"Click a connector and enter your credentials"},{step:"2",text:'Hit "Test Connection" to verify it works'},{step:"3",text:"Enable two-way messaging to chat from external apps"},{step:"4",text:'Ask Plutus to "send me a Telegram message" anytime'}].map(y=>a.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-xl bg-gray-900/40",children:[a.jsx("span",{className:"w-6 h-6 rounded-lg bg-plutus-500/10 text-plutus-400 text-xs font-bold flex items-center justify-center flex-shrink-0",children:y.step}),a.jsx("span",{className:"text-xs text-gray-500 leading-relaxed",children:y.text})]},y.step))})]})]}),u&&a.jsx(ow,{connector:u,onClose:()=>d(null),onRefresh:x})]})}const Ag=[{id:"anthropic",label:"Anthropic",sublabel:"Claude models",icon:"A",color:"from-orange-500 to-amber-600",keyPlaceholder:"sk-ant-...",keyUrl:"https://console.anthropic.com/settings/keys",keyLabel:"Anthropic Console"},{id:"openai",label:"OpenAI",sublabel:"GPT models",icon:"O",color:"from-emerald-500 to-teal-600",keyPlaceholder:"sk-...",keyUrl:"https://platform.openai.com/api-keys",keyLabel:"OpenAI Dashboard"},{id:"ollama",label:"Ollama",sublabel:"Free, local models",icon:"L",color:"from-blue-500 to-indigo-600",keyPlaceholder:"",keyUrl:"",keyLabel:""},{id:"custom",label:"Custom",sublabel:"Any endpoint",icon:"C",color:"from-gray-500 to-gray-600",keyPlaceholder:"your-api-key",keyUrl:"",keyLabel:""}],uw=[{id:"observer",label:"Observer",desc:"Read-only. Plutus can look but not touch anything.",icon:Ql,color:"text-gray-400",bg:"bg-gray-500/10 border-gray-700/60",activeBg:"bg-gray-500/20 border-gray-400/40"},{id:"assistant",label:"Assistant",desc:"Every action requires your explicit approval first.",icon:bn,label2:"Recommended for new users",color:"text-blue-400",bg:"bg-blue-500/10 border-blue-700/40",activeBg:"bg-blue-500/20 border-blue-400/40"},{id:"operator",label:"Operator",desc:"Pre-approved safe actions run automatically. Risky ones still ask.",icon:vn,color:"text-amber-400",bg:"bg-amber-500/10 border-amber-700/40",activeBg:"bg-amber-500/20 border-amber-400/40"},{id:"autonomous",label:"Autonomous",desc:"Full system control. No restrictions. For advanced users only.",icon:$t,color:"text-red-400",bg:"bg-red-500/10 border-red-700/40",activeBg:"bg-red-500/20 border-red-400/40"}],dw=[{icon:rn,label:"Run shell commands",desc:"Execute anything in your terminal"},{icon:Ii,label:"Browse the web",desc:"Search, scrape, and interact with sites"},{icon:an,label:"Long-term memory",desc:"Remembers facts across conversations"},{icon:bl,label:"Parallel workers",desc:"Spawn sub-agents for complex tasks"},{icon:Xl,label:"Desktop control",desc:"Click, type, and see your screen"},{icon:vn,label:"Custom tools",desc:"Build your own tools with Python"}];function fw(){const[n,r]=D.useState(0),[s,o]=D.useState("anthropic"),[u,d]=D.useState(""),[f,x]=D.useState(!1),[p,h]=D.useState(!1),[y,g]=D.useState(!1),[v,j]=D.useState(""),[k,R]=D.useState("assistant"),[S,T]=D.useState(!1),[V,H]=D.useState(""),[I,z]=D.useState(null),[U,$]=D.useState(!1),[fe,J]=D.useState(!1),M=Ag.find(_=>_.id===s),ne=s!=="ollama",re=I?5:4,Z=re-1,[Q,ee]=D.useState(!1);D.useEffect(()=>{de.getKeyStatus().then(_=>{var F;ee(((F=_.providers)==null?void 0:F[s])??!1)}).catch(()=>{})},[s]),D.useEffect(()=>{de.getWSLStatus().then(_=>{z(_.is_windows),$(_.wsl_installed),J(_.setup_completed)}).catch(()=>{z(!1)})},[]);const A=()=>n===1?!0:n===2?!ne||y||Q:!0,O=async()=>{if(u.trim()){h(!0),j("");try{const _=await de.setKey(s,u.trim());g(!0),ee(!0),d(""),x(!1),_.key_configured&&Qe.getState().setKeyConfigured(!0)}catch{j("Failed to save key. Please try again.")}finally{h(!1)}}},le=async()=>{T(!0);try{const _={anthropic:"claude-sonnet-4-6",openai:"gpt-4.1",ollama:"llama3.2",custom:"gpt-4.1"};await de.updateConfig({model:{provider:s,model:_[s]||"claude-sonnet-4-6",base_url:V||null},guardrails:{tier:k}}),await de.completeSetup(),Qe.getState().setOnboardingCompleted(!0),Qe.getState().setView("chat")}catch{Qe.getState().setOnboardingCompleted(!0),Qe.getState().setView("chat")}},ie=()=>r(_=>Math.min(_+1,Z)),C=()=>r(_=>Math.max(_-1,0));return I===null?a.jsx("div",{className:"fixed inset-0 bg-gray-950 z-50 flex items-center justify-center",children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-plutus-500 to-plutus-700 flex items-center justify-center font-bold text-lg shadow-lg shadow-plutus-600/20 ring-1 ring-white/10",children:"P"}),a.jsx("div",{className:"w-6 h-6 border-2 border-plutus-500/30 border-t-plutus-500 rounded-full animate-spin"})]})}):a.jsxs("div",{className:"fixed inset-0 bg-gray-950 z-50 flex items-center justify-center overflow-y-auto",children:[a.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[a.jsx("div",{className:"absolute -top-1/2 -left-1/4 w-[800px] h-[800px] rounded-full bg-plutus-600/5 blur-[120px]"}),a.jsx("div",{className:"absolute -bottom-1/2 -right-1/4 w-[600px] h-[600px] rounded-full bg-indigo-600/5 blur-[100px]"})]}),a.jsxs("div",{className:"relative w-full max-w-2xl mx-auto px-6 py-12",children:[a.jsx("div",{className:"flex items-center gap-2 mb-10",children:Array.from({length:re}).map((_,F)=>a.jsx("div",{className:`h-1 flex-1 rounded-full transition-all duration-500 ${F<=n?"bg-plutus-500":"bg-gray-800"}`},F))}),a.jsxs("div",{className:"min-h-[480px]",children:[n===0&&a.jsx(mw,{}),n===1&&a.jsx(hw,{provider:s,setProvider:_=>{o(_),g(!1),d(""),j("")},baseUrl:V,setBaseUrl:H}),n===2&&a.jsx(xw,{provider:M,needsKey:ne,apiKey:u,setApiKey:d,showKey:f,setShowKey:x,savingKey:p,keySaved:y||Q,keyError:v,onSaveKey:O}),n===3&&!I&&a.jsx(Jx,{tier:k,setTier:R}),n===3&&I&&a.jsx(Jx,{tier:k,setTier:R}),n===4&&I&&a.jsx(gw,{wslDetected:U,wslSetupDone:fe,onSetupComplete:()=>J(!0)})]}),a.jsxs("div",{className:"flex items-center justify-between mt-8",children:[a.jsx("div",{children:n>0&&a.jsxs("button",{onClick:C,className:"flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm text-gray-400 hover:text-gray-200 hover:bg-gray-800/60 transition-all",children:[a.jsx(ts,{className:"w-4 h-4"}),"Back"]})}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"text-xs text-gray-600",children:[n+1," of ",re]}),n<Z?a.jsxs("button",{onClick:ie,disabled:!A(),className:"flex items-center gap-2 px-6 py-2.5 rounded-xl bg-plutus-600 hover:bg-plutus-500 disabled:opacity-40 disabled:hover:bg-plutus-600 text-white text-sm font-medium transition-all shadow-lg shadow-plutus-600/20 hover:shadow-plutus-500/30",children:["Continue",a.jsx(gn,{className:"w-4 h-4"})]}):a.jsx("button",{onClick:le,disabled:S,className:"flex items-center gap-2 px-8 py-2.5 rounded-xl bg-plutus-600 hover:bg-plutus-500 disabled:opacity-60 text-white text-sm font-medium transition-all shadow-lg shadow-plutus-600/20 hover:shadow-plutus-500/30",children:S?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Setting up..."]}):a.jsxs(a.Fragment,{children:["Launch Plutus",a.jsx($t,{className:"w-4 h-4"})]})})]})]})]})]})}function mw(){return a.jsxs("div",{className:"animate-onboard-in",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[a.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-plutus-500 to-plutus-700 flex items-center justify-center text-2xl font-bold shadow-xl shadow-plutus-600/30 ring-1 ring-white/10",children:"P"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-100",children:"Welcome to Plutus"}),a.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:"Your autonomous AI agent"})]})]}),a.jsx("p",{className:"text-gray-400 mt-6 text-[15px] leading-relaxed max-w-xl",children:"Plutus is an AI assistant that can control your computer, run commands, browse the web, manage files, and automate complex tasks — all from a single chat interface."}),a.jsx("p",{className:"text-gray-500 mt-3 text-sm leading-relaxed max-w-xl",children:"This setup takes about 60 seconds. We'll connect an AI provider, set your safety preferences, and you'll be ready to go."}),a.jsx("div",{className:"grid grid-cols-2 gap-3 mt-8",children:dw.map(n=>{const r=n.icon;return a.jsxs("div",{className:"flex items-start gap-3 p-3.5 rounded-xl bg-gray-900/60 border border-gray-800/50",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-plutus-500/10 flex items-center justify-center shrink-0 mt-0.5",children:a.jsx(r,{className:"w-4 h-4 text-plutus-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-gray-200",children:n.label}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:n.desc})]})]},n.label)})})]})}function hw({provider:n,setProvider:r,baseUrl:s,setBaseUrl:o}){return a.jsxs("div",{className:"animate-onboard-in",children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Choose your AI provider"}),a.jsx("p",{className:"text-sm text-gray-500 mt-2 mb-8",children:"Select which AI service will power Plutus. You can change this later in Settings."}),a.jsx("div",{className:"grid grid-cols-2 gap-3",children:Ag.map(u=>{const d=n===u.id;return a.jsxs("button",{onClick:()=>r(u.id),className:`relative flex items-center gap-4 p-5 rounded-xl border-2 transition-all text-left ${d?"border-plutus-500/60 bg-plutus-500/5 shadow-lg shadow-plutus-500/10":"border-gray-800/60 bg-gray-900/40 hover:border-gray-700/60 hover:bg-gray-900/60"}`,children:[a.jsx("div",{className:`w-12 h-12 rounded-xl bg-gradient-to-br ${u.color} flex items-center justify-center text-white text-lg font-bold shadow-md`,children:u.icon}),a.jsxs("div",{children:[a.jsx("p",{className:"text-base font-semibold text-gray-200",children:u.label}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:u.sublabel})]}),d&&a.jsx("div",{className:"absolute top-3 right-3",children:a.jsx(qe,{className:"w-5 h-5 text-plutus-400"})})]},u.id)})}),(n==="custom"||n==="ollama")&&a.jsxs("div",{className:"mt-6",children:[a.jsx("label",{className:"text-sm text-gray-400 mb-2 block",children:"Base URL"}),a.jsx("input",{type:"text",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-xl px-4 py-3 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-1 focus:ring-plutus-500/20",value:s,onChange:u=>o(u.target.value),placeholder:n==="ollama"?"http://localhost:11434":"https://your-api-endpoint.com/v1"}),n==="ollama"&&a.jsx("p",{className:"text-xs text-gray-600 mt-2",children:"Make sure Ollama is running locally. Default: http://localhost:11434"})]})]})}function xw({provider:n,needsKey:r,apiKey:s,setApiKey:o,showKey:u,setShowKey:d,savingKey:f,keySaved:x,keyError:p,onSaveKey:h}){return r?a.jsxs("div",{className:"animate-onboard-in",children:[a.jsxs("h2",{className:"text-2xl font-bold text-gray-100",children:["Connect your ",n.label," key"]}),a.jsxs("p",{className:"text-sm text-gray-500 mt-2 mb-2",children:["Plutus needs an API key to communicate with ",n.label,". Your key is stored locally and never sent anywhere except ",n.label,"'s API."]}),n.keyUrl&&a.jsxs("p",{className:"text-sm text-gray-500 mb-8",children:["Don't have one?"," ",a.jsxs("a",{href:n.keyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-plutus-400 hover:text-plutus-300 underline underline-offset-2",children:["Get a key from ",n.keyLabel]})]}),x?a.jsxs("div",{className:"flex items-center gap-3 p-5 rounded-xl bg-emerald-500/10 border border-emerald-500/20 mb-4",children:[a.jsx(qe,{className:"w-6 h-6 text-emerald-400 shrink-0"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-emerald-300",children:"API key configured"}),a.jsx("p",{className:"text-xs text-emerald-400/60 mt-0.5",children:"Stored securely at ~/.plutus/.secrets.json"})]})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"text-sm text-gray-400 mb-2 block",children:[a.jsx(ss,{className:"w-3.5 h-3.5 inline mr-1.5 -mt-0.5"}),"API Key"]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx("input",{type:u?"text":"password",className:"w-full bg-gray-800/50 border border-gray-700/50 rounded-xl px-4 py-3.5 pr-11 text-sm text-gray-300 focus:outline-none focus:border-plutus-500/50 focus:ring-2 focus:ring-plutus-500/20 font-mono",value:s,onChange:y=>o(y.target.value),placeholder:n.keyPlaceholder,onKeyDown:y=>{y.key==="Enter"&&h()},autoFocus:!0}),a.jsx("button",{onClick:()=>d(!u),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 p-1",children:u?a.jsx(ud,{className:"w-4 h-4"}):a.jsx(Ql,{className:"w-4 h-4"})})]}),a.jsxs("button",{onClick:h,disabled:f||!s.trim(),className:"flex items-center gap-2 px-5 py-3 rounded-xl bg-plutus-600 hover:bg-plutus-500 disabled:opacity-40 disabled:hover:bg-plutus-600 text-white text-sm font-medium transition-all whitespace-nowrap",children:[f?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx(ss,{className:"w-4 h-4"}),f?"Saving...":"Save Key"]})]})]}),p&&a.jsx("p",{className:"text-xs text-red-400",children:p})]}),a.jsx("div",{className:"mt-8 p-4 rounded-xl bg-gray-900/60 border border-gray-800/50",children:a.jsxs("p",{className:"text-xs text-gray-500 leading-relaxed",children:[a.jsx("span",{className:"text-gray-400 font-medium",children:"Privacy:"})," Your API key is stored in ",a.jsx("code",{className:"text-gray-400 bg-gray-800 px-1.5 py-0.5 rounded text-[11px]",children:"~/.plutus/.secrets.json"})," with restricted file permissions (owner-only). It is never included in config files or sent to any service other than your chosen provider."]})})]}):a.jsxs("div",{className:"animate-onboard-in",children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"No API key needed"}),a.jsx("p",{className:"text-sm text-gray-500 mt-2 mb-8",children:"Ollama runs locally on your machine — no API key or account required. Just make sure Ollama is installed and running."}),a.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-xl bg-emerald-500/10 border border-emerald-500/20",children:[a.jsx(qe,{className:"w-5 h-5 text-emerald-400 shrink-0"}),a.jsx("p",{className:"text-sm text-emerald-300",children:"You're all set! Click Continue to pick your safety tier."})]})]})}function Jx({tier:n,setTier:r}){return a.jsxs("div",{className:"animate-onboard-in",children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Set your safety level"}),a.jsx("p",{className:"text-sm text-gray-500 mt-2 mb-8",children:"Guardrails control what Plutus can do without asking. You can change this anytime from the Guardrails page."}),a.jsx("div",{className:"space-y-3",children:uw.map(s=>{const o=s.icon,u=n===s.id;return a.jsxs("button",{onClick:()=>r(s.id),className:`w-full flex items-start gap-4 p-4 rounded-xl border-2 transition-all text-left ${u?s.activeBg:`${s.bg} hover:brightness-110`}`,children:[a.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center shrink-0 mt-0.5 ${u?"bg-white/10":"bg-white/5"}`,children:a.jsx(o,{className:`w-5 h-5 ${s.color}`})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-semibold text-gray-200",children:s.label}),s.label2&&a.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-blue-500/15 text-blue-400 font-medium",children:s.label2})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s.desc})]}),u&&a.jsx(qe,{className:`w-5 h-5 shrink-0 mt-1 ${s.color}`})]},s.id)})})]})}const pw=[{icon:Zu,label:"Package managers",desc:"apt, pip, npm, cargo — install anything in seconds"},{icon:Ki,label:"Dev tools",desc:"GCC, Python, Node.js, Rust, Go, and more"},{icon:bp,label:"Server tools",desc:"Docker, nginx, PostgreSQL, Redis, SSH"},{icon:h1,label:"Shell scripting",desc:"Full Bash with grep, sed, awk, and thousands of CLI tools"}];function gw({wslDetected:n,wslSetupDone:r,onSetupComplete:s}){const[o,u]=D.useState(!1),[d,f]=D.useState(!1),x=async()=>{f(!0);try{await de.completeWSLSetup(),s()}catch{s()}finally{f(!1)}};return r?a.jsxs("div",{className:"animate-onboard-in",children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Linux Superpowers"}),a.jsx("p",{className:"text-sm text-gray-500 mt-2 mb-6",children:"WSL is configured and ready to go."}),a.jsxs("div",{className:"flex items-center gap-4 p-5 rounded-xl bg-emerald-500/10 border border-emerald-500/20 mb-6",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-emerald-500/20 flex items-center justify-center",children:a.jsx(qe,{className:"w-6 h-6 text-emerald-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-base font-semibold text-emerald-300",children:"WSL is active"}),a.jsx("p",{className:"text-sm text-emerald-400/60 mt-0.5",children:"Plutus has full access to Linux tools on your Windows machine."})]})]}),a.jsxs("p",{className:"text-sm text-gray-500",children:["Click ",a.jsx("span",{className:"text-gray-300",children:"Launch Plutus"})," to start using your AI agent."]})]}):o?a.jsx(yw,{wslDetected:n,onComplete:x,onBack:()=>u(!1)}):a.jsxs("div",{className:"animate-onboard-in",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-orange-500 to-amber-600 flex items-center justify-center shadow-lg shadow-orange-600/20",children:a.jsx(rn,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Unlock Linux Superpowers"}),a.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:"Recommended for the full Plutus experience"})]})]}),a.jsx("div",{className:"mt-5 p-4 rounded-xl bg-orange-500/5 border border-orange-500/15",children:a.jsxs("p",{className:"text-sm text-gray-300 leading-relaxed",children:[a.jsx("span",{className:"text-orange-400 font-semibold",children:"WSL (Windows Subsystem for Linux)"})," gives Plutus access to the entire Linux ecosystem directly on your Windows PC — no virtual machine, no dual-boot, no complexity. It's like giving your AI agent a second brain."]})}),a.jsx("div",{className:"grid grid-cols-2 gap-3 mt-5",children:pw.map(p=>{const h=p.icon;return a.jsxs("div",{className:"flex items-start gap-3 p-3.5 rounded-xl bg-gray-900/60 border border-gray-800/50",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-orange-500/10 flex items-center justify-center shrink-0 mt-0.5",children:a.jsx(h,{className:"w-4 h-4 text-orange-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-gray-200",children:p.label}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:p.desc})]})]},p.label)})}),n&&a.jsxs("div",{className:"mt-5 flex items-center gap-3 p-3.5 rounded-xl bg-emerald-500/10 border border-emerald-500/20",children:[a.jsx(qe,{className:"w-5 h-5 text-emerald-400 shrink-0"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-emerald-300 font-medium",children:"WSL is already installed"}),a.jsx("p",{className:"text-xs text-emerald-400/60 mt-0.5",children:"We detected WSL on your system. You can activate it right away."})]})]}),a.jsxs("div",{className:"mt-6 space-y-3",children:[n?a.jsxs("button",{onClick:x,disabled:d,className:"w-full flex items-center justify-center gap-2 px-6 py-3.5 rounded-xl bg-gradient-to-r from-orange-500 to-amber-500 hover:from-orange-400 hover:to-amber-400 disabled:opacity-60 text-white text-sm font-semibold transition-all shadow-lg shadow-orange-500/20",children:[d?a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):a.jsx($t,{className:"w-4 h-4"}),d?"Activating...":"Activate Linux Superpowers"]}):a.jsxs("button",{onClick:()=>u(!0),className:"w-full flex items-center justify-center gap-2 px-6 py-3.5 rounded-xl bg-gradient-to-r from-orange-500 to-amber-500 hover:from-orange-400 hover:to-amber-400 text-white text-sm font-semibold transition-all shadow-lg shadow-orange-500/20",children:[a.jsx(rn,{className:"w-4 h-4"}),"Set up WSL now",a.jsx(cd,{className:"w-4 h-4"})]}),a.jsx("p",{className:"text-center text-xs text-gray-600",children:"You can also set this up later from Settings. It takes about 10 minutes."})]})]})}function yw({wslDetected:n,onComplete:r,onBack:s}){const[o,u]=D.useState([]),[d,f]=D.useState(0),[x,p]=D.useState(new Set),[h,y]=D.useState(!0),[g,v]=D.useState(null),[j,k]=D.useState(!1),[R,S]=D.useState([]);D.useEffect(()=>{de.getWSLSetupGuide().then(z=>{if(!z.needed){r();return}if(u(z.steps),S(z.troubleshooting||[]),n&&z.steps.length>0){const U=new Set;for(const J of z.steps)(J.id==="open_terminal"||J.id==="install_wsl"||J.id==="reboot")&&U.add(J.id);p(U);const $=z.steps.findIndex(J=>J.id==="verify"),fe=z.steps.findIndex(J=>J.id==="create_user");f(fe>=0?fe:$>=0?$:0)}}).catch(()=>{}).finally(()=>y(!1))},[n,r]);const T=z=>{navigator.clipboard.writeText(z).then(()=>{v(z),setTimeout(()=>v(null),2e3)})},V=z=>{p(U=>new Set([...U,z])),d<o.length-1&&f(d+1)},H=o.length>0&&o.every(z=>x.has(z.id)),I=o[d];return h?a.jsx("div",{className:"animate-onboard-in flex items-center justify-center min-h-[400px]",children:a.jsx("div",{className:"w-8 h-8 border-2 border-orange-500/30 border-t-orange-500 rounded-full animate-spin"})}):H?a.jsxs("div",{className:"animate-onboard-in",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[a.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-emerald-500 to-green-600 flex items-center justify-center shadow-xl shadow-emerald-600/20",children:a.jsx(qe,{className:"w-7 h-7 text-white"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"All set!"}),a.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:"WSL is installed and ready to go."})]})]}),a.jsx("p",{className:"text-sm text-gray-400 mb-6",children:"Plutus can now use Linux tools like apt, Docker, SSH, compilers, and thousands more — all running natively on your Windows machine."}),a.jsxs("button",{onClick:r,className:"w-full flex items-center justify-center gap-2 px-6 py-3.5 rounded-xl bg-gradient-to-r from-orange-500 to-amber-500 hover:from-orange-400 hover:to-amber-400 text-white text-sm font-semibold transition-all shadow-lg shadow-orange-500/20",children:[a.jsx($t,{className:"w-4 h-4"}),"Activate Linux Superpowers"]})]}):a.jsxs("div",{className:"animate-onboard-in",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("button",{onClick:s,className:"flex items-center gap-1 text-sm text-gray-500 hover:text-gray-300 transition-colors",children:[a.jsx(ts,{className:"w-4 h-4"}),"Back to overview"]}),a.jsxs("span",{className:"text-xs text-orange-400/80 font-medium px-2.5 py-1 bg-orange-500/10 rounded-lg",children:["Step ",d+1," of ",o.length]})]}),a.jsx("div",{className:"flex items-center gap-1.5 mb-6",children:o.map((z,U)=>a.jsx("button",{onClick:()=>f(U),className:`h-1.5 flex-1 rounded-full transition-all duration-300 cursor-pointer ${x.has(z.id)?"bg-orange-500":U===d?"bg-orange-500/40":"bg-gray-800 hover:bg-gray-700"}`},z.id))}),I&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-orange-500/15 flex items-center justify-center shrink-0 mt-0.5",children:a.jsx("span",{className:"text-sm font-bold text-orange-400",children:d+1})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-lg font-bold text-gray-100",children:I.title}),x.has(I.id)&&a.jsxs("span",{className:"text-xs text-emerald-400 flex items-center gap-1 mt-1",children:[a.jsx(qe,{className:"w-3.5 h-3.5"})," Completed"]})]})]}),a.jsx("p",{className:"text-sm text-gray-400 leading-relaxed mb-4",children:I.description}),I.substeps&&I.substeps.length>0&&a.jsx("div",{className:"space-y-2 mb-4",children:I.substeps.map((z,U)=>a.jsxs("div",{className:"flex items-start gap-2.5 text-sm",children:[a.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-800 flex items-center justify-center shrink-0 mt-0.5",children:a.jsx("span",{className:"text-[10px] font-bold text-gray-400",children:U+1})}),a.jsx("span",{className:"text-gray-400",children:z})]},U))}),I.command&&a.jsxs("div",{className:"relative group mb-4",children:[a.jsx("div",{className:"bg-gray-900 rounded-lg border border-gray-800/60 p-4 font-mono text-sm text-orange-300 overflow-x-auto",children:I.command}),a.jsx("button",{onClick:()=>T(I.command),className:"absolute top-2 right-2 p-2 rounded-lg bg-gray-800/80 hover:bg-gray-700/80 text-gray-400 hover:text-gray-200 opacity-0 group-hover:opacity-100 transition-all",children:g===I.command?a.jsx(qe,{className:"w-4 h-4 text-emerald-400"}):a.jsx("span",{className:"text-xs font-medium",children:"Copy"})})]}),I.command_verify&&a.jsxs("div",{className:"relative group mb-4",children:[a.jsx("p",{className:"text-xs text-gray-500 mb-1.5",children:"Then run this to verify:"}),a.jsx("div",{className:"bg-gray-900 rounded-lg border border-gray-800/60 p-4 font-mono text-sm text-orange-300/80 overflow-x-auto",children:I.command_verify}),a.jsx("button",{onClick:()=>T(I.command_verify),className:"absolute top-8 right-2 p-2 rounded-lg bg-gray-800/80 hover:bg-gray-700/80 text-gray-400 hover:text-gray-200 opacity-0 group-hover:opacity-100 transition-all",children:g===I.command_verify?a.jsx(qe,{className:"w-4 h-4 text-emerald-400"}):a.jsx("span",{className:"text-xs font-medium",children:"Copy"})})]}),I.warning&&a.jsxs("div",{className:"flex items-start gap-3 p-3.5 rounded-xl bg-amber-500/5 border border-amber-500/20 mb-4",children:[a.jsx(Yl,{className:"w-4 h-4 text-amber-400 shrink-0 mt-0.5"}),a.jsx("p",{className:"text-xs text-amber-300/80 leading-relaxed",children:I.warning})]}),a.jsx("div",{className:"bg-gray-900/40 rounded-lg p-3 border border-gray-800/30 mb-4",children:a.jsxs("p",{className:"text-xs text-gray-500 leading-relaxed",children:[a.jsx("span",{className:"text-gray-400 font-medium",children:"Tip:"})," ",I.note]})}),a.jsxs("div",{className:"flex items-center justify-between",children:[x.has(I.id)?a.jsx("div",{}):a.jsxs("button",{onClick:()=>V(I.id),className:"flex items-center gap-2 px-4 py-2.5 rounded-xl bg-orange-500/10 hover:bg-orange-500/20 border border-orange-500/20 text-orange-400 text-sm font-medium transition-all",children:[a.jsx(qe,{className:"w-4 h-4"}),"I've done this step"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[d>0&&a.jsx("button",{onClick:()=>f(d-1),className:"px-3 py-2 rounded-xl text-sm text-gray-400 hover:text-gray-200 hover:bg-gray-800/60 transition-all",children:"Prev"}),d<o.length-1&&a.jsxs("button",{onClick:()=>f(d+1),className:"flex items-center gap-1 px-3 py-2 rounded-xl text-sm text-gray-300 hover:text-white bg-gray-800/60 hover:bg-gray-700/60 transition-all",children:["Next ",a.jsx(gn,{className:"w-3.5 h-3.5"})]})]})]})]}),R.length>0&&a.jsxs("div",{className:"mt-6 border-t border-gray-800/40 pt-4",children:[a.jsxs("button",{onClick:()=>k(!j),className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[a.jsx(Yl,{className:"w-3.5 h-3.5"}),j?"Hide troubleshooting":"Having problems? Click here",a.jsx(gn,{className:`w-3.5 h-3.5 transition-transform ${j?"rotate-90":""}`})]}),j&&a.jsx("div",{className:"mt-3 space-y-3 max-h-[200px] overflow-y-auto pr-1",children:R.map(z=>a.jsxs("div",{className:"bg-gray-900/40 rounded-lg p-3 border border-gray-800/30",children:[a.jsx("p",{className:"text-xs font-medium text-gray-300 mb-1",children:z.problem}),a.jsx("p",{className:"text-xs text-gray-500 leading-relaxed whitespace-pre-line",children:z.solution})]},z.id))})]})]})}function bw(){const{updateInfo:n,setUpdateInfo:r}=Qe(),[s,o]=D.useState(!1),[u,d]=D.useState(null),[f,x]=D.useState(!1);if(!n||!n.available||n.dismissed)return null;const p=async()=>{try{await de.dismissUpdate(n.latestVersion)}catch{}r({...n,dismissed:!0})},h=async()=>{o(!0),d(null);try{const y=await de.applyUpdate();y.success?d({success:!0,message:`Updated to v${y.new_version||n.latestVersion}`,restartRequired:y.restart_required}):d({success:!1,message:y.error||"Update failed. Try updating manually."})}catch(y){d({success:!1,message:y instanceof Error?y.message:"Update failed"})}finally{o(!1)}};return u?a.jsxs("div",{className:`shrink-0 border-b px-4 py-3 flex items-center gap-3 ${u.success?"bg-emerald-500/5 border-emerald-500/20":"bg-red-500/5 border-red-500/20"}`,children:[u.success?a.jsx(qe,{className:"w-4 h-4 text-emerald-400 shrink-0"}):a.jsx(Yl,{className:"w-4 h-4 text-red-400 shrink-0"}),a.jsx("p",{className:`text-sm flex-1 ${u.success?"text-emerald-300":"text-red-300"}`,children:u.message}),u.restartRequired&&u.success&&a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-emerald-500/10 border border-emerald-500/20",children:[a.jsx(M1,{className:"w-3.5 h-3.5 text-emerald-400"}),a.jsx("span",{className:"text-xs text-emerald-400 font-medium",children:"Restart Plutus to finish"})]}),!u.success&&a.jsx("button",{onClick:()=>d(null),className:"text-xs text-gray-400 hover:text-gray-200 px-2 py-1 rounded-lg hover:bg-gray-800/60 transition-colors",children:"Retry"}),a.jsx("button",{onClick:()=>{d(null),r({...n,dismissed:!0})},className:"p-1 text-gray-500 hover:text-gray-300 transition-colors",children:a.jsx(Vl,{className:"w-3.5 h-3.5"})})]}):a.jsxs("div",{className:"shrink-0 bg-plutus-500/5 border-b border-plutus-500/20 px-4 py-2.5",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(x1,{className:"w-4 h-4 text-plutus-400 shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("p",{className:"text-sm text-gray-200",children:[a.jsxs("span",{className:"font-medium text-plutus-300",children:["v",n.latestVersion]}),n.releaseName&&n.releaseName!==`v${n.latestVersion}`&&a.jsxs("span",{className:"text-gray-400",children:[" — ",n.releaseName]}),a.jsxs("span",{className:"text-gray-500 ml-1.5",children:["(you're on v",n.currentVersion,")"]})]}),n.releaseNotes&&a.jsx("button",{onClick:()=>x(!f),className:"text-xs text-gray-500 hover:text-gray-300 mt-0.5 transition-colors",children:f?"Hide release notes":"View release notes"})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n.releaseUrl&&a.jsx("a",{href:n.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 text-gray-500 hover:text-gray-300 transition-colors",title:"View on GitHub",children:a.jsx(op,{className:"w-3.5 h-3.5"})}),a.jsx("button",{onClick:h,disabled:s,className:"flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg bg-plutus-600 hover:bg-plutus-500 disabled:opacity-50 text-white text-xs font-medium transition-all shadow-sm shadow-plutus-600/20",children:s?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Updating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(g1,{className:"w-3 h-3"}),"Update now"]})}),a.jsx("button",{onClick:p,className:"p-1.5 text-gray-600 hover:text-gray-400 transition-colors",title:"Dismiss",children:a.jsx(Vl,{className:"w-3.5 h-3.5"})})]})]}),f&&n.releaseNotes&&a.jsx("div",{className:"mt-2 p-3 rounded-lg bg-gray-900/60 border border-gray-800/40 max-h-40 overflow-y-auto",children:a.jsx("pre",{className:"text-xs text-gray-400 whitespace-pre-wrap font-sans leading-relaxed",children:n.releaseNotes})})]})}function vw({send:n}){const[r,s]=D.useState([]),[o,u]=D.useState(""),[d,f]=D.useState(!1),[x,p]=D.useState(null),[h,y]=D.useState(""),[g,v]=D.useState(null),[j,k]=D.useState(null),R=D.useRef(null),S=D.useRef(null),T=D.useRef(null),{conversationId:V,setConversationId:H,clearMessages:I,setView:z}=Qe(),U=D.useCallback(()=>{de.getConversations(50).then(Z=>s(Z)).catch(()=>{})},[]);D.useEffect(()=>{U()},[U,V]),D.useEffect(()=>{const Z=setInterval(U,3e4);return()=>clearInterval(Z)},[U]),D.useEffect(()=>{x&&R.current&&(R.current.focus(),R.current.select())},[x]),D.useEffect(()=>{const Z=Q=>{T.current&&!T.current.contains(Q.target)&&k(null)};return j&&document.addEventListener("mousedown",Z),()=>document.removeEventListener("mousedown",Z)},[j]);const $=D.useMemo(()=>{if(!o.trim())return r;const Z=o.toLowerCase();return r.filter(Q=>(Q.title||Qu(Q)).toLowerCase().includes(Z))},[r,o]),fe=D.useMemo(()=>Nw($),[$]),J=Z=>{Z.id!==V&&(n({type:"resume_conversation",conversation_id:Z.id}),z("chat"))},M=async Z=>{try{await de.deleteConversation(Z),Z===V&&(I(),H(null)),s(Q=>Q.filter(ee=>ee.id!==Z)),v(null),k(null)}catch(Q){console.error("Failed to delete conversation:",Q)}},ne=async Z=>{const Q=h.trim();if(!Q){p(null);return}try{await de.renameConversation(Z,Q),s(ee=>ee.map(A=>A.id===Z?{...A,title:Q}:A))}catch(ee){console.error("Failed to rename:",ee)}p(null)},re=Z=>{p(Z.id),y(Z.title||Qu(Z)),v(null),k(null)};return r.length===0?null:a.jsxs("div",{className:"flex flex-col min-h-0 flex-1",children:[a.jsx("div",{className:"px-3 pt-1 pb-3",children:a.jsxs("div",{className:`flex items-center gap-2 px-2.5 py-1.5 rounded-lg transition-all duration-200 ${d?"bg-gray-800 ring-1 ring-plutus-500/30":"bg-gray-800/50 hover:bg-gray-800/80"}`,children:[a.jsx(os,{className:"w-3.5 h-3.5 text-gray-500 shrink-0"}),a.jsx("input",{ref:S,type:"text",placeholder:"Search chats...",value:o,onChange:Z=>u(Z.target.value),onFocus:()=>f(!0),onBlur:()=>f(!1),className:"flex-1 bg-transparent text-xs text-gray-300 placeholder-gray-600 focus:outline-none min-w-0"}),o&&a.jsx("button",{onClick:()=>u(""),className:"p-0.5 rounded text-gray-500 hover:text-gray-300 transition-colors",children:a.jsx(Vl,{className:"w-3 h-3"})})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden px-2 pb-2 sidebar-scroll",children:$.length===0?a.jsxs("div",{className:"px-3 py-4 text-center",children:[a.jsx(os,{className:"w-4 h-4 text-gray-700 mx-auto mb-1.5"}),a.jsx("p",{className:"text-[11px] text-gray-600",children:o?"No matches found":"No conversations yet"})]}):a.jsx("div",{className:"space-y-3",children:fe.map(Z=>Z.items.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 px-2 mb-1",children:[a.jsx("span",{className:"text-[10px] font-semibold text-gray-600 uppercase tracking-wider whitespace-nowrap",children:Z.label}),a.jsx("div",{className:"flex-1 h-px bg-gray-800/60"})]}),a.jsx("div",{className:"space-y-0.5",children:Z.items.map(Q=>{const ee=Q.id===V,A=x===Q.id,O=g===Q.id,le=j===Q.id;return a.jsx("div",{className:"conv-item animate-fade-in",children:A?a.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2 rounded-lg bg-gray-800/80 border border-gray-700/50",children:[a.jsx("input",{ref:R,className:"flex-1 bg-gray-900/50 border border-gray-700 rounded-md px-2 py-1 text-xs text-gray-200 focus:outline-none focus:border-plutus-500/50 min-w-0",value:h,onChange:ie=>y(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&ne(Q.id),ie.key==="Escape"&&p(null)},onClick:ie=>ie.stopPropagation()}),a.jsx("button",{onClick:ie=>{ie.stopPropagation(),ne(Q.id)},className:"p-1 rounded-md text-emerald-400 hover:text-emerald-300 hover:bg-emerald-500/10 transition-colors",children:a.jsx(ql,{className:"w-3.5 h-3.5"})}),a.jsx("button",{onClick:ie=>{ie.stopPropagation(),p(null)},className:"p-1 rounded-md text-gray-500 hover:text-gray-300 hover:bg-gray-700/50 transition-colors",children:a.jsx(Vl,{className:"w-3.5 h-3.5"})})]}):O?a.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg bg-red-500/5 border border-red-500/20",children:[a.jsx("span",{className:"text-xs text-red-400 font-medium",children:"Delete this chat?"}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{onClick:ie=>{ie.stopPropagation(),M(Q.id)},className:"px-2 py-1 text-[11px] font-medium bg-red-500/20 text-red-400 rounded-md hover:bg-red-500/30 transition-colors",children:"Delete"}),a.jsx("button",{onClick:ie=>{ie.stopPropagation(),v(null)},className:"px-2 py-1 text-[11px] font-medium bg-gray-700/50 text-gray-400 rounded-md hover:bg-gray-700 transition-colors",children:"Cancel"})]})]}):a.jsxs("div",{onClick:()=>J(Q),className:`group relative flex items-center gap-2 pl-2.5 pr-1.5 py-1.5 rounded-md cursor-pointer transition-all duration-150 ${ee?"bg-plutus-600/10 conv-active":"hover:bg-gray-800/60"}`,children:[ee&&a.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[2px] h-4 rounded-r-full bg-plutus-500 shadow-sm shadow-plutus-500/50"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:`text-xs truncate font-medium leading-snug ${ee?"text-plutus-300":"text-gray-400 group-hover:text-gray-200"}`,children:Q.title||Qu(Q)}),a.jsxs("span",{className:`text-[10px] leading-none ${ee?"text-plutus-500/60":"text-gray-600"}`,children:[jw(Q.last_activity),Q.message_count>0&&` · ${Q.message_count} msgs`]})]}),a.jsxs("div",{className:"relative shrink-0",ref:le?T:void 0,children:[a.jsx("button",{onClick:ie=>{ie.stopPropagation(),k(le?null:Q.id)},className:`p-0.5 rounded transition-all ${le?"text-gray-300 bg-gray-700/50":"text-gray-700 opacity-0 group-hover:opacity-100 hover:text-gray-300 hover:bg-gray-700/50"}`,children:a.jsx(y1,{className:"w-3.5 h-3.5"})}),le&&a.jsxs("div",{className:"absolute right-0 top-full mt-1 w-32 py-1 bg-gray-800 border border-gray-700/80 rounded-lg shadow-xl shadow-black/30 z-50 animate-fade-in",children:[a.jsxs("button",{onClick:ie=>{ie.stopPropagation(),re(Q)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-gray-300 hover:bg-gray-700/60 hover:text-gray-100 transition-colors",children:[a.jsx(_1,{className:"w-3 h-3"}),"Rename"]}),a.jsx("div",{className:"h-px bg-gray-700/50 my-1"}),a.jsxs("button",{onClick:ie=>{ie.stopPropagation(),v(Q.id),k(null)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-red-400 hover:bg-red-500/10 hover:text-red-300 transition-colors",children:[a.jsx(Za,{className:"w-3 h-3"}),"Delete"]})]})]})]})},Q.id)})})]},Z.label))})})]})}function Qu(n){return`Chat ${new Date(n.created_at*1e3).toLocaleDateString(void 0,{month:"short",day:"numeric"})}`}function jw(n){const r=Math.floor(Date.now()/1e3-n);return r<60?"just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:r<172800?"yesterday":r<604800?`${Math.floor(r/86400)}d ago`:new Date(n*1e3).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Nw(n){const r=new Date;r.setHours(0,0,0,0);const s=r.getTime()/1e3,o=s-86400,u=s-7*86400,d=s-30*86400,f=[{label:"Today",items:[]},{label:"Yesterday",items:[]},{label:"This Week",items:[]},{label:"This Month",items:[]},{label:"Older",items:[]}];for(const x of n){const p=x.last_activity||x.created_at;p>=s?f[0].items.push(x):p>=o?f[1].items.push(x):p>=u?f[2].items.push(x):p>=d?f[3].items.push(x):f[4].items.push(x)}return f}function ww({send:n}){const{view:r,historyPanelOpen:s,setHistoryPanelOpen:o}=Qe(),u=r==="chat"&&s;return a.jsx("div",{className:`shrink-0 h-full transition-all duration-300 ease-out overflow-hidden ${u?"w-72 opacity-100":"w-0 opacity-0"}`,children:a.jsxs("div",{className:"w-72 h-full flex flex-col bg-gray-950 border-r border-gray-800/40",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 pt-4 pb-3",children:[a.jsx("div",{children:a.jsx("h2",{className:"text-xs font-semibold text-gray-300 uppercase tracking-wider",children:"History"})}),a.jsx("button",{onClick:()=>o(!1),className:"p-1.5 rounded-lg text-gray-600 hover:text-gray-300 hover:bg-gray-800/60 transition-colors",title:"Close panel",children:a.jsx(C1,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"mx-3 h-px bg-gradient-to-r from-transparent via-gray-800/60 to-transparent"}),a.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:a.jsx(vw,{send:n})})]})})}function kw(){const{view:n,addMessage:r,setProcessing:s,setConnected:o,setCurrentTier:u,setConversationId:d,setKeyConfigured:f,clearMessages:x,onboardingCompleted:p,setOnboardingCompleted:h,setUpdateInfo:y,theme:g}=Qe();i1(g);const v=D.useCallback(S=>{var T,V,H,I,z,U,$,fe,J,M,ne,re;switch(S.type){case"thinking":s(!0);break;case"text":r({role:"assistant",content:S.content});break;case"tool_call":{const Z=S.tool||"",Q=S.arguments||{};if(Z.startsWith("computer.")){const ee=Z.replace("computer.",""),A={screenshot:"Taking screenshot...",click:`Clicking at (${(T=Q.coordinate)==null?void 0:T[0]}, ${(V=Q.coordinate)==null?void 0:V[1]})`,left_click:`Clicking at (${(H=Q.coordinate)==null?void 0:H[0]}, ${(I=Q.coordinate)==null?void 0:I[1]})`,right_click:`Right-clicking at (${(z=Q.coordinate)==null?void 0:z[0]}, ${(U=Q.coordinate)==null?void 0:U[1]})`,double_click:`Double-clicking at (${($=Q.coordinate)==null?void 0:$[0]}, ${(fe=Q.coordinate)==null?void 0:fe[1]})`,type:`Typing: "${(Q.text||"").slice(0,50)}${(Q.text||"").length>50?"...":""}"`,key:`Pressing: ${Q.text}`,scroll:`Scrolling ${Q.coordinate?`at (${Q.coordinate[0]}, ${Q.coordinate[1]})`:""}`,move:`Moving to (${(J=Q.coordinate)==null?void 0:J[0]}, ${(M=Q.coordinate)==null?void 0:M[1]})`,wait:"Waiting...",triple_click:`Triple-clicking at (${(ne=Q.coordinate)==null?void 0:ne[0]}, ${(re=Q.coordinate)==null?void 0:re[1]})`};r({role:"assistant",content:A[ee]||ee,tool_calls:[{id:S.id||"",name:Z,arguments:Q}]})}else{const ee=Q.operation||Q.action||"",A=ee?ee.replace(/_/g," "):Z.replace(/_/g," ");r({role:"assistant",content:`Using tool: **${A}**`,tool_calls:[{id:S.id||"",name:Z,arguments:Q}]})}break}case"tool_result":{S.screenshot&&S.image_base64?r({role:"tool",content:`__SCREENSHOT__:${S.image_base64}`,tool_call_id:S.id}):S.error?r({role:"tool",content:`[ERROR] ${S.result||"Unknown error"}`,tool_call_id:S.id}):r({role:"tool",content:S.result||"Done",tool_call_id:S.id});break}case"tool_approval_needed":r({role:"system",content:`Approval needed for **${S.tool}**: ${S.reason}`,approval_id:S.approval_id});break;case"mode":break;case"iteration":r({role:"system",content:`Step ${S.number}/${S.max}`});break;case"error":r({role:"system",content:`Error: ${S.message}`}),s(!1);break;case"done":s(!1);break;case"cancelled":case"task_stopped":r({role:"system",content:`${S.message||"Task stopped"}`}),s(!1);break;case"conversation_started":d(S.conversation_id);break;case"conversation_resumed":d(S.conversation_id),x(),S.messages.forEach(Z=>{if(Z.role==="user"&&typeof Z.content=="string"){if(Z.content.startsWith("[HEARTBEAT]")){r({...Z,role:"system"});return}if(Z.content.startsWith("[SYSTEM NOTIFICATION]")){r({...Z,role:"system"});return}if(Z.content.startsWith("[SYSTEM]")){r({...Z,role:"system"});return}}r(Z)});break;case"heartbeat":r({role:"system",content:`Heartbeat #${S.beat}/${S.max}`}),s(!0);break;case"heartbeat_paused":r({role:"system",content:`Heartbeat paused: ${S.reason} (after ${S.count} beats)`});break;case"attachment":{if(S.is_image&&S.image_base64){const Z=S.caption?`
${S.caption}`:"";r({role:"tool",content:`__ATTACHMENT_IMAGE__:${S.file_name}:${S.image_base64}${Z}`})}else{const Z=Math.round((S.file_size||0)/1024),Q=S.caption?` — ${S.caption}`:"";r({role:"tool",content:`__ATTACHMENT_FILE__:${S.file_name}:${Z}:${S.file_path}${Q}`})}break}case"plan_update":break;case"worker_result":{const Z=S.name||"Worker",Q=S.model||"",ee=S.result||"(no output)";r({role:"assistant",content:`__WORKER_RESULT__:${Z}:${Q}:${ee}`});break}case"worker_started":{const Z=S.worker||{};r({role:"system",content:`__WORKER_STARTED__:${Z.name||Z.task_id}:${Z.model||"auto"}`});break}}},[r,s,d,x]),{send:j,connected:k}=o1(v);if(D.useEffect(()=>{o(k)},[k,o]),D.useEffect(()=>{de.getStatus().then(S=>{var T;(T=S==null?void 0:S.guardrails)!=null&&T.tier&&u(S.guardrails.tier),(S==null?void 0:S.key_configured)!==void 0&&f(S.key_configured),h((S==null?void 0:S.onboarding_completed)??!0)}).catch(()=>{h(!0)})},[u,f,h]),D.useEffect(()=>{const S=()=>{de.checkForUpdate().then(H=>{H.error&&console.warn("[update-check] Backend error:",H.error),H.update_available&&y({available:!0,dismissed:H.dismissed??!1,currentVersion:H.current_version,latestVersion:H.latest_version,releaseName:H.release_name||"",releaseNotes:H.release_notes||"",releaseUrl:H.release_url||"",publishedAt:H.published_at||""})}).catch(H=>{console.warn("[update-check] Failed:",H)})},T=setTimeout(S,2e3),V=setInterval(S,360*60*1e3);return()=>{clearTimeout(T),clearInterval(V)}},[y]),p===null)return a.jsx("div",{className:"h-screen flex items-center justify-center bg-gray-950",children:a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-plutus-500 to-plutus-700 flex items-center justify-center font-bold text-lg shadow-lg shadow-plutus-600/20 ring-1 ring-white/10",children:"P"}),a.jsx("div",{className:"w-6 h-6 border-2 border-plutus-500/30 border-t-plutus-500 rounded-full animate-spin"})]})});if(!p)return a.jsx(fw,{});const R={chat:a.jsx(C3,{send:j}),dashboard:a.jsx(M3,{}),guardrails:a.jsx(L3,{}),settings:a.jsx(q3,{}),tools:a.jsx(F3,{}),workers:a.jsx(W3,{}),"tool-creator":a.jsx(nw,{}),skills:a.jsx(rw,{}),memory:a.jsx(iw,{}),connectors:a.jsx(cw,{})};return a.jsxs("div",{className:"flex h-screen overflow-hidden",children:[a.jsx(L1,{send:j}),a.jsx(ww,{send:j}),a.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[a.jsx(bw,{}),a.jsx(H1,{}),a.jsx("main",{className:`flex-1 flex flex-col overflow-hidden ${n==="chat"?"":"p-6"}`,children:R[n]||R.chat})]})]})}t1.createRoot(document.getElementById("root")).render(a.jsx(Jr.StrictMode,{children:a.jsx(kw,{})}));
