@adhdev/daemon-standalone 0.5.3 → 0.5.5
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/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/public/assets/index-94oyUw_i.js +186 -0
- package/public/assets/{index-68ueYWEL.js → index-96w38vUG.js} +47 -47
- package/public/assets/index-B10-caE3.css +32 -0
- package/public/assets/index-B2YMaA0y.js +186 -0
- package/public/assets/index-BFcENe83.js +186 -0
- package/public/assets/index-BLoxWHbc.css +32 -0
- package/public/assets/index-BRaYxriU.js +186 -0
- package/public/assets/index-BiGfAi3p.css +32 -0
- package/public/assets/index-BoMNLSFo.js +186 -0
- package/public/assets/index-Bqd63kEf.js +186 -0
- package/public/assets/index-BrRx73WW.css +32 -0
- package/public/assets/index-BtFBYt4S.js +186 -0
- package/public/assets/index-Buh3CKsZ.css +32 -0
- package/public/assets/index-BwTB9bq4.css +32 -0
- package/public/assets/index-C3WbW5-9.css +32 -0
- package/public/assets/index-C3kQpRwM.js +186 -0
- package/public/assets/index-CBPu6684.css +32 -0
- package/public/assets/index-CRb5jZSP.js +186 -0
- package/public/assets/index-CcwtBh4z.css +32 -0
- package/public/assets/index-Cdl_Uf8k.css +32 -0
- package/public/assets/index-CiRrLeo4.js +186 -0
- package/public/assets/index-CwzgUmt4.css +32 -0
- package/public/assets/index-D3r1MeBL.css +32 -0
- package/public/assets/index-D41sUK70.js +186 -0
- package/public/assets/index-D5ZAG2ed.js +186 -0
- package/public/assets/index-DCq6bTMj.css +32 -0
- package/public/assets/index-DDN-N8-r.css +32 -0
- package/public/assets/index-DE_LrhPD.js +186 -0
- package/public/assets/index-DH3JFo3P.js +186 -0
- package/public/assets/index-DHu8pF3J.js +186 -0
- package/public/assets/index-DJbQi3ra.js +186 -0
- package/public/assets/index-DR6VqErb.js +186 -0
- package/public/assets/index-DTXVM3Vb.css +32 -0
- package/public/assets/index-Ddcbtwg-.js +186 -0
- package/public/assets/index-Dg92qUFt.js +186 -0
- package/public/assets/index-DhLjcjFc.css +32 -0
- package/public/assets/index-DmdYQOWM.js +186 -0
- package/public/assets/index-DthOENaz.css +32 -0
- package/public/assets/index-DvOOmQ1s.js +186 -0
- package/public/assets/index-W2ECenxW.css +32 -0
- package/public/assets/index-_0NDaGCi.js +186 -0
- package/public/assets/index-c_ex_bK7.js +186 -0
- package/public/assets/index-fQgFNmvM.js +186 -0
- package/public/assets/index-j9BGHnc1.js +186 -0
- package/public/assets/index-oQ8GgkYr.css +32 -0
- package/public/assets/index-qBcMLS7S.js +186 -0
- package/public/assets/index-u7iXS4BI.js +186 -0
- package/public/assets/index-uCH1wvbu.js +186 -0
- package/public/index.html +2 -2
- package/public/assets/index-ChXBX3No.css +0 -32
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
var j1=Object.defineProperty;var O1=(e,t,r)=>t in e?j1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ms=(e,t,r)=>O1(e,typeof t!="symbol"?t+"":t,r);function z1(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Fl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s_={exports:{}},ba={},o_={exports:{}},Te={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Lo=Symbol.for("react.element"),F1=Symbol.for("react.portal"),$1=Symbol.for("react.fragment"),H1=Symbol.for("react.strict_mode"),W1=Symbol.for("react.profiler"),U1=Symbol.for("react.provider"),V1=Symbol.for("react.context"),K1=Symbol.for("react.forward_ref"),q1=Symbol.for("react.suspense"),Y1=Symbol.for("react.memo"),X1=Symbol.for("react.lazy"),Mf=Symbol.iterator;function G1(e){return e===null||typeof e!="object"?null:(e=Mf&&e[Mf]||e["@@iterator"],typeof e=="function"?e:null)}var l_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},a_=Object.assign,c_={};function os(e,t,r){this.props=e,this.context=t,this.refs=c_,this.updater=r||l_}os.prototype.isReactComponent={};os.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};os.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function u_(){}u_.prototype=os.prototype;function Zh(e,t,r){this.props=e,this.context=t,this.refs=c_,this.updater=r||l_}var Jh=Zh.prototype=new u_;Jh.constructor=Zh;a_(Jh,os.prototype);Jh.isPureReactComponent=!0;var If=Array.isArray,h_=Object.prototype.hasOwnProperty,ed={current:null},d_={key:!0,ref:!0,__self:!0,__source:!0};function f_(e,t,r){var n,i={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)h_.call(t,n)&&!d_.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){for(var a=Array(l),c=0;c<l;c++)a[c]=arguments[c+2];i.children=a}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:Lo,type:e,key:s,ref:o,props:i,_owner:ed.current}}function Q1(e,t){return{$$typeof:Lo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function td(e){return typeof e=="object"&&e!==null&&e.$$typeof===Lo}function Z1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Af=/\/+/g;function ec(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Z1(""+e.key):t.toString(36)}function _l(e,t,r,n,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Lo:case F1:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+ec(o,0):n,If(i)?(r="",e!=null&&(r=e.replace(Af,"$&/")+"/"),_l(i,t,r,"",function(c){return c})):i!=null&&(td(i)&&(i=Q1(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Af,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",If(e))for(var l=0;l<e.length;l++){s=e[l];var a=n+ec(s,l);o+=_l(s,t,r,a,i)}else if(a=G1(e),typeof a=="function")for(e=a.call(e),l=0;!(s=e.next()).done;)s=s.value,a=n+ec(s,l++),o+=_l(s,t,r,a,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Uo(e,t,r){if(e==null)return e;var n=[],i=0;return _l(e,n,"","",function(s){return t.call(r,s,i++)}),n}function J1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ft={current:null},vl={transition:null},ex={ReactCurrentDispatcher:Ft,ReactCurrentBatchConfig:vl,ReactCurrentOwner:ed};function p_(){throw Error("act(...) is not supported in production builds of React.")}Te.Children={map:Uo,forEach:function(e,t,r){Uo(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Uo(e,function(){t++}),t},toArray:function(e){return Uo(e,function(t){return t})||[]},only:function(e){if(!td(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Te.Component=os;Te.Fragment=$1;Te.Profiler=W1;Te.PureComponent=Zh;Te.StrictMode=H1;Te.Suspense=q1;Te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ex;Te.act=p_;Te.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=a_({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=ed.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)h_.call(t,a)&&!d_.hasOwnProperty(a)&&(n[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)n.children=r;else if(1<a){l=Array(a);for(var c=0;c<a;c++)l[c]=arguments[c+2];n.children=l}return{$$typeof:Lo,type:e.type,key:i,ref:s,props:n,_owner:o}};Te.createContext=function(e){return e={$$typeof:V1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:U1,_context:e},e.Consumer=e};Te.createElement=f_;Te.createFactory=function(e){var t=f_.bind(null,e);return t.type=e,t};Te.createRef=function(){return{current:null}};Te.forwardRef=function(e){return{$$typeof:K1,render:e}};Te.isValidElement=td;Te.lazy=function(e){return{$$typeof:X1,_payload:{_status:-1,_result:e},_init:J1}};Te.memo=function(e,t){return{$$typeof:Y1,type:e,compare:t===void 0?null:t}};Te.startTransition=function(e){var t=vl.transition;vl.transition={};try{e()}finally{vl.transition=t}};Te.unstable_act=p_;Te.useCallback=function(e,t){return Ft.current.useCallback(e,t)};Te.useContext=function(e){return Ft.current.useContext(e)};Te.useDebugValue=function(){};Te.useDeferredValue=function(e){return Ft.current.useDeferredValue(e)};Te.useEffect=function(e,t){return Ft.current.useEffect(e,t)};Te.useId=function(){return Ft.current.useId()};Te.useImperativeHandle=function(e,t,r){return Ft.current.useImperativeHandle(e,t,r)};Te.useInsertionEffect=function(e,t){return Ft.current.useInsertionEffect(e,t)};Te.useLayoutEffect=function(e,t){return Ft.current.useLayoutEffect(e,t)};Te.useMemo=function(e,t){return Ft.current.useMemo(e,t)};Te.useReducer=function(e,t,r){return Ft.current.useReducer(e,t,r)};Te.useRef=function(e){return Ft.current.useRef(e)};Te.useState=function(e){return Ft.current.useState(e)};Te.useSyncExternalStore=function(e,t,r){return Ft.current.useSyncExternalStore(e,t,r)};Te.useTransition=function(){return Ft.current.useTransition()};Te.version="18.3.1";o_.exports=Te;var b=o_.exports;const tx=Qh(b),rx=z1({__proto__:null,default:tx},[b]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var nx=b,ix=Symbol.for("react.element"),sx=Symbol.for("react.fragment"),ox=Object.prototype.hasOwnProperty,lx=nx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ax={key:!0,ref:!0,__self:!0,__source:!0};function m_(e,t,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)ox.call(t,n)&&!ax.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:ix,type:e,key:s,ref:o,props:i,_owner:lx.current}}ba.Fragment=sx;ba.jsx=m_;ba.jsxs=m_;s_.exports=ba;var d=s_.exports,g_={exports:{}},hr={},__={exports:{}},v_={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(P,$){var w=P.length;P.push($);e:for(;0<w;){var re=w-1>>>1,ce=P[re];if(0<i(ce,$))P[re]=$,P[w]=ce,w=re;else break e}}function r(P){return P.length===0?null:P[0]}function n(P){if(P.length===0)return null;var $=P[0],w=P.pop();if(w!==$){P[0]=w;e:for(var re=0,ce=P.length,k=ce>>>1;re<k;){var me=2*(re+1)-1,Q=P[me],J=me+1,X=P[J];if(0>i(Q,w))J<ce&&0>i(X,Q)?(P[re]=X,P[J]=w,re=J):(P[re]=Q,P[me]=w,re=me);else if(J<ce&&0>i(X,w))P[re]=X,P[J]=w,re=J;else break e}}return $}function i(P,$){var w=P.sortIndex-$.sortIndex;return w!==0?w:P.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var a=[],c=[],h=1,u=null,f=3,p=!1,m=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(P){for(var $=r(c);$!==null;){if($.callback===null)n(c);else if($.startTime<=P)n(c),$.sortIndex=$.expirationTime,t(a,$);else break;$=r(c)}}function N(P){if(g=!1,y(P),!m)if(r(a)!==null)m=!0,O(L);else{var $=r(c);$!==null&&V(N,$.startTime-P)}}function L(P,$){m=!1,g&&(g=!1,_(z),z=-1),p=!0;var w=f;try{for(y($),u=r(a);u!==null&&(!(u.expirationTime>$)||P&&!H());){var re=u.callback;if(typeof re=="function"){u.callback=null,f=u.priorityLevel;var ce=re(u.expirationTime<=$);$=e.unstable_now(),typeof ce=="function"?u.callback=ce:u===r(a)&&n(a),y($)}else n(a);u=r(a)}if(u!==null)var k=!0;else{var me=r(c);me!==null&&V(N,me.startTime-$),k=!1}return k}finally{u=null,f=w,p=!1}}var C=!1,D=null,z=-1,F=5,E=-1;function H(){return!(e.unstable_now()-E<F)}function B(){if(D!==null){var P=e.unstable_now();E=P;var $=!0;try{$=D(!0,P)}finally{$?I():(C=!1,D=null)}}else C=!1}var I;if(typeof v=="function")I=function(){v(B)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,T=W.port2;W.port1.onmessage=B,I=function(){T.postMessage(null)}}else I=function(){x(B,0)};function O(P){D=P,C||(C=!0,I())}function V(P,$){z=x(function(){P(e.unstable_now())},$)}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(P){P.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,O(L))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return r(a)},e.unstable_next=function(P){switch(f){case 1:case 2:case 3:var $=3;break;default:$=f}var w=f;f=$;try{return P()}finally{f=w}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,$){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var w=f;f=P;try{return $()}finally{f=w}},e.unstable_scheduleCallback=function(P,$,w){var re=e.unstable_now();switch(typeof w=="object"&&w!==null?(w=w.delay,w=typeof w=="number"&&0<w?re+w:re):w=re,P){case 1:var ce=-1;break;case 2:ce=250;break;case 5:ce=1073741823;break;case 4:ce=1e4;break;default:ce=5e3}return ce=w+ce,P={id:h++,callback:$,priorityLevel:P,startTime:w,expirationTime:ce,sortIndex:-1},w>re?(P.sortIndex=w,t(c,P),r(a)===null&&P===r(c)&&(g?(_(z),z=-1):g=!0,V(N,w-re))):(P.sortIndex=ce,t(a,P),m||p||(m=!0,O(L))),P},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(P){var $=f;return function(){var w=f;f=$;try{return P.apply(this,arguments)}finally{f=w}}}})(v_);__.exports=v_;var cx=__.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var ux=b,ur=cx;function te(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var y_=new Set,no={};function xi(e,t){Qi(e,t),Qi(e+"Capture",t)}function Qi(e,t){for(no[e]=t,e=0;e<t.length;e++)y_.add(t[e])}var cn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),su=Object.prototype.hasOwnProperty,hx=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Bf={},jf={};function dx(e){return su.call(jf,e)?!0:su.call(Bf,e)?!1:hx.test(e)?jf[e]=!0:(Bf[e]=!0,!1)}function fx(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function px(e,t,r,n){if(t===null||typeof t>"u"||fx(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function $t(e,t,r,n,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Nt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Nt[e]=new $t(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Nt[t]=new $t(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Nt[e]=new $t(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Nt[e]=new $t(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Nt[e]=new $t(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Nt[e]=new $t(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Nt[e]=new $t(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Nt[e]=new $t(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Nt[e]=new $t(e,5,!1,e.toLowerCase(),null,!1,!1)});var rd=/[\-:]([a-z])/g;function nd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(rd,nd);Nt[t]=new $t(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(rd,nd);Nt[t]=new $t(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(rd,nd);Nt[t]=new $t(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Nt[e]=new $t(e,1,!1,e.toLowerCase(),null,!1,!1)});Nt.xlinkHref=new $t("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Nt[e]=new $t(e,1,!1,e.toLowerCase(),null,!0,!0)});function id(e,t,r,n){var i=Nt.hasOwnProperty(t)?Nt[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(px(t,r,i,n)&&(r=null),n||i===null?dx(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var fn=ux.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Vo=Symbol.for("react.element"),Di=Symbol.for("react.portal"),Ri=Symbol.for("react.fragment"),sd=Symbol.for("react.strict_mode"),ou=Symbol.for("react.profiler"),x_=Symbol.for("react.provider"),w_=Symbol.for("react.context"),od=Symbol.for("react.forward_ref"),lu=Symbol.for("react.suspense"),au=Symbol.for("react.suspense_list"),ld=Symbol.for("react.memo"),Sn=Symbol.for("react.lazy"),S_=Symbol.for("react.offscreen"),Of=Symbol.iterator;function gs(e){return e===null||typeof e!="object"?null:(e=Of&&e[Of]||e["@@iterator"],typeof e=="function"?e:null)}var Xe=Object.assign,tc;function Is(e){if(tc===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);tc=t&&t[1]||""}return`
|
|
34
|
+
`+tc+e}var rc=!1;function nc(e,t){if(!e||rc)return"";rc=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&typeof c.stack=="string"){for(var i=c.stack.split(`
|
|
35
|
+
`),s=n.stack.split(`
|
|
36
|
+
`),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var a=`
|
|
37
|
+
`+i[o].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=o&&0<=l);break}}}finally{rc=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Is(e):""}function mx(e){switch(e.tag){case 5:return Is(e.type);case 16:return Is("Lazy");case 13:return Is("Suspense");case 19:return Is("SuspenseList");case 0:case 2:case 15:return e=nc(e.type,!1),e;case 11:return e=nc(e.type.render,!1),e;case 1:return e=nc(e.type,!0),e;default:return""}}function cu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ri:return"Fragment";case Di:return"Portal";case ou:return"Profiler";case sd:return"StrictMode";case lu:return"Suspense";case au:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w_:return(e.displayName||"Context")+".Consumer";case x_:return(e._context.displayName||"Context")+".Provider";case od:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ld:return t=e.displayName||null,t!==null?t:cu(e.type)||"Memo";case Sn:t=e._payload,e=e._init;try{return cu(e(t))}catch{}}return null}function gx(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return cu(t);case 8:return t===sd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Fn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function b_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _x(e){var t=b_(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ko(e){e._valueTracker||(e._valueTracker=_x(e))}function k_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=b_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function $l(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function uu(e,t){var r=t.checked;return Xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function zf(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Fn(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function C_(e,t){t=t.checked,t!=null&&id(e,"checked",t,!1)}function hu(e,t){C_(e,t);var r=Fn(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?du(e,t.type,r):t.hasOwnProperty("defaultValue")&&du(e,t.type,Fn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ff(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function du(e,t,r){(t!=="number"||$l(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var As=Array.isArray;function Ui(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Fn(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function fu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(te(91));return Xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function $f(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(te(92));if(As(r)){if(1<r.length)throw Error(te(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Fn(r)}}function E_(e,t){var r=Fn(t.value),n=Fn(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Hf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function N_(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?N_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var qo,L_=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(qo=qo||document.createElement("div"),qo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=qo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function io(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ws={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},vx=["Webkit","ms","Moz","O"];Object.keys(Ws).forEach(function(e){vx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ws[t]=Ws[e]})});function T_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ws.hasOwnProperty(e)&&Ws[e]?(""+t).trim():t+"px"}function P_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=T_(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var yx=Xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function mu(e,t){if(t){if(yx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(te(62))}}function gu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _u=null;function ad(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vu=null,Vi=null,Ki=null;function Wf(e){if(e=Do(e)){if(typeof vu!="function")throw Error(te(280));var t=e.stateNode;t&&(t=La(t),vu(e.stateNode,e.type,t))}}function D_(e){Vi?Ki?Ki.push(e):Ki=[e]:Vi=e}function R_(){if(Vi){var e=Vi,t=Ki;if(Ki=Vi=null,Wf(e),t)for(e=0;e<t.length;e++)Wf(t[e])}}function M_(e,t){return e(t)}function I_(){}var ic=!1;function A_(e,t,r){if(ic)return e(t,r);ic=!0;try{return M_(e,t,r)}finally{ic=!1,(Vi!==null||Ki!==null)&&(I_(),R_())}}function so(e,t){var r=e.stateNode;if(r===null)return null;var n=La(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(te(231,t,typeof r));return r}var yu=!1;if(cn)try{var _s={};Object.defineProperty(_s,"passive",{get:function(){yu=!0}}),window.addEventListener("test",_s,_s),window.removeEventListener("test",_s,_s)}catch{yu=!1}function xx(e,t,r,n,i,s,o,l,a){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(h){this.onError(h)}}var Us=!1,Hl=null,Wl=!1,xu=null,wx={onError:function(e){Us=!0,Hl=e}};function Sx(e,t,r,n,i,s,o,l,a){Us=!1,Hl=null,xx.apply(wx,arguments)}function bx(e,t,r,n,i,s,o,l,a){if(Sx.apply(this,arguments),Us){if(Us){var c=Hl;Us=!1,Hl=null}else throw Error(te(198));Wl||(Wl=!0,xu=c)}}function wi(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function B_(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 Uf(e){if(wi(e)!==e)throw Error(te(188))}function kx(e){var t=e.alternate;if(!t){if(t=wi(e),t===null)throw Error(te(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var s=i.alternate;if(s===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return Uf(i),e;if(s===n)return Uf(i),t;s=s.sibling}throw Error(te(188))}if(r.return!==n.return)r=i,n=s;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=s;break}if(l===n){o=!0,n=i,r=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===r){o=!0,r=s,n=i;break}if(l===n){o=!0,n=s,r=i;break}l=l.sibling}if(!o)throw Error(te(189))}}if(r.alternate!==n)throw Error(te(190))}if(r.tag!==3)throw Error(te(188));return r.stateNode.current===r?e:t}function j_(e){return e=kx(e),e!==null?O_(e):null}function O_(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=O_(e);if(t!==null)return t;e=e.sibling}return null}var z_=ur.unstable_scheduleCallback,Vf=ur.unstable_cancelCallback,Cx=ur.unstable_shouldYield,Ex=ur.unstable_requestPaint,it=ur.unstable_now,Nx=ur.unstable_getCurrentPriorityLevel,cd=ur.unstable_ImmediatePriority,F_=ur.unstable_UserBlockingPriority,Ul=ur.unstable_NormalPriority,Lx=ur.unstable_LowPriority,$_=ur.unstable_IdlePriority,ka=null,Yr=null;function Tx(e){if(Yr&&typeof Yr.onCommitFiberRoot=="function")try{Yr.onCommitFiberRoot(ka,e,void 0,(e.current.flags&128)===128)}catch{}}var Mr=Math.clz32?Math.clz32:Rx,Px=Math.log,Dx=Math.LN2;function Rx(e){return e>>>=0,e===0?32:31-(Px(e)/Dx|0)|0}var Yo=64,Xo=4194304;function Bs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Vl(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=Bs(l):(s&=o,s!==0&&(n=Bs(s)))}else o=r&~i,o!==0?n=Bs(o):s!==0&&(n=Bs(s));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Mr(t),i=1<<r,n|=e[r],t&=~i;return n}function Mx(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ix(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Mr(s),l=1<<o,a=i[o];a===-1?(!(l&r)||l&n)&&(i[o]=Mx(l,t)):a<=t&&(e.expiredLanes|=l),s&=~l}}function wu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function H_(){var e=Yo;return Yo<<=1,!(Yo&4194240)&&(Yo=64),e}function sc(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function To(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mr(t),e[t]=r}function Ax(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-Mr(r),s=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~s}}function ud(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Mr(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Me=0;function W_(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var U_,hd,V_,K_,q_,Su=!1,Go=[],Dn=null,Rn=null,Mn=null,oo=new Map,lo=new Map,Cn=[],Bx="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Kf(e,t){switch(e){case"focusin":case"focusout":Dn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Mn=null;break;case"pointerover":case"pointerout":oo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":lo.delete(t.pointerId)}}function vs(e,t,r,n,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Do(t),t!==null&&hd(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function jx(e,t,r,n,i){switch(t){case"focusin":return Dn=vs(Dn,e,t,r,n,i),!0;case"dragenter":return Rn=vs(Rn,e,t,r,n,i),!0;case"mouseover":return Mn=vs(Mn,e,t,r,n,i),!0;case"pointerover":var s=i.pointerId;return oo.set(s,vs(oo.get(s)||null,e,t,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,lo.set(s,vs(lo.get(s)||null,e,t,r,n,i)),!0}return!1}function Y_(e){var t=ii(e.target);if(t!==null){var r=wi(t);if(r!==null){if(t=r.tag,t===13){if(t=B_(r),t!==null){e.blockedOn=t,q_(e.priority,function(){V_(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function yl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=bu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);_u=n,r.target.dispatchEvent(n),_u=null}else return t=Do(r),t!==null&&hd(t),e.blockedOn=r,!1;t.shift()}return!0}function qf(e,t,r){yl(e)&&r.delete(t)}function Ox(){Su=!1,Dn!==null&&yl(Dn)&&(Dn=null),Rn!==null&&yl(Rn)&&(Rn=null),Mn!==null&&yl(Mn)&&(Mn=null),oo.forEach(qf),lo.forEach(qf)}function ys(e,t){e.blockedOn===t&&(e.blockedOn=null,Su||(Su=!0,ur.unstable_scheduleCallback(ur.unstable_NormalPriority,Ox)))}function ao(e){function t(i){return ys(i,e)}if(0<Go.length){ys(Go[0],e);for(var r=1;r<Go.length;r++){var n=Go[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Dn!==null&&ys(Dn,e),Rn!==null&&ys(Rn,e),Mn!==null&&ys(Mn,e),oo.forEach(t),lo.forEach(t),r=0;r<Cn.length;r++)n=Cn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Cn.length&&(r=Cn[0],r.blockedOn===null);)Y_(r),r.blockedOn===null&&Cn.shift()}var qi=fn.ReactCurrentBatchConfig,Kl=!0;function zx(e,t,r,n){var i=Me,s=qi.transition;qi.transition=null;try{Me=1,dd(e,t,r,n)}finally{Me=i,qi.transition=s}}function Fx(e,t,r,n){var i=Me,s=qi.transition;qi.transition=null;try{Me=4,dd(e,t,r,n)}finally{Me=i,qi.transition=s}}function dd(e,t,r,n){if(Kl){var i=bu(e,t,r,n);if(i===null)mc(e,t,n,ql,r),Kf(e,n);else if(jx(i,e,t,r,n))n.stopPropagation();else if(Kf(e,n),t&4&&-1<Bx.indexOf(e)){for(;i!==null;){var s=Do(i);if(s!==null&&U_(s),s=bu(e,t,r,n),s===null&&mc(e,t,n,ql,r),s===i)break;i=s}i!==null&&n.stopPropagation()}else mc(e,t,n,null,r)}}var ql=null;function bu(e,t,r,n){if(ql=null,e=ad(n),e=ii(e),e!==null)if(t=wi(e),t===null)e=null;else if(r=t.tag,r===13){if(e=B_(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ql=e,null}function X_(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Nx()){case cd:return 1;case F_:return 4;case Ul:case Lx:return 16;case $_:return 536870912;default:return 16}default:return 16}}var Nn=null,fd=null,xl=null;function G_(){if(xl)return xl;var e,t=fd,r=t.length,n,i="value"in Nn?Nn.value:Nn.textContent,s=i.length;for(e=0;e<r&&t[e]===i[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===i[s-n];n++);return xl=i.slice(e,1<n?1-n:void 0)}function wl(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 Qo(){return!0}function Yf(){return!1}function dr(e){function t(r,n,i,s,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Qo:Yf,this.isPropagationStopped=Yf,this}return Xe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Qo)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Qo)},persist:function(){},isPersistent:Qo}),t}var ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pd=dr(ls),Po=Xe({},ls,{view:0,detail:0}),$x=dr(Po),oc,lc,xs,Ca=Xe({},Po,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:md,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!==xs&&(xs&&e.type==="mousemove"?(oc=e.screenX-xs.screenX,lc=e.screenY-xs.screenY):lc=oc=0,xs=e),oc)},movementY:function(e){return"movementY"in e?e.movementY:lc}}),Xf=dr(Ca),Hx=Xe({},Ca,{dataTransfer:0}),Wx=dr(Hx),Ux=Xe({},Po,{relatedTarget:0}),ac=dr(Ux),Vx=Xe({},ls,{animationName:0,elapsedTime:0,pseudoElement:0}),Kx=dr(Vx),qx=Xe({},ls,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Yx=dr(qx),Xx=Xe({},ls,{data:0}),Gf=dr(Xx),Gx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qx={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"},Zx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zx[e])?!!t[e]:!1}function md(){return Jx}var ew=Xe({},Po,{key:function(e){if(e.key){var t=Gx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=wl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Qx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:md,charCode:function(e){return e.type==="keypress"?wl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?wl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),tw=dr(ew),rw=Xe({},Ca,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qf=dr(rw),nw=Xe({},Po,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:md}),iw=dr(nw),sw=Xe({},ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),ow=dr(sw),lw=Xe({},Ca,{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}),aw=dr(lw),cw=[9,13,27,32],gd=cn&&"CompositionEvent"in window,Vs=null;cn&&"documentMode"in document&&(Vs=document.documentMode);var uw=cn&&"TextEvent"in window&&!Vs,Q_=cn&&(!gd||Vs&&8<Vs&&11>=Vs),Zf=" ",Jf=!1;function Z_(e,t){switch(e){case"keyup":return cw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function J_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mi=!1;function hw(e,t){switch(e){case"compositionend":return J_(t);case"keypress":return t.which!==32?null:(Jf=!0,Zf);case"textInput":return e=t.data,e===Zf&&Jf?null:e;default:return null}}function dw(e,t){if(Mi)return e==="compositionend"||!gd&&Z_(e,t)?(e=G_(),xl=fd=Nn=null,Mi=!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 Q_&&t.locale!=="ko"?null:t.data;default:return null}}var fw={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 ep(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fw[e.type]:t==="textarea"}function ev(e,t,r,n){D_(n),t=Yl(t,"onChange"),0<t.length&&(r=new pd("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Ks=null,co=null;function pw(e){hv(e,0)}function Ea(e){var t=Bi(e);if(k_(t))return e}function mw(e,t){if(e==="change")return t}var tv=!1;if(cn){var cc;if(cn){var uc="oninput"in document;if(!uc){var tp=document.createElement("div");tp.setAttribute("oninput","return;"),uc=typeof tp.oninput=="function"}cc=uc}else cc=!1;tv=cc&&(!document.documentMode||9<document.documentMode)}function rp(){Ks&&(Ks.detachEvent("onpropertychange",rv),co=Ks=null)}function rv(e){if(e.propertyName==="value"&&Ea(co)){var t=[];ev(t,co,e,ad(e)),A_(pw,t)}}function gw(e,t,r){e==="focusin"?(rp(),Ks=t,co=r,Ks.attachEvent("onpropertychange",rv)):e==="focusout"&&rp()}function _w(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ea(co)}function vw(e,t){if(e==="click")return Ea(t)}function yw(e,t){if(e==="input"||e==="change")return Ea(t)}function xw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Br=typeof Object.is=="function"?Object.is:xw;function uo(e,t){if(Br(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!su.call(t,i)||!Br(e[i],t[i]))return!1}return!0}function np(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ip(e,t){var r=np(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=np(r)}}function nv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?nv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function iv(){for(var e=window,t=$l();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=$l(e.document)}return t}function _d(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ww(e){var t=iv(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&nv(r.ownerDocument.documentElement,r)){if(n!==null&&_d(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!e.extend&&s>n&&(i=n,n=s,s=i),i=ip(r,s);var o=ip(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Sw=cn&&"documentMode"in document&&11>=document.documentMode,Ii=null,ku=null,qs=null,Cu=!1;function sp(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Cu||Ii==null||Ii!==$l(n)||(n=Ii,"selectionStart"in n&&_d(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),qs&&uo(qs,n)||(qs=n,n=Yl(ku,"onSelect"),0<n.length&&(t=new pd("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ii)))}function Zo(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ai={animationend:Zo("Animation","AnimationEnd"),animationiteration:Zo("Animation","AnimationIteration"),animationstart:Zo("Animation","AnimationStart"),transitionend:Zo("Transition","TransitionEnd")},hc={},sv={};cn&&(sv=document.createElement("div").style,"AnimationEvent"in window||(delete Ai.animationend.animation,delete Ai.animationiteration.animation,delete Ai.animationstart.animation),"TransitionEvent"in window||delete Ai.transitionend.transition);function Na(e){if(hc[e])return hc[e];if(!Ai[e])return e;var t=Ai[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in sv)return hc[e]=t[r];return e}var ov=Na("animationend"),lv=Na("animationiteration"),av=Na("animationstart"),cv=Na("transitionend"),uv=new Map,op="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Hn(e,t){uv.set(e,t),xi(t,[e])}for(var dc=0;dc<op.length;dc++){var fc=op[dc],bw=fc.toLowerCase(),kw=fc[0].toUpperCase()+fc.slice(1);Hn(bw,"on"+kw)}Hn(ov,"onAnimationEnd");Hn(lv,"onAnimationIteration");Hn(av,"onAnimationStart");Hn("dblclick","onDoubleClick");Hn("focusin","onFocus");Hn("focusout","onBlur");Hn(cv,"onTransitionEnd");Qi("onMouseEnter",["mouseout","mouseover"]);Qi("onMouseLeave",["mouseout","mouseover"]);Qi("onPointerEnter",["pointerout","pointerover"]);Qi("onPointerLeave",["pointerout","pointerover"]);xi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xi("onBeforeInput",["compositionend","keypress","textInput","paste"]);xi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var js="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(" "),Cw=new Set("cancel close invalid load scroll toggle".split(" ").concat(js));function lp(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,bx(n,t,void 0,e),e.currentTarget=null}function hv(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==s&&i.isPropagationStopped())break e;lp(i,l,c),s=a}else for(o=0;o<n.length;o++){if(l=n[o],a=l.instance,c=l.currentTarget,l=l.listener,a!==s&&i.isPropagationStopped())break e;lp(i,l,c),s=a}}}if(Wl)throw e=xu,Wl=!1,xu=null,e}function Fe(e,t){var r=t[Pu];r===void 0&&(r=t[Pu]=new Set);var n=e+"__bubble";r.has(n)||(dv(t,e,2,!1),r.add(n))}function pc(e,t,r){var n=0;t&&(n|=4),dv(r,e,n,t)}var Jo="_reactListening"+Math.random().toString(36).slice(2);function ho(e){if(!e[Jo]){e[Jo]=!0,y_.forEach(function(r){r!=="selectionchange"&&(Cw.has(r)||pc(r,!1,e),pc(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jo]||(t[Jo]=!0,pc("selectionchange",!1,t))}}function dv(e,t,r,n){switch(X_(t)){case 1:var i=zx;break;case 4:i=Fx;break;default:i=dd}r=i.bind(null,t,r,e),i=void 0,!yu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function mc(e,t,r,n,i){var s=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var a=o.tag;if((a===3||a===4)&&(a=o.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;o=o.return}for(;l!==null;){if(o=ii(l),o===null)return;if(a=o.tag,a===5||a===6){n=s=o;continue e}l=l.parentNode}}n=n.return}A_(function(){var c=s,h=ad(r),u=[];e:{var f=uv.get(e);if(f!==void 0){var p=pd,m=e;switch(e){case"keypress":if(wl(r)===0)break e;case"keydown":case"keyup":p=tw;break;case"focusin":m="focus",p=ac;break;case"focusout":m="blur",p=ac;break;case"beforeblur":case"afterblur":p=ac;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Xf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Wx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=iw;break;case ov:case lv:case av:p=Kx;break;case cv:p=ow;break;case"scroll":p=$x;break;case"wheel":p=aw;break;case"copy":case"cut":case"paste":p=Yx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Qf}var g=(t&4)!==0,x=!g&&e==="scroll",_=g?f!==null?f+"Capture":null:f;g=[];for(var v=c,y;v!==null;){y=v;var N=y.stateNode;if(y.tag===5&&N!==null&&(y=N,_!==null&&(N=so(v,_),N!=null&&g.push(fo(v,N,y)))),x)break;v=v.return}0<g.length&&(f=new p(f,m,null,r,h),u.push({event:f,listeners:g}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&r!==_u&&(m=r.relatedTarget||r.fromElement)&&(ii(m)||m[un]))break e;if((p||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=r.relatedTarget||r.toElement,p=c,m=m?ii(m):null,m!==null&&(x=wi(m),m!==x||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(g=Xf,N="onMouseLeave",_="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=Qf,N="onPointerLeave",_="onPointerEnter",v="pointer"),x=p==null?f:Bi(p),y=m==null?f:Bi(m),f=new g(N,v+"leave",p,r,h),f.target=x,f.relatedTarget=y,N=null,ii(h)===c&&(g=new g(_,v+"enter",m,r,h),g.target=y,g.relatedTarget=x,N=g),x=N,p&&m)t:{for(g=p,_=m,v=0,y=g;y;y=Ei(y))v++;for(y=0,N=_;N;N=Ei(N))y++;for(;0<v-y;)g=Ei(g),v--;for(;0<y-v;)_=Ei(_),y--;for(;v--;){if(g===_||_!==null&&g===_.alternate)break t;g=Ei(g),_=Ei(_)}g=null}else g=null;p!==null&&ap(u,f,p,g,!1),m!==null&&x!==null&&ap(u,x,m,g,!0)}}e:{if(f=c?Bi(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var L=mw;else if(ep(f))if(tv)L=yw;else{L=_w;var C=gw}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(L=vw);if(L&&(L=L(e,c))){ev(u,L,r,h);break e}C&&C(e,f,c),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&du(f,"number",f.value)}switch(C=c?Bi(c):window,e){case"focusin":(ep(C)||C.contentEditable==="true")&&(Ii=C,ku=c,qs=null);break;case"focusout":qs=ku=Ii=null;break;case"mousedown":Cu=!0;break;case"contextmenu":case"mouseup":case"dragend":Cu=!1,sp(u,r,h);break;case"selectionchange":if(Sw)break;case"keydown":case"keyup":sp(u,r,h)}var D;if(gd)e:{switch(e){case"compositionstart":var z="onCompositionStart";break e;case"compositionend":z="onCompositionEnd";break e;case"compositionupdate":z="onCompositionUpdate";break e}z=void 0}else Mi?Z_(e,r)&&(z="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(z="onCompositionStart");z&&(Q_&&r.locale!=="ko"&&(Mi||z!=="onCompositionStart"?z==="onCompositionEnd"&&Mi&&(D=G_()):(Nn=h,fd="value"in Nn?Nn.value:Nn.textContent,Mi=!0)),C=Yl(c,z),0<C.length&&(z=new Gf(z,e,null,r,h),u.push({event:z,listeners:C}),D?z.data=D:(D=J_(r),D!==null&&(z.data=D)))),(D=uw?hw(e,r):dw(e,r))&&(c=Yl(c,"onBeforeInput"),0<c.length&&(h=new Gf("onBeforeInput","beforeinput",null,r,h),u.push({event:h,listeners:c}),h.data=D))}hv(u,t)})}function fo(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Yl(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=so(e,r),s!=null&&n.unshift(fo(e,s,i)),s=so(e,t),s!=null&&n.push(fo(e,s,i))),e=e.return}return n}function Ei(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ap(e,t,r,n,i){for(var s=t._reactName,o=[];r!==null&&r!==n;){var l=r,a=l.alternate,c=l.stateNode;if(a!==null&&a===n)break;l.tag===5&&c!==null&&(l=c,i?(a=so(r,s),a!=null&&o.unshift(fo(r,a,l))):i||(a=so(r,s),a!=null&&o.push(fo(r,a,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var Ew=/\r\n?/g,Nw=/\u0000|\uFFFD/g;function cp(e){return(typeof e=="string"?e:""+e).replace(Ew,`
|
|
38
|
+
`).replace(Nw,"")}function el(e,t,r){if(t=cp(t),cp(e)!==t&&r)throw Error(te(425))}function Xl(){}var Eu=null,Nu=null;function Lu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Tu=typeof setTimeout=="function"?setTimeout:void 0,Lw=typeof clearTimeout=="function"?clearTimeout:void 0,up=typeof Promise=="function"?Promise:void 0,Tw=typeof queueMicrotask=="function"?queueMicrotask:typeof up<"u"?function(e){return up.resolve(null).then(e).catch(Pw)}:Tu;function Pw(e){setTimeout(function(){throw e})}function gc(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),ao(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);ao(t)}function In(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function hp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var as=Math.random().toString(36).slice(2),Kr="__reactFiber$"+as,po="__reactProps$"+as,un="__reactContainer$"+as,Pu="__reactEvents$"+as,Dw="__reactListeners$"+as,Rw="__reactHandles$"+as;function ii(e){var t=e[Kr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[un]||r[Kr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=hp(e);e!==null;){if(r=e[Kr])return r;e=hp(e)}return t}e=r,r=e.parentNode}return null}function Do(e){return e=e[Kr]||e[un],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Bi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(te(33))}function La(e){return e[po]||null}var Du=[],ji=-1;function Wn(e){return{current:e}}function He(e){0>ji||(e.current=Du[ji],Du[ji]=null,ji--)}function Oe(e,t){ji++,Du[ji]=e.current,e.current=t}var $n={},Mt=Wn($n),Xt=Wn(!1),di=$n;function Zi(e,t){var r=e.type.contextTypes;if(!r)return $n;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Gt(e){return e=e.childContextTypes,e!=null}function Gl(){He(Xt),He(Mt)}function dp(e,t,r){if(Mt.current!==$n)throw Error(te(168));Oe(Mt,t),Oe(Xt,r)}function fv(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(te(108,gx(e)||"Unknown",i));return Xe({},r,n)}function Ql(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$n,di=Mt.current,Oe(Mt,e),Oe(Xt,Xt.current),!0}function fp(e,t,r){var n=e.stateNode;if(!n)throw Error(te(169));r?(e=fv(e,t,di),n.__reactInternalMemoizedMergedChildContext=e,He(Xt),He(Mt),Oe(Mt,e)):He(Xt),Oe(Xt,r)}var rn=null,Ta=!1,_c=!1;function pv(e){rn===null?rn=[e]:rn.push(e)}function Mw(e){Ta=!0,pv(e)}function Un(){if(!_c&&rn!==null){_c=!0;var e=0,t=Me;try{var r=rn;for(Me=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}rn=null,Ta=!1}catch(i){throw rn!==null&&(rn=rn.slice(e+1)),z_(cd,Un),i}finally{Me=t,_c=!1}}return null}var Oi=[],zi=0,Zl=null,Jl=0,yr=[],xr=0,fi=null,sn=1,on="";function Qn(e,t){Oi[zi++]=Jl,Oi[zi++]=Zl,Zl=e,Jl=t}function mv(e,t,r){yr[xr++]=sn,yr[xr++]=on,yr[xr++]=fi,fi=e;var n=sn;e=on;var i=32-Mr(n)-1;n&=~(1<<i),r+=1;var s=32-Mr(t)+i;if(30<s){var o=i-i%5;s=(n&(1<<o)-1).toString(32),n>>=o,i-=o,sn=1<<32-Mr(t)+i|r<<i|n,on=s+e}else sn=1<<s|r<<i|n,on=e}function vd(e){e.return!==null&&(Qn(e,1),mv(e,1,0))}function yd(e){for(;e===Zl;)Zl=Oi[--zi],Oi[zi]=null,Jl=Oi[--zi],Oi[zi]=null;for(;e===fi;)fi=yr[--xr],yr[xr]=null,on=yr[--xr],yr[xr]=null,sn=yr[--xr],yr[xr]=null}var ar=null,lr=null,We=!1,Dr=null;function gv(e,t){var r=Sr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function pp(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ar=e,lr=In(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ar=e,lr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=fi!==null?{id:sn,overflow:on}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Sr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,ar=e,lr=null,!0):!1;default:return!1}}function Ru(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Mu(e){if(We){var t=lr;if(t){var r=t;if(!pp(e,t)){if(Ru(e))throw Error(te(418));t=In(r.nextSibling);var n=ar;t&&pp(e,t)?gv(n,r):(e.flags=e.flags&-4097|2,We=!1,ar=e)}}else{if(Ru(e))throw Error(te(418));e.flags=e.flags&-4097|2,We=!1,ar=e}}}function mp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ar=e}function tl(e){if(e!==ar)return!1;if(!We)return mp(e),We=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Lu(e.type,e.memoizedProps)),t&&(t=lr)){if(Ru(e))throw _v(),Error(te(418));for(;t;)gv(e,t),t=In(t.nextSibling)}if(mp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(te(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){lr=In(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}lr=null}}else lr=ar?In(e.stateNode.nextSibling):null;return!0}function _v(){for(var e=lr;e;)e=In(e.nextSibling)}function Ji(){lr=ar=null,We=!1}function xd(e){Dr===null?Dr=[e]:Dr.push(e)}var Iw=fn.ReactCurrentBatchConfig;function ws(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(te(309));var n=r.stateNode}if(!n)throw Error(te(147,e));var i=n,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var l=i.refs;o===null?delete l[s]:l[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(te(284));if(!r._owner)throw Error(te(290,e))}return e}function rl(e,t){throw e=Object.prototype.toString.call(t),Error(te(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function gp(e){var t=e._init;return t(e._payload)}function vv(e){function t(_,v){if(e){var y=_.deletions;y===null?(_.deletions=[v],_.flags|=16):y.push(v)}}function r(_,v){if(!e)return null;for(;v!==null;)t(_,v),v=v.sibling;return null}function n(_,v){for(_=new Map;v!==null;)v.key!==null?_.set(v.key,v):_.set(v.index,v),v=v.sibling;return _}function i(_,v){return _=On(_,v),_.index=0,_.sibling=null,_}function s(_,v,y){return _.index=y,e?(y=_.alternate,y!==null?(y=y.index,y<v?(_.flags|=2,v):y):(_.flags|=2,v)):(_.flags|=1048576,v)}function o(_){return e&&_.alternate===null&&(_.flags|=2),_}function l(_,v,y,N){return v===null||v.tag!==6?(v=kc(y,_.mode,N),v.return=_,v):(v=i(v,y),v.return=_,v)}function a(_,v,y,N){var L=y.type;return L===Ri?h(_,v,y.props.children,N,y.key):v!==null&&(v.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Sn&&gp(L)===v.type)?(N=i(v,y.props),N.ref=ws(_,v,y),N.return=_,N):(N=Ll(y.type,y.key,y.props,null,_.mode,N),N.ref=ws(_,v,y),N.return=_,N)}function c(_,v,y,N){return v===null||v.tag!==4||v.stateNode.containerInfo!==y.containerInfo||v.stateNode.implementation!==y.implementation?(v=Cc(y,_.mode,N),v.return=_,v):(v=i(v,y.children||[]),v.return=_,v)}function h(_,v,y,N,L){return v===null||v.tag!==7?(v=ci(y,_.mode,N,L),v.return=_,v):(v=i(v,y),v.return=_,v)}function u(_,v,y){if(typeof v=="string"&&v!==""||typeof v=="number")return v=kc(""+v,_.mode,y),v.return=_,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Vo:return y=Ll(v.type,v.key,v.props,null,_.mode,y),y.ref=ws(_,null,v),y.return=_,y;case Di:return v=Cc(v,_.mode,y),v.return=_,v;case Sn:var N=v._init;return u(_,N(v._payload),y)}if(As(v)||gs(v))return v=ci(v,_.mode,y,null),v.return=_,v;rl(_,v)}return null}function f(_,v,y,N){var L=v!==null?v.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return L!==null?null:l(_,v,""+y,N);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Vo:return y.key===L?a(_,v,y,N):null;case Di:return y.key===L?c(_,v,y,N):null;case Sn:return L=y._init,f(_,v,L(y._payload),N)}if(As(y)||gs(y))return L!==null?null:h(_,v,y,N,null);rl(_,y)}return null}function p(_,v,y,N,L){if(typeof N=="string"&&N!==""||typeof N=="number")return _=_.get(y)||null,l(v,_,""+N,L);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case Vo:return _=_.get(N.key===null?y:N.key)||null,a(v,_,N,L);case Di:return _=_.get(N.key===null?y:N.key)||null,c(v,_,N,L);case Sn:var C=N._init;return p(_,v,y,C(N._payload),L)}if(As(N)||gs(N))return _=_.get(y)||null,h(v,_,N,L,null);rl(v,N)}return null}function m(_,v,y,N){for(var L=null,C=null,D=v,z=v=0,F=null;D!==null&&z<y.length;z++){D.index>z?(F=D,D=null):F=D.sibling;var E=f(_,D,y[z],N);if(E===null){D===null&&(D=F);break}e&&D&&E.alternate===null&&t(_,D),v=s(E,v,z),C===null?L=E:C.sibling=E,C=E,D=F}if(z===y.length)return r(_,D),We&&Qn(_,z),L;if(D===null){for(;z<y.length;z++)D=u(_,y[z],N),D!==null&&(v=s(D,v,z),C===null?L=D:C.sibling=D,C=D);return We&&Qn(_,z),L}for(D=n(_,D);z<y.length;z++)F=p(D,_,z,y[z],N),F!==null&&(e&&F.alternate!==null&&D.delete(F.key===null?z:F.key),v=s(F,v,z),C===null?L=F:C.sibling=F,C=F);return e&&D.forEach(function(H){return t(_,H)}),We&&Qn(_,z),L}function g(_,v,y,N){var L=gs(y);if(typeof L!="function")throw Error(te(150));if(y=L.call(y),y==null)throw Error(te(151));for(var C=L=null,D=v,z=v=0,F=null,E=y.next();D!==null&&!E.done;z++,E=y.next()){D.index>z?(F=D,D=null):F=D.sibling;var H=f(_,D,E.value,N);if(H===null){D===null&&(D=F);break}e&&D&&H.alternate===null&&t(_,D),v=s(H,v,z),C===null?L=H:C.sibling=H,C=H,D=F}if(E.done)return r(_,D),We&&Qn(_,z),L;if(D===null){for(;!E.done;z++,E=y.next())E=u(_,E.value,N),E!==null&&(v=s(E,v,z),C===null?L=E:C.sibling=E,C=E);return We&&Qn(_,z),L}for(D=n(_,D);!E.done;z++,E=y.next())E=p(D,_,z,E.value,N),E!==null&&(e&&E.alternate!==null&&D.delete(E.key===null?z:E.key),v=s(E,v,z),C===null?L=E:C.sibling=E,C=E);return e&&D.forEach(function(B){return t(_,B)}),We&&Qn(_,z),L}function x(_,v,y,N){if(typeof y=="object"&&y!==null&&y.type===Ri&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Vo:e:{for(var L=y.key,C=v;C!==null;){if(C.key===L){if(L=y.type,L===Ri){if(C.tag===7){r(_,C.sibling),v=i(C,y.props.children),v.return=_,_=v;break e}}else if(C.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Sn&&gp(L)===C.type){r(_,C.sibling),v=i(C,y.props),v.ref=ws(_,C,y),v.return=_,_=v;break e}r(_,C);break}else t(_,C);C=C.sibling}y.type===Ri?(v=ci(y.props.children,_.mode,N,y.key),v.return=_,_=v):(N=Ll(y.type,y.key,y.props,null,_.mode,N),N.ref=ws(_,v,y),N.return=_,_=N)}return o(_);case Di:e:{for(C=y.key;v!==null;){if(v.key===C)if(v.tag===4&&v.stateNode.containerInfo===y.containerInfo&&v.stateNode.implementation===y.implementation){r(_,v.sibling),v=i(v,y.children||[]),v.return=_,_=v;break e}else{r(_,v);break}else t(_,v);v=v.sibling}v=Cc(y,_.mode,N),v.return=_,_=v}return o(_);case Sn:return C=y._init,x(_,v,C(y._payload),N)}if(As(y))return m(_,v,y,N);if(gs(y))return g(_,v,y,N);rl(_,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,v!==null&&v.tag===6?(r(_,v.sibling),v=i(v,y),v.return=_,_=v):(r(_,v),v=kc(y,_.mode,N),v.return=_,_=v),o(_)):r(_,v)}return x}var es=vv(!0),yv=vv(!1),ea=Wn(null),ta=null,Fi=null,wd=null;function Sd(){wd=Fi=ta=null}function bd(e){var t=ea.current;He(ea),e._currentValue=t}function Iu(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Yi(e,t){ta=e,wd=Fi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Yt=!0),e.firstContext=null)}function Cr(e){var t=e._currentValue;if(wd!==e)if(e={context:e,memoizedValue:t,next:null},Fi===null){if(ta===null)throw Error(te(308));Fi=e,ta.dependencies={lanes:0,firstContext:e}}else Fi=Fi.next=e;return t}var si=null;function kd(e){si===null?si=[e]:si.push(e)}function xv(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,kd(t)):(r.next=i.next,i.next=r),t.interleaved=r,hn(e,n)}function hn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var bn=!1;function Cd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wv(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function an(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function An(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Re&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,hn(e,r)}return i=n.interleaved,i===null?(t.next=t,kd(n)):(t.next=i.next,i.next=t),n.interleaved=t,hn(e,r)}function Sl(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ud(e,r)}}function _p(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=t:s=s.next=t}else i=s=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function ra(e,t,r,n){var i=e.updateQueue;bn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,c=a.next;a.next=null,o===null?s=c:o.next=c,o=a;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=c:l.next=c,h.lastBaseUpdate=a))}if(s!==null){var u=i.baseState;o=0,h=c=a=null,l=s;do{var f=l.lane,p=l.eventTime;if((n&f)===f){h!==null&&(h=h.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(f=t,p=r,g.tag){case 1:if(m=g.payload,typeof m=="function"){u=m.call(p,u,f);break e}u=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m=="function"?m.call(p,u,f):m,f==null)break e;u=Xe({},u,f);break e;case 2:bn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(c=h=p,a=u):h=h.next=p,o|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(h===null&&(a=u),i.baseState=a,i.firstBaseUpdate=c,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);mi|=o,e.lanes=o,e.memoizedState=u}}function vp(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(te(191,i));i.call(n)}}}var Ro={},Xr=Wn(Ro),mo=Wn(Ro),go=Wn(Ro);function oi(e){if(e===Ro)throw Error(te(174));return e}function Ed(e,t){switch(Oe(go,t),Oe(mo,e),Oe(Xr,Ro),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=pu(t,e)}He(Xr),Oe(Xr,t)}function ts(){He(Xr),He(mo),He(go)}function Sv(e){oi(go.current);var t=oi(Xr.current),r=pu(t,e.type);t!==r&&(Oe(mo,e),Oe(Xr,r))}function Nd(e){mo.current===e&&(He(Xr),He(mo))}var qe=Wn(0);function na(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var vc=[];function Ld(){for(var e=0;e<vc.length;e++)vc[e]._workInProgressVersionPrimary=null;vc.length=0}var bl=fn.ReactCurrentDispatcher,yc=fn.ReactCurrentBatchConfig,pi=0,Ye=null,dt=null,_t=null,ia=!1,Ys=!1,_o=0,Aw=0;function Lt(){throw Error(te(321))}function Td(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Br(e[r],t[r]))return!1;return!0}function Pd(e,t,r,n,i,s){if(pi=s,Ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,bl.current=e===null||e.memoizedState===null?zw:Fw,e=r(n,i),Ys){s=0;do{if(Ys=!1,_o=0,25<=s)throw Error(te(301));s+=1,_t=dt=null,t.updateQueue=null,bl.current=$w,e=r(n,i)}while(Ys)}if(bl.current=sa,t=dt!==null&&dt.next!==null,pi=0,_t=dt=Ye=null,ia=!1,t)throw Error(te(300));return e}function Dd(){var e=_o!==0;return _o=0,e}function Wr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?Ye.memoizedState=_t=e:_t=_t.next=e,_t}function Er(){if(dt===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=_t===null?Ye.memoizedState:_t.next;if(t!==null)_t=t,dt=e;else{if(e===null)throw Error(te(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},_t===null?Ye.memoizedState=_t=e:_t=_t.next=e}return _t}function vo(e,t){return typeof t=="function"?t(e):t}function xc(e){var t=Er(),r=t.queue;if(r===null)throw Error(te(311));r.lastRenderedReducer=e;var n=dt,i=n.baseQueue,s=r.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}n.baseQueue=i=s,r.pending=null}if(i!==null){s=i.next,n=n.baseState;var l=o=null,a=null,c=s;do{var h=c.lane;if((pi&h)===h)a!==null&&(a=a.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var u={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(l=a=u,o=n):a=a.next=u,Ye.lanes|=h,mi|=h}c=c.next}while(c!==null&&c!==s);a===null?o=n:a.next=l,Br(n,t.memoizedState)||(Yt=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=a,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do s=i.lane,Ye.lanes|=s,mi|=s,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function wc(e){var t=Er(),r=t.queue;if(r===null)throw Error(te(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,s=t.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Br(s,t.memoizedState)||(Yt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),r.lastRenderedState=s}return[s,n]}function bv(){}function kv(e,t){var r=Ye,n=Er(),i=t(),s=!Br(n.memoizedState,i);if(s&&(n.memoizedState=i,Yt=!0),n=n.queue,Rd(Nv.bind(null,r,n,e),[e]),n.getSnapshot!==t||s||_t!==null&&_t.memoizedState.tag&1){if(r.flags|=2048,yo(9,Ev.bind(null,r,n,i,t),void 0,null),wt===null)throw Error(te(349));pi&30||Cv(r,t,i)}return i}function Cv(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Ev(e,t,r,n){t.value=r,t.getSnapshot=n,Lv(t)&&Tv(e)}function Nv(e,t,r){return r(function(){Lv(t)&&Tv(e)})}function Lv(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Br(e,r)}catch{return!0}}function Tv(e){var t=hn(e,1);t!==null&&Ir(t,e,1,-1)}function yp(e){var t=Wr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:e},t.queue=e,e=e.dispatch=Ow.bind(null,Ye,e),[t.memoizedState,e]}function yo(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function Pv(){return Er().memoizedState}function kl(e,t,r,n){var i=Wr();Ye.flags|=e,i.memoizedState=yo(1|t,r,void 0,n===void 0?null:n)}function Pa(e,t,r,n){var i=Er();n=n===void 0?null:n;var s=void 0;if(dt!==null){var o=dt.memoizedState;if(s=o.destroy,n!==null&&Td(n,o.deps)){i.memoizedState=yo(t,r,s,n);return}}Ye.flags|=e,i.memoizedState=yo(1|t,r,s,n)}function xp(e,t){return kl(8390656,8,e,t)}function Rd(e,t){return Pa(2048,8,e,t)}function Dv(e,t){return Pa(4,2,e,t)}function Rv(e,t){return Pa(4,4,e,t)}function Mv(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Iv(e,t,r){return r=r!=null?r.concat([e]):null,Pa(4,4,Mv.bind(null,t,e),r)}function Md(){}function Av(e,t){var r=Er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Td(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Bv(e,t){var r=Er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Td(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function jv(e,t,r){return pi&21?(Br(r,t)||(r=H_(),Ye.lanes|=r,mi|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Yt=!0),e.memoizedState=r)}function Bw(e,t){var r=Me;Me=r!==0&&4>r?r:4,e(!0);var n=yc.transition;yc.transition={};try{e(!1),t()}finally{Me=r,yc.transition=n}}function Ov(){return Er().memoizedState}function jw(e,t,r){var n=jn(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},zv(e))Fv(t,r);else if(r=xv(e,t,r,n),r!==null){var i=zt();Ir(r,e,n,i),$v(r,t,n)}}function Ow(e,t,r){var n=jn(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(zv(e))Fv(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,r);if(i.hasEagerState=!0,i.eagerState=l,Br(l,o)){var a=t.interleaved;a===null?(i.next=i,kd(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}r=xv(e,t,i,n),r!==null&&(i=zt(),Ir(r,e,n,i),$v(r,t,n))}}function zv(e){var t=e.alternate;return e===Ye||t!==null&&t===Ye}function Fv(e,t){Ys=ia=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function $v(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ud(e,r)}}var sa={readContext:Cr,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useInsertionEffect:Lt,useLayoutEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useMutableSource:Lt,useSyncExternalStore:Lt,useId:Lt,unstable_isNewReconciler:!1},zw={readContext:Cr,useCallback:function(e,t){return Wr().memoizedState=[e,t===void 0?null:t],e},useContext:Cr,useEffect:xp,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,kl(4194308,4,Mv.bind(null,t,e),r)},useLayoutEffect:function(e,t){return kl(4194308,4,e,t)},useInsertionEffect:function(e,t){return kl(4,2,e,t)},useMemo:function(e,t){var r=Wr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Wr();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=jw.bind(null,Ye,e),[n.memoizedState,e]},useRef:function(e){var t=Wr();return e={current:e},t.memoizedState=e},useState:yp,useDebugValue:Md,useDeferredValue:function(e){return Wr().memoizedState=e},useTransition:function(){var e=yp(!1),t=e[0];return e=Bw.bind(null,e[1]),Wr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ye,i=Wr();if(We){if(r===void 0)throw Error(te(407));r=r()}else{if(r=t(),wt===null)throw Error(te(349));pi&30||Cv(n,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,xp(Nv.bind(null,n,s,e),[e]),n.flags|=2048,yo(9,Ev.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=Wr(),t=wt.identifierPrefix;if(We){var r=on,n=sn;r=(n&~(1<<32-Mr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=_o++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Aw++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Fw={readContext:Cr,useCallback:Av,useContext:Cr,useEffect:Rd,useImperativeHandle:Iv,useInsertionEffect:Dv,useLayoutEffect:Rv,useMemo:Bv,useReducer:xc,useRef:Pv,useState:function(){return xc(vo)},useDebugValue:Md,useDeferredValue:function(e){var t=Er();return jv(t,dt.memoizedState,e)},useTransition:function(){var e=xc(vo)[0],t=Er().memoizedState;return[e,t]},useMutableSource:bv,useSyncExternalStore:kv,useId:Ov,unstable_isNewReconciler:!1},$w={readContext:Cr,useCallback:Av,useContext:Cr,useEffect:Rd,useImperativeHandle:Iv,useInsertionEffect:Dv,useLayoutEffect:Rv,useMemo:Bv,useReducer:wc,useRef:Pv,useState:function(){return wc(vo)},useDebugValue:Md,useDeferredValue:function(e){var t=Er();return dt===null?t.memoizedState=e:jv(t,dt.memoizedState,e)},useTransition:function(){var e=wc(vo)[0],t=Er().memoizedState;return[e,t]},useMutableSource:bv,useSyncExternalStore:kv,useId:Ov,unstable_isNewReconciler:!1};function Tr(e,t){if(e&&e.defaultProps){t=Xe({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Au(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Xe({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Da={isMounted:function(e){return(e=e._reactInternals)?wi(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=zt(),i=jn(e),s=an(n,i);s.payload=t,r!=null&&(s.callback=r),t=An(e,s,i),t!==null&&(Ir(t,e,i,n),Sl(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=zt(),i=jn(e),s=an(n,i);s.tag=1,s.payload=t,r!=null&&(s.callback=r),t=An(e,s,i),t!==null&&(Ir(t,e,i,n),Sl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=zt(),n=jn(e),i=an(r,n);i.tag=2,t!=null&&(i.callback=t),t=An(e,i,n),t!==null&&(Ir(t,e,n,r),Sl(t,e,n))}};function wp(e,t,r,n,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,o):t.prototype&&t.prototype.isPureReactComponent?!uo(r,n)||!uo(i,s):!0}function Hv(e,t,r){var n=!1,i=$n,s=t.contextType;return typeof s=="object"&&s!==null?s=Cr(s):(i=Gt(t)?di:Mt.current,n=t.contextTypes,s=(n=n!=null)?Zi(e,i):$n),t=new t(r,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Da,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Sp(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Da.enqueueReplaceState(t,t.state,null)}function Bu(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},Cd(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Cr(s):(s=Gt(t)?di:Mt.current,i.context=Zi(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Au(e,t,s,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Da.enqueueReplaceState(i,i.state,null),ra(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function rs(e,t){try{var r="",n=t;do r+=mx(n),n=n.return;while(n);var i=r}catch(s){i=`
|
|
39
|
+
Error generating stack: `+s.message+`
|
|
40
|
+
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function Sc(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function ju(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Hw=typeof WeakMap=="function"?WeakMap:Map;function Wv(e,t,r){r=an(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){la||(la=!0,qu=n),ju(e,t)},r}function Uv(e,t,r){r=an(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){ju(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){ju(e,t),typeof n!="function"&&(Bn===null?Bn=new Set([this]):Bn.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function bp(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new Hw;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=rS.bind(null,e,t,r),t.then(e,e))}function kp(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Cp(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=an(-1,1),t.tag=2,An(r,t,1))),r.lanes|=1),e)}var Ww=fn.ReactCurrentOwner,Yt=!1;function jt(e,t,r,n){t.child=e===null?yv(t,null,r,n):es(t,e.child,r,n)}function Ep(e,t,r,n,i){r=r.render;var s=t.ref;return Yi(t,i),n=Pd(e,t,r,n,s,i),r=Dd(),e!==null&&!Yt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,dn(e,t,i)):(We&&r&&vd(t),t.flags|=1,jt(e,t,n,i),t.child)}function Np(e,t,r,n,i){if(e===null){var s=r.type;return typeof s=="function"&&!$d(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=s,Vv(e,t,s,n,i)):(e=Ll(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:uo,r(o,n)&&e.ref===t.ref)return dn(e,t,i)}return t.flags|=1,e=On(s,n),e.ref=t.ref,e.return=t,t.child=e}function Vv(e,t,r,n,i){if(e!==null){var s=e.memoizedProps;if(uo(s,n)&&e.ref===t.ref)if(Yt=!1,t.pendingProps=n=s,(e.lanes&i)!==0)e.flags&131072&&(Yt=!0);else return t.lanes=e.lanes,dn(e,t,i)}return Ou(e,t,r,n,i)}function Kv(e,t,r){var n=t.pendingProps,i=n.children,s=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Oe(Hi,sr),sr|=r;else{if(!(r&1073741824))return e=s!==null?s.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Oe(Hi,sr),sr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,Oe(Hi,sr),sr|=n}else s!==null?(n=s.baseLanes|r,t.memoizedState=null):n=r,Oe(Hi,sr),sr|=n;return jt(e,t,i,r),t.child}function qv(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Ou(e,t,r,n,i){var s=Gt(r)?di:Mt.current;return s=Zi(t,s),Yi(t,i),r=Pd(e,t,r,n,s,i),n=Dd(),e!==null&&!Yt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,dn(e,t,i)):(We&&n&&vd(t),t.flags|=1,jt(e,t,r,i),t.child)}function Lp(e,t,r,n,i){if(Gt(r)){var s=!0;Ql(t)}else s=!1;if(Yi(t,i),t.stateNode===null)Cl(e,t),Hv(t,r,n),Bu(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var a=o.context,c=r.contextType;typeof c=="object"&&c!==null?c=Cr(c):(c=Gt(r)?di:Mt.current,c=Zi(t,c));var h=r.getDerivedStateFromProps,u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||a!==c)&&Sp(t,o,n,c),bn=!1;var f=t.memoizedState;o.state=f,ra(t,n,o,i),a=t.memoizedState,l!==n||f!==a||Xt.current||bn?(typeof h=="function"&&(Au(t,r,h,n),a=t.memoizedState),(l=bn||wp(t,r,l,n,f,a,c))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=a),o.props=n,o.state=a,o.context=c,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,wv(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Tr(t.type,l),o.props=c,u=t.pendingProps,f=o.context,a=r.contextType,typeof a=="object"&&a!==null?a=Cr(a):(a=Gt(r)?di:Mt.current,a=Zi(t,a));var p=r.getDerivedStateFromProps;(h=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==u||f!==a)&&Sp(t,o,n,a),bn=!1,f=t.memoizedState,o.state=f,ra(t,n,o,i);var m=t.memoizedState;l!==u||f!==m||Xt.current||bn?(typeof p=="function"&&(Au(t,r,p,n),m=t.memoizedState),(c=bn||wp(t,r,c,n,f,m,a)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,m,a),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,m,a)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=m),o.props=n,o.state=m,o.context=a,n=c):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return zu(e,t,r,n,s,i)}function zu(e,t,r,n,i,s){qv(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&fp(t,r,!1),dn(e,t,s);n=t.stateNode,Ww.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=es(t,e.child,null,s),t.child=es(t,null,l,s)):jt(e,t,l,s),t.memoizedState=n.state,i&&fp(t,r,!0),t.child}function Yv(e){var t=e.stateNode;t.pendingContext?dp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&dp(e,t.context,!1),Ed(e,t.containerInfo)}function Tp(e,t,r,n,i){return Ji(),xd(i),t.flags|=256,jt(e,t,r,n),t.child}var Fu={dehydrated:null,treeContext:null,retryLane:0};function $u(e){return{baseLanes:e,cachePool:null,transitions:null}}function Xv(e,t,r){var n=t.pendingProps,i=qe.current,s=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Oe(qe,i&1),e===null)return Mu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,s?(n=t.mode,s=t.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Ia(o,n,0,null),e=ci(e,n,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=$u(r),t.memoizedState=Fu,e):Id(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return Uw(e,t,o,n,l,i,r);if(s){s=n.fallback,o=t.mode,i=e.child,l=i.sibling;var a={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=a,t.deletions=null):(n=On(i,a),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=On(l,s):(s=ci(s,o,r,null),s.flags|=2),s.return=t,n.return=t,n.sibling=s,t.child=n,n=s,s=t.child,o=e.child.memoizedState,o=o===null?$u(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~r,t.memoizedState=Fu,n}return s=e.child,e=s.sibling,n=On(s,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Id(e,t){return t=Ia({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nl(e,t,r,n){return n!==null&&xd(n),es(t,e.child,null,r),e=Id(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Uw(e,t,r,n,i,s,o){if(r)return t.flags&256?(t.flags&=-257,n=Sc(Error(te(422))),nl(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=n.fallback,i=t.mode,n=Ia({mode:"visible",children:n.children},i,0,null),s=ci(s,i,o,null),s.flags|=2,n.return=t,s.return=t,n.sibling=s,t.child=n,t.mode&1&&es(t,e.child,null,o),t.child.memoizedState=$u(o),t.memoizedState=Fu,s);if(!(t.mode&1))return nl(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,s=Error(te(419)),n=Sc(s,n,void 0),nl(e,t,o,n)}if(l=(o&e.childLanes)!==0,Yt||l){if(n=wt,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,hn(e,i),Ir(n,e,i,-1))}return Fd(),n=Sc(Error(te(421))),nl(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=nS.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,lr=In(i.nextSibling),ar=t,We=!0,Dr=null,e!==null&&(yr[xr++]=sn,yr[xr++]=on,yr[xr++]=fi,sn=e.id,on=e.overflow,fi=t),t=Id(t,n.children),t.flags|=4096,t)}function Pp(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Iu(e.return,t,r)}function bc(e,t,r,n,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function Gv(e,t,r){var n=t.pendingProps,i=n.revealOrder,s=n.tail;if(jt(e,t,n.children,r),n=qe.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pp(e,r,t);else if(e.tag===19)Pp(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Oe(qe,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&na(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),bc(t,!1,i,r,s);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&na(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}bc(t,!0,r,null,s);break;case"together":bc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Cl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function dn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),mi|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(te(153));if(t.child!==null){for(e=t.child,r=On(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=On(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Vw(e,t,r){switch(t.tag){case 3:Yv(t),Ji();break;case 5:Sv(t);break;case 1:Gt(t.type)&&Ql(t);break;case 4:Ed(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Oe(ea,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Oe(qe,qe.current&1),t.flags|=128,null):r&t.child.childLanes?Xv(e,t,r):(Oe(qe,qe.current&1),e=dn(e,t,r),e!==null?e.sibling:null);Oe(qe,qe.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Gv(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Oe(qe,qe.current),n)break;return null;case 22:case 23:return t.lanes=0,Kv(e,t,r)}return dn(e,t,r)}var Qv,Hu,Zv,Jv;Qv=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Hu=function(){};Zv=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,oi(Xr.current);var s=null;switch(r){case"input":i=uu(e,i),n=uu(e,n),s=[];break;case"select":i=Xe({},i,{value:void 0}),n=Xe({},n,{value:void 0}),s=[];break;case"textarea":i=fu(e,i),n=fu(e,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Xl)}mu(r,n);var o;r=null;for(c in i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var l=i[c];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(no.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in n){var a=n[c];if(l=i!=null?i[c]:void 0,n.hasOwnProperty(c)&&a!==l&&(a!=null||l!=null))if(c==="style")if(l){for(o in l)!l.hasOwnProperty(o)||a&&a.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in a)a.hasOwnProperty(o)&&l[o]!==a[o]&&(r||(r={}),r[o]=a[o])}else r||(s||(s=[]),s.push(c,r)),r=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(s=s||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(s=s||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(no.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&Fe("scroll",e),s||l===a||(s=[])):(s=s||[]).push(c,a))}r&&(s=s||[]).push("style",r);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};Jv=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ss(e,t){if(!We)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Kw(e,t,r){var n=t.pendingProps;switch(yd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(t),null;case 1:return Gt(t.type)&&Gl(),Tt(t),null;case 3:return n=t.stateNode,ts(),He(Xt),He(Mt),Ld(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(tl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dr!==null&&(Gu(Dr),Dr=null))),Hu(e,t),Tt(t),null;case 5:Nd(t);var i=oi(go.current);if(r=t.type,e!==null&&t.stateNode!=null)Zv(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(te(166));return Tt(t),null}if(e=oi(Xr.current),tl(t)){n=t.stateNode,r=t.type;var s=t.memoizedProps;switch(n[Kr]=t,n[po]=s,e=(t.mode&1)!==0,r){case"dialog":Fe("cancel",n),Fe("close",n);break;case"iframe":case"object":case"embed":Fe("load",n);break;case"video":case"audio":for(i=0;i<js.length;i++)Fe(js[i],n);break;case"source":Fe("error",n);break;case"img":case"image":case"link":Fe("error",n),Fe("load",n);break;case"details":Fe("toggle",n);break;case"input":zf(n,s),Fe("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},Fe("invalid",n);break;case"textarea":$f(n,s),Fe("invalid",n)}mu(r,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?n.textContent!==l&&(s.suppressHydrationWarning!==!0&&el(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&el(n.textContent,l,e),i=["children",""+l]):no.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Fe("scroll",n)}switch(r){case"input":Ko(n),Ff(n,s,!0);break;case"textarea":Ko(n),Hf(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=Xl)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=N_(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Kr]=t,e[po]=n,Qv(e,t,!1,!1),t.stateNode=e;e:{switch(o=gu(r,n),r){case"dialog":Fe("cancel",e),Fe("close",e),i=n;break;case"iframe":case"object":case"embed":Fe("load",e),i=n;break;case"video":case"audio":for(i=0;i<js.length;i++)Fe(js[i],e);i=n;break;case"source":Fe("error",e),i=n;break;case"img":case"image":case"link":Fe("error",e),Fe("load",e),i=n;break;case"details":Fe("toggle",e),i=n;break;case"input":zf(e,n),i=uu(e,n),Fe("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=Xe({},n,{value:void 0}),Fe("invalid",e);break;case"textarea":$f(e,n),i=fu(e,n),Fe("invalid",e);break;default:i=n}mu(r,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var a=l[s];s==="style"?P_(e,a):s==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&L_(e,a)):s==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&io(e,a):typeof a=="number"&&io(e,""+a):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(no.hasOwnProperty(s)?a!=null&&s==="onScroll"&&Fe("scroll",e):a!=null&&id(e,s,a,o))}switch(r){case"input":Ko(e),Ff(e,n,!1);break;case"textarea":Ko(e),Hf(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Fn(n.value));break;case"select":e.multiple=!!n.multiple,s=n.value,s!=null?Ui(e,!!n.multiple,s,!1):n.defaultValue!=null&&Ui(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Xl)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Tt(t),null;case 6:if(e&&t.stateNode!=null)Jv(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(te(166));if(r=oi(go.current),oi(Xr.current),tl(t)){if(n=t.stateNode,r=t.memoizedProps,n[Kr]=t,(s=n.nodeValue!==r)&&(e=ar,e!==null))switch(e.tag){case 3:el(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&el(n.nodeValue,r,(e.mode&1)!==0)}s&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Kr]=t,t.stateNode=n}return Tt(t),null;case 13:if(He(qe),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(We&&lr!==null&&t.mode&1&&!(t.flags&128))_v(),Ji(),t.flags|=98560,s=!1;else if(s=tl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(te(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(te(317));s[Kr]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Tt(t),s=!1}else Dr!==null&&(Gu(Dr),Dr=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||qe.current&1?ft===0&&(ft=3):Fd())),t.updateQueue!==null&&(t.flags|=4),Tt(t),null);case 4:return ts(),Hu(e,t),e===null&&ho(t.stateNode.containerInfo),Tt(t),null;case 10:return bd(t.type._context),Tt(t),null;case 17:return Gt(t.type)&&Gl(),Tt(t),null;case 19:if(He(qe),s=t.memoizedState,s===null)return Tt(t),null;if(n=(t.flags&128)!==0,o=s.rendering,o===null)if(n)Ss(s,!1);else{if(ft!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=na(e),o!==null){for(t.flags|=128,Ss(s,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)s=r,e=n,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Oe(qe,qe.current&1|2),t.child}e=e.sibling}s.tail!==null&&it()>ns&&(t.flags|=128,n=!0,Ss(s,!1),t.lanes=4194304)}else{if(!n)if(e=na(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ss(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!We)return Tt(t),null}else 2*it()-s.renderingStartTime>ns&&r!==1073741824&&(t.flags|=128,n=!0,Ss(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(r=s.last,r!==null?r.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=it(),t.sibling=null,r=qe.current,Oe(qe,n?r&1|2:r&1),t):(Tt(t),null);case 22:case 23:return zd(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?sr&1073741824&&(Tt(t),t.subtreeFlags&6&&(t.flags|=8192)):Tt(t),null;case 24:return null;case 25:return null}throw Error(te(156,t.tag))}function qw(e,t){switch(yd(t),t.tag){case 1:return Gt(t.type)&&Gl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ts(),He(Xt),He(Mt),Ld(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Nd(t),null;case 13:if(He(qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return He(qe),null;case 4:return ts(),null;case 10:return bd(t.type._context),null;case 22:case 23:return zd(),null;case 24:return null;default:return null}}var il=!1,Dt=!1,Yw=typeof WeakSet=="function"?WeakSet:Set,de=null;function $i(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){et(e,t,n)}else r.current=null}function Wu(e,t,r){try{r()}catch(n){et(e,t,n)}}var Dp=!1;function Xw(e,t){if(Eu=Kl,e=iv(),_d(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,l=-1,a=-1,c=0,h=0,u=e,f=null;t:for(;;){for(var p;u!==r||i!==0&&u.nodeType!==3||(l=o+i),u!==s||n!==0&&u.nodeType!==3||(a=o+n),u.nodeType===3&&(o+=u.nodeValue.length),(p=u.firstChild)!==null;)f=u,u=p;for(;;){if(u===e)break t;if(f===r&&++c===i&&(l=o),f===s&&++h===n&&(a=o),(p=u.nextSibling)!==null)break;u=f,f=u.parentNode}u=p}r=l===-1||a===-1?null:{start:l,end:a}}else r=null}r=r||{start:0,end:0}}else r=null;for(Nu={focusedElem:e,selectionRange:r},Kl=!1,de=t;de!==null;)if(t=de,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,de=e;else for(;de!==null;){t=de;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,x=m.memoizedState,_=t.stateNode,v=_.getSnapshotBeforeUpdate(t.elementType===t.type?g:Tr(t.type,g),x);_.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(te(163))}}catch(N){et(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,de=e;break}de=t.return}return m=Dp,Dp=!1,m}function Xs(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Wu(t,r,s)}i=i.next}while(i!==n)}}function Ra(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Uu(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function e0(e){var t=e.alternate;t!==null&&(e.alternate=null,e0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Kr],delete t[po],delete t[Pu],delete t[Dw],delete t[Rw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function t0(e){return e.tag===5||e.tag===3||e.tag===4}function Rp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||t0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vu(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Xl));else if(n!==4&&(e=e.child,e!==null))for(Vu(e,t,r),e=e.sibling;e!==null;)Vu(e,t,r),e=e.sibling}function Ku(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Ku(e,t,r),e=e.sibling;e!==null;)Ku(e,t,r),e=e.sibling}var bt=null,Pr=!1;function _n(e,t,r){for(r=r.child;r!==null;)r0(e,t,r),r=r.sibling}function r0(e,t,r){if(Yr&&typeof Yr.onCommitFiberUnmount=="function")try{Yr.onCommitFiberUnmount(ka,r)}catch{}switch(r.tag){case 5:Dt||$i(r,t);case 6:var n=bt,i=Pr;bt=null,_n(e,t,r),bt=n,Pr=i,bt!==null&&(Pr?(e=bt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):bt.removeChild(r.stateNode));break;case 18:bt!==null&&(Pr?(e=bt,r=r.stateNode,e.nodeType===8?gc(e.parentNode,r):e.nodeType===1&&gc(e,r),ao(e)):gc(bt,r.stateNode));break;case 4:n=bt,i=Pr,bt=r.stateNode.containerInfo,Pr=!0,_n(e,t,r),bt=n,Pr=i;break;case 0:case 11:case 14:case 15:if(!Dt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Wu(r,t,o),i=i.next}while(i!==n)}_n(e,t,r);break;case 1:if(!Dt&&($i(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){et(r,t,l)}_n(e,t,r);break;case 21:_n(e,t,r);break;case 22:r.mode&1?(Dt=(n=Dt)||r.memoizedState!==null,_n(e,t,r),Dt=n):_n(e,t,r);break;default:_n(e,t,r)}}function Mp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Yw),t.forEach(function(n){var i=iS.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Nr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var s=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:bt=l.stateNode,Pr=!1;break e;case 3:bt=l.stateNode.containerInfo,Pr=!0;break e;case 4:bt=l.stateNode.containerInfo,Pr=!0;break e}l=l.return}if(bt===null)throw Error(te(160));r0(s,o,i),bt=null,Pr=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(c){et(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)n0(t,e),t=t.sibling}function n0(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nr(t,e),zr(e),n&4){try{Xs(3,e,e.return),Ra(3,e)}catch(g){et(e,e.return,g)}try{Xs(5,e,e.return)}catch(g){et(e,e.return,g)}}break;case 1:Nr(t,e),zr(e),n&512&&r!==null&&$i(r,r.return);break;case 5:if(Nr(t,e),zr(e),n&512&&r!==null&&$i(r,r.return),e.flags&32){var i=e.stateNode;try{io(i,"")}catch(g){et(e,e.return,g)}}if(n&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=r!==null?r.memoizedProps:s,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&C_(i,s),gu(l,o);var c=gu(l,s);for(o=0;o<a.length;o+=2){var h=a[o],u=a[o+1];h==="style"?P_(i,u):h==="dangerouslySetInnerHTML"?L_(i,u):h==="children"?io(i,u):id(i,h,u,c)}switch(l){case"input":hu(i,s);break;case"textarea":E_(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Ui(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?Ui(i,!!s.multiple,s.defaultValue,!0):Ui(i,!!s.multiple,s.multiple?[]:"",!1))}i[po]=s}catch(g){et(e,e.return,g)}}break;case 6:if(Nr(t,e),zr(e),n&4){if(e.stateNode===null)throw Error(te(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(g){et(e,e.return,g)}}break;case 3:if(Nr(t,e),zr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ao(t.containerInfo)}catch(g){et(e,e.return,g)}break;case 4:Nr(t,e),zr(e);break;case 13:Nr(t,e),zr(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(jd=it())),n&4&&Mp(e);break;case 22:if(h=r!==null&&r.memoizedState!==null,e.mode&1?(Dt=(c=Dt)||h,Nr(t,e),Dt=c):Nr(t,e),zr(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!h&&e.mode&1)for(de=e,h=e.child;h!==null;){for(u=de=h;de!==null;){switch(f=de,p=f.child,f.tag){case 0:case 11:case 14:case 15:Xs(4,f,f.return);break;case 1:$i(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){n=f,r=f.return;try{t=n,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){et(n,r,g)}}break;case 5:$i(f,f.return);break;case 22:if(f.memoizedState!==null){Ap(u);continue}}p!==null?(p.return=f,de=p):Ap(u)}h=h.sibling}e:for(h=null,u=e;;){if(u.tag===5){if(h===null){h=u;try{i=u.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=u.stateNode,a=u.memoizedProps.style,o=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=T_("display",o))}catch(g){et(e,e.return,g)}}}else if(u.tag===6){if(h===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(g){et(e,e.return,g)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:Nr(t,e),zr(e),n&4&&Mp(e);break;case 21:break;default:Nr(t,e),zr(e)}}function zr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(t0(r)){var n=r;break e}r=r.return}throw Error(te(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(io(i,""),n.flags&=-33);var s=Rp(e);Ku(e,s,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=Rp(e);Vu(e,l,o);break;default:throw Error(te(161))}}catch(a){et(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gw(e,t,r){de=e,i0(e)}function i0(e,t,r){for(var n=(e.mode&1)!==0;de!==null;){var i=de,s=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||il;if(!o){var l=i.alternate,a=l!==null&&l.memoizedState!==null||Dt;l=il;var c=Dt;if(il=o,(Dt=a)&&!c)for(de=i;de!==null;)o=de,a=o.child,o.tag===22&&o.memoizedState!==null?Bp(i):a!==null?(a.return=o,de=a):Bp(i);for(;s!==null;)de=s,i0(s),s=s.sibling;de=i,il=l,Dt=c}Ip(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,de=s):Ip(e)}}function Ip(e){for(;de!==null;){var t=de;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Dt||Ra(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Dt)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:Tr(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&vp(t,s,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}vp(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break;case"img":a.src&&(r.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var h=c.memoizedState;if(h!==null){var u=h.dehydrated;u!==null&&ao(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(te(163))}Dt||t.flags&512&&Uu(t)}catch(f){et(t,t.return,f)}}if(t===e){de=null;break}if(r=t.sibling,r!==null){r.return=t.return,de=r;break}de=t.return}}function Ap(e){for(;de!==null;){var t=de;if(t===e){de=null;break}var r=t.sibling;if(r!==null){r.return=t.return,de=r;break}de=t.return}}function Bp(e){for(;de!==null;){var t=de;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Ra(4,t)}catch(a){et(t,r,a)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(a){et(t,i,a)}}var s=t.return;try{Uu(t)}catch(a){et(t,s,a)}break;case 5:var o=t.return;try{Uu(t)}catch(a){et(t,o,a)}}}catch(a){et(t,t.return,a)}if(t===e){de=null;break}var l=t.sibling;if(l!==null){l.return=t.return,de=l;break}de=t.return}}var Qw=Math.ceil,oa=fn.ReactCurrentDispatcher,Ad=fn.ReactCurrentOwner,br=fn.ReactCurrentBatchConfig,Re=0,wt=null,at=null,Et=0,sr=0,Hi=Wn(0),ft=0,xo=null,mi=0,Ma=0,Bd=0,Gs=null,qt=null,jd=0,ns=1/0,tn=null,la=!1,qu=null,Bn=null,sl=!1,Ln=null,aa=0,Qs=0,Yu=null,El=-1,Nl=0;function zt(){return Re&6?it():El!==-1?El:El=it()}function jn(e){return e.mode&1?Re&2&&Et!==0?Et&-Et:Iw.transition!==null?(Nl===0&&(Nl=H_()),Nl):(e=Me,e!==0||(e=window.event,e=e===void 0?16:X_(e.type)),e):1}function Ir(e,t,r,n){if(50<Qs)throw Qs=0,Yu=null,Error(te(185));To(e,r,n),(!(Re&2)||e!==wt)&&(e===wt&&(!(Re&2)&&(Ma|=r),ft===4&&En(e,Et)),Qt(e,n),r===1&&Re===0&&!(t.mode&1)&&(ns=it()+500,Ta&&Un()))}function Qt(e,t){var r=e.callbackNode;Ix(e,t);var n=Vl(e,e===wt?Et:0);if(n===0)r!==null&&Vf(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Vf(r),t===1)e.tag===0?Mw(jp.bind(null,e)):pv(jp.bind(null,e)),Tw(function(){!(Re&6)&&Un()}),r=null;else{switch(W_(n)){case 1:r=cd;break;case 4:r=F_;break;case 16:r=Ul;break;case 536870912:r=$_;break;default:r=Ul}r=d0(r,s0.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function s0(e,t){if(El=-1,Nl=0,Re&6)throw Error(te(327));var r=e.callbackNode;if(Xi()&&e.callbackNode!==r)return null;var n=Vl(e,e===wt?Et:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=ca(e,n);else{t=n;var i=Re;Re|=2;var s=l0();(wt!==e||Et!==t)&&(tn=null,ns=it()+500,ai(e,t));do try{eS();break}catch(l){o0(e,l)}while(!0);Sd(),oa.current=s,Re=i,at!==null?t=0:(wt=null,Et=0,t=ft)}if(t!==0){if(t===2&&(i=wu(e),i!==0&&(n=i,t=Xu(e,i))),t===1)throw r=xo,ai(e,0),En(e,n),Qt(e,it()),r;if(t===6)En(e,n);else{if(i=e.current.alternate,!(n&30)&&!Zw(i)&&(t=ca(e,n),t===2&&(s=wu(e),s!==0&&(n=s,t=Xu(e,s))),t===1))throw r=xo,ai(e,0),En(e,n),Qt(e,it()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(te(345));case 2:Zn(e,qt,tn);break;case 3:if(En(e,n),(n&130023424)===n&&(t=jd+500-it(),10<t)){if(Vl(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){zt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Tu(Zn.bind(null,e,qt,tn),t);break}Zn(e,qt,tn);break;case 4:if(En(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-Mr(n);s=1<<o,o=t[o],o>i&&(i=o),n&=~s}if(n=i,n=it()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Qw(n/1960))-n,10<n){e.timeoutHandle=Tu(Zn.bind(null,e,qt,tn),n);break}Zn(e,qt,tn);break;case 5:Zn(e,qt,tn);break;default:throw Error(te(329))}}}return Qt(e,it()),e.callbackNode===r?s0.bind(null,e):null}function Xu(e,t){var r=Gs;return e.current.memoizedState.isDehydrated&&(ai(e,t).flags|=256),e=ca(e,t),e!==2&&(t=qt,qt=r,t!==null&&Gu(t)),e}function Gu(e){qt===null?qt=e:qt.push.apply(qt,e)}function Zw(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],s=i.getSnapshot;i=i.value;try{if(!Br(s(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 En(e,t){for(t&=~Bd,t&=~Ma,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Mr(t),n=1<<r;e[r]=-1,t&=~n}}function jp(e){if(Re&6)throw Error(te(327));Xi();var t=Vl(e,0);if(!(t&1))return Qt(e,it()),null;var r=ca(e,t);if(e.tag!==0&&r===2){var n=wu(e);n!==0&&(t=n,r=Xu(e,n))}if(r===1)throw r=xo,ai(e,0),En(e,t),Qt(e,it()),r;if(r===6)throw Error(te(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Zn(e,qt,tn),Qt(e,it()),null}function Od(e,t){var r=Re;Re|=1;try{return e(t)}finally{Re=r,Re===0&&(ns=it()+500,Ta&&Un())}}function gi(e){Ln!==null&&Ln.tag===0&&!(Re&6)&&Xi();var t=Re;Re|=1;var r=br.transition,n=Me;try{if(br.transition=null,Me=1,e)return e()}finally{Me=n,br.transition=r,Re=t,!(Re&6)&&Un()}}function zd(){sr=Hi.current,He(Hi)}function ai(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Lw(r)),at!==null)for(r=at.return;r!==null;){var n=r;switch(yd(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Gl();break;case 3:ts(),He(Xt),He(Mt),Ld();break;case 5:Nd(n);break;case 4:ts();break;case 13:He(qe);break;case 19:He(qe);break;case 10:bd(n.type._context);break;case 22:case 23:zd()}r=r.return}if(wt=e,at=e=On(e.current,null),Et=sr=t,ft=0,xo=null,Bd=Ma=mi=0,qt=Gs=null,si!==null){for(t=0;t<si.length;t++)if(r=si[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,s=r.pending;if(s!==null){var o=s.next;s.next=i,n.next=o}r.pending=n}si=null}return e}function o0(e,t){do{var r=at;try{if(Sd(),bl.current=sa,ia){for(var n=Ye.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}ia=!1}if(pi=0,_t=dt=Ye=null,Ys=!1,_o=0,Ad.current=null,r===null||r.return===null){ft=1,xo=t,at=null;break}e:{var s=e,o=r.return,l=r,a=t;if(t=Et,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,h=l,u=h.tag;if(!(h.mode&1)&&(u===0||u===11||u===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=kp(o);if(p!==null){p.flags&=-257,Cp(p,o,l,s,t),p.mode&1&&bp(s,c,t),t=p,a=c;var m=t.updateQueue;if(m===null){var g=new Set;g.add(a),t.updateQueue=g}else m.add(a);break e}else{if(!(t&1)){bp(s,c,t),Fd();break e}a=Error(te(426))}}else if(We&&l.mode&1){var x=kp(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),Cp(x,o,l,s,t),xd(rs(a,l));break e}}s=a=rs(a,l),ft!==4&&(ft=2),Gs===null?Gs=[s]:Gs.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var _=Wv(s,a,t);_p(s,_);break e;case 1:l=a;var v=s.type,y=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Bn===null||!Bn.has(y)))){s.flags|=65536,t&=-t,s.lanes|=t;var N=Uv(s,l,t);_p(s,N);break e}}s=s.return}while(s!==null)}c0(r)}catch(L){t=L,at===r&&r!==null&&(at=r=r.return);continue}break}while(!0)}function l0(){var e=oa.current;return oa.current=sa,e===null?sa:e}function Fd(){(ft===0||ft===3||ft===2)&&(ft=4),wt===null||!(mi&268435455)&&!(Ma&268435455)||En(wt,Et)}function ca(e,t){var r=Re;Re|=2;var n=l0();(wt!==e||Et!==t)&&(tn=null,ai(e,t));do try{Jw();break}catch(i){o0(e,i)}while(!0);if(Sd(),Re=r,oa.current=n,at!==null)throw Error(te(261));return wt=null,Et=0,ft}function Jw(){for(;at!==null;)a0(at)}function eS(){for(;at!==null&&!Cx();)a0(at)}function a0(e){var t=h0(e.alternate,e,sr);e.memoizedProps=e.pendingProps,t===null?c0(e):at=t,Ad.current=null}function c0(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=qw(r,t),r!==null){r.flags&=32767,at=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ft=6,at=null;return}}else if(r=Kw(r,t,sr),r!==null){at=r;return}if(t=t.sibling,t!==null){at=t;return}at=t=e}while(t!==null);ft===0&&(ft=5)}function Zn(e,t,r){var n=Me,i=br.transition;try{br.transition=null,Me=1,tS(e,t,r,n)}finally{br.transition=i,Me=n}return null}function tS(e,t,r,n){do Xi();while(Ln!==null);if(Re&6)throw Error(te(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(te(177));e.callbackNode=null,e.callbackPriority=0;var s=r.lanes|r.childLanes;if(Ax(e,s),e===wt&&(at=wt=null,Et=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||sl||(sl=!0,d0(Ul,function(){return Xi(),null})),s=(r.flags&15990)!==0,r.subtreeFlags&15990||s){s=br.transition,br.transition=null;var o=Me;Me=1;var l=Re;Re|=4,Ad.current=null,Xw(e,r),n0(r,e),ww(Nu),Kl=!!Eu,Nu=Eu=null,e.current=r,Gw(r),Ex(),Re=l,Me=o,br.transition=s}else e.current=r;if(sl&&(sl=!1,Ln=e,aa=i),s=e.pendingLanes,s===0&&(Bn=null),Tx(r.stateNode),Qt(e,it()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(la)throw la=!1,e=qu,qu=null,e;return aa&1&&e.tag!==0&&Xi(),s=e.pendingLanes,s&1?e===Yu?Qs++:(Qs=0,Yu=e):Qs=0,Un(),null}function Xi(){if(Ln!==null){var e=W_(aa),t=br.transition,r=Me;try{if(br.transition=null,Me=16>e?16:e,Ln===null)var n=!1;else{if(e=Ln,Ln=null,aa=0,Re&6)throw Error(te(331));var i=Re;for(Re|=4,de=e.current;de!==null;){var s=de,o=s.child;if(de.flags&16){var l=s.deletions;if(l!==null){for(var a=0;a<l.length;a++){var c=l[a];for(de=c;de!==null;){var h=de;switch(h.tag){case 0:case 11:case 15:Xs(8,h,s)}var u=h.child;if(u!==null)u.return=h,de=u;else for(;de!==null;){h=de;var f=h.sibling,p=h.return;if(e0(h),h===c){de=null;break}if(f!==null){f.return=p,de=f;break}de=p}}}var m=s.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}de=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,de=o;else e:for(;de!==null;){if(s=de,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Xs(9,s,s.return)}var _=s.sibling;if(_!==null){_.return=s.return,de=_;break e}de=s.return}}var v=e.current;for(de=v;de!==null;){o=de;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,de=y;else e:for(o=v;de!==null;){if(l=de,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ra(9,l)}}catch(L){et(l,l.return,L)}if(l===o){de=null;break e}var N=l.sibling;if(N!==null){N.return=l.return,de=N;break e}de=l.return}}if(Re=i,Un(),Yr&&typeof Yr.onPostCommitFiberRoot=="function")try{Yr.onPostCommitFiberRoot(ka,e)}catch{}n=!0}return n}finally{Me=r,br.transition=t}}return!1}function Op(e,t,r){t=rs(r,t),t=Wv(e,t,1),e=An(e,t,1),t=zt(),e!==null&&(To(e,1,t),Qt(e,t))}function et(e,t,r){if(e.tag===3)Op(e,e,r);else for(;t!==null;){if(t.tag===3){Op(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Bn===null||!Bn.has(n))){e=rs(r,e),e=Uv(t,e,1),t=An(t,e,1),e=zt(),t!==null&&(To(t,1,e),Qt(t,e));break}}t=t.return}}function rS(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=zt(),e.pingedLanes|=e.suspendedLanes&r,wt===e&&(Et&r)===r&&(ft===4||ft===3&&(Et&130023424)===Et&&500>it()-jd?ai(e,0):Bd|=r),Qt(e,t)}function u0(e,t){t===0&&(e.mode&1?(t=Xo,Xo<<=1,!(Xo&130023424)&&(Xo=4194304)):t=1);var r=zt();e=hn(e,t),e!==null&&(To(e,t,r),Qt(e,r))}function nS(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),u0(e,r)}function iS(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(te(314))}n!==null&&n.delete(t),u0(e,r)}var h0;h0=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xt.current)Yt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Yt=!1,Vw(e,t,r);Yt=!!(e.flags&131072)}else Yt=!1,We&&t.flags&1048576&&mv(t,Jl,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Cl(e,t),e=t.pendingProps;var i=Zi(t,Mt.current);Yi(t,r),i=Pd(null,t,n,e,i,r);var s=Dd();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Gt(n)?(s=!0,Ql(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Cd(t),i.updater=Da,t.stateNode=i,i._reactInternals=t,Bu(t,n,e,r),t=zu(null,t,n,!0,s,r)):(t.tag=0,We&&s&&vd(t),jt(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Cl(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=oS(n),e=Tr(n,e),i){case 0:t=Ou(null,t,n,e,r);break e;case 1:t=Lp(null,t,n,e,r);break e;case 11:t=Ep(null,t,n,e,r);break e;case 14:t=Np(null,t,n,Tr(n.type,e),r);break e}throw Error(te(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Tr(n,i),Ou(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Tr(n,i),Lp(e,t,n,i,r);case 3:e:{if(Yv(t),e===null)throw Error(te(387));n=t.pendingProps,s=t.memoizedState,i=s.element,wv(e,t),ra(t,n,null,r);var o=t.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=rs(Error(te(423)),t),t=Tp(e,t,n,r,i);break e}else if(n!==i){i=rs(Error(te(424)),t),t=Tp(e,t,n,r,i);break e}else for(lr=In(t.stateNode.containerInfo.firstChild),ar=t,We=!0,Dr=null,r=yv(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ji(),n===i){t=dn(e,t,r);break e}jt(e,t,n,r)}t=t.child}return t;case 5:return Sv(t),e===null&&Mu(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Lu(n,i)?o=null:s!==null&&Lu(n,s)&&(t.flags|=32),qv(e,t),jt(e,t,o,r),t.child;case 6:return e===null&&Mu(t),null;case 13:return Xv(e,t,r);case 4:return Ed(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=es(t,null,n,r):jt(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Tr(n,i),Ep(e,t,n,i,r);case 7:return jt(e,t,t.pendingProps,r),t.child;case 8:return jt(e,t,t.pendingProps.children,r),t.child;case 12:return jt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Oe(ea,n._currentValue),n._currentValue=o,s!==null)if(Br(s.value,o)){if(s.children===i.children&&!Xt.current){t=dn(e,t,r);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===n){if(s.tag===1){a=an(-1,r&-r),a.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?a.next=a:(a.next=h.next,h.next=a),c.pending=a}}s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),Iu(s.return,r,t),l.lanes|=r;break}a=a.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(te(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Iu(o,r,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}jt(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Yi(t,r),i=Cr(i),n=n(i),t.flags|=1,jt(e,t,n,r),t.child;case 14:return n=t.type,i=Tr(n,t.pendingProps),i=Tr(n.type,i),Np(e,t,n,i,r);case 15:return Vv(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Tr(n,i),Cl(e,t),t.tag=1,Gt(n)?(e=!0,Ql(t)):e=!1,Yi(t,r),Hv(t,n,i),Bu(t,n,i,r),zu(null,t,n,!0,e,r);case 19:return Gv(e,t,r);case 22:return Kv(e,t,r)}throw Error(te(156,t.tag))};function d0(e,t){return z_(e,t)}function sS(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sr(e,t,r,n){return new sS(e,t,r,n)}function $d(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oS(e){if(typeof e=="function")return $d(e)?1:0;if(e!=null){if(e=e.$$typeof,e===od)return 11;if(e===ld)return 14}return 2}function On(e,t){var r=e.alternate;return r===null?(r=Sr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Ll(e,t,r,n,i,s){var o=2;if(n=e,typeof e=="function")$d(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ri:return ci(r.children,i,s,t);case sd:o=8,i|=8;break;case ou:return e=Sr(12,r,t,i|2),e.elementType=ou,e.lanes=s,e;case lu:return e=Sr(13,r,t,i),e.elementType=lu,e.lanes=s,e;case au:return e=Sr(19,r,t,i),e.elementType=au,e.lanes=s,e;case S_:return Ia(r,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case x_:o=10;break e;case w_:o=9;break e;case od:o=11;break e;case ld:o=14;break e;case Sn:o=16,n=null;break e}throw Error(te(130,e==null?e:typeof e,""))}return t=Sr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function ci(e,t,r,n){return e=Sr(7,e,n,t),e.lanes=r,e}function Ia(e,t,r,n){return e=Sr(22,e,n,t),e.elementType=S_,e.lanes=r,e.stateNode={isHidden:!1},e}function kc(e,t,r){return e=Sr(6,e,null,t),e.lanes=r,e}function Cc(e,t,r){return t=Sr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lS(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sc(0),this.expirationTimes=sc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sc(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Hd(e,t,r,n,i,s,o,l,a){return e=new lS(e,t,r,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Sr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cd(s),e}function aS(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Di,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function f0(e){if(!e)return $n;e=e._reactInternals;e:{if(wi(e)!==e||e.tag!==1)throw Error(te(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Gt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(te(171))}if(e.tag===1){var r=e.type;if(Gt(r))return fv(e,r,t)}return t}function p0(e,t,r,n,i,s,o,l,a){return e=Hd(r,n,!0,e,i,s,o,l,a),e.context=f0(null),r=e.current,n=zt(),i=jn(r),s=an(n,i),s.callback=t??null,An(r,s,i),e.current.lanes=i,To(e,i,n),Qt(e,n),e}function Aa(e,t,r,n){var i=t.current,s=zt(),o=jn(i);return r=f0(r),t.context===null?t.context=r:t.pendingContext=r,t=an(s,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=An(i,t,o),e!==null&&(Ir(e,i,o,s),Sl(e,i,o)),o}function ua(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function zp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Wd(e,t){zp(e,t),(e=e.alternate)&&zp(e,t)}function cS(){return null}var m0=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ud(e){this._internalRoot=e}Ba.prototype.render=Ud.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(te(409));Aa(e,t,null,null)};Ba.prototype.unmount=Ud.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gi(function(){Aa(null,e,null,null)}),t[un]=null}};function Ba(e){this._internalRoot=e}Ba.prototype.unstable_scheduleHydration=function(e){if(e){var t=K_();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Cn.length&&t!==0&&t<Cn[r].priority;r++);Cn.splice(r,0,e),r===0&&Y_(e)}};function Vd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ja(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Fp(){}function uS(e,t,r,n,i){if(i){if(typeof n=="function"){var s=n;n=function(){var c=ua(o);s.call(c)}}var o=p0(t,n,e,0,null,!1,!1,"",Fp);return e._reactRootContainer=o,e[un]=o.current,ho(e.nodeType===8?e.parentNode:e),gi(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var c=ua(a);l.call(c)}}var a=Hd(e,0,!1,null,null,!1,!1,"",Fp);return e._reactRootContainer=a,e[un]=a.current,ho(e.nodeType===8?e.parentNode:e),gi(function(){Aa(t,a,r,n)}),a}function Oa(e,t,r,n,i){var s=r._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var l=i;i=function(){var a=ua(o);l.call(a)}}Aa(t,o,e,i)}else o=uS(r,t,e,i,n);return ua(o)}U_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Bs(t.pendingLanes);r!==0&&(ud(t,r|1),Qt(t,it()),!(Re&6)&&(ns=it()+500,Un()))}break;case 13:gi(function(){var n=hn(e,1);if(n!==null){var i=zt();Ir(n,e,1,i)}}),Wd(e,1)}};hd=function(e){if(e.tag===13){var t=hn(e,134217728);if(t!==null){var r=zt();Ir(t,e,134217728,r)}Wd(e,134217728)}};V_=function(e){if(e.tag===13){var t=jn(e),r=hn(e,t);if(r!==null){var n=zt();Ir(r,e,t,n)}Wd(e,t)}};K_=function(){return Me};q_=function(e,t){var r=Me;try{return Me=e,t()}finally{Me=r}};vu=function(e,t,r){switch(t){case"input":if(hu(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=La(n);if(!i)throw Error(te(90));k_(n),hu(n,i)}}}break;case"textarea":E_(e,r);break;case"select":t=r.value,t!=null&&Ui(e,!!r.multiple,t,!1)}};M_=Od;I_=gi;var hS={usingClientEntryPoint:!1,Events:[Do,Bi,La,D_,R_,Od]},bs={findFiberByHostInstance:ii,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dS={bundleType:bs.bundleType,version:bs.version,rendererPackageName:bs.rendererPackageName,rendererConfig:bs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:fn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=j_(e),e===null?null:e.stateNode},findFiberByHostInstance:bs.findFiberByHostInstance||cS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ol=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ol.isDisabled&&ol.supportsFiber)try{ka=ol.inject(dS),Yr=ol}catch{}}hr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hS;hr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vd(t))throw Error(te(200));return aS(e,t,null,r)};hr.createRoot=function(e,t){if(!Vd(e))throw Error(te(299));var r=!1,n="",i=m0;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Hd(e,1,!1,null,null,r,!1,n,i),e[un]=t.current,ho(e.nodeType===8?e.parentNode:e),new Ud(t)};hr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(te(188)):(e=Object.keys(e).join(","),Error(te(268,e)));return e=j_(t),e=e===null?null:e.stateNode,e};hr.flushSync=function(e){return gi(e)};hr.hydrate=function(e,t,r){if(!ja(t))throw Error(te(200));return Oa(null,e,t,!0,r)};hr.hydrateRoot=function(e,t,r){if(!Vd(e))throw Error(te(405));var n=r!=null&&r.hydratedSources||null,i=!1,s="",o=m0;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=p0(t,null,e,1,r??null,i,!1,s,o),e[un]=t.current,ho(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Ba(t)};hr.render=function(e,t,r){if(!ja(t))throw Error(te(200));return Oa(null,e,t,!1,r)};hr.unmountComponentAtNode=function(e){if(!ja(e))throw Error(te(40));return e._reactRootContainer?(gi(function(){Oa(null,null,e,!1,function(){e._reactRootContainer=null,e[un]=null})}),!0):!1};hr.unstable_batchedUpdates=Od;hr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!ja(r))throw Error(te(200));if(e==null||e._reactInternals===void 0)throw Error(te(38));return Oa(e,t,r,!1,n)};hr.version="18.3.1-next-f1338f8080-20240426";function g0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g0)}catch(e){console.error(e)}}g0(),g_.exports=hr;var fS=g_.exports,_0,$p=fS;_0=$p.createRoot,$p.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.2
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function wo(){return wo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wo.apply(this,arguments)}var Tn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Tn||(Tn={}));const Hp="popstate";function pS(e){e===void 0&&(e={});function t(n,i){let{pathname:s,search:o,hash:l}=n.location;return Qu("",{pathname:s,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:v0(i)}return gS(t,r,null,e)}function ct(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Kd(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mS(){return Math.random().toString(36).substr(2,8)}function Wp(e,t){return{usr:e.state,key:e.key,idx:t}}function Qu(e,t,r,n){return r===void 0&&(r=null),wo({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?cs(t):t,{state:r,key:t&&t.key||n||mS()})}function v0(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function cs(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function gS(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,l=Tn.Pop,a=null,c=h();c==null&&(c=0,o.replaceState(wo({},o.state,{idx:c}),""));function h(){return(o.state||{idx:null}).idx}function u(){l=Tn.Pop;let x=h(),_=x==null?null:x-c;c=x,a&&a({action:l,location:g.location,delta:_})}function f(x,_){l=Tn.Push;let v=Qu(g.location,x,_);c=h()+1;let y=Wp(v,c),N=g.createHref(v);try{o.pushState(y,"",N)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;i.location.assign(N)}s&&a&&a({action:l,location:g.location,delta:1})}function p(x,_){l=Tn.Replace;let v=Qu(g.location,x,_);c=h();let y=Wp(v,c),N=g.createHref(v);o.replaceState(y,"",N),s&&a&&a({action:l,location:g.location,delta:0})}function m(x){let _=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof x=="string"?x:v0(x);return v=v.replace(/ $/,"%20"),ct(_,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,_)}let g={get action(){return l},get location(){return e(i,o)},listen(x){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(Hp,u),a=x,()=>{i.removeEventListener(Hp,u),a=null}},createHref(x){return t(i,x)},createURL:m,encodeLocation(x){let _=m(x);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:f,replace:p,go(x){return o.go(x)}};return g}var Up;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Up||(Up={}));function _S(e,t,r){return r===void 0&&(r="/"),vS(e,t,r)}function vS(e,t,r,n){let i=typeof t=="string"?cs(t):t,s=w0(i.pathname||"/",r);if(s==null)return null;let o=y0(e);yS(o);let l=null;for(let a=0;l==null&&a<o.length;++a){let c=DS(s);l=LS(o[a],c)}return l}function y0(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let i=(s,o,l)=>{let a={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};a.relativePath.startsWith("/")&&(ct(a.relativePath.startsWith(n),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(n.length));let c=ui([n,a.relativePath]),h=r.concat(a);s.children&&s.children.length>0&&(ct(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),y0(s.children,t,h,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:ES(c,s.index),routesMeta:h})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))i(s,o);else for(let a of x0(s.path))i(s,o,a)}),t}function x0(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=x0(n.join("/")),l=[];return l.push(...o.map(a=>a===""?s:[s,a].join("/"))),i&&l.push(...o),l.map(a=>e.startsWith("/")&&a===""?"/":a)}function yS(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:NS(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const xS=/^:[\w-]+$/,wS=3,SS=2,bS=1,kS=10,CS=-2,Vp=e=>e==="*";function ES(e,t){let r=e.split("/"),n=r.length;return r.some(Vp)&&(n+=CS),t&&(n+=SS),r.filter(i=>!Vp(i)).reduce((i,s)=>i+(xS.test(s)?wS:s===""?bS:kS),n)}function NS(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function LS(e,t,r){let{routesMeta:n}=e,i={},s="/",o=[];for(let l=0;l<n.length;++l){let a=n[l],c=l===n.length-1,h=s==="/"?t:t.slice(s.length)||"/",u=TS({path:a.relativePath,caseSensitive:a.caseSensitive,end:c},h),f=a.route;if(!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:ui([s,u.pathname]),pathnameBase:BS(ui([s,u.pathnameBase])),route:f}),u.pathnameBase!=="/"&&(s=ui([s,u.pathnameBase]))}return o}function TS(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=PS(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:n.reduce((c,h,u)=>{let{paramName:f,isOptional:p}=h;if(f==="*"){let g=l[u]||"";o=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const m=l[u];return p&&!m?c[f]=void 0:c[f]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:e}}function PS(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Kd(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,a)=>(n.push({paramName:l,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function DS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Kd(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function w0(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const RS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,MS=e=>RS.test(e);function IS(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?cs(e):e,s;if(r)if(MS(r))s=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),Kd(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?s=Kp(r.substring(1),"/"):s=Kp(r,t)}else s=t;return{pathname:s,search:jS(n),hash:OS(i)}}function Kp(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Ec(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function AS(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function S0(e,t){let r=AS(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function b0(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=cs(e):(i=wo({},e),ct(!i.pathname||!i.pathname.includes("?"),Ec("?","pathname","search",i)),ct(!i.pathname||!i.pathname.includes("#"),Ec("#","pathname","hash",i)),ct(!i.search||!i.search.includes("#"),Ec("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,l;if(o==null)l=r;else{let u=t.length-1;if(!n&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),u-=1;i.pathname=f.join("/")}l=u>=0?t[u]:"/"}let a=IS(i,l),c=o&&o!=="/"&&o.endsWith("/"),h=(s||o===".")&&r.endsWith("/");return!a.pathname.endsWith("/")&&(c||h)&&(a.pathname+="/"),a}const ui=e=>e.join("/").replace(/\/\/+/g,"/"),BS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),jS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,OS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function zS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const k0=["post","put","patch","delete"];new Set(k0);const FS=["get",...k0];new Set(FS);/**
|
|
50
|
+
* React Router v6.30.3
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function So(){return So=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},So.apply(this,arguments)}const qd=b.createContext(null),$S=b.createContext(null),Mo=b.createContext(null),za=b.createContext(null),Vn=b.createContext({outlet:null,matches:[],isDataRoute:!1}),C0=b.createContext(null);function Io(){return b.useContext(za)!=null}function Ao(){return Io()||ct(!1),b.useContext(za).location}function E0(e){b.useContext(Mo).static||b.useLayoutEffect(e)}function us(){let{isDataRoute:e}=b.useContext(Vn);return e?eb():HS()}function HS(){Io()||ct(!1);let e=b.useContext(qd),{basename:t,future:r,navigator:n}=b.useContext(Mo),{matches:i}=b.useContext(Vn),{pathname:s}=Ao(),o=JSON.stringify(S0(i,r.v7_relativeSplatPath)),l=b.useRef(!1);return E0(()=>{l.current=!0}),b.useCallback(function(c,h){if(h===void 0&&(h={}),!l.current)return;if(typeof c=="number"){n.go(c);return}let u=b0(c,JSON.parse(o),s,h.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:ui([t,u.pathname])),(h.replace?n.replace:n.push)(u,h.state,h)},[t,n,o,s,e])}function N0(){let{matches:e}=b.useContext(Vn),t=e[e.length-1];return t?t.params:{}}function WS(e,t){return US(e,t)}function US(e,t,r,n){Io()||ct(!1);let{navigator:i}=b.useContext(Mo),{matches:s}=b.useContext(Vn),o=s[s.length-1],l=o?o.params:{};o&&o.pathname;let a=o?o.pathnameBase:"/";o&&o.route;let c=Ao(),h;if(t){var u;let x=typeof t=="string"?cs(t):t;a==="/"||(u=x.pathname)!=null&&u.startsWith(a)||ct(!1),h=x}else h=c;let f=h.pathname||"/",p=f;if(a!=="/"){let x=a.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(x.length).join("/")}let m=_S(e,{pathname:p}),g=XS(m&&m.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:ui([a,i.encodeLocation?i.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?a:ui([a,i.encodeLocation?i.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),s,r,n);return t&&g?b.createElement(za.Provider,{value:{location:So({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Tn.Pop}},g):g}function VS(){let e=JS(),t=zS(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),r?b.createElement("pre",{style:i},r):null,null)}const KS=b.createElement(VS,null);class qS extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?b.createElement(Vn.Provider,{value:this.props.routeContext},b.createElement(C0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function YS(e){let{routeContext:t,match:r,children:n}=e,i=b.useContext(qd);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),b.createElement(Vn.Provider,{value:t},n)}function XS(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var s;if(!r)return null;if(r.errors)e=r.matches;else if((s=n)!=null&&s.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(i=r)==null?void 0:i.errors;if(l!=null){let h=o.findIndex(u=>u.route.id&&(l==null?void 0:l[u.route.id])!==void 0);h>=0||ct(!1),o=o.slice(0,Math.min(o.length,h+1))}let a=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let h=0;h<o.length;h++){let u=o[h];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(c=h),u.route.id){let{loaderData:f,errors:p}=r,m=u.route.loader&&f[u.route.id]===void 0&&(!p||p[u.route.id]===void 0);if(u.route.lazy||m){a=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((h,u,f)=>{let p,m=!1,g=null,x=null;r&&(p=l&&u.route.id?l[u.route.id]:void 0,g=u.route.errorElement||KS,a&&(c<0&&f===0?(tb("route-fallback"),m=!0,x=null):c===f&&(m=!0,x=u.route.hydrateFallbackElement||null)));let _=t.concat(o.slice(0,f+1)),v=()=>{let y;return p?y=g:m?y=x:u.route.Component?y=b.createElement(u.route.Component,null):u.route.element?y=u.route.element:y=h,b.createElement(YS,{match:u,routeContext:{outlet:h,matches:_,isDataRoute:r!=null},children:y})};return r&&(u.route.ErrorBoundary||u.route.errorElement||f===0)?b.createElement(qS,{location:r.location,revalidation:r.revalidation,component:g,error:p,children:v(),routeContext:{outlet:null,matches:_,isDataRoute:!0}}):v()},null)}var L0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(L0||{}),T0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(T0||{});function GS(e){let t=b.useContext(qd);return t||ct(!1),t}function QS(e){let t=b.useContext($S);return t||ct(!1),t}function ZS(e){let t=b.useContext(Vn);return t||ct(!1),t}function P0(e){let t=ZS(),r=t.matches[t.matches.length-1];return r.route.id||ct(!1),r.route.id}function JS(){var e;let t=b.useContext(C0),r=QS(),n=P0();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function eb(){let{router:e}=GS(L0.UseNavigateStable),t=P0(T0.UseNavigateStable),r=b.useRef(!1);return E0(()=>{r.current=!0}),b.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,So({fromRouteId:t},s)))},[e,t])}const qp={};function tb(e,t,r){qp[e]||(qp[e]=!0)}function rb(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Tl(e){let{to:t,replace:r,state:n,relative:i}=e;Io()||ct(!1);let{future:s,static:o}=b.useContext(Mo),{matches:l}=b.useContext(Vn),{pathname:a}=Ao(),c=us(),h=b0(t,S0(l,s.v7_relativeSplatPath),a,i==="path"),u=JSON.stringify(h);return b.useEffect(()=>c(JSON.parse(u),{replace:r,state:n,relative:i}),[c,u,i,r,n]),null}function Jn(e){ct(!1)}function nb(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Tn.Pop,navigator:s,static:o=!1,future:l}=e;Io()&&ct(!1);let a=t.replace(/^\/*/,"/"),c=b.useMemo(()=>({basename:a,navigator:s,static:o,future:So({v7_relativeSplatPath:!1},l)}),[a,l,s,o]);typeof n=="string"&&(n=cs(n));let{pathname:h="/",search:u="",hash:f="",state:p=null,key:m="default"}=n,g=b.useMemo(()=>{let x=w0(h,a);return x==null?null:{location:{pathname:x,search:u,hash:f,state:p,key:m},navigationType:i}},[a,h,u,f,p,m,i]);return g==null?null:b.createElement(Mo.Provider,{value:c},b.createElement(za.Provider,{children:r,value:g}))}function ib(e){let{children:t,location:r}=e;return WS(Zu(t),r)}new Promise(()=>{});function Zu(e,t){t===void 0&&(t=[]);let r=[];return b.Children.forEach(e,(n,i)=>{if(!b.isValidElement(n))return;let s=[...t,i];if(n.type===b.Fragment){r.push.apply(r,Zu(n.props.children,s));return}n.type!==Jn&&ct(!1),!n.props.index||!n.props.children||ct(!1);let o={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Zu(n.props.children,s)),r.push(o)}),r}/**
|
|
59
|
+
* React Router DOM v6.30.3
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function Ju(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function sb(e,t){let r=Ju(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(s=>{r.append(i,s)})}),r}const ob="6";try{window.__reactRouterVersion=ob}catch{}const lb="startTransition",Yp=rx[lb];function ab(e){let{basename:t,children:r,future:n,window:i}=e,s=b.useRef();s.current==null&&(s.current=pS({window:i,v5Compat:!0}));let o=s.current,[l,a]=b.useState({action:o.action,location:o.location}),{v7_startTransition:c}=n||{},h=b.useCallback(u=>{c&&Yp?Yp(()=>a(u)):a(u)},[a,c]);return b.useLayoutEffect(()=>o.listen(h),[o,h]),b.useEffect(()=>rb(n),[n]),b.createElement(nb,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}var Xp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Xp||(Xp={}));var Gp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Gp||(Gp={}));function cb(e){let t=b.useRef(Ju(e)),r=b.useRef(!1),n=Ao(),i=b.useMemo(()=>sb(n.search,r.current?null:t.current),[n.search]),s=us(),o=b.useCallback((l,a)=>{const c=Ju(typeof l=="function"?l(i):l);r.current=!0,s("?"+c,a)},[s,i]);return[i,o]}const D0=b.createContext({ides:[],updateIdeChats:()=>{},screenshotMap:{},setScreenshotMap:()=>{},initialLoaded:!1,toasts:[],setToasts:()=>{},wsStatus:"connected",isConnected:!0,connectionStates:{},connectionTransports:{},showReconnected:!1}),R0=b.createContext({injectEntries:()=>{},markLoaded:()=>{},getIdes:()=>[]});function ub(e,t){var o,l,a,c;const r=Date.now();if(t.length===0)return e.map(h=>({...h,_lastUpdate:r}));const n=new Map;for(const h of t)n.set(h.id,h);for(const h of e){const u=n.get(h.id);if(!u){n.set(h.id,{...h,_lastUpdate:r});continue}const f=h.timestamp||r,p=u._lastUpdate||u.timestamp||0;if(f>=p){const m=(o=h.chats)!=null&&o.length?h.chats:u.chats;n.set(h.id,{...u,...h,chats:m,_lastUpdate:r})}else(l=h.chats)!=null&&l.length&&!((a=u.chats)!=null&&a.length)&&n.set(h.id,{...u,chats:h.chats})}const i=new Set(e.map(h=>h.id)),s=new Set;for(const h of e){const u=h.daemonId||((c=h.id)==null?void 0:c.split(":")[0]);u&&s.add(u)}for(const[h,u]of n){const f=u.daemonId||h.split(":")[0];if(!s.has(f))continue;const p=r-(u._lastUpdate||u.timestamp||0);(h.includes(":cli:")&&!i.has(h)&&p>1e4||h.includes(":acp:")&&!i.has(h)&&p>1e4||h.includes(":ide:")&&!i.has(h)&&p>3e4)&&n.delete(h)}for(const[h,u]of n)r-(u._lastUpdate||u.timestamp||0)>3e5&&u.status!=="online"&&n.delete(h);return Array.from(n.values())}function hb({children:e}){const[t,r]=b.useState([]),[n,i]=b.useState({}),[s,o]=b.useState(!1),[l,a]=b.useState([]),c=b.useCallback((u,f)=>{r(p=>p.map(m=>m.id===u?{...m,chats:f}:m))},[]),h={injectEntries:u=>{r(f=>f.length===0?u:ub(u,f))},markLoaded:()=>o(!0),getIdes:()=>t};return d.jsx(R0.Provider,{value:h,children:d.jsx(D0.Provider,{value:{ides:t,updateIdeChats:c,screenshotMap:n,setScreenshotMap:i,initialLoaded:s,toasts:l,setToasts:a,wsStatus:"connected",isConnected:!0,connectionStates:{},connectionTransports:{},showReconnected:!1},children:e})})}function M0(){return b.useContext(D0)}function Qp(){return b.useContext(R0)}function db(e){const{baseUrl:t,getToken:r,onUnauthorized:n}=e;async function i(s,o={}){const l={"Content-Type":"application/json",...o.headers||{}},a=r==null?void 0:r();a&&(l.Authorization=`Bearer ${a}`);const c=s.startsWith("http")?s:`${t}${s.startsWith("/")?"":"/"}${s}`,h=await fetch(c,{...o,headers:l});if(h.status===401)throw n==null||n(),new Error("Unauthorized");if(!h.ok){const u=await h.json().catch(()=>({error:h.statusText}));throw new Error(u.error||`API Error: ${h.status}`)}return h.json()}return{getDaemons:()=>i("/api/v1/daemons"),getDaemonStatus:s=>i(`/api/v1/daemons/${s}/status`),sendCommand:(s,o,l={})=>i(`/api/v1/daemons/${s}/command`,{method:"POST",body:JSON.stringify({type:o,payload:l})}),execTerminal:(s,o,l)=>i(`/api/v1/daemons/${s}/terminal`,{method:"POST",body:JSON.stringify({command:o,name:l})}),sendAgentMessage:(s,o,l)=>i(`/api/v1/agents/${s}/send`,{method:"POST",body:JSON.stringify({agentType:o,message:l})}),getAgentStatus:s=>i(`/api/v1/agents/${s}/status`),approveAgent:(s,o,l)=>i(`/api/v1/agents/${s}/approve`,{method:"POST",body:JSON.stringify({agentType:o,approve:l})}),request:i}}const fb=db({baseUrl:"http://localhost:3847"});b.createContext(fb);const pb={sendCommand:async()=>{throw new Error("TransportContext not initialized")}},I0=b.createContext(pb);function mb({value:e,children:t}){return d.jsx(I0.Provider,{value:e,children:t})}function Si(){return b.useContext(I0)}function gb(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const _b=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yb={};function Zp(e,t){return(yb.jsx?vb:_b).test(e)}const xb=/[ \t\n\f\r]/g;function wb(e){return typeof e=="object"?e.type==="text"?Jp(e.value):!1:Jp(e)}function Jp(e){return e.replace(xb,"")===""}class Bo{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}Bo.prototype.normal={};Bo.prototype.property={};Bo.prototype.space=void 0;function A0(e,t){const r={},n={};for(const i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new Bo(r,n,t)}function eh(e){return e.toLowerCase()}class Zt{constructor(t,r){this.attribute=r,this.property=t}}Zt.prototype.attribute="";Zt.prototype.booleanish=!1;Zt.prototype.boolean=!1;Zt.prototype.commaOrSpaceSeparated=!1;Zt.prototype.commaSeparated=!1;Zt.prototype.defined=!1;Zt.prototype.mustUseProperty=!1;Zt.prototype.number=!1;Zt.prototype.overloadedBoolean=!1;Zt.prototype.property="";Zt.prototype.spaceSeparated=!1;Zt.prototype.space=void 0;let Sb=0;const Ce=bi(),st=bi(),th=bi(),ie=bi(),je=bi(),Gi=bi(),ir=bi();function bi(){return 2**++Sb}const rh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ce,booleanish:st,commaOrSpaceSeparated:ir,commaSeparated:Gi,number:ie,overloadedBoolean:th,spaceSeparated:je},Symbol.toStringTag,{value:"Module"})),Nc=Object.keys(rh);class Yd extends Zt{constructor(t,r,n,i){let s=-1;if(super(t,r),em(this,"space",i),typeof n=="number")for(;++s<Nc.length;){const o=Nc[s];em(this,Nc[s],(n&rh[o])===rh[o])}}}Yd.prototype.defined=!0;function em(e,t,r){r&&(e[t]=r)}function hs(e){const t={},r={};for(const[n,i]of Object.entries(e.properties)){const s=new Yd(n,e.transform(e.attributes||{},n),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(s.mustUseProperty=!0),t[n]=s,r[eh(n)]=n,r[eh(s.attribute)]=n}return new Bo(t,r,e.space)}const B0=hs({properties:{ariaActiveDescendant:null,ariaAtomic:st,ariaAutoComplete:null,ariaBusy:st,ariaChecked:st,ariaColCount:ie,ariaColIndex:ie,ariaColSpan:ie,ariaControls:je,ariaCurrent:null,ariaDescribedBy:je,ariaDetails:null,ariaDisabled:st,ariaDropEffect:je,ariaErrorMessage:null,ariaExpanded:st,ariaFlowTo:je,ariaGrabbed:st,ariaHasPopup:null,ariaHidden:st,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:je,ariaLevel:ie,ariaLive:null,ariaModal:st,ariaMultiLine:st,ariaMultiSelectable:st,ariaOrientation:null,ariaOwns:je,ariaPlaceholder:null,ariaPosInSet:ie,ariaPressed:st,ariaReadOnly:st,ariaRelevant:null,ariaRequired:st,ariaRoleDescription:je,ariaRowCount:ie,ariaRowIndex:ie,ariaRowSpan:ie,ariaSelected:st,ariaSetSize:ie,ariaSort:null,ariaValueMax:ie,ariaValueMin:ie,ariaValueNow:ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function j0(e,t){return t in e?e[t]:t}function O0(e,t){return j0(e,t.toLowerCase())}const bb=hs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Gi,acceptCharset:je,accessKey:je,action:null,allow:null,allowFullScreen:Ce,allowPaymentRequest:Ce,allowUserMedia:Ce,alt:null,as:null,async:Ce,autoCapitalize:null,autoComplete:je,autoFocus:Ce,autoPlay:Ce,blocking:je,capture:null,charSet:null,checked:Ce,cite:null,className:je,cols:ie,colSpan:null,content:null,contentEditable:st,controls:Ce,controlsList:je,coords:ie|Gi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ce,defer:Ce,dir:null,dirName:null,disabled:Ce,download:th,draggable:st,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ce,formTarget:null,headers:je,height:ie,hidden:th,high:ie,href:null,hrefLang:null,htmlFor:je,httpEquiv:je,id:null,imageSizes:null,imageSrcSet:null,inert:Ce,inputMode:null,integrity:null,is:null,isMap:Ce,itemId:null,itemProp:je,itemRef:je,itemScope:Ce,itemType:je,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ce,low:ie,manifest:null,max:null,maxLength:ie,media:null,method:null,min:null,minLength:ie,multiple:Ce,muted:Ce,name:null,nonce:null,noModule:Ce,noValidate:Ce,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:Ce,optimum:ie,pattern:null,ping:je,placeholder:null,playsInline:Ce,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ce,referrerPolicy:null,rel:je,required:Ce,reversed:Ce,rows:ie,rowSpan:ie,sandbox:je,scope:null,scoped:Ce,seamless:Ce,selected:Ce,shadowRootClonable:Ce,shadowRootDelegatesFocus:Ce,shadowRootMode:null,shape:null,size:ie,sizes:null,slot:null,span:ie,spellCheck:st,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ie,step:null,style:null,tabIndex:ie,target:null,title:null,translate:null,type:null,typeMustMatch:Ce,useMap:null,value:st,width:ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:je,axis:null,background:null,bgColor:null,border:ie,borderColor:null,bottomMargin:ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ce,declare:Ce,event:null,face:null,frame:null,frameBorder:null,hSpace:ie,leftMargin:ie,link:null,longDesc:null,lowSrc:null,marginHeight:ie,marginWidth:ie,noResize:Ce,noHref:Ce,noShade:Ce,noWrap:Ce,object:null,profile:null,prompt:null,rev:null,rightMargin:ie,rules:null,scheme:null,scrolling:st,standby:null,summary:null,text:null,topMargin:ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ie,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ce,disableRemotePlayback:Ce,prefix:null,property:null,results:ie,security:null,unselectable:null},space:"html",transform:O0}),kb=hs({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:ir,accentHeight:ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ie,amplitude:ie,arabicForm:null,ascent:ie,attributeName:null,attributeType:null,azimuth:ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ie,by:null,calcMode:null,capHeight:ie,className:je,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:ie,diffuseConstant:ie,direction:null,display:null,dur:null,divisor:ie,dominantBaseline:null,download:Ce,dx:null,dy:null,edgeMode:null,editable:null,elevation:ie,enableBackground:null,end:null,event:null,exponent:ie,externalResourcesRequired:null,fill:null,fillOpacity:ie,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:Gi,g2:Gi,glyphName:Gi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ie,horizOriginX:ie,horizOriginY:ie,id:null,ideographic:ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ie,k:ie,k1:ie,k2:ie,k3:ie,k4:ie,kernelMatrix:ir,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ie,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:ie,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:ie,overlineThickness:ie,paintOrder:null,panose1:null,path:null,pathLength:ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:je,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ie,pointsAtY:ie,pointsAtZ:ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ir,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ir,rev:ir,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ir,requiredFeatures:ir,requiredFonts:ir,requiredFormats:ir,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:ie,specularExponent:ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ie,strikethroughThickness:ie,string:null,stroke:null,strokeDashArray:ir,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ie,strokeOpacity:ie,strokeWidth:null,style:null,surfaceScale:ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ir,tabIndex:ie,tableValues:null,target:null,targetX:ie,targetY:ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ir,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ie,underlineThickness:ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ie,values:null,vAlphabetic:ie,vMathematical:ie,vectorEffect:null,vHanging:ie,vIdeographic:ie,version:null,vertAdvY:ie,vertOriginX:ie,vertOriginY:ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:j0}),z0=hs({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()}}),F0=hs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:O0}),$0=hs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Cb={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"},Eb=/[A-Z]/g,tm=/-[a-z]/g,Nb=/^data[-\w.:]+$/i;function Lb(e,t){const r=eh(t);let n=t,i=Zt;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&Nb.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(tm,Pb);n="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!tm.test(s)){let o=s.replace(Eb,Tb);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Yd}return new i(n,t)}function Tb(e){return"-"+e.toLowerCase()}function Pb(e){return e.charAt(1).toUpperCase()}const Db=A0([B0,bb,z0,F0,$0],"html"),Xd=A0([B0,kb,z0,F0,$0],"svg");function Rb(e){return e.join(" ").trim()}var Gd={},rm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Mb=/\n/g,Ib=/^\s*/,Ab=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Bb=/^:\s*/,jb=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ob=/^[;\s]*/,zb=/^\s+|\s+$/g,Fb=`
|
|
68
|
+
`,nm="/",im="*",ni="",$b="comment",Hb="declaration";function Wb(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,n=1;function i(m){var g=m.match(Mb);g&&(r+=g.length);var x=m.lastIndexOf(Fb);n=~x?m.length-x:n+m.length}function s(){var m={line:r,column:n};return function(g){return g.position=new o(m),c(),g}}function o(m){this.start=m,this.end={line:r,column:n},this.source=t.source}o.prototype.content=e;function l(m){var g=new Error(t.source+":"+r+":"+n+": "+m);if(g.reason=m,g.filename=t.source,g.line=r,g.column=n,g.source=e,!t.silent)throw g}function a(m){var g=m.exec(e);if(g){var x=g[0];return i(x),e=e.slice(x.length),g}}function c(){a(Ib)}function h(m){var g;for(m=m||[];g=u();)g!==!1&&m.push(g);return m}function u(){var m=s();if(!(nm!=e.charAt(0)||im!=e.charAt(1))){for(var g=2;ni!=e.charAt(g)&&(im!=e.charAt(g)||nm!=e.charAt(g+1));)++g;if(g+=2,ni===e.charAt(g-1))return l("End of comment missing");var x=e.slice(2,g-2);return n+=2,i(x),e=e.slice(g),n+=2,m({type:$b,comment:x})}}function f(){var m=s(),g=a(Ab);if(g){if(u(),!a(Bb))return l("property missing ':'");var x=a(jb),_=m({type:Hb,property:sm(g[0].replace(rm,ni)),value:x?sm(x[0].replace(rm,ni)):ni});return a(Ob),_}}function p(){var m=[];h(m);for(var g;g=f();)g!==!1&&(m.push(g),h(m));return m}return c(),p()}function sm(e){return e?e.replace(zb,ni):ni}var Ub=Wb,Vb=Fl&&Fl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gd,"__esModule",{value:!0});Gd.default=qb;const Kb=Vb(Ub);function qb(e,t){let r=null;if(!e||typeof e!="string")return r;const n=(0,Kb.default)(e),i=typeof t=="function";return n.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:l}=s;i?t(o,l,s):l&&(r=r||{},r[o]=l)}),r}var Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});Fa.camelCase=void 0;var Yb=/^--[a-zA-Z0-9_-]+$/,Xb=/-([a-z])/g,Gb=/^[^-]+$/,Qb=/^-(webkit|moz|ms|o|khtml)-/,Zb=/^-(ms)-/,Jb=function(e){return!e||Gb.test(e)||Yb.test(e)},ek=function(e,t){return t.toUpperCase()},om=function(e,t){return"".concat(t,"-")},tk=function(e,t){return t===void 0&&(t={}),Jb(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Zb,om):e=e.replace(Qb,om),e.replace(Xb,ek))};Fa.camelCase=tk;var rk=Fl&&Fl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},nk=rk(Gd),ik=Fa;function nh(e,t){var r={};return!e||typeof e!="string"||(0,nk.default)(e,function(n,i){n&&i&&(r[(0,ik.camelCase)(n,t)]=i)}),r}nh.default=nh;var sk=nh;const ok=Qh(sk),H0=W0("end"),Qd=W0("start");function W0(e){return t;function t(r){const n=r&&r.position&&r.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 lk(e){const t=Qd(e),r=H0(e);if(t&&r)return{start:t,end:r}}function Zs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?lm(e.position):"start"in e||"end"in e?lm(e):"line"in e||"column"in e?ih(e):""}function ih(e){return am(e&&e.line)+":"+am(e&&e.column)}function lm(e){return ih(e&&e.start)+"-"+ih(e&&e.end)}function am(e){return e&&typeof e=="number"?e:1}class It extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",s={},o=!1;if(r&&("line"in r&&"column"in r?s={place:r}:"start"in r&&"end"in r?s={place:r}:"type"in r?s={ancestors:[r],place:r.position}:s={...r}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof n=="string"){const a=n.indexOf(":");a===-1?s.ruleId=n:(s.source=n.slice(0,a),s.ruleId=n.slice(a+1))}if(!s.place&&s.ancestors&&s.ancestors){const a=s.ancestors[s.ancestors.length-1];a&&(s.place=a.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=Zs(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}It.prototype.file="";It.prototype.name="";It.prototype.reason="";It.prototype.message="";It.prototype.stack="";It.prototype.column=void 0;It.prototype.line=void 0;It.prototype.ancestors=void 0;It.prototype.cause=void 0;It.prototype.fatal=void 0;It.prototype.place=void 0;It.prototype.ruleId=void 0;It.prototype.source=void 0;const Zd={}.hasOwnProperty,ak=new Map,ck=/[A-Z]/g,uk=new Set(["table","tbody","thead","tfoot","tr"]),hk=new Set(["td","th"]),U0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function dk(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=xk(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=yk(r,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Xd:Db,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=V0(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function V0(e,t,r){if(t.type==="element")return fk(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return pk(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return gk(e,t,r);if(t.type==="mdxjsEsm")return mk(e,t);if(t.type==="root")return _k(e,t,r);if(t.type==="text")return vk(e,t)}function fk(e,t,r){const n=e.schema;let i=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=Xd,e.schema=i),e.ancestors.push(t);const s=q0(e,t.tagName,!1),o=wk(e,t);let l=ef(e,t);return uk.has(t.tagName)&&(l=l.filter(function(a){return typeof a=="string"?!wb(a):!0})),K0(e,o,s,t),Jd(o,l),e.ancestors.pop(),e.schema=n,e.create(t,s,o,r)}function pk(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}bo(e,t.position)}function mk(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bo(e,t.position)}function gk(e,t,r){const n=e.schema;let i=n;t.name==="svg"&&n.space==="html"&&(i=Xd,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:q0(e,t.name,!0),o=Sk(e,t),l=ef(e,t);return K0(e,o,s,t),Jd(o,l),e.ancestors.pop(),e.schema=n,e.create(t,s,o,r)}function _k(e,t,r){const n={};return Jd(n,ef(e,t)),e.create(t,e.Fragment,n,r)}function vk(e,t){return t.value}function K0(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function Jd(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function yk(e,t,r){return n;function n(i,s,o,l){const c=Array.isArray(o.children)?r:t;return l?c(s,o,l):c(s,o)}}function xk(e,t){return r;function r(n,i,s,o){const l=Array.isArray(s.children),a=Qd(n);return t(i,s,o,l,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function wk(e,t){const r={};let n,i;for(i in t.properties)if(i!=="children"&&Zd.call(t.properties,i)){const s=bk(e,i,t.properties[i]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&hk.has(t.tagName)?n=l:r[o]=l}}if(n){const s=r.style||(r.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function Sk(e,t){const r={};for(const n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const s=n.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(r,e.evaluater.evaluateExpression(l.argument))}else bo(e,t.position);else{const i=n.name;let s;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const l=n.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else bo(e,t.position);else s=n.value===null?!0:n.value;r[i]=s}return r}function ef(e,t){const r=[];let n=-1;const i=e.passKeys?new Map:ak;for(;++n<t.children.length;){const s=t.children[n];let o;if(e.passKeys){const a=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(a){const c=i.get(a)||0;o=a+"-"+c,i.set(a,c+1)}}const l=V0(e,s,o);l!==void 0&&r.push(l)}return r}function bk(e,t,r){const n=Lb(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?gb(r):Rb(r)),n.property==="style"){let i=typeof r=="object"?r:kk(e,String(r));return e.stylePropertyNameCase==="css"&&(i=Ck(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&n.space?Cb[n.property]||n.property:n.attribute,r]}}function kk(e,t){try{return ok(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const n=r,i=new It("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=U0+"#cannot-parse-style-attribute",i}}function q0(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const l=Zp(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}n=o}else n=Zp(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){const i=n.value;return Zd.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(n);bo(e)}function bo(e,t){const r=new It("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=U0+"#cannot-handle-mdx-estrees-without-createevaluater",r}function Ck(e){const t={};let r;for(r in e)Zd.call(e,r)&&(t[Ek(r)]=e[r]);return t}function Ek(e){let t=e.replace(ck,Nk);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Nk(e){return"-"+e.toLowerCase()}const Lc={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"]},Lk={};function tf(e,t){const r=Lk,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Y0(e,n,i)}function Y0(e,t,r){if(Tk(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return cm(e.children,t,r)}return Array.isArray(e)?cm(e,t,r):""}function cm(e,t,r){const n=[];let i=-1;for(;++i<e.length;)n[i]=Y0(e[i],t,r);return n.join("")}function Tk(e){return!!(e&&typeof e=="object")}const um=document.createElement("i");function rf(e){const t="&"+e+";";um.innerHTML=t;const r=um.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function cr(e,t,r,n){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,r=r>0?r:0,n.length<1e4)o=Array.from(n),o.unshift(t,r),e.splice(...o);else for(r&&e.splice(t,r);s<n.length;)o=n.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function wr(e,t){return e.length>0?(cr(e,e.length,0,t),e):t}const hm={}.hasOwnProperty;function X0(e){const t={};let r=-1;for(;++r<e.length;)Pk(t,e[r]);return t}function Pk(e,t){let r;for(r in t){const i=(hm.call(e,r)?e[r]:void 0)||(e[r]={}),s=t[r];let o;if(s)for(o in s){hm.call(i,o)||(i[o]=[]);const l=s[o];Dk(i[o],Array.isArray(l)?l:l?[l]:[])}}}function Dk(e,t){let r=-1;const n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);cr(e,0,0,n)}function G0(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Ar(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ot=Kn(/[A-Za-z]/),Rt=Kn(/[\dA-Za-z]/),Rk=Kn(/[#-'*+\--9=?A-Z^-~]/);function ha(e){return e!==null&&(e<32||e===127)}const sh=Kn(/\d/),Mk=Kn(/[\dA-Fa-f]/),Ik=Kn(/[!-/:-@[-`{-~]/);function _e(e){return e!==null&&e<-2}function Be(e){return e!==null&&(e<0||e===32)}function Le(e){return e===-2||e===-1||e===32}const $a=Kn(new RegExp("\\p{P}|\\p{S}","u")),_i=Kn(/\s/);function Kn(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ds(e){const t=[];let r=-1,n=0,i=0;for(;++r<e.length;){const s=e.charCodeAt(r);let o="";if(s===37&&Rt(e.charCodeAt(r+1))&&Rt(e.charCodeAt(r+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const l=e.charCodeAt(r+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(n,r),encodeURIComponent(o)),n=r+i+1,o=""),i&&(r+=i,i=0)}return t.join("")+e.slice(n)}function De(e,t,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(a){return Le(a)?(e.enter(r),l(a)):t(a)}function l(a){return Le(a)&&s++<i?(e.consume(a),l):(e.exit(r),t(a))}}const Ak={tokenize:Bk};function Bk(e){const t=e.attempt(this.parser.constructs.contentInitial,n,i);let r;return t;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),De(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),s(l)}function s(l){const a=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=a),r=a,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return _e(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),o)}}const jk={tokenize:Ok},dm={tokenize:zk};function Ok(e){const t=this,r=[];let n=0,i,s,o;return l;function l(y){if(n<r.length){const N=r[n];return t.containerState=N[1],e.attempt(N[0].continuation,a,c)(y)}return c(y)}function a(y){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const N=t.events.length;let L=N,C;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){C=t.events[L][1].end;break}_(n);let D=N;for(;D<t.events.length;)t.events[D][1].end={...C},D++;return cr(t.events,L+1,0,t.events.slice(N)),t.events.length=D,c(y)}return l(y)}function c(y){if(n===r.length){if(!i)return f(y);if(i.currentConstruct&&i.currentConstruct.concrete)return m(y);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dm,h,u)(y)}function h(y){return i&&v(),_(n),f(y)}function u(y){return t.parser.lazy[t.now().line]=n!==r.length,o=t.now().offset,m(y)}function f(y){return t.containerState={},e.attempt(dm,p,m)(y)}function p(y){return n++,r.push([t.currentConstruct,t.containerState]),f(y)}function m(y){if(y===null){i&&v(),_(0),e.consume(y);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),g(y)}function g(y){if(y===null){x(e.exit("chunkFlow"),!0),_(0),e.consume(y);return}return _e(y)?(e.consume(y),x(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(y),g)}function x(y,N){const L=t.sliceStream(y);if(N&&L.push(null),y.previous=s,s&&(s.next=y),s=y,i.defineSkip(y.start),i.write(L),t.parser.lazy[y.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<o&&(!i.events[C][1].end||i.events[C][1].end.offset>o))return;const D=t.events.length;let z=D,F,E;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){if(F){E=t.events[z][1].end;break}F=!0}for(_(n),C=D;C<t.events.length;)t.events[C][1].end={...E},C++;cr(t.events,z+1,0,t.events.slice(D)),t.events.length=C}}function _(y){let N=r.length;for(;N-- >y;){const L=r[N];t.containerState=L[1],L[0].exit.call(t,e)}r.length=y}function v(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function zk(e,t,r){return De(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function is(e){if(e===null||Be(e)||_i(e))return 1;if($a(e))return 2}function Ha(e,t,r){const n=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!n.includes(s)&&(t=s(t,r),n.push(s))}return t}const oh={name:"attention",resolveAll:Fk,tokenize:$k};function Fk(e,t){let r=-1,n,i,s,o,l,a,c,h;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const u={...e[n][1].end},f={...e[r][1].start};fm(u,-a),fm(f,a),o={type:a>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:f},s={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},i={type:a>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[n][1].end={...o.start},e[r][1].start={...l.end},c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=wr(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=wr(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=wr(c,Ha(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=wr(c,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[r][1].end.offset-e[r][1].start.offset?(h=2,c=wr(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):h=0,cr(e,n-1,r-n+3,c),r=n+c.length-h-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function $k(e,t){const r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=is(n);let s;return o;function o(a){return s=a,e.enter("attentionSequence"),l(a)}function l(a){if(a===s)return e.consume(a),l;const c=e.exit("attentionSequence"),h=is(a),u=!h||h===2&&i||r.includes(a),f=!i||i===2&&h||r.includes(n);return c._open=!!(s===42?u:u&&(i||!f)),c._close=!!(s===42?f:f&&(h||!u)),t(a)}}function fm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Hk={name:"autolink",tokenize:Wk};function Wk(e,t,r){let n=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return Ot(p)?(e.consume(p),o):p===64?r(p):c(p)}function o(p){return p===43||p===45||p===46||Rt(p)?(n=1,l(p)):c(p)}function l(p){return p===58?(e.consume(p),n=0,a):(p===43||p===45||p===46||Rt(p))&&n++<32?(e.consume(p),l):(n=0,c(p))}function a(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||ha(p)?r(p):(e.consume(p),a)}function c(p){return p===64?(e.consume(p),h):Rk(p)?(e.consume(p),c):r(p)}function h(p){return Rt(p)?u(p):r(p)}function u(p){return p===46?(e.consume(p),n=0,h):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||Rt(p))&&n++<63){const m=p===45?f:u;return e.consume(p),m}return r(p)}}const jo={partial:!0,tokenize:Uk};function Uk(e,t,r){return n;function n(s){return Le(s)?De(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||_e(s)?t(s):r(s)}}const Q0={continuation:{tokenize:Kk},exit:qk,name:"blockQuote",tokenize:Vk};function Vk(e,t,r){const n=this;return i;function i(o){if(o===62){const l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return r(o)}function s(o){return Le(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Kk(e,t,r){const n=this;return i;function i(o){return Le(o)?De(e,s,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(Q0,t,r)(o)}}function qk(e){e.exit("blockQuote")}const Z0={name:"characterEscape",tokenize:Yk};function Yk(e,t,r){return n;function n(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return Ik(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(s)}}const J0={name:"characterReference",tokenize:Xk};function Xk(e,t,r){const n=this;let i=0,s,o;return l;function l(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),a}function a(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=Rt,h(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=Mk,h):(e.enter("characterReferenceValue"),s=7,o=sh,h(u))}function h(u){if(u===59&&i){const f=e.exit("characterReferenceValue");return o===Rt&&!rf(n.sliceSerialize(f))?r(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(u)&&i++<s?(e.consume(u),h):r(u)}}const pm={partial:!0,tokenize:Qk},mm={concrete:!0,name:"codeFenced",tokenize:Gk};function Gk(e,t,r){const n=this,i={partial:!0,tokenize:L};let s=0,o=0,l;return a;function a(C){return c(C)}function c(C){const D=n.events[n.events.length-1];return s=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,l=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(C)}function h(C){return C===l?(o++,e.consume(C),h):o<3?r(C):(e.exit("codeFencedFenceSequence"),Le(C)?De(e,u,"whitespace")(C):u(C))}function u(C){return C===null||_e(C)?(e.exit("codeFencedFence"),n.interrupt?t(C):e.check(pm,g,N)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||_e(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(C)):Le(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),De(e,p,"whitespace")(C)):C===96&&C===l?r(C):(e.consume(C),f)}function p(C){return C===null||_e(C)?u(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||_e(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(C)):C===96&&C===l?r(C):(e.consume(C),m)}function g(C){return e.attempt(i,N,x)(C)}function x(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),_}function _(C){return s>0&&Le(C)?De(e,v,"linePrefix",s+1)(C):v(C)}function v(C){return C===null||_e(C)?e.check(pm,g,N)(C):(e.enter("codeFlowValue"),y(C))}function y(C){return C===null||_e(C)?(e.exit("codeFlowValue"),v(C)):(e.consume(C),y)}function N(C){return e.exit("codeFenced"),t(C)}function L(C,D,z){let F=0;return E;function E(T){return C.enter("lineEnding"),C.consume(T),C.exit("lineEnding"),H}function H(T){return C.enter("codeFencedFence"),Le(T)?De(C,B,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):B(T)}function B(T){return T===l?(C.enter("codeFencedFenceSequence"),I(T)):z(T)}function I(T){return T===l?(F++,C.consume(T),I):F>=o?(C.exit("codeFencedFenceSequence"),Le(T)?De(C,W,"whitespace")(T):W(T)):z(T)}function W(T){return T===null||_e(T)?(C.exit("codeFencedFence"),D(T)):z(T)}}}function Qk(e,t,r){const n=this;return i;function i(o){return o===null?r(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return n.parser.lazy[n.now().line]?r(o):t(o)}}const Tc={name:"codeIndented",tokenize:Jk},Zk={partial:!0,tokenize:eC};function Jk(e,t,r){const n=this;return i;function i(c){return e.enter("codeIndented"),De(e,s,"linePrefix",5)(c)}function s(c){const h=n.events[n.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(c):r(c)}function o(c){return c===null?a(c):_e(c)?e.attempt(Zk,o,a)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||_e(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),l)}function a(c){return e.exit("codeIndented"),t(c)}}function eC(e,t,r){const n=this;return i;function i(o){return n.parser.lazy[n.now().line]?r(o):_e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):De(e,s,"linePrefix",5)(o)}function s(o){const l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):_e(o)?i(o):r(o)}}const tC={name:"codeText",previous:nC,resolve:rC,tokenize:iC};function rC(e){let t=e.length-4,r=3,n,i;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)i===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(i=n):(n===t||e[n][1].type==="lineEnding")&&(e[i][1].type="codeTextData",n!==i+2&&(e[i][1].end=e[n-1][1].end,e.splice(i+2,n-i-2),t-=n-i-2,n=i+2),i=void 0);return e}function nC(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function iC(e,t,r){let n=0,i,s;return o;function o(u){return e.enter("codeText"),e.enter("codeTextSequence"),l(u)}function l(u){return u===96?(e.consume(u),n++,l):(e.exit("codeTextSequence"),a(u))}function a(u){return u===null?r(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),a):u===96?(s=e.enter("codeTextSequence"),i=0,h(u)):_e(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||_e(u)?(e.exit("codeTextData"),a(u)):(e.consume(u),c)}function h(u){return u===96?(e.consume(u),i++,h):i===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(s.type="codeTextData",c(u))}}class sC{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){const i=r||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&ks(this.left,n),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ks(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ks(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);ks(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ks(this.left,r.reverse())}}}function ks(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function ey(e){const t={};let r=-1,n,i,s,o,l,a,c;const h=new sC(e);for(;++r<h.length;){for(;r in t;)r=t[r];if(n=h.get(r),r&&n[1].type==="chunkFlow"&&h.get(r-1)[1].type==="listItemPrefix"&&(a=n[1]._tokenizer.events,s=0,s<a.length&&a[s][1].type==="lineEndingBlank"&&(s+=2),s<a.length&&a[s][1].type==="content"))for(;++s<a.length&&a[s][1].type!=="content";)a[s][1].type==="chunkText"&&(a[s][1]._isInFirstContentOfListItem=!0,s++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,oC(h,r)),r=t[r],c=!0);else if(n[1]._container){for(s=r,i=void 0;s--;)if(o=h.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(n[1].end={...h.get(i)[1].start},l=h.slice(i,r),l.unshift(n),h.splice(i,r-i+1,l))}}return cr(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function oC(e,t){const r=e.get(t)[1],n=e.get(t)[2];let i=t-1;const s=[];let o=r._tokenizer;o||(o=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,a=[],c={};let h,u,f=-1,p=r,m=0,g=0;const x=[g];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(h=n.sliceStream(p),p.next||h.push(null),u&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(h),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),u=p,p=p.next}for(p=r;++f<l.length;)l[f][0]==="exit"&&l[f-1][0]==="enter"&&l[f][1].type===l[f-1][1].type&&l[f][1].start.line!==l[f][1].end.line&&(g=f+1,x.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),f=x.length;f--;){const _=l.slice(x[f],x[f+1]),v=s.pop();a.push([v,v+_.length-1]),e.splice(v,2,_)}for(a.reverse(),f=-1;++f<a.length;)c[m+a[f][0]]=m+a[f][1],m+=a[f][1]-a[f][0]-1;return c}const lC={resolve:cC,tokenize:uC},aC={partial:!0,tokenize:hC};function cC(e){return ey(e),e}function uC(e,t){let r;return n;function n(l){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?s(l):_e(l)?e.check(aC,o,s)(l):(e.consume(l),i)}function s(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function hC(e,t,r){const n=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),De(e,s,"linePrefix")}function s(o){if(o===null||_e(o))return r(o);const l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(n.parser.constructs.flow,r,t)(o)}}function ty(e,t,r,n,i,s,o,l,a){const c=a||Number.POSITIVE_INFINITY;let h=0;return u;function u(_){return _===60?(e.enter(n),e.enter(i),e.enter(s),e.consume(_),e.exit(s),f):_===null||_===32||_===41||ha(_)?r(_):(e.enter(n),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(_))}function f(_){return _===62?(e.enter(s),e.consume(_),e.exit(s),e.exit(i),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===62?(e.exit("chunkString"),e.exit(l),f(_)):_===null||_===60||_e(_)?r(_):(e.consume(_),_===92?m:p)}function m(_){return _===60||_===62||_===92?(e.consume(_),p):p(_)}function g(_){return!h&&(_===null||_===41||Be(_))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(n),t(_)):h<c&&_===40?(e.consume(_),h++,g):_===41?(e.consume(_),h--,g):_===null||_===32||_===40||ha(_)?r(_):(e.consume(_),_===92?x:g)}function x(_){return _===40||_===41||_===92?(e.consume(_),g):g(_)}}function ry(e,t,r,n,i,s){const o=this;let l=0,a;return c;function c(p){return e.enter(n),e.enter(i),e.consume(p),e.exit(i),e.enter(s),h}function h(p){return l>999||p===null||p===91||p===93&&!a||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?r(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(n),t):_e(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===null||p===91||p===93||_e(p)||l++>999?(e.exit("chunkString"),h(p)):(e.consume(p),a||(a=!Le(p)),p===92?f:u)}function f(p){return p===91||p===92||p===93?(e.consume(p),l++,u):u(p)}}function ny(e,t,r,n,i,s){let o;return l;function l(f){return f===34||f===39||f===40?(e.enter(n),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,a):r(f)}function a(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(n),t):(e.enter(s),c(f))}function c(f){return f===o?(e.exit(s),a(o)):f===null?r(f):_e(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),De(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===o||f===null||_e(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?u:h)}function u(f){return f===o||f===92?(e.consume(f),h):h(f)}}function Js(e,t){let r;return n;function n(i){return _e(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r=!0,n):Le(i)?De(e,n,r?"linePrefix":"lineSuffix")(i):t(i)}}const dC={name:"definition",tokenize:pC},fC={partial:!0,tokenize:mC};function pC(e,t,r){const n=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return ry.call(n,e,l,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=Ar(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),a):r(p)}function a(p){return Be(p)?Js(e,c)(p):c(p)}function c(p){return ty(e,h,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function h(p){return e.attempt(fC,u,u)(p)}function u(p){return Le(p)?De(e,f,"whitespace")(p):f(p)}function f(p){return p===null||_e(p)?(e.exit("definition"),n.parser.defined.push(i),t(p)):r(p)}}function mC(e,t,r){return n;function n(l){return Be(l)?Js(e,i)(l):r(l)}function i(l){return ny(e,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Le(l)?De(e,o,"whitespace")(l):o(l)}function o(l){return l===null||_e(l)?t(l):r(l)}}const gC={name:"hardBreakEscape",tokenize:_C};function _C(e,t,r){return n;function n(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return _e(s)?(e.exit("hardBreakEscape"),t(s)):r(s)}}const vC={name:"headingAtx",resolve:yC,tokenize:xC};function yC(e,t){let r=e.length-2,n=3,i,s;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},s={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},cr(e,n,r-n+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function xC(e,t,r){let n=0;return i;function i(h){return e.enter("atxHeading"),s(h)}function s(h){return e.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&n++<6?(e.consume(h),o):h===null||Be(h)?(e.exit("atxHeadingSequence"),l(h)):r(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),a(h)):h===null||_e(h)?(e.exit("atxHeading"),t(h)):Le(h)?De(e,l,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function a(h){return h===35?(e.consume(h),a):(e.exit("atxHeadingSequence"),l(h))}function c(h){return h===null||h===35||Be(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),c)}}const wC=["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"],gm=["pre","script","style","textarea"],SC={concrete:!0,name:"htmlFlow",resolveTo:CC,tokenize:EC},bC={partial:!0,tokenize:LC},kC={partial:!0,tokenize:NC};function CC(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 EC(e,t,r){const n=this;let i,s,o,l,a;return c;function c(k){return h(k)}function h(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),u}function u(k){return k===33?(e.consume(k),f):k===47?(e.consume(k),s=!0,g):k===63?(e.consume(k),i=3,n.interrupt?t:w):Ot(k)?(e.consume(k),o=String.fromCharCode(k),x):r(k)}function f(k){return k===45?(e.consume(k),i=2,p):k===91?(e.consume(k),i=5,l=0,m):Ot(k)?(e.consume(k),i=4,n.interrupt?t:w):r(k)}function p(k){return k===45?(e.consume(k),n.interrupt?t:w):r(k)}function m(k){const me="CDATA[";return k===me.charCodeAt(l++)?(e.consume(k),l===me.length?n.interrupt?t:B:m):r(k)}function g(k){return Ot(k)?(e.consume(k),o=String.fromCharCode(k),x):r(k)}function x(k){if(k===null||k===47||k===62||Be(k)){const me=k===47,Q=o.toLowerCase();return!me&&!s&&gm.includes(Q)?(i=1,n.interrupt?t(k):B(k)):wC.includes(o.toLowerCase())?(i=6,me?(e.consume(k),_):n.interrupt?t(k):B(k)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(k):s?v(k):y(k))}return k===45||Rt(k)?(e.consume(k),o+=String.fromCharCode(k),x):r(k)}function _(k){return k===62?(e.consume(k),n.interrupt?t:B):r(k)}function v(k){return Le(k)?(e.consume(k),v):E(k)}function y(k){return k===47?(e.consume(k),E):k===58||k===95||Ot(k)?(e.consume(k),N):Le(k)?(e.consume(k),y):E(k)}function N(k){return k===45||k===46||k===58||k===95||Rt(k)?(e.consume(k),N):L(k)}function L(k){return k===61?(e.consume(k),C):Le(k)?(e.consume(k),L):y(k)}function C(k){return k===null||k===60||k===61||k===62||k===96?r(k):k===34||k===39?(e.consume(k),a=k,D):Le(k)?(e.consume(k),C):z(k)}function D(k){return k===a?(e.consume(k),a=null,F):k===null||_e(k)?r(k):(e.consume(k),D)}function z(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||Be(k)?L(k):(e.consume(k),z)}function F(k){return k===47||k===62||Le(k)?y(k):r(k)}function E(k){return k===62?(e.consume(k),H):r(k)}function H(k){return k===null||_e(k)?B(k):Le(k)?(e.consume(k),H):r(k)}function B(k){return k===45&&i===2?(e.consume(k),O):k===60&&i===1?(e.consume(k),V):k===62&&i===4?(e.consume(k),re):k===63&&i===3?(e.consume(k),w):k===93&&i===5?(e.consume(k),$):_e(k)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(bC,ce,I)(k)):k===null||_e(k)?(e.exit("htmlFlowData"),I(k)):(e.consume(k),B)}function I(k){return e.check(kC,W,ce)(k)}function W(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),T}function T(k){return k===null||_e(k)?I(k):(e.enter("htmlFlowData"),B(k))}function O(k){return k===45?(e.consume(k),w):B(k)}function V(k){return k===47?(e.consume(k),o="",P):B(k)}function P(k){if(k===62){const me=o.toLowerCase();return gm.includes(me)?(e.consume(k),re):B(k)}return Ot(k)&&o.length<8?(e.consume(k),o+=String.fromCharCode(k),P):B(k)}function $(k){return k===93?(e.consume(k),w):B(k)}function w(k){return k===62?(e.consume(k),re):k===45&&i===2?(e.consume(k),w):B(k)}function re(k){return k===null||_e(k)?(e.exit("htmlFlowData"),ce(k)):(e.consume(k),re)}function ce(k){return e.exit("htmlFlow"),t(k)}}function NC(e,t,r){const n=this;return i;function i(o){return _e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):r(o)}function s(o){return n.parser.lazy[n.now().line]?r(o):t(o)}}function LC(e,t,r){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(jo,t,r)}}const TC={name:"htmlText",tokenize:PC};function PC(e,t,r){const n=this;let i,s,o;return l;function l(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),a}function a(w){return w===33?(e.consume(w),c):w===47?(e.consume(w),L):w===63?(e.consume(w),y):Ot(w)?(e.consume(w),z):r(w)}function c(w){return w===45?(e.consume(w),h):w===91?(e.consume(w),s=0,m):Ot(w)?(e.consume(w),v):r(w)}function h(w){return w===45?(e.consume(w),p):r(w)}function u(w){return w===null?r(w):w===45?(e.consume(w),f):_e(w)?(o=u,V(w)):(e.consume(w),u)}function f(w){return w===45?(e.consume(w),p):u(w)}function p(w){return w===62?O(w):w===45?f(w):u(w)}function m(w){const re="CDATA[";return w===re.charCodeAt(s++)?(e.consume(w),s===re.length?g:m):r(w)}function g(w){return w===null?r(w):w===93?(e.consume(w),x):_e(w)?(o=g,V(w)):(e.consume(w),g)}function x(w){return w===93?(e.consume(w),_):g(w)}function _(w){return w===62?O(w):w===93?(e.consume(w),_):g(w)}function v(w){return w===null||w===62?O(w):_e(w)?(o=v,V(w)):(e.consume(w),v)}function y(w){return w===null?r(w):w===63?(e.consume(w),N):_e(w)?(o=y,V(w)):(e.consume(w),y)}function N(w){return w===62?O(w):y(w)}function L(w){return Ot(w)?(e.consume(w),C):r(w)}function C(w){return w===45||Rt(w)?(e.consume(w),C):D(w)}function D(w){return _e(w)?(o=D,V(w)):Le(w)?(e.consume(w),D):O(w)}function z(w){return w===45||Rt(w)?(e.consume(w),z):w===47||w===62||Be(w)?F(w):r(w)}function F(w){return w===47?(e.consume(w),O):w===58||w===95||Ot(w)?(e.consume(w),E):_e(w)?(o=F,V(w)):Le(w)?(e.consume(w),F):O(w)}function E(w){return w===45||w===46||w===58||w===95||Rt(w)?(e.consume(w),E):H(w)}function H(w){return w===61?(e.consume(w),B):_e(w)?(o=H,V(w)):Le(w)?(e.consume(w),H):F(w)}function B(w){return w===null||w===60||w===61||w===62||w===96?r(w):w===34||w===39?(e.consume(w),i=w,I):_e(w)?(o=B,V(w)):Le(w)?(e.consume(w),B):(e.consume(w),W)}function I(w){return w===i?(e.consume(w),i=void 0,T):w===null?r(w):_e(w)?(o=I,V(w)):(e.consume(w),I)}function W(w){return w===null||w===34||w===39||w===60||w===61||w===96?r(w):w===47||w===62||Be(w)?F(w):(e.consume(w),W)}function T(w){return w===47||w===62||Be(w)?F(w):r(w)}function O(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):r(w)}function V(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),P}function P(w){return Le(w)?De(e,$,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):$(w)}function $(w){return e.enter("htmlTextData"),o(w)}}const nf={name:"labelEnd",resolveAll:IC,resolveTo:AC,tokenize:BC},DC={tokenize:jC},RC={tokenize:OC},MC={tokenize:zC};function IC(e){let t=-1;const r=[];for(;++t<e.length;){const n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const i=n.type==="labelImage"?4:2;n.type="data",t+=i}}return e.length!==r.length&&cr(e,0,e.length,r),e}function AC(e,t){let r=e.length,n=0,i,s,o,l;for(;r--;)if(i=e[r][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[r][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[r][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=r,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(o=r);const a={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},h={type:"labelText",start:{...e[s+n+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",a,t],["enter",c,t]],l=wr(l,e.slice(s+1,s+n+3)),l=wr(l,[["enter",h,t]]),l=wr(l,Ha(t.parser.constructs.insideSpan.null,e.slice(s+n+4,o-3),t)),l=wr(l,[["exit",h,t],e[o-2],e[o-1],["exit",c,t]]),l=wr(l,e.slice(o+1)),l=wr(l,[["exit",a,t]]),cr(e,s,e.length,l),e}function BC(e,t,r){const n=this;let i=n.events.length,s,o;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){s=n.events[i][1];break}return l;function l(f){return s?s._inactive?u(f):(o=n.parser.defined.includes(Ar(n.sliceSerialize({start:s.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),a):r(f)}function a(f){return f===40?e.attempt(DC,h,o?h:u)(f):f===91?e.attempt(RC,h,o?c:u)(f):o?h(f):u(f)}function c(f){return e.attempt(MC,h,u)(f)}function h(f){return t(f)}function u(f){return s._balanced=!0,r(f)}}function jC(e,t,r){return n;function n(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),i}function i(u){return Be(u)?Js(e,s)(u):s(u)}function s(u){return u===41?h(u):ty(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function o(u){return Be(u)?Js(e,a)(u):h(u)}function l(u){return r(u)}function a(u){return u===34||u===39||u===40?ny(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):h(u)}function c(u){return Be(u)?Js(e,h)(u):h(u)}function h(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):r(u)}}function OC(e,t,r){const n=this;return i;function i(l){return ry.call(n,e,s,o,"reference","referenceMarker","referenceString")(l)}function s(l){return n.parser.defined.includes(Ar(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):r(l)}function o(l){return r(l)}}function zC(e,t,r){return n;function n(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):r(s)}}const FC={name:"labelStartImage",resolveAll:nf.resolveAll,tokenize:$C};function $C(e,t,r){const n=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),s}function s(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):r(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(l):t(l)}}const HC={name:"labelStartLink",resolveAll:nf.resolveAll,tokenize:WC};function WC(e,t,r){const n=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(o):t(o)}}const Pc={name:"lineEnding",tokenize:UC};function UC(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),De(e,t,"linePrefix")}}const Pl={name:"thematicBreak",tokenize:VC};function VC(e,t,r){let n=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,l(c)}function l(c){return c===i?(e.enter("thematicBreakSequence"),a(c)):n>=3&&(c===null||_e(c))?(e.exit("thematicBreak"),t(c)):r(c)}function a(c){return c===i?(e.consume(c),n++,a):(e.exit("thematicBreakSequence"),Le(c)?De(e,l,"whitespace")(c):l(c))}}const Kt={continuation:{tokenize:XC},exit:QC,name:"list",tokenize:YC},KC={partial:!0,tokenize:ZC},qC={partial:!0,tokenize:GC};function YC(e,t,r){const n=this,i=n.events[n.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(p){const m=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:sh(p)){if(n.containerState.type||(n.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Pl,r,c)(p):c(p);if(!n.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(p)}return r(p)}function a(p){return sh(p)&&++o<10?(e.consume(p),a):(!n.interrupt||o<2)&&(n.containerState.marker?p===n.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):r(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||p,e.check(jo,n.interrupt?r:h,e.attempt(KC,f,u))}function h(p){return n.containerState.initialBlankLine=!0,s++,f(p)}function u(p){return Le(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):r(p)}function f(p){return n.containerState.size=s+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function XC(e,t,r){const n=this;return n.containerState._closeFlow=void 0,e.check(jo,i,s);function i(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,De(e,t,"listItemIndent",n.containerState.size+1)(l)}function s(l){return n.containerState.furtherBlankLines||!Le(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(qC,t,o)(l))}function o(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,De(e,e.attempt(Kt,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function GC(e,t,r){const n=this;return De(e,i,"listItemIndent",n.containerState.size+1);function i(s){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?t(s):r(s)}}function QC(e){e.exit(this.containerState.type)}function ZC(e,t,r){const n=this;return De(e,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=n.events[n.events.length-1];return!Le(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):r(s)}}const _m={name:"setextUnderline",resolveTo:JC,tokenize:e2};function JC(e,t){let r=e.length,n,i,s;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(i=r)}else e[r][1].type==="content"&&e.splice(r,1),!s&&e[r][1].type==="definition"&&(s=r);const o={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[n][1],t]),e[n][1].end={...e[s][1].end}):e[n][1]=o,e.push(["exit",o,t]),e}function e2(e,t,r){const n=this;let i;return s;function s(c){let h=n.events.length,u;for(;h--;)if(n.events[h][1].type!=="lineEnding"&&n.events[h][1].type!=="linePrefix"&&n.events[h][1].type!=="content"){u=n.events[h][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||u)?(e.enter("setextHeadingLine"),i=c,o(c)):r(c)}function o(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),Le(c)?De(e,a,"lineSuffix")(c):a(c))}function a(c){return c===null||_e(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}const t2={tokenize:r2};function r2(e){const t=this,r=e.attempt(jo,n,e.attempt(this.parser.constructs.flowInitial,i,De(e,e.attempt(this.parser.constructs.flow,i,e.attempt(lC,i)),"linePrefix")));return r;function n(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const n2={resolveAll:sy()},i2=iy("string"),s2=iy("text");function iy(e){return{resolveAll:sy(e==="text"?o2:void 0),tokenize:t};function t(r){const n=this,i=this.parser.constructs[e],s=r.attempt(i,o,l);return o;function o(h){return c(h)?s(h):l(h)}function l(h){if(h===null){r.consume(h);return}return r.enter("data"),r.consume(h),a}function a(h){return c(h)?(r.exit("data"),s(h)):(r.consume(h),a)}function c(h){if(h===null)return!0;const u=i[h];let f=-1;if(u)for(;++f<u.length;){const p=u[f];if(!p.previous||p.previous.call(n,n.previous))return!0}return!1}}}function sy(e){return t;function t(r,n){let i=-1,s;for(;++i<=r.length;)s===void 0?r[i]&&r[i][1].type==="data"&&(s=i,i++):(!r[i]||r[i][1].type!=="data")&&(i!==s+2&&(r[s][1].end=r[i-1][1].end,r.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(r,n):r}}function o2(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const n=e[r-1][1],i=t.sliceStream(n);let s=i.length,o=-1,l=0,a;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(c===-2)a=!0,l++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){const c={type:r===e.length||a||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:n.start._bufferIndex+o,_index:n.start._index+s,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(e.splice(r,0,["enter",c,t],["exit",c,t]),r+=2)}r++}return e}const l2={42:Kt,43:Kt,45:Kt,48:Kt,49:Kt,50:Kt,51:Kt,52:Kt,53:Kt,54:Kt,55:Kt,56:Kt,57:Kt,62:Q0},a2={91:dC},c2={[-2]:Tc,[-1]:Tc,32:Tc},u2={35:vC,42:Pl,45:[_m,Pl],60:SC,61:_m,95:Pl,96:mm,126:mm},h2={38:J0,92:Z0},d2={[-5]:Pc,[-4]:Pc,[-3]:Pc,33:FC,38:J0,42:oh,60:[Hk,TC],91:HC,92:[gC,Z0],93:nf,95:oh,96:tC},f2={null:[oh,n2]},p2={null:[42,95]},m2={null:[]},g2=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:p2,contentInitial:a2,disable:m2,document:l2,flow:u2,flowInitial:c2,insideSpan:f2,string:h2,text:d2},Symbol.toStringTag,{value:"Module"}));function _2(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const i={},s=[];let o=[],l=[];const a={attempt:D(L),check:D(C),consume:v,enter:y,exit:N,interrupt:D(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:u};let h=t.tokenize.call(c,a);return t.resolveAll&&s.push(t),c;function u(H){return o=wr(o,H),x(),o[o.length-1]!==null?[]:(z(t,0),c.events=Ha(s,c.events,c),c.events)}function f(H,B){return y2(p(H),B)}function p(H){return v2(o,H)}function m(){const{_bufferIndex:H,_index:B,line:I,column:W,offset:T}=n;return{_bufferIndex:H,_index:B,line:I,column:W,offset:T}}function g(H){i[H.line]=H.column,E()}function x(){let H;for(;n._index<o.length;){const B=o[n._index];if(typeof B=="string")for(H=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===H&&n._bufferIndex<B.length;)_(B.charCodeAt(n._bufferIndex));else _(B)}}function _(H){h=h(H)}function v(H){_e(H)?(n.line++,n.column=1,n.offset+=H===-3?2:1,E()):H!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===o[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=H}function y(H,B){const I=B||{};return I.type=H,I.start=m(),c.events.push(["enter",I,c]),l.push(I),I}function N(H){const B=l.pop();return B.end=m(),c.events.push(["exit",B,c]),B}function L(H,B){z(H,B.from)}function C(H,B){B.restore()}function D(H,B){return I;function I(W,T,O){let V,P,$,w;return Array.isArray(W)?ce(W):"tokenize"in W?ce([W]):re(W);function re(J){return X;function X(ae){const ue=ae!==null&&J[ae],ge=ae!==null&&J.null,M=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return ce(M)(ae)}}function ce(J){return V=J,P=0,J.length===0?O:k(J[P])}function k(J){return X;function X(ae){return w=F(),$=J,J.partial||(c.currentConstruct=J),J.name&&c.parser.constructs.disable.null.includes(J.name)?Q():J.tokenize.call(B?Object.assign(Object.create(c),B):c,a,me,Q)(ae)}}function me(J){return H($,w),T}function Q(J){return w.restore(),++P<V.length?k(V[P]):O}}}function z(H,B){H.resolveAll&&!s.includes(H)&&s.push(H),H.resolve&&cr(c.events,B,c.events.length-B,H.resolve(c.events.slice(B),c)),H.resolveTo&&(c.events=H.resolveTo(c.events,c))}function F(){const H=m(),B=c.previous,I=c.currentConstruct,W=c.events.length,T=Array.from(l);return{from:W,restore:O};function O(){n=H,c.previous=B,c.currentConstruct=I,c.events.length=W,l=T,E()}}function E(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function v2(e,t){const r=t.start._index,n=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(r===i)o=[e[r].slice(n,s)];else{if(o=e.slice(r,i),n>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(n):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function y2(e,t){let r=-1;const n=[];let i;for(;++r<e.length;){const s=e[r];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
69
|
+
`;break}case-3:{o=`\r
|
|
70
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,n.push(o)}return n.join("")}function x2(e){const n={constructs:X0([g2,...(e||{}).extensions||[]]),content:i(Ak),defined:[],document:i(jk),flow:i(t2),lazy:{},string:i(i2),text:i(s2)};return n;function i(s){return o;function o(l){return _2(n,s,l)}}}function w2(e){for(;!ey(e););return e}const vm=/[\0\t\n\r]/g;function S2(){let e=1,t="",r=!0,n;return i;function i(s,o,l){const a=[];let c,h,u,f,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),u=0,t="",r&&(s.charCodeAt(0)===65279&&u++,r=void 0);u<s.length;){if(vm.lastIndex=u,c=vm.exec(s),f=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(f),!c){t=s.slice(u);break}if(p===10&&u===f&&n)a.push(-3),n=void 0;else switch(n&&(a.push(-5),n=void 0),u<f&&(a.push(s.slice(u,f)),e+=f-u),p){case 0:{a.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,a.push(-2);e++<h;)a.push(-1);break}case 10:{a.push(-4),e=1;break}default:n=!0,e=1}u=f+1}return l&&(n&&a.push(-5),t&&a.push(t),a.push(null)),a}}const b2=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function k2(e){return e.replace(b2,C2)}function C2(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const i=r.charCodeAt(1),s=i===120||i===88;return G0(r.slice(s?2:1),s?16:10)}return rf(r)||e}const oy={}.hasOwnProperty;function E2(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),N2(r)(w2(x2(r).document().write(S2()(e,t,!0))))}function N2(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(jr),autolinkProtocol:F,autolinkEmail:F,atxHeading:s(Ut),blockQuote:s(ge),characterEscape:F,characterReference:F,codeFenced:s(M),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(M,o),codeText:s(ke,o),codeTextData:F,data:F,codeFlowValue:F,definition:s(Se),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Ae),hardBreakEscape:s(fr),hardBreakTrailing:s(fr),htmlFlow:s(Jt,o),htmlFlowData:F,htmlText:s(Jt,o),htmlTextData:F,image:s(Jr),label:o,link:s(jr),listItem:s(er),listItemValue:f,listOrdered:s(Or,u),listUnordered:s(Or),paragraph:s(pr),reference:k,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Ut),strong:s(Pe),thematicBreak:s(pe)},exit:{atxHeading:a(),atxHeadingSequence:L,autolink:a(),autolinkEmail:ue,autolinkProtocol:ae,blockQuote:a(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:Q,characterReferenceMarkerNumeric:Q,characterReferenceValue:J,characterReference:X,codeFenced:a(x),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:a(_),codeText:a(T),codeTextData:E,data:E,definition:a(),definitionDestinationString:N,definitionLabelString:v,definitionTitleString:y,emphasis:a(),hardBreakEscape:a(B),hardBreakTrailing:a(B),htmlFlow:a(I),htmlFlowData:E,htmlText:a(W),htmlTextData:E,image:a(V),label:$,labelText:P,lineEnding:H,link:a(O),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:me,resourceDestinationString:w,resourceTitleString:re,resource:ce,setextHeading:a(z),setextHeadingLineSequence:D,setextHeadingText:C,strong:a(),thematicBreak:a()}};ly(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(R){let q={type:"root",children:[]};const A={stack:[q],tokenStack:[],config:t,enter:l,exit:c,buffer:o,resume:h,data:r},j=[];let U=-1;for(;++U<R.length;)if(R[U][1].type==="listOrdered"||R[U][1].type==="listUnordered")if(R[U][0]==="enter")j.push(U);else{const Y=j.pop();U=i(R,Y,U)}for(U=-1;++U<R.length;){const Y=t[R[U][0]];oy.call(Y,R[U][1].type)&&Y[R[U][1].type].call(Object.assign({sliceSerialize:R[U][2].sliceSerialize},A),R[U][1])}if(A.tokenStack.length>0){const Y=A.tokenStack[A.tokenStack.length-1];(Y[1]||ym).call(A,void 0,Y[0])}for(q.position={start:vn(R.length>0?R[0][1].start:{line:1,column:1,offset:0}),end:vn(R.length>0?R[R.length-2][1].end:{line:1,column:1,offset:0})},U=-1;++U<t.transforms.length;)q=t.transforms[U](q)||q;return q}function i(R,q,A){let j=q-1,U=-1,Y=!1,ee,se,ne,fe;for(;++j<=A;){const le=R[j];switch(le[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{le[0]==="enter"?U++:U--,fe=void 0;break}case"lineEndingBlank":{le[0]==="enter"&&(ee&&!fe&&!U&&!ne&&(ne=j),fe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fe=void 0}if(!U&&le[0]==="enter"&&le[1].type==="listItemPrefix"||U===-1&&le[0]==="exit"&&(le[1].type==="listUnordered"||le[1].type==="listOrdered")){if(ee){let ye=j;for(se=void 0;ye--;){const be=R[ye];if(be[1].type==="lineEnding"||be[1].type==="lineEndingBlank"){if(be[0]==="exit")continue;se&&(R[se][1].type="lineEndingBlank",Y=!0),be[1].type="lineEnding",se=ye}else if(!(be[1].type==="linePrefix"||be[1].type==="blockQuotePrefix"||be[1].type==="blockQuotePrefixWhitespace"||be[1].type==="blockQuoteMarker"||be[1].type==="listItemIndent"))break}ne&&(!se||ne<se)&&(ee._spread=!0),ee.end=Object.assign({},se?R[se][1].start:le[1].end),R.splice(se||j,0,["exit",ee,le[2]]),j++,A++}if(le[1].type==="listItemPrefix"){const ye={type:"listItem",_spread:!1,start:Object.assign({},le[1].start),end:void 0};ee=ye,R.splice(j,0,["enter",ye,le[2]]),j++,A++,ne=void 0,fe=!0}}}return R[q][1]._spread=Y,A}function s(R,q){return A;function A(j){l.call(this,R(j),j),q&&q.call(this,j)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(R,q,A){this.stack[this.stack.length-1].children.push(R),this.stack.push(R),this.tokenStack.push([q,A||void 0]),R.position={start:vn(q.start),end:void 0}}function a(R){return q;function q(A){R&&R.call(this,A),c.call(this,A)}}function c(R,q){const A=this.stack.pop(),j=this.tokenStack.pop();if(j)j[0].type!==R.type&&(q?q.call(this,R,j[0]):(j[1]||ym).call(this,R,j[0]));else throw new Error("Cannot close `"+R.type+"` ("+Zs({start:R.start,end:R.end})+"): it’s not open");A.position.end=vn(R.end)}function h(){return tf(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function f(R){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(R),10),this.data.expectingFirstListItemValue=void 0}}function p(){const R=this.resume(),q=this.stack[this.stack.length-1];q.lang=R}function m(){const R=this.resume(),q=this.stack[this.stack.length-1];q.meta=R}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R.replace(/(\r?\n|\r)$/g,"")}function v(R){const q=this.resume(),A=this.stack[this.stack.length-1];A.label=q,A.identifier=Ar(this.sliceSerialize(R)).toLowerCase()}function y(){const R=this.resume(),q=this.stack[this.stack.length-1];q.title=R}function N(){const R=this.resume(),q=this.stack[this.stack.length-1];q.url=R}function L(R){const q=this.stack[this.stack.length-1];if(!q.depth){const A=this.sliceSerialize(R).length;q.depth=A}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function D(R){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(R).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function F(R){const A=this.stack[this.stack.length-1].children;let j=A[A.length-1];(!j||j.type!=="text")&&(j=K(),j.position={start:vn(R.start),end:void 0},A.push(j)),this.stack.push(j)}function E(R){const q=this.stack.pop();q.value+=this.sliceSerialize(R),q.position.end=vn(R.end)}function H(R){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const A=q.children[q.children.length-1];A.position.end=vn(R.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(F.call(this,R),E.call(this,R))}function B(){this.data.atHardBreak=!0}function I(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R}function W(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R}function T(){const R=this.resume(),q=this.stack[this.stack.length-1];q.value=R}function O(){const R=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";R.type+="Reference",R.referenceType=q,delete R.url,delete R.title}else delete R.identifier,delete R.label;this.data.referenceType=void 0}function V(){const R=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";R.type+="Reference",R.referenceType=q,delete R.url,delete R.title}else delete R.identifier,delete R.label;this.data.referenceType=void 0}function P(R){const q=this.sliceSerialize(R),A=this.stack[this.stack.length-2];A.label=k2(q),A.identifier=Ar(q).toLowerCase()}function $(){const R=this.stack[this.stack.length-1],q=this.resume(),A=this.stack[this.stack.length-1];if(this.data.inReference=!0,A.type==="link"){const j=R.children;A.children=j}else A.alt=q}function w(){const R=this.resume(),q=this.stack[this.stack.length-1];q.url=R}function re(){const R=this.resume(),q=this.stack[this.stack.length-1];q.title=R}function ce(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function me(R){const q=this.resume(),A=this.stack[this.stack.length-1];A.label=q,A.identifier=Ar(this.sliceSerialize(R)).toLowerCase(),this.data.referenceType="full"}function Q(R){this.data.characterReferenceType=R.type}function J(R){const q=this.sliceSerialize(R),A=this.data.characterReferenceType;let j;A?(j=G0(q,A==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):j=rf(q);const U=this.stack[this.stack.length-1];U.value+=j}function X(R){const q=this.stack.pop();q.position.end=vn(R.end)}function ae(R){E.call(this,R);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(R)}function ue(R){E.call(this,R);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(R)}function ge(){return{type:"blockquote",children:[]}}function M(){return{type:"code",lang:null,meta:null,value:""}}function ke(){return{type:"inlineCode",value:""}}function Se(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ae(){return{type:"emphasis",children:[]}}function Ut(){return{type:"heading",depth:0,children:[]}}function fr(){return{type:"break"}}function Jt(){return{type:"html",value:""}}function Jr(){return{type:"image",title:null,url:"",alt:null}}function jr(){return{type:"link",title:null,url:"",children:[]}}function Or(R){return{type:"list",ordered:R.type==="listOrdered",start:null,spread:R._spread,children:[]}}function er(R){return{type:"listItem",spread:R._spread,checked:null,children:[]}}function pr(){return{type:"paragraph",children:[]}}function Pe(){return{type:"strong",children:[]}}function K(){return{type:"text",value:""}}function pe(){return{type:"thematicBreak"}}}function vn(e){return{line:e.line,column:e.column,offset:e.offset}}function ly(e,t){let r=-1;for(;++r<t.length;){const n=t[r];Array.isArray(n)?ly(e,n):L2(e,n)}}function L2(e,t){let r;for(r in t)if(oy.call(t,r))switch(r){case"canContainEols":{const n=t[r];n&&e[r].push(...n);break}case"transforms":{const n=t[r];n&&e[r].push(...n);break}case"enter":case"exit":{const n=t[r];n&&Object.assign(e[r],n);break}}}function ym(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Zs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Zs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Zs({start:t.start,end:t.end})+") is still open")}function T2(e){const t=this;t.parser=r;function r(n){return E2(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function P2(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function D2(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
71
|
+
`}]}function R2(e,t){const r=t.value?t.value+`
|
|
72
|
+
`:"",n={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(n.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function M2(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function I2(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function A2(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),i=ds(n.toLowerCase()),s=e.footnoteOrder.indexOf(n);let o,l=e.footnoteCounts.get(n);l===void 0?(l=0,e.footnoteOrder.push(n),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(n,l);const a={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,a);const c={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,c),e.applyData(t,c)}function B2(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function j2(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function ay(e,t){const r=t.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=n:i.push({type:"text",value:n}),i}function O2(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return ay(e,t);const i={src:ds(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function z2(e,t){const r={src:ds(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)}function F2(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)}function $2(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return ay(e,t);const i={href:ds(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function H2(e,t){const r={href:ds(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function W2(e,t,r){const n=e.all(t),i=r?U2(r):cy(t),s={},o=[];if(typeof t.checked=="boolean"){const h=n[0];let u;h&&h.type==="element"&&h.tagName==="p"?u=h:(u={type:"element",tagName:"p",properties:{},children:[]},n.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<n.length;){const h=n[l];(i||l!==0||h.type!=="element"||h.tagName!=="p")&&o.push({type:"text",value:`
|
|
73
|
+
`}),h.type==="element"&&h.tagName==="p"&&!i?o.push(...h.children):o.push(h)}const a=n[n.length-1];a&&(i||a.type!=="element"||a.tagName!=="p")&&o.push({type:"text",value:`
|
|
74
|
+
`});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function U2(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let n=-1;for(;!t&&++n<r.length;)t=cy(r[n])}return t}function cy(e){const t=e.spread;return t??e.children.length>1}function V2(e,t){const r={},n=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++i<n.length;){const o=n[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(t,s),e.applyData(t,s)}function K2(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function q2(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function Y2(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function X2(e,t){const r=e.all(t),n=r.shift(),i=[];if(n){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],o),i.push(o)}if(r.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},l=Qd(t.children[1]),a=H0(t.children[t.children.length-1]);l&&a&&(o.position={start:l,end:a}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function G2(e,t,r){const n=r?r.children:void 0,s=(n?n.indexOf(t):1)===0?"th":"td",o=r&&r.type==="table"?r.align:void 0,l=o?o.length:t.children.length;let a=-1;const c=[];for(;++a<l;){const u=t.children[a],f={},p=o?o[a]:void 0;p&&(f.align=p);let m={type:"element",tagName:s,properties:f,children:[]};u&&(m.children=e.all(u),e.patch(u,m),m=e.applyData(u,m)),c.push(m)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,h),e.applyData(t,h)}function Q2(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const xm=9,wm=32;function Z2(e){const t=String(e),r=/\r?\n|\r/g;let n=r.exec(t),i=0;const s=[];for(;n;)s.push(Sm(t.slice(i,n.index),i>0,!0),n[0]),i=n.index+n[0].length,n=r.exec(t);return s.push(Sm(t.slice(i),i>0,!1)),s.join("")}function Sm(e,t,r){let n=0,i=e.length;if(t){let s=e.codePointAt(n);for(;s===xm||s===wm;)n++,s=e.codePointAt(n)}if(r){let s=e.codePointAt(i-1);for(;s===xm||s===wm;)i--,s=e.codePointAt(i-1)}return i>n?e.slice(n,i):""}function J2(e,t){const r={type:"text",value:Z2(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function eE(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const tE={blockquote:P2,break:D2,code:R2,delete:M2,emphasis:I2,footnoteReference:A2,heading:B2,html:j2,imageReference:O2,image:z2,inlineCode:F2,linkReference:$2,link:H2,listItem:W2,list:V2,paragraph:K2,root:q2,strong:Y2,table:X2,tableCell:Q2,tableRow:G2,text:J2,thematicBreak:eE,toml:ll,yaml:ll,definition:ll,footnoteDefinition:ll};function ll(){}const uy=-1,Wa=0,eo=1,da=2,sf=3,of=4,lf=5,af=6,hy=7,dy=8,bm=typeof self=="object"?self:globalThis,rE=(e,t)=>{const r=(i,s)=>(e.set(s,i),i),n=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Wa:case uy:return r(o,i);case eo:{const l=r([],i);for(const a of o)l.push(n(a));return l}case da:{const l=r({},i);for(const[a,c]of o)l[n(a)]=n(c);return l}case sf:return r(new Date(o),i);case of:{const{source:l,flags:a}=o;return r(new RegExp(l,a),i)}case lf:{const l=r(new Map,i);for(const[a,c]of o)l.set(n(a),n(c));return l}case af:{const l=r(new Set,i);for(const a of o)l.add(n(a));return l}case hy:{const{name:l,message:a}=o;return r(new bm[l](a),i)}case dy:return r(BigInt(o),i);case"BigInt":return r(Object(BigInt(o)),i);case"ArrayBuffer":return r(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return r(new DataView(l),o)}}return r(new bm[s](o),i)};return n},km=e=>rE(new Map,e)(0),Ni="",{toString:nE}={},{keys:iE}=Object,Cs=e=>{const t=typeof e;if(t!=="object"||!e)return[Wa,t];const r=nE.call(e).slice(8,-1);switch(r){case"Array":return[eo,Ni];case"Object":return[da,Ni];case"Date":return[sf,Ni];case"RegExp":return[of,Ni];case"Map":return[lf,Ni];case"Set":return[af,Ni];case"DataView":return[eo,r]}return r.includes("Array")?[eo,r]:r.includes("Error")?[hy,r]:[da,r]},al=([e,t])=>e===Wa&&(t==="function"||t==="symbol"),sE=(e,t,r,n)=>{const i=(o,l)=>{const a=n.push(o)-1;return r.set(l,a),a},s=o=>{if(r.has(o))return r.get(o);let[l,a]=Cs(o);switch(l){case Wa:{let h=o;switch(a){case"bigint":l=dy,h=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);h=null;break;case"undefined":return i([uy],o)}return i([l,h],o)}case eo:{if(a){let f=o;return a==="DataView"?f=new Uint8Array(o.buffer):a==="ArrayBuffer"&&(f=new Uint8Array(o)),i([a,[...f]],o)}const h=[],u=i([l,h],o);for(const f of o)h.push(s(f));return u}case da:{if(a)switch(a){case"BigInt":return i([a,o.toString()],o);case"Boolean":case"Number":case"String":return i([a,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const h=[],u=i([l,h],o);for(const f of iE(o))(e||!al(Cs(o[f])))&&h.push([s(f),s(o[f])]);return u}case sf:return i([l,o.toISOString()],o);case of:{const{source:h,flags:u}=o;return i([l,{source:h,flags:u}],o)}case lf:{const h=[],u=i([l,h],o);for(const[f,p]of o)(e||!(al(Cs(f))||al(Cs(p))))&&h.push([s(f),s(p)]);return u}case af:{const h=[],u=i([l,h],o);for(const f of o)(e||!al(Cs(f)))&&h.push(s(f));return u}}const{message:c}=o;return i([l,{name:a,message:c}],o)};return s},Cm=(e,{json:t,lossy:r}={})=>{const n=[];return sE(!(t||r),!!t,new Map,n)(e),n},fa=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?km(Cm(e,t)):structuredClone(e):(e,t)=>km(Cm(e,t));function oE(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function lE(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function aE(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||oE,n=e.options.footnoteBackLabel||lE,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let a=-1;for(;++a<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[a]);if(!c)continue;const h=e.all(c),u=String(c.identifier).toUpperCase(),f=ds(u.toLowerCase());let p=0;const m=[],g=e.footnoteCounts.get(u);for(;g!==void 0&&++p<=g;){m.length>0&&m.push({type:"text",value:" "});let v=typeof r=="string"?r:r(a,p);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(a,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const x=h[h.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const v=x.children[x.children.length-1];v&&v.type==="text"?v.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...m)}else h.push(...m);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(h,!0)};e.patch(c,_),l.push(_)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...fa(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
75
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
76
|
+
`}]}}const Ua=function(e){if(e==null)return dE;if(typeof e=="function")return Va(e);if(typeof e=="object")return Array.isArray(e)?cE(e):uE(e);if(typeof e=="string")return hE(e);throw new Error("Expected function, string, or object as test")};function cE(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=Ua(e[r]);return Va(n);function n(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function uE(e){const t=e;return Va(r);function r(n){const i=n;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function hE(e){return Va(t);function t(r){return r&&r.type===e}}function Va(e){return t;function t(r,n,i){return!!(fE(r)&&e.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function dE(){return!0}function fE(e){return e!==null&&typeof e=="object"&&"type"in e}const fy=[],pE=!0,lh=!1,mE="skip";function py(e,t,r,n){let i;typeof t=="function"&&typeof r!="function"?(n=r,r=t):i=t;const s=Ua(i),o=n?-1:1;l(e,void 0,[])();function l(a,c,h){const u=a&&typeof a=="object"?a:{};if(typeof u.type=="string"){const p=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(a.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=fy,m,g,x;if((!t||s(a,c,h[h.length-1]||void 0))&&(p=gE(r(a,h)),p[0]===lh))return p;if("children"in a&&a.children){const _=a;if(_.children&&p[0]!==mE)for(g=(n?_.children.length:-1)+o,x=h.concat(_);g>-1&&g<_.children.length;){const v=_.children[g];if(m=l(v,g,x)(),m[0]===lh)return m;g=typeof m[1]=="number"?m[1]:g+o}}return p}}}function gE(e){return Array.isArray(e)?e:typeof e=="number"?[pE,e]:e==null?fy:[e]}function Ka(e,t,r,n){let i,s,o;typeof t=="function"&&typeof r!="function"?(s=void 0,o=t,i=r):(s=t,o=r,i=n),py(e,s,l,i);function l(a,c){const h=c[c.length-1],u=h?h.children.indexOf(a):void 0;return o(a,u,h)}}const ah={}.hasOwnProperty,_E={};function vE(e,t){const r=t||_E,n=new Map,i=new Map,s=new Map,o={...tE,...r.handlers},l={all:c,applyData:xE,definitionById:n,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:a,options:r,patch:yE,wrap:SE};return Ka(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const u=h.type==="definition"?n:i,f=String(h.identifier).toUpperCase();u.has(f)||u.set(f,h)}}),l;function a(h,u){const f=h.type,p=l.handlers[f];if(ah.call(l.handlers,f)&&p)return p(l,h,u);if(l.options.passThrough&&l.options.passThrough.includes(f)){if("children"in h){const{children:g,...x}=h,_=fa(x);return _.children=l.all(h),_}return fa(h)}return(l.options.unknownHandler||wE)(l,h,u)}function c(h){const u=[];if("children"in h){const f=h.children;let p=-1;for(;++p<f.length;){const m=l.one(f[p],h);if(m){if(p&&f[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Em(m.value)),!Array.isArray(m)&&m.type==="element")){const g=m.children[0];g&&g.type==="text"&&(g.value=Em(g.value))}Array.isArray(m)?u.push(...m):u.push(m)}}}return u}}function yE(e,t){e.position&&(t.position=lk(e))}function xE(e,t){let r=t;if(e&&e.data){const n=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof n=="string")if(r.type==="element")r.tagName=n;else{const o="children"in r?r.children:[r];r={type:"element",tagName:n,properties:{},children:o}}r.type==="element"&&s&&Object.assign(r.properties,fa(s)),"children"in r&&r.children&&i!==null&&i!==void 0&&(r.children=i)}return r}function wE(e,t){const r=t.data||{},n="value"in t&&!(ah.call(r,"hProperties")||ah.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SE(e,t){const r=[];let n=-1;for(t&&r.push({type:"text",value:`
|
|
77
|
+
`});++n<e.length;)n&&r.push({type:"text",value:`
|
|
78
|
+
`}),r.push(e[n]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
79
|
+
`}),r}function Em(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function Nm(e,t){const r=vE(e,t),n=r.one(e,void 0),i=aE(r),s=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
80
|
+
`},i),s}function bE(e,t){return e&&"run"in e?async function(r,n){const i=Nm(r,{file:n,...t});await e.run(i,n)}:function(r,n){return Nm(r,{file:n,...e||t})}}function Lm(e){if(e)throw e}var Dl=Object.prototype.hasOwnProperty,my=Object.prototype.toString,Tm=Object.defineProperty,Pm=Object.getOwnPropertyDescriptor,Dm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):my.call(t)==="[object Array]"},Rm=function(t){if(!t||my.call(t)!=="[object Object]")return!1;var r=Dl.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&Dl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var i;for(i in t);return typeof i>"u"||Dl.call(t,i)},Mm=function(t,r){Tm&&r.name==="__proto__"?Tm(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},Im=function(t,r){if(r==="__proto__")if(Dl.call(t,r)){if(Pm)return Pm(t,r).value}else return;return t[r]},kE=function e(){var t,r,n,i,s,o,l=arguments[0],a=1,c=arguments.length,h=!1;for(typeof l=="boolean"&&(h=l,l=arguments[1]||{},a=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});a<c;++a)if(t=arguments[a],t!=null)for(r in t)n=Im(l,r),i=Im(t,r),l!==i&&(h&&i&&(Rm(i)||(s=Dm(i)))?(s?(s=!1,o=n&&Dm(n)?n:[]):o=n&&Rm(n)?n:{},Mm(l,{name:r,newValue:e(h,o,i)})):typeof i<"u"&&Mm(l,{name:r,newValue:i}));return l};const Dc=Qh(kE);function ch(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function CE(){const e=[],t={run:r,use:n};return t;function r(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...i);function l(a,...c){const h=e[++s];let u=-1;if(a){o(a);return}for(;++u<i.length;)(c[u]===null||c[u]===void 0)&&(c[u]=i[u]);i=c,h?EE(h,l)(...c):o(null,...c)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function EE(e,t){let r;return n;function n(...o){const l=e.length>o.length;let a;l&&o.push(i);try{a=e.apply(this,o)}catch(c){const h=c;if(l&&r)throw h;return i(h)}l||(a&&a.then&&typeof a.then=="function"?a.then(s,i):a instanceof Error?i(a):s(a))}function i(o,...l){r||(r=!0,t(o,...l))}function s(o){i(null,o)}}const Ur={basename:NE,dirname:LE,extname:TE,join:PE,sep:"/"};function NE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Oo(e);let r=0,n=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){r=i+1;break}}else n<0&&(s=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){r=i+1;break}}else o<0&&(s=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(n=i):(l=-1,n=o));return r===n?n=o:n<0&&(n=e.length),e.slice(r,n)}function LE(e){if(Oo(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function TE(e){Oo(e);let t=e.length,r=-1,n=0,i=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){n=t+1;break}continue}r<0&&(o=!0,r=t+1),l===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||r<0||s===0||s===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function PE(...e){let t=-1,r;for(;++t<e.length;)Oo(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":DE(r)}function DE(e){Oo(e);const t=e.codePointAt(0)===47;let r=RE(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function RE(e,t){let r="",n=0,i=-1,s=0,o=-1,l,a;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(a=r.lastIndexOf("/"),a!==r.length-1){a<0?(r="",n=0):(r=r.slice(0,a),n=r.length-1-r.lastIndexOf("/")),i=o,s=0;continue}}else if(r.length>0){r="",n=0,i=o,s=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,o):r=e.slice(i+1,o),n=o-i-1;i=o,s=0}else l===46&&s>-1?s++:s=-1}return r}function Oo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ME={cwd:IE};function IE(){return"/"}function uh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function AE(e){if(typeof e=="string")e=new URL(e);else if(!uh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return BE(e)}function BE(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Rc=["history","path","basename","stem","extname","dirname"];class gy{constructor(t){let r;t?uh(t)?r={path:t}:typeof t=="string"||jE(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":ME.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Rc.length;){const s=Rc[n];s in r&&r[s]!==void 0&&r[s]!==null&&(this[s]=s==="history"?[...r[s]]:r[s])}let i;for(i in r)Rc.includes(i)||(this[i]=r[i])}get basename(){return typeof this.path=="string"?Ur.basename(this.path):void 0}set basename(t){Ic(t,"basename"),Mc(t,"basename"),this.path=Ur.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ur.dirname(this.path):void 0}set dirname(t){Am(this.basename,"dirname"),this.path=Ur.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ur.extname(this.path):void 0}set extname(t){if(Mc(t,"extname"),Am(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ur.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){uh(t)&&(t=AE(t)),Ic(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ur.basename(this.path,this.extname):void 0}set stem(t){Ic(t,"stem"),Mc(t,"stem"),this.path=Ur.join(this.dirname||"",t+(this.extname||""))}fail(t,r,n){const i=this.message(t,r,n);throw i.fatal=!0,i}info(t,r,n){const i=this.message(t,r,n);return i.fatal=void 0,i}message(t,r,n){const i=new It(t,r,n);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Mc(e,t){if(e&&e.includes(Ur.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ur.sep+"`")}function Ic(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Am(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function jE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const OE=function(e){const n=this.constructor.prototype,i=n[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,n),s},zE={}.hasOwnProperty;class cf extends OE{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=CE()}copy(){const t=new cf;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];t.use(...n)}return t.data(Dc(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(jc("data",this.frozen),this.namespace[t]=r,this):zE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(jc("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const i=r.call(t,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=cl(t),n=this.parser||this.Parser;return Ac("parse",n),n(String(r),r)}process(t,r){const n=this;return this.freeze(),Ac("process",this.parser||this.Parser),Bc("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(s,o){const l=cl(t),a=n.parse(l);n.run(a,l,function(h,u,f){if(h||!u||!f)return c(h);const p=u,m=n.stringify(p,f);HE(m)?f.value=m:f.result=m,c(h,f)});function c(h,u){h||!u?o(h):s?s(u):r(void 0,u)}}}processSync(t){let r=!1,n;return this.freeze(),Ac("processSync",this.parser||this.Parser),Bc("processSync",this.compiler||this.Compiler),this.process(t,i),jm("processSync","process",r),n;function i(s,o){r=!0,Lm(s),n=o}}run(t,r,n){Bm(t),this.freeze();const i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?s(void 0,n):new Promise(s);function s(o,l){const a=cl(r);i.run(t,a,c);function c(h,u,f){const p=u||t;h?l(h):o?o(p):n(void 0,p,f)}}}runSync(t,r){let n=!1,i;return this.run(t,r,s),jm("runSync","run",n),i;function s(o,l){Lm(o),i=l,n=!0}}stringify(t,r){this.freeze();const n=cl(r),i=this.compiler||this.Compiler;return Bc("stringify",i),Bm(t),i(t,n)}use(t,...r){const n=this.attachers,i=this.namespace;if(jc("use",this.frozen),t!=null)if(typeof t=="function")a(t,r);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")a(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...u]=c;a(h,u)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(c.plugins),c.settings&&(i.settings=Dc(!0,i.settings,c.settings))}function l(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const u=c[h];s(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function a(c,h){let u=-1,f=-1;for(;++u<n.length;)if(n[u][0]===c){f=u;break}if(f===-1)n.push([c,...h]);else if(h.length>0){let[p,...m]=h;const g=n[f][1];ch(g)&&ch(p)&&(p=Dc(!0,g,p)),n[f]=[c,p,...m]}}}}const FE=new cf().freeze();function Ac(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function jc(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Bm(e){if(!ch(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function jm(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function cl(e){return $E(e)?e:new gy(e)}function $E(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function HE(e){return typeof e=="string"||WE(e)}function WE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const UE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Om=[],zm={allowDangerousHtml:!0},VE=/^(https?|ircs?|mailto|xmpp)$/i,KE=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Fm(e){const t=qE(e),r=YE(e);return XE(t.runSync(t.parse(r),r),e)}function qE(e){const t=e.rehypePlugins||Om,r=e.remarkPlugins||Om,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...zm}:zm;return FE().use(T2).use(r).use(bE,n).use(t)}function YE(e){const t=e.children||"",r=new gy;return typeof t=="string"&&(r.value=t),r}function XE(e,t){const r=t.allowedElements,n=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,a=t.urlTransform||GE;for(const h of KE)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+UE+h.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Ka(e,c),dk(e,{Fragment:d.Fragment,components:i,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(h,u,f){if(h.type==="raw"&&f&&typeof u=="number")return o?f.children.splice(u,1):f.children[u]={type:"text",value:h.value},u;if(h.type==="element"){let p;for(p in Lc)if(Object.hasOwn(Lc,p)&&Object.hasOwn(h.properties,p)){const m=h.properties[p],g=Lc[p];(g===null||g.includes(h.tagName))&&(h.properties[p]=a(String(m||""),p,h))}}if(h.type==="element"){let p=r?!r.includes(h.tagName):s?s.includes(h.tagName):!1;if(!p&&n&&typeof u=="number"&&(p=!n(h,u,f)),p&&f&&typeof u=="number")return l&&h.children?f.children.splice(u,1,...h.children):f.children.splice(u,1),u}}}function GE(e){const t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||r!==-1&&t>r||n!==-1&&t>n||VE.test(e.slice(0,t))?e:""}function $m(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(t);for(;i!==-1;)n++,i=r.indexOf(t,i+t.length);return n}function QE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function _y(e,t,r){const i=Ua((r||{}).ignore||[]),s=ZE(t);let o=-1;for(;++o<s.length;)py(e,"text",l);function l(c,h){let u=-1,f;for(;++u<h.length;){const p=h[u],m=f?f.children:void 0;if(i(p,m?m.indexOf(p):void 0,f))return;f=p}if(f)return a(c,h)}function a(c,h){const u=h[h.length-1],f=s[o][0],p=s[o][1];let m=0;const x=u.children.indexOf(c);let _=!1,v=[];f.lastIndex=0;let y=f.exec(c.value);for(;y;){const N=y.index,L={index:y.index,input:y.input,stack:[...h,c]};let C=p(...y,L);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?f.lastIndex=N+1:(m!==N&&v.push({type:"text",value:c.value.slice(m,N)}),Array.isArray(C)?v.push(...C):C&&v.push(C),m=N+y[0].length,_=!0),!f.global)break;y=f.exec(c.value)}return _?(m<c.value.length&&v.push({type:"text",value:c.value.slice(m)}),u.children.splice(x,1,...v)):v=[c],x+v.length}}function ZE(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let n=-1;for(;++n<r.length;){const i=r[n];t.push([JE(i[0]),e5(i[1])])}return t}function JE(e){return typeof e=="string"?new RegExp(QE(e),"g"):e}function e5(e){return typeof e=="function"?e:function(){return e}}const Oc="phrasing",zc=["autolink","link","image","label"];function t5(){return{transforms:[a5],enter:{literalAutolink:n5,literalAutolinkEmail:Fc,literalAutolinkHttp:Fc,literalAutolinkWww:Fc},exit:{literalAutolink:l5,literalAutolinkEmail:o5,literalAutolinkHttp:i5,literalAutolinkWww:s5}}}function r5(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Oc,notInConstruct:zc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Oc,notInConstruct:zc},{character:":",before:"[ps]",after:"\\/",inConstruct:Oc,notInConstruct:zc}]}}function n5(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Fc(e){this.config.enter.autolinkProtocol.call(this,e)}function i5(e){this.config.exit.autolinkProtocol.call(this,e)}function s5(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function o5(e){this.config.exit.autolinkEmail.call(this,e)}function l5(e){this.exit(e)}function a5(e){_y(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,c5],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),u5]],{ignore:["link","linkReference"]})}function c5(e,t,r,n,i){let s="";if(!vy(i)||(/^w/i.test(t)&&(r=t+r,t="",s="http://"),!h5(r)))return!1;const o=d5(r+n);if(!o[0])return!1;const l={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function u5(e,t,r,n){return!vy(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function h5(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function d5(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],n=r.indexOf(")");const i=$m(e,"(");let s=$m(e,")");for(;n!==-1&&i>s;)e+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),s++;return[e,r]}function vy(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||_i(r)||$a(r))&&(!t||r!==47)}yy.peek=w5;function f5(){this.buffer()}function p5(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function m5(){this.buffer()}function g5(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function _5(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ar(this.sliceSerialize(e)).toLowerCase(),r.label=t}function v5(e){this.exit(e)}function y5(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Ar(this.sliceSerialize(e)).toLowerCase(),r.label=t}function x5(e){this.exit(e)}function w5(){return"["}function yy(e,t,r,n){const i=r.createTracker(n);let s=i.move("[^");const o=r.enter("footnoteReference"),l=r.enter("reference");return s+=i.move(r.safe(r.associationId(e),{after:"]",before:s})),l(),o(),s+=i.move("]"),s}function S5(){return{enter:{gfmFootnoteCallString:f5,gfmFootnoteCall:p5,gfmFootnoteDefinitionLabelString:m5,gfmFootnoteDefinition:g5},exit:{gfmFootnoteCallString:_5,gfmFootnoteCall:v5,gfmFootnoteDefinitionLabelString:y5,gfmFootnoteDefinition:x5}}}function b5(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:yy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,s,o){const l=s.createTracker(o);let a=l.move("[^");const c=s.enter("footnoteDefinition"),h=s.enter("label");return a+=l.move(s.safe(s.associationId(n),{before:a,after:"]"})),h(),a+=l.move("]:"),n.children&&n.children.length>0&&(l.shift(4),a+=l.move((t?`
|
|
81
|
+
`:" ")+s.indentLines(s.containerFlow(n,l.current()),t?xy:k5))),c(),a}}function k5(e,t,r){return t===0?e:xy(e,t,r)}function xy(e,t,r){return(r?"":" ")+e}const C5=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];wy.peek=P5;function E5(){return{canContainEols:["delete"],enter:{strikethrough:L5},exit:{strikethrough:T5}}}function N5(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:C5}],handlers:{delete:wy}}}function L5(e){this.enter({type:"delete",children:[]},e)}function T5(e){this.exit(e)}function wy(e,t,r,n){const i=r.createTracker(n),s=r.enter("strikethrough");let o=i.move("~~");return o+=r.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function P5(){return"~"}function D5(e){return e.length}function R5(e,t){const r=t||{},n=(r.align||[]).concat(),i=r.stringLength||D5,s=[],o=[],l=[],a=[];let c=0,h=-1;for(;++h<e.length;){const g=[],x=[];let _=-1;for(e[h].length>c&&(c=e[h].length);++_<e[h].length;){const v=M5(e[h][_]);if(r.alignDelimiters!==!1){const y=i(v);x[_]=y,(a[_]===void 0||y>a[_])&&(a[_]=y)}g.push(v)}o[h]=g,l[h]=x}let u=-1;if(typeof n=="object"&&"length"in n)for(;++u<c;)s[u]=Hm(n[u]);else{const g=Hm(n);for(;++u<c;)s[u]=g}u=-1;const f=[],p=[];for(;++u<c;){const g=s[u];let x="",_="";g===99?(x=":",_=":"):g===108?x=":":g===114&&(_=":");let v=r.alignDelimiters===!1?1:Math.max(1,a[u]-x.length-_.length);const y=x+"-".repeat(v)+_;r.alignDelimiters!==!1&&(v=x.length+v+_.length,v>a[u]&&(a[u]=v),p[u]=v),f[u]=y}o.splice(1,0,f),l.splice(1,0,p),h=-1;const m=[];for(;++h<o.length;){const g=o[h],x=l[h];u=-1;const _=[];for(;++u<c;){const v=g[u]||"";let y="",N="";if(r.alignDelimiters!==!1){const L=a[u]-(x[u]||0),C=s[u];C===114?y=" ".repeat(L):C===99?L%2?(y=" ".repeat(L/2+.5),N=" ".repeat(L/2-.5)):(y=" ".repeat(L/2),N=y):N=" ".repeat(L)}r.delimiterStart!==!1&&!u&&_.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&v==="")&&(r.delimiterStart!==!1||u)&&_.push(" "),r.alignDelimiters!==!1&&_.push(y),_.push(v),r.alignDelimiters!==!1&&_.push(N),r.padding!==!1&&_.push(" "),(r.delimiterEnd!==!1||u!==c-1)&&_.push("|")}m.push(r.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return m.join(`
|
|
82
|
+
`)}function M5(e){return e==null?"":String(e)}function Hm(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function I5(e,t,r,n){const i=r.enter("blockquote"),s=r.createTracker(n);s.move("> "),s.shift(2);const o=r.indentLines(r.containerFlow(e,s.current()),A5);return i(),o}function A5(e,t,r){return">"+(r?"":" ")+e}function B5(e,t){return Wm(e,t.inConstruct,!0)&&!Wm(e,t.notInConstruct,!1)}function Wm(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let n=-1;for(;++n<t.length;)if(e.includes(t[n]))return!0;return!1}function Um(e,t,r,n){let i=-1;for(;++i<r.unsafe.length;)if(r.unsafe[i].character===`
|
|
83
|
+
`&&B5(r.stack,r.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return`\\
|
|
84
|
+
`}function j5(e,t){const r=String(e);let n=r.indexOf(t),i=n,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===i?++s>o&&(o=s):s=1,i=n+t.length,n=r.indexOf(t,i);return o}function O5(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 z5(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function F5(e,t,r,n){const i=z5(r),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(O5(e,r)){const u=r.enter("codeIndented"),f=r.indentLines(s,$5);return u(),f}const l=r.createTracker(n),a=i.repeat(Math.max(j5(s,i)+1,3)),c=r.enter("codeFenced");let h=l.move(a);if(e.lang){const u=r.enter(`codeFencedLang${o}`);h+=l.move(r.safe(e.lang,{before:h,after:" ",encode:["`"],...l.current()})),u()}if(e.lang&&e.meta){const u=r.enter(`codeFencedMeta${o}`);h+=l.move(" "),h+=l.move(r.safe(e.meta,{before:h,after:`
|
|
85
|
+
`,encode:["`"],...l.current()})),u()}return h+=l.move(`
|
|
86
|
+
`),s&&(h+=l.move(s+`
|
|
87
|
+
`)),h+=l.move(a),c(),h}function $5(e,t,r){return(r?"":" ")+e}function uf(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function H5(e,t,r,n){const i=uf(r),s=i==='"'?"Quote":"Apostrophe",o=r.enter("definition");let l=r.enter("label");const a=r.createTracker(n);let c=a.move("[");return c+=a.move(r.safe(r.associationId(e),{before:c,after:"]",...a.current()})),c+=a.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=r.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(r.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=r.enter("destinationRaw"),c+=a.move(r.safe(e.url,{before:c,after:e.title?" ":`
|
|
88
|
+
`,...a.current()}))),l(),e.title&&(l=r.enter(`title${s}`),c+=a.move(" "+i),c+=a.move(r.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),o(),c}function W5(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ko(e){return"&#x"+e.toString(16).toUpperCase()+";"}function pa(e,t,r){const n=is(e),i=is(t);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===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}}Sy.peek=U5;function Sy(e,t,r,n){const i=W5(r),s=r.enter("emphasis"),o=r.createTracker(n),l=o.move(i);let a=o.move(r.containerPhrasing(e,{after:i,before:l,...o.current()}));const c=a.charCodeAt(0),h=pa(n.before.charCodeAt(n.before.length-1),c,i);h.inside&&(a=ko(c)+a.slice(1));const u=a.charCodeAt(a.length-1),f=pa(n.after.charCodeAt(0),u,i);f.inside&&(a=a.slice(0,-1)+ko(u));const p=o.move(i);return s(),r.attentionEncodeSurroundingInfo={after:f.outside,before:h.outside},l+a+p}function U5(e,t,r){return r.options.emphasis||"*"}function V5(e,t){let r=!1;return Ka(e,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,lh}),!!((!e.depth||e.depth<3)&&tf(e)&&(t.options.setext||r))}function K5(e,t,r,n){const i=Math.max(Math.min(6,e.depth||1),1),s=r.createTracker(n);if(V5(e,r)){const h=r.enter("headingSetext"),u=r.enter("phrasing"),f=r.containerPhrasing(e,{...s.current(),before:`
|
|
89
|
+
`,after:`
|
|
90
|
+
`});return u(),h(),f+`
|
|
91
|
+
`+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
|
|
92
|
+
`))+1))}const o="#".repeat(i),l=r.enter("headingAtx"),a=r.enter("phrasing");s.move(o+" ");let c=r.containerPhrasing(e,{before:"# ",after:`
|
|
93
|
+
`,...s.current()});return/^[\t ]/.test(c)&&(c=ko(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,r.options.closeAtx&&(c+=" "+o),a(),l(),c}by.peek=q5;function by(e){return e.value||""}function q5(){return"<"}ky.peek=Y5;function ky(e,t,r,n){const i=uf(r),s=i==='"'?"Quote":"Apostrophe",o=r.enter("image");let l=r.enter("label");const a=r.createTracker(n);let c=a.move("![");return c+=a.move(r.safe(e.alt,{before:c,after:"]",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=r.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(r.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=r.enter("destinationRaw"),c+=a.move(r.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=r.enter(`title${s}`),c+=a.move(" "+i),c+=a.move(r.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),o(),c}function Y5(){return"!"}Cy.peek=X5;function Cy(e,t,r,n){const i=e.referenceType,s=r.enter("imageReference");let o=r.enter("label");const l=r.createTracker(n);let a=l.move("![");const c=r.safe(e.alt,{before:a,after:"]",...l.current()});a+=l.move(c+"]["),o();const h=r.stack;r.stack=[],o=r.enter("reference");const u=r.safe(r.associationId(e),{before:a,after:"]",...l.current()});return o(),r.stack=h,s(),i==="full"||!c||c!==u?a+=l.move(u+"]"):i==="shortcut"?a=a.slice(0,-1):a+=l.move("]"),a}function X5(){return"!"}Ey.peek=G5;function Ey(e,t,r){let n=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++s<r.unsafe.length;){const o=r.unsafe[s],l=r.compilePattern(o);let a;if(o.atBreak)for(;a=l.exec(n);){let c=a.index;n.charCodeAt(c)===10&&n.charCodeAt(c-1)===13&&c--,n=n.slice(0,c)+" "+n.slice(a.index+1)}}return i+n+i}function G5(){return"`"}function Ny(e,t){const r=tf(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ly.peek=Q5;function Ly(e,t,r,n){const i=uf(r),s=i==='"'?"Quote":"Apostrophe",o=r.createTracker(n);let l,a;if(Ny(e,r)){const h=r.stack;r.stack=[],l=r.enter("autolink");let u=o.move("<");return u+=o.move(r.containerPhrasing(e,{before:u,after:">",...o.current()})),u+=o.move(">"),l(),r.stack=h,u}l=r.enter("link"),a=r.enter("label");let c=o.move("[");return c+=o.move(r.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=r.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(r.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(a=r.enter("destinationRaw"),c+=o.move(r.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),a(),e.title&&(a=r.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(r.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),a()),c+=o.move(")"),l(),c}function Q5(e,t,r){return Ny(e,r)?"<":"["}Ty.peek=Z5;function Ty(e,t,r,n){const i=e.referenceType,s=r.enter("linkReference");let o=r.enter("label");const l=r.createTracker(n);let a=l.move("[");const c=r.containerPhrasing(e,{before:a,after:"]",...l.current()});a+=l.move(c+"]["),o();const h=r.stack;r.stack=[],o=r.enter("reference");const u=r.safe(r.associationId(e),{before:a,after:"]",...l.current()});return o(),r.stack=h,s(),i==="full"||!c||c!==u?a+=l.move(u+"]"):i==="shortcut"?a=a.slice(0,-1):a+=l.move("]"),a}function Z5(){return"["}function hf(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function J5(e){const t=hf(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function eN(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Py(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function tN(e,t,r,n){const i=r.enter("list"),s=r.bulletCurrent;let o=e.ordered?eN(r):hf(r);const l=e.ordered?o==="."?")":".":J5(r);let a=t&&r.bulletLastUsed?o===r.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&h&&(!h.children||!h.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(a=!0),Py(r)===o&&h){let u=-1;for(;++u<e.children.length;){const f=e.children[u];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){a=!0;break}}}}a&&(o=l),r.bulletCurrent=o;const c=r.containerFlow(e,n);return r.bulletLastUsed=o,r.bulletCurrent=s,i(),c}function rN(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function nN(e,t,r,n){const i=rN(r);let s=r.bulletCurrent||hf(r);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=r.createTracker(n);l.move(s+" ".repeat(o-s.length)),l.shift(o);const a=r.enter("listItem"),c=r.indentLines(r.containerFlow(e,l.current()),h);return a(),c;function h(u,f,p){return f?(p?"":" ".repeat(o))+u:(p?s:s+" ".repeat(o-s.length))+u}}function iN(e,t,r,n){const i=r.enter("paragraph"),s=r.enter("phrasing"),o=r.containerPhrasing(e,n);return s(),i(),o}const sN=Ua(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function oN(e,t,r,n){return(e.children.some(function(o){return sN(o)})?r.containerPhrasing:r.containerFlow).call(r,e,n)}function lN(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Dy.peek=aN;function Dy(e,t,r,n){const i=lN(r),s=r.enter("strong"),o=r.createTracker(n),l=o.move(i+i);let a=o.move(r.containerPhrasing(e,{after:i,before:l,...o.current()}));const c=a.charCodeAt(0),h=pa(n.before.charCodeAt(n.before.length-1),c,i);h.inside&&(a=ko(c)+a.slice(1));const u=a.charCodeAt(a.length-1),f=pa(n.after.charCodeAt(0),u,i);f.inside&&(a=a.slice(0,-1)+ko(u));const p=o.move(i+i);return s(),r.attentionEncodeSurroundingInfo={after:f.outside,before:h.outside},l+a+p}function aN(e,t,r){return r.options.strong||"*"}function cN(e,t,r,n){return r.safe(e.value,n)}function uN(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function hN(e,t,r){const n=(Py(r)+(r.options.ruleSpaces?" ":"")).repeat(uN(r));return r.options.ruleSpaces?n.slice(0,-1):n}const Ry={blockquote:I5,break:Um,code:F5,definition:H5,emphasis:Sy,hardBreak:Um,heading:K5,html:by,image:ky,imageReference:Cy,inlineCode:Ey,link:Ly,linkReference:Ty,list:tN,listItem:nN,paragraph:iN,root:oN,strong:Dy,text:cN,thematicBreak:hN};function dN(){return{enter:{table:fN,tableData:Vm,tableHeader:Vm,tableRow:mN},exit:{codeText:gN,table:pN,tableData:$c,tableHeader:$c,tableRow:$c}}}function fN(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function pN(e){this.exit(e),this.data.inTable=void 0}function mN(e){this.enter({type:"tableRow",children:[]},e)}function $c(e){this.exit(e)}function Vm(e){this.enter({type:"tableCell",children:[]},e)}function gN(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,_N));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function _N(e,t){return t==="|"?t:e}function vN(e){const t=e||{},r=t.tableCellPadding,n=t.tablePipeAlign,i=t.stringLength,s=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
94
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:o,tableCell:a,tableRow:l}};function o(p,m,g,x){return c(h(p,g,x),p.align)}function l(p,m,g,x){const _=u(p,g,x),v=c([_]);return v.slice(0,v.indexOf(`
|
|
95
|
+
`))}function a(p,m,g,x){const _=g.enter("tableCell"),v=g.enter("phrasing"),y=g.containerPhrasing(p,{...x,before:s,after:s});return v(),_(),y}function c(p,m){return R5(p,{align:m,alignDelimiters:n,padding:r,stringLength:i})}function h(p,m,g){const x=p.children;let _=-1;const v=[],y=m.enter("table");for(;++_<x.length;)v[_]=u(x[_],m,g);return y(),v}function u(p,m,g){const x=p.children;let _=-1;const v=[],y=m.enter("tableRow");for(;++_<x.length;)v[_]=a(x[_],p,m,g);return y(),v}function f(p,m,g){let x=Ry.inlineCode(p,m,g);return g.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function yN(){return{exit:{taskListCheckValueChecked:Km,taskListCheckValueUnchecked:Km,paragraph:wN}}}function xN(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:SN}}}function Km(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function wN(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const n=r.children[0];if(n&&n.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const l=i[s];if(l.type==="paragraph"){o=l;break}}o===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function SN(e,t,r,n){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=r.createTracker(n);s&&l.move(o);let a=Ry.listItem(e,t,r,{...n,...l.current()});return s&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),a;function c(h){return h+o}}function bN(){return[t5(),S5(),E5(),dN(),yN()]}function kN(e){return{extensions:[r5(),b5(e),N5(),vN(e),xN()]}}const CN={tokenize:DN,partial:!0},My={tokenize:RN,partial:!0},Iy={tokenize:MN,partial:!0},Ay={tokenize:IN,partial:!0},EN={tokenize:AN,partial:!0},By={name:"wwwAutolink",tokenize:TN,previous:Oy},jy={name:"protocolAutolink",tokenize:PN,previous:zy},pn={name:"emailAutolink",tokenize:LN,previous:Fy},Zr={};function NN(){return{text:Zr}}let Yn=48;for(;Yn<123;)Zr[Yn]=pn,Yn++,Yn===58?Yn=65:Yn===91&&(Yn=97);Zr[43]=pn;Zr[45]=pn;Zr[46]=pn;Zr[95]=pn;Zr[72]=[pn,jy];Zr[104]=[pn,jy];Zr[87]=[pn,By];Zr[119]=[pn,By];function LN(e,t,r){const n=this;let i,s;return o;function o(u){return!hh(u)||!Fy.call(n,n.previous)||df(n.events)?r(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(u))}function l(u){return hh(u)?(e.consume(u),l):u===64?(e.consume(u),a):r(u)}function a(u){return u===46?e.check(EN,h,c)(u):u===45||u===95||Rt(u)?(s=!0,e.consume(u),a):h(u)}function c(u){return e.consume(u),i=!0,a}function h(u){return s&&i&&Ot(n.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):r(u)}}function TN(e,t,r){const n=this;return i;function i(o){return o!==87&&o!==119||!Oy.call(n,n.previous)||df(n.events)?r(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(CN,e.attempt(My,e.attempt(Iy,s),r),r)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function PN(e,t,r){const n=this;let i="",s=!1;return o;function o(u){return(u===72||u===104)&&zy.call(n,n.previous)&&!df(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(u),e.consume(u),l):r(u)}function l(u){if(Ot(u)&&i.length<5)return i+=String.fromCodePoint(u),e.consume(u),l;if(u===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(u),a}return r(u)}function a(u){return u===47?(e.consume(u),s?c:(s=!0,a)):r(u)}function c(u){return u===null||ha(u)||Be(u)||_i(u)||$a(u)?r(u):e.attempt(My,e.attempt(Iy,h),r)(u)}function h(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function DN(e,t,r){let n=0;return i;function i(o){return(o===87||o===119)&&n<3?(n++,e.consume(o),i):o===46&&n===3?(e.consume(o),s):r(o)}function s(o){return o===null?r(o):t(o)}}function RN(e,t,r){let n,i,s;return o;function o(c){return c===46||c===95?e.check(Ay,a,l)(c):c===null||Be(c)||_i(c)||c!==45&&$a(c)?a(c):(s=!0,e.consume(c),o)}function l(c){return c===95?n=!0:(i=n,n=void 0),e.consume(c),o}function a(c){return i||n||!s?r(c):t(c)}}function MN(e,t){let r=0,n=0;return i;function i(o){return o===40?(r++,e.consume(o),i):o===41&&n<r?s(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(Ay,t,s)(o):o===null||Be(o)||_i(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&n++,e.consume(o),i}}function IN(e,t,r){return n;function n(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),n):l===38?(e.consume(l),s):l===93?(e.consume(l),i):l===60||l===null||Be(l)||_i(l)?t(l):r(l)}function i(l){return l===null||l===40||l===91||Be(l)||_i(l)?t(l):n(l)}function s(l){return Ot(l)?o(l):r(l)}function o(l){return l===59?(e.consume(l),n):Ot(l)?(e.consume(l),o):r(l)}}function AN(e,t,r){return n;function n(s){return e.consume(s),i}function i(s){return Rt(s)?r(s):t(s)}}function Oy(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Be(e)}function zy(e){return!Ot(e)}function Fy(e){return!(e===47||hh(e))}function hh(e){return e===43||e===45||e===46||e===95||Rt(e)}function df(e){let t=e.length,r=!1;for(;t--;){const n=e[t][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const BN={tokenize:UN,partial:!0};function jN(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:$N,continuation:{tokenize:HN},exit:WN}},text:{91:{name:"gfmFootnoteCall",tokenize:FN},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ON,resolveTo:zN}}}}function ON(e,t,r){const n=this;let i=n.events.length;const s=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let o;for(;i--;){const a=n.events[i][1];if(a.type==="labelImage"){o=a;break}if(a.type==="gfmFootnoteCall"||a.type==="labelLink"||a.type==="label"||a.type==="image"||a.type==="link")break}return l;function l(a){if(!o||!o._balanced)return r(a);const c=Ar(n.sliceSerialize({start:o.end,end:n.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?r(a):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),t(a))}}function zN(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const n={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[r+1],e[r+2],["enter",n,t],e[r+3],e[r+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",n,t]];return e.splice(r,e.length-r+1,...l),e}function FN(e,t,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let s=0,o;return l;function l(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),a}function a(u){return u!==94?r(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(s>999||u===93&&!o||u===null||u===91||Be(u))return r(u);if(u===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(Ar(n.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(u)}return Be(u)||(o=!0),s++,e.consume(u),u===92?h:c}function h(u){return u===91||u===92||u===93?(e.consume(u),s++,c):c(u)}}function $N(e,t,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let s,o=0,l;return a;function a(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):r(m)}function h(m){if(o>999||m===93&&!l||m===null||m===91||Be(m))return r(m);if(m===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return s=Ar(n.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Be(m)||(l=!0),o++,e.consume(m),m===92?u:h}function u(m){return m===91||m===92||m===93?(e.consume(m),o++,h):h(m)}function f(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),De(e,p,"gfmFootnoteDefinitionWhitespace")):r(m)}function p(m){return t(m)}}function HN(e,t,r){return e.check(jo,t,e.attempt(BN,t,r))}function WN(e){e.exit("gfmFootnoteDefinition")}function UN(e,t,r){const n=this;return De(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=n.events[n.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):r(s)}}function VN(e){let r=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:s,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(o,l){let a=-1;for(;++a<o.length;)if(o[a][0]==="enter"&&o[a][1].type==="strikethroughSequenceTemporary"&&o[a][1]._close){let c=a;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[a][1].end.offset-o[a][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[a][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[a][1].end)},u={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[a][1].start)},f=[["enter",h,l],["enter",o[c][1],l],["exit",o[c][1],l],["enter",u,l]],p=l.parser.constructs.insideSpan.null;p&&cr(f,f.length,0,Ha(p,o.slice(c+1,a),l)),cr(f,f.length,0,[["exit",u,l],["enter",o[a][1],l],["exit",o[a][1],l],["exit",h,l]]),cr(o,c-1,a-c+3,f),a=c+f.length-2;break}}for(a=-1;++a<o.length;)o[a][1].type==="strikethroughSequenceTemporary"&&(o[a][1].type="data");return o}function s(o,l,a){const c=this.previous,h=this.events;let u=0;return f;function f(m){return c===126&&h[h.length-1][1].type!=="characterEscape"?a(m):(o.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const g=is(c);if(m===126)return u>1?a(m):(o.consume(m),u++,p);if(u<2&&!r)return a(m);const x=o.exit("strikethroughSequenceTemporary"),_=is(m);return x._open=!_||_===2&&!!g,x._close=!g||g===2&&!!_,l(m)}}}class KN{constructor(){this.map=[]}add(t,r,n){qN(this,t,r,n)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let r=this.map.length;const n=[];for(;r>0;)r-=1,n.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];n.push(t.slice()),t.length=0;let i=n.pop();for(;i;){for(const s of i)t.push(s);i=n.pop()}this.map.length=0}}function qN(e,t,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=r,e.map[i][2].push(...n);return}i+=1}e.map.push([t,r,n])}}function YN(e,t){let r=!1;const n=[];for(;t<e.length;){const i=e[t];if(r){if(i[0]==="enter")i[1].type==="tableContent"&&n.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=n.length-1;n[s]=n[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return n}function XN(){return{flow:{null:{name:"table",tokenize:GN,resolveAll:QN}}}}function GN(e,t,r){const n=this;let i=0,s=0,o;return l;function l(E){let H=n.events.length-1;for(;H>-1;){const W=n.events[H][1].type;if(W==="lineEnding"||W==="linePrefix")H--;else break}const B=H>-1?n.events[H][1].type:null,I=B==="tableHead"||B==="tableRow"?C:a;return I===C&&n.parser.lazy[n.now().line]?r(E):I(E)}function a(E){return e.enter("tableHead"),e.enter("tableRow"),c(E)}function c(E){return E===124||(o=!0,s+=1),h(E)}function h(E){return E===null?r(E):_e(E)?s>1?(s=0,n.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),p):r(E):Le(E)?De(e,h,"whitespace")(E):(s+=1,o&&(o=!1,i+=1),E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),o=!0,h):(e.enter("data"),u(E)))}function u(E){return E===null||E===124||Be(E)?(e.exit("data"),h(E)):(e.consume(E),E===92?f:u)}function f(E){return E===92||E===124?(e.consume(E),u):u(E)}function p(E){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(E):(e.enter("tableDelimiterRow"),o=!1,Le(E)?De(e,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):m(E))}function m(E){return E===45||E===58?x(E):E===124?(o=!0,e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),g):L(E)}function g(E){return Le(E)?De(e,x,"whitespace")(E):x(E)}function x(E){return E===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),_):E===45?(s+=1,_(E)):E===null||_e(E)?N(E):L(E)}function _(E){return E===45?(e.enter("tableDelimiterFiller"),v(E)):L(E)}function v(E){return E===45?(e.consume(E),v):E===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(E),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(E))}function y(E){return Le(E)?De(e,N,"whitespace")(E):N(E)}function N(E){return E===124?m(E):E===null||_e(E)?!o||i!==s?L(E):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(E)):L(E)}function L(E){return r(E)}function C(E){return e.enter("tableRow"),D(E)}function D(E){return E===124?(e.enter("tableCellDivider"),e.consume(E),e.exit("tableCellDivider"),D):E===null||_e(E)?(e.exit("tableRow"),t(E)):Le(E)?De(e,D,"whitespace")(E):(e.enter("data"),z(E))}function z(E){return E===null||E===124||Be(E)?(e.exit("data"),D(E)):(e.consume(E),E===92?F:z)}function F(E){return E===92||E===124?(e.consume(E),z):z(E)}}function QN(e,t){let r=-1,n=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,a=0,c,h,u;const f=new KN;for(;++r<e.length;){const p=e[r],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,a!==0&&(qm(f,t,a,c,h),h=void 0,a=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(r,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,u=void 0,s=[0,0,0,0],o=[0,r+1,0,0],l&&(l=!1,h={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(r,0,[["enter",h,t]])),i=m.type==="tableDelimiterRow"?2:h?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],u=ul(f,t,s,i,void 0,u),s=[0,0,0,0]),o[2]=r)):m.type==="tableCellDivider"&&(n?n=!1:(s[1]!==0&&(o[0]=o[1],u=ul(f,t,s,i,void 0,u)),s=o,o=[s[1],r,0,0])):m.type==="tableHead"?(l=!0,a=r):m.type==="tableRow"||m.type==="tableDelimiterRow"?(a=r,s[1]!==0?(o[0]=o[1],u=ul(f,t,s,i,r,u)):o[1]!==0&&(u=ul(f,t,o,i,r,u)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=r)}for(a!==0&&qm(f,t,a,c,h),f.consume(t.events),r=-1;++r<t.events.length;){const p=t.events[r];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=YN(t.events,r))}return e}function ul(e,t,r,n,i,s){const o=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",l="tableContent";r[0]!==0&&(s.end=Object.assign({},Pi(t.events,r[0])),e.add(r[0],0,[["exit",s,t]]));const a=Pi(t.events,r[1]);if(s={type:o,start:Object.assign({},a),end:Object.assign({},a)},e.add(r[1],0,[["enter",s,t]]),r[2]!==0){const c=Pi(t.events,r[2]),h=Pi(t.events,r[3]),u={type:l,start:Object.assign({},c),end:Object.assign({},h)};if(e.add(r[2],0,[["enter",u,t]]),n!==2){const f=t.events[r[2]],p=t.events[r[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",r[3]>r[2]+1){const m=r[2]+1,g=r[3]-r[2]-1;e.add(m,g,[])}}e.add(r[3]+1,0,[["exit",u,t]])}return i!==void 0&&(s.end=Object.assign({},Pi(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function qm(e,t,r,n,i){const s=[],o=Pi(t.events,r);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),n.end=Object.assign({},o),s.push(["exit",n,t]),e.add(r+1,0,s)}function Pi(e,t){const r=e[t],n=r[0]==="enter"?"start":"end";return r[1][n]}const ZN={name:"tasklistCheck",tokenize:e3};function JN(){return{text:{91:ZN}}}function e3(e,t,r){const n=this;return i;function i(a){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(a):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),s)}function s(a){return Be(a)?(e.enter("taskListCheckValueUnchecked"),e.consume(a),e.exit("taskListCheckValueUnchecked"),o):a===88||a===120?(e.enter("taskListCheckValueChecked"),e.consume(a),e.exit("taskListCheckValueChecked"),o):r(a)}function o(a){return a===93?(e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):r(a)}function l(a){return _e(a)?t(a):Le(a)?e.check({tokenize:t3},t,r)(a):r(a)}}function t3(e,t,r){return De(e,n,"whitespace");function n(i){return i===null?r(i):t(i)}}function r3(e){return X0([NN(),jN(),VN(e),XN(),JN()])}const n3={};function Ym(e){const t=this,r=e||n3,n=t.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),s=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(r3(r)),s.push(bN()),o.push(kN(r))}const i3=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,s3=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,o3=({legacyTitle:e=!1,tagName:t="div"}={})=>r=>{Ka(r,"blockquote",(n,i,s)=>{let o="",l="",a=!0,c=n.children.map(h=>{if(a&&h.type==="paragraph"){const u=h.children[0],f=u.type==="text"?u.value:"",p=e?s3:i3,m=f.match(p);if(m&&(a=!1,o=m[1].toLocaleLowerCase(),l=e&&m[2]||o.toLocaleUpperCase(),f.includes(`
|
|
96
|
+
`)&&(h.children[0]={type:"text",value:f.replace(p,"").replace(/^\n+/,"")}),!f.includes(`
|
|
97
|
+
`))){const g=[];h.children.forEach((x,_)=>{_!=0&&(_==1&&x.type==="break"||g.push(x))}),h.children=[...g]}}return h});o&&(n.data={hName:t,hProperties:{className:["markdown-alert",`markdown-alert-${o}`],dir:"auto"}},c.unshift({type:"paragraph",children:[l3(o),{type:"text",value:l.replace(/^\//,"")}],data:{hProperties:{className:"markdown-alert-title",dir:"auto"}}})),n.children=[...c]})};function l3(e){let t=a3[e]??"";return{type:"emphasis",data:{hName:"svg",hProperties:{className:["octicon"],viewBox:"0 0 16 16",width:"16",height:"16",ariaHidden:"true"}},children:[{type:"emphasis",data:{hName:"path",hProperties:{d:t}},children:[]}]}}const a3={note:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z",tip:"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z",important:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",warning:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",caution:"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"};function c3(e){_y(e,[/\r?\n|\r/g,u3])}function u3(){return{type:"break"}}function h3(){return function(e){c3(e)}}const Ge={size:18};function d3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}function f3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("rect",{x:"2",y:"2",width:"20",height:"8",rx:"2"}),d.jsx("rect",{x:"2",y:"14",width:"20",height:"8",rx:"2"}),d.jsx("circle",{cx:"6",cy:"6",r:"1",fill:"currentColor",stroke:"none"}),d.jsx("circle",{cx:"6",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),d.jsx("line",{x1:"10",y1:"6",x2:"18",y2:"6"}),d.jsx("line",{x1:"10",y1:"18",x2:"18",y2:"18"})]})}function p3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),d.jsx("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1"}),d.jsx("line",{x1:"8",y1:"10",x2:"16",y2:"10"}),d.jsx("line",{x1:"8",y1:"14",x2:"14",y2:"14"}),d.jsx("line",{x1:"8",y1:"18",x2:"12",y2:"18"})]})}function m3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"3"}),d.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}function g3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),d.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}function ff({size:e=Ge.size,className:t}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:d.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function to({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),d.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),d.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}function _3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),d.jsx("polyline",{points:"14 2 14 8 20 8"}),d.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),d.jsx("line",{x1:"8",y1:"17",x2:"13",y2:"17"})]})}function Xm({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("circle",{cx:"11",cy:"11",r:"8"}),d.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}function ma({size:e=Ge.size,className:t}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:d.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function v3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("polyline",{points:"23 4 23 10 17 10"}),d.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})}function $y({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),d.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),d.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}function Hy({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("path",{d:"M12 22v-5"}),d.jsx("path",{d:"M9 8V2"}),d.jsx("path",{d:"M15 8V2"}),d.jsx("path",{d:"M18 8v5a6 6 0 0 1-12 0V8z"})]})}function y3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),d.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function x3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"10"}),d.jsx("polyline",{points:"12 6 12 12 16 14"})]})}function w3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"10"}),d.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"4"}),d.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"14"})]})}function S3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("polyline",{points:"4 17 10 11 4 5"}),d.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})}function b3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),d.jsx("path",{d:"M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),d.jsx("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),d.jsx("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]})}function k3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("rect",{x:"3",y:"8",width:"18",height:"12",rx:"2"}),d.jsx("path",{d:"M12 2v6"}),d.jsx("circle",{cx:"8.5",cy:"14",r:"1.5",fill:"currentColor",stroke:"none"}),d.jsx("circle",{cx:"15.5",cy:"14",r:"1.5",fill:"currentColor",stroke:"none"})]})}function C3({size:e=Ge.size,className:t}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:d.jsx("path",{d:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"})})}function E3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("rect",{x:"9",y:"10",width:"6",height:"12",rx:"1"}),d.jsx("path",{d:"M12 2c-1.5 2-3 3.5-3 5a3 3 0 0 0 6 0c0-1.5-1.5-3-3-5z"})]})}function N3({size:e=Ge.size,className:t}){return d.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"5"}),d.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),d.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),d.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),d.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),d.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),d.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),d.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),d.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})}function L3({size:e=Ge.size,className:t}){return d.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:d.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}function T3(e){const r=e.split(`
|
|
98
|
+
`).map(l=>{if(!l.includes("\r"))return l;const a=l.split("\r").map(u=>u.trim()).filter(Boolean);if(a.length===0)return"";const c=a.filter(u=>u.startsWith("⏺"));if(c.length>0)return c[c.length-1];const h=a.filter(u=>!(/^[❯›>]\s*$/.test(u)||/^[^a-zA-Z0-9\s]\s*\S+[…\.]{1,3}\s*$/.test(u)&&u.length<40||/^[╭╰│├╮╯─═]+$/.test(u)));return h.length>0?h[h.length-1]:a[a.length-1]}).join(`
|
|
99
|
+
`).split(`
|
|
100
|
+
`),n={},i=[];let s=!1;for(const l of r){const a=l.trim();if(a===""){s=!1,i.push("");continue}if(/^❯\s*$/.test(a)||/^>\s*$/.test(a)||/^[✡-✩✪-✿⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏◆◇◐◑◒◓]\s*\S+[…\.]{1,3}\s*$/.test(a)||/^◐\s/.test(a)||/\/effort/.test(a)||/^⎿\s+(Tip|Note|Hint):/.test(a)||/^\?\s*(for\s*shortcuts|shortcuts)/.test(a)||/esc\s+to\s+interrupt|shift\+tab\s+to\s+cycle|accept\s+edits\s+on/i.test(a)||/Brewing[…\.]{0,3}\s*\d*$/i.test(a)||/^[✢✳✶✻⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏◆◇✦\s]+$/.test(a)||/^Auto-updating/i.test(a))continue;if(/^[⏺●·⏵]/.test(l)){const h=l.match(/^[⏺●·]\s*([A-Za-z][A-Za-z0-9_]*)\s*[\(\[]/);if(h)n[h[1]]=(n[h[1]]||0)+1;else{const u=l.replace(/^[⏺●·⏵]\s*/,"").trim().slice(0,40);u&&(n[u]=(n[u]||0)+1)}s=!0;continue}if(/^[\s]*[╭╰│├╮╯]/.test(l)||/^[╭╰│├╮╯─]+/.test(a)||/^\s+[⊙✓✗○◎▸►✦]/.test(l)||s&&/^\s{2,}/.test(l))continue;s=!1;const c=l.replace(/^❯\s+/,"");i.push(c)}const o=i.join(`
|
|
101
|
+
`).replace(/\n{3,}/g,`
|
|
102
|
+
|
|
103
|
+
`).trim();return{toolCounts:n,textContent:o,hasTools:Object.keys(n).length>0}}function Hc(e){return e?new Date(e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):""}const Wy=b.forwardRef(function({messages:t,actionLogs:r,agentName:n="Agent",isCliMode:i=!1,isWorking:s=!1,contextKey:o="",receivedAtMap:l={},emptyState:a,onLoadMore:c,isLoadingMore:h,hasMoreHistory:u},f){var W;const p=b.useRef(null),m=b.useRef(null),g=b.useRef(0),x=b.useRef(""),_=b.useRef(!1),[v,y]=b.useState(new Set),[N,L]=b.useState(new Set),C=b.useRef(!1),D=()=>{const T=p.current;return T?T.scrollHeight-T.scrollTop-T.clientHeight<200:!0},z=t.length>0?`${t.length}:${(((W=t[t.length-1])==null?void 0:W.content)||"").length}`:"0:0";b.useEffect(()=>{var P,$;const T=!_.current,O=x.current!==o;if(x.current=o,T||O){_.current=!0,C.current=!1;const w=()=>{var re;(re=m.current)==null||re.scrollIntoView({behavior:"instant"})};requestAnimationFrame(()=>requestAnimationFrame(w)),setTimeout(w,100),setTimeout(w,300),g.current=t.length;return}t.length>g.current?C.current||(P=m.current)==null||P.scrollIntoView({behavior:"instant"}):D()&&!C.current&&(($=m.current)==null||$.scrollIntoView({behavior:"instant"})),g.current=t.length},[z,o,s]),b.useImperativeHandle(f,()=>({scrollToBottom:(T="smooth")=>{var O;(O=m.current)==null||O.scrollIntoView({behavior:T})}})),b.useEffect(()=>{const T=p.current;if(!T)return;let O;const V=()=>{clearTimeout(O),O=setTimeout(()=>{C.current=!D()},50)};return T.addEventListener("scroll",V,{passive:!0}),()=>{T.removeEventListener("scroll",V),clearTimeout(O)}},[]);const F=b.useRef(!1),E=b.useRef(0),H=b.useRef(!1);b.useEffect(()=>{const T=p.current;if(!T||!H.current||E.current===0)return;const V=T.scrollHeight-E.current;V>0&&(T.scrollTop=V),E.current=0,H.current=!1},[t.length]),b.useEffect(()=>{const T=p.current;if(!T||!c)return;const O=()=>{T.scrollTop<60&&u&&!h&&!F.current&&(F.current=!0,E.current=T.scrollHeight,c(),setTimeout(()=>{F.current=!1},1500))};return T.addEventListener("scroll",O,{passive:!0}),()=>T.removeEventListener("scroll",O)},[c,u,h]);const B=(()=>{const T=t.map(($,w)=>({type:"message",data:$,index:w,ts:$.receivedAt||l[$.id??`i-${w}`]||0}));if(!r||r.length===0)return T;const O=[...r].sort(($,w)=>$.timestamp-w.timestamp).map(($,w)=>({type:"action",data:$,index:w,ts:$.timestamp})),V=[];let P=0;for(const $ of T){for(;P<O.length&&$.ts>0&&O[P].ts<$.ts;)V.push(O[P++]);V.push($)}for(;P<O.length;)V.push(O[P++]);return V})(),I=700;return d.jsxs("div",{ref:p,"data-chat-scroll":!0,className:"flex-1 min-h-0 overflow-y-auto px-5 py-6 flex flex-col gap-4 bg-bg-primary",children:[h&&d.jsx("div",{className:"text-center py-3 text-text-muted text-xs opacity-60",children:"⏳ Loading older messages..."}),u&&!h&&d.jsx("div",{className:"text-center py-2",children:d.jsx("button",{onClick:c,className:"bg-transparent border border-border-subtle text-text-muted text-[11px] rounded-xl px-4 py-1 cursor-pointer opacity-70",children:"↑ Load older messages"})}),B.length===0&&!u&&(a||d.jsx("div",{className:"text-center mt-16 opacity-20 text-[13px]",children:"Waiting for messages..."})),B.map(T=>{var ge;if(T.type==="action"){const M=T.data;return d.jsxs("div",{className:"self-center max-w-[80%] bg-indigo-500/[0.08] text-accent px-3.5 py-1.5 rounded-[20px] text-xs text-center border border-indigo-500/15 opacity-85",children:[d.jsx(Fm,{remarkPlugins:[Ym],children:M.text}),d.jsx("span",{className:"text-[10px] opacity-50 ml-2",children:Hc(M.timestamp)})]},`action-${T.index}`)}const O=T.data,V=T.index,P=(O.role||"").toLowerCase(),$=P==="user"||P==="human",w=O.kind||"standard",re=O.receivedAt||l[O.id??`i-${V}`],ce=`${o}-${V}`,k=v.has(ce),me=N.has(ce);if(w==="thought"){const M=((ge=O.meta)==null?void 0:ge.label)||"Thought";return d.jsxs("div",{className:"self-start max-w-[88%] rounded-lg flex-shrink-0 bg-bg-secondary border border-border-subtle",children:[d.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-b border-border-subtle",children:[d.jsx("span",{className:"text-[11px] text-indigo-400",children:d.jsx(C3,{size:13})}),d.jsx("span",{className:"text-[11px] text-indigo-400 font-medium",children:M})]}),d.jsx("div",{className:"px-3 py-2 text-xs text-text-muted italic leading-relaxed opacity-75",style:{maxHeight:200,overflowY:"auto",whiteSpace:"pre-wrap"},children:O.content||""})]},`msg-${V}`)}if(w==="tool")return d.jsxs("div",{className:"self-start flex items-center gap-1.5 text-[11px] text-text-muted py-0.5 px-2.5 pl-2 bg-bg-secondary border border-border-subtle rounded-md font-mono flex-shrink-0",children:[d.jsx("span",{className:"text-emerald-500 text-[10px]",children:"⏺"}),d.jsx("span",{className:"text-emerald-500 opacity-80",children:(O.content||"").split(`
|
|
104
|
+
`)[0].slice(0,80)})]},`msg-${V}`);if(w==="terminal"){const M=O.meta||{},ke=M.isRunning?"⏳":"✅",Se=M.label||"Ran command";return d.jsxs("div",{className:"self-start max-w-[88%] rounded-lg flex-shrink-0 bg-bg-secondary border border-border-subtle",children:[d.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-b border-border-subtle",children:[d.jsx("span",{className:"text-[11px]",children:ke}),d.jsx("span",{className:"text-[11px] text-emerald-500 font-medium",children:Se})]}),d.jsx("pre",{className:"px-3 py-2 text-[11px] text-text-muted font-mono leading-relaxed m-0",style:{maxHeight:250,overflowY:"auto",overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",background:"transparent"},children:O.content||""})]},`msg-${V}`)}if(w==="system")return d.jsx("div",{className:"self-center text-[11px] text-text-muted opacity-60 px-3 py-0.5 rounded-[20px] border border-border-subtle",children:(O.content||"").slice(0,100)},`msg-${V}`);const Q=!$&&i?T3(O.content||""):null,J=Q?Q.textContent:O.content||"",X=Q?Object.entries(Q.toolCounts):[],ae=i&&!$&&!k&&J.length>I,ue=k?O.content||"":ae&&!me?J.slice(0,I):J;return d.jsxs("div",{className:`max-w-[88%] flex flex-col gap-1 ${$?"self-end":"self-start"}`,children:[X.length>0&&d.jsxs("div",{className:"flex flex-wrap gap-1 items-center mb-0.5",children:[X.map(([M,ke])=>d.jsxs("span",{className:"text-[10px] font-mono text-emerald-500 bg-bg-secondary border border-border-subtle rounded px-[7px] py-0.5",children:["⏺ ",M,ke>1?` ×${ke}`:""]},M)),(Q==null?void 0:Q.hasTools)&&d.jsx("button",{onClick:()=>y(M=>{const ke=new Set(M);return k?ke.delete(ce):ke.add(ce),ke}),className:"text-[10px] text-text-muted bg-transparent border-none cursor-pointer px-1 py-px opacity-50",children:k?"Collapse":"Original"}),!J&&re!=null&&d.jsx("span",{className:"text-[10px] opacity-35 ml-0.5",children:Hc(re)})]}),(J||$)&&d.jsxs("div",{style:{background:$?"linear-gradient(135deg, var(--accent-primary), #4f46e5)":"var(--bg-secondary)",color:$?"#fff":"var(--text-primary)",padding:"12px 16px",borderRadius:$?"16px 16px 4px 16px":"16px 16px 16px 4px",fontSize:13,lineHeight:1.65,border:$?"none":"1px solid var(--border-subtle)"},children:[d.jsxs("div",{className:`flex justify-between items-baseline gap-2 ${J?"mb-1.5":"mb-0"}`,children:[d.jsx("span",{className:"text-[10px] font-bold opacity-60 tracking-wide uppercase",children:$?"You":n}),re!=null&&d.jsx("span",{className:"text-[10px] opacity-45",children:Hc(re)})]}),J&&d.jsx("div",{className:"chat-markdown",children:d.jsx(Fm,{remarkPlugins:[Ym,o3,h3],children:ue})}),ae&&d.jsx("button",{onClick:()=>L(M=>{const ke=new Set(M);return me?ke.delete(ce):ke.add(ce),ke}),className:"mt-1.5 text-[11px] font-semibold text-[var(--accent-primary)] bg-transparent border-none cursor-pointer p-0 opacity-80",children:me?"Collapse ↑":`Show more (${Math.round(J.length/100)*100} chars) ↓`})]})]},`msg-${V}`)}),s&&d.jsx("div",{className:"self-start max-w-[90%] bg-bg-secondary rounded-[16px_16px_16px_4px] border border-border-subtle",children:d.jsxs("div",{className:"typing-indicator",children:[d.jsx("div",{className:"dot"}),d.jsx("div",{className:"dot"}),d.jsx("div",{className:"dot"}),d.jsx("span",{className:"text-[11px] text-text-muted ml-1",children:"Agent working..."})]})}),d.jsx("div",{className:"min-h-10",ref:m})]})}),Es={idle:{bg:"rgba(100,116,139,0.15)",text:"#94a3b8",dot:"#64748b",label:"Idle"},streaming:{bg:"rgba(59,130,246,0.15)",text:"#60a5fa",dot:"#3b82f6",label:"Streaming"},waiting_approval:{bg:"rgba(245,158,11,0.15)",text:"#fbbf24",dot:"#f59e0b",label:"Waiting Approval"},error:{bg:"rgba(239,68,68,0.15)",text:"#f87171",dot:"#ef4444",label:"Error"},disconnected:{bg:"rgba(75,85,99,0.15)",text:"#6b7280",dot:"#4b5563",label:"Disconnected"}},Wc={cline:"#22d3ee","roo-code":"#a78bfa",continue:"#34d399",copilot:"#60a5fa"};function P3({agentStreams:e,sendCommand:t}){var f,p,m;const[r,n]=b.useState(null),[i,s]=b.useState(""),[o,l]=b.useState(!1);b.useEffect(()=>{!r&&e.length>0&&n(e[0].agentType)},[e,r]);const a=e.find(g=>g.agentType===r),c=b.useCallback(async()=>{if(!(!i.trim()||!r||o)){l(!0);try{await t("agent_stream_send",{agentType:r,text:i.trim()}),s("")}catch(g){console.error("Failed to send agent message",g)}finally{l(!1)}}},[i,r,o,t]),h=b.useCallback(async g=>{if(r)try{await t("agent_stream_resolve",{agentType:r,action:g})}catch(x){console.error("Failed to resolve agent action",x)}},[r,t]),u=b.useCallback(async()=>{if(r)try{await t("agent_stream_new_session",{agentType:r})}catch(g){console.error("Failed to start new session",g)}},[r,t]);return e.length===0?null:d.jsxs("div",{className:"flex flex-col h-full bg-[#0c0e14] rounded-xl overflow-hidden border border-white/[0.06]",children:[d.jsxs("div",{className:"flex items-center gap-0.5 px-3 pt-2 border-b border-white/[0.06] bg-white/[0.02] overflow-x-auto",children:[e.map(g=>{const x=g.agentType===r,_=Wc[g.agentType]||"#94a3b8",v=Es[g.status]||Es.idle;return d.jsxs("button",{onClick:()=>n(g.agentType),className:`flex items-center gap-2 px-4 py-2 border-none rounded-t-lg text-[13px] whitespace-nowrap cursor-pointer transition-all duration-150 ${x?"bg-white/[0.05] text-slate-100 font-semibold":"bg-transparent text-slate-500 font-normal"}`,style:{borderBottom:x?`2px solid ${_}`:"2px solid transparent"},children:[d.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:v.dot,boxShadow:g.status==="streaming"?`0 0 6px ${v.dot}`:"none",animation:g.status==="streaming"?"pulse 1.5s infinite":"none"}}),g.agentName,g.status==="waiting_approval"&&d.jsx("span",{className:"text-[10px] px-1.5 py-px rounded bg-yellow-500/20 text-yellow-300 font-semibold",children:"APPROVE"})]},g.agentType)}),d.jsx("div",{className:"flex-1"}),d.jsx("button",{onClick:u,title:"New Chat Session",className:"px-2 py-1 mb-1 border-none bg-white/[0.06] text-slate-400 rounded-md cursor-pointer text-[13px]",children:"+ New"})]}),a?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-1.5 text-[11px] text-slate-500 border-b border-white/[0.04]",children:[d.jsx("span",{className:"px-2 py-0.5 rounded font-semibold text-[10px] tracking-wide uppercase",style:{background:(f=Es[a.status])==null?void 0:f.bg,color:(p=Es[a.status])==null?void 0:p.text},children:((m=Es[a.status])==null?void 0:m.label)||a.status}),a.model&&d.jsxs("span",{className:"text-slate-600",children:["Model: ",d.jsx("span",{className:"text-slate-400",children:a.model})]}),d.jsx("span",{className:"text-slate-700",children:"|"}),d.jsxs("span",{children:[a.messages.length," messages"]})]}),a.activeModal&&d.jsxs("div",{className:"px-3.5 py-2.5 bg-gradient-to-br from-yellow-500/10 to-orange-600/[0.08] border-b border-yellow-500/20 flex items-center gap-2.5",children:[d.jsx("span",{className:"text-base",children:"⚠️"}),d.jsx("span",{className:"flex-1 text-[13px] text-yellow-300 leading-snug",children:a.activeModal.message||"Action requires approval"}),d.jsx("button",{onClick:()=>h("approve"),className:"px-3.5 py-1 border-none rounded-md bg-green-500 text-white text-xs font-semibold cursor-pointer",children:"Approve"}),d.jsx("button",{onClick:()=>h("reject"),className:"px-3.5 py-1 border-none rounded-md bg-red-500/20 text-red-400 text-xs font-semibold cursor-pointer",children:"Reject"})]}),d.jsx(Wy,{messages:a.messages.map((g,x)=>({role:g.role,content:g.content,kind:g.kind,id:`${a.agentType}-${x}`,receivedAt:g.timestamp})),agentName:a.agentName,isWorking:a.status==="streaming",contextKey:`agent-${a.agentType}`,emptyState:d.jsxs("div",{className:"flex items-center justify-center h-full text-text-muted text-[13px]",children:["No messages yet. Start a conversation with ",a.agentName,"."]})}),d.jsxs("div",{className:"px-3.5 py-2.5 border-t border-white/[0.06] flex gap-2",children:[d.jsx("input",{type:"text",value:i,onChange:g=>s(g.target.value),onKeyDown:g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),c())},placeholder:`Message ${a.agentName}...`,disabled:o,className:"flex-1 bg-white/[0.04] border border-white/[0.08] rounded-lg px-3.5 py-2 text-slate-200 text-[13px] outline-none"}),d.jsx("button",{onClick:c,disabled:o||!i.trim(),className:"px-4.5 py-2 border-none rounded-lg text-[13px] font-semibold transition-all duration-150",style:{background:i.trim()?`linear-gradient(135deg, ${Wc[a.agentType]||"#3b82f6"}, ${Wc[a.agentType]||"#3b82f6"}cc)`:"rgba(255,255,255,0.04)",color:i.trim()?"#fff":"#475569",cursor:i.trim()?"pointer":"default"},children:o?"…":"Send"})]})]}):d.jsx("div",{className:"flex-1 flex items-center justify-center text-slate-700 text-[13px]",children:"Select an agent tab to view its chat stream."}),d.jsx("style",{children:`
|
|
105
|
+
@keyframes pulse {
|
|
106
|
+
0%, 100% { opacity: 1; }
|
|
107
|
+
50% { opacity: 0.4; }
|
|
108
|
+
}
|
|
109
|
+
`})]})}/**
|
|
110
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
111
|
+
* @license MIT
|
|
112
|
+
*
|
|
113
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
114
|
+
* @license MIT
|
|
115
|
+
*
|
|
116
|
+
* Originally forked from (with the author's permission):
|
|
117
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
118
|
+
* http://bellard.org/jslinux/
|
|
119
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
120
|
+
*/var Uy=Object.defineProperty,D3=Object.getOwnPropertyDescriptor,R3=(e,t)=>{for(var r in t)Uy(e,r,{get:t[r],enumerable:!0})},tt=(e,t,r,n)=>{for(var i=n>1?void 0:n?D3(t,r):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=(n?o(t,r,i):o(i))||i);return n&&i&&Uy(t,r,i),i},he=(e,t)=>(r,n)=>t(r,n,e),Gm="Terminal input",dh={get:()=>Gm,set:e=>Gm=e},Qm="Too much output to announce, navigate to rows manually to read",fh={get:()=>Qm,set:e=>Qm=e};function M3(e){return e.replace(/\r?\n/g,"\r")}function I3(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function A3(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function B3(e,t,r,n){if(e.stopPropagation(),e.clipboardData){let i=e.clipboardData.getData("text/plain");Vy(i,t,r,n)}}function Vy(e,t,r,n){e=M3(e),e=I3(e,r.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(e,!0),t.value=""}function Ky(e,t,r){let n=r.getBoundingClientRect(),i=e.clientX-n.left-10,s=e.clientY-n.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${i}px`,t.style.top=`${s}px`,t.style.zIndex="1000",t.focus()}function Zm(e,t,r,n,i){Ky(e,t,r),i&&n.rightClickSelect(e),t.value=n.selectionText,t.select()}function kn(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function qa(e,t=0,r=e.length){let n="";for(let i=t;i<r;++i){let s=e[i];s>65535?(s-=65536,n+=String.fromCharCode((s>>10)+55296)+String.fromCharCode(s%1024+56320)):n+=String.fromCharCode(s)}return n}var j3=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let r=e.length;if(!r)return 0;let n=0,i=0;if(this._interim){let s=e.charCodeAt(i++);56320<=s&&s<=57343?t[n++]=(this._interim-55296)*1024+s-56320+65536:(t[n++]=this._interim,t[n++]=s),this._interim=0}for(let s=i;s<r;++s){let o=e.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=r)return this._interim=o,n;let l=e.charCodeAt(s);56320<=l&&l<=57343?t[n++]=(o-55296)*1024+l-56320+65536:(t[n++]=o,t[n++]=l);continue}o!==65279&&(t[n++]=o)}return n}},O3=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let r=e.length;if(!r)return 0;let n=0,i,s,o,l,a=0,c=0;if(this.interim[0]){let f=!1,p=this.interim[0];p&=(p&224)===192?31:(p&240)===224?15:7;let m=0,g;for(;(g=this.interim[++m]&63)&&m<4;)p<<=6,p|=g;let x=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,_=x-m;for(;c<_;){if(c>=r)return 0;if(g=e[c++],(g&192)!==128){c--,f=!0;break}else this.interim[m++]=g,p<<=6,p|=g&63}f||(x===2?p<128?c--:t[n++]=p:x===3?p<2048||p>=55296&&p<=57343||p===65279||(t[n++]=p):p<65536||p>1114111||(t[n++]=p)),this.interim.fill(0)}let h=r-4,u=c;for(;u<r;){for(;u<h&&!((i=e[u])&128)&&!((s=e[u+1])&128)&&!((o=e[u+2])&128)&&!((l=e[u+3])&128);)t[n++]=i,t[n++]=s,t[n++]=o,t[n++]=l,u+=4;if(i=e[u++],i<128)t[n++]=i;else if((i&224)===192){if(u>=r)return this.interim[0]=i,n;if(s=e[u++],(s&192)!==128){u--;continue}if(a=(i&31)<<6|s&63,a<128){u--;continue}t[n++]=a}else if((i&240)===224){if(u>=r)return this.interim[0]=i,n;if(s=e[u++],(s&192)!==128){u--;continue}if(u>=r)return this.interim[0]=i,this.interim[1]=s,n;if(o=e[u++],(o&192)!==128){u--;continue}if(a=(i&15)<<12|(s&63)<<6|o&63,a<2048||a>=55296&&a<=57343||a===65279)continue;t[n++]=a}else if((i&248)===240){if(u>=r)return this.interim[0]=i,n;if(s=e[u++],(s&192)!==128){u--;continue}if(u>=r)return this.interim[0]=i,this.interim[1]=s,n;if(o=e[u++],(o&192)!==128){u--;continue}if(u>=r)return this.interim[0]=i,this.interim[1]=s,this.interim[2]=o,n;if(l=e[u++],(l&192)!==128){u--;continue}if(a=(i&7)<<18|(s&63)<<12|(o&63)<<6|l&63,a<65536||a>1114111)continue;t[n++]=a}}return n}},qy="",Pn=" ",zo=class Yy{constructor(){this.fg=0,this.bg=0,this.extended=new ga}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new Yy;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},ga=class Xy{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Xy(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},kr=class Gy extends zo{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ga,this.combinedData=""}static fromCharData(t){let r=new Gy;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?kn(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let n=t[1].charCodeAt(0);if(55296<=n&&n<=56319){let i=t[1].charCodeAt(1);56320<=i&&i<=57343?this.content=(n-55296)*1024+i-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Jm="di$target",ph="di$dependencies",Uc=new Map;function z3(e){return e[ph]||[]}function St(e){if(Uc.has(e))return Uc.get(e);let t=function(r,n,i){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");F3(t,r,i)};return t._id=e,Uc.set(e,t),t}function F3(e,t,r){t[Jm]===t?t[ph].push({id:e,index:r}):(t[ph]=[{id:e,index:r}],t[Jm]=t)}var Ht=St("BufferService"),Qy=St("CoreMouseService"),ki=St("CoreService"),$3=St("CharsetService"),pf=St("InstantiationService"),Zy=St("LogService"),Wt=St("OptionsService"),Jy=St("OscLinkService"),H3=St("UnicodeService"),Fo=St("DecorationService"),mh=class{constructor(e,t,r){this._bufferService=e,this._optionsService=t,this._oscLinkService=r}provideLinks(e,t){var h;let r=this._bufferService.buffer.lines.get(e-1);if(!r){t(void 0);return}let n=[],i=this._optionsService.rawOptions.linkHandler,s=new kr,o=r.getTrimmedLength(),l=-1,a=-1,c=!1;for(let u=0;u<o;u++)if(!(a===-1&&!r.hasContent(u))){if(r.loadCell(u,s),s.hasExtendedAttrs()&&s.extended.urlId)if(a===-1){a=u,l=s.extended.urlId;continue}else c=s.extended.urlId!==l;else a!==-1&&(c=!0);if(c||a!==-1&&u===o-1){let f=(h=this._oscLinkService.getLinkData(l))==null?void 0:h.uri;if(f){let p={start:{x:a+1,y:e},end:{x:u+(!c&&u===o-1?1:0),y:e}},m=!1;if(!(i!=null&&i.allowNonHttpProtocols))try{let g=new URL(f);["http:","https:"].includes(g.protocol)||(m=!0)}catch{m=!0}m||n.push({text:f,range:p,activate:(g,x)=>i?i.activate(g,x,p):W3(g,x),hover:(g,x)=>{var _;return(_=i==null?void 0:i.hover)==null?void 0:_.call(i,g,x,p)},leave:(g,x)=>{var _;return(_=i==null?void 0:i.leave)==null?void 0:_.call(i,g,x,p)}})}c=!1,s.hasExtendedAttrs()&&s.extended.urlId?(a=u,l=s.extended.urlId):(a=-1,l=-1)}}t(n)}};mh=tt([he(0,Ht),he(1,Wt),he(2,Jy)],mh);function W3(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
121
|
+
|
|
122
|
+
WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Ya=St("CharSizeService"),mn=St("CoreBrowserService"),mf=St("MouseService"),gn=St("RenderService"),U3=St("SelectionService"),e1=St("CharacterJoinerService"),fs=St("ThemeService"),t1=St("LinkProviderService"),V3=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?eg.isErrorNoTelemetry(e)?new eg(e.message+`
|
|
123
|
+
|
|
124
|
+
`+e.stack):new Error(e.message+`
|
|
125
|
+
|
|
126
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},K3=new V3;function Rl(e){q3(e)||K3.onUnexpectedError(e)}var gh="Canceled";function q3(e){return e instanceof Y3?!0:e instanceof Error&&e.name===gh&&e.message===gh}var Y3=class extends Error{constructor(){super(gh),this.name=this.message}};function X3(e){return new Error(`Illegal argument: ${e}`)}var eg=class _h extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof _h)return t;let r=new _h;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},vh=class r1 extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,r1.prototype)}};function rr(e,t=0){return e[e.length-(1+t)]}var G3;(e=>{function t(s){return s<0}e.isLessThan=t;function r(s){return s<=0}e.isLessThanOrEqual=r;function n(s){return s>0}e.isGreaterThan=n;function i(s){return s===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(G3||(G3={}));function Q3(e,t){let r=this,n=!1,i;return function(){return n||(n=!0,t||(i=e.apply(r,arguments))),i}}var n1;(e=>{function t(N){return N&&typeof N=="object"&&typeof N[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function n(){return r}e.empty=n;function*i(N){yield N}e.single=i;function s(N){return t(N)?N:i(N)}e.wrap=s;function o(N){return N||r}e.from=o;function*l(N){for(let L=N.length-1;L>=0;L--)yield N[L]}e.reverse=l;function a(N){return!N||N[Symbol.iterator]().next().done===!0}e.isEmpty=a;function c(N){return N[Symbol.iterator]().next().value}e.first=c;function h(N,L){let C=0;for(let D of N)if(L(D,C++))return!0;return!1}e.some=h;function u(N,L){for(let C of N)if(L(C))return C}e.find=u;function*f(N,L){for(let C of N)L(C)&&(yield C)}e.filter=f;function*p(N,L){let C=0;for(let D of N)yield L(D,C++)}e.map=p;function*m(N,L){let C=0;for(let D of N)yield*L(D,C++)}e.flatMap=m;function*g(...N){for(let L of N)yield*L}e.concat=g;function x(N,L,C){let D=C;for(let z of N)D=L(D,z);return D}e.reduce=x;function*_(N,L,C=N.length){for(L<0&&(L+=N.length),C<0?C+=N.length:C>N.length&&(C=N.length);L<C;L++)yield N[L]}e.slice=_;function v(N,L=Number.POSITIVE_INFINITY){let C=[];if(L===0)return[C,N];let D=N[Symbol.iterator]();for(let z=0;z<L;z++){let F=D.next();if(F.done)return[C,e.empty()];C.push(F.value)}return[C,{[Symbol.iterator](){return D}}]}e.consume=v;async function y(N){let L=[];for await(let C of N)L.push(C);return Promise.resolve(L)}e.asyncToArray=y})(n1||(n1={}));function vi(e){if(n1.is(e)){let t=[];for(let r of e)if(r)try{r.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Z3(...e){return Ue(()=>vi(e))}function Ue(e){return{dispose:Q3(()=>{e()})}}var i1=class s1{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{vi(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?s1.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};i1.DISABLE_DISPOSED_WARNING=!1;var zn=i1,Ne=class{constructor(){this._store=new zn,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ne.None=Object.freeze({dispose(){}});var ss=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},ln=typeof window=="object"?window:globalThis,yh=class xh{constructor(t){this.element=t,this.next=xh.Undefined,this.prev=xh.Undefined}};yh.Undefined=new yh(void 0);var Ve=yh,tg=class{constructor(){this._first=Ve.Undefined,this._last=Ve.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ve.Undefined}clear(){let e=this._first;for(;e!==Ve.Undefined;){let t=e.next;e.prev=Ve.Undefined,e.next=Ve.Undefined,e=t}this._first=Ve.Undefined,this._last=Ve.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new Ve(e);if(this._first===Ve.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==Ve.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ve.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ve.Undefined&&e.next!==Ve.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ve.Undefined&&e.next===Ve.Undefined?(this._first=Ve.Undefined,this._last=Ve.Undefined):e.next===Ve.Undefined?(this._last=this._last.prev,this._last.next=Ve.Undefined):e.prev===Ve.Undefined&&(this._first=this._first.next,this._first.prev=Ve.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ve.Undefined;)yield e.element,e=e.next}},J3=globalThis.performance&&typeof globalThis.performance.now=="function",eL=class o1{static create(t){return new o1(t)}constructor(t){this._now=J3&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Ct;(e=>{e.None=()=>Ne.None;function t(B,I){return u(B,()=>{},0,void 0,!0,void 0,I)}e.defer=t;function r(B){return(I,W=null,T)=>{let O=!1,V;return V=B(P=>{if(!O)return V?V.dispose():O=!0,I.call(W,P)},null,T),O&&V.dispose(),V}}e.once=r;function n(B,I,W){return c((T,O=null,V)=>B(P=>T.call(O,I(P)),null,V),W)}e.map=n;function i(B,I,W){return c((T,O=null,V)=>B(P=>{I(P),T.call(O,P)},null,V),W)}e.forEach=i;function s(B,I,W){return c((T,O=null,V)=>B(P=>I(P)&&T.call(O,P),null,V),W)}e.filter=s;function o(B){return B}e.signal=o;function l(...B){return(I,W=null,T)=>{let O=Z3(...B.map(V=>V(P=>I.call(W,P))));return h(O,T)}}e.any=l;function a(B,I,W,T){let O=W;return n(B,V=>(O=I(O,V),O),T)}e.reduce=a;function c(B,I){let W,T={onWillAddFirstListener(){W=B(O.fire,O)},onDidRemoveLastListener(){W==null||W.dispose()}},O=new oe(T);return I==null||I.add(O),O.event}function h(B,I){return I instanceof Array?I.push(B):I&&I.add(B),B}function u(B,I,W=100,T=!1,O=!1,V,P){let $,w,re,ce=0,k,me={leakWarningThreshold:V,onWillAddFirstListener(){$=B(J=>{ce++,w=I(w,J),T&&!re&&(Q.fire(w),w=void 0),k=()=>{let X=w;w=void 0,re=void 0,(!T||ce>1)&&Q.fire(X),ce=0},typeof W=="number"?(clearTimeout(re),re=setTimeout(k,W)):re===void 0&&(re=0,queueMicrotask(k))})},onWillRemoveListener(){O&&ce>0&&(k==null||k())},onDidRemoveLastListener(){k=void 0,$.dispose()}},Q=new oe(me);return P==null||P.add(Q),Q.event}e.debounce=u;function f(B,I=0,W){return e.debounce(B,(T,O)=>T?(T.push(O),T):[O],I,void 0,!0,void 0,W)}e.accumulate=f;function p(B,I=(T,O)=>T===O,W){let T=!0,O;return s(B,V=>{let P=T||!I(V,O);return T=!1,O=V,P},W)}e.latch=p;function m(B,I,W){return[e.filter(B,I,W),e.filter(B,T=>!I(T),W)]}e.split=m;function g(B,I=!1,W=[],T){let O=W.slice(),V=B(w=>{O?O.push(w):$.fire(w)});T&&T.add(V);let P=()=>{O==null||O.forEach(w=>$.fire(w)),O=null},$=new oe({onWillAddFirstListener(){V||(V=B(w=>$.fire(w)),T&&T.add(V))},onDidAddFirstListener(){O&&(I?setTimeout(P):P())},onDidRemoveLastListener(){V&&V.dispose(),V=null}});return T&&T.add($),$.event}e.buffer=g;function x(B,I){return(W,T,O)=>{let V=I(new v);return B(function(P){let $=V.evaluate(P);$!==_&&W.call(T,$)},void 0,O)}}e.chain=x;let _=Symbol("HaltChainable");class v{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(W=>(I(W),W)),this}filter(I){return this.steps.push(W=>I(W)?W:_),this}reduce(I,W){let T=W;return this.steps.push(O=>(T=I(T,O),T)),this}latch(I=(W,T)=>W===T){let W=!0,T;return this.steps.push(O=>{let V=W||!I(O,T);return W=!1,T=O,V?O:_}),this}evaluate(I){for(let W of this.steps)if(I=W(I),I===_)break;return I}}function y(B,I,W=T=>T){let T=(...$)=>P.fire(W(...$)),O=()=>B.on(I,T),V=()=>B.removeListener(I,T),P=new oe({onWillAddFirstListener:O,onDidRemoveLastListener:V});return P.event}e.fromNodeEventEmitter=y;function N(B,I,W=T=>T){let T=(...$)=>P.fire(W(...$)),O=()=>B.addEventListener(I,T),V=()=>B.removeEventListener(I,T),P=new oe({onWillAddFirstListener:O,onDidRemoveLastListener:V});return P.event}e.fromDOMEventEmitter=N;function L(B){return new Promise(I=>r(B)(I))}e.toPromise=L;function C(B){let I=new oe;return B.then(W=>{I.fire(W)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}e.fromPromise=C;function D(B,I){return B(W=>I.fire(W))}e.forward=D;function z(B,I,W){return I(W),B(T=>I(T))}e.runAndSubscribe=z;class F{constructor(I,W){this._observable=I,this._counter=0,this._hasChanged=!1;let T={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new oe(T),W&&W.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,W){this._hasChanged=!0}endUpdate(I){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function E(B,I){return new F(B,I).emitter.event}e.fromObservable=E;function H(B){return(I,W,T)=>{let O=0,V=!1,P={beginUpdate(){O++},endUpdate(){O--,O===0&&(B.reportChanges(),V&&(V=!1,I.call(W)))},handlePossibleChange(){},handleChange(){V=!0}};B.addObserver(P),B.reportChanges();let $={dispose(){B.removeObserver(P)}};return T instanceof zn?T.add($):Array.isArray(T)&&T.push($),$}}e.fromObservableLight=H})(Ct||(Ct={}));var wh=class Sh{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Sh._idPool++}`,Sh.all.add(this)}start(t){this._stopWatch=new eL,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};wh.all=new Set,wh._idPool=0;var tL=wh,rL=-1,l1=class a1{constructor(t,r,n=(a1._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,r){let n=this.threshold;if(n<=0||r<n)return;this._stacks||(this._stacks=new Map);let i=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[s,o]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${o}):`;console.warn(l),console.warn(s);let a=new sL(l,s);this._errorHandler(a)}return()=>{let s=this._stacks.get(t.value)||0;this._stacks.set(t.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[n,i]of this._stacks)(!t||r<i)&&(t=[n,i],r=i);return t}};l1._idPool=1;var nL=l1,iL=class c1{constructor(t){this.value=t}static create(){let t=new Error;return new c1(t.stack??"")}print(){console.warn(this.value.split(`
|
|
127
|
+
`).slice(2).join(`
|
|
128
|
+
`))}},sL=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},oL=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},lL=0,Vc=class{constructor(e){this.value=e,this.id=lL++}},aL=2,cL,oe=class{constructor(t){var r,n,i,s;this._size=0,this._options=t,this._leakageMon=(r=this._options)!=null&&r.leakWarningThreshold?new nL((t==null?void 0:t.onListenerError)??Rl,((n=this._options)==null?void 0:n.leakWarningThreshold)??rL):void 0,this._perfMon=(i=this._options)!=null&&i._profName?new tL(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var t,r,n,i;this._disposed||(this._disposed=!0,((t=this._deliveryQueue)==null?void 0:t.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(r=this._options)==null?void 0:r.onDidRemoveLastListener)==null||n.call(r),(i=this._leakageMon)==null||i.dispose())}get event(){return this._event??(this._event=(t,r,n)=>{var l,a,c,h,u;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let f=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(f);let p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],m=new oL(`${f}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(((l=this._options)==null?void 0:l.onListenerError)||Rl)(m),Ne.None}if(this._disposed)return Ne.None;r&&(t=t.bind(r));let i=new Vc(t),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=iL.create(),s=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof Vc?(this._deliveryQueue??(this._deliveryQueue=new uL),this._listeners=[this._listeners,i]):this._listeners.push(i):((c=(a=this._options)==null?void 0:a.onWillAddFirstListener)==null||c.call(a,this),this._listeners=i,(u=(h=this._options)==null?void 0:h.onDidAddFirstListener)==null||u.call(h,this)),this._size++;let o=Ue(()=>{s==null||s(),this._removeListener(i)});return n instanceof zn?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(t){var s,o,l,a;if((o=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||o.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(a=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||a.call(l,this),this._size=0;return}let r=this._listeners,n=r.indexOf(t);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[n]=void 0;let i=this._deliveryQueue.current===this;if(this._size*aL<=r.length){let c=0;for(let h=0;h<r.length;h++)r[h]?r[c++]=r[h]:i&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=c}}_deliver(t,r){var i;if(!t)return;let n=((i=this._options)==null?void 0:i.onListenerError)||Rl;if(!n){t.value(r);return}try{t.value(r)}catch(s){n(s)}}_deliverQueue(t){let r=t.current._listeners;for(;t.i<t.end;)this._deliver(r[t.i++],t.value);t.reset()}fire(t){var r,n,i,s;if((r=this._deliveryQueue)!=null&&r.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(i=this._perfMon)==null||i.start(this._size),this._listeners)if(this._listeners instanceof Vc)this._deliver(this._listeners,t);else{let o=this._deliveryQueue;o.enqueue(this,t,this._listeners.length),this._deliverQueue(o)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},uL=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},bh=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new oe,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new oe,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};bh.INSTANCE=new bh;var gf=bh;function hL(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}gf.INSTANCE.onDidChangeZoomLevel;function dL(e){return gf.INSTANCE.getZoomFactor(e)}gf.INSTANCE.onDidChangeFullscreen;var ps=typeof navigator=="object"?navigator.userAgent:"",kh=ps.indexOf("Firefox")>=0,fL=ps.indexOf("AppleWebKit")>=0,_f=ps.indexOf("Chrome")>=0,pL=!_f&&ps.indexOf("Safari")>=0;ps.indexOf("Electron/")>=0;ps.indexOf("Android")>=0;var Kc=!1;if(typeof ln.matchMedia=="function"){let e=ln.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ln.matchMedia("(display-mode: fullscreen)");Kc=e.matches,hL(ln,e,({matches:r})=>{Kc&&t.matches||(Kc=r)})}var Wi="en",Ch=!1,Eh=!1,Ml=!1,u1=!1,hl,Il=Wi,rg=Wi,mL,Lr,hi=globalThis,kt,r_;typeof hi.vscode<"u"&&typeof hi.vscode.process<"u"?kt=hi.vscode.process:typeof process<"u"&&typeof((r_=process==null?void 0:process.versions)==null?void 0:r_.node)=="string"&&(kt=process);var n_,gL=typeof((n_=kt==null?void 0:kt.versions)==null?void 0:n_.electron)=="string",_L=gL&&(kt==null?void 0:kt.type)==="renderer",i_;if(typeof kt=="object"){Ch=kt.platform==="win32",Eh=kt.platform==="darwin",Ml=kt.platform==="linux",Ml&&kt.env.SNAP&&kt.env.SNAP_REVISION,kt.env.CI||kt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,hl=Wi,Il=Wi;let e=kt.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);hl=t.userLocale,rg=t.osLocale,Il=t.resolvedLanguage||Wi,mL=(i_=t.languagePack)==null?void 0:i_.translationsConfigFile}catch{}u1=!0}else typeof navigator=="object"&&!_L?(Lr=navigator.userAgent,Ch=Lr.indexOf("Windows")>=0,Eh=Lr.indexOf("Macintosh")>=0,(Lr.indexOf("Macintosh")>=0||Lr.indexOf("iPad")>=0||Lr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ml=Lr.indexOf("Linux")>=0,(Lr==null?void 0:Lr.indexOf("Mobi"))>=0,Il=globalThis._VSCODE_NLS_LANGUAGE||Wi,hl=navigator.language.toLowerCase(),rg=hl):console.error("Unable to resolve platform.");var h1=Ch,Gr=Eh,vL=Ml,ng=u1,Qr=Lr,yn=Il,yL;(e=>{function t(){return yn}e.value=t;function r(){return yn.length===2?yn==="en":yn.length>=3?yn[0]==="e"&&yn[1]==="n"&&yn[2]==="-":!1}e.isDefaultVariant=r;function n(){return yn==="en"}e.isDefault=n})(yL||(yL={}));var xL=typeof hi.postMessage=="function"&&!hi.importScripts;(()=>{if(xL){let e=[];hi.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,i=e.length;n<i;n++){let s=e[n];if(s.id===r.data.vscodeScheduleAsyncWork){e.splice(n,1),s.callback();return}}});let t=0;return r=>{let n=++t;e.push({id:n,callback:r}),hi.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})();var wL=!!(Qr&&Qr.indexOf("Chrome")>=0);Qr&&Qr.indexOf("Firefox")>=0;!wL&&Qr&&Qr.indexOf("Safari")>=0;Qr&&Qr.indexOf("Edg/")>=0;Qr&&Qr.indexOf("Android")>=0;var Li=typeof navigator=="object"?navigator:{};ng||document.queryCommandSupported&&document.queryCommandSupported("copy")||Li&&Li.clipboard&&Li.clipboard.writeText,ng||Li&&Li.clipboard&&Li.clipboard.readText;var vf=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},qc=new vf,ig=new vf,sg=new vf,SL=new Array(230),d1;(e=>{function t(l){return qc.keyCodeToStr(l)}e.toString=t;function r(l){return qc.strToKeyCode(l)}e.fromString=r;function n(l){return ig.keyCodeToStr(l)}e.toUserSettingsUS=n;function i(l){return sg.keyCodeToStr(l)}e.toUserSettingsGeneral=i;function s(l){return ig.strToKeyCode(l)||sg.strToKeyCode(l)}e.fromUserSettings=s;function o(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return qc.keyCodeToStr(l)}e.toElectronAccelerator=o})(d1||(d1={}));var bL=class f1{constructor(t,r,n,i,s){this.ctrlKey=t,this.shiftKey=r,this.altKey=n,this.metaKey=i,this.keyCode=s}equals(t){return t instanceof f1&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",n=this.altKey?"1":"0",i=this.metaKey?"1":"0";return`K${t}${r}${n}${i}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new kL([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},kL=class{constructor(e){if(e.length===0)throw X3("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t<r;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function CL(e){if(e.charCode){let r=String.fromCharCode(e.charCode).toUpperCase();return d1.fromString(r)}let t=e.keyCode;if(t===3)return 7;if(kh)switch(t){case 59:return 85;case 60:if(vL)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Gr)return 57;break}else if(fL&&(Gr&&t===93||!Gr&&t===92))return 57;return SL[t]||0}var EL=Gr?256:2048,NL=512,LL=1024,TL=Gr?2048:256,og=class{constructor(e){var r;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(r=t.getModifierState)==null?void 0:r.call(t,"AltGraph"),this.keyCode=CL(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=EL),this.altKey&&(t|=NL),this.shiftKey&&(t|=LL),this.metaKey&&(t|=TL),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new bL(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},lg=new WeakMap;function PL(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,r=e.parent.location;if(t.origin!=="null"&&r.origin!=="null"&&t.origin!==r.origin)return null}catch{return null}return e.parent}var DL=class{static getSameOriginWindowChain(e){let t=lg.get(e);if(!t){t=[],lg.set(e,t);let r=e,n;do n=PL(r),n?t.push({window:new WeakRef(r),iframeElement:r.frameElement||null}):t.push({window:new WeakRef(r),iframeElement:null}),r=n;while(r)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let r=0,n=0,i=this.getSameOriginWindowChain(e);for(let s of i){let o=s.window.deref();if(r+=(o==null?void 0:o.scrollY)??0,n+=(o==null?void 0:o.scrollX)??0,o===t||!s.iframeElement)break;let l=s.iframeElement.getBoundingClientRect();r+=l.top,n+=l.left}return{top:r,left:n}}},dl=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let r=DL.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=r.left,this.posy-=r.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},ag=class{constructor(e,t=0,r=0){var i;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=r,this.deltaX=t;let n=!1;if(_f){let s=navigator.userAgent.match(/Chrome\/(\d+)/);n=(s?parseInt(s[1]):123)<=122}if(e){let s=e,o=e,l=((i=e.view)==null?void 0:i.devicePixelRatio)||1;if(typeof s.wheelDeltaY<"u")n?this.deltaY=s.wheelDeltaY/(120*l):this.deltaY=s.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){let a=e;a.deltaMode===a.DOM_DELTA_LINE?kh&&!Gr?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")pL&&h1?this.deltaX=-(s.wheelDeltaX/120):n?this.deltaX=s.wheelDeltaX/(120*l):this.deltaX=s.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let a=e;a.deltaMode===a.DOM_DELTA_LINE?kh&&!Gr?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*l):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},p1=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),RL;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof ML?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ct.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:p1})})(RL||(RL={}));var ML=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?p1:(this._emitter||(this._emitter=new oe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},yf=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new vh("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new vh("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},IL=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,r=globalThis){if(this.isDisposed)throw new vh("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=r.setInterval(()=>{e()},t);this.disposable=Ue(()=>{r.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},AL;(e=>{async function t(n){let i,s=await Promise.all(n.map(o=>o.then(l=>l,l=>{i||(i=l)})));if(typeof i<"u")throw i;return s}e.settled=t;function r(n){return new Promise(async(i,s)=>{try{await n(i,s)}catch(o){s(o)}})}e.withAsyncBody=r})(AL||(AL={}));var cg=class _r{static fromArray(t){return new _r(r=>{r.emitMany(t)})}static fromPromise(t){return new _r(async r=>{r.emitMany(await t)})}static fromPromises(t){return new _r(async r=>{await Promise.all(t.map(async n=>r.emitOne(await n)))})}static merge(t){return new _r(async r=>{await Promise.all(t.map(async n=>{for await(let i of n)r.emitOne(i)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new oe,queueMicrotask(async()=>{let n={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{await Promise.resolve(t(n)),this.resolve()}catch(i){this.reject(i)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Ct.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var r;return(r=this._onReturn)==null||r.call(this),{done:!0,value:void 0}}}}static map(t,r){return new _r(async n=>{for await(let i of t)n.emitOne(r(i))})}map(t){return _r.map(this,t)}static filter(t,r){return new _r(async n=>{for await(let i of t)r(i)&&n.emitOne(i)})}filter(t){return _r.filter(this,t)}static coalesce(t){return _r.filter(t,r=>!!r)}coalesce(){return _r.coalesce(this)}static async toPromise(t){let r=[];for await(let n of t)r.push(n);return r}toPromise(){return _r.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};cg.EMPTY=cg.fromArray([]);var{getWindow:qr,getWindowId:BL,onDidRegisterWindow:jL}=function(){let e=new Map,t={window:ln,disposables:new zn};e.set(ln.vscodeWindowId,t);let r=new oe,n=new oe,i=new oe;function s(o,l){return(typeof o=="number"?e.get(o):void 0)??(l?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:n.event,registerWindow(o){if(e.has(o.vscodeWindowId))return Ne.None;let l=new zn,a={window:o,disposables:l.add(new zn)};return e.set(o.vscodeWindowId,a),l.add(Ue(()=>{e.delete(o.vscodeWindowId),n.fire(o)})),l.add(we(o,gt.BEFORE_UNLOAD,()=>{i.fire(o)})),r.fire(a),l},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:s,getWindow(o){var c;let l=o;if((c=l==null?void 0:l.ownerDocument)!=null&&c.defaultView)return l.ownerDocument.defaultView.window;let a=o;return a!=null&&a.view?a.view.window:ln},getDocument(o){return qr(o).document}}}(),OL=class{constructor(e,t,r,n){this._node=e,this._type=t,this._handler=r,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function we(e,t,r,n){return new OL(e,t,r,n)}var ug=function(e,t,r,n){return we(e,t,r,n)},xf,zL=class extends IL{constructor(e){super(),this.defaultTarget=e&&qr(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},hg=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Rl(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,r=new Map,n=new Map,i=s=>{r.set(s,!1);let o=e.get(s)??[];for(t.set(s,o),e.set(s,[]),n.set(s,!0);o.length>0;)o.sort(hg.sort),o.shift().execute();n.set(s,!1)};xf=(s,o,l=0)=>{let a=BL(s),c=new hg(o,l),h=e.get(a);return h||(h=[],e.set(a,h)),h.push(c),r.get(a)||(r.set(a,!0),s.requestAnimationFrame(()=>i(a))),c}})();function FL(e){let t=e.getBoundingClientRect(),r=qr(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var gt={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},$L=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Vt(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Vt(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Vt(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Vt(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Vt(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Vt(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Vt(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Vt(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Vt(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Vt(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Vt(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Vt(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Vt(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Vt(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Vt(e){return typeof e=="number"?`${e}px`:e}function ro(e){return new $L(e)}var m1=class{constructor(){this._hooks=new zn,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,r,n,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=i;let s=e;try{e.setPointerCapture(t),this._hooks.add(Ue(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=qr(e)}this._hooks.add(we(s,gt.POINTER_MOVE,o=>{if(o.buttons!==r){this.stopMonitoring(!0);return}o.preventDefault(),this._pointerMoveCallback(o)})),this._hooks.add(we(s,gt.POINTER_UP,o=>this.stopMonitoring(!0)))}};function HL(e,t,r){let n=null,i=null;if(typeof r.value=="function"?(n="value",i=r.value,i.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(n="get",i=r.get),!i)throw new Error("not supported");let s=`$memoize$${t}`;r[n]=function(...o){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,o)}),this[s]}}var Hr;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Hr||(Hr={}));var Os=class Pt extends Ne{constructor(){super(),this.dispatched=!1,this.targets=new tg,this.ignoreTargets=new tg,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Ct.runAndSubscribe(jL,({window:t,disposables:r})=>{r.add(we(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),r.add(we(t.document,"touchend",n=>this.onTouchEnd(t,n))),r.add(we(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:ln,disposables:this._store}))}static addTarget(t){if(!Pt.isTouchDevice())return Ne.None;Pt.INSTANCE||(Pt.INSTANCE=new Pt);let r=Pt.INSTANCE.targets.push(t);return Ue(r)}static ignoreTarget(t){if(!Pt.isTouchDevice())return Ne.None;Pt.INSTANCE||(Pt.INSTANCE=new Pt);let r=Pt.INSTANCE.ignoreTargets.push(t);return Ue(r)}static isTouchDevice(){return"ontouchstart"in ln||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,i=t.targetTouches.length;n<i;n++){let s=t.targetTouches.item(n);this.activeTouches[s.identifier]={id:s.identifier,initialTarget:s.target,initialTimeStamp:r,initialPageX:s.pageX,initialPageY:s.pageY,rollingTimestamps:[r],rollingPageX:[s.pageX],rollingPageY:[s.pageY]};let o=this.newGestureEvent(Hr.Start,s.target);o.pageX=s.pageX,o.pageY=s.pageY,this.dispatchEvent(o)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,r){let n=Date.now(),i=Object.keys(this.activeTouches).length;for(let s=0,o=r.changedTouches.length;s<o;s++){let l=r.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("move of an UNKNOWN touch",l);continue}let a=this.activeTouches[l.identifier],c=Date.now()-a.initialTimeStamp;if(c<Pt.HOLD_DELAY&&Math.abs(a.initialPageX-rr(a.rollingPageX))<30&&Math.abs(a.initialPageY-rr(a.rollingPageY))<30){let h=this.newGestureEvent(Hr.Tap,a.initialTarget);h.pageX=rr(a.rollingPageX),h.pageY=rr(a.rollingPageY),this.dispatchEvent(h)}else if(c>=Pt.HOLD_DELAY&&Math.abs(a.initialPageX-rr(a.rollingPageX))<30&&Math.abs(a.initialPageY-rr(a.rollingPageY))<30){let h=this.newGestureEvent(Hr.Contextmenu,a.initialTarget);h.pageX=rr(a.rollingPageX),h.pageY=rr(a.rollingPageY),this.dispatchEvent(h)}else if(i===1){let h=rr(a.rollingPageX),u=rr(a.rollingPageY),f=rr(a.rollingTimestamps)-a.rollingTimestamps[0],p=h-a.rollingPageX[0],m=u-a.rollingPageY[0],g=[...this.targets].filter(x=>a.initialTarget instanceof Node&&x.contains(a.initialTarget));this.inertia(t,g,n,Math.abs(p)/f,p>0?1:-1,h,Math.abs(m)/f,m>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(Hr.End,a.initialTarget)),delete this.activeTouches[l.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=r,n.tapCount=0,n}dispatchEvent(t){if(t.type===Hr.Tap){let r=new Date().getTime(),n=0;r-this._lastSetTapCountTime>Pt.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=r,t.tapCount=n}else(t.type===Hr.Change||t.type===Hr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let r=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let i=0,s=t.initialTarget;for(;s&&s!==n;)i++,s=s.parentElement;r.push([i,n])}r.sort((n,i)=>n[0]-i[0]);for(let[n,i]of r)i.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,n,i,s,o,l,a,c){this.handle=xf(t,()=>{let h=Date.now(),u=h-n,f=0,p=0,m=!0;i+=Pt.SCROLL_FRICTION*u,l+=Pt.SCROLL_FRICTION*u,i>0&&(m=!1,f=s*i*u),l>0&&(m=!1,p=a*l*u);let g=this.newGestureEvent(Hr.Change);g.translationX=f,g.translationY=p,r.forEach(x=>x.dispatchEvent(g)),m||this.inertia(t,r,h,i,s,o+f,l,a,c+p)})}onTouchMove(t){let r=Date.now();for(let n=0,i=t.changedTouches.length;n<i;n++){let s=t.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("end of an UNKNOWN touch",s);continue}let o=this.activeTouches[s.identifier],l=this.newGestureEvent(Hr.Change,o.initialTarget);l.translationX=s.pageX-rr(o.rollingPageX),l.translationY=s.pageY-rr(o.rollingPageY),l.pageX=s.pageX,l.pageY=s.pageY,this.dispatchEvent(l),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(s.pageX),o.rollingPageY.push(s.pageY),o.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Os.SCROLL_FRICTION=-.005,Os.HOLD_DELAY=700,Os.CLEAR_TAP_COUNT_TIME=400,tt([HL],Os,"isTouchDevice",1);var WL=Os,wf=class extends Ne{onclick(e,t){this._register(we(e,gt.CLICK,r=>t(new dl(qr(e),r))))}onmousedown(e,t){this._register(we(e,gt.MOUSE_DOWN,r=>t(new dl(qr(e),r))))}onmouseover(e,t){this._register(we(e,gt.MOUSE_OVER,r=>t(new dl(qr(e),r))))}onmouseleave(e,t){this._register(we(e,gt.MOUSE_LEAVE,r=>t(new dl(qr(e),r))))}onkeydown(e,t){this._register(we(e,gt.KEY_DOWN,r=>t(new og(r))))}onkeyup(e,t){this._register(we(e,gt.KEY_UP,r=>t(new og(r))))}oninput(e,t){this._register(we(e,gt.INPUT,t))}onblur(e,t){this._register(we(e,gt.BLUR,t))}onfocus(e,t){this._register(we(e,gt.FOCUS,t))}onchange(e,t){this._register(we(e,gt.CHANGE,t))}ignoreGesture(e){return WL.ignoreTarget(e)}},dg=11,UL=class extends wf{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=dg+"px",this.domNode.style.height=dg+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new m1),this._register(ug(this.bgDomNode,gt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(ug(this.domNode,gt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new zL),this._pointerdownScheduleRepeatTimer=this._register(new yf)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,qr(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},VL=class Nh{constructor(t,r,n,i,s,o,l){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,n=n|0,i=i|0,s=s|0,o=o|0,l=l|0),this.rawScrollLeft=i,this.rawScrollTop=l,r<0&&(r=0),i+r>n&&(i=n-r),i<0&&(i=0),s<0&&(s=0),l+s>o&&(l=o-s),l<0&&(l=0),this.width=r,this.scrollWidth=n,this.scrollLeft=i,this.height=s,this.scrollHeight=o,this.scrollTop=l}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,r){return new Nh(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Nh(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,r){let n=this.width!==t.width,i=this.scrollWidth!==t.scrollWidth,s=this.scrollLeft!==t.scrollLeft,o=this.height!==t.height,l=this.scrollHeight!==t.scrollHeight,a=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:i,scrollLeftChanged:s,heightChanged:o,scrollHeightChanged:l,scrollTopChanged:a}}},KL=class extends Ne{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new oe),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new VL(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var n;let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(n=this._smoothScrolling)==null||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let n;t?n=new pg(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=pg.start(this._state,r,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},fg=class{constructor(e,t,r){this.scrollLeft=e,this.scrollTop=t,this.isDone=r}};function Yc(e,t){let r=t-e;return function(n){return e+r*XL(n)}}function qL(e,t,r){return function(n){return n<r?e(n/r):t((n-r)/(1-r))}}var pg=class Lh{constructor(t,r,n,i){this.from=t,this.to=r,this.duration=i,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,r,n){if(Math.abs(t-r)>2.5*n){let i,s;return t<r?(i=t+.75*n,s=r-.75*n):(i=t-.75*n,s=r+.75*n),qL(Yc(t,i),Yc(s,r),.33)}return Yc(t,r)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let r=(t-this.startTime)/this.duration;if(r<1){let n=this.scrollLeft(r),i=this.scrollTop(r);return new fg(n,i,!1)}return new fg(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,r,n){return Lh.start(t,r,n)}static start(t,r,n){n=n+10;let i=Date.now()-10;return new Lh(t,r,i,n)}};function YL(e){return Math.pow(e,3)}function XL(e){return 1-YL(1-e)}var GL=class extends Ne{constructor(e,t,r){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=r,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new yf)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},QL=140,g1=class extends wf{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new GL(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new m1),this._shouldRender=!0,this.domNode=ro(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(we(this.domNode.domNode,gt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new UL(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,r,n){this.slider=ro(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof r=="number"&&this.slider.setWidth(r),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(we(this.slider.domNode,gt.POINTER_DOWN,i=>{i.button===0&&(i.preventDefault(),this._sliderPointerDown(i))})),this.onclick(this.slider.domNode,i=>{i.leftButton&&i.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,r=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);r<=i&&i<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,r;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,r=e.offsetY;else{let i=FL(this.domNode.domNode);t=e.pageX-i.left,r=e.pageY-i.top}let n=this._pointerDownRelativePosition(t,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{let s=this._sliderOrthogonalPointerPosition(i),o=Math.abs(s-r);if(h1&&o>QL){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let l=this._sliderPointerPosition(i)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(l))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},_1=class Th{constructor(t,r,n,i,s,o){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=i,this._scrollSize=s,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Th(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,n,i,s){let o=Math.max(0,n-t),l=Math.max(0,o-2*r),a=i>0&&i>n;if(!a)return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*l/i))),h=(l-c)/(i-n),u=s*h;return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(c),computedSliderRatio:h,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=Th._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,n=this._scrollPosition;return r<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let r=this._computedSliderPosition+t;return Math.round(r/this._computedSliderRatio)}},ZL=class extends g1{constructor(e,t,r){let n=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new _1(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},JL=class extends g1{constructor(e,t,r){let n=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new _1(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},eT=500,mg=50,tT=class{constructor(e,t,r){this.timestamp=e,this.deltaX=t,this.deltaY=r,this.score=0}},Ph=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,r=0,n=1,i=this._rear;do{let s=i===this._front?t:Math.pow(2,-n);if(t-=s,r+=this._memory[i].score*s,i===this._front)break;i=(this._capacity+i-1)%this._capacity,n++}while(!0);return r<=.5}acceptStandardWheelEvent(t){if(_f){let r=qr(t.browserEvent),n=dL(r);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,r,n){let i=null,s=new tT(t,r,n);this._front===-1&&this._rear===-1?(this._memory[0]=s,this._front=0,this._rear=0):(i=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=s),s.score=this._computeScore(s,i)}_computeScore(t,r){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(n+=.25),r){let i=Math.abs(t.deltaX),s=Math.abs(t.deltaY),o=Math.abs(r.deltaX),l=Math.abs(r.deltaY),a=Math.max(Math.min(i,o),1),c=Math.max(Math.min(s,l),1),h=Math.max(i,o),u=Math.max(s,l);h%a===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Ph.INSTANCE=new Ph;var rT=Ph,nT=class extends wf{constructor(e,t,r){super(),this._onScroll=this._register(new oe),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new oe),this.onWillScroll=this._onWillScroll.event,this._options=sT(t),this._scrollable=r,this._register(this._scrollable.onScroll(i=>{this._onWillScroll.fire(i),this._onDidScroll(i),this._onScroll.fire(i)}));let n={onMouseWheel:i=>this._onMouseWheel(i),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new JL(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new ZL(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=ro(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ro(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ro(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,i=>this._onMouseOver(i)),this.onmouseleave(this._listenOnDomNode,i=>this._onMouseLeave(i)),this._hideTimeout=this._register(new yf),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=vi(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Gr&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new ag(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=vi(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new ag(r))};this._mouseWheelToDispose.push(we(this._listenOnDomNode,gt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var i;if((i=e.browserEvent)!=null&&i.defaultPrevented)return;let t=rT.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+s===0?o=s=0:Math.abs(s)>=Math.abs(o)?o=0:s=0),this._options.flipAxes&&([s,o]=[o,s]);let l=!Gr&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!o&&(o=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);let a=this._scrollable.getFutureScrollPosition(),c={};if(s){let h=mg*s,u=a.scrollTop-(h<0?Math.floor(h):Math.ceil(h));this._verticalScrollbar.writeScrollPosition(c,u)}if(o){let h=mg*o,u=a.scrollLeft-(h<0?Math.floor(h):Math.ceil(h));this._horizontalScrollbar.writeScrollPosition(c,u)}c=this._scrollable.validateScrollPosition(c),(a.scrollLeft!==c.scrollLeft||a.scrollTop!==c.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(c):this._scrollable.setScrollPositionNow(c),r=!0)}let n=r;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,r=e.scrollLeft>0,n=r?" left":"",i=t?" top":"",s=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${i}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),eT)}},iT=class extends nT{constructor(e,t,r){super(e,t,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function sT(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Gr&&(t.className+=" mac"),t}var Dh=class extends Ne{constructor(e,t,r,n,i,s,o,l){super(),this._bufferService=r,this._optionsService=o,this._renderService=l,this._onRequestScrollLines=this._register(new oe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let a=this._register(new KL({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:c=>xf(n.window,c)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{a.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new iT(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},a)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(c=>{this._scrollableElement.updateOptions({handleMouseWheel:!(c&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Ct.runAndSubscribe(s.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=s.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Ue(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Ue(()=>this._styleElement.remove())),this._register(Ct.runAndSubscribe(s.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${s.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${s.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${s.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
129
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(c=>this._handleScroll(c)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r=t-this._bufferService.buffer.ydisp;r!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};Dh=tt([he(2,Ht),he(3,mn),he(4,Qy),he(5,fs),he(6,Wt),he(7,gn)],Dh);var Rh=class extends Ne{constructor(e,t,r,n,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=r,this._decorationService=n,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(s=>this._removeDecoration(s))),this._register(Ue(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var n;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((n=e==null?void 0:e.options)==null?void 0:n.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r=e.options.x??0;return r&&r>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,t=e.element){if(!t)return;let r=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=r?`${r*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};Rh=tt([he(1,Ht),he(2,mn),he(3,Fo),he(4,gn)],Rh);var oT=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,r){return t>=e.startBufferLine-this._linePadding[r||"full"]&&t<=e.endBufferLine+this._linePadding[r||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Fr={full:0,left:0,center:0,right:0},xn={full:0,left:0,center:0,right:0},Ns={full:0,left:0,center:0,right:0},_a=class extends Ne{constructor(e,t,r,n,i,s,o,l){var c;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=r,this._decorationService=n,this._renderService=i,this._optionsService=s,this._themeService=o,this._coreBrowserService=l,this._colorZoneStore=new oT,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(c=this._viewportElement.parentElement)==null||c.insertBefore(this._canvas,this._viewportElement),this._register(Ue(()=>{var h;return(h=this._canvas)==null?void 0:h.remove()}));let a=this._canvas.getContext("2d");if(a)this._ctx=a;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);xn.full=this._canvas.width,xn.left=e,xn.center=t,xn.right=e,this._refreshDrawHeightConstants(),Ns.full=1,Ns.left=1,Ns.center=1+xn.left,Ns.right=1+xn.left+xn.center}_refreshDrawHeightConstants(){Fr.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Fr.left=t,Fr.center=t,Fr.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Fr.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Fr.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Fr.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Fr.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Ns[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Fr[e.position||"full"]/2),xn[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Fr[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};_a=tt([he(2,Ht),he(3,Fo),he(4,gn),he(5,Wt),he(6,fs),he(7,mn)],_a);var G;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
130
|
+
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(G||(G={}));var Al;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(Al||(Al={}));var v1;(e=>e.ST=`${G.ESC}\\`)(v1||(v1={}));var Mh=class{constructor(e,t,r,n,i,s){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=n,this._coreService=i,this._renderService=s,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let r;t.start+=this._dataAlreadySent.length,this._isComposing?r=this._textarea.value.substring(t.start,this._compositionPosition.start):r=this._textarea.value.substring(t.start),r.length>0&&this._coreService.triggerDataEvent(r,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,r=t.replace(e,"");this._dataAlreadySent=r,t.length>e.length?this._coreService.triggerDataEvent(r,!0):t.length<e.length?this._coreService.triggerDataEvent(`${G.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,i=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let s=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Mh=tt([he(2,Ht),he(3,Wt),he(4,ki),he(5,gn)],Mh);var vt=0,yt=0,xt=0,Je=0,gg={css:"#00000000",rgba:0},lt;(e=>{function t(i,s,o,l){return l!==void 0?`#${Xn(i)}${Xn(s)}${Xn(o)}${Xn(l)}`:`#${Xn(i)}${Xn(s)}${Xn(o)}`}e.toCss=t;function r(i,s,o,l=255){return(i<<24|s<<16|o<<8|l)>>>0}e.toRgba=r;function n(i,s,o,l){return{css:e.toCss(i,s,o,l),rgba:e.toRgba(i,s,o,l)}}e.toColor=n})(lt||(lt={}));var $e;(e=>{function t(a,c){if(Je=(c.rgba&255)/255,Je===1)return{css:c.css,rgba:c.rgba};let h=c.rgba>>24&255,u=c.rgba>>16&255,f=c.rgba>>8&255,p=a.rgba>>24&255,m=a.rgba>>16&255,g=a.rgba>>8&255;vt=p+Math.round((h-p)*Je),yt=m+Math.round((u-m)*Je),xt=g+Math.round((f-g)*Je);let x=lt.toCss(vt,yt,xt),_=lt.toRgba(vt,yt,xt);return{css:x,rgba:_}}e.blend=t;function r(a){return(a.rgba&255)===255}e.isOpaque=r;function n(a,c,h){let u=Bl.ensureContrastRatio(a.rgba,c.rgba,h);if(u)return lt.toColor(u>>24&255,u>>16&255,u>>8&255)}e.ensureContrastRatio=n;function i(a){let c=(a.rgba|255)>>>0;return[vt,yt,xt]=Bl.toChannels(c),{css:lt.toCss(vt,yt,xt),rgba:c}}e.opaque=i;function s(a,c){return Je=Math.round(c*255),[vt,yt,xt]=Bl.toChannels(a.rgba),{css:lt.toCss(vt,yt,xt,Je),rgba:lt.toRgba(vt,yt,xt,Je)}}e.opacity=s;function o(a,c){return Je=a.rgba&255,s(a,Je*c/255)}e.multiplyOpacity=o;function l(a){return[a.rgba>>24&255,a.rgba>>16&255,a.rgba>>8&255]}e.toColorRGB=l})($e||($e={}));var Ke;(e=>{let t,r;try{let i=document.createElement("canvas");i.width=1,i.height=1;let s=i.getContext("2d",{willReadFrequently:!0});s&&(t=s,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function n(i){if(i.match(/#[\da-f]{3,8}/i))switch(i.length){case 4:return vt=parseInt(i.slice(1,2).repeat(2),16),yt=parseInt(i.slice(2,3).repeat(2),16),xt=parseInt(i.slice(3,4).repeat(2),16),lt.toColor(vt,yt,xt);case 5:return vt=parseInt(i.slice(1,2).repeat(2),16),yt=parseInt(i.slice(2,3).repeat(2),16),xt=parseInt(i.slice(3,4).repeat(2),16),Je=parseInt(i.slice(4,5).repeat(2),16),lt.toColor(vt,yt,xt,Je);case 7:return{css:i,rgba:(parseInt(i.slice(1),16)<<8|255)>>>0};case 9:return{css:i,rgba:parseInt(i.slice(1),16)>>>0}}let s=i.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return vt=parseInt(s[1]),yt=parseInt(s[2]),xt=parseInt(s[3]),Je=Math.round((s[5]===void 0?1:parseFloat(s[5]))*255),lt.toColor(vt,yt,xt,Je);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=i,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[vt,yt,xt,Je]=t.getImageData(0,0,1,1).data,Je!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:lt.toRgba(vt,yt,xt,Je),css:i}}e.toColor=n})(Ke||(Ke={}));var Bt;(e=>{function t(n){return r(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function r(n,i,s){let o=n/255,l=i/255,a=s/255,c=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),u=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4);return c*.2126+h*.7152+u*.0722}e.relativeLuminance2=r})(Bt||(Bt={}));var Bl;(e=>{function t(o,l){if(Je=(l&255)/255,Je===1)return l;let a=l>>24&255,c=l>>16&255,h=l>>8&255,u=o>>24&255,f=o>>16&255,p=o>>8&255;return vt=u+Math.round((a-u)*Je),yt=f+Math.round((c-f)*Je),xt=p+Math.round((h-p)*Je),lt.toRgba(vt,yt,xt)}e.blend=t;function r(o,l,a){let c=Bt.relativeLuminance(o>>8),h=Bt.relativeLuminance(l>>8);if(en(c,h)<a){if(h<c){let p=n(o,l,a),m=en(c,Bt.relativeLuminance(p>>8));if(m<a){let g=i(o,l,a),x=en(c,Bt.relativeLuminance(g>>8));return m>x?p:g}return p}let u=i(o,l,a),f=en(c,Bt.relativeLuminance(u>>8));if(f<a){let p=n(o,l,a),m=en(c,Bt.relativeLuminance(p>>8));return f>m?u:p}return u}}e.ensureContrastRatio=r;function n(o,l,a){let c=o>>24&255,h=o>>16&255,u=o>>8&255,f=l>>24&255,p=l>>16&255,m=l>>8&255,g=en(Bt.relativeLuminance2(f,p,m),Bt.relativeLuminance2(c,h,u));for(;g<a&&(f>0||p>0||m>0);)f-=Math.max(0,Math.ceil(f*.1)),p-=Math.max(0,Math.ceil(p*.1)),m-=Math.max(0,Math.ceil(m*.1)),g=en(Bt.relativeLuminance2(f,p,m),Bt.relativeLuminance2(c,h,u));return(f<<24|p<<16|m<<8|255)>>>0}e.reduceLuminance=n;function i(o,l,a){let c=o>>24&255,h=o>>16&255,u=o>>8&255,f=l>>24&255,p=l>>16&255,m=l>>8&255,g=en(Bt.relativeLuminance2(f,p,m),Bt.relativeLuminance2(c,h,u));for(;g<a&&(f<255||p<255||m<255);)f=Math.min(255,f+Math.ceil((255-f)*.1)),p=Math.min(255,p+Math.ceil((255-p)*.1)),m=Math.min(255,m+Math.ceil((255-m)*.1)),g=en(Bt.relativeLuminance2(f,p,m),Bt.relativeLuminance2(c,h,u));return(f<<24|p<<16|m<<8|255)>>>0}e.increaseLuminance=i;function s(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=s})(Bl||(Bl={}));function Xn(e){let t=e.toString(16);return t.length<2?"0"+t:t}function en(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var lT=class extends zo{constructor(e,t,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},va=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new kr}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let r=[],n=t.translateToString(!0),i=0,s=0,o=0,l=t.getFg(0),a=t.getBg(0);for(let c=0;c<t.getTrimmedLength();c++)if(t.loadCell(c,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==l||this._workCell.bg!==a){if(c-i>1){let h=this._getJoinedRanges(n,o,s,t,i);for(let u=0;u<h.length;u++)r.push(h[u])}i=c,o=s,l=this._workCell.fg,a=this._workCell.bg}s+=this._workCell.getChars().length||Pn.length}if(this._bufferService.cols-i>1){let c=this._getJoinedRanges(n,o,s,t,i);for(let h=0;h<c.length;h++)r.push(c[h])}return r}_getJoinedRanges(e,t,r,n,i){let s=e.substring(t,r),o=[];try{o=this._characterJoiners[0].handler(s)}catch(l){console.error(l)}for(let l=1;l<this._characterJoiners.length;l++)try{let a=this._characterJoiners[l].handler(s);for(let c=0;c<a.length;c++)va._mergeRanges(o,a[c])}catch(a){console.error(a)}return this._stringRangesToCellRanges(o,n,i),o}_stringRangesToCellRanges(e,t,r){let n=0,i=!1,s=0,o=e[n];if(o){for(let l=r;l<this._bufferService.cols;l++){let a=t.getWidth(l),c=t.getString(l).length||Pn.length;if(a!==0){if(!i&&o[0]<=s&&(o[0]=l,i=!0),o[1]<=s){if(o[1]=l,o=e[++n],!o)break;o[0]<=s?(o[0]=l,i=!0):i=!1}s+=c}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let r=!1;for(let n=0;n<e.length;n++){let i=e[n];if(r){if(t[1]<=i[0])return e[n-1][1]=t[1],e;if(t[1]<=i[1])return e[n-1][1]=Math.max(t[1],i[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=i[0])return e.splice(n,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),r=!0);continue}}return r?e[e.length-1][1]=t[1]:e.push(t),e}};va=tt([he(0,Ht)],va);function aT(e){return 57508<=e&&e<=57558}function cT(e){return 9472<=e&&e<=9631}function uT(e){return aT(e)||cT(e)}function hT(){return{css:{canvas:fl(),cell:fl()},device:{canvas:fl(),cell:fl(),char:{width:0,height:0,left:0,top:0}}}}function fl(){return{width:0,height:0}}var Ih=class{constructor(e,t,r,n,i,s,o){this._document=e,this._characterJoinerService=t,this._optionsService=r,this._coreBrowserService=n,this._coreService=i,this._decorationService=s,this._themeService=o,this._workCell=new kr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,r){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=r}createRow(e,t,r,n,i,s,o,l,a,c,h){let u=[],f=this._characterJoinerService.getJoinedCharacters(t),p=this._themeService.colors,m=e.getNoBgTrimmedLength();r&&m<s+1&&(m=s+1);let g,x=0,_="",v=0,y=0,N=0,L=0,C=!1,D=0,z=!1,F=0,E=0,H=[],B=c!==-1&&h!==-1;for(let I=0;I<m;I++){e.loadCell(I,this._workCell);let W=this._workCell.getWidth();if(W===0)continue;let T=!1,O=I>=E,V=I,P=this._workCell;if(f.length>0&&I===f[0][0]&&O){let Se=f.shift(),Ae=this._isCellInSelection(Se[0],t);for(v=Se[0]+1;v<Se[1];v++)O&&(O=Ae===this._isCellInSelection(v,t));O&&(O=!r||s<Se[0]||s>=Se[1]),O?(T=!0,P=new lT(this._workCell,e.translateToString(!0,Se[0],Se[1]),Se[1]-Se[0]),V=Se[1]-1,W=P.getWidth()):E=Se[1]}let $=this._isCellInSelection(I,t),w=r&&I===s,re=B&&I>=c&&I<=h,ce=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,Se=>{ce=!0});let k=P.getChars()||Pn;if(k===" "&&(P.isUnderline()||P.isOverline())&&(k=" "),F=W*l-a.get(k,P.isBold(),P.isItalic()),!g)g=this._document.createElement("span");else if(x&&($&&z||!$&&!z&&P.bg===y)&&($&&z&&p.selectionForeground||P.fg===N)&&P.extended.ext===L&&re===C&&F===D&&!w&&!T&&!ce&&O){P.isInvisible()?_+=Pn:_+=k,x++;continue}else x&&(g.textContent=_),g=this._document.createElement("span"),x=0,_="";if(y=P.bg,N=P.fg,L=P.extended.ext,C=re,D=F,z=$,T&&s>=I&&s<=V&&(s=I),!this._coreService.isCursorHidden&&w&&this._coreService.isCursorInitialized){if(H.push("xterm-cursor"),this._coreBrowserService.isFocused)o&&H.push("xterm-cursor-blink"),H.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(i)switch(i){case"outline":H.push("xterm-cursor-outline");break;case"block":H.push("xterm-cursor-block");break;case"bar":H.push("xterm-cursor-bar");break;case"underline":H.push("xterm-cursor-underline");break}}if(P.isBold()&&H.push("xterm-bold"),P.isItalic()&&H.push("xterm-italic"),P.isDim()&&H.push("xterm-dim"),P.isInvisible()?_=Pn:_=P.getChars()||Pn,P.isUnderline()&&(H.push(`xterm-underline-${P.extended.underlineStyle}`),_===" "&&(_=" "),!P.isUnderlineColorDefault()))if(P.isUnderlineColorRGB())g.style.textDecorationColor=`rgb(${zo.toColorRGB(P.getUnderlineColor()).join(",")})`;else{let Se=P.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&P.isBold()&&Se<8&&(Se+=8),g.style.textDecorationColor=p.ansi[Se].css}P.isOverline()&&(H.push("xterm-overline"),_===" "&&(_=" ")),P.isStrikethrough()&&H.push("xterm-strikethrough"),re&&(g.style.textDecoration="underline");let me=P.getFgColor(),Q=P.getFgColorMode(),J=P.getBgColor(),X=P.getBgColorMode(),ae=!!P.isInverse();if(ae){let Se=me;me=J,J=Se;let Ae=Q;Q=X,X=Ae}let ue,ge,M=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,Se=>{Se.options.layer!=="top"&&M||(Se.backgroundColorRGB&&(X=50331648,J=Se.backgroundColorRGB.rgba>>8&16777215,ue=Se.backgroundColorRGB),Se.foregroundColorRGB&&(Q=50331648,me=Se.foregroundColorRGB.rgba>>8&16777215,ge=Se.foregroundColorRGB),M=Se.options.layer==="top")}),!M&&$&&(ue=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,J=ue.rgba>>8&16777215,X=50331648,M=!0,p.selectionForeground&&(Q=50331648,me=p.selectionForeground.rgba>>8&16777215,ge=p.selectionForeground)),M&&H.push("xterm-decoration-top");let ke;switch(X){case 16777216:case 33554432:ke=p.ansi[J],H.push(`xterm-bg-${J}`);break;case 50331648:ke=lt.toColor(J>>16,J>>8&255,J&255),this._addStyle(g,`background-color:#${_g((J>>>0).toString(16),"0",6)}`);break;case 0:default:ae?(ke=p.foreground,H.push("xterm-bg-257")):ke=p.background}switch(ue||P.isDim()&&(ue=$e.multiplyOpacity(ke,.5)),Q){case 16777216:case 33554432:P.isBold()&&me<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(me+=8),this._applyMinimumContrast(g,ke,p.ansi[me],P,ue,void 0)||H.push(`xterm-fg-${me}`);break;case 50331648:let Se=lt.toColor(me>>16&255,me>>8&255,me&255);this._applyMinimumContrast(g,ke,Se,P,ue,ge)||this._addStyle(g,`color:#${_g(me.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(g,ke,p.foreground,P,ue,ge)||ae&&H.push("xterm-fg-257")}H.length&&(g.className=H.join(" "),H.length=0),!w&&!T&&!ce&&O?x++:g.textContent=_,F!==this.defaultSpacing&&(g.style.letterSpacing=`${F}px`),u.push(g),I=V}return g&&x&&(g.textContent=_),u}_applyMinimumContrast(e,t,r,n,i,s){if(this._optionsService.rawOptions.minimumContrastRatio===1||uT(n.getCode()))return!1;let o=this._getContrastCache(n),l;if(!i&&!s&&(l=o.getColor(t.rgba,r.rgba)),l===void 0){let a=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);l=$e.ensureContrastRatio(i||t,s||r,a),o.setColor((i||t).rgba,(s||r).rgba,l??null)}return l?(this._addStyle(e,`color:${l.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let r=this._selectionStart,n=this._selectionEnd;return!r||!n?!1:this._columnSelectMode?r[0]<=n[0]?e>=r[0]&&t>=r[1]&&e<n[0]&&t<=n[1]:e<r[0]&&t>=r[1]&&e>=n[0]&&t<=n[1]:t>r[1]&&t<n[1]||r[1]===n[1]&&t===r[1]&&e>=r[0]&&e<n[0]||r[1]<n[1]&&t===n[1]&&e<n[0]||r[1]<n[1]&&t===r[1]&&e>=r[0]}};Ih=tt([he(1,e1),he(2,Wt),he(3,mn),he(4,ki),he(5,Fo),he(6,fs)],Ih);function _g(e,t,r){for(;e.length<r;)e=t+e;return e}var dT=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let r=e.createElement("span");r.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let i=e.createElement("span");i.classList.add("xterm-char-measure-element"),i.style.fontStyle="italic";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold",s.style.fontStyle="italic",this._measureElements=[r,n,i,s],this._container.appendChild(r),this._container.appendChild(n),this._container.appendChild(i),this._container.appendChild(s),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,r,n){e===this._font&&t===this._fontSize&&r===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=r,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${r}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${r}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,r){let n=0;if(!t&&!r&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let o=this._measure(e,0);return o>0&&(this._flat[n]=o),o}let i=e;t&&(i+="B"),r&&(i+="I");let s=this._holey.get(i);if(s===void 0){let o=0;t&&(o|=1),r&&(o|=2),s=this._measure(e,o),s>0&&this._holey.set(i,s)}return s}_measure(e,t){let r=this._measureElements[t];return r.textContent=e.repeat(32),r.offsetWidth/32}},fT=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,r,n=!1){if(this.selectionStart=t,this.selectionEnd=r,!t||!r||t[0]===r[0]&&t[1]===r[1]){this.clear();return}let i=e.buffers.active.ydisp,s=t[1]-i,o=r[1]-i,l=Math.max(s,0),a=Math.min(o,e.rows-1);if(l>=e.rows||a<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=s,this.viewportEndRow=o,this.viewportCappedStartRow=l,this.viewportCappedEndRow=a,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t<this.endCol&&r<=this.viewportCappedEndRow:t<this.startCol&&r>=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol):!1}};function pT(){return new fT}var Xc="xterm-dom-renderer-owner-",mr="xterm-rows",pl="xterm-fg-",vg="xterm-bg-",Ls="xterm-focus",ml="xterm-selection",mT=1,Ah=class extends Ne{constructor(e,t,r,n,i,s,o,l,a,c,h,u,f,p){super(),this._terminal=e,this._document=t,this._element=r,this._screenElement=n,this._viewportElement=i,this._helperContainer=s,this._linkifier2=o,this._charSizeService=a,this._optionsService=c,this._bufferService=h,this._coreService=u,this._coreBrowserService=f,this._themeService=p,this._terminalClass=mT++,this._rowElements=[],this._selectionRenderModel=pT(),this.onRequestRedraw=this._register(new oe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(mr),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(ml),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=hT(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(m=>this._injectCss(m))),this._injectCss(this._themeService.colors),this._rowFactory=l.createInstance(Ih,document),this._element.classList.add(Xc+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(m=>this._handleLinkHover(m))),this._register(this._linkifier2.onHideLinkUnderline(m=>this._handleLinkLeave(m))),this._register(Ue(()=>{this._element.classList.remove(Xc+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new dT(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let r of this._rowElements)r.style.width=`${this.dimensions.css.canvas.width}px`,r.style.height=`${this.dimensions.css.cell.height}px`,r.style.lineHeight=`${this.dimensions.css.cell.height}px`,r.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${mr} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${mr} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${mr} .xterm-dim { color: ${$e.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let r=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${mr}.${Ls} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${mr}.${Ls} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${mr}.${Ls} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${mr} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${mr} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${mr} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${mr} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${mr} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${ml} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${ml} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${ml} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[s,o]of e.ansi.entries())t+=`${this._terminalSelector} .${pl}${s} { color: ${o.css}; }${this._terminalSelector} .${pl}${s}.xterm-dim { color: ${$e.multiplyOpacity(o,.5).css}; }${this._terminalSelector} .${vg}${s} { background-color: ${o.css}; }`;t+=`${this._terminalSelector} .${pl}257 { color: ${$e.opaque(e.background).css}; }${this._terminalSelector} .${pl}257.xterm-dim { color: ${$e.multiplyOpacity($e.opaque(e.background),.5).css}; }${this._terminalSelector} .${vg}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let r=this._rowElements.length;r<=t;r++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Ls),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Ls),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,r),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,r),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,s=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,l=this._document.createDocumentFragment();if(r){let a=e[0]>t[0];l.appendChild(this._createSelectionElement(s,a?t[0]:e[0],a?e[0]:t[0],o-s+1))}else{let a=n===s?e[0]:0,c=s===i?t[0]:this._bufferService.cols;l.appendChild(this._createSelectionElement(s,a,c));let h=o-s-1;if(l.appendChild(this._createSelectionElement(s+1,0,this._bufferService.cols,h)),s!==o){let u=i===o?t[0]:this._bufferService.cols;l.appendChild(this._createSelectionElement(o,0,u))}}this._selectionContainer.appendChild(l)}_createSelectionElement(e,t,r,n=1){let i=this._document.createElement("div"),s=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(r-t);return s+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-s),i.style.height=`${n*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${s}px`,i.style.width=`${o}px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let r=this._bufferService.buffer,n=r.ybase+r.y,i=Math.min(r.x,this._bufferService.cols-1),s=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,l=this._optionsService.rawOptions.cursorInactiveStyle;for(let a=e;a<=t;a++){let c=a+r.ydisp,h=this._rowElements[a],u=r.lines.get(c);if(!h||!u)break;h.replaceChildren(...this._rowFactory.createRow(u,c,c===n,o,l,i,s,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Xc}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,r,n,i,s){r<0&&(e=0),n<0&&(t=0);let o=this._bufferService.rows-1;r=Math.max(Math.min(r,o),0),n=Math.max(Math.min(n,o),0),i=Math.min(i,this._bufferService.cols);let l=this._bufferService.buffer,a=l.ybase+l.y,c=Math.min(l.x,i-1),h=this._optionsService.rawOptions.cursorBlink,u=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let p=r;p<=n;++p){let m=p+l.ydisp,g=this._rowElements[p],x=l.lines.get(m);if(!g||!x)break;g.replaceChildren(...this._rowFactory.createRow(x,m,m===a,u,f,c,h,this.dimensions.css.cell.width,this._widthCache,s?p===r?e:0:-1,s?(p===n?t:i)-1:-1))}}};Ah=tt([he(7,pf),he(8,Ya),he(9,Wt),he(10,Ht),he(11,ki),he(12,mn),he(13,fs)],Ah);var Bh=class extends Ne{constructor(e,t,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new oe),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new _T(this._optionsService))}catch{this._measureStrategy=this._register(new gT(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Bh=tt([he(2,Wt)],Bh);var y1=class extends Ne{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},gT=class extends y1{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},_T=class extends y1{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},vT=class extends Ne{constructor(e,t,r){super(),this._textarea=e,this._window=t,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new yT(this._window)),this._onDprChange=this._register(new oe),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new oe),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register(Ct.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(we(this._textarea,"focus",()=>this._isFocused=!0)),this._register(we(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},yT=class extends Ne{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ss),this._onDprChange=this._register(new oe),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Ue(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=we(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},xT=class extends Ne{constructor(){super(),this.linkProviders=[],this._register(Ue(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Sf(e,t,r){let n=r.getBoundingClientRect(),i=e.getComputedStyle(r),s=parseInt(i.getPropertyValue("padding-left")),o=parseInt(i.getPropertyValue("padding-top"));return[t.clientX-n.left-s,t.clientY-n.top-o]}function wT(e,t,r,n,i,s,o,l,a){if(!s)return;let c=Sf(e,t,r);if(c)return c[0]=Math.ceil((c[0]+(a?o/2:0))/o),c[1]=Math.ceil(c[1]/l),c[0]=Math.min(Math.max(c[0],1),n+(a?1:0)),c[1]=Math.min(Math.max(c[1],1),i),c}var jh=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,r,n,i){return wT(window,e,t,r,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let r=Sf(window,e,t);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};jh=tt([he(0,gn),he(1,Ya)],jh);var ST=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},x1={};R3(x1,{getSafariVersion:()=>kT,isChromeOS:()=>k1,isFirefox:()=>w1,isIpad:()=>CT,isIphone:()=>ET,isLegacyEdge:()=>bT,isLinux:()=>bf,isMac:()=>ya,isNode:()=>Xa,isSafari:()=>S1,isWindows:()=>b1});var Xa=typeof process<"u"&&"title"in process,$o=Xa?"node":navigator.userAgent,Ho=Xa?"node":navigator.platform,w1=$o.includes("Firefox"),bT=$o.includes("Edge"),S1=/^((?!chrome|android).)*safari/i.test($o);function kT(){if(!S1)return 0;let e=$o.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var ya=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Ho),CT=Ho==="iPad",ET=Ho==="iPhone",b1=["Windows","Win16","Win32","WinCE"].includes(Ho),bf=Ho.indexOf("Linux")>=0,k1=/\bCrOS\b/.test($o),C1=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,r=0,n=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),r=Math.max(t,r),i=e.timeRemaining(),r*1.5>i){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=i}this.clear()}},NT=class extends C1{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},LT=class extends C1{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},xa=!Xa&&"requestIdleCallback"in window?LT:NT,TT=class{constructor(){this._queue=new xa}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Oh=class extends Ne{constructor(e,t,r,n,i,s,o,l,a){super(),this._rowCount=e,this._optionsService=r,this._charSizeService=n,this._coreService=i,this._coreBrowserService=l,this._renderer=this._register(new ss),this._pausedResizeTask=new TT,this._observerDisposable=this._register(new ss),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new oe),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new oe),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new oe),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new oe),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new ST((c,h)=>this._renderRows(c,h),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new PT(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Ue(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>{var c;return(c=this._renderer.value)==null?void 0:c.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(s.onDecorationRegistered(()=>this._fullRefresh())),this._register(s.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(a.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(c=>this._registerIntersectionObserver(c,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});r.observe(t),this._observerDisposable.value=Ue(()=>r.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.end)),r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var r;return(r=this._renderer.value)==null?void 0:r.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,r){var n;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,(n=this._renderer.value)==null||n.handleSelectionChanged(e,t,r)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Oh=tt([he(2,Wt),he(3,Ya),he(4,ki),he(5,Fo),he(6,Ht),he(7,mn),he(8,fs)],Oh);var PT=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function DT(e,t,r,n){let i=r.buffer.x,s=r.buffer.y;if(!r.buffer.hasScrollback)return IT(i,s,e,t,r,n)+Ga(s,t,r,n)+AT(i,s,e,t,r,n);let o;if(s===t)return o=i>e?"D":"C",Eo(Math.abs(i-e),Co(o,n));o=s>t?"D":"C";let l=Math.abs(s-t),a=MT(s>t?e:i,r)+(l-1)*r.cols+1+RT(s>t?i:e);return Eo(a,Co(o,n))}function RT(e,t){return e-1}function MT(e,t){return t.cols-e}function IT(e,t,r,n,i,s){return Ga(t,n,i,s).length===0?"":Eo(N1(e,t,e,t-yi(t,i),!1,i).length,Co("D",s))}function Ga(e,t,r,n){let i=e-yi(e,r),s=t-yi(t,r),o=Math.abs(i-s)-BT(e,t,r);return Eo(o,Co(E1(e,t),n))}function AT(e,t,r,n,i,s){let o;Ga(t,n,i,s).length>0?o=n-yi(n,i):o=t;let l=n,a=jT(e,t,r,n,i,s);return Eo(N1(e,o,r,l,a==="C",i).length,Co(a,s))}function BT(e,t,r){var o;let n=0,i=e-yi(e,r),s=t-yi(t,r);for(let l=0;l<Math.abs(i-s);l++){let a=E1(e,t)==="A"?-1:1;(o=r.buffer.lines.get(i+a*l))!=null&&o.isWrapped&&n++}return n}function yi(e,t){let r=0,n=t.buffer.lines.get(e),i=n==null?void 0:n.isWrapped;for(;i&&e>=0&&e<t.rows;)r++,n=t.buffer.lines.get(--e),i=n==null?void 0:n.isWrapped;return r}function jT(e,t,r,n,i,s){let o;return Ga(r,n,i,s).length>0?o=n-yi(n,i):o=t,e<r&&o<=n||e>=r&&o<n?"C":"D"}function E1(e,t){return e>t?"A":"B"}function N1(e,t,r,n,i,s){let o=e,l=t,a="";for(;(o!==r||l!==n)&&l>=0&&l<s.buffer.lines.length;)o+=i?1:-1,i&&o>s.cols-1?(a+=s.buffer.translateBufferLineToString(l,!1,e,o),o=0,e=0,l++):!i&&o<0&&(a+=s.buffer.translateBufferLineToString(l,!1,0,e+1),o=s.cols-1,e=o,l--);return a+s.buffer.translateBufferLineToString(l,!1,e,o)}function Co(e,t){let r=t?"O":"[";return G.ESC+r+e}function Eo(e,t){e=Math.floor(e);let r="";for(let n=0;n<e;n++)r+=t;return r}var OT=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function yg(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Gc=50,zT=15,FT=50,$T=500,HT=" ",WT=new RegExp(HT,"g"),zh=class extends Ne{constructor(e,t,r,n,i,s,o,l,a){super(),this._element=e,this._screenElement=t,this._linkifier=r,this._bufferService=n,this._coreService=i,this._mouseService=s,this._optionsService=o,this._renderService=l,this._coreBrowserService=a,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new kr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new oe),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new oe),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new oe),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new oe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=c=>this._handleMouseMove(c),this._mouseUpListener=c=>this._handleMouseUp(c),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(c=>this._handleTrim(c)),this._register(this._bufferService.buffers.onBufferActivate(c=>this._handleBufferActivate(c))),this.enable(),this._model=new OT(this._bufferService),this._activeSelectionMode=0,this._register(Ue(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(c=>{c.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let r=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let i=e[0]<t[0]?e[0]:t[0],s=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let l=r.translateBufferLineToString(o,!0,i,s);n.push(l)}}else{let i=e[1]===t[1]?t[0]:void 0;n.push(r.translateBufferLineToString(e[1],!0,e[0],i));for(let s=e[1]+1;s<=t[1]-1;s++){let o=r.lines.get(s),l=r.translateBufferLineToString(s,!0);o!=null&&o.isWrapped?n[n.length-1]+=l:n.push(l)}if(e[1]!==t[1]){let s=r.lines.get(t[1]),o=r.translateBufferLineToString(t[1],!0,0,t[0]);s&&s.isWrapped?n[n.length-1]+=o:n.push(o)}}return n.map(i=>i.replace(WT," ")).join(b1?`\r
|
|
131
|
+
`:`
|
|
132
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),bf&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n||!t?!1:this._areCoordsInSelection(t,r,n)}isCellInSelection(e,t){let r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n?!1:this._areCoordsInSelection([e,t],r,n)}_areCoordsInSelection(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var i,s;let r=(s=(i=this._linkifier.currentLink)==null?void 0:i.link)==null?void 0:s.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=yg(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Sf(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-Gc),Gc),t/=Gc,t/Math.abs(t)+Math.round(t*(zT-1)))}shouldForceSelection(e){return ya?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),FT)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(ya&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){let n=r.lines.get(this._model.selectionEnd[1]);n&&n.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<$T&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let r=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r&&r[0]!==void 0&&r[1]!==void 0){let n=DT(r[0]-1,r[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,r=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!r){this._oldHasSelection&&this._fireOnSelectionChange(e,t,r);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,r)}_fireOnSelectionChange(e,t,r){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=r,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let r=t;for(let n=0;t>=n;n++){let i=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?r--:i>1&&t!==n&&(r+=i-1)}return r}setSelection(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,r=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,s=i.lines.get(e[1]);if(!s)return;let o=i.translateBufferLineToString(e[1],!1),l=this._convertViewportColToCharacterIndex(s,e[0]),a=l,c=e[0]-l,h=0,u=0,f=0,p=0;if(o.charAt(l)===" "){for(;l>0&&o.charAt(l-1)===" ";)l--;for(;a<o.length&&o.charAt(a+1)===" ";)a++}else{let x=e[0],_=e[0];s.getWidth(x)===0&&(h++,x--),s.getWidth(_)===2&&(u++,_++);let v=s.getString(_).length;for(v>1&&(p+=v-1,a+=v-1);x>0&&l>0&&!this._isCharWordSeparator(s.loadCell(x-1,this._workCell));){s.loadCell(x-1,this._workCell);let y=this._workCell.getChars().length;this._workCell.getWidth()===0?(h++,x--):y>1&&(f+=y-1,l-=y-1),l--,x--}for(;_<s.length&&a+1<o.length&&!this._isCharWordSeparator(s.loadCell(_+1,this._workCell));){s.loadCell(_+1,this._workCell);let y=this._workCell.getChars().length;this._workCell.getWidth()===2?(u++,_++):y>1&&(p+=y-1,a+=y-1),a++,_++}}a++;let m=l+c-h+f,g=Math.min(this._bufferService.cols,a-l+h+u-f-p);if(!(!t&&o.slice(l,a).trim()==="")){if(r&&m===0&&s.getCodePoint(0)!==32){let x=i.lines.get(e[1]-1);if(x&&s.isWrapped&&x.getCodePoint(this._bufferService.cols-1)!==32){let _=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(_){let v=this._bufferService.cols-_.start;m-=v,g+=v}}}if(n&&m+g===this._bufferService.cols&&s.getCodePoint(this._bufferService.cols-1)!==32){let x=i.lines.get(e[1]+1);if(x!=null&&x.isWrapped&&x.getCodePoint(0)!==32){let _=this._getWordAt([0,e[1]+1],!1,!1,!0);_&&(g+=_.length)}}return{start:m,length:g}}}_selectWordAt(e,t){let r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let r=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=yg(r,this._bufferService.cols)}};zh=tt([he(3,Ht),he(4,ki),he(5,mf),he(6,Wt),he(7,gn),he(8,mn)],zh);var xg=class{constructor(){this._data={}}set(e,t,r){this._data[e]||(this._data[e]={}),this._data[e][t]=r}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},wg=class{constructor(){this._color=new xg,this._css=new xg}setCss(e,t,r){this._css.set(e,t,r)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,r){this._color.set(e,t,r)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},ut=Object.freeze((()=>{let e=[Ke.toColor("#2e3436"),Ke.toColor("#cc0000"),Ke.toColor("#4e9a06"),Ke.toColor("#c4a000"),Ke.toColor("#3465a4"),Ke.toColor("#75507b"),Ke.toColor("#06989a"),Ke.toColor("#d3d7cf"),Ke.toColor("#555753"),Ke.toColor("#ef2929"),Ke.toColor("#8ae234"),Ke.toColor("#fce94f"),Ke.toColor("#729fcf"),Ke.toColor("#ad7fa8"),Ke.toColor("#34e2e2"),Ke.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=t[r/36%6|0],i=t[r/6%6|0],s=t[r%6];e.push({css:lt.toCss(n,i,s),rgba:lt.toRgba(n,i,s)})}for(let r=0;r<24;r++){let n=8+r*10;e.push({css:lt.toCss(n,n,n),rgba:lt.toRgba(n,n,n)})}return e})()),ei=Ke.toColor("#ffffff"),zs=Ke.toColor("#000000"),Sg=Ke.toColor("#ffffff"),bg=zs,Ts={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},UT=ei,Fh=class extends Ne{constructor(e){super(),this._optionsService=e,this._contrastCache=new wg,this._halfContrastCache=new wg,this._onChangeColors=this._register(new oe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:ei,background:zs,cursor:Sg,cursorAccent:bg,selectionForeground:void 0,selectionBackgroundTransparent:Ts,selectionBackgroundOpaque:$e.blend(zs,Ts),selectionInactiveBackgroundTransparent:Ts,selectionInactiveBackgroundOpaque:$e.blend(zs,Ts),scrollbarSliderBackground:$e.opacity(ei,.2),scrollbarSliderHoverBackground:$e.opacity(ei,.4),scrollbarSliderActiveBackground:$e.opacity(ei,.5),overviewRulerBorder:ei,ansi:ut.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=Ie(e.foreground,ei),t.background=Ie(e.background,zs),t.cursor=$e.blend(t.background,Ie(e.cursor,Sg)),t.cursorAccent=$e.blend(t.background,Ie(e.cursorAccent,bg)),t.selectionBackgroundTransparent=Ie(e.selectionBackground,Ts),t.selectionBackgroundOpaque=$e.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Ie(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=$e.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Ie(e.selectionForeground,gg):void 0,t.selectionForeground===gg&&(t.selectionForeground=void 0),$e.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=$e.opacity(t.selectionBackgroundTransparent,.3)),$e.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=$e.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Ie(e.scrollbarSliderBackground,$e.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Ie(e.scrollbarSliderHoverBackground,$e.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Ie(e.scrollbarSliderActiveBackground,$e.opacity(t.foreground,.5)),t.overviewRulerBorder=Ie(e.overviewRulerBorder,UT),t.ansi=ut.slice(),t.ansi[0]=Ie(e.black,ut[0]),t.ansi[1]=Ie(e.red,ut[1]),t.ansi[2]=Ie(e.green,ut[2]),t.ansi[3]=Ie(e.yellow,ut[3]),t.ansi[4]=Ie(e.blue,ut[4]),t.ansi[5]=Ie(e.magenta,ut[5]),t.ansi[6]=Ie(e.cyan,ut[6]),t.ansi[7]=Ie(e.white,ut[7]),t.ansi[8]=Ie(e.brightBlack,ut[8]),t.ansi[9]=Ie(e.brightRed,ut[9]),t.ansi[10]=Ie(e.brightGreen,ut[10]),t.ansi[11]=Ie(e.brightYellow,ut[11]),t.ansi[12]=Ie(e.brightBlue,ut[12]),t.ansi[13]=Ie(e.brightMagenta,ut[13]),t.ansi[14]=Ie(e.brightCyan,ut[14]),t.ansi[15]=Ie(e.brightWhite,ut[15]),e.extendedAnsi){let r=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<r;n++)t.ansi[n+16]=Ie(e.extendedAnsi[n],ut[n+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};Fh=tt([he(0,Wt)],Fh);function Ie(e,t){if(e!==void 0)try{return Ke.toColor(e)}catch{}return t}var VT=class{constructor(...e){this._entries=new Map;for(let[t,r]of e)this.set(t,r)}set(e,t){let r=this._entries.get(e);return this._entries.set(e,t),r}forEach(e){for(let[t,r]of this._entries.entries())e(t,r)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},KT=class{constructor(){this._services=new VT,this._services.set(pf,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let r=z3(e).sort((s,o)=>s.index-o.index),n=[];for(let s of r){let o=this._services.get(s.id);if(!o)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${s.id._id}.`);n.push(o)}let i=r.length>0?r[0].index:t.length;if(t.length!==i)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...n)}},qT={trace:0,debug:1,info:2,warn:3,error:4,off:5},YT="xterm.js: ",$h=class extends Ne{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=qT[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":YT)+t,...r)}trace(e,...t){var r;this._logLevel<=0&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var r;this._logLevel<=1&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var r;this._logLevel<=2&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var r;this._logLevel<=3&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var r;this._logLevel<=4&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.error.bind(this._optionsService.options.logger))??console.error,e,t)}};$h=tt([he(0,Wt)],$h);var kg=class extends Ne{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new oe),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new oe),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new oe),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...r){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+r.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<r.length;n++)this._array[this._getCyclicIndex(e+n)]=r[n];if(r.length&&this.onInsertEmitter.fire({index:e,amount:r.length}),this._length+r.length>this._maxLength){let n=this._length+r.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let i=t-1;i>=0;i--)this.set(e+i+r,this.get(e+i));let n=e+t+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<t;n++)this.set(e+n+r,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ee=3,ot=Object.freeze(new zo),gl=0,Qc=2,Fs=class L1{constructor(t,r,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ee);let i=r||kr.fromCharData([0,qy,1,0]);for(let s=0;s<t;++s)this.setCell(s,i);this.length=t}get(t){let r=this._data[t*Ee+0],n=r&2097151;return[this._data[t*Ee+1],r&2097152?this._combined[t]:n?kn(n):"",r>>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,r){this._data[t*Ee+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*Ee+0]=t|2097152|r[2]<<22):this._data[t*Ee+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*Ee+0]>>22}hasWidth(t){return this._data[t*Ee+0]&12582912}getFg(t){return this._data[t*Ee+1]}getBg(t){return this._data[t*Ee+2]}hasContent(t){return this._data[t*Ee+0]&4194303}getCodePoint(t){let r=this._data[t*Ee+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*Ee+0]&2097152}getString(t){let r=this._data[t*Ee+0];return r&2097152?this._combined[t]:r&2097151?kn(r&2097151):""}isProtected(t){return this._data[t*Ee+2]&536870912}loadCell(t,r){return gl=t*Ee,r.content=this._data[gl+0],r.fg=this._data[gl+1],r.bg=this._data[gl+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Ee+0]=r.content,this._data[t*Ee+1]=r.fg,this._data[t*Ee+2]=r.bg}setCellFromCodepoint(t,r,n,i){i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*Ee+0]=r|n<<22,this._data[t*Ee+1]=i.fg,this._data[t*Ee+2]=i.bg}addCodepointToCell(t,r,n){let i=this._data[t*Ee+0];i&2097152?this._combined[t]+=kn(r):i&2097151?(this._combined[t]=kn(i&2097151)+kn(r),i&=-2097152,i|=2097152):i=r|1<<22,n&&(i&=-12582913,i|=n<<22),this._data[t*Ee+0]=i}insertCells(t,r,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length-t){let i=new kr;for(let s=this.length-t-r-1;s>=0;--s)this.setCell(t+r+s,this.loadCell(t+s,i));for(let s=0;s<r;++s)this.setCell(t+s,n)}else for(let i=t;i<this.length;++i)this.setCell(i,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,r,n){if(t%=this.length,r<this.length-t){let i=new kr;for(let s=0;s<this.length-t-r;++s)this.setCell(t+s,this.loadCell(t+r+s,i));for(let s=this.length-r;s<this.length;++s)this.setCell(s,n)}else for(let i=t;i<this.length;++i)this.setCell(i,n);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,n)}replaceCells(t,r,n,i=!1){if(i){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.isProtected(t)||this.setCell(t,n),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.setCell(t++,n)}resize(t,r){if(t===this.length)return this._data.length*4*Qc<this._data.buffer.byteLength;let n=t*Ee;if(t>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let i=new Uint32Array(n);i.set(this._data),this._data=i}for(let i=this.length;i<t;++i)this.setCell(i,r)}else{this._data=this._data.subarray(0,n);let i=Object.keys(this._combined);for(let o=0;o<i.length;o++){let l=parseInt(i[o],10);l>=t&&delete this._combined[l]}let s=Object.keys(this._extendedAttrs);for(let o=0;o<s.length;o++){let l=parseInt(s[o],10);l>=t&&delete this._extendedAttrs[l]}}return this.length=t,n*4*Qc<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Qc<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,r=!1){if(r){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,t);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let r in t._combined)this._combined[r]=t._combined[r];this._extendedAttrs={};for(let r in t._extendedAttrs)this._extendedAttrs[r]=t._extendedAttrs[r];this.isWrapped=t.isWrapped}clone(){let t=new L1(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let r in this._combined)t._combined[r]=this._combined[r];for(let r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ee+0]&4194303)return t+(this._data[t*Ee+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ee+0]&4194303||this._data[t*Ee+2]&50331648)return t+(this._data[t*Ee+0]>>22);return 0}copyCellsFrom(t,r,n,i,s){let o=t._data;if(s)for(let a=i-1;a>=0;a--){for(let c=0;c<Ee;c++)this._data[(n+a)*Ee+c]=o[(r+a)*Ee+c];o[(r+a)*Ee+2]&268435456&&(this._extendedAttrs[n+a]=t._extendedAttrs[r+a])}else for(let a=0;a<i;a++){for(let c=0;c<Ee;c++)this._data[(n+a)*Ee+c]=o[(r+a)*Ee+c];o[(r+a)*Ee+2]&268435456&&(this._extendedAttrs[n+a]=t._extendedAttrs[r+a])}let l=Object.keys(t._combined);for(let a=0;a<l.length;a++){let c=parseInt(l[a],10);c>=r&&(this._combined[c-r+n]=t._combined[c])}}translateToString(t,r,n,i){r=r??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),i&&(i.length=0);let s="";for(;r<n;){let o=this._data[r*Ee+0],l=o&2097151,a=o&2097152?this._combined[r]:l?kn(l):Pn;if(s+=a,i)for(let c=0;c<a.length;++c)i.push(r);r+=o>>22||1}return i&&i.push(r),s}};function XT(e,t,r,n,i,s){let o=[];for(let l=0;l<e.length-1;l++){let a=l,c=e.get(++a);if(!c.isWrapped)continue;let h=[e.get(l)];for(;a<e.length&&c.isWrapped;)h.push(c),c=e.get(++a);if(!s&&n>=l&&n<a){l+=h.length-1;continue}let u=0,f=No(h,u,t),p=1,m=0;for(;p<h.length;){let x=No(h,p,t),_=x-m,v=r-f,y=Math.min(_,v);h[u].copyCellsFrom(h[p],m,f,y,!1),f+=y,f===r&&(u++,f=0),m+=y,m===x&&(p++,m=0),f===0&&u!==0&&h[u-1].getWidth(r-1)===2&&(h[u].copyCellsFrom(h[u-1],r-1,f++,1,!1),h[u-1].setCell(r-1,i))}h[u].replaceCells(f,r,i);let g=0;for(let x=h.length-1;x>0&&(x>u||h[x].getTrimmedLength()===0);x--)g++;g>0&&(o.push(l+h.length-g),o.push(g)),l+=h.length-1}return o}function GT(e,t){let r=[],n=0,i=t[n],s=0;for(let o=0;o<e.length;o++)if(i===o){let l=t[++n];e.onDeleteEmitter.fire({index:o-s,amount:l}),o+=l-1,s+=l,i=t[++n]}else r.push(o);return{layout:r,countRemoved:s}}function QT(e,t){let r=[];for(let n=0;n<t.length;n++)r.push(e.get(t[n]));for(let n=0;n<r.length;n++)e.set(n,r[n]);e.length=t.length}function ZT(e,t,r){let n=[],i=e.map((a,c)=>No(e,c,t)).reduce((a,c)=>a+c),s=0,o=0,l=0;for(;l<i;){if(i-l<r){n.push(i-l);break}s+=r;let a=No(e,o,t);s>a&&(s-=a,o++);let c=e[o].getWidth(s-1)===2;c&&s--;let h=c?r-1:r;n.push(h),l+=h}return n}function No(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,i=e[t+1].getWidth(0)===2;return n&&i?r-1:r}var T1=class P1{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=P1._nextId++,this._onDispose=this.register(new oe),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),vi(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};T1._nextId=1;var JT=T1,pt={},ti=pt.B;pt[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};pt.A={"#":"£"};pt.B=void 0;pt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};pt.C=pt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};pt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};pt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};pt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};pt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};pt.E=pt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};pt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};pt.H=pt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};pt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Cg=4294967295,Eg=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=ot.clone(),this.savedCharset=ti,this.markers=[],this._nullCell=kr.fromCharData([0,qy,1,0]),this._whitespaceCell=kr.fromCharData([0,Pn,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new xa,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new kg(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new ga),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new ga),this._whitespaceCell}getBlankLine(e,t){return new Fs(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>Cg?Cg:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=ot);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new kg(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(ot),n=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let o=0;o<this.lines.length;o++)n+=+this.lines.get(o).resize(e,r);let s=0;if(this._rows<t)for(let o=this._rows;o<t;o++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Fs(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new Fs(e,r)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let o=this.lines.length-i;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),s&&(this.y+=s),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let s=0;s<this.lines.length;s++)n+=+this.lines.get(s).resize(e,r);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=XT(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(ot),r);if(n.length>0){let i=GT(this.lines,n);QT(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let n=this.getNullCell(ot),i=r;for(;i-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Fs(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(ot),i=[],s=0;for(let o=this.lines.length-1;o>=0;o--){let l=this.lines.get(o);if(!l||!l.isWrapped&&l.getTrimmedLength()<=e)continue;let a=[l];for(;l.isWrapped&&o>0;)l=this.lines.get(--o),a.unshift(l);if(!r){let y=this.ybase+this.y;if(y>=o&&y<o+a.length)continue}let c=a[a.length-1].getTrimmedLength(),h=ZT(a,this._cols,e),u=h.length-a.length,f;this.ybase===0&&this.y!==this.lines.length-1?f=Math.max(0,this.y-this.lines.maxLength+u):f=Math.max(0,this.lines.length-this.lines.maxLength+u);let p=[];for(let y=0;y<u;y++){let N=this.getBlankLine(ot,!0);p.push(N)}p.length>0&&(i.push({start:o+a.length+s,newLines:p}),s+=p.length),a.push(...p);let m=h.length-1,g=h[m];g===0&&(m--,g=h[m]);let x=a.length-u-1,_=c;for(;x>=0;){let y=Math.min(_,g);if(a[m]===void 0)break;if(a[m].copyCellsFrom(a[x],_-y,g-y,y,!0),g-=y,g===0&&(m--,g=h[m]),_-=y,_===0){x--;let N=Math.max(x,0);_=No(a,N,this._cols)}}for(let y=0;y<a.length;y++)h[y]<e&&a[y].setCell(h[y],n);let v=u-f;for(;v-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+s)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+u,this.ybase+t-1)}if(i.length>0){let o=[],l=[];for(let g=0;g<this.lines.length;g++)l.push(this.lines.get(g));let a=this.lines.length,c=a-1,h=0,u=i[h];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);let f=0;for(let g=Math.min(this.lines.maxLength-1,a+s-1);g>=0;g--)if(u&&u.start>c+f){for(let x=u.newLines.length-1;x>=0;x--)this.lines.set(g--,u.newLines[x]);g++,o.push({index:c+1,amount:u.newLines.length}),f+=u.newLines.length,u=i[++h]}else this.lines.set(g,l[c--]);let p=0;for(let g=o.length-1;g>=0;g--)o[g].index+=p,this.lines.onInsertEmitter.fire(o[g]),p+=o[g].amount;let m=Math.max(0,a+s-this.lines.maxLength);m>0&&this.lines.onTrimEmitter.fire(m)}}translateBufferLineToString(e,t,r=0,n){let i=this.lines.get(e);return i?i.translateToString(t,r,n):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new JT(e);return this.markers.push(t),t.register(this.lines.onTrim(r=>{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.line<r.index+r.amount&&t.dispose(),t.line>r.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},e4=class extends Ne{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new oe),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new Eg(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Eg(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},D1=2,R1=1,Hh=class extends Ne{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new oe),this.onResize=this._onResize.event,this._onScroll=this._register(new oe),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,D1),this.rows=Math.max(e.rawOptions.rows||0,R1),this.buffers=this._register(new e4(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=r.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;let i=r.ybase+r.scrollTop,s=r.ybase+r.scrollBottom;if(r.scrollTop===0){let o=r.lines.isFull;s===r.lines.length-1?o?r.lines.recycle().copyFrom(n):r.lines.push(n.clone()):r.lines.splice(s+1,0,n.clone()),o?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let o=s-i+1;r.lines.shiftElements(i+1,o-1,-1),r.lines.set(s,n.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let n=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),n!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};Hh=tt([he(0,Wt)],Hh);var Ti={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:ya,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},t4=["normal","bold","100","200","300","400","500","600","700","800","900"],r4=class extends Ne{constructor(e){super(),this._onOptionChange=this._register(new oe),this.onOptionChange=this._onOptionChange.event;let t={...Ti};for(let r in e)if(r in t)try{let n=e[r];t[r]=this._sanitizeAndValidateOption(r,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(Ue(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(r=>{r===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(r=>{e.indexOf(r)!==-1&&t()})}_setupOptions(){let e=r=>{if(!(r in Ti))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,n)=>{if(!(r in Ti))throw new Error(`No option with key "${r}"`);n=this._sanitizeAndValidateOption(r,n),this.rawOptions[r]!==n&&(this.rawOptions[r]=n,this._onOptionChange.fire(r))};for(let r in this.rawOptions){let n={get:e.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Ti[e]),!n4(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Ti[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=t4.includes(t)?t:Ti[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function n4(e){return e==="block"||e==="underline"||e==="bar"}function $s(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let n in e)r[n]=t<=1?e[n]:e[n]&&$s(e[n],t-1);return r}var Ng=Object.freeze({insertMode:!1}),Lg=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Wh=class extends Ne{constructor(e,t,r){super(),this._bufferService=e,this._logService=t,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new oe),this.onData=this._onData.event,this._onUserInput=this._register(new oe),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new oe),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new oe),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=$s(Ng),this.decPrivateModes=$s(Lg)}reset(){this.modes=$s(Ng),this.decPrivateModes=$s(Lg)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Wh=tt([he(0,Ht),he(1,Zy),he(2,Wt)],Wh);var Tg={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Zc(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var Jc=String.fromCharCode,Pg={DEFAULT:e=>{let t=[Zc(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Jc(t[0])}${Jc(t[1])}${Jc(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Zc(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Zc(e,!0)};${e.x};${e.y}${t}`}},Uh=class extends Ne{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new oe),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(Tg))this.addProtocol(n,Tg[n]);for(let n of Object.keys(Pg))this.addEncoding(n,Pg[n]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let n=t/r,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=n+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,r){if(r){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Uh=tt([he(0,Ht),he(1,ki),he(2,Wt)],Uh);var eu=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],i4=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],ht;function s4(e,t){let r=0,n=t.length-1,i;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=r;)if(i=r+n>>1,e>t[i][1])r=i+1;else if(e<t[i][0])n=i-1;else return!0;return!1}var o4=class{constructor(){if(this.version="6",!ht){ht=new Uint8Array(65536),ht.fill(1),ht[0]=0,ht.fill(0,1,32),ht.fill(0,127,160),ht.fill(2,4352,4448),ht[9001]=2,ht[9002]=2,ht.fill(2,11904,42192),ht[12351]=1,ht.fill(2,44032,55204),ht.fill(2,63744,64256),ht.fill(2,65040,65050),ht.fill(2,65072,65136),ht.fill(2,65280,65377),ht.fill(2,65504,65511);for(let e=0;e<eu.length;++e)ht.fill(0,eu[e][0],eu[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ht[e]:s4(e,i4)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let r=this.wcwidth(e),n=r===0&&t!==0;if(n){let i=li.extractWidth(t);i===0?n=!1:i>r&&(r=i)}return li.createPropertyValue(0,r,n)}},li=class jl{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new oe,this.onChange=this._onChange.event;let t=new o4;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,n=!1){return(t&16777215)<<3|(r&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,n=0,i=t.length;for(let s=0;s<i;++s){let o=t.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=i)return r+this.wcwidth(o);let c=t.charCodeAt(s);56320<=c&&c<=57343?o=(o-55296)*1024+c-56320+65536:r+=this.wcwidth(c)}let l=this.charProperties(o,n),a=jl.extractWidth(l);jl.extractShouldJoin(l)&&(a-=jl.extractWidth(n)),r+=a,n=l}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},l4=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function Dg(e){var n;let t=(n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:n.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var Ps=2147483647,a4=256,M1=class Vh{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>a4)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new Vh;if(!t.length)return r;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let i=t[n];if(Array.isArray(i))for(let s=0;s<i.length;++s)r.addSubParam(i[s]);else r.addParam(i)}return r}clone(){let t=new Vh(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let r=0;r<this.length;++r){t.push(this.params[r]);let n=this._subParamsIdx[r]>>8,i=this._subParamsIdx[r]&255;i-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,i))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Ps?Ps:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Ps?Ps:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,n=this._subParamsIdx[t]&255;return n-r>0?this._subParams.subarray(r,n):null}getSubParamsAll(){let t={};for(let r=0;r<this.length;++r){let n=this._subParamsIdx[r]>>8,i=this._subParamsIdx[r]&255;i-n>0&&(t[r]=this._subParams.slice(n,i))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,i=n[r-1];n[r-1]=~i?Math.min(i*10+t,Ps):t}},Ds=[],c4=class{constructor(){this._state=0,this._active=Ds,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Ds}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Ds,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Ds,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,r){if(!this._active.length)this._handlerFb(this._id,"PUT",qa(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}start(){this.reset(),this._state=1}put(e,t,r){if(this._state!==3){if(this._state===1)for(;t<r;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&r-t>0&&this._put(e,t,r)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let r=!1,n=this._active.length-1,i=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&r===!1){for(;n>=0&&(r=this._active[n].end(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].end(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=Ds,this._id=-1,this._state=0}}},nr=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=qa(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(r=>(this._data="",this._hitLimit=!1,r));return this._data="",this._hitLimit=!1,t}},Rs=[],u4=class{constructor(){this._handlers=Object.create(null),this._active=Rs,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Rs}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Rs,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Rs,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(t)}put(e,t,r){if(!this._active.length)this._handlerFb(this._ident,"PUT",qa(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let r=!1,n=this._active.length-1,i=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&r===!1){for(;n>=0&&(r=this._active[n].unhook(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=Rs,this._ident=0}},Hs=new M1;Hs.addParam(0);var Rg=class{constructor(e){this._handler=e,this._data="",this._params=Hs,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Hs,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=qa(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(r=>(this._params=Hs,this._data="",this._hitLimit=!1,r));return this._params=Hs,this._data="",this._hitLimit=!1,t}},h4=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,r,n){this.table[t<<8|e]=r<<4|n}addMany(e,t,r,n){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=r<<4|n}},vr=160,d4=function(){let e=new h4(4095),t=Array.apply(null,Array(256)).map((l,a)=>a),r=(l,a)=>t.slice(l,a),n=r(32,127),i=r(0,24);i.push(25),i.push.apply(i,r(28,32));let s=r(0,14),o;e.setDefault(1,0),e.addMany(n,0,2,0);for(o in s)e.addMany([24,26,153,154],o,3,0),e.addMany(r(128,144),o,3,0),e.addMany(r(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(vr,0,2,0),e.add(vr,8,5,8),e.add(vr,6,0,6),e.add(vr,11,0,11),e.add(vr,13,13,13),e}(),f4=class extends Ne{constructor(e=d4){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new M1,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,r,n)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,r)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Ue(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new c4),this._dcsParser=this._register(new u4),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=e.prefix.charCodeAt(0),r&&60>r||r>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let i=0;i<e.intermediates.length;++i){let s=e.intermediates.charCodeAt(i);if(32>s||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=s}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return r<<=8,r|=n,r}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let r=this._identifier(e,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);let n=this._escHandlers[r];return n.push(t),{dispose:()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let r=this._identifier(e);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);let n=this._csiHandlers[r];return n.push(t),{dispose:()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,r,n,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=r,this._parseStack.transition=n,this._parseStack.chunkPos=i}parse(e,t,r){let n=0,i=0,s=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,s=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let l=this._parseStack.handlers,a=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&a>-1){for(;a>=0&&(o=l[a](this._params),o!==!0);a--)if(o instanceof Promise)return this._parseStack.handlerPos=a,o}this._parseStack.handlers=[];break;case 4:if(r===!1&&a>-1){for(;a>=0&&(o=l[a](),o!==!0);a--)if(o instanceof Promise)return this._parseStack.handlerPos=a,o}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(n!==24&&n!==26,r),o)return o;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],o=this._oscParser.end(n!==24&&n!==26,r),o)return o;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,s=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let l=s;l<t;++l){switch(n=e[l],i=this._transitions.table[this.currentState<<8|(n<160?n:vr)],i>>4){case 2:for(let f=l+1;;++f){if(f>=t||(n=e[f])<32||n>126&&n<vr){this._printHandler(e,l,f),l=f-1;break}if(++f>=t||(n=e[f])<32||n>126&&n<vr){this._printHandler(e,l,f),l=f-1;break}if(++f>=t||(n=e[f])<32||n>126&&n<vr){this._printHandler(e,l,f),l=f-1;break}if(++f>=t||(n=e[f])<32||n>126&&n<vr){this._printHandler(e,l,f),l=f-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:l,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let a=this._csiHandlers[this._collect<<8|n],c=a?a.length-1:-1;for(;c>=0&&(o=a[c](this._params),o!==!0);c--)if(o instanceof Promise)return this._preserveStack(3,a,c,i,l),o;c<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++l<t&&(n=e[l])>47&&n<60);l--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let h=this._escHandlers[this._collect<<8|n],u=h?h.length-1:-1;for(;u>=0&&(o=h[u](),o!==!0);u--)if(o instanceof Promise)return this._preserveStack(4,h,u,i,l),o;u<0&&this._escHandlerFb(this._collect<<8|n),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|n,this._params);break;case 13:for(let f=l+1;;++f)if(f>=t||(n=e[f])===24||n===26||n===27||n>127&&n<vr){this._dcsParser.put(e,l,f),l=f-1;break}break;case 14:if(o=this._dcsParser.unhook(n!==24&&n!==26),o)return this._preserveStack(6,[],0,i,l),o;n===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let f=l+1;;f++)if(f>=t||(n=e[f])<32||n>127&&n<vr){this._oscParser.put(e,l,f),l=f-1;break}break;case 6:if(o=this._oscParser.end(n!==24&&n!==26),o)return this._preserveStack(5,[],0,i,l),o;n===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=i&15}}},p4=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,m4=/^[\da-f]+$/;function Mg(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let r=p4.exec(t);if(r){let n=r[1]?15:r[4]?255:r[7]?4095:65535;return[Math.round(parseInt(r[1]||r[4]||r[7]||r[10],16)/n*255),Math.round(parseInt(r[2]||r[5]||r[8]||r[11],16)/n*255),Math.round(parseInt(r[3]||r[6]||r[9]||r[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),m4.exec(t)&&[3,6,9,12].includes(t.length))){let r=t.length/3,n=[0,0,0];for(let i=0;i<3;++i){let s=parseInt(t.slice(r*i,r*i+r),16);n[i]=r===1?s<<4:r===2?s:r===3?s>>4:s>>8}return n}}function tu(e,t){let r=e.toString(16),n=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function g4(e,t=16){let[r,n,i]=e;return`rgb:${tu(r,t)}/${tu(n,t)}/${tu(i,t)}`}var _4={"(":0,")":1,"*":2,"+":3,"-":1,".":2},wn=131072,Ig=10;function Ag(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var Bg=5e3,jg=0,v4=class extends Ne{constructor(e,t,r,n,i,s,o,l,a=new f4){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=n,this._optionsService=i,this._oscLinkService=s,this._coreMouseService=o,this._unicodeService=l,this._parser=a,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new j3,this._utf8Decoder=new O3,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=ot.clone(),this._eraseAttrDataInternal=ot.clone(),this._onRequestBell=this._register(new oe),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new oe),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new oe),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new oe),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new oe),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new oe),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new oe),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new oe),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new oe),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new oe),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new oe),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new oe),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new oe),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Kh(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(c=>this._activeBuffer=c.activeBuffer)),this._parser.setCsiHandlerFallback((c,h)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(c),params:h.toArray()})}),this._parser.setEscHandlerFallback(c=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(c)})}),this._parser.setExecuteHandlerFallback(c=>{this._logService.debug("Unknown EXECUTE code: ",{code:c})}),this._parser.setOscHandlerFallback((c,h,u)=>{this._logService.debug("Unknown OSC code: ",{identifier:c,action:h,data:u})}),this._parser.setDcsHandlerFallback((c,h,u)=>{h==="HOOK"&&(u=u.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(c),action:h,payload:u})}),this._parser.setPrintHandler((c,h,u)=>this.print(c,h,u)),this._parser.registerCsiHandler({final:"@"},c=>this.insertChars(c)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},c=>this.scrollLeft(c)),this._parser.registerCsiHandler({final:"A"},c=>this.cursorUp(c)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},c=>this.scrollRight(c)),this._parser.registerCsiHandler({final:"B"},c=>this.cursorDown(c)),this._parser.registerCsiHandler({final:"C"},c=>this.cursorForward(c)),this._parser.registerCsiHandler({final:"D"},c=>this.cursorBackward(c)),this._parser.registerCsiHandler({final:"E"},c=>this.cursorNextLine(c)),this._parser.registerCsiHandler({final:"F"},c=>this.cursorPrecedingLine(c)),this._parser.registerCsiHandler({final:"G"},c=>this.cursorCharAbsolute(c)),this._parser.registerCsiHandler({final:"H"},c=>this.cursorPosition(c)),this._parser.registerCsiHandler({final:"I"},c=>this.cursorForwardTab(c)),this._parser.registerCsiHandler({final:"J"},c=>this.eraseInDisplay(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},c=>this.eraseInDisplay(c,!0)),this._parser.registerCsiHandler({final:"K"},c=>this.eraseInLine(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},c=>this.eraseInLine(c,!0)),this._parser.registerCsiHandler({final:"L"},c=>this.insertLines(c)),this._parser.registerCsiHandler({final:"M"},c=>this.deleteLines(c)),this._parser.registerCsiHandler({final:"P"},c=>this.deleteChars(c)),this._parser.registerCsiHandler({final:"S"},c=>this.scrollUp(c)),this._parser.registerCsiHandler({final:"T"},c=>this.scrollDown(c)),this._parser.registerCsiHandler({final:"X"},c=>this.eraseChars(c)),this._parser.registerCsiHandler({final:"Z"},c=>this.cursorBackwardTab(c)),this._parser.registerCsiHandler({final:"`"},c=>this.charPosAbsolute(c)),this._parser.registerCsiHandler({final:"a"},c=>this.hPositionRelative(c)),this._parser.registerCsiHandler({final:"b"},c=>this.repeatPrecedingCharacter(c)),this._parser.registerCsiHandler({final:"c"},c=>this.sendDeviceAttributesPrimary(c)),this._parser.registerCsiHandler({prefix:">",final:"c"},c=>this.sendDeviceAttributesSecondary(c)),this._parser.registerCsiHandler({final:"d"},c=>this.linePosAbsolute(c)),this._parser.registerCsiHandler({final:"e"},c=>this.vPositionRelative(c)),this._parser.registerCsiHandler({final:"f"},c=>this.hVPosition(c)),this._parser.registerCsiHandler({final:"g"},c=>this.tabClear(c)),this._parser.registerCsiHandler({final:"h"},c=>this.setMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"h"},c=>this.setModePrivate(c)),this._parser.registerCsiHandler({final:"l"},c=>this.resetMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"l"},c=>this.resetModePrivate(c)),this._parser.registerCsiHandler({final:"m"},c=>this.charAttributes(c)),this._parser.registerCsiHandler({final:"n"},c=>this.deviceStatus(c)),this._parser.registerCsiHandler({prefix:"?",final:"n"},c=>this.deviceStatusPrivate(c)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},c=>this.softReset(c)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},c=>this.setCursorStyle(c)),this._parser.registerCsiHandler({final:"r"},c=>this.setScrollRegion(c)),this._parser.registerCsiHandler({final:"s"},c=>this.saveCursor(c)),this._parser.registerCsiHandler({final:"t"},c=>this.windowOptions(c)),this._parser.registerCsiHandler({final:"u"},c=>this.restoreCursor(c)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},c=>this.insertColumns(c)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},c=>this.deleteColumns(c)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},c=>this.selectProtected(c)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},c=>this.requestMode(c,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},c=>this.requestMode(c,!1)),this._parser.setExecuteHandler(G.BEL,()=>this.bell()),this._parser.setExecuteHandler(G.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(G.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(G.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(G.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(G.BS,()=>this.backspace()),this._parser.setExecuteHandler(G.HT,()=>this.tab()),this._parser.setExecuteHandler(G.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(G.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Al.IND,()=>this.index()),this._parser.setExecuteHandler(Al.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Al.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new nr(c=>(this.setTitle(c),this.setIconName(c),!0))),this._parser.registerOscHandler(1,new nr(c=>this.setIconName(c))),this._parser.registerOscHandler(2,new nr(c=>this.setTitle(c))),this._parser.registerOscHandler(4,new nr(c=>this.setOrReportIndexedColor(c))),this._parser.registerOscHandler(8,new nr(c=>this.setHyperlink(c))),this._parser.registerOscHandler(10,new nr(c=>this.setOrReportFgColor(c))),this._parser.registerOscHandler(11,new nr(c=>this.setOrReportBgColor(c))),this._parser.registerOscHandler(12,new nr(c=>this.setOrReportCursorColor(c))),this._parser.registerOscHandler(104,new nr(c=>this.restoreIndexedColor(c))),this._parser.registerOscHandler(110,new nr(c=>this.restoreFgColor(c))),this._parser.registerOscHandler(111,new nr(c=>this.restoreBgColor(c))),this._parser.registerOscHandler(112,new nr(c=>this.restoreCursorColor(c))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let c in pt)this._parser.registerEscHandler({intermediates:"(",final:c},()=>this.selectCharset("("+c)),this._parser.registerEscHandler({intermediates:")",final:c},()=>this.selectCharset(")"+c)),this._parser.registerEscHandler({intermediates:"*",final:c},()=>this.selectCharset("*"+c)),this._parser.registerEscHandler({intermediates:"+",final:c},()=>this.selectCharset("+"+c)),this._parser.registerEscHandler({intermediates:"-",final:c},()=>this.selectCharset("-"+c)),this._parser.registerEscHandler({intermediates:".",final:c},()=>this.selectCharset("."+c)),this._parser.registerEscHandler({intermediates:"/",final:c},()=>this.selectCharset("/"+c));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(c=>(this._logService.error("Parsing error: ",c),c)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Rg((c,h)=>this.requestStatusString(c,h)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),Bg))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Bg} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,n=this._activeBuffer.x,i=this._activeBuffer.y,s=0,o=this._parseStack.paused;if(o){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;n=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>wn&&(s=this._parseStack.position+wn)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,c=>String.fromCharCode(c)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(c=>c.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<wn&&(this._parseBuffer=new Uint32Array(Math.min(e.length,wn))),o||this._dirtyRowTracker.clearRange(),e.length>wn)for(let c=s;c<e.length;c+=wn){let h=c+wn<e.length?c+wn:e.length,u=typeof e=="string"?this._stringDecoder.decode(e.substring(c,h),this._parseBuffer):this._utf8Decoder.decode(e.subarray(c,h),this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,u))return this._preserveStack(n,i,u,c),this._logSlowResolvingAsync(r),r}else if(!o){let c=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,c))return this._preserveStack(n,i,c,0),this._logSlowResolvingAsync(r),r}(this._activeBuffer.x!==n||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let l=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),a=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);a<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(a,this._bufferService.rows-1),end:Math.min(l,this._bufferService.rows-1)})}print(e,t,r){let n,i,s=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,l=this._bufferService.cols,a=this._coreService.decPrivateModes.wraparound,c=this._coreService.modes.insertMode,h=this._curAttrData,u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r-t>0&&u.getWidth(this._activeBuffer.x-1)===2&&u.setCellFromCodepoint(this._activeBuffer.x-1,0,1,h);let f=this._parser.precedingJoinState;for(let p=t;p<r;++p){if(n=e[p],n<127&&s){let _=s[String.fromCharCode(n)];_&&(n=_.charCodeAt(0))}let m=this._unicodeService.charProperties(n,f);i=li.extractWidth(m);let g=li.extractShouldJoin(m),x=g?li.extractWidth(f):0;if(f=m,o&&this._onA11yChar.fire(kn(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-x>l){if(a){let _=u,v=this._activeBuffer.x-x;for(this._activeBuffer.x=x,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),x>0&&u instanceof Fs&&u.copyCellsFrom(_,v,0,x,!1);v<l;)_.setCellFromCodepoint(v++,0,1,h)}else if(this._activeBuffer.x=l-1,i===2)continue}if(g&&this._activeBuffer.x){let _=u.getWidth(this._activeBuffer.x-1)?1:2;u.addCodepointToCell(this._activeBuffer.x-_,n,i);for(let v=i-x;--v>=0;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,h);continue}if(c&&(u.insertCells(this._activeBuffer.x,i-x,this._activeBuffer.getNullCell(h)),u.getWidth(l-1)===2&&u.setCellFromCodepoint(l-1,0,1,h)),u.setCellFromCodepoint(this._activeBuffer.x++,n,i,h),i>0)for(;--i;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,h)}this._parser.precedingJoinState=f,this._activeBuffer.x<l&&r-t>0&&u.getWidth(this._activeBuffer.x)===0&&!u.hasContent(this._activeBuffer.x)&&u.setCellFromCodepoint(this._activeBuffer.x,0,1,h),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>Ag(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Rg(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new nr(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,r,n=!1,i=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),i),n&&(s.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){var n;this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r<this._bufferService.rows;r++)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(r);break;case 1:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!((n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r))!=null&&n.getTrimmedLength()););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let i=this._activeBuffer.lines.length-this._bufferService.rows;i>0&&(this._activeBuffer.lines.trimStart(i),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-i,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-i,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;t--;)this._activeBuffer.lines.splice(r,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(ot));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let r=e.params[0]||1,n=li.extractWidth(t),i=this._activeBuffer.x-n,s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(s.length*r),l=0;for(let c=0;c<s.length;){let h=s.codePointAt(c)||0;o[l++]=h,c+=h>65535?2:1}let a=l;for(let c=1;c<r;++c)o.copyWithin(a,0,l),a+=l;return this.print(o,0,a),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(G.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(G.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(G.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(G.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(G.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,ti),this._charsetService.setgCharset(1,ti),this._charsetService.setgCharset(2,ti),this._charsetService.setgCharset(3,ti);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(g=>(g[g.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",g[g.SET=1]="SET",g[g.RESET=2]="RESET",g[g.PERMANENTLY_SET=3]="PERMANENTLY_SET",g[g.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(r={}));let n=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:s}=this._coreMouseService,o=this._coreService,{buffers:l,cols:a}=this._bufferService,{active:c,alt:h}=l,u=this._optionsService.rawOptions,f=(g,x)=>(o.triggerDataEvent(`${G.ESC}[${t?"":"?"}${g};${x}$y`),!0),p=g=>g?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,p(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,p(u.convertEol)):f(m,0):m===1?f(m,p(n.applicationCursorKeys)):m===3?f(m,u.windowOptions.setWinLines?a===80?2:a===132?1:0:0):m===6?f(m,p(n.origin)):m===7?f(m,p(n.wraparound)):m===8?f(m,3):m===9?f(m,p(i==="X10")):m===12?f(m,p(u.cursorBlink)):m===25?f(m,p(!o.isCursorHidden)):m===45?f(m,p(n.reverseWraparound)):m===66?f(m,p(n.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,p(i==="VT200")):m===1002?f(m,p(i==="DRAG")):m===1003?f(m,p(i==="ANY")):m===1004?f(m,p(n.sendFocus)):m===1005?f(m,4):m===1006?f(m,p(s==="SGR")):m===1015?f(m,4):m===1016?f(m,p(s==="SGR_PIXELS")):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,p(c===h)):m===2004?f(m,p(n.bracketedPasteMode)):m===2026?f(m,p(n.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,r,n,i){return t===2?(e|=50331648,e&=-16777216,e|=zo.fromColorRGB([r,n,i])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let n=[0,0,-1,0,0,0],i=0,s=0;do{if(n[s+i]=e.params[t+s],e.hasSubParams(t+s)){let o=e.getSubParams(t+s),l=0;do n[1]===5&&(i=1),n[s+l+1+i]=o[l];while(++l<o.length&&l+s+1+i<n.length);break}if(n[1]===5&&s+i>=2||n[1]===2&&s+i>=5)break;n[1]&&(i=1)}while(++s+t<e.length&&s+i<n.length);for(let o=2;o<n.length;++o)n[o]===-1&&(n[o]=0);switch(n[0]){case 38:r.fg=this._updateAttrColor(r.fg,n[1],n[3],n[4],n[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,n[1],n[3],n[4],n[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,n[1],n[3],n[4],n[5])}return s}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=ot.fg,e.bg=ot.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,r,n=this._curAttrData;for(let i=0;i<t;i++)r=e.params[i],r>=30&&r<=37?(n.fg&=-50331904,n.fg|=16777216|r-30):r>=40&&r<=47?(n.bg&=-50331904,n.bg|=16777216|r-40):r>=90&&r<=97?(n.fg&=-50331904,n.fg|=16777216|r-90|8):r>=100&&r<=107?(n.bg&=-50331904,n.bg|=16777216|r-100|8):r===0?this._processSGR0(n):r===1?n.fg|=134217728:r===3?n.bg|=67108864:r===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,n)):r===5?n.fg|=536870912:r===7?n.fg|=67108864:r===8?n.fg|=1073741824:r===9?n.fg|=2147483648:r===2?n.bg|=134217728:r===21?this._processUnderline(2,n):r===22?(n.fg&=-134217729,n.bg&=-134217729):r===23?n.bg&=-67108865:r===24?(n.fg&=-268435457,this._processUnderline(0,n)):r===25?n.fg&=-536870913:r===27?n.fg&=-67108865:r===28?n.fg&=-1073741825:r===29?n.fg&=2147483647:r===39?(n.fg&=-67108864,n.fg|=ot.fg&16777215):r===49?(n.bg&=-67108864,n.bg|=ot.bg&16777215):r===38||r===48||r===58?i+=this._extractColor(e,i,n):r===53?n.bg|=1073741824:r===55?n.bg&=-1073741825:r===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):r===100?(n.fg&=-67108864,n.fg|=ot.fg&16777215,n.bg&=-67108864,n.bg|=ot.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${G.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${G.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${G.ESC}[?${t};${r}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=ot.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Ag(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${G.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Ig&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Ig&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],r=e.split(";");for(;r.length>1;){let n=r.shift(),i=r.shift();if(/^\d+$/.exec(n)){let s=parseInt(n);if(Og(s))if(i==="?")t.push({type:0,index:s});else{let o=Mg(i);o&&t.push({type:1,index:s,color:o})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),n=e.slice(t+1);return n?this._createHyperlink(r,n):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),n,i=r.findIndex(s=>s.startsWith("id="));return i!==-1&&(n=r[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let r=e.split(";");for(let n=0;n<r.length&&!(t>=this._specialColors.length);++n,++t)if(r[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let i=Mg(r[n]);i&&this._onColor.fire([{type:1,index:this._specialColors[t],color:i}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],r=e.split(";");for(let n=0;n<r.length;++n)if(/^\d+$/.exec(r[n])){let i=parseInt(r[n]);Og(i)&&t.push({type:2,index:i})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,ti),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(_4[e[0]],pt[e[1]]||ti),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=ot.clone(),this._eraseAttrDataInternal=ot.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new kr;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let r=this._activeBuffer.ybase+this._activeBuffer.y+t,n=this._activeBuffer.lines.get(r);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let r=o=>(this._coreService.triggerDataEvent(`${G.ESC}${o}${G.ESC}\\`),!0),n=this._bufferService.buffer,i=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-(i.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Kh=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(jg=e,e=t,t=jg),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Kh=tt([he(0,Ht)],Kh);function Og(e){return 0<=e&&e<256}var y4=5e7,zg=12,x4=50,w4=class extends Ne{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new oe),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let r;for(;r=this._writeBuffer.shift();){this._action(r);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>y4)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],i=this._action(n,t);if(i){let o=l=>performance.now()-r>=zg?setTimeout(()=>this._innerWrite(0,l)):this._innerWrite(r,l);i.catch(l=>(queueMicrotask(()=>{throw l}),Promise.resolve(!1))).then(o);return}let s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-r>=zg)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>x4&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},qh=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let l=t.addMarker(t.ybase+t.y),a={data:e,id:this._nextId++,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(a,l)),this._dataByLinkId.set(a.id,a),a.id}let r=e,n=this._getEntryIdKey(r),i=this._entriesWithId.get(n);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let s=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(o,s)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);r.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(r,n))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let r=e.lines.indexOf(t);r!==-1&&(e.lines.splice(r,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};qh=tt([he(0,Ht)],qh);var Fg=!1,S4=class extends Ne{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ss),this._onBinary=this._register(new oe),this.onBinary=this._onBinary.event,this._onData=this._register(new oe),this.onData=this._onData.event,this._onLineFeed=this._register(new oe),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new oe),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new oe),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new oe),this._instantiationService=new KT,this.optionsService=this._register(new r4(e)),this._instantiationService.setService(Wt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Hh)),this._instantiationService.setService(Ht,this._bufferService),this._logService=this._register(this._instantiationService.createInstance($h)),this._instantiationService.setService(Zy,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Wh)),this._instantiationService.setService(ki,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Uh)),this._instantiationService.setService(Qy,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(li)),this._instantiationService.setService(H3,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l4),this._instantiationService.setService($3,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(qh),this._instantiationService.setService(Jy,this._oscLinkService),this._inputHandler=this._register(new v4(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Ct.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Ct.forward(this._bufferService.onResize,this._onResize)),this._register(Ct.forward(this.coreService.onData,this._onData)),this._register(Ct.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new w4((t,r)=>this._inputHandler.parse(t,r))),this._register(Ct.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new oe),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Fg&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Fg=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,D1),t=Math.max(t,R1),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Dg.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Dg(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Ue(()=>{for(let t of e)t.dispose()})}}},b4={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function k4(e,t,r,n){var o;let i={type:0,cancel:!1,key:void 0},s=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?i.key=G.ESC+"OA":i.key=G.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?i.key=G.ESC+"OD":i.key=G.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?i.key=G.ESC+"OC":i.key=G.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?i.key=G.ESC+"OB":i.key=G.ESC+"[B");break;case 8:i.key=e.ctrlKey?"\b":G.DEL,e.altKey&&(i.key=G.ESC+i.key);break;case 9:if(e.shiftKey){i.key=G.ESC+"[Z";break}i.key=G.HT,i.cancel=!0;break;case 13:i.key=e.altKey?G.ESC+G.CR:G.CR,i.cancel=!0;break;case 27:i.key=G.ESC,e.altKey&&(i.key=G.ESC+G.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;s?i.key=G.ESC+"[1;"+(s+1)+"D":t?i.key=G.ESC+"OD":i.key=G.ESC+"[D";break;case 39:if(e.metaKey)break;s?i.key=G.ESC+"[1;"+(s+1)+"C":t?i.key=G.ESC+"OC":i.key=G.ESC+"[C";break;case 38:if(e.metaKey)break;s?i.key=G.ESC+"[1;"+(s+1)+"A":t?i.key=G.ESC+"OA":i.key=G.ESC+"[A";break;case 40:if(e.metaKey)break;s?i.key=G.ESC+"[1;"+(s+1)+"B":t?i.key=G.ESC+"OB":i.key=G.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=G.ESC+"[2~");break;case 46:s?i.key=G.ESC+"[3;"+(s+1)+"~":i.key=G.ESC+"[3~";break;case 36:s?i.key=G.ESC+"[1;"+(s+1)+"H":t?i.key=G.ESC+"OH":i.key=G.ESC+"[H";break;case 35:s?i.key=G.ESC+"[1;"+(s+1)+"F":t?i.key=G.ESC+"OF":i.key=G.ESC+"[F";break;case 33:e.shiftKey?i.type=2:e.ctrlKey?i.key=G.ESC+"[5;"+(s+1)+"~":i.key=G.ESC+"[5~";break;case 34:e.shiftKey?i.type=3:e.ctrlKey?i.key=G.ESC+"[6;"+(s+1)+"~":i.key=G.ESC+"[6~";break;case 112:s?i.key=G.ESC+"[1;"+(s+1)+"P":i.key=G.ESC+"OP";break;case 113:s?i.key=G.ESC+"[1;"+(s+1)+"Q":i.key=G.ESC+"OQ";break;case 114:s?i.key=G.ESC+"[1;"+(s+1)+"R":i.key=G.ESC+"OR";break;case 115:s?i.key=G.ESC+"[1;"+(s+1)+"S":i.key=G.ESC+"OS";break;case 116:s?i.key=G.ESC+"[15;"+(s+1)+"~":i.key=G.ESC+"[15~";break;case 117:s?i.key=G.ESC+"[17;"+(s+1)+"~":i.key=G.ESC+"[17~";break;case 118:s?i.key=G.ESC+"[18;"+(s+1)+"~":i.key=G.ESC+"[18~";break;case 119:s?i.key=G.ESC+"[19;"+(s+1)+"~":i.key=G.ESC+"[19~";break;case 120:s?i.key=G.ESC+"[20;"+(s+1)+"~":i.key=G.ESC+"[20~";break;case 121:s?i.key=G.ESC+"[21;"+(s+1)+"~":i.key=G.ESC+"[21~";break;case 122:s?i.key=G.ESC+"[23;"+(s+1)+"~":i.key=G.ESC+"[23~";break;case 123:s?i.key=G.ESC+"[24;"+(s+1)+"~":i.key=G.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=G.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=G.DEL:e.keyCode===219?i.key=G.ESC:e.keyCode===220?i.key=G.FS:e.keyCode===221&&(i.key=G.GS);else if((!r||n)&&e.altKey&&!e.metaKey){let l=(o=b4[e.keyCode])==null?void 0:o[e.shiftKey?1:0];if(l)i.key=G.ESC+l;else if(e.keyCode>=65&&e.keyCode<=90){let a=e.ctrlKey?e.keyCode-64:e.keyCode+32,c=String.fromCharCode(a);e.shiftKey&&(c=c.toUpperCase()),i.key=G.ESC+c}else if(e.keyCode===32)i.key=G.ESC+(e.ctrlKey?G.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let a=e.code.slice(3,4);e.shiftKey||(a=a.toLowerCase()),i.key=G.ESC+a,i.cancel=!0}}else r&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(i.key=G.US),e.key==="@"&&(i.key=G.NUL));break}return i}var nt=0,C4=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new xa,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new xa,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((i,s)=>this._getKey(i)-this._getKey(s)),t=0,r=0,n=new Array(this._array.length+this._insertedValues.length);for(let i=0;i<n.length;i++)r>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[r])?(n[i]=e[t],t++):n[i]=this._array[r++];this._array=n,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(nt=this._search(t),nt===-1)||this._getKey(this._array[nt])!==t)return!1;do if(this._array[nt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(nt),!0;while(++nt<this._array.length&&this._getKey(this._array[nt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((i,s)=>i-s),t=0,r=new Array(this._array.length-e.length),n=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:r[n++]=this._array[i];this._array=r,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(nt=this._search(e),!(nt<0||nt>=this._array.length)&&this._getKey(this._array[nt])===e))do yield this._array[nt];while(++nt<this._array.length&&this._getKey(this._array[nt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(nt=this._search(e),!(nt<0||nt>=this._array.length)&&this._getKey(this._array[nt])===e))do t(this._array[nt]);while(++nt<this._array.length&&this._getKey(this._array[nt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,r=this._array.length-1;for(;r>=t;){let n=t+r>>1,i=this._getKey(this._array[n]);if(i>e)r=n-1;else if(i<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},ru=0,$g=0,E4=class extends Ne{constructor(){super(),this._decorations=new C4(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new oe),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new oe),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Ue(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new N4(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,r){let n=0,i=0;for(let s of this._decorations.getKeyIterator(t))n=s.options.x??0,i=n+(s.options.width??1),e>=n&&e<i&&(!r||(s.options.layer??"bottom")===r)&&(yield s)}forEachDecorationAtCell(e,t,r,n){this._decorations.forEachByKey(t,i=>{ru=i.options.x??0,$g=ru+(i.options.width??1),e>=ru&&e<$g&&(!r||(i.options.layer??"bottom")===r)&&n(i)})}},N4=class extends zn{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new oe),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new oe),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Ke.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Ke.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},L4=1e3,T4=class{constructor(e,t=L4){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let i=n-this._lastRefreshMs,s=this._debounceThresholdMS-i;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},s)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Hg=20,wa=class extends Ne{constructor(e,t,r,n){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=i.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let s=0;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);if(this._topBoundaryFocusListener=s=>this._handleBoundaryFocus(s,0),this._bottomBoundaryFocusListener=s=>this._handleBoundaryFocus(s,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new T4(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(s=>this._handleResize(s.rows))),this._register(this._terminal.onRender(s=>this._refreshRows(s.start,s.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(s=>this._handleChar(s))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
133
|
+
`))),this._register(this._terminal.onA11yTab(s=>this._handleTab(s))),this._register(this._terminal.onKey(s=>this._handleKey(s.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(we(i,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Ue(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Hg+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
134
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Hg+1&&(this._liveRegion.textContent+=fh.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let r=this._terminal.buffer,n=r.lines.length.toString();for(let i=e;i<=t;i++){let s=r.lines.get(r.ydisp+i),o=[],l=(s==null?void 0:s.translateToString(!0,void 0,void 0,o))||"",a=(r.ydisp+i+1).toString(),c=this._rowElements[i];c&&(l.length===0?(c.textContent=" ",this._rowColumns.set(c,[0,1])):(c.textContent=l,this._rowColumns.set(c,o)),c.setAttribute("aria-posinset",a),c.setAttribute("aria-setsize",n),this._alignRowWidth(c))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,n=this._rowElements[t===0?1:this._rowElements.length-2],i=r.getAttribute("aria-posinset"),s=t===0?"1":`${this._terminal.buffer.lines.length}`;if(i===s||e.relatedTarget!==n)return;let o,l;if(t===0?(o=r,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(o=this._rowElements.shift(),l=r,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let a=this._createAccessibilityTreeNode();this._rowElements.unshift(a),this._rowContainer.insertAdjacentElement("afterbegin",a)}else{let a=this._createAccessibilityTreeNode();this._rowElements.push(a),this._rowContainer.appendChild(a)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var l;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let n=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:n,offset:((l=n.textContent)==null?void 0:l.length)??0}),!this._rowContainer.contains(r.node))return;let i=({node:a,offset:c})=>{let h=a instanceof Text?a.parentNode:a,u=parseInt(h==null?void 0:h.getAttribute("aria-posinset"),10)-1;if(isNaN(u))return console.warn("row is invalid. Race condition?"),null;let f=this._rowColumns.get(h);if(!f)return console.warn("columns is null. Race condition?"),null;let p=c<f.length?f[c]:f.slice(-1)[0]+1;return p>=this._terminal.cols&&(++u,p=0),{row:u,column:p}},s=i(t),o=i(r);if(!(!s||!o)){if(s.row>o.row||s.row===o.row&&s.column>=o.column)throw new Error("invalid range");this._terminal.select(s.column,s.row,(o.row-s.row)*this._terminal.cols-s.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var i,s;e.style.transform="";let t=e.getBoundingClientRect().width,r=(s=(i=this._rowColumns.get(e))==null?void 0:i.slice(-1))==null?void 0:s[0];if(!r)return;let n=r*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};wa=tt([he(1,pf),he(2,mn),he(3,gn)],wa);var Yh=class extends Ne{constructor(e,t,r,n,i){super(),this._element=e,this._mouseService=t,this._renderService=r,this._bufferService=n,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new oe),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new oe),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Ue(()=>{var s;vi(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(s=this._activeProviderReplies)==null||s.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(we(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(we(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(we(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(we(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let r=e.composedPath();for(let n=0;n<r.length;n++){let i=r[n];if(i.classList.contains("xterm"))break;if(i.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var n,i;(!this._activeProviderReplies||!t)&&((n=this._activeProviderReplies)==null||n.forEach(s=>{s==null||s.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[s,o]of this._linkProviderService.linkProviders.entries())t?(i=this._activeProviderReplies)!=null&&i.get(s)&&(r=this._checkLinkProviderResult(s,e,r)):o.provideLinks(e.y,l=>{var c,h;if(this._isMouseOut)return;let a=l==null?void 0:l.map(u=>({link:u}));(c=this._activeProviderReplies)==null||c.set(s,a),r=this._checkLinkProviderResult(s,e,r),((h=this._activeProviderReplies)==null?void 0:h.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let n=0;n<t.size;n++){let i=t.get(n);if(i)for(let s=0;s<i.length;s++){let o=i[s],l=o.link.range.start.y<e?0:o.link.range.start.x,a=o.link.range.end.y>e?this._bufferService.cols:o.link.range.end.x;for(let c=l;c<=a;c++){if(r.has(c)){i.splice(s--,1);break}r.add(c)}}}}_checkLinkProviderResult(e,t,r){var s;if(!this._activeProviderReplies)return r;let n=this._activeProviderReplies.get(e),i=!1;for(let o=0;o<e;o++)(!this._activeProviderReplies.has(o)||this._activeProviderReplies.get(o))&&(i=!0);if(!i&&n){let o=n.find(l=>this._linkAtPosition(l.link,t));o&&(r=!0,this._handleNewLink(o))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let o=0;o<this._activeProviderReplies.size;o++){let l=(s=this._activeProviderReplies.get(o))==null?void 0:s.find(a=>this._linkAtPosition(a.link,t));if(l){r=!0,this._handleNewLink(l);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&P4(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,vi(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var r,n;return(n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.pointerCursor},set:r=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>{var r,n;return(n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.underline},set:r=>{var n,i,s;(n=this._currentLink)!=null&&n.state&&((s=(i=this._currentLink)==null?void 0:i.state)==null?void 0:s.decorations.underline)!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let n=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,i=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=i&&(this._clearCurrentLink(n,i),this._lastMouseEvent)){let s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._askForLink(s,!1)}})))}_linkHover(e,t,r){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,n=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-n-1,r.end.x,r.end.y-n-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,r){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return r<=i&&i<=n}_positionFromMouseEvent(e,t,r){let n=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,n,i){return{x1:e,y1:t,x2:r,y2:n,cols:this._bufferService.cols,fg:i}}};Yh=tt([he(1,mf),he(2,gn),he(3,Ht),he(4,t1)],Yh);function P4(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var D4=class extends S4{constructor(e={}){super(e),this._linkifier=this._register(new ss),this.browser=x1,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ss),this._onCursorMove=this._register(new oe),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new oe),this.onKey=this._onKey.event,this._onRender=this._register(new oe),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new oe),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new oe),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new oe),this.onBell=this._onBell.event,this._onFocus=this._register(new oe),this._onBlur=this._register(new oe),this._onA11yCharEmitter=this._register(new oe),this._onA11yTabEmitter=this._register(new oe),this._onWillOpen=this._register(new oe),this._setup(),this._decorationService=this._instantiationService.createInstance(E4),this._instantiationService.setService(Fo,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(xT),this._instantiationService.setService(t1,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(mh)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(Ct.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Ct.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Ct.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Ct.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Ue(()=>{var t,r;this._customKeyEventHandler=void 0,(r=(t=this.element)==null?void 0:t.parentNode)==null||r.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let r,n="";switch(t.index){case 256:r="foreground",n="10";break;case 257:r="background",n="11";break;case 258:r="cursor",n="12";break;default:r="ansi",n="4;"+t.index}switch(t.type){case 0:let i=$e.toColorRGB(r==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[r]);this.coreService.triggerDataEvent(`${G.ESC}]${n};${g4(i)}${v1.ST}`);break;case 1:if(r==="ansi")this._themeService.modifyColors(s=>s.ansi[t.index]=lt.toColor(...t.color));else{let s=r;this._themeService.modifyColors(o=>o[s]=lt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(wa,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let r=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,i=t.getWidth(r),s=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,l=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=l+"px",this.textarea.style.top=o+"px",this.textarea.style.width=s+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(we(this.element,"copy",t=>{this.hasSelection()&&A3(t,this._selectionService)}));let e=t=>B3(t,this.textarea,this.coreService,this.optionsService);this._register(we(this.textarea,"paste",e)),this._register(we(this.element,"paste",e)),w1?this._register(we(this.element,"mousedown",t=>{t.button===2&&Zm(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(we(this.element,"contextmenu",t=>{Zm(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),bf&&this._register(we(this.element,"auxclick",t=>{t.button===1&&Ky(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(we(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(we(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(we(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(we(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(we(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(we(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(we(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var i;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((i=this.element)==null?void 0:i.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(we(this.screenElement,"mousemove",s=>this.updateCursorStyle(s))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",dh.get()),k1||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(vT,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(mn,this._coreBrowserService),this._register(we(this.textarea,"focus",s=>this._handleTextAreaFocus(s))),this._register(we(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Bh,this._document,this._helperContainer),this._instantiationService.setService(Ya,this._charSizeService),this._themeService=this._instantiationService.createInstance(Fh),this._instantiationService.setService(fs,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(va),this._instantiationService.setService(e1,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Oh,this.rows,this.screenElement)),this._instantiationService.setService(gn,this._renderService),this._register(this._renderService.onRenderedViewportChange(s=>this._onRender.fire(s))),this.onResize(s=>this._renderService.resize(s.cols,s.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Mh,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(jh),this._instantiationService.setService(mf,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(Yh,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(Dh,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(s=>{super.scrollLines(s,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(zh,this.element,this.screenElement,n)),this._instantiationService.setService(U3,this._selectionService),this._register(this._selectionService.onRequestScrollLines(s=>this.scrollLines(s.amount,s.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(s=>this._renderService.handleSelectionChanged(s.start,s.end,s.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(s=>{this.textarea.value=s,this.textarea.focus(),this.textarea.select()})),this._register(Ct.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var s;this._selectionService.refresh(),(s=this._viewport)==null||s.queueSync()})),this._register(this._instantiationService.createInstance(Rh,this.screenElement)),this._register(we(this.element,"mousedown",s=>this._selectionService.handleMouseDown(s))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(wa,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",s=>this._handleScreenReaderModeOptionChange(s))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(_a,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",s=>{!this._overviewRulerRenderer&&s&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(_a,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Ah,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function r(s){var c,h,u,f,p;let o=e._mouseService.getMouseReportCoords(s,e.screenElement);if(!o)return!1;let l,a;switch(s.overrideType||s.type){case"mousemove":a=32,s.buttons===void 0?(l=3,s.button!==void 0&&(l=s.button<3?s.button:3)):l=s.buttons&1?0:s.buttons&4?1:s.buttons&2?2:3;break;case"mouseup":a=0,l=s.button<3?s.button:3;break;case"mousedown":a=1,l=s.button<3?s.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(s)===!1)return!1;let m=s.deltaY;if(m===0||e.coreMouseService.consumeWheelEvent(s,(f=(u=(h=(c=e._renderService)==null?void 0:c.dimensions)==null?void 0:h.device)==null?void 0:u.cell)==null?void 0:f.height,(p=e._coreBrowserService)==null?void 0:p.dpr)===0)return!1;a=m<0?0:1,l=4;break;default:return!1}return a===void 0||l===void 0||l>4?!1:e.coreMouseService.triggerMouseEvent({col:o.col,row:o.row,x:o.x,y:o.y,button:l,action:a,ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:s=>(r(s),s.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(s)),wheel:s=>(r(s),this.cancel(s,!0)),mousedrag:s=>{s.buttons&&r(s)},mousemove:s=>{s.buttons||r(s)}};this._register(this.coreMouseService.onProtocolChange(s=>{s?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(s)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),s&8?n.mousemove||(t.addEventListener("mousemove",i.mousemove),n.mousemove=i.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),s&16?n.wheel||(t.addEventListener("wheel",i.wheel,{passive:!1}),n.wheel=i.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),s&2?n.mouseup||(n.mouseup=i.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),s&4?n.mousedrag||(n.mousedrag=i.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(we(t,"mousedown",s=>{if(s.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(s)))return r(s),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(s)})),this._register(we(t,"wheel",s=>{var o,l,a,c,h;if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(s)===!1)return!1;if(!this.buffer.hasScrollback){if(s.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(s,(c=(a=(l=(o=e._renderService)==null?void 0:o.dimensions)==null?void 0:l.device)==null?void 0:a.cell)==null?void 0:c.height,(h=e._coreBrowserService)==null?void 0:h.dpr)===0)return this.cancel(s,!0);let u=G.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(s.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(u,!0),this.cancel(s,!0)}}},{passive:!1}))}refresh(e,t){var r;(r=this._renderService)==null||r.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){Vy(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,r){this._selectionService.setSelection(e,t,r)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var r;(r=this._selectionService)==null||r.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let r=k4(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r.type===3||r.type===2){let n=this.rows-1;return this.scrollLines(r.type===2?-n:n),this.cancel(e,!0)}if(r.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((r.key===G.ETX||r.key===G.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?r:r&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(R4(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var r;(r=this._charSizeService)==null||r.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(ot));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(G.ESC+"[I"):this.coreService.triggerDataEvent(G.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),r=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.ESC}[4;${r};${t}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),i=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${G.ESC}[6;${i};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function R4(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var M4=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=()=>this._wrappedAddonDispose(r),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let r=0;r<this._addons.length;r++)if(this._addons[r]===e){t=r;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},I4=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new kr)}translateToString(e,t,r){return this._line.translateToString(e,t,r)}},Wg=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new I4(t)}getNullCell(){return new kr}},A4=class extends Ne{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new oe),this.onBufferChange=this._onBufferChange.event,this._normal=new Wg(this._core.buffers.normal,"normal"),this._alternate=new Wg(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},B4=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,n)=>t(r,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},j4=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},O4=["cols","rows"],$r=0,z4=class extends Ne{constructor(e){super(),this._core=this._register(new D4(e)),this._addonManager=this._register(new M4),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],r=(n,i)=>{this._checkReadonlyOptions(n),this._core.options[n]=i};for(let n in this._core.options){let i={get:t.bind(this,n),set:r.bind(this,n)};Object.defineProperty(this._publicOptions,n,i)}}_checkReadonlyOptions(e){if(O4.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new B4(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new j4(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new A4(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
135
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return dh.get()},set promptLabel(e){dh.set(e)},get tooMuchOutput(){return fh.get()},set tooMuchOutput(e){fh.set(e)}}}_verifyIntegers(...e){for($r of e)if($r===1/0||isNaN($r)||$r%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for($r of e)if($r&&($r===1/0||isNaN($r)||$r%1!==0||$r<0))throw new Error("This API only accepts positive integers")}};/**
|
|
136
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
137
|
+
* @license MIT
|
|
138
|
+
*
|
|
139
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
140
|
+
* @license MIT
|
|
141
|
+
*
|
|
142
|
+
* Originally forked from (with the author's permission):
|
|
143
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
144
|
+
* http://bellard.org/jslinux/
|
|
145
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
146
|
+
*/var F4=2,$4=1,H4=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var u;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((u=this._terminal.options.overviewRuler)==null?void 0:u.width)||14,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),i=Math.max(0,parseInt(r.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),o={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},l=o.top+o.bottom,a=o.right+o.left,c=n-l,h=i-a-t;return{cols:Math.max(F4,Math.floor(h/e.css.cell.width)),rows:Math.max($4,Math.floor(c/e.css.cell.height))}}};/**
|
|
147
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
148
|
+
* @license MIT
|
|
149
|
+
*
|
|
150
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
151
|
+
* @license MIT
|
|
152
|
+
*
|
|
153
|
+
* Originally forked from (with the author's permission):
|
|
154
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
155
|
+
* http://bellard.org/jslinux/
|
|
156
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
157
|
+
*/var W4=class{constructor(e,t,r,n={}){this._terminal=e,this._regex=t,this._handler=r,this._options=n}provideLinks(e,t){let r=V4.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(r))}_addCallbacks(e){return e.map(t=>(t.leave=this._options.leave,t.hover=(r,n)=>{if(this._options.hover){let{range:i}=t;this._options.hover(r,n,i)}},t))}};function U4(e){try{let t=new URL(e),r=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(r.toLocaleLowerCase())}catch{return!1}}var V4=class Ol{static computeLink(t,r,n,i){let s=new RegExp(r.source,(r.flags||"")+"g"),[o,l]=Ol._getWindowedLineStrings(t-1,n),a=o.join(""),c,h=[];for(;c=s.exec(a);){let u=c[0];if(!U4(u))continue;let[f,p]=Ol._mapStrIdx(n,l,0,c.index),[m,g]=Ol._mapStrIdx(n,f,p,u.length);if(f===-1||p===-1||m===-1||g===-1)continue;let x={start:{x:p+1,y:f+1},end:{x:g,y:m+1}};h.push({range:x,text:u,activate:i})}return h}static _getWindowedLineStrings(t,r){let n,i=t,s=t,o=0,l="",a=[];if(n=r.buffer.active.getLine(t)){let c=n.translateToString(!0);if(n.isWrapped&&c[0]!==" "){for(o=0;(n=r.buffer.active.getLine(--i))&&o<2048&&(l=n.translateToString(!0),o+=l.length,a.push(l),!(!n.isWrapped||l.indexOf(" ")!==-1)););a.reverse()}for(a.push(c),o=0;(n=r.buffer.active.getLine(++s))&&n.isWrapped&&o<2048&&(l=n.translateToString(!0),o+=l.length,a.push(l),l.indexOf(" ")===-1););}return[a,i]}static _mapStrIdx(t,r,n,i){let s=t.buffer.active,o=s.getNullCell(),l=n;for(;i;){let a=s.getLine(r);if(!a)return[-1,-1];for(let c=l;c<a.length;++c){a.getCell(c,o);let h=o.getChars();if(o.getWidth()&&(i-=h.length||1,c===a.length-1&&h==="")){let u=s.getLine(r+1);u&&u.isWrapped&&(u.getCell(0,o),o.getWidth()===2&&(i+=1))}if(i<0)return[r,c]}r++,l=0}return[r,l]}},K4=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function q4(e,t){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var Y4=class{constructor(e=q4,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,r=t.urlRegex||K4;this._linkProvider=this._terminal.registerLinkProvider(new W4(this._terminal,r,this._handler,t))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};const Ug={background:"#0f1117",foreground:"#cdd6f4",cursor:"#f38ba8",cursorAccent:"#0f1117",selectionBackground:"rgba(166, 227, 161, 0.3)",selectionForeground:"#cdd6f4",black:"#45475a",red:"#f38ba8",green:"#a6e3a1",yellow:"#f9e2af",blue:"#89b4fa",magenta:"#cba6f7",cyan:"#94e2d5",white:"#bac2de",brightBlack:"#585b70",brightRed:"#f38ba8",brightGreen:"#a6e3a1",brightYellow:"#f9e2af",brightBlue:"#89b4fa",brightMagenta:"#cba6f7",brightCyan:"#94e2d5",brightWhite:"#a6adc8"},I1=b.forwardRef(({onInput:e,onResize:t,fontSize:r=13},n)=>{const i=b.useRef(null),s=b.useRef(null),o=b.useRef(null),[l,a]=b.useState(!1);return b.useImperativeHandle(n,()=>({write:c=>{var h;(h=s.current)==null||h.write(c)},clear:()=>{var c;(c=s.current)==null||c.clear()},fit:()=>{var c;try{(c=o.current)==null||c.fit(),s.current&&(t==null||t(s.current.cols,s.current.rows))}catch{}},bumpResize:()=>{var c;try{(c=o.current)==null||c.fit();const h=s.current;if(!h)return;const u=h.cols,f=h.rows;t==null||t(u+5,f),setTimeout(()=>{t==null||t(u,f)},100)}catch{}}})),b.useEffect(()=>{if(!i.current)return;const c=new z4({cursorBlink:!0,cursorStyle:"bar",fontSize:r,fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', 'Menlo', monospace",fontWeight:"400",letterSpacing:0,lineHeight:1.2,theme:Ug,allowTransparency:!0,scrollback:5e3,convertEol:!1}),h=new H4,u=new Y4;c.loadAddon(h),c.loadAddon(u),c.open(i.current),requestAnimationFrame(()=>{h.fit(),t==null||t(c.cols,c.rows),a(!0)});const f=c.onData(m=>{e(m)}),p=new ResizeObserver(()=>{requestAnimationFrame(()=>{try{h.fit(),t==null||t(c.cols,c.rows)}catch{}})});return p.observe(i.current),s.current=c,o.current=h,()=>{f.dispose(),p.disconnect(),c.dispose(),s.current=null,o.current=null}},[r]),d.jsx("div",{ref:i,className:"w-full h-full rounded-lg overflow-hidden transition-opacity duration-200",style:{background:Ug.background,opacity:l?1:0}})});I1.displayName="CliTerminal";function Vg({label:e,value:t,sub:r,icon:n}){return d.jsxs("div",{className:"px-4 py-3.5 rounded-xl bg-slate-900/50 border border-white/[0.06]",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[d.jsx("span",{className:"text-base flex items-center",children:n}),d.jsx("span",{className:"text-[10px] text-slate-500 uppercase tracking-wide font-semibold",children:e})]}),d.jsx("div",{className:"text-[22px] font-bold text-slate-100 tracking-tight",children:t}),r&&d.jsx("div",{className:"text-[11px] text-slate-500 mt-0.5",children:r})]})}function Kg({value:e,max:t,label:r,color:n="#8b5cf6",detail:i,compact:s=!1}){const o=t>0?Math.min(Math.round(e/t*100),100):0,l=o>85?"#ef4444":o>60?"#f59e0b":n;return s?d.jsxs("div",{className:"flex-1",children:[d.jsxs("div",{className:"flex justify-between mb-0.5",children:[d.jsx("span",{className:"text-[9px] text-slate-500 uppercase tracking-wide font-semibold",children:r}),d.jsxs("span",{className:"text-[10px] text-slate-400 font-semibold",children:[o,"%"]})]}),d.jsx("div",{className:"h-1 bg-white/[0.04] rounded-sm overflow-hidden",children:d.jsx("div",{className:"h-full rounded-sm transition-[width] duration-500",style:{width:`${o}%`,background:l}})})]}):d.jsxs("div",{className:"flex-1",children:[d.jsxs("div",{className:"flex justify-between mb-1.5",children:[d.jsx("span",{className:"text-[11px] text-slate-400 font-medium",children:r}),d.jsxs("span",{className:"text-[13px] text-slate-200 font-bold",children:[o,"%"]})]}),d.jsx("div",{className:"h-1.5 bg-white/[0.04] rounded-sm overflow-hidden",children:d.jsx("div",{className:"h-full rounded-sm transition-[width] duration-[600ms]",style:{width:`${o}%`,background:`linear-gradient(90deg, ${l}, ${l}cc)`}})}),i&&d.jsx("div",{className:"text-[10px] text-slate-500 mt-0.5",children:i})]})}function X4({screenshot:e,isCapturing:t,onRefresh:r,onAction:n,addLog:i,connState:s,connScreenshot:o}){const l=b.useRef(null),a=b.useRef(null),c=b.useRef(null),[h,u]=b.useState(!0),[f,p]=b.useState(2e3),[m,g]=b.useState(null),[x,_]=b.useState(""),[,v]=b.useState(!1),[y,N]=b.useState(!1),[L,C]=b.useState(!1),D=typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches,[z,F]=b.useState(D?"mouse":"touch"),[E,H]=b.useState(1),[B,I]=b.useState(0),[W,T]=b.useState(0),O=b.useRef(0),V=b.useRef(t),P=b.useRef(r),$=b.useRef(n),w=b.useRef(null),re=b.useRef(null),ce=b.useRef(!1),k=b.useRef(null),me=b.useRef(0),Q=b.useRef(null),J=b.useRef(1),X=b.useRef({x:0,y:0}),ae=b.useRef(E),ue=b.useRef(B),ge=b.useRef(W),M=b.useRef(z);b.useEffect(()=>{V.current=t},[t]),b.useEffect(()=>{P.current=r},[r]),b.useEffect(()=>{ae.current=E},[E]),b.useEffect(()=>{ue.current=B},[B]),b.useEffect(()=>{ge.current=W},[W]),b.useEffect(()=>{$.current=n},[n]),b.useEffect(()=>{M.current=z},[z]),b.useEffect(()=>{var K;(K=l.current)==null||K.focus()},[]);const ke=s==="connected",Se=s!=="connected"&&s!=="connecting",Ae=ke&&o?o:e;b.useEffect(()=>{E<=1&&(I(0),T(0))},[E]);const Ut=(K,pe,R)=>{if(R<=1)return{x:0,y:0};const q=(R-1)/(2*R)*100,A=(R-1)/(2*R)*100;return{x:Math.max(-q,Math.min(q,K)),y:Math.max(-A,Math.min(A,pe))}};b.useEffect(()=>{if(!h||!Se)return;let K=null;const pe=()=>{K&&clearInterval(K),!document.hidden&&(K=setInterval(()=>{var q;if(!V.current){const A=((q=l.current)==null?void 0:q.clientWidth)||0,j=Math.max(400,Math.ceil(A/100)*100);P.current(j)}},f))},R=()=>{document.hidden?(K&&clearInterval(K),K=null):pe()};return pe(),document.addEventListener("visibilitychange",R),()=>{K&&clearInterval(K),document.removeEventListener("visibilitychange",R)}},[h,Se,f]);const fr=(K,pe)=>{if(!c.current)return null;const R=c.current.getBoundingClientRect();return!R.width||!R.height?null:{nx:Math.max(0,Math.min(1,(K-R.left)/R.width)),ny:Math.max(0,Math.min(1,(pe-R.top)/R.height))}},Jt=async K=>{var R;const pe=fr(K.clientX,K.clientY);if(pe){g(`Click: ${Math.round(pe.nx*100)}%, ${Math.round(pe.ny*100)}%`),(R=l.current)==null||R.focus();try{const q=await n("input_click",{nx:pe.nx,ny:pe.ny});q!=null&&q.success||i(`❌ Click failed: ${q==null?void 0:q.error}`)}catch(q){i(`❌ Click error: ${q.message||q}`)}}},Jr=async(K,pe,R,q=0)=>{try{await n("input_key",{type:R?"char":"keyDown",key:K,code:pe,text:R?K:void 0,unmodifiedText:R?K:void 0,modifiers:q})}catch(A){i(`❌ Key error: ${A.message||A}`)}},jr=async K=>{if(K.target.tagName==="INPUT")return;["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Backspace","Tab","Enter","Escape"].includes(K.key)&&K.preventDefault();let R=0;K.altKey&&(R|=1),K.ctrlKey&&(R|=2),K.metaKey&&(R|=4),K.shiftKey&&(R|=8),g(`Key: ${K.key}`),await Jr(K.key,K.code,K.key.length===1,R)},Or=async K=>{if(K.key==="Enter"){if(K.nativeEvent.isComposing)return;if(x){const pe=x;_(""),g(`IME Sent: ${pe}`);try{const R=await n("input_type",{text:pe});R!=null&&R.success||i(`❌ IME error: ${R==null?void 0:R.error}`)}catch(R){i(`❌ IME error: ${R.message}`)}}else g("Key: Enter"),await Jr("Enter","Enter",!1)}};b.useEffect(()=>{const K=l.current;if(!K)return;const pe=R=>{var q;if((q=c.current)!=null&&q.contains(R.target)){R.preventDefault();const A=Date.now();if(A-O.current<40)return;O.current=A;const j=fr(R.clientX,R.clientY);if(!j)return;g(`Scroll: ${Math.round(R.deltaY)}`),n("input_wheel",{nx:j.nx,ny:j.ny,deltaX:Math.round(R.deltaX),deltaY:Math.round(R.deltaY)}).catch(()=>{})}};return K.addEventListener("wheel",pe,{passive:!1}),()=>K.removeEventListener("wheel",pe)},[n]);const[er,pr]=b.useState(null),Pe=b.useRef(null);return b.useEffect(()=>{if(z==="mouse"&&!Pe.current){const K={nx:.5,ny:.5};Pe.current=K,pr(K)}},[z]),b.useEffect(()=>{const K=l.current;if(!K)return;const pe=Y=>{if(!c.current)return null;const ee=c.current.getBoundingClientRect();return!ee.width||!ee.height?null:{nx:Math.max(0,Math.min(1,(Y.clientX-ee.left)/ee.width)),ny:Math.max(0,Math.min(1,(Y.clientY-ee.top)/ee.height))}},R=(Y,ee)=>{if(!c.current)return{dnx:0,dny:0};const se=c.current,ne=se.getBoundingClientRect(),fe=se.naturalWidth||ne.width,le=se.naturalHeight||ne.height,ye=fe/le,be=ne.width/ne.height;let Qe,rt;return ye>be?(Qe=ne.width,rt=ne.width/ye):(rt=ne.height,Qe=ne.height*ye),{dnx:Y/Qe,dny:ee/rt}},q=(Y,ee,se)=>{if(se<=1.05)return;const ne=-(Y-.5)*100,fe=-(ee-.5)*100,le=Ut(ne,fe,se);(Math.abs(le.x-ue.current)>.1||Math.abs(le.y-ge.current)>.1)&&(I(le.x),T(le.y),ue.current=le.x,ge.current=le.y)},A=Y=>{if(Y.preventDefault(),Y.touches.length===1){const ee=Y.touches[0];w.current={x:ee.clientX,y:ee.clientY,time:Date.now()},re.current={x:ee.clientX,y:ee.clientY},ce.current=!1,k.current=setTimeout(()=>{if(!ce.current)if(ce.current=!0,M.current==="mouse"){const se=Pe.current||{nx:.5,ny:.5};g("Right Click"),$.current("input_click",{...se,button:"right"}).catch(()=>{})}else{const se=pe(ee);se&&(g("Right Click"),$.current("input_click",{...se,button:"right"}).catch(()=>{}))}},500)}else if(Y.touches.length===2){clearTimeout(k.current),ce.current=!0;const ee=Y.touches[1].clientX-Y.touches[0].clientX,se=Y.touches[1].clientY-Y.touches[0].clientY;Q.current=Math.sqrt(ee*ee+se*se),J.current=ae.current,X.current={x:(Y.touches[0].clientX+Y.touches[1].clientX)/2,y:(Y.touches[0].clientY+Y.touches[1].clientY)/2}}},j=Y=>{if(Y.preventDefault(),Y.touches.length===1&&re.current){const ee=Y.touches[0],se=ee.clientX-re.current.x,ne=ee.clientY-re.current.y;if(!ce.current&&(Math.abs(se)>10||Math.abs(ne)>10)&&(ce.current=!0,clearTimeout(k.current)),ce.current)if(M.current==="mouse"){const fe=R(se,ne),le=Pe.current||{nx:.5,ny:.5},ye=Math.max(0,Math.min(1,le.nx+fe.dnx)),be=Math.max(0,Math.min(1,le.ny+fe.dny));Pe.current={nx:ye,ny:be},pr({nx:ye,ny:be}),g(`Cursor: ${Math.round(ye*100)}%, ${Math.round(be*100)}%`),q(ye,be,ae.current);const Qe=Date.now();Qe-O.current>=30&&(O.current=Qe,$.current("input_mouseMoved",{nx:ye,ny:be}).catch(()=>{}))}else if(ae.current>1){const fe=a.current;if(fe){const le=fe.clientWidth,ye=fe.clientHeight,be=ue.current+se/le*100,Qe=ge.current+ne/ye*100,rt=Ut(be,Qe,ae.current);I(rt.x),T(rt.y),ue.current=rt.x,ge.current=rt.y}}else{const fe=pe(ee);if(fe){const le=Date.now();le-O.current>=40&&(O.current=le,g("Scroll"),$.current("input_wheel",{nx:fe.nx,ny:fe.ny,deltaX:Math.round(-se*2.5),deltaY:Math.round(-ne*2.5)}).catch(()=>{}))}}re.current={x:ee.clientX,y:ee.clientY}}else if(Y.touches.length===2&&Q.current!==null){const ee=Y.touches[1].clientX-Y.touches[0].clientX,se=Y.touches[1].clientY-Y.touches[0].clientY,fe=Math.sqrt(ee*ee+se*se)/Q.current,le=(Y.touches[0].clientX+Y.touches[1].clientX)/2,ye=(Y.touches[0].clientY+Y.touches[1].clientY)/2,be=le-X.current.x,Qe=ye-X.current.y,rt=Math.abs(fe-1)>.03;if(M.current==="mouse"){if(rt){const tr=Math.max(.5,Math.min(5,J.current*fe));H(tr),ae.current=tr}else if(Math.abs(be)>2||Math.abs(Qe)>2){const tr=Pe.current||{nx:.5,ny:.5},At=Date.now();At-O.current>=30&&(O.current=At,g("Scroll"),$.current("input_wheel",{nx:tr.nx,ny:tr.ny,deltaX:Math.round(-be*3),deltaY:Math.round(-Qe*3)}).catch(()=>{}))}}else{const tr=Math.max(.5,Math.min(5,J.current*fe));H(tr),ae.current=tr;const At=a.current;if(At&&tr>1){const Qa=At.clientWidth,Wo=At.clientHeight,Za=ue.current+be/Qa*100,Ja=ge.current+Qe/Wo*100,qn=Ut(Za,Ja,tr);I(qn.x),T(qn.y),ue.current=qn.x,ge.current=qn.y}}X.current={x:le,y:ye}}},U=Y=>{var ee;if(clearTimeout(k.current),Q.current=null,Y.touches.length===0&&Y.changedTouches.length===1&&!ce.current){const se=Y.changedTouches[0],ne=Date.now();if(ne-(((ee=w.current)==null?void 0:ee.time)||0)<40)return;if(M.current==="mouse"){const le=Pe.current||pe(se);le&&(g(`Click: ${Math.round(le.nx*100)}%, ${Math.round(le.ny*100)}%`),$.current("input_click",{...le}).catch(()=>{}))}else{const le=pe(se);if(!le)return;ne-me.current<300?(g("Double tap"),$.current("input_click",{...le,clickCount:2}).catch(()=>{}),me.current=0):(g(`Tap: ${Math.round(le.nx*100)}%, ${Math.round(le.ny*100)}%`),$.current("input_click",{...le}).catch(()=>{}),me.current=ne)}}ce.current=!1};return K.addEventListener("touchstart",A,{passive:!1}),K.addEventListener("touchmove",j,{passive:!1}),K.addEventListener("touchend",U,{passive:!1}),()=>{K.removeEventListener("touchstart",A),K.removeEventListener("touchmove",j),K.removeEventListener("touchend",U),clearTimeout(k.current)}},[]),d.jsxs("div",{ref:l,className:"flex-1 flex flex-col bg-black relative overflow-hidden outline-none touch-none",onKeyDown:jr,onContextMenu:K=>K.preventDefault(),onFocus:()=>v(!0),onBlur:()=>v(!1),tabIndex:0,children:[d.jsxs("div",{ref:a,className:"flex-1 relative overflow-hidden flex items-center justify-center bg-black",children:[Ae?d.jsx("img",{ref:c,src:Ae,alt:"Remote View",style:{display:"block",maxWidth:"100%",maxHeight:"100%",width:"auto",height:"auto",transform:`scale(${E}) translate(${B}%, ${W}%)`,transformOrigin:"center center",cursor:z==="mouse"?"default":"crosshair",userSelect:"none",WebkitTouchCallout:"none"},onClick:Jt,onContextMenu:K=>K.preventDefault(),onDragStart:K=>K.preventDefault()}):d.jsxs("div",{className:"text-slate-800 text-center",children:[d.jsx("div",{className:"text-5xl mb-3",children:"🌑"}),d.jsx("div",{className:"text-[13px] font-semibold",children:"Connecting to Host..."})]}),z==="mouse"&&er&&Ae&&c.current&&(()=>{var Qe;const K=c.current,pe=K.getBoundingClientRect(),R=(Qe=a.current)==null?void 0:Qe.getBoundingClientRect();if(!R)return null;const q=K.naturalWidth||pe.width,A=K.naturalHeight||pe.height,j=q/A,U=pe.width/pe.height;let Y,ee,se,ne;j>U?(Y=pe.width,ee=pe.width/j,se=0,ne=(pe.height-ee)/2):(ee=pe.height,Y=pe.height*j,se=(pe.width-Y)/2,ne=0);const fe=pe.left-R.left+se+Y*er.nx,le=pe.top-R.top+ne+ee*er.ny,ye=Math.max(8,Math.min(R.width-8,fe)),be=Math.max(8,Math.min(R.height-8,le));return d.jsxs("div",{style:{position:"absolute",left:ye-8,top:be-8,width:16,height:16,pointerEvents:"none",zIndex:100},children:[d.jsx("div",{style:{position:"absolute",left:7,top:0,width:2,height:16,background:"rgba(59,130,246,0.8)"}}),d.jsx("div",{style:{position:"absolute",left:0,top:7,width:16,height:2,background:"rgba(59,130,246,0.8)"}}),d.jsx("div",{style:{position:"absolute",left:5,top:5,width:6,height:6,borderRadius:"50%",background:"#3b82f6",boxShadow:"0 0 8px rgba(59,130,246,0.6)"}})]})})()]}),d.jsxs("div",{onTouchStart:K=>K.stopPropagation(),className:"absolute bottom-0 left-0 right-0 z-[1000] flex items-center justify-center gap-1.5 px-3 py-2 bg-black/75 backdrop-blur-xl border-t border-white/[0.08] touch-none",children:[d.jsxs("div",{onClick:()=>{F(K=>{const pe=K==="touch"?"mouse":"touch";if(pe==="mouse"&&!Pe.current){const R={nx:.5,ny:.5};Pe.current=R,pr(R)}return pe})},className:`h-8 px-2.5 rounded-lg flex items-center gap-[5px] cursor-pointer ${z==="mouse"?"bg-blue-500/25 border border-blue-500/40":"bg-white/[0.08] border border-white/10"}`,children:[d.jsx("span",{className:"text-sm",children:z==="mouse"?"🖱️":"👆"}),d.jsx("span",{className:`text-[10px] font-bold ${z==="mouse"?"text-blue-400":"text-slate-400"}`,children:z==="mouse"?"Mouse":"Touch"})]}),d.jsxs("div",{className:"relative",children:[d.jsx("div",{onClick:()=>{C(!L),N(!1)},className:`w-8 h-8 rounded-lg flex items-center justify-center cursor-pointer ${L?"bg-emerald-500/25 border border-emerald-500/40":"bg-white/[0.08] border border-white/10"}`,children:d.jsx("span",{className:"text-sm",children:"⌨️"})}),L&&d.jsx("div",{className:"absolute bottom-10 left-1/2 -translate-x-1/2 w-[220px] bg-neutral-950/[0.98] backdrop-blur-[30px] rounded-xl border border-white/20 p-[10px_12px] shadow-[0_10px_30px_rgba(0,0,0,0.8)] flex flex-col gap-2 z-[2000]",style:{animation:"slideUp 0.15s ease-out"},children:d.jsx("input",{type:"text",placeholder:"Type & Enter...",value:x,autoFocus:!0,onTouchStart:K=>K.stopPropagation(),onChange:K=>_(K.target.value),onKeyDown:Or,className:"w-full bg-black/60 border border-white/15 rounded-lg px-2.5 py-2 text-white text-[13px] outline-none"})})]}),d.jsx("div",{className:"relative",children:d.jsx("div",{onClick:()=>{N(!y),C(!1)},className:`w-8 h-8 rounded-lg flex items-center justify-center cursor-pointer ${y?"bg-blue-500/25 border border-blue-500/40":"bg-white/[0.08] border border-white/10"}`,children:d.jsx("span",{className:"text-sm",children:"⚙️"})})}),d.jsx("div",{className:"w-px h-[18px] bg-white/10"}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsxs("div",{className:"flex items-center gap-0.5 px-1.5 py-0.5 rounded-md",style:{background:ke?"rgba(16,185,129,0.12)":"rgba(251,191,36,0.12)"},children:[d.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:ke?"#10b981":"#fbbf24"}}),d.jsx("span",{className:"text-[8px] font-extrabold",style:{color:ke?"#10b981":"#fbbf24"},children:ke?"Connected":"WS"})]}),E>1&&d.jsxs("span",{className:"text-[8px] font-bold text-indigo-400",children:[Math.round(E*100),"%"]}),m&&d.jsx("span",{className:"text-[8px] text-neutral-500 font-semibold max-w-[100px] overflow-hidden text-ellipsis whitespace-nowrap",children:m})]})]}),y&&d.jsxs("div",{onTouchStart:K=>K.stopPropagation(),style:{position:"absolute",bottom:56,left:"50%",transform:"translateX(-50%)",width:220,background:"rgba(23, 23, 23, 0.95)",backdropFilter:"blur(25px)",borderRadius:14,border:"1px solid rgba(255,255,255,0.1)",padding:14,boxShadow:"0 12px 40px rgba(0,0,0,0.6)",display:"flex",flexDirection:"column",gap:12,zIndex:1001,touchAction:"none",animation:"slideUpSidebar 0.15s ease-out"},children:[d.jsx("div",{style:{fontSize:9,fontWeight:900,color:"#3b82f6",letterSpacing:1.5},children:"SETTINGS"}),d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[d.jsxs("div",{style:{fontSize:10,color:"#888",fontWeight:700},children:["ZOOM: ",E===1?"FIT":`${Math.round(E*100)}%`]}),d.jsxs("div",{style:{display:"flex",gap:4},children:[d.jsx("button",{onClick:K=>{K.stopPropagation(),H(pe=>Math.max(.5,pe-.25))},style:{flex:1,background:"rgba(255,255,255,0.1)",color:"#fff",border:"none",padding:"6px",borderRadius:6,fontSize:12,fontWeight:800,cursor:"pointer"},children:"−"}),d.jsx("button",{onClick:K=>{K.stopPropagation(),H(1),I(0),T(0)},style:{flex:1,background:"rgba(255,255,255,0.1)",color:"#fff",border:"none",padding:"6px",borderRadius:6,fontSize:9,fontWeight:800,cursor:"pointer"},children:"FIT"}),d.jsx("button",{onClick:K=>{K.stopPropagation(),H(pe=>Math.min(5,pe+.25))},style:{flex:1,background:"rgba(255,255,255,0.1)",color:"#fff",border:"none",padding:"6px",borderRadius:6,fontSize:12,fontWeight:800,cursor:"pointer"},children:"+"})]})]}),d.jsx("button",{onClick:K=>{var q;K.stopPropagation();const pe=((q=l.current)==null?void 0:q.clientWidth)||0,R=pe>0?Math.max(400,Math.ceil(pe/100)*100):void 0;r(R)},style:{width:"100%",background:"#3b82f6",color:"#fff",border:"none",padding:"8px",borderRadius:6,fontSize:11,fontWeight:800,cursor:"pointer"},children:"FORCE SYNC"}),d.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(255,255,255,0.05)",padding:"6px 10px",borderRadius:6},children:[d.jsx("span",{style:{fontSize:10,color:"#888",fontWeight:700},children:"AUTO REF."}),d.jsx("input",{type:"checkbox",checked:h,onChange:K=>u(K.target.checked)})]}),d.jsxs("select",{value:f,onChange:K=>p(Number(K.target.value)),style:{background:"rgba(255,255,255,0.05)",color:"#fff",border:"none",borderRadius:6,padding:"6px",fontSize:10,fontWeight:600,outline:"none"},children:[d.jsx("option",{value:500,children:"0.5s Interval"}),d.jsx("option",{value:1e3,children:"1.0s Interval"}),d.jsx("option",{value:2e3,children:"2.0s Interval"}),d.jsx("option",{value:4e3,children:"4.0s Interval"})]})]}),d.jsx("style",{children:`
|
|
158
|
+
@keyframes slideUp {
|
|
159
|
+
from { opacity: 0; transform: translateY(6px); }
|
|
160
|
+
to { opacity: 1; transform: translateY(0); }
|
|
161
|
+
}
|
|
162
|
+
@keyframes slideUpSidebar {
|
|
163
|
+
from { opacity: 0; transform: translateY(6px); }
|
|
164
|
+
to { opacity: 1; transform: translateY(0); }
|
|
165
|
+
}
|
|
166
|
+
`})]})}function G4({screenshotUrl:e,mode:t="preview",zoom:r=100,interactive:n=!1,connectionState:i,onDismiss:s,onClickAt:o,onKeyDown:l,badge:a,emptyMessage:c,aspectRatio:h,className:u,style:f}){const p=b.useRef(null),m=b.useCallback(g=>{if(!n||!o||!p.current)return;const x=p.current,_=x.getBoundingClientRect(),v=(g.clientX-_.left)/_.width*x.naturalWidth,y=(g.clientY-_.top)/_.height*x.naturalHeight;o(v,y,x.naturalWidth,x.naturalHeight)},[n,o]);return t==="preview"?e?d.jsxs("div",{className:`relative rounded-xl overflow-hidden border border-border-subtle bg-bg-secondary ${u||""}`,style:{aspectRatio:h||"16/9",...f},children:[d.jsx("img",{ref:p,src:e,alt:"IDE Screenshot",className:"w-full h-full object-cover"}),s&&d.jsx("button",{onClick:s,className:"absolute top-2.5 right-2.5 bg-black/50 border-none text-white w-5 h-5 rounded-full text-[10px] z-10 cursor-pointer flex items-center justify-center",children:"✕"})]}):null:e?d.jsxs("div",{className:`${n?"screenshot-interactive":""} ${u||""} relative h-full flex items-center justify-center overflow-auto`,tabIndex:n?0:void 0,onKeyDown:n?l:void 0,style:f,children:[d.jsx("img",{ref:p,src:e,alt:"IDE Screenshot",onClick:n?m:void 0,className:"max-w-full max-h-full object-contain",style:{...n?{cursor:"crosshair"}:{},...r!==100?{transform:`scale(${r/100})`,transformOrigin:"center center"}:{}}}),a&&d.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 bg-black/70 text-white px-3.5 py-1.5 rounded-[20px] text-xs font-semibold backdrop-blur-sm",children:a})]}):d.jsxs("div",{className:`flex items-center justify-center flex-col gap-2 h-full text-text-muted ${u||""}`,style:f,children:[d.jsx("p",{className:"text-base",children:c||"🖥 Waiting for screenshot stream..."}),i&&d.jsxs("p",{className:"text-[13px] mt-2 opacity-50",children:["P2P: ",i]})]})}function A1({activeConv:e,onModalButton:t}){const[r,n]=b.useState(null);if(b.useEffect(()=>{n(null)},[e.modalMessage,e.status]),e.status!=="waiting_approval"||!e.modalButtons)return null;const i=s=>{r||(n(s),t(s))};return d.jsxs("div",{className:"bg-gradient-to-br from-amber-600 to-amber-700 text-white py-2.5 px-4 shrink-0 z-[5]",children:[e.modalMessage&&d.jsx("div",{className:"text-[11px] opacity-85 mb-1.5 whitespace-nowrap overflow-hidden text-ellipsis max-w-full",children:e.modalMessage.replace(/[\n\r]+/g," ").slice(0,120)}),d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsxs("div",{className:"font-black text-xs flex items-center gap-2",children:[d.jsx($y,{size:14})," ",r?"PROCESSING...":"ACTION REQUIRED"]}),d.jsx("div",{className:"flex gap-2 flex-wrap",children:e.modalButtons.map((s,o)=>{const l=s.replace(/[⌥⏎⇧⌫⌘⌃]/g,"").trim().toLowerCase(),a=/^(run|approve|accept|yes|allow|always)/.test(l),c=/^(reject|deny|delete|remove|abort)/.test(l),h=r===s,u=r!==null;return d.jsx("button",{onClick:()=>i(s),disabled:u,className:`btn btn-sm border-none rounded-md text-xs px-3 py-1 ${a?"bg-white text-amber-700 font-extrabold":c?"bg-red-500/30 text-white font-semibold":"bg-white/15 text-white font-semibold"} ${u&&!h?"opacity-40":"opacity-100"} ${u?"cursor-not-allowed":"cursor-pointer"}`,children:h?"⏳ ...":s.replace(/[⌥⏎⇧⌫⌘⌃]/g,"").trim()},o)})})]})]})}const gr=new Map;function Q4({ideId:e,ideType:t,agentType:r,agentName:n,serverModel:i,serverMode:s,acpConfigOptions:o,acpModes:l}){var me;const{sendCommand:a}=Si(),c=!!(o||l),h=`${e}:${r}`,u=gr.get(h),[f,p]=b.useState(!1),[m,g]=b.useState(!1),[x,_]=b.useState((u==null?void 0:u.models)||[]),[v,y]=b.useState((u==null?void 0:u.modes)||[]),N=Q=>Q?typeof Q=="string"?Q:typeof Q=="object"?Q.name||Q.id||JSON.stringify(Q):String(Q):"",[L,C]=b.useState(N(i)),[D,z]=b.useState(N(s)),[F,E]=b.useState(!1),[H,B]=b.useState(!1),I=b.useRef(0),W=Q=>Q.map(J=>typeof J=="string"?J:(J==null?void 0:J.name)||(J==null?void 0:J.id)||String(J));b.useEffect(()=>{if(o){const Q=o.find(J=>J.category==="model");if(Q){const J=W(Q.options.map(ae=>ae.value));_(J),Q.currentValue&&C(N(Q.currentValue));const X=gr.get(h)||{models:[],modes:[]};gr.set(h,{...X,models:J})}}if(l&&l.length>0){const Q=W(l.map(X=>X.id));y(Q);const J=gr.get(h)||{models:[],modes:[]};gr.set(h,{...J,modes:Q})}else if(o){const Q=o.find(J=>J.category!=="model");if(Q){const J=W(Q.options.map(ae=>ae.value));y(J),Q.currentValue&&z(N(Q.currentValue));const X=gr.get(h)||{models:[],modes:[]};gr.set(h,{...X,modes:J})}}},[o,l,h]),b.useEffect(()=>{p(!1),g(!1),C(N(i)),z(N(s));const Q=gr.get(h);Q?(_(Q.models),y(Q.modes)):(_([]),y([]))},[e,r]),b.useEffect(()=>{i&&Date.now()>I.current&&C(N(i))},[i]),b.useEffect(()=>{s&&Date.now()>I.current&&z(N(s))},[s]);const T=b.useCallback(async(Q,J={})=>{const X={...J},ae=e.split(":");return ae.length>=3&&(ae[1]==="ide"||ae[1]==="cli"||ae[1]==="acp")&&(X._targetInstance=ae.slice(2).join(":"),X._targetType=ae[1]),await a(e,Q,X)},[e]),O=async()=>{var Q,J;if(x.length>0){p(!f);return}if(c){p(!0);return}E(!0);try{const X=await T("list_extension_models",{agentType:r,ideType:t}),ae=(X==null?void 0:X.models)||((Q=X==null?void 0:X.result)==null?void 0:Q.models)||[],ue=W(ae);_(ue),X!=null&&X.current&&C(N(X.current)),(J=X==null?void 0:X.result)!=null&&J.current&&C(N(X.result.current));const ge=gr.get(h)||{models:[],modes:[]};gr.set(h,{...ge,models:ue}),p(!0)}catch{}finally{E(!1)}},V=async()=>{var Q,J;if(v.length>0){g(!m);return}if(c){g(!0);return}B(!0);try{const X=await T("list_extension_modes",{agentType:r,ideType:t}),ae=(X==null?void 0:X.modes)||((Q=X==null?void 0:X.result)==null?void 0:Q.modes)||[],ue=W(ae);y(ue),X!=null&&X.current&&z(N(X.current)),(J=X==null?void 0:X.result)!=null&&J.current&&z(N(X.result.current));const ge=gr.get(h)||{models:[],modes:[]};gr.set(h,{...ge,modes:ue}),g(!0)}catch{}finally{B(!1)}},P=async Q=>{p(!1),C(Q),I.current=Date.now()+5e3;try{c?await T("change_model",{agentType:r,ideType:t,model:Q}):await T("set_extension_model",{agentType:r,ideType:t,model:Q})}catch{}},$=c&&!(l&&l.length>0)&&(o==null?void 0:o.some(Q=>Q.category!=="model")),w=$?(me=o==null?void 0:o.find(Q=>Q.category!=="model"))==null?void 0:me.configId:void 0,re=async Q=>{g(!1),z(Q),I.current=Date.now()+5e3;try{c&&$&&w?await T("set_thought_level",{agentType:r,ideType:t,configId:w,value:Q}):c?await T("set_mode",{agentType:r,ideType:t,mode:Q}):await T("set_extension_mode",{agentType:r,ideType:t,mode:Q})}catch{}},k={cline:"#22d3ee","roo-code":"#a78bfa",cursor:"#60a5fa",antigravity:"#f97316",windsurf:"#34d399"}[r]||"#94a3b8";return d.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 flex-wrap text-[10px] border-t border-border-subtle bg-[var(--surface-primary)]",children:[d.jsx("span",{className:"text-[9px] font-bold tracking-wide uppercase opacity-70",style:{color:k},children:n}),d.jsx("span",{className:"text-border-subtle text-[10px]",children:"│"}),d.jsxs("div",{className:"relative",children:[d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-xl text-[10px] font-medium cursor-pointer transition-all bg-[var(--surface-tertiary)] whitespace-nowrap max-w-40 overflow-hidden text-ellipsis",style:{borderColor:f?`${k}55`:"transparent",border:"1px solid",color:L?"var(--text-primary)":"var(--text-muted)"},onClick:O,children:[d.jsx("span",{className:"text-[9px] opacity-60",children:"🤖"}),F?"...":L||"Model",d.jsx("span",{className:"text-[7px] opacity-50",children:"▼"})]}),f&&x.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-[59]",onClick:()=>p(!1)}),d.jsxs("div",{className:"absolute bottom-full left-0 z-[60] bg-[var(--surface-primary)] border border-border-subtle rounded-lg mb-1 max-h-[220px] overflow-y-auto min-w-40 shadow-[0_-4px_16px_rgba(0,0,0,0.3)]",children:[d.jsx("div",{className:"px-3 py-1.5 text-[9px] font-bold text-text-muted tracking-wider border-b border-border-subtle",children:"SELECT MODEL"}),x.map(Q=>d.jsx("div",{className:"px-3 py-[7px] text-[11px] cursor-pointer whitespace-nowrap overflow-hidden text-ellipsis",style:{background:Q===L?`${k}18`:"transparent",color:Q===L?k:"var(--text-secondary)",fontWeight:Q===L?600:400,borderLeft:Q===L?`2px solid ${k}`:"2px solid transparent"},onMouseEnter:J=>{J.currentTarget.style.background=`${k}12`},onMouseLeave:J=>{J.currentTarget.style.background=Q===L?`${k}18`:"transparent"},onClick:()=>P(Q),children:Q},Q))]})]})]}),d.jsxs("div",{className:"relative",children:[d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-xl text-[10px] font-medium cursor-pointer transition-all bg-[var(--surface-tertiary)] whitespace-nowrap max-w-40 overflow-hidden text-ellipsis",style:{borderColor:m?`${k}55`:"transparent",border:"1px solid",color:D?"var(--text-primary)":"var(--text-muted)"},onClick:V,children:[d.jsx("span",{className:"text-[9px] opacity-60",children:$?"🧠":"⚡"}),H?"...":D||($?"Thinking":"Mode"),d.jsx("span",{className:"text-[7px] opacity-50",children:"▼"})]}),m&&v.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"fixed inset-0 z-[59]",onClick:()=>g(!1)}),d.jsxs("div",{className:"absolute bottom-full left-0 z-[60] bg-[var(--surface-primary)] border border-border-subtle rounded-lg mb-1 max-h-[220px] overflow-y-auto min-w-40 shadow-[0_-4px_16px_rgba(0,0,0,0.3)]",children:[d.jsx("div",{className:"px-3 py-1.5 text-[9px] font-bold text-text-muted tracking-wider border-b border-border-subtle",children:$?"SELECT THINKING LEVEL":"SELECT MODE"}),v.map(Q=>d.jsx("div",{className:"px-3 py-[7px] text-[11px] cursor-pointer whitespace-nowrap overflow-hidden text-ellipsis",style:{background:Q===D?`${k}18`:"transparent",color:Q===D?k:"var(--text-secondary)",fontWeight:Q===D?600:400,borderLeft:Q===D?`2px solid ${k}`:"2px solid transparent"},onMouseEnter:J=>{J.currentTarget.style.background=`${k}12`},onMouseLeave:J=>{J.currentTarget.style.background=Q===D?`${k}18`:"transparent"},onClick:()=>re(Q),children:Q},Q))]})]})]})]})}const or=e=>(e.ideId||e.tabKey||e.id||"").includes(":cli:"),Rr=e=>(e.ideId||e.tabKey||e.id||"").includes(":acp:");function B1({activeConv:e,ides:t,agentInput:r,setAgentInput:n,handleSendChat:i,handleFocusAgent:s,isFocusingAgent:o,messageReceivedAt:l,actionLogs:a}){const c=b.useRef(null),{sendCommand:h}=Si(),[u,f]=b.useState([]),[p,m]=b.useState(0),[g,x]=b.useState(!0),[_,v]=b.useState(!1),y=b.useRef("");e.tabKey!==y.current&&(y.current=e.tabKey,f([]),m(0),x(!0));const N=b.useCallback(async()=>{var D,z,F,E,H;if(!(_||!g)){v(!0);try{const B=t.find(P=>P.id===e.ideId),I=(B==null?void 0:B.daemonId)||((D=e.ideId)==null?void 0:D.split(":")[0])||"";if(!I){x(!1);return}const W=e.ideType||e.agentType||"",T=(e.ideId||"").split(":"),O=T.length>=3?T.slice(2).join(":"):void 0;console.log("[ChatPane] requestChatHistory:",{daemonId:I,agentType:W,instanceId:O,offset:p});const V=await h(I,"chat_history",{agentType:W,offset:p,limit:30,instanceId:O});console.log("[ChatPane] got result:",{count:((z=V.messages)==null?void 0:z.length)||0,hasMore:V.hasMore}),((F=V.messages)==null?void 0:F.length)>0&&(f(P=>[...V.messages,...P]),m(P=>P+V.messages.length)),x(V.hasMore)}catch(B){console.warn("[ChatPane] Failed to load history:",B),!((E=B==null?void 0:B.message)!=null&&E.includes("P2P not available"))&&!((H=B==null?void 0:B.message)!=null&&H.includes("channel not open"))&&x(!1)}finally{v(!1)}}},[_,g,p,t,e]),L=b.useRef(0);b.useEffect(()=>{if(e.messages.length<10&&g&&!_&&u.length===0){const D=L.current;if(D>5)return;const F=setTimeout(()=>{L.current=D+1,N()},D===0?0:2e3);return()=>clearTimeout(F)}else u.length>0&&(L.current=0)},[e.tabKey,e.messages.length,g,_,u.length,N]);const C=(()=>{const D=e.messages.map((E,H)=>{const B=`${e.ideId}-${E.id??`i-${H}`}`;return{...E,receivedAt:E.receivedAt||l[B]||0}});if(u.length===0)return D;const z=new Set(D.map(E=>`${E.role}:${(E.content||"").slice(0,100)}`));return[...u.filter(E=>!z.has(`${E.role}:${(E.content||"").slice(0,100)}`)),...D]})();return d.jsxs(d.Fragment,{children:[d.jsx(Wy,{messages:C,actionLogs:a.filter(D=>D.ideId===e.tabKey).sort((D,z)=>D.timestamp-z.timestamp),agentName:e.agentName||e.displayPrimary||"Agent",isCliMode:or(e)||Rr(e),isWorking:e.status==="working",contextKey:e.tabKey,onLoadMore:N,isLoadingMore:_,hasMoreHistory:g,emptyState:e.messages.length===0?e.status==="not_monitored"?d.jsxs("div",{className:"text-center mt-16 flex flex-col items-center gap-3",children:[d.jsx("div",{className:"text-3xl opacity-60",children:d.jsx(Hy,{size:28})}),d.jsx("div",{className:"text-[13px] opacity-50",children:"Agent not monitored"}),d.jsx("button",{onClick:s,disabled:o,className:"btn btn-sm bg-accent text-white border-none rounded-[10px] px-5 py-2 font-bold text-[13px] cursor-pointer transition-all",children:o?"⌛ Switching...":d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(ma,{size:14})," Open ",e.displayPrimary," Panel"]})}),d.jsx("div",{className:"text-[11px] opacity-35 max-w-[280px]",children:"Click to switch monitoring to this agent"})]}):e.status==="panel_hidden"?d.jsxs("div",{className:"text-center mt-16 flex flex-col items-center gap-3",children:[d.jsx("div",{className:"text-3xl opacity-60",children:d.jsx(y3,{size:28})}),d.jsx("div",{className:"text-[13px] opacity-50",children:"Panel is not visible in IDE"}),d.jsx("button",{onClick:s,disabled:o,className:"btn btn-sm bg-accent text-white border-none rounded-[10px] px-5 py-2 font-bold text-[13px] cursor-pointer transition-all",children:o?"⌛ Opening...":d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(ma,{size:14})," Open ",e.displayPrimary," Panel"]})}),d.jsx("div",{className:"text-[11px] opacity-35 max-w-[280px]",children:"Open the agent sidebar in your IDE to start viewing messages"})]}):void 0:void 0}),!or(e)&&(()=>{const D=t.find(z=>z.id===e.ideId);return d.jsx(Q4,{ideId:e.ideId,ideType:e.ideType,agentType:e.streamSource==="agent-stream"?e.agentType:e.ideType,agentName:e.streamSource==="agent-stream"?e.agentName:e.displaySecondary,serverModel:(D==null?void 0:D.currentModel)||void 0,serverMode:(D==null?void 0:D.currentPlan)||void 0,acpConfigOptions:Rr(e)?D==null?void 0:D.acpConfigOptions:void 0,acpModes:Rr(e)?D==null?void 0:D.acpModes:void 0})})(),d.jsx("div",{className:"dashboard-input-area px-3 py-2.5 bg-[var(--surface-primary)] border-t border-border-subtle shrink-0",children:d.jsxs("div",{className:"flex gap-2.5 items-center",children:[d.jsx("div",{className:"flex-1 relative",children:d.jsx("input",{ref:c,type:"text",placeholder:`Send message to ${e.displayPrimary}...`,value:r,onChange:D=>n(D.target.value),onPaste:D=>{const z=D.clipboardData.getData("text");z&&n(F=>F+z),D.preventDefault()},onKeyDown:D=>{if(D.key==="Enter"){if(D.nativeEvent.isComposing){D.preventDefault();return}D.preventDefault(),i()}},onBlur:()=>{window.innerWidth<768&&setTimeout(()=>{document.documentElement.scrollTop=0},100)},className:"w-full h-10 rounded-[20px] px-4 bg-bg-secondary border border-border-subtle text-sm text-text-primary"})}),d.jsx("button",{onClick:i,disabled:!r.trim(),className:`w-10 h-10 rounded-full flex items-center justify-center border-none shrink-0 transition-all duration-300 ${r.trim()?"bg-accent cursor-pointer":"bg-bg-secondary cursor-default"}`,children:d.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:r.trim()?"text-white":"text-text-muted",children:d.jsx("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"})})})]})})]})}function Z4({activeConv:e,ptyBuffers:t,terminalRef:r,agentInput:n,setAgentInput:i,handleSendChat:s,handleModalButton:o}){const l=b.useRef(null),{sendCommand:a,sendData:c}=Si();return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 bg-[var(--surface-primary)] border-b border-border-subtle shrink-0",children:[d.jsx("div",{className:"flex gap-1",children:d.jsx("div",{className:"px-3 py-1 rounded-md text-[11px] font-semibold bg-accent text-white",children:"⬛ Terminal"})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{className:"text-[10px] text-text-muted",children:[e.agentName," — Terminal"]}),d.jsx("button",{onClick:()=>{if(!r.current||!e)return;const h=t.current.get(e.tabKey);if(h&&h.length>0)for(const u of h)r.current.write(u);requestAnimationFrame(()=>{requestAnimationFrame(()=>{var u;(u=r.current)==null||u.bumpResize()})})},title:"Refresh terminal (replay buffer + TUI redraw)",className:"px-2 py-0.5 rounded-[5px] text-[11px] bg-bg-secondary text-text-secondary border border-border-subtle cursor-pointer leading-none",children:"↺"}),d.jsx("button",{onClick:async()=>{var f;const h=(f=e.ideId)!=null&&f.includes(":cli:")?e.ideId.split(":cli:")[1]:e.ideType||e.agentType||"";if(!window.confirm(`Stop ${h}?
|
|
167
|
+
This will terminate the CLI process.`))return;const u=e.ideId||e.daemonId||"";try{await a(u,"stop_cli",{cliType:h})}catch(p){console.error("Stop CLI failed:",p)}},title:"Stop CLI process",className:"px-2 py-0.5 rounded-[5px] text-[11px] bg-red-500/[0.08] text-red-400 border border-red-500/30 cursor-pointer leading-none font-semibold",children:"■ Stop"})]})]}),d.jsx(A1,{activeConv:e,onModalButton:o}),d.jsx("div",{className:"flex-1 min-h-0 p-2 bg-[#0f1117]",children:d.jsx(I1,{ref:r,onInput:h=>{var p;const u=e.ideId||e.daemonId||"",f=(p=e.ideId)!=null&&p.includes(":cli:")?e.ideId.split(":cli:")[1]:e.ideType||e.agentType||"";c!=null&&c(u,{type:"pty_input",cliType:f,data:h})||a(u,"pty_input",{cliType:f,data:h}).catch(console.error)},onResize:(h,u)=>{var m;const f=e.ideId||e.daemonId||"",p=(m=e.ideId)!=null&&m.includes(":cli:")?e.ideId.split(":cli:")[1]:e.ideType||e.agentType||"";c!=null&&c(f,{type:"pty_resize",cliType:p,cols:h,rows:u})||a(f,"pty_resize",{cliType:p,cols:h,rows:u,force:!0}).catch(()=>{})}},e.tabKey)}),d.jsx("div",{className:"px-3 py-2 bg-[var(--surface-primary)] border-t border-border-subtle shrink-0",children:d.jsxs("div",{className:"flex gap-2.5 items-center",children:[d.jsx("div",{className:"flex-1 relative",children:d.jsx("input",{ref:l,type:"text",placeholder:`Send message to ${e.displayPrimary}...`,value:n,onChange:h=>i(h.target.value),onPaste:h=>{const u=h.clipboardData.getData("text");u&&i(f=>f+u),h.preventDefault()},onKeyDown:h=>{if(h.key==="Enter"){if(h.nativeEvent.isComposing){h.preventDefault();return}h.preventDefault(),s()}},className:"w-full h-9 rounded-[18px] px-4 bg-bg-secondary border border-border-subtle text-[13px] text-text-primary"})}),d.jsx("button",{onClick:s,disabled:!n.trim(),className:`w-9 h-9 rounded-full flex items-center justify-center border-none shrink-0 transition-all duration-300 ${n.trim()?"bg-accent cursor-pointer":"bg-bg-secondary cursor-default"}`,children:d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:n.trim()?"text-white":"text-text-muted",children:d.jsx("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"})})})]})})]})}function J4({wsStatus:e,showReconnected:t,loginUrl:r}){const n=e==="disconnected"||e==="reconnecting"||e==="offline"||e==="auth_failed",i=e==="auth_failed"?"red":e==="offline"?"orange":"violet",s={red:"linear-gradient(90deg, rgba(239,68,68,0.12), rgba(239,68,68,0.04))",orange:"linear-gradient(90deg, rgba(255,107,53,0.12), rgba(255,107,53,0.04))",violet:"linear-gradient(90deg, rgba(139,92,246,0.12), rgba(139,92,246,0.04))"},o={red:"1px solid rgba(239,68,68,0.2)",orange:"1px solid rgba(255,107,53,0.2)",violet:"1px solid rgba(139,92,246,0.2)"},l={red:"#ef4444",orange:"#ff6b35",violet:"#a78bfa"};return d.jsxs(d.Fragment,{children:[n&&d.jsxs("div",{className:"py-2.5 px-5 text-[13px] font-semibold flex items-center gap-2.5 justify-center",style:{background:s[i],borderBottom:o[i],color:l[i]},children:[d.jsx("img",{src:"/otter-logo.png",alt:"",className:"w-5 h-5",style:{opacity:e==="auth_failed"?.6:1,animation:e==="auth_failed"?void 0:"pulse 2s ease-in-out infinite",filter:e==="auth_failed"?"grayscale(1)":void 0}}),e==="offline"&&"Network offline — waiting for connection...",e==="disconnected"&&"Reconnecting to server...",e==="reconnecting"&&"Reconnecting to server...",e==="auth_failed"&&(r?d.jsxs(d.Fragment,{children:["Session expired."," ",d.jsx("a",{href:r,className:"text-inherit underline",children:"Log in again"})]}):"Connection failed — please restart the server.")]}),t&&e==="connected"&&d.jsxs("div",{className:"py-2 px-4 text-xs font-semibold flex items-center gap-2 justify-center bg-gradient-to-r from-green-500/[0.12] to-green-500/[0.04] text-green-400 border-b border-green-500/15 animate-[fadeIn_0.3s_ease]",children:[d.jsx("img",{src:"/otter-logo.png",alt:"",className:"w-4 h-4"}),"Connected"]})]})}const nu=e=>(e.ideId||e.tabKey||e.id||"").includes(":cli:"),iu=e=>(e.ideId||e.tabKey||e.id||"").includes(":acp:");function eP({activeConv:e,agentCount:t,wsStatus:r,isConnected:n,onOpenHistory:i}){const s=us(),o=n?"#22c55e":r==="connected"?"#eab308":"#ef4444",l=n?"0 0 4px #22c55e80":r==="connected"?"0 0 4px #eab30880":"0 0 4px #ef444480";return d.jsxs("div",{className:"dashboard-header",children:[d.jsx("div",{className:"flex items-center gap-3",children:d.jsxs("div",{className:"leading-tight",children:[d.jsxs("h1",{className:"header-title m-0 flex items-center gap-1.5",children:[d.jsx(ff,{size:18})," Dashboard",d.jsxs("span",{className:"header-count-mobile text-[10px] font-semibold opacity-60 ml-2 tracking-wide",children:[t," Active",d.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full ml-1 align-middle",style:{background:o}})]})]}),d.jsxs("div",{className:"header-subtitle text-[11px] items-center gap-1",children:[t," agent",t!==1?"s":""," active",d.jsx("span",{title:n?"Connected":r==="connected"?"Partial":"Disconnected",className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{background:o,boxShadow:l}})]})]})}),d.jsxs("div",{className:"flex gap-2 items-center",children:[e&&!nu(e)&&!iu(e)&&d.jsxs("button",{onClick:()=>s(`/ide/${e.ideId}`),className:"btn btn-primary btn-sm border-none px-2.5 py-1.5 flex items-center gap-1 text-xs",title:"IDE View",children:[d.jsx(S3,{size:14})," IDE"]}),e&&!nu(e)&&!iu(e)&&d.jsx("button",{onClick:i,className:"btn btn-secondary btn-sm border-none bg-bg-secondary px-2.5 py-1.5 flex items-center gap-1",title:"Chat History",children:d.jsx(_3,{size:16})}),e&&!nu(e)&&!iu(e)&&d.jsx("button",{onClick:()=>s(`/ide/${e.ideId}?view=remote`),className:"btn btn-secondary btn-sm border-none bg-bg-secondary px-2.5 py-1.5",title:"Remote Control",children:d.jsx(to,{size:16})})]})]})}function Vr(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"IDE"}function tP(e){if(e<60)return`${Math.round(e)}s`;const t=Math.floor(e/60);if(t<60)return`${t}m`;const r=Math.floor(t/60),n=t%60;if(r<24)return n>0?`${r}h ${n}m`:`${r}h`;const i=Math.floor(r/24),s=r%24;return`${i}d ${s}h`}function qg(e){return e<1024*1024*1024?`${(e/(1024*1024)).toFixed(0)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function Yg(e){return(e.id||"").includes(":cli:")}function Xg(e){return(e.id||"").includes(":acp:")}function Xh(e,t){return Vr(e)}function rP(e){if(!Array.isArray(e)||e.length<=1)return e;const t=new Map,r=["generating","streaming","active","connected","idle","panel_hidden"];for(const n of e){const i=(n.name||n.id||"").toLowerCase().replace(/\s+/g,"-"),s=t.get(i);if(!s){t.set(i,n);continue}const o=r.indexOf(s.status||"idle"),l=r.indexOf(n.status||"idle");l>=0&&(o<0||l<o)&&t.set(i,n)}return Array.from(t.values())}function nP({activeConv:e,ides:t,isCreatingChat:r,isRefreshingHistory:n,onClose:i,onNewChat:s,onSwitchSession:o,onRefreshHistory:l}){var u;const a=t.find(f=>f.id===e.ideId),c=(a==null?void 0:a.chats)||[],h=(u=a==null?void 0:a.activeChat)==null?void 0:u.id;return d.jsxs("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center",children:[d.jsx("div",{onClick:i,className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),d.jsxs("div",{className:"card fade-in relative w-[90%] max-w-[500px] max-h-[80vh] flex flex-col p-0 overflow-hidden shadow-[0_20px_40px_rgba(0,0,0,0.4)] rounded-[20px]",children:[d.jsxs("div",{className:"px-6 py-5 border-b border-border-subtle flex justify-between items-center bg-[var(--surface-primary)]",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"m-0 text-lg font-extrabold",children:"Chat History"}),d.jsxs("div",{className:"text-xs text-text-muted mt-0.5",children:[e.displayPrimary," — ",Vr(e.ideType)]})]}),d.jsx("button",{onClick:i,className:"bg-transparent border-none text-xl text-text-muted cursor-pointer",children:"✕"})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto p-3 bg-bg-primary",children:[d.jsx("button",{onClick:s,disabled:r,className:"w-full p-3.5 rounded-xl mb-3 bg-indigo-500/10 border border-dashed border-accent text-accent font-bold text-sm cursor-pointer",children:r?"⌛ Creating...":"+ Start New Chat Session"}),c.map(f=>d.jsxs("div",{onClick:()=>{o(e.ideId,f.id),i()},className:`p-4 rounded-xl mb-2 cursor-pointer border transition-all ${h===f.id?"bg-[var(--bg-glass-hover)] border-accent":"bg-[var(--surface-secondary)] border-border-subtle"}`,children:[d.jsx("div",{className:`font-bold text-sm mb-1 ${h===f.id?"text-[var(--accent-primary-light)]":"text-text-primary"}`,children:f.title||"Untitled Session"}),d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsxs("div",{className:"text-[11px] text-text-muted font-mono",children:[f.id.substring(0,12),"..."]}),h===f.id&&d.jsx("span",{className:"text-[10px] bg-accent text-white px-2 py-0.5 rounded-[10px] font-extrabold",children:"ACTIVE"})]})]},f.id)),c.length===0&&d.jsxs("div",{className:"py-10 px-5 text-center text-text-muted",children:[d.jsx("div",{className:"text-3xl mb-3 opacity-60",children:d.jsx(E3,{size:32})}),d.jsx("div",{className:"text-[13px]",children:"No recent chat sessions found."})]})]}),d.jsx("div",{className:"px-5 py-4 bg-[var(--surface-tertiary)] border-t border-border-subtle text-right",children:d.jsx("button",{onClick:l,disabled:n,className:"btn btn-secondary btn-sm rounded-[10px]",children:n?"⌛ Refreshing...":d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(v3,{size:13})," Refresh History"]})})})]})]})}function iP({sortedConversations:e,activeTabId:t,tabsOverflow:r,tabsContainerRef:n,terminalRef:i,onSelectTab:s,onReorder:o,pinTab:l,clearTabPinTimers:a,retryConnection:c}){const{sendCommand:h}=Si(),u=b.useRef(null),f=b.useRef(null),p=b.useRef(null),m=b.useRef(null),[g,x]=b.useState(!1),_=b.useCallback((F,E)=>{const H=E.touches[0];p.current={x:H.clientX,y:H.clientY},f.current=F,m.current=setTimeout(()=>{x(!0)},400)},[]),v=b.useCallback(F=>{if(!g||!f.current){m.current&&(clearTimeout(m.current),m.current=null);return}F.preventDefault();const E=F.touches[0],H=n.current;if(!H)return;const B=Array.from(H.querySelectorAll("[data-tabkey]"));for(const I of B){const W=I.getBoundingClientRect();if(E.clientX>=W.left&&E.clientX<=W.right){const T=I.getAttribute("data-tabkey");if(T&&T!==f.current){const O=e.map($=>$.tabKey),V=O.indexOf(f.current),P=O.indexOf(T);if(V!==-1&&P!==-1){const $=[...O];$.splice(V,1),$.splice(P,0,f.current),o($)}}break}}},[g,e,n,o]),y=b.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null),x(!1),f.current=null,p.current=null},[]),[N,L]=b.useState(!1),[C,D]=b.useState(!1),z=b.useCallback(()=>{const F=n.current;F&&(L(F.scrollLeft>4),D(F.scrollLeft+F.clientWidth<F.scrollWidth-4))},[n]);return b.useEffect(()=>{const F=n.current;if(!F)return;z(),F.addEventListener("scroll",z,{passive:!0});const E=new ResizeObserver(z);return E.observe(F),()=>{F.removeEventListener("scroll",z),E.disconnect()}},[n,z,e.length]),d.jsxs("div",{className:"relative shrink-0",children:[r&&N&&d.jsx("div",{className:"absolute left-0 top-0 bottom-0 z-[3] w-5 pointer-events-none",style:{background:"linear-gradient(to right, var(--bg-secondary), transparent)"}}),r&&C&&d.jsx("div",{className:"absolute right-0 top-0 bottom-0 z-[3] w-5 pointer-events-none",style:{background:"linear-gradient(to left, var(--bg-secondary), transparent)"}}),d.jsxs("div",{ref:n,className:"dashboard-agent-tabs flex overflow-x-auto overflow-y-visible shrink-0 bg-bg-secondary border-b border-border-subtle pt-1.5 pb-0 gap-1 select-none",onWheel:F=>{const E=n.current;E&&Math.abs(F.deltaY)>Math.abs(F.deltaX)&&(F.preventDefault(),E.scrollLeft+=F.deltaY)},style:{paddingLeft:8,paddingRight:8,scrollbarWidth:"none",WebkitOverflowScrolling:"touch"},children:[e.map((F,E)=>{const H=t===F.tabKey,B=F.status==="working"?"agent-tab-working":F.status==="waiting_approval"?"agent-tab-waiting":"",I=E<9?String(E+1):null,W=F.connectionState==="gave_up";return d.jsxs("div",{"data-tabkey":F.tabKey,className:`${B} shrink-0 px-2.5 py-1.5 rounded-t-lg border-b-0 cursor-grab flex items-center gap-2 transition-all duration-200`,draggable:!0,onDragStart:()=>{u.current=F.tabKey},onDragOver:T=>{T.preventDefault(),T.currentTarget.style.borderLeft="2px solid var(--accent-primary)"},onDragLeave:T=>{T.currentTarget.style.borderLeft=H?"1px solid var(--border-subtle)":"1px solid transparent"},onDrop:T=>{if(T.preventDefault(),T.currentTarget.style.borderLeft=H?"1px solid var(--border-subtle)":"1px solid transparent",!u.current||u.current===F.tabKey)return;const O=e.map(w=>w.tabKey),V=O.indexOf(u.current),P=O.indexOf(F.tabKey);if(V===-1||P===-1)return;const $=[...O];$.splice(V,1),$.splice(P,0,u.current),o($),u.current=null},onDragEnd:()=>{u.current=null},onTouchStart:T=>_(F.tabKey,T),onTouchMove:v,onTouchEnd:y,onClick:()=>{a(),s(F.tabKey),F.streamSource==="agent-stream"&&F.agentType&&(h(F.ideId,"agent_stream_focus",{agentType:F.agentType}).catch(()=>{}),l(F.tabKey,[200,1500])),or(F)&&setTimeout(()=>{var T,O;(O=(T=i.current)==null?void 0:T.bumpResize)==null||O.call(T)},100)},style:{background:H?"var(--bg-primary)":"var(--bg-glass)",borderTop:H?"1px solid var(--border-subtle)":"1px solid transparent",borderLeft:H?"1px solid var(--border-subtle)":"1px solid transparent",borderRight:H?"1px solid var(--border-subtle)":"1px solid transparent",opacity:g&&f.current===F.tabKey?W?.15:.3:W?H?.6:.3:H?1:.65},children:[F.status==="working"?d.jsx("div",{className:"tab-spinner"}):F.status==="waiting_approval"?d.jsx("span",{className:"text-[8px] px-[5px] py-px text-yellow-400",children:"▲"}):F.connectionState==="gave_up"?d.jsx("span",{onClick:T=>{var V;T.stopPropagation();const O=F.daemonId||((V=F.ideId)==null?void 0:V.split(":")[0])||"";c==null||c(O)},title:"Disconnected — click to reconnect",className:"text-[8px] px-[5px] py-px text-yellow-400 cursor-pointer",children:"●"}):F.connectionState==="connecting"?d.jsx("span",{className:"text-[8px] px-[5px] py-px text-blue-400",children:"○"}):F.connectionState==="connected"?d.jsx("span",{className:"text-[8px] px-[5px] py-px text-green-400",children:"●"}):d.jsx("span",{className:"text-[8px] px-[5px] py-px text-text-muted",children:"●"}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:"text-xs font-bold whitespace-nowrap overflow-hidden text-ellipsis",children:F.displayPrimary}),d.jsxs("div",{className:"text-[8px] opacity-50 flex gap-1 items-center",children:[F.displaySecondary,F.machineName&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"opacity-40",children:"·"}),d.jsxs("span",{className:"opacity-70",children:["🖥 ",F.machineName]})]})]})]}),I&&d.jsx("span",{className:"text-[9px] opacity-35 font-mono ml-0.5 shrink-0",children:I})]},F.tabKey)}),e.length===0&&d.jsx("div",{className:"p-2 text-xs opacity-40",children:"No active agents online."})]})]})}const Gg={success:"rgba(16, 185, 129, 0.95)",warning:"rgba(245, 158, 11, 0.95)",info:"rgba(99, 102, 241, 0.95)"};function sP({toasts:e,onDismiss:t,onClickToast:r}){return d.jsx("div",{className:"fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none",children:e.map(n=>d.jsx("div",{className:"fade-in text-white px-5 py-3 rounded-xl text-[13px] font-semibold shadow-[0_8px_32px_rgba(0,0,0,0.3)] backdrop-blur-lg pointer-events-auto cursor-pointer animate-[toast-in_0.3s_ease-out] max-w-[360px]",style:{background:Gg[n.type]||Gg.info},onClick:()=>{r&&r(n),t(n.id)},children:n.message},n.id))})}const oP=e=>(e.id||"").includes(":cli:")||(e.id||"").includes(":acp:")||(e.id||"").includes(":ide:")?!0:e.daemonId!==e.id;function lP(e){var n;const t=(n=e.workspaceFolders)==null?void 0:n[0];return t!=null&&t.name?t.name:((t==null?void 0:t.path)??"").split("/").filter(Boolean).pop()||"Workspace"}function aP(e,t,r,n){var s;const i={};if(r)for(const o of r){const l=o;if(l.type==="adhdev-daemon"||l.daemonMode){const a=l.machine||{},c=l.machineNickname,h=a.hostname||((s=l.system)==null?void 0:s.hostname)||"",u=c||(h&&h!=="Unknown"?h.replace(/\.local$/,""):null)||`Machine ${(l.id||"").substring(0,6)}`;i[l.id]=u}}return e.flatMap(o=>{var x,_,v,y,N;const l=[],a=o.daemonId&&i[o.daemonId]||void 0,c=o.daemonId||((x=o.id)==null?void 0:x.split(":")[0])||o.id,h=n?n[c]||"new":void 0,u=lP(o),f=Vr(o.type),p=o.agentStreams,m=Array.isArray(p)?p:[],g=oP(o);if(g){const L=Xh(o.type),C=(_=o.agents)==null?void 0:_[0],D=(v=o.activeChat)==null?void 0:v.activeModal,z=D&&Array.isArray(D.buttons)&&D.buttons.length>0,F=(y=o.activeChat)==null?void 0:y.status,E=F==="generating"||F==="loading"||F&&F.toLowerCase()==="thinking",B=z||F==="waiting_approval"?"waiting_approval":E?"working":(C==null?void 0:C.status)||"idle",I=o.activeChat||{title:"",messages:[]};let W=I.title&&String(I.title).trim()?String(I.title).trim():"";const T=(N=o.activeChat)==null?void 0:N.id,O=o.chats;if(T&&Array.isArray(O)&&O.length>0){const re=O.find(ce=>ce.id===T||ce.id&&String(ce.id)===String(T));re!=null&&re.title&&String(re.title).trim()&&(W=String(re.title).trim())}const V=I.messages||[],P=t[o.id]||[],$=new Map;V.filter(re=>re.role==="user").forEach(re=>{$.set(re.content,($.get(re.content)||0)+1)});const w=P.filter(re=>{const ce=$.get(re.content)||0;return ce>0?($.set(re.content,ce-1),!1):!0});l.push({ideId:o.id,daemonId:o.daemonId||void 0,agentName:L,agentType:or(o)||Rr(o)?o.type:(C==null?void 0:C.type)||"ide-native",status:B,title:W,messages:[...V,...w],ideType:o.type,workspaceName:u,displayPrimary:W||L||u,displaySecondary:f,cdpconnected:o.cdpconnected,modalButtons:z?D.buttons:void 0,modalMessage:z?D.message:void 0,streamSource:"native",tabKey:o.id,machineName:a,connectionState:h})}if(g&&(or(o)||Rr(o)))return l;for(const L of m){const C=L.activeModal&&Array.isArray(L.activeModal.buttons)&&L.activeModal.buttons.length>0,D=C?"waiting_approval":L.status==="streaming"?"working":L.status,z=`${o.id}:${L.agentType}`,F=L.messages||[],E=t[z]||[],H=new Map;F.filter(I=>I.role==="user").forEach(I=>{H.set(I.content,(H.get(I.content)||0)+1)});const B=E.filter(I=>{const W=H.get(I.content)||0;return W>0?(H.set(I.content,W-1),!1):!0});l.push({ideId:o.id,daemonId:o.daemonId||void 0,agentName:L.agentName,agentType:L.agentType,status:D,title:"",messages:[...F,...B],ideType:o.type,workspaceName:u,displayPrimary:L.agentName,displaySecondary:f,cdpconnected:o.cdpconnected,modalButtons:C?L.activeModal.buttons:void 0,modalMessage:C?L.activeModal.message:void 0,streamSource:"agent-stream",tabKey:z,machineName:a,connectionState:h})}return l.length===0&&l.push({ideId:o.id,daemonId:o.daemonId||void 0,agentName:Xh(o.type),agentType:"ide-native",status:"idle",title:"",messages:[],ideType:o.type,workspaceName:u,displayPrimary:u||f,displaySecondary:f,cdpconnected:o.cdpconnected,streamSource:"native",tabKey:o.id,connectionState:h}),l})}function cP(){return typeof window>"u"?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function Qg(){try{const e=localStorage.getItem("theme");if(e==="dark"||e==="light")return e}catch{}return null}function uP(){const[e,t]=b.useState(()=>Qg()??cP());b.useEffect(()=>{document.documentElement.setAttribute("data-theme",e)},[e]),b.useEffect(()=>{const i=window.matchMedia("(prefers-color-scheme: light)"),s=o=>{Qg()||t(o.matches?"light":"dark")};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[]);const r=b.useCallback(i=>{t(i);try{localStorage.setItem("theme",i)}catch{}},[]),n=b.useCallback(()=>{t(i=>{const s=i==="dark"?"light":"dark";try{localStorage.setItem("theme",s)}catch{}return s})},[]);return{theme:e,setTheme:r,toggleTheme:n,isDark:e==="dark"}}function hP({collapsed:e}){const{isDark:t,toggleTheme:r}=uP();return d.jsxs("div",{className:`nav-item cursor-pointer ${e?"justify-center py-2.5 px-0":""}`,onClick:r,title:t?"Switch to light mode":"Switch to dark mode",children:[d.jsx("span",{className:"nav-icon",children:t?d.jsx(N3,{size:16}):d.jsx(L3,{size:16})}),!e&&d.jsx("span",{className:"text-xs",children:t?"Light mode":"Dark mode"})]})}let dP=M0;function kf(){return dP()}class fP{constructor(){ms(this,"listeners",new Map)}send(t){}isConnected(){return!1}on(t,r){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r),()=>{var n;(n=this.listeners.get(t))==null||n.delete(r)}}emit(t,...r){var n;(n=this.listeners.get(t))==null||n.forEach(i=>i(...r))}}let pP=new fP;class mP{constructor(){ms(this,"ptyCallbacks",new Set)}sendPtyInput(t,r,n){return!1}sendPtyResize(t,r,n,i){return!1}async requestChatHistory(t,r,n,i,s){return{messages:[],hasMore:!1}}retryConnection(t){}getState(t){return"disconnected"}sendData(t,r){return!1}get(t){}onScreenshot(t,r){return()=>{}}onStatusEvent(t){return()=>{}}onPtyOutput(t){return this.ptyCallbacks.add(t),()=>{this.ptyCallbacks.delete(t)}}emitPtyOutput(t,r){this.ptyCallbacks.forEach(n=>n(t,r))}}let ri=new mP,Zg=ri;function gP(){const{sendCommand:e}=Si(),t=kf(),{updateIdeChats:r,screenshotMap:n,setScreenshotMap:i}=t,s=t.ides||[],o=t.toasts||[],l=t.setToasts||(()=>{}),a=t.wsStatus||"connected",c=t.isConnected??!0,h=t.connectionStates||{},u=t.retryConnection,f=t.showReconnected||!1,[p,m]=b.useState(()=>{try{const j=new URLSearchParams(window.location.search).get("activeTab");return j||sessionStorage.getItem("adhdev_dashboard_activeTab")}catch{return null}}),g=b.useCallback(A=>{m(A);try{A?sessionStorage.setItem("adhdev_dashboard_activeTab",A):sessionStorage.removeItem("adhdev_dashboard_activeTab")}catch{}},[]),x=b.useRef([]),[_,v]=b.useState(""),[y,N]=b.useState({}),[L,C]=b.useState(!1),[D,z]=b.useState(!1),[F,E]=b.useState(!1),[H,B]=b.useState([]),[I,W]=b.useState({}),[T,O]=b.useState({}),V=b.useRef(null),P=b.useRef(null),$=b.useRef(null),[w,re]=b.useState(!1),ce=s.find(A=>A.type==="adhdev-daemon"),k=(ce==null?void 0:ce.detectedIdes)||[],me=!!ce,Q=b.useMemo(()=>{var U,Y;const A=s.filter(ee=>ee.type!=="adhdev-daemon"),j=new Map;for(const ee of A){const se=j.get(ee.id);if(!se)j.set(ee.id,ee);else{const ne=(((U=se.workspaceFolders)==null?void 0:U.length)||0)+(se.activeChat?1:0);((((Y=ee.workspaceFolders)==null?void 0:Y.length)||0)+(ee.activeChat?1:0)>ne||(ee.timestamp||0)>(se.timestamp||0))&&j.set(ee.id,ee)}}return Array.from(j.values())},[s]),J=b.useMemo(()=>{const A=aP(Q,I,s,h),j=Date.now();return A.map(U=>{const Y=T[U.tabKey];return Y&&j-Y<5e3?{...U,messages:[],title:""}:U})},[Q,I,T,s]),[X,ae]=b.useState(()=>{try{return JSON.parse(sessionStorage.getItem("adhdev_tabOrder")||"[]")}catch{return[]}}),ue=b.useMemo(()=>{if(X.length===0)return J;const A=new Map(X.map((j,U)=>[j,U]));return[...J].sort((j,U)=>{const Y=A.get(j.tabKey)??9999,ee=A.get(U.tabKey)??9999;return Y-ee})},[J,X]);b.useEffect(()=>{const A=$.current;if(!A)return;const j=()=>re(A.scrollWidth>A.clientWidth+2);j();const U=new ResizeObserver(j);return U.observe(A),A.addEventListener("scroll",j),()=>{U.disconnect(),A.removeEventListener("scroll",j)}},[ue.length]);const ge=b.useCallback(A=>{ae(A);try{sessionStorage.setItem("adhdev_tabOrder",JSON.stringify(A))}catch{}},[]);b.useEffect(()=>{if(Object.keys(T).length===0)return;const j=setTimeout(()=>{O(U=>{const Y=Date.now(),ee={};for(const[se,ne]of Object.entries(U))Y-ne<5e3&&(ee[se]=ne);return Object.keys(ee).length===Object.keys(U).length?U:ee})},5500);return()=>clearTimeout(j)},[T]);const M=ue.find(A=>A.tabKey===p),ke=ue.map(A=>A.tabKey).join(","),Se=b.useRef(!1);b.useEffect(()=>{if(ue.length===0||Se.current&&p&&ue.some(j=>j.tabKey===p))return;const A=ue.find(j=>j.cdpconnected===!0);A?g(A.tabKey):(!p||!ue.some(j=>j.tabKey===p))&&g(ue[0].tabKey)},[ke]);const Ae=b.useCallback(()=>{x.current.forEach(A=>clearTimeout(A)),x.current=[]},[]),Ut=b.useCallback((A,j)=>{Ae();for(const U of j)x.current.push(setTimeout(()=>g(A),U))},[Ae]);b.useEffect(()=>{var U;if(!((U=M==null?void 0:M.messages)!=null&&U.length))return;const A=M.ideId,j=Date.now();N(Y=>{let ee=!1;const se={...Y};return M.messages.forEach((ne,fe)=>{const le=`${A}-${ne.id??`i-${fe}`}`;se[le]==null&&(se[le]=j,ee=!0)}),ee?se:Y})},[M==null?void 0:M.ideId,M==null?void 0:M.messages]);const fr=b.useRef(!1);b.useEffect(()=>{if(!L){fr.current=!1;return}if(!M||fr.current||D)return;const A=s.find(j=>j.id===M.ideId);A&&(!A.chats||A.chats.length===0)&&(fr.current=!0,q())},[L,M==null?void 0:M.ideId]),b.useEffect(()=>{const A=setInterval(()=>{const j=Date.now()-3e5;B(U=>{const Y=U.filter(ee=>ee.timestamp>j).slice(-100);return Y.length===U.length?U:Y})},6e4);return()=>clearInterval(A)},[]);const Jt=b.useRef(new Map);b.useEffect(()=>{const A=(U,Y)=>{var fe,le,ye;if(!Y)return;for(const be of J){if(!or(be))continue;const rt=(fe=be.ideId)!=null&&fe.includes(":cli:")?be.ideId.split(":cli:")[1]:"";if(U===rt||U===be.agentType||U===be.ideType){const At=Jt.current.get(be.tabKey)||[];At.push(Y),At.length>1e4&&At.splice(0,At.length-5e3),Jt.current.set(be.tabKey,At)}}const ee=M&&or(M),se=(le=M==null?void 0:M.ideId)!=null&&le.includes(":cli:")?M.ideId.split(":cli:")[1]:"",ne=U===se||U===(M==null?void 0:M.agentType)||U===(M==null?void 0:M.ideType);ee&&ne&&((ye=V.current)==null||ye.write(Y))},j=Zg.onPtyOutput(A);return()=>{j()}},[M==null?void 0:M.agentType,M==null?void 0:M.ideType,M==null?void 0:M.tabKey,J]),b.useEffect(()=>{if(!M||!or(M))return;const j=setTimeout(()=>{if(V.current){const U=Jt.current.get(M.tabKey);if(U&&U.length>0)for(const Y of U)V.current.write(Y);V.current.bumpResize()}},200);return()=>clearTimeout(j)},[M==null?void 0:M.tabKey]),b.useEffect(()=>{if(!M)return;const A=setTimeout(()=>{var j;(j=P.current)==null||j.focus()},150);return()=>clearTimeout(A)},[M==null?void 0:M.tabKey]),b.useEffect(()=>{const A=j=>{var ne,fe,le,ye,be,Qe;const U=parseInt(j.key);if(isNaN(U)||U<1||U>9)return;if(j.ctrlKey){j.preventDefault();const rt=ue[U-1];rt&&(Ae(),g(rt.tabKey));return}const Y=(ne=document.activeElement)==null?void 0:ne.tagName,ee=Y==="INPUT"||Y==="TEXTAREA"||((fe=document.activeElement)==null?void 0:fe.isContentEditable),se=((ye=(le=document.activeElement)==null?void 0:le.closest)==null?void 0:ye.call(le,".xterm-helper-textarea"))!=null||((Qe=(be=document.activeElement)==null?void 0:be.classList)==null?void 0:Qe.contains("xterm-helper-textarea"));if(!ee&&!se){j.preventDefault();const rt=ue[U-1];rt&&(Ae(),g(rt.tabKey))}};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[ue,Ae,g]),b.useEffect(()=>{const A=pP.on("status_event",j=>{var se;const U=Vr(j.ideType||"");let Y="",ee="info";if(j.event==="agent:generating_completed"){const ne=j.duration?` (${j.duration}s)`:"";Y=`✅ ${U} agent task completed${ne}`,ee="success";try{new Audio("data:audio/wav;base64,UklGRigAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQQAAAB/f39/").play().catch(()=>{})}catch{}if(j.ideId){const fe={role:"system",timestamp:Date.now(),content:`✅ Task completed${ne}`,_localId:`sys_complete_${Date.now()}`};W(le=>{for(const ye of Object.keys(le))if(ye.includes(j.ideId))return{...le,[ye]:[...le[ye]||[],fe]};return le})}}else if(j.event==="agent:generating_started")j.ideId&&W(ne=>{const fe={...ne};for(const le of Object.keys(fe))le.includes(j.ideId)&&(fe[le]=(fe[le]||[]).filter(ye=>{var be;return!(ye.role==="system"&&((be=ye._localId)!=null&&be.startsWith("sys_complete_")))}));return fe});else if((j.event==="agent:waiting_approval"||j.event==="agent:approval_needed")&&(Y=`⚡ ${U} approval needed`,ee="warning",j.ideId)){const ne=j.modalMessage||"Approval requested",fe=(se=j.modalButtons)!=null&&se.length?j.modalButtons.map(ye=>`[${ye}]`).join(" "):"[Approve] [Reject]",le={role:"system",timestamp:Date.now(),content:`⚡ Approval requested: ${ne}
|
|
168
|
+
${fe}`,_localId:`sys_approval_${Date.now()}`};W(ye=>{for(const be of Object.keys(ye))if(be.includes(j.ideId))return{...ye,[be]:[...ye[be]||[],le]};return ye})}if(Y){const ne=Date.now();l(fe=>[...fe.slice(-4),{id:ne,message:Y,type:ee,timestamp:ne,ideId:j.ideId}]),setTimeout(()=>l(fe=>fe.filter(le=>le.id!==ne)),5e3)}});return()=>A()},[]),b.useEffect(()=>{var j;const A=U=>{const Y=U.data;(Y==null?void 0:Y.type)==="notification_action"&&Y.action==="approve"&&Y.ideId&&e(Y.ideId,"resolve_action",{action:"approve",button:"Approve"}).catch(ee=>console.error("[SW Action] approve failed:",ee))};return(j=navigator.serviceWorker)==null||j.addEventListener("message",A),()=>{var U;return(U=navigator.serviceWorker)==null?void 0:U.removeEventListener("message",A)}},[]);const Jr=async()=>{if(!M)return;const A=_.trim();if(!A)return;const j=M.ideId,U=M.tabKey;v(""),Ut(U,[100,500,1500,3e3]);const Y=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ee={role:"user",content:A,timestamp:Date.now(),_localId:Y};W(se=>({...se,[U]:[...se[U]||[],ee]}));try{if(or(M)&&!Rr(M)){const se=j||M.daemonId||"";if(!se)return;const ne=M.ideType||M.agentType||"";await e(se,"agent_command",{agentType:ne,cliType:ne,action:"send_chat",message:A,text:A})}else if(Rr(M)){const se=j||M.daemonId||"";if(!se)return;await e(se,"send_chat",{message:A,text:A,agentType:M.agentType})}else{const se=j||M.daemonId||"";if(!se)return;await e(se,"send_chat",{message:A,text:A,...M.streamSource==="agent-stream"&&{agentType:M.agentType}})}setTimeout(()=>{const se=Date.now()-6e4;W(ne=>{const fe=ne[U];if(!fe)return ne;const le=fe.filter(ye=>ye.timestamp>se);return le.length===fe.length?ne:{...ne,[U]:le}})},6e4)}catch(se){console.error("Send failed",se),v(A),W(ne=>({...ne,[U]:(ne[U]||[]).filter(fe=>fe._localId!==Y)}))}},jr=async()=>{if(M)try{me?await e(M.ideId,"launch_ide",{ideType:M.ideType,enableCdp:!0}):await e(M.ideId,"vscode_command_exec",{commandId:"adhdev.relaunchWithCdp",args:[{force:!0}]})}catch(A){console.error("Relaunch failed",A)}},Or=async A=>{try{await e("standalone","launch_ide",{ideType:A,enableCdp:!0})}catch(j){console.error("Launch failed",j)}},er=async A=>{if(M){console.log("[ModalButton] ideId:",M.ideId,"button:",A,"agentType:",M.agentType,"source:",M.streamSource),B(j=>[...j,{ideId:M.tabKey,text:`🖱️ **${A}** clicked`,timestamp:Date.now()}]);try{let j;if(or(M)&&!Rr(M)){const Y=(M.modalButtons||[]).indexOf(A),ee=A.replace(/[⌥⏎⇧⌫⌘⌃]/g,"").trim().toLowerCase();let se;Y>=0?se=`${Y+1}\r`:/^(deny|no|reject|cancel)/.test(ee)?se="3\r":/always/.test(ee)?se="2\r":se="1\r";const ne=M.daemonId||M.ideId,fe=M.ideType||M.agentType||"";Zg.sendPtyInput(ne,fe,se)||await e(ne,"pty_input",{cliType:fe,data:se}),j={success:!0}}else{const U=A.replace(/[⌥⏎⇧⌫⌘⌃]/g,"").trim().toLowerCase(),Y=/^(run|approve|accept|yes|allow|always|proceed|save)/.test(U),ee=M.ideId||M.daemonId||"";j=await e(ee,"resolve_action",{button:A,action:Y?"approve":"reject",...M.streamSource==="agent-stream"&&{agentType:M.agentType}})}console.log("[ModalButton] result:",j),j.success||B(U=>[...U,{ideId:M.tabKey,text:`⚠️ **${A}** failed — button not found`,timestamp:Date.now()}])}catch(j){console.error("[ModalButton] Error:",j),B(U=>[...U,{ideId:M.tabKey,text:`❌ **${A}** error`,timestamp:Date.now()}])}}},pr=async(A,j)=>{try{const U=A||(M==null?void 0:M.daemonId)||"",Y=await e(U,"switch_chat",{id:j,sessionId:j,...(M==null?void 0:M.streamSource)==="agent-stream"&&{agentType:M==null?void 0:M.agentType}}),ee=Y==null?void 0:Y.result;(Y==null?void 0:Y.success)===!0||ee==="switched"||ee==="switched-by-title"||(ee===!1||ee==="not_found"?l(ne=>[...ne,{id:Date.now(),message:"⚠️ Session tab not found — try refreshing history",type:"warning",timestamp:Date.now()}]):typeof ee=="string"&&ee.startsWith("error:")?l(ne=>[...ne,{id:Date.now(),message:`⚠️ Switch error: ${ee}`,type:"warning",timestamp:Date.now()}]):l(ne=>[...ne,{id:Date.now(),message:"⚠️ Session switch failed",type:"warning",timestamp:Date.now()}]))}catch(U){console.error("Switch failed",U),l(Y=>[...Y,{id:Date.now(),message:`❌ Switch failed: ${U.message||"connection error"}`,type:"warning",timestamp:Date.now()}])}},Pe=async()=>{if(!(!M||F)){E(!0);try{const A=M.ideId||M.daemonId||"";await e(A,"new_chat",{...M.streamSource==="agent-stream"&&{agentType:M.agentType}}),O(j=>({...j,[M.tabKey]:Date.now()})),W(j=>({...j,[M.tabKey]:[]}))}catch(A){console.error("New chat failed",A)}finally{E(!1)}}},[K,pe]=b.useState(!1),R=async()=>{if(!M||K)return;pe(!0);const A=M.tabKey;try{await e(M.ideId,"agent_stream_focus",{agentType:M.agentType}),Ut(A,[200,1500,3e3])}catch(j){console.error("Focus agent failed",j)}finally{pe(!1)}},q=async()=>{var A;if(!(!M||D)){z(!0);try{const j=M.ideId||M.daemonId||"",U=await e(j,"list_chats",{forceExpand:!0,...M.streamSource==="agent-stream"&&{agentType:M.agentType}}),Y=(U==null?void 0:U.chats)||((A=U==null?void 0:U.result)==null?void 0:A.chats);U!=null&&U.success&&Array.isArray(Y)&&r(M.ideId,Y)}catch(j){console.error("Refresh history failed",j)}finally{z(!1)}}};return d.jsxs("div",{className:"page-dashboard flex-1 min-h-0 bg-bg-primary text-text-primary flex flex-col overflow-hidden",children:[d.jsx(J4,{wsStatus:a,showReconnected:f}),d.jsx(eP,{activeConv:M,agentCount:Q.length,wsStatus:a,isConnected:c,onOpenHistory:()=>C(!0)}),d.jsx(iP,{sortedConversations:ue,activeTabId:p,tabsOverflow:w,tabsContainerRef:$,terminalRef:V,onSelectTab:A=>{Se.current=!0,g(A)},onReorder:ge,pinTab:Ut,clearTabPinTimers:Ae,retryConnection:u}),d.jsx("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden relative",children:M?d.jsxs(d.Fragment,{children:[d.jsx(A1,{activeConv:M,onModalButton:er}),d.jsx("div",{className:"desktop-only px-3 pt-1 pb-2",children:!or(M)&&!Rr(M)&&n[M.ideId]?d.jsx(G4,{screenshotUrl:n[M.ideId],mode:"preview",onDismiss:()=>{const A={...n};delete A[M.ideId],i(A)}}):!or(M)&&!Rr(M)&&M.cdpconnected===!1?d.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 py-2 bg-yellow-500/[0.08] border border-yellow-500/20 rounded-lg text-xs text-text-secondary",children:[d.jsx("span",{className:"text-sm",children:d.jsx($y,{size:14})}),d.jsx("span",{className:"flex-1",children:"CDP not connected — chat history & screenshots unavailable for this IDE."}),d.jsx("button",{className:"btn btn-sm bg-yellow-500/15 text-yellow-500 border border-yellow-500/30 text-[10px] whitespace-nowrap shrink-0",onClick:jr,children:"Relaunch with CDP"})]}):null}),or(M)&&!Rr(M)?d.jsx(Z4,{activeConv:M,ptyBuffers:Jt,terminalRef:V,agentInput:_,setAgentInput:v,handleSendChat:Jr,handleModalButton:er}):d.jsx(B1,{activeConv:M,ides:s,agentInput:_,setAgentInput:v,handleSendChat:Jr,handleFocusAgent:R,isFocusingAgent:K,messageReceivedAt:y,actionLogs:H})]}):d.jsxs("div",{className:"empty-dashboard",children:[d.jsx("div",{className:"glow-orb",children:d.jsx("img",{src:"/otter-logo.png",alt:"",className:"w-12 h-12"})}),d.jsxs("div",{className:"text-center",children:[d.jsx("div",{className:"font-bold text-lg mb-1.5",children:"No IDE connected"}),d.jsx("div",{className:"text-[13px] text-text-muted",style:{marginBottom:me&&k.length>0?16:0},children:me?"Launch an IDE with CDP to start monitoring":"Launch your IDE with the ADHDev extension to start"}),me&&k.length>0&&d.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:k.filter(A=>A.running||!0).map(A=>d.jsx("button",{className:"btn btn-sm bg-violet-500/10 border border-violet-500/25 text-violet-400 text-xs font-semibold px-4 py-2 rounded-lg cursor-pointer flex items-center gap-1.5 transition-all",onClick:()=>Or(A.type),onMouseEnter:j=>j.currentTarget.style.background="rgba(139,92,246,0.2)",onMouseLeave:j=>j.currentTarget.style.background="rgba(139,92,246,0.1)",children:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(b3,{size:14})," Launch ",A.name]})},A.type))})]})]})}),L&&M&&d.jsx(nP,{activeConv:M,ides:s,isCreatingChat:F,isRefreshingHistory:D,onClose:()=>C(!1),onNewChat:Pe,onSwitchSession:pr,onRefreshHistory:q}),d.jsx("style",{children:`
|
|
169
|
+
body { overflow: hidden; overscroll - behavior: none; }
|
|
170
|
+
.btn { cursor: pointer; border - radius: 8px; font - weight: 600; font - size: 14px; transition: all 0.2s; }
|
|
171
|
+
.btn - sm { padding: 6px 12px; font - size: 12px; }
|
|
172
|
+
.pulse - amber { animation: pulse - amber 2s infinite ease -in -out; }
|
|
173
|
+
@keyframes pulse - amber {
|
|
174
|
+
0 % { transform: scale(1); box- shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
|
|
175
|
+
}
|
|
176
|
+
70 % { transform: scale(1.1); box- shadow: 0 0 0 10px rgba(245, 158, 11, 0);
|
|
177
|
+
}
|
|
178
|
+
100 % { transform: scale(1); box- shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
|
|
179
|
+
}
|
|
180
|
+
`}),d.jsx(sP,{toasts:o,onDismiss:A=>l(j=>j.filter(U=>U.id!==A)),onClickToast:A=>{if(A.ideId){const j=ue.find(U=>U.ideId===A.ideId||U.tabKey===A.ideId);j&&(Ae(),g(j.tabKey))}}}),d.jsx("style",{children:`
|
|
181
|
+
@keyframes toast -in {
|
|
182
|
+
from { opacity: 0; transform: translateX(40px); }
|
|
183
|
+
to { opacity: 1; transform: translateX(0); }
|
|
184
|
+
}
|
|
185
|
+
`})]})}function _P(e){return e.split(":")[0]||""}function vP({renderHeaderActions:e}={}){var me,Q,J;const{id:t}=N0(),r=us(),n=kf(),i=n.ides||[],s=n.connectionStates||{},{sendCommand:o}=Si(),l=b.useMemo(()=>_P(t||""),[t]),a=b.useMemo(()=>i.find(X=>X.id===t),[i,t]),c=(a==null?void 0:a.type)||void 0,h=c?c.charAt(0).toUpperCase()+c.slice(1):"IDE",u=(a==null?void 0:a.activeChat)||null,f=(a==null?void 0:a.agentStreams)||[],p=n.isConnected??!0,m=s[l]||(p?"connected":"new"),g=b.useMemo(()=>i.find(X=>X.id===l||X.daemonId===l),[i,l]),x=(g==null?void 0:g.machineNickname)||((me=g==null?void 0:g.machine)==null?void 0:me.hostname)||"",_=((J=(Q=a==null?void 0:a.workspaceFolders)==null?void 0:Q[0])==null?void 0:J.name)||"",[v]=cb(),y=typeof window<"u"&&window.innerWidth<=768,N=v.get("view")||(y?"chat":"split"),[L,C]=b.useState(N),[D,z]=b.useState("ide"),[F,E]=b.useState(""),[H,B]=b.useState(!1),[I,W]=b.useState(null),[T,O]=b.useState(null),[V,P]=b.useState([]),$=b.useMemo(()=>{var X,ae;return{ideId:t||"",daemonId:l,agentName:Xh(c||""),agentType:c||"",status:(u==null?void 0:u.status)||"idle",title:(u==null?void 0:u.title)||"",messages:(u==null?void 0:u.messages)||[],ideType:c||"",workspaceName:(a==null?void 0:a.workspaceName)||"",displayPrimary:h,displaySecondary:(a==null?void 0:a.workspaceName)||"",cdpConnected:!0,modalButtons:(X=u==null?void 0:u.activeModal)==null?void 0:X.buttons,modalMessage:(ae=u==null?void 0:u.activeModal)==null?void 0:ae.message,streamSource:"native",tabKey:`ide-${t}`}},[t,l,c,u,a,h]);b.useEffect(()=>l?ri.onScreenshot("ide-page",(ae,ue)=>{if(ae!==l)return;const ge=new FileReader;ge.onload=()=>W(ge.result),ge.readAsDataURL(ue)}):void 0,[l]),b.useEffect(()=>l?ri.onStatusEvent((ae,ue)=>{if(ae!==l)return;let ge="",M="info";if(ue.event==="agent:generating_completed"?(ge=`✅ Task completed${ue.duration?` (${ue.duration}s)`:""}`,M="success"):(ue.event==="agent:waiting_approval"||ue.event==="agent:approval_requested")&&(ge="⚡ Approval needed",M="warning"),ge){const ke=Date.now();P(Ae=>[...Ae.slice(-4),{id:ke,message:ge,type:M}]),setTimeout(()=>P(Ae=>Ae.filter(Ut=>Ut.id!==ke)),M==="warning"?1e4:5e3)}}):void 0,[l]),b.useEffect(()=>{const X=l?ri.get(l):null;!X||!(m==="connected")||(L!=="chat"?X.startScreenshots(c):X.stopScreenshots(c))},[L,m,c,l]);const w=b.useCallback(async(X,ae={})=>{if(!t)throw new Error("No IDE ID");const ue={...ae};if(!ue._targetInstance&&t){const M=t.split(":");M.length>=3&&(M[1]==="ide"||M[1]==="cli")&&(ue._targetInstance=M.slice(2).join(":"),ue._targetType=M[1])}const ge=l?ri.get(l):null;return ge!=null&&ge.hasCommandChannel?await ge.sendCommand(X,ue):ge&&ge.connectionState!=="failed"&&ge.connectionState!=="closed"&&await new Promise(ke=>{const Se=Date.now(),Ae=()=>{if(ge.hasCommandChannel)return ke(!0);if(Date.now()-Se>3e3)return ke(!1);setTimeout(Ae,200)};Ae()})&&ge.hasCommandChannel?await ge.sendCommand(X,ue):await o(t,X,ue)},[t,l]),re=async()=>{const X=F.trim();if(!(!X||!t||H)){E(""),B(!0);try{await w("send_chat",{message:X,waitForResponse:!0})}catch(ae){console.error("[IDE] Send failed:",ae)}finally{B(!1)}}},ce=async X=>{if(t)try{const ae=await o(t,"screenshot",{width:X?Math.min(X,1280):1280});ae!=null&&ae.success&&(ae!=null&&ae.base64)&&O(`data:image/jpeg;base64,${ae.base64}`)}catch(ae){console.error("[IDE] Screenshot failed:",ae)}},k=f.length>0;return t?d.jsxs("div",{className:"ide-page",children:[d.jsxs("header",{className:"ide-header",children:[d.jsxs("div",{className:"ide-header-left",children:[d.jsxs("div",{className:"ide-title",children:[d.jsx("span",{className:"ide-name",children:h}),_&&d.jsx("span",{className:"ide-workspace",children:_}),d.jsx("span",{className:"ide-badge",children:"REMOTE"})]}),d.jsxs("div",{className:"ide-status-pill",children:[d.jsx("span",{className:`ide-dot ${m==="connected"?"online":"connecting"}`}),d.jsx("span",{className:"ide-status-text",children:m==="connected"?"Connected":m==="connecting"?"Connecting":"WS"})]}),x&&d.jsx("span",{className:"ide-machine-label",children:x})]}),d.jsxs("div",{className:"ide-header-right",children:[["chat","split","remote"].map(X=>d.jsx("button",{className:"btn btn-secondary btn-sm",style:{border:L===X?"1px solid var(--accent-primary)":"none",background:L===X?"rgba(99,102,241,0.12)":"var(--bg-secondary)",padding:"6px 10px",color:L===X?"var(--accent-primary)":void 0},onClick:()=>C(X),children:X==="chat"?d.jsx(ff,{size:14}):X==="split"?"⊞":d.jsx(to,{size:14})},X)),e&&e({daemonId:l,ideInstanceId:t||""}),d.jsx("button",{className:"btn btn-primary btn-sm border-none px-3 py-1.5 text-xs",onClick:()=>r("/dashboard"),children:"← Back"})]})]}),d.jsxs("div",{className:"ide-content",children:[d.jsxs("div",{className:`ide-chat-panel ${L==="chat"?"full":""} ${L==="remote"?"hidden":""}`,children:[k&&d.jsxs("div",{className:"ide-chat-tabs",children:[d.jsx("button",{className:`ide-chat-tab ${D==="ide"?"active":""}`,onClick:()=>z("ide"),children:h}),d.jsxs("button",{className:`ide-chat-tab ext ${D==="extensions"?"active":""}`,onClick:()=>z("extensions"),children:["Extensions ",d.jsx("span",{className:"ide-ext-badge",children:f.length})]})]}),D==="extensions"&&k?d.jsx(P3,{ideId:t,agentStreams:f,sendCommand:async(X,ae)=>{try{const ue=l?ri.get(l):null;if(ue&&m==="connected"){await Promise.race([ue.sendCommand(X,ae),new Promise((ge,M)=>setTimeout(()=>M(new Error("connection timeout")),3e3))]);return}}catch{}await o(t,X,ae)}}):d.jsx(B1,{activeConv:$,ides:i,agentInput:F,setAgentInput:E,handleSendChat:re,handleFocusAgent:()=>{},isFocusingAgent:!1,messageReceivedAt:{},actionLogs:[]})]}),d.jsx("div",{className:`ide-remote-panel ${L==="remote"?"full":""} ${L==="chat"?"hidden":""}`,children:d.jsx(X4,{screenshot:T,isCapturing:!1,onRefresh:ce,addLog:()=>{},connState:m,connScreenshot:I,onAction:async(X,ae)=>{const ue=l?ri.get(l):null;if(ue&&m==="connected")try{return await ue.sendInput(X,ae)}catch(ge){console.error("[Connection Input] Failed:",ge)}return await o(t,"cdp_remote_action",{action:X,params:ae})}})})]}),V.length>0&&d.jsx("div",{className:"ide-toasts",children:V.map(X=>d.jsx("div",{className:`ide-toast ${X.type}`,onClick:()=>P(ae=>ae.filter(ue=>ue.id!==X.id)),children:X.message},X.id))})]}):d.jsx("div",{className:"ide-empty",children:"No IDE selected"})}function yP(){var qn,Cf,Ef,Nf,Lf,Tf,Pf,Df,Rf;const{id:e}=N0(),t=us(),{sendCommand:r}=Si(),n=r,i=kf(),s=i.ides||[],o=i.initialLoaded??!0,[l,a]=b.useState([]),[c,h]=b.useState([]),[u,f]=b.useState(0),[p,m]=b.useState(!0),[g,x]=b.useState("debug"),[_,v]=b.useState(null),[y,N]=b.useState([]),[L,C]=b.useState(!1),[D,z]=b.useState(""),[F,E]=b.useState(""),[H,B]=b.useState(""),[I,W]=b.useState(""),[T,O]=b.useState(""),[V,P]=b.useState(""),[$,w]=b.useState(""),[re,ce]=b.useState("overview"),[k,me]=b.useState([]),[Q,J]=b.useState(!1),[X,ae]=b.useState(!1),[ue,ge]=b.useState(""),[M,ke]=b.useState([]),[Se,Ae]=b.useState(!1),[Ut,fr]=b.useState(null),[Jt,Jr]=b.useState("all"),jr=b.useRef(null),Or=b.useRef(!1);b.useEffect(()=>{if(!e||re!=="logs"||!p)return;const S=async()=>{try{const ve=await r(e,"get_logs",{count:200,minLevel:g,since:u}),xe=(ve==null?void 0:ve.result)||ve;if(ve!=null&&ve.success&&Array.isArray(xe==null?void 0:xe.logs)&&xe.logs.length>0){h(Ze=>[...Ze,...xe.logs.map(Ci=>({timestamp:Ci.ts,level:Ci.level,message:`[${Ci.category}] ${Ci.message}`}))].slice(-300));const ze=Math.max(...xe.logs.map(Ze=>Ze.ts));f(ze)}}catch{}};S();const Z=setInterval(S,3e3);return()=>clearInterval(Z)},[e,re,p,u,g]),b.useEffect(()=>{if(p&&c.length>0){const S=Or.current?"smooth":"instant";setTimeout(()=>{var Z;(Z=jr.current)==null||Z.scrollIntoView({behavior:S}),Or.current=!0},50)}},[c.length,l.length,p]),b.useEffect(()=>{re!=="logs"&&(Or.current=!1)},[re]);const er=async()=>{var S;if(e){Ae(!0);try{const Z=await r(e,"get_provider_settings",{}),ve=(Z==null?void 0:Z.result)||Z;if(Z!=null&&Z.success&&(ve!=null&&ve.settings)){const xe=[];for(const[ze,Ze]of Object.entries(ve.settings)){const mt=pe.find(Ci=>Ci.type===ze);xe.push({type:ze,displayName:(mt==null?void 0:mt.displayName)||ze,icon:(mt==null?void 0:mt.icon)||"",category:(mt==null?void 0:mt.category)||"unknown",schema:Ze,values:((S=ve.values)==null?void 0:S[ze])||{}})}xe.sort((ze,Ze)=>ze.category.localeCompare(Ze.category)||ze.displayName.localeCompare(Ze.displayName)),ke(xe)}}catch{}Ae(!1)}};b.useEffect(()=>{re==="providers"&&M.length===0&&er()},[re]);const pr=async(S,Z,ve)=>{fr(`${S}.${Z}`),ke(xe=>xe.map(ze=>ze.type===S?{...ze,values:{...ze.values,[Z]:ve}}:ze));try{const xe=await r(e,"set_provider_setting",{providerType:S,key:Z,value:ve});xe!=null&&xe.success||er()}catch{er()}fr(null)},Pe=s.find(S=>S.id===e&&S.daemonMode),K=Pe?{id:Pe.id,hostname:((qn=Pe.machine)==null?void 0:qn.hostname)||Pe.id,platform:((Cf=Pe.machine)==null?void 0:Cf.platform)||"unknown",arch:((Ef=Pe.machine)==null?void 0:Ef.arch)||"",cpus:((Nf=Pe.machine)==null?void 0:Nf.cpus)||0,totalMem:((Lf=Pe.machine)==null?void 0:Lf.totalMem)||0,freeMem:((Tf=Pe.machine)==null?void 0:Tf.freeMem)||0,loadavg:((Pf=Pe.machine)==null?void 0:Pf.loadavg)||[],uptime:((Df=Pe.machine)==null?void 0:Df.uptime)||0,release:((Rf=Pe.machine)==null?void 0:Rf.release)||"",cdpconnected:Pe.cdpconnected||!1,machineNickname:Pe.machineNickname||null,p2p:Pe.p2p||{available:!1,state:"unavailable",peers:0},detectedIdes:Pe.detectedIdes||[],managedIdeIds:Pe.managedIdeIds||[],managedCliIds:Pe.managedCliIds||[]}:null,pe=(Pe==null?void 0:Pe.availableProviders)||[],R={};for(const S of pe)R[S.type]=S.icon;const q=S=>R[S]||"",A=pe.filter(S=>S.category==="cli"),j=pe.filter(S=>S.category==="acp");b.useEffect(()=>{!H&&A.length>0&&B(A[0].type)},[H,A.length]),b.useEffect(()=>{!I&&j.length>0&&W(j[0].type)},[I,j.length]);const U=s.filter(S=>S.daemonId===e&&!S.daemonMode).filter(S=>!Yg(S)&&!Xg(S)).map(S=>({id:S.id,type:S.type,version:S.version||"",instanceId:S.instanceId||"",status:S.status,workspaceFolders:S.workspaceFolders||[],activeFile:S.activeFile||null,terminals:S.terminals||0,aiAgents:rP(S.aiAgents||S.agents||[]),activeChat:S.activeChat||null,chats:S.chats||[],agentStreams:S.agentStreams||[],cdpconnected:S.cdpconnected||!1,daemonId:e})),Y=s.filter(S=>S.daemonId===e&&Yg(S)).map(S=>{var Z,ve;return{id:S.id,type:S.type,cliName:S.cliName||S.type,status:S.status,workingDir:S.workingDir||((ve=(Z=S.workspaceFolders)==null?void 0:Z[0])==null?void 0:ve.path)||"",activeChat:S.activeChat||null,daemonId:e}}),ee=s.filter(S=>S.daemonId===e&&Xg(S)).map(S=>{var Z,ve;return{id:S.id,type:S.type,acpName:S.cliName||S.type,status:S.status,workingDir:S.workingDir||((ve=(Z=S.workspaceFolders)==null?void 0:Z[0])==null?void 0:ve.path)||"",activeChat:S.activeChat||null,currentModel:S.currentModel,currentPlan:S.currentPlan,daemonId:e}}),se=((K==null?void 0:K.detectedIdes)||[]).filter(S=>!S.running&&!U.some(Z=>(Z.type||"").toLowerCase()===(S.type||"").toLowerCase())),ne=(S,Z)=>{a(ve=>[...ve.slice(-100),{timestamp:Date.now(),level:S,message:Z}]),setTimeout(()=>{var ve;return(ve=jr.current)==null?void 0:ve.scrollIntoView({behavior:"smooth"})},100)},fe=async S=>{if(!(!e||_)){v(S),ne("info",`Launching ${Vr(S)}...`);try{const Z=await r(e,"launch_ide",{ideType:S,enableCdp:!0});ne(Z!=null&&Z.success?"info":"error",Z!=null&&Z.success?`${Vr(S)} launched`:`Failed: ${Z==null?void 0:Z.error}`)}catch(Z){ne("error",`Launch error: ${Z.message}`)}finally{v(null)}}},le=async(S,Z,ve,xe)=>{if(e){ne("info",`Launching ${S}${Z?` in ${Z}`:""}${xe?` (model: ${xe})`:""}...`);try{const ze=ve?ve.split(/\s+/).filter(Boolean):void 0,Ze=await r(e,"launch_cli",{cliType:S,dir:Z||void 0,cliArgs:ze,initialModel:xe||void 0}),mt=(Ze==null?void 0:Ze.result)||Ze;Ze!=null&&Ze.success?(ne("info",`${S} launched`),mt!=null&&mt.defaultedToHome&&ne("info",`📂 No directory specified — running in home directory (${mt.dir||"~"})`)):ne("error",`Failed: ${(Ze==null?void 0:Ze.error)||(mt==null?void 0:mt.error)}`)}catch(ze){ne("error",`Launch error: ${ze.message}`)}}},ye=async(S,Z,ve)=>{if(e&&window.confirm(`Stop ${S}?
|
|
186
|
+
This will terminate the process.`))try{const xe=await r(e,"stop_cli",{cliType:S,dir:Z,_targetInstance:ve});xe!=null&&xe.success?ne("info",`${S} stopped`):ne("error",`Stop failed: ${(xe==null?void 0:xe.error)||"Unknown error"}`)}catch(xe){ne("error",`Stop failed: ${xe.message}`)}},be=async S=>{try{await r(S.id,"restart_session",{ideType:S.type}),ne("info",`${Vr(S.type)} restart initiated`)}catch(Z){ne("error",`Restart failed: ${Z.message}`)}},Qe=async()=>{if(e)try{const S=await r(e,"detect_ides",{});ne("info",`Found ${((S==null?void 0:S.result)||[]).length} IDE(s)`)}catch(S){ne("error",`Detection failed: ${S.message}`)}},rt=async()=>{if(e){C(!0);try{const S=await r(e,"get_recent_workspaces",{});S!=null&&S.success&&Array.isArray(S==null?void 0:S.result)&&N(S.result)}catch(S){ne("error",`Failed: ${S.message}`)}finally{C(!1)}}},tr=async()=>{var S;if(e){J(!0);try{const Z=await n(e,"get_cli_history");Z.success&&((S=Z.result)!=null&&S.history)&&me(Z.result.history)}catch{}J(!1)}},At=async()=>{if(e)try{await n(e,"set_machine_nickname",{nickname:ue}),ne("info",`Nickname set to "${ue||"(cleared)"}"`),ae(!1)}catch(S){ne("error",`Failed: ${S.message}`)}};if(!K)return o?d.jsxs("div",{className:"p-10 text-center text-text-muted",children:[d.jsx("h2",{className:"text-text-primary",children:"Machine not found"}),d.jsx("p",{className:"mt-3",children:"The machine may be offline or not yet connected."}),d.jsx("button",{onClick:()=>t("/machines"),className:"machine-btn-back",children:"← Back to Burrows"})]}):d.jsx("div",{className:"p-10 text-center text-text-muted",children:d.jsx("p",{children:"⏳ Loading machine..."})});const Qa=K.totalMem>0?Math.round((K.totalMem-K.freeMem)/K.totalMem*100):0,Wo=K.loadavg[0]||0,Za=K.machineNickname||K.hostname,Ja=[{id:"overview",label:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(w3,{size:14})," Overview"]})},{id:"ides",label:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(to,{size:14})," IDEs"]}),count:U.length},{id:"clis",label:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(Hy,{size:14})," CLIs"]}),count:Y.length},{id:"acps",label:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(k3,{size:14})," ACP Agents"]}),count:ee.length},{id:"providers",label:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(m3,{size:14})," Providers"]}),count:M.length>0?M.length:void 0},{id:"logs",label:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(p3,{size:14})," Logs"]}),count:l.length>0?l.length:void 0}];return d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsxs("div",{className:"px-6 py-4 border-b border-border-subtle bg-surface-primary",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3.5",children:[d.jsx("button",{onClick:()=>t("/machines"),className:"machine-btn-back",children:"←"}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2",children:[X?d.jsxs("div",{className:"flex gap-1.5 items-center",children:[d.jsx("input",{autoFocus:!0,value:ue,onChange:S=>ge(S.target.value),onKeyDown:S=>{S.key==="Enter"&&At(),S.key==="Escape"&&ae(!1)},placeholder:"Machine nickname...",className:"px-2.5 py-1 rounded-md border border-violet-500/30 bg-bg-secondary text-text-primary text-sm font-semibold w-[200px]"}),d.jsx("button",{onClick:At,className:"machine-btn text-green-500 border-green-500/30",children:"✓"}),d.jsx("button",{onClick:()=>ae(!1),className:"machine-btn",children:"✕"})]}):d.jsx("h1",{className:"text-lg font-bold text-text-primary m-0 cursor-pointer",onClick:()=>{ae(!0),ge(K.machineNickname||"")},title:"Click to set nickname",children:Za}),d.jsx("span",{className:"status-dot-md online"})]}),d.jsxs("div",{className:"text-[11px] text-text-muted mt-0.5 flex gap-2 items-center",children:[d.jsxs("span",{children:[K.platform," · ",K.arch," · ",K.cpus," cores"]}),K.p2p.available&&d.jsxs("span",{className:"px-1.5 py-px rounded text-[9px] font-semibold",style:{background:K.p2p.state==="connected"?"rgba(34,197,94,0.08)":"rgba(234,179,8,0.08)",color:K.p2p.state==="connected"?"#22c55e":"#eab308"},children:["P2P ",K.p2p.state==="connected"?`● ${K.p2p.peers}`:"○"]}),K.cdpconnected&&d.jsx("span",{className:"px-1.5 py-px rounded text-[9px] font-semibold bg-green-500/[0.08] text-green-500",children:"CDP ●"}),K.machineNickname&&d.jsxs("span",{className:"text-text-muted",children:["(",K.hostname,")"]})]})]})]}),d.jsx("button",{onClick:Qe,className:"machine-btn-primary",title:"Re-detect installed IDEs",children:d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx(Xm,{size:14})," Scan IDEs"]})})]}),d.jsx("div",{className:"machine-tabs",children:Ja.map(S=>d.jsxs("button",{onClick:()=>ce(S.id),className:`machine-tab${re===S.id?" active":""}`,children:[S.label,S.count!==void 0&&d.jsx("span",{className:"tab-count",children:S.count})]},S.id))})]}),d.jsxs("div",{className:"page-content",children:[re==="overview"&&d.jsxs("div",{children:[d.jsxs("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(140px,1fr))] gap-2.5 mb-5",children:[d.jsx(Vg,{icon:d.jsx(x3,{size:16}),label:"Uptime",value:tP(K.uptime)}),d.jsx(Vg,{icon:d.jsx(to,{size:16}),label:"IDEs",value:`${U.length}`,sub:`${Y.length} CLIs`})]}),d.jsxs("div",{className:"px-5 py-4 rounded-xl mb-5 bg-bg-secondary border border-border-subtle",children:[d.jsx("div",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider mb-3",children:"Resource Usage"}),d.jsxs("div",{className:"flex gap-6",children:[d.jsx(Kg,{value:Math.min(Math.round(Wo/K.cpus*100),100),max:100,label:"CPU Load",color:"#8b5cf6",detail:`${Wo.toFixed(2)} avg / ${K.cpus} cores`}),d.jsx(Kg,{value:Qa,max:100,label:"Memory",color:"#3b82f6",detail:`${qg(K.totalMem-K.freeMem)} / ${qg(K.totalMem)}`})]})]}),d.jsxs("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] gap-3",children:[d.jsxs("div",{className:"px-5 py-4 rounded-xl bg-bg-secondary border border-border-subtle",children:[d.jsxs("div",{className:"flex justify-between items-center mb-2.5",children:[d.jsx("span",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider",children:"IDEs"}),d.jsx("button",{onClick:()=>ce("ides"),className:"machine-btn text-[10px]",children:"View All →"})]}),U.length===0?d.jsx("div",{className:"text-xs text-text-muted italic",children:"No IDEs running"}):d.jsx("div",{className:"flex flex-col gap-1.5",children:U.map(S=>{var ve,xe,ze;const Z=(S.agentStreams||[]).some(Ze=>Ze.status==="generating"||Ze.status==="streaming")||((ve=S.activeChat)==null?void 0:ve.status)==="generating";return d.jsxs("div",{onClick:()=>t(`/ide/${S.id}`),className:`flex items-center gap-2 px-2.5 py-1.5 rounded-lg cursor-pointer transition-[background] duration-150 ${Z?"bg-orange-500/[0.04] border border-orange-500/10":"bg-white/[0.02] border border-transparent"}`,children:[d.jsx("span",{children:q(S.type)}),d.jsx("span",{className:"text-xs text-slate-200 font-medium",children:Vr(S.type)}),d.jsx("span",{className:"text-[10px] text-text-muted overflow-hidden text-ellipsis whitespace-nowrap",children:((ze=(xe=S.workspaceFolders)==null?void 0:xe[0])==null?void 0:ze.name)||""}),Z&&d.jsx("span",{className:"text-[10px] text-orange-400 font-semibold ml-auto",children:"⚡ Working"}),d.jsx("span",{className:`${Z?"ml-1.5":"ml-auto"} w-1.5 h-1.5 rounded-full`,style:{background:Z?"#fb923c":"#22c55e",boxShadow:Z?"0 0 8px rgba(249,115,22,0.4)":"none",animation:Z?"pulse-dot 1.5s infinite":"none"}})]},S.id)})})]}),d.jsxs("div",{className:"px-5 py-4 rounded-xl bg-bg-secondary border border-border-subtle",children:[d.jsxs("div",{className:"flex justify-between items-center mb-2.5",children:[d.jsx("span",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider",children:"CLIs"}),d.jsx("button",{onClick:()=>ce("clis"),className:"machine-btn text-[10px]",children:"View All →"})]}),Y.length===0?d.jsx("div",{className:"text-xs text-text-muted italic",children:"No CLIs running"}):d.jsx("div",{className:"flex flex-col gap-1.5",children:Y.map(S=>d.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 rounded-lg bg-white/[0.02]",children:[d.jsx("span",{children:q(S.type)}),d.jsx("span",{className:"text-xs text-slate-200 font-medium",children:S.cliName}),d.jsx("span",{className:"text-[10px] text-text-muted overflow-hidden text-ellipsis whitespace-nowrap",children:S.workingDir.split("/").pop()}),d.jsx("span",{className:"ml-auto w-1.5 h-1.5 rounded-full",style:{background:S.status==="stopped"?"#ef4444":"#22c55e"}})]},S.id))})]})]}),K.detectedIdes.length>0&&d.jsxs("div",{className:"mt-4 px-4.5 py-3.5 rounded-xl bg-bg-secondary border border-border-subtle",children:[d.jsx("div",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider mb-2",children:"Detected on this machine"}),d.jsx("div",{className:"flex flex-wrap gap-1.5",children:K.detectedIdes.map(S=>d.jsxs("div",{className:`px-2.5 py-1 rounded-md text-[11px] flex items-center gap-1 ${S.running?"bg-green-500/[0.06] border border-green-500/[0.12] text-green-300":"bg-white/[0.02] border border-white/[0.04] text-text-muted"}`,children:[d.jsx("span",{children:q(S.type)}),S.name||S.type,d.jsx("span",{className:"w-1 h-1 rounded-full",style:{background:S.running?"#22c55e":"#475569"}})]},S.type))})]})]}),re==="ides"&&d.jsxs("div",{children:[d.jsxs("div",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider mb-2.5",children:["Running (",U.length,")"]}),U.length===0?d.jsx("div",{className:"py-10 px-5 text-center rounded-xl bg-bg-secondary border border-dashed border-border-subtle text-text-muted text-[13px] mb-5",children:"No IDEs currently running. Launch one below."}):d.jsx("div",{className:"flex flex-col gap-2.5 mb-5",children:U.map(S=>{var Z,ve;return d.jsxs("div",{className:"px-4.5 py-3.5 rounded-xl bg-bg-secondary border border-border-subtle",children:[d.jsxs("div",{className:"flex justify-between items-center mb-2.5",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-lg",children:q(S.type)}),d.jsx("span",{className:"font-semibold text-sm text-text-primary",children:Vr(S.type)}),S.version&&d.jsxs("span",{className:"text-[10px] text-text-muted",children:["v",S.version]}),d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 shadow-[0_0_6px_rgba(34,197,94,0.3)]"})]}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsxs("button",{onClick:()=>t(`/ide/${S.id}`),className:"machine-btn flex items-center gap-1",children:[d.jsx(to,{size:13})," Control"]}),d.jsx("button",{onClick:()=>be(S),className:"machine-btn text-amber-500 border-amber-500/30",children:"↻ Restart"})]})]}),d.jsxs("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(130px,1fr))] gap-1.5 text-xs text-text-secondary",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-text-muted",children:"Workspace:"})," ",((Z=S.workspaceFolders)==null?void 0:Z.map(xe=>xe.name).join(", "))||"—"]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-text-muted",children:"File:"})," ",((ve=S.activeFile)==null?void 0:ve.split("/").pop())||"—"]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-text-muted",children:"Terminals:"})," ",S.terminals]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-text-muted",children:"CDP:"})," ",S.cdpconnected?"● connected":"○ Off"]})]}),S.aiAgents.length>0&&d.jsx("div",{className:"flex gap-1 mt-2 flex-wrap",children:S.aiAgents.map(xe=>d.jsxs("span",{className:`px-2 py-0.5 rounded-md text-[10px] ${xe.status==="generating"||xe.status==="streaming"?"bg-orange-500/[0.08] text-orange-400":"bg-indigo-500/[0.06] text-indigo-400"}`,children:[xe.name," · ",xe.status]},xe.id))})]},S.id)})}),d.jsxs("div",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider mb-2.5",children:["Available to Launch (",se.length,")"]}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[se.map(S=>d.jsxs("button",{onClick:()=>fe(S.type||S.id||""),disabled:!!_,className:"machine-btn-primary flex items-center gap-1.5",style:{opacity:_&&_!==S.type?.4:1},children:[d.jsx("span",{children:q(S.type)}),_===S.type?"⏳ Launching...":`▶ ${S.name||Vr(S.type)}`]},S.type)),se.length===0&&d.jsxs("div",{className:"text-xs text-text-muted italic",children:["All detected IDEs are running, or none detected.",d.jsxs("button",{onClick:Qe,className:"machine-btn ml-2 flex items-center gap-1",children:[d.jsx(Xm,{size:12})," Scan"]})]})]})]}),re==="clis"&&d.jsxs("div",{children:[d.jsxs("div",{className:"px-5 py-4 rounded-xl mb-5 bg-bg-secondary border border-violet-500/[0.12]",children:[d.jsx("div",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider mb-2.5",children:"Launch New CLI"}),d.jsxs("div",{className:"flex gap-2 items-center flex-wrap",children:[d.jsx("select",{value:H,onChange:S=>B(S.target.value),className:"machine-input",children:A.length>0?A.map(S=>d.jsxs("option",{value:S.type,children:[S.icon," ",S.displayName]},S.type)):d.jsx("option",{value:"",disabled:!0,children:"No CLI providers available"})}),d.jsx("input",{type:"text",placeholder:"Working directory...",value:D,onChange:S=>z(S.target.value),className:"machine-input flex-1 min-w-[200px]"}),d.jsx("input",{type:"text",placeholder:"Args (optional)",value:F,onChange:S=>E(S.target.value),className:"machine-input min-w-[150px]"}),d.jsx("button",{onClick:()=>le(H,D,F||void 0),className:"machine-btn-primary",children:"▶ Launch"})]})]}),d.jsxs("div",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider mb-2.5",children:["Running (",Y.length,")"]}),Y.length===0?d.jsx("div",{className:"py-7.5 px-5 text-center rounded-xl bg-bg-secondary border border-dashed border-border-subtle text-text-muted text-[13px] mb-5",children:"No CLIs running"}):d.jsx("div",{className:"flex flex-col gap-2 mb-5",children:Y.map(S=>d.jsxs("div",{className:"px-4 py-3 rounded-[10px] bg-bg-secondary border border-border-subtle flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2.5",children:[d.jsx("span",{className:"text-lg",children:q(S.type)}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold text-[13px] text-text-primary",children:S.cliName}),d.jsx("div",{className:"text-[11px] text-text-muted",children:S.workingDir})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`px-2 py-0.5 rounded-md text-[10px] font-semibold ${S.status==="stopped"?"bg-red-500/[0.08] text-red-500":"bg-green-500/[0.08] text-green-500"}`,children:S.status}),S.status==="stopped"?d.jsx("button",{onClick:()=>le(S.type,S.workingDir),className:"machine-btn text-green-500 border-green-500/30",children:"▶"}):d.jsx("button",{onClick:()=>ye(S.type,S.workingDir,S.id),className:"machine-btn text-red-500 border-red-500/30",children:"■"})]})]},S.id))}),d.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[d.jsx("span",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider",children:"History"}),d.jsx("button",{onClick:tr,disabled:Q,className:"machine-btn",children:Q?"⏳":"↻ Load"})]}),k.length>0&&d.jsx("div",{className:"flex flex-col gap-1 max-h-[200px] overflow-y-auto",children:k.map((S,Z)=>{var ve,xe;return d.jsxs("div",{onClick:()=>{B(S.cliType),z(S.dir),E((S.cliArgs||[]).join(" "))},className:"flex justify-between items-center px-2.5 py-1.5 rounded-md cursor-pointer bg-white/[0.02] border border-white/[0.04] text-xs transition-[background] duration-150",onMouseEnter:ze=>ze.currentTarget.style.background="rgba(255,255,255,0.06)",onMouseLeave:ze=>ze.currentTarget.style.background="rgba(255,255,255,0.02)",children:[d.jsxs("div",{className:"flex gap-1.5 items-center text-text-secondary",children:[d.jsx("span",{children:q(S.cliType)}),d.jsx("span",{children:((ve=S.dir)==null?void 0:ve.split("/").filter(Boolean).pop())||"root"}),((xe=S.cliArgs)==null?void 0:xe.length)>0&&d.jsx("span",{className:"text-text-muted text-[10px]",children:S.cliArgs.join(" ")})]}),d.jsx("span",{className:"text-text-muted text-[10px]",children:S.timestamp?new Date(S.timestamp).toLocaleDateString():""})]},Z)})}),d.jsxs("div",{className:"mt-5",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[d.jsx("span",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider",children:"Recent Workspaces"}),d.jsx("button",{onClick:rt,disabled:L,className:"machine-btn",children:L?"⏳":"↻ Load"})]}),y.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.map((S,Z)=>d.jsx("button",{onClick:()=>z(S),className:"machine-btn max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap",title:S,children:d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(ma,{size:12})," ",S.split("/").filter(Boolean).pop()||S]})},Z))})]})]}),re==="acps"&&d.jsxs("div",{children:[d.jsxs("div",{className:"px-5 py-4 rounded-xl mb-5 bg-bg-secondary border border-emerald-500/[0.12]",children:[d.jsx("div",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider mb-2.5",children:"Launch ACP Agent"}),d.jsxs("div",{className:"flex gap-2 items-center flex-wrap",children:[d.jsx("select",{value:I,onChange:S=>W(S.target.value),className:"machine-input",children:j.length>0?j.map(S=>d.jsxs("option",{value:S.type,children:[S.icon," ",S.displayName]},S.type)):d.jsx("option",{value:"",disabled:!0,children:"No ACP providers available"})}),d.jsx("input",{type:"text",placeholder:"Working directory...",value:T,onChange:S=>O(S.target.value),className:"machine-input flex-1 min-w-[200px]"}),d.jsx("input",{type:"text",placeholder:"Model (default)",value:V,onChange:S=>P(S.target.value),className:"machine-input min-w-[120px]"}),d.jsx("input",{type:"text",placeholder:"Args (optional)",value:$,onChange:S=>w(S.target.value),className:"machine-input min-w-[120px]"}),d.jsx("button",{onClick:()=>le(I,T,$||void 0,V||void 0),className:"machine-btn-primary",children:"▶ Launch"})]})]}),d.jsxs("div",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider mb-2.5",children:["Running (",ee.length,")"]}),ee.length===0?d.jsx("div",{className:"py-7.5 px-5 text-center rounded-xl bg-bg-secondary border border-dashed border-border-subtle text-text-muted text-[13px] mb-5",children:"No ACP agents running"}):d.jsx("div",{className:"flex flex-col gap-2 mb-5",children:ee.map(S=>d.jsxs("div",{className:"px-4 py-3 rounded-[10px] bg-bg-secondary border border-border-subtle flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2.5",children:[d.jsx("span",{className:"text-lg",children:q(S.type)}),d.jsxs("div",{children:[d.jsx("div",{className:"font-semibold text-[13px] text-text-primary",children:S.acpName}),d.jsxs("div",{className:"text-[11px] text-text-muted flex gap-2",children:[d.jsx("span",{children:S.workingDir}),S.currentModel&&d.jsxs("span",{className:"text-cyan-500",children:["🤖 ",S.currentModel]}),S.currentPlan&&d.jsxs("span",{className:"text-amber-500",children:["📋 ",S.currentPlan]})]})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:`px-2 py-0.5 rounded-md text-[10px] font-semibold ${S.status==="stopped"?"bg-red-500/[0.08] text-red-500":S.status==="generating"?"bg-orange-500/[0.08] text-orange-400":"bg-green-500/[0.08] text-green-500"}`,children:S.status}),d.jsx("button",{onClick:()=>t(`/ide/${S.id}`),className:"machine-btn",title:"View chat",children:d.jsx(ff,{size:14})}),S.status==="stopped"?d.jsx("button",{onClick:()=>le(S.type,S.workingDir),className:"machine-btn text-green-500 border-green-500/30",children:"▶"}):d.jsx("button",{onClick:()=>ye(S.type,S.workingDir,S.id),className:"machine-btn text-red-500 border-red-500/30",children:"■"})]})]},S.id))}),d.jsxs("div",{className:"mt-5",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[d.jsx("span",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider",children:"Recent Workspaces"}),d.jsx("button",{onClick:rt,disabled:L,className:"machine-btn",children:L?"⏳":"↻ Load"})]}),y.length>0&&d.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.map((S,Z)=>d.jsx("button",{onClick:()=>O(S),className:"machine-btn max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap",title:S,children:d.jsxs("span",{className:"flex items-center gap-1",children:[d.jsx(ma,{size:12})," ",S.split("/").filter(Boolean).pop()||S]})},Z))})]})]}),re==="providers"&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex justify-between items-center mb-4",children:[d.jsxs("div",{className:"flex gap-1 items-center",children:[d.jsx("span",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider mr-2",children:"Filter"}),["all","acp","cli","ide","extension"].map(S=>d.jsx("button",{onClick:()=>Jr(S),className:`machine-btn text-[10px] px-2 py-0.5 ${Jt===S?"bg-violet-500/15 border-violet-500/40 text-violet-400":""}`,children:S.toUpperCase()},S))]}),d.jsx("button",{onClick:er,disabled:Se,className:"machine-btn",children:Se?"⏳ Loading...":"↻ Refresh"})]}),Se&&M.length===0?d.jsx("div",{className:"p-10 text-center text-text-muted",children:"Loading provider settings..."}):d.jsx("div",{className:"flex flex-col gap-2",children:M.filter(S=>Jt==="all"||S.category===Jt).map(S=>d.jsxs("div",{className:"px-4.5 py-3.5 rounded-xl bg-bg-secondary border border-border-subtle",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[d.jsx("span",{className:"text-lg",children:S.icon}),d.jsx("span",{className:"font-semibold text-[13px] text-text-primary",children:S.displayName}),d.jsx("span",{className:"px-1.5 py-px rounded text-[9px] font-semibold",style:{background:S.category==="acp"?"rgba(139,92,246,0.08)":S.category==="cli"?"rgba(59,130,246,0.08)":S.category==="ide"?"rgba(34,197,94,0.08)":"rgba(245,158,11,0.08)",color:S.category==="acp"?"#a78bfa":S.category==="cli"?"#60a5fa":S.category==="ide"?"#86efac":"#fbbf24"},children:S.category})]}),d.jsx("div",{className:"flex flex-col gap-2",children:S.schema.map(Z=>d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"text-xs font-medium text-slate-200",children:[Z.label||Z.key,Ut===`${S.type}.${Z.key}`&&d.jsx("span",{className:"ml-1.5 text-[9px] text-violet-500",children:"saving..."})]}),Z.description&&d.jsx("div",{className:"text-[10px] text-text-muted mt-px",children:Z.description})]}),d.jsx("div",{className:"shrink-0",children:Z.type==="boolean"?d.jsx("button",{onClick:()=>pr(S.type,Z.key,!(S.values[Z.key]??Z.default)),className:"w-10 h-[22px] rounded-[11px] border-none relative cursor-pointer transition-colors duration-200",style:{background:S.values[Z.key]??Z.default?"#8b5cf6":"rgba(255,255,255,0.08)"},children:d.jsx("div",{className:"w-4 h-4 rounded-full bg-white absolute top-[3px] transition-[left] duration-200 shadow-[0_1px_3px_rgba(0,0,0,0.3)]",style:{left:S.values[Z.key]??Z.default?21:3}})}):Z.type==="number"?d.jsx("input",{type:"number",value:S.values[Z.key]??Z.default??0,min:Z.min,max:Z.max,onChange:ve=>{const xe=parseInt(ve.target.value)||0;Z.min!==void 0&&xe<Z.min||Z.max!==void 0&&xe>Z.max||pr(S.type,Z.key,xe)},className:"machine-input w-20 text-center text-[11px]"}):Z.type==="select"&&Z.options?d.jsx("select",{value:S.values[Z.key]??Z.default??"",onChange:ve=>pr(S.type,Z.key,ve.target.value),className:"machine-input text-[11px]",children:Z.options.map(ve=>d.jsx("option",{value:ve,children:ve},ve))}):d.jsx("input",{type:"text",value:S.values[Z.key]??Z.default??"",onBlur:ve=>pr(S.type,Z.key,ve.target.value),className:"machine-input w-[120px] text-[11px]"})})]},Z.key))})]},S.type))})]}),re==="logs"&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex justify-between items-center mb-3",children:[d.jsxs("div",{className:"flex gap-1 items-center",children:[d.jsx("span",{className:"text-[11px] text-text-muted font-semibold uppercase tracking-wider mr-2",children:"Level"}),["debug","info","warn","error"].map(S=>d.jsx("button",{onClick:()=>{x(S),h([]),f(0)},className:`machine-btn text-[10px] px-2 py-0.5 ${g===S?"bg-violet-500/15 border-violet-500/40 text-violet-400":""}`,children:S.toUpperCase()},S))]}),d.jsxs("div",{className:"flex gap-1.5 items-center",children:[d.jsxs("span",{className:"text-[10px] text-text-muted",children:[c.length," entries"]}),d.jsx("button",{onClick:()=>m(!p),className:`machine-btn ${p?"text-green-500 border-green-500/30":""}`,children:p?"⏸ Pause":"▶ Resume"}),d.jsx("button",{onClick:()=>{h([]),f(0)},className:"machine-btn",children:"Clear"})]})]}),d.jsxs("div",{className:"bg-bg-secondary border border-border-subtle rounded-xl p-3 min-h-[200px] max-h-[500px] overflow-y-auto font-mono text-[11px] leading-relaxed",children:[c.length===0&&d.jsx("div",{className:"p-10 text-center text-text-muted",children:"Loading daemon logs..."}),c.map((S,Z)=>d.jsxs("div",{className:"flex gap-2 py-px",style:{color:S.level==="error"?"#ef4444":S.level==="warn"?"#f59e0b":S.level==="debug"?"#64748b":"#94a3b8"},children:[d.jsx("span",{className:"text-text-muted min-w-[75px] shrink-0",children:new Date(S.timestamp).toLocaleTimeString()}),d.jsx("span",{className:"font-semibold min-w-[32px] shrink-0 text-[9px]",style:{color:S.level==="error"?"#ef4444":S.level==="warn"?"#f59e0b":S.level==="debug"?"#475569":"#8b5cf6"},children:S.level==="error"?"ERR":S.level==="warn"?"WRN":S.level==="debug"?"DBG":"INF"}),d.jsx("span",{children:S.message})]},Z)),d.jsx("div",{ref:jr})]})]})]})]})}function xP(){if(typeof window>"u")return"ws://localhost:3847/ws";const t=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/ws`,n=new URLSearchParams(window.location.search).get("token");return n?`${t}?token=${encodeURIComponent(n)}`:t}const Jg=xP(),e_=3e3,wP=3e4;let nn=null,SP=0;const Sa=new Map,Gh=new Set;let Ms=null;async function zl(e,t,r){const n=nn;if(n&&n.readyState===WebSocket.OPEN){const s=`req_${++SP}_${Date.now()}`;return new Promise((o,l)=>{const a=setTimeout(()=>{Sa.delete(s),l(new Error(`WS command timeout: ${t}`))},3e4);Sa.set(s,{resolve:c=>{clearTimeout(a),o(c)},reject:c=>{clearTimeout(a),l(c)}}),n.send(JSON.stringify({type:"command",requestId:s,data:{type:t,payload:r||{},target:e}}))})}const i=await fetch("/api/v1/command",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:t,payload:r||{},target:e})});if(!i.ok)throw new Error(`HTTP ${i.status}`);return i.json()}class bP{constructor(t){ms(this,"daemonId");ms(this,"screenshotIdeType",null);this.daemonId=t}get hasCommandChannel(){return(nn==null?void 0:nn.readyState)===WebSocket.OPEN}get connectionState(){return(nn==null?void 0:nn.readyState)===WebSocket.OPEN?"connected":"disconnected"}async sendCommand(t,r){return zl(this.daemonId,t,r)}async sendInput(t,r){return zl(this.daemonId,"cdp_remote_action",{action:t,params:r})}startScreenshots(t){if(this.screenshotIdeType=t||null,Ms)return;const r=async()=>{if(this.hasCommandChannel)try{const n=await zl(this.daemonId,"screenshot",{width:1280});if(n!=null&&n.success&&(n!=null&&n.base64)){const i=await fetch(`data:image/jpeg;base64,${n.base64}`).then(s=>s.blob());Gh.forEach(s=>s(this.daemonId,i))}}catch{}};r(),Ms=setInterval(r,2e3)}stopScreenshots(t){Ms&&(clearInterval(Ms),Ms=null)}}let Gn=null;function kP(e){(!Gn||Gn.daemonId!==e)&&(Gn=new bP(e));try{const{connectionManager:t}=require("@adhdev/web-core"),r=t.get.bind(t);t.get=n=>n===e?Gn:r(n),t.getState=n=>n===e&&(Gn==null?void 0:Gn.connectionState)||"disconnected",t.onScreenshot=n=>(Gh.add(n),()=>{Gh.delete(n)})}catch{}}function CP({children:e}){const t=b.useRef(Qp()),r=Qp();t.current=r;const[,n]=b.useState("disconnected"),i=b.useRef(null),s=b.useRef(),o=b.useRef(e_),l=b.useRef(!0);return b.useEffect(()=>{l.current=!0;function a(){var u,f;if(!l.current||((u=i.current)==null?void 0:u.readyState)===WebSocket.OPEN||((f=i.current)==null?void 0:f.readyState)===WebSocket.CONNECTING)return;n("connecting"),console.log(`[Standalone WS] Connecting to ${Jg}...`);let h;try{h=new WebSocket(Jg)}catch(p){console.error("[Standalone WS] Failed to create WebSocket:",p),c();return}i.current=h,h.onopen=()=>{if(!l.current){h.close();return}n("connected"),o.current=e_,console.log("[Standalone WS] Connected")},nn=h,h.onmessage=p=>{var m;try{const g=JSON.parse(p.data);if((g.type==="command_result"||g.type==="error")&&g.requestId){const x=Sa.get(g.requestId);x&&(Sa.delete(g.requestId),g.type==="error"?x.reject(new Error(((m=g.data)==null?void 0:m.message)||"Command failed")):x.resolve(g.data));return}if(g.type==="status"||g.type==="initial_state"){const x=g.data;if(!x)return;const{injectEntries:_,markLoaded:v}=t.current,y=[],N=x.id||"standalone";kP(N),y.push({id:N,type:"adhdev-daemon",status:"online",daemonMode:!0,machine:{hostname:x.hostname,platform:x.platform,...x.system||{}},system:x.system||null,timestamp:x.timestamp,cdpConnected:x.cdpConnected,detectedIdes:x.detectedIdes||[],availableProviders:x.availableProviders||[],managedIdeIds:(x.ides||[]).map(L=>L.id),managedCliIds:(x.clis||[]).map(L=>L.id)});for(const L of x.ides||[])y.push({...L,daemonId:x.id||"standalone",status:L.cdpConnected?"online":"detected"});for(const L of x.clis||[])y.push({...L,daemonId:x.id||"standalone",status:L.isRunning?"running":"stopped"});y.length>0&&_(y),v()}}catch(g){console.error("[Standalone WS] Parse error:",g)}},h.onclose=()=>{l.current&&(n("disconnected"),i.current=null,c())},h.onerror=p=>{console.warn("[Standalone WS] Error, will reconnect:",p)}}function c(){if(!l.current)return;clearTimeout(s.current);const h=o.current;console.log(`[Standalone WS] Reconnecting in ${h}ms...`),s.current=setTimeout(()=>{o.current=Math.min(o.current*1.5,wP),a()},h)}return a(),()=>{l.current=!1,clearTimeout(s.current),i.current&&(i.current.onclose=null,i.current.close(),i.current=null,nn=null)}},[]),d.jsx(d.Fragment,{children:e})}function EP({children:e}){return d.jsx(hb,{children:d.jsx(CP,{children:e})})}const NP=[{id:"dashboard",path:"/dashboard",icon:d.jsx(d3,{}),label:"Dashboard"},{id:"machine",path:"/machine",icon:d.jsx(f3,{}),label:"Burrow"}];function LP({children:e}){const t=us(),r=Ao(),[n,i]=b.useState(!1),[s,o]=b.useState(()=>{try{return localStorage.getItem("sidebar-collapsed")==="1"}catch{return!1}}),l=h=>{t(h),i(!1)},a=()=>{o(h=>{const u=!h;try{localStorage.setItem("sidebar-collapsed",u?"1":"0")}catch{}return u})},c=h=>`nav-item${r.pathname===h?" active":""} cursor-pointer ${s?"justify-center py-2.5 px-0":""}`;return d.jsxs("div",{className:`app-layout${n?" mobile-menu-open":""}${s?" sidebar-collapsed":""}`,children:[d.jsxs("button",{type:"button",className:"mobile-menu-btn","aria-label":"Open menu",onClick:()=>i(!0),children:[d.jsx("span",{className:"mobile-menu-icon"}),d.jsx("span",{className:"mobile-menu-icon"}),d.jsx("span",{className:"mobile-menu-icon"})]}),n&&d.jsx("div",{className:"sidebar-overlay",role:"button",tabIndex:0,"aria-label":"Close menu",onClick:()=>i(!1),onKeyDown:h=>h.key==="Escape"&&i(!1)}),d.jsxs("aside",{className:`sidebar ${n?"sidebar-open":""}`,children:[d.jsxs("div",{className:"sidebar-header",children:[d.jsxs("div",{className:`sidebar-logo ${s?"justify-center gap-0":""}`,children:[d.jsx("img",{src:"/otter-logo.png",alt:"ADHDev",className:"w-7 h-7"}),!s&&d.jsx("span",{children:"ADHDev"})]}),d.jsx("button",{type:"button",className:"sidebar-close-btn","aria-label":"Close menu",onClick:()=>i(!1),children:"✕"})]}),d.jsx("nav",{className:"sidebar-nav",children:NP.map(h=>d.jsxs("div",{className:c(h.path),id:`nav-${h.id}`,onClick:()=>l(h.path),title:s?h.label:void 0,children:[d.jsx("span",{className:"nav-icon",children:h.icon}),!s&&h.label]},h.id))}),d.jsxs("div",{className:"border-t border-border-subtle pt-4 mt-2",children:[!s&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"nav-item cursor-pointer",id:"nav-about",onClick:()=>t("/about"),children:[d.jsx("span",{className:"nav-icon",children:d.jsx(g3,{})}),"About"]}),d.jsxs("div",{className:"px-3 py-2 text-xs text-text-muted",children:["Selfhost v","0.5.3"]})]}),d.jsx(hP,{collapsed:s}),d.jsxs("div",{className:`nav-item cursor-pointer ${s?"justify-center py-2.5 px-0":"mt-1"}`,onClick:a,title:s?"Expand sidebar":"Collapse sidebar",children:[d.jsx("span",{className:"nav-icon text-base",children:s?"›":"‹"}),!s&&d.jsx("span",{className:"text-xs",children:"Collapse"})]})]})]}),d.jsx("main",{className:"main-content relative",children:d.jsx("div",{className:"main-content-inner",children:e})})]})}function t_(){const{ides:e}=M0(),t=e.find(r=>{var n;return r.daemonMode||((n=r.id)==null?void 0:n.startsWith("standalone"))});return t?d.jsx(Tl,{to:`/machines/${t.id}`,replace:!0}):e.length>0?d.jsx(Tl,{to:`/machines/${e[0].id}`,replace:!0}):d.jsx(Tl,{to:"/dashboard",replace:!0})}function TP(){return d.jsx(ab,{children:d.jsx(EP,{children:d.jsx(mb,{value:{sendCommand:zl,sendData:()=>!1},children:d.jsx(LP,{children:d.jsxs(ib,{children:[d.jsx(Jn,{path:"/dashboard",element:d.jsx(gP,{})}),d.jsx(Jn,{path:"/ide/:id",element:d.jsx(vP,{})}),d.jsx(Jn,{path:"/machine",element:d.jsx(t_,{})}),d.jsx(Jn,{path:"/machines/:id",element:d.jsx(yP,{})}),d.jsx(Jn,{path:"/machines",element:d.jsx(t_,{})}),d.jsx(Jn,{path:"*",element:d.jsx(Tl,{to:"/dashboard",replace:!0})})]})})})})})}_0(document.getElementById("root")).render(d.jsx(b.StrictMode,{children:d.jsx(TP,{})}));
|