@amd-gaia/agent-ui 0.25.3 → 0.25.4-rc.1
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/{AdvancedSettings-DERzP9Jc.js → AdvancedSettings-CuIQvcmD.js} +1 -1
- package/dist/assets/{ConnectorsPane-s0fFxmus.js → ConnectorsPane-DQYLrzjU.js} +1 -1
- package/dist/assets/DocumentLibrary-B5-Yd9vc.css +1 -0
- package/dist/assets/DocumentLibrary-s6IEqE1v.js +4 -0
- package/dist/assets/FileBrowser-Cna3BsT7.css +1 -0
- package/dist/assets/FileBrowser-EJp637PF.js +4 -0
- package/dist/assets/MemoryDashboard-DKeENiEN.js +1 -0
- package/dist/assets/{MemoryDashboard-Mo721-BI.css → MemoryDashboard-Dt6zI60b.css} +1 -1
- package/dist/assets/{MobileAccessModal-B31mPs50.js → MobileAccessModal-BOjyr9RN.js} +1 -1
- package/dist/assets/{ScheduleManager-b0gTAf2R.js → ScheduleManager-DMCckccQ.js} +2 -2
- package/dist/assets/index-BsYOJS61.js +78 -0
- package/dist/assets/index-cP47kET9.css +1 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/services/agent-seeder.cjs +22 -13
- package/dist/assets/DocumentLibrary-CIKp6qld.css +0 -1
- package/dist/assets/DocumentLibrary-DqapN_Tr.js +0 -4
- package/dist/assets/FileBrowser-Dil1lZJ4.css +0 -1
- package/dist/assets/FileBrowser-vAJV41RT.js +0 -4
- package/dist/assets/MemoryDashboard-CP5wVWkY.js +0 -1
- package/dist/assets/index-C-EM_5yl.css +0 -1
- package/dist/assets/index-Cae5Fje-.js +0 -78
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ConnectorsPane-DQYLrzjU.js","./rolldown-runtime-XKyaHtl9.js","./apiBase-CS6zLsJY.js","./ConnectorsPane-Dzu2DRTc.css","./AdvancedSettings-CuIQvcmD.js","./MemoryDashboard-DKeENiEN.js","./zap-BogJn9oN.js","./MemoryDashboard-Dt6zI60b.css","./ScheduleManager-DMCckccQ.js","./ScheduleManager-D5c4gVIt.css","./DocumentLibrary-s6IEqE1v.js","./DocumentLibrary-B5-Yd9vc.css","./FileBrowser-EJp637PF.js","./FileBrowser-Cna3BsT7.css","./MobileAccessModal-BOjyr9RN.js","./MobileAccessModal-DuVy9F1u.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{a as r,i,n as a,o,r as s,t as c}from"./apiBase-CS6zLsJY.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),u=n(((e,t)=>{t.exports=l()})),d=n((e=>{var t=o();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=i.p;try{if(u.T=null,i.p=2,e)return e()}finally{u.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),f=n(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=d()})),p=n((e=>{var t=u(),n=o(),r=f();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function c(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 l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(s(e)!==e)throw Error(i(188))}function p(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return d(a),e;if(o===r)return d(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var c=!1,l=a.child;l;){if(l===n){c=!0,n=a,r=o;break}if(l===r){c=!0,r=a,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=a;break}if(l===r){c=!0,r=o,n=a;break}l=l.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),ee=Symbol.for(`react.consumer`),P=Symbol.for(`react.context`),F=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),ne=Symbol.for(`react.suspense_list`),re=Symbol.for(`react.memo`),I=Symbol.for(`react.lazy`),L=Symbol.for(`react.activity`),ie=Symbol.for(`react.legacy_hidden`),ae=Symbol.for(`react.memo_cache_sentinel`),oe=Symbol.for(`react.view_transition`),se=Symbol.for(`react.recoverable`),ce=Symbol.iterator;function le(e){return typeof e!=`object`||!e?null:(e=ce&&e[ce]||e[`@@iterator`],typeof e==`function`?e:null)}var ue=Symbol.for(`react.client.reference`);function de(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case te:return`Suspense`;case ne:return`SuspenseList`;case L:return`Activity`;case oe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case P:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case F:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case re:return t=e.displayName||null,t===null?de(e.type)||`Memo`:t;case I:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}var fe=Array.isArray,R=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},me=[],he=-1;function ge(e){return{current:e}}function _e(e){0>he||(e.current=me[he],me[he]=null,he--)}function ve(e,t){he++,me[he]=e.current,e.current=t}var ye=ge(null),be=ge(null),xe=ge(null),Se=ge(null);function Ce(e,t){switch(ve(xe,t),ve(be,e),ve(ye,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}_e(ye),ve(ye,e)}function we(){_e(ye),_e(be),_e(xe)}function Te(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,ve(Se,e)),t=ye.current;var n=dp(t,e.type);t!==n&&(ve(be,e),ve(ye,n))}function Ee(e){be.current===e&&(_e(ye),_e(be)),Se.current===e&&(_e(Se),sh._currentValue=pe)}var De,Oe;function ke(e){if(De===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);De=t&&t[1]||``,Oe=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+De+e+Oe}var Ae=!1;function je(e,t){if(!e||Ae)return``;Ae=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ae=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ke(n):``}function Me(e,t){switch(e.tag){case 26:case 27:case 5:return ke(e.type);case 16:return ke(`Lazy`);case 13:return e.child!==t&&t!==null?ke(`Suspense Fallback`):ke(`Suspense`);case 19:return ke(`SuspenseList`);case 0:case 15:return je(e.type,!1);case 11:return je(e.type.render,!1);case 1:return je(e.type,!0);case 31:return ke(`Activity`);case 30:return ke(`ViewTransition`);default:return``}}function Ne(e){try{var t=``,n=null;do t+=Me(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var Pe=Object.prototype.hasOwnProperty,Fe=t.unstable_scheduleCallback,Ie=t.unstable_cancelCallback,Le=t.unstable_shouldYield,Re=t.unstable_requestPaint,ze=t.unstable_now,Be=t.unstable_getCurrentPriorityLevel,Ve=t.unstable_ImmediatePriority,He=t.unstable_UserBlockingPriority,Ue=t.unstable_NormalPriority,We=t.unstable_LowPriority,Ge=t.unstable_IdlePriority,Ke=t.log,qe=t.unstable_setDisableYieldValue,Je=null,Ye=null;function Xe(e){if(typeof Ke==`function`&&qe(e),Ye&&typeof Ye.setStrictMode==`function`)try{Ye.setStrictMode(Je,e)}catch{}}var Ze=Math.clz32?Math.clz32:et,Qe=Math.log,$e=Math.LN2;function et(e){return e>>>=0,e===0?32:31-(Qe(e)/$e|0)|0}var tt=256,nt=262144,rt=4194304;function it(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function at(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=it(n))):i=it(o):i=it(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=it(n))):i=it(o)):i=it(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ot(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function st(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ze(n),i=1<<r;t|=e[r],n&=~i}return t}function ct(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lt(){var e=rt;return rt<<=1,!(rt&62914560)&&(rt=4194304),e}function ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function dt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ft(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ze(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&pt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function pt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function mt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ht(e,t){var n=t&-t;return n=n&42?1:gt(n),(n&(e.suspendedLanes|t))===0?n:0}function gt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function _t(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function vt(){var e=z.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function yt(e,t){var n=z.p;try{return z.p=e,t()}finally{z.p=n}}var bt=Math.random().toString(36).slice(2),xt=`__reactFiber$`+bt,St=`__reactProps$`+bt,Ct=`__reactContainer$`+bt,wt=`__reactEvents$`+bt,Tt=`__reactListeners$`+bt,Et=`__reactHandles$`+bt,Dt=`__reactResources$`+bt,B=`__reactMarker$`+bt,Ot=`__reactLoad$`+bt;function kt(e){delete e[xt],delete e[St],delete e[Tt],delete e[Et]}function At(e){var t;if(t=e[xt])return t;for(var n=e.parentNode;n;){if(t=n[Ct]||n[xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[xt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function jt(e){if(e=e[xt]||e[Ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Mt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Nt(e){var t=e[Dt];return t||=e[Dt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Pt(e){e[B]=!0}function Ft(e){e[Ot]=void 0}var It=new Set,Lt={};function Rt(e,t){zt(e,t),zt(e+`Capture`,t)}function zt(e,t){for(Lt[e]=t,e=0;e<t.length;e++)It.add(t[e])}var Bt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Vt={},Ht={};function Ut(e){return Pe.call(Ht,e)?!0:Pe.call(Vt,e)?!1:Bt.test(e)?Ht[e]=!0:(Vt[e]=!0,!1)}var Wt=!1;function Gt(){var e=Wt;return Wt=!1,e}function Kt(e,t,n){if(Ut(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function qt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Jt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Yt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Xt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Zt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qt(e){if(!e._valueTracker){var t=Xt(e)?`checked`:`value`;e._valueTracker=Zt(e,t,``+e[t])}}function $t(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Xt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var en=/[\n"\\]/g;function tn(e){return e.replace(en,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function nn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Yt(t)):e.value!==``+Yt(t)&&(e.value=``+Yt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):an(e,Yt(n)):o===`number`&&e.value==t?an(e,Yt(e.value)):an(e,Yt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Yt(s):e.removeAttribute(`name`)}function rn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Qt(e);return}n=n==null?``:``+Yt(n),t=t==null?n:``+Yt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Qt(e)}function an(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function on(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=``+Yt(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 sn(e,t,n){t!=null&&(t=``+Yt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Yt(n)}function cn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(fe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Yt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Qt(e)}function ln(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var un=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function dn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||un.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function fn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Wt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(dn(e,a,r),Wt=!0)}else for(var o in t)t.hasOwnProperty(o)&&dn(e,o,t[o])}function pn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var mn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),hn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function gn(e){return hn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function _n(){}var vn=null;function yn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bn=null,xn=null;function Sn(e){var t=jt(e);if(t&&(e=t.stateNode)){var n=e[St]||null;a:switch(e=t.stateNode,t.type){case`input`:if(nn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+tn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[St]||null;if(!a)throw Error(i(90));nn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&$t(r)}break a;case`textarea`:sn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&on(e,!!n.multiple,t,!1)}}}var Cn=!1;function wn(e,t,n){if(Cn)return e(t,n);Cn=!0;try{return e(t)}finally{if(Cn=!1,(bn!==null||xn!==null)&&(Id(),bn&&(t=bn,e=xn,xn=bn=null,Sn(t),e)))for(t=0;t<e.length;t++)Sn(e[t])}}function Tn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[St]||null;if(r===null)return null;n=r[t];a: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 a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var En=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Dn=!1;if(En)try{var On={};Object.defineProperty(On,"passive",{get:function(){Dn=!0}}),window.addEventListener(`test`,On,On),window.removeEventListener(`test`,On,On)}catch{Dn=!1}var kn=null,An=null,jn=null;function Mn(){if(jn)return jn;var e,t=An,n=t.length,r,i=`value`in kn?kn.value:kn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return jn=i.slice(e,1<r?1-r:void 0)}function Nn(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 Pn(){return!0}function Fn(){return!1}function In(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Pn:Fn,this.isPropagationStopped=Fn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Pn)},persist:function(){},isPersistent:Pn}),t}var Ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rn=In(Ln),zn=D({},Ln,{view:0,detail:0}),Bn=In(zn),V,Vn,Hn,Un=D({},zn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:er,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!==Hn&&(Hn&&e.type===`mousemove`?(V=e.screenX-Hn.screenX,Vn=e.screenY-Hn.screenY):Vn=V=0,Hn=e),V)},movementY:function(e){return`movementY`in e?e.movementY:Vn}}),Wn=In(Un),Gn=In(D({},Un,{dataTransfer:0})),Kn=In(D({},zn,{relatedTarget:0})),qn=In(D({},Ln,{animationName:0,elapsedTime:0,pseudoElement:0})),Jn=In(D({},Ln,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Yn=In(D({},Ln,{data:0})),Xn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Zn={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`},Qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function $n(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qn[e])?!!t[e]:!1}function er(){return $n}var tr=In(D({},zn,{key:function(e){if(e.key){var t=Xn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Nn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Zn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:er,charCode:function(e){return e.type===`keypress`?Nn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Nn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),nr=In(D({},Un,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),rr=In(D({},Ln,{submitter:0})),ir=In(D({},zn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:er})),ar=In(D({},Ln,{propertyName:0,elapsedTime:0,pseudoElement:0})),or=In(D({},Un,{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})),sr=In(D({},Ln,{newState:0,oldState:0,source:0})),cr=[9,13,27,32],lr=En&&`CompositionEvent`in window,ur=null;En&&`documentMode`in document&&(ur=document.documentMode);var dr=En&&`TextEvent`in window&&!ur,fr=En&&(!lr||ur&&8<ur&&11>=ur),pr=` `,mr=!1;function hr(e,t){switch(e){case`keyup`:return cr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function gr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var _r=!1;function vr(e,t){switch(e){case`compositionend`:return gr(t);case`keypress`:return t.which===32?(mr=!0,pr):null;case`textInput`:return e=t.data,e===pr&&mr?null:e;default:return null}}function yr(e,t){if(_r)return e===`compositionend`||!lr&&hr(e,t)?(e=Mn(),jn=An=kn=null,_r=!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 fr&&t.locale!==`ko`?null:t.data;default:return null}}var br={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 xr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!br[e.type]:t===`textarea`}function Sr(e,t,n,r){bn?xn?xn.push(r):xn=[r]:bn=r,t=qf(t,`onChange`),0<t.length&&(n=new Rn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Cr=null,wr=null;function Tr(e){zf(e,0)}function Er(e){if($t(Mt(e)))return e}function Dr(e,t){if(e===`change`)return t}var Or=!1;if(En){var kr;if(En){var Ar=`oninput`in document;if(!Ar){var jr=document.createElement(`div`);jr.setAttribute(`oninput`,`return;`),Ar=typeof jr.oninput==`function`}kr=Ar}else kr=!1;Or=kr&&(!document.documentMode||9<document.documentMode)}function Mr(){Cr&&(Cr.detachEvent(`onpropertychange`,Nr),wr=Cr=null)}function Nr(e){if(e.propertyName===`value`&&Er(wr)){var t=[];Sr(t,wr,e,yn(e)),wn(Tr,t)}}function Pr(e,t,n){e===`focusin`?(Mr(),Cr=t,wr=n,Cr.attachEvent(`onpropertychange`,Nr)):e===`focusout`&&Mr()}function Fr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Er(wr)}function Ir(e,t){if(e===`click`)return Er(t)}function Lr(e,t){if(e===`input`||e===`change`)return Er(t)}function Rr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var zr=typeof Object.is==`function`?Object.is:Rr;function Br(e,t){if(zr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)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(!Pe.call(t,i)||!zr(e[i],t[i]))return!1}return!0}function Vr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Hr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ur(e,t){var n=Hr(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}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Hr(n)}}function Wr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Vr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vr(e.document)}return t}function Kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var qr=En&&`documentMode`in document&&11>=document.documentMode,Jr=null,Yr=null,Xr=null,Zr=!1;function Qr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Zr||Jr==null||Jr!==Vr(r)||(r=Jr,`selectionStart`in r&&Kr(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}),Xr&&Br(Xr,r)||(Xr=r,r=qf(Yr,`onSelect`),0<r.length&&(t=new Rn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Jr)))}function $r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ei={animationend:$r(`Animation`,`AnimationEnd`),animationiteration:$r(`Animation`,`AnimationIteration`),animationstart:$r(`Animation`,`AnimationStart`),transitionrun:$r(`Transition`,`TransitionRun`),transitionstart:$r(`Transition`,`TransitionStart`),transitioncancel:$r(`Transition`,`TransitionCancel`),transitionend:$r(`Transition`,`TransitionEnd`)},ti={},ni={};En&&(ni=document.createElement(`div`).style,`AnimationEvent`in window||(delete ei.animationend.animation,delete ei.animationiteration.animation,delete ei.animationstart.animation),`TransitionEvent`in window||delete ei.transitionend.transition);function ri(e){if(ti[e])return ti[e];if(!ei[e])return e;var t=ei[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ni)return ti[e]=t[n];return e}var ii=ri(`animationend`),ai=ri(`animationiteration`),oi=ri(`animationstart`),si=ri(`transitionrun`),ci=ri(`transitionstart`),li=ri(`transitioncancel`),ui=ri(`transitionend`),di=new Map,fi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);fi.push(`scrollEnd`);function pi(e,t){di.set(e,t),Rt(t,[e])}var mi=0;function hi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=mi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function gi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ed;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function _i(e,t){return e=gi(e),t=gi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var vi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},yi=[],bi=0,xi=0;function Si(){for(var e=bi,t=xi=bi=0;t<e;){var n=yi[t];yi[t++]=null;var r=yi[t];yi[t++]=null;var i=yi[t];yi[t++]=null;var a=yi[t];if(yi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ti(n,i,a)}}function H(e,t,n,r){yi[bi++]=e,yi[bi++]=t,yi[bi++]=n,yi[bi++]=r,xi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ci(e,t,n,r){return H(e,t,n,r),Ei(e)}function wi(e,t){return H(e,null,null,t),Ei(e)}function Ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ei(e){if(50<Dd)throw Dd=0,Od=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Di={};function Oi(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.refCleanup=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 ki(e,t,n,r){return new Oi(e,t,n,r)}function U(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ai(e,t){var n=e.alternate;return n===null?(n=ki(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&1206910976,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.refCleanup=e.refCleanup,n}function ji(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Mi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)U(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,ye.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case L:return e=ki(31,n,t,a),e.elementType=L,e.lanes=o,e;case j:return Ni(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=ki(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case te:return e=ki(13,n,t,a),e.elementType=te,e.lanes=o,e;case ne:return e=ki(19,n,t,a),e.elementType=ne,e.lanes=o,e;case ie:case oe:return e=a|32,e=ki(30,n,t,e),e.elementType=oe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case P:s=10;break a;case ee:s=9;break a;case F:s=11;break a;case re:s=14;break a;case I:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ki(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ni(e,t,n,r){return e=ki(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=ki(6,e,null,t),e.lanes=n,e}function Fi(e){var t=ki(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=ki(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Li=new WeakMap;function Ri(e,t){if(typeof e==`object`&&e){var n=Li.get(e);return n===void 0?(t={value:e,source:t,stack:Ne(t)},Li.set(e,t),t):n}return{value:e,source:t,stack:Ne(t)}}var zi=[],Bi=0,Vi=null,Hi=0,Ui=[],Wi=0,Gi=null,Ki=1,qi=``;function Ji(e,t){zi[Bi++]=Hi,zi[Bi++]=Vi,Vi=e,Hi=t}function Yi(e,t,n){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Gi=e;var r=Ki;e=qi;var i=32-Ze(r)-1;r&=~(1<<i),n+=1;var a=32-Ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ki=1<<32-Ze(t)+i|n<<i|r,qi=a+e}else Ki=1<<a|n<<i|r,qi=e}function Xi(e){e.return!==null&&(Ji(e,1),Yi(e,1,0))}function Zi(e){for(;e===Vi;)Vi=zi[--Bi],zi[Bi]=null,Hi=zi[--Bi],zi[Bi]=null;for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,qi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null}function Qi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Ki=t.id,qi=t.overflow,Gi=e}var $i=null,ea=null,W=!1,ta=null,na=!1,ra=Error(i(519));function ia(e){throw ua(Ri(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ra}function aa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[xt]=e,t[St]=r,n){case`dialog`:Bf(`cancel`,t),Bf(`close`,t);break;case`iframe`:case`object`:case`embed`:Bf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Lf.length;n++)Bf(Lf[n],t);break;case`source`:Bf(`error`,t);break;case`img`:case`image`:case`link`:Bf(`error`,t),Bf(`load`,t);break;case`details`:Bf(`toggle`,t);break;case`input`:Bf(`invalid`,t),rn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Bf(`invalid`,t);break;case`textarea`:Bf(`invalid`,t),cn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&(Bf(`beforetoggle`,t),Bf(`toggle`,t)),r.onScroll!=null&&Bf(`scroll`,t),r.onScrollEnd!=null&&Bf(`scrollend`,t),r.onClick!=null&&(t.onclick=_n),t=!0):t=!1,t||ia(e,!0)}function oa(e){for($i=e.return;$i;)switch($i.tag){case 5:case 31:case 13:na=!1;return;case 27:case 3:na=!0;return;default:$i=$i.return}}function sa(e){if(e!==$i)return!1;if(!W)return oa(e),W=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&ea&&ia(e),oa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=dm(e)}else t===27?(t=ea,Sp(e.type)?(e=um,um=null,ea=e):ea=t):ea=$i?lm(e.stateNode.nextSibling):null;return!0}function ca(){ea=$i=null,W=!1}function la(){var e=ta;return e!==null&&(ud===null?ud=e:ud.push.apply(ud,e),ta=null),e}function ua(e){ta===null?ta=[e]:ta.push(e)}var da=ge(null),fa=null,pa=null;function ma(e,t,n){ve(da,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=da.current,_e(da)}function ga(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function _a(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ga(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ga(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ga(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function va(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;zr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&_a(t,e,n,r),t.flags|=262144,e!==null}function ya(e){for(e=e.firstContext;e!==null;){if(!zr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){fa=e,pa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return Ca(fa,e)}function Sa(e,t){return fa===null&&ba(e),Ca(e,t)}function Ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pa===null){if(e===null)throw Error(i(308));pa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pa=pa.next=t;return n}var G=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},wa=t.unstable_scheduleCallback,Ta=t.unstable_NormalPriority,Ea={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Da(){return{controller:new G,data:new Map,refCount:0}}function Oa(e){e.refCount--,e.refCount===0&&wa(Ta,function(){e.controller.abort()})}function ka(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Aa=null;function ja(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ma=null,Na=0,Pa=0,Fa=null;function Ia(e,t){if(Ma===null){var n=Ma=[];Na=0,Pa=Mf(),Fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Na++,t.then(La,La),t}function La(){if(--Na===0&&(Aa=null,Ma!==null)){Fa!==null&&(Fa.status=`fulfilled`);var e=Ma;Ma=null,Pa=0,Fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ra(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var za=R.S;R.S=function(e,t){if(pd=ze(),typeof t==`object`&&t&&typeof t.then==`function`&&Ia(e,t),Aa!==null)for(var n=vf;n!==null;)ka(n,Aa),n=n.next;if(n=e.types,n!==null){for(var r=vf;r!==null;)ka(r,n),r=r.next;if(Pa!==0){r=Aa,r===null&&(r=Aa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}za!==null&&za(e,t)};var Ba=ge(null);function Va(){var e=Ba.current;return e===null?Xu.pooledCache:e}function Ha(e,t){t===null?ve(Ba,Ba.current):ve(Ba,t.pool)}function Ua(){var e=Va();return e===null?null:{parent:Ea._currentValue,pool:e}}var Wa=Error(i(460)),Ga=Error(i(474)),Ka=Error(i(542)),qa={then:function(){}};function Ja(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ya(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(_n,_n),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,$a(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(_n,_n);else{if(e=Xu,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,$a(e),e}throw Za=t,Wa}}function Xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Za=e,Wa):e}}var Za=null;function Qa(){if(Za===null)throw Error(i(459));var e=Za;return Za=null,e}function $a(e){if(e===Wa||e===Ka)throw Error(i(483))}var eo=null,to=0;function no(e){var t=to;return to+=1,eo===null&&(eo=[]),Ya(eo,e,t)}function ro(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function io(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ao(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),ro(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===I&&Xa(i)===t.type)?(t=a(t,n.props),ro(t,n),t.return=e,t):(t=Mi(n.type,n.key,n.props,null,e.mode,r),ro(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ii(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ni(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Mi(t.type,t.key,t.props,null,e.mode,n),ro(n,t),n.return=e,n;case A:return t=Ii(t,e.mode,n),t.return=e,t;case I:return t=Xa(t),f(e,t,n)}if(fe(t)||le(t))return t=Ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,no(t),n);if(t.$$typeof===P)return f(e,Sa(e,t),n);io(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case I:return n=Xa(n),p(e,t,n,r)}if(fe(n)||le(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,no(n),r);if(n.$$typeof===P)return p(e,t,Sa(e,n),r);io(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case I:return r=Xa(r),m(e,t,n,r,i)}if(fe(r)||le(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,no(r),i);if(r.$$typeof===P)return m(e,t,n,Sa(t,r),i);io(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),W&&Ji(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return W&&Ji(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),W&&Ji(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),W&&Ji(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return W&&Ji(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),W&&Ji(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),ro(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===I&&Xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ro(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ni(o.props.children,e.mode,c,o.key),ro(c,o),c.return=e,e=c):(c=Mi(o.type,o.key,o.props,null,e.mode,c),ro(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ii(o,e.mode,c),c.return=e,e=c}return s(e);case I:return o=Xa(o),_(e,r,o,c)}if(fe(o))return h(e,r,o,c);if(le(o)){if(l=le(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,no(o),c);if(o.$$typeof===P)return _(e,r,Sa(e,o),c);io(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{to=0;var i=_(e,t,n,r);return eo=null,i}catch(t){if(t===Wa||t===Ka)throw t;var a=ki(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var oo=ao(!0),so=ao(!1),co=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function fo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function po(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Yu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ei(e),Ti(e,null,n),t}return H(e,r,t,n),Ei(e)}function mo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mt(e,n)}}function ho(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var go=!1;function _o(){if(go){var e=Fa;if(e!==null)throw e}}function vo(e,t,n,r){go=!1;var i=e.updateQueue;co=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Q&f)===f:(r&f)===f){f!==0&&f===Pa&&(go=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:co=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),id|=o,e.lanes=o,e.memoizedState=d}}function yo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function bo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)yo(n[e],t)}var xo=ge(null),So=ge(0);function Co(e,t){e=nd,ve(So,e),ve(xo,t),nd=e|t.baseLanes}function wo(){ve(So,nd),ve(xo,xo.current)}function To(){nd=So.current,_e(xo),_e(So)}var Eo=ge(null),Do=null;function Oo(e){var t=e.alternate;ve(No,No.current&1),ve(Eo,e),Do===null&&(t===null||xo.current!==null||t.memoizedState!==null)&&(Do=e)}function ko(e){ve(No,No.current),ve(Eo,e),Do===null&&(Do=e)}function Ao(e){e.tag===22?(ve(No,No.current),ve(Eo,e),Do===null&&(Do=e)):jo()}function jo(){ve(No,No.current),ve(Eo,Eo.current)}function Mo(e){_e(Eo),Do===e&&(Do=null),_e(No)}var No=ge(0);function Po(e,t){ve(Eo,Eo.current),ve(No,t)}function Fo(e){_e(No),_e(Eo),Do===e&&(Do=null)}function Io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Lo=0,K=null,Ro=null,zo=null,Bo=!1,Vo=!1,Ho=!1,Uo=0,Wo=0,Go=null,Ko=0;function qo(){throw Error(i(321))}function Jo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!zr(e[n],t[n]))return!1;return!0}function Yo(e,t,n,r,i,a){return Lo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=e===null||e.memoizedState===null?fc:pc,Ho=!1,a=n(r,i),Ho=!1,Vo&&(a=Zo(t,n,r,i)),Xo(e),a}function Xo(e){R.H=dc;var t=Ro!==null&&Ro.next!==null;if(Lo=0,zo=Ro=K=null,Bo=!1,Wo=0,Go=null,t)throw Error(i(300));e===null||Ac||(e=e.dependencies,e!==null&&ya(e)&&(Ac=!0))}function Zo(e,t,n,r){K=e;var a=0;do{if(Vo&&(Go=null),Wo=0,Vo=!1,25<=a)throw Error(i(301));if(a+=1,zo=Ro=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}R.H=mc,o=t(n,r)}while(Vo);return o}function Qo(){var e=R.H,t=e.useState()[0];return t=typeof t.then==`function`?as(t):t,e=e.useState()[0],(Ro===null?null:Ro.memoizedState)!==e&&(K.flags|=1024),t}function $o(){var e=Uo!==0;return Uo=0,e}function es(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ts(e){if(Bo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bo=!1}Lo=0,zo=Ro=K=null,Vo=!1,Wo=Uo=0,Go=null}function ns(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zo===null?K.memoizedState=zo=e:zo=zo.next=e,zo}function rs(){if(Ro===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=Ro.next;var t=zo===null?K.memoizedState:zo.next;if(t!==null)zo=t,Ro=e;else{if(e===null)throw K.alternate===null?Error(i(467)):Error(i(310));Ro=e,e={memoizedState:Ro.memoizedState,baseState:Ro.baseState,baseQueue:Ro.baseQueue,queue:Ro.queue,next:null},zo===null?K.memoizedState=zo=e:zo=zo.next=e}return zo}function is(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function as(e){var t=Wo;return Wo+=1,Go===null&&(Go=[]),e=Ya(Go,e,t),t=K,(zo===null?t.memoizedState:zo.next)===null&&(t=t.alternate,R.H=t===null||t.memoizedState===null?fc:pc),e}function os(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return as(e);if(e.$$typeof===se)return;if(e.$$typeof===P)return xa(e)}throw Error(i(438,String(e)))}function ss(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=is(),K.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ae;return t.index++,n}function cs(e,t){return typeof t==`function`?t(e):t}function ls(e){return us(rs(),Ro,e)}function us(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Lo&f)===f:(Q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Pa&&(d=!0);else if((Lo&p)===p){u=u.next,p===Pa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,K.lanes|=p,id|=p;f=u.action,Ho&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,K.lanes|=f,id|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!zr(o,e.memoizedState)&&(Ac=!0,d&&(n=Fa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ds(e){var t=rs(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);zr(o,t.memoizedState)||(Ac=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function fs(e,t,n){var r=K,a=rs(),o=W;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!zr((Ro||a).memoizedState,n);if(s&&(a.memoizedState=n,Ac=!0),a=a.queue,Ls(hs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||zo!==null&&!!(zo.memoizedState.tag&1),Ms(e?9:8,{destroy:void 0},ms.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(i(349));o||Lo&127||ps(r,t,n)}return n}function ps(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=is(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ms(e,t,n,r){t.value=n,t.getSnapshot=r,gs(t)&&_s(e)}function hs(e,t,n){return n(function(){gs(t)&&_s(e)})}function gs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zr(e,n)}catch{return!0}}function _s(e){var t=wi(e,2);t!==null&&Md(t,e,2)}function vs(e){var t=ns();if(typeof e==`function`){var n=e;if(e=n(),Ho){Xe(!0);try{n()}finally{Xe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t}function ys(e,t,n,r){return e.baseState=n,us(e,Ro,typeof r==`function`?r:cs)}function bs(e,t,n,r,a){if(cc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};R.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,xs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function xs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=R.T,o={};o.types=a===null?null:a.types,R.T=o;try{var s=n(i,r),c=R.S;c!==null&&c(o,s),Ss(e,t,s)}catch(n){ws(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),R.T=a}}else try{a=n(i,r),Ss(e,t,a)}catch(n){ws(e,t,n)}}function Ss(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Cs(e,t,n)},function(n){return ws(e,t,n)}):Cs(e,t,n)}function Cs(e,t,n){t.status=`fulfilled`,t.value=n,Ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,xs(e,n)))}function ws(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ts(t),t=t.next;while(t!==r)}e.action=null}function Ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Es(e,t){return t}function Ds(e,t){if(W){var n=Xu.formState;if(n!==null){a:{var r=K;if(W){if(ea){b:{for(var i=ea,a=na;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ea=lm(i.nextSibling),r=i.data===`F!`;break a}}ia(r)}r=!1}r&&(t=n[0])}}return n=ns(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:t},n.queue=r,n=ac.bind(null,K,r),r.dispatch=n,r=vs(!1),a=sc.bind(null,K,!1,r.queue),r=ns(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=bs.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Os(e){return ks(rs(),Ro,e)}function ks(e,t,n){if(t=us(e,t,Es)[0],e=ls(cs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=as(t)}catch(e){throw e===Wa?Ka:e}else r=t;t=rs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,Ms(9,{destroy:void 0},As.bind(null,i,n),null)),[r,a,e]}function As(e,t){e.action=t}function js(e){var t=rs(),n=Ro;if(n!==null)return ks(t,n,e);rs(),t=t.memoizedState,n=rs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ms(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=is(),K.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ns(){return rs().memoizedState}function Ps(e,t,n,r){var i=ns();K.flags|=e,i.memoizedState=Ms(1|t,{destroy:void 0},n,r===void 0?null:r)}function Fs(e,t,n,r){var i=rs();r=r===void 0?null:r;var a=i.memoizedState.inst;Ro!==null&&r!==null&&Jo(r,Ro.memoizedState.deps)?i.memoizedState=Ms(t,a,n,r):(K.flags|=e,i.memoizedState=Ms(1|t,a,n,r))}function Is(e,t){Ps(8390656,8,e,t)}function Ls(e,t){Fs(2048,8,e,t)}function Rs(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=is(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function zs(e){var t=rs().memoizedState;return Rs({ref:t,nextImpl:e}),function(){if(Yu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Bs(e,t){return Fs(4,2,e,t)}function Vs(e,t){return Fs(4,4,e,t)}function Hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Us(e,t,n){n=n==null?null:n.concat([e]),Fs(4,4,Hs.bind(null,t,e),n)}function Ws(){}function Gs(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Jo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ks(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Jo(t,r[1]))return r[0];if(r=e(),Ho){Xe(!0);try{e()}finally{Xe(!1)}}return n.memoizedState=[r,t],r}function qs(e,t,n){return n===void 0||Lo&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ad(),K.lanes|=e,id|=e,n)}function Js(e,t,n,r){return zr(n,t)?n:xo.current===null?!(Lo&106)||Lo&1073741824&&!(Q&261930)?(Ac=!0,e.memoizedState=n):(e=Ad(),K.lanes|=e,id|=e,t):(e=qs(e,n,r),zr(e,t)||(Ac=!0),e)}function Ys(e,t,n,r,i){var a=z.p;z.p=a!==0&&8>a?a:8;var o=R.T,s={};s.types=o===null?null:o.types,R.T=s,sc(e,!1,t,n);try{var c=i(),l=R.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?oc(e,t,Ra(c,r),kd(e)):oc(e,t,r,kd(e))}catch(n){oc(e,t,{then:function(){},status:`rejected`,reason:n},kd())}finally{z.p=a,o!==null&&s.types!==null&&(o.types=s.types),R.T=o}}function Xs(){}function Zs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Qs(e).queue;Ys(e,a,t,pe,n===null?Xs:function(){return $s(e),n(r)})}function Qs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:pe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $s(e){var t=Qs(e);t.next===null&&(t=e.alternate.memoizedState),oc(e,t.next.queue,{},kd())}function ec(){return xa(sh)}function tc(){return rs().memoizedState}function nc(){return rs().memoizedState}function rc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kd();e=fo(n);var r=po(t,e,n);r!==null&&(Md(r,t,n),mo(r,t,n)),t={cache:Da()},e.payload=t;return}t=t.return}}function ic(e,t,n){var r=kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},cc(e)?lc(t,n):(n=Ci(e,t,n,r),n!==null&&(Md(n,e,r),uc(n,t,r)))}function ac(e,t,n){oc(e,t,n,kd())}function oc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(cc(e))lc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,zr(s,o))return H(e,t,i,0),Xu===null&&Si(),!1}catch{}if(n=Ci(e,t,i,r),n!==null)return Md(n,e,r),uc(n,t,r),!0}return!1}function sc(e,t,n,r){if(r={lane:2,revertLane:Mf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},cc(e)){if(t)throw Error(i(479))}else t=Ci(e,n,r,2),t!==null&&Md(t,e,2)}function cc(e){var t=e.alternate;return e===K||t!==null&&t===K}function lc(e,t){Vo=Bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mt(e,n)}}var dc={readContext:xa,use:os,useCallback:qo,useContext:qo,useEffect:qo,useImperativeHandle:qo,useLayoutEffect:qo,useInsertionEffect:qo,useMemo:qo,useReducer:qo,useRef:qo,useState:qo,useDebugValue:qo,useDeferredValue:qo,useTransition:qo,useSyncExternalStore:qo,useId:qo,useHostTransitionStatus:qo,useFormState:qo,useActionState:qo,useOptimistic:qo,useMemoCache:qo,useCacheRefresh:qo,useEffectEvent:qo},fc={readContext:xa,use:os,useCallback:function(e,t){return ns().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:Is,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ps(4194308,4,Hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){Ps(4,2,e,t)},useMemo:function(e,t){var n=ns();t=t===void 0?null:t;var r=e();if(Ho){Xe(!0);try{e()}finally{Xe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ns();if(n!==void 0){var i=n(t);if(Ho){Xe(!0);try{n(t)}finally{Xe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ic.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=ns();return e={current:e},t.memoizedState=e},useState:function(e){e=vs(e);var t=e.queue,n=ac.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ws,useDeferredValue:function(e,t){return qs(ns(),e,t)},useTransition:function(){var e=vs(!1);return e=Ys.bind(null,K,e.queue,!0,!1),ns().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,a=ns();if(W){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xu===null)throw Error(i(349));Q&127||ps(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Is(hs.bind(null,r,o,e),[e]),r.flags|=2048,Ms(9,{destroy:void 0},ms.bind(null,r,o,n,t),null),n},useId:function(){var e=ns(),t=Xu.identifierPrefix;if(W){var n=qi,r=Ki;n=(r&~(1<<32-Ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Ko++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ec,useFormState:Ds,useActionState:Ds,useOptimistic:function(e){var t=ns();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=sc.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:ss,useCacheRefresh:function(){return ns().memoizedState=rc.bind(null,K)},useEffectEvent:function(e){var t=ns(),n={impl:e};return t.memoizedState=n,function(){if(Yu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},pc={readContext:xa,use:os,useCallback:Gs,useContext:xa,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:ls,useRef:Ns,useState:function(){return ls(cs)},useDebugValue:Ws,useDeferredValue:function(e,t){return Js(rs(),Ro.memoizedState,e,t)},useTransition:function(){var e=ls(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:tc,useHostTransitionStatus:ec,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){return ys(rs(),Ro,e,t)},useMemoCache:ss,useCacheRefresh:nc,useEffectEvent:zs},mc={readContext:xa,use:os,useCallback:Gs,useContext:xa,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:ds,useRef:Ns,useState:function(){return ds(cs)},useDebugValue:Ws,useDeferredValue:function(e,t){var n=rs();return Ro===null?qs(n,e,t):Js(n,Ro.memoizedState,e,t)},useTransition:function(){var e=ds(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:tc,useHostTransitionStatus:ec,useFormState:js,useActionState:js,useOptimistic:function(e,t){var n=rs();return Ro===null?(n.baseState=e,[e,n.queue.dispatch]):ys(n,Ro,e,t)},useMemoCache:ss,useCacheRefresh:nc,useEffectEvent:zs};function hc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var gc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kd(),i=fo(r);i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(Md(t,e,r),mo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kd(),i=fo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(Md(t,e,r),mo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kd(),r=fo(n);r.tag=2,t!=null&&(r.callback=t),t=po(e,r,n),t!==null&&(Md(t,e,n),mo(t,e,n))}};function _c(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Br(n,r)||!Br(i,a):!0}function vc(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&&gc.enqueueReplaceState(t,t.state,null)}function yc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function bc(e){vi(e)}function xc(e){console.error(e)}function Sc(e){vi(e)}function Cc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function wc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Tc(e,t,n){return n=fo(n),n.tag=3,n.payload={element:null},n.callback=function(){Cc(e,t)},n}function Ec(e){return e=fo(e),e.tag=3,e}function Dc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){wc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){wc(t,n,r),typeof i!=`function`&&(gd===null?gd=new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Oc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&va(t,n,a,!0),n=Eo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Do===null?Ud():n.alternate===null&&rd===0&&(rd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ff(e,r,a)),!1;case 22:return n.flags|=65536,r===qa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ff(e,r,a)),!1}throw Error(i(435,n.tag))}return ff(e,r,a),Ud(),!1}if(W)return t=Eo.current,t===null?(r!==ra&&(t=Error(i(423),{cause:r}),ua(Ri(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ri(r,n),a=Tc(e.stateNode,r,a),ho(e,a),rd!==4&&(rd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ra&&(e=Error(i(422),{cause:r}),ua(Ri(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ri(o,n),ld===null?ld=[o]:ld.push(o),rd!==4&&(rd=2),t===null)return!0;r=Ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Tc(n.stateNode,r,e),ho(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(gd===null||!gd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ec(a),Dc(a,e,n,r),ho(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var kc=Error(i(461)),Ac=!1;function jc(e,t,n,r){t.child=e===null?so(t,null,n,r):oo(t,e.child,n,r)}function Mc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ba(t),r=Yo(e,t,n,o,a,i),s=$o(),e!==null&&!Ac?(es(e,t,i),ol(e,t,i)):(W&&s&&Xi(t),t.flags|=1,jc(e,t,r,i),t.child)}function Nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!U(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Pc(e,t,a,r,i)):(e=Mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!sl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Br:n,n(o,r)&&e.ref===t.ref)return ol(e,t,i)}return t.flags|=1,e=Ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function Pc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Br(a,r)&&e.ref===t.ref){if(Ac=!1,t.pendingProps=r=a,sl(e,i))e.flags&131072&&(Ac=!0);else return t.lanes=e.lanes,ol(e,t,i)}}return Hc(e,t,n,r,i)}function Fc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ha(t,a===null?null:a.cachePool),a===null?wo():Co(t,a),Ao(t);else return r=t.lanes=536870912,Lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ha(t,null),wo(),jo()):(Ha(t,a.cachePool),Co(t,a),jo(),t.memoizedState=null);return jc(e,t,i,n),t.child}function Ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Lc(e,t,n,r,i){var a=Va();return a=a===null?null:{parent:Ea._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ha(t,null),wo(),Ao(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function Rc(e,t){return t=Zc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zc(e,t,n){return oo(t,e.child,null,n),e=Rc(t,t.pendingProps),e.flags|=2,Mo(t),t.memoizedState=null,e}function Bc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(W){if(r.mode===`hidden`)return e=Rc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ic(null,e);if(ko(t),(e=ea)?(e=am(e,na),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw ia(t);return t.lanes=536870912,null}return Rc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ko(t),a){if(t.flags&256)t.flags&=-257,t=zc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ac||va(e,t,n,!1),a=(n&e.childLanes)!==0,Ac||a){if(xo.current===null){if(r=Xu,r!==null&&(s=ht(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,wi(e,s),Md(r,e,s),kc;Ud()}t=zc(e,t,n)}else e=o.treeContext,ea=lm(s.nextSibling),$i=t,W=!0,ta=null,na=!1,e!==null&&Qi(t,e),t=Rc(t,r),t.flags|=134221824;return t}return e=Ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Hc(e,t,n,r,i){return ba(t),n=Yo(e,t,n,r,void 0,i),r=$o(),e!==null&&!Ac?(es(e,t,i),ol(e,t,i)):(W&&r&&Xi(t),t.flags|=1,jc(e,t,n,i),t.child)}function Uc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=Zo(t,r,n,i),Xo(e),r=$o(),e!==null&&!Ac?(es(e,t,a),ol(e,t,a)):(W&&r&&Xi(t),t.flags|=1,jc(e,t,n,a),t.child)}function Wc(e,t,n,r,i){if(ba(t),t.stateNode===null){var a=Di,o=n.contextType;typeof o==`object`&&o&&(a=xa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=gc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},lo(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):Di,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(hc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&gc.enqueueReplaceState(a,a.state,null),vo(t,r,a,i),_o(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=yc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Di,typeof u==`object`&&u&&(o=xa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&vc(t,a,r,o),co=!1;var f=t.memoizedState;a.state=f,vo(t,r,a,i),_o(),l=t.memoizedState,s||f!==l||co?(typeof d==`function`&&(hc(t,n,d,r),l=t.memoizedState),(c=co||_c(t,n,c,r,f,l,o))?(u||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=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,uo(e,t),o=t.memoizedProps,u=yc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Di,typeof l==`object`&&l&&(c=xa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&vc(t,a,r,c),co=!1,f=t.memoizedState,a.state=f,vo(t,r,a,i),_o();var p=t.memoizedState;o!==d||f!==p||co||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(hc(t,n,s,r),p=t.memoizedState),(u=co||_c(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ya(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Vc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=oo(t,e.child,null,i),t.child=oo(t,null,n,i)):jc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ol(e,t,i),e}function Gc(e,t,n,r){return ca(),t.flags|=256,jc(e,t,n,r),t.child}var Kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Ua()}}function Jc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=sd),e}function Yc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(No.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(W){if(i?Oo(t):jo(),(e=ea)?(e=am(e,na),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw ia(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(jo(),i=t.mode,a=Zc({mode:`hidden`,children:a},i),r=Ni(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=qc(n),r.childLanes=Jc(e,o,n),t.memoizedState=Kc,Ic(null,r)):(Oo(t),Xc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return $c(e,t,a,o,r,c,s,n)}return i?(jo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ai(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ni(i,a,n,null),i.flags|=2):i=Ai(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Ic(null,r),r=t.child,i=e.child.memoizedState,i===null?i=qc(n):(a=i.cachePool,a===null?a=Ua():(s=Ea._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Jc(e,o,n),t.memoizedState=Kc,Ic(e.child,r)):(Oo(t),n=e.child,e=n.sibling,n=Ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Xc(e,t){return t=Zc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Zc(e,t){return e=ki(22,e,null,t),e.lanes=0,e}function Qc(e,t,n){return oo(t,e.child,null,n),e=Xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $c(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Oo(t),t.flags&=-257,Qc(e,t,c)):t.memoizedState===null?(jo(),o=a.fallback,s=t.mode,a=Zc({mode:`visible`,children:a.children},s),o=Ni(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,oo(t,e.child,null,c),a=t.child,a.memoizedState=qc(c),a.childLanes=Jc(e,r,c),t.memoizedState=Kc,Ic(null,a)):(jo(),t.child=e.child,t.flags|=128,null);if(Oo(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ua({value:a,source:null,stack:null})),Qc(e,t,c)}if(Ac||va(e,t,c,!1),r=(c&e.childLanes)!==0,Ac||r){if(xo.current!==null)return Qc(e,t,c);if(r=Xu,r!==null&&(a=ht(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,wi(e,a),Md(r,e,a),kc;return om(o)||Ud(),Qc(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ea=lm(o.nextSibling),$i=t,W=!0,ta=null,na=!1,e!==null&&Qi(t,e),t=Xc(t,a.children),t.flags|=134221824,t)}function el(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function tl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Io(n)===null&&(t=e),e=e.sibling}return t}function nl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function rl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function il(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=No.current;if(t.flags&128)return Po(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Po(t,o),i===`backwards`&&e!==null?(rl(e),jc(e,t,r,n),rl(e)):jc(e,t,r,n),r=W?Hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&el(e,n,t);else if(e.tag===19)el(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,rl(t)),nl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}nl(t,!0,n,null,a,r);break;case`together`:nl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),nl(t,!1,i,n,a,r)}return t.child}function al(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),jc(e,t,r.children,n),t.child}function ol(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),id|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(va(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function cl(e,t,n){switch(t.tag){case 3:Ce(t,t.stateNode.containerInfo),ma(t,Ea,e.memoizedState.cache),ca();break;case 27:case 5:Te(t);break;case 4:Ce(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ko(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Oo(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Yc(e,t,n):(Oo(t),e=ol(e,t,n),e===null?null:e.sibling)}Oo(t);break;case 19:if(t.flags&128)return il(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(va(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return il(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Po(t,No.current),r)break;return null;case 22:return t.lanes=0,Fc(e,t,n,t.pendingProps);case 24:ma(t,Ea,e.memoizedState.cache)}return ol(e,t,n)}function ll(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ac=!0;else{if(!sl(e,n)&&!(t.flags&128))return Ac=!1,cl(e,t,n);Ac=!!(e.flags&131072)}}else Ac=!1,W&&t.flags&1048576&&Yi(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Xa(t.elementType),t.type=e,typeof e==`function`)U(e)?(r=yc(e,r),t.tag=1,t=Wc(null,t,e,r,n)):(t.tag=0,t=Hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===F){t.tag=11,t=Mc(null,t,e,r,n);break a}if(a===re){t.tag=14,t=Nc(null,t,e,r,n);break a}if(a===P){t.tag=10,t.type=e,t=al(null,t,n);break a}}throw t=de(e)||e,Error(i(306,t,``))}}return t;case 0:return Hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=yc(r,t.pendingProps),Wc(e,t,r,a,n);case 3:a:{if(Ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,uo(e,t),vo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ma(t,Ea,r),r!==o.cache&&_a(t,[Ea],n,!0),_o(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Gc(e,t,r,n);break a}if(r!==a){a=Ri(Error(i(424)),t),ua(a),t=Gc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ea=lm(e.firstChild),$i=t,W=!0,ta=null,na=!0,n=so(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ca(),r===a){t=ol(e,t,n);break a}jc(e,t,r,n)}t=t.child}return t;case 26:return Vc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:W||(t.stateNode=fp(t.type,t.pendingProps,xe.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Te(t),e===null&&W&&(r=t.stateNode=hm(t.type,t.pendingProps,xe.current),$i=t,na=!0,a=ea,Sp(t.type)?(um=a,ea=lm(r.firstChild)):ea=a),jc(e,t,t.pendingProps.children,n),Vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&W&&((a=r=ea)&&(r=rm(r,t.type,t.pendingProps,na),r===null?a=!1:(t.stateNode=r,$i=t,ea=lm(r.firstChild),na=!1,a=!0)),a||ia(t)),Te(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(a,o)?r=null:s!==null&&pp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Yo(e,t,Qo,null,null,n),sh._currentValue=a),Vc(e,t),jc(e,t,r,n),t.child;case 6:return e===null&&W&&((e=n=ea)&&(n=im(n,t.pendingProps,na),n===null?e=!1:(t.stateNode=n,$i=t,ea=null,e=!0)),e||ia(t)),null;case 13:return Yc(e,t,n);case 4:return Ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=oo(t,null,r,n):jc(e,t,r,n),t.child;case 11:return Mc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Vc(e,t),jc(e,t,r,n),t.child;case 8:return jc(e,t,t.pendingProps.children,n),t.child;case 12:return jc(e,t,t.pendingProps.children,n),t.child;case 10:return al(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ba(t),a=xa(a),r=r(a),t.flags|=1,jc(e,t,r,n),t.child;case 14:return Nc(e,t,t.type,t.pendingProps,n);case 15:return Pc(e,t,t.type,t.pendingProps,n);case 19:return il(e,t,n);case 31:return Bc(e,t,n);case 22:return Fc(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Ea),e===null?(a=Va(),a===null&&(a=Xu,o=Da(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},lo(t),ma(t,Ea,a)):((e.lanes&n)!==0&&(uo(e,t),vo(t,null,null,n),_o()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ma(t,Ea,r),r!==a.cache&&_a(t,[Ea],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ma(t,Ea,r))),jc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:W&&Xi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Vc(e,t),jc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ul(e){e.flags|=4}function dl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Bd())e.flags|=8192;else throw Za=qa,Ga}}else e.flags&=-16777217}function fl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Bd())e.flags|=8192;else throw Za=qa,Ga}}function pl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:lt(),e.lanes|=t,cd|=t)}function ml(e,t){if(!W)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function hl(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&1206910976,r|=i.flags&1206910976,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 gl(e,t,n){var r=t.pendingProps;switch(Zi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hl(t),null;case 1:return hl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ha(Ea),we(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sa(t)?ul(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),hl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ul(t),o===null?(hl(t),dl(t,a,null,r,n)):(hl(t),fl(t,o))):o?o===e.memoizedState?(hl(t),t.flags&=-16777217):(ul(t),hl(t),fl(t,o)):(e=e.memoizedProps,e!==r&&ul(t),hl(t),dl(t,a,e,r,n)),null;case 27:if(Ee(t),n=xe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hl(t),t.subtreeFlags&=-33554433,null}e=ye.current,sa(t)?aa(t,e):(e=hm(a,r,n),t.stateNode=e,ul(t))}return hl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ee(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hl(t),t.subtreeFlags&=-33554433,null}if(o=ye.current,sa(t))aa(t,o);else{var s=lp(xe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[xt]=t,o[St]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ul(t)}}return hl(t),t.subtreeFlags&=-33554433,dl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=xe.current,sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=$i,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[xt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||ia(t,!0)}else e=lp(e).createTextNode(r),e[xt]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=sa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[xt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mo(t),t):(Mo(t),null);if(t.flags&128)throw Error(i(558))}return hl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=sa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[xt]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),a=!1}else a=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Mo(t),t):(Mo(t),null)}return Mo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),pl(t,t.updateQueue),hl(t),null);case 4:return we(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,hl(t),null;case 10:return ha(t.type),hl(t),null;case 19:if(Fo(t),r=t.memoizedState,r===null)return hl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ml(r,!1);else{if(rd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Io(e),o!==null){for(t.flags|=128,ml(r,!1),e=o.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return Po(t,No.current&1|2),W&&Ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ze()>md&&(t.flags|=128,a=!0,ml(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),ml(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!W)return hl(t),null}else 2*ze()-r.renderingStartTime>md&&n!==536870912&&(t.flags|=128,a=!0,ml(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ze(),e.sibling=null,o=No.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||W?Po(t,o):(n=o,ve(Eo,t),ve(No,n),Do===null&&(Do=t)),W&&Ji(t,r.treeForkCount),e}return hl(t),null;case 22:case 23:return Mo(t),To(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(hl(t),t.subtreeFlags&6&&(t.flags|=8192)):hl(t),n=t.updateQueue,n!==null&&pl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&_e(Ba),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Ea),hl(t),null;case 25:return null;case 30:return t.flags|=33554432,hl(t),null}throw Error(i(156,t.tag))}function _l(e,t){switch(Zi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Ea),we(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ee(t),null;case 31:if(t.memoizedState!==null){if(Mo(t),t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return we(),null;case 10:return ha(t.type),null;case 22:case 23:return Mo(t),To(),e!==null&&_e(Ba),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Ea),null;case 25:return null;default:return null}}function vl(e,t){switch(Zi(t),t.tag){case 3:ha(Ea),we();break;case 26:case 27:case 5:Ee(t);break;case 4:we();break;case 31:t.memoizedState!==null&&Mo(t);break;case 13:Mo(t);break;case 19:Fo(t);break;case 10:ha(t.type);break;case 22:case 23:Mo(t),To(),e!==null&&_e(Ba);break;case 24:ha(Ea)}}function yl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){df(t,t.return,e)}}function bl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){df(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){df(t,t.return,e)}}function xl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{bo(t,n)}catch(t){df(e,e.return,t)}}}function q(e,t,n){n.props=yc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){df(e,t,n)}}function Sl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=hi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){df(e,t,n)}}function Cl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){df(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){df(e,t,n)}else n.current=null}}function wl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Tl(e){for(var t=e.return;t!==null&&(Ol(t)&&em(e.stateNode,t.stateNode),!Dl(t));)t=t.return}function El(e){for(var t=e.return;t!==null&&(Ol(t)&&tm(e.stateNode,t.stateNode),!Dl(t));)t=t.return}function Dl(e){return e.tag===5||e.tag===3||e.tag===27}function Ol(e){return e&&e.tag===7&&e.stateNode!==null}function kl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){df(e,e.return,t)}}function Al(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[St]=t}catch(t){df(e,e.return,t)}}function jl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Ml(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||jl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Nl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=_n)),wl(e,r),Wt=!0;else if(i!==4&&(i===27&&(wl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Nl(e,t,n,r),e=e.sibling;e!==null;)Nl(e,t,n,r),e=e.sibling}function Pl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),wl(e,r),Wt=!0;else if(i!==4&&(i===27&&(wl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[xt]=e,t[St]=n}catch(t){df(e,e.return,t)}}var Il=!1,Ll=null;function Rl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Il=!0)}var zl=null;function Bl(){var e=zl;return zl=null,e}var Vl=0;function Hl(e,t,n,r,i){return Vl=0,Ul(e.child,t,n,r,i)}function Ul(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Il=!0,Tp(o,Vl===0?t:t+`_`+Vl,n),Vl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Ul(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Wl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Wl(e.child,t)),e=e.sibling}function Gl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Gl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=_i(t.default,t.share),t!==`none`&&(Hl(e,n,t,null,!1)||Wl(e.child,!1))}e=e.sibling}}function Kl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=hi(r,n),a=_i(r.default,n.paired?r.share:r.enter);a===`none`?Gl(e):Hl(e,i,a,null,!1)?(Gl(e),n.paired||t||jd(e,r.onEnter)):Wl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e,t),e=e.sibling;else Gl(e)}function ql(e){if(Ll!==null&&Ll.size!==0){var t=Ll;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=_i(n.default,n.share);if(a!==`none`&&(Hl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,jd(e,n.onShare)):Wl(e.child,!1)),t.delete(r),t.size===0)break}}}ql(e)}e=e.sibling}}}function Jl(e){if(e.tag===30){var t=e.memoizedProps,n=hi(t,e.stateNode),r=Ll===null?void 0:Ll.get(n),i=_i(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Hl(e,n,i,null,!1)?r===void 0?jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ll.delete(n),jd(e,t.onShare)):Wl(e.child,!1)),Ll!==null&&ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Jl(e),e=e.sibling;else Ll!==null&&ql(e)}function Yl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=hi(t,e.stateNode);t=_i(t.default,t.update),e.flags&=-5,t!==`none`&&Hl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Yl(e);e=e.sibling}}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Wl(e.child,!1))}Xl(e)}e=e.sibling}}function J(e){if(e.tag===30)e.stateNode.paired=null,Wl(e.child,!1),Xl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)J(e),e=e.sibling;else Xl(e)}function Zl(e){for(e=e.child;e!==null;)e.tag===30?Wl(e.child,!1):e.subtreeFlags&33554432&&Zl(e),e=e.sibling}function Ql(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Vl<a.length){var l=a[Vl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Vl===0?n:n+`_`+Vl,i),s&&e.flags&4||(zl===null&&(zl=[]),zl.push(c,Vl===0?r:r+`_`+Vl,t.memoizedProps)),Vl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Ql(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Y(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=hi(n,r),a=_i(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Vl=0,i=Ql(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Y(e,t);e=e.sibling}}var X=!1,$l=!1,eu=!1,tu=!1,nu=typeof WeakSet==`function`?WeakSet:Set,ru=null,iu=!1,au=!1,ou=!1,su=!1;function cu(e,t,n){if(e=e.containerInfo,sp=gh,e=Gr(e),Kr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,ru=t,t=n?9270:1024;ru!==null;){if(e=ru,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Jl(r[a]);if(e.alternate===null&&e.flags&2)n&&Rl(e),lu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Jl(r),lu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Rl(e),lu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ru=r):(n&&Yl(e),lu(n))}}Ll=null}function lu(e){for(;ru!==null;){var t=ru,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=yc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){df(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=hi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=_i(a.default,a.update),a!==`none`&&Hl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,ru=r;break}ru=t.return}}function uu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Au(e,n),r&4&&yl(5,n);break;case 1:if(Au(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){df(n,n.return,e)}else{var i=yc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){df(n,n.return,e)}}}r&64&&xl(n),r&512&&Sl(n,n.return);break;case 3:if(Au(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{bo(e,t)}catch(e){df(n,n.return,e)}}break;case 27:t===null&&r&4&&Fl(n);case 26:case 5:Au(e,n),t===null&&r&4&&kl(n),r&512&&Sl(n,n.return);break;case 12:Au(e,n);break;case 31:Au(e,n),r&4&&yu(e,n);break;case 13:Au(e,n),r&4&&bu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=hf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||X,!r){var a=t!==null&&t.memoizedState!==null||$l;t=X,i=$l,X=r,($l=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Mu(e,n,r)):Au(e,n),X=t,$l=i}break;case 30:Au(e,n),r&512&&Sl(n,n.return);break;case 7:r&512&&Sl(n,n.return);default:Au(e,n)}}function du(e,t){for(e=e.child;e!==null;)fu(e,t),e=e.sibling}function fu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){df(e,e.return,t)}pu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Wt=!0}catch(t){df(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){df(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&du(e,t);break;default:du(e,t)}}function pu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:fu(n,r);break a;case 22:n.memoizedState===null&&pu(n,r);break a;default:pu(n,r)}}e=e.sibling}}function mu(e){var t=e.alternate;t!==null&&(e.alternate=null,mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&kt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var hu=null,gu=!1;function _u(e,t,n){for(n=n.child;n!==null;)vu(e,t,n),n=n.sibling}function vu(e,t,n){if(Ye&&typeof Ye.onCommitFiberUnmount==`function`)try{Ye.onCommitFiberUnmount(Je,n)}catch{}switch(n.tag){case 26:$l||Cl(n,t),_u(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!$l&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$l||Cl(n,t),El(n);var r=hu,i=gu;Sp(n.type)&&(hu=n.stateNode,gu=!1),_u(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),hu=r,gu=i;break;case 5:$l||Cl(n,t),El(n);case 6:if(n.tag===6&&El(n),r=hu,i=gu,hu=null,_u(e,t,n),hu=r,gu=i,hu!==null){if(gu)try{(hu.nodeType===9?hu.body:hu.nodeName===`HTML`?hu.ownerDocument.body:hu).removeChild(n.stateNode),Wt=!0}catch(e){df(n,t,e)}else try{hu.removeChild(n.stateNode),Wt=!0}catch(e){df(n,t,e)}}break;case 18:hu!==null&&(gu?(e=hu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(hu,n.stateNode));break;case 4:r=hu,i=gu,hu=n.stateNode.containerInfo,gu=!0,_u(e,t,n),hu=r,gu=i;break;case 0:case 11:case 14:case 15:bl(2,n,t),$l||bl(4,n,t),_u(e,t,n);break;case 1:$l||(Cl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&q(n,t,r)),_u(e,t,n);break;case 21:_u(e,t,n);break;case 22:$l=(r=$l)||n.memoizedState!==null,_u(e,t,n),$l=r;break;case 30:Cl(n,t),_u(e,t,n);break;case 7:$l||Cl(n,t),_u(e,t,n);break;default:_u(e,t,n)}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){df(t,t.return,e)}}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){df(t,t.return,e)}}function xu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nu),t;default:throw Error(i(435,e.tag))}}function Su(e,t){var n=xu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=gf.bind(null,e,t);t.then(r,r)}})}function Cu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){hu=l.stateNode,gu=!1;break a}break;case 5:hu=l.stateNode,gu=!1;break a;case 3:case 4:hu=l.stateNode.containerInfo,gu=!0;break a}l=l.return}if(hu===null)throw Error(i(160));vu(s,c,o),hu=null,gu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tu(t,e,n),t=t.sibling}var wu=null;function Tu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Cu(t,e,n),Eu(e),a&4&&(bl(3,e,e.return),yl(3,e),bl(5,e,e.return));break;case 1:Cu(t,e,n),Eu(e),a&512&&($l||r===null||Cl(r,r.return)),a&64&&X&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=wu,Cu(t,e,n),Eu(e),a&512&&($l||r===null||Cl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(X)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[B]||r[xt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),np(r,t,n),r[xt]=e,Pt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[xt]=e,Pt(r),t=r}e.stateNode=t}}else X||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Al(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||$l||t.parentNode.removeChild(t)):a.count--,n===null?X||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Cu(t,e,n),Eu(e),a&512&&($l||r===null||Cl(r,r.return)),r!==null&&a&4&&Al(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=eu,eu=!1,Cu(t,e,n),eu=o,Eu(e),a&512&&($l||r===null||Cl(r,r.return)),e.flags&32){t=e.stateNode;try{ln(t,``),Wt=!0}catch(t){df(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Al(e,t,r===null?t:r.memoizedProps)),a&1024&&(tu=!0);break;case 6:if(Cu(t,e,n),Eu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Wt=!0}catch(t){df(e,e.return,t)}}break;case 3:if(Wt=!1,Wm=null,o=wu,wu=bm(t.containerInfo),Cu(t,e,n),wu=o,Eu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){df(e,e.return,t)}tu&&(tu=!1,Du(e)),Wt=!1;break;case 4:a=eu,eu=X,r=Gt(),o=wu,wu=bm(e.stateNode.containerInfo),Cu(t,e,n),Eu(e),wu=o,Wt&&au&&(ou=!0),Wt=r,eu=a;break;case 12:Cu(t,e,n),Eu(e);break;case 31:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 13:Cu(t,e,n),Eu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fd=ze()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=X,l=$l,u=eu;X=c||o,eu=u||o,$l=l||s,Cu(t,e,n),$l=l,eu=u,X=c,Eu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||X||$l||(t=s||$l,n=X,r=$l,X=o||X,$l=t,ju(e,2),X=n,$l=r),!o&&eu||du(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Su(e,n))));break;case 19:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 30:a&512&&($l||r===null||Cl(r,r.return)),a=Gt(),o=au,s=(n&335544064)===n,c=e.memoizedProps,au=s&&_i(c.default,c.update)!==`none`,Cu(t,e,n),Eu(e),s&&r!==null&&Wt&&(e.flags|=4),au=o,Wt=a;break;case 21:break;case 7:a&512&&($l||r===null||Cl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Cu(t,e,n),Eu(e)}}function Eu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(jl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ol(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Dl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Pl(e,Ml(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(ln(l,``),n.flags&=-33),Pl(e,Ml(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Nl(e,Ml(e),u,s);break;default:throw Error(i(161))}}catch(t){df(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Du(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Du(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Ou(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ku(t,e),t=t.sibling;else Y(t,!1)}function ku(e,t){var n=e.alternate;if(n===null)Kl(e,!1);else switch(e.tag){case 3:if(su=iu=!1,Bl(),Ou(t,e),!iu&&!ou){if(e=zl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),su=!0}zl=null;break;case 5:Ou(t,e);break;case 4:r=iu,iu=!1,Ou(t,e),iu&&(ou=!0),iu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ou(t,e):Kl(e,!1));break;case 30:r=iu,i=Bl(),iu=!1,Ou(t,e),iu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=hi(a,o),o=hi(n.memoizedProps,o);var s=_i(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Vl=0,t=Ql(e,n,t,o,s,a,!0),Vl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(jd(e,e.memoizedProps.onUpdate),zl=i):i!==null&&(i.push.apply(i,zl),zl=i),iu=e.flags&32?!0:r;break;default:Ou(t,e)}}function Au(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uu(e,t.alternate,t),t=t.sibling}function ju(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:bl(4,n,n.return),ju(n,r);break;case 1:Cl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&q(n,n.return,i),ju(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Cl(n,n.return),n.tag!==5&&n.tag!==27||El(n),ju(n,r);break;case 6:El(n);break;case 26:Cl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||$l||i.parentNode.removeChild(i),ju(n,r);break;case 22:n.memoizedState===null&&ju(n,r);break;case 30:Cl(n,n.return),ju(n,r);break;case 7:Cl(n,n.return);default:ju(n,r)}e=e.sibling}}function Mu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Mu(i,a,n),yl(4,a);break;case 1:if(Mu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){df(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)yo(l[i],c)}catch(e){df(r,r.return,e)}}s&&o&64&&xl(a),Sl(a,a.return);break;case 27:n&2&&Fl(a);case 5:a.tag!==5&&a.tag!==27||Tl(a),Mu(i,a,n),s&&r===null&&o&4&&kl(a),Sl(a,a.return);break;case 6:Tl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||X||Km(bm(c.ownerDocument),a.type,c),Mu(i,a,n),s&&r===null&&o&4&&kl(a),Sl(a,a.return);break;case 12:Mu(i,a,n);break;case 31:Mu(i,a,n),s&&o&4&&yu(i,a);break;case 13:Mu(i,a,n),s&&o&4&&bu(i,a);break;case 22:a.memoizedState===null&&Mu(i,a,n),Sl(a,a.return);break;case 30:Mu(i,a,n),Sl(a,a.return);break;case 7:Sl(a,a.return);default:Mu(i,a,n)}t=t.sibling}}function Nu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Oa(n))}function Pu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Oa(e))}function Fu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Iu(e,t,n,r),t=t.sibling;else i&&Zl(t)}function Iu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&J(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Fu(e,t,n,r),a&2048&&yl(9,t);break;case 1:Fu(e,t,n,r);break;case 3:Fu(e,t,n,r),i&&su&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Oa(a)));break;case 12:if(a&2048){Fu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){df(t,t.return,e)}}else Fu(e,t,n,r);break;case 31:Fu(e,t,n,r);break;case 13:Fu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&J(t),o._visibility&2?Fu(e,t,n,r):(o._visibility|=2,Lu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&J(s),o._visibility&2?Fu(e,t,n,r):Ru(e,t)),a&2048&&Nu(s,t);break;case 24:Fu(e,t,n,r),a&2048&&Pu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Wl(a.child,!0),Wl(t.child,!0))),Fu(e,t,n,r);break;default:Fu(e,t,n,r)}}function Lu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Lu(a,o,s,c,i),yl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Lu(a,o,s,c,i)):u._visibility&2?Lu(a,o,s,c,i):Ru(a,o),i&&l&2048&&Nu(o.alternate,o);break;case 24:Lu(a,o,s,c,i),i&&l&2048&&Pu(o.alternate,o);break;default:Lu(a,o,s,c,i)}t=t.sibling}}function Ru(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ru(n,r),i&2048&&Nu(r.alternate,r);break;case 24:Ru(n,r),i&2048&&Pu(r.alternate,r);break;default:Ru(n,r)}t=t.sibling}}var zu=8192;function Bu(e,t,n){if(e.subtreeFlags&zu)for(e=e.child;e!==null;)Vu(e,t,n),e=e.sibling}function Vu(e,t,n){switch(e.tag){case 26:Bu(e,t,n),e.flags&zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,wu,e.memoizedState,e.memoizedProps));break;case 5:Bu(e,t,n),e.flags&zu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=wu;wu=bm(e.stateNode.containerInfo),Bu(e,t,n),wu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=zu,zu=16777216,Bu(e,t,n),zu=r):Bu(e,t,n));break;case 30:if((e.flags&zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ll===null&&(Ll=new Map),Ll.set(r,i)}Bu(e,t,n);break;default:Bu(e,t,n)}}function Hu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Uu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Wu(e),e=e.sibling}function Wu(e){switch(e.tag){case 0:case 11:case 15:Uu(e),e.flags&2048&&bl(9,e,e.return);break;case 3:Uu(e);break;case 12:Uu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gu(e)):Uu(e);break;default:Uu(e)}}function Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:bl(8,t,t.return),Gu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Gu(t));break;default:Gu(t)}e=e.sibling}}function Ku(e,t){for(;ru!==null;){var n=ru;switch(n.tag){case 0:case 11:case 15:bl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Oa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ru=r;else a:for(n=e;ru!==null;){r=ru;var i=r.sibling,a=r.return;if(mu(r),r===n){ru=null;break a}if(i!==null){i.return=a,ru=i;break a}ru=a}}}var qu={getCacheForType:function(e){var t=xa(Ea),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xa(Ea).controller.signal}},Ju=typeof WeakMap==`function`?WeakMap:Map,Yu=0,Xu=null,Z=null,Q=0,Zu=0,Qu=null,$u=!1,ed=!1,td=!1,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=null,ud=null,dd=!1,fd=0,pd=0,md=1/0,hd=null,gd=null,_d=0,vd=null,yd=null,bd=0,xd=0,Sd=null,Cd=null,wd=null,Td=null,Ed=null,Dd=0,Od=null;function kd(){return Yu&2&&Q!==0?Q&-Q:R.T===null?vt():Mf()}function Ad(){if(sd===0){if(!(Q&536870912)||W){var e=nt;nt<<=1,!(nt&3932160)&&(nt=262144),sd=e}else sd=536870912}return e=Eo.current,e!==null&&(e.flags|=32),sd}function jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(hi(e.memoizedProps,n))),Td===null&&(Td=[]),Td.push(t.bind(null,r))}}function Md(e,t,n){(e===Xu&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)&&(Rd(e,0),Fd(e,Q,sd,!1)),dt(e,n),(!(Yu&2)||e!==Xu)&&(e===Xu&&(!(Yu&2)&&(ad|=n),rd===4&&Fd(e,Q,sd,!1)),wf(e))}function $(e,t,n){if(Yu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ot(e,t),a=r?Kd(e,t):Wd(e,t,!0),o=r;do{if(a===0){ed&&!r&&Fd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Pd(n))a=Wd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ld;var l=c.current.memoizedState.isDehydrated;if(l&&(Rd(c,s).flags|=256),s=Wd(c,s,!1),s!==2&&s!==6){if(td&&!l){c.errorRecoveryDisabledLanes|=o,ad|=o,a=4;break a}o=ud,ud=a,o!==null&&(ud===null?ud=o:ud.push.apply(ud,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Rd(e,0),Fd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Fd(r,t,sd,!$u);break a;case 2:ud=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=fd+300-ze(),10<a)){if(Fd(r,t,sd,!$u),at(r,0,!0)!==0)break a;bd=t,r.timeoutHandle=gp(Nd.bind(null,r,n,ud,hd,dd,t,sd,ad,cd,$u,o,`Throttled`,-0,0),a);break a}Nd(r,n,ud,hd,dd,t,sd,ad,cd,$u,o,null,-0,0)}break}}while(1);wf(e)}function Nd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_n},Ll=null,Vu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?fd-ze():(a&4194048)===a?pd-ze():0,m=eh(d,m),m!==null)?(bd=a,e.cancelPendingCommit=m($d.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Fd(e,a,o,!l)):$d(e,t,a,n,r,i,o,s,c,l,u,d)}function Pd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!zr(a(),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 Fd(e,t,n,r){t=st(e,t),t&=~od,t&=~ad,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&pt(e,n,t)}function Id(){return Yu&6?!0:(Tf(0,!1),!1)}function Ld(){if(Z!==null){if(Zu===0)var e=Z.return;else e=Z,pa=fa=null,ts(e),eo=null,to=0,e=Z;for(;e!==null;)vl(e.alternate,e),e=e.return;Z=null}}function Rd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bd=0,Ld(),Xu=e,Z=n=Ai(e.current,null),Q=t,Zu=0,Qu=null,$u=!1,ed=ot(e,t),td=!1,cd=sd=od=ad=id=rd=0,ud=ld=null,dd=!1,nd=st(e,t),Si(),n}function zd(e,t){K=null,R.H=dc,t===Wa||t===Ka?(t=Qa(),Zu=3):t===Ga?(t=Qa(),Zu=4):Zu=t===kc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Qu=t,Z===null&&(rd=1,Cc(e,Ri(t,e.current)))}function Bd(){var e=Eo.current;return e===null?!0:(Q&4194048)===Q?Do===null:(Q&62914560)===Q||Q&536870912?e===Do:!1}function Vd(){var e=R.H;return R.H=dc,e===null?dc:e}function Hd(){var e=R.A;return R.A=qu,e}function Ud(){rd=4,$u||(Q&4194048)!==Q&&Eo.current!==null||(ed=!0),!(id&134217727)&&!(ad&134217727)||Xu===null||Fd(Xu,Q,sd,!1)}function Wd(e,t,n){var r=Yu;Yu|=2;var i=Vd(),a=Hd();(Xu!==e||Q!==t)&&(hd=null,Rd(e,t)),t=!1;var o=rd;a:do try{if(Zu!==0&&Z!==null){var s=Z,c=Qu;switch(Zu){case 8:Ld(),o=6;break a;case 3:case 2:case 9:case 6:Eo.current===null&&(t=!0);var l=Zu;if(Zu=0,Qu=null,Xd(e,s,c,l),n&&ed){o=0;break a}break;default:l=Zu,Zu=0,Qu=null,Xd(e,s,c,l)}}Gd(),o=rd;break}catch(t){zd(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,Yu=r,R.H=i,R.A=a,Z===null&&(Xu=null,Q=0,Si()),o}function Gd(){for(;Z!==null;)Jd(Z)}function Kd(e,t){var n=Yu;Yu|=2;var r=Vd(),a=Hd();Xu!==e||Q!==t?(hd=null,md=ze()+500,Rd(e,t)):ed=ot(e,t);a:do try{if(Zu!==0&&Z!==null){t=Z;var o=Qu;b:switch(Zu){case 1:Zu=0,Qu=null,Xd(e,t,o,1);break;case 2:case 9:if(Ja(o)){Zu=0,Qu=null,Yd(t);break}t=function(){Zu!==2&&Zu!==9||Xu!==e||(Zu=7),wf(e)},o.then(t,t);break a;case 3:Zu=7;break a;case 4:Zu=5;break a;case 7:Ja(o)?(Zu=0,Qu=null,Yd(t)):(Zu=0,Qu=null,Xd(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Ym(s):c.stateNode.complete){Zu=0,Qu=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Zd(u))}break b}}Zu=0,Qu=null,Xd(e,t,o,5);break;case 6:Zu=0,Qu=null,Xd(e,t,o,6);break;case 8:Ld(),rd=6;break a;default:throw Error(i(462))}}qd();break}catch(t){zd(e,t)}while(1);return pa=fa=null,R.H=r,R.A=a,Yu=n,Z===null?(Xu=null,Q=0,Si(),rd):0}function qd(){for(;Z!==null&&!Le();)Jd(Z)}function Jd(e){var t=ll(e.alternate,e,nd);e.memoizedProps=e.pendingProps,t===null?Zd(e):Z=t}function Yd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Uc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=Uc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:ts(t);var r=t;r===$i&&(W?(oa(r),r.tag===5&&r.stateNode!=null&&(ea=r.stateNode)):(oa(r),W=!0));default:vl(n,t),t=Z=ji(t,nd),t=ll(n,t,nd)}e.memoizedProps=e.pendingProps,t===null?Zd(e):Z=t}function Xd(e,t,n,r){pa=fa=null,ts(t),eo=null,to=0;var i=t.return;try{if(Oc(e,i,t,n,Q)){rd=1,Cc(e,Ri(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;rd=1,Cc(e,Ri(n,e.current)),Z=null;return}t.flags&32768?(W||r===1?e=!0:ed||Q&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=Eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Qd(t,e)):Zd(t)}function Zd(e){var t=e;do{if(t.flags&32768){Qd(t,$u);return}e=t.return;var n=gl(t.alternate,t,nd);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);rd===0&&(rd=5)}function Qd(e,t){do{var n=_l(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);rd=6,Z=null}function $d(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do cf();while(_d!==0);if(Yu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Xu&&(Z=Xu=null,Q=0),yd=t,vd=e,bd=n,Sd=a,Cd=r,ef(e,t,n,s,c,l,f)}}function ef(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(xd=s,s|=xi,ft(e,n,s,r,i,a),Td=null,(n&335544064)===n?(Ed=ja(e),r=10262):(Ed=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,_f(Ue,function(){return lf(),null})):(e.callbackNode=null,e.callbackPriority=0),Il=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=R.T,R.T=null,i=z.p,z.p=2,a=Yu,Yu|=4;try{cu(e,t,n)}finally{Yu=a,z.p=i,R.T=r}}_d=1,Il?wd=Mp(o,e.containerInfo,Ed,rf,af,nf,of,lf,tf,null,null):(rf(),af(),of())}function tf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function nf(){_d===3&&(_d=0,ku(yd,vd),_d=4)}function rf(){if(_d===1){_d=0;var e=vd,t=yd,n=bd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=R.T,R.T=null;var i=z.p;z.p=2;var a=Yu;Yu|=4;try{au=ou=!1,Tu(t,e,n),n=cp;var o=Gr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Wr(s.ownerDocument.documentElement,s)){if(c!==null&&Kr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Ur(s,h),v=Ur(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{Yu=a,z.p=i,R.T=r}}e.current=t,_d=2}}function af(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=R.T,R.T=null;var r=z.p;z.p=2;var i=Yu;Yu|=4;try{uu(e,t.alternate,t)}finally{Yu=i,z.p=r,R.T=n}}_d=3}}function of(){if(_d===4||_d===3){_d=0;var e=wd;wd=null,Re();var t=vd,n=yd,r=bd,i=Cd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,sf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),_t(r),n=n.stateNode,Ye&&typeof Ye.onCommitFiberRoot==`function`)try{Ye.onCommitFiberRoot(Je,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=R.T,a=z.p,z.p=2,R.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{R.T=n,z.p=a}}if(i=Td,o=Ed,Ed=null,i!==null&&(Td=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);bd&3&&cf(),wf(t),a=t.pendingLanes,r&261930&&a&42?t===Od?Dd++:(Dd=0,Od=t):(Dd=0,Od=null),Tf(0,!1)}}function sf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Oa(t)))}function cf(){return wd!==null&&(wd.skipTransition(),wd=null),rf(),af(),of(),lf()}function lf(){if(_d!==5)return!1;var e=vd,t=xd;xd=0;var n=_t(bd),r=R.T,a=z.p;try{z.p=32>n?32:n,R.T=null,n=Sd,Sd=null;var o=vd,s=bd;if(_d=0,yd=vd=null,bd=0,Yu&6)throw Error(i(331));var c=Yu;if(Yu|=4,Wu(o.current),Iu(o,o.current,s,n),Yu=c,Tf(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot==`function`)try{Ye.onPostCommitFiberRoot(Je,o)}catch{}return!0}finally{z.p=a,R.T=r,sf(e,t)}}function uf(e,t,n){t=Ri(n,t),t=Tc(e.stateNode,t,2),e=po(e,t,2),e!==null&&(dt(e,2),wf(e))}function df(e,t,n){if(e.tag===3)uf(e,e,n);else for(;t!==null;){if(t.tag===3){uf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=Ri(n,e),n=Ec(2),r=po(t,n,2),r!==null&&(Dc(n,r,t,e),dt(r,2),wf(r));break}}t=t.return}}function ff(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ju;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)||(td=!0,i.add(n),e=pf.bind(null,e,t,n),t.then(e,e))}function pf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Q&n)===n&&(rd===4||rd===3&&(Q&62914560)===Q&&300>ze()-fd?Yu&2?od|=n:Rd(e,0):od|=n,cd===Q&&(cd=0)),wf(e)}function mf(e,t){t===0&&(t=lt()),e=wi(e,t),e!==null&&(dt(e,t),wf(e))}function hf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mf(e,n)}function gf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),mf(e,n)}function _f(e,t){return Fe(e,t)}var vf=null,yf=null,bf=!1,xf=!1,Sf=!1,Cf=0;function wf(e){e!==yf&&e.next===null&&(yf===null?vf=yf=e:yf=yf.next=e),xf=!0,bf||(bf=!0,jf())}function Tf(e,t){if(!Sf&&xf){Sf=!0;do for(var n=!1,r=vf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Af(r,a))}else a=Q,a=at(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ot(r,a)||(n=!0,Af(r,a))}r=r.next}while(n);Sf=!1}}function Ef(){Df()}function Df(){xf=bf=!1;var e=0;Cf!==0&&hp()&&(e=Cf);for(var t=ze(),n=null,r=vf;r!==null;){var i=r.next,a=Of(r,t);a===0?(r.next=null,n===null?vf=i:n.next=i,i===null&&(yf=n)):(n=r,(e!==0||a&3)&&(xf=!0)),r=i}_d!==0&&_d!==5||Tf(e,!1),Cf!==0&&(Cf=0)}function Of(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ct(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Q,n=at(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ie(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ot(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ie(r),_t(n)){case 2:case 8:n=He;break;case 32:n=Ue;break;case 268435456:n=Ge;break;default:n=Ue}return r=kf.bind(null,e),n=Fe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ie(r),e.callbackPriority=2,e.callbackNode=null,2}function kf(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(cf()&&e.callbackNode!==n)return null;var r=Q;return r=at(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:($(e,r,t),Of(e,ze()),e.callbackNode!=null&&e.callbackNode===n?kf.bind(null,e):null)}function Af(e,t){if(cf())return null;$(e,t,!0)}function jf(){bp(function(){Yu&6?Fe(Ve,Ef):Df()})}function Mf(){if(Cf===0){var e=Pa;e===0&&(e=tt,tt<<=1,!(tt&261888)&&(tt=256)),Cf=e}return Cf}function Nf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:gn(e)}function Pf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Nf((i[St]||null).action),o=r.submitter;o&&(t=(t=o[St]||null)?Nf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Rn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Cf!==0){var e=new FormData(i,o);Zs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Zs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ff=0;Ff<fi.length;Ff++){var If=fi[Ff];pi(If.toLowerCase(),`on`+(If[0].toUpperCase()+If.slice(1)))}pi(ii,`onAnimationEnd`),pi(ai,`onAnimationIteration`),pi(oi,`onAnimationStart`),pi(`dblclick`,`onDoubleClick`),pi(`focusin`,`onFocus`),pi(`focusout`,`onBlur`),pi(si,`onTransitionRun`),pi(ci,`onTransitionStart`),pi(li,`onTransitionCancel`),pi(ui,`onTransitionEnd`),zt(`onMouseEnter`,[`mouseout`,`mouseover`]),zt(`onMouseLeave`,[`mouseout`,`mouseover`]),zt(`onPointerEnter`,[`pointerout`,`pointerover`]),zt(`onPointerLeave`,[`pointerout`,`pointerover`]),Rt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Rt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Rt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Rt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Rt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Rt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Lf=`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(` `),Rf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Lf));function zf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){vi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){vi(e)}i.currentTarget=null,a=c}}}}function Bf(e,t){var n=t[wt];n===void 0&&(n=t[wt]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,It.forEach(function(t){t!==`selectionchange`&&(Rf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!Dn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=At(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}wn(function(){var r=a,i=yn(n),o=[];a:{var c=di.get(e);if(c!==void 0){var l=Rn,u=e;switch(e){case`keypress`:if(Nn(n)===0)break a;case`keydown`:case`keyup`:l=tr;break;case`focusin`:u=`focus`,l=Kn;break;case`focusout`:u=`blur`,l=Kn;break;case`beforeblur`:case`afterblur`:l=Kn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Gn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=ir;break;case ii:case ai:case oi:l=qn;break;case ui:l=ar;break;case`scroll`:case`scrollend`:l=Bn;break;case`wheel`:l=or;break;case`copy`:case`cut`:case`paste`:l=Jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=nr;break;case`submit`:l=rr;break;case`toggle`:case`beforetoggle`:l=sr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Tn(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==vn&&(u=n.relatedTarget||n.fromElement)&&(At(u)||u[Ct]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?At(l):null,l!==null&&(f=s(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=nr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Mt(c),h=l==null?u:Mt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,At(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Jf):null,c!==null&&Yf(o,u,c,d,!1),l!==null&&f!==null&&Yf(o,f,l,d,!0)))}a:{if(c=r?Mt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Dr;else if(xr(c)){if(Or)_=Lr;else{_=Fr;var v=Pr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&pn(r.elementType)&&(_=Dr):_=Ir;if(_&&=_(e,r)){Sr(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Mt(r):window,e){case`focusin`:(xr(v)||v.contentEditable===`true`)&&(Jr=v,Yr=r,Xr=null);break;case`focusout`:Xr=Yr=Jr=null;break;case`mousedown`:Zr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Zr=!1,Qr(o,n,i);break;case`selectionchange`:if(qr)break;case`keydown`:case`keyup`:Qr(o,n,i)}var y;if(lr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else _r?hr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(fr&&n.locale!==`ko`&&(_r||b!==`onCompositionStart`?b===`onCompositionEnd`&&_r&&(y=Mn()):(kn=i,An=`value`in kn?kn.value:kn.textContent,_r=!0)),v=qf(r,b),0<v.length&&(b=new Yn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=gr(n),y!==null&&(b.data=y)))),(y=dr?vr(e,n):yr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Yn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Pf(o,e,r,n,i)}zf(o,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Tn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=Tn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Tn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=Tn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
|
|
10
|
+
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||ln(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&ln(e,``+r);else return;break;case`className`:qt(e,`class`,r);break;case`tabIndex`:qt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:qt(e,n,r);break;case`style`:fn(e,r,o);return;case`data`:if(t!==`object`){qt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=gn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,a.name,a,null),ep(e,t,`formEncType`,a.formEncType,a,null),ep(e,t,`formMethod`,a.formMethod,a,null),ep(e,t,`formTarget`,a.formTarget,a,null)):(ep(e,t,`encType`,a.encType,a,null),ep(e,t,`method`,a.method,a,null),ep(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=gn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=_n);return;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=gn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Kt(e,`popover`,r);break;case`xlinkActuate`:Jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Kt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=mn.get(n)||n,Kt(e,n,r);else return}Wt=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:fn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)ln(e,r);else if(typeof r==`number`||typeof r==`bigint`)ln(e,``+r);else return;break;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=_n);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Lt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[St]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Wt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Kt(e,n,r)}return}Wt=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Bf(`error`,e),Bf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ep(e,t,o,s,n,null)}}a&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:Bf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:ep(e,t,r,d,n,null)}}rn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Bf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&on(e,!!r,n,!0):on(e,!!r,t,!1);return;case`textarea`:for(s in Bf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:ep(e,t,s,c,n,null)}cn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Bf(`cancel`,e),Bf(`close`,e);break;case`iframe`:case`object`:Bf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Lf.length;r++)Bf(Lf[r],e);break;case`image`:Bf(`error`,e),Bf(`load`,e);break;case`details`:Bf(`toggle`,e);break;case`embed`:case`source`:case`link`:Bf(`error`,e),Bf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ep(e,t,u,r,n,null)}return;default:if(pn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Wt=!0),o=m;break;case`name`:m!==f&&(Wt=!0),a=m;break;case`checked`:m!==f&&(Wt=!0),u=m;break;case`defaultChecked`:m!==f&&(Wt=!0),d=m;break;case`value`:m!==f&&(Wt=!0),s=m;break;case`defaultValue`:m!==f&&(Wt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}nn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ep(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Wt=!0),p=o;break;case`defaultValue`:o!==l&&(Wt=!0),c=o;break;case`multiple`:o!==l&&(Wt=!0),s=o;default:o!==l&&ep(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?on(e,!!n,n?[]:``,!1):on(e,!!n,t,!0)):on(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Wt=!0),p=a;break;case`defaultValue`:a!==o&&(Wt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ep(e,t,s,a,r,o)}sn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Wt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(pn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[xt]=r,n[St]=t,np(n,e,t),Pt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(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===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[B]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=At(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Zp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),kt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[B])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===_n&&(e.onclick=null),kt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=z.d;z.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Id();return e||t}function Cm(e){var t=jt(e);t!==null&&t.tag===5&&t.type===`form`?$s(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=tn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Pt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+tn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+tn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+tn(n.imageSizes)+`"]`)):i+=`[href="`+tn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Ot]=!0,o.onload=o.onerror=function(){Ft(o)}),Pt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+tn(r)+`"][href="`+tn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Pt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Nt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Pt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Nt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Pt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Nt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Pt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=xe.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Nt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=Nt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Nt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+tn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ot]){r.loading=1;return}}else t=e.createElement(`link`),t[Ot]=!0,t.onload=t.onerror=Ft.bind(null,t),np(t,`link`,n),Pt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+tn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+tn(n.href)+`"]`);if(r)return t.instance=r,Pt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Pt(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Pt(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Pt(a),a):(r=n,(a=vm.get(o))&&(r=D({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Pt(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[B]||a[xt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Pt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:P,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ut(0),this.hiddenUpdates=ut(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ki(3,null,null,t),e.current=a,a.stateNode=e,t=Da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},lo(a),e}function uh(e){return e?(e=Di,e):Di}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=fo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=po(e,r,t),n!==null&&(Md(n,e,t),mo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=wi(e,67108864);t!==null&&Md(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=kd();t=gt(t);var n=wi(e,t);n!==null&&Md(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=R.T;R.T=null;var a=z.p;try{z.p=2,yh(e,t,n,r)}finally{z.p=a,R.T=i}}function vh(e,t,n,r){var i=R.T;R.T=null;var a=z.p;try{z.p=8,yh(e,t,n,r)}finally{z.p=a,R.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=jt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=it(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ze(o);s.entanglements[1]|=c,o&=~c}wf(a),!(Yu&6)&&(md=ze()+500,Tf(0,!1))}}break;case 31:case 13:s=wi(a,2),s!==null&&Md(s,a,2),Id(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=yn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=At(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(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 xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Be()){case Ve:return 2;case He:return 8;case Ue:case We:return 32;case Ge:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=jt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=At(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,yt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,yt(e.priority,function(){hh(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 Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);vn=r,n.target.dispatchEvent(r),vn=null}else return t=jt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=jt(n);a!==null&&(e.splice(t,3),t-=3,Zs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[St]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[St]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,kd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Id(),t[Ct]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=vt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.1`)throw Error(i(527,Kh,`19.3.1`));z.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:R,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Je=Jh.inject(qh),Ye=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=bc,s=xc,c=Sc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[Ct]=t.current,Uf(e),new Wh(t)}})),m=n(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h={name:`archive`,size:24,node:[[`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`}]]};h.node;var g=r(h),_={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};_.node;var v=r(_),y={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};y.node;var b=r(y),x={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};x.node;var S=r(x),C={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};C.node;var w=r(C),T={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};T.node;var E=r(T),D={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};D.node;var O=r(D),k={name:`bug`,size:24,node:[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]};k.node;var A=r(k),j={name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]};j.node;var M=r(j),N={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};N.node;var ee=r(N),P={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};P.node;var F=r(P),te={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};te.node;var ne=r(te),re={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};re.node;var I=r(re),L={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};L.node;var ie=r(L),ae={name:`circle-alert`,size:24,node:[[`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`}]],aliases:[`alert-circle`]};ae.node;var oe=r(ae),se={name:`circle-check-big`,size:24,node:[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-circle`]};se.node;var ce=r(se),le={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};le.node;var ue=r(le),de={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};de.node;var fe=r(de),R={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};R.node;var z=r(R),pe={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};pe.node;var me=r(pe),he={name:`cloud`,size:24,node:[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]};he.node;var ge=r(he),_e={name:`code-xml`,size:24,node:[[`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`}]],aliases:[`code-2`]};_e.node;var ve=r(_e),ye={name:`copy`,size:24,node:[[`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`}]]};ye.node;var be=r(ye),xe={name:`corner-down-right`,size:24,node:[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]};xe.node;var Se=r(xe),Ce={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};Ce.node;var we=r(Ce),Te={name:`database`,size:24,node:[[`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`}]]};Te.node;var Ee=r(Te),De={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};De.node;var Oe=r(De),ke={name:`ellipsis`,size:24,node:[[`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`}]],aliases:[`more-horizontal`]};ke.node;var Ae=r(ke),je={name:`external-link`,size:24,node:[[`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`}]]};je.node;var Me=r(je),Ne={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Ne.node;var Pe=r(Ne),Fe={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Fe.node;var Ie=r(Fe),Le={name:`file-diff`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]};Le.node;var Re=r(Le),ze={name:`file-output`,size:24,node:[[`path`,{d:`M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127`,key:`wfxp4w`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 11-3 3`,key:`1dgrs4`}],[`path`,{d:`m5 17-3-3h10`,key:`1mvvaf`}]]};ze.node;var Be=r(ze),Ve={name:`file-pen`,size:24,node:[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]],aliases:[`file-edit`]};Ve.node;var He=r(Ve),Ue={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Ue.node;var We=r(Ue),Ge={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};Ge.node;var Ke=r(Ge),qe={name:`folder-open`,size:24,node:[[`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`}]]};qe.node;var Je=r(qe),Ye={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`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`}]]};Ye.node;var Xe=r(Ye),Ze={name:`folder-search`,size:24,node:[[`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.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]};Ze.node;var Qe=r(Ze),$e={name:`folder`,size:24,node:[[`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`}]]};$e.node;var et=r($e),tt={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};tt.node;var nt=r(tt),rt={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};rt.node;var it=r(rt),at={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};at.node;var ot=r(at),st={name:`globe`,size:24,node:[[`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`}]]};st.node;var ct=r(st),lt={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};lt.node;var ut=r(lt),dt={name:`inbox`,size:24,node:[[`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`}]]};dt.node;var ft=r(dt),pt={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};pt.node;var mt=r(pt),ht={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};ht.node;var gt=r(ht),_t={name:`layers`,size:24,node:[[`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:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};_t.node;var vt=r(_t),yt={name:`library`,size:24,node:[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]};yt.node;var bt=r(yt),xt={name:`link-2`,size:24,node:[[`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`}]]};xt.node;var St=r(xt),Ct={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]};Ct.node;var wt=r(Ct),Tt={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Tt.node;var Et=r(Tt),Dt={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Dt.node;var B=r(Dt),Ot={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};Ot.node;var kt=r(Ot),At={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};At.node;var jt=r(At),Mt={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};Mt.node;var Nt=r(Mt),Pt={name:`monitor`,size:24,node:[[`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`}]]};Pt.node;var Ft=r(Pt),It={name:`panel-left-close`,size:24,node:[[`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`}]],aliases:[`sidebar-close`]};It.node;var Lt=r(It),Rt={name:`panel-left-open`,size:24,node:[[`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`}]],aliases:[`sidebar-open`]};Rt.node;var zt=r(Rt),Bt={name:`panel-right-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]};Bt.node;var Vt=r(Bt),Ht={name:`panel-right-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]};Ht.node;var Ut=r(Ht),Wt={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};Wt.node;var Gt=r(Wt),Kt={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};Kt.node;var qt=r(Kt),Jt={name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]};Jt.node;var Yt=r(Jt),Xt={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};Xt.node;var Zt=r(Xt),Qt={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Qt.node;var $t=r(Qt),en={name:`refresh-cw`,size:24,node:[[`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`}]]};en.node;var tn=r(en),nn={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};nn.node;var rn=r(nn),an={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};an.node;var on=r(an),sn={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};sn.node;var cn=r(sn),ln={name:`shield-alert`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]};ln.node;var un=r(ln),dn={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};dn.node;var fn=r(dn),pn={name:`shield-question-mark`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`shield-question`]};pn.node;var mn=r(pn),hn={name:`shuffle`,size:24,node:[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]};hn.node;var gn=r(hn),_n={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};_n.node;var vn=r(_n),yn={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};yn.node;var bn=r(yn),xn={name:`square-pen`,size:24,node:[[`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.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};xn.node;var Sn=r(xn),Cn={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};Cn.node;var wn=r(Cn),Tn={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};Tn.node;var En=r(Tn),Dn={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Dn.node;var On=r(Dn),kn={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};kn.node;var An=r(kn),jn={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};jn.node;var Mn=r(jn),Nn={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Nn.node;var Pn=r(Nn),Fn={name:`wifi-off`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Fn.node;var In=r(Fn),Ln={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};Ln.node;var Rn=r(Ln),zn={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};zn.node;var Bn=r(zn),V=t(o(),1),Vn=t(m(),1),Hn=e=>Symbol.iterator in e,Un=e=>`entries`in e,Wn=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},Gn=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function Kn(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:Hn(e)&&Hn(t)?Un(e)&&Un(t)?Wn(e,t):Gn(e,t):Wn({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function qn(e){let t=V.useRef(void 0);return n=>{let r=e(n);return Kn(t.current,r)?t.current:t.current=r}}var Jn=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Yn=(e=>e?Jn(e):Jn),Xn=e=>e;function Zn(e,t=Xn){let n=V.useSyncExternalStore(e.subscribe,V.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return V.useDebugValue(n),n}var Qn=e=>{let t=Yn(e),n=e=>Zn(t,e);return Object.assign(n,t),n},$n=(e=>e?Qn(e):Qn);function er(){return typeof window>`u`||typeof window.matchMedia!=`function`?`dark`:window.matchMedia(`(prefers-color-scheme: light)`).matches?`light`:`dark`}function tr(e){return e===`system`?er():e}var nr={light:`#FAF9F7`,dark:`#1A1917`};function rr(e){document.documentElement.setAttribute(`data-theme`,e);let t=document.querySelector(`meta[name="theme-color"]`);t?t.setAttribute(`content`,nr[e]):console.error(`applyTheme: index.html declares no <meta name="theme-color">, so the browser frame keeps its default colour instead of the app canvas. Restore the tag in src/gaia/apps/webui/index.html.`)}function ir(){let e=window.gaiaWindow?.titleBar;e&&e!==`native`&&(document.documentElement.dataset.titlebar=e)}function ar(){let e=document.documentElement,t=getComputedStyle(e),n=t.getPropertyValue(`--bg-primary`).trim(),r=t.getPropertyValue(`--text-primary`).trim();window.gaiaWindow?.titleBar===`overlay`&&n&&r&&window.gaiaWindow.setColors({color:n,symbolColor:r}).catch(e=>{console.error(`syncTitleBar: the desktop window controls did not take the colors`,e)}),e.dataset.palette&&n&&document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,n)}var or=[{id:`default`,name:`Warm gray`,swatch:[`#FAF9F7`,`#B08D57`,`#D4B47E`]},{id:`stone`,name:`Stone and ink`,swatch:[`#FAFAF9`,`#2B2B29`,`#E4E4E0`]},{id:`marble`,name:`Blue marble`,swatch:[`#F8FAFC`,`#1F5FA8`,`#5B9BE6`]},{id:`glacier`,name:`Glacier`,swatch:[`#F7FAFA`,`#2C6E78`,`#5FB4BF`]},{id:`forest`,name:`Forest floor`,swatch:[`#F8F9F7`,`#3A6B48`,`#7DBA8C`]},{id:`sage`,name:`Sage and mist`,swatch:[`#F9F9F7`,`#5E7A63`,`#9BB5A0`]},{id:`basalt`,name:`Basalt and lichen`,swatch:[`#F8F8F6`,`#6B7A2E`,`#B4C36A`]},{id:`gold`,name:`Graphite and gold`,swatch:[`#F7F7F8`,`#D9A300`,`#F2C230`]},{id:`dusk`,name:`Dusk`,swatch:[`#F9F9FB`,`#4F5A9C`,`#97A1E0`]}],sr=new Set([...or.map(e=>e.id),`custom`]),cr={accent:`#1F5FA8`,base:`#6B7A8C`},lr=/^#[0-9a-fA-F]{6}$/,ur=e=>typeof e==`string`&&lr.test(e),dr=e=>[1,3,5].map(t=>parseInt(e.slice(t,t+2),16)),fr=e=>`#`+e.map(e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`)).join(``).toUpperCase(),pr=(e,t,n)=>{let r=dr(e),i=dr(t);return fr([0,1,2].map(e=>r[e]+(i[e]-r[e])*n))},mr=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},hr=e=>{let[t,n,r]=dr(e).map(mr);return .2126*t+.7152*n+.0722*r};function gr(e,t){let[n,r]=[hr(e),hr(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)}function _r(e,t,n,r){let i=e;for(let a=.02;Math.min(...t.map(e=>gr(i,e)))<n&&a<=1;a+=.02)i=pr(e,r,a);return i}var vr=(e,t)=>{let[n,r,i]=dr(e);return`rgba(${n}, ${r}, ${i}, ${t})`};function yr(e,t){let n=t===`dark`,r=n?`#FFFFFF`:`#000000`,i=n?pr(`#151515`,e.base,.1):pr(`#FAFAFA`,e.base,.06),a=pr(n?`#111111`:`#F1F1F1`,e.base,.1),o=n?pr(`#ECECEC`,e.base,.06):pr(`#1B1B1B`,e.base,.12),s=n?pr(i,o,.06):`#FFFFFF`,c=pr(i,o,n?.09:.06),l=pr(i,o,n?.14:.1),u=pr(i,o,n?.11:.07),d=pr(i,a,.5),f=n?pr(i,`#000000`,.15):pr(i,a,.8),p=[i,a,s,c,d,u,f,l],m=_r(n?pr(`#A3A3A3`,e.base,.12):pr(`#5E5E5E`,e.base,.18),p,4.6,r),h=_r(pr(i,o,n?.24:.26),[i,s,a],1.6,r),g=_r(e.accent,[i],3,r),_=_r(g,[i,s,a],4.6,r),v=pr(s,g,n?.22:.14),y=pr(s,g,n?.3:.22);return{"--bg-primary":i,"--bg-secondary":d,"--bg-tertiary":u,"--bg-sidebar":a,"--bg-input":s,"--bg-card":s,"--bg-hover":c,"--bg-active":l,"--bg-user-msg":s,"--bg-recessed":f,"--text-primary":o,"--text-secondary":m,"--text-muted":m,"--border":h,"--border-light":h,"--border-recessed":h,"--accent":_,"--accent-light":pr(g,`#FFFFFF`,.18),"--accent-solid":g,"--accent-dim":vr(g,.16),"--accent-dim2":vr(g,.08),"--accent-selection":vr(g,.26),"--accent-ring":vr(g,.38),"--accent-fill":v,"--accent-fill-text":_r(_,[v,y],4.6,r),"--accent-fill-hover":y,"--tint-subtle":vr(o,.03),"--tint-hover":vr(o,n?.06:.05),...n?{"--text-inverse":i,"--switch-knob":o}:{}}}var br=Object.keys(yr(cr,`dark`));function xr(e,t,n){let r=document.documentElement;for(let e of br)r.style.removeProperty(e);if(e==="default"?delete r.dataset.palette:r.dataset.palette=e,e===`custom`)for(let[e,i]of Object.entries(yr(t,n)))r.style.setProperty(e,i);ar()}var Sr={meta:{code:`ar`,nativeName:`العربية`,englishName:`Arabic`,dir:`rtl`,showEnglishInBrackets:!0},messages:{"sidebar.label":`المحادثات`,"sidebar.expand":`توسيع الشريط الجانبي`,"sidebar.collapse":`طي الشريط الجانبي`,"sidebar.search":`البحث في المحادثات`,"sidebar.newChat":`محادثة جديدة`,"sidebar.memory":`الذاكرة`,"sidebar.schedules":`المهام المجدولة`,"sidebar.documents":`المستندات`,"sidebar.recent":`المحادثات الأخيرة`,"sidebar.noMatch":`لا توجد محادثات مطابقة.`,"sidebar.searching":`جارٍ البحث داخل المحادثات…`,"sidebar.searchCapped":`نعرض أحدث {n} محادثة تذكر هذا. اكتب المزيد لتضييق النتائج.`,"sidebar.matchCount.one":`المحادثات المطابقة: {n}`,"sidebar.matchCount.other":`المحادثات المطابقة: {n}`,"sidebar.empty":`لا توجد محادثات بعد.`,"sidebar.group.needsYou":`بانتظارك`,"sidebar.group.pinned":`المثبّتة`,"sidebar.group.today":`اليوم`,"sidebar.group.yesterday":`أمس`,"sidebar.group.prev7":`آخر 7 أيام`,"sidebar.group.prev30":`آخر 30 يومًا`,"sidebar.group.older":`أقدم`,"sidebar.hideBackground":`إخفاء عمليات الخلفية`,"sidebar.showBackground.one":`إظهار عمليات الخلفية: {n}`,"sidebar.showBackground.other":`إظهار عمليات الخلفية: {n}`,"sidebar.notifications":`الإشعارات`,"sidebar.notificationsUnread":`الإشعارات، غير المقروءة: {n}`,"sidebar.mobileAccess":`الوصول من الهاتف`,"sidebar.mobileAccessOn":`الوصول من الهاتف مفعّل`,"sidebar.settings":`الإعدادات`,"row.status.running":`قيد التشغيل`,"row.status.queued":`بانتظار معالج الرسومات`,"row.status.waiting":`بانتظارك`,"row.status.done":`اكتملت`,"row.status.failed":`فشلت`,"row.unread":`غير مقروءة`,"row.private":`محادثة خاصة`,"row.rename":`إعادة تسمية`,"row.renameAria":`إعادة تسمية {title}`,"row.saveName":`حفظ الاسم`,"row.cancelRename":`إلغاء إعادة التسمية`,"row.moreActions":`مزيد من الإجراءات لـ {title}`,"row.actions":`إجراءات المحادثة`,"row.pin":`تثبيت`,"row.unpin":`إلغاء التثبيت`,"row.pinToTop":`تثبيت في الأعلى`,"row.pinAria":`تثبيت {title}`,"row.unpinAria":`إلغاء تثبيت {title}`,"row.delete":`حذف`,"row.deleteAria":`حذف {title}`,"row.deleteConfirm":`حذف؟`,"row.confirmDeleteAria":`تأكيد حذف {title}`,"row.clickAgain":`انقر مرة أخرى للحذف`,"row.tapAgain":`{label} اضغط مرة أخرى`,"newChat.label":`محادثة جديدة`,"newChat.greeting.morning":`صباح الخير. ما الذي سنعمل عليه؟`,"newChat.greeting.afternoon":`مساء الخير. ما الذي سنعمل عليه؟`,"newChat.greeting.evening":`مساء الخير. ما الذي سنعمل عليه؟`,"newChat.warmup.ready":`جارٍ تجهيز GAIA… {s} ث`,"newChat.warmup.loading":`جارٍ تحميل {model}… {s} ث`,"newChat.warmup.loadingOn":`جارٍ تحميل {model} على {where}… {s} ث`,"device.gpu":`معالج الرسومات GPU`,"device.npu":`المعالج العصبي NPU`,"device.cpu":`المعالج المركزي CPU`,"newChat.assistantUnavailable":`لم يبدأ مساعد GAIA بعد.`,"newChat.tryAgain":`إعادة المحاولة`,"newChat.details":`التفاصيل`,"newChat.docs.forChat":`مستندات هذه المحادثة`,"newChat.docs.dontAttach":`عدم إرفاق {name}`,"newChat.docs.more.one":`مستندات أخرى في مكتبتك: {n}.`,"newChat.docs.more.other":`مستندات أخرى في مكتبتك: {n}.`,"newChat.docs.library.one":`عدد المستندات في مكتبتك: {n}، ولا تبحث هذه المحادثة إلا في المستندات التي ترفقها بها.`,"newChat.docs.library.other":`عدد المستندات في مكتبتك: {n}، ولا تبحث هذه المحادثة إلا في المستندات التي ترفقها بها.`,"newChat.docs.attachIt":`إرفاقه`,"newChat.docs.attachAll":`إرفاق المستندات كلها ({n})`,"newChat.docs.choose":`اختيار`,"newChat.setupFailed.title":`لم يكتمل الإعداد الأولي لـ GAIA، لذا ستفشل المحادثة التي تستخدم نموذج هذا الجهاز.`,"newChat.setupFailed.hint":`استخدم نموذجًا سحابيًا، أو اختر نموذجًا أصغر.`,"newChat.setupFailed.choose":`اختيار نموذج`,"newChat.cardsLabel":`أفكار للبدء`,"card.document-brief.title":`اسأل عن مستنداتك`,"card.document-brief.note.one":`المستندات المفهرسة: {n}`,"card.document-brief.note.other":`المستندات المفهرسة: {n}`,"card.inbox-triage.title":`فرز بريدي الوارد`,"card.inbox-triage.note":`حساب البريد المتصل`,"card.research-report.title":`البحث في موضوع`,"card.research-report.note":`تقرير موثّق بالمصادر من الويب`,"card.coding.title":`العمل على الشيفرة`,"card.coding.note":`في {folder}`,"card.summarize.title":`تلخيص محتوى`,"card.summarize.note":`مستند أو نص تفريغ أو رسالة بريد`,"card.check-in.title":`المتابعة`,"card.check-in.note":`تابع من حيث توقفت`,"composer.placeholder":`اسأل GAIA عن أي شيء`,"composer.reply":`الرد على GAIA`,"composer.queueNext":`أضف رسالتك التالية إلى قائمة الانتظار`,"composer.starting":`جارٍ تشغيل GAIA…`,"composer.message":`الرسالة`,"composer.attached":`الملفات المرفقة`,"composer.uploading":`جارٍ الرفع…`,"composer.remove":`إزالة {name}`,"composer.tooLong":`الرسالة أطول من أن تُرسل: عدد الأحرف {sent} والحد الأقصى {max}.`,"composer.tooLongHint":`احفظها في ملف وأرفقه بزر +، وسيتمكن GAIA من قراءتها كاملة.`,"composer.attach":`إرفاق ملفات`,"composer.queue":`إضافة الرسالة إلى قائمة الانتظار`,"composer.queueTitle":`أضفها إلى قائمة الانتظار لتُرسل عند انتهاء هذا الرد (Enter)`,"composer.stop":`إيقاف`,"composer.stopping":`جارٍ الإيقاف…`,"composer.send":`إرسال`,"msg.sent":`أُرسلت في {time}`,"msg.replied":`تم الرد في {time}`,"msg.thinking":`جارٍ التفكير...`,"msg.resend":`إعادة إرسال الرسالة`,"msg.copy":`نسخ الرسالة`,"msg.copied":`تم النسخ!`,"msg.copiedAria":`تم النسخ إلى الحافظة`,"msg.delete":`حذف الرسالة`,"msg.confirmDelete":`انقر مرة أخرى للتأكيد`,"msg.confirmDeleteAria":`تأكيد حذف الرسالة`,"msg.error":`حدث خطأ ما`,"msg.showAll":`عرض الكل`,"msg.showLess":`عرض أقل`,"msg.stopped":`تم الإيقاف`,"msg.stoppedUnconfirmed":`تم الإيقاف. لم يؤكد GAIA الإيقاف، لذا قد تنقص بعض الخطوات هنا. أعد تحميل المحادثة لترى ما حفظه.`,"msg.stoppedError":`تم الإيقاف. أبلغ GAIA عن خطأ أثناء الإيقاف: {error}`,"msg.about":`حول هذه الإجابة`,"msg.timestamp":`وقت الرسالة`,"code.copy":`نسخ`,"citation.open":`فتح {name}`,"citation.openPage":`فتح الصفحة {page}`,"code.copied":`تم النسخ`,"code.copyAria":`نسخ الشيفرة`,"retry.button":`إعادة المحاولة بنموذج آخر`,"retry.head":`إعادة المحاولة باستخدام…`,"activity.thinking":`جارٍ التفكير`,"activity.thought":`فكّر`,"activity.thoughtFor":`فكّر لمدة {time}`,"activity.waiting":`بانتظارك`,"activity.usedSkill":`استخدم مهارة {name}`,"activity.blocked":`محظور بموجب السياسة`,"activity.hitError":`واجه خطأ`,"activity.madePlan":`وضع خطة`,"activity.thoughtThrough":`فكّر في الأمر`,"activity.summarySep":`، `,"activity.summaryMore":`{list} و{n} أخرى`,"activity.filterPlaceholder":`تصفية الخطوات…`,"activity.filterByTool":`التصفية حسب اسم الأداة`,"activity.filterByStatus":`التصفية حسب الحالة`,"activity.filter.all":`الكل`,"activity.filter.success":`نجحت`,"activity.filter.error":`خطأ`,"activity.identicalCalls":`استدعاءات متطابقة: {n}`,"activity.detail.tool":`الأداة`,"activity.detail.via":`عبر {server}`,"activity.detail.arguments":`الوسائط`,"activity.detail.output":`المخرجات`,"activity.detail.error":`خطأ`,"activity.detail.result":`النتيجة`,"activity.truncated":`اقتُطعت المخرجات لتجاوزها الحد المسموح`,"activity.files.more":`+{n} أخرى`,"activity.files.showing":`عرض {shown} من أصل {total} ملف`,"activity.files.file":`ملف {n}`,"activity.plan":`الخطة`,"activity.planDone":`اكتمل {done} من {total}`,"activity.planItem":`{status}: {text}`,"activity.planStatus.done":`اكتملت`,"activity.planStatus.running":`قيد التنفيذ`,"activity.planStatus.failed":`فشلت`,"activity.planStatus.stopped":`توقفت`,"activity.planStatus.pending":`لم تبدأ`,"activity.errorOccurred":`حدث خطأ`,"activity.policy.title":`درع السياسات`,"activity.policy.tool":`الأداة`,"activity.policy.rules":`القواعد`,"activity.policy.policy":`السياسة`,"activity.policy.receipt":`الإيصال`,"activity.policy.receiptUnavailable":`الإيصال غير متاح`,"activity.chunks":`المقاطع المسترجعة: {n}`,"activity.chunkPage":`ص {page}`,"activity.terminal":`الطرفية`,"activity.exit":`رمز الخروج {code}`,"activity.copyOutput":`نسخ المخرجات`,"activity.copyOutputAria":`نسخ مخرجات الأمر`,"activity.noOutput":`لا توجد مخرجات`,"activity.openPath":`فتح: {path}`,"tool.failed":`تعذّر: {label}`,"tool.unfinished":`لم يكتمل: {label}`,"tool.default.done":`استخدم أداة`,"tool.default.active":`استخدام أداة`,"tool.mcp.done":`أداة MCP`,"tool.mcp.active":`تشغيل أداة MCP`,"tool.named.done":`استخدم {what}`,"tool.named.active":`استخدام {what}`,"tool.search_file.done":`بحث في الملفات`,"tool.search_file.active":`البحث في الملفات`,"tool.search_files.done":`بحث في الملفات`,"tool.search_files.active":`البحث في الملفات`,"tool.search_file_content.done":`بحث في المحتوى`,"tool.search_file_content.active":`البحث في المحتوى`,"tool.search_directory.done":`بحث في المجلد`,"tool.search_directory.active":`البحث في المجلد`,"tool.read_file.done":`قرأ ملفًا`,"tool.read_file.active":`قراءة ملف`,"tool.write_file.done":`كتب ملفًا`,"tool.write_file.active":`كتابة ملف`,"tool.get_file_info.done":`اطّلع على معلومات الملف`,"tool.get_file_info.active":`جلب معلومات الملف`,"tool.browse_directory.done":`استعرض المجلد`,"tool.browse_directory.active":`استعراض المجلد`,"tool.list_directory.done":`اطّلع على محتويات المجلد`,"tool.list_directory.active":`سرد محتويات المجلد`,"tool.list_recent_files.done":`اطّلع على الملفات الأخيرة`,"tool.list_recent_files.active":`سرد الملفات الأخيرة`,"tool.analyze_data_file.done":`حلّل البيانات`,"tool.analyze_data_file.active":`تحليل البيانات`,"tool.run_shell_command.done":`نفّذ أمرًا`,"tool.run_shell_command.active":`تنفيذ أمر`,"tool.execute_code.done":`نفّذ الشيفرة`,"tool.execute_code.active":`تنفيذ الشيفرة`,"tool.query_documents.done":`استعلم في المستندات`,"tool.query_documents.active":`الاستعلام في المستندات`,"tool.query_specific_file.done":`استعلم في ملف`,"tool.query_specific_file.active":`الاستعلام في ملف`,"tool.search_indexed_chunks.done":`بحث في المقاطع`,"tool.search_indexed_chunks.active":`البحث في المقاطع`,"tool.semantic_search.done":`بحث في المستندات`,"tool.semantic_search.active":`البحث في المستندات`,"tool.evaluate_retrieval.done":`قيّم نتائج الاسترجاع`,"tool.evaluate_retrieval.active":`تقييم نتائج الاسترجاع`,"tool.index_document.done":`فهرس مستندًا`,"tool.index_document.active":`فهرسة مستند`,"tool.index_documents.done":`فهرس المستندات`,"tool.index_documents.active":`فهرسة المستندات`,"tool.index_directory.done":`فهرس المجلد`,"tool.index_directory.active":`فهرسة المجلد`,"tool.index_file.done":`فهرس ملفًا`,"tool.index_file.active":`فهرسة ملف`,"tool.list_indexed_documents.done":`استعرض المستندات`,"tool.list_indexed_documents.active":`استعراض المستندات`,"tool.summarize_document.done":`لخّص المستند`,"tool.summarize_document.active":`تلخيص المستند`,"tool.dump_document.done":`استخرج النص`,"tool.dump_document.active":`استخراج النص`,"tool.rag_status.done":`تحقّق من حالة RAG`,"tool.rag_status.active":`التحقق من حالة RAG`,"tool.add_watch_directory.done":`أضاف مجلدًا للمراقبة`,"tool.add_watch_directory.active":`إضافة مجلد للمراقبة`,"tool.web_search.done":`بحث في الويب`,"tool.web_search.active":`البحث في الويب`,"tool.search_web.done":`بحث في الويب`,"tool.search_web.active":`البحث في الويب`,"tool.fetch_page.done":`قرأ صفحة ويب`,"tool.fetch_page.active":`قراءة صفحة ويب`,"tool.fetch_webpage.done":`قرأ صفحة ويب`,"tool.fetch_webpage.active":`قراءة صفحة ويب`,"tool.analyze_data.done":`حلّل البيانات`,"tool.analyze_data.active":`تحليل البيانات`,"tool.find_files.done":`عثر على ملفات`,"tool.find_files.active":`البحث عن ملفات`,"tool.edit_file.done":`حرّر ملفًا`,"tool.edit_file.active":`تحرير ملف`,"tool.recall.done":`استرجع من الذاكرة`,"tool.recall.active":`الاسترجاع من الذاكرة`,"tool.remember.done":`حفظ في الذاكرة`,"tool.remember.active":`الحفظ في الذاكرة`,"tool.update_memory.done":`حدّث الذاكرة`,"tool.update_memory.active":`تحديث الذاكرة`,"tool.forget.done":`حذف من الذاكرة`,"tool.forget.active":`الحذف من الذاكرة`,"tool.search_past_conversations.done":`بحث في المحادثات السابقة`,"tool.search_past_conversations.active":`البحث في المحادثات السابقة`,"tool.request_user_input.done":`طرح سؤالًا عليك`,"tool.request_user_input.active":`طرح سؤال عليك`,"tool.load_skill.done":`استخدم مهارة`,"tool.load_skill.active":`تحميل مهارة`,"tool.unload_skill.done":`وضع مهارة جانبًا`,"tool.unload_skill.active":`إبعاد مهارة`,"tool.list_skills.done":`تحقّق من المهارات`,"tool.list_skills.active":`التحقق من المهارات`,"tool.search_skill_hub.done":`بحث في المهارات`,"tool.search_skill_hub.active":`البحث في المهارات`,"tool.install_skill.done":`ثبّت مهارة`,"tool.install_skill.active":`تثبيت مهارة`,"tool.capture_skill.done":`حفظ مهارة`,"tool.capture_skill.active":`حفظ المهارة`,"tool.remove_skill.done":`أزال مهارة`,"tool.remove_skill.active":`إزالة مهارة`,"tool.skill_status.done":`تحقّق من مهارة`,"tool.skill_status.active":`التحقق من مهارة`,"docs.title":`مكتبة المستندات`,"docs.close":`إغلاق مكتبة المستندات`,"docs.untitledChat":`محادثة بلا عنوان`,"docs.addTo":`إضافة المستندات إلى`,"docs.thisChat":`هذه المحادثة: {chat}`,"docs.nextChat":`محادثتك الجديدة التالية`,"docs.nextChatOnly":`تُرفق المستندات التي تضيفها هنا بمحادثتك الجديدة التالية.`,"docs.hint":`لا تبحث المحادثة إلا في المستندات المرفقة بها.`,"docs.drop":`أفلت الملفات هنا لفهرستها`,"docs.dropHint":`ملفات PDF وTXT وMD والشيفرة البرمجية، وأكثر من 50 صيغة أخرى`,"docs.pathPlaceholder":`أو أدخل مسار ملف أو مجلد: {example}`,"docs.pathAria":`مسار الملف المراد فهرسته`,"docs.index":`فهرسة`,"docs.browse":`تصفح الملفات`,"docs.browseTitle":`تصفح الملفات على هذا الجهاز`,"docs.count.one":`المستندات: {n}`,"docs.count.other":`المستندات: {n}`,"docs.chunks.one":`المقاطع: {n}`,"docs.chunks.other":`المقاطع: {n}`,"docs.empty":`لم تتم فهرسة أي مستندات بعد`,"docs.emptyHint":`أفلت الملفات أعلاه أو أدخل مسار ملف`,"docs.indexingFile":`جارٍ فهرسة {name}...`,"docs.indexingFolder":`جارٍ فهرسة المستندات في {name}...`,"docs.willAttach":`سيُرفق {name} بمحادثتك الجديدة التالية.`,"docs.attached":`تم إرفاق {name} بـ {chat}.`,"docs.indexing":`جارٍ الفهرسة...`,"docs.indexingLabel":`جارٍ الفهرسة`,"docs.progress.reading":`قراءة الصفحة {done} من {total}`,"docs.progress.readingCount":`قراءة الصفحة {done}`,"docs.progress.embedding":`تضمين المقاطع: {done} من {total}`,"docs.progress.embeddingCount":`تضمين المقطع {done}`,"docs.cancelIndexing":`إلغاء الفهرسة`,"docs.cancelIndexingAria":`إلغاء فهرسة {name}`,"docs.cancel":`إلغاء`,"docs.failed":`فشلت`,"docs.cantRead":`تتعذّر قراءته`,"docs.failedAria":`فشلت: {error}`,"docs.indexingFailed":`فشلت الفهرسة`,"docs.retry":`إعادة المحاولة`,"docs.retrying":`جارٍ إعادة المحاولة…`,"docs.retryTitle":`إعادة محاولة الفهرسة`,"docs.retryTitleFix":`إعادة محاولة الفهرسة (أصلح الملف أولًا، وإلا فستفشل مجددًا)`,"docs.retryAria":`إعادة محاولة فهرسة {name}`,"docs.noReason":`لم يسجّل GAIA السبب. أعد المحاولة لترى الخطأ.`,"docs.cancelled":`أُلغيت`,"docs.missing":`الملف مفقود`,"docs.indexedAt":`تاريخ الفهرسة: {time}`,"docs.openFolder":`فتح المجلد: {path}`,"docs.openFolderAria":`فتح المجلد الذي يحتوي على {name}`,"docs.useIn":`استخدامه في {chat}`,"docs.useNext":`استخدامه في محادثتك التالية`,"docs.attachAria":`إرفاق {name} بـ {chat}`,"docs.attachNextAria":`إرفاق {name} بمحادثتك التالية`,"docs.remove":`إزالة`,"docs.removeAria":`إزالة {name}`,"docs.dismissFolder":`إغلاق نتيجة فهرسة المجلد`,"time.justNow":`الآن`,"time.minutesAgo":`قبل {n} د`,"time.hoursAgo":`قبل {n} س`,"time.yesterday":`أمس`,"time.daysAgo":`قبل {n} ي`,"sp.label":`لوحة الجلسة`,"sp.resize":`تغيير حجم لوحة الجلسة`,"sp.title":`هذه المحادثة`,"sp.close":`إغلاق لوحة الجلسة`,"sp.closeShort":`إغلاق`,"sp.show":`إظهار لوحة الجلسة`,"sp.hide":`إخفاء لوحة الجلسة`,"sp.showWarn":`إظهار لوحة الجلسة: تعذّر الحصول على بيانات مباشرة`,"sp.section.answer":`هذه الإجابة`,"sp.section.context":`السياق والأداء`,"sp.checking":`جارٍ التحقق…`,"sp.open":`فتح`,"sp.showInFolder":`إظهار في المجلد`,"sp.goToTurn":`الانتقال إلى الدور`,"sp.cancel":`إلغاء`,"sp.couldntOpen":`تعذّر فتح {name}: {error}`,"sp.gone":`لم يعد موجودًا على القرص`,"rail.pending":`جارٍ العمل على هذه الإجابة. ستظهر هنا مصادرها وملفاتها ووجهة بياناتها عند انتهائها.`,"rail.noLive":`تعذّر الحصول على بيانات مباشرة`,"rail.noLiveWhy":`فشلت كل عمليات البحث على الويب في هذا الدور، لذا لا تستند الإجابة إلى معلومات حديثة.`,"rail.error":`تعذّر تجميع مصادر هذا الدور وتفاصيله: {error}`,"rail.sources":`المصادر`,"rail.searchResult":`نتيجة بحث`,"rail.pages.one":`ص {list}`,"rail.pages.other":`الصفحات {list}`,"rail.passages.one":`المقاطع: {n}`,"rail.passages.other":`المقاطع: {n}`,"rail.files":`الملفات`,"rail.changedSince":`تغيّر منذ هذا الدور`,"rail.checkFailed":`تعذّر التحقق مما إذا كانت هذه الملفات قد تغيّرت: {error}`,"rail.thisTurn":`هذا الدور`,"rail.model":`النموذج`,"rail.cloudModel":`{name} (سحابي)`,"rail.thisPc":`هذا الجهاز`,"rail.notReported":`لم يُبلَّغ عنه`,"rail.documents":`المستندات`,"rail.docsSent":`جرى البحث على هذا الجهاز. وأُرسلت المقاطع المستخدمة إلى {provider}.`,"rail.docsLocal":`قُرئت على هذا الجهاز وبقيت فيه.`,"rail.docsSearched":`جرى البحث على هذا الجهاز.`,"rail.websites":`المواقع`,"rail.noSites":`لا شيء من أدوات الويب في GAIA`,"rail.cost":`التكلفة`,"rail.costLocal":`لا رسوم سحابية`,"rail.costAbout":"نحو ${usd} بسعر القائمة","rail.costUnknownModel":`غير معروفة لهذا النموذج`,"rail.costUnknown":`غير معروفة`,"env.title":`البيئة`,"env.offline":`غير متصل`,"env.runsOn":`يعمل على`,"env.cloudPlace":`{name} (سحابي)`,"env.notKnownYet":`غير معروف بعد`,"env.thisPc":`هذا الجهاز`,"env.notLoaded":`{model} · غير محمّل الآن`,"env.inUse":`المستخدم: {gb} غيغابايت`,"env.inUseUnknown":`الذاكرة المستخدمة غير معروفة`,"env.free":`المتاح: {gb} غيغابايت`,"env.reach":`الملفات التي يمكن لـ GAIA الوصول إليها`,"env.readWrite":`يمكنه القراءة والكتابة`,"env.flagshipScope":`هذه المجلدات هي نقطة بداية GAIA وليست حدًا: يمكنه أيضًا فتح مجلدات داخل مجلد المستخدم، مجلدًا تلو الآخر، لكن لا يفتح مجلد المستخدم كله دفعة واحدة. وفي وضع السؤال يستأذنك قبل فتح مجلد جديد أو تغيير أي شيء.`,"env.agentScope":`هذه المجلدات هي نقطة بداية وكيل هذه المحادثة، وهو يطبّق حدوده الخاصة.`,"env.foldersError":`تعذّرت قراءة مجلدات هذه المحادثة: {error}`,"env.nothing":`لا شيء بعد. لا يمكن لـ GAIA قراءة أي مجلد أو الكتابة فيه في هذه المحادثة.`,"env.fewerFiles":`إظهار ملفات أقل`,"env.allFiles":`إظهار كل الملفات ({n})`,"env.ownProcess":`يعمل وكيل هذه المحادثة في عملية مستقلة، لذا لا يمكن تغيير مجلداته من هنا.`,"env.removed":`أُزيل: {names}. يُمنع GAIA من الوصول إليه حتى تضيفه مجددًا.`,"env.addFolder":`إضافة مجلد`,"env.remove":`إزالة {path} من هذه المحادثة`,"env.removeShort":`إزالة من هذه المحادثة`,"env.source.added":`أضفته أنت`,"env.source.gaia_documents":`مجلد مستندات GAIA`,"env.source.scratch":`مجلد GAIA المؤقت`,"env.source.document":`مستند في هذه المحادثة`,"env.source.working_folder":`المجلد الذي بدأ منه GAIA`,"env.source.approved":`وافقت عليه خلال هذه المحادثة`,"env.source.allowed_paths":`محدد عبر GAIA_ALLOWED_PATHS`,"env.internet":`الإنترنت`,"env.internetFor":`الإنترنت لهذه المحادثة`,"env.on":`مفعّل`,"env.off":`متوقف`,"env.offBlocked":`متوقف: البحث على الويب والصفحات محظورة`,"env.phone":`الوصول من الهاتف`,"env.stopping":`جارٍ الإيقاف…`,"env.starting":`جارٍ التشغيل…`,"env.phoneConnected":`{name} متصل`,"env.noPhone":`لا يوجد هاتف متصل بعد`,"env.qr":`إظهار رمز QR`,"env.permission":`وضع الأذونات`,"env.ask":`السؤال`,"env.fullAccessWarn":`يتيح الوصول الكامل لـ GAIA تغيير الملفات وتشغيل الأوامر على هذا الجهاز دون استئذان.`,"env.turnOn":`تفعيله`,"perm.ask":`السؤال قبل التنفيذ`,"perm.askNote":`يستأذنك GAIA قبل تعديل الملفات أو تشغيل الأوامر أو استخدام أدوات تُحدث تغييرات.`,"perm.full":`وصول كامل`,"perm.fullNote":`يشغّل كل أداة وأمر دون استئذان، في هذه المحادثة فقط.`,"offline.text":`غير متصل: الإنترنت متوقف لهذه المحادثة، لذا لن يبحث GAIA في الويب ولن يفتح الصفحات.`,"offline.error":`تعذّر تفعيله: {error}`,"offline.turnOn":`تفعيل`,"out.title":`المخرجات`,"out.kind.file":`ملف`,"out.kind.export":`تصدير`,"out.kind.image":`صورة`,"out.kind.document":`مستند مفهرس`,"out.kind.memory":`ذاكرة محفوظة`,"out.kind.schedule":`مهمة مجدولة`,"out.change.created":`أُنشئ`,"out.change.edited":`عُدّل`,"out.change.deleted":`حُذف`,"out.kindChanged":`{kind}: {change}`,"out.justNow":`الآن`,"out.minAgo":`قبل {n} د`,"out.hAgo":`قبل {n} س`,"out.undone":`تم التراجع`,"out.listError":`تعذّر سرد ما أنتجته هذه المحادثة: {error}`,"out.empty":`لا شيء بعد. تظهر هنا الملفات والمستندات والصور والذكريات التي تنشئها هذه المحادثة.`,"out.listLabel":`ما أنتجته هذه المحادثة`,"out.notLoaded":`هذا الدور غير محمّل في المحادثة حاليًا.`,"out.goToAria":`الانتقال إلى الدور الذي أنشأ {name}`,"out.fewer":`إظهار أقل`,"out.more":`إظهار المزيد ({n})`,"chg.title":`التغييرات`,"chg.files.one":`الملفات: {n}`,"chg.files.other":`الملفات: {n}`,"chg.summary":`{files} · +{add} −{del}`,"chg.total":`{files} تغيّرت، +{add} −{del}`,"chg.error":`تعذّر حصر تغييرات هذه المحادثة: {error}`,"chg.uncounted.one":`ملفات ثنائية أو كبيرة لم تُعدّ أسطرها: {n}`,"chg.uncounted.other":`ملفات ثنائية أو كبيرة لم تُعدّ أسطرها: {n}`,"chg.pending":`ما زال الرد قيد التشغيل؛ تُضاف تغييراته عند انتهائه.`,"chg.edited":`عُدّل`,"chg.created":`أُنشئ`,"chg.deleted":`حُذف`,"chg.turns":`الأدوار: {n}`,"chg.outside":`تغيّر خارج GAIA: {when}`,"chg.goToLast":`الانتقال إلى آخر دور غيّر {name}`,"chg.review":`مراجعة التغييرات`,"chg.wait":`انتظر حتى ينتهي الرد`,"chg.undoing":`جارٍ التراجع…`,"chg.undoAll":`التراجع عن الكل`,"chg.confirmLabel":`تأكيد التراجع عن الكل`,"chg.confirm.one":`إعادة {files} إلى ما كانت عليه قبل هذه المحادثة؟ سيُتراجع عن تغييرات الملفات في كل الأدوار.`,"chg.confirm.other":`إعادة {files} إلى ما كانت عليه قبل هذه المحادثة؟ سيُتراجع عن تغييرات الملفات في كل الأدوار.`,"chg.undoAnyway":`التراجع على أي حال وفقدان تلك التغييرات`,"chg.keep":`الإبقاء عليها`,"chg.gitError":`تعذّر التحقق من وجود مستودع git: {error}`,"pick.label":`إضافة مجلد إلى هذه المحادثة`,"pick.title":`إضافة مجلد`,"pick.note":`سيتمكن GAIA من قراءة كل ما في المجلد الذي تختاره والكتابة فيه، في هذه المحادثة فقط.`,"pick.path":`مسار المجلد`,"pick.go":`انتقال`,"pick.onlyHidden":`لا توجد هنا إلا مجلدات مخفية. فعّل «إظهار المخفي» لرؤيتها.`,"pick.none":`لا توجد مجلدات بالداخل.`,"pick.loading":`جارٍ التحميل…`,"perm.chipAria":`وضع الأذونات: {mode}`,"perm.fullLower":`وصول كامل`,"perm.askLower":`السؤال قبل التنفيذ`,"pick.showHidden":`إظهار المخفي`,"pick.up":`مستوى واحد للأعلى`,"pick.use":`استخدام هذا المجلد`,"ctx.sheetAria":`السياق والأداء`,"ctx.unknown":`غير معروف`,"ctx.tokens":`الرموز: {n}`,"ctx.rate":`{n} رمز/ث`,"ctx.rateTitle":`{n} رمز في الثانية`,"ctx.cloud":`سحابي`,"ctx.cloudVia":`سحابي · {provider}`,"ctx.notLoadedNow":`غير محمّل الآن`,"ctx.took":`استغرق`,"ctx.tookHint":`من إرسال الرسالة حتى حفظ الإجابة`,"ctx.split":`التوزيع`,"ctx.inModel":`داخل النموذج`,"ctx.runningTools":`تشغيل الأدوات`,"ctx.waitingOnYou":`بانتظارك`,"ctx.gaiaItself":`GAIA نفسه`,"ctx.inGaia":`داخل GAIA`,"ctx.inGaiaHint":`كل ما لم يكن النموذج: الأدوات وانتظارك وعمل GAIA نفسه`,"ctx.src.server":`أبلغ عنه خادم النموذج`,"ctx.src.client":`قاسه GAIA على البث، بما في ذلك الشبكة`,"ctx.toolOutside":`عمل أدوات خارج خطوة`,"ctx.firstWord":`أول كلمة`,"ctx.in":`خلال`,"ctx.readingPrompt":`قراءة الطلب`,"ctx.readingHint":`الملء المسبق: رموز الطلب الجديدة على زمن أول رمز`,"ctx.tooFewTitle":`الرموز الجديدة أقل من أن تعطي سرعة قراءة؛ والباقي جاء من الذاكرة المؤقتة`,"ctx.onlyNew":`رموز جديدة فقط: {n}`,"ctx.approx":`تقريبي`,"ctx.approxTitle":`قاسه GAIA من أول كلمة، لذا يشمل وقت الشبكة والانتظار`,"ctx.writing":`كتابة الإجابة`,"ctx.writingHint":`سرعة التوليد، موزونة بعدد الرموز`,"ctx.tokensInOut":`الرموز الداخلة والخارجة`,"ctx.cache":`مُعاد من الذاكرة المؤقتة`,"ctx.cacheHint":`رموز الطلب التي لم يحتج الخادم إلى قراءتها مجددًا`,"ctx.modelCalls":`استدعاءات النموذج`,"ctx.toolCalls":`استدعاءات الأدوات`,"ctx.none":`لا شيء`,"ctx.loads":`تحميلات النموذج`,"ctx.costLocalTitle":`يعمل على هذا الجهاز`,"ctx.costLocal":`$0 · على هذا الجهاز`,"ctx.listPriceTitle":"${usd} بسعر القائمة","ctx.about":"نحو ${usd}","ctx.turns":`الأدوار المقيسة`,"ctx.totalTime":`الوقت الإجمالي`,"ctx.unpricedTitle":`أدوار على نموذج بلا سعر معروف: {n}`,"ctx.unpriced":"${usd} + {n} بلا تسعير","ctx.live":`حاضر في النافذة`,"ctx.putAway":`أُبعد`,"ctx.putAwayHint":`نتائج أدوات أقدم نُقلت خارج الطلب؛ وما زالت قابلة للقراءة`,"ctx.results.one":`النتائج: {n}`,"ctx.results.other":`النتائج: {n}`,"ctx.summarized":`لُخّص`,"ctx.summarizedHint":`دُمجت أدوار أقدم في ملخص متجدد؛ ويبقى الأصل محفوظًا`,"ctx.earlier.one":`الأدوار السابقة: {n}`,"ctx.earlier.other":`الأدوار السابقة: {n}`,"ctx.summarizedNote":`لُخّصت الرسائل السابقة، وما زال البحث فيها ممكنًا.`,"ctx.filling":`النافذة تمتلئ. تُنقل نتائج الأدوات الأقدم خارج الطلب وتبقى قابلة للقراءة، وقد تخرج أقدم الأدوار من نطاق رؤية النموذج. لكنها تبقى محفوظة، ويمكنك أن تطلب من GAIA استرجاعها.`,"ctx.context":`السياق`,"ctx.measuring":`جارٍ القياس…`,"ctx.used":`المستخدم {pct}%`,"ctx.of":`من`,"ctx.tokensWord":`رمز`,"ctx.windowTitle":`يسمح GAIA بهذا القدر من النافذة، لذا تخرج الأدوار الأقدم من الرؤية أبكر مما يحتاجه النموذج`,"ctx.gaiaUses":`يستخدم GAIA`,"ctx.ofModel":`من أصل نافذة النموذج البالغة`,"ctx.freeRow":`متاح`,"ctx.reserve":`منها محجوز للرد`,"ctx.exactTokenizer":`عُدّ كل جزء بمُرمِّز {model} نفسه.`,"ctx.estimated":`تقديري: {reason}`,"ctx.sharedTokenizer":`عُدّ بمُرمِّز مشترك.`,"ctx.lastRequest":`حمل الطلب الأخير {n} رمزًا كما عدّها خادم النموذج، بما في ذلك تنسيق المحادثة.`,"ctx.onDemand":`أدوات إضافية تُحمَّل عند الحاجة فقط: {n}`,"ctx.sentNow":`المُرسلة الآن: {n}. لا تكلّف هذه شيئًا حتى يحتاجها دور ما:`,"ctx.hood":`التفاصيل التقنية`,"ctx.show":`عرض`,"ctx.lastTurn":`آخر دور`,"ctx.memory":`ذاكرة النموذج`,"ctx.memoryHint":`أوزان النموذج + ذاكرة KV المؤقتة عند هذه النافذة؛ والذاكرة المتاحة الآن`,"ctx.gbModel":`النموذج {gb} غيغابايت`,"ctx.gbCache":`الذاكرة المؤقتة {gb} غيغابايت`,"ctx.freeUnknown":`المتاح غير معروف`,"ctx.afterNext":`يظهر بعد إجابة GAIA التالية في هذه المحادثة.`,"ctx.latestAnswer":`آخر إجابة:`,"ctx.notMeasured":`لم تُقَس.`,"settings.title":`الإعدادات`,"settings.sections":`أقسام الإعدادات`,"settings.close":`إغلاق الإعدادات`,"settings.loading":`جارٍ التحميل…`,"settings.section.general":`عام`,"settings.section.model":`النموذج`,"settings.section.permissions":`الأذونات`,"settings.section.skills":`المهارات`,"settings.section.connectors":`الموصلات`,"settings.section.memory":`الذاكرة`,"settings.section.notifications":`الإشعارات`,"settings.section.privacy":`الخصوصية`,"settings.section.advanced":`متقدم`,"settings.language":`اللغة`,"settings.languageHint":`تغيّر تسميات التطبيق واتجاه تخطيطه، لا اللغة التي يجيب بها GAIA.`,"settings.appearance":`المظهر`,"settings.theme.light":`فاتح`,"settings.theme.dark":`داكن`,"settings.theme.system":`مطابقة النظام`,"settings.colors":`الألوان`,"palette.default":`رمادي دافئ`,"palette.stone":`حجر وحبر`,"palette.marble":`رخام أزرق`,"palette.glacier":`جليد`,"palette.forest":`أرض الغابة`,"palette.sage":`مريمية وضباب`,"palette.basalt":`بازلت وأشنة`,"palette.gold":`جرافيت وذهب`,"palette.dusk":`غسق`,"settings.colors.custom":`مخصص`,"settings.colors.accent":`اللون المميز`,"settings.colors.accentHint":`الأزرار والروابط ومؤشر التركيز`,"settings.colors.base":`صبغة الخلفية`,"settings.colors.baseHint":`اللون الذي تميل إليه الدرجات الرمادية`,"settings.colors.reset":`إعادة تعيين`,"settings.colors.hint":`تتكيّف ألوان النص تلقائيًا ليبقى كل شيء مقروءًا في الوضعين الفاتح والداكن.`,"settings.shortcuts":`اختصارات لوحة المفاتيح`,"settings.shortcut.send":`إرسال`,"settings.shortcut.newLine":`سطر جديد`,"settings.shortcut.stop":`إيقاف الإجابة`,"settings.shortcut.newChat":`محادثة جديدة`,"settings.shortcut.search":`البحث في المحادثات`,"settings.shortcut.sidebar":`إظهار الشريط الجانبي أو إخفاؤه`,"settings.shortcut.settings":`الإعدادات`}},Cr={"sidebar.label":`Chats`,"sidebar.expand":`Expand sidebar`,"sidebar.collapse":`Collapse sidebar`,"sidebar.search":`Search chats`,"sidebar.newChat":`New chat`,"sidebar.memory":`Memory`,"sidebar.schedules":`Scheduled tasks`,"sidebar.documents":`Documents`,"sidebar.recent":`Recent chats`,"sidebar.noMatch":`No chats match.`,"sidebar.searching":`Searching inside chats…`,"sidebar.searchCapped":`Showing the {n} newest chats that mention this. Type more to narrow it down.`,"sidebar.matchCount.one":`{n} chat matches`,"sidebar.matchCount.other":`{n} chats match`,"sidebar.empty":`No chats yet.`,"sidebar.group.needsYou":`Needs you`,"sidebar.group.pinned":`Pinned`,"sidebar.group.today":`Today`,"sidebar.group.yesterday":`Yesterday`,"sidebar.group.prev7":`Previous 7 days`,"sidebar.group.prev30":`Previous 30 days`,"sidebar.group.older":`Older`,"sidebar.hideBackground":`Hide background runs`,"sidebar.showBackground.one":`Show {n} background run`,"sidebar.showBackground.other":`Show {n} background runs`,"sidebar.notifications":`Notifications`,"sidebar.notificationsUnread":`Notifications, {n} unread`,"sidebar.mobileAccess":`Mobile access`,"sidebar.mobileAccessOn":`Mobile access is on`,"sidebar.settings":`Settings`,"row.status.running":`Running`,"row.status.queued":`Waiting for the GPU`,"row.status.waiting":`Waiting for you`,"row.status.done":`Done`,"row.status.failed":`Failed`,"row.unread":`unread`,"row.private":`Private chat`,"row.rename":`Rename`,"row.renameAria":`Rename {title}`,"row.saveName":`Save name`,"row.cancelRename":`Cancel rename`,"row.moreActions":`More actions for {title}`,"row.actions":`Chat actions`,"row.pin":`Pin`,"row.unpin":`Unpin`,"row.pinToTop":`Pin to top`,"row.pinAria":`Pin {title}`,"row.unpinAria":`Unpin {title}`,"row.delete":`Delete`,"row.deleteAria":`Delete {title}`,"row.deleteConfirm":`Delete?`,"row.confirmDeleteAria":`Confirm delete {title}`,"row.clickAgain":`Click again to delete`,"row.tapAgain":`{label} Tap again`,"newChat.label":`New chat`,"newChat.greeting.morning":`Good morning. What should we work on?`,"newChat.greeting.afternoon":`Good afternoon. What should we work on?`,"newChat.greeting.evening":`Good evening. What should we work on?`,"newChat.warmup.ready":`Getting GAIA ready… {s}s`,"newChat.warmup.loading":`Loading {model}… {s}s`,"newChat.warmup.loadingOn":`Loading {model} on {where}… {s}s`,"device.gpu":`your GPU`,"device.npu":`your NPU`,"device.cpu":`the CPU`,"newChat.assistantUnavailable":`GAIA’s assistant didn’t start yet.`,"newChat.tryAgain":`Try again`,"newChat.details":`Details`,"newChat.docs.forChat":`Documents for this chat`,"newChat.docs.dontAttach":`Don't attach {name}`,"newChat.docs.more.one":`{n} more document in your library.`,"newChat.docs.more.other":`{n} more documents in your library.`,"newChat.docs.library.one":`Your library has {n} document; this chat can search only the ones you attach.`,"newChat.docs.library.other":`Your library has {n} documents; this chat can search only the ones you attach.`,"newChat.docs.attachIt":`Attach it`,"newChat.docs.attachAll":`Attach all {n}`,"newChat.docs.choose":`Choose`,"newChat.setupFailed.title":`GAIA’s first-run setup didn’t finish, so a chat on this PC’s model will fail.`,"newChat.setupFailed.hint":`Use a cloud model, or pick a smaller one.`,"newChat.setupFailed.choose":`Choose a model`,"newChat.cardsLabel":`Things to try`,"card.document-brief.title":`Ask about your documents`,"card.document-brief.note.one":`{n} indexed document`,"card.document-brief.note.other":`{n} indexed documents`,"card.inbox-triage.title":`Triage my inbox`,"card.inbox-triage.note":`Your connected mail account`,"card.research-report.title":`Research a topic`,"card.research-report.note":`A cited report from the web`,"card.coding.title":`Work on code`,"card.coding.note":`In {folder}`,"card.summarize.title":`Summarize something`,"card.summarize.note":`A document, transcript or email`,"card.check-in.title":`Check in`,"card.check-in.note":`Pick up where you left off`,"composer.placeholder":`Ask GAIA anything`,"composer.reply":`Reply to GAIA`,"composer.queueNext":`Queue your next message`,"composer.starting":`GAIA is starting…`,"composer.message":`Message`,"composer.attached":`Attached files`,"composer.uploading":`Uploading…`,"composer.remove":`Remove {name}`,"composer.tooLong":`Too long to send: {sent} of {max} characters.`,"composer.tooLongHint":`Save it as a file and attach it with +, and GAIA can read all of it.`,"composer.attach":`Attach files`,"composer.queue":`Queue message`,"composer.queueTitle":`Queue it to send when this reply ends (Enter)`,"composer.stop":`Stop`,"composer.stopping":`Stopping…`,"composer.send":`Send`,"msg.sent":`Sent {time}`,"msg.replied":`Replied {time}`,"msg.thinking":`Thinking...`,"msg.resend":`Resend message`,"msg.copy":`Copy message`,"msg.copied":`Copied!`,"msg.copiedAria":`Copied to clipboard`,"msg.delete":`Delete message`,"msg.confirmDelete":`Click again to confirm`,"msg.confirmDeleteAria":`Confirm delete message`,"msg.error":`Something went wrong`,"msg.showAll":`Show all`,"msg.showLess":`Show less`,"msg.stopped":`Stopped`,"msg.stoppedUnconfirmed":`Stopped. GAIA did not confirm the stop, so some steps may be missing here. Reload the chat to see what it saved.`,"msg.stoppedError":`Stopped. GAIA reported an error while stopping: {error}`,"msg.about":`About this answer`,"msg.timestamp":`Message timestamp`,"code.copy":`Copy`,"citation.open":`Open {name}`,"citation.openPage":`Open page {page}`,"code.copied":`Copied`,"code.copyAria":`Copy code`,"retry.button":`Retry with another model`,"retry.head":`Retry with…`,"activity.thinking":`Thinking`,"activity.thought":`Thought`,"activity.thoughtFor":`Thought for {time}`,"activity.waiting":`Waiting for you`,"activity.usedSkill":`Used {name} skill`,"activity.blocked":`Blocked by policy`,"activity.hitError":`Hit an error`,"activity.madePlan":`Made a plan`,"activity.thoughtThrough":`Thought it through`,"activity.summarySep":`, `,"activity.summaryMore":`{list} and {n} more`,"activity.filterPlaceholder":`Filter steps…`,"activity.filterByTool":`Filter by tool name`,"activity.filterByStatus":`Filter by status`,"activity.filter.all":`All`,"activity.filter.success":`Success`,"activity.filter.error":`Error`,"activity.identicalCalls":`{n} identical calls`,"activity.detail.tool":`Tool`,"activity.detail.via":`via {server}`,"activity.detail.arguments":`Arguments`,"activity.detail.output":`Output`,"activity.detail.error":`Error`,"activity.detail.result":`Result`,"activity.truncated":`Output was truncated (exceeded size limit)`,"activity.files.more":`+{n} more`,"activity.files.showing":`Showing {shown} of {total} files`,"activity.files.file":`File {n}`,"activity.plan":`Plan`,"activity.planDone":`{done} of {total} done`,"activity.planItem":`{status}: {text}`,"activity.planStatus.done":`Done`,"activity.planStatus.running":`Running`,"activity.planStatus.failed":`Failed`,"activity.planStatus.stopped":`Stopped`,"activity.planStatus.pending":`Not started`,"activity.errorOccurred":`An error occurred`,"activity.policy.title":`Policy Shield`,"activity.policy.tool":`Tool`,"activity.policy.rules":`Rules`,"activity.policy.policy":`Policy`,"activity.policy.receipt":`Receipt`,"activity.policy.receiptUnavailable":`Receipt unavailable`,"activity.chunks":`Retrieved Chunks ({n})`,"activity.chunkPage":`p.{page}`,"activity.terminal":`Terminal`,"activity.exit":`exit {code}`,"activity.copyOutput":`Copy output`,"activity.copyOutputAria":`Copy command output`,"activity.noOutput":`No output`,"activity.openPath":`Open: {path}`,"tool.failed":`{label} failed`,"tool.unfinished":`{label} didn't finish`,"tool.default.done":`Used tool`,"tool.default.active":`Using tool`,"tool.mcp.done":`MCP tool`,"tool.mcp.active":`Running MCP tool`,"tool.named.done":`Used {what}`,"tool.named.active":`Using {what}`,"tool.search_file.done":`Searched files`,"tool.search_file.active":`Searching files`,"tool.search_files.done":`Searched files`,"tool.search_files.active":`Searching files`,"tool.search_file_content.done":`Searched content`,"tool.search_file_content.active":`Searching content`,"tool.search_directory.done":`Searched directory`,"tool.search_directory.active":`Searching directory`,"tool.read_file.done":`Read file`,"tool.read_file.active":`Reading file`,"tool.write_file.done":`Wrote file`,"tool.write_file.active":`Writing file`,"tool.get_file_info.done":`Got file info`,"tool.get_file_info.active":`Getting file info`,"tool.browse_directory.done":`Browsed directory`,"tool.browse_directory.active":`Browsing directory`,"tool.list_directory.done":`Listed directory`,"tool.list_directory.active":`Listing directory`,"tool.list_recent_files.done":`Listed recent files`,"tool.list_recent_files.active":`Listing recent files`,"tool.analyze_data_file.done":`Analyzed data`,"tool.analyze_data_file.active":`Analyzing data`,"tool.run_shell_command.done":`Ran command`,"tool.run_shell_command.active":`Running command`,"tool.execute_code.done":`Executed code`,"tool.execute_code.active":`Executing code`,"tool.query_documents.done":`Queried documents`,"tool.query_documents.active":`Querying documents`,"tool.query_specific_file.done":`Queried file`,"tool.query_specific_file.active":`Querying file`,"tool.search_indexed_chunks.done":`Searched chunks`,"tool.search_indexed_chunks.active":`Searching chunks`,"tool.semantic_search.done":`Searched documents`,"tool.semantic_search.active":`Searching documents`,"tool.evaluate_retrieval.done":`Evaluated retrieval`,"tool.evaluate_retrieval.active":`Evaluating retrieval`,"tool.index_document.done":`Indexed document`,"tool.index_document.active":`Indexing document`,"tool.index_documents.done":`Indexed documents`,"tool.index_documents.active":`Indexing documents`,"tool.index_directory.done":`Indexed directory`,"tool.index_directory.active":`Indexing directory`,"tool.index_file.done":`Indexed file`,"tool.index_file.active":`Indexing file`,"tool.list_indexed_documents.done":`Listed documents`,"tool.list_indexed_documents.active":`Listing documents`,"tool.summarize_document.done":`Summarized`,"tool.summarize_document.active":`Summarizing`,"tool.dump_document.done":`Extracted text`,"tool.dump_document.active":`Extracting text`,"tool.rag_status.done":`Checked RAG status`,"tool.rag_status.active":`Checking RAG`,"tool.add_watch_directory.done":`Added watch dir`,"tool.add_watch_directory.active":`Adding watch dir`,"tool.web_search.done":`Searched web`,"tool.web_search.active":`Searching web`,"tool.search_web.done":`Searched web`,"tool.search_web.active":`Searching web`,"tool.fetch_page.done":`Read web page`,"tool.fetch_page.active":`Reading web page`,"tool.fetch_webpage.done":`Read web page`,"tool.fetch_webpage.active":`Reading web page`,"tool.analyze_data.done":`Analyzed data`,"tool.analyze_data.active":`Analyzing data`,"tool.find_files.done":`Found files`,"tool.find_files.active":`Finding files`,"tool.edit_file.done":`Edited file`,"tool.edit_file.active":`Editing file`,"tool.recall.done":`Recalled memory`,"tool.recall.active":`Recalling memory`,"tool.remember.done":`Saved to memory`,"tool.remember.active":`Saving to memory`,"tool.update_memory.done":`Updated memory`,"tool.update_memory.active":`Updating memory`,"tool.forget.done":`Deleted from memory`,"tool.forget.active":`Deleting from memory`,"tool.search_past_conversations.done":`Searched past chats`,"tool.search_past_conversations.active":`Searching past chats`,"tool.request_user_input.done":`Asked you`,"tool.request_user_input.active":`Asking you`,"tool.load_skill.done":`Used skill`,"tool.load_skill.active":`Loading skill`,"tool.unload_skill.done":`Put away skill`,"tool.unload_skill.active":`Putting away skill`,"tool.list_skills.done":`Checked skills`,"tool.list_skills.active":`Checking skills`,"tool.search_skill_hub.done":`Searched skills`,"tool.search_skill_hub.active":`Searching skills`,"tool.install_skill.done":`Installed skill`,"tool.install_skill.active":`Installing skill`,"tool.capture_skill.done":`Saved skill`,"tool.capture_skill.active":`Saving skill`,"tool.remove_skill.done":`Removed skill`,"tool.remove_skill.active":`Removing skill`,"tool.skill_status.done":`Checked skill`,"tool.skill_status.active":`Checking skill`,"docs.title":`Document library`,"docs.close":`Close document library`,"docs.untitledChat":`Untitled chat`,"docs.addTo":`Add documents to`,"docs.thisChat":`This chat: {chat}`,"docs.nextChat":`Your next new chat`,"docs.nextChatOnly":`Documents you add here are attached to your next new chat.`,"docs.hint":`A chat searches only the documents attached to it.`,"docs.drop":`Drop files here to index`,"docs.dropHint":`PDF, TXT, MD, code files, and 50+ formats`,"docs.pathPlaceholder":`Or enter a file or folder path: {example}`,"docs.pathAria":`File path to index`,"docs.index":`Index`,"docs.browse":`Browse files`,"docs.browseTitle":`Browse files on this computer`,"docs.count.one":`{n} document`,"docs.count.other":`{n} documents`,"docs.chunks.one":`{n} chunk`,"docs.chunks.other":`{n} chunks`,"docs.empty":`No documents indexed yet`,"docs.emptyHint":`Drop files above or enter a file path`,"docs.indexingFile":`Indexing {name}...`,"docs.indexingFolder":`Indexing the documents in {name}...`,"docs.willAttach":`{name} will be attached to your next new chat.`,"docs.attached":`Attached {name} to {chat}.`,"docs.indexing":`Indexing...`,"docs.indexingLabel":`Indexing`,"docs.progress.reading":`Reading page {done} of {total}`,"docs.progress.readingCount":`Reading page {done}`,"docs.progress.embedding":`Embedding {done} of {total}`,"docs.progress.embeddingCount":`Embedding chunk {done}`,"docs.cancelIndexing":`Cancel indexing`,"docs.cancelIndexingAria":`Cancel indexing {name}`,"docs.cancel":`Cancel`,"docs.failed":`Failed`,"docs.cantRead":`Can't be read`,"docs.failedAria":`Failed: {error}`,"docs.indexingFailed":`Indexing failed`,"docs.retry":`Retry`,"docs.retrying":`Retrying…`,"docs.retryTitle":`Retry indexing`,"docs.retryTitleFix":`Retry indexing (fix the file first, or this fails again)`,"docs.retryAria":`Retry indexing {name}`,"docs.noReason":`GAIA didn't record why. Retry to see the error.`,"docs.cancelled":`Cancelled`,"docs.missing":`File missing`,"docs.indexedAt":`Indexed: {time}`,"docs.openFolder":`Open folder: {path}`,"docs.openFolderAria":`Open containing folder for {name}`,"docs.useIn":`Use in {chat}`,"docs.useNext":`Use in your next chat`,"docs.attachAria":`Attach {name} to {chat}`,"docs.attachNextAria":`Attach {name} to your next chat`,"docs.remove":`Remove`,"docs.removeAria":`Remove {name}`,"docs.dismissFolder":`Dismiss folder indexing result`,"time.justNow":`just now`,"time.minutesAgo":`{n}m ago`,"time.hoursAgo":`{n}h ago`,"time.yesterday":`yesterday`,"time.daysAgo":`{n}d ago`,"sp.label":`Session panel`,"sp.resize":`Resize session panel`,"sp.title":`This chat`,"sp.close":`Close session panel`,"sp.closeShort":`Close`,"sp.show":`Show session panel`,"sp.hide":`Hide session panel`,"sp.showWarn":`Show session panel: couldn't get live data`,"sp.section.answer":`This answer`,"sp.section.context":`Context & performance`,"sp.checking":`Checking…`,"sp.open":`Open`,"sp.showInFolder":`Show in folder`,"sp.goToTurn":`Go to turn`,"sp.cancel":`Cancel`,"sp.couldntOpen":`Couldn't open {name}: {error}`,"sp.gone":`No longer on disk`,"rail.pending":`Working on this answer. Its sources, files and where its data went appear here when it finishes.`,"rail.noLive":`Couldn't get live data`,"rail.noLiveWhy":`Every web lookup this turn failed, so the answer isn't based on current information.`,"rail.error":`Couldn't put together this turn's sources and details: {error}`,"rail.sources":`Sources`,"rail.searchResult":`search result`,"rail.pages.one":`p. {list}`,"rail.pages.other":`pp. {list}`,"rail.passages.one":`{n} passage`,"rail.passages.other":`{n} passages`,"rail.files":`Files`,"rail.changedSince":`Changed since this turn`,"rail.checkFailed":`Couldn't check whether these files changed: {error}`,"rail.thisTurn":`This turn`,"rail.model":`Model`,"rail.cloudModel":`{name} (cloud)`,"rail.thisPc":`This PC`,"rail.notReported":`Not reported`,"rail.documents":`Documents`,"rail.docsSent":`Searched on this PC. The passages used were sent to {provider}.`,"rail.docsLocal":`Read on this PC and stayed here.`,"rail.docsSearched":`Searched on this PC.`,"rail.websites":`Websites`,"rail.noSites":`None from GAIA's web tools`,"rail.cost":`Cost`,"rail.costLocal":`No cloud charges`,"rail.costAbout":"About ${usd} at list price","rail.costUnknownModel":`Not known for this model`,"rail.costUnknown":`Not known`,"env.title":`Environment`,"env.offline":`Offline`,"env.runsOn":`Runs on`,"env.cloudPlace":`{name} (cloud)`,"env.notKnownYet":`Not known yet`,"env.thisPc":`This PC`,"env.notLoaded":`{model} · not loaded right now`,"env.inUse":`{gb} GB in use`,"env.inUseUnknown":`Memory in use unknown`,"env.free":`{gb} GB free`,"env.reach":`Files GAIA can reach`,"env.readWrite":`Can read and write`,"env.flagshipScope":`These folders are where GAIA starts, not a limit: it can also open folders inside your user folder, one at a time, but never the whole user folder at once. In Ask mode it asks before it opens a new folder or changes anything.`,"env.agentScope":`These folders are where this chat's agent starts; it applies its own limits.`,"env.foldersError":`Couldn't read this chat's folders: {error}`,"env.nothing":`Nothing yet. GAIA can't read or write any folder in this chat.`,"env.fewerFiles":`Show fewer files`,"env.allFiles":`Show all {n} files`,"env.ownProcess":`This chat's agent runs as its own process, so its folders can't be changed from here.`,"env.removed":`Removed: {names}. GAIA is refused there until you add it back.`,"env.addFolder":`Add folder`,"env.remove":`Remove {path} from this chat`,"env.removeShort":`Remove from this chat`,"env.source.added":`Added by you`,"env.source.gaia_documents":`GAIA's documents folder`,"env.source.scratch":`GAIA's scratch folder`,"env.source.document":`Document in this chat`,"env.source.working_folder":`Folder GAIA started in`,"env.source.approved":`Approved during this chat`,"env.source.allowed_paths":`Set by GAIA_ALLOWED_PATHS`,"env.internet":`Internet`,"env.internetFor":`Internet for this chat`,"env.on":`On`,"env.off":`Off`,"env.offBlocked":`Off: web search and pages are blocked`,"env.phone":`Phone access`,"env.stopping":`Stopping…`,"env.starting":`Starting…`,"env.phoneConnected":`{name} connected`,"env.noPhone":`No phone connected yet`,"env.qr":`Show QR code`,"env.permission":`Permission mode`,"env.ask":`Ask`,"env.fullAccessWarn":`Full access lets GAIA change files and run commands on this PC without asking.`,"env.turnOn":`Turn it on`,"perm.ask":`Ask before acting`,"perm.askNote":`GAIA asks before it edits files, runs commands or uses tools that change things.`,"perm.full":`Full access`,"perm.fullNote":`Runs every tool and command without asking, in this chat only.`,"offline.text":`Offline: internet is off for this chat, so GAIA won't search the web or open pages.`,"offline.error":`Couldn't turn it on: {error}`,"offline.turnOn":`Turn on`,"out.title":`Outputs`,"out.kind.file":`File`,"out.kind.export":`Export`,"out.kind.image":`Image`,"out.kind.document":`Indexed document`,"out.kind.memory":`Memory saved`,"out.kind.schedule":`Scheduled task`,"out.change.created":`created`,"out.change.edited":`edited`,"out.change.deleted":`deleted`,"out.kindChanged":`{kind} {change}`,"out.justNow":`just now`,"out.minAgo":`{n} min ago`,"out.hAgo":`{n} h ago`,"out.undone":`Undone`,"out.listError":`Couldn't list what this chat produced: {error}`,"out.empty":`Nothing yet. Files, documents, images and memories this chat makes appear here.`,"out.listLabel":`What this chat produced`,"out.notLoaded":`That turn isn't loaded in the chat right now.`,"out.goToAria":`Go to the turn that made {name}`,"out.fewer":`Show fewer`,"out.more":`Show {n} more`,"chg.title":`Changes`,"chg.files.one":`{n} file`,"chg.files.other":`{n} files`,"chg.summary":`{files} · +{add} −{del}`,"chg.total":`{files} changed, +{add} −{del}`,"chg.error":`Couldn't total this chat's changes: {error}`,"chg.uncounted.one":`{n} binary or large file not line-counted`,"chg.uncounted.other":`{n} binary or large files not line-counted`,"chg.pending":`A reply is still running; its changes are added when it ends.`,"chg.edited":`Edited`,"chg.created":`Created`,"chg.deleted":`Deleted`,"chg.turns":`{n} turns`,"chg.outside":`Changed outside GAIA: {when}`,"chg.goToLast":`Go to the last turn that changed {name}`,"chg.review":`Review changes`,"chg.wait":`Wait for the reply to finish`,"chg.undoing":`Undoing…`,"chg.undoAll":`Undo all`,"chg.confirmLabel":`Confirm undo all`,"chg.confirm.one":`Put {files} back the way it was before this chat? Every turn's file changes are undone.`,"chg.confirm.other":`Put {files} back the way they were before this chat? Every turn's file changes are undone.`,"chg.undoAnyway":`Undo anyway and lose those changes`,"chg.keep":`Keep them`,"chg.gitError":`Couldn't check for a git repository: {error}`,"pick.label":`Add a folder to this chat`,"pick.title":`Add a folder`,"pick.note":`GAIA will be able to read and write everything in the folder you pick, in this chat only.`,"pick.path":`Folder path`,"pick.go":`Go`,"pick.onlyHidden":`Only hidden folders here. Turn on Show hidden to see them.`,"pick.none":`No folders inside.`,"pick.loading":`Loading…`,"perm.chipAria":`Permission mode: {mode}`,"perm.fullLower":`full access`,"perm.askLower":`ask before acting`,"pick.showHidden":`Show hidden`,"pick.up":`Up one level`,"pick.use":`Use this folder`,"ctx.sheetAria":`Context and performance`,"ctx.unknown":`unknown`,"ctx.tokens":`{n} tokens`,"ctx.rate":`{n} tokens/s`,"ctx.rateTitle":`{n} tokens per second`,"ctx.cloud":`Cloud`,"ctx.cloudVia":`Cloud · {provider}`,"ctx.notLoadedNow":`Not loaded now`,"ctx.took":`Took`,"ctx.tookHint":`From sending the message to the answer being saved`,"ctx.split":`split`,"ctx.inModel":`In the model`,"ctx.runningTools":`Running tools`,"ctx.waitingOnYou":`Waiting on you`,"ctx.gaiaItself":`GAIA itself`,"ctx.inGaia":`In GAIA`,"ctx.inGaiaHint":`Everything that was not the model: tools, waiting on you, and GAIA's own work`,"ctx.src.server":`Reported by the model server`,"ctx.src.client":`Measured by GAIA on the stream, network included`,"ctx.toolOutside":`tool work outside a step`,"ctx.firstWord":`First word`,"ctx.in":`in`,"ctx.readingPrompt":`Reading the prompt`,"ctx.readingHint":`Prefill: new prompt tokens over time to first token`,"ctx.tooFewTitle":`Too few new tokens to give a reading speed; the rest came from the cache`,"ctx.onlyNew":`only {n} new tokens`,"ctx.approx":`approx.`,"ctx.approxTitle":`Measured by GAIA from the first word, so it includes network and queue time`,"ctx.writing":`Writing the answer`,"ctx.writingHint":`Generation speed, weighted by tokens`,"ctx.tokensInOut":`Tokens in → out`,"ctx.cache":`Reused from cache`,"ctx.cacheHint":`Prompt tokens the server did not have to read again`,"ctx.modelCalls":`Model calls`,"ctx.toolCalls":`Tool calls`,"ctx.none":`none`,"ctx.loads":`Model loads`,"ctx.costLocalTitle":`Runs on this PC`,"ctx.costLocal":`$0 · on this PC`,"ctx.listPriceTitle":"${usd} at list price","ctx.about":"about ${usd}","ctx.turns":`Turns measured`,"ctx.totalTime":`Total time`,"ctx.unpricedTitle":`{n} turn(s) on a model with no known price`,"ctx.unpriced":"${usd} + {n} unpriced","ctx.live":`Live in the window`,"ctx.putAway":`Put away`,"ctx.putAwayHint":`Older tool results moved out of the prompt; still readable`,"ctx.results.one":`{n} result`,"ctx.results.other":`{n} results`,"ctx.summarized":`Summarized`,"ctx.summarizedHint":`Older turns folded into a running summary; the originals stay saved`,"ctx.earlier.one":`{n} earlier turn`,"ctx.earlier.other":`{n} earlier turns`,"ctx.summarizedNote":`Earlier messages summarized — still searchable.`,"ctx.filling":`The window is filling up. Older tool results move out of the prompt and stay readable, and the oldest turns may drop out of the model's view. They stay saved, and you can ask GAIA to recall them.`,"ctx.context":`Context`,"ctx.measuring":`Measuring…`,"ctx.used":`{pct}% used`,"ctx.of":`of`,"ctx.tokensWord":`tokens`,"ctx.windowTitle":`GAIA admits this much of the window, so older turns drop out of view sooner than the model would need`,"ctx.gaiaUses":`GAIA uses`,"ctx.ofModel":`of the model's`,"ctx.freeRow":`Free`,"ctx.reserve":`of which kept for the reply`,"ctx.exactTokenizer":`Each part counted with {model}'s own tokenizer.`,"ctx.estimated":`Estimated: {reason}`,"ctx.sharedTokenizer":`counted with a shared tokenizer.`,"ctx.lastRequest":`The last request carried {n} tokens as the model server counted them, chat formatting included.`,"ctx.onDemand":`{n} more tools load only when needed`,"ctx.sentNow":`Sent now: {n}. These cost nothing until a turn needs them:`,"ctx.hood":`Under the hood`,"ctx.show":`Show`,"ctx.lastTurn":`Last turn`,"ctx.memory":`Model memory`,"ctx.memoryHint":`Model weights + KV cache at this window; free memory now`,"ctx.gbModel":`{gb} GB model`,"ctx.gbCache":`{gb} GB cache`,"ctx.freeUnknown":`free unknown`,"ctx.afterNext":`Shown after GAIA's next answer in this chat.`,"ctx.latestAnswer":`Latest answer:`,"ctx.notMeasured":`It was not measured.`,"settings.title":`Settings`,"settings.sections":`Settings sections`,"settings.close":`Close settings`,"settings.loading":`Loading…`,"settings.section.general":`General`,"settings.section.model":`Model`,"settings.section.permissions":`Permissions`,"settings.section.skills":`Skills`,"settings.section.connectors":`Connectors`,"settings.section.memory":`Memory`,"settings.section.notifications":`Notifications`,"settings.section.privacy":`Privacy`,"settings.section.advanced":`Advanced`,"settings.language":`Language`,"settings.languageHint":`Changes the app’s labels and layout, not the language GAIA answers in.`,"settings.appearance":`Appearance`,"settings.theme.light":`Light`,"settings.theme.dark":`Dark`,"settings.theme.system":`Match system`,"settings.colors":`Colors`,"palette.default":`Warm gray`,"palette.stone":`Stone and ink`,"palette.marble":`Blue marble`,"palette.glacier":`Glacier`,"palette.forest":`Forest floor`,"palette.sage":`Sage and mist`,"palette.basalt":`Basalt and lichen`,"palette.gold":`Graphite and gold`,"palette.dusk":`Dusk`,"settings.colors.custom":`Custom`,"settings.colors.accent":`Accent`,"settings.colors.accentHint":`Buttons, links and focus`,"settings.colors.base":`Background tint`,"settings.colors.baseHint":`The color the grays lean toward`,"settings.colors.reset":`Reset`,"settings.colors.hint":`Text colors adjust on their own so everything stays readable in light and dark.`,"settings.shortcuts":`Keyboard shortcuts`,"settings.shortcut.send":`Send`,"settings.shortcut.newLine":`New line`,"settings.shortcut.stop":`Stop the answer`,"settings.shortcut.newChat":`New chat`,"settings.shortcut.search":`Search chats`,"settings.shortcut.sidebar":`Show or hide the sidebar`,"settings.shortcut.settings":`Settings`},wr={meta:{code:`en`,nativeName:`English`,englishName:`English`,dir:`ltr`,showEnglishInBrackets:!1},messages:Cr},Tr=[wr,Sr],Er=wr.meta.code,Dr=new Map(Tr.map(e=>[e.meta.code,e]));function Or(e){return typeof e==`string`&&Dr.has(e)}function kr(e){let t=Dr.get(e);if(!t)throw Error(`Unknown UI locale "${e}". Registered: ${[...Dr.keys()].join(`, `)}. Add it to LOCALES in src/i18n/registry.ts.`);return t}var Ar=``,jr=``,Mr=``,Nr=``;function Pr(e,t){return`${t===`rtl`?jr:Ar}${e}${Nr}`}function Fr(e,t,n){return kr(e).meta.dir===`rtl`?`${t} ${Pr(`(${n})`,`ltr`)}`:`${t} (${n})`}function Ir(e){return e.nativeName===e.englishName?e.nativeName:e.dir===`rtl`?`${Pr(e.nativeName,`rtl`)} ${Pr(`(${e.englishName})`,`ltr`)}`:`${e.nativeName} (${e.englishName})`}var Lr=(e,t)=>({ref:e,params:t});function Rr(e,t,n,r=!1){return e.messages[t].replace(/\{(\w+)\}/g,(i,a)=>{let o=n?.[a];if(o===void 0)throw Error(`Message "${t}" needs a {${a}} param, and the caller passed none.`);return typeof o==`object`?Rr(e,o.ref,o.params,r):r&&typeof o==`string`?`${Mr}${o}${Nr}`:String(o)})}function zr(e,t,n){return Br(e,e=>e(t,n))}function Br(e,t){let n=kr(e),r=n.meta.dir===`rtl`,i=t((e,t)=>Rr(n,e,t,r));if(!n.meta.showEnglishInBrackets||n===wr)return i;let a=t((e,t)=>Rr(wr,e,t,r));return i===a?i:`${Pr(i,n.meta.dir)}${Hr}${Pr(`(${a})`,`ltr`)}`}function Vr(e,t,n){let r=kr(e);return Rr(r,t,n,r.meta.dir===`rtl`)}var Hr=` `;function Ur(e){let t=e.indexOf(`${Nr}${Hr}${Ar}(`);return t<0?[e]:[e.slice(0,t+1),e.slice(t+1+1)]}function Wr(e,t){return`${e}.${t===1?`one`:`other`}`}function Gr(e){return Object.prototype.hasOwnProperty.call(wr.messages,e)}function Kr(e){let{meta:t}=kr(e);document.documentElement.lang=t.code,document.documentElement.dir=t.dir}var qr=[`sending`,`delivered`,`queued`,`starting`,`failed`],Jr=1;function Yr(e,t){return{id:Jr++,text:e,state:t}}function Xr(e,t,n){return[...e,Yr(t,n)]}function Zr(e,t,n,r){return e.map(e=>e.id===t&&e.state===n?{...e,state:r,error:void 0,note:void 0}:e)}var Qr=`Can't add to this reply; it will send when the reply ends.`;function $r(e,t){return e.map(e=>e.id===t&&e.state===`sending`?{...e,state:`queued`,note:Qr}:e)}function ei(e,t){return e.filter(e=>e.id!==t)}function ti(e,t,n){return e.some(e=>e.id===t&&e.state===`starting`)?e.map(e=>e.id===t?n===void 0?{...e,state:`queued`,error:void 0}:{...e,state:`failed`,error:n}:e):e}var ni=e=>e.state===`delivered`||e.state===`sending`;function ri(e,t){let n=e.findIndex(e=>ni(e)&&e.text===t);return n===-1?e:[...e.slice(0,n),...e.slice(n+1)]}function ii(e,t){let n=[...t];return e.map(e=>{let t=ni(e)?n.indexOf(e.text):-1;return t===-1?e:(n.splice(t,1),{...e,state:`queued`})})}function ai(e){return e.some(e=>e.state===`delivered`)}var oi=`GAIA could not confirm it read this message.`;function si(e,t){let n=[...t.returned],r=[...t.taken],i=[];for(let t of e){if(t.state!==`delivered`){i.push(t);continue}let e=n.indexOf(t.text);if(e!==-1){n.splice(e,1),i.push({...t,state:`queued`});continue}let a=r.indexOf(t.text);a===-1?i.push({...t,state:`failed`,error:oi}):r.splice(a,1)}return i}function ci(e,t){return e.map(e=>e.state===`delivered`?{...e,state:`failed`,error:t}:e)}function li(e){if(e.some(e=>ni(e)||e.state===`starting`))return;let t=e.find(e=>e.state===`queued`||e.state===`failed`);return t?.state===`queued`?t:void 0}var ui=`GAIA closed while this was being sent, so it may not have gone out. Check the chat above before sending it again.`;function di(e){if(!e||typeof e!=`object`)return{};let t={};for(let[n,r]of Object.entries(e)){if(!Array.isArray(r))continue;let e=r.filter(e=>!!e&&typeof e==`object`&&typeof e.id==`number`&&typeof e.text==`string`&&qr.includes(e.state)).map(e=>e.state===`sending`?{...e,state:`delivered`}:e.state===`starting`?{...e,state:`failed`,error:ui}:e);for(let t of e)Jr=Math.max(Jr,t.id+1);e.length&&(t[n]=e)}return t}function fi(e,t){return e.length===t.length&&e.every(e=>t.includes(e))}function pi(e,t){if(typeof window>`u`)return t;try{return localStorage.getItem(e)||t}catch(n){return s.system.warn(`Preference "${e}" unreadable, using "${t}". localStorage is blocked -- check private-browsing or site-data settings.`,n),t}}function mi(){let e=pi(`gaia-chat-theme`,`system`);return e===`light`||e===`dark`?e:`system`}function hi(){let e=pi(`gaia-chat-palette`,`default`);return sr.has(e)?e:`default`}function gi(){try{let e=JSON.parse(pi(`gaia-chat-custom-colors`,`null`));if(e&&ur(e.accent)&&ur(e.base))return{accent:e.accent,base:e.base}}catch(e){s.system.warn(`Saved custom colors unreadable; starting from the default pair.`,e)}return cr}var _i=`gaia-chat-locale`;function vi(){let e=pi(_i,Er);return Or(e)?e:(s.system.warn(`Saved interface language "${e}" is not a registered locale; using English.`),Er)}function yi(e,t){try{localStorage.setItem(e,t)}catch(t){s.system.warn(`Preference "${e}" not saved -- it will reset on reload. localStorage is blocked -- check private-browsing or site-data settings.`,t)}}var bi=`gaia-chat-message-queues`;function xi(){try{return di(JSON.parse(pi(bi,`{}`)))}catch(e){return s.system.warn(`Saved queued messages unreadable; starting with none.`,e),{}}}var Si={showMemoryDashboard:!1,showSchedules:!1,showDocLibrary:!1},H=$n((e,t)=>({agents:[],setAgents:t=>e({agents:t}),sessions:[],currentSessionId:null,pendingDeleteIds:[],runningSessionIds:[],setRunningSessions:t=>e(e=>fi(e.runningSessionIds,t)?e:{runningSessionIds:t}),queuedSessionIds:[],awaitingBySession:{},activeRunsAt:0,setActiveRuns:(t,n)=>e(e=>{let r={activeRunsAt:n};return fi(e.runningSessionIds,t.session_ids)||(r.runningSessionIds=t.session_ids),e.queuedSessionIds.join()!==t.queued.join()&&(r.queuedSessionIds=t.queued),JSON.stringify(e.awaitingBySession)!==JSON.stringify(t.awaiting_user)&&(r.awaitingBySession=t.awaiting_user),r}),messageQueues:xi(),updateQueue:(t,n)=>e(e=>{let r=e.messageQueues[t]??[],i=n(r);if(i.length===r.length&&i.every((e,t)=>e===r[t]))return e;let a={...e.messageQueues};return i.length?a[t]=i:delete a[t],yi(bi,JSON.stringify(a)),{messageQueues:a}}),queueHolds:{},setQueueHold:(t,n)=>e(e=>{if(!!e.queueHolds[t]===n)return e;let r={...e.queueHolds};return n?r[t]=!0:delete r[t],{queueHolds:r}}),setSessions:t=>e(e=>({sessions:t.filter(t=>!e.pendingDeleteIds.includes(t.id))})),setCurrentSession:t=>e(t?{currentSessionId:t,showMemoryDashboard:!1,showSchedules:!1}:{currentSessionId:t}),addSession:t=>e(e=>({sessions:[t,...e.sessions]})),removeSession:t=>e(e=>{let n={sessions:e.sessions.filter(e=>e.id!==t),currentSessionId:e.currentSessionId===t?null:e.currentSessionId,messages:e.currentSessionId===t?[]:e.messages};if(e.messageQueues[t]){let r={...e.messageQueues};delete r[t],yi(bi,JSON.stringify(r)),n.messageQueues=r}if(e.queueHolds[t]){let r={...e.queueHolds};delete r[t],n.queueHolds=r}return n}),updateSessionInList:(t,n)=>e(e=>({sessions:e.sessions.map(e=>e.id===t?{...e,...n}:e)})),addPendingDelete:t=>e(e=>({pendingDeleteIds:[...e.pendingDeleteIds,t]})),removePendingDelete:t=>e(e=>({pendingDeleteIds:e.pendingDeleteIds.filter(e=>e!==t)})),messages:[],setMessages:t=>e({messages:t}),addMessage:t=>e(e=>({messages:[...e.messages,t]})),removeMessage:t=>e(e=>({messages:e.messages.filter(e=>e.id!==t)})),removeMessagesFrom:t=>e(e=>{let n=e.messages.findIndex(e=>e.id===t);return n===-1?e:{messages:e.messages.slice(0,n)}}),isStreaming:!1,streamingContent:``,setStreaming:t=>e({isStreaming:t}),setStreamContent:t=>e({streamingContent:t}),clearStreamContent:()=>e({streamingContent:``}),resetStreaming:()=>e({isStreaming:!1,streamingContent:``,agentSteps:[],cards:[],liveStatus:null,livePhase:null,awaitingUser:!1}),agentSteps:[],addAgentStep:t=>e(e=>({agentSteps:[...e.agentSteps.map(e=>e.active&&e.type===`tool`&&t.type!==`tool`&&e.success==null&&!e.result?e:{...e,active:!1}),t]})),updateLastAgentStep:t=>e(e=>{if(e.agentSteps.length===0)return e;let n=[...e.agentSteps];return n[n.length-1]={...n[n.length-1],...t},{agentSteps:n}}),appendThinkingContent:t=>e(e=>{if(e.agentSteps.length===0)return e;let n=[...e.agentSteps],r=n[n.length-1];return r.type===`thinking`?(n[n.length-1]={...r,detail:(r.detail??``)+t,active:!0},{agentSteps:n}):e}),updateLastToolStep:t=>e(e=>{if(e.agentSteps.length===0)return e;let n=[...e.agentSteps];for(let e=n.length-1;e>=0;e--)if(n[e].type===`tool`)return n[e]={...n[e],...t},{agentSteps:n};return e}),clearAgentSteps:()=>e({agentSteps:[],liveStatus:null,livePhase:null,awaitingUser:!1}),liveStatus:null,livePhase:null,setLiveStatus:(t,n=null)=>e({liveStatus:t,livePhase:n}),awaitingUser:!1,setAwaitingUser:t=>e({awaitingUser:t}),liveQuestions:{},openQuestion:(t,n,r)=>e(e=>({liveQuestions:{...e.liveQuestions,[t]:{sessionId:n,expiresAt:r!=null&&r>0?Date.now()+r*1e3:null}}})),closeQuestion:t=>e(e=>{if(!(t in e.liveQuestions))return e;let{[t]:n,...r}=e.liveQuestions;return{liveQuestions:r}}),closeSessionQuestions:t=>e(e=>{let n=Object.fromEntries(Object.entries(e.liveQuestions).filter(([,e])=>e.sessionId!==t));return Object.keys(n).length===Object.keys(e.liveQuestions).length?e:{liveQuestions:n}}),cards:[],appendCard:t=>e(e=>({cards:[...e.cards,t]})),clearCards:()=>e({cards:[]}),documents:[],setDocuments:t=>e({documents:t}),systemStatus:null,backendConnected:!0,setSystemStatus:t=>e({systemStatus:t}),setBackendConnected:t=>e({backendConnected:t}),themePreference:mi(),theme:tr(mi()),showDocLibrary:!1,showFileBrowser:!1,settingsSection:null,settingsProvider:null,showMemoryDashboard:!1,showSchedules:!1,draftPermissionMode:`ask`,draftPermissionModeChosen:!1,defaultPermissionMode:`ask`,defaultPermissionModeKnown:!1,draftDocumentIds:[],draftPrivate:!1,draftFolder:null,setThemePreference:n=>{yi(`gaia-chat-theme`,n);let r=tr(n);rr(r),xr(t().palette,t().customColors,r),e({themePreference:n,theme:r})},syncSystemTheme:()=>{if(t().themePreference!==`system`)return;let n=tr(`system`);rr(n),xr(t().palette,t().customColors,n),e({theme:n})},locale:vi(),setLocale:t=>{Kr(t),yi(_i,t),e({locale:t})},palette:hi(),customColors:gi(),setPalette:n=>{yi(`gaia-chat-palette`,n),xr(n,t().customColors,t().theme),e({palette:n})},setCustomColors:n=>{yi(`gaia-chat-custom-colors`,JSON.stringify(n)),xr(`custom`,n,t().theme),yi(`gaia-chat-palette`,`custom`),e({customColors:n,palette:`custom`})},sidebarOpen:typeof window<`u`?window.innerWidth>768:!0,sidebarCollapsed:pi(`gaia-chat-sidebar-collapsed`,`false`)===`true`,isLoadingMessages:!1,pendingPrompt:null,setShowDocLibrary:t=>e(t?{...Si,showDocLibrary:!0}:{showDocLibrary:!1}),setShowFileBrowser:t=>e({showFileBrowser:t}),openSettings:(t=`general`,n)=>e({settingsSection:t,settingsProvider:n??null}),closeSettings:()=>e({settingsSection:null,settingsProvider:null}),setShowMemoryDashboard:t=>e(t?{...Si,showMemoryDashboard:!0}:{showMemoryDashboard:!1}),setShowSchedules:t=>e(t?{...Si,showSchedules:!0}:{showSchedules:!1}),setDraftPermissionMode:t=>e({draftPermissionMode:t,draftPermissionModeChosen:!0}),setDefaultPermissionMode:t=>e(e=>({defaultPermissionMode:t,defaultPermissionModeKnown:!0,draftPermissionMode:!e.draftPermissionModeChosen&&e.draftPermissionMode===e.defaultPermissionMode?t:e.draftPermissionMode})),resetDraftPermissionMode:()=>e(e=>({draftPermissionMode:e.defaultPermissionMode,draftPermissionModeChosen:!1})),setDraftPrivate:t=>e({draftPrivate:t}),setDraftFolder:t=>e({draftFolder:t}),addDraftDocuments:t=>e(e=>{let n=t.filter(t=>!e.draftDocumentIds.includes(t));return n.length?{draftDocumentIds:[...e.draftDocumentIds,...n]}:e}),removeDraftDocument:t=>e(e=>({draftDocumentIds:e.draftDocumentIds.filter(e=>e!==t)})),clearDraftDocuments:()=>e({draftDocumentIds:[]}),setSidebarOpen:t=>e({sidebarOpen:t}),toggleSidebarCollapsed:()=>e(e=>{let t=!e.sidebarCollapsed;return yi(`gaia-chat-sidebar-collapsed`,String(t)),{sidebarCollapsed:t}}),setSidebarCollapsed:t=>{yi(`gaia-chat-sidebar-collapsed`,String(t)),e({sidebarCollapsed:t})},setLoadingMessages:t=>e({isLoadingMessages:t}),setPendingPrompt:t=>e({pendingPrompt:t})})),Ci={"data-claims-escape":``},wi=[];function Ti(e){if(e.key!==`Escape`||e.defaultPrevented)return;let t=wi[wi.length-1];t&&(e.preventDefault(),t.close?.())}function Ei(e){return wi.length===0&&document.addEventListener(`keydown`,Ti),wi.push(e),()=>{wi.splice(wi.indexOf(e),1),wi.length===0&&document.removeEventListener(`keydown`,Ti)}}function Di(e){if(e.defaultPrevented||wi.length>0)return!0;let t=e.target;return t instanceof Element&&t.closest(`[data-claims-escape]`)!==null}function Oi(e){(0,V.useEffect)(()=>e?Ei({}):void 0,[e])}function ki(e,t,n=!0){let r=(0,V.useRef)(t),i=(0,V.useRef)(n);(0,V.useEffect)(()=>{r.current=t,i.current=n}),(0,V.useEffect)(()=>{if(e)return Ei({close:()=>{i.current&&r.current()}})},[e])}var U=a(),Ai=14;function ji({open:e,onClose:t,anchor:n,label:r,placement:i=`above`,align:a=`start`,children:o}){let s=(0,V.useRef)(null),[c,l]=(0,V.useState)(i),[u,d]=(0,V.useState)(null);return(0,V.useLayoutEffect)(()=>{if(!e)return;let t=()=>{let e=n.current?.getBoundingClientRect(),t=s.current;if(!e||!t)return;let r=e.top-Ai,a=window.innerHeight-e.bottom-Ai,o=i===`above`?r:a,c=i===`above`?a:r,u=t.scrollHeight>o&&c>o;l(u?i===`above`?`below`:`above`:i),d(Math.max(0,Math.floor(u?c:o)))};t();let r=new MutationObserver(t);return s.current&&r.observe(s.current,{childList:!0,subtree:!0}),window.addEventListener(`resize`,t),()=>{r.disconnect(),window.removeEventListener(`resize`,t)}},[e,i,n]),Oi(e),(0,V.useEffect)(()=>{if(!e)return;(s.current?.querySelector(`button:not(:disabled), input, [tabindex="0"]`))?.focus();let r=e=>{let r=e.target;s.current?.contains(r)||n.current?.contains(r)||t()},i=e=>{e.key===`Escape`&&(e.stopPropagation(),e.preventDefault(),t(),n.current?.focus())};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i,!0),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i,!0)}},[e,t,n]),e?(0,U.jsx)(`div`,{ref:s,className:`popover popover-${c} popover-${a}`,style:u===null?void 0:{"--popover-room":`${u}px`},role:`dialog`,"aria-label":r,children:o}):null}var Mi=`gaia:draft:`,Ni=e=>`chat:${e}`,Pi=`new-chat`;function Fi(e){try{return localStorage.getItem(Mi+e)??``}catch(t){return s.ui.warn(`Couldn't read the saved draft for ${e}`,t),``}}function Ii(e,t){try{t?localStorage.setItem(Mi+e,t):localStorage.removeItem(Mi+e)}catch(t){s.ui.warn(`Couldn't save the draft for ${e}`,t)}}function Li(e){Ii(e,``)}async function Ri(){return G(`GET`,`/connectors`)}async function zi(e){return G(`GET`,`/connectors/${e}`)}async function Bi(e,t,n=[]){return G(`POST`,`/connectors/${e}/authorize`,{scopes:t,grant_agents:n},xa)}async function Vi(e,t,n=[]){return G(`POST`,`/connectors/${e}/authorize-device`,{scopes:t,grant_agents:n},xa)}async function Hi(e,t){return G(`POST`,`/connectors/${e}/configure`,{config:t},xa)}async function Ui(e){await G(`DELETE`,`/connectors/${e}`,void 0,xa)}async function Wi(e){return G(`POST`,`/connectors/${e}/enable`,{},xa)}async function Gi(e){return G(`POST`,`/connectors/${e}/disable`,{},xa)}async function Ki(){return G(`GET`,`/connectors/agent-mcps`)}async function qi(e){return G(`GET`,`/connectors/${e}/grants`)}async function Ji(e,t,n){await G(`PUT`,`/connectors/${e}/grants/${encodeURIComponent(t)}`,{scopes:n},xa)}async function Yi(e,t){await G(`DELETE`,`/connectors/${e}/grants/${encodeURIComponent(t)}`,void 0,xa)}async function Xi(e){return G(`GET`,`/connectors/${e}/activations`)}async function Zi(e,t,n){return G(`PUT`,`/connectors/${e}/activations/${encodeURIComponent(t)}`,n?{scopes:n}:{},xa)}async function Qi(e,t){await G(`DELETE`,`/connectors/${e}/activations/${encodeURIComponent(t)}`,void 0,xa)}async function $i(e){return G(`POST`,`/chat/cancel`,{session_id:e})}async function ea(e,t){return G(`POST`,`/chat/followup`,{session_id:e,text:t})}async function W(e){return G(`GET`,`/chat/followup/${encodeURIComponent(e)}`)}async function ta(e){return G(`GET`,`/chat/context/${encodeURIComponent(e)}`)}async function na(e){return G(`GET`,`/chat/performance/${encodeURIComponent(e)}`)}async function ra(e,t,n){return G(`POST`,`/chat/retry-with`,{session_id:e,message_id:t,model:n})}async function ia(e,t,n){return G(`POST`,`/chat/retry-with/choose`,{session_id:e,message_id:t,keep:n})}async function aa(){return G(`GET`,`/chat/active`)}async function oa(e,t,n={}){return G(`POST`,`/chat/confirm-tool`,{session_id:e,approved:t,always:n.always??!1,...n.confirmId?{confirm_id:n.confirmId}:{}})}async function sa(e,t,n){return G(`POST`,`/chat/user-input`,{session_id:e,request_id:t,value:n})}async function ca(e){return G(`GET`,`/chat/permissions/${encodeURIComponent(e)}`)}async function la(){return G(`GET`,`/chat/permissions`)}async function ua(e){return G(`PUT`,`/chat/permissions`,{mode:e})}async function da(e,t){return G(`PUT`,`/chat/permissions/${encodeURIComponent(e)}`,{mode:t})}async function fa(e,t){let n=t?`?key=${encodeURIComponent(t)}`:``;return G(`DELETE`,`/chat/permissions/${encodeURIComponent(e)}/grants${n}`)}var pa=c();function ma(e){try{let t=JSON.parse(e).detail;return Array.isArray(t)?t.map(e=>e?.msg??JSON.stringify(e)).join(`; `)||e:t&&typeof t==`object`&&typeof t.message==`string`?t.message:t&&typeof t!=`string`?JSON.stringify(t):t||e}catch{return e}}function ha(e){try{let t=JSON.parse(e).detail?.status;return typeof t==`string`?t:null}catch{return null}}function ga(e){try{let t=JSON.parse(e).detail;return Array.isArray(t)?t.map(e=>Array.isArray(e?.loc)?e.loc[e.loc.length-1]:void 0).filter(e=>typeof e==`string`):[]}catch{return[]}}var _a=class extends Error{httpStatus;detail;reason;fields;constructor(e,t,n,r,i=[]){super(e),this.name=`ApiError`,this.httpStatus=t,this.detail=n,this.reason=r,this.fields=i}};function va(e){return e.trim().toLowerCase()===`internal server error`}function ya(e){let t=e.trim();return t!==``&&!va(t)&&!/^[<{[]/.test(t)}function ba(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 ya(t)?t:`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})`}}var xa={"x-gaia-ui":`1`,"x-gaia-client":`agent-ui`},Sa=/key|token|secret|password/i;function Ca(e){return!e||typeof e!=`object`||Array.isArray(e)?e:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Sa.test(e)&&typeof t==`string`&&t?`***`:t]))}async function G(e,t,n,r,i){let a=`${pa}${t}`,o=s.api.time();s.api.info(`${e} ${a}`,n===void 0?``:{body:Ca(n)});let c=n===void 0?{}:{"Content-Type":`application/json`},l={method:e,headers:{...xa,...r,...c},body:n===void 0?void 0:JSON.stringify(n),signal:i},u;try{u=await fetch(a,l)}catch(t){throw s.api.error(`${e} ${a} - network error`,t),t}if(!u.ok){let t=await u.text().catch(()=>``);s.api.error(`${e} ${a} - HTTP ${u.status}`,{errorText:t});let n=ma(t);throw new _a(ba(u.status,n),u.status,n,ha(t),ga(t))}let d=u.headers.get(`content-type`)||``;if(!d.includes(`application/json`)){let n=await u.text().catch(()=>``);if(u.status===204||n.trim()===``){s.api.timed(`${e} ${a} -> ${u.status} (no body)`,o);return}throw s.api.error(`${e} ${a} -> ${u.status} (non-JSON body)`,{contentType:d,preview:n.slice(0,200)}),Error(`${e} ${t}: expected JSON, got ${d||`no Content-Type`} (HTTP ${u.status}: ${n.slice(0,120)})`)}let f=await u.json();return s.api.timed(`${e} ${a} -> ${u.status}`,o,f),f}async function wa(e){return G(`GET`,`/system/status`,void 0,void 0,e)}async function Ta(){return G(`POST`,`/system/warm-up`)}async function Ea(){return G(`GET`,`/system/warm-up`)}async function Da(){return G(`GET`,`/system/model-server`)}async function Oa(e){return G(`PUT`,`/system/model-server/backend`,{backend:e})}async function ka(){return G(`GET`,`/settings`)}async function Aa(e){return G(`PUT`,`/settings`,e)}async function ja(e,t,n=!1){return G(`POST`,`/system/load-model`,{model_name:e,ctx_size:t,force:n})}async function Ma(e,t,n=e=>window.confirm(e)){try{return await ja(e,t),!0}catch(r){if(!(r instanceof _a)||r.httpStatus!==409)throw r;return n(`${r.detail}
|
|
11
|
+
|
|
12
|
+
Load ${e} anyway?`)?(await ja(e,t,!0),!0):!1}}async function Na(e,t=!1){return G(`POST`,`/system/download-model`,{model_name:e,force:t})}async function Pa(){return G(`GET`,`/agents`)}async function Fa(e){return G(`POST`,`/agents/install`,{id:e})}async function Ia(e){return G(`GET`,`/agents/${encodeURIComponent(e)}/install-status`)}async function La(){return G(`GET`,`/onboarding/preflight`)}async function Ra(e=!1){return G(`GET`,`/setup/check?skip_chat_model=${e}`)}async function za(e,t=!1){return G(`POST`,`/setup/run`,{skip_chat_model:e,gaia_lemonade:t})}async function Ba(){return G(`GET`,`/setup/status`)}async function Va(){return G(`GET`,`/setup/plan`)}async function Ha(e){return G(`POST`,`/setup/chat-model`,{model_id:e})}async function Ua(){return G(`GET`,`/onboarding/start`)}async function Wa(){return G(`GET`,`/lemonade/target`)}async function Ga(){return G(`GET`,`/lemonade/detect`)}async function Ka(e){try{return await G(`POST`,`/lemonade/target`,e)}catch(e){throw e instanceof _a&&e.httpStatus===502&&e.detail?new _a(e.detail,e.httpStatus,e.detail,e.reason,e.fields):e}}async function qa(){return G(`GET`,`/providers`)}async function Ja(){return G(`GET`,`/providers/active`)}async function Ya(e,t){return G(`POST`,`/providers/${encodeURIComponent(e)}/connect`,t)}var Xa=2e3;async function Za(e,t,n,r=()=>!1){for(;;)try{return await Ya(e,t)}catch(e){if(!(e instanceof _a)||e.httpStatus!==409||r())throw e;n(e.detail),await new Promise(e=>setTimeout(e,Xa))}}async function Qa(e){return G(`DELETE`,`/providers/${encodeURIComponent(e)}/key`)}async function $a(e){return G(`GET`,`/providers/${encodeURIComponent(e)}/models`)}async function eo(e){return G(`GET`,`/providers/local/context?model=${encodeURIComponent(e)}`)}async function to(e,t){return G(`PUT`,`/providers/local/context`,{model:e,ctx_size:t})}async function no(){return G(`GET`,`/providers/local/status`)}async function ro(e=!1){return G(`POST`,`/providers/local/restart`,{confirm:e})}async function io(e){return G(`POST`,`/providers/select`,{model:e})}async function ao(e,t){return G(`POST`,`/providers/local/custom/check`,{url:e,quant:t||null})}async function oo(e,t){return G(`POST`,`/providers/local/custom`,{url:e,quant:t||null})}async function so(e){return G(`DELETE`,`/providers/local/custom/${encodeURIComponent(e)}`)}async function co(e){return G(`GET`,`/spending/prices/${encodeURIComponent(e)}`)}async function lo(){return G(`GET`,`/spending`)}async function uo(e){return G(`PUT`,`/spending/limit`,{limit_usd:e})}async function fo(){return G(`POST`,`/spending/allow-month`)}async function po(){return G(`GET`,`/skills`)}async function mo(){let e=new Map,t=0;for(let n=0;;n+=200){let r=await G(`GET`,`/sessions?limit=200&offset=${n}`);t=r.total;for(let t of r.sessions)e.has(t.id)||e.set(t.id,t);if(r.sessions.length<200||n+200>=t)break}return{sessions:[...e.values()],total:t}}async function ho(e={}){return G(`POST`,`/sessions`,e)}async function go(e,t){return G(`PUT`,`/sessions/${e}`,t)}async function _o(e){await G(`DELETE`,`/sessions/${e}`),Li(Ni(e))}async function vo(e){return G(`GET`,`/sessions/${e}`)}async function yo(e,t){return G(`PUT`,`/sessions/${e}/pin`,{pinned:t})}async function bo(e,t,n){return G(`GET`,`/sessions/search?${new URLSearchParams({q:e,include_automated:String(t)})}`,void 0,void 0,n)}async function xo(e){return G(`POST`,`/sessions/${e}/read`)}async function So(e){return G(`PATCH`,`/sessions/${e}/private`)}async function Co(e){let{total:t}=await G(`GET`,`/sessions/${e}/messages?limit=1&offset=0`);return t}async function wo(e){let t=`/sessions/${e}/messages`,n=await G(`GET`,`${t}?limit=100&offset=0`),r=[...n.messages],i=n.total;for(;r.length<i;){let e=await G(`GET`,`${t}?limit=${Math.min(100,i-r.length)}&offset=${r.length}`);if(e.messages.length===0)throw Error(`Incomplete transcript received. Please reload the conversation.`);r.push(...e.messages)}return{messages:r,total:i}}async function To(e){return G(`GET`,`/sessions/${e}/export?format=markdown`)}async function Eo(e,t){return G(`DELETE`,`/sessions/${e}/messages/${t}`)}async function Do(e,t){return G(`DELETE`,`/sessions/${e}/messages/${t}/and-below`)}var Oo=new Set([`status`,`step`,`thinking`,`commentary`,`plan`,`tool_start`,`tool_end`,`tool_result`,`tool_args`,`tool_confirm`,`agent_error`,`permission_request`,`needs_confirmation`,`needs_input`,`policy_alert`,`followup_taken`,`followup_returned`,`followup_unavailable`,`context_usage`]);function ko(e,t,n,r,i,a,o){let c;c=typeof n==`function`?{onChunk:n,onAgentEvent:()=>{},onDone:r||(()=>{}),onError:i||(e=>{s.stream.error(`Unhandled stream error`,e)})}:n;let l=new AbortController,u=s.stream.time();s.stream.info(`Starting SSE stream for session=${e}`,{messageLength:t.length});let d=Ro(l,c,Mo,No);return fetch(`${pa}/chat/send`,{method:`POST`,headers:{...xa,"Content-Type":`application/json`},body:JSON.stringify({session_id:e,message:t,stream:!0,...a?{agent_type:a}:{},...o?{device:o}:{}}),signal:l.signal}).then(e=>(d.received(),d.connected(),Bo(e,c,u,{silentCloseIsError:!0}))).catch(e=>{d.received(),d.timedOut()?(s.stream.error(`No answer to /chat/send within ${Mo/1e3}s`),c.onError(new K(`send`,Mo))):e.name===`AbortError`?s.stream.warn(`Stream aborted by user`):(s.stream.error(`Stream fetch error`,e),c.onError(e))}),l}var Ao=3e4,jo=6e5,Mo=9e4,No=3e3,Po=`Waiting for GAIA to start this answer…`,Fo=3e4,Io=class extends Error{idleMs;constructor(e){super(`The connection to GAIA went silent for ${Math.round(e/1e3)} s.`),this.idleMs=e,this.name=`StreamStalledError`}},Lo=class extends Error{cause;constructor(e){super(`The connection to GAIA was cut: ${e instanceof Error?e.message:String(e)}`),this.cause=e,this.name=`StreamDroppedError`}},K=class extends Error{endpoint;timeoutMs;constructor(e,t){super(`GAIA did not start answering within ${Math.round(t/1e3)} s.`),this.endpoint=e,this.timeoutMs=t,this.name=`StreamTimeoutError`}};function Ro(e,t,n,r){let i=!1,a=r===void 0?void 0:setTimeout(()=>{t.onAgentEvent({type:`status`,status:`working`,phase:`waiting`,message:Po})},r),o=setTimeout(()=>{i=!0,e.abort()},n),s=!1;return{received:()=>{clearTimeout(a),clearTimeout(o)},connected:()=>{s||(s=!0,t.onConnected?.())},timedOut:()=>i}}async function zo(e,t){let n,r=new Promise((e,r)=>{n=setTimeout(()=>r(new Io(t)),t)});try{return await Promise.race([e.read(),r])}finally{clearTimeout(n)}}async function Bo(e,t,n,{silentCloseIsError:r=!1}={}){if(s.stream.info(`SSE connection opened -> HTTP ${e.status}`),!e.ok){let n=await e.text().catch(()=>``);s.stream.error(`SSE connection failed: HTTP ${e.status}`,n);let r=ma(n),i=r&&!va(r)?r:ba(e.status,r);t.onError(new _a(i,e.status,r,ha(n)));return}let i=e.body?.getReader();if(!i){s.stream.error(`No response body reader available`),t.onError(Error(`No response body`));return}let a=new TextDecoder,o=``,c=!1,l=0,u=0,d=0,f=!1,p=!1,m=!1;try{for(;;){let e;try{e=await zo(i,f?jo:Ao)}catch(e){if(e?.name===`AbortError`)throw e;if(!(e instanceof Io)){if(s.stream.error(`SSE connection cut mid-stream`,e),c||p)return;if(m)break;throw new Lo(e)}if(s.stream.error(`SSE stream silent for ${e.idleMs/1e3}s; dropping the connection`),await i.cancel().catch(e=>s.stream.warn(`Could not cancel the stalled stream`,e)),c||p)return;if(m)break;throw e}let{done:r,value:h}=e;if(r){s.stream.debug(`SSE reader done (stream ended)`);break}o+=a.decode(h,{stream:!0});let g=o.split(`
|
|
13
|
+
`);o=g.pop()||``;for(let e of g)if(e.startsWith(`data: `)){let r=e.slice(6).trim();if(!r)continue;try{let e=JSON.parse(r);if(f=e.type===`status`&&e.phase===`queued`,e.type===`chunk`)l++,u+=(e.content||``).length,(l<=3||l%50==0)&&s.stream.debug(`Chunk #${l} (+${(e.content||``).length} chars)`),t.onChunk(e);else if(e.type===`answer`)t.onChunk(e);else if(e.type===`done`)c=!0,s.stream.timed(`Stream complete: ${l} chunks, ${u} chars, ${d} agent events`,n),t.onDone(e);else if(e.type===`error`)s.stream.error(`Stream error event:`,e.content),p=!0,t.onError(Error(e.content||`Unknown error`));else if(e.type===`agent_created`)s.stream.info(`Agent created: ${e.agent_id}`),t.onAgentCreated?.(e);else if(e.type===`mcp_status`){let t=e.servers??[];s.stream.debug(`MCP status: ${t.length} server(s)`,t);for(let e of t)e.connected||s.stream.warn(`MCP server "${e.name}" is not connected: ${e.error??`no error reported`}`)}else Oo.has(e.type)?(d++,e.type===`agent_error`&&!e.recoverable&&(m=!0),s.stream.debug(`Agent event: ${e.type}`,e),t.onAgentEvent(e)):s.stream.warn(`Unknown SSE event type: ${e.type}`,e)}catch{s.stream.warn(`Malformed SSE data, skipping`,{raw:r.slice(0,100)})}}}}finally{i.releaseLock()}if(!c){if(s.stream.timed(`SSE connection closed without done event: ${l} chunks, ${d} agent events`,n),r&&l===0&&d===0&&!p){t.onError(Error(`GAIA closed the connection before any answer arrived. Send the message again; if it keeps happening, check the GAIA server log.`));return}t.onDone({type:`done`})}}function Vo(e,t){let n=new AbortController,r=s.stream.time();s.stream.info(`Attaching to background run for session=${e}`);let i=Ro(n,t,Fo);return fetch(`${pa}/chat/attach?session_id=${encodeURIComponent(e)}`,{method:`GET`,signal:n.signal}).then(n=>{if(i.received(),i.connected(),n.status===404)s.stream.info(`Run for session=${e} finished before the attach`),t.onDone({type:`done`,content:``});else return Bo(n,t,r)}).catch(e=>{i.received(),i.timedOut()?(s.stream.error(`No answer to /chat/attach within ${Fo/1e3}s`),t.onError(new K(`attach`,Fo))):e.name===`AbortError`?s.stream.warn(`Run attach detached by client`):e instanceof TypeError?(s.stream.error(`Run attach could not connect`,e),t.onError(new Lo(e))):(s.stream.error(`Run attach fetch error`,e),t.onError(e))}),n}async function Ho(){return G(`GET`,`/documents`)}async function Uo(e){return G(`POST`,`/documents/upload-path`,{filepath:e})}async function Wo(e){let t=`${pa}/documents/upload`,n=s.api.time();s.api.info(`POST ${t}`,{fileName:e.name,size:e.size});let r=new FormData;r.append(`file`,e);let i;try{i=await fetch(t,{method:`POST`,headers:xa,body:r})}catch(e){throw s.api.error(`POST ${t} - network error`,e),e}if(!i.ok){let e=await i.text().catch(()=>``);s.api.error(`POST ${t} - HTTP ${i.status}`,{errorText:e});let n=ma(e);throw new _a(ba(i.status,n),i.status,n,ha(e))}let a=await i.json();return s.api.timed(`POST ${t} -> ${i.status}`,n,a),a}async function Go(e){return G(`DELETE`,`/documents/${e}`)}async function Ko(e){return G(`GET`,`/documents/${e}/status`)}function qo(e,t){let n=new URL(`${pa}/documents/${encodeURIComponent(e)}/file`,window.location.href);return t&&(n.hash=`page=${t}`),n.href}async function Jo(e){return G(`POST`,`/documents/${e}/cancel`)}async function Yo(e){return G(`POST`,`/documents/${e}/reindex`)}async function Xo(e,t){return G(`POST`,`/sessions/${e}/documents`,{document_id:t})}async function Zo(e,t){return G(`DELETE`,`/sessions/${e}/documents/${t}`)}async function Qo(e){return G(`GET`,`/files/browse${e?`?path=${encodeURIComponent(e)}`:``}`)}async function $o(e,t=!0){return G(`POST`,`/documents/index-folder`,{folder_path:e,recursive:t})}async function es(e,t=!0){return G(`POST`,`/files/open`,{path:e,reveal:t})}async function ts(e){return G(`POST`,`/files/open`,{path:e,launch:!0})}async function ns(e){return G(`POST`,`/files/status`,{paths:e})}async function rs(e){let t=`${pa}/files/upload`,n=s.api.time();s.api.info(`POST ${t}`,{fileName:e.name,size:e.size});let r=new FormData;r.append(`file`,e);let i=await fetch(t,{method:`POST`,headers:xa,body:r});if(!i.ok){let e=await i.text().catch(()=>``);s.api.error(`POST ${t} - HTTP ${i.status}`,{errorText:e});let n=ma(e);throw new _a(ba(i.status,n),i.status,n,ha(e))}let a=await i.json();return s.api.timed(`POST ${t} -> ${i.status}`,n,a),a}async function is(e,t,n){let r=new URLSearchParams({query:e});return t&&r.set(`file_types`,t),n&&r.set(`max_results`,String(n)),G(`GET`,`/files/search?${r}`)}async function as(e,t){let n=new URLSearchParams({path:e});return t&&n.set(`lines`,String(t)),G(`GET`,`/files/preview?${n}`)}async function os(){return G(`POST`,`/tunnel/start`)}async function ss(){return G(`POST`,`/tunnel/stop`)}async function cs(){return G(`GET`,`/tunnel/status`)}async function ls(){return G(`GET`,`/mcp/status`)}async function us(){return G(`GET`,`/schedules`)}function ds(){return Intl.DateTimeFormat().resolvedOptions().timeZone||void 0}async function fs(e,t,n){return G(`POST`,`/schedules`,{name:e,interval:t,prompt:n,timezone:ds()})}async function ps(e,t){return G(`PUT`,`/schedules/${encodeURIComponent(e)}`,{status:t})}async function ms(e){return G(`POST`,`/schedules/${encodeURIComponent(e)}/run`)}async function hs(e){return G(`DELETE`,`/schedules/${encodeURIComponent(e)}`)}async function gs(e,t=20){return G(`GET`,`/schedules/${encodeURIComponent(e)}/results?limit=${t}`)}async function _s(e){return G(`POST`,`/schedules/parse`,{input:e,timezone:ds()})}async function vs(e){return G(`GET`,`/sessions/${encodeURIComponent(e)}/changes`)}async function ys(e,t){return G(`GET`,`/sessions/${encodeURIComponent(e)}/changes/${encodeURIComponent(t)}/diff`)}async function bs(e,t,n=!1){return G(`POST`,`/sessions/${encodeURIComponent(e)}/changes/${encodeURIComponent(t)}/undo`,{force:n})}async function xs(){return G(`GET`,`/settings/undo`)}async function Ss(e,t){return G(`PUT`,`/settings/undo`,{retention_days:e,max_mb:t})}var Cs=e=>`/sessions/${encodeURIComponent(e)}`;async function ws(e){return G(`GET`,`${Cs(e)}/environment`)}async function Ts(e,t){return G(`POST`,`${Cs(e)}/environment/folders`,{path:t})}async function Es(e,t){return G(`POST`,`${Cs(e)}/environment/folders/remove`,{path:t})}async function Ds(e,t){return G(`PUT`,`${Cs(e)}/environment/internet`,{on:t})}async function Os(e){return G(`GET`,`${Cs(e)}/outputs`)}async function ks(e){return G(`GET`,`${Cs(e)}/changes/total`)}async function As(e,t=!1){return G(`POST`,`${Cs(e)}/changes/undo`,{force:t})}async function js(e){return G(`GET`,`${Cs(e)}/changes/git`)}async function Ms(e,t,n){return G(`POST`,`${Cs(e)}/changes/git/commit`,{root:t,message:n,confirmed:!0})}async function Ns(e,t,n,r){return G(`POST`,`${Cs(e)}/changes/git/pr`,{root:t,title:n,body:r,confirmed:!0})}var Ps=5e3,Fs=24,Is=1e3,Ls=3e4,Rs=0,zs=!1,Bs=null,Vs=Is;function Hs(){Bs&&clearTimeout(Bs),Bs=null}async function Us(e){try{let t=await $a(`local`);t?.models&&e(t.models)}catch(e){zs=!1,s.system.warn(`Model names unavailable; raw model ids show until the model list loads`,e)}}var Ws=$n((e,t)=>({active:null,error:null,restoreNotice:null,queued:null,queueError:null,names:{},refresh:async()=>{zs||(zs=!0,Us(t().rememberNames));try{let n=await Ja();Hs(),Vs=Is;let r=n.restore;r?.status===`pending`&&Rs<Fs&&(Rs+=1,setTimeout(()=>{t().refresh()},Ps)),e({active:n,error:null,...r&&r.status!==`none`&&r.message?{restoreNotice:{ok:r.status===`restored`,message:r.message}}:{}})}catch(n){e({error:n instanceof Error?n.message:String(n)}),Bs||(Bs=setTimeout(()=>{Bs=null,t().refresh()},Vs),Vs=Math.min(Vs*2,Ls))}},retryNow:()=>{Bs&&(Hs(),t().refresh())},select:async t=>{let n=await io(t),r=null;try{r=(await mo()).sessions}catch(e){s.system.error(`Could not refresh chats after a model switch; the next poll will`,e)}e({active:n,error:null,restoreNotice:null}),r?.length&&H.getState().setSessions(r)},queue:t=>e({queued:t,queueError:null}),applyQueued:async()=>{let n=t().queued;if(n)try{await t().select(n),e({queued:null})}catch(t){e({queued:null,queueError:`Couldn't switch to ${qs(n)}: ${t instanceof Error?t.message:String(t)}`})}},rememberNames:n=>{let r={...t().names};for(let e of n)e.display_name&&(r[e.id]=e.display_name);e({names:r})},dismissRestoreNotice:()=>e({restoreNotice:null})}));H.subscribe((e,t)=>{t.isStreaming&&!e.isStreaming&&Ws.getState().queued&&Ws.getState().applyQueued()});function Gs(){return Ws(e=>e.names)}function Ks(e,t){if(!e||!t)return!1;let n=e=>e.toLowerCase().replace(/^user\./,``);return n(e)===n(t)}function qs(e){let t=Ws.getState();return t.names[e]?t.names[e]:t.active?.model===e&&t.active.display_name?t.active.display_name:ec(e)}function Js(e,t){return e.find(e=>e.id===t)??e[0]}function Ys(e,t){let n=!!t?.effective_model&&!!e?.model&&t.effective_model!==e.model;return e?.remote&&!(n&&t?.inference_remote!==void 0)?{remote:!0,label:e.provider===`fireworks`?`Fireworks AI`:`AMD LLM Gateway`,description:null}:t?.inference_remote===!0?{remote:!0,label:t.inference_provider_name||`a cloud provider`,description:t.inference_description??null}:t?.inference_remote===!1?{remote:!1,label:`Local`,description:t.inference_description??null}:t===void 0&&e?.inference_remote===!1?{remote:!1,label:`Local`,description:e.inference_description??null}:null}var Xs=`GAIA can't tell whether this chat is answered on this PC or by a cloud provider, so it isn't claiming either.`;function Zs(){return Ys(Ws(e=>e.active),H(e=>Js(e.sessions,e.currentSessionId)))}function Qs(e,t,n){return t.find(e=>e.id===n)?.effective_model||e?.model||null}function $s(e){return/^(fireworks|amd)\./.test(e)?e.slice(e.indexOf(`.`)+1):e}function ec(e){let t=$s(e);return t.slice(t.lastIndexOf(`/`)+1)}function tc(e){let t={};for(let n of e)t[n.id]=n.display_name||qs(n.id);let n=new Map;for(let r of e)n.set(t[r.id],[...n.get(t[r.id])??[],r.id]);for(let e of n.values()){if(e.length<2)continue;let n=e.map(e=>$s(e).split(`/`)),r=e;for(let e=1;e<=Math.max(...n.map(e=>e.length));e++){let t=n.map(t=>t.slice(-e).join(`/`));if(new Set(t).size===t.length){r=t;break}}e.forEach((e,n)=>{t[e]=r[n]})}return t}function nc(e){return e===`fireworks`?`Fireworks AI`:e===`amd`?`AMD LLM Gateway`:e}var rc={loaded:`Loaded`,downloaded:`Downloaded, ready to load`,not_downloaded:`Not downloaded`};function ic(e){return e?.label?e.source===`expected`?`${e.label} (expected)`:e.label:null}function ac(e){return e?`${Math.round(e/1024)}K`:`unknown`}function oc(e){return e.state??(e.downloaded?`downloaded`:`not_downloaded`)}function sc(e){let t=e.download_progress?.state;return t===`starting`||t===`downloading`}var cc=3e3,lc={loaded:`Loaded`,warming:`Warming up`,idle:`Not loaded — it loads with your next message`,stopped:`Model server stopped`};function uc(e){let t=e.memory;return t?[t.model_gb?`~${t.model_gb} GB used by the model`:null,t.free_gb==null?null:`${t.free_gb} GB free`].filter(Boolean).join(` · `)||`${t.total_gb} GB (${t.source})`:e.memory_error}function dc(){let e=Ws(e=>e.active);Ws(e=>e.names);let t=Zs(),n=H(e=>e.systemStatus),r=H(e=>e.openSettings),i=(0,V.useRef)(null),[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(null),[d,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)(!1),h=(0,V.useCallback)(async()=>{try{c(await no()),u(null)}catch(e){u(e instanceof Error?e.message:String(e))}},[]);(0,V.useEffect)(()=>{if(!a)return;h();let e=setInterval(()=>{h()},cc);return()=>clearInterval(e)},[a,h]);let g=(0,V.useCallback)(async e=>{m(!1),f(!0),u(null);try{await ro(e),await h()}catch(e){u(e instanceof Error?e.message:String(e))}finally{f(!1)}},[h]),_=n?n.lemonade_running?n.model_loaded?`loaded`:`idle`:`stopped`:`idle`,v=t?.remote?ge:t?we:fe,y=e?.model?qs(e.model):null,b=[t?.label,y].filter(Boolean).join(` · `)||`Model`,x=t?t.description??(t.remote?`Chat history is sent to ${t.label}`:`Runs on this PC`):Xs,S=s,C=d||!!S?.restarting,w=!!S&&S.owner!==`gaia`,T=!!S&&!(w&&S.state===`stopped`);return(0,U.jsxs)(`div`,{className:`sb-location-wrap`,children:[(0,U.jsxs)(`button`,{ref:i,type:`button`,className:`sb-location`,onClick:()=>o(e=>!e),"aria-haspopup":`dialog`,"aria-expanded":a,"aria-label":t?.remote?b:`${b}, model ${_===`idle`?`not loaded`:_}`,title:y?`${b}. ${x}`:x,children:[(0,U.jsx)(v,{size:13,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{className:`sb-location-text`,children:[t?.label&&y&&(0,U.jsx)(`span`,{className:`sb-location-place`,children:t.label}),(0,U.jsx)(`span`,{className:`sb-location-name`,children:y??t?.label??`Model`})]}),!t?.remote&&(0,U.jsx)(`span`,{className:`sb-location-dot is-${_}`,"aria-hidden":`true`})]}),(0,U.jsx)(ji,{open:a,onClose:()=>o(!1),anchor:i,label:`Model status`,placement:`above`,children:(0,U.jsxs)(`div`,{className:`model-status`,children:[!S&&!l&&(0,U.jsxs)(`span`,{children:[(0,U.jsx)(B,{size:13,className:`spin`}),` Checking the model…`]}),S&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`model-status-head`,children:[(0,U.jsx)(`span`,{className:`model-status-dot is-${S.state}`,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{role:`status`,children:[lc[S.state],S.state===`loaded`&&S.busy_reason===`request`?` · answering`:``]})]}),S.active_remote&&(0,U.jsxs)(`span`,{className:`settings-hint`,children:[`New messages use `,S.active_display_name,` in the cloud. Local model below.`]}),(0,U.jsxs)(`dl`,{className:`model-status-grid`,children:[(0,U.jsx)(`dt`,{children:`Model`}),(0,U.jsx)(`dd`,{title:S.model??S.active_model??void 0,children:S.display_name??(S.active_remote?`—`:S.active_display_name)??`—`}),S.placement&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{children:`Runs on`}),(0,U.jsx)(`dd`,{children:ic(S.placement)})]}),S.state!==`stopped`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{children:`Memory`}),(0,U.jsx)(`dd`,{children:uc(S)??`unknown`})]}),S.ctx_size!=null&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{children:`Context window`}),(0,U.jsxs)(`dd`,{children:[ac(S.ctx_size),` tokens`]})]})]}),S.placement?.warning&&(0,U.jsx)(`span`,{className:`model-status-warning`,role:`alert`,children:S.placement.warning}),S.error&&(0,U.jsx)(`span`,{className:`settings-error`,role:`alert`,title:S.error_detail??void 0,children:S.error}),S.restart_error&&(0,U.jsx)(`span`,{className:`settings-error`,role:`alert`,children:S.restart_error})]}),l&&(0,U.jsx)(`span`,{className:`settings-error`,role:`alert`,children:l}),p&&S&&(0,U.jsxs)(`div`,{className:`model-status-confirm`,role:`alert`,children:[(0,U.jsxs)(`span`,{children:[`This reloads `,S.display_name??`the model`,` on your Lemonade at `,S.base_url,`. Other apps using it are interrupted while it reloads.`]}),(0,U.jsxs)(`div`,{className:`model-status-actions`,children:[(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>m(!1),children:`Cancel`}),(0,U.jsx)(`button`,{type:`button`,className:`btn-primary`,onClick:()=>void g(!0),children:`Reload it`})]})]}),(0,U.jsxs)(`div`,{className:`model-status-actions`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>{o(!1),r(`model`)},children:[(0,U.jsx)(cn,{size:13,"aria-hidden":`true`}),` Model settings`]}),T&&(0,U.jsxs)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>w?m(!0):void g(!1),disabled:C||!S||S.busy||S.active_remote&&S.state!==`loaded`,title:S?.busy?S.busy_reason===`warm_up`?`GAIA is getting the model ready for a new chat. Restart it once that finishes.`:`The model is answering a request. Restart it once that finishes.`:S?.state===`stopped`?`Start the model server and load the model`:`Reload the model at its context size`,children:[C?(0,U.jsx)(B,{size:13,className:`spin`}):(0,U.jsx)(rn,{size:13,"aria-hidden":`true`}),C?`Restarting…`:`Restart`]})]})]})})]})}var fc=500,pc=`gaia_always_allow_tools`;function mc(){try{localStorage.getItem(`gaia_always_allow_tools`)!==null&&(localStorage.removeItem(pc),console.warn(`[notificationStore] Discarded a persisted "always allow" tool list from an earlier version. Grants now cover one call in one chat and are listed in Settings → Permissions.`))}catch(e){console.error(`[notificationStore] Could not clear the legacy always-allow list:`,e)}}var hc=`allow_path_access`;function gc(e){let{path:t,kind:n}=e??{};return{target:typeof t==`string`&&t.trim()?t:null,kind:n}}function _c(e,t=!1){let{target:n,kind:r}=gc(e),i=n?r===`folder`?`the folder ${n} and everything in it`:r===`file`?`the file ${n}`:`${n}, which doesn't exist yet`:`a file or folder outside this chat`;return t?`To do what you just allowed, GAIA also needs ${i}. This chat can't reach it yet. Allow it for this chat?`:`GAIA wants to use ${i}. This chat can't reach it yet. Allow it for this chat?`}function vc(e,t=!1){let{kind:n}=gc(e),r=n===`folder`?`folder`:n===`file`?`file`:`location`;return t?`Also let GAIA use this ${r}?`:`Let GAIA use this ${r}?`}function yc(e){return e.trim().replace(/\\/g,`/`).replace(/\/+$/,``).toLowerCase()}function bc(e){let t=[`file_path`,`path`,`directory`,`dir_path`,`destination`].map(t=>e?.[t]).find(e=>typeof e==`string`&&e.trim());return typeof t==`string`?t:null}function xc(e,t,n){let r=e.find(e=>e.type===`permission_request`&&e.sessionId===t);if(!r||r.response!==`allow`||r.tool===`allow_path_access`)return!1;let i=bc(r.toolArgs),{path:a}=n??{};if(!i||typeof a!=`string`||!a.trim())return!1;let o=yc(i),s=yc(a);return o===s||o.startsWith(`${s}/`)?!0:!/^([a-z]:)?\//.test(o)&&!o.startsWith(`~`)&&s.endsWith(`/${o.replace(/^\.\//,``)}`)}function Sc(e){return e===`share_engineering_context`||e===`append_engineering_context`||e===`approve_engineering_code`||e===`allow_path_access`}function Cc(e,t){return!t.alwaysScope||!t.sessionId||Sc(t.tool)||t.risk===`destructive`?0:e.filter(e=>e.id!==t.id&&e.type===`permission_request`&&e.sessionId===t.sessionId&&e.response===`allow`&&e.tool===t.tool&&e.alwaysScope===t.alwaysScope&&e.risk===t.risk).length}var wc=$n((e,t)=>({notifications:[],showPanel:!1,typeFilter:null,addNotification:t=>e(e=>{let n=e.notifications.find(e=>e.id===t.id);return n?n.response?e:{notifications:e.notifications.map(e=>e.id===t.id?{...t,read:n.read}:e)}:{notifications:[t,...e.notifications].slice(0,fc)}}),dismiss:t=>e(e=>({notifications:e.notifications.map(e=>e.id===t?{...e,dismissed:!0}:e)})),markRead:t=>e(e=>({notifications:e.notifications.map(e=>e.id===t?{...e,read:!0}:e)})),markAllRead:()=>e(e=>({notifications:e.notifications.map(e=>({...e,read:!0}))})),clearAll:()=>e({notifications:[]}),setShowPanel:t=>e({showPanel:t}),setTypeFilter:t=>e({typeFilter:t}),dismissSessionPrompts:t=>e(e=>({notifications:e.notifications.map(e=>e.type===`permission_request`&&e.sessionId===t&&!e.response?{...e,dismissed:!0}:e)})),respondToPermission:async(n,r)=>{let i=t().notifications.find(e=>e.id===n);if(!i)throw Error(`That permission request is no longer pending.`);let a=r!==`deny`,o=r===`always`&&!Sc(i.tool),s=window.gaiaAPI;if(i.sessionId)await oa(i.sessionId,a,{always:o,confirmId:i.confirmId});else if(s?.notification?.respondPermission)await s.notification.respondPermission(n,a?`allow`:`deny`,o);else throw Error(`No agent is waiting for this answer any more.`);e(e=>({notifications:e.notifications.map(e=>e.id===n?{...e,response:a?`allow`:`deny`,respondedAt:Date.now(),read:!0}:e)}))}})),Tc=e=>e.notifications.filter(e=>!e.read&&!e.dismissed).length,Ec=e=>{let t=e.notifications.filter(e=>!e.dismissed);return e.typeFilter?t.filter(t=>t.type===e.typeFilter):t},Dc=e=>t=>t.notifications.find(t=>t.type===`permission_request`&&t.sessionId===e&&!t.response&&!t.dismissed)??null,Oc=e=>[...new Set(e.notifications.filter(e=>e.type===`permission_request`&&e.sessionId&&!e.response&&!e.dismissed).map(e=>e.sessionId))].sort(),kc=`gaia_alert_settings`,Ac={modes:{needs_approval:`banner`,question:`banner`,finished:`banner`},sound:!1,flash:!0,keepAwake:!0,batteryFloor:20},jc=[`banner`,`badge`,`off`];function Mc(){let e=null;try{e=localStorage.getItem(kc)}catch(e){return console.warn(`[alerts] Notification settings unreadable (site data blocked); using defaults.`,e),Ac}if(!e)return Ac;let t;try{t=JSON.parse(e)}catch(e){return console.warn(`[alerts] Saved notification settings are corrupt; using defaults.`,e),Ac}let n={...Ac.modes};for(let e of Object.keys(n)){let r=t.modes?.[e];r!==void 0&&jc.includes(r)?n[e]=r:r!==void 0&&console.warn(`[alerts] Ignored unknown mode ${String(r)} for ${e}.`)}let r=(e,t)=>typeof e==`boolean`?e:t,i=t.batteryFloor;return{modes:n,sound:r(t.sound,Ac.sound),flash:r(t.flash,Ac.flash),keepAwake:r(t.keepAwake,Ac.keepAwake),batteryFloor:typeof i==`number`&&i>=0&&i<=100?i:Ac.batteryFloor}}function Nc(e){try{localStorage.setItem(kc,JSON.stringify(e))}catch(e){console.warn(`[alerts] Notification settings not saved; they will reset on reload.`,e)}}var Pc=e=>({modes:e.modes,sound:e.sound,flash:e.flash,keepAwake:e.keepAwake,batteryFloor:e.batteryFloor}),Fc=$n((e,t)=>({...Mc(),setMode:(n,r)=>{e({modes:{...t().modes,[n]:r}}),Nc(Pc(t()))},update:n=>{e(n),Nc(Pc(t()))}}));function Ic(e){let t=new Date(e.updated_at).getTime();return Number.isNaN(t)?0:t}function Lc(e,t=new Date){let n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),r=864e5,i=[{label:`Today`,sessions:[]},{label:`Yesterday`,sessions:[]},{label:`Previous 7 days`,sessions:[]},{label:`Previous 30 days`,sessions:[]},{label:`Older`,sessions:[]}],a=[...e].sort((e,t)=>Ic(t)-Ic(e));for(let e of a){let t=Ic(e);i[t>=n?0:t>=n-r?1:t>=n-7*r?2:t>=n-30*r?3:4].sessions.push(e)}return i.filter(e=>e.sessions.length>0)}function Rc(e,t){return t.awaiting[e.id]||t.prompting.includes(e.id)?`waiting`:t.queued.includes(e.id)?`queued`:t.running.includes(e.id)?`running`:e.last_run_status===`failed`?`failed`:e.last_run_status===`done`||e.last_run_status===`stopped`?`done`:null}function zc(e){return e.kind===`eval`||e.kind===`scheduled`}function Bc(e,t,{showAutomated:n=!1,now:r=new Date}={}){let i=n?e:e.filter(e=>!zc(e)),a=(e,t)=>Ic(t)-Ic(e),o=i.filter(e=>Rc(e,t)===`waiting`).sort(a),s=i.filter(e=>e.pinned&&!o.includes(e)).sort(a),c=i.filter(e=>!o.includes(e)&&!s.includes(e)),l=[];return o.length&&l.push({label:`Needs you`,sessions:o}),s.length&&l.push({label:`Pinned`,sessions:s}),[...l,...Lc(c,r)]}function Vc(e){return e.filter(zc).length}function Hc(e,t,n){let r={};for(let t of e)r[t]=`running`;for(let[e,n]of Object.entries(t))r[e]=n;for(let e of n)r[e]=`permission`;return r}function Uc(e,t){let n=[];for(let[r,i]of Object.entries(t))i!==e[r]&&(i===`permission`?n.push({sessionId:r,event:`needs_approval`}):i===`question`&&n.push({sessionId:r,event:`question`}));for(let r of Object.keys(e))r in t||n.push({sessionId:r,event:`finished`});return n}var Wc={needs_approval:`GAIA needs your approval`,question:`GAIA has a question`,finished:`GAIA finished`};function Gc(e,t){let n=t?.title||`A chat`;if(e!==`finished`)return{title:Wc[e],body:n};switch(t?.last_run_status){case`done`:return{title:Wc.finished,body:n};case`failed`:return{title:`GAIA hit a problem`,body:n};case`stopped`:return{title:`GAIA stopped`,body:n};default:return{title:`A chat stopped running`,body:n}}}function Kc(e,t,n){return n&&e===t}function qc(e,t,n,r){let i=0;for(let a of e){if(a.kind===`eval`||a.kind===`scheduled`)continue;let e=t[a.id];(e===`permission`&&n.needs_approval!==`off`||e===`question`&&n.question!==`off`||!e&&a.unread&&a.id!==r&&n.finished!==`off`)&&i++}return i}function Jc(e,t){return!e||e.charging||t<=0?!0:e.level*100>=t}function Yc(){let e=window.AudioContext??window.webkitAudioContext;if(!e)throw Error(`This browser has no Web Audio, so GAIA cannot play the alert sound.`);let t=new e,n=t.currentTime;[660,880].forEach((e,r)=>{let i=t.createOscillator(),a=t.createGain();i.frequency.value=e,a.gain.setValueAtTime(1e-4,n+r*.12),a.gain.exponentialRampToValueAtTime(.15,n+r*.12+.02),a.gain.exponentialRampToValueAtTime(1e-4,n+r*.12+.18),i.connect(a).connect(t.destination),i.start(n+r*.12),i.stop(n+r*.12+.2)}),setTimeout(()=>void t.close(),600)}function Xc(e){let t=e%100;return`${e}${t>=11&&t<=13?`th`:{1:`st`,2:`nd`,3:`rd`}[e%10]??`th`}`}function Zc(){return typeof navigator<`u`&&/Mac/i.test(navigator.platform)}function Qc(e=typeof navigator<`u`?navigator.platform:``){return/Mac/i.test(e)?`/Users/you/Documents/manual.pdf`:/Win/i.test(e)?`C:\\Users\\you\\Documents\\manual.pdf`:`/home/you/Documents/manual.pdf`}var $c={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Mod:`⌘`},el=[`Ctrl`,`Alt`,`Shift`,`Mod`];function tl(e,t=Zc()){let n=e.split(`+`),r=n.pop(),i=n.filter(e=>!(e in $c));if(i.length)throw Error(`formatShortcut: unknown modifier(s) ${i.join(`, `)} in "${e}"; use Ctrl, Alt, Shift or Mod`);return t?el.filter(e=>n.includes(e)).map(e=>$c[e]).join(``)+r:[...n.map(e=>e===`Mod`?`Ctrl`:e),r].join(`+`)}var nl=`New Task`;function rl(e,t){let n=t.sessions.find(t=>t.id===e);return!(!n||n.title!==nl||(n.message_count??0)!==0||t.runningSessionIds.includes(e)||t.messageQueues?.[e]?.length||t.currentSessionId===e&&(t.messages.length!==0||t.isStreaming))}async function il(e){if(!e)return!1;let t=H.getState();if(!rl(e,{sessions:t.sessions,currentSessionId:t.currentSessionId,messages:t.messages,isStreaming:t.isStreaming,runningSessionIds:t.runningSessionIds,messageQueues:t.messageQueues}))return!1;s.chat.info(`Removing abandoned draft session ${e}`),t.addPendingDelete(e),t.removeSession(e);try{return await _o(e),!0}catch(t){return s.chat.warn(`Failed to delete abandoned draft ${e}`,t),!1}finally{t.removePendingDelete(e)}}var al=32768,ol=`Gemma-4-E4B-it-GGUF`,sl=3e5,cl=18e5,ll=1e4,ul=`GAIA is starting…`;function dl(e){let[t,n]=(0,V.useState)(()=>typeof window.matchMedia==`function`&&window.matchMedia(e).matches);return(0,V.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var fl=new URL(`gaia-robot-NKaQnEIp.png`,import.meta.url).href,pl=16,ml=`gaia-chat-sidebar-width`,hl=e=>Math.round(Math.max(200,Math.min(420,e)));function gl(){try{let e=Number(localStorage.getItem(ml));return e?hl(e):260}catch(e){return s.system.warn(`Saved sidebar width unreadable; using the default.`,e),260}}function _l(e){try{localStorage.setItem(ml,String(e))}catch(e){s.system.warn(`Sidebar width not saved; it resets on reload.`,e)}}function vl(e){return getComputedStyle(e).direction===`rtl`}function yl(e){let[t,n]=(0,V.useState)(gl),[r,i]=(0,V.useState)(null),a=(0,V.useCallback)(e=>{let t=hl(e);n(t),_l(t)},[]),o=(0,V.useCallback)(n=>{if(n.button!==0)return;n.preventDefault();let r=n.clientX,o=t,s=n.currentTarget,c=vl(s)?-1:1;s.setPointerCapture?.(n.pointerId);let l=o,u=e=>{l=o+c*(e.clientX-r),i(l<150?l:hl(l))},d=()=>{s.removeEventListener(`pointermove`,u),s.removeEventListener(`pointerup`,d),s.removeEventListener(`pointercancel`,d),i(null),l<150?e():a(l)};s.addEventListener(`pointermove`,u),s.addEventListener(`pointerup`,d),s.addEventListener(`pointercancel`,d)},[e,a,t]),s=(0,V.useCallback)(e=>{let n=vl(e.currentTarget)?-16:pl,r={ArrowLeft:t-n,ArrowRight:t+n,Home:200,End:420}[e.key];r!==void 0&&(e.preventDefault(),a(r))},[a,t]);return{width:r??t,resizing:r!=null,handle:(0,U.jsx)(`div`,{className:`sb-resize${r==null?``:` is-dragging`}`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,"aria-valuemin":200,"aria-valuemax":420,"aria-valuenow":Math.round(r??t),tabIndex:0,title:`Drag to resize, double-click to reset`,onPointerDown:o,onKeyDown:s,onDoubleClick:()=>a(260)})}}var bl=new Map;function xl(e){let t=bl.get(e);if(!t){let n=((t,n)=>zr(e,t,n));n.plural=(t,n,r)=>zr(e,Wr(t,n),{n,...r}),n.hint=(t,n)=>Fr(e,t,n),n.compose=t=>Br(e,t),n.bare=(t,n)=>Vr(e,t,n),n.locale=e,t=n,bl.set(e,t)}return t}function q(){return xl(H(e=>e.locale))}function Sl(){return xl(H.getState().locale)}var Cl=xl(`en`);function wl(e){return e.normalize(`NFKD`).replace(/\p{Mn}/gu,``).toLowerCase().replace(/ß/g,`ss`)}function Tl(e){return Array.from(e,wl).join(``)}function El(e,t){let n=Tl(t.trim());if(!n)return null;let r=``,i=[],a=0;for(let t of e){let e=wl(t);r+=e;for(let t=0;t<e.length;t++)i.push(a);a+=t.length}let o=r.indexOf(n);if(o<0)return null;let s=i[o],c=i[o+n.length-1],l=c+String.fromCodePoint(e.codePointAt(c)).length;return{before:e.slice(0,s),match:e.slice(s,l),after:e.slice(l)}}var Dl={running:`row.status.running`,queued:`row.status.queued`,waiting:`row.status.waiting`,done:`row.status.done`,failed:`row.status.failed`},Ol={"Needs you":`sidebar.group.needsYou`,Pinned:`sidebar.group.pinned`,Today:`sidebar.group.today`,Yesterday:`sidebar.group.yesterday`,"Previous 7 days":`sidebar.group.prev7`,"Previous 30 days":`sidebar.group.prev30`,Older:`sidebar.group.older`},kl=`gaia-show-automated-runs`,Al=200,jl=new Map;function Ml({parts:e}){return(0,U.jsxs)(U.Fragment,{children:[e.before,(0,U.jsx)(`mark`,{className:`sb-hit`,children:e.match}),e.after]})}function Nl(){try{return localStorage.getItem(kl)===`1`}catch(e){return s.system.warn(`Chat-list filter unreadable (site data blocked); hiding eval and scheduled runs.`,e),!1}}var Pl=e=>`sb-result-${e}`;function Fl({session:e,active:t,phone:n,moved:r,status:i,queuePlace:a,unsent:o,failed:s,onSelect:c,onDelete:l,onPin:u,onRename:d,rowId:f,kbdActive:p,titleMatch:m,snippet:h}){let g=q(),[_,v]=(0,V.useState)(!1),[y,b]=(0,V.useState)(!1),x=(0,V.useRef)(null),S=(0,V.useCallback)(()=>{b(!1),v(!1)},[]),[C,w]=(0,V.useState)(null),T=C!==null,E=(0,V.useRef)(!1),D=()=>{E.current=!1,w(e.title)},O=t=>{C===null||E.current||(E.current=!0,w(null),t&&d(e.id,C))};(0,V.useEffect)(()=>{if(!_)return;let e=setTimeout(()=>v(!1),3e3);return()=>clearTimeout(e)},[_]);let k=(0,V.useRef)(null);(0,V.useEffect)(()=>{r&&k.current?.scrollIntoView?.({block:`nearest`})},[r]);let A=e=>e.preventDefault(),j=!!e.unread&&!t,M=i===`done`&&!j?null:i,N=a>0?`${Xc(a)} in line`:null,ee=M?[g(Dl[M]),N].filter(Boolean).join(`, `):void 0,P=s>0?`${s} not sent`:o>0?`${o} to send`:null,te=[N,P].filter(Boolean).join(` · `),ne=`${o} unsent message${o===1?``:`s`}`,re=h?`${h.before}${h.match}${h.after}`:null,I=(0,U.jsx)(`span`,{className:`sb-row-title`,children:m?(0,U.jsx)(Ml,{parts:m}):e.title});return(0,U.jsxs)(`li`,{ref:k,className:`sb-row${t?` is-active`:``}${j?` is-unread`:``}${r?` is-moved`:``}${p?` is-kbd-active`:``}`,"data-status":M??void 0,children:[T?(0,U.jsx)(`input`,{className:`sb-row-edit`,value:C,maxLength:200,onChange:e=>w(e.target.value),onBlur:()=>O(!0),onKeyDown:e=>{e.key===`Enter`&&!e.nativeEvent.isComposing&&O(!0),e.key===`Escape`&&(e.preventDefault(),O(!1))},...Ci,autoFocus:!0,onFocus:e=>e.currentTarget.select(),"aria-label":g(`row.renameAria`,{title:e.title}),dir:`auto`}):(0,U.jsxs)(`button`,{type:`button`,id:f,className:`sb-row-main`,onClick:()=>c(e.id),onDoubleClick:D,"aria-current":t?`page`:void 0,"aria-label":[e.title,ee,P,j?g(`row.unread`):null,re].filter(Boolean).join(`, `),title:e.title,children:[M&&(0,U.jsx)(`span`,{className:`sb-dot is-${M}`,"aria-hidden":`true`,title:ee}),e.private&&(0,U.jsx)(Pe,{size:12,className:`sb-row-icon`,"aria-label":g(`row.private`)}),h?(0,U.jsxs)(`span`,{className:`sb-row-text`,children:[I,(0,U.jsx)(`span`,{className:`sb-row-snippet`,children:(0,U.jsx)(Ml,{parts:h})})]}):I,te&&(0,U.jsx)(`span`,{className:`sb-row-queue${s>0?` is-failed`:``}`,children:te})]}),n&&T&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{type:`button`,className:`sb-row-edit-btn is-save`,onPointerDown:A,onMouseDown:A,onClick:()=>O(!0),"aria-label":g(`row.saveName`),children:(0,U.jsx)(F,{size:18,"aria-hidden":`true`})}),(0,U.jsx)(`button`,{type:`button`,className:`sb-row-edit-btn`,onPointerDown:A,onMouseDown:A,onClick:()=>O(!1),"aria-label":g(`row.cancelRename`),children:(0,U.jsx)(Bn,{size:18,"aria-hidden":`true`})})]}),n?!T&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{ref:x,type:`button`,className:`sb-row-more`,onClick:()=>y?S():b(!0),"aria-haspopup":`dialog`,"aria-expanded":y,"aria-label":g(`row.moreActions`,{title:e.title}),children:(0,U.jsx)(Ae,{size:18,"aria-hidden":`true`})}),(0,U.jsx)(ji,{open:y,onClose:S,anchor:x,label:g(`row.actions`),placement:`below`,align:`end`,children:(0,U.jsxs)(`div`,{className:`sb-row-menu`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`popover-item`,onClick:()=>{S(),D()},children:[(0,U.jsx)(qt,{size:15,"aria-hidden":`true`}),g(`row.rename`)]}),(0,U.jsxs)(`button`,{type:`button`,className:`popover-item`,onClick:()=>{S(),u(e.id,!e.pinned,!0)},children:[e.pinned?(0,U.jsx)(Yt,{size:15,"aria-hidden":`true`}):(0,U.jsx)(Zt,{size:15,"aria-hidden":`true`}),e.pinned?g(`row.unpin`):g(`row.pin`)]}),(0,U.jsxs)(`button`,{type:`button`,className:`popover-item sb-row-menu-delete`,onClick:()=>_?l(e.id):v(!0),children:[(0,U.jsx)(On,{size:15,"aria-hidden":`true`}),_?g(`row.tapAgain`,{label:o>0?`Delete ${o} unsent?`:Lr(`row.deleteConfirm`)}):g(`row.delete`)]})]})})]}):(0,U.jsxs)(U.Fragment,{children:[!T&&(0,U.jsx)(`button`,{type:`button`,className:`sb-row-rename`,onClick:D,"aria-label":g(`row.renameAria`,{title:e.title}),title:g(`row.rename`),children:(0,U.jsx)(qt,{size:13})}),(0,U.jsx)(`button`,{type:`button`,className:`sb-row-pin${e.pinned?` is-pinned`:``}`,onClick:()=>u(e.id,!e.pinned),"aria-label":g(e.pinned?`row.unpinAria`:`row.pinAria`,{title:e.title}),"aria-pressed":!!e.pinned,title:e.pinned?g(`row.unpin`):g(`row.pinToTop`),children:e.pinned?(0,U.jsx)(Yt,{size:13}):(0,U.jsx)(Zt,{size:13})}),(0,U.jsx)(`button`,{type:`button`,className:`sb-row-delete${_?` is-confirm`:``}`,onClick:()=>_?l(e.id):v(!0),"aria-label":_?o>0?`Confirm delete ${e.title} and its ${ne}`:g(`row.confirmDeleteAria`,{title:e.title}):g(`row.deleteAria`,{title:e.title}),title:_?o>0?`Click again to delete this chat and its ${ne}`:g(`row.clickAgain`):g(`row.delete`),children:_?(0,U.jsx)(`span`,{className:`sb-row-delete-label`,children:o>0?`Delete ${o} unsent?`:g(`row.deleteConfirm`)}):(0,U.jsx)(On,{size:13})})]})]})}function Il({onNewChat:e,onMobileAccess:t,tunnelActive:n}){let r=q(),i=H(e=>e.sessions),a=H(e=>e.currentSessionId),o=H(e=>e.runningSessionIds),c=H(e=>e.queuedSessionIds),l=H(e=>e.awaitingBySession),u=H(e=>e.messageQueues),d=H(e=>e.updateSessionInList),f=wc(qn(Oc)),p=H(e=>e.sidebarOpen),m=H(e=>e.sidebarCollapsed),h=H(e=>e.toggleSidebarCollapsed),g=H(e=>e.setSidebarOpen),_=H(e=>e.setCurrentSession),v=H(e=>e.setMessages),y=H(e=>e.removeSession),b=H(e=>e.addPendingDelete),x=H(e=>e.removePendingDelete),S=H(e=>e.openSettings),C=H(e=>e.setShowMemoryDashboard),T=H(e=>e.setShowSchedules),E=H(e=>e.setShowDocLibrary),D=H(e=>e.showMemoryDashboard),k=H(e=>e.showSchedules),A=wc(Tc),j=wc(e=>e.showPanel),M=wc(e=>e.setShowPanel),[N,ee]=(0,V.useState)(``),[P,F]=(0,V.useState)(null),[te,ne]=(0,V.useState)(null),[re,I]=(0,V.useState)(-1),[L,ie]=(0,V.useState)(null),[ae,oe]=(0,V.useState)(null),[se,ce]=(0,V.useState)(Nl),le=dl(`(max-width: 768px)`),ue=(0,V.useRef)(null);(0,V.useEffect)(()=>{let e=()=>{m&&h(),requestAnimationFrame(()=>ue.current?.focus())};return window.addEventListener(`gaia:focus-search`,e),()=>window.removeEventListener(`gaia:focus-search`,e)},[m,h]);let de=(0,V.useMemo)(()=>({running:o,queued:c,awaiting:l,prompting:f}),[o,c,l,f]),fe=N.trim();(0,V.useEffect)(()=>{if(I(-1),ne(null),!fe){F(null);return}let e=new AbortController,t=setTimeout(()=>{bo(fe,se,e.signal).then(({results:e,truncated:t})=>F({query:fe,results:e,truncated:!!t})).catch(t=>{e.signal.aborted||(s.chat.error(`Chat search failed`,t),ne(`Could not search inside chats: ${t instanceof Error?t.message:t}`),F({query:fe,results:[],truncated:!1}))})},Al);return()=>{clearTimeout(t),e.abort()}},[fe,se]);let R=!!fe&&P?.query!==fe,z=(0,V.useMemo)(()=>P&&P.query===fe?new Map(P.results.map(e=>[e.session_id,e])):jl,[P,fe]),pe=Vc(i),he=(0,V.useMemo)(()=>{let e=Tl(fe);return Bc(fe?i.filter(t=>Tl(t.title).includes(e)||z.has(t.id)):i,de,{showAutomated:se})},[i,fe,z,de,se]),ge=(0,V.useMemo)(()=>fe?he.flatMap(e=>e.sessions):[],[fe,he]),_e=re>=0&&ge.length>0?ge[Math.min(re,ge.length-1)]:void 0;(0,V.useEffect)(()=>{_e&&document.getElementById(Pl(_e.id))?.scrollIntoView?.({block:`nearest`})},[_e]);let ve=(0,V.useCallback)(()=>{ce(e=>{try{localStorage.setItem(kl,e?`0`:`1`)}catch(e){s.system.warn(`Chat-list filter not saved; it will reset on reload.`,e)}return!e})},[]),ye=(0,V.useCallback)(e=>{d(e,{unread:!1}),xo(e).catch(t=>{s.chat.error(`Could not mark chat ${e} read`,t),oe(`Could not mark the chat read: ${t instanceof Error?t.message:t}`)})},[d]),be=i.find(e=>e.id===a)?.unread;(0,V.useEffect)(()=>{if(!a||!be)return;if(document.hasFocus()){ye(a);return}let e=()=>ye(a);return window.addEventListener(`focus`,e,{once:!0}),()=>window.removeEventListener(`focus`,e)},[a,be,ye]);let[xe,Se]=(0,V.useState)(null);(0,V.useEffect)(()=>{if(!xe)return;let e=setTimeout(()=>Se(null),1200);return()=>clearTimeout(e)},[xe]);let Ce=(0,V.useCallback)(async(e,t)=>{oe(null),d(e,{pinned:t});try{await yo(e,t)}catch(n){s.chat.error(`Could not ${t?`pin`:`unpin`} chat ${e}`,n),d(e,{pinned:!t}),oe(n instanceof Error?n.message:`Could not ${t?`pin`:`unpin`} the chat.`)}},[d]),we=(0,V.useCallback)(async(e,t)=>{let n=t.trim().slice(0,200).trim(),r=H.getState().sessions.find(t=>t.id===e)?.title;if(n&&t!==r&&n!==r){oe(null),d(e,{title:n});try{await go(e,{title:n,title_is_custom:!0})}catch(t){s.chat.error(`Could not rename chat ${e}`,t),r!==void 0&&d(e,{title:r}),oe(t instanceof Error?t.message:`Could not rename the chat.`)}}},[d]),Te=(0,V.useCallback)(()=>{window.innerWidth<=768&&g(!1)},[g]),Ee=(0,V.useCallback)(e=>{e===a?(_(e),Te()):(il(a),_(e),v([]),Te())},[a,_,v,Te]),De=e=>{if(e.key===`Escape`){e.preventDefault(),ee(``),ue.current?.blur();return}if(!fe||ge.length===0||e.nativeEvent.isComposing)return;let t=_e?ge.indexOf(_e):-1;e.key===`ArrowDown`?(e.preventDefault(),I(Math.min(t+1,ge.length-1))):e.key===`ArrowUp`?(e.preventDefault(),I(Math.max(t-1,0))):e.key===`Enter`&&(e.preventDefault(),Ee((_e??ge[0]).id))},Oe=(0,V.useCallback)(async e=>{ie(null),b(e);try{await _o(e),y(e)}catch(t){s.chat.error(`Delete failed for session ${e}`,t),ie(t instanceof Error?t.message:`Could not delete the chat.`)}finally{x(e)}},[b,x,y]),ke=typeof window<`u`&&window.innerWidth<=768,Ae=m&&!ke,je=H(e=>e.setSidebarCollapsed),Me=yl((0,V.useCallback)(()=>je(!0),[je])),Ne=!ke&&!Ae,Pe=[{key:`memory`,label:r(`sidebar.memory`),icon:O,on:D,onClick:()=>{C(!0),Te()}},{key:`schedules`,label:r(`sidebar.schedules`),icon:me,on:k,onClick:()=>{T(!0),Te()}},{key:`documents`,label:r(`sidebar.documents`),icon:We,on:!1,onClick:()=>{E(!0),Te()}}];return(0,U.jsxs)(`aside`,{className:`sb${p?` is-open`:``}${Ae?` is-collapsed`:``}${Me.resizing?` is-resizing`:``}`,style:Ne?{width:Me.width,minWidth:Me.width}:void 0,"aria-label":r(`sidebar.label`),children:[Ne&&Me.handle,(0,U.jsxs)(`div`,{className:`sb-top`,children:[(0,U.jsxs)(`div`,{className:`sb-brand`,children:[(0,U.jsx)(`img`,{src:fl,alt:``,width:22,height:22}),!Ae&&(0,U.jsx)(`span`,{children:`GAIA`})]}),(0,U.jsx)(`button`,{type:`button`,className:`sb-icon-btn`,onClick:ke?()=>g(!1):h,"aria-label":r(Ae?`sidebar.expand`:`sidebar.collapse`),title:r.hint(r(Ae?`sidebar.expand`:`sidebar.collapse`),tl(`Mod+B`)),children:ke?(0,U.jsx)(Bn,{size:17}):Ae?(0,U.jsx)(zt,{size:17}):(0,U.jsx)(Lt,{size:17})})]}),(0,U.jsxs)(`div`,{className:`sb-actions`,children:[Ae?(0,U.jsx)(`button`,{type:`button`,className:`sb-nav-item`,onClick:()=>window.dispatchEvent(new CustomEvent(`gaia:focus-search`)),"aria-label":r(`sidebar.search`),children:(0,U.jsx)(on,{size:16,"aria-hidden":`true`})}):(0,U.jsxs)(`label`,{className:`sb-search`,children:[(0,U.jsx)(on,{size:14,"aria-hidden":`true`}),(0,U.jsx)(`input`,{ref:ue,type:`search`,value:N,onChange:e=>ee(e.target.value),onKeyDown:De,...Ci,placeholder:r(`sidebar.search`),"aria-label":r.hint(r(`sidebar.search`),tl(`Mod+K`)),"aria-controls":`sb-chat-list`,"aria-activedescendant":_e?Pl(_e.id):void 0,dir:`auto`})]}),(0,U.jsx)(`p`,{className:`sb-sr-only`,role:`status`,"aria-live":`polite`,children:fe&&!R?ge.length===0?r(`sidebar.noMatch`):r.plural(`sidebar.matchCount`,ge.length):``}),(0,U.jsxs)(`button`,{type:`button`,className:`sb-nav-item`,onClick:()=>{e(),Te()},title:r.hint(r(`sidebar.newChat`),tl(`Mod+Shift+O`)),children:[(0,U.jsx)(Sn,{size:16,"aria-hidden":`true`}),!Ae&&(0,U.jsx)(`span`,{children:r(`sidebar.newChat`)})]}),Pe.map(({key:e,label:t,icon:n,on:r,onClick:i})=>(0,U.jsxs)(`button`,{type:`button`,className:`sb-nav-item${r?` is-active`:``}`,onClick:i,"aria-current":r?`page`:void 0,"aria-label":t,title:Ae?t:void 0,children:[(0,U.jsx)(n,{size:16,"aria-hidden":`true`}),!Ae&&(0,U.jsx)(`span`,{children:t})]},e))]}),!Ae&&(0,U.jsxs)(`nav`,{className:`sb-list`,id:`sb-chat-list`,"aria-label":r(`sidebar.recent`),children:[he.length===0&&(0,U.jsx)(`p`,{className:`sb-empty`,children:r(fe?R?`sidebar.searching`:`sidebar.noMatch`:`sidebar.empty`)}),he.map(e=>(0,U.jsxs)(`section`,{className:`sb-group${e.label===`Needs you`?` is-needs-you`:``}`,children:[(0,U.jsx)(`h2`,{className:`sb-group-label`,children:r(Ol[e.label])}),(0,U.jsx)(`ul`,{children:e.sessions.map(e=>(0,U.jsx)(Fl,{session:e,active:e.id===a,phone:le,moved:e.id===xe,status:Rc(e,de),queuePlace:c.indexOf(e.id)+1,unsent:u[e.id]?.length??0,failed:u[e.id]?.filter(e=>e.state===`failed`).length??0,onSelect:Ee,onDelete:Oe,onPin:(e,t,n)=>{n&&Se(e),Ce(e,t)},onRename:(e,t)=>void we(e,t),rowId:fe?Pl(e.id):void 0,kbdActive:_e?.id===e.id,titleMatch:fe?El(e.title,fe):null,snippet:z.get(e.id)?.field===`message`?z.get(e.id).snippet:null},e.id))})]},e.label)),pe>0&&(0,U.jsx)(`button`,{type:`button`,className:`sb-filter`,onClick:ve,"aria-pressed":se,children:se?r(`sidebar.hideBackground`):r.plural(`sidebar.showBackground`,pe)}),fe&&P?.query===fe&&P.truncated&&(0,U.jsx)(`p`,{className:`sb-empty`,children:r(`sidebar.searchCapped`,{n:P.results.length})}),te&&(0,U.jsx)(`p`,{className:`sb-error`,role:`alert`,children:te}),L&&(0,U.jsx)(`p`,{className:`sb-error`,role:`alert`,children:L}),ae&&(0,U.jsx)(`p`,{className:`sb-error`,role:`alert`,children:ae})]}),(0,U.jsxs)(`div`,{className:`sb-bottom`,children:[!Ae&&(0,U.jsx)(dc,{}),(0,U.jsxs)(`div`,{className:`sb-bottom-actions`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`sb-icon-btn${j?` is-active`:``}`,onClick:()=>M(!j),"aria-label":A>0?r(`sidebar.notificationsUnread`,{n:A}):r(`sidebar.notifications`),"aria-expanded":j,title:r(`sidebar.notifications`),children:[(0,U.jsx)(w,{size:16}),A>0&&(0,U.jsx)(`span`,{className:`sb-badge`,"aria-hidden":`true`,children:A>99?`99+`:A})]}),t&&(0,U.jsx)(`button`,{type:`button`,className:`sb-icon-btn${n?` is-active`:``}`,onClick:t,"aria-label":r(n?`sidebar.mobileAccessOn`:`sidebar.mobileAccess`),title:r(`sidebar.mobileAccess`),children:(0,U.jsx)(vn,{size:16})}),(0,U.jsx)(`button`,{type:`button`,className:`sb-icon-btn`,onClick:()=>S(),"aria-label":r(`sidebar.settings`),title:r.hint(r(`sidebar.settings`),tl(`Mod+,`)),children:(0,U.jsx)(cn,{size:16})})]})]})]})}function Ll(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Rl=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Bl={};function Vl(e,t){return((t||Bl).jsx?zl:Rl).test(e)}var Hl=/[ \t\n\f\r]/g;function Ul(e){return typeof e==`object`?e.type===`text`&&Wl(e.value):Wl(e)}function Wl(e){return e.replace(Hl,``)===``}var Gl=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Gl.prototype.normal={},Gl.prototype.property={},Gl.prototype.space=void 0;function Kl(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Gl(n,r,t)}function ql(e){return e.toLowerCase()}var Jl=class{constructor(e,t){this.attribute=t,this.property=e}};Jl.prototype.attribute=``,Jl.prototype.booleanish=!1,Jl.prototype.boolean=!1,Jl.prototype.commaOrSpaceSeparated=!1,Jl.prototype.commaSeparated=!1,Jl.prototype.defined=!1,Jl.prototype.mustUseProperty=!1,Jl.prototype.number=!1,Jl.prototype.overloadedBoolean=!1,Jl.prototype.property=``,Jl.prototype.spaceSeparated=!1,Jl.prototype.space=void 0;var Yl=e({boolean:()=>J,booleanish:()=>Zl,commaOrSpaceSeparated:()=>eu,commaSeparated:()=>$l,number:()=>Y,overloadedBoolean:()=>Ql,spaceSeparated:()=>X}),Xl=0,J=tu(),Zl=tu(),Ql=tu(),Y=tu(),X=tu(),$l=tu(),eu=tu();function tu(){return 2**++Xl}var nu=Object.keys(Yl),ru=class extends Jl{constructor(e,t,n,r){let i=-1;if(super(e,t),iu(this,`space`,r),typeof n==`number`)for(;++i<nu.length;){let e=nu[i];iu(this,nu[i],(n&Yl[e])===Yl[e])}}};ru.prototype.defined=!0;function iu(e,t,n){n&&(e[t]=n)}function au(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new ru(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ql(r)]=r,n[ql(a.attribute)]=r}return new Gl(t,n,e.space)}var ou=au({properties:{ariaActiveDescendant:null,ariaAtomic:Zl,ariaAutoComplete:null,ariaBusy:Zl,ariaChecked:Zl,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:X,ariaCurrent:null,ariaDescribedBy:X,ariaDetails:null,ariaDisabled:Zl,ariaDropEffect:X,ariaErrorMessage:null,ariaExpanded:Zl,ariaFlowTo:X,ariaGrabbed:Zl,ariaHasPopup:null,ariaHidden:Zl,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:X,ariaLevel:Y,ariaLive:null,ariaModal:Zl,ariaMultiLine:Zl,ariaMultiSelectable:Zl,ariaOrientation:null,ariaOwns:X,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:Zl,ariaReadOnly:Zl,ariaRelevant:null,ariaRequired:Zl,ariaRoleDescription:X,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:Zl,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function su(e,t){return t in e?e[t]:t}function cu(e,t){return su(e,t.toLowerCase())}var lu=au({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:$l,acceptCharset:X,accessKey:X,action:null,allow:null,allowFullScreen:J,allowPaymentRequest:J,allowUserMedia:J,alt:null,as:null,async:J,autoCapitalize:null,autoComplete:X,autoFocus:J,autoPlay:J,blocking:X,capture:null,charSet:null,checked:J,cite:null,className:X,cols:Y,colSpan:null,content:null,contentEditable:Zl,controls:J,controlsList:X,coords:Y|$l,crossOrigin:null,data:null,dateTime:null,decoding:null,default:J,defer:J,dir:null,dirName:null,disabled:J,download:Ql,draggable:Zl,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:J,formTarget:null,headers:X,height:Y,hidden:Ql,high:Y,href:null,hrefLang:null,htmlFor:X,httpEquiv:X,id:null,imageSizes:null,imageSrcSet:null,inert:J,inputMode:null,integrity:null,is:null,isMap:J,itemId:null,itemProp:X,itemRef:X,itemScope:J,itemType:X,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:J,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:J,muted:J,name:null,nonce:null,noModule:J,noValidate:J,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:J,optimum:Y,pattern:null,ping:X,placeholder:null,playsInline:J,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:J,referrerPolicy:null,rel:X,required:J,reversed:J,rows:Y,rowSpan:Y,sandbox:X,scope:null,scoped:J,seamless:J,selected:J,shadowRootClonable:J,shadowRootDelegatesFocus:J,shadowRootMode:null,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:Zl,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:J,useMap:null,value:Zl,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:X,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:J,declare:J,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:J,noHref:J,noShade:J,noWrap:J,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:Zl,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:J,disableRemotePlayback:J,prefix:null,property:null,results:Y,security:null,unselectable:null},space:`html`,transform:cu}),uu=au({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:eu,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:X,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:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:J,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,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:$l,g2:$l,glyphName:$l,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:eu,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,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:Y,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:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:X,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:eu,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:eu,rev:eu,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:eu,requiredFeatures:eu,requiredFonts:eu,requiredFormats:eu,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:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:eu,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:eu,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:eu,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:su}),du=au({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()}}),fu=au({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:cu}),pu=au({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),mu={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`},hu=/[A-Z]/g,gu=/-[a-z]/g,_u=/^data[-\w.:]+$/i;function vu(e,t){let n=ql(t),r=t,i=Jl;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&_u.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(gu,bu);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!gu.test(e)){let n=e.replace(hu,yu);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=ru}return new i(r,t)}function yu(e){return`-`+e.toLowerCase()}function bu(e){return e.charAt(1).toUpperCase()}var xu=Kl([ou,lu,du,fu,pu],`html`),Su=Kl([ou,uu,du,fu,pu],`svg`);function Cu(e){return e.join(` `).trim()}var wu=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
14
|
+
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Tu=n(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(wu());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),Eu=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Du=n(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Tu()),i=Eu();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),Ou=Au(`end`),ku=Au(`start`);function Au(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function ju(e){let t=ku(e),n=Ou(e);if(t&&n)return{start:t,end:n}}function Mu(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Pu(e.position):`start`in e||`end`in e?Pu(e):`line`in e||`column`in e?Nu(e):``}function Nu(e){return Fu(e&&e.line)+`:`+Fu(e&&e.column)}function Pu(e){return Nu(e&&e.start)+`-`+Nu(e&&e.end)}function Fu(e){return e&&typeof e==`number`?e:1}var Iu=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Mu(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Iu.prototype.file=``,Iu.prototype.name=``,Iu.prototype.reason=``,Iu.prototype.message=``,Iu.prototype.stack=``,Iu.prototype.column=void 0,Iu.prototype.line=void 0,Iu.prototype.ancestors=void 0,Iu.prototype.cause=void 0,Iu.prototype.fatal=void 0,Iu.prototype.place=void 0,Iu.prototype.ruleId=void 0,Iu.prototype.source=void 0;var Lu=t(Du(),1),Ru={}.hasOwnProperty,zu=new Map,Bu=/[A-Z]/g,Vu=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Hu=new Set([`td`,`th`]),Uu=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Wu(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=$u(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Qu(n,t.jsx,t.jsxs)}let 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`?Su:xu,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Gu(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Gu(e,t,n){if(t.type===`element`)return Ku(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return qu(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Yu(e,t,n);if(t.type===`mdxjsEsm`)return Ju(e,t);if(t.type===`root`)return Xu(e,t,n);if(t.type===`text`)return Z(e,t)}function Ku(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Su,e.schema=i),e.ancestors.push(t);let a=ad(e,t.tagName,!1),o=ed(e,t),s=nd(e,t);return Vu.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Ul(e)})),Q(e,o,a,t),Zu(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function qu(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}od(e,t.position)}function Ju(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);od(e,t.position)}function Yu(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Su,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:ad(e,t.name,!0),o=td(e,t),s=nd(e,t);return Q(e,o,a,t),Zu(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Xu(e,t,n){let r={};return Zu(r,nd(e,t)),e.create(t,e.Fragment,r,n)}function Z(e,t){return t.value}function Q(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Zu(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Qu(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function $u(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ku(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function ed(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ru.call(t.properties,i)){let a=rd(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Hu.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function td(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else od(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else od(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function nd(e,t){let n=[],r=-1,i=e.passKeys?new Map:zu;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Gu(e,a,o);s!==void 0&&n.push(s)}return n}function rd(e,t,n){let r=vu(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ll(n):Cu(n)),r.property===`style`){let t=typeof n==`object`?n:id(e,String(n));return e.stylePropertyNameCase===`css`&&(t=sd(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?mu[r.property]||r.property:r.attribute,n]}}function id(e,t){try{return(0,Lu.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Iu("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Uu+`#cannot-parse-style-attribute`,r}}function ad(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Vl(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Vl(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ru.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);od(e)}function od(e,t){let n=new Iu("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=Uu+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function sd(e){let t={},n;for(n in e)Ru.call(e,n)&&(t[cd(n)]=e[n]);return t}function cd(e){let t=e.replace(Bu,ld);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function ld(e){return`-`+e.toLowerCase()}var ud={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`]},dd={};function fd(e,t){let n=t||dd;return pd(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function pd(e,t,n){if(hd(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 md(e.children,t,n)}return Array.isArray(e)?md(e,t,n):``}function md(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=pd(e[i],t,n);return r.join(``)}function hd(e){return!!(e&&typeof e==`object`)}var gd=document.createElement(`i`);function _d(e){let t=`&`+e+`;`;gd.innerHTML=t;let n=gd.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function vd(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function yd(e,t){return e.length>0?(vd(e,e.length,0,t),e):t}var bd={}.hasOwnProperty;function xd(e){let t={},n=-1;for(;++n<e.length;)Sd(t,e[n]);return t}function Sd(e,t){let n;for(n in t){let r=(bd.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){bd.call(r,a)||(r[a]=[]);let e=i[a];Cd(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Cd(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);vd(e,0,0,r)}function wd(e,t){let 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 Td(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Ed=Ld(/[A-Za-z]/),Dd=Ld(/[\dA-Za-z]/),Od=Ld(/[#-'*+\--9=?A-Z^-~]/);function kd(e){return e!==null&&(e<32||e===127)}var Ad=Ld(/\d/),jd=Ld(/[\dA-Fa-f]/),Md=Ld(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function Nd(e){return e!==null&&(e<0||e===32)}function Pd(e){return e===-2||e===-1||e===32}var Fd=Ld(/\p{P}|\p{S}/u),Id=Ld(/\s/);function Ld(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Rd(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Dd(e.charCodeAt(n+1))&&Dd(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function zd(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Pd(r)?(e.enter(n),s(r)):t(r)}function s(r){return Pd(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Bd={tokenize:Vd};function Vd(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),zd(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return $(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Hd={tokenize:Wd},Ud={tokenize:Gd};function Wd(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return vd(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ud,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Ud,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return $(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;vd(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Gd(e,t,n){return zd(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Kd(e){if(e===null||Nd(e)||Id(e))return 1;if(Fd(e))return 2}function qd(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Jd={name:`attention`,resolveAll:Yd,tokenize:Xd};function Yd(e,t){let n=-1,r,i,a,o,s,c,l,u;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;let d={...e[r][1].end},f={...e[n][1].start};Zd(d,-c),Zd(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=yd(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=yd(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=yd(l,qd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=yd(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=yd(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,vd(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Xd(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Kd(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Kd(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Zd(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Qd={name:`autolink`,tokenize:$d};function $d(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Ed(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Dd(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Dd(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||kd(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Od(t)?(e.consume(t),l):n(t)}function u(e){return Dd(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Dd(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ef={partial:!0,tokenize:tf};function tf(e,t,n){return r;function r(t){return Pd(t)?zd(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||$(e)?t(e):n(e)}}var nf={continuation:{tokenize:af},exit:of,name:`blockQuote`,tokenize:rf};function rf(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Pd(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function af(e,t,n){let r=this;return i;function i(t){return Pd(t)?zd(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(nf,t,n)(r)}}function of(e){e.exit(`blockQuote`)}var sf={name:`characterEscape`,tokenize:cf};function cf(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Md(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var lf={name:`characterReference`,tokenize:uf};function uf(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Dd,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=jd,u):(e.enter(`characterReferenceValue`),a=7,o=Ad,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Dd&&!_d(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var df={partial:!0,tokenize:mf},ff={concrete:!0,name:`codeFenced`,tokenize:pf};function pf(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Pd(t)?zd(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(df,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Pd(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),zd(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Pd(t)?zd(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||$(t)?e.check(df,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||$(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Pd(t)?zd(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Pd(t)?zd(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function mf(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var hf={name:`codeIndented`,tokenize:_f},gf={partial:!0,tokenize:vf};function _f(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),zd(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):$(t)?e.attempt(gf,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||$(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function vf(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):zd(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):$(e)?i(e):n(e)}}var yf={name:`codeText`,previous:xf,resolve:bf,tokenize:Sf};function bf(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 xf(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Sf(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||$(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Cf=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&wf(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),wf(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),wf(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);wf(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);wf(this.left,t.reverse())}}}};function wf(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 Tf(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Cf(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Ef(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return vd(e,0,1/0,u.slice(0)),!l}function Ef(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Df={resolve:kf,tokenize:Af},Of={partial:!0,tokenize:jf};function kf(e){return Tf(e),e}function Af(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):$(t)?e.check(Of,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function jf(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),zd(e,a,`linePrefix`)}function a(i){if(i===null||$(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Mf(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||kd(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||$(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Nd(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||kd(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Nf(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):$(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Pd(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Pf(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),zd(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||$(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Ff(e,t){let n;return r;function r(i){return $(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Pd(i)?zd(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var If={name:`definition`,tokenize:Rf},Lf={partial:!0,tokenize:zf};function Rf(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Nf.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Td(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Nd(t)?Ff(e,l)(t):l(t)}function l(t){return Mf(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Lf,d,d)(t)}function d(t){return Pd(t)?zd(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function zf(e,t,n){return r;function r(t){return Nd(t)?Ff(e,i)(t):n(t)}function i(t){return Pf(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Pd(t)?zd(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||$(e)?t(e):n(e)}}var Bf={name:`hardBreakEscape`,tokenize:Vf};function Vf(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return $(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Hf={name:`headingAtx`,resolve:Uf,tokenize:Wf};function Uf(e,t){let n=e.length-2,r=3,i,a;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},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},vd(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Wf(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Nd(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||$(n)?(e.exit(`atxHeading`),t(n)):Pd(n)?zd(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Nd(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Gf=`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`.split(`.`),Kf=[`pre`,`script`,`style`,`textarea`],qf={concrete:!0,name:`htmlFlow`,resolveTo:Xf,tokenize:Zf},Jf={partial:!0,tokenize:$f},Yf={partial:!0,tokenize:Qf};function Xf(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 Zf(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:F):Ed(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Ed(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Ed(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Nd(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Kf.includes(l)?(i=1,r.interrupt?t(s):O(s)):Gf.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Dd(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Pd(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Ed(t)?(e.consume(t),b):Pd(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Dd(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Pd(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Pd(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||$(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Nd(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Pd(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||$(t)?O(t):Pd(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),te):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),P):$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Jf,ne,k)(t)):t===null||$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Yf,A,ne)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),F):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return Kf.includes(n)?(e.consume(t),te):O(t)}return Ed(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function P(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),te):t===45&&i===2?(e.consume(t),F):O(t)}function te(t){return t===null||$(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(n){return e.exit(`htmlFlow`),t(n)}}function Qf(e,t,n){let r=this;return i;function i(t){return $(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function $f(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ef,t,n)}}var ep={name:`htmlText`,tokenize:tp};function tp(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Ed(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Ed(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):$(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):$(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):$(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):$(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return Ed(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Dd(t)?(e.consume(t),S):C(t)}function C(t){return $(t)?(o=C,N(t)):Pd(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Dd(t)?(e.consume(t),w):t===47||t===62||Nd(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||Ed(t)?(e.consume(t),E):$(t)?(o=T,N(t)):Pd(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Dd(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):$(t)?(o=D,N(t)):Pd(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):$(t)?(o=O,N(t)):Pd(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):$(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Nd(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Nd(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return Pd(t)?zd(e,P,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):P(t)}function P(t){return e.enter(`htmlTextData`),o(t)}}var np={name:`labelEnd`,resolveAll:op,resolveTo:sp,tokenize:cp},rp={tokenize:lp},ip={tokenize:up},ap={tokenize:dp};function op(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&vd(e,0,e.length,n),e}function sp(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=yd(s,e.slice(a+1,a+r+3)),s=yd(s,[[`enter`,u,t]]),s=yd(s,qd(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=yd(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=yd(s,e.slice(o+1)),s=yd(s,[[`exit`,c,t]]),vd(e,a,e.length,s),e}function cp(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Td(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(rp,u,o?u:d)(t):t===91?e.attempt(ip,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(ap,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function lp(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Nd(t)?Ff(e,a)(t):a(t)}function a(t){return t===41?u(t):Mf(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Nd(t)?Ff(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Pf(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Nd(t)?Ff(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function up(e,t,n){let r=this;return i;function i(t){return Nf.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Td(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function dp(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var fp={name:`labelStartImage`,resolveAll:np.resolveAll,tokenize:pp};function pp(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var mp={name:`labelStartLink`,resolveAll:np.resolveAll,tokenize:hp};function hp(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var gp={name:`lineEnding`,tokenize:_p};function _p(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),zd(e,t,`linePrefix`)}}var vp={name:`thematicBreak`,tokenize:yp};function yp(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Pd(t)?zd(e,s,`whitespace`)(t):s(t))}}var bp={continuation:{tokenize:wp},exit:Ep,name:`list`,tokenize:Cp},xp={partial:!0,tokenize:Dp},Sp={partial:!0,tokenize:Tp};function Cp(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Ad(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(vp,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Ad(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ef,r.interrupt?n:u,e.attempt(xp,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Pd(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function wp(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ef,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,zd(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Pd(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Sp,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,zd(e,e.attempt(bp,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Tp(e,t,n){let r=this;return zd(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Ep(e){e.exit(this.containerState.type)}function Dp(e,t,n){let r=this;return zd(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Pd(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Op={name:`setextUnderline`,resolveTo:kp,tokenize:Ap};function kp(e,t){let n=e.length,r,i,a;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),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Ap(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Pd(t)?zd(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var jp={tokenize:Mp};function Mp(e){let t=this,n=e.attempt(ef,r,e.attempt(this.parser.constructs.flowInitial,i,zd(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Df,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Np={resolveAll:Lp()},Pp=Ip(`string`),Fp=Ip(`text`);function Ip(e){return{resolveAll:Lp(e===`text`?Rp:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Lp(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Rp(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var zp=e({attentionMarkers:()=>qp,contentInitial:()=>Vp,disable:()=>Jp,document:()=>Bp,flow:()=>Up,flowInitial:()=>Hp,insideSpan:()=>Kp,string:()=>Wp,text:()=>Gp}),Bp={42:bp,43:bp,45:bp,48:bp,49:bp,50:bp,51:bp,52:bp,53:bp,54:bp,55:bp,56:bp,57:bp,62:nf},Vp={91:If},Hp={[-2]:hf,[-1]:hf,32:hf},Up={35:Hf,42:vp,45:[Op,vp],60:qf,61:Op,95:vp,96:ff,126:ff},Wp={38:lf,92:sf},Gp={[-5]:gp,[-4]:gp,[-3]:gp,33:fp,38:lf,42:Jd,60:[Qd,ep],91:mp,92:[Bf,sf],93:np,95:Jd,96:yf},Kp={null:[Jd,Np]},qp={null:[42,95]},Jp={null:[]};function Yp(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=yd(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=qd(a,l.events,l),l.events):[]}function f(e,t){return Zp(p(e),t)}function p(e){return Xp(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){$(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&vd(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Xp(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Zp(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
15
|
+
`;break;case-3:o=`\r
|
|
16
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Qp(e){let t={constructs:xd([zp,...(e||{}).extensions||[]]),content:n(Bd),defined:[],document:n(Hd),flow:n(jp),lazy:{},string:n(Pp),text:n(Fp)};return t;function n(e){return n;function n(n){return Yp(t,e,n)}}}function $p(e){for(;!Tf(e););return e}var em=/[\0\t\n\r]/g;function tm(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(em.lastIndex=u,c=em.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var nm=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rm(e){return e.replace(nm,im)}function im(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return wd(n.slice(t?2:1),t?16:10)}return _d(n)||e}var am={}.hasOwnProperty;function om(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),sm(n)($p(Qp(n).document().write(tm()(e,t,!0))))}function sm(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(he),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(R),blockQuote:a(ce),characterEscape:T,characterReference:T,codeFenced:a(le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(le,o),codeText:a(ue,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(de),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(fe),hardBreakEscape:a(z),hardBreakTrailing:a(z),htmlFlow:a(pe,o),htmlFlowData:T,htmlText:a(pe,o),htmlTextData:T,image:a(me),label:o,link:a(he),listItem:a(_e),listItemValue:f,listOrdered:a(ge,d),listUnordered:a(ge),paragraph:a(ve),reference:re,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(R),strong:a(ye),thematicBreak:a(xe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:se,autolinkProtocol:oe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:L,characterReferenceMarkerNumeric:L,characterReferenceValue:ie,characterReference:ae,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:P,labelText:ee,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:I,resourceDestinationString:F,resourceTitleString:te,resource:ne,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};lm(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];am.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||dm).call(a,void 0,e[0])}for(r.position={start:cm(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:cm(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:cm(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||dm).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Mu({start:e.start,end:e.end})+`): it’s not open`);n.position.end=cm(e.end)}function u(){return fd(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Td(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=be(),n.position={start:cm(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=cm(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=cm(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=rm(t),n.identifier=Td(t).toLowerCase()}function P(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function I(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Td(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function L(e){this.data.characterReferenceType=e.type}function ie(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=wd(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=_d(t);let i=this.stack[this.stack.length-1];i.value+=r}function ae(e){let t=this.stack.pop();t.position.end=cm(e.end)}function oe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ce(){return{type:`blockquote`,children:[]}}function le(){return{type:`code`,lang:null,meta:null,value:``}}function ue(){return{type:`inlineCode`,value:``}}function de(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function fe(){return{type:`emphasis`,children:[]}}function R(){return{type:`heading`,depth:0,children:[]}}function z(){return{type:`break`}}function pe(){return{type:`html`,value:``}}function me(){return{type:`image`,title:null,url:``,alt:null}}function he(){return{type:`link`,title:null,url:``,children:[]}}function ge(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function _e(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ve(){return{type:`paragraph`,children:[]}}function ye(){return{type:`strong`,children:[]}}function be(){return{type:`text`,value:``}}function xe(){return{type:`thematicBreak`}}}function cm(e){return{line:e.line,column:e.column,offset:e.offset}}function lm(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?lm(e,r):um(e,r)}}function um(e,t){let n;for(n in t)if(am.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function dm(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Mu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Mu({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Mu({start:t.start,end:t.end})+`) is still open`)}function fm(e){let t=this;t.parser=n;function n(n){return om(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function pm(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function mm(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
17
|
+
`}]}function hm(e,t){let n=t.value?t.value+`
|
|
18
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function gm(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _m(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vm(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Rd(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function ym(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bm(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function xm(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Sm(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return xm(e,t);let i={src:Rd(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Cm(e,t){let n={src:Rd(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function wm(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Tm(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return xm(e,t);let i={href:Rd(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Em(e,t){let n={href:Rd(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Dm(e,t,n){let r=e.all(t),i=n?Om(n):km(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
19
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
20
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Om(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=km(n[r])}return t}function km(e){return e.spread??e.children.length>1}function Am(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function jm(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mm(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Nm(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Pm(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=ku(t.children[1]),o=Ou(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Fm(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Im(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Lm=9,Rm=32;function zm(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Bm(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Bm(t.slice(i),i>0,!1)),a.join(``)}function Bm(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Lm||t===Rm;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Lm||t===Rm;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Vm(e,t){let n={type:`text`,value:zm(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Hm(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Um={blockquote:pm,break:mm,code:hm,delete:gm,emphasis:_m,footnoteReference:vm,heading:ym,html:bm,imageReference:Sm,image:Cm,inlineCode:wm,linkReference:Tm,link:Em,listItem:Dm,list:Am,paragraph:jm,root:Mm,strong:Nm,table:Pm,tableCell:Im,tableRow:Fm,text:Vm,thematicBreak:Hm,toml:Wm,yaml:Wm,definition:Wm,footnoteDefinition:Wm};function Wm(){}var Gm=typeof self==`object`?self:globalThis,Km=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new Gm[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new Gm[a](o),i)};return r},qm=e=>Km(new Map,e)(0),Jm=``,{toString:Ym}={},{keys:Xm}=Object,Zm=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Ym.call(e).slice(8,-1);switch(n){case`Array`:return[1,Jm];case`Object`:return[2,Jm];case`Date`:return[3,Jm];case`RegExp`:return[4,Jm];case`Map`:return[5,Jm];case`Set`:return[6,Jm];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},Qm=([e,t])=>e===0&&(t===`function`||t===`symbol`),$m=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Zm(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Xm(r))(e||!Qm(Zm(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Qm(Zm(n))||Qm(Zm(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Qm(Zm(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},eh=(e,{json:t,lossy:n}={})=>{let r=[];return $m(!(t||n),!!t,new Map,r)(e),r},th=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?qm(eh(e,t)):structuredClone(e):(e,t)=>qm(eh(e,t));function nh(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function rh(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function ih(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||nh,r=e.options.footnoteBackLabel||rh,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Rd(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...th(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
21
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
22
|
+
`}]}}var ah=(function(e){if(e==null)return uh;if(typeof e==`function`)return lh(e);if(typeof e==`object`)return Array.isArray(e)?oh(e):sh(e);if(typeof e==`string`)return ch(e);throw Error(`Expected function, string, or object as test`)});function oh(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ah(e[n]);return lh(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function sh(e){let t=e;return lh(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ch(e){return lh(t);function t(t){return t&&t.type===e}}function lh(e){return t;function t(t,n,r){return!!(dh(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function uh(){return!0}function dh(e){return typeof e==`object`&&!!e&&`type`in e}function fh(e){return e}var ph=[];function mh(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=ah(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+fh(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=ph,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=hh(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function hh(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?ph:[e]}function gh(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),mh(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var _h={}.hasOwnProperty,vh={};function yh(e,t){let n=t||vh,r=new Map,i=new Map,a={all:s,applyData:xh,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Um,...n.handlers},one:o,options:n,patch:bh,wrap:Ch};return gh(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(_h.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=th(n);return r.children=a.all(e),r}return th(e)}return(a.options.unknownHandler||Sh)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=wh(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=wh(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function bh(e,t){e.position&&(t.position=ju(e))}function xh(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,th(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Sh(e,t){let n=t.data||{},r=`value`in t&&!(_h.call(n,`hProperties`)||_h.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 Ch(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
23
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
24
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
25
|
+
`}),n}function wh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Th(e,t){let n=yh(e,t),r=n.one(e,void 0),i=ih(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
26
|
+
`},i)),a}function Eh(e,t){return e&&`run`in e?async function(n,r){let i=Th(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Th(n,{file:r,...e||t})}}function Dh(e){if(e)throw e}var Oh=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function kh(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ah(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?jh(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function jh(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Mh={basename:Nh,dirname:Ph,extname:Fh,join:Ih,sep:`/`};function Nh(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);zh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Ph(e){if(zh(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||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Fh(e){zh(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Ih(...e){let t=-1,n;for(;++t<e.length;)zh(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Lh(n)}function Lh(e){zh(e);let t=e.codePointAt(0)===47,n=Rh(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Rh(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===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=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function zh(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Bh={cwd:Vh};function Vh(){return`/`}function Hh(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Uh(e){if(typeof e==`string`)e=new URL(e);else if(!Hh(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Wh(e)}function Wh(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Gh=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Kh=class{constructor(e){let t;t=e?Hh(e)?{path:e}:typeof e==`string`||Xh(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Bh.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Gh.length;){let e=Gh[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Gh.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Mh.basename(this.path):void 0}set basename(e){Jh(e,`basename`),qh(e,`basename`),this.path=Mh.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Mh.dirname(this.path):void 0}set dirname(e){Yh(this.basename,`dirname`),this.path=Mh.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Mh.extname(this.path):void 0}set extname(e){if(qh(e,`extname`),Yh(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Mh.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Hh(e)&&(e=Uh(e)),Jh(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Mh.basename(this.path,this.extname):void 0}set stem(e){Jh(e,`stem`),qh(e,`stem`),this.path=Mh.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Iu(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function qh(e,t){if(e&&e.includes(Mh.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Mh.sep+"`")}function Jh(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Yh(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Xh(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Zh=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Qh=t(Oh(),1),$h={}.hasOwnProperty,eg=new class e extends Zh{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=Ah()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Qh.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(rg(`data`,this.frozen),this.namespace[e]=t,this):$h.call(this.namespace,e)&&this.namespace[e]||void 0:e?(rg(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=og(e),n=this.parser||this.Parser;return tg(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),tg(`process`,this.parser||this.Parser),ng(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=og(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);cg(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),tg(`processSync`,this.parser||this.Parser),ng(`processSync`,this.compiler||this.Compiler),this.process(e,r),ag(`processSync`,`process`,t),n;function r(e,r){t=!0,Dh(e),n=r}}run(e,t,n){ig(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=og(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),ag(`runSync`,`run`,n),r;function i(e,t){Dh(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=og(t),r=this.compiler||this.Compiler;return ng(`stringify`,r),ig(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(rg(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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(e.plugins),e.settings&&(r.settings=(0,Qh.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];kh(o)&&kh(r)&&(r=(0,Qh.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function tg(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function ng(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function rg(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ig(e){if(!kh(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function ag(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function og(e){return sg(e)?e:new Kh(e)}function sg(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function cg(e){return typeof e==`string`||lg(e)}function lg(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ug=[],dg={allowDangerousHtml:!0},fg=/^(https?|ircs?|mailto|xmpp)$/i,pg=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function mg(e){let t=hg(e),n=gg(e);return _g(t.runSync(t.parse(n),n),e)}function hg(e){let t=e.rehypePlugins||ug,n=e.remarkPlugins||ug,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dg}:dg;return eg().use(fm).use(n).use(Eh,r).use(t)}function gg(e){let t=e.children||``,n=new Kh;return typeof t==`string`?n.value=t:``+t,n}function _g(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||vg;for(let e of pg)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return gh(e,l),Wu(e,{Fragment:U.Fragment,components:i,ignoreInvalidStyle:!0,jsx:U.jsx,jsxs:U.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in ud)if(Object.hasOwn(ud,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=ud[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function vg(e){let 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||fg.test(e.slice(0,t))?e:``}var yg=[`script`,`iframe`,`object`,`embed`,`style`],bg=/^\/api\/files\/uploads\/([A-Za-z0-9][A-Za-z0-9._-]*)$/;function xg(e){if(!e)return``;if(e.startsWith(`#`))return e;let t=bg.exec(e);if(t)return`${c()}/files/uploads/${t[1]}`;let n=e.indexOf(`:`);if(n===-1)return``;let r=e.slice(0,n).toLowerCase();return r===`https`||r===`http`||r===`mailto`?e:``}function Sg(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Cg(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function wg(e,t,n){let r=ah((n||{}).ignore||[]),i=Tg(t),a=-1;for(;++a<i.length;)mh(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Tg(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Eg(e[0]),Dg(e[1])])}return t}function Eg(e){return typeof e==`string`?new RegExp(Cg(e),`g`):e}function Dg(e){return typeof e==`function`?e:function(){return e}}var Og=`phrasing`,kg=[`autolink`,`link`,`image`,`label`];function Ag(){return{transforms:[Rg],enter:{literalAutolink:Mg,literalAutolinkEmail:Ng,literalAutolinkHttp:Ng,literalAutolinkWww:Ng},exit:{literalAutolink:Lg,literalAutolinkEmail:Ig,literalAutolinkHttp:Pg,literalAutolinkWww:Fg}}}function jg(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Og,notInConstruct:kg},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Og,notInConstruct:kg},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Og,notInConstruct:kg}]}}function Mg(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Ng(e){this.config.enter.autolinkProtocol.call(this,e)}function Pg(e){this.config.exit.autolinkProtocol.call(this,e)}function Fg(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Ig(e){this.config.exit.autolinkEmail.call(this,e)}function Lg(e){this.exit(e)}function Rg(e){wg(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,zg],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Bg]],{ignore:[`link`,`linkReference`]})}function zg(e,t,n,r,i){let a=``;if(!Ug(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Vg(n)))return!1;let o=Hg(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Bg(e,t,n,r){return!Ug(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Vg(e){let 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 Hg(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Sg(e,`(`),a=Sg(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Ug(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Id(n)||Fd(n))&&(!t||n!==47)}$g.peek=Qg;function Wg(){this.buffer()}function Gg(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Kg(){this.buffer()}function qg(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Jg(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Td(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Yg(e){this.exit(e)}function Xg(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Td(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Zg(e){this.exit(e)}function Qg(){return`[`}function $g(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function e_(){return{enter:{gfmFootnoteCallString:Wg,gfmFootnoteCall:Gg,gfmFootnoteDefinitionLabelString:Kg,gfmFootnoteDefinition:qg},exit:{gfmFootnoteCallString:Jg,gfmFootnoteCall:Yg,gfmFootnoteDefinitionLabelString:Xg,gfmFootnoteDefinition:Zg}}}function t_(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$g},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
27
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?r_:n_))),s(),o}}function n_(e,t,n){return t===0?e:r_(e,t,n)}function r_(e,t,n){return(n?``:` `)+e}var i_=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];l_.peek=u_;function a_(){return{canContainEols:[`delete`],enter:{strikethrough:s_},exit:{strikethrough:c_}}}function o_(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:i_}],handlers:{delete:l_}}}function s_(e){this.enter({type:`delete`,children:[]},e)}function c_(e){this.exit(e)}function l_(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function u_(){return`~`}function d_(e){return e.length}function f_(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||d_,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=p_(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=m_(r[d]);else{let e=m_(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
28
|
+
`)}function p_(e){return e==null?``:String(e)}function m_(e){let 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 h_(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),g_);return i(),o}function g_(e,t,n){return`>`+(n?``:` `)+e}function __(e,t){return v_(e,t.inConstruct,!0)&&!v_(e,t.notInConstruct,!1)}function v_(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 y_(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
29
|
+
`&&__(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
30
|
+
`}function b_(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function x_(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 S_(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function C_(e,t,n,r){let i=S_(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(x_(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,w_);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(b_(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
31
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
32
|
+
`),a&&(u+=s.move(a+`
|
|
33
|
+
`)),u+=s.move(c),l(),u}function w_(e,t,n){return(n?``:` `)+e}function T_(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function E_(e,t,n,r){let i=T_(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
34
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function D_(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function O_(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function k_(e,t,n){let r=Kd(e),i=Kd(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}}A_.peek=j_;function A_(e,t,n,r){let i=D_(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=k_(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=O_(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=k_(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+O_(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function j_(e,t,n){return n.options.emphasis||`*`}function M_(e,t){let n=!1;return gh(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&fd(e)&&(t.options.setext||n))}function N_(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(M_(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
35
|
+
`,after:`
|
|
36
|
+
`});return r(),t(),o+`
|
|
37
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
38
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
39
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=O_(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}P_.peek=F_;function P_(e){return e.value||``}function F_(){return`<`}I_.peek=L_;function I_(e,t,n,r){let i=T_(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function L_(){return`!`}R_.peek=z_;function R_(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function z_(){return`!`}B_.peek=V_;function B_(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function V_(){return"`"}function H_(e,t){let n=fd(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))}U_.peek=W_;function U_(e,t,n,r){let i=T_(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(H_(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function W_(e,t,n){return H_(e,n)?`<`:`[`}G_.peek=K_;function G_(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function K_(){return`[`}function q_(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function J_(e){let t=q_(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Y_(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function X_(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Z_(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Y_(n):q_(n),s=e.ordered?o===`.`?`)`:`.`:J_(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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),X_(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Q_(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function $_(e,t,n,r){let i=Q_(n),a=n.bulletCurrent||q_(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function ev(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var tv=ah([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function nv(e,t,n,r){return(e.children.some(function(e){return tv(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function rv(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}iv.peek=av;function iv(e,t,n,r){let i=rv(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=k_(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=O_(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=k_(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+O_(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function av(e,t,n){return n.options.strong||`*`}function ov(e,t,n,r){return n.safe(e.value,r)}function sv(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function cv(e,t,n){let r=(X_(n)+(n.options.ruleSpaces?` `:``)).repeat(sv(n));return n.options.ruleSpaces?r.slice(0,-1):r}var lv={blockquote:h_,break:y_,code:C_,definition:E_,emphasis:A_,hardBreak:y_,heading:N_,html:P_,image:I_,imageReference:R_,inlineCode:B_,link:U_,linkReference:G_,list:Z_,listItem:$_,paragraph:ev,root:nv,strong:iv,text:ov,thematicBreak:cv};function uv(){return{enter:{table:dv,tableData:hv,tableHeader:hv,tableRow:pv},exit:{codeText:gv,table:fv,tableData:mv,tableHeader:mv,tableRow:mv}}}function dv(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function fv(e){this.exit(e),this.data.inTable=void 0}function pv(e){this.enter({type:`tableRow`,children:[]},e)}function mv(e){this.exit(e)}function hv(e){this.enter({type:`tableCell`,children:[]},e)}function gv(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,_v));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function _v(e,t){return t===`|`?t:e}function vv(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
40
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
41
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return f_(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=lv.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function yv(){return{exit:{taskListCheckValueChecked:xv,taskListCheckValueUnchecked:xv,paragraph:Sv}}}function bv(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Cv}}}function xv(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Sv(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Cv(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=lv.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function wv(){return[Ag(),e_(),a_(),uv(),yv()]}function Tv(e){return{extensions:[jg(),t_(e),o_(),vv(e),bv()]}}var Ev={tokenize:Bv,partial:!0},Dv={tokenize:Vv,partial:!0},Ov={tokenize:Hv,partial:!0},kv={tokenize:Uv,partial:!0},Av={tokenize:Wv,partial:!0},jv={name:`wwwAutolink`,tokenize:Rv,previous:Gv},Mv={name:`protocolAutolink`,tokenize:zv,previous:Kv},Nv={name:`emailAutolink`,tokenize:Lv,previous:qv},Pv={};function Fv(){return{text:Pv}}for(var Iv=48;Iv<123;)Pv[Iv]=Nv,Iv++,Iv===58?Iv=65:Iv===91&&(Iv=97);Pv[43]=Nv,Pv[45]=Nv,Pv[46]=Nv,Pv[95]=Nv,Pv[72]=[Nv,Mv],Pv[104]=[Nv,Mv],Pv[87]=[Nv,jv],Pv[119]=[Nv,jv];function Lv(e,t,n){let r=this,i,a;return o;function o(t){return!Jv(t)||!qv.call(r,r.previous)||Yv(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Jv(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Av,u,l)(t):t===45||t===95||Dd(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Ed(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Rv(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Gv.call(r,r.previous)||Yv(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Ev,e.attempt(Dv,e.attempt(Ov,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function zv(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Kv.call(r,r.previous)&&!Yv(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Ed(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||kd(t)||Nd(t)||Id(t)||Fd(t)?n(t):e.attempt(Dv,e.attempt(Ov,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Bv(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Vv(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(kv,c,s)(t):t===null||Nd(t)||Id(t)||t!==45&&Fd(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Hv(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(kv,t,a)(o):o===null||Nd(o)||Id(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Uv(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),a):o===93?(e.consume(o),i):o===60||o===null||Nd(o)||Id(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Nd(e)||Id(e)?t(e):r(e)}function a(e){return Ed(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Ed(t)?(e.consume(t),o):n(t)}}function Wv(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Dd(e)?n(e):t(e)}}function Gv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Nd(e)}function Kv(e){return!Ed(e)}function qv(e){return!(e===47||Jv(e))}function Jv(e){return e===43||e===45||e===46||e===95||Dd(e)}function Yv(e){let t=e.length,n=!1;for(;t--;){let 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}var Xv={tokenize:iy,partial:!0};function Zv(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:ty,continuation:{tokenize:ny},exit:ry}},text:{91:{name:`gfmFootnoteCall`,tokenize:ey},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Qv,resolveTo:$v}}}}function Qv(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Td(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function $v(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`;let 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++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function ey(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Nd(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Td(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Nd(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function ty(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Nd(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Td(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Nd(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),zd(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function ny(e,t,n){return e.check(ef,t,e.attempt(Xv,t,n))}function ry(e){e.exit(`gfmFootnoteDefinition`)}function iy(e,t,n){let r=this;return zd(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function ay(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&vd(o,o.length,0,qd(s,e.slice(r+1,n),t)),vd(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),vd(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Kd(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Kd(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var oy=class{constructor(){this.map=[]}add(e,t,n){sy(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function sy(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 cy(e,t){let n=!1,r=[];for(;t<e.length;){let 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`){let e=r.length-1;r[e]=r[e]===`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 ly(){return{flow:{null:{name:`table`,tokenize:uy,resolveAll:dy}}}}function uy(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Pd(t)?zd(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Nd(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Pd(t)?zd(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Pd(t)?zd(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Pd(t)?zd(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||$(n)?(e.exit(`tableRow`),t(n)):Pd(n)?zd(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Nd(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function dy(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new oy;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(py(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=fy(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=fy(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=fy(f,t,o,i,n,d)):(o[0]=o[1],d=fy(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&py(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=cy(t.events,n))}return e}function fy(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},my(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=my(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=my(t.events,n[2]),a=my(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},my(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function py(e,t,n,r,i){let a=[],o=my(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function my(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var hy={name:`tasklistCheck`,tokenize:_y};function gy(){return{text:{91:hy}}}function _y(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Nd(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return $(r)?t(r):Pd(r)?e.check({tokenize:vy},t,n)(r):n(r)}}function vy(e,t,n){return zd(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function yy(e){return xd([Fv(),Zv(),ay(e),ly(),gy()])}var by={};function xy(e){let t=this,n=e||by,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(yy(n)),a.push(wv()),o.push(Tv(n))}var Sy=/(?:(?<![A-Za-z0-9])[A-Za-z]:\\|\\\\[A-Za-z0-9_.$-]+\\)(?:\\\*|[^\s"`()\]<>|*]|\((?:\\\*|[^\s"`()\]<>|*])*\))*/g,Cy=/\\([!-/:-@[-`{-~])/g;function wy(e){return e.replace(Cy,`$1`)}function Ty(e,t){if(e.type===`text`&&typeof e.value==`string`){let n=e.position?.start.offset,r=e.position?.end.offset;if(n===void 0||r===void 0)return;let i=t.slice(n,r);if(!i.includes(`\\`))return;let a=e.value,o=0;for(let e of i.matchAll(Sy)){let t=e[0],n=wy(t);if(n===t){let e=a.indexOf(t,o);e!==-1&&(o=e+t.length);continue}let r=a.indexOf(n,o);r!==-1&&(a=a.slice(0,r)+t+a.slice(r+n.length),o=r+t.length)}e.value=a}else e.children?.forEach(e=>Ty(e,t))}function Ey(){return(e,t)=>{typeof t.value==`string`&&Ty(e,t.value)}}function Dy(e){if(!e.children)return;let t=[];for(let n of e.children)n.type===`text`&&n.value?.includes(`
|
|
42
|
+
`)?n.value.split(`
|
|
43
|
+
`).forEach((e,n)=>{n>0&&t.push({type:`break`}),e&&t.push({type:`text`,value:e})}):(Dy(n),t.push(n));e.children=t}function Oy(){return e=>{Dy(e)}}function ky(e){let t=e.toolArgs??{},n=[`command`,`file_path`,`path`,`url`,`query`,`name`].map(e=>t[e]).find(e=>typeof e==`string`&&e.trim());return typeof n==`string`?n:``}var Ay=new Set([`run_shell_command`,`run_cli_command`,`wait_for_condition`]);function jy(e){let t=e.split(`
|
|
44
|
+
`);if(t.length<2)return null;let n=!t[t.length-1].startsWith(`in `),r=n?t[t.length-1].trim():``,i=n?t.slice(0,-1):t,a=-1;for(let e=i.length-1;e>0;e--)if(i[e].startsWith(`in `)){a=e;break}return a<0?{command:i.join(`
|
|
45
|
+
`),folder:``,extras:``,note:r}:{command:i.slice(0,a).join(`
|
|
46
|
+
`),folder:i[a].slice(3).trim(),extras:i.slice(a+1).join(` `).trim(),note:r}}function My({code:e,previewLines:t=12,testId:n=`perm-code`}){let[r,i]=(0,V.useState)(!1),a=e.replace(/^\n+|\n+$/g,``).split(`
|
|
47
|
+
`),o=a.length>t,s=(o&&!r?a.slice(0,t):a).join(`
|
|
48
|
+
`);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`pre`,{className:`perm-card-pre perm-card-code${r?` is-expanded`:``}`,"data-testid":n,children:s}),o&&(0,U.jsx)(`button`,{type:`button`,className:`perm-card-args-toggle`,onClick:()=>i(e=>!e),"aria-expanded":r,children:r?`Show less`:`Show all ${a.length} lines`})]})}function Ny({sessionId:e}){let t=wc((0,V.useMemo)(()=>Dc(e),[e]));return t?(0,U.jsx)(Fy,{notification:t},t.id):null}function Py(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),n=e%60;return`${t}:${String(n).padStart(2,`0`)}`}function Fy({notification:e}){let t=wc(e=>e.respondToPermission),[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(null),[o,s]=(0,V.useState)(!1),c=e.timeoutSeconds!=null&&e.timeoutSeconds>0,l=(0,V.useRef)(c?Date.now()+e.timeoutSeconds*1e3:null),[u,d]=(0,V.useState)(c?e.timeoutSeconds:null),f=(0,V.useRef)(null),p=Sc(e.tool),m=p?void 0:e.alwaysScope,h=e.alwaysLabel??m,g=e.alwaysLabel??(0,U.jsx)(`code`,{children:m}),_=wc(t=>Cc(t.notifications,e)),v=!!m&&_>0,y=ky(e),b=e.toolArgs??{},x=Object.keys(b).length>0,S=typeof b._risk_note==`string`?b._risk_note:``,C=S&&typeof b.working_directory==`string`?b.working_directory:``,w=typeof b.code==`string`&&b.code.trim()?b.code:``,T=!x&&Ay.has(e.tool??``)?jy(e.summary??``):null;(0,V.useEffect)(()=>{f.current?.focus({preventScroll:!0})},[]),(0,V.useEffect)(()=>{if(l.current===null)return;let e=setInterval(()=>{let t=Math.max(0,Math.ceil((l.current-Date.now())/1e3));d(t),t===0&&clearInterval(e)},1e3);return()=>clearInterval(e)},[]);let E=(0,V.useCallback)(async n=>{r(!0),a(null);try{await t(e.id,n)}catch(e){a(e instanceof Error?e.message:String(e)),r(!1)}},[e.id,t]);(0,V.useEffect)(()=>{let e=e=>{e.key!==`Escape`||Di(e)||u!==null&&u<=0||(e.preventDefault(),n||E(`deny`))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[E,n,u]);let D=u!==null&&u<=0;return(0,U.jsxs)(`section`,{ref:f,tabIndex:-1,className:`perm-card`,role:`alertdialog`,"aria-labelledby":`perm-${e.id}`,children:[(0,U.jsxs)(`div`,{className:`perm-card-head`,children:[(0,U.jsx)(mn,{size:16,className:`perm-card-icon`,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{className:`perm-card-text`,children:[(0,U.jsx)(`h2`,{id:`perm-${e.id}`,className:`perm-card-title`,children:e.tool===`allow_path_access`?e.title:e.toolLabel?(0,U.jsxs)(U.Fragment,{children:[`Allow `,e.toolLabel,`?`]}):(0,U.jsxs)(U.Fragment,{children:[`Allow GAIA to use `,(0,U.jsx)(`code`,{children:e.tool}),`?`]})}),y&&S&&(0,U.jsx)(`pre`,{className:`perm-card-pre perm-card-exact`,children:y}),y&&!S&&(0,U.jsx)(`p`,{className:`perm-card-detail`,children:(0,U.jsx)(`code`,{children:y})}),C&&(0,U.jsxs)(`p`,{className:`perm-card-detail`,children:[`in `,(0,U.jsx)(`code`,{children:C})]}),S&&(0,U.jsx)(`p`,{className:`perm-card-risk`,role:`note`,children:S}),w&&(0,U.jsx)(My,{code:w}),T&&(0,U.jsx)(`pre`,{className:`perm-card-pre perm-card-exact`,children:T.command}),T?.folder&&(0,U.jsxs)(`p`,{className:`perm-card-detail`,children:[`in `,(0,U.jsx)(`code`,{children:T.folder})]}),T?.extras&&(0,U.jsx)(`p`,{className:`perm-card-detail`,children:T.extras}),T?.note&&(0,U.jsx)(`p`,{className:`perm-card-risk`,role:`note`,children:T.note}),!y&&!w&&e.summary&&!T&&(0,U.jsx)(`p`,{className:`perm-card-detail`,children:e.summary}),p&&e.message&&(0,U.jsx)(`p`,{className:`perm-card-detail`,children:e.message})]}),u!==null&&!D&&(0,U.jsx)(`span`,{className:`perm-card-timer`,title:`Denied automatically when the time runs out`,children:Py(u)})]}),x&&(0,U.jsxs)(`div`,{className:`perm-card-args`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`perm-card-args-toggle`,onClick:()=>s(e=>!e),"aria-expanded":o,children:[(0,U.jsx)(I,{size:13,className:o?`is-open`:``,"aria-hidden":`true`}),`Details`]}),o&&(0,U.jsx)(`pre`,{className:`perm-card-pre`,children:JSON.stringify(b,null,2)})]}),v&&!D&&(0,U.jsxs)(`p`,{className:`perm-card-hint`,children:[`You've allowed this `,_===1?`once`:`${_} times`,` already.`,` `,`Always allow stops asking about `,g,` in this chat.`]}),D?(0,U.jsx)(`p`,{className:`perm-card-detail`,children:`No answer in time, so GAIA was told no.`}):(0,U.jsxs)(`div`,{className:`perm-card-actions`,children:[(0,U.jsx)(`button`,{type:`button`,className:`perm-btn is-primary`,onClick:()=>E(`allow`),disabled:n,children:e.tool===`allow_path_access`?`Allow for this chat`:`Allow once`}),m&&(0,U.jsxs)(`button`,{type:`button`,className:`perm-btn${v?` is-suggested`:``}`,onClick:()=>E(`always`),disabled:n,"aria-label":`Always allow ${h} in this chat`,children:[`Always allow `,g,` in this chat`]}),(0,U.jsx)(`button`,{type:`button`,className:`perm-btn`,onClick:()=>E(`deny`),disabled:n,children:`Deny`})]}),i&&(0,U.jsx)(`p`,{className:`perm-card-error`,role:`alert`,children:i})]})}function Iy(e){return e?e.split(`
|
|
49
|
+
`).length:0}function Ly(e){return Iy(e)>15||e.length>1500}function Ry(e,t=15){let n=Iy(e);return n>t?`${n.toLocaleString(`en-US`)} lines`:`${e.length.toLocaleString(`en-US`)} characters`}function zy({expanded:e,onToggle:t,controls:n,collapsedLabel:r,expandedLabel:i,className:a}){return(0,U.jsxs)(`button`,{type:`button`,className:`expand-toggle${a?` ${a}`:``}`,onClick:t,"aria-expanded":e,"aria-controls":n,children:[e?(0,U.jsx)(ie,{size:13,"aria-hidden":`true`}):(0,U.jsx)(ne,{size:13,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:e?i:r})]})}function By(e){let t=e.replace(/\\(u[0-9a-fA-F]{0,3})?$/,``);try{return JSON.parse(`"${t}"`)}catch{return t}}function Vy(e,t){let n=RegExp(`"${t}"\\s*:\\s*(\\d+)`).exec(e);return n?Number(n[1]):null}function Hy(e,t){let n=RegExp(`"${t}"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)`).exec(e);return n?By(n[1]):``}function Uy(e){let t=e.trim();if(!t.startsWith(`{`))return null;let n;try{n=JSON.parse(t)}catch{return!/^\{\s*"truncated"\s*:\s*true\b/.test(t)||!/"head"\s*:\s*"/.test(t)?null:{head:Hy(t,`head`),tail:Hy(t,`tail`),originalChars:Vy(t,`original_chars`),omittedChars:Vy(t,`omitted_chars`),partial:!0}}if(!n||typeof n!=`object`)return null;let r=n;return r.truncated!==!0||typeof r.head!=`string`?null:{head:r.head,tail:typeof r.tail==`string`?r.tail:``,originalChars:typeof r.original_chars==`number`?r.original_chars:null,omittedChars:typeof r.omitted_chars==`number`?r.omitted_chars:null,partial:!1}}function Wy(e){let t=e=>e.toLocaleString(`en-US`);return`Showing ${e.partial?`part of the output`:e.tail?`the first ${t(e.head.length)} and last ${t(e.tail.length)} characters`:`the first ${t(e.head.length)} characters`}${e.originalChars==null?``:` of ${t(e.originalChars)}`}${e.omittedChars==null?``:` (${t(e.omittedChars)} omitted)`}.`}function Gy({text:e,renderShort:t}){let[n,r]=(0,V.useState)(!1),i=(0,V.useId)(),a=Uy(e),o=a?a.tail?`${a.head}\n…\n${a.tail}`:a.head:e,s=Iy(o)>25||o.length>2500;return(0,U.jsxs)(U.Fragment,{children:[a&&(0,U.jsx)(`div`,{className:`detail-result-note`,children:Wy(a)}),(0,U.jsx)(`div`,{id:i,className:`detail-result-content${s&&!n?` is-collapsed`:``}`,children:a||s?o:t(o)}),s&&(0,U.jsx)(zy,{expanded:n,onToggle:()=>r(e=>!e),controls:i,collapsedLabel:`Expand (${Ry(o,25)})`,expandedLabel:`Collapse`,className:`step-expand-toggle`})]})}var Ky={search_file:on,search_files:on,search_file_content:on,search_directory:on,read_file:We,write_file:He,get_file_info:We,browse_directory:Je,list_directory:Je,list_recent_files:Je,analyze_data_file:ee,run_shell_command:En,execute_code:ve,query_documents:E,query_specific_file:E,search_indexed_chunks:E,semantic_search:E,evaluate_retrieval:E,index_document:Ee,index_documents:Ee,index_directory:Ee,index_file:Ee,list_indexed_documents:Ee,summarize_document:We,dump_document:We,rag_status:Ee,add_watch_directory:Je,web_search:ct,search_web:ct,fetch_page:wt,fetch_webpage:wt,analyze_data:ee,find_files:on,edit_file:He,recall:O,remember:O,update_memory:O,forget:O,search_past_conversations:O,request_user_input:Nt,load_skill:bn,unload_skill:bn,list_skills:bn,search_skill_hub:bn,install_skill:bn,capture_skill:bn,remove_skill:bn,skill_status:bn};for(let e of Object.keys(Ky))if(!Gr(`tool.${e}.done`)||!Gr(`tool.${e}.active`))throw Error(`AgentActivity: tool "${e}" has an icon but no tool.${e}.done/.active labels in src/i18n/locales/en.ts.`);var qy=new Set([`load_skill`]),Jy=new Set([`remember`,`recall`,`update_memory`,`forget`]);function Yy(e){return e.type===`tool`&&e.success!==!1&&Jy.has(e.tool??``)}var Xy={label:Lr(`tool.default.done`),activeLabel:Lr(`tool.default.active`),icon:Rn},Zy=(e,t)=>({label:Lr(`tool.named.done`,{what:e}),activeLabel:Lr(`tool.named.active`,{what:e}),icon:t}),Qy=(e,t)=>e(t.ref,t.params);function $y(e,t){if(!e)return Xy;if(e.startsWith(`mcp_`)){let e=t?.mcpServerLabel;return e?Zy(t?.mcpTool?`${e}: ${t.mcpTool}`:e,ct):{label:Lr(`tool.mcp.done`),activeLabel:Lr(`tool.mcp.active`),icon:ct}}if(Object.prototype.hasOwnProperty.call(Ky,e))return{label:Lr(`tool.${e}.done`),activeLabel:Lr(`tool.${e}.active`),icon:Ky[e]};let n=e.replace(/[_-]+/g,` `).trim();return n?Zy(n,Rn):Xy}function eb(e,t){let n=$y(e.tool,e),r=e.success==null&&!e.result;return e.active?Qy(t,n.activeLabel):e.success===!1?t(`tool.failed`,{label:n.activeLabel}):r?t(`tool.unfinished`,{label:n.activeLabel}):Qy(t,n.label)}function tb(e,t=Cl){return e.mcpServerLabel?eb(e,t):e.narration?ab(e.narration):eb(e,t)}var nb=48,rb=5,ib=6;function ab(e){let t=/^([^:\n]{1,40}): (.+)$/.exec(e);if(!t)return e;let[,n,r]=t;if(/^https?:\/\//i.test(r)){let e=r.replace(/^https?:\/\/(www\.)?/i,``).replace(/\/$/,``),t=e.split(`/`).filter(Boolean);return`${n}: ${e.length>nb&&t.length>2?`${t[0]}/…/${t[t.length-1]}`:e}`}if(r.length>nb&&/[\\/]/.test(r)&&!/\s/.test(r)){let e=r.includes(`\\`)?`\\`:`/`,t=r.split(/[\\/]/).filter(Boolean);if(t.length>2)return`${n}: …${e}${t.slice(-2).join(e)}`}return e}var ob=/^(?:Executing step \d+ of the plan\.?|Following the plan to [\s\S]*)$/;function sb(e,t){return!!e&&!!t&&e.length===t.length&&e.every((e,n)=>e===t[n])}function cb(e,t){return e.tool===t.tool&&(e.detail??``)===(t.detail??``)&&e.mcpServer===t.mcpServer}function lb(e,t,n,r){if(t==null||t<0)return;let i=n[n.length-1],a;return a=i?.active?`running`:i?.success===!1?`failed`:i&&(i.success===!0||i.result)?`done`:r?`running`:i?`stopped`:`pending`,Array.from({length:e},(e,n)=>n<t?`done`:n===t?a:`pending`)}function ub(e,t){let n=[],r=new Map,i,a=!1;e.forEach((t,o)=>{if(Yy(t))return;let s=n[n.length-1];if(!a||t.type!==`thinking`&&t.type!==`status`||!ob.test((t.detail||t.label||``).trim())){if(t.type===`plan`){if(a=!0,i&&sb(i.planSteps,t.planSteps)){t.currentStep!=null&&(i.currentStep=t.currentStep),t.planNarrations&&(i.planNarrations=t.planNarrations),r.get(i.id).anchor=o;return}i&&(r.get(i.id).end=o),i={...t},n.push(i),r.set(t.id,{anchor:o,end:e.length})}else if(t.type===`tool`){let e=n.length-1;for(;e>=0&&(n[e].type===`thinking`||n[e].type===`status`);)e--;let r=e>=0?n[e]:void 0;if(r&&r.type===`tool`&&!r.active&&cb(r,t)&&(t.active||r.success===t.success)){n[e]={...t,id:r.id,count:(r.count??1)+1};return}n.push({...t})}else if(t.type===`thinking`&&s&&s.type===`thinking`){let e=(s.detail||``)+(t.detail||``);n[n.length-1]={...t,timestamp:s.timestamp,detail:e||s.detail}}else t.type===`status`&&s&&s.type===`status`&&t.active!==!1?n[n.length-1]={...t,label:t.label||s.label}:t.type===`thinking`&&s&&s.type===`status`&&s.active!==!1?n[n.length-1]={...s,type:`thinking`,detail:t.detail||s.detail,active:t.active}:t.type===`status`&&t.success!==!1&&s&&s.type===`thinking`?n[n.length-1]={...s,label:t.label||s.label,active:t.active??s.active}:n.push({...t})}});for(let a of n){let n=r.get(a.id);if(a.type!==`plan`||!a.planSteps||!n)continue;let o=e.slice(n.anchor+1,n.end).filter(e=>e.type===`tool`),s=t&&a===i;a.planStatuses=lb(a.planSteps.length,a.currentStep,o,s)}return n}function db(e){let t=Math.max(0,Math.floor(e));return t<60?`${t}s`:`${Math.floor(t/60)}m ${String(t%60).padStart(2,`0`)}s`}function fb(e){let[t,n]=(0,V.useState)(()=>Date.now());return(0,V.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function pb(e,t=``){let n=[];for(let r of e){if(r.type===`commentary`){let e=r.detail?.trim();e&&!t.trimStart().startsWith(e)&&n.push({kind:`note`,row:r});continue}let e=n[n.length-1];e?.kind===`steps`?e.rows.push(r):n.push({kind:`steps`,id:r.id,rows:[r]})}return n}function mb(e){if(!qy.has(e.tool??``))return;let t=/:\s*(.+)$/.exec(e.narration??``)?.[1]?.trim();return t?Lr(`activity.usedSkill`,{name:t}):void 0}var hb=3;function gb(e,t=Cl){let n=[];for(let t of e){let e;if(t.type===`tool`)e=mb(t)??$y(t.tool,t).label;else if(t.type===`policy_alert`)e=Lr(`activity.blocked`);else if(t.type===`error`)e=Lr(`activity.hitError`);else if(t.type===`plan`)e=Lr(`activity.madePlan`);else continue;let r=`${e.ref}:${JSON.stringify(e.params??{})}`,i=n.find(e=>e.id===r);i?i.count+=t.count??1:n.push({label:e,id:r,count:t.count??1})}return t.compose(e=>{if(n.length===0)return e(`activity.thoughtThrough`);let t=n.slice(0,hb).map((t,n)=>{let r=e(t.label.ref,t.label.params),i=n===0?r:r.charAt(0).toLowerCase()+r.slice(1);return t.count>1?`${i} ×${t.count}`:i}),r=t.join(e(`activity.summarySep`)),i=n.length-t.length;return i>0?e(`activity.summaryMore`,{list:r,n:i}):r})}function _b(e){return e.type===`error`||e.type===`policy_alert`}function vb(e){return e.type===`status`&&e.success===!1}function yb(e){return e.type!==`status`&&!(e.type===`thinking`&&!(e.detail||``).trim())}function bb(e){let t=new Map,n=[],r=e=>{let r=n[n.length-1],i=e==null?r?.latencyMs:e-n[0].timestamp;if(i!=null&&i>=0)for(let e of n)t.set(e.id,i);n=[]};for(let t of e)t.type===`thinking`||n.length>0&&t.type===`status`?t.type===`thinking`&&n.push(t):n.length>0&&r(t.timestamp);return n.length>0&&r(),t}function xb({steps:e,isActive:t,running:n=t,awaitingUser:r=!1,liveLine:i,answer:a}){let o=q(),[s,c]=(0,V.useState)(new Map),[l,u]=(0,V.useState)(new Set),[d,f]=(0,V.useState)(``),[p,m]=(0,V.useState)(`all`),h=(0,V.useMemo)(()=>ub(e,n),[e,n]),g=(0,V.useMemo)(()=>pb(h,a),[h,a]),_=(0,V.useMemo)(()=>bb(e),[e]),v=fb(n),y=n?[...h].reverse().find(e=>e.type===`plan`&&e.planSteps?.length):void 0,b=n&&h.some(e=>e.active&&e.type!==`status`),x=!!d||p!==`all`,S=(0,V.useCallback)(e=>{u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),C=e=>{if(e.type!==`tool`||!x)return!0;let t=d.toLowerCase();return!(t&&!e.tool?.toLowerCase().includes(t)&&!tb(e,o).toLowerCase().includes(t)||p===`success`&&e.success!==!0||p===`error`&&e.success!==!1)},w=e=>e.type===`thinking`?(0,U.jsx)(Eb,{step:e,live:n&&!!e.active,durationMs:_.get(e.id)},e.id):e.type===`tool`?(0,U.jsx)(kb,{step:e,isExpanded:l.has(e.id),now:v,awaitingUser:n&&r,onToggle:()=>S(e.id)},e.id):e.type===`plan`?e===y?null:(0,U.jsx)(Mb,{step:e},e.id):e.type===`status`?(0,U.jsx)(Cb,{step:e},e.id):e.type===`error`?(0,U.jsx)(Nb,{step:e},e.id):e.type===`policy_alert`?(0,U.jsx)(Pb,{step:e},e.id):null;if(h.length===0)return i?(0,U.jsx)(`div`,{className:`agent-activity active`,children:(0,U.jsx)(`div`,{className:`flow-live-line`,children:i})}):null;let T=g.length-1,E=(e,t)=>e.filter(e=>(yb(e)||t&&vb(e))&&!Sb(e,y)),D=g.reduce((e,t,r)=>{if(t.kind!==`steps`)return e;let i=n&&r===T,a=E(t.rows,i);return a.length<2&&!i?e:s.get(t.id)??(i||a.some(_b))?e+a.filter(e=>e.type===`tool`).length:e},0);return(0,U.jsxs)(`div`,{className:`agent-activity ${n?`active`:`done`}`,children:[(0,U.jsx)(`div`,{className:`agent-timeline`,children:g.map((e,t)=>{if(e.kind===`note`)return(0,U.jsx)(wb,{text:e.row.detail??``},e.row.id);let r=n&&t===T,i=E(e.rows,r);if(i.length===0)return null;let a=i.some(_b);if(i.length===1&&!r)return C(i[0])?(0,U.jsx)(`div`,{className:`flow-steps single`,children:w(i[0])},e.id):null;let l=s.get(e.id)??(r||a),u=i.filter(C);return(0,U.jsxs)(`div`,{className:`flow-steps ${l?`open`:`folded`} ${r?`live`:``}`,children:[!r&&(0,U.jsxs)(`button`,{className:`flow-steps-summary`,onClick:()=>c(t=>new Map(t).set(e.id,!l)),"aria-expanded":l,children:[a?(0,U.jsx)(oe,{size:13,className:`agent-icon-error`}):(0,U.jsx)(ue,{size:13,className:`flow-steps-done`}),(0,U.jsx)(`span`,{className:`flow-steps-text`,children:gb(i,o)}),(0,U.jsx)(I,{size:12,className:`flow-tool-chevron ${l?`expanded`:``}`})]}),l&&(0,U.jsx)(`div`,{className:`flow-steps-rows`,children:u.map(w)})]},e.id)})}),y&&(0,U.jsx)(Mb,{step:y}),n&&!b&&i&&(0,U.jsx)(`div`,{className:`flow-live-line`,children:i}),!n&&D>=ib&&(0,U.jsxs)(`div`,{className:`activity-filter-bar`,children:[(0,U.jsx)(`input`,{type:`text`,className:`activity-filter-input`,placeholder:o(`activity.filterPlaceholder`),"aria-label":o(`activity.filterByTool`),value:d,onChange:e=>f(e.target.value)}),(0,U.jsxs)(`select`,{className:`activity-filter-select`,"aria-label":o(`activity.filterByStatus`),value:p,onChange:e=>m(e.target.value),children:[(0,U.jsx)(`option`,{value:`all`,children:o(`activity.filter.all`)}),(0,U.jsx)(`option`,{value:`success`,children:o(`activity.filter.success`)}),(0,U.jsx)(`option`,{value:`error`,children:o(`activity.filter.error`)})]})]})]})}function Sb(e,t){return e.type===`plan`&&e===t}function Cb({step:e}){return(0,U.jsxs)(`div`,{className:`flow-warning`,role:`status`,children:[(0,U.jsx)(oe,{size:13}),(0,U.jsx)(`span`,{children:e.label})]})}function wb({text:e}){return(0,U.jsx)(`div`,{className:`flow-note md-content`,children:(0,U.jsx)(mg,{remarkPlugins:[xy],disallowedElements:[...yg],urlTransform:xg,children:e})})}function Tb(e,t,n=Cl){return e?n(`activity.thinking`):t==null||t<1e3?n(`activity.thought`):n(`activity.thoughtFor`,{time:db(t/1e3)})}function Eb({step:e,live:t,durationMs:n}){let r=q(),i=(e.detail||``).trim(),[a,o]=(0,V.useState)(!1),s=(0,V.useRef)(null);return(0,V.useEffect)(()=>{t&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[i,t]),i?(0,U.jsxs)(`div`,{className:`flow-reasoning ${t?`live`:``}`,children:[(0,U.jsxs)(`button`,{className:`flow-reasoning-toggle`,onClick:()=>o(e=>!e),"aria-expanded":a,children:[t?(0,U.jsx)(B,{size:13,className:`flow-tool-spinner`}):(0,U.jsx)(O,{size:13,className:`flow-tool-icon`}),(0,U.jsx)(`span`,{children:Tb(t,n,r)}),(0,U.jsx)(I,{size:12,className:`flow-tool-chevron ${a?`expanded`:``}`})]}),(a||t)&&(0,U.jsxs)(`div`,{ref:s,className:`flow-thought-hacker ${a?``:`peek`}`,children:[(0,U.jsx)(`span`,{children:i}),t&&(0,U.jsx)(`span`,{className:`flow-thought-cursor`})]})]}):null}function Db(e,t=Cl){let n=/(['"`])([A-Z]:[\\/][^'"`\n]*?)\1|(?<![\w/\\])[A-Z]:[\\/](?:[^\s*?"'`<>|,;)}\]]+[\\/])*[^\s*?"'`<>|,;)}\]]*/gi,r=[],i=0,a;for(;(a=n.exec(e))!==null;){let n=a[1]??``;(a.index>i||n)&&r.push(e.slice(i,a.index)+n);let o=n?a[2]:a[0],c=o.replace(/[)}\]]+$/,``),l=()=>{es(c).catch(e=>s.ui.error(`Failed to open path`,e))};r.push((0,U.jsxs)(`span`,{className:`tool-result-path`,onClick:l,title:t(`activity.openPath`,{path:c}),role:`button`,tabIndex:0,onKeyDown:e=>{e.key===`Enter`&&l()},children:[(0,U.jsx)(Je,{size:10,style:{flexShrink:0,opacity:.7}}),c]},a.index)),(c.length<o.length||n)&&r.push(o.slice(c.length)+n),i=a.index+a[0].length}return r.length===0?e:(i<e.length&&r.push(e.slice(i)),(0,U.jsx)(U.Fragment,{children:r}))}function Ob({fileList:e}){let t=q(),[n,r]=(0,V.useState)(!1),i=n?e.files:e.files.slice(0,5),a=e.total-5,o=(e,n)=>{let r=e.name||e.filename||e.file_name;return r?String(r):e.file_path&&String(e.file_path).replace(/\\/g,`/`).split(`/`).pop()||t(`activity.files.file`,{n:n+1})},s=e=>e.directory?String(e.directory):``;return(0,U.jsxs)(`div`,{className:`file-list-view`,children:[i.map((e,t)=>(0,U.jsxs)(`div`,{className:`file-list-item`,children:[(0,U.jsx)(Ke,{size:11,className:`file-list-icon`}),(0,U.jsx)(`span`,{className:`file-list-name`,children:o(e,t)}),s(e)&&(0,U.jsx)(`span`,{className:`file-list-dir`,children:s(e)})]},t)),a>0&&!n&&(0,U.jsx)(`button`,{className:`file-list-more`,onClick:()=>r(!0),children:t(`activity.files.more`,{n:a})}),n&&e.files.length<e.total&&(0,U.jsx)(`span`,{className:`file-list-truncated`,children:t(`activity.files.showing`,{shown:e.files.length,total:e.total})})]})}function kb({step:e,isExpanded:t,onToggle:n,now:r,awaitingUser:i=!1}){let a=q(),o=$y(e.tool,e).icon,s=!!e.active&&i,c=s?a(`activity.waiting`):tb(e,a),l=e.count??1,u=e.success===!1&&e.result?e.result:``,d=s?``:e.active?db((r-e.timestamp)/1e3):e.latencyMs==null?``:Lb(e.latencyMs);return(0,U.jsxs)(`div`,{className:`flow-tool ${e.active?`active`:``} ${e.success===!1?`error`:``} ${qy.has(e.tool??``)?`skill`:``}`,children:[(0,U.jsxs)(`button`,{className:`flow-tool-header`,onClick:n,"aria-expanded":t,title:s?tb(e,a):e.narration&&e.narration!==c?e.narration:void 0,children:[(0,U.jsxs)(`div`,{className:`flow-tool-left`,children:[e.active&&!s?(0,U.jsx)(B,{size:13,className:`flow-tool-spinner`}):e.success===!1?(0,U.jsx)(oe,{size:13,style:{color:`var(--danger)`}}):(0,U.jsx)(o,{size:13,className:`flow-tool-icon`}),(0,U.jsx)(`span`,{className:`flow-tool-label`,children:c}),l>1&&(0,U.jsxs)(`span`,{className:`flow-tool-count`,"aria-label":a(`activity.identicalCalls`,{n:l}),children:[`×`,l]}),u&&(0,U.jsx)(`span`,{className:`flow-tool-failure`,children:u})]}),(0,U.jsxs)(`div`,{className:`flow-tool-right`,children:[d&&(0,U.jsx)(`span`,{className:`flow-tool-latency`,children:d}),(0,U.jsx)(`span`,{className:`flow-tool-chevron ${t?`expanded`:``}`,children:(0,U.jsx)(I,{size:12})})]})]}),t&&(0,U.jsxs)(`div`,{className:`flow-tool-detail`,children:[(0,U.jsxs)(`div`,{className:`flow-tool-raw`,children:[(0,U.jsx)(`span`,{className:`detail-section-label`,children:a(`activity.detail.tool`)}),(0,U.jsx)(`code`,{className:`flow-tool-badge`,children:e.tool||`unknown`}),e.mcpServer&&(0,U.jsx)(`span`,{className:`flow-tool-mcp-server`,children:a(`activity.detail.via`,{server:e.mcpServer})})]}),e.detail&&!e.commandOutput&&(0,U.jsxs)(`div`,{className:`step-detail-args`,children:[(0,U.jsx)(`span`,{className:`detail-section-label`,children:a(`activity.detail.arguments`)}),(0,U.jsx)(`div`,{className:`detail-args-content`,children:Bb(e.detail)})]}),e.commandOutput&&(0,U.jsx)(Ib,{output:e.commandOutput}),e.mcpOutput&&(0,U.jsxs)(`div`,{className:`step-detail-result result-success`,children:[(0,U.jsx)(`span`,{className:`detail-section-label`,children:a(`activity.detail.output`)}),(0,U.jsx)(My,{code:e.mcpOutput.text,previewLines:rb,testId:`mcp-output`}),e.mcpOutput.truncated&&(0,U.jsx)(`div`,{className:`cmd-truncated`,children:a(`activity.truncated`)})]}),e.result&&!e.commandOutput&&!e.mcpOutput&&(0,U.jsxs)(`div`,{className:`step-detail-result ${e.success===!1?`result-error`:`result-success`}`,children:[(0,U.jsx)(`span`,{className:`detail-section-label`,children:e.success===!1?a(`activity.detail.error`):a(`activity.detail.result`)}),(0,U.jsx)(Gy,{text:e.result,renderShort:e=>Db(e,a)})]}),e.retrievalChunks&&e.retrievalChunks.length>0&&(0,U.jsx)(Fb,{chunks:e.retrievalChunks}),e.fileList&&e.fileList.files.length>0&&(0,U.jsx)(Ob,{fileList:e.fileList})]})]})}var Ab={done:`activity.planStatus.done`,running:`activity.planStatus.running`,failed:`activity.planStatus.failed`,stopped:`activity.planStatus.stopped`,pending:`activity.planStatus.pending`};function jb({status:e}){return e===`done`?(0,U.jsx)(ue,{size:13,className:`plan-icon-done`}):e===`running`?(0,U.jsx)(B,{size:13,className:`flow-tool-spinner`}):e===`failed`?(0,U.jsx)(oe,{size:13,className:`plan-icon-failed`}):e===`stopped`?(0,U.jsx)(oe,{size:13,className:`plan-icon-stopped`}):(0,U.jsx)(z,{size:13,className:`plan-icon-pending`})}function Mb({step:e}){let t=q(),n=e.planSteps??[];if(n.length===0)return null;let r=e.planStatuses,i=r?.filter(e=>e===`done`).length??0;return(0,U.jsxs)(`div`,{className:`flow-plan`,children:[(0,U.jsxs)(`div`,{className:`flow-plan-header`,children:[(0,U.jsx)(Et,{size:13}),(0,U.jsx)(`span`,{children:t(`activity.plan`)}),r&&(0,U.jsx)(`span`,{className:`flow-plan-count`,children:t(`activity.planDone`,{done:i,total:n.length})})]}),(0,U.jsx)(`ol`,{className:`flow-plan-list`,children:n.map((n,i)=>{let a=r?.[i],o=ab(e.planNarrations?.[i]||n);return(0,U.jsxs)(`li`,{className:`flow-plan-item ${a??``}`,title:n,"aria-label":a?t(`activity.planItem`,{status:Lr(Ab[a]),text:o}):void 0,children:[(0,U.jsx)(jb,{status:a}),(0,U.jsx)(`span`,{className:`flow-plan-text`,children:o})]},i)})})]})}function Nb({step:e}){let t=q();return(0,U.jsxs)(`div`,{className:`flow-error`,children:[(0,U.jsx)(oe,{size:13}),(0,U.jsx)(`span`,{children:e.detail||e.label||t(`activity.errorOccurred`)})]})}function Pb({step:e}){let t=q();return(0,U.jsxs)(`div`,{className:`flow-policy-alert`,children:[(0,U.jsxs)(`div`,{className:`flow-policy-alert-header`,children:[(0,U.jsx)(un,{size:14}),(0,U.jsx)(`span`,{className:`flow-policy-alert-title`,children:t(`activity.policy.title`)}),(0,U.jsx)(`span`,{className:`flow-policy-alert-decision`,children:e.decision||`BLOCK`})]}),(0,U.jsxs)(`div`,{className:`flow-policy-alert-body`,children:[(0,U.jsxs)(`div`,{className:`flow-policy-alert-line`,children:[(0,U.jsx)(`span`,{children:t(`activity.policy.tool`)}),(0,U.jsx)(`code`,{children:e.tool||`unknown tool`})]}),(0,U.jsx)(`div`,{className:`flow-policy-alert-reason`,children:e.reason||e.detail}),e.ruleIds&&e.ruleIds.length>0&&(0,U.jsxs)(`div`,{className:`flow-policy-alert-line`,children:[(0,U.jsx)(`span`,{children:t(`activity.policy.rules`)}),(0,U.jsx)(`code`,{children:e.ruleIds.join(`, `)})]}),e.policyVersion&&(0,U.jsxs)(`div`,{className:`flow-policy-alert-line`,children:[(0,U.jsx)(`span`,{children:t(`activity.policy.policy`)}),(0,U.jsx)(`code`,{children:e.policyVersion})]}),(0,U.jsxs)(`div`,{className:`flow-policy-alert-line`,children:[(0,U.jsx)(`span`,{children:t(`activity.policy.receipt`)}),e.receiptId?(0,U.jsx)(`code`,{children:e.receiptId}):(0,U.jsx)(`em`,{children:t(`activity.policy.receiptUnavailable`)})]})]})]})}function Fb({chunks:e}){let t=q(),[n,r]=(0,V.useState)(new Set),i=e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,U.jsxs)(`div`,{className:`chunks-view`,children:[(0,U.jsx)(`span`,{className:`detail-section-label`,children:t(`activity.chunks`,{n:e.length})}),(0,U.jsx)(`div`,{className:`chunks-list`,children:e.map(e=>{let r=n.has(e.id);return(0,U.jsxs)(`div`,{className:`chunk-card ${r?`expanded`:``}`,children:[(0,U.jsxs)(`button`,{className:`chunk-header`,onClick:()=>i(e.id),children:[(0,U.jsxs)(`div`,{className:`chunk-header-left`,children:[(0,U.jsx)(E,{size:11,style:{color:`var(--accent-cyan)`,flexShrink:0}}),e.source&&(0,U.jsx)(`span`,{className:`chunk-source`,children:e.source}),e.page!=null&&(0,U.jsx)(`span`,{className:`chunk-page`,children:t(`activity.chunkPage`,{page:e.page})}),e.score!=null&&e.score>0&&(0,U.jsx)(`span`,{className:`chunk-score`,children:e.score.toFixed(2)})]}),(0,U.jsx)(`span`,{className:`chunk-chevron ${r?`expanded`:``}`,children:(0,U.jsx)(I,{size:11})})]}),(0,U.jsx)(`div`,{className:`chunk-body ${r?`show`:``}`,children:r?(0,U.jsx)(`pre`,{className:`chunk-content`,children:e.content}):(0,U.jsx)(`div`,{className:`chunk-preview`,children:e.preview})})]},e.id)})})]})}function Ib({output:e}){let t=q(),[n,r]=(0,V.useState)(!1),i=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{i.current&&clearTimeout(i.current)},[]);let a=(0,V.useCallback)(()=>{let t=e.stdout||e.stderr||``;navigator.clipboard.writeText(t).catch(()=>{}),r(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>r(!1),2e3)},[e]),o=!!(e.stdout||e.stderr),s=e.returnCode!==0&&!e.expectedExit;return(0,U.jsxs)(`div`,{className:`cmd-output ${s?`cmd-error`:``}`,children:[(0,U.jsxs)(`div`,{className:`cmd-header`,children:[(0,U.jsxs)(`div`,{className:`cmd-header-left`,children:[(0,U.jsx)(En,{size:12,className:`cmd-header-icon`}),(0,U.jsx)(`span`,{className:`cmd-header-title`,children:t(`activity.terminal`)}),e.cwd&&(0,U.jsx)(`span`,{className:`cmd-cwd`,children:e.cwd})]}),(0,U.jsxs)(`div`,{className:`cmd-header-right`,children:[e.durationSeconds!=null&&(0,U.jsxs)(`span`,{className:`cmd-duration`,children:[e.durationSeconds.toFixed(1),`s`]}),e.returnCode!==0&&(0,U.jsx)(`span`,{className:`cmd-exit-code${s?``:` cmd-exit-expected`}`,title:e.expectedExit??void 0,children:t(`activity.exit`,{code:e.returnCode})}),o&&(0,U.jsx)(`button`,{className:`cmd-copy ${n?`copied`:``}`,onClick:a,title:t(n?`msg.copied`:`activity.copyOutput`),"aria-label":t(n?`msg.copiedAria`:`activity.copyOutputAria`),children:n?(0,U.jsx)(F,{size:11}):(0,U.jsx)(be,{size:11})})]})]}),(0,U.jsxs)(`div`,{className:`cmd-line`,children:[(0,U.jsx)(`span`,{className:`cmd-prompt`,children:`$`}),(0,U.jsx)(`span`,{className:`cmd-text`,children:e.command})]}),e.stdout&&(0,U.jsx)(`pre`,{className:`cmd-stdout`,children:e.stdout}),e.stderr&&(0,U.jsx)(`pre`,{className:`cmd-stderr`,children:e.stderr}),e.truncated&&(0,U.jsx)(`div`,{className:`cmd-truncated`,children:t(`activity.truncated`)}),!o&&(0,U.jsx)(`div`,{className:`cmd-empty`,children:t(`activity.noOutput`)})]})}function Lb(e){return e<1?`<1ms`:e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function Rb(e){let t=/^\[(.*)\]$/s.exec(e);return t?t[1].split(/,\s*/).map(e=>e.trim().replace(/^(['"])(.*)\1$/s,`$2`)).filter(Boolean).join(`, `):e}var zb=/^([A-Za-z_][\w.-]{0,29}):(?:\s+([\s\S]*))?$/;function Bb(e){let t=e.includes(`
|
|
50
|
+
`)?e.split(`
|
|
51
|
+
`).filter(Boolean):e.split(/, (?=[A-Za-z_][\w.-]{0,29}:(?:\s|$))/).filter(Boolean);return t.length<=1?(0,U.jsx)(`span`,{className:`arg-value`,children:e}):(0,U.jsx)(`div`,{className:`args-grid`,children:t.map((e,t)=>{let n=zb.exec(e.trim());if(n){let e=n[1],r=Rb((n[2]??``).trim());return(0,U.jsxs)(`div`,{className:`arg-row`,children:[(0,U.jsx)(`span`,{className:`arg-key`,children:e}),(0,U.jsx)(`span`,{className:`arg-value`,children:r})]},t)}return(0,U.jsx)(`div`,{className:`arg-row`,children:(0,U.jsx)(`span`,{className:`arg-value`,children:e})},t)})})}var Vb=`email`;function Hb(e,t){return e.filter(e=>e.id===Vb&&!!e.namespaced_agent_id&&(e.required_connections?.some(e=>e.connector_id===t)??!1)).map(e=>e.namespaced_agent_id)}function Ub(e){if(!e)return!1;if(e.includes(`NOT_CONNECTED:`)||e.includes(`AGENT_NOT_GRANTED:`)||e.includes(`AUTH_REQUIRED:`))return!0;let t=e.toLowerCase();return!!(t.includes(`connectors → google`)||t.includes(`connections → google`)||t.includes(`email agent needs additional google permissions`)||t.includes(`connectors → microsoft`)||t.includes(`connections → microsoft`)||t.includes(`microsoft is not currently connected`)||t.includes(`microsoft_work is not currently connected`))}function Wb(e){if(!e)return`all`;let t=e.toLowerCase(),n=t.includes(`google`)||t.includes(`gmail`),r=t.includes(`microsoft_work`)||t.includes(`microsoft 365`)||t.includes(`office365`)||t.includes(`o365`);return[n,!r&&(t.includes(`microsoft`)||t.includes(`outlook`)),r].filter(Boolean).length===1?n?`google`:r?`microsoft_work`:`microsoft`:`all`}function Gb(e){let t=window;t.gaia?.openExternal?t.gaia.openExternal(e):window.open(e,`_blank`,`noopener`)}function Kb({connectorId:e,label:t,grantAgents:n,done:r,onDone:i}){let[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(null),l=(0,V.useCallback)(async()=>{o(!0),c(null);try{let t=await zi(e);Gb((await Bi(e,t.available_scopes&&t.available_scopes.length>0?t.available_scopes:t.default_scopes,n)).authorization_url),i()}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}},[e,n,i]);return(0,U.jsxs)(`div`,{className:`email-connect-cta__provider-slot`,children:[(0,U.jsxs)(`button`,{className:`email-connect-cta__button`,onClick:()=>void l(),disabled:a,"aria-label":r?`Reopen ${t} sign-in`:`Connect ${t}`,children:[a?(0,U.jsx)(B,{size:12,className:`email-connect-cta__spinner`}):(0,U.jsx)(Me,{size:12}),(0,U.jsx)(`span`,{children:r?`Reopen ${t} sign-in`:`Connect ${t}`})]}),s&&(0,U.jsx)(`div`,{className:`email-connect-cta__error`,role:`alert`,children:s})]})}function qb({content:e=``,connectorId:t}){let[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(!1),[o,s]=(0,V.useState)(!1),{agents:c}=H(),l=(0,V.useCallback)(e=>Hb(c,e),[c]),u=t===`google`||t===`microsoft`||t===`microsoft_work`?t:Wb(e),d=u===`google`||u===`all`,f=u===`microsoft`||u===`all`,p=u===`microsoft_work`||u===`all`;return(0,U.jsxs)(`div`,{className:`email-connect-cta`,role:`region`,"aria-label":`Connect email account`,children:[(0,U.jsxs)(`div`,{className:`email-connect-cta__text`,children:[(0,U.jsx)(oe,{size:14,className:`email-connect-cta__icon`}),(0,U.jsx)(`span`,{children:n||i||o?`A browser tab opened for sign-in. Return here when finished.`:`Connect your email account to use Email Triage.`})]}),(0,U.jsxs)(`div`,{className:`email-connect-cta__buttons`,children:[d&&(0,U.jsx)(Kb,{connectorId:`google`,label:`Google`,grantAgents:l(`google`),done:n,onDone:()=>r(!0)}),f&&(0,U.jsx)(Kb,{connectorId:`microsoft`,label:`Microsoft`,grantAgents:l(`microsoft`),done:i,onDone:()=>a(!0)}),p&&(0,U.jsx)(Kb,{connectorId:`microsoft_work`,label:`Microsoft 365`,grantAgents:l(`microsoft_work`),done:o,onDone:()=>s(!0)})]})]})}function Jb(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.kind===`email_pre_scan`&&Array.isArray(t.urgent)&&Array.isArray(t.actionable)&&Array.isArray(t.suggested_archives)&&Array.isArray(t.suggested_drafts)&&typeof t.informational_count==`number`}function Yb(e){e&&window.dispatchEvent(new CustomEvent(`gaia:send-message`,{detail:{text:e}}))}function Xb(e){let t=e.thread_id||e.message_id;if(!t)return;let n=`https://mail.google.com/mail/u/0/#inbox/${encodeURIComponent(t)}`;window.open(n,`_blank`,`noopener,noreferrer`)}function Zb(e){if(!e)return`(unknown)`;let t=e.trim(),n=t.indexOf(`<`);return n>0?t.slice(0,n).trim().replace(/^"|"$/g,``):t}function Qb({payload:e}){let[t,n]=(0,V.useState)(()=>new Set),r=(0,V.useCallback)(e=>{n(t=>{let n=new Set(t);return n.add(e),n})},[]),[i,a]=(0,V.useState)(null),o=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let s=(0,V.useCallback)((e,t)=>{i||(a(e),o.current=setTimeout(()=>{a(t=>t===e?null:t)},5e3),Yb(t))},[i]),c=(0,V.useCallback)(e=>{s(e.message_id,`Archive message id ${e.message_id}.`)},[s]),l=(0,V.useCallback)(e=>{s(e.message_id,`Draft a reply to message id ${e.message_id}.`)},[s]),u=(0,V.useMemo)(()=>[{key:`urgent`,title:`Urgent`,icon:(0,U.jsx)(oe,{size:14}),items:e.urgent.filter(e=>!t.has(e.message_id)),intent:`urgent`},{key:`actionable`,title:`Needs a response`,icon:(0,U.jsx)(kt,{size:14}),items:e.actionable.filter(e=>!t.has(e.message_id)),intent:`actionable`},{key:`archives`,title:`Suggested archives`,icon:(0,U.jsx)(g,{size:14}),items:e.suggested_archives.filter(e=>!t.has(e.message_id)),intent:`archive`}],[e,t]),d=u.reduce((e,t)=>e+t.items.length,0),f=e.informational_count;return(0,U.jsxs)(`div`,{className:`email-pre-scan`,role:`region`,"aria-label":`Inbox pre-scan`,children:[(0,U.jsxs)(`div`,{className:`email-pre-scan__header`,children:[(0,U.jsx)(ft,{size:16,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`email-pre-scan__title`,children:`Inbox pre-scan`}),(0,U.jsxs)(`span`,{className:`email-pre-scan__totals`,children:[d,` surfaced`,f>0?` · ${f} informational`:``]})]}),u.map(e=>e.items.length>0?(0,U.jsx)($b,{def:e,pendingRow:i,onApproveArchive:c,onReply:l,onDismiss:r,onOpen:Xb},e.key):null),d===0&&(0,U.jsxs)(`div`,{className:`email-pre-scan__empty`,children:[(0,U.jsx)(ue,{size:14}),(0,U.jsx)(`span`,{children:`Nothing to surface — your inbox looks quiet.`})]}),(0,U.jsx)(tx,{applied:e.preferences_applied})]})}function $b({def:e,pendingRow:t,onApproveArchive:n,onReply:r,onDismiss:i,onOpen:a}){return(0,U.jsxs)(`section`,{className:`email-pre-scan__section email-pre-scan__section--${e.intent}`,children:[(0,U.jsxs)(`header`,{className:`email-pre-scan__section-header`,children:[e.icon,(0,U.jsx)(`span`,{className:`email-pre-scan__section-title`,children:e.title}),(0,U.jsx)(`span`,{className:`email-pre-scan__section-count`,children:e.items.length})]}),(0,U.jsx)(`ul`,{className:`email-pre-scan__list`,children:e.items.map(o=>(0,U.jsx)(ex,{item:o,intent:e.intent,isPending:t!==null,onApproveArchive:n,onReply:r,onDismiss:i,onOpen:a},o.message_id))})]})}function ex({item:e,intent:t,isPending:n,onApproveArchive:r,onReply:i,onDismiss:a,onOpen:o}){let s=e.reason??e.why??``,c=Zb(e.sender);return(0,U.jsxs)(`li`,{className:`email-pre-scan__row`,children:[(0,U.jsxs)(`div`,{className:`email-pre-scan__row-text`,children:[(0,U.jsxs)(`div`,{className:`email-pre-scan__row-meta`,children:[(0,U.jsx)(`span`,{className:`email-pre-scan__row-sender`,title:e.sender,children:c}),(0,U.jsx)(`span`,{className:`email-pre-scan__row-subject`,title:e.subject,children:e.subject||`(no subject)`})]}),s&&(0,U.jsx)(`div`,{className:`email-pre-scan__row-reason`,title:s,children:s})]}),(0,U.jsxs)(`div`,{className:`email-pre-scan__row-actions`,role:`group`,"aria-label":`Actions for this email`,children:[t===`archive`?(0,U.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:[(0,U.jsx)(g,{size:12}),(0,U.jsx)(`span`,{children:`Archive`})]}):(0,U.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:[(0,U.jsx)(Sn,{size:12}),(0,U.jsx)(`span`,{children:`Reply`})]}),(0,U.jsxs)(`button`,{className:`email-pre-scan__action`,onClick:()=>o(e),title:`Open in Gmail`,"aria-label":`Open "${e.subject}" in Gmail`,children:[(0,U.jsx)(Me,{size:12}),(0,U.jsx)(`span`,{children:`Open`})]}),(0,U.jsx)(`button`,{className:`email-pre-scan__action email-pre-scan__action--ghost`,onClick:()=>a(e.message_id),title:`Dismiss this row`,"aria-label":`Dismiss "${e.subject}"`,children:(0,U.jsx)(Bn,{size:12})})]})]})}function tx({applied:e}){let t=e?.priority_senders??[],n=e?.low_priority_senders??[],r=e?.category_defaults??{};return t.length>0||n.length>0||Object.keys(r).length>0?(0,U.jsxs)(`div`,{className:`email-pre-scan__preferences`,"aria-label":`Active session preferences`,children:[(0,U.jsx)(`span`,{className:`email-pre-scan__preferences-label`,children:`Session preferences:`}),t.length>0&&(0,U.jsxs)(`span`,{className:`email-pre-scan__preferences-chip`,title:`Always urgent`,children:[`+ `,t.length,` priority sender`,t.length===1?``:`s`]}),n.length>0&&(0,U.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(([e,t])=>(0,U.jsxs)(`span`,{className:`email-pre-scan__preferences-chip`,title:`${e} → ${t}`,children:[e,` → `,t]},e))]}):null}var nx=2e6;function rx({variant:e,render:t,data:n}){let r;try{r=JSON.stringify(n)}catch{r=String(n)}let i=r.length>nx,a=r;if(!i)try{a=JSON.stringify(n,null,2)}catch{a=r}let o=e===`unknown`?`Unsupported card type: "${t}"`:`Invalid ${t} payload`;return(0,U.jsxs)(`div`,{className:`render-unsupported`,children:[(0,U.jsx)(`p`,{className:`render-unsupported__message`,children:o}),(0,U.jsxs)(`details`,{className:`render-unsupported__details`,children:[(0,U.jsx)(`summary`,{children:`Raw payload`}),i?(0,U.jsxs)(`p`,{className:`render-unsupported__too-large`,children:[`Payload too large to display (`,r.length,` bytes)`]}):(0,U.jsx)(`pre`,{className:`render-unsupported__json`,children:a})]})]})}function ix(e){return e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function ax(e){return e===null?``:String(e)}function ox(e){return e===void 0||typeof e==`string`}function sx(e){return`+${e-500} more (truncated)`}function cx(e){if(!e||typeof e!=`object`)return!1;let t=e;return ox(t.title)&&Array.isArray(t.columns)&&t.columns.every(e=>typeof e==`string`)&&Array.isArray(t.rows)&&t.rows.every(e=>Array.isArray(e)&&e.every(ix))}function lx({data:e}){if(!cx(e))return(0,U.jsx)(rx,{variant:`invalid`,render:`table`,data:e});let t=e.rows.length>500,n=t?e.rows.slice(0,500):e.rows,r=e.columns.length>500,i=r?e.columns.slice(0,500):e.columns;return(0,U.jsxs)(`div`,{className:`render-table-card`,children:[e.title&&(0,U.jsx)(`div`,{className:`render-table-card__title`,children:e.title}),(0,U.jsx)(`div`,{className:`render-table`,children:(0,U.jsxs)(`table`,{children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[i.map((e,t)=>(0,U.jsx)(`th`,{children:e},t)),r&&(0,U.jsx)(`th`,{children:sx(e.columns.length)})]})}),(0,U.jsx)(`tbody`,{children:n.map((e,t)=>(0,U.jsx)(`tr`,{children:e.slice(0,i.length).map((e,t)=>(0,U.jsx)(`td`,{children:ax(e)},t))},t))})]})}),t&&(0,U.jsx)(`div`,{className:`render-truncation`,children:sx(e.rows.length)})]})}function ux(e){if(!e||typeof e!=`object`)return!1;let t=e;return ox(t.title)&&Array.isArray(t.items)&&t.items.every(e=>e&&typeof e==`object`&&typeof e.key==`string`&&ix(e.value))}function dx({data:e}){if(!ux(e))return(0,U.jsx)(rx,{variant:`invalid`,render:`key_value`,data:e});let t=e.items.length>500,n=t?e.items.slice(0,500):e.items;return(0,U.jsxs)(`div`,{className:`render-kv`,children:[e.title&&(0,U.jsx)(`div`,{className:`render-kv__title`,children:e.title}),(0,U.jsx)(`dl`,{className:`render-kv__list`,children:n.map((e,t)=>(0,U.jsxs)(`div`,{className:`render-kv__row`,children:[(0,U.jsx)(`dt`,{className:`render-kv__key`,children:e.key}),(0,U.jsx)(`dd`,{className:`render-kv__value`,children:ax(e.value)})]},t))}),t&&(0,U.jsx)(`div`,{className:`render-truncation`,children:sx(e.items.length)})]})}function fx(e){if(!e||typeof e!=`object`)return!1;let t=e;return ox(t.title)&&(t.ordered===void 0||typeof t.ordered==`boolean`)&&Array.isArray(t.items)&&t.items.every(e=>typeof e==`string`||typeof e==`number`)}function px({data:e}){if(!fx(e))return(0,U.jsx)(rx,{variant:`invalid`,render:`list`,data:e});let t=e.items.length>500,n=(t?e.items.slice(0,500):e.items).map((e,t)=>(0,U.jsx)(`li`,{children:String(e)},t));return(0,U.jsxs)(`div`,{className:`render-list`,children:[e.title&&(0,U.jsx)(`div`,{className:`render-list__title`,children:e.title}),e.ordered?(0,U.jsx)(`ol`,{className:`render-list__items`,children:n}):(0,U.jsx)(`ul`,{className:`render-list__items`,children:n}),t&&(0,U.jsx)(`div`,{className:`render-truncation`,children:sx(e.items.length)})]})}var mx=/^data:image\/(png|jpe?g|gif|webp);base64,/;function hx(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.src==`string`&&mx.test(t.src)&&ox(t.alt)&&ox(t.caption)}function gx({data:e}){return hx(e)?(0,U.jsxs)(`figure`,{className:`render-image`,children:[(0,U.jsx)(`img`,{className:`render-image__img`,src:e.src,alt:e.alt??``}),e.caption&&(0,U.jsx)(`figcaption`,{className:`render-image__caption`,children:e.caption})]}):(0,U.jsx)(rx,{variant:`invalid`,render:`image`,data:e})}function _x(e){if(!e||typeof e!=`object`)return!1;let t=e;return ox(t.title)&&ox(t.badge)&&ox(t.note)&&typeof t.unified==`string`}function vx(e){return e.startsWith(`@@`)?`render-diff__line render-diff__line--hunk`:e.startsWith(`+++`)||e.startsWith(`---`)||e.startsWith(`diff `)||e.startsWith(`index `)?`render-diff__line`:e.startsWith(`+`)?`render-diff__line render-diff__line--added`:e.startsWith(`-`)?`render-diff__line render-diff__line--removed`:`render-diff__line`}function yx({data:e}){if(!_x(e))return(0,U.jsx)(rx,{variant:`invalid`,render:`diff`,data:e});let t=e.unified.replace(/\n$/,``).split(`
|
|
52
|
+
`).map(e=>e.replace(/\r$/,``));return(0,U.jsxs)(`div`,{className:`render-diff`,children:[(e.title||e.badge)&&(0,U.jsxs)(`div`,{className:`render-diff__title`,children:[e.badge&&(0,U.jsx)(`span`,{className:`render-diff__badge`,children:e.badge}),e.title]}),e.note&&(0,U.jsx)(`div`,{className:`render-diff__note`,children:e.note}),e.unified&&(0,U.jsx)(`pre`,{className:`render-diff__body`,children:t.map((e,t)=>(0,U.jsx)(`div`,{className:vx(e),children:e},t))})]})}function bx(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.action==`string`&&typeof t.summary==`string`}function xx(e){let t=e.replace(/_/g,` `).trim();return t.length>0?t:`action`}function Sx({data:e}){let[t,n]=(0,V.useState)(!1);return bx(e)?t?(0,U.jsx)(`div`,{className:`render-confirmation render-confirmation--dismissed`,children:(0,U.jsx)(`span`,{className:`render-confirmation__dismissed-note`,children:`Confirmation dismissed`})}):(0,U.jsxs)(`div`,{className:`render-confirmation`,children:[(0,U.jsxs)(`div`,{className:`render-confirmation__header`,children:[(0,U.jsx)(`span`,{className:`render-confirmation__badge`,children:`Approval needed`}),(0,U.jsx)(`span`,{className:`render-confirmation__label`,children:xx(e.action)}),(0,U.jsx)(`code`,{className:`render-confirmation__action`,children:e.action})]}),(0,U.jsx)(`pre`,{className:`render-confirmation__summary`,children:e.summary}),(0,U.jsxs)(`div`,{className:`render-confirmation__footer`,children:[(0,U.jsx)(`span`,{className:`render-confirmation__note`,children:`Nothing was executed. Follow the assistant's guidance below to approve this action.`}),(0,U.jsx)(`button`,{type:`button`,className:`render-confirmation__dismiss`,onClick:()=>n(!0),children:`Dismiss`})]})]}):(0,U.jsx)(rx,{variant:`invalid`,render:`needs_confirmation`,data:e})}function Cx(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.session_id==`string`&&typeof t.request_id==`string`&&typeof t.question==`string`&&Array.isArray(t.options)&&typeof t.allow_free_text==`boolean`&&typeof t.sensitive==`boolean`}var wx=`This question is no longer waiting for an answer. If you still want to answer it, say so in a new message.`,Tx=`••••••`;function Ex(e){return e?.httpStatus===404}function Dx({data:e}){let[t,n]=(0,V.useState)({status:`pending`}),[r,i]=(0,V.useState)(``),a=Cx(e)?e.request_id:``,o=H(e=>e.liveQuestions[a]),s=H(e=>e.closeQuestion);if((0,V.useEffect)(()=>{if(!o||o.expiresAt===null)return;let e=o.expiresAt-Date.now();if(e<=0){s(a);return}let t=setTimeout(()=>s(a),e);return()=>clearTimeout(t)},[o,a,s]),!Cx(e))return(0,U.jsx)(rx,{variant:`invalid`,render:`needs_input`,data:e});let c=t.status===`submitting`,l=async t=>{if(t.trim()&&!c&&o){n({status:`submitting`});try{await sa(e.session_id,e.request_id,t),n({status:`answered`}),s(e.request_id)}catch(t){if(Ex(t)){s(e.request_id),n({status:`expired`,message:wx});return}n({status:`error`,message:t instanceof Error?t.message:`Failed to send the answer.`})}}};return t.status===`answered`?(0,U.jsx)(`div`,{className:`render-needs-input render-needs-input--answered`,children:(0,U.jsx)(`span`,{className:`render-needs-input__answered-note`,children:`Answered`})}):t.status===`expired`||!o&&!c?(0,U.jsxs)(`div`,{className:`render-needs-input render-needs-input--expired`,"aria-disabled":`true`,children:[(0,U.jsx)(`div`,{className:`render-needs-input__header`,children:(0,U.jsx)(`span`,{className:`render-needs-input__badge`,children:`Question`})}),(0,U.jsx)(`p`,{className:`render-needs-input__question`,children:e.question}),(0,U.jsx)(`p`,{className:`render-needs-input__expired-note`,role:`status`,children:t.status===`expired`?t.message:wx})]}):(0,U.jsxs)(`div`,{className:`render-needs-input`,children:[(0,U.jsxs)(`div`,{className:`render-needs-input__header`,children:[(0,U.jsx)(`span`,{className:`render-needs-input__badge`,children:`Question`}),e.sensitive&&(0,U.jsx)(`span`,{className:`render-needs-input__sensitive-badge`,children:`Sensitive`})]}),(0,U.jsx)(`p`,{className:`render-needs-input__question`,children:e.question}),e.options.length>0&&(0,U.jsx)(`div`,{className:`render-needs-input__options`,children:e.options.map(e=>(0,U.jsx)(`button`,{type:`button`,className:`render-needs-input__option`,disabled:c,title:e.description||void 0,onClick:()=>l(e.value),children:e.label},e.value))}),e.allow_free_text&&(0,U.jsxs)(`form`,{className:`render-needs-input__free-text`,onSubmit:e=>{e.preventDefault(),l(r)},children:[(0,U.jsx)(`input`,{type:e.sensitive?`password`:`text`,className:`render-needs-input__free-text-input`,value:r,disabled:c,placeholder:e.sensitive?`Type your answer (hidden as ${Tx})`:`Type your answer…`,onChange:e=>i(e.target.value),autoComplete:`off`}),(0,U.jsx)(`button`,{type:`submit`,className:`render-needs-input__free-text-submit`,disabled:c||!r.trim(),children:`Send`})]}),t.status===`error`&&(0,U.jsx)(`p`,{className:`render-needs-input__error`,children:t.message})]})}function Ox(e){if(e&&typeof e==`object`&&e.kind===`email_pre_scan`)return e;let t=e?.data;return t&&typeof t==`object`&&t.kind===`email_pre_scan`?t:e}function kx({data:e}){let t=Ox(e);return Jb(t)?(0,U.jsx)(Qb,{payload:t}):(0,U.jsx)(rx,{variant:`invalid`,render:`email_pre_scan`,data:e})}var Ax={email_pre_scan:kx,table:lx,key_value:dx,list:px,image:gx,diff:yx,needs_confirmation:Sx,needs_input:Dx},jx=class extends V.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){console.error(`[CardErrorBoundary] card render failed:`,e)}render(){return this.state.hasError?(0,U.jsx)(`div`,{role:`alert`,className:`render-card-error`,children:`Card failed to render`}):this.props.children}};function Mx({render:e,data:t}){let n=Ax[e];return(0,U.jsx)(`div`,{className:`render-card`,children:n?(0,U.jsx)(jx,{children:(0,U.jsx)(n,{data:t})}):(0,U.jsx)(rx,{variant:`unknown`,render:e,data:t})})}function Nx(e){if(e<1e3)return`under a second`;let t=Math.round(e/1e3);if(t<60)return`${t} s`;let n=Math.floor(t/60),r=t%60;return r?`${n} min ${r} s`:`${n} min`}var Px={stopped:`Stopped after`,interrupted:`Interrupted after`};function Fx(e,t,n){let r=[];if(e!=null&&e>0){let i=n?Px[n]:`Answered in`;r.push(`${i} ${Nx(e)}${t?.place?` ${t.place}`:``}`)}else t?.place&&r.push(`${n?`Ran`:`Answered`} ${t.place}`);if(t?.time_to_first_token!=null&&t.time_to_first_token>0){let e=`first word in ${Nx(t.time_to_first_token*1e3)}`;r.push(r.length?e:e[0].toUpperCase()+e.slice(1))}return t?.steps!=null&&t.steps>0&&r.push(`${t.steps} step${t.steps===1?``:`s`}`),r.length?r.join(` · `):null}function Ix(e,t){let n=[];return e!=null&&e>0&&n.push(`Total time ${(e/1e3).toFixed(1)} s`),t?.time_to_first_token!=null&&t.time_to_first_token>0&&n.push(`First token ${(t.time_to_first_token*1e3).toFixed(0)} ms`),t?.output_tokens!=null&&t.output_tokens>0&&n.push(`${(t.input_tokens??0).toLocaleString()} → ${t.output_tokens.toLocaleString()} tokens`),t?.tokens_per_second!=null&&t.tokens_per_second>0&&n.push(`${t.tokens_per_second} tokens/s`),n}function Lx({latencyMs:e,stats:t,ended:n}){let[r,i]=(0,V.useState)(!1),a=Fx(e,t,n),o=Ix(e,t);return!a&&o.length===0?null:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{children:(0,U.jsx)(`button`,{type:`button`,className:`msg-stats-summary`,"aria-expanded":r,title:o.join(`
|
|
53
|
+
`),onClick:()=>i(e=>!e),children:a??`Details`})}),r&&o.map(e=>(0,U.jsx)(`span`,{children:e},e))]})}function Rx(e){return!e||e===`Thinking...`||e.startsWith(`Reading `)||/— retrying (now|in \d+s)/.test(e)}var zx=`(prefers-reduced-motion: reduce)`;function Bx(e){let t=getComputedStyle(document.documentElement).getPropertyValue(e).trim(),n=/^([\d.]+)(ms|s)$/.exec(t);if(!n)throw Error(`Motion token ${e} is "${t}", not a duration; check styles/index.css.`);return parseFloat(n[1])*(n[2]===`s`?1e3:1)}function Vx(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(zx).matches}function Hx(){return Vx()?`auto`:`smooth`}var Ux=new Map;function Wx(e){let t=Ux.get(e);return t||(t={byMessage:new Map,checked:new Set,inFlight:null,listeners:new Set},Ux.set(e,t)),t}function Gx(e){let t=Wx(e);return t.inFlight||=Promise.resolve().then(()=>vs(e)).then(e=>{if(!e||!Array.isArray(e.turns))throw Error(`the server sent no list of turns`);let{turns:n}=e;t.byMessage=new Map(n.filter(e=>e.message_id!=null).map(e=>[e.message_id,e])),t.listeners.forEach(e=>e())}).finally(()=>{t.inFlight=null}),t.inFlight}function Kx(e){return Gx(e)}function qx(e,t){let[n,r]=(0,V.useState)(()=>Ux.get(e)?.byMessage.get(t)??null),[i,a]=(0,V.useState)(null);return(0,V.useEffect)(()=>{if(t<=0)return;let n=Wx(e),i=()=>r(n.byMessage.get(t)??null);return n.listeners.add(i),!n.byMessage.has(t)&&!n.checked.has(t)?(n.checked.add(t),Gx(e).then(()=>a(null),e=>{n.checked.delete(t),a(e instanceof Error?e.message:String(e))})):i(),()=>{n.listeners.delete(i)}},[e,t]),{turn:n,error:i,refresh:(0,V.useCallback)(()=>Gx(e),[e])}}var Jx=`gaia:changes-undone`;function Yx(e){window.dispatchEvent(new CustomEvent(Jx,{detail:e}))}function Xx(e,t){let n=(0,V.useRef)(t);n.current=t,(0,V.useEffect)(()=>{let t=t=>{t.detail===e&&n.current()};return window.addEventListener(Jx,t),()=>window.removeEventListener(Jx,t)},[e])}var Zx={shell:{one:`command`,many:`commands`,prefix:`Command`},run_python:{one:`Python snippet`,many:`Python snippets`,prefix:`Python`},execute_python_file:{one:`Python script`,many:`Python scripts`,prefix:`Python script`},mcp:{one:`connected tool call`,many:`connected tool calls`,prefix:`Connected tool`},install_cli:{one:`install command`,many:`install commands`,prefix:`Install`},late_write:{one:`late file write`,many:`late file writes`,prefix:`File write`}},Qx=120;function $x(e){return Zx[e]??{one:e,many:e,prefix:e}}function eS(e){return e.charAt(0).toUpperCase()+e.slice(1)}function tS(e){let t=e.replace(/\s+/g,` `).trim();return t.length>Qx?`${t.slice(0,119).trimEnd()}…`:t}function nS(e,t){return`${e} ${e===1?t.one:t.many}`}function rS(e){let t=new Map;for(let n of e){let e=t.get(n.kind);e||(e={kind:n.kind,count:0,entries:new Map},t.set(n.kind,e)),e.count+=1;let r=(n.detail??``).trim(),i=e.entries.get(r);i?i.count+=1:e.entries.set(r,{label:tS(r),detail:r,count:1})}return[...t.values()].map(({kind:e,count:t,entries:n})=>{let r=$x(e),i=[...n.values()],a;if(i.length===1){let e=i[0];a=e.label?`${r.prefix}: ${e.label}`:eS(r.one),e.count>1&&(a+=` ×${e.count}`)}else a=`${eS(r.many)} ×${t}`;return{kind:e,title:a,count:t,entries:i}})}function iS(e){let t=rS(e).map(e=>nS(e.count,$x(e.kind)));return t.length===0?`work`:t.length===1?t[0]:`${t.slice(0,-1).join(`, `)} and ${t[t.length-1]}`}function aS(e,{also:t=!1,inChat:n=!1,undo:r=`Undo`}={}){let i=e.length===1;return`${n?`In this chat, GAIA`:`GAIA`} ${t?`also ran`:`ran`} ${iS(e)} it can't track. If ${i?`it`:`they`} changed any files, ${r} won't restore them.`}var oS=f(),sS=[`a[href]`,`area[href]`,`button`,`input:not([type="hidden"])`,`select`,`textarea`,`iframe`,`summary`,`[contenteditable]:not([contenteditable="false"])`,`[tabindex]`].join(`, `),cS=[];function lS(){let e=cS[cS.length-1];for(let t=!0;t;){t=!1;for(let n of cS)n!==e&&n.current&&e?.current?.contains(n.current)&&(e=n,t=!0)}return e}function uS(e,t){for(let n=e.parentElement?.closest(`details`);n&&t.contains(n);n=n.parentElement?.closest(`details`))if(!n.open&&!n.querySelector(`:scope > summary`)?.contains(e))return!0;return!1}function dS(e,t){let n=e.closest(`[inert]`);if(n&&t.contains(n)||uS(e,t))return!1;if(typeof e.checkVisibility==`function`)return e.checkVisibility({visibilityProperty:!0});if(getComputedStyle(e).visibility===`hidden`)return!1;for(let n=e;n&&n!==t.parentElement;n=n.parentElement)if(n.hidden||getComputedStyle(n).display===`none`)return!1;return!0}function fS(e){let t=Array.from(e.querySelectorAll(sS)).filter(t=>{let n=t.getAttribute(`tabindex`);return n!==null&&Number(n)<0||t.matches(`:disabled`)?!1:dS(t,e)}),n=e=>e instanceof HTMLInputElement&&e.type===`radio`&&e.name!==``,r=new Map;for(let e of t){if(!n(e))continue;let t=r.get(e.name);(!t||e.checked&&!t.checked)&&r.set(e.name,e)}let i=new Set(r.values());return t.filter(e=>!n(e)||i.has(e))}function pS(e,t){(0,V.useEffect)(()=>{if(!t)return;let n=e;cS.push(n);let r=t=>{if(t.key!==`Tab`||t.defaultPrevented||lS()!==n)return;let r=e.current;if(!r)return;let i=fS(r);if(i.length===0){t.preventDefault();return}let a=document.activeElement,o=a&&r.contains(a)&&a!==r?a:null,s=(e,t)=>!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING),c=!!o&&!i.some(e=>s(e,o)),l=!!o&&!i.some(e=>s(o,e));t.shiftKey&&(!o||c)?(t.preventDefault(),i[i.length-1].focus()):!t.shiftKey&&(!o||l)&&(t.preventDefault(),i[0].focus())};return document.addEventListener(`keydown`,r),()=>{document.removeEventListener(`keydown`,r),cS.splice(cS.indexOf(n),1)}},[e,t])}var mS={edited:`Edited`,created:`Created`,deleted:`Deleted`};function hS(e){if(e.too_large)return`Too large to show: ${e.before_size} → ${e.after_size} bytes.`;if(e.binary)return`Binary file: ${e.before_size} → ${e.after_size} bytes. No text diff.`;if(e.truncated)return`Diff shortened: the change is too long to show in full.`}function gS({sessionId:e,turn:t,onClose:n}){let[r,i]=(0,V.useState)(null),[a,o]=(0,V.useState)(null);ki(!0,n);let s=(0,V.useRef)(null);return pS(s,!0),(0,V.useEffect)(()=>{let n=!0;return ys(e,t.turn_id).then(e=>{n&&i(e.files)},e=>{n&&o(e instanceof Error?e.message:String(e))}),()=>{n=!1}},[e,t.turn_id]),(0,oS.createPortal)((0,U.jsx)(`div`,{ref:s,className:`modal-overlay`,onClick:n,role:`dialog`,"aria-modal":`true`,"aria-label":`Review changes`,children:(0,U.jsxs)(`div`,{className:`modal-panel changes-review`,onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(`div`,{className:`modal-header`,children:[(0,U.jsx)(`h3`,{children:`Changes in this turn`}),(0,U.jsx)(`button`,{type:`button`,className:`btn-icon`,onClick:n,"aria-label":`Close`,children:(0,U.jsx)(Bn,{size:18})})]}),(0,U.jsxs)(`div`,{className:`modal-body changes-review-body`,children:[a&&(0,U.jsxs)(`p`,{className:`settings-error`,role:`alert`,children:[`Could not load the changes: `,a]}),!r&&!a&&(0,U.jsxs)(`p`,{className:`changes-review-loading`,children:[(0,U.jsx)(B,{size:13,className:`spin`}),` Loading changes…`]}),r?.map(e=>(0,U.jsx)(`section`,{className:`changes-review-file`,children:(0,U.jsx)(yx,{data:{title:e.path,badge:mS[e.change],note:hS(e),unified:e.binary||e.too_large?``:e.unified}})},e.path)),t.restored_at&&(0,U.jsx)(`p`,{className:`settings-hint`,children:`This turn was undone; these are the changes it had made.`})]})]})}),document.body)}function _S(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function vS({sessionId:e,messageId:t}){let{turn:n,error:r,refresh:i}=qx(e,t),[a,o]=(0,V.useState)(`idle`),[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(!1),d=(0,V.useCallback)(async t=>{if(n){o(`working`),c(null);try{let r=await bs(e,n.turn_id,t),a=[];r.restored.length&&a.push(`restored ${_S(r.restored.length,`file`)}`),r.removed.length&&a.push(`removed ${_S(r.removed.length,`new file`)}`);let s=`Undone: ${a.join(`, `)||`no files needed changing`}.`;r.kept_folders.length&&(s+=` Kept ${_S(r.kept_folders.length,`folder`)} it created, because they now hold other files.`),c(s),o(`done`),Yx(e),await i()}catch(e){let t=e instanceof _a&&e.reason===`conflict`;c(e instanceof _a?e.detail:String(e)),o(t?`conflict`:`idle`)}}},[i,e,n]);if(r)return(0,U.jsxs)(`div`,{className:`turn-changes is-error`,role:`note`,children:[(0,U.jsx)(An,{size:12,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{children:[`Could not check this turn's file changes: `,r]})]});if(!n||n.files.length===0&&!n.incomplete)return null;let f=n.files.length,p=!!n.restored_at,m=rS(n.untracked);return(0,U.jsxs)(`div`,{className:`turn-changes`,"aria-label":`File changes from this turn`,children:[f>0&&(0,U.jsxs)(`div`,{className:`turn-changes-row`,children:[(0,U.jsxs)(`span`,{className:`turn-changes-summary`,children:[`Changed `,_S(f,`file`),p&&` · undone`]}),(0,U.jsxs)(`button`,{type:`button`,className:`turn-changes-btn`,onClick:()=>u(!0),children:[(0,U.jsx)(Re,{size:12,"aria-hidden":`true`}),` Review changes`]}),!p&&a!==`confirm`&&a!==`conflict`&&(0,U.jsxs)(`button`,{type:`button`,className:`turn-changes-btn`,onClick:()=>o(`confirm`),disabled:a===`working`,children:[(0,U.jsx)(Mn,{size:12,"aria-hidden":`true`}),` `,a===`working`?`Undoing…`:`Undo this turn`]}),a===`confirm`&&(0,U.jsxs)(`span`,{className:`turn-changes-confirm`,role:`group`,"aria-label":`Confirm undo`,children:[`Put `,_S(f,`file`),` back the way `,f===1?`it was`:`they were`,` before this turn?`,(0,U.jsx)(`button`,{type:`button`,className:`turn-changes-btn is-primary`,onClick:()=>void d(!1),children:`Undo`}),(0,U.jsx)(`button`,{type:`button`,className:`turn-changes-btn`,onClick:()=>o(`idle`),children:`Cancel`})]})]}),n.incomplete&&(0,U.jsxs)(`div`,{className:`turn-changes-warning`,role:`note`,children:[(0,U.jsx)(An,{size:12,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{children:[aS(n.untracked,{also:f>0}),m.length>0&&(0,U.jsx)(`ul`,{children:m.map(e=>(0,U.jsx)(`li`,{children:e.entries.length===1?(0,U.jsx)(`span`,{title:e.entries[0].detail||void 0,children:e.title}):(0,U.jsxs)(`details`,{children:[(0,U.jsx)(`summary`,{children:e.title}),(0,U.jsx)(`ul`,{children:e.entries.map(e=>(0,U.jsxs)(`li`,{title:e.detail||void 0,children:[e.label||`No description`,e.count>1&&` ×${e.count}`]},e.detail))})]})},e.kind))})]})]}),s&&(0,U.jsxs)(`div`,{className:`turn-changes-message${a===`done`?` is-ok`:` is-error`}`,role:a===`done`?`status`:`alert`,children:[s,a===`conflict`&&(0,U.jsxs)(`span`,{className:`turn-changes-confirm`,children:[(0,U.jsx)(`button`,{type:`button`,className:`turn-changes-btn is-danger`,onClick:()=>void d(!0),children:`Undo anyway and lose those changes`}),(0,U.jsx)(`button`,{type:`button`,className:`turn-changes-btn`,onClick:()=>{o(`idle`),c(null)},children:`Keep them`})]})]}),l&&(0,U.jsx)(gS,{sessionId:e,turn:n,onClose:()=>u(!1)})]})}var yS=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),bS=String.raw`(?:[A-Za-z]:[\\/](?:[^\s*?"<>|,;)}\]\\/]+[\\/])*)?`,xS=String.raw`(?<![\p{L}\p{N}_.\-])`,SS=String.raw`(?![\p{L}\p{N}_\-]|\.[\p{L}\p{N}])`;function CS(e){let t=new Map;for(let n of e)n.filename&&t.set(n.filename.toLowerCase(),n);if(t.size===0)return{re:null,byName:t};let n=[...t.keys()].sort((e,t)=>t.length-e.length).map(yS).join(`|`);return{re:RegExp(`${bS}${xS}(${n})${SS}`,`giu`),byName:t}}function wS(e,t){let n=t.trim().split(/[\\/]/).pop()??``;return e.byName.get(n.toLowerCase())??null}function TS(e,t){if(!e.re)return[];let n=[];for(let r of t.matchAll(e.re)){let t=e.byName.get(r[1].toLowerCase());t&&n.push({start:r.index,end:r.index+r[0].length,doc:t})}return n}var ES=`[0-9\\u0660-\\u0669\\u06F0-\\u06F9]+`,DS=[`pages?`,`pp?\\.`,`[وبفل]?(?:الصفحات|الصفحتان|الصفحتين|الصفحة|صفحات|صفحتي|صفحة)`,`ص\\.?`].join(`|`),OS=String.raw`\s*(?:,|،|&|and|to|و|إلى|[-–—])\s*`,kS=new RegExp(String.raw`(?<!\p{L})(?:${DS})(?!\p{L})\s*(${ES}(?:${OS}${ES})*)`,`iu`);function AS(e){return Number(e.replace(/[٠-٩۰-۹]/g,e=>String(e.charCodeAt(0)&15)))}function jS(e){let t=kS.exec(e);if(!t||t.index>40)return[];let n=t.index+t[0].length-t[1].length,r=[];for(let e of t[1].matchAll(new RegExp(ES,`g`))){let t=AS(e[0]);t>0&&r.push({start:n+e.index,end:n+e.index+e[0].length,page:t})}return r}function MS({active:e,label:t,awaitingUser:n=!1}){let r=q(),i=n?r(`activity.waiting`):t||r(`msg.thinking`),[a]=(0,V.useState)(Vx),[o,s]=(0,V.useState)(0),[c,l]=(0,V.useState)(a?`idle`:`typing`),u=(0,V.useRef)(e),d=(0,V.useRef)(i.length);d.current=i.length,(0,V.useEffect)(()=>{if(c!==`typing`)return;if(a||o>=i.length){l(`idle`);return}let e=setTimeout(()=>s(e=>e+1),30);return()=>clearTimeout(e)},[c,o,i.length,a]),(0,V.useEffect)(()=>{u.current&&!e&&(s(d.current),l(a?`done`:`erasing`)),u.current=e},[e,a]),(0,V.useEffect)(()=>{if(c!==`erasing`)return;if(o<=0){l(`done`);return}let e=setTimeout(()=>s(e=>e-1),20);return()=>clearTimeout(e)},[c,o]),(0,V.useEffect)(()=>{e&&c===`done`&&(s(0),l(`typing`))},[e,c]);let f=PS(e,i),p=e&&!n&&Rx(t),m=PS(p),h=Zs();if(c===`done`)return null;let g=p&&m>=45;return(0,U.jsxs)(`span`,{className:`thinking-indicator${e&&!n?` is-live`:``}`,children:[(0,U.jsx)(`span`,{className:`thinking-indicator-text`,children:c===`idle`?i:i.slice(0,o)}),e&&!n&&f>=NS&&(0,U.jsxs)(`span`,{className:`thinking-indicator-elapsed`,children:[` · `,f,`s`]}),e&&(0,U.jsx)(`span`,{className:`cursor`}),g&&(0,U.jsx)(`span`,{className:`thinking-indicator-hint`,role:`status`,children:h?.remote===!1?`Still waiting on the model — nothing has come back yet. A long prompt can take a minute or more to read on this PC. Press Stop to end it now.`:`Still waiting on the model — nothing has come back yet. A hosted model that stays silent is retried, then stopped with an error. Press Stop to end it now.`})]})}var NS=3;function PS(e,t){let[n,r]=(0,V.useState)(0);return(0,V.useEffect)(()=>{if(r(0),!e)return;let t=Date.now(),n=setInterval(()=>r(Math.floor((Date.now()-t)/1e3)),1e3);return()=>clearInterval(n)},[e,t]),n}function FS(e){if(!e)return!1;let 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`)}var IS=e=>e.replace(/\s+/g,` `).trim();function LS(e,t){let n=IS(t);if(!n)return{steps:e,echoed:!1};let r=e.filter(e=>!(e.type===`error`&&e.detail&&IS(e.detail)===n));return{steps:r,echoed:r.length<e.length}}var RS=/\s*\{\s*"?tool"?\s*:\s*"[^"]+"\s*,\s*"?tool_args"?\s*:\s*\{[^}]*\}\s*\}/g,zS=new Set([`thought`,`answer`,`tool`,`tool_args`,`goal`]),BS=/^\{\s*"(thought|answer|tool|tool_args|goal)"\s*:/;function VS(e,t){let n=0,r=!1,i=!1;for(let a=t;a<e.length;a++){let t=e[a];if(r)i?i=!1:t===`\\`?i=!0:t===`"`&&(r=!1);else if(t===`"`)r=!0;else if(t===`{`)n++;else if(t===`}`&&(n--,n===0))return a}return-1}function HS(e){let t=e.indexOf(`"answer"`);if(t===-1)return null;let n=e.indexOf(`:`,t+8);if(n===-1)return null;let r=n+1;for(;r<e.length&&/\s/.test(e[r]);)r++;if(r>=e.length||e[r]!==`"`)return null;let i=e.slice(r+1);return i.endsWith(`"}`)?i=i.slice(0,-2):i.endsWith(`"`)&&(i=i.slice(0,-1)),i.replace(/\\"/g,`"`).replace(/\\n/g,`
|
|
54
|
+
`).replace(/\\\\/g,`\\`)}function US(e){let t;try{t=JSON.parse(e)}catch{let t=HS(e);return t===null?e.includes(`"tool_args"`)?{action:`drop`}:{action:`keep`}:{action:`answer`,text:t}}if(typeof t!=`object`||!t||Array.isArray(t))return{action:`keep`};let n=t,r=Object.keys(n),i=r.length>0&&r.every(e=>zS.has(e));return typeof n.tool==`string`&&n.tool_args!==void 0?{action:`drop`}:typeof n.answer==`string`&&i?{action:`answer`,text:n.answer}:typeof n.thought==`string`&&n.answer===void 0&&i?{action:`drop`}:{action:`keep`}}function WS(e,t){let n=``,r=0;for(;r<e.length;){let i=e.indexOf(`{`,r);if(i===-1){n+=e.slice(r);break}if(!BS.test(e.slice(i,i+40))){n+=e.slice(r,i+1),r=i+1;continue}let a=VS(e,i);if(a===-1){n+=t?e.slice(r,i):e.slice(r);break}n+=e.slice(r,i);let o=e.slice(i,a+1),s=US(o);s.action===`answer`?n+=s.text:s.action===`keep`&&(n+=o),r=a+1}return n}var GS=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`.split(`.`));function KS(e){return e.replace(/```(\w*)[ \t]*\n([\s\S]*?)```/g,(e,t,n)=>{let r=t.toLowerCase();return r.length>0&&r.length<=2&&!GS.has(r)?n.trim():e})}var qS=/\n{1,2}Verification: unverified[^\n]*\s*$/;function JS(e){let t=e;for(;;){let e=t.replace(qS,``);if(e===t)return t;t=e}}function YS(e,t=!1){if(!e)return e;e=JS(e);let n=e;n=n.replace(RS,``),n=WS(n,t),n=n.replace(/<think>[\s\S]*?<\/think>/g,``);let r=(n.match(/\\n/g)||[]).length,i=(n.match(/\n/g)||[]).length;return r>2&&r>i*2&&(n=n.replace(/\\n/g,`
|
|
55
|
+
`),n=n.replace(/\\"/g,`"`)),n=KS(n).trim(),XS(n)}function XS(e){let t=!1;return e.split(`
|
|
56
|
+
`).map(e=>(/^\s*(```|~~~)/.test(e)&&(t=!t),t?e:e.replace(/^(\s*\d+)\.(\s*)$/,`$1\\.$2`))).join(`
|
|
57
|
+
`)}function ZS(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}):``}var QS=`Cancelled.`,$S=[`This answer was interrupted when GAIA closed. Send again to retry.`,`This answer was interrupted before it finished. Send again to retry.`,`This answer ended before GAIA could save a reply. Send again to retry.`];function eC(e,t){if(t)return`stopped`;let n=e.trim();return $S.some(e=>n.endsWith(e))?`interrupted`:void 0}function tC({message:e,isStreaming:t,agentSteps:n,agentStepsActive:r,cards:i,onDelete:a,onResend:o,extraActions:s,latencyMs:c,liveStatus:l,awaitingUser:u}){let d=q();Gs();let f=(0,V.useMemo)(()=>e.role===`assistant`&&!t&&n?LS(n,e.content):{steps:n,echoed:!1},[n,e.content,e.role,t]),p=e.role===`assistant`&&(f.echoed||FS(e.content)),m=e.role===`assistant`?e.stopState??(e.content.trim()===QS?`stopped`:void 0):void 0,h=(0,V.useMemo)(()=>e.role===`user`?e.content:YS(e.content,!!t),[e.content,e.role,t]),[g,_]=(0,V.useState)(!1),[v,y]=(0,V.useState)(!1),b=e.role===`user`&&Ly(e.content),[x,S]=(0,V.useState)(!1),C=(0,V.useId)(),w=(0,V.useRef)(null),T=(0,V.useRef)(!1),E=(0,V.useCallback)(()=>{x&&(T.current=!0),S(!x)},[x]);(0,V.useEffect)(()=>{!x&&T.current&&(T.current=!1,w.current?.scrollIntoView?.({block:`nearest`}))},[x]);let D=(0,V.useRef)(null),O=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{D.current&&clearTimeout(D.current),O.current&&clearTimeout(O.current)},[]);let k=(0,V.useCallback)(()=>{if(navigator.clipboard?.writeText)navigator.clipboard.writeText(e.content).catch(()=>{});else{let t=document.createElement(`textarea`);t.value=e.content,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t)}_(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>_(!1),2e3)},[e.content]),A=(0,V.useCallback)(()=>{v?(y(!1),O.current&&clearTimeout(O.current),a?.(e.id)):(y(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>y(!1),3e3))},[v,e.id,a]),j=(0,V.useCallback)(()=>{o?.(e)},[e,o]),M=e.created_at?d(e.role===`user`?`msg.sent`:`msg.replied`,{time:ZS(e.created_at)}):void 0;return(0,U.jsx)(`div`,{className:`msg msg-${e.role} ${p?`msg-error`:``}`,title:M,children:(0,U.jsxs)(`div`,{className:`msg-inner`,children:[(0,U.jsxs)(`div`,{className:`msg-header`,children:[(0,U.jsx)(`div`,{className:`msg-header-left`}),!t&&(0,U.jsxs)(`div`,{className:`msg-actions`,children:[e.role===`user`&&o&&(0,U.jsx)(`button`,{className:`msg-action-btn`,onClick:j,title:d(`msg.resend`),"aria-label":d(`msg.resend`),children:(0,U.jsx)(tn,{size:12})}),s,(0,U.jsx)(`button`,{className:`msg-copy ${g?`copied`:``}`,onClick:k,title:d(g?`msg.copied`:`msg.copy`),"aria-label":d(g?`msg.copiedAria`:`msg.copy`),children:g?(0,U.jsx)(F,{size:12}):(0,U.jsx)(be,{size:12})}),a&&(0,U.jsx)(`button`,{className:`msg-action-btn msg-delete ${v?`confirm`:``}`,onClick:A,title:d(v?`msg.confirmDelete`:`msg.delete`),"aria-label":d(v?`msg.confirmDeleteAria`:`msg.delete`),children:(0,U.jsx)(On,{size:12})})]})]}),(0,U.jsxs)(`div`,{className:`msg-body`,children:[e.role===`assistant`&&(f.steps&&f.steps.length>0||t)&&(0,U.jsx)(xb,{steps:f.steps??[],isActive:r??!1,running:!!t,awaitingUser:u,answer:t?void 0:h,liveLine:t&&(0,U.jsx)(MS,{active:!!r||!h,label:l,awaitingUser:u})}),p&&(0,U.jsxs)(`div`,{className:`error-banner`,children:[(0,U.jsx)(An,{size:14}),(0,U.jsx)(`span`,{children:d(`msg.error`)})]}),(e.cards??i)?.map((e,t)=>(0,U.jsx)(Mx,{render:e.render,data:e.data},t)),b?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{ref:w,id:C,className:`msg-collapsible${x?``:` is-collapsed`}`,children:(0,U.jsx)(yC,{content:h})}),(0,U.jsx)(zy,{expanded:x,onToggle:E,controls:C,collapsedLabel:d.hint(d(`msg.showAll`),Ry(e.content)),expandedLabel:d(`msg.showLess`),className:`msg-expand-toggle`})]}):!(m&&h.trim()===QS)&&(0,U.jsx)(yC,{content:h,showCursor:t&&!!h&&!r,isStreaming:t}),m&&(0,U.jsxs)(`div`,{className:`msg-stopped${m===`unconfirmed`||e.stopError?` is-unconfirmed`:``}`,role:`note`,children:[(0,U.jsx)(wn,{size:9,fill:`currentColor`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:m===`unconfirmed`?d(`msg.stoppedUnconfirmed`):e.stopError?d(`msg.stoppedError`,{error:e.stopError}):d(`msg.stopped`)})]}),e.role===`assistant`&&!t&&Ub(h)&&(0,U.jsx)(qb,{content:h}),e.role===`assistant`&&!t&&(e.stats||c!=null||e.created_at)&&(0,U.jsxs)(`div`,{className:`msg-stats`,"aria-label":d(`msg.about`),children:[e.created_at&&(0,U.jsx)(`span`,{className:`msg-stats-ts`,title:d(`msg.timestamp`),children:ZS(e.created_at)}),e.stats?.retried&&e.stats.model&&(0,U.jsx)(`span`,{title:`This answer was kept from Retry with… (${e.stats.model})`,children:qs(e.stats.model)}),(0,U.jsx)(Lx,{latencyMs:c,stats:e.stats,ended:eC(e.content,m)})]}),e.role===`assistant`&&!t&&e.id>0&&e.session_id&&(0,U.jsx)(vS,{sessionId:e.session_id,messageId:e.id})]})]})})}var nC=(0,V.createContext)(!1);function rC({lang:e,code:t}){let n=q(),[r,i]=(0,V.useState)(!1),[a,o]=(0,V.useState)(!1),s=(0,V.useContext)(nC),c=(0,V.useId)(),l=Iy(t),u=l>(s?20:25),d=u&&!a,f=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{f.current&&clearTimeout(f.current)},[]);let p=(0,V.useCallback)(()=>{if(navigator.clipboard?.writeText)navigator.clipboard.writeText(t).catch(()=>{});else{let e=document.createElement(`textarea`);e.value=t,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e)}i(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>i(!1),2e3)},[t]);return(0,U.jsxs)(`div`,{className:`code-block${d?` is-collapsed`:``}`,dir:`ltr`,children:[(0,U.jsxs)(`div`,{className:`code-header`,children:[(0,U.jsx)(`span`,{className:`code-lang`,children:e||`code`}),(0,U.jsxs)(`button`,{className:`code-copy ${r?`copied`:``}`,onClick:p,title:n(r?`msg.copied`:`code.copy`),"aria-label":n(r?`msg.copiedAria`:`code.copyAria`),children:[r?(0,U.jsx)(F,{size:13}):(0,U.jsx)(be,{size:13}),(0,U.jsx)(`span`,{children:n(r?`code.copied`:`code.copy`)})]})]}),(0,U.jsx)(`pre`,{id:c,children:(0,U.jsx)(`code`,{children:t})}),u&&(0,U.jsx)(zy,{expanded:a,onToggle:()=>o(e=>!e),controls:c,collapsedLabel:`Expand (${l.toLocaleString(`en-US`)} lines)`,expandedLabel:`Collapse`,className:`code-expand-toggle`})]})}var iC=/\b[A-Z]:[\\/][^\s*?"<>|,;)}\]\\/]+(?:[\\/][^\s*?"<>|,;)}\]\\/]+)*[\\/]?/gi,aC=/[.:!']+$/,oC=RegExp(`^(?:${iC.source})$`,`i`);function sC(e){if(typeof e!=`string`)return null;let t=e.trim();return oC.test(t)?t:null}function cC({path:e}){let t=t=>{t.preventDefault(),es(e).catch(e=>{s.ui.error(`Failed to open path`,e)})};return(0,U.jsxs)(`span`,{className:`file-path-link`,dir:`ltr`,onClick:t,title:`Open in file explorer: ${e}`,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t(e))},children:[(0,U.jsx)(Je,{size:12,className:`file-path-icon`}),e]})}function lC(e){let t=new RegExp(iC.source,`gi`),n=[],r=0,i;for(;(i=t.exec(e))!==null;){i.index>r&&n.push(e.slice(r,i.index));let t=i[0].replace(aC,``);n.push((0,U.jsx)(cC,{path:t},i.index)),r=i.index+t.length}return n.length===0?e:(r<e.length&&n.push(e.slice(r)),(0,U.jsx)(U.Fragment,{children:n}))}var uC=(0,V.createContext)(CS([]));function dC({doc:e,page:t,t:n}){return(0,U.jsxs)(`a`,{className:`citation-link`,href:qo(e.id,t),target:`_blank`,rel:`noopener noreferrer`,dir:`ltr`,title:t?n(`citation.openPage`,{page:t}):n(`citation.open`,{name:e.filename}),"data-doc-id":e.id,"data-page":t,children:[(0,U.jsx)(We,{size:12,className:`citation-icon`,"aria-hidden":`true`}),e.filename]})}function fC({doc:e,page:t,label:n,t:r}){return(0,U.jsx)(`a`,{className:`citation-page`,href:qo(e.id,t),target:`_blank`,rel:`noopener noreferrer`,title:r(`citation.openPage`,{page:t}),"data-doc-id":e.id,"data-page":t,children:n})}function pC(e,t){let n=TS(e,t)[0];return jS(n?t.slice(0,n.start):t)}function mC(e,t,n,r){let i=TS(t,e),a=[],o=(t,r,i)=>{for(let o of r){let r=i+o.start,s=i+o.end;a.push({start:r,end:s,node:(0,U.jsx)(fC,{doc:t,page:o.page,label:e.slice(r,s),t:n},`p${r}`)})}};if(r&&o(r,jS(e.slice(0,i[0]?.start??e.length)),0),i.forEach((t,r)=>{let s=jS(e.slice(t.end,i[r+1]?.start??e.length));a.push({start:t.start,end:t.end,node:(0,U.jsx)(dC,{doc:t.doc,page:s[0]?.page,t:n},`c${t.start}`)}),o(t.doc,s,t.end)}),a.length===0)return lC(e);a.sort((e,t)=>e.start-t.start);let s=[],c=0;for(let t of a)t.start>c&&s.push((0,U.jsx)(V.Fragment,{children:lC(e.slice(c,t.start))},`t${c}`)),s.push(t.node),c=t.end;return c<e.length&&s.push((0,U.jsx)(V.Fragment,{children:lC(e.slice(c))},`t${c}`)),(0,U.jsx)(U.Fragment,{children:s})}function hC(e,t){return typeof t==`string`?wS(e,t):null}function gC({children:e}){let t=(0,V.useContext)(uC),n=q(),r=V.Children.toArray(e),i=null,a=r.map((e,a)=>{if(typeof e==`string`){let r=mC(e,t,n,i);return i=null,(0,U.jsx)(V.Fragment,{children:r},`s${a}`)}if(i=null,V.isValidElement(e)&&e.type===_C){let o=hC(t,e.props.children);if(o){let e=r[a+1],s=typeof e==`string`?pC(t,e):[];return i=o,(0,U.jsx)(dC,{doc:o,page:s[0]?.page,t:n},`k${a}`)}}return e});return(0,U.jsx)(U.Fragment,{children:a})}function _C({className:e,children:t,node:n,...r}){let i=(0,V.useContext)(uC),a=q(),o=hC(i,t);if(o)return(0,U.jsx)(dC,{doc:o,t:a});let s=sC(t);return s?(0,U.jsx)(cC,{path:s}):(0,U.jsx)(`code`,{className:`inline-code`,dir:`ltr`,...r,children:t})}var vC={code:_C,pre({children:e}){let t=V.Children.toArray(e)[0];if(V.isValidElement(t)&&(t.type===`code`||t.props?.className!==void 0||typeof t.props?.children==`string`)){let e=t.props,n=e?.className||``,r=/language-([\w-]+)/.exec(n),i=String(e?.children||``).replace(/\n$/,``),a=r?.[1]||``;return(0,U.jsx)(rC,{lang:a,code:i})}return(0,U.jsx)(`pre`,{dir:`ltr`,children:e})},table({children:e}){return(0,U.jsx)(`div`,{className:`md-table-wrap`,children:(0,U.jsx)(`table`,{className:`md-table`,dir:`auto`,children:e})})},a({href:e,children:t}){return(0,U.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`md-link`,children:t})},p({children:e}){return(0,U.jsx)(`p`,{className:`md-p`,dir:`auto`,children:(0,U.jsx)(gC,{children:e})})},h1({children:e}){return(0,U.jsx)(`h2`,{className:`md-h2`,dir:`auto`,children:(0,U.jsx)(gC,{children:e})})},h2({children:e}){return(0,U.jsx)(`h3`,{className:`md-h3`,dir:`auto`,children:(0,U.jsx)(gC,{children:e})})},h3({children:e}){return(0,U.jsx)(`h4`,{className:`md-h4`,dir:`auto`,children:(0,U.jsx)(gC,{children:e})})},h4({children:e}){return(0,U.jsx)(`h5`,{className:`md-h4`,dir:`auto`,children:(0,U.jsx)(gC,{children:e})})},ul({children:e}){return(0,U.jsx)(`ul`,{className:`md-ul`,dir:`auto`,children:e})},ol({children:e,start:t}){return(0,U.jsx)(`ol`,{className:`md-ol`,start:t,dir:`auto`,children:e})},li({children:e}){return(0,U.jsx)(`li`,{className:`md-li`,dir:`auto`,children:(0,U.jsx)(gC,{children:e})})},blockquote({children:e}){return(0,U.jsx)(`blockquote`,{className:`md-blockquote`,dir:`auto`,children:(0,U.jsx)(gC,{children:e})})},hr(){return(0,U.jsx)(`hr`,{className:`md-hr`})},td({children:e}){return(0,U.jsx)(`td`,{dir:`auto`,children:(0,U.jsx)(gC,{children:e})})},th({children:e}){return(0,U.jsx)(`th`,{dir:`auto`,children:(0,U.jsx)(gC,{children:e})})}};function yC({content:e,showCursor:t,isStreaming:n=!1}){let r=H(e=>e.documents),i=(0,V.useMemo)(()=>CS(r),[r]);return!e&&!t?null:!e&&t?(0,U.jsx)(`span`,{className:`cursor`}):(0,U.jsx)(nC.Provider,{value:n,children:(0,U.jsx)(uC.Provider,{value:i,children:(0,U.jsxs)(`div`,{className:`md-content`,children:[(0,U.jsx)(mg,{remarkPlugins:[xy,Ey,Oy],disallowedElements:[...yg],urlTransform:xg,components:vC,children:e}),t&&(0,U.jsx)(`span`,{className:`cursor`})]})})})}function bC(e){return e.type===`status`&&e.status===`working`&&!e.phase&&(e.message??``).startsWith(`Model is processing`)}function xC(e,t){let 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`commentary`:return{id:n,type:`commentary`,label:`Commentary`,detail:e.content,active:!1,timestamp:r};case`tool_start`:return{id:n,type:`tool`,label:`Using tool`,tool:e.tool,detail:e.detail,narration:e.narration,active:!0,timestamp:r,mcpServer:e.mcp_server,mcpServerLabel:e.mcp_server_label,mcpTool:e.mcp_tool};case`plan`:return{id:n,type:`plan`,label:`Created plan`,planSteps:e.steps,planNarrations:e.step_narrations,currentStep:e.current_step,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 e.message?.startsWith(`Agent: `)?null:{id:n,type:`status`,label:e.message||e.status||`Working`,active:e.status===`working`,...e.status===`warning`?{success:!1}:{},timestamp:r};case`agent_error`:return{id:n,type:`error`,label:`Error`,detail:e.content,success:!1,active:!1,timestamp:r};case`policy_alert`:{let t=e.tool||`unknown tool`,i=e.reason||e.message||e.content||`Tool execution was blocked by governance policy.`;return{id:n,type:`policy_alert`,label:`Policy blocked ${t}`,detail:i,tool:t,decision:e.decision||`BLOCK`,reason:i,ruleIds:e.rule_ids??[],policyVersion:e.policy_version,receiptId:e.receipt_id,success:!1,active:!1,timestamp:r}}default:return null}}var SC=/\s*\{\s*"?(?:tool|thought|goal)"?\s*:\s*"[^"]*"[^}]*(?:"?tool_args"?\s*:\s*\{[^}]*\})?\s*\}/g;function CC(e){let t=e.trim();if(!t.startsWith(`{`)||!t.includes(`"thought"`)&&!t.includes(`"answer"`)&&!t.includes(`"goal"`))return e;try{let e=JSON.parse(t);if(e.answer!==void 0)return String(e.answer)}catch{}let n=t.indexOf(`"answer"`);if(n===-1)return``;let 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 a=t.slice(i+1);return a.endsWith(`"}`)?a=a.slice(0,-2):a.endsWith(`"`)&&(a=a.slice(0,-1)),a.replace(/\\"/g,`"`).replace(/\\n/g,`
|
|
58
|
+
`).replace(/\\\\/g,`\\`)}function wC(e,t){if(e.type!==`agent_error`||e.recoverable!==!0)return!1;let n=t[t.length-1];return!n||n.type!==`tool`?!1:n.success===!1||!!n.active&&n.success==null}function TC(e){return(e||[]).map(e=>({...e,agentSteps:e.agentSteps||e.agent_steps||void 0,stats:e.stats||e.inference_stats||void 0,turnSummary:e.turnSummary||e.turn_summary||void 0}))}function EC(e){return`policy-receipt-${encodeURIComponent(e)}`}var DC=1e3,OC=15e3,kC=null,AC=null,jC=DC,MC=0,NC=null;function PC(){if(kC)return kC;let e=Date.now();return kC=aa().then(t=>H.getState().setActiveRuns(t,e)).catch(e=>s.api.warn(`Could not read which chats are running`,e)).finally(()=>{kC=null}),kC}function FC(){let e=H.getState();return e.isStreaming||e.runningSessionIds.length>0}function IC(){return FC()?(jC=DC,DC):(jC=Math.min(jC*2,OC),jC)}function LC(e){PC().then(()=>{e===MC&&(AC=setTimeout(()=>LC(e),IC()))})}function RC(){NC&&(AC&&clearTimeout(AC),AC=null,jC=DC,LC(++MC))}function zC(){NC?.();let e=H.subscribe((e,t)=>{e.isStreaming&&!t.isStreaming&&RC()}),t=()=>RC();window.addEventListener(`focus`,t);let n=()=>{MC++,AC&&clearTimeout(AC),AC=null,e(),window.removeEventListener(`focus`,t),NC===n&&(NC=null)};return NC=n,jC=DC,LC(++MC),n}var BC=[0,3e3,1e4],VC=`The answer to your last message was lost: its run stopped before it finished, most often because GAIA restarted. Send the message again.`;function HC(e){return e.name===`StreamStalledError`||e.name===`StreamDroppedError`}function UC(e){if(HC(e))return`Lost the live view of this answer: the connection to GAIA dropped 4 times. The answer may still finish. Reopen this chat in a minute to see it.`;if(e instanceof K)return e.endpoint===`send`?`GAIA did not start this answer within ${Math.round(e.timeoutMs/1e3)} seconds; it may be busy or stuck. If the chat list shows this chat running, reopen it later to see the answer. Otherwise, send the message again.`:`GAIA did not respond when this chat reconnected to its running answer. The answer may still finish: check that GAIA is still running, then reopen this chat.`;if(e instanceof _a){let t=e.detail?ma(e.detail):``;return e.httpStatus===429?`GAIA is busy with another chat, so this message was not sent. Send it again when that chat finishes.`:e.httpStatus===409?t||`This chat is already answering a message. Wait for it to finish, or press Stop.`:`GAIA could not take this message (HTTP ${e.httpStatus})${t?`: ${t}`:`.`}`}return null}var WC=3e3,GC=new Set,KC=new Map,qC=new Set,JC=null;function YC(e,t=Date.now()){KC.set(e,t)}function XC(e){let t=H.getState();return t.activeRunsAt>0&&t.activeRunsAt>=(KC.get(e)??0)&&!t.runningSessionIds.includes(e)&&!t.queuedSessionIds.includes(e)}function ZC(e){return qC.add(e),()=>{qC.delete(e),JC?.()}}function QC(e){return e instanceof Error?UC(e)??(e.message||`Unknown error`):String(e)}function $C(e){let t=e?.httpStatus;return typeof t==`number`?t:void 0}function ew(e){let t=$C(e);return t===409||t===429}function tw(e){H.getState().setQueueHold(e,!0),setTimeout(()=>H.getState().setQueueHold(e,!1),WC)}function nw(e,t,n){return $C(n)===409&&(s.chat.info(`Chat ${e} was busy; queueing the message to try again`),H.getState().updateQueue(e,e=>Xr(e,t,`queued`)),tw(e),!0)}async function rw(e,t,n){let r=H.getState;if(GC.has(e)||r().queueHolds[e])return;let i=r().messageQueues[e]??[];if(i.some(e=>e.state===`sending`))return;let a=ai(i);if(a||li(i)){GC.add(e);try{if(a){let t;try{t=await W(e)}catch(t){if($C(t)===409){s.chat.info(`Chat ${e} is answering again; its queue waits for that turn to end`);return}s.chat.error(`Could not learn what chat ${e}'s last reply did with the messages added to it`,t),r().updateQueue(e,e=>ci(e,`GAIA could not say whether it read this message: ${QC(t)}`));return}r().updateQueue(e,e=>si(e,t))}let i=li(r().messageQueues[e]??[]);if(!i||!n())return;r().updateQueue(e,e=>Zr(e,i.id,`queued`,`starting`));let o;try{o=await t(e,i.text)}catch(e){o={kind:`failed`,error:QC(e)}}if(o.kind===`accepted`){YC(e),r().updateQueue(e,e=>ei(e,i.id)),RC();return}if(o.kind===`busy`){s.chat.info(`Queued message found chat ${e} busy; holding it`),r().updateQueue(e,e=>ti(e,i.id)),tw(e);return}s.chat.error(`Queued message for chat ${e} was not sent: ${o.error}`),r().updateQueue(e,e=>ti(e,i.id,o.error))}finally{GC.delete(e)}}}function iw(e){return e.type!==`status`||e.phase!==`waiting`}var aw=(e,t)=>new Promise(n=>{let r=!1,i=null,a=!1,o=e=>{r||(r=!0,e.kind===`accepted`&&(i?i.abort():a=!0),n(e))},c=()=>o({kind:`accepted`});s.chat.info(`Sending queued message for chat ${e} in the background`),i=ko(e,t,{onChunk:c,onAgentEvent:e=>{iw(e)&&c()},onDone:c,onError:e=>{HC(e)?c():ew(e)?o({kind:`busy`}):o({kind:`failed`,error:QC(e)})}}),a&&i.abort()});function ow(e=aw){let t=()=>{let t=H.getState();if(t.systemStatus?.init_state!==`initializing`)for(let n of Object.keys(t.messageQueues))!qC.has(n)&&XC(n)&&rw(n,e,()=>!qC.has(n))},n=H.subscribe((e,n)=>{(e.messageQueues!==n.messageQueues||e.queueHolds!==n.queueHolds||e.activeRunsAt!==n.activeRunsAt||e.runningSessionIds!==n.runningSessionIds||e.systemStatus!==n.systemStatus)&&t()});return JC=t,t(),()=>{n(),JC===t&&(JC=null)}}var sw=`https://github.com/amd/gaia/issues/new`,cw=[{label:`Image`,extensions:new Set([`.ico`,`.heic`,`.heif`]),message:`This image format cannot be indexed.`,alternatives:[`Convert it to PNG or JPEG — GAIA reads the text in those images`],featureTitle:`Support HEIC and ICO image indexing`},{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`,`.ppt`,`.xls`]),message:`Legacy Office formats (.doc, legacy PowerPoint .ppt, legacy Excel .xls) are not supported — GAIA reads only the modern XML-based formats. Modern Word (.docx), PowerPoint (.pptx), and Excel (.xlsx) are supported.`,alternatives:[`Re-save as .docx — GAIA indexes modern Word documents directly`,`Save modern PowerPoint as .pptx — GAIA indexes .pptx directly`,`Re-save legacy .xls workbooks as .xlsx — GAIA supports modern Excel files`],featureTitle:`Support legacy Microsoft Office (doc, ppt, xls) indexing`}];function lw(e){let t=e.toLowerCase().startsWith(`.`)?e.toLowerCase():`.${e.toLowerCase()}`;for(let e of cw)if(e.extensions.has(t))return e;return null}var uw=new Set(`.pdf,.pptx,.docx,.epub,.png,.jpg,.jpeg,.webp,.bmp,.gif,.tif,.tiff,.txt,.md,.mdx,.markdown,.rst,.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`.split(`,`));function dw(e){let t=e.toLowerCase().startsWith(`.`)?e.toLowerCase():`.${e.toLowerCase()}`;return uw.has(t)}function fw(){let e=navigator.userAgent;return`**Environment:**\n- GAIA Version: 0.25.4rc1\n- Platform: ${navigator.platform||`unknown`}\n- User Agent: ${e}\n- Interface: Agent UI (Web)`}function pw(e,t){let n=[`## Feature Description`,``,t||`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?_`,``,`---`,fw(),``,`_Submitted from GAIA Agent UI_`].join(`
|
|
59
|
+
`);return`${sw}?${new URLSearchParams({title:`[Feature] ${e}`,body:n,labels:`enhancement,agent-ui`}).toString()}`}function mw(e,t){let n=[`## Bug Description`,``,t||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?_`,``,`---`,fw(),``,`_Submitted from GAIA Agent UI_`].join(`
|
|
60
|
+
`);return`${sw}?${new URLSearchParams({title:`[Bug] ${e}`,body:n,labels:`bug,agent-ui`}).toString()}`}var hw={corrupted:`The file looks damaged. Re-download or re-export it, then index the new copy.`,encrypted:`The PDF needs a password to open. Save a copy without the password, then index that.`,empty:`The PDF has no readable text, which usually means it is a scan. Run OCR on it, then index it again.`,empty_file:`This file is empty. Add content to it, then index it again.`,unsupported_workbook:`This is an old .xls workbook or has a password. Open it in Excel, save a copy as .xlsx without a password, then index that.`};function gw(e,t){return e.startsWith(t)?e.slice(t.length).trim():e}function _w({filename:e,error:t,status:n,kind:r,onDismiss:i,timeout:a=15e3}){let o=(0,V.useRef)(null);(0,V.useEffect)(()=>(a>0&&(o.current=setTimeout(i,a)),()=>{o.current&&clearTimeout(o.current)}),[i,a]);let s=e.includes(`.`)?`.`+e.split(`.`).pop()?.toLowerCase():``,c=s?lw(s):null,l=t.toLowerCase().includes(`unsupported file type`)||t.toLowerCase().includes(`not supported for indexing`)||t.toLowerCase().includes(`file type not allowed`)||c!==null,u=t.toLowerCase().includes(`fetch`)||t.toLowerCase().includes(`network`)||t.toLowerCase().includes(`connect`),d,f,p,m=oe,h=r?hw[r]:void 0;return h?(d=`"${e}" can't be read`,f=h,p=null,m=An):n===404?(d=`"${e}" doesn't exist`,f=gw(t,`File not found:`),p=null,m=An):n===403?(d=`GAIA can't read files in that location`,f=`${t} Or drop the file here instead (up to 20 MB) and GAIA keeps its own copy.`,p=null,m=An):l&&c?(d=`${c.label} files not supported`,f=c.message,p=pw(c.featureTitle),m=An):l&&!s?(d=`"${e}" has no file extension`,f=gw(t,`File type not allowed:`),p=null,m=An):l?(d=`File type not supported: ${s}`,f=`This file format cannot be indexed. Supported: PDF, DOCX, PPTX, XLSX, EPUB, images (PNG, JPG, WEBP, ...), TXT, MD, CSV, JSON, HTML, XML, YAML, and 30+ code file formats.`,p=pw(`Support ${s} file indexing`),m=An):u?(d=`Connection error`,f=`Could not reach the GAIA server. Make sure the backend is running.`,p=mw(`Upload connection error for ${e}`),m=oe):(d=`Failed to index "${e}"`,f=t||`An unexpected error occurred during indexing.`,p=mw(`Indexing error: ${t.slice(0,80)}`),m=A),(0,U.jsxs)(`div`,{className:`upload-error-toast`,role:`alert`,children:[(0,U.jsx)(m,{size:16}),(0,U.jsxs)(`div`,{className:`upload-error-content`,children:[(0,U.jsx)(`div`,{className:`upload-error-title`,children:d}),(0,U.jsxs)(`div`,{className:`upload-error-detail`,children:[f,p&&` `,p===null?null:l?(0,U.jsx)(`a`,{href:p,target:`_blank`,rel:`noopener noreferrer`,children:`Request this feature →`}):(0,U.jsx)(`a`,{href:p,target:`_blank`,rel:`noopener noreferrer`,children:`Report this issue →`})]})]}),(0,U.jsx)(`button`,{className:`upload-error-dismiss`,onClick:i,"aria-label":`Dismiss`,children:(0,U.jsx)(Bn,{size:14})})]})}function vw(e,t){let n=e=>t.some(t=>t.id===e&&t.configured),r=Wb(e);return r===`google`?n(`google`):r===`microsoft`?n(`microsoft`):r===`microsoft_work`?n(`microsoft_work`):n(`google`)||n(`microsoft`)||n(`microsoft_work`)}function yw(e,t){let n=e=>t.some(t=>t.id===e&&t.configured),r=Wb(e);return r===`google`?`Google`:r===`microsoft`?`Microsoft`:r===`microsoft_work`?`Microsoft 365`:n(`google`)?`Google`:n(`microsoft`)?`Microsoft`:n(`microsoft_work`)?`Microsoft 365`:`Google`}var bw=4e3;function xw({content:e,onRetry:t}){let[n,r]=(0,V.useState)([]),[i,a]=(0,V.useState)(!1),o=(0,V.useCallback)(()=>{Ri().then(e=>r(e.connectors||[])).catch(e=>s.ui.warn(`ConnectorRetryBanner: connector fetch failed`,e))},[]),c=vw(e,n);if((0,V.useEffect)(()=>{o();let e=()=>o();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[o]),(0,V.useEffect)(()=>{if(c)return;let e=setInterval(o,bw);return()=>clearInterval(e)},[c,o]),!c||i)return null;let l=yw(e,n);return(0,U.jsxs)(`div`,{className:`connector-retry-banner`,role:`status`,children:[(0,U.jsx)(ue,{size:14,className:`connector-retry-banner__icon`}),(0,U.jsxs)(`span`,{className:`connector-retry-banner__text`,children:[l,` connected since this reply — ask again to run it now.`]}),(0,U.jsxs)(`button`,{type:`button`,className:`connector-retry-banner__btn`,onClick:()=>{a(!0),t()},children:[(0,U.jsx)(tn,{size:12}),(0,U.jsx)(`span`,{children:`Ask again`})]}),(0,U.jsx)(`button`,{type:`button`,className:`connector-retry-banner__dismiss`,onClick:()=>a(!0),"aria-label":`Dismiss`,children:`×`})]})}var Sw=240,Cw=1e5;function ww({value:e,onChange:t,onSubmit:n,onStop:r,streaming:i=!1,stopping:a=!1,queueWhileStreaming:o=!1,disabledReason:s,attachments:c,placeholder:l,autoFocus:u,inputRef:d,leftControls:f,rightControls:p}){let m=q(),h=(0,V.useRef)(null),g=d??h,_=(0,V.useRef)(null),v=!!s,y=e.trim().length>0||c.hasUploaded,b=c.compose(e.trim()).length,x=b>Cw,C=!v&&(!i||o)&&!c.uploading&&y&&!x,w=s||l||m(`composer.placeholder`);(0,V.useLayoutEffect)(()=>{let e=g.current;if(!e)return;let t=()=>{e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,Sw)}px`};if(t(),typeof ResizeObserver>`u`)return;let n=e.clientWidth,r=new ResizeObserver(()=>{e.clientWidth!==n&&(n=e.clientWidth,t())});return r.observe(e),()=>r.disconnect()},[e,w,g]);let T=(0,V.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),C&&n())},[C,n]),E=(0,V.useCallback)(e=>{e.dataTransfer?.files?.length&&(e.preventDefault(),e.stopPropagation(),c.addFiles(Array.from(e.dataTransfer.files)))},[c]);return(0,U.jsxs)(`div`,{className:`composer${v?` composer-disabled`:``}`,onDrop:E,onDragOver:e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},children:[c.attachments.length>0&&(0,U.jsx)(`ul`,{className:`composer-attachments`,"aria-label":m(`composer.attached`),children:c.attachments.map(e=>(0,U.jsxs)(`li`,{className:`composer-attachment${e.error?` has-error`:``}`,children:[e.isImage&&e.url?(0,U.jsx)(`img`,{src:e.url,alt:``,className:`composer-attachment-thumb`}):(0,U.jsx)(We,{size:14,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`composer-attachment-name`,title:e.name,dir:`auto`,children:e.name}),e.uploading&&(0,U.jsx)(`span`,{className:`composer-attachment-state`,children:m(`composer.uploading`)}),e.error&&(0,U.jsx)(`span`,{className:`composer-attachment-state`,role:`alert`,title:e.error,children:e.error}),(0,U.jsx)(`button`,{type:`button`,className:`composer-icon-btn`,onClick:()=>c.remove(e.id),"aria-label":m(`composer.remove`,{name:e.name}),children:(0,U.jsx)(Bn,{size:12})})]},e.id))}),(0,U.jsx)(`textarea`,{ref:g,className:`composer-input`,value:e,onChange:e=>t(e.target.value),onKeyDown:T,onPaste:e=>{c.handlePaste(e)},placeholder:w,rows:1,disabled:v,autoFocus:u,"aria-label":m(`composer.message`),dir:`auto`}),x&&(0,U.jsxs)(`p`,{className:`composer-limit-error`,role:`alert`,children:[m(`composer.tooLong`,{sent:b.toLocaleString(),max:1e5.toLocaleString()}),` `,m(`composer.tooLongHint`)]}),(0,U.jsxs)(`div`,{className:`composer-row`,children:[(0,U.jsxs)(`div`,{className:`composer-row-left`,children:[(0,U.jsx)(`button`,{type:`button`,className:`composer-icon-btn`,onClick:()=>_.current?.click(),disabled:v,"aria-label":m(`composer.attach`),title:m(`composer.attach`),children:(0,U.jsx)($t,{size:16})}),(0,U.jsx)(`input`,{ref:_,type:`file`,multiple:!0,hidden:!0,onChange:e=>{e.target.files&&c.addFiles(Array.from(e.target.files)),e.target.value=``}}),f]}),(0,U.jsxs)(`div`,{className:`composer-row-right`,children:[p,i&&o&&y&&(0,U.jsx)(`button`,{type:`button`,className:`composer-send`,onClick:n,disabled:!C,"aria-label":m(`composer.queue`),title:m(`composer.queueTitle`),children:(0,U.jsx)(S,{size:16})}),i?(0,U.jsx)(`button`,{type:`button`,className:`composer-send is-stop`,onClick:r,disabled:a,"aria-label":m(`composer.stop`),title:a?m(`composer.stopping`):m.hint(m(`composer.stop`),`Esc`),children:(0,U.jsx)(wn,{size:12,fill:`currentColor`})}):(0,U.jsx)(`button`,{type:`button`,className:`composer-send`,onClick:n,disabled:!C,"aria-label":m(`composer.send`),title:m.hint(m(`composer.send`),`Enter`),children:(0,U.jsx)(S,{size:16})})]})]})]})}var Tw=8,Ew=8;function Dw({label:e,warning:t,children:n,id:r,pinned:i=!1,onUnpin:a,tabIndex:o}){let s=(0,V.useId)(),c=r??s,l=(0,V.useRef)(null),u=(0,V.useRef)(null),[d,f]=(0,V.useState)(!1),p=d||i,[m,h]=(0,V.useState)(null);return(0,V.useLayoutEffect)(()=>{if(!p){h(null);return}let e=l.current?.getBoundingClientRect(),t=u.current?.getBoundingClientRect(),n=l.current?.closest(`[role="dialog"]`)?.getBoundingClientRect()??e;if(!e||!t||!n)return;let r=window.innerWidth,i=window.innerHeight,a,o;n.right+Tw+t.width<=r-Ew?(a=n.right+Tw,o=e.top+e.height/2-t.height/2):n.left-Tw-t.width>=Ew?(a=n.left-Tw-t.width,o=e.top+e.height/2-t.height/2):(a=Math.min(Math.max(Ew,e.right-t.width),r-Ew-t.width),o=e.top-Tw-t.height>=Ew?e.top-Tw-t.height:e.bottom+Tw),o=Math.min(Math.max(Ew,o),i-Ew-t.height),h({left:a,top:o})},[p]),(0,V.useEffect)(()=>{if(!p)return;let e=()=>{f(!1),a?.()};return window.addEventListener(`scroll`,e,!0),()=>window.removeEventListener(`scroll`,e,!0)},[p,a]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{ref:l,type:`button`,className:`info-bubble-icon${t?` is-warning`:``}`,"aria-label":e,tabIndex:o,"aria-describedby":p?c:void 0,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onFocus:()=>f(!0),onBlur:()=>f(!1),onClick:e=>{e.stopPropagation(),f(e=>!e)},onKeyDown:e=>{e.key===`Escape`&&p&&(e.stopPropagation(),f(!1))},children:(0,U.jsx)(mt,{size:13,"aria-hidden":`true`})}),p&&(0,oS.createPortal)((0,U.jsx)(`div`,{ref:u,id:c,role:`tooltip`,className:`info-bubble`,style:m?{left:m.left,top:m.top}:{left:0,top:0,visibility:`hidden`},children:n}),document.body)]})}function Ow(e){return e<.1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function kw(e){return e?`${Ow(e.input_per_million)} in · ${Ow(e.output_per_million)} out per 1M tokens`:`price unknown`}function Aw(e){return`$${e.toFixed(2)}`}var jw=2e3,Mw=`waiting_for_os_permission`,Nw=5;function Pw(e,t){let n=e.rank?`#${e.rank} ${e.note??``}`.trim():null;return t?[n,kw(e.price)].filter(e=>!!e):[ic(e.placement),e.size_gb?`${e.size_gb} GB`:null,e.tokens_per_second?`${Math.round(e.tokens_per_second)} tok/s on this PC`:null,n,e.custom?`added by you`:null].filter(e=>!!e)}function Fw({m:e,onDownload:t,busy:n}){if(sc(e)){let t=Math.round(e.download_progress?.percent??0);return(0,U.jsxs)(`span`,{className:`model-state is-downloading`,title:`Downloading, ${t}%`,children:[(0,U.jsx)(B,{size:12,className:`spin`,"aria-hidden":`true`}),` `,t,`%`]})}let r=oc(e);return r===`not_downloaded`?(0,U.jsx)(`button`,{type:`button`,className:`model-state-btn`,onClick:e=>{e.stopPropagation(),t()},disabled:n,"aria-label":`Download ${e.display_name??e.id}`,title:rc.not_downloaded,tabIndex:-1,children:(0,U.jsx)(Oe,{size:13,"aria-hidden":`true`})}):r===`loaded`?(0,U.jsx)(`span`,{className:`model-state is-loaded`,role:`img`,"aria-label":rc.loaded,title:rc.loaded}):(0,U.jsx)(`span`,{className:`model-state is-ready`,title:rc.downloaded,children:`Ready`})}function Iw(){let e=Ws(e=>e.active),t=Ws(e=>e.select),n=Ws(e=>e.queued),r=Ws(e=>e.queue),i=Ws(e=>e.queueError),a=Ws(e=>e.rememberNames);Ws(e=>e.names);let o=Zs(),s=H(t=>Qs(e,t.sessions,t.currentSessionId)),c=H(e=>e.isStreaming),l=H(e=>e.openSettings),u=(0,V.useRef)(null),[d,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)(null),[h,g]=(0,V.useState)(0),[_,v]=(0,V.useState)(null),[y,b]=(0,V.useState)(null),[x,S]=(0,V.useState)(null),[C,w]=(0,V.useState)(null),[T,E]=(0,V.useState)(null),[D,O]=(0,V.useState)(0),[k,A]=(0,V.useState)(null),j=(0,V.useRef)(0),M=(0,V.useRef)(null),N=(0,V.useId)(),ee=(0,V.useRef)(null),[P,te]=(0,V.useState)(null),[re,I]=(0,V.useState)(null),L=(0,V.useCallback)(()=>I(null),[]),ie=(0,V.useCallback)(()=>f(!1),[]),ae=(0,V.useRef)(!1),se=(0,V.useCallback)(async(e=!1)=>{e||(ae.current=!1,v(null),m(null));try{let{providers:t,lemonade_error:n}=await qa();if(n)throw Error(n);let r=t.filter(e=>!e.remote||e.models_discovered||e.id===`fireworks`||e.registered),i=await Promise.all(r.map(async e=>{if(e.remote&&!e.models_discovered)return{provider:e,models:[]};try{return{provider:e,models:(await $a(e.id)).models}}catch(t){return{provider:e,models:[],error:t instanceof Error?t.message:String(t)}}}));a(i.flatMap(e=>e.models)),g(i.flatMap(e=>e.models).filter(e=>e.available===!1).length),e||(ae.current=!0),m(i.map(e=>({...e,models:e.models.filter(e=>e.available!==!1)})))}catch(e){v(e instanceof Error?e.message:String(e))}},[a]);(0,V.useEffect)(()=>{d&&(b(null),te(null),I(null),se())},[d,se]),(0,V.useEffect)(()=>{if(!d||!p||!ae.current)return;let e=ee.current?.querySelector(`[role="option"][tabindex="0"]`);e&&(ae.current=!1,e.focus(),e.scrollIntoView?.({block:`nearest`}))},[d,p]);let ce=e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;let t=Array.from(ee.current?.querySelectorAll(`[role="option"]:not(:disabled)`)??[]);if(!t.length)return;let n=t.indexOf(document.activeElement),r;switch(e.key){case`ArrowDown`:r=n<0?0:Math.min(n+1,t.length-1);break;case`ArrowUp`:r=n<0?t.length-1:Math.max(n-1,0);break;case`Home`:r=0;break;case`End`:r=t.length-1;break;case`ArrowRight`:case`i`:{let r=n<0?void 0:t[n].dataset.row;if(!r)return;e.preventDefault(),I(t=>e.key===`i`&&t===r?null:r);return}case`ArrowLeft`:e.preventDefault(),I(null);return;default:return}e.preventDefault(),t[r].focus(),t[r].scrollIntoView?.({block:`nearest`})},le=!!p?.some(e=>e.models.some(sc)),ue=!!p?.some(e=>e.provider.key_state===Mw);(0,V.useEffect)(()=>{if(!(d||T)||!(le||T||ue))return;let e=setInterval(()=>{se(!0)},jw);return()=>clearInterval(e)},[d,le,T,ue,se]);let de=(0,V.useCallback)(async e=>{w(e),O(e=>e+1),v(null);try{await Na(e),await se(!0)}catch(t){E(t=>t?.model===e?null:t),v(t instanceof Error?t.message:String(t))}finally{w(null),O(e=>e-1)}},[se]),R=(0,V.useCallback)(async(n,i)=>{if(i.remote&&!e?.remote&&y?.model!==n)return b({model:n,provider:i}),null;if(b(null),c)return r(n===e?.model?null:n),f(!1),null;S(n),v(null);try{return await t(n),A(null),f(!1),null}catch(e){let t=e instanceof Error?e.message:String(e);return v(t),t}finally{S(null)}},[e?.model,e?.remote,y,r,t,c]);(0,V.useEffect)(()=>{if(!T||!p||D>0)return;let{model:e,provider:t}=T,n=()=>(M.current!==p&&(M.current=p,j.current+=1),j.current>=Nw),r=p.flatMap(e=>e.models).find(t=>t.id===e);if(!r){if(!n())return;E(null),A(`${qs(e)} is no longer in the model list, so it wasn't switched to.`);return}if(sc(r)){j.current=0;return}let i=r.download_progress;if(i?.state===`error`)E(null),A(`Downloading ${qs(e)} failed: ${i.message??`no reason given`}`);else if(i?.state!==`complete`&&oc(r)===`not_downloaded`){if(!n())return;E(null),A(`The download of ${qs(e)} never started. Try the download button again.`)}else E(null),R(e,t).then(t=>{t&&A(`${qs(e)} downloaded, but switching to it failed: ${t}`)})},[p,T,D,R]);let z=p?.flatMap(({provider:e,models:t})=>[...e.remote&&!e.models_discovered?[`key:${e.id}`]:[],...t.filter(e=>x===null&&!sc(e)).map(e=>e.id)])??[],pe=n??e?.model,me=P&&z.includes(P)?P:pe&&z.includes(pe)?pe:z[0],he=e=>({role:`option`,tabIndex:e===me?0:-1,"data-row":e,onFocus:()=>te(e),onBlur:()=>I(null)}),_e=o?.remote?ge:o?we:fe,ve=s?qs(s):`Model`,ye=`${ve}${o?` · ${o.label}`:``}`,be=Object.fromEntries((p??[]).map(e=>[e.provider.id,tc(e.models)])),xe=e?.downloaded===!1&&s===e.model,Se=k||i||(n?`${qs(n)} is used from your next message.`:e?.config_error?e.config_error:xe?`${ve} isn't downloaded yet. Open the list to download it.`:o?o.description?.replace(/`/g,``)??(o.remote?`Runs on ${o.label} — chat history leaves this PC`:`Runs on this PC`):Xs);return(0,U.jsxs)(`div`,{className:`composer-chip-wrap`,children:[(0,U.jsxs)(`button`,{ref:u,type:`button`,className:`composer-chip${xe||i||k?` is-warning`:``}`,onClick:()=>f(e=>!e),"aria-haspopup":`dialog`,"aria-expanded":d,title:Se,children:[(0,U.jsx)(_e,{size:13,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`composer-chip-label`,children:ye}),n&&(0,U.jsxs)(`span`,{className:`composer-chip-next`,children:[`→ `,qs(n),` next`]}),xe&&(0,U.jsx)(Oe,{size:12,"aria-label":`Not downloaded`}),k&&(0,U.jsx)(oe,{size:12,"aria-label":`Model switch failed`}),(0,U.jsx)(ne,{size:12,"aria-hidden":`true`})]}),(0,U.jsxs)(ji,{open:d,onClose:ie,anchor:u,label:`Choose a model`,align:`end`,children:[c&&(0,U.jsxs)(`div`,{className:`popover-message`,role:`status`,children:[`This reply keeps `,s?qs(s):`its model`,`. A model you pick here is used from your next message.`]}),k&&(0,U.jsx)(`div`,{className:`popover-message is-error`,role:`alert`,children:k}),i&&(0,U.jsx)(`div`,{className:`popover-message is-error`,role:`alert`,children:i}),_&&(0,U.jsx)(`div`,{className:`popover-message is-error`,role:`alert`,children:_}),!p&&!_&&(0,U.jsxs)(`div`,{className:`popover-message`,children:[(0,U.jsx)(B,{size:13,className:`spin`}),` Loading models…`]}),p&&(0,U.jsx)(`div`,{ref:ee,role:`listbox`,"aria-label":`Models`,onKeyDown:ce,children:p.map(({provider:t,models:r,error:i})=>(0,U.jsxs)(`div`,{role:`group`,"aria-labelledby":`${N}-${t.id}`,children:[(0,U.jsx)(`div`,{className:`popover-heading`,id:`${N}-${t.id}`,children:t.name}),i&&(0,U.jsx)(`div`,{className:`popover-message is-error`,children:i}),t.key_state===Mw?(0,U.jsxs)(`div`,{className:`popover-message`,role:`status`,children:[(0,U.jsx)(B,{size:13,className:`spin`,"aria-hidden":`true`}),` `,t.key_message]}):t.remote&&!t.models_discovered&&(0,U.jsxs)(`button`,{type:`button`,className:`popover-item`,...he(`key:${t.id}`),"aria-selected":!1,onClick:()=>{f(!1),l(`model`,t.id)},children:[(0,U.jsx)(`span`,{className:`popover-item-check`,children:(0,U.jsx)(gt,{size:13,"aria-hidden":`true`})}),(0,U.jsxs)(`span`,{className:`popover-item-body`,children:[(0,U.jsx)(`span`,{className:`popover-item-title`,children:`Add your key`}),(0,U.jsxs)(`span`,{className:`popover-item-note`,children:[`Connect `,t.name,` in Settings`]})]})]}),!i&&r.length===0&&t.models_discovered!==!1&&(0,U.jsx)(`div`,{className:`popover-message`,children:`No models yet.`}),r.map(r=>{let i=Ks(n??e?.model,r.id),a=!t.remote&&oc(r)===`not_downloaded`,o=be[t.id][r.id],s=Pw(r,t.remote),c=`${N}-info-${t.id}-${r.id}`;return(0,U.jsxs)(`div`,{className:`popover-row`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`popover-item`,onClick:()=>{a?(j.current=0,A(null),E({model:r.id,provider:t}),de(r.id)):(E(null),R(r.id,t))},disabled:x!==null||sc(r),...he(r.id),"aria-selected":i,"aria-describedby":re===r.id?c:void 0,children:[(0,U.jsx)(`span`,{className:`popover-item-check`,"aria-hidden":`true`,children:x===r.id?(0,U.jsx)(B,{size:13,className:`spin`}):i?(0,U.jsx)(F,{size:13}):null}),(0,U.jsx)(`span`,{className:`popover-item-body`,children:(0,U.jsx)(`span`,{className:`popover-item-title`,children:o})})]}),(0,U.jsxs)(Dw,{label:`About ${o}`,warning:!!r.placement?.warning,id:c,pinned:re===r.id,onUnpin:L,tabIndex:-1,children:[(0,U.jsx)(`div`,{className:`info-bubble-title`,children:o}),s.length>0&&(0,U.jsx)(`ul`,{className:`info-bubble-lines`,children:s.map(e=>(0,U.jsx)(`li`,{children:e},e))}),r.placement?.warning&&(0,U.jsx)(`ul`,{className:`info-bubble-lines`,children:(0,U.jsx)(`li`,{className:`is-warning`,children:r.placement.warning})}),(0,U.jsx)(`div`,{className:`info-bubble-id`,children:r.id})]}),(0,U.jsx)(`span`,{className:`popover-row-state`,children:!t.remote&&(0,U.jsx)(Fw,{m:r,busy:C!==null,onDownload:()=>void de(r.id)})})]},r.id)})]},t.id))}),y&&(0,U.jsxs)(`div`,{className:`popover-message`,role:`alert`,children:[y.provider.privacy_notice,` `,(0,U.jsxs)(`button`,{type:`button`,className:`link-btn`,onClick:()=>R(y.model,y.provider),children:[`Use `,qs(y.model)]})]}),h>0&&(0,U.jsxs)(`button`,{type:`button`,className:`popover-item`,onClick:()=>{f(!1),l(`model`)},children:[(0,U.jsx)(`span`,{className:`popover-item-check`}),(0,U.jsx)(`span`,{className:`popover-item-body`,children:(0,U.jsxs)(`span`,{className:`popover-item-note`,children:[h,` `,h===1?`model isn’t`:`models aren’t`,` available on this PC — see why in Settings`]})})]}),(0,U.jsx)(`div`,{className:`popover-divider`}),(0,U.jsxs)(`button`,{type:`button`,className:`popover-item`,onClick:()=>{f(!1),l(`model`)},children:[(0,U.jsx)(`span`,{className:`popover-item-check`,children:(0,U.jsx)(St,{size:13,"aria-hidden":`true`})}),(0,U.jsxs)(`span`,{className:`popover-item-body`,children:[(0,U.jsx)(`span`,{className:`popover-item-title`,children:`Add a model from a link…`}),(0,U.jsx)(`span`,{className:`popover-item-note`,children:`Any GGUF chat model on Hugging Face`})]})]}),(0,U.jsxs)(`button`,{type:`button`,className:`popover-item`,onClick:()=>{f(!1),l(`model`)},children:[(0,U.jsx)(`span`,{className:`popover-item-check`}),(0,U.jsx)(`span`,{className:`popover-item-body`,children:(0,U.jsx)(`span`,{className:`popover-item-title`,children:`Providers and keys…`})})]})]})]})}function Lw(e,t,n){if(e==null||!t(e))throw Error(`the server sent no ${n}`);return e}var Rw=e=>e.startsWith(`.`);function zw({onPick:e,onClose:t}){let n=q(),[r,i]=(0,V.useState)(null),[a,o]=(0,V.useState)(``),[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(!1),[d,f]=(0,V.useState)(!1);ki(!0,t);let p=(0,V.useRef)(null);pS(p,!0);let m=(0,V.useCallback)(e=>{u(!0),c(null),Promise.resolve().then(()=>Qo(e)).then(e=>{let t=Lw(e,e=>Array.isArray(e.entries),`folder listing`);i(t),o(t.current_path)}).catch(e=>c(e instanceof _a?e.detail||e.message:String(e))).finally(()=>u(!1))},[]);(0,V.useEffect)(()=>m(),[m]);let h=r?.entries.filter(e=>e.type===`folder`)??[],g=d?h:h.filter(e=>!Rw(e.name));return(0,U.jsx)(`div`,{className:`modal-overlay`,onClick:t,children:(0,U.jsxs)(`div`,{ref:p,className:`modal-panel sp-picker`,role:`dialog`,"aria-modal":`true`,"aria-label":n(`pick.label`),onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(`div`,{className:`modal-header`,children:[(0,U.jsx)(`h3`,{children:n(`pick.title`)}),(0,U.jsx)(`button`,{type:`button`,className:`btn-icon`,onClick:t,"aria-label":n(`sp.closeShort`),children:(0,U.jsx)(Bn,{size:18})})]}),(0,U.jsxs)(`div`,{className:`modal-body sp-picker-body`,children:[(0,U.jsx)(`p`,{className:`sp-meta`,children:n(`pick.note`)}),(0,U.jsxs)(`form`,{className:`sp-picker-path`,onSubmit:e=>{e.preventDefault(),a.trim()&&m(a.trim())},children:[(0,U.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),"aria-label":n(`pick.path`),spellCheck:!1,dir:`ltr`}),(0,U.jsx)(`button`,{type:`submit`,className:`sp-action`,children:n(`pick.go`)})]}),r&&(0,U.jsxs)(`div`,{className:`sp-picker-quick`,children:[r.quick_links.map(e=>(0,U.jsx)(`button`,{type:`button`,className:`sp-action`,onClick:()=>m(e.path),children:e.name},e.path)),(0,U.jsxs)(`label`,{className:`sp-picker-hidden`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>f(e.target.checked)}),n(`pick.showHidden`)]})]}),(0,U.jsxs)(`ul`,{className:`sp-picker-list`,"aria-busy":l,children:[r?.parent_path&&(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>m(r.parent_path??void 0),children:[(0,U.jsx)(S,{size:13,"aria-hidden":`true`}),` `,n(`pick.up`)]})}),g.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>m(e.path),children:[(0,U.jsx)(et,{size:13,"aria-hidden":`true`}),` `,e.name]})},e.path)),r&&g.length===0&&(0,U.jsx)(`li`,{className:`sp-meta`,children:n(h.length>0?`pick.onlyHidden`:`pick.none`)}),l&&(0,U.jsxs)(`li`,{className:`sp-meta`,children:[(0,U.jsx)(B,{size:12,className:`spin`,"aria-hidden":`true`}),` `,n(`pick.loading`)]})]}),s&&(0,U.jsx)(`p`,{className:`sp-error`,role:`alert`,children:s})]}),(0,U.jsxs)(`div`,{className:`sp-picker-actions`,children:[(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:t,children:n(`sp.cancel`)}),(0,U.jsx)(`button`,{type:`button`,className:`btn-primary`,disabled:!r,onClick:()=>r&&e(r.current_path),children:n(`pick.use`)})]})]})})}function Bw(e){let[t,n]=(0,V.useState)(!1),[r,i]=(0,V.useState)(null);return{open:t=>{i(null);let r=window.gaiaAPI?.dialog;r?r.pickFolder(t).then(t=>{t&&e(t)}).catch(e=>i(`Couldn't open the folder picker: ${e instanceof Error?e.message:String(e)}`)):n(!0)},picker:t?(0,U.jsx)(zw,{onPick:t=>{n(!1),e(t)},onClose:()=>n(!1)}):null,error:r}}var Vw=new Map;function Hw(e){let t=Vw.get(e);return t||(t={env:null,error:null,inFlight:null,version:0,listeners:new Set},Vw.set(e,t)),t}function Uw(e,t,n){let r=Hw(e);r.env=t??r.env,r.error=n,r.listeners.forEach(e=>e())}function Ww(e){let t=Hw(e);if(t.inFlight)return t.inFlight;let n=t.version;return t.inFlight=Promise.resolve().then(()=>ws(e)).then(r=>{let i=Lw(r,e=>Array.isArray(e.folders),`chat's environment`);t.version===n&&Uw(e,i,null)}).catch(t=>Uw(e,null,t instanceof Error?t.message:String(t))).finally(()=>{t.inFlight=null}),t.inFlight}function Gw(e){let[,t]=(0,V.useState)(0);(0,V.useEffect)(()=>{let n=Hw(e),r=()=>t(e=>e+1);return n.listeners.add(r),!n.env&&!n.inFlight&&Ww(e),()=>{n.listeners.delete(r)}},[e]);let n=(0,V.useCallback)(()=>Ww(e),[e]),r=(0,V.useCallback)(async t=>{let n=await t();return Hw(e).version+=1,Uw(e,n,null),n},[e]),i=Hw(e);return{env:i.env,error:i.error,refresh:n,change:r}}var Kw=e=>e.split(/[\\/]/).filter(Boolean).pop()??e;function qw({folder:e,disabled:t}){let n=H(e=>e.draftFolder),r=H(e=>e.setDraftFolder),{open:i,picker:a,error:o}=Bw(r),s=e.gaia_folder?`GAIA works in its own folder, ${e.path}.`:`GAIA works in ${e.path}.`;return e.choosable?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`button`,{type:`button`,className:`new-chat-folder is-button${n?` is-on`:``}`,onClick:()=>i(e.path),disabled:t,"aria-haspopup":`dialog`,"aria-label":n?`Folder for this chat: ${e.name}, plus ${Kw(n)}`:`Folder for this chat: ${e.name}`,title:n?`This chat can read and write ${n}. Click to pick another folder.`:`${s} Click to give this chat another folder.`,children:[(0,U.jsx)(et,{size:13,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`new-chat-folder-name`,children:n?`${e.name} + ${Kw(n)}`:e.name}),(0,U.jsx)(ne,{size:12,"aria-hidden":`true`})]}),n&&(0,U.jsx)(`button`,{type:`button`,className:`btn-icon-sm new-chat-folder-clear`,onClick:()=>r(null),disabled:t,"aria-label":`Don't give this chat ${Kw(n)}`,title:`Don't add this folder`,children:(0,U.jsx)(Bn,{size:12})}),o&&(0,U.jsx)(`span`,{className:`new-chat-folder-error`,role:`alert`,children:o}),a]}):(0,U.jsxs)(`span`,{className:`new-chat-folder`,title:e.gaia_folder?`${s} Attach a file or start GAIA from a project folder to work there.`:s,children:[(0,U.jsx)(et,{size:13,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`new-chat-folder-name`,children:e.name})]})}function Jw({sessionId:e,onOpen:t}){let{env:n}=Gw(e),r=n?.folders.find(e=>e.source===`working_folder`);if(!r)return null;let i=Kw(r.path);return(0,U.jsxs)(`button`,{type:`button`,className:`composer-chip folder-chip`,title:`GAIA works in ${r.path}`,"aria-label":`Working folder ${i}, show the chat's folders`,onClick:t,children:[(0,U.jsx)(et,{size:13,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`composer-chip-label`,children:i})]})}var Yw=`gaia:permission-mode`;function Xw(e,t){window.dispatchEvent(new CustomEvent(Yw,{detail:{sessionId:e,mode:t}}))}function Zw(e,t){let n=(0,V.useRef)(t);n.current=t,(0,V.useEffect)(()=>{if(!e)return;let t=t=>{let r=t.detail;r?.sessionId===e&&n.current(r.mode)};return window.addEventListener(Yw,t),()=>window.removeEventListener(Yw,t)},[e])}var Qw=[{mode:`ask`,label:`perm.ask`,note:`perm.askNote`},{mode:`full_access`,label:`perm.full`,note:`perm.fullNote`}];function $w({sessionId:e,disabled:t}){let n=q(),r=H(e=>e.draftPermissionMode),i=H(e=>e.setDraftPermissionMode),[a,o]=(0,V.useState)(e?`ask`:r),[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)(!1),[d,f]=(0,V.useState)(null),p=(0,V.useRef)(null);(0,V.useEffect)(()=>{if(!e){o(r);return}let t=!1;return ca(e).then(e=>{t||o(e.mode)}).catch(e=>{t||f(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e,r]),Zw(e,o);let m=(0,V.useCallback)(async t=>{if(t===`full_access`&&!l)u(!0);else{f(null);try{if(e){let n=(await da(e,t)).mode;o(n),Xw(e,n)}else i(t),o(t);c(!1)}catch(t){f(t instanceof Error?t.message:String(t)),e&&ca(e).then(e=>o(e.mode)).catch(e=>f(t=>`${t??``} Couldn't re-read the saved mode: ${e instanceof Error?e.message:String(e)}`.trim()))}finally{u(!1)}}},[l,e,i]),h=a===`full_access`,g=h?un:fn;return(0,U.jsxs)(`div`,{className:`composer-chip-wrap`,children:[(0,U.jsxs)(`button`,{ref:p,type:`button`,className:`composer-chip${h?` is-warning`:``}`,onClick:()=>{u(!1),c(e=>!e)},disabled:t,"aria-haspopup":`dialog`,"aria-expanded":s,"aria-label":n(`perm.chipAria`,{mode:Lr(h?`perm.fullLower`:`perm.askLower`)}),children:[(0,U.jsx)(g,{size:13,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`composer-chip-label`,children:n(h?`perm.full`:`env.ask`)}),(0,U.jsx)(ne,{size:12,"aria-hidden":`true`})]}),(0,U.jsxs)(ji,{open:s,onClose:()=>c(!1),anchor:p,label:n(`env.permission`),children:[Qw.map(e=>(0,U.jsxs)(`button`,{type:`button`,className:`popover-item`,onClick:()=>m(e.mode),"aria-pressed":a===e.mode,children:[(0,U.jsx)(`span`,{className:`popover-item-check`,"aria-hidden":`true`,children:a===e.mode&&(0,U.jsx)(F,{size:13})}),(0,U.jsxs)(`span`,{className:`popover-item-body`,children:[(0,U.jsx)(`span`,{className:`popover-item-title`,children:n(e.label)}),(0,U.jsx)(`span`,{className:`popover-item-note`,children:n(e.note)})]})]},e.mode)),l&&(0,U.jsxs)(`div`,{className:`popover-message`,role:`alert`,children:[n(`env.fullAccessWarn`),` `,(0,U.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>m(`full_access`),children:n(`env.turnOn`)})]}),d&&(0,U.jsx)(`div`,{className:`popover-message is-error`,role:`alert`,children:d})]})]})}var eT={sending:`Adding to the running reply…`,delivered:`Added to the running reply. GAIA reads it at its next step.`,queued:`Queued. Sends when this reply ends.`};function tT(e,t){return e?eT.queued:t?`GAIA is still busy in this chat. Trying again in a few seconds.`:`Sending next.`}function nT({items:e,onRemove:t,onSteer:n,onRetry:r,replying:i=!0,busyRetry:a=!1}){let o=e.filter(e=>e.state!==`starting`);return o.length===0?null:(0,U.jsx)(`ul`,{className:`queued-messages`,"aria-label":`Messages waiting to send`,"aria-live":`polite`,children:o.map(e=>(0,U.jsxs)(`li`,{className:`queued-message is-${e.state}`,children:[e.state===`failed`?(0,U.jsx)(oe,{size:12,"aria-hidden":`true`}):e.state===`queued`?(0,U.jsx)(me,{size:12,"aria-hidden":`true`}):(0,U.jsx)(Se,{size:12,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`queued-message-text`,title:e.text,children:e.text}),(0,U.jsx)(`span`,{className:`queued-message-state`,title:e.error,children:e.state===`failed`?`Not sent. ${e.error??``}`.trim():e.state===`queued`?i&&e.note||tT(i,a):eT[e.state]}),e.state===`failed`&&(0,U.jsxs)(`button`,{type:`button`,className:`queued-message-steer`,onClick:()=>r(e.id),"aria-label":`Send again: ${e.text}`,children:[(0,U.jsx)(rn,{size:11,"aria-hidden":`true`}),` Send again`]}),e.state===`queued`&&n&&(0,U.jsx)(`button`,{type:`button`,className:`queued-message-steer`,onClick:()=>n(e.id),title:`GAIA reads it at its next step, without starting over. It may not answer it separately.`,children:`Add to this reply`}),(e.state===`queued`||e.state===`failed`)&&(0,U.jsx)(`button`,{type:`button`,className:`queued-message-remove`,onClick:()=>t(e.id),"aria-label":`Remove queued message: ${e.text}`,title:`Remove`,children:(0,U.jsx)(Bn,{size:12})})]},e.id))})}var rT=e=>e.toLocaleString(`en-US`);function iT({n:e}){let t=q();if(e==null)return(0,U.jsx)(`span`,{className:`cp-unknown`,children:t(`ctx.unknown`)});let n=e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(+(e<1e4))}K`:`${(e/1e6).toFixed(1).replace(/\.0$/,``)}M`;return(0,U.jsx)(`span`,{title:t(`ctx.tokens`,{n:rT(e)}),dir:`ltr`,children:n})}function aT({s:e}){let t=q();if(e==null)return(0,U.jsx)(`span`,{className:`cp-unknown`,children:t(`ctx.unknown`)});let n=e<.1?e===0?`0 s`:`<0.1 s`:e<10?`${e.toFixed(1)} s`:`${Math.round(e)} s`;return(0,U.jsx)(`span`,{title:`${(e*1e3).toFixed(0)} ms`,dir:`ltr`,children:n})}function oT({r:e}){let t=q();return e==null?(0,U.jsx)(`span`,{className:`cp-unknown`,children:t(`ctx.unknown`)}):(0,U.jsx)(`span`,{title:t(`ctx.rateTitle`,{n:e}),children:t(`ctx.rate`,{n:Math.round(e).toLocaleString(`en-US`)})})}var sT=(e,t)=>t>0?Math.round(e/t*100):0,cT=(e,t)=>{let n=sT(e,t);return n===0&&e>0?`<1`:String(n)},lT=(e,t)=>t&&e!=null?Math.floor(e/t*100):null,uT=256;function dT(e,t=Cl){if(e.provider===`unknown`)return t(`ctx.unknown`);if(e.provider===`cloud`)return t(`ctx.cloud`);if(e.provider!==`local`)return t(`ctx.cloudVia`,{provider:nc(e.provider)});if(!e.device)return e.loaded===!1?t(`ctx.notLoadedNow`):t(`ctx.unknown`);let n=e.device.toUpperCase(),r=e.backend===`npu`?`FLM`:e.backend;return r&&r!==e.device?`${n} · ${r.charAt(0).toUpperCase()}${r.slice(1)}`:n}function fT({label:e,children:t,hint:n}){return(0,U.jsxs)(`div`,{className:`cp-row`,title:n,children:[(0,U.jsx)(`dt`,{children:e}),(0,U.jsx)(`dd`,{children:t})]})}function pT({t:e}){let t=q();if(e.model_seconds==null||e.gaia_seconds==null)return(0,U.jsxs)(fT,{label:t(`ctx.took`),children:[(0,U.jsx)(aT,{s:e.wall_seconds}),` · `,t.bare(`ctx.split`),` `,(0,U.jsx)(`span`,{className:`cp-unknown`,children:t(`ctx.unknown`)})]});let n=[{key:`model`,label:t(`ctx.inModel`),s:e.model_seconds},{key:`tools`,label:t(`ctx.runningTools`),s:e.tool_seconds},{key:`waiting`,label:t(`ctx.waitingOnYou`),s:e.waiting_seconds},{key:`gaia`,label:t(`ctx.gaiaItself`),s:e.own_seconds??0}];return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(fT,{label:t(`ctx.took`),hint:t(`ctx.tookHint`),children:(0,U.jsx)(aT,{s:e.wall_seconds})}),(0,U.jsx)(`div`,{className:`cp-stack`,"aria-hidden":`true`,children:n.map(t=>(0,U.jsx)(`span`,{className:`cp-time-${t.key}`,style:{width:`${sT(t.s,e.wall_seconds)}%`}},t.key))}),(0,U.jsxs)(`dl`,{className:`cp-rows cp-indent`,children:[(0,U.jsx)(fT,{label:t(`ctx.inModel`),children:(0,U.jsx)(aT,{s:e.model_seconds})}),(0,U.jsx)(fT,{label:t(`ctx.inGaia`),hint:t(`ctx.inGaiaHint`),children:(0,U.jsx)(aT,{s:e.gaia_seconds})}),n.slice(1).filter(e=>e.s>0).map(e=>(0,U.jsxs)(fT,{label:`· ${e.label}`,children:[(0,U.jsx)(`span`,{className:`swatch cp-time-${e.key}`,"aria-hidden":`true`}),` `,(0,U.jsx)(aT,{s:e.s})]},e.key))]})]})}function mT({why:e}){let t=q();return(0,U.jsx)(`span`,{className:`cp-unknown`,title:e,children:t(`ctx.unknown`)})}var hT={server:`ctx.src.server`,client:`ctx.src.client`};function gT(e,t){return e?t(hT[e]):void 0}function _T({turn:e}){let t=q(),n=lT(e.tokens_cached,e.tokens_in),r=e.unknown??{},i=e.tools.map(e=>`${e.name??t(`ctx.toolOutside`)}: ${e.seconds??`?`} s`).join(`
|
|
61
|
+
`);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(pT,{t:e.time}),(0,U.jsxs)(`dl`,{className:`cp-rows`,children:[(0,U.jsx)(fT,{label:t(`ctx.firstWord`),hint:gT(e.first_token_source,t),children:e.first_token_seconds==null?(0,U.jsx)(mT,{why:r.first_token_seconds}):(0,U.jsxs)(U.Fragment,{children:[t.bare(`ctx.in`),` `,(0,U.jsx)(aT,{s:e.first_token_seconds})]})}),(0,U.jsx)(fT,{label:t(`ctx.readingPrompt`),hint:t(`ctx.readingHint`),children:e.tokens_new!=null&&e.tokens_new<uT?(0,U.jsx)(`span`,{title:t(`ctx.tooFewTitle`),children:t(`ctx.onlyNew`,{n:e.tokens_new})}):e.prefill_tokens_per_second==null?(0,U.jsx)(mT,{why:r.prefill_tokens_per_second}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(oT,{r:e.prefill_tokens_per_second}),e.prefill_source===`client`&&(0,U.jsx)(`span`,{className:`cp-chip`,title:t(`ctx.approxTitle`),children:t(`ctx.approx`)})]})}),(0,U.jsx)(fT,{label:t(`ctx.writing`),hint:gT(e.generation_source,t)??t(`ctx.writingHint`),children:e.generation_tokens_per_second==null?(0,U.jsx)(mT,{why:r.generation_tokens_per_second}):(0,U.jsx)(oT,{r:e.generation_tokens_per_second})}),(0,U.jsx)(fT,{label:t(`ctx.tokensInOut`),hint:r.tokens,children:(0,U.jsxs)(`span`,{dir:`ltr`,children:[(0,U.jsx)(iT,{n:e.tokens_in}),` → `,(0,U.jsx)(iT,{n:e.tokens_out})]})}),(0,U.jsx)(fT,{label:t(`ctx.cache`),hint:t(`ctx.cacheHint`),children:e.tokens_cached==null?(0,U.jsx)(mT,{why:r.tokens_cached}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(iT,{n:e.tokens_cached}),n!=null&&` (${n}%)`]})}),(0,U.jsx)(fT,{label:t(`ctx.modelCalls`),children:e.model_calls}),(0,U.jsx)(fT,{label:t(`ctx.toolCalls`),hint:i||void 0,children:e.tool_calls===0&&!e.tool_seconds_total?t(`ctx.none`):(0,U.jsxs)(U.Fragment,{children:[e.tool_calls,` · `,(0,U.jsx)(aT,{s:e.tool_seconds_total??0})]})}),(0,U.jsx)(fT,{label:t(`ctx.loads`),children:e.loads.length===0?t(`ctx.none`):(0,U.jsxs)(`span`,{title:e.loads.map(e=>`${e.model}${e.replaced?.length?` replaced ${e.replaced.join(`, `)}`:``}: ${e.seconds} s`).join(`
|
|
62
|
+
`),children:[e.loads.length,` · `,(0,U.jsx)(aT,{s:e.loads.reduce((e,t)=>e+t.seconds,0)})]})}),(0,U.jsx)(fT,{label:t(`rail.cost`),children:(0,U.jsx)(vT,{cost:e.cost})})]})]})}function vT({cost:e}){let t=q();return e.kind===`local`?(0,U.jsx)(`span`,{title:t(`ctx.costLocalTitle`),children:t(`ctx.costLocal`)}):e.kind===`estimate`&&e.usd!=null?(0,U.jsx)(`span`,{title:t(`ctx.listPriceTitle`,{usd:e.usd}),children:t(`ctx.about`,{usd:e.usd<.01?e.usd.toFixed(4):e.usd.toFixed(2)})}):(0,U.jsx)(`span`,{className:`cp-unknown`,children:t(`ctx.unknown`)})}function yT({totals:e}){let t=q(),n=lT(e.tokens_cached,e.tokens_in),r=(0,U.jsx)(`span`,{className:`cp-unknown`,children:t(`ctx.unknown`)});return(0,U.jsxs)(`dl`,{className:`cp-rows`,children:[(0,U.jsx)(fT,{label:t(`ctx.turns`),children:e.turns}),(0,U.jsx)(fT,{label:t(`ctx.totalTime`),children:(0,U.jsx)(aT,{s:e.wall_seconds})}),(0,U.jsx)(fT,{label:t(`ctx.inModel`),children:(0,U.jsx)(aT,{s:e.model_seconds})}),(0,U.jsx)(fT,{label:t(`ctx.inGaia`),children:(0,U.jsx)(aT,{s:e.gaia_seconds})}),(0,U.jsx)(fT,{label:t(`ctx.tokensInOut`),children:(0,U.jsxs)(`span`,{dir:`ltr`,children:[(0,U.jsx)(iT,{n:e.tokens_in}),` → `,(0,U.jsx)(iT,{n:e.tokens_out})]})}),(0,U.jsx)(fT,{label:t(`ctx.cache`),children:e.tokens_cached==null?r:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(iT,{n:e.tokens_cached}),n!=null&&` (${n}%)`]})}),(0,U.jsx)(fT,{label:t(`ctx.toolCalls`),children:e.tool_calls??r}),(0,U.jsx)(fT,{label:t(`ctx.loads`),children:e.loads===0?t(`ctx.none`):(0,U.jsxs)(U.Fragment,{children:[e.loads,` · `,(0,U.jsx)(aT,{s:e.load_seconds})]})}),(0,U.jsx)(fT,{label:t(`rail.cost`),children:e.usd==null?r:e.unpriced_turns>0?(0,U.jsx)(`span`,{title:t(`ctx.unpricedTitle`,{n:e.unpriced_turns}),children:t(`ctx.unpriced`,{usd:e.usd.toFixed(2),n:e.unpriced_turns})}):e.usd===0?`$0`:t(`ctx.about`,{usd:e.usd.toFixed(2)})})]})}function bT({usage:e}){let t=q(),n=e.context_state?.put_away,r=e.context_state?.summarized;return(0,U.jsxs)(`div`,{className:`cp-full`,children:[(0,U.jsxs)(`dl`,{className:`cp-rows`,children:[(0,U.jsx)(fT,{label:t(`ctx.live`),children:(0,U.jsx)(iT,{n:e.used})}),n&&n.results>0&&(0,U.jsxs)(fT,{label:t(`ctx.putAway`),hint:t(`ctx.putAwayHint`),children:[t.plural(`ctx.results`,n.results),` · `,(0,U.jsx)(iT,{n:n.tokens})]}),r&&r.turns>0&&(0,U.jsxs)(fT,{label:t(`ctx.summarized`),hint:t(`ctx.summarizedHint`),children:[t.plural(`ctx.earlier`,r.turns),` · `,(0,U.jsx)(iT,{n:r.tokens}),` → `,(0,U.jsx)(iT,{n:r.summary_tokens})]})]}),r&&r.turns>0&&(0,U.jsx)(`p`,{className:`cp-note cp-summarized`,children:t(`ctx.summarizedNote`)}),e.at_risk.length>0&&(0,U.jsx)(`p`,{className:`cp-warning`,role:`status`,children:t(`ctx.filling`)})]})}function xT({sessionId:e,busy:t,onUsage:n}){let r=q(),[i,a]=(0,V.useState)(null),[o,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(null),[d,f]=(0,V.useState)(null),[p,m]=(0,V.useState)(null),[h,g]=(0,V.useState)(`turn`),_=(0,V.useRef)(n);_.current=n;let v=(0,V.useCallback)(()=>{let t=!1,n=(n,r)=>i=>{t||(s.chat.error(`Could not read the ${n} for session=${e}`,i),r(i instanceof Error?i.message:String(i)))};return ta(e).then(e=>{t||(e.available?(a(e),c(null),_.current?.(e)):(a(null),c(e.reason)),f(null))}).catch(n(`context usage`,f)),na(e).then(e=>{t||(u(e),m(null))}).catch(n(`performance`,m)),()=>{t=!0}},[e]);(0,V.useEffect)(()=>v(),[v]);let y=(0,V.useRef)(t);(0,V.useEffect)(()=>{let e=y.current&&!t;return y.current=t,e?v():void 0},[t,v]);let b=l?.turns[l.turns.length-1]??null,x=b&&b.message_id===l?.latest_message_id?b:null,S=i?Math.max(0,i.window-i.used):0;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`section`,{"aria-labelledby":`cp-context`,children:[(0,U.jsx)(`h3`,{id:`cp-context`,children:r(`ctx.context`)}),d&&(0,U.jsx)(`p`,{className:`cp-error`,role:`alert`,children:d}),!i&&!d&&(0,U.jsx)(`p`,{className:`cp-note`,children:o??r(`ctx.measuring`)}),i&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`cp-lead`,children:[(0,U.jsx)(`strong`,{children:r(`ctx.used`,{pct:sT(i.used,i.window)})}),` · `,(0,U.jsx)(iT,{n:i.used}),` `,r.bare(`ctx.of`),` `,(0,U.jsx)(iT,{n:i.window}),` `,r.bare(`ctx.tokensWord`),i.model&&(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsx)(`span`,{className:`cp-model`,dir:`ltr`,children:i.model})]}),i.model_window!=null&&i.model_window>i.window&&(0,U.jsxs)(`span`,{className:`cp-window-note`,title:r(`ctx.windowTitle`),children:[` `,`· `,r.bare(`ctx.gaiaUses`),` `,(0,U.jsx)(iT,{n:i.window}),` `,r.bare(`ctx.ofModel`),` `,(0,U.jsx)(iT,{n:i.model_window})]}),i.tokenizer&&!i.tokenizer.exact&&(0,U.jsx)(`span`,{className:`cp-chip`,title:i.tokenizer.reason,children:r(`ctx.approx`)})]}),(0,U.jsx)(`div`,{className:`cp-stack`,"aria-hidden":`true`,children:(i.categories??[]).map(e=>(0,U.jsx)(`span`,{className:`cp-cat-${e.key}`,style:{width:`${e.tokens/i.window*100}%`}},e.key))}),(0,U.jsxs)(`dl`,{className:`cp-rows`,children:[(i.categories??[]).map(e=>(0,U.jsxs)(`div`,{className:`cp-row`,children:[(0,U.jsxs)(`dt`,{children:[(0,U.jsx)(`span`,{className:`swatch cp-cat-${e.key}`,"aria-hidden":`true`}),e.label]}),(0,U.jsxs)(`dd`,{children:[(0,U.jsx)(iT,{n:e.tokens}),` `,(0,U.jsxs)(`span`,{className:`cp-pct`,children:[cT(e.tokens,i.window),`%`]})]})]},e.key)),(0,U.jsxs)(`div`,{className:`cp-row is-quiet`,children:[(0,U.jsxs)(`dt`,{children:[(0,U.jsx)(`span`,{className:`swatch cp-cat-free`,"aria-hidden":`true`}),r(`ctx.freeRow`)]}),(0,U.jsxs)(`dd`,{children:[(0,U.jsx)(iT,{n:S}),` `,(0,U.jsxs)(`span`,{className:`cp-pct`,children:[sT(S,i.window),`%`]})]})]}),(0,U.jsxs)(`div`,{className:`cp-row is-quiet cp-indent`,children:[(0,U.jsx)(`dt`,{children:r(`ctx.reserve`)}),(0,U.jsx)(`dd`,{children:(0,U.jsx)(iT,{n:Math.min(S,i.reply_reserve)})})]})]}),(0,U.jsxs)(`p`,{className:`cp-note`,children:[i.tokenizer?.exact?r(`ctx.exactTokenizer`,{model:i.tokenizer.model}):r(`ctx.estimated`,{reason:i.tokenizer?.reason??Lr(`ctx.sharedTokenizer`)}),x?.last_prompt_tokens!=null&&(0,U.jsxs)(U.Fragment,{children:[` `,r(`ctx.lastRequest`,{n:rT(x.last_prompt_tokens)})]})]}),i.tool_loading&&i.tool_loading.on_demand.length>0&&(0,U.jsxs)(`details`,{className:`cp-details`,children:[(0,U.jsx)(`summary`,{children:r(`ctx.onDemand`,{n:i.tool_loading.on_demand.length})}),(0,U.jsx)(`p`,{className:`cp-note`,children:r(`ctx.sentNow`,{n:i.tool_loading.loaded.length})}),(0,U.jsx)(`ul`,{className:`cp-tools`,children:i.tool_loading.on_demand.map(e=>(0,U.jsx)(`li`,{children:e},e))})]}),(0,U.jsx)(bT,{usage:i})]})]}),(0,U.jsxs)(`section`,{"aria-labelledby":`cp-hood`,children:[(0,U.jsxs)(`div`,{className:`cp-section-head`,children:[(0,U.jsx)(`h3`,{id:`cp-hood`,children:r(`ctx.hood`)}),(0,U.jsxs)(`div`,{className:`cp-toggle`,role:`group`,"aria-label":r(`ctx.show`),children:[(0,U.jsx)(`button`,{type:`button`,"aria-pressed":h===`turn`,onClick:()=>g(`turn`),children:r(`ctx.lastTurn`)}),(0,U.jsx)(`button`,{type:`button`,"aria-pressed":h===`chat`,onClick:()=>g(`chat`),children:r(`sp.title`)})]})]}),l&&(0,U.jsxs)(`dl`,{className:`cp-rows`,children:[(0,U.jsx)(fT,{label:r(`env.runsOn`),hint:l.now.error??void 0,children:dT(l.now,r)}),l.now.provider===`local`&&(0,U.jsxs)(fT,{label:r(`ctx.memory`),hint:r(`ctx.memoryHint`),children:[l.now.weights_gb==null?(0,U.jsx)(`span`,{className:`cp-unknown`,children:r(`ctx.unknown`)}):(0,U.jsxs)(U.Fragment,{children:[r(`ctx.gbModel`,{gb:l.now.weights_gb.toFixed(1)}),l.now.kv_cache_gb!=null&&` + ${r(`ctx.gbCache`,{gb:l.now.kv_cache_gb.toFixed(1)})}`]}),` · `,l.now.free_gb==null?(0,U.jsx)(`span`,{className:`cp-unknown`,children:r(`ctx.freeUnknown`)}):r(`env.free`,{gb:l.now.free_gb.toFixed(1)})]})]}),p&&(0,U.jsx)(`p`,{className:`cp-error`,role:`alert`,children:p}),!l&&!p&&(0,U.jsx)(`p`,{className:`cp-note`,children:r(`ctx.measuring`)}),l&&h===`turn`&&(x?(0,U.jsx)(_T,{turn:x}):(0,U.jsx)(`p`,{className:`cp-note`,children:l.latest_message_id==null?r(`ctx.afterNext`):(0,U.jsxs)(U.Fragment,{children:[r.bare(`ctx.latestAnswer`),` `,(0,U.jsx)(`span`,{className:`cp-unknown`,children:r(`ctx.unknown`)}),`. `,r.bare(`ctx.notMeasured`)]})})),l&&h===`chat`&&(0,U.jsx)(yT,{totals:l.totals})]})]})}function ST({sessionId:e,busy:t,onClose:n,onUsage:r}){let i=q(),a=(0,V.useRef)(null),o=(0,V.useRef)(n);o.current=n,(0,V.useEffect)(()=>{a.current?.focus()},[]),ki(!0,(0,V.useCallback)(()=>o.current(),[]));let s=(0,V.useRef)(null);return pS(s,!0),(0,U.jsx)(`div`,{className:`cp-overlay`,onClick:n,children:(0,U.jsxs)(`aside`,{ref:s,className:`cp-sheet`,role:`dialog`,"aria-modal":`true`,"aria-label":i(`ctx.sheetAria`),onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(`header`,{className:`cp-header`,children:[(0,U.jsx)(`h2`,{children:i(`sp.section.context`)}),(0,U.jsx)(`button`,{ref:a,type:`button`,className:`cp-icon`,onClick:n,"aria-label":i(`sp.closeShort`),children:(0,U.jsx)(Bn,{size:16})})]}),(0,U.jsx)(`div`,{className:`cp-body`,children:(0,U.jsx)(xT,{sessionId:e,busy:t,onUsage:r})})]})})}function CT(e){return e<1e3?String(e):`${(e/1e3).toFixed(+(e<1e4))}K`}var wT=[{key:`system`,label:`System prompt`},{key:`tools`,label:`Tools`},{key:`documents`,label:`Documents`},{key:`history`,label:`Conversation`},{key:`query`,label:`Your message`}];function TT({usage:e,unavailable:t,sessionId:n,busy:r=!1,onUsage:i,onDetails:a}){let o=(0,V.useRef)(null),[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)(!1),d=l&&n?(0,U.jsx)(ST,{sessionId:n,busy:r,onUsage:i,onClose:()=>u(!1)}):null;if(!e)return t?(0,U.jsxs)(`span`,{className:`context-meter is-empty`,title:t,children:[(0,U.jsx)(`span`,{className:`context-meter-bar`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{style:{width:0}})}),(0,U.jsx)(`span`,{className:`context-meter-label`,children:`Context`})]}):null;let f=Math.min(100,Math.round(e.used/e.window*100)),p=e.at_risk.length>0,m=Math.max(0,e.window-e.used-e.reply_reserve);return(0,U.jsxs)(`div`,{className:`composer-chip-wrap context-meter-wrap`,children:[(0,U.jsxs)(`button`,{ref:o,type:`button`,className:`context-meter${p?` is-warning`:``}`,onClick:()=>c(e=>!e),"aria-expanded":s,"aria-label":`Context ${f}% full: ${CT(e.used)} of ${CT(e.window)} tokens`,title:`How full the model's context window is`,children:[(0,U.jsx)(`span`,{className:`context-meter-bar`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{style:{width:`${f}%`}})}),(0,U.jsxs)(`span`,{className:`context-meter-label`,children:[f,`%`]})]}),(0,U.jsx)(ji,{open:s,onClose:()=>c(!1),anchor:o,label:`Context window`,align:`end`,children:(0,U.jsxs)(`div`,{className:`context-meter-panel`,children:[(0,U.jsxs)(`div`,{className:`context-meter-head`,children:[(0,U.jsx)(`strong`,{children:CT(e.used)}),` of `,CT(e.window),` tokens`]}),(0,U.jsx)(`div`,{className:`context-meter-stack`,"aria-hidden":`true`,children:wT.map(({key:t})=>(0,U.jsx)(`span`,{className:`part-${t}`,style:{width:`${e[t]/e.window*100}%`}},t))}),(0,U.jsxs)(`dl`,{className:`context-meter-rows`,children:[wT.filter(({key:t})=>t!==`query`||e.query>0).map(({key:t,label:n})=>(0,U.jsxs)(`div`,{className:`context-meter-row`,children:[(0,U.jsxs)(`dt`,{children:[(0,U.jsx)(`span`,{className:`swatch part-${t}`,"aria-hidden":`true`}),n]}),(0,U.jsx)(`dd`,{children:CT(e[t])})]},t)),(0,U.jsxs)(`div`,{className:`context-meter-row is-quiet`,children:[(0,U.jsx)(`dt`,{children:`Kept free for the reply`}),(0,U.jsx)(`dd`,{children:CT(e.reply_reserve)})]}),(0,U.jsxs)(`div`,{className:`context-meter-row is-quiet`,children:[(0,U.jsx)(`dt`,{children:`Free`}),(0,U.jsx)(`dd`,{children:CT(m)})]})]}),(0,U.jsxs)(`p`,{className:`context-meter-note`,children:[e.turns_in_view,` earlier `,e.turns_in_view===1?`turn is`:`turns are`,` in view`,e.turns_hidden>0&&`; ${e.turns_hidden} older ${e.turns_hidden===1?`is`:`are`} out of view`,`.`,` `,e.tokenizer?.exact?`Counted with the model's tokenizer.`:`Estimates.`,` `,`Older turns stay saved and can be recalled.`]}),n&&(0,U.jsx)(`button`,{type:`button`,className:`context-meter-details`,onClick:()=>{c(!1),a?a():u(!0)},children:`Details: context & performance`})]})}),d]})}function ET({usage:e}){if(!e||e.at_risk.length===0)return null;let t=e.at_risk.length;return(0,U.jsxs)(`div`,{className:`context-warning`,role:`status`,children:[(0,U.jsx)(An,{size:13,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{children:[`The conversation is filling the model's context. The oldest`,t===1?` turn`:` ${t} turns`,` may drop out of the model's view next:`,` `,e.at_risk.map((e,t)=>(0,U.jsxs)(`span`,{children:[t>0&&`, `,(0,U.jsx)(`q`,{children:e})]},t)),`. They stay saved, and you can ask GAIA to recall them.`]})]})}async function DT(){let{providers:e,lemonade_error:t}=await qa();if(t)throw Error(t);return(await Promise.all(e.filter(e=>!e.remote).map(e=>$a(e.id)))).flatMap(e=>e.models.filter(e=>e.downloaded).map(e=>({id:e.id,name:e.display_name??qs(e.id)})))}function OT({answeredBy:e,onPick:t}){let n=(0,V.useRef)(null),r=q(),[i,a]=(0,V.useState)(!1),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(null),u=(0,V.useCallback)(async()=>{s(null),l(null);try{s(await DT())}catch(e){l(e instanceof Error?e.message:String(e))}},[]);(0,V.useEffect)(()=>{i&&u()},[i,u]);let d=o?.filter(t=>t.id!==e)??[];return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{ref:n,type:`button`,className:`msg-action-btn`,onClick:()=>a(e=>!e),title:r(`retry.button`),"aria-label":r(`retry.button`),"aria-expanded":i,children:(0,U.jsx)(gn,{size:12})}),(0,U.jsx)(ji,{open:i,onClose:()=>a(!1),anchor:n,label:`Retry with`,placement:`below`,align:`end`,children:(0,U.jsxs)(`div`,{className:`retry-menu`,children:[(0,U.jsx)(`div`,{className:`retry-menu-head`,children:r(`retry.head`)}),c&&(0,U.jsx)(`div`,{className:`retry-menu-error`,role:`alert`,children:c}),!c&&o===null&&(0,U.jsxs)(`div`,{className:`retry-menu-empty`,children:[(0,U.jsx)(B,{size:12,className:`spin`,"aria-hidden":`true`}),` Loading models…`]}),o!==null&&d.length===0&&(0,U.jsx)(`div`,{className:`retry-menu-empty`,children:`No other model is downloaded on this PC. Add one in Settings → Model.`}),d.map(e=>(0,U.jsx)(`button`,{type:`button`,className:`retry-menu-item`,title:e.id,onClick:()=>{a(!1),t(e.id)},children:e.name},e.id))]})})]})}function kT(e){return e!=null&&e>0?`${(e/1e3).toFixed(1)} s`:null}function AT({parts:e}){let t=e.filter(Boolean);return t.length?(0,U.jsx)(`div`,{className:`compare-meta`,children:t.join(` · `)}):null}function jT({original:e,originalModel:t,originalLatencyMs:n,state:r,keeping:i,onKeep:a,onClose:o}){Gs();let s=r.status===`ready`?r.result.model:r.model,c=e.stats?.tokens_per_second;return(0,U.jsxs)(`section`,{className:`answer-compare`,"aria-label":`Compare answers`,children:[(0,U.jsxs)(`header`,{className:`answer-compare-head`,children:[(0,U.jsx)(`span`,{children:`Compare answers`}),(0,U.jsx)(`button`,{type:`button`,className:`msg-action-btn`,onClick:o,"aria-label":`Close comparison`,disabled:!!i,children:(0,U.jsx)(Bn,{size:12})})]}),(0,U.jsxs)(`div`,{className:`answer-compare-cols`,children:[(0,U.jsxs)(`article`,{className:`compare-col`,"aria-label":`Answer from ${t??`the original model`}`,children:[(0,U.jsx)(`h4`,{children:t?qs(t):`Original answer`}),(0,U.jsx)(AT,{parts:[kT(n),c?`${c} tok/s`:null]}),(0,U.jsx)(`div`,{className:`compare-body`,children:(0,U.jsx)(yC,{content:e.content})}),(0,U.jsx)(`button`,{type:`button`,className:`compare-keep`,onClick:()=>a(`original`),disabled:!!i||r.status===`running`,children:i===`original`?`Keeping…`:`Keep this answer`})]}),(0,U.jsxs)(`article`,{className:`compare-col`,"aria-label":`Answer from ${s}`,children:[(0,U.jsx)(`h4`,{children:qs(s)}),r.status===`running`&&(0,U.jsxs)(`div`,{className:`compare-wait`,children:[(0,U.jsx)(B,{size:14,className:`spin`,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{children:[`Loading `,qs(s),`, then answering from the same evidence. Tools are not run again.`]})]}),r.status===`failed`&&(0,U.jsx)(`div`,{className:`compare-error`,role:`alert`,children:r.error}),r.status===`ready`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(AT,{parts:[`${r.result.stats.seconds.toFixed(1)} s`,r.result.stats.load_seconds>=1?`incl. ${r.result.stats.load_seconds.toFixed(1)} s loading`:null,r.result.stats.tokens_per_second?`${r.result.stats.tokens_per_second} tok/s`:null]}),(0,U.jsx)(`div`,{className:`compare-body`,children:(0,U.jsx)(yC,{content:r.result.content})}),(0,U.jsx)(`button`,{type:`button`,className:`compare-keep`,onClick:()=>a(`retry`),disabled:!!i,children:i===`retry`?`Keeping…`:`Keep this answer`})]})]})]})]})}var MT=`gaia.sessionPanel.open`,NT=`gaia.sessionPanel.width`,PT=`gaia.sessionPanel.sections`,FT={answer:!0,environment:!0,context:!1,outputs:!0,changes:!0};function IT(e,t,n){try{let r=window.localStorage.getItem(e);return r==null?n:t(r)}catch(t){return s.ui.warn(`Session panel setting ${e} unavailable; using the default`,t),n}}function LT(e,t){try{window.localStorage.setItem(e,t)}catch(t){s.ui.warn(`Could not remember session panel setting ${e}`,t)}}function RT(e){let t=typeof window<`u`?Math.floor(window.innerWidth*.5):640;return Math.round(Math.max(280,Math.min(e,640,Math.max(280,t))))}function zT(){return{open:IT(MT,e=>e!==`0`,!0),width:RT(IT(NT,e=>Number(e)||320,320)),sections:{...FT,...IT(PT,e=>JSON.parse(e),{})}}}var BT=$n((e,t)=>({...zT(),overlayOpen:!1,focus:null,setOpen:t=>{LT(MT,t?`1`:`0`),e({open:t})},setOverlayOpen:t=>e({overlayOpen:t}),setWidth:t=>{let n=RT(t);LT(NT,String(n)),e({width:n})},setSection:(n,r)=>{let i={...t().sections,[n]:r};LT(PT,JSON.stringify(i)),e({sections:i})},reveal:n=>{let r={...t().sections,[n]:!0};LT(PT,JSON.stringify(r)),LT(MT,`1`),e({sections:r,open:!0,overlayOpen:!0,focus:{section:n,nonce:Date.now()}})},reload:()=>e({...zT(),overlayOpen:!1,focus:null})}));function VT(e,t){if(t)return e.some(e=>e.turnSummary)?{kind:`busy`}:null;let n=e[e.length-1];return!n||n.role!==`assistant`||!n.turnSummary?null:{kind:`turn`,turn:n}}function HT(e){let t=e.live_data?.attempted??0;return t>0&&(e.live_data?.failed??0)>=t}function UT(e){try{return new URL(e).hostname.replace(/^www\./,``)}catch{return e}}function WT(e,t,n){let r=[];return t&&t.length>0&&r.push(e(Wr(`rail.pages`,t.length),{list:t.join(`, `)})),r.push(e(Wr(`rail.passages`,n),{n})),r.join(` · `)}function GT(e,t=Cl){let{cost:n}=e;return n.kind===`local`?t(`rail.costLocal`):n.kind===`estimate`&&typeof n.usd==`number`?t(`rail.costAbout`,{usd:n.usd<.01?n.usd.toFixed(4):n.usd.toFixed(2)}):t(e.model?`rail.costUnknownModel`:`rail.costUnknown`)}function KT(e){return e instanceof _a?e.detail||e.message:e instanceof Error?e.message:String(e)}function qT({messages:e,busy:t=!1}){let n=q(),r=VT(e,t);if(!r)return null;let i=r.kind===`turn`?r.turn.turnSummary??null:null,a=i?HT(i):!1;return(0,U.jsxs)(`div`,{className:`side-rail-body`,children:[!i&&(0,U.jsx)(`p`,{className:`side-rail-pending`,role:`status`,children:n(`rail.pending`)}),a&&(0,U.jsxs)(`div`,{className:`side-rail-warn`,role:`status`,children:[(0,U.jsx)(An,{size:14,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:n(`rail.noLive`)}),(0,U.jsx)(`span`,{children:n(`rail.noLiveWhy`)})]})]}),i&&(i.error?(0,U.jsx)(`p`,{className:`side-rail-error`,role:`alert`,children:n(`rail.error`,{error:i.error})}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(YT,{summary:i}),(0,U.jsx)(QT,{summary:i}),(0,U.jsx)($T,{summary:i})]}))]})}function JT({title:e,children:t}){let[n,r]=(0,V.useState)(!0);return(0,U.jsxs)(`section`,{className:`side-rail-section`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`side-rail-section-head`,onClick:()=>r(!n),"aria-expanded":n,children:[(0,U.jsx)(I,{size:12,className:`side-rail-chevron${n?` open`:``}`,"aria-hidden":`true`}),e]}),n&&(0,U.jsx)(`div`,{className:`side-rail-section-body`,children:t})]})}function YT({summary:e}){let t=q(),n=e.pages??[],r=e.documents??[];return n.length===0&&r.length===0?null:(0,U.jsx)(JT,{title:t(`rail.sources`),children:(0,U.jsxs)(`ul`,{className:`side-rail-list`,children:[n.map(e=>(0,U.jsxs)(`li`,{className:`side-rail-item`,children:[(0,U.jsx)(ct,{size:13,className:`side-rail-item-icon`,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{className:`side-rail-item-text`,children:[(0,U.jsxs)(`a`,{href:xg(e.url)||void 0,target:`_blank`,rel:`noopener noreferrer`,className:`side-rail-link`,title:e.url,children:[(0,U.jsx)(`span`,{className:`side-rail-link-text`,children:e.title||UT(e.url)}),(0,U.jsx)(Me,{size:10,"aria-hidden":`true`,className:`side-rail-link-icon`})]}),(0,U.jsxs)(`span`,{className:`side-rail-meta`,children:[UT(e.url),e.kind===`search_result`?` · ${t(`rail.searchResult`)}`:``]})]})]},e.url)),r.map(e=>{let n=e.passages??0;return(0,U.jsxs)(`li`,{className:`side-rail-item`,children:[(0,U.jsx)(We,{size:13,className:`side-rail-item-icon`,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{className:`side-rail-item-text`,children:[(0,U.jsx)(`span`,{className:`side-rail-name`,title:e.name,dir:`auto`,children:e.name}),(0,U.jsx)(`span`,{className:`side-rail-meta`,children:t.compose(t=>WT(t,e.pages,n))})]})]},e.path)})]})})}var XT=4e3;function ZT(e){let t=e.join(`
|
|
63
|
+
`),[n,r]=(0,V.useState)(()=>new Map),[i,a]=(0,V.useState)(null);return(0,V.useEffect)(()=>{if(!t)return;let e=t.split(`
|
|
64
|
+
`),n=!1,i=()=>{document.visibilityState!==`hidden`&&ns(e).then(e=>{n||(r(new Map(e.files.map(e=>[e.path,e]))),a(null))},e=>{n||(s.ui.warn(`Could not re-check the files this turn wrote`,e),a(KT(e)))})};i();let o=window.setInterval(i,XT);return window.addEventListener(`focus`,i),()=>{n=!0,window.clearInterval(o),window.removeEventListener(`focus`,i)}},[t]),{status:n,error:i}}function QT({summary:e}){let t=q(),n=e.files??[],[r,i]=(0,V.useState)(null),{status:a,error:o}=ZT(n.map(e=>e.path));if(n.length===0)return null;let c=(e,n)=>{i(null),e.catch(e=>{s.ui.error(`Failed to open ${n}`,e),i(t(`sp.couldntOpen`,{name:n,error:KT(e)}))})};return(0,U.jsxs)(JT,{title:t(`rail.files`),children:[(0,U.jsx)(`ul`,{className:`side-rail-list`,children:n.map(e=>{let n=a.get(e.path);if(n?.exists===!1)return(0,U.jsxs)(`li`,{className:`side-rail-item side-rail-item-gone`,children:[(0,U.jsx)(We,{size:13,className:`side-rail-item-icon`,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{className:`side-rail-item-text`,children:[(0,U.jsx)(`span`,{className:`side-rail-name`,title:e.path,children:e.name}),(0,U.jsx)(`span`,{className:`side-rail-meta`,children:t(`sp.gone`)})]})]},e.path);let r=n?.exists===!0&&typeof n.mtime==`number`&&typeof e.mtime==`number`&&n.mtime!==e.mtime;return(0,U.jsxs)(`li`,{className:`side-rail-item`,children:[(0,U.jsx)(We,{size:13,className:`side-rail-item-icon`,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{className:`side-rail-item-text`,children:[(0,U.jsx)(`span`,{className:`side-rail-name`,title:e.path,children:e.name}),r&&(0,U.jsx)(`span`,{className:`side-rail-meta`,children:t(`rail.changedSince`)}),(0,U.jsxs)(`span`,{className:`side-rail-actions`,children:[e.openable&&(0,U.jsx)(`button`,{type:`button`,className:`side-rail-action`,onClick:()=>c(ts(e.path),e.name),children:t(`sp.open`)}),(0,U.jsxs)(`button`,{type:`button`,className:`side-rail-action`,onClick:()=>c(es(e.path,!0),e.name),children:[(0,U.jsx)(Je,{size:11,"aria-hidden":`true`}),t(`sp.showInFolder`)]})]})]})]},e.path)})}),r&&(0,U.jsx)(`p`,{className:`side-rail-error`,role:`alert`,children:r}),o&&(0,U.jsx)(`p`,{className:`side-rail-error`,children:t(`rail.checkFailed`,{error:o})})]})}function $T({summary:e}){let t=q();Gs();let{model:n}=e,r=e.sites??[],i=(e.documents??[]).length>0;return(0,U.jsx)(JT,{title:t(`rail.thisTurn`),children:(0,U.jsxs)(`dl`,{className:`side-rail-facts`,children:[(0,U.jsx)(`dt`,{children:t(`rail.model`)}),(0,U.jsxs)(`dd`,{children:[n?(0,U.jsxs)(`span`,{className:`side-rail-where${n.remote?` remote`:``}`,children:[n.remote?(0,U.jsx)(ge,{size:12,"aria-hidden":`true`}):(0,U.jsx)(Ft,{size:12,"aria-hidden":`true`}),n.remote?t(`rail.cloudModel`,{name:n.provider_name}):t(`rail.thisPc`)]}):(0,U.jsx)(`span`,{className:`side-rail-where`,children:t(`rail.notReported`)}),n?.name&&(0,U.jsx)(`span`,{className:`side-rail-meta`,title:n.name,dir:`ltr`,children:qs(n.name)})]}),i&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`dt`,{children:t(`rail.documents`)}),(0,U.jsx)(`dd`,{children:n?.remote?t(`rail.docsSent`,{provider:n.provider_name}):t(n?`rail.docsLocal`:`rail.docsSearched`)})]}),(0,U.jsx)(`dt`,{children:t(`rail.websites`)}),(0,U.jsx)(`dd`,{children:r.length>0?(0,U.jsx)(`span`,{dir:`ltr`,children:r.join(`, `)}):t(`rail.noSites`)}),(0,U.jsx)(`dt`,{children:t(`rail.cost`)}),(0,U.jsx)(`dd`,{children:GT(e,t)})]})})}function eE({id:e,title:t,summary:n,children:r}){let i=BT(t=>t.sections[e]),a=BT(e=>e.setSection),o=BT(e=>e.focus),s=(0,V.useRef)(null),c=`sp-section-${e}`;return(0,V.useEffect)(()=>{o?.section===e&&s.current?.scrollIntoView?.({block:`start`,behavior:Hx()})},[o,e]),(0,U.jsxs)(`section`,{ref:s,className:`sp-section`,"aria-labelledby":`${c}-title`,children:[(0,U.jsx)(`h3`,{className:`sp-section-heading`,children:(0,U.jsxs)(`button`,{type:`button`,id:`${c}-title`,className:`sp-section-head`,"aria-expanded":i,"aria-controls":c,onClick:()=>a(e,!i),children:[(0,U.jsx)(I,{size:13,className:`sp-chevron${i?` is-open`:``}`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`sp-section-title`,children:t}),n!=null&&(0,U.jsx)(`span`,{className:`sp-section-summary`,children:n})]})}),i&&(0,U.jsx)(`div`,{id:c,className:`sp-section-body`,children:r})]})}function tE(e,t){let n=(0,V.useRef)(e),r=(0,V.useRef)(t);r.current=t,(0,V.useEffect)(()=>{let t=n.current&&!e;n.current=e,t&&r.current()},[e])}var nE=`gaia:mobile-access-request`,rE=`gaia:mobile-access-state`;function iE(e){window.dispatchEvent(new CustomEvent(nE,{detail:e}))}function aE(e){window.dispatchEvent(new CustomEvent(rE,{detail:e}))}function oE(e,t){let n=(0,V.useRef)(t);n.current=t,(0,V.useEffect)(()=>{let t=e=>n.current(!!e.detail);return window.addEventListener(e,t),()=>window.removeEventListener(e,t)},[e])}var sE=e=>oE(nE,e),cE=e=>oE(rE,e);function lE({checked:e,onChange:t,label:n,text:r,disabled:i}){return(0,U.jsxs)(`span`,{className:`sp-switch-wrap`,children:[(0,U.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":n,className:`sp-switch${e?` is-on`:``}`,onClick:()=>t(!e),disabled:i,children:(0,U.jsx)(`span`,{className:`sp-switch-knob`,"aria-hidden":`true`})}),r&&(0,U.jsx)(`span`,{className:`sp-state-text`,children:r})]})}var uE={added:`env.source.added`,gaia_documents:`env.source.gaia_documents`,scratch:`env.source.scratch`,document:`env.source.document`,working_folder:`env.source.working_folder`,approved:`env.source.approved`,allowed_paths:`env.source.allowed_paths`},dE=3;function fE(e){return e instanceof _a?e.detail||e.message:e instanceof Error?e.message:String(e)}function pE(e){let t=e.split(/[\\/]/).filter(Boolean);return t[t.length-1]??e}function mE({sessionId:e,busy:t}){let n=q(),{env:r}=Gw(e),i=r&&!r.internet?n(`env.offline`):null;return(0,U.jsxs)(eE,{id:`environment`,title:n(`env.title`),summary:i,children:[(0,U.jsx)(_E,{sessionId:e,busy:t}),(0,U.jsx)(vE,{sessionId:e}),(0,U.jsx)(yE,{sessionId:e}),(0,U.jsx)(bE,{}),(0,U.jsx)(xE,{sessionId:e})]})}function hE({label:e,children:t}){return(0,U.jsxs)(`div`,{className:`sp-env-row`,children:[(0,U.jsx)(`div`,{className:`sp-env-label`,children:e}),(0,U.jsx)(`div`,{className:`sp-env-value`,children:t})]})}function gE(e,t){let n=e=>e.toLowerCase().replace(/^user\./,``);return n(e)===n(t)}function _E({sessionId:e,busy:t}){let n=q(),r=Zs(),i=Ws(e=>e.active),a=H(t=>Qs(i,t.sessions,e)),[o,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(null),d=r?.remote===!0,f=(0,V.useCallback)(()=>{d||Promise.resolve().then(()=>no()).then(e=>{c(Lw(e,e=>typeof e.state==`string`,`model status`)),u(null)}).catch(e=>{s.ui.warn(`Could not read where the local model runs`,e),u(fE(e))})},[d]);if((0,V.useEffect)(f,[f]),tE(t,f),d)return(0,U.jsxs)(hE,{label:n(`env.runsOn`),children:[(0,U.jsxs)(`span`,{className:`sp-place is-remote`,children:[(0,U.jsx)(ge,{size:13,"aria-hidden":`true`}),` `,n(`env.cloudPlace`,{name:r?.label??``})]}),r?.description&&(0,U.jsx)(`span`,{className:`sp-meta`,children:r.description})]});if(!r)return(0,U.jsx)(hE,{label:n(`env.runsOn`),children:(0,U.jsx)(`span`,{className:`sp-meta`,title:Xs,children:n(`env.notKnownYet`)})});let p=!!(o?.model&&a&&!gE(o.model,a)),m=p?null:o?.memory;return(0,U.jsxs)(hE,{label:n(`env.runsOn`),children:[(0,U.jsxs)(`span`,{className:`sp-place`,children:[(0,U.jsx)(Ft,{size:13,"aria-hidden":`true`}),` `,n(`env.thisPc`),!p&&o?.placement?.label?` · ${o.placement.label}`:``]}),p?(0,U.jsx)(`span`,{className:`sp-meta`,children:n(`env.notLoaded`,{model:qs(a)})}):o?.display_name&&(0,U.jsxs)(`span`,{className:`sp-meta`,dir:`ltr`,children:[o.display_name,o.state===`loaded`?``:` · ${o.state}`]}),m&&(0,U.jsxs)(`span`,{className:`sp-meta`,children:[m.model_gb==null?n(`env.inUseUnknown`):n(`env.inUse`,{gb:m.model_gb.toFixed(1)}),m.free_gb==null?``:` · ${n(`env.free`,{gb:m.free_gb.toFixed(1)})}`]}),(l||o?.error)&&(0,U.jsx)(`span`,{className:`sp-error`,children:l??o?.error})]})}function vE({sessionId:e}){let t=q(),{env:n,error:r,change:i}=Gw(e),a=H(t=>t.sessions.find(t=>t.id===e)?.agent_type===`gaia`),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(!1),f=async(e,t)=>{l(e),s(null);try{await t()}catch(e){s(fE(e))}finally{l(null)}},p=t=>f(t.path,()=>i(()=>Es(e,t.path))),{open:m,picker:h,error:g}=Bw(t=>{f(t,()=>i(()=>Ts(e,t)))}),_=n?.folders.filter(e=>e.kind===`folder`)??[],v=n?.folders.filter(e=>e.kind===`file`)??[],y=u?v:v.slice(0,dE),b=!n||!n.enforced,x=e=>(0,U.jsxs)(`li`,{className:`sp-scope-item`,children:[e.kind===`folder`?(0,U.jsx)(et,{size:13,className:`sp-item-icon`,"aria-hidden":`true`}):(0,U.jsx)(Ke,{size:13,className:`sp-item-icon`,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{className:`sp-item-text`,children:[(0,U.jsx)(`span`,{className:`sp-item-name`,title:e.path,children:pE(e.path)}),(0,U.jsxs)(`span`,{className:`sp-meta`,title:e.path,children:[t(uE[e.source]),` · `,(0,U.jsx)(`span`,{dir:`ltr`,children:e.path})]})]}),e.removable&&!b&&(0,U.jsx)(`button`,{type:`button`,className:`btn-icon-sm sp-item-remove`,onClick:()=>void p(e),disabled:c!==null,"aria-label":t(`env.remove`,{path:e.path}),title:t(`env.removeShort`),children:(0,U.jsx)(Bn,{size:12})})]},e.path);return(0,U.jsxs)(hE,{label:n&&!n.enforced?t(`env.reach`):t(`env.readWrite`),children:[!n&&!r&&(0,U.jsx)(`span`,{className:`sp-meta`,children:t(`sp.checking`)}),n&&!n.enforced&&(0,U.jsx)(`span`,{className:`sp-meta`,children:t(a?`env.flagshipScope`:`env.agentScope`)}),r&&(0,U.jsx)(`span`,{className:`sp-error`,children:t(`env.foldersError`,{error:r})}),n&&(0,U.jsxs)(U.Fragment,{children:[n.folders.length===0&&(0,U.jsx)(`span`,{className:`sp-meta`,children:t(`env.nothing`)}),(0,U.jsxs)(`ul`,{className:`sp-list`,children:[_.map(x),y.map(x)]}),v.length>dE&&(0,U.jsx)(`button`,{type:`button`,className:`link-btn sp-more`,onClick:()=>d(e=>!e),children:u?t(`env.fewerFiles`):t(`env.allFiles`,{n:v.length})}),!n.enforced&&(0,U.jsx)(`span`,{className:`sp-meta`,children:t(`env.ownProcess`)}),n.removed.length>0&&(0,U.jsx)(`span`,{className:`sp-meta`,children:t(`env.removed`,{names:n.removed.map(pE).join(`, `)})}),!b&&(0,U.jsxs)(`button`,{type:`button`,className:`sp-action`,onClick:()=>m(),disabled:c!==null,children:[(0,U.jsx)(Xe,{size:12,"aria-hidden":`true`}),` `,t(`env.addFolder`)]})]}),(o??g)&&(0,U.jsx)(`span`,{className:`sp-error`,role:`alert`,children:o??g}),h]})}function yE({sessionId:e}){let t=q(),{env:n,change:r,refresh:i}=Gw(e),[a,o]=(0,V.useState)(null),[s,c]=(0,V.useState)(!1);if(!n)return null;let l=async t=>{c(!0),o(null);try{await r(()=>Ds(e,t))}catch(e){o(fE(e)),i()}finally{c(!1)}};return n.internet_enforced?(0,U.jsxs)(hE,{label:t(`env.internet`),children:[(0,U.jsx)(lE,{checked:n.internet,onChange:e=>void l(e),disabled:s,label:t(`env.internetFor`),text:n.internet?t(`env.on`):t(`env.offBlocked`)}),a&&(0,U.jsx)(`span`,{className:`sp-error`,role:`alert`,children:a})]}):(0,U.jsx)(hE,{label:t(`env.internet`),children:(0,U.jsx)(`span`,{className:`sp-state-text`,children:n.internet?t(`env.on`):t(`env.off`)})})}function bE(){let e=q(),[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)(!1),[a,o]=(0,V.useState)(null),s=(0,V.useCallback)(()=>{Promise.resolve().then(()=>cs()).then(e=>{n(Lw(e,e=>typeof e.active==`boolean`,`phone access status`)),o(null)}).catch(e=>o(fE(e)))},[]);(0,V.useEffect)(s,[s]),cE(()=>{i(!1),s()});let c=t?.active===!0;return(0,U.jsxs)(hE,{label:e(`env.phone`),children:[(0,U.jsx)(lE,{checked:c,onChange:e=>{i(!0),iE(e)},disabled:r,label:e(`env.phone`),text:e(r?c?`env.stopping`:`env.starting`:c?`env.on`:`env.off`)}),c&&(0,U.jsxs)(`span`,{className:`sp-meta`,children:[(0,U.jsx)(vn,{size:12,"aria-hidden":`true`}),` `,t?.device?e(`env.phoneConnected`,{name:t.device.name}):e(`env.noPhone`)]}),c&&(0,U.jsx)(`button`,{type:`button`,className:`sp-action`,onClick:()=>iE(!0),children:e(`env.qr`)}),(a||t?.error)&&(0,U.jsx)(`span`,{className:`sp-error`,children:a??t?.error})]})}function xE({sessionId:e}){let t=q(),[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(!1),[o,s]=(0,V.useState)(null);(0,V.useEffect)(()=>{let t=!0;return Promise.resolve().then(()=>ca(e)).then(e=>{t&&r(Lw(e,e=>typeof e.mode==`string`,`permission mode`).mode)}).catch(e=>{t&&s(fE(e))}),()=>{t=!1}},[e]),Zw(e,r);let c=async t=>{a(!1),s(null);try{let n=(await da(e,t)).mode;r(n),Xw(e,n)}catch(e){s(fE(e))}},l=Qw.find(e=>e.mode===n)?.note;return(0,U.jsxs)(hE,{label:t(`env.permission`),children:[(0,U.jsx)(`div`,{className:`sp-segmented`,role:`radiogroup`,"aria-label":t(`env.permission`),children:Qw.map(e=>(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":n===e.mode,className:n===e.mode?`is-selected`:void 0,onClick:()=>e.mode===`full_access`?a(!0):void c(e.mode),children:[e.mode===`full_access`?(0,U.jsx)(un,{size:12,"aria-hidden":`true`}):(0,U.jsx)(fn,{size:12,"aria-hidden":`true`}),e.mode===`ask`?t(`env.ask`):t(e.label)]},e.mode))}),l&&(0,U.jsx)(`span`,{className:`sp-meta`,children:t(l)}),i&&(0,U.jsxs)(`span`,{className:`sp-confirm`,role:`alert`,children:[t(`env.fullAccessWarn`),(0,U.jsx)(`button`,{type:`button`,className:`sp-action is-warning`,onClick:()=>void c(`full_access`),children:t(`env.turnOn`)}),(0,U.jsx)(`button`,{type:`button`,className:`sp-action`,onClick:()=>a(!1),children:t(`sp.cancel`)})]}),o&&(0,U.jsx)(`span`,{className:`sp-error`,role:`alert`,children:o})]})}var SE={file:{label:`out.kind.file`,Icon:We},export:{label:`out.kind.export`,Icon:Be},image:{label:`out.kind.image`,Icon:ut},document:{label:`out.kind.document`,Icon:bt},memory:{label:`out.kind.memory`,Icon:O},schedule:{label:`out.kind.schedule`,Icon:M}},CE={created:`out.change.created`,edited:`out.change.edited`,deleted:`out.change.deleted`};function wE(e){return e instanceof _a?e.detail||e.message:e instanceof Error?e.message:String(e)}function TE(e,t){if(!e)return null;let n=Date.parse(`${e.replace(` `,`T`)}Z`);if(Number.isNaN(n))return null;let r=Math.max(0,Math.round((t-n)/1e3));return r<60?{key:`out.justNow`}:r<3600?{key:`out.minAgo`,params:{n:Math.floor(r/60)}}:r<86400?{key:`out.hAgo`,params:{n:Math.floor(r/3600)}}:new Date(n).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function EE(e){return e.state===`undone`?`out.undone`:e.state===`gone`?`sp.gone`:null}function DE({sessionId:e,busy:t,onJumpToMessage:n}){let r=q();return(0,U.jsx)(eE,{id:`outputs`,title:r(`out.title`),children:(0,U.jsx)(OE,{sessionId:e,busy:t,onJumpToMessage:n})})}function OE({sessionId:e,busy:t,onJumpToMessage:n}){let r=q(),[i,a]=(0,V.useState)(null),[o,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(null),[d,f]=(0,V.useState)(!1),p=(0,V.useCallback)(()=>{let t=!0;return Promise.resolve().then(()=>Os(e)).then(e=>{t&&(a(Lw(e,e=>Array.isArray(e.items),`list of outputs`).items),c(null))}).catch(n=>{t&&(s.ui.warn(`Could not list what session=${e} produced`,n),c(wE(n)))}),()=>{t=!1}},[e]);(0,V.useEffect)(p,[p]),tE(t,p),Xx(e,p);let m=(e,t)=>{u(null),e.catch(e=>u(r(`sp.couldntOpen`,{name:t,error:wE(e)})))};if(o)return(0,U.jsx)(`p`,{className:`sp-error`,children:r(`out.listError`,{error:o})});if(!i)return(0,U.jsx)(`p`,{className:`sp-meta`,children:r(`sp.checking`)});if(i.length===0)return(0,U.jsx)(`p`,{className:`sp-meta`,children:r(`out.empty`)});let h=d?i:i.slice(0,5);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`ul`,{className:`sp-list`,"aria-label":r(`out.listLabel`),children:h.map(e=>{let{label:t,Icon:i}=SE[e.kind],a=EE(e),o=e.change&&e.kind!==`document`?CE[e.change]:void 0,s=TE(e.created_at,Date.now()),c=r.compose(e=>[o?e(`out.kindChanged`,{kind:Lr(t),change:Lr(o)}):e(t),s==null?``:typeof s==`string`?s:e(s.key,s.params),a?e(a):``].filter(Boolean).join(` · `));return(0,U.jsxs)(`li`,{className:`sp-output${e.state===`present`?``:` is-inactive`}`,children:[(0,U.jsx)(i,{size:13,className:`sp-item-icon`,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{className:`sp-item-text`,children:[(0,U.jsx)(`span`,{className:`sp-item-name`,title:e.path??e.name,children:e.name}),(0,U.jsx)(`span`,{className:`sp-meta`,children:c}),(0,U.jsxs)(`span`,{className:`sp-item-actions`,children:[e.message_id!=null&&(0,U.jsxs)(`button`,{type:`button`,className:`sp-action`,onClick:()=>{n(e.message_id)||u(r(`out.notLoaded`))},"aria-label":r(`out.goToAria`,{name:e.name}),children:[(0,U.jsx)(Se,{size:11,"aria-hidden":`true`}),` `,r(`sp.goToTurn`)]}),e.openable&&e.path&&(0,U.jsx)(`button`,{type:`button`,className:`sp-action`,onClick:()=>m(ts(e.path),e.name),children:r(`sp.open`)}),e.revealable&&e.path&&(0,U.jsxs)(`button`,{type:`button`,className:`sp-action`,onClick:()=>m(es(e.path,!0),e.name),children:[(0,U.jsx)(Je,{size:11,"aria-hidden":`true`}),` `,r(`sp.showInFolder`)]})]})]})]},e.id)})}),i.length>5&&(0,U.jsx)(`button`,{type:`button`,className:`link-btn sp-more`,onClick:()=>f(e=>!e),children:d?r(`out.fewer`):r(`out.more`,{n:i.length-5})}),l&&(0,U.jsx)(`p`,{className:`sp-error`,role:`alert`,children:l})]})}function kE(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function AE(e){return e instanceof _a?e.detail||e.message:e instanceof Error?e.message:String(e)}function jE(e){let t=e.split(/[\\/]/).filter(Boolean);return t[t.length-1]??e}var ME=e=>Lr(e===1?`chg.files.one`:`chg.files.other`,{n:e});function NE(e,t=Cl){let{files:n,additions:r,deletions:i}=e.totals;return t(`chg.total`,{files:ME(n),add:r,del:i})}var PE={edited:`Edited`,created:`Created`,deleted:`Deleted`},FE={edited:`chg.edited`,created:`chg.created`,deleted:`chg.deleted`};function IE({sessionId:e,busy:t,onJumpToMessage:n}){let r=q(),[i,a]=(0,V.useState)(null),[o,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(null),d=(0,V.useCallback)(()=>{Promise.resolve().then(()=>ks(e)).then(e=>{a(Lw(e,e=>Array.isArray(e.files),`list of this chat's changes`)),c(null)}).catch(t=>{s.ui.warn(`Could not total what session=${e} changed`,t),c(AE(t))})},[e]);(0,V.useEffect)(d,[d]),tE(t,()=>{u(null),d()}),Xx(e,d);let f=!i||i.files.length===0;return!o&&f&&!l?null:(0,U.jsxs)(eE,{id:`changes`,title:r(`chg.title`),summary:i&&!f?r(`chg.summary`,{files:ME(i.totals.files),add:i.totals.additions,del:i.totals.deletions}):null,children:[o&&(0,U.jsx)(`p`,{className:`sp-error`,children:r(`chg.error`,{error:o})}),i&&!f&&(0,U.jsx)(LE,{sessionId:e,busy:t,changes:i,onChanged:d,onUndone:u,onJumpToMessage:n}),f&&l&&(0,U.jsx)(`p`,{className:`sp-ok`,role:`status`,children:l})]})}function LE({sessionId:e,busy:t,changes:n,onChanged:r,onUndone:i,onJumpToMessage:a}){let o=q(),[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)(`idle`),[d,f]=(0,V.useState)(null),p=n.files.length,m=async t=>{u(`working`),f(null);try{let n=await As(e,t),r=[];n.restored.length&&r.push(`restored ${kE(n.restored.length,`file`)}`),n.removed.length&&r.push(`removed ${kE(n.removed.length,`new file`)}`);let a=`Undone: ${r.join(`, `)||`no files needed changing`}.`;n.kept_folders.length&&(a+=` Kept ${kE(n.kept_folders.length,`folder`)} the chat created, because they now hold other files.`),f(a),u(`done`),i(a),Yx(e),await Kx(e)}catch(e){let t=e?.reason===`conflict`;f(AE(e)),u(t?`conflict`:`idle`)}};return(0,U.jsxs)(`div`,{className:`sp-changes`,children:[(0,U.jsxs)(`p`,{className:`sp-changes-total`,"aria-live":`polite`,children:[(0,U.jsx)(`strong`,{children:NE(n,o)}),n.totals.uncounted>0&&(0,U.jsxs)(`span`,{className:`sp-meta`,children:[` · `,o.plural(`chg.uncounted`,n.totals.uncounted)]})]}),n.pending&&(0,U.jsx)(`p`,{className:`sp-meta`,children:o(`chg.pending`)}),(0,U.jsx)(`ul`,{className:`sp-list`,children:n.files.map(e=>{let t=e.message_ids[e.message_ids.length-1];return(0,U.jsxs)(`li`,{className:`sp-change`,children:[(0,U.jsxs)(`div`,{className:`sp-item-text`,children:[(0,U.jsx)(`span`,{className:`sp-item-name`,title:e.path,children:jE(e.path)}),(0,U.jsxs)(`span`,{className:`sp-meta`,children:[o(FE[e.change]),e.additions!=null&&(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsxs)(`span`,{className:`sp-add`,children:[`+`,e.additions]}),` `,(0,U.jsxs)(`span`,{className:`sp-del`,children:[`−`,e.deletions]})]}),e.message_ids.length>1&&` · ${o(`chg.turns`,{n:e.message_ids.length})}`]}),e.changed_since&&(0,U.jsxs)(`span`,{className:`sp-warn-text`,children:[(0,U.jsx)(An,{size:11,"aria-hidden":`true`}),` `,o(`chg.outside`,{when:e.changed_since})]})]}),t!=null&&(0,U.jsx)(`button`,{type:`button`,className:`btn-icon-sm`,onClick:()=>a(t),"aria-label":o(`chg.goToLast`,{name:jE(e.path)}),title:o(`sp.goToTurn`),children:(0,U.jsx)(Se,{size:12})})]},e.path)})}),n.incomplete&&(0,U.jsxs)(`p`,{className:`sp-warn-text`,role:`note`,children:[(0,U.jsx)(An,{size:11,"aria-hidden":`true`}),` `,aS(n.untracked,{inChat:!0,undo:`Undo all`})]}),(0,U.jsxs)(`div`,{className:`sp-actions-row`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`sp-action`,onClick:()=>c(!0),children:[(0,U.jsx)(Re,{size:12,"aria-hidden":`true`}),` `,o(`chg.review`)]}),l!==`confirm`&&l!==`conflict`&&(0,U.jsxs)(`button`,{type:`button`,className:`sp-action`,onClick:()=>u(`confirm`),disabled:l===`working`||t,title:t?o(`chg.wait`):void 0,children:[(0,U.jsx)(Mn,{size:12,"aria-hidden":`true`}),` `,o(l===`working`?`chg.undoing`:`chg.undoAll`)]})]}),l===`confirm`&&(0,U.jsxs)(`div`,{className:`sp-confirm`,role:`group`,"aria-label":o(`chg.confirmLabel`),children:[o(p===1?`chg.confirm.one`:`chg.confirm.other`,{files:ME(p)}),(0,U.jsxs)(`span`,{className:`sp-actions-row`,children:[(0,U.jsx)(`button`,{type:`button`,className:`sp-action is-danger`,onClick:()=>void m(!1),children:o(`chg.undoAll`)}),(0,U.jsx)(`button`,{type:`button`,className:`sp-action`,onClick:()=>u(`idle`),children:o(`sp.cancel`)})]})]}),d&&(0,U.jsxs)(`div`,{className:l===`done`?`sp-ok`:`sp-error`,role:l===`done`?`status`:`alert`,children:[d,l===`conflict`&&(0,U.jsxs)(`span`,{className:`sp-actions-row`,children:[(0,U.jsx)(`button`,{type:`button`,className:`sp-action is-danger`,onClick:()=>void m(!0),children:o(`chg.undoAnyway`)}),(0,U.jsx)(`button`,{type:`button`,className:`sp-action`,onClick:()=>{u(`idle`),f(null)},children:o(`chg.keep`)})]})]}),(0,U.jsx)(BE,{sessionId:e,busy:t,onCommitted:r}),s&&(0,U.jsx)(zE,{changes:n,onClose:()=>c(!1)})]})}function RE(e){if(e.too_large)return`Too large to show: ${e.before_size} → ${e.after_size} bytes.`;if(e.binary)return`Binary file: ${e.before_size} → ${e.after_size} bytes. No text diff.`;if(e.truncated)return`Diff shortened: the change is too long to show in full.`}function zE({changes:e,onClose:t}){ki(!0,t);let n=(0,V.useRef)(null);return pS(n,!0),(0,U.jsx)(`div`,{ref:n,className:`modal-overlay`,onClick:t,role:`dialog`,"aria-modal":`true`,"aria-label":`Review this chat's changes`,children:(0,U.jsxs)(`div`,{className:`modal-panel changes-review`,onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(`div`,{className:`modal-header`,children:[(0,U.jsxs)(`h3`,{children:[`Changes in this chat · `,NE(e)]}),(0,U.jsx)(`button`,{type:`button`,className:`btn-icon`,onClick:t,"aria-label":`Close`,children:(0,U.jsx)(Bn,{size:18})})]}),(0,U.jsx)(`div`,{className:`modal-body changes-review-body`,children:e.files.map(e=>(0,U.jsx)(`section`,{className:`changes-review-file`,children:(0,U.jsx)(yx,{data:{title:e.path,badge:PE[e.change],note:RE(e),unified:e.binary||e.too_large?``:e.unified}})},e.path))})]})})}function BE({sessionId:e,busy:t,onCommitted:n}){let r=q(),[i,a]=(0,V.useState)(null),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(null),f=(0,V.useCallback)(()=>{Promise.resolve().then(()=>js(e)).then(e=>{a(Lw(e,e=>Array.isArray(e.repos),`list of git repositories`)),s(null)}).catch(e=>s(AE(e)))},[e]);return(0,V.useEffect)(f,[f]),tE(t,f),Xx(e,f),o?(0,U.jsx)(`p`,{className:`sp-error`,children:r(`chg.gitError`,{error:o})}):!i||!i.available||i.repos.length===0?null:(0,U.jsxs)(`div`,{className:`sp-git`,children:[i.repos.map(e=>(0,U.jsxs)(`div`,{className:`sp-git-repo`,children:[(0,U.jsxs)(`span`,{className:`sp-meta`,title:e.root,children:[(0,U.jsx)(nt,{size:12,"aria-hidden":`true`}),` `,jE(e.root),` · `,e.branch,e.uncommitted.length===0&&e.files.length>0&&` · committed`]}),(0,U.jsxs)(`span`,{className:`sp-actions-row`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`sp-action`,disabled:t||e.uncommitted.length===0,onClick:()=>{d(null),l({kind:`commit`,repo:e})},children:[(0,U.jsx)(it,{size:12,"aria-hidden":`true`}),` Commit…`]}),(0,U.jsxs)(`button`,{type:`button`,className:`sp-action`,disabled:t||e.pr_blocked!=null,title:e.pr_blocked??void 0,onClick:()=>{d(null),l({kind:`pr`,repo:e})},children:[(0,U.jsx)(ot,{size:12,"aria-hidden":`true`}),` Create PR…`]})]}),e.pr_blocked&&(0,U.jsx)(`span`,{className:`sp-meta`,children:e.pr_blocked})]},e.root)),u&&(0,U.jsx)(`p`,{className:`sp-ok`,role:`status`,children:u}),c&&(0,U.jsx)(VE,{sessionId:e,kind:c.kind,repo:c.repo,onClose:()=>l(null),onDone:e=>{l(null),d(e),f(),n()}})]})}function VE({sessionId:e,kind:t,repo:n,onClose:r,onDone:i}){let[a,o]=(0,V.useState)(n.draft.title),[s,c]=(0,V.useState)(n.draft.body),[l,u]=(0,V.useState)(!1),[d,f]=(0,V.useState)(null);ki(!0,r,!l);let p=(0,V.useRef)(null);pS(p,!0);let m=async()=>{u(!0),f(null);try{if(t===`commit`){let t=await Ms(e,n.root,`${a.trim()}\n\n${s.trim()}`.trim());i(`Committed ${kE(t.files.length,`file`)} as ${t.commit}.`)}else i(`Opened ${(await Ns(e,n.root,a,s)).url}`)}catch(e){f(AE(e)),u(!1)}},h=t===`commit`?n.uncommitted:n.files;return(0,U.jsx)(`div`,{className:`modal-overlay`,onClick:l?void 0:r,children:(0,U.jsxs)(`div`,{ref:p,className:`modal-panel sp-git-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":t===`commit`?`Commit this chat’s changes`:`Create a pull request`,onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(`div`,{className:`modal-header`,children:[(0,U.jsx)(`h3`,{children:t===`commit`?`Commit this chat’s changes`:`Create a pull request`}),(0,U.jsx)(`button`,{type:`button`,className:`btn-icon`,onClick:r,disabled:l,"aria-label":`Close`,children:(0,U.jsx)(Bn,{size:18})})]}),(0,U.jsxs)(`div`,{className:`modal-body sp-git-body`,children:[(0,U.jsx)(`p`,{className:`sp-meta`,children:t===`commit`?`In ${n.root} on ${n.branch}. Only the files below are committed; anything else you changed stays as it is.`:`Pushes ${n.branch} to ${n.remote} (never forced), then opens a pull request with GitHub's gh tool.`}),(0,U.jsxs)(`label`,{className:`sp-field`,children:[(0,U.jsx)(`span`,{children:t===`commit`?`Summary`:`Title`}),(0,U.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),disabled:l})]}),(0,U.jsxs)(`label`,{className:`sp-field`,children:[(0,U.jsx)(`span`,{children:t===`commit`?`Details`:`Description`}),(0,U.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),rows:7,disabled:l})]}),(0,U.jsxs)(`div`,{className:`sp-meta`,children:[kE(h.length,`file`),`: `,h.join(`, `)]}),t===`commit`&&n.ignored.length>0&&(0,U.jsxs)(`div`,{className:`sp-meta`,children:[`Left out, because git ignores `,n.ignored.length===1?`it`:`them`,`: `,n.ignored.join(`, `)]}),d&&(0,U.jsx)(`p`,{className:`sp-error`,role:`alert`,children:d})]}),(0,U.jsxs)(`div`,{className:`sp-picker-actions`,children:[(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:r,disabled:l,children:`Cancel`}),(0,U.jsxs)(`button`,{type:`button`,className:`btn-primary`,onClick:()=>void m(),disabled:l||!a.trim(),children:[l&&(0,U.jsx)(B,{size:13,className:`spin`,"aria-hidden":`true`}),t===`commit`?`Commit ${kE(h.length,`file`)}`:`Push and open PR`]})]})]})})}var HE=`(max-width: 1099px)`,UE=16;function WE({sessionId:e,messages:t,busy:n,onUsage:r,onJumpToMessage:i}){let a=q(),o=dl(HE),s=BT(e=>o?e.overlayOpen:e.open),c=BT(e=>e.width),l=BT(e=>e.setWidth),u=BT(e=>e.setOpen),d=BT(e=>e.setOverlayOpen),f=BT(e=>e.focus),p=(0,V.useRef)(null),[m,h]=(0,V.useState)(null),g=(0,V.useCallback)(()=>{o?d(!1):u(!1)},[o,u,d]);ki(s&&o,g);let _=(0,V.useRef)(null);pS(_,s&&o),(0,V.useEffect)(()=>{s&&o&&p.current?.focus()},[s,o]),(0,V.useEffect)(()=>{f&&o&&d(!0)},[f,o,d]);let v=(0,V.useCallback)(e=>{if(e.button!==0)return;e.preventDefault();let t=e.clientX,n=c,r=e.currentTarget;r.setPointerCapture?.(e.pointerId);let i=getComputedStyle(r).direction===`rtl`?-1:1,a=n,o=e=>{a=RT(n+i*(t-e.clientX)),h(a)},s=()=>{r.removeEventListener(`pointermove`,o),r.removeEventListener(`pointerup`,s),r.removeEventListener(`pointercancel`,s),h(null),l(a)};r.addEventListener(`pointermove`,o),r.addEventListener(`pointerup`,s),r.addEventListener(`pointercancel`,s)},[l,c]),y=(0,V.useCallback)(e=>{let t=getComputedStyle(e.currentTarget).direction===`rtl`?-16:UE,n={ArrowLeft:c+t,ArrowRight:c-t,Home:280,End:640}[e.key];n!==void 0&&(e.preventDefault(),l(n))},[l,c]);if(!s)return null;let b=m??c,x=VT(t,n);return(0,U.jsxs)(U.Fragment,{children:[o&&(0,U.jsx)(`div`,{className:`sp-backdrop`,onClick:g,"aria-hidden":`true`}),(0,U.jsxs)(`aside`,{ref:_,className:`session-panel ${o?`is-overlay`:`is-docked`}`,style:o?void 0:{width:b},"aria-label":a(`sp.label`),role:o?`dialog`:`complementary`,"aria-modal":o?!0:void 0,children:[!o&&(0,U.jsx)(`div`,{className:`sp-resize${m==null?``:` is-dragging`}`,role:`separator`,"aria-orientation":`vertical`,"aria-label":a(`sp.resize`),"aria-valuemin":280,"aria-valuemax":640,"aria-valuenow":b,tabIndex:0,onPointerDown:v,onKeyDown:y,onDoubleClick:()=>l(320)}),(0,U.jsxs)(`header`,{className:`sp-header`,children:[(0,U.jsx)(`h2`,{className:`sp-title`,children:a(`sp.title`)}),(0,U.jsx)(`button`,{ref:p,type:`button`,className:`btn-icon-sm`,onClick:g,"aria-label":a(`sp.close`),title:a(`sp.closeShort`),children:o?(0,U.jsx)(Bn,{size:14}):(0,U.jsx)(Vt,{size:14})})]}),(0,U.jsxs)(`div`,{className:`sp-body`,children:[x&&(0,U.jsx)(eE,{id:`answer`,title:a(`sp.section.answer`),children:(0,U.jsx)(qT,{messages:t,busy:n})}),(0,U.jsx)(mE,{sessionId:e,busy:n}),(0,U.jsx)(eE,{id:`context`,title:a(`sp.section.context`),children:(0,U.jsx)(`div`,{className:`sp-context`,children:(0,U.jsx)(xT,{sessionId:e,busy:n,onUsage:r})})}),(0,U.jsx)(DE,{sessionId:e,busy:n,onJumpToMessage:i}),(0,U.jsx)(IE,{sessionId:e,busy:n,onJumpToMessage:i})]})]})]})}function GE({messages:e,busy:t}){let n=q(),r=dl(HE),i=BT(e=>r?e.overlayOpen:e.open),a=BT(e=>e.setOpen),o=BT(e=>e.setOverlayOpen),s=VT(e,t),c=!i&&s?.kind===`turn`&&s.turn.turnSummary?HT(s.turn.turnSummary):!1,l=n(i?`sp.hide`:c?`sp.showWarn`:`sp.show`);return(0,U.jsx)(`button`,{type:`button`,className:`btn-icon-sm sp-toggle${i?` active`:``}${c?` is-warn`:``}`,onClick:()=>r?o(!i):a(!i),"aria-label":l,"aria-pressed":i,title:l,children:c?(0,U.jsx)(An,{size:15}):i?(0,U.jsx)(Vt,{size:15}):(0,U.jsx)(Ut,{size:15})})}function KE({isPrivate:e,onToggle:t}){return(0,U.jsx)(`button`,{className:`btn-icon-sm task-header-private`,onClick:t,title:e?`Turn off private chat. This chat isn't saved to memory.`:`Turn on private chat. It won't be saved to memory.`,"aria-label":e?`Turn off private chat`:`Turn on private chat`,"data-private":e?`true`:void 0,children:e?(0,U.jsx)(Pe,{size:15}):(0,U.jsx)(Ie,{size:15})})}function qE({sessionId:e}){let t=q(),{env:n,change:r}=Gw(e),[i,a]=(0,V.useState)(null);return!n||n.internet?null:(0,U.jsxs)(`div`,{className:`offline-notice`,role:`status`,children:[(0,U.jsx)(In,{size:13,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{children:[t(`offline.text`),i&&(0,U.jsxs)(`span`,{className:`offline-notice-error`,children:[` `,t(`offline.error`,{error:i})]})]}),(0,U.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>{a(null),r(()=>Ds(e,!0)).catch(e=>{a(e instanceof _a?e.detail||e.message:String(e))})},children:t(`offline.turnOn`)})]})}function JE({message:e,onDismiss:t}){return e?(0,U.jsxs)(`div`,{className:`export-error-bar`,role:`alert`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`button`,{type:`button`,className:`btn-icon-sm`,onClick:t,"aria-label":`Dismiss export error`,children:(0,U.jsx)(Bn,{size:13})})]}):null}function YE(){return`screenshot-${new Date().toISOString().slice(0,19).replace(/[T:]/g,`-`)}.png`}function XE(){let[e,t]=(0,V.useState)([]),n=(0,V.useRef)(!0);(0,V.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]);let r=(0,V.useCallback)(async e=>{try{let r=await rs(e.file);if(!n.current)return;t(t=>t.map(t=>t.id===e.id?{...t,uploading:!1,uploaded:!0,serverUrl:r.url}:t))}catch(r){if(s.chat.error(`Upload failed: ${e.name}`,r),!n.current)return;let i=r instanceof Error?r.message:`Upload failed`;t(t=>t.map(t=>t.id===e.id?{...t,uploading:!1,error:i}:t))}},[]),i=(0,V.useCallback)(e=>{for(let n of e){let e=n.type.startsWith(`image/`),i={id:`attach-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,file:n,name:n.name||(e?YE():`file`),url:e?URL.createObjectURL(n):``,uploading:!0,uploaded:!1,isImage:e};t(e=>[...e,i]),r(i)}},[r]),a=(0,V.useCallback)(e=>{let t=Array.from(e.clipboardData?.items??[]).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);return t.length!==0&&(e.preventDefault(),i(t),!0)},[i]),o=(0,V.useCallback)(e=>{t(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)})},[]),c=(0,V.useCallback)(()=>{t(e=>(e.forEach(e=>{e.url&&URL.revokeObjectURL(e.url)}),[]))},[]),l=(0,V.useCallback)(t=>{let n=e.filter(e=>e.uploaded&&e.serverUrl).map(e=>e.isImage?``:`[${e.name}](${e.serverUrl})`).join(`
|
|
65
|
+
`);return n?t?`${t}\n\n${n}`:n:t},[e]);return{attachments:e,addFiles:i,handlePaste:a,remove:o,clear:c,hasUploaded:e.some(e=>e.uploaded),uploading:e.some(e=>e.uploading),compose:l}}function ZE({sessionId:e,isStreaming:t,isStale:n,setMessages:r,refreshContext:i}){let[a,o]=(0,V.useState)(null),c=a?.state.status===`running`,l=(0,V.useRef)(!1);l.current=c;let u=(0,V.useRef)(a);u.current=a,(0,V.useEffect)(()=>{o(null)},[e]);let d=(0,V.useCallback)((r,i)=>{t||l.current||(s.chat.info(`Retrying message ${r.id} with ${i}`),o({messageId:r.id,state:{status:`running`,model:i},keeping:null}),ra(e,r.id,i).then(e=>{n()||o(t=>t&&t.messageId===r.id?{...t,state:{status:`ready`,result:e}}:t)}).catch(e=>{s.chat.error(`Retry with ${i} failed`,e),!n()&&o(t=>t&&t.messageId===r.id?{...t,state:{status:`failed`,model:i,error:e instanceof Error?e.message:String(e)}}:t)}))},[e,t,n]),f=(0,V.useCallback)(async t=>{if(!a)return;let{messageId:c}=a;o({...a,keeping:t});try{let a=await ia(e,c,t);if(n())return;if(a.kept===`retry`){let e=a.stats;r(H.getState().messages.map(t=>t.id===c?{...t,content:a.content,stats:{...t.stats,...e,tokens_per_second:e.tokens_per_second??0,time_to_first_token:e.time_to_first_token??0,input_tokens:e.input_tokens??0,output_tokens:e.output_tokens??0,retried:!0}}:t)),i()}o(null)}catch(e){if(s.chat.error(`Could not keep the chosen answer`,e),n())return;o(t=>t&&{...t,keeping:null,state:{status:`failed`,model:t.state.status===`ready`?t.state.result.model:t.state.model,error:e instanceof Error?e.message:String(e)}})}},[a,e,r,n,i]);return{comparison:a,comparing:c,comparingRef:l,handleRetryWith:d,handleKeepAnswer:f,handleCloseComparison:(0,V.useCallback)(()=>{a?.state.status===`ready`?f(`original`):o(null)},[a,f]),closeForNewTurn:(0,V.useCallback)(()=>{let t=u.current;t&&(t.state.status===`ready`&&ia(e,t.messageId,`original`).catch(e=>s.chat.error(`Could not close the answer comparison`,e)),o(null))},[e])}}function QE(e,t){let[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(null);(0,V.useEffect)(()=>{r(null),a(null)},[e]);let o=(0,V.useCallback)(()=>{ta(e).then(e=>{t()||(e.available?(r(e),a(null)):(r(null),a(e.reason)))}).catch(t=>s.chat.error(`Could not measure the context for session=${e}`,t))},[e,t]);return(0,V.useEffect)(()=>{o()},[o]),{contextUsage:n,contextUnavailable:i,refreshContext:o,showContextUsage:(0,V.useCallback)(e=>{r(e),a(null)},[])}}function $E(e,t){return(0,V.useCallback)(n=>{let r=e.current?.querySelector(`[data-message-id="${n}"]`);if(!r)return!1;let i=r.previousElementSibling,a=i?.dataset.role===`user`?i:r;return t.current=!1,a.scrollIntoView?.({block:`start`,behavior:Hx()}),r.classList.add(`msg-jump-target`),window.setTimeout(()=>r.classList.remove(`msg-jump-target`),1600),!0},[e,t])}function eD(e,t){let[n,r]=(0,V.useState)(null);(0,V.useEffect)(()=>{r(null)},[e]);let i=(0,V.useCallback)(()=>r(null),[]);return{exportChat:(0,V.useCallback)(async()=>{r(null);try{let n=await To(e),r=new Blob([n.content],{type:`text/markdown`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${(t||`chat`).replace(/[/\\:*?"<>|]/g,`_`).slice(0,100)}.md`,a.click(),URL.revokeObjectURL(i)}catch(e){s.chat.error(`Export failed`,e),r(e instanceof _a?`Couldn't export this chat: GAIA's backend returned an error (HTTP ${e.httpStatus}). Try Export again; if it keeps failing, check the backend log.`:`Couldn't export this chat because GAIA's backend isn't reachable. Check that GAIA is running, then try Export again.`)}},[e,t]),exportError:n,clearExportError:i}}var tD=5200;function nD(e=tD){let[t,n]=(0,V.useState)(null),r=(0,V.useRef)(null),i=(0,V.useCallback)(()=>{r.current&&=(clearTimeout(r.current),null)},[]),a=(0,V.useCallback)(()=>{i(),n(null)},[i]),o=(0,V.useCallback)(t=>{i(),n(t),r.current=setTimeout(()=>{r.current=null,n(null)},e)},[i,e]);return(0,V.useEffect)(()=>i,[i]),{policyToast:t,showPolicyToast:o,dismissPolicyToast:a}}var rD=`gaia`;function iD(e){return e.some(e=>e.id===rD)}function aD(e){let t=e;return t?.httpStatus===422&&`${typeof t.detail==`string`?t.detail:``} ${typeof t.message==`string`?t.message:``}`.includes(`Unknown agent_type '${rD}'`)}var oD=new Set([``,`new chat`,`new task`,`untitled`,`untitled session`,`chat`]);function sD(e){return oD.has((e??``).trim().toLowerCase())}function cD(e,t){let n=()=>typeof document<`u`&&document.visibilityState===`hidden`,r=setInterval(()=>{n()||e()},t),i=()=>{n()||e()};return document.addEventListener(`visibilitychange`,i),()=>{clearInterval(r),document.removeEventListener(`visibilitychange`,i)}}function lD(e){let t=()=>typeof document<`u`&&document.visibilityState===`hidden`,n=t()?null:e(),r=()=>{t()?(n?.(),n=null):n||=e()};return document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`visibilitychange`,r),n?.(),n=null}}function uD(e,t=``){let[n,r]=(0,V.useState)(()=>e&&Fi(e)||t),i=(0,V.useRef)(e);return(0,V.useEffect)(()=>{i.current!==e&&(i.current=e,r(e?Fi(e):``))},[e]),(0,V.useEffect)(()=>{e&&i.current===e&&Ii(e,n)},[e,n]),[n,r]}function dD(e,t){return uD(t?null:Ni(e))}var fD=new Set([`tool_start`,`tool_end`,`tool_result`]),pD=`Connection lost. Reconnecting`,mD=15e3,hD=[],gD=new Map;function _D({text:e}){return(0,U.jsx)(`div`,{className:`history-notice`,role:`note`,children:e})}function vD({sessionId:e}){let t=q(),{sessions:n,messages:r,setMessages:i,addMessage:a,removeMessage:o,removeMessagesFrom:c,updateSessionInList:l,isStreaming:u,streamingContent:d,setStreaming:f,setStreamContent:p,clearStreamContent:m,agentSteps:h,addAgentStep:g,updateLastAgentStep:_,appendThinkingContent:y,updateLastToolStep:b,clearAgentSteps:x,cards:S,appendCard:C,clearCards:w,documents:T,setDocuments:E,setShowDocLibrary:D,setShowFileBrowser:O,isLoadingMessages:k,setLoadingMessages:A,systemStatus:j}=H(),M=wc(e=>e.addNotification),N=wc(e=>e.showPanel),ee=wc(e=>e.setShowPanel),P=wc(e=>e.setTypeFilter),F=H(t=>t.pendingPrompt?.sessionId===e?t.pendingPrompt:null),te=H(e=>e.liveStatus),ne=H(e=>e.awaitingUser),re=H(t=>Object.values(t.liveQuestions).some(t=>t.sessionId===e)),I=wc(t=>Dc(e)(t)!==null),L=n.find(t=>t.id===e),ie=new Set(L?.document_ids??[]),ae=T.filter(e=>ie.has(e.id)),[oe,se]=dD(e,L?.private),[ce,le]=(0,V.useState)(!1),[de,fe]=(0,V.useState)(``),[R,z]=(0,V.useState)(!1),[pe,me]=(0,V.useState)(!1),he=XE(),[ge,_e]=(0,V.useState)(!1),[ve,ye]=(0,V.useState)(null),{policyToast:be,showPolicyToast:xe,dismissPolicyToast:Se}=nD(),[Ce,we]=(0,V.useState)(null),{exportChat:Te,exportError:Ee,clearExportError:De}=eD(e,L?.title),ke=L?.agent_type&&L.agent_type!==`gaia`?L.agent_type:null,[Ae,je]=(0,V.useState)(!1),[Me,Ne]=(0,V.useState)(null),Pe=(0,V.useRef)(``),Fe=(0,V.useRef)([]),Ie=(0,V.useRef)([]),Le=(0,V.useRef)(!1);(0,V.useEffect)(()=>{d&&(Pe.current=d)},[d]),(0,V.useEffect)(()=>{h.length>0&&(Fe.current=h.map(e=>({...e,active:!1})))},[h]),(0,V.useEffect)(()=>{S.length>0&&(Ie.current=[...S])},[S]),(0,V.useEffect)(()=>{if(!u&&Le.current){je(!0);let e=setTimeout(()=>{je(!1),Pe.current=``,Fe.current=[],Ie.current=[]},350);return()=>clearTimeout(e)}Le.current=u},[u]);let Re=(0,V.useRef)(null),ze=(0,V.useRef)(null),Be=(0,V.useRef)(null),Ve=(0,V.useRef)(null),He=(0,V.useRef)(0),Ue=(0,V.useRef)(!1),Ge=(0,V.useRef)(0),Ke=(0,V.useRef)(null),[qe,Je]=(0,V.useState)(!1),Ye=(0,V.useRef)(!1),Xe=(0,V.useRef)(null),Ze=(0,V.useRef)(null),$e=(0,V.useRef)(0),et=(0,V.useRef)(!1),tt=(0,V.useRef)(()=>{}),nt=H(t=>t.messageQueues[e]??hD),rt=(0,V.useCallback)(t=>H.getState().updateQueue(e,t),[e]),it=(0,V.useRef)(!1),[at,ot]=(0,V.useState)(!1),st=(0,V.useRef)(!1),ct=(0,V.useRef)(!1),lt=(0,V.useRef)(u);lt.current=u;let ut=H(t=>!!t.queueHolds[e]),dt=(0,V.useRef)(``),ft=(0,V.useRef)(null),pt=(0,V.useRef)(null),mt=(0,V.useRef)(0),ht=(0,V.useRef)(!0),gt=(0,V.useCallback)(()=>H.getState().currentSessionId!==e,[e]),_t=(0,V.useCallback)(()=>{ft.current=null,!gt()&&dt.current&&p(dt.current)},[p,gt]),vt=(0,V.useRef)(0),yt=(0,V.useRef)(0);(0,V.useEffect)(()=>{s.chat.info(`ChatView mounted for session=${e}, loading messages...`);let t=s.chat.time();A(!0);let n=!1,r=!1,a=async(a=!1)=>{if(n||r)return;r=!0;let o=yt.current;try{if(!a){if(H.getState().isStreaming)return;let t=await Co(e);if(n||t===vt.current||H.getState().isStreaming)return}let r=await wo(e);if(n)return;let c=TC(r.messages);a&&yt.current!==o?vt.current=c.length:a?(i(c),vt.current=c.length,s.chat.timed(`Loaded ${c.length} message(s) for session=${e}`,t)):c.length!==vt.current&&!H.getState().isStreaming&&(s.chat.info(`Messages changed externally: ${vt.current} -> ${c.length}`),i(c),vt.current=c.length)}catch(t){if(n)return;a&&(s.chat.error(`Failed to load messages for session=${e}`,t),i([]))}finally{r=!1,!n&&a&&A(!1)}};a(!0);let o=cD(()=>a(!1),3e3);return()=>{n=!0,o()}},[e,i,A]),(0,V.useEffect)(()=>{Ho().then(e=>E(e.documents||[])).catch(e=>s.doc.error(`Could not load the document list`,e))},[E]);let bt=(0,V.useRef)(!0),xt=(0,V.useRef)(!1);(0,V.useEffect)(()=>(bt.current=!0,()=>{bt.current=!1}),[]),(0,V.useEffect)(()=>{let e=F?.text;e&&!H.getState().isLoadingMessages&&(H.getState().setPendingPrompt(null),xt.current=!0,setTimeout(()=>{xt.current=!1,bt.current&&tt.current(e,{opening:!0})},0))},[F,k]),(0,V.useEffect)(()=>{if(!ht.current)return;let e=Date.now()-mt.current,t=()=>{mt.current=Date.now(),Re.current?.scrollIntoView({behavior:Hx()})};e>=100&&t(),pt.current&&clearTimeout(pt.current),pt.current=setTimeout(t,100)},[r,d,h]),(0,V.useEffect)(()=>{Be.current?.focus()},[e]),(0,V.useEffect)(()=>{it.current=!1},[e]);let{contextUsage:St,contextUnavailable:Ct,refreshContext:wt,showContextUsage:Tt}=QE(e,gt),{comparison:Et,comparing:Dt,comparingRef:B,handleRetryWith:Ot,handleKeepAnswer:kt,handleCloseComparison:At,closeForNewTurn:jt}=ZE({sessionId:e,isStreaming:u,isStale:gt,setMessages:i,refreshContext:wt});(0,V.useEffect)(()=>()=>{lt.current&&YC(e),Ve.current&&!ct.current&&Ve.current.abort(),Ve.current&&=null,Xe.current&&=(clearTimeout(Xe.current),null),Ye.current=!1,Ze.current=null,Je(!1),ft.current!==null&&(cancelAnimationFrame(ft.current),ft.current=null),pt.current&&=(clearTimeout(pt.current),null),Ke.current&&=(clearTimeout(Ke.current),null),Se(),dt.current=``,H.getState().resetStreaming()},[e]),(0,V.useEffect)(()=>{Ce&&N&&(document.getElementById(EC(Ce))?.scrollIntoView({behavior:Hx(),block:`center`}),we(null))},[Ce,N]);let Mt=(0,V.useCallback)(()=>{let e=ze.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;ht.current=t<=80,me(t>200)},[]),Nt=BT(e=>e.width),Pt=BT(e=>e.reveal),Ft=$E(ze,ht),It=(0,V.useCallback)(()=>{ht.current=!0,Re.current?.scrollIntoView({behavior:Hx()})},[]),Lt=(0,V.useCallback)(()=>{Ye.current||(Ye.current=!0,it.current=!0,Je(!0),wc.getState().dismissSessionPrompts(e),H.getState().closeSessionQuestions(e),s.stream.warn(`User stopped generation; waiting for the server to close the turn`),$i(e).catch(e=>{s.stream.error(`Stop request failed; waiting for the stream to close`,e)}),Ke.current?(clearTimeout(Ke.current),Ke.current=null,Ze.current?.()):Xe.current=setTimeout(()=>{s.stream.error(`No closing event ${mD}ms after Stop; closing the turn locally (session=${e})`),Ze.current?.()},mD))},[e]);(0,V.useEffect)(()=>{let e=e=>{e.key===`Escape`&&u&&!Di(e)&&(e.preventDefault(),Lt())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u,Lt]);let Rt=(0,V.useCallback)(async(t,n)=>{let r=n?.attach===!0,c=n?.queued===!0,d=r?n?.reconnect??0:0,h=(t||oe).trim(),v=!c&&he.hasUploaded;ht.current=!0;let S=j?.init_state===`initializing`,T=e=>{c&&n?.onQueuedOutcome?.(e)};if(!r&&ke){s.chat.warn(`Send blocked: chat ${e} belongs to the retired "${ke}" agent`),T({kind:`failed`,error:`This chat's "${ke}" agent was retired, so it cannot take new messages.`});return}let E=!n?.opening&&(H.getState().messageQueues[e]??hD).length>0;if(r){if(u&&!d)return}else if(!c&&(h||v)&&!S&&(u||B.current||E)){rt(e=>Xr(e,he.compose(h),`queued`)),se(``),he.clear(),Be.current?.focus();return}else if(!h&&!v||u||S){T({kind:`busy`}),!h&&!v&&s.chat.debug(`Send blocked: empty message`),u&&s.chat.debug(`Send blocked: already streaming`),S&&s.chat.debug(`Send blocked: system initializing`);return}let D=h,O=null;if(r)s.chat.info(`Re-attaching to background run for session=${e}${d?` (reconnect ${d})`:``}`);else{D=c?h:he.compose(h),s.chat.info(`Sending message to session=${e}`,{length:D.length,preview:D.slice(0,80)}),c||(se(``),Be.current?.focus(),he.clear()),jt();let t={id:Date.now(),session_id:e,role:`user`,content:D,created_at:new Date().toISOString(),rag_sources:null};a(t),O=t,yt.current+=1}d||(Ge.current=0),f(!0),m(),x(),w(),$e.current=0,et.current=!1,d&&H.getState().setLiveStatus(`${pD} (attempt ${d} of 3)…`),s.stream.info(`Starting agent stream...`);let k=s.stream.time(),A=``,N;Ne(null);let ee=!1;st.current=!1,r||ot(!1);let P=null,F=!c;ct.current=c;let te=e=>{F||(F=!0,ct.current=!1,n?.onQueuedOutcome?.(e),e.kind===`accepted`&>()&&P?.abort())},ne=r||!!L&&!sD(L.title),re=()=>{te({kind:`accepted`}),!ne&&(ne=!0,vo(e).then(t=>l(e,{title:t.title})).catch(e=>s.chat.warn(`Could not refresh the chat title`,e)))};dt.current=``,Ye.current=!1,Je(!1);let I=()=>{Xe.current&&=(clearTimeout(Xe.current),null),Ye.current=!1,Ze.current=null,Je(!1)},ie=()=>{let{agentSteps:e,cards:t}=H.getState();return{steps:e.map(e=>({...e,active:!1})),cards:[...t]}};Ze.current=()=>{if(ee)return;ee=!0,Ue.current=!0,He.current=Date.now(),I(),te({kind:`failed`,error:`Stopped before GAIA confirmed it got this message.`}),Ve.current?.abort(),Ve.current=null,ft.current!==null&&(cancelAnimationFrame(ft.current),ft.current=null);let t=dt.current||H.getState().streamingContent;if(dt.current=``,gt())return;let{steps:n,cards:r}=ie();a({id:Date.now()+1,session_id:e,role:`assistant`,content:t,created_at:new Date().toISOString(),rag_sources:null,agentSteps:n.length>0?n:void 0,cards:r.length>0?r:void 0,stopState:`unconfirmed`}),f(!1),m(),x(),w()};let ae={onConnected:()=>{if(gt())return;let e=H.getState();(e.liveStatus===`Waiting for GAIA to start this answer…`||e.liveStatus?.startsWith(pD))&&e.setLiveStatus(null)},onChunk:t=>{if(re(),gt())return;H.getState().awaitingUser&&H.getState().setAwaitingUser(!1);let n=t.content||``;if(n&&wc.getState().dismissSessionPrompts(e),n){if(t.type===`answer`)A=n;else{et.current&&=(A.length>0&&(A+=`
|
|
66
|
+
|
|
67
|
+
`),!1),A+=n;let e=H.getState().agentSteps,t=e[e.length-1];t?.type===`thinking`&&t.active&&_({active:!1,latencyMs:Date.now()-t.timestamp})}let e=A.replace(SC,``).trim();if(e=CC(e),e){let t=e.lastIndexOf(`{`);if(t>-1){let n=e.slice(t);/^\{\s*"(?:thought|answer|goal|tool)"/.test(n)&&(n.match(/\{/g)||[]).length>(n.match(/\}/g)||[]).length&&(e=e.slice(0,t).trim())}}dt.current=e,ft.current===null&&(ft.current=requestAnimationFrame(_t))}},onAgentEvent:t=>{if((t.type!==`status`||t.phase!==`waiting`)&&re(),t.type===`followup_taken`&&t.text){let n=t.text;if(rt(e=>ri(e,n)),gt())return;a({id:Date.now(),session_id:e,role:`user`,content:n,created_at:new Date().toISOString(),rag_sources:null});return}if(t.type===`followup_unavailable`){gt()||ot(!0);return}if(t.type===`followup_returned`){let e=t.texts??[];rt(t=>ii(t,e));return}if(gt())return;if(t.type===`context_usage`){Tt(t);return}let n=t.type===`permission_request`||t.type===`needs_input`;if(H.getState().awaitingUser!==n&&H.getState().setAwaitingUser(n),fD.has(t.type)&&wc.getState().dismissSessionPrompts(e),t.type===`permission_request`){let n=t.tool||``,r=t.tool_label||n,{addNotification:i,notifications:a}=wc.getState(),o=t.confirm_id?a.find(e=>e.id===t.confirm_id):void 0;if(o){!o.response&&o.dismissed&&wc.setState(e=>({notifications:e.notifications.map(e=>e.id===o.id?{...e,dismissed:!1}:e)}));return}let s=n===hc,c=s&&xc(a,e,t.args);i({id:t.confirm_id??`perm-${Date.now()}`,type:`permission_request`,agentId:e,sessionId:e,agentName:`GAIA`,title:s?vc(t.args,c):`Allow ${r}?`,message:s?_c(t.args,c):`GAIA needs your OK before ${r}.`,timestamp:Date.now(),read:!1,dismissed:!1,priority:`high`,tool:n,toolArgs:t.args,confirmId:t.confirm_id,alwaysScope:typeof t.always_scope==`string`?t.always_scope:void 0,alwaysLabel:typeof t.always_label==`string`&&t.always_label?t.always_label:void 0,toolLabel:t.tool_label||void 0,risk:typeof t.risk==`string`?t.risk:void 0,summary:typeof t.summary==`string`&&t.summary?t.summary:void 0,timeoutSeconds:t.timeout_seconds});return}if(t.type===`needs_confirmation`){C({render:`needs_confirmation`,data:{action:typeof t.action==`string`?t.action:``,summary:typeof t.summary==`string`?t.summary:``}});return}if(t.type===`needs_input`){if(!t.request_id){console.error(`[ChatView] needs_input event missing request_id, ignoring`);return}H.getState().openQuestion(t.request_id,e,typeof t.timeout_seconds==`number`?t.timeout_seconds:null),C({render:`needs_input`,data:{session_id:e,request_id:t.request_id,question:typeof t.question==`string`?t.question:``,options:Array.isArray(t.options)?t.options:[],allow_free_text:t.allow_free_text!==!1,sensitive:!!t.sensitive}});return}if(t.type===`policy_alert`){let n=t.tool||`unknown tool`,r=t.reason||t.message||t.content||`Tool execution was blocked by governance policy.`,i={id:t.receipt_id??`policy-${Date.now()}-${$e.current+1}`,type:`policy_alert`,agentId:e,agentName:`GAIA`,title:`Blocked: ${n} is restricted by policy.`,message:r,timestamp:Date.now(),read:!1,dismissed:!1,priority:`critical`,tool:n,decision:t.decision||`BLOCK`,reason:r,ruleIds:t.rule_ids??[],policyVersion:t.policy_version,receiptId:t.receipt_id};M(i);let a=xC(t,$e);a&&g(a),xe({tool:n,receiptId:t.receipt_id});return}if((t.type===`tool_end`||t.type===`tool_result`)&&H.getState().livePhase===`tool`&&H.getState().setLiveStatus(null),t.type===`tool_end`){b({active:!1,success:t.success!==!1});return}if(t.type===`tool_result`){typeof t.render==`string`&&t.render.length>0&&C({render:t.render,data:t.data});let e={result:t.summary||t.title||`Done`,active:!1,success:t.success!==!1,latencyMs:t.latency_ms};t.command_output&&(e.commandOutput={command:t.command_output.command,stdout:t.command_output.stdout,stderr:t.command_output.stderr,returnCode:t.command_output.return_code,expectedExit:t.command_output.expected_exit,cwd:t.command_output.cwd,durationSeconds:t.command_output.duration_seconds,truncated:t.command_output.truncated}),t.mcp_output?.text&&(e.mcpOutput=t.mcp_output),t.result_data?.chunks&&t.result_data.chunks.length>0&&(e.retrievalChunks=t.result_data.chunks.map(e=>({id:e.id,source:e.source,sourcePath:e.sourcePath,page:e.page,score:e.score,preview:e.preview,content:e.content}))),t.result_data?.type===`file_list`&&t.result_data.files?.length>0&&(e.fileList={files:t.result_data.files,total:t.result_data.total??t.result_data.files.length}),b(e);return}if(t.type===`tool_args`){let e=!!t.args&&Object.keys(t.args).length>0,n=t.detail||(e?JSON.stringify(t.args):``);b({...n?{detail:n}:{},...t.narration?{narration:t.narration}:{}});let r=H.getState(),i=[...r.agentSteps].reverse().find(e=>e.type===`tool`);t.narration&&i?.active&&r.livePhase===`tool`&&r.setLiveStatus(tb(i,Sl()),`tool`);return}if(t.type===`commentary`){A=``,et.current=!1,dt.current=``,p(``);let e=xC(t,$e);e&&g(e);return}if(t.type===`thinking`){let e=H.getState().agentSteps,n=e[e.length-1];if(n&&n.type===`thinking`){y(t.content||``);return}let r=xC(t,$e);r&&g(r);return}if(t.type===`status`){let e=t.status,n=(t.message||``).trim();if(e===`history_cut`){N=n||void 0,Ne(N??null);return}if(t.phase&&n&&H.getState().setLiveStatus(n,t.phase),t.phase===`waiting`||bC(t)||n.toLowerCase().startsWith(`executing `))return;if(e===`working`||e===`warning`||e===`info`){let e=H.getState().agentSteps,r=e[e.length-1];if(r&&r.type===`status`&&r.active){_({label:n||`Working`,detail:n});return}if(r&&r.type===`thinking`&&r.active){_({label:n||`Thinking`});return}let i=xC(t,$e);i&&g(i)}return}if(t.type===`step`||t.type===`agent_error`&&wC(t,H.getState().agentSteps))return;let r=xC(t,$e);r&&(g(r),t.type===`tool_start`&&(et.current=!0,H.getState().setLiveStatus(tb(r,Sl()),`tool`)))},onDone:t=>{if(re(),wc.getState().dismissSessionPrompts(e),H.getState().closeSessionQuestions(e),ee)return;ee=!0;let n=t.cancelled===!0?`stopped`:Ye.current&&t.message_id==null?`unconfirmed`:void 0;if(I(),ft.current!==null&&(cancelAnimationFrame(ft.current),ft.current=null),dt.current=``,gt())return;He.current=Date.now(),st.current=!0;let o=H.getState();o.setRunningSessions(o.runningSessionIds.filter(t=>t!==e));let c=t.content||A;s.chat.timed(`Agent response complete: ${c.length} chars${n?` (${n})`:``}`,k);let{steps:l,cards:u}=ie(),d=l.some(e=>e.type===`policy_alert`);if(c||d||n){vt.current=H.getState().messages.length+1;let r={id:t.message_id||Date.now()+1,session_id:e,role:`assistant`,content:c,created_at:new Date().toISOString(),rag_sources:null,agentSteps:l.length>0?l:void 0,stats:t.stats||void 0,turnSummary:t.turn_summary||void 0,cards:u.length>0?u:void 0,stopState:n,historyNotice:N};N&&gD.set(r.id,N),a(r)}f(!1),m(),x(),w(),Be.current&&Be.current.focus(),setTimeout(()=>{wo(e).then(t=>{if(gt()||H.getState().isStreaming)return;let n=H.getState().messages,o=n.filter(e=>e.cards&&e.cards.length>0),s=TC(t.messages).map(e=>{let t=o.find(t=>t.id===e.id||t.role===e.role&&t.content===e.content);return{...e,cards:t?.cards,stopState:n.find(t=>t.id===e.id)?.stopState}});i(s),vt.current=s.length,r&&!c&&s[s.length-1]?.role===`user`&&a({id:Date.now()+2,session_id:e,role:`assistant`,content:VC,created_at:new Date().toISOString(),rag_sources:null})}).catch(t=>s.chat.error(`Could not refresh messages for session=${e}`,t))},300)},onError:t=>{let n=HC(t),i=F&&!r&&!n&&!!O&&nw(e,D,t);if(!F||i){if(n)re();else{if(te(ew(t)?{kind:`busy`}:{kind:`failed`,error:UC(t)??(t.message||`Unknown error`)}),He.current=Date.now(),I(),ft.current!==null&&(cancelAnimationFrame(ft.current),ft.current=null),dt.current=``,gt())return;s.chat.info(`Queued message for session=${e} not taken: ${t.message}`),O&&o(O.id),st.current=!0,f(!1),m(),x(),w();return}}if(n&&Ye.current&&!ee){s.chat.warn(`Stream for session=${e} was lost while stopping; closing the turn locally`),Ze.current?.();return}if(n&&!ee&&!gt()&&Ge.current<3){let n=++Ge.current,r=BC[n-1]??0;s.chat.warn(`Stream for session=${e} lost (${t.name}); reconnecting in ${r}ms (${n}/3)`),H.getState().setLiveStatus(`${pD} (attempt ${n} of 3)…`);let i=()=>{Ke.current=null,!(gt()||Ye.current)&&tt.current(void 0,{attach:!0,reconnect:n})};r>0?Ke.current=setTimeout(i,r):i();return}He.current=Date.now(),wc.getState().dismissSessionPrompts(e),H.getState().closeSessionQuestions(e);let c=Ye.current;if(I(),ft.current!==null&&(cancelAnimationFrame(ft.current),ft.current=null),dt.current=``,gt())return;if(n||(st.current=!0),s.chat.error(`Chat error for session=${e}`,t),c){let{steps:n,cards:r}=ie();a({id:Date.now()+2,session_id:e,role:`assistant`,content:A,created_at:new Date().toISOString(),rag_sources:null,agentSteps:n.length>0?n:void 0,cards:r.length>0?r:void 0,stopState:`stopped`,stopError:t.message||`Unknown error`}),vt.current=H.getState().messages.length,f(!1),m(),x(),w();return}let l,u=t.message||``,d=`
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
*Unexpected error?* [Report it on GitHub](${mw(u.slice(0,80))})`;l=UC(t)||(u.includes(`Lemonade`)||u.includes(`LLM`)||u.includes(`Could not get response`)?`The model server did not answer. Open Settings → Model to check it, then send your message again.
|
|
71
|
+
|
|
72
|
+
Details: ${u}`+d:t instanceof TypeError||u.includes(`fetch`)||u.includes(`Failed to fetch`)||u.includes(`NetworkError`)?`Lost the connection to GAIA. Check that GAIA is still running, then send your message again.`+d:u.includes(`timed out`)||u.includes(`timeout`)||u.includes(`Timeout`)?`The request timed out. Try a shorter question, or a faster model in Settings → Model.`+d:`Error: ${u}`+d);let p={id:Date.now()+2,session_id:e,role:`assistant`,content:l,created_at:new Date().toISOString(),rag_sources:null};a(p),f(!1),m(),x(),w()}},ce=r?Vo(e,ae):ko(e,D,ae);P=ce,Ve.current=ce},[oe,he,u,e,L,ke,a,o,i,f,_t,m,l,g,_,y,b,x,C,w,M,gt]);tt.current=Rt;let zt=H(t=>t.runningSessionIds.includes(e)),Bt=H(e=>e.activeRunsAt>He.current);(0,V.useEffect)(()=>{PC()},[e]),(0,V.useEffect)(()=>{zt?!Bt||u||Ue.current||(s.chat.info(`Resuming live view of background run for session=${e}`),tt.current(void 0,{attach:!0})):Ue.current=!1},[e,zt,Bt,u]),(0,V.useEffect)(()=>{let e=e=>{let t=e.detail?.text;typeof t==`string`&&t.trim()&&tt.current(t)};return window.addEventListener(`gaia:send-message`,e),()=>window.removeEventListener(`gaia:send-message`,e)},[]),(0,V.useEffect)(()=>{!u&&Be.current&&Be.current.focus()},[u]);let Vt=(0,V.useCallback)(async t=>{u||(s.chat.info(`Deleting message ${t} from session=${e}`),ye(t),setTimeout(async()=>{o(t),ye(null);try{await Eo(e,t)}catch(n){s.chat.error(`Failed to delete message ${t}`,n),wo(e).then(e=>{gt()||i(TC(e.messages))}).catch(t=>s.chat.error(`Could not reload messages for session=${e}`,t))}},250))},[e,u,o,i,gt]),Ht=(0,V.useCallback)(async t=>{if(u||t.role!==`user`)return;let n=t.content;s.chat.info(`Resending message ${t.id} from session=${e}`,{preview:n.slice(0,80)}),c(t.id);try{await Do(e,t.id)}catch(n){s.chat.error(`Failed to delete messages from ${t.id}`,n),wo(e).then(e=>{gt()||i(TC(e.messages))}).catch(t=>s.chat.error(`Could not reload messages for session=${e}`,t));return}Rt(n)},[e,u,c,i,Rt,gt]);(0,V.useEffect)(()=>ZC(e),[e]);let Ut=H(()=>XC(e)),Wt=(0,V.useCallback)((e,t)=>new Promise(e=>{tt.current(t,{queued:!0,onQueuedOutcome:e})}),[]),Kt=u||Dt;(0,V.useEffect)(()=>{if(!Kt){if(it.current){it.current=!1;let e=nt.map(e=>e.text);e.length&&(rt(()=>[]),se(t=>[t.trim(),...e].filter(Boolean).join(`
|
|
73
|
+
|
|
74
|
+
`)))}else nt.length===0||ut||k||F||xt.current||ke||j?.init_state===`initializing`||gt()||!st.current&&!Ut||rw(e,Wt,()=>bt.current&&!gt()&&!H.getState().isStreaming&&!B.current)}},[Kt,nt,ut,Ut,k,F,ke,j?.init_state,e,Wt,gt]);let qt=(0,V.useRef)(!1);(0,V.useEffect)(()=>{qt.current&&!Kt&&wt(),qt.current=Kt},[Kt,wt]);let Jt=(0,V.useCallback)(t=>{let n=nt.find(e=>e.id===t&&e.state===`queued`);n&&u&&(rt(e=>Zr(e,t,`queued`,`sending`)),ea(e,n.text).then(()=>rt(e=>Zr(e,t,`sending`,`delivered`))).catch(e=>{s.chat.info(`Follow-up not taken by the running reply; it stays queued: ${e instanceof Error?e.message:e}`),rt(e=>$r(e,t))}))},[nt,u,e,rt]),Yt=(0,V.useCallback)(()=>{for(let e=r.length-1;e>=0;e--)if(r[e].role===`user`){Ht(r[e]);return}},[r,Ht]),Xt=()=>{fe(L?.title||``),le(!0)},Zt=async()=>{let t=de.trim().slice(0,200).trim();t&&de!==L?.title&&t!==L?.title&&(await go(e,{title:t,title_is_custom:!0}),l(e,{title:t})),le(!1)},Qt=(0,V.useCallback)(async()=>{if(e)try{let t=await So(e);l(e,{private:t.private})}catch(e){s.ui.warn(`Failed to toggle private mode`,e)}},[e,l]),$t=(0,V.useCallback)(async(t,n)=>{t.stopPropagation();let r=T.find(e=>e.id===n);s.doc.info(`Detaching document from session: ${r?.filename||n}`);try{await Zo(e,n);let t=(H.getState().sessions.find(t=>t.id===e)?.document_ids??[]).filter(e=>e!==n);l(e,{document_ids:t}),t.length<=3&&_e(!1),s.doc.info(`Detached document from session: ${r?.filename||n}`)}catch(e){s.doc.error(`Failed to detach document: ${r?.filename||n}`,e)}},[T,e,l]),en=(0,V.useCallback)(async t=>{if(t.preventDefault(),t.stopPropagation(),z(!1),t.dataTransfer.files.length!==0){for(let n of Array.from(t.dataTransfer.files)){s.doc.info(`Dropped on chat view: ${n.name}`);try{let t=await Wo(n);if(e&&t?.id)try{await Xo(e,t.id);let r=H.getState().sessions.find(t=>t.id===e)?.document_ids??[];r.includes(t.id)||l(e,{document_ids:[...r,t.id]}),s.doc.info(`Auto-attached "${n.name}" to session ${e}`)}catch(e){s.doc.warn(`Could not attach dropped document to session: ${e}`)}}catch(e){s.doc.error(`Upload failed: ${n.name}`,e)}}try{let e=await Ho();E(e.documents||[])}catch(e){s.doc.error(`Could not refresh the document list after a drop`,e)}}},[e,l,E]),tn=e=>{e.preventDefault(),e.stopPropagation(),z(!0)},nn=e=>{e.preventDefault(),e.stopPropagation(),z(!1)},rn=r.length>0?r[r.length-1]:void 0,an=!u&&!k&&rn?.role===`assistant`&&Ub(rn.content),on=(0,V.useMemo)(()=>{let e=new Map,t;for(let n of r)if(n.role===`user`&&n.created_at)t=new Date(n.created_at).getTime();else if(n.role===`assistant`&&n.created_at&&t!==void 0){let r=new Date(n.created_at).getTime();r>t&&e.set(n.id,r-t),t=void 0}return e},[r]),sn=ke?`This chat used the retired "${ke}" agent and is read-only. Start a new chat.`:j?.init_state===`initializing`?ul:null;return(0,U.jsxs)(`main`,{className:`task-view ${R?`drag-active`:``}`,style:{"--session-panel-w":`${Nt}px`},onDrop:en,onDragOver:tn,onDragLeave:nn,"aria-label":L?.title||`Chat`,children:[(0,U.jsxs)(`header`,{className:`task-header`,children:[(0,U.jsx)(`div`,{className:`task-header-left`,children:ce?(0,U.jsx)(`input`,{className:`title-edit`,value:de,maxLength:200,onChange:e=>fe(e.target.value),onBlur:Zt,onKeyDown:e=>{e.key===`Enter`&&Zt(),e.key===`Escape`&&(e.preventDefault(),le(!1))},...Ci,autoFocus:!0,"aria-label":`Chat title`,dir:`auto`}):(0,U.jsxs)(`button`,{type:`button`,className:`task-title`,onClick:Xt,title:t(`row.rename`),children:[(0,U.jsx)(`span`,{children:L?.title||t(`sidebar.newChat`)}),(0,U.jsx)(Gt,{size:12,"aria-hidden":`true`,className:`task-title-edit`})]})}),(0,U.jsxs)(`div`,{className:`task-header-right`,children:[(0,U.jsx)(KE,{isPrivate:!!L?.private,onToggle:Qt}),(0,U.jsx)(`button`,{className:`btn-icon-sm`,onClick:()=>O(!0),title:`Browse files on this PC`,"aria-label":`Browse files on this PC`,children:(0,U.jsx)(Qe,{size:15})}),(0,U.jsx)(`button`,{className:`btn-icon-sm`,onClick:Te,title:`Export as Markdown`,"aria-label":`Export chat`,children:(0,U.jsx)(Oe,{size:15})}),(0,U.jsx)(GE,{messages:r,busy:u})]})]}),ae.length>0&&(()=>{let e=[...ae].sort((e,t)=>{let n=e.last_accessed_at||e.indexed_at||``;return(t.last_accessed_at||t.indexed_at||``).localeCompare(n)}),t=ge?e:e.slice(0,3),n=e.length-3;return(0,U.jsxs)(`div`,{className:`doc-context-bar${ge?` doc-context-expanded`:``}`,"aria-label":`${ae.length} indexed document${ae.length===1?``:`s`}`,children:[(0,U.jsx)(ue,{size:12,className:`doc-context-icon`,"aria-hidden":`true`}),(0,U.jsxs)(`button`,{type:`button`,className:`doc-context-label`,onClick:()=>D(!0),title:`Manage documents`,children:[ae.length,` indexed`]}),(0,U.jsxs)(`div`,{className:`doc-context-pills${ge?` doc-context-pills-expanded`:``}`,children:[t.map(e=>(0,U.jsxs)(`span`,{className:`doc-pill`,title:e.filepath||e.filename,children:[(0,U.jsx)(We,{size:9,className:`doc-pill-icon`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`doc-pill-name`,children:e.filename}),(0,U.jsx)(`button`,{className:`doc-pill-remove`,onClick:t=>$t(t,e.id),"aria-label":`Remove ${e.filename} from this chat`,children:(0,U.jsx)(Bn,{size:10})})]},e.id)),!ge&&n>0&&(0,U.jsxs)(`button`,{className:`doc-pill-more`,onClick:e=>{e.stopPropagation(),_e(!0)},children:[`+`,n,` more`]}),ge&&n>0&&(0,U.jsx)(`button`,{className:`doc-pill-collapse`,onClick:e=>{e.stopPropagation(),_e(!1)},children:`show less`})]})]})})(),(0,U.jsx)(`div`,{className:`messages-scroll`,ref:ze,onScroll:Mt,children:(0,U.jsxs)(`div`,{className:`messages-column`,children:[k&&(0,U.jsx)(`div`,{className:`skeleton-messages`,"aria-label":`Loading messages`,children:[0,1,2].map(e=>(0,U.jsx)(`div`,{className:`skeleton-msg`,children:(0,U.jsxs)(`div`,{className:`skeleton-lines`,children:[(0,U.jsx)(`div`,{className:`skeleton-line`}),(0,U.jsx)(`div`,{className:`skeleton-line`}),e!==2&&(0,U.jsx)(`div`,{className:`skeleton-line`})]})},e))}),r.map((e,t)=>{if(Ae&&e.role===`assistant`&&t===r.length-1)return null;let n=e.role===`assistant`?e.historyNotice??gD.get(e.id):void 0,i=!Kt&&!Et&&!ke&&!Ae&&e.role===`assistant`&&t===r.length-1&&!e.stopState&&!FS(e.content),a=e.stats?.seconds==null?on.get(e.id):e.stats.seconds*1e3;return(0,U.jsxs)(`div`,{className:ve===e.id?`msg-deleting`:void 0,"data-message-id":e.id,"data-role":e.role,children:[n&&(0,U.jsx)(_D,{text:n}),(0,U.jsx)(tC,{message:e,agentSteps:e.role===`assistant`?e.agentSteps:void 0,onDelete:Kt?void 0:Vt,onResend:!Kt&&e.role===`user`&&!ke?Ht:void 0,extraActions:i?(0,U.jsx)(OT,{answeredBy:e.stats?.model??L?.effective_model,onPick:t=>Ot(e,t)}):void 0,latencyMs:a}),Et?.messageId===e.id&&(0,U.jsx)(jT,{original:e,originalModel:e.stats?.model??L?.effective_model,originalLatencyMs:a,state:Et.state,keeping:Et.keeping,onKeep:e=>{kt(e)},onClose:At})]},e.id)}),(u||Ae)&&Me&&(0,U.jsx)(_D,{text:Me}),(u||Ae)&&(0,U.jsx)(`div`,{className:`streaming-bubble ${Ae?`stream-ending`:`stream-active`}`,children:(0,U.jsx)(tC,{message:{id:-1,session_id:e,role:`assistant`,content:(u?d:Pe.current)||``,created_at:``,rag_sources:null},isStreaming:u,agentSteps:u?h:Fe.current,agentStepsActive:u&&h.some(e=>e.active),cards:u?S:Ie.current,liveStatus:u?te:null,awaitingUser:u&&(ne||re||I)})}),(0,U.jsx)(`div`,{ref:Re})]})}),(0,U.jsx)(WE,{sessionId:e,messages:r,busy:Kt,onUsage:Tt,onJumpToMessage:Ft}),pe&&(0,U.jsx)(`button`,{className:`scroll-bottom-btn`,onClick:It,title:`Scroll to bottom`,"aria-label":`Scroll to bottom`,children:(0,U.jsx)(v,{size:16})}),R&&(0,U.jsxs)(`div`,{className:`drag-overlay`,children:[(0,U.jsx)(Pn,{size:32,strokeWidth:1.5,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:`Drop files to index them for this chat`})]}),be&&(0,U.jsxs)(`div`,{className:`toast policy-alert-toast`,role:`alert`,children:[(0,U.jsxs)(`span`,{children:[`Blocked: `,be.tool,` is restricted by policy.`]}),be.receiptId?(0,U.jsx)(`button`,{type:`button`,className:`policy-alert-toast-link`,onClick:()=>{let e=be.receiptId;e&&(P(`policy_alert`),ee(!0),we(e))},children:`View receipt`}):(0,U.jsx)(`span`,{className:`policy-alert-toast-missing`,children:`Receipt unavailable`})]}),(0,U.jsx)(`div`,{className:`input-area`,children:(0,U.jsxs)(`div`,{className:`input-column`,children:[(0,U.jsx)(JE,{message:Ee,onDismiss:De}),an&&rn&&(0,U.jsx)(xw,{content:rn.content,onRetry:Yt}),(0,U.jsx)(Ny,{sessionId:e}),(0,U.jsx)(ET,{usage:St}),(0,U.jsx)(qE,{sessionId:e}),(0,U.jsx)(nT,{items:nt,onRemove:e=>rt(t=>ei(t,e)),onRetry:e=>rt(t=>Zr(t,e,`failed`,`queued`)),onSteer:u&&!qe&&!at?Jt:void 0,replying:u,busyRetry:!!ut}),(0,U.jsx)(ww,{value:oe,onChange:se,onSubmit:()=>Rt(),onStop:Lt,streaming:u,stopping:qe,queueWhileStreaming:!0,disabledReason:sn,attachments:he,inputRef:Be,placeholder:u?t(`composer.queueNext`):r.length===0?t(`composer.placeholder`):t(`composer.reply`),leftControls:(0,U.jsx)($w,{sessionId:e,disabled:!!ke}),rightControls:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(TT,{usage:St,unavailable:Ct,sessionId:e,busy:Kt,onUsage:Tt,onDetails:()=>Pt(`context`)}),(0,U.jsx)(Jw,{sessionId:e,onOpen:()=>Pt(`environment`)}),(0,U.jsx)(Iw,{})]})})]})})]})}var yD=1.1,bD=60,xD=110,SD=24,CD=2.4,wD=Math.PI*2,TD=(e,t,n)=>{let r=Math.min(1,Math.max(0,(n-e)/(t-e)));return r*r*(3-2*r)};function ED(e){let t=e;return()=>{t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}var DD=class{cols=0;rows=0;w=0;h=0;ox=0;oy=0;time=0;energy=new Float32Array;offset=new Float32Array;mask=new Float32Array;phase=new Float32Array;waves=[];ripples=[];waveIn=1.5;dragIn=0;activity=`idle`;progress=0;pointer=null;exit=null;done=!1;settled=!1;rand;constructor(e=7){this.rand=ED(e)}get cleared(){return this.done}get dissolving(){return this.exit!==null||this.done}resize(e,t,n){this.w=e,this.h=t,this.cols=Math.ceil(e/30),this.rows=Math.ceil(t/30),this.ox=(e-this.cols*30)/2,this.oy=(t-this.rows*30)/2;let r=this.cols*this.rows;this.energy=new Float32Array(r),this.offset=new Float32Array(r*2),this.phase=Float32Array.from({length:r},()=>this.rand()*wD),this.setHole(n)}setHole(e){this.mask.length!==this.cols*this.rows&&(this.mask=new Float32Array(this.cols*this.rows));for(let t=0;t<this.rows;t++)for(let n=0;n<this.cols;n++){let[r,i]=this.center(n,t),a=Math.hypot((r-e.cx)/e.rx,(i-e.cy)/e.ry);this.mask[t*this.cols+n]=(.3+.7*TD(.75,1.5,a))*TD(0,50,i)*TD(0,50,this.h-i)}}setActivity(e){e!==this.activity&&(this.activity=e,this.waveIn=0)}setProgress(e){this.progress=Math.min(1,Math.max(0,e))}setPointer(e,t,n,r=0){this.pointer={x:e,y:t,down:n,speed:r}}clearPointer(){this.pointer=null}ripple(e,t,n){this.ripples.length>24&&this.ripples.shift(),this.ripples.push({x:e,y:t,r:0,t:0,life:1.2+n*.6,strength:n,speed:150+this.rand()*50,phase:this.rand()*wD})}dissolve(e,t){this.ripple(e,t,1);let n=Math.hypot(Math.max(e,this.w-e),Math.max(t,this.h-t))*1.15;this.exit={x:e,y:t,t:0,reach:n,phase:this.rand()*wD},this.done=!1}restore(){this.exit=null,this.done=!1,this.settled=!1,this.energy.fill(0),this.offset.fill(0),this.ripples=[],this.waves=[]}energyAt(e,t){return this.energy[t*this.cols+e]}offsetAt(e,t){let n=t*this.cols+e;return[this.offset[n*2],this.offset[n*2+1]]}center(e,t){return[this.ox+(e+.5)*30,this.oy+(t+.5)*30]}step(e){if(this.done)return!1;if(this.settled&&this.activity===`idle`&&!this.pointer&&!this.ripples.length&&!this.waves.length&&!this.exit&&this.waveIn>e)return this.waveIn-=e,!1;this.time+=e;let t=this.time,n=this.cols+this.rows*.6;if(this.waveIn-=e,this.waveIn<=0){if(this.activity===`loading`)this.waveIn=.9+this.rand()*.5,this.waves.push({front:-3,speed:14+this.rand()*6,dir:1,span:n,strength:.5+this.rand()*.2});else if(this.activity===`idle`){this.waveIn=3+this.rand()*4;let e=this.rand()<.5?1:-1;this.waves.push({front:e>0?-3:n+3,speed:7+this.rand()*4,dir:e,span:n,strength:.45})}else this.waveIn=1}let r=this.pointer;r?.down&&(this.dragIn-=e,this.dragIn<=0&&(this.dragIn=.12,this.ripple(r.x,r.y,.7)));let i=Math.exp(-e*CD),a=Math.min(1,e*14),o=Math.min(1,e*9),s=r?bD+Math.min(80,r.speed*.08):0,c=r?.5+Math.min(.45,r.speed/2e3):0,l=this.activity===`download`?this.progress*this.rows:-1,{cols:u,rows:d,energy:f,offset:p}=this,m=0,h=0;for(let e=0;e<d;e++)for(let n=0;n<u;n++){let g=e*u+n,[_,v]=this.center(n,e),y=f[g]*i,b=0,x=0,S=0,C=.55+.45*Math.sin(n*1.7+e*2.3+t*.6),w=n+e*.6+.9*Math.sin(e*.45+t*.8)+.5*Math.sin(n*.21-t*1.1);for(let e of this.waves){let t=1-Math.abs(w-e.front)/1.5;t>0&&(b=Math.max(b,t*e.strength*C))}for(let e of this.ripples){let t=_-e.x,n=v-e.y,r=Math.hypot(t,n)||1;if(Math.abs(r-e.r)>SD+.11*e.r)continue;let i=Math.atan2(n,t),a=e.r*(1+.07*Math.sin(5*i+e.phase)+.04*Math.sin(9*i-e.phase*2)),o=1-Math.abs(r-a)/SD;if(o<=0)continue;let s=(1-e.t/e.life)**1.3;b=Math.max(b,o*.85*e.strength*s),x+=t/r*o*7*e.strength*s,S+=n/r*o*7*e.strength*s}if(r){let e=_-r.x,t=v-r.y,n=Math.hypot(e,t)||1;if(n<s&&(b=Math.max(b,(1-n/s)**1.4*c)),n<xD){let i=(1-n/xD)**2*(10+Math.min(10,r.speed/120));x+=e/n*i,S+=t/n*i}}let T=0;if(l>=0){let r=l-(d-1-e+.5+.35*Math.sin(n*.55+t*2.1)+.2*Math.sin(n*1.31-t*1.3));r>0&&(T=.16),r>-1&&r<1&&(b=Math.max(b,(1-Math.abs(r))*(.45+.35*Math.sin(t*3+this.phase[g]))))}f[g]=Math.max(T,b>y?y+(b-y)*a:y),p[g*2]+=(x-p[g*2])*o,p[g*2+1]+=(S-p[g*2+1])*o,m=Math.max(m,f[g]),h=Math.max(h,Math.abs(p[g*2]),Math.abs(p[g*2+1]))}return this.settled=m<.04&&h<.05,this.waves=this.waves.filter(t=>(t.front+=t.dir*t.speed*e,t.front>=-4&&t.front<=t.span+4)),this.ripples=this.ripples.filter(t=>(t.t+=e,t.r+=t.speed*e*(1-.35*t.t/t.life),t.t<t.life)),this.exit&&(this.exit.t+=e,this.exit.t>=1.1&&(this.exit=null,this.done=!0)),!0}draw(e,t){if(e.clearRect(0,0,this.w,this.h),this.done)return;let{cols:n,rows:r,energy:i,offset:a,mask:o}=this,s=t.dark?.17:.14;e.lineWidth=1;for(let c=0;c<r;c++)for(let r=0;r<n;r++){let l=c*n+r,[u,d]=this.center(r,c),f=u+a[l*2],p=d+a[l*2+1],m=i[l],h=o[l];if(m<.04){e.fillStyle=t.fg,e.globalAlpha=s*h,e.fillRect(f-1,p-1,2,2);continue}let g=2+m*19,_=Math.max(1,6-m*3);e.beginPath(),e.roundRect(f-g/2,p-g/2,g,g,_),e.fillStyle=t.accent,e.globalAlpha=(.12+m*.22)*h,e.fill(),e.strokeStyle=t.accent,e.globalAlpha=m*.5*h,e.stroke()}this.exit&&this.drawExit(e,t),e.globalAlpha=1}drawExit(e,t){let n=this.exit,r=Math.min(1,n.t/yD),i=(1-(1-r)**3)*n.reach,a=new Path2D;for(let e=0;e<=180;e++){let t=e/180*wD,r=i*(1+.06*Math.sin(3*t+n.phase+n.t*1.5)+.03*Math.sin(5*t-n.phase*1.7-n.t*2.2)),o=n.x+Math.cos(t)*r,s=n.y+Math.sin(t)*r;e?a.lineTo(o,s):a.moveTo(o,s)}a.closePath(),e.globalAlpha=1,e.globalCompositeOperation=`destination-out`,e.fill(a),e.globalCompositeOperation=`source-over`,e.strokeStyle=t.accent,e.lineWidth=1.4,e.globalAlpha=.55*(1-r)**.7,e.stroke(a)}},OD=90;function kD(){let e=getComputedStyle(document.documentElement);return{fg:e.getPropertyValue(`--text-primary`).trim(),accent:e.getPropertyValue(`--accent-solid`).trim(),dark:document.documentElement.getAttribute(`data-theme`)===`dark`}}function AD(e,t,n){let r=e.getBoundingClientRect();return r.width?{cx:r.left-t.left+r.width/2,cy:r.top-t.top+r.height/2,rx:r.width/2+n,ry:r.height/2+n+10}:null}function jD({activity:e,progress:t=0,pulse:n,docked:r,contentRef:i,composerRef:a}){let o=(0,V.useRef)(null),c=(0,V.useRef)(null),l=(0,V.useRef)(null),u=(0,V.useRef)(()=>{}),d=(0,V.useRef)(()=>{}),f=(0,V.useRef)(r),p=(0,V.useRef)({value:n,at:0});f.current=r,(0,V.useEffect)(()=>{let e=o.current,t=e?.parentElement;if(!e||!t)return;let n=e.getContext(`2d`);if(!n){s.ui.warn(`New-chat background is off: the browser gave no 2D canvas context (often low graphics memory).`);return}l.current=t;let r=new DD;c.current=r;let p=typeof window.matchMedia==`function`?window.matchMedia(zx):null,m=kD(),h=0,g=0,_=!1,v=``,y={x:0,y:0,at:0,speed:0},b=()=>r.draw(n,m),x=(e,t=!1)=>{let n=f.current?a.current:i.current,r=(n&&AD(n,e,f.current?24:40))??{cx:e.width/2,cy:e.height/2,rx:1,ry:1},o=`${Math.round(r.cx)},${Math.round(r.cy)},${Math.round(r.rx)},${Math.round(r.ry)}`;return t||o!==v?(v=o,r):null},S=()=>{let i=t.getBoundingClientRect();if(!i.width||!i.height)return;let a=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(i.width*a),e.height=Math.round(i.height*a),n.setTransform(a,0,0,a,0,0),r.resize(i.width,i.height,x(i,!0)),b()},C=e=>{if(h=requestAnimationFrame(C),e-g<31.833333333333336)return;let n=Math.min(.1,(e-g)/1e3);g=e;let i=x(t.getBoundingClientRect());i&&r.setHole(i),e-y.at>80&&(y.speed*=.8),(r.step(n)||i)&&b(),r.cleared&&T()},w=()=>{_||document.hidden||p?.matches||r.cleared||(_=!0,g=performance.now(),h=requestAnimationFrame(C))},T=()=>{_=!1,cancelAnimationFrame(h)};u.current=w,d.current=()=>{let e=x(t.getBoundingClientRect());e&&r.setHole(e),_||b()};let E=()=>document.hidden?T():w(),D=()=>{T(),b(),w()},O=()=>{m=kD(),b()},k=e=>{let n=t.getBoundingClientRect(),i=e.clientX-n.left,a=e.clientY-n.top,o=performance.now();if(y.at&&o>y.at){let e=Math.hypot(i-y.x,a-y.y)/((o-y.at)/1e3);y.speed+=(Math.min(4e3,e)-y.speed)*.35}Object.assign(y,{x:i,y:a,at:o});let s=e.target instanceof Element&&e.target.closest(`button, a, input, textarea, .composer`);r.setPointer(i,a,(e.buttons&1)==1&&!s,y.speed)},A=()=>{y.at=0,y.speed=0,r.clearPointer()},j=typeof ResizeObserver>`u`?null:new ResizeObserver(S);j?.observe(t,{box:`border-box`});let M=new MutationObserver(O);return M.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`,`data-palette`,`style`]}),document.addEventListener(`visibilitychange`,E),p?.addEventListener(`change`,D),t.addEventListener(`pointermove`,k),t.addEventListener(`pointerleave`,A),S(),w(),()=>{T(),j?.disconnect(),M.disconnect(),document.removeEventListener(`visibilitychange`,E),p?.removeEventListener(`change`,D),t.removeEventListener(`pointermove`,k),t.removeEventListener(`pointerleave`,A),c.current=null,u.current=()=>{},d.current=()=>{}}},[i,a]);let m=(0,V.useCallback)(()=>{let e=l.current,t=a.current;if(!e||!t)return null;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return[r.left-n.left+r.width/2,r.top-n.top+r.height/2]},[a]);return(0,V.useEffect)(()=>{let t=c.current;if(t){if(t.setActivity(e),e===`sending`){let e=m();e&&t.dissolve(...e)}else t.dissolving&&(t.restore(),u.current())}},[e,m]),(0,V.useEffect)(()=>{c.current?.setProgress(t)},[t]),(0,V.useEffect)(()=>{d.current()},[r]),(0,V.useEffect)(()=>{let e=p.current;if(n===e.value)return;let t=performance.now();if(e.value=n,t-e.at<OD)return;e.at=t;let r=m();r&&c.current?.ripple(...r,.45)},[n,m]),(0,U.jsx)(`canvas`,{ref:o,className:`npu-backdrop`,"aria-hidden":`true`})}var MD=c();async function ND(e,t,n){let r=`${MD}${t}`,i={};e!==`GET`&&(i[`X-Gaia-UI`]=`1`),n!==void 0&&(i[`Content-Type`]=`application/json`);let a={method:e,headers:Object.keys(i).length>0?i:void 0,body:n===void 0?void 0:JSON.stringify(n)},o=await fetch(r,a);if(!o.ok){let e=await o.text().catch(()=>``),t=e;try{t=JSON.parse(e).detail||e}catch{}throw Error(t||`Memory API error (HTTP ${o.status})`)}if(o.status!==204&&(o.headers.get(`content-type`)||``).includes(`application/json`))return o.json()}function PD(e){let t=[];for(let[n,r]of Object.entries(e))if(r!=null&&r!==``){if(Array.isArray(r))for(let e of r)t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(e))}`);else t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`)}return t.length?`?${t.join(`&`)}`:``}function FD(){return ND(`GET`,`/memory/stats`)}function ID(e=30){return ND(`GET`,`/memory/activity?days=${e}`)}function LD(e={}){return ND(`GET`,`/memory/knowledge${PD(e)}`)}function RD(e){return ND(`POST`,`/memory/knowledge`,e)}function zD(e,t){return ND(`PUT`,`/memory/knowledge/${encodeURIComponent(e)}`,t)}function BD(e){return ND(`DELETE`,`/memory/knowledge/${encodeURIComponent(e)}`)}function VD(){return ND(`GET`,`/memory/entities`)}function HD(){return ND(`GET`,`/memory/tools`)}function UD(e=20){return ND(`GET`,`/memory/conversations?limit=${e}`)}function WD(e,t=20){return ND(`GET`,`/memory/conversations/search?query=${encodeURIComponent(e)}&limit=${t}`)}function GD(e){return ND(`GET`,`/memory/conversations/${encodeURIComponent(e)}`)}function KD(e=7){return ND(`GET`,`/memory/upcoming?days=${e}`)}function qD(){return ND(`GET`,`/memory/embedding-coverage`)}function JD(){return ND(`POST`,`/memory/consolidate`)}function YD(){return ND(`POST`,`/memory/rebuild-embeddings`)}function XD(){return ND(`POST`,`/memory/reconcile`)}function ZD(){return ND(`POST`,`/memory/rebuild-fts`)}function QD(){return ND(`POST`,`/memory/refresh-system-context`)}function $D(){return new EventSource(`${MD}/memory/stream-discovery`)}function eO(e){return new EventSource(`${MD}/memory/stream-inference?include_browser=${e}`)}function tO(e){return ND(`POST`,`/memory/commit-discovery`,{items:e})}function nO(e){return ND(`POST`,`/memory/commit-inference`,{insights:e})}function rO(){return ND(`GET`,`/memory/settings`)}function iO(e){return ND(`PUT`,`/memory/settings`,e)}function aO(){return ND(`DELETE`,`/memory/all`)}function oO(){return ND(`POST`,`/memory/reinitialize`)}function sO(){return ND(`GET`,`/goals/stats`)}function cO(e={}){return ND(`GET`,`/goals${PD(e)}`)}function lO(e){return ND(`POST`,`/goals`,e)}function uO(e){return ND(`PUT`,`/goals/${encodeURIComponent(e)}/approve`)}function dO(e){return ND(`PUT`,`/goals/${encodeURIComponent(e)}/reject`)}function fO(e){return ND(`PUT`,`/goals/${encodeURIComponent(e)}/cancel`)}function pO(e){return ND(`DELETE`,`/goals/${encodeURIComponent(e)}`)}function mO({disabled:e}){let t=H(e=>e.draftPrivate),n=H(e=>e.setDraftPrivate),r=H(e=>e.settingsSection!==null),[i,a]=(0,V.useState)(null),[o,c]=(0,V.useState)(!1);return(0,V.useEffect)(()=>{if(r)return;let e=!1;return rO().then(t=>{e||(a(t.memory_enabled),c(!1))}).catch(t=>{e||(s.ui.error(`Could not read the memory setting for the Private chip`,t),a(null),c(!0))}),()=>{e=!0}},[r]),(0,V.useEffect)(()=>{i===!1&&t&&n(!1)},[i,t,n]),i===!1?(0,U.jsxs)(`button`,{type:`button`,className:`composer-chip is-unavailable`,disabled:!0,"aria-label":`Memory off`,title:`Memory is off in Settings, so no chat is saved to memory`,children:[(0,U.jsx)(Pe,{size:13,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`composer-chip-label`,children:`Memory off`})]}):(0,U.jsxs)(`button`,{type:`button`,className:`composer-chip${t?` is-on`:``}`,onClick:()=>n(!t),disabled:e,"aria-label":t?`Turn off private chat`:`Turn on private chat`,title:t?`Turn off private chat. This chat won't be saved to memory.`:o?`Couldn't read the memory setting. Turn on private chat to keep this chat out of memory either way.`:`Turn on private chat. It won't be saved to memory.`,children:[t?(0,U.jsx)(Pe,{size:13,"aria-hidden":`true`}):(0,U.jsx)(Ie,{size:13,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`composer-chip-label`,children:t?`Private`:o?`Memory unknown`:`Memory on`})]})}var hO=1e3;function gO(){let[e,t]=(0,V.useState)(null);return(0,V.useEffect)(()=>{let e=!1,n,r=a=>{e||(a.state===`warming`?(t({seconds:Math.floor(a.elapsed_seconds??0),model:a.model??null,device:a.device??null}),n=setTimeout(()=>{Ea().then(r,i)},hO)):t(null))},i=n=>{e||(s.system.warn(`Warm-up status unavailable`,n),t(null))};return Ta().then(r,i),()=>{e=!0,n&&clearTimeout(n)}},[]),e}function _O(e){return e===`gpu`?`your GPU`:e===`npu`?`your NPU`:e===`cpu`?`the CPU`:null}function vO(e){return e<1?`under 1 GB`:`${e.toFixed(1)} GB`}var yO=15e3;function bO(e=new Date,t=Cl){let n=e.getHours();return t(`newChat.greeting.${n<5?`evening`:n<12?`morning`:n<18?`afternoon`:`evening`}`)}var xO={gpu:`device.gpu`,npu:`device.npu`,cpu:`device.cpu`};function SO({seconds:e,model:t,device:n},r=Cl){if(!t)return r(`newChat.warmup.ready`,{s:e});let i=qs(t),a=n?xO[n]:void 0;if(a)return r(`newChat.warmup.loadingOn`,{model:i,where:Lr(a),s:e});let o=_O(n);return o?r(`newChat.warmup.loadingOn`,{model:i,where:o,s:e}):r(`newChat.warmup.loading`,{model:i,s:e})}function CO({detail:e,onRetry:t}){let n=q(),[r,i]=(0,V.useState)(!1);return(0,U.jsxs)(`div`,{className:`new-chat-note`,children:[(0,U.jsxs)(`p`,{children:[n(`newChat.assistantUnavailable`),` `,(0,U.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:t,children:n(`newChat.tryAgain`)})]}),(0,U.jsxs)(`button`,{type:`button`,className:`new-chat-details`,"aria-expanded":r,onClick:()=>i(e=>!e),children:[(0,U.jsx)(I,{size:12,className:r?`is-open`:``,"aria-hidden":`true`}),` `,n(`newChat.details`)]}),r&&(0,U.jsx)(`pre`,{className:`new-chat-details-text`,children:e})]})}function wO(){let{documents:e,draftDocumentIds:t,addDraftDocuments:n}=H.getState();n(e.filter(e=>e.indexing_status===`complete`&&!t.includes(e.id)).map(e=>e.id))}function TO(){let e=q(),t=H(e=>e.documents),n=H(e=>e.draftDocumentIds),r=H(e=>e.removeDraftDocument),i=H(e=>e.setShowDocLibrary),a=t.filter(e=>n.includes(e.id)),o=t.filter(e=>e.indexing_status===`complete`&&!n.includes(e.id));if(!a.length&&!o.length)return null;let s=o.length;return(0,U.jsxs)(`div`,{className:`new-chat-docs`,children:[a.length>0&&(0,U.jsx)(`ul`,{className:`new-chat-doc-list`,"aria-label":e(`newChat.docs.forChat`),children:a.map(t=>(0,U.jsxs)(`li`,{className:`new-chat-doc`,children:[(0,U.jsx)(We,{size:12,"aria-hidden":`true`}),(0,U.jsx)(`span`,{dir:`auto`,children:t.filename}),(0,U.jsx)(`button`,{type:`button`,className:`new-chat-doc-remove`,onClick:()=>r(t.id),"aria-label":e(`newChat.docs.dontAttach`,{name:t.filename}),children:(0,U.jsx)(Bn,{size:12,"aria-hidden":`true`})})]},t.id))}),s>0&&(0,U.jsxs)(`p`,{className:`new-chat-note`,children:[a.length?e.plural(`newChat.docs.more`,s):e.plural(`newChat.docs.library`,s),` `,(0,U.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:wO,children:s===1?e(`newChat.docs.attachIt`):e(`newChat.docs.attachAll`,{n:s})}),s>1&&(0,U.jsxs)(U.Fragment,{children:[` · `,(0,U.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>i(!0),children:e(`newChat.docs.choose`)})]})]})]})}function EO({error:e}){let t=q(),n=H(e=>e.openSettings);return(0,U.jsxs)(`div`,{className:`new-chat-setup-failed`,role:`alert`,children:[(0,U.jsx)(`p`,{className:`new-chat-setup-failed-title`,children:t(`newChat.setupFailed.title`)}),(0,U.jsx)(`p`,{className:`new-chat-setup-failed-error`,children:e}),(0,U.jsxs)(`p`,{children:[t(`newChat.setupFailed.hint`),` `,(0,U.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>n(`model`),children:t(`newChat.setupFailed.choose`)})]})]})}function DO({onSend:e,initialText:t=``,focusRequest:n=0}){let r=q(),i=H(e=>e.systemStatus?.init_state===`initializing`),a=H(e=>e.systemStatus?.download_progress??null),o=H(e=>e.systemStatus?.model_loaded?null:e.systemStatus?.setup_error??null),c=Ws(e=>!!e.active?.remote),[l,u]=uD(Pi,t),[d,f]=(0,V.useState)(null),[p,m]=(0,V.useState)(!1),[h,g]=(0,V.useState)(null),[_,v]=(0,V.useState)(null),y=(0,V.useRef)(null),b=(0,V.useRef)(null),x=(0,V.useRef)(null),S=XE(),C=gO();Gs();let w=(0,V.useRef)(!0),T=(0,V.useCallback)((e=!1)=>{e||v(null),Ua().then(e=>{w.current&&(g(e),v(e.skills_error??null))}).catch(e=>{s.api.warn(`New-chat start screen unavailable`,e),w.current&&v(e instanceof Error?e.message:String(e))})},[]);(0,V.useEffect)(()=>(w.current=!0,T(),()=>{w.current=!1}),[T]),(0,V.useEffect)(()=>{Ho().then(e=>H.getState().setDocuments(e.documents||[])).catch(e=>s.api.warn(`Document library unavailable; not offering its documents`,e))},[]),(0,V.useEffect)(()=>{if(_)return cD(()=>T(!0),yO)},[_,T]);let E=(0,V.useRef)(!1),D=(0,V.useRef)([]),O=(0,V.useCallback)(async(t,n=``)=>{if(t){if(E.current)D.current.push(n||t),u(``);else{E.current=!0,m(!0),f(null),u(``);try{let n=await e(t);S.clear();let r=D.current.splice(0),i=H.getState().currentSessionId;if(r.length>0&&i){let e=(e,t)=>n===!1?[...e,{...Yr(t,`failed`),error:`The first message was not sent.`}]:Xr(e,t,`queued`);H.getState().updateQueue(i,t=>r.reduce(e,t))}}catch(e){let r=D.current.splice(0);u([n||t,...r].join(`
|
|
75
|
+
|
|
76
|
+
`)),f(e instanceof Error?e.message:String(e))}finally{E.current=!1,m(!1)}}}},[S,e]),k=(0,V.useCallback)(()=>O(S.compose(l.trim()),l.trim()),[S,O,l]);(0,V.useEffect)(()=>{n&&y.current?.focus()},[n]);let A=l.length>0||p,j=(0,V.useRef)(null);(0,V.useLayoutEffect)(()=>{let e=b.current;if(!e)return;typeof e.getAnimations==`function`&&e.getAnimations().forEach(e=>e.cancel());let t=e.getBoundingClientRect().top,n=j.current;if(j.current={top:t,docked:A},!n||n.docked===A||Vx()||typeof e.animate!=`function`)return;let r=getComputedStyle(document.documentElement).getPropertyValue(`--ease`).trim();if(!r)throw Error(`Motion token --ease is not set; check styles/index.css.`);e.animate([{transform:`translateY(${n.top-t}px)`},{transform:`none`}],{duration:Bx(`--duration-spring`),easing:r})});let M=a?.state===`starting`||a?.state===`downloading`,N=p?`sending`:M?`download`:i||C!==null?`loading`:`idle`,ee=h?.working_folder;return(0,U.jsxs)(`main`,{className:`new-chat${A?` is-docked`:``}`,"aria-label":r(`newChat.label`),children:[(0,U.jsx)(jD,{activity:N,progress:(a?.percent??0)/100,pulse:l.length,docked:A,contentRef:b,composerRef:x}),(0,U.jsxs)(`div`,{className:`new-chat-inner`,ref:b,children:[(0,U.jsx)(`h1`,{className:`new-chat-greeting`,"aria-hidden":A,children:bO(new Date,r)}),o&&!c&&(0,U.jsx)(EO,{error:o}),(0,U.jsx)(`div`,{ref:x,children:(0,U.jsx)(ww,{value:l,onChange:u,onSubmit:k,attachments:S,disabledReason:i?r(`composer.starting`):null,autoFocus:!0,inputRef:y,leftControls:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($w,{sessionId:null}),(0,U.jsx)(mO,{disabled:p})]}),rightControls:(0,U.jsx)(Iw,{})})}),(0,U.jsx)(`div`,{className:`new-chat-meta`,children:ee&&(0,U.jsx)(qw,{folder:ee,disabled:i||p})}),(0,U.jsx)(TO,{}),C!==null&&!i&&(0,U.jsx)(`p`,{className:`new-chat-warmup`,role:`status`,children:SO(C,r)}),d&&(0,U.jsx)(`p`,{className:`new-chat-error`,role:`alert`,children:d}),_&&(0,U.jsx)(CO,{detail:_,onRetry:()=>T()})]})]})}function OO(e){let t=e?.reason;return t===`needs_key`||t===`bad_key`}function kO({provider:e,limit:t}){let[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(null);if((0,V.useEffect)(()=>{r(null),a(null),co(e).then(r).catch(e=>a(e instanceof Error?e.message:String(e)))},[e]),i)return(0,U.jsxs)(`p`,{className:`settings-error`,role:`alert`,children:[`Prices could not be loaded: `,i]});if(!n)return(0,U.jsxs)(`p`,{className:`settings-hint`,children:[(0,U.jsx)(B,{size:13,className:`spin`}),` Loading prices…`]});if(n.models.length===0)return(0,U.jsxs)(`p`,{className:`settings-hint cloud-prices-note`,children:[`Price unknown. `,n.note]});let o=t?n.models.slice(0,t):n.models;return(0,U.jsxs)(`div`,{className:`cloud-prices`,"aria-label":`Prices`,children:[(0,U.jsx)(`ul`,{className:`cloud-prices-list`,children:o.map(e=>(0,U.jsxs)(`li`,{children:[(0,U.jsxs)(`span`,{className:`cloud-prices-name`,children:[e.name,e.note&&(0,U.jsxs)(`span`,{className:`cloud-prices-note`,children:[` · `,e.note]})]}),(0,U.jsx)(`span`,{className:`cloud-prices-price`,children:kw(e.price)})]},e.model))}),(0,U.jsxs)(`span`,{className:`settings-hint`,children:[n.source,`. You pay the provider for what you use.`]})]})}function AO({label:e,value:t,ok:n}){return(0,U.jsxs)(`li`,{className:`setup-check-row${n?` is-ok`:``}`,children:[n?(0,U.jsx)(F,{size:13,"aria-hidden":`true`}):(0,U.jsx)(mt,{size:13,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`setup-check-label`,children:e}),(0,U.jsx)(`span`,{className:`setup-check-value`,children:t})]})}function jO(e){return!!e.gpu_name||!!e.npu_detected||e.lemonade_running}function MO(e){let t=[e.gpu_name,e.npu_detected?`Ryzen AI NPU`:null].filter(Boolean);return t.length?{value:t.join(` · `),ok:!0}:jO(e)?{value:`No GPU or NPU reported; models run on the CPU`,ok:!1}:{value:`Checked once the model server is running`,ok:!1}}function NO({hardware:e,error:t}){if(t)return(0,U.jsxs)(`p`,{className:`setup-hint`,children:[`This PC’s hardware couldn’t be read (`,t,`). Setup still checks it as it goes.`]});if(!e)return(0,U.jsxs)(`p`,{className:`setup-hint`,role:`status`,children:[(0,U.jsx)(B,{size:13,className:`spin`,"aria-hidden":`true`}),` Checking this PC…`]});let n=MO(e),r=e.lemonade_running?e.warnings:e.warnings.filter(e=>!/\bNPU\b/.test(e));return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`ul`,{className:`setup-check`,"aria-label":`This PC`,children:[(0,U.jsx)(AO,{label:`Device`,value:n.value,ok:n.ok}),(0,U.jsx)(AO,{label:`Memory`,value:e.ram_gb==null?`Not reported`:`${e.ram_gb} GB`,ok:e.ram_gb!=null}),(0,U.jsx)(AO,{label:`Disk`,value:e.disk_free_gb==null?`Not reported`:`${Math.round(e.disk_free_gb)} GB free`,ok:e.disk_free_gb!=null&&e.compatible})]}),!e.compatible&&e.blockers.length>0&&(0,U.jsx)(`p`,{className:`setup-error`,role:`alert`,children:e.blockers.join(` `)}),r.length>0&&(0,U.jsx)(`p`,{className:`setup-hint`,children:r.join(` `)})]})}function PO({plan:e,planError:t,chosen:n,locked:r,onPlan:i}){let[a,o]=(0,V.useState)(null),[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(!1);if(n){let t=l||e?.chat_model.user_set&&e.chat_model.id===n;return(0,U.jsxs)(`p`,{className:`setup-hint`,children:[t?`You chose `:`Setup chose `,(0,U.jsx)(`strong`,{children:ec(n)}),t?`.`:` for this PC.`]})}if(t)return(0,U.jsxs)(`p`,{className:`setup-hint`,children:[`Setup names the chat model once it has checked this PC (`,t,`).`]});if(!e)return(0,U.jsxs)(`p`,{className:`setup-hint`,role:`status`,children:[(0,U.jsx)(B,{size:13,className:`spin`,"aria-hidden":`true`}),` Working out which model fits this PC…`]});let d=e.chat_model,f=ec(d.id);if(e.decided_after_server){let t=e.options.map(e=>ec(e.id));return(0,U.jsxs)(`p`,{className:`setup-hint`,children:[`Picked once the model server is running: the largest model your GPU holds`,t.length>1?` (${t.slice(0,-1).join(`, `)}, or else ${t[t.length-1]})`:``,`. It’s named here as soon as setup chooses.`]})}let p=async e=>{o(e),c(null);try{i(await Ha(e)),u(!0)}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(null)}},m=e.memory_gb==null?``:` This PC has ${e.memory_gb} GB for models (${e.memory_source}).`,h=d.downloaded?`already downloaded`:d.size_gb==null?null:vO(d.size_gb),g=d.user_set&&!e.options.some(e=>e.id===d.id),_=!r&&!g&&e.lemonade.reachable&&e.options.filter(e=>e.fits!==!1).length>1;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`setup-hint`,children:[(0,U.jsx)(`strong`,{children:f}),` will answer your chats`,h?` (${h})`:``,`.`,m,g&&` It’s your default_model; change it in Settings → Model after setup.`]}),_&&(0,U.jsx)(`div`,{className:`setup-choices`,role:`radiogroup`,"aria-label":`Chat model`,children:e.options.map(t=>(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t.id===d.id,className:`setup-choice${t.id===d.id?` is-active`:``}`,disabled:t.fits===!1||a!==null,onClick:()=>{t.id!==d.id&&p(t.id)},children:[a===t.id&&(0,U.jsx)(B,{size:14,className:`spin`,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{children:[(0,U.jsxs)(`span`,{className:`setup-choice-title`,children:[ec(t.id),t.id===e.recommended_model?` (recommended)`:``]}),(0,U.jsx)(`span`,{className:`setup-choice-note`,children:t.fits===!1?t.reason:t.size_gb==null?`Size unknown`:vO(t.size_gb)})]})]},t.id))}),s&&(0,U.jsx)(`p`,{className:`setup-error`,role:`alert`,children:s})]})}function FO(e){if(e.skill===`document-brief`){let t=/^(\d+) /.exec(e.note)?.[1];return t?{n:Number(t)}:void 0}if(e.skill===`coding`){let t=/^In (.+)$/.exec(e.note)?.[1];return t?{folder:t}:void 0}}function IO(e,t,n,r){let i=`${n}.one`,a=`${n}.other`,o=Gr(i)&&Gr(a)&&typeof r?.n==`number`?r.n===1?i:a:n;return!Gr(o)||Cr[o].includes(`{`)&&!r?t:Cl(o,r)===t?e(o,r):t}function LO(e,t){return{title:IO(t,e.title,`card.${e.skill}.title`),note:IO(t,e.note,`card.${e.skill}.note`,FO(e))}}function RO({text:e}){let t=Ur(e);return t.length===1?(0,U.jsx)(U.Fragment,{children:e}):(0,U.jsx)(U.Fragment,{children:t.map((e,t)=>(0,U.jsx)(`span`,{className:`start-card-part`,children:e},t))})}function zO({cards:e,onPick:t,disabled:n}){let r=q();return e.length===0?null:(0,U.jsx)(`ul`,{className:`start-cards`,"aria-label":r(`newChat.cardsLabel`),children:e.map(e=>{let{title:i,note:a}=LO(e,r);return(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,className:`start-card`,onClick:()=>t(e),disabled:n,title:e.needs_input?`${e.prompt}…`:e.prompt,children:[(0,U.jsxs)(`span`,{className:`start-card-title`,children:[i,(0,U.jsx)(b,{size:13,"aria-hidden":`true`})]}),(0,U.jsx)(`span`,{className:`start-card-note`,children:(0,U.jsx)(RO,{text:a})})]})},e.skill)})})}function BO(){let[e,t]=(0,V.useState)(null),n=(0,V.useCallback)(()=>{Promise.resolve(qa()).then(e=>t(e?.providers?.find(e=>e.id===`amd`)?.network??null)).catch(e=>{console.warn(`[useGatewayNetwork] could not check the AMD gateway`,e),t(null)})},[]);return(0,V.useEffect)(n,[n]),{network:e,recheck:n}}var VO=[{id:`local`,title:`On this PC`,note:`Private. Models run on your AMD hardware; nothing leaves this machine.`},{id:`fireworks`,title:`Fireworks AI`,note:`Faster, larger cloud models. Needs an API key; chat history is sent to Fireworks AI.`},{id:`amd`,title:`AMD LLM Gateway`,note:`For AMD employees. Needs a gateway key; chat history is sent to the gateway.`}],HO=1e3,UO=`gaia-setup-choice`;function WO(){try{let e=localStorage.getItem(UO);return e===`local`||e===`fireworks`||e===`amd`?e:null}catch(e){return console.warn(`[SetupScreen] could not read the saved provider choice`,e),null}}function GO(e){try{localStorage.setItem(UO,e)}catch(e){console.warn(`[SetupScreen] could not save the provider choice; a reload will ask again`,e)}}function KO({status:e,n:t}){return e===`done`?(0,U.jsx)(F,{size:14,"aria-hidden":`true`}):e===`active`?(0,U.jsx)(B,{size:14,className:`spin`,"aria-hidden":`true`}):e===`failed`||e===`cancelled`?(0,U.jsx)(oe,{size:14,"aria-hidden":`true`}):(0,U.jsx)(U.Fragment,{children:t})}var qO=[`ok`,`needs_key`,`too_old`];function JO({onChosen:e}){let[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)(null),[a,o]=(0,V.useState)([]),[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)(``),[d,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)(!1),[h,g]=(0,V.useState)(null),[_,v]=(0,V.useState)(null),y=(0,V.useRef)(!0),b=(0,V.useCallback)(async()=>{i(null);try{let e=await Wa();if(!e.offer)return;c(!0);let{found:t,unchecked:r=[]}=await Ga();if(!y.current)return;o(t?[]:r),t&&qO.includes(t.status)&&(n({target:e,found:t}),f(t.status===`needs_key`))}catch(e){y.current&&i(e instanceof Error?e.message:String(e))}finally{y.current&&c(!1)}},[]);(0,V.useEffect)(()=>(y.current=!0,b(),()=>{y.current=!1}),[b]);let x=(0,V.useCallback)(async n=>{if(t){m(!0),g(null);try{await Ka(n===`external`?{mode:n,base_url:t.found.url,api_key:l.trim()||void 0}:{mode:n}),u(``),v(n),e(n)}catch(e){OO(e)&&f(!0),g(e instanceof Error?e.message:String(e))}finally{m(!1)}}},[t,l,e]);if(r||a.length>0)return(0,U.jsxs)(`div`,{className:`setup-row`,children:[(0,U.jsx)(`span`,{className:`setup-hint`,children:r?`Couldn't check for a Lemonade Server you already run: ${r}`:`Couldn't check whether your Lemonade Server at ${a.join(` or `)} is running: it didn't answer in time.`}),(0,U.jsxs)(`button`,{type:`button`,className:`btn-secondary`,disabled:s,onClick:()=>void b(),children:[s&&(0,U.jsx)(B,{size:13,className:`spin`}),` Check again`]})]});if(!t)return s?(0,U.jsxs)(`p`,{className:`setup-hint`,role:`status`,children:[(0,U.jsx)(B,{size:13,className:`spin`,"aria-hidden":`true`}),` Looking for a Lemonade Server you already run…`]}):null;let{target:S,found:C}=t;return _?(0,U.jsx)(`p`,{className:`setup-hint`,role:`status`,children:_===`external`?`GAIA will use your Lemonade Server at ${C.url} and won't install its own.`:`GAIA will set up its own Lemonade Server.`}):C.status===`too_old`?(0,U.jsx)(`p`,{className:`setup-hint`,children:C.message}):(0,U.jsxs)(`form`,{className:`setup-lemonade`,"aria-label":`Use your Lemonade Server`,onSubmit:e=>{e.preventDefault(),x(`external`)},children:[(0,U.jsxs)(`span`,{className:`setup-choice-title`,children:[`Use the Lemonade you already run at `,C.url,C.version?` (v${C.version})`:``]}),(0,U.jsx)(`span`,{className:`setup-choice-note`,children:S.what_gaia_does}),d&&(0,U.jsx)(`input`,{className:`settings-input`,type:`password`,autoComplete:`off`,value:l,onChange:e=>u(e.target.value),placeholder:`The API key your Lemonade Server was started with`,"aria-label":`Lemonade API key`}),(0,U.jsxs)(`div`,{className:`setup-row`,children:[(0,U.jsxs)(`button`,{type:`submit`,className:`btn-primary`,disabled:p||d&&!l.trim(),children:[p&&(0,U.jsx)(B,{size:13,className:`spin`}),` Use mine`]}),(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,disabled:p,onClick:()=>void x(`gaia`),children:`Use GAIA’s own`})]}),h&&(0,U.jsx)(`p`,{className:`setup-error`,role:`alert`,children:h})]})}function YO({problem:e,onRetry:t,onUseGaia:n}){return(0,U.jsxs)(U.Fragment,{children:[e.start&&(0,U.jsx)(`p`,{className:`setup-hint`,children:e.start}),(0,U.jsxs)(`div`,{className:`setup-row`,children:[(0,U.jsx)(`button`,{type:`button`,className:`btn-primary`,onClick:t,children:`Try again`}),e.use_gaia&&(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:n,children:`Use GAIA’s own instead`})]}),e.use_gaia&&(0,U.jsx)(`p`,{className:`setup-hint`,children:`GAIA’s own Lemonade Server downloads its own copy of the models.`}),e.switch_hint&&(0,U.jsx)(`p`,{className:`setup-hint`,children:e.switch_hint})]})}function XO(e,t,n){return t?e.map(e=>{if(e.key===`server`&&t.lemonade.mode===`external`)return{...e,label:`Use your Lemonade Server`,detail:t.lemonade.url??e.detail};if(e.key===`models`&&!n&&!t.decided_after_server){let n=t.download_gb===0?`already downloaded`:t.download_gb==null?null:vO(t.download_gb),r=`chat model ${ec(t.chat_model.id)}, plus the embedding model`;return{...e,detail:n?`${r} (${n})`:r}}return e}):e}function ZO({initial:e,onReady:t}){let n=Ws(e=>e.refresh),r=Ws(e=>e.select),[i,a]=(0,V.useState)(()=>WO()??`local`),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(null),[f,p]=(0,V.useState)(null),[m,h]=(0,V.useState)(``),[g,_]=(0,V.useState)({busy:!1,error:null,done:!1}),[v,y]=(0,V.useState)(!1),[b,x]=(0,V.useState)(null),[S,C]=(0,V.useState)(null),[w,T]=(0,V.useState)(null),[E,D]=(0,V.useState)([]),[O,k]=(0,V.useState)(!1),A=(0,V.useRef)(null),j=(0,V.useRef)(!0);(0,V.useEffect)(()=>()=>{j.current=!1},[]);let{network:M,recheck:N}=BO(),ee=e=>e===`amd`&&M?.reachable===!1,P=i!==`local`,te=u?.steps??XO(P?e.cloud_steps??e.steps:e.steps,b,P),ne=u?.state===`running`||u?.state===`verifying`,re=u?.state===`ready`,L=ne||re,ie=!!u?.chat_model||!!b&&!b.decided_after_server,ae=P?3:4,oe=!!c||!!o&&!jO(o),se=(0,V.useCallback)(()=>{l(null),La().then(s).catch(e=>l(e instanceof Error?e.message:String(e)))},[]),ce=(0,V.useRef)(0),le=(0,V.useCallback)(()=>{let e=++ce.current;x(null),C(null),Va().then(t=>{e===ce.current&&x(t)}).catch(t=>{e===ce.current&&C(t instanceof Error?t.message:String(t))})},[]);(0,V.useEffect)(()=>{Wa().then(e=>k(e.source===`config`)).catch(e=>console.warn(`[SetupScreen] could not read which Lemonade GAIA uses`,e)),se(),le(),Ba().then(e=>{e.state!==`idle`&&(d(e),e.skip_chat_model&&!WO()&&a(`fireworks`))}).catch(e=>p(`Could not read setup progress: ${e instanceof Error?e.message:e}`))},[se,le]);let ue=(0,V.useCallback)(()=>{A.current&&clearInterval(A.current),A.current=null},[]);(0,V.useEffect)(()=>{re&&se()},[re,se]),(0,V.useEffect)(()=>(ne&&(A.current=setInterval(()=>{Ba().then(d).catch(e=>{d(t=>t&&{...t,state:`failed`,error:`Lost contact with GAIA: ${e instanceof Error?e.message:e}`})})},HO)),ue),[ne,ue]);let de=(0,V.useCallback)(async(e=!1)=>{p(null);try{GO(i),d(await za(P,e)),e&&k(!1)}catch(e){p(e instanceof Error?e.message:String(e))}},[P,i]),fe=(0,V.useCallback)(async()=>{_({busy:!0,error:null,done:!1});try{await Za(i,{api_key:!O&&m||void 0},e=>_({busy:!0,error:null,done:!1,waiting:e}),()=>!j.current);let{models:e}=await $a(i),t=e.find(e=>e.rank===1)??e[0];if(!t)throw Error(`Connected, but the provider listed no chat models.`);await r(t.id),T(t.id),h(``),_({busy:!1,error:null,done:!0})}catch(e){_({busy:!1,error:e instanceof Error?e.message:String(e),done:!1})}},[i,m,r,O]),R=(0,V.useCallback)(e=>{GO(e),a(e),_({busy:!1,error:null,done:!1})},[]),z=(0,V.useCallback)(async e=>{await n(),t(e)},[t,n]),pe=re&&(!P||g.done),me=te.find(e=>e.status===`active`||e.status===`failed`),he=P?w:u?.chat_model??(b&&!b.decided_after_server?b.chat_model.id:null);return(0,V.useEffect)(()=>{pe&&Ua().then(e=>D(e.cards)).catch(e=>console.warn(`[SetupScreen] no first tasks to offer`,e))},[pe]),(0,U.jsx)(`main`,{className:`setup`,"aria-labelledby":`setup-title`,children:(0,U.jsxs)(`div`,{className:`setup-inner`,children:[(0,U.jsx)(`h1`,{id:`setup-title`,className:`setup-title`,children:`Set up GAIA`}),(0,U.jsx)(`p`,{className:`setup-lede`,children:pe?`All set.`:u?`Setting things up. Setup keeps going if you switch away.`:`A few minutes of setup, then your first chat.`}),(0,U.jsxs)(`ol`,{className:`setup-steps`,children:[(0,U.jsxs)(`li`,{className:`setup-step${oe?``:o?` is-done`:` is-current`}`,children:[(0,U.jsxs)(`div`,{className:`setup-step-head`,children:[(0,U.jsx)(`span`,{className:`setup-step-num`,children:oe?(0,U.jsx)(mt,{size:14,"aria-hidden":`true`}):o?(0,U.jsx)(F,{size:14,"aria-hidden":`true`}):1}),(0,U.jsx)(`span`,{className:`setup-step-label`,children:`Check this PC`})]}),!L&&(0,U.jsx)(`div`,{className:`setup-step-body`,children:(0,U.jsx)(NO,{hardware:o,error:c})})]}),(0,U.jsxs)(`li`,{className:`setup-step${L?` is-done`:` is-current`}`,children:[(0,U.jsxs)(`div`,{className:`setup-step-head`,children:[(0,U.jsx)(`span`,{className:`setup-step-num`,children:L?(0,U.jsx)(F,{size:14,"aria-hidden":`true`}):2}),(0,U.jsx)(`span`,{className:`setup-step-label`,children:`Choose where GAIA runs`})]}),!L&&(0,U.jsxs)(`div`,{className:`setup-step-body`,children:[(0,U.jsx)(JO,{onChosen:e=>{k(e===`external`),se(),le()}}),(0,U.jsx)(`div`,{className:`setup-choices`,role:`radiogroup`,"aria-label":`Where GAIA runs`,children:VO.map(e=>(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":i===e.id,className:`setup-choice${i===e.id?` is-active`:``}${ee(e.id)?` is-disabled`:``}`,onClick:()=>a(e.id),disabled:ee(e.id),children:[e.id===`local`?(0,U.jsx)(we,{size:16,"aria-hidden":`true`}):(0,U.jsx)(ge,{size:16,"aria-hidden":`true`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`setup-choice-title`,children:e.title}),(0,U.jsx)(`span`,{className:`setup-choice-note`,children:ee(e.id)?M?.detail:e.note})]})]},e.id))}),M?.reachable===!1&&(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:N,children:`Check the AMD gateway again`})]})]}),!P&&(0,U.jsxs)(`li`,{className:`setup-step${L&&ie?` is-done`:L?` is-pending`:` is-current`}`,children:[(0,U.jsxs)(`div`,{className:`setup-step-head`,children:[(0,U.jsx)(`span`,{className:`setup-step-num`,children:L&&ie?(0,U.jsx)(F,{size:14,"aria-hidden":`true`}):3}),(0,U.jsx)(`span`,{className:`setup-step-label`,children:`Chat model`})]}),(0,U.jsx)(`div`,{className:`setup-step-body`,children:(0,U.jsx)(PO,{plan:b,planError:S,chosen:u?.chat_model??null,locked:L,onPlan:x})})]}),!u&&(0,U.jsxs)(`li`,{className:`setup-step-action`,children:[(0,U.jsx)(`button`,{type:`button`,className:`btn-primary setup-start`,onClick:()=>void de(),disabled:ee(i),children:`Start setup`}),ee(i)&&(0,U.jsxs)(`p`,{className:`setup-error`,role:`alert`,children:[M?.detail,`. Choose another option, or connect and check again.`]}),f&&(0,U.jsx)(`p`,{className:`setup-error`,role:`alert`,children:f})]}),te.map((e,t)=>{let n=u?e.status:`pending`,r=n===`active`,i=n===`failed`||n===`cancelled`;return(0,U.jsxs)(`li`,{className:`setup-step is-${n??`pending`}`,"aria-current":r?`step`:void 0,children:[(0,U.jsxs)(`div`,{className:`setup-step-head`,children:[(0,U.jsx)(`span`,{className:`setup-step-num`,children:(0,U.jsx)(KO,{status:n,n:t+ae})}),(0,U.jsxs)(`span`,{className:`setup-step-label`,children:[e.label,e.detail&&(0,U.jsxs)(`span`,{className:`setup-step-detail`,children:[` — `,e.detail]})]})]}),r&&u&&(0,U.jsxs)(`div`,{className:`setup-step-body`,children:[(0,U.jsx)(`p`,{className:`setup-hint`,role:`status`,children:u.text}),u.percent!=null&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`progress`,{className:`setup-progress`,max:100,value:u.percent,"aria-label":u.text}),(0,U.jsxs)(`p`,{className:`setup-hint`,children:[u.percent,`%`,u.size?` · ${u.size}`:``]})]})]}),i&&u&&e===me&&(0,U.jsxs)(`div`,{className:`setup-step-body`,children:[(0,U.jsx)(`p`,{className:`setup-error`,role:`alert`,children:u.error??`Setup stopped.`}),u.problem?(0,U.jsx)(YO,{problem:u.problem,onRetry:()=>void de(),onUseGaia:()=>void de(!0)}):(0,U.jsxs)(`div`,{className:`setup-row`,children:[(0,U.jsx)(`button`,{type:`button`,className:`btn-primary`,onClick:()=>void de(!!u.gaia_lemonade),children:`Try again`}),(0,U.jsxs)(`span`,{className:`setup-hint`,children:[`or run `,(0,U.jsx)(`code`,{children:u.command}),` in a terminal.`]})]}),f&&(0,U.jsx)(`p`,{className:`setup-error`,role:`alert`,children:f})]})]},e.key)}),P&&(0,U.jsxs)(`li`,{className:`setup-step${g.done?` is-done`:re?` is-current`:` is-pending`}`,children:[(0,U.jsxs)(`div`,{className:`setup-step-head`,children:[(0,U.jsx)(`span`,{className:`setup-step-num`,children:g.done?(0,U.jsx)(F,{size:14,"aria-hidden":`true`}):te.length+ae}),(0,U.jsxs)(`span`,{className:`setup-step-label`,children:[`Connect `,VO.find(e=>e.id===i)?.title]})]}),re&&!g.done&&(0,U.jsxs)(`form`,{className:`setup-step-body`,onSubmit:e=>{e.preventDefault(),fe()},children:[(0,U.jsx)(`div`,{className:`setup-row`,role:`radiogroup`,"aria-label":`Cloud provider`,children:VO.filter(e=>e.id!==`local`).map(e=>(0,U.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":i===e.id,className:i===e.id?`btn-primary`:`btn-secondary`,onClick:()=>R(e.id),disabled:g.busy||ee(e.id),title:ee(e.id)?M?.detail??void 0:void 0,children:e.title},e.id))}),(0,U.jsx)(kO,{provider:i,limit:3}),O?(0,U.jsx)(`p`,{className:`setup-hint`,children:`GAIA uses this provider as your Lemonade Server already has it set up. It doesn’t send your server a key or change its setup.`}):(0,U.jsx)(`p`,{className:`setup-hint`,children:`The key goes to GAIA’s local model server and your OS credential store, nowhere else.`}),(0,U.jsxs)(`div`,{className:`setup-row`,children:[!O&&(0,U.jsx)(`input`,{className:`settings-input`,type:`password`,autoComplete:`off`,value:m,onChange:e=>h(e.target.value),placeholder:`Paste API key (blank uses a key already configured)`,"aria-label":`API key`}),(0,U.jsxs)(`button`,{type:`submit`,className:`btn-primary`,disabled:g.busy,children:[g.busy&&(0,U.jsx)(B,{size:13,className:`spin`}),` Connect`]})]}),g.busy&&g.waiting&&(0,U.jsx)(`p`,{className:`setup-hint`,role:`status`,children:g.waiting}),g.error&&(0,U.jsx)(`p`,{className:`setup-error`,role:`alert`,children:g.error})]})]})]}),u&&u.log_tail&&u.log_tail.length>0&&(0,U.jsxs)(`div`,{className:`setup-log`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`setup-log-toggle`,onClick:()=>y(e=>!e),"aria-expanded":v,children:[(0,U.jsx)(I,{size:13,className:v?`is-open`:``,"aria-hidden":`true`}),` Details`]}),v&&(0,U.jsx)(`pre`,{className:`setup-log-pre`,children:u.log_tail.join(`
|
|
77
|
+
`)})]}),pe&&(0,U.jsxs)(`div`,{className:`setup-done`,role:`status`,children:[(0,U.jsxs)(`div`,{className:`setup-done-head`,children:[(0,U.jsxs)(`p`,{children:[`GAIA is ready.`,he&&(0,U.jsxs)(U.Fragment,{children:[` `,(0,U.jsx)(`strong`,{children:ec(he)}),` answers`,P?` in the cloud`:` on this PC`,`.`]})]}),(0,U.jsx)(`button`,{type:`button`,className:`btn-primary`,onClick:()=>void z(),autoFocus:!0,children:`Start chatting`})]}),E.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`setup-hint`,children:`Or start with one of these:`}),(0,U.jsx)(zO,{cards:E,onPick:e=>void z(e)})]})]})]})})}var QO=Zc()?`menu bar`:`tray`,$O=[{key:`minimizeToTray`,label:`Keep running when the window closes`,hint:`GAIA stays in the ${QO} with your model loaded. Quit from the ${QO} menu.`},{key:`startOnLogin`,label:`Start GAIA when you sign in`,hint:`Your first chat of the day starts without waiting for GAIA to open.`},{key:`startMinimized`,label:`Start in the ${QO}`,hint:`GAIA opens without its window. Use the ${QO} icon to show it.`}];function ek(){let e=window.gaiaAPI?.tray,[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)(null),[a,o]=(0,V.useState)(null);(0,V.useEffect)(()=>{e&&e.getConfig().then(e=>n(e.tray)).catch(e=>i(`Couldn't read the desktop settings: ${e instanceof Error?e.message:String(e)}`))},[e]);let s=(0,V.useCallback)(async r=>{if(e&&t&&a===null){o(r),i(null);try{let i=await e.setConfig({tray:{[r]:!t[r]}});n(i.tray)}catch(e){i(e instanceof Error?e.message:String(e))}finally{o(null)}}},[e,t,a]);return e?(0,U.jsxs)(`div`,{className:`settings-field`,role:`group`,"aria-labelledby":`desktop-app-label`,children:[(0,U.jsx)(`span`,{className:`settings-label`,id:`desktop-app-label`,children:`Desktop app`}),$O.map(({key:e,label:n,hint:r})=>(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`label`,{className:`setting-row`,children:[(0,U.jsx)(`span`,{children:n}),(0,U.jsxs)(`span`,{className:`toggle-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,role:`switch`,checked:!!t?.[e],"aria-describedby":`desktop-${e}-hint`,onChange:()=>void s(e),disabled:!t||a!==null&&a!==e,"aria-busy":a===e,"aria-label":n}),(0,U.jsx)(`span`,{className:`toggle-track`})]})]}),(0,U.jsx)(`p`,{className:`settings-hint`,id:`desktop-${e}-hint`,children:r})]},e)),r&&(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:r})]}):null}function tk(){return window.gaiaUpdater}var nk={status:`idle`,version:null,progress:0,releaseNotes:null,error:null,currentVersion:null,pinnedVersion:null,autoUpdate:!1,includePrereleases:!1};function rk(){let[e,t]=(0,V.useState)({...nk});return(0,V.useEffect)(()=>{let e=tk();if(!e)return;let n=!0;e.getStatus().then(e=>{n&&e&&t(e)}).catch(()=>{});let r=e.onStatusChange(e=>{n&&e&&t(e)});return()=>{n=!1;try{r()}catch{}}},[]),e}function ik(){return window.gaiaUpdater}function ak({onClose:e}){let[t,n]=(0,V.useState)({kind:`loading`}),r=(0,V.useRef)(null);(0,V.useEffect)(()=>{let e=ik();e?e.listReleases().then(e=>{n(Array.isArray(e)?{kind:`list`,releases:e}:{kind:`error`,message:e.error})}).catch(()=>{n({kind:`error`,message:`Couldn't reach GitHub to list releases — check your connection; you can still download installers from the Releases page.`})}):n({kind:`error`,message:`Couldn't reach GitHub to list releases — check your connection; you can still download installers from the Releases page.`})},[]),ki(!0,e),pS(r,!0),(0,V.useEffect)(()=>{let e=r.current;e&&e.querySelector(`button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`)?.focus()},[]),(0,V.useEffect)(()=>{let e=r.current;if(!e)return;function t(t){if(t.key!==`Tab`||!e)return;let n=e.querySelectorAll(`button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);if(n.length===0)return;let r=n[0],i=n[n.length-1];t.shiftKey?document.activeElement===r&&(t.preventDefault(),i?.focus()):document.activeElement===i&&(t.preventDefault(),r?.focus())}return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[]);function i(e,t){e.isCurrent||n({kind:`confirm`,release:e,releases:t})}async function a(t){n({kind:`installing`});let r=ik();if(!r)n({kind:`error`,message:`Bridge unavailable — please restart the app.`});else try{await r.installVersion(t.tag),e()}catch(e){let t=e instanceof Error?e.message:String(e);n({kind:`error`,message:`Failed to install that version: ${t}`})}}function o(e){if(!e)return``;try{return new Date(e).toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})}catch{return e}}return(0,U.jsx)(`div`,{className:`version-picker-overlay`,onClick:t=>{t.target===t.currentTarget&&e()},children:(0,U.jsxs)(`div`,{className:`version-picker-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Install a specific version`,ref:r,children:[(0,U.jsxs)(`div`,{className:`version-picker-header`,children:[(0,U.jsx)(`h3`,{children:`Install a specific version`}),(0,U.jsx)(`button`,{className:`version-picker-close`,onClick:e,"aria-label":`Close`,type:`button`,children:`×`})]}),(0,U.jsxs)(`div`,{className:`version-picker-body`,children:[t.kind===`loading`&&(0,U.jsxs)(`div`,{className:`version-picker-loading`,"aria-busy":`true`,children:[(0,U.jsx)(`span`,{className:`version-picker-spinner`}),`Loading releases…`]}),t.kind===`error`&&(0,U.jsxs)(`div`,{className:`version-picker-error`,children:[(0,U.jsx)(`p`,{children:t.message}),(0,U.jsx)(`p`,{children:(0,U.jsx)(`a`,{href:`https://github.com/amd/gaia/releases`,target:`_blank`,rel:`noreferrer`,children:`Browse releases on GitHub`})})]}),t.kind===`list`&&(0,U.jsx)(`ul`,{className:`version-picker-list`,role:`listbox`,"aria-label":`Available releases`,children:t.releases.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,className:`version-picker-row`,"data-version":e.version,"aria-label":`${e.version}${e.isCurrent?` — installed`:``}${e.isPinned?` — pinned`:``}`,"aria-disabled":e.isCurrent?`true`:`false`,onClick:()=>i(e,t.releases),disabled:e.isCurrent,children:[(0,U.jsx)(`span`,{className:`vp-version`,children:e.version}),(0,U.jsx)(`span`,{className:`vp-date`,children:o(e.date)}),e.isCurrent&&(0,U.jsx)(`span`,{className:`vp-badge vp-badge-current`,children:`Installed`}),e.isPinned&&!e.isCurrent&&(0,U.jsx)(`span`,{className:`vp-badge vp-badge-pinned`,children:`Pinned`}),!e.isCurrent&&(0,U.jsx)(`span`,{className:`vp-arrow`,"aria-hidden":`true`,children:`›`})]})},e.tag))}),t.kind===`list`&&(0,U.jsxs)(`p`,{className:`version-picker-more`,children:[`Showing the `,t.releases.length,` most recent.`,` `,(0,U.jsx)(`a`,{href:`https://github.com/amd/gaia/releases`,target:`_blank`,rel:`noreferrer`,children:`Browse all releases on GitHub`})]}),t.kind===`confirm`&&(0,U.jsxs)(`div`,{className:`version-picker-confirm`,children:[(0,U.jsxs)(`p`,{children:[`This will `,(0,U.jsxs)(`strong`,{children:[`install v`,t.release.version]}),` and restart the app.`]}),(0,U.jsxs)(`p`,{className:`vp-confirm-note`,children:[`GAIA will stay on v`,t.release.version,`: updates are paused until you unpin it in Settings → Updates.`]}),(0,U.jsxs)(`div`,{className:`vp-confirm-actions`,children:[(0,U.jsx)(`button`,{type:`button`,className:`vp-btn-cancel`,onClick:()=>n({kind:`list`,releases:t.releases}),children:`Back`}),(0,U.jsx)(`button`,{type:`button`,className:`vp-btn-confirm`,onClick:()=>a(t.release),children:`Install & restart`})]})]}),t.kind===`installing`&&(0,U.jsxs)(`div`,{className:`version-picker-loading`,"aria-busy":`true`,children:[(0,U.jsx)(`span`,{className:`version-picker-spinner`}),`Starting download…`]})]})]})})}var ok=`Install updates automatically`,sk=`Include release candidates`;function ck(e){return/^\d+\.\d+\.\d+-/.test(e??``)}function lk(e){switch(e.status){case`checking`:return`Checking for updates…`;case`available`:return`GAIA ${e.version??``} is available.`;case`downloading`:return`Downloading GAIA ${e.version??``}… ${e.progress}%`;case`downloaded`:return`GAIA ${e.version??``} is ready — restart to finish installing.`;case`error`:return`Update check failed: ${e.error??`unknown error`}`;case`no-channel`:return e.error??`No GAIA release publishes a desktop update for this platform yet.`;case`disabled`:return`Updates are turned off for this install (GAIA_DISABLE_UPDATE=1).`;default:return`GAIA is up to date.`}}function uk(){let e=rk(),t=tk(),[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(null),[o,c]=(0,V.useState)(!1);if(!t)return null;async function l(e,n){if(t){r(!0),a(null);try{await n(t)}catch(t){s.system.error(`${e} failed`,t),a(`${e} failed: ${t instanceof Error?t.message:String(t)}`)}finally{r(!1)}}}let u=e.status===`disabled`,d=n||e.status===`checking`||e.status===`downloading`;return(0,U.jsxs)(`div`,{className:`settings-field`,role:`group`,"aria-labelledby":`updates-label`,children:[(0,U.jsx)(`span`,{className:`settings-label`,id:`updates-label`,children:`Updates`}),(0,U.jsxs)(`p`,{className:`settings-hint`,role:`status`,children:[`Running GAIA `,e.currentVersion??`unknown`,`. `,lk(e)]}),(0,U.jsxs)(`label`,{className:`setting-row`,children:[(0,U.jsx)(`span`,{children:ok}),(0,U.jsxs)(`span`,{className:`toggle-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,role:`switch`,checked:e.autoUpdate,"aria-describedby":`updates-auto-hint`,"aria-label":ok,"aria-busy":n,disabled:u,onChange:()=>{n||l(`Saving the auto-update setting`,t=>t.setAutoUpdate(!e.autoUpdate))}}),(0,U.jsx)(`span`,{className:`toggle-track`})]})]}),(0,U.jsx)(`p`,{className:`settings-hint`,id:`updates-auto-hint`,children:`Off by default while GAIA is changing quickly — you choose when to update. The Terminal UI follows the same setting.`}),(0,U.jsxs)(`label`,{className:`setting-row`,children:[(0,U.jsx)(`span`,{children:sk}),(0,U.jsxs)(`span`,{className:`toggle-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,role:`switch`,checked:!!e.includePrereleases,"aria-describedby":`updates-rc-hint`,"aria-label":sk,"aria-busy":n,disabled:u,onChange:()=>{n||l(`Saving the release-candidate setting`,t=>t.setIncludePrereleases(!e.includePrereleases))}}),(0,U.jsx)(`span`,{className:`toggle-track`})]})]}),(0,U.jsxs)(`p`,{className:`settings-hint`,id:`updates-rc-hint`,children:[`Also offer test builds (vX.Y.Z-rcN) before they become a final release. Off by default.`,ck(e.currentVersion)&&` This is a release candidate, so newer ones are offered either way.`]}),e.pinnedVersion&&(0,U.jsxs)(`p`,{className:`settings-hint`,children:[`Pinned to `,e.pinnedVersion,`, so updates are paused.`,` `,(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,disabled:n,onClick:()=>void l(`Resuming updates`,e=>e.resumeUpdates()),children:`Unpin`})]}),(0,U.jsxs)(`div`,{className:`setting-actions`,children:[e.status===`available`&&!e.pinnedVersion&&(0,U.jsxs)(`button`,{type:`button`,className:`btn-primary`,disabled:n,onClick:()=>void l(`Downloading the update`,e=>e.downloadUpdate()),children:[`Update to `,e.version]}),e.status===`downloaded`&&(0,U.jsx)(`button`,{type:`button`,className:`btn-primary`,disabled:n,onClick:()=>void l(`Restarting to install`,e=>e.restart()),children:`Restart to install`}),(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,disabled:d||u,onClick:()=>void l(`Checking for updates`,e=>e.check()),children:`Check for updates`}),(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,disabled:d||u,onClick:()=>c(!0),children:`Install a specific version…`})]}),e.configError&&(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:e.configError}),i&&(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:i}),o&&(0,U.jsx)(ak,{onClose:()=>c(!1)})]})}var dk=[{value:`light`,label:`settings.theme.light`},{value:`dark`,label:`settings.theme.dark`},{value:`system`,label:`settings.theme.system`}],fk={default:`palette.default`,stone:`palette.stone`,marble:`palette.marble`,glacier:`palette.glacier`,forest:`palette.forest`,sage:`palette.sage`,basalt:`palette.basalt`,gold:`palette.gold`,dusk:`palette.dusk`,custom:`settings.colors.custom`},pk=[[`Enter`,`settings.shortcut.send`],[`Shift+Enter`,`settings.shortcut.newLine`],[`Esc`,`settings.shortcut.stop`],[`Mod+Shift+O`,`settings.shortcut.newChat`],[`Mod+K`,`settings.shortcut.search`],[`Mod+B`,`settings.shortcut.sidebar`],[`Mod+,`,`settings.shortcut.settings`]];function mk(){let e=q(),t=H(e=>e.locale),n=H(e=>e.setLocale),r=H(e=>e.themePreference),i=H(e=>e.setThemePreference),a=H(e=>e.palette),o=H(e=>e.setPalette),s=H(e=>e.customColors),c=H(e=>e.setCustomColors),l=e=>t=>c({...s,[e]:t.target.value.toUpperCase()});return(0,U.jsxs)(`div`,{className:`settings-pane`,children:[(0,U.jsx)(`h2`,{className:`settings-pane-title`,children:e(`settings.section.general`)}),(0,U.jsxs)(`div`,{className:`settings-field`,children:[(0,U.jsx)(`label`,{className:`settings-label`,htmlFor:`ui-language`,children:e(`settings.language`)}),(0,U.jsx)(`select`,{id:`ui-language`,className:`settings-input`,value:t,onChange:e=>n(e.target.value),children:Tr.map(({meta:e})=>(0,U.jsx)(`option`,{value:e.code,lang:e.code,dir:e.dir,children:Ir(e)},e.code))}),(0,U.jsx)(`span`,{className:`settings-hint`,children:e(`settings.languageHint`)})]}),(0,U.jsxs)(`div`,{className:`settings-field`,children:[(0,U.jsx)(`span`,{className:`settings-label`,id:`appearance-label`,children:e(`settings.appearance`)}),(0,U.jsx)(`div`,{className:`segmented`,role:`radiogroup`,"aria-labelledby":`appearance-label`,children:dk.map(t=>(0,U.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":r===t.value,className:r===t.value?`is-active`:``,onClick:()=>i(t.value),children:e(t.label)},t.value))})]}),(0,U.jsx)(ek,{}),(0,U.jsx)(uk,{}),(0,U.jsxs)(`div`,{className:`settings-field`,children:[(0,U.jsx)(`span`,{className:`settings-label`,id:`palette-label`,children:e(`settings.colors`)}),(0,U.jsxs)(`div`,{className:`palette-grid`,role:`radiogroup`,"aria-labelledby":`palette-label`,children:[or.map(t=>(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":a===t.id,className:`palette-tile${a===t.id?` is-active`:``}`,onClick:()=>o(t.id),children:[(0,U.jsx)(`span`,{className:`palette-swatch`,"aria-hidden":`true`,children:t.swatch.map(e=>(0,U.jsx)(`i`,{style:{background:e}},e))}),e(fk[t.id])]},t.id)),(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":a===`custom`,className:`palette-tile${a===`custom`?` is-active`:``}`,onClick:()=>o(`custom`),children:[(0,U.jsxs)(`span`,{className:`palette-swatch`,"aria-hidden":`true`,children:[(0,U.jsx)(`i`,{style:{background:s.base}}),(0,U.jsx)(`i`,{style:{background:s.accent}})]}),e(`settings.colors.custom`)]})]}),a===`custom`&&(0,U.jsxs)(`div`,{className:`palette-custom`,children:[(0,U.jsxs)(`label`,{className:`palette-color`,htmlFor:`custom-accent`,children:[(0,U.jsx)(`input`,{id:`custom-accent`,type:`color`,value:s.accent,onChange:l(`accent`)}),(0,U.jsxs)(`span`,{children:[e(`settings.colors.accent`),(0,U.jsx)(`small`,{children:e(`settings.colors.accentHint`)})]})]}),(0,U.jsxs)(`label`,{className:`palette-color`,htmlFor:`custom-base`,children:[(0,U.jsx)(`input`,{id:`custom-base`,type:`color`,value:s.base,onChange:l(`base`)}),(0,U.jsxs)(`span`,{children:[e(`settings.colors.base`),(0,U.jsx)(`small`,{children:e(`settings.colors.baseHint`)})]})]}),(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>c(cr),children:e(`settings.colors.reset`)}),(0,U.jsx)(`p`,{className:`settings-hint`,children:e(`settings.colors.hint`)})]})]}),(0,U.jsxs)(`div`,{className:`settings-field`,children:[(0,U.jsx)(`span`,{className:`settings-label`,children:e(`settings.shortcuts`)}),(0,U.jsx)(`dl`,{className:`shortcut-list`,children:pk.map(([t,n])=>(0,U.jsxs)(`div`,{className:`shortcut-row`,children:[(0,U.jsx)(`dt`,{children:(0,U.jsx)(`kbd`,{children:tl(t)})}),(0,U.jsx)(`dd`,{children:e(n)})]},t))})]})]})}var hk=`auto`;function gk({model:e}){let[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)(null),[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(null);(0,V.useEffect)(()=>{n(null),i(null),c(null),eo(e).then(n).catch(e=>i(e instanceof Error?e.message:String(e)))},[e]);let l=(0,V.useCallback)(async t=>{o(!0),i(null),c(null);try{let r=await to(e,t===hk?null:Number(t));n(r);let i=r.chosen?ac(r.chosen):`the automatic size`;r.reload?.started?c(`Reloading ${r.display_name} at ${i}. Chat pauses until it's back.`):r.reload?.reason===`already_loaded`?c(`Saved. ${r.display_name} is already loaded at ${i}, so nothing reloads.`):r.reload?.reason===`warm_up`?c(`Saved. GAIA is getting the model ready for a new chat, so ${r.display_name} switches to ${i} the next time it loads.`):r.reload?.reason===`busy`?c(`Saved. GAIA is answering right now, so ${r.display_name} switches to ${i} the next time it loads.`):r.reload?.reason===`not_gaias_server`?c(`Saved. GAIA doesn't reload models on your own server; ${r.display_name} uses ${i} the next time it loads.`):r.reload?.reason===`restarting`?c(`Saved. A reload is already running; this size applies the next time the model loads.`):c(`Saved. It applies the next time this model loads.`)}catch(e){i(e instanceof Error?e.message:String(e))}finally{o(!1)}},[e]);if(r&&!t)return(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:r});if(!t)return(0,U.jsxs)(`p`,{className:`settings-hint`,children:[(0,U.jsx)(B,{size:13,className:`spin`}),` Checking context sizes…`]});let u=t.chosen==null?hk:String(t.chosen),d=t.chosen!=null&&t.loaded_ctx!=null&&t.loaded_ctx!==t.chosen;return(0,U.jsxs)(`div`,{className:`settings-field`,children:[(0,U.jsx)(`label`,{className:`settings-label`,htmlFor:`ctx-size`,children:`Context size`}),(0,U.jsxs)(`select`,{id:`ctx-size`,className:`settings-input`,value:u,onChange:e=>void l(e.target.value),disabled:a||t.options.length===0,children:[(0,U.jsxs)(`option`,{value:hk,children:[`Automatic`,t.automatic?` (${ac(t.automatic)})`:``]}),t.options.map(e=>(0,U.jsxs)(`option`,{value:String(e),children:[ac(e),` tokens`]},e))]}),(0,U.jsxs)(`span`,{className:`settings-hint`,children:[t.note??(t.max_fit?`Up to ${ac(t.max_fit)}, the most ${t.display_name} can hold on this PC (${t.memory_source}). A larger window uses more memory. GAIA reloads the model to apply it, except on a Lemonade you run yourself.`:null),d&&` Loaded now at ${ac(t.loaded_ctx)}.`]}),a&&(0,U.jsxs)(`span`,{className:`settings-hint`,children:[(0,U.jsx)(B,{size:13,className:`spin`}),` Applying…`]}),s&&(0,U.jsx)(`p`,{className:`settings-ok`,role:`status`,children:s}),r&&(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:r})]})}function _k({onAdded:e}){let[t,n]=(0,V.useState)(``),[r,i]=(0,V.useState)(``),[a,o]=(0,V.useState)(null),[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(null),d=(0,V.useRef)(``),f=(0,V.useCallback)(async e=>{let n=t.trim();d.current=n,c(`check`),u(null);try{let t=await ao(n,e);if(d.current!==n)return;o(t),i(t.file??e)}catch(e){if(d.current!==n)return;o(null),u(e instanceof Error?e.message:String(e))}finally{c(null)}},[t]),p=(0,V.useCallback)(async()=>{c(`add`),u(null);try{let{report:a}=await oo(t.trim(),r);n(``),i(``),o(null),e(a.display_name??a.model_id??`The model`)}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(null)}},[e,r,t]);return(0,U.jsxs)(`form`,{className:`settings-field custom-model-add`,onSubmit:e=>{e.preventDefault(),f(``)},children:[(0,U.jsx)(`label`,{className:`settings-label`,htmlFor:`custom-model-url`,children:`Add a model from Hugging Face`}),(0,U.jsx)(`span`,{className:`settings-hint`,children:`Paste the link to a GGUF model. GAIA checks that it is a chat model your model server can run and that it fits this PC before adding it. It downloads when you choose Download.`}),(0,U.jsxs)(`div`,{className:`settings-row`,children:[(0,U.jsx)(`input`,{id:`custom-model-url`,className:`settings-input`,type:`url`,inputMode:`url`,spellCheck:!1,autoComplete:`off`,value:t,readOnly:s!==null,onChange:e=>{n(e.target.value),o(null),i(``),d.current=``},placeholder:`https://huggingface.co/unsloth/Qwen3-4B-Instruct-2507-GGUF`}),(0,U.jsxs)(`button`,{type:`submit`,className:`btn-secondary`,disabled:s!==null||!t.trim(),children:[s===`check`?(0,U.jsx)(B,{size:13,className:`spin`}):null,` Check`]})]}),a&&(()=>{let e=(0,U.jsx)(`ul`,{className:`custom-model-checks`,"aria-label":`Checks`,children:a.checks.map(e=>(0,U.jsxs)(`li`,{className:e.ok?`is-ok`:`is-failed`,children:[e.ok?(0,U.jsx)(F,{size:13,"aria-label":`Passed`}):(0,U.jsx)(Bn,{size:13,"aria-label":`Failed`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:e.label}),` — `,e.detail]})]},e.id))});return a.ok?(0,U.jsxs)(`details`,{className:`custom-model-checks-summary`,children:[(0,U.jsxs)(`summary`,{children:[(0,U.jsx)(F,{size:13,"aria-hidden":`true`}),` All `,a.checks.length,` checks passed`]}),e]}):e})(),a&&a.warnings.length>0&&(0,U.jsx)(`ul`,{className:`custom-model-checks`,"aria-label":`Warnings`,children:a.warnings.map(e=>(0,U.jsxs)(`li`,{className:`is-warning`,children:[(0,U.jsx)(An,{size:13,"aria-label":`Warning`}),` `,(0,U.jsx)(`span`,{children:e})]},e))}),a&&a.variants.length>1&&(0,U.jsxs)(`div`,{className:`settings-row`,children:[(0,U.jsx)(`label`,{className:`settings-hint`,htmlFor:`custom-model-quant`,children:`Quantization`}),(0,U.jsx)(`select`,{id:`custom-model-quant`,className:`settings-input`,value:r,onChange:e=>void f(e.target.value),disabled:s!==null,children:a.variants.map(e=>(0,U.jsxs)(`option`,{value:e.file,children:[e.quant,` · `,e.size_gb,` GB`,e.fits?``:` · too large for this PC`]},e.file))})]}),a?.ok&&(0,U.jsxs)(`div`,{className:`settings-row`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`btn-primary`,onClick:()=>void p(),disabled:s!==null,children:[s===`add`?(0,U.jsx)(B,{size:13,className:`spin`}):null,` Add `,a.display_name]}),(0,U.jsxs)(`span`,{className:`settings-hint`,children:[a.size_gb,` GB download`]})]}),l&&(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:l})]})}function vk(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(!1),c=(0,V.useCallback)(async e=>{s(!0),r(null);try{let n=await e();t(n),a(n.limit_usd==null?``:String(n.limit_usd))}catch(e){r(e instanceof Error?e.message:String(e))}finally{s(!1)}},[]);if((0,V.useEffect)(()=>{c(lo)},[c]),!e)return n?(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:n}):(0,U.jsxs)(`p`,{className:`settings-hint`,children:[(0,U.jsx)(B,{size:13,className:`spin`}),` Loading this month’s spending…`]});let l=e.limit_usd,u=i.trim()===``?null:Number(i),d=u===null||Number.isFinite(u)&&u>0,f=u!==l;return(0,U.jsxs)(`section`,{className:`settings-field spending`,"aria-label":`Cloud spending`,children:[(0,U.jsx)(`span`,{className:`settings-label`,children:`Cloud spending this month`}),(0,U.jsxs)(`p`,{className:`spending-total`,children:[(0,U.jsx)(`strong`,{children:Aw(e.total_usd)}),l!=null&&(0,U.jsxs)(U.Fragment,{children:[` of your `,Aw(l),` limit`]}),(0,U.jsxs)(`span`,{className:`settings-hint`,children:[` · `,e.turns,` cloud `,e.turns===1?`chat turn`:`chat turns`,`, at list price`]})]}),e.unpriced_turns>0&&(0,U.jsxs)(`p`,{className:`settings-hint`,children:[`Plus `,e.unpriced_turns,` `,e.unpriced_turns===1?`turn`:`turns`,` on models with an unknown price, not included above.`]}),e.state===`near`&&(0,U.jsxs)(`p`,{className:`spending-warning`,role:`status`,children:[(0,U.jsx)(An,{size:13,"aria-hidden":`true`}),` Close to your limit. GAIA stops before a cloud chat once it’s reached.`]}),e.state===`reached`&&(0,U.jsxs)(`div`,{className:`spending-warning`,role:`alert`,children:[(0,U.jsxs)(`p`,{children:[(0,U.jsx)(An,{size:13,"aria-hidden":`true`}),` You’ve reached your limit, so cloud chats are stopped until next month. Models on this PC still work.`]}),(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,disabled:o,onClick:()=>void c(fo),children:`Allow more this month`})]}),e.state===`allowed_over`&&(0,U.jsx)(`p`,{className:`settings-hint`,children:`Over your limit; you allowed more for this month.`}),(0,U.jsxs)(`form`,{className:`settings-row`,onSubmit:e=>{e.preventDefault(),d&&f&&c(()=>uo(u))},children:[(0,U.jsx)(`label`,{className:`spending-limit-label`,htmlFor:`spend-limit`,children:`Monthly limit ($)`}),(0,U.jsx)(`input`,{id:`spend-limit`,className:`settings-input`,type:`number`,min:`0.01`,step:`0.01`,inputMode:`decimal`,placeholder:`No limit`,value:i,onChange:e=>a(e.target.value),"aria-invalid":!d}),(0,U.jsxs)(`button`,{type:`submit`,className:`btn-secondary`,disabled:o||!d||!f,children:[o?(0,U.jsx)(B,{size:13,className:`spin`}):null,` Save`]}),l!=null&&(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,disabled:o,onClick:()=>void c(()=>uo(null)),children:`Remove limit`})]}),(0,U.jsx)(`span`,{className:`settings-hint`,children:`Counts cloud chats in GAIA’s Agent UI at list price, without cache discounts. Your provider’s bill is the final word. Turns that fail or are stopped before a reply aren’t counted. Models with an unknown price, like the AMD LLM Gateway’s, add nothing to the total, but are stopped too once the limit is reached.`}),n&&(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:n})]})}var yk=2e3;function bk(e){if(e.key_state===`waiting_for_os_permission`)return e.key_message??`Waiting for the OS to allow reading the saved key.`;switch(e.key_source){case`environment`:return`A key is set in ${e.env_var} and is in use.`;case`lemonade`:return`A key is already configured on the local model server.`;case`stored`:return`A saved key will be used.`;default:return`No key yet.`}}function xk(e){return e.key_source===`environment`?`Blank uses the environment key`:e.key_source?`Blank keeps the saved key`:`Paste API key`}function Sk(){let e=Ws(e=>e.active),t=Ws(e=>e.select),n=Ws(e=>e.refresh),r=Ws(e=>e.rememberNames),[i,a]=(0,V.useState)(null),[o,s]=(0,V.useState)(null),c=H(e=>e.settingsProvider),[l,u]=(0,V.useState)(c??e?.provider??`local`),[d,f]=(0,V.useState)(null),[p,m]=(0,V.useState)(null),[h,g]=(0,V.useState)(``),[_,v]=(0,V.useState)(!1),[y,b]=(0,V.useState)(``),[x,S]=(0,V.useState)({base_url:``,auth_header_name:``,auth_header_prefix:``}),[C,w]=(0,V.useState)(null),[T,E]=(0,V.useState)(null),[D,O]=(0,V.useState)(null),[k,A]=(0,V.useState)(null),j=(0,V.useRef)(l);j.current=l;let M=(0,V.useRef)(!0);(0,V.useEffect)(()=>()=>{M.current=!1},[]);let N=i?.find(e=>e.id===l)??null,ee=e=>e?.network?.reachable===!1,P=!!N&&(!N.remote||!!N.models_discovered),te=(0,V.useCallback)(async()=>{s(null);try{let e=await qa();a(e.providers),e.lemonade_error&&s(e.lemonade_error)}catch(e){s(e instanceof Error?e.message:String(e))}},[]),ne=(0,V.useCallback)(async(e,t=!1)=>{t||(f(null),m(null));try{let t=await $a(e);r(t.models),f(t.models),E(t.memory_gb?`${t.memory_gb} GB (${t.memory_source})`:t.capacity_error??null)}catch(e){m(e instanceof Error?e.message:String(e))}},[r]);(0,V.useEffect)(()=>{te()},[te]);let re=!!i?.some(e=>e.key_state===`waiting_for_os_permission`);(0,V.useEffect)(()=>{if(!re)return;let e=setInterval(()=>{te()},yk);return()=>clearInterval(e)},[re,te]);let I=e?.provider;(0,V.useEffect)(()=>{I&&!c&&u(I)},[I,c]),(0,V.useEffect)(()=>{b(``),O(null),g(``),v(!1)},[l]),(0,V.useEffect)(()=>{P?ne(l):f(null)},[l,P,ne]);let L=(0,V.useCallback)(async()=>{if(N){w(`connect`),O(null);try{let e=l===`amd`?{api_key:y||void 0,...Object.fromEntries(Object.entries(x).filter(([,e])=>e!==``))}:{api_key:y||void 0},t=()=>!M.current||j.current!==l,n=await Za(l,e,e=>{t()||O({ok:!0,text:e})},t);if(t())return;b(``),O({ok:!0,text:n.remember_error?`Connected for this session only — the key could not be kept: ${n.remember_error}`:n.remembered?`Connected. The key is kept for next time.`:`Connected.`}),await te()}catch(e){M.current&&j.current===l&&O({ok:!1,text:e instanceof Error?e.message:String(e)})}finally{M.current&&w(null)}}},[x,l,y,te,N]),ie=(0,V.useCallback)(async()=>{w(`forget`),O(null);try{await Qa(l),O({ok:!0,text:`Key cleared, here and for future sessions. An environment key, if set, stays active.`}),await te(),await n()}catch(e){O({ok:!1,text:e instanceof Error?e.message:String(e)})}finally{w(null)}},[l,te,n]),ae=(0,V.useCallback)(async e=>{w(e),O(null);try{await t(e),O({ok:!0,text:`New messages use ${qs(e)}. It is remembered across restarts.`})}catch(e){O({ok:!1,text:e instanceof Error?e.message:String(e)})}finally{w(null)}},[t]),oe=(0,V.useCallback)(async e=>{w(`dl:${e}`),O(null);try{await Na(e),await ne(`local`,!0)}catch(e){O({ok:!1,text:e instanceof Error?e.message:String(e)})}finally{w(null)}},[ne]),se=(0,V.useCallback)(async e=>{w(`rm:${e}`),O(null);try{let t=await so(e);A(null);let r=t.cleared.includes(`last_model`)?` New messages use your default model.`:t.cleared.includes(`default_model`)?` It was your default model, so GAIA's own default takes its place.`:``;O({ok:!0,text:`Removed ${t.display_name} and its download.${r}`}),await ne(`local`,!0),await n()}catch(e){O({ok:!1,text:e instanceof Error?e.message:String(e)})}finally{w(null)}},[ne,n]),ce=(0,V.useCallback)(async e=>{O({ok:!0,text:`Added ${e}. Choose Download to fetch it, then Use.`}),await ne(`local`,!0)},[ne]),le=!!d?.some(sc);(0,V.useEffect)(()=>{if(l!==`local`||!le)return;let e=setInterval(()=>{ne(`local`,!0)},yk);return()=>clearInterval(e)},[le,l,ne]);let ue=(0,V.useMemo)(()=>{let e=h.trim().toLowerCase();return(d??[]).filter(t=>!e||t.id.toLowerCase().includes(e)||(t.display_name??``).toLowerCase().includes(e))},[d,h]),de=ue.filter(e=>e.available!==!1),fe=l===`fireworks`&&!_&&!h.trim()&&de.some(e=>e.rank!==null),R=t=>t.rank!==null||t.id===e?.model,z=fe?de.filter(R):de,pe=fe?de.filter(e=>!R(e)):[],me=ue.filter(e=>e.available===!1),he=tc(d??[]),_e=e&&!e.remote&&e.model?e.model:null,ve=t=>{let n=Ks(e?.model,t.id),r=sc(t)?t.download_progress:null,i=[ic(t.placement),t.size_gb?`${t.size_gb} GB ${t.downloaded?`on disk`:`download`}`:null,t.tokens_per_second?`${Math.round(t.tokens_per_second)} tok/s measured here`:null,!t.placement&&t.context_length?`Context ${t.context_length.toLocaleString()} tokens`:null].filter(Boolean).join(` · `);return(0,U.jsxs)(`li`,{className:`model-row${n?` is-current`:``}`,children:[(0,U.jsxs)(`div`,{className:`model-row-text`,children:[(0,U.jsxs)(`span`,{className:`model-row-name`,title:t.id,children:[he[t.id],t.rank&&(0,U.jsxs)(`span`,{className:`model-row-rank`,children:[`#`,t.rank,` `,t.note]}),t.state===`loaded`&&(0,U.jsx)(`span`,{className:`model-badge is-loaded`,children:rc.loaded}),t.fits===!0&&t.available!==!1&&(0,U.jsx)(`span`,{className:`model-badge is-fit`,children:`Fits this PC`}),t.custom&&(0,U.jsx)(`span`,{className:`model-badge is-custom`,children:`Added by you`})]}),N?.remote&&(0,U.jsx)(`span`,{className:`model-row-meta${t.price?``:` is-unknown-price`}`,children:kw(t.price)}),t.display_name&&(0,U.jsx)(`span`,{className:`model-row-meta`,children:t.id}),i&&(0,U.jsx)(`span`,{className:`model-row-meta`,children:i}),t.placement?.warning&&(0,U.jsx)(`span`,{className:`model-row-meta is-warning`,role:`alert`,children:t.placement.warning}),t.unavailable_reason&&(0,U.jsxs)(`span`,{className:`model-row-meta`,children:[`Can't run here: `,t.unavailable_reason]}),t.evidence&&(0,U.jsxs)(`span`,{className:`model-row-meta`,children:[`Measured: `,t.evidence]}),r&&(0,U.jsx)(`progress`,{max:100,value:r.percent,"aria-label":`Downloading ${he[t.id]}`}),t.custom&&t.source_url&&(0,U.jsxs)(`span`,{className:`model-row-meta`,children:[`From `,t.source_url]})]}),t.custom&&!n&&!r&&(k===t.id?(0,U.jsxs)(`span`,{className:`model-row-confirm`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`btn-danger`,onClick:()=>void se(t.id),disabled:C!==null,children:[C===`rm:${t.id}`?(0,U.jsx)(B,{size:13,className:`spin`}):null,t.downloaded?`Remove and delete download`:`Remove`]}),(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>A(null),disabled:C!==null,children:`Keep`})]}):(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>A(t.id),disabled:C!==null,"aria-label":`Remove ${he[t.id]}`,children:`Remove`})),n?(0,U.jsxs)(`span`,{className:`model-row-current`,children:[(0,U.jsx)(F,{size:13,"aria-hidden":`true`}),` In use`]}):t.available===!1?null:r?(0,U.jsxs)(`span`,{className:`model-row-current`,children:[(0,U.jsx)(B,{size:13,className:`spin`}),` `,Math.round(r.percent),`%`]}):t.downloaded?(0,U.jsxs)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>void ae(t.id),disabled:C!==null,"aria-label":`Use ${he[t.id]}`,children:[C===t.id?(0,U.jsx)(B,{size:13,className:`spin`}):null,` Use`]}):(0,U.jsxs)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>void oe(t.id),disabled:C!==null,"aria-label":`Download ${he[t.id]}`,children:[C===`dl:${t.id}`?(0,U.jsx)(B,{size:13,className:`spin`}):null,` Download`]})]},t.id)};return(0,U.jsxs)(`div`,{className:`settings-pane`,children:[(0,U.jsx)(`h2`,{className:`settings-pane-title`,children:`Model`}),(0,U.jsx)(`p`,{className:`settings-pane-lede`,children:`GAIA runs on this PC by default. Cloud providers are used only when you pick one of their models.`}),(0,U.jsx)(`div`,{className:`provider-tabs`,role:`radiogroup`,"aria-label":`Where GAIA runs`,children:(i??[{id:`local`,name:`Local`,remote:!1}]).map(e=>(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":l===e.id,className:`provider-tab${l===e.id?` is-active`:``}${ee(e)?` is-disabled`:``}`,onClick:()=>u(e.id),disabled:ee(e)&&l!==e.id,title:ee(e)?e.network?.detail??void 0:void 0,children:[e.remote?(0,U.jsx)(ge,{size:14,"aria-hidden":`true`}):(0,U.jsx)(we,{size:14,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:e.name}),e.remote&&e.models_discovered&&(0,U.jsx)(`span`,{className:`provider-tab-dot`,"aria-label":`connected`})]},e.id))}),o&&(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:o}),N&&(0,U.jsxs)(`section`,{className:`settings-card`,"aria-label":N.name,children:[(0,U.jsx)(`p`,{className:`settings-note`,children:N.privacy_notice}),N.id===`local`&&(0,U.jsxs)(`p`,{className:`settings-hint`,children:[`Each model runs where it was built to: GGUF models on the GPU, FLM models on the NPU.`,T&&` Memory for models: ${T}.`]}),N.remote&&!P&&(0,U.jsxs)(`div`,{className:`settings-field`,children:[(0,U.jsx)(`span`,{className:`settings-label`,children:`Prices`}),(0,U.jsx)(kO,{provider:N.id})]}),ee(N)&&(0,U.jsxs)(`div`,{className:`settings-field`,children:[(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:N.network?.detail}),(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>void te(),children:`Check again`})]}),N.remote&&!ee(N)&&(0,U.jsxs)(`form`,{className:`settings-field`,onSubmit:e=>{e.preventDefault(),L()},children:[(0,U.jsx)(`span`,{className:`settings-label`,children:`API key`}),(0,U.jsx)(`span`,{className:`settings-hint`,children:bk(N)}),N.id===`amd`&&(0,U.jsxs)(`div`,{className:`settings-grid`,children:[(0,U.jsx)(`input`,{className:`settings-input`,placeholder:`Gateway URL (default https://llm-api.amd.com/Unified/v1)`,value:x.base_url,onChange:e=>S({...x,base_url:e.target.value}),"aria-label":`Gateway URL`}),(0,U.jsx)(`input`,{className:`settings-input`,placeholder:`Auth header (default Ocp-Apim-Subscription-Key)`,value:x.auth_header_name,onChange:e=>S({...x,auth_header_name:e.target.value}),"aria-label":`Auth header name`})]}),(0,U.jsxs)(`div`,{className:`settings-row`,children:[(0,U.jsx)(`input`,{className:`settings-input`,type:`password`,autoComplete:`off`,spellCheck:!1,value:y,onChange:e=>b(e.target.value),placeholder:xk(N),"aria-label":`${N.name} API key`}),(0,U.jsxs)(`button`,{type:`submit`,className:`btn-primary`,disabled:C!==null||!y&&!N.key_source,children:[C===`connect`?(0,U.jsx)(B,{size:13,className:`spin`}):null,N.models_discovered?`Reconnect`:`Connect`]}),(N.key_source===`lemonade`||N.key_source===`stored`)&&(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>void ie(),disabled:C!==null,children:`Forget key`})]}),N.error&&(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:N.error})]}),D&&(0,U.jsx)(`p`,{className:D.ok?`settings-ok`:`settings-error`,role:D.ok?`status`:`alert`,children:D.text}),N.id===`local`&&_e&&e?.downloaded!==!1&&(0,U.jsx)(gk,{model:_e}),P&&(0,U.jsxs)(`div`,{className:`settings-field`,children:[(0,U.jsx)(`span`,{className:`settings-label`,children:`Models`}),(d?.length??0)>6&&(0,U.jsx)(`input`,{className:`settings-input`,type:`search`,value:h,onChange:e=>g(e.target.value),placeholder:`Search models`,"aria-label":`Search models`}),p&&(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:p}),!d&&!p&&(0,U.jsxs)(`p`,{className:`settings-hint`,children:[(0,U.jsx)(B,{size:13,className:`spin`}),` Loading…`]}),d&&ue.length===0&&(0,U.jsx)(`p`,{className:`settings-hint`,children:`No models match.`}),(0,U.jsx)(`ul`,{className:`model-list`,children:z.map(ve)}),fe&&pe.length>0&&(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>v(!0),children:`Show all models`}),l===`fireworks`&&_&&!h.trim()&&(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>v(!1),children:`Show recommended models`}),me.length>0&&(0,U.jsxs)(`details`,{className:`model-unavailable`,children:[(0,U.jsxs)(`summary`,{children:[`Not available on this PC (`,me.length,`)`]}),(0,U.jsx)(`ul`,{className:`model-list`,children:me.map(ve)})]})]}),N.id===`local`&&P&&(0,U.jsx)(_k,{onAdded:e=>void ce(e)}),N.remote&&(0,U.jsx)(vk,{})]})]})}function Ck(){let e=H(e=>e.sessions),[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)(null),[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(null),l=(0,V.useCallback)(async()=>{c(null);try{let e=await la();n(e.sessions),i(e.default_mode),H.getState().setDefaultPermissionMode(e.default_mode)}catch(e){c(e instanceof Error?e.message:String(e))}},[]);(0,V.useEffect)(()=>{l()},[l]);let u=(0,V.useCallback)(async e=>{c(null);try{await e(),await l()}catch(e){c(e instanceof Error?e.message:String(e))}},[l]),d=(0,V.useCallback)(async e=>{o(!1),await u(()=>ua(e))},[u]),f=()=>{r===`full_access`?d(`ask`):o(e=>!e)},p=t=>e.find(e=>e.id===t)?.title??t;return(0,U.jsxs)(`div`,{className:`settings-pane`,children:[(0,U.jsx)(`h2`,{className:`settings-pane-title`,children:`Permissions`}),(0,U.jsx)(`p`,{className:`settings-pane-lede`,children:`GAIA asks before it changes files, runs commands, or uses tools that act on your behalf. Pick a mode per chat from the shield next to the message box. “Always allow” covers one exact action in one chat and ends when GAIA restarts.`}),(0,U.jsxs)(`section`,{className:`settings-card`,"aria-label":`New chats`,children:[(0,U.jsxs)(`label`,{className:`setting-row`,children:[(0,U.jsx)(`span`,{className:`settings-label`,children:`Start new chats in full access`}),(0,U.jsxs)(`span`,{className:`toggle-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:r===`full_access`,onChange:f,disabled:r===null,"aria-label":`Start new chats in full access`}),(0,U.jsx)(`span`,{className:`toggle-track`})]})]}),(0,U.jsx)(`p`,{className:`settings-hint`,children:r===`full_access`?`On. Every new chat runs commands and changes files without asking. Chats already open keep their mode.`:`Off. New chats ask before they change files or run commands. Chats already open keep their mode.`}),a&&(0,U.jsxs)(`div`,{className:`settings-warning`,role:`alert`,children:[(0,U.jsxs)(`p`,{children:[`Full access lets GAIA change or delete files and run commands on this PC without asking you first, in every new chat, until you turn this off. A mistake or a bad instruction in a document it reads can do real damage. This is the same setting as the TUI’s`,(0,U.jsx)(`code`,{children:` /full-access always`}),`.`]}),(0,U.jsxs)(`div`,{className:`settings-row`,children:[(0,U.jsx)(`button`,{type:`button`,className:`btn-danger`,onClick:()=>void d(`full_access`),children:`Turn on full access for new chats`}),(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>o(!1),children:`Cancel`})]})]})]}),s&&(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:s}),t&&t.length===0&&(0,U.jsx)(`p`,{className:`settings-hint`,children:`No chat has full access or anything allowed without asking.`}),t?.map(e=>(0,U.jsxs)(`section`,{className:`settings-card`,"aria-label":p(e.session_id),children:[(0,U.jsxs)(`div`,{className:`settings-row settings-row-between`,children:[(0,U.jsx)(`span`,{className:`settings-label`,children:p(e.session_id)}),e.mode===`full_access`&&(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>u(async()=>{let t=(await da(e.session_id,`ask`)).mode;Xw(e.session_id,t)}),children:`Turn off full access`})]}),e.grants.length>0&&(0,U.jsx)(`ul`,{className:`grant-list`,children:e.grants.map(t=>(0,U.jsxs)(`li`,{className:`grant-row`,children:[(0,U.jsx)(`code`,{children:t.label}),(0,U.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>u(()=>fa(e.session_id,t.key)),"aria-label":`Revoke ${t.label}`,children:`Revoke`})]},t.key))}),e.grants.length>1&&(0,U.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>u(()=>fa(e.session_id)),children:`Revoke all in this chat`})]},e.session_id))]})}var wk=[{source:`agent-bundled`,title:`Built into GAIA`,note:`Ship with GAIA.`},{source:`user`,title:`Yours`,note:`From your ~/.gaia/skills folder.`,empty:`None yet. Add a folder with a SKILL.md file to ~/.gaia/skills and reopen this page.`},{source:`claude-import`,title:`From Claude Code`,note:`Found in your Claude Code skill folders. GAIA reads them in place and does not change them.`}];function Tk({onUseSkill:e}){let[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)({}),[a,o]=(0,V.useState)(null),[s,c]=(0,V.useState)(``);(0,V.useEffect)(()=>{let e=!1;return po().then(t=>{e||(n(t.skills),i(t.invalid))}).catch(t=>{e||o(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[]);let l=s.trim().toLowerCase(),u=(t??[]).filter(e=>!l||e.name.toLowerCase().includes(l)||e.description.toLowerCase().includes(l)),d=t?.every(e=>e.source)??!1,f=t=>(0,U.jsxs)(`li`,{className:`skill-row`,children:[(0,U.jsxs)(`div`,{className:`skill-row-text`,children:[(0,U.jsxs)(`span`,{className:`skill-row-name`,children:[t.name,t.version&&(0,U.jsxs)(`span`,{className:`skill-row-meta`,children:[` v`,t.version]}),t.always_on&&(0,U.jsx)(`span`,{className:`skill-row-meta`,children:` · Always on`})]}),(0,U.jsx)(`span`,{className:`skill-row-desc`,children:t.description})]}),!t.always_on&&(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>e(t.name),"aria-label":`Use ${t.name} in a new chat`,children:`Use`})]},t.name);return(0,U.jsxs)(`div`,{className:`settings-pane`,children:[(0,U.jsx)(`h2`,{className:`settings-pane-title`,children:`Skills`}),(0,U.jsxs)(`p`,{className:`settings-pane-lede`,children:[`Skills teach GAIA a job — a workflow, a CLI, a document type. GAIA loads one when a request needs it, and keeps the lessons it learns while using it. Your own skills go in `,(0,U.jsx)(`code`,{children:`~/.gaia/skills`}),`, one folder each with a `,(0,U.jsx)(`code`,{children:`SKILL.md`}),` file.`]}),a&&(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:a}),!t&&!a&&(0,U.jsxs)(`p`,{className:`settings-hint`,children:[(0,U.jsx)(B,{size:13,className:`spin`}),` Loading…`]}),t&&t.length>6&&(0,U.jsx)(`input`,{className:`settings-input`,type:`search`,value:s,onChange:e=>c(e.target.value),placeholder:`Search skills`,"aria-label":`Search skills`}),t&&t.length===0&&(0,U.jsx)(`p`,{className:`settings-hint`,children:`No skills are installed.`}),d?wk.map(e=>{let n=u.filter(t=>t.source===e.source),r=(t??[]).filter(t=>t.source===e.source).length;return n.length===0&&(l||!e.empty)?null:(0,U.jsxs)(`section`,{className:`skill-group`,"aria-label":e.title,children:[(0,U.jsxs)(`h3`,{className:`skill-group-title`,children:[e.title,` `,(0,U.jsx)(`span`,{className:`skill-row-meta`,children:r})]}),(0,U.jsx)(`p`,{className:`settings-hint`,children:e.note}),n.length===0?(0,U.jsx)(`p`,{className:`settings-hint`,children:e.empty}):(0,U.jsx)(`ul`,{className:`skill-list`,children:n.map(f)})]},e.source)}):(0,U.jsx)(`ul`,{className:`skill-list`,children:u.map(f)}),Object.keys(r).length>0&&(0,U.jsxs)(`div`,{className:`settings-card`,role:`alert`,children:[(0,U.jsx)(`span`,{className:`settings-label`,children:`Skipped, could not be read`}),(0,U.jsx)(`ul`,{className:`grant-list`,children:Object.entries(r).map(([e,t])=>(0,U.jsxs)(`li`,{children:[(0,U.jsx)(`code`,{children:e}),` — `,t]},e))})]})]})}function Ek(){let e=H(e=>e.setShowMemoryDashboard),t=H(e=>e.closeSettings),[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(null),[o,s]=(0,V.useState)(!1);(0,V.useEffect)(()=>{rO().then(r).catch(e=>a(e instanceof Error?e.message:String(e)))},[]);let c=(0,V.useCallback)(async()=>{if(n){s(!0),a(null);try{r(await iO({memory_enabled:!n.memory_enabled}))}catch(e){a(e instanceof Error?e.message:String(e))}finally{s(!1)}}},[n]);return(0,U.jsxs)(`div`,{className:`settings-pane`,children:[(0,U.jsx)(`h2`,{className:`settings-pane-title`,children:`Memory`}),(0,U.jsx)(`p`,{className:`settings-pane-lede`,children:`GAIA remembers facts, preferences and past conversations across chats, on this PC only. Private chats (the eye icon in a chat) are never remembered.`}),(0,U.jsxs)(`label`,{className:`setting-row`,children:[(0,U.jsx)(`span`,{children:`Remember across chats`}),(0,U.jsxs)(`span`,{className:`toggle-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:!!n?.memory_enabled,onChange:()=>void c(),disabled:!n||o,"aria-label":`Remember across chats`}),(0,U.jsx)(`span`,{className:`toggle-track`})]})]}),i&&(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:i}),(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>{t(),e(!0)},children:`Open the memory dashboard`}),(0,U.jsx)(`p`,{className:`settings-hint`,children:`Search, edit and forget what GAIA remembers.`})]})}var Dk=`Keep for: enter a whole number of days from 1 to 365.`,Ok=`Use at most: enter a whole number of MB from 10 to 100,000.`;function kk(e,t,n){if(!/^\d+$/.test(e.trim()))return!1;let r=Number(e);return r>=t&&r<=n}function Ak(e){return e<1048576?`${Math.ceil(e/1024)} KB`:`${(e/1048576).toFixed(1)} MB`}function jk(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(``),[i,a]=(0,V.useState)(``),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(!1);(0,V.useEffect)(()=>{xs().then(e=>{t(e),r(String(e.retention_days)),a(String(e.max_mb))},e=>s({ok:!1,text:`Could not read undo history settings: ${e instanceof Error?e.message:e}`}))},[]);let[u,d]=(0,V.useState)({days:!1,mb:!1}),f=!kk(n,1,365)||u.days,p=!kk(i,10,1e5)||u.mb,m=e!==null&&(n!==String(e.retention_days)||i!==String(e.max_mb)),h=async()=>{if(!(f||p)){l(!0),s(null);try{let e=await Ss(Number(n),Number(i));t(e),s({ok:!0,text:`Saved. Older undo history beyond these limits was removed.`})}catch(e){let t=e instanceof _a&&e.httpStatus===422?e.fields:[],n=t.includes(`retention_days`),r=t.includes(`max_mb`);n||r?(d({days:n,mb:r}),s({ok:!1,text:`Not saved. Fix the limit marked above.`})):s({ok:!1,text:e instanceof Error?e.message:String(e)})}finally{l(!1)}}};return(0,U.jsxs)(`div`,{className:`settings-field`,"aria-label":`Undo history`,children:[(0,U.jsx)(`span`,{className:`settings-label`,children:`Undo history`}),(0,U.jsx)(`p`,{className:`settings-hint`,children:`Before GAIA changes a file it keeps a copy, so you can undo a turn. Copies older than the time limit, or past the space limit (oldest first), are deleted. The space limit never deletes the latest turn.`}),e&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`setting-row`,children:[(0,U.jsx)(`label`,{htmlFor:`undo-days`,children:`Keep for (days)`}),(0,U.jsx)(`input`,{id:`undo-days`,type:`number`,className:`model-input undo-history-input`,min:1,max:365,value:n,"aria-invalid":f,"aria-describedby":f?`undo-days-error`:void 0,onChange:e=>{r(e.target.value),d(e=>({...e,days:!1}))}})]}),f&&(0,U.jsx)(`p`,{id:`undo-days-error`,className:`settings-error`,children:Dk}),(0,U.jsxs)(`div`,{className:`setting-row`,children:[(0,U.jsx)(`label`,{htmlFor:`undo-mb`,children:`Use at most (MB)`}),(0,U.jsx)(`input`,{id:`undo-mb`,type:`number`,className:`model-input undo-history-input`,min:10,max:1e5,value:i,"aria-invalid":p,"aria-describedby":p?`undo-mb-error`:void 0,onChange:e=>{a(e.target.value),d(e=>({...e,mb:!1}))}})]}),p&&(0,U.jsx)(`p`,{id:`undo-mb-error`,className:`settings-error`,children:Ok}),(0,U.jsxs)(`div`,{className:`setting-row setting-row-path`,children:[(0,U.jsx)(`span`,{children:`In use`}),(0,U.jsxs)(`span`,{children:[Ak(e.used_bytes),` for `,e.turns,` turn`,e.turns===1?``:`s`,` `,`in `,(0,U.jsx)(`code`,{className:`setting-path`,children:e.path})]})]}),(0,U.jsx)(`button`,{type:`button`,className:`btn-model-save`,onClick:()=>void h(),disabled:!m||c||f||p,children:c?`Saving…`:`Save`})]}),o&&(0,U.jsx)(`p`,{className:o.ok?`settings-ok`:`settings-error`,role:o.ok?`status`:`alert`,children:o.text})]})}function Mk(){let e=H(e=>e.sessions),t=H(e=>e.removeSession),n=Zs(),r=H(e=>e.systemStatus?.data_dir),[i,a]=(0,V.useState)(!1),[o,s]=(0,V.useState)(null),c=(0,V.useRef)(null);(0,V.useEffect)(()=>()=>{c.current&&clearTimeout(c.current)},[]);let l=(0,V.useCallback)(async()=>{if(!i){a(!0),c.current=setTimeout(()=>a(!1),4e3);return}a(!1);let n=[];for(let r of e)try{await _o(r.id),t(r.id)}catch(e){n.push(`${r.title}: ${e instanceof Error?e.message:e}`)}s(n.length?{ok:!1,text:`Could not delete ${n.length} chat(s): ${n.join(`; `)}`}:{ok:!0,text:`All chats deleted.`})},[i,t,e]);return(0,U.jsxs)(`div`,{className:`settings-pane`,children:[(0,U.jsx)(`h2`,{className:`settings-pane-title`,children:`Privacy`}),(0,U.jsxs)(`p`,{className:`settings-pane-lede`,children:[`Chats, documents and memory stay on this PC. `,n?.remote?`Right now answers come from ${n.label}, so each message and the chat history are sent there.`:n?`Right now answers are generated on this PC too.`:`GAIA can't tell right now whether answers are generated on this PC or by a cloud provider.`]}),r&&(0,U.jsxs)(`div`,{className:`setting-row`,children:[(0,U.jsx)(`span`,{children:`Data folder`}),(0,U.jsx)(`code`,{className:`setting-path`,children:r})]}),(0,U.jsx)(jk,{}),(0,U.jsx)(`div`,{className:`danger-divider`}),(0,U.jsx)(`p`,{className:`danger-warning`,children:`Deletes every chat and its messages. Documents and memory are kept.`}),(0,U.jsx)(`button`,{type:`button`,className:`btn-danger`,onClick:()=>void l(),disabled:e.length===0,children:i?`Click again to delete all chats`:`Delete all chats`}),o&&(0,U.jsx)(`p`,{className:o.ok?`settings-ok`:`settings-error`,role:o.ok?`status`:`alert`,children:o.text})]})}var Nk=[{id:`needs_approval`,label:`Needs your approval`},{id:`question`,label:`Has a question`},{id:`finished`,label:`Finished`}],Pk=[{value:`banner`,label:`Banner`},{value:`badge`,label:`Badge`},{value:`off`,label:`Off`}],Fk=[0,10,20,30,50];function Ik(){return typeof Notification>`u`?`unsupported`:Notification.permission}function Lk(){let e=Fc(),t=!!window.gaiaAPI,[n,r]=(0,V.useState)(Ik),i=Object.values(e.modes).includes(`banner`);return(0,U.jsxs)(`div`,{className:`settings-pane`,children:[(0,U.jsx)(`h2`,{className:`settings-pane-title`,children:`Notifications`}),(0,U.jsx)(`p`,{className:`settings-pane-lede`,children:`When a chat you aren't looking at needs you or finishes. A banner also counts on the badge.`}),Nk.map(t=>(0,U.jsxs)(`div`,{className:`setting-row`,children:[(0,U.jsx)(`span`,{id:`alert-${t.id}`,children:t.label}),(0,U.jsx)(`div`,{className:`segmented`,role:`radiogroup`,"aria-labelledby":`alert-${t.id}`,children:Pk.map(n=>(0,U.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":e.modes[t.id]===n.value,className:e.modes[t.id]===n.value?`is-active`:``,onClick:()=>e.setMode(t.id,n.value),children:n.label},n.value))})]},t.id)),!t&&i&&n!==`granted`&&(n==="default"?(0,U.jsx)(`button`,{type:`button`,className:`btn-secondary`,onClick:()=>{Notification.requestPermission().then(r).catch(e=>{console.error(`[alerts] Notification permission request failed`,e),r(Ik())})},children:`Allow banners in this browser`}):(0,U.jsx)(`p`,{className:`settings-error`,role:`alert`,children:n===`unsupported`?`This browser can't show banners; alerts appear in the chat list only.`:`This browser blocks banners from GAIA. Allow notifications for this site in the browser’s site settings.`})),(0,U.jsxs)(`label`,{className:`setting-row`,children:[(0,U.jsx)(`span`,{children:`Play a sound`}),(0,U.jsxs)(`span`,{className:`toggle-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.sound,onChange:()=>e.update({sound:!e.sound}),"aria-label":`Play a sound`}),(0,U.jsx)(`span`,{className:`toggle-track`})]})]}),t&&(0,U.jsxs)(`label`,{className:`setting-row`,children:[(0,U.jsx)(`span`,{children:`Flash the taskbar when GAIA isn't focused`}),(0,U.jsxs)(`span`,{className:`toggle-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.flash,onChange:()=>e.update({flash:!e.flash}),"aria-label":`Flash the taskbar when GAIA isn't focused`}),(0,U.jsx)(`span`,{className:`toggle-track`})]})]}),(0,U.jsx)(`h3`,{className:`settings-label`,children:`Keep awake`}),t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`setting-row`,children:[(0,U.jsx)(`span`,{children:`Keep the PC awake while GAIA works`}),(0,U.jsxs)(`span`,{className:`toggle-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.keepAwake,onChange:()=>e.update({keepAwake:!e.keepAwake}),"aria-label":`Keep the PC awake while GAIA works`}),(0,U.jsx)(`span`,{className:`toggle-track`})]})]}),(0,U.jsxs)(`div`,{className:`setting-row`,children:[(0,U.jsx)(`label`,{htmlFor:`battery-floor`,children:`On battery, let it sleep below`}),(0,U.jsx)(`select`,{id:`battery-floor`,value:e.batteryFloor,disabled:!e.keepAwake,onChange:t=>e.update({batteryFloor:Number(t.target.value)}),children:Fk.map(e=>(0,U.jsx)(`option`,{value:e,children:e===0?`Never`:`${e}%`},e))})]}),(0,U.jsx)(`p`,{className:`settings-hint`,children:`The screen can still turn off; only sleep is held off.`})]}):(0,U.jsx)(`p`,{className:`settings-hint`,children:`Keep-awake needs the GAIA desktop app.`})]})}var Rk=`modulepreload`,zk=function(e,t){return new URL(e,t).href},Bk={},Vk=function(e){return e.pathname.endsWith(`.css`)},Hk=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Uk=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=zk(t,n);let r=s(t),i=Vk(r);return Hk(Bk,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Rk,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Wk=(0,V.lazy)(()=>Uk(()=>import(`./ConnectorsPane-DQYLrzjU.js`).then(e=>({default:e.ConnectorsPane})),__vite__mapDeps([0,1,2,3]),import.meta.url)),Gk=(0,V.lazy)(()=>Uk(()=>import(`./AdvancedSettings-CuIQvcmD.js`).then(e=>({default:e.AdvancedSettings})),__vite__mapDeps([4,1,2]),import.meta.url)),Kk=[`general`,`model`,`permissions`,`skills`,`connectors`,`memory`,`notifications`,`privacy`,`advanced`];function qk({onUseSkill:e}){let t=q(),n=H(e=>e.settingsSection),r=H(e=>e.openSettings),i=H(e=>e.closeSettings),a=(0,V.useRef)(null),o=(0,V.useRef)(null),s=n!==null;if(ki(s,i),pS(a,s),(0,V.useEffect)(()=>{if(s)return o.current=document.activeElement,()=>{o.current?.focus?.()}},[s,i]),(0,V.useEffect)(()=>{s&&a.current?.querySelector(`.settings-nav-item.is-active`)?.focus()},[s]),!n)return null;let c=(()=>{switch(n){case`general`:return(0,U.jsx)(mk,{});case`model`:return(0,U.jsx)(Sk,{});case`permissions`:return(0,U.jsx)(Ck,{});case`skills`:return(0,U.jsx)(Tk,{onUseSkill:t=>{i(),e(t)}});case`connectors`:return(0,U.jsx)(Wk,{});case`memory`:return(0,U.jsx)(Ek,{});case`notifications`:return(0,U.jsx)(Lk,{});case`privacy`:return(0,U.jsx)(Mk,{});case`advanced`:return(0,U.jsx)(Gk,{})}})();return(0,U.jsx)(`div`,{className:`settings-overlay`,onMouseDown:e=>{e.target===e.currentTarget&&i()},children:(0,U.jsxs)(`div`,{ref:a,className:`settings-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":t(`settings.title`),children:[(0,U.jsxs)(`nav`,{className:`settings-nav`,"aria-label":t(`settings.sections`),children:[(0,U.jsx)(`h1`,{className:`settings-nav-title`,children:t(`settings.title`)}),Kk.map(e=>(0,U.jsx)(`button`,{type:`button`,"data-section":e,className:`settings-nav-item${n===e?` is-active`:``}`,"aria-current":n===e?`page`:void 0,onClick:t=>{t.currentTarget.focus(),r(e)},children:t(`settings.section.${e}`)},e))]}),(0,U.jsxs)(`div`,{className:`settings-body`,children:[(0,U.jsx)(`button`,{type:`button`,className:`settings-close`,onClick:i,"aria-label":t(`settings.close`),children:(0,U.jsx)(Bn,{size:18})}),(0,U.jsx)(V.Suspense,{fallback:(0,U.jsxs)(`p`,{className:`settings-hint`,children:[(0,U.jsx)(B,{size:13,className:`spin`}),` `,t(`settings.loading`)]}),children:c})]})]})})}function Jk(e,t){let[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(!1),o=(0,V.useRef)(null),c=(0,V.useRef)(null),l=(0,V.useRef)(null),u=(0,V.useCallback)(()=>{o.current&&=(clearTimeout(o.current),null),c.current&&=(clearTimeout(c.current),null),l.current&&=(clearInterval(l.current),null)},[]);(0,V.useEffect)(()=>u,[u]);let d=(0,V.useCallback)((e,t)=>{l.current&&clearInterval(l.current),l.current=setInterval(async()=>{try{let n=await wa();t===`load`?n.model_loaded?.toLowerCase()===e.toLowerCase()&&(r(!1),o.current&&=(clearTimeout(o.current),null),l.current&&=(clearInterval(l.current),null)):(n.model_downloaded===!0||n.model_loaded?.toLowerCase()===e.toLowerCase())&&(a(!1),c.current&&=(clearTimeout(c.current),null),l.current&&=(clearInterval(l.current),null))}catch{}},ll)},[]),f=e??`Gemma-4-E4B-it-GGUF`;return{isLoadingModel:n,isDownloadingModel:i,loadModel:(0,V.useCallback)(async(e,t)=>{let n=e??f,i=t??32768;r(!0);try{if(!await Ma(n,i)){r(!1);return}s.system.info(`Load model triggered: ${n} (ctx=${i})`),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>r(!1),sl),d(n,`load`)}catch(e){s.system.error(`Failed to trigger model load`,e),r(!1)}},[f,t,d]),downloadModel:(0,V.useCallback)(async(e=!1,t)=>{let n=t??f;a(!0);try{await Na(n,e),s.system.info(`Download model triggered: ${n} (force=${e})`),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>a(!1),cl),d(n,`download`)}catch(e){s.system.error(`Failed to trigger model download`,e),a(!1)}},[f,d])}}var Yk=5e3,Xk=2e3,Zk=3e4,Qk=6e4;function $k(e){return e.lemonade_running?`up`:e.lemonade_error?`unresponsive`:`down`}function eA(e){return e.kind===`slow`||e.kind===`error`||e.kind===`ok`&&$k(e.status)===`unresponsive`}function tA(e){let t=e.kind===`ok`?e.status.download_progress?.state:void 0;return t===`downloading`||t===`starting`}function nA(e){let t=null,n=0,r=!1,i=null,a=0,o=null,c=async()=>{let e={controller:new AbortController,cancelled:!1};o=e;let{controller:t}=e,n=setTimeout(()=>t.abort(),Qk);try{return{kind:`ok`,status:await wa(t.signal)}}catch(n){if(e.cancelled)return null;if(t.signal.aborted)return{kind:`slow`};let r=n?.httpStatus;return r===504?{kind:`slow`}:n?.name===`ApiError`&&typeof r==`number`&&r!==502?{kind:`error`,httpStatus:r,message:n.message}:{kind:`unreachable`,error:n}}finally{clearTimeout(n),o===e&&(o=null)}},l=()=>{if(t)return t;let i=c().then(t=>{if(t!==null){n=eA(t)?n+1:0,r=tA(t);try{e(t)}catch(e){s.system.error(`Could not apply the system status; the next poll will try again`,e)}}}).finally(()=>{t===i&&(t=null)});return t=i,i},u=()=>Math.min((r?Xk:Yk)*2**n,Zk),d=e=>{l().finally(()=>{e===a&&(i=setTimeout(()=>d(e),u()))})};return{check:l,start:()=>{let e=++a;return d(e),()=>{e===a&&(a++,i&&clearTimeout(i),i=null,o&&(o.cancelled=!0,o.controller.abort(),o=null,t=null))}}}}function rA({onRetry:e,label:t}){let[n,r]=(0,V.useState)(!1);return(0,U.jsx)(`button`,{className:`connection-banner__retry`,onClick:()=>{r(!0),Promise.resolve(e()).finally(()=>r(!1))},disabled:n,children:n?`Checking…`:t})}function iA({onRetry:e,backendSlow:t=!1,backendError:n=null}){let{backendConnected:r,systemStatus:i,currentSessionId:a,messages:o}=H(),[s,c]=(0,V.useState)(!1),l=!!a&&o.length>0,u=i?.default_model_name??`Gemma-4-E4B-it-GGUF`,{isDownloadingModel:d,downloadModel:f}=Jk(u),p=(0,V.useRef)(i?.lemonade_running),m=(0,V.useRef)(i?.model_downloaded),h=(0,V.useRef)(i?.context_size_sufficient),g=(0,V.useRef)(i?.expected_model_loaded);(0,V.useEffect)(()=>{if(l)return;let e=i?.lemonade_running,t=i?.model_downloaded,n=i?.context_size_sufficient,r=i?.expected_model_loaded,a=!1;p.current!==e&&(p.current=e,e===!1&&(a=!0)),m.current!==t&&(m.current=t,t===!1&&(a=!0)),h.current!==n&&(h.current=n,n===!1&&(a=!0)),g.current!==r&&(g.current=r,r===!1&&(a=!0)),a&&c(!1)},[i,l]);let _=i?.download_progress??null,v=_?.model_name||u;if(d||_?.state===`downloading`||_?.state===`starting`||_?.state===`error`){let e=_?.total_bytes?`${(_.total_bytes/1e9).toFixed(1)} GB`:`large download`,t=_?.state===`error`;return(0,U.jsxs)(`div`,{className:`connection-banner ${t?`connection-banner--error`:`connection-banner--warning`}`,role:t?`alert`:`status`,children:[(0,U.jsx)(`div`,{className:`connection-banner__icon`,children:t?(0,U.jsx)(An,{size:16}):(0,U.jsx)(Oe,{size:16})}),(0,U.jsx)(`div`,{className:`connection-banner__text`,children:t?(0,U.jsxs)(U.Fragment,{children:[`Download of `,(0,U.jsx)(`strong`,{children:v}),` failed.`,` `,_?.message&&(0,U.jsx)(`span`,{className:`connection-banner__hint`,children:_.message})]}):(0,U.jsxs)(U.Fragment,{children:[`Downloading `,(0,U.jsx)(`strong`,{children:v}),` (`,e,`).`,_?.state===`downloading`&&_.file&&(0,U.jsxs)(U.Fragment,{children:[` `,(0,U.jsxs)(`span`,{className:`connection-banner__hint`,children:[`File `,_.file_index,` / `,_.total_files,`: `,(0,U.jsx)(`code`,{children:_.file})]})]})]})}),t?(0,U.jsx)(`button`,{className:`connection-banner__retry`,onClick:()=>f(!1,v),children:`Retry`}):(0,U.jsx)(`span`,{className:`connection-banner__loading connection-banner__progress`,children:_&&_.state===`downloading`&&_.total_bytes>0?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`connection-banner__progress-bar`,role:`progressbar`,"aria-valuenow":_.percent,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Download progress`,children:(0,U.jsx)(`span`,{className:`connection-banner__progress-fill`,style:{width:`${_.percent}%`}})}),(0,U.jsxs)(`span`,{className:`connection-banner__progress-label`,children:[_.percent,`% ·`,` `,(_.downloaded_bytes/1e9).toFixed(2),` /`,` `,(_.total_bytes/1e9).toFixed(2),` GB`]})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(B,{size:13,className:`connection-banner__spinner`}),_?.state===`starting`?`Starting download…`:`Downloading…`]})}),t&&(0,U.jsx)(`button`,{className:`connection-banner__dismiss`,onClick:()=>c(!0),"aria-label":`Dismiss`,children:(0,U.jsx)(Bn,{size:14})})]})}if(i?.init_state===`initializing`){let e=i.init_tasks?.find(e=>e.status===`running`)?.name||`Preparing AI system`;return(0,U.jsxs)(`div`,{className:`connection-banner connection-banner--init`,role:`status`,children:[(0,U.jsx)(`div`,{className:`connection-banner__icon`,children:(0,U.jsx)(B,{size:16,className:`connection-banner__spinner`})}),(0,U.jsxs)(`div`,{className:`connection-banner__text`,children:[e,(0,U.jsxs)(`span`,{className:`thinking-dots`,children:[(0,U.jsx)(`span`,{children:`.`}),(0,U.jsx)(`span`,{children:`.`}),(0,U.jsx)(`span`,{children:`.`})]})]})]})}if(s||l)return null;if(!r)return(0,U.jsxs)(`div`,{className:`connection-banner connection-banner--error`,role:`alert`,children:[(0,U.jsx)(`div`,{className:`connection-banner__icon`,children:(0,U.jsx)(In,{size:16})}),(0,U.jsxs)(`div`,{className:`connection-banner__text`,children:[`Lost the connection to GAIA.`,` `,(0,U.jsx)(`span`,{className:`connection-banner__hint`,children:`Check that GAIA is still running, then retry.`})]}),e&&(0,U.jsx)(rA,{onRetry:e,label:`Retry`})]});if(n)return(0,U.jsxs)(`div`,{className:`connection-banner connection-banner--warning`,role:`status`,children:[(0,U.jsx)(`div`,{className:`connection-banner__icon`,children:(0,U.jsx)(An,{size:16})}),(0,U.jsxs)(`div`,{className:`connection-banner__text`,children:[`GAIA's backend answered with an error (`,n,`).`,` `,(0,U.jsx)(`span`,{className:`connection-banner__hint`,children:`It may be overloaded. GAIA keeps checking; if it lasts, restart GAIA.`})]}),e&&(0,U.jsx)(rA,{onRetry:e,label:`Check again`})]});if(t)return(0,U.jsxs)(`div`,{className:`connection-banner connection-banner--warning`,role:`status`,children:[(0,U.jsx)(`div`,{className:`connection-banner__icon`,children:(0,U.jsx)(An,{size:16})}),(0,U.jsxs)(`div`,{className:`connection-banner__text`,children:[`GAIA is slow to answer.`,` `,(0,U.jsx)(`span`,{className:`connection-banner__hint`,children:`It may be busy with another chat or app. GAIA keeps checking.`})]}),e&&(0,U.jsx)(rA,{onRetry:e,label:`Check again`})]});if(i?.config_error)return(0,U.jsxs)(`div`,{className:`connection-banner connection-banner--error`,role:`alert`,children:[(0,U.jsx)(`div`,{className:`connection-banner__icon`,children:(0,U.jsx)(An,{size:16})}),(0,U.jsxs)(`div`,{className:`connection-banner__text`,children:[`GAIA settings could not be loaded.`,` `,(0,U.jsx)(`span`,{className:`connection-banner__hint`,children:i.config_error})]}),e&&(0,U.jsx)(rA,{onRetry:e,label:`Check again`})]});if(i&&!i.lemonade_running){let t=$k(i)===`unresponsive`;return(0,U.jsxs)(`div`,{className:`connection-banner connection-banner--warning`,role:`status`,children:[(0,U.jsx)(`div`,{className:`connection-banner__icon`,children:(0,U.jsx)(An,{size:16})}),(0,U.jsxs)(`div`,{className:`connection-banner__text`,children:[t?`The model server is not answering (${i.lemonade_error}). It may be busy with another app or loading a model.`:`The model server isn't running.`,` `,i.start_command?(0,U.jsxs)(`span`,{className:`connection-banner__hint`,children:[t?`If it stays this way, restart it: `:`To start it by hand, run `,(0,U.jsx)(`code`,{children:i.start_command})]}):i.start_instruction&&(0,U.jsx)(`span`,{className:`connection-banner__hint`,children:i.start_instruction})]}),e&&(0,U.jsx)(rA,{onRetry:e,label:`Check again`}),(0,U.jsx)(`button`,{className:`connection-banner__dismiss`,onClick:()=>c(!0),"aria-label":`Dismiss`,children:(0,U.jsx)(Bn,{size:14})})]})}if(i&&i.lemonade_running&&i.model_loaded&&i.context_size_sufficient===!1){let t=i.model_context_size??0;return(0,U.jsxs)(`div`,{className:`connection-banner connection-banner--warning`,role:`status`,children:[(0,U.jsx)(`div`,{className:`connection-banner__icon`,children:(0,U.jsx)(vt,{size:16})}),(0,U.jsxs)(`div`,{className:`connection-banner__text`,children:[`LLM context window is too small (`,t.toLocaleString(),` tokens;`,` `,al.toLocaleString(),` required).`,` `,(0,U.jsx)(`span`,{className:`connection-banner__hint`,children:`Reload it with a larger context in Settings → Advanced.`})]}),e&&(0,U.jsx)(rA,{onRetry:e,label:`Check again`}),(0,U.jsx)(`button`,{className:`connection-banner__dismiss`,onClick:()=>c(!0),"aria-label":`Dismiss`,children:(0,U.jsx)(Bn,{size:14})})]})}return null}function aA(){let e=rk(),[t,n]=(0,V.useState)(!1),[r,i]=(0,V.useState)(null),a=(0,V.useCallback)(e=>{let t=tk();t&&(i(null),t[e]().catch(t=>{let n=t instanceof Error?t.message:String(t);s.system.error(`Update ${e} failed`,t),i(n)}))},[]);if(t||e.status===`idle`||e.status===`checking`||e.status===`disabled`||e.status===`no-channel`)return null;if(e.status===`downloading`){let t=Math.max(0,Math.min(100,e.progress));return(0,U.jsxs)(`div`,{className:`update-chip update-chip--downloading`,role:`status`,"aria-live":`polite`,title:`Downloading update${e.version?` ${e.version}`:``}…`,children:[(0,U.jsx)(Oe,{size:13,className:`update-chip__icon`}),(0,U.jsxs)(`span`,{className:`update-chip__label`,children:[`Downloading update… `,t,`%`]})]})}return e.status===`available`?(0,U.jsxs)(`div`,{className:`update-chip update-chip--available`,role:`status`,title:r||e.releaseNotes||`A new version is available.`,children:[(0,U.jsx)(Oe,{size:13,className:`update-chip__icon`}),(0,U.jsx)(`span`,{className:`update-chip__label`,children:r?`Update failed — try again`:`GAIA ${e.version??``} is available`}),!e.pinnedVersion&&(0,U.jsx)(`button`,{type:`button`,className:`update-chip__action`,onClick:()=>a(`downloadUpdate`),children:`Update now`}),(0,U.jsx)(`button`,{type:`button`,className:`update-chip__dismiss`,onClick:()=>n(!0),"aria-label":`Dismiss update notification`,children:(0,U.jsx)(Bn,{size:11})})]}):e.status===`downloaded`?(0,U.jsxs)(`div`,{className:`update-chip update-chip--ready`,role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(tn,{size:13,className:`update-chip__icon`}),(0,U.jsx)(`button`,{type:`button`,className:`update-chip__action`,onClick:()=>a(`restart`),title:r||`Click to restart and apply the update`,children:r?`Restart failed — try again`:`Update ready — restart to apply`})]}):e.status===`error`?(0,U.jsxs)(`div`,{className:`update-chip update-chip--error`,role:`status`,title:e.error||`Update check failed.`,children:[(0,U.jsx)(An,{size:13,className:`update-chip__icon`}),(0,U.jsx)(`span`,{className:`update-chip__label`,children:`Update check failed`}),(0,U.jsx)(`button`,{type:`button`,className:`update-chip__dismiss`,onClick:()=>n(!0),"aria-label":`Dismiss update error`,children:(0,U.jsx)(Bn,{size:11})})]}):null}var oA={permission_request:{icon:(0,U.jsx)(un,{size:16}),colorClass:`notif-type-permission`,label:`Permission`},policy_alert:{icon:(0,U.jsx)(un,{size:16}),colorClass:`notif-type-policy`,label:`Policy`},security_alert:{icon:(0,U.jsx)(An,{size:16}),colorClass:`notif-type-security`,label:`Security`},status_change:{icon:(0,U.jsx)(ce,{size:16}),colorClass:`notif-type-status`,label:`Status`},info:{icon:(0,U.jsx)(mt,{size:16}),colorClass:`notif-type-info`,label:`Info`},error:{icon:(0,U.jsx)(oe,{size:16}),colorClass:`notif-type-error`,label:`Error`}};function sA(e){let t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return`just now`;let r=Math.floor(n/60);if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let a=Math.floor(i/24);return a<7?`${a}d ago`:new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function cA({onClose:e}){let t=wc(qn(Ec)),n=wc(Tc),r=wc(e=>e.markRead),i=wc(e=>e.markAllRead),a=wc(e=>e.clearAll),o=wc(e=>e.dismiss),s=wc(e=>e.respondToPermission),c=wc(e=>e.typeFilter),l=wc(e=>e.setTypeFilter),u=(0,V.useCallback)(e=>{r(e)},[r]),d=(0,V.useCallback)(e=>{s(e.id,`allow`).catch(e=>console.error(`[NotificationCenter] allow failed:`,e))},[s]),f=(0,V.useCallback)(e=>{s(e.id,`deny`).catch(e=>console.error(`[NotificationCenter] deny failed:`,e))},[s]);return ki(!0,e),(0,U.jsxs)(`div`,{className:`notification-center`,role:`dialog`,"aria-label":`Notification Center`,children:[(0,U.jsxs)(`div`,{className:`notification-center-header`,children:[(0,U.jsxs)(`div`,{className:`notification-center-title-row`,children:[(0,U.jsx)(`h2`,{className:`notification-center-title`,children:`Notifications`}),n>0&&(0,U.jsx)(`span`,{className:`notification-center-badge`,children:n})]}),(0,U.jsx)(`button`,{className:`btn-icon notification-center-close`,onClick:e,"aria-label":`Close notification center`,children:(0,U.jsx)(Bn,{size:18})})]}),(0,U.jsx)(`div`,{className:`notification-filter-bar`,role:`tablist`,"aria-label":`Filter notifications`,children:[{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`}].map(e=>(0,U.jsx)(`button`,{role:`tab`,"aria-selected":c===e.key,className:`notification-filter-tab ${c===e.key?`active`:``}`,onClick:()=>l(e.key),children:e.label},e.key??`all`))}),(0,U.jsx)(`div`,{className:`notification-list`,children:t.length===0?(0,U.jsxs)(`div`,{className:`notification-empty`,children:[(0,U.jsx)(w,{size:40,strokeWidth:1.2}),(0,U.jsx)(`span`,{children:`No notifications`})]}):t.map(e=>{let t=oA[e.type];return(0,U.jsxs)(`div`,{className:`notification-item ${e.read?``:`unread`} ${t.colorClass}`,id:e.type===`policy_alert`&&e.receiptId?`policy-receipt-${encodeURIComponent(e.receiptId)}`:void 0,onClick:()=>u(e.id),role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&u(e.id)},children:[!e.read&&(0,U.jsx)(`span`,{className:`notification-unread-dot`}),(0,U.jsx)(`span`,{className:`notification-icon`,children:t.icon}),(0,U.jsxs)(`div`,{className:`notification-content`,children:[(0,U.jsxs)(`div`,{className:`notification-content-header`,children:[(0,U.jsx)(`span`,{className:`notification-agent`,children:e.agentName}),(0,U.jsx)(`span`,{className:`notification-time`,children:sA(e.timestamp)})]}),e.title&&(0,U.jsx)(`span`,{className:`notification-title`,children:e.title}),(0,U.jsx)(`span`,{className:`notification-message`,children:e.message}),e.type===`permission_request`&&e.tool&&e.tool!==`allow_path_access`&&(0,U.jsxs)(`span`,{className:`notification-tool`,children:[`Tool: `,(0,U.jsx)(`code`,{children:e.tool})]}),e.type===`policy_alert`&&(0,U.jsxs)(`div`,{className:`notification-policy-details`,children:[e.tool&&(0,U.jsxs)(`span`,{className:`notification-tool`,children:[`Tool: `,(0,U.jsx)(`code`,{children:e.tool})]}),e.reason&&(0,U.jsxs)(`span`,{className:`notification-policy-reason`,children:[`Reason: `,e.reason]}),e.ruleIds&&e.ruleIds.length>0&&(0,U.jsxs)(`span`,{className:`notification-tool`,children:[`Rules: `,(0,U.jsx)(`code`,{children:e.ruleIds.join(`, `)})]}),e.policyVersion&&(0,U.jsxs)(`span`,{className:`notification-tool`,children:[`Policy: `,(0,U.jsx)(`code`,{children:e.policyVersion})]}),(0,U.jsxs)(`span`,{className:`notification-tool`,children:[`Receipt:`,` `,e.receiptId?(0,U.jsx)(`code`,{children:e.receiptId}):(0,U.jsx)(`em`,{children:`Receipt unavailable`})]})]}),e.type===`permission_request`&&!e.response&&(0,U.jsxs)(`div`,{className:`notification-actions`,children:[(0,U.jsxs)(`button`,{className:`notification-action-btn notification-action-allow`,onClick:t=>{t.stopPropagation(),d(e)},children:[(0,U.jsx)(F,{size:14}),`Approve`]}),(0,U.jsxs)(`button`,{className:`notification-action-btn notification-action-deny`,onClick:t=>{t.stopPropagation(),f(e)},children:[(0,U.jsx)(Bn,{size:14}),`Deny`]})]}),e.type===`permission_request`&&e.response&&(0,U.jsx)(`span`,{className:`notification-response-badge ${e.response===`allow`?`response-allow`:`response-deny`}`,children:e.response===`allow`?`Approved`:`Denied`})]}),(0,U.jsx)(`button`,{className:`notification-dismiss`,onClick:t=>{t.stopPropagation(),o(e.id)},"aria-label":`Dismiss notification`,children:(0,U.jsx)(Bn,{size:14})})]},e.id)})}),t.length>0&&(0,U.jsxs)(`div`,{className:`notification-center-footer`,children:[(0,U.jsxs)(`button`,{className:`notification-footer-btn`,onClick:i,disabled:n===0,children:[(0,U.jsx)(F,{size:14}),`Mark All Read`]}),(0,U.jsxs)(`button`,{className:`notification-footer-btn notification-footer-clear`,onClick:a,children:[(0,U.jsx)(On,{size:14}),`Clear`]})]})]})}var lA=1500,uA=e=>new Promise(t=>setTimeout(t,e));async function dA({onProgress:e,isCancelled:t=()=>!1,pollMs:n=lA}={}){try{await Fa(rD)}catch(e){if(e?.httpStatus!==409)throw e;let t=await Ia(rD).catch(()=>null);if(!t||t.status===`completed`||t.status===`failed`)throw e}for(;!t();){let t=await Ia(rD);if(e?.(t),t.status===`completed`)return;if(t.status===`failed`)throw Error(t.error||`The GAIA agent could not be installed.`);await uA(n)}}function fA({onInstalled:e}){let[t,n]=(0,V.useState)({kind:`idle`}),r=(0,V.useRef)(!1);(0,V.useEffect)(()=>()=>{r.current=!0},[]);let i=(0,V.useCallback)(async()=>{n({kind:`installing`,percent:0});try{if(await dA({isCancelled:()=>r.current,onProgress:e=>{r.current||n({kind:`installing`,percent:e.percent??0})}}),r.current)return;await e(),r.current||n({kind:`idle`})}catch(e){r.current||n({kind:`failed`,error:e instanceof Error?e.message:String(e)})}},[e]);return(0,U.jsxs)(`div`,{className:`app-notice is-warning`,role:`status`,children:[t.kind===`installing`?(0,U.jsxs)(`span`,{children:[`Installing the GAIA agent… `,Math.round(t.percent),`%`]}):t.kind===`failed`?(0,U.jsxs)(`span`,{children:[`The GAIA agent could not be installed: `,t.error]}):(0,U.jsx)(`span`,{children:`The GAIA agent isn't installed, so new chats can't start yet.`}),t.kind!==`installing`&&(0,U.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>void i(),children:t.kind===`failed`?`Try again`:`Install GAIA agent`})]})}function pA(e,t){if(!(e instanceof Error))return t;let n=e.message,r=n.match(/API \d+: (.+)/);if(r)try{let e=JSON.parse(r[1]);if(e.detail)return e.detail}catch{}return n}function mA(e,t){let{addNotification:n}=wc.getState();for(let r of t)r.error_count<=(e[r.id]??0)||!r.last_error||n({id:`schedule-error-${r.id}-${r.error_count}`,type:`error`,agentId:`scheduler`,agentName:`GAIA`,title:`Scheduled task "${r.name}" failed`,message:r.last_error,timestamp:Date.now(),read:!1,dismissed:!1,priority:`high`,...r.session_id?{sessionId:r.session_id}:{}})}var hA=$n((e,t)=>({schedules:[],loading:!1,error:null,actionError:null,selectedSchedule:null,results:[],resultsLoading:!1,errorCounts:null,loadSchedules:async()=>{t().schedules.length===0&&!t().error&&e({loading:!0}),e({error:null});try{let n=(await us()).schedules||[],r=t().errorCounts;r&&mA(r,n),e({schedules:n,loading:!1,errorCounts:Object.fromEntries(n.map(e=>[e.id,e.error_count]))})}catch(t){s.api.error(`Failed to load schedules`,t),e({error:`Failed to load schedules`,loading:!1})}},createSchedule:async(t,n,r)=>{try{let i=await fs(t,n,r);e(e=>({schedules:[...e.schedules,i],actionError:null}))}catch(e){throw s.api.error(`Failed to create schedule`,e),e}},updateScheduleStatus:async(t,n)=>{try{let r=await ps(t,n);e(e=>({schedules:e.schedules.map(e=>e.name===t?r:e),actionError:null}))}catch(n){s.api.error(`Failed to update schedule "${t}"`,n),e({actionError:pA(n,`Failed to update schedule`)})}},runScheduleNow:async t=>{try{let n=await ms(t);e(e=>({schedules:e.schedules.map(e=>e.name===t?n:e),actionError:null}))}catch(n){s.api.error(`Failed to run schedule "${t}" now`,n),e({actionError:pA(n,`Could not run the schedule now`)})}},deleteSchedule:async t=>{try{await hs(t),e(e=>({schedules:e.schedules.filter(e=>e.name!==t),selectedSchedule:e.selectedSchedule===t?null:e.selectedSchedule,actionError:null}))}catch(n){s.api.error(`Failed to delete schedule "${t}"`,n),e({actionError:pA(n,`Failed to delete schedule`)})}},selectSchedule:n=>{e({selectedSchedule:n,results:[],resultsLoading:!1}),n&&t().loadResults(n)},loadResults:async n=>{e({resultsLoading:!0});try{let r=await gs(n);if(t().selectedSchedule!==n)return;e({results:r.results||[],resultsLoading:!1})}catch(r){if(s.api.error(`Failed to load results for "${n}"`,r),t().selectedSchedule!==n)return;e({results:[],resultsLoading:!1})}},dismissActionError:()=>e({actionError:null})})),gA=new Set([`loading_model`,`downloading_model`,`model_retry`,`waiting`]),_A=5;function vA(e,t){return{id:e,title:t.get(e)?.title??`Untitled chat`}}function yA(e){let t=new Map(e.sessions.map(e=>[e.id,e])),n=e.isStreaming&&e.currentSessionId!==null,r=[...e.runningSessionIds];n&&!r.includes(e.currentSessionId)&&r.push(e.currentSessionId);let i=new Set(r),a=new Set(e.notifications.filter(e=>e.type===`permission_request`&&!e.response&&!e.dismissed&&e.sessionId&&i.has(e.sessionId)).map(e=>e.sessionId)),o=[...a].map(e=>({...vA(e,t),reason:`approval`}));n&&e.awaitingUser&&!a.has(e.currentSessionId)&&o.push({...vA(e.currentSessionId,t),reason:`answer`});for(let[n,r]of Object.entries(e.awaitingBySession))o.some(e=>e.id===n)||o.push({...vA(n,t),reason:r===`question`?`answer`:`approval`});let s=n&&!e.awaitingUser&&e.livePhase&&gA.has(e.livePhase)?e.liveStatus:null,c=e.systemStatus,l=null;if(c?.default_model_is_cloud&&c.default_model_name)l={name:c.default_model_name,where:`cloud`};else if(c?.model_loaded){let e=c.model_labels?.includes(`cloud`),t=c.model_device&&c.model_device!==`none`?c.model_device:null;l={name:c.model_loaded,where:e?`cloud`:t}}let u=[...e.sessions].sort((e,t)=>t.updated_at.localeCompare(e.updated_at)).slice(0,_A).map(e=>vA(e.id,t));return{backendConnected:e.backendConnected,modelServerRunning:c&&!c.default_model_is_cloud?c.lemonade_running:null,model:l,waitingOnModel:s||null,running:r.map(e=>vA(e,t)),needsYou:o,recent:u}}function bA(e){let t=(0,V.useRef)(e);t.current=e,(0,V.useEffect)(()=>{let e=window.gaiaAPI?.tray;if(!e)return;let n=``,r=null,i=()=>{let t=H.getState(),i={backendConnected:t.backendConnected,systemStatus:t.systemStatus,sessions:t.sessions,runningSessionIds:t.runningSessionIds,awaitingBySession:t.awaitingBySession,currentSessionId:t.currentSessionId,isStreaming:t.isStreaming,awaitingUser:t.awaitingUser,liveStatus:t.liveStatus,livePhase:t.livePhase,notifications:wc.getState().notifications},a=r;if(r=i,a&&Object.keys(i).every(e=>i[e]===a[e]))return;let o=yA(i),c=JSON.stringify(o);c!==n&&(n=c,e.setActivity(o).catch(e=>{n=``,s.system.error(`The tray could not take the app state`,e)}))};i();let a=H.subscribe(i),o=wc.subscribe(i),c=e.onCommand(e=>{switch(e.type){case`open-chat`:t.current.openChat(e.sessionId);break;case`new-chat`:t.current.newChat();break;case`open-settings`:H.getState().openSettings(e.section);break;case`refresh-status`:t.current.refreshStatus();break;default:s.system.error(`Unknown tray command`,e)}});return()=>{a(),o(),c()}},[])}function xA(){(0,V.useEffect)(()=>{let e=window.gaiaAPI;if(!e)return;let t=wc.getState().addNotification,n=[e.notification.onNotification(t),e.notification.onPermissionRequest(t),e.tray.onNavigate(e=>{let t=typeof e==`string`&&e.startsWith(`session:`)?e.slice(8):null;if(!t)return;let n=H.getState();n.currentSessionId!==t&&n.setMessages([]),n.setCurrentSession(t)})];return()=>n.forEach(e=>e())},[])}function SA(e,t,n){let r=window.gaiaAPI;if(r){r.notification.show({title:t,body:n,sessionId:e}).then(e=>{e||s.system.warn(`This OS has no desktop notifications; the badge still counts it.`)}).catch(e=>s.system.error(`Could not show the desktop notification`,e));return}if(typeof Notification>`u`){s.system.warn(`This browser has no notifications; the alert was not shown.`);return}if(Notification.permission!==`granted`){s.system.warn(`Browser notifications are ${Notification.permission}; allow them in Settings → Notifications.`);return}let i=new Notification(t,{body:n,tag:`gaia-${e}`});i.onclick=()=>{window.focus(),H.getState().setCurrentSession(e)}}function CA(){let[e,t]=(0,V.useState)(null);return(0,V.useEffect)(()=>{let e=navigator;if(!e.getBattery)return;let n=null,r=()=>{n&&t({charging:n.charging,level:n.level})};return e.getBattery().then(e=>{n=e,r(),e.addEventListener(`levelchange`,r),e.addEventListener(`chargingchange`,r)}).catch(e=>s.system.warn(`Battery level unavailable; keep-awake ignores the battery policy.`,e)),()=>{n?.removeEventListener(`levelchange`,r),n?.removeEventListener(`chargingchange`,r)}},[]),e}function wA(){xA();let e=H(e=>e.runningSessionIds),t=H(e=>e.awaitingBySession),n=H(e=>e.sessions),r=H(e=>e.currentSessionId),i=wc(qn(Oc)),a=Fc(),o=CA(),c=(0,V.useRef)(null),l=Hc(e,t,i),u=JSON.stringify(l);(0,V.useEffect)(()=>{let e=JSON.parse(u),t=c.current;if(c.current=e,t===null)return;let{sessions:n,currentSessionId:r}=H.getState(),i=document.hasFocus(),o=!1;for(let{sessionId:c,event:l}of Uc(t,e)){let e=n.find(e=>e.id===c);if(e?.kind===`eval`||e?.kind===`scheduled`)continue;let t=a.modes[l];if(!(t===`off`||Kc(c,r,i))&&(o=!0,t===`banner`)){if(l!==`finished`){let{title:t,body:n}=Gc(l,e);SA(c,t,n)}else vo(c).then(e=>{H.getState().updateSessionInList(c,e);let{title:t,body:n}=Gc(l,e);SA(c,t,n)}).catch(t=>{s.system.error(`Could not read how chat ${c} ended`,t);let{title:n,body:r}=Gc(l,{...e,last_run_status:null});SA(c,n,r)})}}if(o){if(a.sound)try{Yc()}catch(e){s.system.warn(`Alert sound not played`,e)}a.flash&&!i&&window.gaiaAPI&&window.gaiaAPI.notification.flash().catch(e=>s.system.error(`Could not flash the taskbar button`,e))}},[u,a.modes,a.sound,a.flash]);let d=qc(n,l,a.modes,r);(0,V.useEffect)(()=>{window.gaiaAPI?.notification.setAttentionCount(d).catch(e=>s.system.error(`Could not update the taskbar badge`,e))},[d]);let f=a.keepAwake&&e.length>0&&Jc(o,a.batteryFloor);(0,V.useEffect)(()=>{window.gaiaAPI?.power.setKeepAwake(f).catch(e=>s.system.error(`Could not change keep-awake`,e))},[f])}function TA(e){if(e<=0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=Math.min(Math.floor(Math.log(e)/Math.log(t)),n.length-1);return parseFloat((e/t**r).toFixed(1))+` `+n[r]}function EA(e){return e.replace(/-/g,``).slice(0,7)}function DA(e,t){let n=t.replace(/^#/,``).toLowerCase();if(!n||n.length<4)return null;let r=e.find(e=>e.id.replace(/-/g,``).toLowerCase().startsWith(n));return r?r.id:null}function OA(e,t,n){return!e||t&&(e===t||e===EA(t))?null:n.some(t=>t.id===e)?e:DA(n,e)}function kA(e){return new URLSearchParams(e.search).get(`session`)||e.hash.replace(/^#/,``)||null}var AA=`gaia:last-session`;function jA(e){try{e?localStorage.setItem(AA,e):localStorage.removeItem(AA)}catch(e){s.ui.warn(`Could not save the open chat for the next launch`,e)}}function MA(){try{return localStorage.getItem(AA)}catch(e){return s.ui.warn(`Could not read the chat open at last launch`,e),null}}var NA=1e3,PA=3e4;function FA(e,{initialMs:t=NA,maxMs:n=PA,onError:r}={}){let i=t,a=0,o=null,s=!1,c=!1,l=!1,u=()=>{l||c||s||(o&&=(clearTimeout(o),null),s=!0,a+=1,e().then(()=>{c=!0}).catch(e=>{l||(r?.(e,a),o=setTimeout(()=>{o=null,u()},i),i=Math.min(i*2,n))}).finally(()=>{s=!1}))};return u(),{kick:()=>{o&&u()},stop:()=>{l=!0,o&&clearTimeout(o),o=null},done:()=>c}}var IA=(0,V.lazy)(()=>Uk(()=>import(`./MemoryDashboard-DKeENiEN.js`).then(e=>({default:e.MemoryDashboard})),__vite__mapDeps([5,1,2,6,7]),import.meta.url)),LA=(0,V.lazy)(()=>Uk(()=>import(`./ScheduleManager-DMCckccQ.js`).then(e=>({default:e.ScheduleManager})),__vite__mapDeps([8,1,2,6,9]),import.meta.url)),RA=(0,V.lazy)(()=>Uk(()=>import(`./DocumentLibrary-s6IEqE1v.js`).then(e=>({default:e.DocumentLibrary})),__vite__mapDeps([10,1,2,11]),import.meta.url)),zA=(0,V.lazy)(()=>Uk(()=>import(`./FileBrowser-EJp637PF.js`).then(e=>({default:e.FileBrowser})),__vite__mapDeps([12,1,2,13]),import.meta.url)),BA=(0,V.lazy)(()=>Uk(()=>import(`./MobileAccessModal-BOjyr9RN.js`).then(e=>({default:e.MobileAccessModal})),__vite__mapDeps([14,1,2,15]),import.meta.url)),VA=3,HA=3e5,UA=6e3,WA=6e4,GA=e=>e instanceof TypeError,KA=e=>new Promise(t=>setTimeout(t,e));function qA(){return(0,U.jsx)(`div`,{className:`loading-spinner`,role:`status`,"aria-label":`Loading`})}var JA=e=>e===1||e%10==0;function YA(){let e=H(e=>e.currentSessionId),t=H(e=>e.setSessions),n=H(e=>e.setCurrentSession),r=H(e=>e.addSession),a=H(e=>e.setMessages),o=H(e=>e.showDocLibrary),l=H(e=>e.showFileBrowser),u=H(e=>e.showMemoryDashboard),d=H(e=>e.showSchedules),f=H(e=>e.sidebarOpen),p=H(e=>e.setSidebarOpen),m=H(e=>e.setSystemStatus),h=H(e=>e.setBackendConnected),g=H(e=>e.setAgents),_=H(e=>e.agents),v=H(e=>e.setPendingPrompt),y=H(e=>e.setDefaultPermissionMode),b=H(e=>e.openSettings),x=H(e=>e.settingsSection),S=H(e=>e.syncSystemTheme),C=Ws(e=>e.restoreNotice),w=Ws(e=>e.dismissRestoreNotice),T=wc(e=>e.showPanel),E=H(e=>e.systemStatus?.initialized===!0),D=wc(e=>e.setShowPanel);(0,V.useEffect)(()=>{if(!C?.ok)return;let e=setTimeout(w,UA);return()=>clearTimeout(e)},[C,w]);let[O,k]=(0,V.useState)({state:`checking`}),A=(0,V.useRef)(O);A.current=O;let[j,M]=(0,V.useState)(!1),N=(0,V.useRef)(j);N.current=j;let[ee,P]=(0,V.useState)(!1),F=ee||j&&!iD(_),te=(0,V.useRef)(F);te.current=F;let[ne,re]=(0,V.useState)(null),[I,L]=(0,V.useState)(``),[ie,ae]=(0,V.useState)(0),[oe,se]=(0,V.useState)(!1),[ce,le]=(0,V.useState)(!1),[ue,de]=(0,V.useState)(null),fe=(0,V.useRef)(async()=>{}),R=(0,V.useRef)(async()=>{}),z=(0,V.useCallback)(async(e=!1,t=!1)=>{e||k({state:`checking`});let n=0;try{for(;;){await Ws.getState().refresh();let e=Ws.getState().active,r;try{r=await Ra(!!e?.remote)}catch(e){if(!t||!GA(e)||n>=WA)throw e;await KA(NA),n+=NA;continue}n>0&&await Promise.all([fe.current(),R.current()]),k(r.ready?{state:`ready`}:{state:`needed`,check:r});return}}catch(e){let t=e instanceof Error?e.message:String(e);s.system.warn(`Setup check could not be answered`,e),k({state:`unknown`,error:t})}},[]),pe=(0,V.useRef)(0),me=(0,V.useCallback)(async()=>{let e=++pe.current,t=(await Pa()).agents||[];e===pe.current&&(g(t),M(!0),iD(t)&&P(!1))},[g]),he=(0,V.useCallback)(()=>{let e=N.current;M(!1),me().catch(t=>{s.api.warn(`Agent list unavailable after setup`,t),e&&M(!0)})},[me]);(0,V.useEffect)(()=>{let e=()=>{te.current&&me().catch(e=>s.api.warn(`Agent list unavailable`,e))};return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[me]);let ge=(0,V.useCallback)(async()=>{y((await la()).default_mode)},[y]),_e=(0,V.useRef)([]);(0,V.useEffect)(()=>{i(`0.25.4rc1`),z(!1,!0);let e=[FA(me,{onError:(e,t)=>{JA(t)&&s.api.warn(`Agent list unavailable (attempt ${t}); retrying`,e)}}),FA(ge,{onError:(e,t)=>{JA(t)&&s.api.warn(`Default permission mode unavailable (attempt ${t}); retrying`,e)}})];return _e.current=e,()=>e.forEach(e=>e.stop())},[z,me,ge]);let ve=(0,V.useCallback)(()=>{_e.current.forEach(e=>e.kick()),Ws.getState().retryNow(),R.current(),A.current.state===`unknown`&&z(!0)},[z]),ye=(0,V.useRef)(ve);ye.current=ve;let be=(0,V.useRef)(0),xe=(0,V.useRef)(0),Se=(0,V.useRef)(null),Ce=(0,V.useRef)(!1),[we,Te]=(0,V.useState)(!1),[Ee,De]=(0,V.useState)(null),Oe=(0,V.useCallback)(e=>{if(e.kind===`unreachable`){s.system.warn(`System status check failed`,e.error),Ce.current=!0,xe.current=0,Se.current=null,Te(!1),De(null),h(!1),m(null);return}if(e.kind===`error`){s.system.warn(`System status answered HTTP ${e.httpStatus}`,e.message),Ce.current&&ye.current(),Ce.current=!1,xe.current=0,Se.current=null,Te(!1),De(`HTTP ${e.httpStatus}: ${e.message}`),h(!0);return}if(e.kind===`slow`){if(xe.current+=1,Se.current??=Date.now(),De(null),s.system.warn(`System status did not answer in time (${xe.current} in a row)`),Date.now()-Se.current>=HA){Te(!1),h(!1),m(null);return}h(!0),(Ce.current||xe.current>=VA)&&Te(!0);return}let{status:t}=e;Ce.current&&ye.current(),Ce.current=!1,xe.current=0,Se.current=null,Te(!1),De(null),h(!0),be.current=t.lemonade_running?0:be.current+1;let n=H.getState().systemStatus;t.lemonade_running||be.current>=VA||!n?.lemonade_running?m(t):m({...n,download_progress:t.download_progress})},[h,m]),ke=(0,V.useRef)(Oe);ke.current=Oe;let[Ae]=(0,V.useState)(()=>nA(e=>ke.current(e))),je=Ae.check;fe.current=je,(0,V.useEffect)(()=>lD(Ae.start),[Ae]);let Me=(0,V.useRef)(``);(0,V.useEffect)(()=>{let e=e=>mo().then(n=>{let r=n.sessions||[];if(!e&&r.length===0&&H.getState().sessions.length>0)return;let i=r.map(e=>`${e.id}|${e.updated_at}|${e.title}|${e.inference_remote}|${e.inference_provider}|${e.inference_description}|${e.effective_model}|${e.unread}|${e.pinned}|${e.last_run_status}|${e.kind}`).join(`
|
|
78
|
+
`);if(i===Me.current)return;Me.current=i,t(r);let a=Ws.getState().active?.model;a&&r.some(e=>e.effective_model&&e.effective_model!==a)&&Ws.getState().refresh()}).catch(t=>{e&&s.system.error(`Could not load chats`,t)});R.current=()=>e(!1),e(!0);let n=setInterval(()=>void e(!1),5e3);return()=>clearInterval(n)},[t]),(0,V.useEffect)(()=>zC(),[]),(0,V.useEffect)(()=>{let e=()=>{hA.getState().loadSchedules()};e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[]),(0,V.useEffect)(()=>ow(),[]),wA();let Ne=(0,V.useRef)(!1),Pe=(0,V.useRef)(!1);(0,V.useEffect)(()=>{let e=()=>{let e=kA(window.location),{currentSessionId:t,sessions:r}=H.getState(),i=OA(e,t,r);return i&&(n(i),a([])),i},t=()=>{if(Ne.current||(Ne.current=!0,e()||H.getState().currentSessionId))return;if(window.location.hash){window.history.replaceState(null,``,window.location.pathname+window.location.search);return}if(Pe.current||Fi(`new-chat`))return;let{sessions:t}=H.getState(),r=OA(MA(),null,t);r&&(n(r),a([]))},r=H.subscribe(e=>{e.sessions.length>0&&t()});return H.getState().sessions.length>0&&t(),window.addEventListener(`hashchange`,e),window.addEventListener(`popstate`,e),()=>{r(),window.removeEventListener(`hashchange`,e),window.removeEventListener(`popstate`,e)}},[n,a]),(0,V.useEffect)(()=>{let e=null,t=2e3,r=!1,i=null,o=()=>{r||(e=new EventSource(`${c()}/sessions/events`),e.onopen=()=>{t=2e3},e.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch(e){s.api.warn(`Malformed session event`,e);return}t.type===`set_active_session`&&t.session_id&&t.session_id!==H.getState().currentSessionId&&(n(t.session_id),a([]))},e.onerror=()=>{e?.close(),e=null,!r&&(i=setTimeout(o,t),t=Math.min(t*2,3e4))})};return o(),()=>{r=!0,i&&clearTimeout(i),e?.close()}},[n,a]),(0,V.useEffect)(()=>{if(Ne.current&&jA(e),e){let t=EA(e);window.location.hash!==`#${t}`&&window.history.replaceState(null,``,`#${t}`)}else Ne.current&&window.location.hash&&window.history.replaceState(null,``,window.location.pathname+window.location.search)},[e]);let Fe=(0,V.useCallback)(async e=>{re(null);let t=H.getState(),i;try{i=await ho({title:`New Task`,agent_type:rD,document_ids:t.draftDocumentIds,private:t.draftPrivate,folders:t.draftFolder?[t.draftFolder]:[]})}catch(e){throw aD(e)?(P(!0),Error(`The GAIA agent isn't installed. Install it from the notice above, then send again.`)):e}te.current&&(P(!1),me().catch(e=>s.api.warn(`Agent list unavailable`,e))),t.defaultPermissionModeKnown||(await ge().catch(e=>s.api.warn(`Default permission mode unavailable; using the chip's mode`,e)),t=H.getState()),t.clearDraftDocuments(),t.setDraftPrivate(!1),t.setDraftFolder(null);let o=null;try{await da(i.id,t.draftPermissionMode)}catch(e){o=e}return Li(Pi),o&&!i.private&&Ii(Ni(i.id),e),r(i),n(i.id),a([]),L(``),o?(re(`The chat was created, but its permission mode could not be set, so your message was not sent${i.private?``:` — it is in the chat's box`}: ${o instanceof Error?o.message:o}`),!1):(t.resetDraftPermissionMode(),v({sessionId:i.id,text:e}),!0)},[r,n,a,v,me,ge]),Ie=(0,V.useCallback)(()=>{let e=H.getState(),t=e.currentSessionId;t&&rl(t,e)&&il(t),e.setShowMemoryDashboard(!1),e.setShowSchedules(!1),Pe.current=!0,n(null),a([]),ae(e=>e+1)},[n,a]);bA({openChat:(0,V.useCallback)(e=>{let t=H.getState();t.closeSettings(),e!==t.currentSessionId&&(il(t.currentSessionId),a([])),n(e)},[n,a]),newChat:(0,V.useCallback)(()=>{H.getState().closeSettings(),Ie()},[Ie]),refreshStatus:()=>void je()});let Le=(0,V.useCallback)(e=>{Ie(),Fe(`Load the \`${e}\` skill, then tell me briefly what it lets you do.`).catch(e=>re(e instanceof Error?e.message:String(e)))},[Ie,Fe]),Re=(0,V.useCallback)(e=>{k({state:`ready`}),he(),je(),e&&(e.needs_input?L(e.prompt):Fe(e.prompt).catch(e=>re(e instanceof Error?e.message:String(e))))},[je,Fe,he]);(0,V.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&(e.shiftKey&&e.key.toLowerCase()===`o`?(e.preventDefault(),Ie()):!e.shiftKey&&e.key.toLowerCase()===`k`?(e.preventDefault(),window.dispatchEvent(new CustomEvent(`gaia:focus-search`))):!e.shiftKey&&e.key.toLowerCase()===`b`?(e.preventDefault(),H.getState().toggleSidebarCollapsed()):!e.shiftKey&&e.key===`,`&&(e.preventDefault(),b()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Ie,b]),(0,V.useEffect)(()=>{let e=window.matchMedia?.(`(max-width: 768px)`);if(!e)return;let t=()=>p(!e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[p]),(0,V.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(prefers-color-scheme: light)`);return e.addEventListener(`change`,S),()=>e.removeEventListener(`change`,S)},[S]),(0,V.useEffect)(()=>{cs().then(e=>le(e.active===!0)).catch(e=>s.system.debug(`Mobile access unavailable`,e))},[]);let ze=(0,V.useCallback)(async()=>{if(se(!0),de(null),!ce)try{let e=await os();e.error?de(e.error):le(!0)}catch(e){de(e instanceof Error?e.message:`Could not start mobile access`)}},[ce]),Be=(0,V.useCallback)(async()=>{try{await ss(),le(!1),se(!1)}catch(e){de(e instanceof Error?e.message:`Could not stop mobile access`)}},[]);sE(e=>{e?ze():Be()}),(0,V.useEffect)(()=>{aE(ce)},[ce]);let Ve=typeof window<`u`&&window.innerWidth<=768;if(O.state===`checking`&&!E)return(0,U.jsx)(`div`,{className:`app`,children:(0,U.jsxs)(`main`,{className:`startup`,role:`status`,"aria-label":`Starting GAIA`,children:[(0,U.jsx)(`div`,{className:`loading-spinner`,"aria-hidden":`true`}),(0,U.jsx)(`p`,{className:`startup-text`,children:`Starting GAIA…`})]})});if(O.state===`needed`)return(0,U.jsx)(`div`,{className:`app`,children:(0,U.jsx)(ZO,{initial:O.check,onReady:Re})});let He=u?(0,U.jsx)(V.Suspense,{fallback:(0,U.jsx)(qA,{}),children:(0,U.jsx)(IA,{})}):e?(0,U.jsx)(vD,{sessionId:e},e):(0,U.jsx)(DO,{onSend:Fe,initialText:I,focusRequest:ie},I);return(0,U.jsxs)(`div`,{className:`app`,children:[!f&&(0,U.jsx)(`button`,{className:`sidebar-toggle`,onClick:()=>p(!0),"aria-label":`Open sidebar`,children:(0,U.jsx)(jt,{size:18})}),(0,U.jsx)(`div`,{className:`sidebar-overlay ${f?`visible`:``}`,onClick:()=>p(!1),"aria-hidden":`true`}),(0,U.jsx)(Il,{onNewChat:Ie,onMobileAccess:Ve?void 0:()=>void ze(),tunnelActive:ce}),(0,U.jsxs)(`div`,{className:`main-content`,children:[O.state===`ready`&&(0,U.jsx)(iA,{onRetry:je,backendSlow:we,backendError:Ee}),O.state===`unknown`&&(0,U.jsxs)(`div`,{className:`app-notice is-warning`,role:`status`,children:[(0,U.jsxs)(`span`,{children:[`Could not check whether GAIA is set up: `,O.error]}),(0,U.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>void z(),children:`Check again`})]}),F&&(0,U.jsx)(fA,{onInstalled:me}),C&&(0,U.jsxs)(`div`,{className:`app-notice${C.ok?``:` is-warning`}`,role:`status`,children:[(0,U.jsx)(`span`,{children:C.message}),!C.ok&&(0,U.jsx)(`button`,{type:`button`,className:`link-btn`,onClick:()=>{w(),b(`model`)},children:`Pick a model`}),(0,U.jsx)(`button`,{type:`button`,className:`app-notice-close`,onClick:w,"aria-label":`Dismiss`,children:(0,U.jsx)(Bn,{size:14})})]}),He]}),d&&(0,U.jsx)(V.Suspense,{fallback:null,children:(0,U.jsx)(LA,{})}),o&&(0,U.jsx)(V.Suspense,{fallback:null,children:(0,U.jsx)(RA,{})}),l&&(0,U.jsx)(V.Suspense,{fallback:null,children:(0,U.jsx)(zA,{onStartChat:Fe})}),T&&(0,U.jsx)(`div`,{className:`notification-center-popover`,children:(0,U.jsx)(cA,{onClose:()=>D(!1)})}),oe&&(0,U.jsx)(V.Suspense,{fallback:null,children:(0,U.jsx)(BA,{isOpen:oe,onClose:()=>se(!1),onStop:()=>void Be(),error:ue})}),x&&(0,U.jsx)(qk,{onUseSkill:Le}),(0,U.jsx)(aA,{}),ne&&(0,U.jsx)(`div`,{className:`toast`,role:`alert`,children:ne})]})}mc(),ir();var XA=localStorage.getItem(`gaia-chat-theme`);rr(tr(XA===`light`||XA===`dark`?XA:`system`));var ZA=H.getState();xr(ZA.palette,ZA.customColors,ZA.theme),Kr(ZA.locale),Vn.createRoot(document.getElementById(`root`)).render((0,U.jsx)(V.StrictMode,{children:(0,U.jsx)(YA,{})}));export{Go as $,et as $t,$D as A,Ki as At,hw as B,Mn as Bt,ID as C,Hi as Ct,HD as D,Wi as Dt,FD as E,Ui as Et,QD as F,ki as Ft,q as G,on as Gt,lw as H,On as Ht,oO as I,H as It,Qc as J,qt as Jt,ol as K,tn as Kt,dO as L,Bn as Lt,YD as M,qi as Mt,ZD as N,Ri as Nt,KD as O,zi as Ot,XD as P,Yi as Pt,Jo as Q,St as Qt,WD as R,Rn as Rt,LD as S,Vi as St,rO as T,Gi as Tt,dw as U,bn as Ut,_w as V,An as Vt,pS as W,vn as Wt,Xo as X,B as Xt,qs as Y,Ft as Yt,Qo as Z,Et as Zt,zD as _,ne as _n,Aa as _t,OO as a,Ae as an,wa as at,VD as b,S as bn,Zi as bt,fO as c,we as cn,Ho as ct,nO as d,z as dn,_s as dt,Je as en,Ko as et,JD as f,ue as fn,as as ft,BD as g,I as gn,Oa as gt,pO as h,ie as hn,Ka as ht,Uk as i,Me as in,ka as it,eO as j,Xi as jt,cO as k,Ji as kt,aO as l,be as ln,Ma as lt,RD as m,oe as mn,is as mt,hA as n,We as nn,ls as nt,vO as o,Oe as on,cs as ot,lO as p,ce as pn,Yo as pt,al as q,$t as qt,Jk as r,Ie as rn,Da as rt,uO as s,Ee as sn,$o as st,TA as t,Ke as tn,Wa as tt,tO as u,me as un,es as ut,GD as v,F as vn,Wo as vt,UD as w,Qi as wt,sO as x,Bi as xt,qD as y,O as yn,Uo as yt,iO as z,Pn as zt};
|