@stilero/bankan 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,48 @@
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 Ca={exports:{}},Ls={},wa={exports:{}},ee={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var wi=Symbol.for("react.element"),Nu=Symbol.for("react.portal"),Fu=Symbol.for("react.fragment"),zu=Symbol.for("react.strict_mode"),Wu=Symbol.for("react.profiler"),Uu=Symbol.for("react.provider"),$u=Symbol.for("react.context"),Ku=Symbol.for("react.forward_ref"),Vu=Symbol.for("react.suspense"),Gu=Symbol.for("react.memo"),qu=Symbol.for("react.lazy"),cl=Symbol.iterator;function Yu(e){return e===null||typeof e!="object"?null:(e=cl&&e[cl]||e["@@iterator"],typeof e=="function"?e:null)}var xa={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ka=Object.assign,Ea={};function Dr(e,t,r){this.props=e,this.context=t,this.refs=Ea,this.updater=r||xa}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 ba(){}ba.prototype=Dr.prototype;function _o(e,t,r){this.props=e,this.context=t,this.refs=Ea,this.updater=r||xa}var vo=_o.prototype=new ba;vo.constructor=_o;ka(vo,Dr.prototype);vo.isPureReactComponent=!0;var ul=Array.isArray,Ra=Object.prototype.hasOwnProperty,go={current:null},La={key:!0,ref:!0,__self:!0,__source:!0};function Da(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)Ra.call(t,i)&&!La.hasOwnProperty(i)&&(a[i]=t[i]);var o=arguments.length-2;if(o===1)a.children=r;else if(1<o){for(var u=Array(o),d=0;d<o;d++)u[d]=arguments[d+2];a.children=u}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:go.current}}function Xu(e,t){return{$$typeof:wi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function mo(e){return typeof e=="object"&&e!==null&&e.$$typeof===wi}function Qu(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var hl=/\/+/g;function qs(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Qu(""+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 Nu:C=!0}}if(C)return C=e,a=a(C),e=i===""?"."+qs(C,0):i,ul(a)?(r="",e!=null&&(r=e.replace(hl,"$&/")+"/"),Vi(a,t,r,"",function(d){return d})):a!=null&&(mo(a)&&(a=Xu(a,r+(!a.key||C&&C.key===a.key?"":(""+a.key).replace(hl,"$&/")+"/")+e)),t.push(a)),1;if(C=0,i=i===""?".":i+":",ul(e))for(var o=0;o<e.length;o++){f=e[o];var u=i+qs(f,o);C+=Vi(f,t,r,u,a)}else if(u=Yu(e),typeof u=="function")for(e=u.call(e),o=0;!(f=e.next()).done;)f=f.value,u=i+qs(f,o++),C+=Vi(f,t,r,u,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 Zu(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},Ju={ReactCurrentDispatcher:Te,ReactCurrentBatchConfig:Gi,ReactCurrentOwner:go};function Ta(){throw Error("act(...) is not supported in production builds of React.")}ee.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(!mo(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ee.Component=Dr;ee.Fragment=Fu;ee.Profiler=Wu;ee.PureComponent=_o;ee.StrictMode=zu;ee.Suspense=Vu;ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ju;ee.act=Ta;ee.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=ka({},e.props),a=e.key,f=e.ref,C=e._owner;if(t!=null){if(t.ref!==void 0&&(f=t.ref,C=go.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)Ra.call(t,u)&&!La.hasOwnProperty(u)&&(i[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)i.children=r;else if(1<u){o=Array(u);for(var d=0;d<u;d++)o[d]=arguments[d+2];i.children=o}return{$$typeof:wi,type:e.type,key:a,ref:f,props:i,_owner:C}};ee.createContext=function(e){return e={$$typeof:$u,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Uu,_context:e},e.Consumer=e};ee.createElement=Da;ee.createFactory=function(e){var t=Da.bind(null,e);return t.type=e,t};ee.createRef=function(){return{current:null}};ee.forwardRef=function(e){return{$$typeof:Ku,render:e}};ee.isValidElement=mo;ee.lazy=function(e){return{$$typeof:qu,_payload:{_status:-1,_result:e},_init:Zu}};ee.memo=function(e,t){return{$$typeof:Gu,type:e,compare:t===void 0?null:t}};ee.startTransition=function(e){var t=Gi.transition;Gi.transition={};try{e()}finally{Gi.transition=t}};ee.unstable_act=Ta;ee.useCallback=function(e,t){return Te.current.useCallback(e,t)};ee.useContext=function(e){return Te.current.useContext(e)};ee.useDebugValue=function(){};ee.useDeferredValue=function(e){return Te.current.useDeferredValue(e)};ee.useEffect=function(e,t){return Te.current.useEffect(e,t)};ee.useId=function(){return Te.current.useId()};ee.useImperativeHandle=function(e,t,r){return Te.current.useImperativeHandle(e,t,r)};ee.useInsertionEffect=function(e,t){return Te.current.useInsertionEffect(e,t)};ee.useLayoutEffect=function(e,t){return Te.current.useLayoutEffect(e,t)};ee.useMemo=function(e,t){return Te.current.useMemo(e,t)};ee.useReducer=function(e,t,r){return Te.current.useReducer(e,t,r)};ee.useRef=function(e){return Te.current.useRef(e)};ee.useState=function(e){return Te.current.useState(e)};ee.useSyncExternalStore=function(e,t,r){return Te.current.useSyncExternalStore(e,t,r)};ee.useTransition=function(){return Te.current.useTransition()};ee.version="18.3.1";wa.exports=ee;var V=wa.exports;/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var eh=V,th=Symbol.for("react.element"),rh=Symbol.for("react.fragment"),ih=Object.prototype.hasOwnProperty,sh=eh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nh={key:!0,ref:!0,__self:!0,__source:!0};function Aa(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)ih.call(t,i)&&!nh.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:th,type:e,key:f,ref:C,props:a,_owner:sh.current}}Ls.Fragment=rh;Ls.jsx=Aa;Ls.jsxs=Aa;Ca.exports=Ls;var L=Ca.exports,Ma={exports:{}},We={},Pa={exports:{}},Ia={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(H,b){var T=H.length;H.push(b);e:for(;0<T;){var D=T-1>>>1,M=H[D];if(0<a(M,b))H[D]=b,H[T]=M,T=D;else break e}}function r(H){return H.length===0?null:H[0]}function i(H){if(H.length===0)return null;var b=H[0],T=H.pop();if(T!==b){H[0]=T;e:for(var D=0,M=H.length,j=M>>>1;D<j;){var U=2*(D+1)-1,Z=H[U],q=U+1,O=H[q];if(0>a(Z,T))q<M&&0>a(O,Z)?(H[D]=O,H[q]=T,D=q):(H[D]=Z,H[U]=T,D=U);else if(q<M&&0>a(O,T))H[D]=O,H[q]=T,D=q;else break e}}return b}function a(H,b){var T=H.sortIndex-b.sortIndex;return T!==0?T:H.id-b.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 u=[],d=[],g=1,h=null,_=3,S=!1,x=!1,v=!1,c=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(H){for(var b=r(d);b!==null;){if(b.callback===null)i(d);else if(b.startTime<=H)i(d),b.sortIndex=b.expirationTime,t(u,b);else break;b=r(d)}}function p(H){if(v=!1,n(H),!x)if(r(u)!==null)x=!0,K(w);else{var b=r(d);b!==null&&G(p,b.startTime-H)}}function w(H,b){x=!1,v&&(v=!1,l(m),m=-1),S=!0;var T=_;try{for(n(b),h=r(u);h!==null&&(!(h.expirationTime>b)||H&&!I());){var D=h.callback;if(typeof D=="function"){h.callback=null,_=h.priorityLevel;var M=D(h.expirationTime<=b);b=e.unstable_now(),typeof M=="function"?h.callback=M:h===r(u)&&i(u),n(b)}else i(u);h=r(u)}if(h!==null)var j=!0;else{var U=r(d);U!==null&&G(p,U.startTime-b),j=!1}return j}finally{h=null,_=T,S=!1}}var y=!1,k=null,m=-1,E=5,A=-1;function I(){return!(e.unstable_now()-A<E)}function B(){if(k!==null){var H=e.unstable_now();A=H;var b=!0;try{b=k(!0,H)}finally{b?P():(y=!1,k=null)}}else y=!1}var P;if(typeof s=="function")P=function(){s(B)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,z=N.port2;N.port1.onmessage=B,P=function(){z.postMessage(null)}}else P=function(){c(B,0)};function K(H){k=H,y||(y=!0,P())}function G(H,b){m=c(function(){H(e.unstable_now())},b)}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(H){H.callback=null},e.unstable_continueExecution=function(){x||S||(x=!0,K(w))},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(H){switch(_){case 1:case 2:case 3:var b=3;break;default:b=_}var T=_;_=b;try{return H()}finally{_=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(H,b){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var T=_;_=H;try{return b()}finally{_=T}},e.unstable_scheduleCallback=function(H,b,T){var D=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?D+T:D):T=D,H){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=T+M,H={id:g++,callback:b,priorityLevel:H,startTime:T,expirationTime:M,sortIndex:-1},T>D?(H.sortIndex=T,t(d,H),r(u)===null&&H===r(d)&&(v?(l(m),m=-1):v=!0,G(p,T-D))):(H.sortIndex=M,t(u,H),x||S||(x=!0,K(w))),H},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(H){var b=_;return function(){var T=_;_=b;try{return H.apply(this,arguments)}finally{_=T}}}})(Ia);Pa.exports=Ia;var oh=Pa.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var lh=V,ze=oh;function $(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 Ba=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++)Ba.add(t[e])}var _t=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wn=Object.prototype.hasOwnProperty,ah=/^[: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]*$/,dl={},fl={};function ch(e){return wn.call(fl,e)?!0:wn.call(dl,e)?!1:ah.test(e)?fl[e]=!0:(dl[e]=!0,!1)}function uh(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 hh(e,t,r,i){if(t===null||typeof t>"u"||uh(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 So=/[\-:]([a-z])/g;function yo(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(So,yo);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(So,yo);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(So,yo);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 Co(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")&&(hh(t,r,a,i)&&(r=null),i||a===null?ch(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=lh.__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"),wo=Symbol.for("react.strict_mode"),xn=Symbol.for("react.profiler"),Oa=Symbol.for("react.provider"),ja=Symbol.for("react.context"),xo=Symbol.for("react.forward_ref"),kn=Symbol.for("react.suspense"),En=Symbol.for("react.suspense_list"),ko=Symbol.for("react.memo"),xt=Symbol.for("react.lazy"),Ha=Symbol.for("react.offscreen"),pl=Symbol.iterator;function Or(e){return e===null||typeof e!="object"?null:(e=pl&&e[pl]||e["@@iterator"],typeof e=="function"?e:null)}var he=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
+ `+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
+ `),f=i.stack.split(`
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 u=`
37
+ `+a[C].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=C&&0<=o);break}}}finally{Xs=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Vr(e):""}function dh(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 bn(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 En:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ja:return(e.displayName||"Context")+".Consumer";case Oa: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:bn(e.type)||"Memo";case xt:t=e._payload,e=e._init;try{return bn(e(t))}catch{}}return null}function fh(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 bn(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 Na(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ph(e){var t=Na(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=ph(e))}function Fa(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Na(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 he({},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 za(e,t){t=t.checked,t!=null&&Co(e,"checked",t,!1)}function Ln(e,t){za(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($(91));return he({},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($(92));if(Gr(r)){if(1<r.length)throw Error($(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:jt(r)}}function Wa(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 Ua(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"?Ua(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Mi,$a=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(Mi=Mi||document.createElement("div"),Mi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Mi.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},_h=["Webkit","ms","Moz","O"];Object.keys(Xr).forEach(function(e){_h.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xr[t]=Xr[e]})});function Ka(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 Va(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,a=Ka(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,a):e[r]=a}}var vh=he({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(vh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error($(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error($(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error($(61))}if(t.style!=null&&typeof t.style!="object")throw Error($(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 In=null;function Eo(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=Ei(e)){if(typeof Bn!="function")throw Error($(280));var t=e.stateNode;t&&(t=Ps(t),Bn(e.stateNode,e.type,t))}}function Ga(e){gr?mr?mr.push(e):mr=[e]:gr=e}function qa(){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 Ya(e,t){return e(t)}function Xa(){}var Zs=!1;function Qa(e,t,r){if(Zs)return e(t,r);Zs=!0;try{return Ya(e,t,r)}finally{Zs=!1,(gr!==null||mr!==null)&&(Xa(),qa())}}function li(e,t){var r=e.stateNode;if(r===null)return null;var i=Ps(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($(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 gh(e,t,r,i,a,f,C,o,u){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(g){this.onError(g)}}var Qr=!1,ns=null,os=!1,jn=null,mh={onError:function(e){Qr=!0,ns=e}};function Sh(e,t,r,i,a,f,C,o,u){Qr=!1,ns=null,gh.apply(mh,arguments)}function yh(e,t,r,i,a,f,C,o,u){if(Sh.apply(this,arguments),Qr){if(Qr){var d=ns;Qr=!1,ns=null}else throw Error($(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 Za(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($(188))}function Ch(e){var t=e.alternate;if(!t){if(t=tr(e),t===null)throw Error($(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($(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($(189))}}if(r.alternate!==i)throw Error($(190))}if(r.tag!==3)throw Error($(188));return r.stateNode.current===r?e:t}function Ja(e){return e=Ch(e),e!==null?ec(e):null}function ec(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ec(e);if(t!==null)return t;e=e.sibling}return null}var tc=ze.unstable_scheduleCallback,Cl=ze.unstable_cancelCallback,wh=ze.unstable_shouldYield,xh=ze.unstable_requestPaint,_e=ze.unstable_now,kh=ze.unstable_getCurrentPriorityLevel,bo=ze.unstable_ImmediatePriority,rc=ze.unstable_UserBlockingPriority,ls=ze.unstable_NormalPriority,Eh=ze.unstable_LowPriority,ic=ze.unstable_IdlePriority,Ds=null,at=null;function bh(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:Dh,Rh=Math.log,Lh=Math.LN2;function Dh(e){return e>>>=0,e===0?32:31-(Rh(e)/Lh|0)|0}var Pi=64,Ii=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 Th(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 Ah(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,u=a[C];u===-1?(!(o&r)||o&i)&&(a[C]=Th(o,t)):u<=t&&(e.expiredLanes|=o),f&=~o}}function Hn(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function sc(){var e=Pi;return Pi<<=1,!(Pi&4194240)&&(Pi=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 ie=0;function nc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var oc,Lo,lc,ac,cc,Nn=!1,Bi=[],Dt=null,Tt=null,At=null,ai=new Map,ci=new Map,Et=[],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=Ei(t),t!==null&&Lo(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Ih(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 uc(e){var t=$t(e.target);if(t!==null){var r=tr(t);if(r!==null){if(t=r.tag,t===13){if(t=Za(r),t!==null){e.blockedOn=t,cc(e.priority,function(){lc(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);In=i,r.target.dispatchEvent(i),In=null}else return t=Ei(r),t!==null&&Lo(t),e.blockedOn=r,!1;t.shift()}return!0}function xl(e,t,r){qi(e)&&r.delete(t)}function Bh(){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,Bh)))}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<Et.length;r++)i=Et[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<Et.length&&(r=Et[0],r.blockedOn===null);)uc(r),r.blockedOn===null&&Et.shift()}var Sr=St.ReactCurrentBatchConfig,cs=!0;function Oh(e,t,r,i){var a=ie,f=Sr.transition;Sr.transition=null;try{ie=1,Do(e,t,r,i)}finally{ie=a,Sr.transition=f}}function jh(e,t,r,i){var a=ie,f=Sr.transition;Sr.transition=null;try{ie=4,Do(e,t,r,i)}finally{ie=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(Ih(a,e,t,r,i))i.stopPropagation();else if(wl(e,i),t&4&&-1<Ph.indexOf(e)){for(;a!==null;){var f=Ei(a);if(f!==null&&oc(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=Eo(i),e=$t(e),e!==null)if(t=tr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Za(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 hc(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(kh()){case bo:return 1;case rc:return 4;case ls:case Eh:return 16;case ic:return 536870912;default:return 16}default:return 16}}var Rt=null,To=null,Yi=null;function dc(){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 he(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=he({},Tr,{view:0,detail:0}),Hh=Ue(ki),en,tn,Fr,Ts=he({},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),Nh=he({},Ts,{dataTransfer:0}),Fh=Ue(Nh),zh=he({},ki,{relatedTarget:0}),rn=Ue(zh),Wh=he({},Tr,{animationName:0,elapsedTime:0,pseudoElement:0}),Uh=Ue(Wh),$h=he({},Tr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kh=Ue($h),Vh=he({},Tr,{data:0}),bl=Ue(Vh),Gh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qh={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"},Yh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yh[e])?!!t[e]:!1}function Mo(){return Xh}var Qh=he({},ki,{key:function(e){if(e.key){var t=Gh[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"?qh[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}}),Zh=Ue(Qh),Jh=he({},Ts,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rl=Ue(Jh),ed=he({},ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mo}),td=Ue(ed),rd=he({},Tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),id=Ue(rd),sd=he({},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}),nd=Ue(sd),od=[9,13,27,32],Po=_t&&"CompositionEvent"in window,Zr=null;_t&&"documentMode"in document&&(Zr=document.documentMode);var ld=_t&&"TextEvent"in window&&!Zr,fc=_t&&(!Po||Zr&&8<Zr&&11>=Zr),Ll=" ",Dl=!1;function pc(e,t){switch(e){case"keyup":return od.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _c(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var or=!1;function ad(e,t){switch(e){case"compositionend":return _c(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 cd(e,t){if(or)return e==="compositionend"||!Po&&pc(e,t)?(e=dc(),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 fc&&t.locale!=="ko"?null:t.data;default:return null}}var ud={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"?!!ud[e.type]:t==="textarea"}function vc(e,t,r,i){Ga(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 hd(e){Rc(e,0)}function As(e){var t=cr(e);if(Fa(t))return e}function dd(e,t){if(e==="change")return t}var gc=!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;gc=sn&&(!document.documentMode||9<document.documentMode)}function Ml(){Jr&&(Jr.detachEvent("onpropertychange",mc),hi=Jr=null)}function mc(e){if(e.propertyName==="value"&&As(hi)){var t=[];vc(t,hi,e,Eo(e)),Qa(hd,t)}}function fd(e,t,r){e==="focusin"?(Ml(),Jr=t,hi=r,Jr.attachEvent("onpropertychange",mc)):e==="focusout"&&Ml()}function pd(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return As(hi)}function _d(e,t){if(e==="click")return As(t)}function vd(e,t){if(e==="input"||e==="change")return As(t)}function gd(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var it=typeof Object.is=="function"?Object.is:gd;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 Pl(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Il(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 Sc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yc(){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 Io(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 md(e){var t=yc(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Sc(r.ownerDocument.documentElement,r)){if(i!==null&&Io(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=Il(r,f);var C=Il(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 Sd=_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&&Io(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={},Cc={};_t&&(Cc=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 Ms(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 Cc)return on[e]=t[r];return e}var wc=Ms("animationend"),xc=Ms("animationiteration"),kc=Ms("animationstart"),Ec=Ms("transitionend"),bc=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){bc.set(e,t),er(t,[e])}for(var ln=0;ln<Ol.length;ln++){var an=Ol[ln],yd=an.toLowerCase(),Cd=an[0].toUpperCase()+an.slice(1);Nt(yd,"on"+Cd)}Nt(wc,"onAnimationEnd");Nt(xc,"onAnimationIteration");Nt(kc,"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(" "),wd=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,yh(i,t,void 0,e),e.currentTarget=null}function Rc(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],u=o.instance,d=o.currentTarget;if(o=o.listener,u!==f&&a.isPropagationStopped())break e;jl(a,o,d),f=u}else for(C=0;C<i.length;C++){if(o=i[C],u=o.instance,d=o.currentTarget,o=o.listener,u!==f&&a.isPropagationStopped())break e;jl(a,o,d),f=u}}}if(os)throw e=jn,os=!1,jn=null,e}function ne(e,t){var r=t[Gn];r===void 0&&(r=t[Gn]=new Set);var i=e+"__bubble";r.has(i)||(Lc(t,e,2,!1),r.add(i))}function cn(e,t,r){var i=0;t&&(i|=4),Lc(r,e,i,t)}var Hi="_reactListening"+Math.random().toString(36).slice(2);function fi(e){if(!e[Hi]){e[Hi]=!0,Ba.forEach(function(r){r!=="selectionchange"&&(wd.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 Lc(e,t,r,i){switch(hc(t)){case 1:var a=Oh;break;case 4:a=jh;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 u=C.tag;if((u===3||u===4)&&(u=C.stateNode.containerInfo,u===a||u.nodeType===8&&u.parentNode===a))return;C=C.return}for(;o!==null;){if(C=$t(o),C===null)return;if(u=C.tag,u===5||u===6){i=f=C;continue e}o=o.parentNode}}i=i.return}Qa(function(){var d=f,g=Eo(r),h=[];e:{var _=bc.get(e);if(_!==void 0){var S=Ao,x=e;switch(e){case"keypress":if(Xi(r)===0)break e;case"keydown":case"keyup":S=Zh;break;case"focusin":x="focus",S=rn;break;case"focusout":x="blur",S=rn;break;case"beforeblur":case"afterblur":S=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":S=El;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":S=Fh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":S=td;break;case wc:case xc:case kc:S=Uh;break;case Ec:S=id;break;case"scroll":S=Hh;break;case"wheel":S=nd;break;case"copy":case"cut":case"paste":S=Kh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":S=Rl}var v=(t&4)!==0,c=!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)))),c)break;s=s.return}0<v.length&&(_=new S(_,x,null,r,g),h.push({event:_,listeners:v}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",S=e==="mouseout"||e==="pointerout",_&&r!==In&&(x=r.relatedTarget||r.fromElement)&&($t(x)||x[vt]))break e;if((S||_)&&(_=g.window===g?g:(_=g.ownerDocument)?_.defaultView||_.parentWindow:window,S?(x=r.relatedTarget||r.toElement,S=d,x=x?$t(x):null,x!==null&&(c=tr(x),x!==c||x.tag!==5&&x.tag!==6)&&(x=null)):(S=null,x=d),S!==x)){if(v=El,p="onMouseLeave",l="onMouseEnter",s="mouse",(e==="pointerout"||e==="pointerover")&&(v=Rl,p="onPointerLeave",l="onPointerEnter",s="pointer"),c=S==null?_:cr(S),n=x==null?_:cr(x),_=new v(p,s+"leave",S,r,g),_.target=c,_.relatedTarget=n,p=null,$t(g)===d&&(v=new v(l,s+"enter",x,r,g),v.target=n,v.relatedTarget=c,p=v),c=p,S&&x)t:{for(v=S,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;S!==null&&Hl(h,_,S,v,!1),x!==null&&c!==null&&Hl(h,c,x,v,!0)}}e:{if(_=d?cr(d):window,S=_.nodeName&&_.nodeName.toLowerCase(),S==="select"||S==="input"&&_.type==="file")var w=dd;else if(Tl(_))if(gc)w=vd;else{w=pd;var y=fd}else(S=_.nodeName)&&S.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(w=_d);if(w&&(w=w(e,d))){vc(h,w,r,g);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,g);break;case"selectionchange":if(Sd)break;case"keydown":case"keyup":Bl(h,r,g)}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?pc(e,r)&&(m="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(m="onCompositionStart");m&&(fc&&r.locale!=="ko"&&(or||m!=="onCompositionStart"?m==="onCompositionEnd"&&or&&(k=dc()):(Rt=g,To="value"in Rt?Rt.value:Rt.textContent,or=!0)),y=hs(d,m),0<y.length&&(m=new bl(m,e,null,r,g),h.push({event:m,listeners:y}),k?m.data=k:(k=_c(r),k!==null&&(m.data=k)))),(k=ld?ad(e,r):cd(e,r))&&(d=hs(d,"onBeforeInput"),0<d.length&&(g=new bl("onBeforeInput","beforeinput",null,r,g),h.push({event:g,listeners:d}),g.data=k))}Rc(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,u=o.alternate,d=o.stateNode;if(u!==null&&u===i)break;o.tag===5&&d!==null&&(o=d,a?(u=li(r,f),u!=null&&C.unshift(pi(r,u,o))):a||(u=li(r,f),u!=null&&C.push(pi(r,u,o)))),r=r.return}C.length!==0&&e.push({event:t,listeners:C})}var xd=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Nl(e){return(typeof e=="string"?e:""+e).replace(xd,`
38
+ `).replace(kd,"")}function Ni(e,t,r){if(t=Nl(t),Nl(e)!==t&&r)throw Error($(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,bd=typeof queueMicrotask=="function"?queueMicrotask:typeof Fl<"u"?function(e){return Fl.resolve(null).then(e).catch(Rd)}:Vn;function Rd(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 Mt(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,Ld="__reactListeners$"+Ar,Dd="__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 Ei(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($(33))}function Ps(e){return e[_i]||null}var qn=[],ur=-1;function Ft(e){return{current:e}}function oe(e){0>ur||(e.current=qn[ur],qn[ur]=null,ur--)}function se(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(){oe(Be),oe(Re)}function Wl(e,t,r){if(Re.current!==Ht)throw Error($(168));se(Re,t),se(Be,r)}function Dc(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($(108,fh(e)||"Unknown",a));return he({},r,i)}function ps(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ht,Yt=Re.current,se(Re,e),se(Be,Be.current),!0}function Ul(e,t,r){var i=e.stateNode;if(!i)throw Error($(169));r?(e=Dc(e,t,Yt),i.__reactInternalMemoizedMergedChildContext=e,oe(Be),oe(Re),se(Re,e)):oe(Be),se(Be,r)}var ht=null,Is=!1,dn=!1;function Tc(e){ht===null?ht=[e]:ht.push(e)}function Td(e){Is=!0,Tc(e)}function zt(){if(!dn&&ht!==null){dn=!0;var e=0,t=ie;try{var r=ht;for(ie=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}ht=null,Is=!1}catch(a){throw ht!==null&&(ht=ht.slice(e+1)),tc(bo,zt),a}finally{ie=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 Ac(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),Ac(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,le=!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=Mt(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(le){var t=Ne;if(t){var r=t;if(!$l(e,t)){if(Yn(e))throw Error($(418));t=Mt(r.nextSibling);var i=Fe;t&&$l(e,t)?Mc(i,r):(e.flags=e.flags&-4097|2,le=!1,Fe=e)}}else{if(Yn(e))throw Error($(418));e.flags=e.flags&-4097|2,le=!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(!le)return Kl(e),le=!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($(418));for(;t;)Mc(e,t),t=Mt(t.nextSibling)}if(Kl(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error($(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Ne=Mt(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Ne=null}}else Ne=Fe?Mt(e.stateNode.nextSibling):null;return!0}function Pc(){for(var e=Ne;e;)e=Mt(e.nextSibling)}function kr(){Ne=Fe=null,le=!1}function jo(e){et===null?et=[e]:et.push(e)}var Ad=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($(309));var i=r.stateNode}if(!i)throw Error($(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($(284));if(!r._owner)throw Error($(290,e))}return e}function zi(e,t){throw e=Object.prototype.toString.call(t),Error($(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vl(e){var t=e._init;return t(e._payload)}function Ic(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 u(l,s,n,p){var w=n.type;return w===nr?g(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 g(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?u(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:g(l,s,n,p,null);zi(l,n)}return null}function S(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,u(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 S(l,s,n,y(p._payload),w)}if(Gr(p)||Or(p))return l=l.get(n)||null,g(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,E=null;k!==null&&m<n.length;m++){k.index>m?(E=k,k=null):E=k.sibling;var A=_(l,k,n[m],p);if(A===null){k===null&&(k=E);break}e&&k&&A.alternate===null&&t(l,k),s=f(A,s,m),y===null?w=A:y.sibling=A,y=A,k=E}if(m===n.length)return r(l,k),le&&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 le&&Wt(l,m),w}for(k=i(l,k);m<n.length;m++)E=S(k,l,m,n[m],p),E!==null&&(e&&E.alternate!==null&&k.delete(E.key===null?m:E.key),s=f(E,s,m),y===null?w=E:y.sibling=E,y=E);return e&&k.forEach(function(I){return t(l,I)}),le&&Wt(l,m),w}function v(l,s,n,p){var w=Or(n);if(typeof w!="function")throw Error($(150));if(n=w.call(n),n==null)throw Error($(151));for(var y=w=null,k=s,m=s=0,E=null,A=n.next();k!==null&&!A.done;m++,A=n.next()){k.index>m?(E=k,k=null):E=k.sibling;var I=_(l,k,A.value,p);if(I===null){k===null&&(k=E);break}e&&k&&I.alternate===null&&t(l,k),s=f(I,s,m),y===null?w=I:y.sibling=I,y=I,k=E}if(A.done)return r(l,k),le&&Wt(l,m),w;if(k===null){for(;!A.done;m++,A=n.next())A=h(l,A.value,p),A!==null&&(s=f(A,s,m),y===null?w=A:y.sibling=A,y=A);return le&&Wt(l,m),w}for(k=i(l,k);!A.done;m++,A=n.next())A=S(k,l,m,A.value,p),A!==null&&(e&&A.alternate!==null&&k.delete(A.key===null?m:A.key),s=f(A,s,m),y===null?w=A:y.sibling=A,y=A);return e&&k.forEach(function(B){return t(l,B)}),le&&Wt(l,m),w}function c(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,c(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 c}var Er=Ic(!0),Bc=Ic(!1),gs=Ft(null),ms=null,fr=null,Ho=null;function No(){Ho=fr=ms=null}function Fo(e){var t=gs.current;oe(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&&(Ie=!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($(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 Oc(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 jc(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 Pt(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 u=o,d=u.next;u.next=null,C===null?f=d:C.next=d,C=u;var g=e.alternate;g!==null&&(g=g.updateQueue,o=g.lastBaseUpdate,o!==C&&(o===null?g.firstBaseUpdate=d:o.next=d,g.lastBaseUpdate=u))}if(f!==null){var h=a.baseState;C=0,g=d=u=null,o=f;do{var _=o.lane,S=o.eventTime;if((i&_)===_){g!==null&&(g=g.next={eventTime:S,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var x=e,v=o;switch(_=t,S=r,v.tag){case 1:if(x=v.payload,typeof x=="function"){h=x.call(S,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(S,h,_):x,_==null)break e;h=he({},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 S={eventTime:S,lane:_,tag:o.tag,payload:o.payload,callback:o.callback,next:null},g===null?(d=g=S,u=h):g=g.next=S,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(g===null&&(u=h),a.baseState=u,a.firstBaseUpdate=d,a.lastBaseUpdate=g,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($(191,a));a.call(i)}}}var bi={},ct=Ft(bi),vi=Ft(bi),gi=Ft(bi);function Vt(e){if(e===bi)throw Error($(174));return e}function Uo(e,t){switch(se(gi,t),se(vi,e),se(ct,bi),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)}oe(ct),se(ct,t)}function br(){oe(ct),oe(vi),oe(gi)}function Hc(e){Vt(gi.current);var t=Vt(ct.current),r=An(t,e.type);t!==r&&(se(vi,e),se(ct,r))}function $o(e){vi.current===e&&(oe(ct),oe(vi))}var ce=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,ue=null,ge=null,Se=null,Cs=!1,ti=!1,mi=0,Md=0;function ke(){throw Error($(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,ue=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Zi.current=e===null||e.memoizedState===null?Od:jd,e=r(i,a),ti){f=0;do{if(ti=!1,mi=0,25<=f)throw Error($(301));f+=1,Se=ge=null,t.updateQueue=null,Zi.current=Hd,e=r(i,a)}while(ti)}if(Zi.current=ws,t=ge!==null&&ge.next!==null,Qt=0,Se=ge=ue=null,Cs=!1,t)throw Error($(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?ue.memoizedState=Se=e:Se=Se.next=e,Se}function Xe(){if(ge===null){var e=ue.alternate;e=e!==null?e.memoizedState:null}else e=ge.next;var t=Se===null?ue.memoizedState:Se.next;if(t!==null)Se=t,ge=e;else{if(e===null)throw Error($(310));ge=e,e={memoizedState:ge.memoizedState,baseState:ge.baseState,baseQueue:ge.baseQueue,queue:ge.queue,next:null},Se===null?ue.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($(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,u=null,d=f;do{var g=d.lane;if((Qt&g)===g)u!==null&&(u=u.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:g,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};u===null?(o=u=h,C=i):u=u.next=h,ue.lanes|=g,Zt|=g}d=d.next}while(d!==null&&d!==f);u===null?C=i:u.next=o,it(i,t.memoizedState)||(Ie=!0),t.memoizedState=i,t.baseState=C,t.baseQueue=u,r.lastRenderedState=i}if(e=r.interleaved,e!==null){a=e;do f=a.lane,ue.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($(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)||(Ie=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),r.lastRenderedState=f}return[f,i]}function Nc(){}function Fc(e,t){var r=ue,i=Xe(),a=t(),f=!it(i.memoizedState,a);if(f&&(i.memoizedState=a,Ie=!0),i=i.queue,Yo(Uc.bind(null,r,i,e),[e]),i.getSnapshot!==t||f||Se!==null&&Se.memoizedState.tag&1){if(r.flags|=2048,yi(9,Wc.bind(null,r,i,a,t),void 0,null),ye===null)throw Error($(349));Qt&30||zc(r,t,a)}return a}function zc(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ue.updateQueue,t===null?(t={lastEffect:null,stores:null},ue.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Wc(e,t,r,i){t.value=r,t.getSnapshot=i,$c(t)&&Kc(e)}function Uc(e,t,r){return r(function(){$c(t)&&Kc(e)})}function $c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!it(e,r)}catch{return!0}}function Kc(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=Bd.bind(null,ue,e),[t.memoizedState,e]}function yi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=ue.updateQueue,t===null?(t={lastEffect:null,stores:null},ue.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 Vc(){return Xe().memoizedState}function Ji(e,t,r,i){var a=ot();ue.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}}ue.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 Gc(e,t){return Bs(4,2,e,t)}function qc(e,t){return Bs(4,4,e,t)}function Yc(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 Xc(e,t,r){return r=r!=null?r.concat([e]):null,Bs(4,4,Yc.bind(null,t,e),r)}function Xo(){}function Qc(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 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]:(e=e(),r.memoizedState=[e,t],e)}function Jc(e,t,r){return Qt&21?(it(r,t)||(r=sc(),ue.lanes|=r,Zt|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ie=!0),e.memoizedState=r)}function Pd(e,t){var r=ie;ie=r!==0&&4>r?r:4,e(!0);var i=pn.transition;pn.transition={};try{e(!1),t()}finally{ie=r,pn.transition=i}}function eu(){return Xe().memoizedState}function Id(e,t,r){var i=Bt(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},tu(e))ru(t,r);else if(r=Oc(e,t,r,i),r!==null){var a=De();rt(r,e,i,a),iu(r,t,i)}}function Bd(e,t,r){var i=Bt(e),a={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(tu(e))ru(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 u=t.interleaved;u===null?(a.next=a,zo(t)):(a.next=u.next,u.next=a),t.interleaved=a;return}}catch{}finally{}r=Oc(e,t,a,i),r!==null&&(a=De(),rt(r,e,i,a),iu(r,t,i))}}function tu(e){var t=e.alternate;return e===ue||t!==null&&t===ue}function ru(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 iu(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},Od={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,Yc.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=Id.bind(null,ue,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=ue,a=ot();if(le){if(r===void 0)throw Error($(407));r=r()}else{if(r=t(),ye===null)throw Error($(349));Qt&30||zc(i,t,r)}a.memoizedState=r;var f={value:r,getSnapshot:t};return a.queue=f,Xl(Uc.bind(null,i,f,e),[e]),i.flags|=2048,yi(9,Wc.bind(null,i,f,r,t),void 0,null),r},useId:function(){var e=ot(),t=ye.identifierPrefix;if(le){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},jd={readContext:Ye,useCallback:Qc,useContext:Ye,useEffect:Yo,useImperativeHandle:Xc,useInsertionEffect:Gc,useLayoutEffect:qc,useMemo:Zc,useReducer:_n,useRef:Vc,useState:function(){return _n(Si)},useDebugValue:Xo,useDeferredValue:function(e){var t=Xe();return Jc(t,ge.memoizedState,e)},useTransition:function(){var e=_n(Si)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:Nc,useSyncExternalStore:Fc,useId:eu,unstable_isNewReconciler:!1},Hd={readContext:Ye,useCallback:Qc,useContext:Ye,useEffect:Yo,useImperativeHandle:Xc,useInsertionEffect:Gc,useLayoutEffect:qc,useMemo:Zc,useReducer:vn,useRef:Vc,useState:function(){return vn(Si)},useDebugValue:Xo,useDeferredValue:function(e){var t=Xe();return ge===null?t.memoizedState=e:Jc(t,ge.memoizedState,e)},useTransition:function(){var e=vn(Si)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:Nc,useSyncExternalStore:Fc,useId:eu,unstable_isNewReconciler:!1};function Ze(e,t){if(e&&e.defaultProps){t=he({},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:he({},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=Pt(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=Pt(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=Pt(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 su(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+=dh(i),i=i.return;while(i);var a=r}catch(f){a=`
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 Nd=typeof WeakMap=="function"?WeakMap:Map;function nu(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 ou(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"&&(It===null?It=new Set([this]):It.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 Nd;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=Jd.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,Pt(r,t,1))),r.lanes|=1),e)}var Fd=St.ReactCurrentOwner,Ie=!1;function Le(e,t,r,i){t.child=e===null?Bc(t,null,r,i):Er(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&&!Ie?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,mt(e,t,a)):(le&&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,lu(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 lu(e,t,r,i,a){if(e!==null){var f=e.memoizedProps;if(di(f,i)&&e.ref===t.ref)if(Ie=!1,t.pendingProps=i=f,(e.lanes&a)!==0)e.flags&131072&&(Ie=!0);else return t.lanes=e.lanes,mt(e,t,a)}return to(e,t,r,i,a)}function au(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},se(_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,se(_r,He),He|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=f!==null?f.baseLanes:r,se(_r,He),He|=i}else f!==null?(i=f.baseLanes|r,t.memoizedState=null):i=r,se(_r,He),He|=i;return Le(e,t,a,r),t.child}function cu(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&&!Ie?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,mt(e,t,a)):(le&&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),su(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 u=C.context,d=r.contextType;typeof d=="object"&&d!==null?d=Ye(d):(d=Oe(r)?Yt:Re.current,d=xr(t,d));var g=r.getDerivedStateFromProps,h=typeof g=="function"||typeof C.getSnapshotBeforeUpdate=="function";h||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(o!==i||u!==d)&&Zl(t,C,i,d),kt=!1;var _=t.memoizedState;C.state=_,Ss(t,i,C,a),u=t.memoizedState,o!==i||_!==u||Be.current||kt?(typeof g=="function"&&(Zn(t,r,g,i),u=t.memoizedState),(o=kt||Ql(t,r,o,i,_,u,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=u),C.props=i,C.state=u,C.context=d,i=o):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{C=t.stateNode,jc(e,t),o=t.memoizedProps,d=t.type===t.elementType?o:Ze(t.type,o),C.props=d,h=t.pendingProps,_=C.context,u=r.contextType,typeof u=="object"&&u!==null?u=Ye(u):(u=Oe(r)?Yt:Re.current,u=xr(t,u));var S=r.getDerivedStateFromProps;(g=typeof S=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(o!==h||_!==u)&&Zl(t,C,i,u),kt=!1,_=t.memoizedState,C.state=_,Ss(t,i,C,a);var x=t.memoizedState;o!==h||_!==x||Be.current||kt?(typeof S=="function"&&(Zn(t,r,S,i),x=t.memoizedState),(d=kt||Ql(t,r,d,i,_,x,u)||!1)?(g||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(i,x,u),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(i,x,u)),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=u,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){cu(e,t);var C=(t.flags&128)!==0;if(!i&&!C)return a&&Ul(t,r,!1),mt(e,t,f);i=t.stateNode,Fd.current=t;var o=C&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&C?(t.child=Er(t,e.child,null,f),t.child=Er(t,null,o,f)):Le(e,t,o,f),t.memoizedState=i.state,a&&Ul(t,r,!0),t.child}function uu(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 hu(e,t,r){var i=t.pendingProps,a=ce.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),se(ce,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 zd(e,t,C,i,o,a,r);if(f){f=i.fallback,C=t.mode,a=e.child,o=a.sibling;var u={mode:"hidden",children:i.children};return!(C&1)&&t.child!==a?(i=t.child,i.childLanes=0,i.pendingProps=u,t.deletions=null):(i=Ot(a,u),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),Er(t,e.child,null,r),e=Qo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zd(e,t,r,i,a,f,C){if(r)return t.flags&256?(t.flags&=-257,i=gn(Error($(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&&Er(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($(419)),i=gn(f,i,void 0),Wi(e,t,C,i)}if(o=(C&e.childLanes)!==0,Ie||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($(421))),Wi(e,t,C,i)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=ef.bind(null,e),a._reactRetry=t,null):(e=f.treeContext,Ne=Mt(a.nextSibling),Fe=t,le=!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 du(e,t,r){var i=t.pendingProps,a=i.revealOrder,f=i.tail;if(Le(e,t,i.children,r),i=ce.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(se(ce,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($(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 Wd(e,t,r){switch(t.tag){case 3:uu(t),kr();break;case 5:Hc(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;se(gs,i._currentValue),i._currentValue=a;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(se(ce,ce.current&1),t.flags|=128,null):r&t.child.childLanes?hu(e,t,r):(se(ce,ce.current&1),e=mt(e,t,r),e!==null?e.sibling:null);se(ce,ce.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return du(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),se(ce,ce.current),i)break;return null;case 22:case 23:return t.lanes=0,au(e,t,r)}return mt(e,t,r)}var fu,no,pu,_u;fu=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(){};pu=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=he({},a,{value:void 0}),i=he({},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)}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 u=i[d];if(o=a!=null?a[d]:void 0,i.hasOwnProperty(d)&&u!==o&&(u!=null||o!=null))if(d==="style")if(o){for(C in o)!o.hasOwnProperty(C)||u&&u.hasOwnProperty(C)||(r||(r={}),r[C]="");for(C in u)u.hasOwnProperty(C)&&o[C]!==u[C]&&(r||(r={}),r[C]=u[C])}else r||(f||(f=[]),f.push(d,r)),r=u;else d==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(f=f||[]).push(d,u)):d==="children"?typeof u!="string"&&typeof u!="number"||(f=f||[]).push(d,""+u):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(ni.hasOwnProperty(d)?(u!=null&&d==="onScroll"&&ne("scroll",e),f||o===u||(f=[])):(f=f||[]).push(d,u))}r&&(f=f||[]).push("style",r);var d=f;(t.updateQueue=d)&&(t.flags|=4)}};_u=function(e,t,r,i){r!==i&&(t.flags|=4)};function Wr(e,t){if(!le)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 Ee(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 Ud(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 Ee(t),null;case 1:return Oe(t.type)&&fs(),Ee(t),null;case 3:return i=t.stateNode,br(),oe(Be),oe(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),Ee(t),null;case 5:$o(t);var a=Vt(gi.current);if(r=t.type,e!==null&&t.stateNode!=null)pu(e,t,r,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error($(166));return Ee(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":ne("cancel",i),ne("close",i);break;case"iframe":case"object":case"embed":ne("load",i);break;case"video":case"audio":for(a=0;a<Yr.length;a++)ne(Yr[a],i);break;case"source":ne("error",i);break;case"img":case"image":case"link":ne("error",i),ne("load",i);break;case"details":ne("toggle",i);break;case"input":_l(i,f),ne("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!f.multiple},ne("invalid",i);break;case"textarea":gl(i,f),ne("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"&&ne("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=Ua(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,fu(e,t,!1,!1),t.stateNode=e;e:{switch(C=Pn(r,i),r){case"dialog":ne("cancel",e),ne("close",e),a=i;break;case"iframe":case"object":case"embed":ne("load",e),a=i;break;case"video":case"audio":for(a=0;a<Yr.length;a++)ne(Yr[a],e);a=i;break;case"source":ne("error",e),a=i;break;case"img":case"image":case"link":ne("error",e),ne("load",e),a=i;break;case"details":ne("toggle",e),a=i;break;case"input":_l(e,i),a=Rn(e,i),ne("invalid",e);break;case"option":a=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},a=he({},i,{value:void 0}),ne("invalid",e);break;case"textarea":gl(e,i),a=Tn(e,i),ne("invalid",e);break;default:a=i}Mn(r,a),o=a;for(f in o)if(o.hasOwnProperty(f)){var u=o[f];f==="style"?Va(e,u):f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&$a(e,u)):f==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&oi(e,u):typeof u=="number"&&oi(e,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(ni.hasOwnProperty(f)?u!=null&&f==="onScroll"&&ne("scroll",e):u!=null&&Co(e,f,u,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 Ee(t),null;case 6:if(e&&t.stateNode!=null)_u(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error($(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 Ee(t),null;case 13:if(oe(ce),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(le&&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($(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error($(317));f[lt]=t}else kr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ee(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||ce.current&1?me===0&&(me=3):il())),t.updateQueue!==null&&(t.flags|=4),Ee(t),null);case 4:return br(),no(e,t),e===null&&fi(t.stateNode.containerInfo),Ee(t),null;case 10:return Fo(t.type._context),Ee(t),null;case 17:return Oe(t.type)&&fs(),Ee(t),null;case 19:if(oe(ce),f=t.memoizedState,f===null)return Ee(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 se(ce,ce.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&&!le)return Ee(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=ce.current,se(ce,i?r&1|2:r&1),t):(Ee(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&&(Ee(t),t.subtreeFlags&6&&(t.flags|=8192)):Ee(t),null;case 24:return null;case 25:return null}throw Error($(156,t.tag))}function $d(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 br(),oe(Be),oe(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(oe(ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($(340));kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return oe(ce),null;case 4:return br(),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,be=!1,Kd=typeof WeakSet=="function"?WeakSet:Set,Q=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 Vd(e,t){if(Un=cs,e=yc(),Io(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,u=-1,d=0,g=0,h=e,_=null;t:for(;;){for(var S;h!==r||a!==0&&h.nodeType!==3||(o=C+a),h!==f||i!==0&&h.nodeType!==3||(u=C+i),h.nodeType===3&&(C+=h.nodeValue.length),(S=h.firstChild)!==null;)_=h,h=S;for(;;){if(h===e)break t;if(_===r&&++d===a&&(o=C),_===f&&++g===i&&(u=C),(S=h.nextSibling)!==null)break;h=_,_=h.parentNode}h=S}r=o===-1||u===-1?null:{start:o,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for($n={focusedElem:e,selectionRange:r},cs=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;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,c=x.memoizedState,l=t.stateNode,s=l.getSnapshotBeforeUpdate(t.elementType===t.type?v:Ze(t.type,v),c);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($(163))}}catch(p){pe(t,t.return,p)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=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 vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(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[Ld],delete t[Dd])),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 gu(e){return e.tag===5||e.tag===3||e.tag===4}function aa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gu(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;)mu(e,t,r),r=r.sibling}function mu(e,t,r){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(Ds,r)}catch{}switch(r.tag){case 5:be||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(!be&&(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(!be&&(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?(be=(i=be)||r.memoizedState!==null,wt(e,t,r),be=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 Kd),t.forEach(function(i){var a=tf.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($(160));mu(f,C,a),Ce=null,Je=!1;var u=a.alternate;u!==null&&(u.return=null),a.return=null}catch(d){pe(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Su(t,e),t=t.sibling}function Su(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,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&f.type==="radio"&&f.name!=null&&za(a,f),Pn(o,C);var d=Pn(o,f);for(C=0;C<u.length;C+=2){var g=u[C],h=u[C+1];g==="style"?Va(a,h):g==="dangerouslySetInnerHTML"?$a(a,h):g==="children"?oi(a,h):Co(a,g,h,d)}switch(o){case"input":Ln(a,f);break;case"textarea":Wa(a,f);break;case"select":var _=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!f.multiple;var S=f.value;S!=null?vr(a,!!f.multiple,S,!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($(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(g=r!==null&&r.memoizedState!==null,e.mode&1?(be=(d=be)||g,Qe(t,e),be=d):Qe(t,e),nt(e),i&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!g&&e.mode&1)for(Q=e,g=e.child;g!==null;){for(h=Q=g;Q!==null;){switch(_=Q,S=_.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}}S!==null?(S.return=_,Q=S):ha(h)}g=g.sibling}e:for(g=null,h=e;;){if(h.tag===5){if(g===null){g=h;try{a=h.stateNode,d?(f=a.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none"):(o=h.stateNode,u=h.memoizedProps.style,C=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=Ka("display",C))}catch(v){pe(e,e.return,v)}}}else if(h.tag===6){if(g===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;g===h&&(g=null),h=h.return}g===h&&(g=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(gu(r)){var i=r;break e}r=r.return}throw Error($(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($(161))}}catch(u){pe(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gd(e,t,r){Q=e,yu(e)}function yu(e,t,r){for(var i=(e.mode&1)!==0;Q!==null;){var a=Q,f=a.child;if(a.tag===22&&i){var C=a.memoizedState!==null||Ui;if(!C){var o=a.alternate,u=o!==null&&o.memoizedState!==null||be;o=Ui;var d=be;if(Ui=C,(be=u)&&!d)for(Q=a;Q!==null;)C=Q,u=C.child,C.tag===22&&C.memoizedState!==null?da(a):u!==null?(u.return=C,Q=u):da(a);for(;f!==null;)Q=f,yu(f),f=f.sibling;Q=a,Ui=o,be=d}ua(e)}else a.subtreeFlags&8772&&f!==null?(f.return=a,Q=f):ua(e)}}function ua(e){for(;Q!==null;){var t=Q;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:be||js(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!be)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 u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.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 g=d.memoizedState;if(g!==null){var h=g.dehydrated;h!==null&&ui(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error($(163))}be||t.flags&512&&lo(t)}catch(_){pe(t,t.return,_)}}if(t===e){Q=null;break}if(r=t.sibling,r!==null){r.return=t.return,Q=r;break}Q=t.return}}function ha(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Q=r;break}Q=t.return}}function da(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{js(4,t)}catch(u){pe(t,r,u)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var a=t.return;try{i.componentDidMount()}catch(u){pe(t,a,u)}}var f=t.return;try{lo(t)}catch(u){pe(t,f,u)}break;case 5:var C=t.return;try{lo(t)}catch(u){pe(t,C,u)}}}catch(u){pe(t,t.return,u)}if(t===e){Q=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Q=o;break}Q=t.return}}var qd=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,Pe=null,el=0,Lr=1/0,ut=null,ks=!1,uo=null,It=null,$i=!1,Lt=null,Es=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:Ad.transition!==null?(rs===0&&(rs=sc()),rs):(e=ie,e!==0||(e=window.event,e=e===void 0?16:hc(e.type)),e):1}function rt(e,t,r,i){if(50<si)throw si=0,ho=null,Error($(185));xi(e,r,i),(!(re&2)||e!==ye)&&(e===ye&&(!(re&2)&&(Hs|=r),me===4&&bt(e,we)),je(e,i),r===1&&re===0&&!(t.mode&1)&&(Lr=_e()+500,Is&&zt()))}function je(e,t){var r=e.callbackNode;Ah(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?Td(fa.bind(null,e)):Tc(fa.bind(null,e)),bd(function(){!(re&6)&&zt()}),r=null;else{switch(nc(i)){case 1:r=bo;break;case 4:r=rc;break;case 16:r=ls;break;case 536870912:r=ic;break;default:r=ls}r=Lu(r,Cu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Cu(e,t){if(ts=-1,rs=0,re&6)throw Error($(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=bs(e,i);else{t=i;var a=re;re|=2;var f=xu();(ye!==e||we!==t)&&(ut=null,Lr=_e()+500,Gt(e,t));do try{Qd();break}catch(o){wu(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),bt(e,i),je(e,_e()),r;if(t===6)bt(e,i);else{if(a=e.current.alternate,!(i&30)&&!Yd(a)&&(t=bs(e,i),t===2&&(f=Hn(e),f!==0&&(i=f,t=fo(e,f))),t===1))throw r=Ci,Gt(e,0),bt(e,i),je(e,_e()),r;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error($(345));case 2:Ut(e,Pe,ut);break;case 3:if(bt(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,Pe,ut),t);break}Ut(e,Pe,ut);break;case 4:if(bt(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*qd(i/1960))-i,10<i){e.timeoutHandle=Vn(Ut.bind(null,e,Pe,ut),i);break}Ut(e,Pe,ut);break;case 5:Ut(e,Pe,ut);break;default:throw Error($(329))}}}return je(e,_e()),e.callbackNode===r?Cu.bind(null,e):null}function fo(e,t){var r=ii;return e.current.memoizedState.isDehydrated&&(Gt(e,t).flags|=256),e=bs(e,t),e!==2&&(t=Pe,Pe=r,t!==null&&po(t)),e}function po(e){Pe===null?Pe=e:Pe.push.apply(Pe,e)}function Yd(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 bt(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($(327));Cr();var t=as(e,0);if(!(t&1))return je(e,_e()),null;var r=bs(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),bt(e,t),je(e,_e()),r;if(r===6)throw Error($(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ut(e,Pe,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,Is&&zt())}}function Jt(e){Lt!==null&&Lt.tag===0&&!(re&6)&&Cr();var t=re;re|=1;var r=qe.transition,i=ie;try{if(qe.transition=null,ie=1,e)return e()}finally{ie=i,qe.transition=r,re=t,!(re&6)&&zt()}}function rl(){He=_r.current,oe(_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:br(),oe(Be),oe(Re),Ko();break;case 5:$o(i);break;case 4:br();break;case 13:oe(ce);break;case 19:oe(ce);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,Pe=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 wu(e,t){do{var r=ve;try{if(No(),Zi.current=ws,Cs){for(var i=ue.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Cs=!1}if(Qt=0,Se=ge=ue=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,u=t;if(t=we,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var d=u,g=o,h=g.tag;if(!(g.mode&1)&&(h===0||h===11||h===15)){var _=g.alternate;_?(g.updateQueue=_.updateQueue,g.memoizedState=_.memoizedState,g.lanes=_.lanes):(g.updateQueue=null,g.memoizedState=null)}var S=ea(C);if(S!==null){S.flags&=-257,ta(S,C,o,f,t),S.mode&1&&Jl(f,d,t),t=S,u=d;var x=t.updateQueue;if(x===null){var v=new Set;v.add(u),t.updateQueue=v}else x.add(u);break e}else{if(!(t&1)){Jl(f,d,t),il();break e}u=Error($(426))}}else if(le&&o.mode&1){var c=ea(C);if(c!==null){!(c.flags&65536)&&(c.flags|=256),ta(c,C,o,f,t),jo(Rr(u,o));break e}}f=u=Rr(u,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=nu(f,u,t);Gl(f,l);break e;case 1:o=u;var s=f.type,n=f.stateNode;if(!(f.flags&128)&&(typeof s.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(It===null||!It.has(n)))){f.flags|=65536,t&=-t,f.lanes|=t;var p=ou(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 xu(){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)||bt(ye,we)}function bs(e,t){var r=re;re|=2;var i=xu();(ye!==e||we!==t)&&(ut=null,Gt(e,t));do try{Xd();break}catch(a){wu(e,a)}while(!0);if(No(),re=r,xs.current=i,ve!==null)throw Error($(261));return ye=null,we=0,me}function Xd(){for(;ve!==null;)ku(ve)}function Qd(){for(;ve!==null&&!wh();)ku(ve)}function ku(e){var t=Ru(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=$d(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=Ud(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=ie,a=qe.transition;try{qe.transition=null,ie=1,Zd(e,t,r,i)}finally{qe.transition=a,ie=i}return null}function Zd(e,t,r,i){do Cr();while(Lt!==null);if(re&6)throw Error($(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($(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,Lu(ls,function(){return Cr(),null})),f=(r.flags&15990)!==0,r.subtreeFlags&15990||f){f=qe.transition,qe.transition=null;var C=ie;ie=1;var o=re;re|=4,Zo.current=null,Vd(e,r),Su(r,e),md($n),cs=!!Un,$n=Un=null,e.current=r,Gd(r),xh(),re=o,ie=C,qe.transition=f}else e.current=r;if($i&&($i=!1,Lt=e,Es=a),f=e.pendingLanes,f===0&&(It=null),bh(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 Es&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=nc(Es),t=qe.transition,r=ie;try{if(qe.transition=null,ie=16>e?16:e,Lt===null)var i=!1;else{if(e=Lt,Lt=null,Es=0,re&6)throw Error($(331));var a=re;for(re|=4,Q=e.current;Q!==null;){var f=Q,C=f.child;if(Q.flags&16){var o=f.deletions;if(o!==null){for(var u=0;u<o.length;u++){var d=o[u];for(Q=d;Q!==null;){var g=Q;switch(g.tag){case 0:case 11:case 15:ri(8,g,f)}var h=g.child;if(h!==null)h.return=g,Q=h;else for(;Q!==null;){g=Q;var _=g.sibling,S=g.return;if(vu(g),g===d){Q=null;break}if(_!==null){_.return=S,Q=_;break}Q=S}}}var x=f.alternate;if(x!==null){var v=x.child;if(v!==null){x.child=null;do{var c=v.sibling;v.sibling=null,v=c}while(v!==null)}}Q=f}}if(f.subtreeFlags&2064&&C!==null)C.return=f,Q=C;else e:for(;Q!==null;){if(f=Q,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,Q=l;break e}Q=f.return}}var s=e.current;for(Q=s;Q!==null;){C=Q;var n=C.child;if(C.subtreeFlags&2064&&n!==null)n.return=C,Q=n;else e:for(C=s;Q!==null;){if(o=Q,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){Q=null;break e}var p=o.sibling;if(p!==null){p.return=o.return,Q=p;break e}Q=o.return}}if(re=a,zt(),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Ds,e)}catch{}i=!0}return i}finally{ie=r,qe.transition=t}}return!1}function pa(e,t,r){t=Rr(r,t),t=nu(e,t,1),e=Pt(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"&&(It===null||!It.has(i))){e=Rr(r,e),e=ou(t,e,1),t=Pt(t,e,1),e=De(),t!==null&&(xi(t,1,e),je(t,e));break}}t=t.return}}function Jd(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 bu(e,t){t===0&&(e.mode&1?(t=Ii,Ii<<=1,!(Ii&130023424)&&(Ii=4194304)):t=1);var r=De();e=gt(e,t),e!==null&&(xi(e,t,r),je(e,r))}function ef(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),bu(e,r)}function tf(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($(314))}i!==null&&i.delete(t),bu(e,r)}var Ru;Ru=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Be.current)Ie=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ie=!1,Wd(e,t,r);Ie=!!(e.flags&131072)}else Ie=!1,le&&t.flags&1048576&&Ac(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,le&&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=sf(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($(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(uu(t),e===null)throw Error($(387));i=t.pendingProps,f=t.memoizedState,a=f.element,jc(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($(423)),t),t=na(e,t,i,r,a);break e}else if(i!==a){a=Rr(Error($(424)),t),t=na(e,t,i,r,a);break e}else for(Ne=Mt(t.stateNode.containerInfo.firstChild),Fe=t,le=!0,et=null,r=Bc(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 Hc(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),cu(e,t),Le(e,t,C,r),t.child;case 6:return e===null&&Xn(t),null;case 13:return hu(e,t,r);case 4:return Uo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Er(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,se(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 u=o.firstContext;u!==null;){if(u.context===i){if(f.tag===1){u=pt(-1,r&-r),u.tag=2;var d=f.updateQueue;if(d!==null){d=d.shared;var g=d.pending;g===null?u.next=u:(u.next=g.next,g.next=u),d.pending=u}}f.lanes|=r,u=f.alternate,u!==null&&(u.lanes|=r),Qn(f.return,r,t),o.lanes|=r;break}u=u.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($(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 lu(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),su(t,i,a),Jn(t,i,a,r),ro(null,t,i,!0,e,r);case 19:return du(e,t,r);case 22:return au(e,t,r)}throw Error($(156,t.tag))};function Lu(e,t){return tc(e,t)}function rf(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 rf(e,t,r,i)}function sl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sf(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 En:return e=Ge(19,r,t,a),e.elementType=En,e.lanes=f,e;case Ha:return Ns(r,a,f,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Oa:C=10;break e;case ja: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($(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=Ha,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 nf(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,u){return e=new nf(e,t,r,o,u),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 of(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 Du(e){if(!e)return Ht;e=e._reactInternals;e:{if(tr(e)!==e||e.tag!==1)throw Error($(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($(171))}if(e.tag===1){var r=e.type;if(Oe(r))return Dc(e,r,t)}return t}function Tu(e,t,r,i,a,f,C,o,u){return e=nl(r,i,!0,e,a,f,C,o,u),e.context=Du(null),r=e.current,i=De(),a=Bt(r),f=pt(i,a),f.callback=t??null,Pt(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=Du(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=Pt(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 lf(){return null}var Au=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($(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=ac();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Et.length&&t!==0&&t<Et[r].priority;r++);Et.splice(r,0,e),r===0&&uc(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 af(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=Tu(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(u);o.call(d)}}var u=nl(e,0,!1,null,null,!1,!1,"",va);return e._reactRootContainer=u,e[vt]=u.current,fi(e.nodeType===8?e.parentNode:e),Jt(function(){Fs(t,u,r,i)}),u}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 u=Rs(C);o.call(u)}}Fs(t,C,e,a)}else C=af(r,t,e,a,i);return Rs(C)}oc=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)}};lc=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)}};ac=function(){return ie};cc=function(e,t){var r=ie;try{return ie=e,t()}finally{ie=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=Ps(i);if(!a)throw Error($(90));Fa(i),Ln(i,a)}}}break;case"textarea":Wa(e,r);break;case"select":t=r.value,t!=null&&vr(e,!!r.multiple,t,!1)}};Ya=tl;Xa=Jt;var cf={usingClientEntryPoint:!1,Events:[Ei,cr,Ps,Ga,qa,tl]},Ur={findFiberByHostInstance:$t,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},uf={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=Ja(e),e===null?null:e.stateNode},findFiberByHostInstance:Ur.findFiberByHostInstance||lf,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(uf),at=Ki}catch{}}We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cf;We.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!al(t))throw Error($(200));return of(e,t,null,r)};We.createRoot=function(e,t){if(!al(e))throw Error($(299));var r=!1,i="",a=Au;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($(188)):(e=Object.keys(e).join(","),Error($(268,e)));return e=Ja(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($(200));return Us(null,e,t,!0,r)};We.hydrateRoot=function(e,t,r){if(!al(e))throw Error($(405));var i=r!=null&&r.hydratedSources||null,a=!1,f="",C=Au;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),t=Tu(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($(200));return Us(null,e,t,!1,r)};We.unmountComponentAtNode=function(e){if(!Ws(e))throw Error($(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($(200));if(e==null||e._reactInternals===void 0)throw Error($(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 hf=Ma.exports,Pu,ga=hf;Pu=ga.createRoot,ga.hydrateRoot;const df=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,ff=3e3,pf=5,_f=5e3;function vf(){const[e,t]=V.useState(!1),[r,i]=V.useState([]),[a,f]=V.useState([]),[C,o]=V.useState([]),[u,d]=V.useState(null),[g,h]=V.useState([]),_=V.useRef(null),S=V.useRef(new Map),x=V.useRef(null),v=V.useCallback((D,M="info")=>{const j={id:Date.now()+Math.random(),msg:D,type:M};h(U=>[j,...U].slice(0,pf)),setTimeout(()=>{h(U=>U.filter(Z=>Z.id!==j.id))},_f)},[]),c=V.useCallback((D,M)=>{const j=_.current;j&&j.readyState===WebSocket.OPEN&&j.send(JSON.stringify({type:D,payload:M,ts:Date.now()}))},[]),l=V.useCallback(()=>{if(_.current&&_.current.readyState===WebSocket.OPEN)return;const D=new WebSocket(df);_.current=D,D.onopen=()=>{t(!0),x.current&&(clearInterval(x.current),x.current=null);for(const[M]of S.current)c("SUBSCRIBE_TERMINAL",{agentId:M})},D.onmessage=M=>{var U,Z,q,O,R;let j;try{j=JSON.parse(M.data)}catch{return}switch(j.type){case"INIT":i(j.payload.tasks||[]),f(j.payload.agents||[]),o(j.payload.repos||[]),j.payload.settings&&d(j.payload.settings);break;case"TASKS_UPDATED":i(j.payload.tasks||[]);break;case"TASK_ADDED":i(W=>[...W,j.payload.task]);break;case"AGENTS_UPDATED":f(j.payload.agents||[]);break;case"AGENT_UPDATED":f(W=>W.some(Y=>Y.id===j.payload.agent.id)?W.map(Y=>Y.id===j.payload.agent.id?j.payload.agent:Y):[...W,j.payload.agent]);break;case"AGENT_REMOVED":f(W=>W.filter(F=>F.id!==j.payload.agentId));break;case"SETTINGS_UPDATED":d(j.payload);break;case"REPOS_UPDATED":o(j.payload.repos||[]);break;case"TERMINAL_DATA":{const W=S.current.get(j.payload.agentId);W&&W(j.payload.data);break}case"PLAN_READY":v(`Plan ready for ${j.payload.taskId} — approval needed`,"warning");break;case"PLAN_PARTIAL":i(W=>W.map(F=>F.id===j.payload.taskId?{...F,plan:j.payload.plan}:F));break;case"PR_CREATED":v(`PR created for ${j.payload.taskId}`,"success");break;case"TASK_BLOCKED":v(`${j.payload.taskId} blocked: ${j.payload.reason}`,"error");break;case"REVIEW_FAILED":v(`Review failed for ${j.payload.taskId} — returning to implementor`,"warning");break;case"REVIEW_PASSED":v(`Review passed for ${j.payload.taskId}`,"success");break;case"TASK_ABORTED":v(`Task ${j.payload.taskId} aborted`,"info");break;case"TASK_RESET":v(`Task ${j.payload.taskId} reset to backlog`,"info");break;case"TASK_RETRIED":v(`Task ${j.payload.taskId} retrying from ${j.payload.retryStatus}`,"info");break;case"TASK_DELETED":v(`Task ${j.payload.taskId} deleted from Done`,"info");break;case"BRIDGE_OPENED":v(`${j.payload.agentName} opened in Terminal`,"info");break;case"BRIDGE_RETURNED":v(`${j.payload.agentName} returned to Ban Kan`,"info");break;case"BRIDGE_ERROR":v(((U=j.payload)==null?void 0:U.message)||"Terminal bridge failed","error");break;case"TASK_WORKSPACE_OPENED":v(((Z=j.payload)==null?void 0:Z.message)||`Opened workspace for ${(q=j.payload)==null?void 0:q.taskId}`,"success");break;case"TASK_WORKSPACE_ERROR":v(((O=j.payload)==null?void 0:O.message)||"Failed to open task workspace","error");break;case"SETTINGS_ERROR":v((((R=j.payload)==null?void 0:R.errors)||[]).join(", ")||"Settings update failed","error");break}},D.onclose=()=>{t(!1),_.current=null,x.current||(x.current=setInterval(l,ff))},D.onerror=()=>{D.close()}},[v,c]);V.useEffect(()=>(l(),()=>{x.current&&clearInterval(x.current),_.current&&_.current.close()}),[l]);const s=V.useCallback((D,M,j,U)=>{c("ADD_TASK",{title:D,priority:M,description:j,repoPath:U})},[c]),n=V.useCallback(D=>{c("APPROVE_PLAN",{taskId:D})},[c]),p=V.useCallback((D,M)=>{c("REJECT_PLAN",{taskId:D,feedback:M})},[c]),w=V.useCallback((D,M)=>{c("INJECT_MESSAGE",{agentId:D,message:M})},[c]),y=V.useCallback((D,M)=>{c("INJECT_RAW",{agentId:D,data:M})},[c]),k=V.useCallback(D=>{c("PAUSE_AGENT",{agentId:D})},[c]),m=V.useCallback(D=>{c("RESUME_AGENT",{agentId:D})},[c]),E=V.useCallback(D=>{c("PAUSE_TASK",{taskId:D})},[c]),A=V.useCallback(D=>{c("RESUME_TASK",{taskId:D})},[c]),I=V.useCallback((D,M)=>{c("EDIT_TASK",{taskId:D,updates:M})},[c]),B=V.useCallback(D=>{c("ABORT_TASK",{taskId:D})},[c]),P=V.useCallback(D=>{c("RESET_TASK",{taskId:D})},[c]),N=V.useCallback(D=>{c("RETRY_TASK",{taskId:D})},[c]),z=V.useCallback(D=>{c("DELETE_TASK",{taskId:D})},[c]),K=V.useCallback(D=>{c("OPEN_TASK_WORKSPACE",{taskId:D})},[c]),G=V.useCallback(D=>{c("UPDATE_SETTINGS",D)},[c]),H=V.useCallback(D=>{c("OPEN_AGENT_TERMINAL",{agentId:D})},[c]),b=V.useCallback(D=>{c("RETURN_AGENT_TERMINAL",{agentId:D})},[c]),T=V.useCallback((D,M)=>(S.current.set(D,M),c("SUBSCRIBE_TERMINAL",{agentId:D}),()=>{S.current.delete(D),c("UNSUBSCRIBE_TERMINAL",{agentId:D})}),[c]);return{connected:e,tasks:r,agents:a,repos:C,settings:u,notifications:g,addTask:s,approvePlan:n,rejectPlan:p,pauseTask:E,resumeTask:A,editTask:I,abortTask:B,resetTask:P,retryTask:N,deleteTask:z,openTaskWorkspace:K,injectMessage:w,sendRaw:y,pauseAgent:k,resumeAgent:m,updateSettings:G,subscribeTerminal:T,openAgentTerminal:H,returnAgentTerminal:b}}const gf={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 mf(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 Sf(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 yf({task:e,columnColor:t,agents:r,isAnimating:i,onApprove:a,onReject:f,onAgentClick:C,onTaskClick:o}){const[u,d]=V.useState(!1),[g,h]=V.useState(""),[_,S]=V.useState(!1),x=e.status==="blocked",v=r.find(s=>s.id===e.assignedTo),c=x?"var(--red)":t,l=x?"rgba(255,77,77,0.05)":"transparent";return L.jsxs("div",{onClick:()=>o&&o(e),onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),style:{cursor:"pointer",background:_?"var(--bg2)":`linear-gradient(${l}, ${l}), var(--bg1)`,borderRadius:6,borderLeft:`3px solid ${c}`,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:gf[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:mf(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:Sf(e.blockedReason)})]}),u&&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:g,onChange:s=>h(s.target.value),onKeyDown:s=>{s.key==="Enter"&&g.trim()&&(f(e.id,g.trim()),d(!1),h("")),s.key==="Escape"&&(d(!1),h(""))},style:{width:"100%",fontSize:11,padding:"4px 8px"}})})]})}function Cf({column:e,tasks:t,agents:r,animatingTasks:i,onApprove:a,onReject:f,onAgentClick:C,onAddTask:o,onTaskClick:u}){const d=e.agentPrefix?r.filter(g=>g.id.startsWith(e.agentPrefix+"-")||g.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:d.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})]}),d.length>0&&L.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:d.map(g=>{const h=g.status==="active",_=g.status==="blocked",S=g.status==="draining",x=!h&&!_&&!S;return L.jsxs("div",{onClick:()=>C(g.id),title:`${g.name} — ${g.status}`,style:{width:22,height:22,borderRadius:"50%",background:x?"transparent":g.color||e.color,border:x?`1px solid ${g.color||e.color}66`:S?`2px dashed ${g.color||e.color}`:_?"2px solid var(--red)":"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,cursor:"pointer",position:"relative",opacity:x?.4:1,transition:"opacity 0.15s"},children:[g.icon||g.id.charAt(0).toUpperCase(),h&&L.jsx("span",{style:{position:"absolute",bottom:-1,right:-1,width:5,height:5,borderRadius:"50%",background:"var(--green)",border:"1px solid var(--bg)"}})]},g.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"?L.jsx("span",{onClick:o,style:{cursor:"pointer",textDecoration:"underline",textUnderlineOffset:3},children:"No tasks — click + ADD TASK"}):e.id==="done"?"No completed tasks":"All clear"}),t.map(g=>L.jsx(yf,{task:g,columnColor:e.color,agents:r,isAnimating:i.has(g.id),onApprove:a,onReject:f,onAgentClick:C,onTaskClick:u},g.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 wf({tasks:e,agents:t,onApprove:r,onReject:i,onAgentClick:a,onAddTask:f,onTaskClick:C}){const o=V.useRef(new Map),[u,d]=V.useState(new Set);V.useEffect(()=>{const h=o.current,_=new Set;if(e.forEach(x=>{const v=h.get(x.id);v&&v!==x.status&&_.add(x.id)}),_.size>0){d(_);const x=setTimeout(()=>d(new Set),350);return()=>clearTimeout(x)}const S=new Map;e.forEach(x=>S.set(x.id,x.status)),o.current=S},[e]),V.useEffect(()=>{const h=new Map;e.forEach(_=>h.set(_.id,_.status)),o.current=h},[e]);const g=V.useMemo(()=>{const h={};ir.forEach(_=>{h[_.id]=[]}),e.forEach(_=>{if(_.status==="blocked"){const x=ir.find(v=>v.id===_.lastActiveStage);if(x){h[x.id].push(_);return}if(_.assignedTo){const v=ir.find(c=>c.agentPrefix&&_.assignedTo.startsWith(c.agentPrefix));if(v){h[v.id].push(_);return}}h.backlog.push(_);return}const S=ir.find(x=>x.statuses.includes(_.status));S?h[S.id].push(_):h.backlog.push(_)});for(const _ of ir)h[_.id].sort((S,x)=>S.status==="blocked"&&x.status!=="blocked"?-1:S.status!=="blocked"&&x.status==="blocked"?1:new Date(x.updatedAt).getTime()-new Date(S.updatedAt).getTime());return h},[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(h=>L.jsx(Cf,{column:h,tasks:g[h.id],agents:t,animatingTasks:u,onApprove:r,onReject:i,onAgentClick:a,onAddTask:f,onTaskClick:C},h.id))})}var Iu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var r={4567:function(C,o,u){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 E=s.length-1;E>=0;E--)(y=s[E])&&(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},g=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=u(9042),_=u(9924),S=u(844),x=u(4725),v=u(2585),c=u(3656);let l=o.AccessibilityManager=class extends S.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
+ `))),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,c.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,S.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=[],E=(k==null?void 0:k.translateToString(!0,void 0,void 0,m))||"",A=(p.ydisp+y+1).toString(),I=this._rowElements[y];I&&(E.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=E,this._rowColumns.set(I,m)),I.setAttribute("aria-posinset",A),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 E;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:((E=w.textContent)==null?void 0:E.length)??0}),!this._rowContainer.contains(p.node))return;const y=({node:A,offset:I})=>{const B=A instanceof Text?A.parentNode:A;let P=parseInt(B==null?void 0:B.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const N=this._rowColumns.get(B);if(!N)return console.warn("columns is null. Race condition?"),null;let z=I<N.length?N[I]:N.slice(-1)[0]+1;return z>=this._terminal.cols&&(++P,z=0),{row:P,column:z}},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([g(1,v.IInstantiationService),g(2,x.ICoreBrowserService),g(3,x.IRenderService)],l)},3614:(C,o)=>{function u(_){return _.replace(/\r?\n/g,"\r")}function d(_,S){return S?"\x1B[200~"+_+"\x1B[201~":_}function g(_,S,x,v){_=d(_=u(_),x.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(_,!0),S.value=""}function h(_,S,x){const v=x.getBoundingClientRect(),c=_.clientX-v.left-10,l=_.clientY-v.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${c}px`,S.style.top=`${l}px`,S.style.zIndex="1000",S.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=u,o.bracketTextForPaste=d,o.copyHandler=function(_,S){_.clipboardData&&_.clipboardData.setData("text/plain",S.selectionText),_.preventDefault()},o.handlePasteEvent=function(_,S,x,v){_.stopPropagation(),_.clipboardData&&g(_.clipboardData.getData("text/plain"),S,x,v)},o.paste=g,o.moveTextAreaUnderMouseCursor=h,o.rightClickHandler=function(_,S,x,v,c){h(_,S,x),c&&v.rightClickSelect(_),S.value=v.selectionText,S.select()}},7239:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const d=u(1505);o.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(g,h,_){this._css.set(g,h,_)}getCss(g,h){return this._css.get(g,h)}setColor(g,h,_){this._color.set(g,h,_)}getColor(g,h){return this._color.get(g,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(u,d,g,h){u.addEventListener(d,g,h);let _=!1;return{dispose:()=>{_||(_=!0,u.removeEventListener(d,g,h))}}}},3551:function(C,o,u){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},g=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=u(3656),_=u(8460),S=u(844),x=u(2585),v=u(4725);let c=o.Linkifier=class extends S.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,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.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 A,I;if(this._isMouseOut)return;const E=m==null?void 0:m.map(B=>({link:B}));(A=this._activeProviderReplies)==null||A.set(y,E),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,E=k.link.range.end.y>l?this._bufferService.cols:k.link.range.end.x;for(let A=m;A<=E;A++){if(n.has(A)){w.splice(y--,1);break}n.add(A)}}}}_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(E=>this._linkAtPosition(E.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,S.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=c=d([g(1,v.IMouseService),g(2,v.IRenderService),g(3,x.IBufferService),g(4,v.ILinkProviderService)],c)},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,u){var d=this&&this.__decorate||function(v,c,l,s){var n,p=arguments.length,w=p<3?c:s===null?s=Object.getOwnPropertyDescriptor(c,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,c,l,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(c,l,w):n(c,l))||w);return p>3&&w&&Object.defineProperty(c,l,w),w},g=this&&this.__param||function(v,c){return function(l,s){c(l,s,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const h=u(511),_=u(2585);let S=o.OscLinkProvider=class{constructor(v,c,l){this._bufferService=v,this._optionsService=c,this._oscLinkService=l}provideLinks(v,c){var E;const l=this._bufferService.buffer.lines.get(v-1);if(!l)return void c(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 A=0;A<w;A++)if(k!==-1||l.hasContent(A)){if(l.loadCell(A,p),p.hasExtendedAttrs()&&p.extended.urlId){if(k===-1){k=A,y=p.extended.urlId;continue}m=p.extended.urlId!==y}else k!==-1&&(m=!0);if(m||k!==-1&&A===w-1){const I=(E=this._oscLinkService.getLinkData(y))==null?void 0:E.uri;if(I){const B={start:{x:k+1,y:v},end:{x:A+(m||A!==w-1?0:1),y:v}};let P=!1;if(!(n!=null&&n.allowNonHttpProtocols))try{const N=new URL(I);["http:","https:"].includes(N.protocol)||(P=!0)}catch{P=!0}P||s.push({text:I,range:B,activate:(N,z)=>n?n.activate(N,z,B):x(0,z),hover:(N,z)=>{var K;return(K=n==null?void 0:n.hover)==null?void 0:K.call(n,N,z,B)},leave:(N,z)=>{var K;return(K=n==null?void 0:n.leave)==null?void 0:K.call(n,N,z,B)}})}m=!1,p.hasExtendedAttrs()&&p.extended.urlId?(k=A,y=p.extended.urlId):(k=-1,y=-1)}}c(s)}};function x(v,c){if(confirm(`Do you want to navigate to ${c}?
43
+
44
+ WARNING: This link could potentially be dangerous`)){const l=window.open();if(l){try{l.opener=null}catch{}l.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=S=d([g(0,_.IBufferService),g(1,_.IOptionsService),g(2,_.IOscLinkService)],S)},6193:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(u,d,g){this._rowCount=g,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,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 u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const d=u(3614),g=u(3656),h=u(3551),_=u(9042),S=u(3730),x=u(1680),v=u(3107),c=u(5744),l=u(2950),s=u(1296),n=u(428),p=u(4269),w=u(5114),y=u(8934),k=u(3230),m=u(9312),E=u(4725),A=u(6731),I=u(8055),B=u(8969),P=u(8460),N=u(844),z=u(6114),K=u(8437),G=u(2584),H=u(7399),b=u(5941),T=u(9074),D=u(2585),M=u(5435),j=u(4567),U=u(779);class Z extends B.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=z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new N.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(T.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(U.LinkProviderService),this._instantiationService.setService(E.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((R,W)=>this.refresh(R,W))),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,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.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,W;this._customKeyEventHandler=void 0,(W=(R=this.element)==null?void 0:R.parentNode)==null||W.removeChild(this.element)}))}_handleColorEvent(O){if(this._themeService)for(const R of O){let W,F="";switch(R.index){case 256:W="foreground",F="10";break;case 257:W="background",F="11";break;case 258:W="cursor",F="12";break;default:W="ansi",F="4;"+R.index}switch(R.type){case 0:const Y=I.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[R.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${G.C0.ESC}]${F};${(0,b.toRgbString)(Y)}${G.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors(X=>X.ansi[R.index]=I.channels.toColor(...R.color));else{const X=W;this._themeService.modifyColors(te=>te[X]=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(j.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(O){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.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(G.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 W=Math.min(this.buffer.x,this.cols-1),F=this._renderService.dimensions.css.cell.height,Y=R.getWidth(W),X=this._renderService.dimensions.css.cell.width*Y,te=this.buffer.y*this._renderService.dimensions.css.cell.height,de=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=de+"px",this.textarea.style.top=te+"px",this.textarea.style.width=X+"px",this.textarea.style.height=F+"px",this.textarea.style.lineHeight=F+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.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,g.addDisposableDomListener)(this.textarea,"paste",O)),this.register((0,g.addDisposableDomListener)(this.element,"paste",O)),z.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",R=>{R.button===2&&(0,d.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",R=>{(0,d.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),z.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",R=>{R.button===1&&(0,d.moveTextAreaUnderMouseCursor)(R,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",O=>this._keyUp(O),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",O=>this._keyDown(O),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",O=>this._keyPress(O),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",O=>this._compositionHelper.compositionupdate(O))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,g.addDisposableDomListener)(this.textarea,"input",O=>this._inputEvent(O),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(O){var W;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"),((W=this.element)==null?void 0:W.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,g.addDisposableDomListener)(this.screenElement,"mousemove",F=>this.updateCursorStyle(F))),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),z.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(E.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",F=>this._handleTextAreaFocus(F))),this.register((0,g.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(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(A.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(F=>this._onRender.fire(F))),this.onResize(F=>this._renderService.resize(F.cols,F.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(E.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(F=>this.scrollLines(F.amount,F.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(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(F=>this.scrollLines(F.amount,F.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(F=>this._renderService.handleSelectionChanged(F.start,F.end,F.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(F=>{this.textarea.value=F,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(F=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",F=>this._selectionService.handleMouseDown(F))),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(j.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",F=>this._handleScreenReaderModeOptionChange(F))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",F=>{!this._overviewRulerRenderer&&F&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.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 W(X){const te=O._mouseService.getMouseReportCoords(X,O.screenElement);if(!te)return!1;let de,fe;switch(X.overrideType||X.type){case"mousemove":fe=32,X.buttons===void 0?(de=3,X.button!==void 0&&(de=X.button<3?X.button:3)):de=1&X.buttons?0:4&X.buttons?1:2&X.buttons?2:3;break;case"mouseup":fe=0,de=X.button<3?X.button:3;break;case"mousedown":fe=1,de=X.button<3?X.button:3;break;case"wheel":if(O._customWheelEventHandler&&O._customWheelEventHandler(X)===!1||O.viewport.getLinesScrolled(X)===0)return!1;fe=X.deltaY<0?0:1,de=4;break;default:return!1}return!(fe===void 0||de===void 0||de>4)&&O.coreMouseService.triggerMouseEvent({col:te.col,row:te.row,x:te.x,y:te.y,button:de,action:fe,ctrl:X.ctrlKey,alt:X.altKey,shift:X.shiftKey})}const F={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Y={mouseup:X=>(W(X),X.buttons||(this._document.removeEventListener("mouseup",F.mouseup),F.mousedrag&&this._document.removeEventListener("mousemove",F.mousedrag)),this.cancel(X)),wheel:X=>(W(X),this.cancel(X,!0)),mousedrag:X=>{X.buttons&&W(X)},mousemove:X=>{X.buttons||W(X)}};this.register(this.coreMouseService.onProtocolChange(X=>{X?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(X)),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&X?F.mousemove||(R.addEventListener("mousemove",Y.mousemove),F.mousemove=Y.mousemove):(R.removeEventListener("mousemove",F.mousemove),F.mousemove=null),16&X?F.wheel||(R.addEventListener("wheel",Y.wheel,{passive:!1}),F.wheel=Y.wheel):(R.removeEventListener("wheel",F.wheel),F.wheel=null),2&X?F.mouseup||(F.mouseup=Y.mouseup):(this._document.removeEventListener("mouseup",F.mouseup),F.mouseup=null),4&X?F.mousedrag||(F.mousedrag=Y.mousedrag):(this._document.removeEventListener("mousemove",F.mousedrag),F.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(R,"mousedown",X=>{if(X.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(X))return W(X),F.mouseup&&this._document.addEventListener("mouseup",F.mouseup),F.mousedrag&&this._document.addEventListener("mousemove",F.mousedrag),this.cancel(X)})),this.register((0,g.addDisposableDomListener)(R,"wheel",X=>{if(!F.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(X)===!1)return!1;if(!this.buffer.hasScrollback){const te=this.viewport.getLinesScrolled(X);if(te===0)return;const de=G.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(X.deltaY<0?"A":"B");let fe="";for(let Me=0;Me<Math.abs(te);Me++)fe+=de;return this.coreService.triggerDataEvent(fe,!0),this.cancel(X,!0)}return this.viewport.handleWheel(X)?this.cancel(X):void 0}},{passive:!1})),this.register((0,g.addDisposableDomListener)(R,"touchstart",X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(X),this.cancel(X)},{passive:!0})),this.register((0,g.addDisposableDomListener)(R,"touchmove",X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(X)?void 0:this.cancel(X)},{passive:!1}))}refresh(O,R){var W;(W=this._renderService)==null||W.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,W=0){var F;W===1?(super.scrollLines(O,R,W),this.refresh(0,this.rows-1)):(F=this.viewport)==null||F.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,W){this._selectionService.setSelection(O,R,W)}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 W;(W=this._selectionService)==null||W.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 W=(0,H.evaluateKeyboardEvent)(O,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(O),W.type===3||W.type===2){const F=this.rows-1;return this.scrollLines(W.type===2?-F:F),this.cancel(O,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,O)||(W.cancel&&this.cancel(O,!0),!W.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):(W.key!==G.C0.ETX&&W.key!==G.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:O}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||O.altKey||O.ctrlKey?this.cancel(O,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(O,R){const W=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"?W:W&&(!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 W,F;(W=this._charSizeService)==null||W.measure(),(F=this.viewport)==null||F.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(K.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,W;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(),(W=this.viewport)==null||W.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(G.C0.ESC+"[I"):this.coreService.triggerDataEvent(G.C0.ESC+"[O")}_reportWindowsOptions(O){if(this._renderService)switch(O){case M.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const R=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[4;${W};${R}t`);break;case M.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const F=this._renderService.dimensions.css.cell.width.toFixed(0),Y=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[6;${Y};${F}t`)}}cancel(O,R){if(this.options.cancelEvents||R)return O.preventDefault(),O.stopPropagation(),!1}}o.Terminal=Z},9924:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,g){this._rowCount=g,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,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,S=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(C,o,u){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},g=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=u(3656),_=u(4725),S=u(8460),x=u(844),v=u(2585);let c=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 S.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(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(m.colors),this.register(m.onChangeColors(E=>this._handleThemeChange(E))),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 E=l;E<y;E++){const A=k.get(E);if(!A)continue;const I=(m=k.get(E+1))==null?void 0:m.isWrapped;if(p+=A.translateToString(!I),!I||E===k.length-1){const B=document.createElement("div");B.textContent=p,w.push(B),p.length>0&&(n=B),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=c=d([g(2,v.IBufferService),g(3,v.IOptionsService),g(4,_.ICharSizeService),g(5,_.IRenderService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],c)},3107:function(C,o,u){var d=this&&this.__decorate||function(v,c,l,s){var n,p=arguments.length,w=p<3?c:s===null?s=Object.getOwnPropertyDescriptor(c,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,c,l,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(c,l,w):n(c,l))||w);return p>3&&w&&Object.defineProperty(c,l,w),w},g=this&&this.__param||function(v,c){return function(l,s){c(l,s,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const h=u(4725),_=u(844),S=u(2585);let x=o.BufferDecorationRenderer=class extends _.Disposable{constructor(v,c,l,s,n){super(),this._screenElement=v,this._bufferService=c,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 c=this._coreBrowserService.mainDocument.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((s=v==null?void 0:v.options)==null?void 0:s.layer)==="top"),c.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const l=v.options.x??0;return l&&l>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(v,c),c}_refreshStyle(v){const c=v.marker.line-this._bufferService.buffers.active.ydisp;if(c<0||c>=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=c*this._renderService.dimensions.css.cell.height+"px",l.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(l)}}_refreshXPosition(v,c=v.element){if(!c)return;const l=v.options.x??0;(v.options.anchor||"left")==="right"?c.style.right=l?l*this._renderService.dimensions.css.cell.width+"px":"":c.style.left=l?l*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var c;(c=this._decorationElements.get(v))==null||c.remove(),this._decorationElements.delete(v),v.dispose()}};o.BufferDecorationRenderer=x=d([g(1,S.IBufferService),g(2,h.ICoreBrowserService),g(3,S.IDecorationService),g(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(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,g){return d>=u.startBufferLine-this._linePadding[g||"full"]&&d<=u.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(C,o,u){var d=this&&this.__decorate||function(n,p,w,y){var k,m=arguments.length,E=m<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(n,p,w,y);else for(var A=n.length-1;A>=0;A--)(k=n[A])&&(E=(m<3?k(E):m>3?k(p,w,E):k(p,w))||E);return m>3&&E&&Object.defineProperty(p,w,E),E},g=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=u(5871),_=u(4725),S=u(844),x=u(2585),v={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0};let s=o.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(n,p,w,y,k,m,E){var I;super(),this._viewportElement=n,this._screenElement=p,this._bufferService=w,this._decorationService=y,this._renderService=k,this._optionsService=m,this._coreBrowserService=E,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 A=this._canvas.getContext("2d");if(!A)throw new Error("Ctx cannot be null");this._ctx=A,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)(()=>{var B;(B=this._canvas)==null||B.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);c.full=this._canvas.width,c.left=n,c.center=p,c.right=n,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=c.left,l.right=c.left+c.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),c[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([g(2,x.IBufferService),g(3,x.IDecorationService),g(4,_.IRenderService),g(5,x.IOptionsService),g(6,_.ICoreBrowserService)],s)},2950:function(C,o,u){var d=this&&this.__decorate||function(v,c,l,s){var n,p=arguments.length,w=p<3?c:s===null?s=Object.getOwnPropertyDescriptor(c,l):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,c,l,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(c,l,w):n(c,l))||w);return p>3&&w&&Object.defineProperty(c,l,w),w},g=this&&this.__param||function(v,c){return function(l,s){c(l,s,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const h=u(4725),_=u(2585),S=u(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,c,l,s,n,p){this._textarea=v,this._compositionView=c,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 c={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let l;this._isSendingComposition=!1,c.start+=this._dataAlreadySent.length,l=this._isComposing?this._textarea.value.substring(c.start,c.end):this._textarea.value.substring(c.start),l.length>0&&this._coreService.triggerDataEvent(l,!0)}},0)}else{this._isSendingComposition=!1;const c=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(c,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const c=this._textarea.value,l=c.replace(v,"");this._dataAlreadySent=l,c.length>v.length?this._coreService.triggerDataEvent(l,!0):c.length<v.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):c.length===v.length&&c!==v&&this._coreService.triggerDataEvent(c,!0)}},0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const c=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=c*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([g(2,_.IBufferService),g(3,_.IOptionsService),g(4,_.ICoreService),g(5,h.IRenderService)],x)},9806:(C,o)=>{function u(d,g,h){const _=h.getBoundingClientRect(),S=d.getComputedStyle(h),x=parseInt(S.getPropertyValue("padding-left")),v=parseInt(S.getPropertyValue("padding-top"));return[g.clientX-_.left-x,g.clientY-_.top-v]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=u,o.getCoords=function(d,g,h,_,S,x,v,c,l){if(!x)return;const s=u(d,g,h);return s?(s[0]=Math.ceil((s[0]+(l?v/2:0))/v),s[1]=Math.ceil(s[1]/c),s[0]=Math.min(Math.max(s[0],1),_+(l?1:0)),s[1]=Math.min(Math.max(s[1],1),S),s):void 0}},9504:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const d=u(2584);function g(c,l,s,n){const p=c-h(c,s),w=l-h(l,s),y=Math.abs(p-w)-function(k,m,E){let A=0;const I=k-h(k,E),B=m-h(m,E);for(let P=0;P<Math.abs(I-B);P++){const N=_(k,m)==="A"?-1:1,z=E.buffer.lines.get(I+N*P);z!=null&&z.isWrapped&&A++}return A}(c,l,s);return v(y,x(_(c,l),n))}function h(c,l){let s=0,n=l.buffer.lines.get(c),p=n==null?void 0:n.isWrapped;for(;p&&c>=0&&c<l.rows;)s++,n=l.buffer.lines.get(--c),p=n==null?void 0:n.isWrapped;return s}function _(c,l){return c>l?"A":"B"}function S(c,l,s,n,p,w){let y=c,k=l,m="";for(;y!==s||k!==n;)y+=p?1:-1,p&&y>w.cols-1?(m+=w.buffer.translateBufferLineToString(k,!1,c,y),y=0,c=0,k++):!p&&y<0&&(m+=w.buffer.translateBufferLineToString(k,!1,0,c+1),y=w.cols-1,c=y,k--);return m+w.buffer.translateBufferLineToString(k,!1,c,y)}function x(c,l){const s=l?"O":"[";return d.C0.ESC+s+c}function v(c,l){c=Math.floor(c);let s="";for(let n=0;n<c;n++)s+=l;return s}o.moveToCellSequence=function(c,l,s,n){const p=s.buffer.x,w=s.buffer.y;if(!s.buffer.hasScrollback)return function(m,E,A,I,B,P){return g(E,I,B,P).length===0?"":v(S(m,E,m,E-h(E,B),!1,B).length,x("D",P))}(p,w,0,l,s,n)+g(w,l,s,n)+function(m,E,A,I,B,P){let N;N=g(E,I,B,P).length>0?I-h(I,B):E;const z=I,K=function(G,H,b,T,D,M){let j;return j=g(b,T,D,M).length>0?T-h(T,D):H,G<b&&j<=T||G>=b&&j<T?"C":"D"}(m,E,A,I,B,P);return v(S(m,N,A,z,K==="C",B).length,x(K,P))}(p,w,c,l,s,n);let y;if(w===l)return y=p>c?"D":"C",v(Math.abs(p-c),x(y,n));y=w>l?"D":"C";const k=Math.abs(w-l);return v(function(m,E){return E.cols-m}(w>l?c:p,s)+(k-1)*s.cols+1+((w>l?p:c)-1),x(y,n))}},1296:function(C,o,u){var d=this&&this.__decorate||function(P,N,z,K){var G,H=arguments.length,b=H<3?N:K===null?K=Object.getOwnPropertyDescriptor(N,z):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(P,N,z,K);else for(var T=P.length-1;T>=0;T--)(G=P[T])&&(b=(H<3?G(b):H>3?G(N,z,b):G(N,z))||b);return H>3&&b&&Object.defineProperty(N,z,b),b},g=this&&this.__param||function(P,N){return function(z,K){N(z,K,P)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const h=u(3787),_=u(2550),S=u(2223),x=u(6171),v=u(6052),c=u(4725),l=u(8055),s=u(8460),n=u(844),p=u(2585),w="xterm-dom-renderer-owner-",y="xterm-rows",k="xterm-fg-",m="xterm-bg-",E="xterm-focus",A="xterm-selection";let I=1,B=o.DomRenderer=class extends n.Disposable{constructor(P,N,z,K,G,H,b,T,D,M,j,U,Z){super(),this._terminal=P,this._document=N,this._element=z,this._screenElement=K,this._viewportElement=G,this._helperContainer=H,this._linkifier2=b,this._charSizeService=D,this._optionsService=M,this._bufferService=j,this._coreBrowserService=U,this._themeService=Z,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(A),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(q=>this._injectCss(q))),this._injectCss(this._themeService.colors),this._rowFactory=T.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(q=>this._handleLinkHover(q))),this.register(this._linkifier2.onHideLinkUnderline(q=>this._handleLinkLeave(q))),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 P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),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/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),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 z of this._rowElements)z.style.width=`${this.dimensions.css.canvas.width}px`,z.style.height=`${this.dimensions.css.cell.height}px`,z.style.lineHeight=`${this.dimensions.css.cell.height}px`,z.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(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let N=`${this._terminalSelector} .${y} { color: ${P.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(P.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 z=`blink_underline_${this._terminalClass}`,K=`blink_bar_${this._terminalClass}`,G=`blink_block_${this._terminalClass}`;N+=`@keyframes ${z} { 50% { border-bottom-style: hidden; }}`,N+=`@keyframes ${K} { 50% { box-shadow: none; }}`,N+=`@keyframes ${G} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,N+=`${this._terminalSelector} .${y}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${y}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${y}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,N+=`${this._terminalSelector} .${A} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${A} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${A} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[H,b]of P.ansi.entries())N+=`${this._terminalSelector} .${k}${H} { color: ${b.css}; }${this._terminalSelector} .${k}${H}.xterm-dim { color: ${l.color.multiplyOpacity(b,.5).css}; }${this._terminalSelector} .${m}${H} { background-color: ${b.css}; }`;N+=`${this._terminalSelector} .${k}${S.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(P.background).css}; }${this._terminalSelector} .${k}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${m}${S.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=N}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,N){for(let z=this._rowElements.length;z<=N;z++){const K=this._document.createElement("div");this._rowContainer.appendChild(K),this._rowElements.push(K)}for(;this._rowElements.length>N;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,N){this._refreshRowElements(P,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(E),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(E),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,N,z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,N,z),this.renderRows(0,this._bufferService.rows-1),!P||!N)return;this._selectionRenderModel.update(this._terminal,P,N,z);const K=this._selectionRenderModel.viewportStartRow,G=this._selectionRenderModel.viewportEndRow,H=this._selectionRenderModel.viewportCappedStartRow,b=this._selectionRenderModel.viewportCappedEndRow;if(H>=this._bufferService.rows||b<0)return;const T=this._document.createDocumentFragment();if(z){const D=P[0]>N[0];T.appendChild(this._createSelectionElement(H,D?N[0]:P[0],D?P[0]:N[0],b-H+1))}else{const D=K===H?P[0]:0,M=H===G?N[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(H,D,M));const j=b-H-1;if(T.appendChild(this._createSelectionElement(H+1,0,this._bufferService.cols,j)),H!==b){const U=G===b?N[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(b,0,U))}}this._selectionContainer.appendChild(T)}_createSelectionElement(P,N,z,K=1){const G=this._document.createElement("div"),H=N*this.dimensions.css.cell.width;let b=this.dimensions.css.cell.width*(z-N);return H+b>this.dimensions.css.canvas.width&&(b=this.dimensions.css.canvas.width-H),G.style.height=K*this.dimensions.css.cell.height+"px",G.style.top=P*this.dimensions.css.cell.height+"px",G.style.left=`${H}px`,G.style.width=`${b}px`,G}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 P of this._rowElements)P.replaceChildren()}renderRows(P,N){const z=this._bufferService.buffer,K=z.ybase+z.y,G=Math.min(z.x,this._bufferService.cols-1),H=this._optionsService.rawOptions.cursorBlink,b=this._optionsService.rawOptions.cursorStyle,T=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=P;D<=N;D++){const M=D+z.ydisp,j=this._rowElements[D],U=z.lines.get(M);if(!j||!U)break;j.replaceChildren(...this._rowFactory.createRow(U,M,M===K,b,T,G,H,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${w}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,N,z,K,G,H){z<0&&(P=0),K<0&&(N=0);const b=this._bufferService.rows-1;z=Math.max(Math.min(z,b),0),K=Math.max(Math.min(K,b),0),G=Math.min(G,this._bufferService.cols);const T=this._bufferService.buffer,D=T.ybase+T.y,M=Math.min(T.x,G-1),j=this._optionsService.rawOptions.cursorBlink,U=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let q=z;q<=K;++q){const O=q+T.ydisp,R=this._rowElements[q],W=T.lines.get(O);if(!R||!W)break;R.replaceChildren(...this._rowFactory.createRow(W,O,O===D,U,Z,M,j,this.dimensions.css.cell.width,this._widthCache,H?q===z?P:0:-1,H?(q===K?N:G)-1:-1))}}};o.DomRenderer=B=d([g(7,p.IInstantiationService),g(8,c.ICharSizeService),g(9,p.IOptionsService),g(10,p.IBufferService),g(11,c.ICoreBrowserService),g(12,c.IThemeService)],B)},3787:function(C,o,u){var d=this&&this.__decorate||function(y,k,m,E){var A,I=arguments.length,B=I<3?k:E===null?E=Object.getOwnPropertyDescriptor(k,m):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(y,k,m,E);else for(var P=y.length-1;P>=0;P--)(A=y[P])&&(B=(I<3?A(B):I>3?A(k,m,B):A(k,m))||B);return I>3&&B&&Object.defineProperty(k,m,B),B},g=this&&this.__param||function(y,k){return function(m,E){k(m,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const h=u(2223),_=u(643),S=u(511),x=u(2585),v=u(8055),c=u(4725),l=u(4269),s=u(6171),n=u(3734);let p=o.DomRendererRowFactory=class{constructor(y,k,m,E,A,I,B){this._document=y,this._characterJoinerService=k,this._optionsService=m,this._coreBrowserService=E,this._coreService=A,this._decorationService=I,this._themeService=B,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,k,m){this._selectionStart=y,this._selectionEnd=k,this._columnSelectMode=m}createRow(y,k,m,E,A,I,B,P,N,z,K){const G=[],H=this._characterJoinerService.getJoinedCharacters(k),b=this._themeService.colors;let T,D=y.getNoBgTrimmedLength();m&&D<I+1&&(D=I+1);let M=0,j="",U=0,Z=0,q=0,O=!1,R=0,W=!1,F=0;const Y=[],X=z!==-1&&K!==-1;for(let te=0;te<D;te++){y.loadCell(te,this._workCell);let de=this._workCell.getWidth();if(de===0)continue;let fe=!1,Me=te,J=this._workCell;if(H.length>0&&te===H[0][0]){fe=!0;const ae=H.shift();J=new l.JoinedCellData(this._workCell,y.translateToString(!0,ae[0],ae[1]),ae[1]-ae[0]),Me=ae[1]-1,de=J.getWidth()}const Mr=this._isCellInSelection(te,k),$s=m&&te===I,Ks=X&&te>=z&&te<=K;let Vs=!1;this._decorationService.forEachDecorationAtCell(te,k,void 0,ae=>{Vs=!0});let Ri=J.getChars()||_.WHITESPACE_CELL_CHAR;if(Ri===" "&&(J.isUnderline()||J.isOverline())&&(Ri=" "),F=de*P-N.get(Ri,J.isBold(),J.isItalic()),T){if(M&&(Mr&&W||!Mr&&!W&&J.bg===U)&&(Mr&&W&&b.selectionForeground||J.fg===Z)&&J.extended.ext===q&&Ks===O&&F===R&&!$s&&!fe&&!Vs){J.isInvisible()?j+=_.WHITESPACE_CELL_CHAR:j+=Ri,M++;continue}M&&(T.textContent=j),T=this._document.createElement("span"),M=0,j=""}else T=this._document.createElement("span");if(U=J.bg,Z=J.fg,q=J.extended.ext,O=Ks,R=F,W=Mr,fe&&I>=te&&I<=Me&&(I=te),!this._coreService.isCursorHidden&&$s&&this._coreService.isCursorInitialized){if(Y.push("xterm-cursor"),this._coreBrowserService.isFocused)B&&Y.push("xterm-cursor-blink"),Y.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(A)switch(A){case"outline":Y.push("xterm-cursor-outline");break;case"block":Y.push("xterm-cursor-block");break;case"bar":Y.push("xterm-cursor-bar");break;case"underline":Y.push("xterm-cursor-underline")}}if(J.isBold()&&Y.push("xterm-bold"),J.isItalic()&&Y.push("xterm-italic"),J.isDim()&&Y.push("xterm-dim"),j=J.isInvisible()?_.WHITESPACE_CELL_CHAR:J.getChars()||_.WHITESPACE_CELL_CHAR,J.isUnderline()&&(Y.push(`xterm-underline-${J.extended.underlineStyle}`),j===" "&&(j=" "),!J.isUnderlineColorDefault()))if(J.isUnderlineColorRGB())T.style.textDecorationColor=`rgb(${n.AttributeData.toColorRGB(J.getUnderlineColor()).join(",")})`;else{let ae=J.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&J.isBold()&&ae<8&&(ae+=8),T.style.textDecorationColor=b.ansi[ae].css}J.isOverline()&&(Y.push("xterm-overline"),j===" "&&(j=" ")),J.isStrikethrough()&&Y.push("xterm-strikethrough"),Ks&&(T.style.textDecoration="underline");let $e=J.getFgColor(),Pr=J.getFgColorMode(),st=J.getBgColor(),Ir=J.getBgColorMode();const Gs=!!J.isInverse();if(Gs){const ae=$e;$e=st,st=ae;const Hu=Pr;Pr=Ir,Ir=Hu}let yt,Li,Ct,Br=!1;switch(this._decorationService.forEachDecorationAtCell(te,k,void 0,ae=>{ae.options.layer!=="top"&&Br||(ae.backgroundColorRGB&&(Ir=50331648,st=ae.backgroundColorRGB.rgba>>8&16777215,yt=ae.backgroundColorRGB),ae.foregroundColorRGB&&(Pr=50331648,$e=ae.foregroundColorRGB.rgba>>8&16777215,Li=ae.foregroundColorRGB),Br=ae.options.layer==="top")}),!Br&&Mr&&(yt=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,st=yt.rgba>>8&16777215,Ir=50331648,Br=!0,b.selectionForeground&&(Pr=50331648,$e=b.selectionForeground.rgba>>8&16777215,Li=b.selectionForeground)),Br&&Y.push("xterm-decoration-top"),Ir){case 16777216:case 33554432:Ct=b.ansi[st],Y.push(`xterm-bg-${st}`);break;case 50331648:Ct=v.channels.toColor(st>>16,st>>8&255,255&st),this._addStyle(T,`background-color:#${w((st>>>0).toString(16),"0",6)}`);break;default:Gs?(Ct=b.foreground,Y.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Ct=b.background}switch(yt||J.isDim()&&(yt=v.color.multiplyOpacity(Ct,.5)),Pr){case 16777216:case 33554432:J.isBold()&&$e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($e+=8),this._applyMinimumContrast(T,Ct,b.ansi[$e],J,yt,void 0)||Y.push(`xterm-fg-${$e}`);break;case 50331648:const ae=v.channels.toColor($e>>16&255,$e>>8&255,255&$e);this._applyMinimumContrast(T,Ct,ae,J,yt,Li)||this._addStyle(T,`color:#${w($e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(T,Ct,b.foreground,J,yt,Li)||Gs&&Y.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}Y.length&&(T.className=Y.join(" "),Y.length=0),$s||fe||Vs?T.textContent=j:M++,F!==this.defaultSpacing&&(T.style.letterSpacing=`${F}px`),G.push(T),te=Me}return T&&M&&(T.textContent=j),G}_applyMinimumContrast(y,k,m,E,A,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(E.getCode()))return!1;const B=this._getContrastCache(E);let P;if(A||I||(P=B.getColor(k.rgba,m.rgba)),P===void 0){const N=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);P=v.color.ensureContrastRatio(A||k,I||m,N),B.setColor((A||k).rgba,(I||m).rgba,P??null)}return!!P&&(this._addStyle(y,`color:${P.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,E=this._selectionEnd;return!(!m||!E)&&(this._columnSelectMode?m[0]<=E[0]?y>=m[0]&&k>=m[1]&&y<E[0]&&k<=E[1]:y<m[0]&&k>=m[1]&&y>=E[0]&&k<=E[1]:k>m[1]&&k<E[1]||m[1]===E[1]&&k===m[1]&&y>=m[0]&&y<E[0]||m[1]<E[1]&&k===E[1]&&y<E[0]||m[1]<E[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([g(1,c.ICharacterJoinerService),g(2,x.IOptionsService),g(3,c.ICoreBrowserService),g(4,x.ICoreService),g(5,x.IDecorationService),g(6,c.IThemeService)],p)},2550:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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 g=u.createElement("span");g.classList.add("xterm-char-measure-element");const h=u.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const _=u.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const S=u.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[g,h,_,S],this._container.appendChild(g),this._container.appendChild(h),this._container.appendChild(_),this._container.appendChild(S),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(u,d,g,h){u===this._font&&d===this._fontSize&&g===this._weight&&h===this._weightBold||(this._font=u,this._fontSize=d,this._weight=g,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(u,d,g){let h=0;if(!d&&!g&&u.length===1&&(h=u.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const x=this._measure(u,0);return x>0&&(this._flat[h]=x),x}let _=u;d&&(_+="B"),g&&(_+="I");let S=this._holey.get(_);if(S===void 0){let x=0;d&&(x|=1),g&&(x|=2),S=this._measure(u,x),S>0&&this._holey.set(_,S)}return S}_measure(u,d){const g=this._measureElements[d];return g.textContent=u.repeat(32),g.offsetWidth/32}}},2223:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(C,o)=>{function u(g){return 57508<=g&&g<=57558}function d(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=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(g){if(!g)throw new Error("value must not be falsy");return g},o.isPowerlineGlyph=u,o.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},o.isEmoji=d,o.allowRescaling=function(g,h,_,S){return h===1&&_>Math.ceil(1.5*S)&&g!==void 0&&g>255&&!d(g)&&!u(g)&&!function(x){return 57344<=x&&x<=63743}(g)},o.treatGlyphAsBackgroundColor=function(g){return u(g)||function(h){return 9472<=h&&h<=9631}(g)},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(g,h,_=0){return(g-(2*Math.round(h)-_))%(2*Math.round(h))}},6052:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class u{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(g,h,_,S=!1){if(this.selectionStart=h,this.selectionEnd=_,!h||!_||h[0]===_[0]&&h[1]===_[1])return void this.clear();const x=g.buffers.active.ydisp,v=h[1]-x,c=_[1]-x,l=Math.max(v,0),s=Math.min(c,g.rows-1);l>=g.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=v,this.viewportEndRow=c,this.viewportCappedStartRow=l,this.viewportCappedEndRow=s,this.startCol=h[0],this.endCol=_[0])}isCellSelected(g,h,_){return!!this.hasSelection&&(_-=g.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 u}},456:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(C,o,u){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 E=s.length-1;E>=0;E--)(y=s[E])&&(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},g=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=u(2585),_=u(8460),S=u(844);let x=o.CharSizeService=class extends S.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 c(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([g(2,h.IOptionsService)],x);class v extends S.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 c 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,u){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},g=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=u(3734),_=u(643),S=u(511),x=u(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 c=o.CharacterJoinerService=class Bu{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.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,E=n.getFg(0),A=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!==E||this._workCell.bg!==A){if(I-y>1){const B=this._getJoinedRanges(w,m,k,n,y);for(let P=0;P<B.length;P++)p.push(B[P])}y=I,m=k,E=this._workCell.fg,A=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 B=0;B<I.length;B++)p.push(I[B])}return p}_getJoinedRanges(s,n,p,w,y){const k=s.substring(n,p);let m=[];try{m=this._characterJoiners[0].handler(k)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const A=this._characterJoiners[E].handler(k);for(let I=0;I<A.length;I++)Bu._mergeRanges(m,A[I])}catch(A){console.error(A)}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 E=p;E<this._bufferService.cols;E++){const A=n.getWidth(E),I=n.getString(E).length||_.WHITESPACE_CELL_CHAR.length;if(A!==0){if(!y&&m[0]<=k&&(m[0]=E,y=!0),m[1]<=k){if(m[1]=E,m=s[++w],!m)break;m[0]<=k?(m[0]=E,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=c=d([g(0,x.IBufferService)],c)},5114:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const d=u(844),g=u(8460),h=u(3656);class _ extends d.Disposable{constructor(v,c,l){super(),this._textarea=v,this._window=c,this.mainDocument=l,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this.register((0,g.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 S extends d.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new g.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,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const d=u(844);class g extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const S=this.linkProviders.indexOf(_);S!==-1&&this.linkProviders.splice(S,1)}}}}o.LinkProviderService=g},8934:function(C,o,u){var d=this&&this.__decorate||function(x,v,c,l){var s,n=arguments.length,p=n<3?v:l===null?l=Object.getOwnPropertyDescriptor(v,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(x,v,c,l);else for(var w=x.length-1;w>=0;w--)(s=x[w])&&(p=(n<3?s(p):n>3?s(v,c,p):s(v,c))||p);return n>3&&p&&Object.defineProperty(v,c,p),p},g=this&&this.__param||function(x,v){return function(c,l){v(c,l,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const h=u(4725),_=u(9806);let S=o.MouseService=class{constructor(x,v){this._renderService=x,this._charSizeService=v}getCoords(x,v,c,l,s){return(0,_.getCoords)(window,x,v,c,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(x,v){const c=(0,_.getCoordsRelativeToElement)(window,x,v);if(this._charSizeService.hasValidSize)return c[0]=Math.min(Math.max(c[0],0),this._renderService.dimensions.css.canvas.width-1),c[1]=Math.min(Math.max(c[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(c[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(c[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(c[0]),y:Math.floor(c[1])}}};o.MouseService=S=d([g(0,h.IRenderService),g(1,h.ICharSizeService)],S)},3230:function(C,o,u){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 E=s.length-1;E>=0;E--)(y=s[E])&&(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},g=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=u(6193),_=u(4725),S=u(8460),x=u(844),v=u(7226),c=u(2585);let l=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,n,p,w,y,k,m,E){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 S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer((A,I)=>this._renderRows(A,I),m),this.register(this._renderDebouncer),this.register(m.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(k.onResize(()=>this._fullRefresh())),this.register(k.buffers.onBufferActivate(()=>{var A;return(A=this._renderer.value)==null?void 0:A.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(E.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(m.window,n),this.register(m.onWindowChange(A=>this._registerIntersectionObserver(A,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([g(2,c.IOptionsService),g(3,_.ICharSizeService),g(4,c.IDecorationService),g(5,c.IBufferService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],l)},9312:function(C,o,u){var d=this&&this.__decorate||function(m,E,A,I){var B,P=arguments.length,N=P<3?E:I===null?I=Object.getOwnPropertyDescriptor(E,A):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(m,E,A,I);else for(var z=m.length-1;z>=0;z--)(B=m[z])&&(N=(P<3?B(N):P>3?B(E,A,N):B(E,A))||N);return P>3&&N&&Object.defineProperty(E,A,N),N},g=this&&this.__param||function(m,E){return function(A,I){E(A,I,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const h=u(9806),_=u(9504),S=u(456),x=u(4725),v=u(8460),c=u(844),l=u(6114),s=u(4841),n=u(511),p=u(2585),w=" ",y=new RegExp(w,"g");let k=o.SelectionService=class extends c.Disposable{constructor(m,E,A,I,B,P,N,z,K){super(),this._element=m,this._screenElement=E,this._linkifier=A,this._bufferService=I,this._coreService=B,this._mouseService=P,this._optionsService=N,this._renderService=z,this._coreBrowserService=K,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=G=>this._handleMouseMove(G),this._mouseUpListener=G=>this._handleMouseUp(G),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(G=>this._handleTrim(G)),this.register(this._bufferService.buffers.onBufferActivate(G=>this._handleBufferActivate(G))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,c.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,E=this._model.finalSelectionEnd;return!(!m||!E||m[0]===E[0]&&m[1]===E[1])}get selectionText(){const m=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!m||!E)return"";const A=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(m[0]===E[0])return"";const B=m[0]<E[0]?m[0]:E[0],P=m[0]<E[0]?E[0]:m[0];for(let N=m[1];N<=E[1];N++){const z=A.translateBufferLineToString(N,!0,B,P);I.push(z)}}else{const B=m[1]===E[1]?E[0]:void 0;I.push(A.translateBufferLineToString(m[1],!0,m[0],B));for(let P=m[1]+1;P<=E[1]-1;P++){const N=A.lines.get(P),z=A.translateBufferLineToString(P,!0);N!=null&&N.isWrapped?I[I.length-1]+=z:I.push(z)}if(m[1]!==E[1]){const P=A.lines.get(E[1]),N=A.translateBufferLineToString(E[1],!0,0,E[0]);P&&P.isWrapped?I[I.length-1]+=N:I.push(N)}}return I.map(B=>B.replace(y," ")).join(l.isWindows?`\r
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 E=this._getMouseBufferCoords(m),A=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(A&&I&&E)&&this._areCoordsInSelection(E,A,I)}isCellInSelection(m,E){const A=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!A||!I)&&this._areCoordsInSelection([m,E],A,I)}_areCoordsInSelection(m,E,A){return m[1]>E[1]&&m[1]<A[1]||E[1]===A[1]&&m[1]===E[1]&&m[0]>=E[0]&&m[0]<A[0]||E[1]<A[1]&&m[1]===A[1]&&m[0]<A[0]||E[1]<A[1]&&m[1]===E[1]&&m[0]>=E[0]}_selectWordAtCursor(m,E){var B,P;const A=(P=(B=this._linkifier.currentLink)==null?void 0:B.link)==null?void 0:P.range;if(A)return this._model.selectionStart=[A.start.x-1,A.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(A,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(m);return!!I&&(this._selectWordAt(I,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(m,E){this._model.clearSelection(),m=Math.max(m,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(m){this._model.handleTrim(m)&&this.refresh()}_getMouseBufferCoords(m){const E=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(m){let E=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,m,this._screenElement)[1];const A=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=A?0:(E>A&&(E-=A),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}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 E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(m){this._selectWordAtCursor(m,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(m){const E=this._getMouseBufferCoords(m);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(m){return m.altKey&&!(l.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(m){if(m.stopImmediatePropagation(),!this._model.selectionStart)return;const E=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 A=this._bufferService.buffer;if(this._model.selectionEnd[1]<A.lines.length){const I=A.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]++}E&&E[0]===this._model.selectionEnd[0]&&E[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 E=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&m.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const A=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(A&&A[0]!==void 0&&A[1]!==void 0){const I=(0,_.moveToCellSequence)(A[0]-1,A[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const m=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,A=!(!m||!E||m[0]===E[0]&&m[1]===E[1]);A?m&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&m[0]===this._oldSelectionStart[0]&&m[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(m,E,A)):this._oldHasSelection&&this._fireOnSelectionChange(m,E,A)}_fireOnSelectionChange(m,E,A){this._oldSelectionStart=m,this._oldSelectionEnd=E,this._oldHasSelection=A,this._onSelectionChange.fire()}_handleBufferActivate(m){this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(m,E){let A=E;for(let I=0;E>=I;I++){const B=m.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?A--:B>1&&E!==I&&(A+=B-1)}return A}setSelection(m,E,A){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,E],this._model.selectionStartLength=A,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(m){this._isClickInSelection(m)||(this._selectWordAtCursor(m,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(m,E,A=!0,I=!0){if(m[0]>=this._bufferService.cols)return;const B=this._bufferService.buffer,P=B.lines.get(m[1]);if(!P)return;const N=B.translateBufferLineToString(m[1],!1);let z=this._convertViewportColToCharacterIndex(P,m[0]),K=z;const G=m[0]-z;let H=0,b=0,T=0,D=0;if(N.charAt(z)===" "){for(;z>0&&N.charAt(z-1)===" ";)z--;for(;K<N.length&&N.charAt(K+1)===" ";)K++}else{let U=m[0],Z=m[0];P.getWidth(U)===0&&(H++,U--),P.getWidth(Z)===2&&(b++,Z++);const q=P.getString(Z).length;for(q>1&&(D+=q-1,K+=q-1);U>0&&z>0&&!this._isCharWordSeparator(P.loadCell(U-1,this._workCell));){P.loadCell(U-1,this._workCell);const O=this._workCell.getChars().length;this._workCell.getWidth()===0?(H++,U--):O>1&&(T+=O-1,z-=O-1),z--,U--}for(;Z<P.length&&K+1<N.length&&!this._isCharWordSeparator(P.loadCell(Z+1,this._workCell));){P.loadCell(Z+1,this._workCell);const O=this._workCell.getChars().length;this._workCell.getWidth()===2?(b++,Z++):O>1&&(D+=O-1,K+=O-1),K++,Z++}}K++;let M=z+G-H+T,j=Math.min(this._bufferService.cols,K-z+H+b-T-D);if(E||N.slice(z,K).trim()!==""){if(A&&M===0&&P.getCodePoint(0)!==32){const U=B.lines.get(m[1]-1);if(U&&P.isWrapped&&U.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(Z){const q=this._bufferService.cols-Z.start;M-=q,j+=q}}}if(I&&M+j===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const U=B.lines.get(m[1]+1);if(U!=null&&U.isWrapped&&U.getCodePoint(0)!==32){const Z=this._getWordAt([0,m[1]+1],!1,!1,!0);Z&&(j+=Z.length)}}return{start:M,length:j}}}_selectWordAt(m,E){const A=this._getWordAt(m,E);if(A){for(;A.start<0;)A.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[A.start,m[1]],this._model.selectionStartLength=A.length}}_selectToWordAt(m){const E=this._getWordAt(m,!0);if(E){let A=m[1];for(;E.start<0;)E.start+=this._bufferService.cols,A--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,A++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,A]}}_isCharWordSeparator(m){return m.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(m.getChars())>=0}_selectLineAt(m){const E=this._bufferService.buffer.getWrappedRangeForLine(m),A={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(A,this._bufferService.cols)}};o.SelectionService=k=d([g(3,p.IBufferService),g(4,p.ICoreService),g(5,x.IMouseService),g(6,p.IOptionsService),g(7,x.IRenderService),g(8,x.ICoreBrowserService)],k)},4725:(C,o,u)=>{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=u(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,u){var d=this&&this.__decorate||function(k,m,E,A){var I,B=arguments.length,P=B<3?m:A===null?A=Object.getOwnPropertyDescriptor(m,E):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(k,m,E,A);else for(var N=k.length-1;N>=0;N--)(I=k[N])&&(P=(B<3?I(P):B>3?I(m,E,P):I(m,E))||P);return B>3&&P&&Object.defineProperty(m,E,P),P},g=this&&this.__param||function(k,m){return function(E,A){m(E,A,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const h=u(7239),_=u(8055),S=u(8460),x=u(844),v=u(2585),c=_.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 E=0;E<216;E++){const A=m[E/36%6|0],I=m[E/6%6|0],B=m[E%6];k.push({css:_.channels.toCss(A,I,B),rgba:_.channels.toRgba(A,I,B)})}for(let E=0;E<24;E++){const A=8+10*E;k.push({css:_.channels.toCss(A,A,A),rgba:_.channels.toRgba(A,A,A)})}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 S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:c,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,c),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 E=Math.min(m.ansi.length-16,k.extendedAnsi.length);for(let A=0;A<E;A++)m.ansi[A+16]=y(k.extendedAnsi[A],o.DEFAULT_ANSI_COLORS[A+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([g(0,v.IOptionsService)],w)},6349:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const d=u(8460),g=u(844);class h extends g.Disposable{constructor(S){super(),this._maxLength=S,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(S){if(this._maxLength===S)return;const x=new Array(S);for(let v=0;v<Math.min(S,this.length);v++)x[v]=this._array[this._getCyclicIndex(v)];this._array=x,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let x=this._length;x<S;x++)this._array[x]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,x){this._array[this._getCyclicIndex(S)]=x}push(S){this._array[this._getCyclicIndex(this._length)]=S,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(S,x,...v){if(x){for(let c=S;c<this._length-x;c++)this._array[this._getCyclicIndex(c)]=this._array[this._getCyclicIndex(c+x)];this._length-=x,this.onDeleteEmitter.fire({index:S,amount:x})}for(let c=this._length-1;c>=S;c--)this._array[this._getCyclicIndex(c+v.length)]=this._array[this._getCyclicIndex(c)];for(let c=0;c<v.length;c++)this._array[this._getCyclicIndex(S+c)]=v[c];if(v.length&&this.onInsertEmitter.fire({index:S,amount:v.length}),this._length+v.length>this._maxLength){const c=this._length+v.length-this._maxLength;this._startIndex+=c,this._length=this._maxLength,this.onTrimEmitter.fire(c)}else this._length+=v.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,x,v){if(!(x<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+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(S+l+v,this.get(S+l));const c=S+x+v-this._length;if(c>0)for(this._length+=c;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let c=0;c<x;c++)this.set(S+c+v,this.get(S+c))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}o.CircularList=h},1439:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function u(d,g=5){if(typeof d!="object")return d;const h=Array.isArray(d)?[]:{};for(const _ in d)h[_]=g<=1?d[_]:d[_]&&u(d[_],g-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 u=0,d=0,g=0,h=0;var _,S,x,v,c;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),[u,d,g]=c.toChannels(w.rgba),{css:_.toCss(u,d,g,h),rgba:_.toRgba(u,d,g,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,E=y.rgba>>8&255,A=w.rgba>>24&255,I=w.rgba>>16&255,B=w.rgba>>8&255;return u=A+Math.round((k-A)*h),d=I+Math.round((m-I)*h),g=B+Math.round((E-B)*h),{css:_.toCss(u,d,g),rgba:_.toRgba(u,d,g)}},n.isOpaque=function(w){return(255&w.rgba)==255},n.ensureContrastRatio=function(w,y,k){const m=c.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[u,d,g]=c.toChannels(y),{css:_.toCss(u,d,g),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]}}(S||(o.color=S={})),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 u=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),g=parseInt(y.slice(3,4).repeat(2),16),_.toColor(u,d,g);case 5:return u=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),g=parseInt(y.slice(3,4).repeat(2),16),h=parseInt(y.slice(4,5).repeat(2),16),_.toColor(u,d,g,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 u=parseInt(k[1]),d=parseInt(k[2]),g=parseInt(k[3]),h=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),_.toColor(u,d,g,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),[u,d,g,h]=p.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(u,d,g,h),css:y}}}(x||(o.css=x={})),function(n){function p(w,y,k){const m=w/255,E=y/255,A=k/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(A<=.03928?A/12.92:Math.pow((A+.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 E=y>>24&255,A=y>>16&255,I=y>>8&255;let B=k>>24&255,P=k>>16&255,N=k>>8&255,z=s(v.relativeLuminance2(B,P,N),v.relativeLuminance2(E,A,I));for(;z<m&&(B>0||P>0||N>0);)B-=Math.max(0,Math.ceil(.1*B)),P-=Math.max(0,Math.ceil(.1*P)),N-=Math.max(0,Math.ceil(.1*N)),z=s(v.relativeLuminance2(B,P,N),v.relativeLuminance2(E,A,I));return(B<<24|P<<16|N<<8|255)>>>0}function w(y,k,m){const E=y>>24&255,A=y>>16&255,I=y>>8&255;let B=k>>24&255,P=k>>16&255,N=k>>8&255,z=s(v.relativeLuminance2(B,P,N),v.relativeLuminance2(E,A,I));for(;z<m&&(B<255||P<255||N<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),P=Math.min(255,P+Math.ceil(.1*(255-P))),N=Math.min(255,N+Math.ceil(.1*(255-N))),z=s(v.relativeLuminance2(B,P,N),v.relativeLuminance2(E,A,I));return(B<<24|P<<16|N<<8|255)>>>0}n.blend=function(y,k){if(h=(255&k)/255,h===1)return k;const m=k>>24&255,E=k>>16&255,A=k>>8&255,I=y>>24&255,B=y>>16&255,P=y>>8&255;return u=I+Math.round((m-I)*h),d=B+Math.round((E-B)*h),g=P+Math.round((A-P)*h),_.toRgba(u,d,g)},n.ensureContrastRatio=function(y,k,m){const E=v.relativeLuminance(y>>8),A=v.relativeLuminance(k>>8);if(s(E,A)<m){if(A<E){const P=p(y,k,m),N=s(E,v.relativeLuminance(P>>8));if(N<m){const z=w(y,k,m);return N>s(E,v.relativeLuminance(z>>8))?P:z}return P}const I=w(y,k,m),B=s(E,v.relativeLuminance(I>>8));if(B<m){const P=p(y,k,m);return B>s(E,v.relativeLuminance(P>>8))?I:P}return I}},n.reduceLuminance=p,n.increaseLuminance=w,n.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}}(c||(o.rgba=c={})),o.toPaddedHex=l,o.contrastRatio=s},8969:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const d=u(844),g=u(2585),h=u(4348),_=u(7866),S=u(744),x=u(7302),v=u(6975),c=u(8460),l=u(1753),s=u(1480),n=u(7994),p=u(9282),w=u(5435),y=u(5981),k=u(2660);let m=!1;class E extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new c.EventEmitter),this._onScroll.event(I=>{var B;(B=this._onScrollApi)==null||B.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 B in I)this.optionsService.options[B]=I[B]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new c.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new c.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new c.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new x.OptionsService(I)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(l.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(n.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(g.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,c.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,c.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,c.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,c.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(B=>{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(B=>{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((B,P)=>this._inputHandler.parse(B,P))),this.register((0,c.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,B){this._writeBuffer.write(I,B)}writeSync(I,B){this._logService.logLevel<=g.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(I,B)}input(I,B=!0){this.coreService.triggerDataEvent(I,B)}resize(I,B){isNaN(I)||isNaN(B)||(I=Math.max(I,S.MINIMUM_COLS),B=Math.max(B,S.MINIMUM_ROWS),this._bufferService.resize(I,B))}scroll(I,B=!1){this._bufferService.scroll(I,B)}scrollLines(I,B,P){this._bufferService.scrollLines(I,B,P)}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 B=I-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(I,B){return this._inputHandler.registerEscHandler(I,B)}registerDcsHandler(I,B){return this._inputHandler.registerDcsHandler(I,B)}registerCsiHandler(I,B){return this._inputHandler.registerCsiHandler(I,B)}registerOscHandler(I,B){return this._inputHandler.registerOscHandler(I,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?I=B.backend==="conpty"&&B.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 B of I)B.dispose()})}}}o.CoreTerminal=E},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=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const g=[];for(let h=0;h<this._listeners.length;h++)g.push(this._listeners[h]);for(let h=0;h<g.length;h++)g[h].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(u,d){return u(g=>d.fire(g))},o.runAndSubscribe=function(u,d){return d(void 0),u(g=>d(g))}},5435:function(C,o,u){var d=this&&this.__decorate||function(H,b,T,D){var M,j=arguments.length,U=j<3?b:D===null?D=Object.getOwnPropertyDescriptor(b,T):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(H,b,T,D);else for(var Z=H.length-1;Z>=0;Z--)(M=H[Z])&&(U=(j<3?M(U):j>3?M(b,T,U):M(b,T))||U);return j>3&&U&&Object.defineProperty(b,T,U),U},g=this&&this.__param||function(H,b){return function(T,D){b(T,D,H)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const h=u(2584),_=u(7116),S=u(2015),x=u(844),v=u(482),c=u(8437),l=u(8460),s=u(643),n=u(511),p=u(3734),w=u(2585),y=u(1480),k=u(6242),m=u(6351),E=u(5941),A={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function B(H,b){if(H>24)return b.setWinLines||!1;switch(H){case 1:return!!b.restoreWin;case 2:return!!b.minimizeWin;case 3:return!!b.setWinPosition;case 4:return!!b.setWinSizePixels;case 5:return!!b.raiseWin;case 6:return!!b.lowerWin;case 7:return!!b.refreshWin;case 8:return!!b.setWinSizeChars;case 9:return!!b.maximizeWin;case 10:return!!b.fullscreenWin;case 11:return!!b.getWinState;case 13:return!!b.getWinPosition;case 14:return!!b.getWinSizePixels;case 15:return!!b.getScreenSizePixels;case 16:return!!b.getCellSizePixels;case 18:return!!b.getWinSizeChars;case 19:return!!b.getScreenSizeChars;case 20:return!!b.getIconTitle;case 21:return!!b.getWinTitle;case 22:return!!b.pushTitle;case 23:return!!b.popTitle;case 24:return!!b.setWinLines}return!1}var P;(function(H){H[H.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",H[H.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let N=0;class z extends x.Disposable{getAttrData(){return this._curAttrData}constructor(b,T,D,M,j,U,Z,q,O=new S.EscapeSequenceParser){super(),this._bufferService=b,this._charsetService=T,this._coreService=D,this._logService=M,this._optionsService=j,this._oscLinkService=U,this._coreMouseService=Z,this._unicodeService=q,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=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.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 K(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(R=>this._activeBuffer=R.activeBuffer)),this._parser.setCsiHandlerFallback((R,W)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(R),params:W.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,W,F)=>{this._logService.debug("Unknown OSC code: ",{identifier:R,action:W,data:F})}),this._parser.setDcsHandlerFallback((R,W,F)=>{W==="HOOK"&&(F=F.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(R),action:W,payload:F})}),this._parser.setPrintHandler((R,W,F)=>this.print(R,W,F)),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,W)=>this.requestStatusString(R,W)))}_preserveStack(b,T,D,M){this._parseStack.paused=!0,this._parseStack.cursorStartX=b,this._parseStack.cursorStartY=T,this._parseStack.decodedLength=D,this._parseStack.position=M}_logSlowResolvingAsync(b){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([b,new Promise((T,D)=>setTimeout(()=>D("#SLOW_TIMEOUT"),5e3))]).catch(T=>{if(T!=="#SLOW_TIMEOUT")throw T;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(b,T){let D,M=this._activeBuffer.x,j=this._activeBuffer.y,U=0;const Z=this._parseStack.paused;if(Z){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,T))return this._logSlowResolvingAsync(D),D;M=this._parseStack.cursorStartX,j=this._parseStack.cursorStartY,this._parseStack.paused=!1,b.length>I&&(U=this._parseStack.position+I)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof b=="string"?` "${b}"`:` "${Array.prototype.map.call(b,R=>String.fromCharCode(R)).join("")}"`),typeof b=="string"?b.split("").map(R=>R.charCodeAt(0)):b),this._parseBuffer.length<b.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(b.length,I))),Z||this._dirtyRowTracker.clearRange(),b.length>I)for(let R=U;R<b.length;R+=I){const W=R+I<b.length?R+I:b.length,F=typeof b=="string"?this._stringDecoder.decode(b.substring(R,W),this._parseBuffer):this._utf8Decoder.decode(b.subarray(R,W),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,F))return this._preserveStack(M,j,F,R),this._logSlowResolvingAsync(D),D}else if(!Z){const R=typeof b=="string"?this._stringDecoder.decode(b,this._parseBuffer):this._utf8Decoder.decode(b,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,R))return this._preserveStack(M,j,R,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===M&&this._activeBuffer.y===j||this._onCursorMove.fire();const q=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(q,this._bufferService.rows-1))}print(b,T,D){let M,j;const U=this._charsetService.charset,Z=this._optionsService.rawOptions.screenReaderMode,q=this._bufferService.cols,O=this._coreService.decPrivateModes.wraparound,R=this._coreService.modes.insertMode,W=this._curAttrData;let F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-T>0&&F.getWidth(this._activeBuffer.x-1)===2&&F.setCellFromCodepoint(this._activeBuffer.x-1,0,1,W);let Y=this._parser.precedingJoinState;for(let X=T;X<D;++X){if(M=b[X],M<127&&U){const Me=U[String.fromCharCode(M)];Me&&(M=Me.charCodeAt(0))}const te=this._unicodeService.charProperties(M,Y);j=y.UnicodeService.extractWidth(te);const de=y.UnicodeService.extractShouldJoin(te),fe=de?y.UnicodeService.extractWidth(Y):0;if(Y=te,Z&&this._onA11yChar.fire((0,v.stringFromCodePoint)(M)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+j-fe>q){if(O){const Me=F;let J=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),F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),fe>0&&F instanceof c.BufferLine&&F.copyCellsFrom(Me,J,0,fe,!1);J<q;)Me.setCellFromCodepoint(J++,0,1,W)}else if(this._activeBuffer.x=q-1,j===2)continue}if(de&&this._activeBuffer.x){const Me=F.getWidth(this._activeBuffer.x-1)?1:2;F.addCodepointToCell(this._activeBuffer.x-Me,M,j);for(let J=j-fe;--J>=0;)F.setCellFromCodepoint(this._activeBuffer.x++,0,0,W)}else if(R&&(F.insertCells(this._activeBuffer.x,j-fe,this._activeBuffer.getNullCell(W)),F.getWidth(q-1)===2&&F.setCellFromCodepoint(q-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,W)),F.setCellFromCodepoint(this._activeBuffer.x++,M,j,W),j>0)for(;--j;)F.setCellFromCodepoint(this._activeBuffer.x++,0,0,W)}this._parser.precedingJoinState=Y,this._activeBuffer.x<q&&D-T>0&&F.getWidth(this._activeBuffer.x)===0&&!F.hasContent(this._activeBuffer.x)&&F.setCellFromCodepoint(this._activeBuffer.x,0,1,W),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(b,T){return b.final!=="t"||b.prefix||b.intermediates?this._parser.registerCsiHandler(b,T):this._parser.registerCsiHandler(b,D=>!B(D.params[0],this._optionsService.rawOptions.windowOptions)||T(D))}registerDcsHandler(b,T){return this._parser.registerDcsHandler(b,new m.DcsHandler(T))}registerEscHandler(b,T){return this._parser.registerEscHandler(b,T)}registerOscHandler(b,T){return this._parser.registerOscHandler(b,new k.OscHandler(T))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var b;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&&((b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&b.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);T.hasWidth(this._activeBuffer.x)&&!T.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const b=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-b),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(b=this._bufferService.cols-1){this._activeBuffer.x=Math.min(b,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(b,T){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=b,this._activeBuffer.y=this._activeBuffer.scrollTop+T):(this._activeBuffer.x=b,this._activeBuffer.y=T),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(b,T){this._restrictCursor(),this._setCursor(this._activeBuffer.x+b,this._activeBuffer.y+T)}cursorUp(b){const T=this._activeBuffer.y-this._activeBuffer.scrollTop;return T>=0?this._moveCursor(0,-Math.min(T,b.params[0]||1)):this._moveCursor(0,-(b.params[0]||1)),!0}cursorDown(b){const T=this._activeBuffer.scrollBottom-this._activeBuffer.y;return T>=0?this._moveCursor(0,Math.min(T,b.params[0]||1)):this._moveCursor(0,b.params[0]||1),!0}cursorForward(b){return this._moveCursor(b.params[0]||1,0),!0}cursorBackward(b){return this._moveCursor(-(b.params[0]||1),0),!0}cursorNextLine(b){return this.cursorDown(b),this._activeBuffer.x=0,!0}cursorPrecedingLine(b){return this.cursorUp(b),this._activeBuffer.x=0,!0}cursorCharAbsolute(b){return this._setCursor((b.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(b){return this._setCursor(b.length>=2?(b.params[1]||1)-1:0,(b.params[0]||1)-1),!0}charPosAbsolute(b){return this._setCursor((b.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(b){return this._moveCursor(b.params[0]||1,0),!0}linePosAbsolute(b){return this._setCursor(this._activeBuffer.x,(b.params[0]||1)-1),!0}vPositionRelative(b){return this._moveCursor(0,b.params[0]||1),!0}hVPosition(b){return this.cursorPosition(b),!0}tabClear(b){const T=b.params[0];return T===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:T===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=b.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=b.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(b){const T=b.params[0];return T===1&&(this._curAttrData.bg|=536870912),T!==2&&T!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(b,T,D,M=!1,j=!1){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);U.replaceCells(T,D,this._activeBuffer.getNullCell(this._eraseAttrData()),j),M&&(U.isWrapped=!1)}_resetBufferLine(b,T=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),T),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+b),D.isWrapped=!1)}eraseInDisplay(b,T=!1){let D;switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);D<this._bufferService.rows;D++)this._resetBufferLine(D,T);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,T),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,T);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,T);this._dirtyRowTracker.markDirty(0);break;case 3:const M=this._activeBuffer.lines.length-this._bufferService.rows;M>0&&(this._activeBuffer.lines.trimStart(M),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-M,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-M,0),this._onScroll.fire(0))}return!0}eraseInLine(b,T=!1){switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,T);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,T)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(b){this._restrictCursor();let T=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,j=this._bufferService.rows-1+this._activeBuffer.ybase-M+1;for(;T--;)this._activeBuffer.lines.splice(j-1,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(b){this._restrictCursor();let T=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y;let M;for(M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-M;T--;)this._activeBuffer.lines.splice(D,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}insertChars(b){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.insertCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(b){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.deleteCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(b){let T=b.params[0]||1;for(;T--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(b){let T=b.params[0]||1;for(;T--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(c.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=b.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.deleteCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=b.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.insertCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=b.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.insertCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=b.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.deleteCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData())),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(b){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(b.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(b){const T=this._parser.precedingJoinState;if(!T)return!0;const D=b.params[0]||1,M=y.UnicodeService.extractWidth(T),j=this._activeBuffer.x-M,U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(j),Z=new Uint32Array(U.length*D);let q=0;for(let R=0;R<U.length;){const W=U.codePointAt(R)||0;Z[q++]=W,R+=W>65535?2:1}let O=q;for(let R=1;R<D;++R)Z.copyWithin(O,0,q),O+=q;return this.print(Z,0,O),!0}sendDeviceAttributesPrimary(b){return b.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(b){return b.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(b.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(b){return(this._optionsService.rawOptions.termName+"").indexOf(b)===0}setMode(b){for(let T=0;T<b.length;T++)switch(b.params[T]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(b){for(let T=0;T<b.length;T++)switch(b.params[T]){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(b){for(let T=0;T<b.length;T++)switch(b.params[T]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(b){for(let T=0;T<b.length;T++)switch(b.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006: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(),b.params[T]===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(b,T){const D=this._coreService.decPrivateModes,{activeProtocol:M,activeEncoding:j}=this._coreMouseService,U=this._coreService,{buffers:Z,cols:q}=this._bufferService,{active:O,alt:R}=Z,W=this._optionsService.rawOptions,F=de=>de?1:2,Y=b.params[0];return X=Y,te=T?Y===2?4:Y===4?F(U.modes.insertMode):Y===12?3:Y===20?F(W.convertEol):0:Y===1?F(D.applicationCursorKeys):Y===3?W.windowOptions.setWinLines?q===80?2:q===132?1:0:0:Y===6?F(D.origin):Y===7?F(D.wraparound):Y===8?3:Y===9?F(M==="X10"):Y===12?F(W.cursorBlink):Y===25?F(!U.isCursorHidden):Y===45?F(D.reverseWraparound):Y===66?F(D.applicationKeypad):Y===67?4:Y===1e3?F(M==="VT200"):Y===1002?F(M==="DRAG"):Y===1003?F(M==="ANY"):Y===1004?F(D.sendFocus):Y===1005?4:Y===1006?F(j==="SGR"):Y===1015?4:Y===1016?F(j==="SGR_PIXELS"):Y===1048?1:Y===47||Y===1047||Y===1049?F(O===R):Y===2004?F(D.bracketedPasteMode):0,U.triggerDataEvent(`${h.C0.ESC}[${T?"":"?"}${X};${te}$y`),!0;var X,te}_updateAttrColor(b,T,D,M,j){return T===2?(b|=50331648,b&=-16777216,b|=p.AttributeData.fromColorRGB([D,M,j])):T===5&&(b&=-50331904,b|=33554432|255&D),b}_extractColor(b,T,D){const M=[0,0,-1,0,0,0];let j=0,U=0;do{if(M[U+j]=b.params[T+U],b.hasSubParams(T+U)){const Z=b.getSubParams(T+U);let q=0;do M[1]===5&&(j=1),M[U+q+1+j]=Z[q];while(++q<Z.length&&q+U+1+j<M.length);break}if(M[1]===5&&U+j>=2||M[1]===2&&U+j>=5)break;M[1]&&(j=1)}while(++U+T<b.length&&U+j<M.length);for(let Z=2;Z<M.length;++Z)M[Z]===-1&&(M[Z]=0);switch(M[0]){case 38:D.fg=this._updateAttrColor(D.fg,M[1],M[3],M[4],M[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,M[1],M[3],M[4],M[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,M[1],M[3],M[4],M[5])}return U}_processUnderline(b,T){T.extended=T.extended.clone(),(!~b||b>5)&&(b=1),T.extended.underlineStyle=b,T.fg|=268435456,b===0&&(T.fg&=-268435457),T.updateExtended()}_processSGR0(b){b.fg=c.DEFAULT_ATTR_DATA.fg,b.bg=c.DEFAULT_ATTR_DATA.bg,b.extended=b.extended.clone(),b.extended.underlineStyle=0,b.extended.underlineColor&=-67108864,b.updateExtended()}charAttributes(b){if(b.length===1&&b.params[0]===0)return this._processSGR0(this._curAttrData),!0;const T=b.length;let D;const M=this._curAttrData;for(let j=0;j<T;j++)D=b.params[j],D>=30&&D<=37?(M.fg&=-50331904,M.fg|=16777216|D-30):D>=40&&D<=47?(M.bg&=-50331904,M.bg|=16777216|D-40):D>=90&&D<=97?(M.fg&=-50331904,M.fg|=16777224|D-90):D>=100&&D<=107?(M.bg&=-50331904,M.bg|=16777224|D-100):D===0?this._processSGR0(M):D===1?M.fg|=134217728:D===3?M.bg|=67108864:D===4?(M.fg|=268435456,this._processUnderline(b.hasSubParams(j)?b.getSubParams(j)[0]:1,M)):D===5?M.fg|=536870912:D===7?M.fg|=67108864:D===8?M.fg|=1073741824:D===9?M.fg|=2147483648:D===2?M.bg|=134217728:D===21?this._processUnderline(2,M):D===22?(M.fg&=-134217729,M.bg&=-134217729):D===23?M.bg&=-67108865:D===24?(M.fg&=-268435457,this._processUnderline(0,M)):D===25?M.fg&=-536870913:D===27?M.fg&=-67108865:D===28?M.fg&=-1073741825:D===29?M.fg&=2147483647:D===39?(M.fg&=-67108864,M.fg|=16777215&c.DEFAULT_ATTR_DATA.fg):D===49?(M.bg&=-67108864,M.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?j+=this._extractColor(b,j,M):D===53?M.bg|=1073741824:D===55?M.bg&=-1073741825:D===59?(M.extended=M.extended.clone(),M.extended.underlineColor=-1,M.updateExtended()):D===100?(M.fg&=-67108864,M.fg|=16777215&c.DEFAULT_ATTR_DATA.fg,M.bg&=-67108864,M.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(b){switch(b.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const T=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${T};${D}R`)}return!0}deviceStatusPrivate(b){if(b.params[0]===6){const T=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${T};${D}R`)}return!0}softReset(b){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=c.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(b){const T=b.params[0]||1;switch(T){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 D=T%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(b){const T=b.params[0]||1;let D;return(b.length<2||(D=b.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>T&&(this._activeBuffer.scrollTop=T-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(b){if(!B(b.params[0],this._optionsService.rawOptions.windowOptions))return!0;const T=b.length>1?b.params[1]:0;switch(b.params[0]){case 14:T!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.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:T!==0&&T!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),T!==0&&T!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:T!==0&&T!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),T!==0&&T!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(b){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(b){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(b){return this._windowTitle=b,this._onTitleChange.fire(b),!0}setIconName(b){return this._iconName=b,!0}setOrReportIndexedColor(b){const T=[],D=b.split(";");for(;D.length>1;){const M=D.shift(),j=D.shift();if(/^\d+$/.exec(M)){const U=parseInt(M);if(G(U))if(j==="?")T.push({type:0,index:U});else{const Z=(0,E.parseColor)(j);Z&&T.push({type:1,index:U,color:Z})}}}return T.length&&this._onColor.fire(T),!0}setHyperlink(b){const T=b.split(";");return!(T.length<2)&&(T[1]?this._createHyperlink(T[0],T[1]):!T[0]&&this._finishHyperlink())}_createHyperlink(b,T){this._getCurrentLinkId()&&this._finishHyperlink();const D=b.split(":");let M;const j=D.findIndex(U=>U.startsWith("id="));return j!==-1&&(M=D[j].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:M,uri:T}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(b,T){const D=b.split(";");for(let M=0;M<D.length&&!(T>=this._specialColors.length);++M,++T)if(D[M]==="?")this._onColor.fire([{type:0,index:this._specialColors[T]}]);else{const j=(0,E.parseColor)(D[M]);j&&this._onColor.fire([{type:1,index:this._specialColors[T],color:j}])}return!0}setOrReportFgColor(b){return this._setOrReportSpecialColor(b,0)}setOrReportBgColor(b){return this._setOrReportSpecialColor(b,1)}setOrReportCursorColor(b){return this._setOrReportSpecialColor(b,2)}restoreIndexedColor(b){if(!b)return this._onColor.fire([{type:2}]),!0;const T=[],D=b.split(";");for(let M=0;M<D.length;++M)if(/^\d+$/.exec(D[M])){const j=parseInt(D[M]);G(j)&&T.push({type:2,index:j})}return T.length&&this._onColor.fire(T),!0}restoreFgColor(b){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(b){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(b){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(b){return b.length!==2?(this.selectDefaultCharset(),!0):(b[0]==="/"||this._charsetService.setgCharset(A[b[0]],_.CHARSETS[b[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 b=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,b,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=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(b){return this._charsetService.setgLevel(b),!0}screenAlignmentPattern(){const b=new n.CellData;b.content=4194373,b.fg=this._curAttrData.fg,b.bg=this._curAttrData.bg,this._setCursor(0,0);for(let T=0;T<this._bufferService.rows;++T){const D=this._activeBuffer.ybase+this._activeBuffer.y+T,M=this._activeBuffer.lines.get(D);M&&(M.fill(b),M.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(b,T){const D=this._bufferService.buffer,M=this._optionsService.rawOptions;return(j=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${j}${h.C0.ESC}\\`),!0))(b==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:b==='"p'?'P1$r61;1"p':b==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:b==="m"?"P1$r0m":b===" q"?`P1$r${{block:2,underline:4,bar:6}[M.cursorStyle]-(M.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(b,T){this._dirtyRowTracker.markRangeDirty(b,T)}}o.InputHandler=z;let K=class{constructor(H){this._bufferService=H,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(H){H<this.start?this.start=H:H>this.end&&(this.end=H)}markRangeDirty(H,b){H>b&&(N=H,H=b,b=N),H<this.start&&(this.start=H),b>this.end&&(this.end=b)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G(H){return 0<=H&&H<256}K=d([g(0,w.IBufferService)],K)},844:(C,o)=>{function u(d){for(const g of d)g.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 g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)==null||g.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=u,o.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,h,_){this._data[g]||(this._data[g]={}),this._data[g][h]=_}get(g,h){return this._data[g]?this._data[g][h]:void 0}clear(){this._data={}}}o.TwoKeyMap=u,o.FourKeyMap=class{constructor(){this._data=new u}set(d,g,h,_,S){this._data.get(d,g)||this._data.set(d,g,new u),this._data.get(d,g).set(h,_,S)}get(d,g,h,_){var S;return(S=this._data.get(d,g))==null?void 0:S.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 u=o.isNode?"node":navigator.userAgent,d=o.isNode?"node":navigator.platform;o.isFirefox=u.includes("Firefox"),o.isLegacyEdge=u.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(u),o.getSafariVersion=function(){if(!o.isSafari)return 0;const g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[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(u)},6106:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let u=0;o.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const g=this._getKey(d);if(g===void 0||(u=this._search(g),u===-1)||this._getKey(this._array[u])!==g)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===g);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,g){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do g(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let g=0,h=this._array.length-1;for(;h>=g;){let _=g+h>>1;const S=this._getKey(this._array[_]);if(S>d)h=_-1;else{if(!(S<d)){for(;_>0&&this._getKey(this._array[_-1])===d;)_--;return _}g=_+1}}return g}}},7226:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const d=u(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let x=0,v=0,c=S.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=S.timeRemaining(),1.5*v>l)return c-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(c-x))}ms`),void this._start();c=l}this.clear()}}class h extends g{_requestCallback(S){return setTimeout(()=>S(this._createDeadline(16)))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const x=Date.now()+S;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=h,o.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_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,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const d=u(643);o.updateWindowsModeWrappedState=function(g){const h=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),_=h==null?void 0:h.get(g.cols-1),S=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);S&&_&&(S.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 u{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 u;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=u;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,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const d=u(6349),g=u(7226),h=u(3734),_=u(8437),S=u(4634),x=u(511),v=u(643),c=u(4863),l=u(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 g.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,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(p.length>0){const w=(0,S.reflowLargerCreateNewLayout)(this.lines,p);(0,S.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 E=[m];for(;m.isWrapped&&k>0;)m=this.lines.get(--k),E.unshift(m);const A=this.ybase+this.y;if(A>=k&&A<k+E.length)continue;const I=E[E.length-1].getTrimmedLength(),B=(0,S.reflowSmallerGetNewLineLengths)(E,this._cols,s),P=B.length-E.length;let N;N=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const z=[];for(let D=0;D<P;D++){const M=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);z.push(M)}z.length>0&&(w.push({start:k+E.length+y,newLines:z}),y+=z.length),E.push(...z);let K=B.length-1,G=B[K];G===0&&(K--,G=B[K]);let H=E.length-P-1,b=I;for(;H>=0;){const D=Math.min(b,G);if(E[K]===void 0)break;if(E[K].copyCellsFrom(E[H],b-D,G-D,D,!0),G-=D,G===0&&(K--,G=B[K]),b-=D,b===0){H--;const M=Math.max(H,0);b=(0,S.getWrappedLineTrimmedLength)(E,M,this._cols)}}for(let D=0;D<E.length;D++)B[D]<s&&E[D].setCell(B[D],p);let T=P-N;for(;T-- >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+P,this.ybase+n-1)}if(w.length>0){const k=[],m=[];for(let K=0;K<this.lines.length;K++)m.push(this.lines.get(K));const E=this.lines.length;let A=E-1,I=0,B=w[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let P=0;for(let K=Math.min(this.lines.maxLength-1,E+y-1);K>=0;K--)if(B&&B.start>A+P){for(let G=B.newLines.length-1;G>=0;G--)this.lines.set(K--,B.newLines[G]);K++,k.push({index:A+1,amount:B.newLines.length}),P+=B.newLines.length,B=w[++I]}else this.lines.set(K,m[A--]);let N=0;for(let K=k.length-1;K>=0;K--)k[K].index+=N,this.lines.onInsertEmitter.fire(k[K]),N+=k[K].amount;const z=Math.max(0,E+y-this.lines.maxLength);z>0&&this.lines.onTrimEmitter.fire(z)}}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 c.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,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const d=u(3734),g=u(511),h=u(643),_=u(482);o.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let S=0;class x{constructor(c,l,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*c);const n=l||g.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let p=0;p<c;++p)this.setCell(p,n);this.length=c}get(c){const l=this._data[3*c+0],s=2097151&l;return[this._data[3*c+1],2097152&l?this._combined[c]:s?(0,_.stringFromCodePoint)(s):"",l>>22,2097152&l?this._combined[c].charCodeAt(this._combined[c].length-1):s]}set(c,l){this._data[3*c+1]=l[h.CHAR_DATA_ATTR_INDEX],l[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[c]=l[1],this._data[3*c+0]=2097152|c|l[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*c+0]=l[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(c){return this._data[3*c+0]>>22}hasWidth(c){return 12582912&this._data[3*c+0]}getFg(c){return this._data[3*c+1]}getBg(c){return this._data[3*c+2]}hasContent(c){return 4194303&this._data[3*c+0]}getCodePoint(c){const l=this._data[3*c+0];return 2097152&l?this._combined[c].charCodeAt(this._combined[c].length-1):2097151&l}isCombined(c){return 2097152&this._data[3*c+0]}getString(c){const l=this._data[3*c+0];return 2097152&l?this._combined[c]:2097151&l?(0,_.stringFromCodePoint)(2097151&l):""}isProtected(c){return 536870912&this._data[3*c+2]}loadCell(c,l){return S=3*c,l.content=this._data[S+0],l.fg=this._data[S+1],l.bg=this._data[S+2],2097152&l.content&&(l.combinedData=this._combined[c]),268435456&l.bg&&(l.extended=this._extendedAttrs[c]),l}setCell(c,l){2097152&l.content&&(this._combined[c]=l.combinedData),268435456&l.bg&&(this._extendedAttrs[c]=l.extended),this._data[3*c+0]=l.content,this._data[3*c+1]=l.fg,this._data[3*c+2]=l.bg}setCellFromCodepoint(c,l,s,n){268435456&n.bg&&(this._extendedAttrs[c]=n.extended),this._data[3*c+0]=l|s<<22,this._data[3*c+1]=n.fg,this._data[3*c+2]=n.bg}addCodepointToCell(c,l,s){let n=this._data[3*c+0];2097152&n?this._combined[c]+=(0,_.stringFromCodePoint)(l):2097151&n?(this._combined[c]=(0,_.stringFromCodePoint)(2097151&n)+(0,_.stringFromCodePoint)(l),n&=-2097152,n|=2097152):n=l|4194304,s&&(n&=-12582913,n|=s<<22),this._data[3*c+0]=n}insertCells(c,l,s){if((c%=this.length)&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,s),l<this.length-c){const n=new g.CellData;for(let p=this.length-c-l-1;p>=0;--p)this.setCell(c+l+p,this.loadCell(c+p,n));for(let p=0;p<l;++p)this.setCell(c+p,s)}else for(let n=c;n<this.length;++n)this.setCell(n,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(c,l,s){if(c%=this.length,l<this.length-c){const n=new g.CellData;for(let p=0;p<this.length-c-l;++p)this.setCell(c+p,this.loadCell(c+l+p,n));for(let p=this.length-l;p<this.length;++p)this.setCell(p,s)}else for(let n=c;n<this.length;++n)this.setCell(n,s);c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,s),this.getWidth(c)!==0||this.hasContent(c)||this.setCellFromCodepoint(c,0,1,s)}replaceCells(c,l,s,n=!1){if(n)for(c&&this.getWidth(c-1)===2&&!this.isProtected(c-1)&&this.setCellFromCodepoint(c-1,0,1,s),l<this.length&&this.getWidth(l-1)===2&&!this.isProtected(l)&&this.setCellFromCodepoint(l,0,1,s);c<l&&c<this.length;)this.isProtected(c)||this.setCell(c,s),c++;else for(c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,s),l<this.length&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l,0,1,s);c<l&&c<this.length;)this.setCell(c++,s)}resize(c,l){if(c===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*c;if(c>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<c;++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>=c&&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>=c&&delete this._extendedAttrs[y]}}return this.length=c,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const c=new Uint32Array(this._data.length);return c.set(this._data),this._data=c,1}return 0}fill(c,l=!1){if(l)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,c);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,c)}}copyFrom(c){this.length!==c.length?this._data=new Uint32Array(c._data):this._data.set(c._data),this.length=c.length,this._combined={};for(const l in c._combined)this._combined[l]=c._combined[l];this._extendedAttrs={};for(const l in c._extendedAttrs)this._extendedAttrs[l]=c._extendedAttrs[l];this.isWrapped=c.isWrapped}clone(){const c=new x(0);c._data=new Uint32Array(this._data),c.length=this.length;for(const l in this._combined)c._combined[l]=this._combined[l];for(const l in this._extendedAttrs)c._extendedAttrs[l]=this._extendedAttrs[l];return c.isWrapped=this.isWrapped,c}getTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0])return c+(this._data[3*c+0]>>22);return 0}getNoBgTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0]||50331648&this._data[3*c+2])return c+(this._data[3*c+0]>>22);return 0}copyCellsFrom(c,l,s,n,p){const w=c._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]=c._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]=c._extendedAttrs[l+k])}const y=Object.keys(c._combined);for(let k=0;k<y.length;k++){const m=parseInt(y[k],10);m>=l&&(this._combined[m-l+s]=c._combined[m])}}translateToString(c,l,s,n){l=l??0,s=s??this.length,c&&(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(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(C,o)=>{function u(d,g,h){if(g===d.length-1)return d[g].getTrimmedLength();const _=!d[g].hasContent(h-1)&&d[g].getWidth(h-1)===1,S=d[g+1].getWidth(0)===2;return _&&S?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,g,h,_,S){const x=[];for(let v=0;v<d.length-1;v++){let c=v,l=d.get(++c);if(!l.isWrapped)continue;const s=[d.get(v)];for(;c<d.length&&l.isWrapped;)s.push(l),l=d.get(++c);if(_>=v&&_<c){v+=s.length-1;continue}let n=0,p=u(s,n,g),w=1,y=0;for(;w<s.length;){const m=u(s,w,g),E=m-y,A=h-p,I=Math.min(E,A);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,S))}s[n].replaceCells(p,h,S);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,g){const h=[];let _=0,S=g[_],x=0;for(let v=0;v<d.length;v++)if(S===v){const c=g[++_];d.onDeleteEmitter.fire({index:v-x,amount:c}),v+=c-1,x+=c,S=g[++_]}else h.push(v);return{layout:h,countRemoved:x}},o.reflowLargerApplyNewLayout=function(d,g){const h=[];for(let _=0;_<g.length;_++)h.push(d.get(g[_]));for(let _=0;_<h.length;_++)d.set(_,h[_]);d.length=g.length},o.reflowSmallerGetNewLineLengths=function(d,g,h){const _=[],S=d.map((l,s)=>u(d,s,g)).reduce((l,s)=>l+s);let x=0,v=0,c=0;for(;c<S;){if(S-c<h){_.push(S-c);break}x+=h;const l=u(d,v,g);x>l&&(x-=l,v++);const s=d[v].getWidth(x-1)===2;s&&x--;const n=s?h-1:h;_.push(n),c+=n}return _},o.getWrappedLineTrimmedLength=u},5295:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const d=u(8460),g=u(844),h=u(9092);class _ extends g.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,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const d=u(482),g=u(643),h=u(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[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(x[g.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(x[g.CHAR_DATA_CHAR_INDEX].length===2){const c=x[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&c<=56319){const l=x[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(c-55296)+l-56320+65536|x[g.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=x[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[g.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=x[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[g.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,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const d=u(8460),g=u(844);class h{get id(){return this._id}constructor(S){this.line=S,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,g.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}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 u,d,g;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=""}(u||(o.C0=u={})),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=`${u.ESC}\\`}(g||(o.C1_ESCAPED=g={}))},7399:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const d=u(2584),g={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,_,S,x){const v={type:0,cancel:!1,key:void 0},c=(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;c?(v.key=d.C0.ESC+"[1;"+(c+1)+"D",v.key===d.C0.ESC+"[1;3D"&&(v.key=d.C0.ESC+(S?"b":"[1;5D"))):v.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(h.metaKey)break;c?(v.key=d.C0.ESC+"[1;"+(c+1)+"C",v.key===d.C0.ESC+"[1;3C"&&(v.key=d.C0.ESC+(S?"f":"[1;5C"))):v.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(h.metaKey)break;c?(v.key=d.C0.ESC+"[1;"+(c+1)+"A",S||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;c?(v.key=d.C0.ESC+"[1;"+(c+1)+"B",S||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=c?d.C0.ESC+"[3;"+(c+1)+"~":d.C0.ESC+"[3~";break;case 36:v.key=c?d.C0.ESC+"[1;"+(c+1)+"H":_?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:v.key=c?d.C0.ESC+"[1;"+(c+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;"+(c+1)+"~":v.key=d.C0.ESC+"[5~";break;case 34:h.shiftKey?v.type=3:h.ctrlKey?v.key=d.C0.ESC+"[6;"+(c+1)+"~":v.key=d.C0.ESC+"[6~";break;case 112:v.key=c?d.C0.ESC+"[1;"+(c+1)+"P":d.C0.ESC+"OP";break;case 113:v.key=c?d.C0.ESC+"[1;"+(c+1)+"Q":d.C0.ESC+"OQ";break;case 114:v.key=c?d.C0.ESC+"[1;"+(c+1)+"R":d.C0.ESC+"OR";break;case 115:v.key=c?d.C0.ESC+"[1;"+(c+1)+"S":d.C0.ESC+"OS";break;case 116:v.key=c?d.C0.ESC+"[15;"+(c+1)+"~":d.C0.ESC+"[15~";break;case 117:v.key=c?d.C0.ESC+"[17;"+(c+1)+"~":d.C0.ESC+"[17~";break;case 118:v.key=c?d.C0.ESC+"[18;"+(c+1)+"~":d.C0.ESC+"[18~";break;case 119:v.key=c?d.C0.ESC+"[19;"+(c+1)+"~":d.C0.ESC+"[19~";break;case 120:v.key=c?d.C0.ESC+"[20;"+(c+1)+"~":d.C0.ESC+"[20~";break;case 121:v.key=c?d.C0.ESC+"[21;"+(c+1)+"~":d.C0.ESC+"[21~";break;case 122:v.key=c?d.C0.ESC+"[23;"+(c+1)+"~":d.C0.ESC+"[23~";break;case 123:v.key=c?d.C0.ESC+"[24;"+(c+1)+"~":d.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(S&&!x||!h.altKey||h.metaKey)!S||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=g[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(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},o.utf32ToString=function(u,d=0,g=u.length){let h="";for(let _=d;_<g;++_){let S=u[_];S>65535?(S-=65536,h+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):h+=String.fromCharCode(S)}return h},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const g=u.length;if(!g)return 0;let h=0,_=0;if(this._interim){const S=u.charCodeAt(_++);56320<=S&&S<=57343?d[h++]=1024*(this._interim-55296)+S-56320+65536:(d[h++]=this._interim,d[h++]=S),this._interim=0}for(let S=_;S<g;++S){const x=u.charCodeAt(S);if(55296<=x&&x<=56319){if(++S>=g)return this._interim=x,h;const v=u.charCodeAt(S);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(u,d){const g=u.length;if(!g)return 0;let h,_,S,x,v=0,c=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,E=m-k;for(;l<E;){if(l>=g)return 0;if(y=u[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=g-4;let n=l;for(;n<g;){for(;!(!(n<s)||128&(h=u[n])||128&(_=u[n+1])||128&(S=u[n+2])||128&(x=u[n+3]));)d[v++]=h,d[v++]=_,d[v++]=S,d[v++]=x,n+=4;if(h=u[n++],h<128)d[v++]=h;else if((224&h)==192){if(n>=g)return this.interim[0]=h,v;if(_=u[n++],(192&_)!=128){n--;continue}if(c=(31&h)<<6|63&_,c<128){n--;continue}d[v++]=c}else if((240&h)==224){if(n>=g)return this.interim[0]=h,v;if(_=u[n++],(192&_)!=128){n--;continue}if(n>=g)return this.interim[0]=h,this.interim[1]=_,v;if(S=u[n++],(192&S)!=128){n--;continue}if(c=(15&h)<<12|(63&_)<<6|63&S,c<2048||c>=55296&&c<=57343||c===65279)continue;d[v++]=c}else if((248&h)==240){if(n>=g)return this.interim[0]=h,v;if(_=u[n++],(192&_)!=128){n--;continue}if(n>=g)return this.interim[0]=h,this.interim[1]=_,v;if(S=u[n++],(192&S)!=128){n--;continue}if(n>=g)return this.interim[0]=h,this.interim[1]=_,this.interim[2]=S,v;if(x=u[n++],(192&x)!=128){n--;continue}if(c=(7&h)<<18|(63&_)<<12|(63&S)<<6|63&x,c<65536||c>1114111)continue;d[v++]=c}}return v}}},225:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const d=u(1480),g=[[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 S=0;S<g.length;++S)_.fill(0,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?_[S]:function(x,v){let c,l=0,s=v.length-1;if(x<v[0][0]||x>v[s][1])return!1;for(;s>=l;)if(c=l+s>>1,x>v[c][1])l=c+1;else{if(!(x<v[c][0]))return!0;s=c-1}return!1}(S,h)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,x){let v=this.wcwidth(S),c=v===0&&x!==0;if(c){const l=d.UnicodeService.extractWidth(x);l===0?c=!1:l>v&&(v=l)}return d.UnicodeService.createPropertyValue(0,v,c)}}},5981:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const d=u(8460),g=u(844);class h extends g.Disposable{constructor(S){super(),this._action=S,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(S,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const c=this._callbacks.shift();c&&c()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,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+=S.length,this._writeBuffer.push(S),this._callbacks.push(x),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(x)}_innerWrite(S=0,x=!0){const v=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const c=this._writeBuffer[this._bufferOffset],l=this._action(c,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-=c.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 u=/^([\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 g(h,_){const S=h.toString(16),x=S.length<2?"0"+S:S;switch(_){case 4:return S[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 S=u.exec(_);if(S){const x=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/x*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/x*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/x*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),d.exec(_)&&[3,6,9,12].includes(_.length))){const S=_.length/3,x=[0,0,0];for(let v=0;v<3;++v){const c=parseInt(_.slice(S*v,S*v+S),16);x[v]=S===1?c<<4:S===2?c:S===3?c>>4:c>>8}return x}},o.toRgbString=function(h,_=16){const[S,x,v]=h;return`rgb:${g(S,_)}/${g(x,_)}/${g(v,_)}`}},5770:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const d=u(482),g=u(8742),h=u(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 c=this._handlers[x];return c.push(v),{dispose:()=>{const l=c.indexOf(v);l!==-1&&c.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 c=this._active.length-1;c>=0;c--)this._active[c].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(x,v,c){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(x,v,c);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(x,v,c))}unhook(x,v=!0){if(this._active.length){let c=!1,l=this._active.length-1,s=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,c=v,s=this._stack.fallThrough,this._stack.paused=!1),!s&&c===!1){for(;l>=0&&(c=this._active[l].unhook(x),c!==!0);l--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,c;l--}for(;l>=0;l--)if(c=this._active[l].unhook(!1),c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,c}else this._handlerFb(this._ident,"UNHOOK",x);this._active=_,this._ident=0}};const S=new g.Params;S.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=S,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():S,this._data="",this._hitLimit=!1}put(x,v,c){this._hitLimit||(this._data+=(0,d.utf32ToString)(x,v,c),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(c=>(this._params=S,this._data="",this._hitLimit=!1,c));return this._params=S,this._data="",this._hitLimit=!1,v}}},2015:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const d=u(844),g=u(8742),h=u(6242),_=u(6351);class S{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=S;const x=160;o.VT500_TRANSITION_TABLE=function(){const c=new S(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 c.setDefault(1,0),c.addMany(n,0,2,0),w)c.addMany([24,26,153,154],y,3,0),c.addMany(s(128,144),y,3,0),c.addMany(s(144,152),y,3,0),c.add(156,y,0,0),c.add(27,y,11,1),c.add(157,y,4,8),c.addMany([152,158,159],y,0,7),c.add(155,y,11,3),c.add(144,y,11,9);return c.addMany(p,0,3,0),c.addMany(p,1,3,1),c.add(127,1,0,1),c.addMany(p,8,0,8),c.addMany(p,3,3,3),c.add(127,3,0,3),c.addMany(p,4,3,4),c.add(127,4,0,4),c.addMany(p,6,3,6),c.addMany(p,5,3,5),c.add(127,5,0,5),c.addMany(p,2,3,2),c.add(127,2,0,2),c.add(93,1,4,8),c.addMany(n,8,5,8),c.add(127,8,5,8),c.addMany([156,27,24,26,7],8,6,0),c.addMany(s(28,32),8,0,8),c.addMany([88,94,95],1,0,7),c.addMany(n,7,0,7),c.addMany(p,7,0,7),c.add(156,7,0,0),c.add(127,7,0,7),c.add(91,1,11,3),c.addMany(s(64,127),3,7,0),c.addMany(s(48,60),3,8,4),c.addMany([60,61,62,63],3,9,4),c.addMany(s(48,60),4,8,4),c.addMany(s(64,127),4,7,0),c.addMany([60,61,62,63],4,0,6),c.addMany(s(32,64),6,0,6),c.add(127,6,0,6),c.addMany(s(64,127),6,0,0),c.addMany(s(32,48),3,9,5),c.addMany(s(32,48),5,9,5),c.addMany(s(48,64),5,0,6),c.addMany(s(64,127),5,7,0),c.addMany(s(32,48),4,9,5),c.addMany(s(32,48),1,9,2),c.addMany(s(32,48),2,9,2),c.addMany(s(48,127),2,10,0),c.addMany(s(48,80),1,10,0),c.addMany(s(81,88),1,10,0),c.addMany([89,90,92],1,10,0),c.addMany(s(96,127),1,10,0),c.add(80,1,11,9),c.addMany(p,9,0,9),c.add(127,9,0,9),c.addMany(s(28,32),9,0,9),c.addMany(s(32,48),9,9,12),c.addMany(s(48,60),9,8,10),c.addMany([60,61,62,63],9,9,10),c.addMany(p,11,0,11),c.addMany(s(32,128),11,0,11),c.addMany(s(28,32),11,0,11),c.addMany(p,10,0,10),c.add(127,10,0,10),c.addMany(s(28,32),10,0,10),c.addMany(s(48,60),10,8,10),c.addMany([60,61,62,63],10,0,11),c.addMany(s(32,48),10,9,12),c.addMany(p,12,0,12),c.add(127,12,0,12),c.addMany(s(28,32),12,0,12),c.addMany(s(32,48),12,9,12),c.addMany(s(48,64),12,0,11),c.addMany(s(64,127),12,12,13),c.addMany(s(64,127),10,12,13),c.addMany(s(64,127),9,12,13),c.addMany(p,13,13,13),c.addMany(n,13,13,13),c.add(127,13,0,13),c.addMany([27,156,24,26],13,14,0),c.add(x,0,2,0),c.add(x,8,5,8),c.add(x,6,0,6),c.add(x,11,0,11),c.add(x,13,13,13),c}();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 g.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 E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&E>-1){for(;E>=0&&(p=m[E](this._params),p!==!0);E--)if(p instanceof Promise)return this._parseStack.handlerPos=E,p}this._parseStack.handlers=[];break;case 4:if(n===!1&&E>-1){for(;E>=0&&(p=m[E](),p!==!0);E--)if(p instanceof Promise)return this._parseStack.handlerPos=E,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 P=m+1;;++P){if(P>=s||(w=l[P])<32||w>126&&w<x){this._printHandler(l,m,P),m=P-1;break}if(++P>=s||(w=l[P])<32||w>126&&w<x){this._printHandler(l,m,P),m=P-1;break}if(++P>=s||(w=l[P])<32||w>126&&w<x){this._printHandler(l,m,P),m=P-1;break}if(++P>=s||(w=l[P])<32||w>126&&w<x){this._printHandler(l,m,P),m=P-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 E=this._csiHandlers[this._collect<<8|w];let A=E?E.length-1:-1;for(;A>=0&&(p=E[A](this._params),p!==!0);A--)if(p instanceof Promise)return this._preserveStack(3,E,A,y,m),p;A<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 B=I?I.length-1:-1;for(;B>=0&&(p=I[B](),p!==!0);B--)if(p instanceof Promise)return this._preserveStack(4,I,B,y,m),p;B<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 P=m+1;;++P)if(P>=s||(w=l[P])===24||w===26||w===27||w>127&&w<x){this._dcsParser.put(l,m,P),m=P-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 P=m+1;;P++)if(P>=s||(w=l[P])<32||w>127&&w<x){this._oscParser.put(l,m,P),m=P-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,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const d=u(5770),g=u(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(_,S){this._handlers[_]===void 0&&(this._handlers[_]=[]);const x=this._handlers[_];return x.push(S),{dispose:()=>{const v=x.indexOf(S);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(_,S,x){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(_,S,x);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(_,S,x))}start(){this.reset(),this._state=1}put(_,S,x){if(this._state!==3){if(this._state===1)for(;S<x;){const v=_[S++];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-S>0&&this._put(_,S,x)}}end(_,S=!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,c=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,x=S,c=this._stack.fallThrough,this._stack.paused=!1),!c&&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(_,S,x){this._hitLimit||(this._data+=(0,g.utf32ToString)(_,S,x),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let S=!1;if(this._hitLimit)S=!1;else if(_&&(S=this._handler(this._data),S instanceof Promise))return S.then(x=>(this._data="",this._hitLimit=!1,x));return this._data="",this._hitLimit=!1,S}}},8742:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const u=2147483647;class d{static fromArray(h){const _=new d;if(!h.length)return _;for(let S=Array.isArray(h[0])?1:0;S<h.length;++S){const x=h[S];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 S=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];x-S>0&&h.push(Array.prototype.slice.call(this._subParams,S,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>u?u: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>u?u: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,S=255&this._subParamsIdx[h];return S-_>0?this._subParams.subarray(_,S):null}getSubParamsAll(){const h={};for(let _=0;_<this.length;++_){const S=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];x-S>0&&(h[_]=this._subParams.slice(S,x))}return h}addDigit(h){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,x=S[_-1];S[_-1]=~x?Math.min(10*x+h,u):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 u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const g={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(g),d.dispose=()=>this._wrappedAddonDispose(g),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===u){d=g;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const d=u(3785),g=u(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 g.CellData}}},3785:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const d=u(511);o.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,h){if(!(g<0||g>=this._line.length))return h?(this._line.loadCell(g,h),h):this._line.loadCell(g,new d.CellData)}translateToString(g,h,_){return this._line.translateToString(g,h,_)}}},8285:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const d=u(8771),g=u(8460),h=u(844);class _ extends h.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new g.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(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,g=>d(g.toArray()))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,(g,h)=>d(g,h.toArray()))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(C,o,u){var d=this&&this.__decorate||function(c,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(c,l,s,n);else for(var k=c.length-1;k>=0;k--)(p=c[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},g=this&&this.__param||function(c,l){return function(s,n){l(s,n,c)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const h=u(8460),_=u(844),S=u(5295),x=u(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let v=o.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(c){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(c.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(c.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(c,this))}resize(c,l){this.cols=c,this.rows=l,this.buffers.resize(c,l),this._onResize.fire({cols:c,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(c,l=!1){const s=this.buffer;let n;n=this._cachedBlankLine,n&&n.length===this.cols&&n.getFg(0)===c.fg&&n.getBg(0)===c.bg||(n=s.getBlankLine(c,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(c,l,s){const n=this.buffer;if(c<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else c+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);const p=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+c,n.ybase),0),p!==n.ydisp&&(l||this._onScroll.fire(n.ydisp))}};o.BufferService=v=d([g(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(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(C,o,u){var d=this&&this.__decorate||function(n,p,w,y){var k,m=arguments.length,E=m<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(n,p,w,y);else for(var A=n.length-1;A>=0;A--)(k=n[A])&&(E=(m<3?k(E):m>3?k(p,w,E):k(p,w))||E);return m>3&&E&&Object.defineProperty(p,w,E),E},g=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=u(2585),_=u(8460),S=u(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 c=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${c(p[0])}${c(p[1])}${c(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 S.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([g(0,h.IBufferService),g(1,h.ICoreService)],s)},6975:function(C,o,u){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 E=s.length-1;E>=0;E--)(y=s[E])&&(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},g=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=u(1439),_=u(8460),S=u(844),x=u(2585),v=Object.freeze({insertMode:!1}),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=o.CoreService=class extends S.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)(c)}reset(){this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(c)}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([g(0,x.IBufferService),g(1,x.ILogService),g(2,x.IOptionsService)],l)},9074:(C,o,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const d=u(8055),g=u(8460),h=u(844),_=u(6106);let S=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 g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const n=new c(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=>{S=y.options.x??0,x=S+(y.options.width??1),s>=S&&s<x&&(!p||(y.options.layer??"bottom")===p)&&w(y)})}}o.DecorationService=v;class c 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 g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.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,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const d=u(2585),g=u(8343);class h{constructor(...S){this._entries=new Map;for(const[x,v]of S)this.set(x,v)}set(S,x){const v=this._entries.get(S);return this._entries.set(S,x),v}forEach(S){for(const[x,v]of this._entries.entries())S(x,v)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}o.ServiceCollection=h,o.InstantiationService=class{constructor(){this._services=new h,this._services.set(d.IInstantiationService,this)}setService(_,S){this._services.set(_,S)}getService(_){return this._services.get(_)}createInstance(_,...S){const x=(0,g.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 c=x.length>0?x[0].index:S.length;if(S.length!==c)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${c+1} conflicts with ${S.length} static arguments`);return new _(...S,...v)}}},7866:function(C,o,u){var d=this&&this.__decorate||function(c,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(c,l,s,n);else for(var k=c.length-1;k>=0;k--)(p=c[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},g=this&&this.__param||function(c,l){return function(s,n){l(s,n,c)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const h=u(844),_=u(2585),S={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(c){super(),this._optionsService=c,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),x=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(c){for(let l=0;l<c.length;l++)typeof c[l]=="function"&&(c[l]=c[l]())}_log(c,l,s){this._evalLazyOptionalParams(s),c.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...s)}trace(c,...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,c,l)}debug(c,...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,c,l)}info(c,...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,c,l)}warn(c,...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,c,l)}error(c,...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,c,l)}};o.LogService=v=d([g(0,_.IOptionsService)],v),o.setTraceLogger=function(c){x=c},o.traceCall=function(c,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,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const d=u(8460),g=u(844),h=u(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 S extends g.Disposable{constructor(v){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const c={...o.DEFAULT_OPTIONS};for(const l in v)if(l in c)try{const s=v[l];c[l]=this._sanitizeAndValidateOption(l,s)}catch(s){console.error(s)}this.rawOptions=c,this.options={...c},this._setupOptions(),this.register((0,g.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(v,c){return this.onOptionChange(l=>{l===v&&c(this.rawOptions[v])})}onMultipleOptionChange(v,c){return this.onOptionChange(l=>{v.indexOf(l)!==-1&&c()})}_setupOptions(){const v=l=>{if(!(l in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},c=(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:c.bind(this,l)};Object.defineProperty(this.options,l,s)}}_sanitizeAndValidateOption(v,c){switch(v){case"cursorStyle":if(c||(c=o.DEFAULT_OPTIONS[v]),!function(l){return l==="block"||l==="underline"||l==="bar"}(c))throw new Error(`"${c}" is not a valid value for ${v}`);break;case"wordSeparator":c||(c=o.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof c=="number"&&1<=c&&c<=1e3)break;c=_.includes(c)?c:o.DEFAULT_OPTIONS[v];break;case"cursorWidth":c=Math.floor(c);case"lineHeight":case"tabStopWidth":if(c<1)throw new Error(`${v} cannot be less than 1, value: ${c}`);break;case"minimumContrastRatio":c=Math.max(1,Math.min(21,Math.round(10*c)/10));break;case"scrollback":if((c=Math.min(c,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${c}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(c<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${c}`);break;case"rows":case"cols":if(!c&&c!==0)throw new Error(`${v} must be numeric, value: ${c}`);break;case"windowsPty":c=c??{}}return c}}o.OptionsService=S},2660:function(C,o,u){var d=this&&this.__decorate||function(S,x,v,c){var l,s=arguments.length,n=s<3?x:c===null?c=Object.getOwnPropertyDescriptor(x,v):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(S,x,v,c);else for(var p=S.length-1;p>=0;p--)(l=S[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},g=this&&this.__param||function(S,x){return function(v,c){x(v,c,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const h=u(2585);let _=o.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const x=this._bufferService.buffer;if(S.id===void 0){const p=x.addMarker(x.ybase+x.y),w={data:S,id:this._nextId++,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(w,p)),this._dataByLinkId.set(w.id,w),w.id}const v=S,c=this._getEntryIdKey(v),l=this._entriesWithId.get(c);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(S,x){const v=this._dataByLinkId.get(S);if(v&&v.lines.every(c=>c.line!==x)){const c=this._bufferService.buffer.addMarker(x);v.lines.push(c),c.onDispose(()=>this._removeMarkerFromLink(v,c))}}getLinkData(S){var x;return(x=this._dataByLinkId.get(S))==null?void 0:x.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,x){const v=S.lines.indexOf(x);v!==-1&&(S.lines.splice(v,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};o.OscLinkService=_=d([g(0,h.IBufferService)],_)},8343:(C,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const u="di$target",d="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(g){return g[d]||[]},o.createDecorator=function(g){if(o.serviceRegistry.has(g))return o.serviceRegistry.get(g);const h=function(_,S,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,c,l){c[u]===c?c[d].push({id:v,index:l}):(c[d]=[{id:v,index:l}],c[u]=c)})(h,_,x)};return h.toString=()=>g,o.serviceRegistry.set(g,h),h}},2585:(C,o,u)=>{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=u(8343);var g;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"}(g||(o.LogLevelEnum=g={})),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,u)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const d=u(8460),g=u(225);class h{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,x,v=!1){return(16777215&S)<<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 S=new g.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let x=0,v=0;const c=S.length;for(let l=0;l<c;++l){let s=S.charCodeAt(l);if(55296<=s&&s<=56319){if(++l>=c)return x+this.wcwidth(s);const w=S.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(S,x){return this._activeProvider.charProperties(S,x)}}o.UnicodeService=h}},i={};function a(C){var o=i[C];if(o!==void 0)return o.exports;var u=i[C]={exports:{}};return r[C].call(u.exports,u,u.exports,a),u.exports}var f={};return(()=>{var C=f;Object.defineProperty(C,"__esModule",{value:!0}),C.Terminal=void 0;const o=a(9042),u=a(3236),d=a(844),g=a(5741),h=a(8285),_=a(7975),S=a(7090),x=["cols","rows"];class v extends d.Disposable{constructor(l){super(),this._core=this.register(new u.Terminal(l)),this._addonManager=this.register(new g.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 S.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})())})(Iu);var xf=Iu.exports,Ou={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),u=parseInt(o.getPropertyValue("height")),d=Math.max(0,parseInt(o.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),h=u-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),_=d-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.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})())})(Ou);var kf=Ou.exports,ju={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(C,o)=>{function u(g){try{const h=new URL(g),_=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 g.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(g,h,_,S={}){this._terminal=g,this._regex=h,this._handler=_,this._options=S}provideLinks(g,h){const _=d.computeLink(g,this._regex,this._terminal,this._handler);h(this._addCallbacks(_))}_addCallbacks(g){return g.map(h=>(h.leave=this._options.leave,h.hover=(_,S)=>{if(this._options.hover){const{range:x}=h;this._options.hover(_,S,x)}},h))}};class d{static computeLink(h,_,S,x){const v=new RegExp(_.source,(_.flags||"")+"g"),[c,l]=d._getWindowedLineStrings(h-1,S),s=c.join("");let n;const p=[];for(;n=v.exec(s);){const w=n[0];if(!u(w))continue;const[y,k]=d._mapStrIdx(S,l,0,n.index),[m,E]=d._mapStrIdx(S,y,k,w.length);if(y===-1||k===-1||m===-1||E===-1)continue;const A={start:{x:k+1,y:y+1},end:{x:E,y:m+1}};p.push({range:A,text:w,activate:x})}return p}static _getWindowedLineStrings(h,_){let S,x=h,v=h,c=0,l="";const s=[];if(S=_.buffer.active.getLine(h)){const n=S.translateToString(!0);if(S.isWrapped&&n[0]!==" "){for(c=0;(S=_.buffer.active.getLine(--x))&&c<2048&&(l=S.translateToString(!0),c+=l.length,s.push(l),S.isWrapped&&l.indexOf(" ")===-1););s.reverse()}for(s.push(n),c=0;(S=_.buffer.active.getLine(++v))&&S.isWrapped&&c<2048&&(l=S.translateToString(!0),c+=l.length,s.push(l),l.indexOf(" ")===-1););}return[s,x]}static _mapStrIdx(h,_,S,x){const v=h.buffer.active,c=v.getNullCell();let l=S;for(;x;){const s=v.getLine(_);if(!s)return[-1,-1];for(let n=l;n<s.length;++n){s.getCell(n,c);const p=c.getChars();if(c.getWidth()&&(x-=p.length||1,n===s.length-1&&p==="")){const w=v.getLine(_+1);w&&w.isWrapped&&(w.getCell(0,c),c.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 u=i[C]={exports:{}};return r[C](u,u.exports,a),u.exports}var f={};return(()=>{var C=f;Object.defineProperty(C,"__esModule",{value:!0}),C.WebLinksAddon=void 0;const o=a(6),u=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(g,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(g=d,h={}){this._handler=g,this._options=h}activate(g){this._terminal=g;const h=this._options,_=h.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,_,this._handler,h))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),f})())})(ju);var Ef=ju.exports;function Sa(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function bf(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 Rf({agent:e,subscribeTerminal:t,injectMessage:r,sendRaw:i,openAgentTerminal:a,returnAgentTerminal:f,onClose:C}){const o=V.useRef(null),u=V.useRef(null),[d,g]=V.useState(420),[h,_]=V.useState(""),S=V.useRef(!1),x=l=>{const s=l.clientY,n=d;S.current=!0;const p=y=>{g(Math.max(180,Math.min(window.innerHeight*.8,n-(y.clientY-s))))},w=()=>{S.current=!1,window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",w)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",w)};V.useEffect(()=>{if(!o.current||!e)return;const l=e.color||"#F5A623",s=new xf.Terminal({theme:{background:"#030507",foreground:"#E8E8F0",cursor:"#F5A623",selectionBackground:l+"40"},fontFamily:"'DM Mono', monospace",fontSize:12,lineHeight:1.3,cursorBlink:!0,scrollback:5e3}),n=new kf.FitAddon,p=new Ef.WebLinksAddon;s.loadAddon(n),s.loadAddon(p),s.open(o.current),requestAnimationFrame(()=>{try{n.fit()}catch{}}),u.current=s,s.onKey(({key:m})=>{i(e.id,m)});const w=t(e.id,m=>{s.write(m)}),y=new ResizeObserver(()=>{try{n.fit()}catch{}});y.observe(o.current);const k=m=>{m.key==="Escape"&&C()};return window.addEventListener("keydown",k),()=>{window.removeEventListener("keydown",k),y.disconnect(),w(),s.dispose(),u.current=null}},[e==null?void 0:e.id]);const v=l=>{l.key==="Enter"&&h.trim()&&!e.bridgeActive&&(r(e.id,h.trim()),_(""))};if(!e)return null;const c=e.color||"#F5A623";return L.jsxs("div",{style:{height:d,display:"flex",flexDirection:"column",background:"var(--bg1)",borderTop:"1px solid var(--border)"},children:[L.jsx("div",{onMouseDown:x,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:C,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:c,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:c},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: ",bf(e.uptime)]})]}),e.status==="active"&&!e.bridgeActive&&L.jsx("button",{onClick:()=>a(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:()=>f(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:C,style:{color:"var(--text3)",fontSize:14},children:"✕"})]}),L.jsx("div",{ref:o,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:h,placeholder:e.bridgeActive?"Input moved to Terminal.app while bridged...":"Send message to agent...",disabled:e.status!=="active"||e.bridgeActive,onChange:l=>_(l.target.value),onKeyDown:v,style:{width:"100%",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,padding:"5px 10px",fontSize:12,caretColor:c,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 Lf({initialPath:e,onSelect:t,onClose:r}){const[i,a]=V.useState(e||""),[f,C]=V.useState(e||""),[o,u]=V.useState([]),[d,g]=V.useState(null),[h,_]=V.useState(null),[S,x]=V.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),g(y.parent),u(y.dirs)}catch{_("Failed to connect to server")}x(!1)};V.useEffect(()=>{v(e||"")},[]);const c=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:S?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:()=>c(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 Kr={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"},ya={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 Df(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 Tf(e=0){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e||0)}function Af(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 Mf({task:e,repos:t=[],onClose:r,onApprove:i,onReject:a,onPause:f,onResume:C,onEdit:o,onAbort:u,onReset:d,onRetry:g,onDelete:h,onOpenWorkspace:_}){const[S,x]=V.useState(!1),[v,c]=V.useState(e.title),[l,s]=V.useState(e.description||""),[n,p]=V.useState(e.priority),[w,y]=V.useState(e.repoPath||""),[k,m]=V.useState(!1),[E,A]=V.useState(!1),[I,B]=V.useState(!1),[P,N]=V.useState(""),[z,K]=V.useState(!1),G=!["done","paused","aborted"].includes(e.status),H=e.status==="paused",b=!["done","aborted"].includes(e.status),T=e.status!=="done",D=e.status==="blocked",M=!!(e.workspacePath&&_),j=Af(e.startedAt,e.completedAt),U=()=>{o(e.id,{title:v,description:l,priority:n,repoPath:w}),x(!1)},Z=()=>{P.trim()&&(a(e.id,P.trim()),B(!1),N(""))},q={fontSize:10,fontWeight:600,color:"var(--text3)",letterSpacing:1,textTransform:"uppercase",marginBottom:4},O={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:R=>R.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:(ya[e.status]||"var(--text3)")+"20",color:ya[e.status]||"var(--text3)"},children:e.status.replace(/_/g," ")})]}),L.jsx("button",{onClick:r,style:{color:"var(--text3)",fontSize:16},children:"✕"})]}),S?L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:q,children:"Title"}),L.jsx("input",{type:"text",value:v,onChange:R=>c(R.target.value),style:{width:"100%",padding:"6px 10px",fontSize:12}})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:q,children:"Description"}),L.jsx("textarea",{value:l,onChange:R=>s(R.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:q,children:"Priority"}),L.jsx("div",{style:{display:"flex",gap:6},children:["critical","high","medium","low"].map(R=>L.jsx("button",{onClick:()=>p(R),style:{padding:"4px 10px",borderRadius:4,fontSize:11,border:`1px solid ${n===R?Kr[R]:"var(--border)"}`,background:n===R?Kr[R]+"20":"transparent",color:n===R?Kr[R]:"var(--text2)",textTransform:"capitalize"},children:R},R))})]}),t.length>0&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:q,children:"Repository"}),L.jsxs("select",{value:w,onChange:R=>y(R.target.value),style:{width:"100%",padding:"6px 10px",fontSize:12},children:[L.jsx("option",{value:"",children:"No repository"}),t.map(R=>L.jsx("option",{value:R,children:R},R))]})]}),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:U,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:q,children:"Title"}),L.jsx("div",{style:{...O,fontSize:14},children:e.title})]}),L.jsxs("div",{style:{display:"flex",gap:20,marginBottom:14},children:[L.jsxs("div",{children:[L.jsx("div",{style:q,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:q,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:q,children:"Total Tokens"}),L.jsx("div",{style:{...O,fontFamily:"var(--font-mono)"},children:Tf(e.totalTokens||0)})]}),e.description&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:q,children:"Description"}),L.jsx("div",{style:O,children:e.description})]}),e.branch&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:q,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:q,children:"Review Cycles"}),L.jsxs("div",{style:{fontSize:12,color:"var(--text2)"},children:[e.reviewCycleCount||0," / 3"]})]}),j&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:q,children:"Total Time"}),L.jsx("div",{style:{fontSize:12,color:"var(--text2)"},children:j})]}),e.prUrl&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:q,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:q,children:"Blocked Reason"}),L.jsx("div",{title:e.blockedReason,style:{fontSize:12,color:"var(--red)",lineHeight:1.5},children:Df(e.blockedReason)})]}),e.plan&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsxs("div",{onClick:()=>m(!k),style:{...q,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:e.plan})]}),e.review&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsxs("div",{onClick:()=>A(!E),style:{...q,cursor:"pointer",display:"flex",alignItems:"center",gap:4,userSelect:"none"},children:[E?"▼":"▶"," Review"]}),E&&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:e.review})]}),e.log&&e.log.length>0&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:q,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((R,W)=>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(R.ts).toLocaleTimeString()}),L.jsx("span",{style:{color:"var(--text2)"},children:R.message})]},W))})]}),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:()=>{c(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"}),G&&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"}),H&&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:()=>B(!0),style:{padding:"6px 14px",fontSize:12,background:"rgba(255, 77, 77, 0.1)",borderRadius:4,color:"var(--text2)"},children:"Revise"})]}),D&&g&&L.jsx("button",{onClick:()=>g(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"}),M&&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"}),T&&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"}),b&&u&&L.jsx("button",{onClick:()=>u(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(z){h(e.id);return}K(!0)},style:{padding:"6px 14px",fontSize:12,background:z?"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:z?"Confirm Delete":"Delete from Done"})]}),T&&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:P,onChange:R=>N(R.target.value),onKeyDown:R=>{R.key==="Enter"&&Z(),R.key==="Escape"&&(B(!1),N(""))},style:{width:"100%",fontSize:11,padding:"6px 10px"}})}),z&&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 Pf="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 If(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Bf(e,t){return!Array.isArray(e)||e.length===0?"":t!=null&&t.defaultRepoPath&&e.includes(t.defaultRepoPath)?t.defaultRepoPath:e[0]||""}function Of(){return L.jsx("div",{style:{height:34,display:"flex",alignItems:"center",flexShrink:0},children:L.jsx("img",{src:Pf,alt:"Ban Kan",style:{height:34,width:"auto",display:"block"}})})}function jf(){const{connected:e,agents:t,tasks:r,repos:i,settings:a,notifications:f,addTask:C,approvePlan:o,rejectPlan:u,pauseTask:d,resumeTask:g,editTask:h,abortTask:_,resetTask:S,retryTask:x,deleteTask:v,openTaskWorkspace:c,injectMessage:l,sendRaw:s,updateSettings:n,subscribeTerminal:p,openAgentTerminal:w,returnAgentTerminal:y}=vf(),[k,m]=V.useState(null),[E,A]=V.useState(null),[I,B]=V.useState(!1),[P,N]=V.useState(!1),z=V.useMemo(()=>r.filter(M=>M.status==="awaiting_approval"||M.status==="blocked"),[r]),K=V.useMemo(()=>r.reduce((M,j)=>M+(j.totalTokens||0),0),[r]),G=V.useMemo(()=>t.filter(M=>M.status==="active").length,[t]),H=V.useMemo(()=>t.filter(M=>M.status==="blocked").length,[t]),b=V.useMemo(()=>r.filter(M=>!["backlog","done","aborted"].includes(M.status)),[r]),T=V.useMemo(()=>t.find(M=>M.id===k),[t,k]),D=M=>{M!=="orch"&&m(j=>j===M?null:M)};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(Of,{})}),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:G}),"/",t.length]}),H>0&&L.jsxs("span",{children:["Blocked ",L.jsx("span",{style:{color:"var(--red)"},children:H})]}),L.jsxs("span",{children:["In Flight ",L.jsx("span",{style:{color:"var(--amber)"},children:b.length})]}),L.jsxs("span",{children:["Context ",L.jsx("span",{style:{color:"var(--text)"},children:If(K)})]})]}),z.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"}}),z.length," need",z.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:()=>N(!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:()=>B(!0),style:{padding:"6px 14px",background:"var(--amber)",color:"#000",borderRadius:4,fontWeight:500,fontSize:12},children:"+ ADD TASK"})]}),L.jsx(wf,{tasks:r,agents:t,onApprove:o,onReject:u,onAgentClick:D,onAddTask:()=>B(!0),onTaskClick:M=>A(M)}),k&&T&&L.jsx(Rf,{agent:T,subscribeTerminal:p,injectMessage:l,sendRaw:s,openAgentTerminal:w,returnAgentTerminal:y,onClose:()=>m(null)}),E&&L.jsx(Mf,{task:r.find(M=>M.id===E.id)||E,repos:i,onClose:()=>A(null),onApprove:M=>{o(M),A(null)},onReject:(M,j)=>{u(M,j),A(null)},onPause:M=>{d(M),A(null)},onResume:M=>{g(M)},onEdit:(M,j)=>{h(M,j)},onAbort:M=>{_(M),A(null)},onReset:M=>{S(M),A(null)},onRetry:M=>{x(M),A(null)},onDelete:M=>{v(M),A(null)},onOpenWorkspace:M=>{c(M)}}),I&&L.jsx(Hf,{repos:i,settings:a,onClose:()=>B(!1),onSubmit:(M,j,U,Z)=>{C(M,j,U,Z),B(!1)}}),P&&a&&L.jsx(Nf,{settings:a,onClose:()=>N(!1),onApply:M=>{n(M),N(!1)}}),L.jsx("div",{style:{position:"fixed",bottom:16,right:16,display:"flex",flexDirection:"column",gap:8,zIndex:1e3},children:f.map(M=>L.jsx("div",{style:{padding:"10px 14px",background:"var(--bg2)",borderLeft:`3px solid ${M.type==="error"?"var(--red)":M.type==="success"?"var(--green)":M.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:M.msg},M.id))})]})}function Hf({repos:e,settings:t,onClose:r,onSubmit:i}){const[a,f]=V.useState(""),[C,o]=V.useState("medium"),[u,d]=V.useState(""),[g,h]=V.useState(()=>Bf(e,t)),_=()=>{a.trim()&&i(a.trim(),C,u.trim(),g)};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:S=>S.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:g,onChange:S=>h(S.target.value),style:{width:"100%",fontSize:12,padding:"6px 8px"},children:[L.jsx("option",{value:"",children:"No repository"}),e.map(S=>L.jsx("option",{value:S,children:S},S))]})]}),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:S=>f(S.target.value),onKeyDown:S=>{S.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(S=>L.jsx("button",{onClick:()=>o(S),style:{padding:"5px 12px",borderRadius:4,fontSize:12,border:`1px solid ${C===S?Cn[S]:"var(--border)"}`,background:C===S?Cn[S]+"20":"transparent",color:C===S?Cn[S]:"var(--text2)",textTransform:"capitalize"},children:S},S))})]}),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:u,onChange:S=>d(S.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"})]})]})})}function Nf({settings:e,onClose:t,onApply:r}){var p,w;const[i,a]=V.useState(()=>JSON.parse(JSON.stringify(e))),[f,C]=V.useState(""),[o,u]=V.useState(!1),[d,g]=V.useState("general"),h=(y,k,m)=>{a(E=>{const A=JSON.parse(JSON.stringify(E));return A.agents[y][k]=m,A})},_=(y,k)=>{a(m=>({...m,prompts:{...m.prompts||{},[y]:k}}))},S=()=>{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(E=>E!==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}},c=!!((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 A;const k=s[y],m=i.agents[k.roleKey],E=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:E.min,max:E.max,value:m.max,onChange:I=>{const B=E.min,P=parseInt(I.target.value,10),N=Number.isNaN(P)?B:Math.max(E.min,Math.min(E.max,P));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.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:((A=i.prompts)==null?void 0:A[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:()=>g(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:()=>u(!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(Lf,{initialPath:i.workspaceRoot||"",onSelect:y=>{a(k=>({...k,workspaceRoot:y})),u(!1)},onClose:()=>u(!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"&&S()},placeholder:"https://github.com/org/repo",style:{flex:1,fontSize:12,padding:"6px 10px"}}),L.jsx("button",{onClick:S,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:!c,style:{padding:"8px 20px",background:c?"var(--amber)":"var(--border)",color:c?"#000":"var(--text3)",borderRadius:4,fontWeight:500,fontSize:12},children:"Apply"})]})]})})}Pu(document.getElementById("root")).render(L.jsx(jf,{}));