@amd-gaia/agent-ui 0.18.1 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-B6CVnI2W.js +565 -0
- package/dist/assets/index-Dhg6L9-N.css +1 -0
- package/dist/index.html +2 -2
- package/main.cjs +5 -0
- package/package.json +11 -3
- package/dist/assets/index-BAH7zCy-.js +0 -550
- package/dist/assets/index-dpq7GLUN.css +0 -1
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();var ba=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function io(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xh={exports:{}},so={},Jh={exports:{}},_e={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var kl=Symbol.for("react.element"),bv=Symbol.for("react.portal"),jv=Symbol.for("react.fragment"),Sv=Symbol.for("react.strict_mode"),Nv=Symbol.for("react.profiler"),Cv=Symbol.for("react.provider"),_v=Symbol.for("react.context"),Ev=Symbol.for("react.forward_ref"),Tv=Symbol.for("react.suspense"),zv=Symbol.for("react.memo"),Av=Symbol.for("react.lazy"),vf=Symbol.iterator;function Lv(e){return e===null||typeof e!="object"?null:(e=vf&&e[vf]||e["@@iterator"],typeof e=="function"?e:null)}var Zh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ep=Object.assign,tp={};function as(e,t,n){this.props=e,this.context=t,this.refs=tp,this.updater=n||Zh}as.prototype.isReactComponent={};as.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};as.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function np(){}np.prototype=as.prototype;function Lu(e,t,n){this.props=e,this.context=t,this.refs=tp,this.updater=n||Zh}var Du=Lu.prototype=new np;Du.constructor=Lu;ep(Du,as.prototype);Du.isPureReactComponent=!0;var kf=Array.isArray,rp=Object.prototype.hasOwnProperty,Iu={current:null},ip={key:!0,ref:!0,__self:!0,__source:!0};function sp(e,t,n){var r,i={},l=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(l=""+t.key),t)rp.call(t,r)&&!ip.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:kl,type:e,key:l,ref:a,props:i,_owner:Iu.current}}function Dv(e,t){return{$$typeof:kl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Pu(e){return typeof e=="object"&&e!==null&&e.$$typeof===kl}function Iv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var wf=/\/+/g;function Lo(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Iv(""+e.key):t.toString(36)}function aa(e,t,n,r,i){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(l){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case kl:case bv:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Lo(a,0):r,kf(i)?(n="",e!=null&&(n=e.replace(wf,"$&/")+"/"),aa(i,t,n,"",function(u){return u})):i!=null&&(Pu(i)&&(i=Dv(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(wf,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",kf(e))for(var o=0;o<e.length;o++){l=e[o];var c=r+Lo(l,o);a+=aa(l,t,n,c,i)}else if(c=Lv(e),typeof c=="function")for(e=c.call(e),o=0;!(l=e.next()).done;)l=l.value,c=r+Lo(l,o++),a+=aa(l,t,n,c,i);else if(l==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Ml(e,t,n){if(e==null)return e;var r=[],i=0;return aa(e,r,"","",function(l){return t.call(n,l,i++)}),r}function Pv(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ut={current:null},oa={transition:null},Mv={ReactCurrentDispatcher:Ut,ReactCurrentBatchConfig:oa,ReactCurrentOwner:Iu};function lp(){throw Error("act(...) is not supported in production builds of React.")}_e.Children={map:Ml,forEach:function(e,t,n){Ml(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ml(e,function(){t++}),t},toArray:function(e){return Ml(e,function(t){return t})||[]},only:function(e){if(!Pu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};_e.Component=as;_e.Fragment=jv;_e.Profiler=Nv;_e.PureComponent=Lu;_e.StrictMode=Sv;_e.Suspense=Tv;_e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mv;_e.act=lp;_e.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=ep({},e.props),i=e.key,l=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(l=t.ref,a=Iu.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)rp.call(t,c)&&!ip.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:kl,type:e.type,key:i,ref:l,props:r,_owner:a}};_e.createContext=function(e){return e={$$typeof:_v,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Cv,_context:e},e.Consumer=e};_e.createElement=sp;_e.createFactory=function(e){var t=sp.bind(null,e);return t.type=e,t};_e.createRef=function(){return{current:null}};_e.forwardRef=function(e){return{$$typeof:Ev,render:e}};_e.isValidElement=Pu;_e.lazy=function(e){return{$$typeof:Av,_payload:{_status:-1,_result:e},_init:Pv}};_e.memo=function(e,t){return{$$typeof:zv,type:e,compare:t===void 0?null:t}};_e.startTransition=function(e){var t=oa.transition;oa.transition={};try{e()}finally{oa.transition=t}};_e.unstable_act=lp;_e.useCallback=function(e,t){return Ut.current.useCallback(e,t)};_e.useContext=function(e){return Ut.current.useContext(e)};_e.useDebugValue=function(){};_e.useDeferredValue=function(e){return Ut.current.useDeferredValue(e)};_e.useEffect=function(e,t){return Ut.current.useEffect(e,t)};_e.useId=function(){return Ut.current.useId()};_e.useImperativeHandle=function(e,t,n){return Ut.current.useImperativeHandle(e,t,n)};_e.useInsertionEffect=function(e,t){return Ut.current.useInsertionEffect(e,t)};_e.useLayoutEffect=function(e,t){return Ut.current.useLayoutEffect(e,t)};_e.useMemo=function(e,t){return Ut.current.useMemo(e,t)};_e.useReducer=function(e,t,n){return Ut.current.useReducer(e,t,n)};_e.useRef=function(e){return Ut.current.useRef(e)};_e.useState=function(e){return Ut.current.useState(e)};_e.useSyncExternalStore=function(e,t,n){return Ut.current.useSyncExternalStore(e,t,n)};_e.useTransition=function(){return Ut.current.useTransition()};_e.version="18.3.1";Jh.exports=_e;var p=Jh.exports;const Ki=io(p);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Rv=p,$v=Symbol.for("react.element"),Fv=Symbol.for("react.fragment"),Ov=Object.prototype.hasOwnProperty,Uv=Rv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Bv={key:!0,ref:!0,__self:!0,__source:!0};function ap(e,t,n){var r,i={},l=null,a=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Ov.call(t,r)&&!Bv.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:$v,type:e,key:l,ref:a,props:i,_owner:Uv.current}}so.Fragment=Fv;so.jsx=ap;so.jsxs=ap;Xh.exports=so;var s=Xh.exports,bc={},op={exports:{}},cn={},cp={exports:{}},up={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(T,P){var b=T.length;T.push(P);e:for(;0<b;){var X=b-1>>>1,H=T[X];if(0<i(H,P))T[X]=P,T[b]=H,b=X;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var P=T[0],b=T.pop();if(b!==P){T[0]=b;e:for(var X=0,H=T.length,S=H>>>1;X<S;){var ie=2*(X+1)-1,ye=T[ie],ae=ie+1,je=T[ae];if(0>i(ye,b))ae<H&&0>i(je,ye)?(T[X]=je,T[ae]=b,X=ae):(T[X]=ye,T[ie]=b,X=ie);else if(ae<H&&0>i(je,b))T[X]=je,T[ae]=b,X=ae;else break e}}return P}function i(T,P){var b=T.sortIndex-P.sortIndex;return b!==0?b:T.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,k=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(T){for(var P=n(u);P!==null;){if(P.callback===null)r(u);else if(P.startTime<=T)r(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=n(u)}}function z(T){if(k=!1,j(T),!g)if(n(c)!==null)g=!0,le(D);else{var P=n(u);P!==null&&fe(z,P.startTime-T)}}function D(T,P){g=!1,k&&(k=!1,y(_),_=-1),m=!0;var b=h;try{for(j(P),f=n(c);f!==null&&(!(f.expirationTime>P)||T&&!U());){var X=f.callback;if(typeof X=="function"){f.callback=null,h=f.priorityLevel;var H=X(f.expirationTime<=P);P=e.unstable_now(),typeof H=="function"?f.callback=H:f===n(c)&&r(c),j(P)}else r(c);f=n(c)}if(f!==null)var S=!0;else{var ie=n(u);ie!==null&&fe(z,ie.startTime-P),S=!1}return S}finally{f=null,h=b,m=!1}}var C=!1,A=null,_=-1,I=5,N=-1;function U(){return!(e.unstable_now()-N<I)}function O(){if(A!==null){var T=e.unstable_now();N=T;var P=!0;try{P=A(!0,T)}finally{P?re():(C=!1,A=null)}}else C=!1}var re;if(typeof w=="function")re=function(){w(O)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,te=oe.port2;oe.port1.onmessage=O,re=function(){te.postMessage(null)}}else re=function(){v(O,0)};function le(T){A=T,C||(C=!0,re())}function fe(T,P){_=v(function(){T(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(T){T.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,le(D))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(T){switch(h){case 1:case 2:case 3:var P=3;break;default:P=h}var b=h;h=P;try{return T()}finally{h=b}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,P){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var b=h;h=T;try{return P()}finally{h=b}},e.unstable_scheduleCallback=function(T,P,b){var X=e.unstable_now();switch(typeof b=="object"&&b!==null?(b=b.delay,b=typeof b=="number"&&0<b?X+b:X):b=X,T){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=b+H,T={id:d++,callback:P,priorityLevel:T,startTime:b,expirationTime:H,sortIndex:-1},b>X?(T.sortIndex=b,t(u,T),n(c)===null&&T===n(u)&&(k?(y(_),_=-1):k=!0,fe(z,b-X))):(T.sortIndex=H,t(c,T),g||m||(g=!0,le(D))),T},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(T){var P=h;return function(){var b=h;h=P;try{return T.apply(this,arguments)}finally{h=b}}}})(up);cp.exports=up;var Hv=cp.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Vv=p,on=Hv;function W(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var dp=new Set,Zs={};function hi(e,t){Yi(e,t),Yi(e+"Capture",t)}function Yi(e,t){for(Zs[e]=t,e=0;e<t.length;e++)dp.add(t[e])}var nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jc=Object.prototype.hasOwnProperty,Wv=/^[: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]*$/,bf={},jf={};function Gv(e){return jc.call(jf,e)?!0:jc.call(bf,e)?!1:Wv.test(e)?jf[e]=!0:(bf[e]=!0,!1)}function qv(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Qv(e,t,n,r){if(t===null||typeof t>"u"||qv(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Bt(e,t,n,r,i,l,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=a}var _t={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_t[e]=new Bt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];_t[t]=new Bt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_t[e]=new Bt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_t[e]=new Bt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){_t[e]=new Bt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_t[e]=new Bt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_t[e]=new Bt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_t[e]=new Bt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_t[e]=new Bt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Mu=/[\-:]([a-z])/g;function Ru(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Mu,Ru);_t[t]=new Bt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Mu,Ru);_t[t]=new Bt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Mu,Ru);_t[t]=new Bt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_t[e]=new Bt(e,1,!1,e.toLowerCase(),null,!1,!1)});_t.xlinkHref=new Bt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_t[e]=new Bt(e,1,!1,e.toLowerCase(),null,!0,!0)});function $u(e,t,n,r){var i=_t.hasOwnProperty(t)?_t[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Qv(t,n,i,r)&&(n=null),r||i===null?Gv(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var lr=Vv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Rl=Symbol.for("react.element"),_i=Symbol.for("react.portal"),Ei=Symbol.for("react.fragment"),Fu=Symbol.for("react.strict_mode"),Sc=Symbol.for("react.profiler"),fp=Symbol.for("react.provider"),mp=Symbol.for("react.context"),Ou=Symbol.for("react.forward_ref"),Nc=Symbol.for("react.suspense"),Cc=Symbol.for("react.suspense_list"),Uu=Symbol.for("react.memo"),Er=Symbol.for("react.lazy"),hp=Symbol.for("react.offscreen"),Sf=Symbol.iterator;function bs(e){return e===null||typeof e!="object"?null:(e=Sf&&e[Sf]||e["@@iterator"],typeof e=="function"?e:null)}var tt=Object.assign,Do;function Ds(e){if(Do===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Do=t&&t[1]||""}return`
|
|
34
|
+
`+Do+e}var Io=!1;function Po(e,t){if(!e||Io)return"";Io=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
35
|
+
`),l=r.stack.split(`
|
|
36
|
+
`),a=i.length-1,o=l.length-1;1<=a&&0<=o&&i[a]!==l[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==l[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==l[o]){var c=`
|
|
37
|
+
`+i[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=o);break}}}finally{Io=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ds(e):""}function Kv(e){switch(e.tag){case 5:return Ds(e.type);case 16:return Ds("Lazy");case 13:return Ds("Suspense");case 19:return Ds("SuspenseList");case 0:case 2:case 15:return e=Po(e.type,!1),e;case 11:return e=Po(e.type.render,!1),e;case 1:return e=Po(e.type,!0),e;default:return""}}function _c(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ei:return"Fragment";case _i:return"Portal";case Sc:return"Profiler";case Fu:return"StrictMode";case Nc:return"Suspense";case Cc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case mp:return(e.displayName||"Context")+".Consumer";case fp:return(e._context.displayName||"Context")+".Provider";case Ou:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Uu:return t=e.displayName||null,t!==null?t:_c(e.type)||"Memo";case Er:t=e._payload,e=e._init;try{return _c(e(t))}catch{}}return null}function Yv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _c(t);case 8:return t===Fu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Br(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xv(e){var t=pp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,l.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $l(e){e._valueTracker||(e._valueTracker=Xv(e))}function gp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=pp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ja(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ec(e,t){var n=t.checked;return tt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Nf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Br(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function yp(e,t){t=t.checked,t!=null&&$u(e,"checked",t,!1)}function Tc(e,t){yp(e,t);var n=Br(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zc(e,t.type,n):t.hasOwnProperty("defaultValue")&&zc(e,t.type,Br(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Cf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function zc(e,t,n){(t!=="number"||ja(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Is=Array.isArray;function Oi(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Br(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ac(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(W(91));return tt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function _f(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(W(92));if(Is(n)){if(1<n.length)throw Error(W(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Br(n)}}function xp(e,t){var n=Br(t.value),r=Br(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Ef(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function vp(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Lc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?vp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fl,kp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fl=Fl||document.createElement("div"),Fl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function el(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $s={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Jv=["Webkit","ms","Moz","O"];Object.keys($s).forEach(function(e){Jv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),$s[t]=$s[e]})});function wp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||$s.hasOwnProperty(e)&&$s[e]?(""+t).trim():t+"px"}function bp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=wp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Zv=tt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Dc(e,t){if(t){if(Zv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function Ic(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pc=null;function Bu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mc=null,Ui=null,Bi=null;function Tf(e){if(e=jl(e)){if(typeof Mc!="function")throw Error(W(280));var t=e.stateNode;t&&(t=uo(t),Mc(e.stateNode,e.type,t))}}function jp(e){Ui?Bi?Bi.push(e):Bi=[e]:Ui=e}function Sp(){if(Ui){var e=Ui,t=Bi;if(Bi=Ui=null,Tf(e),t)for(e=0;e<t.length;e++)Tf(t[e])}}function Np(e,t){return e(t)}function Cp(){}var Mo=!1;function _p(e,t,n){if(Mo)return e(t,n);Mo=!0;try{return Np(e,t,n)}finally{Mo=!1,(Ui!==null||Bi!==null)&&(Cp(),Sp())}}function tl(e,t){var n=e.stateNode;if(n===null)return null;var r=uo(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(W(231,t,typeof n));return n}var Rc=!1;if(nr)try{var js={};Object.defineProperty(js,"passive",{get:function(){Rc=!0}}),window.addEventListener("test",js,js),window.removeEventListener("test",js,js)}catch{Rc=!1}function e1(e,t,n,r,i,l,a,o,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Fs=!1,Sa=null,Na=!1,$c=null,t1={onError:function(e){Fs=!0,Sa=e}};function n1(e,t,n,r,i,l,a,o,c){Fs=!1,Sa=null,e1.apply(t1,arguments)}function r1(e,t,n,r,i,l,a,o,c){if(n1.apply(this,arguments),Fs){if(Fs){var u=Sa;Fs=!1,Sa=null}else throw Error(W(198));Na||(Na=!0,$c=u)}}function pi(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Ep(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 zf(e){if(pi(e)!==e)throw Error(W(188))}function i1(e){var t=e.alternate;if(!t){if(t=pi(e),t===null)throw Error(W(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var l=i.alternate;if(l===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===l.child){for(l=i.child;l;){if(l===n)return zf(i),e;if(l===r)return zf(i),t;l=l.sibling}throw Error(W(188))}if(n.return!==r.return)n=i,r=l;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=l;break}if(o===r){a=!0,r=i,n=l;break}o=o.sibling}if(!a){for(o=l.child;o;){if(o===n){a=!0,n=l,r=i;break}if(o===r){a=!0,r=l,n=i;break}o=o.sibling}if(!a)throw Error(W(189))}}if(n.alternate!==r)throw Error(W(190))}if(n.tag!==3)throw Error(W(188));return n.stateNode.current===n?e:t}function Tp(e){return e=i1(e),e!==null?zp(e):null}function zp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=zp(e);if(t!==null)return t;e=e.sibling}return null}var Ap=on.unstable_scheduleCallback,Af=on.unstable_cancelCallback,s1=on.unstable_shouldYield,l1=on.unstable_requestPaint,st=on.unstable_now,a1=on.unstable_getCurrentPriorityLevel,Hu=on.unstable_ImmediatePriority,Lp=on.unstable_UserBlockingPriority,Ca=on.unstable_NormalPriority,o1=on.unstable_LowPriority,Dp=on.unstable_IdlePriority,lo=null,Bn=null;function c1(e){if(Bn&&typeof Bn.onCommitFiberRoot=="function")try{Bn.onCommitFiberRoot(lo,e,void 0,(e.current.flags&128)===128)}catch{}}var Ln=Math.clz32?Math.clz32:f1,u1=Math.log,d1=Math.LN2;function f1(e){return e>>>=0,e===0?32:31-(u1(e)/d1|0)|0}var Ol=64,Ul=4194304;function Ps(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function _a(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=Ps(o):(l&=a,l!==0&&(r=Ps(l)))}else a=n&~i,a!==0?r=Ps(a):l!==0&&(r=Ps(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Ln(t),i=1<<n,r|=e[n],t&=~i;return r}function m1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function h1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,l=e.pendingLanes;0<l;){var a=31-Ln(l),o=1<<a,c=i[a];c===-1?(!(o&n)||o&r)&&(i[a]=m1(o,t)):c<=t&&(e.expiredLanes|=o),l&=~o}}function Fc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ip(){var e=Ol;return Ol<<=1,!(Ol&4194240)&&(Ol=64),e}function Ro(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function wl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ln(t),e[t]=n}function p1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Ln(n),l=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~l}}function Vu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ln(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var $e=0;function Pp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Mp,Wu,Rp,$p,Fp,Oc=!1,Bl=[],Ir=null,Pr=null,Mr=null,nl=new Map,rl=new Map,zr=[],g1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Lf(e,t){switch(e){case"focusin":case"focusout":Ir=null;break;case"dragenter":case"dragleave":Pr=null;break;case"mouseover":case"mouseout":Mr=null;break;case"pointerover":case"pointerout":nl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rl.delete(t.pointerId)}}function Ss(e,t,n,r,i,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[i]},t!==null&&(t=jl(t),t!==null&&Wu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function y1(e,t,n,r,i){switch(t){case"focusin":return Ir=Ss(Ir,e,t,n,r,i),!0;case"dragenter":return Pr=Ss(Pr,e,t,n,r,i),!0;case"mouseover":return Mr=Ss(Mr,e,t,n,r,i),!0;case"pointerover":var l=i.pointerId;return nl.set(l,Ss(nl.get(l)||null,e,t,n,r,i)),!0;case"gotpointercapture":return l=i.pointerId,rl.set(l,Ss(rl.get(l)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=Jr(e.target);if(t!==null){var n=pi(t);if(n!==null){if(t=n.tag,t===13){if(t=Ep(n),t!==null){e.blockedOn=t,Fp(e.priority,function(){Rp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ca(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Uc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Pc=r,n.target.dispatchEvent(r),Pc=null}else return t=jl(n),t!==null&&Wu(t),e.blockedOn=n,!1;t.shift()}return!0}function Df(e,t,n){ca(e)&&n.delete(t)}function x1(){Oc=!1,Ir!==null&&ca(Ir)&&(Ir=null),Pr!==null&&ca(Pr)&&(Pr=null),Mr!==null&&ca(Mr)&&(Mr=null),nl.forEach(Df),rl.forEach(Df)}function Ns(e,t){e.blockedOn===t&&(e.blockedOn=null,Oc||(Oc=!0,on.unstable_scheduleCallback(on.unstable_NormalPriority,x1)))}function il(e){function t(i){return Ns(i,e)}if(0<Bl.length){Ns(Bl[0],e);for(var n=1;n<Bl.length;n++){var r=Bl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ir!==null&&Ns(Ir,e),Pr!==null&&Ns(Pr,e),Mr!==null&&Ns(Mr,e),nl.forEach(t),rl.forEach(t),n=0;n<zr.length;n++)r=zr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<zr.length&&(n=zr[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&zr.shift()}var Hi=lr.ReactCurrentBatchConfig,Ea=!0;function v1(e,t,n,r){var i=$e,l=Hi.transition;Hi.transition=null;try{$e=1,Gu(e,t,n,r)}finally{$e=i,Hi.transition=l}}function k1(e,t,n,r){var i=$e,l=Hi.transition;Hi.transition=null;try{$e=4,Gu(e,t,n,r)}finally{$e=i,Hi.transition=l}}function Gu(e,t,n,r){if(Ea){var i=Uc(e,t,n,r);if(i===null)qo(e,t,r,Ta,n),Lf(e,r);else if(y1(i,e,t,n,r))r.stopPropagation();else if(Lf(e,r),t&4&&-1<g1.indexOf(e)){for(;i!==null;){var l=jl(i);if(l!==null&&Mp(l),l=Uc(e,t,n,r),l===null&&qo(e,t,r,Ta,n),l===i)break;i=l}i!==null&&r.stopPropagation()}else qo(e,t,r,null,n)}}var Ta=null;function Uc(e,t,n,r){if(Ta=null,e=Bu(r),e=Jr(e),e!==null)if(t=pi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ep(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ta=e,null}function Up(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(a1()){case Hu:return 1;case Lp:return 4;case Ca:case o1:return 16;case Dp:return 536870912;default:return 16}default:return 16}}var Lr=null,qu=null,ua=null;function Bp(){if(ua)return ua;var e,t=qu,n=t.length,r,i="value"in Lr?Lr.value:Lr.textContent,l=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[l-r];r++);return ua=i.slice(e,1<r?1-r:void 0)}function da(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 Hl(){return!0}function If(){return!1}function un(e){function t(n,r,i,l,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=l,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(l):l[o]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Hl:If,this.isPropagationStopped=If,this}return tt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Hl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Hl)},persist:function(){},isPersistent:Hl}),t}var os={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qu=un(os),bl=tt({},os,{view:0,detail:0}),w1=un(bl),$o,Fo,Cs,ao=tt({},bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ku,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!==Cs&&(Cs&&e.type==="mousemove"?($o=e.screenX-Cs.screenX,Fo=e.screenY-Cs.screenY):Fo=$o=0,Cs=e),$o)},movementY:function(e){return"movementY"in e?e.movementY:Fo}}),Pf=un(ao),b1=tt({},ao,{dataTransfer:0}),j1=un(b1),S1=tt({},bl,{relatedTarget:0}),Oo=un(S1),N1=tt({},os,{animationName:0,elapsedTime:0,pseudoElement:0}),C1=un(N1),_1=tt({},os,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),E1=un(_1),T1=tt({},os,{data:0}),Mf=un(T1),z1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},A1={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"},L1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=L1[e])?!!t[e]:!1}function Ku(){return D1}var I1=tt({},bl,{key:function(e){if(e.key){var t=z1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=da(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?A1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ku,charCode:function(e){return e.type==="keypress"?da(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?da(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),P1=un(I1),M1=tt({},ao,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rf=un(M1),R1=tt({},bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ku}),$1=un(R1),F1=tt({},os,{propertyName:0,elapsedTime:0,pseudoElement:0}),O1=un(F1),U1=tt({},ao,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),B1=un(U1),H1=[9,13,27,32],Yu=nr&&"CompositionEvent"in window,Os=null;nr&&"documentMode"in document&&(Os=document.documentMode);var V1=nr&&"TextEvent"in window&&!Os,Hp=nr&&(!Yu||Os&&8<Os&&11>=Os),$f=" ",Ff=!1;function Vp(e,t){switch(e){case"keyup":return H1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ti=!1;function W1(e,t){switch(e){case"compositionend":return Wp(t);case"keypress":return t.which!==32?null:(Ff=!0,$f);case"textInput":return e=t.data,e===$f&&Ff?null:e;default:return null}}function G1(e,t){if(Ti)return e==="compositionend"||!Yu&&Vp(e,t)?(e=Bp(),ua=qu=Lr=null,Ti=!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 Hp&&t.locale!=="ko"?null:t.data;default:return null}}var q1={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 Of(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!q1[e.type]:t==="textarea"}function Gp(e,t,n,r){jp(r),t=za(t,"onChange"),0<t.length&&(n=new Qu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Us=null,sl=null;function Q1(e){rg(e,0)}function oo(e){var t=Li(e);if(gp(t))return e}function K1(e,t){if(e==="change")return t}var qp=!1;if(nr){var Uo;if(nr){var Bo="oninput"in document;if(!Bo){var Uf=document.createElement("div");Uf.setAttribute("oninput","return;"),Bo=typeof Uf.oninput=="function"}Uo=Bo}else Uo=!1;qp=Uo&&(!document.documentMode||9<document.documentMode)}function Bf(){Us&&(Us.detachEvent("onpropertychange",Qp),sl=Us=null)}function Qp(e){if(e.propertyName==="value"&&oo(sl)){var t=[];Gp(t,sl,e,Bu(e)),_p(Q1,t)}}function Y1(e,t,n){e==="focusin"?(Bf(),Us=t,sl=n,Us.attachEvent("onpropertychange",Qp)):e==="focusout"&&Bf()}function X1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return oo(sl)}function J1(e,t){if(e==="click")return oo(t)}function Z1(e,t){if(e==="input"||e==="change")return oo(t)}function ek(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pn=typeof Object.is=="function"?Object.is:ek;function ll(e,t){if(Pn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!jc.call(t,i)||!Pn(e[i],t[i]))return!1}return!0}function Hf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vf(e,t){var n=Hf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Hf(n)}}function Kp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yp(){for(var e=window,t=ja();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ja(e.document)}return t}function Xu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function tk(e){var t=Yp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Kp(n.ownerDocument.documentElement,n)){if(r!==null&&Xu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=Vf(n,l);var a=Vf(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var nk=nr&&"documentMode"in document&&11>=document.documentMode,zi=null,Bc=null,Bs=null,Hc=!1;function Wf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hc||zi==null||zi!==ja(r)||(r=zi,"selectionStart"in r&&Xu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Bs&&ll(Bs,r)||(Bs=r,r=za(Bc,"onSelect"),0<r.length&&(t=new Qu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=zi)))}function Vl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ai={animationend:Vl("Animation","AnimationEnd"),animationiteration:Vl("Animation","AnimationIteration"),animationstart:Vl("Animation","AnimationStart"),transitionend:Vl("Transition","TransitionEnd")},Ho={},Xp={};nr&&(Xp=document.createElement("div").style,"AnimationEvent"in window||(delete Ai.animationend.animation,delete Ai.animationiteration.animation,delete Ai.animationstart.animation),"TransitionEvent"in window||delete Ai.transitionend.transition);function co(e){if(Ho[e])return Ho[e];if(!Ai[e])return e;var t=Ai[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Xp)return Ho[e]=t[n];return e}var Jp=co("animationend"),Zp=co("animationiteration"),eg=co("animationstart"),tg=co("transitionend"),ng=new Map,Gf="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Vr(e,t){ng.set(e,t),hi(t,[e])}for(var Vo=0;Vo<Gf.length;Vo++){var Wo=Gf[Vo],rk=Wo.toLowerCase(),ik=Wo[0].toUpperCase()+Wo.slice(1);Vr(rk,"on"+ik)}Vr(Jp,"onAnimationEnd");Vr(Zp,"onAnimationIteration");Vr(eg,"onAnimationStart");Vr("dblclick","onDoubleClick");Vr("focusin","onFocus");Vr("focusout","onBlur");Vr(tg,"onTransitionEnd");Yi("onMouseEnter",["mouseout","mouseover"]);Yi("onMouseLeave",["mouseout","mouseover"]);Yi("onPointerEnter",["pointerout","pointerover"]);Yi("onPointerLeave",["pointerout","pointerover"]);hi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));hi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));hi("onBeforeInput",["compositionend","keypress","textInput","paste"]);hi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));hi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));hi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ms="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(" "),sk=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ms));function qf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,r1(r,t,void 0,e),e.currentTarget=null}function rg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==l&&i.isPropagationStopped())break e;qf(i,o,u),l=c}else for(a=0;a<r.length;a++){if(o=r[a],c=o.instance,u=o.currentTarget,o=o.listener,c!==l&&i.isPropagationStopped())break e;qf(i,o,u),l=c}}}if(Na)throw e=$c,Na=!1,$c=null,e}function Ve(e,t){var n=t[Qc];n===void 0&&(n=t[Qc]=new Set);var r=e+"__bubble";n.has(r)||(ig(t,e,2,!1),n.add(r))}function Go(e,t,n){var r=0;t&&(r|=4),ig(n,e,r,t)}var Wl="_reactListening"+Math.random().toString(36).slice(2);function al(e){if(!e[Wl]){e[Wl]=!0,dp.forEach(function(n){n!=="selectionchange"&&(sk.has(n)||Go(n,!1,e),Go(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wl]||(t[Wl]=!0,Go("selectionchange",!1,t))}}function ig(e,t,n,r){switch(Up(t)){case 1:var i=v1;break;case 4:i=k1;break;default:i=Gu}n=i.bind(null,t,n,e),i=void 0,!Rc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function qo(e,t,n,r,i){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;a=a.return}for(;o!==null;){if(a=Jr(o),a===null)return;if(c=a.tag,c===5||c===6){r=l=a;continue e}o=o.parentNode}}r=r.return}_p(function(){var u=l,d=Bu(n),f=[];e:{var h=ng.get(e);if(h!==void 0){var m=Qu,g=e;switch(e){case"keypress":if(da(n)===0)break e;case"keydown":case"keyup":m=P1;break;case"focusin":g="focus",m=Oo;break;case"focusout":g="blur",m=Oo;break;case"beforeblur":case"afterblur":m=Oo;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Pf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=j1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=$1;break;case Jp:case Zp:case eg:m=C1;break;case tg:m=O1;break;case"scroll":m=w1;break;case"wheel":m=B1;break;case"copy":case"cut":case"paste":m=E1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Rf}var k=(t&4)!==0,v=!k&&e==="scroll",y=k?h!==null?h+"Capture":null:h;k=[];for(var w=u,j;w!==null;){j=w;var z=j.stateNode;if(j.tag===5&&z!==null&&(j=z,y!==null&&(z=tl(w,y),z!=null&&k.push(ol(w,z,j)))),v)break;w=w.return}0<k.length&&(h=new m(h,g,null,n,d),f.push({event:h,listeners:k}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Pc&&(g=n.relatedTarget||n.fromElement)&&(Jr(g)||g[rr]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?Jr(g):null,g!==null&&(v=pi(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(k=Pf,z="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(k=Rf,z="onPointerLeave",y="onPointerEnter",w="pointer"),v=m==null?h:Li(m),j=g==null?h:Li(g),h=new k(z,w+"leave",m,n,d),h.target=v,h.relatedTarget=j,z=null,Jr(d)===u&&(k=new k(y,w+"enter",g,n,d),k.target=j,k.relatedTarget=v,z=k),v=z,m&&g)t:{for(k=m,y=g,w=0,j=k;j;j=vi(j))w++;for(j=0,z=y;z;z=vi(z))j++;for(;0<w-j;)k=vi(k),w--;for(;0<j-w;)y=vi(y),j--;for(;w--;){if(k===y||y!==null&&k===y.alternate)break t;k=vi(k),y=vi(y)}k=null}else k=null;m!==null&&Qf(f,h,m,k,!1),g!==null&&v!==null&&Qf(f,v,g,k,!0)}}e:{if(h=u?Li(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var D=K1;else if(Of(h))if(qp)D=Z1;else{D=X1;var C=Y1}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(D=J1);if(D&&(D=D(e,u))){Gp(f,D,n,d);break e}C&&C(e,h,u),e==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&zc(h,"number",h.value)}switch(C=u?Li(u):window,e){case"focusin":(Of(C)||C.contentEditable==="true")&&(zi=C,Bc=u,Bs=null);break;case"focusout":Bs=Bc=zi=null;break;case"mousedown":Hc=!0;break;case"contextmenu":case"mouseup":case"dragend":Hc=!1,Wf(f,n,d);break;case"selectionchange":if(nk)break;case"keydown":case"keyup":Wf(f,n,d)}var A;if(Yu)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Ti?Vp(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(Hp&&n.locale!=="ko"&&(Ti||_!=="onCompositionStart"?_==="onCompositionEnd"&&Ti&&(A=Bp()):(Lr=d,qu="value"in Lr?Lr.value:Lr.textContent,Ti=!0)),C=za(u,_),0<C.length&&(_=new Mf(_,e,null,n,d),f.push({event:_,listeners:C}),A?_.data=A:(A=Wp(n),A!==null&&(_.data=A)))),(A=V1?W1(e,n):G1(e,n))&&(u=za(u,"onBeforeInput"),0<u.length&&(d=new Mf("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=A))}rg(f,t)})}function ol(e,t,n){return{instance:e,listener:t,currentTarget:n}}function za(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,l=i.stateNode;i.tag===5&&l!==null&&(i=l,l=tl(e,n),l!=null&&r.unshift(ol(e,l,i)),l=tl(e,t),l!=null&&r.push(ol(e,l,i))),e=e.return}return r}function vi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Qf(e,t,n,r,i){for(var l=t._reactName,a=[];n!==null&&n!==r;){var o=n,c=o.alternate,u=o.stateNode;if(c!==null&&c===r)break;o.tag===5&&u!==null&&(o=u,i?(c=tl(n,l),c!=null&&a.unshift(ol(n,c,o))):i||(c=tl(n,l),c!=null&&a.push(ol(n,c,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var lk=/\r\n?/g,ak=/\u0000|\uFFFD/g;function Kf(e){return(typeof e=="string"?e:""+e).replace(lk,`
|
|
38
|
+
`).replace(ak,"")}function Gl(e,t,n){if(t=Kf(t),Kf(e)!==t&&n)throw Error(W(425))}function Aa(){}var Vc=null,Wc=null;function Gc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qc=typeof setTimeout=="function"?setTimeout:void 0,ok=typeof clearTimeout=="function"?clearTimeout:void 0,Yf=typeof Promise=="function"?Promise:void 0,ck=typeof queueMicrotask=="function"?queueMicrotask:typeof Yf<"u"?function(e){return Yf.resolve(null).then(e).catch(uk)}:qc;function uk(e){setTimeout(function(){throw e})}function Qo(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),il(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);il(t)}function Rr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Xf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var cs=Math.random().toString(36).slice(2),Un="__reactFiber$"+cs,cl="__reactProps$"+cs,rr="__reactContainer$"+cs,Qc="__reactEvents$"+cs,dk="__reactListeners$"+cs,fk="__reactHandles$"+cs;function Jr(e){var t=e[Un];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rr]||n[Un]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Xf(e);e!==null;){if(n=e[Un])return n;e=Xf(e)}return t}e=n,n=e.parentNode}return null}function jl(e){return e=e[Un]||e[rr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Li(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(W(33))}function uo(e){return e[cl]||null}var Kc=[],Di=-1;function Wr(e){return{current:e}}function We(e){0>Di||(e.current=Kc[Di],Kc[Di]=null,Di--)}function He(e,t){Di++,Kc[Di]=e.current,e.current=t}var Hr={},Dt=Wr(Hr),Qt=Wr(!1),ii=Hr;function Xi(e,t){var n=e.type.contextTypes;if(!n)return Hr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Kt(e){return e=e.childContextTypes,e!=null}function La(){We(Qt),We(Dt)}function Jf(e,t,n){if(Dt.current!==Hr)throw Error(W(168));He(Dt,t),He(Qt,n)}function sg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(W(108,Yv(e)||"Unknown",i));return tt({},n,r)}function Da(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Hr,ii=Dt.current,He(Dt,e),He(Qt,Qt.current),!0}function Zf(e,t,n){var r=e.stateNode;if(!r)throw Error(W(169));n?(e=sg(e,t,ii),r.__reactInternalMemoizedMergedChildContext=e,We(Qt),We(Dt),He(Dt,e)):We(Qt),He(Qt,n)}var Yn=null,fo=!1,Ko=!1;function lg(e){Yn===null?Yn=[e]:Yn.push(e)}function mk(e){fo=!0,lg(e)}function Gr(){if(!Ko&&Yn!==null){Ko=!0;var e=0,t=$e;try{var n=Yn;for($e=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Yn=null,fo=!1}catch(i){throw Yn!==null&&(Yn=Yn.slice(e+1)),Ap(Hu,Gr),i}finally{$e=t,Ko=!1}}return null}var Ii=[],Pi=0,Ia=null,Pa=0,fn=[],mn=0,si=null,Jn=1,Zn="";function Kr(e,t){Ii[Pi++]=Pa,Ii[Pi++]=Ia,Ia=e,Pa=t}function ag(e,t,n){fn[mn++]=Jn,fn[mn++]=Zn,fn[mn++]=si,si=e;var r=Jn;e=Zn;var i=32-Ln(r)-1;r&=~(1<<i),n+=1;var l=32-Ln(t)+i;if(30<l){var a=i-i%5;l=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Jn=1<<32-Ln(t)+i|n<<i|r,Zn=l+e}else Jn=1<<l|n<<i|r,Zn=e}function Ju(e){e.return!==null&&(Kr(e,1),ag(e,1,0))}function Zu(e){for(;e===Ia;)Ia=Ii[--Pi],Ii[Pi]=null,Pa=Ii[--Pi],Ii[Pi]=null;for(;e===si;)si=fn[--mn],fn[mn]=null,Zn=fn[--mn],fn[mn]=null,Jn=fn[--mn],fn[mn]=null}var sn=null,rn=null,Ye=!1,Tn=null;function og(e,t){var n=pn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function em(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sn=e,rn=Rr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sn=e,rn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=si!==null?{id:Jn,overflow:Zn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=pn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,sn=e,rn=null,!0):!1;default:return!1}}function Yc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xc(e){if(Ye){var t=rn;if(t){var n=t;if(!em(e,t)){if(Yc(e))throw Error(W(418));t=Rr(n.nextSibling);var r=sn;t&&em(e,t)?og(r,n):(e.flags=e.flags&-4097|2,Ye=!1,sn=e)}}else{if(Yc(e))throw Error(W(418));e.flags=e.flags&-4097|2,Ye=!1,sn=e}}}function tm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;sn=e}function ql(e){if(e!==sn)return!1;if(!Ye)return tm(e),Ye=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Gc(e.type,e.memoizedProps)),t&&(t=rn)){if(Yc(e))throw cg(),Error(W(418));for(;t;)og(e,t),t=Rr(t.nextSibling)}if(tm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){rn=Rr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}rn=null}}else rn=sn?Rr(e.stateNode.nextSibling):null;return!0}function cg(){for(var e=rn;e;)e=Rr(e.nextSibling)}function Ji(){rn=sn=null,Ye=!1}function ed(e){Tn===null?Tn=[e]:Tn.push(e)}var hk=lr.ReactCurrentBatchConfig;function _s(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(W(309));var r=n.stateNode}if(!r)throw Error(W(147,e));var i=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(a){var o=i.refs;a===null?delete o[l]:o[l]=a},t._stringRef=l,t)}if(typeof e!="string")throw Error(W(284));if(!n._owner)throw Error(W(290,e))}return e}function Ql(e,t){throw e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function nm(e){var t=e._init;return t(e._payload)}function ug(e){function t(y,w){if(e){var j=y.deletions;j===null?(y.deletions=[w],y.flags|=16):j.push(w)}}function n(y,w){if(!e)return null;for(;w!==null;)t(y,w),w=w.sibling;return null}function r(y,w){for(y=new Map;w!==null;)w.key!==null?y.set(w.key,w):y.set(w.index,w),w=w.sibling;return y}function i(y,w){return y=Ur(y,w),y.index=0,y.sibling=null,y}function l(y,w,j){return y.index=j,e?(j=y.alternate,j!==null?(j=j.index,j<w?(y.flags|=2,w):j):(y.flags|=2,w)):(y.flags|=1048576,w)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function o(y,w,j,z){return w===null||w.tag!==6?(w=nc(j,y.mode,z),w.return=y,w):(w=i(w,j),w.return=y,w)}function c(y,w,j,z){var D=j.type;return D===Ei?d(y,w,j.props.children,z,j.key):w!==null&&(w.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===Er&&nm(D)===w.type)?(z=i(w,j.props),z.ref=_s(y,w,j),z.return=y,z):(z=xa(j.type,j.key,j.props,null,y.mode,z),z.ref=_s(y,w,j),z.return=y,z)}function u(y,w,j,z){return w===null||w.tag!==4||w.stateNode.containerInfo!==j.containerInfo||w.stateNode.implementation!==j.implementation?(w=rc(j,y.mode,z),w.return=y,w):(w=i(w,j.children||[]),w.return=y,w)}function d(y,w,j,z,D){return w===null||w.tag!==7?(w=ri(j,y.mode,z,D),w.return=y,w):(w=i(w,j),w.return=y,w)}function f(y,w,j){if(typeof w=="string"&&w!==""||typeof w=="number")return w=nc(""+w,y.mode,j),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Rl:return j=xa(w.type,w.key,w.props,null,y.mode,j),j.ref=_s(y,null,w),j.return=y,j;case _i:return w=rc(w,y.mode,j),w.return=y,w;case Er:var z=w._init;return f(y,z(w._payload),j)}if(Is(w)||bs(w))return w=ri(w,y.mode,j,null),w.return=y,w;Ql(y,w)}return null}function h(y,w,j,z){var D=w!==null?w.key:null;if(typeof j=="string"&&j!==""||typeof j=="number")return D!==null?null:o(y,w,""+j,z);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Rl:return j.key===D?c(y,w,j,z):null;case _i:return j.key===D?u(y,w,j,z):null;case Er:return D=j._init,h(y,w,D(j._payload),z)}if(Is(j)||bs(j))return D!==null?null:d(y,w,j,z,null);Ql(y,j)}return null}function m(y,w,j,z,D){if(typeof z=="string"&&z!==""||typeof z=="number")return y=y.get(j)||null,o(w,y,""+z,D);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case Rl:return y=y.get(z.key===null?j:z.key)||null,c(w,y,z,D);case _i:return y=y.get(z.key===null?j:z.key)||null,u(w,y,z,D);case Er:var C=z._init;return m(y,w,j,C(z._payload),D)}if(Is(z)||bs(z))return y=y.get(j)||null,d(w,y,z,D,null);Ql(w,z)}return null}function g(y,w,j,z){for(var D=null,C=null,A=w,_=w=0,I=null;A!==null&&_<j.length;_++){A.index>_?(I=A,A=null):I=A.sibling;var N=h(y,A,j[_],z);if(N===null){A===null&&(A=I);break}e&&A&&N.alternate===null&&t(y,A),w=l(N,w,_),C===null?D=N:C.sibling=N,C=N,A=I}if(_===j.length)return n(y,A),Ye&&Kr(y,_),D;if(A===null){for(;_<j.length;_++)A=f(y,j[_],z),A!==null&&(w=l(A,w,_),C===null?D=A:C.sibling=A,C=A);return Ye&&Kr(y,_),D}for(A=r(y,A);_<j.length;_++)I=m(A,y,_,j[_],z),I!==null&&(e&&I.alternate!==null&&A.delete(I.key===null?_:I.key),w=l(I,w,_),C===null?D=I:C.sibling=I,C=I);return e&&A.forEach(function(U){return t(y,U)}),Ye&&Kr(y,_),D}function k(y,w,j,z){var D=bs(j);if(typeof D!="function")throw Error(W(150));if(j=D.call(j),j==null)throw Error(W(151));for(var C=D=null,A=w,_=w=0,I=null,N=j.next();A!==null&&!N.done;_++,N=j.next()){A.index>_?(I=A,A=null):I=A.sibling;var U=h(y,A,N.value,z);if(U===null){A===null&&(A=I);break}e&&A&&U.alternate===null&&t(y,A),w=l(U,w,_),C===null?D=U:C.sibling=U,C=U,A=I}if(N.done)return n(y,A),Ye&&Kr(y,_),D;if(A===null){for(;!N.done;_++,N=j.next())N=f(y,N.value,z),N!==null&&(w=l(N,w,_),C===null?D=N:C.sibling=N,C=N);return Ye&&Kr(y,_),D}for(A=r(y,A);!N.done;_++,N=j.next())N=m(A,y,_,N.value,z),N!==null&&(e&&N.alternate!==null&&A.delete(N.key===null?_:N.key),w=l(N,w,_),C===null?D=N:C.sibling=N,C=N);return e&&A.forEach(function(O){return t(y,O)}),Ye&&Kr(y,_),D}function v(y,w,j,z){if(typeof j=="object"&&j!==null&&j.type===Ei&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case Rl:e:{for(var D=j.key,C=w;C!==null;){if(C.key===D){if(D=j.type,D===Ei){if(C.tag===7){n(y,C.sibling),w=i(C,j.props.children),w.return=y,y=w;break e}}else if(C.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===Er&&nm(D)===C.type){n(y,C.sibling),w=i(C,j.props),w.ref=_s(y,C,j),w.return=y,y=w;break e}n(y,C);break}else t(y,C);C=C.sibling}j.type===Ei?(w=ri(j.props.children,y.mode,z,j.key),w.return=y,y=w):(z=xa(j.type,j.key,j.props,null,y.mode,z),z.ref=_s(y,w,j),z.return=y,y=z)}return a(y);case _i:e:{for(C=j.key;w!==null;){if(w.key===C)if(w.tag===4&&w.stateNode.containerInfo===j.containerInfo&&w.stateNode.implementation===j.implementation){n(y,w.sibling),w=i(w,j.children||[]),w.return=y,y=w;break e}else{n(y,w);break}else t(y,w);w=w.sibling}w=rc(j,y.mode,z),w.return=y,y=w}return a(y);case Er:return C=j._init,v(y,w,C(j._payload),z)}if(Is(j))return g(y,w,j,z);if(bs(j))return k(y,w,j,z);Ql(y,j)}return typeof j=="string"&&j!==""||typeof j=="number"?(j=""+j,w!==null&&w.tag===6?(n(y,w.sibling),w=i(w,j),w.return=y,y=w):(n(y,w),w=nc(j,y.mode,z),w.return=y,y=w),a(y)):n(y,w)}return v}var Zi=ug(!0),dg=ug(!1),Ma=Wr(null),Ra=null,Mi=null,td=null;function nd(){td=Mi=Ra=null}function rd(e){var t=Ma.current;We(Ma),e._currentValue=t}function Jc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Vi(e,t){Ra=e,td=Mi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qt=!0),e.firstContext=null)}function yn(e){var t=e._currentValue;if(td!==e)if(e={context:e,memoizedValue:t,next:null},Mi===null){if(Ra===null)throw Error(W(308));Mi=e,Ra.dependencies={lanes:0,firstContext:e}}else Mi=Mi.next=e;return t}var Zr=null;function id(e){Zr===null?Zr=[e]:Zr.push(e)}function fg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,id(t)):(n.next=i.next,i.next=n),t.interleaved=n,ir(e,r)}function ir(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Tr=!1;function sd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function tr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $r(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ie&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,ir(e,n)}return i=r.interleaved,i===null?(t.next=t,id(r)):(t.next=i.next,i.next=t),r.interleaved=t,ir(e,n)}function fa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vu(e,n)}}function rm(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?i=l=a:l=l.next=a,n=n.next}while(n!==null);l===null?i=l=t:l=l.next=t}else i=l=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function $a(e,t,n,r){var i=e.updateQueue;Tr=!1;var l=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var c=o,u=c.next;c.next=null,a===null?l=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=c))}if(l!==null){var f=i.baseState;a=0,d=u=c=null,o=l;do{var h=o.lane,m=o.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var g=e,k=o;switch(h=t,m=n,k.tag){case 1:if(g=k.payload,typeof g=="function"){f=g.call(m,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=k.payload,h=typeof g=="function"?g.call(m,f,h):g,h==null)break e;f=tt({},f,h);break e;case 2:Tr=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[o]:h.push(o))}else m={eventTime:m,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,a|=h;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;h=o,o=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else l===null&&(i.shared.lanes=0);ai|=a,e.lanes=a,e.memoizedState=f}}function im(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(W(191,i));i.call(r)}}}var Sl={},Hn=Wr(Sl),ul=Wr(Sl),dl=Wr(Sl);function ei(e){if(e===Sl)throw Error(W(174));return e}function ld(e,t){switch(He(dl,t),He(ul,e),He(Hn,Sl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Lc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Lc(t,e)}We(Hn),He(Hn,t)}function es(){We(Hn),We(ul),We(dl)}function hg(e){ei(dl.current);var t=ei(Hn.current),n=Lc(t,e.type);t!==n&&(He(ul,e),He(Hn,n))}function ad(e){ul.current===e&&(We(Hn),We(ul))}var Je=Wr(0);function Fa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Yo=[];function od(){for(var e=0;e<Yo.length;e++)Yo[e]._workInProgressVersionPrimary=null;Yo.length=0}var ma=lr.ReactCurrentDispatcher,Xo=lr.ReactCurrentBatchConfig,li=0,et=null,ft=null,vt=null,Oa=!1,Hs=!1,fl=0,pk=0;function Tt(){throw Error(W(321))}function cd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pn(e[n],t[n]))return!1;return!0}function ud(e,t,n,r,i,l){if(li=l,et=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ma.current=e===null||e.memoizedState===null?vk:kk,e=n(r,i),Hs){l=0;do{if(Hs=!1,fl=0,25<=l)throw Error(W(301));l+=1,vt=ft=null,t.updateQueue=null,ma.current=wk,e=n(r,i)}while(Hs)}if(ma.current=Ua,t=ft!==null&&ft.next!==null,li=0,vt=ft=et=null,Oa=!1,t)throw Error(W(300));return e}function dd(){var e=fl!==0;return fl=0,e}function Fn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?et.memoizedState=vt=e:vt=vt.next=e,vt}function xn(){if(ft===null){var e=et.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var t=vt===null?et.memoizedState:vt.next;if(t!==null)vt=t,ft=e;else{if(e===null)throw Error(W(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},vt===null?et.memoizedState=vt=e:vt=vt.next=e}return vt}function ml(e,t){return typeof t=="function"?t(e):t}function Jo(e){var t=xn(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var r=ft,i=r.baseQueue,l=n.pending;if(l!==null){if(i!==null){var a=i.next;i.next=l.next,l.next=a}r.baseQueue=i=l,n.pending=null}if(i!==null){l=i.next,r=r.baseState;var o=a=null,c=null,u=l;do{var d=u.lane;if((li&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(o=c=f,a=r):c=c.next=f,et.lanes|=d,ai|=d}u=u.next}while(u!==null&&u!==l);c===null?a=r:c.next=o,Pn(r,t.memoizedState)||(qt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do l=i.lane,et.lanes|=l,ai|=l,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Zo(e){var t=xn(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,l=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do l=e(l,a.action),a=a.next;while(a!==i);Pn(l,t.memoizedState)||(qt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function pg(){}function gg(e,t){var n=et,r=xn(),i=t(),l=!Pn(r.memoizedState,i);if(l&&(r.memoizedState=i,qt=!0),r=r.queue,fd(vg.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||vt!==null&&vt.memoizedState.tag&1){if(n.flags|=2048,hl(9,xg.bind(null,n,r,i,t),void 0,null),kt===null)throw Error(W(349));li&30||yg(n,t,i)}return i}function yg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=et.updateQueue,t===null?(t={lastEffect:null,stores:null},et.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function xg(e,t,n,r){t.value=n,t.getSnapshot=r,kg(t)&&wg(e)}function vg(e,t,n){return n(function(){kg(t)&&wg(e)})}function kg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pn(e,n)}catch{return!0}}function wg(e){var t=ir(e,1);t!==null&&Dn(t,e,1,-1)}function sm(e){var t=Fn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ml,lastRenderedState:e},t.queue=e,e=e.dispatch=xk.bind(null,et,e),[t.memoizedState,e]}function hl(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=et.updateQueue,t===null?(t={lastEffect:null,stores:null},et.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function bg(){return xn().memoizedState}function ha(e,t,n,r){var i=Fn();et.flags|=e,i.memoizedState=hl(1|t,n,void 0,r===void 0?null:r)}function mo(e,t,n,r){var i=xn();r=r===void 0?null:r;var l=void 0;if(ft!==null){var a=ft.memoizedState;if(l=a.destroy,r!==null&&cd(r,a.deps)){i.memoizedState=hl(t,n,l,r);return}}et.flags|=e,i.memoizedState=hl(1|t,n,l,r)}function lm(e,t){return ha(8390656,8,e,t)}function fd(e,t){return mo(2048,8,e,t)}function jg(e,t){return mo(4,2,e,t)}function Sg(e,t){return mo(4,4,e,t)}function Ng(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Cg(e,t,n){return n=n!=null?n.concat([e]):null,mo(4,4,Ng.bind(null,t,e),n)}function md(){}function _g(e,t){var n=xn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&cd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Eg(e,t){var n=xn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&cd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Tg(e,t,n){return li&21?(Pn(n,t)||(n=Ip(),et.lanes|=n,ai|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qt=!0),e.memoizedState=n)}function gk(e,t){var n=$e;$e=n!==0&&4>n?n:4,e(!0);var r=Xo.transition;Xo.transition={};try{e(!1),t()}finally{$e=n,Xo.transition=r}}function zg(){return xn().memoizedState}function yk(e,t,n){var r=Or(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ag(e))Lg(t,n);else if(n=fg(e,t,n,r),n!==null){var i=Ot();Dn(n,e,r,i),Dg(n,t,r)}}function xk(e,t,n){var r=Or(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ag(e))Lg(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var a=t.lastRenderedState,o=l(a,n);if(i.hasEagerState=!0,i.eagerState=o,Pn(o,a)){var c=t.interleaved;c===null?(i.next=i,id(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=fg(e,t,i,r),n!==null&&(i=Ot(),Dn(n,e,r,i),Dg(n,t,r))}}function Ag(e){var t=e.alternate;return e===et||t!==null&&t===et}function Lg(e,t){Hs=Oa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Dg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vu(e,n)}}var Ua={readContext:yn,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useInsertionEffect:Tt,useLayoutEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useMutableSource:Tt,useSyncExternalStore:Tt,useId:Tt,unstable_isNewReconciler:!1},vk={readContext:yn,useCallback:function(e,t){return Fn().memoizedState=[e,t===void 0?null:t],e},useContext:yn,useEffect:lm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ha(4194308,4,Ng.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ha(4194308,4,e,t)},useInsertionEffect:function(e,t){return ha(4,2,e,t)},useMemo:function(e,t){var n=Fn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Fn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=yk.bind(null,et,e),[r.memoizedState,e]},useRef:function(e){var t=Fn();return e={current:e},t.memoizedState=e},useState:sm,useDebugValue:md,useDeferredValue:function(e){return Fn().memoizedState=e},useTransition:function(){var e=sm(!1),t=e[0];return e=gk.bind(null,e[1]),Fn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=et,i=Fn();if(Ye){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),kt===null)throw Error(W(349));li&30||yg(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,lm(vg.bind(null,r,l,e),[e]),r.flags|=2048,hl(9,xg.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Fn(),t=kt.identifierPrefix;if(Ye){var n=Zn,r=Jn;n=(r&~(1<<32-Ln(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=fl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=pk++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},kk={readContext:yn,useCallback:_g,useContext:yn,useEffect:fd,useImperativeHandle:Cg,useInsertionEffect:jg,useLayoutEffect:Sg,useMemo:Eg,useReducer:Jo,useRef:bg,useState:function(){return Jo(ml)},useDebugValue:md,useDeferredValue:function(e){var t=xn();return Tg(t,ft.memoizedState,e)},useTransition:function(){var e=Jo(ml)[0],t=xn().memoizedState;return[e,t]},useMutableSource:pg,useSyncExternalStore:gg,useId:zg,unstable_isNewReconciler:!1},wk={readContext:yn,useCallback:_g,useContext:yn,useEffect:fd,useImperativeHandle:Cg,useInsertionEffect:jg,useLayoutEffect:Sg,useMemo:Eg,useReducer:Zo,useRef:bg,useState:function(){return Zo(ml)},useDebugValue:md,useDeferredValue:function(e){var t=xn();return ft===null?t.memoizedState=e:Tg(t,ft.memoizedState,e)},useTransition:function(){var e=Zo(ml)[0],t=xn().memoizedState;return[e,t]},useMutableSource:pg,useSyncExternalStore:gg,useId:zg,unstable_isNewReconciler:!1};function _n(e,t){if(e&&e.defaultProps){t=tt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Zc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:tt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ho={isMounted:function(e){return(e=e._reactInternals)?pi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ot(),i=Or(e),l=tr(r,i);l.payload=t,n!=null&&(l.callback=n),t=$r(e,l,i),t!==null&&(Dn(t,e,i,r),fa(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ot(),i=Or(e),l=tr(r,i);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=$r(e,l,i),t!==null&&(Dn(t,e,i,r),fa(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ot(),r=Or(e),i=tr(n,r);i.tag=2,t!=null&&(i.callback=t),t=$r(e,i,r),t!==null&&(Dn(t,e,r,n),fa(t,e,r))}};function am(e,t,n,r,i,l,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,a):t.prototype&&t.prototype.isPureReactComponent?!ll(n,r)||!ll(i,l):!0}function Ig(e,t,n){var r=!1,i=Hr,l=t.contextType;return typeof l=="object"&&l!==null?l=yn(l):(i=Kt(t)?ii:Dt.current,r=t.contextTypes,l=(r=r!=null)?Xi(e,i):Hr),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ho,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=l),t}function om(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ho.enqueueReplaceState(t,t.state,null)}function eu(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},sd(e);var l=t.contextType;typeof l=="object"&&l!==null?i.context=yn(l):(l=Kt(t)?ii:Dt.current,i.context=Xi(e,l)),i.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(Zc(e,t,l,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&ho.enqueueReplaceState(i,i.state,null),$a(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ts(e,t){try{var n="",r=t;do n+=Kv(r),r=r.return;while(r);var i=n}catch(l){i=`
|
|
39
|
+
Error generating stack: `+l.message+`
|
|
40
|
+
`+l.stack}return{value:e,source:t,stack:i,digest:null}}function ec(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function tu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var bk=typeof WeakMap=="function"?WeakMap:Map;function Pg(e,t,n){n=tr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ha||(Ha=!0,du=r),tu(e,t)},n}function Mg(e,t,n){n=tr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){tu(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){tu(e,t),typeof r!="function"&&(Fr===null?Fr=new Set([this]):Fr.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function cm(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new bk;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Mk.bind(null,e,t,n),t.then(e,e))}function um(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function dm(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=tr(-1,1),t.tag=2,$r(n,t,1))),n.lanes|=1),e)}var jk=lr.ReactCurrentOwner,qt=!1;function $t(e,t,n,r){t.child=e===null?dg(t,null,n,r):Zi(t,e.child,n,r)}function fm(e,t,n,r,i){n=n.render;var l=t.ref;return Vi(t,i),r=ud(e,t,n,r,l,i),n=dd(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,sr(e,t,i)):(Ye&&n&&Ju(t),t.flags|=1,$t(e,t,r,i),t.child)}function mm(e,t,n,r,i){if(e===null){var l=n.type;return typeof l=="function"&&!wd(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,Rg(e,t,l,r,i)):(e=xa(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&i)){var a=l.memoizedProps;if(n=n.compare,n=n!==null?n:ll,n(a,r)&&e.ref===t.ref)return sr(e,t,i)}return t.flags|=1,e=Ur(l,r),e.ref=t.ref,e.return=t,t.child=e}function Rg(e,t,n,r,i){if(e!==null){var l=e.memoizedProps;if(ll(l,r)&&e.ref===t.ref)if(qt=!1,t.pendingProps=r=l,(e.lanes&i)!==0)e.flags&131072&&(qt=!0);else return t.lanes=e.lanes,sr(e,t,i)}return nu(e,t,n,r,i)}function $g(e,t,n){var r=t.pendingProps,i=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},He($i,nn),nn|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,He($i,nn),nn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,He($i,nn),nn|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,He($i,nn),nn|=r;return $t(e,t,i,n),t.child}function Fg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function nu(e,t,n,r,i){var l=Kt(n)?ii:Dt.current;return l=Xi(t,l),Vi(t,i),n=ud(e,t,n,r,l,i),r=dd(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,sr(e,t,i)):(Ye&&r&&Ju(t),t.flags|=1,$t(e,t,n,i),t.child)}function hm(e,t,n,r,i){if(Kt(n)){var l=!0;Da(t)}else l=!1;if(Vi(t,i),t.stateNode===null)pa(e,t),Ig(t,n,r),eu(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=yn(u):(u=Kt(n)?ii:Dt.current,u=Xi(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||c!==u)&&om(t,a,r,u),Tr=!1;var h=t.memoizedState;a.state=h,$a(t,r,a,i),c=t.memoizedState,o!==r||h!==c||Qt.current||Tr?(typeof d=="function"&&(Zc(t,n,d,r),c=t.memoizedState),(o=Tr||am(t,n,o,r,h,c,u))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,mg(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:_n(t.type,o),a.props=u,f=t.pendingProps,h=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=yn(c):(c=Kt(n)?ii:Dt.current,c=Xi(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||h!==c)&&om(t,a,r,c),Tr=!1,h=t.memoizedState,a.state=h,$a(t,r,a,i);var g=t.memoizedState;o!==f||h!==g||Qt.current||Tr?(typeof m=="function"&&(Zc(t,n,m,r),g=t.memoizedState),(u=Tr||am(t,n,u,r,h,g,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,g,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,g,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),a.props=r,a.state=g,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return ru(e,t,n,r,l,i)}function ru(e,t,n,r,i,l){Fg(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&Zf(t,n,!1),sr(e,t,l);r=t.stateNode,jk.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Zi(t,e.child,null,l),t.child=Zi(t,null,o,l)):$t(e,t,o,l),t.memoizedState=r.state,i&&Zf(t,n,!0),t.child}function Og(e){var t=e.stateNode;t.pendingContext?Jf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Jf(e,t.context,!1),ld(e,t.containerInfo)}function pm(e,t,n,r,i){return Ji(),ed(i),t.flags|=256,$t(e,t,n,r),t.child}var iu={dehydrated:null,treeContext:null,retryLane:0};function su(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ug(e,t,n){var r=t.pendingProps,i=Je.current,l=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),He(Je,i&1),e===null)return Xc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,l?(r=t.mode,l=t.child,a={mode:"hidden",children:a},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=a):l=yo(a,r,0,null),e=ri(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=su(n),t.memoizedState=iu,e):hd(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return Sk(e,t,a,r,o,i,n);if(l){l=r.fallback,a=t.mode,i=e.child,o=i.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Ur(i,c),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?l=Ur(o,l):(l=ri(l,a,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,a=e.child.memoizedState,a=a===null?su(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},l.memoizedState=a,l.childLanes=e.childLanes&~n,t.memoizedState=iu,r}return l=e.child,e=l.sibling,r=Ur(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function hd(e,t){return t=yo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Kl(e,t,n,r){return r!==null&&ed(r),Zi(t,e.child,null,n),e=hd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sk(e,t,n,r,i,l,a){if(n)return t.flags&256?(t.flags&=-257,r=ec(Error(W(422))),Kl(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,i=t.mode,r=yo({mode:"visible",children:r.children},i,0,null),l=ri(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&Zi(t,e.child,null,a),t.child.memoizedState=su(a),t.memoizedState=iu,l);if(!(t.mode&1))return Kl(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,l=Error(W(419)),r=ec(l,r,void 0),Kl(e,t,a,r)}if(o=(a&e.childLanes)!==0,qt||o){if(r=kt,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==l.retryLane&&(l.retryLane=i,ir(e,i),Dn(r,e,i,-1))}return kd(),r=ec(Error(W(421))),Kl(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Rk.bind(null,e),i._reactRetry=t,null):(e=l.treeContext,rn=Rr(i.nextSibling),sn=t,Ye=!0,Tn=null,e!==null&&(fn[mn++]=Jn,fn[mn++]=Zn,fn[mn++]=si,Jn=e.id,Zn=e.overflow,si=t),t=hd(t,r.children),t.flags|=4096,t)}function gm(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Jc(e.return,t,n)}function tc(e,t,n,r,i){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=i)}function Bg(e,t,n){var r=t.pendingProps,i=r.revealOrder,l=r.tail;if($t(e,t,r.children,n),r=Je.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gm(e,n,t);else if(e.tag===19)gm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(He(Je,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Fa(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),tc(t,!1,i,n,l);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Fa(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}tc(t,!0,n,null,l);break;case"together":tc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function pa(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function sr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ai|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(W(153));if(t.child!==null){for(e=t.child,n=Ur(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ur(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nk(e,t,n){switch(t.tag){case 3:Og(t),Ji();break;case 5:hg(t);break;case 1:Kt(t.type)&&Da(t);break;case 4:ld(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;He(Ma,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(He(Je,Je.current&1),t.flags|=128,null):n&t.child.childLanes?Ug(e,t,n):(He(Je,Je.current&1),e=sr(e,t,n),e!==null?e.sibling:null);He(Je,Je.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Bg(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),He(Je,Je.current),r)break;return null;case 22:case 23:return t.lanes=0,$g(e,t,n)}return sr(e,t,n)}var Hg,lu,Vg,Wg;Hg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};lu=function(){};Vg=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ei(Hn.current);var l=null;switch(n){case"input":i=Ec(e,i),r=Ec(e,r),l=[];break;case"select":i=tt({},i,{value:void 0}),r=tt({},r,{value:void 0}),l=[];break;case"textarea":i=Ac(e,i),r=Ac(e,r),l=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Aa)}Dc(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Zs.hasOwnProperty(u)?l||(l=[]):(l=l||[]).push(u,null));for(u in r){var c=r[u];if(o=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&o[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(l||(l=[]),l.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(l=l||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(l=l||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Zs.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Ve("scroll",e),l||o===c||(l=[])):(l=l||[]).push(u,c))}n&&(l=l||[]).push("style",n);var u=l;(t.updateQueue=u)&&(t.flags|=4)}};Wg=function(e,t,n,r){n!==r&&(t.flags|=4)};function Es(e,t){if(!Ye)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ck(e,t,n){var r=t.pendingProps;switch(Zu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(t),null;case 1:return Kt(t.type)&&La(),zt(t),null;case 3:return r=t.stateNode,es(),We(Qt),We(Dt),od(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ql(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tn!==null&&(hu(Tn),Tn=null))),lu(e,t),zt(t),null;case 5:ad(t);var i=ei(dl.current);if(n=t.type,e!==null&&t.stateNode!=null)Vg(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(W(166));return zt(t),null}if(e=ei(Hn.current),ql(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[Un]=t,r[cl]=l,e=(t.mode&1)!==0,n){case"dialog":Ve("cancel",r),Ve("close",r);break;case"iframe":case"object":case"embed":Ve("load",r);break;case"video":case"audio":for(i=0;i<Ms.length;i++)Ve(Ms[i],r);break;case"source":Ve("error",r);break;case"img":case"image":case"link":Ve("error",r),Ve("load",r);break;case"details":Ve("toggle",r);break;case"input":Nf(r,l),Ve("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},Ve("invalid",r);break;case"textarea":_f(r,l),Ve("invalid",r)}Dc(n,l),i=null;for(var a in l)if(l.hasOwnProperty(a)){var o=l[a];a==="children"?typeof o=="string"?r.textContent!==o&&(l.suppressHydrationWarning!==!0&&Gl(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(l.suppressHydrationWarning!==!0&&Gl(r.textContent,o,e),i=["children",""+o]):Zs.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Ve("scroll",r)}switch(n){case"input":$l(r),Cf(r,l,!0);break;case"textarea":$l(r),Ef(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=Aa)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=vp(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Un]=t,e[cl]=r,Hg(e,t,!1,!1),t.stateNode=e;e:{switch(a=Ic(n,r),n){case"dialog":Ve("cancel",e),Ve("close",e),i=r;break;case"iframe":case"object":case"embed":Ve("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ms.length;i++)Ve(Ms[i],e);i=r;break;case"source":Ve("error",e),i=r;break;case"img":case"image":case"link":Ve("error",e),Ve("load",e),i=r;break;case"details":Ve("toggle",e),i=r;break;case"input":Nf(e,r),i=Ec(e,r),Ve("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=tt({},r,{value:void 0}),Ve("invalid",e);break;case"textarea":_f(e,r),i=Ac(e,r),Ve("invalid",e);break;default:i=r}Dc(n,i),o=i;for(l in o)if(o.hasOwnProperty(l)){var c=o[l];l==="style"?bp(e,c):l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&kp(e,c)):l==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&el(e,c):typeof c=="number"&&el(e,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Zs.hasOwnProperty(l)?c!=null&&l==="onScroll"&&Ve("scroll",e):c!=null&&$u(e,l,c,a))}switch(n){case"input":$l(e),Cf(e,r,!1);break;case"textarea":$l(e),Ef(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Br(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?Oi(e,!!r.multiple,l,!1):r.defaultValue!=null&&Oi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Aa)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return zt(t),null;case 6:if(e&&t.stateNode!=null)Wg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(W(166));if(n=ei(dl.current),ei(Hn.current),ql(t)){if(r=t.stateNode,n=t.memoizedProps,r[Un]=t,(l=r.nodeValue!==n)&&(e=sn,e!==null))switch(e.tag){case 3:Gl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Gl(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Un]=t,t.stateNode=r}return zt(t),null;case 13:if(We(Je),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ye&&rn!==null&&t.mode&1&&!(t.flags&128))cg(),Ji(),t.flags|=98560,l=!1;else if(l=ql(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(W(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(W(317));l[Un]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zt(t),l=!1}else Tn!==null&&(hu(Tn),Tn=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Je.current&1?ht===0&&(ht=3):kd())),t.updateQueue!==null&&(t.flags|=4),zt(t),null);case 4:return es(),lu(e,t),e===null&&al(t.stateNode.containerInfo),zt(t),null;case 10:return rd(t.type._context),zt(t),null;case 17:return Kt(t.type)&&La(),zt(t),null;case 19:if(We(Je),l=t.memoizedState,l===null)return zt(t),null;if(r=(t.flags&128)!==0,a=l.rendering,a===null)if(r)Es(l,!1);else{if(ht!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Fa(e),a!==null){for(t.flags|=128,Es(l,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,a=l.alternate,a===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=a.childLanes,l.lanes=a.lanes,l.child=a.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=a.memoizedProps,l.memoizedState=a.memoizedState,l.updateQueue=a.updateQueue,l.type=a.type,e=a.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return He(Je,Je.current&1|2),t.child}e=e.sibling}l.tail!==null&&st()>ns&&(t.flags|=128,r=!0,Es(l,!1),t.lanes=4194304)}else{if(!r)if(e=Fa(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Es(l,!0),l.tail===null&&l.tailMode==="hidden"&&!a.alternate&&!Ye)return zt(t),null}else 2*st()-l.renderingStartTime>ns&&n!==1073741824&&(t.flags|=128,r=!0,Es(l,!1),t.lanes=4194304);l.isBackwards?(a.sibling=t.child,t.child=a):(n=l.last,n!==null?n.sibling=a:t.child=a,l.last=a)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=st(),t.sibling=null,n=Je.current,He(Je,r?n&1|2:n&1),t):(zt(t),null);case 22:case 23:return vd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?nn&1073741824&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function _k(e,t){switch(Zu(t),t.tag){case 1:return Kt(t.type)&&La(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return es(),We(Qt),We(Dt),od(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ad(t),null;case 13:if(We(Je),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return We(Je),null;case 4:return es(),null;case 10:return rd(t.type._context),null;case 22:case 23:return vd(),null;case 24:return null;default:return null}}var Yl=!1,At=!1,Ek=typeof WeakSet=="function"?WeakSet:Set,ne=null;function Ri(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){rt(e,t,r)}else n.current=null}function au(e,t,n){try{n()}catch(r){rt(e,t,r)}}var ym=!1;function Tk(e,t){if(Vc=Ea,e=Yp(),Xu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var a=0,o=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(o=a+i),f!==l||r!==0&&f.nodeType!==3||(c=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===i&&(o=a),h===l&&++d===r&&(c=a),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wc={focusedElem:e,selectionRange:n},Ea=!1,ne=t;ne!==null;)if(t=ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ne=e;else for(;ne!==null;){t=ne;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var k=g.memoizedProps,v=g.memoizedState,y=t.stateNode,w=y.getSnapshotBeforeUpdate(t.elementType===t.type?k:_n(t.type,k),v);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var j=t.stateNode.containerInfo;j.nodeType===1?j.textContent="":j.nodeType===9&&j.documentElement&&j.removeChild(j.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(z){rt(t,t.return,z)}if(e=t.sibling,e!==null){e.return=t.return,ne=e;break}ne=t.return}return g=ym,ym=!1,g}function Vs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var l=i.destroy;i.destroy=void 0,l!==void 0&&au(t,n,l)}i=i.next}while(i!==r)}}function po(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ou(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Gg(e){var t=e.alternate;t!==null&&(e.alternate=null,Gg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Un],delete t[cl],delete t[Qc],delete t[dk],delete t[fk])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function qg(e){return e.tag===5||e.tag===3||e.tag===4}function xm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Aa));else if(r!==4&&(e=e.child,e!==null))for(cu(e,t,n),e=e.sibling;e!==null;)cu(e,t,n),e=e.sibling}function uu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(uu(e,t,n),e=e.sibling;e!==null;)uu(e,t,n),e=e.sibling}var Nt=null,En=!1;function jr(e,t,n){for(n=n.child;n!==null;)Qg(e,t,n),n=n.sibling}function Qg(e,t,n){if(Bn&&typeof Bn.onCommitFiberUnmount=="function")try{Bn.onCommitFiberUnmount(lo,n)}catch{}switch(n.tag){case 5:At||Ri(n,t);case 6:var r=Nt,i=En;Nt=null,jr(e,t,n),Nt=r,En=i,Nt!==null&&(En?(e=Nt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nt.removeChild(n.stateNode));break;case 18:Nt!==null&&(En?(e=Nt,n=n.stateNode,e.nodeType===8?Qo(e.parentNode,n):e.nodeType===1&&Qo(e,n),il(e)):Qo(Nt,n.stateNode));break;case 4:r=Nt,i=En,Nt=n.stateNode.containerInfo,En=!0,jr(e,t,n),Nt=r,En=i;break;case 0:case 11:case 14:case 15:if(!At&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,a=l.destroy;l=l.tag,a!==void 0&&(l&2||l&4)&&au(n,t,a),i=i.next}while(i!==r)}jr(e,t,n);break;case 1:if(!At&&(Ri(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){rt(n,t,o)}jr(e,t,n);break;case 21:jr(e,t,n);break;case 22:n.mode&1?(At=(r=At)||n.memoizedState!==null,jr(e,t,n),At=r):jr(e,t,n);break;default:jr(e,t,n)}}function vm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ek),t.forEach(function(r){var i=$k.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Sn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var l=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:Nt=o.stateNode,En=!1;break e;case 3:Nt=o.stateNode.containerInfo,En=!0;break e;case 4:Nt=o.stateNode.containerInfo,En=!0;break e}o=o.return}if(Nt===null)throw Error(W(160));Qg(l,a,i),Nt=null,En=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){rt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Kg(t,e),t=t.sibling}function Kg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Sn(t,e),$n(e),r&4){try{Vs(3,e,e.return),po(3,e)}catch(k){rt(e,e.return,k)}try{Vs(5,e,e.return)}catch(k){rt(e,e.return,k)}}break;case 1:Sn(t,e),$n(e),r&512&&n!==null&&Ri(n,n.return);break;case 5:if(Sn(t,e),$n(e),r&512&&n!==null&&Ri(n,n.return),e.flags&32){var i=e.stateNode;try{el(i,"")}catch(k){rt(e,e.return,k)}}if(r&4&&(i=e.stateNode,i!=null)){var l=e.memoizedProps,a=n!==null?n.memoizedProps:l,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&l.type==="radio"&&l.name!=null&&yp(i,l),Ic(o,a);var u=Ic(o,l);for(a=0;a<c.length;a+=2){var d=c[a],f=c[a+1];d==="style"?bp(i,f):d==="dangerouslySetInnerHTML"?kp(i,f):d==="children"?el(i,f):$u(i,d,f,u)}switch(o){case"input":Tc(i,l);break;case"textarea":xp(i,l);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!l.multiple;var m=l.value;m!=null?Oi(i,!!l.multiple,m,!1):h!==!!l.multiple&&(l.defaultValue!=null?Oi(i,!!l.multiple,l.defaultValue,!0):Oi(i,!!l.multiple,l.multiple?[]:"",!1))}i[cl]=l}catch(k){rt(e,e.return,k)}}break;case 6:if(Sn(t,e),$n(e),r&4){if(e.stateNode===null)throw Error(W(162));i=e.stateNode,l=e.memoizedProps;try{i.nodeValue=l}catch(k){rt(e,e.return,k)}}break;case 3:if(Sn(t,e),$n(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{il(t.containerInfo)}catch(k){rt(e,e.return,k)}break;case 4:Sn(t,e),$n(e);break;case 13:Sn(t,e),$n(e),i=e.child,i.flags&8192&&(l=i.memoizedState!==null,i.stateNode.isHidden=l,!l||i.alternate!==null&&i.alternate.memoizedState!==null||(yd=st())),r&4&&vm(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(At=(u=At)||d,Sn(t,e),At=u):Sn(t,e),$n(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ne=e,d=e.child;d!==null;){for(f=ne=d;ne!==null;){switch(h=ne,m=h.child,h.tag){case 0:case 11:case 14:case 15:Vs(4,h,h.return);break;case 1:Ri(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(k){rt(r,n,k)}}break;case 5:Ri(h,h.return);break;case 22:if(h.memoizedState!==null){wm(f);continue}}m!==null?(m.return=h,ne=m):wm(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,u?(l=i.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(o=f.stateNode,c=f.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=wp("display",a))}catch(k){rt(e,e.return,k)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(k){rt(e,e.return,k)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Sn(t,e),$n(e),r&4&&vm(e);break;case 21:break;default:Sn(t,e),$n(e)}}function $n(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(qg(n)){var r=n;break e}n=n.return}throw Error(W(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(el(i,""),r.flags&=-33);var l=xm(e);uu(e,l,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=xm(e);cu(e,o,a);break;default:throw Error(W(161))}}catch(c){rt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zk(e,t,n){ne=e,Yg(e)}function Yg(e,t,n){for(var r=(e.mode&1)!==0;ne!==null;){var i=ne,l=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||Yl;if(!a){var o=i.alternate,c=o!==null&&o.memoizedState!==null||At;o=Yl;var u=At;if(Yl=a,(At=c)&&!u)for(ne=i;ne!==null;)a=ne,c=a.child,a.tag===22&&a.memoizedState!==null?bm(i):c!==null?(c.return=a,ne=c):bm(i);for(;l!==null;)ne=l,Yg(l),l=l.sibling;ne=i,Yl=o,At=u}km(e)}else i.subtreeFlags&8772&&l!==null?(l.return=i,ne=l):km(e)}}function km(e){for(;ne!==null;){var t=ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:At||po(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!At)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:_n(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&im(t,l,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}im(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&il(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(W(163))}At||t.flags&512&&ou(t)}catch(h){rt(t,t.return,h)}}if(t===e){ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,ne=n;break}ne=t.return}}function wm(e){for(;ne!==null;){var t=ne;if(t===e){ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ne=n;break}ne=t.return}}function bm(e){for(;ne!==null;){var t=ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{po(4,t)}catch(c){rt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){rt(t,i,c)}}var l=t.return;try{ou(t)}catch(c){rt(t,l,c)}break;case 5:var a=t.return;try{ou(t)}catch(c){rt(t,a,c)}}}catch(c){rt(t,t.return,c)}if(t===e){ne=null;break}var o=t.sibling;if(o!==null){o.return=t.return,ne=o;break}ne=t.return}}var Ak=Math.ceil,Ba=lr.ReactCurrentDispatcher,pd=lr.ReactCurrentOwner,gn=lr.ReactCurrentBatchConfig,Ie=0,kt=null,ut=null,Ct=0,nn=0,$i=Wr(0),ht=0,pl=null,ai=0,go=0,gd=0,Ws=null,Gt=null,yd=0,ns=1/0,Kn=null,Ha=!1,du=null,Fr=null,Xl=!1,Dr=null,Va=0,Gs=0,fu=null,ga=-1,ya=0;function Ot(){return Ie&6?st():ga!==-1?ga:ga=st()}function Or(e){return e.mode&1?Ie&2&&Ct!==0?Ct&-Ct:hk.transition!==null?(ya===0&&(ya=Ip()),ya):(e=$e,e!==0||(e=window.event,e=e===void 0?16:Up(e.type)),e):1}function Dn(e,t,n,r){if(50<Gs)throw Gs=0,fu=null,Error(W(185));wl(e,n,r),(!(Ie&2)||e!==kt)&&(e===kt&&(!(Ie&2)&&(go|=n),ht===4&&Ar(e,Ct)),Yt(e,r),n===1&&Ie===0&&!(t.mode&1)&&(ns=st()+500,fo&&Gr()))}function Yt(e,t){var n=e.callbackNode;h1(e,t);var r=_a(e,e===kt?Ct:0);if(r===0)n!==null&&Af(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Af(n),t===1)e.tag===0?mk(jm.bind(null,e)):lg(jm.bind(null,e)),ck(function(){!(Ie&6)&&Gr()}),n=null;else{switch(Pp(r)){case 1:n=Hu;break;case 4:n=Lp;break;case 16:n=Ca;break;case 536870912:n=Dp;break;default:n=Ca}n=iy(n,Xg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Xg(e,t){if(ga=-1,ya=0,Ie&6)throw Error(W(327));var n=e.callbackNode;if(Wi()&&e.callbackNode!==n)return null;var r=_a(e,e===kt?Ct:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Wa(e,r);else{t=r;var i=Ie;Ie|=2;var l=Zg();(kt!==e||Ct!==t)&&(Kn=null,ns=st()+500,ni(e,t));do try{Ik();break}catch(o){Jg(e,o)}while(!0);nd(),Ba.current=l,Ie=i,ut!==null?t=0:(kt=null,Ct=0,t=ht)}if(t!==0){if(t===2&&(i=Fc(e),i!==0&&(r=i,t=mu(e,i))),t===1)throw n=pl,ni(e,0),Ar(e,r),Yt(e,st()),n;if(t===6)Ar(e,r);else{if(i=e.current.alternate,!(r&30)&&!Lk(i)&&(t=Wa(e,r),t===2&&(l=Fc(e),l!==0&&(r=l,t=mu(e,l))),t===1))throw n=pl,ni(e,0),Ar(e,r),Yt(e,st()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(W(345));case 2:Yr(e,Gt,Kn);break;case 3:if(Ar(e,r),(r&130023424)===r&&(t=yd+500-st(),10<t)){if(_a(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Ot(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=qc(Yr.bind(null,e,Gt,Kn),t);break}Yr(e,Gt,Kn);break;case 4:if(Ar(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-Ln(r);l=1<<a,a=t[a],a>i&&(i=a),r&=~l}if(r=i,r=st()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ak(r/1960))-r,10<r){e.timeoutHandle=qc(Yr.bind(null,e,Gt,Kn),r);break}Yr(e,Gt,Kn);break;case 5:Yr(e,Gt,Kn);break;default:throw Error(W(329))}}}return Yt(e,st()),e.callbackNode===n?Xg.bind(null,e):null}function mu(e,t){var n=Ws;return e.current.memoizedState.isDehydrated&&(ni(e,t).flags|=256),e=Wa(e,t),e!==2&&(t=Gt,Gt=n,t!==null&&hu(t)),e}function hu(e){Gt===null?Gt=e:Gt.push.apply(Gt,e)}function Lk(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],l=i.getSnapshot;i=i.value;try{if(!Pn(l(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ar(e,t){for(t&=~gd,t&=~go,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ln(t),r=1<<n;e[n]=-1,t&=~r}}function jm(e){if(Ie&6)throw Error(W(327));Wi();var t=_a(e,0);if(!(t&1))return Yt(e,st()),null;var n=Wa(e,t);if(e.tag!==0&&n===2){var r=Fc(e);r!==0&&(t=r,n=mu(e,r))}if(n===1)throw n=pl,ni(e,0),Ar(e,t),Yt(e,st()),n;if(n===6)throw Error(W(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Yr(e,Gt,Kn),Yt(e,st()),null}function xd(e,t){var n=Ie;Ie|=1;try{return e(t)}finally{Ie=n,Ie===0&&(ns=st()+500,fo&&Gr())}}function oi(e){Dr!==null&&Dr.tag===0&&!(Ie&6)&&Wi();var t=Ie;Ie|=1;var n=gn.transition,r=$e;try{if(gn.transition=null,$e=1,e)return e()}finally{$e=r,gn.transition=n,Ie=t,!(Ie&6)&&Gr()}}function vd(){nn=$i.current,We($i)}function ni(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ok(n)),ut!==null)for(n=ut.return;n!==null;){var r=n;switch(Zu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&La();break;case 3:es(),We(Qt),We(Dt),od();break;case 5:ad(r);break;case 4:es();break;case 13:We(Je);break;case 19:We(Je);break;case 10:rd(r.type._context);break;case 22:case 23:vd()}n=n.return}if(kt=e,ut=e=Ur(e.current,null),Ct=nn=t,ht=0,pl=null,gd=go=ai=0,Gt=Ws=null,Zr!==null){for(t=0;t<Zr.length;t++)if(n=Zr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,l=n.pending;if(l!==null){var a=l.next;l.next=i,r.next=a}n.pending=r}Zr=null}return e}function Jg(e,t){do{var n=ut;try{if(nd(),ma.current=Ua,Oa){for(var r=et.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Oa=!1}if(li=0,vt=ft=et=null,Hs=!1,fl=0,pd.current=null,n===null||n.return===null){ht=1,pl=t,ut=null;break}e:{var l=e,a=n.return,o=n,c=t;if(t=Ct,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=o,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=um(a);if(m!==null){m.flags&=-257,dm(m,a,o,l,t),m.mode&1&&cm(l,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var k=new Set;k.add(c),t.updateQueue=k}else g.add(c);break e}else{if(!(t&1)){cm(l,u,t),kd();break e}c=Error(W(426))}}else if(Ye&&o.mode&1){var v=um(a);if(v!==null){!(v.flags&65536)&&(v.flags|=256),dm(v,a,o,l,t),ed(ts(c,o));break e}}l=c=ts(c,o),ht!==4&&(ht=2),Ws===null?Ws=[l]:Ws.push(l),l=a;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var y=Pg(l,c,t);rm(l,y);break e;case 1:o=c;var w=l.type,j=l.stateNode;if(!(l.flags&128)&&(typeof w.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(Fr===null||!Fr.has(j)))){l.flags|=65536,t&=-t,l.lanes|=t;var z=Mg(l,o,t);rm(l,z);break e}}l=l.return}while(l!==null)}ty(n)}catch(D){t=D,ut===n&&n!==null&&(ut=n=n.return);continue}break}while(!0)}function Zg(){var e=Ba.current;return Ba.current=Ua,e===null?Ua:e}function kd(){(ht===0||ht===3||ht===2)&&(ht=4),kt===null||!(ai&268435455)&&!(go&268435455)||Ar(kt,Ct)}function Wa(e,t){var n=Ie;Ie|=2;var r=Zg();(kt!==e||Ct!==t)&&(Kn=null,ni(e,t));do try{Dk();break}catch(i){Jg(e,i)}while(!0);if(nd(),Ie=n,Ba.current=r,ut!==null)throw Error(W(261));return kt=null,Ct=0,ht}function Dk(){for(;ut!==null;)ey(ut)}function Ik(){for(;ut!==null&&!s1();)ey(ut)}function ey(e){var t=ry(e.alternate,e,nn);e.memoizedProps=e.pendingProps,t===null?ty(e):ut=t,pd.current=null}function ty(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=_k(n,t),n!==null){n.flags&=32767,ut=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ht=6,ut=null;return}}else if(n=Ck(n,t,nn),n!==null){ut=n;return}if(t=t.sibling,t!==null){ut=t;return}ut=t=e}while(t!==null);ht===0&&(ht=5)}function Yr(e,t,n){var r=$e,i=gn.transition;try{gn.transition=null,$e=1,Pk(e,t,n,r)}finally{gn.transition=i,$e=r}return null}function Pk(e,t,n,r){do Wi();while(Dr!==null);if(Ie&6)throw Error(W(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(W(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(p1(e,l),e===kt&&(ut=kt=null,Ct=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Xl||(Xl=!0,iy(Ca,function(){return Wi(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=gn.transition,gn.transition=null;var a=$e;$e=1;var o=Ie;Ie|=4,pd.current=null,Tk(e,n),Kg(n,e),tk(Wc),Ea=!!Vc,Wc=Vc=null,e.current=n,zk(n),l1(),Ie=o,$e=a,gn.transition=l}else e.current=n;if(Xl&&(Xl=!1,Dr=e,Va=i),l=e.pendingLanes,l===0&&(Fr=null),c1(n.stateNode),Yt(e,st()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ha)throw Ha=!1,e=du,du=null,e;return Va&1&&e.tag!==0&&Wi(),l=e.pendingLanes,l&1?e===fu?Gs++:(Gs=0,fu=e):Gs=0,Gr(),null}function Wi(){if(Dr!==null){var e=Pp(Va),t=gn.transition,n=$e;try{if(gn.transition=null,$e=16>e?16:e,Dr===null)var r=!1;else{if(e=Dr,Dr=null,Va=0,Ie&6)throw Error(W(331));var i=Ie;for(Ie|=4,ne=e.current;ne!==null;){var l=ne,a=l.child;if(ne.flags&16){var o=l.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(ne=u;ne!==null;){var d=ne;switch(d.tag){case 0:case 11:case 15:Vs(8,d,l)}var f=d.child;if(f!==null)f.return=d,ne=f;else for(;ne!==null;){d=ne;var h=d.sibling,m=d.return;if(Gg(d),d===u){ne=null;break}if(h!==null){h.return=m,ne=h;break}ne=m}}}var g=l.alternate;if(g!==null){var k=g.child;if(k!==null){g.child=null;do{var v=k.sibling;k.sibling=null,k=v}while(k!==null)}}ne=l}}if(l.subtreeFlags&2064&&a!==null)a.return=l,ne=a;else e:for(;ne!==null;){if(l=ne,l.flags&2048)switch(l.tag){case 0:case 11:case 15:Vs(9,l,l.return)}var y=l.sibling;if(y!==null){y.return=l.return,ne=y;break e}ne=l.return}}var w=e.current;for(ne=w;ne!==null;){a=ne;var j=a.child;if(a.subtreeFlags&2064&&j!==null)j.return=a,ne=j;else e:for(a=w;ne!==null;){if(o=ne,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:po(9,o)}}catch(D){rt(o,o.return,D)}if(o===a){ne=null;break e}var z=o.sibling;if(z!==null){z.return=o.return,ne=z;break e}ne=o.return}}if(Ie=i,Gr(),Bn&&typeof Bn.onPostCommitFiberRoot=="function")try{Bn.onPostCommitFiberRoot(lo,e)}catch{}r=!0}return r}finally{$e=n,gn.transition=t}}return!1}function Sm(e,t,n){t=ts(n,t),t=Pg(e,t,1),e=$r(e,t,1),t=Ot(),e!==null&&(wl(e,1,t),Yt(e,t))}function rt(e,t,n){if(e.tag===3)Sm(e,e,n);else for(;t!==null;){if(t.tag===3){Sm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fr===null||!Fr.has(r))){e=ts(n,e),e=Mg(t,e,1),t=$r(t,e,1),e=Ot(),t!==null&&(wl(t,1,e),Yt(t,e));break}}t=t.return}}function Mk(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ot(),e.pingedLanes|=e.suspendedLanes&n,kt===e&&(Ct&n)===n&&(ht===4||ht===3&&(Ct&130023424)===Ct&&500>st()-yd?ni(e,0):gd|=n),Yt(e,t)}function ny(e,t){t===0&&(e.mode&1?(t=Ul,Ul<<=1,!(Ul&130023424)&&(Ul=4194304)):t=1);var n=Ot();e=ir(e,t),e!==null&&(wl(e,t,n),Yt(e,n))}function Rk(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ny(e,n)}function $k(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(W(314))}r!==null&&r.delete(t),ny(e,n)}var ry;ry=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qt.current)qt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qt=!1,Nk(e,t,n);qt=!!(e.flags&131072)}else qt=!1,Ye&&t.flags&1048576&&ag(t,Pa,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;pa(e,t),e=t.pendingProps;var i=Xi(t,Dt.current);Vi(t,n),i=ud(null,t,r,e,i,n);var l=dd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Kt(r)?(l=!0,Da(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,sd(t),i.updater=ho,t.stateNode=i,i._reactInternals=t,eu(t,r,e,n),t=ru(null,t,r,!0,l,n)):(t.tag=0,Ye&&l&&Ju(t),$t(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(pa(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Ok(r),e=_n(r,e),i){case 0:t=nu(null,t,r,e,n);break e;case 1:t=hm(null,t,r,e,n);break e;case 11:t=fm(null,t,r,e,n);break e;case 14:t=mm(null,t,r,_n(r.type,e),n);break e}throw Error(W(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:_n(r,i),nu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:_n(r,i),hm(e,t,r,i,n);case 3:e:{if(Og(t),e===null)throw Error(W(387));r=t.pendingProps,l=t.memoizedState,i=l.element,mg(e,t),$a(t,r,null,n);var a=t.memoizedState;if(r=a.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=ts(Error(W(423)),t),t=pm(e,t,r,n,i);break e}else if(r!==i){i=ts(Error(W(424)),t),t=pm(e,t,r,n,i);break e}else for(rn=Rr(t.stateNode.containerInfo.firstChild),sn=t,Ye=!0,Tn=null,n=dg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ji(),r===i){t=sr(e,t,n);break e}$t(e,t,r,n)}t=t.child}return t;case 5:return hg(t),e===null&&Xc(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,a=i.children,Gc(r,i)?a=null:l!==null&&Gc(r,l)&&(t.flags|=32),Fg(e,t),$t(e,t,a,n),t.child;case 6:return e===null&&Xc(t),null;case 13:return Ug(e,t,n);case 4:return ld(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zi(t,null,r,n):$t(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:_n(r,i),fm(e,t,r,i,n);case 7:return $t(e,t,t.pendingProps,n),t.child;case 8:return $t(e,t,t.pendingProps.children,n),t.child;case 12:return $t(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,l=t.memoizedProps,a=i.value,He(Ma,r._currentValue),r._currentValue=a,l!==null)if(Pn(l.value,a)){if(l.children===i.children&&!Qt.current){t=sr(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var o=l.dependencies;if(o!==null){a=l.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(l.tag===1){c=tr(-1,n&-n),c.tag=2;var u=l.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}l.lanes|=n,c=l.alternate,c!==null&&(c.lanes|=n),Jc(l.return,n,t),o.lanes|=n;break}c=c.next}}else if(l.tag===10)a=l.type===t.type?null:l.child;else if(l.tag===18){if(a=l.return,a===null)throw Error(W(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Jc(a,n,t),a=l.sibling}else a=l.child;if(a!==null)a.return=l;else for(a=l;a!==null;){if(a===t){a=null;break}if(l=a.sibling,l!==null){l.return=a.return,a=l;break}a=a.return}l=a}$t(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Vi(t,n),i=yn(i),r=r(i),t.flags|=1,$t(e,t,r,n),t.child;case 14:return r=t.type,i=_n(r,t.pendingProps),i=_n(r.type,i),mm(e,t,r,i,n);case 15:return Rg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:_n(r,i),pa(e,t),t.tag=1,Kt(r)?(e=!0,Da(t)):e=!1,Vi(t,n),Ig(t,r,i),eu(t,r,i,n),ru(null,t,r,!0,e,n);case 19:return Bg(e,t,n);case 22:return $g(e,t,n)}throw Error(W(156,t.tag))};function iy(e,t){return Ap(e,t)}function Fk(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pn(e,t,n,r){return new Fk(e,t,n,r)}function wd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ok(e){if(typeof e=="function")return wd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ou)return 11;if(e===Uu)return 14}return 2}function Ur(e,t){var n=e.alternate;return n===null?(n=pn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function xa(e,t,n,r,i,l){var a=2;if(r=e,typeof e=="function")wd(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ei:return ri(n.children,i,l,t);case Fu:a=8,i|=8;break;case Sc:return e=pn(12,n,t,i|2),e.elementType=Sc,e.lanes=l,e;case Nc:return e=pn(13,n,t,i),e.elementType=Nc,e.lanes=l,e;case Cc:return e=pn(19,n,t,i),e.elementType=Cc,e.lanes=l,e;case hp:return yo(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fp:a=10;break e;case mp:a=9;break e;case Ou:a=11;break e;case Uu:a=14;break e;case Er:a=16,r=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=pn(a,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function ri(e,t,n,r){return e=pn(7,e,r,t),e.lanes=n,e}function yo(e,t,n,r){return e=pn(22,e,r,t),e.elementType=hp,e.lanes=n,e.stateNode={isHidden:!1},e}function nc(e,t,n){return e=pn(6,e,null,t),e.lanes=n,e}function rc(e,t,n){return t=pn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Uk(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ro(0),this.expirationTimes=Ro(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ro(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function bd(e,t,n,r,i,l,a,o,c){return e=new Uk(e,t,n,o,c),t===1?(t=1,l===!0&&(t|=8)):t=0,l=pn(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},sd(l),e}function Bk(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_i,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function sy(e){if(!e)return Hr;e=e._reactInternals;e:{if(pi(e)!==e||e.tag!==1)throw Error(W(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Kt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(W(171))}if(e.tag===1){var n=e.type;if(Kt(n))return sg(e,n,t)}return t}function ly(e,t,n,r,i,l,a,o,c){return e=bd(n,r,!0,e,i,l,a,o,c),e.context=sy(null),n=e.current,r=Ot(),i=Or(n),l=tr(r,i),l.callback=t??null,$r(n,l,i),e.current.lanes=i,wl(e,i,r),Yt(e,r),e}function xo(e,t,n,r){var i=t.current,l=Ot(),a=Or(i);return n=sy(n),t.context===null?t.context=n:t.pendingContext=n,t=tr(l,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=$r(i,t,a),e!==null&&(Dn(e,i,a,l),fa(e,i,a)),a}function Ga(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Nm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function jd(e,t){Nm(e,t),(e=e.alternate)&&Nm(e,t)}function Hk(){return null}var ay=typeof reportError=="function"?reportError:function(e){console.error(e)};function Sd(e){this._internalRoot=e}vo.prototype.render=Sd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));xo(e,t,null,null)};vo.prototype.unmount=Sd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;oi(function(){xo(null,e,null,null)}),t[rr]=null}};function vo(e){this._internalRoot=e}vo.prototype.unstable_scheduleHydration=function(e){if(e){var t=$p();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zr.length&&t!==0&&t<zr[n].priority;n++);zr.splice(n,0,e),n===0&&Op(e)}};function Nd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ko(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Cm(){}function Vk(e,t,n,r,i){if(i){if(typeof r=="function"){var l=r;r=function(){var u=Ga(a);l.call(u)}}var a=ly(t,r,e,0,null,!1,!1,"",Cm);return e._reactRootContainer=a,e[rr]=a.current,al(e.nodeType===8?e.parentNode:e),oi(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var u=Ga(c);o.call(u)}}var c=bd(e,0,!1,null,null,!1,!1,"",Cm);return e._reactRootContainer=c,e[rr]=c.current,al(e.nodeType===8?e.parentNode:e),oi(function(){xo(t,c,n,r)}),c}function wo(e,t,n,r,i){var l=n._reactRootContainer;if(l){var a=l;if(typeof i=="function"){var o=i;i=function(){var c=Ga(a);o.call(c)}}xo(t,a,e,i)}else a=Vk(n,t,e,i,r);return Ga(a)}Mp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ps(t.pendingLanes);n!==0&&(Vu(t,n|1),Yt(t,st()),!(Ie&6)&&(ns=st()+500,Gr()))}break;case 13:oi(function(){var r=ir(e,1);if(r!==null){var i=Ot();Dn(r,e,1,i)}}),jd(e,1)}};Wu=function(e){if(e.tag===13){var t=ir(e,134217728);if(t!==null){var n=Ot();Dn(t,e,134217728,n)}jd(e,134217728)}};Rp=function(e){if(e.tag===13){var t=Or(e),n=ir(e,t);if(n!==null){var r=Ot();Dn(n,e,t,r)}jd(e,t)}};$p=function(){return $e};Fp=function(e,t){var n=$e;try{return $e=e,t()}finally{$e=n}};Mc=function(e,t,n){switch(t){case"input":if(Tc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=uo(r);if(!i)throw Error(W(90));gp(r),Tc(r,i)}}}break;case"textarea":xp(e,n);break;case"select":t=n.value,t!=null&&Oi(e,!!n.multiple,t,!1)}};Np=xd;Cp=oi;var Wk={usingClientEntryPoint:!1,Events:[jl,Li,uo,jp,Sp,xd]},Ts={findFiberByHostInstance:Jr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Gk={bundleType:Ts.bundleType,version:Ts.version,rendererPackageName:Ts.rendererPackageName,rendererConfig:Ts.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:lr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Tp(e),e===null?null:e.stateNode},findFiberByHostInstance:Ts.findFiberByHostInstance||Hk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jl.isDisabled&&Jl.supportsFiber)try{lo=Jl.inject(Gk),Bn=Jl}catch{}}cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Wk;cn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Nd(t))throw Error(W(200));return Bk(e,t,null,n)};cn.createRoot=function(e,t){if(!Nd(e))throw Error(W(299));var n=!1,r="",i=ay;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=bd(e,1,!1,null,null,n,!1,r,i),e[rr]=t.current,al(e.nodeType===8?e.parentNode:e),new Sd(t)};cn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(W(188)):(e=Object.keys(e).join(","),Error(W(268,e)));return e=Tp(t),e=e===null?null:e.stateNode,e};cn.flushSync=function(e){return oi(e)};cn.hydrate=function(e,t,n){if(!ko(t))throw Error(W(200));return wo(null,e,t,!0,n)};cn.hydrateRoot=function(e,t,n){if(!Nd(e))throw Error(W(405));var r=n!=null&&n.hydratedSources||null,i=!1,l="",a=ay;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=ly(t,null,e,1,n??null,i,!1,l,a),e[rr]=t.current,al(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new vo(t)};cn.render=function(e,t,n){if(!ko(t))throw Error(W(200));return wo(null,e,t,!1,n)};cn.unmountComponentAtNode=function(e){if(!ko(e))throw Error(W(40));return e._reactRootContainer?(oi(function(){wo(null,null,e,!1,function(){e._reactRootContainer=null,e[rr]=null})}),!0):!1};cn.unstable_batchedUpdates=xd;cn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ko(n))throw Error(W(200));if(e==null||e._reactInternals===void 0)throw Error(W(38));return wo(e,t,n,!1,r)};cn.version="18.3.1-next-f1338f8080-20240426";function oy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oy)}catch(e){console.error(e)}}oy(),op.exports=cn;var qk=op.exports,_m=qk;bc.createRoot=_m.createRoot,bc.hydrateRoot=_m.hydrateRoot;/**
|
|
41
|
+
* @license lucide-react v0.312.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/var Qk={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"};/**
|
|
46
|
+
* @license lucide-react v0.312.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/const Kk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Y=(e,t)=>{const n=p.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:l=2,absoluteStrokeWidth:a,className:o="",children:c,...u},d)=>p.createElement("svg",{ref:d,...Qk,width:i,height:i,stroke:r,strokeWidth:a?Number(l)*24/Number(i):l,className:["lucide",`lucide-${Kk(e)}`,o].join(" "),...u},[...t.map(([f,h])=>p.createElement(f,h)),...Array.isArray(c)?c:[c]]));return n.displayName=`${e}`,n};/**
|
|
51
|
+
* @license lucide-react v0.312.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const pt=Y("AlertCircle",[["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"}]]);/**
|
|
56
|
+
* @license lucide-react v0.312.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const ln=Y("AlertTriangle",[["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-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
61
|
+
* @license lucide-react v0.312.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const cy=Y("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
66
|
+
* @license lucide-react v0.312.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const Em=Y("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
71
|
+
* @license lucide-react v0.312.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const uy=Y("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
76
|
+
* @license lucide-react v0.312.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const Yk=Y("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
81
|
+
* @license lucide-react v0.312.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const Tm=Y("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
86
|
+
* @license lucide-react v0.312.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const dy=Y("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
|
|
91
|
+
* @license lucide-react v0.312.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const bi=Y("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
|
|
96
|
+
* @license lucide-react v0.312.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const qa=Y("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"}]]);/**
|
|
101
|
+
* @license lucide-react v0.312.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const ti=Y("Brain",[["path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z",key:"1mhkh5"}],["path",{d:"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z",key:"1d6s00"}]]);/**
|
|
106
|
+
* @license lucide-react v0.312.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const Xk=Y("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
|
|
111
|
+
* @license lucide-react v0.312.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const Vn=Y("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
116
|
+
* @license lucide-react v0.312.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const ji=Y("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
121
|
+
* @license lucide-react v0.312.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const ci=Y("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
126
|
+
* @license lucide-react v0.312.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const ui=Y("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
131
|
+
* @license lucide-react v0.312.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const Jk=Y("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
136
|
+
* @license lucide-react v0.312.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const us=Y("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
141
|
+
* @license lucide-react v0.312.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const fy=Y("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
146
|
+
* @license lucide-react v0.312.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const Zk=Y("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
151
|
+
* @license lucide-react v0.312.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const Qa=Y("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
156
|
+
* @license lucide-react v0.312.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const ew=Y("Code2",[["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"}]]);/**
|
|
161
|
+
* @license lucide-react v0.312.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const my=Y("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
166
|
+
* @license lucide-react v0.312.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const Nl=Y("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"}]]);/**
|
|
171
|
+
* @license lucide-react v0.312.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const rs=Y("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["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"}]]);/**
|
|
176
|
+
* @license lucide-react v0.312.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const Si=Y("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"}]]);/**
|
|
181
|
+
* @license lucide-react v0.312.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const tw=Y("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
|
|
186
|
+
* @license lucide-react v0.312.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const di=Y("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"}]]);/**
|
|
191
|
+
* @license lucide-react v0.312.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const Gi=Y("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"}]]);/**
|
|
196
|
+
* @license lucide-react v0.312.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const hy=Y("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
|
|
201
|
+
* @license lucide-react v0.312.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const nw=Y("FilePen",[["path",{d:"M12 22h6a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v10",key:"x7tsz2"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10.4 12.6a2 2 0 1 1 3 3L8 21l-4 1 1-4Z",key:"o3xyfb"}]]);/**
|
|
206
|
+
* @license lucide-react v0.312.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const zn=Y("FileText",[["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:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
211
|
+
* @license lucide-react v0.312.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const py=Y("File",[["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"}]]);/**
|
|
216
|
+
* @license lucide-react v0.312.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const er=Y("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
221
|
+
* @license lucide-react v0.312.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const pu=Y("FolderSearch",[["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.5-1.5",key:"3sg1j"}]]);/**
|
|
226
|
+
* @license lucide-react v0.312.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const gy=Y("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
231
|
+
* @license lucide-react v0.312.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const zm=Y("GitMerge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);/**
|
|
236
|
+
* @license lucide-react v0.312.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const Cd=Y("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"}]]);/**
|
|
241
|
+
* @license lucide-react v0.312.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const rw=Y("Hammer",[["path",{d:"m15 12-8.5 8.5c-.83.83-2.17.83-3 0 0 0 0 0 0 0a2.12 2.12 0 0 1 0-3L12 9",key:"1afvon"}],["path",{d:"M17.64 15 22 10.64",key:"zsji6s"}],["path",{d:"m20.91 11.7-1.25-1.25c-.6-.6-.93-1.4-.93-2.25v-.86L16.01 4.6a5.56 5.56 0 0 0-3.94-1.64H9l.92.82A6.18 6.18 0 0 1 12 8.4v1.56l2 2h2.47l2.26 1.91",key:"lehyy1"}]]);/**
|
|
246
|
+
* @license lucide-react v0.312.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const yy=Y("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"}]]);/**
|
|
251
|
+
* @license lucide-react v0.312.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const iw=Y("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/**
|
|
256
|
+
* @license lucide-react v0.312.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const sw=Y("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["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"}]]);/**
|
|
261
|
+
* @license lucide-react v0.312.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const lw=Y("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
266
|
+
* @license lucide-react v0.312.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const aw=Y("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"}]]);/**
|
|
271
|
+
* @license lucide-react v0.312.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const ow=Y("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
276
|
+
* @license lucide-react v0.312.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const xy=Y("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"}]]);/**
|
|
281
|
+
* @license lucide-react v0.312.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const mt=Y("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
286
|
+
* @license lucide-react v0.312.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const cw=Y("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
|
|
291
|
+
* @license lucide-react v0.312.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const vy=Y("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
296
|
+
* @license lucide-react v0.312.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const ky=Y("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"}]]);/**
|
|
301
|
+
* @license lucide-react v0.312.0 - ISC
|
|
302
|
+
*
|
|
303
|
+
* This source code is licensed under the ISC license.
|
|
304
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
+
*/const uw=Y("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
306
|
+
* @license lucide-react v0.312.0 - ISC
|
|
307
|
+
*
|
|
308
|
+
* This source code is licensed under the ISC license.
|
|
309
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
+
*/const dw=Y("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
311
|
+
* @license lucide-react v0.312.0 - ISC
|
|
312
|
+
*
|
|
313
|
+
* This source code is licensed under the ISC license.
|
|
314
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
+
*/const gu=Y("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"}]]);/**
|
|
316
|
+
* @license lucide-react v0.312.0 - ISC
|
|
317
|
+
*
|
|
318
|
+
* This source code is licensed under the ISC license.
|
|
319
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
+
*/const fw=Y("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"}]]);/**
|
|
321
|
+
* @license lucide-react v0.312.0 - ISC
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the ISC license.
|
|
324
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/const mw=Y("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
326
|
+
* @license lucide-react v0.312.0 - ISC
|
|
327
|
+
*
|
|
328
|
+
* This source code is licensed under the ISC license.
|
|
329
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
+
*/const hw=Y("MoreHorizontal",[["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"}]]);/**
|
|
331
|
+
* @license lucide-react v0.312.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/const pw=Y("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"}]]);/**
|
|
336
|
+
* @license lucide-react v0.312.0 - ISC
|
|
337
|
+
*
|
|
338
|
+
* This source code is licensed under the ISC license.
|
|
339
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
+
*/const gw=Y("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
|
|
341
|
+
* @license lucide-react v0.312.0 - ISC
|
|
342
|
+
*
|
|
343
|
+
* This source code is licensed under the ISC license.
|
|
344
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
+
*/const yw=Y("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
|
|
346
|
+
* @license lucide-react v0.312.0 - ISC
|
|
347
|
+
*
|
|
348
|
+
* This source code is licensed under the ISC license.
|
|
349
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
+
*/const xw=Y("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]);/**
|
|
351
|
+
* @license lucide-react v0.312.0 - ISC
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the ISC license.
|
|
354
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/const vw=Y("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
356
|
+
* @license lucide-react v0.312.0 - ISC
|
|
357
|
+
*
|
|
358
|
+
* This source code is licensed under the ISC license.
|
|
359
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
+
*/const kw=Y("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"}]]);/**
|
|
361
|
+
* @license lucide-react v0.312.0 - ISC
|
|
362
|
+
*
|
|
363
|
+
* This source code is licensed under the ISC license.
|
|
364
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
+
*/const gl=Y("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
366
|
+
* @license lucide-react v0.312.0 - ISC
|
|
367
|
+
*
|
|
368
|
+
* This source code is licensed under the ISC license.
|
|
369
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
+
*/const qs=Y("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"}]]);/**
|
|
371
|
+
* @license lucide-react v0.312.0 - ISC
|
|
372
|
+
*
|
|
373
|
+
* This source code is licensed under the ISC license.
|
|
374
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
+
*/const An=Y("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
376
|
+
* @license lucide-react v0.312.0 - ISC
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the ISC license.
|
|
379
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/const ww=Y("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
381
|
+
* @license lucide-react v0.312.0 - ISC
|
|
382
|
+
*
|
|
383
|
+
* This source code is licensed under the ISC license.
|
|
384
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
+
*/const bw=Y("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"}]]);/**
|
|
386
|
+
* @license lucide-react v0.312.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/const Ka=Y("ShieldAlert",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
391
|
+
* @license lucide-react v0.312.0 - ISC
|
|
392
|
+
*
|
|
393
|
+
* This source code is licensed under the ISC license.
|
|
394
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
+
*/const jw=Y("ShieldOff",[["path",{d:"M19.7 14a6.9 6.9 0 0 0 .3-2V5l-8-3-3.2 1.2",key:"342pvf"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M4.7 4.7 4 5v7c0 6 8 10 8 10a20.3 20.3 0 0 0 5.62-4.38",key:"p0ycf4"}]]);/**
|
|
396
|
+
* @license lucide-react v0.312.0 - ISC
|
|
397
|
+
*
|
|
398
|
+
* This source code is licensed under the ISC license.
|
|
399
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
+
*/const Xn=Y("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/**
|
|
401
|
+
* @license lucide-react v0.312.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/const wy=Y("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
|
|
406
|
+
* @license lucide-react v0.312.0 - ISC
|
|
407
|
+
*
|
|
408
|
+
* This source code is licensed under the ISC license.
|
|
409
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
+
*/const Sw=Y("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
|
|
411
|
+
* @license lucide-react v0.312.0 - ISC
|
|
412
|
+
*
|
|
413
|
+
* This source code is licensed under the ISC license.
|
|
414
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
+
*/const Nw=Y("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z",key:"1lpok0"}]]);/**
|
|
416
|
+
* @license lucide-react v0.312.0 - ISC
|
|
417
|
+
*
|
|
418
|
+
* This source code is licensed under the ISC license.
|
|
419
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
+
*/const Cw=Y("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
421
|
+
* @license lucide-react v0.312.0 - ISC
|
|
422
|
+
*
|
|
423
|
+
* This source code is licensed under the ISC license.
|
|
424
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
+
*/const Am=Y("StopCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{width:"6",height:"6",x:"9",y:"9",key:"1wrtvo"}]]);/**
|
|
426
|
+
* @license lucide-react v0.312.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/const _w=Y("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"}]]);/**
|
|
431
|
+
* @license lucide-react v0.312.0 - ISC
|
|
432
|
+
*
|
|
433
|
+
* This source code is licensed under the ISC license.
|
|
434
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
+
*/const by=Y("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
|
|
436
|
+
* @license lucide-react v0.312.0 - ISC
|
|
437
|
+
*
|
|
438
|
+
* This source code is licensed under the ISC license.
|
|
439
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
+
*/const Lm=Y("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"}]]);/**
|
|
441
|
+
* @license lucide-react v0.312.0 - ISC
|
|
442
|
+
*
|
|
443
|
+
* This source code is licensed under the ISC license.
|
|
444
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
+
*/const Ya=Y("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
446
|
+
* @license lucide-react v0.312.0 - ISC
|
|
447
|
+
*
|
|
448
|
+
* This source code is licensed under the ISC license.
|
|
449
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
+
*/const fi=Y("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"}]]);/**
|
|
451
|
+
* @license lucide-react v0.312.0 - ISC
|
|
452
|
+
*
|
|
453
|
+
* This source code is licensed under the ISC license.
|
|
454
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
+
*/const Dm=Y("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
456
|
+
* @license lucide-react v0.312.0 - ISC
|
|
457
|
+
*
|
|
458
|
+
* This source code is licensed under the ISC license.
|
|
459
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
+
*/const yl=Y("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
461
|
+
* @license lucide-react v0.312.0 - ISC
|
|
462
|
+
*
|
|
463
|
+
* This source code is licensed under the ISC license.
|
|
464
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
+
*/const Ew=Y("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
466
|
+
* @license lucide-react v0.312.0 - ISC
|
|
467
|
+
*
|
|
468
|
+
* This source code is licensed under the ISC license.
|
|
469
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
+
*/const Tw=Y("WifiOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 4.17-2.65",key:"11utq1"}],["path",{d:"M10.66 5c4.01-.36 8.14.9 11.34 3.76",key:"hxefdu"}],["path",{d:"M16.85 11.25a10 10 0 0 1 2.22 1.68",key:"q734kn"}],["path",{d:"M5 13a10 10 0 0 1 5.24-2.76",key:"piq4yl"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/**
|
|
471
|
+
* @license lucide-react v0.312.0 - ISC
|
|
472
|
+
*
|
|
473
|
+
* This source code is licensed under the ISC license.
|
|
474
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
+
*/const is=Y("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"}]]);/**
|
|
476
|
+
* @license lucide-react v0.312.0 - ISC
|
|
477
|
+
*
|
|
478
|
+
* This source code is licensed under the ISC license.
|
|
479
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
480
|
+
*/const Ze=Y("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
481
|
+
* @license lucide-react v0.312.0 - ISC
|
|
482
|
+
*
|
|
483
|
+
* This source code is licensed under the ISC license.
|
|
484
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
485
|
+
*/const qi=Y("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),zw={},Im=e=>{let t;const n=new Set,r=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,m))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(zw?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,i,c);return c},Aw=e=>e?Im(e):Im;var jy={exports:{}},Sy={},Ny={exports:{}},Cy={};/**
|
|
486
|
+
* @license React
|
|
487
|
+
* use-sync-external-store-shim.production.js
|
|
488
|
+
*
|
|
489
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
490
|
+
*
|
|
491
|
+
* This source code is licensed under the MIT license found in the
|
|
492
|
+
* LICENSE file in the root directory of this source tree.
|
|
493
|
+
*/var ss=p;function Lw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dw=typeof Object.is=="function"?Object.is:Lw,Iw=ss.useState,Pw=ss.useEffect,Mw=ss.useLayoutEffect,Rw=ss.useDebugValue;function $w(e,t){var n=t(),r=Iw({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return Mw(function(){i.value=n,i.getSnapshot=t,ic(i)&&l({inst:i})},[e,n,t]),Pw(function(){return ic(i)&&l({inst:i}),e(function(){ic(i)&&l({inst:i})})},[e]),Rw(n),n}function ic(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dw(e,n)}catch{return!0}}function Fw(e,t){return t()}var Ow=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Fw:$w;Cy.useSyncExternalStore=ss.useSyncExternalStore!==void 0?ss.useSyncExternalStore:Ow;Ny.exports=Cy;var Uw=Ny.exports;/**
|
|
494
|
+
* @license React
|
|
495
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
496
|
+
*
|
|
497
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
498
|
+
*
|
|
499
|
+
* This source code is licensed under the MIT license found in the
|
|
500
|
+
* LICENSE file in the root directory of this source tree.
|
|
501
|
+
*/var bo=p,Bw=Uw;function Hw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vw=typeof Object.is=="function"?Object.is:Hw,Ww=Bw.useSyncExternalStore,Gw=bo.useRef,qw=bo.useEffect,Qw=bo.useMemo,Kw=bo.useDebugValue;Sy.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var l=Gw(null);if(l.current===null){var a={hasValue:!1,value:null};l.current=a}else a=l.current;l=Qw(function(){function c(m){if(!u){if(u=!0,d=m,m=r(m),i!==void 0&&a.hasValue){var g=a.value;if(i(g,m))return f=g}return f=m}if(g=f,Vw(d,m))return g;var k=r(m);return i!==void 0&&i(g,k)?(d=m,g):(d=m,f=k)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,i]);var o=Ww(e,l[0],l[1]);return qw(function(){a.hasValue=!0,a.value=o},[o]),Kw(o),o};jy.exports=Sy;var Yw=jy.exports;const Xw=io(Yw),_y={},{useDebugValue:Jw}=Ki,{useSyncExternalStoreWithSelector:Zw}=Xw;let Pm=!1;const e0=e=>e;function t0(e,t=e0,n){(_y?"production":void 0)!=="production"&&n&&!Pm&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Pm=!0);const r=Zw(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Jw(r),r}const Mm=e=>{(_y?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Aw(e):e,n=(r,i)=>t0(t,r,i);return Object.assign(n,t),n},Ey=e=>e?Mm(e):Mm,ve=Ey((e,t)=>({agents:[],activeAgentId:(()=>{try{return localStorage.getItem("gaia-active-agent-id")||"chat"}catch{return"chat"}})(),setAgents:n=>e({agents:n}),setActiveAgentId:n=>{try{localStorage.setItem("gaia-active-agent-id",n)}catch{}e({activeAgentId:n})},activeDevice:(()=>{try{return localStorage.getItem("gaia-active-device")||"gpu"}catch{return"gpu"}})(),setActiveDevice:n=>{try{localStorage.setItem("gaia-active-device",n)}catch{}e({activeDevice:n})},detectedDevices:["gpu"],setDetectedDevices:n=>e({detectedDevices:n}),sessions:[],currentSessionId:null,pendingDeleteIds:[],setSessions:n=>e(r=>({sessions:n.filter(i=>!r.pendingDeleteIds.includes(i.id))})),setCurrentSession:n=>e({currentSessionId:n}),addSession:n=>e(r=>({sessions:[n,...r.sessions]})),removeSession:n=>e(r=>({sessions:r.sessions.filter(i=>i.id!==n),currentSessionId:r.currentSessionId===n?null:r.currentSessionId,messages:r.currentSessionId===n?[]:r.messages})),updateSessionInList:(n,r)=>e(i=>({sessions:i.sessions.map(l=>l.id===n?{...l,...r}:l)})),addPendingDelete:n=>e(r=>({pendingDeleteIds:[...r.pendingDeleteIds,n]})),removePendingDelete:n=>e(r=>({pendingDeleteIds:r.pendingDeleteIds.filter(i=>i!==n)})),messages:[],setMessages:n=>e({messages:n}),addMessage:n=>e(r=>({messages:[...r.messages,n]})),removeMessage:n=>e(r=>({messages:r.messages.filter(i=>i.id!==n)})),removeMessagesFrom:n=>e(r=>{const i=r.messages.findIndex(l=>l.id===n);return i===-1?r:{messages:r.messages.slice(0,i)}}),isStreaming:!1,streamingContent:"",setStreaming:n=>e({isStreaming:n}),appendStreamContent:n=>e(r=>({streamingContent:r.streamingContent+n})),setStreamContent:n=>e({streamingContent:n}),clearStreamContent:()=>e({streamingContent:""}),agentSteps:[],addAgentStep:n=>e(r=>({agentSteps:[...r.agentSteps.map(i=>({...i,active:!1})),n]})),updateLastAgentStep:n=>e(r=>{if(r.agentSteps.length===0)return r;const i=[...r.agentSteps];return i[i.length-1]={...i[i.length-1],...n},{agentSteps:i}}),appendThinkingContent:n=>e(r=>{if(r.agentSteps.length===0)return r;const i=[...r.agentSteps],l=i[i.length-1];return l.type!=="thinking"?r:(i[i.length-1]={...l,detail:(l.detail?l.detail+`
|
|
502
|
+
`:"")+n,active:!0},{agentSteps:i})}),updateLastToolStep:n=>e(r=>{if(r.agentSteps.length===0)return r;const i=[...r.agentSteps];for(let l=i.length-1;l>=0;l--)if(i[l].type==="tool")return i[l]={...i[l],...n},{agentSteps:i};return r}),clearAgentSteps:()=>e({agentSteps:[]}),documents:[],setDocuments:n=>e({documents:n}),systemStatus:null,backendConnected:!0,setSystemStatus:n=>e({systemStatus:n}),setBackendConnected:n=>e({backendConnected:n}),theme:(()=>{try{return localStorage.getItem("gaia-chat-theme")||"dark"}catch{return"dark"}})(),showDocLibrary:!1,showFileBrowser:!1,showSettings:!1,showMemoryDashboard:!1,toggleTheme:()=>e(n=>{const r=n.theme==="dark"?"light":"dark";try{localStorage.setItem("gaia-chat-theme",r)}catch{}return document.documentElement.setAttribute("data-theme",r),{theme:r}}),sidebarOpen:typeof window<"u"?window.innerWidth>768:!0,sidebarCollapsed:(()=>{try{return typeof window<"u"&&localStorage.getItem("gaia-chat-sidebar-collapsed")==="true"}catch{return!1}})(),sidebarWidth:(()=>{try{return typeof window<"u"?parseInt(localStorage.getItem("gaia-chat-sidebar-width")||"300",10):300}catch{return 300}})(),isLoadingMessages:!1,pendingPrompt:null,setShowDocLibrary:n=>e({showDocLibrary:n}),setShowFileBrowser:n=>e({showFileBrowser:n}),setShowSettings:n=>e(n?{showSettings:!0,showMemoryDashboard:!1}:{showSettings:!1}),setShowMemoryDashboard:n=>e(n?{showMemoryDashboard:!0,showSettings:!1}:{showMemoryDashboard:!1}),toggleSidebar:()=>e(n=>({sidebarOpen:!n.sidebarOpen})),setSidebarOpen:n=>e({sidebarOpen:n}),toggleSidebarCollapsed:()=>e(n=>{const r=!n.sidebarCollapsed;try{localStorage.setItem("gaia-chat-sidebar-collapsed",String(r))}catch{}return{sidebarCollapsed:r}}),setSidebarCollapsed:n=>{try{localStorage.setItem("gaia-chat-sidebar-collapsed",String(n))}catch{}e({sidebarCollapsed:n})},setSidebarWidth:n=>{const r=Math.max(200,Math.min(500,n));try{localStorage.setItem("gaia-chat-sidebar-width",String(r))}catch{}e({sidebarWidth:r})},setLoadingMessages:n=>e({isLoadingMessages:n}),setPendingPrompt:n=>e({pendingPrompt:n})})),n0=/^https?:\/\/(127\.0\.0\.1|localhost):\d+\/api$/,r0="http://localhost:4200/api";function jo(){if(typeof window>"u")return"/api";if(window.location.protocol==="file:"){const e=new URLSearchParams(window.location.search).get("api");return e&&n0.test(e)?e:r0}return"/api"}const i0={api:"#4fc3f7",store:"#ce93d8",chat:"#81c784",stream:"#ffb74d",ui:"#90a4ae",doc:"#a1887f",system:"#e57373",nav:"#fff176"},s0={api:"fetch",store:"state",chat:"chat",stream:"stream",ui:"ui",doc:"docs",system:"sys",nav:"nav"},va=(()=>{try{if(localStorage.getItem("gaia-debug")==="true")return!0;if(typeof location<"u"){const e=new URLSearchParams(location.search);if(e.has("debug")||e.has("verbose"))return!0}}catch{}return!1})();function zs(){const e=new Date;return e.toLocaleTimeString("en-US",{hour12:!1})+"."+String(e.getMilliseconds()).padStart(3,"0")}function Sr(e){const t=i0[e]||"#ccc",r=`%c[${s0[e]||e}]`,i=`color: ${t}; font-weight: bold;`,l="color: #888; font-weight: normal;";return{info:(a,...o)=>{if(!va)return;const c=zs();o.length>0?console.log(`${r} %c${c} %c${a}`,i,l,"color: inherit;",...o):console.log(`${r} %c${c} %c${a}`,i,l,"color: inherit;")},warn:(a,...o)=>{const c=zs();console.warn(`${r} %c${c} %c${a}`,i,l,"color: inherit;",...o)},error:(a,...o)=>{const c=zs();console.error(`${r} %c${c} %c${a}`,i,l,"color: inherit;",...o)},debug:(a,...o)=>{if(!va)return;const c=zs();console.debug(`${r} %c${c} %c${a}`,i,l,"color: #999;",...o)},timed:(a,o,...c)=>{if(!va)return;const u=Math.round(performance.now()-o),d=zs(),f=u>2e3?"color: #e57373;":u>500?"color: #ffb74d;":"color: #81c784;";c.length>0?console.log(`${r} %c${d} %c${a} %c(${u}ms)`,i,l,"color: inherit;",f,...c):console.log(`${r} %c${d} %c${a} %c(${u}ms)`,i,l,"color: inherit;",f)},time:()=>performance.now()}}const E={api:Sr("api"),store:Sr("store"),chat:Sr("chat"),stream:Sr("stream"),ui:Sr("ui"),doc:Sr("doc"),system:Sr("system"),nav:Sr("nav")};function l0(e){console.log("%c GAIA %c v"+e+" %c Local AI Desktop","background: #E23C40; color: white; font-weight: bold; padding: 4px 8px; border-radius: 4px 0 0 4px;","background: #333; color: #fff; padding: 4px 8px;","background: #1a1a1a; color: #888; padding: 4px 8px; border-radius: 0 4px 4px 0;"),console.log(va?"%cVerbose logging enabled. Categories: [fetch] [state] [chat] [stream] [ui] [docs] [sys] [nav]":'%cVerbose logging: add ?debug to URL or run localStorage.setItem("gaia-debug","true")',"color: #666; font-style: italic;")}const So=jo();function Ty(e,t){switch(e){case 403:return t||"Access denied.";case 404:return t||"The requested item was not found.";case 413:return t||"File too large to process.";case 500:return"Server error. Please try again.";case 502:return"Service unavailable. Is the backend running?";case 503:return t||"Service unavailable.";default:return t||`Request failed (HTTP ${e})`}}async function he(e,t,n,r){const i=`${So}${t}`,l=E.api.time();E.api.info(`${e} ${i}`,n!==void 0?{body:n}:"");const o={method:e,headers:{...r,...n!==void 0?{"Content-Type":"application/json"}:{}},body:n!==void 0?JSON.stringify(n):void 0};let c;try{c=await fetch(i,o)}catch(f){throw E.api.error(`${e} ${i} - network error`,f),f}if(!c.ok){const f=await c.text().catch(()=>"");E.api.error(`${e} ${i} - HTTP ${c.status}`,{errorText:f});let h=f;try{h=JSON.parse(f).detail||f}catch{}throw new Error(Ty(c.status,h))}if(!(c.headers.get("content-type")||"").includes("application/json")){E.api.timed(`${e} ${i} -> ${c.status} (no body)`,l);return}const d=await c.json();return E.api.timed(`${e} ${i} -> ${c.status}`,l,d),d}async function _d(){return he("GET","/system/status")}async function a0(){return he("GET","/settings")}async function o0(e){return he("PUT","/settings",e)}async function c0(e,t){return he("POST","/system/load-model",{model_name:e,ctx_size:t})}async function u0(e,t=!1){return he("POST","/system/download-model",{model_name:e,force:t})}async function Ed(){return he("GET","/agents")}async function d0(){return he("GET","/agents/disk",void 0,{"x-gaia-ui":"1"})}const ar={"x-gaia-ui":"1"};async function f0(){return he("GET","/connectors")}async function zy(e){return he("GET",`/connectors/${e}`)}async function Ay(e,t){return he("POST",`/connectors/${e}/authorize`,{scopes:t},ar)}async function Ly(e,t){return he("POST",`/connectors/${e}/configure`,{config:t},ar)}async function Td(e){await he("DELETE",`/connectors/${e}`,void 0,ar)}async function Dy(e){return he("POST",`/connectors/${e}/enable`,{},ar)}async function Iy(e){return he("POST",`/connectors/${e}/disable`,{},ar)}async function m0(){return he("GET","/connectors/agent-mcps")}async function h0(e){return he("GET",`/connectors/${e}/grants`)}async function p0(e,t,n){await he("PUT",`/connectors/${e}/grants/${encodeURIComponent(t)}`,{scopes:n},ar)}async function g0(e,t){await he("DELETE",`/connectors/${e}/grants/${encodeURIComponent(t)}`,void 0,ar)}async function y0(e){return he("GET",`/connectors/${e}/activations`)}async function x0(e,t,n){return he("PUT",`/connectors/${e}/activations/${encodeURIComponent(t)}`,n?{scopes:n}:{},ar)}async function v0(e,t){await he("DELETE",`/connectors/${e}/activations/${encodeURIComponent(t)}`,void 0,ar)}async function k0(){return he("GET","/sessions")}async function yu(e={}){return he("POST","/sessions",e)}async function sc(e,t){return he("PUT",`/sessions/${e}`,t)}async function Py(e){return he("DELETE",`/sessions/${e}`)}async function w0(e){return he("PATCH",`/sessions/${e}/private`)}async function Rs(e){return he("GET",`/sessions/${e}/messages`)}async function b0(e){return he("GET",`/sessions/${e}/export?format=markdown`)}async function j0(e,t){return he("DELETE",`/sessions/${e}/messages/${t}`)}async function S0(e,t){return he("DELETE",`/sessions/${e}/messages/${t}/and-below`)}const N0=new Set(["status","step","thinking","plan","tool_start","tool_end","tool_result","tool_args","tool_confirm","agent_error","permission_request","policy_alert"]);function My(e,t,n,r,i,l,a){let o;typeof n=="function"?o={onChunk:n,onAgentEvent:()=>{},onDone:()=>{},onError:m=>{E.stream.error("Unhandled stream error",m)}}:o=n;const c=new AbortController,u=E.stream.time();let d=0,f=0,h=0;return E.stream.info(`Starting SSE stream for session=${e}`,{messageLength:t.length}),fetch(`${So}/chat/send`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:e,message:t,stream:!0,...l?{agent_type:l}:{}}),signal:c.signal}).then(async m=>{var w,j;if(E.stream.info(`SSE connection opened -> HTTP ${m.status}`),!m.ok){const z=await m.text().catch(()=>"");E.stream.error(`SSE connection failed: HTTP ${m.status}`,z),o.onError(new Error(`HTTP ${m.status}: ${z}`));return}const g=(w=m.body)==null?void 0:w.getReader();if(!g){E.stream.error("No response body reader available"),o.onError(new Error("No response body"));return}const k=new TextDecoder;let v="",y=!1;try{for(;;){const{done:z,value:D}=await g.read();if(z){E.stream.debug("SSE reader done (stream ended)");break}v+=k.decode(D,{stream:!0});const C=v.split(`
|
|
503
|
+
`);v=C.pop()||"";for(const A of C)if(A.startsWith("data: ")){const _=A.slice(6).trim();if(!_)continue;try{const I=JSON.parse(_);I.type==="chunk"?(d++,f+=(I.content||"").length,(d<=3||d%50===0)&&E.stream.debug(`Chunk #${d} (+${(I.content||"").length} chars)`),o.onChunk(I)):I.type==="answer"?o.onChunk(I):I.type==="done"?(y=!0,E.stream.timed(`Stream complete: ${d} chunks, ${f} chars, ${h} agent events`,u),o.onDone(I)):I.type==="error"?(E.stream.error("Stream error event:",I.content),o.onError(new Error(I.content||"Unknown error"))):I.type==="agent_created"?(E.stream.info(`Agent created: ${I.agent_id}`),(j=o.onAgentCreated)==null||j.call(o,I)):N0.has(I.type)?(h++,E.stream.debug(`Agent event: ${I.type}`,I),o.onAgentEvent(I)):E.stream.warn(`Unknown SSE event type: ${I.type}`,I)}catch{E.stream.warn("Malformed SSE data, skipping",{raw:_.slice(0,100)})}}}}finally{g.releaseLock()}y||(E.stream.timed(`SSE connection closed without done event: ${d} chunks, ${h} agent events`,u),o.onDone({type:"done"}))}).catch(m=>{m.name==="AbortError"?E.stream.warn(`Stream aborted by user after ${d} chunks`):(E.stream.error("Stream fetch error",m),o.onError(m))}),c}async function C0(e,t,n,r){return he("POST","/chat/confirm",{session_id:e,confirm_id:t,action:n,remember:r})}async function Ry(e,t){return he("POST","/chat/confirm-tool",{session_id:e,approved:t})}async function _0(e){return he("POST","/chat/cancel",{session_id:e})}async function Ni(){return he("GET","/documents")}async function $y(e){return he("POST","/documents/upload-path",{filepath:e})}async function Fy(e){const t=`${So}/documents/upload`,n=E.api.time();E.api.info(`POST ${t}`,{fileName:e.name,size:e.size});const r=new FormData;r.append("file",e);let i;try{i=await fetch(t,{method:"POST",body:r})}catch(a){throw E.api.error(`POST ${t} - network error`,a),a}if(!i.ok){const a=await i.text().catch(()=>"");E.api.error(`POST ${t} - HTTP ${i.status}`,{errorText:a});let o=a;try{o=JSON.parse(a).detail||a}catch{}throw new Error(Ty(i.status,o))}const l=await i.json();return E.api.timed(`POST ${t} -> ${i.status}`,n,l),l}async function E0(e){return he("DELETE",`/documents/${e}`)}async function T0(e){return he("GET",`/documents/${e}/status`)}async function z0(e){return he("POST",`/documents/${e}/cancel`)}async function Xa(e,t){return he("POST",`/sessions/${e}/documents`,{document_id:t})}async function A0(e,t){return he("DELETE",`/sessions/${e}/documents/${t}`)}async function L0(e){const t=e?`?path=${encodeURIComponent(e)}`:"";return he("GET",`/files/browse${t}`)}async function D0(e,t=!0){return he("POST","/documents/index-folder",{folder_path:e,recursive:t})}async function zd(e,t=!0){return he("POST","/files/open",{path:e,reveal:t})}async function Rm(e){const t=`${So}/files/upload`,n=E.api.time();E.api.info(`POST ${t}`,{fileName:e.name,size:e.size});const r=new FormData;r.append("file",e);const i=await fetch(t,{method:"POST",body:r});if(!i.ok){const a=await i.text().catch(()=>"Upload failed");throw E.api.error(`POST ${t} - HTTP ${i.status}`,{errorText:a}),new Error(`Upload failed: ${a}`)}const l=await i.json();return E.api.timed(`POST ${t} -> ${i.status}`,n,l),l}async function I0(e,t,n){const r=new URLSearchParams({query:e});return t&&r.set("file_types",t),r.set("max_results",String(n)),he("GET",`/files/search?${r}`)}async function P0(e,t){const n=new URLSearchParams({path:e});return he("GET",`/files/preview?${n}`)}async function M0(){return he("POST","/tunnel/start")}async function R0(){return he("POST","/tunnel/stop")}async function Oy(){return he("GET","/tunnel/status")}async function $0(){return he("GET","/mcp/status")}function Fi(e){return e.replace(/-/g,"").slice(0,7)}function F0(e,t){const n=t.replace(/^#/,"").toLowerCase();if(!n||n.length<4)return null;const r=e.find(i=>i.id.replace(/-/g,"").toLowerCase().startsWith(n));return r?r.id:null}const Uy=""+new URL("gaia-robot-NKaQnEIp.png",import.meta.url).href;function O0(e,t){e.stopPropagation(),e.preventDefault();const n=Fi(t),r=`${window.location.origin}${window.location.pathname}#${n}`;navigator.clipboard.writeText(r).then(()=>{E.ui.info(`Copied session link: ${r}`)}).catch(()=>{E.ui.warn("Clipboard write failed")})}function $m({session:e,isActive:t,isPendingDelete:n,isDeleting:r,onSelect:i,onKeyDown:l,onDelete:a,formatTime:o}){const[c,u]=p.useState(!1),d=p.useCallback(f=>{O0(f,e.id),u(!0),setTimeout(()=>u(!1),1500)},[e.id]);return s.jsxs("div",{className:`session-item ${t?"active":""} ${r?"session-deleting":""}`,onClick:()=>i(e.id),onKeyDown:f=>l(f,e.id),role:"button",tabIndex:0,"aria-label":`Open task: ${e.title}`,"aria-current":t?"true":void 0,children:[s.jsxs("span",{className:"session-title",children:[e.private&&s.jsx(hy,{size:10,className:"session-private-icon","aria-label":"Private session"}),e.title]}),s.jsxs("a",{className:`session-hash ${c?"copied":""}`,href:`#${Fi(e.id)}`,onClick:d,title:c?"Copied!":`Copy link #${Fi(e.id)}`,"aria-label":`Copy link for session ${Fi(e.id)}`,children:["#",Fi(e.id)]}),s.jsx("span",{className:"session-time",children:o(e.updated_at)}),n?s.jsxs("button",{className:"session-delete confirm",onClick:f=>a(f,e.id),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&a(f,e.id)},title:"Click to confirm delete","aria-label":`Confirm delete: ${e.title}`,children:[s.jsx(fi,{size:12}),s.jsx("span",{className:"confirm-label",children:"Delete?"})]}):s.jsx("button",{className:"session-delete",onClick:f=>a(f,e.id),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&a(f,e.id)},title:"Delete","aria-label":`Delete: ${e.title}`,children:s.jsx(fi,{size:13})})]})}function U0({onNewTask:e,onHome:t,tunnelActive:n,tunnelLoading:r,onMobileToggle:i}){const{sessions:l,currentSessionId:a,setCurrentSession:o,removeSession:c,addSession:u,setMessages:d,theme:f,toggleTheme:h,setShowSettings:m,setShowMemoryDashboard:g,sidebarOpen:k,setSidebarOpen:v,setLoadingMessages:y,sidebarCollapsed:w,toggleSidebarCollapsed:j,sidebarWidth:z,setSidebarWidth:D,addPendingDelete:C,removePendingDelete:A}=ve(),[_,I]=p.useState(""),[N,U]=p.useState(null),[O,re]=p.useState(null),[oe,te]=p.useState(!1),[le,fe]=p.useState(null),T=p.useRef(null),P=p.useRef(null),b=p.useRef(null);p.useEffect(()=>{const R=()=>{var B;w?(j(),requestAnimationFrame(()=>{var pe;return(pe=P.current)==null?void 0:pe.focus()})):(B=P.current)==null||B.focus()};return window.addEventListener("gaia:focus-search",R),()=>window.removeEventListener("gaia:focus-search",R)},[w,j]);const X=_?l.filter(R=>R.title.toLowerCase().includes(_.toLowerCase())):l,H=p.useMemo(()=>{if(_)return null;const R=new Date,B=new Date(R.getFullYear(),R.getMonth(),R.getDate()).getTime(),pe=B-864e5,ge=B-7*864e5,ce=[{label:"Today",sessions:[]},{label:"Yesterday",sessions:[]},{label:"Previous 7 Days",sessions:[]},{label:"Older",sessions:[]}];for(const we of X){const G=new Date(we.updated_at).getTime();G>=B?ce[0].sessions.push(we):G>=pe?ce[1].sessions.push(we):G>=ge?ce[2].sessions.push(we):ce[3].sessions.push(we)}return ce.filter(we=>we.sessions.length>0)},[X,_]),S=p.useCallback(async R=>{var pe;if(R===a)return;const B=((pe=l.find(ge=>ge.id===R))==null?void 0:pe.title)||"?";E.nav.info(`Selecting session: "${B}" (${R})`),o(R),d([]),y(!0),window.innerWidth<=768&&v(!1);try{const ge=await Rs(R);if(!(ve.getState().currentSessionId===R)){E.nav.debug(`Discarding stale message load for session=${R} (user switched away)`);return}d(ge.messages||[]),E.nav.info(`Loaded ${(ge.messages||[]).length} message(s) for "${B}"`)}catch(ge){E.nav.error(`Failed to load messages for session ${R}`,ge),d([])}finally{y(!1)}},[a,l,o,d,v,y]),ie=p.useCallback(async(R,B)=>{R.stopPropagation(),R.preventDefault();const pe=l.find(ce=>ce.id===B),ge=(pe==null?void 0:pe.title)||"?";if(N===B){E.chat.info(`Deleting session: "${ge}" (${B})`),U(null),re(B),C(B),Py(B).then(()=>{E.chat.info(`Session deleted from backend: "${ge}"`),A(B)}).catch(we=>{E.chat.warn(`Backend delete failed for "${ge}"`,we),A(B)}),le!=null&&le.timer&&clearTimeout(le.timer);const ce=setTimeout(()=>{fe(null)},5e3);pe&&fe({session:pe,timer:ce}),setTimeout(()=>{c(B),re(null)},250);return}E.chat.debug(`Delete pending confirmation for: "${ge}" (${B})`),U(B),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>U(ce=>ce===B?null:ce),3e3)},[N,l,c,le,C,A]),ye=p.useCallback(()=>{if(!le)return;clearTimeout(le.timer);const{session:R}=le;E.chat.info(`Undo delete: re-creating "${R.title}"`),A(R.id),yu({title:R.title}).then(B=>{u(B),E.chat.info(`Undo delete: re-created "${B.title}" (new id=${B.id})`)}).catch(B=>{E.chat.warn(`Undo delete failed for "${R.title}"`,B)}),fe(null)},[le,u,A]);p.useEffect(()=>{if(!N)return;const R=()=>U(null);return window.addEventListener("click",R,{once:!0}),()=>window.removeEventListener("click",R)},[N]);const ae=p.useCallback((R,B)=>{(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),S(B))},[S]),je=p.useRef(null),Ge=p.useCallback(R=>{R.preventDefault(),te(!0),E.ui.debug("Sidebar resize started");const B=R.clientX,pe=z,ge=we=>{const G=we.clientX-B;D(pe+G)},ce=()=>{te(!1),document.removeEventListener("mousemove",ge),document.removeEventListener("mouseup",ce),document.body.style.cursor="",document.body.style.userSelect="",je.current=null,E.ui.debug("Sidebar resize ended")};je.current=ce,document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",ge),document.addEventListener("mouseup",ce)},[z,D]);p.useEffect(()=>()=>{je.current&&je.current(),b.current&&clearTimeout(b.current)},[]);const qe=R=>{const B=new Date(R),ge=new Date().getTime()-B.getTime(),ce=Math.floor(ge/6e4);if(ce<1)return"now";if(ce<60)return`${ce}m`;const we=Math.floor(ce/60);if(we<24)return`${we}h`;const G=Math.floor(we/24);return G<7?`${G}d`:B.toLocaleDateString(void 0,{month:"short",day:"numeric"})},M=typeof window<"u"&&window.innerWidth<=768?void 0:{width:w?56:z,minWidth:w?56:z};return s.jsxs("aside",{ref:T,className:`sidebar ${k?"open":""} ${w?"collapsed":""} ${oe?"resizing":""}`,style:M,role:"complementary","aria-label":"Task sidebar",children:[s.jsxs("div",{className:"sidebar-top",children:[s.jsxs("button",{className:"sidebar-brand",onClick:t,title:"Agent Hub","aria-label":"Go to Agent Hub",children:[s.jsx("div",{className:"brand-icon","aria-hidden":"true",children:s.jsx("img",{src:Uy,alt:"",width:28,height:28})}),s.jsxs("div",{className:"brand-text",children:[s.jsx("span",{className:"brand-name",children:"GAIA"}),s.jsxs("span",{className:"brand-version",children:["v","0.20.0"]}),s.jsx("span",{className:"beta-badge",children:"BETA"})]})]}),s.jsxs("div",{className:"sidebar-top-actions",children:[s.jsx("button",{className:"new-task-btn",onClick:e,title:"New Task","aria-label":"New Task",children:s.jsx(gl,{size:18})}),s.jsx("button",{className:"collapse-btn",onClick:j,title:w?"Expand sidebar":"Collapse sidebar","aria-label":w?"Expand sidebar":"Collapse sidebar",children:w?s.jsx(gw,{size:18}):s.jsx(pw,{size:18})})]})]}),s.jsxs("div",{className:"sidebar-search",children:[s.jsx(An,{size:14,className:"search-icon","aria-hidden":"true"}),s.jsx("input",{ref:P,type:"text",placeholder:"Search... (Ctrl+K)",value:_,onChange:R=>I(R.target.value),"aria-label":"Search tasks"})]}),s.jsxs("nav",{className:"session-list","aria-label":"Task sessions",children:[X.length===0&&s.jsx("div",{className:"empty-hint",children:_?"No results":"No tasks yet"}),H?H.map(R=>s.jsxs("div",{children:[s.jsx("div",{className:"session-group-label",children:R.label}),R.sessions.map(B=>s.jsx($m,{session:B,isActive:B.id===a,isPendingDelete:N===B.id,isDeleting:O===B.id,onSelect:S,onKeyDown:ae,onDelete:ie,formatTime:qe},B.id))]},R.label)):X.map(R=>s.jsx($m,{session:R,isActive:R.id===a,isPendingDelete:N===R.id,isDeleting:O===R.id,onSelect:S,onKeyDown:ae,onDelete:ie,formatTime:qe},R.id))]}),s.jsxs("div",{className:"sidebar-bottom",children:[s.jsxs("div",{className:"privacy-badge",children:[s.jsx("span",{className:"privacy-dot","aria-hidden":"true"}),s.jsx("span",{children:"100% Local"}),s.jsxs("span",{className:"version-badge",children:["v","0.20.0"]})]}),s.jsxs("div",{className:"sidebar-actions",children:[i&&s.jsx("button",{className:`btn-icon mobile-toggle-btn ${n?"active":""} ${r?"loading":""}`,onClick:i,disabled:r,title:n?"Stop mobile access":"Enable mobile access","aria-label":n?"Stop mobile access":"Enable mobile access",children:s.jsx(wy,{size:17})}),s.jsx("button",{className:"btn-icon",onClick:()=>g(!0),title:"Memory Dashboard","aria-label":"Memory Dashboard",children:s.jsx(ti,{size:17})}),s.jsx("button",{className:"btn-icon",onClick:()=>m(!0),title:"Settings","aria-label":"Settings",children:s.jsx(bw,{size:17})}),s.jsx("button",{className:"btn-icon",onClick:h,title:"Toggle theme","aria-label":`Switch to ${f==="dark"?"light":"dark"} theme`,children:f==="dark"?s.jsx(_w,{size:17}):s.jsx(mw,{size:17})})]})]}),!w&&s.jsx("div",{className:"sidebar-resize-handle",onMouseDown:Ge,title:"Drag to resize sidebar","aria-hidden":"true"}),le&&s.jsxs("div",{className:"toast toast-undo",role:"status",children:["Deleted “",le.session.title,"”",s.jsx("span",{className:"toast-action",onClick:ye,children:"Undo"})]})]})}function B0(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const H0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,V0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,W0={};function Fm(e,t){return(W0.jsx?V0:H0).test(e)}const G0=/[ \t\n\f\r]/g;function q0(e){return typeof e=="object"?e.type==="text"?Om(e.value):!1:Om(e)}function Om(e){return e.replace(G0,"")===""}class Cl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Cl.prototype.normal={};Cl.prototype.property={};Cl.prototype.space=void 0;function By(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Cl(n,r,t)}function xu(e){return e.toLowerCase()}class Xt{constructor(t,n){this.attribute=n,this.property=t}}Xt.prototype.attribute="";Xt.prototype.booleanish=!1;Xt.prototype.boolean=!1;Xt.prototype.commaOrSpaceSeparated=!1;Xt.prototype.commaSeparated=!1;Xt.prototype.defined=!1;Xt.prototype.mustUseProperty=!1;Xt.prototype.number=!1;Xt.prototype.overloadedBoolean=!1;Xt.prototype.property="";Xt.prototype.spaceSeparated=!1;Xt.prototype.space=void 0;let Q0=0;const be=gi(),ot=gi(),vu=gi(),q=gi(),Be=gi(),Qi=gi(),tn=gi();function gi(){return 2**++Q0}const ku=Object.freeze(Object.defineProperty({__proto__:null,boolean:be,booleanish:ot,commaOrSpaceSeparated:tn,commaSeparated:Qi,number:q,overloadedBoolean:vu,spaceSeparated:Be},Symbol.toStringTag,{value:"Module"})),lc=Object.keys(ku);class Ad extends Xt{constructor(t,n,r,i){let l=-1;if(super(t,n),Um(this,"space",i),typeof r=="number")for(;++l<lc.length;){const a=lc[l];Um(this,lc[l],(r&ku[a])===ku[a])}}}Ad.prototype.defined=!0;function Um(e,t,n){n&&(e[t]=n)}function ds(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new Ad(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[xu(r)]=r,n[xu(l.attribute)]=r}return new Cl(t,n,e.space)}const Hy=ds({properties:{ariaActiveDescendant:null,ariaAtomic:ot,ariaAutoComplete:null,ariaBusy:ot,ariaChecked:ot,ariaColCount:q,ariaColIndex:q,ariaColSpan:q,ariaControls:Be,ariaCurrent:null,ariaDescribedBy:Be,ariaDetails:null,ariaDisabled:ot,ariaDropEffect:Be,ariaErrorMessage:null,ariaExpanded:ot,ariaFlowTo:Be,ariaGrabbed:ot,ariaHasPopup:null,ariaHidden:ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Be,ariaLevel:q,ariaLive:null,ariaModal:ot,ariaMultiLine:ot,ariaMultiSelectable:ot,ariaOrientation:null,ariaOwns:Be,ariaPlaceholder:null,ariaPosInSet:q,ariaPressed:ot,ariaReadOnly:ot,ariaRelevant:null,ariaRequired:ot,ariaRoleDescription:Be,ariaRowCount:q,ariaRowIndex:q,ariaRowSpan:q,ariaSelected:ot,ariaSetSize:q,ariaSort:null,ariaValueMax:q,ariaValueMin:q,ariaValueNow:q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Vy(e,t){return t in e?e[t]:t}function Wy(e,t){return Vy(e,t.toLowerCase())}const K0=ds({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Qi,acceptCharset:Be,accessKey:Be,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:Be,autoFocus:be,autoPlay:be,blocking:Be,capture:null,charSet:null,checked:be,cite:null,className:Be,cols:q,colSpan:null,content:null,contentEditable:ot,controls:be,controlsList:Be,coords:q|Qi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:vu,draggable:ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:Be,height:q,hidden:vu,high:q,href:null,hrefLang:null,htmlFor:Be,httpEquiv:Be,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:Be,itemRef:Be,itemScope:be,itemType:Be,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:q,manifest:null,max:null,maxLength:q,media:null,method:null,min:null,minLength:q,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,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:be,optimum:q,pattern:null,ping:Be,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:Be,required:be,reversed:be,rows:q,rowSpan:q,sandbox:Be,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shape:null,size:q,sizes:null,slot:null,span:q,spellCheck:ot,src:null,srcDoc:null,srcLang:null,srcSet:null,start:q,step:null,style:null,tabIndex:q,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:ot,width:q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Be,axis:null,background:null,bgColor:null,border:q,borderColor:null,bottomMargin:q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:q,leftMargin:q,link:null,longDesc:null,lowSrc:null,marginHeight:q,marginWidth:q,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:q,rules:null,scheme:null,scrolling:ot,standby:null,summary:null,text:null,topMargin:q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:be,disableRemotePlayback:be,prefix:null,property:null,results:q,security:null,unselectable:null},space:"html",transform:Wy}),Y0=ds({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:tn,accentHeight:q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:q,amplitude:q,arabicForm:null,ascent:q,attributeName:null,attributeType:null,azimuth:q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:q,by:null,calcMode:null,capHeight:q,className:Be,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:q,diffuseConstant:q,direction:null,display:null,dur:null,divisor:q,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:q,enableBackground:null,end:null,event:null,exponent:q,externalResourcesRequired:null,fill:null,fillOpacity:q,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:Qi,g2:Qi,glyphName:Qi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:q,horizOriginX:q,horizOriginY:q,id:null,ideographic:q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:q,k:q,k1:q,k2:q,k3:q,k4:q,kernelMatrix:tn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:q,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:q,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:q,overlineThickness:q,paintOrder:null,panose1:null,path:null,pathLength:q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Be,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:q,pointsAtY:q,pointsAtZ:q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:tn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:tn,rev:tn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:tn,requiredFeatures:tn,requiredFonts:tn,requiredFormats:tn,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:q,specularExponent:q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:q,strikethroughThickness:q,string:null,stroke:null,strokeDashArray:tn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:q,strokeOpacity:q,strokeWidth:null,style:null,surfaceScale:q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:tn,tabIndex:q,tableValues:null,target:null,targetX:q,targetY:q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:tn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:q,underlineThickness:q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:q,values:null,vAlphabetic:q,vMathematical:q,vectorEffect:null,vHanging:q,vIdeographic:q,version:null,vertAdvY:q,vertOriginX:q,vertOriginY:q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Vy}),Gy=ds({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),qy=ds({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Wy}),Qy=ds({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),X0={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"},J0=/[A-Z]/g,Bm=/-[a-z]/g,Z0=/^data[-\w.:]+$/i;function eb(e,t){const n=xu(t);let r=t,i=Xt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Z0.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Bm,nb);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Bm.test(l)){let a=l.replace(J0,tb);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Ad}return new i(r,t)}function tb(e){return"-"+e.toLowerCase()}function nb(e){return e.charAt(1).toUpperCase()}const rb=By([Hy,K0,Gy,qy,Qy],"html"),Ld=By([Hy,Y0,Gy,qy,Qy],"svg");function ib(e){return e.join(" ").trim()}var Dd={},Hm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,sb=/\n/g,lb=/^\s*/,ab=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ob=/^:\s*/,cb=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ub=/^[;\s]*/,db=/^\s+|\s+$/g,fb=`
|
|
504
|
+
`,Vm="/",Wm="*",Xr="",mb="comment",hb="declaration";function pb(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var k=g.match(sb);k&&(n+=k.length);var v=g.lastIndexOf(fb);r=~v?g.length-v:r+g.length}function l(){var g={line:n,column:r};return function(k){return k.position=new a(g),u(),k}}function a(g){this.start=g,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(g){var k=new Error(t.source+":"+n+":"+r+": "+g);if(k.reason=g,k.filename=t.source,k.line=n,k.column=r,k.source=e,!t.silent)throw k}function c(g){var k=g.exec(e);if(k){var v=k[0];return i(v),e=e.slice(v.length),k}}function u(){c(lb)}function d(g){var k;for(g=g||[];k=f();)k!==!1&&g.push(k);return g}function f(){var g=l();if(!(Vm!=e.charAt(0)||Wm!=e.charAt(1))){for(var k=2;Xr!=e.charAt(k)&&(Wm!=e.charAt(k)||Vm!=e.charAt(k+1));)++k;if(k+=2,Xr===e.charAt(k-1))return o("End of comment missing");var v=e.slice(2,k-2);return r+=2,i(v),e=e.slice(k),r+=2,g({type:mb,comment:v})}}function h(){var g=l(),k=c(ab);if(k){if(f(),!c(ob))return o("property missing ':'");var v=c(cb),y=g({type:hb,property:Gm(k[0].replace(Hm,Xr)),value:v?Gm(v[0].replace(Hm,Xr)):Xr});return c(ub),y}}function m(){var g=[];d(g);for(var k;k=h();)k!==!1&&(g.push(k),d(g));return g}return u(),m()}function Gm(e){return e?e.replace(db,Xr):Xr}var gb=pb,yb=ba&&ba.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dd,"__esModule",{value:!0});Dd.default=vb;const xb=yb(gb);function vb(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,xb.default)(e),i=typeof t=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:a,value:o}=l;i?t(a,o,l):o&&(n=n||{},n[a]=o)}),n}var No={};Object.defineProperty(No,"__esModule",{value:!0});No.camelCase=void 0;var kb=/^--[a-zA-Z0-9_-]+$/,wb=/-([a-z])/g,bb=/^[^-]+$/,jb=/^-(webkit|moz|ms|o|khtml)-/,Sb=/^-(ms)-/,Nb=function(e){return!e||bb.test(e)||kb.test(e)},Cb=function(e,t){return t.toUpperCase()},qm=function(e,t){return"".concat(t,"-")},_b=function(e,t){return t===void 0&&(t={}),Nb(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Sb,qm):e=e.replace(jb,qm),e.replace(wb,Cb))};No.camelCase=_b;var Eb=ba&&ba.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Tb=Eb(Dd),zb=No;function wu(e,t){var n={};return!e||typeof e!="string"||(0,Tb.default)(e,function(r,i){r&&i&&(n[(0,zb.camelCase)(r,t)]=i)}),n}wu.default=wu;var Ab=wu;const Lb=io(Ab),Ky=Yy("end"),Id=Yy("start");function Yy(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Db(e){const t=Id(e),n=Ky(e);if(t&&n)return{start:t,end:n}}function Qs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Qm(e.position):"start"in e||"end"in e?Qm(e):"line"in e||"column"in e?bu(e):""}function bu(e){return Km(e&&e.line)+":"+Km(e&&e.column)}function Qm(e){return bu(e&&e.start)+"-"+bu(e&&e.end)}function Km(e){return e&&typeof e=="number"?e:1}class It extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},a=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(a=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?l.ruleId=r:(l.source=r.slice(0,c),l.ruleId=r.slice(c+1))}if(!l.place&&l.ancestors&&l.ancestors){const c=l.ancestors[l.ancestors.length-1];c&&(l.place=c.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Qs(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}It.prototype.file="";It.prototype.name="";It.prototype.reason="";It.prototype.message="";It.prototype.stack="";It.prototype.column=void 0;It.prototype.line=void 0;It.prototype.ancestors=void 0;It.prototype.cause=void 0;It.prototype.fatal=void 0;It.prototype.place=void 0;It.prototype.ruleId=void 0;It.prototype.source=void 0;const Pd={}.hasOwnProperty,Ib=new Map,Pb=/[A-Z]/g,Mb=new Set(["table","tbody","thead","tfoot","tr"]),Rb=new Set(["td","th"]),Xy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $b(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Gb(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Wb(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ld:rb,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=Jy(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Jy(e,t,n){if(t.type==="element")return Fb(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Ob(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Bb(e,t,n);if(t.type==="mdxjsEsm")return Ub(e,t);if(t.type==="root")return Hb(e,t,n);if(t.type==="text")return Vb(e,t)}function Fb(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ld,e.schema=i),e.ancestors.push(t);const l=ex(e,t.tagName,!1),a=qb(e,t);let o=Rd(e,t);return Mb.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!q0(c):!0})),Zy(e,a,l,t),Md(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function Ob(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}xl(e,t.position)}function Ub(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xl(e,t.position)}function Bb(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ld,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:ex(e,t.name,!0),a=Qb(e,t),o=Rd(e,t);return Zy(e,a,l,t),Md(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function Hb(e,t,n){const r={};return Md(r,Rd(e,t)),e.create(t,e.Fragment,r,n)}function Vb(e,t){return t.value}function Zy(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Md(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Wb(e,t,n){return r;function r(i,l,a,o){const u=Array.isArray(a.children)?n:t;return o?u(l,a,o):u(l,a)}}function Gb(e,t){return n;function n(r,i,l,a){const o=Array.isArray(l.children),c=Id(r);return t(i,l,a,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function qb(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Pd.call(t.properties,i)){const l=Kb(e,i,t.properties[i]);if(l){const[a,o]=l;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Rb.has(t.tagName)?r=o:n[a]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Qb(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const a=l.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else xl(e,t.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else xl(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Rd(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Ib;for(;++r<t.children.length;){const l=t.children[r];let a;if(e.passKeys){const c=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(c){const u=i.get(c)||0;a=c+"-"+u,i.set(c,u+1)}}const o=Jy(e,l,a);o!==void 0&&n.push(o)}return n}function Kb(e,t,n){const r=eb(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?B0(n):ib(n)),r.property==="style"){let i=typeof n=="object"?n:Yb(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Xb(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?X0[r.property]||r.property:r.attribute,n]}}function Yb(e,t){try{return Lb(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new It("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Xy+"#cannot-parse-style-attribute",i}}function ex(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,a;for(;++l<i.length;){const o=Fm(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}r=a}else r=Fm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Pd.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);xl(e)}function xl(e,t){const n=new It("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Xy+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Xb(e){const t={};let n;for(n in e)Pd.call(e,n)&&(t[Jb(n)]=e[n]);return t}function Jb(e){let t=e.replace(Pb,Zb);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Zb(e){return"-"+e.toLowerCase()}const ac={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"]},ej={};function $d(e,t){const n=ej,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return tx(e,r,i)}function tx(e,t,n){if(tj(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ym(e.children,t,n)}return Array.isArray(e)?Ym(e,t,n):""}function Ym(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=tx(e[i],t,n);return r.join("")}function tj(e){return!!(e&&typeof e=="object")}const Xm=document.createElement("i");function Fd(e){const t="&"+e+";";Xm.innerHTML=t;const n=Xm.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function an(e,t,n,r){const i=e.length;let l=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);l<r.length;)a=r.slice(l,l+1e4),a.unshift(t,0),e.splice(...a),l+=1e4,t+=1e4}function hn(e,t){return e.length>0?(an(e,e.length,0,t),e):t}const Jm={}.hasOwnProperty;function nx(e){const t={};let n=-1;for(;++n<e.length;)nj(t,e[n]);return t}function nj(e,t){let n;for(n in t){const i=(Jm.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let a;if(l)for(a in l){Jm.call(i,a)||(i[a]=[]);const o=l[a];rj(i[a],Array.isArray(o)?o:o?[o]:[])}}}function rj(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);an(e,0,0,r)}function rx(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function In(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ft=qr(/[A-Za-z]/),Lt=qr(/[\dA-Za-z]/),ij=qr(/[#-'*+\--9=?A-Z^-~]/);function Ja(e){return e!==null&&(e<32||e===127)}const ju=qr(/\d/),sj=qr(/[\dA-Fa-f]/),lj=qr(/[!-/:-@[-`{-~]/);function de(e){return e!==null&&e<-2}function Ue(e){return e!==null&&(e<0||e===32)}function Ce(e){return e===-2||e===-1||e===32}const Co=qr(new RegExp("\\p{P}|\\p{S}","u")),mi=qr(/\s/);function qr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function fs(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let a="";if(l===37&&Lt(e.charCodeAt(n+1))&&Lt(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(a=String.fromCharCode(l,o),i=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Le(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return a;function a(c){return Ce(c)?(e.enter(n),o(c)):t(c)}function o(c){return Ce(c)&&l++<i?(e.consume(c),o):(e.exit(n),t(c))}}const aj={tokenize:oj};function oj(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Le(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),l(o)}function l(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return de(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),a)}}const cj={tokenize:uj},Zm={tokenize:dj};function uj(e){const t=this,n=[];let r=0,i,l,a;return o;function o(j){if(r<n.length){const z=n[r];return t.containerState=z[1],e.attempt(z[0].continuation,c,u)(j)}return u(j)}function c(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&w();const z=t.events.length;let D=z,C;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){C=t.events[D][1].end;break}y(r);let A=z;for(;A<t.events.length;)t.events[A][1].end={...C},A++;return an(t.events,D+1,0,t.events.slice(z)),t.events.length=A,u(j)}return o(j)}function u(j){if(r===n.length){if(!i)return h(j);if(i.currentConstruct&&i.currentConstruct.concrete)return g(j);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zm,d,f)(j)}function d(j){return i&&w(),y(r),h(j)}function f(j){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,g(j)}function h(j){return t.containerState={},e.attempt(Zm,m,g)(j)}function m(j){return r++,n.push([t.currentConstruct,t.containerState]),h(j)}function g(j){if(j===null){i&&w(),y(0),e.consume(j);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),k(j)}function k(j){if(j===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(j);return}return de(j)?(e.consume(j),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(j),k)}function v(j,z){const D=t.sliceStream(j);if(z&&D.push(null),j.previous=l,l&&(l.next=j),l=j,i.defineSkip(j.start),i.write(D),t.parser.lazy[j.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const A=t.events.length;let _=A,I,N;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(I){N=t.events[_][1].end;break}I=!0}for(y(r),C=A;C<t.events.length;)t.events[C][1].end={...N},C++;an(t.events,_+1,0,t.events.slice(A)),t.events.length=C}}function y(j){let z=n.length;for(;z-- >j;){const D=n[z];t.containerState=D[1],D[0].exit.call(t,e)}n.length=j}function w(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function dj(e,t,n){return Le(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ls(e){if(e===null||Ue(e)||mi(e))return 1;if(Co(e))return 2}function _o(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Su={name:"attention",resolveAll:fj,tokenize:mj};function fj(e,t){let n=-1,r,i,l,a,o,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};eh(f,-c),eh(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},l={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=hn(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=hn(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",l,t]]),u=hn(u,_o(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=hn(u,[["exit",l,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=hn(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,an(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function mj(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ls(r);let l;return a;function a(c){return l=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===l)return e.consume(c),o;const u=e.exit("attentionSequence"),d=ls(c),f=!d||d===2&&i||n.includes(c),h=!i||i===2&&d||n.includes(r);return u._open=!!(l===42?f:f&&(i||!h)),u._close=!!(l===42?h:h&&(d||!f)),t(c)}}function eh(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hj={name:"autolink",tokenize:pj};function pj(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(m){return Ft(m)?(e.consume(m),a):m===64?n(m):u(m)}function a(m){return m===43||m===45||m===46||Lt(m)?(r=1,o(m)):u(m)}function o(m){return m===58?(e.consume(m),r=0,c):(m===43||m===45||m===46||Lt(m))&&r++<32?(e.consume(m),o):(r=0,u(m))}function c(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Ja(m)?n(m):(e.consume(m),c)}function u(m){return m===64?(e.consume(m),d):ij(m)?(e.consume(m),u):n(m)}function d(m){return Lt(m)?f(m):n(m)}function f(m){return m===46?(e.consume(m),r=0,d):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||Lt(m))&&r++<63){const g=m===45?h:f;return e.consume(m),g}return n(m)}}const _l={partial:!0,tokenize:gj};function gj(e,t,n){return r;function r(l){return Ce(l)?Le(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||de(l)?t(l):n(l)}}const ix={continuation:{tokenize:xj},exit:vj,name:"blockQuote",tokenize:yj};function yj(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),l}return n(a)}function l(a){return Ce(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function xj(e,t,n){const r=this;return i;function i(a){return Ce(a)?Le(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):l(a)}function l(a){return e.attempt(ix,t,n)(a)}}function vj(e){e.exit("blockQuote")}const sx={name:"characterEscape",tokenize:kj};function kj(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return lj(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const lx={name:"characterReference",tokenize:wj};function wj(e,t,n){const r=this;let i=0,l,a;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),l=31,a=Lt,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,a=sj,d):(e.enter("characterReferenceValue"),l=7,a=ju,d(f))}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return a===Lt&&!Fd(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(f)&&i++<l?(e.consume(f),d):n(f)}}const th={partial:!0,tokenize:jj},nh={concrete:!0,name:"codeFenced",tokenize:bj};function bj(e,t,n){const r=this,i={partial:!0,tokenize:D};let l=0,a=0,o;return c;function c(C){return u(C)}function u(C){const A=r.events[r.events.length-1];return l=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,o=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(C)}function d(C){return C===o?(a++,e.consume(C),d):a<3?n(C):(e.exit("codeFencedFenceSequence"),Ce(C)?Le(e,f,"whitespace")(C):f(C))}function f(C){return C===null||de(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(th,k,z)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||de(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(C)):Ce(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Le(e,m,"whitespace")(C)):C===96&&C===o?n(C):(e.consume(C),h)}function m(C){return C===null||de(C)?f(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===null||de(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(C)):C===96&&C===o?n(C):(e.consume(C),g)}function k(C){return e.attempt(i,z,v)(C)}function v(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return l>0&&Ce(C)?Le(e,w,"linePrefix",l+1)(C):w(C)}function w(C){return C===null||de(C)?e.check(th,k,z)(C):(e.enter("codeFlowValue"),j(C))}function j(C){return C===null||de(C)?(e.exit("codeFlowValue"),w(C)):(e.consume(C),j)}function z(C){return e.exit("codeFenced"),t(C)}function D(C,A,_){let I=0;return N;function N(te){return C.enter("lineEnding"),C.consume(te),C.exit("lineEnding"),U}function U(te){return C.enter("codeFencedFence"),Ce(te)?Le(C,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(te):O(te)}function O(te){return te===o?(C.enter("codeFencedFenceSequence"),re(te)):_(te)}function re(te){return te===o?(I++,C.consume(te),re):I>=a?(C.exit("codeFencedFenceSequence"),Ce(te)?Le(C,oe,"whitespace")(te):oe(te)):_(te)}function oe(te){return te===null||de(te)?(C.exit("codeFencedFence"),A(te)):_(te)}}}function jj(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const oc={name:"codeIndented",tokenize:Nj},Sj={partial:!0,tokenize:Cj};function Nj(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Le(e,l,"linePrefix",5)(u)}function l(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):de(u)?e.attempt(Sj,a,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||de(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),t(u)}}function Cj(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):de(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Le(e,l,"linePrefix",5)(a)}function l(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):de(a)?i(a):n(a)}}const _j={name:"codeText",previous:Tj,resolve:Ej,tokenize:zj};function Ej(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Tj(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function zj(e,t,n){let r=0,i,l;return a;function a(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(l=e.enter("codeTextSequence"),i=0,d(f)):de(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||de(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(l.type="codeTextData",u(f))}}class Aj{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&As(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),As(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),As(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);As(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);As(this.left,n.reverse())}}}function As(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ax(e){const t={};let n=-1,r,i,l,a,o,c,u;const d=new Aj(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,l=0,l<c.length&&c[l][1].type==="lineEndingBlank"&&(l+=2),l<c.length&&c[l][1].type==="content"))for(;++l<c.length&&c[l][1].type!=="content";)c[l][1].type==="chunkText"&&(c[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Lj(d,n)),n=t[n],u=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(a=d.get(l),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=l);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return an(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function Lj(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,c=[],u={};let d,f,h=-1,m=n,g=0,k=0;const v=[k];for(;m;){for(;e.get(++i)[1]!==m;);l.push(i),m._tokenizer||(d=r.sliceStream(m),m.next||d.push(null),f&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=m,m=m.next}for(m=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(k=h+1,v.push(k),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):v.pop(),h=v.length;h--;){const y=o.slice(v[h],v[h+1]),w=l.pop();c.push([w,w+y.length-1]),e.splice(w,2,y)}for(c.reverse(),h=-1;++h<c.length;)u[g+c[h][0]]=g+c[h][1],g+=c[h][1]-c[h][0]-1;return u}const Dj={resolve:Pj,tokenize:Mj},Ij={partial:!0,tokenize:Rj};function Pj(e){return ax(e),e}function Mj(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?l(o):de(o)?e.check(Ij,a,l)(o):(e.consume(o),i)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Rj(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Le(e,l,"linePrefix")}function l(a){if(a===null||de(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function ox(e,t,n,r,i,l,a,o,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(y),e.exit(l),h):y===null||y===32||y===41||Ja(y)?n(y):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),k(y))}function h(y){return y===62?(e.enter(l),e.consume(y),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(o),h(y)):y===null||y===60||de(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function k(y){return!d&&(y===null||y===41||Ue(y))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(y)):d<u&&y===40?(e.consume(y),d++,k):y===41?(e.consume(y),d--,k):y===null||y===32||y===40||Ja(y)?n(y):(e.consume(y),y===92?v:k)}function v(y){return y===40||y===41||y===92?(e.consume(y),k):k(y)}}function cx(e,t,n,r,i,l){const a=this;let o=0,c;return u;function u(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(l),d}function d(m){return o>999||m===null||m===91||m===93&&!c||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(l),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):de(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||de(m)||o++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!Ce(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),o++,f):f(m)}}function ux(e,t,n,r,i,l){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,c):n(h)}function c(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(l),u(h))}function u(h){return h===a?(e.exit(l),c(a)):h===null?n(h):de(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Le(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||de(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function Ks(e,t){let n;return r;function r(i){return de(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ce(i)?Le(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const $j={name:"definition",tokenize:Oj},Fj={partial:!0,tokenize:Uj};function Oj(e,t,n){const r=this;let i;return l;function l(m){return e.enter("definition"),a(m)}function a(m){return cx.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=In(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return Ue(m)?Ks(e,u)(m):u(m)}function u(m){return ox(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(Fj,f,f)(m)}function f(m){return Ce(m)?Le(e,h,"whitespace")(m):h(m)}function h(m){return m===null||de(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function Uj(e,t,n){return r;function r(o){return Ue(o)?Ks(e,i)(o):n(o)}function i(o){return ux(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return Ce(o)?Le(e,a,"whitespace")(o):a(o)}function a(o){return o===null||de(o)?t(o):n(o)}}const Bj={name:"hardBreakEscape",tokenize:Hj};function Hj(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return de(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const Vj={name:"headingAtx",resolve:Wj,tokenize:Gj};function Wj(e,t){let n=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},an(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])),e}function Gj(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),l(d)}function l(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||Ue(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||de(d)?(e.exit("atxHeading"),t(d)):Ce(d)?Le(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||Ue(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const qj=["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"],rh=["pre","script","style","textarea"],Qj={concrete:!0,name:"htmlFlow",resolveTo:Xj,tokenize:Jj},Kj={partial:!0,tokenize:eS},Yj={partial:!0,tokenize:Zj};function Xj(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Jj(e,t,n){const r=this;let i,l,a,o,c;return u;function u(S){return d(S)}function d(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),f}function f(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),l=!0,k):S===63?(e.consume(S),i=3,r.interrupt?t:b):Ft(S)?(e.consume(S),a=String.fromCharCode(S),v):n(S)}function h(S){return S===45?(e.consume(S),i=2,m):S===91?(e.consume(S),i=5,o=0,g):Ft(S)?(e.consume(S),i=4,r.interrupt?t:b):n(S)}function m(S){return S===45?(e.consume(S),r.interrupt?t:b):n(S)}function g(S){const ie="CDATA[";return S===ie.charCodeAt(o++)?(e.consume(S),o===ie.length?r.interrupt?t:O:g):n(S)}function k(S){return Ft(S)?(e.consume(S),a=String.fromCharCode(S),v):n(S)}function v(S){if(S===null||S===47||S===62||Ue(S)){const ie=S===47,ye=a.toLowerCase();return!ie&&!l&&rh.includes(ye)?(i=1,r.interrupt?t(S):O(S)):qj.includes(a.toLowerCase())?(i=6,ie?(e.consume(S),y):r.interrupt?t(S):O(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):l?w(S):j(S))}return S===45||Lt(S)?(e.consume(S),a+=String.fromCharCode(S),v):n(S)}function y(S){return S===62?(e.consume(S),r.interrupt?t:O):n(S)}function w(S){return Ce(S)?(e.consume(S),w):N(S)}function j(S){return S===47?(e.consume(S),N):S===58||S===95||Ft(S)?(e.consume(S),z):Ce(S)?(e.consume(S),j):N(S)}function z(S){return S===45||S===46||S===58||S===95||Lt(S)?(e.consume(S),z):D(S)}function D(S){return S===61?(e.consume(S),C):Ce(S)?(e.consume(S),D):j(S)}function C(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),c=S,A):Ce(S)?(e.consume(S),C):_(S)}function A(S){return S===c?(e.consume(S),c=null,I):S===null||de(S)?n(S):(e.consume(S),A)}function _(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||Ue(S)?D(S):(e.consume(S),_)}function I(S){return S===47||S===62||Ce(S)?j(S):n(S)}function N(S){return S===62?(e.consume(S),U):n(S)}function U(S){return S===null||de(S)?O(S):Ce(S)?(e.consume(S),U):n(S)}function O(S){return S===45&&i===2?(e.consume(S),le):S===60&&i===1?(e.consume(S),fe):S===62&&i===4?(e.consume(S),X):S===63&&i===3?(e.consume(S),b):S===93&&i===5?(e.consume(S),P):de(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Kj,H,re)(S)):S===null||de(S)?(e.exit("htmlFlowData"),re(S)):(e.consume(S),O)}function re(S){return e.check(Yj,oe,H)(S)}function oe(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),te}function te(S){return S===null||de(S)?re(S):(e.enter("htmlFlowData"),O(S))}function le(S){return S===45?(e.consume(S),b):O(S)}function fe(S){return S===47?(e.consume(S),a="",T):O(S)}function T(S){if(S===62){const ie=a.toLowerCase();return rh.includes(ie)?(e.consume(S),X):O(S)}return Ft(S)&&a.length<8?(e.consume(S),a+=String.fromCharCode(S),T):O(S)}function P(S){return S===93?(e.consume(S),b):O(S)}function b(S){return S===62?(e.consume(S),X):S===45&&i===2?(e.consume(S),b):O(S)}function X(S){return S===null||de(S)?(e.exit("htmlFlowData"),H(S)):(e.consume(S),X)}function H(S){return e.exit("htmlFlow"),t(S)}}function Zj(e,t,n){const r=this;return i;function i(a){return de(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l):n(a)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function eS(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(_l,t,n)}}const tS={name:"htmlText",tokenize:nS};function nS(e,t,n){const r=this;let i,l,a;return o;function o(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),c}function c(b){return b===33?(e.consume(b),u):b===47?(e.consume(b),D):b===63?(e.consume(b),j):Ft(b)?(e.consume(b),_):n(b)}function u(b){return b===45?(e.consume(b),d):b===91?(e.consume(b),l=0,g):Ft(b)?(e.consume(b),w):n(b)}function d(b){return b===45?(e.consume(b),m):n(b)}function f(b){return b===null?n(b):b===45?(e.consume(b),h):de(b)?(a=f,fe(b)):(e.consume(b),f)}function h(b){return b===45?(e.consume(b),m):f(b)}function m(b){return b===62?le(b):b===45?h(b):f(b)}function g(b){const X="CDATA[";return b===X.charCodeAt(l++)?(e.consume(b),l===X.length?k:g):n(b)}function k(b){return b===null?n(b):b===93?(e.consume(b),v):de(b)?(a=k,fe(b)):(e.consume(b),k)}function v(b){return b===93?(e.consume(b),y):k(b)}function y(b){return b===62?le(b):b===93?(e.consume(b),y):k(b)}function w(b){return b===null||b===62?le(b):de(b)?(a=w,fe(b)):(e.consume(b),w)}function j(b){return b===null?n(b):b===63?(e.consume(b),z):de(b)?(a=j,fe(b)):(e.consume(b),j)}function z(b){return b===62?le(b):j(b)}function D(b){return Ft(b)?(e.consume(b),C):n(b)}function C(b){return b===45||Lt(b)?(e.consume(b),C):A(b)}function A(b){return de(b)?(a=A,fe(b)):Ce(b)?(e.consume(b),A):le(b)}function _(b){return b===45||Lt(b)?(e.consume(b),_):b===47||b===62||Ue(b)?I(b):n(b)}function I(b){return b===47?(e.consume(b),le):b===58||b===95||Ft(b)?(e.consume(b),N):de(b)?(a=I,fe(b)):Ce(b)?(e.consume(b),I):le(b)}function N(b){return b===45||b===46||b===58||b===95||Lt(b)?(e.consume(b),N):U(b)}function U(b){return b===61?(e.consume(b),O):de(b)?(a=U,fe(b)):Ce(b)?(e.consume(b),U):I(b)}function O(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,re):de(b)?(a=O,fe(b)):Ce(b)?(e.consume(b),O):(e.consume(b),oe)}function re(b){return b===i?(e.consume(b),i=void 0,te):b===null?n(b):de(b)?(a=re,fe(b)):(e.consume(b),re)}function oe(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||Ue(b)?I(b):(e.consume(b),oe)}function te(b){return b===47||b===62||Ue(b)?I(b):n(b)}function le(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function fe(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),T}function T(b){return Ce(b)?Le(e,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):P(b)}function P(b){return e.enter("htmlTextData"),a(b)}}const Od={name:"labelEnd",resolveAll:lS,resolveTo:aS,tokenize:oS},rS={tokenize:cS},iS={tokenize:uS},sS={tokenize:dS};function lS(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&an(e,0,e.length,n),e}function aS(e,t){let n=e.length,r=0,i,l,a,o;for(;n--;)if(i=e[n][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const c={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[l][1].start},end:{...e[a][1].end}},d={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",c,t],["enter",u,t]],o=hn(o,e.slice(l+1,l+r+3)),o=hn(o,[["enter",d,t]]),o=hn(o,_o(t.parser.constructs.insideSpan.null,e.slice(l+r+4,a-3),t)),o=hn(o,[["exit",d,t],e[a-2],e[a-1],["exit",u,t]]),o=hn(o,e.slice(a+1)),o=hn(o,[["exit",c,t]]),an(e,l,e.length,o),e}function oS(e,t,n){const r=this;let i=r.events.length,l,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return o;function o(h){return l?l._inactive?f(h):(a=r.parser.defined.includes(In(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(rS,d,a?d:f)(h):h===91?e.attempt(iS,d,a?u:f)(h):a?d(h):f(h)}function u(h){return e.attempt(sS,d,f)(h)}function d(h){return t(h)}function f(h){return l._balanced=!0,n(h)}}function cS(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Ue(f)?Ks(e,l)(f):l(f)}function l(f){return f===41?d(f):ox(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return Ue(f)?Ks(e,c)(f):d(f)}function o(f){return n(f)}function c(f){return f===34||f===39||f===40?ux(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return Ue(f)?Ks(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function uS(e,t,n){const r=this;return i;function i(o){return cx.call(r,e,l,a,"reference","referenceMarker","referenceString")(o)}function l(o){return r.parser.defined.includes(In(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function dS(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const fS={name:"labelStartImage",resolveAll:Od.resolveAll,tokenize:mS};function mS(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),l}function l(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const hS={name:"labelStartLink",resolveAll:Od.resolveAll,tokenize:pS};function pS(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),l}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const cc={name:"lineEnding",tokenize:gS};function gS(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Le(e,t,"linePrefix")}}const ka={name:"thematicBreak",tokenize:yS};function yS(e,t,n){let r=0,i;return l;function l(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||de(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Ce(u)?Le(e,o,"whitespace")(u):o(u))}}const Wt={continuation:{tokenize:wS},exit:jS,name:"list",tokenize:kS},xS={partial:!0,tokenize:SS},vS={partial:!0,tokenize:bS};function kS(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:ju(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(ka,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return ju(m)&&++a<10?(e.consume(m),c):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(_l,r.interrupt?n:d,e.attempt(xS,h,f))}function d(m){return r.containerState.initialBlankLine=!0,l++,h(m)}function f(m){return Ce(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function wS(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_l,i,l);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Le(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!Ce(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vS,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Le(e,e.attempt(Wt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function bS(e,t,n){const r=this;return Le(e,i,"listItemIndent",r.containerState.size+1);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(l):n(l)}}function jS(e){e.exit(this.containerState.type)}function SS(e,t,n){const r=this;return Le(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const a=r.events[r.events.length-1];return!Ce(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const ih={name:"setextUnderline",resolveTo:NS,tokenize:CS};function NS(e,t){let n=e.length,r,i,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",a,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function CS(e,t,n){const r=this;let i;return l;function l(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),Ce(u)?Le(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||de(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const _S={tokenize:ES};function ES(e){const t=this,n=e.attempt(_l,r,e.attempt(this.parser.constructs.flowInitial,i,Le(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Dj,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const TS={resolveAll:fx()},zS=dx("string"),AS=dx("text");function dx(e){return{resolveAll:fx(e==="text"?LS:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,a,o);return a;function a(d){return u(d)?l(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),l(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=i[d];let h=-1;if(f)for(;++h<f.length;){const m=f[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function fx(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function LS(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let l=i.length,a=-1,o=0,c;for(;l--;){const u=i[l];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)c=!0,o++;else if(u!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?a:r.start._bufferIndex+a,_index:r.start._index+l,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const DS={42:Wt,43:Wt,45:Wt,48:Wt,49:Wt,50:Wt,51:Wt,52:Wt,53:Wt,54:Wt,55:Wt,56:Wt,57:Wt,62:ix},IS={91:$j},PS={[-2]:oc,[-1]:oc,32:oc},MS={35:Vj,42:ka,45:[ih,ka],60:Qj,61:ih,95:ka,96:nh,126:nh},RS={38:lx,92:sx},$S={[-5]:cc,[-4]:cc,[-3]:cc,33:fS,38:lx,42:Su,60:[hj,tS],91:hS,92:[Bj,sx],93:Od,95:Su,96:_j},FS={null:[Su,TS]},OS={null:[42,95]},US={null:[]},BS=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:OS,contentInitial:IS,disable:US,document:DS,flow:MS,flowInitial:PS,insideSpan:FS,string:RS,text:$S},Symbol.toStringTag,{value:"Module"}));function HS(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let a=[],o=[];const c={attempt:A(D),check:A(C),consume:w,enter:j,exit:z,interrupt:A(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:k,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:m,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&l.push(t),u;function f(U){return a=hn(a,U),v(),a[a.length-1]!==null?[]:(_(t,0),u.events=_o(l,u.events,u),u.events)}function h(U,O){return WS(m(U),O)}function m(U){return VS(a,U)}function g(){const{_bufferIndex:U,_index:O,line:re,column:oe,offset:te}=r;return{_bufferIndex:U,_index:O,line:re,column:oe,offset:te}}function k(U){i[U.line]=U.column,N()}function v(){let U;for(;r._index<a.length;){const O=a[r._index];if(typeof O=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<O.length;)y(O.charCodeAt(r._bufferIndex));else y(O)}}function y(U){d=d(U)}function w(U){de(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,N()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=U}function j(U,O){const re=O||{};return re.type=U,re.start=g(),u.events.push(["enter",re,u]),o.push(re),re}function z(U){const O=o.pop();return O.end=g(),u.events.push(["exit",O,u]),O}function D(U,O){_(U,O.from)}function C(U,O){O.restore()}function A(U,O){return re;function re(oe,te,le){let fe,T,P,b;return Array.isArray(oe)?H(oe):"tokenize"in oe?H([oe]):X(oe);function X(ae){return je;function je(Ge){const qe=Ge!==null&&ae[Ge],Xe=Ge!==null&&ae.null,M=[...Array.isArray(qe)?qe:qe?[qe]:[],...Array.isArray(Xe)?Xe:Xe?[Xe]:[]];return H(M)(Ge)}}function H(ae){return fe=ae,T=0,ae.length===0?le:S(ae[T])}function S(ae){return je;function je(Ge){return b=I(),P=ae,ae.partial||(u.currentConstruct=ae),ae.name&&u.parser.constructs.disable.null.includes(ae.name)?ye():ae.tokenize.call(O?Object.assign(Object.create(u),O):u,c,ie,ye)(Ge)}}function ie(ae){return U(P,b),te}function ye(ae){return b.restore(),++T<fe.length?S(fe[T]):le}}}function _(U,O){U.resolveAll&&!l.includes(U)&&l.push(U),U.resolve&&an(u.events,O,u.events.length-O,U.resolve(u.events.slice(O),u)),U.resolveTo&&(u.events=U.resolveTo(u.events,u))}function I(){const U=g(),O=u.previous,re=u.currentConstruct,oe=u.events.length,te=Array.from(o);return{from:oe,restore:le};function le(){r=U,u.previous=O,u.currentConstruct=re,u.events.length=oe,o=te,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function VS(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,l)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}l>0&&a.push(e[i].slice(0,l))}return a}function WS(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let a;if(typeof l=="string")a=l;else switch(l){case-5:{a="\r";break}case-4:{a=`
|
|
505
|
+
`;break}case-3:{a=`\r
|
|
506
|
+
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(l)}i=l===-2,r.push(a)}return r.join("")}function GS(e){const r={constructs:nx([BS,...(e||{}).extensions||[]]),content:i(aj),defined:[],document:i(cj),flow:i(_S),lazy:{},string:i(zS),text:i(AS)};return r;function i(l){return a;function a(o){return HS(r,l,o)}}}function qS(e){for(;!ax(e););return e}const sh=/[\0\t\n\r]/g;function QS(){let e=1,t="",n=!0,r;return i;function i(l,a,o){const c=[];let u,d,f,h,m;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(a||void 0).decode(l)),f=0,t="",n&&(l.charCodeAt(0)===65279&&f++,n=void 0);f<l.length;){if(sh.lastIndex=f,u=sh.exec(l),h=u&&u.index!==void 0?u.index:l.length,m=l.charCodeAt(h),!u){t=l.slice(f);break}if(m===10&&f===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),f<h&&(c.push(l.slice(f,h)),e+=h-f),m){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const KS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function YS(e){return e.replace(KS,XS)}function XS(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return rx(n.slice(l?2:1),l?16:10)}return Fd(n)||e}const mx={}.hasOwnProperty;function JS(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ZS(n)(qS(GS(n).document().write(QS()(e,t,!0))))}function ZS(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(ze),autolinkProtocol:I,autolinkEmail:I,atxHeading:l(ge),blockQuote:l(Xe),characterEscape:I,characterReference:I,codeFenced:l(M),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:l(M,a),codeText:l(R,a),codeTextData:I,data:I,codeFlowValue:I,definition:l(B),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:l(pe),hardBreakEscape:l(ce),hardBreakTrailing:l(ce),htmlFlow:l(we,a),htmlFlowData:I,htmlText:l(we,a),htmlTextData:I,image:l(G),label:a,link:l(ze),listItem:l(Qe),listItemValue:h,listOrdered:l(Te,f),listUnordered:l(Te),paragraph:l(Se),reference:S,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:l(ge),strong:l(Fe),thematicBreak:l(Mn)},exit:{atxHeading:c(),atxHeadingSequence:D,autolink:c(),autolinkEmail:qe,autolinkProtocol:Ge,blockQuote:c(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:ae,characterReference:je,codeFenced:c(v),codeFencedFence:k,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:N,codeIndented:c(y),codeText:c(te),codeTextData:N,data:N,definition:c(),definitionDestinationString:z,definitionLabelString:w,definitionTitleString:j,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(re),htmlFlowData:N,htmlText:c(oe),htmlTextData:N,image:c(fe),label:P,labelText:T,lineEnding:U,link:c(le),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:b,resourceTitleString:X,resource:H,setextHeading:c(_),setextHeadingLineSequence:A,setextHeadingText:C,strong:c(),thematicBreak:c()}};hx(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(F){let K={type:"root",children:[]};const ue={stack:[K],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:d,data:n},ke=[];let Ne=-1;for(;++Ne<F.length;)if(F[Ne][1].type==="listOrdered"||F[Ne][1].type==="listUnordered")if(F[Ne][0]==="enter")ke.push(Ne);else{const wt=ke.pop();Ne=i(F,wt,Ne)}for(Ne=-1;++Ne<F.length;){const wt=t[F[Ne][0]];mx.call(wt,F[Ne][1].type)&&wt[F[Ne][1].type].call(Object.assign({sliceSerialize:F[Ne][2].sliceSerialize},ue),F[Ne][1])}if(ue.tokenStack.length>0){const wt=ue.tokenStack[ue.tokenStack.length-1];(wt[1]||lh).call(ue,void 0,wt[0])}for(K.position={start:Nr(F.length>0?F[0][1].start:{line:1,column:1,offset:0}),end:Nr(F.length>0?F[F.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<t.transforms.length;)K=t.transforms[Ne](K)||K;return K}function i(F,K,ue){let ke=K-1,Ne=-1,wt=!1,gt,Ke,Pt,Jt;for(;++ke<=ue;){const it=F[ke];switch(it[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{it[0]==="enter"?Ne++:Ne--,Jt=void 0;break}case"lineEndingBlank":{it[0]==="enter"&&(gt&&!Jt&&!Ne&&!Pt&&(Pt=ke),Jt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Jt=void 0}if(!Ne&&it[0]==="enter"&&it[1].type==="listItemPrefix"||Ne===-1&&it[0]==="exit"&&(it[1].type==="listUnordered"||it[1].type==="listOrdered")){if(gt){let Mt=ke;for(Ke=void 0;Mt--;){const bt=F[Mt];if(bt[1].type==="lineEnding"||bt[1].type==="lineEndingBlank"){if(bt[0]==="exit")continue;Ke&&(F[Ke][1].type="lineEndingBlank",wt=!0),bt[1].type="lineEnding",Ke=Mt}else if(!(bt[1].type==="linePrefix"||bt[1].type==="blockQuotePrefix"||bt[1].type==="blockQuotePrefixWhitespace"||bt[1].type==="blockQuoteMarker"||bt[1].type==="listItemIndent"))break}Pt&&(!Ke||Pt<Ke)&&(gt._spread=!0),gt.end=Object.assign({},Ke?F[Ke][1].start:it[1].end),F.splice(Ke||ke,0,["exit",gt,it[2]]),ke++,ue++}if(it[1].type==="listItemPrefix"){const Mt={type:"listItem",_spread:!1,start:Object.assign({},it[1].start),end:void 0};gt=Mt,F.splice(ke,0,["enter",Mt,it[2]]),ke++,ue++,Pt=void 0,Jt=!0}}}return F[K][1]._spread=wt,ue}function l(F,K){return ue;function ue(ke){o.call(this,F(ke),ke),K&&K.call(this,ke)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(F,K,ue){this.stack[this.stack.length-1].children.push(F),this.stack.push(F),this.tokenStack.push([K,ue||void 0]),F.position={start:Nr(K.start),end:void 0}}function c(F){return K;function K(ue){F&&F.call(this,ue),u.call(this,ue)}}function u(F,K){const ue=this.stack.pop(),ke=this.tokenStack.pop();if(ke)ke[0].type!==F.type&&(K?K.call(this,F,ke[0]):(ke[1]||lh).call(this,F,ke[0]));else throw new Error("Cannot close `"+F.type+"` ("+Qs({start:F.start,end:F.end})+"): it’s not open");ue.position.end=Nr(F.end)}function d(){return $d(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(F){if(this.data.expectingFirstListItemValue){const K=this.stack[this.stack.length-2];K.start=Number.parseInt(this.sliceSerialize(F),10),this.data.expectingFirstListItemValue=void 0}}function m(){const F=this.resume(),K=this.stack[this.stack.length-1];K.lang=F}function g(){const F=this.resume(),K=this.stack[this.stack.length-1];K.meta=F}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const F=this.resume(),K=this.stack[this.stack.length-1];K.value=F.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const F=this.resume(),K=this.stack[this.stack.length-1];K.value=F.replace(/(\r?\n|\r)$/g,"")}function w(F){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.label=K,ue.identifier=In(this.sliceSerialize(F)).toLowerCase()}function j(){const F=this.resume(),K=this.stack[this.stack.length-1];K.title=F}function z(){const F=this.resume(),K=this.stack[this.stack.length-1];K.url=F}function D(F){const K=this.stack[this.stack.length-1];if(!K.depth){const ue=this.sliceSerialize(F).length;K.depth=ue}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function A(F){const K=this.stack[this.stack.length-1];K.depth=this.sliceSerialize(F).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function I(F){const ue=this.stack[this.stack.length-1].children;let ke=ue[ue.length-1];(!ke||ke.type!=="text")&&(ke=Ht(),ke.position={start:Nr(F.start),end:void 0},ue.push(ke)),this.stack.push(ke)}function N(F){const K=this.stack.pop();K.value+=this.sliceSerialize(F),K.position.end=Nr(F.end)}function U(F){const K=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=K.children[K.children.length-1];ue.position.end=Nr(F.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(K.type)&&(I.call(this,F),N.call(this,F))}function O(){this.data.atHardBreak=!0}function re(){const F=this.resume(),K=this.stack[this.stack.length-1];K.value=F}function oe(){const F=this.resume(),K=this.stack[this.stack.length-1];K.value=F}function te(){const F=this.resume(),K=this.stack[this.stack.length-1];K.value=F}function le(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=K,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function fe(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=K,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function T(F){const K=this.sliceSerialize(F),ue=this.stack[this.stack.length-2];ue.label=YS(K),ue.identifier=In(K).toLowerCase()}function P(){const F=this.stack[this.stack.length-1],K=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const ke=F.children;ue.children=ke}else ue.alt=K}function b(){const F=this.resume(),K=this.stack[this.stack.length-1];K.url=F}function X(){const F=this.resume(),K=this.stack[this.stack.length-1];K.title=F}function H(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function ie(F){const K=this.resume(),ue=this.stack[this.stack.length-1];ue.label=K,ue.identifier=In(this.sliceSerialize(F)).toLowerCase(),this.data.referenceType="full"}function ye(F){this.data.characterReferenceType=F.type}function ae(F){const K=this.sliceSerialize(F),ue=this.data.characterReferenceType;let ke;ue?(ke=rx(K,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ke=Fd(K);const Ne=this.stack[this.stack.length-1];Ne.value+=ke}function je(F){const K=this.stack.pop();K.position.end=Nr(F.end)}function Ge(F){N.call(this,F);const K=this.stack[this.stack.length-1];K.url=this.sliceSerialize(F)}function qe(F){N.call(this,F);const K=this.stack[this.stack.length-1];K.url="mailto:"+this.sliceSerialize(F)}function Xe(){return{type:"blockquote",children:[]}}function M(){return{type:"code",lang:null,meta:null,value:""}}function R(){return{type:"inlineCode",value:""}}function B(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function pe(){return{type:"emphasis",children:[]}}function ge(){return{type:"heading",depth:0,children:[]}}function ce(){return{type:"break"}}function we(){return{type:"html",value:""}}function G(){return{type:"image",title:null,url:"",alt:null}}function ze(){return{type:"link",title:null,url:"",children:[]}}function Te(F){return{type:"list",ordered:F.type==="listOrdered",start:null,spread:F._spread,children:[]}}function Qe(F){return{type:"listItem",spread:F._spread,checked:null,children:[]}}function Se(){return{type:"paragraph",children:[]}}function Fe(){return{type:"strong",children:[]}}function Ht(){return{type:"text",value:""}}function Mn(){return{type:"thematicBreak"}}}function Nr(e){return{line:e.line,column:e.column,offset:e.offset}}function hx(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?hx(e,r):eN(e,r)}}function eN(e,t){let n;for(n in t)if(mx.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function lh(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Qs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Qs({start:t.start,end:t.end})+") is still open")}function tN(e){const t=this;t.parser=n;function n(r){return JS(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function nN(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function rN(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
507
|
+
`}]}function iN(e,t){const n=t.value?t.value+`
|
|
508
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function sN(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lN(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aN(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=fs(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=l+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function oN(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cN(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function px(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function uN(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return px(e,t);const i={src:fs(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)}function dN(e,t){const n={src:fs(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function fN(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function mN(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return px(e,t);const i={href:fs(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function hN(e,t){const n={href:fs(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pN(e,t,n){const r=e.all(t),i=n?gN(n):gx(t),l={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
|
|
509
|
+
`}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
|
|
510
|
+
`});const u={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,u),e.applyData(t,u)}function gN(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=gx(n[r])}return t}function gx(e){const t=e.spread;return t??e.children.length>1}function yN(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function xN(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vN(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function kN(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wN(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Id(t.children[1]),c=Ky(t.children[t.children.length-1]);o&&c&&(a.position={start:o,end:c}),i.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)}function bN(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let c=-1;const u=[];for(;++c<o;){const f=t.children[c],h={},m=a?a[c]:void 0;m&&(h.align=m);let g={type:"element",tagName:l,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),u.push(g)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function jN(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ah=9,oh=32;function SN(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const l=[];for(;r;)l.push(ch(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(ch(t.slice(i),i>0,!1)),l.join("")}function ch(e,t,n){let r=0,i=e.length;if(t){let l=e.codePointAt(r);for(;l===ah||l===oh;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(i-1);for(;l===ah||l===oh;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function NN(e,t){const n={type:"text",value:SN(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function CN(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const _N={blockquote:nN,break:rN,code:iN,delete:sN,emphasis:lN,footnoteReference:aN,heading:oN,html:cN,imageReference:uN,image:dN,inlineCode:fN,linkReference:mN,link:hN,listItem:pN,list:yN,paragraph:xN,root:vN,strong:kN,table:wN,tableCell:jN,tableRow:bN,text:NN,thematicBreak:CN,toml:Zl,yaml:Zl,definition:Zl,footnoteDefinition:Zl};function Zl(){}const yx=-1,Eo=0,Ys=1,Za=2,Ud=3,Bd=4,Hd=5,Vd=6,xx=7,vx=8,uh=typeof self=="object"?self:globalThis,EN=(e,t)=>{const n=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,a]=t[i];switch(l){case Eo:case yx:return n(a,i);case Ys:{const o=n([],i);for(const c of a)o.push(r(c));return o}case Za:{const o=n({},i);for(const[c,u]of a)o[r(c)]=r(u);return o}case Ud:return n(new Date(a),i);case Bd:{const{source:o,flags:c}=a;return n(new RegExp(o,c),i)}case Hd:{const o=n(new Map,i);for(const[c,u]of a)o.set(r(c),r(u));return o}case Vd:{const o=n(new Set,i);for(const c of a)o.add(r(c));return o}case xx:{const{name:o,message:c}=a;return n(new uh[o](c),i)}case vx:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new uh[l](a),i)};return r},dh=e=>EN(new Map,e)(0),ki="",{toString:TN}={},{keys:zN}=Object,Ls=e=>{const t=typeof e;if(t!=="object"||!e)return[Eo,t];const n=TN.call(e).slice(8,-1);switch(n){case"Array":return[Ys,ki];case"Object":return[Za,ki];case"Date":return[Ud,ki];case"RegExp":return[Bd,ki];case"Map":return[Hd,ki];case"Set":return[Vd,ki];case"DataView":return[Ys,n]}return n.includes("Array")?[Ys,n]:n.includes("Error")?[xx,n]:[Za,n]},ea=([e,t])=>e===Eo&&(t==="function"||t==="symbol"),AN=(e,t,n,r)=>{const i=(a,o)=>{const c=r.push(a)-1;return n.set(o,c),c},l=a=>{if(n.has(a))return n.get(a);let[o,c]=Ls(a);switch(o){case Eo:{let d=a;switch(c){case"bigint":o=vx,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([yx],a)}return i([o,d],a)}case Ys:{if(c){let h=a;return c==="DataView"?h=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(a)),i([c,[...h]],a)}const d=[],f=i([o,d],a);for(const h of a)d.push(l(h));return f}case Za:{if(c)switch(c){case"BigInt":return i([c,a.toString()],a);case"Boolean":case"Number":case"String":return i([c,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const d=[],f=i([o,d],a);for(const h of zN(a))(e||!ea(Ls(a[h])))&&d.push([l(h),l(a[h])]);return f}case Ud:return i([o,a.toISOString()],a);case Bd:{const{source:d,flags:f}=a;return i([o,{source:d,flags:f}],a)}case Hd:{const d=[],f=i([o,d],a);for(const[h,m]of a)(e||!(ea(Ls(h))||ea(Ls(m))))&&d.push([l(h),l(m)]);return f}case Vd:{const d=[],f=i([o,d],a);for(const h of a)(e||!ea(Ls(h)))&&d.push(l(h));return f}}const{message:u}=a;return i([o,{name:c,message:u}],a)};return l},fh=(e,{json:t,lossy:n}={})=>{const r=[];return AN(!(t||n),!!t,new Map,r)(e),r},eo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?dh(fh(e,t)):structuredClone(e):(e,t)=>dh(fh(e,t));function LN(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function DN(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function IN(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||LN,r=e.options.footnoteBackLabel||DN,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),f=String(u.identifier).toUpperCase(),h=fs(f.toLowerCase());let m=0;const g=[],k=e.footnoteCounts.get(f);for(;k!==void 0&&++m<=k;){g.length>0&&g.push({type:"text",value:" "});let w=typeof n=="string"?n:n(c,m);typeof w=="string"&&(w={type:"text",value:w}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...eo(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
511
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
512
|
+
`}]}}const To=function(e){if(e==null)return $N;if(typeof e=="function")return zo(e);if(typeof e=="object")return Array.isArray(e)?PN(e):MN(e);if(typeof e=="string")return RN(e);throw new Error("Expected function, string, or object as test")};function PN(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=To(e[n]);return zo(r);function r(...i){let l=-1;for(;++l<t.length;)if(t[l].apply(this,i))return!0;return!1}}function MN(e){const t=e;return zo(n);function n(r){const i=r;let l;for(l in e)if(i[l]!==t[l])return!1;return!0}}function RN(e){return zo(t);function t(n){return n&&n.type===e}}function zo(e){return t;function t(n,r,i){return!!(FN(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function $N(){return!0}function FN(e){return e!==null&&typeof e=="object"&&"type"in e}const kx=[],ON=!0,Nu=!1,UN="skip";function wx(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const l=To(i),a=r?-1:1;o(e,void 0,[])();function o(c,u,d){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const m=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=kx,g,k,v;if((!t||l(c,u,d[d.length-1]||void 0))&&(m=BN(n(c,d)),m[0]===Nu))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==UN)for(k=(r?y.children.length:-1)+a,v=d.concat(y);k>-1&&k<y.children.length;){const w=y.children[k];if(g=o(w,k,v)(),g[0]===Nu)return g;k=typeof g[1]=="number"?g[1]:k+a}}return m}}}function BN(e){return Array.isArray(e)?e:typeof e=="number"?[ON,e]:e==null?kx:[e]}function Wd(e,t,n,r){let i,l,a;typeof t=="function"&&typeof n!="function"?(l=void 0,a=t,i=n):(l=t,a=n,i=r),wx(e,l,o,i);function o(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return a(c,f,d)}}const Cu={}.hasOwnProperty,HN={};function VN(e,t){const n=t||HN,r=new Map,i=new Map,l=new Map,a={..._N,...n.handlers},o={all:u,applyData:GN,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:a,one:c,options:n,patch:WN,wrap:QN};return Wd(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),o;function c(d,f){const h=d.type,m=o.handlers[h];if(Cu.call(o.handlers,h)&&m)return m(o,d,f);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in d){const{children:k,...v}=d,y=eo(v);return y.children=o.all(d),y}return eo(d)}return(o.options.unknownHandler||qN)(o,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let m=-1;for(;++m<h.length;){const g=o.one(h[m],d);if(g){if(m&&h[m-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=mh(g.value)),!Array.isArray(g)&&g.type==="element")){const k=g.children[0];k&&k.type==="text"&&(k.value=mh(k.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function WN(e,t){e.position&&(t.position=Db(e))}function GN(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&l&&Object.assign(n.properties,eo(l)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function qN(e,t){const n=t.data||{},r="value"in t&&!(Cu.call(n,"hProperties")||Cu.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function QN(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
513
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
514
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
515
|
+
`}),n}function mh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function hh(e,t){const n=VN(e,t),r=n.one(e,void 0),i=IN(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
516
|
+
`},i),l}function KN(e,t){return e&&"run"in e?async function(n,r){const i=hh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return hh(n,{file:r,...e||t})}}function ph(e){if(e)throw e}var wa=Object.prototype.hasOwnProperty,bx=Object.prototype.toString,gh=Object.defineProperty,yh=Object.getOwnPropertyDescriptor,xh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):bx.call(t)==="[object Array]"},vh=function(t){if(!t||bx.call(t)!=="[object Object]")return!1;var n=wa.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&wa.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||wa.call(t,i)},kh=function(t,n){gh&&n.name==="__proto__"?gh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},wh=function(t,n){if(n==="__proto__")if(wa.call(t,n)){if(yh)return yh(t,n).value}else return;return t[n]},YN=function e(){var t,n,r,i,l,a,o=arguments[0],c=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},c=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=wh(o,n),i=wh(t,n),o!==i&&(d&&i&&(vh(i)||(l=xh(i)))?(l?(l=!1,a=r&&xh(r)?r:[]):a=r&&vh(r)?r:{},kh(o,{name:n,newValue:e(d,a,i)})):typeof i<"u"&&kh(o,{name:n,newValue:i}));return o};const uc=io(YN);function _u(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function XN(){const e=[],t={run:n,use:r};return t;function n(...i){let l=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(c,...u){const d=e[++l];let f=-1;if(c){a(c);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,d?JN(d,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function JN(e,t){let n;return r;function r(...a){const o=e.length>a.length;let c;o&&a.push(i);try{c=e.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return i(d)}o||(c&&c.then&&typeof c.then=="function"?c.then(l,i):c instanceof Error?i(c):l(c))}function i(a,...o){n||(n=!0,t(a,...o))}function l(a){i(null,a)}}const On={basename:ZN,dirname:e2,extname:t2,join:n2,sep:"/"};function ZN(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');El(e);let n=0,r=-1,i=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){n=i+1;break}}else a<0&&(l=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function e2(e){if(El(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function t2(e){El(e);let t=e.length,n=-1,r=0,i=-1,l=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||n<0||l===0||l===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function n2(...e){let t=-1,n;for(;++t<e.length;)El(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":r2(n)}function r2(e){El(e);const t=e.codePointAt(0)===47;let n=i2(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function i2(e,t){let n="",r=0,i=-1,l=0,a=-1,o,c;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||l===1))if(i!==a-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=a,l=0;continue}}else if(n.length>0){n="",r=0,i=a,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,l=0}else o===46&&l>-1?l++:l=-1}return n}function El(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const s2={cwd:l2};function l2(){return"/"}function Eu(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function a2(e){if(typeof e=="string")e=new URL(e);else if(!Eu(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return o2(e)}function o2(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const dc=["history","path","basename","stem","extname","dirname"];class jx{constructor(t){let n;t?Eu(t)?n={path:t}:typeof t=="string"||c2(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":s2.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<dc.length;){const l=dc[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let i;for(i in n)dc.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?On.basename(this.path):void 0}set basename(t){mc(t,"basename"),fc(t,"basename"),this.path=On.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?On.dirname(this.path):void 0}set dirname(t){bh(this.basename,"dirname"),this.path=On.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?On.extname(this.path):void 0}set extname(t){if(fc(t,"extname"),bh(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=On.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Eu(t)&&(t=a2(t)),mc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?On.basename(this.path,this.extname):void 0}set stem(t){mc(t,"stem"),fc(t,"stem"),this.path=On.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new It(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function fc(e,t){if(e&&e.includes(On.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+On.sep+"`")}function mc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function bh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function c2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const u2=function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},d2={}.hasOwnProperty;class Gd extends u2{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=XN()}copy(){const t=new Gd;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(uc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(gc("data",this.frozen),this.namespace[t]=n,this):d2.call(this.namespace,t)&&this.namespace[t]||void 0:t?(gc("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ta(t),r=this.parser||this.Parser;return hc("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),hc("process",this.parser||this.Parser),pc("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(l,a){const o=ta(t),c=r.parse(o);r.run(c,o,function(d,f,h){if(d||!f||!h)return u(d);const m=f,g=r.stringify(m,h);h2(g)?h.value=g:h.result=g,u(d,h)});function u(d,f){d||!f?a(d):l?l(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),hc("processSync",this.parser||this.Parser),pc("processSync",this.compiler||this.Compiler),this.process(t,i),Sh("processSync","process",n),r;function i(l,a){n=!0,ph(l),r=a}}run(t,n,r){jh(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(a,o){const c=ta(n);i.run(t,c,u);function u(d,f,h){const m=f||t;d?o(d):a?a(m):r(void 0,m,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,l),Sh("runSync","run",r),i;function l(a,o){ph(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=ta(n),i=this.compiler||this.Compiler;return pc("stringify",i),jh(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(gc("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;c(d,f)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))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");o(u.plugins),u.settings&&(i.settings=uc(!0,i.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];l(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...d]);else if(d.length>0){let[m,...g]=d;const k=r[h][1];_u(k)&&_u(m)&&(m=uc(!0,k,m)),r[h]=[u,m,...g]}}}}const f2=new Gd().freeze();function hc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function pc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function gc(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function jh(e){if(!_u(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Sh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ta(e){return m2(e)?e:new jx(e)}function m2(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function h2(e){return typeof e=="string"||p2(e)}function p2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const g2="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Nh=[],Ch={allowDangerousHtml:!0},y2=/^(https?|ircs?|mailto|xmpp)$/i,x2=[{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:"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 v2(e){const t=k2(e),n=w2(e);return b2(t.runSync(t.parse(n),n),e)}function k2(e){const t=e.rehypePlugins||Nh,n=e.remarkPlugins||Nh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Ch}:Ch;return f2().use(tN).use(n).use(KN,r).use(t)}function w2(e){const t=e.children||"",n=new jx;return typeof t=="string"&&(n.value=t),n}function b2(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,l=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||j2;for(const d of x2)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+g2+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Wd(e,u),$b(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in ac)if(Object.hasOwn(ac,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],k=ac[m];(k===null||k.includes(d.tagName))&&(d.properties[m]=c(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):l?l.includes(d.tagName):!1;if(!m&&r&&typeof f=="number"&&(m=!r(d,f,h)),m&&h&&typeof f=="number")return o&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function j2(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||y2.test(e.slice(0,t))?e:""}const S2=["script","iframe","object","embed","style"];function N2(e){if(!e)return"";if(e.startsWith("#")||e.startsWith("/"))return e;const t=e.indexOf(":");if(t===-1)return e;const n=e.slice(0,t).toLowerCase();return n==="https"||n==="http"||n==="mailto"?e:""}function _h(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function C2(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function _2(e,t,n){const i=To((n||{}).ignore||[]),l=E2(t);let a=-1;for(;++a<l.length;)wx(e,"text",o);function o(u,d){let f=-1,h;for(;++f<d.length;){const m=d[f],g=h?h.children:void 0;if(i(m,g?g.indexOf(m):void 0,h))return;h=m}if(h)return c(u,d)}function c(u,d){const f=d[d.length-1],h=l[a][0],m=l[a][1];let g=0;const v=f.children.indexOf(u);let y=!1,w=[];h.lastIndex=0;let j=h.exec(u.value);for(;j;){const z=j.index,D={index:j.index,input:j.input,stack:[...d,u]};let C=m(...j,D);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?h.lastIndex=z+1:(g!==z&&w.push({type:"text",value:u.value.slice(g,z)}),Array.isArray(C)?w.push(...C):C&&w.push(C),g=z+j[0].length,y=!0),!h.global)break;j=h.exec(u.value)}return y?(g<u.value.length&&w.push({type:"text",value:u.value.slice(g)}),f.children.splice(v,1,...w)):w=[u],v+w.length}}function E2(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([T2(i[0]),z2(i[1])])}return t}function T2(e){return typeof e=="string"?new RegExp(C2(e),"g"):e}function z2(e){return typeof e=="function"?e:function(){return e}}const yc="phrasing",xc=["autolink","link","image","label"];function A2(){return{transforms:[$2],enter:{literalAutolink:D2,literalAutolinkEmail:vc,literalAutolinkHttp:vc,literalAutolinkWww:vc},exit:{literalAutolink:R2,literalAutolinkEmail:M2,literalAutolinkHttp:I2,literalAutolinkWww:P2}}}function L2(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:yc,notInConstruct:xc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:yc,notInConstruct:xc},{character:":",before:"[ps]",after:"\\/",inConstruct:yc,notInConstruct:xc}]}}function D2(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function vc(e){this.config.enter.autolinkProtocol.call(this,e)}function I2(e){this.config.exit.autolinkProtocol.call(this,e)}function P2(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function M2(e){this.config.exit.autolinkEmail.call(this,e)}function R2(e){this.exit(e)}function $2(e){_2(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,F2],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),O2]],{ignore:["link","linkReference"]})}function F2(e,t,n,r,i){let l="";if(!Sx(i)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!U2(n)))return!1;const a=B2(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:l+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function O2(e,t,n,r){return!Sx(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function U2(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function B2(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=_h(e,"(");let l=_h(e,")");for(;r!==-1&&i>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function Sx(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||mi(n)||Co(n))&&(!t||n!==47)}Nx.peek=X2;function H2(){this.buffer()}function V2(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function W2(){this.buffer()}function G2(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function q2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=In(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Q2(e){this.exit(e)}function K2(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=In(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Y2(e){this.exit(e)}function X2(){return"["}function Nx(e,t,n,r){const i=n.createTracker(r);let l=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),a(),l+=i.move("]"),l}function J2(){return{enter:{gfmFootnoteCallString:H2,gfmFootnoteCall:V2,gfmFootnoteDefinitionLabelString:W2,gfmFootnoteDefinition:G2},exit:{gfmFootnoteCallString:q2,gfmFootnoteCall:Q2,gfmFootnoteDefinitionLabelString:K2,gfmFootnoteDefinition:Y2}}}function Z2(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Nx},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,l,a){const o=l.createTracker(a);let c=o.move("[^");const u=l.enter("footnoteDefinition"),d=l.enter("label");return c+=o.move(l.safe(l.associationId(r),{before:c,after:"]"})),d(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?`
|
|
517
|
+
`:" ")+l.indentLines(l.containerFlow(r,o.current()),t?Cx:eC))),u(),c}}function eC(e,t,n){return t===0?e:Cx(e,t,n)}function Cx(e,t,n){return(n?"":" ")+e}const tC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];_x.peek=lC;function nC(){return{canContainEols:["delete"],enter:{strikethrough:iC},exit:{strikethrough:sC}}}function rC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:tC}],handlers:{delete:_x}}}function iC(e){this.enter({type:"delete",children:[]},e)}function sC(e){this.exit(e)}function _x(e,t,n,r){const i=n.createTracker(r),l=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),l(),a}function lC(){return"~"}function aC(e){return e.length}function oC(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||aC,l=[],a=[],o=[],c=[];let u=0,d=-1;for(;++d<e.length;){const k=[],v=[];let y=-1;for(e[d].length>u&&(u=e[d].length);++y<e[d].length;){const w=cC(e[d][y]);if(n.alignDelimiters!==!1){const j=i(w);v[y]=j,(c[y]===void 0||j>c[y])&&(c[y]=j)}k.push(w)}a[d]=k,o[d]=v}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)l[f]=Eh(r[f]);else{const k=Eh(r);for(;++f<u;)l[f]=k}f=-1;const h=[],m=[];for(;++f<u;){const k=l[f];let v="",y="";k===99?(v=":",y=":"):k===108?v=":":k===114&&(y=":");let w=n.alignDelimiters===!1?1:Math.max(1,c[f]-v.length-y.length);const j=v+"-".repeat(w)+y;n.alignDelimiters!==!1&&(w=v.length+w+y.length,w>c[f]&&(c[f]=w),m[f]=w),h[f]=j}a.splice(1,0,h),o.splice(1,0,m),d=-1;const g=[];for(;++d<a.length;){const k=a[d],v=o[d];f=-1;const y=[];for(;++f<u;){const w=k[f]||"";let j="",z="";if(n.alignDelimiters!==!1){const D=c[f]-(v[f]||0),C=l[f];C===114?j=" ".repeat(D):C===99?D%2?(j=" ".repeat(D/2+.5),z=" ".repeat(D/2-.5)):(j=" ".repeat(D/2),z=j):z=" ".repeat(D)}n.delimiterStart!==!1&&!f&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&w==="")&&(n.delimiterStart!==!1||f)&&y.push(" "),n.alignDelimiters!==!1&&y.push(j),y.push(w),n.alignDelimiters!==!1&&y.push(z),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&y.push("|")}g.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
|
|
518
|
+
`)}function cC(e){return e==null?"":String(e)}function Eh(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function uC(e,t,n,r){const i=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const a=n.indentLines(n.containerFlow(e,l.current()),dC);return i(),a}function dC(e,t,n){return">"+(n?"":" ")+e}function fC(e,t){return Th(e,t.inConstruct,!0)&&!Th(e,t.notInConstruct,!1)}function Th(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function zh(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
519
|
+
`&&fC(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
520
|
+
`}function mC(e,t){const n=String(e);let r=n.indexOf(t),i=r,l=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>a&&(a=l):l=1,i=r+t.length,r=n.indexOf(t,i);return a}function hC(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function pC(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function gC(e,t,n,r){const i=pC(n),l=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(hC(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(l,yC);return f(),h}const o=n.createTracker(r),c=i.repeat(Math.max(mC(l,i)+1,3)),u=n.enter("codeFenced");let d=o.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:`
|
|
521
|
+
`,encode:["`"],...o.current()})),f()}return d+=o.move(`
|
|
522
|
+
`),l&&(d+=o.move(l+`
|
|
523
|
+
`)),d+=o.move(c),u(),d}function yC(e,t,n){return(n?"":" ")+e}function qd(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function xC(e,t,n,r){const i=qd(n),l=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
524
|
+
`,...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),o()),a(),u}function vC(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function vl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function to(e,t,n){const r=ls(e),i=ls(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ex.peek=kC;function Ex(e,t,n,r){const i=vC(n),l=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let c=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=c.charCodeAt(0),d=to(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=vl(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=to(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+vl(f));const m=a.move(i);return l(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+m}function kC(e,t,n){return n.options.emphasis||"*"}function wC(e,t){let n=!1;return Wd(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Nu}),!!((!e.depth||e.depth<3)&&$d(e)&&(t.options.setext||n))}function bC(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(wC(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...l.current(),before:`
|
|
525
|
+
`,after:`
|
|
526
|
+
`});return f(),d(),h+`
|
|
527
|
+
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
528
|
+
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),c=n.enter("phrasing");l.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
529
|
+
`,...l.current()});return/^[\t ]/.test(u)&&(u=vl(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),o(),u}Tx.peek=jC;function Tx(e){return e.value||""}function jC(){return"<"}zx.peek=SC;function zx(e,t,n,r){const i=qd(n),l=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),o()),u+=c.move(")"),a(),u}function SC(){return"!"}Ax.peek=NC;function Ax(e,t,n,r){const i=e.referenceType,l=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const u=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=d,l(),i==="full"||!u||u!==f?c+=o.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function NC(){return"!"}Lx.peek=CC;function Lx(e,t,n){let r=e.value||"",i="`",l=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const a=n.unsafe[l],o=n.compilePattern(a);let c;if(a.atBreak)for(;c=o.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return i+r+i}function CC(){return"`"}function Dx(e,t){const n=$d(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ix.peek=_C;function Ix(e,t,n,r){const i=qd(n),l=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,c;if(Dx(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),o(),n.stack=d,f}o=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${l}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),c()),u+=a.move(")"),o(),u}function _C(e,t,n){return Dx(e,n)?"<":"["}Px.peek=EC;function Px(e,t,n,r){const i=e.referenceType,l=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=d,l(),i==="full"||!u||u!==f?c+=o.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function EC(){return"["}function Qd(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function TC(e){const t=Qd(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function zC(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Mx(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function AC(e,t,n,r){const i=n.enter("list"),l=n.bulletCurrent;let a=e.ordered?zC(n):Qd(n);const o=e.ordered?a==="."?")":".":TC(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Mx(n)===a&&d){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=l,i(),u}function LC(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function DC(e,t,n,r){const i=LC(n);let l=n.bulletCurrent||Qd(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(a-l.length)),o.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(a))+f:(m?l:l+" ".repeat(a-l.length))+f}}function IC(e,t,n,r){const i=n.enter("paragraph"),l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),i(),a}const PC=To(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function MC(e,t,n,r){return(e.children.some(function(a){return PC(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function RC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Rx.peek=$C;function Rx(e,t,n,r){const i=RC(n),l=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let c=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=c.charCodeAt(0),d=to(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=vl(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=to(r.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+vl(f));const m=a.move(i+i);return l(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+c+m}function $C(e,t,n){return n.options.strong||"*"}function FC(e,t,n,r){return n.safe(e.value,r)}function OC(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function UC(e,t,n){const r=(Mx(n)+(n.options.ruleSpaces?" ":"")).repeat(OC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const $x={blockquote:uC,break:zh,code:gC,definition:xC,emphasis:Ex,hardBreak:zh,heading:bC,html:Tx,image:zx,imageReference:Ax,inlineCode:Lx,link:Ix,linkReference:Px,list:AC,listItem:DC,paragraph:IC,root:MC,strong:Rx,text:FC,thematicBreak:UC};function BC(){return{enter:{table:HC,tableData:Ah,tableHeader:Ah,tableRow:WC},exit:{codeText:GC,table:VC,tableData:kc,tableHeader:kc,tableRow:kc}}}function HC(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function VC(e){this.exit(e),this.data.inTable=void 0}function WC(e){this.enter({type:"tableRow",children:[]},e)}function kc(e){this.exit(e)}function Ah(e){this.enter({type:"tableCell",children:[]},e)}function GC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,qC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function qC(e,t){return t==="|"?t:e}function QC(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
530
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:c,tableRow:o}};function a(m,g,k,v){return u(d(m,k,v),m.align)}function o(m,g,k,v){const y=f(m,k,v),w=u([y]);return w.slice(0,w.indexOf(`
|
|
531
|
+
`))}function c(m,g,k,v){const y=k.enter("tableCell"),w=k.enter("phrasing"),j=k.containerPhrasing(m,{...v,before:l,after:l});return w(),y(),j}function u(m,g){return oC(m,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(m,g,k){const v=m.children;let y=-1;const w=[],j=g.enter("table");for(;++y<v.length;)w[y]=f(v[y],g,k);return j(),w}function f(m,g,k){const v=m.children;let y=-1;const w=[],j=g.enter("tableRow");for(;++y<v.length;)w[y]=c(v[y],m,g,k);return j(),w}function h(m,g,k){let v=$x.inlineCode(m,g,k);return k.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function KC(){return{exit:{taskListCheckValueChecked:Lh,taskListCheckValueUnchecked:Lh,paragraph:XC}}}function YC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:JC}}}function Lh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function XC(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let l=-1,a;for(;++l<i.length;){const o=i[l];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function JC(e,t,n,r){const i=e.children[0],l=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);l&&o.move(a);let c=$x.listItem(e,t,n,{...r,...o.current()});return l&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+a}}function ZC(){return[A2(),J2(),nC(),BC(),KC()]}function e_(e){return{extensions:[L2(),Z2(e),rC(),QC(e),YC()]}}const t_={tokenize:a_,partial:!0},Fx={tokenize:o_,partial:!0},Ox={tokenize:c_,partial:!0},Ux={tokenize:u_,partial:!0},n_={tokenize:d_,partial:!0},Bx={name:"wwwAutolink",tokenize:s_,previous:Vx},Hx={name:"protocolAutolink",tokenize:l_,previous:Wx},or={name:"emailAutolink",tokenize:i_,previous:Gx},Wn={};function r_(){return{text:Wn}}let Qr=48;for(;Qr<123;)Wn[Qr]=or,Qr++,Qr===58?Qr=65:Qr===91&&(Qr=97);Wn[43]=or;Wn[45]=or;Wn[46]=or;Wn[95]=or;Wn[72]=[or,Hx];Wn[104]=[or,Hx];Wn[87]=[or,Bx];Wn[119]=[or,Bx];function i_(e,t,n){const r=this;let i,l;return a;function a(f){return!Tu(f)||!Gx.call(r,r.previous)||Kd(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Tu(f)?(e.consume(f),o):f===64?(e.consume(f),c):n(f)}function c(f){return f===46?e.check(n_,d,u)(f):f===45||f===95||Lt(f)?(l=!0,e.consume(f),c):d(f)}function u(f){return e.consume(f),i=!0,c}function d(f){return l&&i&&Ft(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function s_(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Vx.call(r,r.previous)||Kd(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(t_,e.attempt(Fx,e.attempt(Ox,l),n),n)(a))}function l(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function l_(e,t,n){const r=this;let i="",l=!1;return a;function a(f){return(f===72||f===104)&&Wx.call(r,r.previous)&&!Kd(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(Ft(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),c}return n(f)}function c(f){return f===47?(e.consume(f),l?u:(l=!0,c)):n(f)}function u(f){return f===null||Ja(f)||Ue(f)||mi(f)||Co(f)?n(f):e.attempt(Fx,e.attempt(Ox,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function a_(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),l):n(a)}function l(a){return a===null?n(a):t(a)}}function o_(e,t,n){let r,i,l;return a;function a(u){return u===46||u===95?e.check(Ux,c,o)(u):u===null||Ue(u)||mi(u)||u!==45&&Co(u)?c(u):(l=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function c(u){return i||r||!l?n(u):t(u)}}function c_(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?l(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Ux,t,l)(a):a===null||Ue(a)||mi(a)?t(a):(e.consume(a),i)}function l(a){return a===41&&r++,e.consume(a),i}}function u_(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),l):o===93?(e.consume(o),i):o===60||o===null||Ue(o)||mi(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Ue(o)||mi(o)?t(o):r(o)}function l(o){return Ft(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):Ft(o)?(e.consume(o),a):n(o)}}function d_(e,t,n){return r;function r(l){return e.consume(l),i}function i(l){return Lt(l)?n(l):t(l)}}function Vx(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ue(e)}function Wx(e){return!Ft(e)}function Gx(e){return!(e===47||Tu(e))}function Tu(e){return e===43||e===45||e===46||e===95||Lt(e)}function Kd(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const f_={tokenize:k_,partial:!0};function m_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:y_,continuation:{tokenize:x_},exit:v_}},text:{91:{name:"gfmFootnoteCall",tokenize:g_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:h_,resolveTo:p_}}}}function h_(e,t,n){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!a||!a._balanced)return n(c);const u=In(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!l.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function p_(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function g_(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,a;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(l>999||f===93&&!a||f===null||f===91||Ue(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(In(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Ue(f)||(a=!0),l++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),l++,u):u(f)}}function y_(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,a=0,o;return c;function c(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!o||g===null||g===91||Ue(g))return n(g);if(g===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return l=In(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Ue(g)||(o=!0),a++,e.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(e.consume(g),a++,d):d(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(l)||i.push(l),Le(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function x_(e,t,n){return e.check(_l,t,e.attempt(f_,t,n))}function v_(e){e.exit("gfmFootnoteDefinition")}function k_(e,t,n){const r=this;return Le(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):n(l)}}function w_(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let c=-1;for(;++c<a.length;)if(a[c][0]==="enter"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._close){let u=c;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[c][1].end.offset-a[c][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[c][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[c][1].end)},f={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[c][1].start)},h=[["enter",d,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",f,o]],m=o.parser.constructs.insideSpan.null;m&&an(h,h.length,0,_o(m,a.slice(u+1,c),o)),an(h,h.length,0,[["exit",f,o],["enter",a[c][1],o],["exit",a[c][1],o],["exit",d,o]]),an(a,u-1,c-u+3,h),c=u+h.length-2;break}}for(c=-1;++c<a.length;)a[c][1].type==="strikethroughSequenceTemporary"&&(a[c][1].type="data");return a}function l(a,o,c){const u=this.previous,d=this.events;let f=0;return h;function h(g){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(g):(a.enter("strikethroughSequenceTemporary"),m(g))}function m(g){const k=ls(u);if(g===126)return f>1?c(g):(a.consume(g),f++,m);if(f<2&&!n)return c(g);const v=a.exit("strikethroughSequenceTemporary"),y=ls(g);return v._open=!y||y===2&&!!k,v._close=!k||k===2&&!!y,o(g)}}}class b_{constructor(){this.map=[]}add(t,n,r){j_(this,t,n,r)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0}}function j_(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function S_(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function N_(){return{flow:{null:{name:"table",tokenize:C_,resolveAll:__}}}}function C_(e,t,n){const r=this;let i=0,l=0,a;return o;function o(N){let U=r.events.length-1;for(;U>-1;){const oe=r.events[U][1].type;if(oe==="lineEnding"||oe==="linePrefix")U--;else break}const O=U>-1?r.events[U][1].type:null,re=O==="tableHead"||O==="tableRow"?C:c;return re===C&&r.parser.lazy[r.now().line]?n(N):re(N)}function c(N){return e.enter("tableHead"),e.enter("tableRow"),u(N)}function u(N){return N===124||(a=!0,l+=1),d(N)}function d(N){return N===null?n(N):de(N)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),m):n(N):Ce(N)?Le(e,d,"whitespace")(N):(l+=1,a&&(a=!1,i+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(N)))}function f(N){return N===null||N===124||Ue(N)?(e.exit("data"),d(N)):(e.consume(N),N===92?h:f)}function h(N){return N===92||N===124?(e.consume(N),f):f(N)}function m(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),a=!1,Ce(N)?Le(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):g(N))}function g(N){return N===45||N===58?v(N):N===124?(a=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),k):D(N)}function k(N){return Ce(N)?Le(e,v,"whitespace")(N):v(N)}function v(N){return N===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),y):N===45?(l+=1,y(N)):N===null||de(N)?z(N):D(N)}function y(N){return N===45?(e.enter("tableDelimiterFiller"),w(N)):D(N)}function w(N){return N===45?(e.consume(N),w):N===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(N))}function j(N){return Ce(N)?Le(e,z,"whitespace")(N):z(N)}function z(N){return N===124?g(N):N===null||de(N)?!a||i!==l?D(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):D(N)}function D(N){return n(N)}function C(N){return e.enter("tableRow"),A(N)}function A(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),A):N===null||de(N)?(e.exit("tableRow"),t(N)):Ce(N)?Le(e,A,"whitespace")(N):(e.enter("data"),_(N))}function _(N){return N===null||N===124||Ue(N)?(e.exit("data"),A(N)):(e.consume(N),N===92?I:_)}function I(N){return N===92||N===124?(e.consume(N),_):_(N)}}function __(e,t){let n=-1,r=!0,i=0,l=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,u,d,f;const h=new b_;for(;++n<e.length;){const m=e[n],g=m[1];m[0]==="enter"?g.type==="tableHead"?(o=!1,c!==0&&(Dh(h,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,l=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",d,t]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(l[1]!==0&&(a[0]=a[1],f=na(h,t,l,i,void 0,f),l=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(a[0]=a[1],f=na(h,t,l,i,void 0,f)),l=a,a=[l[1],n,0,0])):g.type==="tableHead"?(o=!0,c=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=n,l[1]!==0?(a[0]=a[1],f=na(h,t,l,i,n,f)):a[1]!==0&&(f=na(h,t,a,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(c!==0&&Dh(h,t,c,u,d),h.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=S_(t.events,n))}return e}function na(e,t,n,r,i,l){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(l.end=Object.assign({},Ci(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const c=Ci(t.events,n[1]);if(l={type:a,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const u=Ci(t.events,n[2]),d=Ci(t.events,n[3]),f={type:o,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],m=t.events[n[3]];if(h[1].end=Object.assign({},m[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,k=n[3]-n[2]-1;e.add(g,k,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(l.end=Object.assign({},Ci(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function Dh(e,t,n,r,i){const l=[],a=Ci(t.events,n);i&&(i.end=Object.assign({},a),l.push(["exit",i,t])),r.end=Object.assign({},a),l.push(["exit",r,t]),e.add(n+1,0,l)}function Ci(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const E_={name:"tasklistCheck",tokenize:z_};function T_(){return{text:{91:E_}}}function z_(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),l)}function l(c){return Ue(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return de(c)?t(c):Ce(c)?e.check({tokenize:A_},t,n)(c):n(c)}}function A_(e,t,n){return Le(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function L_(e){return nx([r_(),m_(),w_(e),N_(),T_()])}const D_={};function I_(e){const t=this,n=e||D_,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(L_(n)),l.push(ZC()),a.push(e_(n))}const P_={search_file:{label:"Searched files",activeLabel:"Searching files",icon:An,color:"#3b82f6"},search_files:{label:"Searched files",activeLabel:"Searching files",icon:An,color:"#3b82f6"},search_file_content:{label:"Searched content",activeLabel:"Searching content",icon:An,color:"#3b82f6"},search_directory:{label:"Searched directory",activeLabel:"Searching directory",icon:An,color:"#3b82f6"},read_file:{label:"Read file",activeLabel:"Reading file",icon:zn,color:"#8b5cf6"},write_file:{label:"Wrote file",activeLabel:"Writing file",icon:nw,color:"#f59e0b"},get_file_info:{label:"Got file info",activeLabel:"Getting file info",icon:zn,color:"#8b5cf6"},browse_directory:{label:"Browsed directory",activeLabel:"Browsing directory",icon:er,color:"#a78bfa"},list_directory:{label:"Listed directory",activeLabel:"Listing directory",icon:er,color:"#a78bfa"},list_recent_files:{label:"Listed recent files",activeLabel:"Listing recent files",icon:er,color:"#a78bfa"},analyze_data_file:{label:"Analyzed data",activeLabel:"Analyzing data",icon:Tm,color:"#ec4899"},run_shell_command:{label:"Ran command",activeLabel:"Running command",icon:Ya,color:"#22c55e"},execute_code:{label:"Executed code",activeLabel:"Executing code",icon:ew,color:"#f59e0b"},query_documents:{label:"Queried documents",activeLabel:"Querying documents",icon:bi,color:"#06b6d4"},query_specific_file:{label:"Queried file",activeLabel:"Querying file",icon:bi,color:"#06b6d4"},search_indexed_chunks:{label:"Searched chunks",activeLabel:"Searching chunks",icon:bi,color:"#06b6d4"},semantic_search:{label:"Searched documents",activeLabel:"Searching documents",icon:bi,color:"#06b6d4"},evaluate_retrieval:{label:"Evaluated retrieval",activeLabel:"Evaluating retrieval",icon:bi,color:"#06b6d4"},index_document:{label:"Indexed document",activeLabel:"Indexing document",icon:Si,color:"#f97316"},index_directory:{label:"Indexed directory",activeLabel:"Indexing directory",icon:Si,color:"#f97316"},index_file:{label:"Indexed file",activeLabel:"Indexing file",icon:Si,color:"#f97316"},list_indexed_documents:{label:"Listed documents",activeLabel:"Listing documents",icon:Si,color:"#f97316"},summarize_document:{label:"Summarized",activeLabel:"Summarizing",icon:zn,color:"#8b5cf6"},dump_document:{label:"Extracted text",activeLabel:"Extracting text",icon:zn,color:"#8b5cf6"},rag_status:{label:"Checked RAG status",activeLabel:"Checking RAG",icon:Si,color:"#f97316"},add_watch_directory:{label:"Added watch dir",activeLabel:"Adding watch dir",icon:er,color:"#a78bfa"},web_search:{label:"Searched web",activeLabel:"Searching web",icon:Cd,color:"#14b8a6"},analyze_data:{label:"Analyzed data",activeLabel:"Analyzing data",icon:Tm,color:"#ec4899"}},Ih={label:"Used tool",activeLabel:"Using tool",icon:is,color:"#3b82f6"};function M_(e){return e?e.startsWith("mcp_")?{label:"MCP tool",activeLabel:"Running MCP tool",icon:Cd,color:"#7c3aed"}:P_[e]||Ih:Ih}function qx({steps:e,isActive:t,variant:n="inline"}){const[r,i]=p.useState(!1),[l,a]=p.useState(new Set),o=p.useRef(0),c=p.useRef(new Map),u=p.useRef(t);p.useEffect(()=>{u.current=t},[t]),p.useEffect(()=>()=>{c.current.forEach(_=>clearTimeout(_)),c.current.clear()},[]);const d=p.useMemo(()=>{const _=[];for(const I of e){const N=_[_.length-1];if(I.type==="thinking"&&N&&N.type==="thinking"){const U=(N.detail||"")+(I.detail||"");_[_.length-1]={...I,detail:U||N.detail};continue}if(I.type==="status"&&N&&N.type==="status"&&I.active!==!1){_[_.length-1]={...I,label:I.label||N.label};continue}if(I.type==="thinking"&&N&&N.type==="status"&&N.active!==!1){_[_.length-1]={...N,type:"thinking",detail:I.detail||N.detail,active:I.active};continue}if(I.type==="status"&&N&&N.type==="thinking"){_[_.length-1]={...N,label:I.label||N.label,active:I.active??N.active};continue}_.push(I)}return _},[e]),f=d.filter(_=>_.type==="tool"),h=d.filter(_=>_.type==="policy_alert"),m=h.length>0,[g,k]=p.useState(""),[v,y]=p.useState("all"),w=p.useMemo(()=>!g&&v==="all"?d:d.filter(_=>{var I;return _.type!=="tool"?!0:!(g&&!((I=_.tool)!=null&&I.toLowerCase().includes(g.toLowerCase()))||v==="success"&&_.success!==!0||v==="error"&&_.success!==!1)}),[d,g,v]),z=d.filter(_=>_.type==="error").length>0;p.useEffect(()=>{m&&i(!0)},[m]),p.useEffect(()=>{o.current=d.length;const _=d.filter(I=>I.type==="tool"&&!I.mcpServer).map(I=>I.id);_.length>0&&a(I=>{const N=new Set(I);return _.forEach(U=>N.add(U)),N})},[d]);const D=p.useCallback(_=>{const I=c.current.get(_);I&&(clearTimeout(I),c.current.delete(_)),a(N=>{const U=new Set(N);return U.has(_)?U.delete(_):U.add(_),U})},[]);if(d.length===0)return null;const C=d.length,A=m?`Blocked by policy · ${h.length} alert${h.length!==1?"s":""}`:`${C} step${C!==1?"s":""}`+(f.length>0?` · ${f.length} tool${f.length!==1?"s":""}`:"");return s.jsxs("div",{className:`agent-activity ${n} ${t?"active":"done"} ${z?"has-errors":""} ${m?"has-policy-alerts":""}`,children:[s.jsxs("button",{className:"agent-summary-bar",onClick:()=>i(!r),"aria-expanded":r,"aria-label":r?"Collapse agent activity":"Expand agent activity",children:[s.jsxs("div",{className:"agent-summary-left",children:[z?s.jsx(pt,{size:14,className:"agent-icon-error"}):s.jsx(qi,{size:14,className:"agent-icon-done"}),s.jsx("span",{className:"agent-summary-text",children:A})]}),s.jsx("div",{className:"agent-summary-right",children:r?s.jsx(ui,{size:14}):s.jsx(us,{size:14})})]}),d.length>0&&s.jsxs("div",{className:`agent-flow-wrap ${r?"flow-expanded":"flow-collapsed"}`,children:[r&&f.length>=2&&s.jsxs("div",{className:"activity-filter-bar",children:[s.jsx("input",{type:"text",className:"activity-filter-input",placeholder:"Filter by tool name...","aria-label":"Filter by tool name",value:g,onChange:_=>k(_.target.value)}),s.jsxs("select",{className:"activity-filter-select","aria-label":"Filter by status",value:v,onChange:_=>y(_.target.value),children:[s.jsx("option",{value:"all",children:"All"}),s.jsx("option",{value:"success",children:"Success"}),s.jsx("option",{value:"error",children:"Error"})]})]}),s.jsx("div",{className:"agent-flow",children:w.map(_=>_.type==="thinking"?s.jsx(R_,{step:_},_.id):_.type==="status"?s.jsx($_,{step:_},_.id):_.type==="tool"?s.jsx(U_,{step:_,isExpanded:l.has(_.id),onToggle:()=>D(_.id)},_.id):_.type==="plan"?s.jsx(B_,{step:_},_.id):_.type==="error"?s.jsx(H_,{step:_},_.id):_.type==="policy_alert"?s.jsx(V_,{step:_},_.id):null)})]})]})}function R_({step:e}){const t=e.detail||e.label||"",n=p.useRef(null);return p.useEffect(()=>{e.active&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[t,e.active]),t?s.jsxs("div",{ref:n,className:"flow-thought-hacker",children:[s.jsx("span",{children:t}),e.active&&s.jsx("span",{className:"flow-thought-cursor"})]}):null}function $_({step:e}){const t=e.detail||e.label||"";return t?s.jsx("div",{className:`flow-thought ${e.active?"active":""}`,children:s.jsx("span",{className:"flow-thought-text",children:t})}):null}function F_(e){const t=/[A-Z]:[\\\/](?:[^\s*?"<>|,;)}\]]+[\\\/])*[^\s*?"<>|,;)}\]]*/gi,n=[];let r=0,i;for(;(i=t.exec(e))!==null;){i.index>r&&n.push(e.slice(r,i.index));const l=i[0],a=l.replace(/[)}\]]+$/,""),o=()=>{zd(a).catch(c=>E.ui.error("Failed to open path",c))};n.push(s.jsxs("span",{className:"tool-result-path",onClick:o,title:`Open: ${a}`,role:"button",tabIndex:0,onKeyDown:c=>{c.key==="Enter"&&o()},children:[s.jsx(er,{size:10,style:{flexShrink:0,opacity:.7}}),a]},i.index)),a.length<l.length&&n.push(l.slice(a.length)),r=i.index+l.length}return n.length===0?e:(r<e.length&&n.push(e.slice(r)),s.jsx(s.Fragment,{children:n}))}function O_({fileList:e}){const[t,n]=p.useState(!1),r=5,i=t?e.files:e.files.slice(0,r),l=e.total-r,a=(c,u)=>{const d=c.name||c.filename||c.file_name;return d?String(d):c.file_path?String(c.file_path).replace(/\\/g,"/").split("/").pop()||`File ${u+1}`:`File ${u+1}`},o=c=>c.directory?String(c.directory):"";return s.jsxs("div",{className:"file-list-view",children:[i.map((c,u)=>s.jsxs("div",{className:"file-list-item",children:[s.jsx(py,{size:11,className:"file-list-icon"}),s.jsx("span",{className:"file-list-name",children:a(c,u)}),o(c)&&s.jsx("span",{className:"file-list-dir",children:o(c)})]},u)),l>0&&!t&&s.jsxs("button",{className:"file-list-more",onClick:()=>n(!0),children:["+",l," more"]}),t&&e.files.length<e.total&&s.jsxs("span",{className:"file-list-truncated",children:["Showing ",e.files.length," of ",e.total," files"]})]})}function U_({step:e,isExpanded:t,onToggle:n}){var c,u;const r=M_(e.tool),i=r.icon,l=r.color,a=e.active?r.activeLabel:r.label,o=!!(e.detail||e.result||e.commandOutput||(u=(c=e.fileList)==null?void 0:c.files)!=null&&u.length);return s.jsxs("div",{className:`flow-tool ${e.active?"active":""} ${e.success===!1?"error":""}`,children:[s.jsxs("button",{className:"flow-tool-header",onClick:o?n:void 0,style:o?void 0:{cursor:"default"},children:[s.jsxs("div",{className:"flow-tool-left",children:[e.active?s.jsx(mt,{size:13,className:"flow-tool-spinner",style:{color:l}}):e.success===!1?s.jsx(pt,{size:13,style:{color:"#ef4444"}}):e.success===!0?s.jsx(Vn,{size:13,style:{color:"#22c55e"}}):s.jsx(i,{size:13,style:{color:l}}),s.jsx("span",{className:"flow-tool-label",children:a}),s.jsx("span",{className:"flow-tool-badge",style:{"--badge-color":l},children:e.tool}),e.mcpServer&&s.jsxs("span",{className:"flow-tool-mcp-server",children:["via ",e.mcpServer]})]}),s.jsxs("div",{className:"flow-tool-right",children:[e.latencyMs!=null&&!e.active&&s.jsxs("span",{className:"flow-tool-latency",children:[Math.round(e.latencyMs),"ms"]}),o&&s.jsx("span",{className:`flow-tool-chevron ${t?"expanded":""}`,children:s.jsx(us,{size:12})})]})]}),t&&o&&s.jsxs("div",{className:"flow-tool-detail",children:[e.detail&&!e.commandOutput&&s.jsxs("div",{className:"step-detail-args",children:[s.jsx("span",{className:"detail-section-label",children:"Arguments"}),s.jsx("div",{className:"detail-args-content",children:q_(e.detail)})]}),e.commandOutput&&s.jsx(G_,{output:e.commandOutput}),e.result&&!e.commandOutput&&s.jsxs("div",{className:`step-detail-result ${e.success===!1?"result-error":"result-success"}`,children:[s.jsx("span",{className:"detail-section-label",children:e.success===!1?"Error":"Result"}),s.jsx("div",{className:"detail-result-content",children:F_(e.result)})]}),e.retrievalChunks&&e.retrievalChunks.length>0&&s.jsx(W_,{chunks:e.retrievalChunks}),e.fileList&&e.fileList.files.length>0&&s.jsx(O_,{fileList:e.fileList})]})]})}function B_({step:e}){const[t,n]=p.useState(!1);return!e.planSteps||e.planSteps.length===0?null:s.jsxs("div",{className:"flow-plan",children:[s.jsxs("button",{className:"flow-plan-header flow-plan-toggle",onClick:()=>n(r=>!r),"aria-expanded":t,title:t?"Collapse plan":"Expand plan",children:[s.jsx(xy,{size:12}),s.jsx("span",{children:"Plan"}),s.jsxs("span",{className:"flow-plan-count",children:["(",e.planSteps.length,")"]}),t?s.jsx(ui,{size:11}):s.jsx(us,{size:11})]}),t&&s.jsx("ol",{className:"flow-plan-list",children:e.planSteps.map((r,i)=>s.jsx("li",{className:"flow-plan-item",children:r},i))})]})}function H_({step:e}){return s.jsxs("div",{className:"flow-error",children:[s.jsx(pt,{size:13}),s.jsx("span",{children:e.detail||e.label||"An error occurred"})]})}function V_({step:e}){return s.jsxs("div",{className:"flow-policy-alert",children:[s.jsxs("div",{className:"flow-policy-alert-header",children:[s.jsx(Ka,{size:14}),s.jsx("span",{className:"flow-policy-alert-title",children:"Policy Shield"}),s.jsx("span",{className:"flow-policy-alert-decision",children:e.decision||"BLOCK"})]}),s.jsxs("div",{className:"flow-policy-alert-body",children:[s.jsxs("div",{className:"flow-policy-alert-line",children:[s.jsx("span",{children:"Tool"}),s.jsx("code",{children:e.tool||"unknown tool"})]}),s.jsx("div",{className:"flow-policy-alert-reason",children:e.reason||e.detail}),e.ruleIds&&e.ruleIds.length>0&&s.jsxs("div",{className:"flow-policy-alert-line",children:[s.jsx("span",{children:"Rules"}),s.jsx("code",{children:e.ruleIds.join(", ")})]}),e.policyVersion&&s.jsxs("div",{className:"flow-policy-alert-line",children:[s.jsx("span",{children:"Policy"}),s.jsx("code",{children:e.policyVersion})]}),s.jsxs("div",{className:"flow-policy-alert-line",children:[s.jsx("span",{children:"Receipt"}),e.receiptId?s.jsx("code",{children:e.receiptId}):s.jsx("em",{children:"Receipt unavailable"})]})]})]})}function W_({chunks:e}){const[t,n]=p.useState(new Set),r=i=>{n(l=>{const a=new Set(l);return a.has(i)?a.delete(i):a.add(i),a})};return s.jsxs("div",{className:"chunks-view",children:[s.jsxs("span",{className:"detail-section-label",children:["Retrieved Chunks (",e.length,")"]}),s.jsx("div",{className:"chunks-list",children:e.map(i=>{const l=t.has(i.id);return s.jsxs("div",{className:`chunk-card ${l?"expanded":""}`,children:[s.jsxs("button",{className:"chunk-header",onClick:()=>r(i.id),children:[s.jsxs("div",{className:"chunk-header-left",children:[s.jsx(bi,{size:11,style:{color:"#06b6d4",flexShrink:0}}),i.source&&s.jsx("span",{className:"chunk-source",children:i.source}),i.page!=null&&s.jsxs("span",{className:"chunk-page",children:["p.",i.page]}),i.score!=null&&i.score>0&&s.jsx("span",{className:"chunk-score",children:i.score.toFixed(2)})]}),s.jsx("span",{className:`chunk-chevron ${l?"expanded":""}`,children:s.jsx(us,{size:11})})]}),s.jsx("div",{className:`chunk-body ${l?"show":""}`,children:l?s.jsx("pre",{className:"chunk-content",children:i.content}):s.jsx("div",{className:"chunk-preview",children:i.preview})})]},i.id)})})]})}function G_({output:e}){const[t,n]=p.useState(!1),r=p.useRef(null);p.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const i=p.useCallback(()=>{const o=e.stdout||e.stderr||"";navigator.clipboard.writeText(o).catch(()=>{}),n(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),2e3)},[e]),l=!!(e.stdout||e.stderr),a=e.returnCode!==0;return s.jsxs("div",{className:`cmd-output ${a?"cmd-error":""}`,children:[s.jsxs("div",{className:"cmd-header",children:[s.jsxs("div",{className:"cmd-header-left",children:[s.jsx(Ya,{size:12,className:"cmd-header-icon"}),s.jsx("span",{className:"cmd-header-title",children:"Terminal"}),e.cwd&&s.jsx("span",{className:"cmd-cwd",children:e.cwd})]}),s.jsxs("div",{className:"cmd-header-right",children:[e.durationSeconds!=null&&s.jsxs("span",{className:"cmd-duration",children:[e.durationSeconds.toFixed(1),"s"]}),e.returnCode!==0&&s.jsxs("span",{className:"cmd-exit-code",children:["exit ",e.returnCode]}),l&&s.jsx("button",{className:`cmd-copy ${t?"copied":""}`,onClick:i,title:t?"Copied!":"Copy output",children:t?s.jsx(ci,{size:11}):s.jsx(Nl,{size:11})})]})]}),s.jsxs("div",{className:"cmd-line",children:[s.jsx("span",{className:"cmd-prompt",children:"$"}),s.jsx("span",{className:"cmd-text",children:e.command})]}),e.stdout&&s.jsx("pre",{className:"cmd-stdout",children:e.stdout}),e.stderr&&s.jsx("pre",{className:"cmd-stderr",children:e.stderr}),e.truncated&&s.jsx("div",{className:"cmd-truncated",children:"Output was truncated (exceeded size limit)"}),!l&&s.jsx("div",{className:"cmd-empty",children:"No output"})]})}function q_(e){const t=e.includes(`
|
|
532
|
+
`)?e.split(`
|
|
533
|
+
`).filter(Boolean):e.split(", ").filter(Boolean);return t.length<=1?s.jsx("span",{className:"arg-value",children:e}):s.jsx("div",{className:"args-grid",children:t.map((n,r)=>{const i=n.indexOf(":");if(i>0&&i<30){const l=n.slice(0,i).trim(),a=n.slice(i+1).trim();return s.jsxs("div",{className:"arg-row",children:[s.jsx("span",{className:"arg-key",children:l}),s.jsx("span",{className:"arg-value",children:a})]},r)}return s.jsx("div",{className:"arg-row",children:s.jsx("span",{className:"arg-value",children:n})},r)})})}function Q_(e){if(!e)return!1;if(e.includes("NOT_CONNECTED:")||e.includes("AGENT_NOT_GRANTED:")||e.includes("AUTH_REQUIRED:"))return!0;const t=e.toLowerCase();return!!(t.includes("connectors → google")||t.includes("connections → google")||t.includes("email agent needs additional google permissions"))}function K_(e){var n;const t=window;(n=t.gaia)!=null&&n.openExternal?t.gaia.openExternal(e):window.open(e,"_blank","noopener")}function Y_({connectorId:e="google"}){const[t,n]=p.useState(!1),[r,i]=p.useState(null),[l,a]=p.useState(!1),o=p.useCallback(async()=>{n(!0),i(null);try{const c=await zy(e),u=c.available_scopes&&c.available_scopes.length>0?c.available_scopes:c.default_scopes,d=await Ay(e,u);K_(d.authorization_url),a(!0)}catch(c){i(c instanceof Error?c.message:String(c))}finally{n(!1)}},[e]);return s.jsxs("div",{className:"email-connect-cta",role:"region","aria-label":"Connect Google",children:[s.jsxs("div",{className:"email-connect-cta__text",children:[s.jsx(pt,{size:14,className:"email-connect-cta__icon"}),s.jsx("span",{children:l?"A browser tab opened for Google sign-in. Return here when finished.":"Connect your Google account to use Email Triage."})]}),s.jsxs("button",{className:"email-connect-cta__button",onClick:()=>void o(),disabled:t,children:[t?s.jsx(mt,{size:12,className:"email-connect-cta__spinner"}):s.jsx(Gi,{size:12}),s.jsx("span",{children:l?"Reopen Google sign-in":"Connect Google"})]}),r&&s.jsx("div",{className:"email-connect-cta__error",role:"alert",children:r})]})}function Ph(e){if(!e||typeof e!="object")return!1;const t=e;return t.kind!=="email_pre_scan"?!1:Array.isArray(t.urgent)&&Array.isArray(t.actionable)&&Array.isArray(t.suggested_archives)&&Array.isArray(t.suggested_drafts)&&typeof t.informational_count=="number"}function X_(e){e&&window.dispatchEvent(new CustomEvent("gaia:send-message",{detail:{text:e}}))}function J_(e){const t=e.thread_id||e.message_id;if(!t)return;const n=`https://mail.google.com/mail/u/0/#inbox/${encodeURIComponent(t)}`;window.open(n,"_blank","noopener,noreferrer")}function Z_(e){if(!e)return"(unknown)";const t=e.trim(),n=t.indexOf("<");return n>0?t.slice(0,n).trim().replace(/^"|"$/g,""):t}function Mh({payload:e}){const[t,n]=p.useState(()=>new Set),r=p.useCallback(m=>{n(g=>{const k=new Set(g);return k.add(m),k})},[]),[i,l]=p.useState(null),a=p.useRef(null);p.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const o=p.useCallback((m,g)=>{i||(l(m),a.current=setTimeout(()=>{l(k=>k===m?null:k)},5e3),X_(g))},[i]),c=p.useCallback(m=>{o(m.message_id,`Archive message id ${m.message_id}.`)},[o]),u=p.useCallback(m=>{o(m.message_id,`Draft a reply to message id ${m.message_id}.`)},[o]),d=p.useMemo(()=>[{key:"urgent",title:"Urgent",icon:s.jsx(pt,{size:14}),items:e.urgent.filter(m=>!t.has(m.message_id)),intent:"urgent"},{key:"actionable",title:"Needs a response",icon:s.jsx(ky,{size:14}),items:e.actionable.filter(m=>!t.has(m.message_id)),intent:"actionable"},{key:"archives",title:"Suggested archives",icon:s.jsx(cy,{size:14}),items:e.suggested_archives.filter(m=>!t.has(m.message_id)),intent:"archive"}],[e,t]),f=d.reduce((m,g)=>m+g.items.length,0),h=e.informational_count;return s.jsxs("div",{className:"email-pre-scan",role:"region","aria-label":"Inbox pre-scan",children:[s.jsxs("div",{className:"email-pre-scan__header",children:[s.jsx(sw,{size:16,"aria-hidden":"true"}),s.jsx("span",{className:"email-pre-scan__title",children:"Inbox pre-scan"}),s.jsxs("span",{className:"email-pre-scan__totals",children:[f," surfaced",h>0?` · ${h} informational`:""]})]}),d.map(m=>m.items.length>0?s.jsx(eE,{def:m,pendingRow:i,onApproveArchive:c,onReply:u,onDismiss:r,onOpen:J_},m.key):null),f===0&&s.jsxs("div",{className:"email-pre-scan__empty",children:[s.jsx(Vn,{size:14}),s.jsx("span",{children:"Nothing to surface — your inbox looks quiet."})]}),s.jsx(nE,{applied:e.preferences_applied})]})}function eE({def:e,pendingRow:t,onApproveArchive:n,onReply:r,onDismiss:i,onOpen:l}){return s.jsxs("section",{className:`email-pre-scan__section email-pre-scan__section--${e.intent}`,children:[s.jsxs("header",{className:"email-pre-scan__section-header",children:[e.icon,s.jsx("span",{className:"email-pre-scan__section-title",children:e.title}),s.jsx("span",{className:"email-pre-scan__section-count",children:e.items.length})]}),s.jsx("ul",{className:"email-pre-scan__list",children:e.items.map(a=>s.jsx(tE,{item:a,intent:e.intent,isPending:t!==null,onApproveArchive:n,onReply:r,onDismiss:i,onOpen:l},a.message_id))})]})}function tE({item:e,intent:t,isPending:n,onApproveArchive:r,onReply:i,onDismiss:l,onOpen:a}){const o=e.reason??e.why??"",c=Z_(e.sender);return s.jsxs("li",{className:"email-pre-scan__row",children:[s.jsxs("div",{className:"email-pre-scan__row-text",children:[s.jsxs("div",{className:"email-pre-scan__row-meta",children:[s.jsx("span",{className:"email-pre-scan__row-sender",title:e.sender,children:c}),s.jsx("span",{className:"email-pre-scan__row-subject",title:e.subject,children:e.subject||"(no subject)"})]}),o&&s.jsx("div",{className:"email-pre-scan__row-reason",title:o,children:o})]}),s.jsxs("div",{className:"email-pre-scan__row-actions",role:"group","aria-label":"Actions for this email",children:[t==="archive"?s.jsxs("button",{className:"email-pre-scan__action email-pre-scan__action--primary",onClick:()=>r(e),disabled:n,title:"Approve archive","aria-label":`Approve archive for "${e.subject}"`,children:[s.jsx(cy,{size:12}),s.jsx("span",{children:"Archive"})]}):s.jsxs("button",{className:"email-pre-scan__action email-pre-scan__action--primary",onClick:()=>i(e),disabled:n,title:"Draft a reply","aria-label":`Draft a reply to "${e.subject}"`,children:[s.jsx(Nw,{size:12}),s.jsx("span",{children:"Reply"})]}),s.jsxs("button",{className:"email-pre-scan__action",onClick:()=>a(e),title:"Open in Gmail","aria-label":`Open "${e.subject}" in Gmail`,children:[s.jsx(Gi,{size:12}),s.jsx("span",{children:"Open"})]}),s.jsx("button",{className:"email-pre-scan__action email-pre-scan__action--ghost",onClick:()=>l(e.message_id),title:"Dismiss this row","aria-label":`Dismiss "${e.subject}"`,children:s.jsx(Ze,{size:12})})]})]})}function nE({applied:e}){const t=(e==null?void 0:e.priority_senders)??[],n=(e==null?void 0:e.low_priority_senders)??[],r=(e==null?void 0:e.category_defaults)??{};return t.length>0||n.length>0||Object.keys(r).length>0?s.jsxs("div",{className:"email-pre-scan__preferences","aria-label":"Active session preferences",children:[s.jsx("span",{className:"email-pre-scan__preferences-label",children:"Session preferences:"}),t.length>0&&s.jsxs("span",{className:"email-pre-scan__preferences-chip",title:"Always urgent",children:["+ ",t.length," priority sender",t.length===1?"":"s"]}),n.length>0&&s.jsxs("span",{className:"email-pre-scan__preferences-chip",title:"Always low-priority",children:["− ",n.length," low-priority sender",n.length===1?"":"s"]}),Object.entries(r).map(([l,a])=>s.jsxs("span",{className:"email-pre-scan__preferences-chip",title:`${l} → ${a}`,children:[l," → ",a]},l))]}):null}function rE({active:e}){const t="Thinking...",[n,r]=p.useState(0),[i,l]=p.useState("typing"),a=p.useRef(e);return p.useEffect(()=>{if(i!=="typing")return;if(n>=t.length){l("idle");return}const o=setTimeout(()=>r(c=>c+1),30);return()=>clearTimeout(o)},[i,n]),p.useEffect(()=>{a.current&&!e&&l("erasing"),a.current=e},[e]),p.useEffect(()=>{if(i!=="erasing")return;if(n<=0){l("done");return}const o=setTimeout(()=>r(c=>c-1),20);return()=>clearTimeout(o)},[i,n]),p.useEffect(()=>{e&&i==="done"&&(r(0),l("typing"))},[e,i]),i==="done"?null:s.jsxs("span",{className:"thinking-indicator",children:[s.jsx("span",{className:"thinking-indicator-text",children:t.slice(0,n)}),e&&s.jsx("span",{className:"cursor"})]})}function iE(e){if(!e)return!1;const t=e.toLowerCase();return t.startsWith("error:")||t.startsWith("error -")||t.includes("traceback (most recent")||t.includes("object has no attribute")||t.includes("is lemonade server running")||t.includes("connection refused")||t.includes("failed to fetch")}const sE=/\s*\{\s*"?tool"?\s*:\s*"[^"]+"\s*,\s*"?tool_args"?\s*:\s*\{[^}]*\}\s*\}/g;function lE(e){const t=['"thought"','"answer"','"tool"'];let n="",r=0;for(;r<e.length;){const i=e.indexOf("{",r);if(i===-1){n+=e.slice(r);break}const l=e.slice(i,i+50);if(!t.some(d=>l.includes(d))){n+=e.slice(r,i+1),r=i+1;continue}n+=e.slice(r,i);let o=0,c=i;for(;c<e.length;c++)if(e[c]==="{")o++;else if(e[c]==="}"&&(o--,o===0))break;if(o!==0)break;const u=e.slice(i,c+1);try{const d=JSON.parse(u);d.answer&&(n+=d.answer)}catch{const d=u.indexOf('"answer"');if(d!==-1){const f=u.indexOf(":",d+8);if(f!==-1){let h=f+1;for(;h<u.length&&/\s/.test(u[h]);)h++;if(h<u.length&&u[h]==='"'){let m=u.slice(h+1);m.endsWith('"}')?m=m.slice(0,-2):m.endsWith('"')&&(m=m.slice(0,-1)),n+=m.replace(/\\"/g,'"').replace(/\\n/g,`
|
|
534
|
+
`).replace(/\\\\/g,"\\")}}}}r=c+1}return n}const aE=new Set(["email_pre_scan","email-pre-scan"]),oE=new Set(["python","py","javascript","js","typescript","ts","java","c","cpp","csharp","cs","go","rust","ruby","rb","php","swift","kotlin","scala","r","perl","lua","bash","sh","zsh","powershell","ps1","sql","html","css","scss","sass","less","xml","json","yaml","yml","toml","ini","csv","markdown","md","dockerfile","docker","makefile","cmake","nginx","apache","graphql","proto","protobuf","jsx","tsx","vue","svelte","dart","elixir","ex","erlang","haskell","hs","ocaml","ml","fsharp","fs","clojure","clj","lisp","scheme","racket","zig","nim","crystal","julia","matlab","octave","fortran","cobol","pascal","delphi","ada","assembly","asm","nasm","wasm","solidity","sol","verilog","vhdl","text","txt","plaintext","diff","patch","log","email_pre_scan","email-pre-scan"]);function cE(e){return e.replace(/```(\w*)[ \t]*\n([\s\S]*?)```/g,(t,n,r)=>{const i=n.toLowerCase();return i&&aE.has(i)||i&&oE.has(i)?t:r.trim()})}const uE={email_pre_scan:"email_pre_scan","email-pre-scan":"email_pre_scan"};function dE(e){const t=e.trimStart();if(!t.startsWith("{"))return e;const n=t.match(/^\{"kind"\s*:\s*"([^"]+)"/);if(!n)return e;const r=uE[n[1]];if(!r)return e;let i=0,l=-1,a=!1,o=!1;for(let f=0;f<t.length;f++){const h=t[f];if(o){o=!1;continue}if(a){h==="\\"?o=!0:h==='"'&&(a=!1);continue}if(h==='"')a=!0;else if(h==="{")i++;else if(h==="}"&&--i===0){l=f;break}}if(l===-1)return e;const c=t.slice(0,l+1),u=t.slice(l+1);return`${e.slice(0,e.length-t.length)}\`\`\`${r}
|
|
535
|
+
${c}
|
|
536
|
+
\`\`\`
|
|
537
|
+
${u}`}function fE(e){if(!e)return e;let t=e;t=dE(t),t=t.replace(sE,""),t=lE(t),t=t.replace(/<think>[\s\S]*?<\/think>/g,"");const n=(t.match(/\\n/g)||[]).length,r=(t.match(/\n/g)||[]).length;return n>2&&n>r*2&&(t=t.replace(/\\n/g,`
|
|
538
|
+
`),t=t.replace(/\\"/g,'"')),t=cE(t).trim(),t}function mE(e){if(!e)return"";const t=new Date(e),r=new Date().getTime()-t.getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const l=Math.floor(i/60);return l<24?`${l}h ago`:t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Rh(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}):""}function hE(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function $h({message:e,isStreaming:t,showTerminalCursor:n,agentSteps:r,agentStepsActive:i,onDelete:l,onResend:a,latencyMs:o,agentName:c}){var D,C,A;const u=e.role==="assistant"&&iE(e.content),d=p.useMemo(()=>fE(e.content),[e.content]),[f,h]=p.useState(!1),[m,g]=p.useState(!1),k=p.useRef(null),v=p.useRef(null);p.useEffect(()=>()=>{k.current&&clearTimeout(k.current),v.current&&clearTimeout(v.current)},[]);const y=p.useCallback(()=>{var _;if((_=navigator.clipboard)!=null&&_.writeText)navigator.clipboard.writeText(e.content).catch(()=>{});else{const I=document.createElement("textarea");I.value=e.content,I.style.position="fixed",I.style.opacity="0",document.body.appendChild(I),I.select(),document.execCommand("copy"),document.body.removeChild(I)}h(!0),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>h(!1),2e3)},[e.content]),w=p.useCallback(()=>{if(!m){g(!0),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>g(!1),3e3);return}g(!1),v.current&&clearTimeout(v.current),l==null||l(e.id)},[m,e.id,l]),j=p.useCallback(()=>{a==null||a(e)},[e,a]),z=e.created_at?`${e.role==="user"?"Sent":"Replied"} ${Rh(e.created_at)}`:void 0;return s.jsx("div",{className:`msg msg-${e.role} ${u?"msg-error":""}`,title:z,children:s.jsxs("div",{className:"msg-inner",children:[s.jsxs("div",{className:"msg-header",children:[s.jsx("div",{className:"msg-header-left",children:e.role==="assistant"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"msg-avatar msg-avatar-assistant","aria-hidden":"true",children:s.jsx("img",{src:Uy,alt:""})}),s.jsx("span",{className:"msg-role-brand",children:"GAIA"}),(()=>{const I=((c==null?void 0:c.trim())??"").replace(/^gaia\b\s*/i,"");return I?s.jsx("span",{className:"msg-role-agent",children:I}):null})(),(t||e.created_at)&&s.jsx("span",{className:"msg-header-sep",children:"|"}),t&&s.jsx(rE,{active:!!i||!d}),!t&&e.created_at&&s.jsx("span",{className:"msg-timestamp",children:mE(e.created_at)})]})}),!t&&s.jsxs("div",{className:"msg-actions",children:[e.role==="user"&&a&&s.jsx("button",{className:"msg-action-btn",onClick:j,title:"Resend message","aria-label":"Resend message",children:s.jsx(qs,{size:12})}),s.jsx("button",{className:`msg-copy ${f?"copied":""}`,onClick:y,title:f?"Copied!":"Copy message","aria-label":f?"Copied to clipboard":"Copy message",children:f?s.jsx(ci,{size:12}):s.jsx(Nl,{size:12})}),l&&s.jsx("button",{className:`msg-action-btn msg-delete ${m?"confirm":""}`,onClick:w,title:m?"Click again to confirm":"Delete message","aria-label":m?"Confirm delete message":"Delete message",children:s.jsx(fi,{size:12})})]})]}),s.jsxs("div",{className:"msg-body",children:[r&&r.length>0&&s.jsx(qx,{steps:r,isActive:i??!1,variant:i?"inline":"summary"}),u&&s.jsxs("div",{className:"error-banner",children:[s.jsx(ln,{size:14}),s.jsx("span",{children:"Something went wrong"})]}),s.jsx(zu,{content:d,showCursor:(t||n)&&!!d&&!i}),e.role==="assistant"&&!t&&Q_(d)&&s.jsx(Y_,{}),e.role==="assistant"&&!t&&(e.stats||o!=null||e.created_at)&&s.jsxs("div",{className:"msg-stats","aria-label":"Message performance stats",children:[e.created_at&&s.jsx("span",{className:"msg-stats-ts",title:"Message timestamp",children:Rh(e.created_at)}),o!=null&&o>0&&s.jsx("span",{title:"Total response time",children:hE(o)}),((D=e.stats)==null?void 0:D.tokens_per_second)!=null&&e.stats.tokens_per_second>0&&s.jsxs("span",{title:"Tokens per second",children:[e.stats.tokens_per_second," tok/s"]}),((C=e.stats)==null?void 0:C.time_to_first_token)!=null&&e.stats.time_to_first_token>0&&s.jsxs("span",{title:"Time to first token",children:[(e.stats.time_to_first_token*1e3).toFixed(0),"ms TTFT"]}),((A=e.stats)==null?void 0:A.output_tokens)!=null&&e.stats.output_tokens>0&&s.jsxs("span",{title:"Input → output tokens",children:[(e.stats.input_tokens??0).toLocaleString()," → ",e.stats.output_tokens.toLocaleString()," tokens"]})]})]})]})})}function pE({lang:e,code:t}){const[n,r]=p.useState(!1),i=p.useRef(null);p.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]);const l=p.useCallback(()=>{var a;if((a=navigator.clipboard)!=null&&a.writeText)navigator.clipboard.writeText(t).catch(()=>{});else{const o=document.createElement("textarea");o.value=t,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o)}r(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>r(!1),2e3)},[t]);return s.jsxs("div",{className:"code-block",children:[s.jsxs("div",{className:"code-header",children:[s.jsx("span",{className:"code-lang",children:e||"code"}),s.jsxs("button",{className:`code-copy ${n?"copied":""}`,onClick:l,title:n?"Copied!":"Copy","aria-label":n?"Copied to clipboard":"Copy code",children:[n?s.jsx(ci,{size:13}):s.jsx(Nl,{size:13}),s.jsx("span",{children:n?"Copied":"Copy"})]})]}),s.jsx("pre",{children:s.jsx("code",{children:t})})]})}const gE=/[A-Z]:[\\\/](?:[^\s*?"<>|,;)}\]]+[\\\/])*[^\s*?"<>|,;)}\]]*\.\w{1,5}/gi,yE=/[A-Z]:[\\\/](?:[^\s*?"<>|,;)}\]]+[\\\/])+/gi;function xE({path:e}){const t=n=>{n.preventDefault(),zd(e).catch(r=>{E.ui.error("Failed to open path",r)})};return s.jsxs("span",{className:"file-path-link",onClick:t,title:`Open in file explorer: ${e}`,role:"button",tabIndex:0,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),t(n))},children:[s.jsx(er,{size:12,className:"file-path-icon"}),e]})}function vE(e){const t=new RegExp(`(${gE.source}|${yE.source})`,"gi"),n=[];let r=0,i;for(;(i=t.exec(e))!==null;)i.index>r&&n.push(e.slice(r,i.index)),n.push(s.jsx(xE,{path:i[0]},i.index)),r=t.lastIndex;return n.length===0?e:(r<e.length&&n.push(e.slice(r)),s.jsx(s.Fragment,{children:n}))}function Cr(e){return Ki.Children.map(e,t=>typeof t=="string"?vE(t):t)}const kE=/```(email[_-]pre[_-]scan)[ \t]*\r?\n([\s\S]*?)\r?\n```/;function zu({content:e,showCursor:t}){if(!e&&!t)return null;if(!e&&t)return s.jsx("span",{className:"cursor"});const n=kE.exec(e);if(n){const r=e.slice(0,n.index).trim(),i=n[2],l=e.slice(n.index+n[0].length).trim();try{const a=JSON.parse(i);if(Ph(a))return s.jsxs("div",{className:"md-content",children:[r&&s.jsx(zu,{content:r}),s.jsx(Mh,{payload:a}),l&&s.jsx(zu,{content:l}),t&&s.jsx("span",{className:"cursor"})]})}catch{}}return s.jsxs("div",{className:"md-content",children:[s.jsx(v2,{remarkPlugins:[I_],disallowedElements:[...S2],urlTransform:N2,components:{code({className:r,children:i,...l}){return s.jsx("code",{className:"inline-code",...l,children:i})},pre({children:r}){var l,a;const i=Ki.Children.toArray(r)[0];if(Ki.isValidElement(i)&&(i.type==="code"||((l=i.props)==null?void 0:l.className)!==void 0||typeof((a=i.props)==null?void 0:a.children)=="string")){const o=i.props,c=(o==null?void 0:o.className)||"",u=/language-([\w-]+)/.exec(c),d=String((o==null?void 0:o.children)||"").replace(/\n$/,""),f=(u==null?void 0:u[1])||"";if(f==="email_pre_scan"||f==="email-pre-scan")try{const h=JSON.parse(d);if(Ph(h))return s.jsx(Mh,{payload:h})}catch{}return s.jsx(pE,{lang:f,code:d})}return s.jsx("pre",{children:r})},table({children:r}){return s.jsx("div",{className:"md-table-wrap",children:s.jsx("table",{className:"md-table",children:r})})},a({href:r,children:i}){return s.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"md-link",children:i})},p({children:r}){return s.jsx("p",{className:"md-p",children:Cr(r)})},h1({children:r}){return s.jsx("h2",{className:"md-h2",children:Cr(r)})},h2({children:r}){return s.jsx("h3",{className:"md-h3",children:Cr(r)})},h3({children:r}){return s.jsx("h4",{className:"md-h4",children:Cr(r)})},ul({children:r}){return s.jsx("ul",{className:"md-ul",children:r})},ol({children:r}){return s.jsx("ol",{className:"md-ol",children:r})},li({children:r}){return s.jsx("li",{className:"md-li",children:Cr(r)})},blockquote({children:r}){return s.jsx("blockquote",{className:"md-blockquote",children:Cr(r)})},hr(){return s.jsx("hr",{className:"md-hr"})},td({children:r}){return s.jsx("td",{children:Cr(r)})},th({children:r}){return s.jsx("th",{children:Cr(r)})}},children:e}),t&&s.jsx("span",{className:"cursor"})]})}const wE=500,no="gaia_always_allow_tools",ct=Ey((e,t)=>({notifications:[],showPanel:!1,typeFilter:null,addNotification:n=>e(r=>({notifications:[n,...r.notifications].slice(0,wE)})),dismiss:n=>e(r=>({notifications:r.notifications.map(i=>i.id===n?{...i,dismissed:!0}:i)})),markRead:n=>e(r=>({notifications:r.notifications.map(i=>i.id===n?{...i,read:!0}:i)})),markAllRead:()=>e(n=>({notifications:n.notifications.map(r=>({...r,read:!0}))})),clearAll:()=>e({notifications:[]}),setShowPanel:n=>e({showPanel:n}),setTypeFilter:n=>e({typeFilter:n}),respondToPermission:async(n,r,i)=>{var c;const l=t().notifications.find(u=>u.id===n),a=l==null?void 0:l.agentId,o=window.gaiaAPI;if((c=o==null?void 0:o.notification)!=null&&c.respondPermission)try{await o.notification.respondPermission(n,r,i)}catch(u){console.error("[notificationStore] Failed to send permission response via IPC:",u);return}else if(a)try{await Ry(a,r==="allow")}catch(u){console.error("[notificationStore] Failed to send permission response via REST:",u);return}if(r==="allow"&&i&&l!=null&&l.tool){const u=JSON.parse(localStorage.getItem(no)||"[]");u.includes(l.tool)||(u.push(l.tool),localStorage.setItem(no,JSON.stringify(u)))}e(u=>({notifications:u.notifications.map(d=>d.id===n?{...d,response:r,respondedAt:Date.now(),read:!0}:d)}))}})),Qx=e=>e.notifications.filter(t=>!t.read&&!t.dismissed).length,bE=e=>{const t=e.notifications.filter(n=>!n.dismissed);return e.typeFilter?t.filter(n=>n.type===e.typeFilter):t},jE=e=>e.notifications.find(t=>t.type==="permission_request"&&!t.response&&!t.dismissed)??null,Kx="https://github.com/amd/gaia/issues/new",SE=[{label:"Image",extensions:new Set([".jpg",".jpeg",".png",".gif",".bmp",".tiff",".webp",".ico",".heic",".heif"]),message:"Image files cannot be indexed for text search.",alternatives:["Index PDFs that contain images — text is extracted automatically","Paste image descriptions or OCR text directly into the chat","Use GAIA's VLM agent for image analysis: gaia vlm"],featureTitle:"Support image file indexing and OCR"},{label:"Video",extensions:new Set([".mp4",".avi",".mkv",".mov",".wmv",".flv",".webm",".m4v"]),message:"Video files are not supported for indexing.",alternatives:["Extract subtitles or transcripts from videos and index those","Use GAIA's voice/talk mode for audio: gaia talk"],featureTitle:"Support video file indexing"},{label:"Audio",extensions:new Set([".mp3",".wav",".flac",".aac",".ogg",".wma",".m4a",".opus"]),message:"Audio files are not supported for indexing.",alternatives:["Use GAIA's voice mode for speech interaction: gaia talk","Transcribe audio to text first, then index the transcript"],featureTitle:"Support audio file transcription and indexing"},{label:"Archive",extensions:new Set([".zip",".rar",".7z",".tar",".gz",".bz2",".xz",".tgz"]),message:"Archive files must be extracted before indexing.",alternatives:["Extract the archive contents to a folder","Then index the folder or individual files from the Document Library"],featureTitle:"Support automatic archive extraction for indexing"},{label:"Executable",extensions:new Set([".exe",".msi",".dll",".so",".app",".dmg",".bin",".com"]),message:"Executable and binary files cannot be indexed.",alternatives:["Index source code files (.py, .js, .ts, .java, etc.) instead","Index documentation or README files from the project"],featureTitle:"Support binary file analysis"},{label:"Database",extensions:new Set([".sqlite",".db",".mdb",".accdb",".dbf"]),message:"Database files are not supported for direct indexing.",alternatives:["Export data to CSV or JSON format, then index those files","Use SQL queries to extract relevant data to a text file"],featureTitle:"Support database file indexing"},{label:"Microsoft Office",extensions:new Set([".doc",".docx",".ppt",".xls"]),message:"Word, legacy PowerPoint (.ppt), and legacy Excel (.xls) files are not yet supported — GAIA does not currently ship parsers for these formats. Modern PowerPoint (.pptx) is supported.",alternatives:["Save modern PowerPoint as .pptx — GAIA indexes .pptx directly","Save Word as PDF, then index the PDF","Re-save legacy .xls workbooks as .xlsx — GAIA supports modern Excel files"],featureTitle:"Support Microsoft Office (doc, docx, ppt, xls) indexing"}];function Xs(e){const t=e.toLowerCase().startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`;for(const n of SE)if(n.extensions.has(t))return n;return null}const NE=new Set([".pdf",".pptx",".txt",".md",".csv",".json",".xlsx",".html",".htm",".xml",".svg",".yaml",".yml",".py",".js",".ts",".java",".c",".cpp",".h",".rs",".go",".rb",".sh",".bat",".ps1",".log",".cfg",".ini",".toml"]);function ro(e){const t=e.toLowerCase().startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`;return NE.has(t)}function Yx(){const e="0.20.0",t=navigator.userAgent,n=navigator.platform||"unknown";return`**Environment:**
|
|
539
|
+
- GAIA Version: ${e}
|
|
540
|
+
- Platform: ${n}
|
|
541
|
+
- User Agent: ${t}
|
|
542
|
+
- Interface: Agent UI (Web)`}function Fh(e,t){const n=["## Feature Description","",`I would like GAIA to support: **${e}**`,"","## Use Case","","_Describe how you would use this feature:_","","## Current Workaround","","_Is there a workaround you are currently using?_","","---",Yx(),"","_Submitted from GAIA Agent UI_"].join(`
|
|
543
|
+
`),r=new URLSearchParams({title:`[Feature] ${e}`,body:n,labels:"enhancement,agent-ui"});return`${Kx}?${r.toString()}`}function Au(e,t){const n=["## Bug Description","",e,"","## Steps to Reproduce","","1. Open GAIA Agent UI","2. _Describe what you did:_","3. ","","## Expected Behavior","","_What did you expect to happen?_","","## Actual Behavior","","_What happened instead?_","","---",Yx(),"","_Submitted from GAIA Agent UI_"].join(`
|
|
544
|
+
`),r=new URLSearchParams({title:`[Bug] ${e}`,body:n,labels:"bug,agent-ui"});return`${Kx}?${r.toString()}`}function Xx({filename:e,error:t,onDismiss:n,timeout:r=15e3}){var m;const i=p.useRef(null);p.useEffect(()=>(r>0&&(i.current=setTimeout(n,r)),()=>{i.current&&clearTimeout(i.current)}),[n,r]);const l=e.includes(".")?"."+((m=e.split(".").pop())==null?void 0:m.toLowerCase()):"",a=l?Xs(l):null,o=t.toLowerCase().includes("unsupported file type")||t.toLowerCase().includes("not supported for indexing")||a!==null,c=t.toLowerCase().includes("fetch")||t.toLowerCase().includes("network")||t.toLowerCase().includes("connect");let u,d,f,h=pt;return o&&a?(u=`${a.label} files not supported`,d=a.message,f=Fh(a.featureTitle),h=ln):o?(u=`File type not supported: ${l}`,d="This file format cannot be indexed. Supported: PDF, PPTX, TXT, MD, CSV, JSON, XLSX, HTML, XML, YAML, and 30+ code file formats.",f=Fh(`Support ${l} file indexing`),h=ln):c?(u="Connection error",d="Could not reach the GAIA server. Make sure the backend is running.",f=Au(`Upload connection error for ${e}`),h=pt):(u=`Failed to index "${e}"`,d=t||"An unexpected error occurred during indexing.",f=Au(`Indexing error: ${t.slice(0,80)}`),h=Xk),s.jsxs("div",{className:"upload-error-toast",role:"alert",children:[s.jsx(h,{size:16}),s.jsxs("div",{className:"upload-error-content",children:[s.jsx("div",{className:"upload-error-title",children:u}),s.jsxs("div",{className:"upload-error-detail",children:[d," ",o?s.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",children:"Request this feature →"}):s.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",children:"Report this issue →"})]})]}),s.jsx("button",{className:"upload-error-dismiss",onClick:n,"aria-label":"Dismiss",children:s.jsx(Ze,{size:14})})]})}function CE({sessionId:e,onClose:t}){const[n,r]=p.useState(!1),[i,l]=p.useState([]),[a,o]=p.useState([]),c=p.useRef(0),u=p.useRef(null),d=p.useCallback(m=>{l(g=>[...g,m])},[]);p.useEffect(()=>()=>{u.current&&(u.current.abort(),u.current=null)},[]);const f=p.useCallback(()=>{if(n)return;r(!0),l([]),o([]);const m=My(e,"dashboard:refresh",{onChunk:g=>{},onAgentEvent:g=>{const k=++c.current,v=Date.now();g.type==="tool_start"?d({id:k,type:"tool",label:"Using tool",tool:g.tool,detail:g.detail,active:!0,timestamp:v}):g.type==="thinking"?d({id:k,type:"thinking",label:"Thinking",detail:g.content,active:!0,timestamp:v}):g.type==="tool_result"?(d({id:k,type:"tool",label:g.title||"Tool result",detail:g.summary,active:!1,success:g.success,timestamp:v}),o(y=>[...y,{id:k,title:g.title,summary:g.summary}])):g.type==="status"&&d({id:k,type:"status",label:g.message||"Working",detail:g.message,active:g.status==="working",timestamp:v})},onDone:g=>{E.stream.info("Dashboard stream done",g),r(!1)},onError:g=>{E.stream.error("Dashboard stream error",g),r(!1)}});u.current=m},[e,n,d]),h=p.useCallback(async()=>{try{await _0(e),r(!1),u.current&&(u.current.abort(),u.current=null)}catch(m){E.stream.error("Cancel request failed",m)}},[e]);return s.jsxs("div",{className:"dashboard-progress",children:[s.jsxs("div",{className:"dashboard-progress-bar",children:[s.jsxs("div",{className:"dashboard-progress-left",children:[s.jsx(mt,{className:`spin ${n?"visible":"hidden"}`}),s.jsx("strong",{className:"dashboard-title",children:"Refresh progress"})]}),s.jsxs("div",{className:"dashboard-controls",children:[s.jsx("button",{className:"btn btn-plain",onClick:()=>f(),disabled:n,title:"Start refresh",children:"Start"}),s.jsx("button",{className:"btn btn-plain",onClick:h,disabled:!n,title:"Cancel refresh",children:"Cancel"}),s.jsx("button",{className:"btn btn-plain",onClick:()=>{t&&t()},title:"Close",children:"Close"})]})]}),s.jsxs("div",{className:"dashboard-body",children:[s.jsx("div",{className:"dashboard-steps",children:s.jsx(qx,{steps:i,isActive:n,variant:"inline"})}),s.jsxs("div",{className:"dashboard-surfaced",children:[s.jsx("h4",{children:"Surfaced"}),s.jsx("div",{className:"surfaced-list",children:a.map(m=>s.jsx("div",{className:"surfaced-card",children:s.jsxs("div",{className:"surfaced-card-body",children:[s.jsx("div",{className:"surfaced-card-title",children:m.title||"Result"}),s.jsx("div",{className:"surfaced-card-summary",children:m.summary})]})},m.id))})]})]})]})}const _E=["Summarize a document","Find a file on my computer","Analyze a spreadsheet","Show my recent files"],EE=/\s*\{\s*"?(?:tool|thought|goal)"?\s*:\s*"[^"]*"[^}]*(?:"?tool_args"?\s*:\s*\{[^}]*\})?\s*\}/g;function TE(e){const t=e.trim();if(!t.startsWith("{")||!t.includes('"thought"')&&!t.includes('"answer"')&&!t.includes('"goal"'))return e;try{const a=JSON.parse(t);if(a.answer!==void 0)return String(a.answer)}catch{}const n=t.indexOf('"answer"');if(n===-1)return"";const r=t.indexOf(":",n+8);if(r===-1)return"";let i=r+1;for(;i<t.length&&/\s/.test(t[i]);)i++;if(i>=t.length||t[i]!=='"')return"";let l=t.slice(i+1);return l.endsWith('"}')?l=l.slice(0,-2):l.endsWith('"')&&(l=l.slice(0,-1)),l.replace(/\\"/g,'"').replace(/\\n/g,`
|
|
545
|
+
`).replace(/\\\\/g,"\\")}function ra(e,t){var i;const n=++t.current,r=Date.now();switch(e.type){case"thinking":return{id:n,type:"thinking",label:"Thinking",detail:e.content,active:!0,timestamp:r};case"tool_start":return{id:n,type:"tool",label:"Using tool",tool:e.tool,detail:e.detail,active:!0,timestamp:r,mcpServer:e.mcp_server};case"plan":return{id:n,type:"plan",label:"Created plan",planSteps:e.steps,active:!1,success:!0,timestamp:r};case"step":return{id:n,type:"status",label:`Step ${e.step}${e.total?` of ${e.total}`:""}`,active:!0,timestamp:r};case"status":return(i=e.message)!=null&&i.startsWith("Agent: ")?null:{id:n,type:"status",label:e.message||e.status||"Working",active:e.status==="working",timestamp:r};case"agent_error":return{id:n,type:"error",label:"Error",detail:e.content,success:!1,active:!1,timestamp:r};case"policy_alert":{const l=e.tool||"unknown tool",a=e.reason||e.message||e.content||"Tool execution was blocked by governance policy.";return{id:n,type:"policy_alert",label:`Policy blocked ${l}`,detail:a,tool:l,decision:e.decision||"BLOCK",reason:a,ruleIds:e.rule_ids??[],policyVersion:e.policy_version,receiptId:e.receipt_id,success:!1,active:!1,timestamp:r}}default:return null}}function zE(e){return`policy-receipt-${encodeURIComponent(e)}`}function AE({sessionId:e,onCreateAgent:t,onAgentChange:n}){var Il,xi,xs;const{sessions:r,messages:i,setMessages:l,addMessage:a,removeMessage:o,removeMessagesFrom:c,updateSessionInList:u,isStreaming:d,streamingContent:f,setStreaming:h,setStreamContent:m,clearStreamContent:g,agentSteps:k,addAgentStep:v,updateLastAgentStep:y,appendThinkingContent:w,updateLastToolStep:j,clearAgentSteps:z,documents:D,setDocuments:C,setShowDocLibrary:A,setShowFileBrowser:_,setShowMemoryDashboard:I,isLoadingMessages:N,setLoadingMessages:U,systemStatus:O,agents:re,activeAgentId:oe,setActiveAgentId:te}=ve(),le=ct(L=>L.addNotification),fe=ct(L=>L.showPanel),T=ct(L=>L.setShowPanel),P=ct(L=>L.setTypeFilter),b=ct(Qx),X=ve(L=>L.pendingPrompt),H=r.find(L=>L.id===e),S=new Set((H==null?void 0:H.document_ids)??[]),ie=D.filter(L=>S.has(L.id)),[ye,ae]=p.useState(""),[je,Ge]=p.useState(!1),[qe,Xe]=p.useState(""),[M,R]=p.useState(!1),[B,pe]=p.useState(!1),[ge,ce]=p.useState([]),[we,G]=p.useState([]),[ze,Te]=p.useState(!1),[Qe,Se]=p.useState(null),[Fe,Ht]=p.useState(null),[Mn,F]=p.useState(!1),[K,ue]=p.useState(!1),ke=p.useRef(null),Ne=(H==null?void 0:H.agent_type)||oe,wt=(Il=re.find(L=>L.id===(H==null?void 0:H.agent_type)))==null?void 0:Il.name,gt=(xi=re.find(L=>L.id===oe))==null?void 0:xi.name;p.useEffect(()=>{if(!K)return;const L=Q=>{ke.current&&!ke.current.contains(Q.target)&&ue(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[K]);const Ke=p.useCallback(async L=>{if(ue(!1),L===Ne)return;const Q=Ne;if(te(L),i.length===0){u(e,{agent_type:L});try{await sc(e,{agent_type:L})}catch{u(e,{agent_type:Q}),te(Q)}}else n==null||n(L)},[Ne,i.length,e,te,u,n]),[Pt,Jt]=p.useState(!1),it=p.useRef(""),Mt=p.useRef([]),bt=p.useRef(!1);p.useEffect(()=>{f&&(it.current=f)},[f]),p.useEffect(()=>{k.length>0&&(Mt.current=k.map(L=>({...L,active:!1})))},[k]),p.useEffect(()=>{if(!d&&bt.current){Jt(!0);const L=setTimeout(()=>{Jt(!1),it.current="",Mt.current=[]},350);return()=>clearTimeout(L)}bt.current=d},[d]);const vn=p.useRef(null),dn=p.useRef(null),Zt=p.useRef(null),en=p.useRef(null),cr=p.useRef(0),kn=p.useRef(!1),ms=p.useRef(()=>{}),wn=p.useRef(""),yt=p.useRef(null),Gn=p.useRef(null),ur=p.useRef(null),Tl=p.useRef(0),dr=p.useRef(!0),fr=p.useCallback(()=>{yt.current=null,wn.current&&m(wn.current)},[m]),mr=p.useRef(null),lt=p.useRef(0);p.useEffect(()=>{E.chat.info(`ChatView mounted for session=${e}, loading messages...`);const L=E.chat.time();U(!0);let Q=!1;const ee=(J=!1)=>{Rs(e).then(xe=>{if(Q)return;const Ae=(xe.messages||[]).map(xt=>({...xt,agentSteps:xt.agentSteps||xt.agent_steps||void 0,stats:xt.stats||xt.inference_stats||void 0}));J?(l(Ae),lt.current=Ae.length,E.chat.timed(`Loaded ${Ae.length} message(s) for session=${e}`,L)):Ae.length!==lt.current&&!ve.getState().isStreaming&&(E.chat.info(`Messages changed externally: ${lt.current} -> ${Ae.length}`),l(Ae),lt.current=Ae.length)}).catch(xe=>{Q||J&&(E.chat.error(`Failed to load messages for session=${e}`,xe),l([]))}).finally(()=>{!Q&&J&&U(!1)})};return ee(!0),mr.current=setInterval(()=>ee(!1),3e3),()=>{Q=!0,mr.current&&clearInterval(mr.current)}},[e,l,U]),p.useEffect(()=>{Ni().then(L=>C(L.documents||[])).catch(()=>{})},[C]),p.useEffect(()=>{const L=ve.getState().pendingPrompt;if(!L)return;E.chat.info(`Consuming pending prompt: "${L.slice(0,60)}"`),ve.getState().setPendingPrompt(null),ae(L);let Q=!1;return requestAnimationFrame(()=>{Q||ms.current(L)}),()=>{Q=!0}},[X]),p.useEffect(()=>{if(!dr.current)return;const Q=Date.now()-Tl.current,ee=100,J=()=>{var xe;Tl.current=Date.now(),(xe=vn.current)==null||xe.scrollIntoView({behavior:"smooth"})};Q>=ee&&J(),ur.current&&clearTimeout(ur.current),ur.current=setTimeout(J,ee)},[i,f,k]),p.useEffect(()=>{var L;(L=Zt.current)==null||L.focus()},[e]),p.useEffect(()=>()=>{en.current&&(en.current.abort(),en.current=null),yt.current!==null&&(cancelAnimationFrame(yt.current),yt.current=null),ur.current&&(clearTimeout(ur.current),ur.current=null),Gn.current&&(clearTimeout(Gn.current),Gn.current=null),Ht(null),wn.current="",G(L=>(L.forEach(Q=>{Q.url&&URL.revokeObjectURL(Q.url)}),[]))},[e]);const hr=p.useCallback(()=>{const L=dn.current;if(!L)return;const Q=L.scrollHeight-L.scrollTop-L.clientHeight;dr.current=Q<=80,pe(Q>200)},[]),hs=p.useCallback(()=>{var L;dr.current=!0,(L=vn.current)==null||L.scrollIntoView({behavior:"smooth"})},[]),bn=p.useCallback(()=>{E.stream.warn("User stopped generation"),en.current&&(en.current.abort(),en.current=null),yt.current!==null&&(cancelAnimationFrame(yt.current),yt.current=null);const L=ve.getState(),Q=wn.current||L.streamingContent;if(Q){E.stream.info(`Saving partial response (${Q.length} chars)`);const ee=L.agentSteps,J={id:Date.now()+1,session_id:e,role:"assistant",content:Q,created_at:new Date().toISOString(),rag_sources:null,agentSteps:ee.length>0?[...ee]:void 0};a(J)}wn.current="",h(!1),g(),ce([]),z()},[e,a,h,g,z]);p.useEffect(()=>{const L=Q=>{Q.key==="Escape"&&d&&(Q.preventDefault(),bn()),Q.key==="k"&&(Q.ctrlKey||Q.metaKey)&&(Q.preventDefault(),window.dispatchEvent(new CustomEvent("gaia:focus-search")))};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[d,bn]);const qn=L=>{ae(L.target.value);const Q=L.target;Q.style.height="auto",Q.style.height=Math.min(Q.scrollHeight,200)+"px"},pr=p.useCallback(async L=>{var J;const Q=(J=L.clipboardData)==null?void 0:J.items;if(!Q)return;const ee=[];for(const xe of Array.from(Q))xe.type.startsWith("image/")&&ee.push(xe);if(ee.length!==0){L.preventDefault();for(const xe of ee){const Ae=xe.getAsFile();if(!Ae)continue;const xt=`attach-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,kr=URL.createObjectURL(Ae),at={id:xt,file:Ae,name:Ae.name||`screenshot-${new Date().toISOString().slice(0,19).replace(/[T:]/g,"-")}.png`,url:kr,uploading:!0,uploaded:!1,isImage:!0};G(Et=>[...Et,at]),E.chat.info(`Pasted image: ${at.name} (${Ae.size} bytes)`);try{const Et=await Rm(Ae);G(St=>St.map(V=>V.id===xt?{...V,uploading:!1,uploaded:!0,serverUrl:Et.url}:V)),E.chat.info(`Upload complete: ${at.name} -> ${Et.url}`)}catch(Et){E.chat.error(`Upload failed: ${at.name}`,Et),G(St=>St.map(V=>V.id===xt?{...V,uploading:!1,error:"Upload failed"}:V))}}}},[]),zl=p.useCallback(async L=>{var ee;L.preventDefault(),L.stopPropagation(),R(!1);const Q=(ee=L.dataTransfer)==null?void 0:ee.files;if(!(!Q||Q.length===0))for(const J of Array.from(Q)){const xe=J.type.startsWith("image/"),Ae=`attach-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,xt=xe?URL.createObjectURL(J):"",kr={id:Ae,file:J,name:J.name,url:xt,uploading:!0,uploaded:!1,isImage:xe};G(at=>[...at,kr]),E.chat.info(`Dropped file: ${J.name} (${J.size} bytes, image=${xe})`);try{const at=await Rm(J);G(Et=>Et.map(St=>St.id===Ae?{...St,uploading:!1,uploaded:!0,serverUrl:at.url}:St)),E.chat.info(`Upload complete: ${J.name} -> ${at.url}`)}catch(at){E.chat.error(`Upload failed: ${J.name}`,at),G(Et=>Et.map(St=>St.id===Ae?{...St,uploading:!1,error:"Upload failed"}:St))}}},[]),Al=p.useCallback(L=>{G(Q=>{const ee=Q.find(J=>J.id===L);return ee!=null&&ee.url&&URL.revokeObjectURL(ee.url),Q.filter(J=>J.id!==L)})},[]),jn=p.useCallback(async L=>{const Q=(L||ye).trim(),ee=we.length>0&&we.some(V=>V.uploaded);dr.current=!0;const J=(O==null?void 0:O.init_state)==="initializing";if(!Q&&!ee||d||J){!Q&&!ee&&E.chat.debug("Send blocked: empty message"),d&&E.chat.debug("Send blocked: already streaming"),J&&E.chat.debug("Send blocked: system initializing");return}let xe=Q;const Ae=we.filter(V=>V.uploaded&&V.serverUrl);if(Ae.length>0){const V=Ae.map(Z=>Z.isImage?``:`[${Z.name}](${Z.serverUrl})`).join(`
|
|
546
|
+
`);xe=xe?`${xe}
|
|
547
|
+
|
|
548
|
+
${V}`:V}E.chat.info(`Sending message to session=${e}`,{length:xe.length,preview:xe.slice(0,80)}),ae(""),Zt.current&&(Zt.current.style.height="auto",Zt.current.focus()),G(V=>(V.forEach(Z=>{Z.url&&URL.revokeObjectURL(Z.url)}),[]));const xt={id:Date.now(),session_id:e,role:"user",content:xe,created_at:new Date().toISOString(),rag_sources:null};a(xt),h(!0),g(),z(),ce([]),cr.current=0,kn.current=!1,E.stream.info("Starting agent stream...");const kr=E.stream.time();let at="",Et=!1;wn.current="";const St=My(e,xe,{onChunk:V=>{const Z=V.content||"";if(Z){V.type==="answer"?at=Z:(kn.current&&at.length>0&&(at+=`
|
|
549
|
+
|
|
550
|
+
`,kn.current=!1),at+=Z);let Ee=at.replace(EE,"").trim();if(Ee=TE(Ee),Ee){const dt=Ee.lastIndexOf("{");if(dt>-1){const Pe=Ee.slice(dt);/^\{\s*"(?:thought|answer|goal|tool)"/.test(Pe)&&(Pe.match(/\{/g)||[]).length>(Pe.match(/\}/g)||[]).length&&(Ee=Ee.slice(0,dt).trim())}}wn.current=Ee,yt.current===null&&(yt.current=requestAnimationFrame(fr))}},onAgentEvent:V=>{var Ee,dt,Pe;if(V.type==="tool_confirm"){if(!V.confirm_id){console.error("[ChatView] tool_confirm event missing confirm_id, ignoring");return}const De=V.tool||"";if(JSON.parse(localStorage.getItem(no)||"[]").includes(De)){C0(e,V.confirm_id,"allow",!1).catch(nt=>console.error("[ChatView] auto-confirm failed:",nt));return}const Vt={id:V.confirm_id,type:"permission_request",agentId:"chat",agentName:"GAIA",title:`Allow ${De}?`,message:`The agent wants to execute: ${De}`,timestamp:Date.now(),read:!1,dismissed:!1,priority:"high",tool:De,toolArgs:V.args,timeoutSeconds:V.timeout_seconds??60};le(Vt);return}if(V.type==="permission_request"){const De=V.tool||"";if(JSON.parse(localStorage.getItem(no)||"[]").includes(De)){Ry(e,!0).catch(nt=>console.error("[ChatView] auto-confirm failed:",nt));return}const{addNotification:Vt}=ct.getState();Vt({id:V.confirm_id??`perm-${Date.now()}`,type:"permission_request",agentId:e,agentName:"GAIA",title:`Allow ${De}?`,message:`The agent wants to execute: ${De}`,timestamp:Date.now(),read:!1,dismissed:!1,priority:"high",tool:De,toolArgs:V.args,timeoutSeconds:V.timeout_seconds??60});return}if(V.type==="policy_alert"){const De=V.tool||"unknown tool",Re=V.reason||V.message||V.content||"Tool execution was blocked by governance policy.",Vt={id:V.receipt_id??`policy-${Date.now()}-${cr.current+1}`,type:"policy_alert",agentId:e,agentName:"GAIA",title:`Blocked: ${De} is restricted by policy.`,message:Re,timestamp:Date.now(),read:!1,dismissed:!1,priority:"critical",tool:De,decision:V.decision||"BLOCK",reason:Re,ruleIds:V.rule_ids??[],policyVersion:V.policy_version,receiptId:V.receipt_id};le(Vt);const nt=ra(V,cr);nt&&v(nt),Ht({tool:De,receiptId:V.receipt_id}),Gn.current&&clearTimeout(Gn.current),Gn.current=setTimeout(()=>Ht(null),5200);return}if(V.type==="tool_end"){j({active:!1,success:V.success!==!1});return}if(V.type==="tool_result"){const De={result:V.summary||V.title||"Done",active:!1,success:V.success!==!1,latencyMs:V.latency_ms};V.command_output&&(De.commandOutput={command:V.command_output.command,stdout:V.command_output.stdout,stderr:V.command_output.stderr,returnCode:V.command_output.return_code,cwd:V.command_output.cwd,durationSeconds:V.command_output.duration_seconds,truncated:V.command_output.truncated}),(Ee=V.result_data)!=null&&Ee.chunks&&V.result_data.chunks.length>0&&(De.retrievalChunks=V.result_data.chunks.map(Re=>({id:Re.id,source:Re.source,sourcePath:Re.sourcePath,page:Re.page,score:Re.score,preview:Re.preview,content:Re.content}))),((dt=V.result_data)==null?void 0:dt.type)==="file_list"&&((Pe=V.result_data.files)==null?void 0:Pe.length)>0&&(De.fileList={files:V.result_data.files,total:V.result_data.total??V.result_data.files.length}),j(De);return}if(V.type==="tool_args"){j({detail:V.detail||JSON.stringify(V.args)});return}if(V.type==="thinking"){const De=ve.getState().agentSteps,Re=De[De.length-1];if(Re&&Re.type==="thinking"){w(V.content||"");return}const Vt=ra(V,cr);Vt&&v(Vt);return}if(V.type==="status"){const De=V.status,Re=(V.message||"").trim();if(Re.toLowerCase().startsWith("executing "))return;if(De==="working"||De==="warning"||De==="info"){const Vt=ve.getState().agentSteps,nt=Vt[Vt.length-1];if(nt&&nt.type==="status"&&nt.active){y({label:Re||"Working",detail:Re});return}if(nt&&nt.type==="thinking"&&nt.active){y({label:Re||"Thinking"});return}const vs=ra(V,cr);vs&&v(vs)}return}if(V.type==="step")return;const Z=ra(V,cr);Z&&(v(Z),V.type==="tool_start"&&(kn.current=!0))},onDone:V=>{if(Et)return;Et=!0,yt.current!==null&&(cancelAnimationFrame(yt.current),yt.current=null),wn.current="";const Z=V.content||at;E.chat.timed(`Agent response complete: ${Z.length} chars`,kr);const Ee=ve.getState().agentSteps.map(Pe=>({...Pe,active:!1})),dt=Ee.some(Pe=>Pe.type==="policy_alert");if(Z||dt){lt.current=ve.getState().messages.length+1;const Pe={id:V.message_id||Date.now()+1,session_id:e,role:"assistant",content:Z,created_at:new Date().toISOString(),rag_sources:null,agentSteps:Ee.length>0?Ee:void 0,stats:V.stats||void 0};a(Pe)}if(ce(Ee),h(!1),g(),z(),Zt.current&&Zt.current.focus(),setTimeout(()=>{Rs(e).then(Pe=>{if(ve.getState().currentSessionId!==e)return;const De=(Pe.messages||[]).map(Re=>({...Re,agentSteps:Re.agentSteps||Re.agent_steps||void 0,stats:Re.stats||Re.inference_stats||void 0}));l(De),lt.current=De.length}).catch(()=>{})},300),H&&H.title==="New Task"){const Pe=Q.slice(0,50)+(Q.length>50?"...":"");sc(e,{title:Pe}).then(()=>u(e,{title:Pe})).catch(De=>E.chat.error("Auto-title failed",De))}},onError:V=>{yt.current!==null&&(cancelAnimationFrame(yt.current),yt.current=null),wn.current="",E.chat.error(`Chat error for session=${e}`,V);let Z;const Ee=V.message||"",dt=`
|
|
551
|
+
|
|
552
|
+
---
|
|
553
|
+
*Unexpected error?* [Report it on GitHub](${Au(Ee.slice(0,80))})`;Ee.includes("Lemonade")||Ee.includes("LLM")||Ee.includes("Could not get response")?Z="Could not reach the LLM server. Make sure Lemonade Server is running:\n\n```\nlemonade-server serve\n```\n\nThen try sending your message again."+dt:V instanceof TypeError||Ee.includes("fetch")||Ee.includes("Failed to fetch")||Ee.includes("NetworkError")?Z="Cannot connect to the GAIA server. Make sure the backend is running:\n\n```\ngaia chat --ui\n```"+dt:Ee.includes("500")?Z="The server encountered an error. This usually means Lemonade Server is not running or the model failed to load.\n\nStart Lemonade Server with:\n```\nlemonade-server serve\n```"+dt:Ee.includes("timed out")||Ee.includes("timeout")||Ee.includes("Timeout")?Z=`The request timed out. The query may be too complex — try breaking it into simpler questions.
|
|
554
|
+
|
|
555
|
+
If Lemonade Server is running but responses are slow, the model may need more resources.`+dt:Z=`Error: ${Ee}`+dt;const Pe={id:Date.now()+2,session_id:e,role:"assistant",content:Z,created_at:new Date().toISOString(),rag_sources:null};a(Pe),h(!1),g(),z()},onAgentCreated:()=>{Ed().then(V=>ve.getState().setAgents(V.agents||[])).catch(()=>{})}},void 0,void 0,oe);en.current=St},[ye,we,d,e,H,a,l,h,fr,g,u,v,y,w,j,z,oe,le]);ms.current=jn,p.useEffect(()=>{const L=Q=>{var xe;const J=(xe=Q.detail)==null?void 0:xe.text;typeof J=="string"&&J.trim()&&ms.current(J)};return window.addEventListener("gaia:send-message",L),()=>window.removeEventListener("gaia:send-message",L)},[]),p.useEffect(()=>{!d&&Zt.current&&Zt.current.focus()},[d]);const gr=p.useCallback(async L=>{d||(E.chat.info(`Deleting message ${L} from session=${e}`),Se(L),setTimeout(async()=>{o(L),Se(null);try{await j0(e,L)}catch(Q){E.chat.error(`Failed to delete message ${L}`,Q),Rs(e).then(ee=>{ve.getState().currentSessionId===e&&l(ee.messages||[])}).catch(()=>{})}},250))},[e,d,o,l]),jt=p.useCallback(async L=>{if(d||L.role!=="user")return;const Q=L.content;E.chat.info(`Resending message ${L.id} from session=${e}`,{preview:Q.slice(0,80)}),c(L.id);try{await S0(e,L.id)}catch(ee){E.chat.error(`Failed to delete messages from ${L.id}`,ee),Rs(e).then(J=>{ve.getState().currentSessionId===e&&l(J.messages||[])}).catch(()=>{});return}jn(Q)},[e,d,c,l,jn]),yr=L=>{L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),jn())},ps=()=>{Xe((H==null?void 0:H.title)||""),Ge(!0)},Rn=async()=>{qe.trim()&&qe!==(H==null?void 0:H.title)&&(await sc(e,{title:qe.trim()}),u(e,{title:qe.trim()})),Ge(!1)},Qn=p.useCallback(async()=>{if(e)try{const L=await w0(e);u(e,{private:L.private})}catch(L){E.ui.warn("Failed to toggle private mode",L)}},[e,u]),xr=async()=>{try{const L=await b0(e),Q=new Blob([L.content],{type:"text/markdown"}),ee=URL.createObjectURL(Q),J=document.createElement("a");J.href=ee;const xe=((H==null?void 0:H.title)||"chat").replace(/[/\\:*?"<>|]/g,"_").slice(0,100);J.download=`${xe}.md`,J.click(),URL.revokeObjectURL(ee)}catch(L){E.chat.error("Export failed",L)}},Ll=p.useCallback(async(L,Q)=>{L.stopPropagation();const ee=D.find(J=>J.id===Q);E.doc.info(`Detaching document from session: ${(ee==null?void 0:ee.filename)||Q}`);try{await A0(e,Q);const J=ve.getState().sessions.find(Ae=>Ae.id===e),xe=((J==null?void 0:J.document_ids)??[]).filter(Ae=>Ae!==Q);u(e,{document_ids:xe}),xe.length<=3&&Te(!1),E.doc.info(`Detached document from session: ${(ee==null?void 0:ee.filename)||Q}`)}catch(J){E.doc.error(`Failed to detach document: ${(ee==null?void 0:ee.filename)||Q}`,J)}},[D,e,u]),Dl=p.useCallback(async L=>{if(L.preventDefault(),L.stopPropagation(),R(!1),L.dataTransfer.files.length!==0)for(const Q of Array.from(L.dataTransfer.files)){E.doc.info(`Dropped on chat view: ${Q.name}`);try{const ee=await Fy(Q);if(e&&(ee!=null&&ee.id))try{await Xa(e,ee.id);const J=ve.getState().sessions.find(Ae=>Ae.id===e),xe=(J==null?void 0:J.document_ids)??[];xe.includes(ee.id)||u(e,{document_ids:[...xe,ee.id]}),E.doc.info(`Auto-attached "${Q.name}" to session ${e}`)}catch(J){E.doc.warn(`Could not attach dropped document to session: ${J}`)}}catch(ee){E.doc.error(`Upload failed: ${Q.name}`,ee)}}},[e,u]),gs=L=>{L.preventDefault(),L.stopPropagation(),R(!0)},Ao=L=>{L.preventDefault(),L.stopPropagation(),R(!1)},yi=L=>{ae(L),jn(L)},vr=!N&&i.length===0&&!d,ys=p.useMemo(()=>{const L=new Map;let Q;for(const ee of i)if(ee.role==="user"&&ee.created_at)Q=new Date(ee.created_at).getTime();else if(ee.role==="assistant"&&ee.created_at&&Q!==void 0){const J=new Date(ee.created_at).getTime();J>Q&&L.set(ee.id,J-Q),Q=void 0}return L},[i]);return s.jsxs("main",{className:`task-view ${M?"drag-active":""}`,onDrop:Dl,onDragOver:gs,onDragLeave:Ao,children:[Mn&&s.jsx("div",{className:"dashboard-overlay",children:s.jsx(CE,{sessionId:e,onClose:()=>F(!1)})}),s.jsxs("header",{className:"task-header",children:[s.jsx("div",{className:"task-header-left",children:je?s.jsx("input",{className:"title-edit",value:qe,onChange:L=>Xe(L.target.value),onBlur:Rn,onKeyDown:L=>L.key==="Enter"&&Rn(),autoFocus:!0,"aria-label":"Edit task title"}):s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"task-title",children:(H==null?void 0:H.title)||"New Task"}),s.jsx("button",{className:"btn-icon-sm",onClick:ps,title:"Rename","aria-label":"Rename task",children:s.jsx(xw,{size:13})})]})}),s.jsxs("div",{className:"task-header-right",children:[s.jsxs("span",{className:`model-badge ${O!=null&&O.model_loaded?"":"no-model"}`,title:O!=null&&O.model_loaded&&(O!=null&&O.model_context_size)?`${O.model_loaded} · context window: ${O.model_context_size.toLocaleString()} tokens`:(O==null?void 0:O.model_loaded)||"No model loaded",children:[(O==null?void 0:O.model_loaded)||"No model loaded",(O==null?void 0:O.model_loaded)&&(O==null?void 0:O.model_context_size)!=null&&s.jsxs("span",{className:"model-ctx-size",children:[" · ",O.model_context_size%1024===0?`${O.model_context_size/1024}K`:O.model_context_size.toLocaleString()]})]}),s.jsx("button",{className:"btn-icon-sm",onClick:()=>A(!0),title:"Documents","aria-label":"Attach documents",children:s.jsx(yw,{size:15})}),s.jsx("button",{className:"btn-icon-sm",onClick:()=>_(!0),title:"Browse files","aria-label":"Browse files",children:s.jsx(pu,{size:15})}),s.jsx("button",{className:`btn-icon-sm${H!=null&&H.private?" active":""}`,onClick:Qn,title:H!=null&&H.private?"Private mode on — click to disable":"Enable private mode (nothing saved to memory)","aria-label":H!=null&&H.private?"Disable private mode":"Enable private mode","aria-pressed":!!(H!=null&&H.private),children:s.jsx(hy,{size:15})}),s.jsx("button",{className:"btn-icon-sm",onClick:()=>I(!0),title:"Memory","aria-label":"Open memory dashboard",children:s.jsx(ti,{size:15})}),s.jsx("button",{className:"btn-icon-sm",onClick:xr,title:"Export","aria-label":"Export task",children:s.jsx(di,{size:15})}),s.jsx("button",{className:"btn-icon-sm",onClick:()=>F(L=>!L),title:"Refresh dashboard","aria-label":"Refresh dashboard",children:s.jsx(Em,{size:15})}),s.jsxs("button",{className:`notification-center-trigger ${b>0?"has-unread":""}`,onClick:()=>T(!fe),"aria-label":"Open notification center","aria-expanded":fe,title:"Notifications",children:[s.jsx(dy,{size:15}),b>0&&s.jsx("span",{className:"notification-center-trigger-badge",children:b>99?"99+":b})]})]})]}),ie.length>0&&(()=>{const L=[...ie].sort((J,xe)=>{const Ae=J.last_accessed_at||J.indexed_at||"";return(xe.last_accessed_at||xe.indexed_at||"").localeCompare(Ae)}),Q=ze?L:L.slice(0,3),ee=L.length-3;return s.jsxs("div",{className:`doc-context-bar${ze?" doc-context-expanded":""}`,"aria-label":`${ie.length} indexed document${ie.length!==1?"s":""}`,children:[s.jsx(Vn,{size:12,className:"doc-context-icon"}),s.jsxs("span",{className:"doc-context-label",onClick:()=>A(!0),title:"Click to manage documents",role:"button",tabIndex:0,children:[ie.length," indexed"]}),s.jsxs("div",{className:`doc-context-pills${ze?" doc-context-pills-expanded":""}`,children:[Q.map(J=>s.jsxs("span",{className:"doc-pill",title:J.filepath||J.filename,children:[s.jsx(zn,{size:9,className:"doc-pill-icon"}),s.jsx("span",{className:"doc-pill-name",children:J.filename}),s.jsx("button",{className:"doc-pill-remove",onClick:xe=>Ll(xe,J.id),title:`Remove ${J.filename} from this session`,"aria-label":`Remove ${J.filename} from this session`,children:s.jsx(Ze,{size:10})})]},J.id)),!ze&&ee>0&&s.jsxs("button",{className:"doc-pill-more",onClick:J=>{J.stopPropagation(),Te(!0)},title:"Show all indexed files","aria-label":`Show ${ee} more files`,children:["+",ee," more"]}),ze&&ee>0&&s.jsx("button",{className:"doc-pill-collapse",onClick:J=>{J.stopPropagation(),Te(!1)},title:"Show fewer files","aria-label":"Collapse file list",children:"show less"})]})]})})(),s.jsxs("div",{className:"messages-scroll",ref:dn,onScroll:hr,children:[N&&s.jsx("div",{className:"skeleton-messages","aria-label":"Loading messages",children:[0,1,2].map(L=>s.jsxs("div",{className:"skeleton-msg",children:[s.jsxs("div",{className:"skeleton-header",children:[s.jsx("div",{className:"skeleton-avatar"}),s.jsx("div",{className:"skeleton-role"})]}),s.jsxs("div",{className:"skeleton-lines",children:[s.jsx("div",{className:"skeleton-line"}),s.jsx("div",{className:"skeleton-line"}),L!==2&&s.jsx("div",{className:"skeleton-line"})]})]},L))}),vr&&s.jsxs("div",{className:"empty-task",children:[s.jsx("div",{className:"empty-task-icon",children:s.jsx(gu,{size:36,strokeWidth:1.2})}),s.jsx("h4",{className:"empty-task-title",children:"What can I help you with?"}),s.jsx("p",{className:"empty-task-desc",children:"Ask about your documents, search files, or analyze data — powered by local AI."}),s.jsx("div",{className:"empty-task-suggestions",children:_E.map(L=>s.jsx("button",{className:"empty-task-chip",onClick:()=>yi(L),children:L},L))})]}),i.map((L,Q)=>{const ee=!d&&!Pt&&L.role==="assistant"&&i.slice(Q+1).every(Ae=>Ae.role!=="assistant");if(Pt&&L.role==="assistant"&&Q===i.length-1)return null;const xe=ys.get(L.id);return s.jsx("div",{className:Qe===L.id?"msg-deleting":void 0,children:s.jsx($h,{message:L,showTerminalCursor:ee,agentSteps:L.role==="assistant"?L.agentSteps:void 0,onDelete:d?void 0:gr,onResend:!d&&L.role==="user"?jt:void 0,latencyMs:xe,agentName:L.role==="assistant"?wt:void 0})},L.id)}),(d||Pt)&&s.jsx("div",{className:`streaming-bubble ${Pt?"stream-ending":"stream-active"}`,children:s.jsx($h,{message:{id:-1,session_id:e,role:"assistant",content:(d?f:it.current)||"",created_at:"",rag_sources:null},isStreaming:d,showTerminalCursor:Pt,agentSteps:d?k:Mt.current,agentStepsActive:d&&k.some(L=>L.active),agentName:gt})}),s.jsx("div",{ref:vn})]}),B&&s.jsx("button",{className:"scroll-bottom-btn",onClick:hs,title:"Scroll to bottom","aria-label":"Scroll to bottom",children:s.jsx(Em,{size:16})}),M&&s.jsxs("div",{className:"drag-overlay",children:[s.jsx(yl,{size:32,strokeWidth:1.5}),s.jsx("span",{children:"Drop files to index"})]}),Fe&&s.jsxs("div",{className:"toast policy-alert-toast",role:"alert",children:[s.jsxs("span",{children:["Blocked: ",Fe.tool," is restricted by policy."]}),Fe.receiptId?s.jsx("button",{type:"button",className:"policy-alert-toast-link",onClick:()=>{const L=Fe.receiptId;L&&(P("policy_alert"),T(!0),window.setTimeout(()=>{var Q;(Q=document.getElementById(zE(L)))==null||Q.scrollIntoView({behavior:"smooth",block:"center"})},80))},children:"View receipt"}):s.jsx("span",{className:"policy-alert-toast-missing",children:"Receipt unavailable"})]}),s.jsxs("div",{className:"input-area",children:[s.jsxs("div",{className:`input-box ${we.length>0?"has-attachments":""}`,onDrop:zl,onDragOver:L=>{L.preventDefault(),L.stopPropagation()},children:[s.jsxs("div",{className:"input-content",children:[we.length>0&&s.jsx("div",{className:"attachment-strip",children:we.map(L=>s.jsxs("div",{className:`attachment-preview ${L.error?"attachment-error":""}`,children:[L.isImage&&L.url?s.jsx("img",{src:L.url,alt:L.name,className:"attachment-thumb"}):s.jsx("div",{className:"attachment-file-icon",children:s.jsx(zn,{size:16})}),s.jsx("span",{className:"attachment-name",title:L.name,children:L.name.length>20?L.name.slice(0,17)+"...":L.name}),L.uploading&&s.jsx("span",{className:"attachment-spinner"}),L.error&&s.jsx("span",{className:"attachment-error-text",children:L.error}),s.jsx("button",{className:"attachment-remove",onClick:()=>Al(L.id),title:"Remove","aria-label":`Remove ${L.name}`,children:s.jsx(Ze,{size:12})})]},L.id))}),s.jsx("textarea",{ref:Zt,className:"msg-input",value:ye,onChange:qn,onKeyDown:yr,onPaste:pr,placeholder:"Type a message or paste an image... (Shift+Enter for new line)",rows:1,disabled:d||(O==null?void 0:O.init_state)==="initializing","aria-label":"Message input"})]}),s.jsxs("div",{className:"input-btns",children:[s.jsx("button",{className:"btn-icon-sm",onClick:()=>A(!0),title:"Upload document","aria-label":"Upload document",children:s.jsx(yl,{size:15})}),s.jsx("button",{className:"btn-icon-sm",onClick:()=>_(!0),title:"Browse files","aria-label":"Browse files",children:s.jsx(pu,{size:15})}),d?s.jsx("button",{className:"stop-btn",onClick:bn,title:"Stop generating","aria-label":"Stop generating",children:s.jsx(Cw,{size:14})}):s.jsx("button",{className:"send-btn",onClick:()=>jn(),disabled:!ye.trim()&&!we.some(L=>L.uploaded),title:"Send (Enter)","aria-label":"Send message",children:s.jsx(ww,{size:16})})]})]}),s.jsxs("div",{className:"input-footer",children:[t&&s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"create-agent-btn",onClick:t,title:"Build a custom agent","aria-label":"Build a custom agent",children:s.jsx(gl,{size:10})}),re.length>1&&s.jsx("span",{className:"input-footer-sep"})]}),re.length>1&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"agent-picker",ref:ke,children:[s.jsxs("button",{className:"agent-picker-btn",onClick:()=>!d&&ue(L=>!L),title:"Switch agent","aria-label":"Switch agent",disabled:d,children:[s.jsx(qa,{size:10}),s.jsx("span",{children:((xs=re.find(L=>L.id===Ne))==null?void 0:xs.name)||"Agent"}),s.jsx(ui,{size:10})]}),K&&s.jsx("div",{className:"agent-picker-dropdown",children:re.map(L=>s.jsxs("button",{className:`agent-picker-option${L.id===Ne?" active":""}`,onClick:()=>Ke(L.id),children:[s.jsx(qa,{size:12}),s.jsx("span",{children:L.name})]},L.id))})]}),s.jsx("span",{className:"input-footer-sep"})]}),s.jsxs("span",{className:"input-footer-item",children:[s.jsx(vy,{size:10}),s.jsx("span",{children:"100% local & private"})]}),s.jsx("span",{className:"input-footer-sep"}),s.jsxs("span",{className:"input-footer-item",children:[s.jsx("kbd",{className:"kbd-hint",children:"Enter"}),s.jsx("span",{children:"send"})]}),s.jsxs("span",{className:"input-footer-item",children:[s.jsx("kbd",{className:"kbd-hint",children:"Shift+Enter"}),s.jsx("span",{children:"new line"})]}),d&&s.jsxs("span",{className:"input-footer-item",children:[s.jsx("kbd",{className:"kbd-hint",children:"Esc"}),s.jsx("span",{children:"stop"})]}),s.jsx("span",{className:"input-footer-sep"}),s.jsxs("span",{className:"input-footer-item",children:[s.jsx("kbd",{className:"kbd-hint",children:"Ctrl+K"}),s.jsx("span",{children:"search"})]}),s.jsxs("span",{className:"input-footer-item",children:[s.jsx("kbd",{className:"kbd-hint",children:"Ctrl+V"}),s.jsx("span",{children:"paste image"})]})]})]})]})}const LE={"message-circle":dw,"file-text":zn,"folder-search":pu,table:by,globe:Cd,mail:ky,zap:qi,plug:kw,wrench:is,cpu:rs,hammer:rw,shield:Xn,code:my,bot:qa};function Jx(e){return e&&LE[e]||qa}function DE(e){return e==="builtin"?s.jsx("span",{className:"agent-badge agent-badge-builtin",children:"Built-in"}):e==="native"?s.jsx("span",{className:"agent-badge agent-badge-native",children:"Native"}):e==="installed"?s.jsx("span",{className:"agent-badge agent-badge-installed",children:"Installed"}):s.jsx("span",{className:"agent-badge agent-badge-custom",children:"Custom"})}const Oh={cpu:"CPU",gpu:"GPU",npu:"NPU"};function IE({agent:e,isActive:t,isElectron:n,onSelect:r,onStartChat:i,onViewDetails:l}){var D,C;const o=!(e.source==="native")||n,c=(D=e.models)==null?void 0:D[0],u=e.tools_count??0,d=(C=e.conversation_starters)==null?void 0:C[0],f=e.required_connections??[],h=Jx(e.icon),m=ve(A=>A.activeDevice),g=ve(A=>A.setActiveDevice),k=ve(A=>A.detectedDevices),y=(e.device_configs??[]).filter(A=>k.includes(A.device)),w=y.find(A=>A.device===m),j=y.length>1,z=["agent-hub-card",t&&"active",!o&&"disabled"].filter(Boolean).join(" ");return s.jsxs("div",{className:z,role:"button",tabIndex:o?0:-1,onClick:()=>o&&r(e.id),onKeyDown:A=>{o&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),r(e.id))},children:[s.jsxs("div",{className:"agent-hub-card-header",children:[s.jsx("div",{className:"agent-hub-card-icon",children:s.jsx(h,{size:18})}),s.jsxs("div",{className:"agent-hub-card-info",children:[s.jsx("h3",{className:"agent-hub-card-name",children:e.name}),s.jsxs("div",{className:"agent-hub-card-badges",children:[DE(e.source),e.language&&e.language!=="python"&&s.jsx("span",{className:"agent-badge agent-badge-native",children:e.language.toUpperCase()}),e.category&&e.category!=="general"&&s.jsx("span",{className:"agent-badge agent-badge-category",children:e.category})]})]})]}),s.jsx("p",{className:"agent-hub-card-desc",children:e.description||"Custom agent"}),s.jsxs("div",{className:"agent-hub-card-meta",children:[c&&s.jsxs("span",{className:"agent-hub-card-meta-item",children:[s.jsx(rs,{size:12}),c]}),u>0&&s.jsxs("span",{className:"agent-hub-card-meta-item",children:[s.jsx(is,{size:12}),u," tools"]}),f.length>0?s.jsxs("span",{className:"agent-hub-card-meta-item",children:[s.jsx(Xn,{size:12}),f.map(A=>A.connector_id).join(", ")]}):s.jsxs("span",{className:"agent-hub-card-meta-item",children:[s.jsx(Xn,{size:12}),"No special permissions"]})]}),y.length>0&&s.jsxs("div",{className:"agent-hub-card-device",children:[j?s.jsx("select",{className:"agent-hub-device-select","aria-label":`Device for ${e.name}`,value:m,onChange:A=>{A.stopPropagation(),g(A.target.value)},onClick:A=>A.stopPropagation(),children:y.map(A=>s.jsxs("option",{value:A.device,children:[Oh[A.device]??A.device.toUpperCase(),A.verified?"":" ⚠"]},A.device))}):s.jsx("span",{className:"agent-hub-device-label",children:Oh[y[0].device]??y[0].device.toUpperCase()}),w&&s.jsx("span",{className:`agent-hub-device-verified ${w.verified?"verified":"unverified"}`,children:w.verified?s.jsxs(s.Fragment,{children:[s.jsx(Vn,{size:11})," Verified"]}):s.jsxs(s.Fragment,{children:[s.jsx(ln,{size:11})," Unverified"]})})]}),d&&s.jsx("div",{className:"agent-hub-card-starter",children:d}),s.jsxs("div",{className:"agent-hub-card-actions",children:[s.jsx("button",{className:"btn-start-chat",disabled:!o,title:o?`Start chat with ${e.name}`:"Available in GAIA Desktop",onClick:A=>{A.stopPropagation(),i(e.id)},children:"Start Chat"}),s.jsx("button",{className:"btn-details",onClick:A=>{A.stopPropagation(),l(e)},children:"Details"})]})]})}const PE=typeof window<"u"&&!!window.electronAPI;function ME({agent:e,onClose:t,onStartChat:n}){const r=e.required_connections??[],i=e.tags??[],l=e.conversation_starters??[],a=e.models??[],o=e.tools_count??0,u=!(e.source==="native")||PE,d=Jx(e.icon),f=p.useCallback(h=>{h.key==="Escape"&&t()},[t]);return p.useEffect(()=>(document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)),[f]),s.jsx("div",{className:"agent-detail-overlay",onClick:t,children:s.jsxs("div",{className:"agent-detail-modal",role:"dialog","aria-modal":"true","aria-labelledby":"agent-detail-title",onClick:h=>h.stopPropagation(),children:[s.jsxs("div",{className:"agent-detail-header",children:[s.jsx("div",{className:"agent-detail-icon",children:s.jsx(d,{size:24})}),s.jsxs("div",{className:"agent-detail-title-area",children:[s.jsx("h2",{id:"agent-detail-title",className:"agent-detail-name",children:e.name}),s.jsxs("div",{className:"agent-hub-card-badges",children:[e.source==="builtin"&&s.jsx("span",{className:"agent-badge agent-badge-builtin",children:"Built-in"}),e.source==="native"&&s.jsx("span",{className:"agent-badge agent-badge-native",children:"Native"}),e.source==="custom_python"&&s.jsx("span",{className:"agent-badge agent-badge-custom",children:"Custom"}),e.source==="installed"&&s.jsx("span",{className:"agent-badge agent-badge-installed",children:"Installed"}),e.language&&e.language!=="python"&&s.jsx("span",{className:"agent-badge agent-badge-native",children:e.language.toUpperCase()}),e.category&&e.category!=="general"&&s.jsx("span",{className:"agent-badge agent-badge-category",children:e.category})]})]}),s.jsx("button",{className:"agent-detail-close",onClick:t,"aria-label":"Close",children:s.jsx(Ze,{size:18})})]}),s.jsxs("div",{className:"agent-detail-body",children:[s.jsxs("div",{className:"agent-detail-section",children:[s.jsx("div",{className:"agent-detail-section-title",children:"About"}),s.jsx("p",{className:"agent-detail-desc",children:e.description||"No description available."})]}),s.jsxs("div",{className:"agent-detail-section",children:[s.jsx("div",{className:"agent-detail-section-title",children:"Details"}),s.jsxs("div",{className:"agent-detail-meta-grid",children:[a.length>0&&s.jsxs("div",{className:"agent-detail-meta-item",children:[s.jsx(rs,{size:14}),s.jsxs("div",{children:[s.jsx("div",{className:"agent-detail-meta-label",children:"Model"}),s.jsx("div",{className:"agent-detail-meta-value",children:a[0]})]})]}),o>0&&s.jsxs("div",{className:"agent-detail-meta-item",children:[s.jsx(is,{size:14}),s.jsxs("div",{children:[s.jsx("div",{className:"agent-detail-meta-label",children:"Tools"}),s.jsx("div",{className:"agent-detail-meta-value",children:o})]})]}),e.min_memory_gb!=null&&s.jsxs("div",{className:"agent-detail-meta-item",children:[s.jsx(yy,{size:14}),s.jsxs("div",{children:[s.jsx("div",{className:"agent-detail-meta-label",children:"Min Memory"}),s.jsxs("div",{className:"agent-detail-meta-value",children:[e.min_memory_gb," GB"]})]})]}),a.length>1&&s.jsxs("div",{className:"agent-detail-meta-item",children:[s.jsx(rs,{size:14}),s.jsxs("div",{children:[s.jsx("div",{className:"agent-detail-meta-label",children:"Fallback"}),s.jsx("div",{className:"agent-detail-meta-value",children:a[1]})]})]})]})]}),s.jsxs("div",{className:"agent-detail-section",children:[s.jsx("div",{className:"agent-detail-section-title",children:"Access Rights"}),r.length>0?s.jsx("div",{className:"agent-detail-permissions",children:r.map((h,m)=>s.jsxs("div",{className:"agent-detail-permission",children:[s.jsx(Xn,{size:14}),s.jsx("span",{children:h.connector_id}),h.reason&&s.jsxs("span",{style:{color:"var(--text-muted)",fontSize:12},children:[" — ",h.reason]})]},m))}):s.jsx("p",{className:"agent-detail-no-permissions",children:"No special permissions required."})]}),i.length>0&&s.jsxs("div",{className:"agent-detail-section",children:[s.jsx("div",{className:"agent-detail-section-title",children:"Tags"}),s.jsx("div",{className:"agent-detail-tags",children:i.map(h=>s.jsx("span",{className:"agent-detail-tag",children:h},h))})]}),l.length>0&&s.jsxs("div",{className:"agent-detail-section",children:[s.jsx("div",{className:"agent-detail-section-title",children:"Try asking"}),s.jsx("div",{className:"agent-detail-starters",children:l.map(h=>s.jsx("button",{className:"agent-detail-starter-chip",disabled:!u,title:u?void 0:"Available in GAIA Desktop",onClick:()=>{n(e.id,h),t()},children:h},h))})]})]})]})})}const RE=typeof window<"u"&&!!window.electronAPI;function $E(e){const t={builtin:0,custom_python:1,installed:2,native:3};return[...e].sort((n,r)=>{const i=t[n.source]??1,l=t[r.source]??1;return i!==l?i-l:n.name.localeCompare(r.name)})}function FE({agents:e,activeAgentId:t,onSelect:n,onStartChat:r,onCreateAgent:i}){const[l,a]=p.useState(""),[o,c]=p.useState("all"),[u,d]=p.useState(null),f=e.length>6,h=p.useMemo(()=>{const g=new Set;return e.forEach(k=>{k.category&&k.category!=="general"&&g.add(k.category)}),Array.from(g).sort()},[e]),m=p.useMemo(()=>{let g=e;if(l){const k=l.toLowerCase();g=g.filter(v=>v.name.toLowerCase().includes(k)||v.description.toLowerCase().includes(k)||(v.tags??[]).some(y=>y.toLowerCase().includes(k))||(v.category??"").toLowerCase().includes(k))}return o!=="all"&&(g=g.filter(k=>k.category===o)),$E(g)},[e,l,o]);return s.jsxs("div",{className:"agent-hub",children:[s.jsxs("div",{className:"agent-hub-header",children:[s.jsx("span",{className:"agent-hub-title",children:"Choose Your Agent"}),f&&s.jsxs("div",{className:"agent-hub-controls",children:[s.jsxs("div",{className:"agent-hub-search",children:[s.jsx(An,{size:14}),s.jsx("input",{type:"text",placeholder:"Search agents...","aria-label":"Search agents",value:l,onChange:g=>a(g.target.value)})]}),h.length>0&&s.jsxs("select",{className:"agent-hub-filter","aria-label":"Filter by category",value:o,onChange:g=>c(g.target.value),children:[s.jsx("option",{value:"all",children:"All categories"}),h.map(g=>s.jsx("option",{value:g,children:g},g))]})]})]}),s.jsxs("div",{className:"agent-hub-grid",children:[m.length===0&&s.jsx("div",{className:"agent-hub-empty",children:"No agents match your search."}),m.map(g=>s.jsx(IE,{agent:g,isActive:g.id===t,isElectron:RE,onSelect:n,onStartChat:k=>r(k),onViewDetails:d},g.id)),i&&s.jsxs("div",{className:"agent-hub-card create-new",role:"button",tabIndex:0,onClick:i,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),i())},children:[s.jsx("div",{className:"create-icon",children:s.jsx(gl,{size:22})}),s.jsx("div",{className:"create-title",children:"Build a Custom Agent"}),s.jsx("div",{className:"create-desc",children:"Create a new agent through conversation"})]})]}),u&&s.jsx(ME,{agent:u,onClose:()=>d(null),onStartChat:r})]})}const Uh="GAIA",ia="Your private AI assistant, running 100% locally on AMD Ryzen AI",OE=65,UE=350;function Zx(e,t){return t===","||t==="."?60+Math.random()*50:t===" "?15+Math.random()*25:Math.random()<.35?8+Math.random()*12:Math.random()<.06?45+Math.random()*35:18+Math.random()*22}const BE=["Scan my Downloads and tell me what I should clean up","Index a folder of documents so I can chat about them","What have I been working on lately? Show my recent files","What hardware is in my PC? Tell me about my CPU and GPU"];function HE({onNewTask:e,onSendPrompt:t,onCreateAgent:n}){const{systemStatus:r,agents:i,activeAgentId:l,setActiveAgentId:a}=ve(),o=p.useMemo(()=>{var _;const A=i.find(I=>I.id===l);return(_=A==null?void 0:A.conversation_starters)!=null&&_.length?A.conversation_starters:BE},[i,l]),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,k]=p.useState(!1),[v,y]=p.useState("title"),[w,j]=p.useState(!1),z=r!==null&&!r.initialized,D=(r==null?void 0:r.init_state)==="initializing",C=r!==null&&r.lemonade_running&&!r.model_loaded;return p.useEffect(()=>{let A=0;const _=setInterval(()=>{A++,A<=Uh.length?u(Uh.slice(0,A)):(clearInterval(_),f(!0))},OE);return()=>clearInterval(_)},[]),p.useEffect(()=>{if(!d)return;let A=!1;const _=setTimeout(()=>{if(A)return;y("subtitle");let N=0;const U=()=>{if(!A)if(N++,N<=ia.length){m(ia.slice(0,N));const O=ia[N-1],re=N>1?ia[N-2]:"",oe=Zx(O,re);I.current=setTimeout(U,oe)}else k(!0),y("done")};U()},UE),I={current:null};return()=>{A=!0,clearTimeout(_),I.current&&clearTimeout(I.current)}},[d]),p.useEffect(()=>{if(!g)return;const A=setTimeout(()=>j(!0),200);return()=>clearTimeout(A)},[g]),s.jsx("main",{className:"welcome",children:s.jsxs("div",{className:`welcome-inner ${w?"content-revealed":""}`,children:[s.jsxs("h1",{className:`welcome-title${d?" typing-done":""}`,children:[c.length>=4?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"gaia-glow",children:c.slice(0,4)}),s.jsx("span",{children:c.slice(4)})]}):c,v==="title"&&s.jsx("span",{className:`terminal-cursor${d?" blink":""}`})]}),s.jsx("p",{className:"welcome-sub",children:s.jsxs("span",{className:"typewriter-text",children:[h,(v==="subtitle"||v==="done")&&s.jsx("span",{className:`terminal-cursor terminal-cursor-sub${v==="done"?" blink":""}`})]})}),s.jsxs("span",{className:"welcome-version",children:["v","0.20.0"," ",s.jsx("span",{className:"beta-badge",children:"BETA"})]}),s.jsxs("div",{className:"features",children:[s.jsx(sa,{icon:s.jsx(vy,{size:22}),title:"Private",desc:"Data stays on your device",codeHint:"> encrypt --local",expandedDesc:"All processing happens on-device. No cloud, no tracking, complete data privacy."}),s.jsx(sa,{icon:s.jsx(qi,{size:22}),title:"Fast",desc:"NPU acceleration",codeHint:"> npu.accelerate()",expandedDesc:"Hardware-accelerated with AMD Ryzen AI NPU for real-time local inference."}),s.jsx(sa,{icon:s.jsx(zn,{size:22}),title:"Smart",desc:"Document Q&A",codeHint:'> rag.query("...")',expandedDesc:"RAG-powered document Q&A — index files and chat with their contents."}),s.jsx(sa,{icon:s.jsx(tw,{size:22}),title:"Free",desc:"No subscriptions",codeHint:"> license: MIT",expandedDesc:"No API keys, no subscriptions, no hidden costs. Fully open-source."})]}),i.length>0&&s.jsx(FE,{agents:i,activeAgentId:l,onSelect:a,onStartChat:(A,_)=>{a(A),_?t(_):e()},onCreateAgent:n}),z&&s.jsxs("div",{className:"welcome-setup-hint",children:[s.jsx(Ya,{size:14}),s.jsxs("span",{children:[s.jsx("strong",{children:"First time?"})," Run ",s.jsx("code",{children:"gaia init --profile chat"})," in a terminal to install Lemonade Server and download the required AI model",r!=null&&r.default_model_size_gb?` (~${r.default_model_size_gb.toFixed(1)} GB).`:"."]})]}),!z&&C&&s.jsxs("div",{className:"welcome-setup-hint",children:[s.jsx(Ya,{size:14}),s.jsxs("span",{children:["No model loaded. Run ",s.jsx("code",{children:"gaia init --profile chat"})," to download",r!=null&&r.default_model_size_gb?` (~${r.default_model_size_gb.toFixed(1)} GB).`:"."]})]}),s.jsx("div",{className:"welcome-actions",children:s.jsx("button",{className:"btn-primary start-btn",onClick:e,disabled:D,children:"Start a New Task"})}),s.jsxs("div",{className:"suggestions",children:[s.jsx("span",{className:"suggestions-label",children:"Try asking:"}),s.jsx("div",{className:"suggestion-chips",children:o.map(A=>s.jsx("button",{className:"chip",onClick:()=>t(A),disabled:D,children:A},A))})]}),s.jsx("p",{className:"welcome-copyright",children:"© 2025–2026 Advanced Micro Devices, Inc. All rights reserved."})]})})}function sa({icon:e,title:t,desc:n,expandedDesc:r,codeHint:i}){const[l,a]=p.useState("idle"),[o,c]=p.useState(i),[u,d]=p.useState(""),f=p.useRef(null),h=()=>{a("erasing"),d("");let k=i.length;const v=()=>{if(k--,k>=0)c(i.slice(0,k)),f.current=setTimeout(v,15+Math.random()*20);else{a("typing"),c("");let y=0;const w=()=>{if(y++,y<=r.length){d(r.slice(0,y));const j=r[y-1],z=y>1?r[y-2]:"";f.current=setTimeout(w,Zx(j,z))}else a("done")};w()}};v()},m=()=>{f.current&&clearTimeout(f.current),a("idle"),c(i),d("")};p.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const g=l!=="idle";return s.jsxs("div",{className:`feature-card ${g?"feature-hovered":""}`,onMouseEnter:h,onMouseLeave:m,children:[s.jsx("div",{className:"feature-icon",children:e}),s.jsx("h3",{children:t}),s.jsx("p",{children:n}),s.jsxs("div",{className:"feature-terminal",children:[l==="idle"&&s.jsx("span",{className:"feature-code-hint",children:i}),l==="erasing"&&s.jsxs("span",{className:"feature-inline",children:[s.jsx("span",{className:"feature-code-hint feature-code-erasing",children:o}),s.jsx("span",{className:"terminal-cursor terminal-cursor-sm"})]}),(l==="typing"||l==="done")&&s.jsxs("span",{className:"feature-inline",children:[s.jsx("span",{className:"feature-expanded-text",children:u}),s.jsx("span",{className:`terminal-cursor terminal-cursor-sm${l==="done"?" blink":""}`})]})]})]})}function VE(e){const t=Math.floor((Date.now()-e)/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return`${n}m ${r}s`}function WE(e){try{const t=new Date(e);if(isNaN(t.getTime()))return"";const r=new Date().getTime()-t.getTime(),i=Math.floor(r/1e3),l=Math.floor(i/60),a=Math.floor(l/60),o=Math.floor(a/24);return i<60?"just now":l<60?`${l}m ago`:a<24?`${a}h ago`:o===1?"yesterday":o<7?`${o}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return""}}function GE(e){try{const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"})}catch{return""}}function qE(){const{documents:e,setDocuments:t,setShowDocLibrary:n,setShowFileBrowser:r,currentSessionId:i,sessions:l,updateSessionInList:a}=ve(),o=l.find(T=>T.id===i)??null,[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.useState(""),[g,k]=p.useState(""),[v,y]=p.useState(null),w=p.useRef(new Map),[,j]=p.useState(0);p.useEffect(()=>{E.doc.info("Loading document library...");const T=E.doc.time();Ni().then(P=>{const b=P.documents||[];t(b),E.doc.timed(`Loaded ${b.length} document(s), ${P.total_chunks||0} chunks, ${P.total_size_bytes||0} bytes total`,T)}).catch(P=>{E.doc.error("Failed to load documents",P),t([])})},[t]);const z=e.some(T=>T.indexing_status==="indexing"||T.indexing_status==="pending");p.useEffect(()=>{if(!z)return;const T=ve.getState().documents;for(const X of T)(X.indexing_status==="indexing"||X.indexing_status==="pending")&&!w.current.has(X.id)&&w.current.set(X.id,Date.now());let P=!1;const b=setInterval(async()=>{if(j(X=>X+1),!P){P=!0;try{const H=ve.getState().documents.filter(S=>S.indexing_status==="indexing"||S.indexing_status==="pending");for(const S of H)try{const ie=await T0(S.id);if(ie.indexing_status!=="indexing"&&ie.indexing_status!=="pending"){w.current.delete(S.id);const ye=await Ni();t(ye.documents||[]);break}}catch{}}finally{P=!1}}},2e3);return()=>clearInterval(b)},[z,t]),p.useEffect(()=>{const T=new Set(e.filter(P=>P.indexing_status==="indexing"||P.indexing_status==="pending").map(P=>P.id));for(const P of w.current.keys())T.has(P)||w.current.delete(P)},[e]),p.useEffect(()=>{const T=setInterval(async()=>{try{const b=(await Ni()).documents||[],X=ve.getState().documents;(b.length!==X.length||b.some((S,ie)=>{const ye=X.find(ae=>ae.id===S.id);return!ye||ye.indexing_status!==S.indexing_status||ye.indexed_at!==S.indexed_at||ye.chunk_count!==S.chunk_count}))&&(t(b),E.doc.debug("Document list refreshed (server-side changes detected)"))}catch{}},15e3);return()=>clearInterval(T)},[t]);const D=e.reduce((T,P)=>T+P.file_size,0),C=e.reduce((T,P)=>T+P.chunk_count,0),A=T=>{if(T<=0)return"0 B";const P=1024,b=["B","KB","MB","GB"],X=Math.min(Math.floor(Math.log(T)/Math.log(P)),b.length-1);return parseFloat((T/Math.pow(P,X)).toFixed(1))+" "+b[X]},_=p.useCallback(async(T,P)=>{var H;const b=T.includes(".")?"."+((H=T.split(".").pop())==null?void 0:H.toLowerCase()):"";if(b&&!ro(b)){const S=Xs(b),ie=S?S.message:`The file type "${b}" is not supported for indexing.`;E.doc.warn(`Unsupported file type: ${T} (${b})`),y({filename:T,error:ie});return}E.doc.info(`Indexing document: ${T}`);const X=E.doc.time();f(!0),m(`Indexing ${T}...`),y(null);try{const S=await P();if(E.doc.timed(`Indexed "${T}": ${(S==null?void 0:S.chunk_count)||"?"} chunks`,X),i&&(S!=null&&S.id))try{await Xa(i,S.id);const ye=ve.getState().sessions.find(je=>je.id===i),ae=(ye==null?void 0:ye.document_ids)??[];ae.includes(S.id)||a(i,{document_ids:[...ae,S.id]}),E.doc.info(`Auto-attached "${T}" to session ${i}`)}catch(ye){E.doc.warn(`Could not attach document to session: ${ye}`)}const ie=await Ni();t(ie.documents||[]),m("")}catch(S){E.doc.error(`Failed to index "${T}"`,S);const ie=S instanceof Error?S.message:"Upload failed";y({filename:T,error:ie}),m("")}finally{f(!1)}},[i,a,t]),I=p.useCallback(async(T,P)=>{await _(P,()=>$y(T))},[_]),N=p.useCallback(async T=>{await _(T.name,()=>Fy(T))},[_]),U=p.useCallback(async T=>{T.preventDefault(),u(!1);const P=Array.from(T.dataTransfer.files);E.doc.info(`Dropped ${P.length} file(s) into Document Library`);for(const b of P)await N(b)},[N]),O=p.useCallback(async T=>{const P=e.find(b=>b.id===T);E.doc.info(`Deleting document: ${(P==null?void 0:P.filename)||T}`);try{await E0(T),w.current.delete(T),t(e.filter(b=>b.id!==T)),E.doc.info(`Deleted document: ${(P==null?void 0:P.filename)||T}`)}catch(b){E.doc.error(`Failed to delete document: ${(P==null?void 0:P.filename)||T}`,b)}},[e,t]),re=p.useCallback(async(T,P)=>{E.doc.info(`Opening folder for: ${T}`);try{await zd(T,!0)}catch(b){E.doc.error(`Failed to open folder for: ${P}`,b)}},[]),oe=p.useCallback(async T=>{const P=e.find(b=>b.id===T);E.doc.info(`Cancelling indexing for: ${(P==null?void 0:P.filename)||T}`);try{await z0(T),w.current.delete(T);const b=await Ni();t(b.documents||[]),E.doc.info(`Cancelled indexing for: ${(P==null?void 0:P.filename)||T}`)}catch(b){E.doc.error(`Failed to cancel indexing: ${(P==null?void 0:P.filename)||T}`,b)}},[e,t]),te=p.useCallback(async T=>{if(!i)return;const P=e.find(b=>b.id===T);E.doc.info(`Attaching document to session: ${(P==null?void 0:P.filename)||T}`);try{await Xa(i,T);const b=ve.getState().sessions.find(H=>H.id===i),X=(b==null?void 0:b.document_ids)??[];X.includes(T)||a(i,{document_ids:[...X,T]}),E.doc.info(`Attached "${(P==null?void 0:P.filename)||T}" to session ${i}`)}catch(b){E.doc.error(`Failed to attach document to session: ${(P==null?void 0:P.filename)||T}`,b)}},[i,e,a]),le=p.useCallback(async T=>{T.preventDefault(),g.trim()&&(E.doc.info(`Indexing from path input: ${g.trim()}`),await I(g.trim(),g.trim().split(/[\\/]/).pop()||"file"),k(""))},[g,I]),fe=T=>{const P=T.indexing_status||"complete",b=w.current.get(T.id),X=T.indexed_at?WE(T.indexed_at):"",H=T.indexed_at?GE(T.indexed_at):"";switch(P){case"indexing":case"pending":return s.jsxs("div",{className:"doc-indexing-status",children:[s.jsxs("div",{className:"doc-indexing-bar",children:[s.jsx("div",{className:"doc-indexing-bar-track",children:s.jsx("div",{className:"doc-indexing-bar-fill"})}),s.jsxs("span",{className:"doc-indexing-label",children:[s.jsx(cw,{size:12,className:"doc-spin"}),"Indexing",b?` (${VE(b)})`:"..."]})]}),s.jsxs("button",{className:"btn-cancel",onClick:S=>{S.stopPropagation(),oe(T.id)},title:"Cancel indexing","aria-label":`Cancel indexing ${T.filename}`,children:[s.jsx(Am,{size:14}),"Cancel"]})]});case"failed":return s.jsxs("span",{className:"doc-status-badge doc-status-failed",children:[s.jsx(pt,{size:12})," Failed"]});case"cancelled":return s.jsxs("span",{className:"doc-status-badge doc-status-cancelled",children:[s.jsx(Am,{size:12})," Cancelled"]});case"missing":return s.jsxs("span",{className:"doc-status-badge doc-status-missing",children:[s.jsx(pt,{size:12})," File missing"]});default:return s.jsxs("span",{className:"doc-meta",children:[A(T.file_size)," · ",T.chunk_count," chunks",X&&s.jsxs("span",{className:"doc-timestamp",title:`Indexed: ${H}`,children:[s.jsx(Qa,{size:10}),X]})]})}};return s.jsx("div",{className:"modal-overlay",onClick:()=>n(!1),role:"dialog","aria-modal":"true","aria-label":"Document Library",children:s.jsxs("div",{className:"modal-panel doc-modal",onClick:T=>T.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("h3",{children:"Document Library"}),s.jsx("button",{className:"btn-icon",onClick:()=>n(!1),"aria-label":"Close document library",children:s.jsx(Ze,{size:18})})]}),s.jsxs("div",{className:"modal-body",children:[s.jsx("div",{className:`drop-zone ${c?"drag-over":""} ${d?"uploading":""}`,onDragOver:T=>{T.preventDefault(),u(!0)},onDragLeave:()=>u(!1),onDrop:U,children:d?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"upload-spinner"}),s.jsx("p",{children:h})]}):s.jsxs(s.Fragment,{children:[s.jsx(yl,{size:32,strokeWidth:1.5}),s.jsx("p",{children:"Drop files here to index"}),s.jsx("span",{className:"drop-hint",children:"PDF, TXT, MD, code files, and 50+ formats"})]})}),s.jsxs("form",{className:"path-input-form",onSubmit:le,children:[s.jsx(er,{size:16,className:"path-icon"}),s.jsx("input",{type:"text",className:"path-input",value:g,onChange:T=>k(T.target.value),placeholder:"Or enter file path: C:\\docs\\manual.pdf","aria-label":"File path to index"}),s.jsx("button",{type:"submit",className:"btn-secondary",disabled:!g.trim()||d,children:"Index"}),s.jsxs("button",{type:"button",className:"btn-secondary",onClick:()=>{n(!1),r(!0)},title:"Browse files on this computer",children:[s.jsx(An,{size:14}),"Browse Files"]})]}),v&&s.jsx(Xx,{filename:v.filename,error:v.error,onDismiss:()=>y(null)}),e.length>0&&s.jsxs("div",{className:"doc-stats",children:[s.jsxs("span",{children:[e.length," document",e.length!==1?"s":""]}),s.jsx("span",{children:"·"}),s.jsxs("span",{children:[C," chunks"]}),s.jsx("span",{children:"·"}),s.jsx("span",{children:A(D)})]}),s.jsxs("div",{className:"doc-list",children:[e.length===0&&!d&&s.jsxs("div",{className:"empty-docs",children:[s.jsx(zn,{size:32,strokeWidth:1}),s.jsx("p",{children:"No documents indexed yet"}),s.jsx("span",{children:"Drop files above or enter a file path"})]}),e.map(T=>{var P;return s.jsxs("div",{className:`doc-row ${T.indexing_status==="indexing"?"doc-row-indexing":""}`,children:[s.jsxs("div",{className:"doc-info",children:[s.jsx("span",{className:"doc-name",children:T.filename}),fe(T)]}),s.jsxs("div",{className:"doc-row-actions",children:[T.filepath&&s.jsx("button",{className:"btn-icon-sm doc-open-folder",onClick:()=>re(T.filepath,T.filename),title:`Open folder: ${T.filepath}`,"aria-label":`Open containing folder for ${T.filename}`,children:s.jsx(er,{size:14})}),i&&T.indexing_status==="complete"&&!((P=o==null?void 0:o.document_ids)!=null&&P.includes(T.id))&&s.jsx("button",{className:"btn-icon-sm doc-attach",onClick:()=>te(T.id),title:"Use in current session","aria-label":`Attach ${T.filename} to current session`,children:s.jsx(ow,{size:14})}),T.indexing_status!=="indexing"&&T.indexing_status!=="pending"&&s.jsx("button",{className:"btn-icon-sm doc-delete",onClick:()=>O(T.id),title:"Remove","aria-label":`Remove ${T.filename}`,children:s.jsx(fi,{size:14})})]})]},T.id)})]})]})]})})}function QE(e){if(e.type==="folder")return s.jsx(gy,{size:16});const t=(e.extension||"").toLowerCase();return[".csv",".xlsx",".xls",".tsv"].includes(t)?s.jsx(by,{size:16}):[".py",".js",".ts",".java",".c",".cpp",".go",".rs"].includes(t)?s.jsx(my,{size:16}):[".pdf",".doc",".docx",".txt",".md"].includes(t)?s.jsx(zn,{size:16}):s.jsx(py,{size:16})}function KE(e){if(e<=0)return"";const t=1024,n=["B","KB","MB","GB"],r=Math.min(Math.floor(Math.log(e)/Math.log(t)),n.length-1);return parseFloat((e/Math.pow(t,r)).toFixed(1))+" "+n[r]}function YE(e){if(!e)return"";const t=new Date(e),n=new Date,r=n.getTime()-t.getTime(),i=Math.floor(r/36e5);if(i<1)return"Just now";if(i<24)return`${i}h ago`;const l=Math.floor(i/24);return l<7?`${l}d ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:t.getFullYear()!==n.getFullYear()?"numeric":void 0})}function XE(e){switch(e){case"home":return s.jsx(iw,{size:14});case"desktop":return s.jsx(fw,{size:14});case"documents":return s.jsx(zn,{size:14});case"download":return s.jsx(di,{size:14});default:return s.jsx(gy,{size:14})}}const JE=[{label:"All Files",value:""},{label:"Documents",value:"pdf,doc,docx,txt,md"},{label:"Spreadsheets",value:"csv,xlsx,xls,tsv"},{label:"Code",value:"py,js,ts,java,c,cpp,go,rs,rb,sh"},{label:"Data",value:"json,xml,yaml,yml,csv,tsv"}];async function Bh(e,t,n,r){var f;const i=[],l=[];for(const h of e){const m=h.includes(".")?"."+((f=h.split(".").pop())==null?void 0:f.toLowerCase()):"";m&&!ro(m)?l.push(h):i.push(h)}const a=[],o=[];let c=0,u="";const d=new Set(t.filter(h=>h.type==="folder").map(h=>h.path));for(const h of i)try{if(d.has(h)){const m=await D0(h),g=[];m.documents.forEach(k=>{k.id&&g.push(k.id)}),g.length>0&&(g.forEach(k=>a.push(k)),o.push(h))}else{const m=await $y(h);m!=null&&m.id&&(a.push(m.id),o.push(h))}}catch(m){c++,u=m instanceof Error?m.message:"Unknown error"}if(n&&a.length>0){for(const k of a)try{await Xa(n,k)}catch(v){E.doc.warn(`Could not attach document to session: ${v}`)}const h=ve.getState().sessions.find(k=>k.id===n),m=(h==null?void 0:h.document_ids)??[],g=a.filter(k=>!m.includes(k));g.length>0&&r(n,{document_ids:[...m,...g]})}return{docIds:a,supported:i,succeededFiles:o,unsupported:l,failed:c,lastError:u}}function ZE(){const{setShowFileBrowser:e,currentSessionId:t,updateSessionInList:n,setPendingPrompt:r}=ve(),[i,l]=p.useState(""),[a,o]=p.useState(null),[c,u]=p.useState([]),[d,f]=p.useState([]),[h,m]=p.useState(!1),[g,k]=p.useState(null),[v,y]=p.useState(""),[w,j]=p.useState(null),[z,D]=p.useState(!1),[C,A]=p.useState(""),[_,I]=p.useState(new Set),[N,U]=p.useState(null),[O,re]=p.useState(!1),[oe,te]=p.useState(new Set),[le,fe]=p.useState(null),T=p.useRef(null),[P,b]=p.useState(null),X=p.useCallback(async M=>{m(!0),k(null),j(null),y("");try{const R=await L0(M);l(R.current_path),o(R.parent_path),u(R.entries),R.quick_links.length>0&&f(R.quick_links),E.ui.info(`Browsing: ${R.current_path} (${R.entries.length} items)`)}catch(R){const B=R instanceof Error?R.message:"Failed to load directory";k(B),E.ui.error("Browse failed",R)}finally{m(!1)}},[]);p.useEffect(()=>{X()},[X]),p.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]);const H=p.useCallback(async()=>{if(!v.trim()){j(null);return}D(!0),k(null);try{const M=await I0(v.trim(),C||void 0,30);j(M.results),E.ui.info(`Search "${v}": ${M.total} results`)}catch(M){const R=M instanceof Error?M.message:"Search failed";k(R),E.ui.error("Search failed",M)}finally{D(!1)}},[v,C]),S=M=>{M.key==="Enter"&&H()},ie=p.useCallback(M=>{M.type==="folder"&&(X(M.path),I(new Set),U(null))},[X]),ye=p.useCallback(async M=>{re(!0);try{const R=await P0(M);U(R)}catch(R){E.ui.error("Preview failed",R)}finally{re(!1)}},[]),ae=p.useCallback(async()=>{if(_.size===0)return;const M=Array.from(_);if(b(null),!M.some(B=>{var ge;const pe=B.includes(".")?"."+((ge=B.split(".").pop())==null?void 0:ge.toLowerCase()):"";return!pe||ro(pe)})){const B=M[0],pe=B.lastIndexOf("."),ge=pe>0?B.slice(pe).toLowerCase():"",ce=Xs(ge);b({filename:M.length===1?B.split(/[\\/]/).pop()||B:`${M.length} files`,error:ce?ce.message:`File type "${ge}" is not supported for indexing.`});return}te(new Set(M)),fe(`Indexing ${M.length} file(s)...`);try{const B=await Bh(M,c,t,n);if(B.failed>0)fe(`Done: ${B.docIds.length} indexed, ${B.failed} failed`),b({filename:`${B.failed} file(s)`,error:B.lastError||"Indexing failed for some files"});else{const pe=B.unsupported.length>0?` (${B.unsupported.length} skipped — unsupported type)`:"";fe(`Successfully indexed ${B.docIds.length} file(s)${pe}`)}T.current&&clearTimeout(T.current),T.current=setTimeout(()=>fe(null),5e3),I(new Set)}catch(B){E.doc.error("Index selected failed",B),b({filename:M.length===1?M[0].split(/[\\/]/).pop()||M[0]:`${M.length} files`,error:B instanceof Error?B.message:"An unexpected error occurred."})}finally{te(new Set)}},[_,t,n,c]),je=p.useCallback(async()=>{if(_.size===0)return;const M=Array.from(_);b(null),te(new Set(M)),fe(`Indexing ${M.length} file(s) for analysis...`);try{const R=await Bh(M,c,t,n);if(R.supported.length===0){const ge=M[0].lastIndexOf("."),ce=ge>0?M[0].slice(ge).toLowerCase():"",we=Xs(ce);b({filename:M.length===1?M[0].split(/[\\/]/).pop()||M[0]:`${M.length} files`,error:(we==null?void 0:we.message)??`File type "${ce}" is not supported for indexing.`});return}if(R.docIds.length===0){b({filename:R.supported.length===1?R.supported[0].split(/[\\/]/).pop()||R.supported[0]:`${R.supported.length} files`,error:"Failed to index selected file(s). Please try again."});return}R.failed>0&&fe(`Warning: ${R.failed} file(s) failed to index and will be excluded.`);const B=(R.succeededFiles.length>0?R.succeededFiles:R.supported).map(ge=>ge.split(/[\\/]/).pop()||ge),pe=B.length===1?`Please analyze this document for me: ${B[0]}`:`Please analyze these documents for me:
|
|
556
|
+
${B.map(ge=>`- ${ge}`).join(`
|
|
557
|
+
`)}`;r(pe),e(!1),I(new Set)}catch(R){E.doc.error("Ask Agent failed",R),b({filename:M.length===1?M[0].split(/[\\/]/).pop()||M[0]:`${M.length} files`,error:R instanceof Error?R.message:"An unexpected error occurred."})}finally{te(new Set),fe(null)}},[_,t,n,c,r,e]),Ge=i?i.replace(/\\/g,"/").split("/").filter(Boolean):[],qe=Ge.map((M,R)=>({label:M,path:Ge.slice(0,R+1).join("/")+(R===0&&M.includes(":")?"/":"")})),Xe=w?w.map(M=>({name:M.name,path:M.path,type:"file",size:M.size,extension:M.extension||"",modified:M.modified||""})):c;return s.jsx("div",{className:"modal-overlay",onClick:()=>e(!1),role:"dialog","aria-modal":"true","aria-label":"File Browser",children:s.jsxs("div",{className:`modal-panel file-browser-modal ${N?"has-preview":""}`,onClick:M=>M.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsxs("h3",{children:[s.jsx(er,{size:18})," File Browser"]}),s.jsx("button",{className:"btn-icon",onClick:()=>e(!1),"aria-label":"Close",children:s.jsx(Ze,{size:18})})]}),s.jsxs("div",{className:"file-browser-body",children:[s.jsx("div",{className:"fb-quick-links",children:d.map(M=>s.jsxs("button",{className:"fb-quick-link",onClick:()=>X(M.path),title:M.path,children:[XE(M.icon),s.jsx("span",{children:M.name})]},M.path))}),s.jsxs("div",{className:"fb-search-bar",children:[s.jsxs("div",{className:"fb-search-input-wrap",children:[s.jsx(An,{size:14,className:"fb-search-icon"}),s.jsx("input",{type:"text",className:"fb-search-input",placeholder:"Search files on your PC...",value:v,onChange:M=>y(M.target.value),onKeyDown:S,"aria-label":"Search files"}),v&&s.jsx("button",{className:"fb-search-clear",onClick:()=>{y(""),j(null)},"aria-label":"Clear search",children:s.jsx(Ze,{size:12})})]}),s.jsx("select",{className:"fb-type-filter",value:C,onChange:M=>A(M.target.value),"aria-label":"File type filter",children:JE.map(M=>s.jsx("option",{value:M.value,children:M.label},M.value))}),s.jsx("button",{className:"fb-search-btn",onClick:H,disabled:!v.trim()||z,children:z?"Searching...":"Search"})]}),!w&&s.jsxs("div",{className:"fb-breadcrumb",children:[s.jsx("button",{className:"fb-crumb",onClick:()=>X("/"),children:s.jsx(yy,{size:12})}),qe.map((M,R)=>s.jsxs("span",{className:"fb-crumb-item",children:[s.jsx(us,{size:12,className:"fb-crumb-sep"}),s.jsx("button",{className:"fb-crumb",onClick:()=>X(M.path),children:M.label})]},R)),a&&s.jsx("button",{className:"fb-up-btn",onClick:()=>X(a),title:"Go up",children:s.jsx(Yk,{size:14})})]}),w&&s.jsxs("div",{className:"fb-search-header",children:[s.jsxs("span",{children:["Found ",w.length,' result(s) for "',v,'"']}),s.jsx("button",{className:"fb-back-btn",onClick:()=>{j(null),y("")},children:"Back to browsing"})]}),g&&s.jsx("div",{className:"fb-error",children:g}),s.jsxs("div",{className:"fb-content",children:[s.jsxs("div",{className:"fb-file-list",children:[h&&s.jsx("div",{className:"fb-loading",children:"Loading..."}),!h&&Xe.length===0&&s.jsx("div",{className:"fb-empty",children:w?"No files found":"This folder is empty"}),!h&&Xe.map(M=>{var ge;const R=M.extension||(M.name.includes(".")?"."+((ge=M.name.split(".").pop())==null?void 0:ge.toLowerCase()):""),B=M.type==="file"&&R&&!ro(R),pe=B?Xs(R):null;return s.jsxs("div",{className:`fb-entry ${M.type} ${_.has(M.path)?"selected":""} ${B?"unsupported":""}`,onClick:()=>M.type==="folder"?ie(M):ye(M.path),onDoubleClick:()=>M.type==="folder"?ie(M):void 0,title:B?`${(pe==null?void 0:pe.label)||"This"} file type cannot be indexed`:M.path,children:[s.jsx("input",{type:"checkbox",className:"fb-entry-checkbox",checked:_.has(M.path),onChange:()=>{I(ce=>{const we=new Set(ce);return we.has(M.path)?we.delete(M.path):we.add(M.path),we})},onClick:ce=>ce.stopPropagation(),"aria-label":`Select ${M.name}`}),s.jsx("span",{className:"fb-entry-icon",children:QE(M)}),s.jsx("span",{className:"fb-entry-name",title:M.path,children:M.name}),B&&s.jsx("span",{className:"fb-unsupported-badge",children:"Not indexable"}),s.jsx("span",{className:"fb-entry-size",children:M.type==="file"?KE(M.size):""}),s.jsx("span",{className:"fb-entry-date",children:YE(M.modified)})]},M.path)})]}),N&&s.jsxs("div",{className:"fb-preview",children:[s.jsxs("div",{className:"fb-preview-header",children:[s.jsx("span",{className:"fb-preview-name",children:N.name}),s.jsx("button",{className:"btn-icon-sm",onClick:()=>U(null),"aria-label":"Close preview",children:s.jsx(Ze,{size:14})})]}),s.jsxs("div",{className:"fb-preview-meta",children:[s.jsx("span",{children:N.size_display}),N.total_lines&&s.jsxs("span",{children:[N.total_lines," lines"]}),N.columns&&s.jsxs("span",{children:[N.columns.length," columns"]}),N.row_count!==null&&s.jsxs("span",{children:[N.row_count," rows"]})]}),N.columns&&s.jsxs("div",{className:"fb-preview-columns",children:[s.jsx("strong",{children:"Columns:"})," ",N.columns.join(", ")]}),O?s.jsx("div",{className:"fb-preview-loading",children:"Loading preview..."}):N.is_text&&N.preview_lines.length>0?s.jsx("pre",{className:"fb-preview-content",children:N.preview_lines.slice(0,30).join(`
|
|
558
|
+
`)}):s.jsx("div",{className:"fb-preview-binary",children:"Binary file - no preview available"})]})]}),P&&s.jsx(Xx,{filename:P.filename,error:P.error,onDismiss:()=>b(null)}),s.jsxs("div",{className:"fb-actions",children:[s.jsx("div",{className:"fb-selection-info",children:_.size>0?`${_.size} item(s) selected`:"Select files to index or analyze"}),le&&s.jsx("span",{className:"fb-index-status",children:le}),s.jsxs("div",{className:"fb-action-btns",children:[s.jsxs("button",{className:"fb-action-btn secondary",onClick:ae,disabled:_.size===0||oe.size>0,title:"Index selected files for RAG search",children:[s.jsx(yl,{size:14}),"Index Selected"]}),s.jsxs("button",{className:"fb-action-btn primary",onClick:je,disabled:_.size===0||oe.size>0,title:"Index and send selected files to the chat agent for analysis",children:[s.jsx(ti,{size:14}),"Ask Agent"]})]})]})]})]})})}const Yd=jo();async function Me(e,t,n){const r=`${Yd}${t}`,i={};e!=="GET"&&(i["X-Gaia-UI"]="1"),n!==void 0&&(i["Content-Type"]="application/json");const l={method:e,headers:Object.keys(i).length>0?i:void 0,body:n!==void 0?JSON.stringify(n):void 0},a=await fetch(r,l);if(!a.ok){const c=await a.text().catch(()=>"");let u=c;try{u=JSON.parse(c).detail||c}catch{}throw new Error(u||`Memory API error (HTTP ${a.status})`)}if((a.headers.get("content-type")||"").includes("application/json"))return a.json()}function ev(e){const t=[];for(const[n,r]of Object.entries(e))if(!(r==null||r===""))if(Array.isArray(r))for(const i of r)t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`);else t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`);return t.length?`?${t.join("&")}`:""}function eT(){return Me("GET","/memory/stats")}function tT(e=30){return Me("GET",`/memory/activity?days=${e}`)}function nT(e={}){return Me("GET",`/memory/knowledge${ev(e)}`)}function rT(e){return Me("POST","/memory/knowledge",e)}function Hh(e,t){return Me("PUT",`/memory/knowledge/${encodeURIComponent(e)}`,t)}function iT(e){return Me("DELETE",`/memory/knowledge/${encodeURIComponent(e)}`)}function sT(){return Me("GET","/memory/entities")}function lT(){return Me("GET","/memory/tools")}function aT(e=20){return Me("GET",`/memory/conversations?limit=${e}`)}function oT(e,t=20){return Me("GET",`/memory/conversations/search?query=${encodeURIComponent(e)}&limit=${t}`)}function cT(e){return Me("GET",`/memory/conversations/${encodeURIComponent(e)}`)}function uT(e=7){return Me("GET",`/memory/upcoming?days=${e}`)}function dT(){return Me("GET","/memory/embedding-coverage")}function fT(){return Me("POST","/memory/consolidate")}function mT(){return Me("POST","/memory/rebuild-embeddings")}function hT(){return Me("POST","/memory/reconcile")}function pT(){return Me("POST","/memory/rebuild-fts")}function gT(){return Me("POST","/memory/refresh-system-context")}function yT(){return new EventSource(`${Yd}/memory/stream-discovery`)}function xT(e){return new EventSource(`${Yd}/memory/stream-inference?include_browser=${e}`)}function vT(e){return Me("POST","/memory/commit-discovery",{items:e})}function kT(e){return Me("POST","/memory/commit-inference",{insights:e})}function wT(){return Me("GET","/memory/settings")}function wi(e){return Me("PUT","/memory/settings",e)}function bT(){return Me("DELETE","/memory/all")}function jT(){return Me("POST","/memory/reinitialize")}function ST(){return Me("GET","/goals/stats")}function NT(e={}){return Me("GET",`/goals${ev(e)}`)}function CT(e){return Me("POST","/goals",e)}function _T(e){return Me("PUT",`/goals/${encodeURIComponent(e)}/approve`)}function ET(e){return Me("PUT",`/goals/${encodeURIComponent(e)}/reject`)}function TT(e){return Me("PUT",`/goals/${encodeURIComponent(e)}/cancel`)}function zT(e){return Me("DELETE",`/goals/${encodeURIComponent(e)}`)}function Vh(e){if(!e)return"—";try{const t=new Date(e);if(isNaN(t.getTime()))return"—";const n={month:"short",day:"numeric"};return t.getFullYear()!==new Date().getFullYear()&&(n.year="numeric"),t.toLocaleDateString(void 0,n)}catch{return"—"}}function Cn(e){if(!e)return"";try{const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function _r(e){if(!e)return"—";try{const t=new Date(e);if(isNaN(t.getTime()))return"—";const n=Date.now(),r=t.getTime()-n,i=Math.abs(r),l=Math.floor(i/1e3),a=Math.floor(i/6e4),o=Math.floor(i/36e5),c=Math.floor(i/864e5);return r<0?l<5?"just now":l<60?`${l}s ago`:o===0?`${a}m ago`:c===0?`${o}h ago`:c===1?"yesterday":c<30?`${c}d ago`:Cn(e):l<5?"now":l<60?`in ${l}s`:o===0?`in ${a}m`:c===0?`in ${o}h`:c===1?"tomorrow":c<30?`in ${c}d`:Cn(e)}catch{return"—"}}function AT(e){if(e<=0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.min(Math.floor(Math.log(e)/Math.log(t)),n.length-1);return parseFloat((e/Math.pow(t,r)).toFixed(1))+" "+n[r]}function LT(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function Wh(e){try{return new Date(e).getTime()<Date.now()}catch{return!1}}function DT(e){return e>=.7?"high":e>=.4?"medium":"low"}function Gh(e){return e>=.9?"high":e>=.7?"medium":"low"}function IT(e,t){const n=Vh(e),r=Vh(t);return n==="—"&&r==="—"?"":n===r?n:`${n} – ${r}`}function PT(e){if(e.length===0)return 0;const t=new Date().toISOString().slice(0,10),n=e.find(r=>r.date===t);return n?n.knowledge_added:0}const qh=["fact","preference","error","skill","note","reminder"],MT={work:"blue",technical:"purple",personal:"green",general:"gray"};function RT(){var nf,rf,sf,lf,af,of,cf,uf,df,ff,mf,hf,pf,gf,yf,xf;const{setShowMemoryDashboard:e}=ve(),[t,n]=p.useState(null),[r,i]=p.useState([]),[l,a]=p.useState(null),[o,c]=p.useState([]),[u,d]=p.useState([]),[f,h]=p.useState([]),[m,g]=p.useState(null),[k,v]=p.useState([]),[y,w]=p.useState(!0),[j,z]=p.useState(null),[D,C]=p.useState(null),[A,_]=p.useState(!1),[I,N]=p.useState(null),[U,O]=p.useState([]),re=p.useRef(0),[oe,te]=p.useState([]),[le,fe]=p.useState(""),[T,P]=p.useState(""),[b,X]=p.useState(""),[H,S]=p.useState("updated_at"),[ie,ye]=p.useState("desc"),[ae,je]=p.useState(0),[Ge,qe]=p.useState(!1),Xe=15,[M,R]=p.useState(""),[B,pe]=p.useState(null),ge=p.useRef(null),[ce,we]=p.useState(null),[G,ze]=p.useState(!1),[Te,Qe]=p.useState(null),[Se,Fe]=p.useState({content:"",category:"fact",domain:"",context:"global",entity:"",sensitive:!1,due_at:""}),[Ht,Mn]=p.useState(new Set),[F,K]=p.useState(!1),[ue,ke]=p.useState(!1),[Ne,wt]=p.useState(!1),[gt,Ke]=p.useState(!1),[Pt,Jt]=p.useState(!1),[it,Mt]=p.useState(!1),[bt,vn]=p.useState(null),[dn,Zt]=p.useState("dashboard"),[en,cr]=p.useState([]),[kn,ms]=p.useState(null),[wn,yt]=p.useState(!1),[Gn,ur]=p.useState(null),[Tl,dr]=p.useState(!1),[fr,mr]=p.useState({title:"",description:"",priority:"medium"}),[lt,hr]=p.useState("idle"),[hs,bn]=p.useState([]),[qn,pr]=p.useState([]),[zl,Al]=p.useState(null),jn=p.useRef(null),gr=p.useRef(null),[jt,yr]=p.useState("idle"),[ps,Rn]=p.useState([]),[Qn,xr]=p.useState([]),[Ll,Dl]=p.useState(null),[gs,Ao]=p.useState(!1),yi=p.useRef(null),vr=p.useRef(null),[ys,Il]=p.useState(30),[xi,xs]=p.useState(!1),[L,Q]=p.useState(!1),[ee,J]=p.useState(!1),[xe,Ae]=p.useState(!1),[xt,kr]=p.useState(!1),[at,Et]=p.useState(!1),St=p.useRef(null),V=p.useRef(null),Z=p.useCallback((x,$="info")=>{const se=++re.current;O(me=>[...me,{id:se,text:x,type:$}]),setTimeout(()=>{O(me=>me.filter(Oe=>Oe.id!==se))},4e3)},[]);p.useEffect(()=>{if(!A)return;const x=$=>{V.current&&!V.current.contains($.target)&&_(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[A]),p.useEffect(()=>{const x=$=>{$.key==="Escape"&&(bt?vn(null):Pt?Jt(!1):it?Mt(!1):ce?we(null):A?_(!1):G||Te?(ze(!1),Qe(null)):I?N(null):e(!1))};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[ce,A,G,Te,I,e,bt,Pt,it]);const Ee=p.useCallback(async()=>{try{const x=await eT();n(x)}catch(x){E.system.warn("Failed to load memory stats",x)}},[]),dt=p.useCallback(async()=>{try{const x=await tT(ys);i(x)}catch(x){E.system.warn("Failed to load memory activity",x)}},[ys]),Pe=p.useCallback(async()=>{try{const x=await nT({category:oe.length>0?oe:void 0,context:le||void 0,entity:T||void 0,search:b||void 0,sort_by:H,order:ie,offset:ae,limit:Xe,include_sensitive:!0,include_superseded:Ge});a(x)}catch(x){E.system.warn("Failed to load knowledge",x)}},[oe,le,T,b,H,ie,ae,Ge]),De=p.useCallback(async()=>{try{const x=await lT();c(x)}catch(x){E.system.warn("Failed to load tool summary",x)}},[]),Re=p.useCallback(async()=>{try{const x=await aT(20);d(x)}catch(x){E.system.warn("Failed to load conversations",x)}},[]),Vt=p.useCallback(async()=>{try{const x=await uT(7);h(x)}catch(x){E.system.warn("Failed to load upcoming items",x)}},[]),nt=p.useCallback(async()=>{try{const x=await dT();g(x)}catch(x){E.system.warn("Failed to load embedding coverage",x)}},[]),vs=p.useCallback(async()=>{try{const x=await sT();v(x||[])}catch(x){E.system.warn("Failed to load entities",x)}},[]),Jd=p.useCallback(async()=>{try{const x=await wT();ke(x.mcp_memory_enabled),K(x.memory_enabled),wt(x.system_discovery_consent)}catch(x){E.system.warn("Failed to load memory settings",x)}},[]),wr=p.useCallback(async()=>{yt(!0);try{const[x,$]=await Promise.all([NT(),ST()]);cr(x.goals),ms($)}catch(x){E.system.warn("Failed to load goals",x)}finally{yt(!1)}},[]),Rt=p.useCallback(async()=>{w(!0),z(null);try{await Promise.all([Ee(),dt(),Pe(),De(),Re(),Vt(),nt(),vs(),Jd(),wr()])}catch(x){z("Failed to load memory data. Is the backend running?"),E.system.error("Memory dashboard load failed",x)}finally{w(!1)}},[Ee,dt,Pe,De,Re,Vt,nt,vs,Jd,wr]);p.useEffect(()=>{Rt()},[Rt]),p.useEffect(()=>{Pe()},[Pe]);const Zd=p.useRef(!0);p.useEffect(()=>{if(Zd.current){Zd.current=!1;return}dt()},[dt]);const rv=p.useCallback(x=>{X(x),Et(!0),St.current&&clearTimeout(St.current),St.current=setTimeout(()=>{je(0),Et(!1)},300)},[]),iv=p.useCallback(async()=>{if(Se.content.trim())try{await rT({content:Se.content,category:Se.category,domain:Se.domain||void 0,context:Se.context,entity:Se.entity||void 0,sensitive:Se.sensitive,due_at:Se.due_at||void 0}),ze(!1),Fe({content:"",category:"fact",domain:"",context:"global",entity:"",sensitive:!1,due_at:""}),Pe(),Ee(),nt(),E.ui.info("Created new knowledge entry"),Z("Memory created successfully","success")}catch(x){E.system.error("Failed to create knowledge",x),Z("Failed to create memory","error")}},[Se,Pe,Ee,nt,Z]),sv=p.useCallback(async()=>{if(!(!Te||!Se.content.trim()))try{await Hh(Te,{content:Se.content,category:Se.category,domain:Se.domain||void 0,context:Se.context,entity:Se.entity||void 0,sensitive:Se.sensitive,due_at:Se.due_at||void 0}),Qe(null),Fe({content:"",category:"fact",domain:"",context:"global",entity:"",sensitive:!1,due_at:""}),Pe(),E.ui.info(`Updated knowledge ${Te}`),Z("Memory updated","success")}catch(x){E.system.error("Failed to update knowledge",x),Z("Failed to update memory","error")}},[Te,Se,Pe,Z]),lv=p.useCallback(async x=>{try{await iT(x),Pe(),Ee(),nt(),E.ui.info(`Deleted knowledge ${x}`),Z("Memory deleted","info")}catch($){E.system.error("Failed to delete knowledge",$),Z("Failed to delete memory","error")}},[Pe,Ee,nt,Z]),av=p.useCallback(async x=>{try{await Hh(x.id,{sensitive:!x.sensitive}),Pe(),E.ui.info(`Toggled sensitive for ${x.id}: ${!x.sensitive}`),Z(x.sensitive?"Unmarked as sensitive":"Marked as sensitive","info")}catch($){E.system.error("Failed to toggle sensitive",$),Z("Failed to toggle sensitive flag","error")}},[Pe,Z]),ov=p.useCallback(x=>{Qe(x.id),ze(!1),Fe({content:x.content,category:x.category,domain:x.domain||"",context:x.context,entity:x.entity||"",sensitive:x.sensitive,due_at:x.due_at||""})},[]),cv=p.useCallback(x=>{navigator.clipboard.writeText(x).catch(()=>{}),E.ui.info(`Copied knowledge ID: ${x}`),Z("ID copied to clipboard","info")},[Z]),uv=p.useCallback(x=>{if(R(x),ge.current&&clearTimeout(ge.current),!x.trim()){pe(null);return}ge.current=setTimeout(async()=>{try{const $=await oT(x.trim(),20);pe($)}catch($){E.system.warn("Conversation search failed",$)}},300)},[]),ef=p.useCallback(async x=>{try{const $=await cT(x);we({sessionId:x,turns:$})}catch($){E.system.error("Failed to load conversation detail",$)}},[]),dv=p.useCallback(x=>{te($=>$.includes(x)?$.filter(se=>se!==x):[...$,x]),je(0)},[]),ks=p.useCallback(x=>{H===x?ye($=>$==="desc"?"asc":"desc"):(S(x),ye("desc")),je(0)},[H]),fv=p.useCallback(async()=>{xs(!0),_(!1);try{const x=await fT();await Rt(),Z(`Consolidated ${x.consolidated??0} sessions, extracted ${x.extracted_items??0} items`,"success")}catch(x){E.system.error("Failed to consolidate sessions",x),Z("Failed to consolidate sessions","error")}finally{xs(!1)}},[Rt,Z]),mv=p.useCallback(async()=>{Q(!0),_(!1);try{const x=await mT();await nt(),Z(`Backfilled ${x.backfilled??0} embeddings${x.total_without?` (${x.total_without} were missing)`:""}`,"success")}catch(x){E.system.error("Failed to rebuild embeddings",x),Z("Failed to rebuild embeddings","error")}finally{Q(!1)}},[nt,Z]),hv=p.useCallback(async()=>{J(!0),_(!1);try{const x=await hT();await Rt(),Z(`Checked ${x.pairs_checked??0} pairs: ${x.reinforced??0} reinforced, ${x.contradicted??0} contradicted`,"success")}catch(x){E.system.error("Failed to reconcile memory",x),Z("Failed to reconcile memory","error")}finally{J(!1)}},[Rt,Z]),pv=p.useCallback(async()=>{Ae(!0),_(!1);try{await pT(),await Rt(),Z("FTS indexes rebuilt successfully","success")}catch(x){E.system.error("Failed to rebuild FTS index",x),Z("Failed to rebuild FTS indexes","error")}finally{Ae(!1)}},[Rt,Z]),gv=p.useCallback(async()=>{kr(!0),_(!1);try{const x=await gT();await Rt(),x.skipped?Z("System context collection is disabled — enable it in settings","error"):Z(`System context refreshed: ${x.stored} facts updated`,"success")}catch(x){E.system.error("Failed to refresh system context",x),Z("Failed to refresh system context","error")}finally{kr(!1)}},[Rt,Z]),tf=xi||L||ee||xe||xt,yv=p.useCallback(()=>{hr("running"),bn([]),pr([]),Al(null);const x=yT();gr.current=x,x.onmessage=$=>{try{const se=JSON.parse($.data);if(se.type==="log")bn(me=>[...me,{text:se.message,kind:"log"}]);else if(se.type==="finding"){const me=se.item;bn(Oe=>[...Oe,{text:` Found: ${me.content}`,kind:"finding"}]),pr(Oe=>[...Oe,{...me,_checked:!0}])}else se.type==="error"?bn(me=>[...me,{text:` Error: ${se.message}`,kind:"error"}]):se.type==="done"&&(x.close(),gr.current=null,bn(me=>[...me,{text:`Done. ${se.total??0} items discovered.`,kind:"log"}]),hr("review"))}catch{bn(se=>[...se,{text:"Failed to parse event data.",kind:"error"}])}},x.onerror=()=>{x.close(),gr.current=null,bn($=>[...$,{text:"Connection error. Is the GAIA server running?",kind:"error"}]),pr($=>(hr($.length>0?"review":"idle"),$))}},[]),xv=p.useCallback(async()=>{const x=qn.filter($=>$._checked);if(x.length!==0){hr("saving");try{const $=x.map(({_checked:me,...Oe})=>Oe),se=await vT($);Al(se.stored),hr("done"),Z(`Saved ${se.stored} items to memory`,"success")}catch($){E.system.error("Failed to commit discovery items",$),Z("Failed to save discovery items","error"),hr("review")}}},[qn,Z]),vv=p.useCallback(()=>{yr("running"),Rn([]),xr([]),Dl(null);const x=xT(gs);vr.current=x,x.onmessage=$=>{try{const se=JSON.parse($.data);if(se.type==="log")Rn(me=>[...me,{text:se.message,kind:"log"}]);else if(se.type==="insight"){const me=se.item;Rn(Oe=>[...Oe,{text:` Insight: ${me.content}`,kind:"finding"}]),xr(Oe=>[...Oe,{...me,_checked:!0}])}else se.type==="error"?Rn(me=>[...me,{text:` Error: ${se.message}`,kind:"error"}]):se.type==="done"&&(x.close(),vr.current=null,Rn(me=>[...me,{text:`Done. ${se.total??0} insights generated.`,kind:"log"}]),yr("review"))}catch{Rn(se=>[...se,{text:"Failed to parse event data.",kind:"error"}])}},x.onerror=()=>{x.close(),vr.current=null,Rn($=>[...$,{text:"Connection error. Is Lemonade Server running?",kind:"error"}]),xr($=>(yr($.length>0?"review":"idle"),$))}},[gs]),kv=p.useCallback(async()=>{const x=Qn.filter($=>$._checked);if(x.length!==0){yr("saving");try{const $=x.map(({_checked:me,...Oe})=>Oe),se=await kT($);Dl(se.stored),yr("done"),Z(`Saved ${se.stored} insights to memory`,"success")}catch($){E.system.error("Failed to commit inference insights",$),Z("Failed to save inference insights","error"),yr("review")}}},[Qn,Z]);p.useEffect(()=>{jn.current&&(jn.current.scrollTop=jn.current.scrollHeight)},[hs]),p.useEffect(()=>{yi.current&&(yi.current.scrollTop=yi.current.scrollHeight)},[ps]),p.useEffect(()=>()=>{gr.current&&(gr.current.close(),gr.current=null),vr.current&&(vr.current.close(),vr.current=null)},[]);const ws=x=>H!==x?null:s.jsx("span",{className:"mem-sort-arrow",children:ie==="desc"?"↓":"↑"}),Pl=Math.max(1,...r.map(x=>x.conversations+x.tool_calls+x.knowledge_added+x.errors)),wv=(nf=t==null?void 0:t.knowledge)!=null&&nf.by_context?Object.keys(t.knowledge.by_context):[];return s.jsxs("div",{className:"memory-dashboard-page",children:[s.jsxs("div",{className:"memory-dashboard-header",children:[s.jsxs("div",{className:"memory-dashboard-header-left",children:[s.jsx("button",{className:"btn-icon settings-back-btn",onClick:()=>e(!1),"aria-label":"Back",children:s.jsx(uy,{size:18})}),s.jsxs("h3",{children:["Memory Dashboard ",s.jsx("span",{style:{fontSize:11,fontWeight:600,color:"#f59e0b",background:"rgba(245,158,11,0.15)",padding:"2px 8px",borderRadius:4,marginLeft:8,verticalAlign:"middle",letterSpacing:"0.5px"},children:"BETA"})]})]}),s.jsxs("div",{className:"memory-dashboard-header-actions",children:[m&&m.total_items>0&&s.jsxs("div",{className:"mem-embedding-coverage",title:`${m.with_embedding} of ${m.total_items} entries embedded`,children:[s.jsx("div",{className:"mem-embedding-bar",children:s.jsx("div",{className:"mem-embedding-fill",style:{width:`${Math.round(m.coverage_pct)}%`}})}),s.jsxs("span",{className:"mem-embedding-label",children:[Math.round(m.coverage_pct),"% embedded"]})]}),s.jsxs("div",{className:"mem-maintenance-wrap",ref:V,children:[s.jsxs("button",{className:`btn-icon ${tf?"mem-spinning":""}`,onClick:()=>_(x=>!x),title:"Maintenance actions","aria-label":"Maintenance actions","aria-expanded":A,children:[tf?s.jsx("div",{className:"mem-spinner-sm"}):s.jsx(Si,{size:16}),s.jsx(ui,{size:10,style:{marginLeft:2}})]}),A&&s.jsxs("div",{className:"mem-maintenance-menu",role:"menu",children:[s.jsxs("button",{className:"mem-maintenance-item",onClick:fv,disabled:xi,role:"menuitem",children:[s.jsx(zm,{size:14}),xi?"Consolidating...":"Consolidate Sessions"]}),s.jsxs("button",{className:"mem-maintenance-item",onClick:mv,disabled:L,role:"menuitem",children:[s.jsx(qi,{size:14}),L?"Rebuilding...":"Rebuild Embeddings"]}),s.jsxs("button",{className:"mem-maintenance-item",onClick:hv,disabled:ee,role:"menuitem",children:[s.jsx(ji,{size:14}),ee?"Reconciling...":"Reconcile Memory"]}),s.jsx("div",{className:"mem-maintenance-divider"}),s.jsxs("button",{className:"mem-maintenance-item",onClick:gv,disabled:xt,role:"menuitem",children:[s.jsx(qs,{size:14}),xt?"Refreshing...":"Refresh System Context"]}),s.jsx("div",{className:"mem-maintenance-divider"}),s.jsxs("button",{className:"mem-maintenance-item",onClick:pv,disabled:xe,role:"menuitem",children:[s.jsx(An,{size:14}),xe?"Rebuilding...":"Rebuild FTS Indexes"]})]})]}),s.jsx("button",{className:"btn-icon",onClick:Rt,title:"Refresh","aria-label":"Refresh dashboard",children:s.jsx(qs,{size:16})})]})]}),s.jsxs("div",{className:"mem-tab-bar",role:"tablist",children:[s.jsxs("button",{className:`mem-tab-btn${dn==="dashboard"?" mem-tab-active":""}`,onClick:()=>Zt("dashboard"),role:"tab","aria-selected":dn==="dashboard",children:[s.jsx(ti,{size:14})," Dashboard"]}),s.jsxs("button",{className:`mem-tab-btn${dn==="goals"?" mem-tab-active":""}`,onClick:()=>{Zt("goals"),wr()},role:"tab","aria-selected":dn==="goals",children:[s.jsx(Lm,{size:14})," Goals",kn&&(kn.goals.pending_approval??0)>0&&s.jsx("span",{className:"mem-tab-badge",children:kn.goals.pending_approval})]}),s.jsxs("button",{className:`mem-tab-btn${dn==="profile"?" mem-tab-active":""}`,onClick:()=>Zt("profile"),role:"tab","aria-selected":dn==="profile",children:[s.jsx(Ew,{size:14})," Profile"]})]}),s.jsxs("div",{className:"memory-dashboard-body",children:[dn==="dashboard"&&s.jsx(s.Fragment,{children:y&&!t?s.jsxs("div",{className:"mem-loading",children:[s.jsx("div",{className:"mem-spinner"}),"Loading memory data..."]}):j?s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(ln,{size:32})}),s.jsx("p",{children:j}),s.jsxs("button",{className:"btn-secondary",onClick:Rt,style:{marginTop:12},children:[s.jsx(qs,{size:14})," Retry"]})]}):s.jsxs(s.Fragment,{children:[!F&&s.jsxs("div",{className:"mem-empty-state",style:{margin:"40px 0"},children:[s.jsx("div",{className:"mem-empty-icon",style:{opacity:.5},children:s.jsx(Xn,{size:32})}),s.jsx("p",{style:{color:"#888",fontSize:14},children:"Memory is disabled. Enable it in Settings below to start storing knowledge, conversations, and preferences."})]}),F&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mem-stat-cards",children:[s.jsxs("div",{className:"mem-stat-card","data-accent":"purple",children:[s.jsx("div",{className:"mem-stat-value",children:((rf=t==null?void 0:t.knowledge)==null?void 0:rf.total)??0}),s.jsx("div",{className:"mem-stat-label",children:"Stored"}),s.jsx("div",{className:"mem-stat-sub",children:(()=>{var $;const x=PT(r);return x>0?`+${x} today`:($=t==null?void 0:t.knowledge)!=null&&$.by_category?Object.entries(t.knowledge.by_category).slice(0,3).map(([se,me])=>`${me} ${se}s`).join(", "):"No entries"})()})]}),s.jsxs("div",{className:"mem-stat-card","data-accent":"gold",children:[s.jsx("div",{className:"mem-stat-value",children:((sf=t==null?void 0:t.knowledge)==null?void 0:sf.total_retrievals)??0}),s.jsx("div",{className:"mem-stat-label",children:"Retrieved"}),s.jsx("div",{className:"mem-stat-sub",children:(lf=t==null?void 0:t.knowledge)!=null&&lf.total&&((af=t==null?void 0:t.knowledge)!=null&&af.total_retrievals)?`avg ${(t.knowledge.total_retrievals/t.knowledge.total).toFixed(1)}x per memory`:"No recalls yet"})]}),s.jsxs("div",{className:"mem-stat-card","data-accent":"blue",children:[s.jsx("div",{className:"mem-stat-value",children:((of=t==null?void 0:t.conversations)==null?void 0:of.total_sessions)??0}),s.jsx("div",{className:"mem-stat-label",children:"Sessions"}),s.jsx("div",{className:"mem-stat-sub",children:IT(((cf=t==null?void 0:t.conversations)==null?void 0:cf.first_session)??null,((uf=t==null?void 0:t.conversations)==null?void 0:uf.last_session)??null)||`${((df=t==null?void 0:t.conversations)==null?void 0:df.total_turns)??0} total turns`})]}),s.jsxs("div",{className:"mem-stat-card","data-accent":"green",children:[s.jsx("div",{className:"mem-stat-value",children:((ff=t==null?void 0:t.tools)==null?void 0:ff.total_calls)??0}),s.jsx("div",{className:"mem-stat-label",children:"Tool Calls"}),s.jsxs("div",{className:"mem-stat-sub",children:[((mf=t==null?void 0:t.tools)==null?void 0:mf.unique_tools)??0," tools"]})]}),s.jsxs("div",{className:"mem-stat-card","data-accent":"red",children:[s.jsx("div",{className:"mem-stat-value",children:((hf=t==null?void 0:t.tools)==null?void 0:hf.overall_success_rate)!=null?`${Math.round(t.tools.overall_success_rate*100)}%`:"—"}),s.jsx("div",{className:"mem-stat-label",children:"Success Rate"}),s.jsxs("div",{className:"mem-stat-sub",children:[((pf=t==null?void 0:t.tools)==null?void 0:pf.total_errors)??0," errors"]})]})]}),s.jsxs("div",{className:"mem-section",children:[s.jsxs("div",{className:"mem-section-title mem-section-title-row",children:[s.jsxs("span",{className:"mem-section-title-left",children:[s.jsx(Dm,{size:14})," Activity"]}),s.jsx("div",{className:"mem-range-tabs",role:"group","aria-label":"Activity range",children:[1,7,30].map(x=>s.jsx("button",{className:`mem-range-tab${ys===x?" active":""}`,onClick:()=>Il(x),children:x===1?"1D":x===7?"7D":"30D"},x))})]}),r.length>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mem-activity-chart",children:r.map((x,$)=>{const se=x.conversations+x.tool_calls+x.knowledge_added+x.errors,me=$===0||$===r.length-1||$%7===0,Oe=new Date(x.date+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"});return s.jsxs("div",{className:"mem-activity-bar-group",onMouseEnter:()=>C($),onMouseLeave:()=>C(null),children:[x.errors>0&&s.jsx("div",{className:"mem-activity-bar errors",style:{height:`${x.errors/Pl*100}%`}}),x.knowledge_added>0&&s.jsx("div",{className:"mem-activity-bar knowledge",style:{height:`${x.knowledge_added/Pl*100}%`}}),x.tool_calls>0&&s.jsx("div",{className:"mem-activity-bar tool_calls",style:{height:`${x.tool_calls/Pl*100}%`}}),x.conversations>0&&s.jsx("div",{className:"mem-activity-bar conversations",style:{height:`${x.conversations/Pl*100}%`}}),me&&s.jsx("span",{className:"mem-activity-date-label",children:Oe}),D===$&&se>0&&s.jsxs("div",{className:"mem-activity-tooltip",children:[s.jsx("strong",{children:Oe}),s.jsx("br",{}),x.conversations>0&&s.jsxs(s.Fragment,{children:[x.conversations," conversations",s.jsx("br",{})]}),x.tool_calls>0&&s.jsxs(s.Fragment,{children:[x.tool_calls," tool calls",s.jsx("br",{})]}),x.knowledge_added>0&&s.jsxs(s.Fragment,{children:[x.knowledge_added," learned",s.jsx("br",{})]}),x.errors>0&&s.jsxs(s.Fragment,{children:[x.errors," errors"]})]})]},x.date)})}),s.jsxs("div",{className:"mem-activity-legend",children:[s.jsxs("span",{className:"mem-activity-legend-item",children:[s.jsx("span",{className:"mem-activity-legend-dot conversations"})," Conversations"]}),s.jsxs("span",{className:"mem-activity-legend-item",children:[s.jsx("span",{className:"mem-activity-legend-dot tool_calls"})," Tool Calls"]}),s.jsxs("span",{className:"mem-activity-legend-item",children:[s.jsx("span",{className:"mem-activity-legend-dot knowledge"})," Knowledge"]}),s.jsxs("span",{className:"mem-activity-legend-item",children:[s.jsx("span",{className:"mem-activity-legend-dot errors"})," Errors"]})]})]}):s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(Dm,{size:28})}),s.jsx("p",{children:"No activity data yet"})]})]}),s.jsxs("div",{className:"mem-section",children:[s.jsxs("div",{className:"mem-section-title mem-section-title-row",children:[s.jsxs("span",{className:"mem-section-title-left",children:[s.jsx(ti,{size:14})," Knowledge Browser",l&&l.total>0&&s.jsx("span",{className:"mem-section-count",children:l.total})]}),!G&&!Te&&s.jsxs("button",{className:"mem-section-add-btn",onClick:()=>ze(!0),title:"Add a memory entry",children:[s.jsx(gl,{size:13})," Add"]})]}),s.jsxs("div",{className:"mem-filters",children:[s.jsxs("div",{className:"mem-category-pills",role:"group","aria-label":"Filter by category",children:[qh.map(x=>s.jsx("button",{className:`mem-category-pill ${x}${oe.includes(x)?" active":""}`,onClick:()=>dv(x),"aria-pressed":oe.includes(x),children:x},x)),oe.length>0&&s.jsx("button",{className:"mem-category-pill clear",onClick:()=>{te([]),je(0)},"aria-label":"Clear category filters",children:"✕ Clear"})]}),s.jsxs("select",{className:"mem-filter-select",value:le,onChange:x=>{fe(x.target.value),je(0)},"aria-label":"Filter by context",children:[s.jsx("option",{value:"",children:"All Contexts"}),wv.map(x=>s.jsx("option",{value:x,children:x},x))]}),s.jsxs("select",{className:"mem-filter-select",value:T,onChange:x=>{P(x.target.value),je(0)},"aria-label":"Filter by entity",children:[s.jsx("option",{value:"",children:"All Entities"}),k.map(x=>s.jsxs("option",{value:x.entity,children:[x.entity," (",x.count,")"]},x.entity))]}),s.jsxs("div",{className:"mem-filter-search-wrap",children:[at?s.jsx("div",{className:"mem-spinner-sm search-icon",style:{width:12,height:12,borderWidth:1.5}}):s.jsx(An,{size:13,className:"search-icon"}),s.jsx("input",{className:"mem-filter-search",type:"text",placeholder:"Search memories...",value:b,onChange:x=>rv(x.target.value),"aria-label":"Search memories"})]}),s.jsxs("label",{className:"mem-filter-toggle",title:"Show entries that have been superseded by newer versions",children:[s.jsx("input",{type:"checkbox",checked:Ge,onChange:x=>qe(x.target.checked)}),s.jsx("span",{children:"Superseded"})]})]}),(G||Te)&&s.jsxs("div",{className:"mem-inline-form",children:[s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Content"}),s.jsx("textarea",{value:Se.content,onChange:x=>Fe($=>({...$,content:x.target.value})),placeholder:"What should the agent remember?"})]}),s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Category"}),s.jsx("select",{value:Se.category,onChange:x=>Fe($=>({...$,category:x.target.value})),children:qh.map(x=>s.jsx("option",{value:x,children:x.charAt(0).toUpperCase()+x.slice(1)},x))})]}),s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Context"}),s.jsx("input",{type:"text",value:Se.context,onChange:x=>Fe($=>({...$,context:x.target.value})),placeholder:"global"})]}),s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Domain"}),s.jsx("input",{type:"text",value:Se.domain,onChange:x=>Fe($=>({...$,domain:x.target.value})),placeholder:"e.g., python, frontend"})]}),s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Entity"}),s.jsx("input",{type:"text",value:Se.entity,onChange:x=>Fe($=>({...$,entity:x.target.value})),placeholder:"e.g., person:sarah_chen"})]}),s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Due At"}),s.jsx("input",{type:"text",value:Se.due_at,onChange:x=>Fe($=>({...$,due_at:x.target.value})),placeholder:"ISO 8601 (e.g., 2026-03-25T09:00:00-07:00)"})]}),s.jsxs("div",{className:"mem-inline-form-row",children:[s.jsx("label",{children:"Sensitive"}),s.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",fontSize:12},children:[s.jsx("input",{type:"checkbox",checked:Se.sensitive,onChange:x=>Fe($=>({...$,sensitive:x.target.checked}))}),"Mark as sensitive (excluded from system prompt)"]})]}),s.jsxs("div",{className:"mem-inline-form-actions",children:[s.jsx("button",{className:"btn-secondary",onClick:()=>{ze(!1),Qe(null)},children:"Cancel"}),s.jsx("button",{className:"btn-primary",onClick:Te?sv:iv,style:{padding:"8px 20px",fontSize:13},children:Te?"Update":"Save"})]})]}),l&&l.items.length>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"mem-knowledge-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsxs("th",{onClick:()=>ks("category"),className:H==="category"?"sorted":"",children:["Category",ws("category")]}),s.jsx("th",{children:"Content"}),s.jsxs("th",{onClick:()=>ks("context"),className:H==="context"?"sorted":"",children:["Context",ws("context")]}),s.jsx("th",{children:"Entity"}),s.jsxs("th",{onClick:()=>ks("confidence"),className:H==="confidence"?"sorted":"",children:["Confidence",ws("confidence")]}),s.jsx("th",{children:"Source"}),s.jsxs("th",{onClick:()=>ks("updated_at"),className:H==="updated_at"?"sorted":"",children:["Updated",ws("updated_at")]}),s.jsxs("th",{onClick:()=>ks("created_at"),className:H==="created_at"?"sorted":"",children:["Created",ws("created_at")]}),s.jsx("th",{children:"Due"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:l.items.map(x=>{const $=I===x.id,se=x.has_embedding;return s.jsxs(Ki.Fragment,{children:[s.jsxs("tr",{className:`${x.superseded_by?"mem-superseded-row":""} ${$?"mem-expanded-row":""}`,onClick:()=>N($?null:x.id),onKeyDown:me=>{(me.key==="Enter"||me.key===" ")&&(me.preventDefault(),N($?null:x.id))},tabIndex:0,role:"row","aria-expanded":$,style:{cursor:"pointer"},children:[s.jsx("td",{children:s.jsx("span",{className:`mem-cat-badge ${x.category}`,children:x.category})}),s.jsx("td",{children:s.jsxs("div",{className:"mem-content-cell",title:x.content,children:[se!==void 0&&s.jsx("span",{className:`mem-embed-dot ${se?"embedded":"missing"}`,title:se?"Embedded":"Embedding missing",children:s.jsx(Zk,{size:6,fill:"currentColor"})}),x.sensitive&&s.jsx("span",{className:"mem-sensitive-badge",title:"Sensitive",children:s.jsx(Xn,{size:11})}),s.jsx("span",{className:x.sensitive&&!Ht.has(x.id)?"mem-sensitive-blur":x.superseded_by?"mem-superseded-text":"",onClick:me=>{x.sensitive&&(me.stopPropagation(),Mn(Oe=>{const br=new Set(Oe);return br.has(x.id)?br.delete(x.id):br.add(x.id),br}))},children:x.content})]})}),s.jsx("td",{children:s.jsx("span",{className:"mem-date-cell",children:x.context})}),s.jsx("td",{children:x.entity?s.jsx("span",{className:"mem-entity-link",onClick:me=>{me.stopPropagation(),P(x.entity),je(0)},title:`Filter by ${x.entity}`,children:x.entity}):s.jsx("span",{className:"mem-date-cell",children:"—"})}),s.jsx("td",{children:s.jsxs("div",{className:"mem-confidence",children:[s.jsx("div",{className:"mem-confidence-bar",children:s.jsx("div",{className:`mem-confidence-fill ${DT(x.confidence)}`,style:{width:`${x.confidence*100}%`}})}),x.confidence.toFixed(2)]})}),s.jsx("td",{children:s.jsx("span",{className:"mem-date-cell",children:x.source||"—"})}),s.jsx("td",{children:s.jsx("span",{className:"mem-date-cell",title:Cn(x.updated_at),children:_r(x.updated_at)})}),s.jsx("td",{children:s.jsx("span",{className:"mem-date-cell",title:Cn(x.created_at),children:_r(x.created_at)})}),s.jsx("td",{children:x.due_at?s.jsx("span",{className:`mem-due-badge ${Wh(x.due_at)?"overdue":"upcoming"}`,title:Cn(x.due_at),children:_r(x.due_at)}):s.jsx("span",{className:"mem-due-badge none",children:"—"})}),s.jsx("td",{children:s.jsxs("div",{className:"mem-row-actions",onClick:me=>me.stopPropagation(),children:[s.jsx("button",{className:"mem-row-action-btn",onClick:()=>ov(x),title:"Edit",children:s.jsx(vw,{size:13})}),s.jsx("button",{className:"mem-row-action-btn",onClick:()=>av(x),title:x.sensitive?"Unmark sensitive":"Mark sensitive",children:x.sensitive?s.jsx(jw,{size:13}):s.jsx(Xn,{size:13})}),s.jsx("button",{className:"mem-row-action-btn",onClick:()=>cv(x.id),title:"Copy ID",children:s.jsx(Nl,{size:13})}),s.jsx("button",{className:"mem-row-action-btn delete",onClick:()=>lv(x.id),title:"Delete",children:s.jsx(fi,{size:13})})]})})]}),$&&s.jsx("tr",{className:"mem-detail-row",children:s.jsx("td",{colSpan:10,children:s.jsxs("div",{className:"mem-detail-panel",children:[s.jsxs("div",{className:"mem-detail-grid",children:[s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"ID"}),s.jsx("span",{className:"mem-detail-value",children:x.id})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Domain"}),s.jsx("span",{className:"mem-detail-value",children:x.domain||"—"})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Source"}),s.jsx("span",{className:"mem-detail-value",children:x.source||"—"})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Use Count"}),s.jsx("span",{className:"mem-detail-value",children:x.use_count??0})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Created"}),s.jsx("span",{className:"mem-detail-value",children:Cn(x.created_at)})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Updated"}),s.jsx("span",{className:"mem-detail-value",children:Cn(x.updated_at)})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Last Used"}),s.jsx("span",{className:"mem-detail-value",children:Cn(x.last_used)})]}),s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Reminded At"}),s.jsx("span",{className:"mem-detail-value",children:Cn(x.reminded_at)})]}),x.superseded_by&&s.jsxs("div",{className:"mem-detail-field",children:[s.jsx("span",{className:"mem-detail-label",children:"Superseded By"}),s.jsx("span",{className:"mem-detail-value mem-detail-chain",children:x.superseded_by})]}),x.metadata&&s.jsxs("div",{className:"mem-detail-field mem-detail-full",children:[s.jsx("span",{className:"mem-detail-label",children:"Metadata"}),s.jsx("span",{className:"mem-detail-value",children:typeof x.metadata=="object"?JSON.stringify(x.metadata,null,2):x.metadata})]})]}),s.jsxs("div",{className:"mem-detail-content-full",children:[s.jsx("span",{className:"mem-detail-label",children:"Full Content"}),s.jsx("div",{className:"mem-detail-content-text",children:x.content})]})]})})})]},x.id)})})]})}),s.jsxs("div",{className:"mem-pagination",children:[s.jsxs("span",{children:[ae+1,"–",Math.min(ae+Xe,l.total)," of ",l.total]}),s.jsxs("div",{className:"mem-pagination-btns",children:[s.jsx("button",{className:"mem-page-btn",disabled:ae===0,onClick:()=>je(Math.max(0,ae-Xe)),children:s.jsx(Jk,{size:14})}),s.jsx("button",{className:"mem-page-btn",disabled:ae+Xe>=l.total,onClick:()=>je(ae+Xe),children:s.jsx(us,{size:14})})]})]})]}):s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(ti,{size:28})}),s.jsx("p",{children:b||oe.length>0||le||T?"No matching memories":"No memories stored yet"})]})]}),s.jsxs("div",{className:"mem-two-col",children:[s.jsxs("div",{className:"mem-section",children:[s.jsxs("div",{className:"mem-section-title",children:[s.jsx(is,{size:14})," Tool Performance"]}),o.length>0?s.jsx("div",{style:{overflowX:"auto"},children:s.jsxs("table",{className:"mem-tool-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Tool"}),s.jsx("th",{children:"Calls"}),s.jsx("th",{children:"Success"}),s.jsx("th",{children:"Avg Time"}),s.jsx("th",{children:"Last Used"}),s.jsx("th",{children:"Last Error"})]})}),s.jsx("tbody",{children:o.map(x=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx("span",{className:"mem-tool-name",children:x.tool_name})}),s.jsx("td",{children:x.total_calls}),s.jsx("td",{children:s.jsxs("div",{className:"mem-confidence",children:[s.jsx("div",{className:"mem-confidence-bar",style:{width:40},children:s.jsx("div",{className:`mem-confidence-fill ${Gh(x.success_rate)}`,style:{width:`${x.success_rate*100}%`}})}),s.jsxs("span",{className:`mem-success-rate ${Gh(x.success_rate)}`,children:[Math.round(x.success_rate*100),"%"]})]})}),s.jsx("td",{children:LT(x.avg_duration_ms)}),s.jsx("td",{children:s.jsx("span",{className:"mem-date-cell",title:Cn(x.last_used),children:_r(x.last_used)})}),s.jsx("td",{children:s.jsx("span",{className:"mem-tool-error",title:x.last_error||"",children:x.last_error||"—"})})]},x.tool_name))})]})}):s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(is,{size:28})}),s.jsx("p",{children:"No tool calls recorded yet"})]})]}),s.jsxs("div",{className:"mem-section",children:[s.jsxs("div",{className:"mem-section-title",children:[s.jsx(Qa,{size:14})," Upcoming & Overdue"]}),f.length>0?s.jsx("div",{className:"mem-temporal-list",children:f.map(x=>{const $=Wh(x.due_at);return s.jsxs("div",{className:`mem-temporal-item ${$?"overdue":"upcoming"}`,children:[s.jsx("span",{className:"mem-temporal-icon",children:$?s.jsx(ln,{size:16}):s.jsx(Qa,{size:16})}),s.jsxs("div",{className:"mem-temporal-content",children:[s.jsx("div",{className:"mem-temporal-text",children:x.content}),s.jsxs("div",{className:"mem-temporal-date",children:[$?"OVERDUE":"Due",": ",_r(x.due_at),x.context!=="global"&&` · ${x.context}`]})]})]},x.id)})}):s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(ji,{size:28})}),s.jsx("p",{children:"Nothing upcoming or overdue"})]})]})]}),s.jsxs("div",{className:"mem-section",children:[s.jsxs("div",{className:"mem-section-title",children:[s.jsx(gu,{size:14})," Conversation History"]}),s.jsxs("div",{className:"mem-conv-search",children:[s.jsx(An,{size:13,className:"search-icon"}),s.jsx("input",{type:"text",placeholder:"Search conversations...",value:M,onChange:x=>uv(x.target.value),"aria-label":"Search conversations"}),M&&s.jsx("button",{className:"mem-search-clear",onClick:()=>{R(""),pe(null)},"aria-label":"Clear search",children:s.jsx(Ze,{size:12})})]}),B!==null?B.length>0?s.jsx("div",{className:"mem-conv-list",children:B.map(x=>s.jsxs("div",{className:"mem-conv-item",onClick:()=>ef(x.session_id),children:[s.jsxs("div",{className:"mem-conv-info",children:[s.jsxs("div",{className:"mem-conv-session-id",children:[s.jsx("span",{className:`mem-conv-turn-role ${x.role}`,children:x.role})," ",x.session_id.slice(0,8),"..."]}),s.jsx("div",{className:"mem-conv-preview",children:x.content})]}),s.jsx("div",{className:"mem-conv-meta",children:s.jsx("span",{children:_r(x.timestamp)})})]},x.id))}):s.jsx("div",{className:"mem-empty",children:s.jsxs("p",{children:["No conversations match “",M,"”"]})}):u.length>0?s.jsx("div",{className:"mem-conv-list",children:u.map(x=>s.jsxs("div",{className:"mem-conv-item",onClick:()=>ef(x.session_id),children:[s.jsxs("div",{className:"mem-conv-info",children:[s.jsxs("div",{className:"mem-conv-session-id",children:[x.session_id.slice(0,8),"...",x.consolidated&&s.jsx("span",{className:"mem-consolidated-badge",title:"Consolidated",children:s.jsx(zm,{size:11})})]}),x.first_message&&s.jsx("div",{className:"mem-conv-preview",children:x.first_message})]}),s.jsxs("div",{className:"mem-conv-meta",children:[s.jsxs("span",{children:[x.turn_count," turns"]}),s.jsx("span",{children:_r(x.last_activity)})]})]},x.session_id))}):s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(gu,{size:28})}),s.jsx("p",{children:"No conversation history in memory"})]})]}),ce&&s.jsxs("div",{className:"mem-conv-detail-overlay",children:[s.jsxs("div",{className:"mem-conv-detail-header",children:[s.jsxs("h4",{children:["Session: ",ce.sessionId.slice(0,12),"..."]}),s.jsx("button",{className:"btn-icon",onClick:()=>we(null),children:s.jsx(Ze,{size:16})})]}),s.jsxs("div",{className:"mem-conv-detail-body",children:[ce.turns.map(x=>s.jsxs("div",{className:"mem-conv-turn",children:[s.jsxs("div",{className:"mem-conv-turn-header",children:[s.jsx("div",{className:`mem-conv-turn-role ${x.role}`,children:x.role}),s.jsx("span",{className:"mem-conv-turn-time",title:Cn(x.timestamp),children:_r(x.timestamp)})]}),s.jsx("div",{className:"mem-conv-turn-content",children:x.content})]},x.id)),ce.turns.length===0&&s.jsx("div",{className:"mem-empty",children:"No turns found"})]})]})]}),s.jsxs("div",{className:"mem-section",children:[s.jsxs("div",{className:"mem-section-title",children:[s.jsx(Xn,{size:14})," Settings ",s.jsx("span",{style:{fontSize:10,fontWeight:600,color:"#f59e0b",background:"rgba(245,158,11,0.15)",padding:"1px 6px",borderRadius:4,marginLeft:6,verticalAlign:"middle",letterSpacing:"0.5px"},children:"BETA"})]}),s.jsxs("div",{className:"mem-setting-row",children:[s.jsxs("div",{className:"mem-setting-info",children:[s.jsx("span",{className:"mem-setting-label",children:"Memory enabled"}),s.jsx("span",{className:"mem-setting-desc",children:"When disabled, no knowledge or conversation data is stored during any session (global incognito)."})]}),s.jsx("button",{className:`mem-toggle${F?" mem-toggle-on":""}`,disabled:gt,onClick:async()=>{if(!F){vn("memory");return}Ke(!0);try{const x=await wi({memory_enabled:!1});K(x.memory_enabled)}catch(x){E.system.warn("Failed to disable memory",x)}finally{Ke(!1)}},"aria-pressed":F,"aria-label":`Memory is ${F?"enabled":"disabled"}`,children:F?"On":"Off"})]}),bt&&(()=>{const $={memory:{title:"Enable Agent Memory?",description:"Agent memory is a work-in-progress. By enabling it:",bullets:[["Conversations and facts are stored ","locally on this machine"],["Stored data ","may be lost"," during updates"],["You can disable it at any time from this settings panel"]],buttonLabel:"Enable Memory",onConfirm:async()=>{const se=await wi({memory_enabled:!0});K(se.memory_enabled),Z("Memory enabled","info")}},mcp:{title:"Enable MCP Memory Access?",description:"This exposes memory data to external MCP clients:",bullets:[["MCP clients can ","read your stored memories"," (read-only)"],["Requires an ","MCP server restart"," to take effect"],["Intended for debugging and troubleshooting only"]],buttonLabel:"Enable MCP Access",onConfirm:async()=>{const se=await wi({mcp_memory_enabled:!0});ke(se.mcp_memory_enabled),Z("MCP memory access enabled","info")}},discovery:{title:"Enable System Discovery?",description:"This scans your system to personalize responses:",bullets:[["Collects ","hardware, software, and environment"," information"],["Scans files, git repos, browser history, and SSH config"],["All data stays ","local on this machine"]],buttonLabel:"Enable Discovery",onConfirm:async()=>{var me;const se=await wi({system_discovery_consent:!0});if(wt(se.system_discovery_consent),se.system_context_error)Z(`System discovery enabled but scan failed: ${se.system_context_error}`,"error");else{const Oe=((me=se.system_context_refresh)==null?void 0:me.stored)??0;Z(`System discovery enabled — ${Oe} system facts collected`,"info")}Rt()}}}[bt];return s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.6)",zIndex:9998,backdropFilter:"blur(4px)"},onClick:()=>vn(null)}),s.jsxs("div",{style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:9999,background:"#1a1a2e",border:"1px solid #333",borderRadius:12,padding:"28px 32px",maxWidth:420,width:"90vw",boxShadow:"0 20px 60px rgba(0,0,0,0.5)"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:16},children:[s.jsx("span",{style:{fontSize:11,fontWeight:700,color:"#f59e0b",background:"rgba(245,158,11,0.15)",padding:"3px 10px",borderRadius:4,letterSpacing:"0.5px"},children:"BETA"}),s.jsx("span",{style:{fontSize:16,fontWeight:600,color:"#e0e0e0"},children:$.title})]}),s.jsx("p",{style:{fontSize:13,lineHeight:1.6,color:"#999",margin:"0 0 8px"},children:$.description}),s.jsx("ul",{style:{fontSize:13,lineHeight:1.7,color:"#999",margin:"0 0 24px",paddingLeft:20},children:$.bullets.map((se,me)=>s.jsx("li",{children:se.map((Oe,br)=>br%2===1?s.jsx("strong",{style:{color:"#ccc"},children:Oe},br):s.jsx("span",{children:Oe},br))},me))}),s.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[s.jsx("button",{className:"btn-secondary",onClick:()=>vn(null),style:{padding:"8px 20px",fontSize:13,borderRadius:6},children:"Cancel"}),s.jsx("button",{disabled:gt,onClick:async()=>{Ke(!0);try{await $.onConfirm()}catch(se){E.system.warn("Failed to update setting",se),Z("Failed to update setting. Please try again.","error")}finally{Ke(!1),vn(null)}},style:{padding:"8px 24px",fontSize:13,fontWeight:600,borderRadius:6,border:"none",cursor:"pointer",background:"linear-gradient(135deg, #f59e0b, #d97706)",color:"#000"},children:$.buttonLabel})]})]})]})})(),s.jsxs("div",{className:"mem-setting-row",children:[s.jsxs("div",{className:"mem-setting-info",children:[s.jsx("span",{className:"mem-setting-label",children:"MCP memory access"}),s.jsx("span",{className:"mem-setting-desc",children:"Expose read-only memory tools to MCP clients (for debug/troubleshooting). Requires MCP server restart."})]}),s.jsx("button",{className:`mem-toggle${ue?" mem-toggle-on":""}`,disabled:gt,onClick:async()=>{if(!ue){vn("mcp");return}Ke(!0);try{const x=await wi({mcp_memory_enabled:!1});ke(x.mcp_memory_enabled)}catch(x){E.system.warn("Failed to update memory settings",x)}finally{Ke(!1)}},"aria-label":"Toggle MCP memory access","aria-pressed":ue,children:ue?"On":"Off"})]}),s.jsxs("div",{className:"mem-setting-row",children:[s.jsxs("div",{className:"mem-setting-info",children:[s.jsx("span",{className:"mem-setting-label",children:"System discovery"}),s.jsx("span",{className:"mem-setting-desc",children:"Allow GAIA to scan your system for hardware, software, and environment information to personalize responses."})]}),s.jsx("button",{className:`mem-toggle${Ne?" mem-toggle-on":""}`,disabled:gt,onClick:async()=>{if(!Ne){vn("discovery");return}Ke(!0);try{const x=await wi({system_discovery_consent:!1});wt(x.system_discovery_consent)}catch(x){E.system.warn("Failed to update system discovery setting",x)}finally{Ke(!1)}},"aria-label":"Toggle system discovery","aria-pressed":Ne,children:Ne?"On":"Off"})]}),s.jsxs("div",{className:"mem-setting-row mem-setting-row-danger",children:[s.jsxs("div",{className:"mem-setting-info",children:[s.jsx("span",{className:"mem-setting-label",children:"Re-initialize memory"}),s.jsx("span",{className:"mem-setting-desc",children:"Wipe all memories, conversations, and tool logs, then re-collect system information. This cannot be undone."})]}),it?s.jsxs("div",{className:"mem-delete-confirm",children:[s.jsx("span",{className:"mem-delete-confirm-label",children:"Are you sure?"}),s.jsx("button",{className:"mem-btn-danger",disabled:gt,onClick:async()=>{Ke(!0);try{const x=await jT();Z(`Re-initialized: cleared ${x.cleared.knowledge} entries, restored ${x.system_context.stored} system facts`,"info"),Rt()}catch(x){E.system.warn("Failed to reinitialize memory",x),Z("Failed to re-initialize memory","error")}finally{Ke(!1),Mt(!1)}},children:"Yes, re-initialize"}),s.jsx("button",{className:"btn-secondary",onClick:()=>Mt(!1),style:{padding:"6px 14px",fontSize:12},children:"Cancel"})]}):s.jsx("button",{className:"mem-btn-danger",disabled:gt,onClick:()=>Mt(!0),children:"Re-initialize"})]}),s.jsxs("div",{className:"mem-setting-row mem-setting-row-danger",children:[s.jsxs("div",{className:"mem-setting-info",children:[s.jsx("span",{className:"mem-setting-label",children:"Delete all memories"}),s.jsx("span",{className:"mem-setting-desc",children:"Permanently wipe all knowledge entries, conversation history, and tool logs. This cannot be undone."})]}),Pt?s.jsxs("div",{className:"mem-delete-confirm",children:[s.jsx("span",{className:"mem-delete-confirm-label",children:"Are you sure?"}),s.jsx("button",{className:"mem-btn-danger",disabled:gt,onClick:async()=>{Ke(!0);try{const x=await bT();Z(`Deleted ${x.knowledge} knowledge entries, ${x.conversations} conversations`,"info"),Rt()}catch(x){E.system.warn("Failed to clear memory",x),Z("Failed to clear memory","error")}finally{Ke(!1),Jt(!1)}},children:"Yes, delete all"}),s.jsx("button",{className:"btn-secondary",onClick:()=>Jt(!1),style:{padding:"6px 14px",fontSize:12},children:"Cancel"})]}):s.jsx("button",{className:"mem-btn-danger",disabled:gt,onClick:()=>Jt(!0),children:"Delete All"})]})]}),t&&s.jsxs("div",{className:"mem-db-footer",children:[s.jsxs("span",{children:["Database: ",AT(t.db_size_bytes),((gf=t.knowledge)==null?void 0:gf.avg_confidence)!=null&&` · Avg confidence: ${t.knowledge.avg_confidence.toFixed(2)}`]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[((yf=t.knowledge)==null?void 0:yf.entity_count)!=null&&t.knowledge.entity_count>0&&s.jsxs("span",{children:[t.knowledge.entity_count," entities"]}),((xf=t.knowledge)==null?void 0:xf.sensitive_count)!=null&&t.knowledge.sensitive_count>0&&s.jsxs("span",{children:[s.jsx(Xn,{size:10})," ",t.knowledge.sensitive_count," sensitive"]})]})]})]})}),dn==="profile"&&s.jsxs("div",{className:"mem-profile-grid",children:[s.jsxs("div",{className:"mem-profile-card",children:[s.jsxs("div",{className:"mem-profile-card-title",children:[s.jsx(rs,{size:16})," System Discovery"]}),s.jsx("p",{className:"mem-profile-desc",children:"Scan your system to discover apps, projects, and usage patterns."}),s.jsx("button",{className:"btn-primary mem-profile-run-btn",disabled:lt==="running"||lt==="saving",onClick:yv,children:lt==="running"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mem-spinner-sm"})," Running..."]}):"Run Discovery"}),hs.length>0&&s.jsx("div",{className:"mem-log",ref:jn,children:hs.map((x,$)=>s.jsx("div",{className:`mem-log-line ${x.kind}`,children:x.text},$))}),(lt==="review"||lt==="saving"||lt==="done")&&qn.length>0&&s.jsxs("div",{className:"mem-review-section",children:[s.jsx("div",{className:"mem-review-header",children:"Review & Save"}),s.jsx("div",{className:"mem-review-list",children:qn.map((x,$)=>s.jsxs("label",{className:"mem-review-item",children:[s.jsx("input",{type:"checkbox",checked:x._checked,disabled:lt==="saving"||lt==="done",onChange:()=>{pr(se=>se.map((me,Oe)=>Oe===$?{...me,_checked:!me._checked}:me))}}),s.jsx("span",{className:"mem-review-content",children:x.content}),s.jsx("span",{className:"mem-source-badge",children:x._source_name||x.category}),s.jsxs("span",{className:"mem-conf-badge",children:[Math.round(x.confidence*100),"%"]})]},$))}),s.jsxs("div",{className:"mem-review-actions",children:[s.jsx("button",{className:"btn-primary",disabled:lt==="saving"||lt==="done"||qn.filter(x=>x._checked).length===0,onClick:xv,children:lt==="saving"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mem-spinner-sm"})," Saving..."]}):`Save Selected (${qn.filter(x=>x._checked).length})`}),s.jsxs("span",{className:"mem-review-select-links",children:[s.jsx("a",{onClick:()=>pr(x=>x.map($=>({...$,_checked:!0}))),children:"Select All"})," / ",s.jsx("a",{onClick:()=>pr(x=>x.map($=>({...$,_checked:!1}))),children:"None"})]})]})]}),lt==="done"&&zl!==null&&s.jsxs("div",{className:"mem-profile-success",children:[s.jsx(ji,{size:14})," Saved ",zl," items to memory"]}),lt==="review"&&qn.length===0&&s.jsx("div",{className:"mem-profile-empty",children:"No items discovered."})]}),s.jsxs("div",{className:"mem-profile-card",children:[s.jsxs("div",{className:"mem-profile-card-title",children:[s.jsx(Sw,{size:16})," AI Profile Inference"]}),s.jsx("p",{className:"mem-profile-desc",children:"Use the local LLM to generate profile insights from your data."}),s.jsx("p",{className:"mem-profile-note",children:"Requires Lemonade Server running."}),s.jsxs("label",{className:"mem-profile-checkbox",children:[s.jsx("input",{type:"checkbox",checked:gs,onChange:x=>Ao(x.target.checked),disabled:jt==="running"||jt==="saving"}),"Include browser history"]}),s.jsx("button",{className:"btn-primary mem-profile-run-btn",disabled:jt==="running"||jt==="saving",onClick:vv,children:jt==="running"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mem-spinner-sm"})," Running..."]}):"Run Inference"}),ps.length>0&&s.jsx("div",{className:"mem-log",ref:yi,children:ps.map((x,$)=>s.jsx("div",{className:`mem-log-line ${x.kind}`,children:x.text},$))}),(jt==="review"||jt==="saving"||jt==="done")&&Qn.length>0&&s.jsxs("div",{className:"mem-review-section",children:[s.jsx("div",{className:"mem-review-header",children:"Review & Save"}),s.jsx("div",{className:"mem-review-list",children:Qn.map((x,$)=>s.jsxs("label",{className:"mem-review-item",children:[s.jsx("input",{type:"checkbox",checked:x._checked,disabled:jt==="saving"||jt==="done",onChange:()=>{xr(se=>se.map((me,Oe)=>Oe===$?{...me,_checked:!me._checked}:me))}}),s.jsx("span",{className:"mem-review-content",children:x.content}),s.jsx("span",{className:`mem-domain-badge ${MT[x.domain]||"gray"}`,children:x.domain}),s.jsxs("span",{className:"mem-conf-badge",children:[Math.round(x.confidence*100),"%"]})]},$))}),s.jsxs("div",{className:"mem-review-actions",children:[s.jsx("button",{className:"btn-primary",disabled:jt==="saving"||jt==="done"||Qn.filter(x=>x._checked).length===0,onClick:kv,children:jt==="saving"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mem-spinner-sm"})," Saving..."]}):`Save Selected (${Qn.filter(x=>x._checked).length})`}),s.jsxs("span",{className:"mem-review-select-links",children:[s.jsx("a",{onClick:()=>xr(x=>x.map($=>({...$,_checked:!0}))),children:"Select All"})," / ",s.jsx("a",{onClick:()=>xr(x=>x.map($=>({...$,_checked:!1}))),children:"None"})]})]})]}),jt==="done"&&Ll!==null&&s.jsxs("div",{className:"mem-profile-success",children:[s.jsx(ji,{size:14})," Saved ",Ll," insights to memory"]}),jt==="review"&&Qn.length===0&&s.jsx("div",{className:"mem-profile-empty",children:"No insights generated."})]})]}),dn==="goals"&&s.jsxs("div",{className:"mem-goals-tab",children:[s.jsx("div",{className:"mem-goals-stats-row",children:["queued","in_progress","completed","failed"].map(x=>s.jsxs("div",{className:`mem-goals-stat-pill mem-goal-status-${x.replace("_","-")}`,children:[s.jsx("span",{className:"mem-goals-stat-n",children:(kn==null?void 0:kn.goals[x])??0}),s.jsx("span",{className:"mem-goals-stat-label",children:x.replace("_"," ")})]},x))}),en.filter(x=>x.status==="pending_approval").length>0&&s.jsxs("div",{className:"mem-goals-approval-banner",children:[s.jsxs("div",{className:"mem-goals-approval-title",children:[s.jsx(qi,{size:14})," Agent suggested ",en.filter(x=>x.status==="pending_approval").length," goal(s) — review before execution"]}),en.filter(x=>x.status==="pending_approval").map(x=>s.jsxs("div",{className:"mem-goals-approval-item",children:[s.jsxs("div",{className:"mem-goals-approval-text",children:[s.jsx("strong",{children:x.title}),s.jsx("span",{children:x.description})]}),s.jsxs("div",{className:"mem-goals-approval-actions",children:[s.jsx("button",{className:"btn-danger-sm",onClick:async()=>{await ET(x.id),wr()},children:"Reject"}),s.jsx("button",{className:"btn-secondary",onClick:async()=>{await _T(x.id),wr()},children:"Accept"})]})]},x.id))]}),s.jsx("div",{className:"mem-goals-toolbar",children:s.jsxs("button",{className:"btn-primary",onClick:()=>dr(x=>!x),children:[s.jsx(gl,{size:14})," New Goal"]})}),Tl&&s.jsxs("div",{className:"mem-goals-add-form",children:[s.jsx("input",{className:"mem-input",placeholder:"Goal title",value:fr.title,onChange:x=>mr($=>({...$,title:x.target.value}))}),s.jsx("textarea",{className:"mem-input",placeholder:"Description — what should the agent work toward?",rows:2,value:fr.description,onChange:x=>mr($=>({...$,description:x.target.value}))}),s.jsxs("div",{className:"mem-goals-form-row",children:[s.jsxs("select",{className:"mem-select",value:fr.priority,onChange:x=>mr($=>({...$,priority:x.target.value})),children:[s.jsx("option",{value:"low",children:"Low priority"}),s.jsx("option",{value:"medium",children:"Medium priority"}),s.jsx("option",{value:"high",children:"High priority"})]}),s.jsx("button",{className:"btn-primary",onClick:async()=>{fr.title.trim()&&(await CT(fr),mr({title:"",description:"",priority:"medium"}),dr(!1),wr())},children:"Create"}),s.jsx("button",{className:"btn-secondary",onClick:()=>dr(!1),children:"Cancel"})]})]}),wn?s.jsxs("div",{className:"mem-loading",children:[s.jsx("div",{className:"mem-spinner"})," Loading goals..."]}):en.filter(x=>x.status!=="pending_approval"&&x.status!=="rejected").length===0?s.jsxs("div",{className:"mem-empty",children:[s.jsx("div",{className:"mem-empty-icon",children:s.jsx(Lm,{size:32})}),s.jsx("p",{children:"No goals yet. Create one or let the agent suggest goals in autonomous mode."})]}):s.jsx("div",{className:"mem-goals-list",children:en.filter(x=>x.status!=="pending_approval"&&x.status!=="rejected").map(x=>s.jsxs("div",{className:`mem-goal-card mem-goal-status-${x.status.replace("_","-")}`,children:[s.jsxs("div",{className:"mem-goal-header",onClick:()=>ur($=>$===x.id?null:x.id),children:[s.jsxs("div",{className:"mem-goal-header-left",children:[s.jsx("span",{className:`mem-goal-status-dot status-${x.status.replace("_","-")}`}),s.jsx("span",{className:"mem-goal-title",children:x.title}),s.jsx("span",{className:`mem-goal-priority mem-priority-${x.priority}`,children:x.priority}),x.source!=="user"&&s.jsxs("span",{className:"mem-goal-source-badge",children:[s.jsx(qi,{size:10})," ",x.source.replace("_"," ")]})]}),s.jsxs("div",{className:"mem-goal-header-right",children:[s.jsxs("span",{className:"mem-goal-task-count",children:[s.jsx(xy,{size:12}),x.tasks.filter($=>$.status==="completed").length,"/",x.tasks.length]}),x.status==="queued"&&s.jsx("button",{className:"mem-goal-action-btn mem-goal-cancel-btn",onClick:async $=>{$.stopPropagation(),await TT(x.id),wr()},children:"Cancel"}),s.jsx("button",{className:"mem-goal-action-btn mem-goal-delete-btn",onClick:async $=>{$.stopPropagation(),confirm(`Delete goal "${x.title}"?`)&&(await zT(x.id),wr())},children:s.jsx(fi,{size:12})}),s.jsx(ui,{size:14,className:Gn===x.id?"mem-chevron-open":""})]})]}),Gn===x.id&&s.jsxs("div",{className:"mem-goal-body",children:[x.description&&s.jsx("p",{className:"mem-goal-desc",children:x.description}),x.progress_notes&&s.jsx("p",{className:"mem-goal-progress",children:x.progress_notes}),x.tasks.length>0?s.jsx("div",{className:"mem-task-list",children:x.tasks.map($=>s.jsxs("div",{className:`mem-task-row mem-task-status-${$.status}`,children:[s.jsx("span",{className:`mem-task-dot status-${$.status}`}),s.jsx("span",{className:"mem-task-desc",children:$.description}),s.jsx("span",{className:"mem-task-status-label",children:$.status}),$.result&&s.jsx("span",{className:"mem-task-result",children:$.result})]},$.id))}):s.jsx("p",{className:"mem-goal-no-tasks",children:"No tasks yet — the agent will break this down when it starts."})]})]},x.id))})]})]}),U.length>0&&s.jsx("div",{className:"mem-toast-container","aria-live":"polite",children:U.map(x=>s.jsxs("div",{className:`mem-toast mem-toast-${x.type}`,role:"status",children:[x.type==="success"&&s.jsx(ji,{size:14}),x.type==="error"&&s.jsx(ln,{size:14}),x.type==="info"&&s.jsx(ti,{size:14}),s.jsx("span",{children:x.text})]},x.id))})]})}const Js=32768,Xd="Qwen3.5-35B-A3B-GGUF",$T=3e5,FT=18e5,OT=1e4;function tv(e,t){const[n,r]=p.useState(!1),[i,l]=p.useState(!1),a=p.useRef(null),o=p.useRef(null),c=p.useRef(null),u=p.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null),o.current&&(clearTimeout(o.current),o.current=null),c.current&&(clearInterval(c.current),c.current=null)},[]);p.useEffect(()=>u,[u]);const d=p.useCallback((g,k)=>{c.current&&clearInterval(c.current),c.current=setInterval(async()=>{var v,y;try{const w=await _d();k==="load"?((v=w.model_loaded)==null?void 0:v.toLowerCase())===g.toLowerCase()&&(r(!1),a.current&&(clearTimeout(a.current),a.current=null),c.current&&(clearInterval(c.current),c.current=null)):(w.model_downloaded===!0||((y=w.model_loaded)==null?void 0:y.toLowerCase())===g.toLowerCase())&&(l(!1),o.current&&(clearTimeout(o.current),o.current=null),c.current&&(clearInterval(c.current),c.current=null))}catch{}},OT)},[]),f=e??Xd,h=p.useCallback(async(g,k)=>{const v=g??f,y=k??Js;r(!0);try{await c0(v,y),E.system.info(`Load model triggered: ${v} (ctx=${y})`),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>r(!1),$T),d(v,"load")}catch(w){E.system.error("Failed to trigger model load",w),r(!1)}},[f,t,d]),m=p.useCallback(async(g=!1,k)=>{const v=k??f;l(!0);try{await u0(v,g),E.system.info(`Download model triggered: ${v} (force=${g})`),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>l(!1),FT),d(v,"download")}catch(y){E.system.error("Failed to trigger model download",y),l(!1)}},[f,d]);return{isLoadingModel:n,isDownloadingModel:i,loadModel:h,downloadModel:m}}const Qh=jo();function UT(){const{setAgents:e}=ve(),[t,n]=p.useState({kind:"idle"}),[r,i]=p.useState([]),l=p.useRef(null),a=p.useRef(null),o=p.useRef(null);p.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),p.useEffect(()=>{var v;t.kind==="error"&&((v=o.current)==null||v.scrollIntoView({behavior:"smooth",block:"nearest"}))},[t]);const c=p.useCallback((v,y=5e3)=>{n(v),a.current&&clearTimeout(a.current),(v.kind==="success"||v.kind==="error")&&(a.current=setTimeout(()=>n({kind:"idle"}),y))},[]),u=p.useCallback(async()=>{try{const[v,y]=await Promise.all([Ed(),d0()]);e(v.agents||[]),i(y.agents||[])}catch(v){E.api.warn("Failed to refresh custom agents",v)}},[e]);p.useEffect(()=>{u()},[u]);const d=r,f=d.length>0,h=p.useCallback(async()=>{if(window.confirm(`Exported bundle contains your agent source files as-is. Any API keys, tokens, or credentials in agent.py will be included in the bundle. Review before sharing.
|
|
559
|
+
|
|
560
|
+
Continue?`)){c({kind:"working",message:"Exporting…"});try{const y=await fetch(`${Qh}/agents/export`,{method:"POST",headers:{"X-Gaia-UI":"1"}});if(!y.ok){const D=await y.text().catch(()=>"");let C=D;try{C=JSON.parse(D).detail||D}catch{}throw new Error(C||`Export failed (HTTP ${y.status})`)}const w=await y.blob(),j=URL.createObjectURL(w),z=document.createElement("a");z.href=j,z.download="gaia-agents-export.zip",document.body.appendChild(z),z.click(),document.body.removeChild(z),URL.revokeObjectURL(j),c({kind:"success",message:"Export downloaded."})}catch(y){console.error("Agent export failed:",y);const w=y instanceof Error?y.message:String(y);E.api.error("Agent export failed",y),c({kind:"error",message:`Export failed: ${w}`})}}},[c]),m=p.useCallback(()=>{var v;(v=l.current)==null||v.click()},[]),g=p.useCallback(async v=>{var D;const y=(D=v.target.files)==null?void 0:D[0];if(v.target.value="",!y)return;let w=null;if(y.size<=100*1024*1024)try{w=await BT(y)}catch(C){E.api.warn("Could not pre-read bundle.json from zip",C)}const j=w&&w.length>0?`Agents to install: ${w.join(", ")}`:"Agents to install: (unable to read bundle contents — contents will be validated by the server)";if(window.confirm(`Importing this bundle will run third-party Python code on your machine when the agent is selected. Only import bundles from sources you trust.
|
|
561
|
+
|
|
562
|
+
`+j+`
|
|
563
|
+
|
|
564
|
+
Import?`)){c({kind:"working",message:"Uploading…"});try{const C=new FormData;C.append("bundle",y,y.name);const A=await fetch(`${Qh}/agents/import`,{method:"POST",headers:{"X-Gaia-UI":"1"},body:C});if(!A.ok){const O=await A.text().catch(()=>"");let re=O;try{re=JSON.parse(O).detail||O}catch{}throw new Error(re||`Import failed (HTTP ${A.status})`)}const _=await A.json(),I=_.imported||[],N=_.overwritten||[];await u();let U;if(I.length===0?U="No agents imported":(U=`Installed ${I.length} agent(s): ${I.join(", ")}`,N.length>0&&(U+=` (replaced: ${N.join(", ")})`)),_.requires_restart&&(U+=" — restart required for replaced agents to take full effect"),_.errors&&_.errors.length>0){const O=_.errors.map(re=>`${re.id}: ${re.error}`).join("; ");c({kind:"error",message:`${U}. Errors: ${O}`})}else c({kind:"success",message:U})}catch(C){console.error("Agent import failed:",C);const A=C instanceof Error?C.message:String(C);E.api.error("Agent import failed",C),c({kind:"error",message:`Import failed: ${A}`})}}},[c,u]),k=t.kind==="working";return s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"Custom Agents"}),d.length===0?s.jsx("p",{className:"danger-warning",style:{marginBottom:12},children:"No custom agents installed yet. Import a bundle below to add one."}):s.jsx("div",{className:"status-grid",style:{marginBottom:12},children:d.map(v=>s.jsxs("div",{className:"status-row",children:[s.jsx("span",{className:"status-label",children:v.name}),s.jsxs("div",{className:"status-value-wrap",children:[s.jsx("span",{className:`status-value ${v.registered?"ok":"warn"}`,children:v.id}),v.registered?v.source&&s.jsx("span",{className:"status-hint",children:s.jsx("code",{children:v.source})}):s.jsx("span",{className:"status-hint",children:"Not loaded"})]})]},v.id))}),s.jsxs("div",{className:"setting-actions",style:{display:"flex",gap:8,flexWrap:"wrap"},children:[s.jsx("button",{className:"btn-model-save",onClick:h,disabled:k||!f,title:f?void 0:"No custom agents to export",children:k&&t.message.startsWith("Export")?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"btn-spinner"})," Exporting…"]}):s.jsxs(s.Fragment,{children:[s.jsx(di,{size:13,style:{verticalAlign:-2,marginRight:6}}),"Export All"]})}),s.jsx("button",{className:"btn-model-save",onClick:m,disabled:k,children:k&&t.message.startsWith("Upload")?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"btn-spinner"})," Uploading…"]}):s.jsxs(s.Fragment,{children:[s.jsx(yl,{size:13,style:{verticalAlign:-2,marginRight:6}}),"Import"]})}),s.jsx("input",{ref:l,type:"file",accept:".zip,application/zip",style:{display:"none"},onChange:g})]}),t.kind!=="idle"&&s.jsxs("div",{ref:o,className:"danger-warning",style:{marginTop:12,display:"flex",alignItems:"center",gap:8,color:t.kind==="error"?"var(--accent-gold)":"var(--text-secondary)"},role:"status",children:[t.kind==="working"&&s.jsx(mt,{size:14,className:"btn-spinner"}),t.kind==="success"&&s.jsx(Vn,{size:14}),t.kind==="error"&&s.jsx(pt,{size:14}),s.jsx("span",{children:t.message})]})]})}async function BT(e){const t=await e.arrayBuffer(),n=new DataView(t),r=new Uint8Array(t),i=Math.min(t.byteLength,65557),l=t.byteLength-i;let a=-1;for(let d=t.byteLength-22;d>=l;d--)if(n.getUint32(d,!0)===101010256){a=d;break}if(a<0)return null;const o=n.getUint16(a+10,!0);let u=n.getUint32(a+16,!0);for(let d=0;d<o;d++){if(u+46>t.byteLength||n.getUint32(u,!0)!==33639248)return null;const f=n.getUint16(u+10,!0),h=n.getUint32(u+20,!0),m=n.getUint16(u+28,!0),g=n.getUint16(u+30,!0),k=n.getUint16(u+32,!0),v=n.getUint32(u+42,!0);if(new TextDecoder("utf-8").decode(r.subarray(u+46,u+46+m))==="bundle.json"){if(v+30>t.byteLength||n.getUint32(v,!0)!==67324752)return null;const w=n.getUint16(v+26,!0),j=n.getUint16(v+28,!0),z=v+30+w+j,D=z+h;if(D>t.byteLength)return null;const C=r.subarray(z,D);let A;if(f===0)A=new TextDecoder("utf-8").decode(C);else if(f===8){const N=new DecompressionStream("deflate-raw"),U=new Blob([C]).stream().pipeThrough(N),O=await new Response(U).arrayBuffer();A=new TextDecoder("utf-8").decode(O)}else return null;const _=JSON.parse(A),I=_==null?void 0:_.agent_ids;return Array.isArray(I)&&I.every(N=>typeof N=="string")?I:null}u+=46+m+g+k}return null}const Kh=E.api;function HT(e){switch(e){case"connector.configured":return"configured";case"connector.disconnected":return"disconnected";case"connection.revoked":return"disconnected";case"connector.oauth.completed":return"oauth_completed";case"connection.connected":return"oauth_completed";case"connector.oauth.error":return"oauth_error";case"connector.tested":return"tested";case"connector.enabled":return"enabled";case"connector.disabled":return"disabled";case"connector.grant.changed":return"grant_changed";case"connector.activation.changed":return"activation_changed";default:return null}}function nv(e){const t=p.useRef(e);p.useEffect(()=>{t.current=e},[e]),p.useEffect(()=>{const n=`${jo()}/connectors/events`;let r=null,i=1e3,l=null,a=!1;const o=()=>{a||(r=new EventSource(n),r.onopen=()=>{i=1e3},r.onmessage=c=>{try{const u=JSON.parse(c.data),d=HT(u.type);if(d===null){Kh.debug("connectors-sse: ignoring event",u.type);return}const f=u.payload??{},h=f.connector_id??f.provider??null;t.current({connectorId:h,reason:d,payload:f})}catch(u){Kh.warn("connectors-sse: malformed event",u)}},r.onerror=()=>{r==null||r.close(),r=null,!a&&(l=setTimeout(o,i),i=Math.min(i*2,3e4))})};return o(),()=>{a=!0,l&&clearTimeout(l),r==null||r.close()}},[])}function VT(e){return e.type==="mcp_server"&&e.configured}function WT({connector:e,onChanged:t}){const[n,r]=p.useState(!1),[i,l]=p.useState(!1),[a,o]=p.useState(null),[c,u]=p.useState(null),d=p.useRef(null),f=p.useRef(null);if(p.useEffect(()=>{if(!n)return;const k=v=>{const y=v.target;d.current&&!d.current.contains(y)&&f.current&&!f.current.contains(y)&&r(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[n]),p.useEffect(()=>{if(!n)return;const k=v=>{v.key==="Escape"&&r(!1)};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[n]),p.useEffect(()=>{if(!n)return;const k=()=>{if(!d.current)return;const v=d.current.getBoundingClientRect();u({top:v.bottom+4,right:window.innerWidth-v.right})};return window.addEventListener("resize",k),window.addEventListener("scroll",k,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,!0)}},[n]),!VT(e))return null;const h=k=>{k.stopPropagation(),k.preventDefault()},m=k=>{if(h(k),!n&&d.current){const v=d.current.getBoundingClientRect();u({top:v.bottom+4,right:window.innerWidth-v.right})}r(v=>!v)},g=async k=>{l(!0),o(null);try{await k(),r(!1),t()}catch(v){o(v instanceof Error?v.message:String(v))}finally{l(!1)}};return s.jsxs("div",{className:"connector-tile-menu",onClick:h,onKeyDown:h,children:[s.jsx("button",{ref:d,type:"button",className:"connector-tile-menu-trigger","aria-haspopup":"menu","aria-expanded":n,"aria-label":"Connector actions",onClick:m,disabled:i,children:s.jsx(hw,{size:14})}),n&&c&&s.jsxs("div",{ref:f,role:"menu",className:"connector-tile-menu-popup",style:{position:"fixed",top:c.top,right:c.right},children:[e.enabled?s.jsx("button",{role:"menuitem",type:"button",className:"connector-tile-menu-item",onClick:()=>void g(()=>Iy(e.id)),disabled:i,children:"Disable"}):s.jsx("button",{role:"menuitem",type:"button",className:"connector-tile-menu-item",onClick:()=>void g(()=>Dy(e.id)),disabled:i,children:"Enable"}),s.jsx("div",{className:"connector-tile-menu-divider"}),s.jsx("button",{role:"menuitem",type:"button",className:"connector-tile-menu-item connector-tile-menu-item--danger",onClick:()=>void g(()=>Td(e.id)),disabled:i,children:"Disconnect"}),a&&s.jsx("div",{className:"connector-tile-menu-error",children:a})]})]})}const GT={"https://www.googleapis.com/auth/gmail.readonly":"Read emails","https://www.googleapis.com/auth/gmail.modify":"Organize emails (archive, label, trash)","https://www.googleapis.com/auth/gmail.send":"Send emails on your behalf","https://www.googleapis.com/auth/gmail.compose":"Compose emails","https://www.googleapis.com/auth/calendar.readonly":"View calendar events","https://www.googleapis.com/auth/calendar.events":"Create & respond to calendar events","https://www.googleapis.com/auth/drive.readonly":"Read Google Drive files","https://www.googleapis.com/auth/drive.file":"Manage Drive files created by this app","https://www.googleapis.com/auth/spreadsheets.readonly":"Read Google Sheets","https://www.googleapis.com/auth/spreadsheets":"Edit Google Sheets",openid:"Identify you",email:"See your email address",profile:"See your basic profile info"};function qT(e){return GT[e]??e.split(/[/.:]/).pop()??e}const QT=["use"];function KT(){const[e,t]=p.useState([]),[n,r]=p.useState([]),[i,l]=p.useState(!0),[a,o]=p.useState(null),[c,u]=p.useState(null),d=p.useCallback(async()=>{try{const[{connectors:m},{agent_mcps:g}]=await Promise.all([f0(),m0()]);t(m),r(g),o(null)}catch(m){o(m instanceof Error?m.message:String(m))}finally{l(!1)}},[]);p.useEffect(()=>{d()},[d]);const f=m=>u(g=>g===m?null:m),h=p.useCallback(async m=>{try{const g=await zy(m);t(k=>k.map(v=>v.id===m?g:v))}catch{d()}},[d]);return nv(p.useCallback(m=>{m.connectorId?h(m.connectorId):d()},[h,d])),s.jsxs("section",{className:"settings-section connectors-section",children:[s.jsx("h4",{children:"Connectors"}),s.jsx("p",{className:"settings-help",children:"Connect external accounts and MCP servers so agents can use them on your behalf. Each agent must be granted scopes individually."}),a&&s.jsxs("div",{className:"error-banner",children:[s.jsx(pt,{size:14}),s.jsx("span",{children:a})]}),i?s.jsx("div",{className:"connectors-loading",children:s.jsx(mt,{size:16,className:"spin"})}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"connectors-list",children:e.map(m=>s.jsx(YT,{connector:m,expanded:c===m.id,onToggle:()=>f(m.id),onChanged:()=>void h(m.id)},m.id))}),n.length>0&&s.jsx(ez,{servers:n,expanded:c,onToggle:f})]})]})}function YT({connector:e,expanded:t,onToggle:n,onChanged:r}){const i=()=>e.configured?e.type==="mcp_server"&&e.enabled===!1?s.jsx("span",{className:"connector-status disabled",children:"Disabled"}):s.jsxs("span",{className:"connector-status ok",children:[s.jsx(Vn,{size:12}),e.account_id??"Configured"]}):s.jsx("span",{className:"connector-status idle",children:"Not configured"});return s.jsxs("div",{className:`connector-tile${t?" connector-tile--open":""}`,children:[s.jsxs("button",{className:"connector-tile-header",onClick:n,"aria-expanded":t,children:[s.jsx("span",{className:"connector-tile-name",children:e.display_name}),s.jsx("span",{className:"connector-tile-type",children:e.type==="oauth_pkce"?"OAuth":"MCP"}),i(),s.jsx(WT,{connector:e,onChanged:r}),s.jsx("span",{className:"connector-tile-chevron",children:t?s.jsx(fy,{size:14}):s.jsx(ui,{size:14})})]}),t&&s.jsxs("div",{className:"connector-detail",children:[e.type==="oauth_pkce"?s.jsx(XT,{connector:e,onChanged:r}):s.jsx(JT,{connector:e,onChanged:r}),e.configured&&s.jsx(nz,{connectorId:e.id,connectorType:e.type})]})]})}function XT({connector:e,onChanged:t}){const[n,r]=p.useState(!1),[i,l]=p.useState(null),[a,o]=p.useState({});p.useEffect(()=>{const g=()=>{t()};return window.addEventListener("focus",g),()=>window.removeEventListener("focus",g)},[t]);const c=g=>{var v;const k=window;(v=k.gaia)!=null&&v.openExternal?k.gaia.openExternal(g):window.open(g,"_blank","noopener")},u=async()=>{var g;r(!0),l(null);try{const k=await Ay(e.id,(g=e.available_scopes)!=null&&g.length?e.available_scopes:e.default_scopes);c(k.authorization_url)}catch(k){l(k instanceof Error?k.message:String(k))}finally{r(!1)}},d=async()=>{r(!0),l(null);try{await Td(e.id),t()}catch(g){l(g instanceof Error?g.message:String(g))}finally{r(!1)}},f=async()=>{var k;const g=(e.oauth_setup_fields??[]).filter(v=>{var y;return v.required!==!1&&!((y=a[v.key])!=null&&y.trim())}).map(v=>v.label);if(g.length){l(`Required: ${g.join(", ")}`);return}r(!0),l(null);try{const v=(k=e.available_scopes)!=null&&k.length?e.available_scopes:e.default_scopes,y=await Ly(e.id,{...a,scopes:v}),w=typeof y.authorization_url=="string"?y.authorization_url:null;w&&c(w),t()}catch(v){l(v instanceof Error?v.message:String(v))}finally{r(!1)}},h=e.oauth_setup_fields??[],m=e.configurable===!1&&!e.configured&&h.length>0;return s.jsxs("div",{className:"configure-body",children:[e.description&&s.jsx("p",{className:"connector-desc",children:e.description}),m&&s.jsxs("div",{className:"oauth-setup-form",children:[s.jsx("p",{className:"connector-desc",children:"First-time setup — provide your OAuth client credentials below. They’re stored encrypted in your OS keyring and reused for future connections."}),h.map(g=>s.jsxs("label",{className:"oauth-setup-field",children:[s.jsx("span",{className:"oauth-setup-label",children:g.label}),s.jsx("input",{type:g.kind==="secret"?"password":"text",className:"oauth-setup-input",placeholder:g.placeholder,value:a[g.key]??"",onChange:k=>o(v=>({...v,[g.key]:k.target.value})),autoComplete:"off",spellCheck:!1}),g.help_md&&s.jsx("span",{className:"oauth-setup-help",children:g.help_md})]},g.key))]}),i&&s.jsxs("div",{className:"configure-error",children:[s.jsx(pt,{size:12})," ",i]}),s.jsxs("div",{className:"configure-actions",children:[e.configured?s.jsx("button",{className:"btn-secondary",disabled:n,onClick:()=>void d(),children:n?s.jsx(mt,{size:12,className:"spin"}):"Disconnect"}):m?s.jsx("button",{className:"btn-primary",disabled:n,onClick:()=>void f(),children:n?s.jsx(mt,{size:12,className:"spin"}):s.jsxs(s.Fragment,{children:[s.jsx(Gi,{size:12})," Save & Connect"]})}):e.configurable===!1?s.jsx("span",{className:"connector-setup-required",title:e.config_error??void 0,children:"Setup required"}):s.jsx("button",{className:"btn-primary",disabled:n,onClick:()=>void u(),children:n?s.jsx(mt,{size:12,className:"spin"}):s.jsxs(s.Fragment,{children:[s.jsx(Gi,{size:12})," Connect"]})}),(e.docs_url||e.product_url)&&s.jsxs("a",{href:e.docs_url||e.product_url||"#",target:"_blank",rel:"noopener noreferrer",className:"connector-product-link",children:["Learn more ",s.jsx(Gi,{size:11})]})]})]})}function JT({connector:e,onChanged:t}){const[n,r]=p.useState(()=>Object.fromEntries(e.mcp_env_keys.map(m=>[m,""]))),[i,l]=p.useState(!1),[a,o]=p.useState(!1),[c,u]=p.useState(null);p.useEffect(()=>{r(Object.fromEntries(e.mcp_env_keys.map(m=>[m,""])))},[e.mcp_env_keys.join(",")]);const d=async()=>{const m=Object.fromEntries(Object.entries(n).filter(([,g])=>g.trim()!==""));if(Object.keys(m).length!==0){l(!0),u(null),o(!1);try{await Ly(e.id,m),o(!0),t(),setTimeout(()=>o(!1),2200)}catch(g){u(g instanceof Error?g.message:String(g))}finally{l(!1)}}},f=async()=>{l(!0),u(null);try{await Td(e.id),r(Object.fromEntries(e.mcp_env_keys.map(m=>[m,""]))),t()}catch(m){u(m instanceof Error?m.message:String(m))}finally{l(!1)}},h=async()=>{l(!0),u(null);try{e.enabled?await Iy(e.id):await Dy(e.id),t()}catch(m){u(m instanceof Error?m.message:String(m))}finally{l(!1)}};return s.jsxs("div",{className:"configure-body",children:[e.description&&s.jsx("p",{className:"connector-desc",children:e.description}),c&&s.jsxs("div",{className:"configure-error",children:[s.jsx(pt,{size:12})," ",c]}),e.configured&&s.jsxs("div",{className:"connector-toggle-row",children:[s.jsx("span",{className:"connector-toggle-label",children:"Active"}),s.jsxs("span",{className:"toggle-switch",children:[s.jsx("input",{type:"checkbox",checked:e.enabled!==!1,onChange:()=>void h(),disabled:i,"aria-label":e.enabled?"Disable this MCP server":"Enable this MCP server"}),s.jsx("span",{className:"toggle-track"})]})]}),e.configured&&e.enabled===!1&&s.jsx("p",{className:"connector-toggle-help",children:"Credentials and per-agent grants are preserved. Re-enable to make this server's tools available again."}),e.mcp_env_keys.map(m=>s.jsxs("div",{className:"mcp-key-row",children:[s.jsx("label",{className:"mcp-key-label",children:m}),s.jsx("input",{type:"password",className:"mcp-key-input",placeholder:e.configured?"••••••••":"Enter value",value:n[m]??"",onChange:g=>r(k=>({...k,[m]:g.target.value})),spellCheck:!1,autoComplete:"off"})]},m)),s.jsxs("div",{className:"configure-actions",children:[s.jsx("button",{className:`btn-model-save${a?" saved":""}`,disabled:i||Object.values(n).every(m=>m.trim()===""),onClick:()=>void d(),children:i?s.jsx(mt,{size:12,className:"spin"}):a?s.jsxs(s.Fragment,{children:[s.jsx(Vn,{size:12})," Saved"]}):"Save"}),e.configured&&s.jsx("button",{className:"btn-secondary",disabled:i,onClick:()=>void f(),children:"Disconnect"}),e.product_url&&s.jsxs("a",{href:e.product_url,target:"_blank",rel:"noopener noreferrer",className:"connector-product-link",children:["Docs ",s.jsx(Gi,{size:11})]})]})]})}function ZT({agent:e,connectorId:t,grantedScopes:n,onChanged:r}){var m;const i=(m=e.required_connections)==null?void 0:m.find(g=>g.connector_id===t),l=e.namespaced_agent_id;if(!i||!l)return null;const[a,o]=p.useState(()=>new Set(n)),[c,u]=p.useState(null),[d,f]=p.useState(null);p.useEffect(()=>{o(new Set(n))},[n.join(",")]);const h=async g=>{if(c!==null)return;const k=new Set(a);k.has(g)?k.delete(g):k.add(g),o(k),u(g),f(null);try{k.size===0?await g0(t,l):await p0(t,l,[...k]),r()}catch(v){o(new Set(n)),f(v instanceof Error?v.message:String(v))}finally{u(null)}};return s.jsxs("div",{className:"grant-agent-card",children:[s.jsx("div",{className:"grant-agent-card-name",children:e.name}),s.jsx("div",{className:"grant-scope-list",children:i.scopes.map(g=>s.jsxs("label",{className:"grant-scope-item",children:[s.jsx("span",{className:"grant-scope-label",children:qT(g)}),s.jsxs("span",{className:"toggle-switch",children:[s.jsx("input",{type:"checkbox",checked:a.has(g),onChange:()=>void h(g),disabled:c!==null}),s.jsx("span",{className:"toggle-track"})]})]},g))}),d&&s.jsxs("div",{className:"grant-scope-warning grant-scope-warning--error",children:[s.jsx(pt,{size:11})," ",d]})]})}function ez({servers:e,expanded:t,onToggle:n}){return s.jsxs("div",{className:"agent-mcps-section",children:[s.jsx("div",{className:"agent-mcps-section-header",children:"Custom agent servers"}),s.jsx("div",{className:"connectors-list",children:e.map(r=>{const i=`${r.agent_id}::${r.server_name}`;return s.jsx(tz,{server:r,expanded:t===i,onToggle:()=>n(i)},i)})})]})}function tz({server:e,expanded:t,onToggle:n}){const r=[e.command,...e.args].join(" ");return s.jsxs("div",{className:`agent-mcp-tile${t?" agent-mcp-tile--open":""}`,children:[s.jsxs("button",{type:"button",className:"agent-mcp-tile-header",onClick:n,"aria-expanded":t,children:[s.jsx("span",{className:"agent-mcp-server-name",children:e.server_name}),s.jsxs("span",{className:"agent-mcp-agent-label",children:["via ",e.agent_name]}),e.disabled?s.jsx("span",{className:"agent-mcp-status disabled",children:"Disabled"}):s.jsxs("span",{className:"agent-mcp-status enabled",children:[s.jsx(Vn,{size:11})," Active"]}),s.jsx("span",{className:"agent-mcp-readonly-badge",children:"read-only"}),s.jsx("span",{className:"agent-mcp-chevron",children:t?s.jsx(fy,{size:14}):s.jsx(ui,{size:14})})]}),t&&s.jsxs("div",{className:"agent-mcp-detail",children:[r&&s.jsx("div",{className:"agent-mcp-command-row",children:r}),s.jsx("div",{className:"agent-mcp-config-path",children:e.config_path}),s.jsxs("div",{className:"agent-mcp-config-hint",children:["Edit the agent's ",s.jsx("code",{children:"mcp_servers.json"})," to change this server."]})]})]})}function nz({connectorId:e,connectorType:t}){const{agents:n}=ve(),[r,i]=p.useState({}),[l,a]=p.useState({}),[o,c]=p.useState(!0),u=p.useCallback(async()=>{try{const[{grants:h},{activations:m}]=await Promise.all([h0(e),y0(e)]);i(h),a(m)}catch{i({}),a({})}finally{c(!1)}},[e]);if(p.useEffect(()=>{u()},[u]),nv(p.useCallback(h=>{h.connectorId===e&&(h.reason==="grant_changed"||h.reason==="activation_changed"||h.reason==="disconnected")&&u()},[e,u])),o)return null;const d=n.filter(h=>{var m;return h.namespaced_agent_id&&((m=h.required_connections)==null?void 0:m.some(g=>g.connector_id===e))}),f=t==="mcp_server"?n.filter(h=>{var m;return h.namespaced_agent_id&&(h.consumes_mcp_servers||((m=h.required_connections)==null?void 0:m.some(g=>g.connector_id===e)))}):[];return s.jsxs("div",{className:"connection-grants",children:[s.jsx("div",{className:"grants-header",children:"Per-agent grants"}),d.length===0?s.jsx("div",{className:"grants-empty",children:"No agents require access to this connector."}):d.map(h=>s.jsx(ZT,{agent:h,connectorId:e,grantedScopes:r[h.namespaced_agent_id]??[],onChanged:()=>void u()},h.namespaced_agent_id)),f.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grants-header grants-header--activations",children:"Active for"}),s.jsx("div",{className:"grants-help",children:"Activations gate which agents see this connector's tools. Activating without a prior grant auto-creates one."}),f.map(h=>s.jsx(rz,{agent:h,connectorId:e,active:!!l[h.namespaced_agent_id],grantedScopes:r[h.namespaced_agent_id]??[],onChanged:()=>void u()},`activation-${h.namespaced_agent_id}`))]})]})}function rz({agent:e,connectorId:t,active:n,grantedScopes:r,onChanged:i}){var g;const l=(g=e.required_connections)==null?void 0:g.find(k=>k.connector_id===t),a=e.namespaced_agent_id;if(!a)return null;const[o,c]=p.useState(n),[u,d]=p.useState(!1),[f,h]=p.useState(null);p.useEffect(()=>{c(n)},[n]);const m=async()=>{if(u)return;const k=!o;c(k),d(!0),h(null);try{if(k){const v=r.length===0?l?[...l.scopes]:[...QT]:void 0;await x0(t,a,v)}else await v0(t,a);i()}catch(v){c(n),h(v instanceof Error?v.message:String(v))}finally{d(!1)}};return s.jsxs("div",{className:"grant-agent-card",children:[s.jsx("div",{className:"grant-agent-card-name",children:e.name}),s.jsx("div",{className:"grant-scope-list",children:s.jsxs("label",{className:"grant-scope-item",children:[s.jsx("span",{className:"grant-scope-label",children:o?"Tools visible to this agent":"Tools hidden from this agent"}),s.jsxs("span",{className:"toggle-switch",children:[s.jsx("input",{type:"checkbox",checked:o,onChange:()=>void m(),disabled:u}),s.jsx("span",{className:"toggle-track"})]})]})}),f&&s.jsxs("div",{className:"grant-scope-warning grant-scope-warning--error",children:[s.jsx(pt,{size:11})," ",f]})]})}function iz(){const{setShowSettings:e,sessions:t,removeSession:n,agents:r}=ve(),[i,l]=p.useState(null),[a,o]=p.useState(!0),[c,u]=p.useState([]),[d,f]=p.useState(""),[h,m]=p.useState(""),[g,k]=p.useState(!1),[v,y]=p.useState(!1),[w,j]=p.useState(null),[z,D]=p.useState(!1),C=p.useRef(null);p.useEffect(()=>{E.system.info("Checking system status...");const M=E.system.time();_d().then(R=>{l(R),E.system.timed("System status received",M,{lemonade:R.lemonade_running?"running":"stopped",model:R.model_loaded||"none",embedding:R.embedding_model_loaded?"yes":"no",disk:`${R.disk_space_gb}GB free`,memory:R.memory_available_gb!=null?`${R.memory_available_gb}GB available`:"unknown"}),R.lemonade_running||E.system.warn("Lemonade Server is NOT running.")}).catch(R=>{E.system.error("Failed to get system status",R),l(null)}).finally(()=>o(!1)),$0().then(R=>u(R.servers)).catch(()=>{}),a0().then(R=>{const B=R.custom_model??"";f(B),m(B)}).catch(R=>{E.system.error("Failed to load settings",R)}).finally(()=>k(!0))},[]),p.useEffect(()=>()=>{C.current&&clearTimeout(C.current)},[]);const A=p.useCallback(async()=>{const M=d.trim(),R=M.length>0?M:"";y(!0),j(null),D(!1);try{E.system.info("Saving custom_model override",{custom_model:R});const pe=(await o0({custom_model:R})).custom_model??"";f(pe),m(pe),D(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>D(!1),2200)}catch(B){const pe=B instanceof Error?B.message:String(B);E.system.error("Failed to save custom_model",B),j(pe)}finally{y(!1)}},[d]),_=d.trim()!==h.trim(),I=(i==null?void 0:i.default_model_name)??Xd,{isLoadingModel:N,isDownloadingModel:U,loadModel:O,downloadModel:re}=tv(I),oe=[{label:"4K",value:4096},{label:"8K",value:8192},{label:"16K",value:16384},{label:"32K",value:32768}],te=(i==null?void 0:i.model_context_size)??null,[le,fe]=p.useState("");p.useEffect(()=>{te!=null&&fe(String(te))},[te]);const T=(()=>{const M=parseInt(le,10);return Number.isFinite(M)&&M>0?M:null})(),P=T!=null&&T!==te,b=(i==null?void 0:i.model_loaded)??I,X=p.useCallback(async()=>{T&&(E.system.info(`Reloading ${b} with ctx_size=${T}`),await O(b,T))},[T,b,O]),[H,S]=p.useState(!1),ie=p.useRef(null);p.useEffect(()=>()=>{ie.current&&clearTimeout(ie.current)},[]);const ye=p.useCallback(async()=>{if(!H){S(!0),ie.current&&clearTimeout(ie.current),ie.current=setTimeout(()=>S(!1),4e3);return}S(!1),ie.current&&clearTimeout(ie.current),E.system.warn(`Clearing ALL data: ${t.length} session(s)`);const M=E.system.time();let R=0;for(const B of t)try{await Py(B.id),n(B.id),R++}catch(pe){E.system.error(`Failed to delete session ${B.id}`,pe)}E.system.timed(`Cleared ${R}/${t.length} session(s)`,M),e(!1)},[H,t,n,e]),ae="0.20.0",je=!!(i!=null&&i.lemonade_running&&i.model_loaded&&i.expected_model_loaded===!1),Ge=!!(i!=null&&i.lemonade_running&&i.model_loaded&&i.context_size_sufficient===!1),qe=!!(i!=null&&i.lemonade_running&&!i.model_loaded&&i.model_downloaded===!1),Xe=je||Ge;return s.jsxs("div",{className:"settings-page",children:[s.jsxs("div",{className:"settings-page-header",children:[s.jsx("button",{className:"btn-icon settings-back-btn",onClick:()=>e(!1),"aria-label":"Back",children:s.jsx(uy,{size:18})}),s.jsx("h3",{children:"Settings"})]}),s.jsxs("div",{className:"settings-page-body",children:[s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"System Status"}),a?s.jsx("p",{className:"loading-text",children:"Checking system..."}):i?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"status-grid",children:[s.jsx(Nn,{label:"Lemonade Server",value:i.lemonade_running?`Running${i.lemonade_version?` v${i.lemonade_version}`:""}`:"Not Running",ok:i.lemonade_running,hint:i.lemonade_running?void 0:i.initialized?"Run: lemonade-server serve":"Run: gaia init --profile chat"}),s.jsx(Nn,{label:"Model",value:i.model_loaded||"None loaded",ok:!!i.model_loaded&&i.expected_model_loaded!==!1,hint:i.model_loaded?i.expected_model_loaded===!1?`Expected: ${I}`:void 0:"Run: gaia init --profile chat"}),i.model_size_gb!=null&&s.jsx(Nn,{label:"Model Size",value:`${i.model_size_gb} GB`,ok:!0}),i.model_device&&s.jsx(Nn,{label:"Device",value:i.model_device.toUpperCase(),ok:i.model_device!=="cpu"}),i.model_context_size!=null&&s.jsx(Nn,{label:"Context Window",value:`${(i.model_context_size/1024).toFixed(0)}K tokens`,ok:i.context_size_sufficient}),i.model_labels&&i.model_labels.length>0&&s.jsx(Nn,{label:"Capabilities",value:i.model_labels.join(", "),ok:!0}),s.jsx(Nn,{label:"Embedding Model",value:i.embedding_model_loaded?"Available":"Not loaded",ok:i.embedding_model_loaded}),i.gpu_name&&s.jsx(Nn,{label:"GPU",value:`${i.gpu_name}${i.gpu_vram_gb?` (${i.gpu_vram_gb} GB)`:""}`,ok:!0}),s.jsx(Nn,{label:"Disk Space",value:`${i.disk_space_gb} GB free`,ok:i.disk_space_gb>5,hint:!i.model_loaded&&i.disk_space_gb<30?`Models require ~25 GB — only ${i.disk_space_gb} GB available`:void 0}),s.jsx(Nn,{label:"Memory",value:i.memory_available_gb!=null?`${i.memory_available_gb} GB available`:"unknown",ok:i.memory_available_gb!=null&&i.memory_available_gb>2}),i.processor_name&&s.jsx(Nn,{label:"Processor",value:i.processor_name,ok:i.device_supported!==!1})]}),qe&&s.jsxs("div",{className:"model-action-row model-action-row--download",children:[s.jsxs("div",{className:"model-action-info",children:[s.jsx("span",{className:"model-action-label",children:"Model not downloaded."}),s.jsxs("span",{className:"model-action-desc",children:[s.jsx("strong",{children:I})," is required for GAIA Chat (~25 GB)."]})]}),s.jsx("button",{className:"btn-model-action btn-model-action--download",onClick:()=>re(!1),disabled:U,children:U?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"btn-spinner"})," Downloading…"]}):"Download"})]}),Xe&&s.jsxs("div",{className:"model-action-row model-action-row--load",children:[s.jsxs("div",{className:"model-action-info",children:[s.jsx("span",{className:"model-action-label",children:je?"Wrong model loaded.":"Context window too small."}),s.jsxs("span",{className:"model-action-desc",children:["Load ",s.jsx("strong",{children:I})," with ",(Js/1024).toFixed(0),"K token context."]})]}),s.jsx("button",{className:"btn-model-action btn-model-action--load",onClick:()=>O(),disabled:N,children:N?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"btn-spinner"})," Loading…"]}):"Load Model"})]}),i.lemonade_running&&s.jsxs("div",{className:"force-redownload-row",children:[s.jsx("span",{className:"force-redownload-label",children:"If the model file is corrupted:"}),s.jsx("button",{className:"btn-force-redownload",onClick:()=>re(!0),disabled:U,children:U?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:12,className:"btn-spinner"})," Downloading…"]}):"Force Re-download"})]})]}):s.jsxs("div",{className:"status-error",children:[s.jsx("p",{children:"Could not connect to server"}),s.jsx("code",{children:"gaia chat --ui"})]})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"Active Model"}),s.jsx("p",{className:"model-override-desc",children:"Override the model used by the active agent. Leave empty to use the current agent’s preferred model."}),s.jsxs("div",{className:"model-input-row",children:[s.jsx("input",{type:"text",className:`model-input${h?" has-override":""}`,placeholder:"Use agent default",value:d,onChange:M=>{f(M.target.value),j(null),D(!1)},onKeyDown:M=>{M.key==="Enter"&&!v&&_&&g&&(M.preventDefault(),A())},disabled:!g||v,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","aria-label":"Custom model override"}),s.jsx("div",{className:"model-btn-group",children:s.jsx("button",{className:`btn-model-save${z?" saved":""}`,onClick:()=>{A()},disabled:!g||v||!_&&!z,"aria-label":"Save custom model",children:v?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"btn-spinner"})," Saving…"]}):z?s.jsxs(s.Fragment,{children:[s.jsx(Vn,{size:13})," Saved"]}):"Save"})})]}),s.jsxs("p",{className:"model-status-hint",children:["Accepts a Lemonade model ID (e.g. ",s.jsx("code",{children:"Qwen3-4B-Instruct-2507-GGUF"}),")"," ","or a HuggingFace ID (e.g. ",s.jsx("code",{children:"unsloth/Qwen3-4B-GGUF"}),")."]}),w&&s.jsxs("div",{className:"model-warning",role:"alert",children:[s.jsx(pt,{size:14}),s.jsxs("div",{className:"model-warning-content",children:[s.jsx("strong",{children:"Could not save"}),s.jsx("p",{children:w})]})]})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"Context Size"}),s.jsx("p",{className:"model-override-desc",children:"Reload the active model with a different context window. Larger contexts use more memory and slow inference; going past the model’s training length may degrade quality."}),s.jsx("div",{className:"ctx-preset-row",children:oe.map(M=>{const R=T===M.value;return s.jsx("button",{className:`btn-ctx-preset${R?" active":""}`,onClick:()=>fe(String(M.value)),disabled:N,type:"button",children:M.label},M.value)})}),s.jsxs("div",{className:"model-input-row",children:[s.jsx("input",{type:"number",className:"model-input",placeholder:te!=null?String(te):"4096",value:le,min:512,step:1024,onChange:M=>fe(M.target.value),disabled:N,"aria-label":"Context size in tokens"}),s.jsx("div",{className:"model-btn-group",children:s.jsx("button",{className:"btn-model-save",onClick:()=>{X()},disabled:N||!P||!(i!=null&&i.lemonade_running),"aria-label":"Reload model with new context size",children:N?s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"btn-spinner"})," Reloading…"]}):"Apply"})})]}),s.jsxs("p",{className:"model-status-hint",children:["Current: ",s.jsx("code",{children:te!=null?`${te.toLocaleString()} tokens`:"unknown"}),(i==null?void 0:i.model_loaded)&&s.jsxs(s.Fragment,{children:[" on ",s.jsx("code",{children:i.model_loaded})]}),"."]})]}),i&&i.memory_available_gb!=null&&(()=>{const M=i.memory_available_gb,R=r.filter(B=>B.min_memory_gb!=null&&B.min_memory_gb>M);return R.length===0?null:s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"Memory Warnings"}),s.jsx("div",{className:"status-grid",children:R.map(B=>s.jsxs("div",{className:"status-row status-row--has-hint",children:[s.jsx("span",{className:"status-label",children:B.name}),s.jsxs("div",{className:"status-value-wrap",children:[s.jsxs("span",{className:"status-value warn memory-warning-value",children:[s.jsx(pt,{size:12}),"Needs ~",B.min_memory_gb," GB free"]}),s.jsxs("span",{className:"status-hint",children:["Only ",i.memory_available_gb," GB available — model load may fail or swap heavily."]})]})]},B.id))})]})})(),c.length>0&&s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"MCP Servers"}),s.jsx("div",{className:"status-grid",children:c.map(M=>s.jsxs("div",{className:"status-row",children:[s.jsx("span",{className:"status-label",children:M.name}),s.jsx("div",{className:"status-value-wrap",children:M.connected?s.jsxs("span",{className:"status-value ok mcp-status-connected",children:[s.jsx(Vn,{size:12}),M.tool_count," tool",M.tool_count!==1?"s":""]}):s.jsxs("span",{className:"status-value warn mcp-status-failed",title:M.error??void 0,children:[s.jsx(pt,{size:12}),"Failed"]})})]},M.name))})]}),s.jsx(UT,{}),s.jsx(KT,{}),s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"About"}),s.jsxs("div",{className:"about-info",children:[s.jsxs("p",{children:["GAIA v",ae," ",s.jsx("span",{className:"beta-badge",children:"BETA"})]}),s.jsx("p",{className:"about-sub",children:"Privacy-first AI chat for AMD Ryzen AI PCs."})]})]}),s.jsxs("section",{className:"settings-section",children:[s.jsx("h4",{children:"Privacy & Data"}),s.jsxs("div",{className:"setting-row",children:[s.jsx("span",{children:"Data location"}),s.jsx("code",{className:"setting-path",children:"~/.gaia/chat/"})]}),s.jsx("div",{className:"danger-divider"}),s.jsxs("div",{className:"setting-actions",children:[s.jsx("p",{className:"danger-warning",children:"This will permanently delete all sessions, messages, and documents."}),s.jsx("button",{className:"btn-danger",onClick:ye,children:H?"Click again to confirm":"Clear All Data"})]})]})]})]})}function Nn({label:e,value:t,ok:n,hint:r}){return s.jsxs("div",{className:`status-row${r?" status-row--has-hint":""}`,children:[s.jsx("span",{className:"status-label",children:e}),s.jsxs("div",{className:"status-value-wrap",children:[s.jsx("span",{className:`status-value ${n?"ok":"warn"}`,children:t}),r&&s.jsx("span",{className:"status-hint",children:s.jsx("code",{children:r})})]})]})}const sz="modulepreload",lz=function(e,t){return new URL(e,t).href},Yh={},az=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){const a=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),c=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=lz(u,r),u in Yh)return;Yh[u]=!0;const d=u.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(!!r)for(let g=a.length-1;g>=0;g--){const k=a[g];if(k.href===u&&(!d||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${f}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":sz,d||(m.as="script"),m.crossOrigin="",m.href=u,c&&m.setAttribute("nonce",c),document.head.appendChild(m),d)return new Promise((g,k)=>{m.addEventListener("load",g),m.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${u}`)))})}))}function l(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&l(o.reason);return t().catch(l)})};let wc=null;function oz({isOpen:e,onClose:t,onStop:n,error:r}){const[i,l]=p.useState(null),[a,o]=p.useState(!1),c=p.useRef(null),u=p.useCallback(async()=>{try{const m=await Oy();return l(m),m}catch(m){return E.system.error("Failed to fetch tunnel status",m),null}},[]);p.useEffect(()=>{if(!e||r)return;u();const m=setInterval(async()=>{const g=await u();g!=null&&g.active&&(g!=null&&g.url)&&clearInterval(m)},2e3);return()=>clearInterval(m)},[e,r,u]),p.useEffect(()=>{if(!(i!=null&&i.active)||!i.url||!i.token||!c.current)return;const m=`${i.url}/?token=${i.token}`;E.system.info(`Generating QR code for: ${m}`),(async()=>{if(!wc)try{const v=await az(()=>import("./browser-CTB2jwNe.js").then(y=>y.b),[],import.meta.url);wc=v.default||v}catch{E.system.error("QR code library not available - install with: npm install qrcode");return}const k=document.documentElement.getAttribute("data-theme")==="dark";try{await wc.toCanvas(c.current,m,{width:200,margin:2,color:{dark:k?"#e6edf3":"#111827",light:k?"#0d0d0d":"#ffffff"}})}catch(v){E.system.error("QR code generation failed",v)}})()},[i==null?void 0:i.active,i==null?void 0:i.url,i==null?void 0:i.token]);const d=p.useRef(null),f=p.useCallback(()=>{if(!(i!=null&&i.url)||!(i!=null&&i.token))return;const m=`${i.url}/?token=${i.token}`;navigator.clipboard.writeText(m).then(()=>{o(!0),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>o(!1),2e3)})},[i]);if(p.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]),!e)return null;const h=i!=null&&i.active&&(i!=null&&i.url)&&(i!=null&&i.token)?`${i.url}/?token=${i.token}`:"";return s.jsx("div",{className:"modal-overlay",onClick:t,role:"dialog","aria-modal":"true","aria-label":"Mobile Access",children:s.jsxs("div",{className:"modal-panel mobile-modal",onClick:m=>m.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsxs("h3",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[s.jsx(wy,{size:18}),"Mobile Access"]}),s.jsx("button",{className:"btn-icon",onClick:t,"aria-label":"Close",children:s.jsx(Ze,{size:18})})]}),s.jsxs("div",{className:"modal-body mobile-modal-body",children:[s.jsxs("div",{className:"tunnel-status",children:[s.jsx("span",{className:`status-dot ${i!=null&&i.active?"active":r?"error":"starting"}`}),s.jsx("span",{children:i!=null&&i.active?"Tunnel active":r?"Connection failed":"Starting tunnel..."}),!(i!=null&&i.active)&&!r&&s.jsx("span",{className:"tunnel-spinner"})]}),r&&s.jsx("div",{className:"tunnel-error",children:r}),s.jsx("div",{className:"qr-code-area",children:i!=null&&i.active?s.jsx("canvas",{ref:c}):r?s.jsx("div",{className:"qr-placeholder error",children:"Failed to connect"}):s.jsxs("div",{className:"qr-placeholder",children:[s.jsx("div",{className:"placeholder-spinner"}),s.jsx("span",{children:"Connecting..."})]})}),(i==null?void 0:i.active)&&h&&s.jsxs("div",{className:"tunnel-url-area",children:[s.jsx("label",{children:"Mobile URL"}),s.jsxs("div",{className:"tunnel-url-row",children:[s.jsx("input",{type:"text",readOnly:!0,value:h}),s.jsxs("button",{className:`copy-url-btn ${a?"copied":""}`,onClick:f,title:"Copy URL",children:[a?s.jsx(ci,{size:13}):s.jsx(Nl,{size:13}),a?"Copied":"Copy"]})]})]}),(i==null?void 0:i.active)&&(i==null?void 0:i.publicIp)&&(i==null?void 0:i.url)&&!i.url.includes("ngrok-free.app")&&s.jsxs("div",{className:"tunnel-password-hint",children:[s.jsx("label",{children:"Tunnel Password"}),s.jsx("div",{className:"tunnel-password-value",children:i.publicIp}),s.jsx("span",{className:"tunnel-password-note",children:"Enter this when the tunnel page asks for a password"})]}),s.jsx("div",{className:"mobile-instructions",children:s.jsxs("ol",{children:[s.jsx("li",{children:"Scan the QR code with your phone's camera"}),(i==null?void 0:i.url)&&!i.url.includes("ngrok-free.app")&&s.jsx("li",{children:"Enter the tunnel password shown above when prompted"}),s.jsx("li",{children:"Chat with GAIA from your mobile device"}),s.jsx("li",{children:"Your data stays secure via encrypted tunnel"})]})}),s.jsxs("div",{className:"mobile-access-actions",children:[(i==null?void 0:i.active)&&n&&s.jsx("button",{className:"btn-danger",onClick:n,title:"Close the tunnel and revoke the mobile URL",children:"Stop Tunnel"}),s.jsx("button",{className:"btn-secondary",onClick:t,children:"Close"})]})]})]})})}function cz({onRetry:e}){var j;const{backendConnected:t,systemStatus:n,currentSessionId:r,messages:i}=ve(),[l,a]=p.useState(!1),o=!!r&&i.length>0,c=(n==null?void 0:n.default_model_name)??Xd,{isLoadingModel:u,isDownloadingModel:d,loadModel:f,downloadModel:h}=tv(c),m=p.useRef(n==null?void 0:n.lemonade_running),g=p.useRef(n==null?void 0:n.model_downloaded),k=p.useRef(n==null?void 0:n.context_size_sufficient),v=p.useRef(n==null?void 0:n.expected_model_loaded);p.useEffect(()=>{if(o)return;const z=n==null?void 0:n.lemonade_running,D=n==null?void 0:n.model_downloaded,C=n==null?void 0:n.context_size_sufficient,A=n==null?void 0:n.expected_model_loaded;let _=!1;m.current!==z&&(m.current=z,z===!1&&(_=!0)),g.current!==D&&(g.current=D,D===!1&&(_=!0)),k.current!==C&&(k.current=C,C===!1&&(_=!0)),v.current!==A&&(v.current=A,A===!1&&(_=!0)),_&&a(!1)},[n,o]);const y=(n==null?void 0:n.download_progress)??null;if(d||(y==null?void 0:y.state)==="downloading"||(y==null?void 0:y.state)==="starting"||(y==null?void 0:y.state)==="error"){const z=n!=null&&n.default_model_size_gb?`~${n.default_model_size_gb.toFixed(1)} GB`:"large download",D=(y==null?void 0:y.state)==="error";return s.jsxs("div",{className:`connection-banner ${D?"connection-banner--error":"connection-banner--warning"}`,role:D?"alert":"status",children:[s.jsx("div",{className:"connection-banner__icon",children:D?s.jsx(ln,{size:16}):s.jsx(di,{size:16})}),s.jsx("div",{className:"connection-banner__text",children:D?s.jsxs(s.Fragment,{children:["Download of ",s.jsx("strong",{children:c})," failed."," ",(y==null?void 0:y.message)&&s.jsx("span",{className:"connection-banner__hint",children:y.message})]}):s.jsxs(s.Fragment,{children:["Downloading ",s.jsx("strong",{children:c})," (",z,").",(y==null?void 0:y.state)==="downloading"&&y.file&&s.jsxs(s.Fragment,{children:[" ",s.jsxs("span",{className:"connection-banner__hint",children:["File ",y.file_index," / ",y.total_files,": ",s.jsx("code",{children:y.file})]})]})]})}),D?s.jsx("button",{className:"connection-banner__retry",onClick:()=>h(!1),children:"Retry"}):s.jsx("span",{className:"connection-banner__loading connection-banner__progress",children:y&&y.state==="downloading"&&y.total_bytes>0?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"connection-banner__progress-bar",role:"progressbar","aria-valuenow":y.percent,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Download progress",children:s.jsx("span",{className:"connection-banner__progress-fill",style:{width:`${y.percent}%`}})}),s.jsxs("span",{className:"connection-banner__progress-label",children:[y.percent,"% ·"," ",(y.downloaded_bytes/1e9).toFixed(2)," /"," ",(y.total_bytes/1e9).toFixed(2)," GB"]})]}):s.jsxs(s.Fragment,{children:[s.jsx(mt,{size:13,className:"connection-banner__spinner"}),(y==null?void 0:y.state)==="starting"?"Starting download…":"Downloading…"]})}),D&&s.jsx("button",{className:"connection-banner__dismiss",onClick:()=>a(!0),"aria-label":"Dismiss",children:s.jsx(Ze,{size:14})})]})}if((n==null?void 0:n.init_state)==="initializing"){const z=(j=n.init_tasks)==null?void 0:j.find(C=>C.status==="running"),D=(z==null?void 0:z.name)||"Preparing AI system";return s.jsxs("div",{className:"connection-banner connection-banner--init",role:"status",children:[s.jsx("div",{className:"connection-banner__icon",children:s.jsx(mt,{size:16,className:"connection-banner__spinner"})}),s.jsxs("div",{className:"connection-banner__text",children:[D,s.jsxs("span",{className:"thinking-dots",children:[s.jsx("span",{children:"."}),s.jsx("span",{children:"."}),s.jsx("span",{children:"."})]})]})]})}if(l||o)return null;if(!t)return s.jsxs("div",{className:"connection-banner connection-banner--error",role:"alert",children:[s.jsx("div",{className:"connection-banner__icon",children:s.jsx(Tw,{size:16})}),s.jsxs("div",{className:"connection-banner__text",children:["Cannot connect to GAIA server."," ",s.jsxs("span",{className:"connection-banner__hint",children:["Start it with: ",s.jsx("code",{children:"gaia chat --ui"})]})]}),e&&s.jsx("button",{className:"connection-banner__retry",onClick:e,children:"Retry"})]});if(n&&!n.lemonade_running)return s.jsxs("div",{className:"connection-banner connection-banner--warning",role:"status",children:[s.jsx("div",{className:"connection-banner__icon",children:s.jsx(ln,{size:16})}),s.jsxs("div",{className:"connection-banner__text",children:["LLM server is not responding — it may be busy or not running."," ",s.jsxs("span",{className:"connection-banner__hint",children:["If not started, run: ",s.jsx("code",{children:"lemonade-server serve"})]})]}),e&&s.jsx("button",{className:"connection-banner__retry",onClick:e,children:"Check again"}),s.jsx("button",{className:"connection-banner__dismiss",onClick:()=>a(!0),"aria-label":"Dismiss",children:s.jsx(Ze,{size:14})})]});if(n&&n.lemonade_running&&!n.model_loaded&&n.model_downloaded===!1){const z=n.default_model_size_gb?`~${n.default_model_size_gb.toFixed(1)} GB`:"large download";return s.jsxs("div",{className:"connection-banner connection-banner--warning",role:"status",children:[s.jsx("div",{className:"connection-banner__icon",children:s.jsx(di,{size:16})}),s.jsxs("div",{className:"connection-banner__text",children:["Required model ",s.jsx("strong",{children:c})," is not downloaded (",z,")."]}),s.jsx("button",{className:"connection-banner__retry",onClick:()=>h(!1),children:"Download"}),e&&s.jsx("button",{className:"connection-banner__retry connection-banner__retry--secondary",onClick:e,children:"Recheck"}),s.jsx("button",{className:"connection-banner__dismiss",onClick:()=>a(!0),"aria-label":"Dismiss",children:s.jsx(Ze,{size:14})})]})}if(n&&n.lemonade_running&&n.model_loaded&&n.expected_model_loaded===!1&&!n.embedding_model_loaded){const z=n.model_loaded,D=n.context_size_sufficient===!1;return s.jsxs("div",{className:"connection-banner connection-banner--warning",role:"status",children:[s.jsx("div",{className:"connection-banner__icon",children:s.jsx(rs,{size:16})}),s.jsxs("div",{className:"connection-banner__text",children:["Wrong model loaded: ",s.jsx("strong",{children:z}),"."," ","GAIA Chat requires ",s.jsx("strong",{children:c}),".",D&&s.jsxs(s.Fragment,{children:[" ","Context window is also too small."]})]}),u?s.jsxs("span",{className:"connection-banner__loading",children:[s.jsx(mt,{size:13,className:"connection-banner__spinner"}),"Loading…"]}):s.jsx("button",{className:"connection-banner__retry",onClick:()=>f(),children:"Load Now"}),e&&!u&&s.jsx("button",{className:"connection-banner__retry connection-banner__retry--secondary",onClick:e,children:"Recheck"}),s.jsx("button",{className:"connection-banner__dismiss",onClick:()=>a(!0),"aria-label":"Dismiss",children:s.jsx(Ze,{size:14})})]})}if(n&&n.lemonade_running&&n.model_loaded&&n.context_size_sufficient===!1){const z=n.model_context_size??0,D=n.lemonade_url??"http://localhost:13305";return s.jsxs("div",{className:"connection-banner connection-banner--warning",role:"status",children:[s.jsx("div",{className:"connection-banner__icon",children:s.jsx(aw,{size:16})}),s.jsxs("div",{className:"connection-banner__text",children:["LLM context window is too small (",z.toLocaleString()," tokens;"," ",Js.toLocaleString()," required)."," ",s.jsxs("span",{className:"connection-banner__hint",children:["In"," ",s.jsx("a",{className:"connection-banner__link",href:D,target:"_blank",rel:"noreferrer",children:"Lemonade"}),", set ctx‑size to ",Js.toLocaleString(),", or restart with:"," ",s.jsxs("code",{children:["lemonade-server serve --ctx-size ",Js]})]})]}),e&&s.jsx("button",{className:"connection-banner__retry",onClick:e,children:"Check again"}),s.jsx("button",{className:"connection-banner__dismiss",onClick:()=>a(!0),"aria-label":"Dismiss",children:s.jsx(Ze,{size:14})})]})}return null}const uz={status:"idle",version:null,progress:0,releaseNotes:null,error:null};function dz(){const[e,t]=p.useState(uz);return p.useEffect(()=>{const n=window.gaiaUpdater;if(!n)return;let r=!0;n.getStatus().then(l=>{r&&l&&t(l)}).catch(()=>{});const i=n.onStatusChange(l=>{r&&l&&t(l)});return()=>{r=!1;try{i()}catch{}}},[]),e}function fz(){const e=dz(),[t,n]=p.useState(!1),r=p.useCallback(()=>{const i=window.gaiaUpdater;i==null||i.check().catch(()=>{})},[]);if(t||e.status==="idle"||e.status==="checking"||e.status==="disabled")return null;if(e.status==="downloading"){const i=Math.max(0,Math.min(100,e.progress));return s.jsxs("div",{className:"update-chip update-chip--downloading",role:"status","aria-live":"polite",title:`Downloading update${e.version?` ${e.version}`:""}…`,children:[s.jsx(di,{size:13,className:"update-chip__icon"}),s.jsxs("span",{className:"update-chip__label",children:["Downloading update… ",i,"%"]})]})}return e.status==="available"?s.jsxs("div",{className:"update-chip update-chip--available",role:"status",title:e.releaseNotes||"A new version is available.",children:[s.jsx(di,{size:13,className:"update-chip__icon"}),s.jsxs("span",{className:"update-chip__label",children:["Update available",e.version?`: ${e.version}`:""]}),s.jsx("button",{type:"button",className:"update-chip__dismiss",onClick:()=>n(!0),"aria-label":"Dismiss update notification",children:s.jsx(Ze,{size:11})})]}):e.status==="downloaded"?s.jsxs("div",{className:"update-chip update-chip--ready",role:"status","aria-live":"polite",children:[s.jsx(qs,{size:13,className:"update-chip__icon"}),s.jsx("button",{type:"button",className:"update-chip__action",onClick:r,title:"Click to restart and apply the update",children:"Update ready — restart to apply"})]}):e.status==="error"?s.jsxs("div",{className:"update-chip update-chip--error",role:"status",title:e.error||"Update check failed.",children:[s.jsx(ln,{size:13,className:"update-chip__icon"}),s.jsx("span",{className:"update-chip__label",children:"Update check failed"}),s.jsx("button",{type:"button",className:"update-chip__dismiss",onClick:()=>n(!0),"aria-label":"Dismiss update error",children:s.jsx(Ze,{size:11})})]}):null}function mz(){const e=ct(jE),t=ct(n=>n.respondToPermission);return e?s.jsx("div",{className:"permission-overlay",role:"dialog","aria-modal":"true","aria-label":"Permission Request",children:s.jsx(hz,{notification:e,onRespond:t},e.id)}):null}function hz({notification:e,onRespond:t}){const n=e.timeoutSeconds!=null&&e.timeoutSeconds>0,[r,i]=p.useState(n?e.timeoutSeconds:null),l=p.useRef(null),[a,o]=p.useState(!1),[c,u]=p.useState(!1),d=p.useRef(!1),f=p.useRef(t);f.current=t,p.useEffect(()=>{if(n)return l.current=setInterval(()=>{i(v=>v===null||v<=1?(l.current&&clearInterval(l.current),0):v-1)},1e3),()=>{l.current&&clearInterval(l.current)}},[n]),p.useEffect(()=>{if(r===0){if(d.current)return;d.current=!0,o(!0),f.current(e.id,"deny",!1)}},[r,e.id]);const h=p.useCallback(async()=>{if(!d.current){d.current=!0,o(!0),l.current&&clearInterval(l.current);try{await t(e.id,"allow",c)}finally{d.current=!1,o(!1)}}},[e.id,t,c]),m=p.useCallback(async()=>{if(!d.current){d.current=!0,o(!0),l.current&&clearInterval(l.current);try{await t(e.id,"deny",!1)}finally{d.current=!1,o(!1)}}},[e.id,t]);p.useEffect(()=>{const v=y=>{y.key==="Enter"&&!y.shiftKey?(y.preventDefault(),h()):y.key==="Escape"&&(y.preventDefault(),m())};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[h,m]);const g=e.toolArgs,k=g&&Object.keys(g).length>0;return s.jsxs("div",{className:"permission-prompt",children:[s.jsxs("div",{className:"permission-header",children:[s.jsx("div",{className:"permission-header-icon",children:s.jsx(Ka,{size:24})}),s.jsxs("div",{className:"permission-header-text",children:[s.jsx("h2",{className:"permission-title",children:"Permission Request"}),s.jsx("span",{className:"permission-agent",children:e.agentName})]}),r!==null&&r>0&&s.jsxs("div",{className:"permission-countdown",title:"Auto-deny on timeout",children:[s.jsx(Qa,{size:14}),s.jsxs("span",{children:[r,"s"]})]})]}),s.jsxs("div",{className:"permission-body",children:[s.jsx("p",{className:"permission-message",children:e.message}),e.tool&&s.jsxs("div",{className:"permission-tool-info",children:[s.jsxs("div",{className:"permission-tool-header",children:[s.jsx(ln,{size:14}),s.jsx("span",{children:"Tool Invocation"})]}),s.jsx("div",{className:"permission-tool-name",children:s.jsx("code",{children:e.tool})}),k&&s.jsx("div",{className:"permission-tool-args",children:s.jsx("pre",{children:JSON.stringify(g,null,2)})})]}),e.priority==="critical"&&s.jsxs("div",{className:"permission-critical-banner",children:[s.jsx(ln,{size:14}),s.jsx("span",{children:"This is a critical-tier operation"})]}),s.jsxs("label",{className:"permission-remember",children:[s.jsx("input",{type:"checkbox",checked:c,onChange:v=>u(v.target.checked),disabled:a}),s.jsx("span",{children:"Always allow this tool"})]})]}),s.jsxs("div",{className:"permission-actions",children:[s.jsxs("button",{className:"permission-btn permission-btn-deny",onClick:m,disabled:a,title:"Deny (Esc)",children:[s.jsx(Ze,{size:16}),"Deny"]}),s.jsxs("button",{className:"permission-btn permission-btn-allow",onClick:h,disabled:a,title:"Allow (Enter)",children:[s.jsx(ci,{size:16}),"Allow"]})]}),s.jsxs("div",{className:"permission-hints",children:[s.jsxs("span",{children:[s.jsx("kbd",{children:"Enter"})," Allow"]}),s.jsxs("span",{children:[s.jsx("kbd",{children:"Esc"})," Deny"]})]})]})}const pz={permission_request:{icon:s.jsx(Ka,{size:16}),colorClass:"notif-type-permission",label:"Permission"},policy_alert:{icon:s.jsx(Ka,{size:16}),colorClass:"notif-type-policy",label:"Policy"},security_alert:{icon:s.jsx(ln,{size:16}),colorClass:"notif-type-security",label:"Security"},status_change:{icon:s.jsx(ji,{size:16}),colorClass:"notif-type-status",label:"Status"},info:{icon:s.jsx(lw,{size:16}),colorClass:"notif-type-info",label:"Info"},error:{icon:s.jsx(pt,{size:16}),colorClass:"notif-type-error",label:"Error"}};function gz(e){const n=Date.now()-e,r=Math.floor(n/1e3);if(r<60)return"just now";const i=Math.floor(r/60);if(i<60)return`${i}m ago`;const l=Math.floor(i/60);if(l<24)return`${l}h ago`;const a=Math.floor(l/24);return a<7?`${a}d ago`:new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function yz({onClose:e}){const t=ct(bE),n=ct(Qx),r=ct(v=>v.markRead),i=ct(v=>v.markAllRead),l=ct(v=>v.clearAll),a=ct(v=>v.dismiss),o=ct(v=>v.addNotification),c=ct(v=>v.respondToPermission),u=ct(v=>v.typeFilter),d=ct(v=>v.setTypeFilter),f=p.useRef(!1);p.useEffect(()=>{var y;const v=window.gaiaAPI;!((y=v==null?void 0:v.notification)!=null&&y.onNotification)||f.current||(f.current=!0,v.notification.onNotification(w=>{o(w)}))},[o]);const h=p.useCallback(v=>{r(v)},[r]),m=p.useCallback(v=>{c(v.id,"allow",!1)},[c]),g=p.useCallback(v=>{c(v.id,"deny",!1)},[c]);p.useEffect(()=>{const v=y=>{y.key==="Escape"&&!y.defaultPrevented&&e()};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[e]);const k=[{key:null,label:"All"},{key:"permission_request",label:"Permissions"},{key:"policy_alert",label:"Policy"},{key:"error",label:"Errors"},{key:"security_alert",label:"Security"},{key:"status_change",label:"Status"},{key:"info",label:"Info"}];return s.jsxs("div",{className:"notification-center",role:"dialog","aria-label":"Notification Center",children:[s.jsxs("div",{className:"notification-center-header",children:[s.jsxs("div",{className:"notification-center-title-row",children:[s.jsx("h2",{className:"notification-center-title",children:"Notifications"}),n>0&&s.jsx("span",{className:"notification-center-badge",children:n})]}),s.jsx("button",{className:"btn-icon notification-center-close",onClick:e,"aria-label":"Close notification center",children:s.jsx(Ze,{size:18})})]}),s.jsx("div",{className:"notification-filter-bar",role:"tablist","aria-label":"Filter notifications",children:k.map(v=>s.jsx("button",{role:"tab","aria-selected":u===v.key,className:`notification-filter-tab ${u===v.key?"active":""}`,onClick:()=>d(v.key),children:v.label},v.key??"all"))}),s.jsx("div",{className:"notification-list",children:t.length===0?s.jsxs("div",{className:"notification-empty",children:[s.jsx(dy,{size:40,strokeWidth:1.2}),s.jsx("span",{children:"No notifications"})]}):t.map(v=>{const y=pz[v.type];return s.jsxs("div",{className:`notification-item ${v.read?"":"unread"} ${y.colorClass}`,id:v.type==="policy_alert"&&v.receiptId?`policy-receipt-${encodeURIComponent(v.receiptId)}`:void 0,onClick:()=>h(v.id),role:"button",tabIndex:0,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&h(v.id)},children:[!v.read&&s.jsx("span",{className:"notification-unread-dot"}),s.jsx("span",{className:"notification-icon",children:y.icon}),s.jsxs("div",{className:"notification-content",children:[s.jsxs("div",{className:"notification-content-header",children:[s.jsx("span",{className:"notification-agent",children:v.agentName}),s.jsx("span",{className:"notification-time",children:gz(v.timestamp)})]}),v.title&&s.jsx("span",{className:"notification-title",children:v.title}),s.jsx("span",{className:"notification-message",children:v.message}),v.type==="permission_request"&&v.tool&&s.jsxs("span",{className:"notification-tool",children:["Tool: ",s.jsx("code",{children:v.tool})]}),v.type==="policy_alert"&&s.jsxs("div",{className:"notification-policy-details",children:[v.tool&&s.jsxs("span",{className:"notification-tool",children:["Tool: ",s.jsx("code",{children:v.tool})]}),v.reason&&s.jsxs("span",{className:"notification-policy-reason",children:["Reason: ",v.reason]}),v.ruleIds&&v.ruleIds.length>0&&s.jsxs("span",{className:"notification-tool",children:["Rules: ",s.jsx("code",{children:v.ruleIds.join(", ")})]}),v.policyVersion&&s.jsxs("span",{className:"notification-tool",children:["Policy: ",s.jsx("code",{children:v.policyVersion})]}),s.jsxs("span",{className:"notification-tool",children:["Receipt:"," ",v.receiptId?s.jsx("code",{children:v.receiptId}):s.jsx("em",{children:"Receipt unavailable"})]})]}),v.type==="permission_request"&&!v.response&&s.jsxs("div",{className:"notification-actions",children:[s.jsxs("button",{className:"notification-action-btn notification-action-allow",onClick:w=>{w.stopPropagation(),m(v)},children:[s.jsx(ci,{size:14}),"Approve"]}),s.jsxs("button",{className:"notification-action-btn notification-action-deny",onClick:w=>{w.stopPropagation(),g(v)},children:[s.jsx(Ze,{size:14}),"Deny"]})]}),v.type==="permission_request"&&v.response&&s.jsx("span",{className:`notification-response-badge ${v.response==="allow"?"response-allow":"response-deny"}`,children:v.response==="allow"?"Approved":"Denied"})]}),s.jsx("button",{className:"notification-dismiss",onClick:w=>{w.stopPropagation(),a(v.id)},"aria-label":"Dismiss notification",children:s.jsx(Ze,{size:14})})]},v.id)})}),t.length>0&&s.jsxs("div",{className:"notification-center-footer",children:[s.jsxs("button",{className:"notification-footer-btn",onClick:i,disabled:n===0,children:[s.jsx(ci,{size:14}),"Mark All Read"]}),s.jsxs("button",{className:"notification-footer-btn notification-footer-clear",onClick:l,children:[s.jsx(fi,{size:14}),"Clear"]})]})]})}function la({show:e,children:t,duration:n=250}){const[r,i]=p.useState(!1),[l,a]=p.useState("idle");return p.useEffect(()=>{if(e)i(!0),requestAnimationFrame(()=>a("entering"));else if(r){a("exiting");const o=setTimeout(()=>{i(!1),a("idle")},n);return()=>clearTimeout(o)}},[e,r,n]),r?s.jsx("div",{className:`animated-presence ${l}`,"data-duration":n,children:t}):null}function xz(){const{currentSessionId:e,setSessions:t,setCurrentSession:n,addSession:r,removeSession:i,updateSessionInList:l,setMessages:a,showDocLibrary:o,showFileBrowser:c,showSettings:u,setShowSettings:d,showMemoryDashboard:f,setShowMemoryDashboard:h,sidebarOpen:m,toggleSidebar:g,setSidebarOpen:k,systemStatus:v,setSystemStatus:y,setBackendConnected:w,setAgents:j}=ve(),z=ct(G=>G.showPanel),D=ct(G=>G.setShowPanel),C=p.useRef(""),A=p.useCallback(async()=>{try{const ze=(await Ed()).agents||[],Te=ze.map(Qe=>Qe.id).sort().join(",");Te!==C.current&&(C.current=Te,j(ze))}catch{}},[j]);p.useEffect(()=>{A();const G=setInterval(A,3e4);return()=>clearInterval(G)},[A]);const[_,I]=p.useState(!1),[N,U]=p.useState(!1),[O,re]=p.useState(!1),[oe,te]=p.useState(null),le=p.useRef(null),fe=p.useRef(0),T=3,P=p.useCallback(async()=>{try{const G=await _d();if(w(!0),G.detected_devices&&G.detected_devices.length>0&&ve.getState().setDetectedDevices(G.detected_devices),G.lemonade_running)fe.current=0,y(G);else if(fe.current+=1,E.system.warn(`Lemonade health check failed (${fe.current}/${T})`),fe.current>=T)y(G);else{const ze=ve.getState().systemStatus;ze&&ze.lemonade_running?y({...ze,disk_space_gb:G.disk_space_gb,memory_available_gb:G.memory_available_gb}):y(G)}E.system.info("System status:",{lemonade:G.lemonade_running,model:G.model_loaded,failCount:fe.current})}catch(G){E.system.warn("System status check failed",G),w(!1),y(null)}},[y,w]),b=p.useRef(3e3);p.useEffect(()=>(P(),b.current=3e3,le.current=setInterval(P,3e3),()=>{le.current&&clearInterval(le.current)}),[P]),p.useEffect(()=>{const G=v==null?void 0:v.init_state;if(!G||G==="initializing")return;const ze=15e3;ze!==b.current&&(b.current=ze,le.current&&clearInterval(le.current),le.current=setInterval(P,ze))},[v==null?void 0:v.init_state,P]);const X=p.useRef(null),H=p.useRef("");p.useEffect(()=>{l0("0.20.0"),E.system.info("App mounting, loading sessions...");const G=E.system.time(),ze=Qe=>Qe.map(Se=>`${Se.id}|${Se.updated_at}|${Se.title}`).join(`
|
|
565
|
+
`),Te=(Qe=!1)=>{k0().then(Se=>{const Fe=Se.sessions||[];if(Qe){t(Fe),w(!0),H.current=ze(Fe),E.system.timed(`Loaded ${Fe.length} session(s)`,G);return}const Ht=ve.getState().sessions;if(Fe.length===0&&Ht.length>0){E.system.warn(`Session poll returned 0 sessions but sidebar has ${Ht.length} — skipping update to prevent data loss`);return}const Mn=ze(Fe);Mn!==H.current&&(E.system.info(`Session list changed (${Ht.length} → ${Fe.length} sessions)`),t(Fe),H.current=Mn)}).catch(Se=>{Qe&&(E.system.error("Failed to load sessions from backend",Se),E.system.warn("Is the Python backend running? Start it with: gaia chat --ui"))})};return Te(!0),X.current=setInterval(()=>Te(!1),5e3),()=>{X.current&&clearInterval(X.current)}},[t,r,i,l,w]),p.useEffect(()=>{if(e)return;const ze=new URLSearchParams(window.location.search).get("session"),Te=window.location.hash.replace(/^#/,""),Qe=ze||Te;if(!Qe)return;E.nav.info(`URL session parameter: ${Qe}`);const Se=setTimeout(()=>{const{sessions:Fe}=ve.getState();let Ht=Fe.some(Mn=>Mn.id===Qe)?Qe:F0(Fe,Qe);Ht?(n(Ht),a([])):E.nav.warn(`Session ${Qe} not found in loaded sessions`)},500);return()=>clearTimeout(Se)},[e,n,a]),p.useEffect(()=>{if(e){const G=Fi(e);window.location.hash!==`#${G}`&&window.history.replaceState(null,"",`#${G}`)}else window.location.hash&&window.history.replaceState(null,"",window.location.pathname+window.location.search)},[e]),p.useEffect(()=>{Oy().then(G=>{U(G.active===!0)}).catch(()=>{})},[]),p.useEffect(()=>{const G=()=>{window.innerWidth>768&&k(!0)};return window.addEventListener("resize",G),()=>window.removeEventListener("resize",G)},[k]);const[S,ie]=p.useState(null),ye=p.useCallback(async()=>{E.chat.info("Creating new task session..."),ie(null);try{const{activeAgentId:G,activeDevice:ze}=ve.getState(),Te=await yu({title:"New Task",agent_type:G,device:ze});E.chat.info(`Session created: id=${Te.id}, title="${Te.title}"`),r(Te),n(Te.id),a([]),window.innerWidth<=768&&k(!1)}catch(G){E.chat.error("Failed to create session",G),P(),ie("Failed to create task. Is the server running?"),setTimeout(()=>ie(null),6e3)}},[r,n,a,k,P]),ae=p.useCallback(async G=>{ve.getState().setActiveAgentId(G),await ye()},[ye]),{setPendingPrompt:je}=ve(),Ge=p.useCallback(async G=>{E.chat.info(`New task with prompt: "${G.slice(0,60)}..."`),je(G),await ye()},[ye,je]),qe=p.useCallback(async()=>{E.chat.info("Creating builder agent session..."),ie(null);try{je("Hi, I'd like to create a new custom agent.");const G=await yu({title:"New Agent",agent_type:"builder"});E.chat.info(`Builder session created: id=${G.id}`),r(G),n(G.id),a([]),window.innerWidth<=768&&k(!1)}catch(G){je(null),E.chat.error("Failed to create builder session",G),P(),ie("Failed to create task. Is the server running?"),setTimeout(()=>ie(null),6e3)}},[r,n,a,k,P,je]),Xe=p.useCallback(async()=>{if(N){E.system.info("Reopening mobile access modal (tunnel already running)"),te(null),I(!0);return}E.system.info("Starting mobile access tunnel..."),I(!0),re(!0),te(null);try{const G=await M0();G.error?(E.system.error("Tunnel failed to start:",G.error),U(!1),te(G.error)):(U(!0),E.system.info("Tunnel started successfully"))}catch(G){E.system.error("Tunnel start error:",G),U(!1),te(G instanceof Error?G.message:"Failed to connect")}finally{re(!1)}},[N]),M=p.useCallback(async()=>{E.system.info("Stopping mobile access tunnel...");try{await R0()}catch(G){E.system.warn("stopTunnel call failed (continuing)",G)}U(!1),te(null),I(!1)},[]);p.useEffect(()=>{const{sessions:G,setActiveAgentId:ze}=ve.getState(),Te=G.find(Qe=>Qe.id===e);Te!=null&&Te.agent_type&&ze(Te.agent_type)},[e]),p.useEffect(()=>{e?E.nav.info(`Viewing session: ${e}`):E.nav.info("Viewing welcome screen (no session selected)")},[e]),p.useEffect(()=>{o&&E.ui.info("Document Library opened")},[o]),p.useEffect(()=>{u&&E.ui.info("Settings page opened")},[u]);const[R,B]=p.useState(typeof window<"u"&&window.innerWidth<=768);p.useEffect(()=>{const G=()=>B(window.innerWidth<=768);return window.addEventListener("resize",G),()=>window.removeEventListener("resize",G)},[]);const[pe,ge]=p.useState(!1),[ce,we]=p.useState(null);return p.useEffect(()=>{if(e!==ce){ge(!0);const G=setTimeout(()=>{we(e),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ge(!1)})})},220);return()=>clearTimeout(G)}},[e,ce]),s.jsxs("div",{className:"app",children:[s.jsx("button",{className:"sidebar-toggle",onClick:g,"aria-label":m?"Close sidebar":"Open sidebar",children:s.jsx(uw,{size:18})}),s.jsx("div",{className:`sidebar-overlay ${m?"visible":""}`,onClick:()=>k(!1),"aria-hidden":"true"}),s.jsx(U0,{onNewTask:ye,onHome:()=>{n(null),d(!1),h(!1),window.history.replaceState(null,"",window.location.pathname)},tunnelActive:N,tunnelLoading:O,onMobileToggle:Xe}),s.jsx("div",{className:"main-content",children:u?s.jsx(iz,{}):f?s.jsx(RT,{}):s.jsxs(s.Fragment,{children:[s.jsx(cz,{onRetry:P}),s.jsx("div",{className:`view-container ${pe?"view-transitioning":""}`,children:ce?s.jsx(AE,{sessionId:ce,onCreateAgent:qe,onAgentChange:ae},ce):s.jsx(HE,{onNewTask:ye,onSendPrompt:Ge,onCreateAgent:qe})})]})}),s.jsx(la,{show:o,children:s.jsx(qE,{})}),s.jsx(la,{show:c,children:s.jsx(ZE,{})}),s.jsx(la,{show:z,children:s.jsx("div",{className:"notification-center-popover",children:s.jsx(yz,{onClose:()=>D(!1)})})}),!R&&s.jsx(la,{show:_,children:s.jsx(oz,{isOpen:_,onClose:()=>I(!1),onStop:M,error:oe})}),s.jsx(mz,{}),s.jsx(fz,{}),S&&s.jsx("div",{className:"toast",role:"alert",children:S})]})}const vz=localStorage.getItem("gaia-chat-theme");vz!=="light"&&document.documentElement.setAttribute("data-theme","dark");bc.createRoot(document.getElementById("root")).render(s.jsx(Ki.StrictMode,{children:s.jsx(xz,{})}));
|