/* * AT Terminal — compiled dsh Client half. DO NOT EDIT. * * Generated by `node dsh/esbuild.dsh.mjs` from src/platform/dsh/client/**, bundling * xterm + addons, the reused webview/terminal building blocks and the stylesheets * (injected as text, scoped to the panel). `npm run verify:dsh` fails if this file is * not the current build of those sources. */ window.__ModuleLoader__.load({ id: "@at-series/dsh-at-terminal", factory: (require) => { var module = { exports: {} }; var exports = module.exports; "use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJS = (cb, mod) => function() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: !0 }); }, __copyProps = (to, from, except, desc) => { if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, mod )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); // node_modules/@xterm/xterm/lib/xterm.js var require_xterm = __commonJS({ "node_modules/@xterm/xterm/lib/xterm.js"(exports, module2) { (function(e, t) { if (typeof exports == "object" && typeof module2 == "object") module2.exports = t(); else if (typeof define == "function" && define.amd) define([], t); else { var i = t(); for (var s in i) (typeof exports == "object" ? exports : e)[s] = i[s]; } })(globalThis, (() => (() => { "use strict"; var e = { 4567: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.AccessibilityManager = void 0; let n = i2(9042), o = i2(9924), a = i2(844), h2 = i2(4725), c = i2(2585), l = i2(3656), d = t2.AccessibilityManager = class extends a.Disposable { constructor(e3, t3, i3, s3) { super(), this._terminal = e3, this._coreBrowserService = i3, this._renderService = s3, this._rowColumns = /* @__PURE__ */ 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 e4 = 0; e4 < this._terminal.rows; e4++) this._rowElements[e4] = this._createAccessibilityTreeNode(), this._rowContainer.appendChild(this._rowElements[e4]); if (this._topBoundaryFocusListener = (e4) => this._handleBoundaryFocus(e4, 0), this._bottomBoundaryFocusListener = (e4) => this._handleBoundaryFocus(e4, 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 o.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(((e4) => this._handleResize(e4.rows)))), this.register(this._terminal.onRender(((e4) => this._refreshRows(e4.start, e4.end)))), this.register(this._terminal.onScroll((() => this._refreshRows()))), this.register(this._terminal.onA11yChar(((e4) => this._handleChar(e4)))), this.register(this._terminal.onLineFeed((() => this._handleChar(` `)))), this.register(this._terminal.onA11yTab(((e4) => this._handleTab(e4)))), this.register(this._terminal.onKey(((e4) => this._handleKey(e4.key)))), this.register(this._terminal.onBlur((() => this._clearLiveRegion()))), this.register(this._renderService.onDimensionsChange((() => this._refreshRowsDimensions()))), this.register((0, l.addDisposableDomListener)(document, "selectionchange", (() => this._handleSelectionChange()))), this.register(this._coreBrowserService.onDprChange((() => this._refreshRowsDimensions()))), this._refreshRows(), this.register((0, a.toDisposable)((() => { this._accessibilityContainer.remove(), this._rowElements.length = 0; }))); } _handleTab(e3) { for (let t3 = 0; t3 < e3; t3++) this._handleChar(" "); } _handleChar(e3) { this._liveRegionLineCount < 21 && (this._charsToConsume.length > 0 ? this._charsToConsume.shift() !== e3 && (this._charsToAnnounce += e3) : this._charsToAnnounce += e3, e3 === ` ` && (this._liveRegionLineCount++, this._liveRegionLineCount === 21 && (this._liveRegion.textContent += n.tooMuchOutput))); } _clearLiveRegion() { this._liveRegion.textContent = "", this._liveRegionLineCount = 0; } _handleKey(e3) { this._clearLiveRegion(), /\p{Control}/u.test(e3) || this._charsToConsume.push(e3); } _refreshRows(e3, t3) { this._liveRegionDebouncer.refresh(e3, t3, this._terminal.rows); } _renderRows(e3, t3) { let i3 = this._terminal.buffer, s3 = i3.lines.length.toString(); for (let r2 = e3; r2 <= t3; r2++) { let e4 = i3.lines.get(i3.ydisp + r2), t4 = [], n2 = e4?.translateToString(!0, void 0, void 0, t4) || "", o2 = (i3.ydisp + r2 + 1).toString(), a2 = this._rowElements[r2]; a2 && (n2.length === 0 ? (a2.innerText = "\xA0", this._rowColumns.set(a2, [0, 1])) : (a2.textContent = n2, this._rowColumns.set(a2, t4)), a2.setAttribute("aria-posinset", o2), a2.setAttribute("aria-setsize", s3)); } this._announceCharacters(); } _announceCharacters() { this._charsToAnnounce.length !== 0 && (this._liveRegion.textContent += this._charsToAnnounce, this._charsToAnnounce = ""); } _handleBoundaryFocus(e3, t3) { let i3 = e3.target, s3 = this._rowElements[t3 === 0 ? 1 : this._rowElements.length - 2]; if (i3.getAttribute("aria-posinset") === (t3 === 0 ? "1" : `${this._terminal.buffer.lines.length}`) || e3.relatedTarget !== s3) return; let r2, n2; if (t3 === 0 ? (r2 = i3, n2 = this._rowElements.pop(), this._rowContainer.removeChild(n2)) : (r2 = this._rowElements.shift(), n2 = i3, this._rowContainer.removeChild(r2)), r2.removeEventListener("focus", this._topBoundaryFocusListener), n2.removeEventListener("focus", this._bottomBoundaryFocusListener), t3 === 0) { let e4 = this._createAccessibilityTreeNode(); this._rowElements.unshift(e4), this._rowContainer.insertAdjacentElement("afterbegin", e4); } else { let e4 = this._createAccessibilityTreeNode(); this._rowElements.push(e4), this._rowContainer.appendChild(e4); } this._rowElements[0].addEventListener("focus", this._topBoundaryFocusListener), this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._terminal.scrollLines(t3 === 0 ? -1 : 1), this._rowElements[t3 === 0 ? 1 : this._rowElements.length - 2].focus(), e3.preventDefault(), e3.stopImmediatePropagation(); } _handleSelectionChange() { if (this._rowElements.length === 0) return; let e3 = document.getSelection(); if (!e3) return; if (e3.isCollapsed) return void (this._rowContainer.contains(e3.anchorNode) && this._terminal.clearSelection()); if (!e3.anchorNode || !e3.focusNode) return void console.error("anchorNode and/or focusNode are null"); let t3 = { node: e3.anchorNode, offset: e3.anchorOffset }, i3 = { node: e3.focusNode, offset: e3.focusOffset }; if ((t3.node.compareDocumentPosition(i3.node) & Node.DOCUMENT_POSITION_PRECEDING || t3.node === i3.node && t3.offset > i3.offset) && ([t3, i3] = [i3, t3]), t3.node.compareDocumentPosition(this._rowElements[0]) & (Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_FOLLOWING) && (t3 = { node: this._rowElements[0].childNodes[0], offset: 0 }), !this._rowContainer.contains(t3.node)) return; let s3 = this._rowElements.slice(-1)[0]; if (i3.node.compareDocumentPosition(s3) & (Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_PRECEDING) && (i3 = { node: s3, offset: s3.textContent?.length ?? 0 }), !this._rowContainer.contains(i3.node)) return; let r2 = ({ node: e4, offset: t4 }) => { let i4 = e4 instanceof Text ? e4.parentNode : e4, s4 = parseInt(i4?.getAttribute("aria-posinset"), 10) - 1; if (isNaN(s4)) return console.warn("row is invalid. Race condition?"), null; let r3 = this._rowColumns.get(i4); if (!r3) return console.warn("columns is null. Race condition?"), null; let n3 = t4 < r3.length ? r3[t4] : r3.slice(-1)[0] + 1; return n3 >= this._terminal.cols && (++s4, n3 = 0), { row: s4, column: n3 }; }, n2 = r2(t3), o2 = r2(i3); if (n2 && o2) { if (n2.row > o2.row || n2.row === o2.row && n2.column >= o2.column) throw new Error("invalid range"); this._terminal.select(n2.column, n2.row, (o2.row - n2.row) * this._terminal.cols - n2.column + o2.column); } } _handleResize(e3) { this._rowElements[this._rowElements.length - 1].removeEventListener("focus", this._bottomBoundaryFocusListener); for (let e4 = this._rowContainer.children.length; e4 < this._terminal.rows; e4++) this._rowElements[e4] = this._createAccessibilityTreeNode(), this._rowContainer.appendChild(this._rowElements[e4]); for (; this._rowElements.length > e3; ) this._rowContainer.removeChild(this._rowElements.pop()); this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._refreshRowsDimensions(); } _createAccessibilityTreeNode() { let e3 = this._coreBrowserService.mainDocument.createElement("div"); return e3.setAttribute("role", "listitem"), e3.tabIndex = -1, this._refreshRowDimensions(e3), e3; } _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 e3 = 0; e3 < this._terminal.rows; e3++) this._refreshRowDimensions(this._rowElements[e3]); } } _refreshRowDimensions(e3) { e3.style.height = `${this._renderService.dimensions.css.cell.height}px`; } }; t2.AccessibilityManager = d = s2([r(1, c.IInstantiationService), r(2, h2.ICoreBrowserService), r(3, h2.IRenderService)], d); }, 3614: (e2, t2) => { function i2(e3) { return e3.replace(/\r?\n/g, "\r"); } function s2(e3, t3) { return t3 ? "\x1B[200~" + e3 + "\x1B[201~" : e3; } function r(e3, t3, r2, n2) { e3 = s2(e3 = i2(e3), r2.decPrivateModes.bracketedPasteMode && n2.rawOptions.ignoreBracketedPasteMode !== !0), r2.triggerDataEvent(e3, !0), t3.value = ""; } function n(e3, t3, i3) { let s3 = i3.getBoundingClientRect(), r2 = e3.clientX - s3.left - 10, n2 = e3.clientY - s3.top - 10; t3.style.width = "20px", t3.style.height = "20px", t3.style.left = `${r2}px`, t3.style.top = `${n2}px`, t3.style.zIndex = "1000", t3.focus(); } Object.defineProperty(t2, "__esModule", { value: !0 }), t2.rightClickHandler = t2.moveTextAreaUnderMouseCursor = t2.paste = t2.handlePasteEvent = t2.copyHandler = t2.bracketTextForPaste = t2.prepareTextForTerminal = void 0, t2.prepareTextForTerminal = i2, t2.bracketTextForPaste = s2, t2.copyHandler = function(e3, t3) { e3.clipboardData && e3.clipboardData.setData("text/plain", t3.selectionText), e3.preventDefault(); }, t2.handlePasteEvent = function(e3, t3, i3, s3) { e3.stopPropagation(), e3.clipboardData && r(e3.clipboardData.getData("text/plain"), t3, i3, s3); }, t2.paste = r, t2.moveTextAreaUnderMouseCursor = n, t2.rightClickHandler = function(e3, t3, i3, s3, r2) { n(e3, t3, i3), r2 && s3.rightClickSelect(e3), t3.value = s3.selectionText, t3.select(); }; }, 7239: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.ColorContrastCache = void 0; let s2 = i2(1505); t2.ColorContrastCache = class { constructor() { this._color = new s2.TwoKeyMap(), this._css = new s2.TwoKeyMap(); } setCss(e3, t3, i3) { this._css.set(e3, t3, i3); } getCss(e3, t3) { return this._css.get(e3, t3); } setColor(e3, t3, i3) { this._color.set(e3, t3, i3); } getColor(e3, t3) { return this._color.get(e3, t3); } clear() { this._color.clear(), this._css.clear(); } }; }, 3656: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.addDisposableDomListener = void 0, t2.addDisposableDomListener = function(e3, t3, i2, s2) { e3.addEventListener(t3, i2, s2); let r = !1; return { dispose: () => { r || (r = !0, e3.removeEventListener(t3, i2, s2)); } }; }; }, 3551: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Linkifier = void 0; let n = i2(3656), o = i2(8460), a = i2(844), h2 = i2(2585), c = i2(4725), l = t2.Linkifier = class extends a.Disposable { get currentLink() { return this._currentLink; } constructor(e3, t3, i3, s3, r2) { super(), this._element = e3, this._mouseService = t3, this._renderService = i3, this._bufferService = s3, this._linkProviderService = r2, this._linkCacheDisposables = [], this._isMouseOut = !0, this._wasResized = !1, this._activeLine = -1, this._onShowLinkUnderline = this.register(new o.EventEmitter()), this.onShowLinkUnderline = this._onShowLinkUnderline.event, this._onHideLinkUnderline = this.register(new o.EventEmitter()), this.onHideLinkUnderline = this._onHideLinkUnderline.event, this.register((0, a.getDisposeArrayDisposable)(this._linkCacheDisposables)), this.register((0, a.toDisposable)((() => { this._lastMouseEvent = void 0, this._activeProviderReplies?.clear(); }))), this.register(this._bufferService.onResize((() => { this._clearCurrentLink(), this._wasResized = !0; }))), this.register((0, n.addDisposableDomListener)(this._element, "mouseleave", (() => { this._isMouseOut = !0, this._clearCurrentLink(); }))), this.register((0, n.addDisposableDomListener)(this._element, "mousemove", this._handleMouseMove.bind(this))), this.register((0, n.addDisposableDomListener)(this._element, "mousedown", this._handleMouseDown.bind(this))), this.register((0, n.addDisposableDomListener)(this._element, "mouseup", this._handleMouseUp.bind(this))); } _handleMouseMove(e3) { this._lastMouseEvent = e3; let t3 = this._positionFromMouseEvent(e3, this._element, this._mouseService); if (!t3) return; this._isMouseOut = !1; let i3 = e3.composedPath(); for (let e4 = 0; e4 < i3.length; e4++) { let t4 = i3[e4]; if (t4.classList.contains("xterm")) break; if (t4.classList.contains("xterm-hover")) return; } this._lastBufferCell && t3.x === this._lastBufferCell.x && t3.y === this._lastBufferCell.y || (this._handleHover(t3), this._lastBufferCell = t3); } _handleHover(e3) { if (this._activeLine !== e3.y || this._wasResized) return this._clearCurrentLink(), this._askForLink(e3, !1), void (this._wasResized = !1); this._currentLink && this._linkAtPosition(this._currentLink.link, e3) || (this._clearCurrentLink(), this._askForLink(e3, !0)); } _askForLink(e3, t3) { this._activeProviderReplies && t3 || (this._activeProviderReplies?.forEach(((e4) => { e4?.forEach(((e5) => { e5.link.dispose && e5.link.dispose(); })); })), this._activeProviderReplies = /* @__PURE__ */ new Map(), this._activeLine = e3.y); let i3 = !1; for (let [s3, r2] of this._linkProviderService.linkProviders.entries()) t3 ? this._activeProviderReplies?.get(s3) && (i3 = this._checkLinkProviderResult(s3, e3, i3)) : r2.provideLinks(e3.y, ((t4) => { if (this._isMouseOut) return; let r3 = t4?.map(((e4) => ({ link: e4 }))); this._activeProviderReplies?.set(s3, r3), i3 = this._checkLinkProviderResult(s3, e3, i3), this._activeProviderReplies?.size === this._linkProviderService.linkProviders.length && this._removeIntersectingLinks(e3.y, this._activeProviderReplies); })); } _removeIntersectingLinks(e3, t3) { let i3 = /* @__PURE__ */ new Set(); for (let s3 = 0; s3 < t3.size; s3++) { let r2 = t3.get(s3); if (r2) for (let t4 = 0; t4 < r2.length; t4++) { let s4 = r2[t4], n2 = s4.link.range.start.y < e3 ? 0 : s4.link.range.start.x, o2 = s4.link.range.end.y > e3 ? this._bufferService.cols : s4.link.range.end.x; for (let e4 = n2; e4 <= o2; e4++) { if (i3.has(e4)) { r2.splice(t4--, 1); break; } i3.add(e4); } } } } _checkLinkProviderResult(e3, t3, i3) { if (!this._activeProviderReplies) return i3; let s3 = this._activeProviderReplies.get(e3), r2 = !1; for (let t4 = 0; t4 < e3; t4++) this._activeProviderReplies.has(t4) && !this._activeProviderReplies.get(t4) || (r2 = !0); if (!r2 && s3) { let e4 = s3.find(((e5) => this._linkAtPosition(e5.link, t3))); e4 && (i3 = !0, this._handleNewLink(e4)); } if (this._activeProviderReplies.size === this._linkProviderService.linkProviders.length && !i3) for (let e4 = 0; e4 < this._activeProviderReplies.size; e4++) { let s4 = this._activeProviderReplies.get(e4)?.find(((e5) => this._linkAtPosition(e5.link, t3))); if (s4) { i3 = !0, this._handleNewLink(s4); break; } } return i3; } _handleMouseDown() { this._mouseDownLink = this._currentLink; } _handleMouseUp(e3) { if (!this._currentLink) return; let t3 = this._positionFromMouseEvent(e3, this._element, this._mouseService); t3 && this._mouseDownLink === this._currentLink && this._linkAtPosition(this._currentLink.link, t3) && this._currentLink.link.activate(e3, this._currentLink.link.text); } _clearCurrentLink(e3, t3) { this._currentLink && this._lastMouseEvent && (!e3 || !t3 || this._currentLink.link.range.start.y >= e3 && this._currentLink.link.range.end.y <= t3) && (this._linkLeave(this._element, this._currentLink.link, this._lastMouseEvent), this._currentLink = void 0, (0, a.disposeArray)(this._linkCacheDisposables)); } _handleNewLink(e3) { if (!this._lastMouseEvent) return; let t3 = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService); t3 && this._linkAtPosition(e3.link, t3) && (this._currentLink = e3, this._currentLink.state = { decorations: { underline: e3.link.decorations === void 0 || e3.link.decorations.underline, pointerCursor: e3.link.decorations === void 0 || e3.link.decorations.pointerCursor }, isHovered: !0 }, this._linkHover(this._element, e3.link, this._lastMouseEvent), e3.link.decorations = {}, Object.defineProperties(e3.link.decorations, { pointerCursor: { get: () => this._currentLink?.state?.decorations.pointerCursor, set: (e4) => { this._currentLink?.state && this._currentLink.state.decorations.pointerCursor !== e4 && (this._currentLink.state.decorations.pointerCursor = e4, this._currentLink.state.isHovered && this._element.classList.toggle("xterm-cursor-pointer", e4)); } }, underline: { get: () => this._currentLink?.state?.decorations.underline, set: (t4) => { this._currentLink?.state && this._currentLink?.state?.decorations.underline !== t4 && (this._currentLink.state.decorations.underline = t4, this._currentLink.state.isHovered && this._fireUnderlineEvent(e3.link, t4)); } } }), this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(((e4) => { if (!this._currentLink) return; let t4 = e4.start === 0 ? 0 : e4.start + 1 + this._bufferService.buffer.ydisp, i3 = this._bufferService.buffer.ydisp + 1 + e4.end; if (this._currentLink.link.range.start.y >= t4 && this._currentLink.link.range.end.y <= i3 && (this._clearCurrentLink(t4, i3), this._lastMouseEvent)) { let e5 = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService); e5 && this._askForLink(e5, !1); } })))); } _linkHover(e3, t3, i3) { this._currentLink?.state && (this._currentLink.state.isHovered = !0, this._currentLink.state.decorations.underline && this._fireUnderlineEvent(t3, !0), this._currentLink.state.decorations.pointerCursor && e3.classList.add("xterm-cursor-pointer")), t3.hover && t3.hover(i3, t3.text); } _fireUnderlineEvent(e3, t3) { let i3 = e3.range, s3 = this._bufferService.buffer.ydisp, r2 = this._createLinkUnderlineEvent(i3.start.x - 1, i3.start.y - s3 - 1, i3.end.x, i3.end.y - s3 - 1, void 0); (t3 ? this._onShowLinkUnderline : this._onHideLinkUnderline).fire(r2); } _linkLeave(e3, t3, i3) { this._currentLink?.state && (this._currentLink.state.isHovered = !1, this._currentLink.state.decorations.underline && this._fireUnderlineEvent(t3, !1), this._currentLink.state.decorations.pointerCursor && e3.classList.remove("xterm-cursor-pointer")), t3.leave && t3.leave(i3, t3.text); } _linkAtPosition(e3, t3) { let i3 = e3.range.start.y * this._bufferService.cols + e3.range.start.x, s3 = e3.range.end.y * this._bufferService.cols + e3.range.end.x, r2 = t3.y * this._bufferService.cols + t3.x; return i3 <= r2 && r2 <= s3; } _positionFromMouseEvent(e3, t3, i3) { let s3 = i3.getCoords(e3, t3, this._bufferService.cols, this._bufferService.rows); if (s3) return { x: s3[0], y: s3[1] + this._bufferService.buffer.ydisp }; } _createLinkUnderlineEvent(e3, t3, i3, s3, r2) { return { x1: e3, y1: t3, x2: i3, y2: s3, cols: this._bufferService.cols, fg: r2 }; } }; t2.Linkifier = l = s2([r(1, c.IMouseService), r(2, c.IRenderService), r(3, h2.IBufferService), r(4, c.ILinkProviderService)], l); }, 9042: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.tooMuchOutput = t2.promptLabel = void 0, t2.promptLabel = "Terminal input", t2.tooMuchOutput = "Too much output to announce, navigate to rows manually to read"; }, 3730: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.OscLinkProvider = void 0; let n = i2(511), o = i2(2585), a = t2.OscLinkProvider = class { constructor(e3, t3, i3) { this._bufferService = e3, this._optionsService = t3, this._oscLinkService = i3; } provideLinks(e3, t3) { let i3 = this._bufferService.buffer.lines.get(e3 - 1); if (!i3) return void t3(void 0); let s3 = [], r2 = this._optionsService.rawOptions.linkHandler, o2 = new n.CellData(), a2 = i3.getTrimmedLength(), c = -1, l = -1, d = !1; for (let t4 = 0; t4 < a2; t4++) if (l !== -1 || i3.hasContent(t4)) { if (i3.loadCell(t4, o2), o2.hasExtendedAttrs() && o2.extended.urlId) { if (l === -1) { l = t4, c = o2.extended.urlId; continue; } d = o2.extended.urlId !== c; } else l !== -1 && (d = !0); if (d || l !== -1 && t4 === a2 - 1) { let i4 = this._oscLinkService.getLinkData(c)?.uri; if (i4) { let n2 = { start: { x: l + 1, y: e3 }, end: { x: t4 + (d || t4 !== a2 - 1 ? 0 : 1), y: e3 } }, o3 = !1; if (!r2?.allowNonHttpProtocols) try { let e4 = new URL(i4); ["http:", "https:"].includes(e4.protocol) || (o3 = !0); } catch { o3 = !0; } o3 || s3.push({ text: i4, range: n2, activate: (e4, t5) => r2 ? r2.activate(e4, t5, n2) : h2(0, t5), hover: (e4, t5) => r2?.hover?.(e4, t5, n2), leave: (e4, t5) => r2?.leave?.(e4, t5, n2) }); } d = !1, o2.hasExtendedAttrs() && o2.extended.urlId ? (l = t4, c = o2.extended.urlId) : (l = -1, c = -1); } } t3(s3); } }; function h2(e3, t3) { if (confirm(`Do you want to navigate to ${t3}? WARNING: This link could potentially be dangerous`)) { let e4 = window.open(); if (e4) { try { e4.opener = null; } catch { } e4.location.href = t3; } else console.warn("Opening link blocked as opener could not be cleared"); } } t2.OscLinkProvider = a = s2([r(0, o.IBufferService), r(1, o.IOptionsService), r(2, o.IOscLinkService)], a); }, 6193: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.RenderDebouncer = void 0, t2.RenderDebouncer = class { constructor(e3, t3) { this._renderCallback = e3, this._coreBrowserService = t3, this._refreshCallbacks = []; } dispose() { this._animationFrame && (this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame), this._animationFrame = void 0); } addRefreshCallback(e3) { return this._refreshCallbacks.push(e3), this._animationFrame || (this._animationFrame = this._coreBrowserService.window.requestAnimationFrame((() => this._innerRefresh()))), this._animationFrame; } refresh(e3, t3, i2) { this._rowCount = i2, e3 = e3 !== void 0 ? e3 : 0, t3 = t3 !== void 0 ? t3 : this._rowCount - 1, this._rowStart = this._rowStart !== void 0 ? Math.min(this._rowStart, e3) : e3, this._rowEnd = this._rowEnd !== void 0 ? Math.max(this._rowEnd, t3) : t3, 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(); let e3 = Math.max(this._rowStart, 0), t3 = Math.min(this._rowEnd, this._rowCount - 1); this._rowStart = void 0, this._rowEnd = void 0, this._renderCallback(e3, t3), this._runRefreshCallbacks(); } _runRefreshCallbacks() { for (let e3 of this._refreshCallbacks) e3(0); this._refreshCallbacks = []; } }; }, 3236: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Terminal = void 0; let s2 = i2(3614), r = i2(3656), n = i2(3551), o = i2(9042), a = i2(3730), h2 = i2(1680), c = i2(3107), l = i2(5744), d = i2(2950), _ = i2(1296), u = i2(428), f = i2(4269), v = i2(5114), p = i2(8934), g = i2(3230), m = i2(9312), S = i2(4725), C = i2(6731), b = i2(8055), w = i2(8969), y = i2(8460), E = i2(844), k = i2(6114), L = i2(8437), D = i2(2584), R = i2(7399), x = i2(5941), A = i2(9074), B = i2(2585), T = i2(5435), M = i2(4567), O = i2(779); class P extends w.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(e3 = {}) { super(e3), this.browser = k, this._keyDownHandled = !1, this._keyDownSeen = !1, this._keyPressHandled = !1, this._unprocessedDeadKey = !1, this._accessibilityManager = this.register(new E.MutableDisposable()), this._onCursorMove = this.register(new y.EventEmitter()), this.onCursorMove = this._onCursorMove.event, this._onKey = this.register(new y.EventEmitter()), this.onKey = this._onKey.event, this._onRender = this.register(new y.EventEmitter()), this.onRender = this._onRender.event, this._onSelectionChange = this.register(new y.EventEmitter()), this.onSelectionChange = this._onSelectionChange.event, this._onTitleChange = this.register(new y.EventEmitter()), this.onTitleChange = this._onTitleChange.event, this._onBell = this.register(new y.EventEmitter()), this.onBell = this._onBell.event, this._onFocus = this.register(new y.EventEmitter()), this._onBlur = this.register(new y.EventEmitter()), this._onA11yCharEmitter = this.register(new y.EventEmitter()), this._onA11yTabEmitter = this.register(new y.EventEmitter()), this._onWillOpen = this.register(new y.EventEmitter()), this._setup(), this._decorationService = this._instantiationService.createInstance(A.DecorationService), this._instantiationService.setService(B.IDecorationService, this._decorationService), this._linkProviderService = this._instantiationService.createInstance(O.LinkProviderService), this._instantiationService.setService(S.ILinkProviderService, this._linkProviderService), this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(a.OscLinkProvider)), this.register(this._inputHandler.onRequestBell((() => this._onBell.fire()))), this.register(this._inputHandler.onRequestRefreshRows(((e4, t3) => this.refresh(e4, t3)))), this.register(this._inputHandler.onRequestSendFocus((() => this._reportFocus()))), this.register(this._inputHandler.onRequestReset((() => this.reset()))), this.register(this._inputHandler.onRequestWindowsOptionsReport(((e4) => this._reportWindowsOptions(e4)))), this.register(this._inputHandler.onColor(((e4) => this._handleColorEvent(e4)))), this.register((0, y.forwardEvent)(this._inputHandler.onCursorMove, this._onCursorMove)), this.register((0, y.forwardEvent)(this._inputHandler.onTitleChange, this._onTitleChange)), this.register((0, y.forwardEvent)(this._inputHandler.onA11yChar, this._onA11yCharEmitter)), this.register((0, y.forwardEvent)(this._inputHandler.onA11yTab, this._onA11yTabEmitter)), this.register(this._bufferService.onResize(((e4) => this._afterResize(e4.cols, e4.rows)))), this.register((0, E.toDisposable)((() => { this._customKeyEventHandler = void 0, this.element?.parentNode?.removeChild(this.element); }))); } _handleColorEvent(e3) { if (this._themeService) for (let t3 of e3) { let e4, i3 = ""; switch (t3.index) { case 256: e4 = "foreground", i3 = "10"; break; case 257: e4 = "background", i3 = "11"; break; case 258: e4 = "cursor", i3 = "12"; break; default: e4 = "ansi", i3 = "4;" + t3.index; } switch (t3.type) { case 0: let s3 = b.color.toColorRGB(e4 === "ansi" ? this._themeService.colors.ansi[t3.index] : this._themeService.colors[e4]); this.coreService.triggerDataEvent(`${D.C0.ESC}]${i3};${(0, x.toRgbString)(s3)}${D.C1_ESCAPED.ST}`); break; case 1: if (e4 === "ansi") this._themeService.modifyColors(((e5) => e5.ansi[t3.index] = b.channels.toColor(...t3.color))); else { let i4 = e4; this._themeService.modifyColors(((e5) => e5[i4] = b.channels.toColor(...t3.color))); } break; case 2: this._themeService.restoreColor(t3.index); } } } _setup() { super._setup(), this._customKeyEventHandler = void 0; } get buffer() { return this.buffers.active; } focus() { this.textarea && this.textarea.focus({ preventScroll: !0 }); } _handleScreenReaderModeOptionChange(e3) { e3 ? !this._accessibilityManager.value && this._renderService && (this._accessibilityManager.value = this._instantiationService.createInstance(M.AccessibilityManager, this)) : this._accessibilityManager.clear(); } _handleTextAreaFocus(e3) { this.coreService.decPrivateModes.sendFocus && this.coreService.triggerDataEvent(D.C0.ESC + "[I"), this.element.classList.add("focus"), this._showCursor(), this._onFocus.fire(); } blur() { return this.textarea?.blur(); } _handleTextAreaBlur() { this.textarea.value = "", this.refresh(this.buffer.y, this.buffer.y), this.coreService.decPrivateModes.sendFocus && this.coreService.triggerDataEvent(D.C0.ESC + "[O"), this.element.classList.remove("focus"), this._onBlur.fire(); } _syncTextArea() { if (!this.textarea || !this.buffer.isCursorInViewport || this._compositionHelper.isComposing || !this._renderService) return; let e3 = this.buffer.ybase + this.buffer.y, t3 = this.buffer.lines.get(e3); if (!t3) return; let i3 = Math.min(this.buffer.x, this.cols - 1), s3 = this._renderService.dimensions.css.cell.height, r2 = t3.getWidth(i3), n2 = this._renderService.dimensions.css.cell.width * r2, o2 = this.buffer.y * this._renderService.dimensions.css.cell.height, a2 = i3 * this._renderService.dimensions.css.cell.width; this.textarea.style.left = a2 + "px", this.textarea.style.top = o2 + "px", this.textarea.style.width = n2 + "px", this.textarea.style.height = s3 + "px", this.textarea.style.lineHeight = s3 + "px", this.textarea.style.zIndex = "-5"; } _initGlobal() { this._bindKeys(), this.register((0, r.addDisposableDomListener)(this.element, "copy", ((e4) => { this.hasSelection() && (0, s2.copyHandler)(e4, this._selectionService); }))); let e3 = (e4) => (0, s2.handlePasteEvent)(e4, this.textarea, this.coreService, this.optionsService); this.register((0, r.addDisposableDomListener)(this.textarea, "paste", e3)), this.register((0, r.addDisposableDomListener)(this.element, "paste", e3)), k.isFirefox ? this.register((0, r.addDisposableDomListener)(this.element, "mousedown", ((e4) => { e4.button === 2 && (0, s2.rightClickHandler)(e4, this.textarea, this.screenElement, this._selectionService, this.options.rightClickSelectsWord); }))) : this.register((0, r.addDisposableDomListener)(this.element, "contextmenu", ((e4) => { (0, s2.rightClickHandler)(e4, this.textarea, this.screenElement, this._selectionService, this.options.rightClickSelectsWord); }))), k.isLinux && this.register((0, r.addDisposableDomListener)(this.element, "auxclick", ((e4) => { e4.button === 1 && (0, s2.moveTextAreaUnderMouseCursor)(e4, this.textarea, this.screenElement); }))); } _bindKeys() { this.register((0, r.addDisposableDomListener)(this.textarea, "keyup", ((e3) => this._keyUp(e3)), !0)), this.register((0, r.addDisposableDomListener)(this.textarea, "keydown", ((e3) => this._keyDown(e3)), !0)), this.register((0, r.addDisposableDomListener)(this.textarea, "keypress", ((e3) => this._keyPress(e3)), !0)), this.register((0, r.addDisposableDomListener)(this.textarea, "compositionstart", (() => this._compositionHelper.compositionstart()))), this.register((0, r.addDisposableDomListener)(this.textarea, "compositionupdate", ((e3) => this._compositionHelper.compositionupdate(e3)))), this.register((0, r.addDisposableDomListener)(this.textarea, "compositionend", (() => this._compositionHelper.compositionend()))), this.register((0, r.addDisposableDomListener)(this.textarea, "input", ((e3) => this._inputEvent(e3)), !0)), this.register(this.onRender((() => this._compositionHelper.updateCompositionElements()))); } open(e3) { if (!e3) throw new Error("Terminal requires a parent element."); if (e3.isConnected || this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"), this.element?.ownerDocument.defaultView && this._coreBrowserService) return void (this.element.ownerDocument.defaultView !== this._coreBrowserService.window && (this._coreBrowserService.window = this.element.ownerDocument.defaultView)); this._document = e3.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"), e3.appendChild(this.element); let t3 = this._document.createDocumentFragment(); this._viewportElement = this._document.createElement("div"), this._viewportElement.classList.add("xterm-viewport"), t3.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, r.addDisposableDomListener)(this.screenElement, "mousemove", ((e4) => this.updateCursorStyle(e4)))), this._helperContainer = this._document.createElement("div"), this._helperContainer.classList.add("xterm-helpers"), this.screenElement.appendChild(this._helperContainer), t3.appendChild(this.screenElement), this.textarea = this._document.createElement("textarea"), this.textarea.classList.add("xterm-helper-textarea"), this.textarea.setAttribute("aria-label", o.promptLabel), k.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, e3.ownerDocument.defaultView ?? window, this._document ?? typeof window < "u" ? window.document : null)), this._instantiationService.setService(S.ICoreBrowserService, this._coreBrowserService), this.register((0, r.addDisposableDomListener)(this.textarea, "focus", ((e4) => this._handleTextAreaFocus(e4)))), this.register((0, r.addDisposableDomListener)(this.textarea, "blur", (() => this._handleTextAreaBlur()))), this._helperContainer.appendChild(this.textarea), this._charSizeService = this._instantiationService.createInstance(u.CharSizeService, this._document, this._helperContainer), this._instantiationService.setService(S.ICharSizeService, this._charSizeService), this._themeService = this._instantiationService.createInstance(C.ThemeService), this._instantiationService.setService(S.IThemeService, this._themeService), this._characterJoinerService = this._instantiationService.createInstance(f.CharacterJoinerService), this._instantiationService.setService(S.ICharacterJoinerService, this._characterJoinerService), this._renderService = this.register(this._instantiationService.createInstance(g.RenderService, this.rows, this.screenElement)), this._instantiationService.setService(S.IRenderService, this._renderService), this.register(this._renderService.onRenderedViewportChange(((e4) => this._onRender.fire(e4)))), this.onResize(((e4) => this._renderService.resize(e4.cols, e4.rows))), this._compositionView = this._document.createElement("div"), this._compositionView.classList.add("composition-view"), this._compositionHelper = this._instantiationService.createInstance(d.CompositionHelper, this.textarea, this._compositionView), this._helperContainer.appendChild(this._compositionView), this._mouseService = this._instantiationService.createInstance(p.MouseService), this._instantiationService.setService(S.IMouseService, this._mouseService), this.linkifier = this.register(this._instantiationService.createInstance(n.Linkifier, this.screenElement)), this.element.appendChild(t3); try { this._onWillOpen.fire(this.element); } catch { } this._renderService.hasRenderer() || this._renderService.setRenderer(this._createRenderer()), this.viewport = this._instantiationService.createInstance(h2.Viewport, this._viewportElement, this._viewportScrollArea), this.viewport.onRequestScrollLines(((e4) => this.scrollLines(e4.amount, e4.suppressScrollEvent, 1))), this.register(this._inputHandler.onRequestSyncScrollBar((() => this.viewport.syncScrollArea()))), this.register(this.viewport), this.register(this.onCursorMove((() => { this._renderService.handleCursorMove(), this._syncTextArea(); }))), this.register(this.onResize((() => this._renderService.handleResize(this.cols, this.rows)))), this.register(this.onBlur((() => this._renderService.handleBlur()))), this.register(this.onFocus((() => this._renderService.handleFocus()))), this.register(this._renderService.onDimensionsChange((() => this.viewport.syncScrollArea()))), this._selectionService = this.register(this._instantiationService.createInstance(m.SelectionService, this.element, this.screenElement, this.linkifier)), this._instantiationService.setService(S.ISelectionService, this._selectionService), this.register(this._selectionService.onRequestScrollLines(((e4) => this.scrollLines(e4.amount, e4.suppressScrollEvent)))), this.register(this._selectionService.onSelectionChange((() => this._onSelectionChange.fire()))), this.register(this._selectionService.onRequestRedraw(((e4) => this._renderService.handleSelectionChanged(e4.start, e4.end, e4.columnSelectMode)))), this.register(this._selectionService.onLinuxMouseSelection(((e4) => { this.textarea.value = e4, this.textarea.focus(), this.textarea.select(); }))), this.register(this._onScroll.event(((e4) => { this.viewport.syncScrollArea(), this._selectionService.refresh(); }))), this.register((0, r.addDisposableDomListener)(this._viewportElement, "scroll", (() => this._selectionService.refresh()))), this.register(this._instantiationService.createInstance(c.BufferDecorationRenderer, this.screenElement)), this.register((0, r.addDisposableDomListener)(this.element, "mousedown", ((e4) => this._selectionService.handleMouseDown(e4)))), 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(M.AccessibilityManager, this)), this.register(this.optionsService.onSpecificOptionChange("screenReaderMode", ((e4) => this._handleScreenReaderModeOptionChange(e4)))), this.options.overviewRulerWidth && (this._overviewRulerRenderer = this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer, this._viewportElement, this.screenElement))), this.optionsService.onSpecificOptionChange("overviewRulerWidth", ((e4) => { !this._overviewRulerRenderer && e4 && this._viewportElement && this.screenElement && (this._overviewRulerRenderer = this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer, this._viewportElement, this.screenElement))); })), this._charSizeService.measure(), this.refresh(0, this.rows - 1), this._initGlobal(), this.bindMouse(); } _createRenderer() { return this._instantiationService.createInstance(_.DomRenderer, this, this._document, this.element, this.screenElement, this._viewportElement, this._helperContainer, this.linkifier); } bindMouse() { let e3 = this, t3 = this.element; function i3(t4) { let i4 = e3._mouseService.getMouseReportCoords(t4, e3.screenElement); if (!i4) return !1; let s4, r2; switch (t4.overrideType || t4.type) { case "mousemove": r2 = 32, t4.buttons === void 0 ? (s4 = 3, t4.button !== void 0 && (s4 = t4.button < 3 ? t4.button : 3)) : s4 = 1 & t4.buttons ? 0 : 4 & t4.buttons ? 1 : 2 & t4.buttons ? 2 : 3; break; case "mouseup": r2 = 0, s4 = t4.button < 3 ? t4.button : 3; break; case "mousedown": r2 = 1, s4 = t4.button < 3 ? t4.button : 3; break; case "wheel": if (e3._customWheelEventHandler && e3._customWheelEventHandler(t4) === !1 || e3.viewport.getLinesScrolled(t4) === 0) return !1; r2 = t4.deltaY < 0 ? 0 : 1, s4 = 4; break; default: return !1; } return !(r2 === void 0 || s4 === void 0 || s4 > 4) && e3.coreMouseService.triggerMouseEvent({ col: i4.col, row: i4.row, x: i4.x, y: i4.y, button: s4, action: r2, ctrl: t4.ctrlKey, alt: t4.altKey, shift: t4.shiftKey }); } let s3 = { mouseup: null, wheel: null, mousedrag: null, mousemove: null }, n2 = { mouseup: (e4) => (i3(e4), e4.buttons || (this._document.removeEventListener("mouseup", s3.mouseup), s3.mousedrag && this._document.removeEventListener("mousemove", s3.mousedrag)), this.cancel(e4)), wheel: (e4) => (i3(e4), this.cancel(e4, !0)), mousedrag: (e4) => { e4.buttons && i3(e4); }, mousemove: (e4) => { e4.buttons || i3(e4); } }; this.register(this.coreMouseService.onProtocolChange(((e4) => { e4 ? (this.optionsService.rawOptions.logLevel === "debug" && this._logService.debug("Binding to mouse events:", this.coreMouseService.explainEvents(e4)), 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 & e4 ? s3.mousemove || (t3.addEventListener("mousemove", n2.mousemove), s3.mousemove = n2.mousemove) : (t3.removeEventListener("mousemove", s3.mousemove), s3.mousemove = null), 16 & e4 ? s3.wheel || (t3.addEventListener("wheel", n2.wheel, { passive: !1 }), s3.wheel = n2.wheel) : (t3.removeEventListener("wheel", s3.wheel), s3.wheel = null), 2 & e4 ? s3.mouseup || (s3.mouseup = n2.mouseup) : (this._document.removeEventListener("mouseup", s3.mouseup), s3.mouseup = null), 4 & e4 ? s3.mousedrag || (s3.mousedrag = n2.mousedrag) : (this._document.removeEventListener("mousemove", s3.mousedrag), s3.mousedrag = null); }))), this.coreMouseService.activeProtocol = this.coreMouseService.activeProtocol, this.register((0, r.addDisposableDomListener)(t3, "mousedown", ((e4) => { if (e4.preventDefault(), this.focus(), this.coreMouseService.areMouseEventsActive && !this._selectionService.shouldForceSelection(e4)) return i3(e4), s3.mouseup && this._document.addEventListener("mouseup", s3.mouseup), s3.mousedrag && this._document.addEventListener("mousemove", s3.mousedrag), this.cancel(e4); }))), this.register((0, r.addDisposableDomListener)(t3, "wheel", ((e4) => { if (!s3.wheel) { if (this._customWheelEventHandler && this._customWheelEventHandler(e4) === !1) return !1; if (!this.buffer.hasScrollback) { let t4 = this.viewport.getLinesScrolled(e4); if (t4 === 0) return; let i4 = D.C0.ESC + (this.coreService.decPrivateModes.applicationCursorKeys ? "O" : "[") + (e4.deltaY < 0 ? "A" : "B"), s4 = ""; for (let e5 = 0; e5 < Math.abs(t4); e5++) s4 += i4; return this.coreService.triggerDataEvent(s4, !0), this.cancel(e4, !0); } return this.viewport.handleWheel(e4) ? this.cancel(e4) : void 0; } }), { passive: !1 })), this.register((0, r.addDisposableDomListener)(t3, "touchstart", ((e4) => { if (!this.coreMouseService.areMouseEventsActive) return this.viewport.handleTouchStart(e4), this.cancel(e4); }), { passive: !0 })), this.register((0, r.addDisposableDomListener)(t3, "touchmove", ((e4) => { if (!this.coreMouseService.areMouseEventsActive) return this.viewport.handleTouchMove(e4) ? void 0 : this.cancel(e4); }), { passive: !1 })); } refresh(e3, t3) { this._renderService?.refreshRows(e3, t3); } updateCursorStyle(e3) { this._selectionService?.shouldColumnSelect(e3) ? 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(e3, t3, i3 = 0) { i3 === 1 ? (super.scrollLines(e3, t3, i3), this.refresh(0, this.rows - 1)) : this.viewport?.scrollLines(e3); } paste(e3) { (0, s2.paste)(e3, this.textarea, this.coreService, this.optionsService); } attachCustomKeyEventHandler(e3) { this._customKeyEventHandler = e3; } attachCustomWheelEventHandler(e3) { this._customWheelEventHandler = e3; } registerLinkProvider(e3) { return this._linkProviderService.registerLinkProvider(e3); } registerCharacterJoiner(e3) { if (!this._characterJoinerService) throw new Error("Terminal must be opened first"); let t3 = this._characterJoinerService.register(e3); return this.refresh(0, this.rows - 1), t3; } deregisterCharacterJoiner(e3) { if (!this._characterJoinerService) throw new Error("Terminal must be opened first"); this._characterJoinerService.deregister(e3) && this.refresh(0, this.rows - 1); } get markers() { return this.buffer.markers; } registerMarker(e3) { return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + e3); } registerDecoration(e3) { return this._decorationService.registerDecoration(e3); } hasSelection() { return !!this._selectionService && this._selectionService.hasSelection; } select(e3, t3, i3) { this._selectionService.setSelection(e3, t3, i3); } 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() { this._selectionService?.clearSelection(); } selectAll() { this._selectionService?.selectAll(); } selectLines(e3, t3) { this._selectionService?.selectLines(e3, t3); } _keyDown(e3) { if (this._keyDownHandled = !1, this._keyDownSeen = !0, this._customKeyEventHandler && this._customKeyEventHandler(e3) === !1) return !1; let t3 = this.browser.isMac && this.options.macOptionIsMeta && e3.altKey; if (!t3 && !this._compositionHelper.keydown(e3)) return this.options.scrollOnUserInput && this.buffer.ybase !== this.buffer.ydisp && this.scrollToBottom(), !1; t3 || e3.key !== "Dead" && e3.key !== "AltGraph" || (this._unprocessedDeadKey = !0); let i3 = (0, R.evaluateKeyboardEvent)(e3, this.coreService.decPrivateModes.applicationCursorKeys, this.browser.isMac, this.options.macOptionIsMeta); if (this.updateCursorStyle(e3), i3.type === 3 || i3.type === 2) { let t4 = this.rows - 1; return this.scrollLines(i3.type === 2 ? -t4 : t4), this.cancel(e3, !0); } return i3.type === 1 && this.selectAll(), !!this._isThirdLevelShift(this.browser, e3) || (i3.cancel && this.cancel(e3, !0), !i3.key || !!(e3.key && !e3.ctrlKey && !e3.altKey && !e3.metaKey && e3.key.length === 1 && e3.key.charCodeAt(0) >= 65 && e3.key.charCodeAt(0) <= 90) || (this._unprocessedDeadKey ? (this._unprocessedDeadKey = !1, !0) : (i3.key !== D.C0.ETX && i3.key !== D.C0.CR || (this.textarea.value = ""), this._onKey.fire({ key: i3.key, domEvent: e3 }), this._showCursor(), this.coreService.triggerDataEvent(i3.key, !0), !this.optionsService.rawOptions.screenReaderMode || e3.altKey || e3.ctrlKey ? this.cancel(e3, !0) : void (this._keyDownHandled = !0)))); } _isThirdLevelShift(e3, t3) { let i3 = e3.isMac && !this.options.macOptionIsMeta && t3.altKey && !t3.ctrlKey && !t3.metaKey || e3.isWindows && t3.altKey && t3.ctrlKey && !t3.metaKey || e3.isWindows && t3.getModifierState("AltGraph"); return t3.type === "keypress" ? i3 : i3 && (!t3.keyCode || t3.keyCode > 47); } _keyUp(e3) { this._keyDownSeen = !1, this._customKeyEventHandler && this._customKeyEventHandler(e3) === !1 || ((function(e4) { return e4.keyCode === 16 || e4.keyCode === 17 || e4.keyCode === 18; })(e3) || this.focus(), this.updateCursorStyle(e3), this._keyPressHandled = !1); } _keyPress(e3) { let t3; if (this._keyPressHandled = !1, this._keyDownHandled || this._customKeyEventHandler && this._customKeyEventHandler(e3) === !1) return !1; if (this.cancel(e3), e3.charCode) t3 = e3.charCode; else if (e3.which === null || e3.which === void 0) t3 = e3.keyCode; else { if (e3.which === 0 || e3.charCode === 0) return !1; t3 = e3.which; } return !(!t3 || (e3.altKey || e3.ctrlKey || e3.metaKey) && !this._isThirdLevelShift(this.browser, e3) || (t3 = String.fromCharCode(t3), this._onKey.fire({ key: t3, domEvent: e3 }), this._showCursor(), this.coreService.triggerDataEvent(t3, !0), this._keyPressHandled = !0, this._unprocessedDeadKey = !1, 0)); } _inputEvent(e3) { if (e3.data && e3.inputType === "insertText" && (!e3.composed || !this._keyDownSeen) && !this.optionsService.rawOptions.screenReaderMode) { if (this._keyPressHandled) return !1; this._unprocessedDeadKey = !1; let t3 = e3.data; return this.coreService.triggerDataEvent(t3, !0), this.cancel(e3), !0; } return !1; } resize(e3, t3) { e3 !== this.cols || t3 !== this.rows ? super.resize(e3, t3) : this._charSizeService && !this._charSizeService.hasValidSize && this._charSizeService.measure(); } _afterResize(e3, t3) { this._charSizeService?.measure(), this.viewport?.syncScrollArea(!0); } clear() { if (this.buffer.ybase !== 0 || this.buffer.y !== 0) { this.buffer.clearAllMarkers(), this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)), this.buffer.lines.length = 1, this.buffer.ydisp = 0, this.buffer.ybase = 0, this.buffer.y = 0; for (let e3 = 1; e3 < this.rows; e3++) this.buffer.lines.push(this.buffer.getBlankLine(L.DEFAULT_ATTR_DATA)); this._onScroll.fire({ position: this.buffer.ydisp, source: 0 }), this.viewport?.reset(), this.refresh(0, this.rows - 1); } } reset() { this.options.rows = this.rows, this.options.cols = this.cols; let e3 = this._customKeyEventHandler; this._setup(), super.reset(), this._selectionService?.reset(), this._decorationService.reset(), this.viewport?.reset(), this._customKeyEventHandler = e3, this.refresh(0, this.rows - 1); } clearTextureAtlas() { this._renderService?.clearTextureAtlas(); } _reportFocus() { this.element?.classList.contains("focus") ? this.coreService.triggerDataEvent(D.C0.ESC + "[I") : this.coreService.triggerDataEvent(D.C0.ESC + "[O"); } _reportWindowsOptions(e3) { if (this._renderService) switch (e3) { case T.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS: let e4 = this._renderService.dimensions.css.canvas.width.toFixed(0), t3 = this._renderService.dimensions.css.canvas.height.toFixed(0); this.coreService.triggerDataEvent(`${D.C0.ESC}[4;${t3};${e4}t`); break; case T.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS: let i3 = this._renderService.dimensions.css.cell.width.toFixed(0), s3 = this._renderService.dimensions.css.cell.height.toFixed(0); this.coreService.triggerDataEvent(`${D.C0.ESC}[6;${s3};${i3}t`); } } cancel(e3, t3) { if (this.options.cancelEvents || t3) return e3.preventDefault(), e3.stopPropagation(), !1; } } t2.Terminal = P; }, 9924: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.TimeBasedDebouncer = void 0, t2.TimeBasedDebouncer = class { constructor(e3, t3 = 1e3) { this._renderCallback = e3, this._debounceThresholdMS = t3, this._lastRefreshMs = 0, this._additionalRefreshRequested = !1; } dispose() { this._refreshTimeoutID && clearTimeout(this._refreshTimeoutID); } refresh(e3, t3, i2) { this._rowCount = i2, e3 = e3 !== void 0 ? e3 : 0, t3 = t3 !== void 0 ? t3 : this._rowCount - 1, this._rowStart = this._rowStart !== void 0 ? Math.min(this._rowStart, e3) : e3, this._rowEnd = this._rowEnd !== void 0 ? Math.max(this._rowEnd, t3) : t3; let s2 = Date.now(); if (s2 - this._lastRefreshMs >= this._debounceThresholdMS) this._lastRefreshMs = s2, this._innerRefresh(); else if (!this._additionalRefreshRequested) { let e4 = s2 - this._lastRefreshMs, t4 = this._debounceThresholdMS - e4; this._additionalRefreshRequested = !0, this._refreshTimeoutID = window.setTimeout((() => { this._lastRefreshMs = Date.now(), this._innerRefresh(), this._additionalRefreshRequested = !1, this._refreshTimeoutID = void 0; }), t4); } } _innerRefresh() { if (this._rowStart === void 0 || this._rowEnd === void 0 || this._rowCount === void 0) return; let e3 = Math.max(this._rowStart, 0), t3 = Math.min(this._rowEnd, this._rowCount - 1); this._rowStart = void 0, this._rowEnd = void 0, this._renderCallback(e3, t3); } }; }, 1680: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Viewport = void 0; let n = i2(3656), o = i2(4725), a = i2(8460), h2 = i2(844), c = i2(2585), l = t2.Viewport = class extends h2.Disposable { constructor(e3, t3, i3, s3, r2, o2, h3, c2) { super(), this._viewportElement = e3, this._scrollArea = t3, this._bufferService = i3, this._optionsService = s3, this._charSizeService = r2, this._renderService = o2, this._coreBrowserService = h3, 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 a.EventEmitter()), this.onRequestScrollLines = this._onRequestScrollLines.event, this.scrollBarWidth = this._viewportElement.offsetWidth - this._scrollArea.offsetWidth || 15, this.register((0, n.addDisposableDomListener)(this._viewportElement, "scroll", this._handleScroll.bind(this))), this._activeBuffer = this._bufferService.buffer, this.register(this._bufferService.buffers.onBufferActivate(((e4) => this._activeBuffer = e4.activeBuffer))), this._renderDimensions = this._renderService.dimensions, this.register(this._renderService.onDimensionsChange(((e4) => this._renderDimensions = e4))), this._handleThemeChange(c2.colors), this.register(c2.onChangeColors(((e4) => this._handleThemeChange(e4)))), this.register(this._optionsService.onSpecificOptionChange("scrollback", (() => this.syncScrollArea()))), setTimeout((() => this.syncScrollArea())); } _handleThemeChange(e3) { this._viewportElement.style.backgroundColor = e3.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(e3) { if (e3) 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; let e4 = Math.round(this._currentRowHeight * this._lastRecordedBufferLength) + (this._lastRecordedViewportHeight - this._renderDimensions.css.canvas.height); this._lastRecordedBufferHeight !== e4 && (this._lastRecordedBufferHeight = e4, this._scrollArea.style.height = this._lastRecordedBufferHeight + "px"); } let e3 = this._bufferService.buffer.ydisp * this._currentRowHeight; this._viewportElement.scrollTop !== e3 && (this._ignoreNextScrollEvent = !0, this._viewportElement.scrollTop = e3), this._refreshAnimationFrame = null; } syncScrollArea(e3 = !1) { if (this._lastRecordedBufferLength !== this._bufferService.buffer.lines.length) return this._lastRecordedBufferLength = this._bufferService.buffer.lines.length, void this._refresh(e3); this._lastRecordedViewportHeight === this._renderService.dimensions.css.canvas.height && this._lastScrollTop === this._activeBuffer.ydisp * this._currentRowHeight && this._renderDimensions.device.cell.height === this._currentDeviceCellHeight || this._refresh(e3); } _handleScroll(e3) { 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 }); let t3 = Math.round(this._lastScrollTop / this._currentRowHeight) - this._bufferService.buffer.ydisp; this._onRequestScrollLines.fire({ amount: t3, suppressScrollEvent: !0 }); } _smoothScroll() { if (this._isDisposed || this._smoothScrollState.origin === -1 || this._smoothScrollState.target === -1) return; let e3 = this._smoothScrollPercent(); this._viewportElement.scrollTop = this._smoothScrollState.origin + Math.round(e3 * (this._smoothScrollState.target - this._smoothScrollState.origin)), e3 < 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(e3, t3) { let i3 = this._viewportElement.scrollTop + this._lastRecordedViewportHeight; return !(t3 < 0 && this._viewportElement.scrollTop !== 0 || t3 > 0 && i3 < this._lastRecordedBufferHeight) || (e3.cancelable && e3.preventDefault(), !1); } handleWheel(e3) { let t3 = this._getPixelsScrolled(e3); return t3 !== 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 + t3 : this._smoothScrollState.target += t3, this._smoothScrollState.target = Math.max(Math.min(this._smoothScrollState.target, this._viewportElement.scrollHeight), 0), this._smoothScroll()) : this._clearSmoothScrollState()) : this._viewportElement.scrollTop += t3, this._bubbleScroll(e3, t3)); } scrollLines(e3) { if (e3 !== 0) if (this._optionsService.rawOptions.smoothScrollDuration) { let t3 = e3 * this._currentRowHeight; this._smoothScrollState.startTime = Date.now(), this._smoothScrollPercent() < 1 ? (this._smoothScrollState.origin = this._viewportElement.scrollTop, this._smoothScrollState.target = this._smoothScrollState.origin + t3, this._smoothScrollState.target = Math.max(Math.min(this._smoothScrollState.target, this._viewportElement.scrollHeight), 0), this._smoothScroll()) : this._clearSmoothScrollState(); } else this._onRequestScrollLines.fire({ amount: e3, suppressScrollEvent: !1 }); } _getPixelsScrolled(e3) { if (e3.deltaY === 0 || e3.shiftKey) return 0; let t3 = this._applyScrollModifier(e3.deltaY, e3); return e3.deltaMode === WheelEvent.DOM_DELTA_LINE ? t3 *= this._currentRowHeight : e3.deltaMode === WheelEvent.DOM_DELTA_PAGE && (t3 *= this._currentRowHeight * this._bufferService.rows), t3; } getBufferElements(e3, t3) { let i3, s3 = "", r2 = [], n2 = t3 ?? this._bufferService.buffer.lines.length, o2 = this._bufferService.buffer.lines; for (let t4 = e3; t4 < n2; t4++) { let e4 = o2.get(t4); if (!e4) continue; let n3 = o2.get(t4 + 1)?.isWrapped; if (s3 += e4.translateToString(!n3), !n3 || t4 === o2.length - 1) { let e5 = document.createElement("div"); e5.textContent = s3, r2.push(e5), s3.length > 0 && (i3 = e5), s3 = ""; } } return { bufferElements: r2, cursorElement: i3 }; } getLinesScrolled(e3) { if (e3.deltaY === 0 || e3.shiftKey) return 0; let t3 = this._applyScrollModifier(e3.deltaY, e3); return e3.deltaMode === WheelEvent.DOM_DELTA_PIXEL ? (t3 /= this._currentRowHeight + 0, this._wheelPartialScroll += t3, t3 = Math.floor(Math.abs(this._wheelPartialScroll)) * (this._wheelPartialScroll > 0 ? 1 : -1), this._wheelPartialScroll %= 1) : e3.deltaMode === WheelEvent.DOM_DELTA_PAGE && (t3 *= this._bufferService.rows), t3; } _applyScrollModifier(e3, t3) { let i3 = this._optionsService.rawOptions.fastScrollModifier; return i3 === "alt" && t3.altKey || i3 === "ctrl" && t3.ctrlKey || i3 === "shift" && t3.shiftKey ? e3 * this._optionsService.rawOptions.fastScrollSensitivity * this._optionsService.rawOptions.scrollSensitivity : e3 * this._optionsService.rawOptions.scrollSensitivity; } handleTouchStart(e3) { this._lastTouchY = e3.touches[0].pageY; } handleTouchMove(e3) { let t3 = this._lastTouchY - e3.touches[0].pageY; return this._lastTouchY = e3.touches[0].pageY, t3 !== 0 && (this._viewportElement.scrollTop += t3, this._bubbleScroll(e3, t3)); } }; t2.Viewport = l = s2([r(2, c.IBufferService), r(3, c.IOptionsService), r(4, o.ICharSizeService), r(5, o.IRenderService), r(6, o.ICoreBrowserService), r(7, o.IThemeService)], l); }, 3107: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferDecorationRenderer = void 0; let n = i2(4725), o = i2(844), a = i2(2585), h2 = t2.BufferDecorationRenderer = class extends o.Disposable { constructor(e3, t3, i3, s3, r2) { super(), this._screenElement = e3, this._bufferService = t3, this._coreBrowserService = i3, this._decorationService = s3, this._renderService = r2, this._decorationElements = /* @__PURE__ */ 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(((e4) => this._removeDecoration(e4)))), this.register((0, o.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 (let e3 of this._decorationService.decorations) this._renderDecoration(e3); this._dimensionsChanged = !1; } _renderDecoration(e3) { this._refreshStyle(e3), this._dimensionsChanged && this._refreshXPosition(e3); } _createElement(e3) { let t3 = this._coreBrowserService.mainDocument.createElement("div"); t3.classList.add("xterm-decoration"), t3.classList.toggle("xterm-decoration-top-layer", e3?.options?.layer === "top"), t3.style.width = `${Math.round((e3.options.width || 1) * this._renderService.dimensions.css.cell.width)}px`, t3.style.height = (e3.options.height || 1) * this._renderService.dimensions.css.cell.height + "px", t3.style.top = (e3.marker.line - this._bufferService.buffers.active.ydisp) * this._renderService.dimensions.css.cell.height + "px", t3.style.lineHeight = `${this._renderService.dimensions.css.cell.height}px`; let i3 = e3.options.x ?? 0; return i3 && i3 > this._bufferService.cols && (t3.style.display = "none"), this._refreshXPosition(e3, t3), t3; } _refreshStyle(e3) { let t3 = e3.marker.line - this._bufferService.buffers.active.ydisp; if (t3 < 0 || t3 >= this._bufferService.rows) e3.element && (e3.element.style.display = "none", e3.onRenderEmitter.fire(e3.element)); else { let i3 = this._decorationElements.get(e3); i3 || (i3 = this._createElement(e3), e3.element = i3, this._decorationElements.set(e3, i3), this._container.appendChild(i3), e3.onDispose((() => { this._decorationElements.delete(e3), i3.remove(); }))), i3.style.top = t3 * this._renderService.dimensions.css.cell.height + "px", i3.style.display = this._altBufferIsActive ? "none" : "block", e3.onRenderEmitter.fire(i3); } } _refreshXPosition(e3, t3 = e3.element) { if (!t3) return; let i3 = e3.options.x ?? 0; (e3.options.anchor || "left") === "right" ? t3.style.right = i3 ? i3 * this._renderService.dimensions.css.cell.width + "px" : "" : t3.style.left = i3 ? i3 * this._renderService.dimensions.css.cell.width + "px" : ""; } _removeDecoration(e3) { this._decorationElements.get(e3)?.remove(), this._decorationElements.delete(e3), e3.dispose(); } }; t2.BufferDecorationRenderer = h2 = s2([r(1, a.IBufferService), r(2, n.ICoreBrowserService), r(3, a.IDecorationService), r(4, n.IRenderService)], h2); }, 5871: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.ColorZoneStore = void 0, t2.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(e3) { if (e3.options.overviewRulerOptions) { for (let t3 of this._zones) if (t3.color === e3.options.overviewRulerOptions.color && t3.position === e3.options.overviewRulerOptions.position) { if (this._lineIntersectsZone(t3, e3.marker.line)) return; if (this._lineAdjacentToZone(t3, e3.marker.line, e3.options.overviewRulerOptions.position)) return void this._addLineToZone(t3, e3.marker.line); } if (this._zonePoolIndex < this._zonePool.length) return this._zonePool[this._zonePoolIndex].color = e3.options.overviewRulerOptions.color, this._zonePool[this._zonePoolIndex].position = e3.options.overviewRulerOptions.position, this._zonePool[this._zonePoolIndex].startBufferLine = e3.marker.line, this._zonePool[this._zonePoolIndex].endBufferLine = e3.marker.line, void this._zones.push(this._zonePool[this._zonePoolIndex++]); this._zones.push({ color: e3.options.overviewRulerOptions.color, position: e3.options.overviewRulerOptions.position, startBufferLine: e3.marker.line, endBufferLine: e3.marker.line }), this._zonePool.push(this._zones[this._zones.length - 1]), this._zonePoolIndex++; } } setPadding(e3) { this._linePadding = e3; } _lineIntersectsZone(e3, t3) { return t3 >= e3.startBufferLine && t3 <= e3.endBufferLine; } _lineAdjacentToZone(e3, t3, i2) { return t3 >= e3.startBufferLine - this._linePadding[i2 || "full"] && t3 <= e3.endBufferLine + this._linePadding[i2 || "full"]; } _addLineToZone(e3, t3) { e3.startBufferLine = Math.min(e3.startBufferLine, t3), e3.endBufferLine = Math.max(e3.endBufferLine, t3); } }; }, 5744: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.OverviewRulerRenderer = void 0; let n = i2(5871), o = i2(4725), a = i2(844), h2 = i2(2585), c = { full: 0, left: 0, center: 0, right: 0 }, l = { full: 0, left: 0, center: 0, right: 0 }, d = { full: 0, left: 0, center: 0, right: 0 }, _ = t2.OverviewRulerRenderer = class extends a.Disposable { get _width() { return this._optionsService.options.overviewRulerWidth || 0; } constructor(e3, t3, i3, s3, r2, o2, h3) { super(), this._viewportElement = e3, this._screenElement = t3, this._bufferService = i3, this._decorationService = s3, this._renderService = r2, this._optionsService = o2, this._coreBrowserService = h3, this._colorZoneStore = new n.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(), this._viewportElement.parentElement?.insertBefore(this._canvas, this._viewportElement); let c2 = this._canvas.getContext("2d"); if (!c2) throw new Error("Ctx cannot be null"); this._ctx = c2, this._registerDecorationListeners(), this._registerBufferChangeListeners(), this._registerDimensionChangeListeners(), this.register((0, a.toDisposable)((() => { this._canvas?.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() { let e3 = Math.floor(this._canvas.width / 3), t3 = Math.ceil(this._canvas.width / 3); l.full = this._canvas.width, l.left = e3, l.center = t3, l.right = e3, this._refreshDrawHeightConstants(), d.full = 0, d.left = 0, d.center = l.left, d.right = l.left + l.center; } _refreshDrawHeightConstants() { c.full = Math.round(2 * this._coreBrowserService.dpr); let e3 = this._canvas.height / this._bufferService.buffer.lines.length, t3 = Math.round(Math.max(Math.min(e3, 12), 6) * this._coreBrowserService.dpr); c.left = t3, c.center = t3, c.right = t3; } _refreshColorZonePadding() { this._colorZoneStore.setPadding({ full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * c.full), left: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * c.left), center: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * c.center), right: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * c.right) }), this._lastKnownBufferLength = this._bufferService.buffers.normal.lines.length; } _refreshCanvasDimensions() { this._canvas.style.width = `${this._width}px`, this._canvas.width = Math.round(this._width * this._coreBrowserService.dpr), this._canvas.style.height = `${this._screenElement.clientHeight}px`, this._canvas.height = Math.round(this._screenElement.clientHeight * this._coreBrowserService.dpr), this._refreshDrawConstants(), this._refreshColorZonePadding(); } _refreshDecorations() { this._shouldUpdateDimensions && this._refreshCanvasDimensions(), this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height), this._colorZoneStore.clear(); for (let e4 of this._decorationService.decorations) this._colorZoneStore.addDecoration(e4); this._ctx.lineWidth = 1; let e3 = this._colorZoneStore.zones; for (let t3 of e3) t3.position !== "full" && this._renderColorZone(t3); for (let t3 of e3) t3.position === "full" && this._renderColorZone(t3); this._shouldUpdateDimensions = !1, this._shouldUpdateAnchor = !1; } _renderColorZone(e3) { this._ctx.fillStyle = e3.color, this._ctx.fillRect(d[e3.position || "full"], Math.round((this._canvas.height - 1) * (e3.startBufferLine / this._bufferService.buffers.active.lines.length) - c[e3.position || "full"] / 2), l[e3.position || "full"], Math.round((this._canvas.height - 1) * ((e3.endBufferLine - e3.startBufferLine) / this._bufferService.buffers.active.lines.length) + c[e3.position || "full"])); } _queueRefresh(e3, t3) { this._shouldUpdateDimensions = e3 || this._shouldUpdateDimensions, this._shouldUpdateAnchor = t3 || this._shouldUpdateAnchor, this._animationFrame === void 0 && (this._animationFrame = this._coreBrowserService.window.requestAnimationFrame((() => { this._refreshDecorations(), this._animationFrame = void 0; }))); } }; t2.OverviewRulerRenderer = _ = s2([r(2, h2.IBufferService), r(3, h2.IDecorationService), r(4, o.IRenderService), r(5, h2.IOptionsService), r(6, o.ICoreBrowserService)], _); }, 2950: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CompositionHelper = void 0; let n = i2(4725), o = i2(2585), a = i2(2584), h2 = t2.CompositionHelper = class { get isComposing() { return this._isComposing; } constructor(e3, t3, i3, s3, r2, n2) { this._textarea = e3, this._compositionView = t3, this._bufferService = i3, this._optionsService = s3, this._coreService = r2, this._renderService = n2, 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(e3) { this._compositionView.textContent = e3.data, this.updateCompositionElements(), setTimeout((() => { this._compositionPosition.end = this._textarea.value.length; }), 0); } compositionend() { this._finalizeComposition(!0); } keydown(e3) { if (this._isComposing || this._isSendingComposition) { if (e3.keyCode === 229 || e3.keyCode === 16 || e3.keyCode === 17 || e3.keyCode === 18) return !1; this._finalizeComposition(!1); } return e3.keyCode !== 229 || (this._handleAnyTextareaChanges(), !1); } _finalizeComposition(e3) { if (this._compositionView.classList.remove("active"), this._isComposing = !1, e3) { let e4 = { start: this._compositionPosition.start, end: this._compositionPosition.end }; this._isSendingComposition = !0, setTimeout((() => { if (this._isSendingComposition) { let t3; this._isSendingComposition = !1, e4.start += this._dataAlreadySent.length, t3 = this._isComposing ? this._textarea.value.substring(e4.start, e4.end) : this._textarea.value.substring(e4.start), t3.length > 0 && this._coreService.triggerDataEvent(t3, !0); } }), 0); } else { this._isSendingComposition = !1; let e4 = this._textarea.value.substring(this._compositionPosition.start, this._compositionPosition.end); this._coreService.triggerDataEvent(e4, !0); } } _handleAnyTextareaChanges() { let e3 = this._textarea.value; setTimeout((() => { if (!this._isComposing) { let t3 = this._textarea.value, i3 = t3.replace(e3, ""); this._dataAlreadySent = i3, t3.length > e3.length ? this._coreService.triggerDataEvent(i3, !0) : t3.length < e3.length ? this._coreService.triggerDataEvent(`${a.C0.DEL}`, !0) : t3.length === e3.length && t3 !== e3 && this._coreService.triggerDataEvent(t3, !0); } }), 0); } updateCompositionElements(e3) { if (this._isComposing) { if (this._bufferService.buffer.isCursorInViewport) { let e4 = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1), t3 = this._renderService.dimensions.css.cell.height, i3 = this._bufferService.buffer.y * this._renderService.dimensions.css.cell.height, s3 = e4 * this._renderService.dimensions.css.cell.width; this._compositionView.style.left = s3 + "px", this._compositionView.style.top = i3 + "px", this._compositionView.style.height = t3 + "px", this._compositionView.style.lineHeight = t3 + "px", this._compositionView.style.fontFamily = this._optionsService.rawOptions.fontFamily, this._compositionView.style.fontSize = this._optionsService.rawOptions.fontSize + "px"; let r2 = this._compositionView.getBoundingClientRect(); this._textarea.style.left = s3 + "px", this._textarea.style.top = i3 + "px", this._textarea.style.width = Math.max(r2.width, 1) + "px", this._textarea.style.height = Math.max(r2.height, 1) + "px", this._textarea.style.lineHeight = r2.height + "px"; } e3 || setTimeout((() => this.updateCompositionElements(!0)), 0); } } }; t2.CompositionHelper = h2 = s2([r(2, o.IBufferService), r(3, o.IOptionsService), r(4, o.ICoreService), r(5, n.IRenderService)], h2); }, 9806: (e2, t2) => { function i2(e3, t3, i3) { let s2 = i3.getBoundingClientRect(), r = e3.getComputedStyle(i3), n = parseInt(r.getPropertyValue("padding-left")), o = parseInt(r.getPropertyValue("padding-top")); return [t3.clientX - s2.left - n, t3.clientY - s2.top - o]; } Object.defineProperty(t2, "__esModule", { value: !0 }), t2.getCoords = t2.getCoordsRelativeToElement = void 0, t2.getCoordsRelativeToElement = i2, t2.getCoords = function(e3, t3, s2, r, n, o, a, h2, c) { if (!o) return; let l = i2(e3, t3, s2); return l ? (l[0] = Math.ceil((l[0] + (c ? a / 2 : 0)) / a), l[1] = Math.ceil(l[1] / h2), l[0] = Math.min(Math.max(l[0], 1), r + (c ? 1 : 0)), l[1] = Math.min(Math.max(l[1], 1), n), l) : void 0; }; }, 9504: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.moveToCellSequence = void 0; let s2 = i2(2584); function r(e3, t3, i3, s3) { let r2 = e3 - n(e3, i3), a2 = t3 - n(t3, i3), l = Math.abs(r2 - a2) - (function(e4, t4, i4) { let s4 = 0, r3 = e4 - n(e4, i4), a3 = t4 - n(t4, i4); for (let n2 = 0; n2 < Math.abs(r3 - a3); n2++) { let a4 = o(e4, t4) === "A" ? -1 : 1; i4.buffer.lines.get(r3 + a4 * n2)?.isWrapped && s4++; } return s4; })(e3, t3, i3); return c(l, h2(o(e3, t3), s3)); } function n(e3, t3) { let i3 = 0, s3 = t3.buffer.lines.get(e3), r2 = s3?.isWrapped; for (; r2 && e3 >= 0 && e3 < t3.rows; ) i3++, s3 = t3.buffer.lines.get(--e3), r2 = s3?.isWrapped; return i3; } function o(e3, t3) { return e3 > t3 ? "A" : "B"; } function a(e3, t3, i3, s3, r2, n2) { let o2 = e3, a2 = t3, h3 = ""; for (; o2 !== i3 || a2 !== s3; ) o2 += r2 ? 1 : -1, r2 && o2 > n2.cols - 1 ? (h3 += n2.buffer.translateBufferLineToString(a2, !1, e3, o2), o2 = 0, e3 = 0, a2++) : !r2 && o2 < 0 && (h3 += n2.buffer.translateBufferLineToString(a2, !1, 0, e3 + 1), o2 = n2.cols - 1, e3 = o2, a2--); return h3 + n2.buffer.translateBufferLineToString(a2, !1, e3, o2); } function h2(e3, t3) { let i3 = t3 ? "O" : "["; return s2.C0.ESC + i3 + e3; } function c(e3, t3) { e3 = Math.floor(e3); let i3 = ""; for (let s3 = 0; s3 < e3; s3++) i3 += t3; return i3; } t2.moveToCellSequence = function(e3, t3, i3, s3) { let o2 = i3.buffer.x, l = i3.buffer.y; if (!i3.buffer.hasScrollback) return (function(e4, t4, i4, s4, o3, l2) { return r(t4, s4, o3, l2).length === 0 ? "" : c(a(e4, t4, e4, t4 - n(t4, o3), !1, o3).length, h2("D", l2)); })(o2, l, 0, t3, i3, s3) + r(l, t3, i3, s3) + (function(e4, t4, i4, s4, o3, l2) { let d2; d2 = r(t4, s4, o3, l2).length > 0 ? s4 - n(s4, o3) : t4; let _2 = s4, u = (function(e5, t5, i5, s5, o4, a2) { let h3; return h3 = r(i5, s5, o4, a2).length > 0 ? s5 - n(s5, o4) : t5, e5 < i5 && h3 <= s5 || e5 >= i5 && h3 < s5 ? "C" : "D"; })(e4, t4, i4, s4, o3, l2); return c(a(e4, d2, i4, _2, u === "C", o3).length, h2(u, l2)); })(o2, l, e3, t3, i3, s3); let d; if (l === t3) return d = o2 > e3 ? "D" : "C", c(Math.abs(o2 - e3), h2(d, s3)); d = l > t3 ? "D" : "C"; let _ = Math.abs(l - t3); return c((function(e4, t4) { return t4.cols - e4; })(l > t3 ? e3 : o2, i3) + (_ - 1) * i3.cols + 1 + ((l > t3 ? o2 : e3) - 1), h2(d, s3)); }; }, 1296: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.DomRenderer = void 0; let n = i2(3787), o = i2(2550), a = i2(2223), h2 = i2(6171), c = i2(6052), l = i2(4725), d = i2(8055), _ = i2(8460), u = i2(844), f = i2(2585), v = "xterm-dom-renderer-owner-", p = "xterm-rows", g = "xterm-fg-", m = "xterm-bg-", S = "xterm-focus", C = "xterm-selection", b = 1, w = t2.DomRenderer = class extends u.Disposable { constructor(e3, t3, i3, s3, r2, a2, l2, d2, f2, g2, m2, S2, w2) { super(), this._terminal = e3, this._document = t3, this._element = i3, this._screenElement = s3, this._viewportElement = r2, this._helperContainer = a2, this._linkifier2 = l2, this._charSizeService = f2, this._optionsService = g2, this._bufferService = m2, this._coreBrowserService = S2, this._themeService = w2, this._terminalClass = b++, this._rowElements = [], this._selectionRenderModel = (0, c.createSelectionRenderModel)(), this.onRequestRedraw = this.register(new _.EventEmitter()).event, this._rowContainer = this._document.createElement("div"), this._rowContainer.classList.add(p), 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(C), this._selectionContainer.setAttribute("aria-hidden", "true"), this.dimensions = (0, h2.createRenderDimensions)(), this._updateDimensions(), this.register(this._optionsService.onOptionChange((() => this._handleOptionsChanged()))), this.register(this._themeService.onChangeColors(((e4) => this._injectCss(e4)))), this._injectCss(this._themeService.colors), this._rowFactory = d2.createInstance(n.DomRendererRowFactory, document), this._element.classList.add(v + this._terminalClass), this._screenElement.appendChild(this._rowContainer), this._screenElement.appendChild(this._selectionContainer), this.register(this._linkifier2.onShowLinkUnderline(((e4) => this._handleLinkHover(e4)))), this.register(this._linkifier2.onHideLinkUnderline(((e4) => this._handleLinkLeave(e4)))), this.register((0, u.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 o.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() { let e3 = this._coreBrowserService.dpr; this.dimensions.device.char.width = this._charSizeService.width * e3, this.dimensions.device.char.height = Math.ceil(this._charSizeService.height * e3), 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 / e3), this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / e3), this.dimensions.css.cell.width = this.dimensions.css.canvas.width / this._bufferService.cols, this.dimensions.css.cell.height = this.dimensions.css.canvas.height / this._bufferService.rows; for (let e4 of this._rowElements) e4.style.width = `${this.dimensions.css.canvas.width}px`, e4.style.height = `${this.dimensions.css.cell.height}px`, e4.style.lineHeight = `${this.dimensions.css.cell.height}px`, e4.style.overflow = "hidden"; this._dimensionsStyleElement || (this._dimensionsStyleElement = this._document.createElement("style"), this._screenElement.appendChild(this._dimensionsStyleElement)); let t3 = `${this._terminalSelector} .${p} span { display: inline-block; height: 100%; vertical-align: top;}`; this._dimensionsStyleElement.textContent = t3, 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(e3) { this._themeStyleElement || (this._themeStyleElement = this._document.createElement("style"), this._screenElement.appendChild(this._themeStyleElement)); let t3 = `${this._terminalSelector} .${p} { color: ${e3.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`; t3 += `${this._terminalSelector} .${p} .xterm-dim { color: ${d.color.multiplyOpacity(e3.foreground, 0.5).css};}`, t3 += `${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`; let i3 = `blink_underline_${this._terminalClass}`, s3 = `blink_bar_${this._terminalClass}`, r2 = `blink_block_${this._terminalClass}`; t3 += `@keyframes ${i3} { 50% { border-bottom-style: hidden; }}`, t3 += `@keyframes ${s3} { 50% { box-shadow: none; }}`, t3 += `@keyframes ${r2} { 0% { background-color: ${e3.cursor.css}; color: ${e3.cursorAccent.css}; } 50% { background-color: inherit; color: ${e3.cursor.css}; }}`, t3 += `${this._terminalSelector} .${p}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i3} 1s step-end infinite;}${this._terminalSelector} .${p}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s3} 1s step-end infinite;}${this._terminalSelector} .${p}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r2} 1s step-end infinite;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-block { background-color: ${e3.cursor.css}; color: ${e3.cursorAccent.css};}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e3.cursor.css} !important; color: ${e3.cursorAccent.css} !important;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e3.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e3.cursor.css} inset;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e3.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`, t3 += `${this._terminalSelector} .${C} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${C} div { position: absolute; background-color: ${e3.selectionBackgroundOpaque.css};}${this._terminalSelector} .${C} div { position: absolute; background-color: ${e3.selectionInactiveBackgroundOpaque.css};}`; for (let [i4, s4] of e3.ansi.entries()) t3 += `${this._terminalSelector} .${g}${i4} { color: ${s4.css}; }${this._terminalSelector} .${g}${i4}.xterm-dim { color: ${d.color.multiplyOpacity(s4, 0.5).css}; }${this._terminalSelector} .${m}${i4} { background-color: ${s4.css}; }`; t3 += `${this._terminalSelector} .${g}${a.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(e3.background).css}; }${this._terminalSelector} .${g}${a.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(e3.background), 0.5).css}; }${this._terminalSelector} .${m}${a.INVERTED_DEFAULT_COLOR} { background-color: ${e3.foreground.css}; }`, this._themeStyleElement.textContent = t3; } _setDefaultSpacing() { let e3 = this.dimensions.css.cell.width - this._widthCache.get("W", !1, !1); this._rowContainer.style.letterSpacing = `${e3}px`, this._rowFactory.defaultSpacing = e3; } handleDevicePixelRatioChange() { this._updateDimensions(), this._widthCache.clear(), this._setDefaultSpacing(); } _refreshRowElements(e3, t3) { for (let e4 = this._rowElements.length; e4 <= t3; e4++) { let e5 = this._document.createElement("div"); this._rowContainer.appendChild(e5), this._rowElements.push(e5); } for (; this._rowElements.length > t3; ) this._rowContainer.removeChild(this._rowElements.pop()); } handleResize(e3, t3) { this._refreshRowElements(e3, t3), 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(S), this.renderRows(0, this._bufferService.rows - 1); } handleFocus() { this._rowContainer.classList.add(S), this.renderRows(this._bufferService.buffer.y, this._bufferService.buffer.y); } handleSelectionChanged(e3, t3, i3) { if (this._selectionContainer.replaceChildren(), this._rowFactory.handleSelectionChanged(e3, t3, i3), this.renderRows(0, this._bufferService.rows - 1), !e3 || !t3) return; this._selectionRenderModel.update(this._terminal, e3, t3, i3); let s3 = this._selectionRenderModel.viewportStartRow, r2 = this._selectionRenderModel.viewportEndRow, n2 = this._selectionRenderModel.viewportCappedStartRow, o2 = this._selectionRenderModel.viewportCappedEndRow; if (n2 >= this._bufferService.rows || o2 < 0) return; let a2 = this._document.createDocumentFragment(); if (i3) { let i4 = e3[0] > t3[0]; a2.appendChild(this._createSelectionElement(n2, i4 ? t3[0] : e3[0], i4 ? e3[0] : t3[0], o2 - n2 + 1)); } else { let i4 = s3 === n2 ? e3[0] : 0, h3 = n2 === r2 ? t3[0] : this._bufferService.cols; a2.appendChild(this._createSelectionElement(n2, i4, h3)); let c2 = o2 - n2 - 1; if (a2.appendChild(this._createSelectionElement(n2 + 1, 0, this._bufferService.cols, c2)), n2 !== o2) { let e4 = r2 === o2 ? t3[0] : this._bufferService.cols; a2.appendChild(this._createSelectionElement(o2, 0, e4)); } } this._selectionContainer.appendChild(a2); } _createSelectionElement(e3, t3, i3, s3 = 1) { let r2 = this._document.createElement("div"), n2 = t3 * this.dimensions.css.cell.width, o2 = this.dimensions.css.cell.width * (i3 - t3); return n2 + o2 > this.dimensions.css.canvas.width && (o2 = this.dimensions.css.canvas.width - n2), r2.style.height = s3 * this.dimensions.css.cell.height + "px", r2.style.top = e3 * this.dimensions.css.cell.height + "px", r2.style.left = `${n2}px`, r2.style.width = `${o2}px`, r2; } handleCursorMove() { } _handleOptionsChanged() { this._updateDimensions(), this._injectCss(this._themeService.colors), this._widthCache.setFont(this._optionsService.rawOptions.fontFamily, this._optionsService.rawOptions.fontSize, this._optionsService.rawOptions.fontWeight, this._optionsService.rawOptions.fontWeightBold), this._setDefaultSpacing(); } clear() { for (let e3 of this._rowElements) e3.replaceChildren(); } renderRows(e3, t3) { let i3 = this._bufferService.buffer, s3 = i3.ybase + i3.y, r2 = Math.min(i3.x, this._bufferService.cols - 1), n2 = this._optionsService.rawOptions.cursorBlink, o2 = this._optionsService.rawOptions.cursorStyle, a2 = this._optionsService.rawOptions.cursorInactiveStyle; for (let h3 = e3; h3 <= t3; h3++) { let e4 = h3 + i3.ydisp, t4 = this._rowElements[h3], c2 = i3.lines.get(e4); if (!t4 || !c2) break; t4.replaceChildren(...this._rowFactory.createRow(c2, e4, e4 === s3, o2, a2, r2, n2, this.dimensions.css.cell.width, this._widthCache, -1, -1)); } } get _terminalSelector() { return `.${v}${this._terminalClass}`; } _handleLinkHover(e3) { this._setCellUnderline(e3.x1, e3.x2, e3.y1, e3.y2, e3.cols, !0); } _handleLinkLeave(e3) { this._setCellUnderline(e3.x1, e3.x2, e3.y1, e3.y2, e3.cols, !1); } _setCellUnderline(e3, t3, i3, s3, r2, n2) { i3 < 0 && (e3 = 0), s3 < 0 && (t3 = 0); let o2 = this._bufferService.rows - 1; i3 = Math.max(Math.min(i3, o2), 0), s3 = Math.max(Math.min(s3, o2), 0), r2 = Math.min(r2, this._bufferService.cols); let a2 = this._bufferService.buffer, h3 = a2.ybase + a2.y, c2 = Math.min(a2.x, r2 - 1), l2 = this._optionsService.rawOptions.cursorBlink, d2 = this._optionsService.rawOptions.cursorStyle, _2 = this._optionsService.rawOptions.cursorInactiveStyle; for (let o3 = i3; o3 <= s3; ++o3) { let u2 = o3 + a2.ydisp, f2 = this._rowElements[o3], v2 = a2.lines.get(u2); if (!f2 || !v2) break; f2.replaceChildren(...this._rowFactory.createRow(v2, u2, u2 === h3, d2, _2, c2, l2, this.dimensions.css.cell.width, this._widthCache, n2 ? o3 === i3 ? e3 : 0 : -1, n2 ? (o3 === s3 ? t3 : r2) - 1 : -1)); } } }; t2.DomRenderer = w = s2([r(7, f.IInstantiationService), r(8, l.ICharSizeService), r(9, f.IOptionsService), r(10, f.IBufferService), r(11, l.ICoreBrowserService), r(12, l.IThemeService)], w); }, 3787: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.DomRendererRowFactory = void 0; let n = i2(2223), o = i2(643), a = i2(511), h2 = i2(2585), c = i2(8055), l = i2(4725), d = i2(4269), _ = i2(6171), u = i2(3734), f = t2.DomRendererRowFactory = class { constructor(e3, t3, i3, s3, r2, n2, o2) { this._document = e3, this._characterJoinerService = t3, this._optionsService = i3, this._coreBrowserService = s3, this._coreService = r2, this._decorationService = n2, this._themeService = o2, this._workCell = new a.CellData(), this._columnSelectMode = !1, this.defaultSpacing = 0; } handleSelectionChanged(e3, t3, i3) { this._selectionStart = e3, this._selectionEnd = t3, this._columnSelectMode = i3; } createRow(e3, t3, i3, s3, r2, a2, h3, l2, _2, f2, p) { let g = [], m = this._characterJoinerService.getJoinedCharacters(t3), S = this._themeService.colors, C, b = e3.getNoBgTrimmedLength(); i3 && b < a2 + 1 && (b = a2 + 1); let w = 0, y = "", E = 0, k = 0, L = 0, D = !1, R = 0, x = !1, A = 0, B = [], T = f2 !== -1 && p !== -1; for (let M = 0; M < b; M++) { e3.loadCell(M, this._workCell); let b2 = this._workCell.getWidth(); if (b2 === 0) continue; let O = !1, P = M, I = this._workCell; if (m.length > 0 && M === m[0][0]) { O = !0; let t4 = m.shift(); I = new d.JoinedCellData(this._workCell, e3.translateToString(!0, t4[0], t4[1]), t4[1] - t4[0]), P = t4[1] - 1, b2 = I.getWidth(); } let H = this._isCellInSelection(M, t3), F = i3 && M === a2, W = T && M >= f2 && M <= p, U = !1; this._decorationService.forEachDecorationAtCell(M, t3, void 0, ((e4) => { U = !0; })); let N = I.getChars() || o.WHITESPACE_CELL_CHAR; if (N === " " && (I.isUnderline() || I.isOverline()) && (N = "\xA0"), A = b2 * l2 - _2.get(N, I.isBold(), I.isItalic()), C) { if (w && (H && x || !H && !x && I.bg === E) && (H && x && S.selectionForeground || I.fg === k) && I.extended.ext === L && W === D && A === R && !F && !O && !U) { I.isInvisible() ? y += o.WHITESPACE_CELL_CHAR : y += N, w++; continue; } w && (C.textContent = y), C = this._document.createElement("span"), w = 0, y = ""; } else C = this._document.createElement("span"); if (E = I.bg, k = I.fg, L = I.extended.ext, D = W, R = A, x = H, O && a2 >= M && a2 <= P && (a2 = M), !this._coreService.isCursorHidden && F && this._coreService.isCursorInitialized) { if (B.push("xterm-cursor"), this._coreBrowserService.isFocused) h3 && B.push("xterm-cursor-blink"), B.push(s3 === "bar" ? "xterm-cursor-bar" : s3 === "underline" ? "xterm-cursor-underline" : "xterm-cursor-block"); else if (r2) switch (r2) { case "outline": B.push("xterm-cursor-outline"); break; case "block": B.push("xterm-cursor-block"); break; case "bar": B.push("xterm-cursor-bar"); break; case "underline": B.push("xterm-cursor-underline"); } } if (I.isBold() && B.push("xterm-bold"), I.isItalic() && B.push("xterm-italic"), I.isDim() && B.push("xterm-dim"), y = I.isInvisible() ? o.WHITESPACE_CELL_CHAR : I.getChars() || o.WHITESPACE_CELL_CHAR, I.isUnderline() && (B.push(`xterm-underline-${I.extended.underlineStyle}`), y === " " && (y = "\xA0"), !I.isUnderlineColorDefault())) if (I.isUnderlineColorRGB()) C.style.textDecorationColor = `rgb(${u.AttributeData.toColorRGB(I.getUnderlineColor()).join(",")})`; else { let e4 = I.getUnderlineColor(); this._optionsService.rawOptions.drawBoldTextInBrightColors && I.isBold() && e4 < 8 && (e4 += 8), C.style.textDecorationColor = S.ansi[e4].css; } I.isOverline() && (B.push("xterm-overline"), y === " " && (y = "\xA0")), I.isStrikethrough() && B.push("xterm-strikethrough"), W && (C.style.textDecoration = "underline"); let $ = I.getFgColor(), j = I.getFgColorMode(), z = I.getBgColor(), K = I.getBgColorMode(), q = !!I.isInverse(); if (q) { let e4 = $; $ = z, z = e4; let t4 = j; j = K, K = t4; } let V, G, X, J = !1; switch (this._decorationService.forEachDecorationAtCell(M, t3, void 0, ((e4) => { e4.options.layer !== "top" && J || (e4.backgroundColorRGB && (K = 50331648, z = e4.backgroundColorRGB.rgba >> 8 & 16777215, V = e4.backgroundColorRGB), e4.foregroundColorRGB && (j = 50331648, $ = e4.foregroundColorRGB.rgba >> 8 & 16777215, G = e4.foregroundColorRGB), J = e4.options.layer === "top"); })), !J && H && (V = this._coreBrowserService.isFocused ? S.selectionBackgroundOpaque : S.selectionInactiveBackgroundOpaque, z = V.rgba >> 8 & 16777215, K = 50331648, J = !0, S.selectionForeground && (j = 50331648, $ = S.selectionForeground.rgba >> 8 & 16777215, G = S.selectionForeground)), J && B.push("xterm-decoration-top"), K) { case 16777216: case 33554432: X = S.ansi[z], B.push(`xterm-bg-${z}`); break; case 50331648: X = c.channels.toColor(z >> 16, z >> 8 & 255, 255 & z), this._addStyle(C, `background-color:#${v((z >>> 0).toString(16), "0", 6)}`); break; default: q ? (X = S.foreground, B.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)) : X = S.background; } switch (V || I.isDim() && (V = c.color.multiplyOpacity(X, 0.5)), j) { case 16777216: case 33554432: I.isBold() && $ < 8 && this._optionsService.rawOptions.drawBoldTextInBrightColors && ($ += 8), this._applyMinimumContrast(C, X, S.ansi[$], I, V, void 0) || B.push(`xterm-fg-${$}`); break; case 50331648: let e4 = c.channels.toColor($ >> 16 & 255, $ >> 8 & 255, 255 & $); this._applyMinimumContrast(C, X, e4, I, V, G) || this._addStyle(C, `color:#${v($.toString(16), "0", 6)}`); break; default: this._applyMinimumContrast(C, X, S.foreground, I, V, G) || q && B.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`); } B.length && (C.className = B.join(" "), B.length = 0), F || O || U ? C.textContent = y : w++, A !== this.defaultSpacing && (C.style.letterSpacing = `${A}px`), g.push(C), M = P; } return C && w && (C.textContent = y), g; } _applyMinimumContrast(e3, t3, i3, s3, r2, n2) { if (this._optionsService.rawOptions.minimumContrastRatio === 1 || (0, _.treatGlyphAsBackgroundColor)(s3.getCode())) return !1; let o2 = this._getContrastCache(s3), a2; if (r2 || n2 || (a2 = o2.getColor(t3.rgba, i3.rgba)), a2 === void 0) { let e4 = this._optionsService.rawOptions.minimumContrastRatio / (s3.isDim() ? 2 : 1); a2 = c.color.ensureContrastRatio(r2 || t3, n2 || i3, e4), o2.setColor((r2 || t3).rgba, (n2 || i3).rgba, a2 ?? null); } return !!a2 && (this._addStyle(e3, `color:${a2.css}`), !0); } _getContrastCache(e3) { return e3.isDim() ? this._themeService.colors.halfContrastCache : this._themeService.colors.contrastCache; } _addStyle(e3, t3) { e3.setAttribute("style", `${e3.getAttribute("style") || ""}${t3};`); } _isCellInSelection(e3, t3) { let i3 = this._selectionStart, s3 = this._selectionEnd; return !(!i3 || !s3) && (this._columnSelectMode ? i3[0] <= s3[0] ? e3 >= i3[0] && t3 >= i3[1] && e3 < s3[0] && t3 <= s3[1] : e3 < i3[0] && t3 >= i3[1] && e3 >= s3[0] && t3 <= s3[1] : t3 > i3[1] && t3 < s3[1] || i3[1] === s3[1] && t3 === i3[1] && e3 >= i3[0] && e3 < s3[0] || i3[1] < s3[1] && t3 === s3[1] && e3 < s3[0] || i3[1] < s3[1] && t3 === i3[1] && e3 >= i3[0]); } }; function v(e3, t3, i3) { for (; e3.length < i3; ) e3 = t3 + e3; return e3; } t2.DomRendererRowFactory = f = s2([r(1, l.ICharacterJoinerService), r(2, h2.IOptionsService), r(3, l.ICoreBrowserService), r(4, h2.ICoreService), r(5, h2.IDecorationService), r(6, l.IThemeService)], f); }, 2550: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.WidthCache = void 0, t2.WidthCache = class { constructor(e3, t3) { this._flat = new Float32Array(256), this._font = "", this._fontSize = 0, this._weight = "normal", this._weightBold = "bold", this._measureElements = [], this._container = e3.createElement("div"), this._container.classList.add("xterm-width-cache-measure-container"), this._container.setAttribute("aria-hidden", "true"), this._container.style.whiteSpace = "pre", this._container.style.fontKerning = "none"; let i2 = e3.createElement("span"); i2.classList.add("xterm-char-measure-element"); let s2 = e3.createElement("span"); s2.classList.add("xterm-char-measure-element"), s2.style.fontWeight = "bold"; let r = e3.createElement("span"); r.classList.add("xterm-char-measure-element"), r.style.fontStyle = "italic"; let n = e3.createElement("span"); n.classList.add("xterm-char-measure-element"), n.style.fontWeight = "bold", n.style.fontStyle = "italic", this._measureElements = [i2, s2, r, n], this._container.appendChild(i2), this._container.appendChild(s2), this._container.appendChild(r), this._container.appendChild(n), t3.appendChild(this._container), this.clear(); } dispose() { this._container.remove(), this._measureElements.length = 0, this._holey = void 0; } clear() { this._flat.fill(-9999), this._holey = /* @__PURE__ */ new Map(); } setFont(e3, t3, i2, s2) { e3 === this._font && t3 === this._fontSize && i2 === this._weight && s2 === this._weightBold || (this._font = e3, this._fontSize = t3, this._weight = i2, this._weightBold = s2, this._container.style.fontFamily = this._font, this._container.style.fontSize = `${this._fontSize}px`, this._measureElements[0].style.fontWeight = `${i2}`, this._measureElements[1].style.fontWeight = `${s2}`, this._measureElements[2].style.fontWeight = `${i2}`, this._measureElements[3].style.fontWeight = `${s2}`, this.clear()); } get(e3, t3, i2) { let s2 = 0; if (!t3 && !i2 && e3.length === 1 && (s2 = e3.charCodeAt(0)) < 256) { if (this._flat[s2] !== -9999) return this._flat[s2]; let t4 = this._measure(e3, 0); return t4 > 0 && (this._flat[s2] = t4), t4; } let r = e3; t3 && (r += "B"), i2 && (r += "I"); let n = this._holey.get(r); if (n === void 0) { let s3 = 0; t3 && (s3 |= 1), i2 && (s3 |= 2), n = this._measure(e3, s3), n > 0 && this._holey.set(r, n); } return n; } _measure(e3, t3) { let i2 = this._measureElements[t3]; return i2.textContent = e3.repeat(32), i2.offsetWidth / 32; } }; }, 2223: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.TEXT_BASELINE = t2.DIM_OPACITY = t2.INVERTED_DEFAULT_COLOR = void 0; let s2 = i2(6114); t2.INVERTED_DEFAULT_COLOR = 257, t2.DIM_OPACITY = 0.5, t2.TEXT_BASELINE = s2.isFirefox || s2.isLegacyEdge ? "bottom" : "ideographic"; }, 6171: (e2, t2) => { function i2(e3) { return 57508 <= e3 && e3 <= 57558; } function s2(e3) { return e3 >= 128512 && e3 <= 128591 || e3 >= 127744 && e3 <= 128511 || e3 >= 128640 && e3 <= 128767 || e3 >= 9728 && e3 <= 9983 || e3 >= 9984 && e3 <= 10175 || e3 >= 65024 && e3 <= 65039 || e3 >= 129280 && e3 <= 129535 || e3 >= 127462 && e3 <= 127487; } Object.defineProperty(t2, "__esModule", { value: !0 }), t2.computeNextVariantOffset = t2.createRenderDimensions = t2.treatGlyphAsBackgroundColor = t2.allowRescaling = t2.isEmoji = t2.isRestrictedPowerlineGlyph = t2.isPowerlineGlyph = t2.throwIfFalsy = void 0, t2.throwIfFalsy = function(e3) { if (!e3) throw new Error("value must not be falsy"); return e3; }, t2.isPowerlineGlyph = i2, t2.isRestrictedPowerlineGlyph = function(e3) { return 57520 <= e3 && e3 <= 57527; }, t2.isEmoji = s2, t2.allowRescaling = function(e3, t3, r, n) { return t3 === 1 && r > Math.ceil(1.5 * n) && e3 !== void 0 && e3 > 255 && !s2(e3) && !i2(e3) && !(function(e4) { return 57344 <= e4 && e4 <= 63743; })(e3); }, t2.treatGlyphAsBackgroundColor = function(e3) { return i2(e3) || (function(e4) { return 9472 <= e4 && e4 <= 9631; })(e3); }, t2.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 } } }; }, t2.computeNextVariantOffset = function(e3, t3, i3 = 0) { return (e3 - (2 * Math.round(t3) - i3)) % (2 * Math.round(t3)); }; }, 6052: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.createSelectionRenderModel = void 0; class i2 { 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(e3, t3, i3, s2 = !1) { if (this.selectionStart = t3, this.selectionEnd = i3, !t3 || !i3 || t3[0] === i3[0] && t3[1] === i3[1]) return void this.clear(); let r = e3.buffers.active.ydisp, n = t3[1] - r, o = i3[1] - r, a = Math.max(n, 0), h2 = Math.min(o, e3.rows - 1); a >= e3.rows || h2 < 0 ? this.clear() : (this.hasSelection = !0, this.columnSelectMode = s2, this.viewportStartRow = n, this.viewportEndRow = o, this.viewportCappedStartRow = a, this.viewportCappedEndRow = h2, this.startCol = t3[0], this.endCol = i3[0]); } isCellSelected(e3, t3, i3) { return !!this.hasSelection && (i3 -= e3.buffer.active.viewportY, this.columnSelectMode ? this.startCol <= this.endCol ? t3 >= this.startCol && i3 >= this.viewportCappedStartRow && t3 < this.endCol && i3 <= this.viewportCappedEndRow : t3 < this.startCol && i3 >= this.viewportCappedStartRow && t3 >= this.endCol && i3 <= this.viewportCappedEndRow : i3 > this.viewportStartRow && i3 < this.viewportEndRow || this.viewportStartRow === this.viewportEndRow && i3 === this.viewportStartRow && t3 >= this.startCol && t3 < this.endCol || this.viewportStartRow < this.viewportEndRow && i3 === this.viewportEndRow && t3 < this.endCol || this.viewportStartRow < this.viewportEndRow && i3 === this.viewportStartRow && t3 >= this.startCol); } } t2.createSelectionRenderModel = function() { return new i2(); }; }, 456: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.SelectionModel = void 0, t2.SelectionModel = class { constructor(e3) { this._bufferService = e3, 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()) { let e3 = this.selectionStart[0] + this.selectionStartLength; return e3 > this._bufferService.cols ? e3 % this._bufferService.cols == 0 ? [this._bufferService.cols, this.selectionStart[1] + Math.floor(e3 / this._bufferService.cols) - 1] : [e3 % this._bufferService.cols, this.selectionStart[1] + Math.floor(e3 / this._bufferService.cols)] : [e3, this.selectionStart[1]]; } if (this.selectionStartLength && this.selectionEnd[1] === this.selectionStart[1]) { let e3 = this.selectionStart[0] + this.selectionStartLength; return e3 > this._bufferService.cols ? [e3 % this._bufferService.cols, this.selectionStart[1] + Math.floor(e3 / this._bufferService.cols)] : [Math.max(e3, this.selectionEnd[0]), this.selectionEnd[1]]; } return this.selectionEnd; } } areSelectionValuesReversed() { let e3 = this.selectionStart, t3 = this.selectionEnd; return !(!e3 || !t3) && (e3[1] > t3[1] || e3[1] === t3[1] && e3[0] > t3[0]); } handleTrim(e3) { return this.selectionStart && (this.selectionStart[1] -= e3), this.selectionEnd && (this.selectionEnd[1] -= e3), this.selectionEnd && this.selectionEnd[1] < 0 ? (this.clearSelection(), !0) : (this.selectionStart && this.selectionStart[1] < 0 && (this.selectionStart[1] = 0), !1); } }; }, 428: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CharSizeService = void 0; let n = i2(2585), o = i2(8460), a = i2(844), h2 = t2.CharSizeService = class extends a.Disposable { get hasValidSize() { return this.width > 0 && this.height > 0; } constructor(e3, t3, i3) { super(), this._optionsService = i3, this.width = 0, this.height = 0, this._onCharSizeChange = this.register(new o.EventEmitter()), this.onCharSizeChange = this._onCharSizeChange.event; try { this._measureStrategy = this.register(new d(this._optionsService)); } catch { this._measureStrategy = this.register(new l(e3, t3, this._optionsService)); } this.register(this._optionsService.onMultipleOptionChange(["fontFamily", "fontSize"], (() => this.measure()))); } measure() { let e3 = this._measureStrategy.measure(); e3.width === this.width && e3.height === this.height || (this.width = e3.width, this.height = e3.height, this._onCharSizeChange.fire()); } }; t2.CharSizeService = h2 = s2([r(2, n.IOptionsService)], h2); class c extends a.Disposable { constructor() { super(...arguments), this._result = { width: 0, height: 0 }; } _validateAndSet(e3, t3) { e3 !== void 0 && e3 > 0 && t3 !== void 0 && t3 > 0 && (this._result.width = e3, this._result.height = t3); } } class l extends c { constructor(e3, t3, i3) { super(), this._document = e3, this._parentElement = t3, this._optionsService = i3, 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 d extends c { constructor(e3) { super(), this._optionsService = e3, this._canvas = new OffscreenCanvas(100, 100), this._ctx = this._canvas.getContext("2d"); let t3 = this._ctx.measureText("W"); if (!("width" in t3 && "fontBoundingBoxAscent" in t3 && "fontBoundingBoxDescent" in t3)) throw new Error("Required font metrics not supported"); } measure() { this._ctx.font = `${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`; let e3 = this._ctx.measureText("W"); return this._validateAndSet(e3.width, e3.fontBoundingBoxAscent + e3.fontBoundingBoxDescent), this._result; } } }, 4269: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CharacterJoinerService = t2.JoinedCellData = void 0; let n = i2(3734), o = i2(643), a = i2(511), h2 = i2(2585); class c extends n.AttributeData { constructor(e3, t3, i3) { super(), this.content = 0, this.combinedData = "", this.fg = e3.fg, this.bg = e3.bg, this.combinedData = t3, this._width = i3; } isCombined() { return 2097152; } getWidth() { return this._width; } getChars() { return this.combinedData; } getCode() { return 2097151; } setFromCharData(e3) { throw new Error("not implemented"); } getAsCharData() { return [this.fg, this.getChars(), this.getWidth(), this.getCode()]; } } t2.JoinedCellData = c; let l = t2.CharacterJoinerService = class e3 { constructor(e4) { this._bufferService = e4, this._characterJoiners = [], this._nextCharacterJoinerId = 0, this._workCell = new a.CellData(); } register(e4) { let t3 = { id: this._nextCharacterJoinerId++, handler: e4 }; return this._characterJoiners.push(t3), t3.id; } deregister(e4) { for (let t3 = 0; t3 < this._characterJoiners.length; t3++) if (this._characterJoiners[t3].id === e4) return this._characterJoiners.splice(t3, 1), !0; return !1; } getJoinedCharacters(e4) { if (this._characterJoiners.length === 0) return []; let t3 = this._bufferService.buffer.lines.get(e4); if (!t3 || t3.length === 0) return []; let i3 = [], s3 = t3.translateToString(!0), r2 = 0, n2 = 0, a2 = 0, h3 = t3.getFg(0), c2 = t3.getBg(0); for (let e5 = 0; e5 < t3.getTrimmedLength(); e5++) if (t3.loadCell(e5, this._workCell), this._workCell.getWidth() !== 0) { if (this._workCell.fg !== h3 || this._workCell.bg !== c2) { if (e5 - r2 > 1) { let e6 = this._getJoinedRanges(s3, a2, n2, t3, r2); for (let t4 = 0; t4 < e6.length; t4++) i3.push(e6[t4]); } r2 = e5, a2 = n2, h3 = this._workCell.fg, c2 = this._workCell.bg; } n2 += this._workCell.getChars().length || o.WHITESPACE_CELL_CHAR.length; } if (this._bufferService.cols - r2 > 1) { let e5 = this._getJoinedRanges(s3, a2, n2, t3, r2); for (let t4 = 0; t4 < e5.length; t4++) i3.push(e5[t4]); } return i3; } _getJoinedRanges(t3, i3, s3, r2, n2) { let o2 = t3.substring(i3, s3), a2 = []; try { a2 = this._characterJoiners[0].handler(o2); } catch (e4) { console.error(e4); } for (let t4 = 1; t4 < this._characterJoiners.length; t4++) try { let i4 = this._characterJoiners[t4].handler(o2); for (let t5 = 0; t5 < i4.length; t5++) e3._mergeRanges(a2, i4[t5]); } catch (e4) { console.error(e4); } return this._stringRangesToCellRanges(a2, r2, n2), a2; } _stringRangesToCellRanges(e4, t3, i3) { let s3 = 0, r2 = !1, n2 = 0, a2 = e4[s3]; if (a2) { for (let h3 = i3; h3 < this._bufferService.cols; h3++) { let i4 = t3.getWidth(h3), c2 = t3.getString(h3).length || o.WHITESPACE_CELL_CHAR.length; if (i4 !== 0) { if (!r2 && a2[0] <= n2 && (a2[0] = h3, r2 = !0), a2[1] <= n2) { if (a2[1] = h3, a2 = e4[++s3], !a2) break; a2[0] <= n2 ? (a2[0] = h3, r2 = !0) : r2 = !1; } n2 += c2; } } a2 && (a2[1] = this._bufferService.cols); } } static _mergeRanges(e4, t3) { let i3 = !1; for (let s3 = 0; s3 < e4.length; s3++) { let r2 = e4[s3]; if (i3) { if (t3[1] <= r2[0]) return e4[s3 - 1][1] = t3[1], e4; if (t3[1] <= r2[1]) return e4[s3 - 1][1] = Math.max(t3[1], r2[1]), e4.splice(s3, 1), e4; e4.splice(s3, 1), s3--; } else { if (t3[1] <= r2[0]) return e4.splice(s3, 0, t3), e4; if (t3[1] <= r2[1]) return r2[0] = Math.min(t3[0], r2[0]), e4; t3[0] < r2[1] && (r2[0] = Math.min(t3[0], r2[0]), i3 = !0); } } return i3 ? e4[e4.length - 1][1] = t3[1] : e4.push(t3), e4; } }; t2.CharacterJoinerService = l = s2([r(0, h2.IBufferService)], l); }, 5114: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CoreBrowserService = void 0; let s2 = i2(844), r = i2(8460), n = i2(3656); class o extends s2.Disposable { constructor(e3, t3, i3) { super(), this._textarea = e3, this._window = t3, this.mainDocument = i3, this._isFocused = !1, this._cachedIsFocused = void 0, this._screenDprMonitor = new a(this._window), this._onDprChange = this.register(new r.EventEmitter()), this.onDprChange = this._onDprChange.event, this._onWindowChange = this.register(new r.EventEmitter()), this.onWindowChange = this._onWindowChange.event, this.register(this.onWindowChange(((e4) => this._screenDprMonitor.setWindow(e4)))), this.register((0, r.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(e3) { this._window !== e3 && (this._window = e3, 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; } } t2.CoreBrowserService = o; class a extends s2.Disposable { constructor(e3) { super(), this._parentWindow = e3, this._windowResizeListener = this.register(new s2.MutableDisposable()), this._onDprChange = this.register(new r.EventEmitter()), this.onDprChange = this._onDprChange.event, this._outerListener = () => this._setDprAndFireIfDiffers(), this._currentDevicePixelRatio = this._parentWindow.devicePixelRatio, this._updateDpr(), this._setWindowResizeListener(), this.register((0, s2.toDisposable)((() => this.clearListener()))); } setWindow(e3) { this._parentWindow = e3, this._setWindowResizeListener(), this._setDprAndFireIfDiffers(); } _setWindowResizeListener() { this._windowResizeListener.value = (0, n.addDisposableDomListener)(this._parentWindow, "resize", (() => this._setDprAndFireIfDiffers())); } _setDprAndFireIfDiffers() { this._parentWindow.devicePixelRatio !== this._currentDevicePixelRatio && this._onDprChange.fire(this._parentWindow.devicePixelRatio), this._updateDpr(); } _updateDpr() { this._outerListener && (this._resolutionMediaMatchList?.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: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.LinkProviderService = void 0; let s2 = i2(844); class r extends s2.Disposable { constructor() { super(), this.linkProviders = [], this.register((0, s2.toDisposable)((() => this.linkProviders.length = 0))); } registerLinkProvider(e3) { return this.linkProviders.push(e3), { dispose: () => { let t3 = this.linkProviders.indexOf(e3); t3 !== -1 && this.linkProviders.splice(t3, 1); } }; } } t2.LinkProviderService = r; }, 8934: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.MouseService = void 0; let n = i2(4725), o = i2(9806), a = t2.MouseService = class { constructor(e3, t3) { this._renderService = e3, this._charSizeService = t3; } getCoords(e3, t3, i3, s3, r2) { return (0, o.getCoords)(window, e3, t3, i3, s3, this._charSizeService.hasValidSize, this._renderService.dimensions.css.cell.width, this._renderService.dimensions.css.cell.height, r2); } getMouseReportCoords(e3, t3) { let i3 = (0, o.getCoordsRelativeToElement)(window, e3, t3); if (this._charSizeService.hasValidSize) return i3[0] = Math.min(Math.max(i3[0], 0), this._renderService.dimensions.css.canvas.width - 1), i3[1] = Math.min(Math.max(i3[1], 0), this._renderService.dimensions.css.canvas.height - 1), { col: Math.floor(i3[0] / this._renderService.dimensions.css.cell.width), row: Math.floor(i3[1] / this._renderService.dimensions.css.cell.height), x: Math.floor(i3[0]), y: Math.floor(i3[1]) }; } }; t2.MouseService = a = s2([r(0, n.IRenderService), r(1, n.ICharSizeService)], a); }, 3230: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.RenderService = void 0; let n = i2(6193), o = i2(4725), a = i2(8460), h2 = i2(844), c = i2(7226), l = i2(2585), d = t2.RenderService = class extends h2.Disposable { get dimensions() { return this._renderer.value.dimensions; } constructor(e3, t3, i3, s3, r2, o2, l2, d2) { super(), this._rowCount = e3, this._charSizeService = s3, this._renderer = this.register(new h2.MutableDisposable()), this._pausedResizeTask = new c.DebouncedIdleTask(), this._observerDisposable = this.register(new h2.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 a.EventEmitter()), this.onDimensionsChange = this._onDimensionsChange.event, this._onRenderedViewportChange = this.register(new a.EventEmitter()), this.onRenderedViewportChange = this._onRenderedViewportChange.event, this._onRender = this.register(new a.EventEmitter()), this.onRender = this._onRender.event, this._onRefreshRequest = this.register(new a.EventEmitter()), this.onRefreshRequest = this._onRefreshRequest.event, this._renderDebouncer = new n.RenderDebouncer(((e4, t4) => this._renderRows(e4, t4)), l2), this.register(this._renderDebouncer), this.register(l2.onDprChange((() => this.handleDevicePixelRatioChange()))), this.register(o2.onResize((() => this._fullRefresh()))), this.register(o2.buffers.onBufferActivate((() => this._renderer.value?.clear()))), this.register(i3.onOptionChange((() => this._handleOptionsChanged()))), this.register(this._charSizeService.onCharSizeChange((() => this.handleCharSizeChanged()))), this.register(r2.onDecorationRegistered((() => this._fullRefresh()))), this.register(r2.onDecorationRemoved((() => this._fullRefresh()))), this.register(i3.onMultipleOptionChange(["customGlyphs", "drawBoldTextInBrightColors", "letterSpacing", "lineHeight", "fontFamily", "fontSize", "fontWeight", "fontWeightBold", "minimumContrastRatio", "rescaleOverlappingGlyphs"], (() => { this.clear(), this.handleResize(o2.cols, o2.rows), this._fullRefresh(); }))), this.register(i3.onMultipleOptionChange(["cursorBlink", "cursorStyle"], (() => this.refreshRows(o2.buffer.y, o2.buffer.y, !0)))), this.register(d2.onChangeColors((() => this._fullRefresh()))), this._registerIntersectionObserver(l2.window, t3), this.register(l2.onWindowChange(((e4) => this._registerIntersectionObserver(e4, t3)))); } _registerIntersectionObserver(e3, t3) { if ("IntersectionObserver" in e3) { let i3 = new e3.IntersectionObserver(((e4) => this._handleIntersectionChange(e4[e4.length - 1])), { threshold: 0 }); i3.observe(t3), this._observerDisposable.value = (0, h2.toDisposable)((() => i3.disconnect())); } } _handleIntersectionChange(e3) { this._isPaused = e3.isIntersecting === void 0 ? e3.intersectionRatio === 0 : !e3.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(e3, t3, i3 = !1) { this._isPaused ? this._needsFullRefresh = !0 : (i3 || (this._isNextRenderRedrawOnly = !1), this._renderDebouncer.refresh(e3, t3, this._rowCount)); } _renderRows(e3, t3) { this._renderer.value && (e3 = Math.min(e3, this._rowCount - 1), t3 = Math.min(t3, this._rowCount - 1), this._renderer.value.renderRows(e3, t3), this._needsSelectionRefresh && (this._renderer.value.handleSelectionChanged(this._selectionState.start, this._selectionState.end, this._selectionState.columnSelectMode), this._needsSelectionRefresh = !1), this._isNextRenderRedrawOnly || this._onRenderedViewportChange.fire({ start: e3, end: t3 }), this._onRender.fire({ start: e3, end: t3 }), this._isNextRenderRedrawOnly = !0); } resize(e3, t3) { this._rowCount = t3, 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(e3) { this._renderer.value = e3, this._renderer.value && (this._renderer.value.onRequestRedraw(((e4) => this.refreshRows(e4.start, e4.end, !0))), this._needsSelectionRefresh = !0, this._fullRefresh()); } addRefreshCallback(e3) { return this._renderDebouncer.addRefreshCallback(e3); } _fullRefresh() { this._isPaused ? this._needsFullRefresh = !0 : this.refreshRows(0, this._rowCount - 1); } clearTextureAtlas() { this._renderer.value && (this._renderer.value.clearTextureAtlas?.(), this._fullRefresh()); } handleDevicePixelRatioChange() { this._charSizeService.measure(), this._renderer.value && (this._renderer.value.handleDevicePixelRatioChange(), this.refreshRows(0, this._rowCount - 1)); } handleResize(e3, t3) { this._renderer.value && (this._isPaused ? this._pausedResizeTask.set((() => this._renderer.value?.handleResize(e3, t3))) : this._renderer.value.handleResize(e3, t3), this._fullRefresh()); } handleCharSizeChanged() { this._renderer.value?.handleCharSizeChanged(); } handleBlur() { this._renderer.value?.handleBlur(); } handleFocus() { this._renderer.value?.handleFocus(); } handleSelectionChanged(e3, t3, i3) { this._selectionState.start = e3, this._selectionState.end = t3, this._selectionState.columnSelectMode = i3, this._renderer.value?.handleSelectionChanged(e3, t3, i3); } handleCursorMove() { this._renderer.value?.handleCursorMove(); } clear() { this._renderer.value?.clear(); } }; t2.RenderService = d = s2([r(2, l.IOptionsService), r(3, o.ICharSizeService), r(4, l.IDecorationService), r(5, l.IBufferService), r(6, o.ICoreBrowserService), r(7, o.IThemeService)], d); }, 9312: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.SelectionService = void 0; let n = i2(9806), o = i2(9504), a = i2(456), h2 = i2(4725), c = i2(8460), l = i2(844), d = i2(6114), _ = i2(4841), u = i2(511), f = i2(2585), v = "\xA0", p = new RegExp(v, "g"), g = t2.SelectionService = class extends l.Disposable { constructor(e3, t3, i3, s3, r2, n2, o2, h3, d2) { super(), this._element = e3, this._screenElement = t3, this._linkifier = i3, this._bufferService = s3, this._coreService = r2, this._mouseService = n2, this._optionsService = o2, this._renderService = h3, this._coreBrowserService = d2, this._dragScrollAmount = 0, this._enabled = !0, this._workCell = new u.CellData(), this._mouseDownTimeStamp = 0, this._oldHasSelection = !1, this._oldSelectionStart = void 0, this._oldSelectionEnd = void 0, this._onLinuxMouseSelection = this.register(new c.EventEmitter()), this.onLinuxMouseSelection = this._onLinuxMouseSelection.event, this._onRedrawRequest = this.register(new c.EventEmitter()), this.onRequestRedraw = this._onRedrawRequest.event, this._onSelectionChange = this.register(new c.EventEmitter()), this.onSelectionChange = this._onSelectionChange.event, this._onRequestScrollLines = this.register(new c.EventEmitter()), this.onRequestScrollLines = this._onRequestScrollLines.event, this._mouseMoveListener = (e4) => this._handleMouseMove(e4), this._mouseUpListener = (e4) => this._handleMouseUp(e4), this._coreService.onUserInput((() => { this.hasSelection && this.clearSelection(); })), this._trimListener = this._bufferService.buffer.lines.onTrim(((e4) => this._handleTrim(e4))), this.register(this._bufferService.buffers.onBufferActivate(((e4) => this._handleBufferActivate(e4)))), this.enable(), this._model = new a.SelectionModel(this._bufferService), this._activeSelectionMode = 0, this.register((0, l.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() { let e3 = this._model.finalSelectionStart, t3 = this._model.finalSelectionEnd; return !(!e3 || !t3 || e3[0] === t3[0] && e3[1] === t3[1]); } get selectionText() { let e3 = this._model.finalSelectionStart, t3 = this._model.finalSelectionEnd; if (!e3 || !t3) return ""; let i3 = this._bufferService.buffer, s3 = []; if (this._activeSelectionMode === 3) { if (e3[0] === t3[0]) return ""; let r2 = e3[0] < t3[0] ? e3[0] : t3[0], n2 = e3[0] < t3[0] ? t3[0] : e3[0]; for (let o2 = e3[1]; o2 <= t3[1]; o2++) { let e4 = i3.translateBufferLineToString(o2, !0, r2, n2); s3.push(e4); } } else { let r2 = e3[1] === t3[1] ? t3[0] : void 0; s3.push(i3.translateBufferLineToString(e3[1], !0, e3[0], r2)); for (let r3 = e3[1] + 1; r3 <= t3[1] - 1; r3++) { let e4 = i3.lines.get(r3), t4 = i3.translateBufferLineToString(r3, !0); e4?.isWrapped ? s3[s3.length - 1] += t4 : s3.push(t4); } if (e3[1] !== t3[1]) { let e4 = i3.lines.get(t3[1]), r3 = i3.translateBufferLineToString(t3[1], !0, 0, t3[0]); e4 && e4.isWrapped ? s3[s3.length - 1] += r3 : s3.push(r3); } } return s3.map(((e4) => e4.replace(p, " "))).join(d.isWindows ? `\r ` : ` `); } clearSelection() { this._model.clearSelection(), this._removeMouseDownListeners(), this.refresh(), this._onSelectionChange.fire(); } refresh(e3) { this._refreshAnimationFrame || (this._refreshAnimationFrame = this._coreBrowserService.window.requestAnimationFrame((() => this._refresh()))), d.isLinux && e3 && 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(e3) { let t3 = this._getMouseBufferCoords(e3), i3 = this._model.finalSelectionStart, s3 = this._model.finalSelectionEnd; return !!(i3 && s3 && t3) && this._areCoordsInSelection(t3, i3, s3); } isCellInSelection(e3, t3) { let i3 = this._model.finalSelectionStart, s3 = this._model.finalSelectionEnd; return !(!i3 || !s3) && this._areCoordsInSelection([e3, t3], i3, s3); } _areCoordsInSelection(e3, t3, i3) { return e3[1] > t3[1] && e3[1] < i3[1] || t3[1] === i3[1] && e3[1] === t3[1] && e3[0] >= t3[0] && e3[0] < i3[0] || t3[1] < i3[1] && e3[1] === i3[1] && e3[0] < i3[0] || t3[1] < i3[1] && e3[1] === t3[1] && e3[0] >= t3[0]; } _selectWordAtCursor(e3, t3) { let i3 = this._linkifier.currentLink?.link?.range; if (i3) return this._model.selectionStart = [i3.start.x - 1, i3.start.y - 1], this._model.selectionStartLength = (0, _.getRangeLength)(i3, this._bufferService.cols), this._model.selectionEnd = void 0, !0; let s3 = this._getMouseBufferCoords(e3); return !!s3 && (this._selectWordAt(s3, t3), this._model.selectionEnd = void 0, !0); } selectAll() { this._model.isSelectAllActive = !0, this.refresh(), this._onSelectionChange.fire(); } selectLines(e3, t3) { this._model.clearSelection(), e3 = Math.max(e3, 0), t3 = Math.min(t3, this._bufferService.buffer.lines.length - 1), this._model.selectionStart = [0, e3], this._model.selectionEnd = [this._bufferService.cols, t3], this.refresh(), this._onSelectionChange.fire(); } _handleTrim(e3) { this._model.handleTrim(e3) && this.refresh(); } _getMouseBufferCoords(e3) { let t3 = this._mouseService.getCoords(e3, this._screenElement, this._bufferService.cols, this._bufferService.rows, !0); if (t3) return t3[0]--, t3[1]--, t3[1] += this._bufferService.buffer.ydisp, t3; } _getMouseEventScrollAmount(e3) { let t3 = (0, n.getCoordsRelativeToElement)(this._coreBrowserService.window, e3, this._screenElement)[1], i3 = this._renderService.dimensions.css.canvas.height; return t3 >= 0 && t3 <= i3 ? 0 : (t3 > i3 && (t3 -= i3), t3 = Math.min(Math.max(t3, -50), 50), t3 /= 50, t3 / Math.abs(t3) + Math.round(14 * t3)); } shouldForceSelection(e3) { return d.isMac ? e3.altKey && this._optionsService.rawOptions.macOptionClickForcesSelection : e3.shiftKey; } handleMouseDown(e3) { if (this._mouseDownTimeStamp = e3.timeStamp, (e3.button !== 2 || !this.hasSelection) && e3.button === 0) { if (!this._enabled) { if (!this.shouldForceSelection(e3)) return; e3.stopPropagation(); } e3.preventDefault(), this._dragScrollAmount = 0, this._enabled && e3.shiftKey ? this._handleIncrementalClick(e3) : e3.detail === 1 ? this._handleSingleClick(e3) : e3.detail === 2 ? this._handleDoubleClick(e3) : e3.detail === 3 && this._handleTripleClick(e3), 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(e3) { this._model.selectionStart && (this._model.selectionEnd = this._getMouseBufferCoords(e3)); } _handleSingleClick(e3) { if (this._model.selectionStartLength = 0, this._model.isSelectAllActive = !1, this._activeSelectionMode = this.shouldColumnSelect(e3) ? 3 : 0, this._model.selectionStart = this._getMouseBufferCoords(e3), !this._model.selectionStart) return; this._model.selectionEnd = void 0; let t3 = this._bufferService.buffer.lines.get(this._model.selectionStart[1]); t3 && t3.length !== this._model.selectionStart[0] && t3.hasWidth(this._model.selectionStart[0]) === 0 && this._model.selectionStart[0]++; } _handleDoubleClick(e3) { this._selectWordAtCursor(e3, !0) && (this._activeSelectionMode = 1); } _handleTripleClick(e3) { let t3 = this._getMouseBufferCoords(e3); t3 && (this._activeSelectionMode = 2, this._selectLineAt(t3[1])); } shouldColumnSelect(e3) { return e3.altKey && !(d.isMac && this._optionsService.rawOptions.macOptionClickForcesSelection); } _handleMouseMove(e3) { if (e3.stopImmediatePropagation(), !this._model.selectionStart) return; let t3 = this._model.selectionEnd ? [this._model.selectionEnd[0], this._model.selectionEnd[1]] : null; if (this._model.selectionEnd = this._getMouseBufferCoords(e3), !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(e3), this._activeSelectionMode !== 3 && (this._dragScrollAmount > 0 ? this._model.selectionEnd[0] = this._bufferService.cols : this._dragScrollAmount < 0 && (this._model.selectionEnd[0] = 0)); let i3 = this._bufferService.buffer; if (this._model.selectionEnd[1] < i3.lines.length) { let e4 = i3.lines.get(this._model.selectionEnd[1]); e4 && e4.hasWidth(this._model.selectionEnd[0]) === 0 && this._model.selectionEnd[0] < this._bufferService.cols && this._model.selectionEnd[0]++; } t3 && t3[0] === this._model.selectionEnd[0] && t3[1] === this._model.selectionEnd[1] || this.refresh(!0); } _dragScroll() { if (this._model.selectionEnd && this._model.selectionStart && this._dragScrollAmount) { this._onRequestScrollLines.fire({ amount: this._dragScrollAmount, suppressScrollEvent: !1 }); let e3 = this._bufferService.buffer; this._dragScrollAmount > 0 ? (this._activeSelectionMode !== 3 && (this._model.selectionEnd[0] = this._bufferService.cols), this._model.selectionEnd[1] = Math.min(e3.ydisp + this._bufferService.rows, e3.lines.length - 1)) : (this._activeSelectionMode !== 3 && (this._model.selectionEnd[0] = 0), this._model.selectionEnd[1] = e3.ydisp), this.refresh(); } } _handleMouseUp(e3) { let t3 = e3.timeStamp - this._mouseDownTimeStamp; if (this._removeMouseDownListeners(), this.selectionText.length <= 1 && t3 < 500 && e3.altKey && this._optionsService.rawOptions.altClickMovesCursor) { if (this._bufferService.buffer.ybase === this._bufferService.buffer.ydisp) { let t4 = this._mouseService.getCoords(e3, this._element, this._bufferService.cols, this._bufferService.rows, !1); if (t4 && t4[0] !== void 0 && t4[1] !== void 0) { let e4 = (0, o.moveToCellSequence)(t4[0] - 1, t4[1] - 1, this._bufferService, this._coreService.decPrivateModes.applicationCursorKeys); this._coreService.triggerDataEvent(e4, !0); } } } else this._fireEventIfSelectionChanged(); } _fireEventIfSelectionChanged() { let e3 = this._model.finalSelectionStart, t3 = this._model.finalSelectionEnd, i3 = !(!e3 || !t3 || e3[0] === t3[0] && e3[1] === t3[1]); i3 ? e3 && t3 && (this._oldSelectionStart && this._oldSelectionEnd && e3[0] === this._oldSelectionStart[0] && e3[1] === this._oldSelectionStart[1] && t3[0] === this._oldSelectionEnd[0] && t3[1] === this._oldSelectionEnd[1] || this._fireOnSelectionChange(e3, t3, i3)) : this._oldHasSelection && this._fireOnSelectionChange(e3, t3, i3); } _fireOnSelectionChange(e3, t3, i3) { this._oldSelectionStart = e3, this._oldSelectionEnd = t3, this._oldHasSelection = i3, this._onSelectionChange.fire(); } _handleBufferActivate(e3) { this.clearSelection(), this._trimListener.dispose(), this._trimListener = e3.activeBuffer.lines.onTrim(((e4) => this._handleTrim(e4))); } _convertViewportColToCharacterIndex(e3, t3) { let i3 = t3; for (let s3 = 0; t3 >= s3; s3++) { let r2 = e3.loadCell(s3, this._workCell).getChars().length; this._workCell.getWidth() === 0 ? i3-- : r2 > 1 && t3 !== s3 && (i3 += r2 - 1); } return i3; } setSelection(e3, t3, i3) { this._model.clearSelection(), this._removeMouseDownListeners(), this._model.selectionStart = [e3, t3], this._model.selectionStartLength = i3, this.refresh(), this._fireEventIfSelectionChanged(); } rightClickSelect(e3) { this._isClickInSelection(e3) || (this._selectWordAtCursor(e3, !1) && this.refresh(!0), this._fireEventIfSelectionChanged()); } _getWordAt(e3, t3, i3 = !0, s3 = !0) { if (e3[0] >= this._bufferService.cols) return; let r2 = this._bufferService.buffer, n2 = r2.lines.get(e3[1]); if (!n2) return; let o2 = r2.translateBufferLineToString(e3[1], !1), a2 = this._convertViewportColToCharacterIndex(n2, e3[0]), h3 = a2, c2 = e3[0] - a2, l2 = 0, d2 = 0, _2 = 0, u2 = 0; if (o2.charAt(a2) === " ") { for (; a2 > 0 && o2.charAt(a2 - 1) === " "; ) a2--; for (; h3 < o2.length && o2.charAt(h3 + 1) === " "; ) h3++; } else { let t4 = e3[0], i4 = e3[0]; n2.getWidth(t4) === 0 && (l2++, t4--), n2.getWidth(i4) === 2 && (d2++, i4++); let s4 = n2.getString(i4).length; for (s4 > 1 && (u2 += s4 - 1, h3 += s4 - 1); t4 > 0 && a2 > 0 && !this._isCharWordSeparator(n2.loadCell(t4 - 1, this._workCell)); ) { n2.loadCell(t4 - 1, this._workCell); let e4 = this._workCell.getChars().length; this._workCell.getWidth() === 0 ? (l2++, t4--) : e4 > 1 && (_2 += e4 - 1, a2 -= e4 - 1), a2--, t4--; } for (; i4 < n2.length && h3 + 1 < o2.length && !this._isCharWordSeparator(n2.loadCell(i4 + 1, this._workCell)); ) { n2.loadCell(i4 + 1, this._workCell); let e4 = this._workCell.getChars().length; this._workCell.getWidth() === 2 ? (d2++, i4++) : e4 > 1 && (u2 += e4 - 1, h3 += e4 - 1), h3++, i4++; } } h3++; let f2 = a2 + c2 - l2 + _2, v2 = Math.min(this._bufferService.cols, h3 - a2 + l2 + d2 - _2 - u2); if (t3 || o2.slice(a2, h3).trim() !== "") { if (i3 && f2 === 0 && n2.getCodePoint(0) !== 32) { let t4 = r2.lines.get(e3[1] - 1); if (t4 && n2.isWrapped && t4.getCodePoint(this._bufferService.cols - 1) !== 32) { let t5 = this._getWordAt([this._bufferService.cols - 1, e3[1] - 1], !1, !0, !1); if (t5) { let e4 = this._bufferService.cols - t5.start; f2 -= e4, v2 += e4; } } } if (s3 && f2 + v2 === this._bufferService.cols && n2.getCodePoint(this._bufferService.cols - 1) !== 32) { let t4 = r2.lines.get(e3[1] + 1); if (t4?.isWrapped && t4.getCodePoint(0) !== 32) { let t5 = this._getWordAt([0, e3[1] + 1], !1, !1, !0); t5 && (v2 += t5.length); } } return { start: f2, length: v2 }; } } _selectWordAt(e3, t3) { let i3 = this._getWordAt(e3, t3); if (i3) { for (; i3.start < 0; ) i3.start += this._bufferService.cols, e3[1]--; this._model.selectionStart = [i3.start, e3[1]], this._model.selectionStartLength = i3.length; } } _selectToWordAt(e3) { let t3 = this._getWordAt(e3, !0); if (t3) { let i3 = e3[1]; for (; t3.start < 0; ) t3.start += this._bufferService.cols, i3--; if (!this._model.areSelectionValuesReversed()) for (; t3.start + t3.length > this._bufferService.cols; ) t3.length -= this._bufferService.cols, i3++; this._model.selectionEnd = [this._model.areSelectionValuesReversed() ? t3.start : t3.start + t3.length, i3]; } } _isCharWordSeparator(e3) { return e3.getWidth() !== 0 && this._optionsService.rawOptions.wordSeparator.indexOf(e3.getChars()) >= 0; } _selectLineAt(e3) { let t3 = this._bufferService.buffer.getWrappedRangeForLine(e3), i3 = { start: { x: 0, y: t3.first }, end: { x: this._bufferService.cols - 1, y: t3.last } }; this._model.selectionStart = [0, t3.first], this._model.selectionEnd = void 0, this._model.selectionStartLength = (0, _.getRangeLength)(i3, this._bufferService.cols); } }; t2.SelectionService = g = s2([r(3, f.IBufferService), r(4, f.ICoreService), r(5, h2.IMouseService), r(6, f.IOptionsService), r(7, h2.IRenderService), r(8, h2.ICoreBrowserService)], g); }, 4725: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.ILinkProviderService = t2.IThemeService = t2.ICharacterJoinerService = t2.ISelectionService = t2.IRenderService = t2.IMouseService = t2.ICoreBrowserService = t2.ICharSizeService = void 0; let s2 = i2(8343); t2.ICharSizeService = (0, s2.createDecorator)("CharSizeService"), t2.ICoreBrowserService = (0, s2.createDecorator)("CoreBrowserService"), t2.IMouseService = (0, s2.createDecorator)("MouseService"), t2.IRenderService = (0, s2.createDecorator)("RenderService"), t2.ISelectionService = (0, s2.createDecorator)("SelectionService"), t2.ICharacterJoinerService = (0, s2.createDecorator)("CharacterJoinerService"), t2.IThemeService = (0, s2.createDecorator)("ThemeService"), t2.ILinkProviderService = (0, s2.createDecorator)("LinkProviderService"); }, 6731: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.ThemeService = t2.DEFAULT_ANSI_COLORS = void 0; let n = i2(7239), o = i2(8055), a = i2(8460), h2 = i2(844), c = i2(2585), l = o.css.toColor("#ffffff"), d = o.css.toColor("#000000"), _ = o.css.toColor("#ffffff"), u = o.css.toColor("#000000"), f = { css: "rgba(255, 255, 255, 0.3)", rgba: 4294967117 }; t2.DEFAULT_ANSI_COLORS = Object.freeze((() => { let e3 = [o.css.toColor("#2e3436"), o.css.toColor("#cc0000"), o.css.toColor("#4e9a06"), o.css.toColor("#c4a000"), o.css.toColor("#3465a4"), o.css.toColor("#75507b"), o.css.toColor("#06989a"), o.css.toColor("#d3d7cf"), o.css.toColor("#555753"), o.css.toColor("#ef2929"), o.css.toColor("#8ae234"), o.css.toColor("#fce94f"), o.css.toColor("#729fcf"), o.css.toColor("#ad7fa8"), o.css.toColor("#34e2e2"), o.css.toColor("#eeeeec")], t3 = [0, 95, 135, 175, 215, 255]; for (let i3 = 0; i3 < 216; i3++) { let s3 = t3[i3 / 36 % 6 | 0], r2 = t3[i3 / 6 % 6 | 0], n2 = t3[i3 % 6]; e3.push({ css: o.channels.toCss(s3, r2, n2), rgba: o.channels.toRgba(s3, r2, n2) }); } for (let t4 = 0; t4 < 24; t4++) { let i3 = 8 + 10 * t4; e3.push({ css: o.channels.toCss(i3, i3, i3), rgba: o.channels.toRgba(i3, i3, i3) }); } return e3; })()); let v = t2.ThemeService = class extends h2.Disposable { get colors() { return this._colors; } constructor(e3) { super(), this._optionsService = e3, this._contrastCache = new n.ColorContrastCache(), this._halfContrastCache = new n.ColorContrastCache(), this._onChangeColors = this.register(new a.EventEmitter()), this.onChangeColors = this._onChangeColors.event, this._colors = { foreground: l, background: d, cursor: _, cursorAccent: u, selectionForeground: void 0, selectionBackgroundTransparent: f, selectionBackgroundOpaque: o.color.blend(d, f), selectionInactiveBackgroundTransparent: f, selectionInactiveBackgroundOpaque: o.color.blend(d, f), ansi: t2.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(e3 = {}) { let i3 = this._colors; if (i3.foreground = p(e3.foreground, l), i3.background = p(e3.background, d), i3.cursor = p(e3.cursor, _), i3.cursorAccent = p(e3.cursorAccent, u), i3.selectionBackgroundTransparent = p(e3.selectionBackground, f), i3.selectionBackgroundOpaque = o.color.blend(i3.background, i3.selectionBackgroundTransparent), i3.selectionInactiveBackgroundTransparent = p(e3.selectionInactiveBackground, i3.selectionBackgroundTransparent), i3.selectionInactiveBackgroundOpaque = o.color.blend(i3.background, i3.selectionInactiveBackgroundTransparent), i3.selectionForeground = e3.selectionForeground ? p(e3.selectionForeground, o.NULL_COLOR) : void 0, i3.selectionForeground === o.NULL_COLOR && (i3.selectionForeground = void 0), o.color.isOpaque(i3.selectionBackgroundTransparent) && (i3.selectionBackgroundTransparent = o.color.opacity(i3.selectionBackgroundTransparent, 0.3)), o.color.isOpaque(i3.selectionInactiveBackgroundTransparent) && (i3.selectionInactiveBackgroundTransparent = o.color.opacity(i3.selectionInactiveBackgroundTransparent, 0.3)), i3.ansi = t2.DEFAULT_ANSI_COLORS.slice(), i3.ansi[0] = p(e3.black, t2.DEFAULT_ANSI_COLORS[0]), i3.ansi[1] = p(e3.red, t2.DEFAULT_ANSI_COLORS[1]), i3.ansi[2] = p(e3.green, t2.DEFAULT_ANSI_COLORS[2]), i3.ansi[3] = p(e3.yellow, t2.DEFAULT_ANSI_COLORS[3]), i3.ansi[4] = p(e3.blue, t2.DEFAULT_ANSI_COLORS[4]), i3.ansi[5] = p(e3.magenta, t2.DEFAULT_ANSI_COLORS[5]), i3.ansi[6] = p(e3.cyan, t2.DEFAULT_ANSI_COLORS[6]), i3.ansi[7] = p(e3.white, t2.DEFAULT_ANSI_COLORS[7]), i3.ansi[8] = p(e3.brightBlack, t2.DEFAULT_ANSI_COLORS[8]), i3.ansi[9] = p(e3.brightRed, t2.DEFAULT_ANSI_COLORS[9]), i3.ansi[10] = p(e3.brightGreen, t2.DEFAULT_ANSI_COLORS[10]), i3.ansi[11] = p(e3.brightYellow, t2.DEFAULT_ANSI_COLORS[11]), i3.ansi[12] = p(e3.brightBlue, t2.DEFAULT_ANSI_COLORS[12]), i3.ansi[13] = p(e3.brightMagenta, t2.DEFAULT_ANSI_COLORS[13]), i3.ansi[14] = p(e3.brightCyan, t2.DEFAULT_ANSI_COLORS[14]), i3.ansi[15] = p(e3.brightWhite, t2.DEFAULT_ANSI_COLORS[15]), e3.extendedAnsi) { let s3 = Math.min(i3.ansi.length - 16, e3.extendedAnsi.length); for (let r2 = 0; r2 < s3; r2++) i3.ansi[r2 + 16] = p(e3.extendedAnsi[r2], t2.DEFAULT_ANSI_COLORS[r2 + 16]); } this._contrastCache.clear(), this._halfContrastCache.clear(), this._updateRestoreColors(), this._onChangeColors.fire(this.colors); } restoreColor(e3) { this._restoreColor(e3), this._onChangeColors.fire(this.colors); } _restoreColor(e3) { if (e3 !== void 0) switch (e3) { 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[e3] = this._restoreColors.ansi[e3]; } else for (let e4 = 0; e4 < this._restoreColors.ansi.length; ++e4) this._colors.ansi[e4] = this._restoreColors.ansi[e4]; } modifyColors(e3) { e3(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 p(e3, t3) { if (e3 !== void 0) try { return o.css.toColor(e3); } catch { } return t3; } t2.ThemeService = v = s2([r(0, c.IOptionsService)], v); }, 6349: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CircularList = void 0; let s2 = i2(8460), r = i2(844); class n extends r.Disposable { constructor(e3) { super(), this._maxLength = e3, this.onDeleteEmitter = this.register(new s2.EventEmitter()), this.onDelete = this.onDeleteEmitter.event, this.onInsertEmitter = this.register(new s2.EventEmitter()), this.onInsert = this.onInsertEmitter.event, this.onTrimEmitter = this.register(new s2.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(e3) { if (this._maxLength === e3) return; let t3 = new Array(e3); for (let i3 = 0; i3 < Math.min(e3, this.length); i3++) t3[i3] = this._array[this._getCyclicIndex(i3)]; this._array = t3, this._maxLength = e3, this._startIndex = 0; } get length() { return this._length; } set length(e3) { if (e3 > this._length) for (let t3 = this._length; t3 < e3; t3++) this._array[t3] = void 0; this._length = e3; } get(e3) { return this._array[this._getCyclicIndex(e3)]; } set(e3, t3) { this._array[this._getCyclicIndex(e3)] = t3; } push(e3) { this._array[this._getCyclicIndex(this._length)] = e3, 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(e3, t3, ...i3) { if (t3) { for (let i4 = e3; i4 < this._length - t3; i4++) this._array[this._getCyclicIndex(i4)] = this._array[this._getCyclicIndex(i4 + t3)]; this._length -= t3, this.onDeleteEmitter.fire({ index: e3, amount: t3 }); } for (let t4 = this._length - 1; t4 >= e3; t4--) this._array[this._getCyclicIndex(t4 + i3.length)] = this._array[this._getCyclicIndex(t4)]; for (let t4 = 0; t4 < i3.length; t4++) this._array[this._getCyclicIndex(e3 + t4)] = i3[t4]; if (i3.length && this.onInsertEmitter.fire({ index: e3, amount: i3.length }), this._length + i3.length > this._maxLength) { let e4 = this._length + i3.length - this._maxLength; this._startIndex += e4, this._length = this._maxLength, this.onTrimEmitter.fire(e4); } else this._length += i3.length; } trimStart(e3) { e3 > this._length && (e3 = this._length), this._startIndex += e3, this._length -= e3, this.onTrimEmitter.fire(e3); } shiftElements(e3, t3, i3) { if (!(t3 <= 0)) { if (e3 < 0 || e3 >= this._length) throw new Error("start argument out of range"); if (e3 + i3 < 0) throw new Error("Cannot shift elements in list beyond index 0"); if (i3 > 0) { for (let s4 = t3 - 1; s4 >= 0; s4--) this.set(e3 + s4 + i3, this.get(e3 + s4)); let s3 = e3 + t3 + i3 - this._length; if (s3 > 0) for (this._length += s3; this._length > this._maxLength; ) this._length--, this._startIndex++, this.onTrimEmitter.fire(1); } else for (let s3 = 0; s3 < t3; s3++) this.set(e3 + s3 + i3, this.get(e3 + s3)); } } _getCyclicIndex(e3) { return (this._startIndex + e3) % this._maxLength; } } t2.CircularList = n; }, 1439: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.clone = void 0, t2.clone = function e3(t3, i2 = 5) { if (typeof t3 != "object") return t3; let s2 = Array.isArray(t3) ? [] : {}; for (let r in t3) s2[r] = i2 <= 1 ? t3[r] : t3[r] && e3(t3[r], i2 - 1); return s2; }; }, 8055: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.contrastRatio = t2.toPaddedHex = t2.rgba = t2.rgb = t2.css = t2.color = t2.channels = t2.NULL_COLOR = void 0; let i2 = 0, s2 = 0, r = 0, n = 0; var o, a, h2, c, l; function d(e3) { let t3 = e3.toString(16); return t3.length < 2 ? "0" + t3 : t3; } function _(e3, t3) { return e3 < t3 ? (t3 + 0.05) / (e3 + 0.05) : (e3 + 0.05) / (t3 + 0.05); } t2.NULL_COLOR = { css: "#00000000", rgba: 0 }, (function(e3) { e3.toCss = function(e4, t3, i3, s3) { return s3 !== void 0 ? `#${d(e4)}${d(t3)}${d(i3)}${d(s3)}` : `#${d(e4)}${d(t3)}${d(i3)}`; }, e3.toRgba = function(e4, t3, i3, s3 = 255) { return (e4 << 24 | t3 << 16 | i3 << 8 | s3) >>> 0; }, e3.toColor = function(t3, i3, s3, r2) { return { css: e3.toCss(t3, i3, s3, r2), rgba: e3.toRgba(t3, i3, s3, r2) }; }; })(o || (t2.channels = o = {})), (function(e3) { function t3(e4, t4) { return n = Math.round(255 * t4), [i2, s2, r] = l.toChannels(e4.rgba), { css: o.toCss(i2, s2, r, n), rgba: o.toRgba(i2, s2, r, n) }; } e3.blend = function(e4, t4) { if (n = (255 & t4.rgba) / 255, n === 1) return { css: t4.css, rgba: t4.rgba }; let a2 = t4.rgba >> 24 & 255, h3 = t4.rgba >> 16 & 255, c2 = t4.rgba >> 8 & 255, l2 = e4.rgba >> 24 & 255, d2 = e4.rgba >> 16 & 255, _2 = e4.rgba >> 8 & 255; return i2 = l2 + Math.round((a2 - l2) * n), s2 = d2 + Math.round((h3 - d2) * n), r = _2 + Math.round((c2 - _2) * n), { css: o.toCss(i2, s2, r), rgba: o.toRgba(i2, s2, r) }; }, e3.isOpaque = function(e4) { return (255 & e4.rgba) == 255; }, e3.ensureContrastRatio = function(e4, t4, i3) { let s3 = l.ensureContrastRatio(e4.rgba, t4.rgba, i3); if (s3) return o.toColor(s3 >> 24 & 255, s3 >> 16 & 255, s3 >> 8 & 255); }, e3.opaque = function(e4) { let t4 = (255 | e4.rgba) >>> 0; return [i2, s2, r] = l.toChannels(t4), { css: o.toCss(i2, s2, r), rgba: t4 }; }, e3.opacity = t3, e3.multiplyOpacity = function(e4, i3) { return n = 255 & e4.rgba, t3(e4, n * i3 / 255); }, e3.toColorRGB = function(e4) { return [e4.rgba >> 24 & 255, e4.rgba >> 16 & 255, e4.rgba >> 8 & 255]; }; })(a || (t2.color = a = {})), (function(e3) { let t3, a2; try { let e4 = document.createElement("canvas"); e4.width = 1, e4.height = 1; let i3 = e4.getContext("2d", { willReadFrequently: !0 }); i3 && (t3 = i3, t3.globalCompositeOperation = "copy", a2 = t3.createLinearGradient(0, 0, 1, 1)); } catch { } e3.toColor = function(e4) { if (e4.match(/#[\da-f]{3,8}/i)) switch (e4.length) { case 4: return i2 = parseInt(e4.slice(1, 2).repeat(2), 16), s2 = parseInt(e4.slice(2, 3).repeat(2), 16), r = parseInt(e4.slice(3, 4).repeat(2), 16), o.toColor(i2, s2, r); case 5: return i2 = parseInt(e4.slice(1, 2).repeat(2), 16), s2 = parseInt(e4.slice(2, 3).repeat(2), 16), r = parseInt(e4.slice(3, 4).repeat(2), 16), n = parseInt(e4.slice(4, 5).repeat(2), 16), o.toColor(i2, s2, r, n); case 7: return { css: e4, rgba: (parseInt(e4.slice(1), 16) << 8 | 255) >>> 0 }; case 9: return { css: e4, rgba: parseInt(e4.slice(1), 16) >>> 0 }; } let h3 = e4.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/); if (h3) return i2 = parseInt(h3[1]), s2 = parseInt(h3[2]), r = parseInt(h3[3]), n = Math.round(255 * (h3[5] === void 0 ? 1 : parseFloat(h3[5]))), o.toColor(i2, s2, r, n); if (!t3 || !a2) throw new Error("css.toColor: Unsupported css format"); if (t3.fillStyle = a2, t3.fillStyle = e4, typeof t3.fillStyle != "string") throw new Error("css.toColor: Unsupported css format"); if (t3.fillRect(0, 0, 1, 1), [i2, s2, r, n] = t3.getImageData(0, 0, 1, 1).data, n !== 255) throw new Error("css.toColor: Unsupported css format"); return { rgba: o.toRgba(i2, s2, r, n), css: e4 }; }; })(h2 || (t2.css = h2 = {})), (function(e3) { function t3(e4, t4, i3) { let s3 = e4 / 255, r2 = t4 / 255, n2 = i3 / 255; return 0.2126 * (s3 <= 0.03928 ? s3 / 12.92 : Math.pow((s3 + 0.055) / 1.055, 2.4)) + 0.7152 * (r2 <= 0.03928 ? r2 / 12.92 : Math.pow((r2 + 0.055) / 1.055, 2.4)) + 0.0722 * (n2 <= 0.03928 ? n2 / 12.92 : Math.pow((n2 + 0.055) / 1.055, 2.4)); } e3.relativeLuminance = function(e4) { return t3(e4 >> 16 & 255, e4 >> 8 & 255, 255 & e4); }, e3.relativeLuminance2 = t3; })(c || (t2.rgb = c = {})), (function(e3) { function t3(e4, t4, i3) { let s3 = e4 >> 24 & 255, r2 = e4 >> 16 & 255, n2 = e4 >> 8 & 255, o2 = t4 >> 24 & 255, a3 = t4 >> 16 & 255, h3 = t4 >> 8 & 255, l2 = _(c.relativeLuminance2(o2, a3, h3), c.relativeLuminance2(s3, r2, n2)); for (; l2 < i3 && (o2 > 0 || a3 > 0 || h3 > 0); ) o2 -= Math.max(0, Math.ceil(0.1 * o2)), a3 -= Math.max(0, Math.ceil(0.1 * a3)), h3 -= Math.max(0, Math.ceil(0.1 * h3)), l2 = _(c.relativeLuminance2(o2, a3, h3), c.relativeLuminance2(s3, r2, n2)); return (o2 << 24 | a3 << 16 | h3 << 8 | 255) >>> 0; } function a2(e4, t4, i3) { let s3 = e4 >> 24 & 255, r2 = e4 >> 16 & 255, n2 = e4 >> 8 & 255, o2 = t4 >> 24 & 255, a3 = t4 >> 16 & 255, h3 = t4 >> 8 & 255, l2 = _(c.relativeLuminance2(o2, a3, h3), c.relativeLuminance2(s3, r2, n2)); for (; l2 < i3 && (o2 < 255 || a3 < 255 || h3 < 255); ) o2 = Math.min(255, o2 + Math.ceil(0.1 * (255 - o2))), a3 = Math.min(255, a3 + Math.ceil(0.1 * (255 - a3))), h3 = Math.min(255, h3 + Math.ceil(0.1 * (255 - h3))), l2 = _(c.relativeLuminance2(o2, a3, h3), c.relativeLuminance2(s3, r2, n2)); return (o2 << 24 | a3 << 16 | h3 << 8 | 255) >>> 0; } e3.blend = function(e4, t4) { if (n = (255 & t4) / 255, n === 1) return t4; let a3 = t4 >> 24 & 255, h3 = t4 >> 16 & 255, c2 = t4 >> 8 & 255, l2 = e4 >> 24 & 255, d2 = e4 >> 16 & 255, _2 = e4 >> 8 & 255; return i2 = l2 + Math.round((a3 - l2) * n), s2 = d2 + Math.round((h3 - d2) * n), r = _2 + Math.round((c2 - _2) * n), o.toRgba(i2, s2, r); }, e3.ensureContrastRatio = function(e4, i3, s3) { let r2 = c.relativeLuminance(e4 >> 8), n2 = c.relativeLuminance(i3 >> 8); if (_(r2, n2) < s3) { if (n2 < r2) { let n3 = t3(e4, i3, s3), o3 = _(r2, c.relativeLuminance(n3 >> 8)); if (o3 < s3) { let t4 = a2(e4, i3, s3); return o3 > _(r2, c.relativeLuminance(t4 >> 8)) ? n3 : t4; } return n3; } let o2 = a2(e4, i3, s3), h3 = _(r2, c.relativeLuminance(o2 >> 8)); if (h3 < s3) { let n3 = t3(e4, i3, s3); return h3 > _(r2, c.relativeLuminance(n3 >> 8)) ? o2 : n3; } return o2; } }, e3.reduceLuminance = t3, e3.increaseLuminance = a2, e3.toChannels = function(e4) { return [e4 >> 24 & 255, e4 >> 16 & 255, e4 >> 8 & 255, 255 & e4]; }; })(l || (t2.rgba = l = {})), t2.toPaddedHex = d, t2.contrastRatio = _; }, 8969: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CoreTerminal = void 0; let s2 = i2(844), r = i2(2585), n = i2(4348), o = i2(7866), a = i2(744), h2 = i2(7302), c = i2(6975), l = i2(8460), d = i2(1753), _ = i2(1480), u = i2(7994), f = i2(9282), v = i2(5435), p = i2(5981), g = i2(2660), m = !1; class S extends s2.Disposable { get onScroll() { return this._onScrollApi || (this._onScrollApi = this.register(new l.EventEmitter()), this._onScroll.event(((e3) => { this._onScrollApi?.fire(e3.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(e3) { for (let t3 in e3) this.optionsService.options[t3] = e3[t3]; } constructor(e3) { super(), this._windowsWrappingHeuristics = this.register(new s2.MutableDisposable()), this._onBinary = this.register(new l.EventEmitter()), this.onBinary = this._onBinary.event, this._onData = this.register(new l.EventEmitter()), this.onData = this._onData.event, this._onLineFeed = this.register(new l.EventEmitter()), this.onLineFeed = this._onLineFeed.event, this._onResize = this.register(new l.EventEmitter()), this.onResize = this._onResize.event, this._onWriteParsed = this.register(new l.EventEmitter()), this.onWriteParsed = this._onWriteParsed.event, this._onScroll = this.register(new l.EventEmitter()), this._instantiationService = new n.InstantiationService(), this.optionsService = this.register(new h2.OptionsService(e3)), this._instantiationService.setService(r.IOptionsService, this.optionsService), this._bufferService = this.register(this._instantiationService.createInstance(a.BufferService)), this._instantiationService.setService(r.IBufferService, this._bufferService), this._logService = this.register(this._instantiationService.createInstance(o.LogService)), this._instantiationService.setService(r.ILogService, this._logService), this.coreService = this.register(this._instantiationService.createInstance(c.CoreService)), this._instantiationService.setService(r.ICoreService, this.coreService), this.coreMouseService = this.register(this._instantiationService.createInstance(d.CoreMouseService)), this._instantiationService.setService(r.ICoreMouseService, this.coreMouseService), this.unicodeService = this.register(this._instantiationService.createInstance(_.UnicodeService)), this._instantiationService.setService(r.IUnicodeService, this.unicodeService), this._charsetService = this._instantiationService.createInstance(u.CharsetService), this._instantiationService.setService(r.ICharsetService, this._charsetService), this._oscLinkService = this._instantiationService.createInstance(g.OscLinkService), this._instantiationService.setService(r.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, l.forwardEvent)(this._inputHandler.onLineFeed, this._onLineFeed)), this.register(this._inputHandler), this.register((0, l.forwardEvent)(this._bufferService.onResize, this._onResize)), this.register((0, l.forwardEvent)(this.coreService.onData, this._onData)), this.register((0, l.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(((e4) => { 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(((e4) => { 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 p.WriteBuffer(((e4, t3) => this._inputHandler.parse(e4, t3)))), this.register((0, l.forwardEvent)(this._writeBuffer.onWriteParsed, this._onWriteParsed)); } write(e3, t3) { this._writeBuffer.write(e3, t3); } writeSync(e3, t3) { this._logService.logLevel <= r.LogLevelEnum.WARN && !m && (this._logService.warn("writeSync is unreliable and will be removed soon."), m = !0), this._writeBuffer.writeSync(e3, t3); } input(e3, t3 = !0) { this.coreService.triggerDataEvent(e3, t3); } resize(e3, t3) { isNaN(e3) || isNaN(t3) || (e3 = Math.max(e3, a.MINIMUM_COLS), t3 = Math.max(t3, a.MINIMUM_ROWS), this._bufferService.resize(e3, t3)); } scroll(e3, t3 = !1) { this._bufferService.scroll(e3, t3); } scrollLines(e3, t3, i3) { this._bufferService.scrollLines(e3, t3, i3); } scrollPages(e3) { this.scrollLines(e3 * (this.rows - 1)); } scrollToTop() { this.scrollLines(-this._bufferService.buffer.ydisp); } scrollToBottom() { this.scrollLines(this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp); } scrollToLine(e3) { let t3 = e3 - this._bufferService.buffer.ydisp; t3 !== 0 && this.scrollLines(t3); } registerEscHandler(e3, t3) { return this._inputHandler.registerEscHandler(e3, t3); } registerDcsHandler(e3, t3) { return this._inputHandler.registerDcsHandler(e3, t3); } registerCsiHandler(e3, t3) { return this._inputHandler.registerCsiHandler(e3, t3); } registerOscHandler(e3, t3) { return this._inputHandler.registerOscHandler(e3, t3); } _setup() { this._handleWindowsPtyOptionChange(); } reset() { this._inputHandler.reset(), this._bufferService.reset(), this._charsetService.reset(), this.coreService.reset(), this.coreMouseService.reset(); } _handleWindowsPtyOptionChange() { let e3 = !1, t3 = this.optionsService.rawOptions.windowsPty; t3 && t3.buildNumber !== void 0 && t3.buildNumber !== void 0 ? e3 = t3.backend === "conpty" && t3.buildNumber < 21376 : this.optionsService.rawOptions.windowsMode && (e3 = !0), e3 ? this._enableWindowsWrappingHeuristics() : this._windowsWrappingHeuristics.clear(); } _enableWindowsWrappingHeuristics() { if (!this._windowsWrappingHeuristics.value) { let e3 = []; e3.push(this.onLineFeed(f.updateWindowsModeWrappedState.bind(null, this._bufferService))), e3.push(this.registerCsiHandler({ final: "H" }, (() => ((0, f.updateWindowsModeWrappedState)(this._bufferService), !1)))), this._windowsWrappingHeuristics.value = (0, s2.toDisposable)((() => { for (let t3 of e3) t3.dispose(); })); } } } t2.CoreTerminal = S; }, 8460: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.runAndSubscribe = t2.forwardEvent = t2.EventEmitter = void 0, t2.EventEmitter = class { constructor() { this._listeners = [], this._disposed = !1; } get event() { return this._event || (this._event = (e3) => (this._listeners.push(e3), { dispose: () => { if (!this._disposed) { for (let t3 = 0; t3 < this._listeners.length; t3++) if (this._listeners[t3] === e3) return void this._listeners.splice(t3, 1); } } })), this._event; } fire(e3, t3) { let i2 = []; for (let e4 = 0; e4 < this._listeners.length; e4++) i2.push(this._listeners[e4]); for (let s2 = 0; s2 < i2.length; s2++) i2[s2].call(void 0, e3, t3); } dispose() { this.clearListeners(), this._disposed = !0; } clearListeners() { this._listeners && (this._listeners.length = 0); } }, t2.forwardEvent = function(e3, t3) { return e3(((e4) => t3.fire(e4))); }, t2.runAndSubscribe = function(e3, t3) { return t3(void 0), e3(((e4) => t3(e4))); }; }, 5435: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.InputHandler = t2.WindowsOptionsReportType = void 0; let n = i2(2584), o = i2(7116), a = i2(2015), h2 = i2(844), c = i2(482), l = i2(8437), d = i2(8460), _ = i2(643), u = i2(511), f = i2(3734), v = i2(2585), p = i2(1480), g = i2(6242), m = i2(6351), S = i2(5941), C = { "(": 0, ")": 1, "*": 2, "+": 3, "-": 1, ".": 2 }, b = 131072; function w(e3, t3) { if (e3 > 24) return t3.setWinLines || !1; switch (e3) { case 1: return !!t3.restoreWin; case 2: return !!t3.minimizeWin; case 3: return !!t3.setWinPosition; case 4: return !!t3.setWinSizePixels; case 5: return !!t3.raiseWin; case 6: return !!t3.lowerWin; case 7: return !!t3.refreshWin; case 8: return !!t3.setWinSizeChars; case 9: return !!t3.maximizeWin; case 10: return !!t3.fullscreenWin; case 11: return !!t3.getWinState; case 13: return !!t3.getWinPosition; case 14: return !!t3.getWinSizePixels; case 15: return !!t3.getScreenSizePixels; case 16: return !!t3.getCellSizePixels; case 18: return !!t3.getWinSizeChars; case 19: return !!t3.getScreenSizeChars; case 20: return !!t3.getIconTitle; case 21: return !!t3.getWinTitle; case 22: return !!t3.pushTitle; case 23: return !!t3.popTitle; case 24: return !!t3.setWinLines; } return !1; } var y; (function(e3) { e3[e3.GET_WIN_SIZE_PIXELS = 0] = "GET_WIN_SIZE_PIXELS", e3[e3.GET_CELL_SIZE_PIXELS = 1] = "GET_CELL_SIZE_PIXELS"; })(y || (t2.WindowsOptionsReportType = y = {})); let E = 0; class k extends h2.Disposable { getAttrData() { return this._curAttrData; } constructor(e3, t3, i3, s3, r2, h3, _2, f2, v2 = new a.EscapeSequenceParser()) { super(), this._bufferService = e3, this._charsetService = t3, this._coreService = i3, this._logService = s3, this._optionsService = r2, this._oscLinkService = h3, this._coreMouseService = _2, this._unicodeService = f2, this._parser = v2, this._parseBuffer = new Uint32Array(4096), this._stringDecoder = new c.StringToUtf32(), this._utf8Decoder = new c.Utf8ToUtf32(), this._workCell = new u.CellData(), this._windowTitle = "", this._iconName = "", this._windowTitleStack = [], this._iconNameStack = [], this._curAttrData = l.DEFAULT_ATTR_DATA.clone(), this._eraseAttrDataInternal = l.DEFAULT_ATTR_DATA.clone(), this._onRequestBell = this.register(new d.EventEmitter()), this.onRequestBell = this._onRequestBell.event, this._onRequestRefreshRows = this.register(new d.EventEmitter()), this.onRequestRefreshRows = this._onRequestRefreshRows.event, this._onRequestReset = this.register(new d.EventEmitter()), this.onRequestReset = this._onRequestReset.event, this._onRequestSendFocus = this.register(new d.EventEmitter()), this.onRequestSendFocus = this._onRequestSendFocus.event, this._onRequestSyncScrollBar = this.register(new d.EventEmitter()), this.onRequestSyncScrollBar = this._onRequestSyncScrollBar.event, this._onRequestWindowsOptionsReport = this.register(new d.EventEmitter()), this.onRequestWindowsOptionsReport = this._onRequestWindowsOptionsReport.event, this._onA11yChar = this.register(new d.EventEmitter()), this.onA11yChar = this._onA11yChar.event, this._onA11yTab = this.register(new d.EventEmitter()), this.onA11yTab = this._onA11yTab.event, this._onCursorMove = this.register(new d.EventEmitter()), this.onCursorMove = this._onCursorMove.event, this._onLineFeed = this.register(new d.EventEmitter()), this.onLineFeed = this._onLineFeed.event, this._onScroll = this.register(new d.EventEmitter()), this.onScroll = this._onScroll.event, this._onTitleChange = this.register(new d.EventEmitter()), this.onTitleChange = this._onTitleChange.event, this._onColor = this.register(new d.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 L(this._bufferService), this._activeBuffer = this._bufferService.buffer, this.register(this._bufferService.buffers.onBufferActivate(((e4) => this._activeBuffer = e4.activeBuffer))), this._parser.setCsiHandlerFallback(((e4, t4) => { this._logService.debug("Unknown CSI code: ", { identifier: this._parser.identToString(e4), params: t4.toArray() }); })), this._parser.setEscHandlerFallback(((e4) => { this._logService.debug("Unknown ESC code: ", { identifier: this._parser.identToString(e4) }); })), this._parser.setExecuteHandlerFallback(((e4) => { this._logService.debug("Unknown EXECUTE code: ", { code: e4 }); })), this._parser.setOscHandlerFallback(((e4, t4, i4) => { this._logService.debug("Unknown OSC code: ", { identifier: e4, action: t4, data: i4 }); })), this._parser.setDcsHandlerFallback(((e4, t4, i4) => { t4 === "HOOK" && (i4 = i4.toArray()), this._logService.debug("Unknown DCS code: ", { identifier: this._parser.identToString(e4), action: t4, payload: i4 }); })), this._parser.setPrintHandler(((e4, t4, i4) => this.print(e4, t4, i4))), this._parser.registerCsiHandler({ final: "@" }, ((e4) => this.insertChars(e4))), this._parser.registerCsiHandler({ intermediates: " ", final: "@" }, ((e4) => this.scrollLeft(e4))), this._parser.registerCsiHandler({ final: "A" }, ((e4) => this.cursorUp(e4))), this._parser.registerCsiHandler({ intermediates: " ", final: "A" }, ((e4) => this.scrollRight(e4))), this._parser.registerCsiHandler({ final: "B" }, ((e4) => this.cursorDown(e4))), this._parser.registerCsiHandler({ final: "C" }, ((e4) => this.cursorForward(e4))), this._parser.registerCsiHandler({ final: "D" }, ((e4) => this.cursorBackward(e4))), this._parser.registerCsiHandler({ final: "E" }, ((e4) => this.cursorNextLine(e4))), this._parser.registerCsiHandler({ final: "F" }, ((e4) => this.cursorPrecedingLine(e4))), this._parser.registerCsiHandler({ final: "G" }, ((e4) => this.cursorCharAbsolute(e4))), this._parser.registerCsiHandler({ final: "H" }, ((e4) => this.cursorPosition(e4))), this._parser.registerCsiHandler({ final: "I" }, ((e4) => this.cursorForwardTab(e4))), this._parser.registerCsiHandler({ final: "J" }, ((e4) => this.eraseInDisplay(e4, !1))), this._parser.registerCsiHandler({ prefix: "?", final: "J" }, ((e4) => this.eraseInDisplay(e4, !0))), this._parser.registerCsiHandler({ final: "K" }, ((e4) => this.eraseInLine(e4, !1))), this._parser.registerCsiHandler({ prefix: "?", final: "K" }, ((e4) => this.eraseInLine(e4, !0))), this._parser.registerCsiHandler({ final: "L" }, ((e4) => this.insertLines(e4))), this._parser.registerCsiHandler({ final: "M" }, ((e4) => this.deleteLines(e4))), this._parser.registerCsiHandler({ final: "P" }, ((e4) => this.deleteChars(e4))), this._parser.registerCsiHandler({ final: "S" }, ((e4) => this.scrollUp(e4))), this._parser.registerCsiHandler({ final: "T" }, ((e4) => this.scrollDown(e4))), this._parser.registerCsiHandler({ final: "X" }, ((e4) => this.eraseChars(e4))), this._parser.registerCsiHandler({ final: "Z" }, ((e4) => this.cursorBackwardTab(e4))), this._parser.registerCsiHandler({ final: "`" }, ((e4) => this.charPosAbsolute(e4))), this._parser.registerCsiHandler({ final: "a" }, ((e4) => this.hPositionRelative(e4))), this._parser.registerCsiHandler({ final: "b" }, ((e4) => this.repeatPrecedingCharacter(e4))), this._parser.registerCsiHandler({ final: "c" }, ((e4) => this.sendDeviceAttributesPrimary(e4))), this._parser.registerCsiHandler({ prefix: ">", final: "c" }, ((e4) => this.sendDeviceAttributesSecondary(e4))), this._parser.registerCsiHandler({ final: "d" }, ((e4) => this.linePosAbsolute(e4))), this._parser.registerCsiHandler({ final: "e" }, ((e4) => this.vPositionRelative(e4))), this._parser.registerCsiHandler({ final: "f" }, ((e4) => this.hVPosition(e4))), this._parser.registerCsiHandler({ final: "g" }, ((e4) => this.tabClear(e4))), this._parser.registerCsiHandler({ final: "h" }, ((e4) => this.setMode(e4))), this._parser.registerCsiHandler({ prefix: "?", final: "h" }, ((e4) => this.setModePrivate(e4))), this._parser.registerCsiHandler({ final: "l" }, ((e4) => this.resetMode(e4))), this._parser.registerCsiHandler({ prefix: "?", final: "l" }, ((e4) => this.resetModePrivate(e4))), this._parser.registerCsiHandler({ final: "m" }, ((e4) => this.charAttributes(e4))), this._parser.registerCsiHandler({ final: "n" }, ((e4) => this.deviceStatus(e4))), this._parser.registerCsiHandler({ prefix: "?", final: "n" }, ((e4) => this.deviceStatusPrivate(e4))), this._parser.registerCsiHandler({ intermediates: "!", final: "p" }, ((e4) => this.softReset(e4))), this._parser.registerCsiHandler({ intermediates: " ", final: "q" }, ((e4) => this.setCursorStyle(e4))), this._parser.registerCsiHandler({ final: "r" }, ((e4) => this.setScrollRegion(e4))), this._parser.registerCsiHandler({ final: "s" }, ((e4) => this.saveCursor(e4))), this._parser.registerCsiHandler({ final: "t" }, ((e4) => this.windowOptions(e4))), this._parser.registerCsiHandler({ final: "u" }, ((e4) => this.restoreCursor(e4))), this._parser.registerCsiHandler({ intermediates: "'", final: "}" }, ((e4) => this.insertColumns(e4))), this._parser.registerCsiHandler({ intermediates: "'", final: "~" }, ((e4) => this.deleteColumns(e4))), this._parser.registerCsiHandler({ intermediates: '"', final: "q" }, ((e4) => this.selectProtected(e4))), this._parser.registerCsiHandler({ intermediates: "$", final: "p" }, ((e4) => this.requestMode(e4, !0))), this._parser.registerCsiHandler({ prefix: "?", intermediates: "$", final: "p" }, ((e4) => this.requestMode(e4, !1))), this._parser.setExecuteHandler(n.C0.BEL, (() => this.bell())), this._parser.setExecuteHandler(n.C0.LF, (() => this.lineFeed())), this._parser.setExecuteHandler(n.C0.VT, (() => this.lineFeed())), this._parser.setExecuteHandler(n.C0.FF, (() => this.lineFeed())), this._parser.setExecuteHandler(n.C0.CR, (() => this.carriageReturn())), this._parser.setExecuteHandler(n.C0.BS, (() => this.backspace())), this._parser.setExecuteHandler(n.C0.HT, (() => this.tab())), this._parser.setExecuteHandler(n.C0.SO, (() => this.shiftOut())), this._parser.setExecuteHandler(n.C0.SI, (() => this.shiftIn())), this._parser.setExecuteHandler(n.C1.IND, (() => this.index())), this._parser.setExecuteHandler(n.C1.NEL, (() => this.nextLine())), this._parser.setExecuteHandler(n.C1.HTS, (() => this.tabSet())), this._parser.registerOscHandler(0, new g.OscHandler(((e4) => (this.setTitle(e4), this.setIconName(e4), !0)))), this._parser.registerOscHandler(1, new g.OscHandler(((e4) => this.setIconName(e4)))), this._parser.registerOscHandler(2, new g.OscHandler(((e4) => this.setTitle(e4)))), this._parser.registerOscHandler(4, new g.OscHandler(((e4) => this.setOrReportIndexedColor(e4)))), this._parser.registerOscHandler(8, new g.OscHandler(((e4) => this.setHyperlink(e4)))), this._parser.registerOscHandler(10, new g.OscHandler(((e4) => this.setOrReportFgColor(e4)))), this._parser.registerOscHandler(11, new g.OscHandler(((e4) => this.setOrReportBgColor(e4)))), this._parser.registerOscHandler(12, new g.OscHandler(((e4) => this.setOrReportCursorColor(e4)))), this._parser.registerOscHandler(104, new g.OscHandler(((e4) => this.restoreIndexedColor(e4)))), this._parser.registerOscHandler(110, new g.OscHandler(((e4) => this.restoreFgColor(e4)))), this._parser.registerOscHandler(111, new g.OscHandler(((e4) => this.restoreBgColor(e4)))), this._parser.registerOscHandler(112, new g.OscHandler(((e4) => this.restoreCursorColor(e4)))), this._parser.registerEscHandler({ final: "7" }, (() => this.saveCursor())), this._parser.registerEscHandler({ final: "8" }, (() => this.restoreCursor())), this._parser.registerEscHandler({ final: "D" }, (() => this.index())), this._parser.registerEscHandler({ final: "E" }, (() => this.nextLine())), this._parser.registerEscHandler({ final: "H" }, (() => this.tabSet())), this._parser.registerEscHandler({ final: "M" }, (() => this.reverseIndex())), this._parser.registerEscHandler({ final: "=" }, (() => this.keypadApplicationMode())), this._parser.registerEscHandler({ final: ">" }, (() => this.keypadNumericMode())), this._parser.registerEscHandler({ final: "c" }, (() => this.fullReset())), this._parser.registerEscHandler({ final: "n" }, (() => this.setgLevel(2))), this._parser.registerEscHandler({ final: "o" }, (() => this.setgLevel(3))), this._parser.registerEscHandler({ final: "|" }, (() => this.setgLevel(3))), this._parser.registerEscHandler({ final: "}" }, (() => this.setgLevel(2))), this._parser.registerEscHandler({ final: "~" }, (() => this.setgLevel(1))), this._parser.registerEscHandler({ intermediates: "%", final: "@" }, (() => this.selectDefaultCharset())), this._parser.registerEscHandler({ intermediates: "%", final: "G" }, (() => this.selectDefaultCharset())); for (let e4 in o.CHARSETS) this._parser.registerEscHandler({ intermediates: "(", final: e4 }, (() => this.selectCharset("(" + e4))), this._parser.registerEscHandler({ intermediates: ")", final: e4 }, (() => this.selectCharset(")" + e4))), this._parser.registerEscHandler({ intermediates: "*", final: e4 }, (() => this.selectCharset("*" + e4))), this._parser.registerEscHandler({ intermediates: "+", final: e4 }, (() => this.selectCharset("+" + e4))), this._parser.registerEscHandler({ intermediates: "-", final: e4 }, (() => this.selectCharset("-" + e4))), this._parser.registerEscHandler({ intermediates: ".", final: e4 }, (() => this.selectCharset("." + e4))), this._parser.registerEscHandler({ intermediates: "/", final: e4 }, (() => this.selectCharset("/" + e4))); this._parser.registerEscHandler({ intermediates: "#", final: "8" }, (() => this.screenAlignmentPattern())), this._parser.setErrorHandler(((e4) => (this._logService.error("Parsing error: ", e4), e4))), this._parser.registerDcsHandler({ intermediates: "$", final: "q" }, new m.DcsHandler(((e4, t4) => this.requestStatusString(e4, t4)))); } _preserveStack(e3, t3, i3, s3) { this._parseStack.paused = !0, this._parseStack.cursorStartX = e3, this._parseStack.cursorStartY = t3, this._parseStack.decodedLength = i3, this._parseStack.position = s3; } _logSlowResolvingAsync(e3) { this._logService.logLevel <= v.LogLevelEnum.WARN && Promise.race([e3, new Promise(((e4, t3) => setTimeout((() => t3("#SLOW_TIMEOUT")), 5e3)))]).catch(((e4) => { if (e4 !== "#SLOW_TIMEOUT") throw e4; console.warn("async parser handler taking longer than 5000 ms"); })); } _getCurrentLinkId() { return this._curAttrData.extended.urlId; } parse(e3, t3) { let i3, s3 = this._activeBuffer.x, r2 = this._activeBuffer.y, n2 = 0, o2 = this._parseStack.paused; if (o2) { if (i3 = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, t3)) return this._logSlowResolvingAsync(i3), i3; s3 = this._parseStack.cursorStartX, r2 = this._parseStack.cursorStartY, this._parseStack.paused = !1, e3.length > b && (n2 = this._parseStack.position + b); } if (this._logService.logLevel <= v.LogLevelEnum.DEBUG && this._logService.debug("parsing data" + (typeof e3 == "string" ? ` "${e3}"` : ` "${Array.prototype.map.call(e3, ((e4) => String.fromCharCode(e4))).join("")}"`), typeof e3 == "string" ? e3.split("").map(((e4) => e4.charCodeAt(0))) : e3), this._parseBuffer.length < e3.length && this._parseBuffer.length < b && (this._parseBuffer = new Uint32Array(Math.min(e3.length, b))), o2 || this._dirtyRowTracker.clearRange(), e3.length > b) for (let t4 = n2; t4 < e3.length; t4 += b) { let n3 = t4 + b < e3.length ? t4 + b : e3.length, o3 = typeof e3 == "string" ? this._stringDecoder.decode(e3.substring(t4, n3), this._parseBuffer) : this._utf8Decoder.decode(e3.subarray(t4, n3), this._parseBuffer); if (i3 = this._parser.parse(this._parseBuffer, o3)) return this._preserveStack(s3, r2, o3, t4), this._logSlowResolvingAsync(i3), i3; } else if (!o2) { let t4 = typeof e3 == "string" ? this._stringDecoder.decode(e3, this._parseBuffer) : this._utf8Decoder.decode(e3, this._parseBuffer); if (i3 = this._parser.parse(this._parseBuffer, t4)) return this._preserveStack(s3, r2, t4, 0), this._logSlowResolvingAsync(i3), i3; } this._activeBuffer.x === s3 && this._activeBuffer.y === r2 || this._onCursorMove.fire(); let a2 = this._dirtyRowTracker.end + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp), h3 = this._dirtyRowTracker.start + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp); h3 < this._bufferService.rows && this._onRequestRefreshRows.fire(Math.min(h3, this._bufferService.rows - 1), Math.min(a2, this._bufferService.rows - 1)); } print(e3, t3, i3) { let s3, r2, n2 = this._charsetService.charset, o2 = this._optionsService.rawOptions.screenReaderMode, a2 = this._bufferService.cols, h3 = this._coreService.decPrivateModes.wraparound, d2 = this._coreService.modes.insertMode, u2 = this._curAttrData, f2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._activeBuffer.x && i3 - t3 > 0 && f2.getWidth(this._activeBuffer.x - 1) === 2 && f2.setCellFromCodepoint(this._activeBuffer.x - 1, 0, 1, u2); let v2 = this._parser.precedingJoinState; for (let g2 = t3; g2 < i3; ++g2) { if (s3 = e3[g2], s3 < 127 && n2) { let e4 = n2[String.fromCharCode(s3)]; e4 && (s3 = e4.charCodeAt(0)); } let t4 = this._unicodeService.charProperties(s3, v2); r2 = p.UnicodeService.extractWidth(t4); let i4 = p.UnicodeService.extractShouldJoin(t4), m2 = i4 ? p.UnicodeService.extractWidth(v2) : 0; if (v2 = t4, o2 && this._onA11yChar.fire((0, c.stringFromCodePoint)(s3)), this._getCurrentLinkId() && this._oscLinkService.addLineToLink(this._getCurrentLinkId(), this._activeBuffer.ybase + this._activeBuffer.y), this._activeBuffer.x + r2 - m2 > a2) { if (h3) { let e4 = f2, t5 = this._activeBuffer.x - m2; for (this._activeBuffer.x = m2, 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), f2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y), m2 > 0 && f2 instanceof l.BufferLine && f2.copyCellsFrom(e4, t5, 0, m2, !1); t5 < a2; ) e4.setCellFromCodepoint(t5++, 0, 1, u2); } else if (this._activeBuffer.x = a2 - 1, r2 === 2) continue; } if (i4 && this._activeBuffer.x) { let e4 = f2.getWidth(this._activeBuffer.x - 1) ? 1 : 2; f2.addCodepointToCell(this._activeBuffer.x - e4, s3, r2); for (let e5 = r2 - m2; --e5 >= 0; ) f2.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, u2); } else if (d2 && (f2.insertCells(this._activeBuffer.x, r2 - m2, this._activeBuffer.getNullCell(u2)), f2.getWidth(a2 - 1) === 2 && f2.setCellFromCodepoint(a2 - 1, _.NULL_CELL_CODE, _.NULL_CELL_WIDTH, u2)), f2.setCellFromCodepoint(this._activeBuffer.x++, s3, r2, u2), r2 > 0) for (; --r2; ) f2.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, u2); } this._parser.precedingJoinState = v2, this._activeBuffer.x < a2 && i3 - t3 > 0 && f2.getWidth(this._activeBuffer.x) === 0 && !f2.hasContent(this._activeBuffer.x) && f2.setCellFromCodepoint(this._activeBuffer.x, 0, 1, u2), this._dirtyRowTracker.markDirty(this._activeBuffer.y); } registerCsiHandler(e3, t3) { return e3.final !== "t" || e3.prefix || e3.intermediates ? this._parser.registerCsiHandler(e3, t3) : this._parser.registerCsiHandler(e3, ((e4) => !w(e4.params[0], this._optionsService.rawOptions.windowOptions) || t3(e4))); } registerDcsHandler(e3, t3) { return this._parser.registerDcsHandler(e3, new m.DcsHandler(t3)); } registerEscHandler(e3, t3) { return this._parser.registerEscHandler(e3, t3); } registerOscHandler(e3, t3) { return this._parser.registerOscHandler(e3, new g.OscHandler(t3)); } 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() { 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 && this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)?.isWrapped) { this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = !1, this._activeBuffer.y--, this._activeBuffer.x = this._bufferService.cols - 1; let e3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); e3.hasWidth(this._activeBuffer.x) && !e3.hasContent(this._activeBuffer.x) && this._activeBuffer.x--; } return this._restrictCursor(), !0; } tab() { if (this._activeBuffer.x >= this._bufferService.cols) return !0; let e3 = this._activeBuffer.x; return this._activeBuffer.x = this._activeBuffer.nextStop(), this._optionsService.rawOptions.screenReaderMode && this._onA11yTab.fire(this._activeBuffer.x - e3), !0; } shiftOut() { return this._charsetService.setgLevel(1), !0; } shiftIn() { return this._charsetService.setgLevel(0), !0; } _restrictCursor(e3 = this._bufferService.cols - 1) { this._activeBuffer.x = Math.min(e3, 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(e3, t3) { this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._coreService.decPrivateModes.origin ? (this._activeBuffer.x = e3, this._activeBuffer.y = this._activeBuffer.scrollTop + t3) : (this._activeBuffer.x = e3, this._activeBuffer.y = t3), this._restrictCursor(), this._dirtyRowTracker.markDirty(this._activeBuffer.y); } _moveCursor(e3, t3) { this._restrictCursor(), this._setCursor(this._activeBuffer.x + e3, this._activeBuffer.y + t3); } cursorUp(e3) { let t3 = this._activeBuffer.y - this._activeBuffer.scrollTop; return t3 >= 0 ? this._moveCursor(0, -Math.min(t3, e3.params[0] || 1)) : this._moveCursor(0, -(e3.params[0] || 1)), !0; } cursorDown(e3) { let t3 = this._activeBuffer.scrollBottom - this._activeBuffer.y; return t3 >= 0 ? this._moveCursor(0, Math.min(t3, e3.params[0] || 1)) : this._moveCursor(0, e3.params[0] || 1), !0; } cursorForward(e3) { return this._moveCursor(e3.params[0] || 1, 0), !0; } cursorBackward(e3) { return this._moveCursor(-(e3.params[0] || 1), 0), !0; } cursorNextLine(e3) { return this.cursorDown(e3), this._activeBuffer.x = 0, !0; } cursorPrecedingLine(e3) { return this.cursorUp(e3), this._activeBuffer.x = 0, !0; } cursorCharAbsolute(e3) { return this._setCursor((e3.params[0] || 1) - 1, this._activeBuffer.y), !0; } cursorPosition(e3) { return this._setCursor(e3.length >= 2 ? (e3.params[1] || 1) - 1 : 0, (e3.params[0] || 1) - 1), !0; } charPosAbsolute(e3) { return this._setCursor((e3.params[0] || 1) - 1, this._activeBuffer.y), !0; } hPositionRelative(e3) { return this._moveCursor(e3.params[0] || 1, 0), !0; } linePosAbsolute(e3) { return this._setCursor(this._activeBuffer.x, (e3.params[0] || 1) - 1), !0; } vPositionRelative(e3) { return this._moveCursor(0, e3.params[0] || 1), !0; } hVPosition(e3) { return this.cursorPosition(e3), !0; } tabClear(e3) { let t3 = e3.params[0]; return t3 === 0 ? delete this._activeBuffer.tabs[this._activeBuffer.x] : t3 === 3 && (this._activeBuffer.tabs = {}), !0; } cursorForwardTab(e3) { if (this._activeBuffer.x >= this._bufferService.cols) return !0; let t3 = e3.params[0] || 1; for (; t3--; ) this._activeBuffer.x = this._activeBuffer.nextStop(); return !0; } cursorBackwardTab(e3) { if (this._activeBuffer.x >= this._bufferService.cols) return !0; let t3 = e3.params[0] || 1; for (; t3--; ) this._activeBuffer.x = this._activeBuffer.prevStop(); return !0; } selectProtected(e3) { let t3 = e3.params[0]; return t3 === 1 && (this._curAttrData.bg |= 536870912), t3 !== 2 && t3 !== 0 || (this._curAttrData.bg &= -536870913), !0; } _eraseInBufferLine(e3, t3, i3, s3 = !1, r2 = !1) { let n2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e3); n2.replaceCells(t3, i3, this._activeBuffer.getNullCell(this._eraseAttrData()), r2), s3 && (n2.isWrapped = !1); } _resetBufferLine(e3, t3 = !1) { let i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e3); i3 && (i3.fill(this._activeBuffer.getNullCell(this._eraseAttrData()), t3), this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + e3), i3.isWrapped = !1); } eraseInDisplay(e3, t3 = !1) { let i3; switch (this._restrictCursor(this._bufferService.cols), e3.params[0]) { case 0: for (i3 = this._activeBuffer.y, this._dirtyRowTracker.markDirty(i3), this._eraseInBufferLine(i3++, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, t3); i3 < this._bufferService.rows; i3++) this._resetBufferLine(i3, t3); this._dirtyRowTracker.markDirty(i3); break; case 1: for (i3 = this._activeBuffer.y, this._dirtyRowTracker.markDirty(i3), this._eraseInBufferLine(i3, 0, this._activeBuffer.x + 1, !0, t3), this._activeBuffer.x + 1 >= this._bufferService.cols && (this._activeBuffer.lines.get(i3 + 1).isWrapped = !1); i3--; ) this._resetBufferLine(i3, t3); this._dirtyRowTracker.markDirty(0); break; case 2: for (i3 = this._bufferService.rows, this._dirtyRowTracker.markDirty(i3 - 1); i3--; ) this._resetBufferLine(i3, t3); this._dirtyRowTracker.markDirty(0); break; case 3: let e4 = this._activeBuffer.lines.length - this._bufferService.rows; e4 > 0 && (this._activeBuffer.lines.trimStart(e4), this._activeBuffer.ybase = Math.max(this._activeBuffer.ybase - e4, 0), this._activeBuffer.ydisp = Math.max(this._activeBuffer.ydisp - e4, 0), this._onScroll.fire(0)); } return !0; } eraseInLine(e3, t3 = !1) { switch (this._restrictCursor(this._bufferService.cols), e3.params[0]) { case 0: this._eraseInBufferLine(this._activeBuffer.y, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, t3); break; case 1: this._eraseInBufferLine(this._activeBuffer.y, 0, this._activeBuffer.x + 1, !1, t3); break; case 2: this._eraseInBufferLine(this._activeBuffer.y, 0, this._bufferService.cols, !0, t3); } return this._dirtyRowTracker.markDirty(this._activeBuffer.y), !0; } insertLines(e3) { this._restrictCursor(); let t3 = e3.params[0] || 1; if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0; let i3 = this._activeBuffer.ybase + this._activeBuffer.y, s3 = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom, r2 = this._bufferService.rows - 1 + this._activeBuffer.ybase - s3 + 1; for (; t3--; ) this._activeBuffer.lines.splice(r2 - 1, 1), this._activeBuffer.lines.splice(i3, 0, this._activeBuffer.getBlankLine(this._eraseAttrData())); return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, !0; } deleteLines(e3) { this._restrictCursor(); let t3 = e3.params[0] || 1; if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0; let i3 = this._activeBuffer.ybase + this._activeBuffer.y, s3; for (s3 = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom, s3 = this._bufferService.rows - 1 + this._activeBuffer.ybase - s3; t3--; ) this._activeBuffer.lines.splice(i3, 1), this._activeBuffer.lines.splice(s3, 0, this._activeBuffer.getBlankLine(this._eraseAttrData())); return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, !0; } insertChars(e3) { this._restrictCursor(); let t3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); return t3 && (t3.insertCells(this._activeBuffer.x, e3.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), !0; } deleteChars(e3) { this._restrictCursor(); let t3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); return t3 && (t3.deleteCells(this._activeBuffer.x, e3.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), !0; } scrollUp(e3) { let t3 = e3.params[0] || 1; for (; t3--; ) 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(e3) { let t3 = e3.params[0] || 1; for (; t3--; ) 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(l.DEFAULT_ATTR_DATA)); return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0; } scrollLeft(e3) { if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0; let t3 = e3.params[0] || 1; for (let e4 = this._activeBuffer.scrollTop; e4 <= this._activeBuffer.scrollBottom; ++e4) { let i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4); i3.deleteCells(0, t3, this._activeBuffer.getNullCell(this._eraseAttrData())), i3.isWrapped = !1; } return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0; } scrollRight(e3) { if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0; let t3 = e3.params[0] || 1; for (let e4 = this._activeBuffer.scrollTop; e4 <= this._activeBuffer.scrollBottom; ++e4) { let i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4); i3.insertCells(0, t3, this._activeBuffer.getNullCell(this._eraseAttrData())), i3.isWrapped = !1; } return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0; } insertColumns(e3) { if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0; let t3 = e3.params[0] || 1; for (let e4 = this._activeBuffer.scrollTop; e4 <= this._activeBuffer.scrollBottom; ++e4) { let i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4); i3.insertCells(this._activeBuffer.x, t3, this._activeBuffer.getNullCell(this._eraseAttrData())), i3.isWrapped = !1; } return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0; } deleteColumns(e3) { if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0; let t3 = e3.params[0] || 1; for (let e4 = this._activeBuffer.scrollTop; e4 <= this._activeBuffer.scrollBottom; ++e4) { let i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4); i3.deleteCells(this._activeBuffer.x, t3, this._activeBuffer.getNullCell(this._eraseAttrData())), i3.isWrapped = !1; } return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0; } eraseChars(e3) { this._restrictCursor(); let t3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); return t3 && (t3.replaceCells(this._activeBuffer.x, this._activeBuffer.x + (e3.params[0] || 1), this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), !0; } repeatPrecedingCharacter(e3) { let t3 = this._parser.precedingJoinState; if (!t3) return !0; let i3 = e3.params[0] || 1, s3 = p.UnicodeService.extractWidth(t3), r2 = this._activeBuffer.x - s3, n2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).getString(r2), o2 = new Uint32Array(n2.length * i3), a2 = 0; for (let e4 = 0; e4 < n2.length; ) { let t4 = n2.codePointAt(e4) || 0; o2[a2++] = t4, e4 += t4 > 65535 ? 2 : 1; } let h3 = a2; for (let e4 = 1; e4 < i3; ++e4) o2.copyWithin(h3, 0, a2), h3 += a2; return this.print(o2, 0, h3), !0; } sendDeviceAttributesPrimary(e3) { return e3.params[0] > 0 || (this._is("xterm") || this._is("rxvt-unicode") || this._is("screen") ? this._coreService.triggerDataEvent(n.C0.ESC + "[?1;2c") : this._is("linux") && this._coreService.triggerDataEvent(n.C0.ESC + "[?6c")), !0; } sendDeviceAttributesSecondary(e3) { return e3.params[0] > 0 || (this._is("xterm") ? this._coreService.triggerDataEvent(n.C0.ESC + "[>0;276;0c") : this._is("rxvt-unicode") ? this._coreService.triggerDataEvent(n.C0.ESC + "[>85;95;0c") : this._is("linux") ? this._coreService.triggerDataEvent(e3.params[0] + "c") : this._is("screen") && this._coreService.triggerDataEvent(n.C0.ESC + "[>83;40003;0c")), !0; } _is(e3) { return (this._optionsService.rawOptions.termName + "").indexOf(e3) === 0; } setMode(e3) { for (let t3 = 0; t3 < e3.length; t3++) switch (e3.params[t3]) { case 4: this._coreService.modes.insertMode = !0; break; case 20: this._optionsService.options.convertEol = !0; } return !0; } setModePrivate(e3) { for (let t3 = 0; t3 < e3.length; t3++) switch (e3.params[t3]) { case 1: this._coreService.decPrivateModes.applicationCursorKeys = !0; break; case 2: this._charsetService.setgCharset(0, o.DEFAULT_CHARSET), this._charsetService.setgCharset(1, o.DEFAULT_CHARSET), this._charsetService.setgCharset(2, o.DEFAULT_CHARSET), this._charsetService.setgCharset(3, o.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(e3) { for (let t3 = 0; t3 < e3.length; t3++) switch (e3.params[t3]) { case 4: this._coreService.modes.insertMode = !1; break; case 20: this._optionsService.options.convertEol = !1; } return !0; } resetModePrivate(e3) { for (let t3 = 0; t3 < e3.length; t3++) switch (e3.params[t3]) { 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(), e3.params[t3] === 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(e3, t3) { let i3 = this._coreService.decPrivateModes, { activeProtocol: s3, activeEncoding: r2 } = this._coreMouseService, o2 = this._coreService, { buffers: a2, cols: h3 } = this._bufferService, { active: c2, alt: l2 } = a2, d2 = this._optionsService.rawOptions, _2 = (e4) => e4 ? 1 : 2, u2 = e3.params[0]; return f2 = u2, v2 = t3 ? u2 === 2 ? 4 : u2 === 4 ? _2(o2.modes.insertMode) : u2 === 12 ? 3 : u2 === 20 ? _2(d2.convertEol) : 0 : u2 === 1 ? _2(i3.applicationCursorKeys) : u2 === 3 ? d2.windowOptions.setWinLines ? h3 === 80 ? 2 : h3 === 132 ? 1 : 0 : 0 : u2 === 6 ? _2(i3.origin) : u2 === 7 ? _2(i3.wraparound) : u2 === 8 ? 3 : u2 === 9 ? _2(s3 === "X10") : u2 === 12 ? _2(d2.cursorBlink) : u2 === 25 ? _2(!o2.isCursorHidden) : u2 === 45 ? _2(i3.reverseWraparound) : u2 === 66 ? _2(i3.applicationKeypad) : u2 === 67 ? 4 : u2 === 1e3 ? _2(s3 === "VT200") : u2 === 1002 ? _2(s3 === "DRAG") : u2 === 1003 ? _2(s3 === "ANY") : u2 === 1004 ? _2(i3.sendFocus) : u2 === 1005 ? 4 : u2 === 1006 ? _2(r2 === "SGR") : u2 === 1015 ? 4 : u2 === 1016 ? _2(r2 === "SGR_PIXELS") : u2 === 1048 ? 1 : u2 === 47 || u2 === 1047 || u2 === 1049 ? _2(c2 === l2) : u2 === 2004 ? _2(i3.bracketedPasteMode) : 0, o2.triggerDataEvent(`${n.C0.ESC}[${t3 ? "" : "?"}${f2};${v2}$y`), !0; var f2, v2; } _updateAttrColor(e3, t3, i3, s3, r2) { return t3 === 2 ? (e3 |= 50331648, e3 &= -16777216, e3 |= f.AttributeData.fromColorRGB([i3, s3, r2])) : t3 === 5 && (e3 &= -50331904, e3 |= 33554432 | 255 & i3), e3; } _extractColor(e3, t3, i3) { let s3 = [0, 0, -1, 0, 0, 0], r2 = 0, n2 = 0; do { if (s3[n2 + r2] = e3.params[t3 + n2], e3.hasSubParams(t3 + n2)) { let i4 = e3.getSubParams(t3 + n2), o2 = 0; do s3[1] === 5 && (r2 = 1), s3[n2 + o2 + 1 + r2] = i4[o2]; while (++o2 < i4.length && o2 + n2 + 1 + r2 < s3.length); break; } if (s3[1] === 5 && n2 + r2 >= 2 || s3[1] === 2 && n2 + r2 >= 5) break; s3[1] && (r2 = 1); } while (++n2 + t3 < e3.length && n2 + r2 < s3.length); for (let e4 = 2; e4 < s3.length; ++e4) s3[e4] === -1 && (s3[e4] = 0); switch (s3[0]) { case 38: i3.fg = this._updateAttrColor(i3.fg, s3[1], s3[3], s3[4], s3[5]); break; case 48: i3.bg = this._updateAttrColor(i3.bg, s3[1], s3[3], s3[4], s3[5]); break; case 58: i3.extended = i3.extended.clone(), i3.extended.underlineColor = this._updateAttrColor(i3.extended.underlineColor, s3[1], s3[3], s3[4], s3[5]); } return n2; } _processUnderline(e3, t3) { t3.extended = t3.extended.clone(), (!~e3 || e3 > 5) && (e3 = 1), t3.extended.underlineStyle = e3, t3.fg |= 268435456, e3 === 0 && (t3.fg &= -268435457), t3.updateExtended(); } _processSGR0(e3) { e3.fg = l.DEFAULT_ATTR_DATA.fg, e3.bg = l.DEFAULT_ATTR_DATA.bg, e3.extended = e3.extended.clone(), e3.extended.underlineStyle = 0, e3.extended.underlineColor &= -67108864, e3.updateExtended(); } charAttributes(e3) { if (e3.length === 1 && e3.params[0] === 0) return this._processSGR0(this._curAttrData), !0; let t3 = e3.length, i3, s3 = this._curAttrData; for (let r2 = 0; r2 < t3; r2++) i3 = e3.params[r2], i3 >= 30 && i3 <= 37 ? (s3.fg &= -50331904, s3.fg |= 16777216 | i3 - 30) : i3 >= 40 && i3 <= 47 ? (s3.bg &= -50331904, s3.bg |= 16777216 | i3 - 40) : i3 >= 90 && i3 <= 97 ? (s3.fg &= -50331904, s3.fg |= 16777224 | i3 - 90) : i3 >= 100 && i3 <= 107 ? (s3.bg &= -50331904, s3.bg |= 16777224 | i3 - 100) : i3 === 0 ? this._processSGR0(s3) : i3 === 1 ? s3.fg |= 134217728 : i3 === 3 ? s3.bg |= 67108864 : i3 === 4 ? (s3.fg |= 268435456, this._processUnderline(e3.hasSubParams(r2) ? e3.getSubParams(r2)[0] : 1, s3)) : i3 === 5 ? s3.fg |= 536870912 : i3 === 7 ? s3.fg |= 67108864 : i3 === 8 ? s3.fg |= 1073741824 : i3 === 9 ? s3.fg |= 2147483648 : i3 === 2 ? s3.bg |= 134217728 : i3 === 21 ? this._processUnderline(2, s3) : i3 === 22 ? (s3.fg &= -134217729, s3.bg &= -134217729) : i3 === 23 ? s3.bg &= -67108865 : i3 === 24 ? (s3.fg &= -268435457, this._processUnderline(0, s3)) : i3 === 25 ? s3.fg &= -536870913 : i3 === 27 ? s3.fg &= -67108865 : i3 === 28 ? s3.fg &= -1073741825 : i3 === 29 ? s3.fg &= 2147483647 : i3 === 39 ? (s3.fg &= -67108864, s3.fg |= 16777215 & l.DEFAULT_ATTR_DATA.fg) : i3 === 49 ? (s3.bg &= -67108864, s3.bg |= 16777215 & l.DEFAULT_ATTR_DATA.bg) : i3 === 38 || i3 === 48 || i3 === 58 ? r2 += this._extractColor(e3, r2, s3) : i3 === 53 ? s3.bg |= 1073741824 : i3 === 55 ? s3.bg &= -1073741825 : i3 === 59 ? (s3.extended = s3.extended.clone(), s3.extended.underlineColor = -1, s3.updateExtended()) : i3 === 100 ? (s3.fg &= -67108864, s3.fg |= 16777215 & l.DEFAULT_ATTR_DATA.fg, s3.bg &= -67108864, s3.bg |= 16777215 & l.DEFAULT_ATTR_DATA.bg) : this._logService.debug("Unknown SGR attribute: %d.", i3); return !0; } deviceStatus(e3) { switch (e3.params[0]) { case 5: this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`); break; case 6: let e4 = this._activeBuffer.y + 1, t3 = this._activeBuffer.x + 1; this._coreService.triggerDataEvent(`${n.C0.ESC}[${e4};${t3}R`); } return !0; } deviceStatusPrivate(e3) { if (e3.params[0] === 6) { let e4 = this._activeBuffer.y + 1, t3 = this._activeBuffer.x + 1; this._coreService.triggerDataEvent(`${n.C0.ESC}[?${e4};${t3}R`); } return !0; } softReset(e3) { return this._coreService.isCursorHidden = !1, this._onRequestSyncScrollBar.fire(), this._activeBuffer.scrollTop = 0, this._activeBuffer.scrollBottom = this._bufferService.rows - 1, this._curAttrData = l.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(e3) { let t3 = e3.params[0] || 1; switch (t3) { 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"; } let i3 = t3 % 2 == 1; return this._optionsService.options.cursorBlink = i3, !0; } setScrollRegion(e3) { let t3 = e3.params[0] || 1, i3; return (e3.length < 2 || (i3 = e3.params[1]) > this._bufferService.rows || i3 === 0) && (i3 = this._bufferService.rows), i3 > t3 && (this._activeBuffer.scrollTop = t3 - 1, this._activeBuffer.scrollBottom = i3 - 1, this._setCursor(0, 0)), !0; } windowOptions(e3) { if (!w(e3.params[0], this._optionsService.rawOptions.windowOptions)) return !0; let t3 = e3.length > 1 ? e3.params[1] : 0; switch (e3.params[0]) { case 14: t3 !== 2 && this._onRequestWindowsOptionsReport.fire(y.GET_WIN_SIZE_PIXELS); break; case 16: this._onRequestWindowsOptionsReport.fire(y.GET_CELL_SIZE_PIXELS); break; case 18: this._bufferService && this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`); break; case 22: t3 !== 0 && t3 !== 2 || (this._windowTitleStack.push(this._windowTitle), this._windowTitleStack.length > 10 && this._windowTitleStack.shift()), t3 !== 0 && t3 !== 1 || (this._iconNameStack.push(this._iconName), this._iconNameStack.length > 10 && this._iconNameStack.shift()); break; case 23: t3 !== 0 && t3 !== 2 || this._windowTitleStack.length && this.setTitle(this._windowTitleStack.pop()), t3 !== 0 && t3 !== 1 || this._iconNameStack.length && this.setIconName(this._iconNameStack.pop()); } return !0; } saveCursor(e3) { 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(e3) { 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(e3) { return this._windowTitle = e3, this._onTitleChange.fire(e3), !0; } setIconName(e3) { return this._iconName = e3, !0; } setOrReportIndexedColor(e3) { let t3 = [], i3 = e3.split(";"); for (; i3.length > 1; ) { let e4 = i3.shift(), s3 = i3.shift(); if (/^\d+$/.exec(e4)) { let i4 = parseInt(e4); if (D(i4)) if (s3 === "?") t3.push({ type: 0, index: i4 }); else { let e5 = (0, S.parseColor)(s3); e5 && t3.push({ type: 1, index: i4, color: e5 }); } } } return t3.length && this._onColor.fire(t3), !0; } setHyperlink(e3) { let t3 = e3.split(";"); return !(t3.length < 2) && (t3[1] ? this._createHyperlink(t3[0], t3[1]) : !t3[0] && this._finishHyperlink()); } _createHyperlink(e3, t3) { this._getCurrentLinkId() && this._finishHyperlink(); let i3 = e3.split(":"), s3, r2 = i3.findIndex(((e4) => e4.startsWith("id="))); return r2 !== -1 && (s3 = i3[r2].slice(3) || void 0), this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = this._oscLinkService.registerLink({ id: s3, uri: t3 }), this._curAttrData.updateExtended(), !0; } _finishHyperlink() { return this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = 0, this._curAttrData.updateExtended(), !0; } _setOrReportSpecialColor(e3, t3) { let i3 = e3.split(";"); for (let e4 = 0; e4 < i3.length && !(t3 >= this._specialColors.length); ++e4, ++t3) if (i3[e4] === "?") this._onColor.fire([{ type: 0, index: this._specialColors[t3] }]); else { let s3 = (0, S.parseColor)(i3[e4]); s3 && this._onColor.fire([{ type: 1, index: this._specialColors[t3], color: s3 }]); } return !0; } setOrReportFgColor(e3) { return this._setOrReportSpecialColor(e3, 0); } setOrReportBgColor(e3) { return this._setOrReportSpecialColor(e3, 1); } setOrReportCursorColor(e3) { return this._setOrReportSpecialColor(e3, 2); } restoreIndexedColor(e3) { if (!e3) return this._onColor.fire([{ type: 2 }]), !0; let t3 = [], i3 = e3.split(";"); for (let e4 = 0; e4 < i3.length; ++e4) if (/^\d+$/.exec(i3[e4])) { let s3 = parseInt(i3[e4]); D(s3) && t3.push({ type: 2, index: s3 }); } return t3.length && this._onColor.fire(t3), !0; } restoreFgColor(e3) { return this._onColor.fire([{ type: 2, index: 256 }]), !0; } restoreBgColor(e3) { return this._onColor.fire([{ type: 2, index: 257 }]), !0; } restoreCursorColor(e3) { 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, o.DEFAULT_CHARSET), !0; } selectCharset(e3) { return e3.length !== 2 ? (this.selectDefaultCharset(), !0) : (e3[0] === "/" || this._charsetService.setgCharset(C[e3[0]], o.CHARSETS[e3[1]] || o.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) { let e3 = this._activeBuffer.scrollBottom - this._activeBuffer.scrollTop; this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase + this._activeBuffer.y, e3, 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 = l.DEFAULT_ATTR_DATA.clone(), this._eraseAttrDataInternal = l.DEFAULT_ATTR_DATA.clone(); } _eraseAttrData() { return this._eraseAttrDataInternal.bg &= -67108864, this._eraseAttrDataInternal.bg |= 67108863 & this._curAttrData.bg, this._eraseAttrDataInternal; } setgLevel(e3) { return this._charsetService.setgLevel(e3), !0; } screenAlignmentPattern() { let e3 = new u.CellData(); e3.content = 4194373, e3.fg = this._curAttrData.fg, e3.bg = this._curAttrData.bg, this._setCursor(0, 0); for (let t3 = 0; t3 < this._bufferService.rows; ++t3) { let i3 = this._activeBuffer.ybase + this._activeBuffer.y + t3, s3 = this._activeBuffer.lines.get(i3); s3 && (s3.fill(e3), s3.isWrapped = !1); } return this._dirtyRowTracker.markAllDirty(), this._setCursor(0, 0), !0; } requestStatusString(e3, t3) { let i3 = this._bufferService.buffer, s3 = this._optionsService.rawOptions; return ((e4) => (this._coreService.triggerDataEvent(`${n.C0.ESC}${e4}${n.C0.ESC}\\`), !0))(e3 === '"q' ? `P1$r${this._curAttrData.isProtected() ? 1 : 0}"q` : e3 === '"p' ? 'P1$r61;1"p' : e3 === "r" ? `P1$r${i3.scrollTop + 1};${i3.scrollBottom + 1}r` : e3 === "m" ? "P1$r0m" : e3 === " q" ? `P1$r${{ block: 2, underline: 4, bar: 6 }[s3.cursorStyle] - (s3.cursorBlink ? 1 : 0)} q` : "P0$r"); } markRangeDirty(e3, t3) { this._dirtyRowTracker.markRangeDirty(e3, t3); } } t2.InputHandler = k; let L = class { constructor(e3) { this._bufferService = e3, this.clearRange(); } clearRange() { this.start = this._bufferService.buffer.y, this.end = this._bufferService.buffer.y; } markDirty(e3) { e3 < this.start ? this.start = e3 : e3 > this.end && (this.end = e3); } markRangeDirty(e3, t3) { e3 > t3 && (E = e3, e3 = t3, t3 = E), e3 < this.start && (this.start = e3), t3 > this.end && (this.end = t3); } markAllDirty() { this.markRangeDirty(0, this._bufferService.rows - 1); } }; function D(e3) { return 0 <= e3 && e3 < 256; } L = s2([r(0, v.IBufferService)], L); }, 844: (e2, t2) => { function i2(e3) { for (let t3 of e3) t3.dispose(); e3.length = 0; } Object.defineProperty(t2, "__esModule", { value: !0 }), t2.getDisposeArrayDisposable = t2.disposeArray = t2.toDisposable = t2.MutableDisposable = t2.Disposable = void 0, t2.Disposable = class { constructor() { this._disposables = [], this._isDisposed = !1; } dispose() { this._isDisposed = !0; for (let e3 of this._disposables) e3.dispose(); this._disposables.length = 0; } register(e3) { return this._disposables.push(e3), e3; } unregister(e3) { let t3 = this._disposables.indexOf(e3); t3 !== -1 && this._disposables.splice(t3, 1); } }, t2.MutableDisposable = class { constructor() { this._isDisposed = !1; } get value() { return this._isDisposed ? void 0 : this._value; } set value(e3) { this._isDisposed || e3 === this._value || (this._value?.dispose(), this._value = e3); } clear() { this.value = void 0; } dispose() { this._isDisposed = !0, this._value?.dispose(), this._value = void 0; } }, t2.toDisposable = function(e3) { return { dispose: e3 }; }, t2.disposeArray = i2, t2.getDisposeArrayDisposable = function(e3) { return { dispose: () => i2(e3) }; }; }, 1505: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.FourKeyMap = t2.TwoKeyMap = void 0; class i2 { constructor() { this._data = {}; } set(e3, t3, i3) { this._data[e3] || (this._data[e3] = {}), this._data[e3][t3] = i3; } get(e3, t3) { return this._data[e3] ? this._data[e3][t3] : void 0; } clear() { this._data = {}; } } t2.TwoKeyMap = i2, t2.FourKeyMap = class { constructor() { this._data = new i2(); } set(e3, t3, s2, r, n) { this._data.get(e3, t3) || this._data.set(e3, t3, new i2()), this._data.get(e3, t3).set(s2, r, n); } get(e3, t3, i3, s2) { return this._data.get(e3, t3)?.get(i3, s2); } clear() { this._data.clear(); } }; }, 6114: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.isChromeOS = t2.isLinux = t2.isWindows = t2.isIphone = t2.isIpad = t2.isMac = t2.getSafariVersion = t2.isSafari = t2.isLegacyEdge = t2.isFirefox = t2.isNode = void 0, t2.isNode = typeof process < "u" && "title" in process; let i2 = t2.isNode ? "node" : navigator.userAgent, s2 = t2.isNode ? "node" : navigator.platform; t2.isFirefox = i2.includes("Firefox"), t2.isLegacyEdge = i2.includes("Edge"), t2.isSafari = /^((?!chrome|android).)*safari/i.test(i2), t2.getSafariVersion = function() { if (!t2.isSafari) return 0; let e3 = i2.match(/Version\/(\d+)/); return e3 === null || e3.length < 2 ? 0 : parseInt(e3[1]); }, t2.isMac = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"].includes(s2), t2.isIpad = s2 === "iPad", t2.isIphone = s2 === "iPhone", t2.isWindows = ["Windows", "Win16", "Win32", "WinCE"].includes(s2), t2.isLinux = s2.indexOf("Linux") >= 0, t2.isChromeOS = /\bCrOS\b/.test(i2); }, 6106: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.SortedList = void 0; let i2 = 0; t2.SortedList = class { constructor(e3) { this._getKey = e3, this._array = []; } clear() { this._array.length = 0; } insert(e3) { this._array.length !== 0 ? (i2 = this._search(this._getKey(e3)), this._array.splice(i2, 0, e3)) : this._array.push(e3); } delete(e3) { if (this._array.length === 0) return !1; let t3 = this._getKey(e3); if (t3 === void 0 || (i2 = this._search(t3), i2 === -1) || this._getKey(this._array[i2]) !== t3) return !1; do if (this._array[i2] === e3) return this._array.splice(i2, 1), !0; while (++i2 < this._array.length && this._getKey(this._array[i2]) === t3); return !1; } *getKeyIterator(e3) { if (this._array.length !== 0 && (i2 = this._search(e3), !(i2 < 0 || i2 >= this._array.length) && this._getKey(this._array[i2]) === e3)) do yield this._array[i2]; while (++i2 < this._array.length && this._getKey(this._array[i2]) === e3); } forEachByKey(e3, t3) { if (this._array.length !== 0 && (i2 = this._search(e3), !(i2 < 0 || i2 >= this._array.length) && this._getKey(this._array[i2]) === e3)) do t3(this._array[i2]); while (++i2 < this._array.length && this._getKey(this._array[i2]) === e3); } values() { return [...this._array].values(); } _search(e3) { let t3 = 0, i3 = this._array.length - 1; for (; i3 >= t3; ) { let s2 = t3 + i3 >> 1, r = this._getKey(this._array[s2]); if (r > e3) i3 = s2 - 1; else { if (!(r < e3)) { for (; s2 > 0 && this._getKey(this._array[s2 - 1]) === e3; ) s2--; return s2; } t3 = s2 + 1; } } return t3; } }; }, 7226: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.DebouncedIdleTask = t2.IdleTaskQueue = t2.PriorityTaskQueue = void 0; let s2 = i2(6114); class r { constructor() { this._tasks = [], this._i = 0; } enqueue(e3) { this._tasks.push(e3), 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(e3) { this._idleCallback = void 0; let t3 = 0, i3 = 0, s3 = e3.timeRemaining(), r2 = 0; for (; this._i < this._tasks.length; ) { if (t3 = Date.now(), this._tasks[this._i]() || this._i++, t3 = Math.max(1, Date.now() - t3), i3 = Math.max(t3, i3), r2 = e3.timeRemaining(), 1.5 * i3 > r2) return s3 - t3 < -20 && console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s3 - t3))}ms`), void this._start(); s3 = r2; } this.clear(); } } class n extends r { _requestCallback(e3) { return setTimeout((() => e3(this._createDeadline(16)))); } _cancelCallback(e3) { clearTimeout(e3); } _createDeadline(e3) { let t3 = Date.now() + e3; return { timeRemaining: () => Math.max(0, t3 - Date.now()) }; } } t2.PriorityTaskQueue = n, t2.IdleTaskQueue = !s2.isNode && "requestIdleCallback" in window ? class extends r { _requestCallback(e3) { return requestIdleCallback(e3); } _cancelCallback(e3) { cancelIdleCallback(e3); } } : n, t2.DebouncedIdleTask = class { constructor() { this._queue = new t2.IdleTaskQueue(); } set(e3) { this._queue.clear(), this._queue.enqueue(e3); } flush() { this._queue.flush(); } }; }, 9282: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.updateWindowsModeWrappedState = void 0; let s2 = i2(643); t2.updateWindowsModeWrappedState = function(e3) { let t3 = e3.buffer.lines.get(e3.buffer.ybase + e3.buffer.y - 1), i3 = t3?.get(e3.cols - 1), r = e3.buffer.lines.get(e3.buffer.ybase + e3.buffer.y); r && i3 && (r.isWrapped = i3[s2.CHAR_DATA_CODE_INDEX] !== s2.NULL_CELL_CODE && i3[s2.CHAR_DATA_CODE_INDEX] !== s2.WHITESPACE_CELL_CODE); }; }, 3734: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.ExtendedAttrs = t2.AttributeData = void 0; class i2 { constructor() { this.fg = 0, this.bg = 0, this.extended = new s2(); } static toColorRGB(e3) { return [e3 >>> 16 & 255, e3 >>> 8 & 255, 255 & e3]; } static fromColorRGB(e3) { return (255 & e3[0]) << 16 | (255 & e3[1]) << 8 | 255 & e3[2]; } clone() { let e3 = new i2(); return e3.fg = this.fg, e3.bg = this.bg, e3.extended = this.extended.clone(), e3; } 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; } } t2.AttributeData = i2; class s2 { get ext() { return this._urlId ? -469762049 & this._ext | this.underlineStyle << 26 : this._ext; } set ext(e3) { this._ext = e3; } get underlineStyle() { return this._urlId ? 5 : (469762048 & this._ext) >> 26; } set underlineStyle(e3) { this._ext &= -469762049, this._ext |= e3 << 26 & 469762048; } get underlineColor() { return 67108863 & this._ext; } set underlineColor(e3) { this._ext &= -67108864, this._ext |= 67108863 & e3; } get urlId() { return this._urlId; } set urlId(e3) { this._urlId = e3; } get underlineVariantOffset() { let e3 = (3758096384 & this._ext) >> 29; return e3 < 0 ? 4294967288 ^ e3 : e3; } set underlineVariantOffset(e3) { this._ext &= 536870911, this._ext |= e3 << 29 & 3758096384; } constructor(e3 = 0, t3 = 0) { this._ext = 0, this._urlId = 0, this._ext = e3, this._urlId = t3; } clone() { return new s2(this._ext, this._urlId); } isEmpty() { return this.underlineStyle === 0 && this._urlId === 0; } } t2.ExtendedAttrs = s2; }, 9092: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Buffer = t2.MAX_BUFFER_SIZE = void 0; let s2 = i2(6349), r = i2(7226), n = i2(3734), o = i2(8437), a = i2(4634), h2 = i2(511), c = i2(643), l = i2(4863), d = i2(7116); t2.MAX_BUFFER_SIZE = 4294967295, t2.Buffer = class { constructor(e3, t3, i3) { this._hasScrollback = e3, this._optionsService = t3, this._bufferService = i3, this.ydisp = 0, this.ybase = 0, this.y = 0, this.x = 0, this.tabs = {}, this.savedY = 0, this.savedX = 0, this.savedCurAttrData = o.DEFAULT_ATTR_DATA.clone(), this.savedCharset = d.DEFAULT_CHARSET, this.markers = [], this._nullCell = h2.CellData.fromCharData([0, c.NULL_CELL_CHAR, c.NULL_CELL_WIDTH, c.NULL_CELL_CODE]), this._whitespaceCell = h2.CellData.fromCharData([0, c.WHITESPACE_CELL_CHAR, c.WHITESPACE_CELL_WIDTH, c.WHITESPACE_CELL_CODE]), this._isClearing = !1, this._memoryCleanupQueue = new r.IdleTaskQueue(), this._memoryCleanupPosition = 0, this._cols = this._bufferService.cols, this._rows = this._bufferService.rows, this.lines = new s2.CircularList(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops(); } getNullCell(e3) { return e3 ? (this._nullCell.fg = e3.fg, this._nullCell.bg = e3.bg, this._nullCell.extended = e3.extended) : (this._nullCell.fg = 0, this._nullCell.bg = 0, this._nullCell.extended = new n.ExtendedAttrs()), this._nullCell; } getWhitespaceCell(e3) { return e3 ? (this._whitespaceCell.fg = e3.fg, this._whitespaceCell.bg = e3.bg, this._whitespaceCell.extended = e3.extended) : (this._whitespaceCell.fg = 0, this._whitespaceCell.bg = 0, this._whitespaceCell.extended = new n.ExtendedAttrs()), this._whitespaceCell; } getBlankLine(e3, t3) { return new o.BufferLine(this._bufferService.cols, this.getNullCell(e3), t3); } get hasScrollback() { return this._hasScrollback && this.lines.maxLength > this._rows; } get isCursorInViewport() { let e3 = this.ybase + this.y - this.ydisp; return e3 >= 0 && e3 < this._rows; } _getCorrectBufferLength(e3) { if (!this._hasScrollback) return e3; let i3 = e3 + this._optionsService.rawOptions.scrollback; return i3 > t2.MAX_BUFFER_SIZE ? t2.MAX_BUFFER_SIZE : i3; } fillViewportRows(e3) { if (this.lines.length === 0) { e3 === void 0 && (e3 = o.DEFAULT_ATTR_DATA); let t3 = this._rows; for (; t3--; ) this.lines.push(this.getBlankLine(e3)); } } clear() { this.ydisp = 0, this.ybase = 0, this.y = 0, this.x = 0, this.lines = new s2.CircularList(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops(); } resize(e3, t3) { let i3 = this.getNullCell(o.DEFAULT_ATTR_DATA), s3 = 0, r2 = this._getCorrectBufferLength(t3); if (r2 > this.lines.maxLength && (this.lines.maxLength = r2), this.lines.length > 0) { if (this._cols < e3) for (let t4 = 0; t4 < this.lines.length; t4++) s3 += +this.lines.get(t4).resize(e3, i3); let n2 = 0; if (this._rows < t3) for (let s4 = this._rows; s4 < t3; s4++) this.lines.length < t3 + this.ybase && (this._optionsService.rawOptions.windowsMode || this._optionsService.rawOptions.windowsPty.backend !== void 0 || this._optionsService.rawOptions.windowsPty.buildNumber !== void 0 ? this.lines.push(new o.BufferLine(e3, i3)) : this.ybase > 0 && this.lines.length <= this.ybase + this.y + n2 + 1 ? (this.ybase--, n2++, this.ydisp > 0 && this.ydisp--) : this.lines.push(new o.BufferLine(e3, i3))); else for (let e4 = this._rows; e4 > t3; e4--) this.lines.length > t3 + this.ybase && (this.lines.length > this.ybase + this.y + 1 ? this.lines.pop() : (this.ybase++, this.ydisp++)); if (r2 < this.lines.maxLength) { let e4 = this.lines.length - r2; e4 > 0 && (this.lines.trimStart(e4), this.ybase = Math.max(this.ybase - e4, 0), this.ydisp = Math.max(this.ydisp - e4, 0), this.savedY = Math.max(this.savedY - e4, 0)), this.lines.maxLength = r2; } this.x = Math.min(this.x, e3 - 1), this.y = Math.min(this.y, t3 - 1), n2 && (this.y += n2), this.savedX = Math.min(this.savedX, e3 - 1), this.scrollTop = 0; } if (this.scrollBottom = t3 - 1, this._isReflowEnabled && (this._reflow(e3, t3), this._cols > e3)) for (let t4 = 0; t4 < this.lines.length; t4++) s3 += +this.lines.get(t4).resize(e3, i3); this._cols = e3, this._rows = t3, this._memoryCleanupQueue.clear(), s3 > 0.1 * this.lines.length && (this._memoryCleanupPosition = 0, this._memoryCleanupQueue.enqueue((() => this._batchedMemoryCleanup()))); } _batchedMemoryCleanup() { let e3 = !0; this._memoryCleanupPosition >= this.lines.length && (this._memoryCleanupPosition = 0, e3 = !1); let t3 = 0; for (; this._memoryCleanupPosition < this.lines.length; ) if (t3 += this.lines.get(this._memoryCleanupPosition++).cleanupMemory(), t3 > 100) return !0; return e3; } get _isReflowEnabled() { let e3 = this._optionsService.rawOptions.windowsPty; return e3 && e3.buildNumber ? this._hasScrollback && e3.backend === "conpty" && e3.buildNumber >= 21376 : this._hasScrollback && !this._optionsService.rawOptions.windowsMode; } _reflow(e3, t3) { this._cols !== e3 && (e3 > this._cols ? this._reflowLarger(e3, t3) : this._reflowSmaller(e3, t3)); } _reflowLarger(e3, t3) { let i3 = (0, a.reflowLargerGetLinesToRemove)(this.lines, this._cols, e3, this.ybase + this.y, this.getNullCell(o.DEFAULT_ATTR_DATA)); if (i3.length > 0) { let s3 = (0, a.reflowLargerCreateNewLayout)(this.lines, i3); (0, a.reflowLargerApplyNewLayout)(this.lines, s3.layout), this._reflowLargerAdjustViewport(e3, t3, s3.countRemoved); } } _reflowLargerAdjustViewport(e3, t3, i3) { let s3 = this.getNullCell(o.DEFAULT_ATTR_DATA), r2 = i3; for (; r2-- > 0; ) this.ybase === 0 ? (this.y > 0 && this.y--, this.lines.length < t3 && this.lines.push(new o.BufferLine(e3, s3))) : (this.ydisp === this.ybase && this.ydisp--, this.ybase--); this.savedY = Math.max(this.savedY - i3, 0); } _reflowSmaller(e3, t3) { let i3 = this.getNullCell(o.DEFAULT_ATTR_DATA), s3 = [], r2 = 0; for (let n2 = this.lines.length - 1; n2 >= 0; n2--) { let h3 = this.lines.get(n2); if (!h3 || !h3.isWrapped && h3.getTrimmedLength() <= e3) continue; let c2 = [h3]; for (; h3.isWrapped && n2 > 0; ) h3 = this.lines.get(--n2), c2.unshift(h3); let l2 = this.ybase + this.y; if (l2 >= n2 && l2 < n2 + c2.length) continue; let d2 = c2[c2.length - 1].getTrimmedLength(), _ = (0, a.reflowSmallerGetNewLineLengths)(c2, this._cols, e3), u = _.length - c2.length, f; f = this.ybase === 0 && this.y !== this.lines.length - 1 ? Math.max(0, this.y - this.lines.maxLength + u) : Math.max(0, this.lines.length - this.lines.maxLength + u); let v = []; for (let e4 = 0; e4 < u; e4++) { let e5 = this.getBlankLine(o.DEFAULT_ATTR_DATA, !0); v.push(e5); } v.length > 0 && (s3.push({ start: n2 + c2.length + r2, newLines: v }), r2 += v.length), c2.push(...v); let p = _.length - 1, g = _[p]; g === 0 && (p--, g = _[p]); let m = c2.length - u - 1, S = d2; for (; m >= 0; ) { let e4 = Math.min(S, g); if (c2[p] === void 0) break; if (c2[p].copyCellsFrom(c2[m], S - e4, g - e4, e4, !0), g -= e4, g === 0 && (p--, g = _[p]), S -= e4, S === 0) { m--; let e5 = Math.max(m, 0); S = (0, a.getWrappedLineTrimmedLength)(c2, e5, this._cols); } } for (let t4 = 0; t4 < c2.length; t4++) _[t4] < e3 && c2[t4].setCell(_[t4], i3); let C = u - f; for (; C-- > 0; ) this.ybase === 0 ? this.y < t3 - 1 ? (this.y++, this.lines.pop()) : (this.ybase++, this.ydisp++) : this.ybase < Math.min(this.lines.maxLength, this.lines.length + r2) - t3 && (this.ybase === this.ydisp && this.ydisp++, this.ybase++); this.savedY = Math.min(this.savedY + u, this.ybase + t3 - 1); } if (s3.length > 0) { let e4 = [], t4 = []; for (let e5 = 0; e5 < this.lines.length; e5++) t4.push(this.lines.get(e5)); let i4 = this.lines.length, n2 = i4 - 1, o2 = 0, a2 = s3[o2]; this.lines.length = Math.min(this.lines.maxLength, this.lines.length + r2); let h3 = 0; for (let c3 = Math.min(this.lines.maxLength - 1, i4 + r2 - 1); c3 >= 0; c3--) if (a2 && a2.start > n2 + h3) { for (let e5 = a2.newLines.length - 1; e5 >= 0; e5--) this.lines.set(c3--, a2.newLines[e5]); c3++, e4.push({ index: n2 + 1, amount: a2.newLines.length }), h3 += a2.newLines.length, a2 = s3[++o2]; } else this.lines.set(c3, t4[n2--]); let c2 = 0; for (let t5 = e4.length - 1; t5 >= 0; t5--) e4[t5].index += c2, this.lines.onInsertEmitter.fire(e4[t5]), c2 += e4[t5].amount; let l2 = Math.max(0, i4 + r2 - this.lines.maxLength); l2 > 0 && this.lines.onTrimEmitter.fire(l2); } } translateBufferLineToString(e3, t3, i3 = 0, s3) { let r2 = this.lines.get(e3); return r2 ? r2.translateToString(t3, i3, s3) : ""; } getWrappedRangeForLine(e3) { let t3 = e3, i3 = e3; for (; t3 > 0 && this.lines.get(t3).isWrapped; ) t3--; for (; i3 + 1 < this.lines.length && this.lines.get(i3 + 1).isWrapped; ) i3++; return { first: t3, last: i3 }; } setupTabStops(e3) { for (e3 != null ? this.tabs[e3] || (e3 = this.prevStop(e3)) : (this.tabs = {}, e3 = 0); e3 < this._cols; e3 += this._optionsService.rawOptions.tabStopWidth) this.tabs[e3] = !0; } prevStop(e3) { for (e3 == null && (e3 = this.x); !this.tabs[--e3] && e3 > 0; ) ; return e3 >= this._cols ? this._cols - 1 : e3 < 0 ? 0 : e3; } nextStop(e3) { for (e3 == null && (e3 = this.x); !this.tabs[++e3] && e3 < this._cols; ) ; return e3 >= this._cols ? this._cols - 1 : e3 < 0 ? 0 : e3; } clearMarkers(e3) { this._isClearing = !0; for (let t3 = 0; t3 < this.markers.length; t3++) this.markers[t3].line === e3 && (this.markers[t3].dispose(), this.markers.splice(t3--, 1)); this._isClearing = !1; } clearAllMarkers() { this._isClearing = !0; for (let e3 = 0; e3 < this.markers.length; e3++) this.markers[e3].dispose(), this.markers.splice(e3--, 1); this._isClearing = !1; } addMarker(e3) { let t3 = new l.Marker(e3); return this.markers.push(t3), t3.register(this.lines.onTrim(((e4) => { t3.line -= e4, t3.line < 0 && t3.dispose(); }))), t3.register(this.lines.onInsert(((e4) => { t3.line >= e4.index && (t3.line += e4.amount); }))), t3.register(this.lines.onDelete(((e4) => { t3.line >= e4.index && t3.line < e4.index + e4.amount && t3.dispose(), t3.line > e4.index && (t3.line -= e4.amount); }))), t3.register(t3.onDispose((() => this._removeMarker(t3)))), t3; } _removeMarker(e3) { this._isClearing || this.markers.splice(this.markers.indexOf(e3), 1); } }; }, 8437: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferLine = t2.DEFAULT_ATTR_DATA = void 0; let s2 = i2(3734), r = i2(511), n = i2(643), o = i2(482); t2.DEFAULT_ATTR_DATA = Object.freeze(new s2.AttributeData()); let a = 0; class h2 { constructor(e3, t3, i3 = !1) { this.isWrapped = i3, this._combined = {}, this._extendedAttrs = {}, this._data = new Uint32Array(3 * e3); let s3 = t3 || r.CellData.fromCharData([0, n.NULL_CELL_CHAR, n.NULL_CELL_WIDTH, n.NULL_CELL_CODE]); for (let t4 = 0; t4 < e3; ++t4) this.setCell(t4, s3); this.length = e3; } get(e3) { let t3 = this._data[3 * e3 + 0], i3 = 2097151 & t3; return [this._data[3 * e3 + 1], 2097152 & t3 ? this._combined[e3] : i3 ? (0, o.stringFromCodePoint)(i3) : "", t3 >> 22, 2097152 & t3 ? this._combined[e3].charCodeAt(this._combined[e3].length - 1) : i3]; } set(e3, t3) { this._data[3 * e3 + 1] = t3[n.CHAR_DATA_ATTR_INDEX], t3[n.CHAR_DATA_CHAR_INDEX].length > 1 ? (this._combined[e3] = t3[1], this._data[3 * e3 + 0] = 2097152 | e3 | t3[n.CHAR_DATA_WIDTH_INDEX] << 22) : this._data[3 * e3 + 0] = t3[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | t3[n.CHAR_DATA_WIDTH_INDEX] << 22; } getWidth(e3) { return this._data[3 * e3 + 0] >> 22; } hasWidth(e3) { return 12582912 & this._data[3 * e3 + 0]; } getFg(e3) { return this._data[3 * e3 + 1]; } getBg(e3) { return this._data[3 * e3 + 2]; } hasContent(e3) { return 4194303 & this._data[3 * e3 + 0]; } getCodePoint(e3) { let t3 = this._data[3 * e3 + 0]; return 2097152 & t3 ? this._combined[e3].charCodeAt(this._combined[e3].length - 1) : 2097151 & t3; } isCombined(e3) { return 2097152 & this._data[3 * e3 + 0]; } getString(e3) { let t3 = this._data[3 * e3 + 0]; return 2097152 & t3 ? this._combined[e3] : 2097151 & t3 ? (0, o.stringFromCodePoint)(2097151 & t3) : ""; } isProtected(e3) { return 536870912 & this._data[3 * e3 + 2]; } loadCell(e3, t3) { return a = 3 * e3, t3.content = this._data[a + 0], t3.fg = this._data[a + 1], t3.bg = this._data[a + 2], 2097152 & t3.content && (t3.combinedData = this._combined[e3]), 268435456 & t3.bg && (t3.extended = this._extendedAttrs[e3]), t3; } setCell(e3, t3) { 2097152 & t3.content && (this._combined[e3] = t3.combinedData), 268435456 & t3.bg && (this._extendedAttrs[e3] = t3.extended), this._data[3 * e3 + 0] = t3.content, this._data[3 * e3 + 1] = t3.fg, this._data[3 * e3 + 2] = t3.bg; } setCellFromCodepoint(e3, t3, i3, s3) { 268435456 & s3.bg && (this._extendedAttrs[e3] = s3.extended), this._data[3 * e3 + 0] = t3 | i3 << 22, this._data[3 * e3 + 1] = s3.fg, this._data[3 * e3 + 2] = s3.bg; } addCodepointToCell(e3, t3, i3) { let s3 = this._data[3 * e3 + 0]; 2097152 & s3 ? this._combined[e3] += (0, o.stringFromCodePoint)(t3) : 2097151 & s3 ? (this._combined[e3] = (0, o.stringFromCodePoint)(2097151 & s3) + (0, o.stringFromCodePoint)(t3), s3 &= -2097152, s3 |= 2097152) : s3 = t3 | 4194304, i3 && (s3 &= -12582913, s3 |= i3 << 22), this._data[3 * e3 + 0] = s3; } insertCells(e3, t3, i3) { if ((e3 %= this.length) && this.getWidth(e3 - 1) === 2 && this.setCellFromCodepoint(e3 - 1, 0, 1, i3), t3 < this.length - e3) { let s3 = new r.CellData(); for (let i4 = this.length - e3 - t3 - 1; i4 >= 0; --i4) this.setCell(e3 + t3 + i4, this.loadCell(e3 + i4, s3)); for (let s4 = 0; s4 < t3; ++s4) this.setCell(e3 + s4, i3); } else for (let t4 = e3; t4 < this.length; ++t4) this.setCell(t4, i3); this.getWidth(this.length - 1) === 2 && this.setCellFromCodepoint(this.length - 1, 0, 1, i3); } deleteCells(e3, t3, i3) { if (e3 %= this.length, t3 < this.length - e3) { let s3 = new r.CellData(); for (let i4 = 0; i4 < this.length - e3 - t3; ++i4) this.setCell(e3 + i4, this.loadCell(e3 + t3 + i4, s3)); for (let e4 = this.length - t3; e4 < this.length; ++e4) this.setCell(e4, i3); } else for (let t4 = e3; t4 < this.length; ++t4) this.setCell(t4, i3); e3 && this.getWidth(e3 - 1) === 2 && this.setCellFromCodepoint(e3 - 1, 0, 1, i3), this.getWidth(e3) !== 0 || this.hasContent(e3) || this.setCellFromCodepoint(e3, 0, 1, i3); } replaceCells(e3, t3, i3, s3 = !1) { if (s3) for (e3 && this.getWidth(e3 - 1) === 2 && !this.isProtected(e3 - 1) && this.setCellFromCodepoint(e3 - 1, 0, 1, i3), t3 < this.length && this.getWidth(t3 - 1) === 2 && !this.isProtected(t3) && this.setCellFromCodepoint(t3, 0, 1, i3); e3 < t3 && e3 < this.length; ) this.isProtected(e3) || this.setCell(e3, i3), e3++; else for (e3 && this.getWidth(e3 - 1) === 2 && this.setCellFromCodepoint(e3 - 1, 0, 1, i3), t3 < this.length && this.getWidth(t3 - 1) === 2 && this.setCellFromCodepoint(t3, 0, 1, i3); e3 < t3 && e3 < this.length; ) this.setCell(e3++, i3); } resize(e3, t3) { if (e3 === this.length) return 4 * this._data.length * 2 < this._data.buffer.byteLength; let i3 = 3 * e3; if (e3 > this.length) { if (this._data.buffer.byteLength >= 4 * i3) this._data = new Uint32Array(this._data.buffer, 0, i3); else { let e4 = new Uint32Array(i3); e4.set(this._data), this._data = e4; } for (let i4 = this.length; i4 < e3; ++i4) this.setCell(i4, t3); } else { this._data = this._data.subarray(0, i3); let t4 = Object.keys(this._combined); for (let i4 = 0; i4 < t4.length; i4++) { let s4 = parseInt(t4[i4], 10); s4 >= e3 && delete this._combined[s4]; } let s3 = Object.keys(this._extendedAttrs); for (let t5 = 0; t5 < s3.length; t5++) { let i4 = parseInt(s3[t5], 10); i4 >= e3 && delete this._extendedAttrs[i4]; } } return this.length = e3, 4 * i3 * 2 < this._data.buffer.byteLength; } cleanupMemory() { if (4 * this._data.length * 2 < this._data.buffer.byteLength) { let e3 = new Uint32Array(this._data.length); return e3.set(this._data), this._data = e3, 1; } return 0; } fill(e3, t3 = !1) { if (t3) for (let t4 = 0; t4 < this.length; ++t4) this.isProtected(t4) || this.setCell(t4, e3); else { this._combined = {}, this._extendedAttrs = {}; for (let t4 = 0; t4 < this.length; ++t4) this.setCell(t4, e3); } } copyFrom(e3) { this.length !== e3.length ? this._data = new Uint32Array(e3._data) : this._data.set(e3._data), this.length = e3.length, this._combined = {}; for (let t3 in e3._combined) this._combined[t3] = e3._combined[t3]; this._extendedAttrs = {}; for (let t3 in e3._extendedAttrs) this._extendedAttrs[t3] = e3._extendedAttrs[t3]; this.isWrapped = e3.isWrapped; } clone() { let e3 = new h2(0); e3._data = new Uint32Array(this._data), e3.length = this.length; for (let t3 in this._combined) e3._combined[t3] = this._combined[t3]; for (let t3 in this._extendedAttrs) e3._extendedAttrs[t3] = this._extendedAttrs[t3]; return e3.isWrapped = this.isWrapped, e3; } getTrimmedLength() { for (let e3 = this.length - 1; e3 >= 0; --e3) if (4194303 & this._data[3 * e3 + 0]) return e3 + (this._data[3 * e3 + 0] >> 22); return 0; } getNoBgTrimmedLength() { for (let e3 = this.length - 1; e3 >= 0; --e3) if (4194303 & this._data[3 * e3 + 0] || 50331648 & this._data[3 * e3 + 2]) return e3 + (this._data[3 * e3 + 0] >> 22); return 0; } copyCellsFrom(e3, t3, i3, s3, r2) { let n2 = e3._data; if (r2) for (let r3 = s3 - 1; r3 >= 0; r3--) { for (let e4 = 0; e4 < 3; e4++) this._data[3 * (i3 + r3) + e4] = n2[3 * (t3 + r3) + e4]; 268435456 & n2[3 * (t3 + r3) + 2] && (this._extendedAttrs[i3 + r3] = e3._extendedAttrs[t3 + r3]); } else for (let r3 = 0; r3 < s3; r3++) { for (let e4 = 0; e4 < 3; e4++) this._data[3 * (i3 + r3) + e4] = n2[3 * (t3 + r3) + e4]; 268435456 & n2[3 * (t3 + r3) + 2] && (this._extendedAttrs[i3 + r3] = e3._extendedAttrs[t3 + r3]); } let o2 = Object.keys(e3._combined); for (let s4 = 0; s4 < o2.length; s4++) { let r3 = parseInt(o2[s4], 10); r3 >= t3 && (this._combined[r3 - t3 + i3] = e3._combined[r3]); } } translateToString(e3, t3, i3, s3) { t3 = t3 ?? 0, i3 = i3 ?? this.length, e3 && (i3 = Math.min(i3, this.getTrimmedLength())), s3 && (s3.length = 0); let r2 = ""; for (; t3 < i3; ) { let e4 = this._data[3 * t3 + 0], i4 = 2097151 & e4, a2 = 2097152 & e4 ? this._combined[t3] : i4 ? (0, o.stringFromCodePoint)(i4) : n.WHITESPACE_CELL_CHAR; if (r2 += a2, s3) for (let e5 = 0; e5 < a2.length; ++e5) s3.push(t3); t3 += e4 >> 22 || 1; } return s3 && s3.push(t3), r2; } } t2.BufferLine = h2; }, 4841: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.getRangeLength = void 0, t2.getRangeLength = function(e3, t3) { if (e3.start.y > e3.end.y) throw new Error(`Buffer range end (${e3.end.x}, ${e3.end.y}) cannot be before start (${e3.start.x}, ${e3.start.y})`); return t3 * (e3.end.y - e3.start.y) + (e3.end.x - e3.start.x + 1); }; }, 4634: (e2, t2) => { function i2(e3, t3, i3) { if (t3 === e3.length - 1) return e3[t3].getTrimmedLength(); let s2 = !e3[t3].hasContent(i3 - 1) && e3[t3].getWidth(i3 - 1) === 1, r = e3[t3 + 1].getWidth(0) === 2; return s2 && r ? i3 - 1 : i3; } Object.defineProperty(t2, "__esModule", { value: !0 }), t2.getWrappedLineTrimmedLength = t2.reflowSmallerGetNewLineLengths = t2.reflowLargerApplyNewLayout = t2.reflowLargerCreateNewLayout = t2.reflowLargerGetLinesToRemove = void 0, t2.reflowLargerGetLinesToRemove = function(e3, t3, s2, r, n) { let o = []; for (let a = 0; a < e3.length - 1; a++) { let h2 = a, c = e3.get(++h2); if (!c.isWrapped) continue; let l = [e3.get(a)]; for (; h2 < e3.length && c.isWrapped; ) l.push(c), c = e3.get(++h2); if (r >= a && r < h2) { a += l.length - 1; continue; } let d = 0, _ = i2(l, d, t3), u = 1, f = 0; for (; u < l.length; ) { let e4 = i2(l, u, t3), r2 = e4 - f, o2 = s2 - _, a2 = Math.min(r2, o2); l[d].copyCellsFrom(l[u], f, _, a2, !1), _ += a2, _ === s2 && (d++, _ = 0), f += a2, f === e4 && (u++, f = 0), _ === 0 && d !== 0 && l[d - 1].getWidth(s2 - 1) === 2 && (l[d].copyCellsFrom(l[d - 1], s2 - 1, _++, 1, !1), l[d - 1].setCell(s2 - 1, n)); } l[d].replaceCells(_, s2, n); let v = 0; for (let e4 = l.length - 1; e4 > 0 && (e4 > d || l[e4].getTrimmedLength() === 0); e4--) v++; v > 0 && (o.push(a + l.length - v), o.push(v)), a += l.length - 1; } return o; }, t2.reflowLargerCreateNewLayout = function(e3, t3) { let i3 = [], s2 = 0, r = t3[s2], n = 0; for (let o = 0; o < e3.length; o++) if (r === o) { let i4 = t3[++s2]; e3.onDeleteEmitter.fire({ index: o - n, amount: i4 }), o += i4 - 1, n += i4, r = t3[++s2]; } else i3.push(o); return { layout: i3, countRemoved: n }; }, t2.reflowLargerApplyNewLayout = function(e3, t3) { let i3 = []; for (let s2 = 0; s2 < t3.length; s2++) i3.push(e3.get(t3[s2])); for (let t4 = 0; t4 < i3.length; t4++) e3.set(t4, i3[t4]); e3.length = t3.length; }, t2.reflowSmallerGetNewLineLengths = function(e3, t3, s2) { let r = [], n = e3.map(((s3, r2) => i2(e3, r2, t3))).reduce(((e4, t4) => e4 + t4)), o = 0, a = 0, h2 = 0; for (; h2 < n; ) { if (n - h2 < s2) { r.push(n - h2); break; } o += s2; let c = i2(e3, a, t3); o > c && (o -= c, a++); let l = e3[a].getWidth(o - 1) === 2; l && o--; let d = l ? s2 - 1 : s2; r.push(d), h2 += d; } return r; }, t2.getWrappedLineTrimmedLength = i2; }, 5295: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferSet = void 0; let s2 = i2(8460), r = i2(844), n = i2(9092); class o extends r.Disposable { constructor(e3, t3) { super(), this._optionsService = e3, this._bufferService = t3, this._onBufferActivate = this.register(new s2.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 n.Buffer(!0, this._optionsService, this._bufferService), this._normal.fillViewportRows(), this._alt = new n.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(e3) { this._activeBuffer !== this._alt && (this._alt.fillViewportRows(e3), 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(e3, t3) { this._normal.resize(e3, t3), this._alt.resize(e3, t3), this.setupTabStops(e3); } setupTabStops(e3) { this._normal.setupTabStops(e3), this._alt.setupTabStops(e3); } } t2.BufferSet = o; }, 511: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CellData = void 0; let s2 = i2(482), r = i2(643), n = i2(3734); class o extends n.AttributeData { constructor() { super(...arguments), this.content = 0, this.fg = 0, this.bg = 0, this.extended = new n.ExtendedAttrs(), this.combinedData = ""; } static fromCharData(e3) { let t3 = new o(); return t3.setFromCharData(e3), t3; } isCombined() { return 2097152 & this.content; } getWidth() { return this.content >> 22; } getChars() { return 2097152 & this.content ? this.combinedData : 2097151 & this.content ? (0, s2.stringFromCodePoint)(2097151 & this.content) : ""; } getCode() { return this.isCombined() ? this.combinedData.charCodeAt(this.combinedData.length - 1) : 2097151 & this.content; } setFromCharData(e3) { this.fg = e3[r.CHAR_DATA_ATTR_INDEX], this.bg = 0; let t3 = !1; if (e3[r.CHAR_DATA_CHAR_INDEX].length > 2) t3 = !0; else if (e3[r.CHAR_DATA_CHAR_INDEX].length === 2) { let i3 = e3[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0); if (55296 <= i3 && i3 <= 56319) { let s3 = e3[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1); 56320 <= s3 && s3 <= 57343 ? this.content = 1024 * (i3 - 55296) + s3 - 56320 + 65536 | e3[r.CHAR_DATA_WIDTH_INDEX] << 22 : t3 = !0; } else t3 = !0; } else this.content = e3[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | e3[r.CHAR_DATA_WIDTH_INDEX] << 22; t3 && (this.combinedData = e3[r.CHAR_DATA_CHAR_INDEX], this.content = 2097152 | e3[r.CHAR_DATA_WIDTH_INDEX] << 22); } getAsCharData() { return [this.fg, this.getChars(), this.getWidth(), this.getCode()]; } } t2.CellData = o; }, 643: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.WHITESPACE_CELL_CODE = t2.WHITESPACE_CELL_WIDTH = t2.WHITESPACE_CELL_CHAR = t2.NULL_CELL_CODE = t2.NULL_CELL_WIDTH = t2.NULL_CELL_CHAR = t2.CHAR_DATA_CODE_INDEX = t2.CHAR_DATA_WIDTH_INDEX = t2.CHAR_DATA_CHAR_INDEX = t2.CHAR_DATA_ATTR_INDEX = t2.DEFAULT_EXT = t2.DEFAULT_ATTR = t2.DEFAULT_COLOR = void 0, t2.DEFAULT_COLOR = 0, t2.DEFAULT_ATTR = 256 | t2.DEFAULT_COLOR << 9, t2.DEFAULT_EXT = 0, t2.CHAR_DATA_ATTR_INDEX = 0, t2.CHAR_DATA_CHAR_INDEX = 1, t2.CHAR_DATA_WIDTH_INDEX = 2, t2.CHAR_DATA_CODE_INDEX = 3, t2.NULL_CELL_CHAR = "", t2.NULL_CELL_WIDTH = 1, t2.NULL_CELL_CODE = 0, t2.WHITESPACE_CELL_CHAR = " ", t2.WHITESPACE_CELL_WIDTH = 1, t2.WHITESPACE_CELL_CODE = 32; }, 4863: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Marker = void 0; let s2 = i2(8460), r = i2(844); class n { get id() { return this._id; } constructor(e3) { this.line = e3, this.isDisposed = !1, this._disposables = [], this._id = n._nextId++, this._onDispose = this.register(new s2.EventEmitter()), this.onDispose = this._onDispose.event; } dispose() { this.isDisposed || (this.isDisposed = !0, this.line = -1, this._onDispose.fire(), (0, r.disposeArray)(this._disposables), this._disposables.length = 0); } register(e3) { return this._disposables.push(e3), e3; } } t2.Marker = n, n._nextId = 1; }, 7116: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.DEFAULT_CHARSET = t2.CHARSETS = void 0, t2.CHARSETS = {}, t2.DEFAULT_CHARSET = t2.CHARSETS.B, t2.CHARSETS[0] = { "`": "\u25C6", a: "\u2592", b: "\u2409", c: "\u240C", d: "\u240D", e: "\u240A", f: "\xB0", g: "\xB1", h: "\u2424", i: "\u240B", j: "\u2518", k: "\u2510", l: "\u250C", m: "\u2514", n: "\u253C", o: "\u23BA", p: "\u23BB", q: "\u2500", r: "\u23BC", s: "\u23BD", t: "\u251C", u: "\u2524", v: "\u2534", w: "\u252C", x: "\u2502", y: "\u2264", z: "\u2265", "{": "\u03C0", "|": "\u2260", "}": "\xA3", "~": "\xB7" }, t2.CHARSETS.A = { "#": "\xA3" }, t2.CHARSETS.B = void 0, t2.CHARSETS[4] = { "#": "\xA3", "@": "\xBE", "[": "ij", "\\": "\xBD", "]": "|", "{": "\xA8", "|": "f", "}": "\xBC", "~": "\xB4" }, t2.CHARSETS.C = t2.CHARSETS[5] = { "[": "\xC4", "\\": "\xD6", "]": "\xC5", "^": "\xDC", "`": "\xE9", "{": "\xE4", "|": "\xF6", "}": "\xE5", "~": "\xFC" }, t2.CHARSETS.R = { "#": "\xA3", "@": "\xE0", "[": "\xB0", "\\": "\xE7", "]": "\xA7", "{": "\xE9", "|": "\xF9", "}": "\xE8", "~": "\xA8" }, t2.CHARSETS.Q = { "@": "\xE0", "[": "\xE2", "\\": "\xE7", "]": "\xEA", "^": "\xEE", "`": "\xF4", "{": "\xE9", "|": "\xF9", "}": "\xE8", "~": "\xFB" }, t2.CHARSETS.K = { "@": "\xA7", "[": "\xC4", "\\": "\xD6", "]": "\xDC", "{": "\xE4", "|": "\xF6", "}": "\xFC", "~": "\xDF" }, t2.CHARSETS.Y = { "#": "\xA3", "@": "\xA7", "[": "\xB0", "\\": "\xE7", "]": "\xE9", "`": "\xF9", "{": "\xE0", "|": "\xF2", "}": "\xE8", "~": "\xEC" }, t2.CHARSETS.E = t2.CHARSETS[6] = { "@": "\xC4", "[": "\xC6", "\\": "\xD8", "]": "\xC5", "^": "\xDC", "`": "\xE4", "{": "\xE6", "|": "\xF8", "}": "\xE5", "~": "\xFC" }, t2.CHARSETS.Z = { "#": "\xA3", "@": "\xA7", "[": "\xA1", "\\": "\xD1", "]": "\xBF", "{": "\xB0", "|": "\xF1", "}": "\xE7" }, t2.CHARSETS.H = t2.CHARSETS[7] = { "@": "\xC9", "[": "\xC4", "\\": "\xD6", "]": "\xC5", "^": "\xDC", "`": "\xE9", "{": "\xE4", "|": "\xF6", "}": "\xE5", "~": "\xFC" }, t2.CHARSETS["="] = { "#": "\xF9", "@": "\xE0", "[": "\xE9", "\\": "\xE7", "]": "\xEA", "^": "\xEE", _: "\xE8", "`": "\xF4", "{": "\xE4", "|": "\xF6", "}": "\xFC", "~": "\xFB" }; }, 2584: (e2, t2) => { var i2, s2, r; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.C1_ESCAPED = t2.C1 = t2.C0 = void 0, (function(e3) { e3.NUL = "\0", e3.SOH = "", e3.STX = "", e3.ETX = "", e3.EOT = "", e3.ENQ = "", e3.ACK = "", e3.BEL = "\x07", e3.BS = "\b", e3.HT = " ", e3.LF = ` `, e3.VT = "\v", e3.FF = "\f", e3.CR = "\r", e3.SO = "", e3.SI = "", e3.DLE = "", e3.DC1 = "", e3.DC2 = "", e3.DC3 = "", e3.DC4 = "", e3.NAK = "", e3.SYN = "", e3.ETB = "", e3.CAN = "", e3.EM = "", e3.SUB = "", e3.ESC = "\x1B", e3.FS = "", e3.GS = "", e3.RS = "", e3.US = "", e3.SP = " ", e3.DEL = "\x7F"; })(i2 || (t2.C0 = i2 = {})), (function(e3) { e3.PAD = "\x80", e3.HOP = "\x81", e3.BPH = "\x82", e3.NBH = "\x83", e3.IND = "\x84", e3.NEL = "\x85", e3.SSA = "\x86", e3.ESA = "\x87", e3.HTS = "\x88", e3.HTJ = "\x89", e3.VTS = "\x8A", e3.PLD = "\x8B", e3.PLU = "\x8C", e3.RI = "\x8D", e3.SS2 = "\x8E", e3.SS3 = "\x8F", e3.DCS = "\x90", e3.PU1 = "\x91", e3.PU2 = "\x92", e3.STS = "\x93", e3.CCH = "\x94", e3.MW = "\x95", e3.SPA = "\x96", e3.EPA = "\x97", e3.SOS = "\x98", e3.SGCI = "\x99", e3.SCI = "\x9A", e3.CSI = "\x9B", e3.ST = "\x9C", e3.OSC = "\x9D", e3.PM = "\x9E", e3.APC = "\x9F"; })(s2 || (t2.C1 = s2 = {})), (function(e3) { e3.ST = `${i2.ESC}\\`; })(r || (t2.C1_ESCAPED = r = {})); }, 7399: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.evaluateKeyboardEvent = void 0; let s2 = i2(2584), r = { 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: ["'", '"'] }; t2.evaluateKeyboardEvent = function(e3, t3, i3, n) { let o = { type: 0, cancel: !1, key: void 0 }, a = (e3.shiftKey ? 1 : 0) | (e3.altKey ? 2 : 0) | (e3.ctrlKey ? 4 : 0) | (e3.metaKey ? 8 : 0); switch (e3.keyCode) { case 0: e3.key === "UIKeyInputUpArrow" ? o.key = t3 ? s2.C0.ESC + "OA" : s2.C0.ESC + "[A" : e3.key === "UIKeyInputLeftArrow" ? o.key = t3 ? s2.C0.ESC + "OD" : s2.C0.ESC + "[D" : e3.key === "UIKeyInputRightArrow" ? o.key = t3 ? s2.C0.ESC + "OC" : s2.C0.ESC + "[C" : e3.key === "UIKeyInputDownArrow" && (o.key = t3 ? s2.C0.ESC + "OB" : s2.C0.ESC + "[B"); break; case 8: o.key = e3.ctrlKey ? "\b" : s2.C0.DEL, e3.altKey && (o.key = s2.C0.ESC + o.key); break; case 9: if (e3.shiftKey) { o.key = s2.C0.ESC + "[Z"; break; } o.key = s2.C0.HT, o.cancel = !0; break; case 13: o.key = e3.altKey ? s2.C0.ESC + s2.C0.CR : s2.C0.CR, o.cancel = !0; break; case 27: o.key = s2.C0.ESC, e3.altKey && (o.key = s2.C0.ESC + s2.C0.ESC), o.cancel = !0; break; case 37: if (e3.metaKey) break; a ? (o.key = s2.C0.ESC + "[1;" + (a + 1) + "D", o.key === s2.C0.ESC + "[1;3D" && (o.key = s2.C0.ESC + (i3 ? "b" : "[1;5D"))) : o.key = t3 ? s2.C0.ESC + "OD" : s2.C0.ESC + "[D"; break; case 39: if (e3.metaKey) break; a ? (o.key = s2.C0.ESC + "[1;" + (a + 1) + "C", o.key === s2.C0.ESC + "[1;3C" && (o.key = s2.C0.ESC + (i3 ? "f" : "[1;5C"))) : o.key = t3 ? s2.C0.ESC + "OC" : s2.C0.ESC + "[C"; break; case 38: if (e3.metaKey) break; a ? (o.key = s2.C0.ESC + "[1;" + (a + 1) + "A", i3 || o.key !== s2.C0.ESC + "[1;3A" || (o.key = s2.C0.ESC + "[1;5A")) : o.key = t3 ? s2.C0.ESC + "OA" : s2.C0.ESC + "[A"; break; case 40: if (e3.metaKey) break; a ? (o.key = s2.C0.ESC + "[1;" + (a + 1) + "B", i3 || o.key !== s2.C0.ESC + "[1;3B" || (o.key = s2.C0.ESC + "[1;5B")) : o.key = t3 ? s2.C0.ESC + "OB" : s2.C0.ESC + "[B"; break; case 45: e3.shiftKey || e3.ctrlKey || (o.key = s2.C0.ESC + "[2~"); break; case 46: o.key = a ? s2.C0.ESC + "[3;" + (a + 1) + "~" : s2.C0.ESC + "[3~"; break; case 36: o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "H" : t3 ? s2.C0.ESC + "OH" : s2.C0.ESC + "[H"; break; case 35: o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "F" : t3 ? s2.C0.ESC + "OF" : s2.C0.ESC + "[F"; break; case 33: e3.shiftKey ? o.type = 2 : e3.ctrlKey ? o.key = s2.C0.ESC + "[5;" + (a + 1) + "~" : o.key = s2.C0.ESC + "[5~"; break; case 34: e3.shiftKey ? o.type = 3 : e3.ctrlKey ? o.key = s2.C0.ESC + "[6;" + (a + 1) + "~" : o.key = s2.C0.ESC + "[6~"; break; case 112: o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "P" : s2.C0.ESC + "OP"; break; case 113: o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "Q" : s2.C0.ESC + "OQ"; break; case 114: o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "R" : s2.C0.ESC + "OR"; break; case 115: o.key = a ? s2.C0.ESC + "[1;" + (a + 1) + "S" : s2.C0.ESC + "OS"; break; case 116: o.key = a ? s2.C0.ESC + "[15;" + (a + 1) + "~" : s2.C0.ESC + "[15~"; break; case 117: o.key = a ? s2.C0.ESC + "[17;" + (a + 1) + "~" : s2.C0.ESC + "[17~"; break; case 118: o.key = a ? s2.C0.ESC + "[18;" + (a + 1) + "~" : s2.C0.ESC + "[18~"; break; case 119: o.key = a ? s2.C0.ESC + "[19;" + (a + 1) + "~" : s2.C0.ESC + "[19~"; break; case 120: o.key = a ? s2.C0.ESC + "[20;" + (a + 1) + "~" : s2.C0.ESC + "[20~"; break; case 121: o.key = a ? s2.C0.ESC + "[21;" + (a + 1) + "~" : s2.C0.ESC + "[21~"; break; case 122: o.key = a ? s2.C0.ESC + "[23;" + (a + 1) + "~" : s2.C0.ESC + "[23~"; break; case 123: o.key = a ? s2.C0.ESC + "[24;" + (a + 1) + "~" : s2.C0.ESC + "[24~"; break; default: if (!e3.ctrlKey || e3.shiftKey || e3.altKey || e3.metaKey) if (i3 && !n || !e3.altKey || e3.metaKey) !i3 || e3.altKey || e3.ctrlKey || e3.shiftKey || !e3.metaKey ? e3.key && !e3.ctrlKey && !e3.altKey && !e3.metaKey && e3.keyCode >= 48 && e3.key.length === 1 ? o.key = e3.key : e3.key && e3.ctrlKey && (e3.key === "_" && (o.key = s2.C0.US), e3.key === "@" && (o.key = s2.C0.NUL)) : e3.keyCode === 65 && (o.type = 1); else { let t4 = r[e3.keyCode], i4 = t4?.[e3.shiftKey ? 1 : 0]; if (i4) o.key = s2.C0.ESC + i4; else if (e3.keyCode >= 65 && e3.keyCode <= 90) { let t5 = e3.ctrlKey ? e3.keyCode - 64 : e3.keyCode + 32, i5 = String.fromCharCode(t5); e3.shiftKey && (i5 = i5.toUpperCase()), o.key = s2.C0.ESC + i5; } else if (e3.keyCode === 32) o.key = s2.C0.ESC + (e3.ctrlKey ? s2.C0.NUL : " "); else if (e3.key === "Dead" && e3.code.startsWith("Key")) { let t5 = e3.code.slice(3, 4); e3.shiftKey || (t5 = t5.toLowerCase()), o.key = s2.C0.ESC + t5, o.cancel = !0; } } else e3.keyCode >= 65 && e3.keyCode <= 90 ? o.key = String.fromCharCode(e3.keyCode - 64) : e3.keyCode === 32 ? o.key = s2.C0.NUL : e3.keyCode >= 51 && e3.keyCode <= 55 ? o.key = String.fromCharCode(e3.keyCode - 51 + 27) : e3.keyCode === 56 ? o.key = s2.C0.DEL : e3.keyCode === 219 ? o.key = s2.C0.ESC : e3.keyCode === 220 ? o.key = s2.C0.FS : e3.keyCode === 221 && (o.key = s2.C0.GS); } return o; }; }, 482: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Utf8ToUtf32 = t2.StringToUtf32 = t2.utf32ToString = t2.stringFromCodePoint = void 0, t2.stringFromCodePoint = function(e3) { return e3 > 65535 ? (e3 -= 65536, String.fromCharCode(55296 + (e3 >> 10)) + String.fromCharCode(e3 % 1024 + 56320)) : String.fromCharCode(e3); }, t2.utf32ToString = function(e3, t3 = 0, i2 = e3.length) { let s2 = ""; for (let r = t3; r < i2; ++r) { let t4 = e3[r]; t4 > 65535 ? (t4 -= 65536, s2 += String.fromCharCode(55296 + (t4 >> 10)) + String.fromCharCode(t4 % 1024 + 56320)) : s2 += String.fromCharCode(t4); } return s2; }, t2.StringToUtf32 = class { constructor() { this._interim = 0; } clear() { this._interim = 0; } decode(e3, t3) { let i2 = e3.length; if (!i2) return 0; let s2 = 0, r = 0; if (this._interim) { let i3 = e3.charCodeAt(r++); 56320 <= i3 && i3 <= 57343 ? t3[s2++] = 1024 * (this._interim - 55296) + i3 - 56320 + 65536 : (t3[s2++] = this._interim, t3[s2++] = i3), this._interim = 0; } for (let n = r; n < i2; ++n) { let r2 = e3.charCodeAt(n); if (55296 <= r2 && r2 <= 56319) { if (++n >= i2) return this._interim = r2, s2; let o = e3.charCodeAt(n); 56320 <= o && o <= 57343 ? t3[s2++] = 1024 * (r2 - 55296) + o - 56320 + 65536 : (t3[s2++] = r2, t3[s2++] = o); } else r2 !== 65279 && (t3[s2++] = r2); } return s2; } }, t2.Utf8ToUtf32 = class { constructor() { this.interim = new Uint8Array(3); } clear() { this.interim.fill(0); } decode(e3, t3) { let i2 = e3.length; if (!i2) return 0; let s2, r, n, o, a = 0, h2 = 0, c = 0; if (this.interim[0]) { let s3 = !1, r2 = this.interim[0]; r2 &= (224 & r2) == 192 ? 31 : (240 & r2) == 224 ? 15 : 7; let n2, o2 = 0; for (; (n2 = 63 & this.interim[++o2]) && o2 < 4; ) r2 <<= 6, r2 |= n2; let h3 = (224 & this.interim[0]) == 192 ? 2 : (240 & this.interim[0]) == 224 ? 3 : 4, l2 = h3 - o2; for (; c < l2; ) { if (c >= i2) return 0; if (n2 = e3[c++], (192 & n2) != 128) { c--, s3 = !0; break; } this.interim[o2++] = n2, r2 <<= 6, r2 |= 63 & n2; } s3 || (h3 === 2 ? r2 < 128 ? c-- : t3[a++] = r2 : h3 === 3 ? r2 < 2048 || r2 >= 55296 && r2 <= 57343 || r2 === 65279 || (t3[a++] = r2) : r2 < 65536 || r2 > 1114111 || (t3[a++] = r2)), this.interim.fill(0); } let l = i2 - 4, d = c; for (; d < i2; ) { for (; !(!(d < l) || 128 & (s2 = e3[d]) || 128 & (r = e3[d + 1]) || 128 & (n = e3[d + 2]) || 128 & (o = e3[d + 3])); ) t3[a++] = s2, t3[a++] = r, t3[a++] = n, t3[a++] = o, d += 4; if (s2 = e3[d++], s2 < 128) t3[a++] = s2; else if ((224 & s2) == 192) { if (d >= i2) return this.interim[0] = s2, a; if (r = e3[d++], (192 & r) != 128) { d--; continue; } if (h2 = (31 & s2) << 6 | 63 & r, h2 < 128) { d--; continue; } t3[a++] = h2; } else if ((240 & s2) == 224) { if (d >= i2) return this.interim[0] = s2, a; if (r = e3[d++], (192 & r) != 128) { d--; continue; } if (d >= i2) return this.interim[0] = s2, this.interim[1] = r, a; if (n = e3[d++], (192 & n) != 128) { d--; continue; } if (h2 = (15 & s2) << 12 | (63 & r) << 6 | 63 & n, h2 < 2048 || h2 >= 55296 && h2 <= 57343 || h2 === 65279) continue; t3[a++] = h2; } else if ((248 & s2) == 240) { if (d >= i2) return this.interim[0] = s2, a; if (r = e3[d++], (192 & r) != 128) { d--; continue; } if (d >= i2) return this.interim[0] = s2, this.interim[1] = r, a; if (n = e3[d++], (192 & n) != 128) { d--; continue; } if (d >= i2) return this.interim[0] = s2, this.interim[1] = r, this.interim[2] = n, a; if (o = e3[d++], (192 & o) != 128) { d--; continue; } if (h2 = (7 & s2) << 18 | (63 & r) << 12 | (63 & n) << 6 | 63 & o, h2 < 65536 || h2 > 1114111) continue; t3[a++] = h2; } } return a; } }; }, 225: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.UnicodeV6 = void 0; let s2 = i2(1480), r = [[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]], n = [[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]], o; t2.UnicodeV6 = class { constructor() { if (this.version = "6", !o) { o = new Uint8Array(65536), o.fill(1), o[0] = 0, o.fill(0, 1, 32), o.fill(0, 127, 160), o.fill(2, 4352, 4448), o[9001] = 2, o[9002] = 2, o.fill(2, 11904, 42192), o[12351] = 1, o.fill(2, 44032, 55204), o.fill(2, 63744, 64256), o.fill(2, 65040, 65050), o.fill(2, 65072, 65136), o.fill(2, 65280, 65377), o.fill(2, 65504, 65511); for (let e3 = 0; e3 < r.length; ++e3) o.fill(0, r[e3][0], r[e3][1] + 1); } } wcwidth(e3) { return e3 < 32 ? 0 : e3 < 127 ? 1 : e3 < 65536 ? o[e3] : (function(e4, t3) { let i3, s3 = 0, r2 = t3.length - 1; if (e4 < t3[0][0] || e4 > t3[r2][1]) return !1; for (; r2 >= s3; ) if (i3 = s3 + r2 >> 1, e4 > t3[i3][1]) s3 = i3 + 1; else { if (!(e4 < t3[i3][0])) return !0; r2 = i3 - 1; } return !1; })(e3, n) ? 0 : e3 >= 131072 && e3 <= 196605 || e3 >= 196608 && e3 <= 262141 ? 2 : 1; } charProperties(e3, t3) { let i3 = this.wcwidth(e3), r2 = i3 === 0 && t3 !== 0; if (r2) { let e4 = s2.UnicodeService.extractWidth(t3); e4 === 0 ? r2 = !1 : e4 > i3 && (i3 = e4); } return s2.UnicodeService.createPropertyValue(0, i3, r2); } }; }, 5981: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.WriteBuffer = void 0; let s2 = i2(8460), r = i2(844); class n extends r.Disposable { constructor(e3) { super(), this._action = e3, this._writeBuffer = [], this._callbacks = [], this._pendingData = 0, this._bufferOffset = 0, this._isSyncWriting = !1, this._syncCalls = 0, this._didUserInput = !1, this._onWriteParsed = this.register(new s2.EventEmitter()), this.onWriteParsed = this._onWriteParsed.event; } handleUserInput() { this._didUserInput = !0; } writeSync(e3, t3) { if (t3 !== void 0 && this._syncCalls > t3) return void (this._syncCalls = 0); if (this._pendingData += e3.length, this._writeBuffer.push(e3), this._callbacks.push(void 0), this._syncCalls++, this._isSyncWriting) return; let i3; for (this._isSyncWriting = !0; i3 = this._writeBuffer.shift(); ) { this._action(i3); let e4 = this._callbacks.shift(); e4 && e4(); } this._pendingData = 0, this._bufferOffset = 2147483647, this._isSyncWriting = !1, this._syncCalls = 0; } write(e3, t3) { 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 += e3.length, this._writeBuffer.push(e3), this._callbacks.push(t3), void this._innerWrite(); setTimeout((() => this._innerWrite())); } this._pendingData += e3.length, this._writeBuffer.push(e3), this._callbacks.push(t3); } _innerWrite(e3 = 0, t3 = !0) { let i3 = e3 || Date.now(); for (; this._writeBuffer.length > this._bufferOffset; ) { let e4 = this._writeBuffer[this._bufferOffset], s3 = this._action(e4, t3); if (s3) { let e5 = (e6) => Date.now() - i3 >= 12 ? setTimeout((() => this._innerWrite(0, e6))) : this._innerWrite(i3, e6); return void s3.catch(((e6) => (queueMicrotask((() => { throw e6; })), Promise.resolve(!1)))).then(e5); } let r2 = this._callbacks[this._bufferOffset]; if (r2 && r2(), this._bufferOffset++, this._pendingData -= e4.length, Date.now() - i3 >= 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(); } } t2.WriteBuffer = n; }, 5941: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.toRgbString = t2.parseColor = void 0; let i2 = /^([\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})$/, s2 = /^[\da-f]+$/; function r(e3, t3) { let i3 = e3.toString(16), s3 = i3.length < 2 ? "0" + i3 : i3; switch (t3) { case 4: return i3[0]; case 8: return s3; case 12: return (s3 + s3).slice(0, 3); default: return s3 + s3; } } t2.parseColor = function(e3) { if (!e3) return; let t3 = e3.toLowerCase(); if (t3.indexOf("rgb:") === 0) { t3 = t3.slice(4); let e4 = i2.exec(t3); if (e4) { let t4 = e4[1] ? 15 : e4[4] ? 255 : e4[7] ? 4095 : 65535; return [Math.round(parseInt(e4[1] || e4[4] || e4[7] || e4[10], 16) / t4 * 255), Math.round(parseInt(e4[2] || e4[5] || e4[8] || e4[11], 16) / t4 * 255), Math.round(parseInt(e4[3] || e4[6] || e4[9] || e4[12], 16) / t4 * 255)]; } } else if (t3.indexOf("#") === 0 && (t3 = t3.slice(1), s2.exec(t3) && [3, 6, 9, 12].includes(t3.length))) { let e4 = t3.length / 3, i3 = [0, 0, 0]; for (let s3 = 0; s3 < 3; ++s3) { let r2 = parseInt(t3.slice(e4 * s3, e4 * s3 + e4), 16); i3[s3] = e4 === 1 ? r2 << 4 : e4 === 2 ? r2 : e4 === 3 ? r2 >> 4 : r2 >> 8; } return i3; } }, t2.toRgbString = function(e3, t3 = 16) { let [i3, s3, n] = e3; return `rgb:${r(i3, t3)}/${r(s3, t3)}/${r(n, t3)}`; }; }, 5770: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.PAYLOAD_LIMIT = void 0, t2.PAYLOAD_LIMIT = 1e7; }, 6351: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.DcsHandler = t2.DcsParser = void 0; let s2 = i2(482), r = i2(8742), n = i2(5770), o = []; t2.DcsParser = class { constructor() { this._handlers = /* @__PURE__ */ Object.create(null), this._active = o, this._ident = 0, this._handlerFb = () => { }, this._stack = { paused: !1, loopPosition: 0, fallThrough: !1 }; } dispose() { this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => { }, this._active = o; } registerHandler(e3, t3) { this._handlers[e3] === void 0 && (this._handlers[e3] = []); let i3 = this._handlers[e3]; return i3.push(t3), { dispose: () => { let e4 = i3.indexOf(t3); e4 !== -1 && i3.splice(e4, 1); } }; } clearHandler(e3) { this._handlers[e3] && delete this._handlers[e3]; } setHandlerFallback(e3) { this._handlerFb = e3; } reset() { if (this._active.length) for (let e3 = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; e3 >= 0; --e3) this._active[e3].unhook(!1); this._stack.paused = !1, this._active = o, this._ident = 0; } hook(e3, t3) { if (this.reset(), this._ident = e3, this._active = this._handlers[e3] || o, this._active.length) for (let e4 = this._active.length - 1; e4 >= 0; e4--) this._active[e4].hook(t3); else this._handlerFb(this._ident, "HOOK", t3); } put(e3, t3, i3) { if (this._active.length) for (let s3 = this._active.length - 1; s3 >= 0; s3--) this._active[s3].put(e3, t3, i3); else this._handlerFb(this._ident, "PUT", (0, s2.utf32ToString)(e3, t3, i3)); } unhook(e3, t3 = !0) { if (this._active.length) { let i3 = !1, s3 = this._active.length - 1, r2 = !1; if (this._stack.paused && (s3 = this._stack.loopPosition - 1, i3 = t3, r2 = this._stack.fallThrough, this._stack.paused = !1), !r2 && i3 === !1) { for (; s3 >= 0 && (i3 = this._active[s3].unhook(e3), i3 !== !0); s3--) if (i3 instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = s3, this._stack.fallThrough = !1, i3; s3--; } for (; s3 >= 0; s3--) if (i3 = this._active[s3].unhook(!1), i3 instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = s3, this._stack.fallThrough = !0, i3; } else this._handlerFb(this._ident, "UNHOOK", e3); this._active = o, this._ident = 0; } }; let a = new r.Params(); a.addParam(0), t2.DcsHandler = class { constructor(e3) { this._handler = e3, this._data = "", this._params = a, this._hitLimit = !1; } hook(e3) { this._params = e3.length > 1 || e3.params[0] ? e3.clone() : a, this._data = "", this._hitLimit = !1; } put(e3, t3, i3) { this._hitLimit || (this._data += (0, s2.utf32ToString)(e3, t3, i3), this._data.length > n.PAYLOAD_LIMIT && (this._data = "", this._hitLimit = !0)); } unhook(e3) { let t3 = !1; if (this._hitLimit) t3 = !1; else if (e3 && (t3 = this._handler(this._data, this._params), t3 instanceof Promise)) return t3.then(((e4) => (this._params = a, this._data = "", this._hitLimit = !1, e4))); return this._params = a, this._data = "", this._hitLimit = !1, t3; } }; }, 2015: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.EscapeSequenceParser = t2.VT500_TRANSITION_TABLE = t2.TransitionTable = void 0; let s2 = i2(844), r = i2(8742), n = i2(6242), o = i2(6351); class a { constructor(e3) { this.table = new Uint8Array(e3); } setDefault(e3, t3) { this.table.fill(e3 << 4 | t3); } add(e3, t3, i3, s3) { this.table[t3 << 8 | e3] = i3 << 4 | s3; } addMany(e3, t3, i3, s3) { for (let r2 = 0; r2 < e3.length; r2++) this.table[t3 << 8 | e3[r2]] = i3 << 4 | s3; } } t2.TransitionTable = a; let h2 = 160; t2.VT500_TRANSITION_TABLE = (function() { let e3 = new a(4095), t3 = Array.apply(null, Array(256)).map(((e4, t4) => t4)), i3 = (e4, i4) => t3.slice(e4, i4), s3 = i3(32, 127), r2 = i3(0, 24); r2.push(25), r2.push.apply(r2, i3(28, 32)); let n2 = i3(0, 14), o2; for (o2 in e3.setDefault(1, 0), e3.addMany(s3, 0, 2, 0), n2) e3.addMany([24, 26, 153, 154], o2, 3, 0), e3.addMany(i3(128, 144), o2, 3, 0), e3.addMany(i3(144, 152), o2, 3, 0), e3.add(156, o2, 0, 0), e3.add(27, o2, 11, 1), e3.add(157, o2, 4, 8), e3.addMany([152, 158, 159], o2, 0, 7), e3.add(155, o2, 11, 3), e3.add(144, o2, 11, 9); return e3.addMany(r2, 0, 3, 0), e3.addMany(r2, 1, 3, 1), e3.add(127, 1, 0, 1), e3.addMany(r2, 8, 0, 8), e3.addMany(r2, 3, 3, 3), e3.add(127, 3, 0, 3), e3.addMany(r2, 4, 3, 4), e3.add(127, 4, 0, 4), e3.addMany(r2, 6, 3, 6), e3.addMany(r2, 5, 3, 5), e3.add(127, 5, 0, 5), e3.addMany(r2, 2, 3, 2), e3.add(127, 2, 0, 2), e3.add(93, 1, 4, 8), e3.addMany(s3, 8, 5, 8), e3.add(127, 8, 5, 8), e3.addMany([156, 27, 24, 26, 7], 8, 6, 0), e3.addMany(i3(28, 32), 8, 0, 8), e3.addMany([88, 94, 95], 1, 0, 7), e3.addMany(s3, 7, 0, 7), e3.addMany(r2, 7, 0, 7), e3.add(156, 7, 0, 0), e3.add(127, 7, 0, 7), e3.add(91, 1, 11, 3), e3.addMany(i3(64, 127), 3, 7, 0), e3.addMany(i3(48, 60), 3, 8, 4), e3.addMany([60, 61, 62, 63], 3, 9, 4), e3.addMany(i3(48, 60), 4, 8, 4), e3.addMany(i3(64, 127), 4, 7, 0), e3.addMany([60, 61, 62, 63], 4, 0, 6), e3.addMany(i3(32, 64), 6, 0, 6), e3.add(127, 6, 0, 6), e3.addMany(i3(64, 127), 6, 0, 0), e3.addMany(i3(32, 48), 3, 9, 5), e3.addMany(i3(32, 48), 5, 9, 5), e3.addMany(i3(48, 64), 5, 0, 6), e3.addMany(i3(64, 127), 5, 7, 0), e3.addMany(i3(32, 48), 4, 9, 5), e3.addMany(i3(32, 48), 1, 9, 2), e3.addMany(i3(32, 48), 2, 9, 2), e3.addMany(i3(48, 127), 2, 10, 0), e3.addMany(i3(48, 80), 1, 10, 0), e3.addMany(i3(81, 88), 1, 10, 0), e3.addMany([89, 90, 92], 1, 10, 0), e3.addMany(i3(96, 127), 1, 10, 0), e3.add(80, 1, 11, 9), e3.addMany(r2, 9, 0, 9), e3.add(127, 9, 0, 9), e3.addMany(i3(28, 32), 9, 0, 9), e3.addMany(i3(32, 48), 9, 9, 12), e3.addMany(i3(48, 60), 9, 8, 10), e3.addMany([60, 61, 62, 63], 9, 9, 10), e3.addMany(r2, 11, 0, 11), e3.addMany(i3(32, 128), 11, 0, 11), e3.addMany(i3(28, 32), 11, 0, 11), e3.addMany(r2, 10, 0, 10), e3.add(127, 10, 0, 10), e3.addMany(i3(28, 32), 10, 0, 10), e3.addMany(i3(48, 60), 10, 8, 10), e3.addMany([60, 61, 62, 63], 10, 0, 11), e3.addMany(i3(32, 48), 10, 9, 12), e3.addMany(r2, 12, 0, 12), e3.add(127, 12, 0, 12), e3.addMany(i3(28, 32), 12, 0, 12), e3.addMany(i3(32, 48), 12, 9, 12), e3.addMany(i3(48, 64), 12, 0, 11), e3.addMany(i3(64, 127), 12, 12, 13), e3.addMany(i3(64, 127), 10, 12, 13), e3.addMany(i3(64, 127), 9, 12, 13), e3.addMany(r2, 13, 13, 13), e3.addMany(s3, 13, 13, 13), e3.add(127, 13, 0, 13), e3.addMany([27, 156, 24, 26], 13, 14, 0), e3.add(h2, 0, 2, 0), e3.add(h2, 8, 5, 8), e3.add(h2, 6, 0, 6), e3.add(h2, 11, 0, 11), e3.add(h2, 13, 13, 13), e3; })(); class c extends s2.Disposable { constructor(e3 = t2.VT500_TRANSITION_TABLE) { super(), this._transitions = e3, this._parseStack = { state: 0, handlers: [], handlerPos: 0, transition: 0, chunkPos: 0 }, this.initialState = 0, this.currentState = this.initialState, this._params = new r.Params(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0, this._printHandlerFb = (e4, t3, i3) => { }, this._executeHandlerFb = (e4) => { }, this._csiHandlerFb = (e4, t3) => { }, this._escHandlerFb = (e4) => { }, this._errorHandlerFb = (e4) => e4, this._printHandler = this._printHandlerFb, this._executeHandlers = /* @__PURE__ */ Object.create(null), this._csiHandlers = /* @__PURE__ */ Object.create(null), this._escHandlers = /* @__PURE__ */ Object.create(null), this.register((0, s2.toDisposable)((() => { this._csiHandlers = /* @__PURE__ */ Object.create(null), this._executeHandlers = /* @__PURE__ */ Object.create(null), this._escHandlers = /* @__PURE__ */ Object.create(null); }))), this._oscParser = this.register(new n.OscParser()), this._dcsParser = this.register(new o.DcsParser()), this._errorHandler = this._errorHandlerFb, this.registerEscHandler({ final: "\\" }, (() => !0)); } _identifier(e3, t3 = [64, 126]) { let i3 = 0; if (e3.prefix) { if (e3.prefix.length > 1) throw new Error("only one byte as prefix supported"); if (i3 = e3.prefix.charCodeAt(0), i3 && 60 > i3 || i3 > 63) throw new Error("prefix must be in range 0x3c .. 0x3f"); } if (e3.intermediates) { if (e3.intermediates.length > 2) throw new Error("only two bytes as intermediates are supported"); for (let t4 = 0; t4 < e3.intermediates.length; ++t4) { let s4 = e3.intermediates.charCodeAt(t4); if (32 > s4 || s4 > 47) throw new Error("intermediate must be in range 0x20 .. 0x2f"); i3 <<= 8, i3 |= s4; } } if (e3.final.length !== 1) throw new Error("final must be a single byte"); let s3 = e3.final.charCodeAt(0); if (t3[0] > s3 || s3 > t3[1]) throw new Error(`final must be in range ${t3[0]} .. ${t3[1]}`); return i3 <<= 8, i3 |= s3, i3; } identToString(e3) { let t3 = []; for (; e3; ) t3.push(String.fromCharCode(255 & e3)), e3 >>= 8; return t3.reverse().join(""); } setPrintHandler(e3) { this._printHandler = e3; } clearPrintHandler() { this._printHandler = this._printHandlerFb; } registerEscHandler(e3, t3) { let i3 = this._identifier(e3, [48, 126]); this._escHandlers[i3] === void 0 && (this._escHandlers[i3] = []); let s3 = this._escHandlers[i3]; return s3.push(t3), { dispose: () => { let e4 = s3.indexOf(t3); e4 !== -1 && s3.splice(e4, 1); } }; } clearEscHandler(e3) { this._escHandlers[this._identifier(e3, [48, 126])] && delete this._escHandlers[this._identifier(e3, [48, 126])]; } setEscHandlerFallback(e3) { this._escHandlerFb = e3; } setExecuteHandler(e3, t3) { this._executeHandlers[e3.charCodeAt(0)] = t3; } clearExecuteHandler(e3) { this._executeHandlers[e3.charCodeAt(0)] && delete this._executeHandlers[e3.charCodeAt(0)]; } setExecuteHandlerFallback(e3) { this._executeHandlerFb = e3; } registerCsiHandler(e3, t3) { let i3 = this._identifier(e3); this._csiHandlers[i3] === void 0 && (this._csiHandlers[i3] = []); let s3 = this._csiHandlers[i3]; return s3.push(t3), { dispose: () => { let e4 = s3.indexOf(t3); e4 !== -1 && s3.splice(e4, 1); } }; } clearCsiHandler(e3) { this._csiHandlers[this._identifier(e3)] && delete this._csiHandlers[this._identifier(e3)]; } setCsiHandlerFallback(e3) { this._csiHandlerFb = e3; } registerDcsHandler(e3, t3) { return this._dcsParser.registerHandler(this._identifier(e3), t3); } clearDcsHandler(e3) { this._dcsParser.clearHandler(this._identifier(e3)); } setDcsHandlerFallback(e3) { this._dcsParser.setHandlerFallback(e3); } registerOscHandler(e3, t3) { return this._oscParser.registerHandler(e3, t3); } clearOscHandler(e3) { this._oscParser.clearHandler(e3); } setOscHandlerFallback(e3) { this._oscParser.setHandlerFallback(e3); } setErrorHandler(e3) { this._errorHandler = e3; } 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(e3, t3, i3, s3, r2) { this._parseStack.state = e3, this._parseStack.handlers = t3, this._parseStack.handlerPos = i3, this._parseStack.transition = s3, this._parseStack.chunkPos = r2; } parse(e3, t3, i3) { let s3, r2 = 0, n2 = 0, o2 = 0; if (this._parseStack.state) if (this._parseStack.state === 2) this._parseStack.state = 0, o2 = this._parseStack.chunkPos + 1; else { if (i3 === void 0 || this._parseStack.state === 1) throw this._parseStack.state = 1, new Error("improper continuation due to previous async handler, giving up parsing"); let t4 = this._parseStack.handlers, n3 = this._parseStack.handlerPos - 1; switch (this._parseStack.state) { case 3: if (i3 === !1 && n3 > -1) { for (; n3 >= 0 && (s3 = t4[n3](this._params), s3 !== !0); n3--) if (s3 instanceof Promise) return this._parseStack.handlerPos = n3, s3; } this._parseStack.handlers = []; break; case 4: if (i3 === !1 && n3 > -1) { for (; n3 >= 0 && (s3 = t4[n3](), s3 !== !0); n3--) if (s3 instanceof Promise) return this._parseStack.handlerPos = n3, s3; } this._parseStack.handlers = []; break; case 6: if (r2 = e3[this._parseStack.chunkPos], s3 = this._dcsParser.unhook(r2 !== 24 && r2 !== 26, i3), s3) return s3; r2 === 27 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0; break; case 5: if (r2 = e3[this._parseStack.chunkPos], s3 = this._oscParser.end(r2 !== 24 && r2 !== 26, i3), s3) return s3; r2 === 27 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0; } this._parseStack.state = 0, o2 = this._parseStack.chunkPos + 1, this.precedingJoinState = 0, this.currentState = 15 & this._parseStack.transition; } for (let i4 = o2; i4 < t3; ++i4) { switch (r2 = e3[i4], n2 = this._transitions.table[this.currentState << 8 | (r2 < 160 ? r2 : h2)], n2 >> 4) { case 2: for (let s4 = i4 + 1; ; ++s4) { if (s4 >= t3 || (r2 = e3[s4]) < 32 || r2 > 126 && r2 < h2) { this._printHandler(e3, i4, s4), i4 = s4 - 1; break; } if (++s4 >= t3 || (r2 = e3[s4]) < 32 || r2 > 126 && r2 < h2) { this._printHandler(e3, i4, s4), i4 = s4 - 1; break; } if (++s4 >= t3 || (r2 = e3[s4]) < 32 || r2 > 126 && r2 < h2) { this._printHandler(e3, i4, s4), i4 = s4 - 1; break; } if (++s4 >= t3 || (r2 = e3[s4]) < 32 || r2 > 126 && r2 < h2) { this._printHandler(e3, i4, s4), i4 = s4 - 1; break; } } break; case 3: this._executeHandlers[r2] ? this._executeHandlers[r2]() : this._executeHandlerFb(r2), this.precedingJoinState = 0; break; case 0: break; case 1: if (this._errorHandler({ position: i4, code: r2, currentState: this.currentState, collect: this._collect, params: this._params, abort: !1 }).abort) return; break; case 7: let o3 = this._csiHandlers[this._collect << 8 | r2], a2 = o3 ? o3.length - 1 : -1; for (; a2 >= 0 && (s3 = o3[a2](this._params), s3 !== !0); a2--) if (s3 instanceof Promise) return this._preserveStack(3, o3, a2, n2, i4), s3; a2 < 0 && this._csiHandlerFb(this._collect << 8 | r2, this._params), this.precedingJoinState = 0; break; case 8: do switch (r2) { case 59: this._params.addParam(0); break; case 58: this._params.addSubParam(-1); break; default: this._params.addDigit(r2 - 48); } while (++i4 < t3 && (r2 = e3[i4]) > 47 && r2 < 60); i4--; break; case 9: this._collect <<= 8, this._collect |= r2; break; case 10: let c2 = this._escHandlers[this._collect << 8 | r2], l = c2 ? c2.length - 1 : -1; for (; l >= 0 && (s3 = c2[l](), s3 !== !0); l--) if (s3 instanceof Promise) return this._preserveStack(4, c2, l, n2, i4), s3; l < 0 && this._escHandlerFb(this._collect << 8 | r2), 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 | r2, this._params); break; case 13: for (let s4 = i4 + 1; ; ++s4) if (s4 >= t3 || (r2 = e3[s4]) === 24 || r2 === 26 || r2 === 27 || r2 > 127 && r2 < h2) { this._dcsParser.put(e3, i4, s4), i4 = s4 - 1; break; } break; case 14: if (s3 = this._dcsParser.unhook(r2 !== 24 && r2 !== 26), s3) return this._preserveStack(6, [], 0, n2, i4), s3; r2 === 27 && (n2 |= 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 s4 = i4 + 1; ; s4++) if (s4 >= t3 || (r2 = e3[s4]) < 32 || r2 > 127 && r2 < h2) { this._oscParser.put(e3, i4, s4), i4 = s4 - 1; break; } break; case 6: if (s3 = this._oscParser.end(r2 !== 24 && r2 !== 26), s3) return this._preserveStack(5, [], 0, n2, i4), s3; r2 === 27 && (n2 |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0; } this.currentState = 15 & n2; } } } t2.EscapeSequenceParser = c; }, 6242: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.OscHandler = t2.OscParser = void 0; let s2 = i2(5770), r = i2(482), n = []; t2.OscParser = class { constructor() { this._state = 0, this._active = n, this._id = -1, this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => { }, this._stack = { paused: !1, loopPosition: 0, fallThrough: !1 }; } registerHandler(e3, t3) { this._handlers[e3] === void 0 && (this._handlers[e3] = []); let i3 = this._handlers[e3]; return i3.push(t3), { dispose: () => { let e4 = i3.indexOf(t3); e4 !== -1 && i3.splice(e4, 1); } }; } clearHandler(e3) { this._handlers[e3] && delete this._handlers[e3]; } setHandlerFallback(e3) { this._handlerFb = e3; } dispose() { this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => { }, this._active = n; } reset() { if (this._state === 2) for (let e3 = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; e3 >= 0; --e3) this._active[e3].end(!1); this._stack.paused = !1, this._active = n, this._id = -1, this._state = 0; } _start() { if (this._active = this._handlers[this._id] || n, this._active.length) for (let e3 = this._active.length - 1; e3 >= 0; e3--) this._active[e3].start(); else this._handlerFb(this._id, "START"); } _put(e3, t3, i3) { if (this._active.length) for (let s3 = this._active.length - 1; s3 >= 0; s3--) this._active[s3].put(e3, t3, i3); else this._handlerFb(this._id, "PUT", (0, r.utf32ToString)(e3, t3, i3)); } start() { this.reset(), this._state = 1; } put(e3, t3, i3) { if (this._state !== 3) { if (this._state === 1) for (; t3 < i3; ) { let i4 = e3[t3++]; if (i4 === 59) { this._state = 2, this._start(); break; } if (i4 < 48 || 57 < i4) return void (this._state = 3); this._id === -1 && (this._id = 0), this._id = 10 * this._id + i4 - 48; } this._state === 2 && i3 - t3 > 0 && this._put(e3, t3, i3); } } end(e3, t3 = !0) { if (this._state !== 0) { if (this._state !== 3) if (this._state === 1 && this._start(), this._active.length) { let i3 = !1, s3 = this._active.length - 1, r2 = !1; if (this._stack.paused && (s3 = this._stack.loopPosition - 1, i3 = t3, r2 = this._stack.fallThrough, this._stack.paused = !1), !r2 && i3 === !1) { for (; s3 >= 0 && (i3 = this._active[s3].end(e3), i3 !== !0); s3--) if (i3 instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = s3, this._stack.fallThrough = !1, i3; s3--; } for (; s3 >= 0; s3--) if (i3 = this._active[s3].end(!1), i3 instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = s3, this._stack.fallThrough = !0, i3; } else this._handlerFb(this._id, "END", e3); this._active = n, this._id = -1, this._state = 0; } } }, t2.OscHandler = class { constructor(e3) { this._handler = e3, this._data = "", this._hitLimit = !1; } start() { this._data = "", this._hitLimit = !1; } put(e3, t3, i3) { this._hitLimit || (this._data += (0, r.utf32ToString)(e3, t3, i3), this._data.length > s2.PAYLOAD_LIMIT && (this._data = "", this._hitLimit = !0)); } end(e3) { let t3 = !1; if (this._hitLimit) t3 = !1; else if (e3 && (t3 = this._handler(this._data), t3 instanceof Promise)) return t3.then(((e4) => (this._data = "", this._hitLimit = !1, e4))); return this._data = "", this._hitLimit = !1, t3; } }; }, 8742: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Params = void 0; let i2 = 2147483647; class s2 { static fromArray(e3) { let t3 = new s2(); if (!e3.length) return t3; for (let i3 = Array.isArray(e3[0]) ? 1 : 0; i3 < e3.length; ++i3) { let s3 = e3[i3]; if (Array.isArray(s3)) for (let e4 = 0; e4 < s3.length; ++e4) t3.addSubParam(s3[e4]); else t3.addParam(s3); } return t3; } constructor(e3 = 32, t3 = 32) { if (this.maxLength = e3, this.maxSubParamsLength = t3, t3 > 256) throw new Error("maxSubParamsLength must not be greater than 256"); this.params = new Int32Array(e3), this.length = 0, this._subParams = new Int32Array(t3), this._subParamsLength = 0, this._subParamsIdx = new Uint16Array(e3), this._rejectDigits = !1, this._rejectSubDigits = !1, this._digitIsSub = !1; } clone() { let e3 = new s2(this.maxLength, this.maxSubParamsLength); return e3.params.set(this.params), e3.length = this.length, e3._subParams.set(this._subParams), e3._subParamsLength = this._subParamsLength, e3._subParamsIdx.set(this._subParamsIdx), e3._rejectDigits = this._rejectDigits, e3._rejectSubDigits = this._rejectSubDigits, e3._digitIsSub = this._digitIsSub, e3; } toArray() { let e3 = []; for (let t3 = 0; t3 < this.length; ++t3) { e3.push(this.params[t3]); let i3 = this._subParamsIdx[t3] >> 8, s3 = 255 & this._subParamsIdx[t3]; s3 - i3 > 0 && e3.push(Array.prototype.slice.call(this._subParams, i3, s3)); } return e3; } reset() { this.length = 0, this._subParamsLength = 0, this._rejectDigits = !1, this._rejectSubDigits = !1, this._digitIsSub = !1; } addParam(e3) { if (this._digitIsSub = !1, this.length >= this.maxLength) this._rejectDigits = !0; else { if (e3 < -1) throw new Error("values lesser than -1 are not allowed"); this._subParamsIdx[this.length] = this._subParamsLength << 8 | this._subParamsLength, this.params[this.length++] = e3 > i2 ? i2 : e3; } } addSubParam(e3) { if (this._digitIsSub = !0, this.length) if (this._rejectDigits || this._subParamsLength >= this.maxSubParamsLength) this._rejectSubDigits = !0; else { if (e3 < -1) throw new Error("values lesser than -1 are not allowed"); this._subParams[this._subParamsLength++] = e3 > i2 ? i2 : e3, this._subParamsIdx[this.length - 1]++; } } hasSubParams(e3) { return (255 & this._subParamsIdx[e3]) - (this._subParamsIdx[e3] >> 8) > 0; } getSubParams(e3) { let t3 = this._subParamsIdx[e3] >> 8, i3 = 255 & this._subParamsIdx[e3]; return i3 - t3 > 0 ? this._subParams.subarray(t3, i3) : null; } getSubParamsAll() { let e3 = {}; for (let t3 = 0; t3 < this.length; ++t3) { let i3 = this._subParamsIdx[t3] >> 8, s3 = 255 & this._subParamsIdx[t3]; s3 - i3 > 0 && (e3[t3] = this._subParams.slice(i3, s3)); } return e3; } addDigit(e3) { let t3; if (this._rejectDigits || !(t3 = this._digitIsSub ? this._subParamsLength : this.length) || this._digitIsSub && this._rejectSubDigits) return; let s3 = this._digitIsSub ? this._subParams : this.params, r = s3[t3 - 1]; s3[t3 - 1] = ~r ? Math.min(10 * r + e3, i2) : e3; } } t2.Params = s2; }, 5741: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.AddonManager = void 0, t2.AddonManager = class { constructor() { this._addons = []; } dispose() { for (let e3 = this._addons.length - 1; e3 >= 0; e3--) this._addons[e3].instance.dispose(); } loadAddon(e3, t3) { let i2 = { instance: t3, dispose: t3.dispose, isDisposed: !1 }; this._addons.push(i2), t3.dispose = () => this._wrappedAddonDispose(i2), t3.activate(e3); } _wrappedAddonDispose(e3) { if (e3.isDisposed) return; let t3 = -1; for (let i2 = 0; i2 < this._addons.length; i2++) if (this._addons[i2] === e3) { t3 = i2; break; } if (t3 === -1) throw new Error("Could not dispose an addon that has not been loaded"); e3.isDisposed = !0, e3.dispose.apply(e3.instance), this._addons.splice(t3, 1); } }; }, 8771: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferApiView = void 0; let s2 = i2(3785), r = i2(511); t2.BufferApiView = class { constructor(e3, t3) { this._buffer = e3, this.type = t3; } init(e3) { return this._buffer = e3, 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(e3) { let t3 = this._buffer.lines.get(e3); if (t3) return new s2.BufferLineApiView(t3); } getNullCell() { return new r.CellData(); } }; }, 3785: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferLineApiView = void 0; let s2 = i2(511); t2.BufferLineApiView = class { constructor(e3) { this._line = e3; } get isWrapped() { return this._line.isWrapped; } get length() { return this._line.length; } getCell(e3, t3) { if (!(e3 < 0 || e3 >= this._line.length)) return t3 ? (this._line.loadCell(e3, t3), t3) : this._line.loadCell(e3, new s2.CellData()); } translateToString(e3, t3, i3) { return this._line.translateToString(e3, t3, i3); } }; }, 8285: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferNamespaceApi = void 0; let s2 = i2(8771), r = i2(8460), n = i2(844); class o extends n.Disposable { constructor(e3) { super(), this._core = e3, this._onBufferChange = this.register(new r.EventEmitter()), this.onBufferChange = this._onBufferChange.event, this._normal = new s2.BufferApiView(this._core.buffers.normal, "normal"), this._alternate = new s2.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); } } t2.BufferNamespaceApi = o; }, 7975: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.ParserApi = void 0, t2.ParserApi = class { constructor(e3) { this._core = e3; } registerCsiHandler(e3, t3) { return this._core.registerCsiHandler(e3, ((e4) => t3(e4.toArray()))); } addCsiHandler(e3, t3) { return this.registerCsiHandler(e3, t3); } registerDcsHandler(e3, t3) { return this._core.registerDcsHandler(e3, ((e4, i2) => t3(e4, i2.toArray()))); } addDcsHandler(e3, t3) { return this.registerDcsHandler(e3, t3); } registerEscHandler(e3, t3) { return this._core.registerEscHandler(e3, t3); } addEscHandler(e3, t3) { return this.registerEscHandler(e3, t3); } registerOscHandler(e3, t3) { return this._core.registerOscHandler(e3, t3); } addOscHandler(e3, t3) { return this.registerOscHandler(e3, t3); } }; }, 7090: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.UnicodeApi = void 0, t2.UnicodeApi = class { constructor(e3) { this._core = e3; } register(e3) { this._core.unicodeService.register(e3); } get versions() { return this._core.unicodeService.versions; } get activeVersion() { return this._core.unicodeService.activeVersion; } set activeVersion(e3) { this._core.unicodeService.activeVersion = e3; } }; }, 744: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferService = t2.MINIMUM_ROWS = t2.MINIMUM_COLS = void 0; let n = i2(8460), o = i2(844), a = i2(5295), h2 = i2(2585); t2.MINIMUM_COLS = 2, t2.MINIMUM_ROWS = 1; let c = t2.BufferService = class extends o.Disposable { get buffer() { return this.buffers.active; } constructor(e3) { super(), this.isUserScrolling = !1, this._onResize = this.register(new n.EventEmitter()), this.onResize = this._onResize.event, this._onScroll = this.register(new n.EventEmitter()), this.onScroll = this._onScroll.event, this.cols = Math.max(e3.rawOptions.cols || 0, t2.MINIMUM_COLS), this.rows = Math.max(e3.rawOptions.rows || 0, t2.MINIMUM_ROWS), this.buffers = this.register(new a.BufferSet(e3, this)); } resize(e3, t3) { this.cols = e3, this.rows = t3, this.buffers.resize(e3, t3), this._onResize.fire({ cols: e3, rows: t3 }); } reset() { this.buffers.reset(), this.isUserScrolling = !1; } scroll(e3, t3 = !1) { let i3 = this.buffer, s3; s3 = this._cachedBlankLine, s3 && s3.length === this.cols && s3.getFg(0) === e3.fg && s3.getBg(0) === e3.bg || (s3 = i3.getBlankLine(e3, t3), this._cachedBlankLine = s3), s3.isWrapped = t3; let r2 = i3.ybase + i3.scrollTop, n2 = i3.ybase + i3.scrollBottom; if (i3.scrollTop === 0) { let e4 = i3.lines.isFull; n2 === i3.lines.length - 1 ? e4 ? i3.lines.recycle().copyFrom(s3) : i3.lines.push(s3.clone()) : i3.lines.splice(n2 + 1, 0, s3.clone()), e4 ? this.isUserScrolling && (i3.ydisp = Math.max(i3.ydisp - 1, 0)) : (i3.ybase++, this.isUserScrolling || i3.ydisp++); } else { let e4 = n2 - r2 + 1; i3.lines.shiftElements(r2 + 1, e4 - 1, -1), i3.lines.set(n2, s3.clone()); } this.isUserScrolling || (i3.ydisp = i3.ybase), this._onScroll.fire(i3.ydisp); } scrollLines(e3, t3, i3) { let s3 = this.buffer; if (e3 < 0) { if (s3.ydisp === 0) return; this.isUserScrolling = !0; } else e3 + s3.ydisp >= s3.ybase && (this.isUserScrolling = !1); let r2 = s3.ydisp; s3.ydisp = Math.max(Math.min(s3.ydisp + e3, s3.ybase), 0), r2 !== s3.ydisp && (t3 || this._onScroll.fire(s3.ydisp)); } }; t2.BufferService = c = s2([r(0, h2.IOptionsService)], c); }, 7994: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CharsetService = void 0, t2.CharsetService = class { constructor() { this.glevel = 0, this._charsets = []; } reset() { this.charset = void 0, this._charsets = [], this.glevel = 0; } setgLevel(e3) { this.glevel = e3, this.charset = this._charsets[e3]; } setgCharset(e3, t3) { this._charsets[e3] = t3, this.glevel === e3 && (this.charset = t3); } }; }, 1753: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CoreMouseService = void 0; let n = i2(2585), o = i2(8460), a = i2(844), h2 = { NONE: { events: 0, restrict: () => !1 }, X10: { events: 1, restrict: (e3) => e3.button !== 4 && e3.action === 1 && (e3.ctrl = !1, e3.alt = !1, e3.shift = !1, !0) }, VT200: { events: 19, restrict: (e3) => e3.action !== 32 }, DRAG: { events: 23, restrict: (e3) => e3.action !== 32 || e3.button !== 3 }, ANY: { events: 31, restrict: (e3) => !0 } }; function c(e3, t3) { let i3 = (e3.ctrl ? 16 : 0) | (e3.shift ? 4 : 0) | (e3.alt ? 8 : 0); return e3.button === 4 ? (i3 |= 64, i3 |= e3.action) : (i3 |= 3 & e3.button, 4 & e3.button && (i3 |= 64), 8 & e3.button && (i3 |= 128), e3.action === 32 ? i3 |= 32 : e3.action !== 0 || t3 || (i3 |= 3)), i3; } let l = String.fromCharCode, d = { DEFAULT: (e3) => { let t3 = [c(e3, !1) + 32, e3.col + 32, e3.row + 32]; return t3[0] > 255 || t3[1] > 255 || t3[2] > 255 ? "" : `\x1B[M${l(t3[0])}${l(t3[1])}${l(t3[2])}`; }, SGR: (e3) => { let t3 = e3.action === 0 && e3.button !== 4 ? "m" : "M"; return `\x1B[<${c(e3, !0)};${e3.col};${e3.row}${t3}`; }, SGR_PIXELS: (e3) => { let t3 = e3.action === 0 && e3.button !== 4 ? "m" : "M"; return `\x1B[<${c(e3, !0)};${e3.x};${e3.y}${t3}`; } }, _ = t2.CoreMouseService = class extends a.Disposable { constructor(e3, t3) { super(), this._bufferService = e3, this._coreService = t3, this._protocols = {}, this._encodings = {}, this._activeProtocol = "", this._activeEncoding = "", this._lastEvent = null, this._onProtocolChange = this.register(new o.EventEmitter()), this.onProtocolChange = this._onProtocolChange.event; for (let e4 of Object.keys(h2)) this.addProtocol(e4, h2[e4]); for (let e4 of Object.keys(d)) this.addEncoding(e4, d[e4]); this.reset(); } addProtocol(e3, t3) { this._protocols[e3] = t3; } addEncoding(e3, t3) { this._encodings[e3] = t3; } get activeProtocol() { return this._activeProtocol; } get areMouseEventsActive() { return this._protocols[this._activeProtocol].events !== 0; } set activeProtocol(e3) { if (!this._protocols[e3]) throw new Error(`unknown protocol "${e3}"`); this._activeProtocol = e3, this._onProtocolChange.fire(this._protocols[e3].events); } get activeEncoding() { return this._activeEncoding; } set activeEncoding(e3) { if (!this._encodings[e3]) throw new Error(`unknown encoding "${e3}"`); this._activeEncoding = e3; } reset() { this.activeProtocol = "NONE", this.activeEncoding = "DEFAULT", this._lastEvent = null; } triggerMouseEvent(e3) { if (e3.col < 0 || e3.col >= this._bufferService.cols || e3.row < 0 || e3.row >= this._bufferService.rows || e3.button === 4 && e3.action === 32 || e3.button === 3 && e3.action !== 32 || e3.button !== 4 && (e3.action === 2 || e3.action === 3) || (e3.col++, e3.row++, e3.action === 32 && this._lastEvent && this._equalEvents(this._lastEvent, e3, this._activeEncoding === "SGR_PIXELS")) || !this._protocols[this._activeProtocol].restrict(e3)) return !1; let t3 = this._encodings[this._activeEncoding](e3); return t3 && (this._activeEncoding === "DEFAULT" ? this._coreService.triggerBinaryEvent(t3) : this._coreService.triggerDataEvent(t3, !0)), this._lastEvent = e3, !0; } explainEvents(e3) { return { down: !!(1 & e3), up: !!(2 & e3), drag: !!(4 & e3), move: !!(8 & e3), wheel: !!(16 & e3) }; } _equalEvents(e3, t3, i3) { if (i3) { if (e3.x !== t3.x || e3.y !== t3.y) return !1; } else if (e3.col !== t3.col || e3.row !== t3.row) return !1; return e3.button === t3.button && e3.action === t3.action && e3.ctrl === t3.ctrl && e3.alt === t3.alt && e3.shift === t3.shift; } }; t2.CoreMouseService = _ = s2([r(0, n.IBufferService), r(1, n.ICoreService)], _); }, 6975: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CoreService = void 0; let n = i2(1439), o = i2(8460), a = i2(844), h2 = i2(2585), c = Object.freeze({ insertMode: !1 }), l = Object.freeze({ applicationCursorKeys: !1, applicationKeypad: !1, bracketedPasteMode: !1, origin: !1, reverseWraparound: !1, sendFocus: !1, wraparound: !0 }), d = t2.CoreService = class extends a.Disposable { constructor(e3, t3, i3) { super(), this._bufferService = e3, this._logService = t3, this._optionsService = i3, this.isCursorInitialized = !1, this.isCursorHidden = !1, this._onData = this.register(new o.EventEmitter()), this.onData = this._onData.event, this._onUserInput = this.register(new o.EventEmitter()), this.onUserInput = this._onUserInput.event, this._onBinary = this.register(new o.EventEmitter()), this.onBinary = this._onBinary.event, this._onRequestScrollToBottom = this.register(new o.EventEmitter()), this.onRequestScrollToBottom = this._onRequestScrollToBottom.event, this.modes = (0, n.clone)(c), this.decPrivateModes = (0, n.clone)(l); } reset() { this.modes = (0, n.clone)(c), this.decPrivateModes = (0, n.clone)(l); } triggerDataEvent(e3, t3 = !1) { if (this._optionsService.rawOptions.disableStdin) return; let i3 = this._bufferService.buffer; t3 && this._optionsService.rawOptions.scrollOnUserInput && i3.ybase !== i3.ydisp && this._onRequestScrollToBottom.fire(), t3 && this._onUserInput.fire(), this._logService.debug(`sending data "${e3}"`, (() => e3.split("").map(((e4) => e4.charCodeAt(0))))), this._onData.fire(e3); } triggerBinaryEvent(e3) { this._optionsService.rawOptions.disableStdin || (this._logService.debug(`sending binary "${e3}"`, (() => e3.split("").map(((e4) => e4.charCodeAt(0))))), this._onBinary.fire(e3)); } }; t2.CoreService = d = s2([r(0, h2.IBufferService), r(1, h2.ILogService), r(2, h2.IOptionsService)], d); }, 9074: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.DecorationService = void 0; let s2 = i2(8055), r = i2(8460), n = i2(844), o = i2(6106), a = 0, h2 = 0; class c extends n.Disposable { get decorations() { return this._decorations.values(); } constructor() { super(), this._decorations = new o.SortedList(((e3) => e3?.marker.line)), this._onDecorationRegistered = this.register(new r.EventEmitter()), this.onDecorationRegistered = this._onDecorationRegistered.event, this._onDecorationRemoved = this.register(new r.EventEmitter()), this.onDecorationRemoved = this._onDecorationRemoved.event, this.register((0, n.toDisposable)((() => this.reset()))); } registerDecoration(e3) { if (e3.marker.isDisposed) return; let t3 = new l(e3); if (t3) { let e4 = t3.marker.onDispose((() => t3.dispose())); t3.onDispose((() => { t3 && (this._decorations.delete(t3) && this._onDecorationRemoved.fire(t3), e4.dispose()); })), this._decorations.insert(t3), this._onDecorationRegistered.fire(t3); } return t3; } reset() { for (let e3 of this._decorations.values()) e3.dispose(); this._decorations.clear(); } *getDecorationsAtCell(e3, t3, i3) { let s3 = 0, r2 = 0; for (let n2 of this._decorations.getKeyIterator(t3)) s3 = n2.options.x ?? 0, r2 = s3 + (n2.options.width ?? 1), e3 >= s3 && e3 < r2 && (!i3 || (n2.options.layer ?? "bottom") === i3) && (yield n2); } forEachDecorationAtCell(e3, t3, i3, s3) { this._decorations.forEachByKey(t3, ((t4) => { a = t4.options.x ?? 0, h2 = a + (t4.options.width ?? 1), e3 >= a && e3 < h2 && (!i3 || (t4.options.layer ?? "bottom") === i3) && s3(t4); })); } } t2.DecorationService = c; class l extends n.Disposable { get isDisposed() { return this._isDisposed; } get backgroundColorRGB() { return this._cachedBg === null && (this.options.backgroundColor ? this._cachedBg = s2.css.toColor(this.options.backgroundColor) : this._cachedBg = void 0), this._cachedBg; } get foregroundColorRGB() { return this._cachedFg === null && (this.options.foregroundColor ? this._cachedFg = s2.css.toColor(this.options.foregroundColor) : this._cachedFg = void 0), this._cachedFg; } constructor(e3) { super(), this.options = e3, this.onRenderEmitter = this.register(new r.EventEmitter()), this.onRender = this.onRenderEmitter.event, this._onDispose = this.register(new r.EventEmitter()), this.onDispose = this._onDispose.event, this._cachedBg = null, this._cachedFg = null, this.marker = e3.marker, this.options.overviewRulerOptions && !this.options.overviewRulerOptions.position && (this.options.overviewRulerOptions.position = "full"); } dispose() { this._onDispose.fire(), super.dispose(); } } }, 4348: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.InstantiationService = t2.ServiceCollection = void 0; let s2 = i2(2585), r = i2(8343); class n { constructor(...e3) { this._entries = /* @__PURE__ */ new Map(); for (let [t3, i3] of e3) this.set(t3, i3); } set(e3, t3) { let i3 = this._entries.get(e3); return this._entries.set(e3, t3), i3; } forEach(e3) { for (let [t3, i3] of this._entries.entries()) e3(t3, i3); } has(e3) { return this._entries.has(e3); } get(e3) { return this._entries.get(e3); } } t2.ServiceCollection = n, t2.InstantiationService = class { constructor() { this._services = new n(), this._services.set(s2.IInstantiationService, this); } setService(e3, t3) { this._services.set(e3, t3); } getService(e3) { return this._services.get(e3); } createInstance(e3, ...t3) { let i3 = (0, r.getServiceDependencies)(e3).sort(((e4, t4) => e4.index - t4.index)), s3 = []; for (let t4 of i3) { let i4 = this._services.get(t4.id); if (!i4) throw new Error(`[createInstance] ${e3.name} depends on UNKNOWN service ${t4.id}.`); s3.push(i4); } let n2 = i3.length > 0 ? i3[0].index : t3.length; if (t3.length !== n2) throw new Error(`[createInstance] First service dependency of ${e3.name} at position ${n2 + 1} conflicts with ${t3.length} static arguments`); return new e3(...t3, ...s3); } }; }, 7866: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.traceCall = t2.setTraceLogger = t2.LogService = void 0; let n = i2(844), o = i2(2585), a = { trace: o.LogLevelEnum.TRACE, debug: o.LogLevelEnum.DEBUG, info: o.LogLevelEnum.INFO, warn: o.LogLevelEnum.WARN, error: o.LogLevelEnum.ERROR, off: o.LogLevelEnum.OFF }, h2, c = t2.LogService = class extends n.Disposable { get logLevel() { return this._logLevel; } constructor(e3) { super(), this._optionsService = e3, this._logLevel = o.LogLevelEnum.OFF, this._updateLogLevel(), this.register(this._optionsService.onSpecificOptionChange("logLevel", (() => this._updateLogLevel()))), h2 = this; } _updateLogLevel() { this._logLevel = a[this._optionsService.rawOptions.logLevel]; } _evalLazyOptionalParams(e3) { for (let t3 = 0; t3 < e3.length; t3++) typeof e3[t3] == "function" && (e3[t3] = e3[t3]()); } _log(e3, t3, i3) { this._evalLazyOptionalParams(i3), e3.call(console, (this._optionsService.options.logger ? "" : "xterm.js: ") + t3, ...i3); } trace(e3, ...t3) { this._logLevel <= o.LogLevelEnum.TRACE && this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger) ?? console.log, e3, t3); } debug(e3, ...t3) { this._logLevel <= o.LogLevelEnum.DEBUG && this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger) ?? console.log, e3, t3); } info(e3, ...t3) { this._logLevel <= o.LogLevelEnum.INFO && this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger) ?? console.info, e3, t3); } warn(e3, ...t3) { this._logLevel <= o.LogLevelEnum.WARN && this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger) ?? console.warn, e3, t3); } error(e3, ...t3) { this._logLevel <= o.LogLevelEnum.ERROR && this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger) ?? console.error, e3, t3); } }; t2.LogService = c = s2([r(0, o.IOptionsService)], c), t2.setTraceLogger = function(e3) { h2 = e3; }, t2.traceCall = function(e3, t3, i3) { if (typeof i3.value != "function") throw new Error("not supported"); let s3 = i3.value; i3.value = function(...e4) { if (h2.logLevel !== o.LogLevelEnum.TRACE) return s3.apply(this, e4); h2.trace(`GlyphRenderer#${s3.name}(${e4.map(((e5) => JSON.stringify(e5))).join(", ")})`); let t4 = s3.apply(this, e4); return h2.trace(`GlyphRenderer#${s3.name} return`, t4), t4; }; }; }, 7302: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.OptionsService = t2.DEFAULT_OPTIONS = void 0; let s2 = i2(8460), r = i2(844), n = i2(6114); t2.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: n.isMac, windowOptions: {}, windowsMode: !1, windowsPty: {}, wordSeparator: " ()[]{}',\"`", altClickMovesCursor: !0, convertEol: !1, termName: "xterm", cancelEvents: !1, overviewRulerWidth: 0 }; let o = ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"]; class a extends r.Disposable { constructor(e3) { super(), this._onOptionChange = this.register(new s2.EventEmitter()), this.onOptionChange = this._onOptionChange.event; let i3 = { ...t2.DEFAULT_OPTIONS }; for (let t3 in e3) if (t3 in i3) try { let s3 = e3[t3]; i3[t3] = this._sanitizeAndValidateOption(t3, s3); } catch (e4) { console.error(e4); } this.rawOptions = i3, this.options = { ...i3 }, this._setupOptions(), this.register((0, r.toDisposable)((() => { this.rawOptions.linkHandler = null, this.rawOptions.documentOverride = null; }))); } onSpecificOptionChange(e3, t3) { return this.onOptionChange(((i3) => { i3 === e3 && t3(this.rawOptions[e3]); })); } onMultipleOptionChange(e3, t3) { return this.onOptionChange(((i3) => { e3.indexOf(i3) !== -1 && t3(); })); } _setupOptions() { let e3 = (e4) => { if (!(e4 in t2.DEFAULT_OPTIONS)) throw new Error(`No option with key "${e4}"`); return this.rawOptions[e4]; }, i3 = (e4, i4) => { if (!(e4 in t2.DEFAULT_OPTIONS)) throw new Error(`No option with key "${e4}"`); i4 = this._sanitizeAndValidateOption(e4, i4), this.rawOptions[e4] !== i4 && (this.rawOptions[e4] = i4, this._onOptionChange.fire(e4)); }; for (let t3 in this.rawOptions) { let s3 = { get: e3.bind(this, t3), set: i3.bind(this, t3) }; Object.defineProperty(this.options, t3, s3); } } _sanitizeAndValidateOption(e3, i3) { switch (e3) { case "cursorStyle": if (i3 || (i3 = t2.DEFAULT_OPTIONS[e3]), !/* @__PURE__ */ (function(e4) { return e4 === "block" || e4 === "underline" || e4 === "bar"; })(i3)) throw new Error(`"${i3}" is not a valid value for ${e3}`); break; case "wordSeparator": i3 || (i3 = t2.DEFAULT_OPTIONS[e3]); break; case "fontWeight": case "fontWeightBold": if (typeof i3 == "number" && 1 <= i3 && i3 <= 1e3) break; i3 = o.includes(i3) ? i3 : t2.DEFAULT_OPTIONS[e3]; break; case "cursorWidth": i3 = Math.floor(i3); case "lineHeight": case "tabStopWidth": if (i3 < 1) throw new Error(`${e3} cannot be less than 1, value: ${i3}`); break; case "minimumContrastRatio": i3 = Math.max(1, Math.min(21, Math.round(10 * i3) / 10)); break; case "scrollback": if ((i3 = Math.min(i3, 4294967295)) < 0) throw new Error(`${e3} cannot be less than 0, value: ${i3}`); break; case "fastScrollSensitivity": case "scrollSensitivity": if (i3 <= 0) throw new Error(`${e3} cannot be less than or equal to 0, value: ${i3}`); break; case "rows": case "cols": if (!i3 && i3 !== 0) throw new Error(`${e3} must be numeric, value: ${i3}`); break; case "windowsPty": i3 = i3 ?? {}; } return i3; } } t2.OptionsService = a; }, 2660: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, n2 = arguments.length, o2 = n2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") o2 = Reflect.decorate(e3, t3, i3, s3); else for (var a = e3.length - 1; a >= 0; a--) (r2 = e3[a]) && (o2 = (n2 < 3 ? r2(o2) : n2 > 3 ? r2(t3, i3, o2) : r2(t3, i3)) || o2); return n2 > 3 && o2 && Object.defineProperty(t3, i3, o2), o2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.OscLinkService = void 0; let n = i2(2585), o = t2.OscLinkService = class { constructor(e3) { this._bufferService = e3, this._nextId = 1, this._entriesWithId = /* @__PURE__ */ new Map(), this._dataByLinkId = /* @__PURE__ */ new Map(); } registerLink(e3) { let t3 = this._bufferService.buffer; if (e3.id === void 0) { let i4 = t3.addMarker(t3.ybase + t3.y), s4 = { data: e3, id: this._nextId++, lines: [i4] }; return i4.onDispose((() => this._removeMarkerFromLink(s4, i4))), this._dataByLinkId.set(s4.id, s4), s4.id; } let i3 = e3, s3 = this._getEntryIdKey(i3), r2 = this._entriesWithId.get(s3); if (r2) return this.addLineToLink(r2.id, t3.ybase + t3.y), r2.id; let n2 = t3.addMarker(t3.ybase + t3.y), o2 = { id: this._nextId++, key: this._getEntryIdKey(i3), data: i3, lines: [n2] }; return n2.onDispose((() => this._removeMarkerFromLink(o2, n2))), this._entriesWithId.set(o2.key, o2), this._dataByLinkId.set(o2.id, o2), o2.id; } addLineToLink(e3, t3) { let i3 = this._dataByLinkId.get(e3); if (i3 && i3.lines.every(((e4) => e4.line !== t3))) { let e4 = this._bufferService.buffer.addMarker(t3); i3.lines.push(e4), e4.onDispose((() => this._removeMarkerFromLink(i3, e4))); } } getLinkData(e3) { return this._dataByLinkId.get(e3)?.data; } _getEntryIdKey(e3) { return `${e3.id};;${e3.uri}`; } _removeMarkerFromLink(e3, t3) { let i3 = e3.lines.indexOf(t3); i3 !== -1 && (e3.lines.splice(i3, 1), e3.lines.length === 0 && (e3.data.id !== void 0 && this._entriesWithId.delete(e3.key), this._dataByLinkId.delete(e3.id))); } }; t2.OscLinkService = o = s2([r(0, n.IBufferService)], o); }, 8343: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.createDecorator = t2.getServiceDependencies = t2.serviceRegistry = void 0; let i2 = "di$target", s2 = "di$dependencies"; t2.serviceRegistry = /* @__PURE__ */ new Map(), t2.getServiceDependencies = function(e3) { return e3[s2] || []; }, t2.createDecorator = function(e3) { if (t2.serviceRegistry.has(e3)) return t2.serviceRegistry.get(e3); let r = function(e4, t3, n) { if (arguments.length !== 3) throw new Error("@IServiceName-decorator can only be used to decorate a parameter"); (function(e5, t4, r2) { t4[i2] === t4 ? t4[s2].push({ id: e5, index: r2 }) : (t4[s2] = [{ id: e5, index: r2 }], t4[i2] = t4); })(r, e4, n); }; return r.toString = () => e3, t2.serviceRegistry.set(e3, r), r; }; }, 2585: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.IDecorationService = t2.IUnicodeService = t2.IOscLinkService = t2.IOptionsService = t2.ILogService = t2.LogLevelEnum = t2.IInstantiationService = t2.ICharsetService = t2.ICoreService = t2.ICoreMouseService = t2.IBufferService = void 0; let s2 = i2(8343); var r; t2.IBufferService = (0, s2.createDecorator)("BufferService"), t2.ICoreMouseService = (0, s2.createDecorator)("CoreMouseService"), t2.ICoreService = (0, s2.createDecorator)("CoreService"), t2.ICharsetService = (0, s2.createDecorator)("CharsetService"), t2.IInstantiationService = (0, s2.createDecorator)("InstantiationService"), (function(e3) { e3[e3.TRACE = 0] = "TRACE", e3[e3.DEBUG = 1] = "DEBUG", e3[e3.INFO = 2] = "INFO", e3[e3.WARN = 3] = "WARN", e3[e3.ERROR = 4] = "ERROR", e3[e3.OFF = 5] = "OFF"; })(r || (t2.LogLevelEnum = r = {})), t2.ILogService = (0, s2.createDecorator)("LogService"), t2.IOptionsService = (0, s2.createDecorator)("OptionsService"), t2.IOscLinkService = (0, s2.createDecorator)("OscLinkService"), t2.IUnicodeService = (0, s2.createDecorator)("UnicodeService"), t2.IDecorationService = (0, s2.createDecorator)("DecorationService"); }, 1480: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.UnicodeService = void 0; let s2 = i2(8460), r = i2(225); class n { static extractShouldJoin(e3) { return (1 & e3) != 0; } static extractWidth(e3) { return e3 >> 1 & 3; } static extractCharKind(e3) { return e3 >> 3; } static createPropertyValue(e3, t3, i3 = !1) { return (16777215 & e3) << 3 | (3 & t3) << 1 | (i3 ? 1 : 0); } constructor() { this._providers = /* @__PURE__ */ Object.create(null), this._active = "", this._onChange = new s2.EventEmitter(), this.onChange = this._onChange.event; let e3 = new r.UnicodeV6(); this.register(e3), this._active = e3.version, this._activeProvider = e3; } dispose() { this._onChange.dispose(); } get versions() { return Object.keys(this._providers); } get activeVersion() { return this._active; } set activeVersion(e3) { if (!this._providers[e3]) throw new Error(`unknown Unicode version "${e3}"`); this._active = e3, this._activeProvider = this._providers[e3], this._onChange.fire(e3); } register(e3) { this._providers[e3.version] = e3; } wcwidth(e3) { return this._activeProvider.wcwidth(e3); } getStringCellWidth(e3) { let t3 = 0, i3 = 0, s3 = e3.length; for (let r2 = 0; r2 < s3; ++r2) { let o = e3.charCodeAt(r2); if (55296 <= o && o <= 56319) { if (++r2 >= s3) return t3 + this.wcwidth(o); let i4 = e3.charCodeAt(r2); 56320 <= i4 && i4 <= 57343 ? o = 1024 * (o - 55296) + i4 - 56320 + 65536 : t3 += this.wcwidth(i4); } let a = this.charProperties(o, i3), h2 = n.extractWidth(a); n.extractShouldJoin(a) && (h2 -= n.extractWidth(i3)), t3 += h2, i3 = a; } return t3; } charProperties(e3, t3) { return this._activeProvider.charProperties(e3, t3); } } t2.UnicodeService = n; } }, t = {}; function i(s2) { var r = t[s2]; if (r !== void 0) return r.exports; var n = t[s2] = { exports: {} }; return e[s2].call(n.exports, n, n.exports, i), n.exports; } var s = {}; return (() => { var e2 = s; Object.defineProperty(e2, "__esModule", { value: !0 }), e2.Terminal = void 0; let t2 = i(9042), r = i(3236), n = i(844), o = i(5741), a = i(8285), h2 = i(7975), c = i(7090), l = ["cols", "rows"]; class d extends n.Disposable { constructor(e3) { super(), this._core = this.register(new r.Terminal(e3)), this._addonManager = this.register(new o.AddonManager()), this._publicOptions = { ...this._core.options }; let t3 = (e4) => this._core.options[e4], i2 = (e4, t4) => { this._checkReadonlyOptions(e4), this._core.options[e4] = t4; }; for (let e4 in this._core.options) { let s2 = { get: t3.bind(this, e4), set: i2.bind(this, e4) }; Object.defineProperty(this._publicOptions, e4, s2); } } _checkReadonlyOptions(e3) { if (l.includes(e3)) throw new Error(`Option "${e3}" 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 h2.ParserApi(this._core)), this._parser; } get unicode() { return this._checkProposedApi(), new c.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() { let e3 = this._core.coreService.decPrivateModes, t3 = "none"; switch (this._core.coreMouseService.activeProtocol) { case "X10": t3 = "x10"; break; case "VT200": t3 = "vt200"; break; case "DRAG": t3 = "drag"; break; case "ANY": t3 = "any"; } return { applicationCursorKeysMode: e3.applicationCursorKeys, applicationKeypadMode: e3.applicationKeypad, bracketedPasteMode: e3.bracketedPasteMode, insertMode: this._core.coreService.modes.insertMode, mouseTrackingMode: t3, originMode: e3.origin, reverseWraparoundMode: e3.reverseWraparound, sendFocusMode: e3.sendFocus, wraparoundMode: e3.wraparound }; } get options() { return this._publicOptions; } set options(e3) { for (let t3 in e3) this._publicOptions[t3] = e3[t3]; } blur() { this._core.blur(); } focus() { this._core.focus(); } input(e3, t3 = !0) { this._core.input(e3, t3); } resize(e3, t3) { this._verifyIntegers(e3, t3), this._core.resize(e3, t3); } open(e3) { this._core.open(e3); } attachCustomKeyEventHandler(e3) { this._core.attachCustomKeyEventHandler(e3); } attachCustomWheelEventHandler(e3) { this._core.attachCustomWheelEventHandler(e3); } registerLinkProvider(e3) { return this._core.registerLinkProvider(e3); } registerCharacterJoiner(e3) { return this._checkProposedApi(), this._core.registerCharacterJoiner(e3); } deregisterCharacterJoiner(e3) { this._checkProposedApi(), this._core.deregisterCharacterJoiner(e3); } registerMarker(e3 = 0) { return this._verifyIntegers(e3), this._core.registerMarker(e3); } registerDecoration(e3) { return this._checkProposedApi(), this._verifyPositiveIntegers(e3.x ?? 0, e3.width ?? 0, e3.height ?? 0), this._core.registerDecoration(e3); } hasSelection() { return this._core.hasSelection(); } select(e3, t3, i2) { this._verifyIntegers(e3, t3, i2), this._core.select(e3, t3, i2); } getSelection() { return this._core.getSelection(); } getSelectionPosition() { return this._core.getSelectionPosition(); } clearSelection() { this._core.clearSelection(); } selectAll() { this._core.selectAll(); } selectLines(e3, t3) { this._verifyIntegers(e3, t3), this._core.selectLines(e3, t3); } dispose() { super.dispose(); } scrollLines(e3) { this._verifyIntegers(e3), this._core.scrollLines(e3); } scrollPages(e3) { this._verifyIntegers(e3), this._core.scrollPages(e3); } scrollToTop() { this._core.scrollToTop(); } scrollToBottom() { this._core.scrollToBottom(); } scrollToLine(e3) { this._verifyIntegers(e3), this._core.scrollToLine(e3); } clear() { this._core.clear(); } write(e3, t3) { this._core.write(e3, t3); } writeln(e3, t3) { this._core.write(e3), this._core.write(`\r `, t3); } paste(e3) { this._core.paste(e3); } refresh(e3, t3) { this._verifyIntegers(e3, t3), this._core.refresh(e3, t3); } reset() { this._core.reset(); } clearTextureAtlas() { this._core.clearTextureAtlas(); } loadAddon(e3) { this._addonManager.loadAddon(this, e3); } static get strings() { return t2; } _verifyIntegers(...e3) { for (let t3 of e3) if (t3 === 1 / 0 || isNaN(t3) || t3 % 1 != 0) throw new Error("This API only accepts integers"); } _verifyPositiveIntegers(...e3) { for (let t3 of e3) if (t3 && (t3 === 1 / 0 || isNaN(t3) || t3 % 1 != 0 || t3 < 0)) throw new Error("This API only accepts positive integers"); } } e2.Terminal = d; })(), s; })())); } }); // node_modules/@xterm/addon-fit/lib/addon-fit.js var require_addon_fit = __commonJS({ "node_modules/@xterm/addon-fit/lib/addon-fit.js"(exports, module2) { (function(e, t) { typeof exports == "object" && typeof module2 == "object" ? module2.exports = t() : typeof define == "function" && define.amd ? define([], t) : typeof exports == "object" ? exports.FitAddon = t() : e.FitAddon = t(); })(self, (() => (() => { "use strict"; var e = {}; return (() => { var t = e; Object.defineProperty(t, "__esModule", { value: !0 }), t.FitAddon = void 0, t.FitAddon = class { activate(e2) { this._terminal = e2; } dispose() { } fit() { let e2 = this.proposeDimensions(); if (!e2 || !this._terminal || isNaN(e2.cols) || isNaN(e2.rows)) return; let t2 = this._terminal._core; this._terminal.rows === e2.rows && this._terminal.cols === e2.cols || (t2._renderService.clear(), this._terminal.resize(e2.cols, e2.rows)); } proposeDimensions() { if (!this._terminal || !this._terminal.element || !this._terminal.element.parentElement) return; let e2 = this._terminal._core, t2 = e2._renderService.dimensions; if (t2.css.cell.width === 0 || t2.css.cell.height === 0) return; let r = this._terminal.options.scrollback === 0 ? 0 : e2.viewport.scrollBarWidth, i = window.getComputedStyle(this._terminal.element.parentElement), o = parseInt(i.getPropertyValue("height")), s = Math.max(0, parseInt(i.getPropertyValue("width"))), n = window.getComputedStyle(this._terminal.element), l = o - (parseInt(n.getPropertyValue("padding-top")) + parseInt(n.getPropertyValue("padding-bottom"))), a = s - (parseInt(n.getPropertyValue("padding-right")) + parseInt(n.getPropertyValue("padding-left"))) - r; return { cols: Math.max(2, Math.floor(a / t2.css.cell.width)), rows: Math.max(1, Math.floor(l / t2.css.cell.height)) }; } }; })(), e; })())); } }); // node_modules/@xterm/addon-search/lib/addon-search.js var require_addon_search = __commonJS({ "node_modules/@xterm/addon-search/lib/addon-search.js"(exports, module2) { (function(e, t) { typeof exports == "object" && typeof module2 == "object" ? module2.exports = t() : typeof define == "function" && define.amd ? define([], t) : typeof exports == "object" ? exports.SearchAddon = t() : e.SearchAddon = t(); })(self, (() => (() => { "use strict"; var e = { 345: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.runAndSubscribe = t2.forwardEvent = t2.EventEmitter = void 0, t2.EventEmitter = class { constructor() { this._listeners = [], this._disposed = !1; } get event() { return this._event || (this._event = (e3) => (this._listeners.push(e3), { dispose: () => { if (!this._disposed) { for (let t3 = 0; t3 < this._listeners.length; t3++) if (this._listeners[t3] === e3) return void this._listeners.splice(t3, 1); } } })), this._event; } fire(e3, t3) { let i2 = []; for (let e4 = 0; e4 < this._listeners.length; e4++) i2.push(this._listeners[e4]); for (let s2 = 0; s2 < i2.length; s2++) i2[s2].call(void 0, e3, t3); } dispose() { this.clearListeners(), this._disposed = !0; } clearListeners() { this._listeners && (this._listeners.length = 0); } }, t2.forwardEvent = function(e3, t3) { return e3(((e4) => t3.fire(e4))); }, t2.runAndSubscribe = function(e3, t3) { return t3(void 0), e3(((e4) => t3(e4))); }; }, 859: (e2, t2) => { function i2(e3) { for (let t3 of e3) t3.dispose(); e3.length = 0; } Object.defineProperty(t2, "__esModule", { value: !0 }), t2.getDisposeArrayDisposable = t2.disposeArray = t2.toDisposable = t2.MutableDisposable = t2.Disposable = void 0, t2.Disposable = class { constructor() { this._disposables = [], this._isDisposed = !1; } dispose() { this._isDisposed = !0; for (let e3 of this._disposables) e3.dispose(); this._disposables.length = 0; } register(e3) { return this._disposables.push(e3), e3; } unregister(e3) { let t3 = this._disposables.indexOf(e3); t3 !== -1 && this._disposables.splice(t3, 1); } }, t2.MutableDisposable = class { constructor() { this._isDisposed = !1; } get value() { return this._isDisposed ? void 0 : this._value; } set value(e3) { this._isDisposed || e3 === this._value || (this._value?.dispose(), this._value = e3); } clear() { this.value = void 0; } dispose() { this._isDisposed = !0, this._value?.dispose(), this._value = void 0; } }, t2.toDisposable = function(e3) { return { dispose: e3 }; }, t2.disposeArray = i2, t2.getDisposeArrayDisposable = function(e3) { return { dispose: () => i2(e3) }; }; } }, t = {}; function i(s2) { var r = t[s2]; if (r !== void 0) return r.exports; var o = t[s2] = { exports: {} }; return e[s2](o, o.exports, i), o.exports; } var s = {}; return (() => { var e2 = s; Object.defineProperty(e2, "__esModule", { value: !0 }), e2.SearchAddon = void 0; let t2 = i(345), r = i(859), o = " ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?"; class n extends r.Disposable { constructor(e3) { super(), this._highlightedLines = /* @__PURE__ */ new Set(), this._highlightDecorations = [], this._selectedDecoration = this.register(new r.MutableDisposable()), this._linesCacheTimeoutId = 0, this._linesCacheDisposables = new r.MutableDisposable(), this._onDidChangeResults = this.register(new t2.EventEmitter()), this.onDidChangeResults = this._onDidChangeResults.event, this._highlightLimit = e3?.highlightLimit ?? 1e3; } activate(e3) { this._terminal = e3, this.register(this._terminal.onWriteParsed((() => this._updateMatches()))), this.register(this._terminal.onResize((() => this._updateMatches()))), this.register((0, r.toDisposable)((() => this.clearDecorations()))); } _updateMatches() { this._highlightTimeout && window.clearTimeout(this._highlightTimeout), this._cachedSearchTerm && this._lastSearchOptions?.decorations && (this._highlightTimeout = setTimeout((() => { let e3 = this._cachedSearchTerm; this._cachedSearchTerm = void 0, this.findPrevious(e3, { ...this._lastSearchOptions, incremental: !0, noScroll: !0 }); }), 200)); } clearDecorations(e3) { this._selectedDecoration.clear(), (0, r.disposeArray)(this._highlightDecorations), this._highlightDecorations = [], this._highlightedLines.clear(), e3 || (this._cachedSearchTerm = void 0); } clearActiveDecoration() { this._selectedDecoration.clear(); } findNext(e3, t3) { if (!this._terminal) throw new Error("Cannot use addon until it has been loaded"); let i2 = !this._lastSearchOptions || this._didOptionsChange(this._lastSearchOptions, t3); this._lastSearchOptions = t3, t3?.decorations && (this._cachedSearchTerm === void 0 || e3 !== this._cachedSearchTerm || i2) && this._highlightAllMatches(e3, t3); let s2 = this._findNextAndSelect(e3, t3); return this._fireResults(t3), this._cachedSearchTerm = e3, s2; } _highlightAllMatches(e3, t3) { if (!this._terminal) throw new Error("Cannot use addon until it has been loaded"); if (!e3 || e3.length === 0) return void this.clearDecorations(); t3 = t3 || {}, this.clearDecorations(!0); let i2 = [], s2, r2 = this._find(e3, 0, 0, t3); for (; r2 && (s2?.row !== r2.row || s2?.col !== r2.col) && !(i2.length >= this._highlightLimit); ) s2 = r2, i2.push(s2), r2 = this._find(e3, s2.col + s2.term.length >= this._terminal.cols ? s2.row + 1 : s2.row, s2.col + s2.term.length >= this._terminal.cols ? 0 : s2.col + 1, t3); for (let e4 of i2) { let i3 = this._createResultDecoration(e4, t3.decorations); i3 && (this._highlightedLines.add(i3.marker.line), this._highlightDecorations.push({ decoration: i3, match: e4, dispose() { i3.dispose(); } })); } } _find(e3, t3, i2, s2) { if (!this._terminal || !e3 || e3.length === 0) return this._terminal?.clearSelection(), void this.clearDecorations(); if (i2 > this._terminal.cols) throw new Error(`Invalid col: ${i2} to search in terminal of ${this._terminal.cols} cols`); let r2; this._initLinesCache(); let o2 = { startRow: t3, startCol: i2 }; if (r2 = this._findInLine(e3, o2, s2), !r2) for (let i3 = t3 + 1; i3 < this._terminal.buffer.active.baseY + this._terminal.rows && (o2.startRow = i3, o2.startCol = 0, r2 = this._findInLine(e3, o2, s2), !r2); i3++) ; return r2; } _findNextAndSelect(e3, t3) { if (!this._terminal || !e3 || e3.length === 0) return this._terminal?.clearSelection(), this.clearDecorations(), !1; let i2 = this._terminal.getSelectionPosition(); this._terminal.clearSelection(); let s2 = 0, r2 = 0; i2 && (this._cachedSearchTerm === e3 ? (s2 = i2.end.x, r2 = i2.end.y) : (s2 = i2.start.x, r2 = i2.start.y)), this._initLinesCache(); let o2 = { startRow: r2, startCol: s2 }, n2 = this._findInLine(e3, o2, t3); if (!n2) for (let i3 = r2 + 1; i3 < this._terminal.buffer.active.baseY + this._terminal.rows && (o2.startRow = i3, o2.startCol = 0, n2 = this._findInLine(e3, o2, t3), !n2); i3++) ; if (!n2 && r2 !== 0) for (let i3 = 0; i3 < r2 && (o2.startRow = i3, o2.startCol = 0, n2 = this._findInLine(e3, o2, t3), !n2); i3++) ; return !n2 && i2 && (o2.startRow = i2.start.y, o2.startCol = 0, n2 = this._findInLine(e3, o2, t3)), this._selectResult(n2, t3?.decorations, t3?.noScroll); } findPrevious(e3, t3) { if (!this._terminal) throw new Error("Cannot use addon until it has been loaded"); let i2 = !this._lastSearchOptions || this._didOptionsChange(this._lastSearchOptions, t3); this._lastSearchOptions = t3, t3?.decorations && (this._cachedSearchTerm === void 0 || e3 !== this._cachedSearchTerm || i2) && this._highlightAllMatches(e3, t3); let s2 = this._findPreviousAndSelect(e3, t3); return this._fireResults(t3), this._cachedSearchTerm = e3, s2; } _didOptionsChange(e3, t3) { return !!t3 && (e3.caseSensitive !== t3.caseSensitive || e3.regex !== t3.regex || e3.wholeWord !== t3.wholeWord); } _fireResults(e3) { if (e3?.decorations) { let e4 = -1; if (this._selectedDecoration.value) { let t3 = this._selectedDecoration.value.match; for (let i2 = 0; i2 < this._highlightDecorations.length; i2++) { let s2 = this._highlightDecorations[i2].match; if (s2.row === t3.row && s2.col === t3.col && s2.size === t3.size) { e4 = i2; break; } } } this._onDidChangeResults.fire({ resultIndex: e4, resultCount: this._highlightDecorations.length }); } } _findPreviousAndSelect(e3, t3) { if (!this._terminal) throw new Error("Cannot use addon until it has been loaded"); if (!this._terminal || !e3 || e3.length === 0) return this._terminal?.clearSelection(), this.clearDecorations(), !1; let i2 = this._terminal.getSelectionPosition(); this._terminal.clearSelection(); let s2 = this._terminal.buffer.active.baseY + this._terminal.rows - 1, r2 = this._terminal.cols, o2 = !0; this._initLinesCache(); let n2 = { startRow: s2, startCol: r2 }, h2; if (i2 && (n2.startRow = s2 = i2.start.y, n2.startCol = r2 = i2.start.x, this._cachedSearchTerm !== e3 && (h2 = this._findInLine(e3, n2, t3, !1), h2 || (n2.startRow = s2 = i2.end.y, n2.startCol = r2 = i2.end.x))), h2 || (h2 = this._findInLine(e3, n2, t3, o2)), !h2) { n2.startCol = Math.max(n2.startCol, this._terminal.cols); for (let i3 = s2 - 1; i3 >= 0 && (n2.startRow = i3, h2 = this._findInLine(e3, n2, t3, o2), !h2); i3--) ; } if (!h2 && s2 !== this._terminal.buffer.active.baseY + this._terminal.rows - 1) for (let i3 = this._terminal.buffer.active.baseY + this._terminal.rows - 1; i3 >= s2 && (n2.startRow = i3, h2 = this._findInLine(e3, n2, t3, o2), !h2); i3--) ; return this._selectResult(h2, t3?.decorations, t3?.noScroll); } _initLinesCache() { let e3 = this._terminal; this._linesCache || (this._linesCache = new Array(e3.buffer.active.length), this._linesCacheDisposables.value = (0, r.getDisposeArrayDisposable)([e3.onLineFeed((() => this._destroyLinesCache())), e3.onCursorMove((() => this._destroyLinesCache())), e3.onResize((() => this._destroyLinesCache()))])), window.clearTimeout(this._linesCacheTimeoutId), this._linesCacheTimeoutId = window.setTimeout((() => this._destroyLinesCache()), 15e3); } _destroyLinesCache() { this._linesCache = void 0, this._linesCacheDisposables.clear(), this._linesCacheTimeoutId && (window.clearTimeout(this._linesCacheTimeoutId), this._linesCacheTimeoutId = 0); } _isWholeWord(e3, t3, i2) { return (e3 === 0 || o.includes(t3[e3 - 1])) && (e3 + i2.length === t3.length || o.includes(t3[e3 + i2.length])); } _findInLine(e3, t3, i2 = {}, s2 = !1) { let r2 = this._terminal, o2 = t3.startRow, n2 = t3.startCol; if (r2.buffer.active.getLine(o2)?.isWrapped) return s2 ? void (t3.startCol += r2.cols) : (t3.startRow--, t3.startCol += r2.cols, this._findInLine(e3, t3, i2)); let a = this._linesCache?.[o2]; a || (a = this._translateBufferLineToStringWithWrap(o2, !0), this._linesCache && (this._linesCache[o2] = a)); let [l, c] = a, d = this._bufferColsToStringOffset(o2, n2), _ = i2.caseSensitive ? e3 : e3.toLowerCase(), u = i2.caseSensitive ? l : l.toLowerCase(), f = -1; if (i2.regex) { let t4 = RegExp(_, "g"), i3; if (s2) for (; i3 = t4.exec(u.slice(0, d)); ) f = t4.lastIndex - i3[0].length, e3 = i3[0], t4.lastIndex -= e3.length - 1; else i3 = t4.exec(u.slice(d)), i3 && i3[0].length > 0 && (f = d + (t4.lastIndex - i3[0].length), e3 = i3[0]); } else s2 ? d - _.length >= 0 && (f = u.lastIndexOf(_, d - _.length)) : f = u.indexOf(_, d); if (f >= 0) { if (i2.wholeWord && !this._isWholeWord(f, u, e3)) return; let t4 = 0; for (; t4 < c.length - 1 && f >= c[t4 + 1]; ) t4++; let s3 = t4; for (; s3 < c.length - 1 && f + e3.length >= c[s3 + 1]; ) s3++; let n3 = f - c[t4], h3 = f + e3.length - c[s3], a2 = this._stringLengthToBufferSize(o2 + t4, n3); return { term: e3, col: a2, row: o2 + t4, size: this._stringLengthToBufferSize(o2 + s3, h3) - a2 + r2.cols * (s3 - t4) }; } } _stringLengthToBufferSize(e3, t3) { let i2 = this._terminal.buffer.active.getLine(e3); if (!i2) return 0; for (let e4 = 0; e4 < t3; e4++) { let s2 = i2.getCell(e4); if (!s2) break; let r2 = s2.getChars(); r2.length > 1 && (t3 -= r2.length - 1); let o2 = i2.getCell(e4 + 1); o2 && o2.getWidth() === 0 && t3++; } return t3; } _bufferColsToStringOffset(e3, t3) { let i2 = this._terminal, s2 = e3, r2 = 0, o2 = i2.buffer.active.getLine(s2); for (; t3 > 0 && o2; ) { for (let e4 = 0; e4 < t3 && e4 < i2.cols; e4++) { let t4 = o2.getCell(e4); if (!t4) break; t4.getWidth() && (r2 += t4.getCode() === 0 ? 1 : t4.getChars().length); } if (s2++, o2 = i2.buffer.active.getLine(s2), o2 && !o2.isWrapped) break; t3 -= i2.cols; } return r2; } _translateBufferLineToStringWithWrap(e3, t3) { let i2 = this._terminal, s2 = [], r2 = [0], o2 = i2.buffer.active.getLine(e3); for (; o2; ) { let n2 = i2.buffer.active.getLine(e3 + 1), h2 = !!n2 && n2.isWrapped, a = o2.translateToString(!h2 && t3); if (h2 && n2) { let e4 = o2.getCell(o2.length - 1); e4 && e4.getCode() === 0 && e4.getWidth() === 1 && n2.getCell(0)?.getWidth() === 2 && (a = a.slice(0, -1)); } if (s2.push(a), !h2) break; r2.push(r2[r2.length - 1] + a.length), e3++, o2 = n2; } return [s2.join(""), r2]; } _selectResult(e3, t3, i2) { let s2 = this._terminal; if (this._selectedDecoration.clear(), !e3) return s2.clearSelection(), !1; if (s2.select(e3.col, e3.row, e3.size), t3) { let i3 = s2.registerMarker(-s2.buffer.active.baseY - s2.buffer.active.cursorY + e3.row); if (i3) { let o2 = s2.registerDecoration({ marker: i3, x: e3.col, width: e3.size, backgroundColor: t3.activeMatchBackground, layer: "top", overviewRulerOptions: { color: t3.activeMatchColorOverviewRuler } }); if (o2) { let s3 = []; s3.push(i3), s3.push(o2.onRender(((e4) => this._applyStyles(e4, t3.activeMatchBorder, !0)))), s3.push(o2.onDispose((() => (0, r.disposeArray)(s3)))), this._selectedDecoration.value = { decoration: o2, match: e3, dispose() { o2.dispose(); } }; } } } if (!i2 && (e3.row >= s2.buffer.active.viewportY + s2.rows || e3.row < s2.buffer.active.viewportY)) { let t4 = e3.row - s2.buffer.active.viewportY; t4 -= Math.floor(s2.rows / 2), s2.scrollLines(t4); } return !0; } _applyStyles(e3, t3, i2) { e3.classList.contains("xterm-find-result-decoration") || (e3.classList.add("xterm-find-result-decoration"), t3 && (e3.style.outline = `1px solid ${t3}`)), i2 && e3.classList.add("xterm-find-active-result-decoration"); } _createResultDecoration(e3, t3) { let i2 = this._terminal, s2 = i2.registerMarker(-i2.buffer.active.baseY - i2.buffer.active.cursorY + e3.row); if (!s2) return; let o2 = i2.registerDecoration({ marker: s2, x: e3.col, width: e3.size, backgroundColor: t3.matchBackground, overviewRulerOptions: this._highlightedLines.has(s2.line) ? void 0 : { color: t3.matchOverviewRuler, position: "center" } }); if (o2) { let e4 = []; e4.push(s2), e4.push(o2.onRender(((e5) => this._applyStyles(e5, t3.matchBorder, !1)))), e4.push(o2.onDispose((() => (0, r.disposeArray)(e4)))); } return o2; } } e2.SearchAddon = n; })(), s; })())); } }); // node_modules/@xterm/addon-web-links/lib/addon-web-links.js var require_addon_web_links = __commonJS({ "node_modules/@xterm/addon-web-links/lib/addon-web-links.js"(exports, module2) { (function(e, t) { typeof exports == "object" && typeof module2 == "object" ? module2.exports = t() : typeof define == "function" && define.amd ? define([], t) : typeof exports == "object" ? exports.WebLinksAddon = t() : e.WebLinksAddon = t(); })(self, (() => (() => { "use strict"; var e = { 6: (e2, t2) => { function n2(e3) { try { let t3 = new URL(e3), n3 = t3.password && t3.username ? `${t3.protocol}//${t3.username}:${t3.password}@${t3.host}` : t3.username ? `${t3.protocol}//${t3.username}@${t3.host}` : `${t3.protocol}//${t3.host}`; return e3.toLocaleLowerCase().startsWith(n3.toLocaleLowerCase()); } catch { return !1; } } Object.defineProperty(t2, "__esModule", { value: !0 }), t2.LinkComputer = t2.WebLinkProvider = void 0, t2.WebLinkProvider = class { constructor(e3, t3, n3, o3 = {}) { this._terminal = e3, this._regex = t3, this._handler = n3, this._options = o3; } provideLinks(e3, t3) { let n3 = o2.computeLink(e3, this._regex, this._terminal, this._handler); t3(this._addCallbacks(n3)); } _addCallbacks(e3) { return e3.map(((e4) => (e4.leave = this._options.leave, e4.hover = (t3, n3) => { if (this._options.hover) { let { range: o3 } = e4; this._options.hover(t3, n3, o3); } }, e4))); } }; class o2 { static computeLink(e3, t3, r, i) { let s = new RegExp(t3.source, (t3.flags || "") + "g"), [a, c] = o2._getWindowedLineStrings(e3 - 1, r), l = a.join(""), d, p = []; for (; d = s.exec(l); ) { let e4 = d[0]; if (!n2(e4)) continue; let [t4, s2] = o2._mapStrIdx(r, c, 0, d.index), [a2, l2] = o2._mapStrIdx(r, t4, s2, e4.length); if (t4 === -1 || s2 === -1 || a2 === -1 || l2 === -1) continue; let h2 = { start: { x: s2 + 1, y: t4 + 1 }, end: { x: l2, y: a2 + 1 } }; p.push({ range: h2, text: e4, activate: i }); } return p; } static _getWindowedLineStrings(e3, t3) { let n3, o3 = e3, r = e3, i = 0, s = "", a = []; if (n3 = t3.buffer.active.getLine(e3)) { let e4 = n3.translateToString(!0); if (n3.isWrapped && e4[0] !== " ") { for (i = 0; (n3 = t3.buffer.active.getLine(--o3)) && i < 2048 && (s = n3.translateToString(!0), i += s.length, a.push(s), n3.isWrapped && s.indexOf(" ") === -1); ) ; a.reverse(); } for (a.push(e4), i = 0; (n3 = t3.buffer.active.getLine(++r)) && n3.isWrapped && i < 2048 && (s = n3.translateToString(!0), i += s.length, a.push(s), s.indexOf(" ") === -1); ) ; } return [a, o3]; } static _mapStrIdx(e3, t3, n3, o3) { let r = e3.buffer.active, i = r.getNullCell(), s = n3; for (; o3; ) { let e4 = r.getLine(t3); if (!e4) return [-1, -1]; for (let n4 = s; n4 < e4.length; ++n4) { e4.getCell(n4, i); let s2 = i.getChars(); if (i.getWidth() && (o3 -= s2.length || 1, n4 === e4.length - 1 && s2 === "")) { let e5 = r.getLine(t3 + 1); e5 && e5.isWrapped && (e5.getCell(0, i), i.getWidth() === 2 && (o3 += 1)); } if (o3 < 0) return [t3, n4]; } t3++, s = 0; } return [t3, s]; } } t2.LinkComputer = o2; } }, t = {}; function n(o2) { var r = t[o2]; if (r !== void 0) return r.exports; var i = t[o2] = { exports: {} }; return e[o2](i, i.exports, n), i.exports; } var o = {}; return (() => { var e2 = o; Object.defineProperty(e2, "__esModule", { value: !0 }), e2.WebLinksAddon = void 0; let t2 = n(6), r = /(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/; function i(e3, t3) { let n2 = window.open(); if (n2) { try { n2.opener = null; } catch { } n2.location.href = t3; } else console.warn("Opening link blocked as opener could not be cleared"); } e2.WebLinksAddon = class { constructor(e3 = i, t3 = {}) { this._handler = e3, this._options = t3; } activate(e3) { this._terminal = e3; let n2 = this._options, o2 = n2.urlRegex || r; this._linkProvider = this._terminal.registerLinkProvider(new t2.WebLinkProvider(this._terminal, o2, this._handler, n2)); } dispose() { this._linkProvider?.dispose(); } }; })(), o; })())); } }); // node_modules/@xterm/addon-webgl/lib/addon-webgl.js var require_addon_webgl = __commonJS({ "node_modules/@xterm/addon-webgl/lib/addon-webgl.js"(exports, module2) { (function(e, t) { typeof exports == "object" && typeof module2 == "object" ? module2.exports = t() : typeof define == "function" && define.amd ? define([], t) : typeof exports == "object" ? exports.WebglAddon = t() : e.WebglAddon = t(); })(self, (() => (() => { "use strict"; var e = { 965: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.GlyphRenderer = void 0; let s2 = i2(374), r = i2(509), o = i2(855), n = i2(859), a = i2(381), h2 = 11, l = h2 * Float32Array.BYTES_PER_ELEMENT, c, d = 0, _ = 0, u = 0; class g extends n.Disposable { constructor(e3, t3, i3, o2) { super(), this._terminal = e3, this._gl = t3, this._dimensions = i3, this._optionsService = o2, this._activeBuffer = 0, this._vertices = { count: 0, attributes: new Float32Array(0), attributesBuffers: [new Float32Array(0), new Float32Array(0)] }; let h3 = this._gl; r.TextureAtlas.maxAtlasPages === void 0 && (r.TextureAtlas.maxAtlasPages = Math.min(32, (0, s2.throwIfFalsy)(h3.getParameter(h3.MAX_TEXTURE_IMAGE_UNITS))), r.TextureAtlas.maxTextureSize = (0, s2.throwIfFalsy)(h3.getParameter(h3.MAX_TEXTURE_SIZE))), this._program = (0, s2.throwIfFalsy)((0, a.createProgram)(h3, `#version 300 es layout (location = 0) in vec2 a_unitquad; layout (location = 1) in vec2 a_cellpos; layout (location = 2) in vec2 a_offset; layout (location = 3) in vec2 a_size; layout (location = 4) in float a_texpage; layout (location = 5) in vec2 a_texcoord; layout (location = 6) in vec2 a_texsize; uniform mat4 u_projection; uniform vec2 u_resolution; out vec2 v_texcoord; flat out int v_texpage; void main() { vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size); gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0); v_texpage = int(a_texpage); v_texcoord = a_texcoord + a_unitquad * a_texsize; }`, (function(e4) { let t4 = ""; for (let i4 = 1; i4 < e4; i4++) t4 += ` else if (v_texpage == ${i4}) { outColor = texture(u_texture[${i4}], v_texcoord); }`; return `#version 300 es precision lowp float; in vec2 v_texcoord; flat in int v_texpage; uniform sampler2D u_texture[${e4}]; out vec4 outColor; void main() { if (v_texpage == 0) { outColor = texture(u_texture[0], v_texcoord); } ${t4} }`; })(r.TextureAtlas.maxAtlasPages))), this.register((0, n.toDisposable)((() => h3.deleteProgram(this._program)))), this._projectionLocation = (0, s2.throwIfFalsy)(h3.getUniformLocation(this._program, "u_projection")), this._resolutionLocation = (0, s2.throwIfFalsy)(h3.getUniformLocation(this._program, "u_resolution")), this._textureLocation = (0, s2.throwIfFalsy)(h3.getUniformLocation(this._program, "u_texture")), this._vertexArrayObject = h3.createVertexArray(), h3.bindVertexArray(this._vertexArrayObject); let c2 = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]), d2 = h3.createBuffer(); this.register((0, n.toDisposable)((() => h3.deleteBuffer(d2)))), h3.bindBuffer(h3.ARRAY_BUFFER, d2), h3.bufferData(h3.ARRAY_BUFFER, c2, h3.STATIC_DRAW), h3.enableVertexAttribArray(0), h3.vertexAttribPointer(0, 2, this._gl.FLOAT, !1, 0, 0); let _2 = new Uint8Array([0, 1, 2, 3]), u2 = h3.createBuffer(); this.register((0, n.toDisposable)((() => h3.deleteBuffer(u2)))), h3.bindBuffer(h3.ELEMENT_ARRAY_BUFFER, u2), h3.bufferData(h3.ELEMENT_ARRAY_BUFFER, _2, h3.STATIC_DRAW), this._attributesBuffer = (0, s2.throwIfFalsy)(h3.createBuffer()), this.register((0, n.toDisposable)((() => h3.deleteBuffer(this._attributesBuffer)))), h3.bindBuffer(h3.ARRAY_BUFFER, this._attributesBuffer), h3.enableVertexAttribArray(2), h3.vertexAttribPointer(2, 2, h3.FLOAT, !1, l, 0), h3.vertexAttribDivisor(2, 1), h3.enableVertexAttribArray(3), h3.vertexAttribPointer(3, 2, h3.FLOAT, !1, l, 2 * Float32Array.BYTES_PER_ELEMENT), h3.vertexAttribDivisor(3, 1), h3.enableVertexAttribArray(4), h3.vertexAttribPointer(4, 1, h3.FLOAT, !1, l, 4 * Float32Array.BYTES_PER_ELEMENT), h3.vertexAttribDivisor(4, 1), h3.enableVertexAttribArray(5), h3.vertexAttribPointer(5, 2, h3.FLOAT, !1, l, 5 * Float32Array.BYTES_PER_ELEMENT), h3.vertexAttribDivisor(5, 1), h3.enableVertexAttribArray(6), h3.vertexAttribPointer(6, 2, h3.FLOAT, !1, l, 7 * Float32Array.BYTES_PER_ELEMENT), h3.vertexAttribDivisor(6, 1), h3.enableVertexAttribArray(1), h3.vertexAttribPointer(1, 2, h3.FLOAT, !1, l, 9 * Float32Array.BYTES_PER_ELEMENT), h3.vertexAttribDivisor(1, 1), h3.useProgram(this._program); let g2 = new Int32Array(r.TextureAtlas.maxAtlasPages); for (let e4 = 0; e4 < r.TextureAtlas.maxAtlasPages; e4++) g2[e4] = e4; h3.uniform1iv(this._textureLocation, g2), h3.uniformMatrix4fv(this._projectionLocation, !1, a.PROJECTION_MATRIX), this._atlasTextures = []; for (let e4 = 0; e4 < r.TextureAtlas.maxAtlasPages; e4++) { let t4 = new a.GLTexture((0, s2.throwIfFalsy)(h3.createTexture())); this.register((0, n.toDisposable)((() => h3.deleteTexture(t4.texture)))), h3.activeTexture(h3.TEXTURE0 + e4), h3.bindTexture(h3.TEXTURE_2D, t4.texture), h3.texParameteri(h3.TEXTURE_2D, h3.TEXTURE_WRAP_S, h3.CLAMP_TO_EDGE), h3.texParameteri(h3.TEXTURE_2D, h3.TEXTURE_WRAP_T, h3.CLAMP_TO_EDGE), h3.texImage2D(h3.TEXTURE_2D, 0, h3.RGBA, 1, 1, 0, h3.RGBA, h3.UNSIGNED_BYTE, new Uint8Array([255, 0, 0, 255])), this._atlasTextures[e4] = t4; } h3.enable(h3.BLEND), h3.blendFunc(h3.SRC_ALPHA, h3.ONE_MINUS_SRC_ALPHA), this.handleResize(); } beginFrame() { return !this._atlas || this._atlas.beginFrame(); } updateCell(e3, t3, i3, s3, r2, o2, n2, a2, h3) { this._updateCell(this._vertices.attributes, e3, t3, i3, s3, r2, o2, n2, a2, h3); } _updateCell(e3, t3, i3, r2, n2, a2, l2, g2, v, f) { d = (i3 * this._terminal.cols + t3) * h2, r2 !== o.NULL_CELL_CODE && r2 !== void 0 ? this._atlas && (c = g2 && g2.length > 1 ? this._atlas.getRasterizedGlyphCombinedChar(g2, n2, a2, l2, !1) : this._atlas.getRasterizedGlyph(r2, n2, a2, l2, !1), _ = Math.floor((this._dimensions.device.cell.width - this._dimensions.device.char.width) / 2), n2 !== f && c.offset.x > _ ? (u = c.offset.x - _, e3[d] = -(c.offset.x - u) + this._dimensions.device.char.left, e3[d + 1] = -c.offset.y + this._dimensions.device.char.top, e3[d + 2] = (c.size.x - u) / this._dimensions.device.canvas.width, e3[d + 3] = c.size.y / this._dimensions.device.canvas.height, e3[d + 4] = c.texturePage, e3[d + 5] = c.texturePositionClipSpace.x + u / this._atlas.pages[c.texturePage].canvas.width, e3[d + 6] = c.texturePositionClipSpace.y, e3[d + 7] = c.sizeClipSpace.x - u / this._atlas.pages[c.texturePage].canvas.width, e3[d + 8] = c.sizeClipSpace.y) : (e3[d] = -c.offset.x + this._dimensions.device.char.left, e3[d + 1] = -c.offset.y + this._dimensions.device.char.top, e3[d + 2] = c.size.x / this._dimensions.device.canvas.width, e3[d + 3] = c.size.y / this._dimensions.device.canvas.height, e3[d + 4] = c.texturePage, e3[d + 5] = c.texturePositionClipSpace.x, e3[d + 6] = c.texturePositionClipSpace.y, e3[d + 7] = c.sizeClipSpace.x, e3[d + 8] = c.sizeClipSpace.y), this._optionsService.rawOptions.rescaleOverlappingGlyphs && (0, s2.allowRescaling)(r2, v, c.size.x, this._dimensions.device.cell.width) && (e3[d + 2] = (this._dimensions.device.cell.width - 1) / this._dimensions.device.canvas.width)) : e3.fill(0, d, d + h2 - 1 - 2); } clear() { let e3 = this._terminal, t3 = e3.cols * e3.rows * h2; this._vertices.count !== t3 ? this._vertices.attributes = new Float32Array(t3) : this._vertices.attributes.fill(0); let i3 = 0; for (; i3 < this._vertices.attributesBuffers.length; i3++) this._vertices.count !== t3 ? this._vertices.attributesBuffers[i3] = new Float32Array(t3) : this._vertices.attributesBuffers[i3].fill(0); this._vertices.count = t3, i3 = 0; for (let t4 = 0; t4 < e3.rows; t4++) for (let s3 = 0; s3 < e3.cols; s3++) this._vertices.attributes[i3 + 9] = s3 / e3.cols, this._vertices.attributes[i3 + 10] = t4 / e3.rows, i3 += h2; } handleResize() { let e3 = this._gl; e3.useProgram(this._program), e3.viewport(0, 0, e3.canvas.width, e3.canvas.height), e3.uniform2f(this._resolutionLocation, e3.canvas.width, e3.canvas.height), this.clear(); } render(e3) { if (!this._atlas) return; let t3 = this._gl; t3.useProgram(this._program), t3.bindVertexArray(this._vertexArrayObject), this._activeBuffer = (this._activeBuffer + 1) % 2; let i3 = this._vertices.attributesBuffers[this._activeBuffer], s3 = 0; for (let t4 = 0; t4 < e3.lineLengths.length; t4++) { let r2 = t4 * this._terminal.cols * h2, o2 = this._vertices.attributes.subarray(r2, r2 + e3.lineLengths[t4] * h2); i3.set(o2, s3), s3 += o2.length; } t3.bindBuffer(t3.ARRAY_BUFFER, this._attributesBuffer), t3.bufferData(t3.ARRAY_BUFFER, i3.subarray(0, s3), t3.STREAM_DRAW); for (let e4 = 0; e4 < this._atlas.pages.length; e4++) this._atlas.pages[e4].version !== this._atlasTextures[e4].version && this._bindAtlasPageTexture(t3, this._atlas, e4); t3.drawElementsInstanced(t3.TRIANGLE_STRIP, 4, t3.UNSIGNED_BYTE, 0, s3 / h2); } setAtlas(e3) { this._atlas = e3; for (let e4 of this._atlasTextures) e4.version = -1; } _bindAtlasPageTexture(e3, t3, i3) { e3.activeTexture(e3.TEXTURE0 + i3), e3.bindTexture(e3.TEXTURE_2D, this._atlasTextures[i3].texture), e3.texParameteri(e3.TEXTURE_2D, e3.TEXTURE_WRAP_S, e3.CLAMP_TO_EDGE), e3.texParameteri(e3.TEXTURE_2D, e3.TEXTURE_WRAP_T, e3.CLAMP_TO_EDGE), e3.texImage2D(e3.TEXTURE_2D, 0, e3.RGBA, e3.RGBA, e3.UNSIGNED_BYTE, t3.pages[i3].canvas), e3.generateMipmap(e3.TEXTURE_2D), this._atlasTextures[i3].version = t3.pages[i3].version; } setDimensions(e3) { this._dimensions = e3; } } t2.GlyphRenderer = g; }, 742: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.RectangleRenderer = void 0; let s2 = i2(374), r = i2(859), o = i2(310), n = i2(381), a = 8 * Float32Array.BYTES_PER_ELEMENT; class h2 { constructor() { this.attributes = new Float32Array(160), this.count = 0; } } let l = 0, c = 0, d = 0, _ = 0, u = 0, g = 0, v = 0; class f extends r.Disposable { constructor(e3, t3, i3, o2) { super(), this._terminal = e3, this._gl = t3, this._dimensions = i3, this._themeService = o2, this._vertices = new h2(), this._verticesCursor = new h2(); let l2 = this._gl; this._program = (0, s2.throwIfFalsy)((0, n.createProgram)(l2, `#version 300 es layout (location = 0) in vec2 a_position; layout (location = 1) in vec2 a_size; layout (location = 2) in vec4 a_color; layout (location = 3) in vec2 a_unitquad; uniform mat4 u_projection; out vec4 v_color; void main() { vec2 zeroToOne = a_position + (a_unitquad * a_size); gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0); v_color = a_color; }`, `#version 300 es precision lowp float; in vec4 v_color; out vec4 outColor; void main() { outColor = v_color; }`)), this.register((0, r.toDisposable)((() => l2.deleteProgram(this._program)))), this._projectionLocation = (0, s2.throwIfFalsy)(l2.getUniformLocation(this._program, "u_projection")), this._vertexArrayObject = l2.createVertexArray(), l2.bindVertexArray(this._vertexArrayObject); let c2 = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]), d2 = l2.createBuffer(); this.register((0, r.toDisposable)((() => l2.deleteBuffer(d2)))), l2.bindBuffer(l2.ARRAY_BUFFER, d2), l2.bufferData(l2.ARRAY_BUFFER, c2, l2.STATIC_DRAW), l2.enableVertexAttribArray(3), l2.vertexAttribPointer(3, 2, this._gl.FLOAT, !1, 0, 0); let _2 = new Uint8Array([0, 1, 2, 3]), u2 = l2.createBuffer(); this.register((0, r.toDisposable)((() => l2.deleteBuffer(u2)))), l2.bindBuffer(l2.ELEMENT_ARRAY_BUFFER, u2), l2.bufferData(l2.ELEMENT_ARRAY_BUFFER, _2, l2.STATIC_DRAW), this._attributesBuffer = (0, s2.throwIfFalsy)(l2.createBuffer()), this.register((0, r.toDisposable)((() => l2.deleteBuffer(this._attributesBuffer)))), l2.bindBuffer(l2.ARRAY_BUFFER, this._attributesBuffer), l2.enableVertexAttribArray(0), l2.vertexAttribPointer(0, 2, l2.FLOAT, !1, a, 0), l2.vertexAttribDivisor(0, 1), l2.enableVertexAttribArray(1), l2.vertexAttribPointer(1, 2, l2.FLOAT, !1, a, 2 * Float32Array.BYTES_PER_ELEMENT), l2.vertexAttribDivisor(1, 1), l2.enableVertexAttribArray(2), l2.vertexAttribPointer(2, 4, l2.FLOAT, !1, a, 4 * Float32Array.BYTES_PER_ELEMENT), l2.vertexAttribDivisor(2, 1), this._updateCachedColors(o2.colors), this.register(this._themeService.onChangeColors(((e4) => { this._updateCachedColors(e4), this._updateViewportRectangle(); }))); } renderBackgrounds() { this._renderVertices(this._vertices); } renderCursor() { this._renderVertices(this._verticesCursor); } _renderVertices(e3) { let t3 = this._gl; t3.useProgram(this._program), t3.bindVertexArray(this._vertexArrayObject), t3.uniformMatrix4fv(this._projectionLocation, !1, n.PROJECTION_MATRIX), t3.bindBuffer(t3.ARRAY_BUFFER, this._attributesBuffer), t3.bufferData(t3.ARRAY_BUFFER, e3.attributes, t3.DYNAMIC_DRAW), t3.drawElementsInstanced(this._gl.TRIANGLE_STRIP, 4, t3.UNSIGNED_BYTE, 0, e3.count); } handleResize() { this._updateViewportRectangle(); } setDimensions(e3) { this._dimensions = e3; } _updateCachedColors(e3) { this._bgFloat = this._colorToFloat32Array(e3.background), this._cursorFloat = this._colorToFloat32Array(e3.cursor); } _updateViewportRectangle() { this._addRectangleFloat(this._vertices.attributes, 0, 0, 0, this._terminal.cols * this._dimensions.device.cell.width, this._terminal.rows * this._dimensions.device.cell.height, this._bgFloat); } updateBackgrounds(e3) { let t3 = this._terminal, i3 = this._vertices, s3, r2, n2, a2, h3, l2, c2, d2, _2, u2, g2, v2 = 1; for (s3 = 0; s3 < t3.rows; s3++) { for (n2 = -1, a2 = 0, h3 = 0, l2 = !1, r2 = 0; r2 < t3.cols; r2++) c2 = (s3 * t3.cols + r2) * o.RENDER_MODEL_INDICIES_PER_CELL, d2 = e3.cells[c2 + o.RENDER_MODEL_BG_OFFSET], _2 = e3.cells[c2 + o.RENDER_MODEL_FG_OFFSET], u2 = !!(67108864 & _2), (d2 !== a2 || _2 !== h3 && (l2 || u2)) && ((a2 !== 0 || l2 && h3 !== 0) && (g2 = 8 * v2++, this._updateRectangle(i3, g2, h3, a2, n2, r2, s3)), n2 = r2, a2 = d2, h3 = _2, l2 = u2); (a2 !== 0 || l2 && h3 !== 0) && (g2 = 8 * v2++, this._updateRectangle(i3, g2, h3, a2, n2, t3.cols, s3)); } i3.count = v2; } updateCursor(e3) { let t3 = this._verticesCursor, i3 = e3.cursor; if (!i3 || i3.style === "block") return void (t3.count = 0); let s3, r2 = 0; i3.style !== "bar" && i3.style !== "outline" || (s3 = 8 * r2++, this._addRectangleFloat(t3.attributes, s3, i3.x * this._dimensions.device.cell.width, i3.y * this._dimensions.device.cell.height, i3.style === "bar" ? i3.dpr * i3.cursorWidth : i3.dpr, this._dimensions.device.cell.height, this._cursorFloat)), i3.style !== "underline" && i3.style !== "outline" || (s3 = 8 * r2++, this._addRectangleFloat(t3.attributes, s3, i3.x * this._dimensions.device.cell.width, (i3.y + 1) * this._dimensions.device.cell.height - i3.dpr, i3.width * this._dimensions.device.cell.width, i3.dpr, this._cursorFloat)), i3.style === "outline" && (s3 = 8 * r2++, this._addRectangleFloat(t3.attributes, s3, i3.x * this._dimensions.device.cell.width, i3.y * this._dimensions.device.cell.height, i3.width * this._dimensions.device.cell.width, i3.dpr, this._cursorFloat), s3 = 8 * r2++, this._addRectangleFloat(t3.attributes, s3, (i3.x + i3.width) * this._dimensions.device.cell.width - i3.dpr, i3.y * this._dimensions.device.cell.height, i3.dpr, this._dimensions.device.cell.height, this._cursorFloat)), t3.count = r2; } _updateRectangle(e3, t3, i3, s3, r2, o2, a2) { if (67108864 & i3) switch (50331648 & i3) { case 16777216: case 33554432: l = this._themeService.colors.ansi[255 & i3].rgba; break; case 50331648: l = (16777215 & i3) << 8; break; default: l = this._themeService.colors.foreground.rgba; } else switch (50331648 & s3) { case 16777216: case 33554432: l = this._themeService.colors.ansi[255 & s3].rgba; break; case 50331648: l = (16777215 & s3) << 8; break; default: l = this._themeService.colors.background.rgba; } e3.attributes.length < t3 + 4 && (e3.attributes = (0, n.expandFloat32Array)(e3.attributes, this._terminal.rows * this._terminal.cols * 8)), c = r2 * this._dimensions.device.cell.width, d = a2 * this._dimensions.device.cell.height, _ = (l >> 24 & 255) / 255, u = (l >> 16 & 255) / 255, g = (l >> 8 & 255) / 255, v = 1, this._addRectangle(e3.attributes, t3, c, d, (o2 - r2) * this._dimensions.device.cell.width, this._dimensions.device.cell.height, _, u, g, v); } _addRectangle(e3, t3, i3, s3, r2, o2, n2, a2, h3, l2) { e3[t3] = i3 / this._dimensions.device.canvas.width, e3[t3 + 1] = s3 / this._dimensions.device.canvas.height, e3[t3 + 2] = r2 / this._dimensions.device.canvas.width, e3[t3 + 3] = o2 / this._dimensions.device.canvas.height, e3[t3 + 4] = n2, e3[t3 + 5] = a2, e3[t3 + 6] = h3, e3[t3 + 7] = l2; } _addRectangleFloat(e3, t3, i3, s3, r2, o2, n2) { e3[t3] = i3 / this._dimensions.device.canvas.width, e3[t3 + 1] = s3 / this._dimensions.device.canvas.height, e3[t3 + 2] = r2 / this._dimensions.device.canvas.width, e3[t3 + 3] = o2 / this._dimensions.device.canvas.height, e3[t3 + 4] = n2[0], e3[t3 + 5] = n2[1], e3[t3 + 6] = n2[2], e3[t3 + 7] = n2[3]; } _colorToFloat32Array(e3) { return new Float32Array([(e3.rgba >> 24 & 255) / 255, (e3.rgba >> 16 & 255) / 255, (e3.rgba >> 8 & 255) / 255, (255 & e3.rgba) / 255]); } } t2.RectangleRenderer = f; }, 310: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.RenderModel = t2.COMBINED_CHAR_BIT_MASK = t2.RENDER_MODEL_EXT_OFFSET = t2.RENDER_MODEL_FG_OFFSET = t2.RENDER_MODEL_BG_OFFSET = t2.RENDER_MODEL_INDICIES_PER_CELL = void 0; let s2 = i2(296); t2.RENDER_MODEL_INDICIES_PER_CELL = 4, t2.RENDER_MODEL_BG_OFFSET = 1, t2.RENDER_MODEL_FG_OFFSET = 2, t2.RENDER_MODEL_EXT_OFFSET = 3, t2.COMBINED_CHAR_BIT_MASK = 2147483648, t2.RenderModel = class { constructor() { this.cells = new Uint32Array(0), this.lineLengths = new Uint32Array(0), this.selection = (0, s2.createSelectionRenderModel)(); } resize(e3, i3) { let s3 = e3 * i3 * t2.RENDER_MODEL_INDICIES_PER_CELL; s3 !== this.cells.length && (this.cells = new Uint32Array(s3), this.lineLengths = new Uint32Array(i3)); } clear() { this.cells.fill(0, 0), this.lineLengths.fill(0, 0); } }; }, 666: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.JoinedCellData = t2.WebglRenderer = void 0; let s2 = i2(820), r = i2(274), o = i2(627), n = i2(457), a = i2(56), h2 = i2(374), l = i2(345), c = i2(859), d = i2(147), _ = i2(782), u = i2(855), g = i2(965), v = i2(742), f = i2(310), p = i2(733); class C extends c.Disposable { constructor(e3, t3, i3, n2, d2, u2, g2, v2, C2) { super(), this._terminal = e3, this._characterJoinerService = t3, this._charSizeService = i3, this._coreBrowserService = n2, this._coreService = d2, this._decorationService = u2, this._optionsService = g2, this._themeService = v2, this._cursorBlinkStateManager = new c.MutableDisposable(), this._charAtlasDisposable = this.register(new c.MutableDisposable()), this._observerDisposable = this.register(new c.MutableDisposable()), this._model = new f.RenderModel(), this._workCell = new _.CellData(), this._workCell2 = new _.CellData(), this._rectangleRenderer = this.register(new c.MutableDisposable()), this._glyphRenderer = this.register(new c.MutableDisposable()), this._onChangeTextureAtlas = this.register(new l.EventEmitter()), this.onChangeTextureAtlas = this._onChangeTextureAtlas.event, this._onAddTextureAtlasCanvas = this.register(new l.EventEmitter()), this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event, this._onRemoveTextureAtlasCanvas = this.register(new l.EventEmitter()), this.onRemoveTextureAtlasCanvas = this._onRemoveTextureAtlasCanvas.event, this._onRequestRedraw = this.register(new l.EventEmitter()), this.onRequestRedraw = this._onRequestRedraw.event, this._onContextLoss = this.register(new l.EventEmitter()), this.onContextLoss = this._onContextLoss.event, this.register(this._themeService.onChangeColors((() => this._handleColorChange()))), this._cellColorResolver = new r.CellColorResolver(this._terminal, this._optionsService, this._model.selection, this._decorationService, this._coreBrowserService, this._themeService), this._core = this._terminal._core, this._renderLayers = [new p.LinkRenderLayer(this._core.screenElement, 2, this._terminal, this._core.linkifier, this._coreBrowserService, g2, this._themeService)], this.dimensions = (0, h2.createRenderDimensions)(), this._devicePixelRatio = this._coreBrowserService.dpr, this._updateDimensions(), this._updateCursorBlink(), this.register(g2.onOptionChange((() => this._handleOptionsChanged()))), this._canvas = this._coreBrowserService.mainDocument.createElement("canvas"); let m2 = { antialias: !1, depth: !1, preserveDrawingBuffer: C2 }; if (this._gl = this._canvas.getContext("webgl2", m2), !this._gl) throw new Error("WebGL2 not supported " + this._gl); this.register((0, s2.addDisposableDomListener)(this._canvas, "webglcontextlost", ((e4) => { console.log("webglcontextlost event received"), e4.preventDefault(), this._contextRestorationTimeout = setTimeout((() => { this._contextRestorationTimeout = void 0, console.warn("webgl context not restored; firing onContextLoss"), this._onContextLoss.fire(e4); }), 3e3); }))), this.register((0, s2.addDisposableDomListener)(this._canvas, "webglcontextrestored", ((e4) => { console.warn("webglcontextrestored event received"), clearTimeout(this._contextRestorationTimeout), this._contextRestorationTimeout = void 0, (0, o.removeTerminalFromCache)(this._terminal), this._initializeWebGLState(), this._requestRedrawViewport(); }))), this._observerDisposable.value = (0, a.observeDevicePixelDimensions)(this._canvas, this._coreBrowserService.window, ((e4, t4) => this._setCanvasDevicePixelDimensions(e4, t4))), this.register(this._coreBrowserService.onWindowChange(((e4) => { this._observerDisposable.value = (0, a.observeDevicePixelDimensions)(this._canvas, e4, ((e5, t4) => this._setCanvasDevicePixelDimensions(e5, t4))); }))), this._core.screenElement.appendChild(this._canvas), [this._rectangleRenderer.value, this._glyphRenderer.value] = this._initializeWebGLState(), this._isAttached = this._coreBrowserService.window.document.body.contains(this._core.screenElement), this.register((0, c.toDisposable)((() => { for (let e4 of this._renderLayers) e4.dispose(); this._canvas.parentElement?.removeChild(this._canvas), (0, o.removeTerminalFromCache)(this._terminal); }))); } get textureAtlas() { return this._charAtlas?.pages[0].canvas; } _handleColorChange() { this._refreshCharAtlas(), this._clearModel(!0); } handleDevicePixelRatioChange() { this._devicePixelRatio !== this._coreBrowserService.dpr && (this._devicePixelRatio = this._coreBrowserService.dpr, this.handleResize(this._terminal.cols, this._terminal.rows)); } handleResize(e3, t3) { this._updateDimensions(), this._model.resize(this._terminal.cols, this._terminal.rows); for (let e4 of this._renderLayers) e4.resize(this._terminal, this.dimensions); this._canvas.width = this.dimensions.device.canvas.width, this._canvas.height = this.dimensions.device.canvas.height, this._canvas.style.width = `${this.dimensions.css.canvas.width}px`, this._canvas.style.height = `${this.dimensions.css.canvas.height}px`, this._core.screenElement.style.width = `${this.dimensions.css.canvas.width}px`, this._core.screenElement.style.height = `${this.dimensions.css.canvas.height}px`, this._rectangleRenderer.value?.setDimensions(this.dimensions), this._rectangleRenderer.value?.handleResize(), this._glyphRenderer.value?.setDimensions(this.dimensions), this._glyphRenderer.value?.handleResize(), this._refreshCharAtlas(), this._clearModel(!1); } handleCharSizeChanged() { this.handleResize(this._terminal.cols, this._terminal.rows); } handleBlur() { for (let e3 of this._renderLayers) e3.handleBlur(this._terminal); this._cursorBlinkStateManager.value?.pause(), this._requestRedrawViewport(); } handleFocus() { for (let e3 of this._renderLayers) e3.handleFocus(this._terminal); this._cursorBlinkStateManager.value?.resume(), this._requestRedrawViewport(); } handleSelectionChanged(e3, t3, i3) { for (let s3 of this._renderLayers) s3.handleSelectionChanged(this._terminal, e3, t3, i3); this._model.selection.update(this._core, e3, t3, i3), this._requestRedrawViewport(); } handleCursorMove() { for (let e3 of this._renderLayers) e3.handleCursorMove(this._terminal); this._cursorBlinkStateManager.value?.restartBlinkAnimation(); } _handleOptionsChanged() { this._updateDimensions(), this._refreshCharAtlas(), this._updateCursorBlink(); } _initializeWebGLState() { return this._rectangleRenderer.value = new v.RectangleRenderer(this._terminal, this._gl, this.dimensions, this._themeService), this._glyphRenderer.value = new g.GlyphRenderer(this._terminal, this._gl, this.dimensions, this._optionsService), this.handleCharSizeChanged(), [this._rectangleRenderer.value, this._glyphRenderer.value]; } _refreshCharAtlas() { if (this.dimensions.device.char.width <= 0 && this.dimensions.device.char.height <= 0) return void (this._isAttached = !1); let e3 = (0, o.acquireTextureAtlas)(this._terminal, this._optionsService.rawOptions, this._themeService.colors, this.dimensions.device.cell.width, this.dimensions.device.cell.height, this.dimensions.device.char.width, this.dimensions.device.char.height, this._coreBrowserService.dpr); this._charAtlas !== e3 && (this._onChangeTextureAtlas.fire(e3.pages[0].canvas), this._charAtlasDisposable.value = (0, c.getDisposeArrayDisposable)([(0, l.forwardEvent)(e3.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas), (0, l.forwardEvent)(e3.onRemoveTextureAtlasCanvas, this._onRemoveTextureAtlasCanvas)])), this._charAtlas = e3, this._charAtlas.warmUp(), this._glyphRenderer.value?.setAtlas(this._charAtlas); } _clearModel(e3) { this._model.clear(), e3 && this._glyphRenderer.value?.clear(); } clearTextureAtlas() { this._charAtlas?.clearTexture(), this._clearModel(!0), this._requestRedrawViewport(); } clear() { this._clearModel(!0); for (let e3 of this._renderLayers) e3.reset(this._terminal); this._cursorBlinkStateManager.value?.restartBlinkAnimation(), this._updateCursorBlink(); } registerCharacterJoiner(e3) { return -1; } deregisterCharacterJoiner(e3) { return !1; } renderRows(e3, t3) { if (!this._isAttached) { if (!(this._coreBrowserService.window.document.body.contains(this._core.screenElement) && this._charSizeService.width && this._charSizeService.height)) return; this._updateDimensions(), this._refreshCharAtlas(), this._isAttached = !0; } for (let i3 of this._renderLayers) i3.handleGridChanged(this._terminal, e3, t3); this._glyphRenderer.value && this._rectangleRenderer.value && (this._glyphRenderer.value.beginFrame() ? (this._clearModel(!0), this._updateModel(0, this._terminal.rows - 1)) : this._updateModel(e3, t3), this._rectangleRenderer.value.renderBackgrounds(), this._glyphRenderer.value.render(this._model), this._cursorBlinkStateManager.value && !this._cursorBlinkStateManager.value.isCursorVisible || this._rectangleRenderer.value.renderCursor()); } _updateCursorBlink() { this._terminal.options.cursorBlink ? this._cursorBlinkStateManager.value = new n.CursorBlinkStateManager((() => { this._requestRedrawCursor(); }), this._coreBrowserService) : this._cursorBlinkStateManager.clear(), this._requestRedrawCursor(); } _updateModel(e3, t3) { let i3 = this._core, s3, r2, o2, n2, a2, h3, l2, c2, d2, _2, g2, v2, p2, C2, x = this._workCell; e3 = L(e3, i3.rows - 1, 0), t3 = L(t3, i3.rows - 1, 0); let w = this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY, b = w - i3.buffer.ydisp, M = Math.min(this._terminal.buffer.active.cursorX, i3.cols - 1), R = -1, y = this._coreService.isCursorInitialized && !this._coreService.isCursorHidden && (!this._cursorBlinkStateManager.value || this._cursorBlinkStateManager.value.isCursorVisible); this._model.cursor = void 0; let A = !1; for (r2 = e3; r2 <= t3; r2++) for (o2 = r2 + i3.buffer.ydisp, n2 = i3.buffer.lines.get(o2), this._model.lineLengths[r2] = 0, a2 = this._characterJoinerService.getJoinedCharacters(o2), p2 = 0; p2 < i3.cols; p2++) if (s3 = this._cellColorResolver.result.bg, n2.loadCell(p2, x), p2 === 0 && (s3 = this._cellColorResolver.result.bg), h3 = !1, l2 = p2, a2.length > 0 && p2 === a2[0][0] && (h3 = !0, c2 = a2.shift(), x = new m(x, n2.translateToString(!0, c2[0], c2[1]), c2[1] - c2[0]), l2 = c2[1] - 1), d2 = x.getChars(), _2 = x.getCode(), v2 = (r2 * i3.cols + p2) * f.RENDER_MODEL_INDICIES_PER_CELL, this._cellColorResolver.resolve(x, p2, o2, this.dimensions.device.cell.width), y && o2 === w && (p2 === M && (this._model.cursor = { x: M, y: b, width: x.getWidth(), style: this._coreBrowserService.isFocused ? i3.options.cursorStyle || "block" : i3.options.cursorInactiveStyle, cursorWidth: i3.options.cursorWidth, dpr: this._devicePixelRatio }, R = M + x.getWidth() - 1), p2 >= M && p2 <= R && (this._coreBrowserService.isFocused && (i3.options.cursorStyle || "block") === "block" || this._coreBrowserService.isFocused === !1 && i3.options.cursorInactiveStyle === "block") && (this._cellColorResolver.result.fg = 50331648 | this._themeService.colors.cursorAccent.rgba >> 8 & 16777215, this._cellColorResolver.result.bg = 50331648 | this._themeService.colors.cursor.rgba >> 8 & 16777215)), _2 !== u.NULL_CELL_CODE && (this._model.lineLengths[r2] = p2 + 1), (this._model.cells[v2] !== _2 || this._model.cells[v2 + f.RENDER_MODEL_BG_OFFSET] !== this._cellColorResolver.result.bg || this._model.cells[v2 + f.RENDER_MODEL_FG_OFFSET] !== this._cellColorResolver.result.fg || this._model.cells[v2 + f.RENDER_MODEL_EXT_OFFSET] !== this._cellColorResolver.result.ext) && (A = !0, d2.length > 1 && (_2 |= f.COMBINED_CHAR_BIT_MASK), this._model.cells[v2] = _2, this._model.cells[v2 + f.RENDER_MODEL_BG_OFFSET] = this._cellColorResolver.result.bg, this._model.cells[v2 + f.RENDER_MODEL_FG_OFFSET] = this._cellColorResolver.result.fg, this._model.cells[v2 + f.RENDER_MODEL_EXT_OFFSET] = this._cellColorResolver.result.ext, g2 = x.getWidth(), this._glyphRenderer.value.updateCell(p2, r2, _2, this._cellColorResolver.result.bg, this._cellColorResolver.result.fg, this._cellColorResolver.result.ext, d2, g2, s3), h3)) for (x = this._workCell, p2++; p2 < l2; p2++) C2 = (r2 * i3.cols + p2) * f.RENDER_MODEL_INDICIES_PER_CELL, this._glyphRenderer.value.updateCell(p2, r2, u.NULL_CELL_CODE, 0, 0, 0, u.NULL_CELL_CHAR, 0, 0), this._model.cells[C2] = u.NULL_CELL_CODE, this._model.cells[C2 + f.RENDER_MODEL_BG_OFFSET] = this._cellColorResolver.result.bg, this._model.cells[C2 + f.RENDER_MODEL_FG_OFFSET] = this._cellColorResolver.result.fg, this._model.cells[C2 + f.RENDER_MODEL_EXT_OFFSET] = this._cellColorResolver.result.ext; A && this._rectangleRenderer.value.updateBackgrounds(this._model), this._rectangleRenderer.value.updateCursor(this._model); } _updateDimensions() { this._charSizeService.width && this._charSizeService.height && (this.dimensions.device.char.width = Math.floor(this._charSizeService.width * this._devicePixelRatio), this.dimensions.device.char.height = Math.ceil(this._charSizeService.height * this._devicePixelRatio), this.dimensions.device.cell.height = Math.floor(this.dimensions.device.char.height * this._optionsService.rawOptions.lineHeight), this.dimensions.device.char.top = this._optionsService.rawOptions.lineHeight === 1 ? 0 : Math.round((this.dimensions.device.cell.height - this.dimensions.device.char.height) / 2), this.dimensions.device.cell.width = this.dimensions.device.char.width + Math.round(this._optionsService.rawOptions.letterSpacing), this.dimensions.device.char.left = Math.floor(this._optionsService.rawOptions.letterSpacing / 2), this.dimensions.device.canvas.height = this._terminal.rows * this.dimensions.device.cell.height, this.dimensions.device.canvas.width = this._terminal.cols * this.dimensions.device.cell.width, this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / this._devicePixelRatio), this.dimensions.css.canvas.width = Math.round(this.dimensions.device.canvas.width / this._devicePixelRatio), this.dimensions.css.cell.height = this.dimensions.device.cell.height / this._devicePixelRatio, this.dimensions.css.cell.width = this.dimensions.device.cell.width / this._devicePixelRatio); } _setCanvasDevicePixelDimensions(e3, t3) { this._canvas.width === e3 && this._canvas.height === t3 || (this._canvas.width = e3, this._canvas.height = t3, this._requestRedrawViewport()); } _requestRedrawViewport() { this._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1 }); } _requestRedrawCursor() { let e3 = this._terminal.buffer.active.cursorY; this._onRequestRedraw.fire({ start: e3, end: e3 }); } } t2.WebglRenderer = C; class m extends d.AttributeData { constructor(e3, t3, i3) { super(), this.content = 0, this.combinedData = "", this.fg = e3.fg, this.bg = e3.bg, this.combinedData = t3, this._width = i3; } isCombined() { return 2097152; } getWidth() { return this._width; } getChars() { return this.combinedData; } getCode() { return 2097151; } setFromCharData(e3) { throw new Error("not implemented"); } getAsCharData() { return [this.fg, this.getChars(), this.getWidth(), this.getCode()]; } } function L(e3, t3, i3 = 0) { return Math.max(Math.min(e3, t3), i3); } t2.JoinedCellData = m; }, 381: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.GLTexture = t2.expandFloat32Array = t2.createShader = t2.createProgram = t2.PROJECTION_MATRIX = void 0; let s2 = i2(374); function r(e3, t3, i3) { let r2 = (0, s2.throwIfFalsy)(e3.createShader(t3)); if (e3.shaderSource(r2, i3), e3.compileShader(r2), e3.getShaderParameter(r2, e3.COMPILE_STATUS)) return r2; console.error(e3.getShaderInfoLog(r2)), e3.deleteShader(r2); } t2.PROJECTION_MATRIX = new Float32Array([2, 0, 0, 0, 0, -2, 0, 0, 0, 0, 1, 0, -1, 1, 0, 1]), t2.createProgram = function(e3, t3, i3) { let o = (0, s2.throwIfFalsy)(e3.createProgram()); if (e3.attachShader(o, (0, s2.throwIfFalsy)(r(e3, e3.VERTEX_SHADER, t3))), e3.attachShader(o, (0, s2.throwIfFalsy)(r(e3, e3.FRAGMENT_SHADER, i3))), e3.linkProgram(o), e3.getProgramParameter(o, e3.LINK_STATUS)) return o; console.error(e3.getProgramInfoLog(o)), e3.deleteProgram(o); }, t2.createShader = r, t2.expandFloat32Array = function(e3, t3) { let i3 = Math.min(2 * e3.length, t3), s3 = new Float32Array(i3); for (let t4 = 0; t4 < e3.length; t4++) s3[t4] = e3[t4]; return s3; }, t2.GLTexture = class { constructor(e3) { this.texture = e3, this.version = -1; } }; }, 592: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BaseRenderLayer = void 0; let s2 = i2(627), r = i2(237), o = i2(374), n = i2(859); class a extends n.Disposable { constructor(e3, t3, i3, s3, r2, o2, a2, h2) { super(), this._container = t3, this._alpha = r2, this._coreBrowserService = o2, this._optionsService = a2, this._themeService = h2, this._deviceCharWidth = 0, this._deviceCharHeight = 0, this._deviceCellWidth = 0, this._deviceCellHeight = 0, this._deviceCharLeft = 0, this._deviceCharTop = 0, this._canvas = this._coreBrowserService.mainDocument.createElement("canvas"), this._canvas.classList.add(`xterm-${i3}-layer`), this._canvas.style.zIndex = s3.toString(), this._initCanvas(), this._container.appendChild(this._canvas), this.register(this._themeService.onChangeColors(((t4) => { this._refreshCharAtlas(e3, t4), this.reset(e3); }))), this.register((0, n.toDisposable)((() => { this._canvas.remove(); }))); } _initCanvas() { this._ctx = (0, o.throwIfFalsy)(this._canvas.getContext("2d", { alpha: this._alpha })), this._alpha || this._clearAll(); } handleBlur(e3) { } handleFocus(e3) { } handleCursorMove(e3) { } handleGridChanged(e3, t3, i3) { } handleSelectionChanged(e3, t3, i3, s3 = !1) { } _setTransparency(e3, t3) { if (t3 === this._alpha) return; let i3 = this._canvas; this._alpha = t3, this._canvas = this._canvas.cloneNode(), this._initCanvas(), this._container.replaceChild(this._canvas, i3), this._refreshCharAtlas(e3, this._themeService.colors), this.handleGridChanged(e3, 0, e3.rows - 1); } _refreshCharAtlas(e3, t3) { this._deviceCharWidth <= 0 && this._deviceCharHeight <= 0 || (this._charAtlas = (0, s2.acquireTextureAtlas)(e3, this._optionsService.rawOptions, t3, this._deviceCellWidth, this._deviceCellHeight, this._deviceCharWidth, this._deviceCharHeight, this._coreBrowserService.dpr), this._charAtlas.warmUp()); } resize(e3, t3) { this._deviceCellWidth = t3.device.cell.width, this._deviceCellHeight = t3.device.cell.height, this._deviceCharWidth = t3.device.char.width, this._deviceCharHeight = t3.device.char.height, this._deviceCharLeft = t3.device.char.left, this._deviceCharTop = t3.device.char.top, this._canvas.width = t3.device.canvas.width, this._canvas.height = t3.device.canvas.height, this._canvas.style.width = `${t3.css.canvas.width}px`, this._canvas.style.height = `${t3.css.canvas.height}px`, this._alpha || this._clearAll(), this._refreshCharAtlas(e3, this._themeService.colors); } _fillBottomLineAtCells(e3, t3, i3 = 1) { this._ctx.fillRect(e3 * this._deviceCellWidth, (t3 + 1) * this._deviceCellHeight - this._coreBrowserService.dpr - 1, i3 * this._deviceCellWidth, this._coreBrowserService.dpr); } _clearAll() { this._alpha ? this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height) : (this._ctx.fillStyle = this._themeService.colors.background.css, this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height)); } _clearCells(e3, t3, i3, s3) { this._alpha ? this._ctx.clearRect(e3 * this._deviceCellWidth, t3 * this._deviceCellHeight, i3 * this._deviceCellWidth, s3 * this._deviceCellHeight) : (this._ctx.fillStyle = this._themeService.colors.background.css, this._ctx.fillRect(e3 * this._deviceCellWidth, t3 * this._deviceCellHeight, i3 * this._deviceCellWidth, s3 * this._deviceCellHeight)); } _fillCharTrueColor(e3, t3, i3, s3) { this._ctx.font = this._getFont(e3, !1, !1), this._ctx.textBaseline = r.TEXT_BASELINE, this._clipCell(i3, s3, t3.getWidth()), this._ctx.fillText(t3.getChars(), i3 * this._deviceCellWidth + this._deviceCharLeft, s3 * this._deviceCellHeight + this._deviceCharTop + this._deviceCharHeight); } _clipCell(e3, t3, i3) { this._ctx.beginPath(), this._ctx.rect(e3 * this._deviceCellWidth, t3 * this._deviceCellHeight, i3 * this._deviceCellWidth, this._deviceCellHeight), this._ctx.clip(); } _getFont(e3, t3, i3) { return `${i3 ? "italic" : ""} ${t3 ? e3.options.fontWeightBold : e3.options.fontWeight} ${e3.options.fontSize * this._coreBrowserService.dpr}px ${e3.options.fontFamily}`; } } t2.BaseRenderLayer = a; }, 733: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.LinkRenderLayer = void 0; let s2 = i2(197), r = i2(237), o = i2(592); class n extends o.BaseRenderLayer { constructor(e3, t3, i3, s3, r2, o2, n2) { super(i3, e3, "link", t3, !0, r2, o2, n2), this.register(s3.onShowLinkUnderline(((e4) => this._handleShowLinkUnderline(e4)))), this.register(s3.onHideLinkUnderline(((e4) => this._handleHideLinkUnderline(e4)))); } resize(e3, t3) { super.resize(e3, t3), this._state = void 0; } reset(e3) { this._clearCurrentLink(); } _clearCurrentLink() { if (this._state) { this._clearCells(this._state.x1, this._state.y1, this._state.cols - this._state.x1, 1); let e3 = this._state.y2 - this._state.y1 - 1; e3 > 0 && this._clearCells(0, this._state.y1 + 1, this._state.cols, e3), this._clearCells(0, this._state.y2, this._state.x2, 1), this._state = void 0; } } _handleShowLinkUnderline(e3) { if (e3.fg === r.INVERTED_DEFAULT_COLOR ? this._ctx.fillStyle = this._themeService.colors.background.css : e3.fg !== void 0 && (0, s2.is256Color)(e3.fg) ? this._ctx.fillStyle = this._themeService.colors.ansi[e3.fg].css : this._ctx.fillStyle = this._themeService.colors.foreground.css, e3.y1 === e3.y2) this._fillBottomLineAtCells(e3.x1, e3.y1, e3.x2 - e3.x1); else { this._fillBottomLineAtCells(e3.x1, e3.y1, e3.cols - e3.x1); for (let t3 = e3.y1 + 1; t3 < e3.y2; t3++) this._fillBottomLineAtCells(0, t3, e3.cols); this._fillBottomLineAtCells(0, e3.y2, e3.x2); } this._state = e3; } _handleHideLinkUnderline(e3) { this._clearCurrentLink(); } } t2.LinkRenderLayer = n; }, 820: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.addDisposableDomListener = void 0, t2.addDisposableDomListener = function(e3, t3, i2, s2) { e3.addEventListener(t3, i2, s2); let r = !1; return { dispose: () => { r || (r = !0, e3.removeEventListener(t3, i2, s2)); } }; }; }, 274: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CellColorResolver = void 0; let s2 = i2(855), r = i2(160), o = i2(374), n, a = 0, h2 = 0, l = !1, c = !1, d = !1, _ = 0; t2.CellColorResolver = class { constructor(e3, t3, i3, s3, r2, o2) { this._terminal = e3, this._optionService = t3, this._selectionRenderModel = i3, this._decorationService = s3, this._coreBrowserService = r2, this._themeService = o2, this.result = { fg: 0, bg: 0, ext: 0 }; } resolve(e3, t3, i3, u) { if (this.result.bg = e3.bg, this.result.fg = e3.fg, this.result.ext = 268435456 & e3.bg ? e3.extended.ext : 0, h2 = 0, a = 0, c = !1, l = !1, d = !1, n = this._themeService.colors, _ = 0, e3.getCode() !== s2.NULL_CELL_CODE && e3.extended.underlineStyle === 4) { let e4 = Math.max(1, Math.floor(this._optionService.rawOptions.fontSize * this._coreBrowserService.dpr / 15)); _ = t3 * u % (2 * Math.round(e4)); } if (this._decorationService.forEachDecorationAtCell(t3, i3, "bottom", ((e4) => { e4.backgroundColorRGB && (h2 = e4.backgroundColorRGB.rgba >> 8 & 16777215, c = !0), e4.foregroundColorRGB && (a = e4.foregroundColorRGB.rgba >> 8 & 16777215, l = !0); })), d = this._selectionRenderModel.isCellSelected(this._terminal, t3, i3), d) { if (67108864 & this.result.fg || (50331648 & this.result.bg) != 0) { if (67108864 & this.result.fg) switch (50331648 & this.result.fg) { case 16777216: case 33554432: h2 = this._themeService.colors.ansi[255 & this.result.fg].rgba; break; case 50331648: h2 = (16777215 & this.result.fg) << 8 | 255; break; default: h2 = this._themeService.colors.foreground.rgba; } else switch (50331648 & this.result.bg) { case 16777216: case 33554432: h2 = this._themeService.colors.ansi[255 & this.result.bg].rgba; break; case 50331648: h2 = (16777215 & this.result.bg) << 8 | 255; } h2 = r.rgba.blend(h2, 4294967040 & (this._coreBrowserService.isFocused ? n.selectionBackgroundOpaque : n.selectionInactiveBackgroundOpaque).rgba | 128) >> 8 & 16777215; } else h2 = (this._coreBrowserService.isFocused ? n.selectionBackgroundOpaque : n.selectionInactiveBackgroundOpaque).rgba >> 8 & 16777215; if (c = !0, n.selectionForeground && (a = n.selectionForeground.rgba >> 8 & 16777215, l = !0), (0, o.treatGlyphAsBackgroundColor)(e3.getCode())) { if (67108864 & this.result.fg && (50331648 & this.result.bg) == 0) a = (this._coreBrowserService.isFocused ? n.selectionBackgroundOpaque : n.selectionInactiveBackgroundOpaque).rgba >> 8 & 16777215; else { if (67108864 & this.result.fg) switch (50331648 & this.result.bg) { case 16777216: case 33554432: a = this._themeService.colors.ansi[255 & this.result.bg].rgba; break; case 50331648: a = (16777215 & this.result.bg) << 8 | 255; } else switch (50331648 & this.result.fg) { case 16777216: case 33554432: a = this._themeService.colors.ansi[255 & this.result.fg].rgba; break; case 50331648: a = (16777215 & this.result.fg) << 8 | 255; break; default: a = this._themeService.colors.foreground.rgba; } a = r.rgba.blend(a, 4294967040 & (this._coreBrowserService.isFocused ? n.selectionBackgroundOpaque : n.selectionInactiveBackgroundOpaque).rgba | 128) >> 8 & 16777215; } l = !0; } } this._decorationService.forEachDecorationAtCell(t3, i3, "top", ((e4) => { e4.backgroundColorRGB && (h2 = e4.backgroundColorRGB.rgba >> 8 & 16777215, c = !0), e4.foregroundColorRGB && (a = e4.foregroundColorRGB.rgba >> 8 & 16777215, l = !0); })), c && (h2 = d ? -16777216 & e3.bg & -134217729 | h2 | 50331648 : -16777216 & e3.bg | h2 | 50331648), l && (a = -16777216 & e3.fg & -67108865 | a | 50331648), 67108864 & this.result.fg && (c && !l && (a = (50331648 & this.result.bg) == 0 ? -134217728 & this.result.fg | 16777215 & n.background.rgba >> 8 | 50331648 : -134217728 & this.result.fg | 67108863 & this.result.bg, l = !0), !c && l && (h2 = (50331648 & this.result.fg) == 0 ? -67108864 & this.result.bg | 16777215 & n.foreground.rgba >> 8 | 50331648 : -67108864 & this.result.bg | 67108863 & this.result.fg, c = !0)), n = void 0, this.result.bg = c ? h2 : this.result.bg, this.result.fg = l ? a : this.result.fg, this.result.ext &= 536870911, this.result.ext |= _ << 29 & 3758096384; } }; }, 627: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.removeTerminalFromCache = t2.acquireTextureAtlas = void 0; let s2 = i2(509), r = i2(197), o = []; t2.acquireTextureAtlas = function(e3, t3, i3, n, a, h2, l, c) { let d = (0, r.generateConfig)(n, a, h2, l, t3, i3, c); for (let t4 = 0; t4 < o.length; t4++) { let i4 = o[t4], s3 = i4.ownedBy.indexOf(e3); if (s3 >= 0) { if ((0, r.configEquals)(i4.config, d)) return i4.atlas; i4.ownedBy.length === 1 ? (i4.atlas.dispose(), o.splice(t4, 1)) : i4.ownedBy.splice(s3, 1); break; } } for (let t4 = 0; t4 < o.length; t4++) { let i4 = o[t4]; if ((0, r.configEquals)(i4.config, d)) return i4.ownedBy.push(e3), i4.atlas; } let _ = e3._core, u = { atlas: new s2.TextureAtlas(document, d, _.unicodeService), config: d, ownedBy: [e3] }; return o.push(u), u.atlas; }, t2.removeTerminalFromCache = function(e3) { for (let t3 = 0; t3 < o.length; t3++) { let i3 = o[t3].ownedBy.indexOf(e3); if (i3 !== -1) { o[t3].ownedBy.length === 1 ? (o[t3].atlas.dispose(), o.splice(t3, 1)) : o[t3].ownedBy.splice(i3, 1); break; } } }; }, 197: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.is256Color = t2.configEquals = t2.generateConfig = void 0; let s2 = i2(160); t2.generateConfig = function(e3, t3, i3, r, o, n, a) { let h2 = { foreground: n.foreground, background: n.background, cursor: s2.NULL_COLOR, cursorAccent: s2.NULL_COLOR, selectionForeground: s2.NULL_COLOR, selectionBackgroundTransparent: s2.NULL_COLOR, selectionBackgroundOpaque: s2.NULL_COLOR, selectionInactiveBackgroundTransparent: s2.NULL_COLOR, selectionInactiveBackgroundOpaque: s2.NULL_COLOR, ansi: n.ansi.slice(), contrastCache: n.contrastCache, halfContrastCache: n.halfContrastCache }; return { customGlyphs: o.customGlyphs, devicePixelRatio: a, letterSpacing: o.letterSpacing, lineHeight: o.lineHeight, deviceCellWidth: e3, deviceCellHeight: t3, deviceCharWidth: i3, deviceCharHeight: r, fontFamily: o.fontFamily, fontSize: o.fontSize, fontWeight: o.fontWeight, fontWeightBold: o.fontWeightBold, allowTransparency: o.allowTransparency, drawBoldTextInBrightColors: o.drawBoldTextInBrightColors, minimumContrastRatio: o.minimumContrastRatio, colors: h2 }; }, t2.configEquals = function(e3, t3) { for (let i3 = 0; i3 < e3.colors.ansi.length; i3++) if (e3.colors.ansi[i3].rgba !== t3.colors.ansi[i3].rgba) return !1; return e3.devicePixelRatio === t3.devicePixelRatio && e3.customGlyphs === t3.customGlyphs && e3.lineHeight === t3.lineHeight && e3.letterSpacing === t3.letterSpacing && e3.fontFamily === t3.fontFamily && e3.fontSize === t3.fontSize && e3.fontWeight === t3.fontWeight && e3.fontWeightBold === t3.fontWeightBold && e3.allowTransparency === t3.allowTransparency && e3.deviceCharWidth === t3.deviceCharWidth && e3.deviceCharHeight === t3.deviceCharHeight && e3.drawBoldTextInBrightColors === t3.drawBoldTextInBrightColors && e3.minimumContrastRatio === t3.minimumContrastRatio && e3.colors.foreground.rgba === t3.colors.foreground.rgba && e3.colors.background.rgba === t3.colors.background.rgba; }, t2.is256Color = function(e3) { return (50331648 & e3) == 16777216 || (50331648 & e3) == 33554432; }; }, 237: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.TEXT_BASELINE = t2.DIM_OPACITY = t2.INVERTED_DEFAULT_COLOR = void 0; let s2 = i2(399); t2.INVERTED_DEFAULT_COLOR = 257, t2.DIM_OPACITY = 0.5, t2.TEXT_BASELINE = s2.isFirefox || s2.isLegacyEdge ? "bottom" : "ideographic"; }, 457: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CursorBlinkStateManager = void 0, t2.CursorBlinkStateManager = class { constructor(e3, t3) { this._renderCallback = e3, this._coreBrowserService = t3, this.isCursorVisible = !0, this._coreBrowserService.isFocused && this._restartInterval(); } get isPaused() { return !(this._blinkStartTimeout || this._blinkInterval); } dispose() { this._blinkInterval && (this._coreBrowserService.window.clearInterval(this._blinkInterval), this._blinkInterval = void 0), this._blinkStartTimeout && (this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout), this._blinkStartTimeout = void 0), this._animationFrame && (this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame), this._animationFrame = void 0); } restartBlinkAnimation() { this.isPaused || (this._animationTimeRestarted = Date.now(), this.isCursorVisible = !0, this._animationFrame || (this._animationFrame = this._coreBrowserService.window.requestAnimationFrame((() => { this._renderCallback(), this._animationFrame = void 0; })))); } _restartInterval(e3 = 600) { this._blinkInterval && (this._coreBrowserService.window.clearInterval(this._blinkInterval), this._blinkInterval = void 0), this._blinkStartTimeout = this._coreBrowserService.window.setTimeout((() => { if (this._animationTimeRestarted) { let e4 = 600 - (Date.now() - this._animationTimeRestarted); if (this._animationTimeRestarted = void 0, e4 > 0) return void this._restartInterval(e4); } this.isCursorVisible = !1, this._animationFrame = this._coreBrowserService.window.requestAnimationFrame((() => { this._renderCallback(), this._animationFrame = void 0; })), this._blinkInterval = this._coreBrowserService.window.setInterval((() => { if (this._animationTimeRestarted) { let e4 = 600 - (Date.now() - this._animationTimeRestarted); return this._animationTimeRestarted = void 0, void this._restartInterval(e4); } this.isCursorVisible = !this.isCursorVisible, this._animationFrame = this._coreBrowserService.window.requestAnimationFrame((() => { this._renderCallback(), this._animationFrame = void 0; })); }), 600); }), e3); } pause() { this.isCursorVisible = !0, this._blinkInterval && (this._coreBrowserService.window.clearInterval(this._blinkInterval), this._blinkInterval = void 0), this._blinkStartTimeout && (this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout), this._blinkStartTimeout = void 0), this._animationFrame && (this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame), this._animationFrame = void 0); } resume() { this.pause(), this._animationTimeRestarted = void 0, this._restartInterval(), this.restartBlinkAnimation(); } }; }, 860: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.tryDrawCustomChar = t2.powerlineDefinitions = t2.boxDrawingDefinitions = t2.blockElementDefinitions = void 0; let s2 = i2(374); t2.blockElementDefinitions = { "\u2580": [{ x: 0, y: 0, w: 8, h: 4 }], "\u2581": [{ x: 0, y: 7, w: 8, h: 1 }], "\u2582": [{ x: 0, y: 6, w: 8, h: 2 }], "\u2583": [{ x: 0, y: 5, w: 8, h: 3 }], "\u2584": [{ x: 0, y: 4, w: 8, h: 4 }], "\u2585": [{ x: 0, y: 3, w: 8, h: 5 }], "\u2586": [{ x: 0, y: 2, w: 8, h: 6 }], "\u2587": [{ x: 0, y: 1, w: 8, h: 7 }], "\u2588": [{ x: 0, y: 0, w: 8, h: 8 }], "\u2589": [{ x: 0, y: 0, w: 7, h: 8 }], "\u258A": [{ x: 0, y: 0, w: 6, h: 8 }], "\u258B": [{ x: 0, y: 0, w: 5, h: 8 }], "\u258C": [{ x: 0, y: 0, w: 4, h: 8 }], "\u258D": [{ x: 0, y: 0, w: 3, h: 8 }], "\u258E": [{ x: 0, y: 0, w: 2, h: 8 }], "\u258F": [{ x: 0, y: 0, w: 1, h: 8 }], "\u2590": [{ x: 4, y: 0, w: 4, h: 8 }], "\u2594": [{ x: 0, y: 0, w: 8, h: 1 }], "\u2595": [{ x: 7, y: 0, w: 1, h: 8 }], "\u2596": [{ x: 0, y: 4, w: 4, h: 4 }], "\u2597": [{ x: 4, y: 4, w: 4, h: 4 }], "\u2598": [{ x: 0, y: 0, w: 4, h: 4 }], "\u2599": [{ x: 0, y: 0, w: 4, h: 8 }, { x: 0, y: 4, w: 8, h: 4 }], "\u259A": [{ x: 0, y: 0, w: 4, h: 4 }, { x: 4, y: 4, w: 4, h: 4 }], "\u259B": [{ x: 0, y: 0, w: 4, h: 8 }, { x: 4, y: 0, w: 4, h: 4 }], "\u259C": [{ x: 0, y: 0, w: 8, h: 4 }, { x: 4, y: 0, w: 4, h: 8 }], "\u259D": [{ x: 4, y: 0, w: 4, h: 4 }], "\u259E": [{ x: 4, y: 0, w: 4, h: 4 }, { x: 0, y: 4, w: 4, h: 4 }], "\u259F": [{ x: 4, y: 0, w: 4, h: 8 }, { x: 0, y: 4, w: 8, h: 4 }], "\u{1FB70}": [{ x: 1, y: 0, w: 1, h: 8 }], "\u{1FB71}": [{ x: 2, y: 0, w: 1, h: 8 }], "\u{1FB72}": [{ x: 3, y: 0, w: 1, h: 8 }], "\u{1FB73}": [{ x: 4, y: 0, w: 1, h: 8 }], "\u{1FB74}": [{ x: 5, y: 0, w: 1, h: 8 }], "\u{1FB75}": [{ x: 6, y: 0, w: 1, h: 8 }], "\u{1FB76}": [{ x: 0, y: 1, w: 8, h: 1 }], "\u{1FB77}": [{ x: 0, y: 2, w: 8, h: 1 }], "\u{1FB78}": [{ x: 0, y: 3, w: 8, h: 1 }], "\u{1FB79}": [{ x: 0, y: 4, w: 8, h: 1 }], "\u{1FB7A}": [{ x: 0, y: 5, w: 8, h: 1 }], "\u{1FB7B}": [{ x: 0, y: 6, w: 8, h: 1 }], "\u{1FB7C}": [{ x: 0, y: 0, w: 1, h: 8 }, { x: 0, y: 7, w: 8, h: 1 }], "\u{1FB7D}": [{ x: 0, y: 0, w: 1, h: 8 }, { x: 0, y: 0, w: 8, h: 1 }], "\u{1FB7E}": [{ x: 7, y: 0, w: 1, h: 8 }, { x: 0, y: 0, w: 8, h: 1 }], "\u{1FB7F}": [{ x: 7, y: 0, w: 1, h: 8 }, { x: 0, y: 7, w: 8, h: 1 }], "\u{1FB80}": [{ x: 0, y: 0, w: 8, h: 1 }, { x: 0, y: 7, w: 8, h: 1 }], "\u{1FB81}": [{ x: 0, y: 0, w: 8, h: 1 }, { x: 0, y: 2, w: 8, h: 1 }, { x: 0, y: 4, w: 8, h: 1 }, { x: 0, y: 7, w: 8, h: 1 }], "\u{1FB82}": [{ x: 0, y: 0, w: 8, h: 2 }], "\u{1FB83}": [{ x: 0, y: 0, w: 8, h: 3 }], "\u{1FB84}": [{ x: 0, y: 0, w: 8, h: 5 }], "\u{1FB85}": [{ x: 0, y: 0, w: 8, h: 6 }], "\u{1FB86}": [{ x: 0, y: 0, w: 8, h: 7 }], "\u{1FB87}": [{ x: 6, y: 0, w: 2, h: 8 }], "\u{1FB88}": [{ x: 5, y: 0, w: 3, h: 8 }], "\u{1FB89}": [{ x: 3, y: 0, w: 5, h: 8 }], "\u{1FB8A}": [{ x: 2, y: 0, w: 6, h: 8 }], "\u{1FB8B}": [{ x: 1, y: 0, w: 7, h: 8 }], "\u{1FB95}": [{ x: 0, y: 0, w: 2, h: 2 }, { x: 4, y: 0, w: 2, h: 2 }, { x: 2, y: 2, w: 2, h: 2 }, { x: 6, y: 2, w: 2, h: 2 }, { x: 0, y: 4, w: 2, h: 2 }, { x: 4, y: 4, w: 2, h: 2 }, { x: 2, y: 6, w: 2, h: 2 }, { x: 6, y: 6, w: 2, h: 2 }], "\u{1FB96}": [{ x: 2, y: 0, w: 2, h: 2 }, { x: 6, y: 0, w: 2, h: 2 }, { x: 0, y: 2, w: 2, h: 2 }, { x: 4, y: 2, w: 2, h: 2 }, { x: 2, y: 4, w: 2, h: 2 }, { x: 6, y: 4, w: 2, h: 2 }, { x: 0, y: 6, w: 2, h: 2 }, { x: 4, y: 6, w: 2, h: 2 }], "\u{1FB97}": [{ x: 0, y: 2, w: 8, h: 2 }, { x: 0, y: 6, w: 8, h: 2 }] }; let r = { "\u2591": [[1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 0]], "\u2592": [[1, 0], [0, 0], [0, 1], [0, 0]], "\u2593": [[0, 1], [1, 1], [1, 0], [1, 1]] }; t2.boxDrawingDefinitions = { "\u2500": { 1: "M0,.5 L1,.5" }, "\u2501": { 3: "M0,.5 L1,.5" }, "\u2502": { 1: "M.5,0 L.5,1" }, "\u2503": { 3: "M.5,0 L.5,1" }, "\u250C": { 1: "M0.5,1 L.5,.5 L1,.5" }, "\u250F": { 3: "M0.5,1 L.5,.5 L1,.5" }, "\u2510": { 1: "M0,.5 L.5,.5 L.5,1" }, "\u2513": { 3: "M0,.5 L.5,.5 L.5,1" }, "\u2514": { 1: "M.5,0 L.5,.5 L1,.5" }, "\u2517": { 3: "M.5,0 L.5,.5 L1,.5" }, "\u2518": { 1: "M.5,0 L.5,.5 L0,.5" }, "\u251B": { 3: "M.5,0 L.5,.5 L0,.5" }, "\u251C": { 1: "M.5,0 L.5,1 M.5,.5 L1,.5" }, "\u2523": { 3: "M.5,0 L.5,1 M.5,.5 L1,.5" }, "\u2524": { 1: "M.5,0 L.5,1 M.5,.5 L0,.5" }, "\u252B": { 3: "M.5,0 L.5,1 M.5,.5 L0,.5" }, "\u252C": { 1: "M0,.5 L1,.5 M.5,.5 L.5,1" }, "\u2533": { 3: "M0,.5 L1,.5 M.5,.5 L.5,1" }, "\u2534": { 1: "M0,.5 L1,.5 M.5,.5 L.5,0" }, "\u253B": { 3: "M0,.5 L1,.5 M.5,.5 L.5,0" }, "\u253C": { 1: "M0,.5 L1,.5 M.5,0 L.5,1" }, "\u254B": { 3: "M0,.5 L1,.5 M.5,0 L.5,1" }, "\u2574": { 1: "M.5,.5 L0,.5" }, "\u2578": { 3: "M.5,.5 L0,.5" }, "\u2575": { 1: "M.5,.5 L.5,0" }, "\u2579": { 3: "M.5,.5 L.5,0" }, "\u2576": { 1: "M.5,.5 L1,.5" }, "\u257A": { 3: "M.5,.5 L1,.5" }, "\u2577": { 1: "M.5,.5 L.5,1" }, "\u257B": { 3: "M.5,.5 L.5,1" }, "\u2550": { 1: (e3, t3) => `M0,${0.5 - t3} L1,${0.5 - t3} M0,${0.5 + t3} L1,${0.5 + t3}` }, "\u2551": { 1: (e3, t3) => `M${0.5 - e3},0 L${0.5 - e3},1 M${0.5 + e3},0 L${0.5 + e3},1` }, "\u2552": { 1: (e3, t3) => `M.5,1 L.5,${0.5 - t3} L1,${0.5 - t3} M.5,${0.5 + t3} L1,${0.5 + t3}` }, "\u2553": { 1: (e3, t3) => `M${0.5 - e3},1 L${0.5 - e3},.5 L1,.5 M${0.5 + e3},.5 L${0.5 + e3},1` }, "\u2554": { 1: (e3, t3) => `M1,${0.5 - t3} L${0.5 - e3},${0.5 - t3} L${0.5 - e3},1 M1,${0.5 + t3} L${0.5 + e3},${0.5 + t3} L${0.5 + e3},1` }, "\u2555": { 1: (e3, t3) => `M0,${0.5 - t3} L.5,${0.5 - t3} L.5,1 M0,${0.5 + t3} L.5,${0.5 + t3}` }, "\u2556": { 1: (e3, t3) => `M${0.5 + e3},1 L${0.5 + e3},.5 L0,.5 M${0.5 - e3},.5 L${0.5 - e3},1` }, "\u2557": { 1: (e3, t3) => `M0,${0.5 + t3} L${0.5 - e3},${0.5 + t3} L${0.5 - e3},1 M0,${0.5 - t3} L${0.5 + e3},${0.5 - t3} L${0.5 + e3},1` }, "\u2558": { 1: (e3, t3) => `M.5,0 L.5,${0.5 + t3} L1,${0.5 + t3} M.5,${0.5 - t3} L1,${0.5 - t3}` }, "\u2559": { 1: (e3, t3) => `M1,.5 L${0.5 - e3},.5 L${0.5 - e3},0 M${0.5 + e3},.5 L${0.5 + e3},0` }, "\u255A": { 1: (e3, t3) => `M1,${0.5 - t3} L${0.5 + e3},${0.5 - t3} L${0.5 + e3},0 M1,${0.5 + t3} L${0.5 - e3},${0.5 + t3} L${0.5 - e3},0` }, "\u255B": { 1: (e3, t3) => `M0,${0.5 + t3} L.5,${0.5 + t3} L.5,0 M0,${0.5 - t3} L.5,${0.5 - t3}` }, "\u255C": { 1: (e3, t3) => `M0,.5 L${0.5 + e3},.5 L${0.5 + e3},0 M${0.5 - e3},.5 L${0.5 - e3},0` }, "\u255D": { 1: (e3, t3) => `M0,${0.5 - t3} L${0.5 - e3},${0.5 - t3} L${0.5 - e3},0 M0,${0.5 + t3} L${0.5 + e3},${0.5 + t3} L${0.5 + e3},0` }, "\u255E": { 1: (e3, t3) => `M.5,0 L.5,1 M.5,${0.5 - t3} L1,${0.5 - t3} M.5,${0.5 + t3} L1,${0.5 + t3}` }, "\u255F": { 1: (e3, t3) => `M${0.5 - e3},0 L${0.5 - e3},1 M${0.5 + e3},0 L${0.5 + e3},1 M${0.5 + e3},.5 L1,.5` }, "\u2560": { 1: (e3, t3) => `M${0.5 - e3},0 L${0.5 - e3},1 M1,${0.5 + t3} L${0.5 + e3},${0.5 + t3} L${0.5 + e3},1 M1,${0.5 - t3} L${0.5 + e3},${0.5 - t3} L${0.5 + e3},0` }, "\u2561": { 1: (e3, t3) => `M.5,0 L.5,1 M0,${0.5 - t3} L.5,${0.5 - t3} M0,${0.5 + t3} L.5,${0.5 + t3}` }, "\u2562": { 1: (e3, t3) => `M0,.5 L${0.5 - e3},.5 M${0.5 - e3},0 L${0.5 - e3},1 M${0.5 + e3},0 L${0.5 + e3},1` }, "\u2563": { 1: (e3, t3) => `M${0.5 + e3},0 L${0.5 + e3},1 M0,${0.5 + t3} L${0.5 - e3},${0.5 + t3} L${0.5 - e3},1 M0,${0.5 - t3} L${0.5 - e3},${0.5 - t3} L${0.5 - e3},0` }, "\u2564": { 1: (e3, t3) => `M0,${0.5 - t3} L1,${0.5 - t3} M0,${0.5 + t3} L1,${0.5 + t3} M.5,${0.5 + t3} L.5,1` }, "\u2565": { 1: (e3, t3) => `M0,.5 L1,.5 M${0.5 - e3},.5 L${0.5 - e3},1 M${0.5 + e3},.5 L${0.5 + e3},1` }, "\u2566": { 1: (e3, t3) => `M0,${0.5 - t3} L1,${0.5 - t3} M0,${0.5 + t3} L${0.5 - e3},${0.5 + t3} L${0.5 - e3},1 M1,${0.5 + t3} L${0.5 + e3},${0.5 + t3} L${0.5 + e3},1` }, "\u2567": { 1: (e3, t3) => `M.5,0 L.5,${0.5 - t3} M0,${0.5 - t3} L1,${0.5 - t3} M0,${0.5 + t3} L1,${0.5 + t3}` }, "\u2568": { 1: (e3, t3) => `M0,.5 L1,.5 M${0.5 - e3},.5 L${0.5 - e3},0 M${0.5 + e3},.5 L${0.5 + e3},0` }, "\u2569": { 1: (e3, t3) => `M0,${0.5 + t3} L1,${0.5 + t3} M0,${0.5 - t3} L${0.5 - e3},${0.5 - t3} L${0.5 - e3},0 M1,${0.5 - t3} L${0.5 + e3},${0.5 - t3} L${0.5 + e3},0` }, "\u256A": { 1: (e3, t3) => `M.5,0 L.5,1 M0,${0.5 - t3} L1,${0.5 - t3} M0,${0.5 + t3} L1,${0.5 + t3}` }, "\u256B": { 1: (e3, t3) => `M0,.5 L1,.5 M${0.5 - e3},0 L${0.5 - e3},1 M${0.5 + e3},0 L${0.5 + e3},1` }, "\u256C": { 1: (e3, t3) => `M0,${0.5 + t3} L${0.5 - e3},${0.5 + t3} L${0.5 - e3},1 M1,${0.5 + t3} L${0.5 + e3},${0.5 + t3} L${0.5 + e3},1 M0,${0.5 - t3} L${0.5 - e3},${0.5 - t3} L${0.5 - e3},0 M1,${0.5 - t3} L${0.5 + e3},${0.5 - t3} L${0.5 + e3},0` }, "\u2571": { 1: "M1,0 L0,1" }, "\u2572": { 1: "M0,0 L1,1" }, "\u2573": { 1: "M1,0 L0,1 M0,0 L1,1" }, "\u257C": { 1: "M.5,.5 L0,.5", 3: "M.5,.5 L1,.5" }, "\u257D": { 1: "M.5,.5 L.5,0", 3: "M.5,.5 L.5,1" }, "\u257E": { 1: "M.5,.5 L1,.5", 3: "M.5,.5 L0,.5" }, "\u257F": { 1: "M.5,.5 L.5,1", 3: "M.5,.5 L.5,0" }, "\u250D": { 1: "M.5,.5 L.5,1", 3: "M.5,.5 L1,.5" }, "\u250E": { 1: "M.5,.5 L1,.5", 3: "M.5,.5 L.5,1" }, "\u2511": { 1: "M.5,.5 L.5,1", 3: "M.5,.5 L0,.5" }, "\u2512": { 1: "M.5,.5 L0,.5", 3: "M.5,.5 L.5,1" }, "\u2515": { 1: "M.5,.5 L.5,0", 3: "M.5,.5 L1,.5" }, "\u2516": { 1: "M.5,.5 L1,.5", 3: "M.5,.5 L.5,0" }, "\u2519": { 1: "M.5,.5 L.5,0", 3: "M.5,.5 L0,.5" }, "\u251A": { 1: "M.5,.5 L0,.5", 3: "M.5,.5 L.5,0" }, "\u251D": { 1: "M.5,0 L.5,1", 3: "M.5,.5 L1,.5" }, "\u251E": { 1: "M0.5,1 L.5,.5 L1,.5", 3: "M.5,.5 L.5,0" }, "\u251F": { 1: "M.5,0 L.5,.5 L1,.5", 3: "M.5,.5 L.5,1" }, "\u2520": { 1: "M.5,.5 L1,.5", 3: "M.5,0 L.5,1" }, "\u2521": { 1: "M.5,.5 L.5,1", 3: "M.5,0 L.5,.5 L1,.5" }, "\u2522": { 1: "M.5,.5 L.5,0", 3: "M0.5,1 L.5,.5 L1,.5" }, "\u2525": { 1: "M.5,0 L.5,1", 3: "M.5,.5 L0,.5" }, "\u2526": { 1: "M0,.5 L.5,.5 L.5,1", 3: "M.5,.5 L.5,0" }, "\u2527": { 1: "M.5,0 L.5,.5 L0,.5", 3: "M.5,.5 L.5,1" }, "\u2528": { 1: "M.5,.5 L0,.5", 3: "M.5,0 L.5,1" }, "\u2529": { 1: "M.5,.5 L.5,1", 3: "M.5,0 L.5,.5 L0,.5" }, "\u252A": { 1: "M.5,.5 L.5,0", 3: "M0,.5 L.5,.5 L.5,1" }, "\u252D": { 1: "M0.5,1 L.5,.5 L1,.5", 3: "M.5,.5 L0,.5" }, "\u252E": { 1: "M0,.5 L.5,.5 L.5,1", 3: "M.5,.5 L1,.5" }, "\u252F": { 1: "M.5,.5 L.5,1", 3: "M0,.5 L1,.5" }, "\u2530": { 1: "M0,.5 L1,.5", 3: "M.5,.5 L.5,1" }, "\u2531": { 1: "M.5,.5 L1,.5", 3: "M0,.5 L.5,.5 L.5,1" }, "\u2532": { 1: "M.5,.5 L0,.5", 3: "M0.5,1 L.5,.5 L1,.5" }, "\u2535": { 1: "M.5,0 L.5,.5 L1,.5", 3: "M.5,.5 L0,.5" }, "\u2536": { 1: "M.5,0 L.5,.5 L0,.5", 3: "M.5,.5 L1,.5" }, "\u2537": { 1: "M.5,.5 L.5,0", 3: "M0,.5 L1,.5" }, "\u2538": { 1: "M0,.5 L1,.5", 3: "M.5,.5 L.5,0" }, "\u2539": { 1: "M.5,.5 L1,.5", 3: "M.5,0 L.5,.5 L0,.5" }, "\u253A": { 1: "M.5,.5 L0,.5", 3: "M.5,0 L.5,.5 L1,.5" }, "\u253D": { 1: "M.5,0 L.5,1 M.5,.5 L1,.5", 3: "M.5,.5 L0,.5" }, "\u253E": { 1: "M.5,0 L.5,1 M.5,.5 L0,.5", 3: "M.5,.5 L1,.5" }, "\u253F": { 1: "M.5,0 L.5,1", 3: "M0,.5 L1,.5" }, "\u2540": { 1: "M0,.5 L1,.5 M.5,.5 L.5,1", 3: "M.5,.5 L.5,0" }, "\u2541": { 1: "M.5,.5 L.5,0 M0,.5 L1,.5", 3: "M.5,.5 L.5,1" }, "\u2542": { 1: "M0,.5 L1,.5", 3: "M.5,0 L.5,1" }, "\u2543": { 1: "M0.5,1 L.5,.5 L1,.5", 3: "M.5,0 L.5,.5 L0,.5" }, "\u2544": { 1: "M0,.5 L.5,.5 L.5,1", 3: "M.5,0 L.5,.5 L1,.5" }, "\u2545": { 1: "M.5,0 L.5,.5 L1,.5", 3: "M0,.5 L.5,.5 L.5,1" }, "\u2546": { 1: "M.5,0 L.5,.5 L0,.5", 3: "M0.5,1 L.5,.5 L1,.5" }, "\u2547": { 1: "M.5,.5 L.5,1", 3: "M.5,.5 L.5,0 M0,.5 L1,.5" }, "\u2548": { 1: "M.5,.5 L.5,0", 3: "M0,.5 L1,.5 M.5,.5 L.5,1" }, "\u2549": { 1: "M.5,.5 L1,.5", 3: "M.5,0 L.5,1 M.5,.5 L0,.5" }, "\u254A": { 1: "M.5,.5 L0,.5", 3: "M.5,0 L.5,1 M.5,.5 L1,.5" }, "\u254C": { 1: "M.1,.5 L.4,.5 M.6,.5 L.9,.5" }, "\u254D": { 3: "M.1,.5 L.4,.5 M.6,.5 L.9,.5" }, "\u2504": { 1: "M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5" }, "\u2505": { 3: "M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5" }, "\u2508": { 1: "M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5" }, "\u2509": { 3: "M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5" }, "\u254E": { 1: "M.5,.1 L.5,.4 M.5,.6 L.5,.9" }, "\u254F": { 3: "M.5,.1 L.5,.4 M.5,.6 L.5,.9" }, "\u2506": { 1: "M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333" }, "\u2507": { 3: "M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333" }, "\u250A": { 1: "M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95" }, "\u250B": { 3: "M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95" }, "\u256D": { 1: (e3, t3) => `M.5,1 L.5,${0.5 + t3 / 0.15 * 0.5} C.5,${0.5 + t3 / 0.15 * 0.5},.5,.5,1,.5` }, "\u256E": { 1: (e3, t3) => `M.5,1 L.5,${0.5 + t3 / 0.15 * 0.5} C.5,${0.5 + t3 / 0.15 * 0.5},.5,.5,0,.5` }, "\u256F": { 1: (e3, t3) => `M.5,0 L.5,${0.5 - t3 / 0.15 * 0.5} C.5,${0.5 - t3 / 0.15 * 0.5},.5,.5,0,.5` }, "\u2570": { 1: (e3, t3) => `M.5,0 L.5,${0.5 - t3 / 0.15 * 0.5} C.5,${0.5 - t3 / 0.15 * 0.5},.5,.5,1,.5` } }, t2.powerlineDefinitions = { "\uE0B0": { d: "M0,0 L1,.5 L0,1", type: 0, rightPadding: 2 }, "\uE0B1": { d: "M-1,-.5 L1,.5 L-1,1.5", type: 1, leftPadding: 1, rightPadding: 1 }, "\uE0B2": { d: "M1,0 L0,.5 L1,1", type: 0, leftPadding: 2 }, "\uE0B3": { d: "M2,-.5 L0,.5 L2,1.5", type: 1, leftPadding: 1, rightPadding: 1 }, "\uE0B4": { d: "M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0", type: 0, rightPadding: 1 }, "\uE0B5": { d: "M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0", type: 1, rightPadding: 1 }, "\uE0B6": { d: "M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0", type: 0, leftPadding: 1 }, "\uE0B7": { d: "M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0", type: 1, leftPadding: 1 }, "\uE0B8": { d: "M-.5,-.5 L1.5,1.5 L-.5,1.5", type: 0 }, "\uE0B9": { d: "M-.5,-.5 L1.5,1.5", type: 1, leftPadding: 1, rightPadding: 1 }, "\uE0BA": { d: "M1.5,-.5 L-.5,1.5 L1.5,1.5", type: 0 }, "\uE0BC": { d: "M1.5,-.5 L-.5,1.5 L-.5,-.5", type: 0 }, "\uE0BD": { d: "M1.5,-.5 L-.5,1.5", type: 1, leftPadding: 1, rightPadding: 1 }, "\uE0BE": { d: "M-.5,-.5 L1.5,1.5 L1.5,-.5", type: 0 } }, t2.powerlineDefinitions["\uE0BB"] = t2.powerlineDefinitions["\uE0BD"], t2.powerlineDefinitions["\uE0BF"] = t2.powerlineDefinitions["\uE0B9"], t2.tryDrawCustomChar = function(e3, i3, n2, l, c, d, _, u) { let g = t2.blockElementDefinitions[i3]; if (g) return (function(e4, t3, i4, s3, r2, o2) { for (let n3 = 0; n3 < t3.length; n3++) { let a2 = t3[n3], h3 = r2 / 8, l2 = o2 / 8; e4.fillRect(i4 + a2.x * h3, s3 + a2.y * l2, a2.w * h3, a2.h * l2); } })(e3, g, n2, l, c, d), !0; let v = r[i3]; if (v) return (function(e4, t3, i4, r2, n3, a2) { let h3 = o.get(t3); h3 || (h3 = /* @__PURE__ */ new Map(), o.set(t3, h3)); let l2 = e4.fillStyle; if (typeof l2 != "string") throw new Error(`Unexpected fillStyle type "${l2}"`); let c2 = h3.get(l2); if (!c2) { let i5 = t3[0].length, r3 = t3.length, o2 = e4.canvas.ownerDocument.createElement("canvas"); o2.width = i5, o2.height = r3; let n4 = (0, s2.throwIfFalsy)(o2.getContext("2d")), a3 = new ImageData(i5, r3), d2, _2, u2, g2; if (l2.startsWith("#")) d2 = parseInt(l2.slice(1, 3), 16), _2 = parseInt(l2.slice(3, 5), 16), u2 = parseInt(l2.slice(5, 7), 16), g2 = l2.length > 7 && parseInt(l2.slice(7, 9), 16) || 1; else { if (!l2.startsWith("rgba")) throw new Error(`Unexpected fillStyle color format "${l2}" when drawing pattern glyph`); [d2, _2, u2, g2] = l2.substring(5, l2.length - 1).split(",").map(((e5) => parseFloat(e5))); } for (let e5 = 0; e5 < r3; e5++) for (let s3 = 0; s3 < i5; s3++) a3.data[4 * (e5 * i5 + s3)] = d2, a3.data[4 * (e5 * i5 + s3) + 1] = _2, a3.data[4 * (e5 * i5 + s3) + 2] = u2, a3.data[4 * (e5 * i5 + s3) + 3] = t3[e5][s3] * (255 * g2); n4.putImageData(a3, 0, 0), c2 = (0, s2.throwIfFalsy)(e4.createPattern(o2, null)), h3.set(l2, c2); } e4.fillStyle = c2, e4.fillRect(i4, r2, n3, a2); })(e3, v, n2, l, c, d), !0; let f = t2.boxDrawingDefinitions[i3]; if (f) return (function(e4, t3, i4, s3, r2, o2, n3) { e4.strokeStyle = e4.fillStyle; for (let [l2, c2] of Object.entries(t3)) { let t4; e4.beginPath(), e4.lineWidth = n3 * Number.parseInt(l2), t4 = typeof c2 == "function" ? c2(0.15, 0.15 / o2 * r2) : c2; for (let l3 of t4.split(" ")) { let t5 = l3[0], c3 = a[t5]; if (!c3) { console.error(`Could not find drawing instructions for "${t5}"`); continue; } let d2 = l3.substring(1).split(","); d2[0] && d2[1] && c3(e4, h2(d2, r2, o2, i4, s3, !0, n3)); } e4.stroke(), e4.closePath(); } })(e3, f, n2, l, c, d, u), !0; let p = t2.powerlineDefinitions[i3]; return !!p && ((function(e4, t3, i4, s3, r2, o2, n3, l2) { let c2 = new Path2D(); c2.rect(i4, s3, r2, o2), e4.clip(c2), e4.beginPath(); let d2 = n3 / 12; e4.lineWidth = l2 * d2; for (let n4 of t3.d.split(" ")) { let c3 = n4[0], _2 = a[c3]; if (!_2) { console.error(`Could not find drawing instructions for "${c3}"`); continue; } let u2 = n4.substring(1).split(","); u2[0] && u2[1] && _2(e4, h2(u2, r2, o2, i4, s3, !1, l2, (t3.leftPadding ?? 0) * (d2 / 2), (t3.rightPadding ?? 0) * (d2 / 2))); } t3.type === 1 ? (e4.strokeStyle = e4.fillStyle, e4.stroke()) : e4.fill(), e4.closePath(); })(e3, p, n2, l, c, d, _, u), !0); }; let o = /* @__PURE__ */ new Map(); function n(e3, t3, i3 = 0) { return Math.max(Math.min(e3, t3), i3); } let a = { C: (e3, t3) => e3.bezierCurveTo(t3[0], t3[1], t3[2], t3[3], t3[4], t3[5]), L: (e3, t3) => e3.lineTo(t3[0], t3[1]), M: (e3, t3) => e3.moveTo(t3[0], t3[1]) }; function h2(e3, t3, i3, s3, r2, o2, a2, h3 = 0, l = 0) { let c = e3.map(((e4) => parseFloat(e4) || parseInt(e4))); if (c.length < 2) throw new Error("Too few arguments for instruction"); for (let e4 = 0; e4 < c.length; e4 += 2) c[e4] *= t3 - h3 * a2 - l * a2, o2 && c[e4] !== 0 && (c[e4] = n(Math.round(c[e4] + 0.5) - 0.5, t3, 0)), c[e4] += s3 + h3 * a2; for (let e4 = 1; e4 < c.length; e4 += 2) c[e4] *= i3, o2 && c[e4] !== 0 && (c[e4] = n(Math.round(c[e4] + 0.5) - 0.5, i3, 0)), c[e4] += r2; return c; } }, 56: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.observeDevicePixelDimensions = void 0; let s2 = i2(859); t2.observeDevicePixelDimensions = function(e3, t3, i3) { let r = new t3.ResizeObserver(((t4) => { let s3 = t4.find(((t5) => t5.target === e3)); if (!s3) return; if (!("devicePixelContentBoxSize" in s3)) return r?.disconnect(), void (r = void 0); let o = s3.devicePixelContentBoxSize[0].inlineSize, n = s3.devicePixelContentBoxSize[0].blockSize; o > 0 && n > 0 && i3(o, n); })); try { r.observe(e3, { box: ["device-pixel-content-box"] }); } catch { r.disconnect(), r = void 0; } return (0, s2.toDisposable)((() => r?.disconnect())); }; }, 374: (e2, t2) => { function i2(e3) { return 57508 <= e3 && e3 <= 57558; } function s2(e3) { return e3 >= 128512 && e3 <= 128591 || e3 >= 127744 && e3 <= 128511 || e3 >= 128640 && e3 <= 128767 || e3 >= 9728 && e3 <= 9983 || e3 >= 9984 && e3 <= 10175 || e3 >= 65024 && e3 <= 65039 || e3 >= 129280 && e3 <= 129535 || e3 >= 127462 && e3 <= 127487; } Object.defineProperty(t2, "__esModule", { value: !0 }), t2.computeNextVariantOffset = t2.createRenderDimensions = t2.treatGlyphAsBackgroundColor = t2.allowRescaling = t2.isEmoji = t2.isRestrictedPowerlineGlyph = t2.isPowerlineGlyph = t2.throwIfFalsy = void 0, t2.throwIfFalsy = function(e3) { if (!e3) throw new Error("value must not be falsy"); return e3; }, t2.isPowerlineGlyph = i2, t2.isRestrictedPowerlineGlyph = function(e3) { return 57520 <= e3 && e3 <= 57527; }, t2.isEmoji = s2, t2.allowRescaling = function(e3, t3, r, o) { return t3 === 1 && r > Math.ceil(1.5 * o) && e3 !== void 0 && e3 > 255 && !s2(e3) && !i2(e3) && !(function(e4) { return 57344 <= e4 && e4 <= 63743; })(e3); }, t2.treatGlyphAsBackgroundColor = function(e3) { return i2(e3) || (function(e4) { return 9472 <= e4 && e4 <= 9631; })(e3); }, t2.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 } } }; }, t2.computeNextVariantOffset = function(e3, t3, i3 = 0) { return (e3 - (2 * Math.round(t3) - i3)) % (2 * Math.round(t3)); }; }, 296: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.createSelectionRenderModel = void 0; class i2 { 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(e3, t3, i3, s2 = !1) { if (this.selectionStart = t3, this.selectionEnd = i3, !t3 || !i3 || t3[0] === i3[0] && t3[1] === i3[1]) return void this.clear(); let r = e3.buffers.active.ydisp, o = t3[1] - r, n = i3[1] - r, a = Math.max(o, 0), h2 = Math.min(n, e3.rows - 1); a >= e3.rows || h2 < 0 ? this.clear() : (this.hasSelection = !0, this.columnSelectMode = s2, this.viewportStartRow = o, this.viewportEndRow = n, this.viewportCappedStartRow = a, this.viewportCappedEndRow = h2, this.startCol = t3[0], this.endCol = i3[0]); } isCellSelected(e3, t3, i3) { return !!this.hasSelection && (i3 -= e3.buffer.active.viewportY, this.columnSelectMode ? this.startCol <= this.endCol ? t3 >= this.startCol && i3 >= this.viewportCappedStartRow && t3 < this.endCol && i3 <= this.viewportCappedEndRow : t3 < this.startCol && i3 >= this.viewportCappedStartRow && t3 >= this.endCol && i3 <= this.viewportCappedEndRow : i3 > this.viewportStartRow && i3 < this.viewportEndRow || this.viewportStartRow === this.viewportEndRow && i3 === this.viewportStartRow && t3 >= this.startCol && t3 < this.endCol || this.viewportStartRow < this.viewportEndRow && i3 === this.viewportEndRow && t3 < this.endCol || this.viewportStartRow < this.viewportEndRow && i3 === this.viewportStartRow && t3 >= this.startCol); } } t2.createSelectionRenderModel = function() { return new i2(); }; }, 509: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.TextureAtlas = void 0; let s2 = i2(237), r = i2(860), o = i2(374), n = i2(160), a = i2(345), h2 = i2(485), l = i2(385), c = i2(147), d = i2(855), _ = { texturePage: 0, texturePosition: { x: 0, y: 0 }, texturePositionClipSpace: { x: 0, y: 0 }, offset: { x: 0, y: 0 }, size: { x: 0, y: 0 }, sizeClipSpace: { x: 0, y: 0 } }, u; class g { get pages() { return this._pages; } constructor(e3, t3, i3) { this._document = e3, this._config = t3, this._unicodeService = i3, this._didWarmUp = !1, this._cacheMap = new h2.FourKeyMap(), this._cacheMapCombined = new h2.FourKeyMap(), this._pages = [], this._activePages = [], this._workBoundingBox = { top: 0, left: 0, bottom: 0, right: 0 }, this._workAttributeData = new c.AttributeData(), this._textureSize = 512, this._onAddTextureAtlasCanvas = new a.EventEmitter(), this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event, this._onRemoveTextureAtlasCanvas = new a.EventEmitter(), this.onRemoveTextureAtlasCanvas = this._onRemoveTextureAtlasCanvas.event, this._requestClearModel = !1, this._createNewPage(), this._tmpCanvas = p(e3, 4 * this._config.deviceCellWidth + 4, this._config.deviceCellHeight + 4), this._tmpCtx = (0, o.throwIfFalsy)(this._tmpCanvas.getContext("2d", { alpha: this._config.allowTransparency, willReadFrequently: !0 })); } dispose() { for (let e3 of this.pages) e3.canvas.remove(); this._onAddTextureAtlasCanvas.dispose(); } warmUp() { this._didWarmUp || (this._doWarmUp(), this._didWarmUp = !0); } _doWarmUp() { let e3 = new l.IdleTaskQueue(); for (let t3 = 33; t3 < 126; t3++) e3.enqueue((() => { if (!this._cacheMap.get(t3, d.DEFAULT_COLOR, d.DEFAULT_COLOR, d.DEFAULT_EXT)) { let e4 = this._drawToCache(t3, d.DEFAULT_COLOR, d.DEFAULT_COLOR, d.DEFAULT_EXT); this._cacheMap.set(t3, d.DEFAULT_COLOR, d.DEFAULT_COLOR, d.DEFAULT_EXT, e4); } })); } beginFrame() { return this._requestClearModel; } clearTexture() { if (this._pages[0].currentRow.x !== 0 || this._pages[0].currentRow.y !== 0) { for (let e3 of this._pages) e3.clear(); this._cacheMap.clear(), this._cacheMapCombined.clear(), this._didWarmUp = !1; } } _createNewPage() { if (g.maxAtlasPages && this._pages.length >= Math.max(4, g.maxAtlasPages)) { let e4 = this._pages.filter(((e5) => 2 * e5.canvas.width <= (g.maxTextureSize || 4096))).sort(((e5, t4) => t4.canvas.width !== e5.canvas.width ? t4.canvas.width - e5.canvas.width : t4.percentageUsed - e5.percentageUsed)), t3 = -1, i3 = 0; for (let s4 = 0; s4 < e4.length; s4++) if (e4[s4].canvas.width !== i3) t3 = s4, i3 = e4[s4].canvas.width; else if (s4 - t3 == 3) break; let s3 = e4.slice(t3, t3 + 4), r2 = s3.map(((e5) => e5.glyphs[0].texturePage)).sort(((e5, t4) => e5 > t4 ? 1 : -1)), o2 = this.pages.length - s3.length, n2 = this._mergePages(s3, o2); n2.version++; for (let e5 = r2.length - 1; e5 >= 0; e5--) this._deletePage(r2[e5]); this.pages.push(n2), this._requestClearModel = !0, this._onAddTextureAtlasCanvas.fire(n2.canvas); } let e3 = new v(this._document, this._textureSize); return this._pages.push(e3), this._activePages.push(e3), this._onAddTextureAtlasCanvas.fire(e3.canvas), e3; } _mergePages(e3, t3) { let i3 = 2 * e3[0].canvas.width, s3 = new v(this._document, i3, e3); for (let [r2, o2] of e3.entries()) { let e4 = r2 * o2.canvas.width % i3, n2 = Math.floor(r2 / 2) * o2.canvas.height; s3.ctx.drawImage(o2.canvas, e4, n2); for (let s4 of o2.glyphs) s4.texturePage = t3, s4.sizeClipSpace.x = s4.size.x / i3, s4.sizeClipSpace.y = s4.size.y / i3, s4.texturePosition.x += e4, s4.texturePosition.y += n2, s4.texturePositionClipSpace.x = s4.texturePosition.x / i3, s4.texturePositionClipSpace.y = s4.texturePosition.y / i3; this._onRemoveTextureAtlasCanvas.fire(o2.canvas); let a2 = this._activePages.indexOf(o2); a2 !== -1 && this._activePages.splice(a2, 1); } return s3; } _deletePage(e3) { this._pages.splice(e3, 1); for (let t3 = e3; t3 < this._pages.length; t3++) { let e4 = this._pages[t3]; for (let t4 of e4.glyphs) t4.texturePage--; e4.version++; } } getRasterizedGlyphCombinedChar(e3, t3, i3, s3, r2) { return this._getFromCacheMap(this._cacheMapCombined, e3, t3, i3, s3, r2); } getRasterizedGlyph(e3, t3, i3, s3, r2) { return this._getFromCacheMap(this._cacheMap, e3, t3, i3, s3, r2); } _getFromCacheMap(e3, t3, i3, s3, r2, o2 = !1) { return u = e3.get(t3, i3, s3, r2), u || (u = this._drawToCache(t3, i3, s3, r2, o2), e3.set(t3, i3, s3, r2, u)), u; } _getColorFromAnsiIndex(e3) { if (e3 >= this._config.colors.ansi.length) throw new Error("No color found for idx " + e3); return this._config.colors.ansi[e3]; } _getBackgroundColor(e3, t3, i3, s3) { if (this._config.allowTransparency) return n.NULL_COLOR; let r2; switch (e3) { case 16777216: case 33554432: r2 = this._getColorFromAnsiIndex(t3); break; case 50331648: let e4 = c.AttributeData.toColorRGB(t3); r2 = n.channels.toColor(e4[0], e4[1], e4[2]); break; default: r2 = i3 ? n.color.opaque(this._config.colors.foreground) : this._config.colors.background; } return r2; } _getForegroundColor(e3, t3, i3, r2, o2, a2, h3, l2, d2, _2) { let u2 = this._getMinimumContrastColor(e3, t3, i3, r2, o2, a2, h3, d2, l2, _2); if (u2) return u2; let g2; switch (o2) { case 16777216: case 33554432: this._config.drawBoldTextInBrightColors && d2 && a2 < 8 && (a2 += 8), g2 = this._getColorFromAnsiIndex(a2); break; case 50331648: let e4 = c.AttributeData.toColorRGB(a2); g2 = n.channels.toColor(e4[0], e4[1], e4[2]); break; default: g2 = h3 ? this._config.colors.background : this._config.colors.foreground; } return this._config.allowTransparency && (g2 = n.color.opaque(g2)), l2 && (g2 = n.color.multiplyOpacity(g2, s2.DIM_OPACITY)), g2; } _resolveBackgroundRgba(e3, t3, i3) { switch (e3) { case 16777216: case 33554432: return this._getColorFromAnsiIndex(t3).rgba; case 50331648: return t3 << 8; default: return i3 ? this._config.colors.foreground.rgba : this._config.colors.background.rgba; } } _resolveForegroundRgba(e3, t3, i3, s3) { switch (e3) { case 16777216: case 33554432: return this._config.drawBoldTextInBrightColors && s3 && t3 < 8 && (t3 += 8), this._getColorFromAnsiIndex(t3).rgba; case 50331648: return t3 << 8; default: return i3 ? this._config.colors.background.rgba : this._config.colors.foreground.rgba; } } _getMinimumContrastColor(e3, t3, i3, s3, r2, o2, a2, h3, l2, c2) { if (this._config.minimumContrastRatio === 1 || c2) return; let d2 = this._getContrastCache(l2), _2 = d2.getColor(e3, s3); if (_2 !== void 0) return _2 || void 0; let u2 = this._resolveBackgroundRgba(t3, i3, a2), g2 = this._resolveForegroundRgba(r2, o2, a2, h3), v2 = n.rgba.ensureContrastRatio(u2, g2, this._config.minimumContrastRatio / (l2 ? 2 : 1)); if (!v2) return void d2.setColor(e3, s3, null); let f2 = n.channels.toColor(v2 >> 24 & 255, v2 >> 16 & 255, v2 >> 8 & 255); return d2.setColor(e3, s3, f2), f2; } _getContrastCache(e3) { return e3 ? this._config.colors.halfContrastCache : this._config.colors.contrastCache; } _drawToCache(e3, t3, i3, n2, a2 = !1) { let h3 = typeof e3 == "number" ? String.fromCharCode(e3) : e3, l2 = Math.min(this._config.deviceCellWidth * Math.max(h3.length, 2) + 4, this._textureSize); this._tmpCanvas.width < l2 && (this._tmpCanvas.width = l2); let d2 = Math.min(this._config.deviceCellHeight + 8, this._textureSize); if (this._tmpCanvas.height < d2 && (this._tmpCanvas.height = d2), this._tmpCtx.save(), this._workAttributeData.fg = i3, this._workAttributeData.bg = t3, this._workAttributeData.extended.ext = n2, this._workAttributeData.isInvisible()) return _; let u2 = !!this._workAttributeData.isBold(), v2 = !!this._workAttributeData.isInverse(), p2 = !!this._workAttributeData.isDim(), C = !!this._workAttributeData.isItalic(), m = !!this._workAttributeData.isUnderline(), L = !!this._workAttributeData.isStrikethrough(), x = !!this._workAttributeData.isOverline(), w = this._workAttributeData.getFgColor(), b = this._workAttributeData.getFgColorMode(), M = this._workAttributeData.getBgColor(), R = this._workAttributeData.getBgColorMode(); if (v2) { let e4 = w; w = M, M = e4; let t4 = b; b = R, R = t4; } let y = this._getBackgroundColor(R, M, v2, p2); this._tmpCtx.globalCompositeOperation = "copy", this._tmpCtx.fillStyle = y.css, this._tmpCtx.fillRect(0, 0, this._tmpCanvas.width, this._tmpCanvas.height), this._tmpCtx.globalCompositeOperation = "source-over"; let A = u2 ? this._config.fontWeightBold : this._config.fontWeight, E = C ? "italic" : ""; this._tmpCtx.font = `${E} ${A} ${this._config.fontSize * this._config.devicePixelRatio}px ${this._config.fontFamily}`, this._tmpCtx.textBaseline = s2.TEXT_BASELINE; let S = h3.length === 1 && (0, o.isPowerlineGlyph)(h3.charCodeAt(0)), T = h3.length === 1 && (0, o.isRestrictedPowerlineGlyph)(h3.charCodeAt(0)), D = this._getForegroundColor(t3, R, M, i3, b, w, v2, p2, u2, (0, o.treatGlyphAsBackgroundColor)(h3.charCodeAt(0))); this._tmpCtx.fillStyle = D.css; let B = T ? 0 : 4, F = !1; this._config.customGlyphs !== !1 && (F = (0, r.tryDrawCustomChar)(this._tmpCtx, h3, B, B, this._config.deviceCellWidth, this._config.deviceCellHeight, this._config.fontSize, this._config.devicePixelRatio)); let P, I = !S; if (P = typeof e3 == "number" ? this._unicodeService.wcwidth(e3) : this._unicodeService.getStringCellWidth(e3), m) { this._tmpCtx.save(); let e4 = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 15)), t4 = e4 % 2 == 1 ? 0.5 : 0; if (this._tmpCtx.lineWidth = e4, this._workAttributeData.isUnderlineColorDefault()) this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle; else if (this._workAttributeData.isUnderlineColorRGB()) I = !1, this._tmpCtx.strokeStyle = `rgb(${c.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`; else { I = !1; let e5 = this._workAttributeData.getUnderlineColor(); this._config.drawBoldTextInBrightColors && this._workAttributeData.isBold() && e5 < 8 && (e5 += 8), this._tmpCtx.strokeStyle = this._getColorFromAnsiIndex(e5).css; } this._tmpCtx.beginPath(); let i4 = B, s3 = Math.ceil(B + this._config.deviceCharHeight) - t4 - (a2 ? 2 * e4 : 0), r2 = s3 + e4, n3 = s3 + 2 * e4, l3 = this._workAttributeData.getUnderlineVariantOffset(); for (let a3 = 0; a3 < P; a3++) { this._tmpCtx.save(); let h4 = i4 + a3 * this._config.deviceCellWidth, c2 = i4 + (a3 + 1) * this._config.deviceCellWidth, d3 = h4 + this._config.deviceCellWidth / 2; switch (this._workAttributeData.extended.underlineStyle) { case 2: this._tmpCtx.moveTo(h4, s3), this._tmpCtx.lineTo(c2, s3), this._tmpCtx.moveTo(h4, n3), this._tmpCtx.lineTo(c2, n3); break; case 3: let i5 = e4 <= 1 ? n3 : Math.ceil(B + this._config.deviceCharHeight - e4 / 2) - t4, a4 = e4 <= 1 ? s3 : Math.ceil(B + this._config.deviceCharHeight + e4 / 2) - t4, _2 = new Path2D(); _2.rect(h4, s3, this._config.deviceCellWidth, n3 - s3), this._tmpCtx.clip(_2), this._tmpCtx.moveTo(h4 - this._config.deviceCellWidth / 2, r2), this._tmpCtx.bezierCurveTo(h4 - this._config.deviceCellWidth / 2, a4, h4, a4, h4, r2), this._tmpCtx.bezierCurveTo(h4, i5, d3, i5, d3, r2), this._tmpCtx.bezierCurveTo(d3, a4, c2, a4, c2, r2), this._tmpCtx.bezierCurveTo(c2, i5, c2 + this._config.deviceCellWidth / 2, i5, c2 + this._config.deviceCellWidth / 2, r2); break; case 4: let u3 = l3 === 0 ? 0 : l3 >= e4 ? 2 * e4 - l3 : e4 - l3; l3 >= e4 || u3 === 0 ? (this._tmpCtx.setLineDash([Math.round(e4), Math.round(e4)]), this._tmpCtx.moveTo(h4 + u3, s3), this._tmpCtx.lineTo(c2, s3)) : (this._tmpCtx.setLineDash([Math.round(e4), Math.round(e4)]), this._tmpCtx.moveTo(h4, s3), this._tmpCtx.lineTo(h4 + u3, s3), this._tmpCtx.moveTo(h4 + u3 + e4, s3), this._tmpCtx.lineTo(c2, s3)), l3 = (0, o.computeNextVariantOffset)(c2 - h4, e4, l3); break; case 5: let g2 = 0.6, v3 = 0.3, f2 = c2 - h4, p3 = Math.floor(g2 * f2), C2 = Math.floor(v3 * f2), m2 = f2 - p3 - C2; this._tmpCtx.setLineDash([p3, C2, m2]), this._tmpCtx.moveTo(h4, s3), this._tmpCtx.lineTo(c2, s3); break; default: this._tmpCtx.moveTo(h4, s3), this._tmpCtx.lineTo(c2, s3); } this._tmpCtx.stroke(), this._tmpCtx.restore(); } if (this._tmpCtx.restore(), !F && this._config.fontSize >= 12 && !this._config.allowTransparency && h3 !== " ") { this._tmpCtx.save(), this._tmpCtx.textBaseline = "alphabetic"; let t5 = this._tmpCtx.measureText(h3); if (this._tmpCtx.restore(), "actualBoundingBoxDescent" in t5 && t5.actualBoundingBoxDescent > 0) { this._tmpCtx.save(); let t6 = new Path2D(); t6.rect(i4, s3 - Math.ceil(e4 / 2), this._config.deviceCellWidth * P, n3 - s3 + Math.ceil(e4 / 2)), this._tmpCtx.clip(t6), this._tmpCtx.lineWidth = 3 * this._config.devicePixelRatio, this._tmpCtx.strokeStyle = y.css, this._tmpCtx.strokeText(h3, B, B + this._config.deviceCharHeight), this._tmpCtx.restore(); } } } if (x) { let e4 = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 15)), t4 = e4 % 2 == 1 ? 0.5 : 0; this._tmpCtx.lineWidth = e4, this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle, this._tmpCtx.beginPath(), this._tmpCtx.moveTo(B, B + t4), this._tmpCtx.lineTo(B + this._config.deviceCharWidth * P, B + t4), this._tmpCtx.stroke(); } if (F || this._tmpCtx.fillText(h3, B, B + this._config.deviceCharHeight), h3 === "_" && !this._config.allowTransparency) { let e4 = f(this._tmpCtx.getImageData(B, B, this._config.deviceCellWidth, this._config.deviceCellHeight), y, D, I); if (e4) for (let t4 = 1; t4 <= 5 && (this._tmpCtx.save(), this._tmpCtx.fillStyle = y.css, this._tmpCtx.fillRect(0, 0, this._tmpCanvas.width, this._tmpCanvas.height), this._tmpCtx.restore(), this._tmpCtx.fillText(h3, B, B + this._config.deviceCharHeight - t4), e4 = f(this._tmpCtx.getImageData(B, B, this._config.deviceCellWidth, this._config.deviceCellHeight), y, D, I), e4); t4++) ; } if (L) { let e4 = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 10)), t4 = this._tmpCtx.lineWidth % 2 == 1 ? 0.5 : 0; this._tmpCtx.lineWidth = e4, this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle, this._tmpCtx.beginPath(), this._tmpCtx.moveTo(B, B + Math.floor(this._config.deviceCharHeight / 2) - t4), this._tmpCtx.lineTo(B + this._config.deviceCharWidth * P, B + Math.floor(this._config.deviceCharHeight / 2) - t4), this._tmpCtx.stroke(); } this._tmpCtx.restore(); let O = this._tmpCtx.getImageData(0, 0, this._tmpCanvas.width, this._tmpCanvas.height), k; if (k = this._config.allowTransparency ? (function(e4) { for (let t4 = 0; t4 < e4.data.length; t4 += 4) if (e4.data[t4 + 3] > 0) return !1; return !0; })(O) : f(O, y, D, I), k) return _; let $ = this._findGlyphBoundingBox(O, this._workBoundingBox, l2, T, F, B), U, N; for (; ; ) { if (this._activePages.length === 0) { let e4 = this._createNewPage(); U = e4, N = e4.currentRow, N.height = $.size.y; break; } U = this._activePages[this._activePages.length - 1], N = U.currentRow; for (let e4 of this._activePages) $.size.y <= e4.currentRow.height && (U = e4, N = e4.currentRow); for (let e4 = this._activePages.length - 1; e4 >= 0; e4--) for (let t4 of this._activePages[e4].fixedRows) t4.height <= N.height && $.size.y <= t4.height && (U = this._activePages[e4], N = t4); if (N.y + $.size.y >= U.canvas.height || N.height > $.size.y + 2) { let e4 = !1; if (U.currentRow.y + U.currentRow.height + $.size.y >= U.canvas.height) { let t4; for (let e5 of this._activePages) if (e5.currentRow.y + e5.currentRow.height + $.size.y < e5.canvas.height) { t4 = e5; break; } if (t4) U = t4; else if (g.maxAtlasPages && this._pages.length >= g.maxAtlasPages && N.y + $.size.y <= U.canvas.height && N.height >= $.size.y && N.x + $.size.x <= U.canvas.width) e4 = !0; else { let t5 = this._createNewPage(); U = t5, N = t5.currentRow, N.height = $.size.y, e4 = !0; } } e4 || (U.currentRow.height > 0 && U.fixedRows.push(U.currentRow), N = { x: 0, y: U.currentRow.y + U.currentRow.height, height: $.size.y }, U.fixedRows.push(N), U.currentRow = { x: 0, y: N.y + N.height, height: 0 }); } if (N.x + $.size.x <= U.canvas.width) break; N === U.currentRow ? (N.x = 0, N.y += N.height, N.height = 0) : U.fixedRows.splice(U.fixedRows.indexOf(N), 1); } return $.texturePage = this._pages.indexOf(U), $.texturePosition.x = N.x, $.texturePosition.y = N.y, $.texturePositionClipSpace.x = N.x / U.canvas.width, $.texturePositionClipSpace.y = N.y / U.canvas.height, $.sizeClipSpace.x /= U.canvas.width, $.sizeClipSpace.y /= U.canvas.height, N.height = Math.max(N.height, $.size.y), N.x += $.size.x, U.ctx.putImageData(O, $.texturePosition.x - this._workBoundingBox.left, $.texturePosition.y - this._workBoundingBox.top, this._workBoundingBox.left, this._workBoundingBox.top, $.size.x, $.size.y), U.addGlyph($), U.version++, $; } _findGlyphBoundingBox(e3, t3, i3, s3, r2, o2) { t3.top = 0; let n2 = s3 ? this._config.deviceCellHeight : this._tmpCanvas.height, a2 = s3 ? this._config.deviceCellWidth : i3, h3 = !1; for (let i4 = 0; i4 < n2; i4++) { for (let s4 = 0; s4 < a2; s4++) { let r3 = i4 * this._tmpCanvas.width * 4 + 4 * s4 + 3; if (e3.data[r3] !== 0) { t3.top = i4, h3 = !0; break; } } if (h3) break; } t3.left = 0, h3 = !1; for (let i4 = 0; i4 < o2 + a2; i4++) { for (let s4 = 0; s4 < n2; s4++) { let r3 = s4 * this._tmpCanvas.width * 4 + 4 * i4 + 3; if (e3.data[r3] !== 0) { t3.left = i4, h3 = !0; break; } } if (h3) break; } t3.right = a2, h3 = !1; for (let i4 = o2 + a2 - 1; i4 >= o2; i4--) { for (let s4 = 0; s4 < n2; s4++) { let r3 = s4 * this._tmpCanvas.width * 4 + 4 * i4 + 3; if (e3.data[r3] !== 0) { t3.right = i4, h3 = !0; break; } } if (h3) break; } t3.bottom = n2, h3 = !1; for (let i4 = n2 - 1; i4 >= 0; i4--) { for (let s4 = 0; s4 < a2; s4++) { let r3 = i4 * this._tmpCanvas.width * 4 + 4 * s4 + 3; if (e3.data[r3] !== 0) { t3.bottom = i4, h3 = !0; break; } } if (h3) break; } return { texturePage: 0, texturePosition: { x: 0, y: 0 }, texturePositionClipSpace: { x: 0, y: 0 }, size: { x: t3.right - t3.left + 1, y: t3.bottom - t3.top + 1 }, sizeClipSpace: { x: t3.right - t3.left + 1, y: t3.bottom - t3.top + 1 }, offset: { x: -t3.left + o2 + (s3 || r2 ? Math.floor((this._config.deviceCellWidth - this._config.deviceCharWidth) / 2) : 0), y: -t3.top + o2 + (s3 || r2 ? this._config.lineHeight === 1 ? 0 : Math.round((this._config.deviceCellHeight - this._config.deviceCharHeight) / 2) : 0) } }; } } t2.TextureAtlas = g; class v { get percentageUsed() { return this._usedPixels / (this.canvas.width * this.canvas.height); } get glyphs() { return this._glyphs; } addGlyph(e3) { this._glyphs.push(e3), this._usedPixels += e3.size.x * e3.size.y; } constructor(e3, t3, i3) { if (this._usedPixels = 0, this._glyphs = [], this.version = 0, this.currentRow = { x: 0, y: 0, height: 0 }, this.fixedRows = [], i3) for (let e4 of i3) this._glyphs.push(...e4.glyphs), this._usedPixels += e4._usedPixels; this.canvas = p(e3, t3, t3), this.ctx = (0, o.throwIfFalsy)(this.canvas.getContext("2d", { alpha: !0 })); } clear() { this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height), this.currentRow.x = 0, this.currentRow.y = 0, this.currentRow.height = 0, this.fixedRows.length = 0, this.version++; } } function f(e3, t3, i3, s3) { let r2 = t3.rgba >>> 24, o2 = t3.rgba >>> 16 & 255, n2 = t3.rgba >>> 8 & 255, a2 = i3.rgba >>> 24, h3 = i3.rgba >>> 16 & 255, l2 = i3.rgba >>> 8 & 255, c2 = Math.floor((Math.abs(r2 - a2) + Math.abs(o2 - h3) + Math.abs(n2 - l2)) / 12), d2 = !0; for (let t4 = 0; t4 < e3.data.length; t4 += 4) e3.data[t4] === r2 && e3.data[t4 + 1] === o2 && e3.data[t4 + 2] === n2 || s3 && Math.abs(e3.data[t4] - r2) + Math.abs(e3.data[t4 + 1] - o2) + Math.abs(e3.data[t4 + 2] - n2) < c2 ? e3.data[t4 + 3] = 0 : d2 = !1; return d2; } function p(e3, t3, i3) { let s3 = e3.createElement("canvas"); return s3.width = t3, s3.height = i3, s3; } }, 160: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.contrastRatio = t2.toPaddedHex = t2.rgba = t2.rgb = t2.css = t2.color = t2.channels = t2.NULL_COLOR = void 0; let i2 = 0, s2 = 0, r = 0, o = 0; var n, a, h2, l, c; function d(e3) { let t3 = e3.toString(16); return t3.length < 2 ? "0" + t3 : t3; } function _(e3, t3) { return e3 < t3 ? (t3 + 0.05) / (e3 + 0.05) : (e3 + 0.05) / (t3 + 0.05); } t2.NULL_COLOR = { css: "#00000000", rgba: 0 }, (function(e3) { e3.toCss = function(e4, t3, i3, s3) { return s3 !== void 0 ? `#${d(e4)}${d(t3)}${d(i3)}${d(s3)}` : `#${d(e4)}${d(t3)}${d(i3)}`; }, e3.toRgba = function(e4, t3, i3, s3 = 255) { return (e4 << 24 | t3 << 16 | i3 << 8 | s3) >>> 0; }, e3.toColor = function(t3, i3, s3, r2) { return { css: e3.toCss(t3, i3, s3, r2), rgba: e3.toRgba(t3, i3, s3, r2) }; }; })(n || (t2.channels = n = {})), (function(e3) { function t3(e4, t4) { return o = Math.round(255 * t4), [i2, s2, r] = c.toChannels(e4.rgba), { css: n.toCss(i2, s2, r, o), rgba: n.toRgba(i2, s2, r, o) }; } e3.blend = function(e4, t4) { if (o = (255 & t4.rgba) / 255, o === 1) return { css: t4.css, rgba: t4.rgba }; let a2 = t4.rgba >> 24 & 255, h3 = t4.rgba >> 16 & 255, l2 = t4.rgba >> 8 & 255, c2 = e4.rgba >> 24 & 255, d2 = e4.rgba >> 16 & 255, _2 = e4.rgba >> 8 & 255; return i2 = c2 + Math.round((a2 - c2) * o), s2 = d2 + Math.round((h3 - d2) * o), r = _2 + Math.round((l2 - _2) * o), { css: n.toCss(i2, s2, r), rgba: n.toRgba(i2, s2, r) }; }, e3.isOpaque = function(e4) { return (255 & e4.rgba) == 255; }, e3.ensureContrastRatio = function(e4, t4, i3) { let s3 = c.ensureContrastRatio(e4.rgba, t4.rgba, i3); if (s3) return n.toColor(s3 >> 24 & 255, s3 >> 16 & 255, s3 >> 8 & 255); }, e3.opaque = function(e4) { let t4 = (255 | e4.rgba) >>> 0; return [i2, s2, r] = c.toChannels(t4), { css: n.toCss(i2, s2, r), rgba: t4 }; }, e3.opacity = t3, e3.multiplyOpacity = function(e4, i3) { return o = 255 & e4.rgba, t3(e4, o * i3 / 255); }, e3.toColorRGB = function(e4) { return [e4.rgba >> 24 & 255, e4.rgba >> 16 & 255, e4.rgba >> 8 & 255]; }; })(a || (t2.color = a = {})), (function(e3) { let t3, a2; try { let e4 = document.createElement("canvas"); e4.width = 1, e4.height = 1; let i3 = e4.getContext("2d", { willReadFrequently: !0 }); i3 && (t3 = i3, t3.globalCompositeOperation = "copy", a2 = t3.createLinearGradient(0, 0, 1, 1)); } catch { } e3.toColor = function(e4) { if (e4.match(/#[\da-f]{3,8}/i)) switch (e4.length) { case 4: return i2 = parseInt(e4.slice(1, 2).repeat(2), 16), s2 = parseInt(e4.slice(2, 3).repeat(2), 16), r = parseInt(e4.slice(3, 4).repeat(2), 16), n.toColor(i2, s2, r); case 5: return i2 = parseInt(e4.slice(1, 2).repeat(2), 16), s2 = parseInt(e4.slice(2, 3).repeat(2), 16), r = parseInt(e4.slice(3, 4).repeat(2), 16), o = parseInt(e4.slice(4, 5).repeat(2), 16), n.toColor(i2, s2, r, o); case 7: return { css: e4, rgba: (parseInt(e4.slice(1), 16) << 8 | 255) >>> 0 }; case 9: return { css: e4, rgba: parseInt(e4.slice(1), 16) >>> 0 }; } let h3 = e4.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/); if (h3) return i2 = parseInt(h3[1]), s2 = parseInt(h3[2]), r = parseInt(h3[3]), o = Math.round(255 * (h3[5] === void 0 ? 1 : parseFloat(h3[5]))), n.toColor(i2, s2, r, o); if (!t3 || !a2) throw new Error("css.toColor: Unsupported css format"); if (t3.fillStyle = a2, t3.fillStyle = e4, typeof t3.fillStyle != "string") throw new Error("css.toColor: Unsupported css format"); if (t3.fillRect(0, 0, 1, 1), [i2, s2, r, o] = t3.getImageData(0, 0, 1, 1).data, o !== 255) throw new Error("css.toColor: Unsupported css format"); return { rgba: n.toRgba(i2, s2, r, o), css: e4 }; }; })(h2 || (t2.css = h2 = {})), (function(e3) { function t3(e4, t4, i3) { let s3 = e4 / 255, r2 = t4 / 255, o2 = i3 / 255; return 0.2126 * (s3 <= 0.03928 ? s3 / 12.92 : Math.pow((s3 + 0.055) / 1.055, 2.4)) + 0.7152 * (r2 <= 0.03928 ? r2 / 12.92 : Math.pow((r2 + 0.055) / 1.055, 2.4)) + 0.0722 * (o2 <= 0.03928 ? o2 / 12.92 : Math.pow((o2 + 0.055) / 1.055, 2.4)); } e3.relativeLuminance = function(e4) { return t3(e4 >> 16 & 255, e4 >> 8 & 255, 255 & e4); }, e3.relativeLuminance2 = t3; })(l || (t2.rgb = l = {})), (function(e3) { function t3(e4, t4, i3) { let s3 = e4 >> 24 & 255, r2 = e4 >> 16 & 255, o2 = e4 >> 8 & 255, n2 = t4 >> 24 & 255, a3 = t4 >> 16 & 255, h3 = t4 >> 8 & 255, c2 = _(l.relativeLuminance2(n2, a3, h3), l.relativeLuminance2(s3, r2, o2)); for (; c2 < i3 && (n2 > 0 || a3 > 0 || h3 > 0); ) n2 -= Math.max(0, Math.ceil(0.1 * n2)), a3 -= Math.max(0, Math.ceil(0.1 * a3)), h3 -= Math.max(0, Math.ceil(0.1 * h3)), c2 = _(l.relativeLuminance2(n2, a3, h3), l.relativeLuminance2(s3, r2, o2)); return (n2 << 24 | a3 << 16 | h3 << 8 | 255) >>> 0; } function a2(e4, t4, i3) { let s3 = e4 >> 24 & 255, r2 = e4 >> 16 & 255, o2 = e4 >> 8 & 255, n2 = t4 >> 24 & 255, a3 = t4 >> 16 & 255, h3 = t4 >> 8 & 255, c2 = _(l.relativeLuminance2(n2, a3, h3), l.relativeLuminance2(s3, r2, o2)); for (; c2 < i3 && (n2 < 255 || a3 < 255 || h3 < 255); ) n2 = Math.min(255, n2 + Math.ceil(0.1 * (255 - n2))), a3 = Math.min(255, a3 + Math.ceil(0.1 * (255 - a3))), h3 = Math.min(255, h3 + Math.ceil(0.1 * (255 - h3))), c2 = _(l.relativeLuminance2(n2, a3, h3), l.relativeLuminance2(s3, r2, o2)); return (n2 << 24 | a3 << 16 | h3 << 8 | 255) >>> 0; } e3.blend = function(e4, t4) { if (o = (255 & t4) / 255, o === 1) return t4; let a3 = t4 >> 24 & 255, h3 = t4 >> 16 & 255, l2 = t4 >> 8 & 255, c2 = e4 >> 24 & 255, d2 = e4 >> 16 & 255, _2 = e4 >> 8 & 255; return i2 = c2 + Math.round((a3 - c2) * o), s2 = d2 + Math.round((h3 - d2) * o), r = _2 + Math.round((l2 - _2) * o), n.toRgba(i2, s2, r); }, e3.ensureContrastRatio = function(e4, i3, s3) { let r2 = l.relativeLuminance(e4 >> 8), o2 = l.relativeLuminance(i3 >> 8); if (_(r2, o2) < s3) { if (o2 < r2) { let o3 = t3(e4, i3, s3), n3 = _(r2, l.relativeLuminance(o3 >> 8)); if (n3 < s3) { let t4 = a2(e4, i3, s3); return n3 > _(r2, l.relativeLuminance(t4 >> 8)) ? o3 : t4; } return o3; } let n2 = a2(e4, i3, s3), h3 = _(r2, l.relativeLuminance(n2 >> 8)); if (h3 < s3) { let o3 = t3(e4, i3, s3); return h3 > _(r2, l.relativeLuminance(o3 >> 8)) ? n2 : o3; } return n2; } }, e3.reduceLuminance = t3, e3.increaseLuminance = a2, e3.toChannels = function(e4) { return [e4 >> 24 & 255, e4 >> 16 & 255, e4 >> 8 & 255, 255 & e4]; }; })(c || (t2.rgba = c = {})), t2.toPaddedHex = d, t2.contrastRatio = _; }, 345: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.runAndSubscribe = t2.forwardEvent = t2.EventEmitter = void 0, t2.EventEmitter = class { constructor() { this._listeners = [], this._disposed = !1; } get event() { return this._event || (this._event = (e3) => (this._listeners.push(e3), { dispose: () => { if (!this._disposed) { for (let t3 = 0; t3 < this._listeners.length; t3++) if (this._listeners[t3] === e3) return void this._listeners.splice(t3, 1); } } })), this._event; } fire(e3, t3) { let i2 = []; for (let e4 = 0; e4 < this._listeners.length; e4++) i2.push(this._listeners[e4]); for (let s2 = 0; s2 < i2.length; s2++) i2[s2].call(void 0, e3, t3); } dispose() { this.clearListeners(), this._disposed = !0; } clearListeners() { this._listeners && (this._listeners.length = 0); } }, t2.forwardEvent = function(e3, t3) { return e3(((e4) => t3.fire(e4))); }, t2.runAndSubscribe = function(e3, t3) { return t3(void 0), e3(((e4) => t3(e4))); }; }, 859: (e2, t2) => { function i2(e3) { for (let t3 of e3) t3.dispose(); e3.length = 0; } Object.defineProperty(t2, "__esModule", { value: !0 }), t2.getDisposeArrayDisposable = t2.disposeArray = t2.toDisposable = t2.MutableDisposable = t2.Disposable = void 0, t2.Disposable = class { constructor() { this._disposables = [], this._isDisposed = !1; } dispose() { this._isDisposed = !0; for (let e3 of this._disposables) e3.dispose(); this._disposables.length = 0; } register(e3) { return this._disposables.push(e3), e3; } unregister(e3) { let t3 = this._disposables.indexOf(e3); t3 !== -1 && this._disposables.splice(t3, 1); } }, t2.MutableDisposable = class { constructor() { this._isDisposed = !1; } get value() { return this._isDisposed ? void 0 : this._value; } set value(e3) { this._isDisposed || e3 === this._value || (this._value?.dispose(), this._value = e3); } clear() { this.value = void 0; } dispose() { this._isDisposed = !0, this._value?.dispose(), this._value = void 0; } }, t2.toDisposable = function(e3) { return { dispose: e3 }; }, t2.disposeArray = i2, t2.getDisposeArrayDisposable = function(e3) { return { dispose: () => i2(e3) }; }; }, 485: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.FourKeyMap = t2.TwoKeyMap = void 0; class i2 { constructor() { this._data = {}; } set(e3, t3, i3) { this._data[e3] || (this._data[e3] = {}), this._data[e3][t3] = i3; } get(e3, t3) { return this._data[e3] ? this._data[e3][t3] : void 0; } clear() { this._data = {}; } } t2.TwoKeyMap = i2, t2.FourKeyMap = class { constructor() { this._data = new i2(); } set(e3, t3, s2, r, o) { this._data.get(e3, t3) || this._data.set(e3, t3, new i2()), this._data.get(e3, t3).set(s2, r, o); } get(e3, t3, i3, s2) { return this._data.get(e3, t3)?.get(i3, s2); } clear() { this._data.clear(); } }; }, 399: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.isChromeOS = t2.isLinux = t2.isWindows = t2.isIphone = t2.isIpad = t2.isMac = t2.getSafariVersion = t2.isSafari = t2.isLegacyEdge = t2.isFirefox = t2.isNode = void 0, t2.isNode = typeof process < "u" && "title" in process; let i2 = t2.isNode ? "node" : navigator.userAgent, s2 = t2.isNode ? "node" : navigator.platform; t2.isFirefox = i2.includes("Firefox"), t2.isLegacyEdge = i2.includes("Edge"), t2.isSafari = /^((?!chrome|android).)*safari/i.test(i2), t2.getSafariVersion = function() { if (!t2.isSafari) return 0; let e3 = i2.match(/Version\/(\d+)/); return e3 === null || e3.length < 2 ? 0 : parseInt(e3[1]); }, t2.isMac = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"].includes(s2), t2.isIpad = s2 === "iPad", t2.isIphone = s2 === "iPhone", t2.isWindows = ["Windows", "Win16", "Win32", "WinCE"].includes(s2), t2.isLinux = s2.indexOf("Linux") >= 0, t2.isChromeOS = /\bCrOS\b/.test(i2); }, 385: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.DebouncedIdleTask = t2.IdleTaskQueue = t2.PriorityTaskQueue = void 0; let s2 = i2(399); class r { constructor() { this._tasks = [], this._i = 0; } enqueue(e3) { this._tasks.push(e3), 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(e3) { this._idleCallback = void 0; let t3 = 0, i3 = 0, s3 = e3.timeRemaining(), r2 = 0; for (; this._i < this._tasks.length; ) { if (t3 = Date.now(), this._tasks[this._i]() || this._i++, t3 = Math.max(1, Date.now() - t3), i3 = Math.max(t3, i3), r2 = e3.timeRemaining(), 1.5 * i3 > r2) return s3 - t3 < -20 && console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s3 - t3))}ms`), void this._start(); s3 = r2; } this.clear(); } } class o extends r { _requestCallback(e3) { return setTimeout((() => e3(this._createDeadline(16)))); } _cancelCallback(e3) { clearTimeout(e3); } _createDeadline(e3) { let t3 = Date.now() + e3; return { timeRemaining: () => Math.max(0, t3 - Date.now()) }; } } t2.PriorityTaskQueue = o, t2.IdleTaskQueue = !s2.isNode && "requestIdleCallback" in window ? class extends r { _requestCallback(e3) { return requestIdleCallback(e3); } _cancelCallback(e3) { cancelIdleCallback(e3); } } : o, t2.DebouncedIdleTask = class { constructor() { this._queue = new t2.IdleTaskQueue(); } set(e3) { this._queue.clear(), this._queue.enqueue(e3); } flush() { this._queue.flush(); } }; }, 147: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.ExtendedAttrs = t2.AttributeData = void 0; class i2 { constructor() { this.fg = 0, this.bg = 0, this.extended = new s2(); } static toColorRGB(e3) { return [e3 >>> 16 & 255, e3 >>> 8 & 255, 255 & e3]; } static fromColorRGB(e3) { return (255 & e3[0]) << 16 | (255 & e3[1]) << 8 | 255 & e3[2]; } clone() { let e3 = new i2(); return e3.fg = this.fg, e3.bg = this.bg, e3.extended = this.extended.clone(), e3; } 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; } } t2.AttributeData = i2; class s2 { get ext() { return this._urlId ? -469762049 & this._ext | this.underlineStyle << 26 : this._ext; } set ext(e3) { this._ext = e3; } get underlineStyle() { return this._urlId ? 5 : (469762048 & this._ext) >> 26; } set underlineStyle(e3) { this._ext &= -469762049, this._ext |= e3 << 26 & 469762048; } get underlineColor() { return 67108863 & this._ext; } set underlineColor(e3) { this._ext &= -67108864, this._ext |= 67108863 & e3; } get urlId() { return this._urlId; } set urlId(e3) { this._urlId = e3; } get underlineVariantOffset() { let e3 = (3758096384 & this._ext) >> 29; return e3 < 0 ? 4294967288 ^ e3 : e3; } set underlineVariantOffset(e3) { this._ext &= 536870911, this._ext |= e3 << 29 & 3758096384; } constructor(e3 = 0, t3 = 0) { this._ext = 0, this._urlId = 0, this._ext = e3, this._urlId = t3; } clone() { return new s2(this._ext, this._urlId); } isEmpty() { return this.underlineStyle === 0 && this._urlId === 0; } } t2.ExtendedAttrs = s2; }, 782: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CellData = void 0; let s2 = i2(133), r = i2(855), o = i2(147); class n extends o.AttributeData { constructor() { super(...arguments), this.content = 0, this.fg = 0, this.bg = 0, this.extended = new o.ExtendedAttrs(), this.combinedData = ""; } static fromCharData(e3) { let t3 = new n(); return t3.setFromCharData(e3), t3; } isCombined() { return 2097152 & this.content; } getWidth() { return this.content >> 22; } getChars() { return 2097152 & this.content ? this.combinedData : 2097151 & this.content ? (0, s2.stringFromCodePoint)(2097151 & this.content) : ""; } getCode() { return this.isCombined() ? this.combinedData.charCodeAt(this.combinedData.length - 1) : 2097151 & this.content; } setFromCharData(e3) { this.fg = e3[r.CHAR_DATA_ATTR_INDEX], this.bg = 0; let t3 = !1; if (e3[r.CHAR_DATA_CHAR_INDEX].length > 2) t3 = !0; else if (e3[r.CHAR_DATA_CHAR_INDEX].length === 2) { let i3 = e3[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0); if (55296 <= i3 && i3 <= 56319) { let s3 = e3[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1); 56320 <= s3 && s3 <= 57343 ? this.content = 1024 * (i3 - 55296) + s3 - 56320 + 65536 | e3[r.CHAR_DATA_WIDTH_INDEX] << 22 : t3 = !0; } else t3 = !0; } else this.content = e3[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | e3[r.CHAR_DATA_WIDTH_INDEX] << 22; t3 && (this.combinedData = e3[r.CHAR_DATA_CHAR_INDEX], this.content = 2097152 | e3[r.CHAR_DATA_WIDTH_INDEX] << 22); } getAsCharData() { return [this.fg, this.getChars(), this.getWidth(), this.getCode()]; } } t2.CellData = n; }, 855: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.WHITESPACE_CELL_CODE = t2.WHITESPACE_CELL_WIDTH = t2.WHITESPACE_CELL_CHAR = t2.NULL_CELL_CODE = t2.NULL_CELL_WIDTH = t2.NULL_CELL_CHAR = t2.CHAR_DATA_CODE_INDEX = t2.CHAR_DATA_WIDTH_INDEX = t2.CHAR_DATA_CHAR_INDEX = t2.CHAR_DATA_ATTR_INDEX = t2.DEFAULT_EXT = t2.DEFAULT_ATTR = t2.DEFAULT_COLOR = void 0, t2.DEFAULT_COLOR = 0, t2.DEFAULT_ATTR = 256 | t2.DEFAULT_COLOR << 9, t2.DEFAULT_EXT = 0, t2.CHAR_DATA_ATTR_INDEX = 0, t2.CHAR_DATA_CHAR_INDEX = 1, t2.CHAR_DATA_WIDTH_INDEX = 2, t2.CHAR_DATA_CODE_INDEX = 3, t2.NULL_CELL_CHAR = "", t2.NULL_CELL_WIDTH = 1, t2.NULL_CELL_CODE = 0, t2.WHITESPACE_CELL_CHAR = " ", t2.WHITESPACE_CELL_WIDTH = 1, t2.WHITESPACE_CELL_CODE = 32; }, 133: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Utf8ToUtf32 = t2.StringToUtf32 = t2.utf32ToString = t2.stringFromCodePoint = void 0, t2.stringFromCodePoint = function(e3) { return e3 > 65535 ? (e3 -= 65536, String.fromCharCode(55296 + (e3 >> 10)) + String.fromCharCode(e3 % 1024 + 56320)) : String.fromCharCode(e3); }, t2.utf32ToString = function(e3, t3 = 0, i2 = e3.length) { let s2 = ""; for (let r = t3; r < i2; ++r) { let t4 = e3[r]; t4 > 65535 ? (t4 -= 65536, s2 += String.fromCharCode(55296 + (t4 >> 10)) + String.fromCharCode(t4 % 1024 + 56320)) : s2 += String.fromCharCode(t4); } return s2; }, t2.StringToUtf32 = class { constructor() { this._interim = 0; } clear() { this._interim = 0; } decode(e3, t3) { let i2 = e3.length; if (!i2) return 0; let s2 = 0, r = 0; if (this._interim) { let i3 = e3.charCodeAt(r++); 56320 <= i3 && i3 <= 57343 ? t3[s2++] = 1024 * (this._interim - 55296) + i3 - 56320 + 65536 : (t3[s2++] = this._interim, t3[s2++] = i3), this._interim = 0; } for (let o = r; o < i2; ++o) { let r2 = e3.charCodeAt(o); if (55296 <= r2 && r2 <= 56319) { if (++o >= i2) return this._interim = r2, s2; let n = e3.charCodeAt(o); 56320 <= n && n <= 57343 ? t3[s2++] = 1024 * (r2 - 55296) + n - 56320 + 65536 : (t3[s2++] = r2, t3[s2++] = n); } else r2 !== 65279 && (t3[s2++] = r2); } return s2; } }, t2.Utf8ToUtf32 = class { constructor() { this.interim = new Uint8Array(3); } clear() { this.interim.fill(0); } decode(e3, t3) { let i2 = e3.length; if (!i2) return 0; let s2, r, o, n, a = 0, h2 = 0, l = 0; if (this.interim[0]) { let s3 = !1, r2 = this.interim[0]; r2 &= (224 & r2) == 192 ? 31 : (240 & r2) == 224 ? 15 : 7; let o2, n2 = 0; for (; (o2 = 63 & this.interim[++n2]) && n2 < 4; ) r2 <<= 6, r2 |= o2; let h3 = (224 & this.interim[0]) == 192 ? 2 : (240 & this.interim[0]) == 224 ? 3 : 4, c2 = h3 - n2; for (; l < c2; ) { if (l >= i2) return 0; if (o2 = e3[l++], (192 & o2) != 128) { l--, s3 = !0; break; } this.interim[n2++] = o2, r2 <<= 6, r2 |= 63 & o2; } s3 || (h3 === 2 ? r2 < 128 ? l-- : t3[a++] = r2 : h3 === 3 ? r2 < 2048 || r2 >= 55296 && r2 <= 57343 || r2 === 65279 || (t3[a++] = r2) : r2 < 65536 || r2 > 1114111 || (t3[a++] = r2)), this.interim.fill(0); } let c = i2 - 4, d = l; for (; d < i2; ) { for (; !(!(d < c) || 128 & (s2 = e3[d]) || 128 & (r = e3[d + 1]) || 128 & (o = e3[d + 2]) || 128 & (n = e3[d + 3])); ) t3[a++] = s2, t3[a++] = r, t3[a++] = o, t3[a++] = n, d += 4; if (s2 = e3[d++], s2 < 128) t3[a++] = s2; else if ((224 & s2) == 192) { if (d >= i2) return this.interim[0] = s2, a; if (r = e3[d++], (192 & r) != 128) { d--; continue; } if (h2 = (31 & s2) << 6 | 63 & r, h2 < 128) { d--; continue; } t3[a++] = h2; } else if ((240 & s2) == 224) { if (d >= i2) return this.interim[0] = s2, a; if (r = e3[d++], (192 & r) != 128) { d--; continue; } if (d >= i2) return this.interim[0] = s2, this.interim[1] = r, a; if (o = e3[d++], (192 & o) != 128) { d--; continue; } if (h2 = (15 & s2) << 12 | (63 & r) << 6 | 63 & o, h2 < 2048 || h2 >= 55296 && h2 <= 57343 || h2 === 65279) continue; t3[a++] = h2; } else if ((248 & s2) == 240) { if (d >= i2) return this.interim[0] = s2, a; if (r = e3[d++], (192 & r) != 128) { d--; continue; } if (d >= i2) return this.interim[0] = s2, this.interim[1] = r, a; if (o = e3[d++], (192 & o) != 128) { d--; continue; } if (d >= i2) return this.interim[0] = s2, this.interim[1] = r, this.interim[2] = o, a; if (n = e3[d++], (192 & n) != 128) { d--; continue; } if (h2 = (7 & s2) << 18 | (63 & r) << 12 | (63 & o) << 6 | 63 & n, h2 < 65536 || h2 > 1114111) continue; t3[a++] = h2; } } return a; } }; }, 776: function(e2, t2, i2) { var s2 = this && this.__decorate || function(e3, t3, i3, s3) { var r2, o2 = arguments.length, n2 = o2 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n2 = Reflect.decorate(e3, t3, i3, s3); else for (var a2 = e3.length - 1; a2 >= 0; a2--) (r2 = e3[a2]) && (n2 = (o2 < 3 ? r2(n2) : o2 > 3 ? r2(t3, i3, n2) : r2(t3, i3)) || n2); return o2 > 3 && n2 && Object.defineProperty(t3, i3, n2), n2; }, r = this && this.__param || function(e3, t3) { return function(i3, s3) { t3(i3, s3, e3); }; }; Object.defineProperty(t2, "__esModule", { value: !0 }), t2.traceCall = t2.setTraceLogger = t2.LogService = void 0; let o = i2(859), n = i2(97), a = { trace: n.LogLevelEnum.TRACE, debug: n.LogLevelEnum.DEBUG, info: n.LogLevelEnum.INFO, warn: n.LogLevelEnum.WARN, error: n.LogLevelEnum.ERROR, off: n.LogLevelEnum.OFF }, h2, l = t2.LogService = class extends o.Disposable { get logLevel() { return this._logLevel; } constructor(e3) { super(), this._optionsService = e3, this._logLevel = n.LogLevelEnum.OFF, this._updateLogLevel(), this.register(this._optionsService.onSpecificOptionChange("logLevel", (() => this._updateLogLevel()))), h2 = this; } _updateLogLevel() { this._logLevel = a[this._optionsService.rawOptions.logLevel]; } _evalLazyOptionalParams(e3) { for (let t3 = 0; t3 < e3.length; t3++) typeof e3[t3] == "function" && (e3[t3] = e3[t3]()); } _log(e3, t3, i3) { this._evalLazyOptionalParams(i3), e3.call(console, (this._optionsService.options.logger ? "" : "xterm.js: ") + t3, ...i3); } trace(e3, ...t3) { this._logLevel <= n.LogLevelEnum.TRACE && this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger) ?? console.log, e3, t3); } debug(e3, ...t3) { this._logLevel <= n.LogLevelEnum.DEBUG && this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger) ?? console.log, e3, t3); } info(e3, ...t3) { this._logLevel <= n.LogLevelEnum.INFO && this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger) ?? console.info, e3, t3); } warn(e3, ...t3) { this._logLevel <= n.LogLevelEnum.WARN && this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger) ?? console.warn, e3, t3); } error(e3, ...t3) { this._logLevel <= n.LogLevelEnum.ERROR && this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger) ?? console.error, e3, t3); } }; t2.LogService = l = s2([r(0, n.IOptionsService)], l), t2.setTraceLogger = function(e3) { h2 = e3; }, t2.traceCall = function(e3, t3, i3) { if (typeof i3.value != "function") throw new Error("not supported"); let s3 = i3.value; i3.value = function(...e4) { if (h2.logLevel !== n.LogLevelEnum.TRACE) return s3.apply(this, e4); h2.trace(`GlyphRenderer#${s3.name}(${e4.map(((e5) => JSON.stringify(e5))).join(", ")})`); let t4 = s3.apply(this, e4); return h2.trace(`GlyphRenderer#${s3.name} return`, t4), t4; }; }; }, 726: (e2, t2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.createDecorator = t2.getServiceDependencies = t2.serviceRegistry = void 0; let i2 = "di$target", s2 = "di$dependencies"; t2.serviceRegistry = /* @__PURE__ */ new Map(), t2.getServiceDependencies = function(e3) { return e3[s2] || []; }, t2.createDecorator = function(e3) { if (t2.serviceRegistry.has(e3)) return t2.serviceRegistry.get(e3); let r = function(e4, t3, o) { if (arguments.length !== 3) throw new Error("@IServiceName-decorator can only be used to decorate a parameter"); (function(e5, t4, r2) { t4[i2] === t4 ? t4[s2].push({ id: e5, index: r2 }) : (t4[s2] = [{ id: e5, index: r2 }], t4[i2] = t4); })(r, e4, o); }; return r.toString = () => e3, t2.serviceRegistry.set(e3, r), r; }; }, 97: (e2, t2, i2) => { Object.defineProperty(t2, "__esModule", { value: !0 }), t2.IDecorationService = t2.IUnicodeService = t2.IOscLinkService = t2.IOptionsService = t2.ILogService = t2.LogLevelEnum = t2.IInstantiationService = t2.ICharsetService = t2.ICoreService = t2.ICoreMouseService = t2.IBufferService = void 0; let s2 = i2(726); var r; t2.IBufferService = (0, s2.createDecorator)("BufferService"), t2.ICoreMouseService = (0, s2.createDecorator)("CoreMouseService"), t2.ICoreService = (0, s2.createDecorator)("CoreService"), t2.ICharsetService = (0, s2.createDecorator)("CharsetService"), t2.IInstantiationService = (0, s2.createDecorator)("InstantiationService"), (function(e3) { e3[e3.TRACE = 0] = "TRACE", e3[e3.DEBUG = 1] = "DEBUG", e3[e3.INFO = 2] = "INFO", e3[e3.WARN = 3] = "WARN", e3[e3.ERROR = 4] = "ERROR", e3[e3.OFF = 5] = "OFF"; })(r || (t2.LogLevelEnum = r = {})), t2.ILogService = (0, s2.createDecorator)("LogService"), t2.IOptionsService = (0, s2.createDecorator)("OptionsService"), t2.IOscLinkService = (0, s2.createDecorator)("OscLinkService"), t2.IUnicodeService = (0, s2.createDecorator)("UnicodeService"), t2.IDecorationService = (0, s2.createDecorator)("DecorationService"); } }, t = {}; function i(s2) { var r = t[s2]; if (r !== void 0) return r.exports; var o = t[s2] = { exports: {} }; return e[s2].call(o.exports, o, o.exports, i), o.exports; } var s = {}; return (() => { var e2 = s; Object.defineProperty(e2, "__esModule", { value: !0 }), e2.WebglAddon = void 0; let t2 = i(345), r = i(859), o = i(399), n = i(666), a = i(776); class h2 extends r.Disposable { constructor(e3) { if (o.isSafari && (0, o.getSafariVersion)() < 16) { let e4 = { antialias: !1, depth: !1, preserveDrawingBuffer: !0 }; if (!document.createElement("canvas").getContext("webgl2", e4)) throw new Error("Webgl2 is only supported on Safari 16 and above"); } super(), this._preserveDrawingBuffer = e3, this._onChangeTextureAtlas = this.register(new t2.EventEmitter()), this.onChangeTextureAtlas = this._onChangeTextureAtlas.event, this._onAddTextureAtlasCanvas = this.register(new t2.EventEmitter()), this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event, this._onRemoveTextureAtlasCanvas = this.register(new t2.EventEmitter()), this.onRemoveTextureAtlasCanvas = this._onRemoveTextureAtlasCanvas.event, this._onContextLoss = this.register(new t2.EventEmitter()), this.onContextLoss = this._onContextLoss.event; } activate(e3) { let i2 = e3._core; if (!e3.element) return void this.register(i2.onWillOpen((() => this.activate(e3)))); this._terminal = e3; let s2 = i2.coreService, o2 = i2.optionsService, h3 = i2, l = h3._renderService, c = h3._characterJoinerService, d = h3._charSizeService, _ = h3._coreBrowserService, u = h3._decorationService, g = h3._logService, v = h3._themeService; (0, a.setTraceLogger)(g), this._renderer = this.register(new n.WebglRenderer(e3, c, d, _, s2, u, o2, v, this._preserveDrawingBuffer)), this.register((0, t2.forwardEvent)(this._renderer.onContextLoss, this._onContextLoss)), this.register((0, t2.forwardEvent)(this._renderer.onChangeTextureAtlas, this._onChangeTextureAtlas)), this.register((0, t2.forwardEvent)(this._renderer.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas)), this.register((0, t2.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas, this._onRemoveTextureAtlasCanvas)), l.setRenderer(this._renderer), this.register((0, r.toDisposable)((() => { let t3 = this._terminal._core._renderService; t3.setRenderer(this._terminal._core._createRenderer()), t3.handleResize(e3.cols, e3.rows); }))); } get textureAtlas() { return this._renderer?.textureAtlas; } clearTextureAtlas() { this._renderer?.clearTextureAtlas(); } } e2.WebglAddon = h2; })(), s; })())); } }); // src/platform/dsh/client/main.ts var main_exports = {}; __export(main_exports, { apply: () => apply, definition: () => definition, inject: () => inject, sessionDefinition: () => sessionDefinition }); module.exports = __toCommonJS(main_exports); // src/sftp/FileSize.ts var UNITS = ["B", "KB", "MB", "GB", "TB"]; function formatFileSize(bytes) { if (!Number.isFinite(bytes) || bytes < 0) return "0 B"; let value = bytes, unitIndex = 0; for (; value >= 1024 && unitIndex < UNITS.length - 1; ) value /= 1024, unitIndex += 1; return `${Number.isInteger(value) ? value.toString() : value.toFixed(1).replace(/\.0$/, "")} ${UNITS[unitIndex]}`; } // src/sftp/RemotePath.ts function joinRemotePath(parent, child) { return `${parent === "/" ? "" : parent.replace(/\/+$/, "")}/${child.replace(/^\/+/, "")}` || "/"; } function dirname(path) { let normalized = path.replace(/\/+$/, ""), index = normalized.lastIndexOf("/"); return index <= 0 ? "/" : normalized.slice(0, index); } // src/platform/dsh/client/models.ts function rpcError(code, message) { let error = new Error( typeof message == "string" && message !== "" ? message : "channel rpc failed" ); return error.code = typeof code == "string" && code !== "" ? code : "rpc-error", error; } function asFailure(error) { let candidate = error; return { code: typeof candidate?.code == "string" ? candidate.code : "client-error", message: String(candidate?.message ?? error) }; } function count(value) { return Number.isFinite(Number(value)) ? Number(value) : 0; } function text(value) { return value == null ? "" : String(value); } function errorKey(code) { return code === "bad-params" ? "error.badParams" : code === "wrong-password" ? "error.wrongPassword" : code === "unreadable-package" ? "error.unreadablePackage" : code === "host-key-unknown" ? "error.hostKeyUnknown" : code === "host-key-changed" ? "error.hostKeyChanged" : code === "authentication-failed" ? "error.authenticationFailed" : code === "password-missing" ? "error.passwordMissing" : code === "private-key-path-missing" ? "error.privateKeyPathMissing" : code === "private-key-unreadable" ? "error.privateKeyUnreadable" : code === "connection-refused" ? "error.connectionRefused" : code === "connection-timeout" ? "error.connectionTimeout" : code === "host-unresolved" ? "error.hostUnresolved" : code === "host-unreachable" ? "error.hostUnreachable" : code === "no-active-terminal" ? "error.noActiveTerminal" : code === "sftp-disconnected" ? "error.sftpDisconnected" : code === "sftp-no-such-file" ? "error.sftpNoSuchFile" : code === "sftp-permission-denied" ? "error.sftpPermissionDenied" : code === "sftp-read-failed" ? "error.sftpReadFailed" : code === "sftp-file-too-large" ? "error.sftpFileTooLarge" : code === "sftp-binary-file" ? "error.sftpBinaryFile" : code === "sftp-not-a-file" ? "error.sftpNotAFile" : code === "sftp-conflict" ? "error.sftpConflict" : code === "sftp-write-failed" ? "error.sftpWriteFailed" : code === "sftp-bad-params" ? "error.sftpBadParams" : code === "no-file-reader" ? "error.noFileReader" : "error.generic"; } function sftpDirFailureKey(code) { return code === "sftp-no-such-file" ? "sftp.dirFailedNoSuchFile" : code === "sftp-permission-denied" ? "sftp.dirFailedPermissionDenied" : code === "sftp-read-failed" ? "sftp.dirFailedReadFailed" : "sftp.dirFailed"; } function authLabel(t, authType) { return authType === "password" ? t("auth.password") : authType === "privateKey" ? t("auth.privateKey") : authType === "agent" ? t("auth.agent") : text(authType); } function serverViews(result) { let list = result ?? {}; return Array.isArray(list.servers) ? list.servers.filter( (server) => server !== null && typeof server == "object" ) : []; } function groupServers(servers) { let named = /* @__PURE__ */ new Map(), ungrouped = []; for (let server of servers) { let name = typeof server.group == "string" && server.group !== "" ? server.group : null; if (name === null) { ungrouped.push(server); continue; } let bucket = named.get(name); bucket === void 0 ? named.set(name, [server]) : bucket.push(server); } let groups = []; for (let [name, items] of named) groups.push({ name, servers: items }); return ungrouped.length > 0 && groups.push({ name: null, servers: ungrouped }), groups; } function emptyForm() { return { id: "", label: "", group: "", host: "", port: "22", username: "", authType: "password", password: "", privateKeyPath: "", jumpHostId: "", encoding: "utf-8", keepAliveInterval: "30", agentCommandTrust: "none", backgroundConnectionAllowed: !1 }; } function trustLevel(value) { return value === "policy" || value === "full" ? value : "none"; } function formFromServer(server) { return { id: text(server.id), label: text(server.label), group: text(server.group), host: text(server.host), port: String(count(server.port) || 22), username: text(server.username), authType: text(server.authType) || "password", password: "", privateKeyPath: text(server.privateKeyPath), jumpHostId: text(server.jumpHostId), encoding: text(server.encoding) || "utf-8", keepAliveInterval: String( Number.isFinite(Number(server.keepAliveInterval)) ? Number(server.keepAliveInterval) : 30 ), agentCommandTrust: trustLevel(server.agentCommandTrust), backgroundConnectionAllowed: server.backgroundConnectionAllowed === !0 }; } function validateForm(t, form, isNew) { return form.label.trim() === "" ? { field: "label", message: t("validate.label") } : form.host.trim() === "" ? { field: "host", message: t("validate.host") } : form.username.trim() === "" ? { field: "username", message: t("validate.username") } : !/^\d+$/.test(form.port.trim()) || Number(form.port) < 1 || Number(form.port) > 65535 ? { field: "port", message: t("validate.port") } : /^\d+$/.test(form.keepAliveInterval.trim()) ? form.authType === "password" && isNew && form.password === "" ? { field: "password", message: t("validate.password") } : form.authType === "privateKey" && form.privateKeyPath.trim() === "" ? { field: "privateKeyPath", message: t("validate.privateKeyPath") } : null : { field: "keepAliveInterval", message: t("validate.keepAlive") }; } function buildServerInput(form, isNew) { let input = { label: form.label.trim(), host: form.host.trim(), username: form.username.trim(), port: Number(form.port), authType: form.authType, encoding: form.encoding, keepAliveInterval: Number(form.keepAliveInterval), agentCommandTrust: form.agentCommandTrust }; return isNew || (input.id = form.id), form.group.trim() !== "" && (input.group = form.group.trim()), form.authType === "privateKey" && form.privateKeyPath.trim() !== "" && (input.privateKeyPath = form.privateKeyPath.trim()), form.jumpHostId !== "" && (input.jumpHostId = form.jumpHostId), form.agentCommandTrust !== "none" && (input.backgroundConnectionAllowed = form.backgroundConnectionAllowed), form.authType === "password" && form.password !== "" && (input.password = form.password), input; } function summarizeForm(t, form, servers) { let username = form.username.trim(), host = form.host.trim(), port = form.port.trim() === "" ? "22" : form.port.trim(), jump = servers.find((server) => server.id === form.jumpHostId); return { target: username !== "" && host !== "" ? `${username}@${host}:${port}` : t("form.summaryEnterHostUser"), auth: t("form.summaryAuth", { auth: authLabel(t, form.authType) }), group: t("form.summaryGroup", { group: form.group.trim() === "" ? t("form.defaultGroup") : form.group.trim() }), route: jump === void 0 ? t("form.summaryRouteDirect") : t("form.summaryRouteVia", { host: `${jump.label} (${jump.host})` }), agent: form.agentCommandTrust === "full" ? t("form.summaryAgentFull") : form.agentCommandTrust === "policy" ? t("form.summaryAgentPolicy") : t("form.summaryAgentManual") }; } function trustHelpKey(trust) { return trust === "full" ? "form.trustHelpFull" : trust === "policy" ? "form.trustHelpPolicy" : "form.trustHelpNone"; } function decodeBase64Frame(data) { if (typeof atob != "function") throw rpcError("no-base64", "this page cannot decode base64 terminal output"); let binary = atob(String(data ?? "")), bytes = new Uint8Array(binary.length); for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index); return bytes; } function terminalSocketUrl(location2) { let host = location2 && typeof location2.host == "string" ? location2.host : ""; if (host === "") throw rpcError("no-origin", "the page has no host, so the terminal address is unknown"); return `${location2?.protocol === "https:" ? "wss:" : "ws:"}//${host}/dsh-at-terminal/ws`; } function resolveSocketUrl(location2, endpoints) { let protocol = location2?.protocol; if (protocol === "http:" || protocol === "https:") return terminalSocketUrl(location2); let wsUrl = typeof endpoints?.wsUrl == "string" ? endpoints.wsUrl.trim() : ""; if (wsUrl === "") throw rpcError( "no-ws-endpoint", "the page has no web origin and the Host reported no websocket endpoint" ); return wsUrl; } function saveDownload(filename, envelope) { let payload = typeof envelope == "string" ? envelope : JSON.stringify(envelope, null, 2), blob = new Blob([payload], { type: "application/json" }), url = URL.createObjectURL(blob); try { let anchor = document.createElement("a"); anchor.href = url, anchor.download = filename, document.body.appendChild(anchor), anchor.click(), anchor.remove(); } finally { URL.revokeObjectURL(url); } } function sftpListing(result) { let source = result ?? {}, entries = Array.isArray(source.entries) ? source.entries.filter( (entry) => entry !== null && typeof entry == "object" && typeof entry.name == "string" && typeof entry.path == "string" ) : []; return { kind: source.kind === "active" || source.kind === "disconnected" ? source.kind : "none", rootPath: text(source.rootPath), path: text(source.path), entries, serverId: text(source.serverId), serverLabel: text(source.serverLabel) }; } function sftpExpandable(entry) { return entry.type === "directory" || entry.type === "symlink" && entry.targetType === "directory"; } function sftpEntrySize(entry) { return entry.type === "file" && typeof entry.size == "number" ? formatFileSize(entry.size) : ""; } function flattenSftpTree(input) { let root = input.rootPath; if (root === "") return []; let rows = [], expanded = new Set(input.expanded); !input.disconnected && root !== "/" && rows.push({ kind: "parent", key: "parent", depth: 0, expandable: !1, expanded: !1 }); let walk = (entries, depth) => { for (let entry of entries) { let expandable = !input.disconnected && sftpExpandable(entry), isExpanded = expandable && expanded.has(entry.path); if (rows.push({ kind: "entry", key: entry.path, depth, entry, expandable, expanded: isExpanded }), !isExpanded) continue; let child = input.children[entry.path]; if (child === void 0 || child.kind === "pending") { rows.push({ kind: "pending", key: `${entry.path}#pending`, depth: depth + 1, expandable: !1, expanded: !1 }); continue; } if (child.kind === "failed") { rows.push({ kind: "failed", key: `${entry.path}#failed`, depth: depth + 1, code: child.code, message: child.message, expandable: !1, expanded: !1 }); continue; } walk(child.entries, depth + 1); } }; return walk(input.entries, 0), rows; } function sftpFileText(result) { let source = result ?? {}; return { path: text(source.path), text: typeof source.text == "string" ? source.text : "", eol: source.eol === "crlf" ? "crlf" : "lf", size: count(source.size), modifiedAt: count(source.modifiedAt), truncated: source.truncated === !0 }; } function sftpWriteResult(result) { let source = result ?? {}; return { size: count(source.size), modifiedAt: count(source.modifiedAt) }; } function uploadTargetPath(directory, localName) { return joinRemotePath(directory, localName); } function sftpFileSize(entry) { return formatFileSize(entry.size); } function saveBytes(filename, base64, type = "application/octet-stream") { let blob; if (typeof Uint8Array.fromBase64 == "function") blob = new Blob([Uint8Array.fromBase64(base64)], { type }); else if (typeof Buffer < "u" && typeof Buffer.from == "function") blob = new Blob([Buffer.from(base64, "base64")], { type }); else if (typeof atob == "function") { let byteCharacters = atob(base64), byteNumbers = new Uint8Array(byteCharacters.length); for (let i = 0; i < byteCharacters.length; i += 65536) { let end = Math.min(i + 65536, byteCharacters.length); for (let j = i; j < end; j += 1) byteNumbers[j] = byteCharacters.charCodeAt(j); } blob = new Blob([byteNumbers], { type }); } else { let bytes = decodeBase64Frame(base64); blob = new Blob([bytes], { type }); } let url = URL.createObjectURL(blob); try { let anchor = document.createElement("a"); anchor.href = url, anchor.download = filename, document.body.appendChild(anchor), anchor.click(), anchor.remove(); } finally { setTimeout(() => { try { URL.revokeObjectURL(url); } catch { } }, 1e3); } } function readFileAsBase64(file) { return new Promise((resolve, reject) => { if (typeof FileReader != "function") { reject(rpcError("no-file-reader", "this page cannot read a local file")); return; } let reader = new FileReader(); reader.onerror = () => reject(rpcError("no-file-reader", `could not read ${nameOfBlob(file)}`)), reader.onload = () => { let result = reader.result; if (typeof result != "string") { reject(rpcError("no-file-reader", `could not read ${nameOfBlob(file)}`)); return; } let comma = result.indexOf(","); resolve(comma === -1 ? "" : result.slice(comma + 1)); }, reader.readAsDataURL(file); }); } function nameOfBlob(blob) { return typeof blob.name == "string" ? blob.name : "the chosen file"; } function splitPathForDisplay(path) { let cut = path.lastIndexOf("/"); return cut === -1 ? { base: "", leaf: path } : { base: path.slice(0, cut + 1), leaf: path.slice(cut + 1) }; } function sftpRowFocusable(row) { return row.kind === "entry" || row.kind === "parent"; } function sftpRowA11y(row, focused) { let props = { role: "treeitem", "aria-level": row.depth + 1, // The row's own identity, because the keyboard handler finds the next row through // the DOM. It lives beside the ARIA so the attribute the handler queries and the // attribute the render writes cannot drift apart. "data-at-terminal-sftp-row": row.key }; return sftpRowFocusable(row) && (props.tabIndex = focused ? 0 : -1, focused && (props["data-at-terminal-sftp-focus"] = "true")), row.expandable && (props["aria-expanded"] = row.expanded), props; } function sftpTreeFocusKey(rows, wanted) { if (wanted !== null && rows.some((row) => row.key === wanted && sftpRowFocusable(row))) return wanted; for (let row of rows) if (sftpRowFocusable(row)) return row.key; return null; } function sftpTreeKeyAction(rows, focusedKey, key) { let index = rows.findIndex((row2) => row2.key === focusedKey); if (index < 0) return { kind: "none" }; let row = rows[index]; if (key === "Enter" || key === " ") return row.kind === "parent" ? { kind: "go-up" } : row.entry !== void 0 && !sftpExpandable(row.entry) ? { kind: "open", path: row.entry.path } : !row.expandable || row.entry === void 0 ? { kind: "none" } : { kind: "toggle", path: row.entry.path }; if (key === "ArrowDown" || key === "ArrowUp") { let step = key === "ArrowDown" ? 1 : -1; for (let next = index + step; next >= 0 && next < rows.length; next += step) if (sftpRowFocusable(rows[next])) return { kind: "focus", key: rows[next].key }; return { kind: "none" }; } if (key === "ArrowRight") { if (row.kind !== "entry" || !row.expandable || row.entry === void 0) return { kind: "none" }; if (!row.expanded) return { kind: "toggle", path: row.entry.path }; let child = rows[index + 1]; return child === void 0 || child.depth <= row.depth || !sftpRowFocusable(child) ? { kind: "none" } : { kind: "focus", key: child.key }; } if (key === "ArrowLeft") { if (row.kind === "entry" && row.expandable && row.expanded && row.entry !== void 0) return { kind: "toggle", path: row.entry.path }; for (let prev = index - 1; prev >= 0; prev -= 1) if (rows[prev].depth < row.depth) return { kind: "focus", key: rows[prev].key }; return { kind: "none" }; } return { kind: "none" }; } // src/platform/dsh/client/channel.ts var CHANNEL_PREFIX = "/dsh-at-terminal", KIND = "at-terminal", KIND_SESSION = "at-terminal-session", ID = "@at-series/dsh-at-terminal", ID_SESSION = "@at-series/dsh-at-terminal/session", requestSeq = 0; async function callRpc(method, params, options) { requestSeq += 1; let payload = JSON.stringify({ id: requestSeq, method, params }); if (typeof XMLHttpRequest < "u" && (options?.onUploadProgress || options?.onDownloadProgress)) return new Promise((resolve, reject) => { let xhr = new XMLHttpRequest(); xhr.open("POST", `${CHANNEL_PREFIX}/rpc`), xhr.setRequestHeader("content-type", "application/json"), xhr.setRequestHeader("accept", "application/json"), xhr.upload.onprogress = (event) => { if (event.lengthComputable && options?.onUploadProgress) { let percent = event.total > 0 ? Math.min(100, Math.round(event.loaded / event.total * 100)) : 0; options.onUploadProgress({ loaded: event.loaded, total: event.total, percent }); } }, options?.onDownloadProgress && (xhr.onprogress = (event) => { if (event.lengthComputable && options.onDownloadProgress) { let percent = event.total > 0 ? Math.min(100, Math.round(event.loaded / event.total * 100)) : 0; options.onDownloadProgress({ loaded: event.loaded, total: event.total, percent }); } }), xhr.onload = () => { if (xhr.status < 200 || xhr.status >= 300) { reject(rpcError(`http-${xhr.status}`, `HTTP ${xhr.status}`)); return; } let body2 = null; try { body2 = JSON.parse(xhr.responseText); } catch { reject(rpcError("bad-json", "Invalid JSON response")); return; } if (body2 === null || body2.ok !== !0) { let detail = body2?.error ?? {}; reject( rpcError( typeof detail.code == "string" ? detail.code : void 0, typeof detail.message == "string" ? detail.message : void 0 ) ); return; } resolve(body2.result); }, xhr.onerror = () => reject(rpcError("network-error", "Network error during RPC")), xhr.onabort = () => reject(rpcError("aborted", "RPC aborted")), xhr.send(payload); }); let response = await fetch(`${CHANNEL_PREFIX}/rpc`, { method: "POST", headers: { "content-type": "application/json", accept: "application/json" }, body: payload }); if (!response.ok) throw rpcError(`http-${response.status}`, `HTTP ${response.status}`); let body = null; if (options?.onDownloadProgress && response.body && typeof response.body.getReader == "function" && typeof TextDecoder < "u") { let contentLength = Number(response.headers?.get?.("content-length") || 0), reader = response.body.getReader(), decoder = new TextDecoder("utf8"), loaded = 0, accumulated = ""; for (; ; ) { let { done, value } = await reader.read(); if (done) break; if (value) { loaded += value.length, accumulated += decoder.decode(value, { stream: !0 }); let percent = contentLength > 0 ? Math.min(100, Math.round(loaded / contentLength * 100)) : 0; options.onDownloadProgress({ loaded, total: contentLength, percent }); } } accumulated += decoder.decode(); try { body = JSON.parse(accumulated); } catch { throw rpcError("bad-json", "Invalid JSON response"); } } else body = await response.json(); if (body === null || body.ok !== !0) { let detail = body?.error ?? {}; throw rpcError( typeof detail.code == "string" ? detail.code : void 0, typeof detail.message == "string" ? detail.message : void 0 ); } return body.result; } function postDiagnostic(level, message, source, line, stack) { try { fetch(`${CHANNEL_PREFIX}/rpc`, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ id: `client.diagnostic.${Date.now()}`, method: "client.diagnostic", params: { level, message, source, line, stack: typeof stack == "string" ? stack : null } }), keepalive: !0 }).catch(() => { }); } catch { } } function describeThrown(value) { if (typeof value == "string") return value; if (typeof value == "object" && value !== null) { let name = value.name, message = value.message; if (typeof name == "string" && typeof message == "string") return `${name}: ${message}`; if (typeof message == "string") return message; } try { let rendered = JSON.stringify(value); return rendered === "{}" || rendered === void 0 ? String(value) : rendered; } catch { return String(value); } } function stackOfThrown(value) { if (typeof value != "object" || value === null) return null; let stack = value.stack; return typeof stack == "string" ? stack : null; } function installDiagnostics() { if (typeof window > "u" || typeof window.addEventListener != "function") return; let target = window; if (target.__atTerminalDiagnostics === !0) return; target.__atTerminalDiagnostics = !0, window.addEventListener("error", (event) => { let error = event.error; postDiagnostic( "error", describeThrown(error ?? event.message ?? "unknown error"), typeof location > "u" ? "" : location.href, event.lineno ?? null, stackOfThrown(error) ); }), window.addEventListener("unhandledrejection", (event) => { let reason = event.reason; postDiagnostic( "unhandledrejection", describeThrown(reason), typeof location > "u" ? "" : location.href, null, stackOfThrown(reason) ); }); let original = console.error; console.error = (...args) => { let stack = null; for (let arg of args) if (stack = stackOfThrown(arg), stack !== null) break; postDiagnostic( "console.error", args.map((value) => describeThrown(value)).join(" "), typeof location > "u" ? "" : location.href, null, stack ), original.apply(console, args); }; } function announceToHost() { try { let params = { kind: KIND, origin: typeof location > "u" ? null : location.origin, href: typeof location > "u" ? null : location.href, userAgent: typeof navigator > "u" ? null : navigator.userAgent }; fetch(`${CHANNEL_PREFIX}/rpc`, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ id: "client.hello", method: "client.hello", params }), keepalive: !0 }).catch(() => { }); } catch { } } // src/platform/dsh/client/i18n.ts var NS = "atTerminal", zh = { // The 资产 tab's own chip. It is the column's default page — see `definition()` in `main.ts` // for why exactly one guide entry has to stay on the registered list. "type.label": "AT Terminal", // The 终端 tab's chip, used until a server is known and then suffixed with its label. A separate // key so a strip holding both kinds is readable without reading the titles. "session.label": "AT \u7EC8\u7AEF", "guide.title": "AT Terminal", "guide.description": "\u7BA1\u7406 SSH \u670D\u52A1\u5668\u8D44\u4EA7\uFF1B\u53CC\u51FB\u4E00\u53F0\u670D\u52A1\u5668\u5373\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00\u7EC8\u7AEF", "body.heading": "AT Terminal", // The 终端 tab's two pages. `mode.assets` names the 资产 tab in the command list, where the three // pages of the old single body are still listed together. "mode.assets": "\u8D44\u4EA7", "mode.sftp": "\u6587\u4EF6", "mode.terminal": "\u7EC8\u7AEF", // The command opens a **new terminal tab for a chosen server**, not an empty one: 「新建终端」 as // a bare button is gone, so what remains must say what it acts on. The second line is the // `blocked` reason when the focused panel has nothing to act on. "shortcut.newTab": "\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u8FDE\u63A5", "shortcut.pickAsset": "\u8BF7\u5148\u5728\u8D44\u4EA7\u5217\u8868\u4E2D\u9009\u62E9\u4E00\u53F0\u670D\u52A1\u5668\uFF0C\u6216\u5728\u7EC8\u7AEF\u6807\u7B7E\u9875\u9009\u597D\u76EE\u6807\u670D\u52A1\u5668\u3002", "toolbar.new": "\u65B0\u589E\u670D\u52A1\u5668", "toolbar.import": "\u5BFC\u5165", "toolbar.export": "\u5BFC\u51FA", "toolbar.refresh": "\u5237\u65B0", "toolbar.back": "\u8FD4\u56DE\u5217\u8868", // A terminal tab has to exist before a connection can, so this item and the row double-click do // the same thing rather than promising a connection that would have nowhere to appear. "menu.connect": "\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00\u7EC8\u7AEF", "menu.edit": "\u7F16\u8F91", "menu.copy": "\u590D\u5236\u5730\u5740", "menu.remove": "\u5220\u9664", "menu.copied": "\u5DF2\u590D\u5236 {target}", "dialog.close": "\u5173\u95ED", "summary.title": "\u8D44\u4EA7\u6458\u8981", "summary.pending": "\u6B63\u5728\u8BFB\u53D6\u8D44\u4EA7\u6458\u8981 \u2026", "summary.servers": "\u670D\u52A1\u5668\uFF1A{count}", "summary.passwords": "\u5DF2\u5B58\u53E3\u4EE4\uFF1A{count}", "summary.privateKeys": "\u79C1\u94A5\u6587\u4EF6\uFF1A{count}", "summary.directory": "\u79C1\u94A5\u76EE\u5F55\uFF1A{path}", // The label half of the private-key directory, kept apart from the path so the path // itself can be one `PathLabel` element — the two halves need different colors and // the leaf is what a reader identifies the entry by. `summary.directory` stays for // anything that only needs the sentence. "summary.directoryLabel": "\u79C1\u94A5\u76EE\u5F55\uFF1A", "servers.title": "\u670D\u52A1\u5668", "servers.pending": "\u6B63\u5728\u8BFB\u53D6\u670D\u52A1\u5668\u5217\u8868 \u2026", "servers.empty": "\u8FD8\u6CA1\u6709\u670D\u52A1\u5668\u3002\u70B9\u300C\u65B0\u589E\u670D\u52A1\u5668\u300D\u521B\u5EFA\uFF0C\u6216\u4ECE VS Code \u53D8\u4F53\u300C\u5BFC\u5165\u300D\u8D44\u4EA7\u5305\u3002", "servers.ungrouped": "\u672A\u5206\u7EC4", "servers.hint": "\u53CC\u51FB\u67D0\u53F0\u670D\u52A1\u5668\u5373\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00\u7EC8\u7AEF\uFF1B\u53F3\u952E\u53EF\u6253\u5F00\u7EC8\u7AEF\u3001\u7F16\u8F91\u3001\u590D\u5236\u5730\u5740\u6216\u5220\u9664\u3002", "servers.tabRefused": "\u65E0\u6CD5\u6253\u5F00\u65B0\u6807\u7B7E\u9875\uFF1A\u53F3\u4FA7\u680F\u5F53\u524D\u6CA1\u6709\u53EF\u653E\u7F6E\u6807\u7B7E\u7684\u533A\u57DF\u3002\u8BF7\u5148\u5C55\u5F00\u53F3\u4FA7\u680F\uFF0C\u518D\u53CC\u51FB\u8FDE\u63A5\u3002", "servers.connect": "\u8FDE\u63A5", "servers.edit": "\u7F16\u8F91", "servers.remove": "\u5220\u9664", "servers.hasPassword": "\u5DF2\u5B58\u53E3\u4EE4", "servers.removeConfirm": "\u786E\u5B9A\u5220\u9664\u670D\u52A1\u5668\u300C{label}\u300D\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002", "servers.removed": "\u5DF2\u5220\u9664 {label}\u3002", "servers.removeMissing": "\u8BE5\u670D\u52A1\u5668\u5DF2\u4E0D\u5B58\u5728\uFF0C\u5217\u8868\u5DF2\u5237\u65B0\u3002", "auth.password": "\u53E3\u4EE4", "auth.privateKey": "\u79C1\u94A5", "auth.agent": "agent", "auth.password.title": "\u53E3\u4EE4", "auth.password.copy": "\u5B89\u5168\u4FDD\u5B58\u5728\u5BBF\u4E3B\u51ED\u636E\u5E93\u4E2D\uFF0C\u4EC5\u53EF\u5199\u5165\u3001\u7EDD\u4E0D\u56DE\u663E\u3002", "auth.privateKey.title": "\u79C1\u94A5", "auth.privateKey.copy": "\u53EA\u4FDD\u5B58\u672C\u673A\u79C1\u94A5\u8DEF\u5F84\uFF0C\u8FDE\u63A5\u65F6\u624D\u8BFB\u53D6\u79C1\u94A5\u5185\u5BB9\u3002", "auth.agent.title": "SSH Agent", "auth.agent.copy": "\u4F7F\u7528\u672C\u5730 SSH agent\uFF08SSH_AUTH_SOCK\uFF09\u3002", "form.subtitle": "\u914D\u7F6E\u4E00\u53F0\u76F4\u8FDE SSH \u7EC8\u7AEF\u670D\u52A1\u5668\u3002", "form.manual": "\u624B\u52A8\u914D\u7F6E", "form.new": "\u65B0\u589E\u670D\u52A1\u5668", "form.edit": "\u7F16\u8F91\u670D\u52A1\u5668", "form.section.connection": "\u8FDE\u63A5", "form.section.auth": "\u8BA4\u8BC1", "form.section.jump": "\u8DF3\u677F", "form.section.summary": "\u6458\u8981", "form.label": "\u540D\u79F0", "form.group": "\u5206\u7EC4", "form.host": "\u4E3B\u673A", "form.port": "\u7AEF\u53E3", "form.username": "\u7528\u6237\u540D", "form.authType": "\u8BA4\u8BC1\u65B9\u5F0F", "form.password": "\u53E3\u4EE4", "form.passwordKeep": "\u7559\u7A7A\u8868\u793A\u4E0D\u4FEE\u6539\u5DF2\u5B58\u53E3\u4EE4\uFF08\u4EC5\u53EF\u5199\u5165\uFF0C\u4E0D\u4F1A\u56DE\u663E\uFF09\u3002", "form.show": "\u663E\u793A", "form.hide": "\u9690\u85CF", "form.privateKeyPath": "\u79C1\u94A5\u8DEF\u5F84", "form.privateKeyPlaceholder": "\u4E3B\u673A\u4E0A\u7684\u79C1\u94A5\u6587\u4EF6\u8DEF\u5F84", "form.jumpHost": "\u8DF3\u677F\u673A", "form.jumpHostNone": "\uFF08\u76F4\u8FDE\uFF09", "form.encoding": "\u7F16\u7801", "form.keepAlive": "\u4FDD\u6D3B\u95F4\u9694\uFF08\u79D2\uFF09", "form.trust": "Agent \u547D\u4EE4\u4FE1\u4EFB", "form.trust.none": "\u6BCF\u6B21\u8BE2\u95EE", "form.trust.policy": "\u6309\u7B56\u7565\u8BE2\u95EE", "form.trust.full": "\u5B8C\u5168\u4FE1\u4EFB", "form.trustHelpNone": "\u6BCF\u6761\u8FDC\u7A0B\u547D\u4EE4\u90FD\u4F1A\u8BF7\u6C42\u786E\u8BA4\u3002", "form.trustHelpPolicy": "\u9ED1\u540D\u5355\u4E0A\u7684\u7834\u574F\u6027\u547D\u4EE4\uFF08rm\u3001chmod\u3001systemctl restart\u3001apt\u3001docker exec\u3001iptables -F\uFF09\u59CB\u7EC8\u8BE2\u95EE\uFF1B\u5176\u4F59\u547D\u4EE4\uFF08\u542B\u672A\u77E5\u547D\u4EE4\uFF09\u76F4\u63A5\u6267\u884C\uFF1B\u65E0\u6CD5 plainly \u8BFB\u53D6\u7684\u547D\u4EE4\uFF08\u547D\u4EE4\u66FF\u6362\u3001\u6587\u4EF6\u91CD\u5B9A\u5411\uFF09\u59CB\u7EC8\u8BE2\u95EE\u3002", "form.trustHelpFull": "\u8FDC\u7A0B\u547D\u4EE4\u4E0E SFTP \u5199\u5165\u4E0D\u518D\u8BF7\u6C42\u786E\u8BA4\u3002", "form.background": "\u5141\u8BB8 Agent \u540E\u53F0\u8FDE\u63A5", "form.save": "\u4FDD\u5B58", "form.saving": "\u6B63\u5728\u4FDD\u5B58 \u2026", "form.cancel": "\u53D6\u6D88", "form.saved": "\u5DF2\u4FDD\u5B58 {label}\u3002", "form.summaryEnterHostUser": "\u586B\u5199\u4E3B\u673A\u4E0E\u7528\u6237\u540D", "form.summaryAuth": "\u8BA4\u8BC1\uFF1A{auth}", "form.summaryGroup": "\u5206\u7EC4\uFF1A{group}", "form.summaryRouteDirect": "\u8DEF\u7EBF\uFF1A\u76F4\u8FDE", "form.summaryRouteVia": "\u8DEF\u7EBF\uFF1A\u7ECF {host} \u8DF3\u677F", "form.summaryAgentFull": "Agent \u547D\u4EE4\uFF1A\u76F4\u63A5\u6267\u884C", "form.summaryAgentPolicy": "Agent \u547D\u4EE4\uFF1A\u7834\u574F\u6027\u547D\u4EE4\u4ECD\u8BE2\u95EE", "form.summaryAgentManual": "Agent \u547D\u4EE4\uFF1A\u9010\u6761\u786E\u8BA4", "form.defaultGroup": "\u9ED8\u8BA4", "validate.label": "\u8BF7\u586B\u5199\u540D\u79F0\u3002", "validate.host": "\u8BF7\u586B\u5199\u4E3B\u673A\u3002", "validate.username": "\u8BF7\u586B\u5199\u7528\u6237\u540D\u3002", "validate.port": "\u7AEF\u53E3\u5FC5\u987B\u662F 1\u201365535 \u4E4B\u95F4\u7684\u6574\u6570\u3002", "validate.password": "\u53E3\u4EE4\u8BA4\u8BC1\u7684\u670D\u52A1\u5668\u5FC5\u987B\u586B\u5199\u53E3\u4EE4\u3002", "validate.privateKeyPath": "\u79C1\u94A5\u8BA4\u8BC1\u7684\u670D\u52A1\u5668\u5FC5\u987B\u586B\u5199\u79C1\u94A5\u8DEF\u5F84\u3002", "validate.keepAlive": "\u4FDD\u6D3B\u95F4\u9694\u5FC5\u987B\u662F\u4E0D\u5C0F\u4E8E 0 \u7684\u6574\u6570\u3002", "export.title": "\u5BFC\u51FA\u8D44\u4EA7", "export.includePasswords": "\u5305\u542B\u5DF2\u4FDD\u5B58\u7684\u53E3\u4EE4", "export.includePrivateKeys": "\u5305\u542B\u79C1\u94A5\u6587\u4EF6\u5185\u5BB9", "export.password": "\u5305\u53E3\u4EE4", "export.passwordHint": "\u5FC5\u586B\uFF1A\u5BFC\u51FA\u7684\u6587\u4EF6\u7528\u5B83\u52A0\u5BC6", "export.submit": "\u5BFC\u51FA", "export.pending": "\u6B63\u5728\u5BFC\u51FA \u2026", "export.done": "\u5DF2\u5BFC\u51FA {filename}", "export.omissions": "\u6709 {count} \u9879\u56E0\u5BF9\u5E94\u9009\u9879\u672A\u52FE\u9009\u800C\u672A\u5BFC\u51FA\u3002", "export.needPassword": "\u8BF7\u5148\u586B\u5199\u5305\u53E3\u4EE4\uFF0C\u518D\u5BFC\u51FA\u3002", "import.title": "\u5BFC\u5165\u8D44\u4EA7", "import.file": "\u8D44\u4EA7\u5305\u6587\u4EF6\uFF08.at-terminal-assets\uFF09", "import.password": "\u5305\u53E3\u4EE4", "import.strategy": "\u540C\u540D\u51B2\u7A81\u65F6", "import.strategy.skip": "\u8DF3\u8FC7", "import.strategy.overwrite": "\u8986\u76D6", "import.strategy.rename": "\u91CD\u547D\u540D", "import.submit": "\u5BFC\u5165", "import.pending": "\u6B63\u5728\u5BFC\u5165 \u2026", "import.needFile": "\u8BF7\u5148\u9009\u62E9\u8981\u5BFC\u5165\u7684\u8D44\u4EA7\u5305\u6587\u4EF6\u3002", "import.needPassword": "\u8BF7\u5148\u586B\u5199\u5305\u53E3\u4EE4\u3002", "import.done": "\u5BFC\u5165\u5B8C\u6210\uFF1A", "import.result.imported": "\u65B0\u589E {count}", "import.result.skipped": "\u8DF3\u8FC7 {count}", "import.result.overwritten": "\u8986\u76D6 {count}", "import.result.renamed": "\u91CD\u547D\u540D {count}", "import.result.privateKeys": "\u5199\u5165\u79C1\u94A5 {count}", "terminal.title": "\u7EC8\u7AEF", "terminal.select": "\u670D\u52A1\u5668", "terminal.connect": "\u8FDE\u63A5", "terminal.disconnect": "\u65AD\u5F00", "terminal.reconnect": "\u91CD\u8FDE", "terminal.pick": "\u8BF7\u5148\u9009\u62E9\u4E00\u53F0\u670D\u52A1\u5668\u3002", "terminal.state.idle": "\u672A\u8FDE\u63A5", "terminal.state.connecting": "\u8FDE\u63A5\u4E2D \u2026", "terminal.state.connected": "\u5DF2\u8FDE\u63A5", "terminal.state.disconnected": "\u5DF2\u65AD\u5F00", "terminal.searchHint": "Ctrl/\u2318+F \u67E5\u627E", "terminal.find": "\u67E5\u627E", "terminal.findPrev": "\u4E0A\u4E00\u4E2A", "terminal.findNext": "\u4E0B\u4E00\u4E2A", "terminal.findClose": "\u5173\u95ED\u67E5\u627E", "terminal.engine": "xterm.js", "terminal.trust": "\u4FE1\u4EFB\u8BE5\u4E3B\u673A", "terminal.fingerprint": "\u4E3B\u673A\u5BC6\u94A5\u6307\u7EB9\uFF1A{fingerprint}", "terminal.trusted": "\u5DF2\u4FE1\u4EFB {host}:{port}\uFF0C\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5 \u2026", "terminal.trustPending": "\u6B63\u5728\u8BB0\u5F55\u4E3B\u673A\u5BC6\u94A5 \u2026", "terminal.forget": "\u6E05\u9664\u5DF2\u8BB0\u5F55\u7684\u5BC6\u94A5\u5E76\u91CD\u8BD5", "terminal.closed": "\u8FDE\u63A5\u5DF2\u5173\u95ED\uFF1A{reason}", "terminal.noOrigin": "\u65E0\u6CD5\u4ECE\u5F53\u524D\u9875\u9762\u5730\u5740\u63A8\u65AD\u51FA\u7EC8\u7AEF\u5730\u5740\uFF0C\u56E0\u6B64\u4E0D\u80FD\u8FDE\u63A5\u3002", "terminal.noWsEndpoint": "Host \u672A\u62A5\u544A\u53EF\u7528\u7684\u7EC8\u7AEF\u5730\u5740\uFF08channel.info \u65E0 wsUrl\uFF09\uFF0C\u65E0\u6CD5\u8FDE\u63A5\u3002", "terminal.noWebSocket": "\u5F53\u524D\u9875\u9762\u6CA1\u6709\u53EF\u7528\u7684 WebSocket \u5B9E\u73B0\uFF0C\u65E0\u6CD5\u8FDE\u63A5\u7EC8\u7AEF\u3002", "error.title": "\u64CD\u4F5C\u5931\u8D25", "error.badParams": "\u53C2\u6570\u4E0D\u5B8C\u6574\u6216\u4E0D\u5408\u6CD5\u3002", "error.wrongPassword": "\u5305\u53E3\u4EE4\u4E0D\u6B63\u786E\uFF0C\u6216\u5BFC\u51FA\u6587\u4EF6\u5DF2\u635F\u574F\u3002", "error.unreadablePackage": "\u5305\u53E3\u4EE4\u6B63\u786E\uFF0C\u4F46\u6587\u4EF6\u5185\u5BB9\u4E0D\u662F\u53EF\u8BC6\u522B\u7684\u8D44\u4EA7\u5305\u3002", "error.hostKeyUnknown": "\u8BE5\u4E3B\u673A\u7684\u5BC6\u94A5\u5C1A\u672A\u88AB\u4FE1\u4EFB\u3002\u6838\u5BF9\u6307\u7EB9\u540E\u70B9\u300C\u4FE1\u4EFB\u8BE5\u4E3B\u673A\u300D\uFF0C\u4F1A\u81EA\u52A8\u91CD\u65B0\u8FDE\u63A5\u3002", "error.hostKeyChanged": "\u8BE5\u4E3B\u673A\u7684\u5BC6\u94A5\u4E0E\u4E4B\u524D\u8BB0\u5F55\u7684\u4E0D\u4E00\u81F4\uFF0C\u53EF\u80FD\u662F\u4E2D\u95F4\u4EBA\u653B\u51FB\u3002\u6838\u5BF9\u6307\u7EB9\u540E\u518D\u51B3\u5B9A\u662F\u5426\u4FE1\u4EFB\u3002", "error.authenticationFailed": "\u670D\u52A1\u5668\u62D2\u7EDD\u4E86\u672C\u6B21\u63D0\u4F9B\u7684\u5168\u90E8\u8BA4\u8BC1\u65B9\u5F0F\u3002\u8BF7\u6838\u5BF9\uFF1A\u2460 \u9762\u677F\u91CC\u4FDD\u5B58\u7684\u53E3\u4EE4/\u79C1\u94A5\u662F\u5426\u4ECD\u7136\u6709\u6548\uFF08\u53F3\u952E \u2192 \u7F16\u8F91 \u53EF\u91CD\u65B0\u8F93\u5165\uFF09\uFF1B\u2461 \u8BE5\u8D26\u53F7\u662F\u5426\u5141\u8BB8\u8FD9\u79CD\u767B\u5F55\uFF08root \u53E3\u4EE4\u767B\u5F55\u5E38\u88AB\u670D\u52A1\u5668\u4EE5 PermitRootLogin prohibit-password \u7981\u6B62\uFF09\uFF1B\u2462 \u662F\u5426\u8981\u6C42\u952E\u76D8\u4EA4\u4E92\uFF082FA/PAM\uFF09\u8BA4\u8BC1\u3002", "error.passwordMissing": "\u8FD9\u53F0\u670D\u52A1\u5668\u4F7F\u7528\u53E3\u4EE4\u8BA4\u8BC1\uFF0C\u4F46\u9762\u677F\u91CC\u6CA1\u6709\u4FDD\u5B58\u53E3\u4EE4\u3002\u8BF7\u53F3\u952E \u2192 \u7F16\u8F91 \u8F93\u5165\u53E3\u4EE4\u540E\u91CD\u8BD5\u3002", "error.privateKeyPathMissing": "\u8FD9\u53F0\u670D\u52A1\u5668\u4F7F\u7528\u79C1\u94A5\u8BA4\u8BC1\uFF0C\u4F46\u6CA1\u6709\u914D\u7F6E\u79C1\u94A5\u8DEF\u5F84\u3002\u8BF7\u53F3\u952E \u2192 \u7F16\u8F91 \u586B\u5199\u79C1\u94A5\u8DEF\u5F84\u3002", "error.privateKeyUnreadable": "\u79C1\u94A5\u6587\u4EF6\u8BFB\u4E0D\u5230\uFF08\u4E0D\u5B58\u5728\u6216\u6743\u9650\u4E0D\u8DB3\uFF09\u3002\u8BF7\u6838\u5BF9\u8DEF\u5F84\uFF1B\u82E5\u662F\u4ECE\u8D44\u4EA7\u5305\u5BFC\u5165\u7684\uFF0C\u786E\u8BA4\u5305\u91CC\u5E26\u4E0A\u4E86\u79C1\u94A5\u6587\u4EF6\u3002", "error.connectionRefused": "\u76EE\u6807\u7AEF\u53E3\u6CA1\u6709\u670D\u52A1\u5728\u76D1\u542C\uFF08\u8FDE\u63A5\u88AB\u62D2\u7EDD\uFF09\u3002\u8BF7\u6838\u5BF9\u4E3B\u673A\u4E0E\u7AEF\u53E3\u662F\u5426\u6B63\u786E\u3001\u4EE5\u53CA\u662F\u5426\u9700\u8981\u5148\u8FDE\u8DF3\u677F\u673A/VPN\u3002", "error.connectionTimeout": "\u8FDE\u63A5\u8D85\u65F6\u3002\u8BF7\u6838\u5BF9\u7F51\u7EDC\u3001\u9632\u706B\u5899\uFF0C\u6216\u5148\u786E\u8BA4\u8DF3\u677F\u673A/VPN \u53EF\u8FBE\u3002", "error.hostUnresolved": "\u4E3B\u673A\u540D\u65E0\u6CD5\u89E3\u6790\u3002\u8BF7\u6838\u5BF9\u4E3B\u673A\u540D\u6216 DNS\u3002", "error.hostUnreachable": "\u76EE\u6807\u4E3B\u673A\u4E0D\u53EF\u8FBE\u3002\u8BF7\u6838\u5BF9\u8DEF\u7531\u6216 VPN\u3002", "error.generic": "Host \u534A\u8FD4\u56DE\u4E86\u9519\u8BEF\u3002", "error.detail": "\u9519\u8BEF\u7801 {code}\uFF1A{message}", "error.noActiveTerminal": "\u672C\u6807\u7B7E\u9875\u8FD8\u6CA1\u6709\u5DF2\u8FDE\u63A5\u7684 SSH \u7EC8\u7AEF\u3002\u5148\u5728\u300C\u7EC8\u7AEF\u300D\u9875\u8FDE\u63A5\u4E00\u53F0\u670D\u52A1\u5668\uFF0C\u6587\u4EF6\u6811\u4F1A\u8DDF\u968F\u8FD9\u4E2A\u7EC8\u7AEF\u3002", "error.sftpDisconnected": "\u8FD9\u4E2A\u6807\u7B7E\u9875\u7684 SSH \u7EC8\u7AEF\u5DF2\u65AD\u5F00\uFF0C\u53EA\u80FD\u663E\u793A\u65AD\u5F00\u524D\u8BFB\u5230\u7684\u90A3\u4E00\u5C42\u76EE\u5F55\u3002\u91CD\u65B0\u8FDE\u63A5\u8BE5\u670D\u52A1\u5668\u5373\u53EF\u7EE7\u7EED\u5C55\u5F00\u3002", "error.sftpNoSuchFile": "\u8FDC\u7AEF\u5DF2\u6CA1\u6709\u8BE5\u8DEF\u5F84\uFF08\u53EF\u80FD\u5728\u522B\u5904\u88AB\u5220\u6389\u6216\u6539\u540D\uFF09\u3002\u5237\u65B0\u540E\u91CD\u65B0\u5C55\u5F00\u5373\u53EF\u3002", "error.sftpPermissionDenied": "\u767B\u5F55\u8D26\u53F7\u65E0\u6743\u8BFB\u53D6\u8BE5\u76EE\u5F55\u3002\u6362\u4E00\u4E2A\u6709\u6743\u9650\u7684\u8D26\u53F7\uFF0C\u6216\u7528\u7EC8\u7AEF\u9875\u5728\u8FDC\u7AEF\u786E\u8BA4\u76EE\u5F55\u6743\u9650\u3002", "error.sftpReadFailed": "\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u5931\u8D25\u3002\u53EF\u91CD\u8BD5\uFF1B\u82E5\u4E00\u76F4\u5931\u8D25\uFF0C\u8BF7\u5230\u300C\u7EC8\u7AEF\u300D\u9875\u786E\u8BA4\u8BE5\u4F1A\u8BDD\u4ECD\u7136\u6B63\u5E38\u3002", "sftp.title": "\u8FDC\u7A0B\u6587\u4EF6", "sftp.pending": "\u6B63\u5728\u8BFB\u53D6\u8FDC\u7A0B\u76EE\u5F55 \u2026", "sftp.noTerminal": "\u672C\u6807\u7B7E\u9875\u6CA1\u6709\u6D3B\u52A8\u7684 SSH \u7EC8\u7AEF\u3002\u6587\u4EF6\u6811\u8DDF\u968F\u672C\u6807\u7B7E\u9875\u7684\u7EC8\u7AEF\u2014\u2014\u5148\u5728\u300C\u7EC8\u7AEF\u300D\u9875\u8FDE\u63A5\u4E00\u53F0\u670D\u52A1\u5668\u3002", "sftp.disconnected": "\u7EC8\u7AEF\u5DF2\u65AD\u5F00\uFF1A\u4EE5\u4E0B\u662F\u65AD\u5F00\u524D\u8BFB\u5230\u7684\u76EE\u5F55\u5185\u5BB9\uFF0C\u91CD\u65B0\u8FDE\u63A5\u540E\u624D\u80FD\u7EE7\u7EED\u5C55\u5F00\u3002", "sftp.empty": "\u8BE5\u76EE\u5F55\u4E3A\u7A7A\u3002", "sftp.parent": "\u4E0A\u4E00\u7EA7", "sftp.goUp": "\u4E0A\u4E00\u7EA7", "sftp.expand": "\u5C55\u5F00", "sftp.collapse": "\u6298\u53E0", "sftp.dirPending": "\u6B63\u5728\u8BFB\u53D6\u8BE5\u76EE\u5F55 \u2026", "sftp.dirFailed": "\u8FD9\u4E00\u5C42\u6CA1\u6709\u8BFB\u5230\u5185\u5BB9\u3002", "sftp.dirFailedNoSuchFile": "\u8FD9\u4E00\u5C42\u6CA1\u6709\u8BFB\u5230\uFF1A\u8FDC\u7AEF\u5DF2\u4E0D\u5B58\u5728\u8BE5\u8DEF\u5F84\uFF0C\u53EF\u80FD\u521A\u88AB\u5220\u9664\u6216\u6539\u540D\u3002", "sftp.dirFailedPermissionDenied": "\u8FD9\u4E00\u5C42\u6CA1\u6709\u8BFB\u5230\uFF1A\u5F53\u524D\u767B\u5F55\u8D26\u53F7\u6CA1\u6709\u8BFB\u53D6\u5B83\u7684\u6743\u9650\u3002", "sftp.dirFailedReadFailed": "\u8FD9\u4E00\u5C42\u6CA1\u6709\u8BFB\u5230\uFF1A\u8BFB\u53D6\u65F6\u51FA\u4E86\u9519\uFF0C\u53EF\u4EE5\u91CD\u8BD5\u3002", "sftp.retry": "\u91CD\u8BD5", "sftp.pathUnknown": "\u5C1A\u672A\u89E3\u6790\u51FA\u8FDC\u7AEF\u8DEF\u5F84", "sftp.entryCount": "{count} \u9879", // The four file operations. 查看 and 编辑 are separate words on purpose: one opens a // read-only view, the other an editable buffer, and a single 「打开」 would leave the user // to discover which one they got. "sftp.view": "\u67E5\u770B", "sftp.edit": "\u7F16\u8F91", "sftp.download": "\u4E0B\u8F7D", "sftp.downloading": "\u6B63\u5728\u4E0B\u8F7D \u2026", "sftp.downloadDone": "\u5DF2\u4E0B\u8F7D {name}\uFF08{size}\uFF09\u3002", "sftp.downloadProgress": "\u4E0B\u8F7D\u4E2D\uFF1A{name}", "sftp.newFile": "\u65B0\u5EFA\u6587\u4EF6", "sftp.delete": "\u5220\u9664", "sftp.deleteConfirm": "\u786E\u5B9A\u8981\u5220\u9664\u201C{name}\u201D\u5417\uFF1F\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500\u3002", "sftp.deleteDone": "\u5DF2\u5220\u9664 {name}\u3002", "sftp.newFileTitle": "\u65B0\u5EFA\u6587\u4EF6", "sftp.newFilePrompt": "\u8F93\u5165\u6587\u4EF6\u540D\uFF1A", "sftp.newFileNamePlaceholder": "\u4F8B\u5982\uFF1Aindex.js", "sftp.newFileTargetDir": "\u76EE\u6807\u76EE\u5F55\uFF1A{dir}", "sftp.create": "\u521B\u5EFA", "sftp.cancel": "\u53D6\u6D88", "sftp.createDone": "\u5DF2\u521B\u5EFA {name}\u3002", "sftp.copyPath": "\u590D\u5236\u8DEF\u5F84", "sftp.copiedPath": "\u5DF2\u590D\u5236\u8DEF\u5F84\uFF1A{path}", "sftp.uploadHere": "\u4E0A\u4F20\u5230\u6B64\u76EE\u5F55 \u2026", "sftp.upload": "\u4E0A\u4F20", "sftp.uploading": "\u4E0A\u4F20\u4E2D \u2026", "sftp.uploadProgress": "\u4E0A\u4F20\u4E2D\uFF1A{name}", "sftp.uploadProgressMulti": "\u4E0A\u4F20\u4E2D ({current}/{total})\uFF1A{name}", // The destination is on the control, not only in the dialog: the tree can be rooted // anywhere, so "where did my file go" must be answerable before the picker opens. "sftp.uploadTo": "\u4E0A\u4F20\u5230 {path}", "sftp.uploadConflict": "\u8FDC\u7AEF\u5DF2\u5B58\u5728 {path}\u3002\u8981\u8986\u76D6\u5B83\u5417\uFF1F", "sftp.uploadSkipped": "\u5DF2\u8DF3\u8FC7 {name}\uFF08\u8FDC\u7AEF\u5DF2\u5B58\u5728\uFF09", "sftp.uploadDone": "\u5DF2\u4E0A\u4F20 {count} \u4E2A\u6587\u4EF6\u3002", "sftp.fileBack": "\u8FD4\u56DE\u5217\u8868", "sftp.filePending": "\u6B63\u5728\u8BFB\u53D6\u6587\u4EF6 \u2026", "sftp.fileSave": "\u4FDD\u5B58", "sftp.fileSaving": "\u6B63\u5728\u4FDD\u5B58 \u2026", "sftp.fileRevert": "\u64A4\u9500\u4FEE\u6539", "sftp.fileSaved": "\u5DF2\u4FDD\u5B58\u5230\u8FDC\u7AEF\uFF08{size}\uFF09\u3002", "sftp.fileDirty": "\u672A\u4FDD\u5B58", "sftp.fileClean": "\u5DF2\u540C\u6B65", "sftp.fileSize": "{size}", "sftp.fileLines": "{count} \u884C", "sftp.fileEolLf": "\u884C\u5C3E LF", "sftp.fileEolCrlf": "\u884C\u5C3E CRLF", "sftp.fileTruncated": "\u8BE5\u6587\u4EF6\u6BD4\u9762\u677F\u7684\u663E\u793A\u4E0A\u9650\u66F4\u5927\uFF08{size}\uFF09\uFF0C\u8FD9\u91CC\u53EA\u6709\u5F00\u5934\u4E00\u6BB5\u3002\u67E5\u770B\u53EF\u7528\uFF1B\u7F16\u8F91\u4F1A\u628A\u622A\u65AD\u540E\u7684\u5185\u5BB9\u5199\u56DE\u5E76\u4E22\u6389\u5176\u4F59\u90E8\u5206\uFF0C\u8BF7\u6539\u7528\u4E0B\u8F7D\u6216\u7EC8\u7AEF\u9875\u3002", "sftp.fileConflict": "\u8BE5\u6587\u4EF6\u5728\u6253\u5F00\u4E4B\u540E\u5DF2\u7ECF\u6539\u8FC7\uFF08\u53EF\u80FD\u6709\u4EBA\u5728\u522B\u5904\u7F16\u8F91\u6216\u90E8\u7F72\u4E86\u5B83\uFF09\u3002\u5199\u5165\u4F1A\u8986\u76D6\u90A3\u4E00\u6B21\u6539\u52A8\u3002", "sftp.fileOverwrite": "\u8986\u76D6\u5E76\u4FDD\u5B58", "sftp.fileReload": "\u91CD\u65B0\u8BFB\u53D6", "sftp.fileEditBlocked": "\u53EA\u8BFB\uFF1A\u6587\u4EF6\u8D85\u51FA\u9762\u677F\u4E0A\u9650\u3002\u7F16\u8F91\u4F1A\u628A\u622A\u65AD\u540E\u7684\u5185\u5BB9\u5199\u56DE\uFF0C\u8986\u76D6\u6389\u5269\u4F59\u90E8\u5206\uFF0C\u56E0\u6B64\u8FD9\u91CC\u4E0D\u63D0\u4F9B\u7F16\u8F91\u3002", "sftp.fileEditorLabel": "\u7F16\u8F91 {path}", "sftp.fileViewerLabel": "{path} \u7684\u5185\u5BB9", "error.sftpFileTooLarge": "\u6587\u4EF6\u8D85\u51FA\u9762\u677F\u4E00\u6B21\u80FD\u642C\u8FD0\u7684\u4E0A\u9650\u3002\u6587\u4EF6\u4F20\u8F93\u8BF7\u6539\u7528\u300C\u7EC8\u7AEF\u300D\u9875\uFF08scp / rsync\uFF09\uFF0C\u6216\u5206\u5757\u8BFB\u53D6\u3002", "error.sftpBinaryFile": "\u8FD9\u662F\u4E00\u4E2A\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u6309\u6587\u672C\u6253\u5F00\u518D\u4FDD\u5B58\u4F1A\u628A\u5B83\u5199\u574F\u3002\u8BF7\u6539\u7528\u300C\u4E0B\u8F7D\u300D\uFF0C\u6216\u5728\u7EC8\u7AEF\u9875\u67E5\u770B\u3002", "error.sftpNotAFile": "\u8BE5\u8DEF\u5F84\u662F\u4E00\u4E2A\u76EE\u5F55\uFF0C\u4E0D\u662F\u6587\u4EF6\u3002", "error.sftpConflict": "\u8FDC\u7AEF\u6587\u4EF6\u5728\u672C\u6B21\u64CD\u4F5C\u671F\u95F4\u88AB\u6539\u52A8\u8FC7\uFF08\u5185\u5BB9\u6216\u65F6\u95F4\u6233\u4E0D\u4E00\u81F4\uFF09\u3002\u786E\u8BA4\u8981\u8986\u76D6\u65F6\u518D\u9009\u300C\u8986\u76D6\u300D\uFF0C\u6216\u91CD\u65B0\u8BFB\u53D6\u540E\u91CD\u505A\u4FEE\u6539\u3002", "error.sftpWriteFailed": "\u5199\u5165\u8FDC\u7AEF\u6587\u4EF6\u5931\u8D25\u3002\u53EF\u91CD\u8BD5\uFF1B\u82E5\u4E00\u76F4\u5931\u8D25\uFF0C\u8BF7\u5230\u300C\u7EC8\u7AEF\u300D\u9875\u786E\u8BA4\u8BE5\u4F1A\u8BDD\u4ECD\u7136\u6B63\u5E38\u3002", "error.sftpBadParams": "\u6587\u4EF6\u64CD\u4F5C\u7F3A\u5C11\u5FC5\u8981\u53C2\u6570\uFF08\u8DEF\u5F84\u6216\u5185\u5BB9\uFF09\u3002", "error.noFileReader": "\u5F53\u524D\u9875\u9762\u65E0\u6CD5\u8BFB\u53D6\u672C\u5730\u6587\u4EF6\uFF08\u7F3A\u5C11 FileReader \u652F\u6301\uFF09\uFF0C\u56E0\u6B64\u4E0D\u80FD\u4E0A\u4F20\u3002" }, en = { "type.label": "AT Terminal", "session.label": "AT Terminal", "guide.title": "AT Terminal", "guide.description": "Manage SSH server assets; double-click a server to open a terminal in a new tab", "body.heading": "AT Terminal", "mode.assets": "Assets", "mode.sftp": "Files", "mode.terminal": "Terminal", "shortcut.newTab": "Connect in a new tab", "shortcut.pickAsset": "Pick a server in the asset list first, or choose one on a terminal tab.", "toolbar.new": "New Server", "toolbar.import": "Import", "toolbar.export": "Export", "toolbar.refresh": "Refresh", "toolbar.back": "Back to list", "menu.connect": "Open a terminal in a new tab", "menu.edit": "Edit", "menu.copy": "Copy address", "menu.remove": "Delete", "menu.copied": "Copied {target}", "dialog.close": "Close", "summary.title": "Asset summary", "summary.pending": "Reading the asset summary \u2026", "summary.servers": "Servers: {count}", "summary.passwords": "Stored passwords: {count}", "summary.privateKeys": "Private key files: {count}", "summary.directory": "Private key directory: {path}", "summary.directoryLabel": "Private key directory: ", "servers.title": "Servers", "servers.pending": "Reading the server list \u2026", "servers.empty": 'No servers yet. Create one with "New Server", or import an asset package from the VS Code variant.', "servers.ungrouped": "Ungrouped", "servers.hint": "Double-click a server to open a terminal for it in a new tab; right-click to open a terminal, edit, copy the address or delete.", "servers.tabRefused": "Could not open a new tab: the right sidebar has no area to place one in. Expand the sidebar and double-click again.", "servers.connect": "Connect", "servers.edit": "Edit", "servers.remove": "Delete", "servers.hasPassword": "password stored", "servers.removeConfirm": 'Delete server "{label}"? This cannot be undone.', "servers.removed": "Deleted {label}.", "servers.removeMissing": "That server is already gone; the list has been refreshed.", "auth.password": "password", "auth.privateKey": "private key", "auth.agent": "agent", "auth.password.title": "Password", "auth.password.copy": "Stored in the host credential store; write-only, never echoed back.", "auth.privateKey.title": "Private Key", "auth.privateKey.copy": "Saves a local key path; the key itself is read only when connecting.", "auth.agent.title": "SSH Agent", "auth.agent.copy": "Use the local SSH agent (SSH_AUTH_SOCK).", "form.subtitle": "Configure a direct SSH terminal server.", "form.manual": "Manual setup", "form.new": "New server", "form.edit": "Edit server", "form.section.connection": "Connection", "form.section.auth": "Authentication", "form.section.jump": "Jump host", "form.section.summary": "Summary", "form.label": "Label", "form.group": "Group", "form.host": "Host", "form.port": "Port", "form.username": "Username", "form.authType": "Authentication", "form.password": "Password", "form.passwordKeep": "Leave blank to keep the stored password. It is write-only and is never echoed back.", "form.show": "Show", "form.hide": "Hide", "form.privateKeyPath": "Private key path", "form.privateKeyPlaceholder": "Path to the private key on the host", "form.jumpHost": "Jump host", "form.jumpHostNone": "(direct)", "form.encoding": "Encoding", "form.keepAlive": "Keep-alive (s)", "form.trust": "Agent command trust", "form.trust.none": "Ask every time", "form.trust.policy": "Ask by policy", "form.trust.full": "Full trust", "form.trustHelpNone": "Every remote command asks for confirmation.", "form.trustHelpPolicy": "State-changing commands on the blocklist (rm, chmod, systemctl restart, apt, docker exec, iptables -F) always ask; commands not on it, including unknown ones, run without asking; commands that cannot be read plainly (substitution, redirects) always ask.", "form.trustHelpFull": "Remote commands and SFTP writes run without a confirmation dialog.", "form.background": "Allow agent background connections", "form.save": "Save", "form.saving": "Saving \u2026", "form.cancel": "Cancel", "form.saved": "Saved {label}.", "form.summaryEnterHostUser": "Enter host and username", "form.summaryAuth": "Authentication: {auth}", "form.summaryGroup": "Group: {group}", "form.summaryRouteDirect": "Route: direct connection", "form.summaryRouteVia": "Route: via {host}", "form.summaryAgentFull": "Agent commands: run without asking", "form.summaryAgentPolicy": "Agent commands: state-changing commands still ask", "form.summaryAgentManual": "Agent commands: manual approval", "form.defaultGroup": "Default", "validate.label": "Enter a label.", "validate.host": "Enter a host.", "validate.username": "Enter a username.", "validate.port": "Port must be an integer between 1 and 65535.", "validate.password": "A password-auth server needs a password.", "validate.privateKeyPath": "A private-key server needs a key path.", "validate.keepAlive": "Keep-alive must be an integer of 0 or more.", "export.title": "Export assets", "export.includePasswords": "Include stored passwords", "export.includePrivateKeys": "Include private key contents", "export.password": "Package password", "export.passwordHint": "Required: the exported file is encrypted with it", "export.submit": "Export", "export.pending": "Exporting \u2026", "export.done": "Exported {filename}", "export.omissions": "{count} item(s) were left out because their option was unchecked.", "export.needPassword": "Enter a package password before exporting.", "import.title": "Import assets", "import.file": "Asset package file (.at-terminal-assets)", "import.password": "Package password", "import.strategy": "On name conflict", "import.strategy.skip": "Skip", "import.strategy.overwrite": "Overwrite", "import.strategy.rename": "Rename", "import.submit": "Import", "import.pending": "Importing \u2026", "import.needFile": "Choose an asset package file to import first.", "import.needPassword": "Enter the package password first.", "import.done": "Import finished:", "import.result.imported": "added {count}", "import.result.skipped": "skipped {count}", "import.result.overwritten": "overwritten {count}", "import.result.renamed": "renamed {count}", "import.result.privateKeys": "private keys written {count}", "terminal.title": "Terminal", "terminal.select": "Server", "terminal.connect": "Connect", "terminal.disconnect": "Disconnect", "terminal.reconnect": "Reconnect", "terminal.pick": "Choose a server first.", "terminal.state.idle": "Not connected", "terminal.state.connecting": "Connecting \u2026", "terminal.state.connected": "Connected", "terminal.state.disconnected": "Disconnected", "terminal.searchHint": "Ctrl/\u2318+F to search", "terminal.find": "Find", "terminal.findPrev": "Previous match", "terminal.findNext": "Next match", "terminal.findClose": "Close find", "terminal.engine": "xterm.js", "terminal.trust": "Trust this host", "terminal.fingerprint": "Host key fingerprint: {fingerprint}", "terminal.trusted": "Trusted {host}:{port}, reconnecting \u2026", "terminal.trustPending": "Recording the host key \u2026", "terminal.forget": "Clear the stored key and retry", "terminal.closed": "Connection closed: {reason}", "terminal.noOrigin": "The page address yields no terminal host, so the terminal cannot connect.", "terminal.noWsEndpoint": "The Host reported no usable terminal address (channel.info had no wsUrl), so the terminal cannot connect.", "terminal.noWebSocket": "This page has no WebSocket implementation, so the terminal cannot connect.", "error.title": "Operation failed", "error.badParams": "A parameter is missing or invalid.", "error.wrongPassword": "The package password is wrong, or the exported file is damaged.", "error.unreadablePackage": "The password is correct, but the file is not a recognizable asset package.", "error.hostKeyUnknown": "The host key is not trusted yet. Check the fingerprint and click Trust this host \u2014 the connection retries automatically.", "error.hostKeyChanged": "The host key differs from the one recorded earlier, which can mean a man-in-the-middle. Check the fingerprint before you trust it.", "error.authenticationFailed": "The server rejected every authentication method this connection offered. Check: (1) the stored password/key is still valid (right-click \u2192 Edit to re-enter it); (2) the account allows this kind of login (root password login is often disabled with PermitRootLogin prohibit-password); (3) whether keyboard-interactive (2FA/PAM) is required.", "error.passwordMissing": "This server uses password authentication but no password is stored. Right-click \u2192 Edit, enter the password and retry.", "error.privateKeyPathMissing": "This server uses private-key authentication but no key path is configured. Right-click \u2192 Edit and set the key path.", "error.privateKeyUnreadable": "The private key file could not be read (missing or not permitted). Check the path; if the server came from an asset package, make sure the package included the key file.", "error.connectionRefused": "Nothing is listening on that port (connection refused). Check the host and port, and whether a jump host or VPN is needed first.", "error.connectionTimeout": "The connection timed out. Check the network and firewall, or confirm the jump host/VPN is reachable.", "error.hostUnresolved": "The host name could not be resolved. Check the name or DNS.", "error.hostUnreachable": "The host is unreachable. Check the route or VPN.", "error.generic": "The Host half returned an error.", "error.detail": "code {code}: {message}", "error.noActiveTerminal": "This tab has no connected SSH terminal yet. Connect a server on the Terminal page first; the file tree follows it.", "error.sftpDisconnected": "This tab\u2019s SSH terminal has disconnected, so only the directory level read before it dropped can be shown. Reconnect that server to expand further.", "error.sftpNoSuchFile": "That path no longer exists on the remote host (it may have been removed or renamed elsewhere). Refresh and expand again.", "error.sftpPermissionDenied": "The login account may not read that directory. Use an account with permission, or check the directory mode from the Terminal page.", "error.sftpReadFailed": "Reading the remote directory failed. Retrying may work; if it keeps failing, confirm the session on the Terminal page is still healthy.", "sftp.title": "Remote files", "sftp.pending": "Reading the remote directory \u2026", "sftp.noTerminal": "This tab has no active SSH terminal. The file tree follows this tab\u2019s terminal \u2014 connect a server on the Terminal page first.", "sftp.disconnected": "The terminal disconnected: this is the directory as it was read before, and expanding again needs a reconnection.", "sftp.empty": "This directory is empty.", "sftp.parent": "parent", "sftp.goUp": "Parent", "sftp.expand": "Expand", "sftp.collapse": "Collapse", "sftp.dirPending": "Reading this directory \u2026", "sftp.dirFailed": "This level could not be read.", "sftp.dirFailedNoSuchFile": "Not read: that path is gone from the remote host, deleted or renamed just now.", "sftp.dirFailedPermissionDenied": "Not read: this account has no permission to read it.", "sftp.dirFailedReadFailed": "Not read: the read failed. You can try again.", "sftp.retry": "Retry", "sftp.pathUnknown": "no remote path resolved yet", "sftp.entryCount": "{count} entries", "sftp.view": "View", "sftp.edit": "Edit", "sftp.download": "Download", "sftp.downloading": "Downloading \u2026", "sftp.downloadDone": "Downloaded {name} ({size}).", "sftp.downloadProgress": "Downloading: {name}", "sftp.newFile": "New File", "sftp.delete": "Delete", "sftp.deleteConfirm": 'Are you sure you want to delete "{name}"? This action cannot be undone.', "sftp.deleteDone": "Deleted {name}.", "sftp.newFileTitle": "New File", "sftp.newFilePrompt": "Enter file name:", "sftp.newFileNamePlaceholder": "e.g. index.js", "sftp.newFileTargetDir": "Target directory: {dir}", "sftp.create": "Create", "sftp.cancel": "Cancel", "sftp.createDone": "Created {name}.", "sftp.copyPath": "Copy Path", "sftp.copiedPath": "Copied path: {path}", "sftp.uploadHere": "Upload here \u2026", "sftp.upload": "Upload", "sftp.uploading": "Uploading \u2026", "sftp.uploadProgress": "Uploading: {name}", "sftp.uploadProgressMulti": "Uploading ({current}/{total}): {name}", "sftp.uploadTo": "Upload to {path}", "sftp.uploadConflict": "{path} already exists on the server. Overwrite it?", "sftp.uploadSkipped": "Skipped {name} (already on the server)", "sftp.uploadDone": "Uploaded {count} file(s).", "sftp.fileBack": "Back to files", "sftp.filePending": "Reading the file \u2026", "sftp.fileSave": "Save", "sftp.fileSaving": "Saving \u2026", "sftp.fileRevert": "Revert", "sftp.fileSaved": "Saved to the server ({size}).", "sftp.fileDirty": "unsaved", "sftp.fileClean": "in sync", "sftp.fileSize": "{size}", "sftp.fileLines": "{count} lines", "sftp.fileEolLf": "LF endings", "sftp.fileEolCrlf": "CRLF endings", "sftp.fileTruncated": "This file is larger than the panel shows ({size}), so only its beginning is here. Viewing is fine; editing would write the cut text back and drop the rest \u2014 download it, or use the Terminal page.", "sftp.fileConflict": "This file changed after it was opened (someone edited or deployed it elsewhere). Saving will overwrite that change.", "sftp.fileOverwrite": "Overwrite and save", "sftp.fileReload": "Reload", "sftp.fileEditBlocked": "Read-only: the file is larger than the panel limit. Editing would write the truncated text back and drop the rest, so editing is not offered here.", "sftp.fileEditorLabel": "Edit {path}", "sftp.fileViewerLabel": "Contents of {path}", "error.sftpFileTooLarge": "The file is larger than this panel can move in one call. Use the Terminal page (scp / rsync) to transfer it, or read it in chunks.", "error.sftpBinaryFile": "This is a binary file, and opening it as text would corrupt it on save. Use Download instead, or look at it from the Terminal page.", "error.sftpNotAFile": "That path is a directory, not a file.", "error.sftpConflict": "The remote file changed during this operation (its size or timestamp no longer matches). Choose Overwrite to replace it, or reload and redo the edit.", "error.sftpWriteFailed": "Writing the remote file failed. Retrying may work; if it keeps failing, confirm the session on the Terminal page is still healthy.", "error.sftpBadParams": "The file operation is missing a required parameter (a path or the content).", "error.noFileReader": "This page cannot read local files (no FileReader support), so uploading is not possible." }; // src/platform/dsh/client/body.ts var import_react3 = __toESM(require("react"), 1); // src/platform/dsh/client/sessions.ts var import_react = __toESM(require("react"), 1); // src/platform/dsh/client/flow.ts function createFlowController(options) { let pauseAt = options.pauseBytes ?? 262144, resumeAt = options.resumeBytes ?? 65536, outstanding = 0, paused = !1; return { produced(bytes) { bytes <= 0 || (outstanding += bytes, !paused && outstanding > pauseAt && (paused = !0, options.onPauseChange(!0))); }, rendered(bytes) { bytes <= 0 || (outstanding = Math.max(0, outstanding - bytes), paused && outstanding < resumeAt && (paused = !1, options.onPauseChange(!1))); }, reset() { outstanding = 0, paused && (paused = !1); }, get paused() { return paused; }, get outstanding() { return outstanding; } }; } // src/platform/dsh/client/frames.ts function createTerminalFrameHandler(deps) { return { handle(raw) { let message; try { message = JSON.parse(String(raw)); } catch { return; } if (message === null || typeof message != "object") return; let type = message.type; if (type === "hello") { deps.requestOpen(); return; } if (type === "terminal.opened") { deps.onOpened(text(message.terminalId)); return; } if (type === "terminal.output") { if (typeof message.data != "string" || message.data === "") return; let bytes; try { bytes = decodeBase64Frame(message.data); } catch (error) { let failure = asFailure(error); deps.onError({ code: failure.code, message: failure.message, fingerprint: "" }); return; } if (bytes.length === 0) return; deps.onOutput(bytes); return; } if (type === "terminal.status") { let state = typeof message.state == "string" ? message.state : "disconnected"; deps.onState({ kind: state === "connected" || state === "connecting" || state === "disconnected" ? state : "disconnected", text: text(message.text) }); return; } if (type === "terminal.error") { let host = typeof message.host == "string" && message.host !== "" ? message.host : void 0, port = typeof message.port == "number" ? message.port : void 0; deps.onError({ code: text(message.code) || "terminal-error", message: text(message.message), fingerprint: text(message.fingerprint), ...host === void 0 ? {} : { host }, ...port === void 0 ? {} : { port } }); return; } if (type === "terminal.closed") { deps.onState({ kind: "disconnected", text: "" }), deps.onClosed(text(message.reason)); return; } if (type === "error") { deps.onError({ code: "frame-error", message: text(message.message), fingerprint: "" }); return; } type === "bye" && deps.onState({ kind: "disconnected", text: "" }); } }; } // src/platform/dsh/client/sessions.ts var TERMINAL_ID = "at-terminal-pane", RETAIN_LIMIT_BYTES = 4 * 1024 * 1024, RETAIN_LIMIT_CHUNKS = 2e4, RESET_BYTES = new Uint8Array( [..."\x1B[0m\x1B[2J\x1B[3J\x1B[H"].map((char) => char.charCodeAt(0)) ), sessions = /* @__PURE__ */ new Map(); function notify(session) { for (let listener of session.listeners) listener(); } var badges = /* @__PURE__ */ new Map(), badgeListeners = /* @__PURE__ */ new Set(); function publishTabBadge(key, badge) { if (key === "") return; let current = badges.get(key); if (!(current !== void 0 && current.label === badge.label && current.kind === badge.kind)) { badges.set(key, badge); for (let listener of badgeListeners) listener(); } } function clearTabBadge(key) { if (!(key === "" || !badges.delete(key))) for (let listener of badgeListeners) listener(); } function useTabBadge(key) { let [, bump] = import_react.default.useReducer((value) => value + 1, 0); return import_react.default.useEffect(() => { let listener = () => bump(); return badgeListeners.add(listener), () => { badgeListeners.delete(listener); }; }, []), key === "" ? void 0 : badges.get(key); } function createSession(key) { let session = { key, createdAt: Date.now(), serverId: "", page: "terminal", state: { kind: "idle", text: "" }, failure: null, reason: "", connectError: null, trusted: null, hostTerminalId: "", socket: null, flow: null, engine: null, opened: !1, retained: [], retainedBytes: 0, truncated: !1, listeners: /* @__PURE__ */ new Set(), autoConnected: !1, confirmedOpen: !1, frames: createTerminalFrameHandler({ requestOpen: () => { let size = engineSize(session); sendWs(session, { type: "terminal.open", id: TERMINAL_ID, serverId: session.serverId, rows: size.rows, cols: size.cols }); }, onOpened: (terminalId) => { session.opened = !0, session.state = { kind: "connected", text: "" }, session.failure = null, session.hostTerminalId = terminalId; let size = engineSize(session); sendWs(session, { type: "terminal.resize", id: TERMINAL_ID, rows: size.rows, cols: size.cols }), notify(session); }, onState: (state) => { session.state = state, notify(session); }, onOutput: (bytes) => { session.flow?.produced(bytes.length), consume(session, bytes); }, onError: (failure) => { session.failure = failure, session.state.kind === "connecting" && (session.state = { kind: "disconnected", text: "" }), notify(session); }, onClosed: (reason) => { session.state = { kind: "disconnected", text: "" }, session.reason = reason, notify(session); } }) }; return sessions.set(key, session), session; } function ensureSession(key) { return sessions.get(key) ?? createSession(key); } function useSession(key) { let session = ensureSession(key), [, bump] = import_react.default.useReducer((value) => value + 1, 0); return import_react.default.useEffect(() => { let listener = () => bump(); return session.listeners.add(listener), () => { session.listeners.delete(listener); }; }, [key]), session; } var SEED_TTL_MS = 3e3, seed = null; function stashSessionSeed(serverId) { let wanted = text(serverId); seed = wanted === "" ? null : { serverId: wanted, at: Date.now() }; } function takeSessionSeed(createdAt) { let held = seed; return held === null || Date.now() - held.at > SEED_TTL_MS || held.at > createdAt ? "" : (seed = null, held.serverId); } function adoptSessionTarget(session, serverId, source = "params") { let wanted = text(serverId); return wanted === "" || session.serverId === wanted ? !1 : session.serverId !== "" || session.autoConnected ? (postDiagnostic( "info", `at-terminal target-ignored key=${session.key} serverId=${wanted} source=${source} keeping=${session.serverId}`, "session", null, null ), !1) : (session.serverId = wanted, postDiagnostic( "info", `at-terminal target-adopted key=${session.key} serverId=${wanted} source=${source}`, "session", null, null ), notify(session), !0); } function maybeAutoConnect(session, serverId) { let wanted = text(serverId); wanted === "" || session.autoConnected || (session.autoConnected = !0, !(session.socket !== null || session.state.kind !== "idle") && (postDiagnostic( "info", `at-terminal auto-connect key=${session.key} serverId=${wanted}`, "session", null, null ), connectSession(session))); } function disposeSession(key, notifyHost = !0, why = "unspecified") { let session = sessions.get(key); if (session !== void 0) { postDiagnostic( "info", `at-terminal dispose key=${key} why=${why} socket=${session.socket === null ? "none" : "open"} state=${session.state.kind} target=${session.serverId}`, "session", null, null ), sessions.delete(key), teardown(session, notifyHost), clearTabBadge(key); for (let listener of session.listeners) listener(); session.listeners.clear(); } } function disposeAllSessions(why = "unload") { for (let key of [...sessions.keys()]) disposeSession(key, !0, why); } var openKeys = /* @__PURE__ */ new Set(); function retainSessions(tabs) { let open = /* @__PURE__ */ new Set(); for (let tab of tabs) { let contentId = tab.contentId; typeof contentId == "string" && contentId !== "" && open.add(contentId); } recordInventory(open); for (let [key, session] of [...sessions]) { if (open.has(key)) { session.confirmedOpen = !0; continue; } if (session.confirmedOpen) { if (session.signal !== void 0 && !session.signal.aborted) { postDiagnostic( "info", `at-terminal inventory-drop-ignored key=${key} (occurrence not aborted)`, "session", null, null ); continue; } disposeSession(key, !0, "inventory-reap"); } } } function recordInventory(open) { let next = [...open].sort().join(" "), previous = [...openKeys].sort().join(" "); openKeys.clear(); for (let key of open) openKeys.add(key); next !== previous && postDiagnostic("info", `at-terminal inventory [${next}]`, "session", null, null); } function retainSessionSignal(session, signal) { if (signal !== void 0) { if (session.signal === signal) { signal.aborted && closeOnSignalAbort(session); return; } session.signal = signal, signal.addEventListener("abort", () => closeOnSignalAbort(session)), signal.aborted && closeOnSignalAbort(session); } } function closeOnSignalAbort(session) { if (openKeys.has(session.key)) { postDiagnostic( "info", `at-terminal occurrence-abort-ignored key=${session.key} (tab still listed)`, "session", null, null ); return; } disposeSession(session.key, !1, "occurrence-abort"); } function setSessionTarget(session, serverId) { session.serverId !== serverId && (session.serverId = serverId, notify(session)); } function setSessionFailure(session, failure) { session.failure = failure, notify(session); } function setSessionPage(session, page) { session.page !== page && (session.page = page, notify(session)); } function sendWs(session, message) { let socket = session.socket; if (!(socket === null || socket.readyState !== 1)) try { socket.send(JSON.stringify(message)); } catch { } } function sendSessionInput(session, data) { data === "" || !session.opened || sendWs(session, { type: "terminal.input", id: TERMINAL_ID, data }); } function sendSessionResize(session, rows, cols) { session.opened && sendWs(session, { type: "terminal.resize", id: TERMINAL_ID, rows, cols }); } function engineSize(session) { let engine = session.engine; return engine !== null && engine.rows > 0 && engine.cols > 0 ? { rows: engine.rows, cols: engine.cols } : { rows: 24, cols: 80 }; } function dropRetainedHead(session, count2) { if (!(count2 <= 0)) { if (count2 >= session.retained.length) { session.retained = [], session.retainedBytes = 0; return; } session.retained.splice(0, count2); } } function consume(session, bytes) { if (session.retained.push(bytes), session.retainedBytes += bytes.length, session.retained.length > RETAIN_LIMIT_CHUNKS || session.retainedBytes > RETAIN_LIMIT_BYTES) { session.truncated = !0; let dropCount = 0, droppedBytes = 0; for (; (session.retained.length - dropCount > RETAIN_LIMIT_CHUNKS || session.retainedBytes - droppedBytes > RETAIN_LIMIT_BYTES) && dropCount < session.retained.length; ) droppedBytes += session.retained[dropCount].length, dropCount += 1; session.retainedBytes -= droppedBytes, dropRetainedHead(session, dropCount); } let engine = session.engine; engine !== null && engine.writeOutput(bytes, (byteLength) => session.flow?.rendered(byteLength)); } function teardown(session, notifyHost) { session.opened = !1, session.hostTerminalId = "", session.flow?.reset(), session.flow = null; let socket = session.socket; if (session.socket = null, socket !== null) { if (notifyHost) try { socket.readyState === 1 && socket.send(JSON.stringify({ type: "terminal.close", id: TERMINAL_ID })); } catch { } socket.onopen = null, socket.onmessage = null, socket.onerror = null, socket.onclose = null; try { socket.close(); } catch { } } } async function connectSession(session) { let wanted = text(session.serverId); if (wanted === "") { session.connectError = "terminal.pick", session.page = "terminal", notify(session); return; } session.serverId = wanted, session.connectError = null, session.failure = null, session.reason = "", session.trusted = null, session.page = "terminal", teardown(session, !1), session.retained = [], session.retainedBytes = 0, session.truncated = !1, notify(session); let pageLocation = typeof window > "u" ? void 0 : window.location, pageHasWebOrigin = pageLocation !== void 0 && (pageLocation.protocol === "http:" || pageLocation.protocol === "https:"), url; try { if (pageHasWebOrigin) url = resolveSocketUrl(pageLocation, null); else { let endpoints = await callRpc("channel.info", {}).catch(() => null); url = resolveSocketUrl(pageLocation, endpoints); } } catch (error) { session.state = { kind: "idle", text: "" }, session.connectError = asFailure(error).code === "no-origin" ? "terminal.noOrigin" : "terminal.noWsEndpoint", notify(session); return; } if (sessions.get(session.key) !== session) return; let WebSocketImpl = typeof window < "u" && typeof window.WebSocket == "function" ? window.WebSocket : void 0; if (WebSocketImpl === void 0) { session.state = { kind: "idle", text: "" }, session.connectError = "terminal.noWebSocket", notify(session); return; } session.flow = createFlowController({ onPauseChange: (paused) => sendWs(session, { type: "terminal.pause", id: TERMINAL_ID, paused }) }), session.state = { kind: "connecting", text: "" }, notify(session); let socket = new WebSocketImpl(url); session.socket = socket, socket.onopen = () => postDiagnostic("info", `at-terminal ws-open key=${session.key} url=${url}`, "session", null, null), socket.onmessage = (event) => session.frames.handle(event?.data), socket.onerror = () => { postDiagnostic("error", `at-terminal ws-error key=${session.key} url=${url}`, "session", null, null), session.opened = !1, session.failure = { code: "websocket-error", message: url, fingerprint: "" }, session.state = { kind: "disconnected", text: "" }, notify(session); }, socket.onclose = (event) => { session.socket === socket && (postDiagnostic( "info", `at-terminal ws-close key=${session.key} code=${String(event?.code ?? "?")} clean=${String(event?.wasClean ?? "?")} reason=${String(event?.reason ?? "")}`, "session", null, null ), session.socket = null, session.opened = !1, session.state.kind !== "disconnected" && (session.state = { kind: "disconnected", text: "" }), notify(session)); }; } function disconnectSession(session) { teardown(session, !0), session.state = { kind: "disconnected", text: "" }, session.reason = "", notify(session); } function attachEngine(session, engine) { session.engine = engine; let { retained, truncated } = session; truncated && engine.writeOutput(RESET_BYTES, () => { }); let BATCH_LIMIT = 64 * 1024, batchBuffer = [], batchBytes = 0, flushBatch = () => { if (batchBuffer.length !== 0) { if (batchBuffer.length === 1) { let b = batchBuffer[0]; engine.writeOutput(b, (byteLength) => session.flow?.rendered(byteLength)); } else { let merged = new Uint8Array(batchBytes), offset = 0; for (let piece of batchBuffer) merged.set(piece, offset), offset += piece.length; engine.writeOutput(merged, (byteLength) => session.flow?.rendered(byteLength)); } batchBuffer = [], batchBytes = 0; } }; for (let bytes of retained) batchBuffer.push(bytes), batchBytes += bytes.length, batchBytes >= BATCH_LIMIT && flushBatch(); flushBatch(), postDiagnostic( "info", `at-terminal replay key=${session.key} chunks=${retained.length} bytes=${session.retainedBytes} truncated=${String(truncated)}`, "session", null, null ), engine.fit(); } function detachEngine(session, engine) { session.engine === engine && (session.engine = null); } async function trustSessionHost(session) { let refused = session.failure; if (refused === null) return; let payload = await callRpc("terminal.trustHost", { serverId: text(session.serverId), fingerprint: text(refused.fingerprint), // The refused host, not the selected one: with a jump host these differ, and sending only // the serverId records the accepted key under the wrong address — which is what left the // bastion permanently untrusted while the store looked updated. ...refused.host === void 0 ? {} : { host: refused.host, ...refused.port === void 0 ? {} : { port: refused.port } } }) ?? {}; session.failure = null; let retry = connectSession(session); session.trusted = { host: text(payload.host), port: Number(payload.port) || 0 }, notify(session), await retry; } async function forgetSessionHost(session) { let refused = session.failure; if (refused === null) return; let payload = await callRpc("terminal.forgetHost", { serverId: text(session.serverId), ...refused.host === void 0 ? {} : { host: refused.host, ...refused.port === void 0 ? {} : { port: refused.port } } }) ?? {}; session.failure = null; let retry = connectSession(session); session.trusted = { host: text(payload.host), port: Number(payload.port) || 0 }, notify(session), await retry; } function refusedHostKey(session) { return session.failure !== null && session.failure.fingerprint !== "" ? session.failure : null; } // src/platform/dsh/client/views/shared.ts var import_react2 = __toESM(require("react"), 1); var h = import_react2.default.createElement, pendingState = { kind: "pending" }; function failedState(error) { return { kind: "failed", code: typeof error.code == "string" ? error.code : "client-error", message: String(error.message ?? "") }; } function renderFailure(t, failure) { return h( "div", { className: "att-banner", "data-at-terminal-error": failure.code }, h("div", null, t("error.title")), h("div", null, t(errorKey(failure.code))), h("div", null, t("error.detail", { code: failure.code, message: failure.message })) ); } function pathLabel(path, options = {}) { let { base, leaf } = splitPathForDisplay(path); return h( "span", { className: "att-dir", title: path, "data-at-terminal-path-truncated": options.truncated === !0 ? "true" : "false" }, h("span", { className: "att-dir-base" }, base), h("span", { className: "att-dir-leaf" }, leaf) ); } function navTabId(scope, mode) { return `at-tab-${scope}-${mode}`; } function navPanelId(mode) { return `at-panel-${mode}`; } function renderNav(t, mode, onMode, scope = "terminal") { let button = (value, key) => h( "button", { key: value, type: "button", className: "att-nav-btn", // `role="tab"` is what makes `aria-selected` meaningful; on a plain button the // attribute is inert, so the nav announced three unselected buttons. role: "tab", id: navTabId(scope, value), "aria-selected": mode === value, // Points at the panel this tab reveals. Both navs name the same two panels, which is // correct: the nav is repeated per page, the panels are not. "aria-controls": navPanelId(value), onClick: () => onMode(value), "data-at-terminal-action": `mode-${value}` }, t(key) ); return h( "div", { className: "att-nav", role: "tablist", "data-at-terminal-mode": mode }, button("terminal", "mode.terminal"), button("sftp", "mode.sftp") ); } // src/platform/dsh/client/views/assets.ts function toolbarButton(t, key, labelKey, onClick, disabled, primary = !1) { return h( "button", { key, type: "button", className: primary ? "att-btn primary" : "att-btn", disabled, onClick, "data-at-terminal-action": key }, t(labelKey) ); } function renderRow(t, server, props) { let selected = props.selectedId === text(server.id); return h( "div", { key: text(server.id), className: "att-row", role: "option", "aria-selected": selected, "data-at-terminal-row": text(server.id), onClick: () => props.onSelect(server), // A double-click opens a **terminal tab** for this server. The keyboard route to the same act // is the `atTerminal.newTab` shortcut; `role="option"` has no key gesture of its own, so // nothing here claims one. onDoubleClick: () => props.onOpenInNewTab(server), onContextMenu: (event) => props.onRowMenu(event, server) }, h("span", { className: "att-row-label" }, text(server.label)), h( "span", { className: "att-row-addr" }, `${text(server.username)}@${text(server.host)}:${count(server.port)}` ), h("span", { className: "att-badge" }, authLabel(t, server.authType)), server.hasPassword === !0 && server.authType === "password" ? h( "span", { className: "att-badge", "data-at-terminal-badge": "has-password" }, t("servers.hasPassword") ) : null ); } function renderPending(t, labelKey) { let label = t(labelKey); return h( "div", { key: "pending", className: "att-line att-pending", role: "status", "aria-live": "polite" }, h("span", { className: "att-spinner", role: "img", "aria-label": label }), h("span", { "aria-hidden": "true" }, label) ); } function renderList(t, props) { let nodes = [], state = props.serversState; if (state.kind === "pending") return nodes.push(renderPending(t, "servers.pending")), nodes; if (state.kind === "failed") return nodes.push(h("div", { key: "failed" }, renderFailure(t, state))), nodes; let servers = serverViews(state.result); if (props.savedLabel !== null && nodes.push( h( "div", { key: "saved", className: "att-line", "data-at-terminal-save": "ok" }, t("form.saved", { label: props.savedLabel }) ) ), props.removal.kind === "ok" && nodes.push( h( "div", { key: "removed", className: "att-line", "data-at-terminal-remove": "ok" }, props.removal.removed ? t("servers.removed", { label: props.removal.label }) : t("servers.removeMissing") ) ), props.removal.kind === "failed" && nodes.push(h("div", { key: "remove-failed" }, renderFailure(t, props.removal))), servers.length === 0) return nodes.push(h("div", { key: "empty", className: "att-hint" }, t("servers.empty"))), nodes; for (let group of groupServers(servers)) { let groupKey = group.name ?? "__ungrouped__", isCollapsed = props.collapsedGroups?.includes(groupKey) ?? !1; if (nodes.push( h( "div", { key: `group:${group.name ?? ""}`, className: "att-group-name", "data-at-terminal-group": group.name ?? "", "aria-expanded": !isCollapsed, onClick: () => props.onToggleGroup?.(groupKey) }, h("span", { className: "att-group-disclosure", "aria-hidden": "true" }, isCollapsed ? "\u25B6" : "\u25BC"), group.name === null ? t("servers.ungrouped") : group.name, h("span", { className: "att-group-count", "aria-hidden": "true" }, `(${group.servers.length})`) ) ), !isCollapsed) for (let server of group.servers) nodes.push(renderRow(t, server, props)); } return nodes.push(h("div", { key: "hint", className: "att-hint" }, t("servers.hint"))), nodes; } function renderStatusbar(t, summaryState) { if (summaryState.kind !== "ok") return h( "div", { className: "att-statusbar", role: "status", "data-at-terminal-summary": summaryState.kind }, summaryState.kind === "pending" ? t("summary.pending") : t("error.title") ); let result = summaryState.result ?? {}; return h( "div", { className: "att-statusbar", role: "status", "data-at-terminal-summary": "ok" }, h("span", { "data-at-terminal-summary-count": "servers" }, t("summary.servers", { count: count(result.servers) })), h("span", { "data-at-terminal-summary-count": "passwords" }, t("summary.passwords", { count: count(result.passwords) })), h("span", { "data-at-terminal-summary-count": "privateKeys" }, t("summary.privateKeys", { count: count(result.privateKeyFiles) })), // The label stays outside the path element so the path can be one `PathLabel` // with a dimmed directory and a primary-colored leaf; folding the sentence into // the same span would color the label as if it were part of the path. h( "span", { "data-at-terminal-summary-count": "directory" }, h("span", null, t("summary.directoryLabel")), result.privateKeyDirectory === "" || result.privateKeyDirectory === void 0 ? h("span", { className: "att-dir" }, t("sftp.pathUnknown")) : pathLabel(text(result.privateKeyDirectory)) ) ); } function renderAssetsView(props) { let { t } = props; return h( "div", { className: "att-page", key: "assets", hidden: props.hidden, // A region rather than a `tabpanel`: this page is the whole body of its own tab kind, not // one panel of a tablist. It used to claim `role="tabpanel"` for the removed page nav, and // an orphaned panel role is worse than none — it advertises a controller that is not there. role: "region", "aria-label": t("servers.title"), "data-at-terminal-page": "assets" }, h( "div", { className: "att-toolbar" }, h("div", { className: "att-spacer" }), props.copied !== null ? h("span", { className: "att-copied" }, props.copied) : null, toolbarButton(t, "new-server", "toolbar.new", props.onNew, props.busy, !0), toolbarButton(t, "import", "toolbar.import", props.onImport, props.busy), toolbarButton(t, "export", "toolbar.export", props.onExport, props.busy), toolbarButton(t, "refresh", "toolbar.refresh", props.onRefresh, props.busy) ), // Directly under the toolbar rather than in the list: the list may be mid-read or empty when // the gesture is refused, and a notice inside a region that failed to load is a notice nobody // reads. `role="status"` because it appears in response to an action. props.notice === null ? null : h( "div", { className: "att-banner", role: "status", "data-at-terminal-notice": "tab-refused" }, props.notice ), h("div", { className: "att-content", role: "listbox", "aria-label": t("servers.title") }, renderList(t, props)), renderStatusbar(t, props.summaryState) ); } // src/platform/dsh/client/views/dialogs.ts var focusOrigin = null, dialogRef = (node) => { if (node === null) { let origin = focusOrigin; focusOrigin = null, origin?.focus(); return; } if (focusOrigin === null) { let active = node.ownerDocument.activeElement; active instanceof HTMLElement && !node.contains(active) && (focusOrigin = active); } (node.querySelector("[data-modal-autofocus]") ?? node).focus(); }, TABBABLE = [ "a[href]", "button:not([disabled])", 'input:not([disabled]):not([type="hidden"])', "select:not([disabled])", "textarea:not([disabled])", '[tabindex]:not([tabindex^="-"])' ].join(","); function dialogKeydown(event, onClose) { if (event.key === "Escape") { event.stopPropagation(), onClose(); return; } if (event.key !== "Tab") return; let items = Array.from(event.currentTarget.querySelectorAll(TABBABLE)); if (items.length === 0) { event.preventDefault(); return; } let active = event.currentTarget.ownerDocument.activeElement, backward = event.shiftKey === !0, boundary = backward ? items[0] : items[items.length - 1]; (active === boundary || active === event.currentTarget) && (event.preventDefault(), (backward ? items[items.length - 1] : items[0]).focus()); } function overlay(key, title, body, actions, onClose) { return h( "div", { key, className: "att-overlay", onClick: (event) => { event.target === event.currentTarget && onClose(); }, "data-at-terminal-dialog": key }, h( "div", { className: "att-dialog", role: "dialog", "aria-modal": !0, "aria-label": title, // Focusable so the dialog can hold focus when it has no autofocus // target, and so Escape/Tab have an element to listen on. tabIndex: -1, ref: dialogRef, onKeyDown: (event) => dialogKeydown(event, onClose) }, h("h2", { className: "att-dialog-title" }, title), body, actions ) ); } function checkRow(t, key, labelKey, checked, disabled, onChange) { return h( "label", { key, className: "att-check" }, h("input", { type: "checkbox", checked, disabled, // Whether stored credentials leave the machine is an on/off capability, // not a selection among items, so it is announced as a switch. The // wrapping