notjs-react 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/dist/NotJS.d.ts +17 -0
- package/dist/NotJS.d.ts.map +1 -0
- package/dist/index.cjs +114 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9500 -0
- package/dist/index.js.map +1 -0
- package/dist/notjs-react.css +32 -0
- package/package.json +57 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react/jsx-runtime"),X=require("react"),pr=require("react-dom");function vr(n){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const m in n)if(m!=="default"){const C=Object.getOwnPropertyDescriptor(n,m);Object.defineProperty(h,m,C.get?C:{enumerable:!0,get:()=>n[m]})}}return h.default=n,Object.freeze(h)}const j=vr(X),gr=vr(pr);function Kt(n,h){(h==null||h>n.length)&&(h=n.length);for(var m=0,C=Array(h);m<h;m++)C[m]=n[m];return C}function _i(n){if(Array.isArray(n))return n}function pi(n,h,m){return(h=wi(h))in n?Object.defineProperty(n,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):n[h]=m,n}function vi(n,h){var m=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(m!=null){var C,E,R,x,i=[],o=!0,c=!1;try{if(R=(m=m.call(n)).next,h!==0)for(;!(o=(C=R.call(m)).done)&&(i.push(C.value),i.length!==h);o=!0);}catch(d){c=!0,E=d}finally{try{if(!o&&m.return!=null&&(x=m.return(),Object(x)!==x))return}finally{if(c)throw E}}return i}}function gi(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vt(n,h){var m=Object.keys(n);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(n);h&&(C=C.filter(function(E){return Object.getOwnPropertyDescriptor(n,E).enumerable})),m.push.apply(m,C)}return m}function Gt(n){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?Vt(Object(m),!0).forEach(function(C){pi(n,C,m[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(m)):Vt(Object(m)).forEach(function(C){Object.defineProperty(n,C,Object.getOwnPropertyDescriptor(m,C))})}return n}function mi(n,h){if(n==null)return{};var m,C,E=Si(n,h);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(n);for(C=0;C<R.length;C++)m=R[C],h.indexOf(m)===-1&&{}.propertyIsEnumerable.call(n,m)&&(E[m]=n[m])}return E}function Si(n,h){if(n==null)return{};var m={};for(var C in n)if({}.hasOwnProperty.call(n,C)){if(h.indexOf(C)!==-1)continue;m[C]=n[C]}return m}function bi(n,h){return _i(n)||vi(n,h)||yi(n,h)||gi()}function Ci(n,h){if(typeof n!="object"||!n)return n;var m=n[Symbol.toPrimitive];if(m!==void 0){var C=m.call(n,h);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(n)}function wi(n){var h=Ci(n,"string");return typeof h=="symbol"?h:h+""}function yi(n,h){if(n){if(typeof n=="string")return Kt(n,h);var m={}.toString.call(n).slice(8,-1);return m==="Object"&&n.constructor&&(m=n.constructor.name),m==="Map"||m==="Set"?Array.from(n):m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m)?Kt(n,h):void 0}}function Ei(n,h,m){return h in n?Object.defineProperty(n,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):n[h]=m,n}function Xt(n,h){var m=Object.keys(n);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(n);h&&(C=C.filter(function(E){return Object.getOwnPropertyDescriptor(n,E).enumerable})),m.push.apply(m,C)}return m}function Jt(n){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?Xt(Object(m),!0).forEach(function(C){Ei(n,C,m[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(m)):Xt(Object(m)).forEach(function(C){Object.defineProperty(n,C,Object.getOwnPropertyDescriptor(m,C))})}return n}function xi(){for(var n=arguments.length,h=new Array(n),m=0;m<n;m++)h[m]=arguments[m];return function(C){return h.reduceRight(function(E,R){return R(E)},C)}}function Ne(n){return function h(){for(var m=this,C=arguments.length,E=new Array(C),R=0;R<C;R++)E[R]=arguments[R];return E.length>=n.length?n.apply(this,E):function(){for(var x=arguments.length,i=new Array(x),o=0;o<x;o++)i[o]=arguments[o];return h.apply(m,[].concat(E,i))}}}function rt(n){return{}.toString.call(n).includes("Object")}function ki(n){return!Object.keys(n).length}function je(n){return typeof n=="function"}function Ri(n,h){return Object.prototype.hasOwnProperty.call(n,h)}function Li(n,h){return rt(h)||Ce("changeType"),Object.keys(h).some(function(m){return!Ri(n,m)})&&Ce("changeField"),h}function Di(n){je(n)||Ce("selectorType")}function Ai(n){je(n)||rt(n)||Ce("handlerType"),rt(n)&&Object.values(n).some(function(h){return!je(h)})&&Ce("handlersType")}function Oi(n){n||Ce("initialIsRequired"),rt(n)||Ce("initialType"),ki(n)&&Ce("initialContent")}function Ti(n,h){throw new Error(n[h]||n.default)}var Mi={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Ce=Ne(Ti)(Mi),Je={changes:Li,selector:Di,handler:Ai,initial:Oi};function Pi(n){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Je.initial(n),Je.handler(h);var m={current:n},C=Ne(Hi)(m,h),E=Ne(Ii)(m),R=Ne(Je.changes)(n),x=Ne(Bi)(m);function i(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return Je.selector(c),c(m.current)}function o(c){xi(C,E,R,x)(c)}return[i,o]}function Bi(n,h){return je(h)?h(n.current):h}function Ii(n,h){return n.current=Jt(Jt({},n.current),h),h}function Hi(n,h,m){return je(h)?h(n.current):Object.keys(m).forEach(function(C){var E;return(E=h[C])===null||E===void 0?void 0:E.call(h,n.current[C])}),m}var Fi={create:Pi},Ni={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function Wi(n){return function h(){for(var m=this,C=arguments.length,E=new Array(C),R=0;R<C;R++)E[R]=arguments[R];return E.length>=n.length?n.apply(this,E):function(){for(var x=arguments.length,i=new Array(x),o=0;o<x;o++)i[o]=arguments[o];return h.apply(m,[].concat(E,i))}}}function ji(n){return{}.toString.call(n).includes("Object")}function $i(n){return n||Yt("configIsRequired"),ji(n)||Yt("configType"),n.urls?(Ui(),{paths:{vs:n.urls.monacoBase}}):n}function Ui(){console.warn(mr.deprecation)}function zi(n,h){throw new Error(n[h]||n.default)}var mr={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
3
|
+
You are using deprecated way of configuration.
|
|
4
|
+
|
|
5
|
+
Instead of using
|
|
6
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
7
|
+
use
|
|
8
|
+
monaco.config({ paths: { vs: '...' } })
|
|
9
|
+
|
|
10
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
11
|
+
`},Yt=Wi(zi)(mr),qi={config:$i},Ki=function(){for(var h=arguments.length,m=new Array(h),C=0;C<h;C++)m[C]=arguments[C];return function(E){return m.reduceRight(function(R,x){return x(R)},E)}};function Sr(n,h){return Object.keys(h).forEach(function(m){h[m]instanceof Object&&n[m]&&Object.assign(h[m],Sr(n[m],h[m]))}),Gt(Gt({},n),h)}var Vi={type:"cancelation",msg:"operation is manually canceled"};function mt(n){var h=!1,m=new Promise(function(C,E){n.then(function(R){return h?E(Vi):C(R)}),n.catch(E)});return m.cancel=function(){return h=!0},m}var Gi=["monaco"],Xi=Fi.create({config:Ni,isInitialized:!1,resolve:null,reject:null,monaco:null}),br=bi(Xi,2),qe=br[0],at=br[1];function Ji(n){var h=qi.config(n),m=h.monaco,C=mi(h,Gi);at(function(E){return{config:Sr(E.config,C),monaco:m}})}function Yi(){var n=qe(function(h){var m=h.monaco,C=h.isInitialized,E=h.resolve;return{monaco:m,isInitialized:C,resolve:E}});if(!n.isInitialized){if(at({isInitialized:!0}),n.monaco)return n.resolve(n.monaco),mt(St);if(window.monaco&&window.monaco.editor)return Cr(window.monaco),n.resolve(window.monaco),mt(St);Ki(Zi,es)(ts)}return mt(St)}function Zi(n){return document.body.appendChild(n)}function Qi(n){var h=document.createElement("script");return n&&(h.src=n),h}function es(n){var h=qe(function(C){var E=C.config,R=C.reject;return{config:E,reject:R}}),m=Qi("".concat(h.config.paths.vs,"/loader.js"));return m.onload=function(){return n()},m.onerror=h.reject,m}function ts(){var n=qe(function(m){var C=m.config,E=m.resolve,R=m.reject;return{config:C,resolve:E,reject:R}}),h=window.require;h.config(n.config),h(["vs/editor/editor.main"],function(m){var C=m.m||m;Cr(C),n.resolve(C)},function(m){n.reject(m)})}function Cr(n){qe().monaco||at({monaco:n})}function rs(){return qe(function(n){var h=n.monaco;return h})}var St=new Promise(function(n,h){return at({resolve:n,reject:h})}),wr={config:Ji,init:Yi,__getMonacoInstance:rs},is={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},bt=is,ss={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},ns=ss;function os({children:n}){return X.createElement("div",{style:ns.container},n)}var as=os,cs=as;function ls({width:n,height:h,isEditorReady:m,loading:C,_ref:E,className:R,wrapperProps:x}){return X.createElement("section",{style:{...bt.wrapper,width:n,height:h},...x},!m&&X.createElement(cs,null,C),X.createElement("div",{ref:E,style:{...bt.fullWidth,...!m&&bt.hide},className:R}))}var hs=ls,yr=X.memo(hs);function us(n){X.useEffect(n,[])}var Er=us;function ds(n,h,m=!0){let C=X.useRef(!0);X.useEffect(C.current||!m?()=>{C.current=!1}:n,h)}var se=ds;function We(){}function De(n,h,m,C){return fs(n,C)||_s(n,h,m,C)}function fs(n,h){return n.editor.getModel(xr(n,h))}function _s(n,h,m,C){return n.editor.createModel(h,m,C?xr(n,C):void 0)}function xr(n,h){return n.Uri.parse(h)}function ps({original:n,modified:h,language:m,originalLanguage:C,modifiedLanguage:E,originalModelPath:R,modifiedModelPath:x,keepCurrentOriginalModel:i=!1,keepCurrentModifiedModel:o=!1,theme:c="light",loading:d="Loading...",options:a={},height:f="100%",width:_="100%",className:S,wrapperProps:u={},beforeMount:r=We,onMount:s=We}){let[e,t]=X.useState(!1),[l,v]=X.useState(!0),g=X.useRef(null),b=X.useRef(null),p=X.useRef(null),w=X.useRef(s),L=X.useRef(r),M=X.useRef(!1);Er(()=>{let I=wr.init();return I.then($=>(b.current=$)&&v(!1)).catch($=>($==null?void 0:$.type)!=="cancelation"&&console.error("Monaco initialization: error:",$)),()=>g.current?H():I.cancel()}),se(()=>{if(g.current&&b.current){let I=g.current.getOriginalEditor(),$=De(b.current,n||"",C||m||"text",R||"");$!==I.getModel()&&I.setModel($)}},[R],e),se(()=>{if(g.current&&b.current){let I=g.current.getModifiedEditor(),$=De(b.current,h||"",E||m||"text",x||"");$!==I.getModel()&&I.setModel($)}},[x],e),se(()=>{let I=g.current.getModifiedEditor();I.getOption(b.current.editor.EditorOption.readOnly)?I.setValue(h||""):h!==I.getValue()&&(I.executeEdits("",[{range:I.getModel().getFullModelRange(),text:h||"",forceMoveMarkers:!0}]),I.pushUndoStop())},[h],e),se(()=>{var I,$;($=(I=g.current)==null?void 0:I.getModel())==null||$.original.setValue(n||"")},[n],e),se(()=>{let{original:I,modified:$}=g.current.getModel();b.current.editor.setModelLanguage(I,C||m||"text"),b.current.editor.setModelLanguage($,E||m||"text")},[m,C,E],e),se(()=>{var I;(I=b.current)==null||I.editor.setTheme(c)},[c],e),se(()=>{var I;(I=g.current)==null||I.updateOptions(a)},[a],e);let B=X.useCallback(()=>{var z;if(!b.current)return;L.current(b.current);let I=De(b.current,n||"",C||m||"text",R||""),$=De(b.current,h||"",E||m||"text",x||"");(z=g.current)==null||z.setModel({original:I,modified:$})},[m,h,E,n,C,R,x]),D=X.useCallback(()=>{var I;!M.current&&p.current&&(g.current=b.current.editor.createDiffEditor(p.current,{automaticLayout:!0,...a}),B(),(I=b.current)==null||I.editor.setTheme(c),t(!0),M.current=!0)},[a,c,B]);X.useEffect(()=>{e&&w.current(g.current,b.current)},[e]),X.useEffect(()=>{!l&&!e&&D()},[l,e,D]);function H(){var $,z,N,y;let I=($=g.current)==null?void 0:$.getModel();i||((z=I==null?void 0:I.original)==null||z.dispose()),o||((N=I==null?void 0:I.modified)==null||N.dispose()),(y=g.current)==null||y.dispose()}return X.createElement(yr,{width:_,height:f,isEditorReady:e,loading:d,_ref:p,className:S,wrapperProps:u})}var vs=ps;X.memo(vs);function gs(n){let h=X.useRef();return X.useEffect(()=>{h.current=n},[n]),h.current}var ms=gs,Ye=new Map;function Ss({defaultValue:n,defaultLanguage:h,defaultPath:m,value:C,language:E,path:R,theme:x="light",line:i,loading:o="Loading...",options:c={},overrideServices:d={},saveViewState:a=!0,keepCurrentModel:f=!1,width:_="100%",height:S="100%",className:u,wrapperProps:r={},beforeMount:s=We,onMount:e=We,onChange:t,onValidate:l=We}){let[v,g]=X.useState(!1),[b,p]=X.useState(!0),w=X.useRef(null),L=X.useRef(null),M=X.useRef(null),B=X.useRef(e),D=X.useRef(s),H=X.useRef(),I=X.useRef(C),$=ms(R),z=X.useRef(!1),N=X.useRef(!1);Er(()=>{let O=wr.init();return O.then(P=>(w.current=P)&&p(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>L.current?A():O.cancel()}),se(()=>{var P,U,V,J;let O=De(w.current,n||C||"",h||E||"",R||m||"");O!==((P=L.current)==null?void 0:P.getModel())&&(a&&Ye.set($,(U=L.current)==null?void 0:U.saveViewState()),(V=L.current)==null||V.setModel(O),a&&((J=L.current)==null||J.restoreViewState(Ye.get(R))))},[R],v),se(()=>{var O;(O=L.current)==null||O.updateOptions(c)},[c],v),se(()=>{!L.current||C===void 0||(L.current.getOption(w.current.editor.EditorOption.readOnly)?L.current.setValue(C):C!==L.current.getValue()&&(N.current=!0,L.current.executeEdits("",[{range:L.current.getModel().getFullModelRange(),text:C,forceMoveMarkers:!0}]),L.current.pushUndoStop(),N.current=!1))},[C],v),se(()=>{var P,U;let O=(P=L.current)==null?void 0:P.getModel();O&&E&&((U=w.current)==null||U.editor.setModelLanguage(O,E))},[E],v),se(()=>{var O;i!==void 0&&((O=L.current)==null||O.revealLine(i))},[i],v),se(()=>{var O;(O=w.current)==null||O.editor.setTheme(x)},[x],v);let y=X.useCallback(()=>{var O;if(!(!M.current||!w.current)&&!z.current){D.current(w.current);let P=R||m,U=De(w.current,C||n||"",h||E||"",P||"");L.current=(O=w.current)==null?void 0:O.editor.create(M.current,{model:U,automaticLayout:!0,...c},d),a&&L.current.restoreViewState(Ye.get(P)),w.current.editor.setTheme(x),i!==void 0&&L.current.revealLine(i),g(!0),z.current=!0}},[n,h,m,C,E,R,c,d,a,x,i]);X.useEffect(()=>{v&&B.current(L.current,w.current)},[v]),X.useEffect(()=>{!b&&!v&&y()},[b,v,y]),I.current=C,X.useEffect(()=>{var O,P;v&&t&&((O=H.current)==null||O.dispose(),H.current=(P=L.current)==null?void 0:P.onDidChangeModelContent(U=>{N.current||t(L.current.getValue(),U)}))},[v,t]),X.useEffect(()=>{if(v){let O=w.current.editor.onDidChangeMarkers(P=>{var V;let U=(V=L.current.getModel())==null?void 0:V.uri;if(U&&P.find(J=>J.path===U.path)){let J=w.current.editor.getModelMarkers({resource:U});l==null||l(J)}});return()=>{O==null||O.dispose()}}return()=>{}},[v,l]);function A(){var O,P;(O=H.current)==null||O.dispose(),f?a&&Ye.set(R,L.current.saveViewState()):(P=L.current.getModel())==null||P.dispose(),L.current.dispose()}return X.createElement(yr,{width:_,height:S,isEditorReady:v,loading:o,_ref:M,className:u,wrapperProps:r})}var bs=Ss,Cs=X.memo(bs),ws=Cs,Ct={exports:{}},Zt;function ys(){return Zt||(Zt=1,(function(n,h){(function(m,C){n.exports=C()})(globalThis,(()=>(()=>{var m={4567:function(x,i,o){var c=this&&this.__decorate||function(e,t,l,v){var g,b=arguments.length,p=b<3?t:v===null?v=Object.getOwnPropertyDescriptor(t,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(e,t,l,v);else for(var w=e.length-1;w>=0;w--)(g=e[w])&&(p=(b<3?g(p):b>3?g(t,l,p):g(t,l))||p);return b>3&&p&&Object.defineProperty(t,l,p),p},d=this&&this.__param||function(e,t){return function(l,v){t(l,v,e)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;const a=o(9042),f=o(9924),_=o(844),S=o(4725),u=o(2585),r=o(3656);let s=i.AccessibilityManager=class extends _.Disposable{constructor(e,t,l,v){super(),this._terminal=e,this._coreBrowserService=l,this._renderService=v,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 g=0;g<this._terminal.rows;g++)this._rowElements[g]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[g]);if(this._topBoundaryFocusListener=g=>this._handleBoundaryFocus(g,0),this._bottomBoundaryFocusListener=g=>this._handleBoundaryFocus(g,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 f.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((g=>this._handleResize(g.rows)))),this.register(this._terminal.onRender((g=>this._refreshRows(g.start,g.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((g=>this._handleChar(g)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
12
|
+
`)))),this.register(this._terminal.onA11yTab((g=>this._handleTab(g)))),this.register(this._terminal.onKey((g=>this._handleKey(g.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,r.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,_.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
13
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const l=this._terminal.buffer,v=l.lines.length.toString();for(let g=e;g<=t;g++){const b=l.lines.get(l.ydisp+g),p=[],w=(b==null?void 0:b.translateToString(!0,void 0,void 0,p))||"",L=(l.ydisp+g+1).toString(),M=this._rowElements[g];M&&(w.length===0?(M.innerText=" ",this._rowColumns.set(M,[0,1])):(M.textContent=w,this._rowColumns.set(M,p)),M.setAttribute("aria-posinset",L),M.setAttribute("aria-setsize",v))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const l=e.target,v=this._rowElements[t===0?1:this._rowElements.length-2];if(l.getAttribute("aria-posinset")===(t===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==v)return;let g,b;if(t===0?(g=l,b=this._rowElements.pop(),this._rowContainer.removeChild(b)):(g=this._rowElements.shift(),b=l,this._rowContainer.removeChild(g)),g.removeEventListener("focus",this._topBoundaryFocusListener),b.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){const p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{const p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var w;if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},l={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(l.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===l.node&&t.offset>l.offset)&&([t,l]=[l,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;const v=this._rowElements.slice(-1)[0];if(l.node.compareDocumentPosition(v)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(l={node:v,offset:((w=v.textContent)==null?void 0:w.length)??0}),!this._rowContainer.contains(l.node))return;const g=({node:L,offset:M})=>{const B=L instanceof Text?L.parentNode:L;let D=parseInt(B==null?void 0:B.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get(B);if(!H)return console.warn("columns is null. Race condition?"),null;let I=M<H.length?H[M]:H.slice(-1)[0]+1;return I>=this._terminal.cols&&(++D,I=0),{row:D,column:I}},b=g(t),p=g(l);if(b&&p){if(b.row>p.row||b.row===p.row&&b.column>=p.column)throw new Error("invalid range");this._terminal.select(b.column,b.row,(p.row-b.row)*this._terminal.cols-b.column+p.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=s=c([d(1,u.IInstantiationService),d(2,S.ICoreBrowserService),d(3,S.IRenderService)],s)},3614:(x,i)=>{function o(f){return f.replace(/\r?\n/g,"\r")}function c(f,_){return _?"\x1B[200~"+f+"\x1B[201~":f}function d(f,_,S,u){f=c(f=o(f),S.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(f,!0),_.value=""}function a(f,_,S){const u=S.getBoundingClientRect(),r=f.clientX-u.left-10,s=f.clientY-u.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${r}px`,_.style.top=`${s}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=o,i.bracketTextForPaste=c,i.copyHandler=function(f,_){f.clipboardData&&f.clipboardData.setData("text/plain",_.selectionText),f.preventDefault()},i.handlePasteEvent=function(f,_,S,u){f.stopPropagation(),f.clipboardData&&d(f.clipboardData.getData("text/plain"),_,S,u)},i.paste=d,i.moveTextAreaUnderMouseCursor=a,i.rightClickHandler=function(f,_,S,u,r){a(f,_,S),r&&u.rightClickSelect(f),_.value=u.selectionText,_.select()}},7239:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const c=o(1505);i.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(d,a,f){this._css.set(d,a,f)}getCss(d,a){return this._css.get(d,a)}setColor(d,a,f){this._color.set(d,a,f)}getColor(d,a){return this._color.get(d,a)}clear(){this._color.clear(),this._css.clear()}}},3656:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(o,c,d,a){o.addEventListener(c,d,a);let f=!1;return{dispose:()=>{f||(f=!0,o.removeEventListener(c,d,a))}}}},3551:function(x,i,o){var c=this&&this.__decorate||function(s,e,t,l){var v,g=arguments.length,b=g<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(s,e,t,l);else for(var p=s.length-1;p>=0;p--)(v=s[p])&&(b=(g<3?v(b):g>3?v(e,t,b):v(e,t))||b);return g>3&&b&&Object.defineProperty(e,t,b),b},d=this&&this.__param||function(s,e){return function(t,l){e(t,l,s)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;const a=o(3656),f=o(8460),_=o(844),S=o(2585),u=o(4725);let r=i.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(s,e,t,l,v){super(),this._element=s,this._mouseService=e,this._renderService=t,this._bufferService=l,this._linkProviderService=v,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new f.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new f.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)((()=>{var g;this._lastMouseEvent=void 0,(g=this._activeProviderReplies)==null||g.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,a.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(s){this._lastMouseEvent=s;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const t=s.composedPath();for(let l=0;l<t.length;l++){const v=t[l];if(v.classList.contains("xterm"))break;if(v.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(s){if(this._activeLine!==s.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(s,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,s)||(this._clearCurrentLink(),this._askForLink(s,!0))}_askForLink(s,e){var l,v;this._activeProviderReplies&&e||((l=this._activeProviderReplies)==null||l.forEach((g=>{g==null||g.forEach((b=>{b.link.dispose&&b.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=s.y);let t=!1;for(const[g,b]of this._linkProviderService.linkProviders.entries())e?(v=this._activeProviderReplies)!=null&&v.get(g)&&(t=this._checkLinkProviderResult(g,s,t)):b.provideLinks(s.y,(p=>{var L,M;if(this._isMouseOut)return;const w=p==null?void 0:p.map((B=>({link:B})));(L=this._activeProviderReplies)==null||L.set(g,w),t=this._checkLinkProviderResult(g,s,t),((M=this._activeProviderReplies)==null?void 0:M.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)}))}_removeIntersectingLinks(s,e){const t=new Set;for(let l=0;l<e.size;l++){const v=e.get(l);if(v)for(let g=0;g<v.length;g++){const b=v[g],p=b.link.range.start.y<s?0:b.link.range.start.x,w=b.link.range.end.y>s?this._bufferService.cols:b.link.range.end.x;for(let L=p;L<=w;L++){if(t.has(L)){v.splice(g--,1);break}t.add(L)}}}}_checkLinkProviderResult(s,e,t){var g;if(!this._activeProviderReplies)return t;const l=this._activeProviderReplies.get(s);let v=!1;for(let b=0;b<s;b++)this._activeProviderReplies.has(b)&&!this._activeProviderReplies.get(b)||(v=!0);if(!v&&l){const b=l.find((p=>this._linkAtPosition(p.link,e)));b&&(t=!0,this._handleNewLink(b))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!t)for(let b=0;b<this._activeProviderReplies.size;b++){const p=(g=this._activeProviderReplies.get(b))==null?void 0:g.find((w=>this._linkAtPosition(w.link,e)));if(p){t=!0,this._handleNewLink(p);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,e){this._currentLink&&this._lastMouseEvent&&(!s||!e||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(s.link,e)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>{var t,l;return(l=(t=this._currentLink)==null?void 0:t.state)==null?void 0:l.decorations.pointerCursor},set:t=>{var l;(l=this._currentLink)!=null&&l.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",t))}},underline:{get:()=>{var t,l;return(l=(t=this._currentLink)==null?void 0:t.state)==null?void 0:l.decorations.underline},set:t=>{var l,v,g;(l=this._currentLink)!=null&&l.state&&((g=(v=this._currentLink)==null?void 0:v.state)==null?void 0:g.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((t=>{if(!this._currentLink)return;const l=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=v&&(this._clearCurrentLink(l,v),this._lastMouseEvent)){const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._askForLink(g,!1)}}))))}_linkHover(s,e,t){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(t,e.text)}_fireUnderlineEvent(s,e){const t=s.range,l=this._bufferService.buffer.ydisp,v=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-l-1,t.end.x,t.end.y-l-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(v)}_linkLeave(s,e,t){var l;(l=this._currentLink)!=null&&l.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(t,e.text)}_linkAtPosition(s,e){const t=s.range.start.y*this._bufferService.cols+s.range.start.x,l=s.range.end.y*this._bufferService.cols+s.range.end.x,v=e.y*this._bufferService.cols+e.x;return t<=v&&v<=l}_positionFromMouseEvent(s,e,t){const l=t.getCoords(s,e,this._bufferService.cols,this._bufferService.rows);if(l)return{x:l[0],y:l[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,e,t,l,v){return{x1:s,y1:e,x2:t,y2:l,cols:this._bufferService.cols,fg:v}}};i.Linkifier=r=c([d(1,u.IMouseService),d(2,u.IRenderService),d(3,S.IBufferService),d(4,u.ILinkProviderService)],r)},9042:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(x,i,o){var c=this&&this.__decorate||function(u,r,s,e){var t,l=arguments.length,v=l<3?r:e===null?e=Object.getOwnPropertyDescriptor(r,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(u,r,s,e);else for(var g=u.length-1;g>=0;g--)(t=u[g])&&(v=(l<3?t(v):l>3?t(r,s,v):t(r,s))||v);return l>3&&v&&Object.defineProperty(r,s,v),v},d=this&&this.__param||function(u,r){return function(s,e){r(s,e,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;const a=o(511),f=o(2585);let _=i.OscLinkProvider=class{constructor(u,r,s){this._bufferService=u,this._optionsService=r,this._oscLinkService=s}provideLinks(u,r){var w;const s=this._bufferService.buffer.lines.get(u-1);if(!s)return void r(void 0);const e=[],t=this._optionsService.rawOptions.linkHandler,l=new a.CellData,v=s.getTrimmedLength();let g=-1,b=-1,p=!1;for(let L=0;L<v;L++)if(b!==-1||s.hasContent(L)){if(s.loadCell(L,l),l.hasExtendedAttrs()&&l.extended.urlId){if(b===-1){b=L,g=l.extended.urlId;continue}p=l.extended.urlId!==g}else b!==-1&&(p=!0);if(p||b!==-1&&L===v-1){const M=(w=this._oscLinkService.getLinkData(g))==null?void 0:w.uri;if(M){const B={start:{x:b+1,y:u},end:{x:L+(p||L!==v-1?0:1),y:u}};let D=!1;if(!(t!=null&&t.allowNonHttpProtocols))try{const H=new URL(M);["http:","https:"].includes(H.protocol)||(D=!0)}catch{D=!0}D||e.push({text:M,range:B,activate:(H,I)=>t?t.activate(H,I,B):S(0,I),hover:(H,I)=>{var $;return($=t==null?void 0:t.hover)==null?void 0:$.call(t,H,I,B)},leave:(H,I)=>{var $;return($=t==null?void 0:t.leave)==null?void 0:$.call(t,H,I,B)}})}p=!1,l.hasExtendedAttrs()&&l.extended.urlId?(b=L,g=l.extended.urlId):(b=-1,g=-1)}}r(e)}};function S(u,r){if(confirm(`Do you want to navigate to ${r}?
|
|
14
|
+
|
|
15
|
+
WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=r}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=_=c([d(0,f.IBufferService),d(1,f.IOptionsService),d(2,f.IOscLinkService)],_)},6193:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(o,c,d){this._rowCount=d,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,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 o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;const c=o(3614),d=o(3656),a=o(3551),f=o(9042),_=o(3730),S=o(1680),u=o(3107),r=o(5744),s=o(2950),e=o(1296),t=o(428),l=o(4269),v=o(5114),g=o(8934),b=o(3230),p=o(9312),w=o(4725),L=o(6731),M=o(8055),B=o(8969),D=o(8460),H=o(844),I=o(6114),$=o(8437),z=o(2584),N=o(7399),y=o(5941),A=o(9074),O=o(2585),P=o(5435),U=o(4567),V=o(779);class J 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(T={}){super(T),this.browser=I,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new H.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(A.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(V.LinkProviderService),this._instantiationService.setService(w.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((k,W)=>this.refresh(k,W)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((k=>this._reportWindowsOptions(k)))),this.register(this._inputHandler.onColor((k=>this._handleColorEvent(k)))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((k=>this._afterResize(k.cols,k.rows)))),this.register((0,H.toDisposable)((()=>{var k,W;this._customKeyEventHandler=void 0,(W=(k=this.element)==null?void 0:k.parentNode)==null||W.removeChild(this.element)})))}_handleColorEvent(T){if(this._themeService)for(const k of T){let W,F="";switch(k.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;"+k.index}switch(k.type){case 0:const K=M.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[k.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${z.C0.ESC}]${F};${(0,y.toRgbString)(K)}${z.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors((G=>G.ansi[k.index]=M.channels.toColor(...k.color)));else{const G=W;this._themeService.modifyColors((Q=>Q[G]=M.channels.toColor(...k.color)))}break;case 2:this._themeService.restoreColor(k.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(T){T?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(T){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var T;return(T=this.textarea)==null?void 0:T.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.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 T=this.buffer.ybase+this.buffer.y,k=this.buffer.lines.get(T);if(!k)return;const W=Math.min(this.buffer.x,this.cols-1),F=this._renderService.dimensions.css.cell.height,K=k.getWidth(W),G=this._renderService.dimensions.css.cell.width*K,Q=this.buffer.y*this._renderService.dimensions.css.cell.height,ee=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ee+"px",this.textarea.style.top=Q+"px",this.textarea.style.width=G+"px",this.textarea.style.height=F+"px",this.textarea.style.lineHeight=F+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,d.addDisposableDomListener)(this.element,"copy",(k=>{this.hasSelection()&&(0,c.copyHandler)(k,this._selectionService)})));const T=k=>(0,c.handlePasteEvent)(k,this.textarea,this.coreService,this.optionsService);this.register((0,d.addDisposableDomListener)(this.textarea,"paste",T)),this.register((0,d.addDisposableDomListener)(this.element,"paste",T)),I.isFirefox?this.register((0,d.addDisposableDomListener)(this.element,"mousedown",(k=>{k.button===2&&(0,c.rightClickHandler)(k,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,d.addDisposableDomListener)(this.element,"contextmenu",(k=>{(0,c.rightClickHandler)(k,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),I.isLinux&&this.register((0,d.addDisposableDomListener)(this.element,"auxclick",(k=>{k.button===1&&(0,c.moveTextAreaUnderMouseCursor)(k,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,d.addDisposableDomListener)(this.textarea,"keyup",(T=>this._keyUp(T)),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keydown",(T=>this._keyDown(T)),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"keypress",(T=>this._keyPress(T)),!0)),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionupdate",(T=>this._compositionHelper.compositionupdate(T)))),this.register((0,d.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,d.addDisposableDomListener)(this.textarea,"input",(T=>this._inputEvent(T)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(T){var W;if(!T)throw new Error("Terminal requires a parent element.");if(T.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=T.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"),T.appendChild(this.element);const k=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),k.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,d.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),k.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",f.promptLabel),I.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(v.CoreBrowserService,this.textarea,T.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(w.ICoreBrowserService,this._coreBrowserService),this.register((0,d.addDisposableDomListener)(this.textarea,"focus",(F=>this._handleTextAreaFocus(F)))),this.register((0,d.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(t.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(w.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(w.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(l.CharacterJoinerService),this._instantiationService.setService(w.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(b.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(w.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(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(g.MouseService),this._instantiationService.setService(w.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(a.Linkifier,this.screenElement)),this.element.appendChild(k);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(S.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(p.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(w.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,d.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(u.BufferDecorationRenderer,this.screenElement)),this.register((0,d.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(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(F=>this._handleScreenReaderModeOptionChange(F)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(F=>{!this._overviewRulerRenderer&&F&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const T=this,k=this.element;function W(G){const Q=T._mouseService.getMouseReportCoords(G,T.screenElement);if(!Q)return!1;let ee,te;switch(G.overrideType||G.type){case"mousemove":te=32,G.buttons===void 0?(ee=3,G.button!==void 0&&(ee=G.button<3?G.button:3)):ee=1&G.buttons?0:4&G.buttons?1:2&G.buttons?2:3;break;case"mouseup":te=0,ee=G.button<3?G.button:3;break;case"mousedown":te=1,ee=G.button<3?G.button:3;break;case"wheel":if(T._customWheelEventHandler&&T._customWheelEventHandler(G)===!1||T.viewport.getLinesScrolled(G)===0)return!1;te=G.deltaY<0?0:1,ee=4;break;default:return!1}return!(te===void 0||ee===void 0||ee>4)&&T.coreMouseService.triggerMouseEvent({col:Q.col,row:Q.row,x:Q.x,y:Q.y,button:ee,action:te,ctrl:G.ctrlKey,alt:G.altKey,shift:G.shiftKey})}const F={mouseup:null,wheel:null,mousedrag:null,mousemove:null},K={mouseup:G=>(W(G),G.buttons||(this._document.removeEventListener("mouseup",F.mouseup),F.mousedrag&&this._document.removeEventListener("mousemove",F.mousedrag)),this.cancel(G)),wheel:G=>(W(G),this.cancel(G,!0)),mousedrag:G=>{G.buttons&&W(G)},mousemove:G=>{G.buttons||W(G)}};this.register(this.coreMouseService.onProtocolChange((G=>{G?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(G)),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&G?F.mousemove||(k.addEventListener("mousemove",K.mousemove),F.mousemove=K.mousemove):(k.removeEventListener("mousemove",F.mousemove),F.mousemove=null),16&G?F.wheel||(k.addEventListener("wheel",K.wheel,{passive:!1}),F.wheel=K.wheel):(k.removeEventListener("wheel",F.wheel),F.wheel=null),2&G?F.mouseup||(F.mouseup=K.mouseup):(this._document.removeEventListener("mouseup",F.mouseup),F.mouseup=null),4&G?F.mousedrag||(F.mousedrag=K.mousedrag):(this._document.removeEventListener("mousemove",F.mousedrag),F.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,d.addDisposableDomListener)(k,"mousedown",(G=>{if(G.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(G))return W(G),F.mouseup&&this._document.addEventListener("mouseup",F.mouseup),F.mousedrag&&this._document.addEventListener("mousemove",F.mousedrag),this.cancel(G)}))),this.register((0,d.addDisposableDomListener)(k,"wheel",(G=>{if(!F.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(G)===!1)return!1;if(!this.buffer.hasScrollback){const Q=this.viewport.getLinesScrolled(G);if(Q===0)return;const ee=z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(G.deltaY<0?"A":"B");let te="";for(let ie=0;ie<Math.abs(Q);ie++)te+=ee;return this.coreService.triggerDataEvent(te,!0),this.cancel(G,!0)}return this.viewport.handleWheel(G)?this.cancel(G):void 0}}),{passive:!1})),this.register((0,d.addDisposableDomListener)(k,"touchstart",(G=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(G),this.cancel(G)}),{passive:!0})),this.register((0,d.addDisposableDomListener)(k,"touchmove",(G=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(G)?void 0:this.cancel(G)}),{passive:!1}))}refresh(T,k){var W;(W=this._renderService)==null||W.refreshRows(T,k)}updateCursorStyle(T){var k;(k=this._selectionService)!=null&&k.shouldColumnSelect(T)?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(T,k,W=0){var F;W===1?(super.scrollLines(T,k,W),this.refresh(0,this.rows-1)):(F=this.viewport)==null||F.scrollLines(T)}paste(T){(0,c.paste)(T,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(T){this._customKeyEventHandler=T}attachCustomWheelEventHandler(T){this._customWheelEventHandler=T}registerLinkProvider(T){return this._linkProviderService.registerLinkProvider(T)}registerCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const k=this._characterJoinerService.register(T);return this.refresh(0,this.rows-1),k}deregisterCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(T)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(T){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+T)}registerDecoration(T){return this._decorationService.registerDecoration(T)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(T,k,W){this._selectionService.setSelection(T,k,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 T;(T=this._selectionService)==null||T.clearSelection()}selectAll(){var T;(T=this._selectionService)==null||T.selectAll()}selectLines(T,k){var W;(W=this._selectionService)==null||W.selectLines(T,k)}_keyDown(T){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;const k=this.browser.isMac&&this.options.macOptionIsMeta&&T.altKey;if(!k&&!this._compositionHelper.keydown(T))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;k||T.key!=="Dead"&&T.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const W=(0,N.evaluateKeyboardEvent)(T,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(T),W.type===3||W.type===2){const F=this.rows-1;return this.scrollLines(W.type===2?-F:F),this.cancel(T,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,T)||(W.cancel&&this.cancel(T,!0),!W.key||!!(T.key&&!T.ctrlKey&&!T.altKey&&!T.metaKey&&T.key.length===1&&T.key.charCodeAt(0)>=65&&T.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(W.key!==z.C0.ETX&&W.key!==z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||T.altKey||T.ctrlKey?this.cancel(T,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(T,k){const W=T.isMac&&!this.options.macOptionIsMeta&&k.altKey&&!k.ctrlKey&&!k.metaKey||T.isWindows&&k.altKey&&k.ctrlKey&&!k.metaKey||T.isWindows&&k.getModifierState("AltGraph");return k.type==="keypress"?W:W&&(!k.keyCode||k.keyCode>47)}_keyUp(T){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1||((function(k){return k.keyCode===16||k.keyCode===17||k.keyCode===18})(T)||this.focus(),this.updateCursorStyle(T),this._keyPressHandled=!1)}_keyPress(T){let k;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;if(this.cancel(T),T.charCode)k=T.charCode;else if(T.which===null||T.which===void 0)k=T.keyCode;else{if(T.which===0||T.charCode===0)return!1;k=T.which}return!(!k||(T.altKey||T.ctrlKey||T.metaKey)&&!this._isThirdLevelShift(this.browser,T)||(k=String.fromCharCode(k),this._onKey.fire({key:k,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(k,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(T){if(T.data&&T.inputType==="insertText"&&(!T.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const k=T.data;return this.coreService.triggerDataEvent(k,!0),this.cancel(T),!0}return!1}resize(T,k){T!==this.cols||k!==this.rows?super.resize(T,k):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(T,k){var W,F;(W=this._charSizeService)==null||W.measure(),(F=this.viewport)==null||F.syncScrollArea(!0)}clear(){var T;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 k=1;k<this.rows;k++)this.buffer.lines.push(this.buffer.getBlankLine($.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(T=this.viewport)==null||T.reset(),this.refresh(0,this.rows-1)}}reset(){var k,W;this.options.rows=this.rows,this.options.cols=this.cols;const T=this._customKeyEventHandler;this._setup(),super.reset(),(k=this._selectionService)==null||k.reset(),this._decorationService.reset(),(W=this.viewport)==null||W.reset(),this._customKeyEventHandler=T,this.refresh(0,this.rows-1)}clearTextureAtlas(){var T;(T=this._renderService)==null||T.clearTextureAtlas()}_reportFocus(){var T;(T=this.element)!=null&&T.classList.contains("focus")?this.coreService.triggerDataEvent(z.C0.ESC+"[I"):this.coreService.triggerDataEvent(z.C0.ESC+"[O")}_reportWindowsOptions(T){if(this._renderService)switch(T){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const k=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[4;${W};${k}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const F=this._renderService.dimensions.css.cell.width.toFixed(0),K=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[6;${K};${F}t`)}}cancel(T,k){if(this.options.cancelEvents||k)return T.preventDefault(),T.stopPropagation(),!1}}i.Terminal=J},9924:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,d){this._rowCount=d,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const a=Date.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){const f=a-this._lastRefreshMs,_=this._debounceThresholdMS-f;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(x,i,o){var c=this&&this.__decorate||function(s,e,t,l){var v,g=arguments.length,b=g<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(s,e,t,l);else for(var p=s.length-1;p>=0;p--)(v=s[p])&&(b=(g<3?v(b):g>3?v(e,t,b):v(e,t))||b);return g>3&&b&&Object.defineProperty(e,t,b),b},d=this&&this.__param||function(s,e){return function(t,l){e(t,l,s)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;const a=o(3656),f=o(4725),_=o(8460),S=o(844),u=o(2585);let r=i.Viewport=class extends S.Disposable{constructor(s,e,t,l,v,g,b,p){super(),this._viewportElement=s,this._scrollArea=e,this._bufferService=t,this._optionsService=l,this._charSizeService=v,this._renderService=g,this._coreBrowserService=b,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 _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((w=>this._activeBuffer=w.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((w=>this._renderDimensions=w))),this._handleThemeChange(p.colors),this.register(p.onChangeColors((w=>this._handleThemeChange(w)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.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(s){if(s)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 e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const s=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==s&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=s),this._refreshAnimationFrame=null}syncScrollArea(s=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(s)}_handleScroll(s){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 e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const s=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(s*(this._smoothScrollState.target-this._smoothScrollState.origin)),s<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(s,e){const t=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&t<this._lastRecordedBufferHeight)||(s.cancelable&&s.preventDefault(),!1)}handleWheel(s){const e=this._getPixelsScrolled(s);return e!==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+e:this._smoothScrollState.target+=e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}scrollLines(s){if(s!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const e=s*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+e,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!1})}_getPixelsScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._currentRowHeight:s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._currentRowHeight*this._bufferService.rows),e}getBufferElements(s,e){var p;let t,l="";const v=[],g=e??this._bufferService.buffer.lines.length,b=this._bufferService.buffer.lines;for(let w=s;w<g;w++){const L=b.get(w);if(!L)continue;const M=(p=b.get(w+1))==null?void 0:p.isWrapped;if(l+=L.translateToString(!M),!M||w===b.length-1){const B=document.createElement("div");B.textContent=l,v.push(B),l.length>0&&(t=B),l=""}}return{bufferElements:v,cursorElement:t}}getLinesScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(s,e){const t=this._optionsService.rawOptions.fastScrollModifier;return t==="alt"&&e.altKey||t==="ctrl"&&e.ctrlKey||t==="shift"&&e.shiftKey?s*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:s*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(s){this._lastTouchY=s.touches[0].pageY}handleTouchMove(s){const e=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}};i.Viewport=r=c([d(2,u.IBufferService),d(3,u.IOptionsService),d(4,f.ICharSizeService),d(5,f.IRenderService),d(6,f.ICoreBrowserService),d(7,f.IThemeService)],r)},3107:function(x,i,o){var c=this&&this.__decorate||function(u,r,s,e){var t,l=arguments.length,v=l<3?r:e===null?e=Object.getOwnPropertyDescriptor(r,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(u,r,s,e);else for(var g=u.length-1;g>=0;g--)(t=u[g])&&(v=(l<3?t(v):l>3?t(r,s,v):t(r,s))||v);return l>3&&v&&Object.defineProperty(r,s,v),v},d=this&&this.__param||function(u,r){return function(s,e){r(s,e,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;const a=o(4725),f=o(844),_=o(2585);let S=i.BufferDecorationRenderer=class extends f.Disposable{constructor(u,r,s,e,t){super(),this._screenElement=u,this._bufferService=r,this._coreBrowserService=s,this._decorationService=e,this._renderService=t,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((l=>this._removeDecoration(l)))),this.register((0,f.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 u of this._decorationService.decorations)this._renderDecoration(u);this._dimensionsChanged=!1}_renderDecoration(u){this._refreshStyle(u),this._dimensionsChanged&&this._refreshXPosition(u)}_createElement(u){var e;const r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",((e=u==null?void 0:u.options)==null?void 0:e.layer)==="top"),r.style.width=`${Math.round((u.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=(u.options.height||1)*this._renderService.dimensions.css.cell.height+"px",r.style.top=(u.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const s=u.options.x??0;return s&&s>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(u,r),r}_refreshStyle(u){const r=u.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)u.element&&(u.element.style.display="none",u.onRenderEmitter.fire(u.element));else{let s=this._decorationElements.get(u);s||(s=this._createElement(u),u.element=s,this._decorationElements.set(u,s),this._container.appendChild(s),u.onDispose((()=>{this._decorationElements.delete(u),s.remove()}))),s.style.top=r*this._renderService.dimensions.css.cell.height+"px",s.style.display=this._altBufferIsActive?"none":"block",u.onRenderEmitter.fire(s)}}_refreshXPosition(u,r=u.element){if(!r)return;const s=u.options.x??0;(u.options.anchor||"left")==="right"?r.style.right=s?s*this._renderService.dimensions.css.cell.width+"px":"":r.style.left=s?s*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(u){var r;(r=this._decorationElements.get(u))==null||r.remove(),this._decorationElements.delete(u),u.dispose()}};i.BufferDecorationRenderer=S=c([d(1,_.IBufferService),d(2,a.ICoreBrowserService),d(3,_.IDecorationService),d(4,a.IRenderService)],S)},5871:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.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(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,c){return c>=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,d){return c>=o.startBufferLine-this._linePadding[d||"full"]&&c<=o.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(x,i,o){var c=this&&this.__decorate||function(t,l,v,g){var b,p=arguments.length,w=p<3?l:g===null?g=Object.getOwnPropertyDescriptor(l,v):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(t,l,v,g);else for(var L=t.length-1;L>=0;L--)(b=t[L])&&(w=(p<3?b(w):p>3?b(l,v,w):b(l,v))||w);return p>3&&w&&Object.defineProperty(l,v,w),w},d=this&&this.__param||function(t,l){return function(v,g){l(v,g,t)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;const a=o(5871),f=o(4725),_=o(844),S=o(2585),u={full:0,left:0,center:0,right:0},r={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0};let e=i.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(t,l,v,g,b,p,w){var M;super(),this._viewportElement=t,this._screenElement=l,this._bufferService=v,this._decorationService=g,this._renderService=b,this._optionsService=p,this._coreBrowserService=w,this._colorZoneStore=new a.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(M=this._viewportElement.parentElement)==null||M.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.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 t=Math.floor(this._canvas.width/3),l=Math.ceil(this._canvas.width/3);r.full=this._canvas.width,r.left=t,r.center=l,r.right=t,this._refreshDrawHeightConstants(),s.full=0,s.left=0,s.center=r.left,s.right=r.left+r.center}_refreshDrawHeightConstants(){u.full=Math.round(2*this._coreBrowserService.dpr);const t=this._canvas.height/this._bufferService.buffer.lines.length,l=Math.round(Math.max(Math.min(t,12),6)*this._coreBrowserService.dpr);u.left=l,u.center=l,u.right=l}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.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 l of this._decorationService.decorations)this._colorZoneStore.addDecoration(l);this._ctx.lineWidth=1;const t=this._colorZoneStore.zones;for(const l of t)l.position!=="full"&&this._renderColorZone(l);for(const l of t)l.position==="full"&&this._renderColorZone(l);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(t){this._ctx.fillStyle=t.color,this._ctx.fillRect(s[t.position||"full"],Math.round((this._canvas.height-1)*(t.startBufferLine/this._bufferService.buffers.active.lines.length)-u[t.position||"full"]/2),r[t.position||"full"],Math.round((this._canvas.height-1)*((t.endBufferLine-t.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[t.position||"full"]))}_queueRefresh(t,l){this._shouldUpdateDimensions=t||this._shouldUpdateDimensions,this._shouldUpdateAnchor=l||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};i.OverviewRulerRenderer=e=c([d(2,S.IBufferService),d(3,S.IDecorationService),d(4,f.IRenderService),d(5,S.IOptionsService),d(6,f.ICoreBrowserService)],e)},2950:function(x,i,o){var c=this&&this.__decorate||function(u,r,s,e){var t,l=arguments.length,v=l<3?r:e===null?e=Object.getOwnPropertyDescriptor(r,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(u,r,s,e);else for(var g=u.length-1;g>=0;g--)(t=u[g])&&(v=(l<3?t(v):l>3?t(r,s,v):t(r,s))||v);return l>3&&v&&Object.defineProperty(r,s,v),v},d=this&&this.__param||function(u,r){return function(s,e){r(s,e,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;const a=o(4725),f=o(2585),_=o(2584);let S=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(u,r,s,e,t,l){this._textarea=u,this._compositionView=r,this._bufferService=s,this._optionsService=e,this._coreService=t,this._renderService=l,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(u){this._compositionView.textContent=u.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(u){if(this._isComposing||this._isSendingComposition){if(u.keyCode===229||u.keyCode===16||u.keyCode===17||u.keyCode===18)return!1;this._finalizeComposition(!1)}return u.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(u){if(this._compositionView.classList.remove("active"),this._isComposing=!1,u){const r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let s;this._isSendingComposition=!1,r.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(r.start,r.end):this._textarea.value.substring(r.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}}),0)}else{this._isSendingComposition=!1;const r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}}_handleAnyTextareaChanges(){const u=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const r=this._textarea.value,s=r.replace(u,"");this._dataAlreadySent=s,r.length>u.length?this._coreService.triggerDataEvent(s,!0):r.length<u.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):r.length===u.length&&r!==u&&this._coreService.triggerDataEvent(r,!0)}}),0)}updateCompositionElements(u){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,e=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,t=r*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=t+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const l=this._compositionView.getBoundingClientRect();this._textarea.style.left=t+"px",this._textarea.style.top=e+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}u||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=S=c([d(2,f.IBufferService),d(3,f.IOptionsService),d(4,f.ICoreService),d(5,a.IRenderService)],S)},9806:(x,i)=>{function o(c,d,a){const f=a.getBoundingClientRect(),_=c.getComputedStyle(a),S=parseInt(_.getPropertyValue("padding-left")),u=parseInt(_.getPropertyValue("padding-top"));return[d.clientX-f.left-S,d.clientY-f.top-u]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=o,i.getCoords=function(c,d,a,f,_,S,u,r,s){if(!S)return;const e=o(c,d,a);return e?(e[0]=Math.ceil((e[0]+(s?u/2:0))/u),e[1]=Math.ceil(e[1]/r),e[0]=Math.min(Math.max(e[0],1),f+(s?1:0)),e[1]=Math.min(Math.max(e[1],1),_),e):void 0}},9504:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;const c=o(2584);function d(r,s,e,t){const l=r-a(r,e),v=s-a(s,e),g=Math.abs(l-v)-(function(b,p,w){let L=0;const M=b-a(b,w),B=p-a(p,w);for(let D=0;D<Math.abs(M-B);D++){const H=f(b,p)==="A"?-1:1,I=w.buffer.lines.get(M+H*D);I!=null&&I.isWrapped&&L++}return L})(r,s,e);return u(g,S(f(r,s),t))}function a(r,s){let e=0,t=s.buffer.lines.get(r),l=t==null?void 0:t.isWrapped;for(;l&&r>=0&&r<s.rows;)e++,t=s.buffer.lines.get(--r),l=t==null?void 0:t.isWrapped;return e}function f(r,s){return r>s?"A":"B"}function _(r,s,e,t,l,v){let g=r,b=s,p="";for(;g!==e||b!==t;)g+=l?1:-1,l&&g>v.cols-1?(p+=v.buffer.translateBufferLineToString(b,!1,r,g),g=0,r=0,b++):!l&&g<0&&(p+=v.buffer.translateBufferLineToString(b,!1,0,r+1),g=v.cols-1,r=g,b--);return p+v.buffer.translateBufferLineToString(b,!1,r,g)}function S(r,s){const e=s?"O":"[";return c.C0.ESC+e+r}function u(r,s){r=Math.floor(r);let e="";for(let t=0;t<r;t++)e+=s;return e}i.moveToCellSequence=function(r,s,e,t){const l=e.buffer.x,v=e.buffer.y;if(!e.buffer.hasScrollback)return(function(p,w,L,M,B,D){return d(w,M,B,D).length===0?"":u(_(p,w,p,w-a(w,B),!1,B).length,S("D",D))})(l,v,0,s,e,t)+d(v,s,e,t)+(function(p,w,L,M,B,D){let H;H=d(w,M,B,D).length>0?M-a(M,B):w;const I=M,$=(function(z,N,y,A,O,P){let U;return U=d(y,A,O,P).length>0?A-a(A,O):N,z<y&&U<=A||z>=y&&U<A?"C":"D"})(p,w,L,M,B,D);return u(_(p,H,L,I,$==="C",B).length,S($,D))})(l,v,r,s,e,t);let g;if(v===s)return g=l>r?"D":"C",u(Math.abs(l-r),S(g,t));g=v>s?"D":"C";const b=Math.abs(v-s);return u((function(p,w){return w.cols-p})(v>s?r:l,e)+(b-1)*e.cols+1+((v>s?l:r)-1),S(g,t))}},1296:function(x,i,o){var c=this&&this.__decorate||function(D,H,I,$){var z,N=arguments.length,y=N<3?H:$===null?$=Object.getOwnPropertyDescriptor(H,I):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(D,H,I,$);else for(var A=D.length-1;A>=0;A--)(z=D[A])&&(y=(N<3?z(y):N>3?z(H,I,y):z(H,I))||y);return N>3&&y&&Object.defineProperty(H,I,y),y},d=this&&this.__param||function(D,H){return function(I,$){H(I,$,D)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;const a=o(3787),f=o(2550),_=o(2223),S=o(6171),u=o(6052),r=o(4725),s=o(8055),e=o(8460),t=o(844),l=o(2585),v="xterm-dom-renderer-owner-",g="xterm-rows",b="xterm-fg-",p="xterm-bg-",w="xterm-focus",L="xterm-selection";let M=1,B=i.DomRenderer=class extends t.Disposable{constructor(D,H,I,$,z,N,y,A,O,P,U,V,J){super(),this._terminal=D,this._document=H,this._element=I,this._screenElement=$,this._viewportElement=z,this._helperContainer=N,this._linkifier2=y,this._charSizeService=O,this._optionsService=P,this._bufferService=U,this._coreBrowserService=V,this._themeService=J,this._terminalClass=M++,this._rowElements=[],this._selectionRenderModel=(0,u.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(g),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(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((Y=>this._injectCss(Y)))),this._injectCss(this._themeService.colors),this._rowFactory=A.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(v+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((Y=>this._handleLinkHover(Y)))),this.register(this._linkifier2.onHideLinkUnderline((Y=>this._handleLinkLeave(Y)))),this.register((0,t.toDisposable)((()=>{this._element.classList.remove(v+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new f.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 D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),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/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),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 I of this._rowElements)I.style.width=`${this.dimensions.css.canvas.width}px`,I.style.height=`${this.dimensions.css.cell.height}px`,I.style.lineHeight=`${this.dimensions.css.cell.height}px`,I.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const H=`${this._terminalSelector} .${g} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=H,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(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let H=`${this._terminalSelector} .${g} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;H+=`${this._terminalSelector} .${g} .xterm-dim { color: ${s.color.multiplyOpacity(D.foreground,.5).css};}`,H+=`${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 I=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,z=`blink_block_${this._terminalClass}`;H+=`@keyframes ${I} { 50% { border-bottom-style: hidden; }}`,H+=`@keyframes ${$} { 50% { box-shadow: none; }}`,H+=`@keyframes ${z} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,H+=`${this._terminalSelector} .${g}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${I} 1s step-end infinite;}${this._terminalSelector} .${g}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${g}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,H+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[N,y]of D.ansi.entries())H+=`${this._terminalSelector} .${b}${N} { color: ${y.css}; }${this._terminalSelector} .${b}${N}.xterm-dim { color: ${s.color.multiplyOpacity(y,.5).css}; }${this._terminalSelector} .${p}${N} { background-color: ${y.css}; }`;H+=`${this._terminalSelector} .${b}${_.INVERTED_DEFAULT_COLOR} { color: ${s.color.opaque(D.background).css}; }${this._terminalSelector} .${b}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${s.color.multiplyOpacity(s.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${p}${_.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=H}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,H){for(let I=this._rowElements.length;I<=H;I++){const $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>H;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,H){this._refreshRowElements(D,H),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(w),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(w),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,H,I){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,H,I),this.renderRows(0,this._bufferService.rows-1),!D||!H)return;this._selectionRenderModel.update(this._terminal,D,H,I);const $=this._selectionRenderModel.viewportStartRow,z=this._selectionRenderModel.viewportEndRow,N=this._selectionRenderModel.viewportCappedStartRow,y=this._selectionRenderModel.viewportCappedEndRow;if(N>=this._bufferService.rows||y<0)return;const A=this._document.createDocumentFragment();if(I){const O=D[0]>H[0];A.appendChild(this._createSelectionElement(N,O?H[0]:D[0],O?D[0]:H[0],y-N+1))}else{const O=$===N?D[0]:0,P=N===z?H[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement(N,O,P));const U=y-N-1;if(A.appendChild(this._createSelectionElement(N+1,0,this._bufferService.cols,U)),N!==y){const V=z===y?H[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement(y,0,V))}}this._selectionContainer.appendChild(A)}_createSelectionElement(D,H,I,$=1){const z=this._document.createElement("div"),N=H*this.dimensions.css.cell.width;let y=this.dimensions.css.cell.width*(I-H);return N+y>this.dimensions.css.canvas.width&&(y=this.dimensions.css.canvas.width-N),z.style.height=$*this.dimensions.css.cell.height+"px",z.style.top=D*this.dimensions.css.cell.height+"px",z.style.left=`${N}px`,z.style.width=`${y}px`,z}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 D of this._rowElements)D.replaceChildren()}renderRows(D,H){const I=this._bufferService.buffer,$=I.ybase+I.y,z=Math.min(I.x,this._bufferService.cols-1),N=this._optionsService.rawOptions.cursorBlink,y=this._optionsService.rawOptions.cursorStyle,A=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=D;O<=H;O++){const P=O+I.ydisp,U=this._rowElements[O],V=I.lines.get(P);if(!U||!V)break;U.replaceChildren(...this._rowFactory.createRow(V,P,P===$,y,A,z,N,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${v}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,H,I,$,z,N){I<0&&(D=0),$<0&&(H=0);const y=this._bufferService.rows-1;I=Math.max(Math.min(I,y),0),$=Math.max(Math.min($,y),0),z=Math.min(z,this._bufferService.cols);const A=this._bufferService.buffer,O=A.ybase+A.y,P=Math.min(A.x,z-1),U=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let Y=I;Y<=$;++Y){const T=Y+A.ydisp,k=this._rowElements[Y],W=A.lines.get(T);if(!k||!W)break;k.replaceChildren(...this._rowFactory.createRow(W,T,T===O,V,J,P,U,this.dimensions.css.cell.width,this._widthCache,N?Y===I?D:0:-1,N?(Y===$?H:z)-1:-1))}}};i.DomRenderer=B=c([d(7,l.IInstantiationService),d(8,r.ICharSizeService),d(9,l.IOptionsService),d(10,l.IBufferService),d(11,r.ICoreBrowserService),d(12,r.IThemeService)],B)},3787:function(x,i,o){var c=this&&this.__decorate||function(g,b,p,w){var L,M=arguments.length,B=M<3?b:w===null?w=Object.getOwnPropertyDescriptor(b,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(g,b,p,w);else for(var D=g.length-1;D>=0;D--)(L=g[D])&&(B=(M<3?L(B):M>3?L(b,p,B):L(b,p))||B);return M>3&&B&&Object.defineProperty(b,p,B),B},d=this&&this.__param||function(g,b){return function(p,w){b(p,w,g)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;const a=o(2223),f=o(643),_=o(511),S=o(2585),u=o(8055),r=o(4725),s=o(4269),e=o(6171),t=o(3734);let l=i.DomRendererRowFactory=class{constructor(g,b,p,w,L,M,B){this._document=g,this._characterJoinerService=b,this._optionsService=p,this._coreBrowserService=w,this._coreService=L,this._decorationService=M,this._themeService=B,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(g,b,p){this._selectionStart=g,this._selectionEnd=b,this._columnSelectMode=p}createRow(g,b,p,w,L,M,B,D,H,I,$){const z=[],N=this._characterJoinerService.getJoinedCharacters(b),y=this._themeService.colors;let A,O=g.getNoBgTrimmedLength();p&&O<M+1&&(O=M+1);let P=0,U="",V=0,J=0,Y=0,T=!1,k=0,W=!1,F=0;const K=[],G=I!==-1&&$!==-1;for(let Q=0;Q<O;Q++){g.loadCell(Q,this._workCell);let ee=this._workCell.getWidth();if(ee===0)continue;let te=!1,ie=Q,Z=this._workCell;if(N.length>0&&Q===N[0][0]){te=!0;const re=N.shift();Z=new s.JoinedCellData(this._workCell,g.translateToString(!0,re[0],re[1]),re[1]-re[0]),ie=re[1]-1,ee=Z.getWidth()}const ke=this._isCellInSelection(Q,b),me=p&&Q===M,pt=G&&Q>=I&&Q<=$;let vt=!1;this._decorationService.forEachDecorationAtCell(Q,b,void 0,(re=>{vt=!0}));let Ge=Z.getChars()||f.WHITESPACE_CELL_CHAR;if(Ge===" "&&(Z.isUnderline()||Z.isOverline())&&(Ge=" "),F=ee*D-H.get(Ge,Z.isBold(),Z.isItalic()),A){if(P&&(ke&&W||!ke&&!W&&Z.bg===V)&&(ke&&W&&y.selectionForeground||Z.fg===J)&&Z.extended.ext===Y&&pt===T&&F===k&&!me&&!te&&!vt){Z.isInvisible()?U+=f.WHITESPACE_CELL_CHAR:U+=Ge,P++;continue}P&&(A.textContent=U),A=this._document.createElement("span"),P=0,U=""}else A=this._document.createElement("span");if(V=Z.bg,J=Z.fg,Y=Z.extended.ext,T=pt,k=F,W=ke,te&&M>=Q&&M<=ie&&(M=Q),!this._coreService.isCursorHidden&&me&&this._coreService.isCursorInitialized){if(K.push("xterm-cursor"),this._coreBrowserService.isFocused)B&&K.push("xterm-cursor-blink"),K.push(w==="bar"?"xterm-cursor-bar":w==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":K.push("xterm-cursor-outline");break;case"block":K.push("xterm-cursor-block");break;case"bar":K.push("xterm-cursor-bar");break;case"underline":K.push("xterm-cursor-underline")}}if(Z.isBold()&&K.push("xterm-bold"),Z.isItalic()&&K.push("xterm-italic"),Z.isDim()&&K.push("xterm-dim"),U=Z.isInvisible()?f.WHITESPACE_CELL_CHAR:Z.getChars()||f.WHITESPACE_CELL_CHAR,Z.isUnderline()&&(K.push(`xterm-underline-${Z.extended.underlineStyle}`),U===" "&&(U=" "),!Z.isUnderlineColorDefault()))if(Z.isUnderlineColorRGB())A.style.textDecorationColor=`rgb(${t.AttributeData.toColorRGB(Z.getUnderlineColor()).join(",")})`;else{let re=Z.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Z.isBold()&&re<8&&(re+=8),A.style.textDecorationColor=y.ansi[re].css}Z.isOverline()&&(K.push("xterm-overline"),U===" "&&(U=" ")),Z.isStrikethrough()&&K.push("xterm-strikethrough"),pt&&(A.style.textDecoration="underline");let ae=Z.getFgColor(),Ie=Z.getFgColorMode(),he=Z.getBgColor(),He=Z.getBgColorMode();const gt=!!Z.isInverse();if(gt){const re=ae;ae=he,he=re;const fi=Ie;Ie=He,He=fi}let Se,Xe,be,Fe=!1;switch(this._decorationService.forEachDecorationAtCell(Q,b,void 0,(re=>{re.options.layer!=="top"&&Fe||(re.backgroundColorRGB&&(He=50331648,he=re.backgroundColorRGB.rgba>>8&16777215,Se=re.backgroundColorRGB),re.foregroundColorRGB&&(Ie=50331648,ae=re.foregroundColorRGB.rgba>>8&16777215,Xe=re.foregroundColorRGB),Fe=re.options.layer==="top")})),!Fe&&ke&&(Se=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,he=Se.rgba>>8&16777215,He=50331648,Fe=!0,y.selectionForeground&&(Ie=50331648,ae=y.selectionForeground.rgba>>8&16777215,Xe=y.selectionForeground)),Fe&&K.push("xterm-decoration-top"),He){case 16777216:case 33554432:be=y.ansi[he],K.push(`xterm-bg-${he}`);break;case 50331648:be=u.channels.toColor(he>>16,he>>8&255,255&he),this._addStyle(A,`background-color:#${v((he>>>0).toString(16),"0",6)}`);break;default:gt?(be=y.foreground,K.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):be=y.background}switch(Se||Z.isDim()&&(Se=u.color.multiplyOpacity(be,.5)),Ie){case 16777216:case 33554432:Z.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(A,be,y.ansi[ae],Z,Se,void 0)||K.push(`xterm-fg-${ae}`);break;case 50331648:const re=u.channels.toColor(ae>>16&255,ae>>8&255,255&ae);this._applyMinimumContrast(A,be,re,Z,Se,Xe)||this._addStyle(A,`color:#${v(ae.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(A,be,y.foreground,Z,Se,Xe)||gt&&K.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}K.length&&(A.className=K.join(" "),K.length=0),me||te||vt?A.textContent=U:P++,F!==this.defaultSpacing&&(A.style.letterSpacing=`${F}px`),z.push(A),Q=ie}return A&&P&&(A.textContent=U),z}_applyMinimumContrast(g,b,p,w,L,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(w.getCode()))return!1;const B=this._getContrastCache(w);let D;if(L||M||(D=B.getColor(b.rgba,p.rgba)),D===void 0){const H=this._optionsService.rawOptions.minimumContrastRatio/(w.isDim()?2:1);D=u.color.ensureContrastRatio(L||b,M||p,H),B.setColor((L||b).rgba,(M||p).rgba,D??null)}return!!D&&(this._addStyle(g,`color:${D.css}`),!0)}_getContrastCache(g){return g.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(g,b){g.setAttribute("style",`${g.getAttribute("style")||""}${b};`)}_isCellInSelection(g,b){const p=this._selectionStart,w=this._selectionEnd;return!(!p||!w)&&(this._columnSelectMode?p[0]<=w[0]?g>=p[0]&&b>=p[1]&&g<w[0]&&b<=w[1]:g<p[0]&&b>=p[1]&&g>=w[0]&&b<=w[1]:b>p[1]&&b<w[1]||p[1]===w[1]&&b===p[1]&&g>=p[0]&&g<w[0]||p[1]<w[1]&&b===w[1]&&g<w[0]||p[1]<w[1]&&b===p[1]&&g>=p[0])}};function v(g,b,p){for(;g.length<p;)g=b+g;return g}i.DomRendererRowFactory=l=c([d(1,r.ICharacterJoinerService),d(2,S.IOptionsService),d(3,r.ICoreBrowserService),d(4,S.ICoreService),d(5,S.IDecorationService),d(6,r.IThemeService)],l)},2550:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(o,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.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 d=o.createElement("span");d.classList.add("xterm-char-measure-element");const a=o.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold";const f=o.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontStyle="italic";const _=o.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[d,a,f,_],this._container.appendChild(d),this._container.appendChild(a),this._container.appendChild(f),this._container.appendChild(_),c.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(o,c,d,a){o===this._font&&c===this._fontSize&&d===this._weight&&a===this._weightBold||(this._font=o,this._fontSize=c,this._weight=d,this._weightBold=a,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${d}`,this._measureElements[1].style.fontWeight=`${a}`,this._measureElements[2].style.fontWeight=`${d}`,this._measureElements[3].style.fontWeight=`${a}`,this.clear())}get(o,c,d){let a=0;if(!c&&!d&&o.length===1&&(a=o.charCodeAt(0))<256){if(this._flat[a]!==-9999)return this._flat[a];const S=this._measure(o,0);return S>0&&(this._flat[a]=S),S}let f=o;c&&(f+="B"),d&&(f+="I");let _=this._holey.get(f);if(_===void 0){let S=0;c&&(S|=1),d&&(S|=2),_=this._measure(o,S),_>0&&this._holey.set(f,_)}return _}_measure(o,c){const d=this._measureElements[c];return d.textContent=o.repeat(32),d.offsetWidth/32}}},2223:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(x,i)=>{function o(d){return 57508<=d&&d<=57558}function c(d){return d>=128512&&d<=128591||d>=127744&&d<=128511||d>=128640&&d<=128767||d>=9728&&d<=9983||d>=9984&&d<=10175||d>=65024&&d<=65039||d>=129280&&d<=129535||d>=127462&&d<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},i.isPowerlineGlyph=o,i.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},i.isEmoji=c,i.allowRescaling=function(d,a,f,_){return a===1&&f>Math.ceil(1.5*_)&&d!==void 0&&d>255&&!c(d)&&!o(d)&&!(function(S){return 57344<=S&&S<=63743})(d)},i.treatGlyphAsBackgroundColor=function(d){return o(d)||(function(a){return 9472<=a&&a<=9631})(d)},i.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}}}},i.computeNextVariantOffset=function(d,a,f=0){return(d-(2*Math.round(a)-f))%(2*Math.round(a))}},6052:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class o{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(d,a,f,_=!1){if(this.selectionStart=a,this.selectionEnd=f,!a||!f||a[0]===f[0]&&a[1]===f[1])return void this.clear();const S=d.buffers.active.ydisp,u=a[1]-S,r=f[1]-S,s=Math.max(u,0),e=Math.min(r,d.rows-1);s>=d.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=u,this.viewportEndRow=r,this.viewportCappedStartRow=s,this.viewportCappedEndRow=e,this.startCol=a[0],this.endCol=f[0])}isCellSelected(d,a,f){return!!this.hasSelection&&(f-=d.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&f>=this.viewportCappedStartRow&&a<this.endCol&&f<=this.viewportCappedEndRow:a<this.startCol&&f>=this.viewportCappedStartRow&&a>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&a>=this.startCol)}}i.createSelectionRenderModel=function(){return new o}},456:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(x,i,o){var c=this&&this.__decorate||function(e,t,l,v){var g,b=arguments.length,p=b<3?t:v===null?v=Object.getOwnPropertyDescriptor(t,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(e,t,l,v);else for(var w=e.length-1;w>=0;w--)(g=e[w])&&(p=(b<3?g(p):b>3?g(t,l,p):g(t,l))||p);return b>3&&p&&Object.defineProperty(t,l,p),p},d=this&&this.__param||function(e,t){return function(l,v){t(l,v,e)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;const a=o(2585),f=o(8460),_=o(844);let S=i.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,l){super(),this._optionsService=l,this.width=0,this.height=0,this._onCharSizeChange=this.register(new f.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new s(this._optionsService))}catch{this._measureStrategy=this.register(new r(e,t,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};i.CharSizeService=S=c([d(2,a.IOptionsService)],S);class u extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,l){t!==void 0&&t>0&&l!==void 0&&l>0&&(this._result.width=t,this._result.height=l)}}class r extends u{constructor(t,l,v){super(),this._document=t,this._parentElement=l,this._optionsService=v,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 s extends u{constructor(t){super(),this._optionsService=t,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const l=this._ctx.measureText("W");if(!("width"in l&&"fontBoundingBoxAscent"in l&&"fontBoundingBoxDescent"in l))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const t=this._ctx.measureText("W");return this._validateAndSet(t.width,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent),this._result}}},4269:function(x,i,o){var c=this&&this.__decorate||function(s,e,t,l){var v,g=arguments.length,b=g<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(s,e,t,l);else for(var p=s.length-1;p>=0;p--)(v=s[p])&&(b=(g<3?v(b):g>3?v(e,t,b):v(e,t))||b);return g>3&&b&&Object.defineProperty(e,t,b),b},d=this&&this.__param||function(s,e){return function(t,l){e(t,l,s)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;const a=o(3734),f=o(643),_=o(511),S=o(2585);class u extends a.AttributeData{constructor(e,t,l){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=l}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=u;let r=i.CharacterJoinerService=class kr{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(e){const t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];const t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];const l=[],v=t.translateToString(!0);let g=0,b=0,p=0,w=t.getFg(0),L=t.getBg(0);for(let M=0;M<t.getTrimmedLength();M++)if(t.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==w||this._workCell.bg!==L){if(M-g>1){const B=this._getJoinedRanges(v,p,b,t,g);for(let D=0;D<B.length;D++)l.push(B[D])}g=M,p=b,w=this._workCell.fg,L=this._workCell.bg}b+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-g>1){const M=this._getJoinedRanges(v,p,b,t,g);for(let B=0;B<M.length;B++)l.push(M[B])}return l}_getJoinedRanges(e,t,l,v,g){const b=e.substring(t,l);let p=[];try{p=this._characterJoiners[0].handler(b)}catch(w){console.error(w)}for(let w=1;w<this._characterJoiners.length;w++)try{const L=this._characterJoiners[w].handler(b);for(let M=0;M<L.length;M++)kr._mergeRanges(p,L[M])}catch(L){console.error(L)}return this._stringRangesToCellRanges(p,v,g),p}_stringRangesToCellRanges(e,t,l){let v=0,g=!1,b=0,p=e[v];if(p){for(let w=l;w<this._bufferService.cols;w++){const L=t.getWidth(w),M=t.getString(w).length||f.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!g&&p[0]<=b&&(p[0]=w,g=!0),p[1]<=b){if(p[1]=w,p=e[++v],!p)break;p[0]<=b?(p[0]=w,g=!0):g=!1}b+=M}}p&&(p[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let l=!1;for(let v=0;v<e.length;v++){const g=e[v];if(l){if(t[1]<=g[0])return e[v-1][1]=t[1],e;if(t[1]<=g[1])return e[v-1][1]=Math.max(t[1],g[1]),e.splice(v,1),e;e.splice(v,1),v--}else{if(t[1]<=g[0])return e.splice(v,0,t),e;if(t[1]<=g[1])return g[0]=Math.min(t[0],g[0]),e;t[0]<g[1]&&(g[0]=Math.min(t[0],g[0]),l=!0)}}return l?e[e.length-1][1]=t[1]:e.push(t),e}};i.CharacterJoinerService=r=c([d(0,S.IBufferService)],r)},5114:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;const c=o(844),d=o(8460),a=o(3656);class f extends c.Disposable{constructor(u,r,s){super(),this._textarea=u,this._window=r,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new d.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((e=>this._screenDprMonitor.setWindow(e)))),this.register((0,d.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(u){this._window!==u&&(this._window=u,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}}i.CoreBrowserService=f;class _ extends c.Disposable{constructor(u){super(),this._parentWindow=u,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new d.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(u){this._parentWindow=u,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,a.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var u;this._outerListener&&((u=this._resolutionMediaMatchList)==null||u.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:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;const c=o(844);class d extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(f){return this.linkProviders.push(f),{dispose:()=>{const _=this.linkProviders.indexOf(f);_!==-1&&this.linkProviders.splice(_,1)}}}}i.LinkProviderService=d},8934:function(x,i,o){var c=this&&this.__decorate||function(S,u,r,s){var e,t=arguments.length,l=t<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,r):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(S,u,r,s);else for(var v=S.length-1;v>=0;v--)(e=S[v])&&(l=(t<3?e(l):t>3?e(u,r,l):e(u,r))||l);return t>3&&l&&Object.defineProperty(u,r,l),l},d=this&&this.__param||function(S,u){return function(r,s){u(r,s,S)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;const a=o(4725),f=o(9806);let _=i.MouseService=class{constructor(S,u){this._renderService=S,this._charSizeService=u}getCoords(S,u,r,s,e){return(0,f.getCoords)(window,S,u,r,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(S,u){const r=(0,f.getCoordsRelativeToElement)(window,S,u);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};i.MouseService=_=c([d(0,a.IRenderService),d(1,a.ICharSizeService)],_)},3230:function(x,i,o){var c=this&&this.__decorate||function(e,t,l,v){var g,b=arguments.length,p=b<3?t:v===null?v=Object.getOwnPropertyDescriptor(t,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(e,t,l,v);else for(var w=e.length-1;w>=0;w--)(g=e[w])&&(p=(b<3?g(p):b>3?g(t,l,p):g(t,l))||p);return b>3&&p&&Object.defineProperty(t,l,p),p},d=this&&this.__param||function(e,t){return function(l,v){t(l,v,e)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;const a=o(6193),f=o(4725),_=o(8460),S=o(844),u=o(7226),r=o(2585);let s=i.RenderService=class extends S.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,l,v,g,b,p,w){super(),this._rowCount=e,this._charSizeService=v,this._renderer=this.register(new S.MutableDisposable),this._pausedResizeTask=new u.DebouncedIdleTask,this._observerDisposable=this.register(new S.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 _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new a.RenderDebouncer(((L,M)=>this._renderRows(L,M)),p),this.register(this._renderDebouncer),this.register(p.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(b.onResize((()=>this._fullRefresh()))),this.register(b.buffers.onBufferActivate((()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()}))),this.register(l.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(g.onDecorationRegistered((()=>this._fullRefresh()))),this.register(g.onDecorationRemoved((()=>this._fullRefresh()))),this.register(l.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(b.cols,b.rows),this._fullRefresh()}))),this.register(l.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(b.buffer.y,b.buffer.y,!0)))),this.register(w.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(p.window,t),this.register(p.onWindowChange((L=>this._registerIntersectionObserver(L,t))))}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){const l=new e.IntersectionObserver((v=>this._handleIntersectionChange(v[v.length-1])),{threshold:0});l.observe(t),this._observerDisposable.value=(0,S.toDisposable)((()=>l.disconnect()))}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,l=!1){this._isPaused?this._needsFullRefresh=!0:(l||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw((t=>this.refreshRows(t.start,t.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var l;return(l=this._renderer.value)==null?void 0:l.handleResize(e,t)})):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,l){var v;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=l,(v=this._renderer.value)==null||v.handleSelectionChanged(e,t,l)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};i.RenderService=s=c([d(2,r.IOptionsService),d(3,f.ICharSizeService),d(4,r.IDecorationService),d(5,r.IBufferService),d(6,f.ICoreBrowserService),d(7,f.IThemeService)],s)},9312:function(x,i,o){var c=this&&this.__decorate||function(p,w,L,M){var B,D=arguments.length,H=D<3?w:M===null?M=Object.getOwnPropertyDescriptor(w,L):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(p,w,L,M);else for(var I=p.length-1;I>=0;I--)(B=p[I])&&(H=(D<3?B(H):D>3?B(w,L,H):B(w,L))||H);return D>3&&H&&Object.defineProperty(w,L,H),H},d=this&&this.__param||function(p,w){return function(L,M){w(L,M,p)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;const a=o(9806),f=o(9504),_=o(456),S=o(4725),u=o(8460),r=o(844),s=o(6114),e=o(4841),t=o(511),l=o(2585),v=" ",g=new RegExp(v,"g");let b=i.SelectionService=class extends r.Disposable{constructor(p,w,L,M,B,D,H,I,$){super(),this._element=p,this._screenElement=w,this._linkifier=L,this._bufferService=M,this._coreService=B,this._mouseService=D,this._optionsService=H,this._renderService=I,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new t.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new u.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new u.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new u.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new u.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=z=>this._handleMouseMove(z),this._mouseUpListener=z=>this._handleMouseUp(z),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((z=>this._handleTrim(z))),this.register(this._bufferService.buffers.onBufferActivate((z=>this._handleBufferActivate(z)))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,r.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 p=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!(!p||!w||p[0]===w[0]&&p[1]===w[1])}get selectionText(){const p=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;if(!p||!w)return"";const L=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(p[0]===w[0])return"";const B=p[0]<w[0]?p[0]:w[0],D=p[0]<w[0]?w[0]:p[0];for(let H=p[1];H<=w[1];H++){const I=L.translateBufferLineToString(H,!0,B,D);M.push(I)}}else{const B=p[1]===w[1]?w[0]:void 0;M.push(L.translateBufferLineToString(p[1],!0,p[0],B));for(let D=p[1]+1;D<=w[1]-1;D++){const H=L.lines.get(D),I=L.translateBufferLineToString(D,!0);H!=null&&H.isWrapped?M[M.length-1]+=I:M.push(I)}if(p[1]!==w[1]){const D=L.lines.get(w[1]),H=L.translateBufferLineToString(w[1],!0,0,w[0]);D&&D.isWrapped?M[M.length-1]+=H:M.push(H)}}return M.map((B=>B.replace(g," "))).join(s.isWindows?`\r
|
|
16
|
+
`:`
|
|
17
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(p){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),s.isLinux&&p&&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(p){const w=this._getMouseBufferCoords(p),L=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(L&&M&&w)&&this._areCoordsInSelection(w,L,M)}isCellInSelection(p,w){const L=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!L||!M)&&this._areCoordsInSelection([p,w],L,M)}_areCoordsInSelection(p,w,L){return p[1]>w[1]&&p[1]<L[1]||w[1]===L[1]&&p[1]===w[1]&&p[0]>=w[0]&&p[0]<L[0]||w[1]<L[1]&&p[1]===L[1]&&p[0]<L[0]||w[1]<L[1]&&p[1]===w[1]&&p[0]>=w[0]}_selectWordAtCursor(p,w){var B,D;const L=(D=(B=this._linkifier.currentLink)==null?void 0:B.link)==null?void 0:D.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(p);return!!M&&(this._selectWordAt(M,w),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(p,w){this._model.clearSelection(),p=Math.max(p,0),w=Math.min(w,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,p],this._model.selectionEnd=[this._bufferService.cols,w],this.refresh(),this._onSelectionChange.fire()}_handleTrim(p){this._model.handleTrim(p)&&this.refresh()}_getMouseBufferCoords(p){const w=this._mouseService.getCoords(p,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(w)return w[0]--,w[1]--,w[1]+=this._bufferService.buffer.ydisp,w}_getMouseEventScrollAmount(p){let w=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,p,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return w>=0&&w<=L?0:(w>L&&(w-=L),w=Math.min(Math.max(w,-50),50),w/=50,w/Math.abs(w)+Math.round(14*w))}shouldForceSelection(p){return s.isMac?p.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:p.shiftKey}handleMouseDown(p){if(this._mouseDownTimeStamp=p.timeStamp,(p.button!==2||!this.hasSelection)&&p.button===0){if(!this._enabled){if(!this.shouldForceSelection(p))return;p.stopPropagation()}p.preventDefault(),this._dragScrollAmount=0,this._enabled&&p.shiftKey?this._handleIncrementalClick(p):p.detail===1?this._handleSingleClick(p):p.detail===2?this._handleDoubleClick(p):p.detail===3&&this._handleTripleClick(p),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(p){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(p))}_handleSingleClick(p){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(p)?3:0,this._model.selectionStart=this._getMouseBufferCoords(p),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const w=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);w&&w.length!==this._model.selectionStart[0]&&w.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(p){this._selectWordAtCursor(p,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(p){const w=this._getMouseBufferCoords(p);w&&(this._activeSelectionMode=2,this._selectLineAt(w[1]))}shouldColumnSelect(p){return p.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(p){if(p.stopImmediatePropagation(),!this._model.selectionStart)return;const w=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(p),!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(p),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const M=L.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}w&&w[0]===this._model.selectionEnd[0]&&w[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 p=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(p.ydisp+this._bufferService.rows,p.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=p.ydisp),this.refresh()}}_handleMouseUp(p){const w=p.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&w<500&&p.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(p,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const M=(0,f.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const p=this._model.finalSelectionStart,w=this._model.finalSelectionEnd,L=!(!p||!w||p[0]===w[0]&&p[1]===w[1]);L?p&&w&&(this._oldSelectionStart&&this._oldSelectionEnd&&p[0]===this._oldSelectionStart[0]&&p[1]===this._oldSelectionStart[1]&&w[0]===this._oldSelectionEnd[0]&&w[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(p,w,L)):this._oldHasSelection&&this._fireOnSelectionChange(p,w,L)}_fireOnSelectionChange(p,w,L){this._oldSelectionStart=p,this._oldSelectionEnd=w,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(p){this.clearSelection(),this._trimListener.dispose(),this._trimListener=p.activeBuffer.lines.onTrim((w=>this._handleTrim(w)))}_convertViewportColToCharacterIndex(p,w){let L=w;for(let M=0;w>=M;M++){const B=p.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:B>1&&w!==M&&(L+=B-1)}return L}setSelection(p,w,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[p,w],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(p){this._isClickInSelection(p)||(this._selectWordAtCursor(p,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(p,w,L=!0,M=!0){if(p[0]>=this._bufferService.cols)return;const B=this._bufferService.buffer,D=B.lines.get(p[1]);if(!D)return;const H=B.translateBufferLineToString(p[1],!1);let I=this._convertViewportColToCharacterIndex(D,p[0]),$=I;const z=p[0]-I;let N=0,y=0,A=0,O=0;if(H.charAt(I)===" "){for(;I>0&&H.charAt(I-1)===" ";)I--;for(;$<H.length&&H.charAt($+1)===" ";)$++}else{let V=p[0],J=p[0];D.getWidth(V)===0&&(N++,V--),D.getWidth(J)===2&&(y++,J++);const Y=D.getString(J).length;for(Y>1&&(O+=Y-1,$+=Y-1);V>0&&I>0&&!this._isCharWordSeparator(D.loadCell(V-1,this._workCell));){D.loadCell(V-1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===0?(N++,V--):T>1&&(A+=T-1,I-=T-1),I--,V--}for(;J<D.length&&$+1<H.length&&!this._isCharWordSeparator(D.loadCell(J+1,this._workCell));){D.loadCell(J+1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===2?(y++,J++):T>1&&(O+=T-1,$+=T-1),$++,J++}}$++;let P=I+z-N+A,U=Math.min(this._bufferService.cols,$-I+N+y-A-O);if(w||H.slice(I,$).trim()!==""){if(L&&P===0&&D.getCodePoint(0)!==32){const V=B.lines.get(p[1]-1);if(V&&D.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,p[1]-1],!1,!0,!1);if(J){const Y=this._bufferService.cols-J.start;P-=Y,U+=Y}}}if(M&&P+U===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const V=B.lines.get(p[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const J=this._getWordAt([0,p[1]+1],!1,!1,!0);J&&(U+=J.length)}}return{start:P,length:U}}}_selectWordAt(p,w){const L=this._getWordAt(p,w);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,p[1]--;this._model.selectionStart=[L.start,p[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(p){const w=this._getWordAt(p,!0);if(w){let L=p[1];for(;w.start<0;)w.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;w.start+w.length>this._bufferService.cols;)w.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?w.start:w.start+w.length,L]}}_isCharWordSeparator(p){return p.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(p.getChars())>=0}_selectLineAt(p){const w=this._bufferService.buffer.getWrappedRangeForLine(p),L={start:{x:0,y:w.first},end:{x:this._bufferService.cols-1,y:w.last}};this._model.selectionStart=[0,w.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(L,this._bufferService.cols)}};i.SelectionService=b=c([d(3,l.IBufferService),d(4,l.ICoreService),d(5,S.IMouseService),d(6,l.IOptionsService),d(7,S.IRenderService),d(8,S.ICoreBrowserService)],b)},4725:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;const c=o(8343);i.ICharSizeService=(0,c.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),i.IMouseService=(0,c.createDecorator)("MouseService"),i.IRenderService=(0,c.createDecorator)("RenderService"),i.ISelectionService=(0,c.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,c.createDecorator)("ThemeService"),i.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(x,i,o){var c=this&&this.__decorate||function(b,p,w,L){var M,B=arguments.length,D=B<3?p:L===null?L=Object.getOwnPropertyDescriptor(p,w):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,p,w,L);else for(var H=b.length-1;H>=0;H--)(M=b[H])&&(D=(B<3?M(D):B>3?M(p,w,D):M(p,w))||D);return B>3&&D&&Object.defineProperty(p,w,D),D},d=this&&this.__param||function(b,p){return function(w,L){p(w,L,b)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const a=o(7239),f=o(8055),_=o(8460),S=o(844),u=o(2585),r=f.css.toColor("#ffffff"),s=f.css.toColor("#000000"),e=f.css.toColor("#ffffff"),t=f.css.toColor("#000000"),l={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const b=[f.css.toColor("#2e3436"),f.css.toColor("#cc0000"),f.css.toColor("#4e9a06"),f.css.toColor("#c4a000"),f.css.toColor("#3465a4"),f.css.toColor("#75507b"),f.css.toColor("#06989a"),f.css.toColor("#d3d7cf"),f.css.toColor("#555753"),f.css.toColor("#ef2929"),f.css.toColor("#8ae234"),f.css.toColor("#fce94f"),f.css.toColor("#729fcf"),f.css.toColor("#ad7fa8"),f.css.toColor("#34e2e2"),f.css.toColor("#eeeeec")],p=[0,95,135,175,215,255];for(let w=0;w<216;w++){const L=p[w/36%6|0],M=p[w/6%6|0],B=p[w%6];b.push({css:f.channels.toCss(L,M,B),rgba:f.channels.toRgba(L,M,B)})}for(let w=0;w<24;w++){const L=8+10*w;b.push({css:f.channels.toCss(L,L,L),rgba:f.channels.toRgba(L,L,L)})}return b})());let v=i.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(b){super(),this._optionsService=b,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:r,background:s,cursor:e,cursorAccent:t,selectionForeground:void 0,selectionBackgroundTransparent:l,selectionBackgroundOpaque:f.color.blend(s,l),selectionInactiveBackgroundTransparent:l,selectionInactiveBackgroundOpaque:f.color.blend(s,l),ansi:i.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(b={}){const p=this._colors;if(p.foreground=g(b.foreground,r),p.background=g(b.background,s),p.cursor=g(b.cursor,e),p.cursorAccent=g(b.cursorAccent,t),p.selectionBackgroundTransparent=g(b.selectionBackground,l),p.selectionBackgroundOpaque=f.color.blend(p.background,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundTransparent=g(b.selectionInactiveBackground,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundOpaque=f.color.blend(p.background,p.selectionInactiveBackgroundTransparent),p.selectionForeground=b.selectionForeground?g(b.selectionForeground,f.NULL_COLOR):void 0,p.selectionForeground===f.NULL_COLOR&&(p.selectionForeground=void 0),f.color.isOpaque(p.selectionBackgroundTransparent)&&(p.selectionBackgroundTransparent=f.color.opacity(p.selectionBackgroundTransparent,.3)),f.color.isOpaque(p.selectionInactiveBackgroundTransparent)&&(p.selectionInactiveBackgroundTransparent=f.color.opacity(p.selectionInactiveBackgroundTransparent,.3)),p.ansi=i.DEFAULT_ANSI_COLORS.slice(),p.ansi[0]=g(b.black,i.DEFAULT_ANSI_COLORS[0]),p.ansi[1]=g(b.red,i.DEFAULT_ANSI_COLORS[1]),p.ansi[2]=g(b.green,i.DEFAULT_ANSI_COLORS[2]),p.ansi[3]=g(b.yellow,i.DEFAULT_ANSI_COLORS[3]),p.ansi[4]=g(b.blue,i.DEFAULT_ANSI_COLORS[4]),p.ansi[5]=g(b.magenta,i.DEFAULT_ANSI_COLORS[5]),p.ansi[6]=g(b.cyan,i.DEFAULT_ANSI_COLORS[6]),p.ansi[7]=g(b.white,i.DEFAULT_ANSI_COLORS[7]),p.ansi[8]=g(b.brightBlack,i.DEFAULT_ANSI_COLORS[8]),p.ansi[9]=g(b.brightRed,i.DEFAULT_ANSI_COLORS[9]),p.ansi[10]=g(b.brightGreen,i.DEFAULT_ANSI_COLORS[10]),p.ansi[11]=g(b.brightYellow,i.DEFAULT_ANSI_COLORS[11]),p.ansi[12]=g(b.brightBlue,i.DEFAULT_ANSI_COLORS[12]),p.ansi[13]=g(b.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),p.ansi[14]=g(b.brightCyan,i.DEFAULT_ANSI_COLORS[14]),p.ansi[15]=g(b.brightWhite,i.DEFAULT_ANSI_COLORS[15]),b.extendedAnsi){const w=Math.min(p.ansi.length-16,b.extendedAnsi.length);for(let L=0;L<w;L++)p.ansi[L+16]=g(b.extendedAnsi[L],i.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(b){this._restoreColor(b),this._onChangeColors.fire(this.colors)}_restoreColor(b){if(b!==void 0)switch(b){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[b]=this._restoreColors.ansi[b]}else for(let p=0;p<this._restoreColors.ansi.length;++p)this._colors.ansi[p]=this._restoreColors.ansi[p]}modifyColors(b){b(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 g(b,p){if(b!==void 0)try{return f.css.toColor(b)}catch{}return p}i.ThemeService=v=c([d(0,u.IOptionsService)],v)},6349:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;const c=o(8460),d=o(844);class a extends d.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.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(_){if(this._maxLength===_)return;const S=new Array(_);for(let u=0;u<Math.min(_,this.length);u++)S[u]=this._array[this._getCyclicIndex(u)];this._array=S,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let S=this._length;S<_;S++)this._array[S]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,S){this._array[this._getCyclicIndex(_)]=S}push(_){this._array[this._getCyclicIndex(this._length)]=_,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,...u){if(S){for(let r=_;r<this._length-S;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+S)];this._length-=S,this.onDeleteEmitter.fire({index:_,amount:S})}for(let r=this._length-1;r>=_;r--)this._array[this._getCyclicIndex(r+u.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<u.length;r++)this._array[this._getCyclicIndex(_+r)]=u[r];if(u.length&&this.onInsertEmitter.fire({index:_,amount:u.length}),this._length+u.length>this._maxLength){const r=this._length+u.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=u.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,S,u){if(!(S<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+u<0)throw new Error("Cannot shift elements in list beyond index 0");if(u>0){for(let s=S-1;s>=0;s--)this.set(_+s+u,this.get(_+s));const r=_+S+u-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<S;r++)this.set(_+r+u,this.get(_+r))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}i.CircularList=a},1439:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function o(c,d=5){if(typeof c!="object")return c;const a=Array.isArray(c)?[]:{};for(const f in c)a[f]=d<=1?c[f]:c[f]&&o(c[f],d-1);return a}},8055:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let o=0,c=0,d=0,a=0;var f,_,S,u,r;function s(t){const l=t.toString(16);return l.length<2?"0"+l:l}function e(t,l){return t<l?(l+.05)/(t+.05):(t+.05)/(l+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(t){t.toCss=function(l,v,g,b){return b!==void 0?`#${s(l)}${s(v)}${s(g)}${s(b)}`:`#${s(l)}${s(v)}${s(g)}`},t.toRgba=function(l,v,g,b=255){return(l<<24|v<<16|g<<8|b)>>>0},t.toColor=function(l,v,g,b){return{css:t.toCss(l,v,g,b),rgba:t.toRgba(l,v,g,b)}}})(f||(i.channels=f={})),(function(t){function l(v,g){return a=Math.round(255*g),[o,c,d]=r.toChannels(v.rgba),{css:f.toCss(o,c,d,a),rgba:f.toRgba(o,c,d,a)}}t.blend=function(v,g){if(a=(255&g.rgba)/255,a===1)return{css:g.css,rgba:g.rgba};const b=g.rgba>>24&255,p=g.rgba>>16&255,w=g.rgba>>8&255,L=v.rgba>>24&255,M=v.rgba>>16&255,B=v.rgba>>8&255;return o=L+Math.round((b-L)*a),c=M+Math.round((p-M)*a),d=B+Math.round((w-B)*a),{css:f.toCss(o,c,d),rgba:f.toRgba(o,c,d)}},t.isOpaque=function(v){return(255&v.rgba)==255},t.ensureContrastRatio=function(v,g,b){const p=r.ensureContrastRatio(v.rgba,g.rgba,b);if(p)return f.toColor(p>>24&255,p>>16&255,p>>8&255)},t.opaque=function(v){const g=(255|v.rgba)>>>0;return[o,c,d]=r.toChannels(g),{css:f.toCss(o,c,d),rgba:g}},t.opacity=l,t.multiplyOpacity=function(v,g){return a=255&v.rgba,l(v,a*g/255)},t.toColorRGB=function(v){return[v.rgba>>24&255,v.rgba>>16&255,v.rgba>>8&255]}})(_||(i.color=_={})),(function(t){let l,v;try{const g=document.createElement("canvas");g.width=1,g.height=1;const b=g.getContext("2d",{willReadFrequently:!0});b&&(l=b,l.globalCompositeOperation="copy",v=l.createLinearGradient(0,0,1,1))}catch{}t.toColor=function(g){if(g.match(/#[\da-f]{3,8}/i))switch(g.length){case 4:return o=parseInt(g.slice(1,2).repeat(2),16),c=parseInt(g.slice(2,3).repeat(2),16),d=parseInt(g.slice(3,4).repeat(2),16),f.toColor(o,c,d);case 5:return o=parseInt(g.slice(1,2).repeat(2),16),c=parseInt(g.slice(2,3).repeat(2),16),d=parseInt(g.slice(3,4).repeat(2),16),a=parseInt(g.slice(4,5).repeat(2),16),f.toColor(o,c,d,a);case 7:return{css:g,rgba:(parseInt(g.slice(1),16)<<8|255)>>>0};case 9:return{css:g,rgba:parseInt(g.slice(1),16)>>>0}}const b=g.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(b)return o=parseInt(b[1]),c=parseInt(b[2]),d=parseInt(b[3]),a=Math.round(255*(b[5]===void 0?1:parseFloat(b[5]))),f.toColor(o,c,d,a);if(!l||!v)throw new Error("css.toColor: Unsupported css format");if(l.fillStyle=v,l.fillStyle=g,typeof l.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(l.fillRect(0,0,1,1),[o,c,d,a]=l.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(o,c,d,a),css:g}}})(S||(i.css=S={})),(function(t){function l(v,g,b){const p=v/255,w=g/255,L=b/255;return .2126*(p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4))+.7152*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}t.relativeLuminance=function(v){return l(v>>16&255,v>>8&255,255&v)},t.relativeLuminance2=l})(u||(i.rgb=u={})),(function(t){function l(g,b,p){const w=g>>24&255,L=g>>16&255,M=g>>8&255;let B=b>>24&255,D=b>>16&255,H=b>>8&255,I=e(u.relativeLuminance2(B,D,H),u.relativeLuminance2(w,L,M));for(;I<p&&(B>0||D>0||H>0);)B-=Math.max(0,Math.ceil(.1*B)),D-=Math.max(0,Math.ceil(.1*D)),H-=Math.max(0,Math.ceil(.1*H)),I=e(u.relativeLuminance2(B,D,H),u.relativeLuminance2(w,L,M));return(B<<24|D<<16|H<<8|255)>>>0}function v(g,b,p){const w=g>>24&255,L=g>>16&255,M=g>>8&255;let B=b>>24&255,D=b>>16&255,H=b>>8&255,I=e(u.relativeLuminance2(B,D,H),u.relativeLuminance2(w,L,M));for(;I<p&&(B<255||D<255||H<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),D=Math.min(255,D+Math.ceil(.1*(255-D))),H=Math.min(255,H+Math.ceil(.1*(255-H))),I=e(u.relativeLuminance2(B,D,H),u.relativeLuminance2(w,L,M));return(B<<24|D<<16|H<<8|255)>>>0}t.blend=function(g,b){if(a=(255&b)/255,a===1)return b;const p=b>>24&255,w=b>>16&255,L=b>>8&255,M=g>>24&255,B=g>>16&255,D=g>>8&255;return o=M+Math.round((p-M)*a),c=B+Math.round((w-B)*a),d=D+Math.round((L-D)*a),f.toRgba(o,c,d)},t.ensureContrastRatio=function(g,b,p){const w=u.relativeLuminance(g>>8),L=u.relativeLuminance(b>>8);if(e(w,L)<p){if(L<w){const D=l(g,b,p),H=e(w,u.relativeLuminance(D>>8));if(H<p){const I=v(g,b,p);return H>e(w,u.relativeLuminance(I>>8))?D:I}return D}const M=v(g,b,p),B=e(w,u.relativeLuminance(M>>8));if(B<p){const D=l(g,b,p);return B>e(w,u.relativeLuminance(D>>8))?M:D}return M}},t.reduceLuminance=l,t.increaseLuminance=v,t.toChannels=function(g){return[g>>24&255,g>>16&255,g>>8&255,255&g]}})(r||(i.rgba=r={})),i.toPaddedHex=s,i.contrastRatio=e},8969:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;const c=o(844),d=o(2585),a=o(4348),f=o(7866),_=o(744),S=o(7302),u=o(6975),r=o(8460),s=o(1753),e=o(1480),t=o(7994),l=o(9282),v=o(5435),g=o(5981),b=o(2660);let p=!1;class w extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new r.EventEmitter),this._onScroll.event((M=>{var B;(B=this._onScrollApi)==null||B.fire(M.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(M){for(const B in M)this.optionsService.options[B]=M[B]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new r.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new r.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new r.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new r.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new S.OptionsService(M)),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(f.LogService)),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(u.CoreService)),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(b.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new v.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,r.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,r.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,r.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,r.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 g.WriteBuffer(((B,D)=>this._inputHandler.parse(B,D)))),this.register((0,r.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,B){this._writeBuffer.write(M,B)}writeSync(M,B){this._logService.logLevel<=d.LogLevelEnum.WARN&&!p&&(this._logService.warn("writeSync is unreliable and will be removed soon."),p=!0),this._writeBuffer.writeSync(M,B)}input(M,B=!0){this.coreService.triggerDataEvent(M,B)}resize(M,B){isNaN(M)||isNaN(B)||(M=Math.max(M,_.MINIMUM_COLS),B=Math.max(B,_.MINIMUM_ROWS),this._bufferService.resize(M,B))}scroll(M,B=!1){this._bufferService.scroll(M,B)}scrollLines(M,B,D){this._bufferService.scrollLines(M,B,D)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const B=M-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(M,B){return this._inputHandler.registerEscHandler(M,B)}registerDcsHandler(M,B){return this._inputHandler.registerDcsHandler(M,B)}registerCsiHandler(M,B){return this._inputHandler.registerCsiHandler(M,B)}registerOscHandler(M,B){return this._inputHandler.registerOscHandler(M,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?M=B.backend==="conpty"&&B.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(l.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},(()=>((0,l.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const B of M)B.dispose()}))}}}i.CoreTerminal=w},8460:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const d=[];for(let a=0;a<this._listeners.length;a++)d.push(this._listeners[a]);for(let a=0;a<d.length;a++)d[a].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(o,c){return o((d=>c.fire(d)))},i.runAndSubscribe=function(o,c){return c(void 0),o((d=>c(d)))}},5435:function(x,i,o){var c=this&&this.__decorate||function(N,y,A,O){var P,U=arguments.length,V=U<3?y:O===null?O=Object.getOwnPropertyDescriptor(y,A):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(N,y,A,O);else for(var J=N.length-1;J>=0;J--)(P=N[J])&&(V=(U<3?P(V):U>3?P(y,A,V):P(y,A))||V);return U>3&&V&&Object.defineProperty(y,A,V),V},d=this&&this.__param||function(N,y){return function(A,O){y(A,O,N)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;const a=o(2584),f=o(7116),_=o(2015),S=o(844),u=o(482),r=o(8437),s=o(8460),e=o(643),t=o(511),l=o(3734),v=o(2585),g=o(1480),b=o(6242),p=o(6351),w=o(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function B(N,y){if(N>24)return y.setWinLines||!1;switch(N){case 1:return!!y.restoreWin;case 2:return!!y.minimizeWin;case 3:return!!y.setWinPosition;case 4:return!!y.setWinSizePixels;case 5:return!!y.raiseWin;case 6:return!!y.lowerWin;case 7:return!!y.refreshWin;case 8:return!!y.setWinSizeChars;case 9:return!!y.maximizeWin;case 10:return!!y.fullscreenWin;case 11:return!!y.getWinState;case 13:return!!y.getWinPosition;case 14:return!!y.getWinSizePixels;case 15:return!!y.getScreenSizePixels;case 16:return!!y.getCellSizePixels;case 18:return!!y.getWinSizeChars;case 19:return!!y.getScreenSizeChars;case 20:return!!y.getIconTitle;case 21:return!!y.getWinTitle;case 22:return!!y.pushTitle;case 23:return!!y.popTitle;case 24:return!!y.setWinLines}return!1}var D;(function(N){N[N.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",N[N.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(i.WindowsOptionsReportType=D={}));let H=0;class I extends S.Disposable{getAttrData(){return this._curAttrData}constructor(y,A,O,P,U,V,J,Y,T=new _.EscapeSequenceParser){super(),this._bufferService=y,this._charsetService=A,this._coreService=O,this._logService=P,this._optionsService=U,this._oscLinkService=V,this._coreMouseService=J,this._unicodeService=Y,this._parser=T,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new u.StringToUtf32,this._utf8Decoder=new u.Utf8ToUtf32,this._workCell=new t.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new s.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new s.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new s.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new s.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new s.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new s.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new s.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new s.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new s.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new s.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new s.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 $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((k=>this._activeBuffer=k.activeBuffer))),this._parser.setCsiHandlerFallback(((k,W)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(k),params:W.toArray()})})),this._parser.setEscHandlerFallback((k=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(k)})})),this._parser.setExecuteHandlerFallback((k=>{this._logService.debug("Unknown EXECUTE code: ",{code:k})})),this._parser.setOscHandlerFallback(((k,W,F)=>{this._logService.debug("Unknown OSC code: ",{identifier:k,action:W,data:F})})),this._parser.setDcsHandlerFallback(((k,W,F)=>{W==="HOOK"&&(F=F.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(k),action:W,payload:F})})),this._parser.setPrintHandler(((k,W,F)=>this.print(k,W,F))),this._parser.registerCsiHandler({final:"@"},(k=>this.insertChars(k))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(k=>this.scrollLeft(k))),this._parser.registerCsiHandler({final:"A"},(k=>this.cursorUp(k))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(k=>this.scrollRight(k))),this._parser.registerCsiHandler({final:"B"},(k=>this.cursorDown(k))),this._parser.registerCsiHandler({final:"C"},(k=>this.cursorForward(k))),this._parser.registerCsiHandler({final:"D"},(k=>this.cursorBackward(k))),this._parser.registerCsiHandler({final:"E"},(k=>this.cursorNextLine(k))),this._parser.registerCsiHandler({final:"F"},(k=>this.cursorPrecedingLine(k))),this._parser.registerCsiHandler({final:"G"},(k=>this.cursorCharAbsolute(k))),this._parser.registerCsiHandler({final:"H"},(k=>this.cursorPosition(k))),this._parser.registerCsiHandler({final:"I"},(k=>this.cursorForwardTab(k))),this._parser.registerCsiHandler({final:"J"},(k=>this.eraseInDisplay(k,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(k=>this.eraseInDisplay(k,!0))),this._parser.registerCsiHandler({final:"K"},(k=>this.eraseInLine(k,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(k=>this.eraseInLine(k,!0))),this._parser.registerCsiHandler({final:"L"},(k=>this.insertLines(k))),this._parser.registerCsiHandler({final:"M"},(k=>this.deleteLines(k))),this._parser.registerCsiHandler({final:"P"},(k=>this.deleteChars(k))),this._parser.registerCsiHandler({final:"S"},(k=>this.scrollUp(k))),this._parser.registerCsiHandler({final:"T"},(k=>this.scrollDown(k))),this._parser.registerCsiHandler({final:"X"},(k=>this.eraseChars(k))),this._parser.registerCsiHandler({final:"Z"},(k=>this.cursorBackwardTab(k))),this._parser.registerCsiHandler({final:"`"},(k=>this.charPosAbsolute(k))),this._parser.registerCsiHandler({final:"a"},(k=>this.hPositionRelative(k))),this._parser.registerCsiHandler({final:"b"},(k=>this.repeatPrecedingCharacter(k))),this._parser.registerCsiHandler({final:"c"},(k=>this.sendDeviceAttributesPrimary(k))),this._parser.registerCsiHandler({prefix:">",final:"c"},(k=>this.sendDeviceAttributesSecondary(k))),this._parser.registerCsiHandler({final:"d"},(k=>this.linePosAbsolute(k))),this._parser.registerCsiHandler({final:"e"},(k=>this.vPositionRelative(k))),this._parser.registerCsiHandler({final:"f"},(k=>this.hVPosition(k))),this._parser.registerCsiHandler({final:"g"},(k=>this.tabClear(k))),this._parser.registerCsiHandler({final:"h"},(k=>this.setMode(k))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(k=>this.setModePrivate(k))),this._parser.registerCsiHandler({final:"l"},(k=>this.resetMode(k))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(k=>this.resetModePrivate(k))),this._parser.registerCsiHandler({final:"m"},(k=>this.charAttributes(k))),this._parser.registerCsiHandler({final:"n"},(k=>this.deviceStatus(k))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(k=>this.deviceStatusPrivate(k))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(k=>this.softReset(k))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(k=>this.setCursorStyle(k))),this._parser.registerCsiHandler({final:"r"},(k=>this.setScrollRegion(k))),this._parser.registerCsiHandler({final:"s"},(k=>this.saveCursor(k))),this._parser.registerCsiHandler({final:"t"},(k=>this.windowOptions(k))),this._parser.registerCsiHandler({final:"u"},(k=>this.restoreCursor(k))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(k=>this.insertColumns(k))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(k=>this.deleteColumns(k))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(k=>this.selectProtected(k))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(k=>this.requestMode(k,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(k=>this.requestMode(k,!1))),this._parser.setExecuteHandler(a.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(a.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(a.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(a.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(a.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(a.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(a.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(a.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(a.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new b.OscHandler((k=>(this.setTitle(k),this.setIconName(k),!0)))),this._parser.registerOscHandler(1,new b.OscHandler((k=>this.setIconName(k)))),this._parser.registerOscHandler(2,new b.OscHandler((k=>this.setTitle(k)))),this._parser.registerOscHandler(4,new b.OscHandler((k=>this.setOrReportIndexedColor(k)))),this._parser.registerOscHandler(8,new b.OscHandler((k=>this.setHyperlink(k)))),this._parser.registerOscHandler(10,new b.OscHandler((k=>this.setOrReportFgColor(k)))),this._parser.registerOscHandler(11,new b.OscHandler((k=>this.setOrReportBgColor(k)))),this._parser.registerOscHandler(12,new b.OscHandler((k=>this.setOrReportCursorColor(k)))),this._parser.registerOscHandler(104,new b.OscHandler((k=>this.restoreIndexedColor(k)))),this._parser.registerOscHandler(110,new b.OscHandler((k=>this.restoreFgColor(k)))),this._parser.registerOscHandler(111,new b.OscHandler((k=>this.restoreBgColor(k)))),this._parser.registerOscHandler(112,new b.OscHandler((k=>this.restoreCursorColor(k)))),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 k in f.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:k},(()=>this.selectCharset("("+k))),this._parser.registerEscHandler({intermediates:")",final:k},(()=>this.selectCharset(")"+k))),this._parser.registerEscHandler({intermediates:"*",final:k},(()=>this.selectCharset("*"+k))),this._parser.registerEscHandler({intermediates:"+",final:k},(()=>this.selectCharset("+"+k))),this._parser.registerEscHandler({intermediates:"-",final:k},(()=>this.selectCharset("-"+k))),this._parser.registerEscHandler({intermediates:".",final:k},(()=>this.selectCharset("."+k))),this._parser.registerEscHandler({intermediates:"/",final:k},(()=>this.selectCharset("/"+k)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((k=>(this._logService.error("Parsing error: ",k),k))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new p.DcsHandler(((k,W)=>this.requestStatusString(k,W))))}_preserveStack(y,A,O,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=y,this._parseStack.cursorStartY=A,this._parseStack.decodedLength=O,this._parseStack.position=P}_logSlowResolvingAsync(y){this._logService.logLevel<=v.LogLevelEnum.WARN&&Promise.race([y,new Promise(((A,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((A=>{if(A!=="#SLOW_TIMEOUT")throw A;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(y,A){let O,P=this._activeBuffer.x,U=this._activeBuffer.y,V=0;const J=this._parseStack.paused;if(J){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,A))return this._logSlowResolvingAsync(O),O;P=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,y.length>M&&(V=this._parseStack.position+M)}if(this._logService.logLevel<=v.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof y=="string"?` "${y}"`:` "${Array.prototype.map.call(y,(k=>String.fromCharCode(k))).join("")}"`),typeof y=="string"?y.split("").map((k=>k.charCodeAt(0))):y),this._parseBuffer.length<y.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(y.length,M))),J||this._dirtyRowTracker.clearRange(),y.length>M)for(let k=V;k<y.length;k+=M){const W=k+M<y.length?k+M:y.length,F=typeof y=="string"?this._stringDecoder.decode(y.substring(k,W),this._parseBuffer):this._utf8Decoder.decode(y.subarray(k,W),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,F))return this._preserveStack(P,U,F,k),this._logSlowResolvingAsync(O),O}else if(!J){const k=typeof y=="string"?this._stringDecoder.decode(y,this._parseBuffer):this._utf8Decoder.decode(y,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,k))return this._preserveStack(P,U,k,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===P&&this._activeBuffer.y===U||this._onCursorMove.fire();const Y=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),T=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);T<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(T,this._bufferService.rows-1),Math.min(Y,this._bufferService.rows-1))}print(y,A,O){let P,U;const V=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,Y=this._bufferService.cols,T=this._coreService.decPrivateModes.wraparound,k=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&&O-A>0&&F.getWidth(this._activeBuffer.x-1)===2&&F.setCellFromCodepoint(this._activeBuffer.x-1,0,1,W);let K=this._parser.precedingJoinState;for(let G=A;G<O;++G){if(P=y[G],P<127&&V){const ie=V[String.fromCharCode(P)];ie&&(P=ie.charCodeAt(0))}const Q=this._unicodeService.charProperties(P,K);U=g.UnicodeService.extractWidth(Q);const ee=g.UnicodeService.extractShouldJoin(Q),te=ee?g.UnicodeService.extractWidth(K):0;if(K=Q,J&&this._onA11yChar.fire((0,u.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+U-te>Y){if(T){const ie=F;let Z=this._activeBuffer.x-te;for(this._activeBuffer.x=te,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),te>0&&F instanceof r.BufferLine&&F.copyCellsFrom(ie,Z,0,te,!1);Z<Y;)ie.setCellFromCodepoint(Z++,0,1,W)}else if(this._activeBuffer.x=Y-1,U===2)continue}if(ee&&this._activeBuffer.x){const ie=F.getWidth(this._activeBuffer.x-1)?1:2;F.addCodepointToCell(this._activeBuffer.x-ie,P,U);for(let Z=U-te;--Z>=0;)F.setCellFromCodepoint(this._activeBuffer.x++,0,0,W)}else if(k&&(F.insertCells(this._activeBuffer.x,U-te,this._activeBuffer.getNullCell(W)),F.getWidth(Y-1)===2&&F.setCellFromCodepoint(Y-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,W)),F.setCellFromCodepoint(this._activeBuffer.x++,P,U,W),U>0)for(;--U;)F.setCellFromCodepoint(this._activeBuffer.x++,0,0,W)}this._parser.precedingJoinState=K,this._activeBuffer.x<Y&&O-A>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(y,A){return y.final!=="t"||y.prefix||y.intermediates?this._parser.registerCsiHandler(y,A):this._parser.registerCsiHandler(y,(O=>!B(O.params[0],this._optionsService.rawOptions.windowOptions)||A(O)))}registerDcsHandler(y,A){return this._parser.registerDcsHandler(y,new p.DcsHandler(A))}registerEscHandler(y,A){return this._parser.registerEscHandler(y,A)}registerOscHandler(y,A){return this._parser.registerOscHandler(y,new b.OscHandler(A))}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 y;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&&((y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&y.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);A.hasWidth(this._activeBuffer.x)&&!A.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const y=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-y),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(y=this._bufferService.cols-1){this._activeBuffer.x=Math.min(y,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(y,A){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=y,this._activeBuffer.y=this._activeBuffer.scrollTop+A):(this._activeBuffer.x=y,this._activeBuffer.y=A),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(y,A){this._restrictCursor(),this._setCursor(this._activeBuffer.x+y,this._activeBuffer.y+A)}cursorUp(y){const A=this._activeBuffer.y-this._activeBuffer.scrollTop;return A>=0?this._moveCursor(0,-Math.min(A,y.params[0]||1)):this._moveCursor(0,-(y.params[0]||1)),!0}cursorDown(y){const A=this._activeBuffer.scrollBottom-this._activeBuffer.y;return A>=0?this._moveCursor(0,Math.min(A,y.params[0]||1)):this._moveCursor(0,y.params[0]||1),!0}cursorForward(y){return this._moveCursor(y.params[0]||1,0),!0}cursorBackward(y){return this._moveCursor(-(y.params[0]||1),0),!0}cursorNextLine(y){return this.cursorDown(y),this._activeBuffer.x=0,!0}cursorPrecedingLine(y){return this.cursorUp(y),this._activeBuffer.x=0,!0}cursorCharAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(y){return this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1),!0}charPosAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(y){return this._moveCursor(y.params[0]||1,0),!0}linePosAbsolute(y){return this._setCursor(this._activeBuffer.x,(y.params[0]||1)-1),!0}vPositionRelative(y){return this._moveCursor(0,y.params[0]||1),!0}hVPosition(y){return this.cursorPosition(y),!0}tabClear(y){const A=y.params[0];return A===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:A===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=y.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=y.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(y){const A=y.params[0];return A===1&&(this._curAttrData.bg|=536870912),A!==2&&A!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(y,A,O,P=!1,U=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);V.replaceCells(A,O,this._activeBuffer.getNullCell(this._eraseAttrData()),U),P&&(V.isWrapped=!1)}_resetBufferLine(y,A=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),A),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+y),O.isWrapped=!1)}eraseInDisplay(y,A=!1){let O;switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);O<this._bufferService.rows;O++)this._resetBufferLine(O,A);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,A),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,A);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,A);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(y,A=!1){switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,A);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,A)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(y){this._restrictCursor();let A=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;A--;)this._activeBuffer.lines.splice(U-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(y){this._restrictCursor();let A=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;A--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(y){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.insertCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(y){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.deleteCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(y){let A=y.params[0]||1;for(;A--;)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(y){let A=y.params[0]||1;for(;A--;)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(r.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=y.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);P.deleteCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=y.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);P.insertCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=y.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);P.insertCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=y.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);P.deleteCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(y){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(y.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(y){const A=this._parser.precedingJoinState;if(!A)return!0;const O=y.params[0]||1,P=g.UnicodeService.extractWidth(A),U=this._activeBuffer.x-P,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(U),J=new Uint32Array(V.length*O);let Y=0;for(let k=0;k<V.length;){const W=V.codePointAt(k)||0;J[Y++]=W,k+=W>65535?2:1}let T=Y;for(let k=1;k<O;++k)J.copyWithin(T,0,Y),T+=Y;return this.print(J,0,T),!0}sendDeviceAttributesPrimary(y){return y.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(a.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(a.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(y){return y.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(a.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(a.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(y.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(a.C0.ESC+"[>83;40003;0c")),!0}_is(y){return(this._optionsService.rawOptions.termName+"").indexOf(y)===0}setMode(y){for(let A=0;A<y.length;A++)switch(y.params[A]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(y){for(let A=0;A<y.length;A++)switch(y.params[A]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,f.DEFAULT_CHARSET),this._charsetService.setgCharset(1,f.DEFAULT_CHARSET),this._charsetService.setgCharset(2,f.DEFAULT_CHARSET),this._charsetService.setgCharset(3,f.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(y){for(let A=0;A<y.length;A++)switch(y.params[A]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(y){for(let A=0;A<y.length;A++)switch(y.params[A]){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(),y.params[A]===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(y,A){const O=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:U}=this._coreMouseService,V=this._coreService,{buffers:J,cols:Y}=this._bufferService,{active:T,alt:k}=J,W=this._optionsService.rawOptions,F=ee=>ee?1:2,K=y.params[0];return G=K,Q=A?K===2?4:K===4?F(V.modes.insertMode):K===12?3:K===20?F(W.convertEol):0:K===1?F(O.applicationCursorKeys):K===3?W.windowOptions.setWinLines?Y===80?2:Y===132?1:0:0:K===6?F(O.origin):K===7?F(O.wraparound):K===8?3:K===9?F(P==="X10"):K===12?F(W.cursorBlink):K===25?F(!V.isCursorHidden):K===45?F(O.reverseWraparound):K===66?F(O.applicationKeypad):K===67?4:K===1e3?F(P==="VT200"):K===1002?F(P==="DRAG"):K===1003?F(P==="ANY"):K===1004?F(O.sendFocus):K===1005?4:K===1006?F(U==="SGR"):K===1015?4:K===1016?F(U==="SGR_PIXELS"):K===1048?1:K===47||K===1047||K===1049?F(T===k):K===2004?F(O.bracketedPasteMode):0,V.triggerDataEvent(`${a.C0.ESC}[${A?"":"?"}${G};${Q}$y`),!0;var G,Q}_updateAttrColor(y,A,O,P,U){return A===2?(y|=50331648,y&=-16777216,y|=l.AttributeData.fromColorRGB([O,P,U])):A===5&&(y&=-50331904,y|=33554432|255&O),y}_extractColor(y,A,O){const P=[0,0,-1,0,0,0];let U=0,V=0;do{if(P[V+U]=y.params[A+V],y.hasSubParams(A+V)){const J=y.getSubParams(A+V);let Y=0;do P[1]===5&&(U=1),P[V+Y+1+U]=J[Y];while(++Y<J.length&&Y+V+1+U<P.length);break}if(P[1]===5&&V+U>=2||P[1]===2&&V+U>=5)break;P[1]&&(U=1)}while(++V+A<y.length&&V+U<P.length);for(let J=2;J<P.length;++J)P[J]===-1&&(P[J]=0);switch(P[0]){case 38:O.fg=this._updateAttrColor(O.fg,P[1],P[3],P[4],P[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,P[1],P[3],P[4],P[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,P[1],P[3],P[4],P[5])}return V}_processUnderline(y,A){A.extended=A.extended.clone(),(!~y||y>5)&&(y=1),A.extended.underlineStyle=y,A.fg|=268435456,y===0&&(A.fg&=-268435457),A.updateExtended()}_processSGR0(y){y.fg=r.DEFAULT_ATTR_DATA.fg,y.bg=r.DEFAULT_ATTR_DATA.bg,y.extended=y.extended.clone(),y.extended.underlineStyle=0,y.extended.underlineColor&=-67108864,y.updateExtended()}charAttributes(y){if(y.length===1&&y.params[0]===0)return this._processSGR0(this._curAttrData),!0;const A=y.length;let O;const P=this._curAttrData;for(let U=0;U<A;U++)O=y.params[U],O>=30&&O<=37?(P.fg&=-50331904,P.fg|=16777216|O-30):O>=40&&O<=47?(P.bg&=-50331904,P.bg|=16777216|O-40):O>=90&&O<=97?(P.fg&=-50331904,P.fg|=16777224|O-90):O>=100&&O<=107?(P.bg&=-50331904,P.bg|=16777224|O-100):O===0?this._processSGR0(P):O===1?P.fg|=134217728:O===3?P.bg|=67108864:O===4?(P.fg|=268435456,this._processUnderline(y.hasSubParams(U)?y.getSubParams(U)[0]:1,P)):O===5?P.fg|=536870912:O===7?P.fg|=67108864:O===8?P.fg|=1073741824:O===9?P.fg|=2147483648:O===2?P.bg|=134217728:O===21?this._processUnderline(2,P):O===22?(P.fg&=-134217729,P.bg&=-134217729):O===23?P.bg&=-67108865:O===24?(P.fg&=-268435457,this._processUnderline(0,P)):O===25?P.fg&=-536870913:O===27?P.fg&=-67108865:O===28?P.fg&=-1073741825:O===29?P.fg&=2147483647:O===39?(P.fg&=-67108864,P.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):O===49?(P.bg&=-67108864,P.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?U+=this._extractColor(y,U,P):O===53?P.bg|=1073741824:O===55?P.bg&=-1073741825:O===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):O===100?(P.fg&=-67108864,P.fg|=16777215&r.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(y){switch(y.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:const A=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${A};${O}R`)}return!0}deviceStatusPrivate(y){if(y.params[0]===6){const A=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${A};${O}R`)}return!0}softReset(y){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r.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(y){const A=y.params[0]||1;switch(A){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 O=A%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(y){const A=y.params[0]||1;let O;return(y.length<2||(O=y.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>A&&(this._activeBuffer.scrollTop=A-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(y){if(!B(y.params[0],this._optionsService.rawOptions.windowOptions))return!0;const A=y.length>1?y.params[1]:0;switch(y.params[0]){case 14:A!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:A!==0&&A!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),A!==0&&A!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:A!==0&&A!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),A!==0&&A!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(y){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(y){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(y){return this._windowTitle=y,this._onTitleChange.fire(y),!0}setIconName(y){return this._iconName=y,!0}setOrReportIndexedColor(y){const A=[],O=y.split(";");for(;O.length>1;){const P=O.shift(),U=O.shift();if(/^\d+$/.exec(P)){const V=parseInt(P);if(z(V))if(U==="?")A.push({type:0,index:V});else{const J=(0,w.parseColor)(U);J&&A.push({type:1,index:V,color:J})}}}return A.length&&this._onColor.fire(A),!0}setHyperlink(y){const A=y.split(";");return!(A.length<2)&&(A[1]?this._createHyperlink(A[0],A[1]):!A[0]&&this._finishHyperlink())}_createHyperlink(y,A){this._getCurrentLinkId()&&this._finishHyperlink();const O=y.split(":");let P;const U=O.findIndex((V=>V.startsWith("id=")));return U!==-1&&(P=O[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:A}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(y,A){const O=y.split(";");for(let P=0;P<O.length&&!(A>=this._specialColors.length);++P,++A)if(O[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[A]}]);else{const U=(0,w.parseColor)(O[P]);U&&this._onColor.fire([{type:1,index:this._specialColors[A],color:U}])}return!0}setOrReportFgColor(y){return this._setOrReportSpecialColor(y,0)}setOrReportBgColor(y){return this._setOrReportSpecialColor(y,1)}setOrReportCursorColor(y){return this._setOrReportSpecialColor(y,2)}restoreIndexedColor(y){if(!y)return this._onColor.fire([{type:2}]),!0;const A=[],O=y.split(";");for(let P=0;P<O.length;++P)if(/^\d+$/.exec(O[P])){const U=parseInt(O[P]);z(U)&&A.push({type:2,index:U})}return A.length&&this._onColor.fire(A),!0}restoreFgColor(y){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(y){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(y){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,f.DEFAULT_CHARSET),!0}selectCharset(y){return y.length!==2?(this.selectDefaultCharset(),!0):(y[0]==="/"||this._charsetService.setgCharset(L[y[0]],f.CHARSETS[y[1]]||f.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 y=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,y,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=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(y){return this._charsetService.setgLevel(y),!0}screenAlignmentPattern(){const y=new t.CellData;y.content=4194373,y.fg=this._curAttrData.fg,y.bg=this._curAttrData.bg,this._setCursor(0,0);for(let A=0;A<this._bufferService.rows;++A){const O=this._activeBuffer.ybase+this._activeBuffer.y+A,P=this._activeBuffer.lines.get(O);P&&(P.fill(y),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(y,A){const O=this._bufferService.buffer,P=this._optionsService.rawOptions;return(U=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${U}${a.C0.ESC}\\`),!0))(y==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:y==='"p'?'P1$r61;1"p':y==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:y==="m"?"P1$r0m":y===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(y,A){this._dirtyRowTracker.markRangeDirty(y,A)}}i.InputHandler=I;let $=class{constructor(N){this._bufferService=N,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(N){N<this.start?this.start=N:N>this.end&&(this.end=N)}markRangeDirty(N,y){N>y&&(H=N,N=y,y=H),N<this.start&&(this.start=N),y>this.end&&(this.end=y)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function z(N){return 0<=N&&N<256}$=c([d(0,v.IBufferService)],$)},844:(x,i)=>{function o(c){for(const d of c)d.dispose();c.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const d=this._disposables.indexOf(c);d!==-1&&this._disposables.splice(d,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var d;this._isDisposed||c===this._value||((d=this._value)==null||d.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},i.toDisposable=function(c){return{dispose:c}},i.disposeArray=o,i.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(d,a,f){this._data[d]||(this._data[d]={}),this._data[d][a]=f}get(d,a){return this._data[d]?this._data[d][a]:void 0}clear(){this._data={}}}i.TwoKeyMap=o,i.FourKeyMap=class{constructor(){this._data=new o}set(c,d,a,f,_){this._data.get(c,d)||this._data.set(c,d,new o),this._data.get(c,d).set(a,f,_)}get(c,d,a,f){var _;return(_=this._data.get(c,d))==null?void 0:_.get(a,f)}clear(){this._data.clear()}}},6114:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const o=i.isNode?"node":navigator.userAgent,c=i.isNode?"node":navigator.platform;i.isFirefox=o.includes("Firefox"),i.isLegacyEdge=o.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(o),i.getSafariVersion=function(){if(!i.isSafari)return 0;const d=o.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),i.isIpad=c==="iPad",i.isIphone=c==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),i.isLinux=c.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(o)},6106:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let o=0;i.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const d=this._getKey(c);if(d===void 0||(o=this._search(d),o===-1)||this._getKey(this._array[o])!==d)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===d);return!1}*getKeyIterator(c){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===c)}forEachByKey(c,d){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do d(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===c)}values(){return[...this._array].values()}_search(c){let d=0,a=this._array.length-1;for(;a>=d;){let f=d+a>>1;const _=this._getKey(this._array[f]);if(_>c)a=f-1;else{if(!(_<c)){for(;f>0&&this._getKey(this._array[f-1])===c;)f--;return f}d=f+1}}return d}}},7226:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const c=o(6114);class d{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let S=0,u=0,r=_.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),u=Math.max(S,u),s=_.timeRemaining(),1.5*u>s)return r-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-S))}ms`),void this._start();r=s}this.clear()}}class a extends d{_requestCallback(_){return setTimeout((()=>_(this._createDeadline(16))))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const S=Date.now()+_;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}i.PriorityTaskQueue=a,i.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:a,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},9282:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;const c=o(643);i.updateWindowsModeWrappedState=function(d){const a=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),f=a==null?void 0:a.get(d.cols-1),_=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);_&&f&&(_.isWrapped=f[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&f[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new o;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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}}i.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,f=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=f}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=c},9092:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;const c=o(6349),d=o(7226),a=o(3734),f=o(8437),_=o(4634),S=o(511),u=o(643),r=o(4863),s=o(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(e,t,l){this._hasScrollback=e,this._optionsService=t,this._bufferService=l,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,u.WHITESPACE_CELL_CHAR,u.WHITESPACE_CELL_WIDTH,u.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new d.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new f.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const t=e+this._optionsService.rawOptions.scrollback;return t>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=f.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const l=this.getNullCell(f.DEFAULT_ATTR_DATA);let v=0;const g=this._getCorrectBufferLength(t);if(g>this.lines.maxLength&&(this.lines.maxLength=g),this.lines.length>0){if(this._cols<e)for(let p=0;p<this.lines.length;p++)v+=+this.lines.get(p).resize(e,l);let b=0;if(this._rows<t)for(let p=this._rows;p<t;p++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new f.BufferLine(e,l)):this.ybase>0&&this.lines.length<=this.ybase+this.y+b+1?(this.ybase--,b++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(e,l)));else for(let p=this._rows;p>t;p--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(g<this.lines.maxLength){const p=this.lines.length-g;p>0&&(this.lines.trimStart(p),this.ybase=Math.max(this.ybase-p,0),this.ydisp=Math.max(this.ydisp-p,0),this.savedY=Math.max(this.savedY-p,0)),this.lines.maxLength=g}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),b&&(this.y+=b),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let b=0;b<this.lines.length;b++)v+=+this.lines.get(b).resize(e,l);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),v>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){const l=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(l.length>0){const v=(0,_.reflowLargerCreateNewLayout)(this.lines,l);(0,_.reflowLargerApplyNewLayout)(this.lines,v.layout),this._reflowLargerAdjustViewport(e,t,v.countRemoved)}}_reflowLargerAdjustViewport(e,t,l){const v=this.getNullCell(f.DEFAULT_ATTR_DATA);let g=l;for(;g-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new f.BufferLine(e,v))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-l,0)}_reflowSmaller(e,t){const l=this.getNullCell(f.DEFAULT_ATTR_DATA),v=[];let g=0;for(let b=this.lines.length-1;b>=0;b--){let p=this.lines.get(b);if(!p||!p.isWrapped&&p.getTrimmedLength()<=e)continue;const w=[p];for(;p.isWrapped&&b>0;)p=this.lines.get(--b),w.unshift(p);const L=this.ybase+this.y;if(L>=b&&L<b+w.length)continue;const M=w[w.length-1].getTrimmedLength(),B=(0,_.reflowSmallerGetNewLineLengths)(w,this._cols,e),D=B.length-w.length;let H;H=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const I=[];for(let O=0;O<D;O++){const P=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);I.push(P)}I.length>0&&(v.push({start:b+w.length+g,newLines:I}),g+=I.length),w.push(...I);let $=B.length-1,z=B[$];z===0&&($--,z=B[$]);let N=w.length-D-1,y=M;for(;N>=0;){const O=Math.min(y,z);if(w[$]===void 0)break;if(w[$].copyCellsFrom(w[N],y-O,z-O,O,!0),z-=O,z===0&&($--,z=B[$]),y-=O,y===0){N--;const P=Math.max(N,0);y=(0,_.getWrappedLineTrimmedLength)(w,P,this._cols)}}for(let O=0;O<w.length;O++)B[O]<e&&w[O].setCell(B[O],l);let A=D-H;for(;A-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+g)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+t-1)}if(v.length>0){const b=[],p=[];for(let $=0;$<this.lines.length;$++)p.push(this.lines.get($));const w=this.lines.length;let L=w-1,M=0,B=v[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+g);let D=0;for(let $=Math.min(this.lines.maxLength-1,w+g-1);$>=0;$--)if(B&&B.start>L+D){for(let z=B.newLines.length-1;z>=0;z--)this.lines.set($--,B.newLines[z]);$++,b.push({index:L+1,amount:B.newLines.length}),D+=B.newLines.length,B=v[++M]}else this.lines.set($,p[L--]);let H=0;for(let $=b.length-1;$>=0;$--)b[$].index+=H,this.lines.onInsertEmitter.fire(b[$]),H+=b[$].amount;const I=Math.max(0,w+g-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}}translateBufferLineToString(e,t,l=0,v){const g=this.lines.get(e);return g?g.translateToString(t,l,v):""}getWrappedRangeForLine(e){let t=e,l=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;l+1<this.lines.length&&this.lines.get(l+1).isWrapped;)l++;return{first:t,last:l}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){const t=new r.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim((l=>{t.line-=l,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((l=>{t.line>=l.index&&(t.line+=l.amount)}))),t.register(this.lines.onDelete((l=>{t.line>=l.index&&t.line<l.index+l.amount&&t.dispose(),t.line>l.index&&(t.line-=l.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;const c=o(3734),d=o(511),a=o(643),f=o(482);i.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let _=0;class S{constructor(r,s,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*r);const t=s||d.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let l=0;l<r;++l)this.setCell(l,t);this.length=r}get(r){const s=this._data[3*r+0],e=2097151&s;return[this._data[3*r+1],2097152&s?this._combined[r]:e?(0,f.stringFromCodePoint)(e):"",s>>22,2097152&s?this._combined[r].charCodeAt(this._combined[r].length-1):e]}set(r,s){this._data[3*r+1]=s[a.CHAR_DATA_ATTR_INDEX],s[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[r]=s[1],this._data[3*r+0]=2097152|r|s[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*r+0]=s[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(r){return this._data[3*r+0]>>22}hasWidth(r){return 12582912&this._data[3*r+0]}getFg(r){return this._data[3*r+1]}getBg(r){return this._data[3*r+2]}hasContent(r){return 4194303&this._data[3*r+0]}getCodePoint(r){const s=this._data[3*r+0];return 2097152&s?this._combined[r].charCodeAt(this._combined[r].length-1):2097151&s}isCombined(r){return 2097152&this._data[3*r+0]}getString(r){const s=this._data[3*r+0];return 2097152&s?this._combined[r]:2097151&s?(0,f.stringFromCodePoint)(2097151&s):""}isProtected(r){return 536870912&this._data[3*r+2]}loadCell(r,s){return _=3*r,s.content=this._data[_+0],s.fg=this._data[_+1],s.bg=this._data[_+2],2097152&s.content&&(s.combinedData=this._combined[r]),268435456&s.bg&&(s.extended=this._extendedAttrs[r]),s}setCell(r,s){2097152&s.content&&(this._combined[r]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[r]=s.extended),this._data[3*r+0]=s.content,this._data[3*r+1]=s.fg,this._data[3*r+2]=s.bg}setCellFromCodepoint(r,s,e,t){268435456&t.bg&&(this._extendedAttrs[r]=t.extended),this._data[3*r+0]=s|e<<22,this._data[3*r+1]=t.fg,this._data[3*r+2]=t.bg}addCodepointToCell(r,s,e){let t=this._data[3*r+0];2097152&t?this._combined[r]+=(0,f.stringFromCodePoint)(s):2097151&t?(this._combined[r]=(0,f.stringFromCodePoint)(2097151&t)+(0,f.stringFromCodePoint)(s),t&=-2097152,t|=2097152):t=s|4194304,e&&(t&=-12582913,t|=e<<22),this._data[3*r+0]=t}insertCells(r,s,e){if((r%=this.length)&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,e),s<this.length-r){const t=new d.CellData;for(let l=this.length-r-s-1;l>=0;--l)this.setCell(r+s+l,this.loadCell(r+l,t));for(let l=0;l<s;++l)this.setCell(r+l,e)}else for(let t=r;t<this.length;++t)this.setCell(t,e);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,e)}deleteCells(r,s,e){if(r%=this.length,s<this.length-r){const t=new d.CellData;for(let l=0;l<this.length-r-s;++l)this.setCell(r+l,this.loadCell(r+s+l,t));for(let l=this.length-s;l<this.length;++l)this.setCell(l,e)}else for(let t=r;t<this.length;++t)this.setCell(t,e);r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,e),this.getWidth(r)!==0||this.hasContent(r)||this.setCellFromCodepoint(r,0,1,e)}replaceCells(r,s,e,t=!1){if(t)for(r&&this.getWidth(r-1)===2&&!this.isProtected(r-1)&&this.setCellFromCodepoint(r-1,0,1,e),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,e);r<s&&r<this.length;)this.isProtected(r)||this.setCell(r,e),r++;else for(r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,e),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,e);r<s&&r<this.length;)this.setCell(r++,e)}resize(r,s){if(r===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const e=3*r;if(r>this.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const t=new Uint32Array(e);t.set(this._data),this._data=t}for(let t=this.length;t<r;++t)this.setCell(t,s)}else{this._data=this._data.subarray(0,e);const t=Object.keys(this._combined);for(let v=0;v<t.length;v++){const g=parseInt(t[v],10);g>=r&&delete this._combined[g]}const l=Object.keys(this._extendedAttrs);for(let v=0;v<l.length;v++){const g=parseInt(l[v],10);g>=r&&delete this._extendedAttrs[g]}}return this.length=r,4*e*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const r=new Uint32Array(this._data.length);return r.set(this._data),this._data=r,1}return 0}fill(r,s=!1){if(s)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,r);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,r)}}copyFrom(r){this.length!==r.length?this._data=new Uint32Array(r._data):this._data.set(r._data),this.length=r.length,this._combined={};for(const s in r._combined)this._combined[s]=r._combined[s];this._extendedAttrs={};for(const s in r._extendedAttrs)this._extendedAttrs[s]=r._extendedAttrs[s];this.isWrapped=r.isWrapped}clone(){const r=new S(0);r._data=new Uint32Array(this._data),r.length=this.length;for(const s in this._combined)r._combined[s]=this._combined[s];for(const s in this._extendedAttrs)r._extendedAttrs[s]=this._extendedAttrs[s];return r.isWrapped=this.isWrapped,r}getTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0])return r+(this._data[3*r+0]>>22);return 0}getNoBgTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0]||50331648&this._data[3*r+2])return r+(this._data[3*r+0]>>22);return 0}copyCellsFrom(r,s,e,t,l){const v=r._data;if(l)for(let b=t-1;b>=0;b--){for(let p=0;p<3;p++)this._data[3*(e+b)+p]=v[3*(s+b)+p];268435456&v[3*(s+b)+2]&&(this._extendedAttrs[e+b]=r._extendedAttrs[s+b])}else for(let b=0;b<t;b++){for(let p=0;p<3;p++)this._data[3*(e+b)+p]=v[3*(s+b)+p];268435456&v[3*(s+b)+2]&&(this._extendedAttrs[e+b]=r._extendedAttrs[s+b])}const g=Object.keys(r._combined);for(let b=0;b<g.length;b++){const p=parseInt(g[b],10);p>=s&&(this._combined[p-s+e]=r._combined[p])}}translateToString(r,s,e,t){s=s??0,e=e??this.length,r&&(e=Math.min(e,this.getTrimmedLength())),t&&(t.length=0);let l="";for(;s<e;){const v=this._data[3*s+0],g=2097151&v,b=2097152&v?this._combined[s]:g?(0,f.stringFromCodePoint)(g):a.WHITESPACE_CELL_CHAR;if(l+=b,t)for(let p=0;p<b.length;++p)t.push(s);s+=v>>22||1}return t&&t.push(s),l}}i.BufferLine=S},4841:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(x,i)=>{function o(c,d,a){if(d===c.length-1)return c[d].getTrimmedLength();const f=!c[d].hasContent(a-1)&&c[d].getWidth(a-1)===1,_=c[d+1].getWidth(0)===2;return f&&_?a-1:a}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(c,d,a,f,_){const S=[];for(let u=0;u<c.length-1;u++){let r=u,s=c.get(++r);if(!s.isWrapped)continue;const e=[c.get(u)];for(;r<c.length&&s.isWrapped;)e.push(s),s=c.get(++r);if(f>=u&&f<r){u+=e.length-1;continue}let t=0,l=o(e,t,d),v=1,g=0;for(;v<e.length;){const p=o(e,v,d),w=p-g,L=a-l,M=Math.min(w,L);e[t].copyCellsFrom(e[v],g,l,M,!1),l+=M,l===a&&(t++,l=0),g+=M,g===p&&(v++,g=0),l===0&&t!==0&&e[t-1].getWidth(a-1)===2&&(e[t].copyCellsFrom(e[t-1],a-1,l++,1,!1),e[t-1].setCell(a-1,_))}e[t].replaceCells(l,a,_);let b=0;for(let p=e.length-1;p>0&&(p>t||e[p].getTrimmedLength()===0);p--)b++;b>0&&(S.push(u+e.length-b),S.push(b)),u+=e.length-1}return S},i.reflowLargerCreateNewLayout=function(c,d){const a=[];let f=0,_=d[f],S=0;for(let u=0;u<c.length;u++)if(_===u){const r=d[++f];c.onDeleteEmitter.fire({index:u-S,amount:r}),u+=r-1,S+=r,_=d[++f]}else a.push(u);return{layout:a,countRemoved:S}},i.reflowLargerApplyNewLayout=function(c,d){const a=[];for(let f=0;f<d.length;f++)a.push(c.get(d[f]));for(let f=0;f<a.length;f++)c.set(f,a[f]);c.length=d.length},i.reflowSmallerGetNewLineLengths=function(c,d,a){const f=[],_=c.map(((s,e)=>o(c,e,d))).reduce(((s,e)=>s+e));let S=0,u=0,r=0;for(;r<_;){if(_-r<a){f.push(_-r);break}S+=a;const s=o(c,u,d);S>s&&(S-=s,u++);const e=c[u].getWidth(S-1)===2;e&&S--;const t=e?a-1:a;f.push(t),r+=t}return f},i.getWrappedLineTrimmedLength=o},5295:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;const c=o(8460),d=o(844),a=o(9092);class f extends d.Disposable{constructor(S,u){super(),this._optionsService=S,this._bufferService=u,this._onBufferActivate=this.register(new c.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 a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.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(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),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(S,u){this._normal.resize(S,u),this._alt.resize(S,u),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}i.BufferSet=f},511:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const c=o(482),d=o(643),a=o(3734);class f extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const u=new f;return u.setFromCharData(S),u}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let u=!1;if(S[d.CHAR_DATA_CHAR_INDEX].length>2)u=!0;else if(S[d.CHAR_DATA_CHAR_INDEX].length===2){const r=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const s=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(r-55296)+s-56320+65536|S[d.CHAR_DATA_WIDTH_INDEX]<<22:u=!0}else u=!0}else this.content=S[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[d.CHAR_DATA_WIDTH_INDEX]<<22;u&&(this.combinedData=S[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=f},643:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;const c=o(8460),d=o(844);class a{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,d.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}i.Marker=a,a._nextId=1},7116:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.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:"≥","{":"π","|":"≠","}":"£","~":"·"},i.CHARSETS.A={"#":"£"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},i.CHARSETS.C=i.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},i.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},i.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},i.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},i.CHARSETS.E=i.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},i.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},i.CHARSETS.H=i.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(x,i)=>{var o,c,d;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,(function(a){a.NUL="\0",a.SOH="",a.STX="",a.ETX="",a.EOT="",a.ENQ="",a.ACK="",a.BEL="\x07",a.BS="\b",a.HT=" ",a.LF=`
|
|
18
|
+
`,a.VT="\v",a.FF="\f",a.CR="\r",a.SO="",a.SI="",a.DLE="",a.DC1="",a.DC2="",a.DC3="",a.DC4="",a.NAK="",a.SYN="",a.ETB="",a.CAN="",a.EM="",a.SUB="",a.ESC="\x1B",a.FS="",a.GS="",a.RS="",a.US="",a.SP=" ",a.DEL=""})(o||(i.C0=o={})),(function(a){a.PAD="",a.HOP="",a.BPH="",a.NBH="",a.IND="",a.NEL="
",a.SSA="",a.ESA="",a.HTS="",a.HTJ="",a.VTS="",a.PLD="",a.PLU="",a.RI="",a.SS2="",a.SS3="",a.DCS="",a.PU1="",a.PU2="",a.STS="",a.CCH="",a.MW="",a.SPA="",a.EPA="",a.SOS="",a.SGCI="",a.SCI="",a.CSI="",a.ST="",a.OSC="",a.PM="",a.APC=""})(c||(i.C1=c={})),(function(a){a.ST=`${o.ESC}\\`})(d||(i.C1_ESCAPED=d={}))},7399:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;const c=o(2584),d={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:["'",'"']};i.evaluateKeyboardEvent=function(a,f,_,S){const u={type:0,cancel:!1,key:void 0},r=(a.shiftKey?1:0)|(a.altKey?2:0)|(a.ctrlKey?4:0)|(a.metaKey?8:0);switch(a.keyCode){case 0:a.key==="UIKeyInputUpArrow"?u.key=f?c.C0.ESC+"OA":c.C0.ESC+"[A":a.key==="UIKeyInputLeftArrow"?u.key=f?c.C0.ESC+"OD":c.C0.ESC+"[D":a.key==="UIKeyInputRightArrow"?u.key=f?c.C0.ESC+"OC":c.C0.ESC+"[C":a.key==="UIKeyInputDownArrow"&&(u.key=f?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:u.key=a.ctrlKey?"\b":c.C0.DEL,a.altKey&&(u.key=c.C0.ESC+u.key);break;case 9:if(a.shiftKey){u.key=c.C0.ESC+"[Z";break}u.key=c.C0.HT,u.cancel=!0;break;case 13:u.key=a.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,u.cancel=!0;break;case 27:u.key=c.C0.ESC,a.altKey&&(u.key=c.C0.ESC+c.C0.ESC),u.cancel=!0;break;case 37:if(a.metaKey)break;r?(u.key=c.C0.ESC+"[1;"+(r+1)+"D",u.key===c.C0.ESC+"[1;3D"&&(u.key=c.C0.ESC+(_?"b":"[1;5D"))):u.key=f?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(a.metaKey)break;r?(u.key=c.C0.ESC+"[1;"+(r+1)+"C",u.key===c.C0.ESC+"[1;3C"&&(u.key=c.C0.ESC+(_?"f":"[1;5C"))):u.key=f?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(a.metaKey)break;r?(u.key=c.C0.ESC+"[1;"+(r+1)+"A",_||u.key!==c.C0.ESC+"[1;3A"||(u.key=c.C0.ESC+"[1;5A")):u.key=f?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(a.metaKey)break;r?(u.key=c.C0.ESC+"[1;"+(r+1)+"B",_||u.key!==c.C0.ESC+"[1;3B"||(u.key=c.C0.ESC+"[1;5B")):u.key=f?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:a.shiftKey||a.ctrlKey||(u.key=c.C0.ESC+"[2~");break;case 46:u.key=r?c.C0.ESC+"[3;"+(r+1)+"~":c.C0.ESC+"[3~";break;case 36:u.key=r?c.C0.ESC+"[1;"+(r+1)+"H":f?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:u.key=r?c.C0.ESC+"[1;"+(r+1)+"F":f?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:a.shiftKey?u.type=2:a.ctrlKey?u.key=c.C0.ESC+"[5;"+(r+1)+"~":u.key=c.C0.ESC+"[5~";break;case 34:a.shiftKey?u.type=3:a.ctrlKey?u.key=c.C0.ESC+"[6;"+(r+1)+"~":u.key=c.C0.ESC+"[6~";break;case 112:u.key=r?c.C0.ESC+"[1;"+(r+1)+"P":c.C0.ESC+"OP";break;case 113:u.key=r?c.C0.ESC+"[1;"+(r+1)+"Q":c.C0.ESC+"OQ";break;case 114:u.key=r?c.C0.ESC+"[1;"+(r+1)+"R":c.C0.ESC+"OR";break;case 115:u.key=r?c.C0.ESC+"[1;"+(r+1)+"S":c.C0.ESC+"OS";break;case 116:u.key=r?c.C0.ESC+"[15;"+(r+1)+"~":c.C0.ESC+"[15~";break;case 117:u.key=r?c.C0.ESC+"[17;"+(r+1)+"~":c.C0.ESC+"[17~";break;case 118:u.key=r?c.C0.ESC+"[18;"+(r+1)+"~":c.C0.ESC+"[18~";break;case 119:u.key=r?c.C0.ESC+"[19;"+(r+1)+"~":c.C0.ESC+"[19~";break;case 120:u.key=r?c.C0.ESC+"[20;"+(r+1)+"~":c.C0.ESC+"[20~";break;case 121:u.key=r?c.C0.ESC+"[21;"+(r+1)+"~":c.C0.ESC+"[21~";break;case 122:u.key=r?c.C0.ESC+"[23;"+(r+1)+"~":c.C0.ESC+"[23~";break;case 123:u.key=r?c.C0.ESC+"[24;"+(r+1)+"~":c.C0.ESC+"[24~";break;default:if(!a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)if(_&&!S||!a.altKey||a.metaKey)!_||a.altKey||a.ctrlKey||a.shiftKey||!a.metaKey?a.key&&!a.ctrlKey&&!a.altKey&&!a.metaKey&&a.keyCode>=48&&a.key.length===1?u.key=a.key:a.key&&a.ctrlKey&&(a.key==="_"&&(u.key=c.C0.US),a.key==="@"&&(u.key=c.C0.NUL)):a.keyCode===65&&(u.type=1);else{const s=d[a.keyCode],e=s==null?void 0:s[a.shiftKey?1:0];if(e)u.key=c.C0.ESC+e;else if(a.keyCode>=65&&a.keyCode<=90){const t=a.ctrlKey?a.keyCode-64:a.keyCode+32;let l=String.fromCharCode(t);a.shiftKey&&(l=l.toUpperCase()),u.key=c.C0.ESC+l}else if(a.keyCode===32)u.key=c.C0.ESC+(a.ctrlKey?c.C0.NUL:" ");else if(a.key==="Dead"&&a.code.startsWith("Key")){let t=a.code.slice(3,4);a.shiftKey||(t=t.toLowerCase()),u.key=c.C0.ESC+t,u.cancel=!0}}else a.keyCode>=65&&a.keyCode<=90?u.key=String.fromCharCode(a.keyCode-64):a.keyCode===32?u.key=c.C0.NUL:a.keyCode>=51&&a.keyCode<=55?u.key=String.fromCharCode(a.keyCode-51+27):a.keyCode===56?u.key=c.C0.DEL:a.keyCode===219?u.key=c.C0.ESC:a.keyCode===220?u.key=c.C0.FS:a.keyCode===221&&(u.key=c.C0.GS)}return u}},482:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},i.utf32ToString=function(o,c=0,d=o.length){let a="";for(let f=c;f<d;++f){let _=o[f];_>65535?(_-=65536,a+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):a+=String.fromCharCode(_)}return a},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const d=o.length;if(!d)return 0;let a=0,f=0;if(this._interim){const _=o.charCodeAt(f++);56320<=_&&_<=57343?c[a++]=1024*(this._interim-55296)+_-56320+65536:(c[a++]=this._interim,c[a++]=_),this._interim=0}for(let _=f;_<d;++_){const S=o.charCodeAt(_);if(55296<=S&&S<=56319){if(++_>=d)return this._interim=S,a;const u=o.charCodeAt(_);56320<=u&&u<=57343?c[a++]=1024*(S-55296)+u-56320+65536:(c[a++]=S,c[a++]=u)}else S!==65279&&(c[a++]=S)}return a}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const d=o.length;if(!d)return 0;let a,f,_,S,u=0,r=0,s=0;if(this.interim[0]){let l=!1,v=this.interim[0];v&=(224&v)==192?31:(240&v)==224?15:7;let g,b=0;for(;(g=63&this.interim[++b])&&b<4;)v<<=6,v|=g;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,w=p-b;for(;s<w;){if(s>=d)return 0;if(g=o[s++],(192&g)!=128){s--,l=!0;break}this.interim[b++]=g,v<<=6,v|=63&g}l||(p===2?v<128?s--:c[u++]=v:p===3?v<2048||v>=55296&&v<=57343||v===65279||(c[u++]=v):v<65536||v>1114111||(c[u++]=v)),this.interim.fill(0)}const e=d-4;let t=s;for(;t<d;){for(;!(!(t<e)||128&(a=o[t])||128&(f=o[t+1])||128&(_=o[t+2])||128&(S=o[t+3]));)c[u++]=a,c[u++]=f,c[u++]=_,c[u++]=S,t+=4;if(a=o[t++],a<128)c[u++]=a;else if((224&a)==192){if(t>=d)return this.interim[0]=a,u;if(f=o[t++],(192&f)!=128){t--;continue}if(r=(31&a)<<6|63&f,r<128){t--;continue}c[u++]=r}else if((240&a)==224){if(t>=d)return this.interim[0]=a,u;if(f=o[t++],(192&f)!=128){t--;continue}if(t>=d)return this.interim[0]=a,this.interim[1]=f,u;if(_=o[t++],(192&_)!=128){t--;continue}if(r=(15&a)<<12|(63&f)<<6|63&_,r<2048||r>=55296&&r<=57343||r===65279)continue;c[u++]=r}else if((248&a)==240){if(t>=d)return this.interim[0]=a,u;if(f=o[t++],(192&f)!=128){t--;continue}if(t>=d)return this.interim[0]=a,this.interim[1]=f,u;if(_=o[t++],(192&_)!=128){t--;continue}if(t>=d)return this.interim[0]=a,this.interim[1]=f,this.interim[2]=_,u;if(S=o[t++],(192&S)!=128){t--;continue}if(r=(7&a)<<18|(63&f)<<12|(63&_)<<6|63&S,r<65536||r>1114111)continue;c[u++]=r}}return u}}},225:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;const c=o(1480),d=[[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]],a=[[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 f;i.UnicodeV6=class{constructor(){if(this.version="6",!f){f=new Uint8Array(65536),f.fill(1),f[0]=0,f.fill(0,1,32),f.fill(0,127,160),f.fill(2,4352,4448),f[9001]=2,f[9002]=2,f.fill(2,11904,42192),f[12351]=1,f.fill(2,44032,55204),f.fill(2,63744,64256),f.fill(2,65040,65050),f.fill(2,65072,65136),f.fill(2,65280,65377),f.fill(2,65504,65511);for(let _=0;_<d.length;++_)f.fill(0,d[_][0],d[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?f[_]:(function(S,u){let r,s=0,e=u.length-1;if(S<u[0][0]||S>u[e][1])return!1;for(;e>=s;)if(r=s+e>>1,S>u[r][1])s=r+1;else{if(!(S<u[r][0]))return!0;e=r-1}return!1})(_,a)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,S){let u=this.wcwidth(_),r=u===0&&S!==0;if(r){const s=c.UnicodeService.extractWidth(S);s===0?r=!1:s>u&&(u=s)}return c.UnicodeService.createPropertyValue(0,u,r)}}},5981:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;const c=o(8460),d=o(844);class a extends d.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let u;for(this._isSyncWriting=!0;u=this._writeBuffer.shift();){this._action(u);const r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,S){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+=_.length,this._writeBuffer.push(_),this._callbacks.push(S),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(S)}_innerWrite(_=0,S=!0){const u=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const r=this._writeBuffer[this._bufferOffset],s=this._action(r,S);if(s){const t=l=>Date.now()-u>=12?setTimeout((()=>this._innerWrite(0,l))):this._innerWrite(u,l);return void s.catch((l=>(queueMicrotask((()=>{throw l})),Promise.resolve(!1)))).then(t)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=r.length,Date.now()-u>=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()}}i.WriteBuffer=a},5941:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;const o=/^([\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})$/,c=/^[\da-f]+$/;function d(a,f){const _=a.toString(16),S=_.length<2?"0"+_:_;switch(f){case 4:return _[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}i.parseColor=function(a){if(!a)return;let f=a.toLowerCase();if(f.indexOf("rgb:")===0){f=f.slice(4);const _=o.exec(f);if(_){const S=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/S*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/S*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/S*255)]}}else if(f.indexOf("#")===0&&(f=f.slice(1),c.exec(f)&&[3,6,9,12].includes(f.length))){const _=f.length/3,S=[0,0,0];for(let u=0;u<3;++u){const r=parseInt(f.slice(_*u,_*u+_),16);S[u]=_===1?r<<4:_===2?r:_===3?r>>4:r>>8}return S}},i.toRgbString=function(a,f=16){const[_,S,u]=a;return`rgb:${d(_,f)}/${d(S,f)}/${d(u,f)}`}},5770:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;const c=o(482),d=o(8742),a=o(5770),f=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=f,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}registerHandler(S,u){this._handlers[S]===void 0&&(this._handlers[S]=[]);const r=this._handlers[S];return r.push(u),{dispose:()=>{const s=r.indexOf(u);s!==-1&&r.splice(s,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=f,this._ident=0}hook(S,u){if(this.reset(),this._ident=S,this._active=this._handlers[S]||f,this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(u);else this._handlerFb(this._ident,"HOOK",u)}put(S,u,r){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(S,u,r);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(S,u,r))}unhook(S,u=!0){if(this._active.length){let r=!1,s=this._active.length-1,e=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,r=u,e=this._stack.fallThrough,this._stack.paused=!1),!e&&r===!1){for(;s>=0&&(r=this._active[s].unhook(S),r!==!0);s--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,r;s--}for(;s>=0;s--)if(r=this._active[s].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,r}else this._handlerFb(this._ident,"UNHOOK",S);this._active=f,this._ident=0}};const _=new d.Params;_.addParam(0),i.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=_,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():_,this._data="",this._hitLimit=!1}put(S,u,r){this._hitLimit||(this._data+=(0,c.utf32ToString)(S,u,r),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let u=!1;if(this._hitLimit)u=!1;else if(S&&(u=this._handler(this._data,this._params),u instanceof Promise))return u.then((r=>(this._params=_,this._data="",this._hitLimit=!1,r)));return this._params=_,this._data="",this._hitLimit=!1,u}}},2015:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;const c=o(844),d=o(8742),a=o(6242),f=o(6351);class _{constructor(s){this.table=new Uint8Array(s)}setDefault(s,e){this.table.fill(s<<4|e)}add(s,e,t,l){this.table[e<<8|s]=t<<4|l}addMany(s,e,t,l){for(let v=0;v<s.length;v++)this.table[e<<8|s[v]]=t<<4|l}}i.TransitionTable=_;const S=160;i.VT500_TRANSITION_TABLE=(function(){const r=new _(4095),s=Array.apply(null,Array(256)).map(((b,p)=>p)),e=(b,p)=>s.slice(b,p),t=e(32,127),l=e(0,24);l.push(25),l.push.apply(l,e(28,32));const v=e(0,14);let g;for(g in r.setDefault(1,0),r.addMany(t,0,2,0),v)r.addMany([24,26,153,154],g,3,0),r.addMany(e(128,144),g,3,0),r.addMany(e(144,152),g,3,0),r.add(156,g,0,0),r.add(27,g,11,1),r.add(157,g,4,8),r.addMany([152,158,159],g,0,7),r.add(155,g,11,3),r.add(144,g,11,9);return r.addMany(l,0,3,0),r.addMany(l,1,3,1),r.add(127,1,0,1),r.addMany(l,8,0,8),r.addMany(l,3,3,3),r.add(127,3,0,3),r.addMany(l,4,3,4),r.add(127,4,0,4),r.addMany(l,6,3,6),r.addMany(l,5,3,5),r.add(127,5,0,5),r.addMany(l,2,3,2),r.add(127,2,0,2),r.add(93,1,4,8),r.addMany(t,8,5,8),r.add(127,8,5,8),r.addMany([156,27,24,26,7],8,6,0),r.addMany(e(28,32),8,0,8),r.addMany([88,94,95],1,0,7),r.addMany(t,7,0,7),r.addMany(l,7,0,7),r.add(156,7,0,0),r.add(127,7,0,7),r.add(91,1,11,3),r.addMany(e(64,127),3,7,0),r.addMany(e(48,60),3,8,4),r.addMany([60,61,62,63],3,9,4),r.addMany(e(48,60),4,8,4),r.addMany(e(64,127),4,7,0),r.addMany([60,61,62,63],4,0,6),r.addMany(e(32,64),6,0,6),r.add(127,6,0,6),r.addMany(e(64,127),6,0,0),r.addMany(e(32,48),3,9,5),r.addMany(e(32,48),5,9,5),r.addMany(e(48,64),5,0,6),r.addMany(e(64,127),5,7,0),r.addMany(e(32,48),4,9,5),r.addMany(e(32,48),1,9,2),r.addMany(e(32,48),2,9,2),r.addMany(e(48,127),2,10,0),r.addMany(e(48,80),1,10,0),r.addMany(e(81,88),1,10,0),r.addMany([89,90,92],1,10,0),r.addMany(e(96,127),1,10,0),r.add(80,1,11,9),r.addMany(l,9,0,9),r.add(127,9,0,9),r.addMany(e(28,32),9,0,9),r.addMany(e(32,48),9,9,12),r.addMany(e(48,60),9,8,10),r.addMany([60,61,62,63],9,9,10),r.addMany(l,11,0,11),r.addMany(e(32,128),11,0,11),r.addMany(e(28,32),11,0,11),r.addMany(l,10,0,10),r.add(127,10,0,10),r.addMany(e(28,32),10,0,10),r.addMany(e(48,60),10,8,10),r.addMany([60,61,62,63],10,0,11),r.addMany(e(32,48),10,9,12),r.addMany(l,12,0,12),r.add(127,12,0,12),r.addMany(e(28,32),12,0,12),r.addMany(e(32,48),12,9,12),r.addMany(e(48,64),12,0,11),r.addMany(e(64,127),12,12,13),r.addMany(e(64,127),10,12,13),r.addMany(e(64,127),9,12,13),r.addMany(l,13,13,13),r.addMany(t,13,13,13),r.add(127,13,0,13),r.addMany([27,156,24,26],13,14,0),r.add(S,0,2,0),r.add(S,8,5,8),r.add(S,6,0,6),r.add(S,11,0,11),r.add(S,13,13,13),r})();class u extends c.Disposable{constructor(s=i.VT500_TRANSITION_TABLE){super(),this._transitions=s,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new d.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,l)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new f.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(s,e=[64,126]){let t=0;if(s.prefix){if(s.prefix.length>1)throw new Error("only one byte as prefix supported");if(t=s.prefix.charCodeAt(0),t&&60>t||t>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(s.intermediates){if(s.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let v=0;v<s.intermediates.length;++v){const g=s.intermediates.charCodeAt(v);if(32>g||g>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");t<<=8,t|=g}}if(s.final.length!==1)throw new Error("final must be a single byte");const l=s.final.charCodeAt(0);if(e[0]>l||l>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return t<<=8,t|=l,t}identToString(s){const e=[];for(;s;)e.push(String.fromCharCode(255&s)),s>>=8;return e.reverse().join("")}setPrintHandler(s){this._printHandler=s}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(s,e){const t=this._identifier(s,[48,126]);this._escHandlers[t]===void 0&&(this._escHandlers[t]=[]);const l=this._escHandlers[t];return l.push(e),{dispose:()=>{const v=l.indexOf(e);v!==-1&&l.splice(v,1)}}}clearEscHandler(s){this._escHandlers[this._identifier(s,[48,126])]&&delete this._escHandlers[this._identifier(s,[48,126])]}setEscHandlerFallback(s){this._escHandlerFb=s}setExecuteHandler(s,e){this._executeHandlers[s.charCodeAt(0)]=e}clearExecuteHandler(s){this._executeHandlers[s.charCodeAt(0)]&&delete this._executeHandlers[s.charCodeAt(0)]}setExecuteHandlerFallback(s){this._executeHandlerFb=s}registerCsiHandler(s,e){const t=this._identifier(s);this._csiHandlers[t]===void 0&&(this._csiHandlers[t]=[]);const l=this._csiHandlers[t];return l.push(e),{dispose:()=>{const v=l.indexOf(e);v!==-1&&l.splice(v,1)}}}clearCsiHandler(s){this._csiHandlers[this._identifier(s)]&&delete this._csiHandlers[this._identifier(s)]}setCsiHandlerFallback(s){this._csiHandlerFb=s}registerDcsHandler(s,e){return this._dcsParser.registerHandler(this._identifier(s),e)}clearDcsHandler(s){this._dcsParser.clearHandler(this._identifier(s))}setDcsHandlerFallback(s){this._dcsParser.setHandlerFallback(s)}registerOscHandler(s,e){return this._oscParser.registerHandler(s,e)}clearOscHandler(s){this._oscParser.clearHandler(s)}setOscHandlerFallback(s){this._oscParser.setHandlerFallback(s)}setErrorHandler(s){this._errorHandler=s}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(s,e,t,l,v){this._parseStack.state=s,this._parseStack.handlers=e,this._parseStack.handlerPos=t,this._parseStack.transition=l,this._parseStack.chunkPos=v}parse(s,e,t){let l,v=0,g=0,b=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,b=this._parseStack.chunkPos+1;else{if(t===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const p=this._parseStack.handlers;let w=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(t===!1&&w>-1){for(;w>=0&&(l=p[w](this._params),l!==!0);w--)if(l instanceof Promise)return this._parseStack.handlerPos=w,l}this._parseStack.handlers=[];break;case 4:if(t===!1&&w>-1){for(;w>=0&&(l=p[w](),l!==!0);w--)if(l instanceof Promise)return this._parseStack.handlerPos=w,l}this._parseStack.handlers=[];break;case 6:if(v=s[this._parseStack.chunkPos],l=this._dcsParser.unhook(v!==24&&v!==26,t),l)return l;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(v=s[this._parseStack.chunkPos],l=this._oscParser.end(v!==24&&v!==26,t),l)return l;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,b=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let p=b;p<e;++p){switch(v=s[p],g=this._transitions.table[this.currentState<<8|(v<160?v:S)],g>>4){case 2:for(let D=p+1;;++D){if(D>=e||(v=s[D])<32||v>126&&v<S){this._printHandler(s,p,D),p=D-1;break}if(++D>=e||(v=s[D])<32||v>126&&v<S){this._printHandler(s,p,D),p=D-1;break}if(++D>=e||(v=s[D])<32||v>126&&v<S){this._printHandler(s,p,D),p=D-1;break}if(++D>=e||(v=s[D])<32||v>126&&v<S){this._printHandler(s,p,D),p=D-1;break}}break;case 3:this._executeHandlers[v]?this._executeHandlers[v]():this._executeHandlerFb(v),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:p,code:v,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const w=this._csiHandlers[this._collect<<8|v];let L=w?w.length-1:-1;for(;L>=0&&(l=w[L](this._params),l!==!0);L--)if(l instanceof Promise)return this._preserveStack(3,w,L,g,p),l;L<0&&this._csiHandlerFb(this._collect<<8|v,this._params),this.precedingJoinState=0;break;case 8:do switch(v){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(v-48)}while(++p<e&&(v=s[p])>47&&v<60);p--;break;case 9:this._collect<<=8,this._collect|=v;break;case 10:const M=this._escHandlers[this._collect<<8|v];let B=M?M.length-1:-1;for(;B>=0&&(l=M[B](),l!==!0);B--)if(l instanceof Promise)return this._preserveStack(4,M,B,g,p),l;B<0&&this._escHandlerFb(this._collect<<8|v),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|v,this._params);break;case 13:for(let D=p+1;;++D)if(D>=e||(v=s[D])===24||v===26||v===27||v>127&&v<S){this._dcsParser.put(s,p,D),p=D-1;break}break;case 14:if(l=this._dcsParser.unhook(v!==24&&v!==26),l)return this._preserveStack(6,[],0,g,p),l;v===27&&(g|=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 D=p+1;;D++)if(D>=e||(v=s[D])<32||v>127&&v<S){this._oscParser.put(s,p,D),p=D-1;break}break;case 6:if(l=this._oscParser.end(v!==24&&v!==26),l)return this._preserveStack(5,[],0,g,p),l;v===27&&(g|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&g}}}i.EscapeSequenceParser=u},6242:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;const c=o(5770),d=o(482),a=[];i.OscParser=class{constructor(){this._state=0,this._active=a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(f,_){this._handlers[f]===void 0&&(this._handlers[f]=[]);const S=this._handlers[f];return S.push(_),{dispose:()=>{const u=S.indexOf(_);u!==-1&&S.splice(u,1)}}}clearHandler(f){this._handlers[f]&&delete this._handlers[f]}setHandlerFallback(f){this._handlerFb=f}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let f=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;f>=0;--f)this._active[f].end(!1);this._stack.paused=!1,this._active=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].start();else this._handlerFb(this._id,"START")}_put(f,_,S){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(f,_,S);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(f,_,S))}start(){this.reset(),this._state=1}put(f,_,S){if(this._state!==3){if(this._state===1)for(;_<S;){const u=f[_++];if(u===59){this._state=2,this._start();break}if(u<48||57<u)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+u-48}this._state===2&&S-_>0&&this._put(f,_,S)}}end(f,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,u=this._active.length-1,r=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,S=_,r=this._stack.fallThrough,this._stack.paused=!1),!r&&S===!1){for(;u>=0&&(S=this._active[u].end(f),S!==!0);u--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,S;u--}for(;u>=0;u--)if(S=this._active[u].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",f);this._active=a,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(f){this._handler=f,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(f,_,S){this._hitLimit||(this._data+=(0,d.utf32ToString)(f,_,S),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(f){let _=!1;if(this._hitLimit)_=!1;else if(f&&(_=this._handler(this._data),_ instanceof Promise))return _.then((S=>(this._data="",this._hitLimit=!1,S)));return this._data="",this._hitLimit=!1,_}}},8742:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;const o=2147483647;class c{static fromArray(a){const f=new c;if(!a.length)return f;for(let _=Array.isArray(a[0])?1:0;_<a.length;++_){const S=a[_];if(Array.isArray(S))for(let u=0;u<S.length;++u)f.addSubParam(S[u]);else f.addParam(S)}return f}constructor(a=32,f=32){if(this.maxLength=a,this.maxSubParamsLength=f,f>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(a),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(a),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const a=new c(this.maxLength,this.maxSubParamsLength);return a.params.set(this.params),a.length=this.length,a._subParams.set(this._subParams),a._subParamsLength=this._subParamsLength,a._subParamsIdx.set(this._subParamsIdx),a._rejectDigits=this._rejectDigits,a._rejectSubDigits=this._rejectSubDigits,a._digitIsSub=this._digitIsSub,a}toArray(){const a=[];for(let f=0;f<this.length;++f){a.push(this.params[f]);const _=this._subParamsIdx[f]>>8,S=255&this._subParamsIdx[f];S-_>0&&a.push(Array.prototype.slice.call(this._subParams,_,S))}return a}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(a){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=a>o?o:a}}addSubParam(a){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=a>o?o:a,this._subParamsIdx[this.length-1]++}}hasSubParams(a){return(255&this._subParamsIdx[a])-(this._subParamsIdx[a]>>8)>0}getSubParams(a){const f=this._subParamsIdx[a]>>8,_=255&this._subParamsIdx[a];return _-f>0?this._subParams.subarray(f,_):null}getSubParamsAll(){const a={};for(let f=0;f<this.length;++f){const _=this._subParamsIdx[f]>>8,S=255&this._subParamsIdx[f];S-_>0&&(a[f]=this._subParams.slice(_,S))}return a}addDigit(a){let f;if(this._rejectDigits||!(f=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,S=_[f-1];_[f-1]=~S?Math.min(10*S+a,o):a}}i.Params=c},5741:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,c){const d={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(d),c.dispose=()=>this._wrappedAddonDispose(d),c.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let c=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===o){c=d;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(c,1)}}},8771:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;const c=o(3785),d=o(511);i.BufferApiView=class{constructor(a,f){this._buffer=a,this.type=f}init(a){return this._buffer=a,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(a){const f=this._buffer.lines.get(a);if(f)return new c.BufferLineApiView(f)}getNullCell(){return new d.CellData}}},3785:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;const c=o(511);i.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,a){if(!(d<0||d>=this._line.length))return a?(this._line.loadCell(d,a),a):this._line.loadCell(d,new c.CellData)}translateToString(d,a,f){return this._line.translateToString(d,a,f)}}},8285:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;const c=o(8771),d=o(8460),a=o(844);class f extends a.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new d.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.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)}}i.BufferNamespaceApi=f},7975:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,c){return this._core.registerCsiHandler(o,(d=>c(d.toArray())))}addCsiHandler(o,c){return this.registerCsiHandler(o,c)}registerDcsHandler(o,c){return this._core.registerDcsHandler(o,((d,a)=>c(d,a.toArray())))}addDcsHandler(o,c){return this.registerDcsHandler(o,c)}registerEscHandler(o,c){return this._core.registerEscHandler(o,c)}addEscHandler(o,c){return this.registerEscHandler(o,c)}registerOscHandler(o,c){return this._core.registerOscHandler(o,c)}addOscHandler(o,c){return this.registerOscHandler(o,c)}}},7090:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(x,i,o){var c=this&&this.__decorate||function(r,s,e,t){var l,v=arguments.length,g=v<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,s,e,t);else for(var b=r.length-1;b>=0;b--)(l=r[b])&&(g=(v<3?l(g):v>3?l(s,e,g):l(s,e))||g);return v>3&&g&&Object.defineProperty(s,e,g),g},d=this&&this.__param||function(r,s){return function(e,t){s(e,t,r)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;const a=o(8460),f=o(844),_=o(5295),S=o(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let u=i.BufferService=class extends f.Disposable{get buffer(){return this.buffers.active}constructor(r){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(r.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(r.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(r,this))}resize(r,s){this.cols=r,this.rows=s,this.buffers.resize(r,s),this._onResize.fire({cols:r,rows:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(r,s=!1){const e=this.buffer;let t;t=this._cachedBlankLine,t&&t.length===this.cols&&t.getFg(0)===r.fg&&t.getBg(0)===r.bg||(t=e.getBlankLine(r,s),this._cachedBlankLine=t),t.isWrapped=s;const l=e.ybase+e.scrollTop,v=e.ybase+e.scrollBottom;if(e.scrollTop===0){const g=e.lines.isFull;v===e.lines.length-1?g?e.lines.recycle().copyFrom(t):e.lines.push(t.clone()):e.lines.splice(v+1,0,t.clone()),g?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{const g=v-l+1;e.lines.shiftElements(l+1,g-1,-1),e.lines.set(v,t.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(r,s,e){const t=this.buffer;if(r<0){if(t.ydisp===0)return;this.isUserScrolling=!0}else r+t.ydisp>=t.ybase&&(this.isUserScrolling=!1);const l=t.ydisp;t.ydisp=Math.max(Math.min(t.ydisp+r,t.ybase),0),l!==t.ydisp&&(s||this._onScroll.fire(t.ydisp))}};i.BufferService=u=c([d(0,S.IOptionsService)],u)},7994:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharsetService=void 0,i.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,c){this._charsets[o]=c,this.glevel===o&&(this.charset=c)}}},1753:function(x,i,o){var c=this&&this.__decorate||function(t,l,v,g){var b,p=arguments.length,w=p<3?l:g===null?g=Object.getOwnPropertyDescriptor(l,v):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(t,l,v,g);else for(var L=t.length-1;L>=0;L--)(b=t[L])&&(w=(p<3?b(w):p>3?b(l,v,w):b(l,v))||w);return p>3&&w&&Object.defineProperty(l,v,w),w},d=this&&this.__param||function(t,l){return function(v,g){l(v,g,t)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;const a=o(2585),f=o(8460),_=o(844),S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button!==4&&t.action===1&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>t.action!==32||t.button!==3},ANY:{events:31,restrict:t=>!0}};function u(t,l){let v=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(v|=64,v|=t.action):(v|=3&t.button,4&t.button&&(v|=64),8&t.button&&(v|=128),t.action===32?v|=32:t.action!==0||l||(v|=3)),v}const r=String.fromCharCode,s={DEFAULT:t=>{const l=[u(t,!1)+32,t.col+32,t.row+32];return l[0]>255||l[1]>255||l[2]>255?"":`\x1B[M${r(l[0])}${r(l[1])}${r(l[2])}`},SGR:t=>{const l=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${u(t,!0)};${t.col};${t.row}${l}`},SGR_PIXELS:t=>{const l=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${u(t,!0)};${t.x};${t.y}${l}`}};let e=i.CoreMouseService=class extends _.Disposable{constructor(t,l){super(),this._bufferService=t,this._coreService=l,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new f.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const v of Object.keys(S))this.addProtocol(v,S[v]);for(const v of Object.keys(s))this.addEncoding(v,s[v]);this.reset()}addProtocol(t,l){this._protocols[t]=l}addEncoding(t,l){this._encodings[t]=l}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;const l=this._encodings[this._activeEncoding](t);return l&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(l):this._coreService.triggerDataEvent(l,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(1&t),up:!!(2&t),drag:!!(4&t),move:!!(8&t),wheel:!!(16&t)}}_equalEvents(t,l,v){if(v){if(t.x!==l.x||t.y!==l.y)return!1}else if(t.col!==l.col||t.row!==l.row)return!1;return t.button===l.button&&t.action===l.action&&t.ctrl===l.ctrl&&t.alt===l.alt&&t.shift===l.shift}};i.CoreMouseService=e=c([d(0,a.IBufferService),d(1,a.ICoreService)],e)},6975:function(x,i,o){var c=this&&this.__decorate||function(e,t,l,v){var g,b=arguments.length,p=b<3?t:v===null?v=Object.getOwnPropertyDescriptor(t,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(e,t,l,v);else for(var w=e.length-1;w>=0;w--)(g=e[w])&&(p=(b<3?g(p):b>3?g(t,l,p):g(t,l))||p);return b>3&&p&&Object.defineProperty(t,l,p),p},d=this&&this.__param||function(e,t){return function(l,v){t(l,v,e)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;const a=o(1439),f=o(8460),_=o(844),S=o(2585),u=Object.freeze({insertMode:!1}),r=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let s=i.CoreService=class extends _.Disposable{constructor(e,t,l){super(),this._bufferService=e,this._logService=t,this._optionsService=l,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new f.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new f.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(u),this.decPrivateModes=(0,a.clone)(r)}reset(){this.modes=(0,a.clone)(u),this.decPrivateModes=(0,a.clone)(r)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const l=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&l.ybase!==l.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((v=>v.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((t=>t.charCodeAt(0))))),this._onBinary.fire(e))}};i.CoreService=s=c([d(0,S.IBufferService),d(1,S.ILogService),d(2,S.IOptionsService)],s)},9074:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;const c=o(8055),d=o(8460),a=o(844),f=o(6106);let _=0,S=0;class u extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new f.SortedList((e=>e==null?void 0:e.marker.line)),this._onDecorationRegistered=this.register(new d.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new d.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,a.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;const t=new r(e);if(t){const l=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),l.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,l){let v=0,g=0;for(const b of this._decorations.getKeyIterator(t))v=b.options.x??0,g=v+(b.options.width??1),e>=v&&e<g&&(!l||(b.options.layer??"bottom")===l)&&(yield b)}forEachDecorationAtCell(e,t,l,v){this._decorations.forEachByKey(t,(g=>{_=g.options.x??0,S=_+(g.options.width??1),e>=_&&e<S&&(!l||(g.options.layer??"bottom")===l)&&v(g)}))}}i.DecorationService=u;class r extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;const c=o(2585),d=o(8343);class a{constructor(..._){this._entries=new Map;for(const[S,u]of _)this.set(S,u)}set(_,S){const u=this._entries.get(_);return this._entries.set(_,S),u}forEach(_){for(const[S,u]of this._entries.entries())_(S,u)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}i.ServiceCollection=a,i.InstantiationService=class{constructor(){this._services=new a,this._services.set(c.IInstantiationService,this)}setService(f,_){this._services.set(f,_)}getService(f){return this._services.get(f)}createInstance(f,..._){const S=(0,d.getServiceDependencies)(f).sort(((s,e)=>s.index-e.index)),u=[];for(const s of S){const e=this._services.get(s.id);if(!e)throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${s.id}.`);u.push(e)}const r=S.length>0?S[0].index:_.length;if(_.length!==r)throw new Error(`[createInstance] First service dependency of ${f.name} at position ${r+1} conflicts with ${_.length} static arguments`);return new f(..._,...u)}}},7866:function(x,i,o){var c=this&&this.__decorate||function(r,s,e,t){var l,v=arguments.length,g=v<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,s,e,t);else for(var b=r.length-1;b>=0;b--)(l=r[b])&&(g=(v<3?l(g):v>3?l(s,e,g):l(s,e))||g);return v>3&&g&&Object.defineProperty(s,e,g),g},d=this&&this.__param||function(r,s){return function(e,t){s(e,t,r)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const a=o(844),f=o(2585),_={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF};let S,u=i.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),S=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let s=0;s<r.length;s++)typeof r[s]=="function"&&(r[s]=r[s]())}_log(r,s,e){this._evalLazyOptionalParams(e),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+s,...e)}trace(r,...s){var e;this._logLevel<=f.LogLevelEnum.TRACE&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.trace.bind(this._optionsService.options.logger))??console.log,r,s)}debug(r,...s){var e;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.debug.bind(this._optionsService.options.logger))??console.log,r,s)}info(r,...s){var e;this._logLevel<=f.LogLevelEnum.INFO&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.info.bind(this._optionsService.options.logger))??console.info,r,s)}warn(r,...s){var e;this._logLevel<=f.LogLevelEnum.WARN&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.warn.bind(this._optionsService.options.logger))??console.warn,r,s)}error(r,...s){var e;this._logLevel<=f.LogLevelEnum.ERROR&&this._log(((e=this._optionsService.options.logger)==null?void 0:e.error.bind(this._optionsService.options.logger))??console.error,r,s)}};i.LogService=u=c([d(0,f.IOptionsService)],u),i.setTraceLogger=function(r){S=r},i.traceCall=function(r,s,e){if(typeof e.value!="function")throw new Error("not supported");const t=e.value;e.value=function(...l){if(S.logLevel!==f.LogLevelEnum.TRACE)return t.apply(this,l);S.trace(`GlyphRenderer#${t.name}(${l.map((g=>JSON.stringify(g))).join(", ")})`);const v=t.apply(this,l);return S.trace(`GlyphRenderer#${t.name} return`,v),v}}},7302:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;const c=o(8460),d=o(844),a=o(6114);i.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:a.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const f=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends d.Disposable{constructor(u){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const r={...i.DEFAULT_OPTIONS};for(const s in u)if(s in r)try{const e=u[s];r[s]=this._sanitizeAndValidateOption(s,e)}catch(e){console.error(e)}this.rawOptions=r,this.options={...r},this._setupOptions(),this.register((0,d.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(u,r){return this.onOptionChange((s=>{s===u&&r(this.rawOptions[u])}))}onMultipleOptionChange(u,r){return this.onOptionChange((s=>{u.indexOf(s)!==-1&&r()}))}_setupOptions(){const u=s=>{if(!(s in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},r=(s,e)=>{if(!(s in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);e=this._sanitizeAndValidateOption(s,e),this.rawOptions[s]!==e&&(this.rawOptions[s]=e,this._onOptionChange.fire(s))};for(const s in this.rawOptions){const e={get:u.bind(this,s),set:r.bind(this,s)};Object.defineProperty(this.options,s,e)}}_sanitizeAndValidateOption(u,r){switch(u){case"cursorStyle":if(r||(r=i.DEFAULT_OPTIONS[u]),!(function(s){return s==="block"||s==="underline"||s==="bar"})(r))throw new Error(`"${r}" is not a valid value for ${u}`);break;case"wordSeparator":r||(r=i.DEFAULT_OPTIONS[u]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=f.includes(r)?r:i.DEFAULT_OPTIONS[u];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${u} cannot be less than 1, value: ${r}`);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(10*r)/10));break;case"scrollback":if((r=Math.min(r,4294967295))<0)throw new Error(`${u} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${u} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${u} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{}}return r}}i.OptionsService=_},2660:function(x,i,o){var c=this&&this.__decorate||function(_,S,u,r){var s,e=arguments.length,t=e<3?S:r===null?r=Object.getOwnPropertyDescriptor(S,u):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(_,S,u,r);else for(var l=_.length-1;l>=0;l--)(s=_[l])&&(t=(e<3?s(t):e>3?s(S,u,t):s(S,u))||t);return e>3&&t&&Object.defineProperty(S,u,t),t},d=this&&this.__param||function(_,S){return function(u,r){S(u,r,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;const a=o(2585);let f=i.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const S=this._bufferService.buffer;if(_.id===void 0){const l=S.addMarker(S.ybase+S.y),v={data:_,id:this._nextId++,lines:[l]};return l.onDispose((()=>this._removeMarkerFromLink(v,l))),this._dataByLinkId.set(v.id,v),v.id}const u=_,r=this._getEntryIdKey(u),s=this._entriesWithId.get(r);if(s)return this.addLineToLink(s.id,S.ybase+S.y),s.id;const e=S.addMarker(S.ybase+S.y),t={id:this._nextId++,key:this._getEntryIdKey(u),data:u,lines:[e]};return e.onDispose((()=>this._removeMarkerFromLink(t,e))),this._entriesWithId.set(t.key,t),this._dataByLinkId.set(t.id,t),t.id}addLineToLink(_,S){const u=this._dataByLinkId.get(_);if(u&&u.lines.every((r=>r.line!==S))){const r=this._bufferService.buffer.addMarker(S);u.lines.push(r),r.onDispose((()=>this._removeMarkerFromLink(u,r)))}}getLinkData(_){var S;return(S=this._dataByLinkId.get(_))==null?void 0:S.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,S){const u=_.lines.indexOf(S);u!==-1&&(_.lines.splice(u,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};i.OscLinkService=f=c([d(0,a.IBufferService)],f)},8343:(x,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const o="di$target",c="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(d){return d[c]||[]},i.createDecorator=function(d){if(i.serviceRegistry.has(d))return i.serviceRegistry.get(d);const a=function(f,_,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(u,r,s){r[o]===r?r[c].push({id:u,index:s}):(r[c]=[{id:u,index:s}],r[o]=r)})(a,f,S)};return a.toString=()=>d,i.serviceRegistry.set(d,a),a}},2585:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const c=o(8343);var d;i.IBufferService=(0,c.createDecorator)("BufferService"),i.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),i.ICoreService=(0,c.createDecorator)("CoreService"),i.ICharsetService=(0,c.createDecorator)("CharsetService"),i.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(d||(i.LogLevelEnum=d={})),i.ILogService=(0,c.createDecorator)("LogService"),i.IOptionsService=(0,c.createDecorator)("OptionsService"),i.IOscLinkService=(0,c.createDecorator)("OscLinkService"),i.IUnicodeService=(0,c.createDecorator)("UnicodeService"),i.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(x,i,o)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;const c=o(8460),d=o(225);class a{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,S,u=!1){return(16777215&_)<<3|(3&S)<<1|(u?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new d.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let S=0,u=0;const r=_.length;for(let s=0;s<r;++s){let e=_.charCodeAt(s);if(55296<=e&&e<=56319){if(++s>=r)return S+this.wcwidth(e);const v=_.charCodeAt(s);56320<=v&&v<=57343?e=1024*(e-55296)+v-56320+65536:S+=this.wcwidth(v)}const t=this.charProperties(e,u);let l=a.extractWidth(t);a.extractShouldJoin(t)&&(l-=a.extractWidth(u)),S+=l,u=t}return S}charProperties(_,S){return this._activeProvider.charProperties(_,S)}}i.UnicodeService=a}},C={};function E(x){var i=C[x];if(i!==void 0)return i.exports;var o=C[x]={exports:{}};return m[x].call(o.exports,o,o.exports,E),o.exports}var R={};return(()=>{var x=R;Object.defineProperty(x,"__esModule",{value:!0}),x.Terminal=void 0;const i=E(9042),o=E(3236),c=E(844),d=E(5741),a=E(8285),f=E(7975),_=E(7090),S=["cols","rows"];class u extends c.Disposable{constructor(s){super(),this._core=this.register(new o.Terminal(s)),this._addonManager=this.register(new d.AddonManager),this._publicOptions={...this._core.options};const e=l=>this._core.options[l],t=(l,v)=>{this._checkReadonlyOptions(l),this._core.options[l]=v};for(const l in this._core.options){const v={get:e.bind(this,l),set:t.bind(this,l)};Object.defineProperty(this._publicOptions,l,v)}}_checkReadonlyOptions(s){if(S.includes(s))throw new Error(`Option "${s}" 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 f.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.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 a.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const s=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:s.applicationCursorKeys,applicationKeypadMode:s.applicationKeypad,bracketedPasteMode:s.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:s.origin,reverseWraparoundMode:s.reverseWraparound,sendFocusMode:s.sendFocus,wraparoundMode:s.wraparound}}get options(){return this._publicOptions}set options(s){for(const e in s)this._publicOptions[e]=s[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(s,e=!0){this._core.input(s,e)}resize(s,e){this._verifyIntegers(s,e),this._core.resize(s,e)}open(s){this._core.open(s)}attachCustomKeyEventHandler(s){this._core.attachCustomKeyEventHandler(s)}attachCustomWheelEventHandler(s){this._core.attachCustomWheelEventHandler(s)}registerLinkProvider(s){return this._core.registerLinkProvider(s)}registerCharacterJoiner(s){return this._checkProposedApi(),this._core.registerCharacterJoiner(s)}deregisterCharacterJoiner(s){this._checkProposedApi(),this._core.deregisterCharacterJoiner(s)}registerMarker(s=0){return this._verifyIntegers(s),this._core.registerMarker(s)}registerDecoration(s){return this._checkProposedApi(),this._verifyPositiveIntegers(s.x??0,s.width??0,s.height??0),this._core.registerDecoration(s)}hasSelection(){return this._core.hasSelection()}select(s,e,t){this._verifyIntegers(s,e,t),this._core.select(s,e,t)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(s,e){this._verifyIntegers(s,e),this._core.selectLines(s,e)}dispose(){super.dispose()}scrollLines(s){this._verifyIntegers(s),this._core.scrollLines(s)}scrollPages(s){this._verifyIntegers(s),this._core.scrollPages(s)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(s){this._verifyIntegers(s),this._core.scrollToLine(s)}clear(){this._core.clear()}write(s,e){this._core.write(s,e)}writeln(s,e){this._core.write(s),this._core.write(`\r
|
|
19
|
+
`,e)}paste(s){this._core.paste(s)}refresh(s,e){this._verifyIntegers(s,e),this._core.refresh(s,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return i}_verifyIntegers(...s){for(const e of s)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const e of s)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}x.Terminal=u})(),R})()))})(Ct)),Ct.exports}var Es=ys();function pe(n,h,{checkForDefaultPrevented:m=!0}={}){return function(E){if(n==null||n(E),m===!1||!E.defaultPrevented)return h==null?void 0:h(E)}}function Qt(n,h){if(typeof n=="function")return n(h);n!=null&&(n.current=h)}function Rr(...n){return h=>{let m=!1;const C=n.map(E=>{const R=Qt(E,h);return!m&&typeof R=="function"&&(m=!0),R});if(m)return()=>{for(let E=0;E<C.length;E++){const R=C[E];typeof R=="function"?R():Qt(n[E],null)}}}}function Le(...n){return j.useCallback(Rr(...n),n)}function Lr(n,h=[]){let m=[];function C(R,x){const i=j.createContext(x),o=m.length;m=[...m,x];const c=a=>{var s;const{scope:f,children:_,...S}=a,u=((s=f==null?void 0:f[n])==null?void 0:s[o])||i,r=j.useMemo(()=>S,Object.values(S));return q.jsx(u.Provider,{value:r,children:_})};c.displayName=R+"Provider";function d(a,f){var u;const _=((u=f==null?void 0:f[n])==null?void 0:u[o])||i,S=j.useContext(_);if(S)return S;if(x!==void 0)return x;throw new Error(`\`${a}\` must be used within \`${R}\``)}return[c,d]}const E=()=>{const R=m.map(x=>j.createContext(x));return function(i){const o=(i==null?void 0:i[n])||R;return j.useMemo(()=>({[`__scope${n}`]:{...i,[n]:o}}),[i,o])}};return E.scopeName=n,[C,xs(E,...h)]}function xs(...n){const h=n[0];if(n.length===1)return h;const m=()=>{const C=n.map(E=>({useScope:E(),scopeName:E.scopeName}));return function(R){const x=C.reduce((i,{useScope:o,scopeName:c})=>{const a=o(R)[`__scope${c}`];return{...i,...a}},{});return j.useMemo(()=>({[`__scope${h.scopeName}`]:x}),[x])}};return m.scopeName=h.scopeName,m}function ks(n){const h=Rs(n),m=j.forwardRef((C,E)=>{const{children:R,...x}=C,i=j.Children.toArray(R),o=i.find(Ds);if(o){const c=o.props.children,d=i.map(a=>a===o?j.Children.count(c)>1?j.Children.only(null):j.isValidElement(c)?c.props.children:null:a);return q.jsx(h,{...x,ref:E,children:j.isValidElement(c)?j.cloneElement(c,void 0,d):null})}return q.jsx(h,{...x,ref:E,children:R})});return m.displayName=`${n}.Slot`,m}function Rs(n){const h=j.forwardRef((m,C)=>{const{children:E,...R}=m;if(j.isValidElement(E)){const x=Os(E),i=As(R,E.props);return E.type!==j.Fragment&&(i.ref=C?Rr(C,x):x),j.cloneElement(E,i)}return j.Children.count(E)>1?j.Children.only(null):null});return h.displayName=`${n}.SlotClone`,h}var Dr=Symbol("radix.slottable");function Ls(n){const h=({children:m})=>q.jsx(q.Fragment,{children:m});return h.displayName=`${n}.Slottable`,h.__radixId=Dr,h}function Ds(n){return j.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===Dr}function As(n,h){const m={...h};for(const C in h){const E=n[C],R=h[C];/^on[A-Z]/.test(C)?E&&R?m[C]=(...i)=>{const o=R(...i);return E(...i),o}:E&&(m[C]=E):C==="style"?m[C]={...E,...R}:C==="className"&&(m[C]=[E,R].filter(Boolean).join(" "))}return{...n,...m}}function Os(n){var C,E;let h=(C=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:C.get,m=h&&"isReactWarning"in h&&h.isReactWarning;return m?n.ref:(h=(E=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:E.get,m=h&&"isReactWarning"in h&&h.isReactWarning,m?n.props.ref:n.props.ref||n.ref)}var Ts=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xe=Ts.reduce((n,h)=>{const m=ks(`Primitive.${h}`),C=j.forwardRef((E,R)=>{const{asChild:x,...i}=E,o=x?m:h;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),q.jsx(o,{...i,ref:R})});return C.displayName=`Primitive.${h}`,{...n,[h]:C}},{});function Ms(n,h){n&&gr.flushSync(()=>n.dispatchEvent(h))}function ct(n){const h=j.useRef(n);return j.useEffect(()=>{h.current=n}),j.useMemo(()=>(...m)=>{var C;return(C=h.current)==null?void 0:C.call(h,...m)},[])}function Ps(n,h=globalThis==null?void 0:globalThis.document){const m=ct(n);j.useEffect(()=>{const C=E=>{E.key==="Escape"&&m(E)};return h.addEventListener("keydown",C,{capture:!0}),()=>h.removeEventListener("keydown",C,{capture:!0})},[m,h])}var Bs="DismissableLayer",Dt="dismissableLayer.update",Is="dismissableLayer.pointerDownOutside",Hs="dismissableLayer.focusOutside",er,Ar=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Or=j.forwardRef((n,h)=>{const{disableOutsidePointerEvents:m=!1,onEscapeKeyDown:C,onPointerDownOutside:E,onFocusOutside:R,onInteractOutside:x,onDismiss:i,...o}=n,c=j.useContext(Ar),[d,a]=j.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=j.useState({}),S=Le(h,b=>a(b)),u=Array.from(c.layers),[r]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),s=u.indexOf(r),e=d?u.indexOf(d):-1,t=c.layersWithOutsidePointerEventsDisabled.size>0,l=e>=s,v=Ws(b=>{const p=b.target,w=[...c.branches].some(L=>L.contains(p));!l||w||(E==null||E(b),x==null||x(b),b.defaultPrevented||i==null||i())},f),g=js(b=>{const p=b.target;[...c.branches].some(L=>L.contains(p))||(R==null||R(b),x==null||x(b),b.defaultPrevented||i==null||i())},f);return Ps(b=>{e===c.layers.size-1&&(C==null||C(b),!b.defaultPrevented&&i&&(b.preventDefault(),i()))},f),j.useEffect(()=>{if(d)return m&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(er=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),tr(),()=>{m&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=er)}},[d,f,m,c]),j.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),tr())},[d,c]),j.useEffect(()=>{const b=()=>_({});return document.addEventListener(Dt,b),()=>document.removeEventListener(Dt,b)},[]),q.jsx(xe.div,{...o,ref:S,style:{pointerEvents:t?l?"auto":"none":void 0,...n.style},onFocusCapture:pe(n.onFocusCapture,g.onFocusCapture),onBlurCapture:pe(n.onBlurCapture,g.onBlurCapture),onPointerDownCapture:pe(n.onPointerDownCapture,v.onPointerDownCapture)})});Or.displayName=Bs;var Fs="DismissableLayerBranch",Ns=j.forwardRef((n,h)=>{const m=j.useContext(Ar),C=j.useRef(null),E=Le(h,C);return j.useEffect(()=>{const R=C.current;if(R)return m.branches.add(R),()=>{m.branches.delete(R)}},[m.branches]),q.jsx(xe.div,{...n,ref:E})});Ns.displayName=Fs;function Ws(n,h=globalThis==null?void 0:globalThis.document){const m=ct(n),C=j.useRef(!1),E=j.useRef(()=>{});return j.useEffect(()=>{const R=i=>{if(i.target&&!C.current){let o=function(){Tr(Is,m,c,{discrete:!0})};const c={originalEvent:i};i.pointerType==="touch"?(h.removeEventListener("click",E.current),E.current=o,h.addEventListener("click",E.current,{once:!0})):o()}else h.removeEventListener("click",E.current);C.current=!1},x=window.setTimeout(()=>{h.addEventListener("pointerdown",R)},0);return()=>{window.clearTimeout(x),h.removeEventListener("pointerdown",R),h.removeEventListener("click",E.current)}},[h,m]),{onPointerDownCapture:()=>C.current=!0}}function js(n,h=globalThis==null?void 0:globalThis.document){const m=ct(n),C=j.useRef(!1);return j.useEffect(()=>{const E=R=>{R.target&&!C.current&&Tr(Hs,m,{originalEvent:R},{discrete:!1})};return h.addEventListener("focusin",E),()=>h.removeEventListener("focusin",E)},[h,m]),{onFocusCapture:()=>C.current=!0,onBlurCapture:()=>C.current=!1}}function tr(){const n=new CustomEvent(Dt);document.dispatchEvent(n)}function Tr(n,h,m,{discrete:C}){const E=m.originalEvent.target,R=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:m});h&&E.addEventListener(n,h,{once:!0}),C?Ms(E,R):E.dispatchEvent(R)}var we=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},$s=j[" useId ".trim().toString()]||(()=>{}),Us=0;function zs(n){const[h,m]=j.useState($s());return we(()=>{m(C=>C??String(Us++))},[n]),h?`radix-${h}`:""}const qs=["top","right","bottom","left"],ye=Math.min,ne=Math.max,it=Math.round,Ze=Math.floor,de=n=>({x:n,y:n}),Ks={left:"right",right:"left",bottom:"top",top:"bottom"},Vs={start:"end",end:"start"};function At(n,h,m){return ne(n,ye(h,m))}function ve(n,h){return typeof n=="function"?n(h):n}function ge(n){return n.split("-")[0]}function Me(n){return n.split("-")[1]}function Bt(n){return n==="x"?"y":"x"}function It(n){return n==="y"?"height":"width"}const Gs=new Set(["top","bottom"]);function ue(n){return Gs.has(ge(n))?"y":"x"}function Ht(n){return Bt(ue(n))}function Xs(n,h,m){m===void 0&&(m=!1);const C=Me(n),E=Ht(n),R=It(E);let x=E==="x"?C===(m?"end":"start")?"right":"left":C==="start"?"bottom":"top";return h.reference[R]>h.floating[R]&&(x=st(x)),[x,st(x)]}function Js(n){const h=st(n);return[Ot(n),h,Ot(h)]}function Ot(n){return n.replace(/start|end/g,h=>Vs[h])}const rr=["left","right"],ir=["right","left"],Ys=["top","bottom"],Zs=["bottom","top"];function Qs(n,h,m){switch(n){case"top":case"bottom":return m?h?ir:rr:h?rr:ir;case"left":case"right":return h?Ys:Zs;default:return[]}}function en(n,h,m,C){const E=Me(n);let R=Qs(ge(n),m==="start",C);return E&&(R=R.map(x=>x+"-"+E),h&&(R=R.concat(R.map(Ot)))),R}function st(n){return n.replace(/left|right|bottom|top/g,h=>Ks[h])}function tn(n){return{top:0,right:0,bottom:0,left:0,...n}}function Mr(n){return typeof n!="number"?tn(n):{top:n,right:n,bottom:n,left:n}}function nt(n){const{x:h,y:m,width:C,height:E}=n;return{width:C,height:E,top:m,left:h,right:h+C,bottom:m+E,x:h,y:m}}function sr(n,h,m){let{reference:C,floating:E}=n;const R=ue(h),x=Ht(h),i=It(x),o=ge(h),c=R==="y",d=C.x+C.width/2-E.width/2,a=C.y+C.height/2-E.height/2,f=C[i]/2-E[i]/2;let _;switch(o){case"top":_={x:d,y:C.y-E.height};break;case"bottom":_={x:d,y:C.y+C.height};break;case"right":_={x:C.x+C.width,y:a};break;case"left":_={x:C.x-E.width,y:a};break;default:_={x:C.x,y:C.y}}switch(Me(h)){case"start":_[x]-=f*(m&&c?-1:1);break;case"end":_[x]+=f*(m&&c?-1:1);break}return _}const rn=async(n,h,m)=>{const{placement:C="bottom",strategy:E="absolute",middleware:R=[],platform:x}=m,i=R.filter(Boolean),o=await(x.isRTL==null?void 0:x.isRTL(h));let c=await x.getElementRects({reference:n,floating:h,strategy:E}),{x:d,y:a}=sr(c,C,o),f=C,_={},S=0;for(let u=0;u<i.length;u++){const{name:r,fn:s}=i[u],{x:e,y:t,data:l,reset:v}=await s({x:d,y:a,initialPlacement:C,placement:f,strategy:E,middlewareData:_,rects:c,platform:x,elements:{reference:n,floating:h}});d=e??d,a=t??a,_={..._,[r]:{..._[r],...l}},v&&S<=50&&(S++,typeof v=="object"&&(v.placement&&(f=v.placement),v.rects&&(c=v.rects===!0?await x.getElementRects({reference:n,floating:h,strategy:E}):v.rects),{x:d,y:a}=sr(c,f,o)),u=-1)}return{x:d,y:a,placement:f,strategy:E,middlewareData:_}};async function $e(n,h){var m;h===void 0&&(h={});const{x:C,y:E,platform:R,rects:x,elements:i,strategy:o}=n,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:a="floating",altBoundary:f=!1,padding:_=0}=ve(h,n),S=Mr(_),r=i[f?a==="floating"?"reference":"floating":a],s=nt(await R.getClippingRect({element:(m=await(R.isElement==null?void 0:R.isElement(r)))==null||m?r:r.contextElement||await(R.getDocumentElement==null?void 0:R.getDocumentElement(i.floating)),boundary:c,rootBoundary:d,strategy:o})),e=a==="floating"?{x:C,y:E,width:x.floating.width,height:x.floating.height}:x.reference,t=await(R.getOffsetParent==null?void 0:R.getOffsetParent(i.floating)),l=await(R.isElement==null?void 0:R.isElement(t))?await(R.getScale==null?void 0:R.getScale(t))||{x:1,y:1}:{x:1,y:1},v=nt(R.convertOffsetParentRelativeRectToViewportRelativeRect?await R.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:e,offsetParent:t,strategy:o}):e);return{top:(s.top-v.top+S.top)/l.y,bottom:(v.bottom-s.bottom+S.bottom)/l.y,left:(s.left-v.left+S.left)/l.x,right:(v.right-s.right+S.right)/l.x}}const sn=n=>({name:"arrow",options:n,async fn(h){const{x:m,y:C,placement:E,rects:R,platform:x,elements:i,middlewareData:o}=h,{element:c,padding:d=0}=ve(n,h)||{};if(c==null)return{};const a=Mr(d),f={x:m,y:C},_=Ht(E),S=It(_),u=await x.getDimensions(c),r=_==="y",s=r?"top":"left",e=r?"bottom":"right",t=r?"clientHeight":"clientWidth",l=R.reference[S]+R.reference[_]-f[_]-R.floating[S],v=f[_]-R.reference[_],g=await(x.getOffsetParent==null?void 0:x.getOffsetParent(c));let b=g?g[t]:0;(!b||!await(x.isElement==null?void 0:x.isElement(g)))&&(b=i.floating[t]||R.floating[S]);const p=l/2-v/2,w=b/2-u[S]/2-1,L=ye(a[s],w),M=ye(a[e],w),B=L,D=b-u[S]-M,H=b/2-u[S]/2+p,I=At(B,H,D),$=!o.arrow&&Me(E)!=null&&H!==I&&R.reference[S]/2-(H<B?L:M)-u[S]/2<0,z=$?H<B?H-B:H-D:0;return{[_]:f[_]+z,data:{[_]:I,centerOffset:H-I-z,...$&&{alignmentOffset:z}},reset:$}}}),nn=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(h){var m,C;const{placement:E,middlewareData:R,rects:x,initialPlacement:i,platform:o,elements:c}=h,{mainAxis:d=!0,crossAxis:a=!0,fallbackPlacements:f,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:u=!0,...r}=ve(n,h);if((m=R.arrow)!=null&&m.alignmentOffset)return{};const s=ge(E),e=ue(i),t=ge(i)===i,l=await(o.isRTL==null?void 0:o.isRTL(c.floating)),v=f||(t||!u?[st(i)]:Js(i)),g=S!=="none";!f&&g&&v.push(...en(i,u,S,l));const b=[i,...v],p=await $e(h,r),w=[];let L=((C=R.flip)==null?void 0:C.overflows)||[];if(d&&w.push(p[s]),a){const H=Xs(E,x,l);w.push(p[H[0]],p[H[1]])}if(L=[...L,{placement:E,overflows:w}],!w.every(H=>H<=0)){var M,B;const H=(((M=R.flip)==null?void 0:M.index)||0)+1,I=b[H];if(I&&(!(a==="alignment"?e!==ue(I):!1)||L.every(N=>ue(N.placement)===e?N.overflows[0]>0:!0)))return{data:{index:H,overflows:L},reset:{placement:I}};let $=(B=L.filter(z=>z.overflows[0]<=0).sort((z,N)=>z.overflows[1]-N.overflows[1])[0])==null?void 0:B.placement;if(!$)switch(_){case"bestFit":{var D;const z=(D=L.filter(N=>{if(g){const y=ue(N.placement);return y===e||y==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(y=>y>0).reduce((y,A)=>y+A,0)]).sort((N,y)=>N[1]-y[1])[0])==null?void 0:D[0];z&&($=z);break}case"initialPlacement":$=i;break}if(E!==$)return{reset:{placement:$}}}return{}}}};function nr(n,h){return{top:n.top-h.height,right:n.right-h.width,bottom:n.bottom-h.height,left:n.left-h.width}}function or(n){return qs.some(h=>n[h]>=0)}const on=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(h){const{rects:m}=h,{strategy:C="referenceHidden",...E}=ve(n,h);switch(C){case"referenceHidden":{const R=await $e(h,{...E,elementContext:"reference"}),x=nr(R,m.reference);return{data:{referenceHiddenOffsets:x,referenceHidden:or(x)}}}case"escaped":{const R=await $e(h,{...E,altBoundary:!0}),x=nr(R,m.floating);return{data:{escapedOffsets:x,escaped:or(x)}}}default:return{}}}}},Pr=new Set(["left","top"]);async function an(n,h){const{placement:m,platform:C,elements:E}=n,R=await(C.isRTL==null?void 0:C.isRTL(E.floating)),x=ge(m),i=Me(m),o=ue(m)==="y",c=Pr.has(x)?-1:1,d=R&&o?-1:1,a=ve(h,n);let{mainAxis:f,crossAxis:_,alignmentAxis:S}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return i&&typeof S=="number"&&(_=i==="end"?S*-1:S),o?{x:_*d,y:f*c}:{x:f*c,y:_*d}}const cn=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(h){var m,C;const{x:E,y:R,placement:x,middlewareData:i}=h,o=await an(h,n);return x===((m=i.offset)==null?void 0:m.placement)&&(C=i.arrow)!=null&&C.alignmentOffset?{}:{x:E+o.x,y:R+o.y,data:{...o,placement:x}}}}},ln=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(h){const{x:m,y:C,placement:E}=h,{mainAxis:R=!0,crossAxis:x=!1,limiter:i={fn:r=>{let{x:s,y:e}=r;return{x:s,y:e}}},...o}=ve(n,h),c={x:m,y:C},d=await $e(h,o),a=ue(ge(E)),f=Bt(a);let _=c[f],S=c[a];if(R){const r=f==="y"?"top":"left",s=f==="y"?"bottom":"right",e=_+d[r],t=_-d[s];_=At(e,_,t)}if(x){const r=a==="y"?"top":"left",s=a==="y"?"bottom":"right",e=S+d[r],t=S-d[s];S=At(e,S,t)}const u=i.fn({...h,[f]:_,[a]:S});return{...u,data:{x:u.x-m,y:u.y-C,enabled:{[f]:R,[a]:x}}}}}},hn=function(n){return n===void 0&&(n={}),{options:n,fn(h){const{x:m,y:C,placement:E,rects:R,middlewareData:x}=h,{offset:i=0,mainAxis:o=!0,crossAxis:c=!0}=ve(n,h),d={x:m,y:C},a=ue(E),f=Bt(a);let _=d[f],S=d[a];const u=ve(i,h),r=typeof u=="number"?{mainAxis:u,crossAxis:0}:{mainAxis:0,crossAxis:0,...u};if(o){const t=f==="y"?"height":"width",l=R.reference[f]-R.floating[t]+r.mainAxis,v=R.reference[f]+R.reference[t]-r.mainAxis;_<l?_=l:_>v&&(_=v)}if(c){var s,e;const t=f==="y"?"width":"height",l=Pr.has(ge(E)),v=R.reference[a]-R.floating[t]+(l&&((s=x.offset)==null?void 0:s[a])||0)+(l?0:r.crossAxis),g=R.reference[a]+R.reference[t]+(l?0:((e=x.offset)==null?void 0:e[a])||0)-(l?r.crossAxis:0);S<v?S=v:S>g&&(S=g)}return{[f]:_,[a]:S}}}},un=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(h){var m,C;const{placement:E,rects:R,platform:x,elements:i}=h,{apply:o=()=>{},...c}=ve(n,h),d=await $e(h,c),a=ge(E),f=Me(E),_=ue(E)==="y",{width:S,height:u}=R.floating;let r,s;a==="top"||a==="bottom"?(r=a,s=f===(await(x.isRTL==null?void 0:x.isRTL(i.floating))?"start":"end")?"left":"right"):(s=a,r=f==="end"?"top":"bottom");const e=u-d.top-d.bottom,t=S-d.left-d.right,l=ye(u-d[r],e),v=ye(S-d[s],t),g=!h.middlewareData.shift;let b=l,p=v;if((m=h.middlewareData.shift)!=null&&m.enabled.x&&(p=t),(C=h.middlewareData.shift)!=null&&C.enabled.y&&(b=e),g&&!f){const L=ne(d.left,0),M=ne(d.right,0),B=ne(d.top,0),D=ne(d.bottom,0);_?p=S-2*(L!==0||M!==0?L+M:ne(d.left,d.right)):b=u-2*(B!==0||D!==0?B+D:ne(d.top,d.bottom))}await o({...h,availableWidth:p,availableHeight:b});const w=await x.getDimensions(i.floating);return S!==w.width||u!==w.height?{reset:{rects:!0}}:{}}}};function lt(){return typeof window<"u"}function Pe(n){return Br(n)?(n.nodeName||"").toLowerCase():"#document"}function oe(n){var h;return(n==null||(h=n.ownerDocument)==null?void 0:h.defaultView)||window}function _e(n){var h;return(h=(Br(n)?n.ownerDocument:n.document)||window.document)==null?void 0:h.documentElement}function Br(n){return lt()?n instanceof Node||n instanceof oe(n).Node:!1}function ce(n){return lt()?n instanceof Element||n instanceof oe(n).Element:!1}function fe(n){return lt()?n instanceof HTMLElement||n instanceof oe(n).HTMLElement:!1}function ar(n){return!lt()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof oe(n).ShadowRoot}const dn=new Set(["inline","contents"]);function Ke(n){const{overflow:h,overflowX:m,overflowY:C,display:E}=le(n);return/auto|scroll|overlay|hidden|clip/.test(h+C+m)&&!dn.has(E)}const fn=new Set(["table","td","th"]);function _n(n){return fn.has(Pe(n))}const pn=[":popover-open",":modal"];function ht(n){return pn.some(h=>{try{return n.matches(h)}catch{return!1}})}const vn=["transform","translate","scale","rotate","perspective"],gn=["transform","translate","scale","rotate","perspective","filter"],mn=["paint","layout","strict","content"];function Ft(n){const h=Nt(),m=ce(n)?le(n):n;return vn.some(C=>m[C]?m[C]!=="none":!1)||(m.containerType?m.containerType!=="normal":!1)||!h&&(m.backdropFilter?m.backdropFilter!=="none":!1)||!h&&(m.filter?m.filter!=="none":!1)||gn.some(C=>(m.willChange||"").includes(C))||mn.some(C=>(m.contain||"").includes(C))}function Sn(n){let h=Ee(n);for(;fe(h)&&!Oe(h);){if(Ft(h))return h;if(ht(h))return null;h=Ee(h)}return null}function Nt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const bn=new Set(["html","body","#document"]);function Oe(n){return bn.has(Pe(n))}function le(n){return oe(n).getComputedStyle(n)}function ut(n){return ce(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Ee(n){if(Pe(n)==="html")return n;const h=n.assignedSlot||n.parentNode||ar(n)&&n.host||_e(n);return ar(h)?h.host:h}function Ir(n){const h=Ee(n);return Oe(h)?n.ownerDocument?n.ownerDocument.body:n.body:fe(h)&&Ke(h)?h:Ir(h)}function Ue(n,h,m){var C;h===void 0&&(h=[]),m===void 0&&(m=!0);const E=Ir(n),R=E===((C=n.ownerDocument)==null?void 0:C.body),x=oe(E);if(R){const i=Tt(x);return h.concat(x,x.visualViewport||[],Ke(E)?E:[],i&&m?Ue(i):[])}return h.concat(E,Ue(E,[],m))}function Tt(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Hr(n){const h=le(n);let m=parseFloat(h.width)||0,C=parseFloat(h.height)||0;const E=fe(n),R=E?n.offsetWidth:m,x=E?n.offsetHeight:C,i=it(m)!==R||it(C)!==x;return i&&(m=R,C=x),{width:m,height:C,$:i}}function Wt(n){return ce(n)?n:n.contextElement}function Ae(n){const h=Wt(n);if(!fe(h))return de(1);const m=h.getBoundingClientRect(),{width:C,height:E,$:R}=Hr(h);let x=(R?it(m.width):m.width)/C,i=(R?it(m.height):m.height)/E;return(!x||!Number.isFinite(x))&&(x=1),(!i||!Number.isFinite(i))&&(i=1),{x,y:i}}const Cn=de(0);function Fr(n){const h=oe(n);return!Nt()||!h.visualViewport?Cn:{x:h.visualViewport.offsetLeft,y:h.visualViewport.offsetTop}}function wn(n,h,m){return h===void 0&&(h=!1),!m||h&&m!==oe(n)?!1:h}function Re(n,h,m,C){h===void 0&&(h=!1),m===void 0&&(m=!1);const E=n.getBoundingClientRect(),R=Wt(n);let x=de(1);h&&(C?ce(C)&&(x=Ae(C)):x=Ae(n));const i=wn(R,m,C)?Fr(R):de(0);let o=(E.left+i.x)/x.x,c=(E.top+i.y)/x.y,d=E.width/x.x,a=E.height/x.y;if(R){const f=oe(R),_=C&&ce(C)?oe(C):C;let S=f,u=Tt(S);for(;u&&C&&_!==S;){const r=Ae(u),s=u.getBoundingClientRect(),e=le(u),t=s.left+(u.clientLeft+parseFloat(e.paddingLeft))*r.x,l=s.top+(u.clientTop+parseFloat(e.paddingTop))*r.y;o*=r.x,c*=r.y,d*=r.x,a*=r.y,o+=t,c+=l,S=oe(u),u=Tt(S)}}return nt({width:d,height:a,x:o,y:c})}function dt(n,h){const m=ut(n).scrollLeft;return h?h.left+m:Re(_e(n)).left+m}function Nr(n,h){const m=n.getBoundingClientRect(),C=m.left+h.scrollLeft-dt(n,m),E=m.top+h.scrollTop;return{x:C,y:E}}function yn(n){let{elements:h,rect:m,offsetParent:C,strategy:E}=n;const R=E==="fixed",x=_e(C),i=h?ht(h.floating):!1;if(C===x||i&&R)return m;let o={scrollLeft:0,scrollTop:0},c=de(1);const d=de(0),a=fe(C);if((a||!a&&!R)&&((Pe(C)!=="body"||Ke(x))&&(o=ut(C)),fe(C))){const _=Re(C);c=Ae(C),d.x=_.x+C.clientLeft,d.y=_.y+C.clientTop}const f=x&&!a&&!R?Nr(x,o):de(0);return{width:m.width*c.x,height:m.height*c.y,x:m.x*c.x-o.scrollLeft*c.x+d.x+f.x,y:m.y*c.y-o.scrollTop*c.y+d.y+f.y}}function En(n){return Array.from(n.getClientRects())}function xn(n){const h=_e(n),m=ut(n),C=n.ownerDocument.body,E=ne(h.scrollWidth,h.clientWidth,C.scrollWidth,C.clientWidth),R=ne(h.scrollHeight,h.clientHeight,C.scrollHeight,C.clientHeight);let x=-m.scrollLeft+dt(n);const i=-m.scrollTop;return le(C).direction==="rtl"&&(x+=ne(h.clientWidth,C.clientWidth)-E),{width:E,height:R,x,y:i}}const cr=25;function kn(n,h){const m=oe(n),C=_e(n),E=m.visualViewport;let R=C.clientWidth,x=C.clientHeight,i=0,o=0;if(E){R=E.width,x=E.height;const d=Nt();(!d||d&&h==="fixed")&&(i=E.offsetLeft,o=E.offsetTop)}const c=dt(C);if(c<=0){const d=C.ownerDocument,a=d.body,f=getComputedStyle(a),_=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,S=Math.abs(C.clientWidth-a.clientWidth-_);S<=cr&&(R-=S)}else c<=cr&&(R+=c);return{width:R,height:x,x:i,y:o}}const Rn=new Set(["absolute","fixed"]);function Ln(n,h){const m=Re(n,!0,h==="fixed"),C=m.top+n.clientTop,E=m.left+n.clientLeft,R=fe(n)?Ae(n):de(1),x=n.clientWidth*R.x,i=n.clientHeight*R.y,o=E*R.x,c=C*R.y;return{width:x,height:i,x:o,y:c}}function lr(n,h,m){let C;if(h==="viewport")C=kn(n,m);else if(h==="document")C=xn(_e(n));else if(ce(h))C=Ln(h,m);else{const E=Fr(n);C={x:h.x-E.x,y:h.y-E.y,width:h.width,height:h.height}}return nt(C)}function Wr(n,h){const m=Ee(n);return m===h||!ce(m)||Oe(m)?!1:le(m).position==="fixed"||Wr(m,h)}function Dn(n,h){const m=h.get(n);if(m)return m;let C=Ue(n,[],!1).filter(i=>ce(i)&&Pe(i)!=="body"),E=null;const R=le(n).position==="fixed";let x=R?Ee(n):n;for(;ce(x)&&!Oe(x);){const i=le(x),o=Ft(x);!o&&i.position==="fixed"&&(E=null),(R?!o&&!E:!o&&i.position==="static"&&!!E&&Rn.has(E.position)||Ke(x)&&!o&&Wr(n,x))?C=C.filter(d=>d!==x):E=i,x=Ee(x)}return h.set(n,C),C}function An(n){let{element:h,boundary:m,rootBoundary:C,strategy:E}=n;const x=[...m==="clippingAncestors"?ht(h)?[]:Dn(h,this._c):[].concat(m),C],i=x[0],o=x.reduce((c,d)=>{const a=lr(h,d,E);return c.top=ne(a.top,c.top),c.right=ye(a.right,c.right),c.bottom=ye(a.bottom,c.bottom),c.left=ne(a.left,c.left),c},lr(h,i,E));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}}function On(n){const{width:h,height:m}=Hr(n);return{width:h,height:m}}function Tn(n,h,m){const C=fe(h),E=_e(h),R=m==="fixed",x=Re(n,!0,R,h);let i={scrollLeft:0,scrollTop:0};const o=de(0);function c(){o.x=dt(E)}if(C||!C&&!R)if((Pe(h)!=="body"||Ke(E))&&(i=ut(h)),C){const _=Re(h,!0,R,h);o.x=_.x+h.clientLeft,o.y=_.y+h.clientTop}else E&&c();R&&!C&&E&&c();const d=E&&!C&&!R?Nr(E,i):de(0),a=x.left+i.scrollLeft-o.x-d.x,f=x.top+i.scrollTop-o.y-d.y;return{x:a,y:f,width:x.width,height:x.height}}function wt(n){return le(n).position==="static"}function hr(n,h){if(!fe(n)||le(n).position==="fixed")return null;if(h)return h(n);let m=n.offsetParent;return _e(n)===m&&(m=m.ownerDocument.body),m}function jr(n,h){const m=oe(n);if(ht(n))return m;if(!fe(n)){let E=Ee(n);for(;E&&!Oe(E);){if(ce(E)&&!wt(E))return E;E=Ee(E)}return m}let C=hr(n,h);for(;C&&_n(C)&&wt(C);)C=hr(C,h);return C&&Oe(C)&&wt(C)&&!Ft(C)?m:C||Sn(n)||m}const Mn=async function(n){const h=this.getOffsetParent||jr,m=this.getDimensions,C=await m(n.floating);return{reference:Tn(n.reference,await h(n.floating),n.strategy),floating:{x:0,y:0,width:C.width,height:C.height}}};function Pn(n){return le(n).direction==="rtl"}const Bn={convertOffsetParentRelativeRectToViewportRelativeRect:yn,getDocumentElement:_e,getClippingRect:An,getOffsetParent:jr,getElementRects:Mn,getClientRects:En,getDimensions:On,getScale:Ae,isElement:ce,isRTL:Pn};function $r(n,h){return n.x===h.x&&n.y===h.y&&n.width===h.width&&n.height===h.height}function In(n,h){let m=null,C;const E=_e(n);function R(){var i;clearTimeout(C),(i=m)==null||i.disconnect(),m=null}function x(i,o){i===void 0&&(i=!1),o===void 0&&(o=1),R();const c=n.getBoundingClientRect(),{left:d,top:a,width:f,height:_}=c;if(i||h(),!f||!_)return;const S=Ze(a),u=Ze(E.clientWidth-(d+f)),r=Ze(E.clientHeight-(a+_)),s=Ze(d),t={rootMargin:-S+"px "+-u+"px "+-r+"px "+-s+"px",threshold:ne(0,ye(1,o))||1};let l=!0;function v(g){const b=g[0].intersectionRatio;if(b!==o){if(!l)return x();b?x(!1,b):C=setTimeout(()=>{x(!1,1e-7)},1e3)}b===1&&!$r(c,n.getBoundingClientRect())&&x(),l=!1}try{m=new IntersectionObserver(v,{...t,root:E.ownerDocument})}catch{m=new IntersectionObserver(v,t)}m.observe(n)}return x(!0),R}function Hn(n,h,m,C){C===void 0&&(C={});const{ancestorScroll:E=!0,ancestorResize:R=!0,elementResize:x=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:o=!1}=C,c=Wt(n),d=E||R?[...c?Ue(c):[],...Ue(h)]:[];d.forEach(s=>{E&&s.addEventListener("scroll",m,{passive:!0}),R&&s.addEventListener("resize",m)});const a=c&&i?In(c,m):null;let f=-1,_=null;x&&(_=new ResizeObserver(s=>{let[e]=s;e&&e.target===c&&_&&(_.unobserve(h),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var t;(t=_)==null||t.observe(h)})),m()}),c&&!o&&_.observe(c),_.observe(h));let S,u=o?Re(n):null;o&&r();function r(){const s=Re(n);u&&!$r(u,s)&&m(),u=s,S=requestAnimationFrame(r)}return m(),()=>{var s;d.forEach(e=>{E&&e.removeEventListener("scroll",m),R&&e.removeEventListener("resize",m)}),a==null||a(),(s=_)==null||s.disconnect(),_=null,o&&cancelAnimationFrame(S)}}const Fn=cn,Nn=ln,Wn=nn,jn=un,$n=on,ur=sn,Un=hn,zn=(n,h,m)=>{const C=new Map,E={platform:Bn,...m},R={...E.platform,_c:C};return rn(n,h,{...E,platform:R})};var qn=typeof document<"u",Kn=function(){},tt=qn?X.useLayoutEffect:Kn;function ot(n,h){if(n===h)return!0;if(typeof n!=typeof h)return!1;if(typeof n=="function"&&n.toString()===h.toString())return!0;let m,C,E;if(n&&h&&typeof n=="object"){if(Array.isArray(n)){if(m=n.length,m!==h.length)return!1;for(C=m;C--!==0;)if(!ot(n[C],h[C]))return!1;return!0}if(E=Object.keys(n),m=E.length,m!==Object.keys(h).length)return!1;for(C=m;C--!==0;)if(!{}.hasOwnProperty.call(h,E[C]))return!1;for(C=m;C--!==0;){const R=E[C];if(!(R==="_owner"&&n.$$typeof)&&!ot(n[R],h[R]))return!1}return!0}return n!==n&&h!==h}function Ur(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function dr(n,h){const m=Ur(n);return Math.round(h*m)/m}function yt(n){const h=j.useRef(n);return tt(()=>{h.current=n}),h}function Vn(n){n===void 0&&(n={});const{placement:h="bottom",strategy:m="absolute",middleware:C=[],platform:E,elements:{reference:R,floating:x}={},transform:i=!0,whileElementsMounted:o,open:c}=n,[d,a]=j.useState({x:0,y:0,strategy:m,placement:h,middlewareData:{},isPositioned:!1}),[f,_]=j.useState(C);ot(f,C)||_(C);const[S,u]=j.useState(null),[r,s]=j.useState(null),e=j.useCallback(N=>{N!==g.current&&(g.current=N,u(N))},[]),t=j.useCallback(N=>{N!==b.current&&(b.current=N,s(N))},[]),l=R||S,v=x||r,g=j.useRef(null),b=j.useRef(null),p=j.useRef(d),w=o!=null,L=yt(o),M=yt(E),B=yt(c),D=j.useCallback(()=>{if(!g.current||!b.current)return;const N={placement:h,strategy:m,middleware:f};M.current&&(N.platform=M.current),zn(g.current,b.current,N).then(y=>{const A={...y,isPositioned:B.current!==!1};H.current&&!ot(p.current,A)&&(p.current=A,gr.flushSync(()=>{a(A)}))})},[f,h,m,M,B]);tt(()=>{c===!1&&p.current.isPositioned&&(p.current.isPositioned=!1,a(N=>({...N,isPositioned:!1})))},[c]);const H=j.useRef(!1);tt(()=>(H.current=!0,()=>{H.current=!1}),[]),tt(()=>{if(l&&(g.current=l),v&&(b.current=v),l&&v){if(L.current)return L.current(l,v,D);D()}},[l,v,D,L,w]);const I=j.useMemo(()=>({reference:g,floating:b,setReference:e,setFloating:t}),[e,t]),$=j.useMemo(()=>({reference:l,floating:v}),[l,v]),z=j.useMemo(()=>{const N={position:m,left:0,top:0};if(!$.floating)return N;const y=dr($.floating,d.x),A=dr($.floating,d.y);return i?{...N,transform:"translate("+y+"px, "+A+"px)",...Ur($.floating)>=1.5&&{willChange:"transform"}}:{position:m,left:y,top:A}},[m,i,$.floating,d.x,d.y]);return j.useMemo(()=>({...d,update:D,refs:I,elements:$,floatingStyles:z}),[d,D,I,$,z])}const Gn=n=>{function h(m){return{}.hasOwnProperty.call(m,"current")}return{name:"arrow",options:n,fn(m){const{element:C,padding:E}=typeof n=="function"?n(m):n;return C&&h(C)?C.current!=null?ur({element:C.current,padding:E}).fn(m):{}:C?ur({element:C,padding:E}).fn(m):{}}}},Xn=(n,h)=>({...Fn(n),options:[n,h]}),Jn=(n,h)=>({...Nn(n),options:[n,h]}),Yn=(n,h)=>({...Un(n),options:[n,h]}),Zn=(n,h)=>({...Wn(n),options:[n,h]}),Qn=(n,h)=>({...jn(n),options:[n,h]}),eo=(n,h)=>({...$n(n),options:[n,h]}),to=(n,h)=>({...Gn(n),options:[n,h]});var ro="Arrow",zr=j.forwardRef((n,h)=>{const{children:m,width:C=10,height:E=5,...R}=n;return q.jsx(xe.svg,{...R,ref:h,width:C,height:E,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?m:q.jsx("polygon",{points:"0,0 30,0 15,10"})})});zr.displayName=ro;var io=zr;function so(n){const[h,m]=j.useState(void 0);return we(()=>{if(n){m({width:n.offsetWidth,height:n.offsetHeight});const C=new ResizeObserver(E=>{if(!Array.isArray(E)||!E.length)return;const R=E[0];let x,i;if("borderBoxSize"in R){const o=R.borderBoxSize,c=Array.isArray(o)?o[0]:o;x=c.inlineSize,i=c.blockSize}else x=n.offsetWidth,i=n.offsetHeight;m({width:x,height:i})});return C.observe(n,{box:"border-box"}),()=>C.unobserve(n)}else m(void 0)},[n]),h}var jt="Popper",[qr,Kr]=Lr(jt),[no,Vr]=qr(jt),Gr=n=>{const{__scopePopper:h,children:m}=n,[C,E]=j.useState(null);return q.jsx(no,{scope:h,anchor:C,onAnchorChange:E,children:m})};Gr.displayName=jt;var Xr="PopperAnchor",Jr=j.forwardRef((n,h)=>{const{__scopePopper:m,virtualRef:C,...E}=n,R=Vr(Xr,m),x=j.useRef(null),i=Le(h,x),o=j.useRef(null);return j.useEffect(()=>{const c=o.current;o.current=(C==null?void 0:C.current)||x.current,c!==o.current&&R.onAnchorChange(o.current)}),C?null:q.jsx(xe.div,{...E,ref:i})});Jr.displayName=Xr;var $t="PopperContent",[oo,ao]=qr($t),Yr=j.forwardRef((n,h)=>{var T,k,W,F,K,G;const{__scopePopper:m,side:C="bottom",sideOffset:E=0,align:R="center",alignOffset:x=0,arrowPadding:i=0,avoidCollisions:o=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:a="partial",hideWhenDetached:f=!1,updatePositionStrategy:_="optimized",onPlaced:S,...u}=n,r=Vr($t,m),[s,e]=j.useState(null),t=Le(h,Q=>e(Q)),[l,v]=j.useState(null),g=so(l),b=(g==null?void 0:g.width)??0,p=(g==null?void 0:g.height)??0,w=C+(R!=="center"?"-"+R:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},M=Array.isArray(c)?c:[c],B=M.length>0,D={padding:L,boundary:M.filter(lo),altBoundary:B},{refs:H,floatingStyles:I,placement:$,isPositioned:z,middlewareData:N}=Vn({strategy:"fixed",placement:w,whileElementsMounted:(...Q)=>Hn(...Q,{animationFrame:_==="always"}),elements:{reference:r.anchor},middleware:[Xn({mainAxis:E+p,alignmentAxis:x}),o&&Jn({mainAxis:!0,crossAxis:!1,limiter:a==="partial"?Yn():void 0,...D}),o&&Zn({...D}),Qn({...D,apply:({elements:Q,rects:ee,availableWidth:te,availableHeight:ie})=>{const{width:Z,height:ke}=ee.reference,me=Q.floating.style;me.setProperty("--radix-popper-available-width",`${te}px`),me.setProperty("--radix-popper-available-height",`${ie}px`),me.setProperty("--radix-popper-anchor-width",`${Z}px`),me.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),l&&to({element:l,padding:i}),ho({arrowWidth:b,arrowHeight:p}),f&&eo({strategy:"referenceHidden",...D})]}),[y,A]=ei($),O=ct(S);we(()=>{z&&(O==null||O())},[z,O]);const P=(T=N.arrow)==null?void 0:T.x,U=(k=N.arrow)==null?void 0:k.y,V=((W=N.arrow)==null?void 0:W.centerOffset)!==0,[J,Y]=j.useState();return we(()=>{s&&Y(window.getComputedStyle(s).zIndex)},[s]),q.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:z?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(F=N.transformOrigin)==null?void 0:F.x,(K=N.transformOrigin)==null?void 0:K.y].join(" "),...((G=N.hide)==null?void 0:G.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:q.jsx(oo,{scope:m,placedSide:y,onArrowChange:v,arrowX:P,arrowY:U,shouldHideArrow:V,children:q.jsx(xe.div,{"data-side":y,"data-align":A,...u,ref:t,style:{...u.style,animation:z?void 0:"none"}})})})});Yr.displayName=$t;var Zr="PopperArrow",co={top:"bottom",right:"left",bottom:"top",left:"right"},Qr=j.forwardRef(function(h,m){const{__scopePopper:C,...E}=h,R=ao(Zr,C),x=co[R.placedSide];return q.jsx("span",{ref:R.onArrowChange,style:{position:"absolute",left:R.arrowX,top:R.arrowY,[x]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[R.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[R.placedSide],visibility:R.shouldHideArrow?"hidden":void 0},children:q.jsx(io,{...E,ref:m,style:{...E.style,display:"block"}})})});Qr.displayName=Zr;function lo(n){return n!==null}var ho=n=>({name:"transformOrigin",options:n,fn(h){var r,s,e;const{placement:m,rects:C,middlewareData:E}=h,x=((r=E.arrow)==null?void 0:r.centerOffset)!==0,i=x?0:n.arrowWidth,o=x?0:n.arrowHeight,[c,d]=ei(m),a={start:"0%",center:"50%",end:"100%"}[d],f=(((s=E.arrow)==null?void 0:s.x)??0)+i/2,_=(((e=E.arrow)==null?void 0:e.y)??0)+o/2;let S="",u="";return c==="bottom"?(S=x?a:`${f}px`,u=`${-o}px`):c==="top"?(S=x?a:`${f}px`,u=`${C.floating.height+o}px`):c==="right"?(S=`${-o}px`,u=x?a:`${_}px`):c==="left"&&(S=`${C.floating.width+o}px`,u=x?a:`${_}px`),{data:{x:S,y:u}}}});function ei(n){const[h,m="center"]=n.split("-");return[h,m]}var uo=Gr,fo=Jr,_o=Yr,po=Qr,vo="Portal",ti=j.forwardRef((n,h)=>{var i;const{container:m,...C}=n,[E,R]=j.useState(!1);we(()=>R(!0),[]);const x=m||E&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return x?pr.createPortal(q.jsx(xe.div,{...C,ref:h}),x):null});ti.displayName=vo;function go(n,h){return j.useReducer((m,C)=>h[m][C]??m,n)}var Ut=n=>{const{present:h,children:m}=n,C=mo(h),E=typeof m=="function"?m({present:C.isPresent}):j.Children.only(m),R=Le(C.ref,So(E));return typeof m=="function"||C.isPresent?j.cloneElement(E,{ref:R}):null};Ut.displayName="Presence";function mo(n){const[h,m]=j.useState(),C=j.useRef(null),E=j.useRef(n),R=j.useRef("none"),x=n?"mounted":"unmounted",[i,o]=go(x,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const c=Qe(C.current);R.current=i==="mounted"?c:"none"},[i]),we(()=>{const c=C.current,d=E.current;if(d!==n){const f=R.current,_=Qe(c);n?o("MOUNT"):_==="none"||(c==null?void 0:c.display)==="none"?o("UNMOUNT"):o(d&&f!==_?"ANIMATION_OUT":"UNMOUNT"),E.current=n}},[n,o]),we(()=>{if(h){let c;const d=h.ownerDocument.defaultView??window,a=_=>{const u=Qe(C.current).includes(CSS.escape(_.animationName));if(_.target===h&&u&&(o("ANIMATION_END"),!E.current)){const r=h.style.animationFillMode;h.style.animationFillMode="forwards",c=d.setTimeout(()=>{h.style.animationFillMode==="forwards"&&(h.style.animationFillMode=r)})}},f=_=>{_.target===h&&(R.current=Qe(C.current))};return h.addEventListener("animationstart",f),h.addEventListener("animationcancel",a),h.addEventListener("animationend",a),()=>{d.clearTimeout(c),h.removeEventListener("animationstart",f),h.removeEventListener("animationcancel",a),h.removeEventListener("animationend",a)}}else o("ANIMATION_END")},[h,o]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:j.useCallback(c=>{C.current=c?getComputedStyle(c):null,m(c)},[])}}function Qe(n){return(n==null?void 0:n.animationName)||"none"}function So(n){var C,E;let h=(C=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:C.get,m=h&&"isReactWarning"in h&&h.isReactWarning;return m?n.ref:(h=(E=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:E.get,m=h&&"isReactWarning"in h&&h.isReactWarning,m?n.props.ref:n.props.ref||n.ref)}var bo=j[" useInsertionEffect ".trim().toString()]||we;function Co({prop:n,defaultProp:h,onChange:m=()=>{},caller:C}){const[E,R,x]=wo({defaultProp:h,onChange:m}),i=n!==void 0,o=i?n:E;{const d=j.useRef(n!==void 0);j.useEffect(()=>{const a=d.current;a!==i&&console.warn(`${C} is changing from ${a?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,C])}const c=j.useCallback(d=>{var a;if(i){const f=yo(d)?d(n):d;f!==n&&((a=x.current)==null||a.call(x,f))}else R(d)},[i,n,R,x]);return[o,c]}function wo({defaultProp:n,onChange:h}){const[m,C]=j.useState(n),E=j.useRef(m),R=j.useRef(h);return bo(()=>{R.current=h},[h]),j.useEffect(()=>{var x;E.current!==m&&((x=R.current)==null||x.call(R,m),E.current=m)},[m,E]),[m,C,R]}function yo(n){return typeof n=="function"}var Eo=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),xo="VisuallyHidden",ri=j.forwardRef((n,h)=>q.jsx(xe.span,{...n,ref:h,style:{...Eo,...n.style}}));ri.displayName=xo;var ko=ri,[ft]=Lr("Tooltip",[Kr]),_t=Kr(),ii="TooltipProvider",Ro=700,Mt="tooltip.open",[Lo,zt]=ft(ii),si=n=>{const{__scopeTooltip:h,delayDuration:m=Ro,skipDelayDuration:C=300,disableHoverableContent:E=!1,children:R}=n,x=j.useRef(!0),i=j.useRef(!1),o=j.useRef(0);return j.useEffect(()=>{const c=o.current;return()=>window.clearTimeout(c)},[]),q.jsx(Lo,{scope:h,isOpenDelayedRef:x,delayDuration:m,onOpen:j.useCallback(()=>{window.clearTimeout(o.current),x.current=!1},[]),onClose:j.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>x.current=!0,C)},[C]),isPointerInTransitRef:i,onPointerInTransitChange:j.useCallback(c=>{i.current=c},[]),disableHoverableContent:E,children:R})};si.displayName=ii;var ze="Tooltip",[Do,Ve]=ft(ze),ni=n=>{const{__scopeTooltip:h,children:m,open:C,defaultOpen:E,onOpenChange:R,disableHoverableContent:x,delayDuration:i}=n,o=zt(ze,n.__scopeTooltip),c=_t(h),[d,a]=j.useState(null),f=zs(),_=j.useRef(0),S=x??o.disableHoverableContent,u=i??o.delayDuration,r=j.useRef(!1),[s,e]=Co({prop:C,defaultProp:E??!1,onChange:b=>{b?(o.onOpen(),document.dispatchEvent(new CustomEvent(Mt))):o.onClose(),R==null||R(b)},caller:ze}),t=j.useMemo(()=>s?r.current?"delayed-open":"instant-open":"closed",[s]),l=j.useCallback(()=>{window.clearTimeout(_.current),_.current=0,r.current=!1,e(!0)},[e]),v=j.useCallback(()=>{window.clearTimeout(_.current),_.current=0,e(!1)},[e]),g=j.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{r.current=!0,e(!0),_.current=0},u)},[u,e]);return j.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]),q.jsx(uo,{...c,children:q.jsx(Do,{scope:h,contentId:f,open:s,stateAttribute:t,trigger:d,onTriggerChange:a,onTriggerEnter:j.useCallback(()=>{o.isOpenDelayedRef.current?g():l()},[o.isOpenDelayedRef,g,l]),onTriggerLeave:j.useCallback(()=>{S?v():(window.clearTimeout(_.current),_.current=0)},[v,S]),onOpen:l,onClose:v,disableHoverableContent:S,children:m})})};ni.displayName=ze;var Pt="TooltipTrigger",oi=j.forwardRef((n,h)=>{const{__scopeTooltip:m,...C}=n,E=Ve(Pt,m),R=zt(Pt,m),x=_t(m),i=j.useRef(null),o=Le(h,i,E.onTriggerChange),c=j.useRef(!1),d=j.useRef(!1),a=j.useCallback(()=>c.current=!1,[]);return j.useEffect(()=>()=>document.removeEventListener("pointerup",a),[a]),q.jsx(fo,{asChild:!0,...x,children:q.jsx(xe.button,{"aria-describedby":E.open?E.contentId:void 0,"data-state":E.stateAttribute,...C,ref:o,onPointerMove:pe(n.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!R.isPointerInTransitRef.current&&(E.onTriggerEnter(),d.current=!0)}),onPointerLeave:pe(n.onPointerLeave,()=>{E.onTriggerLeave(),d.current=!1}),onPointerDown:pe(n.onPointerDown,()=>{E.open&&E.onClose(),c.current=!0,document.addEventListener("pointerup",a,{once:!0})}),onFocus:pe(n.onFocus,()=>{c.current||E.onOpen()}),onBlur:pe(n.onBlur,E.onClose),onClick:pe(n.onClick,E.onClose)})})});oi.displayName=Pt;var qt="TooltipPortal",[Ao,Oo]=ft(qt,{forceMount:void 0}),ai=n=>{const{__scopeTooltip:h,forceMount:m,children:C,container:E}=n,R=Ve(qt,h);return q.jsx(Ao,{scope:h,forceMount:m,children:q.jsx(Ut,{present:m||R.open,children:q.jsx(ti,{asChild:!0,container:E,children:C})})})};ai.displayName=qt;var Te="TooltipContent",ci=j.forwardRef((n,h)=>{const m=Oo(Te,n.__scopeTooltip),{forceMount:C=m.forceMount,side:E="top",...R}=n,x=Ve(Te,n.__scopeTooltip);return q.jsx(Ut,{present:C||x.open,children:x.disableHoverableContent?q.jsx(li,{side:E,...R,ref:h}):q.jsx(To,{side:E,...R,ref:h})})}),To=j.forwardRef((n,h)=>{const m=Ve(Te,n.__scopeTooltip),C=zt(Te,n.__scopeTooltip),E=j.useRef(null),R=Le(h,E),[x,i]=j.useState(null),{trigger:o,onClose:c}=m,d=E.current,{onPointerInTransitChange:a}=C,f=j.useCallback(()=>{i(null),a(!1)},[a]),_=j.useCallback((S,u)=>{const r=S.currentTarget,s={x:S.clientX,y:S.clientY},e=Io(s,r.getBoundingClientRect()),t=Ho(s,e),l=Fo(u.getBoundingClientRect()),v=Wo([...t,...l]);i(v),a(!0)},[a]);return j.useEffect(()=>()=>f(),[f]),j.useEffect(()=>{if(o&&d){const S=r=>_(r,d),u=r=>_(r,o);return o.addEventListener("pointerleave",S),d.addEventListener("pointerleave",u),()=>{o.removeEventListener("pointerleave",S),d.removeEventListener("pointerleave",u)}}},[o,d,_,f]),j.useEffect(()=>{if(x){const S=u=>{const r=u.target,s={x:u.clientX,y:u.clientY},e=(o==null?void 0:o.contains(r))||(d==null?void 0:d.contains(r)),t=!No(s,x);e?f():t&&(f(),c())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[o,d,x,c,f]),q.jsx(li,{...n,ref:R})}),[Mo,Po]=ft(ze,{isInside:!1}),Bo=Ls("TooltipContent"),li=j.forwardRef((n,h)=>{const{__scopeTooltip:m,children:C,"aria-label":E,onEscapeKeyDown:R,onPointerDownOutside:x,...i}=n,o=Ve(Te,m),c=_t(m),{onClose:d}=o;return j.useEffect(()=>(document.addEventListener(Mt,d),()=>document.removeEventListener(Mt,d)),[d]),j.useEffect(()=>{if(o.trigger){const a=f=>{const _=f.target;_!=null&&_.contains(o.trigger)&&d()};return window.addEventListener("scroll",a,{capture:!0}),()=>window.removeEventListener("scroll",a,{capture:!0})}},[o.trigger,d]),q.jsx(Or,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:R,onPointerDownOutside:x,onFocusOutside:a=>a.preventDefault(),onDismiss:d,children:q.jsxs(_o,{"data-state":o.stateAttribute,...c,...i,ref:h,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[q.jsx(Bo,{children:C}),q.jsx(Mo,{scope:m,isInside:!0,children:q.jsx(ko,{id:o.contentId,role:"tooltip",children:E||C})})]})})});ci.displayName=Te;var hi="TooltipArrow",ui=j.forwardRef((n,h)=>{const{__scopeTooltip:m,...C}=n,E=_t(m);return Po(hi,m).isInside?null:q.jsx(po,{...E,...C,ref:h})});ui.displayName=hi;function Io(n,h){const m=Math.abs(h.top-n.y),C=Math.abs(h.bottom-n.y),E=Math.abs(h.right-n.x),R=Math.abs(h.left-n.x);switch(Math.min(m,C,E,R)){case R:return"left";case E:return"right";case m:return"top";case C:return"bottom";default:throw new Error("unreachable")}}function Ho(n,h,m=5){const C=[];switch(h){case"top":C.push({x:n.x-m,y:n.y+m},{x:n.x+m,y:n.y+m});break;case"bottom":C.push({x:n.x-m,y:n.y-m},{x:n.x+m,y:n.y-m});break;case"left":C.push({x:n.x+m,y:n.y-m},{x:n.x+m,y:n.y+m});break;case"right":C.push({x:n.x-m,y:n.y-m},{x:n.x-m,y:n.y+m});break}return C}function Fo(n){const{top:h,right:m,bottom:C,left:E}=n;return[{x:E,y:h},{x:m,y:h},{x:m,y:C},{x:E,y:C}]}function No(n,h){const{x:m,y:C}=n;let E=!1;for(let R=0,x=h.length-1;R<h.length;x=R++){const i=h[R],o=h[x],c=i.x,d=i.y,a=o.x,f=o.y;d>C!=f>C&&m<(a-c)*(C-d)/(f-d)+c&&(E=!E)}return E}function Wo(n){const h=n.slice();return h.sort((m,C)=>m.x<C.x?-1:m.x>C.x?1:m.y<C.y?-1:m.y>C.y?1:0),jo(h)}function jo(n){if(n.length<=1)return n.slice();const h=[];for(let C=0;C<n.length;C++){const E=n[C];for(;h.length>=2;){const R=h[h.length-1],x=h[h.length-2];if((R.x-x.x)*(E.y-x.y)>=(R.y-x.y)*(E.x-x.x))h.pop();else break}h.push(E)}h.pop();const m=[];for(let C=n.length-1;C>=0;C--){const E=n[C];for(;m.length>=2;){const R=m[m.length-1],x=m[m.length-2];if((R.x-x.x)*(E.y-x.y)>=(R.y-x.y)*(E.x-x.x))m.pop();else break}m.push(E)}return m.pop(),h.length===1&&m.length===1&&h[0].x===m[0].x&&h[0].y===m[0].y?h:h.concat(m)}var $o=si,Et=ni,xt=oi,kt=ai,Rt=ci,Lt=ui;/**
|
|
20
|
+
* @license lucide-react v0.469.0 - ISC
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the ISC license.
|
|
23
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
+
*/const Uo=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),di=(...n)=>n.filter((h,m,C)=>!!h&&h.trim()!==""&&C.indexOf(h)===m).join(" ").trim();/**
|
|
25
|
+
* @license lucide-react v0.469.0 - ISC
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the ISC license.
|
|
28
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
29
|
+
*/var zo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
30
|
+
* @license lucide-react v0.469.0 - ISC
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the ISC license.
|
|
33
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/const qo=X.forwardRef(({color:n="currentColor",size:h=24,strokeWidth:m=2,absoluteStrokeWidth:C,className:E="",children:R,iconNode:x,...i},o)=>X.createElement("svg",{ref:o,...zo,width:h,height:h,stroke:n,strokeWidth:C?Number(m)*24/Number(h):m,className:di("lucide",E),...i},[...x.map(([c,d])=>X.createElement(c,d)),...Array.isArray(R)?R:[R]]));/**
|
|
35
|
+
* @license lucide-react v0.469.0 - ISC
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the ISC license.
|
|
38
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/const Be=(n,h)=>{const m=X.forwardRef(({className:C,...E},R)=>X.createElement(qo,{ref:R,iconNode:h,className:di(`lucide-${Uo(n)}`,C),...E}));return m.displayName=`${n}`,m};/**
|
|
40
|
+
* @license lucide-react v0.469.0 - ISC
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the ISC license.
|
|
43
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/const fr=Be("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
45
|
+
* @license lucide-react v0.469.0 - ISC
|
|
46
|
+
*
|
|
47
|
+
* This source code is licensed under the ISC license.
|
|
48
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
+
*/const Ko=Be("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
50
|
+
* @license lucide-react v0.469.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const _r=Be("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
55
|
+
* @license lucide-react v0.469.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/const Vo=Be("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
60
|
+
* @license lucide-react v0.469.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/const Go=Be("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
65
|
+
* @license lucide-react v0.469.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const Xo=Be("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),et={java:`void main() {
|
|
70
|
+
System.out.println("Hello from NotJS!");
|
|
71
|
+
System.out.println("Enter your name:");
|
|
72
|
+
|
|
73
|
+
var scanner = new java.util.Scanner(System.in);
|
|
74
|
+
var name = scanner.nextLine();
|
|
75
|
+
|
|
76
|
+
System.out.println("Hello, " + name + "!");
|
|
77
|
+
}
|
|
78
|
+
`,cpp:`#include <iostream>
|
|
79
|
+
#include <string>
|
|
80
|
+
|
|
81
|
+
int main() {
|
|
82
|
+
std::cout << "Hello from NotJS C++!" << std::endl;
|
|
83
|
+
std::cout << "Enter your name: ";
|
|
84
|
+
|
|
85
|
+
std::string name;
|
|
86
|
+
std::getline(std::cin, name);
|
|
87
|
+
|
|
88
|
+
std::cout << "Hello, " << name << "!" << std::endl;
|
|
89
|
+
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
`};function Jo({websocketUrl:n="ws://localhost:8080/terminal",apiBaseUrl:h="http://localhost:8080/api",initialCode:m,initialLanguage:C="java",initialVersion:E="25",initialDarkMode:R=!0,hideHeader:x=!1}){const[i,o]=X.useState(m||et[C]||et.java),[c,d]=X.useState([]),[a,f]=X.useState(C),[_,S]=X.useState([]),[u,r]=X.useState(E),[s,e]=X.useState(null),[t,l]=X.useState(R),[v,g]=X.useState(!1),[b,p]=X.useState(!1),[w,L]=X.useState(50),[M,B]=X.useState(!1),[D,H]=X.useState(null),[I,$]=X.useState(""),z=X.useRef(null),N=X.useRef(null),y=X.useRef(null),A=X.useRef(""),O=X.useRef(null);X.useEffect(()=>{(async()=>{try{const k=await fetch(`${h}/language/info/${C}`);if(!k.ok)throw new Error("Language not supported");const W=await k.json();W.availableVersions.includes(E)?H(!0):(H(!1),$(`${C.toUpperCase()} version ${E} is not available. Available versions: ${W.availableVersions.join(", ")}`))}catch{H(!1),$(`Failed to connect to NotJS API at ${h}. Please ensure the Spring Boot backend is running.`)}})()},[h,C,E]),X.useEffect(()=>{fetch(`${h}/language/supported`).then(T=>T.json()).then(T=>{d(T)}).catch(T=>{console.error("Failed to fetch languages:",T)})},[h]),X.useEffect(()=>{a&&fetch(`${h}/language/info/${a}`).then(T=>T.json()).then(T=>{S(T.availableVersions),e(T.defaultVersion),r(null)}).catch(T=>{console.error("Failed to fetch language info:",T)})},[a,h]),X.useEffect(()=>{et[a]&&o(et[a])},[a]),X.useEffect(()=>{if(!z.current||D!==!0)return;const T=new Es.Terminal({cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:t?{background:"#0a0a0a",foreground:"#d4d4d4",cursor:"#ffffff"}:{background:"#ffffff",foreground:"#000000",cursor:"#000000"},scrollback:1e3,convertEol:!0});N.current=T,T.open(z.current);const k=()=>{if(z.current&&N.current){const F=z.current.getBoundingClientRect(),K=Math.floor((F.width-20)/9),G=Math.floor((F.height-20)/17);N.current.resize(K,G)}};setTimeout(k,100),window.addEventListener("resize",k);const W=new WebSocket(n);return y.current=W,W.onopen=()=>{console.log("WebSocket connected"),T.write(`\x1B[1;32m> Connected\x1B[0m\r
|
|
93
|
+
`);const F={language:a,code:i,version:u||s||null,arguments:[]};W.send(JSON.stringify(F)),T.write(`\x1B[1;36m> Running ${a} ${u||s||""}...\x1B[0m\r
|
|
94
|
+
`)},W.onmessage=F=>{const K=F.data.replace(/\n/g,`\r
|
|
95
|
+
`);T.write(K)},W.onerror=F=>{console.error("WebSocket error:",F),T.write(`\x1B[1;31m\r
|
|
96
|
+
[ERROR] WebSocket connection error\x1B[0m\r
|
|
97
|
+
`)},W.onclose=()=>{console.log("WebSocket closed"),T.write(`\x1B[1;33m\r
|
|
98
|
+
[DISCONNECTED]\x1B[0m\r
|
|
99
|
+
`)},T.onData(F=>{W.readyState===WebSocket.OPEN&&(F===""||F==="\b"?A.current.length>0&&(A.current=A.current.slice(0,-1),T.write("\b \b")):F==="\r"?(T.write(`\r
|
|
100
|
+
`),W.send(A.current+`
|
|
101
|
+
`),A.current=""):F===""?(T.write(`^C\r
|
|
102
|
+
`),A.current=""):(A.current+=F,T.write(F)))}),()=>{window.removeEventListener("resize",k),T.dispose(),W.readyState===WebSocket.OPEN&&W.close()}},[D,n,a,i,u,s,t]),X.useEffect(()=>{N.current&&(N.current.options.theme=t?{background:"#0a0a0a",foreground:"#d4d4d4",cursor:"#ffffff"}:{background:"#ffffff",foreground:"#000000",cursor:"#000000"})},[t]);const P=()=>{var k;if(!N.current||!z.current)return;if(y.current){const W=y.current;W.onopen=null,W.onmessage=null,W.onerror=null,W.onclose=null,W.close()}N.current.reset(),N.current.clear(),A.current="";const T=new WebSocket(n);y.current=T,T.onopen=()=>{var F,K;console.log("WebSocket reconnected"),(F=N.current)==null||F.write(`\x1B[1;32m> Connected\x1B[0m\r
|
|
103
|
+
`);const W={language:a,code:i,version:u||s||null,arguments:[]};T.send(JSON.stringify(W)),(K=N.current)==null||K.write(`\x1B[1;36m> Running ${a} ${u||s||""}...\x1B[0m\r
|
|
104
|
+
`)},T.onmessage=W=>{var K;const F=W.data.replace(/\n/g,`\r
|
|
105
|
+
`);(K=N.current)==null||K.write(F)},T.onerror=W=>{var F;console.error("WebSocket error:",W),(F=N.current)==null||F.write(`\x1B[1;31m\r
|
|
106
|
+
[ERROR] WebSocket connection error\x1B[0m\r
|
|
107
|
+
`)},T.onclose=()=>{var W;console.log("WebSocket closed"),(W=N.current)==null||W.write(`\x1B[1;33m\r
|
|
108
|
+
[DISCONNECTED]\x1B[0m\r
|
|
109
|
+
`)},(k=N.current)==null||k.onData(W=>{var F,K,G,Q;T.readyState===WebSocket.OPEN&&(W===""||W==="\b"?A.current.length>0&&(A.current=A.current.slice(0,-1),(F=N.current)==null||F.write("\b \b")):W==="\r"?((K=N.current)==null||K.write(`\r
|
|
110
|
+
`),T.send(A.current+`
|
|
111
|
+
`),A.current=""):W===""?((G=N.current)==null||G.write(`^C\r
|
|
112
|
+
`),A.current=""):(A.current+=W,(Q=N.current)==null||Q.write(W)))})},U=(T,k)=>{navigator.clipboard.writeText(T).then(()=>{k==="code"?(g(!0),setTimeout(()=>g(!1),2e3)):(p(!0),setTimeout(()=>p(!1),2e3))})},V=()=>{if(N.current){const T=N.current.buffer.active;let k="";for(let W=0;W<T.length;W++){const F=T.getLine(W);F&&(k+=F.translateToString(!0)+`
|
|
113
|
+
`)}U(k,"console")}},J=()=>{l(T=>!T),t?document.documentElement.classList.remove("dark"):document.documentElement.classList.add("dark")};X.useEffect(()=>{t&&document.documentElement.classList.add("dark")},[]);const Y=T=>{T.preventDefault(),B(!0)};return X.useEffect(()=>{const T=W=>{if(!M||!O.current)return;const K=O.current.getBoundingClientRect(),G=(W.clientX-K.left)/K.width*100;G>=20&&G<=80&&L(G)},k=()=>{B(!1)};return M&&(document.addEventListener("mousemove",T),document.addEventListener("mouseup",k),document.body.style.cursor="col-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",k),document.body.style.cursor="",document.body.style.userSelect=""}},[M]),X.useEffect(()=>{N.current&&z.current&&setTimeout(()=>{if(z.current&&N.current){const T=z.current.getBoundingClientRect(),k=Math.floor((T.width-20)/9),W=Math.floor((T.height-20)/17);N.current.resize(k,W)}},10)},[w]),D===!1?q.jsx("div",{className:"flex flex-col items-center justify-center h-screen w-screen bg-neutral-50 dark:bg-neutral-950 p-8",children:q.jsx("div",{className:"max-w-2xl w-full border-2 border-red-500 rounded-2xl p-8 bg-white dark:bg-neutral-900",children:q.jsxs("div",{className:"flex items-start gap-4",children:[q.jsx(Ko,{className:"w-8 h-8 text-red-500 flex-shrink-0 mt-1"}),q.jsxs("div",{children:[q.jsx("h2",{className:"text-2xl font-bold text-red-600 dark:text-red-500 mb-3",children:"NotJS Configuration Error"}),q.jsx("p",{className:"text-red-700 dark:text-red-400 text-lg leading-relaxed",children:I})]})]})})}):D===null?q.jsx("div",{className:"flex flex-col items-center justify-center h-screen w-screen bg-neutral-50 dark:bg-neutral-950",children:q.jsx("div",{className:"text-neutral-600 dark:text-neutral-400 text-lg",children:"Loading NotJS..."})}):q.jsx($o,{delayDuration:200,children:q.jsxs("div",{className:"flex flex-col h-screen w-screen bg-neutral-50 dark:bg-neutral-950",children:[!x&&q.jsxs("div",{className:"flex items-center justify-between px-8 py-5 bg-white/80 dark:bg-neutral-900/80 backdrop-blur border-b border-black/5 dark:border-white/5",children:[q.jsxs("div",{className:"flex items-center gap-6",children:[q.jsxs("div",{className:"flex items-center gap-4",children:[q.jsx("h1",{className:"text-2xl font-semibold text-neutral-900 dark:text-white",children:"NotJS"}),q.jsx("img",{src:"/notjslogo.png",alt:"NotJS Logo",className:"h-14 object-contain rounded-xl"})]}),q.jsx("select",{value:a,onChange:T=>f(T.target.value),className:"px-4 py-2 rounded-xl bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500/40 transition",children:c.map(T=>q.jsx("option",{value:T,children:T.toUpperCase()},T))}),_.length>0&&q.jsx("select",{value:u||s||"",onChange:T=>r(T.target.value||null),className:"px-4 py-2 rounded-xl bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-white text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/40 transition",children:_.map(T=>q.jsxs("option",{value:T,children:["v",T," ",T===s?"(default)":""]},T))})]}),q.jsx("button",{onClick:J,className:"p-3 rounded-xl bg-neutral-100 dark:bg-neutral-800 hover:bg-neutral-200 dark:hover:bg-neutral-700 transition",children:t?q.jsx(Xo,{className:"w-5 h-5 text-yellow-500"}):q.jsx(Vo,{className:"w-5 h-5 text-neutral-700"})})]}),q.jsxs("div",{ref:O,className:"flex flex-1 overflow-hidden relative",children:[q.jsxs("div",{className:"flex flex-col bg-white dark:bg-neutral-900",style:{width:`${w}%`},children:[q.jsxs("div",{className:"flex items-center justify-between px-8 py-4 bg-neutral-100/70 dark:bg-neutral-900 border-b border-black/5 dark:border-white/5",children:[q.jsx("h2",{className:"text-md font-semibold tracking-wide text-neutral-600 dark:text-neutral-400",children:"CODE"}),q.jsxs("div",{className:"flex items-center gap-3",children:[q.jsxs(Et,{children:[q.jsx(xt,{asChild:!0,children:q.jsx("button",{onClick:P,className:"p-2.5 rounded-xl transition bg-orange-500/90 hover:bg-orange-500 text-white",children:q.jsx(Go,{className:"w-4 h-4"})})}),q.jsx(kt,{children:q.jsxs(Rt,{className:"rounded-lg bg-neutral-900 dark:bg-neutral-800 px-3 py-1.5 text-xs text-white shadow-lg",sideOffset:5,children:["Restart program",q.jsx(Lt,{className:"fill-neutral-900 dark:fill-neutral-800"})]})})]}),q.jsxs(Et,{children:[q.jsx(xt,{asChild:!0,children:q.jsx("button",{onClick:()=>U(i,"code"),className:"p-2.5 rounded-xl bg-neutral-200 dark:bg-neutral-800 hover:bg-neutral-300 dark:hover:bg-neutral-700 transition",children:v?q.jsx(fr,{className:"w-4 h-4 text-emerald-600"}):q.jsx(_r,{className:"w-4 h-4 text-neutral-700 dark:text-neutral-300"})})}),q.jsx(kt,{children:q.jsxs(Rt,{className:"rounded-lg bg-neutral-900 dark:bg-neutral-800 px-3 py-1.5 text-xs text-white shadow-lg",sideOffset:5,children:["Copy code",q.jsx(Lt,{className:"fill-neutral-900 dark:fill-neutral-800"})]})})]})]})]}),q.jsx("div",{className:"flex-1 overflow-hidden rounded-b-2xl",children:q.jsx(ws,{height:"100%",language:a,value:i,onChange:T=>o(T||""),theme:t?"vs-dark":"light",options:{minimap:{enabled:!1},fontSize:14,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:12,bottom:12}}})})]}),q.jsx("div",{className:`w-1 bg-black/5 dark:bg-white/5 hover:bg-blue-500 cursor-col-resize transition ${M?"bg-blue-500":""}`,onMouseDown:Y}),q.jsxs("div",{className:"flex-1 flex flex-col bg-white dark:bg-neutral-950",children:[q.jsxs("div",{className:"flex items-center justify-between px-8 py-4 bg-neutral-100/70 dark:bg-neutral-900 border-b border-black/5 dark:border-white/5",children:[q.jsx("h2",{className:"text-md font-semibold tracking-wide text-neutral-600 dark:text-neutral-400",children:"CONSOLE"}),q.jsxs(Et,{children:[q.jsx(xt,{asChild:!0,children:q.jsx("button",{onClick:V,className:"p-2.5 rounded-xl bg-neutral-200 dark:bg-neutral-800 hover:bg-neutral-300 dark:hover:bg-neutral-700 transition",children:b?q.jsx(fr,{className:"w-4 h-4 text-emerald-600"}):q.jsx(_r,{className:"w-4 h-4 text-neutral-700 dark:text-neutral-300"})})}),q.jsx(kt,{children:q.jsxs(Rt,{className:"rounded-lg bg-neutral-900 dark:bg-neutral-800 px-3 py-1.5 text-xs text-white shadow-lg",sideOffset:5,children:["Copy output",q.jsx(Lt,{className:"fill-neutral-900 dark:fill-neutral-800"})]})})]})]}),q.jsx("div",{ref:z,className:"flex-1 overflow-hidden rounded-b-2xl bg-white dark:bg-neutral-950 p-3"})]})]})]})})}exports.NotJS=Jo;
|
|
114
|
+
//# sourceMappingURL=index.cjs.map
|