@stilero/bankan 1.0.18 → 1.0.20
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/client/dist/assets/{index-CHxyLFN_.js → index-loJ8KKB-.js} +15 -15
- package/client/dist/index.html +1 -1
- package/package.json +1 -1
- package/server/src/config.js +26 -0
- package/server/src/config.test.js +41 -2
- package/server/src/orchestrator.js +3 -3
- package/server/src/orchestrator.test.js +79 -6
- package/server/src/workflow.js +1 -0
- package/server/src/workflow.test.js +7 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const f of a)if(f.type==="childList")for(const C of f.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&i(C)}).observe(document,{childList:!0,subtree:!0});function r(a){const f={};return a.integrity&&(f.integrity=a.integrity),a.referrerPolicy&&(f.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?f.credentials="include":a.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(a){if(a.ep)return;a.ep=!0;const f=r(a);fetch(a.href,f)}})();var
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const f of a)if(f.type==="childList")for(const C of f.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&i(C)}).observe(document,{childList:!0,subtree:!0});function r(a){const f={};return a.integrity&&(f.integrity=a.integrity),a.referrerPolicy&&(f.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?f.credentials="include":a.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(a){if(a.ep)return;a.ep=!0;const f=r(a);fetch(a.href,f)}})();var xa={exports:{}},Ls={},ka={exports:{}},te={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var wi=Symbol.for("react.element"),
|
|
9
|
+
*/var wi=Symbol.for("react.element"),zu=Symbol.for("react.portal"),Wu=Symbol.for("react.fragment"),Uu=Symbol.for("react.strict_mode"),$u=Symbol.for("react.profiler"),Ku=Symbol.for("react.provider"),Vu=Symbol.for("react.context"),Gu=Symbol.for("react.forward_ref"),qu=Symbol.for("react.suspense"),Yu=Symbol.for("react.memo"),Xu=Symbol.for("react.lazy"),ul=Symbol.iterator;function Qu(e){return e===null||typeof e!="object"?null:(e=ul&&e[ul]||e["@@iterator"],typeof e=="function"?e:null)}var ba={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ea=Object.assign,Ra={};function Dr(e,t,r){this.props=e,this.context=t,this.refs=Ra,this.updater=r||ba}Dr.prototype.isReactComponent={};Dr.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")};Dr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function La(){}La.prototype=Dr.prototype;function vo(e,t,r){this.props=e,this.context=t,this.refs=Ra,this.updater=r||ba}var go=vo.prototype=new La;go.constructor=vo;Ea(go,Dr.prototype);go.isPureReactComponent=!0;var hl=Array.isArray,Da=Object.prototype.hasOwnProperty,mo={current:null},Ta={key:!0,ref:!0,__self:!0,__source:!0};function Aa(e,t,r){var i,a={},f=null,C=null;if(t!=null)for(i in t.ref!==void 0&&(C=t.ref),t.key!==void 0&&(f=""+t.key),t)Da.call(t,i)&&!Ta.hasOwnProperty(i)&&(a[i]=t[i]);var o=arguments.length-2;if(o===1)a.children=r;else if(1<o){for(var c=Array(o),d=0;d<o;d++)c[d]=arguments[d+2];a.children=c}if(e&&e.defaultProps)for(i in o=e.defaultProps,o)a[i]===void 0&&(a[i]=o[i]);return{$$typeof:wi,type:e,key:f,ref:C,props:a,_owner:mo.current}}function Zu(e,t){return{$$typeof:wi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function So(e){return typeof e=="object"&&e!==null&&e.$$typeof===wi}function Ju(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var dl=/\/+/g;function qs(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ju(""+e.key):t.toString(36)}function Vi(e,t,r,i,a){var f=typeof e;(f==="undefined"||f==="boolean")&&(e=null);var C=!1;if(e===null)C=!0;else switch(f){case"string":case"number":C=!0;break;case"object":switch(e.$$typeof){case wi:case zu:C=!0}}if(C)return C=e,a=a(C),e=i===""?"."+qs(C,0):i,hl(a)?(r="",e!=null&&(r=e.replace(dl,"$&/")+"/"),Vi(a,t,r,"",function(d){return d})):a!=null&&(So(a)&&(a=Zu(a,r+(!a.key||C&&C.key===a.key?"":(""+a.key).replace(dl,"$&/")+"/")+e)),t.push(a)),1;if(C=0,i=i===""?".":i+":",hl(e))for(var o=0;o<e.length;o++){f=e[o];var c=i+qs(f,o);C+=Vi(f,t,r,c,a)}else if(c=Qu(e),typeof c=="function")for(e=c.call(e),o=0;!(f=e.next()).done;)f=f.value,c=i+qs(f,o++),C+=Vi(f,t,r,c,a);else if(f==="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 C}function Di(e,t,r){if(e==null)return e;var i=[],a=0;return Vi(e,i,"","",function(f){return t.call(r,f,a++)}),i}function eh(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 Te={current:null},Gi={transition:null},th={ReactCurrentDispatcher:Te,ReactCurrentBatchConfig:Gi,ReactCurrentOwner:mo};function Ia(){throw Error("act(...) is not supported in production builds of React.")}te.Children={map:Di,forEach:function(e,t,r){Di(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Di(e,function(){t++}),t},toArray:function(e){return Di(e,function(t){return t})||[]},only:function(e){if(!So(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};te.Component=Dr;te.Fragment=Wu;te.Profiler=$u;te.PureComponent=vo;te.StrictMode=Uu;te.Suspense=qu;te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=th;te.act=Ia;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 i=Ea({},e.props),a=e.key,f=e.ref,C=e._owner;if(t!=null){if(t.ref!==void 0&&(f=t.ref,C=mo.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)Da.call(t,c)&&!Ta.hasOwnProperty(c)&&(i[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)i.children=r;else if(1<c){o=Array(c);for(var d=0;d<c;d++)o[d]=arguments[d+2];i.children=o}return{$$typeof:wi,type:e.type,key:a,ref:f,props:i,_owner:C}};te.createContext=function(e){return e={$$typeof:Vu,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Ku,_context:e},e.Consumer=e};te.createElement=Aa;te.createFactory=function(e){var t=Aa.bind(null,e);return t.type=e,t};te.createRef=function(){return{current:null}};te.forwardRef=function(e){return{$$typeof:Gu,render:e}};te.isValidElement=So;te.lazy=function(e){return{$$typeof:Xu,_payload:{_status:-1,_result:e},_init:eh}};te.memo=function(e,t){return{$$typeof:Yu,type:e,compare:t===void 0?null:t}};te.startTransition=function(e){var t=Gi.transition;Gi.transition={};try{e()}finally{Gi.transition=t}};te.unstable_act=Ia;te.useCallback=function(e,t){return Te.current.useCallback(e,t)};te.useContext=function(e){return Te.current.useContext(e)};te.useDebugValue=function(){};te.useDeferredValue=function(e){return Te.current.useDeferredValue(e)};te.useEffect=function(e,t){return Te.current.useEffect(e,t)};te.useId=function(){return Te.current.useId()};te.useImperativeHandle=function(e,t,r){return Te.current.useImperativeHandle(e,t,r)};te.useInsertionEffect=function(e,t){return Te.current.useInsertionEffect(e,t)};te.useLayoutEffect=function(e,t){return Te.current.useLayoutEffect(e,t)};te.useMemo=function(e,t){return Te.current.useMemo(e,t)};te.useReducer=function(e,t,r){return Te.current.useReducer(e,t,r)};te.useRef=function(e){return Te.current.useRef(e)};te.useState=function(e){return Te.current.useState(e)};te.useSyncExternalStore=function(e,t,r){return Te.current.useSyncExternalStore(e,t,r)};te.useTransition=function(){return Te.current.useTransition()};te.version="18.3.1";ka.exports=te;var q=ka.exports;/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var rh=q,ih=Symbol.for("react.element"),sh=Symbol.for("react.fragment"),nh=Object.prototype.hasOwnProperty,oh=rh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lh={key:!0,ref:!0,__self:!0,__source:!0};function Ma(e,t,r){var i,a={},f=null,C=null;r!==void 0&&(f=""+r),t.key!==void 0&&(f=""+t.key),t.ref!==void 0&&(C=t.ref);for(i in t)nh.call(t,i)&&!lh.hasOwnProperty(i)&&(a[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)a[i]===void 0&&(a[i]=t[i]);return{$$typeof:ih,type:e,key:f,ref:C,props:a,_owner:oh.current}}Ls.Fragment=sh;Ls.jsx=Ma;Ls.jsxs=Ma;xa.exports=Ls;var L=xa.exports,Pa={exports:{}},We={},Ba={exports:{}},Oa={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(j,E){var D=j.length;j.push(E);e:for(;0<D;){var
|
|
25
|
+
*/(function(e){function t(j,E){var D=j.length;j.push(E);e:for(;0<D;){var I=D-1>>>1,B=j[I];if(0<a(B,E))j[I]=E,j[D]=B,D=I;else break e}}function r(j){return j.length===0?null:j[0]}function i(j){if(j.length===0)return null;var E=j[0],D=j.pop();if(D!==E){j[0]=D;e:for(var I=0,B=j.length,K=B>>>1;I<K;){var F=2*(I+1)-1,Y=j[F],U=F+1,O=j[U];if(0>a(Y,D))U<B&&0>a(O,Y)?(j[I]=O,j[U]=D,I=U):(j[I]=Y,j[F]=D,I=F);else if(U<B&&0>a(O,D))j[I]=O,j[U]=D,I=U;else break e}}return E}function a(j,E){var D=j.sortIndex-E.sortIndex;return D!==0?D:j.id-E.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;e.unstable_now=function(){return f.now()}}else{var C=Date,o=C.now();e.unstable_now=function(){return C.now()-o}}var c=[],d=[],S=1,h=null,_=3,g=!1,x=!1,v=!1,u=typeof setTimeout=="function"?setTimeout:null,l=typeof clearTimeout=="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function n(j){for(var E=r(d);E!==null;){if(E.callback===null)i(d);else if(E.startTime<=j)i(d),E.sortIndex=E.expirationTime,t(c,E);else break;E=r(d)}}function p(j){if(v=!1,n(j),!x)if(r(c)!==null)x=!0,V(w);else{var E=r(d);E!==null&&X(p,E.startTime-j)}}function w(j,E){x=!1,v&&(v=!1,l(m),m=-1),g=!0;var D=_;try{for(n(E),h=r(c);h!==null&&(!(h.expirationTime>E)||j&&!M());){var I=h.callback;if(typeof I=="function"){h.callback=null,_=h.priorityLevel;var B=I(h.expirationTime<=E);E=e.unstable_now(),typeof B=="function"?h.callback=B:h===r(c)&&i(c),n(E)}else i(c);h=r(c)}if(h!==null)var K=!0;else{var F=r(d);F!==null&&X(p,F.startTime-E),K=!1}return K}finally{h=null,_=D,g=!1}}var y=!1,k=null,m=-1,b=5,T=-1;function M(){return!(e.unstable_now()-T<b)}function P(){if(k!==null){var j=e.unstable_now();T=j;var E=!0;try{E=k(!0,j)}finally{E?A():(y=!1,k=null)}}else y=!1}var A;if(typeof s=="function")A=function(){s(P)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,W=N.port2;N.port1.onmessage=P,A=function(){W.postMessage(null)}}else A=function(){u(P,0)};function V(j){k=j,y||(y=!0,A())}function X(j,E){m=u(function(){j(e.unstable_now())},E)}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(j){j.callback=null},e.unstable_continueExecution=function(){x||g||(x=!0,V(w))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(j){switch(_){case 1:case 2:case 3:var E=3;break;default:E=_}var D=_;_=E;try{return j()}finally{_=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,E){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var D=_;_=j;try{return E()}finally{_=D}},e.unstable_scheduleCallback=function(j,E,D){var I=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?I+D:I):D=I,j){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=D+B,j={id:S++,callback:E,priorityLevel:j,startTime:D,expirationTime:B,sortIndex:-1},D>I?(j.sortIndex=D,t(d,j),r(c)===null&&j===r(d)&&(v?(l(m),m=-1):v=!0,X(p,D-I))):(j.sortIndex=B,t(c,j),x||g||(x=!0,V(w))),j},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(j){var E=_;return function(){var D=_;_=E;try{return j.apply(this,arguments)}finally{_=D}}}})(Oa);Ba.exports=Oa;var ah=Ba.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
33
|
+
*/var ch=q,ze=ah;function G(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 ja=new Set,ni={};function er(e,t){wr(e,t),wr(e+"Capture",t)}function wr(e,t){for(ni[e]=t,e=0;e<t.length;e++)ja.add(t[e])}var _t=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xn=Object.prototype.hasOwnProperty,uh=/^[: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]*$/,fl={},pl={};function hh(e){return xn.call(pl,e)?!0:xn.call(fl,e)?!1:uh.test(e)?pl[e]=!0:(fl[e]=!0,!1)}function dh(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function fh(e,t,r,i){if(t===null||typeof t>"u"||dh(e,t,r,i))return!0;if(i)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 Ae(e,t,r,i,a,f,C){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=f,this.removeEmptyString=C}var xe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){xe[e]=new Ae(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];xe[t]=new Ae(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){xe[e]=new Ae(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){xe[e]=new Ae(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){xe[e]=new Ae(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){xe[e]=new Ae(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){xe[e]=new Ae(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){xe[e]=new Ae(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){xe[e]=new Ae(e,5,!1,e.toLowerCase(),null,!1,!1)});var yo=/[\-:]([a-z])/g;function Co(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(yo,Co);xe[t]=new Ae(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(yo,Co);xe[t]=new Ae(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(yo,Co);xe[t]=new Ae(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){xe[e]=new Ae(e,1,!1,e.toLowerCase(),null,!1,!1)});xe.xlinkHref=new Ae("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){xe[e]=new Ae(e,1,!1,e.toLowerCase(),null,!0,!0)});function wo(e,t,r,i){var a=xe.hasOwnProperty(t)?xe[t]:null;(a!==null?a.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(fh(t,r,a,i)&&(r=null),i||a===null?hh(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,i=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var St=ch.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ti=Symbol.for("react.element"),sr=Symbol.for("react.portal"),nr=Symbol.for("react.fragment"),xo=Symbol.for("react.strict_mode"),kn=Symbol.for("react.profiler"),Ha=Symbol.for("react.provider"),Na=Symbol.for("react.context"),ko=Symbol.for("react.forward_ref"),bn=Symbol.for("react.suspense"),En=Symbol.for("react.suspense_list"),bo=Symbol.for("react.memo"),xt=Symbol.for("react.lazy"),Fa=Symbol.for("react.offscreen"),_l=Symbol.iterator;function Or(e){return e===null||typeof e!="object"?null:(e=_l&&e[_l]||e["@@iterator"],typeof e=="function"?e:null)}var de=Object.assign,Ys;function Vr(e){if(Ys===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ys=t&&t[1]||""}return`
|
|
34
34
|
`+Ys+e}var Xs=!1;function Qs(e,t){if(!e||Xs)return"";Xs=!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(d){var i=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){i=d}e.call(t.prototype)}else{try{throw Error()}catch(d){i=d}e()}}catch(d){if(d&&i&&typeof d.stack=="string"){for(var a=d.stack.split(`
|
|
35
35
|
`),f=i.stack.split(`
|
|
36
36
|
`),C=a.length-1,o=f.length-1;1<=C&&0<=o&&a[C]!==f[o];)o--;for(;1<=C&&0<=o;C--,o--)if(a[C]!==f[o]){if(C!==1||o!==1)do if(C--,o--,0>o||a[C]!==f[o]){var c=`
|
|
37
|
-
`+a[C].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=C&&0<=o);break}}}finally{Xs=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Vr(e):""}function fh(e){switch(e.tag){case 5:return Vr(e.type);case 16:return Vr("Lazy");case 13:return Vr("Suspense");case 19:return Vr("SuspenseList");case 0:case 2:case 15:return e=Qs(e.type,!1),e;case 11:return e=Qs(e.type.render,!1),e;case 1:return e=Qs(e.type,!0),e;default:return""}}function En(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 nr:return"Fragment";case sr:return"Portal";case xn:return"Profiler";case wo:return"StrictMode";case kn:return"Suspense";case bn:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ha:return(e.displayName||"Context")+".Consumer";case ja:return(e._context.displayName||"Context")+".Provider";case xo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ko:return t=e.displayName||null,t!==null?t:En(e.type)||"Memo";case xt:t=e._payload,e=e._init;try{return En(e(t))}catch{}}return null}function ph(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 En(t);case 8:return t===wo?"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 jt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _h(e){var t=Fa(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(C){i=""+C,f.call(this,C)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(C){i=""+C},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ai(e){e._valueTracker||(e._valueTracker=_h(e))}function za(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Fa(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function ss(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 Rn(e,t){var r=t.checked;return de({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function _l(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=jt(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Wa(e,t){t=t.checked,t!=null&&Co(e,"checked",t,!1)}function Ln(e,t){Wa(e,t);var r=jt(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Dn(e,t.type,r):t.hasOwnProperty("defaultValue")&&Dn(e,t.type,jt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vl(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="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 Dn(e,t,r){(t!=="number"||ss(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Gr=Array.isArray;function vr(e,t,r,i){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&i&&(e[r].defaultSelected=!0)}else{for(r=""+jt(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,i&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Tn(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return de({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function gl(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(G(92));if(Gr(r)){if(1<r.length)throw Error(G(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:jt(r)}}function Ua(e,t){var r=jt(t.value),i=jt(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function ml(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function $a(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 An(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?$a(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ii,Ka=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ii=Ii||document.createElement("div"),Ii.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ii.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function oi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Xr={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},vh=["Webkit","ms","Moz","O"];Object.keys(Xr).forEach(function(e){vh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xr[t]=Xr[e]})});function Va(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Xr.hasOwnProperty(e)&&Xr[e]?(""+t).trim():t+"px"}function Ga(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,a=Va(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,a):e[r]=a}}var gh=de({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 In(e,t){if(t){if(gh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function Mn(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 Pn=null;function bo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bn=null,gr=null,mr=null;function Sl(e){if(e=bi(e)){if(typeof Bn!="function")throw Error(G(280));var t=e.stateNode;t&&(t=Ms(t),Bn(e.stateNode,e.type,t))}}function qa(e){gr?mr?mr.push(e):mr=[e]:gr=e}function Ya(){if(gr){var e=gr,t=mr;if(mr=gr=null,Sl(e),t)for(e=0;e<t.length;e++)Sl(t[e])}}function Xa(e,t){return e(t)}function Qa(){}var Zs=!1;function Za(e,t,r){if(Zs)return e(t,r);Zs=!0;try{return Xa(e,t,r)}finally{Zs=!1,(gr!==null||mr!==null)&&(Qa(),Ya())}}function li(e,t){var r=e.stateNode;if(r===null)return null;var i=Ms(r);if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(G(231,t,typeof r));return r}var On=!1;if(_t)try{var jr={};Object.defineProperty(jr,"passive",{get:function(){On=!0}}),window.addEventListener("test",jr,jr),window.removeEventListener("test",jr,jr)}catch{On=!1}function mh(e,t,r,i,a,f,C,o,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(S){this.onError(S)}}var Qr=!1,ns=null,os=!1,jn=null,Sh={onError:function(e){Qr=!0,ns=e}};function yh(e,t,r,i,a,f,C,o,c){Qr=!1,ns=null,mh.apply(Sh,arguments)}function Ch(e,t,r,i,a,f,C,o,c){if(yh.apply(this,arguments),Qr){if(Qr){var d=ns;Qr=!1,ns=null}else throw Error(G(198));os||(os=!0,jn=d)}}function tr(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 Ja(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 yl(e){if(tr(e)!==e)throw Error(G(188))}function wh(e){var t=e.alternate;if(!t){if(t=tr(e),t===null)throw Error(G(188));return t!==e?null:e}for(var r=e,i=t;;){var a=r.return;if(a===null)break;var f=a.alternate;if(f===null){if(i=a.return,i!==null){r=i;continue}break}if(a.child===f.child){for(f=a.child;f;){if(f===r)return yl(a),e;if(f===i)return yl(a),t;f=f.sibling}throw Error(G(188))}if(r.return!==i.return)r=a,i=f;else{for(var C=!1,o=a.child;o;){if(o===r){C=!0,r=a,i=f;break}if(o===i){C=!0,i=a,r=f;break}o=o.sibling}if(!C){for(o=f.child;o;){if(o===r){C=!0,r=f,i=a;break}if(o===i){C=!0,i=f,r=a;break}o=o.sibling}if(!C)throw Error(G(189))}}if(r.alternate!==i)throw Error(G(190))}if(r.tag!==3)throw Error(G(188));return r.stateNode.current===r?e:t}function ec(e){return e=wh(e),e!==null?tc(e):null}function tc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=tc(e);if(t!==null)return t;e=e.sibling}return null}var rc=ze.unstable_scheduleCallback,Cl=ze.unstable_cancelCallback,xh=ze.unstable_shouldYield,kh=ze.unstable_requestPaint,_e=ze.unstable_now,bh=ze.unstable_getCurrentPriorityLevel,Eo=ze.unstable_ImmediatePriority,ic=ze.unstable_UserBlockingPriority,ls=ze.unstable_NormalPriority,Eh=ze.unstable_LowPriority,sc=ze.unstable_IdlePriority,Ds=null,at=null;function Rh(e){if(at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(Ds,e,void 0,(e.current.flags&128)===128)}catch{}}var tt=Math.clz32?Math.clz32:Th,Lh=Math.log,Dh=Math.LN2;function Th(e){return e>>>=0,e===0?32:31-(Lh(e)/Dh|0)|0}var Mi=64,Pi=4194304;function qr(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 as(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,f=e.pingedLanes,C=r&268435455;if(C!==0){var o=C&~a;o!==0?i=qr(o):(f&=C,f!==0&&(i=qr(f)))}else C=r&~a,C!==0?i=qr(C):f!==0&&(i=qr(f));if(i===0)return 0;if(t!==0&&t!==i&&!(t&a)&&(a=i&-i,f=t&-t,a>=f||a===16&&(f&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-tt(t),a=1<<r,i|=e[r],t&=~a;return i}function Ah(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 Ih(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,f=e.pendingLanes;0<f;){var C=31-tt(f),o=1<<C,c=a[C];c===-1?(!(o&r)||o&i)&&(a[C]=Ah(o,t)):c<=t&&(e.expiredLanes|=o),f&=~o}}function Hn(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function nc(){var e=Mi;return Mi<<=1,!(Mi&4194240)&&(Mi=64),e}function Js(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function xi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-tt(t),e[t]=r}function Mh(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 i=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-tt(r),f=1<<a;t[a]=0,i[a]=-1,e[a]=-1,r&=~f}}function Ro(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-tt(r),a=1<<i;a&t|e[i]&t&&(e[i]|=t),r&=~a}}var se=0;function oc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var lc,Lo,ac,cc,uc,Nn=!1,Bi=[],Dt=null,Tt=null,At=null,ai=new Map,ci=new Map,bt=[],Ph="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 wl(e,t){switch(e){case"focusin":case"focusout":Dt=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":At=null;break;case"pointerover":case"pointerout":ai.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ci.delete(t.pointerId)}}function Hr(e,t,r,i,a,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:f,targetContainers:[a]},t!==null&&(t=bi(t),t!==null&&Lo(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Bh(e,t,r,i,a){switch(t){case"focusin":return Dt=Hr(Dt,e,t,r,i,a),!0;case"dragenter":return Tt=Hr(Tt,e,t,r,i,a),!0;case"mouseover":return At=Hr(At,e,t,r,i,a),!0;case"pointerover":var f=a.pointerId;return ai.set(f,Hr(ai.get(f)||null,e,t,r,i,a)),!0;case"gotpointercapture":return f=a.pointerId,ci.set(f,Hr(ci.get(f)||null,e,t,r,i,a)),!0}return!1}function hc(e){var t=$t(e.target);if(t!==null){var r=tr(t);if(r!==null){if(t=r.tag,t===13){if(t=Ja(r),t!==null){e.blockedOn=t,uc(e.priority,function(){ac(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 qi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Fn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);Pn=i,r.target.dispatchEvent(i),Pn=null}else return t=bi(r),t!==null&&Lo(t),e.blockedOn=r,!1;t.shift()}return!0}function xl(e,t,r){qi(e)&&r.delete(t)}function Oh(){Nn=!1,Dt!==null&&qi(Dt)&&(Dt=null),Tt!==null&&qi(Tt)&&(Tt=null),At!==null&&qi(At)&&(At=null),ai.forEach(xl),ci.forEach(xl)}function Nr(e,t){e.blockedOn===t&&(e.blockedOn=null,Nn||(Nn=!0,ze.unstable_scheduleCallback(ze.unstable_NormalPriority,Oh)))}function ui(e){function t(a){return Nr(a,e)}if(0<Bi.length){Nr(Bi[0],e);for(var r=1;r<Bi.length;r++){var i=Bi[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Dt!==null&&Nr(Dt,e),Tt!==null&&Nr(Tt,e),At!==null&&Nr(At,e),ai.forEach(t),ci.forEach(t),r=0;r<bt.length;r++)i=bt[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<bt.length&&(r=bt[0],r.blockedOn===null);)hc(r),r.blockedOn===null&&bt.shift()}var Sr=St.ReactCurrentBatchConfig,cs=!0;function jh(e,t,r,i){var a=se,f=Sr.transition;Sr.transition=null;try{se=1,Do(e,t,r,i)}finally{se=a,Sr.transition=f}}function Hh(e,t,r,i){var a=se,f=Sr.transition;Sr.transition=null;try{se=4,Do(e,t,r,i)}finally{se=a,Sr.transition=f}}function Do(e,t,r,i){if(cs){var a=Fn(e,t,r,i);if(a===null)un(e,t,i,us,r),wl(e,i);else if(Bh(a,e,t,r,i))i.stopPropagation();else if(wl(e,i),t&4&&-1<Ph.indexOf(e)){for(;a!==null;){var f=bi(a);if(f!==null&&lc(f),f=Fn(e,t,r,i),f===null&&un(e,t,i,us,r),f===a)break;a=f}a!==null&&i.stopPropagation()}else un(e,t,i,null,r)}}var us=null;function Fn(e,t,r,i){if(us=null,e=bo(i),e=$t(e),e!==null)if(t=tr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Ja(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 us=e,null}function dc(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(bh()){case Eo:return 1;case ic:return 4;case ls:case Eh:return 16;case sc:return 536870912;default:return 16}default:return 16}}var Rt=null,To=null,Yi=null;function fc(){if(Yi)return Yi;var e,t=To,r=t.length,i,a="value"in Rt?Rt.value:Rt.textContent,f=a.length;for(e=0;e<r&&t[e]===a[e];e++);var C=r-e;for(i=1;i<=C&&t[r-i]===a[f-i];i++);return Yi=a.slice(e,1<i?1-i:void 0)}function Xi(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 Oi(){return!0}function kl(){return!1}function Ue(e){function t(r,i,a,f,C){this._reactName=r,this._targetInst=a,this.type=i,this.nativeEvent=f,this.target=C,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(r=e[o],this[o]=r?r(f):f[o]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Oi:kl,this.isPropagationStopped=kl,this}return de(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=Oi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Oi)},persist:function(){},isPersistent:Oi}),t}var Tr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ao=Ue(Tr),ki=de({},Tr,{view:0,detail:0}),Nh=Ue(ki),en,tn,Fr,Ts=de({},ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Io,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!==Fr&&(Fr&&e.type==="mousemove"?(en=e.screenX-Fr.screenX,tn=e.screenY-Fr.screenY):tn=en=0,Fr=e),en)},movementY:function(e){return"movementY"in e?e.movementY:tn}}),bl=Ue(Ts),Fh=de({},Ts,{dataTransfer:0}),zh=Ue(Fh),Wh=de({},ki,{relatedTarget:0}),rn=Ue(Wh),Uh=de({},Tr,{animationName:0,elapsedTime:0,pseudoElement:0}),$h=Ue(Uh),Kh=de({},Tr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Vh=Ue(Kh),Gh=de({},Tr,{data:0}),El=Ue(Gh),qh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yh={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"},Xh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xh[e])?!!t[e]:!1}function Io(){return Qh}var Zh=de({},ki,{key:function(e){if(e.key){var t=qh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Xi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Io,charCode:function(e){return e.type==="keypress"?Xi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jh=Ue(Zh),ed=de({},Ts,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rl=Ue(ed),td=de({},ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Io}),rd=Ue(td),id=de({},Tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),sd=Ue(id),nd=de({},Ts,{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}),od=Ue(nd),ld=[9,13,27,32],Mo=_t&&"CompositionEvent"in window,Zr=null;_t&&"documentMode"in document&&(Zr=document.documentMode);var ad=_t&&"TextEvent"in window&&!Zr,pc=_t&&(!Mo||Zr&&8<Zr&&11>=Zr),Ll=" ",Dl=!1;function _c(e,t){switch(e){case"keyup":return ld.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var or=!1;function cd(e,t){switch(e){case"compositionend":return vc(t);case"keypress":return t.which!==32?null:(Dl=!0,Ll);case"textInput":return e=t.data,e===Ll&&Dl?null:e;default:return null}}function ud(e,t){if(or)return e==="compositionend"||!Mo&&_c(e,t)?(e=fc(),Yi=To=Rt=null,or=!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 pc&&t.locale!=="ko"?null:t.data;default:return null}}var hd={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 Tl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!hd[e.type]:t==="textarea"}function gc(e,t,r,i){qa(i),t=hs(t,"onChange"),0<t.length&&(r=new Ao("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var Jr=null,hi=null;function dd(e){Lc(e,0)}function As(e){var t=cr(e);if(za(t))return e}function fd(e,t){if(e==="change")return t}var mc=!1;if(_t){var sn;if(_t){var nn="oninput"in document;if(!nn){var Al=document.createElement("div");Al.setAttribute("oninput","return;"),nn=typeof Al.oninput=="function"}sn=nn}else sn=!1;mc=sn&&(!document.documentMode||9<document.documentMode)}function Il(){Jr&&(Jr.detachEvent("onpropertychange",Sc),hi=Jr=null)}function Sc(e){if(e.propertyName==="value"&&As(hi)){var t=[];gc(t,hi,e,bo(e)),Za(dd,t)}}function pd(e,t,r){e==="focusin"?(Il(),Jr=t,hi=r,Jr.attachEvent("onpropertychange",Sc)):e==="focusout"&&Il()}function _d(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return As(hi)}function vd(e,t){if(e==="click")return As(t)}function gd(e,t){if(e==="input"||e==="change")return As(t)}function md(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var it=typeof Object.is=="function"?Object.is:md;function di(e,t){if(it(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var a=r[i];if(!wn.call(t,a)||!it(e[a],t[a]))return!1}return!0}function Ml(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pl(e,t){var r=Ml(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ml(r)}}function yc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cc(){for(var e=window,t=ss();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ss(e.document)}return t}function Po(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 Sd(e){var t=Cc(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&yc(r.ownerDocument.documentElement,r)){if(i!==null&&Po(r)){if(t=i.start,e=i.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 a=r.textContent.length,f=Math.min(i.start,a);i=i.end===void 0?f:Math.min(i.end,a),!e.extend&&f>i&&(a=i,i=f,f=a),a=Pl(r,f);var C=Pl(r,i);a&&C&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==C.node||e.focusOffset!==C.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),f>i?(e.addRange(t),e.extend(C.node,C.offset)):(t.setEnd(C.node,C.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 yd=_t&&"documentMode"in document&&11>=document.documentMode,lr=null,zn=null,ei=null,Wn=!1;function Bl(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Wn||lr==null||lr!==ss(i)||(i=lr,"selectionStart"in i&&Po(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ei&&di(ei,i)||(ei=i,i=hs(zn,"onSelect"),0<i.length&&(t=new Ao("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=lr)))}function ji(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ar={animationend:ji("Animation","AnimationEnd"),animationiteration:ji("Animation","AnimationIteration"),animationstart:ji("Animation","AnimationStart"),transitionend:ji("Transition","TransitionEnd")},on={},wc={};_t&&(wc=document.createElement("div").style,"AnimationEvent"in window||(delete ar.animationend.animation,delete ar.animationiteration.animation,delete ar.animationstart.animation),"TransitionEvent"in window||delete ar.transitionend.transition);function Is(e){if(on[e])return on[e];if(!ar[e])return e;var t=ar[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in wc)return on[e]=t[r];return e}var xc=Is("animationend"),kc=Is("animationiteration"),bc=Is("animationstart"),Ec=Is("transitionend"),Rc=new Map,Ol="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 Nt(e,t){Rc.set(e,t),er(t,[e])}for(var ln=0;ln<Ol.length;ln++){var an=Ol[ln],Cd=an.toLowerCase(),wd=an[0].toUpperCase()+an.slice(1);Nt(Cd,"on"+wd)}Nt(xc,"onAnimationEnd");Nt(kc,"onAnimationIteration");Nt(bc,"onAnimationStart");Nt("dblclick","onDoubleClick");Nt("focusin","onFocus");Nt("focusout","onBlur");Nt(Ec,"onTransitionEnd");wr("onMouseEnter",["mouseout","mouseover"]);wr("onMouseLeave",["mouseout","mouseover"]);wr("onPointerEnter",["pointerout","pointerover"]);wr("onPointerLeave",["pointerout","pointerover"]);er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));er("onBeforeInput",["compositionend","keypress","textInput","paste"]);er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yr="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(" "),xd=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yr));function jl(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,Ch(i,t,void 0,e),e.currentTarget=null}function Lc(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],a=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var C=i.length-1;0<=C;C--){var o=i[C],c=o.instance,d=o.currentTarget;if(o=o.listener,c!==f&&a.isPropagationStopped())break e;jl(a,o,d),f=c}else for(C=0;C<i.length;C++){if(o=i[C],c=o.instance,d=o.currentTarget,o=o.listener,c!==f&&a.isPropagationStopped())break e;jl(a,o,d),f=c}}}if(os)throw e=jn,os=!1,jn=null,e}function oe(e,t){var r=t[Gn];r===void 0&&(r=t[Gn]=new Set);var i=e+"__bubble";r.has(i)||(Dc(t,e,2,!1),r.add(i))}function cn(e,t,r){var i=0;t&&(i|=4),Dc(r,e,i,t)}var Hi="_reactListening"+Math.random().toString(36).slice(2);function fi(e){if(!e[Hi]){e[Hi]=!0,Oa.forEach(function(r){r!=="selectionchange"&&(xd.has(r)||cn(r,!1,e),cn(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hi]||(t[Hi]=!0,cn("selectionchange",!1,t))}}function Dc(e,t,r,i){switch(dc(t)){case 1:var a=jh;break;case 4:a=Hh;break;default:a=Do}r=a.bind(null,t,r,e),a=void 0,!On||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),i?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function un(e,t,r,i,a){var f=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var C=i.tag;if(C===3||C===4){var o=i.stateNode.containerInfo;if(o===a||o.nodeType===8&&o.parentNode===a)break;if(C===4)for(C=i.return;C!==null;){var c=C.tag;if((c===3||c===4)&&(c=C.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;C=C.return}for(;o!==null;){if(C=$t(o),C===null)return;if(c=C.tag,c===5||c===6){i=f=C;continue e}o=o.parentNode}}i=i.return}Za(function(){var d=f,S=bo(r),h=[];e:{var _=Rc.get(e);if(_!==void 0){var g=Ao,x=e;switch(e){case"keypress":if(Xi(r)===0)break e;case"keydown":case"keyup":g=Jh;break;case"focusin":x="focus",g=rn;break;case"focusout":x="blur",g=rn;break;case"beforeblur":case"afterblur":g=rn;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":g=bl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=zh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=rd;break;case xc:case kc:case bc:g=$h;break;case Ec:g=sd;break;case"scroll":g=Nh;break;case"wheel":g=od;break;case"copy":case"cut":case"paste":g=Vh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Rl}var v=(t&4)!==0,u=!v&&e==="scroll",l=v?_!==null?_+"Capture":null:_;v=[];for(var s=d,n;s!==null;){n=s;var p=n.stateNode;if(n.tag===5&&p!==null&&(n=p,l!==null&&(p=li(s,l),p!=null&&v.push(pi(s,p,n)))),u)break;s=s.return}0<v.length&&(_=new g(_,x,null,r,S),h.push({event:_,listeners:v}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",_&&r!==Pn&&(x=r.relatedTarget||r.fromElement)&&($t(x)||x[vt]))break e;if((g||_)&&(_=S.window===S?S:(_=S.ownerDocument)?_.defaultView||_.parentWindow:window,g?(x=r.relatedTarget||r.toElement,g=d,x=x?$t(x):null,x!==null&&(u=tr(x),x!==u||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=d),g!==x)){if(v=bl,p="onMouseLeave",l="onMouseEnter",s="mouse",(e==="pointerout"||e==="pointerover")&&(v=Rl,p="onPointerLeave",l="onPointerEnter",s="pointer"),u=g==null?_:cr(g),n=x==null?_:cr(x),_=new v(p,s+"leave",g,r,S),_.target=u,_.relatedTarget=n,p=null,$t(S)===d&&(v=new v(l,s+"enter",x,r,S),v.target=n,v.relatedTarget=u,p=v),u=p,g&&x)t:{for(v=g,l=x,s=0,n=v;n;n=rr(n))s++;for(n=0,p=l;p;p=rr(p))n++;for(;0<s-n;)v=rr(v),s--;for(;0<n-s;)l=rr(l),n--;for(;s--;){if(v===l||l!==null&&v===l.alternate)break t;v=rr(v),l=rr(l)}v=null}else v=null;g!==null&&Hl(h,_,g,v,!1),x!==null&&u!==null&&Hl(h,u,x,v,!0)}}e:{if(_=d?cr(d):window,g=_.nodeName&&_.nodeName.toLowerCase(),g==="select"||g==="input"&&_.type==="file")var w=fd;else if(Tl(_))if(mc)w=gd;else{w=_d;var y=pd}else(g=_.nodeName)&&g.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(w=vd);if(w&&(w=w(e,d))){gc(h,w,r,S);break e}y&&y(e,_,d),e==="focusout"&&(y=_._wrapperState)&&y.controlled&&_.type==="number"&&Dn(_,"number",_.value)}switch(y=d?cr(d):window,e){case"focusin":(Tl(y)||y.contentEditable==="true")&&(lr=y,zn=d,ei=null);break;case"focusout":ei=zn=lr=null;break;case"mousedown":Wn=!0;break;case"contextmenu":case"mouseup":case"dragend":Wn=!1,Bl(h,r,S);break;case"selectionchange":if(yd)break;case"keydown":case"keyup":Bl(h,r,S)}var k;if(Mo)e:{switch(e){case"compositionstart":var m="onCompositionStart";break e;case"compositionend":m="onCompositionEnd";break e;case"compositionupdate":m="onCompositionUpdate";break e}m=void 0}else or?_c(e,r)&&(m="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(m="onCompositionStart");m&&(pc&&r.locale!=="ko"&&(or||m!=="onCompositionStart"?m==="onCompositionEnd"&&or&&(k=fc()):(Rt=S,To="value"in Rt?Rt.value:Rt.textContent,or=!0)),y=hs(d,m),0<y.length&&(m=new El(m,e,null,r,S),h.push({event:m,listeners:y}),k?m.data=k:(k=vc(r),k!==null&&(m.data=k)))),(k=ad?cd(e,r):ud(e,r))&&(d=hs(d,"onBeforeInput"),0<d.length&&(S=new El("onBeforeInput","beforeinput",null,r,S),h.push({event:S,listeners:d}),S.data=k))}Lc(h,t)})}function pi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function hs(e,t){for(var r=t+"Capture",i=[];e!==null;){var a=e,f=a.stateNode;a.tag===5&&f!==null&&(a=f,f=li(e,r),f!=null&&i.unshift(pi(e,f,a)),f=li(e,t),f!=null&&i.push(pi(e,f,a))),e=e.return}return i}function rr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Hl(e,t,r,i,a){for(var f=t._reactName,C=[];r!==null&&r!==i;){var o=r,c=o.alternate,d=o.stateNode;if(c!==null&&c===i)break;o.tag===5&&d!==null&&(o=d,a?(c=li(r,f),c!=null&&C.unshift(pi(r,c,o))):a||(c=li(r,f),c!=null&&C.push(pi(r,c,o)))),r=r.return}C.length!==0&&e.push({event:t,listeners:C})}var kd=/\r\n?/g,bd=/\u0000|\uFFFD/g;function Nl(e){return(typeof e=="string"?e:""+e).replace(kd,`
|
|
38
|
-
`).replace(bd,"")}function Ni(e,t,r){if(t=Nl(t),Nl(e)!==t&&r)throw Error(G(425))}function ds(){}var Un=null,$n=null;function Kn(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 Vn=typeof setTimeout=="function"?setTimeout:void 0,Ed=typeof clearTimeout=="function"?clearTimeout:void 0,Fl=typeof Promise=="function"?Promise:void 0,Rd=typeof queueMicrotask=="function"?queueMicrotask:typeof Fl<"u"?function(e){return Fl.resolve(null).then(e).catch(Ld)}:Vn;function Ld(e){setTimeout(function(){throw e})}function hn(e,t){var r=t,i=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(i===0){e.removeChild(a),ui(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=a}while(r);ui(t)}function It(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 zl(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 Ar=Math.random().toString(36).slice(2),lt="__reactFiber$"+Ar,_i="__reactProps$"+Ar,vt="__reactContainer$"+Ar,Gn="__reactEvents$"+Ar,Dd="__reactListeners$"+Ar,Td="__reactHandles$"+Ar;function $t(e){var t=e[lt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[vt]||r[lt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=zl(e);e!==null;){if(r=e[lt])return r;e=zl(e)}return t}e=r,r=e.parentNode}return null}function bi(e){return e=e[lt]||e[vt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function cr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function Ms(e){return e[_i]||null}var qn=[],ur=-1;function Ft(e){return{current:e}}function le(e){0>ur||(e.current=qn[ur],qn[ur]=null,ur--)}function ne(e,t){ur++,qn[ur]=e.current,e.current=t}var Ht={},Re=Ft(Ht),Be=Ft(!1),Yt=Ht;function xr(e,t){var r=e.type.contextTypes;if(!r)return Ht;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var a={},f;for(f in r)a[f]=t[f];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Oe(e){return e=e.childContextTypes,e!=null}function fs(){le(Be),le(Re)}function Wl(e,t,r){if(Re.current!==Ht)throw Error(G(168));ne(Re,t),ne(Be,r)}function Tc(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var a in i)if(!(a in t))throw Error(G(108,ph(e)||"Unknown",a));return de({},r,i)}function ps(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ht,Yt=Re.current,ne(Re,e),ne(Be,Be.current),!0}function Ul(e,t,r){var i=e.stateNode;if(!i)throw Error(G(169));r?(e=Tc(e,t,Yt),i.__reactInternalMemoizedMergedChildContext=e,le(Be),le(Re),ne(Re,e)):le(Be),ne(Be,r)}var ht=null,Ps=!1,dn=!1;function Ac(e){ht===null?ht=[e]:ht.push(e)}function Ad(e){Ps=!0,Ac(e)}function zt(){if(!dn&&ht!==null){dn=!0;var e=0,t=se;try{var r=ht;for(se=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}ht=null,Ps=!1}catch(a){throw ht!==null&&(ht=ht.slice(e+1)),rc(Eo,zt),a}finally{se=t,dn=!1}}return null}var hr=[],dr=0,_s=null,vs=0,Ke=[],Ve=0,Xt=null,dt=1,ft="";function Wt(e,t){hr[dr++]=vs,hr[dr++]=_s,_s=e,vs=t}function Ic(e,t,r){Ke[Ve++]=dt,Ke[Ve++]=ft,Ke[Ve++]=Xt,Xt=e;var i=dt;e=ft;var a=32-tt(i)-1;i&=~(1<<a),r+=1;var f=32-tt(t)+a;if(30<f){var C=a-a%5;f=(i&(1<<C)-1).toString(32),i>>=C,a-=C,dt=1<<32-tt(t)+a|r<<a|i,ft=f+e}else dt=1<<f|r<<a|i,ft=e}function Bo(e){e.return!==null&&(Wt(e,1),Ic(e,1,0))}function Oo(e){for(;e===_s;)_s=hr[--dr],hr[dr]=null,vs=hr[--dr],hr[dr]=null;for(;e===Xt;)Xt=Ke[--Ve],Ke[Ve]=null,ft=Ke[--Ve],Ke[Ve]=null,dt=Ke[--Ve],Ke[Ve]=null}var Fe=null,Ne=null,ae=!1,et=null;function Mc(e,t){var r=Ge(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 $l(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,Fe=e,Ne=It(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Fe=e,Ne=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Xt!==null?{id:dt,overflow:ft}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Ge(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Fe=e,Ne=null,!0):!1;default:return!1}}function Yn(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xn(e){if(ae){var t=Ne;if(t){var r=t;if(!$l(e,t)){if(Yn(e))throw Error(G(418));t=It(r.nextSibling);var i=Fe;t&&$l(e,t)?Mc(i,r):(e.flags=e.flags&-4097|2,ae=!1,Fe=e)}}else{if(Yn(e))throw Error(G(418));e.flags=e.flags&-4097|2,ae=!1,Fe=e}}}function Kl(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fe=e}function Fi(e){if(e!==Fe)return!1;if(!ae)return Kl(e),ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Kn(e.type,e.memoizedProps)),t&&(t=Ne)){if(Yn(e))throw Pc(),Error(G(418));for(;t;)Mc(e,t),t=It(t.nextSibling)}if(Kl(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Ne=It(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Ne=null}}else Ne=Fe?It(e.stateNode.nextSibling):null;return!0}function Pc(){for(var e=Ne;e;)e=It(e.nextSibling)}function kr(){Ne=Fe=null,ae=!1}function jo(e){et===null?et=[e]:et.push(e)}var Id=St.ReactCurrentBatchConfig;function zr(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(G(309));var i=r.stateNode}if(!i)throw Error(G(147,e));var a=i,f=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===f?t.ref:(t=function(C){var o=a.refs;C===null?delete o[f]:o[f]=C},t._stringRef=f,t)}if(typeof e!="string")throw Error(G(284));if(!r._owner)throw Error(G(290,e))}return e}function zi(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vl(e){var t=e._init;return t(e._payload)}function Bc(e){function t(l,s){if(e){var n=l.deletions;n===null?(l.deletions=[s],l.flags|=16):n.push(s)}}function r(l,s){if(!e)return null;for(;s!==null;)t(l,s),s=s.sibling;return null}function i(l,s){for(l=new Map;s!==null;)s.key!==null?l.set(s.key,s):l.set(s.index,s),s=s.sibling;return l}function a(l,s){return l=Ot(l,s),l.index=0,l.sibling=null,l}function f(l,s,n){return l.index=n,e?(n=l.alternate,n!==null?(n=n.index,n<s?(l.flags|=2,s):n):(l.flags|=2,s)):(l.flags|=1048576,s)}function C(l){return e&&l.alternate===null&&(l.flags|=2),l}function o(l,s,n,p){return s===null||s.tag!==6?(s=Sn(n,l.mode,p),s.return=l,s):(s=a(s,n),s.return=l,s)}function c(l,s,n,p){var w=n.type;return w===nr?S(l,s,n.props.children,p,n.key):s!==null&&(s.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===xt&&Vl(w)===s.type)?(p=a(s,n.props),p.ref=zr(l,s,n),p.return=l,p):(p=is(n.type,n.key,n.props,null,l.mode,p),p.ref=zr(l,s,n),p.return=l,p)}function d(l,s,n,p){return s===null||s.tag!==4||s.stateNode.containerInfo!==n.containerInfo||s.stateNode.implementation!==n.implementation?(s=yn(n,l.mode,p),s.return=l,s):(s=a(s,n.children||[]),s.return=l,s)}function S(l,s,n,p,w){return s===null||s.tag!==7?(s=qt(n,l.mode,p,w),s.return=l,s):(s=a(s,n),s.return=l,s)}function h(l,s,n){if(typeof s=="string"&&s!==""||typeof s=="number")return s=Sn(""+s,l.mode,n),s.return=l,s;if(typeof s=="object"&&s!==null){switch(s.$$typeof){case Ti:return n=is(s.type,s.key,s.props,null,l.mode,n),n.ref=zr(l,null,s),n.return=l,n;case sr:return s=yn(s,l.mode,n),s.return=l,s;case xt:var p=s._init;return h(l,p(s._payload),n)}if(Gr(s)||Or(s))return s=qt(s,l.mode,n,null),s.return=l,s;zi(l,s)}return null}function _(l,s,n,p){var w=s!==null?s.key:null;if(typeof n=="string"&&n!==""||typeof n=="number")return w!==null?null:o(l,s,""+n,p);if(typeof n=="object"&&n!==null){switch(n.$$typeof){case Ti:return n.key===w?c(l,s,n,p):null;case sr:return n.key===w?d(l,s,n,p):null;case xt:return w=n._init,_(l,s,w(n._payload),p)}if(Gr(n)||Or(n))return w!==null?null:S(l,s,n,p,null);zi(l,n)}return null}function g(l,s,n,p,w){if(typeof p=="string"&&p!==""||typeof p=="number")return l=l.get(n)||null,o(s,l,""+p,w);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Ti:return l=l.get(p.key===null?n:p.key)||null,c(s,l,p,w);case sr:return l=l.get(p.key===null?n:p.key)||null,d(s,l,p,w);case xt:var y=p._init;return g(l,s,n,y(p._payload),w)}if(Gr(p)||Or(p))return l=l.get(n)||null,S(s,l,p,w,null);zi(s,p)}return null}function x(l,s,n,p){for(var w=null,y=null,k=s,m=s=0,b=null;k!==null&&m<n.length;m++){k.index>m?(b=k,k=null):b=k.sibling;var T=_(l,k,n[m],p);if(T===null){k===null&&(k=b);break}e&&k&&T.alternate===null&&t(l,k),s=f(T,s,m),y===null?w=T:y.sibling=T,y=T,k=b}if(m===n.length)return r(l,k),ae&&Wt(l,m),w;if(k===null){for(;m<n.length;m++)k=h(l,n[m],p),k!==null&&(s=f(k,s,m),y===null?w=k:y.sibling=k,y=k);return ae&&Wt(l,m),w}for(k=i(l,k);m<n.length;m++)b=g(k,l,m,n[m],p),b!==null&&(e&&b.alternate!==null&&k.delete(b.key===null?m:b.key),s=f(b,s,m),y===null?w=b:y.sibling=b,y=b);return e&&k.forEach(function(I){return t(l,I)}),ae&&Wt(l,m),w}function v(l,s,n,p){var w=Or(n);if(typeof w!="function")throw Error(G(150));if(n=w.call(n),n==null)throw Error(G(151));for(var y=w=null,k=s,m=s=0,b=null,T=n.next();k!==null&&!T.done;m++,T=n.next()){k.index>m?(b=k,k=null):b=k.sibling;var I=_(l,k,T.value,p);if(I===null){k===null&&(k=b);break}e&&k&&I.alternate===null&&t(l,k),s=f(I,s,m),y===null?w=I:y.sibling=I,y=I,k=b}if(T.done)return r(l,k),ae&&Wt(l,m),w;if(k===null){for(;!T.done;m++,T=n.next())T=h(l,T.value,p),T!==null&&(s=f(T,s,m),y===null?w=T:y.sibling=T,y=T);return ae&&Wt(l,m),w}for(k=i(l,k);!T.done;m++,T=n.next())T=g(k,l,m,T.value,p),T!==null&&(e&&T.alternate!==null&&k.delete(T.key===null?m:T.key),s=f(T,s,m),y===null?w=T:y.sibling=T,y=T);return e&&k.forEach(function(P){return t(l,P)}),ae&&Wt(l,m),w}function u(l,s,n,p){if(typeof n=="object"&&n!==null&&n.type===nr&&n.key===null&&(n=n.props.children),typeof n=="object"&&n!==null){switch(n.$$typeof){case Ti:e:{for(var w=n.key,y=s;y!==null;){if(y.key===w){if(w=n.type,w===nr){if(y.tag===7){r(l,y.sibling),s=a(y,n.props.children),s.return=l,l=s;break e}}else if(y.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===xt&&Vl(w)===y.type){r(l,y.sibling),s=a(y,n.props),s.ref=zr(l,y,n),s.return=l,l=s;break e}r(l,y);break}else t(l,y);y=y.sibling}n.type===nr?(s=qt(n.props.children,l.mode,p,n.key),s.return=l,l=s):(p=is(n.type,n.key,n.props,null,l.mode,p),p.ref=zr(l,s,n),p.return=l,l=p)}return C(l);case sr:e:{for(y=n.key;s!==null;){if(s.key===y)if(s.tag===4&&s.stateNode.containerInfo===n.containerInfo&&s.stateNode.implementation===n.implementation){r(l,s.sibling),s=a(s,n.children||[]),s.return=l,l=s;break e}else{r(l,s);break}else t(l,s);s=s.sibling}s=yn(n,l.mode,p),s.return=l,l=s}return C(l);case xt:return y=n._init,u(l,s,y(n._payload),p)}if(Gr(n))return x(l,s,n,p);if(Or(n))return v(l,s,n,p);zi(l,n)}return typeof n=="string"&&n!==""||typeof n=="number"?(n=""+n,s!==null&&s.tag===6?(r(l,s.sibling),s=a(s,n),s.return=l,l=s):(r(l,s),s=Sn(n,l.mode,p),s.return=l,l=s),C(l)):r(l,s)}return u}var br=Bc(!0),Oc=Bc(!1),gs=Ft(null),ms=null,fr=null,Ho=null;function No(){Ho=fr=ms=null}function Fo(e){var t=gs.current;le(gs),e._currentValue=t}function Qn(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function yr(e,t){ms=e,Ho=fr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Pe=!0),e.firstContext=null)}function Ye(e){var t=e._currentValue;if(Ho!==e)if(e={context:e,memoizedValue:t,next:null},fr===null){if(ms===null)throw Error(G(308));fr=e,ms.dependencies={lanes:0,firstContext:e}}else fr=fr.next=e;return t}var Kt=null;function zo(e){Kt===null?Kt=[e]:Kt.push(e)}function jc(e,t,r,i){var a=t.interleaved;return a===null?(r.next=r,zo(t)):(r.next=a.next,a.next=r),t.interleaved=r,gt(e,i)}function gt(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 kt=!1;function Wo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Hc(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 pt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Mt(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,re&2){var a=i.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),i.pending=t,gt(e,r)}return a=i.interleaved,a===null?(t.next=t,zo(i)):(t.next=a.next,a.next=t),i.interleaved=t,gt(e,r)}function Qi(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Ro(e,r)}}function Gl(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var a=null,f=null;if(r=r.firstBaseUpdate,r!==null){do{var C={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};f===null?a=f=C:f=f.next=C,r=r.next}while(r!==null);f===null?a=f=t:f=f.next=t}else a=f=t;r={baseState:i.baseState,firstBaseUpdate:a,lastBaseUpdate:f,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ss(e,t,r,i){var a=e.updateQueue;kt=!1;var f=a.firstBaseUpdate,C=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,d=c.next;c.next=null,C===null?f=d:C.next=d,C=c;var S=e.alternate;S!==null&&(S=S.updateQueue,o=S.lastBaseUpdate,o!==C&&(o===null?S.firstBaseUpdate=d:o.next=d,S.lastBaseUpdate=c))}if(f!==null){var h=a.baseState;C=0,S=d=c=null,o=f;do{var _=o.lane,g=o.eventTime;if((i&_)===_){S!==null&&(S=S.next={eventTime:g,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var x=e,v=o;switch(_=t,g=r,v.tag){case 1:if(x=v.payload,typeof x=="function"){h=x.call(g,h,_);break e}h=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,_=typeof x=="function"?x.call(g,h,_):x,_==null)break e;h=de({},h,_);break e;case 2:kt=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,_=a.effects,_===null?a.effects=[o]:_.push(o))}else g={eventTime:g,lane:_,tag:o.tag,payload:o.payload,callback:o.callback,next:null},S===null?(d=S=g,c=h):S=S.next=g,C|=_;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;_=o,o=_.next,_.next=null,a.lastBaseUpdate=_,a.shared.pending=null}}while(!0);if(S===null&&(c=h),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=S,t=a.shared.interleaved,t!==null){a=t;do C|=a.lane,a=a.next;while(a!==t)}else f===null&&(a.shared.lanes=0);Zt|=C,e.lanes=C,e.memoizedState=h}}function ql(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=r,typeof a!="function")throw Error(G(191,a));a.call(i)}}}var Ei={},ct=Ft(Ei),vi=Ft(Ei),gi=Ft(Ei);function Vt(e){if(e===Ei)throw Error(G(174));return e}function Uo(e,t){switch(ne(gi,t),ne(vi,e),ne(ct,Ei),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:An(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=An(t,e)}le(ct),ne(ct,t)}function Er(){le(ct),le(vi),le(gi)}function Nc(e){Vt(gi.current);var t=Vt(ct.current),r=An(t,e.type);t!==r&&(ne(vi,e),ne(ct,r))}function $o(e){vi.current===e&&(le(ct),le(vi))}var ue=Ft(0);function ys(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 fn=[];function Ko(){for(var e=0;e<fn.length;e++)fn[e]._workInProgressVersionPrimary=null;fn.length=0}var Zi=St.ReactCurrentDispatcher,pn=St.ReactCurrentBatchConfig,Qt=0,he=null,ge=null,Se=null,Cs=!1,ti=!1,mi=0,Md=0;function ke(){throw Error(G(321))}function Vo(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!it(e[r],t[r]))return!1;return!0}function Go(e,t,r,i,a,f){if(Qt=f,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Zi.current=e===null||e.memoizedState===null?jd:Hd,e=r(i,a),ti){f=0;do{if(ti=!1,mi=0,25<=f)throw Error(G(301));f+=1,Se=ge=null,t.updateQueue=null,Zi.current=Nd,e=r(i,a)}while(ti)}if(Zi.current=ws,t=ge!==null&&ge.next!==null,Qt=0,Se=ge=he=null,Cs=!1,t)throw Error(G(300));return e}function qo(){var e=mi!==0;return mi=0,e}function ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Se===null?he.memoizedState=Se=e:Se=Se.next=e,Se}function Xe(){if(ge===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=ge.next;var t=Se===null?he.memoizedState:Se.next;if(t!==null)Se=t,ge=e;else{if(e===null)throw Error(G(310));ge=e,e={memoizedState:ge.memoizedState,baseState:ge.baseState,baseQueue:ge.baseQueue,queue:ge.queue,next:null},Se===null?he.memoizedState=Se=e:Se=Se.next=e}return Se}function Si(e,t){return typeof t=="function"?t(e):t}function _n(e){var t=Xe(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var i=ge,a=i.baseQueue,f=r.pending;if(f!==null){if(a!==null){var C=a.next;a.next=f.next,f.next=C}i.baseQueue=a=f,r.pending=null}if(a!==null){f=a.next,i=i.baseState;var o=C=null,c=null,d=f;do{var S=d.lane;if((Qt&S)===S)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),i=d.hasEagerState?d.eagerState:e(i,d.action);else{var h={lane:S,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(o=c=h,C=i):c=c.next=h,he.lanes|=S,Zt|=S}d=d.next}while(d!==null&&d!==f);c===null?C=i:c.next=o,it(i,t.memoizedState)||(Pe=!0),t.memoizedState=i,t.baseState=C,t.baseQueue=c,r.lastRenderedState=i}if(e=r.interleaved,e!==null){a=e;do f=a.lane,he.lanes|=f,Zt|=f,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function vn(e){var t=Xe(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var i=r.dispatch,a=r.pending,f=t.memoizedState;if(a!==null){r.pending=null;var C=a=a.next;do f=e(f,C.action),C=C.next;while(C!==a);it(f,t.memoizedState)||(Pe=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),r.lastRenderedState=f}return[f,i]}function Fc(){}function zc(e,t){var r=he,i=Xe(),a=t(),f=!it(i.memoizedState,a);if(f&&(i.memoizedState=a,Pe=!0),i=i.queue,Yo($c.bind(null,r,i,e),[e]),i.getSnapshot!==t||f||Se!==null&&Se.memoizedState.tag&1){if(r.flags|=2048,yi(9,Uc.bind(null,r,i,a,t),void 0,null),ye===null)throw Error(G(349));Qt&30||Wc(r,t,a)}return a}function Wc(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Uc(e,t,r,i){t.value=r,t.getSnapshot=i,Kc(t)&&Vc(e)}function $c(e,t,r){return r(function(){Kc(t)&&Vc(e)})}function Kc(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!it(e,r)}catch{return!0}}function Vc(e){var t=gt(e,1);t!==null&&rt(t,e,1,-1)}function Yl(e){var t=ot();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:e},t.queue=e,e=e.dispatch=Od.bind(null,he,e),[t.memoizedState,e]}function yi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function Gc(){return Xe().memoizedState}function Ji(e,t,r,i){var a=ot();he.flags|=e,a.memoizedState=yi(1|t,r,void 0,i===void 0?null:i)}function Bs(e,t,r,i){var a=Xe();i=i===void 0?null:i;var f=void 0;if(ge!==null){var C=ge.memoizedState;if(f=C.destroy,i!==null&&Vo(i,C.deps)){a.memoizedState=yi(t,r,f,i);return}}he.flags|=e,a.memoizedState=yi(1|t,r,f,i)}function Xl(e,t){return Ji(8390656,8,e,t)}function Yo(e,t){return Bs(2048,8,e,t)}function qc(e,t){return Bs(4,2,e,t)}function Yc(e,t){return Bs(4,4,e,t)}function Xc(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 Qc(e,t,r){return r=r!=null?r.concat([e]):null,Bs(4,4,Xc.bind(null,t,e),r)}function Xo(){}function Zc(e,t){var r=Xe();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Vo(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Jc(e,t){var r=Xe();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Vo(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function eu(e,t,r){return Qt&21?(it(r,t)||(r=nc(),he.lanes|=r,Zt|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Pe=!0),e.memoizedState=r)}function Pd(e,t){var r=se;se=r!==0&&4>r?r:4,e(!0);var i=pn.transition;pn.transition={};try{e(!1),t()}finally{se=r,pn.transition=i}}function tu(){return Xe().memoizedState}function Bd(e,t,r){var i=Bt(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},ru(e))iu(t,r);else if(r=jc(e,t,r,i),r!==null){var a=De();rt(r,e,i,a),su(r,t,i)}}function Od(e,t,r){var i=Bt(e),a={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(ru(e))iu(t,a);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var C=t.lastRenderedState,o=f(C,r);if(a.hasEagerState=!0,a.eagerState=o,it(o,C)){var c=t.interleaved;c===null?(a.next=a,zo(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}r=jc(e,t,a,i),r!==null&&(a=De(),rt(r,e,i,a),su(r,t,i))}}function ru(e){var t=e.alternate;return e===he||t!==null&&t===he}function iu(e,t){ti=Cs=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function su(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Ro(e,r)}}var ws={readContext:Ye,useCallback:ke,useContext:ke,useEffect:ke,useImperativeHandle:ke,useInsertionEffect:ke,useLayoutEffect:ke,useMemo:ke,useReducer:ke,useRef:ke,useState:ke,useDebugValue:ke,useDeferredValue:ke,useTransition:ke,useMutableSource:ke,useSyncExternalStore:ke,useId:ke,unstable_isNewReconciler:!1},jd={readContext:Ye,useCallback:function(e,t){return ot().memoizedState=[e,t===void 0?null:t],e},useContext:Ye,useEffect:Xl,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ji(4194308,4,Xc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ji(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ji(4,2,e,t)},useMemo:function(e,t){var r=ot();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=ot();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Bd.bind(null,he,e),[i.memoizedState,e]},useRef:function(e){var t=ot();return e={current:e},t.memoizedState=e},useState:Yl,useDebugValue:Xo,useDeferredValue:function(e){return ot().memoizedState=e},useTransition:function(){var e=Yl(!1),t=e[0];return e=Pd.bind(null,e[1]),ot().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=he,a=ot();if(ae){if(r===void 0)throw Error(G(407));r=r()}else{if(r=t(),ye===null)throw Error(G(349));Qt&30||Wc(i,t,r)}a.memoizedState=r;var f={value:r,getSnapshot:t};return a.queue=f,Xl($c.bind(null,i,f,e),[e]),i.flags|=2048,yi(9,Uc.bind(null,i,f,r,t),void 0,null),r},useId:function(){var e=ot(),t=ye.identifierPrefix;if(ae){var r=ft,i=dt;r=(i&~(1<<32-tt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=mi++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Md++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Hd={readContext:Ye,useCallback:Zc,useContext:Ye,useEffect:Yo,useImperativeHandle:Qc,useInsertionEffect:qc,useLayoutEffect:Yc,useMemo:Jc,useReducer:_n,useRef:Gc,useState:function(){return _n(Si)},useDebugValue:Xo,useDeferredValue:function(e){var t=Xe();return eu(t,ge.memoizedState,e)},useTransition:function(){var e=_n(Si)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:Fc,useSyncExternalStore:zc,useId:tu,unstable_isNewReconciler:!1},Nd={readContext:Ye,useCallback:Zc,useContext:Ye,useEffect:Yo,useImperativeHandle:Qc,useInsertionEffect:qc,useLayoutEffect:Yc,useMemo:Jc,useReducer:vn,useRef:Gc,useState:function(){return vn(Si)},useDebugValue:Xo,useDeferredValue:function(e){var t=Xe();return ge===null?t.memoizedState=e:eu(t,ge.memoizedState,e)},useTransition:function(){var e=vn(Si)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:Fc,useSyncExternalStore:zc,useId:tu,unstable_isNewReconciler:!1};function Ze(e,t){if(e&&e.defaultProps){t=de({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Zn(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:de({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Os={isMounted:function(e){return(e=e._reactInternals)?tr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=De(),a=Bt(e),f=pt(i,a);f.payload=t,r!=null&&(f.callback=r),t=Mt(e,f,a),t!==null&&(rt(t,e,a,i),Qi(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=De(),a=Bt(e),f=pt(i,a);f.tag=1,f.payload=t,r!=null&&(f.callback=r),t=Mt(e,f,a),t!==null&&(rt(t,e,a,i),Qi(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=De(),i=Bt(e),a=pt(r,i);a.tag=2,t!=null&&(a.callback=t),t=Mt(e,a,i),t!==null&&(rt(t,e,i,r),Qi(t,e,i))}};function Ql(e,t,r,i,a,f,C){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,C):t.prototype&&t.prototype.isPureReactComponent?!di(r,i)||!di(a,f):!0}function nu(e,t,r){var i=!1,a=Ht,f=t.contextType;return typeof f=="object"&&f!==null?f=Ye(f):(a=Oe(t)?Yt:Re.current,i=t.contextTypes,f=(i=i!=null)?xr(e,a):Ht),t=new t(r,f),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Os,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=f),t}function Zl(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&Os.enqueueReplaceState(t,t.state,null)}function Jn(e,t,r,i){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},Wo(e);var f=t.contextType;typeof f=="object"&&f!==null?a.context=Ye(f):(f=Oe(t)?Yt:Re.current,a.context=xr(e,f)),a.state=e.memoizedState,f=t.getDerivedStateFromProps,typeof f=="function"&&(Zn(e,t,f,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Os.enqueueReplaceState(a,a.state,null),Ss(e,r,a,i),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Rr(e,t){try{var r="",i=t;do r+=fh(i),i=i.return;while(i);var a=r}catch(f){a=`
|
|
37
|
+
`+a[C].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=C&&0<=o);break}}}finally{Xs=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Vr(e):""}function ph(e){switch(e.tag){case 5:return Vr(e.type);case 16:return Vr("Lazy");case 13:return Vr("Suspense");case 19:return Vr("SuspenseList");case 0:case 2:case 15:return e=Qs(e.type,!1),e;case 11:return e=Qs(e.type.render,!1),e;case 1:return e=Qs(e.type,!0),e;default:return""}}function Rn(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 nr:return"Fragment";case sr:return"Portal";case kn:return"Profiler";case xo:return"StrictMode";case bn:return"Suspense";case En:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Na:return(e.displayName||"Context")+".Consumer";case Ha:return(e._context.displayName||"Context")+".Provider";case ko:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case bo:return t=e.displayName||null,t!==null?t:Rn(e.type)||"Memo";case xt:t=e._payload,e=e._init;try{return Rn(e(t))}catch{}}return null}function _h(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 Rn(t);case 8:return t===xo?"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 jt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function za(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vh(e){var t=za(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(C){i=""+C,f.call(this,C)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(C){i=""+C},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ai(e){e._valueTracker||(e._valueTracker=vh(e))}function Wa(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=za(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function ss(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 Ln(e,t){var r=t.checked;return de({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function vl(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=jt(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ua(e,t){t=t.checked,t!=null&&wo(e,"checked",t,!1)}function Dn(e,t){Ua(e,t);var r=jt(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Tn(e,t.type,r):t.hasOwnProperty("defaultValue")&&Tn(e,t.type,jt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function gl(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="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 Tn(e,t,r){(t!=="number"||ss(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Gr=Array.isArray;function vr(e,t,r,i){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&i&&(e[r].defaultSelected=!0)}else{for(r=""+jt(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,i&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function An(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return de({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ml(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(G(92));if(Gr(r)){if(1<r.length)throw Error(G(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:jt(r)}}function $a(e,t){var r=jt(t.value),i=jt(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function Sl(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ka(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 In(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ka(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ii,Va=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ii=Ii||document.createElement("div"),Ii.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ii.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function oi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Xr={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},gh=["Webkit","ms","Moz","O"];Object.keys(Xr).forEach(function(e){gh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xr[t]=Xr[e]})});function Ga(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Xr.hasOwnProperty(e)&&Xr[e]?(""+t).trim():t+"px"}function qa(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,a=Ga(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,a):e[r]=a}}var mh=de({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 Mn(e,t){if(t){if(mh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function Pn(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 Bn=null;function Eo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var On=null,gr=null,mr=null;function yl(e){if(e=bi(e)){if(typeof On!="function")throw Error(G(280));var t=e.stateNode;t&&(t=Ms(t),On(e.stateNode,e.type,t))}}function Ya(e){gr?mr?mr.push(e):mr=[e]:gr=e}function Xa(){if(gr){var e=gr,t=mr;if(mr=gr=null,yl(e),t)for(e=0;e<t.length;e++)yl(t[e])}}function Qa(e,t){return e(t)}function Za(){}var Zs=!1;function Ja(e,t,r){if(Zs)return e(t,r);Zs=!0;try{return Qa(e,t,r)}finally{Zs=!1,(gr!==null||mr!==null)&&(Za(),Xa())}}function li(e,t){var r=e.stateNode;if(r===null)return null;var i=Ms(r);if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(G(231,t,typeof r));return r}var jn=!1;if(_t)try{var jr={};Object.defineProperty(jr,"passive",{get:function(){jn=!0}}),window.addEventListener("test",jr,jr),window.removeEventListener("test",jr,jr)}catch{jn=!1}function Sh(e,t,r,i,a,f,C,o,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(S){this.onError(S)}}var Qr=!1,ns=null,os=!1,Hn=null,yh={onError:function(e){Qr=!0,ns=e}};function Ch(e,t,r,i,a,f,C,o,c){Qr=!1,ns=null,Sh.apply(yh,arguments)}function wh(e,t,r,i,a,f,C,o,c){if(Ch.apply(this,arguments),Qr){if(Qr){var d=ns;Qr=!1,ns=null}else throw Error(G(198));os||(os=!0,Hn=d)}}function tr(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 ec(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 Cl(e){if(tr(e)!==e)throw Error(G(188))}function xh(e){var t=e.alternate;if(!t){if(t=tr(e),t===null)throw Error(G(188));return t!==e?null:e}for(var r=e,i=t;;){var a=r.return;if(a===null)break;var f=a.alternate;if(f===null){if(i=a.return,i!==null){r=i;continue}break}if(a.child===f.child){for(f=a.child;f;){if(f===r)return Cl(a),e;if(f===i)return Cl(a),t;f=f.sibling}throw Error(G(188))}if(r.return!==i.return)r=a,i=f;else{for(var C=!1,o=a.child;o;){if(o===r){C=!0,r=a,i=f;break}if(o===i){C=!0,i=a,r=f;break}o=o.sibling}if(!C){for(o=f.child;o;){if(o===r){C=!0,r=f,i=a;break}if(o===i){C=!0,i=f,r=a;break}o=o.sibling}if(!C)throw Error(G(189))}}if(r.alternate!==i)throw Error(G(190))}if(r.tag!==3)throw Error(G(188));return r.stateNode.current===r?e:t}function tc(e){return e=xh(e),e!==null?rc(e):null}function rc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=rc(e);if(t!==null)return t;e=e.sibling}return null}var ic=ze.unstable_scheduleCallback,wl=ze.unstable_cancelCallback,kh=ze.unstable_shouldYield,bh=ze.unstable_requestPaint,_e=ze.unstable_now,Eh=ze.unstable_getCurrentPriorityLevel,Ro=ze.unstable_ImmediatePriority,sc=ze.unstable_UserBlockingPriority,ls=ze.unstable_NormalPriority,Rh=ze.unstable_LowPriority,nc=ze.unstable_IdlePriority,Ds=null,at=null;function Lh(e){if(at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(Ds,e,void 0,(e.current.flags&128)===128)}catch{}}var tt=Math.clz32?Math.clz32:Ah,Dh=Math.log,Th=Math.LN2;function Ah(e){return e>>>=0,e===0?32:31-(Dh(e)/Th|0)|0}var Mi=64,Pi=4194304;function qr(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 as(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,f=e.pingedLanes,C=r&268435455;if(C!==0){var o=C&~a;o!==0?i=qr(o):(f&=C,f!==0&&(i=qr(f)))}else C=r&~a,C!==0?i=qr(C):f!==0&&(i=qr(f));if(i===0)return 0;if(t!==0&&t!==i&&!(t&a)&&(a=i&-i,f=t&-t,a>=f||a===16&&(f&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-tt(t),a=1<<r,i|=e[r],t&=~a;return i}function Ih(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 Mh(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,f=e.pendingLanes;0<f;){var C=31-tt(f),o=1<<C,c=a[C];c===-1?(!(o&r)||o&i)&&(a[C]=Ih(o,t)):c<=t&&(e.expiredLanes|=o),f&=~o}}function Nn(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function oc(){var e=Mi;return Mi<<=1,!(Mi&4194240)&&(Mi=64),e}function Js(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function xi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-tt(t),e[t]=r}function Ph(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 i=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-tt(r),f=1<<a;t[a]=0,i[a]=-1,e[a]=-1,r&=~f}}function Lo(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-tt(r),a=1<<i;a&t|e[i]&t&&(e[i]|=t),r&=~a}}var se=0;function lc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var ac,Do,cc,uc,hc,Fn=!1,Bi=[],Dt=null,Tt=null,At=null,ai=new Map,ci=new Map,bt=[],Bh="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 xl(e,t){switch(e){case"focusin":case"focusout":Dt=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":At=null;break;case"pointerover":case"pointerout":ai.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ci.delete(t.pointerId)}}function Hr(e,t,r,i,a,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:f,targetContainers:[a]},t!==null&&(t=bi(t),t!==null&&Do(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Oh(e,t,r,i,a){switch(t){case"focusin":return Dt=Hr(Dt,e,t,r,i,a),!0;case"dragenter":return Tt=Hr(Tt,e,t,r,i,a),!0;case"mouseover":return At=Hr(At,e,t,r,i,a),!0;case"pointerover":var f=a.pointerId;return ai.set(f,Hr(ai.get(f)||null,e,t,r,i,a)),!0;case"gotpointercapture":return f=a.pointerId,ci.set(f,Hr(ci.get(f)||null,e,t,r,i,a)),!0}return!1}function dc(e){var t=$t(e.target);if(t!==null){var r=tr(t);if(r!==null){if(t=r.tag,t===13){if(t=ec(r),t!==null){e.blockedOn=t,hc(e.priority,function(){cc(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 qi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=zn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);Bn=i,r.target.dispatchEvent(i),Bn=null}else return t=bi(r),t!==null&&Do(t),e.blockedOn=r,!1;t.shift()}return!0}function kl(e,t,r){qi(e)&&r.delete(t)}function jh(){Fn=!1,Dt!==null&&qi(Dt)&&(Dt=null),Tt!==null&&qi(Tt)&&(Tt=null),At!==null&&qi(At)&&(At=null),ai.forEach(kl),ci.forEach(kl)}function Nr(e,t){e.blockedOn===t&&(e.blockedOn=null,Fn||(Fn=!0,ze.unstable_scheduleCallback(ze.unstable_NormalPriority,jh)))}function ui(e){function t(a){return Nr(a,e)}if(0<Bi.length){Nr(Bi[0],e);for(var r=1;r<Bi.length;r++){var i=Bi[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Dt!==null&&Nr(Dt,e),Tt!==null&&Nr(Tt,e),At!==null&&Nr(At,e),ai.forEach(t),ci.forEach(t),r=0;r<bt.length;r++)i=bt[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<bt.length&&(r=bt[0],r.blockedOn===null);)dc(r),r.blockedOn===null&&bt.shift()}var Sr=St.ReactCurrentBatchConfig,cs=!0;function Hh(e,t,r,i){var a=se,f=Sr.transition;Sr.transition=null;try{se=1,To(e,t,r,i)}finally{se=a,Sr.transition=f}}function Nh(e,t,r,i){var a=se,f=Sr.transition;Sr.transition=null;try{se=4,To(e,t,r,i)}finally{se=a,Sr.transition=f}}function To(e,t,r,i){if(cs){var a=zn(e,t,r,i);if(a===null)un(e,t,i,us,r),xl(e,i);else if(Oh(a,e,t,r,i))i.stopPropagation();else if(xl(e,i),t&4&&-1<Bh.indexOf(e)){for(;a!==null;){var f=bi(a);if(f!==null&&ac(f),f=zn(e,t,r,i),f===null&&un(e,t,i,us,r),f===a)break;a=f}a!==null&&i.stopPropagation()}else un(e,t,i,null,r)}}var us=null;function zn(e,t,r,i){if(us=null,e=Eo(i),e=$t(e),e!==null)if(t=tr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=ec(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 us=e,null}function fc(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(Eh()){case Ro:return 1;case sc:return 4;case ls:case Rh:return 16;case nc:return 536870912;default:return 16}default:return 16}}var Rt=null,Ao=null,Yi=null;function pc(){if(Yi)return Yi;var e,t=Ao,r=t.length,i,a="value"in Rt?Rt.value:Rt.textContent,f=a.length;for(e=0;e<r&&t[e]===a[e];e++);var C=r-e;for(i=1;i<=C&&t[r-i]===a[f-i];i++);return Yi=a.slice(e,1<i?1-i:void 0)}function Xi(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 Oi(){return!0}function bl(){return!1}function Ue(e){function t(r,i,a,f,C){this._reactName=r,this._targetInst=a,this.type=i,this.nativeEvent=f,this.target=C,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(r=e[o],this[o]=r?r(f):f[o]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Oi:bl,this.isPropagationStopped=bl,this}return de(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=Oi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Oi)},persist:function(){},isPersistent:Oi}),t}var Tr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Io=Ue(Tr),ki=de({},Tr,{view:0,detail:0}),Fh=Ue(ki),en,tn,Fr,Ts=de({},ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mo,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!==Fr&&(Fr&&e.type==="mousemove"?(en=e.screenX-Fr.screenX,tn=e.screenY-Fr.screenY):tn=en=0,Fr=e),en)},movementY:function(e){return"movementY"in e?e.movementY:tn}}),El=Ue(Ts),zh=de({},Ts,{dataTransfer:0}),Wh=Ue(zh),Uh=de({},ki,{relatedTarget:0}),rn=Ue(Uh),$h=de({},Tr,{animationName:0,elapsedTime:0,pseudoElement:0}),Kh=Ue($h),Vh=de({},Tr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Gh=Ue(Vh),qh=de({},Tr,{data:0}),Rl=Ue(qh),Yh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xh={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"},Qh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qh[e])?!!t[e]:!1}function Mo(){return Zh}var Jh=de({},ki,{key:function(e){if(e.key){var t=Yh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Xi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Xh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mo,charCode:function(e){return e.type==="keypress"?Xi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ed=Ue(Jh),td=de({},Ts,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ll=Ue(td),rd=de({},ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mo}),id=Ue(rd),sd=de({},Tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),nd=Ue(sd),od=de({},Ts,{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}),ld=Ue(od),ad=[9,13,27,32],Po=_t&&"CompositionEvent"in window,Zr=null;_t&&"documentMode"in document&&(Zr=document.documentMode);var cd=_t&&"TextEvent"in window&&!Zr,_c=_t&&(!Po||Zr&&8<Zr&&11>=Zr),Dl=" ",Tl=!1;function vc(e,t){switch(e){case"keyup":return ad.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var or=!1;function ud(e,t){switch(e){case"compositionend":return gc(t);case"keypress":return t.which!==32?null:(Tl=!0,Dl);case"textInput":return e=t.data,e===Dl&&Tl?null:e;default:return null}}function hd(e,t){if(or)return e==="compositionend"||!Po&&vc(e,t)?(e=pc(),Yi=Ao=Rt=null,or=!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 _c&&t.locale!=="ko"?null:t.data;default:return null}}var dd={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 Al(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dd[e.type]:t==="textarea"}function mc(e,t,r,i){Ya(i),t=hs(t,"onChange"),0<t.length&&(r=new Io("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var Jr=null,hi=null;function fd(e){Dc(e,0)}function As(e){var t=cr(e);if(Wa(t))return e}function pd(e,t){if(e==="change")return t}var Sc=!1;if(_t){var sn;if(_t){var nn="oninput"in document;if(!nn){var Il=document.createElement("div");Il.setAttribute("oninput","return;"),nn=typeof Il.oninput=="function"}sn=nn}else sn=!1;Sc=sn&&(!document.documentMode||9<document.documentMode)}function Ml(){Jr&&(Jr.detachEvent("onpropertychange",yc),hi=Jr=null)}function yc(e){if(e.propertyName==="value"&&As(hi)){var t=[];mc(t,hi,e,Eo(e)),Ja(fd,t)}}function _d(e,t,r){e==="focusin"?(Ml(),Jr=t,hi=r,Jr.attachEvent("onpropertychange",yc)):e==="focusout"&&Ml()}function vd(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return As(hi)}function gd(e,t){if(e==="click")return As(t)}function md(e,t){if(e==="input"||e==="change")return As(t)}function Sd(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var it=typeof Object.is=="function"?Object.is:Sd;function di(e,t){if(it(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var a=r[i];if(!xn.call(t,a)||!it(e[a],t[a]))return!1}return!0}function Pl(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bl(e,t){var r=Pl(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Pl(r)}}function Cc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wc(){for(var e=window,t=ss();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ss(e.document)}return t}function Bo(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 yd(e){var t=wc(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Cc(r.ownerDocument.documentElement,r)){if(i!==null&&Bo(r)){if(t=i.start,e=i.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 a=r.textContent.length,f=Math.min(i.start,a);i=i.end===void 0?f:Math.min(i.end,a),!e.extend&&f>i&&(a=i,i=f,f=a),a=Bl(r,f);var C=Bl(r,i);a&&C&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==C.node||e.focusOffset!==C.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),f>i?(e.addRange(t),e.extend(C.node,C.offset)):(t.setEnd(C.node,C.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 Cd=_t&&"documentMode"in document&&11>=document.documentMode,lr=null,Wn=null,ei=null,Un=!1;function Ol(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Un||lr==null||lr!==ss(i)||(i=lr,"selectionStart"in i&&Bo(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ei&&di(ei,i)||(ei=i,i=hs(Wn,"onSelect"),0<i.length&&(t=new Io("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=lr)))}function ji(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ar={animationend:ji("Animation","AnimationEnd"),animationiteration:ji("Animation","AnimationIteration"),animationstart:ji("Animation","AnimationStart"),transitionend:ji("Transition","TransitionEnd")},on={},xc={};_t&&(xc=document.createElement("div").style,"AnimationEvent"in window||(delete ar.animationend.animation,delete ar.animationiteration.animation,delete ar.animationstart.animation),"TransitionEvent"in window||delete ar.transitionend.transition);function Is(e){if(on[e])return on[e];if(!ar[e])return e;var t=ar[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in xc)return on[e]=t[r];return e}var kc=Is("animationend"),bc=Is("animationiteration"),Ec=Is("animationstart"),Rc=Is("transitionend"),Lc=new Map,jl="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 Nt(e,t){Lc.set(e,t),er(t,[e])}for(var ln=0;ln<jl.length;ln++){var an=jl[ln],wd=an.toLowerCase(),xd=an[0].toUpperCase()+an.slice(1);Nt(wd,"on"+xd)}Nt(kc,"onAnimationEnd");Nt(bc,"onAnimationIteration");Nt(Ec,"onAnimationStart");Nt("dblclick","onDoubleClick");Nt("focusin","onFocus");Nt("focusout","onBlur");Nt(Rc,"onTransitionEnd");wr("onMouseEnter",["mouseout","mouseover"]);wr("onMouseLeave",["mouseout","mouseover"]);wr("onPointerEnter",["pointerout","pointerover"]);wr("onPointerLeave",["pointerout","pointerover"]);er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));er("onBeforeInput",["compositionend","keypress","textInput","paste"]);er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yr="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(" "),kd=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yr));function Hl(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,wh(i,t,void 0,e),e.currentTarget=null}function Dc(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],a=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var C=i.length-1;0<=C;C--){var o=i[C],c=o.instance,d=o.currentTarget;if(o=o.listener,c!==f&&a.isPropagationStopped())break e;Hl(a,o,d),f=c}else for(C=0;C<i.length;C++){if(o=i[C],c=o.instance,d=o.currentTarget,o=o.listener,c!==f&&a.isPropagationStopped())break e;Hl(a,o,d),f=c}}}if(os)throw e=Hn,os=!1,Hn=null,e}function oe(e,t){var r=t[qn];r===void 0&&(r=t[qn]=new Set);var i=e+"__bubble";r.has(i)||(Tc(t,e,2,!1),r.add(i))}function cn(e,t,r){var i=0;t&&(i|=4),Tc(r,e,i,t)}var Hi="_reactListening"+Math.random().toString(36).slice(2);function fi(e){if(!e[Hi]){e[Hi]=!0,ja.forEach(function(r){r!=="selectionchange"&&(kd.has(r)||cn(r,!1,e),cn(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hi]||(t[Hi]=!0,cn("selectionchange",!1,t))}}function Tc(e,t,r,i){switch(fc(t)){case 1:var a=Hh;break;case 4:a=Nh;break;default:a=To}r=a.bind(null,t,r,e),a=void 0,!jn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),i?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function un(e,t,r,i,a){var f=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var C=i.tag;if(C===3||C===4){var o=i.stateNode.containerInfo;if(o===a||o.nodeType===8&&o.parentNode===a)break;if(C===4)for(C=i.return;C!==null;){var c=C.tag;if((c===3||c===4)&&(c=C.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;C=C.return}for(;o!==null;){if(C=$t(o),C===null)return;if(c=C.tag,c===5||c===6){i=f=C;continue e}o=o.parentNode}}i=i.return}Ja(function(){var d=f,S=Eo(r),h=[];e:{var _=Lc.get(e);if(_!==void 0){var g=Io,x=e;switch(e){case"keypress":if(Xi(r)===0)break e;case"keydown":case"keyup":g=ed;break;case"focusin":x="focus",g=rn;break;case"focusout":x="blur",g=rn;break;case"beforeblur":case"afterblur":g=rn;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":g=El;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=Wh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=id;break;case kc:case bc:case Ec:g=Kh;break;case Rc:g=nd;break;case"scroll":g=Fh;break;case"wheel":g=ld;break;case"copy":case"cut":case"paste":g=Gh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Ll}var v=(t&4)!==0,u=!v&&e==="scroll",l=v?_!==null?_+"Capture":null:_;v=[];for(var s=d,n;s!==null;){n=s;var p=n.stateNode;if(n.tag===5&&p!==null&&(n=p,l!==null&&(p=li(s,l),p!=null&&v.push(pi(s,p,n)))),u)break;s=s.return}0<v.length&&(_=new g(_,x,null,r,S),h.push({event:_,listeners:v}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",_&&r!==Bn&&(x=r.relatedTarget||r.fromElement)&&($t(x)||x[vt]))break e;if((g||_)&&(_=S.window===S?S:(_=S.ownerDocument)?_.defaultView||_.parentWindow:window,g?(x=r.relatedTarget||r.toElement,g=d,x=x?$t(x):null,x!==null&&(u=tr(x),x!==u||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=d),g!==x)){if(v=El,p="onMouseLeave",l="onMouseEnter",s="mouse",(e==="pointerout"||e==="pointerover")&&(v=Ll,p="onPointerLeave",l="onPointerEnter",s="pointer"),u=g==null?_:cr(g),n=x==null?_:cr(x),_=new v(p,s+"leave",g,r,S),_.target=u,_.relatedTarget=n,p=null,$t(S)===d&&(v=new v(l,s+"enter",x,r,S),v.target=n,v.relatedTarget=u,p=v),u=p,g&&x)t:{for(v=g,l=x,s=0,n=v;n;n=rr(n))s++;for(n=0,p=l;p;p=rr(p))n++;for(;0<s-n;)v=rr(v),s--;for(;0<n-s;)l=rr(l),n--;for(;s--;){if(v===l||l!==null&&v===l.alternate)break t;v=rr(v),l=rr(l)}v=null}else v=null;g!==null&&Nl(h,_,g,v,!1),x!==null&&u!==null&&Nl(h,u,x,v,!0)}}e:{if(_=d?cr(d):window,g=_.nodeName&&_.nodeName.toLowerCase(),g==="select"||g==="input"&&_.type==="file")var w=pd;else if(Al(_))if(Sc)w=md;else{w=vd;var y=_d}else(g=_.nodeName)&&g.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(w=gd);if(w&&(w=w(e,d))){mc(h,w,r,S);break e}y&&y(e,_,d),e==="focusout"&&(y=_._wrapperState)&&y.controlled&&_.type==="number"&&Tn(_,"number",_.value)}switch(y=d?cr(d):window,e){case"focusin":(Al(y)||y.contentEditable==="true")&&(lr=y,Wn=d,ei=null);break;case"focusout":ei=Wn=lr=null;break;case"mousedown":Un=!0;break;case"contextmenu":case"mouseup":case"dragend":Un=!1,Ol(h,r,S);break;case"selectionchange":if(Cd)break;case"keydown":case"keyup":Ol(h,r,S)}var k;if(Po)e:{switch(e){case"compositionstart":var m="onCompositionStart";break e;case"compositionend":m="onCompositionEnd";break e;case"compositionupdate":m="onCompositionUpdate";break e}m=void 0}else or?vc(e,r)&&(m="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(m="onCompositionStart");m&&(_c&&r.locale!=="ko"&&(or||m!=="onCompositionStart"?m==="onCompositionEnd"&&or&&(k=pc()):(Rt=S,Ao="value"in Rt?Rt.value:Rt.textContent,or=!0)),y=hs(d,m),0<y.length&&(m=new Rl(m,e,null,r,S),h.push({event:m,listeners:y}),k?m.data=k:(k=gc(r),k!==null&&(m.data=k)))),(k=cd?ud(e,r):hd(e,r))&&(d=hs(d,"onBeforeInput"),0<d.length&&(S=new Rl("onBeforeInput","beforeinput",null,r,S),h.push({event:S,listeners:d}),S.data=k))}Dc(h,t)})}function pi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function hs(e,t){for(var r=t+"Capture",i=[];e!==null;){var a=e,f=a.stateNode;a.tag===5&&f!==null&&(a=f,f=li(e,r),f!=null&&i.unshift(pi(e,f,a)),f=li(e,t),f!=null&&i.push(pi(e,f,a))),e=e.return}return i}function rr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Nl(e,t,r,i,a){for(var f=t._reactName,C=[];r!==null&&r!==i;){var o=r,c=o.alternate,d=o.stateNode;if(c!==null&&c===i)break;o.tag===5&&d!==null&&(o=d,a?(c=li(r,f),c!=null&&C.unshift(pi(r,c,o))):a||(c=li(r,f),c!=null&&C.push(pi(r,c,o)))),r=r.return}C.length!==0&&e.push({event:t,listeners:C})}var bd=/\r\n?/g,Ed=/\u0000|\uFFFD/g;function Fl(e){return(typeof e=="string"?e:""+e).replace(bd,`
|
|
38
|
+
`).replace(Ed,"")}function Ni(e,t,r){if(t=Fl(t),Fl(e)!==t&&r)throw Error(G(425))}function ds(){}var $n=null,Kn=null;function Vn(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 Gn=typeof setTimeout=="function"?setTimeout:void 0,Rd=typeof clearTimeout=="function"?clearTimeout:void 0,zl=typeof Promise=="function"?Promise:void 0,Ld=typeof queueMicrotask=="function"?queueMicrotask:typeof zl<"u"?function(e){return zl.resolve(null).then(e).catch(Dd)}:Gn;function Dd(e){setTimeout(function(){throw e})}function hn(e,t){var r=t,i=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(i===0){e.removeChild(a),ui(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=a}while(r);ui(t)}function It(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 Wl(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 Ar=Math.random().toString(36).slice(2),lt="__reactFiber$"+Ar,_i="__reactProps$"+Ar,vt="__reactContainer$"+Ar,qn="__reactEvents$"+Ar,Td="__reactListeners$"+Ar,Ad="__reactHandles$"+Ar;function $t(e){var t=e[lt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[vt]||r[lt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Wl(e);e!==null;){if(r=e[lt])return r;e=Wl(e)}return t}e=r,r=e.parentNode}return null}function bi(e){return e=e[lt]||e[vt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function cr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function Ms(e){return e[_i]||null}var Yn=[],ur=-1;function Ft(e){return{current:e}}function le(e){0>ur||(e.current=Yn[ur],Yn[ur]=null,ur--)}function ne(e,t){ur++,Yn[ur]=e.current,e.current=t}var Ht={},Re=Ft(Ht),Be=Ft(!1),Yt=Ht;function xr(e,t){var r=e.type.contextTypes;if(!r)return Ht;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var a={},f;for(f in r)a[f]=t[f];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Oe(e){return e=e.childContextTypes,e!=null}function fs(){le(Be),le(Re)}function Ul(e,t,r){if(Re.current!==Ht)throw Error(G(168));ne(Re,t),ne(Be,r)}function Ac(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var a in i)if(!(a in t))throw Error(G(108,_h(e)||"Unknown",a));return de({},r,i)}function ps(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ht,Yt=Re.current,ne(Re,e),ne(Be,Be.current),!0}function $l(e,t,r){var i=e.stateNode;if(!i)throw Error(G(169));r?(e=Ac(e,t,Yt),i.__reactInternalMemoizedMergedChildContext=e,le(Be),le(Re),ne(Re,e)):le(Be),ne(Be,r)}var ht=null,Ps=!1,dn=!1;function Ic(e){ht===null?ht=[e]:ht.push(e)}function Id(e){Ps=!0,Ic(e)}function zt(){if(!dn&&ht!==null){dn=!0;var e=0,t=se;try{var r=ht;for(se=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}ht=null,Ps=!1}catch(a){throw ht!==null&&(ht=ht.slice(e+1)),ic(Ro,zt),a}finally{se=t,dn=!1}}return null}var hr=[],dr=0,_s=null,vs=0,Ke=[],Ve=0,Xt=null,dt=1,ft="";function Wt(e,t){hr[dr++]=vs,hr[dr++]=_s,_s=e,vs=t}function Mc(e,t,r){Ke[Ve++]=dt,Ke[Ve++]=ft,Ke[Ve++]=Xt,Xt=e;var i=dt;e=ft;var a=32-tt(i)-1;i&=~(1<<a),r+=1;var f=32-tt(t)+a;if(30<f){var C=a-a%5;f=(i&(1<<C)-1).toString(32),i>>=C,a-=C,dt=1<<32-tt(t)+a|r<<a|i,ft=f+e}else dt=1<<f|r<<a|i,ft=e}function Oo(e){e.return!==null&&(Wt(e,1),Mc(e,1,0))}function jo(e){for(;e===_s;)_s=hr[--dr],hr[dr]=null,vs=hr[--dr],hr[dr]=null;for(;e===Xt;)Xt=Ke[--Ve],Ke[Ve]=null,ft=Ke[--Ve],Ke[Ve]=null,dt=Ke[--Ve],Ke[Ve]=null}var Fe=null,Ne=null,ae=!1,et=null;function Pc(e,t){var r=Ge(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 Kl(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,Fe=e,Ne=It(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Fe=e,Ne=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Xt!==null?{id:dt,overflow:ft}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Ge(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Fe=e,Ne=null,!0):!1;default:return!1}}function Xn(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Qn(e){if(ae){var t=Ne;if(t){var r=t;if(!Kl(e,t)){if(Xn(e))throw Error(G(418));t=It(r.nextSibling);var i=Fe;t&&Kl(e,t)?Pc(i,r):(e.flags=e.flags&-4097|2,ae=!1,Fe=e)}}else{if(Xn(e))throw Error(G(418));e.flags=e.flags&-4097|2,ae=!1,Fe=e}}}function Vl(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fe=e}function Fi(e){if(e!==Fe)return!1;if(!ae)return Vl(e),ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Vn(e.type,e.memoizedProps)),t&&(t=Ne)){if(Xn(e))throw Bc(),Error(G(418));for(;t;)Pc(e,t),t=It(t.nextSibling)}if(Vl(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Ne=It(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Ne=null}}else Ne=Fe?It(e.stateNode.nextSibling):null;return!0}function Bc(){for(var e=Ne;e;)e=It(e.nextSibling)}function kr(){Ne=Fe=null,ae=!1}function Ho(e){et===null?et=[e]:et.push(e)}var Md=St.ReactCurrentBatchConfig;function zr(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(G(309));var i=r.stateNode}if(!i)throw Error(G(147,e));var a=i,f=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===f?t.ref:(t=function(C){var o=a.refs;C===null?delete o[f]:o[f]=C},t._stringRef=f,t)}if(typeof e!="string")throw Error(G(284));if(!r._owner)throw Error(G(290,e))}return e}function zi(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Gl(e){var t=e._init;return t(e._payload)}function Oc(e){function t(l,s){if(e){var n=l.deletions;n===null?(l.deletions=[s],l.flags|=16):n.push(s)}}function r(l,s){if(!e)return null;for(;s!==null;)t(l,s),s=s.sibling;return null}function i(l,s){for(l=new Map;s!==null;)s.key!==null?l.set(s.key,s):l.set(s.index,s),s=s.sibling;return l}function a(l,s){return l=Ot(l,s),l.index=0,l.sibling=null,l}function f(l,s,n){return l.index=n,e?(n=l.alternate,n!==null?(n=n.index,n<s?(l.flags|=2,s):n):(l.flags|=2,s)):(l.flags|=1048576,s)}function C(l){return e&&l.alternate===null&&(l.flags|=2),l}function o(l,s,n,p){return s===null||s.tag!==6?(s=Sn(n,l.mode,p),s.return=l,s):(s=a(s,n),s.return=l,s)}function c(l,s,n,p){var w=n.type;return w===nr?S(l,s,n.props.children,p,n.key):s!==null&&(s.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===xt&&Gl(w)===s.type)?(p=a(s,n.props),p.ref=zr(l,s,n),p.return=l,p):(p=is(n.type,n.key,n.props,null,l.mode,p),p.ref=zr(l,s,n),p.return=l,p)}function d(l,s,n,p){return s===null||s.tag!==4||s.stateNode.containerInfo!==n.containerInfo||s.stateNode.implementation!==n.implementation?(s=yn(n,l.mode,p),s.return=l,s):(s=a(s,n.children||[]),s.return=l,s)}function S(l,s,n,p,w){return s===null||s.tag!==7?(s=qt(n,l.mode,p,w),s.return=l,s):(s=a(s,n),s.return=l,s)}function h(l,s,n){if(typeof s=="string"&&s!==""||typeof s=="number")return s=Sn(""+s,l.mode,n),s.return=l,s;if(typeof s=="object"&&s!==null){switch(s.$$typeof){case Ti:return n=is(s.type,s.key,s.props,null,l.mode,n),n.ref=zr(l,null,s),n.return=l,n;case sr:return s=yn(s,l.mode,n),s.return=l,s;case xt:var p=s._init;return h(l,p(s._payload),n)}if(Gr(s)||Or(s))return s=qt(s,l.mode,n,null),s.return=l,s;zi(l,s)}return null}function _(l,s,n,p){var w=s!==null?s.key:null;if(typeof n=="string"&&n!==""||typeof n=="number")return w!==null?null:o(l,s,""+n,p);if(typeof n=="object"&&n!==null){switch(n.$$typeof){case Ti:return n.key===w?c(l,s,n,p):null;case sr:return n.key===w?d(l,s,n,p):null;case xt:return w=n._init,_(l,s,w(n._payload),p)}if(Gr(n)||Or(n))return w!==null?null:S(l,s,n,p,null);zi(l,n)}return null}function g(l,s,n,p,w){if(typeof p=="string"&&p!==""||typeof p=="number")return l=l.get(n)||null,o(s,l,""+p,w);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Ti:return l=l.get(p.key===null?n:p.key)||null,c(s,l,p,w);case sr:return l=l.get(p.key===null?n:p.key)||null,d(s,l,p,w);case xt:var y=p._init;return g(l,s,n,y(p._payload),w)}if(Gr(p)||Or(p))return l=l.get(n)||null,S(s,l,p,w,null);zi(s,p)}return null}function x(l,s,n,p){for(var w=null,y=null,k=s,m=s=0,b=null;k!==null&&m<n.length;m++){k.index>m?(b=k,k=null):b=k.sibling;var T=_(l,k,n[m],p);if(T===null){k===null&&(k=b);break}e&&k&&T.alternate===null&&t(l,k),s=f(T,s,m),y===null?w=T:y.sibling=T,y=T,k=b}if(m===n.length)return r(l,k),ae&&Wt(l,m),w;if(k===null){for(;m<n.length;m++)k=h(l,n[m],p),k!==null&&(s=f(k,s,m),y===null?w=k:y.sibling=k,y=k);return ae&&Wt(l,m),w}for(k=i(l,k);m<n.length;m++)b=g(k,l,m,n[m],p),b!==null&&(e&&b.alternate!==null&&k.delete(b.key===null?m:b.key),s=f(b,s,m),y===null?w=b:y.sibling=b,y=b);return e&&k.forEach(function(M){return t(l,M)}),ae&&Wt(l,m),w}function v(l,s,n,p){var w=Or(n);if(typeof w!="function")throw Error(G(150));if(n=w.call(n),n==null)throw Error(G(151));for(var y=w=null,k=s,m=s=0,b=null,T=n.next();k!==null&&!T.done;m++,T=n.next()){k.index>m?(b=k,k=null):b=k.sibling;var M=_(l,k,T.value,p);if(M===null){k===null&&(k=b);break}e&&k&&M.alternate===null&&t(l,k),s=f(M,s,m),y===null?w=M:y.sibling=M,y=M,k=b}if(T.done)return r(l,k),ae&&Wt(l,m),w;if(k===null){for(;!T.done;m++,T=n.next())T=h(l,T.value,p),T!==null&&(s=f(T,s,m),y===null?w=T:y.sibling=T,y=T);return ae&&Wt(l,m),w}for(k=i(l,k);!T.done;m++,T=n.next())T=g(k,l,m,T.value,p),T!==null&&(e&&T.alternate!==null&&k.delete(T.key===null?m:T.key),s=f(T,s,m),y===null?w=T:y.sibling=T,y=T);return e&&k.forEach(function(P){return t(l,P)}),ae&&Wt(l,m),w}function u(l,s,n,p){if(typeof n=="object"&&n!==null&&n.type===nr&&n.key===null&&(n=n.props.children),typeof n=="object"&&n!==null){switch(n.$$typeof){case Ti:e:{for(var w=n.key,y=s;y!==null;){if(y.key===w){if(w=n.type,w===nr){if(y.tag===7){r(l,y.sibling),s=a(y,n.props.children),s.return=l,l=s;break e}}else if(y.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===xt&&Gl(w)===y.type){r(l,y.sibling),s=a(y,n.props),s.ref=zr(l,y,n),s.return=l,l=s;break e}r(l,y);break}else t(l,y);y=y.sibling}n.type===nr?(s=qt(n.props.children,l.mode,p,n.key),s.return=l,l=s):(p=is(n.type,n.key,n.props,null,l.mode,p),p.ref=zr(l,s,n),p.return=l,l=p)}return C(l);case sr:e:{for(y=n.key;s!==null;){if(s.key===y)if(s.tag===4&&s.stateNode.containerInfo===n.containerInfo&&s.stateNode.implementation===n.implementation){r(l,s.sibling),s=a(s,n.children||[]),s.return=l,l=s;break e}else{r(l,s);break}else t(l,s);s=s.sibling}s=yn(n,l.mode,p),s.return=l,l=s}return C(l);case xt:return y=n._init,u(l,s,y(n._payload),p)}if(Gr(n))return x(l,s,n,p);if(Or(n))return v(l,s,n,p);zi(l,n)}return typeof n=="string"&&n!==""||typeof n=="number"?(n=""+n,s!==null&&s.tag===6?(r(l,s.sibling),s=a(s,n),s.return=l,l=s):(r(l,s),s=Sn(n,l.mode,p),s.return=l,l=s),C(l)):r(l,s)}return u}var br=Oc(!0),jc=Oc(!1),gs=Ft(null),ms=null,fr=null,No=null;function Fo(){No=fr=ms=null}function zo(e){var t=gs.current;le(gs),e._currentValue=t}function Zn(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function yr(e,t){ms=e,No=fr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Pe=!0),e.firstContext=null)}function Ye(e){var t=e._currentValue;if(No!==e)if(e={context:e,memoizedValue:t,next:null},fr===null){if(ms===null)throw Error(G(308));fr=e,ms.dependencies={lanes:0,firstContext:e}}else fr=fr.next=e;return t}var Kt=null;function Wo(e){Kt===null?Kt=[e]:Kt.push(e)}function Hc(e,t,r,i){var a=t.interleaved;return a===null?(r.next=r,Wo(t)):(r.next=a.next,a.next=r),t.interleaved=r,gt(e,i)}function gt(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 kt=!1;function Uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nc(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 pt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Mt(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,re&2){var a=i.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),i.pending=t,gt(e,r)}return a=i.interleaved,a===null?(t.next=t,Wo(i)):(t.next=a.next,a.next=t),i.interleaved=t,gt(e,r)}function Qi(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Lo(e,r)}}function ql(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var a=null,f=null;if(r=r.firstBaseUpdate,r!==null){do{var C={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};f===null?a=f=C:f=f.next=C,r=r.next}while(r!==null);f===null?a=f=t:f=f.next=t}else a=f=t;r={baseState:i.baseState,firstBaseUpdate:a,lastBaseUpdate:f,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ss(e,t,r,i){var a=e.updateQueue;kt=!1;var f=a.firstBaseUpdate,C=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var c=o,d=c.next;c.next=null,C===null?f=d:C.next=d,C=c;var S=e.alternate;S!==null&&(S=S.updateQueue,o=S.lastBaseUpdate,o!==C&&(o===null?S.firstBaseUpdate=d:o.next=d,S.lastBaseUpdate=c))}if(f!==null){var h=a.baseState;C=0,S=d=c=null,o=f;do{var _=o.lane,g=o.eventTime;if((i&_)===_){S!==null&&(S=S.next={eventTime:g,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var x=e,v=o;switch(_=t,g=r,v.tag){case 1:if(x=v.payload,typeof x=="function"){h=x.call(g,h,_);break e}h=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,_=typeof x=="function"?x.call(g,h,_):x,_==null)break e;h=de({},h,_);break e;case 2:kt=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,_=a.effects,_===null?a.effects=[o]:_.push(o))}else g={eventTime:g,lane:_,tag:o.tag,payload:o.payload,callback:o.callback,next:null},S===null?(d=S=g,c=h):S=S.next=g,C|=_;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;_=o,o=_.next,_.next=null,a.lastBaseUpdate=_,a.shared.pending=null}}while(!0);if(S===null&&(c=h),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=S,t=a.shared.interleaved,t!==null){a=t;do C|=a.lane,a=a.next;while(a!==t)}else f===null&&(a.shared.lanes=0);Zt|=C,e.lanes=C,e.memoizedState=h}}function Yl(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=r,typeof a!="function")throw Error(G(191,a));a.call(i)}}}var Ei={},ct=Ft(Ei),vi=Ft(Ei),gi=Ft(Ei);function Vt(e){if(e===Ei)throw Error(G(174));return e}function $o(e,t){switch(ne(gi,t),ne(vi,e),ne(ct,Ei),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:In(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=In(t,e)}le(ct),ne(ct,t)}function Er(){le(ct),le(vi),le(gi)}function Fc(e){Vt(gi.current);var t=Vt(ct.current),r=In(t,e.type);t!==r&&(ne(vi,e),ne(ct,r))}function Ko(e){vi.current===e&&(le(ct),le(vi))}var ue=Ft(0);function ys(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 fn=[];function Vo(){for(var e=0;e<fn.length;e++)fn[e]._workInProgressVersionPrimary=null;fn.length=0}var Zi=St.ReactCurrentDispatcher,pn=St.ReactCurrentBatchConfig,Qt=0,he=null,ge=null,Se=null,Cs=!1,ti=!1,mi=0,Pd=0;function ke(){throw Error(G(321))}function Go(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!it(e[r],t[r]))return!1;return!0}function qo(e,t,r,i,a,f){if(Qt=f,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Zi.current=e===null||e.memoizedState===null?Hd:Nd,e=r(i,a),ti){f=0;do{if(ti=!1,mi=0,25<=f)throw Error(G(301));f+=1,Se=ge=null,t.updateQueue=null,Zi.current=Fd,e=r(i,a)}while(ti)}if(Zi.current=ws,t=ge!==null&&ge.next!==null,Qt=0,Se=ge=he=null,Cs=!1,t)throw Error(G(300));return e}function Yo(){var e=mi!==0;return mi=0,e}function ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Se===null?he.memoizedState=Se=e:Se=Se.next=e,Se}function Xe(){if(ge===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=ge.next;var t=Se===null?he.memoizedState:Se.next;if(t!==null)Se=t,ge=e;else{if(e===null)throw Error(G(310));ge=e,e={memoizedState:ge.memoizedState,baseState:ge.baseState,baseQueue:ge.baseQueue,queue:ge.queue,next:null},Se===null?he.memoizedState=Se=e:Se=Se.next=e}return Se}function Si(e,t){return typeof t=="function"?t(e):t}function _n(e){var t=Xe(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var i=ge,a=i.baseQueue,f=r.pending;if(f!==null){if(a!==null){var C=a.next;a.next=f.next,f.next=C}i.baseQueue=a=f,r.pending=null}if(a!==null){f=a.next,i=i.baseState;var o=C=null,c=null,d=f;do{var S=d.lane;if((Qt&S)===S)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),i=d.hasEagerState?d.eagerState:e(i,d.action);else{var h={lane:S,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(o=c=h,C=i):c=c.next=h,he.lanes|=S,Zt|=S}d=d.next}while(d!==null&&d!==f);c===null?C=i:c.next=o,it(i,t.memoizedState)||(Pe=!0),t.memoizedState=i,t.baseState=C,t.baseQueue=c,r.lastRenderedState=i}if(e=r.interleaved,e!==null){a=e;do f=a.lane,he.lanes|=f,Zt|=f,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function vn(e){var t=Xe(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var i=r.dispatch,a=r.pending,f=t.memoizedState;if(a!==null){r.pending=null;var C=a=a.next;do f=e(f,C.action),C=C.next;while(C!==a);it(f,t.memoizedState)||(Pe=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),r.lastRenderedState=f}return[f,i]}function zc(){}function Wc(e,t){var r=he,i=Xe(),a=t(),f=!it(i.memoizedState,a);if(f&&(i.memoizedState=a,Pe=!0),i=i.queue,Xo(Kc.bind(null,r,i,e),[e]),i.getSnapshot!==t||f||Se!==null&&Se.memoizedState.tag&1){if(r.flags|=2048,yi(9,$c.bind(null,r,i,a,t),void 0,null),ye===null)throw Error(G(349));Qt&30||Uc(r,t,a)}return a}function Uc(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function $c(e,t,r,i){t.value=r,t.getSnapshot=i,Vc(t)&&Gc(e)}function Kc(e,t,r){return r(function(){Vc(t)&&Gc(e)})}function Vc(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!it(e,r)}catch{return!0}}function Gc(e){var t=gt(e,1);t!==null&&rt(t,e,1,-1)}function Xl(e){var t=ot();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:e},t.queue=e,e=e.dispatch=jd.bind(null,he,e),[t.memoizedState,e]}function yi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function qc(){return Xe().memoizedState}function Ji(e,t,r,i){var a=ot();he.flags|=e,a.memoizedState=yi(1|t,r,void 0,i===void 0?null:i)}function Bs(e,t,r,i){var a=Xe();i=i===void 0?null:i;var f=void 0;if(ge!==null){var C=ge.memoizedState;if(f=C.destroy,i!==null&&Go(i,C.deps)){a.memoizedState=yi(t,r,f,i);return}}he.flags|=e,a.memoizedState=yi(1|t,r,f,i)}function Ql(e,t){return Ji(8390656,8,e,t)}function Xo(e,t){return Bs(2048,8,e,t)}function Yc(e,t){return Bs(4,2,e,t)}function Xc(e,t){return Bs(4,4,e,t)}function Qc(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 Zc(e,t,r){return r=r!=null?r.concat([e]):null,Bs(4,4,Qc.bind(null,t,e),r)}function Qo(){}function Jc(e,t){var r=Xe();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Go(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function eu(e,t){var r=Xe();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Go(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function tu(e,t,r){return Qt&21?(it(r,t)||(r=oc(),he.lanes|=r,Zt|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Pe=!0),e.memoizedState=r)}function Bd(e,t){var r=se;se=r!==0&&4>r?r:4,e(!0);var i=pn.transition;pn.transition={};try{e(!1),t()}finally{se=r,pn.transition=i}}function ru(){return Xe().memoizedState}function Od(e,t,r){var i=Bt(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},iu(e))su(t,r);else if(r=Hc(e,t,r,i),r!==null){var a=De();rt(r,e,i,a),nu(r,t,i)}}function jd(e,t,r){var i=Bt(e),a={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(iu(e))su(t,a);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var C=t.lastRenderedState,o=f(C,r);if(a.hasEagerState=!0,a.eagerState=o,it(o,C)){var c=t.interleaved;c===null?(a.next=a,Wo(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}r=Hc(e,t,a,i),r!==null&&(a=De(),rt(r,e,i,a),nu(r,t,i))}}function iu(e){var t=e.alternate;return e===he||t!==null&&t===he}function su(e,t){ti=Cs=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function nu(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Lo(e,r)}}var ws={readContext:Ye,useCallback:ke,useContext:ke,useEffect:ke,useImperativeHandle:ke,useInsertionEffect:ke,useLayoutEffect:ke,useMemo:ke,useReducer:ke,useRef:ke,useState:ke,useDebugValue:ke,useDeferredValue:ke,useTransition:ke,useMutableSource:ke,useSyncExternalStore:ke,useId:ke,unstable_isNewReconciler:!1},Hd={readContext:Ye,useCallback:function(e,t){return ot().memoizedState=[e,t===void 0?null:t],e},useContext:Ye,useEffect:Ql,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ji(4194308,4,Qc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ji(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ji(4,2,e,t)},useMemo:function(e,t){var r=ot();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=ot();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Od.bind(null,he,e),[i.memoizedState,e]},useRef:function(e){var t=ot();return e={current:e},t.memoizedState=e},useState:Xl,useDebugValue:Qo,useDeferredValue:function(e){return ot().memoizedState=e},useTransition:function(){var e=Xl(!1),t=e[0];return e=Bd.bind(null,e[1]),ot().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=he,a=ot();if(ae){if(r===void 0)throw Error(G(407));r=r()}else{if(r=t(),ye===null)throw Error(G(349));Qt&30||Uc(i,t,r)}a.memoizedState=r;var f={value:r,getSnapshot:t};return a.queue=f,Ql(Kc.bind(null,i,f,e),[e]),i.flags|=2048,yi(9,$c.bind(null,i,f,r,t),void 0,null),r},useId:function(){var e=ot(),t=ye.identifierPrefix;if(ae){var r=ft,i=dt;r=(i&~(1<<32-tt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=mi++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Pd++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Nd={readContext:Ye,useCallback:Jc,useContext:Ye,useEffect:Xo,useImperativeHandle:Zc,useInsertionEffect:Yc,useLayoutEffect:Xc,useMemo:eu,useReducer:_n,useRef:qc,useState:function(){return _n(Si)},useDebugValue:Qo,useDeferredValue:function(e){var t=Xe();return tu(t,ge.memoizedState,e)},useTransition:function(){var e=_n(Si)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:zc,useSyncExternalStore:Wc,useId:ru,unstable_isNewReconciler:!1},Fd={readContext:Ye,useCallback:Jc,useContext:Ye,useEffect:Xo,useImperativeHandle:Zc,useInsertionEffect:Yc,useLayoutEffect:Xc,useMemo:eu,useReducer:vn,useRef:qc,useState:function(){return vn(Si)},useDebugValue:Qo,useDeferredValue:function(e){var t=Xe();return ge===null?t.memoizedState=e:tu(t,ge.memoizedState,e)},useTransition:function(){var e=vn(Si)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:zc,useSyncExternalStore:Wc,useId:ru,unstable_isNewReconciler:!1};function Ze(e,t){if(e&&e.defaultProps){t=de({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Jn(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:de({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Os={isMounted:function(e){return(e=e._reactInternals)?tr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=De(),a=Bt(e),f=pt(i,a);f.payload=t,r!=null&&(f.callback=r),t=Mt(e,f,a),t!==null&&(rt(t,e,a,i),Qi(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=De(),a=Bt(e),f=pt(i,a);f.tag=1,f.payload=t,r!=null&&(f.callback=r),t=Mt(e,f,a),t!==null&&(rt(t,e,a,i),Qi(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=De(),i=Bt(e),a=pt(r,i);a.tag=2,t!=null&&(a.callback=t),t=Mt(e,a,i),t!==null&&(rt(t,e,i,r),Qi(t,e,i))}};function Zl(e,t,r,i,a,f,C){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,C):t.prototype&&t.prototype.isPureReactComponent?!di(r,i)||!di(a,f):!0}function ou(e,t,r){var i=!1,a=Ht,f=t.contextType;return typeof f=="object"&&f!==null?f=Ye(f):(a=Oe(t)?Yt:Re.current,i=t.contextTypes,f=(i=i!=null)?xr(e,a):Ht),t=new t(r,f),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Os,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=f),t}function Jl(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&Os.enqueueReplaceState(t,t.state,null)}function eo(e,t,r,i){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},Uo(e);var f=t.contextType;typeof f=="object"&&f!==null?a.context=Ye(f):(f=Oe(t)?Yt:Re.current,a.context=xr(e,f)),a.state=e.memoizedState,f=t.getDerivedStateFromProps,typeof f=="function"&&(Jn(e,t,f,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Os.enqueueReplaceState(a,a.state,null),Ss(e,r,a,i),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Rr(e,t){try{var r="",i=t;do r+=ph(i),i=i.return;while(i);var a=r}catch(f){a=`
|
|
39
39
|
Error generating stack: `+f.message+`
|
|
40
|
-
`+f.stack}return{value:e,source:t,stack:a,digest:null}}function gn(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function eo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Fd=typeof WeakMap=="function"?WeakMap:Map;function ou(e,t,r){r=pt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){ks||(ks=!0,uo=i),eo(e,t)},r}function lu(e,t,r){r=pt(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var a=t.value;r.payload=function(){return i(a)},r.callback=function(){eo(e,t)}}var f=e.stateNode;return f!==null&&typeof f.componentDidCatch=="function"&&(r.callback=function(){eo(e,t),typeof i!="function"&&(Pt===null?Pt=new Set([this]):Pt.add(this));var C=t.stack;this.componentDidCatch(t.value,{componentStack:C!==null?C:""})}),r}function Jl(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new Fd;var a=new Set;i.set(t,a)}else a=i.get(t),a===void 0&&(a=new Set,i.set(t,a));a.has(r)||(a.add(r),e=ef.bind(null,e,t,r),t.then(e,e))}function ea(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 ta(e,t,r,i,a){return e.mode&1?(e.flags|=65536,e.lanes=a,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=pt(-1,1),t.tag=2,Mt(r,t,1))),r.lanes|=1),e)}var zd=St.ReactCurrentOwner,Pe=!1;function Le(e,t,r,i){t.child=e===null?Oc(t,null,r,i):br(t,e.child,r,i)}function ra(e,t,r,i,a){r=r.render;var f=t.ref;return yr(t,a),i=Go(e,t,r,i,f,a),r=qo(),e!==null&&!Pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,mt(e,t,a)):(ae&&r&&Bo(t),t.flags|=1,Le(e,t,i,a),t.child)}function ia(e,t,r,i,a){if(e===null){var f=r.type;return typeof f=="function"&&!sl(f)&&f.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=f,au(e,t,f,i,a)):(e=is(r.type,null,i,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!(e.lanes&a)){var C=f.memoizedProps;if(r=r.compare,r=r!==null?r:di,r(C,i)&&e.ref===t.ref)return mt(e,t,a)}return t.flags|=1,e=Ot(f,i),e.ref=t.ref,e.return=t,t.child=e}function au(e,t,r,i,a){if(e!==null){var f=e.memoizedProps;if(di(f,i)&&e.ref===t.ref)if(Pe=!1,t.pendingProps=i=f,(e.lanes&a)!==0)e.flags&131072&&(Pe=!0);else return t.lanes=e.lanes,mt(e,t,a)}return to(e,t,r,i,a)}function cu(e,t,r){var i=t.pendingProps,a=i.children,f=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ne(_r,He),He|=r;else{if(!(r&1073741824))return e=f!==null?f.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ne(_r,He),He|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=f!==null?f.baseLanes:r,ne(_r,He),He|=i}else f!==null?(i=f.baseLanes|r,t.memoizedState=null):i=r,ne(_r,He),He|=i;return Le(e,t,a,r),t.child}function uu(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function to(e,t,r,i,a){var f=Oe(r)?Yt:Re.current;return f=xr(t,f),yr(t,a),r=Go(e,t,r,i,f,a),i=qo(),e!==null&&!Pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,mt(e,t,a)):(ae&&i&&Bo(t),t.flags|=1,Le(e,t,r,a),t.child)}function sa(e,t,r,i,a){if(Oe(r)){var f=!0;ps(t)}else f=!1;if(yr(t,a),t.stateNode===null)es(e,t),nu(t,r,i),Jn(t,r,i,a),i=!0;else if(e===null){var C=t.stateNode,o=t.memoizedProps;C.props=o;var c=C.context,d=r.contextType;typeof d=="object"&&d!==null?d=Ye(d):(d=Oe(r)?Yt:Re.current,d=xr(t,d));var S=r.getDerivedStateFromProps,h=typeof S=="function"||typeof C.getSnapshotBeforeUpdate=="function";h||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(o!==i||c!==d)&&Zl(t,C,i,d),kt=!1;var _=t.memoizedState;C.state=_,Ss(t,i,C,a),c=t.memoizedState,o!==i||_!==c||Be.current||kt?(typeof S=="function"&&(Zn(t,r,S,i),c=t.memoizedState),(o=kt||Ql(t,r,o,i,_,c,d))?(h||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(t.flags|=4194308)):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),C.props=i,C.state=c,C.context=d,i=o):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{C=t.stateNode,Hc(e,t),o=t.memoizedProps,d=t.type===t.elementType?o:Ze(t.type,o),C.props=d,h=t.pendingProps,_=C.context,c=r.contextType,typeof c=="object"&&c!==null?c=Ye(c):(c=Oe(r)?Yt:Re.current,c=xr(t,c));var g=r.getDerivedStateFromProps;(S=typeof g=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(o!==h||_!==c)&&Zl(t,C,i,c),kt=!1,_=t.memoizedState,C.state=_,Ss(t,i,C,a);var x=t.memoizedState;o!==h||_!==x||Be.current||kt?(typeof g=="function"&&(Zn(t,r,g,i),x=t.memoizedState),(d=kt||Ql(t,r,d,i,_,x,c)||!1)?(S||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(i,x,c),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(i,x,c)),typeof C.componentDidUpdate=="function"&&(t.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof C.componentDidUpdate!="function"||o===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=x),C.props=i,C.state=x,C.context=c,i=d):(typeof C.componentDidUpdate!="function"||o===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),i=!1)}return ro(e,t,r,i,f,a)}function ro(e,t,r,i,a,f){uu(e,t);var C=(t.flags&128)!==0;if(!i&&!C)return a&&Ul(t,r,!1),mt(e,t,f);i=t.stateNode,zd.current=t;var o=C&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&C?(t.child=br(t,e.child,null,f),t.child=br(t,null,o,f)):Le(e,t,o,f),t.memoizedState=i.state,a&&Ul(t,r,!0),t.child}function hu(e){var t=e.stateNode;t.pendingContext?Wl(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Wl(e,t.context,!1),Uo(e,t.containerInfo)}function na(e,t,r,i,a){return kr(),jo(a),t.flags|=256,Le(e,t,r,i),t.child}var io={dehydrated:null,treeContext:null,retryLane:0};function so(e){return{baseLanes:e,cachePool:null,transitions:null}}function du(e,t,r){var i=t.pendingProps,a=ue.current,f=!1,C=(t.flags&128)!==0,o;if((o=C)||(o=e!==null&&e.memoizedState===null?!1:(a&2)!==0),o?(f=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),ne(ue,a&1),e===null)return Xn(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):(C=i.children,e=i.fallback,f?(i=t.mode,f=t.child,C={mode:"hidden",children:C},!(i&1)&&f!==null?(f.childLanes=0,f.pendingProps=C):f=Ns(C,i,0,null),e=qt(e,i,r,null),f.return=t,e.return=t,f.sibling=e,t.child=f,t.child.memoizedState=so(r),t.memoizedState=io,e):Qo(t,C));if(a=e.memoizedState,a!==null&&(o=a.dehydrated,o!==null))return Wd(e,t,C,i,o,a,r);if(f){f=i.fallback,C=t.mode,a=e.child,o=a.sibling;var c={mode:"hidden",children:i.children};return!(C&1)&&t.child!==a?(i=t.child,i.childLanes=0,i.pendingProps=c,t.deletions=null):(i=Ot(a,c),i.subtreeFlags=a.subtreeFlags&14680064),o!==null?f=Ot(o,f):(f=qt(f,C,r,null),f.flags|=2),f.return=t,i.return=t,i.sibling=f,t.child=i,i=f,f=t.child,C=e.child.memoizedState,C=C===null?so(r):{baseLanes:C.baseLanes|r,cachePool:null,transitions:C.transitions},f.memoizedState=C,f.childLanes=e.childLanes&~r,t.memoizedState=io,i}return f=e.child,e=f.sibling,i=Ot(f,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Qo(e,t){return t=Ns({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Wi(e,t,r,i){return i!==null&&jo(i),br(t,e.child,null,r),e=Qo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wd(e,t,r,i,a,f,C){if(r)return t.flags&256?(t.flags&=-257,i=gn(Error(G(422))),Wi(e,t,C,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(f=i.fallback,a=t.mode,i=Ns({mode:"visible",children:i.children},a,0,null),f=qt(f,a,C,null),f.flags|=2,i.return=t,f.return=t,i.sibling=f,t.child=i,t.mode&1&&br(t,e.child,null,C),t.child.memoizedState=so(C),t.memoizedState=io,f);if(!(t.mode&1))return Wi(e,t,C,null);if(a.data==="$!"){if(i=a.nextSibling&&a.nextSibling.dataset,i)var o=i.dgst;return i=o,f=Error(G(419)),i=gn(f,i,void 0),Wi(e,t,C,i)}if(o=(C&e.childLanes)!==0,Pe||o){if(i=ye,i!==null){switch(C&-C){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(i.suspendedLanes|C)?0:a,a!==0&&a!==f.retryLane&&(f.retryLane=a,gt(e,a),rt(i,e,a,-1))}return il(),i=gn(Error(G(421))),Wi(e,t,C,i)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=tf.bind(null,e),a._reactRetry=t,null):(e=f.treeContext,Ne=It(a.nextSibling),Fe=t,ae=!0,et=null,e!==null&&(Ke[Ve++]=dt,Ke[Ve++]=ft,Ke[Ve++]=Xt,dt=e.id,ft=e.overflow,Xt=t),t=Qo(t,i.children),t.flags|=4096,t)}function oa(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Qn(e.return,t,r)}function mn(e,t,r,i,a){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:a}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=i,f.tail=r,f.tailMode=a)}function fu(e,t,r){var i=t.pendingProps,a=i.revealOrder,f=i.tail;if(Le(e,t,i.children,r),i=ue.current,i&2)i=i&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&&oa(e,r,t);else if(e.tag===19)oa(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}i&=1}if(ne(ue,i),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&ys(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),mn(t,!1,a,r,f);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&ys(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}mn(t,!0,r,null,f);break;case"together":mn(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function es(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function mt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Zt|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,r=Ot(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Ot(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Ud(e,t,r){switch(t.tag){case 3:hu(t),kr();break;case 5:Nc(t);break;case 1:Oe(t.type)&&ps(t);break;case 4:Uo(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,a=t.memoizedProps.value;ne(gs,i._currentValue),i._currentValue=a;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(ne(ue,ue.current&1),t.flags|=128,null):r&t.child.childLanes?du(e,t,r):(ne(ue,ue.current&1),e=mt(e,t,r),e!==null?e.sibling:null);ne(ue,ue.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return fu(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ne(ue,ue.current),i)break;return null;case 22:case 23:return t.lanes=0,cu(e,t,r)}return mt(e,t,r)}var pu,no,_u,vu;pu=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}};no=function(){};_u=function(e,t,r,i){var a=e.memoizedProps;if(a!==i){e=t.stateNode,Vt(ct.current);var f=null;switch(r){case"input":a=Rn(e,a),i=Rn(e,i),f=[];break;case"select":a=de({},a,{value:void 0}),i=de({},i,{value:void 0}),f=[];break;case"textarea":a=Tn(e,a),i=Tn(e,i),f=[];break;default:typeof a.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=ds)}In(r,i);var C;r=null;for(d in a)if(!i.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var o=a[d];for(C in o)o.hasOwnProperty(C)&&(r||(r={}),r[C]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(ni.hasOwnProperty(d)?f||(f=[]):(f=f||[]).push(d,null));for(d in i){var c=i[d];if(o=a!=null?a[d]:void 0,i.hasOwnProperty(d)&&c!==o&&(c!=null||o!=null))if(d==="style")if(o){for(C in o)!o.hasOwnProperty(C)||c&&c.hasOwnProperty(C)||(r||(r={}),r[C]="");for(C in c)c.hasOwnProperty(C)&&o[C]!==c[C]&&(r||(r={}),r[C]=c[C])}else r||(f||(f=[]),f.push(d,r)),r=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(f=f||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(f=f||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(ni.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&oe("scroll",e),f||o===c||(f=[])):(f=f||[]).push(d,c))}r&&(f=f||[]).push("style",r);var d=f;(t.updateQueue=d)&&(t.flags|=4)}};vu=function(e,t,r,i){r!==i&&(t.flags|=4)};function Wr(e,t){if(!ae)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 i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function be(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,i|=a.subtreeFlags&14680064,i|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,i|=a.subtreeFlags,i|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function $d(e,t,r){var i=t.pendingProps;switch(Oo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return be(t),null;case 1:return Oe(t.type)&&fs(),be(t),null;case 3:return i=t.stateNode,Er(),le(Be),le(Re),Ko(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,et!==null&&(po(et),et=null))),no(e,t),be(t),null;case 5:$o(t);var a=Vt(gi.current);if(r=t.type,e!==null&&t.stateNode!=null)_u(e,t,r,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(G(166));return be(t),null}if(e=Vt(ct.current),Fi(t)){i=t.stateNode,r=t.type;var f=t.memoizedProps;switch(i[lt]=t,i[_i]=f,e=(t.mode&1)!==0,r){case"dialog":oe("cancel",i),oe("close",i);break;case"iframe":case"object":case"embed":oe("load",i);break;case"video":case"audio":for(a=0;a<Yr.length;a++)oe(Yr[a],i);break;case"source":oe("error",i);break;case"img":case"image":case"link":oe("error",i),oe("load",i);break;case"details":oe("toggle",i);break;case"input":_l(i,f),oe("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!f.multiple},oe("invalid",i);break;case"textarea":gl(i,f),oe("invalid",i)}In(r,f),a=null;for(var C in f)if(f.hasOwnProperty(C)){var o=f[C];C==="children"?typeof o=="string"?i.textContent!==o&&(f.suppressHydrationWarning!==!0&&Ni(i.textContent,o,e),a=["children",o]):typeof o=="number"&&i.textContent!==""+o&&(f.suppressHydrationWarning!==!0&&Ni(i.textContent,o,e),a=["children",""+o]):ni.hasOwnProperty(C)&&o!=null&&C==="onScroll"&&oe("scroll",i)}switch(r){case"input":Ai(i),vl(i,f,!0);break;case"textarea":Ai(i),ml(i);break;case"select":case"option":break;default:typeof f.onClick=="function"&&(i.onclick=ds)}i=a,t.updateQueue=i,i!==null&&(t.flags|=4)}else{C=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=$a(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=C.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=C.createElement(r,{is:i.is}):(e=C.createElement(r),r==="select"&&(C=e,i.multiple?C.multiple=!0:i.size&&(C.size=i.size))):e=C.createElementNS(e,r),e[lt]=t,e[_i]=i,pu(e,t,!1,!1),t.stateNode=e;e:{switch(C=Mn(r,i),r){case"dialog":oe("cancel",e),oe("close",e),a=i;break;case"iframe":case"object":case"embed":oe("load",e),a=i;break;case"video":case"audio":for(a=0;a<Yr.length;a++)oe(Yr[a],e);a=i;break;case"source":oe("error",e),a=i;break;case"img":case"image":case"link":oe("error",e),oe("load",e),a=i;break;case"details":oe("toggle",e),a=i;break;case"input":_l(e,i),a=Rn(e,i),oe("invalid",e);break;case"option":a=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},a=de({},i,{value:void 0}),oe("invalid",e);break;case"textarea":gl(e,i),a=Tn(e,i),oe("invalid",e);break;default:a=i}In(r,a),o=a;for(f in o)if(o.hasOwnProperty(f)){var c=o[f];f==="style"?Ga(e,c):f==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Ka(e,c)):f==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&oi(e,c):typeof c=="number"&&oi(e,""+c):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(ni.hasOwnProperty(f)?c!=null&&f==="onScroll"&&oe("scroll",e):c!=null&&Co(e,f,c,C))}switch(r){case"input":Ai(e),vl(e,i,!1);break;case"textarea":Ai(e),ml(e);break;case"option":i.value!=null&&e.setAttribute("value",""+jt(i.value));break;case"select":e.multiple=!!i.multiple,f=i.value,f!=null?vr(e,!!i.multiple,f,!1):i.defaultValue!=null&&vr(e,!!i.multiple,i.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=ds)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return be(t),null;case 6:if(e&&t.stateNode!=null)vu(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(G(166));if(r=Vt(gi.current),Vt(ct.current),Fi(t)){if(i=t.stateNode,r=t.memoizedProps,i[lt]=t,(f=i.nodeValue!==r)&&(e=Fe,e!==null))switch(e.tag){case 3:Ni(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ni(i.nodeValue,r,(e.mode&1)!==0)}f&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[lt]=t,t.stateNode=i}return be(t),null;case 13:if(le(ue),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ae&&Ne!==null&&t.mode&1&&!(t.flags&128))Pc(),kr(),t.flags|=98560,f=!1;else if(f=Fi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!f)throw Error(G(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(G(317));f[lt]=t}else kr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;be(t),f=!1}else et!==null&&(po(et),et=null),f=!0;if(!f)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||ue.current&1?me===0&&(me=3):il())),t.updateQueue!==null&&(t.flags|=4),be(t),null);case 4:return Er(),no(e,t),e===null&&fi(t.stateNode.containerInfo),be(t),null;case 10:return Fo(t.type._context),be(t),null;case 17:return Oe(t.type)&&fs(),be(t),null;case 19:if(le(ue),f=t.memoizedState,f===null)return be(t),null;if(i=(t.flags&128)!==0,C=f.rendering,C===null)if(i)Wr(f,!1);else{if(me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(C=ys(e),C!==null){for(t.flags|=128,Wr(f,!1),i=C.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)f=r,e=i,f.flags&=14680066,C=f.alternate,C===null?(f.childLanes=0,f.lanes=e,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=C.childLanes,f.lanes=C.lanes,f.child=C.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=C.memoizedProps,f.memoizedState=C.memoizedState,f.updateQueue=C.updateQueue,f.type=C.type,e=C.dependencies,f.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ne(ue,ue.current&1|2),t.child}e=e.sibling}f.tail!==null&&_e()>Lr&&(t.flags|=128,i=!0,Wr(f,!1),t.lanes=4194304)}else{if(!i)if(e=ys(C),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Wr(f,!0),f.tail===null&&f.tailMode==="hidden"&&!C.alternate&&!ae)return be(t),null}else 2*_e()-f.renderingStartTime>Lr&&r!==1073741824&&(t.flags|=128,i=!0,Wr(f,!1),t.lanes=4194304);f.isBackwards?(C.sibling=t.child,t.child=C):(r=f.last,r!==null?r.sibling=C:t.child=C,f.last=C)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=_e(),t.sibling=null,r=ue.current,ne(ue,i?r&1|2:r&1),t):(be(t),null);case 22:case 23:return rl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?He&1073741824&&(be(t),t.subtreeFlags&6&&(t.flags|=8192)):be(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function Kd(e,t){switch(Oo(t),t.tag){case 1:return Oe(t.type)&&fs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Er(),le(Be),le(Re),Ko(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return $o(t),null;case 13:if(le(ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(ue),null;case 4:return Er(),null;case 10:return Fo(t.type._context),null;case 22:case 23:return rl(),null;case 24:return null;default:return null}}var Ui=!1,Ee=!1,Vd=typeof WeakSet=="function"?WeakSet:Set,Z=null;function pr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){pe(e,t,i)}else r.current=null}function oo(e,t,r){try{r()}catch(i){pe(e,t,i)}}var la=!1;function Gd(e,t){if(Un=cs,e=Cc(),Po(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{r.nodeType,f.nodeType}catch{r=null;break e}var C=0,o=-1,c=-1,d=0,S=0,h=e,_=null;t:for(;;){for(var g;h!==r||a!==0&&h.nodeType!==3||(o=C+a),h!==f||i!==0&&h.nodeType!==3||(c=C+i),h.nodeType===3&&(C+=h.nodeValue.length),(g=h.firstChild)!==null;)_=h,h=g;for(;;){if(h===e)break t;if(_===r&&++d===a&&(o=C),_===f&&++S===i&&(c=C),(g=h.nextSibling)!==null)break;h=_,_=h.parentNode}h=g}r=o===-1||c===-1?null:{start:o,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for($n={focusedElem:e,selectionRange:r},cs=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,u=x.memoizedState,l=t.stateNode,s=l.getSnapshotBeforeUpdate(t.elementType===t.type?v:Ze(t.type,v),u);l.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var n=t.stateNode.containerInfo;n.nodeType===1?n.textContent="":n.nodeType===9&&n.documentElement&&n.removeChild(n.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(p){pe(t,t.return,p)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return x=la,la=!1,x}function ri(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var a=i=i.next;do{if((a.tag&e)===e){var f=a.destroy;a.destroy=void 0,f!==void 0&&oo(t,r,f)}a=a.next}while(a!==i)}}function js(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 i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function lo(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 gu(e){var t=e.alternate;t!==null&&(e.alternate=null,gu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[lt],delete t[_i],delete t[Gn],delete t[Dd],delete t[Td])),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 mu(e){return e.tag===5||e.tag===3||e.tag===4}function aa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mu(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 ao(e,t,r){var i=e.tag;if(i===5||i===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=ds));else if(i!==4&&(e=e.child,e!==null))for(ao(e,t,r),e=e.sibling;e!==null;)ao(e,t,r),e=e.sibling}function co(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(co(e,t,r),e=e.sibling;e!==null;)co(e,t,r),e=e.sibling}var Ce=null,Je=!1;function wt(e,t,r){for(r=r.child;r!==null;)Su(e,t,r),r=r.sibling}function Su(e,t,r){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(Ds,r)}catch{}switch(r.tag){case 5:Ee||pr(r,t);case 6:var i=Ce,a=Je;Ce=null,wt(e,t,r),Ce=i,Je=a,Ce!==null&&(Je?(e=Ce,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ce.removeChild(r.stateNode));break;case 18:Ce!==null&&(Je?(e=Ce,r=r.stateNode,e.nodeType===8?hn(e.parentNode,r):e.nodeType===1&&hn(e,r),ui(e)):hn(Ce,r.stateNode));break;case 4:i=Ce,a=Je,Ce=r.stateNode.containerInfo,Je=!0,wt(e,t,r),Ce=i,Je=a;break;case 0:case 11:case 14:case 15:if(!Ee&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){a=i=i.next;do{var f=a,C=f.destroy;f=f.tag,C!==void 0&&(f&2||f&4)&&oo(r,t,C),a=a.next}while(a!==i)}wt(e,t,r);break;case 1:if(!Ee&&(pr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(o){pe(r,t,o)}wt(e,t,r);break;case 21:wt(e,t,r);break;case 22:r.mode&1?(Ee=(i=Ee)||r.memoizedState!==null,wt(e,t,r),Ee=i):wt(e,t,r);break;default:wt(e,t,r)}}function ca(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Vd),t.forEach(function(i){var a=rf.bind(null,e,i);r.has(i)||(r.add(i),i.then(a,a))})}}function Qe(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i];try{var f=e,C=t,o=C;e:for(;o!==null;){switch(o.tag){case 5:Ce=o.stateNode,Je=!1;break e;case 3:Ce=o.stateNode.containerInfo,Je=!0;break e;case 4:Ce=o.stateNode.containerInfo,Je=!0;break e}o=o.return}if(Ce===null)throw Error(G(160));Su(f,C,a),Ce=null,Je=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){pe(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)yu(t,e),t=t.sibling}function yu(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Qe(t,e),nt(e),i&4){try{ri(3,e,e.return),js(3,e)}catch(v){pe(e,e.return,v)}try{ri(5,e,e.return)}catch(v){pe(e,e.return,v)}}break;case 1:Qe(t,e),nt(e),i&512&&r!==null&&pr(r,r.return);break;case 5:if(Qe(t,e),nt(e),i&512&&r!==null&&pr(r,r.return),e.flags&32){var a=e.stateNode;try{oi(a,"")}catch(v){pe(e,e.return,v)}}if(i&4&&(a=e.stateNode,a!=null)){var f=e.memoizedProps,C=r!==null?r.memoizedProps:f,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&f.type==="radio"&&f.name!=null&&Wa(a,f),Mn(o,C);var d=Mn(o,f);for(C=0;C<c.length;C+=2){var S=c[C],h=c[C+1];S==="style"?Ga(a,h):S==="dangerouslySetInnerHTML"?Ka(a,h):S==="children"?oi(a,h):Co(a,S,h,d)}switch(o){case"input":Ln(a,f);break;case"textarea":Ua(a,f);break;case"select":var _=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!f.multiple;var g=f.value;g!=null?vr(a,!!f.multiple,g,!1):_!==!!f.multiple&&(f.defaultValue!=null?vr(a,!!f.multiple,f.defaultValue,!0):vr(a,!!f.multiple,f.multiple?[]:"",!1))}a[_i]=f}catch(v){pe(e,e.return,v)}}break;case 6:if(Qe(t,e),nt(e),i&4){if(e.stateNode===null)throw Error(G(162));a=e.stateNode,f=e.memoizedProps;try{a.nodeValue=f}catch(v){pe(e,e.return,v)}}break;case 3:if(Qe(t,e),nt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{ui(t.containerInfo)}catch(v){pe(e,e.return,v)}break;case 4:Qe(t,e),nt(e);break;case 13:Qe(t,e),nt(e),a=e.child,a.flags&8192&&(f=a.memoizedState!==null,a.stateNode.isHidden=f,!f||a.alternate!==null&&a.alternate.memoizedState!==null||(el=_e())),i&4&&ca(e);break;case 22:if(S=r!==null&&r.memoizedState!==null,e.mode&1?(Ee=(d=Ee)||S,Qe(t,e),Ee=d):Qe(t,e),nt(e),i&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!S&&e.mode&1)for(Z=e,S=e.child;S!==null;){for(h=Z=S;Z!==null;){switch(_=Z,g=_.child,_.tag){case 0:case 11:case 14:case 15:ri(4,_,_.return);break;case 1:pr(_,_.return);var x=_.stateNode;if(typeof x.componentWillUnmount=="function"){i=_,r=_.return;try{t=i,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(v){pe(i,r,v)}}break;case 5:pr(_,_.return);break;case 22:if(_.memoizedState!==null){ha(h);continue}}g!==null?(g.return=_,Z=g):ha(h)}S=S.sibling}e:for(S=null,h=e;;){if(h.tag===5){if(S===null){S=h;try{a=h.stateNode,d?(f=a.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none"):(o=h.stateNode,c=h.memoizedProps.style,C=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=Va("display",C))}catch(v){pe(e,e.return,v)}}}else if(h.tag===6){if(S===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(v){pe(e,e.return,v)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;S===h&&(S=null),h=h.return}S===h&&(S=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Qe(t,e),nt(e),i&4&&ca(e);break;case 21:break;default:Qe(t,e),nt(e)}}function nt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(mu(r)){var i=r;break e}r=r.return}throw Error(G(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(oi(a,""),i.flags&=-33);var f=aa(e);co(e,f,a);break;case 3:case 4:var C=i.stateNode.containerInfo,o=aa(e);ao(e,o,C);break;default:throw Error(G(161))}}catch(c){pe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qd(e,t,r){Z=e,Cu(e)}function Cu(e,t,r){for(var i=(e.mode&1)!==0;Z!==null;){var a=Z,f=a.child;if(a.tag===22&&i){var C=a.memoizedState!==null||Ui;if(!C){var o=a.alternate,c=o!==null&&o.memoizedState!==null||Ee;o=Ui;var d=Ee;if(Ui=C,(Ee=c)&&!d)for(Z=a;Z!==null;)C=Z,c=C.child,C.tag===22&&C.memoizedState!==null?da(a):c!==null?(c.return=C,Z=c):da(a);for(;f!==null;)Z=f,Cu(f),f=f.sibling;Z=a,Ui=o,Ee=d}ua(e)}else a.subtreeFlags&8772&&f!==null?(f.return=a,Z=f):ua(e)}}function ua(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ee||js(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ee)if(r===null)i.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:Ze(t.type,r.memoizedProps);i.componentDidUpdate(a,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var f=t.updateQueue;f!==null&&ql(t,f,i);break;case 3:var C=t.updateQueue;if(C!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}ql(t,C,r)}break;case 5:var o=t.stateNode;if(r===null&&t.flags&4){r=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var S=d.memoizedState;if(S!==null){var h=S.dehydrated;h!==null&&ui(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}Ee||t.flags&512&&lo(t)}catch(_){pe(t,t.return,_)}}if(t===e){Z=null;break}if(r=t.sibling,r!==null){r.return=t.return,Z=r;break}Z=t.return}}function ha(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Z=r;break}Z=t.return}}function da(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{js(4,t)}catch(c){pe(t,r,c)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var a=t.return;try{i.componentDidMount()}catch(c){pe(t,a,c)}}var f=t.return;try{lo(t)}catch(c){pe(t,f,c)}break;case 5:var C=t.return;try{lo(t)}catch(c){pe(t,C,c)}}}catch(c){pe(t,t.return,c)}if(t===e){Z=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Z=o;break}Z=t.return}}var Yd=Math.ceil,xs=St.ReactCurrentDispatcher,Zo=St.ReactCurrentOwner,qe=St.ReactCurrentBatchConfig,re=0,ye=null,ve=null,we=0,He=0,_r=Ft(0),me=0,Ci=null,Zt=0,Hs=0,Jo=0,ii=null,Me=null,el=0,Lr=1/0,ut=null,ks=!1,uo=null,Pt=null,$i=!1,Lt=null,bs=0,si=0,ho=null,ts=-1,rs=0;function De(){return re&6?_e():ts!==-1?ts:ts=_e()}function Bt(e){return e.mode&1?re&2&&we!==0?we&-we:Id.transition!==null?(rs===0&&(rs=nc()),rs):(e=se,e!==0||(e=window.event,e=e===void 0?16:dc(e.type)),e):1}function rt(e,t,r,i){if(50<si)throw si=0,ho=null,Error(G(185));xi(e,r,i),(!(re&2)||e!==ye)&&(e===ye&&(!(re&2)&&(Hs|=r),me===4&&Et(e,we)),je(e,i),r===1&&re===0&&!(t.mode&1)&&(Lr=_e()+500,Ps&&zt()))}function je(e,t){var r=e.callbackNode;Ih(e,t);var i=as(e,e===ye?we:0);if(i===0)r!==null&&Cl(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&Cl(r),t===1)e.tag===0?Ad(fa.bind(null,e)):Ac(fa.bind(null,e)),Rd(function(){!(re&6)&&zt()}),r=null;else{switch(oc(i)){case 1:r=Eo;break;case 4:r=ic;break;case 16:r=ls;break;case 536870912:r=sc;break;default:r=ls}r=Du(r,wu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function wu(e,t){if(ts=-1,rs=0,re&6)throw Error(G(327));var r=e.callbackNode;if(Cr()&&e.callbackNode!==r)return null;var i=as(e,e===ye?we:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=Es(e,i);else{t=i;var a=re;re|=2;var f=ku();(ye!==e||we!==t)&&(ut=null,Lr=_e()+500,Gt(e,t));do try{Zd();break}catch(o){xu(e,o)}while(!0);No(),xs.current=f,re=a,ve!==null?t=0:(ye=null,we=0,t=me)}if(t!==0){if(t===2&&(a=Hn(e),a!==0&&(i=a,t=fo(e,a))),t===1)throw r=Ci,Gt(e,0),Et(e,i),je(e,_e()),r;if(t===6)Et(e,i);else{if(a=e.current.alternate,!(i&30)&&!Xd(a)&&(t=Es(e,i),t===2&&(f=Hn(e),f!==0&&(i=f,t=fo(e,f))),t===1))throw r=Ci,Gt(e,0),Et(e,i),je(e,_e()),r;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(G(345));case 2:Ut(e,Me,ut);break;case 3:if(Et(e,i),(i&130023424)===i&&(t=el+500-_e(),10<t)){if(as(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){De(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Vn(Ut.bind(null,e,Me,ut),t);break}Ut(e,Me,ut);break;case 4:if(Et(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var C=31-tt(i);f=1<<C,C=t[C],C>a&&(a=C),i&=~f}if(i=a,i=_e()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Yd(i/1960))-i,10<i){e.timeoutHandle=Vn(Ut.bind(null,e,Me,ut),i);break}Ut(e,Me,ut);break;case 5:Ut(e,Me,ut);break;default:throw Error(G(329))}}}return je(e,_e()),e.callbackNode===r?wu.bind(null,e):null}function fo(e,t){var r=ii;return e.current.memoizedState.isDehydrated&&(Gt(e,t).flags|=256),e=Es(e,t),e!==2&&(t=Me,Me=r,t!==null&&po(t)),e}function po(e){Me===null?Me=e:Me.push.apply(Me,e)}function Xd(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var a=r[i],f=a.getSnapshot;a=a.value;try{if(!it(f(),a))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 Et(e,t){for(t&=~Jo,t&=~Hs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-tt(t),i=1<<r;e[r]=-1,t&=~i}}function fa(e){if(re&6)throw Error(G(327));Cr();var t=as(e,0);if(!(t&1))return je(e,_e()),null;var r=Es(e,t);if(e.tag!==0&&r===2){var i=Hn(e);i!==0&&(t=i,r=fo(e,i))}if(r===1)throw r=Ci,Gt(e,0),Et(e,t),je(e,_e()),r;if(r===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ut(e,Me,ut),je(e,_e()),null}function tl(e,t){var r=re;re|=1;try{return e(t)}finally{re=r,re===0&&(Lr=_e()+500,Ps&&zt())}}function Jt(e){Lt!==null&&Lt.tag===0&&!(re&6)&&Cr();var t=re;re|=1;var r=qe.transition,i=se;try{if(qe.transition=null,se=1,e)return e()}finally{se=i,qe.transition=r,re=t,!(re&6)&&zt()}}function rl(){He=_r.current,le(_r)}function Gt(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Ed(r)),ve!==null)for(r=ve.return;r!==null;){var i=r;switch(Oo(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&fs();break;case 3:Er(),le(Be),le(Re),Ko();break;case 5:$o(i);break;case 4:Er();break;case 13:le(ue);break;case 19:le(ue);break;case 10:Fo(i.type._context);break;case 22:case 23:rl()}r=r.return}if(ye=e,ve=e=Ot(e.current,null),we=He=t,me=0,Ci=null,Jo=Hs=Zt=0,Me=ii=null,Kt!==null){for(t=0;t<Kt.length;t++)if(r=Kt[t],i=r.interleaved,i!==null){r.interleaved=null;var a=i.next,f=r.pending;if(f!==null){var C=f.next;f.next=a,i.next=C}r.pending=i}Kt=null}return e}function xu(e,t){do{var r=ve;try{if(No(),Zi.current=ws,Cs){for(var i=he.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Cs=!1}if(Qt=0,Se=ge=he=null,ti=!1,mi=0,Zo.current=null,r===null||r.return===null){me=1,Ci=t,ve=null;break}e:{var f=e,C=r.return,o=r,c=t;if(t=we,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,S=o,h=S.tag;if(!(S.mode&1)&&(h===0||h===11||h===15)){var _=S.alternate;_?(S.updateQueue=_.updateQueue,S.memoizedState=_.memoizedState,S.lanes=_.lanes):(S.updateQueue=null,S.memoizedState=null)}var g=ea(C);if(g!==null){g.flags&=-257,ta(g,C,o,f,t),g.mode&1&&Jl(f,d,t),t=g,c=d;var x=t.updateQueue;if(x===null){var v=new Set;v.add(c),t.updateQueue=v}else x.add(c);break e}else{if(!(t&1)){Jl(f,d,t),il();break e}c=Error(G(426))}}else if(ae&&o.mode&1){var u=ea(C);if(u!==null){!(u.flags&65536)&&(u.flags|=256),ta(u,C,o,f,t),jo(Rr(c,o));break e}}f=c=Rr(c,o),me!==4&&(me=2),ii===null?ii=[f]:ii.push(f),f=C;do{switch(f.tag){case 3:f.flags|=65536,t&=-t,f.lanes|=t;var l=ou(f,c,t);Gl(f,l);break e;case 1:o=c;var s=f.type,n=f.stateNode;if(!(f.flags&128)&&(typeof s.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Pt===null||!Pt.has(n)))){f.flags|=65536,t&=-t,f.lanes|=t;var p=lu(f,o,t);Gl(f,p);break e}}f=f.return}while(f!==null)}Eu(r)}catch(w){t=w,ve===r&&r!==null&&(ve=r=r.return);continue}break}while(!0)}function ku(){var e=xs.current;return xs.current=ws,e===null?ws:e}function il(){(me===0||me===3||me===2)&&(me=4),ye===null||!(Zt&268435455)&&!(Hs&268435455)||Et(ye,we)}function Es(e,t){var r=re;re|=2;var i=ku();(ye!==e||we!==t)&&(ut=null,Gt(e,t));do try{Qd();break}catch(a){xu(e,a)}while(!0);if(No(),re=r,xs.current=i,ve!==null)throw Error(G(261));return ye=null,we=0,me}function Qd(){for(;ve!==null;)bu(ve)}function Zd(){for(;ve!==null&&!xh();)bu(ve)}function bu(e){var t=Lu(e.alternate,e,He);e.memoizedProps=e.pendingProps,t===null?Eu(e):ve=t,Zo.current=null}function Eu(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Kd(r,t),r!==null){r.flags&=32767,ve=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{me=6,ve=null;return}}else if(r=$d(r,t,He),r!==null){ve=r;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);me===0&&(me=5)}function Ut(e,t,r){var i=se,a=qe.transition;try{qe.transition=null,se=1,Jd(e,t,r,i)}finally{qe.transition=a,se=i}return null}function Jd(e,t,r,i){do Cr();while(Lt!==null);if(re&6)throw Error(G(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var f=r.lanes|r.childLanes;if(Mh(e,f),e===ye&&(ve=ye=null,we=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||$i||($i=!0,Du(ls,function(){return Cr(),null})),f=(r.flags&15990)!==0,r.subtreeFlags&15990||f){f=qe.transition,qe.transition=null;var C=se;se=1;var o=re;re|=4,Zo.current=null,Gd(e,r),yu(r,e),Sd($n),cs=!!Un,$n=Un=null,e.current=r,qd(r),kh(),re=o,se=C,qe.transition=f}else e.current=r;if($i&&($i=!1,Lt=e,bs=a),f=e.pendingLanes,f===0&&(Pt=null),Rh(r.stateNode),je(e,_e()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],i(a.value,{componentStack:a.stack,digest:a.digest});if(ks)throw ks=!1,e=uo,uo=null,e;return bs&1&&e.tag!==0&&Cr(),f=e.pendingLanes,f&1?e===ho?si++:(si=0,ho=e):si=0,zt(),null}function Cr(){if(Lt!==null){var e=oc(bs),t=qe.transition,r=se;try{if(qe.transition=null,se=16>e?16:e,Lt===null)var i=!1;else{if(e=Lt,Lt=null,bs=0,re&6)throw Error(G(331));var a=re;for(re|=4,Z=e.current;Z!==null;){var f=Z,C=f.child;if(Z.flags&16){var o=f.deletions;if(o!==null){for(var c=0;c<o.length;c++){var d=o[c];for(Z=d;Z!==null;){var S=Z;switch(S.tag){case 0:case 11:case 15:ri(8,S,f)}var h=S.child;if(h!==null)h.return=S,Z=h;else for(;Z!==null;){S=Z;var _=S.sibling,g=S.return;if(gu(S),S===d){Z=null;break}if(_!==null){_.return=g,Z=_;break}Z=g}}}var x=f.alternate;if(x!==null){var v=x.child;if(v!==null){x.child=null;do{var u=v.sibling;v.sibling=null,v=u}while(v!==null)}}Z=f}}if(f.subtreeFlags&2064&&C!==null)C.return=f,Z=C;else e:for(;Z!==null;){if(f=Z,f.flags&2048)switch(f.tag){case 0:case 11:case 15:ri(9,f,f.return)}var l=f.sibling;if(l!==null){l.return=f.return,Z=l;break e}Z=f.return}}var s=e.current;for(Z=s;Z!==null;){C=Z;var n=C.child;if(C.subtreeFlags&2064&&n!==null)n.return=C,Z=n;else e:for(C=s;Z!==null;){if(o=Z,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:js(9,o)}}catch(w){pe(o,o.return,w)}if(o===C){Z=null;break e}var p=o.sibling;if(p!==null){p.return=o.return,Z=p;break e}Z=o.return}}if(re=a,zt(),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Ds,e)}catch{}i=!0}return i}finally{se=r,qe.transition=t}}return!1}function pa(e,t,r){t=Rr(r,t),t=ou(e,t,1),e=Mt(e,t,1),t=De(),e!==null&&(xi(e,1,t),je(e,t))}function pe(e,t,r){if(e.tag===3)pa(e,e,r);else for(;t!==null;){if(t.tag===3){pa(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Pt===null||!Pt.has(i))){e=Rr(r,e),e=lu(t,e,1),t=Mt(t,e,1),e=De(),t!==null&&(xi(t,1,e),je(t,e));break}}t=t.return}}function ef(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=De(),e.pingedLanes|=e.suspendedLanes&r,ye===e&&(we&r)===r&&(me===4||me===3&&(we&130023424)===we&&500>_e()-el?Gt(e,0):Jo|=r),je(e,t)}function Ru(e,t){t===0&&(e.mode&1?(t=Pi,Pi<<=1,!(Pi&130023424)&&(Pi=4194304)):t=1);var r=De();e=gt(e,t),e!==null&&(xi(e,t,r),je(e,r))}function tf(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Ru(e,r)}function rf(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(G(314))}i!==null&&i.delete(t),Ru(e,r)}var Lu;Lu=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Be.current)Pe=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Pe=!1,Ud(e,t,r);Pe=!!(e.flags&131072)}else Pe=!1,ae&&t.flags&1048576&&Ic(t,vs,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;es(e,t),e=t.pendingProps;var a=xr(t,Re.current);yr(t,r),a=Go(null,t,i,e,a,r);var f=qo();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Oe(i)?(f=!0,ps(t)):f=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Wo(t),a.updater=Os,t.stateNode=a,a._reactInternals=t,Jn(t,i,e,r),t=ro(null,t,i,!0,f,r)):(t.tag=0,ae&&f&&Bo(t),Le(null,t,a,r),t=t.child),t;case 16:i=t.elementType;e:{switch(es(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=nf(i),e=Ze(i,e),a){case 0:t=to(null,t,i,e,r);break e;case 1:t=sa(null,t,i,e,r);break e;case 11:t=ra(null,t,i,e,r);break e;case 14:t=ia(null,t,i,Ze(i.type,e),r);break e}throw Error(G(306,i,""))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),to(e,t,i,a,r);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),sa(e,t,i,a,r);case 3:e:{if(hu(t),e===null)throw Error(G(387));i=t.pendingProps,f=t.memoizedState,a=f.element,Hc(e,t),Ss(t,i,null,r);var C=t.memoizedState;if(i=C.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){a=Rr(Error(G(423)),t),t=na(e,t,i,r,a);break e}else if(i!==a){a=Rr(Error(G(424)),t),t=na(e,t,i,r,a);break e}else for(Ne=It(t.stateNode.containerInfo.firstChild),Fe=t,ae=!0,et=null,r=Oc(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(kr(),i===a){t=mt(e,t,r);break e}Le(e,t,i,r)}t=t.child}return t;case 5:return Nc(t),e===null&&Xn(t),i=t.type,a=t.pendingProps,f=e!==null?e.memoizedProps:null,C=a.children,Kn(i,a)?C=null:f!==null&&Kn(i,f)&&(t.flags|=32),uu(e,t),Le(e,t,C,r),t.child;case 6:return e===null&&Xn(t),null;case 13:return du(e,t,r);case 4:return Uo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=br(t,null,i,r):Le(e,t,i,r),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),ra(e,t,i,a,r);case 7:return Le(e,t,t.pendingProps,r),t.child;case 8:return Le(e,t,t.pendingProps.children,r),t.child;case 12:return Le(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,a=t.pendingProps,f=t.memoizedProps,C=a.value,ne(gs,i._currentValue),i._currentValue=C,f!==null)if(it(f.value,C)){if(f.children===a.children&&!Be.current){t=mt(e,t,r);break e}}else for(f=t.child,f!==null&&(f.return=t);f!==null;){var o=f.dependencies;if(o!==null){C=f.child;for(var c=o.firstContext;c!==null;){if(c.context===i){if(f.tag===1){c=pt(-1,r&-r),c.tag=2;var d=f.updateQueue;if(d!==null){d=d.shared;var S=d.pending;S===null?c.next=c:(c.next=S.next,S.next=c),d.pending=c}}f.lanes|=r,c=f.alternate,c!==null&&(c.lanes|=r),Qn(f.return,r,t),o.lanes|=r;break}c=c.next}}else if(f.tag===10)C=f.type===t.type?null:f.child;else if(f.tag===18){if(C=f.return,C===null)throw Error(G(341));C.lanes|=r,o=C.alternate,o!==null&&(o.lanes|=r),Qn(C,r,t),C=f.sibling}else C=f.child;if(C!==null)C.return=f;else for(C=f;C!==null;){if(C===t){C=null;break}if(f=C.sibling,f!==null){f.return=C.return,C=f;break}C=C.return}f=C}Le(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,yr(t,r),a=Ye(a),i=i(a),t.flags|=1,Le(e,t,i,r),t.child;case 14:return i=t.type,a=Ze(i,t.pendingProps),a=Ze(i.type,a),ia(e,t,i,a,r);case 15:return au(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),es(e,t),t.tag=1,Oe(i)?(e=!0,ps(t)):e=!1,yr(t,r),nu(t,i,a),Jn(t,i,a,r),ro(null,t,i,!0,e,r);case 19:return fu(e,t,r);case 22:return cu(e,t,r)}throw Error(G(156,t.tag))};function Du(e,t){return rc(e,t)}function sf(e,t,r,i){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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ge(e,t,r,i){return new sf(e,t,r,i)}function sl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nf(e){if(typeof e=="function")return sl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xo)return 11;if(e===ko)return 14}return 2}function Ot(e,t){var r=e.alternate;return r===null?(r=Ge(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 is(e,t,r,i,a,f){var C=2;if(i=e,typeof e=="function")sl(e)&&(C=1);else if(typeof e=="string")C=5;else e:switch(e){case nr:return qt(r.children,a,f,t);case wo:C=8,a|=8;break;case xn:return e=Ge(12,r,t,a|2),e.elementType=xn,e.lanes=f,e;case kn:return e=Ge(13,r,t,a),e.elementType=kn,e.lanes=f,e;case bn:return e=Ge(19,r,t,a),e.elementType=bn,e.lanes=f,e;case Na:return Ns(r,a,f,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ja:C=10;break e;case Ha:C=9;break e;case xo:C=11;break e;case ko:C=14;break e;case xt:C=16,i=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=Ge(C,r,t,a),t.elementType=e,t.type=i,t.lanes=f,t}function qt(e,t,r,i){return e=Ge(7,e,i,t),e.lanes=r,e}function Ns(e,t,r,i){return e=Ge(22,e,i,t),e.elementType=Na,e.lanes=r,e.stateNode={isHidden:!1},e}function Sn(e,t,r){return e=Ge(6,e,null,t),e.lanes=r,e}function yn(e,t,r){return t=Ge(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function of(e,t,r,i,a){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=Js(0),this.expirationTimes=Js(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Js(0),this.identifierPrefix=i,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function nl(e,t,r,i,a,f,C,o,c){return e=new of(e,t,r,o,c),t===1?(t=1,f===!0&&(t|=8)):t=0,f=Ge(3,null,null,t),e.current=f,f.stateNode=e,f.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wo(f),e}function lf(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:sr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Tu(e){if(!e)return Ht;e=e._reactInternals;e:{if(tr(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Oe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var r=e.type;if(Oe(r))return Tc(e,r,t)}return t}function Au(e,t,r,i,a,f,C,o,c){return e=nl(r,i,!0,e,a,f,C,o,c),e.context=Tu(null),r=e.current,i=De(),a=Bt(r),f=pt(i,a),f.callback=t??null,Mt(r,f,a),e.current.lanes=a,xi(e,a,i),je(e,i),e}function Fs(e,t,r,i){var a=t.current,f=De(),C=Bt(a);return r=Tu(r),t.context===null?t.context=r:t.pendingContext=r,t=pt(f,C),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=Mt(a,t,C),e!==null&&(rt(e,a,C,f),Qi(e,a,C)),C}function Rs(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 _a(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ol(e,t){_a(e,t),(e=e.alternate)&&_a(e,t)}function af(){return null}var Iu=typeof reportError=="function"?reportError:function(e){console.error(e)};function ll(e){this._internalRoot=e}zs.prototype.render=ll.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));Fs(e,t,null,null)};zs.prototype.unmount=ll.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jt(function(){Fs(null,e,null,null)}),t[vt]=null}};function zs(e){this._internalRoot=e}zs.prototype.unstable_scheduleHydration=function(e){if(e){var t=cc();e={blockedOn:null,target:e,priority:t};for(var r=0;r<bt.length&&t!==0&&t<bt[r].priority;r++);bt.splice(r,0,e),r===0&&hc(e)}};function al(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ws(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function va(){}function cf(e,t,r,i,a){if(a){if(typeof i=="function"){var f=i;i=function(){var d=Rs(C);f.call(d)}}var C=Au(t,i,e,0,null,!1,!1,"",va);return e._reactRootContainer=C,e[vt]=C.current,fi(e.nodeType===8?e.parentNode:e),Jt(),C}for(;a=e.lastChild;)e.removeChild(a);if(typeof i=="function"){var o=i;i=function(){var d=Rs(c);o.call(d)}}var c=nl(e,0,!1,null,null,!1,!1,"",va);return e._reactRootContainer=c,e[vt]=c.current,fi(e.nodeType===8?e.parentNode:e),Jt(function(){Fs(t,c,r,i)}),c}function Us(e,t,r,i,a){var f=r._reactRootContainer;if(f){var C=f;if(typeof a=="function"){var o=a;a=function(){var c=Rs(C);o.call(c)}}Fs(t,C,e,a)}else C=cf(r,t,e,a,i);return Rs(C)}lc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=qr(t.pendingLanes);r!==0&&(Ro(t,r|1),je(t,_e()),!(re&6)&&(Lr=_e()+500,zt()))}break;case 13:Jt(function(){var i=gt(e,1);if(i!==null){var a=De();rt(i,e,1,a)}}),ol(e,1)}};Lo=function(e){if(e.tag===13){var t=gt(e,134217728);if(t!==null){var r=De();rt(t,e,134217728,r)}ol(e,134217728)}};ac=function(e){if(e.tag===13){var t=Bt(e),r=gt(e,t);if(r!==null){var i=De();rt(r,e,t,i)}ol(e,t)}};cc=function(){return se};uc=function(e,t){var r=se;try{return se=e,t()}finally{se=r}};Bn=function(e,t,r){switch(t){case"input":if(Ln(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 i=r[t];if(i!==e&&i.form===e.form){var a=Ms(i);if(!a)throw Error(G(90));za(i),Ln(i,a)}}}break;case"textarea":Ua(e,r);break;case"select":t=r.value,t!=null&&vr(e,!!r.multiple,t,!1)}};Xa=tl;Qa=Jt;var uf={usingClientEntryPoint:!1,Events:[bi,cr,Ms,qa,Ya,tl]},Ur={findFiberByHostInstance:$t,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hf={bundleType:Ur.bundleType,version:Ur.version,rendererPackageName:Ur.rendererPackageName,rendererConfig:Ur.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:St.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ec(e),e===null?null:e.stateNode},findFiberByHostInstance:Ur.findFiberByHostInstance||af,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 Ki=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ki.isDisabled&&Ki.supportsFiber)try{Ds=Ki.inject(hf),at=Ki}catch{}}We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uf;We.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!al(t))throw Error(G(200));return lf(e,t,null,r)};We.createRoot=function(e,t){if(!al(e))throw Error(G(299));var r=!1,i="",a=Iu;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=nl(e,1,!1,null,null,r,!1,i,a),e[vt]=t.current,fi(e.nodeType===8?e.parentNode:e),new ll(t)};We.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(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=ec(t),e=e===null?null:e.stateNode,e};We.flushSync=function(e){return Jt(e)};We.hydrate=function(e,t,r){if(!Ws(t))throw Error(G(200));return Us(null,e,t,!0,r)};We.hydrateRoot=function(e,t,r){if(!al(e))throw Error(G(405));var i=r!=null&&r.hydratedSources||null,a=!1,f="",C=Iu;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),t=Au(t,null,e,1,r??null,a,!1,f,C),e[vt]=t.current,fi(e),i)for(e=0;e<i.length;e++)r=i[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new zs(t)};We.render=function(e,t,r){if(!Ws(t))throw Error(G(200));return Us(null,e,t,!1,r)};We.unmountComponentAtNode=function(e){if(!Ws(e))throw Error(G(40));return e._reactRootContainer?(Jt(function(){Us(null,null,e,!1,function(){e._reactRootContainer=null,e[vt]=null})}),!0):!1};We.unstable_batchedUpdates=tl;We.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!Ws(r))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return Us(e,t,r,!1,i)};We.version="18.3.1-next-f1338f8080-20240426";function Mu(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mu)}catch(e){console.error(e)}}Mu(),Ma.exports=We;var df=Ma.exports,Pu,ga=df;Pu=ga.createRoot,ga.hydrateRoot;const ff=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,pf=3e3,_f=5,vf=5e3;function gf(){const[e,t]=q.useState(!1),[r,i]=q.useState(!1),[a,f]=q.useState([]),[C,o]=q.useState([]),[c,d]=q.useState([]),[S,h]=q.useState(null),[_,g]=q.useState([]),x=q.useRef(null),v=q.useRef(new Map),u=q.useRef(null),l=q.useCallback((F,Y="info")=>{const U={id:Date.now()+Math.random(),msg:F,type:Y};g(O=>[U,...O].slice(0,_f)),setTimeout(()=>{g(O=>O.filter(R=>R.id!==U.id))},vf)},[]),s=q.useCallback((F,Y)=>{const U=x.current;U&&U.readyState===WebSocket.OPEN&&U.send(JSON.stringify({type:F,payload:Y,ts:Date.now()}))},[]),n=q.useCallback(()=>{if(x.current&&x.current.readyState===WebSocket.OPEN)return;const F=new WebSocket(ff);x.current=F,F.onopen=()=>{t(!0),u.current&&(clearInterval(u.current),u.current=null);for(const[Y]of v.current)s("SUBSCRIBE_TERMINAL",{agentId:Y})},F.onmessage=Y=>{var O,R,$,H,Q;let U;try{U=JSON.parse(Y.data)}catch{return}switch(U.type){case"INIT":f(U.payload.tasks||[]),o(U.payload.agents||[]),d(U.payload.repos||[]),U.payload.settings&&h(U.payload.settings),i(!0);break;case"TASKS_UPDATED":f(U.payload.tasks||[]);break;case"TASK_ADDED":f(z=>[...z,U.payload.task]);break;case"AGENTS_UPDATED":o(U.payload.agents||[]);break;case"AGENT_UPDATED":o(z=>z.some(ie=>ie.id===U.payload.agent.id)?z.map(ie=>ie.id===U.payload.agent.id?U.payload.agent:ie):[...z,U.payload.agent]);break;case"AGENT_REMOVED":o(z=>z.filter(J=>J.id!==U.payload.agentId));break;case"SETTINGS_UPDATED":h(U.payload);break;case"REPOS_UPDATED":d(U.payload.repos||[]);break;case"TERMINAL_DATA":{const z=v.current.get(U.payload.agentId);z&&z(U.payload.data);break}case"PLAN_READY":l(`Plan ready for ${U.payload.taskId} — approval needed`,"warning");break;case"PLAN_PARTIAL":f(z=>z.map(J=>J.id===U.payload.taskId?{...J,plan:U.payload.plan}:J));break;case"PR_CREATED":l(`PR created for ${U.payload.taskId}`,"success");break;case"TASK_BLOCKED":l(`${U.payload.taskId} blocked: ${U.payload.reason}`,"error");break;case"REVIEW_FAILED":l(`Review failed for ${U.payload.taskId} — returning to implementor`,"warning");break;case"REVIEW_PASSED":l(`Review passed for ${U.payload.taskId}`,"success");break;case"TASK_ABORTED":l(`Task ${U.payload.taskId} aborted`,"info");break;case"TASK_RESET":l(`Task ${U.payload.taskId} reset to backlog`,"info");break;case"TASK_RETRIED":l(`Task ${U.payload.taskId} retrying from ${U.payload.retryStatus}`,"info");break;case"TASK_DELETED":l(`Task ${U.payload.taskId} deleted from Done`,"info");break;case"BRIDGE_OPENED":l(`${U.payload.agentName} opened in Terminal`,"info");break;case"BRIDGE_RETURNED":l(`${U.payload.agentName} returned to Ban Kan`,"info");break;case"BRIDGE_ERROR":l(((O=U.payload)==null?void 0:O.message)||"Terminal bridge failed","error");break;case"TASK_WORKSPACE_OPENED":l(((R=U.payload)==null?void 0:R.message)||`Opened workspace for ${($=U.payload)==null?void 0:$.taskId}`,"success");break;case"TASK_WORKSPACE_ERROR":l(((H=U.payload)==null?void 0:H.message)||"Failed to open task workspace","error");break;case"SETTINGS_ERROR":l((((Q=U.payload)==null?void 0:Q.errors)||[]).join(", ")||"Settings update failed","error");break}},F.onclose=()=>{t(!1),x.current=null,u.current||(u.current=setInterval(n,pf))},F.onerror=()=>{F.close()}},[l,s]);q.useEffect(()=>(n(),()=>{u.current&&clearInterval(u.current),x.current&&x.current.close()}),[n]);const p=q.useCallback((F,Y,U,O)=>{s("ADD_TASK",{title:F,priority:Y,description:U,repoPath:O})},[s]),w=q.useCallback(F=>{s("APPROVE_PLAN",{taskId:F})},[s]),y=q.useCallback((F,Y)=>{s("REJECT_PLAN",{taskId:F,feedback:Y})},[s]),k=q.useCallback((F,Y)=>{s("INJECT_MESSAGE",{agentId:F,message:Y})},[s]),m=q.useCallback((F,Y)=>{s("INJECT_RAW",{agentId:F,data:Y})},[s]),b=q.useCallback((F,Y,U)=>{s("RESIZE_TERMINAL",{agentId:F,cols:Y,rows:U})},[s]),T=q.useCallback(F=>{s("PAUSE_AGENT",{agentId:F})},[s]),I=q.useCallback(F=>{s("RESUME_AGENT",{agentId:F})},[s]),P=q.useCallback(F=>{s("PAUSE_TASK",{taskId:F})},[s]),A=q.useCallback(F=>{s("RESUME_TASK",{taskId:F})},[s]),N=q.useCallback((F,Y)=>{s("EDIT_TASK",{taskId:F,updates:Y})},[s]),W=q.useCallback(F=>{s("ABORT_TASK",{taskId:F})},[s]),V=q.useCallback(F=>{s("RESET_TASK",{taskId:F})},[s]),X=q.useCallback(F=>{s("RETRY_TASK",{taskId:F})},[s]),j=q.useCallback(F=>{s("DELETE_TASK",{taskId:F})},[s]),E=q.useCallback(F=>{s("OPEN_TASK_WORKSPACE",{taskId:F})},[s]),D=q.useCallback(F=>{s("UPDATE_SETTINGS",F)},[s]),M=q.useCallback(F=>{s("OPEN_AGENT_TERMINAL",{agentId:F})},[s]),B=q.useCallback(F=>{s("RETURN_AGENT_TERMINAL",{agentId:F})},[s]),K=q.useCallback((F,Y)=>(v.current.set(F,Y),s("SUBSCRIBE_TERMINAL",{agentId:F}),()=>{v.current.delete(F),s("UNSUBSCRIBE_TERMINAL",{agentId:F})}),[s]);return{connected:e,isInitialized:r,tasks:a,agents:C,repos:c,settings:S,notifications:_,addTask:p,approvePlan:w,rejectPlan:y,pauseTask:P,resumeTask:A,editTask:N,abortTask:W,resetTask:V,retryTask:X,deleteTask:j,openTaskWorkspace:E,injectMessage:k,sendRaw:m,resizeTerminal:b,pauseAgent:T,resumeAgent:I,updateSettings:D,subscribeTerminal:K,openAgentTerminal:M,returnAgentTerminal:B}}const mf={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"},ma={planning:"var(--steel2)",awaiting_approval:"var(--amber)",queued:"var(--text3)",workspace_setup:"var(--steel2)",implementing:"var(--green)",review:"#A78BFA",blocked:"var(--red)",paused:"var(--amber)",backlog:"var(--text3)",aborted:"var(--text3)",done:"var(--green)"};function Sf(e){const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/6e4);if(r<1)return"now";if(r<60)return`${r}m`;const i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function yf(e,t=72){if(typeof e!="string")return"";const r=e.replace(/\s+/g," ").trim();return r.length<=t?r:r.slice(0,t-1).trimEnd()+"…"}function Cf({task:e,columnColor:t,agents:r,isAnimating:i,onApprove:a,onReject:f,onAgentClick:C,onTaskClick:o}){const[c,d]=q.useState(!1),[S,h]=q.useState(""),[_,g]=q.useState(!1),x=e.status==="blocked",v=r.find(s=>s.id===e.assignedTo),u=x?"var(--red)":t,l=x?"rgba(255,77,77,0.05)":"transparent";return L.jsxs("div",{onClick:()=>o&&o(e),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),style:{cursor:"pointer",background:_?"var(--bg2)":`linear-gradient(${l}, ${l}), var(--bg1)`,borderRadius:6,borderLeft:`3px solid ${u}`,padding:"10px 12px",transform:_?"translateY(-1px)":"none",boxShadow:_?"0 4px 12px rgba(0,0,0,0.3)":"none",transition:"transform 0.15s, box-shadow 0.15s, background 0.15s",animation:i?"card-enter 0.3s ease-out":"none"},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[L.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:mf[e.priority]||"var(--text3)",flexShrink:0}}),L.jsx("span",{style:{fontSize:11,color:"var(--text3)",fontFamily:"var(--font-mono)"},children:e.id}),L.jsx("span",{style:{flex:1}}),L.jsx("span",{style:{fontSize:10,color:"var(--text3)"},children:Sf(e.createdAt)})]}),L.jsx("div",{style:{fontSize:12,lineHeight:1.4,marginBottom:8,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.title}),L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:e.progress>0?6:0},children:[L.jsx("span",{style:{padding:"1px 6px",borderRadius:3,fontSize:10,background:(ma[e.status]||"var(--text3)")+"20",color:ma[e.status]||"var(--text3)"},children:e.status.replace(/_/g," ")}),L.jsx("span",{style:{flex:1}}),v&&L.jsxs("span",{onClick:s=>{s.stopPropagation(),C(v.id)},title:`Open ${v.name} terminal`,style:{display:"inline-flex",alignItems:"center",gap:3,padding:"2px 6px",borderRadius:9,background:(v.color||"var(--text3)")+"26",color:v.color||"var(--text3)",fontSize:10,cursor:"pointer",transition:"background 0.15s"},onMouseEnter:s=>s.currentTarget.style.background=(v.color||"var(--text3)")+"40",onMouseLeave:s=>s.currentTarget.style.background=(v.color||"var(--text3)")+"26",children:[L.jsx("span",{style:{fontSize:10,lineHeight:1},children:v.icon||v.id.charAt(0).toUpperCase()}),v.name]})]}),e.progress>0&&L.jsxs("div",{style:{marginBottom:6},children:[L.jsx("div",{style:{height:2,background:"var(--border)",borderRadius:1},children:L.jsx("div",{style:{height:"100%",borderRadius:1,width:`${e.progress}%`,background:t,transition:"width 0.3s"}})}),L.jsxs("div",{style:{fontSize:9,color:"var(--text3)",textAlign:"right",marginTop:2},children:[e.progress,"%"]})]}),e.status==="awaiting_approval"&&L.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[L.jsx("button",{onClick:s=>{s.stopPropagation(),a(e.id)},style:{padding:"3px 8px",borderRadius:3,background:"rgba(61, 220, 132, 0.15)",color:"var(--green)",fontSize:11},children:"Approve"}),L.jsx("button",{onClick:s=>{s.stopPropagation(),d(!0),h("")},style:{padding:"3px 8px",borderRadius:3,background:"rgba(255, 77, 77, 0.1)",color:"var(--text2)",fontSize:11},children:"Revise"})]}),e.status==="done"&&e.prUrl&&L.jsx("div",{style:{marginTop:4},children:L.jsx("a",{href:e.prUrl,target:"_blank",rel:"noopener noreferrer",style:{padding:"3px 8px",borderRadius:3,background:"rgba(96, 165, 250, 0.15)",color:"#60A5FA",fontSize:11,textDecoration:"none",display:"inline-block"},children:"PR"})}),x&&e.blockedReason&&L.jsxs("div",{style:{marginTop:4},children:[L.jsx("span",{style:{fontSize:10,color:"var(--red)",fontWeight:600},children:"AWAITING HUMAN INPUT"}),L.jsx("span",{title:e.blockedReason,style:{fontSize:10,color:"var(--text3)",marginLeft:6},children:yf(e.blockedReason)})]}),c&&L.jsx("div",{style:{marginTop:6,animation:"fade-in 0.15s ease-out"},children:L.jsx("input",{autoFocus:!0,type:"text",placeholder:"Feedback for planner...",value:S,onChange:s=>h(s.target.value),onKeyDown:s=>{s.key==="Enter"&&S.trim()&&(f(e.id,S.trim()),d(!1),h("")),s.key==="Escape"&&(d(!1),h(""))},style:{width:"100%",fontSize:11,padding:"4px 8px"}})})]})}function wf({column:e,tasks:t,agents:r,animatingTasks:i,onApprove:a,onReject:f,onAgentClick:C,onAddTask:o,onTaskClick:c,canCreateTask:d}){const S=e.agentPrefix?r.filter(h=>h.id.startsWith(e.agentPrefix+"-")||h.id===e.agentPrefix):[];return L.jsxs("div",{style:{display:"flex",flexDirection:"column",background:"var(--bg)",minHeight:0,overflow:"hidden"},children:[L.jsxs("div",{style:{padding:"12px 12px 8px",borderBottom:`2px solid ${e.color}30`},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:S.length>0?8:0},children:[L.jsx("span",{style:{width:16,height:16,display:"inline-flex",alignItems:"center",justifyContent:"center",color:e.color,flexShrink:0},children:e.icon}),L.jsx("span",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:12,letterSpacing:1,textTransform:"uppercase"},children:e.title}),L.jsx("span",{style:{flex:1}}),t.length>0&&L.jsx("span",{style:{width:20,height:20,borderRadius:"50%",background:e.color+"33",color:e.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:600},children:t.length})]}),S.length>0&&L.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:S.map(h=>{const _=h.status==="active",g=h.status==="blocked",x=h.status==="draining",v=!_&&!g&&!x;return L.jsxs("div",{onClick:()=>C(h.id),title:`${h.name} — ${h.status}`,style:{width:22,height:22,borderRadius:"50%",background:v?"transparent":h.color||e.color,border:v?`1px solid ${h.color||e.color}66`:x?`2px dashed ${h.color||e.color}`:g?"2px solid var(--red)":"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,cursor:"pointer",position:"relative",opacity:v?.4:1,transition:"opacity 0.15s"},children:[h.icon||h.id.charAt(0).toUpperCase(),_&&L.jsx("span",{style:{position:"absolute",bottom:-1,right:-1,width:5,height:5,borderRadius:"50%",background:"var(--green)",border:"1px solid var(--bg)"}})]},h.id)})})]}),L.jsxs("div",{style:{flex:1,overflowY:"auto",padding:8,display:"flex",flexDirection:"column",gap:6},children:[t.length===0&&L.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text3)",fontSize:11,textAlign:"center",padding:16},children:e.id==="backlog"?d?L.jsx("span",{onClick:o,style:{cursor:"pointer",textDecoration:"underline",textUnderlineOffset:3},children:"No tasks — click + ADD TASK"}):"No tasks yet — add a repository in Settings to create your first task":e.id==="done"?"No completed tasks":"All clear"}),t.map(h=>L.jsx(Cf,{task:h,columnColor:e.color,agents:r,isAnimating:i.has(h.id),onApprove:a,onReject:f,onAgentClick:C,onTaskClick:c},h.id))]})]})}function $r({children:e}){return L.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",style:{width:"100%",height:"100%",display:"block"},children:e})}const ir=[{id:"backlog",title:"Backlog",icon:L.jsxs($r,{children:[L.jsx("rect",{x:"2.5",y:"3",width:"11",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),L.jsx("path",{d:"M5 6h6M5 8.5h6M5 11h3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})]}),statuses:["backlog","paused","aborted"],agentPrefix:null,color:"var(--text3)"},{id:"planning",title:"Planning",icon:L.jsxs($r,{children:[L.jsx("path",{d:"M4 12.5h2.25l5.75-5.75-2.25-2.25L4 10.25v2.25Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),L.jsx("path",{d:"M8.75 5.75 11 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"}),L.jsx("path",{d:"M3.5 13h9",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})]}),statuses:["workspace_setup","planning","awaiting_approval"],agentPrefix:"plan",color:"var(--steel2)"},{id:"implementation",title:"Implementation",icon:L.jsxs($r,{children:[L.jsx("path",{d:"m6.25 4.5 1.25-1.25 5 5L11.25 9.5l-.9-.9-1.6 1.6a1.5 1.5 0 0 1-2.12 0l-.83-.83a1.5 1.5 0 0 1 0-2.12l1.6-1.6-.9-.9Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),L.jsx("path",{d:"M4 12.25 7.5 8.75",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"}),L.jsx("path",{d:"m3.5 10.5 2 2",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})]}),statuses:["queued","implementing"],agentPrefix:"imp",color:"var(--green)"},{id:"review",title:"Review",icon:L.jsxs($r,{children:[L.jsx("path",{d:"M1.75 8s2.25-3.75 6.25-3.75S14.25 8 14.25 8 12 11.75 8 11.75 1.75 8 1.75 8Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),L.jsx("circle",{cx:"8",cy:"8",r:"1.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),statuses:["review"],agentPrefix:"rev",color:"var(--yellow)"},{id:"done",title:"Done",icon:L.jsxs($r,{children:[L.jsx("circle",{cx:"8",cy:"8",r:"5.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),L.jsx("path",{d:"m5.5 8 1.5 1.5 3.5-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]}),statuses:["done"],agentPrefix:null,color:"var(--green)"}];function xf({tasks:e,agents:t,onApprove:r,onReject:i,onAgentClick:a,onAddTask:f,onTaskClick:C,canCreateTask:o}){const c=q.useRef(new Map),[d,S]=q.useState(new Set);q.useEffect(()=>{const _=c.current,g=new Set;if(e.forEach(v=>{const u=_.get(v.id);u&&u!==v.status&&g.add(v.id)}),g.size>0){S(g);const v=setTimeout(()=>S(new Set),350);return()=>clearTimeout(v)}const x=new Map;e.forEach(v=>x.set(v.id,v.status)),c.current=x},[e]),q.useEffect(()=>{const _=new Map;e.forEach(g=>_.set(g.id,g.status)),c.current=_},[e]);const h=q.useMemo(()=>{const _={};ir.forEach(g=>{_[g.id]=[]}),e.forEach(g=>{if(g.status==="blocked"){const v=ir.find(u=>u.id===g.lastActiveStage);if(v){_[v.id].push(g);return}if(g.assignedTo){const u=ir.find(l=>l.agentPrefix&&g.assignedTo.startsWith(l.agentPrefix));if(u){_[u.id].push(g);return}}_.backlog.push(g);return}const x=ir.find(v=>v.statuses.includes(g.status));x?_[x.id].push(g):_.backlog.push(g)});for(const g of ir)_[g.id].sort((x,v)=>{if(x.status==="blocked"&&v.status!=="blocked")return-1;if(x.status!=="blocked"&&v.status==="blocked")return 1;const u=new Date(v.updatedAt).getTime()-new Date(x.updatedAt).getTime();return u!==0?u:x.id.localeCompare(v.id)});return _},[e]);return L.jsx("div",{style:{flex:1,display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:1,background:"var(--border)",minHeight:0,overflow:"hidden"},children:ir.map(_=>L.jsx(wf,{column:_,tasks:h[_.id],agents:t,animatingTasks:d,onApprove:r,onReject:i,onAgentClick:a,onAddTask:f,onTaskClick:C,canCreateTask:o},_.id))})}var Bu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var r={4567:function(C,o,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,m=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(m=(k<3?y(m):k>3?y(n,p,m):y(n,p))||m);return k>3&&m&&Object.defineProperty(n,p,m),m},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const h=c(9042),_=c(9924),g=c(844),x=c(4725),v=c(2585),u=c(3656);let l=o.AccessibilityManager=class extends g.Disposable{constructor(s,n,p,w){super(),this._terminal=s,this._coreBrowserService=p,this._renderService=w,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(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(y=>this._handleResize(y.rows))),this.register(this._terminal.onRender(y=>this._refreshRows(y.start,y.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(y=>this._handleChar(y))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
40
|
+
`+f.stack}return{value:e,source:t,stack:a,digest:null}}function gn(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function to(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var zd=typeof WeakMap=="function"?WeakMap:Map;function lu(e,t,r){r=pt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){ks||(ks=!0,ho=i),to(e,t)},r}function au(e,t,r){r=pt(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var a=t.value;r.payload=function(){return i(a)},r.callback=function(){to(e,t)}}var f=e.stateNode;return f!==null&&typeof f.componentDidCatch=="function"&&(r.callback=function(){to(e,t),typeof i!="function"&&(Pt===null?Pt=new Set([this]):Pt.add(this));var C=t.stack;this.componentDidCatch(t.value,{componentStack:C!==null?C:""})}),r}function ea(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new zd;var a=new Set;i.set(t,a)}else a=i.get(t),a===void 0&&(a=new Set,i.set(t,a));a.has(r)||(a.add(r),e=tf.bind(null,e,t,r),t.then(e,e))}function ta(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 ra(e,t,r,i,a){return e.mode&1?(e.flags|=65536,e.lanes=a,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=pt(-1,1),t.tag=2,Mt(r,t,1))),r.lanes|=1),e)}var Wd=St.ReactCurrentOwner,Pe=!1;function Le(e,t,r,i){t.child=e===null?jc(t,null,r,i):br(t,e.child,r,i)}function ia(e,t,r,i,a){r=r.render;var f=t.ref;return yr(t,a),i=qo(e,t,r,i,f,a),r=Yo(),e!==null&&!Pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,mt(e,t,a)):(ae&&r&&Oo(t),t.flags|=1,Le(e,t,i,a),t.child)}function sa(e,t,r,i,a){if(e===null){var f=r.type;return typeof f=="function"&&!nl(f)&&f.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=f,cu(e,t,f,i,a)):(e=is(r.type,null,i,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!(e.lanes&a)){var C=f.memoizedProps;if(r=r.compare,r=r!==null?r:di,r(C,i)&&e.ref===t.ref)return mt(e,t,a)}return t.flags|=1,e=Ot(f,i),e.ref=t.ref,e.return=t,t.child=e}function cu(e,t,r,i,a){if(e!==null){var f=e.memoizedProps;if(di(f,i)&&e.ref===t.ref)if(Pe=!1,t.pendingProps=i=f,(e.lanes&a)!==0)e.flags&131072&&(Pe=!0);else return t.lanes=e.lanes,mt(e,t,a)}return ro(e,t,r,i,a)}function uu(e,t,r){var i=t.pendingProps,a=i.children,f=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ne(_r,He),He|=r;else{if(!(r&1073741824))return e=f!==null?f.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ne(_r,He),He|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=f!==null?f.baseLanes:r,ne(_r,He),He|=i}else f!==null?(i=f.baseLanes|r,t.memoizedState=null):i=r,ne(_r,He),He|=i;return Le(e,t,a,r),t.child}function hu(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function ro(e,t,r,i,a){var f=Oe(r)?Yt:Re.current;return f=xr(t,f),yr(t,a),r=qo(e,t,r,i,f,a),i=Yo(),e!==null&&!Pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,mt(e,t,a)):(ae&&i&&Oo(t),t.flags|=1,Le(e,t,r,a),t.child)}function na(e,t,r,i,a){if(Oe(r)){var f=!0;ps(t)}else f=!1;if(yr(t,a),t.stateNode===null)es(e,t),ou(t,r,i),eo(t,r,i,a),i=!0;else if(e===null){var C=t.stateNode,o=t.memoizedProps;C.props=o;var c=C.context,d=r.contextType;typeof d=="object"&&d!==null?d=Ye(d):(d=Oe(r)?Yt:Re.current,d=xr(t,d));var S=r.getDerivedStateFromProps,h=typeof S=="function"||typeof C.getSnapshotBeforeUpdate=="function";h||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(o!==i||c!==d)&&Jl(t,C,i,d),kt=!1;var _=t.memoizedState;C.state=_,Ss(t,i,C,a),c=t.memoizedState,o!==i||_!==c||Be.current||kt?(typeof S=="function"&&(Jn(t,r,S,i),c=t.memoizedState),(o=kt||Zl(t,r,o,i,_,c,d))?(h||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(t.flags|=4194308)):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),C.props=i,C.state=c,C.context=d,i=o):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{C=t.stateNode,Nc(e,t),o=t.memoizedProps,d=t.type===t.elementType?o:Ze(t.type,o),C.props=d,h=t.pendingProps,_=C.context,c=r.contextType,typeof c=="object"&&c!==null?c=Ye(c):(c=Oe(r)?Yt:Re.current,c=xr(t,c));var g=r.getDerivedStateFromProps;(S=typeof g=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(o!==h||_!==c)&&Jl(t,C,i,c),kt=!1,_=t.memoizedState,C.state=_,Ss(t,i,C,a);var x=t.memoizedState;o!==h||_!==x||Be.current||kt?(typeof g=="function"&&(Jn(t,r,g,i),x=t.memoizedState),(d=kt||Zl(t,r,d,i,_,x,c)||!1)?(S||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(i,x,c),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(i,x,c)),typeof C.componentDidUpdate=="function"&&(t.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof C.componentDidUpdate!="function"||o===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=x),C.props=i,C.state=x,C.context=c,i=d):(typeof C.componentDidUpdate!="function"||o===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),i=!1)}return io(e,t,r,i,f,a)}function io(e,t,r,i,a,f){hu(e,t);var C=(t.flags&128)!==0;if(!i&&!C)return a&&$l(t,r,!1),mt(e,t,f);i=t.stateNode,Wd.current=t;var o=C&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&C?(t.child=br(t,e.child,null,f),t.child=br(t,null,o,f)):Le(e,t,o,f),t.memoizedState=i.state,a&&$l(t,r,!0),t.child}function du(e){var t=e.stateNode;t.pendingContext?Ul(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ul(e,t.context,!1),$o(e,t.containerInfo)}function oa(e,t,r,i,a){return kr(),Ho(a),t.flags|=256,Le(e,t,r,i),t.child}var so={dehydrated:null,treeContext:null,retryLane:0};function no(e){return{baseLanes:e,cachePool:null,transitions:null}}function fu(e,t,r){var i=t.pendingProps,a=ue.current,f=!1,C=(t.flags&128)!==0,o;if((o=C)||(o=e!==null&&e.memoizedState===null?!1:(a&2)!==0),o?(f=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),ne(ue,a&1),e===null)return Qn(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):(C=i.children,e=i.fallback,f?(i=t.mode,f=t.child,C={mode:"hidden",children:C},!(i&1)&&f!==null?(f.childLanes=0,f.pendingProps=C):f=Ns(C,i,0,null),e=qt(e,i,r,null),f.return=t,e.return=t,f.sibling=e,t.child=f,t.child.memoizedState=no(r),t.memoizedState=so,e):Zo(t,C));if(a=e.memoizedState,a!==null&&(o=a.dehydrated,o!==null))return Ud(e,t,C,i,o,a,r);if(f){f=i.fallback,C=t.mode,a=e.child,o=a.sibling;var c={mode:"hidden",children:i.children};return!(C&1)&&t.child!==a?(i=t.child,i.childLanes=0,i.pendingProps=c,t.deletions=null):(i=Ot(a,c),i.subtreeFlags=a.subtreeFlags&14680064),o!==null?f=Ot(o,f):(f=qt(f,C,r,null),f.flags|=2),f.return=t,i.return=t,i.sibling=f,t.child=i,i=f,f=t.child,C=e.child.memoizedState,C=C===null?no(r):{baseLanes:C.baseLanes|r,cachePool:null,transitions:C.transitions},f.memoizedState=C,f.childLanes=e.childLanes&~r,t.memoizedState=so,i}return f=e.child,e=f.sibling,i=Ot(f,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Zo(e,t){return t=Ns({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Wi(e,t,r,i){return i!==null&&Ho(i),br(t,e.child,null,r),e=Zo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ud(e,t,r,i,a,f,C){if(r)return t.flags&256?(t.flags&=-257,i=gn(Error(G(422))),Wi(e,t,C,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(f=i.fallback,a=t.mode,i=Ns({mode:"visible",children:i.children},a,0,null),f=qt(f,a,C,null),f.flags|=2,i.return=t,f.return=t,i.sibling=f,t.child=i,t.mode&1&&br(t,e.child,null,C),t.child.memoizedState=no(C),t.memoizedState=so,f);if(!(t.mode&1))return Wi(e,t,C,null);if(a.data==="$!"){if(i=a.nextSibling&&a.nextSibling.dataset,i)var o=i.dgst;return i=o,f=Error(G(419)),i=gn(f,i,void 0),Wi(e,t,C,i)}if(o=(C&e.childLanes)!==0,Pe||o){if(i=ye,i!==null){switch(C&-C){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(i.suspendedLanes|C)?0:a,a!==0&&a!==f.retryLane&&(f.retryLane=a,gt(e,a),rt(i,e,a,-1))}return sl(),i=gn(Error(G(421))),Wi(e,t,C,i)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=rf.bind(null,e),a._reactRetry=t,null):(e=f.treeContext,Ne=It(a.nextSibling),Fe=t,ae=!0,et=null,e!==null&&(Ke[Ve++]=dt,Ke[Ve++]=ft,Ke[Ve++]=Xt,dt=e.id,ft=e.overflow,Xt=t),t=Zo(t,i.children),t.flags|=4096,t)}function la(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Zn(e.return,t,r)}function mn(e,t,r,i,a){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:a}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=i,f.tail=r,f.tailMode=a)}function pu(e,t,r){var i=t.pendingProps,a=i.revealOrder,f=i.tail;if(Le(e,t,i.children,r),i=ue.current,i&2)i=i&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&&la(e,r,t);else if(e.tag===19)la(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}i&=1}if(ne(ue,i),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&ys(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),mn(t,!1,a,r,f);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&ys(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}mn(t,!0,r,null,f);break;case"together":mn(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function es(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function mt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Zt|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,r=Ot(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Ot(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function $d(e,t,r){switch(t.tag){case 3:du(t),kr();break;case 5:Fc(t);break;case 1:Oe(t.type)&&ps(t);break;case 4:$o(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,a=t.memoizedProps.value;ne(gs,i._currentValue),i._currentValue=a;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(ne(ue,ue.current&1),t.flags|=128,null):r&t.child.childLanes?fu(e,t,r):(ne(ue,ue.current&1),e=mt(e,t,r),e!==null?e.sibling:null);ne(ue,ue.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return pu(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ne(ue,ue.current),i)break;return null;case 22:case 23:return t.lanes=0,uu(e,t,r)}return mt(e,t,r)}var _u,oo,vu,gu;_u=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}};oo=function(){};vu=function(e,t,r,i){var a=e.memoizedProps;if(a!==i){e=t.stateNode,Vt(ct.current);var f=null;switch(r){case"input":a=Ln(e,a),i=Ln(e,i),f=[];break;case"select":a=de({},a,{value:void 0}),i=de({},i,{value:void 0}),f=[];break;case"textarea":a=An(e,a),i=An(e,i),f=[];break;default:typeof a.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=ds)}Mn(r,i);var C;r=null;for(d in a)if(!i.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var o=a[d];for(C in o)o.hasOwnProperty(C)&&(r||(r={}),r[C]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(ni.hasOwnProperty(d)?f||(f=[]):(f=f||[]).push(d,null));for(d in i){var c=i[d];if(o=a!=null?a[d]:void 0,i.hasOwnProperty(d)&&c!==o&&(c!=null||o!=null))if(d==="style")if(o){for(C in o)!o.hasOwnProperty(C)||c&&c.hasOwnProperty(C)||(r||(r={}),r[C]="");for(C in c)c.hasOwnProperty(C)&&o[C]!==c[C]&&(r||(r={}),r[C]=c[C])}else r||(f||(f=[]),f.push(d,r)),r=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(f=f||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(f=f||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(ni.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&oe("scroll",e),f||o===c||(f=[])):(f=f||[]).push(d,c))}r&&(f=f||[]).push("style",r);var d=f;(t.updateQueue=d)&&(t.flags|=4)}};gu=function(e,t,r,i){r!==i&&(t.flags|=4)};function Wr(e,t){if(!ae)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 i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function be(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,i|=a.subtreeFlags&14680064,i|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,i|=a.subtreeFlags,i|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function Kd(e,t,r){var i=t.pendingProps;switch(jo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return be(t),null;case 1:return Oe(t.type)&&fs(),be(t),null;case 3:return i=t.stateNode,Er(),le(Be),le(Re),Vo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,et!==null&&(_o(et),et=null))),oo(e,t),be(t),null;case 5:Ko(t);var a=Vt(gi.current);if(r=t.type,e!==null&&t.stateNode!=null)vu(e,t,r,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(G(166));return be(t),null}if(e=Vt(ct.current),Fi(t)){i=t.stateNode,r=t.type;var f=t.memoizedProps;switch(i[lt]=t,i[_i]=f,e=(t.mode&1)!==0,r){case"dialog":oe("cancel",i),oe("close",i);break;case"iframe":case"object":case"embed":oe("load",i);break;case"video":case"audio":for(a=0;a<Yr.length;a++)oe(Yr[a],i);break;case"source":oe("error",i);break;case"img":case"image":case"link":oe("error",i),oe("load",i);break;case"details":oe("toggle",i);break;case"input":vl(i,f),oe("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!f.multiple},oe("invalid",i);break;case"textarea":ml(i,f),oe("invalid",i)}Mn(r,f),a=null;for(var C in f)if(f.hasOwnProperty(C)){var o=f[C];C==="children"?typeof o=="string"?i.textContent!==o&&(f.suppressHydrationWarning!==!0&&Ni(i.textContent,o,e),a=["children",o]):typeof o=="number"&&i.textContent!==""+o&&(f.suppressHydrationWarning!==!0&&Ni(i.textContent,o,e),a=["children",""+o]):ni.hasOwnProperty(C)&&o!=null&&C==="onScroll"&&oe("scroll",i)}switch(r){case"input":Ai(i),gl(i,f,!0);break;case"textarea":Ai(i),Sl(i);break;case"select":case"option":break;default:typeof f.onClick=="function"&&(i.onclick=ds)}i=a,t.updateQueue=i,i!==null&&(t.flags|=4)}else{C=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ka(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=C.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=C.createElement(r,{is:i.is}):(e=C.createElement(r),r==="select"&&(C=e,i.multiple?C.multiple=!0:i.size&&(C.size=i.size))):e=C.createElementNS(e,r),e[lt]=t,e[_i]=i,_u(e,t,!1,!1),t.stateNode=e;e:{switch(C=Pn(r,i),r){case"dialog":oe("cancel",e),oe("close",e),a=i;break;case"iframe":case"object":case"embed":oe("load",e),a=i;break;case"video":case"audio":for(a=0;a<Yr.length;a++)oe(Yr[a],e);a=i;break;case"source":oe("error",e),a=i;break;case"img":case"image":case"link":oe("error",e),oe("load",e),a=i;break;case"details":oe("toggle",e),a=i;break;case"input":vl(e,i),a=Ln(e,i),oe("invalid",e);break;case"option":a=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},a=de({},i,{value:void 0}),oe("invalid",e);break;case"textarea":ml(e,i),a=An(e,i),oe("invalid",e);break;default:a=i}Mn(r,a),o=a;for(f in o)if(o.hasOwnProperty(f)){var c=o[f];f==="style"?qa(e,c):f==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Va(e,c)):f==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&oi(e,c):typeof c=="number"&&oi(e,""+c):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(ni.hasOwnProperty(f)?c!=null&&f==="onScroll"&&oe("scroll",e):c!=null&&wo(e,f,c,C))}switch(r){case"input":Ai(e),gl(e,i,!1);break;case"textarea":Ai(e),Sl(e);break;case"option":i.value!=null&&e.setAttribute("value",""+jt(i.value));break;case"select":e.multiple=!!i.multiple,f=i.value,f!=null?vr(e,!!i.multiple,f,!1):i.defaultValue!=null&&vr(e,!!i.multiple,i.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=ds)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return be(t),null;case 6:if(e&&t.stateNode!=null)gu(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(G(166));if(r=Vt(gi.current),Vt(ct.current),Fi(t)){if(i=t.stateNode,r=t.memoizedProps,i[lt]=t,(f=i.nodeValue!==r)&&(e=Fe,e!==null))switch(e.tag){case 3:Ni(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ni(i.nodeValue,r,(e.mode&1)!==0)}f&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[lt]=t,t.stateNode=i}return be(t),null;case 13:if(le(ue),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ae&&Ne!==null&&t.mode&1&&!(t.flags&128))Bc(),kr(),t.flags|=98560,f=!1;else if(f=Fi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!f)throw Error(G(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(G(317));f[lt]=t}else kr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;be(t),f=!1}else et!==null&&(_o(et),et=null),f=!0;if(!f)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||ue.current&1?me===0&&(me=3):sl())),t.updateQueue!==null&&(t.flags|=4),be(t),null);case 4:return Er(),oo(e,t),e===null&&fi(t.stateNode.containerInfo),be(t),null;case 10:return zo(t.type._context),be(t),null;case 17:return Oe(t.type)&&fs(),be(t),null;case 19:if(le(ue),f=t.memoizedState,f===null)return be(t),null;if(i=(t.flags&128)!==0,C=f.rendering,C===null)if(i)Wr(f,!1);else{if(me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(C=ys(e),C!==null){for(t.flags|=128,Wr(f,!1),i=C.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)f=r,e=i,f.flags&=14680066,C=f.alternate,C===null?(f.childLanes=0,f.lanes=e,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=C.childLanes,f.lanes=C.lanes,f.child=C.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=C.memoizedProps,f.memoizedState=C.memoizedState,f.updateQueue=C.updateQueue,f.type=C.type,e=C.dependencies,f.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ne(ue,ue.current&1|2),t.child}e=e.sibling}f.tail!==null&&_e()>Lr&&(t.flags|=128,i=!0,Wr(f,!1),t.lanes=4194304)}else{if(!i)if(e=ys(C),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Wr(f,!0),f.tail===null&&f.tailMode==="hidden"&&!C.alternate&&!ae)return be(t),null}else 2*_e()-f.renderingStartTime>Lr&&r!==1073741824&&(t.flags|=128,i=!0,Wr(f,!1),t.lanes=4194304);f.isBackwards?(C.sibling=t.child,t.child=C):(r=f.last,r!==null?r.sibling=C:t.child=C,f.last=C)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=_e(),t.sibling=null,r=ue.current,ne(ue,i?r&1|2:r&1),t):(be(t),null);case 22:case 23:return il(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?He&1073741824&&(be(t),t.subtreeFlags&6&&(t.flags|=8192)):be(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function Vd(e,t){switch(jo(t),t.tag){case 1:return Oe(t.type)&&fs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Er(),le(Be),le(Re),Vo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ko(t),null;case 13:if(le(ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(ue),null;case 4:return Er(),null;case 10:return zo(t.type._context),null;case 22:case 23:return il(),null;case 24:return null;default:return null}}var Ui=!1,Ee=!1,Gd=typeof WeakSet=="function"?WeakSet:Set,Z=null;function pr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){pe(e,t,i)}else r.current=null}function lo(e,t,r){try{r()}catch(i){pe(e,t,i)}}var aa=!1;function qd(e,t){if($n=cs,e=wc(),Bo(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{r.nodeType,f.nodeType}catch{r=null;break e}var C=0,o=-1,c=-1,d=0,S=0,h=e,_=null;t:for(;;){for(var g;h!==r||a!==0&&h.nodeType!==3||(o=C+a),h!==f||i!==0&&h.nodeType!==3||(c=C+i),h.nodeType===3&&(C+=h.nodeValue.length),(g=h.firstChild)!==null;)_=h,h=g;for(;;){if(h===e)break t;if(_===r&&++d===a&&(o=C),_===f&&++S===i&&(c=C),(g=h.nextSibling)!==null)break;h=_,_=h.parentNode}h=g}r=o===-1||c===-1?null:{start:o,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Kn={focusedElem:e,selectionRange:r},cs=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,u=x.memoizedState,l=t.stateNode,s=l.getSnapshotBeforeUpdate(t.elementType===t.type?v:Ze(t.type,v),u);l.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var n=t.stateNode.containerInfo;n.nodeType===1?n.textContent="":n.nodeType===9&&n.documentElement&&n.removeChild(n.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(p){pe(t,t.return,p)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return x=aa,aa=!1,x}function ri(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var a=i=i.next;do{if((a.tag&e)===e){var f=a.destroy;a.destroy=void 0,f!==void 0&&lo(t,r,f)}a=a.next}while(a!==i)}}function js(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 i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function ao(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 mu(e){var t=e.alternate;t!==null&&(e.alternate=null,mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[lt],delete t[_i],delete t[qn],delete t[Td],delete t[Ad])),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 Su(e){return e.tag===5||e.tag===3||e.tag===4}function ca(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Su(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 co(e,t,r){var i=e.tag;if(i===5||i===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=ds));else if(i!==4&&(e=e.child,e!==null))for(co(e,t,r),e=e.sibling;e!==null;)co(e,t,r),e=e.sibling}function uo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(uo(e,t,r),e=e.sibling;e!==null;)uo(e,t,r),e=e.sibling}var Ce=null,Je=!1;function wt(e,t,r){for(r=r.child;r!==null;)yu(e,t,r),r=r.sibling}function yu(e,t,r){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(Ds,r)}catch{}switch(r.tag){case 5:Ee||pr(r,t);case 6:var i=Ce,a=Je;Ce=null,wt(e,t,r),Ce=i,Je=a,Ce!==null&&(Je?(e=Ce,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ce.removeChild(r.stateNode));break;case 18:Ce!==null&&(Je?(e=Ce,r=r.stateNode,e.nodeType===8?hn(e.parentNode,r):e.nodeType===1&&hn(e,r),ui(e)):hn(Ce,r.stateNode));break;case 4:i=Ce,a=Je,Ce=r.stateNode.containerInfo,Je=!0,wt(e,t,r),Ce=i,Je=a;break;case 0:case 11:case 14:case 15:if(!Ee&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){a=i=i.next;do{var f=a,C=f.destroy;f=f.tag,C!==void 0&&(f&2||f&4)&&lo(r,t,C),a=a.next}while(a!==i)}wt(e,t,r);break;case 1:if(!Ee&&(pr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(o){pe(r,t,o)}wt(e,t,r);break;case 21:wt(e,t,r);break;case 22:r.mode&1?(Ee=(i=Ee)||r.memoizedState!==null,wt(e,t,r),Ee=i):wt(e,t,r);break;default:wt(e,t,r)}}function ua(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Gd),t.forEach(function(i){var a=sf.bind(null,e,i);r.has(i)||(r.add(i),i.then(a,a))})}}function Qe(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i];try{var f=e,C=t,o=C;e:for(;o!==null;){switch(o.tag){case 5:Ce=o.stateNode,Je=!1;break e;case 3:Ce=o.stateNode.containerInfo,Je=!0;break e;case 4:Ce=o.stateNode.containerInfo,Je=!0;break e}o=o.return}if(Ce===null)throw Error(G(160));yu(f,C,a),Ce=null,Je=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){pe(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Cu(t,e),t=t.sibling}function Cu(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Qe(t,e),nt(e),i&4){try{ri(3,e,e.return),js(3,e)}catch(v){pe(e,e.return,v)}try{ri(5,e,e.return)}catch(v){pe(e,e.return,v)}}break;case 1:Qe(t,e),nt(e),i&512&&r!==null&&pr(r,r.return);break;case 5:if(Qe(t,e),nt(e),i&512&&r!==null&&pr(r,r.return),e.flags&32){var a=e.stateNode;try{oi(a,"")}catch(v){pe(e,e.return,v)}}if(i&4&&(a=e.stateNode,a!=null)){var f=e.memoizedProps,C=r!==null?r.memoizedProps:f,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&f.type==="radio"&&f.name!=null&&Ua(a,f),Pn(o,C);var d=Pn(o,f);for(C=0;C<c.length;C+=2){var S=c[C],h=c[C+1];S==="style"?qa(a,h):S==="dangerouslySetInnerHTML"?Va(a,h):S==="children"?oi(a,h):wo(a,S,h,d)}switch(o){case"input":Dn(a,f);break;case"textarea":$a(a,f);break;case"select":var _=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!f.multiple;var g=f.value;g!=null?vr(a,!!f.multiple,g,!1):_!==!!f.multiple&&(f.defaultValue!=null?vr(a,!!f.multiple,f.defaultValue,!0):vr(a,!!f.multiple,f.multiple?[]:"",!1))}a[_i]=f}catch(v){pe(e,e.return,v)}}break;case 6:if(Qe(t,e),nt(e),i&4){if(e.stateNode===null)throw Error(G(162));a=e.stateNode,f=e.memoizedProps;try{a.nodeValue=f}catch(v){pe(e,e.return,v)}}break;case 3:if(Qe(t,e),nt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{ui(t.containerInfo)}catch(v){pe(e,e.return,v)}break;case 4:Qe(t,e),nt(e);break;case 13:Qe(t,e),nt(e),a=e.child,a.flags&8192&&(f=a.memoizedState!==null,a.stateNode.isHidden=f,!f||a.alternate!==null&&a.alternate.memoizedState!==null||(tl=_e())),i&4&&ua(e);break;case 22:if(S=r!==null&&r.memoizedState!==null,e.mode&1?(Ee=(d=Ee)||S,Qe(t,e),Ee=d):Qe(t,e),nt(e),i&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!S&&e.mode&1)for(Z=e,S=e.child;S!==null;){for(h=Z=S;Z!==null;){switch(_=Z,g=_.child,_.tag){case 0:case 11:case 14:case 15:ri(4,_,_.return);break;case 1:pr(_,_.return);var x=_.stateNode;if(typeof x.componentWillUnmount=="function"){i=_,r=_.return;try{t=i,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(v){pe(i,r,v)}}break;case 5:pr(_,_.return);break;case 22:if(_.memoizedState!==null){da(h);continue}}g!==null?(g.return=_,Z=g):da(h)}S=S.sibling}e:for(S=null,h=e;;){if(h.tag===5){if(S===null){S=h;try{a=h.stateNode,d?(f=a.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none"):(o=h.stateNode,c=h.memoizedProps.style,C=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=Ga("display",C))}catch(v){pe(e,e.return,v)}}}else if(h.tag===6){if(S===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(v){pe(e,e.return,v)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;S===h&&(S=null),h=h.return}S===h&&(S=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Qe(t,e),nt(e),i&4&&ua(e);break;case 21:break;default:Qe(t,e),nt(e)}}function nt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Su(r)){var i=r;break e}r=r.return}throw Error(G(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(oi(a,""),i.flags&=-33);var f=ca(e);uo(e,f,a);break;case 3:case 4:var C=i.stateNode.containerInfo,o=ca(e);co(e,o,C);break;default:throw Error(G(161))}}catch(c){pe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Yd(e,t,r){Z=e,wu(e)}function wu(e,t,r){for(var i=(e.mode&1)!==0;Z!==null;){var a=Z,f=a.child;if(a.tag===22&&i){var C=a.memoizedState!==null||Ui;if(!C){var o=a.alternate,c=o!==null&&o.memoizedState!==null||Ee;o=Ui;var d=Ee;if(Ui=C,(Ee=c)&&!d)for(Z=a;Z!==null;)C=Z,c=C.child,C.tag===22&&C.memoizedState!==null?fa(a):c!==null?(c.return=C,Z=c):fa(a);for(;f!==null;)Z=f,wu(f),f=f.sibling;Z=a,Ui=o,Ee=d}ha(e)}else a.subtreeFlags&8772&&f!==null?(f.return=a,Z=f):ha(e)}}function ha(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ee||js(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ee)if(r===null)i.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:Ze(t.type,r.memoizedProps);i.componentDidUpdate(a,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var f=t.updateQueue;f!==null&&Yl(t,f,i);break;case 3:var C=t.updateQueue;if(C!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Yl(t,C,r)}break;case 5:var o=t.stateNode;if(r===null&&t.flags&4){r=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var S=d.memoizedState;if(S!==null){var h=S.dehydrated;h!==null&&ui(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}Ee||t.flags&512&&ao(t)}catch(_){pe(t,t.return,_)}}if(t===e){Z=null;break}if(r=t.sibling,r!==null){r.return=t.return,Z=r;break}Z=t.return}}function da(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Z=r;break}Z=t.return}}function fa(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{js(4,t)}catch(c){pe(t,r,c)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var a=t.return;try{i.componentDidMount()}catch(c){pe(t,a,c)}}var f=t.return;try{ao(t)}catch(c){pe(t,f,c)}break;case 5:var C=t.return;try{ao(t)}catch(c){pe(t,C,c)}}}catch(c){pe(t,t.return,c)}if(t===e){Z=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Z=o;break}Z=t.return}}var Xd=Math.ceil,xs=St.ReactCurrentDispatcher,Jo=St.ReactCurrentOwner,qe=St.ReactCurrentBatchConfig,re=0,ye=null,ve=null,we=0,He=0,_r=Ft(0),me=0,Ci=null,Zt=0,Hs=0,el=0,ii=null,Me=null,tl=0,Lr=1/0,ut=null,ks=!1,ho=null,Pt=null,$i=!1,Lt=null,bs=0,si=0,fo=null,ts=-1,rs=0;function De(){return re&6?_e():ts!==-1?ts:ts=_e()}function Bt(e){return e.mode&1?re&2&&we!==0?we&-we:Md.transition!==null?(rs===0&&(rs=oc()),rs):(e=se,e!==0||(e=window.event,e=e===void 0?16:fc(e.type)),e):1}function rt(e,t,r,i){if(50<si)throw si=0,fo=null,Error(G(185));xi(e,r,i),(!(re&2)||e!==ye)&&(e===ye&&(!(re&2)&&(Hs|=r),me===4&&Et(e,we)),je(e,i),r===1&&re===0&&!(t.mode&1)&&(Lr=_e()+500,Ps&&zt()))}function je(e,t){var r=e.callbackNode;Mh(e,t);var i=as(e,e===ye?we:0);if(i===0)r!==null&&wl(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&wl(r),t===1)e.tag===0?Id(pa.bind(null,e)):Ic(pa.bind(null,e)),Ld(function(){!(re&6)&&zt()}),r=null;else{switch(lc(i)){case 1:r=Ro;break;case 4:r=sc;break;case 16:r=ls;break;case 536870912:r=nc;break;default:r=ls}r=Tu(r,xu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function xu(e,t){if(ts=-1,rs=0,re&6)throw Error(G(327));var r=e.callbackNode;if(Cr()&&e.callbackNode!==r)return null;var i=as(e,e===ye?we:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=Es(e,i);else{t=i;var a=re;re|=2;var f=bu();(ye!==e||we!==t)&&(ut=null,Lr=_e()+500,Gt(e,t));do try{Jd();break}catch(o){ku(e,o)}while(!0);Fo(),xs.current=f,re=a,ve!==null?t=0:(ye=null,we=0,t=me)}if(t!==0){if(t===2&&(a=Nn(e),a!==0&&(i=a,t=po(e,a))),t===1)throw r=Ci,Gt(e,0),Et(e,i),je(e,_e()),r;if(t===6)Et(e,i);else{if(a=e.current.alternate,!(i&30)&&!Qd(a)&&(t=Es(e,i),t===2&&(f=Nn(e),f!==0&&(i=f,t=po(e,f))),t===1))throw r=Ci,Gt(e,0),Et(e,i),je(e,_e()),r;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(G(345));case 2:Ut(e,Me,ut);break;case 3:if(Et(e,i),(i&130023424)===i&&(t=tl+500-_e(),10<t)){if(as(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){De(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Gn(Ut.bind(null,e,Me,ut),t);break}Ut(e,Me,ut);break;case 4:if(Et(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var C=31-tt(i);f=1<<C,C=t[C],C>a&&(a=C),i&=~f}if(i=a,i=_e()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Xd(i/1960))-i,10<i){e.timeoutHandle=Gn(Ut.bind(null,e,Me,ut),i);break}Ut(e,Me,ut);break;case 5:Ut(e,Me,ut);break;default:throw Error(G(329))}}}return je(e,_e()),e.callbackNode===r?xu.bind(null,e):null}function po(e,t){var r=ii;return e.current.memoizedState.isDehydrated&&(Gt(e,t).flags|=256),e=Es(e,t),e!==2&&(t=Me,Me=r,t!==null&&_o(t)),e}function _o(e){Me===null?Me=e:Me.push.apply(Me,e)}function Qd(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var a=r[i],f=a.getSnapshot;a=a.value;try{if(!it(f(),a))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 Et(e,t){for(t&=~el,t&=~Hs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-tt(t),i=1<<r;e[r]=-1,t&=~i}}function pa(e){if(re&6)throw Error(G(327));Cr();var t=as(e,0);if(!(t&1))return je(e,_e()),null;var r=Es(e,t);if(e.tag!==0&&r===2){var i=Nn(e);i!==0&&(t=i,r=po(e,i))}if(r===1)throw r=Ci,Gt(e,0),Et(e,t),je(e,_e()),r;if(r===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ut(e,Me,ut),je(e,_e()),null}function rl(e,t){var r=re;re|=1;try{return e(t)}finally{re=r,re===0&&(Lr=_e()+500,Ps&&zt())}}function Jt(e){Lt!==null&&Lt.tag===0&&!(re&6)&&Cr();var t=re;re|=1;var r=qe.transition,i=se;try{if(qe.transition=null,se=1,e)return e()}finally{se=i,qe.transition=r,re=t,!(re&6)&&zt()}}function il(){He=_r.current,le(_r)}function Gt(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Rd(r)),ve!==null)for(r=ve.return;r!==null;){var i=r;switch(jo(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&fs();break;case 3:Er(),le(Be),le(Re),Vo();break;case 5:Ko(i);break;case 4:Er();break;case 13:le(ue);break;case 19:le(ue);break;case 10:zo(i.type._context);break;case 22:case 23:il()}r=r.return}if(ye=e,ve=e=Ot(e.current,null),we=He=t,me=0,Ci=null,el=Hs=Zt=0,Me=ii=null,Kt!==null){for(t=0;t<Kt.length;t++)if(r=Kt[t],i=r.interleaved,i!==null){r.interleaved=null;var a=i.next,f=r.pending;if(f!==null){var C=f.next;f.next=a,i.next=C}r.pending=i}Kt=null}return e}function ku(e,t){do{var r=ve;try{if(Fo(),Zi.current=ws,Cs){for(var i=he.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Cs=!1}if(Qt=0,Se=ge=he=null,ti=!1,mi=0,Jo.current=null,r===null||r.return===null){me=1,Ci=t,ve=null;break}e:{var f=e,C=r.return,o=r,c=t;if(t=we,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,S=o,h=S.tag;if(!(S.mode&1)&&(h===0||h===11||h===15)){var _=S.alternate;_?(S.updateQueue=_.updateQueue,S.memoizedState=_.memoizedState,S.lanes=_.lanes):(S.updateQueue=null,S.memoizedState=null)}var g=ta(C);if(g!==null){g.flags&=-257,ra(g,C,o,f,t),g.mode&1&&ea(f,d,t),t=g,c=d;var x=t.updateQueue;if(x===null){var v=new Set;v.add(c),t.updateQueue=v}else x.add(c);break e}else{if(!(t&1)){ea(f,d,t),sl();break e}c=Error(G(426))}}else if(ae&&o.mode&1){var u=ta(C);if(u!==null){!(u.flags&65536)&&(u.flags|=256),ra(u,C,o,f,t),Ho(Rr(c,o));break e}}f=c=Rr(c,o),me!==4&&(me=2),ii===null?ii=[f]:ii.push(f),f=C;do{switch(f.tag){case 3:f.flags|=65536,t&=-t,f.lanes|=t;var l=lu(f,c,t);ql(f,l);break e;case 1:o=c;var s=f.type,n=f.stateNode;if(!(f.flags&128)&&(typeof s.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Pt===null||!Pt.has(n)))){f.flags|=65536,t&=-t,f.lanes|=t;var p=au(f,o,t);ql(f,p);break e}}f=f.return}while(f!==null)}Ru(r)}catch(w){t=w,ve===r&&r!==null&&(ve=r=r.return);continue}break}while(!0)}function bu(){var e=xs.current;return xs.current=ws,e===null?ws:e}function sl(){(me===0||me===3||me===2)&&(me=4),ye===null||!(Zt&268435455)&&!(Hs&268435455)||Et(ye,we)}function Es(e,t){var r=re;re|=2;var i=bu();(ye!==e||we!==t)&&(ut=null,Gt(e,t));do try{Zd();break}catch(a){ku(e,a)}while(!0);if(Fo(),re=r,xs.current=i,ve!==null)throw Error(G(261));return ye=null,we=0,me}function Zd(){for(;ve!==null;)Eu(ve)}function Jd(){for(;ve!==null&&!kh();)Eu(ve)}function Eu(e){var t=Du(e.alternate,e,He);e.memoizedProps=e.pendingProps,t===null?Ru(e):ve=t,Jo.current=null}function Ru(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Vd(r,t),r!==null){r.flags&=32767,ve=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{me=6,ve=null;return}}else if(r=Kd(r,t,He),r!==null){ve=r;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);me===0&&(me=5)}function Ut(e,t,r){var i=se,a=qe.transition;try{qe.transition=null,se=1,ef(e,t,r,i)}finally{qe.transition=a,se=i}return null}function ef(e,t,r,i){do Cr();while(Lt!==null);if(re&6)throw Error(G(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var f=r.lanes|r.childLanes;if(Ph(e,f),e===ye&&(ve=ye=null,we=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||$i||($i=!0,Tu(ls,function(){return Cr(),null})),f=(r.flags&15990)!==0,r.subtreeFlags&15990||f){f=qe.transition,qe.transition=null;var C=se;se=1;var o=re;re|=4,Jo.current=null,qd(e,r),Cu(r,e),yd(Kn),cs=!!$n,Kn=$n=null,e.current=r,Yd(r),bh(),re=o,se=C,qe.transition=f}else e.current=r;if($i&&($i=!1,Lt=e,bs=a),f=e.pendingLanes,f===0&&(Pt=null),Lh(r.stateNode),je(e,_e()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],i(a.value,{componentStack:a.stack,digest:a.digest});if(ks)throw ks=!1,e=ho,ho=null,e;return bs&1&&e.tag!==0&&Cr(),f=e.pendingLanes,f&1?e===fo?si++:(si=0,fo=e):si=0,zt(),null}function Cr(){if(Lt!==null){var e=lc(bs),t=qe.transition,r=se;try{if(qe.transition=null,se=16>e?16:e,Lt===null)var i=!1;else{if(e=Lt,Lt=null,bs=0,re&6)throw Error(G(331));var a=re;for(re|=4,Z=e.current;Z!==null;){var f=Z,C=f.child;if(Z.flags&16){var o=f.deletions;if(o!==null){for(var c=0;c<o.length;c++){var d=o[c];for(Z=d;Z!==null;){var S=Z;switch(S.tag){case 0:case 11:case 15:ri(8,S,f)}var h=S.child;if(h!==null)h.return=S,Z=h;else for(;Z!==null;){S=Z;var _=S.sibling,g=S.return;if(mu(S),S===d){Z=null;break}if(_!==null){_.return=g,Z=_;break}Z=g}}}var x=f.alternate;if(x!==null){var v=x.child;if(v!==null){x.child=null;do{var u=v.sibling;v.sibling=null,v=u}while(v!==null)}}Z=f}}if(f.subtreeFlags&2064&&C!==null)C.return=f,Z=C;else e:for(;Z!==null;){if(f=Z,f.flags&2048)switch(f.tag){case 0:case 11:case 15:ri(9,f,f.return)}var l=f.sibling;if(l!==null){l.return=f.return,Z=l;break e}Z=f.return}}var s=e.current;for(Z=s;Z!==null;){C=Z;var n=C.child;if(C.subtreeFlags&2064&&n!==null)n.return=C,Z=n;else e:for(C=s;Z!==null;){if(o=Z,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:js(9,o)}}catch(w){pe(o,o.return,w)}if(o===C){Z=null;break e}var p=o.sibling;if(p!==null){p.return=o.return,Z=p;break e}Z=o.return}}if(re=a,zt(),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Ds,e)}catch{}i=!0}return i}finally{se=r,qe.transition=t}}return!1}function _a(e,t,r){t=Rr(r,t),t=lu(e,t,1),e=Mt(e,t,1),t=De(),e!==null&&(xi(e,1,t),je(e,t))}function pe(e,t,r){if(e.tag===3)_a(e,e,r);else for(;t!==null;){if(t.tag===3){_a(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Pt===null||!Pt.has(i))){e=Rr(r,e),e=au(t,e,1),t=Mt(t,e,1),e=De(),t!==null&&(xi(t,1,e),je(t,e));break}}t=t.return}}function tf(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=De(),e.pingedLanes|=e.suspendedLanes&r,ye===e&&(we&r)===r&&(me===4||me===3&&(we&130023424)===we&&500>_e()-tl?Gt(e,0):el|=r),je(e,t)}function Lu(e,t){t===0&&(e.mode&1?(t=Pi,Pi<<=1,!(Pi&130023424)&&(Pi=4194304)):t=1);var r=De();e=gt(e,t),e!==null&&(xi(e,t,r),je(e,r))}function rf(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Lu(e,r)}function sf(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(G(314))}i!==null&&i.delete(t),Lu(e,r)}var Du;Du=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Be.current)Pe=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Pe=!1,$d(e,t,r);Pe=!!(e.flags&131072)}else Pe=!1,ae&&t.flags&1048576&&Mc(t,vs,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;es(e,t),e=t.pendingProps;var a=xr(t,Re.current);yr(t,r),a=qo(null,t,i,e,a,r);var f=Yo();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Oe(i)?(f=!0,ps(t)):f=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Uo(t),a.updater=Os,t.stateNode=a,a._reactInternals=t,eo(t,i,e,r),t=io(null,t,i,!0,f,r)):(t.tag=0,ae&&f&&Oo(t),Le(null,t,a,r),t=t.child),t;case 16:i=t.elementType;e:{switch(es(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=of(i),e=Ze(i,e),a){case 0:t=ro(null,t,i,e,r);break e;case 1:t=na(null,t,i,e,r);break e;case 11:t=ia(null,t,i,e,r);break e;case 14:t=sa(null,t,i,Ze(i.type,e),r);break e}throw Error(G(306,i,""))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),ro(e,t,i,a,r);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),na(e,t,i,a,r);case 3:e:{if(du(t),e===null)throw Error(G(387));i=t.pendingProps,f=t.memoizedState,a=f.element,Nc(e,t),Ss(t,i,null,r);var C=t.memoizedState;if(i=C.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){a=Rr(Error(G(423)),t),t=oa(e,t,i,r,a);break e}else if(i!==a){a=Rr(Error(G(424)),t),t=oa(e,t,i,r,a);break e}else for(Ne=It(t.stateNode.containerInfo.firstChild),Fe=t,ae=!0,et=null,r=jc(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(kr(),i===a){t=mt(e,t,r);break e}Le(e,t,i,r)}t=t.child}return t;case 5:return Fc(t),e===null&&Qn(t),i=t.type,a=t.pendingProps,f=e!==null?e.memoizedProps:null,C=a.children,Vn(i,a)?C=null:f!==null&&Vn(i,f)&&(t.flags|=32),hu(e,t),Le(e,t,C,r),t.child;case 6:return e===null&&Qn(t),null;case 13:return fu(e,t,r);case 4:return $o(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=br(t,null,i,r):Le(e,t,i,r),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),ia(e,t,i,a,r);case 7:return Le(e,t,t.pendingProps,r),t.child;case 8:return Le(e,t,t.pendingProps.children,r),t.child;case 12:return Le(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,a=t.pendingProps,f=t.memoizedProps,C=a.value,ne(gs,i._currentValue),i._currentValue=C,f!==null)if(it(f.value,C)){if(f.children===a.children&&!Be.current){t=mt(e,t,r);break e}}else for(f=t.child,f!==null&&(f.return=t);f!==null;){var o=f.dependencies;if(o!==null){C=f.child;for(var c=o.firstContext;c!==null;){if(c.context===i){if(f.tag===1){c=pt(-1,r&-r),c.tag=2;var d=f.updateQueue;if(d!==null){d=d.shared;var S=d.pending;S===null?c.next=c:(c.next=S.next,S.next=c),d.pending=c}}f.lanes|=r,c=f.alternate,c!==null&&(c.lanes|=r),Zn(f.return,r,t),o.lanes|=r;break}c=c.next}}else if(f.tag===10)C=f.type===t.type?null:f.child;else if(f.tag===18){if(C=f.return,C===null)throw Error(G(341));C.lanes|=r,o=C.alternate,o!==null&&(o.lanes|=r),Zn(C,r,t),C=f.sibling}else C=f.child;if(C!==null)C.return=f;else for(C=f;C!==null;){if(C===t){C=null;break}if(f=C.sibling,f!==null){f.return=C.return,C=f;break}C=C.return}f=C}Le(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,yr(t,r),a=Ye(a),i=i(a),t.flags|=1,Le(e,t,i,r),t.child;case 14:return i=t.type,a=Ze(i,t.pendingProps),a=Ze(i.type,a),sa(e,t,i,a,r);case 15:return cu(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),es(e,t),t.tag=1,Oe(i)?(e=!0,ps(t)):e=!1,yr(t,r),ou(t,i,a),eo(t,i,a,r),io(null,t,i,!0,e,r);case 19:return pu(e,t,r);case 22:return uu(e,t,r)}throw Error(G(156,t.tag))};function Tu(e,t){return ic(e,t)}function nf(e,t,r,i){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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ge(e,t,r,i){return new nf(e,t,r,i)}function nl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function of(e){if(typeof e=="function")return nl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ko)return 11;if(e===bo)return 14}return 2}function Ot(e,t){var r=e.alternate;return r===null?(r=Ge(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 is(e,t,r,i,a,f){var C=2;if(i=e,typeof e=="function")nl(e)&&(C=1);else if(typeof e=="string")C=5;else e:switch(e){case nr:return qt(r.children,a,f,t);case xo:C=8,a|=8;break;case kn:return e=Ge(12,r,t,a|2),e.elementType=kn,e.lanes=f,e;case bn:return e=Ge(13,r,t,a),e.elementType=bn,e.lanes=f,e;case En:return e=Ge(19,r,t,a),e.elementType=En,e.lanes=f,e;case Fa:return Ns(r,a,f,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ha:C=10;break e;case Na:C=9;break e;case ko:C=11;break e;case bo:C=14;break e;case xt:C=16,i=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=Ge(C,r,t,a),t.elementType=e,t.type=i,t.lanes=f,t}function qt(e,t,r,i){return e=Ge(7,e,i,t),e.lanes=r,e}function Ns(e,t,r,i){return e=Ge(22,e,i,t),e.elementType=Fa,e.lanes=r,e.stateNode={isHidden:!1},e}function Sn(e,t,r){return e=Ge(6,e,null,t),e.lanes=r,e}function yn(e,t,r){return t=Ge(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lf(e,t,r,i,a){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=Js(0),this.expirationTimes=Js(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Js(0),this.identifierPrefix=i,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function ol(e,t,r,i,a,f,C,o,c){return e=new lf(e,t,r,o,c),t===1?(t=1,f===!0&&(t|=8)):t=0,f=Ge(3,null,null,t),e.current=f,f.stateNode=e,f.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uo(f),e}function af(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:sr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Au(e){if(!e)return Ht;e=e._reactInternals;e:{if(tr(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Oe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var r=e.type;if(Oe(r))return Ac(e,r,t)}return t}function Iu(e,t,r,i,a,f,C,o,c){return e=ol(r,i,!0,e,a,f,C,o,c),e.context=Au(null),r=e.current,i=De(),a=Bt(r),f=pt(i,a),f.callback=t??null,Mt(r,f,a),e.current.lanes=a,xi(e,a,i),je(e,i),e}function Fs(e,t,r,i){var a=t.current,f=De(),C=Bt(a);return r=Au(r),t.context===null?t.context=r:t.pendingContext=r,t=pt(f,C),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=Mt(a,t,C),e!==null&&(rt(e,a,C,f),Qi(e,a,C)),C}function Rs(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 va(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ll(e,t){va(e,t),(e=e.alternate)&&va(e,t)}function cf(){return null}var Mu=typeof reportError=="function"?reportError:function(e){console.error(e)};function al(e){this._internalRoot=e}zs.prototype.render=al.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));Fs(e,t,null,null)};zs.prototype.unmount=al.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jt(function(){Fs(null,e,null,null)}),t[vt]=null}};function zs(e){this._internalRoot=e}zs.prototype.unstable_scheduleHydration=function(e){if(e){var t=uc();e={blockedOn:null,target:e,priority:t};for(var r=0;r<bt.length&&t!==0&&t<bt[r].priority;r++);bt.splice(r,0,e),r===0&&dc(e)}};function cl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ws(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ga(){}function uf(e,t,r,i,a){if(a){if(typeof i=="function"){var f=i;i=function(){var d=Rs(C);f.call(d)}}var C=Iu(t,i,e,0,null,!1,!1,"",ga);return e._reactRootContainer=C,e[vt]=C.current,fi(e.nodeType===8?e.parentNode:e),Jt(),C}for(;a=e.lastChild;)e.removeChild(a);if(typeof i=="function"){var o=i;i=function(){var d=Rs(c);o.call(d)}}var c=ol(e,0,!1,null,null,!1,!1,"",ga);return e._reactRootContainer=c,e[vt]=c.current,fi(e.nodeType===8?e.parentNode:e),Jt(function(){Fs(t,c,r,i)}),c}function Us(e,t,r,i,a){var f=r._reactRootContainer;if(f){var C=f;if(typeof a=="function"){var o=a;a=function(){var c=Rs(C);o.call(c)}}Fs(t,C,e,a)}else C=uf(r,t,e,a,i);return Rs(C)}ac=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=qr(t.pendingLanes);r!==0&&(Lo(t,r|1),je(t,_e()),!(re&6)&&(Lr=_e()+500,zt()))}break;case 13:Jt(function(){var i=gt(e,1);if(i!==null){var a=De();rt(i,e,1,a)}}),ll(e,1)}};Do=function(e){if(e.tag===13){var t=gt(e,134217728);if(t!==null){var r=De();rt(t,e,134217728,r)}ll(e,134217728)}};cc=function(e){if(e.tag===13){var t=Bt(e),r=gt(e,t);if(r!==null){var i=De();rt(r,e,t,i)}ll(e,t)}};uc=function(){return se};hc=function(e,t){var r=se;try{return se=e,t()}finally{se=r}};On=function(e,t,r){switch(t){case"input":if(Dn(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 i=r[t];if(i!==e&&i.form===e.form){var a=Ms(i);if(!a)throw Error(G(90));Wa(i),Dn(i,a)}}}break;case"textarea":$a(e,r);break;case"select":t=r.value,t!=null&&vr(e,!!r.multiple,t,!1)}};Qa=rl;Za=Jt;var hf={usingClientEntryPoint:!1,Events:[bi,cr,Ms,Ya,Xa,rl]},Ur={findFiberByHostInstance:$t,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},df={bundleType:Ur.bundleType,version:Ur.version,rendererPackageName:Ur.rendererPackageName,rendererConfig:Ur.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:St.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=tc(e),e===null?null:e.stateNode},findFiberByHostInstance:Ur.findFiberByHostInstance||cf,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 Ki=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ki.isDisabled&&Ki.supportsFiber)try{Ds=Ki.inject(df),at=Ki}catch{}}We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hf;We.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cl(t))throw Error(G(200));return af(e,t,null,r)};We.createRoot=function(e,t){if(!cl(e))throw Error(G(299));var r=!1,i="",a=Mu;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=ol(e,1,!1,null,null,r,!1,i,a),e[vt]=t.current,fi(e.nodeType===8?e.parentNode:e),new al(t)};We.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(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=tc(t),e=e===null?null:e.stateNode,e};We.flushSync=function(e){return Jt(e)};We.hydrate=function(e,t,r){if(!Ws(t))throw Error(G(200));return Us(null,e,t,!0,r)};We.hydrateRoot=function(e,t,r){if(!cl(e))throw Error(G(405));var i=r!=null&&r.hydratedSources||null,a=!1,f="",C=Mu;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),t=Iu(t,null,e,1,r??null,a,!1,f,C),e[vt]=t.current,fi(e),i)for(e=0;e<i.length;e++)r=i[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new zs(t)};We.render=function(e,t,r){if(!Ws(t))throw Error(G(200));return Us(null,e,t,!1,r)};We.unmountComponentAtNode=function(e){if(!Ws(e))throw Error(G(40));return e._reactRootContainer?(Jt(function(){Us(null,null,e,!1,function(){e._reactRootContainer=null,e[vt]=null})}),!0):!1};We.unstable_batchedUpdates=rl;We.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!Ws(r))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return Us(e,t,r,!1,i)};We.version="18.3.1-next-f1338f8080-20240426";function Pu(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pu)}catch(e){console.error(e)}}Pu(),Pa.exports=We;var ff=Pa.exports,Bu,ma=ff;Bu=ma.createRoot,ma.hydrateRoot;const pf=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,_f=3e3,vf=5,gf=5e3;function mf(){const[e,t]=q.useState(!1),[r,i]=q.useState(!1),[a,f]=q.useState([]),[C,o]=q.useState([]),[c,d]=q.useState([]),[S,h]=q.useState(null),[_,g]=q.useState([]),x=q.useRef(null),v=q.useRef(new Map),u=q.useRef(null),l=q.useCallback((F,Y="info")=>{const U={id:Date.now()+Math.random(),msg:F,type:Y};g(O=>[U,...O].slice(0,vf)),setTimeout(()=>{g(O=>O.filter(R=>R.id!==U.id))},gf)},[]),s=q.useCallback((F,Y)=>{const U=x.current;U&&U.readyState===WebSocket.OPEN&&U.send(JSON.stringify({type:F,payload:Y,ts:Date.now()}))},[]),n=q.useCallback(()=>{if(x.current&&x.current.readyState===WebSocket.OPEN)return;const F=new WebSocket(pf);x.current=F,F.onopen=()=>{t(!0),u.current&&(clearInterval(u.current),u.current=null);for(const[Y]of v.current)s("SUBSCRIBE_TERMINAL",{agentId:Y})},F.onmessage=Y=>{var O,R,$,H,Q;let U;try{U=JSON.parse(Y.data)}catch{return}switch(U.type){case"INIT":f(U.payload.tasks||[]),o(U.payload.agents||[]),d(U.payload.repos||[]),U.payload.settings&&h(U.payload.settings),i(!0);break;case"TASKS_UPDATED":f(U.payload.tasks||[]);break;case"TASK_ADDED":f(z=>[...z,U.payload.task]);break;case"AGENTS_UPDATED":o(U.payload.agents||[]);break;case"AGENT_UPDATED":o(z=>z.some(ie=>ie.id===U.payload.agent.id)?z.map(ie=>ie.id===U.payload.agent.id?U.payload.agent:ie):[...z,U.payload.agent]);break;case"AGENT_REMOVED":o(z=>z.filter(J=>J.id!==U.payload.agentId));break;case"SETTINGS_UPDATED":h(U.payload);break;case"REPOS_UPDATED":d(U.payload.repos||[]);break;case"TERMINAL_DATA":{const z=v.current.get(U.payload.agentId);z&&z(U.payload.data);break}case"PLAN_READY":l(`Plan ready for ${U.payload.taskId} — approval needed`,"warning");break;case"PLAN_PARTIAL":f(z=>z.map(J=>J.id===U.payload.taskId?{...J,plan:U.payload.plan}:J));break;case"PR_CREATED":l(`PR created for ${U.payload.taskId}`,"success");break;case"TASK_BLOCKED":l(`${U.payload.taskId} blocked: ${U.payload.reason}`,"error");break;case"REVIEW_FAILED":l(`Review failed for ${U.payload.taskId} — returning to implementor`,"warning");break;case"REVIEW_PASSED":l(`Review passed for ${U.payload.taskId}`,"success");break;case"TASK_ABORTED":l(`Task ${U.payload.taskId} aborted`,"info");break;case"TASK_RESET":l(`Task ${U.payload.taskId} reset to backlog`,"info");break;case"TASK_RETRIED":l(`Task ${U.payload.taskId} retrying from ${U.payload.retryStatus}`,"info");break;case"TASK_DELETED":l(`Task ${U.payload.taskId} deleted from Done`,"info");break;case"BRIDGE_OPENED":l(`${U.payload.agentName} opened in Terminal`,"info");break;case"BRIDGE_RETURNED":l(`${U.payload.agentName} returned to Ban Kan`,"info");break;case"BRIDGE_ERROR":l(((O=U.payload)==null?void 0:O.message)||"Terminal bridge failed","error");break;case"TASK_WORKSPACE_OPENED":l(((R=U.payload)==null?void 0:R.message)||`Opened workspace for ${($=U.payload)==null?void 0:$.taskId}`,"success");break;case"TASK_WORKSPACE_ERROR":l(((H=U.payload)==null?void 0:H.message)||"Failed to open task workspace","error");break;case"SETTINGS_ERROR":l((((Q=U.payload)==null?void 0:Q.errors)||[]).join(", ")||"Settings update failed","error");break}},F.onclose=()=>{t(!1),x.current=null,u.current||(u.current=setInterval(n,_f))},F.onerror=()=>{F.close()}},[l,s]);q.useEffect(()=>(n(),()=>{u.current&&clearInterval(u.current),x.current&&x.current.close()}),[n]);const p=q.useCallback((F,Y,U,O)=>{s("ADD_TASK",{title:F,priority:Y,description:U,repoPath:O})},[s]),w=q.useCallback(F=>{s("APPROVE_PLAN",{taskId:F})},[s]),y=q.useCallback((F,Y)=>{s("REJECT_PLAN",{taskId:F,feedback:Y})},[s]),k=q.useCallback((F,Y)=>{s("INJECT_MESSAGE",{agentId:F,message:Y})},[s]),m=q.useCallback((F,Y)=>{s("INJECT_RAW",{agentId:F,data:Y})},[s]),b=q.useCallback((F,Y,U)=>{s("RESIZE_TERMINAL",{agentId:F,cols:Y,rows:U})},[s]),T=q.useCallback(F=>{s("PAUSE_AGENT",{agentId:F})},[s]),M=q.useCallback(F=>{s("RESUME_AGENT",{agentId:F})},[s]),P=q.useCallback(F=>{s("PAUSE_TASK",{taskId:F})},[s]),A=q.useCallback(F=>{s("RESUME_TASK",{taskId:F})},[s]),N=q.useCallback((F,Y)=>{s("EDIT_TASK",{taskId:F,updates:Y})},[s]),W=q.useCallback(F=>{s("ABORT_TASK",{taskId:F})},[s]),V=q.useCallback(F=>{s("RESET_TASK",{taskId:F})},[s]),X=q.useCallback(F=>{s("RETRY_TASK",{taskId:F})},[s]),j=q.useCallback(F=>{s("DELETE_TASK",{taskId:F})},[s]),E=q.useCallback(F=>{s("OPEN_TASK_WORKSPACE",{taskId:F})},[s]),D=q.useCallback(F=>{s("UPDATE_SETTINGS",F)},[s]),I=q.useCallback(F=>{s("OPEN_AGENT_TERMINAL",{agentId:F})},[s]),B=q.useCallback(F=>{s("RETURN_AGENT_TERMINAL",{agentId:F})},[s]),K=q.useCallback((F,Y)=>(v.current.set(F,Y),s("SUBSCRIBE_TERMINAL",{agentId:F}),()=>{v.current.delete(F),s("UNSUBSCRIBE_TERMINAL",{agentId:F})}),[s]);return{connected:e,isInitialized:r,tasks:a,agents:C,repos:c,settings:S,notifications:_,addTask:p,approvePlan:w,rejectPlan:y,pauseTask:P,resumeTask:A,editTask:N,abortTask:W,resetTask:V,retryTask:X,deleteTask:j,openTaskWorkspace:E,injectMessage:k,sendRaw:m,resizeTerminal:b,pauseAgent:T,resumeAgent:M,updateSettings:D,subscribeTerminal:K,openAgentTerminal:I,returnAgentTerminal:B}}const Sf={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"},Sa={planning:"var(--steel2)",awaiting_approval:"var(--amber)",queued:"var(--text3)",workspace_setup:"var(--steel2)",implementing:"var(--green)",review:"#A78BFA",blocked:"var(--red)",paused:"var(--amber)",backlog:"var(--text3)",aborted:"var(--text3)",done:"var(--green)"};function yf(e){const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/6e4);if(r<1)return"now";if(r<60)return`${r}m`;const i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function Cf(e,t=72){if(typeof e!="string")return"";const r=e.replace(/\s+/g," ").trim();return r.length<=t?r:r.slice(0,t-1).trimEnd()+"…"}function wf({task:e,columnColor:t,agents:r,isAnimating:i,onApprove:a,onReject:f,onAgentClick:C,onTaskClick:o}){const[c,d]=q.useState(!1),[S,h]=q.useState(""),[_,g]=q.useState(!1),x=e.status==="blocked",v=r.find(s=>s.id===e.assignedTo),u=x?"var(--red)":t,l=x?"rgba(255,77,77,0.05)":"transparent";return L.jsxs("div",{onClick:()=>o&&o(e),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),style:{cursor:"pointer",background:_?"var(--bg2)":`linear-gradient(${l}, ${l}), var(--bg1)`,borderRadius:6,borderLeft:`3px solid ${u}`,padding:"10px 12px",transform:_?"translateY(-1px)":"none",boxShadow:_?"0 4px 12px rgba(0,0,0,0.3)":"none",transition:"transform 0.15s, box-shadow 0.15s, background 0.15s",animation:i?"card-enter 0.3s ease-out":"none"},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[L.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:Sf[e.priority]||"var(--text3)",flexShrink:0}}),L.jsx("span",{style:{fontSize:11,color:"var(--text3)",fontFamily:"var(--font-mono)"},children:e.id}),L.jsx("span",{style:{flex:1}}),L.jsx("span",{style:{fontSize:10,color:"var(--text3)"},children:yf(e.createdAt)})]}),L.jsx("div",{style:{fontSize:12,lineHeight:1.4,marginBottom:8,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.title}),L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:e.progress>0?6:0},children:[L.jsx("span",{style:{padding:"1px 6px",borderRadius:3,fontSize:10,background:(Sa[e.status]||"var(--text3)")+"20",color:Sa[e.status]||"var(--text3)"},children:e.status.replace(/_/g," ")}),L.jsx("span",{style:{flex:1}}),v&&L.jsxs("span",{onClick:s=>{s.stopPropagation(),C(v.id)},title:`Open ${v.name} terminal`,style:{display:"inline-flex",alignItems:"center",gap:3,padding:"2px 6px",borderRadius:9,background:(v.color||"var(--text3)")+"26",color:v.color||"var(--text3)",fontSize:10,cursor:"pointer",transition:"background 0.15s"},onMouseEnter:s=>s.currentTarget.style.background=(v.color||"var(--text3)")+"40",onMouseLeave:s=>s.currentTarget.style.background=(v.color||"var(--text3)")+"26",children:[L.jsx("span",{style:{fontSize:10,lineHeight:1},children:v.icon||v.id.charAt(0).toUpperCase()}),v.name]})]}),e.progress>0&&L.jsxs("div",{style:{marginBottom:6},children:[L.jsx("div",{style:{height:2,background:"var(--border)",borderRadius:1},children:L.jsx("div",{style:{height:"100%",borderRadius:1,width:`${e.progress}%`,background:t,transition:"width 0.3s"}})}),L.jsxs("div",{style:{fontSize:9,color:"var(--text3)",textAlign:"right",marginTop:2},children:[e.progress,"%"]})]}),e.status==="awaiting_approval"&&L.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[L.jsx("button",{onClick:s=>{s.stopPropagation(),a(e.id)},style:{padding:"3px 8px",borderRadius:3,background:"rgba(61, 220, 132, 0.15)",color:"var(--green)",fontSize:11},children:"Approve"}),L.jsx("button",{onClick:s=>{s.stopPropagation(),d(!0),h("")},style:{padding:"3px 8px",borderRadius:3,background:"rgba(255, 77, 77, 0.1)",color:"var(--text2)",fontSize:11},children:"Revise"})]}),e.status==="done"&&e.prUrl&&L.jsx("div",{style:{marginTop:4},children:L.jsx("a",{href:e.prUrl,target:"_blank",rel:"noopener noreferrer",style:{padding:"3px 8px",borderRadius:3,background:"rgba(96, 165, 250, 0.15)",color:"#60A5FA",fontSize:11,textDecoration:"none",display:"inline-block"},children:"PR"})}),x&&e.blockedReason&&L.jsxs("div",{style:{marginTop:4},children:[L.jsx("span",{style:{fontSize:10,color:"var(--red)",fontWeight:600},children:"AWAITING HUMAN INPUT"}),L.jsx("span",{title:e.blockedReason,style:{fontSize:10,color:"var(--text3)",marginLeft:6},children:Cf(e.blockedReason)})]}),c&&L.jsx("div",{style:{marginTop:6,animation:"fade-in 0.15s ease-out"},children:L.jsx("input",{autoFocus:!0,type:"text",placeholder:"Feedback for planner...",value:S,onChange:s=>h(s.target.value),onKeyDown:s=>{s.key==="Enter"&&S.trim()&&(f(e.id,S.trim()),d(!1),h("")),s.key==="Escape"&&(d(!1),h(""))},style:{width:"100%",fontSize:11,padding:"4px 8px"}})})]})}function xf({column:e,tasks:t,agents:r,animatingTasks:i,onApprove:a,onReject:f,onAgentClick:C,onAddTask:o,onTaskClick:c,canCreateTask:d}){const S=e.agentPrefix?r.filter(h=>h.id.startsWith(e.agentPrefix+"-")||h.id===e.agentPrefix):[];return L.jsxs("div",{style:{display:"flex",flexDirection:"column",background:"var(--bg)",minHeight:0,overflow:"hidden"},children:[L.jsxs("div",{style:{padding:"12px 12px 8px",borderBottom:`2px solid ${e.color}30`},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:S.length>0?8:0},children:[L.jsx("span",{style:{width:16,height:16,display:"inline-flex",alignItems:"center",justifyContent:"center",color:e.color,flexShrink:0},children:e.icon}),L.jsx("span",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:12,letterSpacing:1,textTransform:"uppercase"},children:e.title}),L.jsx("span",{style:{flex:1}}),t.length>0&&L.jsx("span",{style:{width:20,height:20,borderRadius:"50%",background:e.color+"33",color:e.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:600},children:t.length})]}),S.length>0&&L.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:S.map(h=>{const _=h.status==="active",g=h.status==="blocked",x=h.status==="draining",v=!_&&!g&&!x;return L.jsxs("div",{onClick:()=>C(h.id),title:`${h.name} — ${h.status}`,style:{width:22,height:22,borderRadius:"50%",background:v?"transparent":h.color||e.color,border:v?`1px solid ${h.color||e.color}66`:x?`2px dashed ${h.color||e.color}`:g?"2px solid var(--red)":"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,cursor:"pointer",position:"relative",opacity:v?.4:1,transition:"opacity 0.15s"},children:[h.icon||h.id.charAt(0).toUpperCase(),_&&L.jsx("span",{style:{position:"absolute",bottom:-1,right:-1,width:5,height:5,borderRadius:"50%",background:"var(--green)",border:"1px solid var(--bg)"}})]},h.id)})})]}),L.jsxs("div",{style:{flex:1,overflowY:"auto",padding:8,display:"flex",flexDirection:"column",gap:6},children:[t.length===0&&L.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text3)",fontSize:11,textAlign:"center",padding:16},children:e.id==="backlog"?d?L.jsx("span",{onClick:o,style:{cursor:"pointer",textDecoration:"underline",textUnderlineOffset:3},children:"No tasks — click + ADD TASK"}):"No tasks yet — add a repository in Settings to create your first task":e.id==="done"?"No completed tasks":"All clear"}),t.map(h=>L.jsx(wf,{task:h,columnColor:e.color,agents:r,isAnimating:i.has(h.id),onApprove:a,onReject:f,onAgentClick:C,onTaskClick:c},h.id))]})]})}function $r({children:e}){return L.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",style:{width:"100%",height:"100%",display:"block"},children:e})}const ir=[{id:"backlog",title:"Backlog",icon:L.jsxs($r,{children:[L.jsx("rect",{x:"2.5",y:"3",width:"11",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),L.jsx("path",{d:"M5 6h6M5 8.5h6M5 11h3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})]}),statuses:["backlog","paused","aborted"],agentPrefix:null,color:"var(--text3)"},{id:"planning",title:"Planning",icon:L.jsxs($r,{children:[L.jsx("path",{d:"M4 12.5h2.25l5.75-5.75-2.25-2.25L4 10.25v2.25Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),L.jsx("path",{d:"M8.75 5.75 11 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"}),L.jsx("path",{d:"M3.5 13h9",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})]}),statuses:["workspace_setup","planning","awaiting_approval"],agentPrefix:"plan",color:"var(--steel2)"},{id:"implementation",title:"Implementation",icon:L.jsxs($r,{children:[L.jsx("path",{d:"m6.25 4.5 1.25-1.25 5 5L11.25 9.5l-.9-.9-1.6 1.6a1.5 1.5 0 0 1-2.12 0l-.83-.83a1.5 1.5 0 0 1 0-2.12l1.6-1.6-.9-.9Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),L.jsx("path",{d:"M4 12.25 7.5 8.75",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"}),L.jsx("path",{d:"m3.5 10.5 2 2",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})]}),statuses:["queued","implementing"],agentPrefix:"imp",color:"var(--green)"},{id:"review",title:"Review",icon:L.jsxs($r,{children:[L.jsx("path",{d:"M1.75 8s2.25-3.75 6.25-3.75S14.25 8 14.25 8 12 11.75 8 11.75 1.75 8 1.75 8Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),L.jsx("circle",{cx:"8",cy:"8",r:"1.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),statuses:["review"],agentPrefix:"rev",color:"var(--yellow)"},{id:"done",title:"Done",icon:L.jsxs($r,{children:[L.jsx("circle",{cx:"8",cy:"8",r:"5.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),L.jsx("path",{d:"m5.5 8 1.5 1.5 3.5-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]}),statuses:["done"],agentPrefix:null,color:"var(--green)"}];function kf({tasks:e,agents:t,onApprove:r,onReject:i,onAgentClick:a,onAddTask:f,onTaskClick:C,canCreateTask:o}){const c=q.useRef(new Map),[d,S]=q.useState(new Set);q.useEffect(()=>{const _=c.current,g=new Set;if(e.forEach(v=>{const u=_.get(v.id);u&&u!==v.status&&g.add(v.id)}),g.size>0){S(g);const v=setTimeout(()=>S(new Set),350);return()=>clearTimeout(v)}const x=new Map;e.forEach(v=>x.set(v.id,v.status)),c.current=x},[e]),q.useEffect(()=>{const _=new Map;e.forEach(g=>_.set(g.id,g.status)),c.current=_},[e]);const h=q.useMemo(()=>{const _={};ir.forEach(g=>{_[g.id]=[]}),e.forEach(g=>{if(g.status==="blocked"){const v=ir.find(u=>u.id===g.lastActiveStage);if(v){_[v.id].push(g);return}if(g.assignedTo){const u=ir.find(l=>l.agentPrefix&&g.assignedTo.startsWith(l.agentPrefix));if(u){_[u.id].push(g);return}}_.backlog.push(g);return}const x=ir.find(v=>v.statuses.includes(g.status));x?_[x.id].push(g):_.backlog.push(g)});for(const g of ir)_[g.id].sort((x,v)=>{if(x.status==="blocked"&&v.status!=="blocked")return-1;if(x.status!=="blocked"&&v.status==="blocked")return 1;const u=new Date(v.updatedAt).getTime()-new Date(x.updatedAt).getTime();return u!==0?u:x.id.localeCompare(v.id)});return _},[e]);return L.jsx("div",{style:{flex:1,display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:1,background:"var(--border)",minHeight:0,overflow:"hidden"},children:ir.map(_=>L.jsx(xf,{column:_,tasks:h[_.id],agents:t,animatingTasks:d,onApprove:r,onReject:i,onAgentClick:a,onAddTask:f,onTaskClick:C,canCreateTask:o},_.id))})}var Ou={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var r={4567:function(C,o,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,m=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(m=(k<3?y(m):k>3?y(n,p,m):y(n,p))||m);return k>3&&m&&Object.defineProperty(n,p,m),m},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const h=c(9042),_=c(9924),g=c(844),x=c(4725),v=c(2585),u=c(3656);let l=o.AccessibilityManager=class extends g.Disposable{constructor(s,n,p,w){super(),this._terminal=s,this._coreBrowserService=p,this._renderService=w,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(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(y=>this._handleResize(y.rows))),this.register(this._terminal.onRender(y=>this._refreshRows(y.start,y.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(y=>this._handleChar(y))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
41
41
|
`))),this.register(this._terminal.onA11yTab(y=>this._handleTab(y))),this.register(this._terminal.onKey(y=>this._handleKey(y.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,u.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,g.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(s){for(let n=0;n<s;n++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
|
|
42
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(s)||this._charsToConsume.push(s)}_refreshRows(s,n){this._liveRegionDebouncer.refresh(s,n,this._terminal.rows)}_renderRows(s,n){const p=this._terminal.buffer,w=p.lines.length.toString();for(let y=s;y<=n;y++){const k=p.lines.get(p.ydisp+y),m=[],b=(k==null?void 0:k.translateToString(!0,void 0,void 0,m))||"",T=(p.ydisp+y+1).toString(),I=this._rowElements[y];I&&(b.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=b,this._rowColumns.set(I,m)),I.setAttribute("aria-posinset",T),I.setAttribute("aria-setsize",w))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,n){const p=s.target,w=this._rowElements[n===0?1:this._rowElements.length-2];if(p.getAttribute("aria-posinset")===(n===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==w)return;let y,k;if(n===0?(y=p,k=this._rowElements.pop(),this._rowContainer.removeChild(k)):(y=this._rowElements.shift(),k=p,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),k.removeEventListener("focus",this._bottomBoundaryFocusListener),n===0){const m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{const m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(n===0?-1:1),this._rowElements[n===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){var b;if(this._rowElements.length===0)return;const s=document.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let n={node:s.anchorNode,offset:s.anchorOffset},p={node:s.focusNode,offset:s.focusOffset};if((n.node.compareDocumentPosition(p.node)&Node.DOCUMENT_POSITION_PRECEDING||n.node===p.node&&n.offset>p.offset)&&([n,p]=[p,n]),n.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(n={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(n.node))return;const w=this._rowElements.slice(-1)[0];if(p.node.compareDocumentPosition(w)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(p={node:w,offset:((b=w.textContent)==null?void 0:b.length)??0}),!this._rowContainer.contains(p.node))return;const y=({node:T,offset:I})=>{const P=T instanceof Text?T.parentNode:T;let A=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(A))return console.warn("row is invalid. Race condition?"),null;const N=this._rowColumns.get(P);if(!N)return console.warn("columns is null. Race condition?"),null;let W=I<N.length?N[I]:N.slice(-1)[0]+1;return W>=this._terminal.cols&&(++A,W=0),{row:A,column:W}},k=y(n),m=y(p);if(k&&m){if(k.row>m.row||k.row===m.row&&k.column>=m.column)throw new Error("invalid range");this._terminal.select(k.column,k.row,(m.row-k.row)*this._terminal.cols-k.column+m.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let n=this._rowContainer.children.length;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=l=d([S(1,v.IInstantiationService),S(2,x.ICoreBrowserService),S(3,x.IRenderService)],l)},3614:(C,o)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function d(_,g){return g?"\x1B[200~"+_+"\x1B[201~":_}function S(_,g,x,v){_=d(_=c(_),x.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(_,!0),g.value=""}function h(_,g,x){const v=x.getBoundingClientRect(),u=_.clientX-v.left-10,l=_.clientY-v.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${u}px`,g.style.top=`${l}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=d,o.copyHandler=function(_,g){_.clipboardData&&_.clipboardData.setData("text/plain",g.selectionText),_.preventDefault()},o.handlePasteEvent=function(_,g,x,v){_.stopPropagation(),_.clipboardData&&S(_.clipboardData.getData("text/plain"),g,x,v)},o.paste=S,o.moveTextAreaUnderMouseCursor=h,o.rightClickHandler=function(_,g,x,v,u){h(_,g,x),u&&v.rightClickSelect(_),g.value=v.selectionText,g.select()}},7239:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const d=c(1505);o.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(S,h,_){this._css.set(S,h,_)}getCss(S,h){return this._css.get(S,h)}setColor(S,h,_){this._color.set(S,h,_)}getColor(S,h){return this._color.get(S,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,d,S,h){c.addEventListener(d,S,h);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(d,S,h))}}}},3551:function(C,o,c){var d=this&&this.__decorate||function(l,s,n,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(l,s,n,p);else for(var m=l.length-1;m>=0;m--)(w=l[m])&&(k=(y<3?w(k):y>3?w(s,n,k):w(s,n))||k);return y>3&&k&&Object.defineProperty(s,n,k),k},S=this&&this.__param||function(l,s){return function(n,p){s(n,p,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const h=c(3656),_=c(8460),g=c(844),x=c(2585),v=c(4725);let u=o.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(l,s,n,p,w){super(),this._element=l,this._mouseService=s,this._renderService=n,this._bufferService=p,this._linkProviderService=w,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)(()=>{var y;this._lastMouseEvent=void 0,(y=this._activeProviderReplies)==null||y.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(l){this._lastMouseEvent=l;const s=this._positionFromMouseEvent(l,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const n=l.composedPath();for(let p=0;p<n.length;p++){const w=n[p];if(w.classList.contains("xterm"))break;if(w.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(l){if(this._activeLine!==l.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(l,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,l)||(this._clearCurrentLink(),this._askForLink(l,!0))}_askForLink(l,s){var p,w;this._activeProviderReplies&&s||((p=this._activeProviderReplies)==null||p.forEach(y=>{y==null||y.forEach(k=>{k.link.dispose&&k.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=l.y);let n=!1;for(const[y,k]of this._linkProviderService.linkProviders.entries())s?(w=this._activeProviderReplies)!=null&&w.get(y)&&(n=this._checkLinkProviderResult(y,l,n)):k.provideLinks(l.y,m=>{var T,I;if(this._isMouseOut)return;const b=m==null?void 0:m.map(P=>({link:P}));(T=this._activeProviderReplies)==null||T.set(y,b),n=this._checkLinkProviderResult(y,l,n),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(l.y,this._activeProviderReplies)})}_removeIntersectingLinks(l,s){const n=new Set;for(let p=0;p<s.size;p++){const w=s.get(p);if(w)for(let y=0;y<w.length;y++){const k=w[y],m=k.link.range.start.y<l?0:k.link.range.start.x,b=k.link.range.end.y>l?this._bufferService.cols:k.link.range.end.x;for(let T=m;T<=b;T++){if(n.has(T)){w.splice(y--,1);break}n.add(T)}}}}_checkLinkProviderResult(l,s,n){var y;if(!this._activeProviderReplies)return n;const p=this._activeProviderReplies.get(l);let w=!1;for(let k=0;k<l;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(w=!0);if(!w&&p){const k=p.find(m=>this._linkAtPosition(m.link,s));k&&(n=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let k=0;k<this._activeProviderReplies.size;k++){const m=(y=this._activeProviderReplies.get(k))==null?void 0:y.find(b=>this._linkAtPosition(b.link,s));if(m){n=!0,this._handleNewLink(m);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(l){if(!this._currentLink)return;const s=this._positionFromMouseEvent(l,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(l,this._currentLink.link.text)}_clearCurrentLink(l,s){this._currentLink&&this._lastMouseEvent&&(!l||!s||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(l){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(l.link,s)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:()=>{var n,p;return(p=(n=this._currentLink)==null?void 0:n.state)==null?void 0:p.decorations.pointerCursor},set:n=>{var p;(p=this._currentLink)!=null&&p.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,p;return(p=(n=this._currentLink)==null?void 0:n.state)==null?void 0:p.decorations.underline},set:n=>{var p,w,y;(p=this._currentLink)!=null&&p.state&&((y=(w=this._currentLink)==null?void 0:w.state)==null?void 0:y.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(l.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;const p=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,w=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=w&&(this._clearCurrentLink(p,w),this._lastMouseEvent)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}})))}_linkHover(l,s,n){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(n,s.text)}_fireUnderlineEvent(l,s){const n=l.range,p=this._bufferService.buffer.ydisp,w=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-p-1,n.end.x,n.end.y-p-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(w)}_linkLeave(l,s,n){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(n,s.text)}_linkAtPosition(l,s){const n=l.range.start.y*this._bufferService.cols+l.range.start.x,p=l.range.end.y*this._bufferService.cols+l.range.end.x,w=s.y*this._bufferService.cols+s.x;return n<=w&&w<=p}_positionFromMouseEvent(l,s,n){const p=n.getCoords(l,s,this._bufferService.cols,this._bufferService.rows);if(p)return{x:p[0],y:p[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(l,s,n,p,w){return{x1:l,y1:s,x2:n,y2:p,cols:this._bufferService.cols,fg:w}}};o.Linkifier=u=d([S(1,v.IMouseService),S(2,v.IRenderService),S(3,x.IBufferService),S(4,v.ILinkProviderService)],u)},9042:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(C,o,c){var d=this&&this.__decorate||function(v,u,l,s){var n,p=arguments.length,w=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,u,l,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(u,l,w):n(u,l))||w);return p>3&&w&&Object.defineProperty(u,l,w),w},S=this&&this.__param||function(v,u){return function(l,s){u(l,s,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const h=c(511),_=c(2585);let g=o.OscLinkProvider=class{constructor(v,u,l){this._bufferService=v,this._optionsService=u,this._oscLinkService=l}provideLinks(v,u){var b;const l=this._bufferService.buffer.lines.get(v-1);if(!l)return void u(void 0);const s=[],n=this._optionsService.rawOptions.linkHandler,p=new h.CellData,w=l.getTrimmedLength();let y=-1,k=-1,m=!1;for(let T=0;T<w;T++)if(k!==-1||l.hasContent(T)){if(l.loadCell(T,p),p.hasExtendedAttrs()&&p.extended.urlId){if(k===-1){k=T,y=p.extended.urlId;continue}m=p.extended.urlId!==y}else k!==-1&&(m=!0);if(m||k!==-1&&T===w-1){const I=(b=this._oscLinkService.getLinkData(y))==null?void 0:b.uri;if(I){const P={start:{x:k+1,y:v},end:{x:T+(m||T!==w-1?0:1),y:v}};let A=!1;if(!(n!=null&&n.allowNonHttpProtocols))try{const N=new URL(I);["http:","https:"].includes(N.protocol)||(A=!0)}catch{A=!0}A||s.push({text:I,range:P,activate:(N,W)=>n?n.activate(N,W,P):x(0,W),hover:(N,W)=>{var V;return(V=n==null?void 0:n.hover)==null?void 0:V.call(n,N,W,P)},leave:(N,W)=>{var V;return(V=n==null?void 0:n.leave)==null?void 0:V.call(n,N,W,P)}})}m=!1,p.hasExtendedAttrs()&&p.extended.urlId?(k=T,y=p.extended.urlId):(k=-1,y=-1)}}u(s)}};function x(v,u){if(confirm(`Do you want to navigate to ${u}?
|
|
42
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(s)||this._charsToConsume.push(s)}_refreshRows(s,n){this._liveRegionDebouncer.refresh(s,n,this._terminal.rows)}_renderRows(s,n){const p=this._terminal.buffer,w=p.lines.length.toString();for(let y=s;y<=n;y++){const k=p.lines.get(p.ydisp+y),m=[],b=(k==null?void 0:k.translateToString(!0,void 0,void 0,m))||"",T=(p.ydisp+y+1).toString(),M=this._rowElements[y];M&&(b.length===0?(M.innerText=" ",this._rowColumns.set(M,[0,1])):(M.textContent=b,this._rowColumns.set(M,m)),M.setAttribute("aria-posinset",T),M.setAttribute("aria-setsize",w))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,n){const p=s.target,w=this._rowElements[n===0?1:this._rowElements.length-2];if(p.getAttribute("aria-posinset")===(n===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==w)return;let y,k;if(n===0?(y=p,k=this._rowElements.pop(),this._rowContainer.removeChild(k)):(y=this._rowElements.shift(),k=p,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),k.removeEventListener("focus",this._bottomBoundaryFocusListener),n===0){const m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{const m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(n===0?-1:1),this._rowElements[n===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){var b;if(this._rowElements.length===0)return;const s=document.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let n={node:s.anchorNode,offset:s.anchorOffset},p={node:s.focusNode,offset:s.focusOffset};if((n.node.compareDocumentPosition(p.node)&Node.DOCUMENT_POSITION_PRECEDING||n.node===p.node&&n.offset>p.offset)&&([n,p]=[p,n]),n.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(n={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(n.node))return;const w=this._rowElements.slice(-1)[0];if(p.node.compareDocumentPosition(w)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(p={node:w,offset:((b=w.textContent)==null?void 0:b.length)??0}),!this._rowContainer.contains(p.node))return;const y=({node:T,offset:M})=>{const P=T instanceof Text?T.parentNode:T;let A=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(A))return console.warn("row is invalid. Race condition?"),null;const N=this._rowColumns.get(P);if(!N)return console.warn("columns is null. Race condition?"),null;let W=M<N.length?N[M]:N.slice(-1)[0]+1;return W>=this._terminal.cols&&(++A,W=0),{row:A,column:W}},k=y(n),m=y(p);if(k&&m){if(k.row>m.row||k.row===m.row&&k.column>=m.column)throw new Error("invalid range");this._terminal.select(k.column,k.row,(m.row-k.row)*this._terminal.cols-k.column+m.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let n=this._rowContainer.children.length;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=l=d([S(1,v.IInstantiationService),S(2,x.ICoreBrowserService),S(3,x.IRenderService)],l)},3614:(C,o)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function d(_,g){return g?"\x1B[200~"+_+"\x1B[201~":_}function S(_,g,x,v){_=d(_=c(_),x.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(_,!0),g.value=""}function h(_,g,x){const v=x.getBoundingClientRect(),u=_.clientX-v.left-10,l=_.clientY-v.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${u}px`,g.style.top=`${l}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=d,o.copyHandler=function(_,g){_.clipboardData&&_.clipboardData.setData("text/plain",g.selectionText),_.preventDefault()},o.handlePasteEvent=function(_,g,x,v){_.stopPropagation(),_.clipboardData&&S(_.clipboardData.getData("text/plain"),g,x,v)},o.paste=S,o.moveTextAreaUnderMouseCursor=h,o.rightClickHandler=function(_,g,x,v,u){h(_,g,x),u&&v.rightClickSelect(_),g.value=v.selectionText,g.select()}},7239:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const d=c(1505);o.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(S,h,_){this._css.set(S,h,_)}getCss(S,h){return this._css.get(S,h)}setColor(S,h,_){this._color.set(S,h,_)}getColor(S,h){return this._color.get(S,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,d,S,h){c.addEventListener(d,S,h);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(d,S,h))}}}},3551:function(C,o,c){var d=this&&this.__decorate||function(l,s,n,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(l,s,n,p);else for(var m=l.length-1;m>=0;m--)(w=l[m])&&(k=(y<3?w(k):y>3?w(s,n,k):w(s,n))||k);return y>3&&k&&Object.defineProperty(s,n,k),k},S=this&&this.__param||function(l,s){return function(n,p){s(n,p,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const h=c(3656),_=c(8460),g=c(844),x=c(2585),v=c(4725);let u=o.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(l,s,n,p,w){super(),this._element=l,this._mouseService=s,this._renderService=n,this._bufferService=p,this._linkProviderService=w,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)(()=>{var y;this._lastMouseEvent=void 0,(y=this._activeProviderReplies)==null||y.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(l){this._lastMouseEvent=l;const s=this._positionFromMouseEvent(l,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const n=l.composedPath();for(let p=0;p<n.length;p++){const w=n[p];if(w.classList.contains("xterm"))break;if(w.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(l){if(this._activeLine!==l.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(l,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,l)||(this._clearCurrentLink(),this._askForLink(l,!0))}_askForLink(l,s){var p,w;this._activeProviderReplies&&s||((p=this._activeProviderReplies)==null||p.forEach(y=>{y==null||y.forEach(k=>{k.link.dispose&&k.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=l.y);let n=!1;for(const[y,k]of this._linkProviderService.linkProviders.entries())s?(w=this._activeProviderReplies)!=null&&w.get(y)&&(n=this._checkLinkProviderResult(y,l,n)):k.provideLinks(l.y,m=>{var T,M;if(this._isMouseOut)return;const b=m==null?void 0:m.map(P=>({link:P}));(T=this._activeProviderReplies)==null||T.set(y,b),n=this._checkLinkProviderResult(y,l,n),((M=this._activeProviderReplies)==null?void 0:M.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(l.y,this._activeProviderReplies)})}_removeIntersectingLinks(l,s){const n=new Set;for(let p=0;p<s.size;p++){const w=s.get(p);if(w)for(let y=0;y<w.length;y++){const k=w[y],m=k.link.range.start.y<l?0:k.link.range.start.x,b=k.link.range.end.y>l?this._bufferService.cols:k.link.range.end.x;for(let T=m;T<=b;T++){if(n.has(T)){w.splice(y--,1);break}n.add(T)}}}}_checkLinkProviderResult(l,s,n){var y;if(!this._activeProviderReplies)return n;const p=this._activeProviderReplies.get(l);let w=!1;for(let k=0;k<l;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(w=!0);if(!w&&p){const k=p.find(m=>this._linkAtPosition(m.link,s));k&&(n=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let k=0;k<this._activeProviderReplies.size;k++){const m=(y=this._activeProviderReplies.get(k))==null?void 0:y.find(b=>this._linkAtPosition(b.link,s));if(m){n=!0,this._handleNewLink(m);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(l){if(!this._currentLink)return;const s=this._positionFromMouseEvent(l,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(l,this._currentLink.link.text)}_clearCurrentLink(l,s){this._currentLink&&this._lastMouseEvent&&(!l||!s||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(l){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(l.link,s)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:()=>{var n,p;return(p=(n=this._currentLink)==null?void 0:n.state)==null?void 0:p.decorations.pointerCursor},set:n=>{var p;(p=this._currentLink)!=null&&p.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,p;return(p=(n=this._currentLink)==null?void 0:n.state)==null?void 0:p.decorations.underline},set:n=>{var p,w,y;(p=this._currentLink)!=null&&p.state&&((y=(w=this._currentLink)==null?void 0:w.state)==null?void 0:y.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(l.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;const p=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,w=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=w&&(this._clearCurrentLink(p,w),this._lastMouseEvent)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}})))}_linkHover(l,s,n){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(n,s.text)}_fireUnderlineEvent(l,s){const n=l.range,p=this._bufferService.buffer.ydisp,w=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-p-1,n.end.x,n.end.y-p-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(w)}_linkLeave(l,s,n){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(n,s.text)}_linkAtPosition(l,s){const n=l.range.start.y*this._bufferService.cols+l.range.start.x,p=l.range.end.y*this._bufferService.cols+l.range.end.x,w=s.y*this._bufferService.cols+s.x;return n<=w&&w<=p}_positionFromMouseEvent(l,s,n){const p=n.getCoords(l,s,this._bufferService.cols,this._bufferService.rows);if(p)return{x:p[0],y:p[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(l,s,n,p,w){return{x1:l,y1:s,x2:n,y2:p,cols:this._bufferService.cols,fg:w}}};o.Linkifier=u=d([S(1,v.IMouseService),S(2,v.IRenderService),S(3,x.IBufferService),S(4,v.ILinkProviderService)],u)},9042:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(C,o,c){var d=this&&this.__decorate||function(v,u,l,s){var n,p=arguments.length,w=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,u,l,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(u,l,w):n(u,l))||w);return p>3&&w&&Object.defineProperty(u,l,w),w},S=this&&this.__param||function(v,u){return function(l,s){u(l,s,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const h=c(511),_=c(2585);let g=o.OscLinkProvider=class{constructor(v,u,l){this._bufferService=v,this._optionsService=u,this._oscLinkService=l}provideLinks(v,u){var b;const l=this._bufferService.buffer.lines.get(v-1);if(!l)return void u(void 0);const s=[],n=this._optionsService.rawOptions.linkHandler,p=new h.CellData,w=l.getTrimmedLength();let y=-1,k=-1,m=!1;for(let T=0;T<w;T++)if(k!==-1||l.hasContent(T)){if(l.loadCell(T,p),p.hasExtendedAttrs()&&p.extended.urlId){if(k===-1){k=T,y=p.extended.urlId;continue}m=p.extended.urlId!==y}else k!==-1&&(m=!0);if(m||k!==-1&&T===w-1){const M=(b=this._oscLinkService.getLinkData(y))==null?void 0:b.uri;if(M){const P={start:{x:k+1,y:v},end:{x:T+(m||T!==w-1?0:1),y:v}};let A=!1;if(!(n!=null&&n.allowNonHttpProtocols))try{const N=new URL(M);["http:","https:"].includes(N.protocol)||(A=!0)}catch{A=!0}A||s.push({text:M,range:P,activate:(N,W)=>n?n.activate(N,W,P):x(0,W),hover:(N,W)=>{var V;return(V=n==null?void 0:n.hover)==null?void 0:V.call(n,N,W,P)},leave:(N,W)=>{var V;return(V=n==null?void 0:n.leave)==null?void 0:V.call(n,N,W,P)}})}m=!1,p.hasExtendedAttrs()&&p.extended.urlId?(k=T,y=p.extended.urlId):(k=-1,y=-1)}}u(s)}};function x(v,u){if(confirm(`Do you want to navigate to ${u}?
|
|
43
43
|
|
|
44
|
-
WARNING: This link could potentially be dangerous`)){const l=window.open();if(l){try{l.opener=null}catch{}l.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=g=d([S(0,_.IBufferService),S(1,_.IOptionsService),S(2,_.IOscLinkService)],g)},6193:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,d){this._renderCallback=c,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(c,d,S){this._rowCount=S,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const d=c(3614),S=c(3656),h=c(3551),_=c(9042),g=c(3730),x=c(1680),v=c(3107),u=c(5744),l=c(2950),s=c(1296),n=c(428),p=c(4269),w=c(5114),y=c(8934),k=c(3230),m=c(9312),b=c(4725),T=c(6731),I=c(8055),P=c(8969),A=c(8460),N=c(844),W=c(6114),V=c(8437),X=c(2584),j=c(7399),E=c(5941),D=c(9074),M=c(2585),B=c(5435),K=c(4567),F=c(779);class Y extends P.CoreTerminal{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}constructor(O={}){super(O),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new N.MutableDisposable),this._onCursorMove=this.register(new A.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new A.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new A.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new A.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new A.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new A.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new A.EventEmitter),this._onBlur=this.register(new A.EventEmitter),this._onA11yCharEmitter=this.register(new A.EventEmitter),this._onA11yTabEmitter=this.register(new A.EventEmitter),this._onWillOpen=this.register(new A.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(M.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(F.LinkProviderService),this._instantiationService.setService(b.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((R,$)=>this.refresh(R,$))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(R=>this._reportWindowsOptions(R))),this.register(this._inputHandler.onColor(R=>this._handleColorEvent(R))),this.register((0,A.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,A.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(R=>this._afterResize(R.cols,R.rows))),this.register((0,N.toDisposable)(()=>{var R,$;this._customKeyEventHandler=void 0,($=(R=this.element)==null?void 0:R.parentNode)==null||$.removeChild(this.element)}))}_handleColorEvent(O){if(this._themeService)for(const R of O){let $,H="";switch(R.index){case 256:$="foreground",H="10";break;case 257:$="background",H="11";break;case 258:$="cursor",H="12";break;default:$="ansi",H="4;"+R.index}switch(R.type){case 0:const Q=I.color.toColorRGB($==="ansi"?this._themeService.colors.ansi[R.index]:this._themeService.colors[$]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${H};${(0,E.toRgbString)(Q)}${X.C1_ESCAPED.ST}`);break;case 1:if($==="ansi")this._themeService.modifyColors(z=>z.ansi[R.index]=I.channels.toColor(...R.color));else{const z=$;this._themeService.modifyColors(J=>J[z]=I.channels.toColor(...R.color))}break;case 2:this._themeService.restoreColor(R.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(O){O?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(O){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var O;return(O=this.textarea)==null?void 0:O.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const O=this.buffer.ybase+this.buffer.y,R=this.buffer.lines.get(O);if(!R)return;const $=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,Q=R.getWidth($),z=this._renderService.dimensions.css.cell.width*Q,J=this.buffer.y*this._renderService.dimensions.css.cell.height,ie=$*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ie+"px",this.textarea.style.top=J+"px",this.textarea.style.width=z+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,S.addDisposableDomListener)(this.element,"copy",R=>{this.hasSelection()&&(0,d.copyHandler)(R,this._selectionService)}));const O=R=>(0,d.handlePasteEvent)(R,this.textarea,this.coreService,this.optionsService);this.register((0,S.addDisposableDomListener)(this.textarea,"paste",O)),this.register((0,S.addDisposableDomListener)(this.element,"paste",O)),W.isFirefox?this.register((0,S.addDisposableDomListener)(this.element,"mousedown",R=>{R.button===2&&(0,d.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,S.addDisposableDomListener)(this.element,"contextmenu",R=>{(0,d.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),W.isLinux&&this.register((0,S.addDisposableDomListener)(this.element,"auxclick",R=>{R.button===1&&(0,d.moveTextAreaUnderMouseCursor)(R,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,S.addDisposableDomListener)(this.textarea,"keyup",O=>this._keyUp(O),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keydown",O=>this._keyDown(O),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keypress",O=>this._keyPress(O),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionupdate",O=>this._compositionHelper.compositionupdate(O))),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,S.addDisposableDomListener)(this.textarea,"input",O=>this._inputEvent(O),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(O){var $;if(!O)throw new Error("Terminal requires a parent element.");if(O.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),(($=this.element)==null?void 0:$.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=O.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"),O.appendChild(this.element);const R=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),R.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,S.addDisposableDomListener)(this.screenElement,"mousemove",H=>this.updateCursorStyle(H))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),R.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),W.isChromeOS||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._coreBrowserService=this.register(this._instantiationService.createInstance(w.CoreBrowserService,this.textarea,O.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(b.ICoreBrowserService,this._coreBrowserService),this.register((0,S.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,S.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(n.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(b.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(b.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(b.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(b.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(l.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(b.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(R);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),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.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(m.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(b.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,S.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,S.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),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(K.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const O=this,R=this.element;function $(z){const J=O._mouseService.getMouseReportCoords(z,O.screenElement);if(!J)return!1;let ie,fe;switch(z.overrideType||z.type){case"mousemove":fe=32,z.buttons===void 0?(ie=3,z.button!==void 0&&(ie=z.button<3?z.button:3)):ie=1&z.buttons?0:4&z.buttons?1:2&z.buttons?2:3;break;case"mouseup":fe=0,ie=z.button<3?z.button:3;break;case"mousedown":fe=1,ie=z.button<3?z.button:3;break;case"wheel":if(O._customWheelEventHandler&&O._customWheelEventHandler(z)===!1||O.viewport.getLinesScrolled(z)===0)return!1;fe=z.deltaY<0?0:1,ie=4;break;default:return!1}return!(fe===void 0||ie===void 0||ie>4)&&O.coreMouseService.triggerMouseEvent({col:J.col,row:J.row,x:J.x,y:J.y,button:ie,action:fe,ctrl:z.ctrlKey,alt:z.altKey,shift:z.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Q={mouseup:z=>($(z),z.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(z)),wheel:z=>($(z),this.cancel(z,!0)),mousedrag:z=>{z.buttons&&$(z)},mousemove:z=>{z.buttons||$(z)}};this.register(this.coreMouseService.onProtocolChange(z=>{z?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(z)),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()),8&z?H.mousemove||(R.addEventListener("mousemove",Q.mousemove),H.mousemove=Q.mousemove):(R.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&z?H.wheel||(R.addEventListener("wheel",Q.wheel,{passive:!1}),H.wheel=Q.wheel):(R.removeEventListener("wheel",H.wheel),H.wheel=null),2&z?H.mouseup||(H.mouseup=Q.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&z?H.mousedrag||(H.mousedrag=Q.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,S.addDisposableDomListener)(R,"mousedown",z=>{if(z.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(z))return $(z),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(z)})),this.register((0,S.addDisposableDomListener)(R,"wheel",z=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(z)===!1)return!1;if(!this.buffer.hasScrollback){const J=this.viewport.getLinesScrolled(z);if(J===0)return;const ie=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(z.deltaY<0?"A":"B");let fe="";for(let Ie=0;Ie<Math.abs(J);Ie++)fe+=ie;return this.coreService.triggerDataEvent(fe,!0),this.cancel(z,!0)}return this.viewport.handleWheel(z)?this.cancel(z):void 0}},{passive:!1})),this.register((0,S.addDisposableDomListener)(R,"touchstart",z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(z),this.cancel(z)},{passive:!0})),this.register((0,S.addDisposableDomListener)(R,"touchmove",z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(z)?void 0:this.cancel(z)},{passive:!1}))}refresh(O,R){var $;($=this._renderService)==null||$.refreshRows(O,R)}updateCursorStyle(O){var R;(R=this._selectionService)!=null&&R.shouldColumnSelect(O)?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(O,R,$=0){var H;$===1?(super.scrollLines(O,R,$),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.scrollLines(O)}paste(O){(0,d.paste)(O,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(O){this._customKeyEventHandler=O}attachCustomWheelEventHandler(O){this._customWheelEventHandler=O}registerLinkProvider(O){return this._linkProviderService.registerLinkProvider(O)}registerCharacterJoiner(O){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const R=this._characterJoinerService.register(O);return this.refresh(0,this.rows-1),R}deregisterCharacterJoiner(O){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(O)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(O){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+O)}registerDecoration(O){return this._decorationService.registerDecoration(O)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(O,R,$){this._selectionService.setSelection(O,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 O;(O=this._selectionService)==null||O.clearSelection()}selectAll(){var O;(O=this._selectionService)==null||O.selectAll()}selectLines(O,R){var $;($=this._selectionService)==null||$.selectLines(O,R)}_keyDown(O){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1)return!1;const R=this.browser.isMac&&this.options.macOptionIsMeta&&O.altKey;if(!R&&!this._compositionHelper.keydown(O))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;R||O.key!=="Dead"&&O.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const $=(0,j.evaluateKeyboardEvent)(O,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(O),$.type===3||$.type===2){const H=this.rows-1;return this.scrollLines($.type===2?-H:H),this.cancel(O,!0)}return $.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,O)||($.cancel&&this.cancel(O,!0),!$.key||!!(O.key&&!O.ctrlKey&&!O.altKey&&!O.metaKey&&O.key.length===1&&O.key.charCodeAt(0)>=65&&O.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):($.key!==X.C0.ETX&&$.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:$.key,domEvent:O}),this._showCursor(),this.coreService.triggerDataEvent($.key,!0),!this.optionsService.rawOptions.screenReaderMode||O.altKey||O.ctrlKey?this.cancel(O,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(O,R){const $=O.isMac&&!this.options.macOptionIsMeta&&R.altKey&&!R.ctrlKey&&!R.metaKey||O.isWindows&&R.altKey&&R.ctrlKey&&!R.metaKey||O.isWindows&&R.getModifierState("AltGraph");return R.type==="keypress"?$:$&&(!R.keyCode||R.keyCode>47)}_keyUp(O){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1||(function(R){return R.keyCode===16||R.keyCode===17||R.keyCode===18}(O)||this.focus(),this.updateCursorStyle(O),this._keyPressHandled=!1)}_keyPress(O){let R;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1)return!1;if(this.cancel(O),O.charCode)R=O.charCode;else if(O.which===null||O.which===void 0)R=O.keyCode;else{if(O.which===0||O.charCode===0)return!1;R=O.which}return!(!R||(O.altKey||O.ctrlKey||O.metaKey)&&!this._isThirdLevelShift(this.browser,O)||(R=String.fromCharCode(R),this._onKey.fire({key:R,domEvent:O}),this._showCursor(),this.coreService.triggerDataEvent(R,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(O){if(O.data&&O.inputType==="insertText"&&(!O.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const R=O.data;return this.coreService.triggerDataEvent(R,!0),this.cancel(O),!0}return!1}resize(O,R){O!==this.cols||R!==this.rows?super.resize(O,R):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(O,R){var $,H;($=this._charSizeService)==null||$.measure(),(H=this.viewport)==null||H.syncScrollArea(!0)}clear(){var O;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 R=1;R<this.rows;R++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(O=this.viewport)==null||O.reset(),this.refresh(0,this.rows-1)}}reset(){var R,$;this.options.rows=this.rows,this.options.cols=this.cols;const O=this._customKeyEventHandler;this._setup(),super.reset(),(R=this._selectionService)==null||R.reset(),this._decorationService.reset(),($=this.viewport)==null||$.reset(),this._customKeyEventHandler=O,this.refresh(0,this.rows-1)}clearTextureAtlas(){var O;(O=this._renderService)==null||O.clearTextureAtlas()}_reportFocus(){var O;(O=this.element)!=null&&O.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(O){if(this._renderService)switch(O){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const R=this._renderService.dimensions.css.canvas.width.toFixed(0),$=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${$};${R}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),Q=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${Q};${H}t`)}}cancel(O,R){if(this.options.cancelEvents||R)return O.preventDefault(),O.stopPropagation(),!1}}o.Terminal=Y},9924:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,d=1e3){this._renderCallback=c,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,d,S){this._rowCount=S,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=h-this._lastRefreshMs,g=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d)}}},1680:function(C,o,c){var d=this&&this.__decorate||function(l,s,n,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(l,s,n,p);else for(var m=l.length-1;m>=0;m--)(w=l[m])&&(k=(y<3?w(k):y>3?w(s,n,k):w(s,n))||k);return y>3&&k&&Object.defineProperty(s,n,k),k},S=this&&this.__param||function(l,s){return function(n,p){s(n,p,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const h=c(3656),_=c(4725),g=c(8460),x=c(844),v=c(2585);let u=o.Viewport=class extends x.Disposable{constructor(l,s,n,p,w,y,k,m){super(),this._viewportElement=l,this._scrollArea=s,this._bufferService=n,this._optionsService=p,this._charSizeService=w,this._renderService=y,this._coreBrowserService=k,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(b=>this._activeBuffer=b.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(b=>this._renderDimensions=b)),this._handleThemeChange(m.colors),this.register(m.onChangeColors(b=>this._handleThemeChange(b))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(l){this._viewportElement.style.backgroundColor=l.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(l){if(l)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const l=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==l&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=l),this._refreshAnimationFrame=null}syncScrollArea(l=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(l);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(l)}_handleScroll(l){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const l=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(l*(this._smoothScrollState.target-this._smoothScrollState.origin)),l<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(l,s){const n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&n<this._lastRecordedBufferHeight)||(l.cancelable&&l.preventDefault(),!1)}handleWheel(l){const s=this._getPixelsScrolled(l);return s!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(l,s))}scrollLines(l){if(l!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=l*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!1})}_getPixelsScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let s=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(l,s){var m;let n,p="";const w=[],y=s??this._bufferService.buffer.lines.length,k=this._bufferService.buffer.lines;for(let b=l;b<y;b++){const T=k.get(b);if(!T)continue;const I=(m=k.get(b+1))==null?void 0:m.isWrapped;if(p+=T.translateToString(!I),!I||b===k.length-1){const P=document.createElement("div");P.textContent=p,w.push(P),p.length>0&&(n=P),p=""}}return{bufferElements:w,cursorElement:n}}getLinesScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let s=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(l,s){const n=this._optionsService.rawOptions.fastScrollModifier;return n==="alt"&&s.altKey||n==="ctrl"&&s.ctrlKey||n==="shift"&&s.shiftKey?l*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:l*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(l){this._lastTouchY=l.touches[0].pageY}handleTouchMove(l){const s=this._lastTouchY-l.touches[0].pageY;return this._lastTouchY=l.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(l,s))}};o.Viewport=u=d([S(2,v.IBufferService),S(3,v.IOptionsService),S(4,_.ICharSizeService),S(5,_.IRenderService),S(6,_.ICoreBrowserService),S(7,_.IThemeService)],u)},3107:function(C,o,c){var d=this&&this.__decorate||function(v,u,l,s){var n,p=arguments.length,w=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,u,l,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(u,l,w):n(u,l))||w);return p>3&&w&&Object.defineProperty(u,l,w),w},S=this&&this.__param||function(v,u){return function(l,s){u(l,s,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const h=c(4725),_=c(844),g=c(2585);let x=o.BufferDecorationRenderer=class extends _.Disposable{constructor(v,u,l,s,n){super(),this._screenElement=v,this._bufferService=u,this._coreBrowserService=l,this._decorationService=s,this._renderService=n,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(p=>this._removeDecoration(p))),this.register((0,_.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var s;const u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",((s=v==null?void 0:v.options)==null?void 0:s.layer)==="top"),u.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const l=v.options.x??0;return l&&l>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(v,u),u}_refreshStyle(v){const u=v.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let l=this._decorationElements.get(v);l||(l=this._createElement(v),v.element=l,this._decorationElements.set(v,l),this._container.appendChild(l),v.onDispose(()=>{this._decorationElements.delete(v),l.remove()})),l.style.top=u*this._renderService.dimensions.css.cell.height+"px",l.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(l)}}_refreshXPosition(v,u=v.element){if(!u)return;const l=v.options.x??0;(v.options.anchor||"left")==="right"?u.style.right=l?l*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=l?l*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var u;(u=this._decorationElements.get(v))==null||u.remove(),this._decorationElements.delete(v),v.dispose()}};o.BufferDecorationRenderer=x=d([S(1,g.IBufferService),S(2,h.ICoreBrowserService),S(3,g.IDecorationService),S(4,h.IRenderService)],x)},5871:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=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(c){if(c.options.overviewRulerOptions){for(const d of this._zones)if(d.color===c.options.overviewRulerOptions.color&&d.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,c.marker.line))return;if(this._lineAdjacentToZone(d,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(d,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,d){return d>=c.startBufferLine&&d<=c.endBufferLine}_lineAdjacentToZone(c,d,S){return d>=c.startBufferLine-this._linePadding[S||"full"]&&d<=c.endBufferLine+this._linePadding[S||"full"]}_addLineToZone(c,d){c.startBufferLine=Math.min(c.startBufferLine,d),c.endBufferLine=Math.max(c.endBufferLine,d)}}},5744:function(C,o,c){var d=this&&this.__decorate||function(n,p,w,y){var k,m=arguments.length,b=m<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,p,w,y);else for(var T=n.length-1;T>=0;T--)(k=n[T])&&(b=(m<3?k(b):m>3?k(p,w,b):k(p,w))||b);return m>3&&b&&Object.defineProperty(p,w,b),b},S=this&&this.__param||function(n,p){return function(w,y){p(w,y,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const h=c(5871),_=c(4725),g=c(844),x=c(2585),v={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0};let s=o.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(n,p,w,y,k,m,b){var I;super(),this._viewportElement=n,this._screenElement=p,this._bufferService=w,this._decorationService=y,this._renderService=k,this._optionsService=m,this._coreBrowserService=b,this._colorZoneStore=new h.ColorZoneStore,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(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)(()=>{var P;(P=this._canvas)==null||P.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){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())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const n=Math.floor(this._canvas.width/3),p=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=n,u.center=p,u.right=n,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=u.left,l.right=u.left+u.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const n=this._canvas.height/this._bufferService.buffer.lines.length,p=Math.round(Math.max(Math.min(n,12),6)*this._coreBrowserService.dpr);v.left=p,v.center=p,v.right=p}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.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(const p of this._decorationService.decorations)this._colorZoneStore.addDecoration(p);this._ctx.lineWidth=1;const n=this._colorZoneStore.zones;for(const p of n)p.position!=="full"&&this._renderColorZone(p);for(const p of n)p.position==="full"&&this._renderColorZone(p);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(n){this._ctx.fillStyle=n.color,this._ctx.fillRect(l[n.position||"full"],Math.round((this._canvas.height-1)*(n.startBufferLine/this._bufferService.buffers.active.lines.length)-v[n.position||"full"]/2),u[n.position||"full"],Math.round((this._canvas.height-1)*((n.endBufferLine-n.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[n.position||"full"]))}_queueRefresh(n,p){this._shouldUpdateDimensions=n||this._shouldUpdateDimensions,this._shouldUpdateAnchor=p||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=s=d([S(2,x.IBufferService),S(3,x.IDecorationService),S(4,_.IRenderService),S(5,x.IOptionsService),S(6,_.ICoreBrowserService)],s)},2950:function(C,o,c){var d=this&&this.__decorate||function(v,u,l,s){var n,p=arguments.length,w=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,u,l,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(u,l,w):n(u,l))||w);return p>3&&w&&Object.defineProperty(u,l,w),w},S=this&&this.__param||function(v,u){return function(l,s){u(l,s,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const h=c(4725),_=c(2585),g=c(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,u,l,s,n,p){this._textarea=v,this._compositionView=u,this._bufferService=l,this._optionsService=s,this._coreService=n,this._renderService=p,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let l;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,l=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),l.length>0&&this._coreService.triggerDataEvent(l,!0)}},0)}else{this._isSendingComposition=!1;const u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const u=this._textarea.value,l=u.replace(v,"");this._dataAlreadySent=l,u.length>v.length?this._coreService.triggerDataEvent(l,!0):u.length<v.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):u.length===v.length&&u!==v&&this._coreService.triggerDataEvent(u,!0)}},0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),l=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,n=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=l+"px",this._compositionView.style.lineHeight=l+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const p=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(p.width,1)+"px",this._textarea.style.height=Math.max(p.height,1)+"px",this._textarea.style.lineHeight=p.height+"px"}v||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=x=d([S(2,_.IBufferService),S(3,_.IOptionsService),S(4,_.ICoreService),S(5,h.IRenderService)],x)},9806:(C,o)=>{function c(d,S,h){const _=h.getBoundingClientRect(),g=d.getComputedStyle(h),x=parseInt(g.getPropertyValue("padding-left")),v=parseInt(g.getPropertyValue("padding-top"));return[S.clientX-_.left-x,S.clientY-_.top-v]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(d,S,h,_,g,x,v,u,l){if(!x)return;const s=c(d,S,h);return s?(s[0]=Math.ceil((s[0]+(l?v/2:0))/v),s[1]=Math.ceil(s[1]/u),s[0]=Math.min(Math.max(s[0],1),_+(l?1:0)),s[1]=Math.min(Math.max(s[1],1),g),s):void 0}},9504:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const d=c(2584);function S(u,l,s,n){const p=u-h(u,s),w=l-h(l,s),y=Math.abs(p-w)-function(k,m,b){let T=0;const I=k-h(k,b),P=m-h(m,b);for(let A=0;A<Math.abs(I-P);A++){const N=_(k,m)==="A"?-1:1,W=b.buffer.lines.get(I+N*A);W!=null&&W.isWrapped&&T++}return T}(u,l,s);return v(y,x(_(u,l),n))}function h(u,l){let s=0,n=l.buffer.lines.get(u),p=n==null?void 0:n.isWrapped;for(;p&&u>=0&&u<l.rows;)s++,n=l.buffer.lines.get(--u),p=n==null?void 0:n.isWrapped;return s}function _(u,l){return u>l?"A":"B"}function g(u,l,s,n,p,w){let y=u,k=l,m="";for(;y!==s||k!==n;)y+=p?1:-1,p&&y>w.cols-1?(m+=w.buffer.translateBufferLineToString(k,!1,u,y),y=0,u=0,k++):!p&&y<0&&(m+=w.buffer.translateBufferLineToString(k,!1,0,u+1),y=w.cols-1,u=y,k--);return m+w.buffer.translateBufferLineToString(k,!1,u,y)}function x(u,l){const s=l?"O":"[";return d.C0.ESC+s+u}function v(u,l){u=Math.floor(u);let s="";for(let n=0;n<u;n++)s+=l;return s}o.moveToCellSequence=function(u,l,s,n){const p=s.buffer.x,w=s.buffer.y;if(!s.buffer.hasScrollback)return function(m,b,T,I,P,A){return S(b,I,P,A).length===0?"":v(g(m,b,m,b-h(b,P),!1,P).length,x("D",A))}(p,w,0,l,s,n)+S(w,l,s,n)+function(m,b,T,I,P,A){let N;N=S(b,I,P,A).length>0?I-h(I,P):b;const W=I,V=function(X,j,E,D,M,B){let K;return K=S(E,D,M,B).length>0?D-h(D,M):j,X<E&&K<=D||X>=E&&K<D?"C":"D"}(m,b,T,I,P,A);return v(g(m,N,T,W,V==="C",P).length,x(V,A))}(p,w,u,l,s,n);let y;if(w===l)return y=p>u?"D":"C",v(Math.abs(p-u),x(y,n));y=w>l?"D":"C";const k=Math.abs(w-l);return v(function(m,b){return b.cols-m}(w>l?u:p,s)+(k-1)*s.cols+1+((w>l?p:u)-1),x(y,n))}},1296:function(C,o,c){var d=this&&this.__decorate||function(A,N,W,V){var X,j=arguments.length,E=j<3?N:V===null?V=Object.getOwnPropertyDescriptor(N,W):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(A,N,W,V);else for(var D=A.length-1;D>=0;D--)(X=A[D])&&(E=(j<3?X(E):j>3?X(N,W,E):X(N,W))||E);return j>3&&E&&Object.defineProperty(N,W,E),E},S=this&&this.__param||function(A,N){return function(W,V){N(W,V,A)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const h=c(3787),_=c(2550),g=c(2223),x=c(6171),v=c(6052),u=c(4725),l=c(8055),s=c(8460),n=c(844),p=c(2585),w="xterm-dom-renderer-owner-",y="xterm-rows",k="xterm-fg-",m="xterm-bg-",b="xterm-focus",T="xterm-selection";let I=1,P=o.DomRenderer=class extends n.Disposable{constructor(A,N,W,V,X,j,E,D,M,B,K,F,Y){super(),this._terminal=A,this._document=N,this._element=W,this._screenElement=V,this._viewportElement=X,this._helperContainer=j,this._linkifier2=E,this._charSizeService=M,this._optionsService=B,this._bufferService=K,this._coreBrowserService=F,this._themeService=Y,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),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(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(U=>this._injectCss(U))),this._injectCss(this._themeService.colors),this._rowFactory=D.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(w+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(U=>this._handleLinkHover(U))),this.register(this._linkifier2.onHideLinkUnderline(U=>this._handleLinkLeave(U))),this.register((0,n.toDisposable)(()=>{this._element.classList.remove(w+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new _.WidthCache(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(){const A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),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/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),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(const W of this._rowElements)W.style.width=`${this.dimensions.css.canvas.width}px`,W.style.height=`${this.dimensions.css.cell.height}px`,W.style.lineHeight=`${this.dimensions.css.cell.height}px`,W.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const N=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=N,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(A){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let N=`${this._terminalSelector} .${y} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;N+=`${this._terminalSelector} .${y} .xterm-dim { color: ${l.color.multiplyOpacity(A.foreground,.5).css};}`,N+=`${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;}`;const W=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;N+=`@keyframes ${W} { 50% { border-bottom-style: hidden; }}`,N+=`@keyframes ${V} { 50% { box-shadow: none; }}`,N+=`@keyframes ${X} { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,N+=`${this._terminalSelector} .${y}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${y}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${y}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${A.cursor.css} !important; color: ${A.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,N+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(const[j,E]of A.ansi.entries())N+=`${this._terminalSelector} .${k}${j} { color: ${E.css}; }${this._terminalSelector} .${k}${j}.xterm-dim { color: ${l.color.multiplyOpacity(E,.5).css}; }${this._terminalSelector} .${m}${j} { background-color: ${E.css}; }`;N+=`${this._terminalSelector} .${k}${g.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(A.background).css}; }${this._terminalSelector} .${k}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${m}${g.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=N}_setDefaultSpacing(){const A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,N){for(let W=this._rowElements.length;W<=N;W++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>N;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,N){this._refreshRowElements(A,N),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(b),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(b),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,N,W){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,N,W),this.renderRows(0,this._bufferService.rows-1),!A||!N)return;this._selectionRenderModel.update(this._terminal,A,N,W);const V=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,j=this._selectionRenderModel.viewportCappedStartRow,E=this._selectionRenderModel.viewportCappedEndRow;if(j>=this._bufferService.rows||E<0)return;const D=this._document.createDocumentFragment();if(W){const M=A[0]>N[0];D.appendChild(this._createSelectionElement(j,M?N[0]:A[0],M?A[0]:N[0],E-j+1))}else{const M=V===j?A[0]:0,B=j===X?N[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(j,M,B));const K=E-j-1;if(D.appendChild(this._createSelectionElement(j+1,0,this._bufferService.cols,K)),j!==E){const F=X===E?N[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(E,0,F))}}this._selectionContainer.appendChild(D)}_createSelectionElement(A,N,W,V=1){const X=this._document.createElement("div"),j=N*this.dimensions.css.cell.width;let E=this.dimensions.css.cell.width*(W-N);return j+E>this.dimensions.css.canvas.width&&(E=this.dimensions.css.canvas.width-j),X.style.height=V*this.dimensions.css.cell.height+"px",X.style.top=A*this.dimensions.css.cell.height+"px",X.style.left=`${j}px`,X.style.width=`${E}px`,X}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(const A of this._rowElements)A.replaceChildren()}renderRows(A,N){const W=this._bufferService.buffer,V=W.ybase+W.y,X=Math.min(W.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,E=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let M=A;M<=N;M++){const B=M+W.ydisp,K=this._rowElements[M],F=W.lines.get(B);if(!K||!F)break;K.replaceChildren(...this._rowFactory.createRow(F,B,B===V,E,D,X,j,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${w}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,N,W,V,X,j){W<0&&(A=0),V<0&&(N=0);const E=this._bufferService.rows-1;W=Math.max(Math.min(W,E),0),V=Math.max(Math.min(V,E),0),X=Math.min(X,this._bufferService.cols);const D=this._bufferService.buffer,M=D.ybase+D.y,B=Math.min(D.x,X-1),K=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,Y=this._optionsService.rawOptions.cursorInactiveStyle;for(let U=W;U<=V;++U){const O=U+D.ydisp,R=this._rowElements[U],$=D.lines.get(O);if(!R||!$)break;R.replaceChildren(...this._rowFactory.createRow($,O,O===M,F,Y,B,K,this.dimensions.css.cell.width,this._widthCache,j?U===W?A:0:-1,j?(U===V?N:X)-1:-1))}}};o.DomRenderer=P=d([S(7,p.IInstantiationService),S(8,u.ICharSizeService),S(9,p.IOptionsService),S(10,p.IBufferService),S(11,u.ICoreBrowserService),S(12,u.IThemeService)],P)},3787:function(C,o,c){var d=this&&this.__decorate||function(y,k,m,b){var T,I=arguments.length,P=I<3?k:b===null?b=Object.getOwnPropertyDescriptor(k,m):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(y,k,m,b);else for(var A=y.length-1;A>=0;A--)(T=y[A])&&(P=(I<3?T(P):I>3?T(k,m,P):T(k,m))||P);return I>3&&P&&Object.defineProperty(k,m,P),P},S=this&&this.__param||function(y,k){return function(m,b){k(m,b,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const h=c(2223),_=c(643),g=c(511),x=c(2585),v=c(8055),u=c(4725),l=c(4269),s=c(6171),n=c(3734);let p=o.DomRendererRowFactory=class{constructor(y,k,m,b,T,I,P){this._document=y,this._characterJoinerService=k,this._optionsService=m,this._coreBrowserService=b,this._coreService=T,this._decorationService=I,this._themeService=P,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,k,m){this._selectionStart=y,this._selectionEnd=k,this._columnSelectMode=m}createRow(y,k,m,b,T,I,P,A,N,W,V){const X=[],j=this._characterJoinerService.getJoinedCharacters(k),E=this._themeService.colors;let D,M=y.getNoBgTrimmedLength();m&&M<I+1&&(M=I+1);let B=0,K="",F=0,Y=0,U=0,O=!1,R=0,$=!1,H=0;const Q=[],z=W!==-1&&V!==-1;for(let J=0;J<M;J++){y.loadCell(J,this._workCell);let ie=this._workCell.getWidth();if(ie===0)continue;let fe=!1,Ie=J,ee=this._workCell;if(j.length>0&&J===j[0][0]){fe=!0;const ce=j.shift();ee=new l.JoinedCellData(this._workCell,y.translateToString(!0,ce[0],ce[1]),ce[1]-ce[0]),Ie=ce[1]-1,ie=ee.getWidth()}const Ir=this._isCellInSelection(J,k),$s=m&&J===I,Ks=z&&J>=W&&J<=V;let Vs=!1;this._decorationService.forEachDecorationAtCell(J,k,void 0,ce=>{Vs=!0});let Ri=ee.getChars()||_.WHITESPACE_CELL_CHAR;if(Ri===" "&&(ee.isUnderline()||ee.isOverline())&&(Ri=" "),H=ie*A-N.get(Ri,ee.isBold(),ee.isItalic()),D){if(B&&(Ir&&$||!Ir&&!$&&ee.bg===F)&&(Ir&&$&&E.selectionForeground||ee.fg===Y)&&ee.extended.ext===U&&Ks===O&&H===R&&!$s&&!fe&&!Vs){ee.isInvisible()?K+=_.WHITESPACE_CELL_CHAR:K+=Ri,B++;continue}B&&(D.textContent=K),D=this._document.createElement("span"),B=0,K=""}else D=this._document.createElement("span");if(F=ee.bg,Y=ee.fg,U=ee.extended.ext,O=Ks,R=H,$=Ir,fe&&I>=J&&I<=Ie&&(I=J),!this._coreService.isCursorHidden&&$s&&this._coreService.isCursorInitialized){if(Q.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&Q.push("xterm-cursor-blink"),Q.push(b==="bar"?"xterm-cursor-bar":b==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":Q.push("xterm-cursor-outline");break;case"block":Q.push("xterm-cursor-block");break;case"bar":Q.push("xterm-cursor-bar");break;case"underline":Q.push("xterm-cursor-underline")}}if(ee.isBold()&&Q.push("xterm-bold"),ee.isItalic()&&Q.push("xterm-italic"),ee.isDim()&&Q.push("xterm-dim"),K=ee.isInvisible()?_.WHITESPACE_CELL_CHAR:ee.getChars()||_.WHITESPACE_CELL_CHAR,ee.isUnderline()&&(Q.push(`xterm-underline-${ee.extended.underlineStyle}`),K===" "&&(K=" "),!ee.isUnderlineColorDefault()))if(ee.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${n.AttributeData.toColorRGB(ee.getUnderlineColor()).join(",")})`;else{let ce=ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ee.isBold()&&ce<8&&(ce+=8),D.style.textDecorationColor=E.ansi[ce].css}ee.isOverline()&&(Q.push("xterm-overline"),K===" "&&(K=" ")),ee.isStrikethrough()&&Q.push("xterm-strikethrough"),Ks&&(D.style.textDecoration="underline");let $e=ee.getFgColor(),Mr=ee.getFgColorMode(),st=ee.getBgColor(),Pr=ee.getBgColorMode();const Gs=!!ee.isInverse();if(Gs){const ce=$e;$e=st,st=ce;const Nu=Mr;Mr=Pr,Pr=Nu}let yt,Li,Ct,Br=!1;switch(this._decorationService.forEachDecorationAtCell(J,k,void 0,ce=>{ce.options.layer!=="top"&&Br||(ce.backgroundColorRGB&&(Pr=50331648,st=ce.backgroundColorRGB.rgba>>8&16777215,yt=ce.backgroundColorRGB),ce.foregroundColorRGB&&(Mr=50331648,$e=ce.foregroundColorRGB.rgba>>8&16777215,Li=ce.foregroundColorRGB),Br=ce.options.layer==="top")}),!Br&&Ir&&(yt=this._coreBrowserService.isFocused?E.selectionBackgroundOpaque:E.selectionInactiveBackgroundOpaque,st=yt.rgba>>8&16777215,Pr=50331648,Br=!0,E.selectionForeground&&(Mr=50331648,$e=E.selectionForeground.rgba>>8&16777215,Li=E.selectionForeground)),Br&&Q.push("xterm-decoration-top"),Pr){case 16777216:case 33554432:Ct=E.ansi[st],Q.push(`xterm-bg-${st}`);break;case 50331648:Ct=v.channels.toColor(st>>16,st>>8&255,255&st),this._addStyle(D,`background-color:#${w((st>>>0).toString(16),"0",6)}`);break;default:Gs?(Ct=E.foreground,Q.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Ct=E.background}switch(yt||ee.isDim()&&(yt=v.color.multiplyOpacity(Ct,.5)),Mr){case 16777216:case 33554432:ee.isBold()&&$e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($e+=8),this._applyMinimumContrast(D,Ct,E.ansi[$e],ee,yt,void 0)||Q.push(`xterm-fg-${$e}`);break;case 50331648:const ce=v.channels.toColor($e>>16&255,$e>>8&255,255&$e);this._applyMinimumContrast(D,Ct,ce,ee,yt,Li)||this._addStyle(D,`color:#${w($e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,Ct,E.foreground,ee,yt,Li)||Gs&&Q.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}Q.length&&(D.className=Q.join(" "),Q.length=0),$s||fe||Vs?D.textContent=K:B++,H!==this.defaultSpacing&&(D.style.letterSpacing=`${H}px`),X.push(D),J=Ie}return D&&B&&(D.textContent=K),X}_applyMinimumContrast(y,k,m,b,T,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(b.getCode()))return!1;const P=this._getContrastCache(b);let A;if(T||I||(A=P.getColor(k.rgba,m.rgba)),A===void 0){const N=this._optionsService.rawOptions.minimumContrastRatio/(b.isDim()?2:1);A=v.color.ensureContrastRatio(T||k,I||m,N),P.setColor((T||k).rgba,(I||m).rgba,A??null)}return!!A&&(this._addStyle(y,`color:${A.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,k){y.setAttribute("style",`${y.getAttribute("style")||""}${k};`)}_isCellInSelection(y,k){const m=this._selectionStart,b=this._selectionEnd;return!(!m||!b)&&(this._columnSelectMode?m[0]<=b[0]?y>=m[0]&&k>=m[1]&&y<b[0]&&k<=b[1]:y<m[0]&&k>=m[1]&&y>=b[0]&&k<=b[1]:k>m[1]&&k<b[1]||m[1]===b[1]&&k===m[1]&&y>=m[0]&&y<b[0]||m[1]<b[1]&&k===b[1]&&y<b[0]||m[1]<b[1]&&k===m[1]&&y>=m[0])}};function w(y,k,m){for(;y.length<m;)y=k+y;return y}o.DomRendererRowFactory=p=d([S(1,u.ICharacterJoinerService),S(2,x.IOptionsService),S(3,u.ICoreBrowserService),S(4,x.ICoreService),S(5,x.IDecorationService),S(6,u.IThemeService)],p)},2550:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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";const S=c.createElement("span");S.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const g=c.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[S,h,_,g],this._container.appendChild(S),this._container.appendChild(h),this._container.appendChild(_),this._container.appendChild(g),d.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(c,d,S,h){c===this._font&&d===this._fontSize&&S===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=d,this._weight=S,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${S}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${S}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,d,S){let h=0;if(!d&&!S&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const x=this._measure(c,0);return x>0&&(this._flat[h]=x),x}let _=c;d&&(_+="B"),S&&(_+="I");let g=this._holey.get(_);if(g===void 0){let x=0;d&&(x|=1),S&&(x|=2),g=this._measure(c,x),g>0&&this._holey.set(_,g)}return g}_measure(c,d){const S=this._measureElements[d];return S.textContent=c.repeat(32),S.offsetWidth/32}}},2223:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const d=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(C,o)=>{function c(S){return 57508<=S&&S<=57558}function d(S){return S>=128512&&S<=128591||S>=127744&&S<=128511||S>=128640&&S<=128767||S>=9728&&S<=9983||S>=9984&&S<=10175||S>=65024&&S<=65039||S>=129280&&S<=129535||S>=127462&&S<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(S){if(!S)throw new Error("value must not be falsy");return S},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(S){return 57520<=S&&S<=57527},o.isEmoji=d,o.allowRescaling=function(S,h,_,g){return h===1&&_>Math.ceil(1.5*g)&&S!==void 0&&S>255&&!d(S)&&!c(S)&&!function(x){return 57344<=x&&x<=63743}(S)},o.treatGlyphAsBackgroundColor=function(S){return c(S)||function(h){return 9472<=h&&h<=9631}(S)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(S,h,_=0){return(S-(2*Math.round(h)-_))%(2*Math.round(h))}},6052:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{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(S,h,_,g=!1){if(this.selectionStart=h,this.selectionEnd=_,!h||!_||h[0]===_[0]&&h[1]===_[1])return void this.clear();const x=S.buffers.active.ydisp,v=h[1]-x,u=_[1]-x,l=Math.max(v,0),s=Math.min(u,S.rows-1);l>=S.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=v,this.viewportEndRow=u,this.viewportCappedStartRow=l,this.viewportCappedEndRow=s,this.startCol=h[0],this.endCol=_[0])}isCellSelected(S,h,_){return!!this.hasSelection&&(_-=S.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&_>=this.viewportCappedStartRow&&h<this.endCol&&_<=this.viewportCappedEndRow:h<this.startCol&&_>=this.viewportCappedStartRow&&h>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,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.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()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,d=this.selectionEnd;return!(!c||!d)&&(c[1]>d[1]||c[1]===d[1]&&c[0]>d[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(C,o,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,m=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(m=(k<3?y(m):k>3?y(n,p,m):y(n,p))||m);return k>3&&m&&Object.defineProperty(n,p,m),m},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const h=c(2585),_=c(8460),g=c(844);let x=o.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,n,p){super(),this._optionsService=p,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new l(this._optionsService))}catch{this._measureStrategy=this.register(new u(s,n,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};o.CharSizeService=x=d([S(2,h.IOptionsService)],x);class v extends g.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(n,p){n!==void 0&&n>0&&p!==void 0&&p>0&&(this._result.width=n,this._result.height=p)}}class u extends v{constructor(n,p,w){super(),this._document=n,this._parentElement=p,this._optionsService=w,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}}class l extends v{constructor(n){super(),this._optionsService=n,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const p=this._ctx.measureText("W");if(!("width"in p&&"fontBoundingBoxAscent"in p&&"fontBoundingBoxDescent"in p))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const n=this._ctx.measureText("W");return this._validateAndSet(n.width,n.fontBoundingBoxAscent+n.fontBoundingBoxDescent),this._result}}},4269:function(C,o,c){var d=this&&this.__decorate||function(l,s,n,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(l,s,n,p);else for(var m=l.length-1;m>=0;m--)(w=l[m])&&(k=(y<3?w(k):y>3?w(s,n,k):w(s,n))||k);return y>3&&k&&Object.defineProperty(s,n,k),k},S=this&&this.__param||function(l,s){return function(n,p){s(n,p,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const h=c(3734),_=c(643),g=c(511),x=c(2585);class v extends h.AttributeData{constructor(s,n,p){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=n,this._width=p}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=v;let u=o.CharacterJoinerService=class Ou{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(s){const n={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(n),n.id}deregister(s){for(let n=0;n<this._characterJoiners.length;n++)if(this._characterJoiners[n].id===s)return this._characterJoiners.splice(n,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const n=this._bufferService.buffer.lines.get(s);if(!n||n.length===0)return[];const p=[],w=n.translateToString(!0);let y=0,k=0,m=0,b=n.getFg(0),T=n.getBg(0);for(let I=0;I<n.getTrimmedLength();I++)if(n.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==b||this._workCell.bg!==T){if(I-y>1){const P=this._getJoinedRanges(w,m,k,n,y);for(let A=0;A<P.length;A++)p.push(P[A])}y=I,m=k,b=this._workCell.fg,T=this._workCell.bg}k+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const I=this._getJoinedRanges(w,m,k,n,y);for(let P=0;P<I.length;P++)p.push(I[P])}return p}_getJoinedRanges(s,n,p,w,y){const k=s.substring(n,p);let m=[];try{m=this._characterJoiners[0].handler(k)}catch(b){console.error(b)}for(let b=1;b<this._characterJoiners.length;b++)try{const T=this._characterJoiners[b].handler(k);for(let I=0;I<T.length;I++)Ou._mergeRanges(m,T[I])}catch(T){console.error(T)}return this._stringRangesToCellRanges(m,w,y),m}_stringRangesToCellRanges(s,n,p){let w=0,y=!1,k=0,m=s[w];if(m){for(let b=p;b<this._bufferService.cols;b++){const T=n.getWidth(b),I=n.getString(b).length||_.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!y&&m[0]<=k&&(m[0]=b,y=!0),m[1]<=k){if(m[1]=b,m=s[++w],!m)break;m[0]<=k?(m[0]=b,y=!0):y=!1}k+=I}}m&&(m[1]=this._bufferService.cols)}}static _mergeRanges(s,n){let p=!1;for(let w=0;w<s.length;w++){const y=s[w];if(p){if(n[1]<=y[0])return s[w-1][1]=n[1],s;if(n[1]<=y[1])return s[w-1][1]=Math.max(n[1],y[1]),s.splice(w,1),s;s.splice(w,1),w--}else{if(n[1]<=y[0])return s.splice(w,0,n),s;if(n[1]<=y[1])return y[0]=Math.min(n[0],y[0]),s;n[0]<y[1]&&(y[0]=Math.min(n[0],y[0]),p=!0)}}return p?s[s.length-1][1]=n[1]:s.push(n),s}};o.CharacterJoinerService=u=d([S(0,x.IBufferService)],u)},5114:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const d=c(844),S=c(8460),h=c(3656);class _ extends d.Disposable{constructor(v,u,l){super(),this._textarea=v,this._window=u,this.mainDocument=l,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new S.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new S.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this.register((0,S.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(v){this._window!==v&&(this._window=v,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}}o.CoreBrowserService=_;class g extends d.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new S.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)(()=>this.clearListener()))}setWindow(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.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)}}},779:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const d=c(844);class S extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const g=this.linkProviders.indexOf(_);g!==-1&&this.linkProviders.splice(g,1)}}}}o.LinkProviderService=S},8934:function(C,o,c){var d=this&&this.__decorate||function(x,v,u,l){var s,n=arguments.length,p=n<3?v:l===null?l=Object.getOwnPropertyDescriptor(v,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(x,v,u,l);else for(var w=x.length-1;w>=0;w--)(s=x[w])&&(p=(n<3?s(p):n>3?s(v,u,p):s(v,u))||p);return n>3&&p&&Object.defineProperty(v,u,p),p},S=this&&this.__param||function(x,v){return function(u,l){v(u,l,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const h=c(4725),_=c(9806);let g=o.MouseService=class{constructor(x,v){this._renderService=x,this._charSizeService=v}getCoords(x,v,u,l,s){return(0,_.getCoords)(window,x,v,u,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(x,v){const u=(0,_.getCoordsRelativeToElement)(window,x,v);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};o.MouseService=g=d([S(0,h.IRenderService),S(1,h.ICharSizeService)],g)},3230:function(C,o,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,m=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(m=(k<3?y(m):k>3?y(n,p,m):y(n,p))||m);return k>3&&m&&Object.defineProperty(n,p,m),m},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const h=c(6193),_=c(4725),g=c(8460),x=c(844),v=c(7226),u=c(2585);let l=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,n,p,w,y,k,m,b){super(),this._rowCount=s,this._charSizeService=w,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),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 g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer((T,I)=>this._renderRows(T,I),m),this.register(this._renderDebouncer),this.register(m.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(k.onResize(()=>this._fullRefresh())),this.register(k.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()})),this.register(p.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(y.onDecorationRegistered(()=>this._fullRefresh())),this.register(y.onDecorationRemoved(()=>this._fullRefresh())),this.register(p.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(k.cols,k.rows),this._fullRefresh()})),this.register(p.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(k.buffer.y,k.buffer.y,!0))),this.register(b.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(m.window,n),this.register(m.onWindowChange(T=>this._registerIntersectionObserver(T,n)))}_registerIntersectionObserver(s,n){if("IntersectionObserver"in s){const p=new s.IntersectionObserver(w=>this._handleIntersectionChange(w[w.length-1]),{threshold:0});p.observe(n),this._observerDisposable.value=(0,x.toDisposable)(()=>p.disconnect())}}_handleIntersectionChange(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.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(s,n,p=!1){this._isPaused?this._needsFullRefresh=!0:(p||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,n,this._rowCount))}_renderRows(s,n){this._renderer.value&&(s=Math.min(s,this._rowCount-1),n=Math.min(n,this._rowCount-1),this._renderer.value.renderRows(s,n),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:n}),this._onRender.fire({start:s,end:n}),this._isNextRenderRedrawOnly=!0)}resize(s,n){this._rowCount=n,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(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw(n=>this.refreshRows(n.start,n.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(s){return this._renderDebouncer.addRefreshCallback(s)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var s,n;this._renderer.value&&((n=(s=this._renderer.value).clearTextureAtlas)==null||n.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,n){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var p;return(p=this._renderer.value)==null?void 0:p.handleResize(s,n)}):this._renderer.value.handleResize(s,n),this._fullRefresh())}handleCharSizeChanged(){var s;(s=this._renderer.value)==null||s.handleCharSizeChanged()}handleBlur(){var s;(s=this._renderer.value)==null||s.handleBlur()}handleFocus(){var s;(s=this._renderer.value)==null||s.handleFocus()}handleSelectionChanged(s,n,p){var w;this._selectionState.start=s,this._selectionState.end=n,this._selectionState.columnSelectMode=p,(w=this._renderer.value)==null||w.handleSelectionChanged(s,n,p)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};o.RenderService=l=d([S(2,u.IOptionsService),S(3,_.ICharSizeService),S(4,u.IDecorationService),S(5,u.IBufferService),S(6,_.ICoreBrowserService),S(7,_.IThemeService)],l)},9312:function(C,o,c){var d=this&&this.__decorate||function(m,b,T,I){var P,A=arguments.length,N=A<3?b:I===null?I=Object.getOwnPropertyDescriptor(b,T):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(m,b,T,I);else for(var W=m.length-1;W>=0;W--)(P=m[W])&&(N=(A<3?P(N):A>3?P(b,T,N):P(b,T))||N);return A>3&&N&&Object.defineProperty(b,T,N),N},S=this&&this.__param||function(m,b){return function(T,I){b(T,I,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const h=c(9806),_=c(9504),g=c(456),x=c(4725),v=c(8460),u=c(844),l=c(6114),s=c(4841),n=c(511),p=c(2585),w=" ",y=new RegExp(w,"g");let k=o.SelectionService=class extends u.Disposable{constructor(m,b,T,I,P,A,N,W,V){super(),this._element=m,this._screenElement=b,this._linkifier=T,this._bufferService=I,this._coreService=P,this._mouseService=A,this._optionsService=N,this._renderService=W,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new n.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(X=>this._handleTrim(X)),this.register(this._bufferService.buffers.onBufferActivate(X=>this._handleBufferActivate(X))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)(()=>{this._removeMouseDownListeners()}))}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(){const m=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!(!m||!b||m[0]===b[0]&&m[1]===b[1])}get selectionText(){const m=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;if(!m||!b)return"";const T=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(m[0]===b[0])return"";const P=m[0]<b[0]?m[0]:b[0],A=m[0]<b[0]?b[0]:m[0];for(let N=m[1];N<=b[1];N++){const W=T.translateBufferLineToString(N,!0,P,A);I.push(W)}}else{const P=m[1]===b[1]?b[0]:void 0;I.push(T.translateBufferLineToString(m[1],!0,m[0],P));for(let A=m[1]+1;A<=b[1]-1;A++){const N=T.lines.get(A),W=T.translateBufferLineToString(A,!0);N!=null&&N.isWrapped?I[I.length-1]+=W:I.push(W)}if(m[1]!==b[1]){const A=T.lines.get(b[1]),N=T.translateBufferLineToString(b[1],!0,0,b[0]);A&&A.isWrapped?I[I.length-1]+=N:I.push(N)}}return I.map(P=>P.replace(y," ")).join(l.isWindows?`\r
|
|
44
|
+
WARNING: This link could potentially be dangerous`)){const l=window.open();if(l){try{l.opener=null}catch{}l.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=g=d([S(0,_.IBufferService),S(1,_.IOptionsService),S(2,_.IOscLinkService)],g)},6193:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,d){this._renderCallback=c,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(c,d,S){this._rowCount=S,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const d=c(3614),S=c(3656),h=c(3551),_=c(9042),g=c(3730),x=c(1680),v=c(3107),u=c(5744),l=c(2950),s=c(1296),n=c(428),p=c(4269),w=c(5114),y=c(8934),k=c(3230),m=c(9312),b=c(4725),T=c(6731),M=c(8055),P=c(8969),A=c(8460),N=c(844),W=c(6114),V=c(8437),X=c(2584),j=c(7399),E=c(5941),D=c(9074),I=c(2585),B=c(5435),K=c(4567),F=c(779);class Y extends P.CoreTerminal{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}constructor(O={}){super(O),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new N.MutableDisposable),this._onCursorMove=this.register(new A.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new A.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new A.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new A.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new A.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new A.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new A.EventEmitter),this._onBlur=this.register(new A.EventEmitter),this._onA11yCharEmitter=this.register(new A.EventEmitter),this._onA11yTabEmitter=this.register(new A.EventEmitter),this._onWillOpen=this.register(new A.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(F.LinkProviderService),this._instantiationService.setService(b.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((R,$)=>this.refresh(R,$))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(R=>this._reportWindowsOptions(R))),this.register(this._inputHandler.onColor(R=>this._handleColorEvent(R))),this.register((0,A.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,A.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(R=>this._afterResize(R.cols,R.rows))),this.register((0,N.toDisposable)(()=>{var R,$;this._customKeyEventHandler=void 0,($=(R=this.element)==null?void 0:R.parentNode)==null||$.removeChild(this.element)}))}_handleColorEvent(O){if(this._themeService)for(const R of O){let $,H="";switch(R.index){case 256:$="foreground",H="10";break;case 257:$="background",H="11";break;case 258:$="cursor",H="12";break;default:$="ansi",H="4;"+R.index}switch(R.type){case 0:const Q=M.color.toColorRGB($==="ansi"?this._themeService.colors.ansi[R.index]:this._themeService.colors[$]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${H};${(0,E.toRgbString)(Q)}${X.C1_ESCAPED.ST}`);break;case 1:if($==="ansi")this._themeService.modifyColors(z=>z.ansi[R.index]=M.channels.toColor(...R.color));else{const z=$;this._themeService.modifyColors(J=>J[z]=M.channels.toColor(...R.color))}break;case 2:this._themeService.restoreColor(R.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(O){O?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(O){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var O;return(O=this.textarea)==null?void 0:O.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const O=this.buffer.ybase+this.buffer.y,R=this.buffer.lines.get(O);if(!R)return;const $=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,Q=R.getWidth($),z=this._renderService.dimensions.css.cell.width*Q,J=this.buffer.y*this._renderService.dimensions.css.cell.height,ie=$*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ie+"px",this.textarea.style.top=J+"px",this.textarea.style.width=z+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,S.addDisposableDomListener)(this.element,"copy",R=>{this.hasSelection()&&(0,d.copyHandler)(R,this._selectionService)}));const O=R=>(0,d.handlePasteEvent)(R,this.textarea,this.coreService,this.optionsService);this.register((0,S.addDisposableDomListener)(this.textarea,"paste",O)),this.register((0,S.addDisposableDomListener)(this.element,"paste",O)),W.isFirefox?this.register((0,S.addDisposableDomListener)(this.element,"mousedown",R=>{R.button===2&&(0,d.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,S.addDisposableDomListener)(this.element,"contextmenu",R=>{(0,d.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),W.isLinux&&this.register((0,S.addDisposableDomListener)(this.element,"auxclick",R=>{R.button===1&&(0,d.moveTextAreaUnderMouseCursor)(R,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,S.addDisposableDomListener)(this.textarea,"keyup",O=>this._keyUp(O),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keydown",O=>this._keyDown(O),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keypress",O=>this._keyPress(O),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionupdate",O=>this._compositionHelper.compositionupdate(O))),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,S.addDisposableDomListener)(this.textarea,"input",O=>this._inputEvent(O),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(O){var $;if(!O)throw new Error("Terminal requires a parent element.");if(O.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),(($=this.element)==null?void 0:$.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=O.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"),O.appendChild(this.element);const R=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),R.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,S.addDisposableDomListener)(this.screenElement,"mousemove",H=>this.updateCursorStyle(H))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),R.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),W.isChromeOS||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._coreBrowserService=this.register(this._instantiationService.createInstance(w.CoreBrowserService,this.textarea,O.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(b.ICoreBrowserService,this._coreBrowserService),this.register((0,S.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,S.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(n.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(b.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(b.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(b.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(b.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(l.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(b.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(R);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),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.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(m.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(b.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,S.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,S.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),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(K.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const O=this,R=this.element;function $(z){const J=O._mouseService.getMouseReportCoords(z,O.screenElement);if(!J)return!1;let ie,fe;switch(z.overrideType||z.type){case"mousemove":fe=32,z.buttons===void 0?(ie=3,z.button!==void 0&&(ie=z.button<3?z.button:3)):ie=1&z.buttons?0:4&z.buttons?1:2&z.buttons?2:3;break;case"mouseup":fe=0,ie=z.button<3?z.button:3;break;case"mousedown":fe=1,ie=z.button<3?z.button:3;break;case"wheel":if(O._customWheelEventHandler&&O._customWheelEventHandler(z)===!1||O.viewport.getLinesScrolled(z)===0)return!1;fe=z.deltaY<0?0:1,ie=4;break;default:return!1}return!(fe===void 0||ie===void 0||ie>4)&&O.coreMouseService.triggerMouseEvent({col:J.col,row:J.row,x:J.x,y:J.y,button:ie,action:fe,ctrl:z.ctrlKey,alt:z.altKey,shift:z.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Q={mouseup:z=>($(z),z.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(z)),wheel:z=>($(z),this.cancel(z,!0)),mousedrag:z=>{z.buttons&&$(z)},mousemove:z=>{z.buttons||$(z)}};this.register(this.coreMouseService.onProtocolChange(z=>{z?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(z)),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()),8&z?H.mousemove||(R.addEventListener("mousemove",Q.mousemove),H.mousemove=Q.mousemove):(R.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&z?H.wheel||(R.addEventListener("wheel",Q.wheel,{passive:!1}),H.wheel=Q.wheel):(R.removeEventListener("wheel",H.wheel),H.wheel=null),2&z?H.mouseup||(H.mouseup=Q.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&z?H.mousedrag||(H.mousedrag=Q.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,S.addDisposableDomListener)(R,"mousedown",z=>{if(z.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(z))return $(z),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(z)})),this.register((0,S.addDisposableDomListener)(R,"wheel",z=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(z)===!1)return!1;if(!this.buffer.hasScrollback){const J=this.viewport.getLinesScrolled(z);if(J===0)return;const ie=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(z.deltaY<0?"A":"B");let fe="";for(let Ie=0;Ie<Math.abs(J);Ie++)fe+=ie;return this.coreService.triggerDataEvent(fe,!0),this.cancel(z,!0)}return this.viewport.handleWheel(z)?this.cancel(z):void 0}},{passive:!1})),this.register((0,S.addDisposableDomListener)(R,"touchstart",z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(z),this.cancel(z)},{passive:!0})),this.register((0,S.addDisposableDomListener)(R,"touchmove",z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(z)?void 0:this.cancel(z)},{passive:!1}))}refresh(O,R){var $;($=this._renderService)==null||$.refreshRows(O,R)}updateCursorStyle(O){var R;(R=this._selectionService)!=null&&R.shouldColumnSelect(O)?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(O,R,$=0){var H;$===1?(super.scrollLines(O,R,$),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.scrollLines(O)}paste(O){(0,d.paste)(O,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(O){this._customKeyEventHandler=O}attachCustomWheelEventHandler(O){this._customWheelEventHandler=O}registerLinkProvider(O){return this._linkProviderService.registerLinkProvider(O)}registerCharacterJoiner(O){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const R=this._characterJoinerService.register(O);return this.refresh(0,this.rows-1),R}deregisterCharacterJoiner(O){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(O)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(O){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+O)}registerDecoration(O){return this._decorationService.registerDecoration(O)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(O,R,$){this._selectionService.setSelection(O,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 O;(O=this._selectionService)==null||O.clearSelection()}selectAll(){var O;(O=this._selectionService)==null||O.selectAll()}selectLines(O,R){var $;($=this._selectionService)==null||$.selectLines(O,R)}_keyDown(O){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1)return!1;const R=this.browser.isMac&&this.options.macOptionIsMeta&&O.altKey;if(!R&&!this._compositionHelper.keydown(O))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;R||O.key!=="Dead"&&O.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const $=(0,j.evaluateKeyboardEvent)(O,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(O),$.type===3||$.type===2){const H=this.rows-1;return this.scrollLines($.type===2?-H:H),this.cancel(O,!0)}return $.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,O)||($.cancel&&this.cancel(O,!0),!$.key||!!(O.key&&!O.ctrlKey&&!O.altKey&&!O.metaKey&&O.key.length===1&&O.key.charCodeAt(0)>=65&&O.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):($.key!==X.C0.ETX&&$.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:$.key,domEvent:O}),this._showCursor(),this.coreService.triggerDataEvent($.key,!0),!this.optionsService.rawOptions.screenReaderMode||O.altKey||O.ctrlKey?this.cancel(O,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(O,R){const $=O.isMac&&!this.options.macOptionIsMeta&&R.altKey&&!R.ctrlKey&&!R.metaKey||O.isWindows&&R.altKey&&R.ctrlKey&&!R.metaKey||O.isWindows&&R.getModifierState("AltGraph");return R.type==="keypress"?$:$&&(!R.keyCode||R.keyCode>47)}_keyUp(O){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1||(function(R){return R.keyCode===16||R.keyCode===17||R.keyCode===18}(O)||this.focus(),this.updateCursorStyle(O),this._keyPressHandled=!1)}_keyPress(O){let R;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1)return!1;if(this.cancel(O),O.charCode)R=O.charCode;else if(O.which===null||O.which===void 0)R=O.keyCode;else{if(O.which===0||O.charCode===0)return!1;R=O.which}return!(!R||(O.altKey||O.ctrlKey||O.metaKey)&&!this._isThirdLevelShift(this.browser,O)||(R=String.fromCharCode(R),this._onKey.fire({key:R,domEvent:O}),this._showCursor(),this.coreService.triggerDataEvent(R,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(O){if(O.data&&O.inputType==="insertText"&&(!O.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const R=O.data;return this.coreService.triggerDataEvent(R,!0),this.cancel(O),!0}return!1}resize(O,R){O!==this.cols||R!==this.rows?super.resize(O,R):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(O,R){var $,H;($=this._charSizeService)==null||$.measure(),(H=this.viewport)==null||H.syncScrollArea(!0)}clear(){var O;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 R=1;R<this.rows;R++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(O=this.viewport)==null||O.reset(),this.refresh(0,this.rows-1)}}reset(){var R,$;this.options.rows=this.rows,this.options.cols=this.cols;const O=this._customKeyEventHandler;this._setup(),super.reset(),(R=this._selectionService)==null||R.reset(),this._decorationService.reset(),($=this.viewport)==null||$.reset(),this._customKeyEventHandler=O,this.refresh(0,this.rows-1)}clearTextureAtlas(){var O;(O=this._renderService)==null||O.clearTextureAtlas()}_reportFocus(){var O;(O=this.element)!=null&&O.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(O){if(this._renderService)switch(O){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const R=this._renderService.dimensions.css.canvas.width.toFixed(0),$=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${$};${R}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),Q=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${Q};${H}t`)}}cancel(O,R){if(this.options.cancelEvents||R)return O.preventDefault(),O.stopPropagation(),!1}}o.Terminal=Y},9924:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,d=1e3){this._renderCallback=c,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,d,S){this._rowCount=S,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=h-this._lastRefreshMs,g=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d)}}},1680:function(C,o,c){var d=this&&this.__decorate||function(l,s,n,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(l,s,n,p);else for(var m=l.length-1;m>=0;m--)(w=l[m])&&(k=(y<3?w(k):y>3?w(s,n,k):w(s,n))||k);return y>3&&k&&Object.defineProperty(s,n,k),k},S=this&&this.__param||function(l,s){return function(n,p){s(n,p,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const h=c(3656),_=c(4725),g=c(8460),x=c(844),v=c(2585);let u=o.Viewport=class extends x.Disposable{constructor(l,s,n,p,w,y,k,m){super(),this._viewportElement=l,this._scrollArea=s,this._bufferService=n,this._optionsService=p,this._charSizeService=w,this._renderService=y,this._coreBrowserService=k,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(b=>this._activeBuffer=b.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(b=>this._renderDimensions=b)),this._handleThemeChange(m.colors),this.register(m.onChangeColors(b=>this._handleThemeChange(b))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(l){this._viewportElement.style.backgroundColor=l.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(l){if(l)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const l=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==l&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=l),this._refreshAnimationFrame=null}syncScrollArea(l=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(l);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(l)}_handleScroll(l){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const l=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(l*(this._smoothScrollState.target-this._smoothScrollState.origin)),l<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(l,s){const n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&n<this._lastRecordedBufferHeight)||(l.cancelable&&l.preventDefault(),!1)}handleWheel(l){const s=this._getPixelsScrolled(l);return s!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(l,s))}scrollLines(l){if(l!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=l*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!1})}_getPixelsScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let s=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(l,s){var m;let n,p="";const w=[],y=s??this._bufferService.buffer.lines.length,k=this._bufferService.buffer.lines;for(let b=l;b<y;b++){const T=k.get(b);if(!T)continue;const M=(m=k.get(b+1))==null?void 0:m.isWrapped;if(p+=T.translateToString(!M),!M||b===k.length-1){const P=document.createElement("div");P.textContent=p,w.push(P),p.length>0&&(n=P),p=""}}return{bufferElements:w,cursorElement:n}}getLinesScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let s=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(l,s){const n=this._optionsService.rawOptions.fastScrollModifier;return n==="alt"&&s.altKey||n==="ctrl"&&s.ctrlKey||n==="shift"&&s.shiftKey?l*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:l*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(l){this._lastTouchY=l.touches[0].pageY}handleTouchMove(l){const s=this._lastTouchY-l.touches[0].pageY;return this._lastTouchY=l.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(l,s))}};o.Viewport=u=d([S(2,v.IBufferService),S(3,v.IOptionsService),S(4,_.ICharSizeService),S(5,_.IRenderService),S(6,_.ICoreBrowserService),S(7,_.IThemeService)],u)},3107:function(C,o,c){var d=this&&this.__decorate||function(v,u,l,s){var n,p=arguments.length,w=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,u,l,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(u,l,w):n(u,l))||w);return p>3&&w&&Object.defineProperty(u,l,w),w},S=this&&this.__param||function(v,u){return function(l,s){u(l,s,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const h=c(4725),_=c(844),g=c(2585);let x=o.BufferDecorationRenderer=class extends _.Disposable{constructor(v,u,l,s,n){super(),this._screenElement=v,this._bufferService=u,this._coreBrowserService=l,this._decorationService=s,this._renderService=n,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(p=>this._removeDecoration(p))),this.register((0,_.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var s;const u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",((s=v==null?void 0:v.options)==null?void 0:s.layer)==="top"),u.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const l=v.options.x??0;return l&&l>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(v,u),u}_refreshStyle(v){const u=v.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let l=this._decorationElements.get(v);l||(l=this._createElement(v),v.element=l,this._decorationElements.set(v,l),this._container.appendChild(l),v.onDispose(()=>{this._decorationElements.delete(v),l.remove()})),l.style.top=u*this._renderService.dimensions.css.cell.height+"px",l.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(l)}}_refreshXPosition(v,u=v.element){if(!u)return;const l=v.options.x??0;(v.options.anchor||"left")==="right"?u.style.right=l?l*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=l?l*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var u;(u=this._decorationElements.get(v))==null||u.remove(),this._decorationElements.delete(v),v.dispose()}};o.BufferDecorationRenderer=x=d([S(1,g.IBufferService),S(2,h.ICoreBrowserService),S(3,g.IDecorationService),S(4,h.IRenderService)],x)},5871:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=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(c){if(c.options.overviewRulerOptions){for(const d of this._zones)if(d.color===c.options.overviewRulerOptions.color&&d.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,c.marker.line))return;if(this._lineAdjacentToZone(d,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(d,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,d){return d>=c.startBufferLine&&d<=c.endBufferLine}_lineAdjacentToZone(c,d,S){return d>=c.startBufferLine-this._linePadding[S||"full"]&&d<=c.endBufferLine+this._linePadding[S||"full"]}_addLineToZone(c,d){c.startBufferLine=Math.min(c.startBufferLine,d),c.endBufferLine=Math.max(c.endBufferLine,d)}}},5744:function(C,o,c){var d=this&&this.__decorate||function(n,p,w,y){var k,m=arguments.length,b=m<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,p,w,y);else for(var T=n.length-1;T>=0;T--)(k=n[T])&&(b=(m<3?k(b):m>3?k(p,w,b):k(p,w))||b);return m>3&&b&&Object.defineProperty(p,w,b),b},S=this&&this.__param||function(n,p){return function(w,y){p(w,y,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const h=c(5871),_=c(4725),g=c(844),x=c(2585),v={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0};let s=o.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(n,p,w,y,k,m,b){var M;super(),this._viewportElement=n,this._screenElement=p,this._bufferService=w,this._decorationService=y,this._renderService=k,this._optionsService=m,this._coreBrowserService=b,this._colorZoneStore=new h.ColorZoneStore,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(),(M=this._viewportElement.parentElement)==null||M.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)(()=>{var P;(P=this._canvas)==null||P.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){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())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const n=Math.floor(this._canvas.width/3),p=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=n,u.center=p,u.right=n,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=u.left,l.right=u.left+u.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const n=this._canvas.height/this._bufferService.buffer.lines.length,p=Math.round(Math.max(Math.min(n,12),6)*this._coreBrowserService.dpr);v.left=p,v.center=p,v.right=p}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.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(const p of this._decorationService.decorations)this._colorZoneStore.addDecoration(p);this._ctx.lineWidth=1;const n=this._colorZoneStore.zones;for(const p of n)p.position!=="full"&&this._renderColorZone(p);for(const p of n)p.position==="full"&&this._renderColorZone(p);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(n){this._ctx.fillStyle=n.color,this._ctx.fillRect(l[n.position||"full"],Math.round((this._canvas.height-1)*(n.startBufferLine/this._bufferService.buffers.active.lines.length)-v[n.position||"full"]/2),u[n.position||"full"],Math.round((this._canvas.height-1)*((n.endBufferLine-n.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[n.position||"full"]))}_queueRefresh(n,p){this._shouldUpdateDimensions=n||this._shouldUpdateDimensions,this._shouldUpdateAnchor=p||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=s=d([S(2,x.IBufferService),S(3,x.IDecorationService),S(4,_.IRenderService),S(5,x.IOptionsService),S(6,_.ICoreBrowserService)],s)},2950:function(C,o,c){var d=this&&this.__decorate||function(v,u,l,s){var n,p=arguments.length,w=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,u,l,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(u,l,w):n(u,l))||w);return p>3&&w&&Object.defineProperty(u,l,w),w},S=this&&this.__param||function(v,u){return function(l,s){u(l,s,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const h=c(4725),_=c(2585),g=c(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,u,l,s,n,p){this._textarea=v,this._compositionView=u,this._bufferService=l,this._optionsService=s,this._coreService=n,this._renderService=p,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let l;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,l=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),l.length>0&&this._coreService.triggerDataEvent(l,!0)}},0)}else{this._isSendingComposition=!1;const u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const u=this._textarea.value,l=u.replace(v,"");this._dataAlreadySent=l,u.length>v.length?this._coreService.triggerDataEvent(l,!0):u.length<v.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):u.length===v.length&&u!==v&&this._coreService.triggerDataEvent(u,!0)}},0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),l=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,n=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=l+"px",this._compositionView.style.lineHeight=l+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const p=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(p.width,1)+"px",this._textarea.style.height=Math.max(p.height,1)+"px",this._textarea.style.lineHeight=p.height+"px"}v||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=x=d([S(2,_.IBufferService),S(3,_.IOptionsService),S(4,_.ICoreService),S(5,h.IRenderService)],x)},9806:(C,o)=>{function c(d,S,h){const _=h.getBoundingClientRect(),g=d.getComputedStyle(h),x=parseInt(g.getPropertyValue("padding-left")),v=parseInt(g.getPropertyValue("padding-top"));return[S.clientX-_.left-x,S.clientY-_.top-v]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(d,S,h,_,g,x,v,u,l){if(!x)return;const s=c(d,S,h);return s?(s[0]=Math.ceil((s[0]+(l?v/2:0))/v),s[1]=Math.ceil(s[1]/u),s[0]=Math.min(Math.max(s[0],1),_+(l?1:0)),s[1]=Math.min(Math.max(s[1],1),g),s):void 0}},9504:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const d=c(2584);function S(u,l,s,n){const p=u-h(u,s),w=l-h(l,s),y=Math.abs(p-w)-function(k,m,b){let T=0;const M=k-h(k,b),P=m-h(m,b);for(let A=0;A<Math.abs(M-P);A++){const N=_(k,m)==="A"?-1:1,W=b.buffer.lines.get(M+N*A);W!=null&&W.isWrapped&&T++}return T}(u,l,s);return v(y,x(_(u,l),n))}function h(u,l){let s=0,n=l.buffer.lines.get(u),p=n==null?void 0:n.isWrapped;for(;p&&u>=0&&u<l.rows;)s++,n=l.buffer.lines.get(--u),p=n==null?void 0:n.isWrapped;return s}function _(u,l){return u>l?"A":"B"}function g(u,l,s,n,p,w){let y=u,k=l,m="";for(;y!==s||k!==n;)y+=p?1:-1,p&&y>w.cols-1?(m+=w.buffer.translateBufferLineToString(k,!1,u,y),y=0,u=0,k++):!p&&y<0&&(m+=w.buffer.translateBufferLineToString(k,!1,0,u+1),y=w.cols-1,u=y,k--);return m+w.buffer.translateBufferLineToString(k,!1,u,y)}function x(u,l){const s=l?"O":"[";return d.C0.ESC+s+u}function v(u,l){u=Math.floor(u);let s="";for(let n=0;n<u;n++)s+=l;return s}o.moveToCellSequence=function(u,l,s,n){const p=s.buffer.x,w=s.buffer.y;if(!s.buffer.hasScrollback)return function(m,b,T,M,P,A){return S(b,M,P,A).length===0?"":v(g(m,b,m,b-h(b,P),!1,P).length,x("D",A))}(p,w,0,l,s,n)+S(w,l,s,n)+function(m,b,T,M,P,A){let N;N=S(b,M,P,A).length>0?M-h(M,P):b;const W=M,V=function(X,j,E,D,I,B){let K;return K=S(E,D,I,B).length>0?D-h(D,I):j,X<E&&K<=D||X>=E&&K<D?"C":"D"}(m,b,T,M,P,A);return v(g(m,N,T,W,V==="C",P).length,x(V,A))}(p,w,u,l,s,n);let y;if(w===l)return y=p>u?"D":"C",v(Math.abs(p-u),x(y,n));y=w>l?"D":"C";const k=Math.abs(w-l);return v(function(m,b){return b.cols-m}(w>l?u:p,s)+(k-1)*s.cols+1+((w>l?p:u)-1),x(y,n))}},1296:function(C,o,c){var d=this&&this.__decorate||function(A,N,W,V){var X,j=arguments.length,E=j<3?N:V===null?V=Object.getOwnPropertyDescriptor(N,W):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(A,N,W,V);else for(var D=A.length-1;D>=0;D--)(X=A[D])&&(E=(j<3?X(E):j>3?X(N,W,E):X(N,W))||E);return j>3&&E&&Object.defineProperty(N,W,E),E},S=this&&this.__param||function(A,N){return function(W,V){N(W,V,A)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const h=c(3787),_=c(2550),g=c(2223),x=c(6171),v=c(6052),u=c(4725),l=c(8055),s=c(8460),n=c(844),p=c(2585),w="xterm-dom-renderer-owner-",y="xterm-rows",k="xterm-fg-",m="xterm-bg-",b="xterm-focus",T="xterm-selection";let M=1,P=o.DomRenderer=class extends n.Disposable{constructor(A,N,W,V,X,j,E,D,I,B,K,F,Y){super(),this._terminal=A,this._document=N,this._element=W,this._screenElement=V,this._viewportElement=X,this._helperContainer=j,this._linkifier2=E,this._charSizeService=I,this._optionsService=B,this._bufferService=K,this._coreBrowserService=F,this._themeService=Y,this._terminalClass=M++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),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(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(U=>this._injectCss(U))),this._injectCss(this._themeService.colors),this._rowFactory=D.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(w+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(U=>this._handleLinkHover(U))),this.register(this._linkifier2.onHideLinkUnderline(U=>this._handleLinkLeave(U))),this.register((0,n.toDisposable)(()=>{this._element.classList.remove(w+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new _.WidthCache(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(){const A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),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/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),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(const W of this._rowElements)W.style.width=`${this.dimensions.css.canvas.width}px`,W.style.height=`${this.dimensions.css.cell.height}px`,W.style.lineHeight=`${this.dimensions.css.cell.height}px`,W.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const N=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=N,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(A){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let N=`${this._terminalSelector} .${y} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;N+=`${this._terminalSelector} .${y} .xterm-dim { color: ${l.color.multiplyOpacity(A.foreground,.5).css};}`,N+=`${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;}`;const W=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;N+=`@keyframes ${W} { 50% { border-bottom-style: hidden; }}`,N+=`@keyframes ${V} { 50% { box-shadow: none; }}`,N+=`@keyframes ${X} { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,N+=`${this._terminalSelector} .${y}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${y}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${y}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${A.cursor.css} !important; color: ${A.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,N+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(const[j,E]of A.ansi.entries())N+=`${this._terminalSelector} .${k}${j} { color: ${E.css}; }${this._terminalSelector} .${k}${j}.xterm-dim { color: ${l.color.multiplyOpacity(E,.5).css}; }${this._terminalSelector} .${m}${j} { background-color: ${E.css}; }`;N+=`${this._terminalSelector} .${k}${g.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(A.background).css}; }${this._terminalSelector} .${k}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${m}${g.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=N}_setDefaultSpacing(){const A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,N){for(let W=this._rowElements.length;W<=N;W++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>N;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,N){this._refreshRowElements(A,N),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(b),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(b),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,N,W){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,N,W),this.renderRows(0,this._bufferService.rows-1),!A||!N)return;this._selectionRenderModel.update(this._terminal,A,N,W);const V=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,j=this._selectionRenderModel.viewportCappedStartRow,E=this._selectionRenderModel.viewportCappedEndRow;if(j>=this._bufferService.rows||E<0)return;const D=this._document.createDocumentFragment();if(W){const I=A[0]>N[0];D.appendChild(this._createSelectionElement(j,I?N[0]:A[0],I?A[0]:N[0],E-j+1))}else{const I=V===j?A[0]:0,B=j===X?N[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(j,I,B));const K=E-j-1;if(D.appendChild(this._createSelectionElement(j+1,0,this._bufferService.cols,K)),j!==E){const F=X===E?N[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(E,0,F))}}this._selectionContainer.appendChild(D)}_createSelectionElement(A,N,W,V=1){const X=this._document.createElement("div"),j=N*this.dimensions.css.cell.width;let E=this.dimensions.css.cell.width*(W-N);return j+E>this.dimensions.css.canvas.width&&(E=this.dimensions.css.canvas.width-j),X.style.height=V*this.dimensions.css.cell.height+"px",X.style.top=A*this.dimensions.css.cell.height+"px",X.style.left=`${j}px`,X.style.width=`${E}px`,X}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(const A of this._rowElements)A.replaceChildren()}renderRows(A,N){const W=this._bufferService.buffer,V=W.ybase+W.y,X=Math.min(W.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,E=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let I=A;I<=N;I++){const B=I+W.ydisp,K=this._rowElements[I],F=W.lines.get(B);if(!K||!F)break;K.replaceChildren(...this._rowFactory.createRow(F,B,B===V,E,D,X,j,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${w}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,N,W,V,X,j){W<0&&(A=0),V<0&&(N=0);const E=this._bufferService.rows-1;W=Math.max(Math.min(W,E),0),V=Math.max(Math.min(V,E),0),X=Math.min(X,this._bufferService.cols);const D=this._bufferService.buffer,I=D.ybase+D.y,B=Math.min(D.x,X-1),K=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,Y=this._optionsService.rawOptions.cursorInactiveStyle;for(let U=W;U<=V;++U){const O=U+D.ydisp,R=this._rowElements[U],$=D.lines.get(O);if(!R||!$)break;R.replaceChildren(...this._rowFactory.createRow($,O,O===I,F,Y,B,K,this.dimensions.css.cell.width,this._widthCache,j?U===W?A:0:-1,j?(U===V?N:X)-1:-1))}}};o.DomRenderer=P=d([S(7,p.IInstantiationService),S(8,u.ICharSizeService),S(9,p.IOptionsService),S(10,p.IBufferService),S(11,u.ICoreBrowserService),S(12,u.IThemeService)],P)},3787:function(C,o,c){var d=this&&this.__decorate||function(y,k,m,b){var T,M=arguments.length,P=M<3?k:b===null?b=Object.getOwnPropertyDescriptor(k,m):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(y,k,m,b);else for(var A=y.length-1;A>=0;A--)(T=y[A])&&(P=(M<3?T(P):M>3?T(k,m,P):T(k,m))||P);return M>3&&P&&Object.defineProperty(k,m,P),P},S=this&&this.__param||function(y,k){return function(m,b){k(m,b,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const h=c(2223),_=c(643),g=c(511),x=c(2585),v=c(8055),u=c(4725),l=c(4269),s=c(6171),n=c(3734);let p=o.DomRendererRowFactory=class{constructor(y,k,m,b,T,M,P){this._document=y,this._characterJoinerService=k,this._optionsService=m,this._coreBrowserService=b,this._coreService=T,this._decorationService=M,this._themeService=P,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,k,m){this._selectionStart=y,this._selectionEnd=k,this._columnSelectMode=m}createRow(y,k,m,b,T,M,P,A,N,W,V){const X=[],j=this._characterJoinerService.getJoinedCharacters(k),E=this._themeService.colors;let D,I=y.getNoBgTrimmedLength();m&&I<M+1&&(I=M+1);let B=0,K="",F=0,Y=0,U=0,O=!1,R=0,$=!1,H=0;const Q=[],z=W!==-1&&V!==-1;for(let J=0;J<I;J++){y.loadCell(J,this._workCell);let ie=this._workCell.getWidth();if(ie===0)continue;let fe=!1,Ie=J,ee=this._workCell;if(j.length>0&&J===j[0][0]){fe=!0;const ce=j.shift();ee=new l.JoinedCellData(this._workCell,y.translateToString(!0,ce[0],ce[1]),ce[1]-ce[0]),Ie=ce[1]-1,ie=ee.getWidth()}const Ir=this._isCellInSelection(J,k),$s=m&&J===M,Ks=z&&J>=W&&J<=V;let Vs=!1;this._decorationService.forEachDecorationAtCell(J,k,void 0,ce=>{Vs=!0});let Ri=ee.getChars()||_.WHITESPACE_CELL_CHAR;if(Ri===" "&&(ee.isUnderline()||ee.isOverline())&&(Ri=" "),H=ie*A-N.get(Ri,ee.isBold(),ee.isItalic()),D){if(B&&(Ir&&$||!Ir&&!$&&ee.bg===F)&&(Ir&&$&&E.selectionForeground||ee.fg===Y)&&ee.extended.ext===U&&Ks===O&&H===R&&!$s&&!fe&&!Vs){ee.isInvisible()?K+=_.WHITESPACE_CELL_CHAR:K+=Ri,B++;continue}B&&(D.textContent=K),D=this._document.createElement("span"),B=0,K=""}else D=this._document.createElement("span");if(F=ee.bg,Y=ee.fg,U=ee.extended.ext,O=Ks,R=H,$=Ir,fe&&M>=J&&M<=Ie&&(M=J),!this._coreService.isCursorHidden&&$s&&this._coreService.isCursorInitialized){if(Q.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&Q.push("xterm-cursor-blink"),Q.push(b==="bar"?"xterm-cursor-bar":b==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":Q.push("xterm-cursor-outline");break;case"block":Q.push("xterm-cursor-block");break;case"bar":Q.push("xterm-cursor-bar");break;case"underline":Q.push("xterm-cursor-underline")}}if(ee.isBold()&&Q.push("xterm-bold"),ee.isItalic()&&Q.push("xterm-italic"),ee.isDim()&&Q.push("xterm-dim"),K=ee.isInvisible()?_.WHITESPACE_CELL_CHAR:ee.getChars()||_.WHITESPACE_CELL_CHAR,ee.isUnderline()&&(Q.push(`xterm-underline-${ee.extended.underlineStyle}`),K===" "&&(K=" "),!ee.isUnderlineColorDefault()))if(ee.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${n.AttributeData.toColorRGB(ee.getUnderlineColor()).join(",")})`;else{let ce=ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ee.isBold()&&ce<8&&(ce+=8),D.style.textDecorationColor=E.ansi[ce].css}ee.isOverline()&&(Q.push("xterm-overline"),K===" "&&(K=" ")),ee.isStrikethrough()&&Q.push("xterm-strikethrough"),Ks&&(D.style.textDecoration="underline");let $e=ee.getFgColor(),Mr=ee.getFgColorMode(),st=ee.getBgColor(),Pr=ee.getBgColorMode();const Gs=!!ee.isInverse();if(Gs){const ce=$e;$e=st,st=ce;const Fu=Mr;Mr=Pr,Pr=Fu}let yt,Li,Ct,Br=!1;switch(this._decorationService.forEachDecorationAtCell(J,k,void 0,ce=>{ce.options.layer!=="top"&&Br||(ce.backgroundColorRGB&&(Pr=50331648,st=ce.backgroundColorRGB.rgba>>8&16777215,yt=ce.backgroundColorRGB),ce.foregroundColorRGB&&(Mr=50331648,$e=ce.foregroundColorRGB.rgba>>8&16777215,Li=ce.foregroundColorRGB),Br=ce.options.layer==="top")}),!Br&&Ir&&(yt=this._coreBrowserService.isFocused?E.selectionBackgroundOpaque:E.selectionInactiveBackgroundOpaque,st=yt.rgba>>8&16777215,Pr=50331648,Br=!0,E.selectionForeground&&(Mr=50331648,$e=E.selectionForeground.rgba>>8&16777215,Li=E.selectionForeground)),Br&&Q.push("xterm-decoration-top"),Pr){case 16777216:case 33554432:Ct=E.ansi[st],Q.push(`xterm-bg-${st}`);break;case 50331648:Ct=v.channels.toColor(st>>16,st>>8&255,255&st),this._addStyle(D,`background-color:#${w((st>>>0).toString(16),"0",6)}`);break;default:Gs?(Ct=E.foreground,Q.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Ct=E.background}switch(yt||ee.isDim()&&(yt=v.color.multiplyOpacity(Ct,.5)),Mr){case 16777216:case 33554432:ee.isBold()&&$e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($e+=8),this._applyMinimumContrast(D,Ct,E.ansi[$e],ee,yt,void 0)||Q.push(`xterm-fg-${$e}`);break;case 50331648:const ce=v.channels.toColor($e>>16&255,$e>>8&255,255&$e);this._applyMinimumContrast(D,Ct,ce,ee,yt,Li)||this._addStyle(D,`color:#${w($e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,Ct,E.foreground,ee,yt,Li)||Gs&&Q.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}Q.length&&(D.className=Q.join(" "),Q.length=0),$s||fe||Vs?D.textContent=K:B++,H!==this.defaultSpacing&&(D.style.letterSpacing=`${H}px`),X.push(D),J=Ie}return D&&B&&(D.textContent=K),X}_applyMinimumContrast(y,k,m,b,T,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(b.getCode()))return!1;const P=this._getContrastCache(b);let A;if(T||M||(A=P.getColor(k.rgba,m.rgba)),A===void 0){const N=this._optionsService.rawOptions.minimumContrastRatio/(b.isDim()?2:1);A=v.color.ensureContrastRatio(T||k,M||m,N),P.setColor((T||k).rgba,(M||m).rgba,A??null)}return!!A&&(this._addStyle(y,`color:${A.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,k){y.setAttribute("style",`${y.getAttribute("style")||""}${k};`)}_isCellInSelection(y,k){const m=this._selectionStart,b=this._selectionEnd;return!(!m||!b)&&(this._columnSelectMode?m[0]<=b[0]?y>=m[0]&&k>=m[1]&&y<b[0]&&k<=b[1]:y<m[0]&&k>=m[1]&&y>=b[0]&&k<=b[1]:k>m[1]&&k<b[1]||m[1]===b[1]&&k===m[1]&&y>=m[0]&&y<b[0]||m[1]<b[1]&&k===b[1]&&y<b[0]||m[1]<b[1]&&k===m[1]&&y>=m[0])}};function w(y,k,m){for(;y.length<m;)y=k+y;return y}o.DomRendererRowFactory=p=d([S(1,u.ICharacterJoinerService),S(2,x.IOptionsService),S(3,u.ICoreBrowserService),S(4,x.ICoreService),S(5,x.IDecorationService),S(6,u.IThemeService)],p)},2550:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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";const S=c.createElement("span");S.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const g=c.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[S,h,_,g],this._container.appendChild(S),this._container.appendChild(h),this._container.appendChild(_),this._container.appendChild(g),d.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(c,d,S,h){c===this._font&&d===this._fontSize&&S===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=d,this._weight=S,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${S}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${S}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,d,S){let h=0;if(!d&&!S&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const x=this._measure(c,0);return x>0&&(this._flat[h]=x),x}let _=c;d&&(_+="B"),S&&(_+="I");let g=this._holey.get(_);if(g===void 0){let x=0;d&&(x|=1),S&&(x|=2),g=this._measure(c,x),g>0&&this._holey.set(_,g)}return g}_measure(c,d){const S=this._measureElements[d];return S.textContent=c.repeat(32),S.offsetWidth/32}}},2223:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const d=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(C,o)=>{function c(S){return 57508<=S&&S<=57558}function d(S){return S>=128512&&S<=128591||S>=127744&&S<=128511||S>=128640&&S<=128767||S>=9728&&S<=9983||S>=9984&&S<=10175||S>=65024&&S<=65039||S>=129280&&S<=129535||S>=127462&&S<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(S){if(!S)throw new Error("value must not be falsy");return S},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(S){return 57520<=S&&S<=57527},o.isEmoji=d,o.allowRescaling=function(S,h,_,g){return h===1&&_>Math.ceil(1.5*g)&&S!==void 0&&S>255&&!d(S)&&!c(S)&&!function(x){return 57344<=x&&x<=63743}(S)},o.treatGlyphAsBackgroundColor=function(S){return c(S)||function(h){return 9472<=h&&h<=9631}(S)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(S,h,_=0){return(S-(2*Math.round(h)-_))%(2*Math.round(h))}},6052:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{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(S,h,_,g=!1){if(this.selectionStart=h,this.selectionEnd=_,!h||!_||h[0]===_[0]&&h[1]===_[1])return void this.clear();const x=S.buffers.active.ydisp,v=h[1]-x,u=_[1]-x,l=Math.max(v,0),s=Math.min(u,S.rows-1);l>=S.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=v,this.viewportEndRow=u,this.viewportCappedStartRow=l,this.viewportCappedEndRow=s,this.startCol=h[0],this.endCol=_[0])}isCellSelected(S,h,_){return!!this.hasSelection&&(_-=S.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&_>=this.viewportCappedStartRow&&h<this.endCol&&_<=this.viewportCappedEndRow:h<this.startCol&&_>=this.viewportCappedStartRow&&h>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,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.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()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,d=this.selectionEnd;return!(!c||!d)&&(c[1]>d[1]||c[1]===d[1]&&c[0]>d[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(C,o,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,m=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(m=(k<3?y(m):k>3?y(n,p,m):y(n,p))||m);return k>3&&m&&Object.defineProperty(n,p,m),m},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const h=c(2585),_=c(8460),g=c(844);let x=o.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,n,p){super(),this._optionsService=p,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new l(this._optionsService))}catch{this._measureStrategy=this.register(new u(s,n,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};o.CharSizeService=x=d([S(2,h.IOptionsService)],x);class v extends g.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(n,p){n!==void 0&&n>0&&p!==void 0&&p>0&&(this._result.width=n,this._result.height=p)}}class u extends v{constructor(n,p,w){super(),this._document=n,this._parentElement=p,this._optionsService=w,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}}class l extends v{constructor(n){super(),this._optionsService=n,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const p=this._ctx.measureText("W");if(!("width"in p&&"fontBoundingBoxAscent"in p&&"fontBoundingBoxDescent"in p))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const n=this._ctx.measureText("W");return this._validateAndSet(n.width,n.fontBoundingBoxAscent+n.fontBoundingBoxDescent),this._result}}},4269:function(C,o,c){var d=this&&this.__decorate||function(l,s,n,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(l,s,n,p);else for(var m=l.length-1;m>=0;m--)(w=l[m])&&(k=(y<3?w(k):y>3?w(s,n,k):w(s,n))||k);return y>3&&k&&Object.defineProperty(s,n,k),k},S=this&&this.__param||function(l,s){return function(n,p){s(n,p,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const h=c(3734),_=c(643),g=c(511),x=c(2585);class v extends h.AttributeData{constructor(s,n,p){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=n,this._width=p}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=v;let u=o.CharacterJoinerService=class ju{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(s){const n={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(n),n.id}deregister(s){for(let n=0;n<this._characterJoiners.length;n++)if(this._characterJoiners[n].id===s)return this._characterJoiners.splice(n,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const n=this._bufferService.buffer.lines.get(s);if(!n||n.length===0)return[];const p=[],w=n.translateToString(!0);let y=0,k=0,m=0,b=n.getFg(0),T=n.getBg(0);for(let M=0;M<n.getTrimmedLength();M++)if(n.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==b||this._workCell.bg!==T){if(M-y>1){const P=this._getJoinedRanges(w,m,k,n,y);for(let A=0;A<P.length;A++)p.push(P[A])}y=M,m=k,b=this._workCell.fg,T=this._workCell.bg}k+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const M=this._getJoinedRanges(w,m,k,n,y);for(let P=0;P<M.length;P++)p.push(M[P])}return p}_getJoinedRanges(s,n,p,w,y){const k=s.substring(n,p);let m=[];try{m=this._characterJoiners[0].handler(k)}catch(b){console.error(b)}for(let b=1;b<this._characterJoiners.length;b++)try{const T=this._characterJoiners[b].handler(k);for(let M=0;M<T.length;M++)ju._mergeRanges(m,T[M])}catch(T){console.error(T)}return this._stringRangesToCellRanges(m,w,y),m}_stringRangesToCellRanges(s,n,p){let w=0,y=!1,k=0,m=s[w];if(m){for(let b=p;b<this._bufferService.cols;b++){const T=n.getWidth(b),M=n.getString(b).length||_.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!y&&m[0]<=k&&(m[0]=b,y=!0),m[1]<=k){if(m[1]=b,m=s[++w],!m)break;m[0]<=k?(m[0]=b,y=!0):y=!1}k+=M}}m&&(m[1]=this._bufferService.cols)}}static _mergeRanges(s,n){let p=!1;for(let w=0;w<s.length;w++){const y=s[w];if(p){if(n[1]<=y[0])return s[w-1][1]=n[1],s;if(n[1]<=y[1])return s[w-1][1]=Math.max(n[1],y[1]),s.splice(w,1),s;s.splice(w,1),w--}else{if(n[1]<=y[0])return s.splice(w,0,n),s;if(n[1]<=y[1])return y[0]=Math.min(n[0],y[0]),s;n[0]<y[1]&&(y[0]=Math.min(n[0],y[0]),p=!0)}}return p?s[s.length-1][1]=n[1]:s.push(n),s}};o.CharacterJoinerService=u=d([S(0,x.IBufferService)],u)},5114:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const d=c(844),S=c(8460),h=c(3656);class _ extends d.Disposable{constructor(v,u,l){super(),this._textarea=v,this._window=u,this.mainDocument=l,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new S.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new S.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this.register((0,S.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(v){this._window!==v&&(this._window=v,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}}o.CoreBrowserService=_;class g extends d.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new S.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)(()=>this.clearListener()))}setWindow(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.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)}}},779:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const d=c(844);class S extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const g=this.linkProviders.indexOf(_);g!==-1&&this.linkProviders.splice(g,1)}}}}o.LinkProviderService=S},8934:function(C,o,c){var d=this&&this.__decorate||function(x,v,u,l){var s,n=arguments.length,p=n<3?v:l===null?l=Object.getOwnPropertyDescriptor(v,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(x,v,u,l);else for(var w=x.length-1;w>=0;w--)(s=x[w])&&(p=(n<3?s(p):n>3?s(v,u,p):s(v,u))||p);return n>3&&p&&Object.defineProperty(v,u,p),p},S=this&&this.__param||function(x,v){return function(u,l){v(u,l,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const h=c(4725),_=c(9806);let g=o.MouseService=class{constructor(x,v){this._renderService=x,this._charSizeService=v}getCoords(x,v,u,l,s){return(0,_.getCoords)(window,x,v,u,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(x,v){const u=(0,_.getCoordsRelativeToElement)(window,x,v);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};o.MouseService=g=d([S(0,h.IRenderService),S(1,h.ICharSizeService)],g)},3230:function(C,o,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,m=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(m=(k<3?y(m):k>3?y(n,p,m):y(n,p))||m);return k>3&&m&&Object.defineProperty(n,p,m),m},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const h=c(6193),_=c(4725),g=c(8460),x=c(844),v=c(7226),u=c(2585);let l=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,n,p,w,y,k,m,b){super(),this._rowCount=s,this._charSizeService=w,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),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 g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer((T,M)=>this._renderRows(T,M),m),this.register(this._renderDebouncer),this.register(m.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(k.onResize(()=>this._fullRefresh())),this.register(k.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()})),this.register(p.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(y.onDecorationRegistered(()=>this._fullRefresh())),this.register(y.onDecorationRemoved(()=>this._fullRefresh())),this.register(p.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(k.cols,k.rows),this._fullRefresh()})),this.register(p.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(k.buffer.y,k.buffer.y,!0))),this.register(b.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(m.window,n),this.register(m.onWindowChange(T=>this._registerIntersectionObserver(T,n)))}_registerIntersectionObserver(s,n){if("IntersectionObserver"in s){const p=new s.IntersectionObserver(w=>this._handleIntersectionChange(w[w.length-1]),{threshold:0});p.observe(n),this._observerDisposable.value=(0,x.toDisposable)(()=>p.disconnect())}}_handleIntersectionChange(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.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(s,n,p=!1){this._isPaused?this._needsFullRefresh=!0:(p||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,n,this._rowCount))}_renderRows(s,n){this._renderer.value&&(s=Math.min(s,this._rowCount-1),n=Math.min(n,this._rowCount-1),this._renderer.value.renderRows(s,n),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:n}),this._onRender.fire({start:s,end:n}),this._isNextRenderRedrawOnly=!0)}resize(s,n){this._rowCount=n,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(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw(n=>this.refreshRows(n.start,n.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(s){return this._renderDebouncer.addRefreshCallback(s)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var s,n;this._renderer.value&&((n=(s=this._renderer.value).clearTextureAtlas)==null||n.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,n){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var p;return(p=this._renderer.value)==null?void 0:p.handleResize(s,n)}):this._renderer.value.handleResize(s,n),this._fullRefresh())}handleCharSizeChanged(){var s;(s=this._renderer.value)==null||s.handleCharSizeChanged()}handleBlur(){var s;(s=this._renderer.value)==null||s.handleBlur()}handleFocus(){var s;(s=this._renderer.value)==null||s.handleFocus()}handleSelectionChanged(s,n,p){var w;this._selectionState.start=s,this._selectionState.end=n,this._selectionState.columnSelectMode=p,(w=this._renderer.value)==null||w.handleSelectionChanged(s,n,p)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};o.RenderService=l=d([S(2,u.IOptionsService),S(3,_.ICharSizeService),S(4,u.IDecorationService),S(5,u.IBufferService),S(6,_.ICoreBrowserService),S(7,_.IThemeService)],l)},9312:function(C,o,c){var d=this&&this.__decorate||function(m,b,T,M){var P,A=arguments.length,N=A<3?b:M===null?M=Object.getOwnPropertyDescriptor(b,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(m,b,T,M);else for(var W=m.length-1;W>=0;W--)(P=m[W])&&(N=(A<3?P(N):A>3?P(b,T,N):P(b,T))||N);return A>3&&N&&Object.defineProperty(b,T,N),N},S=this&&this.__param||function(m,b){return function(T,M){b(T,M,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const h=c(9806),_=c(9504),g=c(456),x=c(4725),v=c(8460),u=c(844),l=c(6114),s=c(4841),n=c(511),p=c(2585),w=" ",y=new RegExp(w,"g");let k=o.SelectionService=class extends u.Disposable{constructor(m,b,T,M,P,A,N,W,V){super(),this._element=m,this._screenElement=b,this._linkifier=T,this._bufferService=M,this._coreService=P,this._mouseService=A,this._optionsService=N,this._renderService=W,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new n.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(X=>this._handleTrim(X)),this.register(this._bufferService.buffers.onBufferActivate(X=>this._handleBufferActivate(X))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)(()=>{this._removeMouseDownListeners()}))}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(){const m=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!(!m||!b||m[0]===b[0]&&m[1]===b[1])}get selectionText(){const m=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;if(!m||!b)return"";const T=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(m[0]===b[0])return"";const P=m[0]<b[0]?m[0]:b[0],A=m[0]<b[0]?b[0]:m[0];for(let N=m[1];N<=b[1];N++){const W=T.translateBufferLineToString(N,!0,P,A);M.push(W)}}else{const P=m[1]===b[1]?b[0]:void 0;M.push(T.translateBufferLineToString(m[1],!0,m[0],P));for(let A=m[1]+1;A<=b[1]-1;A++){const N=T.lines.get(A),W=T.translateBufferLineToString(A,!0);N!=null&&N.isWrapped?M[M.length-1]+=W:M.push(W)}if(m[1]!==b[1]){const A=T.lines.get(b[1]),N=T.translateBufferLineToString(b[1],!0,0,b[0]);A&&A.isWrapped?M[M.length-1]+=N:M.push(N)}}return M.map(P=>P.replace(y," ")).join(l.isWindows?`\r
|
|
45
45
|
`:`
|
|
46
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(m){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),l.isLinux&&m&&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(m){const b=this._getMouseBufferCoords(m),T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(T&&I&&b)&&this._areCoordsInSelection(b,T,I)}isCellInSelection(m,b){const T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!T||!I)&&this._areCoordsInSelection([m,b],T,I)}_areCoordsInSelection(m,b,T){return m[1]>b[1]&&m[1]<T[1]||b[1]===T[1]&&m[1]===b[1]&&m[0]>=b[0]&&m[0]<T[0]||b[1]<T[1]&&m[1]===T[1]&&m[0]<T[0]||b[1]<T[1]&&m[1]===b[1]&&m[0]>=b[0]}_selectWordAtCursor(m,b){var P,A;const T=(A=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:A.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(m);return!!I&&(this._selectWordAt(I,b),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(m,b){this._model.clearSelection(),m=Math.max(m,0),b=Math.min(b,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,b],this.refresh(),this._onSelectionChange.fire()}_handleTrim(m){this._model.handleTrim(m)&&this.refresh()}_getMouseBufferCoords(m){const b=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(b)return b[0]--,b[1]--,b[1]+=this._bufferService.buffer.ydisp,b}_getMouseEventScrollAmount(m){let b=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,m,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return b>=0&&b<=T?0:(b>T&&(b-=T),b=Math.min(Math.max(b,-50),50),b/=50,b/Math.abs(b)+Math.round(14*b))}shouldForceSelection(m){return l.isMac?m.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:m.shiftKey}handleMouseDown(m){if(this._mouseDownTimeStamp=m.timeStamp,(m.button!==2||!this.hasSelection)&&m.button===0){if(!this._enabled){if(!this.shouldForceSelection(m))return;m.stopPropagation()}m.preventDefault(),this._dragScrollAmount=0,this._enabled&&m.shiftKey?this._handleIncrementalClick(m):m.detail===1?this._handleSingleClick(m):m.detail===2?this._handleDoubleClick(m):m.detail===3&&this._handleTripleClick(m),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(),50)}_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(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))}_handleSingleClick(m){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(m)?3:0,this._model.selectionStart=this._getMouseBufferCoords(m),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const b=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);b&&b.length!==this._model.selectionStart[0]&&b.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(m){this._selectWordAtCursor(m,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(m){const b=this._getMouseBufferCoords(m);b&&(this._activeSelectionMode=2,this._selectLineAt(b[1]))}shouldColumnSelect(m){return m.altKey&&!(l.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(m){if(m.stopImmediatePropagation(),!this._model.selectionStart)return;const b=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(m),!this._model.selectionEnd)return void this.refresh(!0);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(m),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const I=T.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}b&&b[0]===this._model.selectionEnd[0]&&b[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});const m=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(m.ydisp+this._bufferService.rows,m.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=m.ydisp),this.refresh()}}_handleMouseUp(m){const b=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&b<500&&m.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const I=(0,_.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const m=this._model.finalSelectionStart,b=this._model.finalSelectionEnd,T=!(!m||!b||m[0]===b[0]&&m[1]===b[1]);T?m&&b&&(this._oldSelectionStart&&this._oldSelectionEnd&&m[0]===this._oldSelectionStart[0]&&m[1]===this._oldSelectionStart[1]&&b[0]===this._oldSelectionEnd[0]&&b[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(m,b,T)):this._oldHasSelection&&this._fireOnSelectionChange(m,b,T)}_fireOnSelectionChange(m,b,T){this._oldSelectionStart=m,this._oldSelectionEnd=b,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(m){this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim(b=>this._handleTrim(b))}_convertViewportColToCharacterIndex(m,b){let T=b;for(let I=0;b>=I;I++){const P=m.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:P>1&&b!==I&&(T+=P-1)}return T}setSelection(m,b,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,b],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(m){this._isClickInSelection(m)||(this._selectWordAtCursor(m,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(m,b,T=!0,I=!0){if(m[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,A=P.lines.get(m[1]);if(!A)return;const N=P.translateBufferLineToString(m[1],!1);let W=this._convertViewportColToCharacterIndex(A,m[0]),V=W;const X=m[0]-W;let j=0,E=0,D=0,M=0;if(N.charAt(W)===" "){for(;W>0&&N.charAt(W-1)===" ";)W--;for(;V<N.length&&N.charAt(V+1)===" ";)V++}else{let F=m[0],Y=m[0];A.getWidth(F)===0&&(j++,F--),A.getWidth(Y)===2&&(E++,Y++);const U=A.getString(Y).length;for(U>1&&(M+=U-1,V+=U-1);F>0&&W>0&&!this._isCharWordSeparator(A.loadCell(F-1,this._workCell));){A.loadCell(F-1,this._workCell);const O=this._workCell.getChars().length;this._workCell.getWidth()===0?(j++,F--):O>1&&(D+=O-1,W-=O-1),W--,F--}for(;Y<A.length&&V+1<N.length&&!this._isCharWordSeparator(A.loadCell(Y+1,this._workCell));){A.loadCell(Y+1,this._workCell);const O=this._workCell.getChars().length;this._workCell.getWidth()===2?(E++,Y++):O>1&&(M+=O-1,V+=O-1),V++,Y++}}V++;let B=W+X-j+D,K=Math.min(this._bufferService.cols,V-W+j+E-D-M);if(b||N.slice(W,V).trim()!==""){if(T&&B===0&&A.getCodePoint(0)!==32){const F=P.lines.get(m[1]-1);if(F&&A.isWrapped&&F.getCodePoint(this._bufferService.cols-1)!==32){const Y=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(Y){const U=this._bufferService.cols-Y.start;B-=U,K+=U}}}if(I&&B+K===this._bufferService.cols&&A.getCodePoint(this._bufferService.cols-1)!==32){const F=P.lines.get(m[1]+1);if(F!=null&&F.isWrapped&&F.getCodePoint(0)!==32){const Y=this._getWordAt([0,m[1]+1],!1,!1,!0);Y&&(K+=Y.length)}}return{start:B,length:K}}}_selectWordAt(m,b){const T=this._getWordAt(m,b);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[T.start,m[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(m){const b=this._getWordAt(m,!0);if(b){let T=m[1];for(;b.start<0;)b.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;b.start+b.length>this._bufferService.cols;)b.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,T]}}_isCharWordSeparator(m){return m.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(m.getChars())>=0}_selectLineAt(m){const b=this._bufferService.buffer.getWrappedRangeForLine(m),T={start:{x:0,y:b.first},end:{x:this._bufferService.cols-1,y:b.last}};this._model.selectionStart=[0,b.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols)}};o.SelectionService=k=d([S(3,p.IBufferService),S(4,p.ICoreService),S(5,x.IMouseService),S(6,p.IOptionsService),S(7,x.IRenderService),S(8,x.ICoreBrowserService)],k)},4725:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const d=c(8343);o.ICharSizeService=(0,d.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),o.IMouseService=(0,d.createDecorator)("MouseService"),o.IRenderService=(0,d.createDecorator)("RenderService"),o.ISelectionService=(0,d.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,d.createDecorator)("ThemeService"),o.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(C,o,c){var d=this&&this.__decorate||function(k,m,b,T){var I,P=arguments.length,A=P<3?m:T===null?T=Object.getOwnPropertyDescriptor(m,b):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(k,m,b,T);else for(var N=k.length-1;N>=0;N--)(I=k[N])&&(A=(P<3?I(A):P>3?I(m,b,A):I(m,b))||A);return P>3&&A&&Object.defineProperty(m,b,A),A},S=this&&this.__param||function(k,m){return function(b,T){m(b,T,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),_=c(8055),g=c(8460),x=c(844),v=c(2585),u=_.css.toColor("#ffffff"),l=_.css.toColor("#000000"),s=_.css.toColor("#ffffff"),n=_.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],m=[0,95,135,175,215,255];for(let b=0;b<216;b++){const T=m[b/36%6|0],I=m[b/6%6|0],P=m[b%6];k.push({css:_.channels.toCss(T,I,P),rgba:_.channels.toRgba(T,I,P)})}for(let b=0;b<24;b++){const T=8+10*b;k.push({css:_.channels.toCss(T,T,T),rgba:_.channels.toRgba(T,T,T)})}return k})());let w=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:l,cursor:s,cursorAccent:n,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:_.color.blend(l,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:_.color.blend(l,p),ansi:o.DEFAULT_ANSI_COLORS.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)))}_setTheme(k={}){const m=this._colors;if(m.foreground=y(k.foreground,u),m.background=y(k.background,l),m.cursor=y(k.cursor,s),m.cursorAccent=y(k.cursorAccent,n),m.selectionBackgroundTransparent=y(k.selectionBackground,p),m.selectionBackgroundOpaque=_.color.blend(m.background,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundTransparent=y(k.selectionInactiveBackground,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundOpaque=_.color.blend(m.background,m.selectionInactiveBackgroundTransparent),m.selectionForeground=k.selectionForeground?y(k.selectionForeground,_.NULL_COLOR):void 0,m.selectionForeground===_.NULL_COLOR&&(m.selectionForeground=void 0),_.color.isOpaque(m.selectionBackgroundTransparent)&&(m.selectionBackgroundTransparent=_.color.opacity(m.selectionBackgroundTransparent,.3)),_.color.isOpaque(m.selectionInactiveBackgroundTransparent)&&(m.selectionInactiveBackgroundTransparent=_.color.opacity(m.selectionInactiveBackgroundTransparent,.3)),m.ansi=o.DEFAULT_ANSI_COLORS.slice(),m.ansi[0]=y(k.black,o.DEFAULT_ANSI_COLORS[0]),m.ansi[1]=y(k.red,o.DEFAULT_ANSI_COLORS[1]),m.ansi[2]=y(k.green,o.DEFAULT_ANSI_COLORS[2]),m.ansi[3]=y(k.yellow,o.DEFAULT_ANSI_COLORS[3]),m.ansi[4]=y(k.blue,o.DEFAULT_ANSI_COLORS[4]),m.ansi[5]=y(k.magenta,o.DEFAULT_ANSI_COLORS[5]),m.ansi[6]=y(k.cyan,o.DEFAULT_ANSI_COLORS[6]),m.ansi[7]=y(k.white,o.DEFAULT_ANSI_COLORS[7]),m.ansi[8]=y(k.brightBlack,o.DEFAULT_ANSI_COLORS[8]),m.ansi[9]=y(k.brightRed,o.DEFAULT_ANSI_COLORS[9]),m.ansi[10]=y(k.brightGreen,o.DEFAULT_ANSI_COLORS[10]),m.ansi[11]=y(k.brightYellow,o.DEFAULT_ANSI_COLORS[11]),m.ansi[12]=y(k.brightBlue,o.DEFAULT_ANSI_COLORS[12]),m.ansi[13]=y(k.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),m.ansi[14]=y(k.brightCyan,o.DEFAULT_ANSI_COLORS[14]),m.ansi[15]=y(k.brightWhite,o.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const b=Math.min(m.ansi.length-16,k.extendedAnsi.length);for(let T=0;T<b;T++)m.ansi[T+16]=y(k.extendedAnsi[T],o.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){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[k]=this._restoreColors.ansi[k]}else for(let m=0;m<this._restoreColors.ansi.length;++m)this._colors.ansi[m]=this._restoreColors.ansi[m]}modifyColors(k){k(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()}}};function y(k,m){if(k!==void 0)try{return _.css.toColor(k)}catch{}return m}o.ThemeService=w=d([S(0,v.IOptionsService)],w)},6349:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const d=c(8460),S=c(844);class h extends S.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(g){if(this._maxLength===g)return;const x=new Array(g);for(let v=0;v<Math.min(g,this.length);v++)x[v]=this._array[this._getCyclicIndex(v)];this._array=x,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let x=this._length;x<g;x++)this._array[x]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,x){this._array[this._getCyclicIndex(g)]=x}push(g){this._array[this._getCyclicIndex(this._length)]=g,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(g,x,...v){if(x){for(let u=g;u<this._length-x;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+x)];this._length-=x,this.onDeleteEmitter.fire({index:g,amount:x})}for(let u=this._length-1;u>=g;u--)this._array[this._getCyclicIndex(u+v.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<v.length;u++)this._array[this._getCyclicIndex(g+u)]=v[u];if(v.length&&this.onInsertEmitter.fire({index:g,amount:v.length}),this._length+v.length>this._maxLength){const u=this._length+v.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=v.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,x,v){if(!(x<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let l=x-1;l>=0;l--)this.set(g+l+v,this.get(g+l));const u=g+x+v-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<x;u++)this.set(g+u+v,this.get(g+u))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}o.CircularList=h},1439:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(d,S=5){if(typeof d!="object")return d;const h=Array.isArray(d)?[]:{};for(const _ in d)h[_]=S<=1?d[_]:d[_]&&c(d[_],S-1);return h}},8055:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,d=0,S=0,h=0;var _,g,x,v,u;function l(n){const p=n.toString(16);return p.length<2?"0"+p:p}function s(n,p){return n<p?(p+.05)/(n+.05):(n+.05)/(p+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(n){n.toCss=function(p,w,y,k){return k!==void 0?`#${l(p)}${l(w)}${l(y)}${l(k)}`:`#${l(p)}${l(w)}${l(y)}`},n.toRgba=function(p,w,y,k=255){return(p<<24|w<<16|y<<8|k)>>>0},n.toColor=function(p,w,y,k){return{css:n.toCss(p,w,y,k),rgba:n.toRgba(p,w,y,k)}}}(_||(o.channels=_={})),function(n){function p(w,y){return h=Math.round(255*y),[c,d,S]=u.toChannels(w.rgba),{css:_.toCss(c,d,S,h),rgba:_.toRgba(c,d,S,h)}}n.blend=function(w,y){if(h=(255&y.rgba)/255,h===1)return{css:y.css,rgba:y.rgba};const k=y.rgba>>24&255,m=y.rgba>>16&255,b=y.rgba>>8&255,T=w.rgba>>24&255,I=w.rgba>>16&255,P=w.rgba>>8&255;return c=T+Math.round((k-T)*h),d=I+Math.round((m-I)*h),S=P+Math.round((b-P)*h),{css:_.toCss(c,d,S),rgba:_.toRgba(c,d,S)}},n.isOpaque=function(w){return(255&w.rgba)==255},n.ensureContrastRatio=function(w,y,k){const m=u.ensureContrastRatio(w.rgba,y.rgba,k);if(m)return _.toColor(m>>24&255,m>>16&255,m>>8&255)},n.opaque=function(w){const y=(255|w.rgba)>>>0;return[c,d,S]=u.toChannels(y),{css:_.toCss(c,d,S),rgba:y}},n.opacity=p,n.multiplyOpacity=function(w,y){return h=255&w.rgba,p(w,h*y/255)},n.toColorRGB=function(w){return[w.rgba>>24&255,w.rgba>>16&255,w.rgba>>8&255]}}(g||(o.color=g={})),function(n){let p,w;try{const y=document.createElement("canvas");y.width=1,y.height=1;const k=y.getContext("2d",{willReadFrequently:!0});k&&(p=k,p.globalCompositeOperation="copy",w=p.createLinearGradient(0,0,1,1))}catch{}n.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return c=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),S=parseInt(y.slice(3,4).repeat(2),16),_.toColor(c,d,S);case 5:return c=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),S=parseInt(y.slice(3,4).repeat(2),16),h=parseInt(y.slice(4,5).repeat(2),16),_.toColor(c,d,S,h);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const k=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return c=parseInt(k[1]),d=parseInt(k[2]),S=parseInt(k[3]),h=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),_.toColor(c,d,S,h);if(!p||!w)throw new Error("css.toColor: Unsupported css format");if(p.fillStyle=w,p.fillStyle=y,typeof p.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(p.fillRect(0,0,1,1),[c,d,S,h]=p.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,d,S,h),css:y}}}(x||(o.css=x={})),function(n){function p(w,y,k){const m=w/255,b=y/255,T=k/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}n.relativeLuminance=function(w){return p(w>>16&255,w>>8&255,255&w)},n.relativeLuminance2=p}(v||(o.rgb=v={})),function(n){function p(y,k,m){const b=y>>24&255,T=y>>16&255,I=y>>8&255;let P=k>>24&255,A=k>>16&255,N=k>>8&255,W=s(v.relativeLuminance2(P,A,N),v.relativeLuminance2(b,T,I));for(;W<m&&(P>0||A>0||N>0);)P-=Math.max(0,Math.ceil(.1*P)),A-=Math.max(0,Math.ceil(.1*A)),N-=Math.max(0,Math.ceil(.1*N)),W=s(v.relativeLuminance2(P,A,N),v.relativeLuminance2(b,T,I));return(P<<24|A<<16|N<<8|255)>>>0}function w(y,k,m){const b=y>>24&255,T=y>>16&255,I=y>>8&255;let P=k>>24&255,A=k>>16&255,N=k>>8&255,W=s(v.relativeLuminance2(P,A,N),v.relativeLuminance2(b,T,I));for(;W<m&&(P<255||A<255||N<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),A=Math.min(255,A+Math.ceil(.1*(255-A))),N=Math.min(255,N+Math.ceil(.1*(255-N))),W=s(v.relativeLuminance2(P,A,N),v.relativeLuminance2(b,T,I));return(P<<24|A<<16|N<<8|255)>>>0}n.blend=function(y,k){if(h=(255&k)/255,h===1)return k;const m=k>>24&255,b=k>>16&255,T=k>>8&255,I=y>>24&255,P=y>>16&255,A=y>>8&255;return c=I+Math.round((m-I)*h),d=P+Math.round((b-P)*h),S=A+Math.round((T-A)*h),_.toRgba(c,d,S)},n.ensureContrastRatio=function(y,k,m){const b=v.relativeLuminance(y>>8),T=v.relativeLuminance(k>>8);if(s(b,T)<m){if(T<b){const A=p(y,k,m),N=s(b,v.relativeLuminance(A>>8));if(N<m){const W=w(y,k,m);return N>s(b,v.relativeLuminance(W>>8))?A:W}return A}const I=w(y,k,m),P=s(b,v.relativeLuminance(I>>8));if(P<m){const A=p(y,k,m);return P>s(b,v.relativeLuminance(A>>8))?I:A}return I}},n.reduceLuminance=p,n.increaseLuminance=w,n.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}}(u||(o.rgba=u={})),o.toPaddedHex=l,o.contrastRatio=s},8969:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const d=c(844),S=c(2585),h=c(4348),_=c(7866),g=c(744),x=c(7302),v=c(6975),u=c(8460),l=c(1753),s=c(1480),n=c(7994),p=c(9282),w=c(5435),y=c(5981),k=c(2660);let m=!1;class b extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event(I=>{var P;(P=this._onScrollApi)==null||P.fire(I.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(I){for(const P in I)this.optionsService.options[P]=I[P]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new x.OptionsService(I)),this._instantiationService.setService(S.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(S.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(S.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(S.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(l.CoreMouseService)),this._instantiationService.setService(S.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(S.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(n.CharsetService),this._instantiationService.setService(S.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(S.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new w.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new y.WriteBuffer((P,A)=>this._inputHandler.parse(P,A))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,P){this._writeBuffer.write(I,P)}writeSync(I,P){this._logService.logLevel<=S.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(I,P)}input(I,P=!0){this.coreService.triggerDataEvent(I,P)}resize(I,P){isNaN(I)||isNaN(P)||(I=Math.max(I,g.MINIMUM_COLS),P=Math.max(P,g.MINIMUM_ROWS),this._bufferService.resize(I,P))}scroll(I,P=!1){this._bufferService.scroll(I,P)}scrollLines(I,P,A){this._bufferService.scrollLines(I,P,A)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const P=I-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(I,P){return this._inputHandler.registerEscHandler(I,P)}registerDcsHandler(I,P){return this._inputHandler.registerDcsHandler(I,P)}registerCsiHandler(I,P){return this._inputHandler.registerCsiHandler(I,P)}registerOscHandler(I,P){return this._inputHandler.registerOscHandler(I,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?I=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const P of I)P.dispose()})}}}o.CoreTerminal=b},8460:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===c)return void this._listeners.splice(d,1)}}})),this._event}fire(c,d){const S=[];for(let h=0;h<this._listeners.length;h++)S.push(this._listeners[h]);for(let h=0;h<S.length;h++)S[h].call(void 0,c,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,d){return c(S=>d.fire(S))},o.runAndSubscribe=function(c,d){return d(void 0),c(S=>d(S))}},5435:function(C,o,c){var d=this&&this.__decorate||function(j,E,D,M){var B,K=arguments.length,F=K<3?E:M===null?M=Object.getOwnPropertyDescriptor(E,D):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(j,E,D,M);else for(var Y=j.length-1;Y>=0;Y--)(B=j[Y])&&(F=(K<3?B(F):K>3?B(E,D,F):B(E,D))||F);return K>3&&F&&Object.defineProperty(E,D,F),F},S=this&&this.__param||function(j,E){return function(D,M){E(D,M,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const h=c(2584),_=c(7116),g=c(2015),x=c(844),v=c(482),u=c(8437),l=c(8460),s=c(643),n=c(511),p=c(3734),w=c(2585),y=c(1480),k=c(6242),m=c(6351),b=c(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function P(j,E){if(j>24)return E.setWinLines||!1;switch(j){case 1:return!!E.restoreWin;case 2:return!!E.minimizeWin;case 3:return!!E.setWinPosition;case 4:return!!E.setWinSizePixels;case 5:return!!E.raiseWin;case 6:return!!E.lowerWin;case 7:return!!E.refreshWin;case 8:return!!E.setWinSizeChars;case 9:return!!E.maximizeWin;case 10:return!!E.fullscreenWin;case 11:return!!E.getWinState;case 13:return!!E.getWinPosition;case 14:return!!E.getWinSizePixels;case 15:return!!E.getScreenSizePixels;case 16:return!!E.getCellSizePixels;case 18:return!!E.getWinSizeChars;case 19:return!!E.getScreenSizeChars;case 20:return!!E.getIconTitle;case 21:return!!E.getWinTitle;case 22:return!!E.pushTitle;case 23:return!!E.popTitle;case 24:return!!E.setWinLines}return!1}var A;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(o.WindowsOptionsReportType=A={}));let N=0;class W extends x.Disposable{getAttrData(){return this._curAttrData}constructor(E,D,M,B,K,F,Y,U,O=new g.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=D,this._coreService=M,this._logService=B,this._optionsService=K,this._oscLinkService=F,this._coreMouseService=Y,this._unicodeService=U,this._parser=O,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new n.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new l.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new l.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new l.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new l.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new l.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new l.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new l.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new l.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new l.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new l.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new l.EventEmitter),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 V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(R=>this._activeBuffer=R.activeBuffer)),this._parser.setCsiHandlerFallback((R,$)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(R),params:$.toArray()})}),this._parser.setEscHandlerFallback(R=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(R)})}),this._parser.setExecuteHandlerFallback(R=>{this._logService.debug("Unknown EXECUTE code: ",{code:R})}),this._parser.setOscHandlerFallback((R,$,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:R,action:$,data:H})}),this._parser.setDcsHandlerFallback((R,$,H)=>{$==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(R),action:$,payload:H})}),this._parser.setPrintHandler((R,$,H)=>this.print(R,$,H)),this._parser.registerCsiHandler({final:"@"},R=>this.insertChars(R)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},R=>this.scrollLeft(R)),this._parser.registerCsiHandler({final:"A"},R=>this.cursorUp(R)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},R=>this.scrollRight(R)),this._parser.registerCsiHandler({final:"B"},R=>this.cursorDown(R)),this._parser.registerCsiHandler({final:"C"},R=>this.cursorForward(R)),this._parser.registerCsiHandler({final:"D"},R=>this.cursorBackward(R)),this._parser.registerCsiHandler({final:"E"},R=>this.cursorNextLine(R)),this._parser.registerCsiHandler({final:"F"},R=>this.cursorPrecedingLine(R)),this._parser.registerCsiHandler({final:"G"},R=>this.cursorCharAbsolute(R)),this._parser.registerCsiHandler({final:"H"},R=>this.cursorPosition(R)),this._parser.registerCsiHandler({final:"I"},R=>this.cursorForwardTab(R)),this._parser.registerCsiHandler({final:"J"},R=>this.eraseInDisplay(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},R=>this.eraseInDisplay(R,!0)),this._parser.registerCsiHandler({final:"K"},R=>this.eraseInLine(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},R=>this.eraseInLine(R,!0)),this._parser.registerCsiHandler({final:"L"},R=>this.insertLines(R)),this._parser.registerCsiHandler({final:"M"},R=>this.deleteLines(R)),this._parser.registerCsiHandler({final:"P"},R=>this.deleteChars(R)),this._parser.registerCsiHandler({final:"S"},R=>this.scrollUp(R)),this._parser.registerCsiHandler({final:"T"},R=>this.scrollDown(R)),this._parser.registerCsiHandler({final:"X"},R=>this.eraseChars(R)),this._parser.registerCsiHandler({final:"Z"},R=>this.cursorBackwardTab(R)),this._parser.registerCsiHandler({final:"`"},R=>this.charPosAbsolute(R)),this._parser.registerCsiHandler({final:"a"},R=>this.hPositionRelative(R)),this._parser.registerCsiHandler({final:"b"},R=>this.repeatPrecedingCharacter(R)),this._parser.registerCsiHandler({final:"c"},R=>this.sendDeviceAttributesPrimary(R)),this._parser.registerCsiHandler({prefix:">",final:"c"},R=>this.sendDeviceAttributesSecondary(R)),this._parser.registerCsiHandler({final:"d"},R=>this.linePosAbsolute(R)),this._parser.registerCsiHandler({final:"e"},R=>this.vPositionRelative(R)),this._parser.registerCsiHandler({final:"f"},R=>this.hVPosition(R)),this._parser.registerCsiHandler({final:"g"},R=>this.tabClear(R)),this._parser.registerCsiHandler({final:"h"},R=>this.setMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"h"},R=>this.setModePrivate(R)),this._parser.registerCsiHandler({final:"l"},R=>this.resetMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"l"},R=>this.resetModePrivate(R)),this._parser.registerCsiHandler({final:"m"},R=>this.charAttributes(R)),this._parser.registerCsiHandler({final:"n"},R=>this.deviceStatus(R)),this._parser.registerCsiHandler({prefix:"?",final:"n"},R=>this.deviceStatusPrivate(R)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},R=>this.softReset(R)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},R=>this.setCursorStyle(R)),this._parser.registerCsiHandler({final:"r"},R=>this.setScrollRegion(R)),this._parser.registerCsiHandler({final:"s"},R=>this.saveCursor(R)),this._parser.registerCsiHandler({final:"t"},R=>this.windowOptions(R)),this._parser.registerCsiHandler({final:"u"},R=>this.restoreCursor(R)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},R=>this.insertColumns(R)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},R=>this.deleteColumns(R)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},R=>this.selectProtected(R)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},R=>this.requestMode(R,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},R=>this.requestMode(R,!1)),this._parser.setExecuteHandler(h.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(h.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(h.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(h.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(h.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(h.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(h.C1.IND,()=>this.index()),this._parser.setExecuteHandler(h.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(h.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new k.OscHandler(R=>(this.setTitle(R),this.setIconName(R),!0))),this._parser.registerOscHandler(1,new k.OscHandler(R=>this.setIconName(R))),this._parser.registerOscHandler(2,new k.OscHandler(R=>this.setTitle(R))),this._parser.registerOscHandler(4,new k.OscHandler(R=>this.setOrReportIndexedColor(R))),this._parser.registerOscHandler(8,new k.OscHandler(R=>this.setHyperlink(R))),this._parser.registerOscHandler(10,new k.OscHandler(R=>this.setOrReportFgColor(R))),this._parser.registerOscHandler(11,new k.OscHandler(R=>this.setOrReportBgColor(R))),this._parser.registerOscHandler(12,new k.OscHandler(R=>this.setOrReportCursorColor(R))),this._parser.registerOscHandler(104,new k.OscHandler(R=>this.restoreIndexedColor(R))),this._parser.registerOscHandler(110,new k.OscHandler(R=>this.restoreFgColor(R))),this._parser.registerOscHandler(111,new k.OscHandler(R=>this.restoreBgColor(R))),this._parser.registerOscHandler(112,new k.OscHandler(R=>this.restoreCursorColor(R))),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(const R in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:R},()=>this.selectCharset("("+R)),this._parser.registerEscHandler({intermediates:")",final:R},()=>this.selectCharset(")"+R)),this._parser.registerEscHandler({intermediates:"*",final:R},()=>this.selectCharset("*"+R)),this._parser.registerEscHandler({intermediates:"+",final:R},()=>this.selectCharset("+"+R)),this._parser.registerEscHandler({intermediates:"-",final:R},()=>this.selectCharset("-"+R)),this._parser.registerEscHandler({intermediates:".",final:R},()=>this.selectCharset("."+R)),this._parser.registerEscHandler({intermediates:"/",final:R},()=>this.selectCharset("/"+R));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(R=>(this._logService.error("Parsing error: ",R),R)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler((R,$)=>this.requestStatusString(R,$)))}_preserveStack(E,D,M,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=M,this._parseStack.position=B}_logSlowResolvingAsync(E){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([E,new Promise((D,M)=>setTimeout(()=>M("#SLOW_TIMEOUT"),5e3))]).catch(D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(E,D){let M,B=this._activeBuffer.x,K=this._activeBuffer.y,F=0;const Y=this._parseStack.paused;if(Y){if(M=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(M),M;B=this._parseStack.cursorStartX,K=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>I&&(F=this._parseStack.position+I)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,R=>String.fromCharCode(R)).join("")}"`),typeof E=="string"?E.split("").map(R=>R.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(E.length,I))),Y||this._dirtyRowTracker.clearRange(),E.length>I)for(let R=F;R<E.length;R+=I){const $=R+I<E.length?R+I:E.length,H=typeof E=="string"?this._stringDecoder.decode(E.substring(R,$),this._parseBuffer):this._utf8Decoder.decode(E.subarray(R,$),this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,H))return this._preserveStack(B,K,H,R),this._logSlowResolvingAsync(M),M}else if(!Y){const R=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,R))return this._preserveStack(B,K,R,0),this._logSlowResolvingAsync(M),M}this._activeBuffer.x===B&&this._activeBuffer.y===K||this._onCursorMove.fire();const U=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),O=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);O<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(O,this._bufferService.rows-1),Math.min(U,this._bufferService.rows-1))}print(E,D,M){let B,K;const F=this._charsetService.charset,Y=this._optionsService.rawOptions.screenReaderMode,U=this._bufferService.cols,O=this._coreService.decPrivateModes.wraparound,R=this._coreService.modes.insertMode,$=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&M-D>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,$);let Q=this._parser.precedingJoinState;for(let z=D;z<M;++z){if(B=E[z],B<127&&F){const Ie=F[String.fromCharCode(B)];Ie&&(B=Ie.charCodeAt(0))}const J=this._unicodeService.charProperties(B,Q);K=y.UnicodeService.extractWidth(J);const ie=y.UnicodeService.extractShouldJoin(J),fe=ie?y.UnicodeService.extractWidth(Q):0;if(Q=J,Y&&this._onA11yChar.fire((0,v.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+K-fe>U){if(O){const Ie=H;let ee=this._activeBuffer.x-fe;for(this._activeBuffer.x=fe,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),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),fe>0&&H instanceof u.BufferLine&&H.copyCellsFrom(Ie,ee,0,fe,!1);ee<U;)Ie.setCellFromCodepoint(ee++,0,1,$)}else if(this._activeBuffer.x=U-1,K===2)continue}if(ie&&this._activeBuffer.x){const Ie=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-Ie,B,K);for(let ee=K-fe;--ee>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,$)}else if(R&&(H.insertCells(this._activeBuffer.x,K-fe,this._activeBuffer.getNullCell($)),H.getWidth(U-1)===2&&H.setCellFromCodepoint(U-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,$)),H.setCellFromCodepoint(this._activeBuffer.x++,B,K,$),K>0)for(;--K;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,$)}this._parser.precedingJoinState=Q,this._activeBuffer.x<U&&M-D>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,$),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,D){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,D):this._parser.registerCsiHandler(E,M=>!P(M.params[0],this._optionsService.rawOptions.windowOptions)||D(M))}registerDcsHandler(E,D){return this._parser.registerDcsHandler(E,new m.DcsHandler(D))}registerEscHandler(E,D){return this._parser.registerEscHandler(E,D)}registerOscHandler(E,D){return this._parser.registerOscHandler(E,new k.OscHandler(D))}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;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const 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,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=E,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+D)}cursorUp(E){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,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){const D=E.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){const D=E.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,D,M,B=!1,K=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);F.replaceCells(D,M,this._activeBuffer.getNullCell(this._eraseAttrData()),K),B&&(F.isWrapped=!1)}_resetBufferLine(E,D=!1){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);M&&(M.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),M.isWrapped=!1)}eraseInDisplay(E,D=!1){let M;switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);M<this._bufferService.rows;M++)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(M);break;case 1:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(M+1).isWrapped=!1);M--;)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(M=this._bufferService.rows,this._dirtyRowTracker.markDirty(M-1);M--;)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(E,D=!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,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(E){this._restrictCursor();let D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,K=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;D--;)this._activeBuffer.lines.splice(K-1,1),this._activeBuffer.lines.splice(M,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 D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;D--;)this._activeBuffer.lines.splice(M,1),this._activeBuffer.lines.splice(B,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();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let D=E.params[0]||1;for(;D--;)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 D=E.params[0]||1;for(;D--;)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(u.DEFAULT_ATTR_DATA));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;const D=E.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);B.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.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;const D=E.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);B.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.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;const D=E.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);B.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.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;const D=E.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);B.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.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){const D=this._parser.precedingJoinState;if(!D)return!0;const M=E.params[0]||1,B=y.UnicodeService.extractWidth(D),K=this._activeBuffer.x-B,F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(K),Y=new Uint32Array(F.length*M);let U=0;for(let R=0;R<F.length;){const $=F.codePointAt(R)||0;Y[U++]=$,R+=$>65535?2:1}let O=U;for(let R=1;R<M;++R)Y.copyWithin(O,0,U),O+=U;return this.print(Y,0,O),!0}sendDeviceAttributesPrimary(E){return E.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(E){return(this._optionsService.rawOptions.termName+"").indexOf(E)===0}setMode(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);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(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");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[D]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(E,D){const M=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:K}=this._coreMouseService,F=this._coreService,{buffers:Y,cols:U}=this._bufferService,{active:O,alt:R}=Y,$=this._optionsService.rawOptions,H=ie=>ie?1:2,Q=E.params[0];return z=Q,J=D?Q===2?4:Q===4?H(F.modes.insertMode):Q===12?3:Q===20?H($.convertEol):0:Q===1?H(M.applicationCursorKeys):Q===3?$.windowOptions.setWinLines?U===80?2:U===132?1:0:0:Q===6?H(M.origin):Q===7?H(M.wraparound):Q===8?3:Q===9?H(B==="X10"):Q===12?H($.cursorBlink):Q===25?H(!F.isCursorHidden):Q===45?H(M.reverseWraparound):Q===66?H(M.applicationKeypad):Q===67?4:Q===1e3?H(B==="VT200"):Q===1002?H(B==="DRAG"):Q===1003?H(B==="ANY"):Q===1004?H(M.sendFocus):Q===1005?4:Q===1006?H(K==="SGR"):Q===1015?4:Q===1016?H(K==="SGR_PIXELS"):Q===1048?1:Q===47||Q===1047||Q===1049?H(O===R):Q===2004?H(M.bracketedPasteMode):0,F.triggerDataEvent(`${h.C0.ESC}[${D?"":"?"}${z};${J}$y`),!0;var z,J}_updateAttrColor(E,D,M,B,K){return D===2?(E|=50331648,E&=-16777216,E|=p.AttributeData.fromColorRGB([M,B,K])):D===5&&(E&=-50331904,E|=33554432|255&M),E}_extractColor(E,D,M){const B=[0,0,-1,0,0,0];let K=0,F=0;do{if(B[F+K]=E.params[D+F],E.hasSubParams(D+F)){const Y=E.getSubParams(D+F);let U=0;do B[1]===5&&(K=1),B[F+U+1+K]=Y[U];while(++U<Y.length&&U+F+1+K<B.length);break}if(B[1]===5&&F+K>=2||B[1]===2&&F+K>=5)break;B[1]&&(K=1)}while(++F+D<E.length&&F+K<B.length);for(let Y=2;Y<B.length;++Y)B[Y]===-1&&(B[Y]=0);switch(B[0]){case 38:M.fg=this._updateAttrColor(M.fg,B[1],B[3],B[4],B[5]);break;case 48:M.bg=this._updateAttrColor(M.bg,B[1],B[3],B[4],B[5]);break;case 58:M.extended=M.extended.clone(),M.extended.underlineColor=this._updateAttrColor(M.extended.underlineColor,B[1],B[3],B[4],B[5])}return F}_processUnderline(E,D){D.extended=D.extended.clone(),(!~E||E>5)&&(E=1),D.extended.underlineStyle=E,D.fg|=268435456,E===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(E){E.fg=u.DEFAULT_ATTR_DATA.fg,E.bg=u.DEFAULT_ATTR_DATA.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;const D=E.length;let M;const B=this._curAttrData;for(let K=0;K<D;K++)M=E.params[K],M>=30&&M<=37?(B.fg&=-50331904,B.fg|=16777216|M-30):M>=40&&M<=47?(B.bg&=-50331904,B.bg|=16777216|M-40):M>=90&&M<=97?(B.fg&=-50331904,B.fg|=16777224|M-90):M>=100&&M<=107?(B.bg&=-50331904,B.bg|=16777224|M-100):M===0?this._processSGR0(B):M===1?B.fg|=134217728:M===3?B.bg|=67108864:M===4?(B.fg|=268435456,this._processUnderline(E.hasSubParams(K)?E.getSubParams(K)[0]:1,B)):M===5?B.fg|=536870912:M===7?B.fg|=67108864:M===8?B.fg|=1073741824:M===9?B.fg|=2147483648:M===2?B.bg|=134217728:M===21?this._processUnderline(2,B):M===22?(B.fg&=-134217729,B.bg&=-134217729):M===23?B.bg&=-67108865:M===24?(B.fg&=-268435457,this._processUnderline(0,B)):M===25?B.fg&=-536870913:M===27?B.fg&=-67108865:M===28?B.fg&=-1073741825:M===29?B.fg&=2147483647:M===39?(B.fg&=-67108864,B.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):M===49?(B.bg&=-67108864,B.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):M===38||M===48||M===58?K+=this._extractColor(E,K,B):M===53?B.bg|=1073741824:M===55?B.bg&=-1073741825:M===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):M===100?(B.fg&=-67108864,B.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",M);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${D};${M}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const D=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${D};${M}R`)}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=u.DEFAULT_ATTR_DATA.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){const D=E.params[0]||1;switch(D){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const M=D%2==1;return this._optionsService.options.cursorBlink=M,!0}setScrollRegion(E){const D=E.params[0]||1;let M;return(E.length<2||(M=E.params[1])>this._bufferService.rows||M===0)&&(M=this._bufferService.rows),M>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=M-1,this._setCursor(0,0)),!0}windowOptions(E){if(!P(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(A.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(A.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}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){const D=[],M=E.split(";");for(;M.length>1;){const B=M.shift(),K=M.shift();if(/^\d+$/.exec(B)){const F=parseInt(B);if(X(F))if(K==="?")D.push({type:0,index:F});else{const Y=(0,b.parseColor)(K);Y&&D.push({type:1,index:F,color:Y})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(E){const D=E.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(E,D){this._getCurrentLinkId()&&this._finishHyperlink();const M=E.split(":");let B;const K=M.findIndex(F=>F.startsWith("id="));return K!==-1&&(B=M[K].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(E,D){const M=E.split(";");for(let B=0;B<M.length&&!(D>=this._specialColors.length);++B,++D)if(M[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const K=(0,b.parseColor)(M[B]);K&&this._onColor.fire([{type:1,index:this._specialColors[D],color:K}])}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;const D=[],M=E.split(";");for(let B=0;B<M.length;++B)if(/^\d+$/.exec(M[B])){const K=parseInt(M[B]);X(K)&&D.push({type:2,index:K})}return D.length&&this._onColor.fire(D),!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,_.DEFAULT_CHARSET),!0}selectCharset(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(T[E[0]],_.CHARSETS[E[1]]||_.DEFAULT_CHARSET),!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){const 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=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(E){return this._charsetService.setgLevel(E),!0}screenAlignmentPattern(){const E=new n.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const M=this._activeBuffer.ybase+this._activeBuffer.y+D,B=this._activeBuffer.lines.get(M);B&&(B.fill(E),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,D){const M=this._bufferService.buffer,B=this._optionsService.rawOptions;return(K=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${K}${h.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${M.scrollTop+1};${M.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,D){this._dirtyRowTracker.markRangeDirty(E,D)}}o.InputHandler=W;let V=class{constructor(j){this._bufferService=j,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(j){j<this.start?this.start=j:j>this.end&&(this.end=j)}markRangeDirty(j,E){j>E&&(N=j,j=E,E=N),j<this.start&&(this.start=j),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(j){return 0<=j&&j<256}V=d([S(0,w.IBufferService)],V)},844:(C,o)=>{function c(d){for(const S of d)S.dispose();d.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const S=this._disposables.indexOf(d);S!==-1&&this._disposables.splice(S,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var S;this._isDisposed||d===this._value||((S=this._value)==null||S.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},o.toDisposable=function(d){return{dispose:d}},o.disposeArray=c,o.getDisposeArrayDisposable=function(d){return{dispose:()=>c(d)}}},1505:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(S,h,_){this._data[S]||(this._data[S]={}),this._data[S][h]=_}get(S,h){return this._data[S]?this._data[S][h]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(d,S,h,_,g){this._data.get(d,S)||this._data.set(d,S,new c),this._data.get(d,S).set(h,_,g)}get(d,S,h,_){var g;return(g=this._data.get(d,S))==null?void 0:g.get(h,_)}clear(){this._data.clear()}}},6114:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,d=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const S=c.match(/Version\/(\d+)/);return S===null||S.length<2?0:parseInt(S[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),o.isIpad=d==="iPad",o.isIphone=d==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),o.isLinux=d.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(c=this._search(this._getKey(d)),this._array.splice(c,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const S=this._getKey(d);if(S===void 0||(c=this._search(S),c===-1)||this._getKey(this._array[c])!==S)return!1;do if(this._array[c]===d)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===S);return!1}*getKeyIterator(d){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===d)}forEachByKey(d,S){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do S(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===d)}values(){return[...this._array].values()}_search(d){let S=0,h=this._array.length-1;for(;h>=S;){let _=S+h>>1;const g=this._getKey(this._array[_]);if(g>d)h=_-1;else{if(!(g<d)){for(;_>0&&this._getKey(this._array[_-1])===d;)_--;return _}S=_+1}}return S}}},7226:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const d=c(6114);class S{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),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(g){this._idleCallback=void 0;let x=0,v=0,u=g.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),v=Math.max(x,v),l=g.timeRemaining(),1.5*v>l)return u-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-x))}ms`),void this._start();u=l}this.clear()}}class h extends S{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const x=Date.now()+g;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=h,o.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends S{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:h,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const d=c(643);o.updateWindowsModeWrappedState=function(S){const h=S.buffer.lines.get(S.buffer.ybase+S.buffer.y-1),_=h==null?void 0:h.get(S.cols-1),g=S.buffer.lines.get(S.buffer.ybase+S.buffer.y);g&&_&&(g.isWrapped=_[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&_[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,_=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=_}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=d},9092:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const d=c(6349),S=c(7226),h=c(3734),_=c(8437),g=c(4634),x=c(511),v=c(643),u=c(4863),l=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(s,n,p){this._hasScrollback=s,this._optionsService=n,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new S.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,n){return new _.BufferLine(this._bufferService.cols,this.getNullCell(s),n)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const n=s+this._optionsService.rawOptions.scrollback;return n>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:n}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=_.DEFAULT_ATTR_DATA);let n=this._rows;for(;n--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,n){const p=this.getNullCell(_.DEFAULT_ATTR_DATA);let w=0;const y=this._getCorrectBufferLength(n);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<s)for(let m=0;m<this.lines.length;m++)w+=+this.lines.get(m).resize(s,p);let k=0;if(this._rows<n)for(let m=this._rows;m<n;m++)this.lines.length<n+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(s,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(s,p)));else for(let m=this._rows;m>n;m--)this.lines.length>n+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){const m=this.lines.length-y;m>0&&(this.lines.trimStart(m),this.ybase=Math.max(this.ybase-m,0),this.ydisp=Math.max(this.ydisp-m,0),this.savedY=Math.max(this.savedY-m,0)),this.lines.maxLength=y}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,n-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=n-1,this._isReflowEnabled&&(this._reflow(s,n),this._cols>s))for(let k=0;k<this.lines.length;k++)w+=+this.lines.get(k).resize(s,p);this._cols=s,this._rows=n,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let n=0;for(;this._memoryCleanupPosition<this.lines.length;)if(n+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),n>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,n){this._cols!==s&&(s>this._cols?this._reflowLarger(s,n):this._reflowSmaller(s,n))}_reflowLarger(s,n){const p=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(p.length>0){const w=(0,g.reflowLargerCreateNewLayout)(this.lines,p);(0,g.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(s,n,w.countRemoved)}}_reflowLargerAdjustViewport(s,n,p){const w=this.getNullCell(_.DEFAULT_ATTR_DATA);let y=p;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<n&&this.lines.push(new _.BufferLine(s,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(s,n){const p=this.getNullCell(_.DEFAULT_ATTR_DATA),w=[];let y=0;for(let k=this.lines.length-1;k>=0;k--){let m=this.lines.get(k);if(!m||!m.isWrapped&&m.getTrimmedLength()<=s)continue;const b=[m];for(;m.isWrapped&&k>0;)m=this.lines.get(--k),b.unshift(m);const T=this.ybase+this.y;if(T>=k&&T<k+b.length)continue;const I=b[b.length-1].getTrimmedLength(),P=(0,g.reflowSmallerGetNewLineLengths)(b,this._cols,s),A=P.length-b.length;let N;N=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+A):Math.max(0,this.lines.length-this.lines.maxLength+A);const W=[];for(let M=0;M<A;M++){const B=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);W.push(B)}W.length>0&&(w.push({start:k+b.length+y,newLines:W}),y+=W.length),b.push(...W);let V=P.length-1,X=P[V];X===0&&(V--,X=P[V]);let j=b.length-A-1,E=I;for(;j>=0;){const M=Math.min(E,X);if(b[V]===void 0)break;if(b[V].copyCellsFrom(b[j],E-M,X-M,M,!0),X-=M,X===0&&(V--,X=P[V]),E-=M,E===0){j--;const B=Math.max(j,0);E=(0,g.getWrappedLineTrimmedLength)(b,B,this._cols)}}for(let M=0;M<b.length;M++)P[M]<s&&b[M].setCell(P[M],p);let D=A-N;for(;D-- >0;)this.ybase===0?this.y<n-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-n&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+A,this.ybase+n-1)}if(w.length>0){const k=[],m=[];for(let V=0;V<this.lines.length;V++)m.push(this.lines.get(V));const b=this.lines.length;let T=b-1,I=0,P=w[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let A=0;for(let V=Math.min(this.lines.maxLength-1,b+y-1);V>=0;V--)if(P&&P.start>T+A){for(let X=P.newLines.length-1;X>=0;X--)this.lines.set(V--,P.newLines[X]);V++,k.push({index:T+1,amount:P.newLines.length}),A+=P.newLines.length,P=w[++I]}else this.lines.set(V,m[T--]);let N=0;for(let V=k.length-1;V>=0;V--)k[V].index+=N,this.lines.onInsertEmitter.fire(k[V]),N+=k[V].amount;const W=Math.max(0,b+y-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(s,n,p=0,w){const y=this.lines.get(s);return y?y.translateToString(n,p,w):""}getWrappedRangeForLine(s){let n=s,p=s;for(;n>0&&this.lines.get(n).isWrapped;)n--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:n,last:p}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let n=0;n<this.markers.length;n++)this.markers[n].line===s&&(this.markers[n].dispose(),this.markers.splice(n--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const n=new u.Marker(s);return this.markers.push(n),n.register(this.lines.onTrim(p=>{n.line-=p,n.line<0&&n.dispose()})),n.register(this.lines.onInsert(p=>{n.line>=p.index&&(n.line+=p.amount)})),n.register(this.lines.onDelete(p=>{n.line>=p.index&&n.line<p.index+p.amount&&n.dispose(),n.line>p.index&&(n.line-=p.amount)})),n.register(n.onDispose(()=>this._removeMarker(n))),n}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const d=c(3734),S=c(511),h=c(643),_=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let g=0;class x{constructor(u,l,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);const n=l||S.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let p=0;p<u;++p)this.setCell(p,n);this.length=u}get(u){const l=this._data[3*u+0],s=2097151&l;return[this._data[3*u+1],2097152&l?this._combined[u]:s?(0,_.stringFromCodePoint)(s):"",l>>22,2097152&l?this._combined[u].charCodeAt(this._combined[u].length-1):s]}set(u,l){this._data[3*u+1]=l[h.CHAR_DATA_ATTR_INDEX],l[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=l[1],this._data[3*u+0]=2097152|u|l[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=l[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){const l=this._data[3*u+0];return 2097152&l?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&l}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){const l=this._data[3*u+0];return 2097152&l?this._combined[u]:2097151&l?(0,_.stringFromCodePoint)(2097151&l):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,l){return g=3*u,l.content=this._data[g+0],l.fg=this._data[g+1],l.bg=this._data[g+2],2097152&l.content&&(l.combinedData=this._combined[u]),268435456&l.bg&&(l.extended=this._extendedAttrs[u]),l}setCell(u,l){2097152&l.content&&(this._combined[u]=l.combinedData),268435456&l.bg&&(this._extendedAttrs[u]=l.extended),this._data[3*u+0]=l.content,this._data[3*u+1]=l.fg,this._data[3*u+2]=l.bg}setCellFromCodepoint(u,l,s,n){268435456&n.bg&&(this._extendedAttrs[u]=n.extended),this._data[3*u+0]=l|s<<22,this._data[3*u+1]=n.fg,this._data[3*u+2]=n.bg}addCodepointToCell(u,l,s){let n=this._data[3*u+0];2097152&n?this._combined[u]+=(0,_.stringFromCodePoint)(l):2097151&n?(this._combined[u]=(0,_.stringFromCodePoint)(2097151&n)+(0,_.stringFromCodePoint)(l),n&=-2097152,n|=2097152):n=l|4194304,s&&(n&=-12582913,n|=s<<22),this._data[3*u+0]=n}insertCells(u,l,s){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),l<this.length-u){const n=new S.CellData;for(let p=this.length-u-l-1;p>=0;--p)this.setCell(u+l+p,this.loadCell(u+p,n));for(let p=0;p<l;++p)this.setCell(u+p,s)}else for(let n=u;n<this.length;++n)this.setCell(n,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(u,l,s){if(u%=this.length,l<this.length-u){const n=new S.CellData;for(let p=0;p<this.length-u-l;++p)this.setCell(u+p,this.loadCell(u+l+p,n));for(let p=this.length-l;p<this.length;++p)this.setCell(p,s)}else for(let n=u;n<this.length;++n)this.setCell(n,s);u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodepoint(u,0,1,s)}replaceCells(u,l,s,n=!1){if(n)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodepoint(u-1,0,1,s),l<this.length&&this.getWidth(l-1)===2&&!this.isProtected(l)&&this.setCellFromCodepoint(l,0,1,s);u<l&&u<this.length;)this.isProtected(u)||this.setCell(u,s),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),l<this.length&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l,0,1,s);u<l&&u<this.length;)this.setCell(u++,s)}resize(u,l){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const n=new Uint32Array(s);n.set(this._data),this._data=n}for(let n=this.length;n<u;++n)this.setCell(n,l)}else{this._data=this._data.subarray(0,s);const n=Object.keys(this._combined);for(let w=0;w<n.length;w++){const y=parseInt(n[w],10);y>=u&&delete this._combined[y]}const p=Object.keys(this._extendedAttrs);for(let w=0;w<p.length;w++){const y=parseInt(p[w],10);y>=u&&delete this._extendedAttrs[y]}}return this.length=u,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,l=!1){if(l)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,u);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(const l in u._combined)this._combined[l]=u._combined[l];this._extendedAttrs={};for(const l in u._extendedAttrs)this._extendedAttrs[l]=u._extendedAttrs[l];this.isWrapped=u.isWrapped}clone(){const u=new x(0);u._data=new Uint32Array(this._data),u.length=this.length;for(const l in this._combined)u._combined[l]=this._combined[l];for(const l in this._extendedAttrs)u._extendedAttrs[l]=this._extendedAttrs[l];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,l,s,n,p){const w=u._data;if(p)for(let k=n-1;k>=0;k--){for(let m=0;m<3;m++)this._data[3*(s+k)+m]=w[3*(l+k)+m];268435456&w[3*(l+k)+2]&&(this._extendedAttrs[s+k]=u._extendedAttrs[l+k])}else for(let k=0;k<n;k++){for(let m=0;m<3;m++)this._data[3*(s+k)+m]=w[3*(l+k)+m];268435456&w[3*(l+k)+2]&&(this._extendedAttrs[s+k]=u._extendedAttrs[l+k])}const y=Object.keys(u._combined);for(let k=0;k<y.length;k++){const m=parseInt(y[k],10);m>=l&&(this._combined[m-l+s]=u._combined[m])}}translateToString(u,l,s,n){l=l??0,s=s??this.length,u&&(s=Math.min(s,this.getTrimmedLength())),n&&(n.length=0);let p="";for(;l<s;){const w=this._data[3*l+0],y=2097151&w,k=2097152&w?this._combined[l]:y?(0,_.stringFromCodePoint)(y):h.WHITESPACE_CELL_CHAR;if(p+=k,n)for(let m=0;m<k.length;++m)n.push(l);l+=w>>22||1}return n&&n.push(l),p}}o.BufferLine=x},4841:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,d){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return d*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(C,o)=>{function c(d,S,h){if(S===d.length-1)return d[S].getTrimmedLength();const _=!d[S].hasContent(h-1)&&d[S].getWidth(h-1)===1,g=d[S+1].getWidth(0)===2;return _&&g?h-1:h}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(d,S,h,_,g){const x=[];for(let v=0;v<d.length-1;v++){let u=v,l=d.get(++u);if(!l.isWrapped)continue;const s=[d.get(v)];for(;u<d.length&&l.isWrapped;)s.push(l),l=d.get(++u);if(_>=v&&_<u){v+=s.length-1;continue}let n=0,p=c(s,n,S),w=1,y=0;for(;w<s.length;){const m=c(s,w,S),b=m-y,T=h-p,I=Math.min(b,T);s[n].copyCellsFrom(s[w],y,p,I,!1),p+=I,p===h&&(n++,p=0),y+=I,y===m&&(w++,y=0),p===0&&n!==0&&s[n-1].getWidth(h-1)===2&&(s[n].copyCellsFrom(s[n-1],h-1,p++,1,!1),s[n-1].setCell(h-1,g))}s[n].replaceCells(p,h,g);let k=0;for(let m=s.length-1;m>0&&(m>n||s[m].getTrimmedLength()===0);m--)k++;k>0&&(x.push(v+s.length-k),x.push(k)),v+=s.length-1}return x},o.reflowLargerCreateNewLayout=function(d,S){const h=[];let _=0,g=S[_],x=0;for(let v=0;v<d.length;v++)if(g===v){const u=S[++_];d.onDeleteEmitter.fire({index:v-x,amount:u}),v+=u-1,x+=u,g=S[++_]}else h.push(v);return{layout:h,countRemoved:x}},o.reflowLargerApplyNewLayout=function(d,S){const h=[];for(let _=0;_<S.length;_++)h.push(d.get(S[_]));for(let _=0;_<h.length;_++)d.set(_,h[_]);d.length=S.length},o.reflowSmallerGetNewLineLengths=function(d,S,h){const _=[],g=d.map((l,s)=>c(d,s,S)).reduce((l,s)=>l+s);let x=0,v=0,u=0;for(;u<g;){if(g-u<h){_.push(g-u);break}x+=h;const l=c(d,v,S);x>l&&(x-=l,v++);const s=d[v].getWidth(x-1)===2;s&&x--;const n=s?h-1:h;_.push(n),u+=n}return _},o.getWrappedLineTrimmedLength=c},5295:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const d=c(8460),S=c(844),h=c(9092);class _ extends S.Disposable{constructor(x,v){super(),this._optionsService=x,this._bufferService=v,this._onBufferActivate=this.register(new d.EventEmitter),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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!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(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),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(x,v){this._normal.resize(x,v),this._alt.resize(x,v),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=_},511:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const d=c(482),S=c(643),h=c(3734);class _ extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const v=new _;return v.setFromCharData(x),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[S.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(x[S.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(x[S.CHAR_DATA_CHAR_INDEX].length===2){const u=x[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){const l=x[S.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(u-55296)+l-56320+65536|x[S.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=x[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[S.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=x[S.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[S.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=_},643:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const d=c(8460),S=c(844);class h{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,S.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}o.Marker=h,h._nextId=1},7116:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(C,o)=>{var c,d,S;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
|
|
47
|
-
`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""}(c||(o.C0=c={})),function(h){h.PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC=""}(d||(o.C1=d={})),function(h){h.ST=`${c.ESC}\\`}(S||(o.C1_ESCAPED=S={}))},7399:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const d=c(2584),S={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:["'",'"']};o.evaluateKeyboardEvent=function(h,_,g,x){const v={type:0,cancel:!1,key:void 0},u=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?v.key=_?d.C0.ESC+"OA":d.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?v.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?v.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(v.key=_?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:v.key=h.ctrlKey?"\b":d.C0.DEL,h.altKey&&(v.key=d.C0.ESC+v.key);break;case 9:if(h.shiftKey){v.key=d.C0.ESC+"[Z";break}v.key=d.C0.HT,v.cancel=!0;break;case 13:v.key=h.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,v.cancel=!0;break;case 27:v.key=d.C0.ESC,h.altKey&&(v.key=d.C0.ESC+d.C0.ESC),v.cancel=!0;break;case 37:if(h.metaKey)break;u?(v.key=d.C0.ESC+"[1;"+(u+1)+"D",v.key===d.C0.ESC+"[1;3D"&&(v.key=d.C0.ESC+(g?"b":"[1;5D"))):v.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(h.metaKey)break;u?(v.key=d.C0.ESC+"[1;"+(u+1)+"C",v.key===d.C0.ESC+"[1;3C"&&(v.key=d.C0.ESC+(g?"f":"[1;5C"))):v.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(h.metaKey)break;u?(v.key=d.C0.ESC+"[1;"+(u+1)+"A",g||v.key!==d.C0.ESC+"[1;3A"||(v.key=d.C0.ESC+"[1;5A")):v.key=_?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(h.metaKey)break;u?(v.key=d.C0.ESC+"[1;"+(u+1)+"B",g||v.key!==d.C0.ESC+"[1;3B"||(v.key=d.C0.ESC+"[1;5B")):v.key=_?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(v.key=d.C0.ESC+"[2~");break;case 46:v.key=u?d.C0.ESC+"[3;"+(u+1)+"~":d.C0.ESC+"[3~";break;case 36:v.key=u?d.C0.ESC+"[1;"+(u+1)+"H":_?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:v.key=u?d.C0.ESC+"[1;"+(u+1)+"F":_?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:h.shiftKey?v.type=2:h.ctrlKey?v.key=d.C0.ESC+"[5;"+(u+1)+"~":v.key=d.C0.ESC+"[5~";break;case 34:h.shiftKey?v.type=3:h.ctrlKey?v.key=d.C0.ESC+"[6;"+(u+1)+"~":v.key=d.C0.ESC+"[6~";break;case 112:v.key=u?d.C0.ESC+"[1;"+(u+1)+"P":d.C0.ESC+"OP";break;case 113:v.key=u?d.C0.ESC+"[1;"+(u+1)+"Q":d.C0.ESC+"OQ";break;case 114:v.key=u?d.C0.ESC+"[1;"+(u+1)+"R":d.C0.ESC+"OR";break;case 115:v.key=u?d.C0.ESC+"[1;"+(u+1)+"S":d.C0.ESC+"OS";break;case 116:v.key=u?d.C0.ESC+"[15;"+(u+1)+"~":d.C0.ESC+"[15~";break;case 117:v.key=u?d.C0.ESC+"[17;"+(u+1)+"~":d.C0.ESC+"[17~";break;case 118:v.key=u?d.C0.ESC+"[18;"+(u+1)+"~":d.C0.ESC+"[18~";break;case 119:v.key=u?d.C0.ESC+"[19;"+(u+1)+"~":d.C0.ESC+"[19~";break;case 120:v.key=u?d.C0.ESC+"[20;"+(u+1)+"~":d.C0.ESC+"[20~";break;case 121:v.key=u?d.C0.ESC+"[21;"+(u+1)+"~":d.C0.ESC+"[21~";break;case 122:v.key=u?d.C0.ESC+"[23;"+(u+1)+"~":d.C0.ESC+"[23~";break;case 123:v.key=u?d.C0.ESC+"[24;"+(u+1)+"~":d.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(g&&!x||!h.altKey||h.metaKey)!g||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?v.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(v.key=d.C0.US),h.key==="@"&&(v.key=d.C0.NUL)):h.keyCode===65&&(v.type=1);else{const l=S[h.keyCode],s=l==null?void 0:l[h.shiftKey?1:0];if(s)v.key=d.C0.ESC+s;else if(h.keyCode>=65&&h.keyCode<=90){const n=h.ctrlKey?h.keyCode-64:h.keyCode+32;let p=String.fromCharCode(n);h.shiftKey&&(p=p.toUpperCase()),v.key=d.C0.ESC+p}else if(h.keyCode===32)v.key=d.C0.ESC+(h.ctrlKey?d.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let n=h.code.slice(3,4);h.shiftKey||(n=n.toLowerCase()),v.key=d.C0.ESC+n,v.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?v.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?v.key=d.C0.NUL:h.keyCode>=51&&h.keyCode<=55?v.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?v.key=d.C0.DEL:h.keyCode===219?v.key=d.C0.ESC:h.keyCode===220?v.key=d.C0.FS:h.keyCode===221&&(v.key=d.C0.GS)}return v}},482:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,d=0,S=c.length){let h="";for(let _=d;_<S;++_){let g=c[_];g>65535?(g-=65536,h+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):h+=String.fromCharCode(g)}return h},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,d){const S=c.length;if(!S)return 0;let h=0,_=0;if(this._interim){const g=c.charCodeAt(_++);56320<=g&&g<=57343?d[h++]=1024*(this._interim-55296)+g-56320+65536:(d[h++]=this._interim,d[h++]=g),this._interim=0}for(let g=_;g<S;++g){const x=c.charCodeAt(g);if(55296<=x&&x<=56319){if(++g>=S)return this._interim=x,h;const v=c.charCodeAt(g);56320<=v&&v<=57343?d[h++]=1024*(x-55296)+v-56320+65536:(d[h++]=x,d[h++]=v)}else x!==65279&&(d[h++]=x)}return h}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,d){const S=c.length;if(!S)return 0;let h,_,g,x,v=0,u=0,l=0;if(this.interim[0]){let p=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let y,k=0;for(;(y=63&this.interim[++k])&&k<4;)w<<=6,w|=y;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,b=m-k;for(;l<b;){if(l>=S)return 0;if(y=c[l++],(192&y)!=128){l--,p=!0;break}this.interim[k++]=y,w<<=6,w|=63&y}p||(m===2?w<128?l--:d[v++]=w:m===3?w<2048||w>=55296&&w<=57343||w===65279||(d[v++]=w):w<65536||w>1114111||(d[v++]=w)),this.interim.fill(0)}const s=S-4;let n=l;for(;n<S;){for(;!(!(n<s)||128&(h=c[n])||128&(_=c[n+1])||128&(g=c[n+2])||128&(x=c[n+3]));)d[v++]=h,d[v++]=_,d[v++]=g,d[v++]=x,n+=4;if(h=c[n++],h<128)d[v++]=h;else if((224&h)==192){if(n>=S)return this.interim[0]=h,v;if(_=c[n++],(192&_)!=128){n--;continue}if(u=(31&h)<<6|63&_,u<128){n--;continue}d[v++]=u}else if((240&h)==224){if(n>=S)return this.interim[0]=h,v;if(_=c[n++],(192&_)!=128){n--;continue}if(n>=S)return this.interim[0]=h,this.interim[1]=_,v;if(g=c[n++],(192&g)!=128){n--;continue}if(u=(15&h)<<12|(63&_)<<6|63&g,u<2048||u>=55296&&u<=57343||u===65279)continue;d[v++]=u}else if((248&h)==240){if(n>=S)return this.interim[0]=h,v;if(_=c[n++],(192&_)!=128){n--;continue}if(n>=S)return this.interim[0]=h,this.interim[1]=_,v;if(g=c[n++],(192&g)!=128){n--;continue}if(n>=S)return this.interim[0]=h,this.interim[1]=_,this.interim[2]=g,v;if(x=c[n++],(192&x)!=128){n--;continue}if(u=(7&h)<<18|(63&_)<<12|(63&g)<<6|63&x,u<65536||u>1114111)continue;d[v++]=u}}return v}}},225:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const d=c(1480),S=[[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]],h=[[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]];let _;o.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let g=0;g<S.length;++g)_.fill(0,S[g][0],S[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?_[g]:function(x,v){let u,l=0,s=v.length-1;if(x<v[0][0]||x>v[s][1])return!1;for(;s>=l;)if(u=l+s>>1,x>v[u][1])l=u+1;else{if(!(x<v[u][0]))return!0;s=u-1}return!1}(g,h)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,x){let v=this.wcwidth(g),u=v===0&&x!==0;if(u){const l=d.UnicodeService.extractWidth(x);l===0?u=!1:l>v&&(v=l)}return d.UnicodeService.createPropertyValue(0,v,u)}}},5981:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const d=c(8460),S=c(844);class h extends S.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(x),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(x)}_innerWrite(g=0,x=!0){const v=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const u=this._writeBuffer[this._bufferOffset],l=this._action(u,x);if(l){const n=p=>Date.now()-v>=12?setTimeout(()=>this._innerWrite(0,p)):this._innerWrite(v,p);return void l.catch(p=>(queueMicrotask(()=>{throw p}),Promise.resolve(!1))).then(n)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-v>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}o.WriteBuffer=h},5941:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\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})$/,d=/^[\da-f]+$/;function S(h,_){const g=h.toString(16),x=g.length<2?"0"+g:g;switch(_){case 4:return g[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(h){if(!h)return;let _=h.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const g=c.exec(_);if(g){const x=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/x*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/x*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/x*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),d.exec(_)&&[3,6,9,12].includes(_.length))){const g=_.length/3,x=[0,0,0];for(let v=0;v<3;++v){const u=parseInt(_.slice(g*v,g*v+g),16);x[v]=g===1?u<<4:g===2?u:g===3?u>>4:u>>8}return x}},o.toRgbString=function(h,_=16){const[g,x,v]=h;return`rgb:${S(g,_)}/${S(x,_)}/${S(v,_)}`}},5770:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const d=c(482),S=c(8742),h=c(5770),_=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(x,v){this._handlers[x]===void 0&&(this._handlers[x]=[]);const u=this._handlers[x];return u.push(v),{dispose:()=>{const l=u.indexOf(v);l!==-1&&u.splice(l,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(x,v){if(this.reset(),this._ident=x,this._active=this._handlers[x]||_,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(x,v,u){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(x,v,u);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(x,v,u))}unhook(x,v=!0){if(this._active.length){let u=!1,l=this._active.length-1,s=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,u=v,s=this._stack.fallThrough,this._stack.paused=!1),!s&&u===!1){for(;l>=0&&(u=this._active[l].unhook(x),u!==!0);l--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,u;l--}for(;l>=0;l--)if(u=this._active[l].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",x);this._active=_,this._ident=0}};const g=new S.Params;g.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=g,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():g,this._data="",this._hitLimit=!1}put(x,v,u){this._hitLimit||(this._data+=(0,d.utf32ToString)(x,v,u),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let v=!1;if(this._hitLimit)v=!1;else if(x&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then(u=>(this._params=g,this._data="",this._hitLimit=!1,u));return this._params=g,this._data="",this._hitLimit=!1,v}}},2015:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const d=c(844),S=c(8742),h=c(6242),_=c(6351);class g{constructor(l){this.table=new Uint8Array(l)}setDefault(l,s){this.table.fill(l<<4|s)}add(l,s,n,p){this.table[s<<8|l]=n<<4|p}addMany(l,s,n,p){for(let w=0;w<l.length;w++)this.table[s<<8|l[w]]=n<<4|p}}o.TransitionTable=g;const x=160;o.VT500_TRANSITION_TABLE=function(){const u=new g(4095),l=Array.apply(null,Array(256)).map((k,m)=>m),s=(k,m)=>l.slice(k,m),n=s(32,127),p=s(0,24);p.push(25),p.push.apply(p,s(28,32));const w=s(0,14);let y;for(y in u.setDefault(1,0),u.addMany(n,0,2,0),w)u.addMany([24,26,153,154],y,3,0),u.addMany(s(128,144),y,3,0),u.addMany(s(144,152),y,3,0),u.add(156,y,0,0),u.add(27,y,11,1),u.add(157,y,4,8),u.addMany([152,158,159],y,0,7),u.add(155,y,11,3),u.add(144,y,11,9);return u.addMany(p,0,3,0),u.addMany(p,1,3,1),u.add(127,1,0,1),u.addMany(p,8,0,8),u.addMany(p,3,3,3),u.add(127,3,0,3),u.addMany(p,4,3,4),u.add(127,4,0,4),u.addMany(p,6,3,6),u.addMany(p,5,3,5),u.add(127,5,0,5),u.addMany(p,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(n,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(s(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(n,7,0,7),u.addMany(p,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(s(64,127),3,7,0),u.addMany(s(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(s(48,60),4,8,4),u.addMany(s(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(s(32,64),6,0,6),u.add(127,6,0,6),u.addMany(s(64,127),6,0,0),u.addMany(s(32,48),3,9,5),u.addMany(s(32,48),5,9,5),u.addMany(s(48,64),5,0,6),u.addMany(s(64,127),5,7,0),u.addMany(s(32,48),4,9,5),u.addMany(s(32,48),1,9,2),u.addMany(s(32,48),2,9,2),u.addMany(s(48,127),2,10,0),u.addMany(s(48,80),1,10,0),u.addMany(s(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(s(96,127),1,10,0),u.add(80,1,11,9),u.addMany(p,9,0,9),u.add(127,9,0,9),u.addMany(s(28,32),9,0,9),u.addMany(s(32,48),9,9,12),u.addMany(s(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(p,11,0,11),u.addMany(s(32,128),11,0,11),u.addMany(s(28,32),11,0,11),u.addMany(p,10,0,10),u.add(127,10,0,10),u.addMany(s(28,32),10,0,10),u.addMany(s(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(s(32,48),10,9,12),u.addMany(p,12,0,12),u.add(127,12,0,12),u.addMany(s(28,32),12,0,12),u.addMany(s(32,48),12,9,12),u.addMany(s(48,64),12,0,11),u.addMany(s(64,127),12,12,13),u.addMany(s(64,127),10,12,13),u.addMany(s(64,127),9,12,13),u.addMany(p,13,13,13),u.addMany(n,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(x,0,2,0),u.add(x,8,5,8),u.add(x,6,0,6),u.add(x,11,0,11),u.add(x,13,13,13),u}();class v extends d.Disposable{constructor(l=o.VT500_TRANSITION_TABLE){super(),this._transitions=l,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new S.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,n,p)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,n)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(l,s=[64,126]){let n=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=l.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let w=0;w<l.intermediates.length;++w){const y=l.intermediates.charCodeAt(w);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=y}}if(l.final.length!==1)throw new Error("final must be a single byte");const p=l.final.charCodeAt(0);if(s[0]>p||p>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return n<<=8,n|=p,n}identToString(l){const s=[];for(;l;)s.push(String.fromCharCode(255&l)),l>>=8;return s.reverse().join("")}setPrintHandler(l){this._printHandler=l}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(l,s){const n=this._identifier(l,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);const p=this._escHandlers[n];return p.push(s),{dispose:()=>{const w=p.indexOf(s);w!==-1&&p.splice(w,1)}}}clearEscHandler(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]}setEscHandlerFallback(l){this._escHandlerFb=l}setExecuteHandler(l,s){this._executeHandlers[l.charCodeAt(0)]=s}clearExecuteHandler(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]}setExecuteHandlerFallback(l){this._executeHandlerFb=l}registerCsiHandler(l,s){const n=this._identifier(l);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);const p=this._csiHandlers[n];return p.push(s),{dispose:()=>{const w=p.indexOf(s);w!==-1&&p.splice(w,1)}}}clearCsiHandler(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]}setCsiHandlerFallback(l){this._csiHandlerFb=l}registerDcsHandler(l,s){return this._dcsParser.registerHandler(this._identifier(l),s)}clearDcsHandler(l){this._dcsParser.clearHandler(this._identifier(l))}setDcsHandlerFallback(l){this._dcsParser.setHandlerFallback(l)}registerOscHandler(l,s){return this._oscParser.registerHandler(l,s)}clearOscHandler(l){this._oscParser.clearHandler(l)}setOscHandlerFallback(l){this._oscParser.setHandlerFallback(l)}setErrorHandler(l){this._errorHandler=l}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(l,s,n,p,w){this._parseStack.state=l,this._parseStack.handlers=s,this._parseStack.handlerPos=n,this._parseStack.transition=p,this._parseStack.chunkPos=w}parse(l,s,n){let p,w=0,y=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const m=this._parseStack.handlers;let b=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&b>-1){for(;b>=0&&(p=m[b](this._params),p!==!0);b--)if(p instanceof Promise)return this._parseStack.handlerPos=b,p}this._parseStack.handlers=[];break;case 4:if(n===!1&&b>-1){for(;b>=0&&(p=m[b](),p!==!0);b--)if(p instanceof Promise)return this._parseStack.handlerPos=b,p}this._parseStack.handlers=[];break;case 6:if(w=l[this._parseStack.chunkPos],p=this._dcsParser.unhook(w!==24&&w!==26,n),p)return p;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=l[this._parseStack.chunkPos],p=this._oscParser.end(w!==24&&w!==26,n),p)return p;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let m=k;m<s;++m){switch(w=l[m],y=this._transitions.table[this.currentState<<8|(w<160?w:x)],y>>4){case 2:for(let A=m+1;;++A){if(A>=s||(w=l[A])<32||w>126&&w<x){this._printHandler(l,m,A),m=A-1;break}if(++A>=s||(w=l[A])<32||w>126&&w<x){this._printHandler(l,m,A),m=A-1;break}if(++A>=s||(w=l[A])<32||w>126&&w<x){this._printHandler(l,m,A),m=A-1;break}if(++A>=s||(w=l[A])<32||w>126&&w<x){this._printHandler(l,m,A),m=A-1;break}}break;case 3:this._executeHandlers[w]?this._executeHandlers[w]():this._executeHandlerFb(w),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:m,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const b=this._csiHandlers[this._collect<<8|w];let T=b?b.length-1:-1;for(;T>=0&&(p=b[T](this._params),p!==!0);T--)if(p instanceof Promise)return this._preserveStack(3,b,T,y,m),p;T<0&&this._csiHandlerFb(this._collect<<8|w,this._params),this.precedingJoinState=0;break;case 8:do switch(w){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(w-48)}while(++m<s&&(w=l[m])>47&&w<60);m--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const I=this._escHandlers[this._collect<<8|w];let P=I?I.length-1:-1;for(;P>=0&&(p=I[P](),p!==!0);P--)if(p instanceof Promise)return this._preserveStack(4,I,P,y,m),p;P<0&&this._escHandlerFb(this._collect<<8|w),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|w,this._params);break;case 13:for(let A=m+1;;++A)if(A>=s||(w=l[A])===24||w===26||w===27||w>127&&w<x){this._dcsParser.put(l,m,A),m=A-1;break}break;case 14:if(p=this._dcsParser.unhook(w!==24&&w!==26),p)return this._preserveStack(6,[],0,y,m),p;w===27&&(y|=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 A=m+1;;A++)if(A>=s||(w=l[A])<32||w>127&&w<x){this._oscParser.put(l,m,A),m=A-1;break}break;case 6:if(p=this._oscParser.end(w!==24&&w!==26),p)return this._preserveStack(5,[],0,y,m),p;w===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}o.EscapeSequenceParser=v},6242:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const d=c(5770),S=c(482),h=[];o.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,g){this._handlers[_]===void 0&&(this._handlers[_]=[]);const x=this._handlers[_];return x.push(g),{dispose:()=>{const v=x.indexOf(g);v!==-1&&x.splice(v,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,g,x){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(_,g,x);else this._handlerFb(this._id,"PUT",(0,S.utf32ToString)(_,g,x))}start(){this.reset(),this._state=1}put(_,g,x){if(this._state!==3){if(this._state===1)for(;g<x;){const v=_[g++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&x-g>0&&this._put(_,g,x)}}end(_,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,v=this._active.length-1,u=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,x=g,u=this._stack.fallThrough,this._stack.paused=!1),!u&&x===!1){for(;v>=0&&(x=this._active[v].end(_),x!==!0);v--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,x;v--}for(;v>=0;v--)if(x=this._active[v].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",_);this._active=h,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,g,x){this._hitLimit||(this._data+=(0,S.utf32ToString)(_,g,x),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let g=!1;if(this._hitLimit)g=!1;else if(_&&(g=this._handler(this._data),g instanceof Promise))return g.then(x=>(this._data="",this._hitLimit=!1,x));return this._data="",this._hitLimit=!1,g}}},8742:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class d{static fromArray(h){const _=new d;if(!h.length)return _;for(let g=Array.isArray(h[0])?1:0;g<h.length;++g){const x=h[g];if(Array.isArray(x))for(let v=0;v<x.length;++v)_.addSubParam(x[v]);else _.addParam(x)}return _}constructor(h=32,_=32){if(this.maxLength=h,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new d(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let _=0;_<this.length;++_){h.push(this.params[_]);const g=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];x-g>0&&h.push(Array.prototype.slice.call(this._subParams,g,x))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const _=this._subParamsIdx[h]>>8,g=255&this._subParamsIdx[h];return g-_>0?this._subParams.subarray(_,g):null}getSubParamsAll(){const h={};for(let _=0;_<this.length;++_){const g=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];x-g>0&&(h[_]=this._subParams.slice(g,x))}return h}addDigit(h){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,x=g[_-1];g[_-1]=~x?Math.min(10*x+h,c):h}}o.Params=d},5741:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,d){const S={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(S),d.dispose=()=>this._wrappedAddonDispose(S),d.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let d=-1;for(let S=0;S<this._addons.length;S++)if(this._addons[S]===c){d=S;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(d,1)}}},8771:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const d=c(3785),S=c(511);o.BufferApiView=class{constructor(h,_){this._buffer=h,this.type=_}init(h){return this._buffer=h,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(h){const _=this._buffer.lines.get(h);if(_)return new d.BufferLineApiView(_)}getNullCell(){return new S.CellData}}},3785:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const d=c(511);o.BufferLineApiView=class{constructor(S){this._line=S}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(S,h){if(!(S<0||S>=this._line.length))return h?(this._line.loadCell(S,h),h):this._line.loadCell(S,new d.CellData)}translateToString(S,h,_){return this._line.translateToString(S,h,_)}}},8285:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const d=c(8771),S=c(8460),h=c(844);class _ extends h.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new S.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(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)}}o.BufferNamespaceApi=_},7975:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,d){return this._core.registerCsiHandler(c,S=>d(S.toArray()))}addCsiHandler(c,d){return this.registerCsiHandler(c,d)}registerDcsHandler(c,d){return this._core.registerDcsHandler(c,(S,h)=>d(S,h.toArray()))}addDcsHandler(c,d){return this.registerDcsHandler(c,d)}registerEscHandler(c,d){return this._core.registerEscHandler(c,d)}addEscHandler(c,d){return this.registerEscHandler(c,d)}registerOscHandler(c,d){return this._core.registerOscHandler(c,d)}addOscHandler(c,d){return this.registerOscHandler(c,d)}}},7090:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(C,o,c){var d=this&&this.__decorate||function(u,l,s,n){var p,w=arguments.length,y=w<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,l,s,n);else for(var k=u.length-1;k>=0;k--)(p=u[k])&&(y=(w<3?p(y):w>3?p(l,s,y):p(l,s))||y);return w>3&&y&&Object.defineProperty(l,s,y),y},S=this&&this.__param||function(u,l){return function(s,n){l(s,n,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const h=c(8460),_=c(844),g=c(5295),x=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let v=o.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(u){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(u.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(u,this))}resize(u,l){this.cols=u,this.rows=l,this.buffers.resize(u,l),this._onResize.fire({cols:u,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,l=!1){const s=this.buffer;let n;n=this._cachedBlankLine,n&&n.length===this.cols&&n.getFg(0)===u.fg&&n.getBg(0)===u.bg||(n=s.getBlankLine(u,l),this._cachedBlankLine=n),n.isWrapped=l;const p=s.ybase+s.scrollTop,w=s.ybase+s.scrollBottom;if(s.scrollTop===0){const y=s.lines.isFull;w===s.lines.length-1?y?s.lines.recycle().copyFrom(n):s.lines.push(n.clone()):s.lines.splice(w+1,0,n.clone()),y?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const y=w-p+1;s.lines.shiftElements(p+1,y-1,-1),s.lines.set(w,n.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(u,l,s){const n=this.buffer;if(u<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else u+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);const p=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+u,n.ybase),0),p!==n.ydisp&&(l||this._onScroll.fire(n.ydisp))}};o.BufferService=v=d([S(0,x.IOptionsService)],v)},7994:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,d){this._charsets[c]=d,this.glevel===c&&(this.charset=d)}}},1753:function(C,o,c){var d=this&&this.__decorate||function(n,p,w,y){var k,m=arguments.length,b=m<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,p,w,y);else for(var T=n.length-1;T>=0;T--)(k=n[T])&&(b=(m<3?k(b):m>3?k(p,w,b):k(p,w))||b);return m>3&&b&&Object.defineProperty(p,w,b),b},S=this&&this.__param||function(n,p){return function(w,y){p(w,y,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const h=c(2585),_=c(8460),g=c(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:n=>n.button!==4&&n.action===1&&(n.ctrl=!1,n.alt=!1,n.shift=!1,!0)},VT200:{events:19,restrict:n=>n.action!==32},DRAG:{events:23,restrict:n=>n.action!==32||n.button!==3},ANY:{events:31,restrict:n=>!0}};function v(n,p){let w=(n.ctrl?16:0)|(n.shift?4:0)|(n.alt?8:0);return n.button===4?(w|=64,w|=n.action):(w|=3&n.button,4&n.button&&(w|=64),8&n.button&&(w|=128),n.action===32?w|=32:n.action!==0||p||(w|=3)),w}const u=String.fromCharCode,l={DEFAULT:n=>{const p=[v(n,!1)+32,n.col+32,n.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${u(p[0])}${u(p[1])}${u(p[2])}`},SGR:n=>{const p=n.action===0&&n.button!==4?"m":"M";return`\x1B[<${v(n,!0)};${n.col};${n.row}${p}`},SGR_PIXELS:n=>{const p=n.action===0&&n.button!==4?"m":"M";return`\x1B[<${v(n,!0)};${n.x};${n.y}${p}`}};let s=o.CoreMouseService=class extends g.Disposable{constructor(n,p){super(),this._bufferService=n,this._coreService=p,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const w of Object.keys(x))this.addProtocol(w,x[w]);for(const w of Object.keys(l))this.addEncoding(w,l[w]);this.reset()}addProtocol(n,p){this._protocols[n]=p}addEncoding(n,p){this._encodings[n]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(n){if(!this._protocols[n])throw new Error(`unknown protocol "${n}"`);this._activeProtocol=n,this._onProtocolChange.fire(this._protocols[n].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(n){if(!this._encodings[n])throw new Error(`unknown encoding "${n}"`);this._activeEncoding=n}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(n){if(n.col<0||n.col>=this._bufferService.cols||n.row<0||n.row>=this._bufferService.rows||n.button===4&&n.action===32||n.button===3&&n.action!==32||n.button!==4&&(n.action===2||n.action===3)||(n.col++,n.row++,n.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,n,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(n))return!1;const p=this._encodings[this._activeEncoding](n);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=n,!0}explainEvents(n){return{down:!!(1&n),up:!!(2&n),drag:!!(4&n),move:!!(8&n),wheel:!!(16&n)}}_equalEvents(n,p,w){if(w){if(n.x!==p.x||n.y!==p.y)return!1}else if(n.col!==p.col||n.row!==p.row)return!1;return n.button===p.button&&n.action===p.action&&n.ctrl===p.ctrl&&n.alt===p.alt&&n.shift===p.shift}};o.CoreMouseService=s=d([S(0,h.IBufferService),S(1,h.ICoreService)],s)},6975:function(C,o,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,m=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(m=(k<3?y(m):k>3?y(n,p,m):y(n,p))||m);return k>3&&m&&Object.defineProperty(n,p,m),m},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const h=c(1439),_=c(8460),g=c(844),x=c(2585),v=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=o.CoreService=class extends g.Disposable{constructor(s,n,p){super(),this._bufferService=s,this._logService=n,this._optionsService=p,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(u)}reset(){this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(u)}triggerDataEvent(s,n=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;n&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),n&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(w=>w.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(n=>n.charCodeAt(0))),this._onBinary.fire(s))}};o.CoreService=l=d([S(0,x.IBufferService),S(1,x.ILogService),S(2,x.IOptionsService)],l)},9074:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const d=c(8055),S=c(8460),h=c(844),_=c(6106);let g=0,x=0;class v extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList(s=>s==null?void 0:s.marker.line),this._onDecorationRegistered=this.register(new S.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new S.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const n=new u(s);if(n){const p=n.marker.onDispose(()=>n.dispose());n.onDispose(()=>{n&&(this._decorations.delete(n)&&this._onDecorationRemoved.fire(n),p.dispose())}),this._decorations.insert(n),this._onDecorationRegistered.fire(n)}return n}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,n,p){let w=0,y=0;for(const k of this._decorations.getKeyIterator(n))w=k.options.x??0,y=w+(k.options.width??1),s>=w&&s<y&&(!p||(k.options.layer??"bottom")===p)&&(yield k)}forEachDecorationAtCell(s,n,p,w){this._decorations.forEachByKey(n,y=>{g=y.options.x??0,x=g+(y.options.width??1),s>=g&&s<x&&(!p||(y.options.layer??"bottom")===p)&&w(y)})}}o.DecorationService=v;class u extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new S.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new S.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const d=c(2585),S=c(8343);class h{constructor(...g){this._entries=new Map;for(const[x,v]of g)this.set(x,v)}set(g,x){const v=this._entries.get(g);return this._entries.set(g,x),v}forEach(g){for(const[x,v]of this._entries.entries())g(x,v)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}o.ServiceCollection=h,o.InstantiationService=class{constructor(){this._services=new h,this._services.set(d.IInstantiationService,this)}setService(_,g){this._services.set(_,g)}getService(_){return this._services.get(_)}createInstance(_,...g){const x=(0,S.getServiceDependencies)(_).sort((l,s)=>l.index-s.index),v=[];for(const l of x){const s=this._services.get(l.id);if(!s)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${l.id}.`);v.push(s)}const u=x.length>0?x[0].index:g.length;if(g.length!==u)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${u+1} conflicts with ${g.length} static arguments`);return new _(...g,...v)}}},7866:function(C,o,c){var d=this&&this.__decorate||function(u,l,s,n){var p,w=arguments.length,y=w<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,l,s,n);else for(var k=u.length-1;k>=0;k--)(p=u[k])&&(y=(w<3?p(y):w>3?p(l,s,y):p(l,s))||y);return w>3&&y&&Object.defineProperty(l,s,y),y},S=this&&this.__param||function(u,l){return function(s,n){l(s,n,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const h=c(844),_=c(2585),g={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let x,v=o.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),x=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let l=0;l<u.length;l++)typeof u[l]=="function"&&(u[l]=u[l]())}_log(u,l,s){this._evalLazyOptionalParams(s),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...s)}trace(u,...l){var s;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,u,l)}debug(u,...l){var s;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,u,l)}info(u,...l){var s;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,u,l)}warn(u,...l){var s;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,u,l)}error(u,...l){var s;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,u,l)}};o.LogService=v=d([S(0,_.IOptionsService)],v),o.setTraceLogger=function(u){x=u},o.traceCall=function(u,l,s){if(typeof s.value!="function")throw new Error("not supported");const n=s.value;s.value=function(...p){if(x.logLevel!==_.LogLevelEnum.TRACE)return n.apply(this,p);x.trace(`GlyphRenderer#${n.name}(${p.map(y=>JSON.stringify(y)).join(", ")})`);const w=n.apply(this,p);return x.trace(`GlyphRenderer#${n.name} return`,w),w}}},7302:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const d=c(8460),S=c(844),h=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends S.Disposable{constructor(v){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const u={...o.DEFAULT_OPTIONS};for(const l in v)if(l in u)try{const s=v[l];u[l]=this._sanitizeAndValidateOption(l,s)}catch(s){console.error(s)}this.rawOptions=u,this.options={...u},this._setupOptions(),this.register((0,S.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(v,u){return this.onOptionChange(l=>{l===v&&u(this.rawOptions[v])})}onMultipleOptionChange(v,u){return this.onOptionChange(l=>{v.indexOf(l)!==-1&&u()})}_setupOptions(){const v=l=>{if(!(l in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},u=(l,s)=>{if(!(l in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);s=this._sanitizeAndValidateOption(l,s),this.rawOptions[l]!==s&&(this.rawOptions[l]=s,this._onOptionChange.fire(l))};for(const l in this.rawOptions){const s={get:v.bind(this,l),set:u.bind(this,l)};Object.defineProperty(this.options,l,s)}}_sanitizeAndValidateOption(v,u){switch(v){case"cursorStyle":if(u||(u=o.DEFAULT_OPTIONS[v]),!function(l){return l==="block"||l==="underline"||l==="bar"}(u))throw new Error(`"${u}" is not a valid value for ${v}`);break;case"wordSeparator":u||(u=o.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=_.includes(u)?u:o.DEFAULT_OPTIONS[v];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${v} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${v} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}o.OptionsService=g},2660:function(C,o,c){var d=this&&this.__decorate||function(g,x,v,u){var l,s=arguments.length,n=s<3?x:u===null?u=Object.getOwnPropertyDescriptor(x,v):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(g,x,v,u);else for(var p=g.length-1;p>=0;p--)(l=g[p])&&(n=(s<3?l(n):s>3?l(x,v,n):l(x,v))||n);return s>3&&n&&Object.defineProperty(x,v,n),n},S=this&&this.__param||function(g,x){return function(v,u){x(v,u,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const h=c(2585);let _=o.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const x=this._bufferService.buffer;if(g.id===void 0){const p=x.addMarker(x.ybase+x.y),w={data:g,id:this._nextId++,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(w,p)),this._dataByLinkId.set(w.id,w),w.id}const v=g,u=this._getEntryIdKey(v),l=this._entriesWithId.get(u);if(l)return this.addLineToLink(l.id,x.ybase+x.y),l.id;const s=x.addMarker(x.ybase+x.y),n={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(n,s)),this._entriesWithId.set(n.key,n),this._dataByLinkId.set(n.id,n),n.id}addLineToLink(g,x){const v=this._dataByLinkId.get(g);if(v&&v.lines.every(u=>u.line!==x)){const u=this._bufferService.buffer.addMarker(x);v.lines.push(u),u.onDispose(()=>this._removeMarkerFromLink(v,u))}}getLinkData(g){var x;return(x=this._dataByLinkId.get(g))==null?void 0:x.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,x){const v=g.lines.indexOf(x);v!==-1&&(g.lines.splice(v,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};o.OscLinkService=_=d([S(0,h.IBufferService)],_)},8343:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",d="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(S){return S[d]||[]},o.createDecorator=function(S){if(o.serviceRegistry.has(S))return o.serviceRegistry.get(S);const h=function(_,g,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,u,l){u[c]===u?u[d].push({id:v,index:l}):(u[d]=[{id:v,index:l}],u[c]=u)})(h,_,x)};return h.toString=()=>S,o.serviceRegistry.set(S,h),h}},2585:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const d=c(8343);var S;o.IBufferService=(0,d.createDecorator)("BufferService"),o.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),o.ICoreService=(0,d.createDecorator)("CoreService"),o.ICharsetService=(0,d.createDecorator)("CharsetService"),o.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"}(S||(o.LogLevelEnum=S={})),o.ILogService=(0,d.createDecorator)("LogService"),o.IOptionsService=(0,d.createDecorator)("OptionsService"),o.IOscLinkService=(0,d.createDecorator)("OscLinkService"),o.IUnicodeService=(0,d.createDecorator)("UnicodeService"),o.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const d=c(8460),S=c(225);class h{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,x,v=!1){return(16777215&g)<<3|(3&x)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const g=new S.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let x=0,v=0;const u=g.length;for(let l=0;l<u;++l){let s=g.charCodeAt(l);if(55296<=s&&s<=56319){if(++l>=u)return x+this.wcwidth(s);const w=g.charCodeAt(l);56320<=w&&w<=57343?s=1024*(s-55296)+w-56320+65536:x+=this.wcwidth(w)}const n=this.charProperties(s,v);let p=h.extractWidth(n);h.extractShouldJoin(n)&&(p-=h.extractWidth(v)),x+=p,v=n}return x}charProperties(g,x){return this._activeProvider.charProperties(g,x)}}o.UnicodeService=h}},i={};function a(C){var o=i[C];if(o!==void 0)return o.exports;var c=i[C]={exports:{}};return r[C].call(c.exports,c,c.exports,a),c.exports}var f={};return(()=>{var C=f;Object.defineProperty(C,"__esModule",{value:!0}),C.Terminal=void 0;const o=a(9042),c=a(3236),d=a(844),S=a(5741),h=a(8285),_=a(7975),g=a(7090),x=["cols","rows"];class v extends d.Disposable{constructor(l){super(),this._core=this.register(new c.Terminal(l)),this._addonManager=this.register(new S.AddonManager),this._publicOptions={...this._core.options};const s=p=>this._core.options[p],n=(p,w)=>{this._checkReadonlyOptions(p),this._core.options[p]=w};for(const p in this._core.options){const w={get:s.bind(this,p),set:n.bind(this,p)};Object.defineProperty(this._publicOptions,p,w)}}_checkReadonlyOptions(l){if(x.includes(l))throw new Error(`Option "${l}" 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 _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new g.UnicodeApi(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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const l=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:l.applicationCursorKeys,applicationKeypadMode:l.applicationKeypad,bracketedPasteMode:l.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:l.origin,reverseWraparoundMode:l.reverseWraparound,sendFocusMode:l.sendFocus,wraparoundMode:l.wraparound}}get options(){return this._publicOptions}set options(l){for(const s in l)this._publicOptions[s]=l[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(l,s=!0){this._core.input(l,s)}resize(l,s){this._verifyIntegers(l,s),this._core.resize(l,s)}open(l){this._core.open(l)}attachCustomKeyEventHandler(l){this._core.attachCustomKeyEventHandler(l)}attachCustomWheelEventHandler(l){this._core.attachCustomWheelEventHandler(l)}registerLinkProvider(l){return this._core.registerLinkProvider(l)}registerCharacterJoiner(l){return this._checkProposedApi(),this._core.registerCharacterJoiner(l)}deregisterCharacterJoiner(l){this._checkProposedApi(),this._core.deregisterCharacterJoiner(l)}registerMarker(l=0){return this._verifyIntegers(l),this._core.registerMarker(l)}registerDecoration(l){return this._checkProposedApi(),this._verifyPositiveIntegers(l.x??0,l.width??0,l.height??0),this._core.registerDecoration(l)}hasSelection(){return this._core.hasSelection()}select(l,s,n){this._verifyIntegers(l,s,n),this._core.select(l,s,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(l,s){this._verifyIntegers(l,s),this._core.selectLines(l,s)}dispose(){super.dispose()}scrollLines(l){this._verifyIntegers(l),this._core.scrollLines(l)}scrollPages(l){this._verifyIntegers(l),this._core.scrollPages(l)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(l){this._verifyIntegers(l),this._core.scrollToLine(l)}clear(){this._core.clear()}write(l,s){this._core.write(l,s)}writeln(l,s){this._core.write(l),this._core.write(`\r
|
|
48
|
-
`,s)}paste(l){this._core.paste(l)}refresh(l,s){this._verifyIntegers(l,s),this._core.refresh(l,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(l){this._addonManager.loadAddon(this,l)}static get strings(){return o}_verifyIntegers(...l){for(const s of l)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...l){for(const s of l)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}C.Terminal=v})(),f})())})(Bu);var kf=Bu.exports,ju={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const f=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(f._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,f=a._renderService.dimensions;if(f.css.cell.width===0||f.css.cell.height===0)return;const C=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),d=Math.max(0,parseInt(o.getPropertyValue("width"))),S=window.getComputedStyle(this._terminal.element),h=c-(parseInt(S.getPropertyValue("padding-top"))+parseInt(S.getPropertyValue("padding-bottom"))),_=d-(parseInt(S.getPropertyValue("padding-right"))+parseInt(S.getPropertyValue("padding-left")))-C;return{cols:Math.max(2,Math.floor(_/f.css.cell.width)),rows:Math.max(1,Math.floor(h/f.css.cell.height))}}}})(),r})())})(ju);var bf=ju.exports,Hu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(C,o)=>{function c(S){try{const h=new URL(S),_=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return S.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(S,h,_,g={}){this._terminal=S,this._regex=h,this._handler=_,this._options=g}provideLinks(S,h){const _=d.computeLink(S,this._regex,this._terminal,this._handler);h(this._addCallbacks(_))}_addCallbacks(S){return S.map(h=>(h.leave=this._options.leave,h.hover=(_,g)=>{if(this._options.hover){const{range:x}=h;this._options.hover(_,g,x)}},h))}};class d{static computeLink(h,_,g,x){const v=new RegExp(_.source,(_.flags||"")+"g"),[u,l]=d._getWindowedLineStrings(h-1,g),s=u.join("");let n;const p=[];for(;n=v.exec(s);){const w=n[0];if(!c(w))continue;const[y,k]=d._mapStrIdx(g,l,0,n.index),[m,b]=d._mapStrIdx(g,y,k,w.length);if(y===-1||k===-1||m===-1||b===-1)continue;const T={start:{x:k+1,y:y+1},end:{x:b,y:m+1}};p.push({range:T,text:w,activate:x})}return p}static _getWindowedLineStrings(h,_){let g,x=h,v=h,u=0,l="";const s=[];if(g=_.buffer.active.getLine(h)){const n=g.translateToString(!0);if(g.isWrapped&&n[0]!==" "){for(u=0;(g=_.buffer.active.getLine(--x))&&u<2048&&(l=g.translateToString(!0),u+=l.length,s.push(l),g.isWrapped&&l.indexOf(" ")===-1););s.reverse()}for(s.push(n),u=0;(g=_.buffer.active.getLine(++v))&&g.isWrapped&&u<2048&&(l=g.translateToString(!0),u+=l.length,s.push(l),l.indexOf(" ")===-1););}return[s,x]}static _mapStrIdx(h,_,g,x){const v=h.buffer.active,u=v.getNullCell();let l=g;for(;x;){const s=v.getLine(_);if(!s)return[-1,-1];for(let n=l;n<s.length;++n){s.getCell(n,u);const p=u.getChars();if(u.getWidth()&&(x-=p.length||1,n===s.length-1&&p==="")){const w=v.getLine(_+1);w&&w.isWrapped&&(w.getCell(0,u),u.getWidth()===2&&(x+=1))}if(x<0)return[_,n]}_++,l=0}return[_,l]}}o.LinkComputer=d}},i={};function a(C){var o=i[C];if(o!==void 0)return o.exports;var c=i[C]={exports:{}};return r[C](c,c.exports,a),c.exports}var f={};return(()=>{var C=f;Object.defineProperty(C,"__esModule",{value:!0}),C.WebLinksAddon=void 0;const o=a(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(S,h){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}C.WebLinksAddon=class{constructor(S=d,h={}){this._handler=S,this._options=h}activate(S){this._terminal=S;const h=this._options,_=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,_,this._handler,h))}dispose(){var S;(S=this._linkProvider)==null||S.dispose()}}})(),f})())})(Hu);var Ef=Hu.exports;function Sa(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Rf(e){if(!e)return"0s";if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m ${e%60}s`;const t=Math.floor(e/3600),r=Math.floor(e%3600/60);return`${t}h ${r}m`}function Lf({agent:e,subscribeTerminal:t,injectMessage:r,sendRaw:i,resizeTerminal:a,openAgentTerminal:f,returnAgentTerminal:C,onClose:o}){const c=q.useRef(null),d=q.useRef(null),[S,h]=q.useState(420),[_,g]=q.useState(""),x=q.useRef(!1),v=q.useRef(null),u=q.useRef(o);u.current=o;const l=p=>{const w=p.clientY,y=S;x.current=!0;const k=b=>{h(Math.max(180,Math.min(window.innerHeight*.8,y-(b.clientY-w))))},m=()=>{x.current=!1,window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",m)};window.addEventListener("mousemove",k),window.addEventListener("mouseup",m)};q.useEffect(()=>{if(!c.current||!e)return;const p=e.color||"#F5A623",w=new kf.Terminal({theme:{background:"#030507",foreground:"#E8E8F0",cursor:"#F5A623",selectionBackground:p+"40"},fontFamily:"'DM Mono', monospace",fontSize:12,lineHeight:1.3,cursorBlink:!0,scrollback:5e3}),y=new bf.FitAddon,k=new Ef.WebLinksAddon;w.loadAddon(y),w.loadAddon(k),w.open(c.current),d.current=w;const m=()=>{if(d.current){try{y.fit()}catch{return}w.cols>0&&w.rows>0&&a(e.id,w.cols,w.rows)}};requestAnimationFrame(()=>{var A;m();const P=(A=document.activeElement)==null?void 0:A.tagName;(!P||P==="BODY"||P==="DIV")&&w.focus()}),w.onData(P=>{i(e.id,P)});const b=t(e.id,P=>{w.write(P)}),T=new ResizeObserver(()=>{v.current&&window.clearTimeout(v.current),v.current=window.setTimeout(m,50)});T.observe(c.current);const I=P=>{P.key==="Escape"&&u.current()};return window.addEventListener("keydown",I),()=>{window.removeEventListener("keydown",I),T.disconnect(),v.current&&(window.clearTimeout(v.current),v.current=null),b(),w.dispose(),d.current=null}},[e==null?void 0:e.id]);const s=p=>{p.key==="Enter"&&_.trim()&&!e.bridgeActive&&(r(e.id,_.trim()),g(""))};if(!e)return null;const n=e.color||"#F5A623";return L.jsxs("div",{style:{height:S,display:"flex",flexDirection:"column",background:"var(--bg1)",borderTop:"1px solid var(--border)"},children:[L.jsx("div",{onMouseDown:l,style:{height:6,cursor:"ns-resize",background:"transparent",borderTop:"2px solid var(--border)",flexShrink:0}}),L.jsxs("div",{style:{height:36,minHeight:36,display:"flex",alignItems:"center",gap:10,padding:"0 12px",borderBottom:"1px solid var(--border)",fontSize:11},children:[L.jsx("button",{onClick:o,style:{color:"var(--text2)",fontSize:11,padding:"2px 6px",background:"var(--bg2)",borderRadius:3,border:"1px solid var(--border)"},children:"ESC"}),L.jsx("span",{style:{color:n,fontSize:14},children:e.icon}),L.jsx("span",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:13},children:e.name}),L.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:e.status==="active"?"var(--green)":e.status==="blocked"?"var(--red)":"var(--text3)",animation:e.status==="active"?"pulse 2s infinite":"none"}}),L.jsxs("div",{style:{flex:1,display:"flex",justifyContent:"center",gap:24,color:"var(--text2)"},children:[L.jsxs("span",{children:["Task: ",L.jsx("span",{style:{color:n},children:e.currentTask||"—"})]}),L.jsxs("span",{children:["Tokens: ",Sa(e.tokens||0)," / 200k"]}),L.jsxs("span",{children:["Total: ",Sa(e.aggregatedTokens||0)]}),L.jsxs("span",{children:["Uptime: ",Rf(e.uptime)]})]}),e.status==="active"&&!e.bridgeActive&&L.jsx("button",{onClick:()=>f(e.id),style:{color:"var(--text2)",fontSize:11,padding:"3px 8px",background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4},children:"Open in Terminal"}),e.bridgeActive&&L.jsx("button",{onClick:()=>C(e.id),style:{color:"var(--amber)",fontSize:11,padding:"3px 8px",background:"rgba(245, 166, 35, 0.12)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:4},children:"Return to Ban Kan"}),L.jsx("button",{onClick:o,style:{color:"var(--text3)",fontSize:14},children:"✕"})]}),L.jsx("div",{ref:c,style:{flex:1,overflow:"hidden",padding:4}}),L.jsxs("div",{style:{padding:"6px 12px",borderTop:"1px solid var(--border)"},children:[L.jsx("input",{type:"text",value:_,placeholder:e.bridgeActive?"Input moved to Terminal.app while bridged...":"Send message to agent...",disabled:e.status!=="active"||e.bridgeActive,onChange:p=>g(p.target.value),onKeyDown:s,style:{width:"100%",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,padding:"5px 10px",fontSize:12,caretColor:n,opacity:e.status==="active"&&!e.bridgeActive?1:.55}}),e.bridgeActive&&L.jsx("div",{style:{marginTop:6,fontSize:11,color:"var(--text3)"},children:"Terminal.app currently owns input for this live session. Type `/return` there or use the button above to hand control back."}),e.status!=="active"&&!e.bridgeActive&&L.jsx("div",{style:{marginTop:6,fontSize:11,color:"var(--text3)"},children:"Agent input is unavailable because the session is not running. Resolve the blocker, then retry the task."})]})]})}function Df({initialPath:e,onSelect:t,onClose:r}){const[i,a]=q.useState(e||""),[f,C]=q.useState(e||""),[o,c]=q.useState([]),[d,S]=q.useState(null),[h,_]=q.useState(null),[g,x]=q.useState(!1),v=async n=>{x(!0),_(null);try{const p=n?`/api/browse-dir?path=${encodeURIComponent(n)}`:"/api/browse-dir",w=await fetch(p);if(!w.ok){const k=await w.json();_(k.error||"Failed to browse directory"),x(!1);return}const y=await w.json();a(y.current),C(y.current),S(y.parent),c(y.dirs)}catch{_("Failed to connect to server")}x(!1)};q.useEffect(()=>{v(e||"")},[e]);const u=n=>{v(i+"/"+n)},l=()=>{d&&v(d)},s=n=>{n.key==="Enter"&&v(f)};return L.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:200},children:L.jsxs("div",{onClick:n=>n.stopPropagation(),style:{width:500,maxHeight:"70vh",display:"flex",flexDirection:"column",padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[L.jsx("h2",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:16,marginBottom:16},children:"Select Directory"}),L.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12},children:[L.jsx("input",{type:"text",value:f,onChange:n=>C(n.target.value),onKeyDown:s,style:{flex:1,padding:"6px 10px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)"}}),L.jsx("button",{onClick:()=>v(f),style:{padding:"6px 12px",fontSize:12,background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)"},children:"Go"})]}),h&&L.jsx("div",{style:{color:"var(--red)",fontSize:11,marginBottom:8},children:h}),L.jsx("div",{style:{flex:1,overflowY:"auto",minHeight:200,border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)"},children:g?L.jsx("div",{style:{padding:16,color:"var(--text3)",fontSize:12,textAlign:"center"},children:"Loading..."}):L.jsxs(L.Fragment,{children:[d&&L.jsxs("div",{onClick:l,style:{padding:"8px 12px",fontSize:12,cursor:"pointer",color:"var(--text2)",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:6},onMouseEnter:n=>n.currentTarget.style.background="var(--bg2)",onMouseLeave:n=>n.currentTarget.style.background="transparent",children:[L.jsx("span",{style:{fontSize:14},children:".."}),L.jsx("span",{style:{color:"var(--text3)"},children:"(parent)"})]}),o.length===0&&!d&&L.jsx("div",{style:{padding:16,color:"var(--text3)",fontSize:12,textAlign:"center"},children:"No subdirectories"}),o.map(n=>L.jsxs("div",{onClick:()=>u(n),style:{padding:"8px 12px",fontSize:12,cursor:"pointer",color:"var(--text)",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:6},onMouseEnter:p=>p.currentTarget.style.background="var(--bg2)",onMouseLeave:p=>p.currentTarget.style.background="transparent",children:[L.jsx("span",{style:{color:"var(--amber)"},children:"📁"}),n]},n))]})}),L.jsxs("div",{style:{marginTop:12,fontSize:11,color:"var(--text3)"},children:["Selected: ",L.jsx("span",{style:{color:"var(--text)"},children:i})]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:16},children:[L.jsx("button",{onClick:r,style:{padding:"8px 16px",color:"var(--text2)",fontSize:12},children:"Cancel"}),L.jsx("button",{onClick:()=>t(i),style:{padding:"8px 20px",background:"var(--amber)",color:"#000",borderRadius:4,fontWeight:500,fontSize:12},children:"Select"})]})]})})}const Tf=/^(?:.*(?:⏵⏵bypass|bypasspermission|shift\+tab\s*to\s*cycle)|.*Opus\s*4\.\d.*(?:│|context)|.*Claude(?:Code|Max)|.*▐▛|.*▝▜|.*[░▓█]{3,}|[─━═]{10,}|^\s*[❯›]\s*$|.*\.data\/workspaces\/T-)/i,Af=/\s*[❯›]\s*[─━═]{4,}.*$/,If=/[─━═]{10,}/g;function ya(e){return typeof e!="string"?e:e.split(`
|
|
49
|
-
`).map(t=>t.replace(
|
|
50
|
-
`)}const Kr={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"},Ca={planning:"var(--steel2)",awaiting_approval:"var(--amber)",queued:"var(--text3)",workspace_setup:"var(--steel2)",implementing:"var(--green)",review:"#A78BFA",blocked:"var(--red)",paused:"var(--amber)",backlog:"var(--text3)",aborted:"var(--text3)",done:"var(--green)"};function Mf(e,t=120){if(typeof e!="string")return"";const r=e.replace(/\s+/g," ").trim();return r.length<=t?r:r.slice(0,t-1).trimEnd()+"…"}function Pf(e=0){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e||0)}function Bf(e,t){if(!e||!t)return null;const r=new Date(e).getTime(),i=new Date(t).getTime();if(Number.isNaN(r)||Number.isNaN(i)||i<r)return null;const a=Math.max(1,Math.floor((i-r)/6e4)),f=Math.floor(a/(60*24)),C=Math.floor(a%(60*24)/60),o=a%60;return f>0?C>0?`${f}d ${C}h`:`${f}d`:C>0?o>0?`${C}h ${o}m`:`${C}h`:`${o}m`}function Of({task:e,repos:t=[],onClose:r,onApprove:i,onReject:a,onPause:f,onResume:C,onEdit:o,onAbort:c,onReset:d,onRetry:S,onDelete:h,onOpenWorkspace:_}){const[g,x]=q.useState(!1),[v,u]=q.useState(e.title),[l,s]=q.useState(e.description||""),[n,p]=q.useState(e.priority),[w,y]=q.useState(e.repoPath||""),[k,m]=q.useState(!1),[b,T]=q.useState(!1),[I,P]=q.useState(!1),[A,N]=q.useState(""),[W,V]=q.useState(!1),[X,j]=q.useState({}),E=!["done","paused","aborted"].includes(e.status),D=e.status==="paused",M=!["done","aborted"].includes(e.status),B=e.status!=="done",K=e.status==="blocked",F=!!(e.workspacePath&&_),Y=Bf(e.startedAt,e.completedAt),U=Array.isArray(e.sessionHistory)?e.sessionHistory.slice().reverse():[],O=()=>{o(e.id,{title:v,description:l,priority:n,repoPath:w}),x(!1)},R=()=>{A.trim()&&(a(e.id,A.trim()),P(!1),N(""))},$=z=>{j(J=>({...J,[z]:!J[z]}))},H={fontSize:10,fontWeight:600,color:"var(--text3)",letterSpacing:1,textTransform:"uppercase",marginBottom:4},Q={fontSize:12,color:"var(--text)",marginBottom:14};return L.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:L.jsxs("div",{onClick:z=>z.stopPropagation(),style:{width:540,maxHeight:"80vh",overflowY:"auto",padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[L.jsx("span",{style:{fontSize:12,color:"var(--text3)"},children:e.id}),L.jsx("span",{style:{padding:"2px 8px",borderRadius:3,fontSize:10,background:(Ca[e.status]||"var(--text3)")+"20",color:Ca[e.status]||"var(--text3)"},children:e.status.replace(/_/g," ")})]}),L.jsx("button",{onClick:r,style:{color:"var(--text3)",fontSize:16},children:"✕"})]}),g?L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Title"}),L.jsx("input",{type:"text",value:v,onChange:z=>u(z.target.value),style:{width:"100%",padding:"6px 10px",fontSize:12}})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Description"}),L.jsx("textarea",{value:l,onChange:z=>s(z.target.value),rows:3,style:{width:"100%",padding:"6px 10px",fontSize:12,resize:"vertical"}})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Priority"}),L.jsx("div",{style:{display:"flex",gap:6},children:["critical","high","medium","low"].map(z=>L.jsx("button",{onClick:()=>p(z),style:{padding:"4px 10px",borderRadius:4,fontSize:11,border:`1px solid ${n===z?Kr[z]:"var(--border)"}`,background:n===z?Kr[z]+"20":"transparent",color:n===z?Kr[z]:"var(--text2)",textTransform:"capitalize"},children:z},z))})]}),t.length>0&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Repository"}),L.jsxs("select",{value:w,onChange:z=>y(z.target.value),style:{width:"100%",padding:"6px 10px",fontSize:12},children:[L.jsx("option",{value:"",children:"No repository"}),t.map(z=>L.jsx("option",{value:z,children:z},z))]})]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[L.jsx("button",{onClick:()=>x(!1),style:{padding:"6px 14px",color:"var(--text2)",fontSize:12},children:"Cancel"}),L.jsx("button",{onClick:O,style:{padding:"6px 16px",background:"var(--amber)",color:"#000",borderRadius:4,fontWeight:500,fontSize:12},children:"Save"})]})]}):L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Title"}),L.jsx("div",{style:{...Q,fontSize:14},children:e.title})]}),L.jsxs("div",{style:{display:"flex",gap:20,marginBottom:14},children:[L.jsxs("div",{children:[L.jsx("div",{style:H,children:"Priority"}),L.jsx("span",{style:{padding:"2px 8px",borderRadius:3,fontSize:11,background:(Kr[e.priority]||"var(--text3)")+"20",color:Kr[e.priority]||"var(--text3)",textTransform:"capitalize"},children:e.priority})]}),e.repoPath&&L.jsxs("div",{style:{flex:1},children:[L.jsx("div",{style:H,children:"Repository"}),L.jsx("div",{style:{fontSize:11,color:"var(--text2)",wordBreak:"break-all"},children:e.repoPath})]})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Total Tokens"}),L.jsx("div",{style:{...Q,fontFamily:"var(--font-mono)"},children:Pf(e.totalTokens||0)})]}),e.description&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Description"}),L.jsx("div",{style:Q,children:e.description})]}),e.branch&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Branch"}),L.jsx("div",{style:{fontSize:12,color:"var(--steel2)"},children:e.branch})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Review Cycles"}),L.jsxs("div",{style:{fontSize:12,color:"var(--text2)"},children:[e.reviewCycleCount||0," / 3"]})]}),Y&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Total Time"}),L.jsx("div",{style:{fontSize:12,color:"var(--text2)"},children:Y})]}),e.prUrl&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Pull Request"}),L.jsx("a",{href:e.prUrl,target:"_blank",rel:"noopener noreferrer",style:{fontSize:12,color:"#60A5FA"},children:e.prUrl})]}),e.blockedReason&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Blocked Reason"}),L.jsx("div",{title:e.blockedReason,style:{fontSize:12,color:"var(--red)",lineHeight:1.5},children:Mf(e.blockedReason)})]}),e.plan&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsxs("div",{onClick:()=>m(!k),style:{...H,cursor:"pointer",display:"flex",alignItems:"center",gap:4,userSelect:"none"},children:[k?"▼":"▶"," Plan"]}),k&&L.jsx("pre",{style:{fontSize:11,color:"var(--text2)",background:"var(--bg)",padding:10,borderRadius:4,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:200,overflowY:"auto",border:"1px solid var(--border)"},children:ya(e.plan)})]}),e.review&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsxs("div",{onClick:()=>T(!b),style:{...H,cursor:"pointer",display:"flex",alignItems:"center",gap:4,userSelect:"none"},children:[b?"▼":"▶"," Review"]}),b&&L.jsx("pre",{style:{fontSize:11,color:"var(--text2)",background:"var(--bg)",padding:10,borderRadius:4,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:200,overflowY:"auto",border:"1px solid var(--border)"},children:ya(e.review)})]}),U.length>0&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Completed Sessions"}),L.jsx("div",{style:{border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)",overflow:"hidden"},children:U.map((z,J)=>{const ie=!!X[z.id];return L.jsxs("div",{style:{borderBottom:J<U.length-1?"1px solid var(--border)":"none"},children:[L.jsxs("button",{onClick:()=>$(z.id),style:{width:"100%",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,background:"transparent",color:"var(--text)",fontSize:11,textAlign:"left"},children:[L.jsxs("span",{children:[ie?"▼":"▶"," ",z.agentName," · ",z.stage," · ",z.outcome]}),L.jsx("span",{style:{color:"var(--text3)",flexShrink:0},children:new Date(z.finishedAt).toLocaleString()})]}),ie&&L.jsx("pre",{style:{margin:0,padding:10,fontSize:11,color:"var(--text2)",background:"var(--bg1)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:220,overflowY:"auto",borderTop:"1px solid var(--border)"},children:z.transcript||"[No transcript captured]"})]},z.id||J)})})]}),e.log&&e.log.length>0&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"History"}),L.jsx("div",{style:{maxHeight:120,overflowY:"auto",border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)"},children:e.log.slice().reverse().map((z,J)=>L.jsxs("div",{style:{padding:"4px 10px",fontSize:10,borderBottom:"1px solid var(--border)",display:"flex",gap:8},children:[L.jsx("span",{style:{color:"var(--text3)",flexShrink:0},children:new Date(z.ts).toLocaleTimeString()}),L.jsx("span",{style:{color:"var(--text2)"},children:z.message})]},J))})]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",borderTop:"1px solid var(--border)",paddingTop:16,marginTop:8,flexWrap:"wrap"},children:[L.jsx("button",{onClick:()=>{u(e.title),s(e.description||""),p(e.priority),y(e.repoPath||""),x(!0)},style:{padding:"6px 14px",fontSize:12,background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)"},children:"Edit"}),E&&L.jsx("button",{onClick:()=>f(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(245, 166, 35, 0.15)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:4,color:"var(--amber)"},children:"Pause"}),D&&L.jsx("button",{onClick:()=>C(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(61, 220, 132, 0.15)",border:"1px solid rgba(61, 220, 132, 0.3)",borderRadius:4,color:"var(--green)"},children:"Resume"}),e.status==="awaiting_approval"&&L.jsxs(L.Fragment,{children:[L.jsx("button",{onClick:()=>i(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(61, 220, 132, 0.15)",borderRadius:4,color:"var(--green)"},children:"Approve"}),L.jsx("button",{onClick:()=>P(!0),style:{padding:"6px 14px",fontSize:12,background:"rgba(255, 77, 77, 0.1)",borderRadius:4,color:"var(--text2)"},children:"Revise"})]}),K&&S&&L.jsx("button",{onClick:()=>S(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(100, 160, 255, 0.15)",border:"1px solid rgba(100, 160, 255, 0.3)",borderRadius:4,color:"var(--steel2)"},children:"Retry"}),F&&L.jsx("button",{onClick:()=>_(e.id),title:e.workspacePath,style:{padding:"6px 14px",fontSize:12,background:"rgba(96, 165, 250, 0.12)",border:"1px solid rgba(96, 165, 250, 0.3)",borderRadius:4,color:"#60A5FA"},children:"Open in VSCode"}),B&&d&&L.jsx("button",{onClick:()=>d(e.id),title:"Delete the local workspace and clear plan, review, branch, PR, blockers, and progress before returning to backlog.",style:{padding:"6px 14px",fontSize:12,background:"rgba(245, 166, 35, 0.12)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:4,color:"var(--amber)"},children:"Reset to Backlog"}),M&&c&&L.jsx("button",{onClick:()=>c(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(255, 77, 77, 0.15)",border:"1px solid rgba(255, 77, 77, 0.3)",borderRadius:4,color:"var(--red)"},children:"Abort"}),e.status==="done"&&h&&L.jsx("button",{onClick:()=>{if(W){h(e.id);return}V(!0)},style:{padding:"6px 14px",fontSize:12,background:W?"rgba(255, 77, 77, 0.2)":"rgba(255, 77, 77, 0.1)",border:"1px solid rgba(255, 77, 77, 0.3)",borderRadius:4,color:"var(--red)"},children:W?"Confirm Delete":"Delete from Done"})]}),B&&L.jsx("div",{style:{marginTop:10,fontSize:10,color:"var(--text3)",lineHeight:1.5},children:"Reset deletes the local workspace and discards the current plan, review, branch, blocker, and PR state."}),I&&L.jsx("div",{style:{marginTop:10,animation:"fade-in 0.15s ease-out"},children:L.jsx("input",{autoFocus:!0,type:"text",placeholder:"Feedback for planner...",value:A,onChange:z=>N(z.target.value),onKeyDown:z=>{z.key==="Enter"&&R(),z.key==="Escape"&&(P(!1),N(""))},style:{width:"100%",fontSize:11,padding:"6px 10px"}})}),W&&e.status==="done"&&L.jsx("div",{style:{marginTop:10,fontSize:10,color:"var(--text3)",lineHeight:1.5},children:"Delete removes the completed task from Ban Kan state and clears any saved plan/workspace artifacts."})]})]})})}const jf="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAiIHZpZXdCb3g9IjAgMCAxNDAwIDM2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8dGl0bGU+QmFuIEthbiBsb2dvPC90aXRsZT4KICA8ZGVzYz5NaW5pbWFsIFNWRyBsb2dvIGZvciBCYW4gS2FuIHdpdGggaGV4YWdvbmFsIG1hcmsgYW5kIHdvcmRtYXJrLjwvZGVzYz4KCiAgPCEtLSBUcmFuc3BhcmVudCBiYWNrZ3JvdW5kIC0tPgoKICA8IS0tIExvZ28gbWFyayAtLT4KICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0MCw0MCkiIHN0cm9rZT0iI0Y1QTYyMyIgc3Ryb2tlLXdpZHRoPSIxMCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KICAgIDwhLS0gT3V0ZXIgaGV4YWdvbiAtLT4KICAgIDxwYXRoIGQ9Ik0xMjAgMjAgTDIwNi42IDcwIEwyMDYuNiAxNzAgTDEyMCAyMjAgTDMzLjQgMTcwIEwzMy40IDcwIFoiLz4KICAgIDwhLS0gSW5uZXIgYmFycyAvIGthbmJhbiBsYW5lcyAtLT4KICAgIDxnIGZpbGw9IiNGNUE2MjMiIHN0cm9rZT0ibm9uZSI+CiAgICAgIDxwYXRoIGQ9Ik03NCAxNDYgQzc0IDE0Mi43IDc2LjcgMTQwIDgwIDE0MCBIMTA0IEMxMDcuMyAxNDAgMTEwIDE0Mi43IDExMCAxNDYgVjE4MiBDMTEwIDE4NS4zIDEwNy4zIDE4OCAxMDQgMTg4IEg4MCBDNzYuNyAxODggNzQgMTg1LjMgNzQgMTgyIFYxNDYgWiIvPgogICAgICA8cGF0aCBkPSJNMTEyIDExOCBDMTEyIDExNC43IDExNC43IDExMiAxMTggMTEyIEgxNDIgQzE0NS4zIDExMiAxNDggMTE0LjcgMTQ4IDExOCBWMTgyIEMxNDggMTg1LjMgMTQ1LjMgMTg4IDE0MiAxODggSDExOCBDMTE0LjcgMTg4IDExMiAxODUuMyAxMTIgMTgyIFYxMTggWiIvPgogICAgICA8cGF0aCBkPSJNMTUwIDg2IEMxNTAgODIuNyAxNTIuNyA4MCAxNTYgODAgSDE4MCBDMTgzLjMgODAgMTg2IDgyLjcgMTg2IDg2IFYxODIgQzE4NiAxODUuMyAxODMuMyAxODggMTgwIDE4OCBIMTU2IEMxNTIuNyAxODggMTUwIDE4NS4zIDE1MCAxODIgVjg2IFoiLz4KICAgIDwvZz4KICA8L2c+CgogIDwhLS0gV29yZG1hcmsgLS0+CiAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzIwLDApIj4KICAgIDx0ZXh0IHg9IjAiIHk9IjIxMCIKICAgICAgICAgIGZpbGw9IiNFOEU4RjAiCiAgICAgICAgICBmb250LXNpemU9IjExOCIKICAgICAgICAgIGZvbnQtd2VpZ2h0PSI4MDAiCiAgICAgICAgICBsZXR0ZXItc3BhY2luZz0iMTAiCiAgICAgICAgICBmb250LWZhbWlseT0iU3luZSwgSW50ZXIsIEFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2VyaWYiPgogICAgICBCQU4gS0FOCiAgICA8L3RleHQ+CiAgPC9nPgo8L3N2Zz4K",Cn={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"};function Hf(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Nf(e,t){return!Array.isArray(e)||e.length===0?"":t!=null&&t.defaultRepoPath&&e.includes(t.defaultRepoPath)?t.defaultRepoPath:e[0]||""}function Ff(){return L.jsx("div",{style:{height:34,display:"flex",alignItems:"center",flexShrink:0},children:L.jsx("img",{src:jf,alt:"Ban Kan",style:{height:34,width:"auto",display:"block"}})})}function zf(){const{connected:e,isInitialized:t,agents:r,tasks:i,repos:a,settings:f,notifications:C,addTask:o,approvePlan:c,rejectPlan:d,pauseTask:S,resumeTask:h,editTask:_,abortTask:g,resetTask:x,retryTask:v,deleteTask:u,openTaskWorkspace:l,injectMessage:s,sendRaw:n,resizeTerminal:p,updateSettings:w,subscribeTerminal:y,openAgentTerminal:k,returnAgentTerminal:m}=gf(),[b,T]=q.useState(null),[I,P]=q.useState(null),[A,N]=q.useState(!1),[W,V]=q.useState(!1),X=a.length>0,j=X,E=t&&!X&&i.length===0,D=q.useMemo(()=>i.filter(R=>R.status==="awaiting_approval"||R.status==="blocked"),[i]),M=q.useMemo(()=>i.reduce((R,$)=>R+($.totalTokens||0),0),[i]),B=q.useMemo(()=>r.filter(R=>R.status==="active").length,[r]),K=q.useMemo(()=>r.filter(R=>R.status==="blocked").length,[r]),F=q.useMemo(()=>i.filter(R=>!["backlog","done","aborted"].includes(R.status)),[i]),Y=q.useMemo(()=>r.find(R=>R.id===b),[r,b]);q.useEffect(()=>{!j&&A&&N(!1)},[j,A]);const U=R=>{R!=="orch"&&T($=>$===R?null:R)},O=()=>{j&&N(!0)};return L.jsxs("div",{style:{height:"100vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[L.jsxs("div",{style:{height:54,minHeight:54,display:"flex",alignItems:"center",gap:16,padding:"0 16px",background:"var(--bg1)",borderBottom:"1px solid var(--border)"},children:[L.jsx("div",{style:{display:"flex",alignItems:"center",minWidth:0},children:L.jsx(Ff,{})}),L.jsxs("div",{style:{display:"flex",gap:16,fontSize:11,color:"var(--text2)",marginLeft:24},children:[L.jsxs("span",{children:["Active ",L.jsx("span",{style:{color:"var(--green)"},children:B}),"/",r.length]}),K>0&&L.jsxs("span",{children:["Blocked ",L.jsx("span",{style:{color:"var(--red)"},children:K})]}),L.jsxs("span",{children:["In Flight ",L.jsx("span",{style:{color:"var(--amber)"},children:F.length})]}),L.jsxs("span",{children:["Context ",L.jsx("span",{style:{color:"var(--text)"},children:Hf(M)})]})]}),D.length>0&&L.jsxs("button",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 10px",background:"rgba(245, 166, 35, 0.1)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:12,color:"var(--amber)",fontSize:11},children:[L.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--amber)",animation:"pulse 2s infinite"}}),D.length," need",D.length===1?"s":""," attention"]}),L.jsx("div",{style:{flex:1}}),L.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:e?"var(--green)":"var(--red)"}}),L.jsx("button",{onClick:()=>V(!0),style:{padding:"6px 10px",background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,fontSize:14,color:"var(--text2)",cursor:"pointer"},title:"Settings",children:"⚙"}),L.jsx("button",{onClick:O,disabled:!j,style:{padding:"6px 14px",background:j?"var(--amber)":"var(--bg2)",color:j?"#000":"var(--text3)",border:`1px solid ${j?"var(--amber)":"var(--border)"}`,borderRadius:4,fontWeight:500,fontSize:12,cursor:j?"pointer":"not-allowed",opacity:j?1:.7},title:j?"Add Task":"Configure at least one repository in Settings before adding a task",children:"+ ADD TASK"})]}),L.jsxs("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[E&&L.jsx("div",{style:{margin:"16px 16px 0",padding:"18px 20px",borderRadius:10,border:"1px solid rgba(245, 166, 35, 0.35)",background:"linear-gradient(135deg, rgba(245, 166, 35, 0.18), rgba(122, 162, 247, 0.08))",boxShadow:"0 12px 32px rgba(0,0,0,0.18)"},children:L.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,flexWrap:"wrap"},children:[L.jsxs("div",{style:{maxWidth:720},children:[L.jsx("div",{style:{fontFamily:"var(--font-head)",fontSize:20,fontWeight:700,marginBottom:6},children:"Welcome to Ban Kan"}),L.jsx("div",{style:{fontSize:13,color:"var(--text2)",lineHeight:1.5},children:"Open Settings to add at least one repository, choose a default repository, and review the agent configuration before creating your first task."})]}),L.jsx("button",{onClick:()=>V(!0),style:{padding:"10px 14px",background:"var(--amber)",color:"#000",border:"1px solid var(--amber)",borderRadius:6,fontSize:12,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},children:"Open Settings"})]})}),L.jsx(xf,{tasks:i,agents:r,onApprove:c,onReject:d,onAgentClick:U,onAddTask:O,onTaskClick:R=>P(R),canCreateTask:j})]}),b&&Y&&L.jsx(Lf,{agent:Y,subscribeTerminal:y,injectMessage:s,sendRaw:n,resizeTerminal:p,openAgentTerminal:k,returnAgentTerminal:m,onClose:()=>T(null)}),I&&L.jsx(Of,{task:i.find(R=>R.id===I.id)||I,repos:a,onClose:()=>P(null),onApprove:R=>{c(R),P(null)},onReject:(R,$)=>{d(R,$),P(null)},onPause:R=>{S(R),P(null)},onResume:R=>{h(R)},onEdit:(R,$)=>{_(R,$)},onAbort:R=>{g(R),P(null)},onReset:R=>{x(R),P(null)},onRetry:R=>{v(R),P(null)},onDelete:R=>{u(R),P(null)},onOpenWorkspace:R=>{l(R)}}),A&&L.jsx(Wf,{repos:a,settings:f,onClose:()=>N(!1),onSubmit:(R,$,H,Q)=>{o(R,$,H,Q),N(!1)}}),W&&f&&L.jsx($f,{settings:f,onClose:()=>V(!1),onApply:R=>{w(R),V(!1)}}),L.jsx("div",{style:{position:"fixed",bottom:16,right:16,display:"flex",flexDirection:"column",gap:8,zIndex:1e3},children:C.map(R=>L.jsx("div",{style:{padding:"10px 14px",background:"var(--bg2)",borderLeft:`3px solid ${R.type==="error"?"var(--red)":R.type==="success"?"var(--green)":R.type==="warning"?"var(--amber)":"var(--steel2)"}`,borderRadius:4,fontSize:12,maxWidth:320,animation:"toast-in 0.3s ease-out",boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:R.msg},R.id))})]})}function Wf({repos:e,settings:t,onClose:r,onSubmit:i}){const[a,f]=q.useState(""),[C,o]=q.useState("medium"),[c,d]=q.useState(""),[S,h]=q.useState(()=>Nf(e,t)),_=()=>{a.trim()&&i(a.trim(),C,c.trim(),S)};return L.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:L.jsxs("div",{onClick:g=>g.stopPropagation(),style:{width:440,padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[L.jsx("h2",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:18,marginBottom:20},children:"Add Task"}),e.length>0&&L.jsxs("div",{style:{marginBottom:16},children:[L.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Repository"}),L.jsxs("select",{value:S,onChange:g=>h(g.target.value),style:{width:"100%",fontSize:12,padding:"6px 8px"},children:[L.jsx("option",{value:"",children:"No repository"}),e.map(g=>L.jsx("option",{value:g,children:g},g))]})]}),L.jsxs("div",{style:{marginBottom:16},children:[L.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Title"}),L.jsx("input",{autoFocus:!0,type:"text",value:a,onChange:g=>f(g.target.value),onKeyDown:g=>{g.key==="Enter"&&_()},placeholder:"What needs to be built?",style:{width:"100%"}})]}),L.jsxs("div",{style:{marginBottom:16},children:[L.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Priority"}),L.jsx("div",{style:{display:"flex",gap:6},children:["critical","high","medium","low"].map(g=>L.jsx("button",{onClick:()=>o(g),style:{padding:"5px 12px",borderRadius:4,fontSize:12,border:`1px solid ${C===g?Cn[g]:"var(--border)"}`,background:C===g?Cn[g]+"20":"transparent",color:C===g?Cn[g]:"var(--text2)",textTransform:"capitalize"},children:g},g))})]}),L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Description (optional)"}),L.jsx("textarea",{value:c,onChange:g=>d(g.target.value),placeholder:"Additional context...",rows:3,style:{width:"100%",resize:"vertical"}})]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[L.jsx("button",{onClick:r,style:{padding:"8px 16px",color:"var(--text2)",fontSize:12},children:"Cancel"}),L.jsx("button",{onClick:_,disabled:!a.trim(),style:{padding:"8px 20px",background:a.trim()?"var(--amber)":"var(--border)",color:a.trim()?"#000":"var(--text3)",borderRadius:4,fontWeight:500,fontSize:12},children:"Add Task"})]})]})})}const Uf=[{value:"",label:"Default (CLI default)"},{value:"sonnet",label:"Sonnet (balanced)"},{value:"opus",label:"Opus (highest capability)"},{value:"haiku",label:"Haiku (fastest, cheapest)"}];function $f({settings:e,onClose:t,onApply:r}){var p,w;const[i,a]=q.useState(()=>JSON.parse(JSON.stringify(e))),[f,C]=q.useState(""),[o,c]=q.useState(!1),[d,S]=q.useState("general"),h=(y,k,m)=>{a(b=>{const T=JSON.parse(JSON.stringify(b));return T.agents[y][k]=m,T})},_=(y,k)=>{a(m=>({...m,prompts:{...m.prompts||{},[y]:k}}))},g=()=>{const y=f.trim();y&&(a(k=>{if((k.repos||[]).includes(y))return k;const m=[...k.repos||[],y];return{...k,repos:m,defaultRepoPath:k.defaultRepoPath||y}}),C(""))},x=y=>{a(k=>{const m=(k.repos||[]).filter(b=>b!==y);return{...k,repos:m,defaultRepoPath:k.defaultRepoPath===y?m[0]||"":k.defaultRepoPath}})},v={planners:{min:0,max:10},implementors:{min:1,max:10},reviewers:{min:0,max:10}},u=!!((p=i.workspaceRoot)!=null&&p.trim())&&Object.entries(i.agents||{}).every(([y,k])=>{const m=v[y]||{min:1,max:10};return k.max>=m.min&&k.max<=m.max})&&["planning","implementation","review"].every(y=>{var k;return typeof((k=i.prompts)==null?void 0:k[y])=="string"}),l=[{key:"general",label:"General"},{key:"planning",label:"Planning"},{key:"implementation",label:"Implementation"},{key:"review",label:"Review"}],s={planning:{roleKey:"planners",promptKey:"planning",description:"Set max agents to 0 to disable planning and skip directly into implementation."},implementation:{roleKey:"implementors",promptKey:"implementation",description:"Implementation cannot be disabled. The prompt body customizes the engineer instructions only."},review:{roleKey:"reviewers",promptKey:"review",description:"Set max agents to 0 to disable review and create the PR immediately after implementation."}},n=y=>{var T;const k=s[y],m=i.agents[k.roleKey],b=v[k.roleKey];return L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:10},children:"AGENTS"}),L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8},children:[L.jsx("span",{style:{fontSize:12,color:"var(--text2)",width:45},children:"Max:"}),L.jsx("input",{type:"number",min:b.min,max:b.max,value:m.max,onChange:I=>{const P=b.min,A=parseInt(I.target.value,10),N=Number.isNaN(A)?P:Math.max(b.min,Math.min(b.max,A));h(k.roleKey,"max",N)},style:{width:60,padding:"4px 6px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,textAlign:"center"}})]}),L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8},children:[L.jsx("span",{style:{fontSize:12,color:"var(--text2)",width:45},children:"CLI:"}),L.jsxs("select",{value:m.cli,onChange:I=>h(k.roleKey,"cli",I.target.value),style:{padding:"4px 8px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4},children:[L.jsx("option",{value:"claude",children:"claude"}),L.jsx("option",{value:"codex",children:"codex"})]})]}),L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8},children:[L.jsx("span",{style:{fontSize:12,color:"var(--text2)",width:45},children:"Model:"}),L.jsx("select",{value:m.model||"",onChange:I=>h(k.roleKey,"model",I.target.value),style:{padding:"4px 8px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4},children:Uf.map(I=>L.jsx("option",{value:I.value,children:I.label},I.value))})]}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)"},children:k.description})]}),L.jsxs("div",{style:{marginBottom:18},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"PROMPT BODY"}),L.jsx("textarea",{value:((T=i.prompts)==null?void 0:T[k.promptKey])||"",onChange:I=>_(k.promptKey,I.target.value),spellCheck:!1,style:{width:"100%",minHeight:220,resize:"vertical",padding:"10px 12px",fontSize:12,lineHeight:1.5,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text)"}}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)",marginTop:6},children:"This edits the stage instructions only. Required output markers and parser-critical formatting stay fixed."})]})]})};return L.jsx("div",{onClick:t,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:L.jsxs("div",{onClick:y=>y.stopPropagation(),style:{width:760,maxWidth:"calc(100vw - 32px)",padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20},children:[L.jsx("h2",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:18},children:"Settings"}),L.jsx("button",{onClick:t,style:{color:"var(--text3)",fontSize:16},children:"✕"})]}),L.jsx("div",{style:{display:"flex",gap:8,marginBottom:18,flexWrap:"wrap"},children:l.map(y=>L.jsx("button",{onClick:()=>S(y.key),style:{padding:"7px 12px",background:d===y.key?"var(--amber)":"var(--bg2)",color:d===y.key?"#000":"var(--text2)",border:"1px solid",borderColor:d===y.key?"var(--amber)":"var(--border)",borderRadius:999,fontSize:12,fontWeight:600,cursor:"pointer"},children:y.label},y.key))}),L.jsxs("div",{style:{maxHeight:"65vh",overflowY:"auto",paddingRight:4},children:[d==="general"&&L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"WORKSPACE FOLDER"}),L.jsxs("div",{style:{display:"flex",gap:8,marginBottom:6},children:[L.jsx("input",{type:"text",value:i.workspaceRoot||"",onChange:y=>a(k=>({...k,workspaceRoot:y.target.value})),placeholder:"/path/to/workspaces",style:{flex:1,fontSize:12,padding:"6px 10px"}}),L.jsx("button",{onClick:()=>c(!0),style:{fontSize:12,padding:"6px 10px",background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)",cursor:"pointer"},children:"Browse"})]}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)"},children:"Local folder used when the app creates per-task working copies."}),o&&L.jsx(Df,{initialPath:i.workspaceRoot||"",onSelect:y=>{a(k=>({...k,workspaceRoot:y})),c(!1)},onClose:()=>c(!1)})]}),L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"REPOSITORIES"}),(i.repos||[]).map(y=>L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[L.jsx("span",{style:{flex:1,fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:y,children:y}),L.jsx("button",{onClick:()=>x(y),style:{color:"var(--red)",fontSize:12,flexShrink:0},children:"×"})]},y)),L.jsxs("div",{style:{display:"flex",gap:8,marginTop:10},children:[L.jsx("input",{type:"text",value:f,onChange:y=>C(y.target.value),onKeyDown:y=>{y.key==="Enter"&&g()},placeholder:"https://github.com/org/repo",style:{flex:1,fontSize:12,padding:"6px 10px"}}),L.jsx("button",{onClick:g,disabled:!f.trim(),style:{fontSize:12,padding:"6px 10px",background:f.trim()?"var(--bg2)":"var(--bg)",border:"1px solid var(--border)",borderRadius:4,color:f.trim()?"var(--text)":"var(--text3)",cursor:f.trim()?"pointer":"default"},children:"Add Repo"})]}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)",marginTop:6},children:"Add repository URLs for task assignment. The workspace folder above controls where the app checks them out locally."})]}),((w=i.repos)==null?void 0:w.length)>0&&L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"DEFAULT REPOSITORY"}),L.jsxs("select",{value:i.defaultRepoPath||"",onChange:y=>a(k=>({...k,defaultRepoPath:y.target.value})),style:{width:"100%",fontSize:12,padding:"6px 10px"},children:[L.jsx("option",{value:"",children:"No default repository"}),(i.repos||[]).map(y=>L.jsx("option",{value:y,children:y},y))]}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)",marginTop:6},children:"New tasks preselect this repository. If it is removed, the first remaining repository becomes the default."})]}),L.jsx("div",{style:{fontSize:11,color:"var(--text3)",marginBottom:16,fontStyle:"italic"},children:"Orchestrator scales agents up on demand, up to the max per role. Planning and Review can be disabled by setting max to 0."})]}),d!=="general"&&n(d)]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[L.jsx("button",{onClick:t,style:{padding:"8px 16px",color:"var(--text2)",fontSize:12},children:"Cancel"}),L.jsx("button",{onClick:()=>r(i),disabled:!u,style:{padding:"8px 20px",background:u?"var(--amber)":"var(--border)",color:u?"#000":"var(--text3)",borderRadius:4,fontWeight:500,fontSize:12},children:"Apply"})]})]})})}Pu(document.getElementById("root")).render(L.jsx(zf,{}));
|
|
46
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(m){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),l.isLinux&&m&&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(m){const b=this._getMouseBufferCoords(m),T=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(T&&M&&b)&&this._areCoordsInSelection(b,T,M)}isCellInSelection(m,b){const T=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!T||!M)&&this._areCoordsInSelection([m,b],T,M)}_areCoordsInSelection(m,b,T){return m[1]>b[1]&&m[1]<T[1]||b[1]===T[1]&&m[1]===b[1]&&m[0]>=b[0]&&m[0]<T[0]||b[1]<T[1]&&m[1]===T[1]&&m[0]<T[0]||b[1]<T[1]&&m[1]===b[1]&&m[0]>=b[0]}_selectWordAtCursor(m,b){var P,A;const T=(A=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:A.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(m);return!!M&&(this._selectWordAt(M,b),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(m,b){this._model.clearSelection(),m=Math.max(m,0),b=Math.min(b,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,b],this.refresh(),this._onSelectionChange.fire()}_handleTrim(m){this._model.handleTrim(m)&&this.refresh()}_getMouseBufferCoords(m){const b=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(b)return b[0]--,b[1]--,b[1]+=this._bufferService.buffer.ydisp,b}_getMouseEventScrollAmount(m){let b=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,m,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return b>=0&&b<=T?0:(b>T&&(b-=T),b=Math.min(Math.max(b,-50),50),b/=50,b/Math.abs(b)+Math.round(14*b))}shouldForceSelection(m){return l.isMac?m.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:m.shiftKey}handleMouseDown(m){if(this._mouseDownTimeStamp=m.timeStamp,(m.button!==2||!this.hasSelection)&&m.button===0){if(!this._enabled){if(!this.shouldForceSelection(m))return;m.stopPropagation()}m.preventDefault(),this._dragScrollAmount=0,this._enabled&&m.shiftKey?this._handleIncrementalClick(m):m.detail===1?this._handleSingleClick(m):m.detail===2?this._handleDoubleClick(m):m.detail===3&&this._handleTripleClick(m),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(),50)}_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(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))}_handleSingleClick(m){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(m)?3:0,this._model.selectionStart=this._getMouseBufferCoords(m),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const b=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);b&&b.length!==this._model.selectionStart[0]&&b.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(m){this._selectWordAtCursor(m,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(m){const b=this._getMouseBufferCoords(m);b&&(this._activeSelectionMode=2,this._selectLineAt(b[1]))}shouldColumnSelect(m){return m.altKey&&!(l.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(m){if(m.stopImmediatePropagation(),!this._model.selectionStart)return;const b=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(m),!this._model.selectionEnd)return void this.refresh(!0);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(m),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const M=T.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}b&&b[0]===this._model.selectionEnd[0]&&b[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});const m=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(m.ydisp+this._bufferService.rows,m.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=m.ydisp),this.refresh()}}_handleMouseUp(m){const b=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&b<500&&m.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const M=(0,_.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const m=this._model.finalSelectionStart,b=this._model.finalSelectionEnd,T=!(!m||!b||m[0]===b[0]&&m[1]===b[1]);T?m&&b&&(this._oldSelectionStart&&this._oldSelectionEnd&&m[0]===this._oldSelectionStart[0]&&m[1]===this._oldSelectionStart[1]&&b[0]===this._oldSelectionEnd[0]&&b[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(m,b,T)):this._oldHasSelection&&this._fireOnSelectionChange(m,b,T)}_fireOnSelectionChange(m,b,T){this._oldSelectionStart=m,this._oldSelectionEnd=b,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(m){this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim(b=>this._handleTrim(b))}_convertViewportColToCharacterIndex(m,b){let T=b;for(let M=0;b>=M;M++){const P=m.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:P>1&&b!==M&&(T+=P-1)}return T}setSelection(m,b,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,b],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(m){this._isClickInSelection(m)||(this._selectWordAtCursor(m,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(m,b,T=!0,M=!0){if(m[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,A=P.lines.get(m[1]);if(!A)return;const N=P.translateBufferLineToString(m[1],!1);let W=this._convertViewportColToCharacterIndex(A,m[0]),V=W;const X=m[0]-W;let j=0,E=0,D=0,I=0;if(N.charAt(W)===" "){for(;W>0&&N.charAt(W-1)===" ";)W--;for(;V<N.length&&N.charAt(V+1)===" ";)V++}else{let F=m[0],Y=m[0];A.getWidth(F)===0&&(j++,F--),A.getWidth(Y)===2&&(E++,Y++);const U=A.getString(Y).length;for(U>1&&(I+=U-1,V+=U-1);F>0&&W>0&&!this._isCharWordSeparator(A.loadCell(F-1,this._workCell));){A.loadCell(F-1,this._workCell);const O=this._workCell.getChars().length;this._workCell.getWidth()===0?(j++,F--):O>1&&(D+=O-1,W-=O-1),W--,F--}for(;Y<A.length&&V+1<N.length&&!this._isCharWordSeparator(A.loadCell(Y+1,this._workCell));){A.loadCell(Y+1,this._workCell);const O=this._workCell.getChars().length;this._workCell.getWidth()===2?(E++,Y++):O>1&&(I+=O-1,V+=O-1),V++,Y++}}V++;let B=W+X-j+D,K=Math.min(this._bufferService.cols,V-W+j+E-D-I);if(b||N.slice(W,V).trim()!==""){if(T&&B===0&&A.getCodePoint(0)!==32){const F=P.lines.get(m[1]-1);if(F&&A.isWrapped&&F.getCodePoint(this._bufferService.cols-1)!==32){const Y=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(Y){const U=this._bufferService.cols-Y.start;B-=U,K+=U}}}if(M&&B+K===this._bufferService.cols&&A.getCodePoint(this._bufferService.cols-1)!==32){const F=P.lines.get(m[1]+1);if(F!=null&&F.isWrapped&&F.getCodePoint(0)!==32){const Y=this._getWordAt([0,m[1]+1],!1,!1,!0);Y&&(K+=Y.length)}}return{start:B,length:K}}}_selectWordAt(m,b){const T=this._getWordAt(m,b);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[T.start,m[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(m){const b=this._getWordAt(m,!0);if(b){let T=m[1];for(;b.start<0;)b.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;b.start+b.length>this._bufferService.cols;)b.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,T]}}_isCharWordSeparator(m){return m.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(m.getChars())>=0}_selectLineAt(m){const b=this._bufferService.buffer.getWrappedRangeForLine(m),T={start:{x:0,y:b.first},end:{x:this._bufferService.cols-1,y:b.last}};this._model.selectionStart=[0,b.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols)}};o.SelectionService=k=d([S(3,p.IBufferService),S(4,p.ICoreService),S(5,x.IMouseService),S(6,p.IOptionsService),S(7,x.IRenderService),S(8,x.ICoreBrowserService)],k)},4725:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const d=c(8343);o.ICharSizeService=(0,d.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),o.IMouseService=(0,d.createDecorator)("MouseService"),o.IRenderService=(0,d.createDecorator)("RenderService"),o.ISelectionService=(0,d.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,d.createDecorator)("ThemeService"),o.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(C,o,c){var d=this&&this.__decorate||function(k,m,b,T){var M,P=arguments.length,A=P<3?m:T===null?T=Object.getOwnPropertyDescriptor(m,b):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(k,m,b,T);else for(var N=k.length-1;N>=0;N--)(M=k[N])&&(A=(P<3?M(A):P>3?M(m,b,A):M(m,b))||A);return P>3&&A&&Object.defineProperty(m,b,A),A},S=this&&this.__param||function(k,m){return function(b,T){m(b,T,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),_=c(8055),g=c(8460),x=c(844),v=c(2585),u=_.css.toColor("#ffffff"),l=_.css.toColor("#000000"),s=_.css.toColor("#ffffff"),n=_.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],m=[0,95,135,175,215,255];for(let b=0;b<216;b++){const T=m[b/36%6|0],M=m[b/6%6|0],P=m[b%6];k.push({css:_.channels.toCss(T,M,P),rgba:_.channels.toRgba(T,M,P)})}for(let b=0;b<24;b++){const T=8+10*b;k.push({css:_.channels.toCss(T,T,T),rgba:_.channels.toRgba(T,T,T)})}return k})());let w=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:l,cursor:s,cursorAccent:n,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:_.color.blend(l,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:_.color.blend(l,p),ansi:o.DEFAULT_ANSI_COLORS.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)))}_setTheme(k={}){const m=this._colors;if(m.foreground=y(k.foreground,u),m.background=y(k.background,l),m.cursor=y(k.cursor,s),m.cursorAccent=y(k.cursorAccent,n),m.selectionBackgroundTransparent=y(k.selectionBackground,p),m.selectionBackgroundOpaque=_.color.blend(m.background,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundTransparent=y(k.selectionInactiveBackground,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundOpaque=_.color.blend(m.background,m.selectionInactiveBackgroundTransparent),m.selectionForeground=k.selectionForeground?y(k.selectionForeground,_.NULL_COLOR):void 0,m.selectionForeground===_.NULL_COLOR&&(m.selectionForeground=void 0),_.color.isOpaque(m.selectionBackgroundTransparent)&&(m.selectionBackgroundTransparent=_.color.opacity(m.selectionBackgroundTransparent,.3)),_.color.isOpaque(m.selectionInactiveBackgroundTransparent)&&(m.selectionInactiveBackgroundTransparent=_.color.opacity(m.selectionInactiveBackgroundTransparent,.3)),m.ansi=o.DEFAULT_ANSI_COLORS.slice(),m.ansi[0]=y(k.black,o.DEFAULT_ANSI_COLORS[0]),m.ansi[1]=y(k.red,o.DEFAULT_ANSI_COLORS[1]),m.ansi[2]=y(k.green,o.DEFAULT_ANSI_COLORS[2]),m.ansi[3]=y(k.yellow,o.DEFAULT_ANSI_COLORS[3]),m.ansi[4]=y(k.blue,o.DEFAULT_ANSI_COLORS[4]),m.ansi[5]=y(k.magenta,o.DEFAULT_ANSI_COLORS[5]),m.ansi[6]=y(k.cyan,o.DEFAULT_ANSI_COLORS[6]),m.ansi[7]=y(k.white,o.DEFAULT_ANSI_COLORS[7]),m.ansi[8]=y(k.brightBlack,o.DEFAULT_ANSI_COLORS[8]),m.ansi[9]=y(k.brightRed,o.DEFAULT_ANSI_COLORS[9]),m.ansi[10]=y(k.brightGreen,o.DEFAULT_ANSI_COLORS[10]),m.ansi[11]=y(k.brightYellow,o.DEFAULT_ANSI_COLORS[11]),m.ansi[12]=y(k.brightBlue,o.DEFAULT_ANSI_COLORS[12]),m.ansi[13]=y(k.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),m.ansi[14]=y(k.brightCyan,o.DEFAULT_ANSI_COLORS[14]),m.ansi[15]=y(k.brightWhite,o.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const b=Math.min(m.ansi.length-16,k.extendedAnsi.length);for(let T=0;T<b;T++)m.ansi[T+16]=y(k.extendedAnsi[T],o.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){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[k]=this._restoreColors.ansi[k]}else for(let m=0;m<this._restoreColors.ansi.length;++m)this._colors.ansi[m]=this._restoreColors.ansi[m]}modifyColors(k){k(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()}}};function y(k,m){if(k!==void 0)try{return _.css.toColor(k)}catch{}return m}o.ThemeService=w=d([S(0,v.IOptionsService)],w)},6349:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const d=c(8460),S=c(844);class h extends S.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(g){if(this._maxLength===g)return;const x=new Array(g);for(let v=0;v<Math.min(g,this.length);v++)x[v]=this._array[this._getCyclicIndex(v)];this._array=x,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let x=this._length;x<g;x++)this._array[x]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,x){this._array[this._getCyclicIndex(g)]=x}push(g){this._array[this._getCyclicIndex(this._length)]=g,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(g,x,...v){if(x){for(let u=g;u<this._length-x;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+x)];this._length-=x,this.onDeleteEmitter.fire({index:g,amount:x})}for(let u=this._length-1;u>=g;u--)this._array[this._getCyclicIndex(u+v.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<v.length;u++)this._array[this._getCyclicIndex(g+u)]=v[u];if(v.length&&this.onInsertEmitter.fire({index:g,amount:v.length}),this._length+v.length>this._maxLength){const u=this._length+v.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=v.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,x,v){if(!(x<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let l=x-1;l>=0;l--)this.set(g+l+v,this.get(g+l));const u=g+x+v-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<x;u++)this.set(g+u+v,this.get(g+u))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}o.CircularList=h},1439:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(d,S=5){if(typeof d!="object")return d;const h=Array.isArray(d)?[]:{};for(const _ in d)h[_]=S<=1?d[_]:d[_]&&c(d[_],S-1);return h}},8055:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,d=0,S=0,h=0;var _,g,x,v,u;function l(n){const p=n.toString(16);return p.length<2?"0"+p:p}function s(n,p){return n<p?(p+.05)/(n+.05):(n+.05)/(p+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(n){n.toCss=function(p,w,y,k){return k!==void 0?`#${l(p)}${l(w)}${l(y)}${l(k)}`:`#${l(p)}${l(w)}${l(y)}`},n.toRgba=function(p,w,y,k=255){return(p<<24|w<<16|y<<8|k)>>>0},n.toColor=function(p,w,y,k){return{css:n.toCss(p,w,y,k),rgba:n.toRgba(p,w,y,k)}}}(_||(o.channels=_={})),function(n){function p(w,y){return h=Math.round(255*y),[c,d,S]=u.toChannels(w.rgba),{css:_.toCss(c,d,S,h),rgba:_.toRgba(c,d,S,h)}}n.blend=function(w,y){if(h=(255&y.rgba)/255,h===1)return{css:y.css,rgba:y.rgba};const k=y.rgba>>24&255,m=y.rgba>>16&255,b=y.rgba>>8&255,T=w.rgba>>24&255,M=w.rgba>>16&255,P=w.rgba>>8&255;return c=T+Math.round((k-T)*h),d=M+Math.round((m-M)*h),S=P+Math.round((b-P)*h),{css:_.toCss(c,d,S),rgba:_.toRgba(c,d,S)}},n.isOpaque=function(w){return(255&w.rgba)==255},n.ensureContrastRatio=function(w,y,k){const m=u.ensureContrastRatio(w.rgba,y.rgba,k);if(m)return _.toColor(m>>24&255,m>>16&255,m>>8&255)},n.opaque=function(w){const y=(255|w.rgba)>>>0;return[c,d,S]=u.toChannels(y),{css:_.toCss(c,d,S),rgba:y}},n.opacity=p,n.multiplyOpacity=function(w,y){return h=255&w.rgba,p(w,h*y/255)},n.toColorRGB=function(w){return[w.rgba>>24&255,w.rgba>>16&255,w.rgba>>8&255]}}(g||(o.color=g={})),function(n){let p,w;try{const y=document.createElement("canvas");y.width=1,y.height=1;const k=y.getContext("2d",{willReadFrequently:!0});k&&(p=k,p.globalCompositeOperation="copy",w=p.createLinearGradient(0,0,1,1))}catch{}n.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return c=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),S=parseInt(y.slice(3,4).repeat(2),16),_.toColor(c,d,S);case 5:return c=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),S=parseInt(y.slice(3,4).repeat(2),16),h=parseInt(y.slice(4,5).repeat(2),16),_.toColor(c,d,S,h);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const k=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return c=parseInt(k[1]),d=parseInt(k[2]),S=parseInt(k[3]),h=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),_.toColor(c,d,S,h);if(!p||!w)throw new Error("css.toColor: Unsupported css format");if(p.fillStyle=w,p.fillStyle=y,typeof p.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(p.fillRect(0,0,1,1),[c,d,S,h]=p.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,d,S,h),css:y}}}(x||(o.css=x={})),function(n){function p(w,y,k){const m=w/255,b=y/255,T=k/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}n.relativeLuminance=function(w){return p(w>>16&255,w>>8&255,255&w)},n.relativeLuminance2=p}(v||(o.rgb=v={})),function(n){function p(y,k,m){const b=y>>24&255,T=y>>16&255,M=y>>8&255;let P=k>>24&255,A=k>>16&255,N=k>>8&255,W=s(v.relativeLuminance2(P,A,N),v.relativeLuminance2(b,T,M));for(;W<m&&(P>0||A>0||N>0);)P-=Math.max(0,Math.ceil(.1*P)),A-=Math.max(0,Math.ceil(.1*A)),N-=Math.max(0,Math.ceil(.1*N)),W=s(v.relativeLuminance2(P,A,N),v.relativeLuminance2(b,T,M));return(P<<24|A<<16|N<<8|255)>>>0}function w(y,k,m){const b=y>>24&255,T=y>>16&255,M=y>>8&255;let P=k>>24&255,A=k>>16&255,N=k>>8&255,W=s(v.relativeLuminance2(P,A,N),v.relativeLuminance2(b,T,M));for(;W<m&&(P<255||A<255||N<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),A=Math.min(255,A+Math.ceil(.1*(255-A))),N=Math.min(255,N+Math.ceil(.1*(255-N))),W=s(v.relativeLuminance2(P,A,N),v.relativeLuminance2(b,T,M));return(P<<24|A<<16|N<<8|255)>>>0}n.blend=function(y,k){if(h=(255&k)/255,h===1)return k;const m=k>>24&255,b=k>>16&255,T=k>>8&255,M=y>>24&255,P=y>>16&255,A=y>>8&255;return c=M+Math.round((m-M)*h),d=P+Math.round((b-P)*h),S=A+Math.round((T-A)*h),_.toRgba(c,d,S)},n.ensureContrastRatio=function(y,k,m){const b=v.relativeLuminance(y>>8),T=v.relativeLuminance(k>>8);if(s(b,T)<m){if(T<b){const A=p(y,k,m),N=s(b,v.relativeLuminance(A>>8));if(N<m){const W=w(y,k,m);return N>s(b,v.relativeLuminance(W>>8))?A:W}return A}const M=w(y,k,m),P=s(b,v.relativeLuminance(M>>8));if(P<m){const A=p(y,k,m);return P>s(b,v.relativeLuminance(A>>8))?M:A}return M}},n.reduceLuminance=p,n.increaseLuminance=w,n.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}}(u||(o.rgba=u={})),o.toPaddedHex=l,o.contrastRatio=s},8969:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const d=c(844),S=c(2585),h=c(4348),_=c(7866),g=c(744),x=c(7302),v=c(6975),u=c(8460),l=c(1753),s=c(1480),n=c(7994),p=c(9282),w=c(5435),y=c(5981),k=c(2660);let m=!1;class b extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event(M=>{var P;(P=this._onScrollApi)==null||P.fire(M.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(M){for(const P in M)this.optionsService.options[P]=M[P]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new x.OptionsService(M)),this._instantiationService.setService(S.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(S.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(S.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(S.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(l.CoreMouseService)),this._instantiationService.setService(S.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(S.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(n.CharsetService),this._instantiationService.setService(S.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(S.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new w.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new y.WriteBuffer((P,A)=>this._inputHandler.parse(P,A))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,P){this._writeBuffer.write(M,P)}writeSync(M,P){this._logService.logLevel<=S.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(M,P)}input(M,P=!0){this.coreService.triggerDataEvent(M,P)}resize(M,P){isNaN(M)||isNaN(P)||(M=Math.max(M,g.MINIMUM_COLS),P=Math.max(P,g.MINIMUM_ROWS),this._bufferService.resize(M,P))}scroll(M,P=!1){this._bufferService.scroll(M,P)}scrollLines(M,P,A){this._bufferService.scrollLines(M,P,A)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const P=M-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(M,P){return this._inputHandler.registerEscHandler(M,P)}registerDcsHandler(M,P){return this._inputHandler.registerDcsHandler(M,P)}registerCsiHandler(M,P){return this._inputHandler.registerCsiHandler(M,P)}registerOscHandler(M,P){return this._inputHandler.registerOscHandler(M,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?M=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const P of M)P.dispose()})}}}o.CoreTerminal=b},8460:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===c)return void this._listeners.splice(d,1)}}})),this._event}fire(c,d){const S=[];for(let h=0;h<this._listeners.length;h++)S.push(this._listeners[h]);for(let h=0;h<S.length;h++)S[h].call(void 0,c,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,d){return c(S=>d.fire(S))},o.runAndSubscribe=function(c,d){return d(void 0),c(S=>d(S))}},5435:function(C,o,c){var d=this&&this.__decorate||function(j,E,D,I){var B,K=arguments.length,F=K<3?E:I===null?I=Object.getOwnPropertyDescriptor(E,D):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(j,E,D,I);else for(var Y=j.length-1;Y>=0;Y--)(B=j[Y])&&(F=(K<3?B(F):K>3?B(E,D,F):B(E,D))||F);return K>3&&F&&Object.defineProperty(E,D,F),F},S=this&&this.__param||function(j,E){return function(D,I){E(D,I,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const h=c(2584),_=c(7116),g=c(2015),x=c(844),v=c(482),u=c(8437),l=c(8460),s=c(643),n=c(511),p=c(3734),w=c(2585),y=c(1480),k=c(6242),m=c(6351),b=c(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function P(j,E){if(j>24)return E.setWinLines||!1;switch(j){case 1:return!!E.restoreWin;case 2:return!!E.minimizeWin;case 3:return!!E.setWinPosition;case 4:return!!E.setWinSizePixels;case 5:return!!E.raiseWin;case 6:return!!E.lowerWin;case 7:return!!E.refreshWin;case 8:return!!E.setWinSizeChars;case 9:return!!E.maximizeWin;case 10:return!!E.fullscreenWin;case 11:return!!E.getWinState;case 13:return!!E.getWinPosition;case 14:return!!E.getWinSizePixels;case 15:return!!E.getScreenSizePixels;case 16:return!!E.getCellSizePixels;case 18:return!!E.getWinSizeChars;case 19:return!!E.getScreenSizeChars;case 20:return!!E.getIconTitle;case 21:return!!E.getWinTitle;case 22:return!!E.pushTitle;case 23:return!!E.popTitle;case 24:return!!E.setWinLines}return!1}var A;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(o.WindowsOptionsReportType=A={}));let N=0;class W extends x.Disposable{getAttrData(){return this._curAttrData}constructor(E,D,I,B,K,F,Y,U,O=new g.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=D,this._coreService=I,this._logService=B,this._optionsService=K,this._oscLinkService=F,this._coreMouseService=Y,this._unicodeService=U,this._parser=O,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new n.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new l.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new l.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new l.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new l.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new l.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new l.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new l.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new l.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new l.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new l.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new l.EventEmitter),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 V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(R=>this._activeBuffer=R.activeBuffer)),this._parser.setCsiHandlerFallback((R,$)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(R),params:$.toArray()})}),this._parser.setEscHandlerFallback(R=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(R)})}),this._parser.setExecuteHandlerFallback(R=>{this._logService.debug("Unknown EXECUTE code: ",{code:R})}),this._parser.setOscHandlerFallback((R,$,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:R,action:$,data:H})}),this._parser.setDcsHandlerFallback((R,$,H)=>{$==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(R),action:$,payload:H})}),this._parser.setPrintHandler((R,$,H)=>this.print(R,$,H)),this._parser.registerCsiHandler({final:"@"},R=>this.insertChars(R)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},R=>this.scrollLeft(R)),this._parser.registerCsiHandler({final:"A"},R=>this.cursorUp(R)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},R=>this.scrollRight(R)),this._parser.registerCsiHandler({final:"B"},R=>this.cursorDown(R)),this._parser.registerCsiHandler({final:"C"},R=>this.cursorForward(R)),this._parser.registerCsiHandler({final:"D"},R=>this.cursorBackward(R)),this._parser.registerCsiHandler({final:"E"},R=>this.cursorNextLine(R)),this._parser.registerCsiHandler({final:"F"},R=>this.cursorPrecedingLine(R)),this._parser.registerCsiHandler({final:"G"},R=>this.cursorCharAbsolute(R)),this._parser.registerCsiHandler({final:"H"},R=>this.cursorPosition(R)),this._parser.registerCsiHandler({final:"I"},R=>this.cursorForwardTab(R)),this._parser.registerCsiHandler({final:"J"},R=>this.eraseInDisplay(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},R=>this.eraseInDisplay(R,!0)),this._parser.registerCsiHandler({final:"K"},R=>this.eraseInLine(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},R=>this.eraseInLine(R,!0)),this._parser.registerCsiHandler({final:"L"},R=>this.insertLines(R)),this._parser.registerCsiHandler({final:"M"},R=>this.deleteLines(R)),this._parser.registerCsiHandler({final:"P"},R=>this.deleteChars(R)),this._parser.registerCsiHandler({final:"S"},R=>this.scrollUp(R)),this._parser.registerCsiHandler({final:"T"},R=>this.scrollDown(R)),this._parser.registerCsiHandler({final:"X"},R=>this.eraseChars(R)),this._parser.registerCsiHandler({final:"Z"},R=>this.cursorBackwardTab(R)),this._parser.registerCsiHandler({final:"`"},R=>this.charPosAbsolute(R)),this._parser.registerCsiHandler({final:"a"},R=>this.hPositionRelative(R)),this._parser.registerCsiHandler({final:"b"},R=>this.repeatPrecedingCharacter(R)),this._parser.registerCsiHandler({final:"c"},R=>this.sendDeviceAttributesPrimary(R)),this._parser.registerCsiHandler({prefix:">",final:"c"},R=>this.sendDeviceAttributesSecondary(R)),this._parser.registerCsiHandler({final:"d"},R=>this.linePosAbsolute(R)),this._parser.registerCsiHandler({final:"e"},R=>this.vPositionRelative(R)),this._parser.registerCsiHandler({final:"f"},R=>this.hVPosition(R)),this._parser.registerCsiHandler({final:"g"},R=>this.tabClear(R)),this._parser.registerCsiHandler({final:"h"},R=>this.setMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"h"},R=>this.setModePrivate(R)),this._parser.registerCsiHandler({final:"l"},R=>this.resetMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"l"},R=>this.resetModePrivate(R)),this._parser.registerCsiHandler({final:"m"},R=>this.charAttributes(R)),this._parser.registerCsiHandler({final:"n"},R=>this.deviceStatus(R)),this._parser.registerCsiHandler({prefix:"?",final:"n"},R=>this.deviceStatusPrivate(R)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},R=>this.softReset(R)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},R=>this.setCursorStyle(R)),this._parser.registerCsiHandler({final:"r"},R=>this.setScrollRegion(R)),this._parser.registerCsiHandler({final:"s"},R=>this.saveCursor(R)),this._parser.registerCsiHandler({final:"t"},R=>this.windowOptions(R)),this._parser.registerCsiHandler({final:"u"},R=>this.restoreCursor(R)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},R=>this.insertColumns(R)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},R=>this.deleteColumns(R)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},R=>this.selectProtected(R)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},R=>this.requestMode(R,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},R=>this.requestMode(R,!1)),this._parser.setExecuteHandler(h.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(h.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(h.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(h.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(h.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(h.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(h.C1.IND,()=>this.index()),this._parser.setExecuteHandler(h.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(h.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new k.OscHandler(R=>(this.setTitle(R),this.setIconName(R),!0))),this._parser.registerOscHandler(1,new k.OscHandler(R=>this.setIconName(R))),this._parser.registerOscHandler(2,new k.OscHandler(R=>this.setTitle(R))),this._parser.registerOscHandler(4,new k.OscHandler(R=>this.setOrReportIndexedColor(R))),this._parser.registerOscHandler(8,new k.OscHandler(R=>this.setHyperlink(R))),this._parser.registerOscHandler(10,new k.OscHandler(R=>this.setOrReportFgColor(R))),this._parser.registerOscHandler(11,new k.OscHandler(R=>this.setOrReportBgColor(R))),this._parser.registerOscHandler(12,new k.OscHandler(R=>this.setOrReportCursorColor(R))),this._parser.registerOscHandler(104,new k.OscHandler(R=>this.restoreIndexedColor(R))),this._parser.registerOscHandler(110,new k.OscHandler(R=>this.restoreFgColor(R))),this._parser.registerOscHandler(111,new k.OscHandler(R=>this.restoreBgColor(R))),this._parser.registerOscHandler(112,new k.OscHandler(R=>this.restoreCursorColor(R))),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(const R in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:R},()=>this.selectCharset("("+R)),this._parser.registerEscHandler({intermediates:")",final:R},()=>this.selectCharset(")"+R)),this._parser.registerEscHandler({intermediates:"*",final:R},()=>this.selectCharset("*"+R)),this._parser.registerEscHandler({intermediates:"+",final:R},()=>this.selectCharset("+"+R)),this._parser.registerEscHandler({intermediates:"-",final:R},()=>this.selectCharset("-"+R)),this._parser.registerEscHandler({intermediates:".",final:R},()=>this.selectCharset("."+R)),this._parser.registerEscHandler({intermediates:"/",final:R},()=>this.selectCharset("/"+R));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(R=>(this._logService.error("Parsing error: ",R),R)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler((R,$)=>this.requestStatusString(R,$)))}_preserveStack(E,D,I,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=I,this._parseStack.position=B}_logSlowResolvingAsync(E){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([E,new Promise((D,I)=>setTimeout(()=>I("#SLOW_TIMEOUT"),5e3))]).catch(D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(E,D){let I,B=this._activeBuffer.x,K=this._activeBuffer.y,F=0;const Y=this._parseStack.paused;if(Y){if(I=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(I),I;B=this._parseStack.cursorStartX,K=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>M&&(F=this._parseStack.position+M)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,R=>String.fromCharCode(R)).join("")}"`),typeof E=="string"?E.split("").map(R=>R.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(E.length,M))),Y||this._dirtyRowTracker.clearRange(),E.length>M)for(let R=F;R<E.length;R+=M){const $=R+M<E.length?R+M:E.length,H=typeof E=="string"?this._stringDecoder.decode(E.substring(R,$),this._parseBuffer):this._utf8Decoder.decode(E.subarray(R,$),this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,H))return this._preserveStack(B,K,H,R),this._logSlowResolvingAsync(I),I}else if(!Y){const R=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,R))return this._preserveStack(B,K,R,0),this._logSlowResolvingAsync(I),I}this._activeBuffer.x===B&&this._activeBuffer.y===K||this._onCursorMove.fire();const U=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),O=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);O<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(O,this._bufferService.rows-1),Math.min(U,this._bufferService.rows-1))}print(E,D,I){let B,K;const F=this._charsetService.charset,Y=this._optionsService.rawOptions.screenReaderMode,U=this._bufferService.cols,O=this._coreService.decPrivateModes.wraparound,R=this._coreService.modes.insertMode,$=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&I-D>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,$);let Q=this._parser.precedingJoinState;for(let z=D;z<I;++z){if(B=E[z],B<127&&F){const Ie=F[String.fromCharCode(B)];Ie&&(B=Ie.charCodeAt(0))}const J=this._unicodeService.charProperties(B,Q);K=y.UnicodeService.extractWidth(J);const ie=y.UnicodeService.extractShouldJoin(J),fe=ie?y.UnicodeService.extractWidth(Q):0;if(Q=J,Y&&this._onA11yChar.fire((0,v.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+K-fe>U){if(O){const Ie=H;let ee=this._activeBuffer.x-fe;for(this._activeBuffer.x=fe,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),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),fe>0&&H instanceof u.BufferLine&&H.copyCellsFrom(Ie,ee,0,fe,!1);ee<U;)Ie.setCellFromCodepoint(ee++,0,1,$)}else if(this._activeBuffer.x=U-1,K===2)continue}if(ie&&this._activeBuffer.x){const Ie=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-Ie,B,K);for(let ee=K-fe;--ee>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,$)}else if(R&&(H.insertCells(this._activeBuffer.x,K-fe,this._activeBuffer.getNullCell($)),H.getWidth(U-1)===2&&H.setCellFromCodepoint(U-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,$)),H.setCellFromCodepoint(this._activeBuffer.x++,B,K,$),K>0)for(;--K;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,$)}this._parser.precedingJoinState=Q,this._activeBuffer.x<U&&I-D>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,$),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,D){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,D):this._parser.registerCsiHandler(E,I=>!P(I.params[0],this._optionsService.rawOptions.windowOptions)||D(I))}registerDcsHandler(E,D){return this._parser.registerDcsHandler(E,new m.DcsHandler(D))}registerEscHandler(E,D){return this._parser.registerEscHandler(E,D)}registerOscHandler(E,D){return this._parser.registerOscHandler(E,new k.OscHandler(D))}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;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const 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,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=E,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+D)}cursorUp(E){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,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){const D=E.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){const D=E.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,D,I,B=!1,K=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);F.replaceCells(D,I,this._activeBuffer.getNullCell(this._eraseAttrData()),K),B&&(F.isWrapped=!1)}_resetBufferLine(E,D=!1){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);I&&(I.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),I.isWrapped=!1)}eraseInDisplay(E,D=!1){let I;switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);I<this._bufferService.rows;I++)this._resetBufferLine(I,D);this._dirtyRowTracker.markDirty(I);break;case 1:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(I+1).isWrapped=!1);I--;)this._resetBufferLine(I,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(I=this._bufferService.rows,this._dirtyRowTracker.markDirty(I-1);I--;)this._resetBufferLine(I,D);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(E,D=!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,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(E){this._restrictCursor();let D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,K=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;D--;)this._activeBuffer.lines.splice(K-1,1),this._activeBuffer.lines.splice(I,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 D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;D--;)this._activeBuffer.lines.splice(I,1),this._activeBuffer.lines.splice(B,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();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let D=E.params[0]||1;for(;D--;)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 D=E.params[0]||1;for(;D--;)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(u.DEFAULT_ATTR_DATA));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;const D=E.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);B.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.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;const D=E.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);B.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.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;const D=E.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);B.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.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;const D=E.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);B.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.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){const D=this._parser.precedingJoinState;if(!D)return!0;const I=E.params[0]||1,B=y.UnicodeService.extractWidth(D),K=this._activeBuffer.x-B,F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(K),Y=new Uint32Array(F.length*I);let U=0;for(let R=0;R<F.length;){const $=F.codePointAt(R)||0;Y[U++]=$,R+=$>65535?2:1}let O=U;for(let R=1;R<I;++R)Y.copyWithin(O,0,U),O+=U;return this.print(Y,0,O),!0}sendDeviceAttributesPrimary(E){return E.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(E){return(this._optionsService.rawOptions.termName+"").indexOf(E)===0}setMode(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);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(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");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[D]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(E,D){const I=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:K}=this._coreMouseService,F=this._coreService,{buffers:Y,cols:U}=this._bufferService,{active:O,alt:R}=Y,$=this._optionsService.rawOptions,H=ie=>ie?1:2,Q=E.params[0];return z=Q,J=D?Q===2?4:Q===4?H(F.modes.insertMode):Q===12?3:Q===20?H($.convertEol):0:Q===1?H(I.applicationCursorKeys):Q===3?$.windowOptions.setWinLines?U===80?2:U===132?1:0:0:Q===6?H(I.origin):Q===7?H(I.wraparound):Q===8?3:Q===9?H(B==="X10"):Q===12?H($.cursorBlink):Q===25?H(!F.isCursorHidden):Q===45?H(I.reverseWraparound):Q===66?H(I.applicationKeypad):Q===67?4:Q===1e3?H(B==="VT200"):Q===1002?H(B==="DRAG"):Q===1003?H(B==="ANY"):Q===1004?H(I.sendFocus):Q===1005?4:Q===1006?H(K==="SGR"):Q===1015?4:Q===1016?H(K==="SGR_PIXELS"):Q===1048?1:Q===47||Q===1047||Q===1049?H(O===R):Q===2004?H(I.bracketedPasteMode):0,F.triggerDataEvent(`${h.C0.ESC}[${D?"":"?"}${z};${J}$y`),!0;var z,J}_updateAttrColor(E,D,I,B,K){return D===2?(E|=50331648,E&=-16777216,E|=p.AttributeData.fromColorRGB([I,B,K])):D===5&&(E&=-50331904,E|=33554432|255&I),E}_extractColor(E,D,I){const B=[0,0,-1,0,0,0];let K=0,F=0;do{if(B[F+K]=E.params[D+F],E.hasSubParams(D+F)){const Y=E.getSubParams(D+F);let U=0;do B[1]===5&&(K=1),B[F+U+1+K]=Y[U];while(++U<Y.length&&U+F+1+K<B.length);break}if(B[1]===5&&F+K>=2||B[1]===2&&F+K>=5)break;B[1]&&(K=1)}while(++F+D<E.length&&F+K<B.length);for(let Y=2;Y<B.length;++Y)B[Y]===-1&&(B[Y]=0);switch(B[0]){case 38:I.fg=this._updateAttrColor(I.fg,B[1],B[3],B[4],B[5]);break;case 48:I.bg=this._updateAttrColor(I.bg,B[1],B[3],B[4],B[5]);break;case 58:I.extended=I.extended.clone(),I.extended.underlineColor=this._updateAttrColor(I.extended.underlineColor,B[1],B[3],B[4],B[5])}return F}_processUnderline(E,D){D.extended=D.extended.clone(),(!~E||E>5)&&(E=1),D.extended.underlineStyle=E,D.fg|=268435456,E===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(E){E.fg=u.DEFAULT_ATTR_DATA.fg,E.bg=u.DEFAULT_ATTR_DATA.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;const D=E.length;let I;const B=this._curAttrData;for(let K=0;K<D;K++)I=E.params[K],I>=30&&I<=37?(B.fg&=-50331904,B.fg|=16777216|I-30):I>=40&&I<=47?(B.bg&=-50331904,B.bg|=16777216|I-40):I>=90&&I<=97?(B.fg&=-50331904,B.fg|=16777224|I-90):I>=100&&I<=107?(B.bg&=-50331904,B.bg|=16777224|I-100):I===0?this._processSGR0(B):I===1?B.fg|=134217728:I===3?B.bg|=67108864:I===4?(B.fg|=268435456,this._processUnderline(E.hasSubParams(K)?E.getSubParams(K)[0]:1,B)):I===5?B.fg|=536870912:I===7?B.fg|=67108864:I===8?B.fg|=1073741824:I===9?B.fg|=2147483648:I===2?B.bg|=134217728:I===21?this._processUnderline(2,B):I===22?(B.fg&=-134217729,B.bg&=-134217729):I===23?B.bg&=-67108865:I===24?(B.fg&=-268435457,this._processUnderline(0,B)):I===25?B.fg&=-536870913:I===27?B.fg&=-67108865:I===28?B.fg&=-1073741825:I===29?B.fg&=2147483647:I===39?(B.fg&=-67108864,B.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):I===49?(B.bg&=-67108864,B.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?K+=this._extractColor(E,K,B):I===53?B.bg|=1073741824:I===55?B.bg&=-1073741825:I===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):I===100?(B.fg&=-67108864,B.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",I);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${D};${I}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const D=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${D};${I}R`)}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=u.DEFAULT_ATTR_DATA.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){const D=E.params[0]||1;switch(D){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const I=D%2==1;return this._optionsService.options.cursorBlink=I,!0}setScrollRegion(E){const D=E.params[0]||1;let I;return(E.length<2||(I=E.params[1])>this._bufferService.rows||I===0)&&(I=this._bufferService.rows),I>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=I-1,this._setCursor(0,0)),!0}windowOptions(E){if(!P(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(A.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(A.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}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){const D=[],I=E.split(";");for(;I.length>1;){const B=I.shift(),K=I.shift();if(/^\d+$/.exec(B)){const F=parseInt(B);if(X(F))if(K==="?")D.push({type:0,index:F});else{const Y=(0,b.parseColor)(K);Y&&D.push({type:1,index:F,color:Y})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(E){const D=E.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(E,D){this._getCurrentLinkId()&&this._finishHyperlink();const I=E.split(":");let B;const K=I.findIndex(F=>F.startsWith("id="));return K!==-1&&(B=I[K].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(E,D){const I=E.split(";");for(let B=0;B<I.length&&!(D>=this._specialColors.length);++B,++D)if(I[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const K=(0,b.parseColor)(I[B]);K&&this._onColor.fire([{type:1,index:this._specialColors[D],color:K}])}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;const D=[],I=E.split(";");for(let B=0;B<I.length;++B)if(/^\d+$/.exec(I[B])){const K=parseInt(I[B]);X(K)&&D.push({type:2,index:K})}return D.length&&this._onColor.fire(D),!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,_.DEFAULT_CHARSET),!0}selectCharset(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(T[E[0]],_.CHARSETS[E[1]]||_.DEFAULT_CHARSET),!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){const 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=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(E){return this._charsetService.setgLevel(E),!0}screenAlignmentPattern(){const E=new n.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const I=this._activeBuffer.ybase+this._activeBuffer.y+D,B=this._activeBuffer.lines.get(I);B&&(B.fill(E),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,D){const I=this._bufferService.buffer,B=this._optionsService.rawOptions;return(K=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${K}${h.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${I.scrollTop+1};${I.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,D){this._dirtyRowTracker.markRangeDirty(E,D)}}o.InputHandler=W;let V=class{constructor(j){this._bufferService=j,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(j){j<this.start?this.start=j:j>this.end&&(this.end=j)}markRangeDirty(j,E){j>E&&(N=j,j=E,E=N),j<this.start&&(this.start=j),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(j){return 0<=j&&j<256}V=d([S(0,w.IBufferService)],V)},844:(C,o)=>{function c(d){for(const S of d)S.dispose();d.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const S=this._disposables.indexOf(d);S!==-1&&this._disposables.splice(S,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var S;this._isDisposed||d===this._value||((S=this._value)==null||S.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},o.toDisposable=function(d){return{dispose:d}},o.disposeArray=c,o.getDisposeArrayDisposable=function(d){return{dispose:()=>c(d)}}},1505:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(S,h,_){this._data[S]||(this._data[S]={}),this._data[S][h]=_}get(S,h){return this._data[S]?this._data[S][h]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(d,S,h,_,g){this._data.get(d,S)||this._data.set(d,S,new c),this._data.get(d,S).set(h,_,g)}get(d,S,h,_){var g;return(g=this._data.get(d,S))==null?void 0:g.get(h,_)}clear(){this._data.clear()}}},6114:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,d=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const S=c.match(/Version\/(\d+)/);return S===null||S.length<2?0:parseInt(S[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),o.isIpad=d==="iPad",o.isIphone=d==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),o.isLinux=d.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(c=this._search(this._getKey(d)),this._array.splice(c,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const S=this._getKey(d);if(S===void 0||(c=this._search(S),c===-1)||this._getKey(this._array[c])!==S)return!1;do if(this._array[c]===d)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===S);return!1}*getKeyIterator(d){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===d)}forEachByKey(d,S){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do S(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===d)}values(){return[...this._array].values()}_search(d){let S=0,h=this._array.length-1;for(;h>=S;){let _=S+h>>1;const g=this._getKey(this._array[_]);if(g>d)h=_-1;else{if(!(g<d)){for(;_>0&&this._getKey(this._array[_-1])===d;)_--;return _}S=_+1}}return S}}},7226:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const d=c(6114);class S{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),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(g){this._idleCallback=void 0;let x=0,v=0,u=g.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),v=Math.max(x,v),l=g.timeRemaining(),1.5*v>l)return u-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-x))}ms`),void this._start();u=l}this.clear()}}class h extends S{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const x=Date.now()+g;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=h,o.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends S{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:h,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const d=c(643);o.updateWindowsModeWrappedState=function(S){const h=S.buffer.lines.get(S.buffer.ybase+S.buffer.y-1),_=h==null?void 0:h.get(S.cols-1),g=S.buffer.lines.get(S.buffer.ybase+S.buffer.y);g&&_&&(g.isWrapped=_[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&_[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,_=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=_}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=d},9092:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const d=c(6349),S=c(7226),h=c(3734),_=c(8437),g=c(4634),x=c(511),v=c(643),u=c(4863),l=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(s,n,p){this._hasScrollback=s,this._optionsService=n,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new S.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,n){return new _.BufferLine(this._bufferService.cols,this.getNullCell(s),n)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const n=s+this._optionsService.rawOptions.scrollback;return n>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:n}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=_.DEFAULT_ATTR_DATA);let n=this._rows;for(;n--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,n){const p=this.getNullCell(_.DEFAULT_ATTR_DATA);let w=0;const y=this._getCorrectBufferLength(n);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<s)for(let m=0;m<this.lines.length;m++)w+=+this.lines.get(m).resize(s,p);let k=0;if(this._rows<n)for(let m=this._rows;m<n;m++)this.lines.length<n+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(s,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(s,p)));else for(let m=this._rows;m>n;m--)this.lines.length>n+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){const m=this.lines.length-y;m>0&&(this.lines.trimStart(m),this.ybase=Math.max(this.ybase-m,0),this.ydisp=Math.max(this.ydisp-m,0),this.savedY=Math.max(this.savedY-m,0)),this.lines.maxLength=y}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,n-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=n-1,this._isReflowEnabled&&(this._reflow(s,n),this._cols>s))for(let k=0;k<this.lines.length;k++)w+=+this.lines.get(k).resize(s,p);this._cols=s,this._rows=n,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let n=0;for(;this._memoryCleanupPosition<this.lines.length;)if(n+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),n>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,n){this._cols!==s&&(s>this._cols?this._reflowLarger(s,n):this._reflowSmaller(s,n))}_reflowLarger(s,n){const p=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(p.length>0){const w=(0,g.reflowLargerCreateNewLayout)(this.lines,p);(0,g.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(s,n,w.countRemoved)}}_reflowLargerAdjustViewport(s,n,p){const w=this.getNullCell(_.DEFAULT_ATTR_DATA);let y=p;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<n&&this.lines.push(new _.BufferLine(s,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(s,n){const p=this.getNullCell(_.DEFAULT_ATTR_DATA),w=[];let y=0;for(let k=this.lines.length-1;k>=0;k--){let m=this.lines.get(k);if(!m||!m.isWrapped&&m.getTrimmedLength()<=s)continue;const b=[m];for(;m.isWrapped&&k>0;)m=this.lines.get(--k),b.unshift(m);const T=this.ybase+this.y;if(T>=k&&T<k+b.length)continue;const M=b[b.length-1].getTrimmedLength(),P=(0,g.reflowSmallerGetNewLineLengths)(b,this._cols,s),A=P.length-b.length;let N;N=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+A):Math.max(0,this.lines.length-this.lines.maxLength+A);const W=[];for(let I=0;I<A;I++){const B=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);W.push(B)}W.length>0&&(w.push({start:k+b.length+y,newLines:W}),y+=W.length),b.push(...W);let V=P.length-1,X=P[V];X===0&&(V--,X=P[V]);let j=b.length-A-1,E=M;for(;j>=0;){const I=Math.min(E,X);if(b[V]===void 0)break;if(b[V].copyCellsFrom(b[j],E-I,X-I,I,!0),X-=I,X===0&&(V--,X=P[V]),E-=I,E===0){j--;const B=Math.max(j,0);E=(0,g.getWrappedLineTrimmedLength)(b,B,this._cols)}}for(let I=0;I<b.length;I++)P[I]<s&&b[I].setCell(P[I],p);let D=A-N;for(;D-- >0;)this.ybase===0?this.y<n-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-n&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+A,this.ybase+n-1)}if(w.length>0){const k=[],m=[];for(let V=0;V<this.lines.length;V++)m.push(this.lines.get(V));const b=this.lines.length;let T=b-1,M=0,P=w[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let A=0;for(let V=Math.min(this.lines.maxLength-1,b+y-1);V>=0;V--)if(P&&P.start>T+A){for(let X=P.newLines.length-1;X>=0;X--)this.lines.set(V--,P.newLines[X]);V++,k.push({index:T+1,amount:P.newLines.length}),A+=P.newLines.length,P=w[++M]}else this.lines.set(V,m[T--]);let N=0;for(let V=k.length-1;V>=0;V--)k[V].index+=N,this.lines.onInsertEmitter.fire(k[V]),N+=k[V].amount;const W=Math.max(0,b+y-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(s,n,p=0,w){const y=this.lines.get(s);return y?y.translateToString(n,p,w):""}getWrappedRangeForLine(s){let n=s,p=s;for(;n>0&&this.lines.get(n).isWrapped;)n--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:n,last:p}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let n=0;n<this.markers.length;n++)this.markers[n].line===s&&(this.markers[n].dispose(),this.markers.splice(n--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const n=new u.Marker(s);return this.markers.push(n),n.register(this.lines.onTrim(p=>{n.line-=p,n.line<0&&n.dispose()})),n.register(this.lines.onInsert(p=>{n.line>=p.index&&(n.line+=p.amount)})),n.register(this.lines.onDelete(p=>{n.line>=p.index&&n.line<p.index+p.amount&&n.dispose(),n.line>p.index&&(n.line-=p.amount)})),n.register(n.onDispose(()=>this._removeMarker(n))),n}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const d=c(3734),S=c(511),h=c(643),_=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let g=0;class x{constructor(u,l,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);const n=l||S.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let p=0;p<u;++p)this.setCell(p,n);this.length=u}get(u){const l=this._data[3*u+0],s=2097151&l;return[this._data[3*u+1],2097152&l?this._combined[u]:s?(0,_.stringFromCodePoint)(s):"",l>>22,2097152&l?this._combined[u].charCodeAt(this._combined[u].length-1):s]}set(u,l){this._data[3*u+1]=l[h.CHAR_DATA_ATTR_INDEX],l[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=l[1],this._data[3*u+0]=2097152|u|l[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=l[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){const l=this._data[3*u+0];return 2097152&l?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&l}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){const l=this._data[3*u+0];return 2097152&l?this._combined[u]:2097151&l?(0,_.stringFromCodePoint)(2097151&l):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,l){return g=3*u,l.content=this._data[g+0],l.fg=this._data[g+1],l.bg=this._data[g+2],2097152&l.content&&(l.combinedData=this._combined[u]),268435456&l.bg&&(l.extended=this._extendedAttrs[u]),l}setCell(u,l){2097152&l.content&&(this._combined[u]=l.combinedData),268435456&l.bg&&(this._extendedAttrs[u]=l.extended),this._data[3*u+0]=l.content,this._data[3*u+1]=l.fg,this._data[3*u+2]=l.bg}setCellFromCodepoint(u,l,s,n){268435456&n.bg&&(this._extendedAttrs[u]=n.extended),this._data[3*u+0]=l|s<<22,this._data[3*u+1]=n.fg,this._data[3*u+2]=n.bg}addCodepointToCell(u,l,s){let n=this._data[3*u+0];2097152&n?this._combined[u]+=(0,_.stringFromCodePoint)(l):2097151&n?(this._combined[u]=(0,_.stringFromCodePoint)(2097151&n)+(0,_.stringFromCodePoint)(l),n&=-2097152,n|=2097152):n=l|4194304,s&&(n&=-12582913,n|=s<<22),this._data[3*u+0]=n}insertCells(u,l,s){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),l<this.length-u){const n=new S.CellData;for(let p=this.length-u-l-1;p>=0;--p)this.setCell(u+l+p,this.loadCell(u+p,n));for(let p=0;p<l;++p)this.setCell(u+p,s)}else for(let n=u;n<this.length;++n)this.setCell(n,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(u,l,s){if(u%=this.length,l<this.length-u){const n=new S.CellData;for(let p=0;p<this.length-u-l;++p)this.setCell(u+p,this.loadCell(u+l+p,n));for(let p=this.length-l;p<this.length;++p)this.setCell(p,s)}else for(let n=u;n<this.length;++n)this.setCell(n,s);u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodepoint(u,0,1,s)}replaceCells(u,l,s,n=!1){if(n)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodepoint(u-1,0,1,s),l<this.length&&this.getWidth(l-1)===2&&!this.isProtected(l)&&this.setCellFromCodepoint(l,0,1,s);u<l&&u<this.length;)this.isProtected(u)||this.setCell(u,s),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),l<this.length&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l,0,1,s);u<l&&u<this.length;)this.setCell(u++,s)}resize(u,l){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const n=new Uint32Array(s);n.set(this._data),this._data=n}for(let n=this.length;n<u;++n)this.setCell(n,l)}else{this._data=this._data.subarray(0,s);const n=Object.keys(this._combined);for(let w=0;w<n.length;w++){const y=parseInt(n[w],10);y>=u&&delete this._combined[y]}const p=Object.keys(this._extendedAttrs);for(let w=0;w<p.length;w++){const y=parseInt(p[w],10);y>=u&&delete this._extendedAttrs[y]}}return this.length=u,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,l=!1){if(l)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,u);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(const l in u._combined)this._combined[l]=u._combined[l];this._extendedAttrs={};for(const l in u._extendedAttrs)this._extendedAttrs[l]=u._extendedAttrs[l];this.isWrapped=u.isWrapped}clone(){const u=new x(0);u._data=new Uint32Array(this._data),u.length=this.length;for(const l in this._combined)u._combined[l]=this._combined[l];for(const l in this._extendedAttrs)u._extendedAttrs[l]=this._extendedAttrs[l];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,l,s,n,p){const w=u._data;if(p)for(let k=n-1;k>=0;k--){for(let m=0;m<3;m++)this._data[3*(s+k)+m]=w[3*(l+k)+m];268435456&w[3*(l+k)+2]&&(this._extendedAttrs[s+k]=u._extendedAttrs[l+k])}else for(let k=0;k<n;k++){for(let m=0;m<3;m++)this._data[3*(s+k)+m]=w[3*(l+k)+m];268435456&w[3*(l+k)+2]&&(this._extendedAttrs[s+k]=u._extendedAttrs[l+k])}const y=Object.keys(u._combined);for(let k=0;k<y.length;k++){const m=parseInt(y[k],10);m>=l&&(this._combined[m-l+s]=u._combined[m])}}translateToString(u,l,s,n){l=l??0,s=s??this.length,u&&(s=Math.min(s,this.getTrimmedLength())),n&&(n.length=0);let p="";for(;l<s;){const w=this._data[3*l+0],y=2097151&w,k=2097152&w?this._combined[l]:y?(0,_.stringFromCodePoint)(y):h.WHITESPACE_CELL_CHAR;if(p+=k,n)for(let m=0;m<k.length;++m)n.push(l);l+=w>>22||1}return n&&n.push(l),p}}o.BufferLine=x},4841:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,d){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return d*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(C,o)=>{function c(d,S,h){if(S===d.length-1)return d[S].getTrimmedLength();const _=!d[S].hasContent(h-1)&&d[S].getWidth(h-1)===1,g=d[S+1].getWidth(0)===2;return _&&g?h-1:h}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(d,S,h,_,g){const x=[];for(let v=0;v<d.length-1;v++){let u=v,l=d.get(++u);if(!l.isWrapped)continue;const s=[d.get(v)];for(;u<d.length&&l.isWrapped;)s.push(l),l=d.get(++u);if(_>=v&&_<u){v+=s.length-1;continue}let n=0,p=c(s,n,S),w=1,y=0;for(;w<s.length;){const m=c(s,w,S),b=m-y,T=h-p,M=Math.min(b,T);s[n].copyCellsFrom(s[w],y,p,M,!1),p+=M,p===h&&(n++,p=0),y+=M,y===m&&(w++,y=0),p===0&&n!==0&&s[n-1].getWidth(h-1)===2&&(s[n].copyCellsFrom(s[n-1],h-1,p++,1,!1),s[n-1].setCell(h-1,g))}s[n].replaceCells(p,h,g);let k=0;for(let m=s.length-1;m>0&&(m>n||s[m].getTrimmedLength()===0);m--)k++;k>0&&(x.push(v+s.length-k),x.push(k)),v+=s.length-1}return x},o.reflowLargerCreateNewLayout=function(d,S){const h=[];let _=0,g=S[_],x=0;for(let v=0;v<d.length;v++)if(g===v){const u=S[++_];d.onDeleteEmitter.fire({index:v-x,amount:u}),v+=u-1,x+=u,g=S[++_]}else h.push(v);return{layout:h,countRemoved:x}},o.reflowLargerApplyNewLayout=function(d,S){const h=[];for(let _=0;_<S.length;_++)h.push(d.get(S[_]));for(let _=0;_<h.length;_++)d.set(_,h[_]);d.length=S.length},o.reflowSmallerGetNewLineLengths=function(d,S,h){const _=[],g=d.map((l,s)=>c(d,s,S)).reduce((l,s)=>l+s);let x=0,v=0,u=0;for(;u<g;){if(g-u<h){_.push(g-u);break}x+=h;const l=c(d,v,S);x>l&&(x-=l,v++);const s=d[v].getWidth(x-1)===2;s&&x--;const n=s?h-1:h;_.push(n),u+=n}return _},o.getWrappedLineTrimmedLength=c},5295:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const d=c(8460),S=c(844),h=c(9092);class _ extends S.Disposable{constructor(x,v){super(),this._optionsService=x,this._bufferService=v,this._onBufferActivate=this.register(new d.EventEmitter),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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!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(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),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(x,v){this._normal.resize(x,v),this._alt.resize(x,v),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=_},511:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const d=c(482),S=c(643),h=c(3734);class _ extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const v=new _;return v.setFromCharData(x),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[S.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(x[S.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(x[S.CHAR_DATA_CHAR_INDEX].length===2){const u=x[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){const l=x[S.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(u-55296)+l-56320+65536|x[S.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=x[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[S.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=x[S.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[S.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=_},643:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const d=c(8460),S=c(844);class h{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,S.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}o.Marker=h,h._nextId=1},7116:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(C,o)=>{var c,d,S;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
|
|
47
|
+
`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""}(c||(o.C0=c={})),function(h){h.PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC=""}(d||(o.C1=d={})),function(h){h.ST=`${c.ESC}\\`}(S||(o.C1_ESCAPED=S={}))},7399:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const d=c(2584),S={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:["'",'"']};o.evaluateKeyboardEvent=function(h,_,g,x){const v={type:0,cancel:!1,key:void 0},u=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?v.key=_?d.C0.ESC+"OA":d.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?v.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?v.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(v.key=_?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:v.key=h.ctrlKey?"\b":d.C0.DEL,h.altKey&&(v.key=d.C0.ESC+v.key);break;case 9:if(h.shiftKey){v.key=d.C0.ESC+"[Z";break}v.key=d.C0.HT,v.cancel=!0;break;case 13:v.key=h.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,v.cancel=!0;break;case 27:v.key=d.C0.ESC,h.altKey&&(v.key=d.C0.ESC+d.C0.ESC),v.cancel=!0;break;case 37:if(h.metaKey)break;u?(v.key=d.C0.ESC+"[1;"+(u+1)+"D",v.key===d.C0.ESC+"[1;3D"&&(v.key=d.C0.ESC+(g?"b":"[1;5D"))):v.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(h.metaKey)break;u?(v.key=d.C0.ESC+"[1;"+(u+1)+"C",v.key===d.C0.ESC+"[1;3C"&&(v.key=d.C0.ESC+(g?"f":"[1;5C"))):v.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(h.metaKey)break;u?(v.key=d.C0.ESC+"[1;"+(u+1)+"A",g||v.key!==d.C0.ESC+"[1;3A"||(v.key=d.C0.ESC+"[1;5A")):v.key=_?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(h.metaKey)break;u?(v.key=d.C0.ESC+"[1;"+(u+1)+"B",g||v.key!==d.C0.ESC+"[1;3B"||(v.key=d.C0.ESC+"[1;5B")):v.key=_?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(v.key=d.C0.ESC+"[2~");break;case 46:v.key=u?d.C0.ESC+"[3;"+(u+1)+"~":d.C0.ESC+"[3~";break;case 36:v.key=u?d.C0.ESC+"[1;"+(u+1)+"H":_?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:v.key=u?d.C0.ESC+"[1;"+(u+1)+"F":_?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:h.shiftKey?v.type=2:h.ctrlKey?v.key=d.C0.ESC+"[5;"+(u+1)+"~":v.key=d.C0.ESC+"[5~";break;case 34:h.shiftKey?v.type=3:h.ctrlKey?v.key=d.C0.ESC+"[6;"+(u+1)+"~":v.key=d.C0.ESC+"[6~";break;case 112:v.key=u?d.C0.ESC+"[1;"+(u+1)+"P":d.C0.ESC+"OP";break;case 113:v.key=u?d.C0.ESC+"[1;"+(u+1)+"Q":d.C0.ESC+"OQ";break;case 114:v.key=u?d.C0.ESC+"[1;"+(u+1)+"R":d.C0.ESC+"OR";break;case 115:v.key=u?d.C0.ESC+"[1;"+(u+1)+"S":d.C0.ESC+"OS";break;case 116:v.key=u?d.C0.ESC+"[15;"+(u+1)+"~":d.C0.ESC+"[15~";break;case 117:v.key=u?d.C0.ESC+"[17;"+(u+1)+"~":d.C0.ESC+"[17~";break;case 118:v.key=u?d.C0.ESC+"[18;"+(u+1)+"~":d.C0.ESC+"[18~";break;case 119:v.key=u?d.C0.ESC+"[19;"+(u+1)+"~":d.C0.ESC+"[19~";break;case 120:v.key=u?d.C0.ESC+"[20;"+(u+1)+"~":d.C0.ESC+"[20~";break;case 121:v.key=u?d.C0.ESC+"[21;"+(u+1)+"~":d.C0.ESC+"[21~";break;case 122:v.key=u?d.C0.ESC+"[23;"+(u+1)+"~":d.C0.ESC+"[23~";break;case 123:v.key=u?d.C0.ESC+"[24;"+(u+1)+"~":d.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(g&&!x||!h.altKey||h.metaKey)!g||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?v.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(v.key=d.C0.US),h.key==="@"&&(v.key=d.C0.NUL)):h.keyCode===65&&(v.type=1);else{const l=S[h.keyCode],s=l==null?void 0:l[h.shiftKey?1:0];if(s)v.key=d.C0.ESC+s;else if(h.keyCode>=65&&h.keyCode<=90){const n=h.ctrlKey?h.keyCode-64:h.keyCode+32;let p=String.fromCharCode(n);h.shiftKey&&(p=p.toUpperCase()),v.key=d.C0.ESC+p}else if(h.keyCode===32)v.key=d.C0.ESC+(h.ctrlKey?d.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let n=h.code.slice(3,4);h.shiftKey||(n=n.toLowerCase()),v.key=d.C0.ESC+n,v.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?v.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?v.key=d.C0.NUL:h.keyCode>=51&&h.keyCode<=55?v.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?v.key=d.C0.DEL:h.keyCode===219?v.key=d.C0.ESC:h.keyCode===220?v.key=d.C0.FS:h.keyCode===221&&(v.key=d.C0.GS)}return v}},482:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,d=0,S=c.length){let h="";for(let _=d;_<S;++_){let g=c[_];g>65535?(g-=65536,h+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):h+=String.fromCharCode(g)}return h},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,d){const S=c.length;if(!S)return 0;let h=0,_=0;if(this._interim){const g=c.charCodeAt(_++);56320<=g&&g<=57343?d[h++]=1024*(this._interim-55296)+g-56320+65536:(d[h++]=this._interim,d[h++]=g),this._interim=0}for(let g=_;g<S;++g){const x=c.charCodeAt(g);if(55296<=x&&x<=56319){if(++g>=S)return this._interim=x,h;const v=c.charCodeAt(g);56320<=v&&v<=57343?d[h++]=1024*(x-55296)+v-56320+65536:(d[h++]=x,d[h++]=v)}else x!==65279&&(d[h++]=x)}return h}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,d){const S=c.length;if(!S)return 0;let h,_,g,x,v=0,u=0,l=0;if(this.interim[0]){let p=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let y,k=0;for(;(y=63&this.interim[++k])&&k<4;)w<<=6,w|=y;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,b=m-k;for(;l<b;){if(l>=S)return 0;if(y=c[l++],(192&y)!=128){l--,p=!0;break}this.interim[k++]=y,w<<=6,w|=63&y}p||(m===2?w<128?l--:d[v++]=w:m===3?w<2048||w>=55296&&w<=57343||w===65279||(d[v++]=w):w<65536||w>1114111||(d[v++]=w)),this.interim.fill(0)}const s=S-4;let n=l;for(;n<S;){for(;!(!(n<s)||128&(h=c[n])||128&(_=c[n+1])||128&(g=c[n+2])||128&(x=c[n+3]));)d[v++]=h,d[v++]=_,d[v++]=g,d[v++]=x,n+=4;if(h=c[n++],h<128)d[v++]=h;else if((224&h)==192){if(n>=S)return this.interim[0]=h,v;if(_=c[n++],(192&_)!=128){n--;continue}if(u=(31&h)<<6|63&_,u<128){n--;continue}d[v++]=u}else if((240&h)==224){if(n>=S)return this.interim[0]=h,v;if(_=c[n++],(192&_)!=128){n--;continue}if(n>=S)return this.interim[0]=h,this.interim[1]=_,v;if(g=c[n++],(192&g)!=128){n--;continue}if(u=(15&h)<<12|(63&_)<<6|63&g,u<2048||u>=55296&&u<=57343||u===65279)continue;d[v++]=u}else if((248&h)==240){if(n>=S)return this.interim[0]=h,v;if(_=c[n++],(192&_)!=128){n--;continue}if(n>=S)return this.interim[0]=h,this.interim[1]=_,v;if(g=c[n++],(192&g)!=128){n--;continue}if(n>=S)return this.interim[0]=h,this.interim[1]=_,this.interim[2]=g,v;if(x=c[n++],(192&x)!=128){n--;continue}if(u=(7&h)<<18|(63&_)<<12|(63&g)<<6|63&x,u<65536||u>1114111)continue;d[v++]=u}}return v}}},225:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const d=c(1480),S=[[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]],h=[[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]];let _;o.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let g=0;g<S.length;++g)_.fill(0,S[g][0],S[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?_[g]:function(x,v){let u,l=0,s=v.length-1;if(x<v[0][0]||x>v[s][1])return!1;for(;s>=l;)if(u=l+s>>1,x>v[u][1])l=u+1;else{if(!(x<v[u][0]))return!0;s=u-1}return!1}(g,h)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,x){let v=this.wcwidth(g),u=v===0&&x!==0;if(u){const l=d.UnicodeService.extractWidth(x);l===0?u=!1:l>v&&(v=l)}return d.UnicodeService.createPropertyValue(0,v,u)}}},5981:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const d=c(8460),S=c(844);class h extends S.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(x),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(x)}_innerWrite(g=0,x=!0){const v=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const u=this._writeBuffer[this._bufferOffset],l=this._action(u,x);if(l){const n=p=>Date.now()-v>=12?setTimeout(()=>this._innerWrite(0,p)):this._innerWrite(v,p);return void l.catch(p=>(queueMicrotask(()=>{throw p}),Promise.resolve(!1))).then(n)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-v>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}o.WriteBuffer=h},5941:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\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})$/,d=/^[\da-f]+$/;function S(h,_){const g=h.toString(16),x=g.length<2?"0"+g:g;switch(_){case 4:return g[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(h){if(!h)return;let _=h.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const g=c.exec(_);if(g){const x=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/x*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/x*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/x*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),d.exec(_)&&[3,6,9,12].includes(_.length))){const g=_.length/3,x=[0,0,0];for(let v=0;v<3;++v){const u=parseInt(_.slice(g*v,g*v+g),16);x[v]=g===1?u<<4:g===2?u:g===3?u>>4:u>>8}return x}},o.toRgbString=function(h,_=16){const[g,x,v]=h;return`rgb:${S(g,_)}/${S(x,_)}/${S(v,_)}`}},5770:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const d=c(482),S=c(8742),h=c(5770),_=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(x,v){this._handlers[x]===void 0&&(this._handlers[x]=[]);const u=this._handlers[x];return u.push(v),{dispose:()=>{const l=u.indexOf(v);l!==-1&&u.splice(l,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(x,v){if(this.reset(),this._ident=x,this._active=this._handlers[x]||_,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(x,v,u){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(x,v,u);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(x,v,u))}unhook(x,v=!0){if(this._active.length){let u=!1,l=this._active.length-1,s=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,u=v,s=this._stack.fallThrough,this._stack.paused=!1),!s&&u===!1){for(;l>=0&&(u=this._active[l].unhook(x),u!==!0);l--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,u;l--}for(;l>=0;l--)if(u=this._active[l].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",x);this._active=_,this._ident=0}};const g=new S.Params;g.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=g,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():g,this._data="",this._hitLimit=!1}put(x,v,u){this._hitLimit||(this._data+=(0,d.utf32ToString)(x,v,u),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let v=!1;if(this._hitLimit)v=!1;else if(x&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then(u=>(this._params=g,this._data="",this._hitLimit=!1,u));return this._params=g,this._data="",this._hitLimit=!1,v}}},2015:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const d=c(844),S=c(8742),h=c(6242),_=c(6351);class g{constructor(l){this.table=new Uint8Array(l)}setDefault(l,s){this.table.fill(l<<4|s)}add(l,s,n,p){this.table[s<<8|l]=n<<4|p}addMany(l,s,n,p){for(let w=0;w<l.length;w++)this.table[s<<8|l[w]]=n<<4|p}}o.TransitionTable=g;const x=160;o.VT500_TRANSITION_TABLE=function(){const u=new g(4095),l=Array.apply(null,Array(256)).map((k,m)=>m),s=(k,m)=>l.slice(k,m),n=s(32,127),p=s(0,24);p.push(25),p.push.apply(p,s(28,32));const w=s(0,14);let y;for(y in u.setDefault(1,0),u.addMany(n,0,2,0),w)u.addMany([24,26,153,154],y,3,0),u.addMany(s(128,144),y,3,0),u.addMany(s(144,152),y,3,0),u.add(156,y,0,0),u.add(27,y,11,1),u.add(157,y,4,8),u.addMany([152,158,159],y,0,7),u.add(155,y,11,3),u.add(144,y,11,9);return u.addMany(p,0,3,0),u.addMany(p,1,3,1),u.add(127,1,0,1),u.addMany(p,8,0,8),u.addMany(p,3,3,3),u.add(127,3,0,3),u.addMany(p,4,3,4),u.add(127,4,0,4),u.addMany(p,6,3,6),u.addMany(p,5,3,5),u.add(127,5,0,5),u.addMany(p,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(n,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(s(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(n,7,0,7),u.addMany(p,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(s(64,127),3,7,0),u.addMany(s(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(s(48,60),4,8,4),u.addMany(s(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(s(32,64),6,0,6),u.add(127,6,0,6),u.addMany(s(64,127),6,0,0),u.addMany(s(32,48),3,9,5),u.addMany(s(32,48),5,9,5),u.addMany(s(48,64),5,0,6),u.addMany(s(64,127),5,7,0),u.addMany(s(32,48),4,9,5),u.addMany(s(32,48),1,9,2),u.addMany(s(32,48),2,9,2),u.addMany(s(48,127),2,10,0),u.addMany(s(48,80),1,10,0),u.addMany(s(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(s(96,127),1,10,0),u.add(80,1,11,9),u.addMany(p,9,0,9),u.add(127,9,0,9),u.addMany(s(28,32),9,0,9),u.addMany(s(32,48),9,9,12),u.addMany(s(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(p,11,0,11),u.addMany(s(32,128),11,0,11),u.addMany(s(28,32),11,0,11),u.addMany(p,10,0,10),u.add(127,10,0,10),u.addMany(s(28,32),10,0,10),u.addMany(s(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(s(32,48),10,9,12),u.addMany(p,12,0,12),u.add(127,12,0,12),u.addMany(s(28,32),12,0,12),u.addMany(s(32,48),12,9,12),u.addMany(s(48,64),12,0,11),u.addMany(s(64,127),12,12,13),u.addMany(s(64,127),10,12,13),u.addMany(s(64,127),9,12,13),u.addMany(p,13,13,13),u.addMany(n,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(x,0,2,0),u.add(x,8,5,8),u.add(x,6,0,6),u.add(x,11,0,11),u.add(x,13,13,13),u}();class v extends d.Disposable{constructor(l=o.VT500_TRANSITION_TABLE){super(),this._transitions=l,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new S.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,n,p)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,n)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(l,s=[64,126]){let n=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=l.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let w=0;w<l.intermediates.length;++w){const y=l.intermediates.charCodeAt(w);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=y}}if(l.final.length!==1)throw new Error("final must be a single byte");const p=l.final.charCodeAt(0);if(s[0]>p||p>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return n<<=8,n|=p,n}identToString(l){const s=[];for(;l;)s.push(String.fromCharCode(255&l)),l>>=8;return s.reverse().join("")}setPrintHandler(l){this._printHandler=l}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(l,s){const n=this._identifier(l,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);const p=this._escHandlers[n];return p.push(s),{dispose:()=>{const w=p.indexOf(s);w!==-1&&p.splice(w,1)}}}clearEscHandler(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]}setEscHandlerFallback(l){this._escHandlerFb=l}setExecuteHandler(l,s){this._executeHandlers[l.charCodeAt(0)]=s}clearExecuteHandler(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]}setExecuteHandlerFallback(l){this._executeHandlerFb=l}registerCsiHandler(l,s){const n=this._identifier(l);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);const p=this._csiHandlers[n];return p.push(s),{dispose:()=>{const w=p.indexOf(s);w!==-1&&p.splice(w,1)}}}clearCsiHandler(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]}setCsiHandlerFallback(l){this._csiHandlerFb=l}registerDcsHandler(l,s){return this._dcsParser.registerHandler(this._identifier(l),s)}clearDcsHandler(l){this._dcsParser.clearHandler(this._identifier(l))}setDcsHandlerFallback(l){this._dcsParser.setHandlerFallback(l)}registerOscHandler(l,s){return this._oscParser.registerHandler(l,s)}clearOscHandler(l){this._oscParser.clearHandler(l)}setOscHandlerFallback(l){this._oscParser.setHandlerFallback(l)}setErrorHandler(l){this._errorHandler=l}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(l,s,n,p,w){this._parseStack.state=l,this._parseStack.handlers=s,this._parseStack.handlerPos=n,this._parseStack.transition=p,this._parseStack.chunkPos=w}parse(l,s,n){let p,w=0,y=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const m=this._parseStack.handlers;let b=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&b>-1){for(;b>=0&&(p=m[b](this._params),p!==!0);b--)if(p instanceof Promise)return this._parseStack.handlerPos=b,p}this._parseStack.handlers=[];break;case 4:if(n===!1&&b>-1){for(;b>=0&&(p=m[b](),p!==!0);b--)if(p instanceof Promise)return this._parseStack.handlerPos=b,p}this._parseStack.handlers=[];break;case 6:if(w=l[this._parseStack.chunkPos],p=this._dcsParser.unhook(w!==24&&w!==26,n),p)return p;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=l[this._parseStack.chunkPos],p=this._oscParser.end(w!==24&&w!==26,n),p)return p;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let m=k;m<s;++m){switch(w=l[m],y=this._transitions.table[this.currentState<<8|(w<160?w:x)],y>>4){case 2:for(let A=m+1;;++A){if(A>=s||(w=l[A])<32||w>126&&w<x){this._printHandler(l,m,A),m=A-1;break}if(++A>=s||(w=l[A])<32||w>126&&w<x){this._printHandler(l,m,A),m=A-1;break}if(++A>=s||(w=l[A])<32||w>126&&w<x){this._printHandler(l,m,A),m=A-1;break}if(++A>=s||(w=l[A])<32||w>126&&w<x){this._printHandler(l,m,A),m=A-1;break}}break;case 3:this._executeHandlers[w]?this._executeHandlers[w]():this._executeHandlerFb(w),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:m,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const b=this._csiHandlers[this._collect<<8|w];let T=b?b.length-1:-1;for(;T>=0&&(p=b[T](this._params),p!==!0);T--)if(p instanceof Promise)return this._preserveStack(3,b,T,y,m),p;T<0&&this._csiHandlerFb(this._collect<<8|w,this._params),this.precedingJoinState=0;break;case 8:do switch(w){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(w-48)}while(++m<s&&(w=l[m])>47&&w<60);m--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const M=this._escHandlers[this._collect<<8|w];let P=M?M.length-1:-1;for(;P>=0&&(p=M[P](),p!==!0);P--)if(p instanceof Promise)return this._preserveStack(4,M,P,y,m),p;P<0&&this._escHandlerFb(this._collect<<8|w),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|w,this._params);break;case 13:for(let A=m+1;;++A)if(A>=s||(w=l[A])===24||w===26||w===27||w>127&&w<x){this._dcsParser.put(l,m,A),m=A-1;break}break;case 14:if(p=this._dcsParser.unhook(w!==24&&w!==26),p)return this._preserveStack(6,[],0,y,m),p;w===27&&(y|=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 A=m+1;;A++)if(A>=s||(w=l[A])<32||w>127&&w<x){this._oscParser.put(l,m,A),m=A-1;break}break;case 6:if(p=this._oscParser.end(w!==24&&w!==26),p)return this._preserveStack(5,[],0,y,m),p;w===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}o.EscapeSequenceParser=v},6242:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const d=c(5770),S=c(482),h=[];o.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,g){this._handlers[_]===void 0&&(this._handlers[_]=[]);const x=this._handlers[_];return x.push(g),{dispose:()=>{const v=x.indexOf(g);v!==-1&&x.splice(v,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,g,x){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(_,g,x);else this._handlerFb(this._id,"PUT",(0,S.utf32ToString)(_,g,x))}start(){this.reset(),this._state=1}put(_,g,x){if(this._state!==3){if(this._state===1)for(;g<x;){const v=_[g++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&x-g>0&&this._put(_,g,x)}}end(_,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,v=this._active.length-1,u=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,x=g,u=this._stack.fallThrough,this._stack.paused=!1),!u&&x===!1){for(;v>=0&&(x=this._active[v].end(_),x!==!0);v--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,x;v--}for(;v>=0;v--)if(x=this._active[v].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",_);this._active=h,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,g,x){this._hitLimit||(this._data+=(0,S.utf32ToString)(_,g,x),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let g=!1;if(this._hitLimit)g=!1;else if(_&&(g=this._handler(this._data),g instanceof Promise))return g.then(x=>(this._data="",this._hitLimit=!1,x));return this._data="",this._hitLimit=!1,g}}},8742:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class d{static fromArray(h){const _=new d;if(!h.length)return _;for(let g=Array.isArray(h[0])?1:0;g<h.length;++g){const x=h[g];if(Array.isArray(x))for(let v=0;v<x.length;++v)_.addSubParam(x[v]);else _.addParam(x)}return _}constructor(h=32,_=32){if(this.maxLength=h,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new d(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let _=0;_<this.length;++_){h.push(this.params[_]);const g=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];x-g>0&&h.push(Array.prototype.slice.call(this._subParams,g,x))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const _=this._subParamsIdx[h]>>8,g=255&this._subParamsIdx[h];return g-_>0?this._subParams.subarray(_,g):null}getSubParamsAll(){const h={};for(let _=0;_<this.length;++_){const g=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];x-g>0&&(h[_]=this._subParams.slice(g,x))}return h}addDigit(h){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,x=g[_-1];g[_-1]=~x?Math.min(10*x+h,c):h}}o.Params=d},5741:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,d){const S={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(S),d.dispose=()=>this._wrappedAddonDispose(S),d.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let d=-1;for(let S=0;S<this._addons.length;S++)if(this._addons[S]===c){d=S;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(d,1)}}},8771:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const d=c(3785),S=c(511);o.BufferApiView=class{constructor(h,_){this._buffer=h,this.type=_}init(h){return this._buffer=h,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(h){const _=this._buffer.lines.get(h);if(_)return new d.BufferLineApiView(_)}getNullCell(){return new S.CellData}}},3785:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const d=c(511);o.BufferLineApiView=class{constructor(S){this._line=S}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(S,h){if(!(S<0||S>=this._line.length))return h?(this._line.loadCell(S,h),h):this._line.loadCell(S,new d.CellData)}translateToString(S,h,_){return this._line.translateToString(S,h,_)}}},8285:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const d=c(8771),S=c(8460),h=c(844);class _ extends h.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new S.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(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)}}o.BufferNamespaceApi=_},7975:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,d){return this._core.registerCsiHandler(c,S=>d(S.toArray()))}addCsiHandler(c,d){return this.registerCsiHandler(c,d)}registerDcsHandler(c,d){return this._core.registerDcsHandler(c,(S,h)=>d(S,h.toArray()))}addDcsHandler(c,d){return this.registerDcsHandler(c,d)}registerEscHandler(c,d){return this._core.registerEscHandler(c,d)}addEscHandler(c,d){return this.registerEscHandler(c,d)}registerOscHandler(c,d){return this._core.registerOscHandler(c,d)}addOscHandler(c,d){return this.registerOscHandler(c,d)}}},7090:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(C,o,c){var d=this&&this.__decorate||function(u,l,s,n){var p,w=arguments.length,y=w<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,l,s,n);else for(var k=u.length-1;k>=0;k--)(p=u[k])&&(y=(w<3?p(y):w>3?p(l,s,y):p(l,s))||y);return w>3&&y&&Object.defineProperty(l,s,y),y},S=this&&this.__param||function(u,l){return function(s,n){l(s,n,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const h=c(8460),_=c(844),g=c(5295),x=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let v=o.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(u){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(u.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(u,this))}resize(u,l){this.cols=u,this.rows=l,this.buffers.resize(u,l),this._onResize.fire({cols:u,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,l=!1){const s=this.buffer;let n;n=this._cachedBlankLine,n&&n.length===this.cols&&n.getFg(0)===u.fg&&n.getBg(0)===u.bg||(n=s.getBlankLine(u,l),this._cachedBlankLine=n),n.isWrapped=l;const p=s.ybase+s.scrollTop,w=s.ybase+s.scrollBottom;if(s.scrollTop===0){const y=s.lines.isFull;w===s.lines.length-1?y?s.lines.recycle().copyFrom(n):s.lines.push(n.clone()):s.lines.splice(w+1,0,n.clone()),y?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const y=w-p+1;s.lines.shiftElements(p+1,y-1,-1),s.lines.set(w,n.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(u,l,s){const n=this.buffer;if(u<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else u+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);const p=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+u,n.ybase),0),p!==n.ydisp&&(l||this._onScroll.fire(n.ydisp))}};o.BufferService=v=d([S(0,x.IOptionsService)],v)},7994:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,d){this._charsets[c]=d,this.glevel===c&&(this.charset=d)}}},1753:function(C,o,c){var d=this&&this.__decorate||function(n,p,w,y){var k,m=arguments.length,b=m<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,p,w,y);else for(var T=n.length-1;T>=0;T--)(k=n[T])&&(b=(m<3?k(b):m>3?k(p,w,b):k(p,w))||b);return m>3&&b&&Object.defineProperty(p,w,b),b},S=this&&this.__param||function(n,p){return function(w,y){p(w,y,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const h=c(2585),_=c(8460),g=c(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:n=>n.button!==4&&n.action===1&&(n.ctrl=!1,n.alt=!1,n.shift=!1,!0)},VT200:{events:19,restrict:n=>n.action!==32},DRAG:{events:23,restrict:n=>n.action!==32||n.button!==3},ANY:{events:31,restrict:n=>!0}};function v(n,p){let w=(n.ctrl?16:0)|(n.shift?4:0)|(n.alt?8:0);return n.button===4?(w|=64,w|=n.action):(w|=3&n.button,4&n.button&&(w|=64),8&n.button&&(w|=128),n.action===32?w|=32:n.action!==0||p||(w|=3)),w}const u=String.fromCharCode,l={DEFAULT:n=>{const p=[v(n,!1)+32,n.col+32,n.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${u(p[0])}${u(p[1])}${u(p[2])}`},SGR:n=>{const p=n.action===0&&n.button!==4?"m":"M";return`\x1B[<${v(n,!0)};${n.col};${n.row}${p}`},SGR_PIXELS:n=>{const p=n.action===0&&n.button!==4?"m":"M";return`\x1B[<${v(n,!0)};${n.x};${n.y}${p}`}};let s=o.CoreMouseService=class extends g.Disposable{constructor(n,p){super(),this._bufferService=n,this._coreService=p,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const w of Object.keys(x))this.addProtocol(w,x[w]);for(const w of Object.keys(l))this.addEncoding(w,l[w]);this.reset()}addProtocol(n,p){this._protocols[n]=p}addEncoding(n,p){this._encodings[n]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(n){if(!this._protocols[n])throw new Error(`unknown protocol "${n}"`);this._activeProtocol=n,this._onProtocolChange.fire(this._protocols[n].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(n){if(!this._encodings[n])throw new Error(`unknown encoding "${n}"`);this._activeEncoding=n}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(n){if(n.col<0||n.col>=this._bufferService.cols||n.row<0||n.row>=this._bufferService.rows||n.button===4&&n.action===32||n.button===3&&n.action!==32||n.button!==4&&(n.action===2||n.action===3)||(n.col++,n.row++,n.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,n,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(n))return!1;const p=this._encodings[this._activeEncoding](n);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=n,!0}explainEvents(n){return{down:!!(1&n),up:!!(2&n),drag:!!(4&n),move:!!(8&n),wheel:!!(16&n)}}_equalEvents(n,p,w){if(w){if(n.x!==p.x||n.y!==p.y)return!1}else if(n.col!==p.col||n.row!==p.row)return!1;return n.button===p.button&&n.action===p.action&&n.ctrl===p.ctrl&&n.alt===p.alt&&n.shift===p.shift}};o.CoreMouseService=s=d([S(0,h.IBufferService),S(1,h.ICoreService)],s)},6975:function(C,o,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,m=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(m=(k<3?y(m):k>3?y(n,p,m):y(n,p))||m);return k>3&&m&&Object.defineProperty(n,p,m),m},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const h=c(1439),_=c(8460),g=c(844),x=c(2585),v=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=o.CoreService=class extends g.Disposable{constructor(s,n,p){super(),this._bufferService=s,this._logService=n,this._optionsService=p,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(u)}reset(){this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(u)}triggerDataEvent(s,n=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;n&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),n&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(w=>w.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(n=>n.charCodeAt(0))),this._onBinary.fire(s))}};o.CoreService=l=d([S(0,x.IBufferService),S(1,x.ILogService),S(2,x.IOptionsService)],l)},9074:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const d=c(8055),S=c(8460),h=c(844),_=c(6106);let g=0,x=0;class v extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList(s=>s==null?void 0:s.marker.line),this._onDecorationRegistered=this.register(new S.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new S.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const n=new u(s);if(n){const p=n.marker.onDispose(()=>n.dispose());n.onDispose(()=>{n&&(this._decorations.delete(n)&&this._onDecorationRemoved.fire(n),p.dispose())}),this._decorations.insert(n),this._onDecorationRegistered.fire(n)}return n}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,n,p){let w=0,y=0;for(const k of this._decorations.getKeyIterator(n))w=k.options.x??0,y=w+(k.options.width??1),s>=w&&s<y&&(!p||(k.options.layer??"bottom")===p)&&(yield k)}forEachDecorationAtCell(s,n,p,w){this._decorations.forEachByKey(n,y=>{g=y.options.x??0,x=g+(y.options.width??1),s>=g&&s<x&&(!p||(y.options.layer??"bottom")===p)&&w(y)})}}o.DecorationService=v;class u extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new S.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new S.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const d=c(2585),S=c(8343);class h{constructor(...g){this._entries=new Map;for(const[x,v]of g)this.set(x,v)}set(g,x){const v=this._entries.get(g);return this._entries.set(g,x),v}forEach(g){for(const[x,v]of this._entries.entries())g(x,v)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}o.ServiceCollection=h,o.InstantiationService=class{constructor(){this._services=new h,this._services.set(d.IInstantiationService,this)}setService(_,g){this._services.set(_,g)}getService(_){return this._services.get(_)}createInstance(_,...g){const x=(0,S.getServiceDependencies)(_).sort((l,s)=>l.index-s.index),v=[];for(const l of x){const s=this._services.get(l.id);if(!s)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${l.id}.`);v.push(s)}const u=x.length>0?x[0].index:g.length;if(g.length!==u)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${u+1} conflicts with ${g.length} static arguments`);return new _(...g,...v)}}},7866:function(C,o,c){var d=this&&this.__decorate||function(u,l,s,n){var p,w=arguments.length,y=w<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,l,s,n);else for(var k=u.length-1;k>=0;k--)(p=u[k])&&(y=(w<3?p(y):w>3?p(l,s,y):p(l,s))||y);return w>3&&y&&Object.defineProperty(l,s,y),y},S=this&&this.__param||function(u,l){return function(s,n){l(s,n,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const h=c(844),_=c(2585),g={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let x,v=o.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),x=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let l=0;l<u.length;l++)typeof u[l]=="function"&&(u[l]=u[l]())}_log(u,l,s){this._evalLazyOptionalParams(s),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...s)}trace(u,...l){var s;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,u,l)}debug(u,...l){var s;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,u,l)}info(u,...l){var s;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,u,l)}warn(u,...l){var s;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,u,l)}error(u,...l){var s;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,u,l)}};o.LogService=v=d([S(0,_.IOptionsService)],v),o.setTraceLogger=function(u){x=u},o.traceCall=function(u,l,s){if(typeof s.value!="function")throw new Error("not supported");const n=s.value;s.value=function(...p){if(x.logLevel!==_.LogLevelEnum.TRACE)return n.apply(this,p);x.trace(`GlyphRenderer#${n.name}(${p.map(y=>JSON.stringify(y)).join(", ")})`);const w=n.apply(this,p);return x.trace(`GlyphRenderer#${n.name} return`,w),w}}},7302:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const d=c(8460),S=c(844),h=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends S.Disposable{constructor(v){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const u={...o.DEFAULT_OPTIONS};for(const l in v)if(l in u)try{const s=v[l];u[l]=this._sanitizeAndValidateOption(l,s)}catch(s){console.error(s)}this.rawOptions=u,this.options={...u},this._setupOptions(),this.register((0,S.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(v,u){return this.onOptionChange(l=>{l===v&&u(this.rawOptions[v])})}onMultipleOptionChange(v,u){return this.onOptionChange(l=>{v.indexOf(l)!==-1&&u()})}_setupOptions(){const v=l=>{if(!(l in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},u=(l,s)=>{if(!(l in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);s=this._sanitizeAndValidateOption(l,s),this.rawOptions[l]!==s&&(this.rawOptions[l]=s,this._onOptionChange.fire(l))};for(const l in this.rawOptions){const s={get:v.bind(this,l),set:u.bind(this,l)};Object.defineProperty(this.options,l,s)}}_sanitizeAndValidateOption(v,u){switch(v){case"cursorStyle":if(u||(u=o.DEFAULT_OPTIONS[v]),!function(l){return l==="block"||l==="underline"||l==="bar"}(u))throw new Error(`"${u}" is not a valid value for ${v}`);break;case"wordSeparator":u||(u=o.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=_.includes(u)?u:o.DEFAULT_OPTIONS[v];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${v} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${v} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}o.OptionsService=g},2660:function(C,o,c){var d=this&&this.__decorate||function(g,x,v,u){var l,s=arguments.length,n=s<3?x:u===null?u=Object.getOwnPropertyDescriptor(x,v):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(g,x,v,u);else for(var p=g.length-1;p>=0;p--)(l=g[p])&&(n=(s<3?l(n):s>3?l(x,v,n):l(x,v))||n);return s>3&&n&&Object.defineProperty(x,v,n),n},S=this&&this.__param||function(g,x){return function(v,u){x(v,u,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const h=c(2585);let _=o.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const x=this._bufferService.buffer;if(g.id===void 0){const p=x.addMarker(x.ybase+x.y),w={data:g,id:this._nextId++,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(w,p)),this._dataByLinkId.set(w.id,w),w.id}const v=g,u=this._getEntryIdKey(v),l=this._entriesWithId.get(u);if(l)return this.addLineToLink(l.id,x.ybase+x.y),l.id;const s=x.addMarker(x.ybase+x.y),n={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(n,s)),this._entriesWithId.set(n.key,n),this._dataByLinkId.set(n.id,n),n.id}addLineToLink(g,x){const v=this._dataByLinkId.get(g);if(v&&v.lines.every(u=>u.line!==x)){const u=this._bufferService.buffer.addMarker(x);v.lines.push(u),u.onDispose(()=>this._removeMarkerFromLink(v,u))}}getLinkData(g){var x;return(x=this._dataByLinkId.get(g))==null?void 0:x.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,x){const v=g.lines.indexOf(x);v!==-1&&(g.lines.splice(v,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};o.OscLinkService=_=d([S(0,h.IBufferService)],_)},8343:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",d="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(S){return S[d]||[]},o.createDecorator=function(S){if(o.serviceRegistry.has(S))return o.serviceRegistry.get(S);const h=function(_,g,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,u,l){u[c]===u?u[d].push({id:v,index:l}):(u[d]=[{id:v,index:l}],u[c]=u)})(h,_,x)};return h.toString=()=>S,o.serviceRegistry.set(S,h),h}},2585:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const d=c(8343);var S;o.IBufferService=(0,d.createDecorator)("BufferService"),o.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),o.ICoreService=(0,d.createDecorator)("CoreService"),o.ICharsetService=(0,d.createDecorator)("CharsetService"),o.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"}(S||(o.LogLevelEnum=S={})),o.ILogService=(0,d.createDecorator)("LogService"),o.IOptionsService=(0,d.createDecorator)("OptionsService"),o.IOscLinkService=(0,d.createDecorator)("OscLinkService"),o.IUnicodeService=(0,d.createDecorator)("UnicodeService"),o.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(C,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const d=c(8460),S=c(225);class h{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,x,v=!1){return(16777215&g)<<3|(3&x)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const g=new S.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let x=0,v=0;const u=g.length;for(let l=0;l<u;++l){let s=g.charCodeAt(l);if(55296<=s&&s<=56319){if(++l>=u)return x+this.wcwidth(s);const w=g.charCodeAt(l);56320<=w&&w<=57343?s=1024*(s-55296)+w-56320+65536:x+=this.wcwidth(w)}const n=this.charProperties(s,v);let p=h.extractWidth(n);h.extractShouldJoin(n)&&(p-=h.extractWidth(v)),x+=p,v=n}return x}charProperties(g,x){return this._activeProvider.charProperties(g,x)}}o.UnicodeService=h}},i={};function a(C){var o=i[C];if(o!==void 0)return o.exports;var c=i[C]={exports:{}};return r[C].call(c.exports,c,c.exports,a),c.exports}var f={};return(()=>{var C=f;Object.defineProperty(C,"__esModule",{value:!0}),C.Terminal=void 0;const o=a(9042),c=a(3236),d=a(844),S=a(5741),h=a(8285),_=a(7975),g=a(7090),x=["cols","rows"];class v extends d.Disposable{constructor(l){super(),this._core=this.register(new c.Terminal(l)),this._addonManager=this.register(new S.AddonManager),this._publicOptions={...this._core.options};const s=p=>this._core.options[p],n=(p,w)=>{this._checkReadonlyOptions(p),this._core.options[p]=w};for(const p in this._core.options){const w={get:s.bind(this,p),set:n.bind(this,p)};Object.defineProperty(this._publicOptions,p,w)}}_checkReadonlyOptions(l){if(x.includes(l))throw new Error(`Option "${l}" 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 _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new g.UnicodeApi(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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const l=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:l.applicationCursorKeys,applicationKeypadMode:l.applicationKeypad,bracketedPasteMode:l.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:l.origin,reverseWraparoundMode:l.reverseWraparound,sendFocusMode:l.sendFocus,wraparoundMode:l.wraparound}}get options(){return this._publicOptions}set options(l){for(const s in l)this._publicOptions[s]=l[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(l,s=!0){this._core.input(l,s)}resize(l,s){this._verifyIntegers(l,s),this._core.resize(l,s)}open(l){this._core.open(l)}attachCustomKeyEventHandler(l){this._core.attachCustomKeyEventHandler(l)}attachCustomWheelEventHandler(l){this._core.attachCustomWheelEventHandler(l)}registerLinkProvider(l){return this._core.registerLinkProvider(l)}registerCharacterJoiner(l){return this._checkProposedApi(),this._core.registerCharacterJoiner(l)}deregisterCharacterJoiner(l){this._checkProposedApi(),this._core.deregisterCharacterJoiner(l)}registerMarker(l=0){return this._verifyIntegers(l),this._core.registerMarker(l)}registerDecoration(l){return this._checkProposedApi(),this._verifyPositiveIntegers(l.x??0,l.width??0,l.height??0),this._core.registerDecoration(l)}hasSelection(){return this._core.hasSelection()}select(l,s,n){this._verifyIntegers(l,s,n),this._core.select(l,s,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(l,s){this._verifyIntegers(l,s),this._core.selectLines(l,s)}dispose(){super.dispose()}scrollLines(l){this._verifyIntegers(l),this._core.scrollLines(l)}scrollPages(l){this._verifyIntegers(l),this._core.scrollPages(l)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(l){this._verifyIntegers(l),this._core.scrollToLine(l)}clear(){this._core.clear()}write(l,s){this._core.write(l,s)}writeln(l,s){this._core.write(l),this._core.write(`\r
|
|
48
|
+
`,s)}paste(l){this._core.paste(l)}refresh(l,s){this._verifyIntegers(l,s),this._core.refresh(l,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(l){this._addonManager.loadAddon(this,l)}static get strings(){return o}_verifyIntegers(...l){for(const s of l)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...l){for(const s of l)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}C.Terminal=v})(),f})())})(Ou);var bf=Ou.exports,Hu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const f=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(f._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,f=a._renderService.dimensions;if(f.css.cell.width===0||f.css.cell.height===0)return;const C=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),d=Math.max(0,parseInt(o.getPropertyValue("width"))),S=window.getComputedStyle(this._terminal.element),h=c-(parseInt(S.getPropertyValue("padding-top"))+parseInt(S.getPropertyValue("padding-bottom"))),_=d-(parseInt(S.getPropertyValue("padding-right"))+parseInt(S.getPropertyValue("padding-left")))-C;return{cols:Math.max(2,Math.floor(_/f.css.cell.width)),rows:Math.max(1,Math.floor(h/f.css.cell.height))}}}})(),r})())})(Hu);var Ef=Hu.exports,Nu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(C,o)=>{function c(S){try{const h=new URL(S),_=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return S.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(S,h,_,g={}){this._terminal=S,this._regex=h,this._handler=_,this._options=g}provideLinks(S,h){const _=d.computeLink(S,this._regex,this._terminal,this._handler);h(this._addCallbacks(_))}_addCallbacks(S){return S.map(h=>(h.leave=this._options.leave,h.hover=(_,g)=>{if(this._options.hover){const{range:x}=h;this._options.hover(_,g,x)}},h))}};class d{static computeLink(h,_,g,x){const v=new RegExp(_.source,(_.flags||"")+"g"),[u,l]=d._getWindowedLineStrings(h-1,g),s=u.join("");let n;const p=[];for(;n=v.exec(s);){const w=n[0];if(!c(w))continue;const[y,k]=d._mapStrIdx(g,l,0,n.index),[m,b]=d._mapStrIdx(g,y,k,w.length);if(y===-1||k===-1||m===-1||b===-1)continue;const T={start:{x:k+1,y:y+1},end:{x:b,y:m+1}};p.push({range:T,text:w,activate:x})}return p}static _getWindowedLineStrings(h,_){let g,x=h,v=h,u=0,l="";const s=[];if(g=_.buffer.active.getLine(h)){const n=g.translateToString(!0);if(g.isWrapped&&n[0]!==" "){for(u=0;(g=_.buffer.active.getLine(--x))&&u<2048&&(l=g.translateToString(!0),u+=l.length,s.push(l),g.isWrapped&&l.indexOf(" ")===-1););s.reverse()}for(s.push(n),u=0;(g=_.buffer.active.getLine(++v))&&g.isWrapped&&u<2048&&(l=g.translateToString(!0),u+=l.length,s.push(l),l.indexOf(" ")===-1););}return[s,x]}static _mapStrIdx(h,_,g,x){const v=h.buffer.active,u=v.getNullCell();let l=g;for(;x;){const s=v.getLine(_);if(!s)return[-1,-1];for(let n=l;n<s.length;++n){s.getCell(n,u);const p=u.getChars();if(u.getWidth()&&(x-=p.length||1,n===s.length-1&&p==="")){const w=v.getLine(_+1);w&&w.isWrapped&&(w.getCell(0,u),u.getWidth()===2&&(x+=1))}if(x<0)return[_,n]}_++,l=0}return[_,l]}}o.LinkComputer=d}},i={};function a(C){var o=i[C];if(o!==void 0)return o.exports;var c=i[C]={exports:{}};return r[C](c,c.exports,a),c.exports}var f={};return(()=>{var C=f;Object.defineProperty(C,"__esModule",{value:!0}),C.WebLinksAddon=void 0;const o=a(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(S,h){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}C.WebLinksAddon=class{constructor(S=d,h={}){this._handler=S,this._options=h}activate(S){this._terminal=S;const h=this._options,_=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,_,this._handler,h))}dispose(){var S;(S=this._linkProvider)==null||S.dispose()}}})(),f})())})(Nu);var Rf=Nu.exports;function ya(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Lf(e){if(!e)return"0s";if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m ${e%60}s`;const t=Math.floor(e/3600),r=Math.floor(e%3600/60);return`${t}h ${r}m`}function Df({agent:e,subscribeTerminal:t,injectMessage:r,sendRaw:i,resizeTerminal:a,openAgentTerminal:f,returnAgentTerminal:C,onClose:o}){const c=q.useRef(null),d=q.useRef(null),[S,h]=q.useState(420),[_,g]=q.useState(""),x=q.useRef(!1),v=q.useRef(null),u=q.useRef(o);u.current=o;const l=p=>{const w=p.clientY,y=S;x.current=!0;const k=b=>{h(Math.max(180,Math.min(window.innerHeight*.8,y-(b.clientY-w))))},m=()=>{x.current=!1,window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",m)};window.addEventListener("mousemove",k),window.addEventListener("mouseup",m)};q.useEffect(()=>{if(!c.current||!e)return;const p=e.color||"#F5A623",w=new bf.Terminal({theme:{background:"#030507",foreground:"#E8E8F0",cursor:"#F5A623",selectionBackground:p+"40"},fontFamily:"'DM Mono', monospace",fontSize:12,lineHeight:1.3,cursorBlink:!0,scrollback:5e3}),y=new Ef.FitAddon,k=new Rf.WebLinksAddon;w.loadAddon(y),w.loadAddon(k),w.open(c.current),d.current=w;const m=()=>{if(d.current){try{y.fit()}catch{return}w.cols>0&&w.rows>0&&a(e.id,w.cols,w.rows)}};requestAnimationFrame(()=>{var A;m();const P=(A=document.activeElement)==null?void 0:A.tagName;(!P||P==="BODY"||P==="DIV")&&w.focus()}),w.onData(P=>{i(e.id,P)});const b=t(e.id,P=>{w.write(P)}),T=new ResizeObserver(()=>{v.current&&window.clearTimeout(v.current),v.current=window.setTimeout(m,50)});T.observe(c.current);const M=P=>{P.key==="Escape"&&u.current()};return window.addEventListener("keydown",M),()=>{window.removeEventListener("keydown",M),T.disconnect(),v.current&&(window.clearTimeout(v.current),v.current=null),b(),w.dispose(),d.current=null}},[e==null?void 0:e.id]);const s=p=>{p.key==="Enter"&&_.trim()&&!e.bridgeActive&&(r(e.id,_.trim()),g(""))};if(!e)return null;const n=e.color||"#F5A623";return L.jsxs("div",{style:{height:S,display:"flex",flexDirection:"column",background:"var(--bg1)",borderTop:"1px solid var(--border)"},children:[L.jsx("div",{onMouseDown:l,style:{height:6,cursor:"ns-resize",background:"transparent",borderTop:"2px solid var(--border)",flexShrink:0}}),L.jsxs("div",{style:{height:36,minHeight:36,display:"flex",alignItems:"center",gap:10,padding:"0 12px",borderBottom:"1px solid var(--border)",fontSize:11},children:[L.jsx("button",{onClick:o,style:{color:"var(--text2)",fontSize:11,padding:"2px 6px",background:"var(--bg2)",borderRadius:3,border:"1px solid var(--border)"},children:"ESC"}),L.jsx("span",{style:{color:n,fontSize:14},children:e.icon}),L.jsx("span",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:13},children:e.name}),L.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:e.status==="active"?"var(--green)":e.status==="blocked"?"var(--red)":"var(--text3)",animation:e.status==="active"?"pulse 2s infinite":"none"}}),L.jsxs("div",{style:{flex:1,display:"flex",justifyContent:"center",gap:24,color:"var(--text2)"},children:[L.jsxs("span",{children:["Task: ",L.jsx("span",{style:{color:n},children:e.currentTask||"—"})]}),L.jsxs("span",{children:["Tokens: ",ya(e.tokens||0)," / 200k"]}),L.jsxs("span",{children:["Total: ",ya(e.aggregatedTokens||0)]}),L.jsxs("span",{children:["Uptime: ",Lf(e.uptime)]})]}),e.status==="active"&&!e.bridgeActive&&L.jsx("button",{onClick:()=>f(e.id),style:{color:"var(--text2)",fontSize:11,padding:"3px 8px",background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4},children:"Open in Terminal"}),e.bridgeActive&&L.jsx("button",{onClick:()=>C(e.id),style:{color:"var(--amber)",fontSize:11,padding:"3px 8px",background:"rgba(245, 166, 35, 0.12)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:4},children:"Return to Ban Kan"}),L.jsx("button",{onClick:o,style:{color:"var(--text3)",fontSize:14},children:"✕"})]}),L.jsx("div",{ref:c,style:{flex:1,overflow:"hidden",padding:4}}),L.jsxs("div",{style:{padding:"6px 12px",borderTop:"1px solid var(--border)"},children:[L.jsx("input",{type:"text",value:_,placeholder:e.bridgeActive?"Input moved to Terminal.app while bridged...":"Send message to agent...",disabled:e.status!=="active"||e.bridgeActive,onChange:p=>g(p.target.value),onKeyDown:s,style:{width:"100%",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,padding:"5px 10px",fontSize:12,caretColor:n,opacity:e.status==="active"&&!e.bridgeActive?1:.55}}),e.bridgeActive&&L.jsx("div",{style:{marginTop:6,fontSize:11,color:"var(--text3)"},children:"Terminal.app currently owns input for this live session. Type `/return` there or use the button above to hand control back."}),e.status!=="active"&&!e.bridgeActive&&L.jsx("div",{style:{marginTop:6,fontSize:11,color:"var(--text3)"},children:"Agent input is unavailable because the session is not running. Resolve the blocker, then retry the task."})]})]})}function Tf({initialPath:e,onSelect:t,onClose:r}){const[i,a]=q.useState(e||""),[f,C]=q.useState(e||""),[o,c]=q.useState([]),[d,S]=q.useState(null),[h,_]=q.useState(null),[g,x]=q.useState(!1),v=async n=>{x(!0),_(null);try{const p=n?`/api/browse-dir?path=${encodeURIComponent(n)}`:"/api/browse-dir",w=await fetch(p);if(!w.ok){const k=await w.json();_(k.error||"Failed to browse directory"),x(!1);return}const y=await w.json();a(y.current),C(y.current),S(y.parent),c(y.dirs)}catch{_("Failed to connect to server")}x(!1)};q.useEffect(()=>{v(e||"")},[e]);const u=n=>{v(i+"/"+n)},l=()=>{d&&v(d)},s=n=>{n.key==="Enter"&&v(f)};return L.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:200},children:L.jsxs("div",{onClick:n=>n.stopPropagation(),style:{width:500,maxHeight:"70vh",display:"flex",flexDirection:"column",padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[L.jsx("h2",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:16,marginBottom:16},children:"Select Directory"}),L.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12},children:[L.jsx("input",{type:"text",value:f,onChange:n=>C(n.target.value),onKeyDown:s,style:{flex:1,padding:"6px 10px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)"}}),L.jsx("button",{onClick:()=>v(f),style:{padding:"6px 12px",fontSize:12,background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)"},children:"Go"})]}),h&&L.jsx("div",{style:{color:"var(--red)",fontSize:11,marginBottom:8},children:h}),L.jsx("div",{style:{flex:1,overflowY:"auto",minHeight:200,border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)"},children:g?L.jsx("div",{style:{padding:16,color:"var(--text3)",fontSize:12,textAlign:"center"},children:"Loading..."}):L.jsxs(L.Fragment,{children:[d&&L.jsxs("div",{onClick:l,style:{padding:"8px 12px",fontSize:12,cursor:"pointer",color:"var(--text2)",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:6},onMouseEnter:n=>n.currentTarget.style.background="var(--bg2)",onMouseLeave:n=>n.currentTarget.style.background="transparent",children:[L.jsx("span",{style:{fontSize:14},children:".."}),L.jsx("span",{style:{color:"var(--text3)"},children:"(parent)"})]}),o.length===0&&!d&&L.jsx("div",{style:{padding:16,color:"var(--text3)",fontSize:12,textAlign:"center"},children:"No subdirectories"}),o.map(n=>L.jsxs("div",{onClick:()=>u(n),style:{padding:"8px 12px",fontSize:12,cursor:"pointer",color:"var(--text)",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:6},onMouseEnter:p=>p.currentTarget.style.background="var(--bg2)",onMouseLeave:p=>p.currentTarget.style.background="transparent",children:[L.jsx("span",{style:{color:"var(--amber)"},children:"📁"}),n]},n))]})}),L.jsxs("div",{style:{marginTop:12,fontSize:11,color:"var(--text3)"},children:["Selected: ",L.jsx("span",{style:{color:"var(--text)"},children:i})]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:16},children:[L.jsx("button",{onClick:r,style:{padding:"8px 16px",color:"var(--text2)",fontSize:12},children:"Cancel"}),L.jsx("button",{onClick:()=>t(i),style:{padding:"8px 20px",background:"var(--amber)",color:"#000",borderRadius:4,fontWeight:500,fontSize:12},children:"Select"})]})]})})}const Af=/^(?:.*(?:⏵⏵bypass|bypasspermission|shift\+tab\s*to\s*cycle)|.*Opus\s*4\.\d.*(?:│|context)|.*Claude(?:Code|Max)|.*▐▛|.*▝▜|.*[░▓█]{3,}|[─━═]{10,}|^\s*[❯›]\s*$|.*\.data\/workspaces\/T-)/i,If=/\s*[❯›]\s*[─━═]{4,}.*$/,Mf=/[─━═]{10,}/g;function Ca(e){return typeof e!="string"?e:e.split(`
|
|
49
|
+
`).map(t=>t.replace(If,"").replace(Mf,"").trimEnd()).filter(t=>!t||!Af.test(t)).join(`
|
|
50
|
+
`)}const Kr={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"},wa={planning:"var(--steel2)",awaiting_approval:"var(--amber)",queued:"var(--text3)",workspace_setup:"var(--steel2)",implementing:"var(--green)",review:"#A78BFA",blocked:"var(--red)",paused:"var(--amber)",backlog:"var(--text3)",aborted:"var(--text3)",done:"var(--green)"};function Pf(e,t=120){if(typeof e!="string")return"";const r=e.replace(/\s+/g," ").trim();return r.length<=t?r:r.slice(0,t-1).trimEnd()+"…"}function Bf(e=0){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e||0)}function Of(e,t){if(!e||!t)return null;const r=new Date(e).getTime(),i=new Date(t).getTime();if(Number.isNaN(r)||Number.isNaN(i)||i<r)return null;const a=Math.max(1,Math.floor((i-r)/6e4)),f=Math.floor(a/(60*24)),C=Math.floor(a%(60*24)/60),o=a%60;return f>0?C>0?`${f}d ${C}h`:`${f}d`:C>0?o>0?`${C}h ${o}m`:`${C}h`:`${o}m`}function jf({task:e,repos:t=[],onClose:r,onApprove:i,onReject:a,onPause:f,onResume:C,onEdit:o,onAbort:c,onReset:d,onRetry:S,onDelete:h,onOpenWorkspace:_}){const[g,x]=q.useState(!1),[v,u]=q.useState(e.title),[l,s]=q.useState(e.description||""),[n,p]=q.useState(e.priority),[w,y]=q.useState(e.repoPath||""),[k,m]=q.useState(!1),[b,T]=q.useState(!1),[M,P]=q.useState(!1),[A,N]=q.useState(""),[W,V]=q.useState(!1),[X,j]=q.useState({}),E=!["done","paused","aborted"].includes(e.status),D=e.status==="paused",I=!["done","aborted"].includes(e.status),B=e.status!=="done",K=e.status==="blocked",F=!!(e.workspacePath&&_),Y=Of(e.startedAt,e.completedAt),U=Array.isArray(e.sessionHistory)?e.sessionHistory.slice().reverse():[],O=()=>{o(e.id,{title:v,description:l,priority:n,repoPath:w}),x(!1)},R=()=>{A.trim()&&(a(e.id,A.trim()),P(!1),N(""))},$=z=>{j(J=>({...J,[z]:!J[z]}))},H={fontSize:10,fontWeight:600,color:"var(--text3)",letterSpacing:1,textTransform:"uppercase",marginBottom:4},Q={fontSize:12,color:"var(--text)",marginBottom:14};return L.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:L.jsxs("div",{onClick:z=>z.stopPropagation(),style:{width:540,maxHeight:"80vh",overflowY:"auto",padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[L.jsx("span",{style:{fontSize:12,color:"var(--text3)"},children:e.id}),L.jsx("span",{style:{padding:"2px 8px",borderRadius:3,fontSize:10,background:(wa[e.status]||"var(--text3)")+"20",color:wa[e.status]||"var(--text3)"},children:e.status.replace(/_/g," ")})]}),L.jsx("button",{onClick:r,style:{color:"var(--text3)",fontSize:16},children:"✕"})]}),g?L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Title"}),L.jsx("input",{type:"text",value:v,onChange:z=>u(z.target.value),style:{width:"100%",padding:"6px 10px",fontSize:12}})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Description"}),L.jsx("textarea",{value:l,onChange:z=>s(z.target.value),rows:3,style:{width:"100%",padding:"6px 10px",fontSize:12,resize:"vertical"}})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Priority"}),L.jsx("div",{style:{display:"flex",gap:6},children:["critical","high","medium","low"].map(z=>L.jsx("button",{onClick:()=>p(z),style:{padding:"4px 10px",borderRadius:4,fontSize:11,border:`1px solid ${n===z?Kr[z]:"var(--border)"}`,background:n===z?Kr[z]+"20":"transparent",color:n===z?Kr[z]:"var(--text2)",textTransform:"capitalize"},children:z},z))})]}),t.length>0&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Repository"}),L.jsxs("select",{value:w,onChange:z=>y(z.target.value),style:{width:"100%",padding:"6px 10px",fontSize:12},children:[L.jsx("option",{value:"",children:"No repository"}),t.map(z=>L.jsx("option",{value:z,children:z},z))]})]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[L.jsx("button",{onClick:()=>x(!1),style:{padding:"6px 14px",color:"var(--text2)",fontSize:12},children:"Cancel"}),L.jsx("button",{onClick:O,style:{padding:"6px 16px",background:"var(--amber)",color:"#000",borderRadius:4,fontWeight:500,fontSize:12},children:"Save"})]})]}):L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Title"}),L.jsx("div",{style:{...Q,fontSize:14},children:e.title})]}),L.jsxs("div",{style:{display:"flex",gap:20,marginBottom:14},children:[L.jsxs("div",{children:[L.jsx("div",{style:H,children:"Priority"}),L.jsx("span",{style:{padding:"2px 8px",borderRadius:3,fontSize:11,background:(Kr[e.priority]||"var(--text3)")+"20",color:Kr[e.priority]||"var(--text3)",textTransform:"capitalize"},children:e.priority})]}),e.repoPath&&L.jsxs("div",{style:{flex:1},children:[L.jsx("div",{style:H,children:"Repository"}),L.jsx("div",{style:{fontSize:11,color:"var(--text2)",wordBreak:"break-all"},children:e.repoPath})]})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Total Tokens"}),L.jsx("div",{style:{...Q,fontFamily:"var(--font-mono)"},children:Bf(e.totalTokens||0)})]}),e.description&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Description"}),L.jsx("div",{style:Q,children:e.description})]}),e.branch&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Branch"}),L.jsx("div",{style:{fontSize:12,color:"var(--steel2)"},children:e.branch})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Review Cycles"}),L.jsxs("div",{style:{fontSize:12,color:"var(--text2)"},children:[e.reviewCycleCount||0," / 3"]})]}),Y&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Total Time"}),L.jsx("div",{style:{fontSize:12,color:"var(--text2)"},children:Y})]}),e.prUrl&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Pull Request"}),L.jsx("a",{href:e.prUrl,target:"_blank",rel:"noopener noreferrer",style:{fontSize:12,color:"#60A5FA"},children:e.prUrl})]}),e.blockedReason&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Blocked Reason"}),L.jsx("div",{title:e.blockedReason,style:{fontSize:12,color:"var(--red)",lineHeight:1.5},children:Pf(e.blockedReason)})]}),e.plan&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsxs("div",{onClick:()=>m(!k),style:{...H,cursor:"pointer",display:"flex",alignItems:"center",gap:4,userSelect:"none"},children:[k?"▼":"▶"," Plan"]}),k&&L.jsx("pre",{style:{fontSize:11,color:"var(--text2)",background:"var(--bg)",padding:10,borderRadius:4,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:200,overflowY:"auto",border:"1px solid var(--border)"},children:Ca(e.plan)})]}),e.review&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsxs("div",{onClick:()=>T(!b),style:{...H,cursor:"pointer",display:"flex",alignItems:"center",gap:4,userSelect:"none"},children:[b?"▼":"▶"," Review"]}),b&&L.jsx("pre",{style:{fontSize:11,color:"var(--text2)",background:"var(--bg)",padding:10,borderRadius:4,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:200,overflowY:"auto",border:"1px solid var(--border)"},children:Ca(e.review)})]}),U.length>0&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Completed Sessions"}),L.jsx("div",{style:{border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)",overflow:"hidden"},children:U.map((z,J)=>{const ie=!!X[z.id];return L.jsxs("div",{style:{borderBottom:J<U.length-1?"1px solid var(--border)":"none"},children:[L.jsxs("button",{onClick:()=>$(z.id),style:{width:"100%",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,background:"transparent",color:"var(--text)",fontSize:11,textAlign:"left"},children:[L.jsxs("span",{children:[ie?"▼":"▶"," ",z.agentName," · ",z.stage," · ",z.outcome]}),L.jsx("span",{style:{color:"var(--text3)",flexShrink:0},children:new Date(z.finishedAt).toLocaleString()})]}),ie&&L.jsx("pre",{style:{margin:0,padding:10,fontSize:11,color:"var(--text2)",background:"var(--bg1)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:220,overflowY:"auto",borderTop:"1px solid var(--border)"},children:z.transcript||"[No transcript captured]"})]},z.id||J)})})]}),e.log&&e.log.length>0&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"History"}),L.jsx("div",{style:{maxHeight:120,overflowY:"auto",border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)"},children:e.log.slice().reverse().map((z,J)=>L.jsxs("div",{style:{padding:"4px 10px",fontSize:10,borderBottom:"1px solid var(--border)",display:"flex",gap:8},children:[L.jsx("span",{style:{color:"var(--text3)",flexShrink:0},children:new Date(z.ts).toLocaleTimeString()}),L.jsx("span",{style:{color:"var(--text2)"},children:z.message})]},J))})]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",borderTop:"1px solid var(--border)",paddingTop:16,marginTop:8,flexWrap:"wrap"},children:[L.jsx("button",{onClick:()=>{u(e.title),s(e.description||""),p(e.priority),y(e.repoPath||""),x(!0)},style:{padding:"6px 14px",fontSize:12,background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)"},children:"Edit"}),E&&L.jsx("button",{onClick:()=>f(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(245, 166, 35, 0.15)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:4,color:"var(--amber)"},children:"Pause"}),D&&L.jsx("button",{onClick:()=>C(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(61, 220, 132, 0.15)",border:"1px solid rgba(61, 220, 132, 0.3)",borderRadius:4,color:"var(--green)"},children:"Resume"}),e.status==="awaiting_approval"&&L.jsxs(L.Fragment,{children:[L.jsx("button",{onClick:()=>i(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(61, 220, 132, 0.15)",borderRadius:4,color:"var(--green)"},children:"Approve"}),L.jsx("button",{onClick:()=>P(!0),style:{padding:"6px 14px",fontSize:12,background:"rgba(255, 77, 77, 0.1)",borderRadius:4,color:"var(--text2)"},children:"Revise"})]}),K&&S&&L.jsx("button",{onClick:()=>S(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(100, 160, 255, 0.15)",border:"1px solid rgba(100, 160, 255, 0.3)",borderRadius:4,color:"var(--steel2)"},children:"Retry"}),F&&L.jsx("button",{onClick:()=>_(e.id),title:e.workspacePath,style:{padding:"6px 14px",fontSize:12,background:"rgba(96, 165, 250, 0.12)",border:"1px solid rgba(96, 165, 250, 0.3)",borderRadius:4,color:"#60A5FA"},children:"Open in VSCode"}),B&&d&&L.jsx("button",{onClick:()=>d(e.id),title:"Delete the local workspace and clear plan, review, branch, PR, blockers, and progress before returning to backlog.",style:{padding:"6px 14px",fontSize:12,background:"rgba(245, 166, 35, 0.12)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:4,color:"var(--amber)"},children:"Reset to Backlog"}),I&&c&&L.jsx("button",{onClick:()=>c(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(255, 77, 77, 0.15)",border:"1px solid rgba(255, 77, 77, 0.3)",borderRadius:4,color:"var(--red)"},children:"Abort"}),e.status==="done"&&h&&L.jsx("button",{onClick:()=>{if(W){h(e.id);return}V(!0)},style:{padding:"6px 14px",fontSize:12,background:W?"rgba(255, 77, 77, 0.2)":"rgba(255, 77, 77, 0.1)",border:"1px solid rgba(255, 77, 77, 0.3)",borderRadius:4,color:"var(--red)"},children:W?"Confirm Delete":"Delete from Done"})]}),B&&L.jsx("div",{style:{marginTop:10,fontSize:10,color:"var(--text3)",lineHeight:1.5},children:"Reset deletes the local workspace and discards the current plan, review, branch, blocker, and PR state."}),M&&L.jsx("div",{style:{marginTop:10,animation:"fade-in 0.15s ease-out"},children:L.jsx("input",{autoFocus:!0,type:"text",placeholder:"Feedback for planner...",value:A,onChange:z=>N(z.target.value),onKeyDown:z=>{z.key==="Enter"&&R(),z.key==="Escape"&&(P(!1),N(""))},style:{width:"100%",fontSize:11,padding:"6px 10px"}})}),W&&e.status==="done"&&L.jsx("div",{style:{marginTop:10,fontSize:10,color:"var(--text3)",lineHeight:1.5},children:"Delete removes the completed task from Ban Kan state and clears any saved plan/workspace artifacts."})]})]})})}const Hf="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAiIHZpZXdCb3g9IjAgMCAxNDAwIDM2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8dGl0bGU+QmFuIEthbiBsb2dvPC90aXRsZT4KICA8ZGVzYz5NaW5pbWFsIFNWRyBsb2dvIGZvciBCYW4gS2FuIHdpdGggaGV4YWdvbmFsIG1hcmsgYW5kIHdvcmRtYXJrLjwvZGVzYz4KCiAgPCEtLSBUcmFuc3BhcmVudCBiYWNrZ3JvdW5kIC0tPgoKICA8IS0tIExvZ28gbWFyayAtLT4KICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0MCw0MCkiIHN0cm9rZT0iI0Y1QTYyMyIgc3Ryb2tlLXdpZHRoPSIxMCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KICAgIDwhLS0gT3V0ZXIgaGV4YWdvbiAtLT4KICAgIDxwYXRoIGQ9Ik0xMjAgMjAgTDIwNi42IDcwIEwyMDYuNiAxNzAgTDEyMCAyMjAgTDMzLjQgMTcwIEwzMy40IDcwIFoiLz4KICAgIDwhLS0gSW5uZXIgYmFycyAvIGthbmJhbiBsYW5lcyAtLT4KICAgIDxnIGZpbGw9IiNGNUE2MjMiIHN0cm9rZT0ibm9uZSI+CiAgICAgIDxwYXRoIGQ9Ik03NCAxNDYgQzc0IDE0Mi43IDc2LjcgMTQwIDgwIDE0MCBIMTA0IEMxMDcuMyAxNDAgMTEwIDE0Mi43IDExMCAxNDYgVjE4MiBDMTEwIDE4NS4zIDEwNy4zIDE4OCAxMDQgMTg4IEg4MCBDNzYuNyAxODggNzQgMTg1LjMgNzQgMTgyIFYxNDYgWiIvPgogICAgICA8cGF0aCBkPSJNMTEyIDExOCBDMTEyIDExNC43IDExNC43IDExMiAxMTggMTEyIEgxNDIgQzE0NS4zIDExMiAxNDggMTE0LjcgMTQ4IDExOCBWMTgyIEMxNDggMTg1LjMgMTQ1LjMgMTg4IDE0MiAxODggSDExOCBDMTE0LjcgMTg4IDExMiAxODUuMyAxMTIgMTgyIFYxMTggWiIvPgogICAgICA8cGF0aCBkPSJNMTUwIDg2IEMxNTAgODIuNyAxNTIuNyA4MCAxNTYgODAgSDE4MCBDMTgzLjMgODAgMTg2IDgyLjcgMTg2IDg2IFYxODIgQzE4NiAxODUuMyAxODMuMyAxODggMTgwIDE4OCBIMTU2IEMxNTIuNyAxODggMTUwIDE4NS4zIDE1MCAxODIgVjg2IFoiLz4KICAgIDwvZz4KICA8L2c+CgogIDwhLS0gV29yZG1hcmsgLS0+CiAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzIwLDApIj4KICAgIDx0ZXh0IHg9IjAiIHk9IjIxMCIKICAgICAgICAgIGZpbGw9IiNFOEU4RjAiCiAgICAgICAgICBmb250LXNpemU9IjExOCIKICAgICAgICAgIGZvbnQtd2VpZ2h0PSI4MDAiCiAgICAgICAgICBsZXR0ZXItc3BhY2luZz0iMTAiCiAgICAgICAgICBmb250LWZhbWlseT0iU3luZSwgSW50ZXIsIEFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2VyaWYiPgogICAgICBCQU4gS0FOCiAgICA8L3RleHQ+CiAgPC9nPgo8L3N2Zz4K",Cn={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"};function Nf(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Ff(e,t){return!Array.isArray(e)||e.length===0?"":t!=null&&t.defaultRepoPath&&e.includes(t.defaultRepoPath)?t.defaultRepoPath:e[0]||""}function zf(){return L.jsx("div",{style:{height:34,display:"flex",alignItems:"center",flexShrink:0},children:L.jsx("img",{src:Hf,alt:"Ban Kan",style:{height:34,width:"auto",display:"block"}})})}function Wf(){const{connected:e,isInitialized:t,agents:r,tasks:i,repos:a,settings:f,notifications:C,addTask:o,approvePlan:c,rejectPlan:d,pauseTask:S,resumeTask:h,editTask:_,abortTask:g,resetTask:x,retryTask:v,deleteTask:u,openTaskWorkspace:l,injectMessage:s,sendRaw:n,resizeTerminal:p,updateSettings:w,subscribeTerminal:y,openAgentTerminal:k,returnAgentTerminal:m}=mf(),[b,T]=q.useState(null),[M,P]=q.useState(null),[A,N]=q.useState(!1),[W,V]=q.useState(!1),X=a.length>0,j=X,E=t&&!X&&i.length===0,D=q.useMemo(()=>i.filter(R=>R.status==="awaiting_approval"||R.status==="blocked"),[i]),I=q.useMemo(()=>i.reduce((R,$)=>R+($.totalTokens||0),0),[i]),B=q.useMemo(()=>r.filter(R=>R.status==="active").length,[r]),K=q.useMemo(()=>r.filter(R=>R.status==="blocked").length,[r]),F=q.useMemo(()=>i.filter(R=>!["backlog","done","aborted"].includes(R.status)),[i]),Y=q.useMemo(()=>r.find(R=>R.id===b),[r,b]);q.useEffect(()=>{!j&&A&&N(!1)},[j,A]);const U=R=>{R!=="orch"&&T($=>$===R?null:R)},O=()=>{j&&N(!0)};return L.jsxs("div",{style:{height:"100vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[L.jsxs("div",{style:{height:54,minHeight:54,display:"flex",alignItems:"center",gap:16,padding:"0 16px",background:"var(--bg1)",borderBottom:"1px solid var(--border)"},children:[L.jsx("div",{style:{display:"flex",alignItems:"center",minWidth:0},children:L.jsx(zf,{})}),L.jsxs("div",{style:{display:"flex",gap:16,fontSize:11,color:"var(--text2)",marginLeft:24},children:[L.jsxs("span",{children:["Active ",L.jsx("span",{style:{color:"var(--green)"},children:B}),"/",r.length]}),K>0&&L.jsxs("span",{children:["Blocked ",L.jsx("span",{style:{color:"var(--red)"},children:K})]}),L.jsxs("span",{children:["In Flight ",L.jsx("span",{style:{color:"var(--amber)"},children:F.length})]}),L.jsxs("span",{children:["Context ",L.jsx("span",{style:{color:"var(--text)"},children:Nf(I)})]})]}),D.length>0&&L.jsxs("button",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 10px",background:"rgba(245, 166, 35, 0.1)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:12,color:"var(--amber)",fontSize:11},children:[L.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--amber)",animation:"pulse 2s infinite"}}),D.length," need",D.length===1?"s":""," attention"]}),L.jsx("div",{style:{flex:1}}),L.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:e?"var(--green)":"var(--red)"}}),L.jsx("button",{onClick:()=>V(!0),style:{padding:"6px 10px",background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,fontSize:14,color:"var(--text2)",cursor:"pointer"},title:"Settings",children:"⚙"}),L.jsx("button",{onClick:O,disabled:!j,style:{padding:"6px 14px",background:j?"var(--amber)":"var(--bg2)",color:j?"#000":"var(--text3)",border:`1px solid ${j?"var(--amber)":"var(--border)"}`,borderRadius:4,fontWeight:500,fontSize:12,cursor:j?"pointer":"not-allowed",opacity:j?1:.7},title:j?"Add Task":"Configure at least one repository in Settings before adding a task",children:"+ ADD TASK"})]}),L.jsxs("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[E&&L.jsx("div",{style:{margin:"16px 16px 0",padding:"18px 20px",borderRadius:10,border:"1px solid rgba(245, 166, 35, 0.35)",background:"linear-gradient(135deg, rgba(245, 166, 35, 0.18), rgba(122, 162, 247, 0.08))",boxShadow:"0 12px 32px rgba(0,0,0,0.18)"},children:L.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,flexWrap:"wrap"},children:[L.jsxs("div",{style:{maxWidth:720},children:[L.jsx("div",{style:{fontFamily:"var(--font-head)",fontSize:20,fontWeight:700,marginBottom:6},children:"Welcome to Ban Kan"}),L.jsx("div",{style:{fontSize:13,color:"var(--text2)",lineHeight:1.5},children:"Open Settings to add at least one repository, choose a default repository, and review the agent configuration before creating your first task."})]}),L.jsx("button",{onClick:()=>V(!0),style:{padding:"10px 14px",background:"var(--amber)",color:"#000",border:"1px solid var(--amber)",borderRadius:6,fontSize:12,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},children:"Open Settings"})]})}),L.jsx(kf,{tasks:i,agents:r,onApprove:c,onReject:d,onAgentClick:U,onAddTask:O,onTaskClick:R=>P(R),canCreateTask:j})]}),b&&Y&&L.jsx(Df,{agent:Y,subscribeTerminal:y,injectMessage:s,sendRaw:n,resizeTerminal:p,openAgentTerminal:k,returnAgentTerminal:m,onClose:()=>T(null)}),M&&L.jsx(jf,{task:i.find(R=>R.id===M.id)||M,repos:a,onClose:()=>P(null),onApprove:R=>{c(R),P(null)},onReject:(R,$)=>{d(R,$),P(null)},onPause:R=>{S(R),P(null)},onResume:R=>{h(R)},onEdit:(R,$)=>{_(R,$)},onAbort:R=>{g(R),P(null)},onReset:R=>{x(R),P(null)},onRetry:R=>{v(R),P(null)},onDelete:R=>{u(R),P(null)},onOpenWorkspace:R=>{l(R)}}),A&&L.jsx(Uf,{repos:a,settings:f,onClose:()=>N(!1),onSubmit:(R,$,H,Q)=>{o(R,$,H,Q),N(!1)}}),W&&f&&L.jsx(Vf,{settings:f,onClose:()=>V(!1),onApply:R=>{w(R),V(!1)}}),L.jsx("div",{style:{position:"fixed",bottom:16,right:16,display:"flex",flexDirection:"column",gap:8,zIndex:1e3},children:C.map(R=>L.jsx("div",{style:{padding:"10px 14px",background:"var(--bg2)",borderLeft:`3px solid ${R.type==="error"?"var(--red)":R.type==="success"?"var(--green)":R.type==="warning"?"var(--amber)":"var(--steel2)"}`,borderRadius:4,fontSize:12,maxWidth:320,animation:"toast-in 0.3s ease-out",boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:R.msg},R.id))})]})}function Uf({repos:e,settings:t,onClose:r,onSubmit:i}){const[a,f]=q.useState(""),[C,o]=q.useState("medium"),[c,d]=q.useState(""),[S,h]=q.useState(()=>Ff(e,t)),_=()=>{a.trim()&&i(a.trim(),C,c.trim(),S)};return L.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:L.jsxs("div",{onClick:g=>g.stopPropagation(),style:{width:440,padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[L.jsx("h2",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:18,marginBottom:20},children:"Add Task"}),e.length>0&&L.jsxs("div",{style:{marginBottom:16},children:[L.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Repository"}),L.jsxs("select",{value:S,onChange:g=>h(g.target.value),style:{width:"100%",fontSize:12,padding:"6px 8px"},children:[L.jsx("option",{value:"",children:"No repository"}),e.map(g=>L.jsx("option",{value:g,children:g},g))]})]}),L.jsxs("div",{style:{marginBottom:16},children:[L.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Title"}),L.jsx("input",{autoFocus:!0,type:"text",value:a,onChange:g=>f(g.target.value),onKeyDown:g=>{g.key==="Enter"&&_()},placeholder:"What needs to be built?",style:{width:"100%"}})]}),L.jsxs("div",{style:{marginBottom:16},children:[L.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Priority"}),L.jsx("div",{style:{display:"flex",gap:6},children:["critical","high","medium","low"].map(g=>L.jsx("button",{onClick:()=>o(g),style:{padding:"5px 12px",borderRadius:4,fontSize:12,border:`1px solid ${C===g?Cn[g]:"var(--border)"}`,background:C===g?Cn[g]+"20":"transparent",color:C===g?Cn[g]:"var(--text2)",textTransform:"capitalize"},children:g},g))})]}),L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Description (optional)"}),L.jsx("textarea",{value:c,onChange:g=>d(g.target.value),placeholder:"Additional context...",rows:3,style:{width:"100%",resize:"vertical"}})]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[L.jsx("button",{onClick:r,style:{padding:"8px 16px",color:"var(--text2)",fontSize:12},children:"Cancel"}),L.jsx("button",{onClick:_,disabled:!a.trim(),style:{padding:"8px 20px",background:a.trim()?"var(--amber)":"var(--border)",color:a.trim()?"#000":"var(--text3)",borderRadius:4,fontWeight:500,fontSize:12},children:"Add Task"})]})]})})}const $f={claude:[{value:"",label:"Default (CLI default)"},{value:"claude-opus-4-6",label:"Opus 4.6 (most intelligent)"},{value:"claude-sonnet-4-6",label:"Sonnet 4.6 (balanced)"},{value:"claude-haiku-4-5",label:"Haiku 4.5 (fastest, cheapest)"}],codex:[{value:"",label:"Default (CLI default)"},{value:"gpt-5.4",label:"GPT-5.4 (flagship)"},{value:"gpt-5.3-codex",label:"GPT-5.3 Codex (best coding)"},{value:"gpt-5.3-codex-spark",label:"GPT-5.3 Codex Spark (fast)"}]};function wn(e,t){return`${e}:${t}`}function Kf(e){const t=e.indexOf(":");return t===-1?{cli:"claude",model:""}:{cli:e.slice(0,t),model:e.slice(t+1)}}function Vf({settings:e,onClose:t,onApply:r}){var p,w;const[i,a]=q.useState(()=>JSON.parse(JSON.stringify(e))),[f,C]=q.useState(""),[o,c]=q.useState(!1),[d,S]=q.useState("general"),h=(y,k,m)=>{a(b=>{const T=JSON.parse(JSON.stringify(b));return T.agents[y][k]=m,T})},_=(y,k)=>{a(m=>({...m,prompts:{...m.prompts||{},[y]:k}}))},g=()=>{const y=f.trim();y&&(a(k=>{if((k.repos||[]).includes(y))return k;const m=[...k.repos||[],y];return{...k,repos:m,defaultRepoPath:k.defaultRepoPath||y}}),C(""))},x=y=>{a(k=>{const m=(k.repos||[]).filter(b=>b!==y);return{...k,repos:m,defaultRepoPath:k.defaultRepoPath===y?m[0]||"":k.defaultRepoPath}})},v={planners:{min:0,max:10},implementors:{min:1,max:10},reviewers:{min:0,max:10}},u=!!((p=i.workspaceRoot)!=null&&p.trim())&&Object.entries(i.agents||{}).every(([y,k])=>{const m=v[y]||{min:1,max:10};return k.max>=m.min&&k.max<=m.max})&&["planning","implementation","review"].every(y=>{var k;return typeof((k=i.prompts)==null?void 0:k[y])=="string"}),l=[{key:"general",label:"General"},{key:"planning",label:"Planning"},{key:"implementation",label:"Implementation"},{key:"review",label:"Review"}],s={planning:{roleKey:"planners",promptKey:"planning",description:"Set max agents to 0 to disable planning and skip directly into implementation."},implementation:{roleKey:"implementors",promptKey:"implementation",description:"Implementation cannot be disabled. The prompt body customizes the engineer instructions only."},review:{roleKey:"reviewers",promptKey:"review",description:"Set max agents to 0 to disable review and create the PR immediately after implementation."}},n=y=>{var T;const k=s[y],m=i.agents[k.roleKey],b=v[k.roleKey];return L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:10},children:"AGENTS"}),L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8},children:[L.jsx("span",{style:{fontSize:12,color:"var(--text2)",width:45},children:"Max:"}),L.jsx("input",{type:"number",min:b.min,max:b.max,value:m.max,onChange:M=>{const P=b.min,A=parseInt(M.target.value,10),N=Number.isNaN(A)?P:Math.max(b.min,Math.min(b.max,A));h(k.roleKey,"max",N)},style:{width:60,padding:"4px 6px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,textAlign:"center"}})]}),L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8},children:[L.jsx("span",{style:{fontSize:12,color:"var(--text2)",width:45},children:"Model:"}),L.jsx("select",{"data-testid":`model-select-${k.roleKey}`,value:wn(m.cli,m.model||""),onChange:M=>{const{cli:P,model:A}=Kf(M.target.value);a(N=>{const W=JSON.parse(JSON.stringify(N));return W.agents[k.roleKey].cli=P,W.agents[k.roleKey].model=A,W})},style:{padding:"4px 8px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4},children:Object.entries($f).map(([M,P])=>L.jsx("optgroup",{label:`${M} CLI`,children:P.map(A=>L.jsx("option",{value:wn(M,A.value),children:A.label},wn(M,A.value)))},M))})]}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)"},children:k.description})]}),L.jsxs("div",{style:{marginBottom:18},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"PROMPT BODY"}),L.jsx("textarea",{value:((T=i.prompts)==null?void 0:T[k.promptKey])||"",onChange:M=>_(k.promptKey,M.target.value),spellCheck:!1,style:{width:"100%",minHeight:220,resize:"vertical",padding:"10px 12px",fontSize:12,lineHeight:1.5,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text)"}}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)",marginTop:6},children:"This edits the stage instructions only. Required output markers and parser-critical formatting stay fixed."})]})]})};return L.jsx("div",{onClick:t,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:L.jsxs("div",{onClick:y=>y.stopPropagation(),style:{width:760,maxWidth:"calc(100vw - 32px)",padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20},children:[L.jsx("h2",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:18},children:"Settings"}),L.jsx("button",{onClick:t,style:{color:"var(--text3)",fontSize:16},children:"✕"})]}),L.jsx("div",{style:{display:"flex",gap:8,marginBottom:18,flexWrap:"wrap"},children:l.map(y=>L.jsx("button",{onClick:()=>S(y.key),style:{padding:"7px 12px",background:d===y.key?"var(--amber)":"var(--bg2)",color:d===y.key?"#000":"var(--text2)",border:"1px solid",borderColor:d===y.key?"var(--amber)":"var(--border)",borderRadius:999,fontSize:12,fontWeight:600,cursor:"pointer"},children:y.label},y.key))}),L.jsxs("div",{style:{maxHeight:"65vh",overflowY:"auto",paddingRight:4},children:[d==="general"&&L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"WORKSPACE FOLDER"}),L.jsxs("div",{style:{display:"flex",gap:8,marginBottom:6},children:[L.jsx("input",{type:"text",value:i.workspaceRoot||"",onChange:y=>a(k=>({...k,workspaceRoot:y.target.value})),placeholder:"/path/to/workspaces",style:{flex:1,fontSize:12,padding:"6px 10px"}}),L.jsx("button",{onClick:()=>c(!0),style:{fontSize:12,padding:"6px 10px",background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)",cursor:"pointer"},children:"Browse"})]}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)"},children:"Local folder used when the app creates per-task working copies."}),o&&L.jsx(Tf,{initialPath:i.workspaceRoot||"",onSelect:y=>{a(k=>({...k,workspaceRoot:y})),c(!1)},onClose:()=>c(!1)})]}),L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"REPOSITORIES"}),(i.repos||[]).map(y=>L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[L.jsx("span",{style:{flex:1,fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:y,children:y}),L.jsx("button",{onClick:()=>x(y),style:{color:"var(--red)",fontSize:12,flexShrink:0},children:"×"})]},y)),L.jsxs("div",{style:{display:"flex",gap:8,marginTop:10},children:[L.jsx("input",{type:"text",value:f,onChange:y=>C(y.target.value),onKeyDown:y=>{y.key==="Enter"&&g()},placeholder:"https://github.com/org/repo",style:{flex:1,fontSize:12,padding:"6px 10px"}}),L.jsx("button",{onClick:g,disabled:!f.trim(),style:{fontSize:12,padding:"6px 10px",background:f.trim()?"var(--bg2)":"var(--bg)",border:"1px solid var(--border)",borderRadius:4,color:f.trim()?"var(--text)":"var(--text3)",cursor:f.trim()?"pointer":"default"},children:"Add Repo"})]}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)",marginTop:6},children:"Add repository URLs for task assignment. The workspace folder above controls where the app checks them out locally."})]}),((w=i.repos)==null?void 0:w.length)>0&&L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"DEFAULT REPOSITORY"}),L.jsxs("select",{value:i.defaultRepoPath||"",onChange:y=>a(k=>({...k,defaultRepoPath:y.target.value})),style:{width:"100%",fontSize:12,padding:"6px 10px"},children:[L.jsx("option",{value:"",children:"No default repository"}),(i.repos||[]).map(y=>L.jsx("option",{value:y,children:y},y))]}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)",marginTop:6},children:"New tasks preselect this repository. If it is removed, the first remaining repository becomes the default."})]}),L.jsx("div",{style:{fontSize:11,color:"var(--text3)",marginBottom:16,fontStyle:"italic"},children:"Orchestrator scales agents up on demand, up to the max per role. Planning and Review can be disabled by setting max to 0."})]}),d!=="general"&&n(d)]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[L.jsx("button",{onClick:t,style:{padding:"8px 16px",color:"var(--text2)",fontSize:12},children:"Cancel"}),L.jsx("button",{onClick:()=>r(i),disabled:!u,style:{padding:"8px 20px",background:u?"var(--amber)":"var(--border)",color:u?"#000":"var(--text3)",borderRadius:4,fontWeight:500,fontSize:12},children:"Apply"})]})]})})}Bu(document.getElementById("root")).render(L.jsx(Wf,{}));
|