(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("@angular/core"), require("@angular/common"), require("@angular/forms"), require("@ng-bootstrap/ng-bootstrap"), require("ngx-toastr"), require("@angular/animations"), require("tabby-core"), require("tabby-settings"), (function webpackLoadOptionalExternalModule() { try { return require("fs"); } catch(e) {} }()), require("rxjs"), require("readline"), require("stream"), require("os"));
	else if(typeof define === 'function' && define.amd)
		define(["@angular/core", "@angular/common", "@angular/forms", "@ng-bootstrap/ng-bootstrap", "ngx-toastr", "@angular/animations", "tabby-core", "tabby-settings", "fs", "rxjs", "readline", "stream", "os"], factory);
	else {
		var a = typeof exports === 'object' ? factory(require("@angular/core"), require("@angular/common"), require("@angular/forms"), require("@ng-bootstrap/ng-bootstrap"), require("ngx-toastr"), require("@angular/animations"), require("tabby-core"), require("tabby-settings"), (function webpackLoadOptionalExternalModule() { try { return require("fs"); } catch(e) {} }()), require("rxjs"), require("readline"), require("stream"), require("os")) : factory(root["@angular/core"], root["@angular/common"], root["@angular/forms"], root["@ng-bootstrap/ng-bootstrap"], root["ngx-toastr"], root["@angular/animations"], root["tabby-core"], root["tabby-settings"], root["fs"], root["rxjs"], root["readline"], root["stream"], root["os"]);
		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
	}
})(global, (__WEBPACK_EXTERNAL_MODULE__860__, __WEBPACK_EXTERNAL_MODULE__4358__, __WEBPACK_EXTERNAL_MODULE__7182__, __WEBPACK_EXTERNAL_MODULE__9765__, __WEBPACK_EXTERNAL_MODULE__6523__, __WEBPACK_EXTERNAL_MODULE__1448__, __WEBPACK_EXTERNAL_MODULE__7650__, __WEBPACK_EXTERNAL_MODULE__3700__, __WEBPACK_EXTERNAL_MODULE__2947__, __WEBPACK_EXTERNAL_MODULE__3961__, __WEBPACK_EXTERNAL_MODULE__4902__, __WEBPACK_EXTERNAL_MODULE__7748__, __WEBPACK_EXTERNAL_MODULE__4234__) => {
return /******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ 88
/*!***************************************************!*\
  !*** ../node_modules/object-is/implementation.js ***!
  \***************************************************/
(module) {

"use strict";


var numberIsNaN = function (value) {
  return value !== value;
};
module.exports = function is(a, b) {
  if (a === 0 && b === 0) {
    return 1 / a === 1 / b;
  }
  if (a === b) {
    return true;
  }
  if (numberIsNaN(a) && numberIsNaN(b)) {
    return true;
  }
  return false;
};

/***/ },

/***/ 142
/*!********************************************!*\
  !*** ./node_modules/zmodem.js/src/zcrc.js ***!
  \********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


const CRC32_MOD = __webpack_require__(/*! crc-32 */ 3651);
var Zmodem = module.exports;
Object.assign(Zmodem, __webpack_require__(/*! ./zerror */ 3478), __webpack_require__(/*! ./encode */ 6248));

//----------------------------------------------------------------------
// BEGIN adapted from crc-js by Johannes Rudolph

var _crctab;
const crc_width = 16,
  crc_polynomial = 0x1021,
  crc_castmask = 0xffff,
  crc_msbmask = 1 << crc_width - 1;
function _compute_crctab() {
  _crctab = new Array(256);
  var divident_shift = crc_width - 8;
  for (var divident = 0; divident < 256; divident++) {
    var currByte = divident << divident_shift & crc_castmask;
    for (var bit = 0; bit < 8; bit++) {
      if ((currByte & crc_msbmask) !== 0) {
        currByte <<= 1;
        currByte ^= crc_polynomial;
      } else {
        currByte <<= 1;
      }
    }
    _crctab[divident] = currByte & crc_castmask;
  }
}

// END adapted from crc-js by Johannes Rudolph
//----------------------------------------------------------------------

function _updcrc(cp, crc) {
  if (!_crctab) _compute_crctab();
  return _crctab[crc >> 8 & 255] ^ (255 & crc) << 8 ^ cp;
}
function __verify(expect, got) {
  var err;
  if (expect.join() !== got.join()) {
    throw new Zmodem.Error("crc", got, expect);
  }
}

//TODO: use external implementation(s)
Zmodem.CRC = {
  //https://www.lammertbies.nl/comm/info/crc-calculation.html
  //CRC-CCITT (XModem)

  /**
   * Deduce a given set of octet values’ CRC16, as per the CRC16
   * variant that ZMODEM uses (CRC-CCITT/XModem).
   *
   * @param {Array} octets - The array of octet values.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *
   * @returns {Array} crc - The CRC, expressed as an array of octet values.
   */
  crc16: function crc16(octet_nums) {
    var crc = octet_nums[0];
    for (var b = 1; b < octet_nums.length; b++) {
      crc = _updcrc(octet_nums[b], crc);
    }
    crc = _updcrc(0, _updcrc(0, crc));

    //a big-endian 2-byte sequence
    return Zmodem.ENCODELIB.pack_u16_be(crc);
  },
  /**
   * Deduce a given set of octet values’ CRC32.
   *
   * @param {Array} octets - The array of octet values.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *
   * @returns {Array} crc - The CRC, expressed as an array of octet values.
   */
  crc32: function crc32(octet_nums) {
    return Zmodem.ENCODELIB.pack_u32_le(CRC32_MOD.buf(octet_nums) >>> 0 //bit-shift to get unsigned
    );
  },
  /**
   * Verify a given set of octet values’ CRC16.
   * An exception is thrown on failure.
   *
   * @param {Array} bytes_arr - The array of octet values.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *
   * @param {Array} crc - The CRC to check against, expressed as
   *      an array of octet values.
   */
  verify16: function verify16(bytes_arr, got) {
    return __verify(this.crc16(bytes_arr), got);
  },
  /**
   * Verify a given set of octet values’ CRC32.
   * An exception is thrown on failure.
   *
   * @param {Array} bytes_arr - The array of octet values.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *
   * @param {Array} crc - The CRC to check against, expressed as
   *      an array of octet values.
   */
  verify32: function verify32(bytes_arr, crc) {
    try {
      __verify(this.crc32(bytes_arr), crc);
    } catch (err) {
      err.input = bytes_arr.slice(0);
      throw err;
    }
  }
};

/***/ },

/***/ 161
/*!**************************************************************!*\
  !*** ./src/components/searchPanel.component.scss?ngResource ***!
  \**************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {


        var result = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./searchPanel.component.scss?ngResource */ 8093);

        if (result && result.__esModule) {
            result = result.default;
        }

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ },

/***/ 204
/*!****************************************************************************!*\
  !*** ./src/components/colorSchemeSettingsForMode.component.pug?ngResource ***!
  \****************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/colorSchemeSettingsForMode.component.pug?ngResource */ 8201);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 438
/*!**************************************************!*\
  !*** ../app/node_modules/function-bind/index.js ***!
  \**************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var implementation = __webpack_require__(/*! ./implementation */ 8862);
module.exports = Function.prototype.bind || implementation;

/***/ },

/***/ 442
/*!*********************************************************!*\
  !*** ../node_modules/css-loader/dist/runtime/getUrl.js ***!
  \*********************************************************/
(module) {

"use strict";


module.exports = function (url, options) {
  if (!options) {
    options = {};
  }
  if (!url) {
    return url;
  }
  url = String(url.__esModule ? url.default : url);

  // If url is already wrapped in quotes, remove them
  if (/^['"].*['"]$/.test(url)) {
    url = url.slice(1, -1);
  }
  if (options.hash) {
    url += options.hash;
  }

  // Should url be wrapped?
  // See https://drafts.csswg.org/css-values-3/#urls
  if (/["'() \t\n]|(%20)/.test(url) || options.needQuotes) {
    return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, "\\n"), "\"");
  }
  return url;
};

/***/ },

/***/ 474
/*!************************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/colorSchemePreview.component.pug?ngResource ***!
  \************************************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cdiv class=\"preview\" [style.font-family]=\"getPreviewFontFamily()\" [style.font-size]=\"(fontPreview ? config.store.terminal.fontSize : 11) + &quot;px&quot;\" [style.font-weight]=\"config.store.terminal.fontWeight\" [style.background-color]=\"scheme.background\" [style.color]=\"scheme.foreground\" [style.font-feature-settings]=\"'&quot;liga&quot; ' + config.store.terminal.ligatures ? 1 : 0\" [style.font-variant-ligatures]=\"config.store.terminal.ligatures ? &quot;initial&quot; : &quot;none&quot;\"\u003E\n  \u003Cdiv\u003E\u003Cspan [style.color]=\"scheme.colors[2]\"\u003Ejohn\u003C\u002Fspan\u003E\u003Cspan [style.color]=\"scheme.colors[6]\"\u003E@\u003C\u002Fspan\u003E\u003Cspan [style.color]=\"scheme.colors[4]\"\u003Edoe-pc\u003C\u002Fspan\u003E\u003Cstrong [style.color]=\"scheme.colors[1]\" [style.font-weight]=\"config.store.terminal.fontWeightBold\"\u003E$\u003C\u002Fstrong\u003E\u003Cspan\u003E ls\u003C\u002Fspan\u003E\u003Cspan [style.background-color]=\"scheme.cursor\"\u003E&nbsp;\u003C\u002Fspan\u003E\u003C\u002Fdiv\u003E\n  \u003Cdiv\u003E\u003Cspan\u003E-rwxr-xr-x  1 root\u003C\u002Fspan\u003E\u003Cstrong [style.color]=\"scheme.colors[3]\" [style.font-weight]=\"config.store.terminal.fontWeightBold\"\u003E Documents\u003C\u002Fstrong\u003E\u003C\u002Fdiv\u003E\n  \u003Cdiv\u003E\u003Cspan\u003E-rwxr-xr-x  1 root&nbsp;\u003C\u002Fspan\u003E\u003Cstrong [style.color]=\"scheme.colors[0]\" [style.background]=\"scheme.colors[2]\" [style.font-weight]=\"config.store.terminal.fontWeightBold\"\u003EDownloads\u003C\u002Fstrong\u003E\u003C\u002Fdiv\u003E\n  \u003Cdiv\u003E\u003Cspan\u003E-rwxr-xr-x  1 root&nbsp;\u003C\u002Fspan\u003E\u003Cstrong [style.color]=\"scheme.colors[0]\" [style.background]=\"scheme.colors[8]\" [style.font-weight]=\"config.store.terminal.fontWeightBold\"\u003EPictures\u003C\u002Fstrong\u003E\u003C\u002Fdiv\u003E\n  \u003Cdiv\u003E\u003Cspan\u003E-rwxr-xr-x  1 root\u003C\u002Fspan\u003E\u003Cstrong [style.color]=\"scheme.colors[12]\" [style.font-weight]=\"config.store.terminal.fontWeightBold\"\u003E Music\u003C\u002Fstrong\u003E\u003C\u002Fdiv\u003E\n  \u003Cdiv *ngIf=\"fontPreview\"\u003E\u003Cspan\u003E-rwxr-xr-x  1 root\u003C\u002Fspan\u003E\u003Cspan [style.color]=\"scheme.colors[2]\"\u003E 実行可能ファイル\u003C\u002Fspan\u003E\u003C\u002Fdiv\u003E\n  \u003Cdiv *ngIf=\"fontPreview\"\u003E\u003Cspan\u003E-rwxr-xr-x  1 root\u003C\u002Fspan\u003E\u003Cspan [style.color]=\"scheme.colors[6]\"\u003E sym\u003C\u002Fspan\u003E\u003Cspan\u003E -\u003E\u003C\u002Fspan\u003E\u003Cspan [style.color]=\"scheme.colors[1]\"\u003E link\u003C\u002Fspan\u003E\u003C\u002Fdiv\u003E\n  \u003Cdiv *ngIf=\"fontPreview\"\u003E\u003Cspan\u003E\u003Cstrong [style.font-weight]=\"config.store.terminal.fontWeightBold\"\u003EIcons:\u003C\u002Fstrong\u003E\u003Cspan\u003E   \u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003Cspan\u003E\u003Cspan\u003E &nbsp;\u003C\u002Fspan\u003E\u003Cspan [style.background-color]=\"scheme.colors[1]\" [style.color]=\"scheme.colors[0]\"\u003E Powerline&nbsp;\u003C\u002Fspan\u003E\u003Cspan [style.color]=\"scheme.colors[1]\"\u003E\u003C\u002Fspan\u003E\u003C\u002Fspan\u003E\u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 582
/*!*******************************************!*\
  !*** ./node_modules/ansi-colors/index.js ***!
  \*******************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);

/* eslint-disable no-control-regex */
// this is a modified version of https://github.com/chalk/ansi-regex (MIT License)
const ANSI_REGEX = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g;
const hasColor = () => {
  if (typeof process !== 'undefined') {
    return process.env.FORCE_COLOR !== '0';
  }
  return false;
};
const create = () => {
  const colors = {
    enabled: hasColor(),
    visible: true,
    styles: {},
    keys: {}
  };
  const ansi = style => {
    let open = style.open = `\u001b[${style.codes[0]}m`;
    let close = style.close = `\u001b[${style.codes[1]}m`;
    let regex = style.regex = new RegExp(`\\u001b\\[${style.codes[1]}m`, 'g');
    style.wrap = (input, newline) => {
      if (input.includes(close)) input = input.replace(regex, close + open);
      let output = open + input + close;
      // see https://github.com/chalk/chalk/pull/92, thanks to the
      // chalk contributors for this fix. However, we've confirmed that
      // this issue is also present in Windows terminals
      return newline ? output.replace(/\r*\n/g, `${close}$&${open}`) : output;
    };
    return style;
  };
  const wrap = (style, input, newline) => {
    return typeof style === 'function' ? style(input) : style.wrap(input, newline);
  };
  const style = (input, stack) => {
    if (input === '' || input == null) return '';
    if (colors.enabled === false) return input;
    if (colors.visible === false) return '';
    let str = '' + input;
    let nl = str.includes('\n');
    let n = stack.length;
    if (n > 0 && stack.includes('unstyle')) {
      stack = [...new Set(['unstyle', ...stack])].reverse();
    }
    while (n-- > 0) str = wrap(colors.styles[stack[n]], str, nl);
    return str;
  };
  const define = (name, codes, type) => {
    colors.styles[name] = ansi({
      name,
      codes
    });
    let keys = colors.keys[type] || (colors.keys[type] = []);
    keys.push(name);
    Reflect.defineProperty(colors, name, {
      configurable: true,
      enumerable: true,
      set(value) {
        colors.alias(name, value);
      },
      get() {
        let color = input => style(input, color.stack);
        Reflect.setPrototypeOf(color, colors);
        color.stack = this.stack ? this.stack.concat(name) : [name];
        return color;
      }
    });
  };
  define('reset', [0, 0], 'modifier');
  define('bold', [1, 22], 'modifier');
  define('dim', [2, 22], 'modifier');
  define('italic', [3, 23], 'modifier');
  define('underline', [4, 24], 'modifier');
  define('inverse', [7, 27], 'modifier');
  define('hidden', [8, 28], 'modifier');
  define('strikethrough', [9, 29], 'modifier');
  define('black', [30, 39], 'color');
  define('red', [31, 39], 'color');
  define('green', [32, 39], 'color');
  define('yellow', [33, 39], 'color');
  define('blue', [34, 39], 'color');
  define('magenta', [35, 39], 'color');
  define('cyan', [36, 39], 'color');
  define('white', [37, 39], 'color');
  define('gray', [90, 39], 'color');
  define('grey', [90, 39], 'color');
  define('bgBlack', [40, 49], 'bg');
  define('bgRed', [41, 49], 'bg');
  define('bgGreen', [42, 49], 'bg');
  define('bgYellow', [43, 49], 'bg');
  define('bgBlue', [44, 49], 'bg');
  define('bgMagenta', [45, 49], 'bg');
  define('bgCyan', [46, 49], 'bg');
  define('bgWhite', [47, 49], 'bg');
  define('blackBright', [90, 39], 'bright');
  define('redBright', [91, 39], 'bright');
  define('greenBright', [92, 39], 'bright');
  define('yellowBright', [93, 39], 'bright');
  define('blueBright', [94, 39], 'bright');
  define('magentaBright', [95, 39], 'bright');
  define('cyanBright', [96, 39], 'bright');
  define('whiteBright', [97, 39], 'bright');
  define('bgBlackBright', [100, 49], 'bgBright');
  define('bgRedBright', [101, 49], 'bgBright');
  define('bgGreenBright', [102, 49], 'bgBright');
  define('bgYellowBright', [103, 49], 'bgBright');
  define('bgBlueBright', [104, 49], 'bgBright');
  define('bgMagentaBright', [105, 49], 'bgBright');
  define('bgCyanBright', [106, 49], 'bgBright');
  define('bgWhiteBright', [107, 49], 'bgBright');
  colors.ansiRegex = ANSI_REGEX;
  colors.hasColor = colors.hasAnsi = str => {
    colors.ansiRegex.lastIndex = 0;
    return typeof str === 'string' && str !== '' && colors.ansiRegex.test(str);
  };
  colors.alias = (name, color) => {
    let fn = typeof color === 'string' ? colors[color] : color;
    if (typeof fn !== 'function') {
      throw new TypeError('Expected alias to be the name of an existing color (string) or a function');
    }
    if (!fn.stack) {
      Reflect.defineProperty(fn, 'name', {
        value: name
      });
      colors.styles[name] = fn;
      fn.stack = [name];
    }
    Reflect.defineProperty(colors, name, {
      configurable: true,
      enumerable: true,
      set(value) {
        colors.alias(name, value);
      },
      get() {
        let color = input => style(input, color.stack);
        Reflect.setPrototypeOf(color, colors);
        color.stack = this.stack ? this.stack.concat(fn.stack) : fn.stack;
        return color;
      }
    });
  };
  colors.theme = custom => {
    if (!isObject(custom)) throw new TypeError('Expected theme to be an object');
    for (let name of Object.keys(custom)) {
      colors.alias(name, custom[name]);
    }
    return colors;
  };
  colors.alias('unstyle', str => {
    if (typeof str === 'string' && str !== '') {
      colors.ansiRegex.lastIndex = 0;
      return str.replace(colors.ansiRegex, '');
    }
    return '';
  });
  colors.alias('noop', str => str);
  colors.none = colors.clear = colors.noop;
  colors.stripColor = colors.unstyle;
  colors.symbols = __webpack_require__(/*! ./symbols */ 7603);
  colors.define = define;
  return colors;
};
module.exports = create();
module.exports.create = create;

/***/ },

/***/ 613
/*!*****************************************!*\
  !*** ../node_modules/isobject/index.js ***!
  \*****************************************/
(module) {

"use strict";
/*!
 * isobject <https://github.com/jonschlinkert/isobject>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */



module.exports = function isObject(val) {
  return val != null && typeof val === 'object' && Array.isArray(val) === false;
};

/***/ },

/***/ 658
/*!***********************************************************************!*\
  !*** ../node_modules/style-loader/dist/runtime/insertStyleElement.js ***!
  \***********************************************************************/
(module) {

"use strict";


/* istanbul ignore next  */
function insertStyleElement(options) {
  var element = document.createElement("style");
  options.setAttributes(element, options.attributes);
  options.insert(element, options.options);
  return element;
}
module.exports = insertStyleElement;

/***/ },

/***/ 681
/*!***********************************************!*\
  !*** ../app/node_modules/is-weakmap/index.js ***!
  \***********************************************/
(module) {

"use strict";


var $WeakMap = typeof WeakMap === 'function' && WeakMap.prototype ? WeakMap : null;
var $WeakSet = typeof WeakSet === 'function' && WeakSet.prototype ? WeakSet : null;
var exported;
if (!$WeakMap) {
  /** @type {import('.')} */
  // eslint-disable-next-line no-unused-vars
  exported = function isWeakMap(x) {
    // `WeakMap` is not present in this environment.
    return false;
  };
}
var $mapHas = $WeakMap ? $WeakMap.prototype.has : null;
var $setHas = $WeakSet ? $WeakSet.prototype.has : null;
if (!exported && !$mapHas) {
  /** @type {import('.')} */
  // eslint-disable-next-line no-unused-vars
  exported = function isWeakMap(x) {
    // `WeakMap` does not have a `has` method
    return false;
  };
}

/** @type {import('.')} */
module.exports = exported || function isWeakMap(x) {
  if (!x || typeof x !== 'object') {
    return false;
  }
  try {
    $mapHas.call(x, $mapHas);
    if ($setHas) {
      try {
        $setHas.call(x, $setHas);
      } catch (e) {
        return true;
      }
    }
    // @ts-expect-error TS can't figure out that $WeakMap is always truthy here
    return x instanceof $WeakMap; // core-js workaround, pre-v3
  } catch (e) {}
  return false;
};

/***/ },

/***/ 701
/*!*****************************************!*\
  !*** ./node_modules/zmodem.js/index.js ***!
  \*****************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


Object.assign(module.exports, __webpack_require__(/*! ./src/zsentry */ 3769));

/***/ },

/***/ 711
/*!*******************************************************************!*\
  !*** ../app/node_modules/call-bind-apply-helpers/functionCall.js ***!
  \*******************************************************************/
(module) {

"use strict";


/** @type {import('./functionCall')} */
module.exports = Function.prototype.call;

/***/ },

/***/ 743
/*!**************************************************!*\
  !*** ../app/node_modules/math-intrinsics/min.js ***!
  \**************************************************/
(module) {

"use strict";


/** @type {import('./min')} */
module.exports = Math.min;

/***/ },

/***/ 799
/*!*********************************************************************************************************************************************!*\
  !*** ../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./src/components/colorPicker.component.scss?ngResource ***!
  \*********************************************************************************************************************************************/
(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ 1333);
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ 5955);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ":host{display:inline-block}div{width:32px;height:32px;box-shadow:0 1px 1px rgba(0,0,0,.5);border:none;margin:5px 10px 5px 0;border-radius:2px;text-align:center;font-weight:bold;font-size:17px;display:inline-block;color:#fff;line-height:31px;text-shadow:0 1px 1px rgba(0,0,0,.5)}", "",{"version":3,"sources":["webpack://./src/components/colorPicker.component.scss"],"names":[],"mappings":"AAAA,MACI,oBAAA,CAGJ,IACI,UAAA,CACA,WAAA,CACA,mCAAA,CACA,WAAA,CACA,qBAAA,CACA,iBAAA,CACA,iBAAA,CACA,gBAAA,CACA,cAAA,CACA,oBAAA,CACA,UAAA,CACA,gBAAA,CACA,oCAAA","sourcesContent":[":host {\n    display: inline-block;\n}\n\ndiv {\n    width: 32px;\n    height: 32px;\n    box-shadow: 0 1px 1px rgba(0,0,0,.5);\n    border: none;\n    margin: 5px 10px 5px 0;\n    border-radius: 2px;\n    text-align: center;\n    font-weight: bold;\n    font-size: 17px;\n    display: inline-block;\n    color: #fff;\n    line-height: 31px;\n    text-shadow: 0 1px 1px rgba(0,0,0,.5);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ },

/***/ 803
/*!*****************************************************!*\
  !*** ./node_modules/hexer/chunked_hex_transform.js ***!
  \*****************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var util = __webpack_require__(/*! util */ 9023);
var HexTransform = __webpack_require__(/*! ./hex_transform */ 7840);
function ChunkedHexTransform(options) {
  if (!(this instanceof ChunkedHexTransform)) {
    return new ChunkedHexTransform(options);
  }
  // istanbul ignore next
  if (!options) options = {};
  HexTransform.call(this, options);
  var self = this;
  if (typeof options.header === 'function') {
    self.header = options.header;
  } else if (typeof options.header === 'object') {
    self.header = simpleHeader(options.header);
  } else if (typeof options.header === 'string') {
    self.header = simpleHeader({
      label: options.header
    });
  } else {
    self.header = simpleHeader();
  }
  self.chunkNum = 0;
}
util.inherits(ChunkedHexTransform, HexTransform);
ChunkedHexTransform.prototype._transform = function transform(chunk, encoding, done) {
  var self = this;
  // istanbul ignore next
  if (self.totalOffset) {
    self.reset();
  }
  ++self.chunkNum;
  var header = self.header(self.chunkNum, chunk);
  if (header.length) {
    self.push(header);
  }
  HexTransform.prototype._transform.call(self, chunk, encoding, function subDone(err) {
    self.reset();
    done(err);
  });
};
function simpleHeader(opts) {
  opts = opts || {};
  var fmt = '-- ';
  if (opts.label) fmt += opts.label + ' ';
  fmt += 'chunk[%s] length: %s (0x%s)\n';
  return function header(chunkNum, chunk) {
    var len = chunk.length;
    var hexlen = len.toString(16);
    return util.format(fmt, chunkNum, len, hexlen);
  };
}
module.exports = ChunkedHexTransform;

/***/ },

/***/ 830
/*!********************************!*\
  !*** ./src/icons/arrow-up.svg ***!
  \********************************/
(module) {

module.exports = "<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fal\" data-icon=\"arrow-up\" class=\"svg-inline--fa fa-arrow-up\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><path fill=\"currentColor\" d=\"M379.8 225.7C376.7 229.3 372.3 231.1 368 231.1c-3.844 0-7.703-1.426-10.77-4.31L208 86.12v377.3c0 9.171-7.156 16.59-15.1 16.59S176 472.6 176 463.4V86.12l-149.2 140.7C20.25 232.1 10.14 232.5 4.156 225.7C-1.781 218.9-1.297 208.4 5.234 202.2l176-165.9c6.094-5.768 15.44-5.768 21.53 0l176 165.9C385.3 208.4 385.8 218.9 379.8 225.7z\"></path></svg>"

/***/ },

/***/ 860
/*!********************************!*\
  !*** external "@angular/core" ***!
  \********************************/
(module) {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__860__;

/***/ },

/***/ 882
/*!*********************************************************************!*\
  !*** ./src/components/colorSchemeSelector.component.pug?ngResource ***!
  \*********************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/colorSchemeSelector.component.pug?ngResource */ 6925);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 947
/*!*************************************************************!*\
  !*** ../app/node_modules/has-property-descriptors/index.js ***!
  \*************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var $defineProperty = __webpack_require__(/*! es-define-property */ 5832);
var hasPropertyDescriptors = function hasPropertyDescriptors() {
  return !!$defineProperty;
};
hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
  // node v0.6 has a bug where array lengths can be Set but not Defined
  if (!$defineProperty) {
    return null;
  }
  try {
    return $defineProperty([], 'length', {
      value: 1
    }).length !== 1;
  } catch (e) {
    // In Firefox 4-22, defining length on an array throws an exception.
    return true;
  }
};
module.exports = hasPropertyDescriptors;

/***/ },

/***/ 954
/*!****************************************************!*\
  !*** ../app/node_modules/math-intrinsics/isNaN.js ***!
  \****************************************************/
(module) {

"use strict";


/** @type {import('./isNaN')} */
module.exports = Number.isNaN || function isNaN(a) {
  return a !== a;
};

/***/ },

/***/ 988
/*!***********************************************************!*\
  !*** ../app/node_modules/available-typed-arrays/index.js ***!
  \***********************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var possibleNames = __webpack_require__(/*! possible-typed-array-names */ 9041);
var g = typeof globalThis === 'undefined' ? global : globalThis;

/** @type {import('.')} */
module.exports = function availableTypedArrays() {
  var /** @type {ReturnType<typeof availableTypedArrays>} */out = [];
  for (var i = 0; i < possibleNames.length; i++) {
    if (typeof g[possibleNames[i]] === 'function') {
      // @ts-expect-error
      out[out.length] = possibleNames[i];
    }
  }
  return out;
};

/***/ },

/***/ 1045
/*!****************************!*\
  !*** ./src/icons/case.svg ***!
  \****************************/
(module) {

module.exports = "<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fal\" data-icon=\"text-size\" class=\"svg-inline--fa fa-text-size\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 512\"><path fill=\"currentColor\" d=\"M0 48l0 96C0 152.8 7.156 160 16 160S32 152.8 32 144V64h144v384h-64C103.2 448 96 455.2 96 464S103.2 480 112 480h160C280.8 480 288 472.8 288 464S280.8 448 272 448h-64V64H352v80C352 152.8 359.2 160 368 160S384 152.8 384 144v-96C384 39.16 376.8 32 368 32h-352C7.156 32 0 39.16 0 48zM320 240v64c0 8.844 7.156 16 16 16S352 312.8 352 304V256h112v192H416c-8.844 0-16 7.156-16 16S407.2 480 416 480h128c8.844 0 16-7.156 16-16S552.8 448 544 448h-48V256H608v48c0 8.844 7.156 16 16 16S640 312.8 640 304v-64C640 231.2 632.8 224 624 224h-288C327.2 224 320 231.2 320 240z\"></path></svg>"

/***/ },

/***/ 1055
/*!***********************************************!*\
  !*** ../node_modules/es-get-iterator/node.js ***!
  \***********************************************/
(module) {

"use strict";


// this should only run in node >= 13.2, so it
// does not need any of the intense fallbacks that old node/browsers do
var $iterator = Symbol.iterator;
module.exports = function getIterator(iterable) {
  // alternatively, `iterable[$iterator]?.()`
  if (iterable != null && typeof iterable[$iterator] !== 'undefined') {
    return iterable[$iterator]();
  }
};

/***/ },

/***/ 1243
/*!*****************************************!*\
  !*** ../node_modules/object-is/shim.js ***!
  \*****************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var getPolyfill = __webpack_require__(/*! ./polyfill */ 4301);
var define = __webpack_require__(/*! define-properties */ 2445);
module.exports = function shimObjectIs() {
  var polyfill = getPolyfill();
  define(Object, {
    is: polyfill
  }, {
    is: function testObjectIs() {
      return Object.is !== polyfill;
    }
  });
  return polyfill;
};

/***/ },

/***/ 1284
/*!*****************************************!*\
  !*** ../app/node_modules/gopd/index.js ***!
  \*****************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


/** @type {import('.')} */
var $gOPD = __webpack_require__(/*! ./gOPD */ 4448);
if ($gOPD) {
  try {
    $gOPD([], 'length');
  } catch (e) {
    // IE 8 has a broken gOPD
    $gOPD = null;
  }
}
module.exports = $gOPD;

/***/ },

/***/ 1290
/*!**************************************************************************************************************************************!*\
  !*** ../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./src/components/baseTerminalTab.component.scss ***!
  \**************************************************************************************************************************************/
(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ 1333);
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ 5955);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ":host{flex:auto;display:flex;flex-direction:column;position:relative}:host>.content{flex:auto;position:relative;display:block;overflow:hidden;margin:max(0px,30px*var(--spaciness) - 15px);transition:opacity ease-out .25s;opacity:0}:host>.content div[style]:last-child{background:#000 !important;color:#fff !important}:host>terminal-toolbar{position:absolute;top:0;left:0;right:0;z-index:4;opacity:0;transition:.25s opacity;will-change:transform;transform:translate(0, -100px);transition:.25s transform ease-out;height:40px}:host.toolbar-revealed>terminal-toolbar,:host.toolbar-pinned>terminal-toolbar{opacity:1;transform:translate(0, 0)}:host>.toolbar-pin-button{position:absolute;right:34px;top:5px;z-index:4;background:rgba(0,0,0,.2784313725)}:host.toolbar-pinned>.terminal-toolbar-spacer{width:100%;height:40px}:host-context(.with-title-inset){padding-top:20px}:host-context(.with-title-inset) terminal-toolbar{padding-left:90px}", "",{"version":3,"sources":["webpack://./src/components/baseTerminalTab.component.scss"],"names":[],"mappings":"AAAA,MACI,SAAA,CACA,YAAA,CACA,qBAAA,CAEA,iBAAA,CAEA,eACI,SAAA,CACA,iBAAA,CACA,aAAA,CACA,eAAA,CACA,4CAAA,CACA,gCAAA,CACA,SAAA,CAEA,qCACI,0BAAA,CACA,qBAAA,CAMR,uBACI,iBAAA,CACA,KAAA,CACA,MAAA,CACA,OAAA,CACA,SAAA,CAEA,SAAA,CACA,uBAAA,CACA,qBAAA,CACA,8BAAA,CACA,kCAAA,CACA,WAdY,CAkBZ,8EACI,SAAA,CACA,yBAAA,CAIR,0BACI,iBAAA,CACA,UAAA,CACA,OAAA,CACA,SAAA,CACA,kCAAA,CAGJ,8CACI,UAAA,CACA,WAlCY,CAsCpB,iCACI,gBAAA,CAEA,kDACI,iBAAA","sourcesContent":[":host {\n    flex: auto;\n    display: flex;\n    flex-direction: column;\n    // overflow: hidden;\n    position: relative;\n\n    &> .content {\n        flex: auto;\n        position: relative;\n        display: block;\n        overflow: hidden;\n        margin: calc(max(0px, 30px * var(--spaciness) - 15px));\n        transition: opacity ease-out 0.25s;\n        opacity: 0;\n\n        div[style]:last-child {\n            background: black !important;\n            color: white !important;\n        }\n    }\n\n    $toolbarHeight: 40px;\n\n    > terminal-toolbar {\n        position: absolute;\n        top: 0;\n        left: 0;\n        right: 0;\n        z-index: 4;\n\n        opacity: 0;\n        transition: 0.25s opacity;\n        will-change: transform;\n        transform: translate(0, -100px);\n        transition: 0.25s transform ease-out;\n        height: $toolbarHeight;\n    }\n\n    &.toolbar-revealed, &.toolbar-pinned {\n        > terminal-toolbar {\n            opacity: 1;\n            transform: translate(0, 0);\n        }\n    }\n\n    > .toolbar-pin-button {\n        position: absolute;\n        right: 34px;\n        top: 5px;\n        z-index: 4;\n        background: #00000047;\n    }\n\n    &.toolbar-pinned > .terminal-toolbar-spacer {\n        width: 100%;\n        height: $toolbarHeight;\n    }\n}\n\n:host-context(.with-title-inset) {\n    padding-top: 20px;\n\n    terminal-toolbar {\n        padding-left: 90px;\n    }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ },

/***/ 1333
/*!*************************************************************!*\
  !*** ../node_modules/css-loader/dist/runtime/sourceMaps.js ***!
  \*************************************************************/
(module) {

"use strict";


module.exports = function (item) {
  var content = item[1];
  var cssMapping = item[3];
  if (!cssMapping) {
    return content;
  }
  if (typeof btoa === "function") {
    var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
    var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
    var sourceMapping = "/*# ".concat(data, " */");
    return [content].concat([sourceMapping]).join("\n");
  }
  return [content].join("\n");
};

/***/ },

/***/ 1448
/*!**************************************!*\
  !*** external "@angular/animations" ***!
  \**************************************/
(module) {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__1448__;

/***/ },

/***/ 1476
/*!*********************************************!*\
  !*** ../app/node_modules/is-regex/index.js ***!
  \*********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var callBound = __webpack_require__(/*! call-bound */ 4731);
var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ 6565)();
var hasOwn = __webpack_require__(/*! hasown */ 1766);
var gOPD = __webpack_require__(/*! gopd */ 1284);

/** @type {import('.')} */
var fn;
if (hasToStringTag) {
  /** @type {(receiver: ThisParameterType<typeof RegExp.prototype.exec>, ...args: Parameters<typeof RegExp.prototype.exec>) => ReturnType<typeof RegExp.prototype.exec>} */
  var $exec = callBound('RegExp.prototype.exec');
  /** @type {object} */
  var isRegexMarker = {};
  var throwRegexMarker = function () {
    throw isRegexMarker;
  };
  /** @type {{ toString(): never, valueOf(): never, [Symbol.toPrimitive]?(): never }} */
  var badStringifier = {
    toString: throwRegexMarker,
    valueOf: throwRegexMarker
  };
  if (typeof Symbol.toPrimitive === 'symbol') {
    badStringifier[Symbol.toPrimitive] = throwRegexMarker;
  }

  /** @type {import('.')} */
  // @ts-expect-error TS can't figure out that the $exec call always throws
  // eslint-disable-next-line consistent-return
  fn = function isRegex(value) {
    if (!value || typeof value !== 'object') {
      return false;
    }

    // eslint-disable-next-line no-extra-parens
    var descriptor = /** @type {NonNullable<typeof gOPD>} */gOPD(/** @type {{ lastIndex?: unknown }} */value, 'lastIndex');
    var hasLastIndexDataProperty = descriptor && hasOwn(descriptor, 'value');
    if (!hasLastIndexDataProperty) {
      return false;
    }
    try {
      // eslint-disable-next-line no-extra-parens
      $exec(value, /** @type {string} */ /** @type {unknown} */badStringifier);
    } catch (e) {
      return e === isRegexMarker;
    }
  };
} else {
  /** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
  var $toString = callBound('Object.prototype.toString');
  /** @const @type {'[object RegExp]'} */
  var regexClass = '[object RegExp]';

  /** @type {import('.')} */
  fn = function isRegex(value) {
    // In older browsers, typeof regex incorrectly returns 'function'
    if (!value || typeof value !== 'object' && typeof value !== 'function') {
      return false;
    }
    return $toString(value) === regexClass;
  };
}
module.exports = fn;

/***/ },

/***/ 1488
/*!*******************************************!*\
  !*** ../app/node_modules/uuid/lib/rng.js ***!
  \*******************************************/
(module, __unused_webpack_exports, __webpack_require__) {

// Unique ID creation requires a high quality random # generator.  In node.js
// this is pretty straight-forward - we use the crypto API.

var crypto = __webpack_require__(/*! crypto */ 6982);
module.exports = function nodeRNG() {
  return crypto.randomBytes(16);
};

/***/ },

/***/ 1514
/*!*******************************************************************************************************************************************************!*\
  !*** ../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./src/components/appearanceSettingsTab.component.scss?ngResource ***!
  \*******************************************************************************************************************************************************/
(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ 1333);
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ 5955);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, "color-scheme-preview{flex-shrink:0;margin-bottom:20px}textarea{font-family:\"Source Code Pro\",monospace;min-height:120px}.font-size-input{width:100px;flex:none}", "",{"version":3,"sources":["webpack://./src/components/appearanceSettingsTab.component.scss"],"names":[],"mappings":"AAAA,qBACI,aAAA,CACA,kBAAA,CAGJ,SACI,uCAAA,CACA,gBAAA,CAGJ,iBACI,WAAA,CACA,SAAA","sourcesContent":["color-scheme-preview {\n    flex-shrink: 0;\n    margin-bottom: 20px;\n}\n\ntextarea {\n    font-family: 'Source Code Pro', monospace;\n    min-height: 120px;\n}\n\n.font-size-input {\n    width: 100px;\n    flex: none;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ },

/***/ 1578
/*!*********************************************!*\
  !*** ../app/node_modules/es-errors/eval.js ***!
  \*********************************************/
(module) {

"use strict";


/** @type {import('./eval')} */
module.exports = EvalError;

/***/ },

/***/ 1625
/*!**********************************************************!*\
  !*** ../app/node_modules/regexp.prototype.flags/shim.js ***!
  \**********************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var supportsDescriptors = (__webpack_require__(/*! define-properties */ 2445).supportsDescriptors);
var getPolyfill = __webpack_require__(/*! ./polyfill */ 6919);
var gOPD = __webpack_require__(/*! gopd */ 1284);
var defineProperty = Object.defineProperty;
var $TypeError = __webpack_require__(/*! es-errors */ 8458);
var getProto = __webpack_require__(/*! get-proto */ 3077);
var regex = /a/;
module.exports = function shimFlags() {
  if (!supportsDescriptors || !getProto) {
    throw new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');
  }
  var polyfill = getPolyfill();
  var proto = getProto(regex);
  var descriptor = gOPD(proto, 'flags');
  if (!descriptor || descriptor.get !== polyfill) {
    defineProperty(proto, 'flags', {
      configurable: true,
      enumerable: false,
      get: polyfill
    });
  }
  return polyfill;
};

/***/ },

/***/ 1638
/*!**************************************************!*\
  !*** ./node_modules/zmodem.js/src/zsubpacket.js ***!
  \**************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var Zmodem = module.exports;
Object.assign(Zmodem, __webpack_require__(/*! ./zcrc */ 142), __webpack_require__(/*! ./zdle */ 6563), __webpack_require__(/*! ./zmlib */ 3568), __webpack_require__(/*! ./zerror */ 3478));
const ZCRCE = 0x68,
  // 'h', 104, frame ends, header packet follows
  ZCRCG = 0x69,
  // 'i', 105, frame continues nonstop
  ZCRCQ = 0x6a,
  // 'j', 106, frame continues, ZACK expected
  ZCRCW = 0x6b // 'k', 107, frame ends, ZACK expected
;
var SUBPACKET_BUILDER;

/** Class that represents a ZMODEM data subpacket. */
Zmodem.Subpacket = class ZmodemSubpacket {
  /**
   * Build a Subpacket subclass given a payload and frame end string.
   *
   * @param {Array} octets - The octet values to parse.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *
   * @param {string} frameend - One of:
   * - `no_end_no_ack`
   * - `end_no_ack`
   * - `no_end_ack` (unused currently)
   * - `end_ack`
   *
   * @returns {Subpacket} An instance of the appropriate Subpacket subclass.
   */
  static build(octets, frameend) {
    //TODO: make this better
    var Ctr = SUBPACKET_BUILDER[frameend];
    if (!Ctr) {
      throw "No subpacket type “" + frameend + "” is defined! Try one of: " + Object.keys(SUBPACKET_BUILDER).join(", ");
    }
    return new Ctr(octets);
  }

  /**
   * Return the octet values array that represents the object
   * encoded with a 16-bit CRC.
   *
   * @param {ZDLE} zencoder - A ZDLE instance to use for ZDLE encoding.
   *
   * @returns {number[]} An array of octet values suitable for sending
   *      as binary data.
   */
  encode16(zencoder) {
    return this._encode(zencoder, Zmodem.CRC.crc16);
  }

  /**
   * Return the octet values array that represents the object
   * encoded with a 32-bit CRC.
   *
   * @param {ZDLE} zencoder - A ZDLE instance to use for ZDLE encoding.
   *
   * @returns {number[]} An array of octet values suitable for sending
   *      as binary data.
   */
  encode32(zencoder) {
    return this._encode(zencoder, Zmodem.CRC.crc32);
  }

  /**
   * Return the subpacket payload’s octet values.
   *
   * NOTE: For speed, this returns the actual data in the subpacket;
   * if you mutate this return value, you alter the Subpacket object
   * internals. This is OK if you won’t need the Subpacket anymore, but
   * just be careful.
   *
   * @returns {number[]} The subpacket’s payload, represented as an
   * array of octet values. **DO NOT ALTER THIS ARRAY** unless you
   * no longer need the Subpacket.
   */
  get_payload() {
    return this._payload;
  }

  /**
   * Parse out a Subpacket object from a given array of octet values,
   * assuming a 16-bit CRC.
   *
   * An exception is thrown if the given bytes are definitively invalid
   * as subpacket values with 16-bit CRC.
   *
   * @param {number[]} octets - The octet values to parse.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *      This object is mutated in the function.
   *
   * @returns {Subpacket|undefined} An instance of the appropriate Subpacket
   *      subclass, or undefined if not enough octet values are given
   *      to determine whether there is a valid subpacket here or not.
   */
  static parse16(octets) {
    return ZmodemSubpacket._parse(octets, 2);
  }

  //parse32 test:
  //[102, 105, 108, 101, 110, 97, 109, 101, 119, 105, 116, 104, 115, 112, 97, 99, 101, 115, 0, 49, 55, 49, 51, 49, 52, 50, 52, 51, 50, 49, 55, 50, 49, 48, 48, 54, 52, 52, 48, 49, 49, 55, 0, 43, 8, 63, 115, 23, 17]

  /**
   * Same as parse16(), but assuming a 32-bit CRC.
   *
   * @param {number[]} octets - The octet values to parse.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *      This object is mutated in the function.
   *
   * @returns {Subpacket|undefined} An instance of the appropriate Subpacket
   *      subclass, or undefined if not enough octet values are given
   *      to determine whether there is a valid subpacket here or not.
   */
  static parse32(octets) {
    return ZmodemSubpacket._parse(octets, 4);
  }

  /**
   * Not used directly.
   */
  constructor(payload) {
    this._payload = payload;
  }
  _encode(zencoder, crc_func) {
    return zencoder.encode(this._payload.slice(0)).concat([Zmodem.ZMLIB.ZDLE, this._frameend_num], zencoder.encode(crc_func(this._payload.concat(this._frameend_num))));
  }

  //Because of ZDLE encoding, we’ll never see any of the frame-end octets
  //in a stream except as the ends of data payloads.
  static _parse(bytes_arr, crc_len) {
    var end_at;
    var creator;

    //These have to be written in decimal since they’re lookup keys.
    var _frame_ends_lookup = {
      104: ZEndNoAckSubpacket,
      105: ZNoEndNoAckSubpacket,
      106: ZNoEndAckSubpacket,
      107: ZEndAckSubpacket
    };
    var zdle_at = 0;
    while (zdle_at < bytes_arr.length) {
      zdle_at = bytes_arr.indexOf(Zmodem.ZMLIB.ZDLE, zdle_at);
      if (zdle_at === -1) return;
      var after_zdle = bytes_arr[zdle_at + 1];
      creator = _frame_ends_lookup[after_zdle];
      if (creator) {
        end_at = zdle_at + 1;
        break;
      }
      zdle_at++;
    }
    if (!creator) return;
    var frameend_num = bytes_arr[end_at];

    //sanity check
    if (bytes_arr[end_at - 1] !== Zmodem.ZMLIB.ZDLE) {
      throw "Byte before frame end should be ZDLE, not " + bytes_arr[end_at - 1];
    }
    var zdle_encoded_payload = bytes_arr.splice(0, end_at - 1);
    var got_crc = Zmodem.ZDLE.splice(bytes_arr, 2, crc_len);
    if (!got_crc) {
      //got payload but no CRC yet .. should be rare!

      //We have to put the ZDLE-encoded payload back before returning.
      bytes_arr.unshift.apply(bytes_arr, zdle_encoded_payload);
      return;
    }
    var payload = Zmodem.ZDLE.decode(zdle_encoded_payload);

    //We really shouldn’t need to do this, but just for good measure.
    //I suppose it’s conceivable this may run over UDP or something?
    Zmodem.CRC[crc_len === 2 ? "verify16" : "verify32"](payload.concat([frameend_num]), got_crc);
    return new creator(payload, got_crc);
  }
};
class ZEndSubpacketBase extends Zmodem.Subpacket {
  frame_end() {
    return true;
  }
}
class ZNoEndSubpacketBase extends Zmodem.Subpacket {
  frame_end() {
    return false;
  }
}

//Used for end-of-file.
class ZEndNoAckSubpacket extends ZEndSubpacketBase {
  ack_expected() {
    return false;
  }
}
ZEndNoAckSubpacket.prototype._frameend_num = ZCRCE;

//Used for ZFILE and ZSINIT payloads.
class ZEndAckSubpacket extends ZEndSubpacketBase {
  ack_expected() {
    return true;
  }
}
ZEndAckSubpacket.prototype._frameend_num = ZCRCW;

//Used for ZDATA, prior to end-of-file.
class ZNoEndNoAckSubpacket extends ZNoEndSubpacketBase {
  ack_expected() {
    return false;
  }
}
ZNoEndNoAckSubpacket.prototype._frameend_num = ZCRCG;

//only used if receiver can full-duplex
class ZNoEndAckSubpacket extends ZNoEndSubpacketBase {
  ack_expected() {
    return true;
  }
}
ZNoEndAckSubpacket.prototype._frameend_num = ZCRCQ;
SUBPACKET_BUILDER = {
  end_no_ack: ZEndNoAckSubpacket,
  end_ack: ZEndAckSubpacket,
  no_end_no_ack: ZNoEndNoAckSubpacket,
  no_end_ack: ZNoEndAckSubpacket
};

/***/ },

/***/ 1734
/*!***********************************************************************************!*\
  !*** ../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***!
  \***********************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


/* istanbul ignore next  */
function setAttributesWithoutAttributes(styleElement) {
  var nonce =  true ? __webpack_require__.nc : 0;
  if (nonce) {
    styleElement.setAttribute("nonce", nonce);
  }
}
module.exports = setAttributesWithoutAttributes;

/***/ },

/***/ 1766
/*!*******************************************!*\
  !*** ../app/node_modules/hasown/index.js ***!
  \*******************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var call = Function.prototype.call;
var $hasOwn = Object.prototype.hasOwnProperty;
var bind = __webpack_require__(/*! function-bind */ 438);

/** @type {import('.')} */
module.exports = bind.call(call, $hasOwn);

/***/ },

/***/ 1836
/*!********************************************!*\
  !*** ../node_modules/pug-runtime/index.js ***!
  \********************************************/
(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


var pug_has_own_property = Object.prototype.hasOwnProperty;

/**
 * Merge two attribute objects giving precedence
 * to values in object `b`. Classes are special-cased
 * allowing for arrays and merging/joining appropriately
 * resulting in a string.
 *
 * @param {Object} a
 * @param {Object} b
 * @return {Object} a
 * @api private
 */

exports.merge = pug_merge;
function pug_merge(a, b) {
  if (arguments.length === 1) {
    var attrs = a[0];
    for (var i = 1; i < a.length; i++) {
      attrs = pug_merge(attrs, a[i]);
    }
    return attrs;
  }

  for (var key in b) {
    if (key === 'class') {
      var valA = a[key] || [];
      a[key] = (Array.isArray(valA) ? valA : [valA]).concat(b[key] || []);
    } else if (key === 'style') {
      var valA = pug_style(a[key]);
      valA = valA && valA[valA.length - 1] !== ';' ? valA + ';' : valA;
      var valB = pug_style(b[key]);
      valB = valB && valB[valB.length - 1] !== ';' ? valB + ';' : valB;
      a[key] = valA + valB;
    } else {
      a[key] = b[key];
    }
  }

  return a;
}

/**
 * Process array, object, or string as a string of classes delimited by a space.
 *
 * If `val` is an array, all members of it and its subarrays are counted as
 * classes. If `escaping` is an array, then whether or not the item in `val` is
 * escaped depends on the corresponding item in `escaping`. If `escaping` is
 * not an array, no escaping is done.
 *
 * If `val` is an object, all the keys whose value is truthy are counted as
 * classes. No escaping is done.
 *
 * If `val` is a string, it is counted as a class. No escaping is done.
 *
 * @param {(Array.<string>|Object.<string, boolean>|string)} val
 * @param {?Array.<string>} escaping
 * @return {String}
 */
exports.classes = pug_classes;
function pug_classes_array(val, escaping) {
  var classString = '',
    className,
    padding = '',
    escapeEnabled = Array.isArray(escaping);
  for (var i = 0; i < val.length; i++) {
    className = pug_classes(val[i]);
    if (!className) continue;
    escapeEnabled && escaping[i] && (className = pug_escape(className));
    classString = classString + padding + className;
    padding = ' ';
  }
  return classString;
}
function pug_classes_object(val) {
  var classString = '',
    padding = '';
  for (var key in val) {
    if (key && val[key] && pug_has_own_property.call(val, key)) {
      classString = classString + padding + key;
      padding = ' ';
    }
  }
  return classString;
}
function pug_classes(val, escaping) {
  if (Array.isArray(val)) {
    return pug_classes_array(val, escaping);
  } else if (val && typeof val === 'object') {
    return pug_classes_object(val);
  } else {
    return val || '';
  }
}

/**
 * Convert object or string to a string of CSS styles delimited by a semicolon.
 *
 * @param {(Object.<string, string>|string)} val
 * @return {String}
 */

exports.style = pug_style;
function pug_style(val) {
  if (!val) return '';
  if (typeof val === 'object') {
    var out = '';
    for (var style in val) {
      /* istanbul ignore else */
      if (pug_has_own_property.call(val, style)) {
        out = out + style + ':' + val[style] + ';';
      }
    }
    return out;
  } else {
    return val + '';
  }
}

/**
 * Render the given attribute.
 *
 * @param {String} key
 * @param {String} val
 * @param {Boolean} escaped
 * @param {Boolean} terse
 * @return {String}
 */
exports.attr = pug_attr;
function pug_attr(key, val, escaped, terse) {
  if (
    val === false ||
    val == null ||
    (!val && (key === 'class' || key === 'style'))
  ) {
    return '';
  }
  if (val === true) {
    return ' ' + (terse ? key : key + '="' + key + '"');
  }
  var type = typeof val;
  if (
    (type === 'object' || type === 'function') &&
    typeof val.toJSON === 'function'
  ) {
    val = val.toJSON();
  }
  if (typeof val !== 'string') {
    val = JSON.stringify(val);
    if (!escaped && val.indexOf('"') !== -1) {
      return ' ' + key + "='" + val.replace(/'/g, '&#39;') + "'";
    }
  }
  if (escaped) val = pug_escape(val);
  return ' ' + key + '="' + val + '"';
}

/**
 * Render the given attributes object.
 *
 * @param {Object} obj
 * @param {Object} terse whether to use HTML5 terse boolean attributes
 * @return {String}
 */
exports.attrs = pug_attrs;
function pug_attrs(obj, terse) {
  var attrs = '';

  for (var key in obj) {
    if (pug_has_own_property.call(obj, key)) {
      var val = obj[key];

      if ('class' === key) {
        val = pug_classes(val);
        attrs = pug_attr(key, val, false, terse) + attrs;
        continue;
      }
      if ('style' === key) {
        val = pug_style(val);
      }
      attrs += pug_attr(key, val, false, terse);
    }
  }

  return attrs;
}

/**
 * Escape the given string of `html`.
 *
 * @param {String} html
 * @return {String}
 * @api private
 */

var pug_match_html = /["&<>]/;
exports.escape = pug_escape;
function pug_escape(_html) {
  var html = '' + _html;
  var regexResult = pug_match_html.exec(html);
  if (!regexResult) return _html;

  var result = '';
  var i, lastIndex, escape;
  for (i = regexResult.index, lastIndex = 0; i < html.length; i++) {
    switch (html.charCodeAt(i)) {
      case 34:
        escape = '&quot;';
        break;
      case 38:
        escape = '&amp;';
        break;
      case 60:
        escape = '&lt;';
        break;
      case 62:
        escape = '&gt;';
        break;
      default:
        continue;
    }
    if (lastIndex !== i) result += html.substring(lastIndex, i);
    lastIndex = i + 1;
    result += escape;
  }
  if (lastIndex !== i) return result + html.substring(lastIndex, i);
  else return result;
}

/**
 * Re-throw the given `err` in context to the
 * the pug in `filename` at the given `lineno`.
 *
 * @param {Error} err
 * @param {String} filename
 * @param {String} lineno
 * @param {String} str original source
 * @api private
 */

exports.rethrow = pug_rethrow;
function pug_rethrow(err, filename, lineno, str) {
  if (!(err instanceof Error)) throw err;
  if ((typeof window != 'undefined' || !filename) && !str) {
    err.message += ' on line ' + lineno;
    throw err;
  }
  var context, lines, start, end;
  try {
    str = str || (__webpack_require__(/*! fs */ 2947).readFileSync)(filename, {encoding: 'utf8'});
    context = 3;
    lines = str.split('\n');
    start = Math.max(lineno - context, 0);
    end = Math.min(lines.length, lineno + context);
  } catch (ex) {
    err.message +=
      ' - could not read from ' + filename + ' (' + ex.message + ')';
    pug_rethrow(err, null, lineno);
    return;
  }

  // Error context
  context = lines
    .slice(start, end)
    .map(function(line, i) {
      var curr = i + start + 1;
      return (curr == lineno ? '  > ' : '    ') + curr + '| ' + line;
    })
    .join('\n');

  // Alter exception message
  err.path = filename;
  try {
    err.message =
      (filename || 'Pug') +
      ':' +
      lineno +
      '\n' +
      context +
      '\n\n' +
      err.message;
  } catch (e) {}
  throw err;
}


/***/ },

/***/ 1837
/*!*****************************************!*\
  !*** ./node_modules/xtend/immutable.js ***!
  \*****************************************/
(module) {

module.exports = extend;
var hasOwnProperty = Object.prototype.hasOwnProperty;
function extend() {
  var target = {};
  for (var i = 0; i < arguments.length; i++) {
    var source = arguments[i];
    for (var key in source) {
      if (hasOwnProperty.call(source, key)) {
        target[key] = source[key];
      }
    }
  }
  return target;
}

/***/ },

/***/ 1852
/*!***************************************************!*\
  !*** ./node_modules/ansi-color/lib/ansi-color.js ***!
  \***************************************************/
(__unused_webpack_module, exports) {

// ANSI color code outputs for strings

var ANSI_CODES = {
  "off": 0,
  "bold": 1,
  "italic": 3,
  "underline": 4,
  "blink": 5,
  "inverse": 7,
  "hidden": 8,
  "black": 30,
  "red": 31,
  "green": 32,
  "yellow": 33,
  "blue": 34,
  "magenta": 35,
  "cyan": 36,
  "white": 37,
  "black_bg": 40,
  "red_bg": 41,
  "green_bg": 42,
  "yellow_bg": 43,
  "blue_bg": 44,
  "magenta_bg": 45,
  "cyan_bg": 46,
  "white_bg": 47
};
exports.h = function (str, color) {
  if (!color) return str;
  var color_attrs = color.split("+");
  var ansi_str = "";
  for (var i = 0, attr; attr = color_attrs[i]; i++) {
    ansi_str += "\x1b[" + ANSI_CODES[attr] + "m";
  }
  ansi_str += str + "\x1b[" + ANSI_CODES["off"] + "m";
  return ansi_str;
};

/***/ },

/***/ 1991
/*!************************************************************************!*\
  !*** ./src/components/colorSchemeSettingsTab.component.pug?ngResource ***!
  \************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/colorSchemeSettingsTab.component.pug?ngResource */ 8810);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 2007
/*!***************************************************************!*\
  !*** ../app/node_modules/get-proto/Reflect.getPrototypeOf.js ***!
  \***************************************************************/
(module) {

"use strict";


/** @type {import('./Reflect.getPrototypeOf')} */
module.exports = typeof Reflect !== 'undefined' && Reflect.getPrototypeOf || null;

/***/ },

/***/ 2069
/*!************************************************************************!*\
  !*** ./src/components/appearanceSettingsTab.component.scss?ngResource ***!
  \************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {


        var result = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./appearanceSettingsTab.component.scss?ngResource */ 1514);

        if (result && result.__esModule) {
            result = result.default;
        }

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ },

/***/ 2181
/*!*************************************!*\
  !*** ./src/fonts/SourceCodePro.ttf ***!
  \*************************************/
(module) {

"use strict";
module.exports = "data:font/ttf;base64, ";

/***/ },

/***/ 2185
/*!************************************************!*\
  !*** ../node_modules/is-plain-object/index.js ***!
  \************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */



var isObject = __webpack_require__(/*! isobject */ 613);
function isObjectObject(o) {
  return isObject(o) === true && Object.prototype.toString.call(o) === '[object Object]';
}
module.exports = function isPlainObject(o) {
  var ctor, prot;
  if (isObjectObject(o) === false) return false;

  // If has modified constructor
  ctor = o.constructor;
  if (typeof ctor !== 'function') return false;

  // If has modified prototype
  prot = ctor.prototype;
  if (isObjectObject(prot) === false) return false;

  // If constructor does not have an Object-specific method
  if (prot.hasOwnProperty('isPrototypeOf') === false) {
    return false;
  }

  // Most likely a plain Object
  return true;
};

/***/ },

/***/ 2187
/*!************************************************************************!*\
  !*** ../node_modules/css-loader/dist/cjs.js!./src/frontends/xterm.css ***!
  \************************************************************************/
(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ 1333);
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ 5955);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_node_modules_xterm_xterm_css_xterm_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! -!../../../node_modules/css-loader/dist/cjs.js!../../node_modules/@xterm/xterm/css/xterm.css */ 6775);
/* harmony import */ var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/getUrl.js */ 442);
/* harmony import */ var _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_3__);
// Imports




var ___CSS_LOADER_URL_IMPORT_0___ = new URL(/* asset import */ __webpack_require__(/*! ../fonts/SourceCodePro.ttf */ 2181), __webpack_require__.b);
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
___CSS_LOADER_EXPORT___.i(_node_modules_css_loader_dist_cjs_js_node_modules_xterm_xterm_css_xterm_css__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A);
var ___CSS_LOADER_URL_REPLACEMENT_0___ = _node_modules_css_loader_dist_runtime_getUrl_js__WEBPACK_IMPORTED_MODULE_3___default()(___CSS_LOADER_URL_IMPORT_0___);
// Module
___CSS_LOADER_EXPORT___.push([module.id, "@font-face {\n    font-family: \"monospace-fallback\";\n    src: url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ") format(\"truetype\");\n}\n\n.xterm-decoration-overview-ruler {\n    right: 1px;\n    pointer-events: none;\n}\n\n.xterm-viewport {\n    background: none !important;\n}\n", "",{"version":3,"sources":["webpack://./src/frontends/xterm.css"],"names":[],"mappings":"AAEA;IACI,iCAAiC;IACjC,+DAAuD;AAC3D;;AAEA;IACI,UAAU;IACV,oBAAoB;AACxB;;AAEA;IACI,2BAA2B;AAC/B","sourcesContent":["@import url(\"../../node_modules/@xterm/xterm/css/xterm.css\");\n\n@font-face {\n    font-family: \"monospace-fallback\";\n    src: url(../fonts/SourceCodePro.ttf) format(\"truetype\");\n}\n\n.xterm-decoration-overview-ruler {\n    right: 1px;\n    pointer-events: none;\n}\n\n.xterm-viewport {\n    background: none !important;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ },

/***/ 2323
/*!********************************************!*\
  !*** ../app/node_modules/es-errors/ref.js ***!
  \********************************************/
(module) {

"use strict";


/** @type {import('./ref')} */
module.exports = ReferenceError;

/***/ },

/***/ 2326
/*!***************************************!*\
  !*** ./node_modules/hexer/hex_spy.js ***!
  \***************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var util = __webpack_require__(/*! util */ 9023);
var Transform = (__webpack_require__(/*! stream */ 7748).Transform);
var ChunkedHexTransform = __webpack_require__(/*! ./chunked_hex_transform */ 803);
module.exports = HexSpy;
function HexSpy(sink, options) {
  if (!(this instanceof HexSpy)) {
    return new HexSpy(sink, options);
  }
  // istanbul ignore next
  if (!options) options = {};
  // istanbul ignore else
  if (options.highWaterMark === undefined) {
    options.highWaterMark = 1;
  }
  var self = this;
  Transform.call(self, options);
  self.hex = ChunkedHexTransform(options);
  self.hex.pipe(sink);
}
util.inherits(HexSpy, Transform);
HexSpy.prototype._transform = function _transform(chunk, encoding, callback) {
  var self = this;
  self.hex.write(chunk, encoding, function writeDone() {
    self.push(chunk);
    callback();
  });
};
HexSpy.prototype._flush = function _flush(callback) {
  var self = this;
  self.hex.end(null, null, callback);
};

/***/ },

/***/ 2443
/*!**************************************!*\
  !*** ../app/node_modules/uuid/v4.js ***!
  \**************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var rng = __webpack_require__(/*! ./lib/rng */ 1488);
var bytesToUuid = __webpack_require__(/*! ./lib/bytesToUuid */ 8516);
function v4(options, buf, offset) {
  var i = buf && offset || 0;
  if (typeof options == 'string') {
    buf = options === 'binary' ? new Array(16) : null;
    options = null;
  }
  options = options || {};
  var rnds = options.random || (options.rng || rng)();

  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  rnds[6] = rnds[6] & 0x0f | 0x40;
  rnds[8] = rnds[8] & 0x3f | 0x80;

  // Copy bytes to buffer, if provided
  if (buf) {
    for (var ii = 0; ii < 16; ++ii) {
      buf[i + ii] = rnds[ii];
    }
  }
  return buf || bytesToUuid(rnds);
}
module.exports = v4;

/***/ },

/***/ 2445
/*!******************************************************!*\
  !*** ../app/node_modules/define-properties/index.js ***!
  \******************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var keys = __webpack_require__(/*! object-keys */ 2560);
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
var toStr = Object.prototype.toString;
var concat = Array.prototype.concat;
var defineDataProperty = __webpack_require__(/*! define-data-property */ 4466);
var isFunction = function (fn) {
  return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
};
var supportsDescriptors = __webpack_require__(/*! has-property-descriptors */ 947)();
var defineProperty = function (object, name, value, predicate) {
  if (name in object) {
    if (predicate === true) {
      if (object[name] === value) {
        return;
      }
    } else if (!isFunction(predicate) || !predicate()) {
      return;
    }
  }
  if (supportsDescriptors) {
    defineDataProperty(object, name, value, true);
  } else {
    defineDataProperty(object, name, value);
  }
};
var defineProperties = function (object, map) {
  var predicates = arguments.length > 2 ? arguments[2] : {};
  var props = keys(map);
  if (hasSymbols) {
    props = concat.call(props, Object.getOwnPropertySymbols(map));
  }
  for (var i = 0; i < props.length; i += 1) {
    defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
  }
};
defineProperties.supportsDescriptors = !!supportsDescriptors;
module.exports = defineProperties;

/***/ },

/***/ 2560
/*!************************************************!*\
  !*** ../app/node_modules/object-keys/index.js ***!
  \************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var slice = Array.prototype.slice;
var isArgs = __webpack_require__(/*! ./isArguments */ 6564);
var origKeys = Object.keys;
var keysShim = origKeys ? function keys(o) {
  return origKeys(o);
} : __webpack_require__(/*! ./implementation */ 5860);
var originalKeys = Object.keys;
keysShim.shim = function shimObjectKeys() {
  if (Object.keys) {
    var keysWorksWithArguments = function () {
      // Safari 5.0 bug
      var args = Object.keys(arguments);
      return args && args.length === arguments.length;
    }(1, 2);
    if (!keysWorksWithArguments) {
      Object.keys = function keys(object) {
        // eslint-disable-line func-name-matching
        if (isArgs(object)) {
          return originalKeys(slice.call(object));
        }
        return originalKeys(object);
      };
    }
  } else {
    Object.keys = keysShim;
  }
  return Object.keys || keysShim;
};
module.exports = keysShim;

/***/ },

/***/ 2595
/*!*******************************************!*\
  !*** ../app/node_modules/is-set/index.js ***!
  \*******************************************/
(module) {

"use strict";


var $Map = typeof Map === 'function' && Map.prototype ? Map : null;
var $Set = typeof Set === 'function' && Set.prototype ? Set : null;
var exported;
if (!$Set) {
  /** @type {import('.')} */
  // eslint-disable-next-line no-unused-vars
  exported = function isSet(x) {
    // `Set` is not present in this environment.
    return false;
  };
}
var $mapHas = $Map ? Map.prototype.has : null;
var $setHas = $Set ? Set.prototype.has : null;
if (!exported && !$setHas) {
  /** @type {import('.')} */
  // eslint-disable-next-line no-unused-vars
  exported = function isSet(x) {
    // `Set` does not have a `has` method
    return false;
  };
}

/** @type {import('.')} */
module.exports = exported || function isSet(x) {
  if (!x || typeof x !== 'object') {
    return false;
  }
  try {
    $setHas.call(x);
    if ($mapHas) {
      try {
        $mapHas.call(x);
      } catch (e) {
        return true;
      }
    }
    // @ts-expect-error TS can't figure out that $Set is always truthy here
    return x instanceof $Set; // core-js workaround, pre-v2.5.0
  } catch (e) {}
  return false;
};

/***/ },

/***/ 2624
/*!************************************************!*\
  !*** ./node_modules/zmodem.js/src/zsession.js ***!
  \************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var Zmodem = module.exports;

/**
 * This is where the protocol-level logic lives: the interaction of ZMODEM
 * headers and subpackets. The logic here is not unlikely to need tweaking
 * as little edge cases crop up.
 */

Zmodem.DEBUG = false;
Object.assign(Zmodem, __webpack_require__(/*! ./encode */ 6248), __webpack_require__(/*! ./text */ 3773), __webpack_require__(/*! ./zdle */ 6563), __webpack_require__(/*! ./zmlib */ 3568), __webpack_require__(/*! ./zheader */ 3147), __webpack_require__(/*! ./zsubpacket */ 1638), __webpack_require__(/*! ./zvalidation */ 7417), __webpack_require__(/*! ./zerror */ 3478));
const
  //pertinent to this module
  KEEPALIVE_INTERVAL = 5000,
  //We ourselves don’t need ESCCTL, so we don’t send it;
  //however, we always expect to receive it in ZRINIT.
  //See _ensure_receiver_escapes_ctrl_chars() for more details.
  ZRINIT_FLAGS = ["CANFDX",
  //full duplex
  "CANOVIO",
  //overlap I/O

  //lsz has a buffer overflow bug that shows itself when:
  //
  //  - 16-bit CRC is used, and
  //  - lsz receives the abort sequence while sending a file
  //
  //To avoid this, we just tell lsz to use 32-bit CRC
  //even though there is otherwise no reason. This ensures that
  //unfixed lsz versions will avoid the buffer overflow.
  "CANFC32"],
  //We do this because some WebSocket shell servers
  //(e.g., xterm.js’s demo server) enable the IEXTEN termios flag,
  //which bars 0x0f and 0x16 from reaching the shell process,
  //which results in transmission errors.
  FORCE_ESCAPE_CTRL_CHARS = true,
  DEFAULT_RECEIVE_INPUT_MODE = "spool_uint8array",
  //pertinent to ZMODEM
  MAX_CHUNK_LENGTH = 8192,
  //1 KiB officially, but lrzsz allows 8192
  BS = 0x8,
  OVER_AND_OUT = [79, 79],
  ABORT_SEQUENCE = Zmodem.ZMLIB.ABORT_SEQUENCE;

/**
 * A base class for objects that have events.
 *
 * @private
 */
class _Eventer {
  /**
   * Not called directly.
   */
  constructor() {
    this._on_evt = {};
    this._evt_once_index = {};
  }
  _Add_event(evt_name) {
    this._on_evt[evt_name] = [];
    this._evt_once_index[evt_name] = [];
  }
  _get_evt_queue(evt_name) {
    if (!this._on_evt[evt_name]) {
      throw "Bad event: " + evt_name;
    }
    return this._on_evt[evt_name];
  }

  /**
   * Register a callback for a given event.
   *
   * @param {string} evt_name - The name of the event.
   *
   * @param {Function} todo - The function to execute when the event happens.
   */
  on(evt_name, todo) {
    var queue = this._get_evt_queue(evt_name);
    queue.push(todo);
    return this;
  }

  /**
   * Unregister a callback for a given event.
   *
   * @param {string} evt_name - The name of the event.
   *
   * @param {Function} [todo] - The function to execute when the event
   *  happens. If not given, the last event registered for the event
   *  is unregistered.
   */
  off(evt_name, todo) {
    var queue = this._get_evt_queue(evt_name);
    if (todo) {
      var at = queue.indexOf(todo);
      if (at === -1) {
        throw "“" + todo + "” is not in the “" + evt_name + "” queue.";
      }
      queue.splice(at, 1);
    } else {
      queue.pop();
    }
    return this;
  }
  _Happen(evt_name /*, arg0, arg1, .. */) {
    var queue = this._get_evt_queue(evt_name); //might as well validate

    //console.info("EVENT", this, arguments);

    var args = Array.apply(null, arguments);
    args.shift();
    var sess = this;
    queue.forEach(function (cb) {
      cb.apply(sess, args);
    });
    return queue.length;
  }
}

/**
 * The Session classes handle the protocol-level logic.
 * These shield the user from dealing with headers and subpackets.
 * This is a base class with functionality common to both Receive
 * and Send subclasses.
 *
 * @extends _Eventer
*/
Zmodem.Session = class ZmodemSession extends _Eventer {
  /**
   * Parse out a hex header from the given array.
   * If there’s a ZRQINIT or ZRINIT at the beginning,
   * we’ll return it. If the input isn’t a header,
   * for whatever reason, we return undefined.
   *
   * @param {number[]} octets - The bytes to parse.
   *
   * @return {Session|undefined} A Session object if the beginning
   *      of a session was parsable in “octets”; otherwise undefined.
   */
  static parse(octets) {
    //Will need to trap errors.
    var hdr;
    try {
      hdr = Zmodem.Header.parse_hex(octets);
    } catch (e) {
      //Don’t report since we aren’t in session

      //debug
      //console.warn("No hex header: ", e);

      return;
    }
    if (!hdr) return;
    switch (hdr.NAME) {
      case "ZRQINIT":
        //throw if ZCOMMAND
        return new Zmodem.Session.Receive();
      case "ZRINIT":
        return new Zmodem.Session.Send(hdr);
    }

    //console.warn("Invalid first Zmodem header", hdr);
  }

  /**
   * Sets the sender function that a Session object will use.
   *
   * @param {Function} sender_func - The function to call.
   *      It will receive an Array with the relevant octets.
   *
   * @return {Session} The session object (for chaining).
   */
  set_sender(sender_func) {
    this._sender = sender_func;
    return this;
  }

  /**
   * Whether the current Session has ended.
   *
   * @returns {boolean} The ended state.
   */
  has_ended() {
    return this._has_ended();
  }

  /**
   * Consumes an array of octets as ZMODEM session input.
   *
   * @param {number[]} octets - The input octets.
   */
  consume(octets) {
    this._before_consume(octets);
    if (this._aborted) throw new Zmodem.Error('already_aborted');
    if (!octets.length) return;
    this._strip_and_enqueue_input(octets);
    if (!this._check_for_abort_sequence(octets)) {
      this._consume_first();
    }
    return;
  }

  /**
   * Whether the current Session has been `abort()`ed.
   *
   * @returns {boolean} The aborted state.
   */
  aborted() {
    return !!this._aborted;
  }

  /**
   * Not called directly.
   */
  constructor() {
    super();
    //if (!sender_func) throw "Need sender!";

    //this._first_header = first_header;
    //this._sender = sender_func;
    this._config = {};

    //this._input = new ZInput();

    this._input_buffer = [];

    //This is mostly for debugging.
    this._Add_event("receive");
    this._Add_event("garbage");
    this._Add_event("session_end");
  }

  /**
   * Returns the Session object’s role.
   *
   * @returns {string} One of:
   * - `receive`
   * - `send`
   */
  get_role() {
    return this.type;
  }
  _trim_leading_garbage_until_header() {
    var garbage = Zmodem.Header.trim_leading_garbage(this._input_buffer);
    if (garbage.length) {
      if (this._Happen("garbage", garbage) === 0) {
        console.debug("Garbage: ", String.fromCharCode.apply(String, garbage), garbage);
      }
    }
  }
  _parse_and_consume_header() {
    this._trim_leading_garbage_until_header();
    var new_header_and_crc = Zmodem.Header.parse(this._input_buffer);
    if (!new_header_and_crc) return;
    if (Zmodem.DEBUG) {
      this._log_header("RECEIVED HEADER", new_header_and_crc[0]);
    }
    this._consume_header(new_header_and_crc[0]);
    this._last_header_name = new_header_and_crc[0].NAME;
    this._last_header_crc = new_header_and_crc[1];
    return new_header_and_crc[0];
  }
  _log_header(label, header) {
    console.debug(this.type, label, header.NAME, header._bytes4.join());
  }
  _consume_header(new_header) {
    this._on_receive(new_header);
    var handler = this._next_header_handler && this._next_header_handler[new_header.NAME];
    if (!handler) {
      console.error("Unhandled header!", new_header, this._next_header_handler);
      throw new Zmodem.Error("Unhandled header: " + new_header.NAME);
    }
    this._next_header_handler = null;
    handler.call(this, new_header);
  }

  //TODO: strip out the abort sequence
  _check_for_abort_sequence() {
    var abort_at = Zmodem.ZMLIB.find_subarray(this._input_buffer, ABORT_SEQUENCE);
    if (abort_at !== -1) {
      //TODO: expose this to caller
      this._input_buffer.splice(0, abort_at + ABORT_SEQUENCE.length);
      this._aborted = true;

      //TODO compare response here to lrzsz.
      this._on_session_end();

      //We shouldn’t ever expect to receive an abort. Even if we
      //have sent an abort ourselves, the Sentry should have stopped
      //directing input to this Session object.
      //if (this._expect_abort) {
      //    return true;
      //}

      throw new Zmodem.Error("peer_aborted");
    }
  }
  _send_header(name /*, args */) {
    if (!this._sender) throw "Need sender!";
    var args = Array.apply(null, arguments);
    var bytes_hdr = this._create_header_bytes(args);
    if (Zmodem.DEBUG) {
      this._log_header("SENDING HEADER", bytes_hdr[1]);
    }
    this._sender(bytes_hdr[0]);
    this._last_sent_header = bytes_hdr[1];
  }
  _create_header_bytes(name_and_args) {
    var hdr = Zmodem.Header.build.apply(Zmodem.Header, name_and_args);
    var formatter = this._get_header_formatter(name_and_args[0]);
    return [hdr[formatter](this._zencoder), hdr];
  }
  _strip_and_enqueue_input(input) {
    Zmodem.ZMLIB.strip_ignored_bytes(input);

    //It’s possible that “input” is empty at this point.
    //It doesn’t seem to hurt anything to keep processing, though.

    this._input_buffer.push.apply(this._input_buffer, input);
  }

  /**
   * **STOP!** You probably want to `skip()` an Offer rather than
   * `abort()`. See below.
   *
   * Abort the current session by sending the ZMODEM abort sequence.
   * This function will cause the Session object to refuse to send
   * any further data.
   *
   * Zmodem.Sentry is configured to send all output to the terminal
   * after a session’s `abort()`. That could result in lots of
   * ZMODEM garble being sent to the JavaScript terminal, which you
   * probably don’t want.
   *
   * `skip()` on an Offer is better because Session will continue to
   * discard data until we reach either another file or the
   * sender-initiated end of the ZMODEM session. So no ZMODEM garble,
   * and the session will end successfully.
   *
   * The behavior of `abort()` is subject to change since it’s not
   * very useful as currently implemented.
   */
  abort() {
    //this._expect_abort = true;

    //From Forsberg:
    //
    //The Cancel sequence consists of eight CAN characters
    //and ten backspace characters. ZMODEM only requires five
    //Cancel characters; the other three are "insurance".
    //The trailing backspace characters attempt to erase
    //the effects of the CAN characters if they are
    //received by a command interpreter.
    //
    //FG: Since we assume our connection is reliable, there’s
    //no reason to send more than 5 CANs.
    this._sender(ABORT_SEQUENCE.concat([BS, BS, BS, BS, BS]));
    this._aborted = true;
    this._sender = function () {
      throw new Zmodem.Error('already_aborted');
    };
    this._on_session_end();
    return;
  }

  //----------------------------------------------------------------------
  _on_session_end() {
    this._Happen("session_end");
  }
  _on_receive(hdr_or_pkt) {
    this._Happen("receive", hdr_or_pkt);
  }
  _before_consume() {}
};
function _trim_OO(array) {
  if (0 === Zmodem.ZMLIB.find_subarray(array, OVER_AND_OUT)) {
    array.splice(0, OVER_AND_OUT.length);
  }

  //TODO: This assumes OVER_AND_OUT is 2 bytes long. No biggie, but.
  else if (array[0] === OVER_AND_OUT[OVER_AND_OUT.length - 1]) {
    array.splice(0, 1);
  }
  return array;
}

/** A class for ZMODEM receive sessions.
 *
 * @extends Session
 */
Zmodem.Session.Receive = class ZmodemReceiveSession extends Zmodem.Session {
  //We only get 1 file at a time, so on each consume() either
  //continue state for the current file or start a new one.

  /**
   * Not called directly.
   */
  constructor() {
    super();
    this._Add_event("offer");
    this._Add_event("data_in");
    this._Add_event("file_end");
  }

  /**
   * Consume input bytes from the sender.
   *
   * @private
   * @param {number[]} octets - The bytes to consume.
   */
  _before_consume(octets) {
    if (this._bytes_after_OO) {
      throw "PROTOCOL: Session is completed!";
    }

    //Put this here so that our logic later on has access to the
    //input string and can populate _bytes_after_OO when the
    //session ends.
    this._bytes_being_consumed = octets;
  }

  /**
   * Return any bytes that have been `consume()`d but
   * came after the end of the ZMODEM session.
   *
   * @returns {number[]} The trailing bytes.
   */
  get_trailing_bytes() {
    if (this._aborted) return [];
    if (!this._bytes_after_OO) {
      throw "PROTOCOL: Session is not completed!";
    }
    return this._bytes_after_OO.slice(0);
  }
  _has_ended() {
    return this.aborted() || !!this._bytes_after_OO;
  }

  //Receiver always sends hex headers.
  _get_header_formatter() {
    return "to_hex";
  }
  _parse_and_consume_subpacket() {
    var parse_func;
    if (this._last_header_crc === 16) {
      parse_func = "parse16";
    } else {
      parse_func = "parse32";
    }
    var subpacket = Zmodem.Subpacket[parse_func](this._input_buffer);
    if (subpacket) {
      if (Zmodem.DEBUG) {
        console.debug(this.type, "RECEIVED SUBPACKET", subpacket);
      }
      this._consume_data(subpacket);

      //What state are we in if the subpacket indicates frame end
      //but we haven’t gotten ZEOF yet? Can anything other than ZEOF
      //follow after a ZDATA?
      if (subpacket.frame_end()) {
        this._next_subpacket_handler = null;
      }
    }
    return subpacket;
  }
  _consume_first() {
    if (this._got_ZFIN) {
      if (this._input_buffer.length < 2) return;

      //if it’s OO, then set this._bytes_after_OO
      if (Zmodem.ZMLIB.find_subarray(this._input_buffer, OVER_AND_OUT) === 0) {
        //This doubles as an indication that the session has ended.
        //We need to set this right away so that handlers like
        //"session_end" will have access to it.
        this._bytes_after_OO = _trim_OO(this._bytes_being_consumed.slice(0));
        this._on_session_end();
        return;
      } else {
        throw "PROTOCOL: Only thing after ZFIN should be “OO” (79,79), not: " + this._input_buffer.join();
      }
    }
    var parsed;
    do {
      if (this._next_subpacket_handler) {
        parsed = this._parse_and_consume_subpacket();
      } else {
        parsed = this._parse_and_consume_header();
      }
    } while (parsed && this._input_buffer.length);
  }
  _consume_data(subpacket) {
    this._on_receive(subpacket);
    if (!this._next_subpacket_handler) {
      throw "PROTOCOL: Received unexpected data packet after " + this._last_header_name + " header: " + subpacket.get_payload().join();
    }
    this._next_subpacket_handler.call(this, subpacket);
  }
  _octets_to_string(octets) {
    if (!this._textdecoder) {
      this._textdecoder = new Zmodem.Text.Decoder();
    }
    return this._textdecoder.decode(new Uint8Array(octets));
  }
  _consume_ZFILE_data(hdr, subpacket) {
    if (this._file_info) {
      throw "PROTOCOL: second ZFILE data subpacket received";
    }
    var packet_payload = subpacket.get_payload();
    var nul_at = packet_payload.indexOf(0);

    //
    var fname = this._octets_to_string(packet_payload.slice(0, nul_at));
    var the_rest = this._octets_to_string(packet_payload.slice(1 + nul_at)).split(" ");
    var mtime = the_rest[1] && parseInt(the_rest[1], 8) || undefined;
    if (mtime) {
      mtime = new Date(mtime * 1000);
    }
    this._file_info = {
      name: fname,
      size: the_rest[0] ? parseInt(the_rest[0], 10) : null,
      mtime: mtime || null,
      mode: the_rest[2] && parseInt(the_rest[2], 8) || null,
      serial: the_rest[3] && parseInt(the_rest[3], 10) || null,
      files_remaining: the_rest[4] ? parseInt(the_rest[4], 10) : null,
      bytes_remaining: the_rest[5] ? parseInt(the_rest[5], 10) : null
    };

    //console.log("ZFILE", hdr);

    var xfer = new Offer(hdr.get_options(), this._file_info, this._accept.bind(this), this._skip.bind(this));
    this._current_transfer = xfer;

    //this._Happen("offer", xfer);
  }
  _consume_ZDATA_data(subpacket) {
    if (!this._accepted_offer) {
      throw "PROTOCOL: Received data without accepting!";
    }

    //TODO: Probably should include some sort of preventive against
    //infinite loop here: if the peer hasn’t sent us what we want after,
    //say, 10 ZRPOS headers then we should send ZABORT and just end.
    if (!this._offset_ok) {
      console.warn("offset not ok!");
      _send_ZRPOS();
      return;
    }
    this._file_offset += subpacket.get_payload().length;
    this._on_data_in(subpacket);

    /*
    console.warn("received error from data_in callback; retrying", e);
    throw "unimplemented";
    */

    if (subpacket.ack_expected() && !subpacket.frame_end()) {
      this._send_header("ZACK", Zmodem.ENCODELIB.pack_u32_le(this._file_offset));
    }
  }
  _make_promise_for_between_files() {
    var sess = this;
    return new Promise(function (res) {
      var between_files_handler = {
        ZFILE: function (hdr) {
          this._next_subpacket_handler = function (subpacket) {
            this._next_subpacket_handler = null;
            this._consume_ZFILE_data(hdr, subpacket);
            this._Happen("offer", this._current_transfer);
            res(this._current_transfer);
          };
        },
        //We use this as a keep-alive. Maybe other
        //implementations do, too?
        ZSINIT: function (hdr) {
          //The content of this header doesn’t affect us
          //since all it does is tell us details of how
          //the sender will ZDLE-encode binary data. Our
          //ZDLE parser doesn’t need to know in advance.

          sess._next_subpacket_handler = function (spkt) {
            sess._next_subpacket_handler = null;
            sess._consume_ZSINIT_data(spkt);
            sess._send_header('ZACK');
            sess._next_header_handler = between_files_handler;
          };
        },
        ZFIN: function () {
          this._consume_ZFIN();
          res();
        }
      };
      sess._next_header_handler = between_files_handler;
    });
  }
  _consume_ZSINIT_data(spkt) {
    //TODO: Should this be used when we signal a cancellation?
    this._attn = spkt.get_payload();
  }

  /**
   * Start the ZMODEM session by signaling to the sender that
   * we are ready for the first file offer.
   *
   * @returns {Promise} A promise that resolves with an Offer object
   * or, if the sender closes the session immediately without offering
   * anything, nothing.
   */
  start() {
    if (this._started) throw "Already started!";
    this._started = true;
    var ret = this._make_promise_for_between_files();
    this._send_ZRINIT();
    return ret;
  }

  //Returns a promise that’s fulfilled when the file
  //transfer is done.
  //
  //  That ZEOF promise return is another promise that’s
  //  fulfilled when we get either ZFIN or another ZFILE.
  _accept(offset) {
    this._accepted_offer = true;
    this._file_offset = offset || 0;
    var sess = this;
    var ret = new Promise(function (resolve_accept) {
      var last_ZDATA;
      sess._next_header_handler = {
        ZDATA: function on_ZDATA(hdr) {
          this._consume_ZDATA(hdr);
          this._next_subpacket_handler = this._consume_ZDATA_data;
          this._next_header_handler = {
            ZEOF: function on_ZEOF(hdr) {
              // Do this first to verify the ZEOF.
              // This also fires the “file_end” event.
              this._consume_ZEOF(hdr);
              this._next_subpacket_handler = null;

              // We don’t care about this promise.
              // Prior to v0.1.8 we did because we called
              // resolve_accept() at the resolution of this
              // promise, but that was a bad idea and was
              // never documented, so 0.1.8 changed it.
              this._make_promise_for_between_files();
              resolve_accept();
              this._send_ZRINIT();
            }
          };
        }
      };
    });
    this._send_ZRPOS();
    return ret;
  }
  _skip() {
    var ret = this._make_promise_for_between_files();
    if (this._accepted_offer) {
      // There’s a race condition where we might attempt to
      // skip() an in-progress transfer near its end but actually
      // the skip() will fire after the transfer is complete.
      // While there might be ways to prevent this, they likely
      // would require extra work on the part of implementations.
      //
      // It seems far simpler just to make this function a no-op
      // in these cases.
      if (!this._current_transfer) return;

      //For cancel of an in-progress transfer from lsz,
      //it’s necessary to avoid this buffer overflow bug:
      //
      //  https://github.com/gooselinux/lrzsz/blob/master/lrzsz-0.12.20.patch
      //
      //… which we do by asking for CRC32 from lsz.

      //We might or might not have consumed ZDATA.
      //The sender also might or might not send a ZEOF before it
      //parses the ZSKIP. Thus, we want to ignore the following:
      //
      //  - ZDATA
      //  - ZDATA then ZEOF
      //  - ZEOF
      //
      //… and just look for the next between-file header.

      var bound_make_promise_for_between_files = function () {
        //Once this happens we fail on any received data packet.
        //So it needs not to happen until we’ve received a header.
        this._accepted_offer = false;
        this._next_subpacket_handler = null;
        this._make_promise_for_between_files();
      }.bind(this);
      Object.assign(this._next_header_handler, {
        ZEOF: bound_make_promise_for_between_files,
        ZDATA: function () {
          bound_make_promise_for_between_files();
          this._next_header_handler.ZEOF = bound_make_promise_for_between_files;
        }.bind(this)
      });
    }

    //this._accepted_offer = false;

    this._file_info = null;
    this._send_header("ZSKIP");
    return ret;
  }
  _send_ZRINIT() {
    this._send_header("ZRINIT", ZRINIT_FLAGS);
  }
  _consume_ZFIN() {
    this._got_ZFIN = true;
    this._send_header("ZFIN");
  }
  _consume_ZEOF(header) {
    if (this._file_offset !== header.get_offset()) {
      throw "ZEOF offset mismatch; unimplemented (local: " + this._file_offset + "; ZEOF: " + header.get_offset() + ")";
    }
    this._on_file_end();

    //Preserve these two so that file_end callbacks
    //will have the right information.
    this._file_info = null;
    this._current_transfer = null;
  }
  _consume_ZDATA(header) {
    if (this._file_offset === header.get_offset()) {
      this._offset_ok = true;
    } else {
      throw "Error correction is unimplemented.";
    }
  }
  _send_ZRPOS() {
    this._send_header("ZRPOS", this._file_offset);
  }

  //----------------------------------------------------------------------
  //events

  _on_file_end() {
    this._Happen("file_end");
    if (this._current_transfer) {
      this._current_transfer._Happen("complete");
      this._current_transfer = null;
    }
  }
  _on_data_in(subpacket) {
    this._Happen("data_in", subpacket);
    if (this._current_transfer) {
      this._current_transfer._Happen("input", subpacket.get_payload());
    }
  }
};
Object.assign(Zmodem.Session.Receive.prototype, {
  type: "receive"
});

//----------------------------------------------------------------------

/**
 * @typedef {Object} FileDetails
 *
 * @property {string} name - The name of the file.
 *
 * @property {number} [size] - The file size, in bytes.
 *
 * @property {number} [mode] - The file mode (e.g., 0100644).
 *
 * @property {Date|number} [mtime] - The file’s modification time.
 *  When expressed as a number, the unit is epoch seconds.
 *
 * @property {number} [files_remaining] - Inclusive of the current file,
 *  so this value is never less than 1.
 *
 * @property {number} [bytes_remaining] - Inclusive of the current file.
 */

/**
 * Common methods for Transfer and Offer objects.
 *
 * @mixin
 */
var Transfer_Offer_Mixin = {
  /**
   * Returns the file details object.
   * @returns {FileDetails} `mtime` is a Date.
   */
  get_details: function get_details() {
    return Object.assign({}, this._file_info);
  },
  /**
   * Returns a parse of the ZFILE header’s payload.
   *
   * @returns {Object} Members are:
   *
   * - `conversion` (string | undefined)
   * - `management` (string | undefined)
   * - `transfer` (string | undefined)
   * - `sparse` (boolean)
   */
  get_options: function get_options() {
    return Object.assign({}, this._zfile_opts);
  },
  /**
   * Returns the offset based on the last transferred chunk.
   * @returns {number} The file offset (i.e., number of bytes after
   *  the start of the file).
   */
  get_offset: function get_offset() {
    return this._file_offset;
  }
};

/**
 * A class to represent a sender’s interaction with a single file
 * transfer within a batch. When a receiver accepts an offer, the
 * Session instantiates this class and passes the instance as the
 * promise resolution from send_offer().
 *
 * @mixes Transfer_Offer_Mixin
 */
class Transfer {
  /**
   * Not called directly.
   */
  constructor(file_info, offset, send_func, end_func) {
    this._file_info = file_info;
    this._file_offset = offset || 0;
    this._send = send_func;
    this._end = end_func;
  }

  /**
   * Send a (non-terminal) piece of the file.
   *
   * @param { number[] | Uint8Array } array_like - The bytes to send.
   */
  send(array_like) {
    this._send(array_like);
    this._file_offset += array_like.length;
  }

  /**
   * Complete the file transfer.
   *
   * @param { number[] | Uint8Array } [array_like] - The last bytes to send.
   *
   * @return { Promise } Resolves when the receiver has indicated
   *      acceptance of the end of the file transfer.
   */
  end(array_like) {
    var ret = this._end(array_like || []);
    if (array_like) this._file_offset += array_like.length;
    return ret;
  }
}
Object.assign(Transfer.prototype, Transfer_Offer_Mixin);

/**
 * A class to represent a receiver’s interaction with a single file
 * transfer offer within a batch. There is functionality here to
 * skip or accept offered files and either to spool the packet
 * payloads or to handle them yourself.
 *
 * @mixes Transfer_Offer_Mixin
 */
class Offer extends _Eventer {
  /**
   * Not called directly.
   */
  constructor(zfile_opts, file_info, accept_func, skip_func) {
    super();
    this._zfile_opts = zfile_opts;
    this._file_info = file_info;
    this._accept_func = accept_func;
    this._skip_func = skip_func;
    this._Add_event("input");
    this._Add_event("complete");

    //Register this first so that application handlers receive
    //the updated offset.
    this.on("input", this._input_handler);
  }
  _verify_not_skipped() {
    if (this._skipped) {
      throw new Zmodem.Error("Already skipped!");
    }
  }

  /**
   * Tell the sender that you don’t want the offered file.
   *
   * You can send this in lieu of `accept()` or after it, e.g.,
   * if you find that the transfer is taking too long. Note that,
   * if you `skip()` after you `accept()`, you’ll likely have to
   * wait for buffers to clear out.
   *
   */
  skip() {
    this._verify_not_skipped();
    this._skipped = true;
    return this._skip_func.apply(this, arguments);
  }

  /**
   * Tell the sender to send the offered file.
   *
   * @param {Object} [opts] - Can be:
   * @param {string} [opts.oninput=spool_uint8array] - Can be:
   *
   * - `spool_uint8array`: Stores the ZMODEM
   *     packet payloads as Uint8Array instances.
   *     This makes for an easy transition to a Blob,
   *     which JavaScript can use to save the file to disk.
   *
   * - `spool_array`: Stores the ZMODEM packet payloads
   *     as Array instances. Each value is an octet value.
   *
   * - (function): A handler that receives each payload
   *     as it arrives. The Offer object does not store
   *     the payloads internally when thus configured.
   *
   * @return { Promise } Resolves when the file is fully received.
   *      If the Offer has been spooling
   *      the packet payloads, the promise resolves with an Array
   *      that contains those payloads.
   */
  accept(opts) {
    this._verify_not_skipped();
    if (this._accepted) {
      throw new Zmodem.Error("Already accepted!");
    }
    this._accepted = true;
    if (!opts) opts = {};
    this._file_offset = opts.offset || 0;
    switch (opts.on_input) {
      case null:
      case undefined:
      case "spool_array":
      case DEFAULT_RECEIVE_INPUT_MODE:
        //default
        this._spool = [];
        break;
      default:
        if (typeof opts.on_input !== "function") {
          throw "Invalid “on_input”: " + opts.on_input;
        }
    }
    this._input_handler_mode = opts.on_input || DEFAULT_RECEIVE_INPUT_MODE;
    return this._accept_func(this._file_offset).then(this._get_spool.bind(this));
  }
  _input_handler(payload) {
    this._file_offset += payload.length;
    if (typeof this._input_handler_mode === "function") {
      this._input_handler_mode(payload);
    } else {
      if (this._input_handler_mode === DEFAULT_RECEIVE_INPUT_MODE) {
        payload = new Uint8Array(payload);
      }

      //sanity
      else if (this._input_handler_mode !== "spool_array") {
        throw new Zmodem.Error("WTF?? _input_handler_mode = " + this._input_handler_mode);
      }
      this._spool.push(payload);
    }
  }
  _get_spool() {
    return this._spool;
  }
}
Object.assign(Offer.prototype, Transfer_Offer_Mixin);

//Curious that ZSINIT isn’t here … but, lsz sends it as hex.
const SENDER_BINARY_HEADER = {
  ZFILE: true,
  ZDATA: true
};

/**
 * A class that encapsulates behavior for a ZMODEM sender.
 *
 * @extends Session
 */
Zmodem.Session.Send = class ZmodemSendSession extends Zmodem.Session {
  /**
   * Not called directly.
   */
  constructor(zrinit_hdr) {
    super();
    if (!zrinit_hdr) {
      throw "Need first header!";
    } else if (zrinit_hdr.NAME !== "ZRINIT") {
      throw "First header should be ZRINIT, not " + zrinit_hdr.NAME;
    }
    this._last_header_name = 'ZRINIT';

    //We don’t need to send crc32. Even if the other side can grok it,
    //there’s no point to sending it since, for now, we assume we’re
    //on a reliable connection, e.g., TCP. Ideally we’d just forgo
    //CRC checks completely, but ZMODEM doesn’t allow that.
    //
    //If we *were* to start using crc32, we’d update this every time
    //we send a header.
    this._subpacket_encode_func = 'encode16';
    this._zencoder = new Zmodem.ZDLE();
    this._consume_ZRINIT(zrinit_hdr);
    this._file_offset = 0;
    var zrqinit_count = 0;
    this._start_keepalive_on_set_sender = true;

    //lrzsz will send ZRINIT until it gets an offer. (keep-alive?)
    //It sends 4 additional ones after the initial ZRINIT and, if
    //no response is received, starts sending “C” (0x43, 67) as if to
    //try to downgrade to XMODEM or YMODEM.
    //var sess = this;
    //this._prepare_to_receive_ZRINIT( function keep_alive() {
    //    sess._prepare_to_receive_ZRINIT(keep_alive);
    //} );

    //queue up the ZSINIT flag to send -- but seems useless??

    /*
    Object.assign(
        this._on_evt,
        {
            file_received: [],
        },
    };
    */
  }

  /**
   * Sets the sender function. The first time this is called,
   * it will also initiate a keepalive using ZSINIT until the
   * first file is sent.
   *
   * @param {Function} func - The function to call.
   *  It will receive an Array with the relevant octets.
   *
   * @return {Session} The session object (for chaining).
   */
  set_sender(func) {
    super.set_sender(func);
    if (this._start_keepalive_on_set_sender) {
      this._start_keepalive_on_set_sender = false;
      this._start_keepalive();
    }
    return this;
  }

  //7.3.3 .. The sender also uses hex headers when they are
  //not followed by binary data subpackets.
  //
  //FG: … or when the header is ZSINIT? That’s what lrzsz does, anyway.
  //Then it sends a single NUL byte as the payload to an end_ack subpacket.
  _get_header_formatter(name) {
    return SENDER_BINARY_HEADER[name] ? "to_binary16" : "to_hex";
  }

  //In order to keep lrzsz from timing out, we send ZSINIT every 5 seconds.
  //Maybe make this configurable?
  _start_keepalive() {
    //if (this._keepalive_promise) throw "Keep-alive already started!";
    if (!this._keepalive_promise) {
      var sess = this;
      this._keepalive_promise = new Promise(function (resolve) {
        //console.log("SETTING KEEPALIVE TIMEOUT");
        sess._keepalive_timeout = setTimeout(resolve, KEEPALIVE_INTERVAL);
      }).then(function () {
        sess._next_header_handler = {
          ZACK: function () {
            //We’re going to need to ensure that the
            //receiver is ready for all control characters
            //to be escaped. If we’ve already sent a ZSINIT
            //and gotten a response, then we know that that
            //work is already done later on when we actually
            //send an offer.
            sess._got_ZSINIT_ZACK = true;
          }
        };
        sess._send_ZSINIT();
        sess._keepalive_promise = null;
        sess._start_keepalive();
      });
    }
  }
  _stop_keepalive() {
    if (this._keepalive_promise) {
      //console.log("STOPPING KEEPALIVE");
      clearTimeout(this._keepalive_timeout);
      this._keep_alive_promise = null;
    }
  }
  _send_ZSINIT() {
    //See note at _ensure_receiver_escapes_ctrl_chars()
    //for why we have to pass ESCCTL.

    var zsinit_flags = [];
    if (this._zencoder.escapes_ctrl_chars()) {
      zsinit_flags.push("ESCCTL");
    }
    this._send_header_and_data(["ZSINIT", zsinit_flags], [0], "end_ack");
  }
  _consume_ZRINIT(hdr) {
    this._last_ZRINIT = hdr;
    if (hdr.get_buffer_size()) {
      throw "Buffer size (" + hdr.get_buffer_size() + ") is unsupported!";
    }
    if (!hdr.can_full_duplex()) {
      throw "Half-duplex I/O is unsupported!";
    }
    if (!hdr.can_overlap_io()) {
      throw "Non-overlap I/O is unsupported!";
    }
    if (hdr.escape_8th_bit()) {
      throw "8-bit escaping is unsupported!";
    }
    if (FORCE_ESCAPE_CTRL_CHARS) {
      this._zencoder.set_escape_ctrl_chars(true);
      if (!hdr.escape_ctrl_chars()) {
        console.debug("Peer didn’t request escape of all control characters. Will send ZSINIT to force recognition of escaped control characters.");
      }
    } else {
      this._zencoder.set_escape_ctrl_chars(hdr.escape_ctrl_chars());
    }
  }

  //https://stackoverflow.com/questions/23155939/missing-0xf-and-0x16-when-binary-data-through-virtual-serial-port-pair-created-b
  //^^ Because of that, we always escape control characters.
  //The alternative would be that lrz would never receive those
  //two bytes from zmodem.js.
  _ensure_receiver_escapes_ctrl_chars() {
    var promise;
    var needs_ZSINIT = !this._last_ZRINIT.escape_ctrl_chars() && !this._got_ZSINIT_ZACK;
    if (needs_ZSINIT) {
      var sess = this;
      promise = new Promise(function (res) {
        sess._next_header_handler = {
          ZACK: hdr => {
            res();
          }
        };
        sess._send_ZSINIT();
      });
    } else {
      promise = Promise.resolve();
    }
    return promise;
  }
  _convert_params_to_offer_payload_array(params) {
    params = Zmodem.Validation.offer_parameters(params);
    var subpacket_payload = params.name + "\x00";
    var subpacket_space_pieces = [(params.size || 0).toString(10), params.mtime ? params.mtime.toString(8) : "0", params.mode ? (0x8000 | params.mode).toString(8) : "0", "0" //serial
    ];
    if (params.files_remaining) {
      subpacket_space_pieces.push(params.files_remaining);
      if (params.bytes_remaining) {
        subpacket_space_pieces.push(params.bytes_remaining);
      }
    }
    subpacket_payload += subpacket_space_pieces.join(" ");
    return this._string_to_octets(subpacket_payload);
  }

  /**
   * Send an offer to the receiver.
   *
   * @param {FileDetails} params - All about the file you want to transfer.
   *
   * @returns {Promise} If the receiver accepts the offer, then the
   * resolution is a Transfer object; otherwise the resolution is
   * undefined.
   */
  send_offer(params) {
    if (Zmodem.DEBUG) {
      console.debug("SENDING OFFER", params);
    }
    if (!params) throw "need file params!";
    if (this._sending_file) throw "Already sending file!";
    var payload_array = this._convert_params_to_offer_payload_array(params);
    this._stop_keepalive();
    var sess = this;
    function zrpos_handler_setter_func() {
      sess._next_header_handler = {
        // The receiver may send ZRPOS in at least two cases:
        //
        // 1) A malformed subpacket arrived, so we need to
        // “rewind” a bit and continue from the receiver’s
        // last-successful location in the file.
        //
        // 2) The receiver hasn’t gotten any data for a bit,
        // so it sends ZRPOS as a “ping”.
        //
        // Case #1 shouldn’t happen since zmodem.js requires a
        // reliable transport. Case #2, though, can happen due
        // to either normal network congestion or errors in
        // implementation. In either case, there’s nothing for
        // us to do but to ignore the ZRPOS, with an optional
        // warning.
        //
        ZRPOS: function (hdr) {
          if (Zmodem.DEBUG) {
            console.warn("Mid-transfer ZRPOS … implementation error?");
          }
          zrpos_handler_setter_func();
        }
      };
    }
    ;
    var doer_func = function () {
      //return Promise object that is fulfilled when the ZRPOS or ZSKIP arrives.
      //The promise value is the byte offset, or undefined for ZSKIP.
      //If ZRPOS arrives, then send ZDATA(0) and set this._sending_file.
      var handler_setter_promise = new Promise(function (res) {
        sess._next_header_handler = {
          ZSKIP: function () {
            sess._start_keepalive();
            res();
          },
          ZRPOS: function (hdr) {
            sess._sending_file = true;
            zrpos_handler_setter_func();
            res(new Transfer(params, hdr.get_offset(), sess._send_interim_file_piece.bind(sess), sess._end_file.bind(sess)));
          }
        };
      });
      sess._send_header_and_data(["ZFILE"], payload_array, "end_ack");
      delete sess._sent_ZDATA;
      return handler_setter_promise;
    };
    if (FORCE_ESCAPE_CTRL_CHARS) {
      return this._ensure_receiver_escapes_ctrl_chars().then(doer_func);
    }
    return doer_func();
  }
  _send_header_and_data(hdr_name_and_args, data_arr, frameend) {
    var bytes_hdr = this._create_header_bytes(hdr_name_and_args);
    var data_bytes = this._build_subpacket_bytes(data_arr, frameend);
    bytes_hdr[0].push.apply(bytes_hdr[0], data_bytes);
    if (Zmodem.DEBUG) {
      this._log_header("SENDING HEADER", bytes_hdr[1]);
      console.debug(this.type, "-- HEADER PAYLOAD:", frameend, data_bytes.length);
    }
    this._sender(bytes_hdr[0]);
    this._last_sent_header = bytes_hdr[1];
  }
  _build_subpacket_bytes(bytes_arr, frameend) {
    var subpacket = Zmodem.Subpacket.build(bytes_arr, frameend);
    return subpacket[this._subpacket_encode_func](this._zencoder);
  }
  _build_and_send_subpacket(bytes_arr, frameend) {
    this._sender(this._build_subpacket_bytes(bytes_arr, frameend));
  }
  _string_to_octets(string) {
    if (!this._textencoder) {
      this._textencoder = new Zmodem.Text.Encoder();
    }
    var uint8arr = this._textencoder.encode(string);
    return Array.prototype.slice.call(uint8arr);
  }

  /*
  Potential future support for responding to ZRPOS:
  send_file_offset(offset) {
  }
  */

  /*
      Sending logic works thus:
          - ASSUME the receiver can overlap I/O (CANOVIO)
              (so fail if !CANFDX || !CANOVIO)
          - Sender opens the firehose … all ZCRCG (!end/!ack)
              until the end, when we send a ZCRCE (end/!ack)
              NB: try 8k/32k/64k chunk sizes? Looks like there’s
              no need to change the packet otherwise.
  */
  //TODO: Put this on a Transfer object similar to what Receive uses?
  _send_interim_file_piece(bytes_obj) {
    //We don’t ask the receiver to confirm because there’s no need.
    this._send_file_part(bytes_obj, "no_end_no_ack");

    //This pattern will allow
    //error-correction without buffering the entire stream in JS.
    //For now the promise is always resolved, but in the future we
    //can make it only resolve once we’ve gotten acknowledgement.
    return Promise.resolve();
  }
  _ensure_we_are_sending() {
    if (!this._sending_file) throw "Not sending a file currently!";
  }

  //This resolves once we receive ZEOF.
  _end_file(bytes_obj) {
    this._ensure_we_are_sending();

    //Is the frame-end-ness of this last packet redundant
    //with the ZEOF packet?? - No. It signals the receiver that
    //the next thing to expect is a header, not a packet.

    //no-ack, following lrzsz’s example
    this._send_file_part(bytes_obj, "end_no_ack");
    var sess = this;

    //Register this before we send ZEOF in case of local round-trip.
    //(Basically just for synchronous testing, but.)
    var ret = new Promise(function (res) {
      //console.log("UNSETTING SENDING FLAG");
      sess._sending_file = false;
      sess._prepare_to_receive_ZRINIT(res);
    });
    this._send_header("ZEOF", this._file_offset);
    this._file_offset = 0;
    return ret;
  }

  //Called at the beginning of our session
  //and also when we’re done sending a file.
  _prepare_to_receive_ZRINIT(after_consume) {
    this._next_header_handler = {
      ZRINIT: function (hdr) {
        this._consume_ZRINIT(hdr);
        if (after_consume) after_consume();
      }
    };
  }

  /**
   * Signal to the receiver that the ZMODEM session is wrapping up.
   *
   * @returns {Promise} Resolves when the receiver has responded to
   * our signal that the session is over.
   */
  close() {
    var ok_to_close = this._last_header_name === "ZRINIT";
    if (!ok_to_close) {
      ok_to_close = this._last_header_name === "ZSKIP";
    }
    if (!ok_to_close) {
      ok_to_close = this._last_sent_header.name === "ZSINIT" && this._last_header_name === "ZACK";
    }
    if (!ok_to_close) {
      throw "Can’t close; last received header was “" + this._last_header_name + "”";
    }
    var sess = this;
    var ret = new Promise(function (res, rej) {
      sess._next_header_handler = {
        ZFIN: function () {
          sess._sender(OVER_AND_OUT);
          sess._sent_OO = true;
          sess._on_session_end();
          res();
        }
      };
    });
    this._send_header("ZFIN");
    return ret;
  }
  _has_ended() {
    return this.aborted() || !!this._sent_OO;
  }
  _send_file_part(bytes_obj, final_packetend) {
    if (!this._sent_ZDATA) {
      this._send_header("ZDATA", this._file_offset);
      this._sent_ZDATA = true;
    }
    var obj_offset = 0;
    var bytes_count = bytes_obj.length;

    //We have to go through at least once in event of an
    //empty buffer, e.g., an empty end_file.
    while (true) {
      var chunk_size = Math.min(obj_offset + MAX_CHUNK_LENGTH, bytes_count) - obj_offset;
      var at_end = chunk_size + obj_offset >= bytes_count;
      var chunk = bytes_obj.slice(obj_offset, obj_offset + chunk_size);
      if (!(chunk instanceof Array)) {
        chunk = Array.prototype.slice.call(chunk);
      }
      this._build_and_send_subpacket(chunk, at_end ? final_packetend : "no_end_no_ack");
      this._file_offset += chunk_size;
      obj_offset += chunk_size;
      if (obj_offset >= bytes_count) break;
    }
  }
  _consume_first() {
    if (!this._parse_and_consume_header()) {
      //When the ZMODEM receive program starts, it immediately sends
      //a ZRINIT header to initiate ZMODEM file transfers, or a
      //ZCHALLENGE header to verify the sending program. The receive
      //program resends its header at response time (default 10 second)
      //intervals for a suitable period of time (40 seconds total)
      //before falling back to YMODEM protocol.
      if (this._input_buffer.join() === "67") {
        throw "Receiver has fallen back to YMODEM.";
      }
    }
  }
  _on_session_end() {
    this._stop_keepalive();
    super._on_session_end();
  }
};
Object.assign(Zmodem.Session.Send.prototype, {
  type: "send"
});

/***/ },

/***/ 2643
/*!******************************************************!*\
  !*** ./src/components/baseTerminalTab.component.pug ***!
  \******************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/baseTerminalTab.component.pug */ 8570);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 2657
/*!*************************************************************************!*\
  !*** ./src/components/inputProcessingSettings.component.pug?ngResource ***!
  \*************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/inputProcessingSettings.component.pug?ngResource */ 3894);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 2861
/*!*****************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/colorPicker.component.pug?ngResource ***!
  \*****************************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cdiv [style.background]=\"model\" ngx-colors-trigger [(ngModel)]=\"model\" (ngModelChange)=\"modelChange.emit($event)\" [ngbTooltip]=\"hint\"\u003E{{ title }}\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 2897
/*!****************************************************!*\
  !*** ../app/node_modules/es-object-atoms/index.js ***!
  \****************************************************/
(module) {

"use strict";


/** @type {import('.')} */
module.exports = Object;

/***/ },

/***/ 2902
/*!*************************************!*\
  !*** ./node_modules/hexer/index.js ***!
  \*************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


hex.Transform = __webpack_require__(/*! ./hex_transform */ 7840);
hex.ChunkedTransform = __webpack_require__(/*! ./chunked_hex_transform */ 803);
hex.Spy = __webpack_require__(/*! ./hex_spy */ 2326);
module.exports = hex;
function hex(buffer, options) {
  if (typeof buffer === 'string') {
    return hex(Buffer(buffer), options);
  }
  if (!Buffer.isBuffer(buffer)) {
    throw new Error('invalid argument to hex, expected a buffer or string');
  }
  options = options || {};
  if (!options.offsetWidth) {
    options.offsetWidth = 2 * Math.ceil(buffer.length.toString(16).length / 2);
  }
  var stream = hex.Transform(options);
  stream.write(buffer);
  stream.end();
  var out = stream.read();
  if (out === null) {
    return '';
  }
  out = String(out);
  out = out.replace(/\n+$/, '');
  return out;
}

/***/ },

/***/ 2943
/*!*********************************************************************!*\
  !*** ./src/components/colorSchemePreview.component.scss?ngResource ***!
  \*********************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {


        var result = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./colorSchemePreview.component.scss?ngResource */ 9546);

        if (result && result.__esModule) {
            result = result.default;
        }

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ },

/***/ 2947
/*!*********************!*\
  !*** external "fs" ***!
  \*********************/
(module) {

"use strict";
if(typeof __WEBPACK_EXTERNAL_MODULE__2947__ === 'undefined') { var e = new Error("Cannot find module 'fs'"); e.code = 'MODULE_NOT_FOUND'; throw e; }

module.exports = __WEBPACK_EXTERNAL_MODULE__2947__;

/***/ },

/***/ 3010
/*!**********************************************************!*\
  !*** ../app/node_modules/which-boxed-primitive/index.js ***!
  \**********************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var isString = __webpack_require__(/*! is-string */ 3156);
var isNumber = __webpack_require__(/*! is-number-object */ 3112);
var isBoolean = __webpack_require__(/*! is-boolean-object */ 4281);
var isSymbol = __webpack_require__(/*! is-symbol */ 9885);
var isBigInt = __webpack_require__(/*! is-bigint */ 4026);

/** @type {import('.')} */
// eslint-disable-next-line consistent-return
module.exports = function whichBoxedPrimitive(value) {
  // eslint-disable-next-line eqeqeq
  if (value == null || typeof value !== 'object' && typeof value !== 'function') {
    return null;
  }
  if (isString(value)) {
    return 'String';
  }
  if (isNumber(value)) {
    return 'Number';
  }
  if (isBoolean(value)) {
    return 'Boolean';
  }
  if (isSymbol(value)) {
    return 'Symbol';
  }
  if (isBigInt(value)) {
    return 'BigInt';
  }
};

/***/ },

/***/ 3077
/*!**********************************************!*\
  !*** ../app/node_modules/get-proto/index.js ***!
  \**********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var reflectGetProto = __webpack_require__(/*! ./Reflect.getPrototypeOf */ 2007);
var originalGetProto = __webpack_require__(/*! ./Object.getPrototypeOf */ 6557);
var getDunderProto = __webpack_require__(/*! dunder-proto/get */ 9875);

/** @type {import('.')} */
module.exports = reflectGetProto ? function getProto(O) {
  // @ts-expect-error TS can't narrow inside a closure, for some reason
  return reflectGetProto(O);
} : originalGetProto ? function getProto(O) {
  if (!O || typeof O !== 'object' && typeof O !== 'function') {
    throw new TypeError('getProto: not an object');
  }
  // @ts-expect-error TS can't narrow inside a closure, for some reason
  return originalGetProto(O);
} : getDunderProto ? function getProto(O) {
  // @ts-expect-error TS can't narrow inside a closure, for some reason
  return getDunderProto(O);
} : null;

/***/ },

/***/ 3112
/*!*****************************************************!*\
  !*** ../app/node_modules/is-number-object/index.js ***!
  \*****************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var callBound = __webpack_require__(/*! call-bound */ 4731);
var $numToStr = callBound('Number.prototype.toString');

/** @type {import('.')} */
var tryNumberObject = function tryNumberObject(value) {
  try {
    $numToStr(value);
    return true;
  } catch (e) {
    return false;
  }
};
var $toString = callBound('Object.prototype.toString');
var numClass = '[object Number]';
var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ 6565)();

/** @type {import('.')} */
module.exports = function isNumberObject(value) {
  if (typeof value === 'number') {
    return true;
  }
  if (!value || typeof value !== 'object') {
    return false;
  }
  return hasToStringTag ? tryNumberObject(value) : $toString(value) === numClass;
};

/***/ },

/***/ 3139
/*!************************************************************************************************************************************************************!*\
  !*** ../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./src/components/colorSchemeSettingsForMode.component.scss?ngResource ***!
  \************************************************************************************************************************************************************/
(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ 1333);
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ 5955);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ".head{flex:none}.body{overflow:auto;flex:auto;min-height:0}.swatch{width:10px;height:10px;border-radius:50%;margin-right:3px;margin-bottom:3px;box-shadow:0 1px 1px rgba(0,0,0,.5)}.list-group-item color-scheme-preview{margin-left:14px}", "",{"version":3,"sources":["webpack://./src/components/colorSchemeSettingsForMode.component.scss"],"names":[],"mappings":"AAAA,MACI,SAAA,CAGJ,MACI,aAAA,CACA,SAAA,CACA,YAAA,CAGJ,QACI,UAAA,CACA,WAAA,CACA,iBAAA,CACA,gBAAA,CACA,iBAAA,CACA,mCAAA,CAGJ,sCACI,gBAAA","sourcesContent":[".head {\n    flex: none;\n}\n\n.body {\n    overflow: auto;\n    flex: auto;\n    min-height: 0;\n}\n\n.swatch {\n    width: 10px;\n    height: 10px;\n    border-radius: 50%;\n    margin-right: 3px;\n    margin-bottom: 3px;\n    box-shadow: 0 1px 1px rgba(0, 0, 0, .5);\n}\n\n.list-group-item color-scheme-preview {\n    margin-left: 14px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ },

/***/ 3147
/*!***********************************************!*\
  !*** ./node_modules/zmodem.js/src/zheader.js ***!
  \***********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var Zmodem = module.exports;
Object.assign(Zmodem, __webpack_require__(/*! ./encode */ 6248), __webpack_require__(/*! ./zdle */ 6563), __webpack_require__(/*! ./zmlib */ 3568), __webpack_require__(/*! ./zcrc */ 142), __webpack_require__(/*! ./zerror */ 3478));
const ZPAD = '*'.charCodeAt(0),
  ZBIN = 'A'.charCodeAt(0),
  ZHEX = 'B'.charCodeAt(0),
  ZBIN32 = 'C'.charCodeAt(0);

//NB: lrzsz uses \x8a rather than \x0a where the specs
//say to use LF. For simplicity, we avoid that and just use
//the 7-bit LF character.
const HEX_HEADER_CRLF = [0x0d, 0x0a];
const HEX_HEADER_CRLF_XON = HEX_HEADER_CRLF.slice(0).concat([Zmodem.ZMLIB.XON]);

//These are more or less duplicated by the logic in trim_leading_garbage().
//
//"**" + ZDLE_CHAR + "B"
const HEX_HEADER_PREFIX = [ZPAD, ZPAD, Zmodem.ZMLIB.ZDLE, ZHEX];
const BINARY16_HEADER_PREFIX = [ZPAD, Zmodem.ZMLIB.ZDLE, ZBIN];
const BINARY32_HEADER_PREFIX = [ZPAD, Zmodem.ZMLIB.ZDLE, ZBIN32];

/** Class that represents a ZMODEM header. */
Zmodem.Header = class ZmodemHeader {
  //lrzsz’s “sz” command sends a random (?) CR/0x0d byte
  //after ZEOF. Let’s accommodate 0x0a, 0x0d, 0x8a, and 0x8d.
  //
  //Also, when you skip a file, sz outputs a message about it.
  //
  //It appears that we’re supposed to ignore anything until
  //[ ZPAD, ZDLE ] when we’re looking for a header.

  /**
   * Weed out the leading bytes that aren’t valid to start a ZMODEM header.
   *
   * @param {number[]} ibuffer - The octet values to parse.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *      This object is mutated in the function.
   *
   * @returns {number[]} The octet values that were removed from the start
   *      of “ibuffer”. Order is preserved.
   */
  static trim_leading_garbage(ibuffer) {
    //Since there’s no escaping of the output it’s possible
    //that the garbage could trip us up, e.g., by having a filename
    //be a legit ZMODEM header. But that’s pretty unlikely.

    //Everything up to the first ZPAD: garbage
    //If first ZPAD has asterisk + ZDLE

    var garbage = [];
    var discard_all,
      parser,
      next_ZPAD_at_least = 0;
    TRIM_LOOP: while (ibuffer.length && !parser) {
      var first_ZPAD = ibuffer.indexOf(ZPAD);

      //No ZPAD? Then we purge the input buffer cuz it’s all garbage.
      if (first_ZPAD === -1) {
        discard_all = true;
        break TRIM_LOOP;
      } else {
        garbage.push.apply(garbage, ibuffer.splice(0, first_ZPAD));

        //buffer has only an asterisk … gotta see about more
        if (ibuffer.length < 2) {
          break TRIM_LOOP;
        } else if (ibuffer[1] === ZPAD) {
          //Two leading ZPADs should be a hex header.

          //We’re assuming the length of the header is 4 in
          //this logic … but ZMODEM isn’t likely to change, so.
          if (ibuffer.length < HEX_HEADER_PREFIX.length) {
            if (ibuffer.join() === HEX_HEADER_PREFIX.slice(0, ibuffer.length).join()) {
              //We have an incomplete fragment that matches
              //HEX_HEADER_PREFIX. So don’t trim any more.
              break TRIM_LOOP;
            }

            //Otherwise, we’ll discard one.
          } else if (ibuffer[2] === HEX_HEADER_PREFIX[2] && ibuffer[3] === HEX_HEADER_PREFIX[3]) {
            parser = _parse_hex;
          }
        } else if (ibuffer[1] === Zmodem.ZMLIB.ZDLE) {
          //ZPAD + ZDLE should be a binary header.
          if (ibuffer.length < BINARY16_HEADER_PREFIX.length) {
            break TRIM_LOOP;
          }
          if (ibuffer[2] === BINARY16_HEADER_PREFIX[2]) {
            parser = _parse_binary16;
          } else if (ibuffer[2] === BINARY32_HEADER_PREFIX[2]) {
            parser = _parse_binary32;
          }
        }
        if (!parser) {
          garbage.push(ibuffer.shift());
        }
      }
    }
    if (discard_all) {
      garbage.push.apply(garbage, ibuffer.splice(0));
    }

    //For now we’ll throw away the parser.
    //It’s not hard for parse() to discern anyway.

    return garbage;
  }

  /**
   * Parse out a Header object from a given array of octet values.
   *
   * An exception is thrown if the given bytes are definitively invalid
   * as header values.
   *
   * @param {number[]} octets - The octet values to parse.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *      This object is mutated in the function.
   *
   * @returns {Header|undefined} An instance of the appropriate Header
   *      subclass, or undefined if not enough octet values are given
   *      to determine whether there is a valid header here or not.
   */
  static parse(octets) {
    var hdr;
    if (octets[1] === ZPAD) {
      hdr = _parse_hex(octets);
      return hdr && [hdr, 16];
    } else if (octets[2] === ZBIN) {
      hdr = _parse_binary16(octets, 3);
      return hdr && [hdr, 16];
    } else if (octets[2] === ZBIN32) {
      hdr = _parse_binary32(octets);
      return hdr && [hdr, 32];
    }
    if (octets.length < 3) return;
    throw "Unrecognized/unsupported octets: " + octets.join();
  }

  /**
   * Build a Header subclass given a name and arguments.
   *
   * @param {string} name - The header type name, e.g., “ZRINIT”.
   *
   * @param {...*} args - The arguments to pass to the appropriate
   *      subclass constructor. These aren’t documented currently
   *      but are pretty easy to glean from the code.
   *
   * @returns {Header} An instance of the appropriate Header subclass.
   */
  static build(name /*, args */) {
    var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);

    //TODO: make this better
    var Ctr = FRAME_NAME_CREATOR[name];
    if (!Ctr) throw "No frame class “" + name + "” is defined!";
    args.shift();

    //Plegh!
    //https://stackoverflow.com/questions/33193310/constr-applythis-args-in-es6-classes
    var hdr = new (Ctr.bind.apply(Ctr, [null].concat(args)))();
    return hdr;
  }

  /**
   * Return the octet values array that represents the object
   * in ZMODEM hex encoding.
   *
   * @returns {number[]} An array of octet values suitable for sending
   *      as binary data.
   */
  to_hex() {
    var to_crc = this._crc_bytes();
    return HEX_HEADER_PREFIX.concat(Zmodem.ENCODELIB.octets_to_hex(to_crc.concat(Zmodem.CRC.crc16(to_crc))), this._hex_header_ending);
  }

  /**
   * Return the octet values array that represents the object
   * in ZMODEM binary encoding with a 16-bit CRC.
   *
   * @param {ZDLE} zencoder - A ZDLE instance to use for
   *      ZDLE encoding.
   *
   * @returns {number[]} An array of octet values suitable for sending
   *      as binary data.
   */
  to_binary16(zencoder) {
    return this._to_binary(zencoder, BINARY16_HEADER_PREFIX, Zmodem.CRC.crc16);
  }

  /**
   * Return the octet values array that represents the object
   * in ZMODEM binary encoding with a 32-bit CRC.
   *
   * @param {ZDLE} zencoder - A ZDLE instance to use for
   *      ZDLE encoding.
   *
   * @returns {number[]} An array of octet values suitable for sending
   *      as binary data.
   */
  to_binary32(zencoder) {
    return this._to_binary(zencoder, BINARY32_HEADER_PREFIX, Zmodem.CRC.crc32);
  }

  //This is never called directly, but only as super().
  constructor() {
    if (!this._bytes4) {
      this._bytes4 = [0, 0, 0, 0];
    }
  }
  _to_binary(zencoder, prefix, crc_func) {
    var to_crc = this._crc_bytes();

    //Both the 4-byte payload and the CRC bytes are ZDLE-encoded.
    var octets = prefix.concat(zencoder.encode(to_crc.concat(crc_func(to_crc))));
    return octets;
  }
  _crc_bytes() {
    return [this.TYPENUM].concat(this._bytes4);
  }
};
Zmodem.Header.prototype._hex_header_ending = HEX_HEADER_CRLF_XON;
class ZRQINIT_HEADER extends Zmodem.Header {}
;

//----------------------------------------------------------------------

const ZRINIT_FLAG = {
  //----------------------------------------------------------------------
  // Bit Masks for ZRINIT flags byte ZF0
  //----------------------------------------------------------------------
  CANFDX: 0x01,
  // Rx can send and receive true FDX
  CANOVIO: 0x02,
  // Rx can receive data during disk I/O
  CANBRK: 0x04,
  // Rx can send a break signal
  CANCRY: 0x08,
  // Receiver can decrypt -- nothing does this
  CANLZW: 0x10,
  // Receiver can uncompress -- nothing does this
  CANFC32: 0x20,
  // Receiver can use 32 bit Frame Check
  ESCCTL: 0x40,
  // Receiver expects ctl chars to be escaped
  ESC8: 0x80 // Receiver expects 8th bit to be escaped
};
function _get_ZRINIT_flag_num(fl) {
  if (!ZRINIT_FLAG[fl]) {
    throw new Zmodem.Error("Invalid ZRINIT flag: " + fl);
  }
  return ZRINIT_FLAG[fl];
}
class ZRINIT_HEADER extends Zmodem.Header {
  constructor(flags_arr, bufsize) {
    super();
    var flags_num = 0;
    if (!bufsize) bufsize = 0;
    flags_arr.forEach(function (fl) {
      flags_num |= _get_ZRINIT_flag_num(fl);
    });
    this._bytes4 = [bufsize & 0xff, bufsize >> 8, 0, flags_num];
  }

  //undefined if nonstop I/O is allowed
  get_buffer_size() {
    return Zmodem.ENCODELIB.unpack_u16_be(this._bytes4.slice(0, 2)) || undefined;
  }

  //Unimplemented:
  //  can_decrypt
  //  can_decompress

  //----------------------------------------------------------------------
  //function names taken from Jacques Mattheij’s implementation,
  //as used in syncterm.

  can_full_duplex() {
    return !!(this._bytes4[3] & ZRINIT_FLAG.CANFDX);
  }
  can_overlap_io() {
    return !!(this._bytes4[3] & ZRINIT_FLAG.CANOVIO);
  }
  can_break() {
    return !!(this._bytes4[3] & ZRINIT_FLAG.CANBRK);
  }
  can_fcs_32() {
    return !!(this._bytes4[3] & ZRINIT_FLAG.CANFC32);
  }
  escape_ctrl_chars() {
    return !!(this._bytes4[3] & ZRINIT_FLAG.ESCCTL);
  }

  //Is this used? I don’t see it used in lrzsz or syncterm
  //Looks like it was a “foreseen” feature that Forsberg
  //never implemented. (The need for it went away, maybe?)
  escape_8th_bit() {
    return !!(this._bytes4[3] & ZRINIT_FLAG.ESC8);
  }
}
;

//----------------------------------------------------------------------

//Since context makes clear what’s going on, we use these
//rather than the T-prefixed constants in the specification.
const ZSINIT_FLAG = {
  ESCCTL: 0x40,
  // Transmitter will escape ctl chars
  ESC8: 0x80 // Transmitter will escape 8th bit
};
function _get_ZSINIT_flag_num(fl) {
  if (!ZSINIT_FLAG[fl]) {
    throw "Invalid ZSINIT flag: " + fl;
  }
  return ZSINIT_FLAG[fl];
}
class ZSINIT_HEADER extends Zmodem.Header {
  constructor(flags_arr, attn_seq_arr) {
    super();
    var flags_num = 0;
    flags_arr.forEach(function (fl) {
      flags_num |= _get_ZSINIT_flag_num(fl);
    });
    this._bytes4 = [0, 0, 0, flags_num];
    if (attn_seq_arr) {
      if (attn_seq_arr.length > 31) {
        throw "Attn sequence must be <= 31 bytes";
      }
      if (attn_seq_arr.some(function (num) {
        return num > 255;
      })) {
        throw "Attn sequence (" + attn_seq_arr + ") must be <256";
      }
      this._data = attn_seq_arr.concat([0]);
    }
  }
  escape_ctrl_chars() {
    return !!(this._bytes4[3] & ZSINIT_FLAG.ESCCTL);
  }

  //Is this used? I don’t see it used in lrzsz or syncterm
  escape_8th_bit() {
    return !!(this._bytes4[3] & ZSINIT_FLAG.ESC8);
  }
}

//Thus far it doesn’t seem we really need this header except to respond
//to ZSINIT, which doesn’t require a payload.
class ZACK_HEADER extends Zmodem.Header {
  constructor(payload4) {
    super();
    if (payload4) {
      this._bytes4 = payload4.slice();
    }
  }
}
ZACK_HEADER.prototype._hex_header_ending = HEX_HEADER_CRLF;

//----------------------------------------------------------------------

const ZFILE_VALUES = {
  //ZF3 (i.e., first byte)
  extended: {
    sparse: 0x40 //ZXSPARS
  },
  //ZF2
  transport: [undefined, "compress",
  //ZTLZW
  "encrypt",
  //ZTCRYPT
  "rle" //ZTRLE
  ],
  //ZF1
  management: [undefined, "newer_or_longer",
  //ZF1_ZMNEWL
  "crc",
  //ZF1_ZMCRC
  "append",
  //ZF1_ZMAPND
  "clobber",
  //ZF1_ZMCLOB
  "newer",
  //ZF1_ZMNEW
  "mtime_or_length",
  //ZF1_ZMNEW
  "protect",
  //ZF1_ZMPROT
  "rename" //ZF1_ZMPROT
  ],
  //ZF0 (i.e., last byte)
  conversion: [undefined, "binary",
  //ZCBIN
  "text",
  //ZCNL
  "resume" //ZCRESUM
  ]
};
const ZFILE_ORDER = ["extended", "transport", "management", "conversion"];
const ZMSKNOLOC = 0x80,
  MANAGEMENT_MASK = 0x1f,
  ZXSPARS = 0x40;
class ZFILE_HEADER extends Zmodem.Header {
  //TODO: allow options on instantiation
  get_options() {
    var opts = {
      sparse: !!(this._bytes4[0] & ZXSPARS)
    };
    var bytes_copy = this._bytes4.slice(0);
    ZFILE_ORDER.forEach(function (key, i) {
      if (ZFILE_VALUES[key] instanceof Array) {
        if (key === "management") {
          opts.skip_if_absent = !!(bytes_copy[i] & ZMSKNOLOC);
          bytes_copy[i] &= MANAGEMENT_MASK;
        }
        opts[key] = ZFILE_VALUES[key][bytes_copy[i]];
      } else {
        for (var extkey in ZFILE_VALUES[key]) {
          opts[extkey] = !!(bytes_copy[i] & ZFILE_VALUES[key][extkey]);
          if (opts[extkey]) {
            bytes_copy[i] ^= ZFILE_VALUES[key][extkey];
          }
        }
      }
      if (!opts[key] && bytes_copy[i]) {
        opts[key] = "unknown:" + bytes_copy[i];
      }
    });
    return opts;
  }
}

//----------------------------------------------------------------------

//Empty headers - in addition to ZRQINIT
class ZSKIP_HEADER extends Zmodem.Header {}
//No need for ZNAK
class ZABORT_HEADER extends Zmodem.Header {}
class ZFIN_HEADER extends Zmodem.Header {}
class ZFERR_HEADER extends Zmodem.Header {}
ZFIN_HEADER.prototype._hex_header_ending = HEX_HEADER_CRLF;
class ZOffsetHeader extends Zmodem.Header {
  constructor(offset) {
    super();
    this._bytes4 = Zmodem.ENCODELIB.pack_u32_le(offset);
  }
  get_offset() {
    return Zmodem.ENCODELIB.unpack_u32_le(this._bytes4);
  }
}
class ZRPOS_HEADER extends ZOffsetHeader {}
;
class ZDATA_HEADER extends ZOffsetHeader {}
;
class ZEOF_HEADER extends ZOffsetHeader {}
;

//As request, receiver creates.
/* UNIMPLEMENTED FOR NOW
class ZCRC_HEADER extends ZHeader {
    constructor(crc_le_bytes) {
        super();
        if (crc_le_bytes) {  //response, sender creates
            this._bytes4 = crc_le_bytes;
        }
    }
}
*/

//No ZCHALLENGE implementation

//class ZCOMPL_HEADER extends ZHeader {}
//class ZCAN_HEADER extends Zmodem.Header {}

//As described, this header represents an information disclosure.
//It could be interpreted, I suppose, merely as “this is how much space
//I have FOR YOU.”
//TODO: implement if needed/requested
//class ZFREECNT_HEADER extends ZmodemHeader {}

//----------------------------------------------------------------------

const FRAME_CLASS_TYPES = [[ZRQINIT_HEADER, "ZRQINIT"], [ZRINIT_HEADER, "ZRINIT"], [ZSINIT_HEADER, "ZSINIT"], [ZACK_HEADER, "ZACK"], [ZFILE_HEADER, "ZFILE"], [ZSKIP_HEADER, "ZSKIP"], undefined,
// [ ZNAK_HEADER, "ZNAK" ],
[ZABORT_HEADER, "ZABORT"], [ZFIN_HEADER, "ZFIN"], [ZRPOS_HEADER, "ZRPOS"], [ZDATA_HEADER, "ZDATA"], [ZEOF_HEADER, "ZEOF"], [ZFERR_HEADER, "ZFERR"],
//see note
undefined,
//[ ZCRC_HEADER, "ZCRC" ],
undefined,
//[ ZCHALLENGE_HEADER, "ZCHALLENGE" ],
undefined,
//[ ZCOMPL_HEADER, "ZCOMPL" ],
undefined,
//[ ZCAN_HEADER, "ZCAN" ],
undefined,
//[ ZFREECNT_HEADER, "ZFREECNT" ],
undefined,
//[ ZCOMMAND_HEADER, "ZCOMMAND" ],
undefined //[ ZSTDERR_HEADER, "ZSTDERR" ],
];

/*
ZFERR is described as “error in reading or writing file”. It’s really
not a good idea from a security angle for the endpoint to expose this
information. We should parse this and handle it as ZABORT but never send it.

Likewise with ZFREECNT: the sender shouldn’t ask how much space is left
on the other box; rather, the receiver should decide what to do with the
file size as the sender reports it.
*/

var FRAME_NAME_CREATOR = {};
for (var fc = 0; fc < FRAME_CLASS_TYPES.length; fc++) {
  if (!FRAME_CLASS_TYPES[fc]) continue;
  FRAME_NAME_CREATOR[FRAME_CLASS_TYPES[fc][1]] = FRAME_CLASS_TYPES[fc][0];
  Object.assign(FRAME_CLASS_TYPES[fc][0].prototype, {
    TYPENUM: fc,
    NAME: FRAME_CLASS_TYPES[fc][1]
  });
}

//----------------------------------------------------------------------

const CREATORS = [ZRQINIT_HEADER, ZRINIT_HEADER, ZSINIT_HEADER, ZACK_HEADER, ZFILE_HEADER, ZSKIP_HEADER, 'ZNAK', ZABORT_HEADER, ZFIN_HEADER, ZRPOS_HEADER, ZDATA_HEADER, ZEOF_HEADER, ZFERR_HEADER, 'ZCRC',
//ZCRC_HEADER, -- leaving unimplemented?
'ZCHALLENGE', 'ZCOMPL', 'ZCAN', 'ZFREECNT',
// ZFREECNT_HEADER,
'ZCOMMAND', 'ZSTDERR'];
function _get_blank_header(typenum) {
  var creator = CREATORS[typenum];
  if (typeof creator === "string") {
    throw "Received unsupported header: " + creator;
  }

  /*
  if (creator === ZCRC_HEADER) {
      return new creator([0, 0, 0, 0]);
  }
  */

  return _get_blank_header_from_constructor(creator);
}

//referenced outside TODO
function _get_blank_header_from_constructor(creator) {
  if (creator.prototype instanceof ZOffsetHeader) {
    return new creator(0);
  }
  return new creator([]);
}
function _parse_binary16(bytes_arr) {
  //The max length of a ZDLE-encoded binary header w/ 16-bit CRC is:
  //  3 initial bytes, NOT ZDLE-encoded
  //  2 typenum bytes     (1 decoded)
  //  8 data bytes        (4 decoded)
  //  4 CRC bytes         (2 decoded)

  //A 16-bit payload has 7 ZDLE-encoded octets.
  //The ZDLE-encoded octets follow the initial prefix.
  var zdle_decoded = Zmodem.ZDLE.splice(bytes_arr, BINARY16_HEADER_PREFIX.length, 7);
  return zdle_decoded && _parse_non_zdle_binary16(zdle_decoded);
}
function _parse_non_zdle_binary16(decoded) {
  Zmodem.CRC.verify16(decoded.slice(0, 5), decoded.slice(5));
  var typenum = decoded[0];
  var hdr = _get_blank_header(typenum);
  hdr._bytes4 = decoded.slice(1, 5);
  return hdr;
}
function _parse_binary32(bytes_arr) {
  //Same deal as with 16-bit CRC except there are two more
  //potentially ZDLE-encoded bytes, for a total of 9.
  var zdle_decoded = Zmodem.ZDLE.splice(bytes_arr,
  //omit the leading "*", ZDLE, and "C"
  BINARY32_HEADER_PREFIX.length, 9);
  if (!zdle_decoded) return;
  Zmodem.CRC.verify32(zdle_decoded.slice(0, 5), zdle_decoded.slice(5));
  var typenum = zdle_decoded[0];
  var hdr = _get_blank_header(typenum);
  hdr._bytes4 = zdle_decoded.slice(1, 5);
  return hdr;
}
function _parse_hex(bytes_arr) {
  //A hex header always has:
  //  4 bytes for the ** . ZDLE . 'B'
  //  2 hex bytes for the header type
  //  8 hex bytes for the header content
  //  4 hex bytes for the CRC
  //  1-2 bytes for (CR/)LF
  //  (...and at this point the trailing XON is already stripped)
  //
  //----------------------------------------------------------------------
  //A carriage return and line feed are sent with HEX headers.  The
  //receive routine expects to see at least one of these characters, two
  //if the first is CR.
  //----------------------------------------------------------------------
  //
  //^^ I guess it can be either CR/LF or just LF … though those two
  //sentences appear to be saying contradictory things.

  var lf_pos = bytes_arr.indexOf(0x8a); //lrzsz sends this

  if (-1 === lf_pos) {
    lf_pos = bytes_arr.indexOf(0x0a);
  }
  var hdr_err, hex_bytes;
  if (-1 === lf_pos) {
    if (bytes_arr.length > 11) {
      hdr_err = "Invalid hex header - no LF detected within 12 bytes!";
    }

    //incomplete header
    return;
  } else {
    hex_bytes = bytes_arr.splice(0, lf_pos);

    //Trim off the LF
    bytes_arr.shift();
    if (hex_bytes.length === 19) {
      //NB: The spec says CR but seems to treat high-bit variants
      //of control characters the same as the regulars; should we
      //also allow 0x8d?
      var preceding = hex_bytes.pop();
      if (preceding !== 0x0d && preceding !== 0x8d) {
        hdr_err = "Invalid hex header: (CR/)LF doesn’t have CR!";
      }
    } else if (hex_bytes.length !== 18) {
      hdr_err = "Invalid hex header: invalid number of bytes before LF!";
    }
  }
  if (hdr_err) {
    hdr_err += " (" + hex_bytes.length + " bytes: " + hex_bytes.join() + ")";
    throw hdr_err;
  }
  hex_bytes.splice(0, 4);

  //Should be 7 bytes ultimately:
  //  1 for typenum
  //  4 for header data
  //  2 for CRC
  var octets = Zmodem.ENCODELIB.parse_hex_octets(hex_bytes);
  return _parse_non_zdle_binary16(octets);
}
Zmodem.Header.parse_hex = _parse_hex;

/***/ },

/***/ 3156
/*!**********************************************!*\
  !*** ../app/node_modules/is-string/index.js ***!
  \**********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var callBound = __webpack_require__(/*! call-bound */ 4731);

/** @type {(receiver: ThisParameterType<typeof String.prototype.valueOf>, ...args: Parameters<typeof String.prototype.valueOf>) => ReturnType<typeof String.prototype.valueOf>} */
var $strValueOf = callBound('String.prototype.valueOf');

/** @type {import('.')} */
var tryStringObject = function tryStringObject(value) {
  try {
    $strValueOf(value);
    return true;
  } catch (e) {
    return false;
  }
};
/** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
var $toString = callBound('Object.prototype.toString');
var strClass = '[object String]';
var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ 6565)();

/** @type {import('.')} */
module.exports = function isString(value) {
  if (typeof value === 'string') {
    return true;
  }
  if (!value || typeof value !== 'object') {
    return false;
  }
  return hasToStringTag ? tryStringObject(value) : $toString(value) === strClass;
};

/***/ },

/***/ 3306
/*!******************************************************************!*\
  !*** ./src/components/terminalToolbar.component.scss?ngResource ***!
  \******************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {


        var result = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./terminalToolbar.component.scss?ngResource */ 7061);

        if (result && result.__esModule) {
            result = result.default;
        }

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ },

/***/ 3413
/*!****************************************************!*\
  !*** ../app/node_modules/math-intrinsics/floor.js ***!
  \****************************************************/
(module) {

"use strict";


/** @type {import('./floor')} */
module.exports = Math.floor;

/***/ },

/***/ 3421
/*!**************************************************************!*\
  !*** ./node_modules/@xterm/addon-canvas/lib/addon-canvas.js ***!
  \**************************************************************/
(module) {

!function (e, t) {
   true ? module.exports = t() : 0;
}(self, () => (() => {
  "use strict";

  var e = {
      903: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.BaseRenderLayer = void 0;
        const s = i(274),
          r = i(627),
          o = i(237),
          n = i(860),
          a = i(374),
          h = i(296),
          l = i(345),
          c = i(859),
          d = i(399),
          _ = i(855);
        class u extends c.Disposable {
          get canvas() {
            return this._canvas;
          }
          get cacheCanvas() {
            return this._charAtlas?.pages[0].canvas;
          }
          constructor(e, t, i, r, o, n, a, d, _, u) {
            super(), this._terminal = e, this._container = t, this._alpha = o, this._themeService = n, this._bufferService = a, this._optionsService = d, this._decorationService = _, this._coreBrowserService = u, this._deviceCharWidth = 0, this._deviceCharHeight = 0, this._deviceCellWidth = 0, this._deviceCellHeight = 0, this._deviceCharLeft = 0, this._deviceCharTop = 0, this._selectionModel = (0, h.createSelectionRenderModel)(), this._bitmapGenerator = [], this._charAtlasDisposable = this.register(new c.MutableDisposable()), this._onAddTextureAtlasCanvas = this.register(new l.EventEmitter()), this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event, this._cellColorResolver = new s.CellColorResolver(this._terminal, this._optionsService, this._selectionModel, this._decorationService, this._coreBrowserService, this._themeService), this._canvas = this._coreBrowserService.mainDocument.createElement("canvas"), this._canvas.classList.add(`xterm-${i}-layer`), this._canvas.style.zIndex = r.toString(), this._initCanvas(), this._container.appendChild(this._canvas), this._refreshCharAtlas(this._themeService.colors), this.register(this._themeService.onChangeColors(e => {
              this._refreshCharAtlas(e), this.reset(), this.handleSelectionChanged(this._selectionModel.selectionStart, this._selectionModel.selectionEnd, this._selectionModel.columnSelectMode);
            })), this.register((0, c.toDisposable)(() => {
              this._canvas.remove();
            }));
          }
          _initCanvas() {
            this._ctx = (0, a.throwIfFalsy)(this._canvas.getContext("2d", {
              alpha: this._alpha
            })), this._alpha || this._clearAll();
          }
          handleBlur() {}
          handleFocus() {}
          handleCursorMove() {}
          handleGridChanged(e, t) {}
          handleSelectionChanged(e, t, i = !1) {
            this._selectionModel.update(this._terminal._core, e, t, i);
          }
          _setTransparency(e) {
            if (e === this._alpha) return;
            const t = this._canvas;
            this._alpha = e, this._canvas = this._canvas.cloneNode(), this._initCanvas(), this._container.replaceChild(this._canvas, t), this._refreshCharAtlas(this._themeService.colors), this.handleGridChanged(0, this._bufferService.rows - 1);
          }
          _refreshCharAtlas(e) {
            if (!(this._deviceCharWidth <= 0 && this._deviceCharHeight <= 0)) {
              this._charAtlas = (0, r.acquireTextureAtlas)(this._terminal, this._optionsService.rawOptions, e, this._deviceCellWidth, this._deviceCellHeight, this._deviceCharWidth, this._deviceCharHeight, this._coreBrowserService.dpr), this._charAtlasDisposable.value = (0, l.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas), this._charAtlas.warmUp();
              for (let e = 0; e < this._charAtlas.pages.length; e++) this._bitmapGenerator[e] = new g(this._charAtlas.pages[e].canvas);
            }
          }
          resize(e) {
            this._deviceCellWidth = e.device.cell.width, this._deviceCellHeight = e.device.cell.height, this._deviceCharWidth = e.device.char.width, this._deviceCharHeight = e.device.char.height, this._deviceCharLeft = e.device.char.left, this._deviceCharTop = e.device.char.top, this._canvas.width = e.device.canvas.width, this._canvas.height = e.device.canvas.height, this._canvas.style.width = `${e.css.canvas.width}px`, this._canvas.style.height = `${e.css.canvas.height}px`, this._alpha || this._clearAll(), this._refreshCharAtlas(this._themeService.colors);
          }
          clearTextureAtlas() {
            this._charAtlas?.clearTexture();
          }
          _fillCells(e, t, i, s) {
            this._ctx.fillRect(e * this._deviceCellWidth, t * this._deviceCellHeight, i * this._deviceCellWidth, s * this._deviceCellHeight);
          }
          _fillMiddleLineAtCells(e, t, i = 1) {
            const s = Math.ceil(.5 * this._deviceCellHeight);
            this._ctx.fillRect(e * this._deviceCellWidth, (t + 1) * this._deviceCellHeight - s - this._coreBrowserService.dpr, i * this._deviceCellWidth, this._coreBrowserService.dpr);
          }
          _fillBottomLineAtCells(e, t, i = 1, s = 0) {
            this._ctx.fillRect(e * this._deviceCellWidth, (t + 1) * this._deviceCellHeight + s - this._coreBrowserService.dpr - 1, i * this._deviceCellWidth, this._coreBrowserService.dpr);
          }
          _curlyUnderlineAtCell(e, t, i = 1) {
            this._ctx.save(), this._ctx.beginPath(), this._ctx.strokeStyle = this._ctx.fillStyle;
            const s = this._coreBrowserService.dpr;
            this._ctx.lineWidth = s;
            for (let r = 0; r < i; r++) {
              const i = (e + r) * this._deviceCellWidth,
                o = (e + r + .5) * this._deviceCellWidth,
                n = (e + r + 1) * this._deviceCellWidth,
                a = (t + 1) * this._deviceCellHeight - s - 1,
                h = a - s,
                l = a + s;
              this._ctx.moveTo(i, a), this._ctx.bezierCurveTo(i, h, o, h, o, a), this._ctx.bezierCurveTo(o, l, n, l, n, a);
            }
            this._ctx.stroke(), this._ctx.restore();
          }
          _dottedUnderlineAtCell(e, t, i = 1) {
            this._ctx.save(), this._ctx.beginPath(), this._ctx.strokeStyle = this._ctx.fillStyle;
            const s = this._coreBrowserService.dpr;
            this._ctx.lineWidth = s, this._ctx.setLineDash([2 * s, s]);
            const r = e * this._deviceCellWidth,
              o = (t + 1) * this._deviceCellHeight - s - 1;
            this._ctx.moveTo(r, o);
            for (let t = 0; t < i; t++) {
              const s = (e + i + t) * this._deviceCellWidth;
              this._ctx.lineTo(s, o);
            }
            this._ctx.stroke(), this._ctx.closePath(), this._ctx.restore();
          }
          _dashedUnderlineAtCell(e, t, i = 1) {
            this._ctx.save(), this._ctx.beginPath(), this._ctx.strokeStyle = this._ctx.fillStyle;
            const s = this._coreBrowserService.dpr;
            this._ctx.lineWidth = s, this._ctx.setLineDash([4 * s, 3 * s]);
            const r = e * this._deviceCellWidth,
              o = (e + i) * this._deviceCellWidth,
              n = (t + 1) * this._deviceCellHeight - s - 1;
            this._ctx.moveTo(r, n), this._ctx.lineTo(o, n), this._ctx.stroke(), this._ctx.closePath(), this._ctx.restore();
          }
          _fillLeftLineAtCell(e, t, i) {
            this._ctx.fillRect(e * this._deviceCellWidth, t * this._deviceCellHeight, this._coreBrowserService.dpr * i, this._deviceCellHeight);
          }
          _strokeRectAtCell(e, t, i, s) {
            const r = this._coreBrowserService.dpr;
            this._ctx.lineWidth = r, this._ctx.strokeRect(e * this._deviceCellWidth + r / 2, t * this._deviceCellHeight + r / 2, i * this._deviceCellWidth - r, s * this._deviceCellHeight - r);
          }
          _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(e, t, i, s) {
            this._alpha ? this._ctx.clearRect(e * this._deviceCellWidth, t * this._deviceCellHeight, i * this._deviceCellWidth, s * this._deviceCellHeight) : (this._ctx.fillStyle = this._themeService.colors.background.css, this._ctx.fillRect(e * this._deviceCellWidth, t * this._deviceCellHeight, i * this._deviceCellWidth, s * this._deviceCellHeight));
          }
          _fillCharTrueColor(e, t, i) {
            this._ctx.font = this._getFont(!1, !1), this._ctx.textBaseline = o.TEXT_BASELINE, this._clipRow(i);
            let s = !1;
            !1 !== this._optionsService.rawOptions.customGlyphs && (s = (0, n.tryDrawCustomChar)(this._ctx, e.getChars(), t * this._deviceCellWidth, i * this._deviceCellHeight, this._deviceCellWidth, this._deviceCellHeight, this._optionsService.rawOptions.fontSize, this._coreBrowserService.dpr)), s || this._ctx.fillText(e.getChars(), t * this._deviceCellWidth + this._deviceCharLeft, i * this._deviceCellHeight + this._deviceCharTop + this._deviceCharHeight);
          }
          _drawChars(e, t, i) {
            const s = e.getChars(),
              r = e.getCode(),
              o = e.getWidth();
            if (this._cellColorResolver.resolve(e, t, this._bufferService.buffer.ydisp + i, this._deviceCellWidth), !this._charAtlas) return;
            let n;
            if (n = s && s.length > 1 ? this._charAtlas.getRasterizedGlyphCombinedChar(s, this._cellColorResolver.result.bg, this._cellColorResolver.result.fg, this._cellColorResolver.result.ext, !0) : this._charAtlas.getRasterizedGlyph(e.getCode() || _.WHITESPACE_CELL_CODE, this._cellColorResolver.result.bg, this._cellColorResolver.result.fg, this._cellColorResolver.result.ext, !0), !n.size.x || !n.size.y) return;
            this._ctx.save(), this._clipRow(i), this._bitmapGenerator[n.texturePage] && this._charAtlas.pages[n.texturePage].canvas !== this._bitmapGenerator[n.texturePage].canvas && (this._bitmapGenerator[n.texturePage]?.bitmap?.close(), delete this._bitmapGenerator[n.texturePage]), this._charAtlas.pages[n.texturePage].version !== this._bitmapGenerator[n.texturePage]?.version && (this._bitmapGenerator[n.texturePage] || (this._bitmapGenerator[n.texturePage] = new g(this._charAtlas.pages[n.texturePage].canvas)), this._bitmapGenerator[n.texturePage].refresh(), this._bitmapGenerator[n.texturePage].version = this._charAtlas.pages[n.texturePage].version);
            let h = n.size.x;
            this._optionsService.rawOptions.rescaleOverlappingGlyphs && (0, a.allowRescaling)(r, o, n.size.x, this._deviceCellWidth) && (h = this._deviceCellWidth - 1), this._ctx.drawImage(this._bitmapGenerator[n.texturePage]?.bitmap || this._charAtlas.pages[n.texturePage].canvas, n.texturePosition.x, n.texturePosition.y, n.size.x, n.size.y, t * this._deviceCellWidth + this._deviceCharLeft - n.offset.x, i * this._deviceCellHeight + this._deviceCharTop - n.offset.y, h, n.size.y), this._ctx.restore();
          }
          _clipRow(e) {
            this._ctx.beginPath(), this._ctx.rect(0, e * this._deviceCellHeight, this._bufferService.cols * this._deviceCellWidth, this._deviceCellHeight), this._ctx.clip();
          }
          _getFont(e, t) {
            return `${t ? "italic" : ""} ${e ? this._optionsService.rawOptions.fontWeightBold : this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize * this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`;
          }
        }
        t.BaseRenderLayer = u;
        class g {
          get bitmap() {
            return this._bitmap;
          }
          constructor(e) {
            this.canvas = e, this._state = 0, this._commitTimeout = void 0, this._bitmap = void 0, this.version = -1;
          }
          refresh() {
            this._bitmap?.close(), this._bitmap = void 0, d.isSafari || (void 0 === this._commitTimeout && (this._commitTimeout = window.setTimeout(() => this._generate(), 100)), 1 === this._state && (this._state = 2));
          }
          _generate() {
            0 === this._state && (this._bitmap?.close(), this._bitmap = void 0, this._state = 1, window.createImageBitmap(this.canvas).then(e => {
              2 === this._state ? this.refresh() : this._bitmap = e, this._state = 0;
            }), this._commitTimeout && (this._commitTimeout = void 0));
          }
        }
      },
      949: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.CanvasRenderer = void 0;
        const s = i(627),
          r = i(56),
          o = i(374),
          n = i(345),
          a = i(859),
          h = i(873),
          l = i(43),
          c = i(630),
          d = i(744);
        class _ extends a.Disposable {
          constructor(e, t, i, _, u, g, f, v, C, p, m) {
            super(), this._terminal = e, this._screenElement = t, this._bufferService = _, this._charSizeService = u, this._optionsService = g, this._coreBrowserService = C, this._themeService = m, this._observerDisposable = this.register(new a.MutableDisposable()), this._onRequestRedraw = this.register(new n.EventEmitter()), this.onRequestRedraw = this._onRequestRedraw.event, this._onChangeTextureAtlas = this.register(new n.EventEmitter()), this.onChangeTextureAtlas = this._onChangeTextureAtlas.event, this._onAddTextureAtlasCanvas = this.register(new n.EventEmitter()), this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event;
            const x = this._optionsService.rawOptions.allowTransparency;
            this._renderLayers = [new d.TextRenderLayer(this._terminal, this._screenElement, 0, x, this._bufferService, this._optionsService, f, p, this._coreBrowserService, m), new c.SelectionRenderLayer(this._terminal, this._screenElement, 1, this._bufferService, this._coreBrowserService, p, this._optionsService, m), new l.LinkRenderLayer(this._terminal, this._screenElement, 2, i, this._bufferService, this._optionsService, p, this._coreBrowserService, m), new h.CursorRenderLayer(this._terminal, this._screenElement, 3, this._onRequestRedraw, this._bufferService, this._optionsService, v, this._coreBrowserService, p, m)];
            for (const e of this._renderLayers) (0, n.forwardEvent)(e.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas);
            this.dimensions = (0, o.createRenderDimensions)(), this._devicePixelRatio = this._coreBrowserService.dpr, this._updateDimensions(), this._observerDisposable.value = (0, r.observeDevicePixelDimensions)(this._renderLayers[0].canvas, this._coreBrowserService.window, (e, t) => this._setCanvasDevicePixelDimensions(e, t)), this.register(this._coreBrowserService.onWindowChange(e => {
              this._observerDisposable.value = (0, r.observeDevicePixelDimensions)(this._renderLayers[0].canvas, e, (e, t) => this._setCanvasDevicePixelDimensions(e, t));
            })), this.register((0, a.toDisposable)(() => {
              for (const e of this._renderLayers) e.dispose();
              (0, s.removeTerminalFromCache)(this._terminal);
            }));
          }
          get textureAtlas() {
            return this._renderLayers[0].cacheCanvas;
          }
          handleDevicePixelRatioChange() {
            this._devicePixelRatio !== this._coreBrowserService.dpr && (this._devicePixelRatio = this._coreBrowserService.dpr, this.handleResize(this._bufferService.cols, this._bufferService.rows));
          }
          handleResize(e, t) {
            this._updateDimensions();
            for (const e of this._renderLayers) e.resize(this.dimensions);
            this._screenElement.style.width = `${this.dimensions.css.canvas.width}px`, this._screenElement.style.height = `${this.dimensions.css.canvas.height}px`;
          }
          handleCharSizeChanged() {
            this.handleResize(this._bufferService.cols, this._bufferService.rows);
          }
          handleBlur() {
            this._runOperation(e => e.handleBlur());
          }
          handleFocus() {
            this._runOperation(e => e.handleFocus());
          }
          handleSelectionChanged(e, t, i = !1) {
            this._runOperation(s => s.handleSelectionChanged(e, t, i)), this._themeService.colors.selectionForeground && this._onRequestRedraw.fire({
              start: 0,
              end: this._bufferService.rows - 1
            });
          }
          handleCursorMove() {
            this._runOperation(e => e.handleCursorMove());
          }
          clear() {
            this._runOperation(e => e.reset());
          }
          _runOperation(e) {
            for (const t of this._renderLayers) e(t);
          }
          renderRows(e, t) {
            for (const i of this._renderLayers) i.handleGridChanged(e, t);
          }
          clearTextureAtlas() {
            for (const e of this._renderLayers) e.clearTextureAtlas();
          }
          _updateDimensions() {
            if (!this._charSizeService.hasValidSize) return;
            const e = this._coreBrowserService.dpr;
            this.dimensions.device.char.width = Math.floor(this._charSizeService.width * e), this.dimensions.device.char.height = Math.ceil(this._charSizeService.height * e), this.dimensions.device.cell.height = Math.floor(this.dimensions.device.char.height * this._optionsService.rawOptions.lineHeight), this.dimensions.device.char.top = 1 === this._optionsService.rawOptions.lineHeight ? 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._bufferService.rows * this.dimensions.device.cell.height, this.dimensions.device.canvas.width = this._bufferService.cols * this.dimensions.device.cell.width, this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / e), this.dimensions.css.canvas.width = Math.round(this.dimensions.device.canvas.width / e), this.dimensions.css.cell.height = this.dimensions.css.canvas.height / this._bufferService.rows, this.dimensions.css.cell.width = this.dimensions.css.canvas.width / this._bufferService.cols;
          }
          _setCanvasDevicePixelDimensions(e, t) {
            this.dimensions.device.canvas.height = t, this.dimensions.device.canvas.width = e;
            for (const e of this._renderLayers) e.resize(this.dimensions);
            this._requestRedrawViewport();
          }
          _requestRedrawViewport() {
            this._onRequestRedraw.fire({
              start: 0,
              end: this._bufferService.rows - 1
            });
          }
        }
        t.CanvasRenderer = _;
      },
      873: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.CursorRenderLayer = void 0;
        const s = i(457),
          r = i(859),
          o = i(399),
          n = i(782),
          a = i(903);
        class h extends a.BaseRenderLayer {
          constructor(e, t, i, s, o, a, h, l, c, d) {
            super(e, t, "cursor", i, !0, d, o, a, c, l), this._onRequestRedraw = s, this._coreService = h, this._cursorBlinkStateManager = this.register(new r.MutableDisposable()), this._cell = new n.CellData(), this._state = {
              x: 0,
              y: 0,
              isFocused: !1,
              style: "",
              width: 0
            }, this._cursorRenderers = {
              bar: this._renderBarCursor.bind(this),
              block: this._renderBlockCursor.bind(this),
              underline: this._renderUnderlineCursor.bind(this),
              outline: this._renderOutlineCursor.bind(this)
            }, this.register(a.onOptionChange(() => this._handleOptionsChanged())), this._handleOptionsChanged();
          }
          resize(e) {
            super.resize(e), this._state = {
              x: 0,
              y: 0,
              isFocused: !1,
              style: "",
              width: 0
            };
          }
          reset() {
            this._clearCursor(), this._cursorBlinkStateManager.value?.restartBlinkAnimation(), this._handleOptionsChanged();
          }
          handleBlur() {
            this._cursorBlinkStateManager.value?.pause(), this._onRequestRedraw.fire({
              start: this._bufferService.buffer.y,
              end: this._bufferService.buffer.y
            });
          }
          handleFocus() {
            this._cursorBlinkStateManager.value?.resume(), this._onRequestRedraw.fire({
              start: this._bufferService.buffer.y,
              end: this._bufferService.buffer.y
            });
          }
          _handleOptionsChanged() {
            this._optionsService.rawOptions.cursorBlink ? this._cursorBlinkStateManager.value || (this._cursorBlinkStateManager.value = new s.CursorBlinkStateManager(() => this._render(!0), this._coreBrowserService)) : this._cursorBlinkStateManager.clear(), this._onRequestRedraw.fire({
              start: this._bufferService.buffer.y,
              end: this._bufferService.buffer.y
            });
          }
          handleCursorMove() {
            this._cursorBlinkStateManager.value?.restartBlinkAnimation();
          }
          handleGridChanged(e, t) {
            !this._cursorBlinkStateManager.value || this._cursorBlinkStateManager.value.isPaused ? this._render(!1) : this._cursorBlinkStateManager.value.restartBlinkAnimation();
          }
          _render(e) {
            if (!this._coreService.isCursorInitialized || this._coreService.isCursorHidden) return void this._clearCursor();
            const t = this._bufferService.buffer.ybase + this._bufferService.buffer.y,
              i = t - this._bufferService.buffer.ydisp;
            if (i < 0 || i >= this._bufferService.rows) return void this._clearCursor();
            const s = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1);
            if (this._bufferService.buffer.lines.get(t).loadCell(s, this._cell), void 0 !== this._cell.content) {
              if (!this._coreBrowserService.isFocused) {
                this._clearCursor(), this._ctx.save(), this._ctx.fillStyle = this._themeService.colors.cursor.css;
                const e = this._optionsService.rawOptions.cursorStyle,
                  t = this._optionsService.rawOptions.cursorInactiveStyle;
                return t && "none" !== t && this._cursorRenderers[t](s, i, this._cell), this._ctx.restore(), this._state.x = s, this._state.y = i, this._state.isFocused = !1, this._state.style = e, void (this._state.width = this._cell.getWidth());
              }
              if (!this._cursorBlinkStateManager.value || this._cursorBlinkStateManager.value.isCursorVisible) {
                if (this._state) {
                  if (this._state.x === s && this._state.y === i && this._state.isFocused === this._coreBrowserService.isFocused && this._state.style === this._optionsService.rawOptions.cursorStyle && this._state.width === this._cell.getWidth()) return;
                  this._clearCursor();
                }
                this._ctx.save(), this._cursorRenderers[this._optionsService.rawOptions.cursorStyle || "block"](s, i, this._cell), this._ctx.restore(), this._state.x = s, this._state.y = i, this._state.isFocused = !1, this._state.style = this._optionsService.rawOptions.cursorStyle, this._state.width = this._cell.getWidth();
              } else this._clearCursor();
            }
          }
          _clearCursor() {
            this._state && (o.isFirefox || this._coreBrowserService.dpr < 1 ? this._clearAll() : this._clearCells(this._state.x, this._state.y, this._state.width, 1), this._state = {
              x: 0,
              y: 0,
              isFocused: !1,
              style: "",
              width: 0
            });
          }
          _renderBarCursor(e, t, i) {
            this._ctx.save(), this._ctx.fillStyle = this._themeService.colors.cursor.css, this._fillLeftLineAtCell(e, t, this._optionsService.rawOptions.cursorWidth), this._ctx.restore();
          }
          _renderBlockCursor(e, t, i) {
            this._ctx.save(), this._ctx.fillStyle = this._themeService.colors.cursor.css, this._fillCells(e, t, i.getWidth(), 1), this._ctx.fillStyle = this._themeService.colors.cursorAccent.css, this._fillCharTrueColor(i, e, t), this._ctx.restore();
          }
          _renderUnderlineCursor(e, t, i) {
            this._ctx.save(), this._ctx.fillStyle = this._themeService.colors.cursor.css, this._fillBottomLineAtCells(e, t), this._ctx.restore();
          }
          _renderOutlineCursor(e, t, i) {
            this._ctx.save(), this._ctx.strokeStyle = this._themeService.colors.cursor.css, this._strokeRectAtCell(e, t, i.getWidth(), 1), this._ctx.restore();
          }
        }
        t.CursorRenderLayer = h;
      },
      574: (e, t) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.GridCache = void 0, t.GridCache = class {
          constructor() {
            this.cache = [];
          }
          resize(e, t) {
            for (let i = 0; i < e; i++) {
              this.cache.length <= i && this.cache.push([]);
              for (let e = this.cache[i].length; e < t; e++) this.cache[i].push(void 0);
              this.cache[i].length = t;
            }
            this.cache.length = e;
          }
          clear() {
            for (let e = 0; e < this.cache.length; e++) for (let t = 0; t < this.cache[e].length; t++) this.cache[e][t] = void 0;
          }
        };
      },
      43: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.LinkRenderLayer = void 0;
        const s = i(197),
          r = i(237),
          o = i(903);
        class n extends o.BaseRenderLayer {
          constructor(e, t, i, s, r, o, n, a, h) {
            super(e, t, "link", i, !0, h, r, o, n, a), this.register(s.onShowLinkUnderline(e => this._handleShowLinkUnderline(e))), this.register(s.onHideLinkUnderline(e => this._handleHideLinkUnderline(e)));
          }
          resize(e) {
            super.resize(e), this._state = void 0;
          }
          reset() {
            this._clearCurrentLink();
          }
          _clearCurrentLink() {
            if (this._state) {
              this._clearCells(this._state.x1, this._state.y1, this._state.cols - this._state.x1, 1);
              const e = this._state.y2 - this._state.y1 - 1;
              e > 0 && this._clearCells(0, this._state.y1 + 1, this._state.cols, e), this._clearCells(0, this._state.y2, this._state.x2, 1), this._state = void 0;
            }
          }
          _handleShowLinkUnderline(e) {
            if (e.fg === r.INVERTED_DEFAULT_COLOR ? this._ctx.fillStyle = this._themeService.colors.background.css : e.fg && (0, s.is256Color)(e.fg) ? this._ctx.fillStyle = this._themeService.colors.ansi[e.fg].css : this._ctx.fillStyle = this._themeService.colors.foreground.css, e.y1 === e.y2) this._fillBottomLineAtCells(e.x1, e.y1, e.x2 - e.x1);else {
              this._fillBottomLineAtCells(e.x1, e.y1, e.cols - e.x1);
              for (let t = e.y1 + 1; t < e.y2; t++) this._fillBottomLineAtCells(0, t, e.cols);
              this._fillBottomLineAtCells(0, e.y2, e.x2);
            }
            this._state = e;
          }
          _handleHideLinkUnderline(e) {
            this._clearCurrentLink();
          }
        }
        t.LinkRenderLayer = n;
      },
      630: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.SelectionRenderLayer = void 0;
        const s = i(903);
        class r extends s.BaseRenderLayer {
          constructor(e, t, i, s, r, o, n, a) {
            super(e, t, "selection", i, !0, a, s, n, o, r), this._clearState();
          }
          _clearState() {
            this._state = {
              start: void 0,
              end: void 0,
              columnSelectMode: void 0,
              ydisp: void 0
            };
          }
          resize(e) {
            super.resize(e), this._selectionModel.selectionStart && this._selectionModel.selectionEnd && (this._clearState(), this._redrawSelection(this._selectionModel.selectionStart, this._selectionModel.selectionEnd, this._selectionModel.columnSelectMode));
          }
          reset() {
            this._state.start && this._state.end && (this._clearState(), this._clearAll());
          }
          handleBlur() {
            this.reset(), this._redrawSelection(this._selectionModel.selectionStart, this._selectionModel.selectionEnd, this._selectionModel.columnSelectMode);
          }
          handleFocus() {
            this.reset(), this._redrawSelection(this._selectionModel.selectionStart, this._selectionModel.selectionEnd, this._selectionModel.columnSelectMode);
          }
          handleSelectionChanged(e, t, i) {
            super.handleSelectionChanged(e, t, i), this._redrawSelection(e, t, i);
          }
          _redrawSelection(e, t, i) {
            if (!this._didStateChange(e, t, i, this._bufferService.buffer.ydisp)) return;
            if (this._clearAll(), !e || !t) return void this._clearState();
            const s = e[1] - this._bufferService.buffer.ydisp,
              r = t[1] - this._bufferService.buffer.ydisp,
              o = Math.max(s, 0),
              n = Math.min(r, this._bufferService.rows - 1);
            if (o >= this._bufferService.rows || n < 0) this._state.ydisp = this._bufferService.buffer.ydisp;else {
              if (this._ctx.fillStyle = (this._coreBrowserService.isFocused ? this._themeService.colors.selectionBackgroundTransparent : this._themeService.colors.selectionInactiveBackgroundTransparent).css, i) {
                const i = e[0],
                  s = t[0] - i,
                  r = n - o + 1;
                this._fillCells(i, o, s, r);
              } else {
                const i = s === o ? e[0] : 0,
                  a = o === r ? t[0] : this._bufferService.cols;
                this._fillCells(i, o, a - i, 1);
                const h = Math.max(n - o - 1, 0);
                if (this._fillCells(0, o + 1, this._bufferService.cols, h), o !== n) {
                  const e = r === n ? t[0] : this._bufferService.cols;
                  this._fillCells(0, n, e, 1);
                }
              }
              this._state.start = [e[0], e[1]], this._state.end = [t[0], t[1]], this._state.columnSelectMode = i, this._state.ydisp = this._bufferService.buffer.ydisp;
            }
          }
          _didStateChange(e, t, i, s) {
            return !this._areCoordinatesEqual(e, this._state.start) || !this._areCoordinatesEqual(t, this._state.end) || i !== this._state.columnSelectMode || s !== this._state.ydisp;
          }
          _areCoordinatesEqual(e, t) {
            return !(!e || !t) && e[0] === t[0] && e[1] === t[1];
          }
        }
        t.SelectionRenderLayer = r;
      },
      744: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.TextRenderLayer = void 0;
        const s = i(577),
          r = i(147),
          o = i(782),
          n = i(855),
          a = i(903),
          h = i(574);
        class l extends a.BaseRenderLayer {
          constructor(e, t, i, s, r, n, a, l, c, d) {
            super(e, t, "text", i, s, d, r, n, l, c), this._characterJoinerService = a, this._characterWidth = 0, this._characterFont = "", this._characterOverlapCache = {}, this._workCell = new o.CellData(), this._state = new h.GridCache(), this.register(n.onSpecificOptionChange("allowTransparency", e => this._setTransparency(e)));
          }
          resize(e) {
            super.resize(e);
            const t = this._getFont(!1, !1);
            this._characterWidth === e.device.char.width && this._characterFont === t || (this._characterWidth = e.device.char.width, this._characterFont = t, this._characterOverlapCache = {}), this._state.clear(), this._state.resize(this._bufferService.cols, this._bufferService.rows);
          }
          reset() {
            this._state.clear(), this._clearAll();
          }
          _forEachCell(e, t, i) {
            for (let r = e; r <= t; r++) {
              const e = r + this._bufferService.buffer.ydisp,
                t = this._bufferService.buffer.lines.get(e),
                o = this._characterJoinerService.getJoinedCharacters(e);
              for (let e = 0; e < this._bufferService.cols; e++) {
                t.loadCell(e, this._workCell);
                let a = this._workCell,
                  h = !1,
                  l = e;
                if (0 !== a.getWidth()) {
                  if (o.length > 0 && e === o[0][0]) {
                    h = !0;
                    const e = o.shift();
                    a = new s.JoinedCellData(this._workCell, t.translateToString(!0, e[0], e[1]), e[1] - e[0]), l = e[1] - 1;
                  }
                  !h && this._isOverlapping(a) && l < t.length - 1 && t.getCodePoint(l + 1) === n.NULL_CELL_CODE && (a.content &= -12582913, a.content |= 2 << 22), i(a, e, r), e = l;
                }
              }
            }
          }
          _drawBackground(e, t) {
            const i = this._ctx,
              s = this._bufferService.cols;
            let o = 0,
              n = 0,
              a = null;
            i.save(), this._forEachCell(e, t, (e, t, h) => {
              let l = null;
              e.isInverse() ? l = e.isFgDefault() ? this._themeService.colors.foreground.css : e.isFgRGB() ? `rgb(${r.AttributeData.toColorRGB(e.getFgColor()).join(",")})` : this._themeService.colors.ansi[e.getFgColor()].css : e.isBgRGB() ? l = `rgb(${r.AttributeData.toColorRGB(e.getBgColor()).join(",")})` : e.isBgPalette() && (l = this._themeService.colors.ansi[e.getBgColor()].css);
              let c = !1;
              this._decorationService.forEachDecorationAtCell(t, this._bufferService.buffer.ydisp + h, void 0, e => {
                "top" !== e.options.layer && c || (e.backgroundColorRGB && (l = e.backgroundColorRGB.css), c = "top" === e.options.layer);
              }), null === a && (o = t, n = h), h !== n ? (i.fillStyle = a || "", this._fillCells(o, n, s - o, 1), o = t, n = h) : a !== l && (i.fillStyle = a || "", this._fillCells(o, n, t - o, 1), o = t, n = h), a = l;
            }), null !== a && (i.fillStyle = a, this._fillCells(o, n, s - o, 1)), i.restore();
          }
          _drawForeground(e, t) {
            this._forEachCell(e, t, (e, t, i) => this._drawChars(e, t, i));
          }
          handleGridChanged(e, t) {
            0 !== this._state.cache.length && (this._charAtlas && this._charAtlas.beginFrame(), this._clearCells(0, e, this._bufferService.cols, t - e + 1), this._drawBackground(e, t), this._drawForeground(e, t));
          }
          _isOverlapping(e) {
            if (1 !== e.getWidth()) return !1;
            if (e.getCode() < 256) return !1;
            const t = e.getChars();
            if (this._characterOverlapCache.hasOwnProperty(t)) return this._characterOverlapCache[t];
            this._ctx.save(), this._ctx.font = this._characterFont;
            const i = Math.floor(this._ctx.measureText(t).width) > this._characterWidth;
            return this._ctx.restore(), this._characterOverlapCache[t] = i, i;
          }
        }
        t.TextRenderLayer = l;
      },
      274: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.CellColorResolver = void 0;
        const s = i(855),
          r = i(160),
          o = i(374);
        let n,
          a = 0,
          h = 0,
          l = !1,
          c = !1,
          d = !1,
          _ = 0;
        t.CellColorResolver = class {
          constructor(e, t, i, s, r, o) {
            this._terminal = e, this._optionService = t, this._selectionRenderModel = i, this._decorationService = s, this._coreBrowserService = r, this._themeService = o, this.result = {
              fg: 0,
              bg: 0,
              ext: 0
            };
          }
          resolve(e, t, i, u) {
            if (this.result.bg = e.bg, this.result.fg = e.fg, this.result.ext = 268435456 & e.bg ? e.extended.ext : 0, h = 0, a = 0, c = !1, l = !1, d = !1, n = this._themeService.colors, _ = 0, e.getCode() !== s.NULL_CELL_CODE && 4 === e.extended.underlineStyle) {
              const e = Math.max(1, Math.floor(this._optionService.rawOptions.fontSize * this._coreBrowserService.dpr / 15));
              _ = t * u % (2 * Math.round(e));
            }
            if (this._decorationService.forEachDecorationAtCell(t, i, "bottom", e => {
              e.backgroundColorRGB && (h = e.backgroundColorRGB.rgba >> 8 & 16777215, c = !0), e.foregroundColorRGB && (a = e.foregroundColorRGB.rgba >> 8 & 16777215, l = !0);
            }), d = this._selectionRenderModel.isCellSelected(this._terminal, t, i), d) {
              if (67108864 & this.result.fg || 0 != (50331648 & this.result.bg)) {
                if (67108864 & this.result.fg) switch (50331648 & this.result.fg) {
                  case 16777216:
                  case 33554432:
                    h = this._themeService.colors.ansi[255 & this.result.fg].rgba;
                    break;
                  case 50331648:
                    h = (16777215 & this.result.fg) << 8 | 255;
                    break;
                  default:
                    h = this._themeService.colors.foreground.rgba;
                } else switch (50331648 & this.result.bg) {
                  case 16777216:
                  case 33554432:
                    h = this._themeService.colors.ansi[255 & this.result.bg].rgba;
                    break;
                  case 50331648:
                    h = (16777215 & this.result.bg) << 8 | 255;
                }
                h = r.rgba.blend(h, 4294967040 & (this._coreBrowserService.isFocused ? n.selectionBackgroundOpaque : n.selectionInactiveBackgroundOpaque).rgba | 128) >> 8 & 16777215;
              } else h = (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)(e.getCode())) {
                if (67108864 & this.result.fg && 0 == (50331648 & this.result.bg)) 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(t, i, "top", e => {
              e.backgroundColorRGB && (h = e.backgroundColorRGB.rgba >> 8 & 16777215, c = !0), e.foregroundColorRGB && (a = e.foregroundColorRGB.rgba >> 8 & 16777215, l = !0);
            }), c && (h = d ? -16777216 & e.bg & -134217729 | h | 50331648 : -16777216 & e.bg | h | 50331648), l && (a = -16777216 & e.fg & -67108865 | a | 50331648), 67108864 & this.result.fg && (c && !l && (a = 0 == (50331648 & this.result.bg) ? -134217728 & this.result.fg | 16777215 & n.background.rgba >> 8 | 50331648 : -134217728 & this.result.fg | 67108863 & this.result.bg, l = !0), !c && l && (h = 0 == (50331648 & this.result.fg) ? -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 ? h : this.result.bg, this.result.fg = l ? a : this.result.fg, this.result.ext &= 536870911, this.result.ext |= _ << 29 & 3758096384;
          }
        };
      },
      627: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.removeTerminalFromCache = t.acquireTextureAtlas = void 0;
        const s = i(509),
          r = i(197),
          o = [];
        t.acquireTextureAtlas = function (e, t, i, n, a, h, l, c) {
          const d = (0, r.generateConfig)(n, a, h, l, t, i, c);
          for (let t = 0; t < o.length; t++) {
            const i = o[t],
              s = i.ownedBy.indexOf(e);
            if (s >= 0) {
              if ((0, r.configEquals)(i.config, d)) return i.atlas;
              1 === i.ownedBy.length ? (i.atlas.dispose(), o.splice(t, 1)) : i.ownedBy.splice(s, 1);
              break;
            }
          }
          for (let t = 0; t < o.length; t++) {
            const i = o[t];
            if ((0, r.configEquals)(i.config, d)) return i.ownedBy.push(e), i.atlas;
          }
          const _ = e._core,
            u = {
              atlas: new s.TextureAtlas(document, d, _.unicodeService),
              config: d,
              ownedBy: [e]
            };
          return o.push(u), u.atlas;
        }, t.removeTerminalFromCache = function (e) {
          for (let t = 0; t < o.length; t++) {
            const i = o[t].ownedBy.indexOf(e);
            if (-1 !== i) {
              1 === o[t].ownedBy.length ? (o[t].atlas.dispose(), o.splice(t, 1)) : o[t].ownedBy.splice(i, 1);
              break;
            }
          }
        };
      },
      197: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.is256Color = t.configEquals = t.generateConfig = void 0;
        const s = i(160);
        t.generateConfig = function (e, t, i, r, o, n, a) {
          const h = {
            foreground: n.foreground,
            background: n.background,
            cursor: s.NULL_COLOR,
            cursorAccent: s.NULL_COLOR,
            selectionForeground: s.NULL_COLOR,
            selectionBackgroundTransparent: s.NULL_COLOR,
            selectionBackgroundOpaque: s.NULL_COLOR,
            selectionInactiveBackgroundTransparent: s.NULL_COLOR,
            selectionInactiveBackgroundOpaque: s.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: e,
            deviceCellHeight: t,
            deviceCharWidth: i,
            deviceCharHeight: r,
            fontFamily: o.fontFamily,
            fontSize: o.fontSize,
            fontWeight: o.fontWeight,
            fontWeightBold: o.fontWeightBold,
            allowTransparency: o.allowTransparency,
            drawBoldTextInBrightColors: o.drawBoldTextInBrightColors,
            minimumContrastRatio: o.minimumContrastRatio,
            colors: h
          };
        }, t.configEquals = function (e, t) {
          for (let i = 0; i < e.colors.ansi.length; i++) if (e.colors.ansi[i].rgba !== t.colors.ansi[i].rgba) return !1;
          return e.devicePixelRatio === t.devicePixelRatio && e.customGlyphs === t.customGlyphs && e.lineHeight === t.lineHeight && e.letterSpacing === t.letterSpacing && e.fontFamily === t.fontFamily && e.fontSize === t.fontSize && e.fontWeight === t.fontWeight && e.fontWeightBold === t.fontWeightBold && e.allowTransparency === t.allowTransparency && e.deviceCharWidth === t.deviceCharWidth && e.deviceCharHeight === t.deviceCharHeight && e.drawBoldTextInBrightColors === t.drawBoldTextInBrightColors && e.minimumContrastRatio === t.minimumContrastRatio && e.colors.foreground.rgba === t.colors.foreground.rgba && e.colors.background.rgba === t.colors.background.rgba;
        }, t.is256Color = function (e) {
          return 16777216 == (50331648 & e) || 33554432 == (50331648 & e);
        };
      },
      237: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.TEXT_BASELINE = t.DIM_OPACITY = t.INVERTED_DEFAULT_COLOR = void 0;
        const s = i(399);
        t.INVERTED_DEFAULT_COLOR = 257, t.DIM_OPACITY = .5, t.TEXT_BASELINE = s.isFirefox || s.isLegacyEdge ? "bottom" : "ideographic";
      },
      457: (e, t) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.CursorBlinkStateManager = void 0;
        t.CursorBlinkStateManager = class {
          constructor(e, t) {
            this._renderCallback = e, this._coreBrowserService = t, 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(e = 600) {
            this._blinkInterval && (this._coreBrowserService.window.clearInterval(this._blinkInterval), this._blinkInterval = void 0), this._blinkStartTimeout = this._coreBrowserService.window.setTimeout(() => {
              if (this._animationTimeRestarted) {
                const e = 600 - (Date.now() - this._animationTimeRestarted);
                if (this._animationTimeRestarted = void 0, e > 0) return void this._restartInterval(e);
              }
              this.isCursorVisible = !1, this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {
                this._renderCallback(), this._animationFrame = void 0;
              }), this._blinkInterval = this._coreBrowserService.window.setInterval(() => {
                if (this._animationTimeRestarted) {
                  const e = 600 - (Date.now() - this._animationTimeRestarted);
                  return this._animationTimeRestarted = void 0, void this._restartInterval(e);
                }
                this.isCursorVisible = !this.isCursorVisible, this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {
                  this._renderCallback(), this._animationFrame = void 0;
                });
              }, 600);
            }, e);
          }
          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: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.tryDrawCustomChar = t.powerlineDefinitions = t.boxDrawingDefinitions = t.blockElementDefinitions = void 0;
        const s = i(374);
        t.blockElementDefinitions = {
          "▀": [{
            x: 0,
            y: 0,
            w: 8,
            h: 4
          }],
          "▁": [{
            x: 0,
            y: 7,
            w: 8,
            h: 1
          }],
          "▂": [{
            x: 0,
            y: 6,
            w: 8,
            h: 2
          }],
          "▃": [{
            x: 0,
            y: 5,
            w: 8,
            h: 3
          }],
          "▄": [{
            x: 0,
            y: 4,
            w: 8,
            h: 4
          }],
          "▅": [{
            x: 0,
            y: 3,
            w: 8,
            h: 5
          }],
          "▆": [{
            x: 0,
            y: 2,
            w: 8,
            h: 6
          }],
          "▇": [{
            x: 0,
            y: 1,
            w: 8,
            h: 7
          }],
          "█": [{
            x: 0,
            y: 0,
            w: 8,
            h: 8
          }],
          "▉": [{
            x: 0,
            y: 0,
            w: 7,
            h: 8
          }],
          "▊": [{
            x: 0,
            y: 0,
            w: 6,
            h: 8
          }],
          "▋": [{
            x: 0,
            y: 0,
            w: 5,
            h: 8
          }],
          "▌": [{
            x: 0,
            y: 0,
            w: 4,
            h: 8
          }],
          "▍": [{
            x: 0,
            y: 0,
            w: 3,
            h: 8
          }],
          "▎": [{
            x: 0,
            y: 0,
            w: 2,
            h: 8
          }],
          "▏": [{
            x: 0,
            y: 0,
            w: 1,
            h: 8
          }],
          "▐": [{
            x: 4,
            y: 0,
            w: 4,
            h: 8
          }],
          "▔": [{
            x: 0,
            y: 0,
            w: 8,
            h: 1
          }],
          "▕": [{
            x: 7,
            y: 0,
            w: 1,
            h: 8
          }],
          "▖": [{
            x: 0,
            y: 4,
            w: 4,
            h: 4
          }],
          "▗": [{
            x: 4,
            y: 4,
            w: 4,
            h: 4
          }],
          "▘": [{
            x: 0,
            y: 0,
            w: 4,
            h: 4
          }],
          "▙": [{
            x: 0,
            y: 0,
            w: 4,
            h: 8
          }, {
            x: 0,
            y: 4,
            w: 8,
            h: 4
          }],
          "▚": [{
            x: 0,
            y: 0,
            w: 4,
            h: 4
          }, {
            x: 4,
            y: 4,
            w: 4,
            h: 4
          }],
          "▛": [{
            x: 0,
            y: 0,
            w: 4,
            h: 8
          }, {
            x: 4,
            y: 0,
            w: 4,
            h: 4
          }],
          "▜": [{
            x: 0,
            y: 0,
            w: 8,
            h: 4
          }, {
            x: 4,
            y: 0,
            w: 4,
            h: 8
          }],
          "▝": [{
            x: 4,
            y: 0,
            w: 4,
            h: 4
          }],
          "▞": [{
            x: 4,
            y: 0,
            w: 4,
            h: 4
          }, {
            x: 0,
            y: 4,
            w: 4,
            h: 4
          }],
          "▟": [{
            x: 4,
            y: 0,
            w: 4,
            h: 8
          }, {
            x: 0,
            y: 4,
            w: 8,
            h: 4
          }],
          "🭰": [{
            x: 1,
            y: 0,
            w: 1,
            h: 8
          }],
          "🭱": [{
            x: 2,
            y: 0,
            w: 1,
            h: 8
          }],
          "🭲": [{
            x: 3,
            y: 0,
            w: 1,
            h: 8
          }],
          "🭳": [{
            x: 4,
            y: 0,
            w: 1,
            h: 8
          }],
          "🭴": [{
            x: 5,
            y: 0,
            w: 1,
            h: 8
          }],
          "🭵": [{
            x: 6,
            y: 0,
            w: 1,
            h: 8
          }],
          "🭶": [{
            x: 0,
            y: 1,
            w: 8,
            h: 1
          }],
          "🭷": [{
            x: 0,
            y: 2,
            w: 8,
            h: 1
          }],
          "🭸": [{
            x: 0,
            y: 3,
            w: 8,
            h: 1
          }],
          "🭹": [{
            x: 0,
            y: 4,
            w: 8,
            h: 1
          }],
          "🭺": [{
            x: 0,
            y: 5,
            w: 8,
            h: 1
          }],
          "🭻": [{
            x: 0,
            y: 6,
            w: 8,
            h: 1
          }],
          "🭼": [{
            x: 0,
            y: 0,
            w: 1,
            h: 8
          }, {
            x: 0,
            y: 7,
            w: 8,
            h: 1
          }],
          "🭽": [{
            x: 0,
            y: 0,
            w: 1,
            h: 8
          }, {
            x: 0,
            y: 0,
            w: 8,
            h: 1
          }],
          "🭾": [{
            x: 7,
            y: 0,
            w: 1,
            h: 8
          }, {
            x: 0,
            y: 0,
            w: 8,
            h: 1
          }],
          "🭿": [{
            x: 7,
            y: 0,
            w: 1,
            h: 8
          }, {
            x: 0,
            y: 7,
            w: 8,
            h: 1
          }],
          "🮀": [{
            x: 0,
            y: 0,
            w: 8,
            h: 1
          }, {
            x: 0,
            y: 7,
            w: 8,
            h: 1
          }],
          "🮁": [{
            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
          }],
          "🮂": [{
            x: 0,
            y: 0,
            w: 8,
            h: 2
          }],
          "🮃": [{
            x: 0,
            y: 0,
            w: 8,
            h: 3
          }],
          "🮄": [{
            x: 0,
            y: 0,
            w: 8,
            h: 5
          }],
          "🮅": [{
            x: 0,
            y: 0,
            w: 8,
            h: 6
          }],
          "🮆": [{
            x: 0,
            y: 0,
            w: 8,
            h: 7
          }],
          "🮇": [{
            x: 6,
            y: 0,
            w: 2,
            h: 8
          }],
          "🮈": [{
            x: 5,
            y: 0,
            w: 3,
            h: 8
          }],
          "🮉": [{
            x: 3,
            y: 0,
            w: 5,
            h: 8
          }],
          "🮊": [{
            x: 2,
            y: 0,
            w: 6,
            h: 8
          }],
          "🮋": [{
            x: 1,
            y: 0,
            w: 7,
            h: 8
          }],
          "🮕": [{
            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
          }],
          "🮖": [{
            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
          }],
          "🮗": [{
            x: 0,
            y: 2,
            w: 8,
            h: 2
          }, {
            x: 0,
            y: 6,
            w: 8,
            h: 2
          }]
        };
        const r = {
          "░": [[1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 0]],
          "▒": [[1, 0], [0, 0], [0, 1], [0, 0]],
          "▓": [[0, 1], [1, 1], [1, 0], [1, 1]]
        };
        t.boxDrawingDefinitions = {
          "─": {
            1: "M0,.5 L1,.5"
          },
          "━": {
            3: "M0,.5 L1,.5"
          },
          "│": {
            1: "M.5,0 L.5,1"
          },
          "┃": {
            3: "M.5,0 L.5,1"
          },
          "┌": {
            1: "M0.5,1 L.5,.5 L1,.5"
          },
          "┏": {
            3: "M0.5,1 L.5,.5 L1,.5"
          },
          "┐": {
            1: "M0,.5 L.5,.5 L.5,1"
          },
          "┓": {
            3: "M0,.5 L.5,.5 L.5,1"
          },
          "└": {
            1: "M.5,0 L.5,.5 L1,.5"
          },
          "┗": {
            3: "M.5,0 L.5,.5 L1,.5"
          },
          "┘": {
            1: "M.5,0 L.5,.5 L0,.5"
          },
          "┛": {
            3: "M.5,0 L.5,.5 L0,.5"
          },
          "├": {
            1: "M.5,0 L.5,1 M.5,.5 L1,.5"
          },
          "┣": {
            3: "M.5,0 L.5,1 M.5,.5 L1,.5"
          },
          "┤": {
            1: "M.5,0 L.5,1 M.5,.5 L0,.5"
          },
          "┫": {
            3: "M.5,0 L.5,1 M.5,.5 L0,.5"
          },
          "┬": {
            1: "M0,.5 L1,.5 M.5,.5 L.5,1"
          },
          "┳": {
            3: "M0,.5 L1,.5 M.5,.5 L.5,1"
          },
          "┴": {
            1: "M0,.5 L1,.5 M.5,.5 L.5,0"
          },
          "┻": {
            3: "M0,.5 L1,.5 M.5,.5 L.5,0"
          },
          "┼": {
            1: "M0,.5 L1,.5 M.5,0 L.5,1"
          },
          "╋": {
            3: "M0,.5 L1,.5 M.5,0 L.5,1"
          },
          "╴": {
            1: "M.5,.5 L0,.5"
          },
          "╸": {
            3: "M.5,.5 L0,.5"
          },
          "╵": {
            1: "M.5,.5 L.5,0"
          },
          "╹": {
            3: "M.5,.5 L.5,0"
          },
          "╶": {
            1: "M.5,.5 L1,.5"
          },
          "╺": {
            3: "M.5,.5 L1,.5"
          },
          "╷": {
            1: "M.5,.5 L.5,1"
          },
          "╻": {
            3: "M.5,.5 L.5,1"
          },
          "═": {
            1: (e, t) => `M0,${.5 - t} L1,${.5 - t} M0,${.5 + t} L1,${.5 + t}`
          },
          "║": {
            1: (e, t) => `M${.5 - e},0 L${.5 - e},1 M${.5 + e},0 L${.5 + e},1`
          },
          "╒": {
            1: (e, t) => `M.5,1 L.5,${.5 - t} L1,${.5 - t} M.5,${.5 + t} L1,${.5 + t}`
          },
          "╓": {
            1: (e, t) => `M${.5 - e},1 L${.5 - e},.5 L1,.5 M${.5 + e},.5 L${.5 + e},1`
          },
          "╔": {
            1: (e, t) => `M1,${.5 - t} L${.5 - e},${.5 - t} L${.5 - e},1 M1,${.5 + t} L${.5 + e},${.5 + t} L${.5 + e},1`
          },
          "╕": {
            1: (e, t) => `M0,${.5 - t} L.5,${.5 - t} L.5,1 M0,${.5 + t} L.5,${.5 + t}`
          },
          "╖": {
            1: (e, t) => `M${.5 + e},1 L${.5 + e},.5 L0,.5 M${.5 - e},.5 L${.5 - e},1`
          },
          "╗": {
            1: (e, t) => `M0,${.5 + t} L${.5 - e},${.5 + t} L${.5 - e},1 M0,${.5 - t} L${.5 + e},${.5 - t} L${.5 + e},1`
          },
          "╘": {
            1: (e, t) => `M.5,0 L.5,${.5 + t} L1,${.5 + t} M.5,${.5 - t} L1,${.5 - t}`
          },
          "╙": {
            1: (e, t) => `M1,.5 L${.5 - e},.5 L${.5 - e},0 M${.5 + e},.5 L${.5 + e},0`
          },
          "╚": {
            1: (e, t) => `M1,${.5 - t} L${.5 + e},${.5 - t} L${.5 + e},0 M1,${.5 + t} L${.5 - e},${.5 + t} L${.5 - e},0`
          },
          "╛": {
            1: (e, t) => `M0,${.5 + t} L.5,${.5 + t} L.5,0 M0,${.5 - t} L.5,${.5 - t}`
          },
          "╜": {
            1: (e, t) => `M0,.5 L${.5 + e},.5 L${.5 + e},0 M${.5 - e},.5 L${.5 - e},0`
          },
          "╝": {
            1: (e, t) => `M0,${.5 - t} L${.5 - e},${.5 - t} L${.5 - e},0 M0,${.5 + t} L${.5 + e},${.5 + t} L${.5 + e},0`
          },
          "╞": {
            1: (e, t) => `M.5,0 L.5,1 M.5,${.5 - t} L1,${.5 - t} M.5,${.5 + t} L1,${.5 + t}`
          },
          "╟": {
            1: (e, t) => `M${.5 - e},0 L${.5 - e},1 M${.5 + e},0 L${.5 + e},1 M${.5 + e},.5 L1,.5`
          },
          "╠": {
            1: (e, t) => `M${.5 - e},0 L${.5 - e},1 M1,${.5 + t} L${.5 + e},${.5 + t} L${.5 + e},1 M1,${.5 - t} L${.5 + e},${.5 - t} L${.5 + e},0`
          },
          "╡": {
            1: (e, t) => `M.5,0 L.5,1 M0,${.5 - t} L.5,${.5 - t} M0,${.5 + t} L.5,${.5 + t}`
          },
          "╢": {
            1: (e, t) => `M0,.5 L${.5 - e},.5 M${.5 - e},0 L${.5 - e},1 M${.5 + e},0 L${.5 + e},1`
          },
          "╣": {
            1: (e, t) => `M${.5 + e},0 L${.5 + e},1 M0,${.5 + t} L${.5 - e},${.5 + t} L${.5 - e},1 M0,${.5 - t} L${.5 - e},${.5 - t} L${.5 - e},0`
          },
          "╤": {
            1: (e, t) => `M0,${.5 - t} L1,${.5 - t} M0,${.5 + t} L1,${.5 + t} M.5,${.5 + t} L.5,1`
          },
          "╥": {
            1: (e, t) => `M0,.5 L1,.5 M${.5 - e},.5 L${.5 - e},1 M${.5 + e},.5 L${.5 + e},1`
          },
          "╦": {
            1: (e, t) => `M0,${.5 - t} L1,${.5 - t} M0,${.5 + t} L${.5 - e},${.5 + t} L${.5 - e},1 M1,${.5 + t} L${.5 + e},${.5 + t} L${.5 + e},1`
          },
          "╧": {
            1: (e, t) => `M.5,0 L.5,${.5 - t} M0,${.5 - t} L1,${.5 - t} M0,${.5 + t} L1,${.5 + t}`
          },
          "╨": {
            1: (e, t) => `M0,.5 L1,.5 M${.5 - e},.5 L${.5 - e},0 M${.5 + e},.5 L${.5 + e},0`
          },
          "╩": {
            1: (e, t) => `M0,${.5 + t} L1,${.5 + t} M0,${.5 - t} L${.5 - e},${.5 - t} L${.5 - e},0 M1,${.5 - t} L${.5 + e},${.5 - t} L${.5 + e},0`
          },
          "╪": {
            1: (e, t) => `M.5,0 L.5,1 M0,${.5 - t} L1,${.5 - t} M0,${.5 + t} L1,${.5 + t}`
          },
          "╫": {
            1: (e, t) => `M0,.5 L1,.5 M${.5 - e},0 L${.5 - e},1 M${.5 + e},0 L${.5 + e},1`
          },
          "╬": {
            1: (e, t) => `M0,${.5 + t} L${.5 - e},${.5 + t} L${.5 - e},1 M1,${.5 + t} L${.5 + e},${.5 + t} L${.5 + e},1 M0,${.5 - t} L${.5 - e},${.5 - t} L${.5 - e},0 M1,${.5 - t} L${.5 + e},${.5 - t} L${.5 + e},0`
          },
          "╱": {
            1: "M1,0 L0,1"
          },
          "╲": {
            1: "M0,0 L1,1"
          },
          "╳": {
            1: "M1,0 L0,1 M0,0 L1,1"
          },
          "╼": {
            1: "M.5,.5 L0,.5",
            3: "M.5,.5 L1,.5"
          },
          "╽": {
            1: "M.5,.5 L.5,0",
            3: "M.5,.5 L.5,1"
          },
          "╾": {
            1: "M.5,.5 L1,.5",
            3: "M.5,.5 L0,.5"
          },
          "╿": {
            1: "M.5,.5 L.5,1",
            3: "M.5,.5 L.5,0"
          },
          "┍": {
            1: "M.5,.5 L.5,1",
            3: "M.5,.5 L1,.5"
          },
          "┎": {
            1: "M.5,.5 L1,.5",
            3: "M.5,.5 L.5,1"
          },
          "┑": {
            1: "M.5,.5 L.5,1",
            3: "M.5,.5 L0,.5"
          },
          "┒": {
            1: "M.5,.5 L0,.5",
            3: "M.5,.5 L.5,1"
          },
          "┕": {
            1: "M.5,.5 L.5,0",
            3: "M.5,.5 L1,.5"
          },
          "┖": {
            1: "M.5,.5 L1,.5",
            3: "M.5,.5 L.5,0"
          },
          "┙": {
            1: "M.5,.5 L.5,0",
            3: "M.5,.5 L0,.5"
          },
          "┚": {
            1: "M.5,.5 L0,.5",
            3: "M.5,.5 L.5,0"
          },
          "┝": {
            1: "M.5,0 L.5,1",
            3: "M.5,.5 L1,.5"
          },
          "┞": {
            1: "M0.5,1 L.5,.5 L1,.5",
            3: "M.5,.5 L.5,0"
          },
          "┟": {
            1: "M.5,0 L.5,.5 L1,.5",
            3: "M.5,.5 L.5,1"
          },
          "┠": {
            1: "M.5,.5 L1,.5",
            3: "M.5,0 L.5,1"
          },
          "┡": {
            1: "M.5,.5 L.5,1",
            3: "M.5,0 L.5,.5 L1,.5"
          },
          "┢": {
            1: "M.5,.5 L.5,0",
            3: "M0.5,1 L.5,.5 L1,.5"
          },
          "┥": {
            1: "M.5,0 L.5,1",
            3: "M.5,.5 L0,.5"
          },
          "┦": {
            1: "M0,.5 L.5,.5 L.5,1",
            3: "M.5,.5 L.5,0"
          },
          "┧": {
            1: "M.5,0 L.5,.5 L0,.5",
            3: "M.5,.5 L.5,1"
          },
          "┨": {
            1: "M.5,.5 L0,.5",
            3: "M.5,0 L.5,1"
          },
          "┩": {
            1: "M.5,.5 L.5,1",
            3: "M.5,0 L.5,.5 L0,.5"
          },
          "┪": {
            1: "M.5,.5 L.5,0",
            3: "M0,.5 L.5,.5 L.5,1"
          },
          "┭": {
            1: "M0.5,1 L.5,.5 L1,.5",
            3: "M.5,.5 L0,.5"
          },
          "┮": {
            1: "M0,.5 L.5,.5 L.5,1",
            3: "M.5,.5 L1,.5"
          },
          "┯": {
            1: "M.5,.5 L.5,1",
            3: "M0,.5 L1,.5"
          },
          "┰": {
            1: "M0,.5 L1,.5",
            3: "M.5,.5 L.5,1"
          },
          "┱": {
            1: "M.5,.5 L1,.5",
            3: "M0,.5 L.5,.5 L.5,1"
          },
          "┲": {
            1: "M.5,.5 L0,.5",
            3: "M0.5,1 L.5,.5 L1,.5"
          },
          "┵": {
            1: "M.5,0 L.5,.5 L1,.5",
            3: "M.5,.5 L0,.5"
          },
          "┶": {
            1: "M.5,0 L.5,.5 L0,.5",
            3: "M.5,.5 L1,.5"
          },
          "┷": {
            1: "M.5,.5 L.5,0",
            3: "M0,.5 L1,.5"
          },
          "┸": {
            1: "M0,.5 L1,.5",
            3: "M.5,.5 L.5,0"
          },
          "┹": {
            1: "M.5,.5 L1,.5",
            3: "M.5,0 L.5,.5 L0,.5"
          },
          "┺": {
            1: "M.5,.5 L0,.5",
            3: "M.5,0 L.5,.5 L1,.5"
          },
          "┽": {
            1: "M.5,0 L.5,1 M.5,.5 L1,.5",
            3: "M.5,.5 L0,.5"
          },
          "┾": {
            1: "M.5,0 L.5,1 M.5,.5 L0,.5",
            3: "M.5,.5 L1,.5"
          },
          "┿": {
            1: "M.5,0 L.5,1",
            3: "M0,.5 L1,.5"
          },
          "╀": {
            1: "M0,.5 L1,.5 M.5,.5 L.5,1",
            3: "M.5,.5 L.5,0"
          },
          "╁": {
            1: "M.5,.5 L.5,0 M0,.5 L1,.5",
            3: "M.5,.5 L.5,1"
          },
          "╂": {
            1: "M0,.5 L1,.5",
            3: "M.5,0 L.5,1"
          },
          "╃": {
            1: "M0.5,1 L.5,.5 L1,.5",
            3: "M.5,0 L.5,.5 L0,.5"
          },
          "╄": {
            1: "M0,.5 L.5,.5 L.5,1",
            3: "M.5,0 L.5,.5 L1,.5"
          },
          "╅": {
            1: "M.5,0 L.5,.5 L1,.5",
            3: "M0,.5 L.5,.5 L.5,1"
          },
          "╆": {
            1: "M.5,0 L.5,.5 L0,.5",
            3: "M0.5,1 L.5,.5 L1,.5"
          },
          "╇": {
            1: "M.5,.5 L.5,1",
            3: "M.5,.5 L.5,0 M0,.5 L1,.5"
          },
          "╈": {
            1: "M.5,.5 L.5,0",
            3: "M0,.5 L1,.5 M.5,.5 L.5,1"
          },
          "╉": {
            1: "M.5,.5 L1,.5",
            3: "M.5,0 L.5,1 M.5,.5 L0,.5"
          },
          "╊": {
            1: "M.5,.5 L0,.5",
            3: "M.5,0 L.5,1 M.5,.5 L1,.5"
          },
          "╌": {
            1: "M.1,.5 L.4,.5 M.6,.5 L.9,.5"
          },
          "╍": {
            3: "M.1,.5 L.4,.5 M.6,.5 L.9,.5"
          },
          "┄": {
            1: "M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"
          },
          "┅": {
            3: "M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"
          },
          "┈": {
            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"
          },
          "┉": {
            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"
          },
          "╎": {
            1: "M.5,.1 L.5,.4 M.5,.6 L.5,.9"
          },
          "╏": {
            3: "M.5,.1 L.5,.4 M.5,.6 L.5,.9"
          },
          "┆": {
            1: "M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"
          },
          "┇": {
            3: "M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"
          },
          "┊": {
            1: "M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"
          },
          "┋": {
            3: "M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"
          },
          "╭": {
            1: (e, t) => `M.5,1 L.5,${.5 + t / .15 * .5} C.5,${.5 + t / .15 * .5},.5,.5,1,.5`
          },
          "╮": {
            1: (e, t) => `M.5,1 L.5,${.5 + t / .15 * .5} C.5,${.5 + t / .15 * .5},.5,.5,0,.5`
          },
          "╯": {
            1: (e, t) => `M.5,0 L.5,${.5 - t / .15 * .5} C.5,${.5 - t / .15 * .5},.5,.5,0,.5`
          },
          "╰": {
            1: (e, t) => `M.5,0 L.5,${.5 - t / .15 * .5} C.5,${.5 - t / .15 * .5},.5,.5,1,.5`
          }
        }, t.powerlineDefinitions = {
          "": {
            d: "M0,0 L1,.5 L0,1",
            type: 0,
            rightPadding: 2
          },
          "": {
            d: "M-1,-.5 L1,.5 L-1,1.5",
            type: 1,
            leftPadding: 1,
            rightPadding: 1
          },
          "": {
            d: "M1,0 L0,.5 L1,1",
            type: 0,
            leftPadding: 2
          },
          "": {
            d: "M2,-.5 L0,.5 L2,1.5",
            type: 1,
            leftPadding: 1,
            rightPadding: 1
          },
          "": {
            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
          },
          "": {
            d: "M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",
            type: 1,
            rightPadding: 1
          },
          "": {
            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
          },
          "": {
            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
          },
          "": {
            d: "M-.5,-.5 L1.5,1.5 L-.5,1.5",
            type: 0
          },
          "": {
            d: "M-.5,-.5 L1.5,1.5",
            type: 1,
            leftPadding: 1,
            rightPadding: 1
          },
          "": {
            d: "M1.5,-.5 L-.5,1.5 L1.5,1.5",
            type: 0
          },
          "": {
            d: "M1.5,-.5 L-.5,1.5 L-.5,-.5",
            type: 0
          },
          "": {
            d: "M1.5,-.5 L-.5,1.5",
            type: 1,
            leftPadding: 1,
            rightPadding: 1
          },
          "": {
            d: "M-.5,-.5 L1.5,1.5 L1.5,-.5",
            type: 0
          }
        }, t.powerlineDefinitions[""] = t.powerlineDefinitions[""], t.powerlineDefinitions[""] = t.powerlineDefinitions[""], t.tryDrawCustomChar = function (e, i, n, l, c, d, _, u) {
          const g = t.blockElementDefinitions[i];
          if (g) return function (e, t, i, s, r, o) {
            for (let n = 0; n < t.length; n++) {
              const a = t[n],
                h = r / 8,
                l = o / 8;
              e.fillRect(i + a.x * h, s + a.y * l, a.w * h, a.h * l);
            }
          }(e, g, n, l, c, d), !0;
          const f = r[i];
          if (f) return function (e, t, i, r, n, a) {
            let h = o.get(t);
            h || (h = new Map(), o.set(t, h));
            const l = e.fillStyle;
            if ("string" != typeof l) throw new Error(`Unexpected fillStyle type "${l}"`);
            let c = h.get(l);
            if (!c) {
              const i = t[0].length,
                r = t.length,
                o = e.canvas.ownerDocument.createElement("canvas");
              o.width = i, o.height = r;
              const n = (0, s.throwIfFalsy)(o.getContext("2d")),
                a = new ImageData(i, r);
              let d, _, u, g;
              if (l.startsWith("#")) d = parseInt(l.slice(1, 3), 16), _ = parseInt(l.slice(3, 5), 16), u = parseInt(l.slice(5, 7), 16), g = l.length > 7 && parseInt(l.slice(7, 9), 16) || 1;else {
                if (!l.startsWith("rgba")) throw new Error(`Unexpected fillStyle color format "${l}" when drawing pattern glyph`);
                [d, _, u, g] = l.substring(5, l.length - 1).split(",").map(e => parseFloat(e));
              }
              for (let e = 0; e < r; e++) for (let s = 0; s < i; s++) a.data[4 * (e * i + s)] = d, a.data[4 * (e * i + s) + 1] = _, a.data[4 * (e * i + s) + 2] = u, a.data[4 * (e * i + s) + 3] = t[e][s] * (255 * g);
              n.putImageData(a, 0, 0), c = (0, s.throwIfFalsy)(e.createPattern(o, null)), h.set(l, c);
            }
            e.fillStyle = c, e.fillRect(i, r, n, a);
          }(e, f, n, l, c, d), !0;
          const v = t.boxDrawingDefinitions[i];
          if (v) return function (e, t, i, s, r, o, n) {
            e.strokeStyle = e.fillStyle;
            for (const [l, c] of Object.entries(t)) {
              let t;
              e.beginPath(), e.lineWidth = n * Number.parseInt(l), t = "function" == typeof c ? c(.15, .15 / o * r) : c;
              for (const l of t.split(" ")) {
                const t = l[0],
                  c = a[t];
                if (!c) {
                  console.error(`Could not find drawing instructions for "${t}"`);
                  continue;
                }
                const d = l.substring(1).split(",");
                d[0] && d[1] && c(e, h(d, r, o, i, s, !0, n));
              }
              e.stroke(), e.closePath();
            }
          }(e, v, n, l, c, d, u), !0;
          const C = t.powerlineDefinitions[i];
          return !!C && (function (e, t, i, s, r, o, n, l) {
            const c = new Path2D();
            c.rect(i, s, r, o), e.clip(c), e.beginPath();
            const d = n / 12;
            e.lineWidth = l * d;
            for (const n of t.d.split(" ")) {
              const c = n[0],
                _ = a[c];
              if (!_) {
                console.error(`Could not find drawing instructions for "${c}"`);
                continue;
              }
              const u = n.substring(1).split(",");
              u[0] && u[1] && _(e, h(u, r, o, i, s, !1, l, (t.leftPadding ?? 0) * (d / 2), (t.rightPadding ?? 0) * (d / 2)));
            }
            1 === t.type ? (e.strokeStyle = e.fillStyle, e.stroke()) : e.fill(), e.closePath();
          }(e, C, n, l, c, d, _, u), !0);
        };
        const o = new Map();
        function n(e, t, i = 0) {
          return Math.max(Math.min(e, t), i);
        }
        const a = {
          C: (e, t) => e.bezierCurveTo(t[0], t[1], t[2], t[3], t[4], t[5]),
          L: (e, t) => e.lineTo(t[0], t[1]),
          M: (e, t) => e.moveTo(t[0], t[1])
        };
        function h(e, t, i, s, r, o, a, h = 0, l = 0) {
          const c = e.map(e => parseFloat(e) || parseInt(e));
          if (c.length < 2) throw new Error("Too few arguments for instruction");
          for (let e = 0; e < c.length; e += 2) c[e] *= t - h * a - l * a, o && 0 !== c[e] && (c[e] = n(Math.round(c[e] + .5) - .5, t, 0)), c[e] += s + h * a;
          for (let e = 1; e < c.length; e += 2) c[e] *= i, o && 0 !== c[e] && (c[e] = n(Math.round(c[e] + .5) - .5, i, 0)), c[e] += r;
          return c;
        }
      },
      56: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.observeDevicePixelDimensions = void 0;
        const s = i(859);
        t.observeDevicePixelDimensions = function (e, t, i) {
          let r = new t.ResizeObserver(t => {
            const s = t.find(t => t.target === e);
            if (!s) return;
            if (!("devicePixelContentBoxSize" in s)) return r?.disconnect(), void (r = void 0);
            const o = s.devicePixelContentBoxSize[0].inlineSize,
              n = s.devicePixelContentBoxSize[0].blockSize;
            o > 0 && n > 0 && i(o, n);
          });
          try {
            r.observe(e, {
              box: ["device-pixel-content-box"]
            });
          } catch {
            r.disconnect(), r = void 0;
          }
          return (0, s.toDisposable)(() => r?.disconnect());
        };
      },
      374: (e, t) => {
        function i(e) {
          return 57508 <= e && e <= 57558;
        }
        function s(e) {
          return e >= 128512 && e <= 128591 || e >= 127744 && e <= 128511 || e >= 128640 && e <= 128767 || e >= 9728 && e <= 9983 || e >= 9984 && e <= 10175 || e >= 65024 && e <= 65039 || e >= 129280 && e <= 129535 || e >= 127462 && e <= 127487;
        }
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.computeNextVariantOffset = t.createRenderDimensions = t.treatGlyphAsBackgroundColor = t.allowRescaling = t.isEmoji = t.isRestrictedPowerlineGlyph = t.isPowerlineGlyph = t.throwIfFalsy = void 0, t.throwIfFalsy = function (e) {
          if (!e) throw new Error("value must not be falsy");
          return e;
        }, t.isPowerlineGlyph = i, t.isRestrictedPowerlineGlyph = function (e) {
          return 57520 <= e && e <= 57527;
        }, t.isEmoji = s, t.allowRescaling = function (e, t, r, o) {
          return 1 === t && r > Math.ceil(1.5 * o) && void 0 !== e && e > 255 && !s(e) && !i(e) && !function (e) {
            return 57344 <= e && e <= 63743;
          }(e);
        }, t.treatGlyphAsBackgroundColor = function (e) {
          return i(e) || function (e) {
            return 9472 <= e && e <= 9631;
          }(e);
        }, t.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
              }
            }
          };
        }, t.computeNextVariantOffset = function (e, t, i = 0) {
          return (e - (2 * Math.round(t) - i)) % (2 * Math.round(t));
        };
      },
      296: (e, t) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.createSelectionRenderModel = void 0;
        class i {
          constructor() {
            this.clear();
          }
          clear() {
            this.hasSelection = !1, this.columnSelectMode = !1, this.viewportStartRow = 0, this.viewportEndRow = 0, this.viewportCappedStartRow = 0, this.viewportCappedEndRow = 0, this.startCol = 0, this.endCol = 0, this.selectionStart = void 0, this.selectionEnd = void 0;
          }
          update(e, t, i, s = !1) {
            if (this.selectionStart = t, this.selectionEnd = i, !t || !i || t[0] === i[0] && t[1] === i[1]) return void this.clear();
            const r = e.buffers.active.ydisp,
              o = t[1] - r,
              n = i[1] - r,
              a = Math.max(o, 0),
              h = Math.min(n, e.rows - 1);
            a >= e.rows || h < 0 ? this.clear() : (this.hasSelection = !0, this.columnSelectMode = s, this.viewportStartRow = o, this.viewportEndRow = n, this.viewportCappedStartRow = a, this.viewportCappedEndRow = h, this.startCol = t[0], this.endCol = i[0]);
          }
          isCellSelected(e, t, i) {
            return !!this.hasSelection && (i -= e.buffer.active.viewportY, this.columnSelectMode ? this.startCol <= this.endCol ? t >= this.startCol && i >= this.viewportCappedStartRow && t < this.endCol && i <= this.viewportCappedEndRow : t < this.startCol && i >= this.viewportCappedStartRow && t >= this.endCol && i <= this.viewportCappedEndRow : i > this.viewportStartRow && i < this.viewportEndRow || this.viewportStartRow === this.viewportEndRow && i === this.viewportStartRow && t >= this.startCol && t < this.endCol || this.viewportStartRow < this.viewportEndRow && i === this.viewportEndRow && t < this.endCol || this.viewportStartRow < this.viewportEndRow && i === this.viewportStartRow && t >= this.startCol);
          }
        }
        t.createSelectionRenderModel = function () {
          return new i();
        };
      },
      509: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.TextureAtlas = void 0;
        const s = i(237),
          r = i(860),
          o = i(374),
          n = i(160),
          a = i(345),
          h = i(485),
          l = i(385),
          c = i(147),
          d = i(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
            }
          };
        let u;
        class g {
          get pages() {
            return this._pages;
          }
          constructor(e, t, i) {
            this._document = e, this._config = t, this._unicodeService = i, this._didWarmUp = !1, this._cacheMap = new h.FourKeyMap(), this._cacheMapCombined = new h.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 = C(e, 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 (const e of this.pages) e.canvas.remove();
            this._onAddTextureAtlasCanvas.dispose();
          }
          warmUp() {
            this._didWarmUp || (this._doWarmUp(), this._didWarmUp = !0);
          }
          _doWarmUp() {
            const e = new l.IdleTaskQueue();
            for (let t = 33; t < 126; t++) e.enqueue(() => {
              if (!this._cacheMap.get(t, d.DEFAULT_COLOR, d.DEFAULT_COLOR, d.DEFAULT_EXT)) {
                const e = this._drawToCache(t, d.DEFAULT_COLOR, d.DEFAULT_COLOR, d.DEFAULT_EXT);
                this._cacheMap.set(t, d.DEFAULT_COLOR, d.DEFAULT_COLOR, d.DEFAULT_EXT, e);
              }
            });
          }
          beginFrame() {
            return this._requestClearModel;
          }
          clearTexture() {
            if (0 !== this._pages[0].currentRow.x || 0 !== this._pages[0].currentRow.y) {
              for (const e of this._pages) e.clear();
              this._cacheMap.clear(), this._cacheMapCombined.clear(), this._didWarmUp = !1;
            }
          }
          _createNewPage() {
            if (g.maxAtlasPages && this._pages.length >= Math.max(4, g.maxAtlasPages)) {
              const e = this._pages.filter(e => 2 * e.canvas.width <= (g.maxTextureSize || 4096)).sort((e, t) => t.canvas.width !== e.canvas.width ? t.canvas.width - e.canvas.width : t.percentageUsed - e.percentageUsed);
              let t = -1,
                i = 0;
              for (let s = 0; s < e.length; s++) if (e[s].canvas.width !== i) t = s, i = e[s].canvas.width;else if (s - t == 3) break;
              const s = e.slice(t, t + 4),
                r = s.map(e => e.glyphs[0].texturePage).sort((e, t) => e > t ? 1 : -1),
                o = this.pages.length - s.length,
                n = this._mergePages(s, o);
              n.version++;
              for (let e = r.length - 1; e >= 0; e--) this._deletePage(r[e]);
              this.pages.push(n), this._requestClearModel = !0, this._onAddTextureAtlasCanvas.fire(n.canvas);
            }
            const e = new f(this._document, this._textureSize);
            return this._pages.push(e), this._activePages.push(e), this._onAddTextureAtlasCanvas.fire(e.canvas), e;
          }
          _mergePages(e, t) {
            const i = 2 * e[0].canvas.width,
              s = new f(this._document, i, e);
            for (const [r, o] of e.entries()) {
              const e = r * o.canvas.width % i,
                n = Math.floor(r / 2) * o.canvas.height;
              s.ctx.drawImage(o.canvas, e, n);
              for (const s of o.glyphs) s.texturePage = t, s.sizeClipSpace.x = s.size.x / i, s.sizeClipSpace.y = s.size.y / i, s.texturePosition.x += e, s.texturePosition.y += n, s.texturePositionClipSpace.x = s.texturePosition.x / i, s.texturePositionClipSpace.y = s.texturePosition.y / i;
              this._onRemoveTextureAtlasCanvas.fire(o.canvas);
              const a = this._activePages.indexOf(o);
              -1 !== a && this._activePages.splice(a, 1);
            }
            return s;
          }
          _deletePage(e) {
            this._pages.splice(e, 1);
            for (let t = e; t < this._pages.length; t++) {
              const e = this._pages[t];
              for (const t of e.glyphs) t.texturePage--;
              e.version++;
            }
          }
          getRasterizedGlyphCombinedChar(e, t, i, s, r) {
            return this._getFromCacheMap(this._cacheMapCombined, e, t, i, s, r);
          }
          getRasterizedGlyph(e, t, i, s, r) {
            return this._getFromCacheMap(this._cacheMap, e, t, i, s, r);
          }
          _getFromCacheMap(e, t, i, s, r, o = !1) {
            return u = e.get(t, i, s, r), u || (u = this._drawToCache(t, i, s, r, o), e.set(t, i, s, r, u)), u;
          }
          _getColorFromAnsiIndex(e) {
            if (e >= this._config.colors.ansi.length) throw new Error("No color found for idx " + e);
            return this._config.colors.ansi[e];
          }
          _getBackgroundColor(e, t, i, s) {
            if (this._config.allowTransparency) return n.NULL_COLOR;
            let r;
            switch (e) {
              case 16777216:
              case 33554432:
                r = this._getColorFromAnsiIndex(t);
                break;
              case 50331648:
                const e = c.AttributeData.toColorRGB(t);
                r = n.channels.toColor(e[0], e[1], e[2]);
                break;
              default:
                r = i ? n.color.opaque(this._config.colors.foreground) : this._config.colors.background;
            }
            return r;
          }
          _getForegroundColor(e, t, i, r, o, a, h, l, d, _) {
            const u = this._getMinimumContrastColor(e, t, i, r, o, a, h, d, l, _);
            if (u) return u;
            let g;
            switch (o) {
              case 16777216:
              case 33554432:
                this._config.drawBoldTextInBrightColors && d && a < 8 && (a += 8), g = this._getColorFromAnsiIndex(a);
                break;
              case 50331648:
                const e = c.AttributeData.toColorRGB(a);
                g = n.channels.toColor(e[0], e[1], e[2]);
                break;
              default:
                g = h ? this._config.colors.background : this._config.colors.foreground;
            }
            return this._config.allowTransparency && (g = n.color.opaque(g)), l && (g = n.color.multiplyOpacity(g, s.DIM_OPACITY)), g;
          }
          _resolveBackgroundRgba(e, t, i) {
            switch (e) {
              case 16777216:
              case 33554432:
                return this._getColorFromAnsiIndex(t).rgba;
              case 50331648:
                return t << 8;
              default:
                return i ? this._config.colors.foreground.rgba : this._config.colors.background.rgba;
            }
          }
          _resolveForegroundRgba(e, t, i, s) {
            switch (e) {
              case 16777216:
              case 33554432:
                return this._config.drawBoldTextInBrightColors && s && t < 8 && (t += 8), this._getColorFromAnsiIndex(t).rgba;
              case 50331648:
                return t << 8;
              default:
                return i ? this._config.colors.background.rgba : this._config.colors.foreground.rgba;
            }
          }
          _getMinimumContrastColor(e, t, i, s, r, o, a, h, l, c) {
            if (1 === this._config.minimumContrastRatio || c) return;
            const d = this._getContrastCache(l),
              _ = d.getColor(e, s);
            if (void 0 !== _) return _ || void 0;
            const u = this._resolveBackgroundRgba(t, i, a),
              g = this._resolveForegroundRgba(r, o, a, h),
              f = n.rgba.ensureContrastRatio(u, g, this._config.minimumContrastRatio / (l ? 2 : 1));
            if (!f) return void d.setColor(e, s, null);
            const v = n.channels.toColor(f >> 24 & 255, f >> 16 & 255, f >> 8 & 255);
            return d.setColor(e, s, v), v;
          }
          _getContrastCache(e) {
            return e ? this._config.colors.halfContrastCache : this._config.colors.contrastCache;
          }
          _drawToCache(e, t, i, n, a = !1) {
            const h = "number" == typeof e ? String.fromCharCode(e) : e,
              l = Math.min(this._config.deviceCellWidth * Math.max(h.length, 2) + 4, this._textureSize);
            this._tmpCanvas.width < l && (this._tmpCanvas.width = l);
            const d = Math.min(this._config.deviceCellHeight + 8, this._textureSize);
            if (this._tmpCanvas.height < d && (this._tmpCanvas.height = d), this._tmpCtx.save(), this._workAttributeData.fg = i, this._workAttributeData.bg = t, this._workAttributeData.extended.ext = n, this._workAttributeData.isInvisible()) return _;
            const u = !!this._workAttributeData.isBold(),
              f = !!this._workAttributeData.isInverse(),
              C = !!this._workAttributeData.isDim(),
              p = !!this._workAttributeData.isItalic(),
              m = !!this._workAttributeData.isUnderline(),
              x = !!this._workAttributeData.isStrikethrough(),
              w = !!this._workAttributeData.isOverline();
            let L = this._workAttributeData.getFgColor(),
              b = this._workAttributeData.getFgColorMode(),
              M = this._workAttributeData.getBgColor(),
              S = this._workAttributeData.getBgColorMode();
            if (f) {
              const e = L;
              L = M, M = e;
              const t = b;
              b = S, S = t;
            }
            const y = this._getBackgroundColor(S, M, f, C);
            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";
            const R = u ? this._config.fontWeightBold : this._config.fontWeight,
              A = p ? "italic" : "";
            this._tmpCtx.font = `${A} ${R} ${this._config.fontSize * this._config.devicePixelRatio}px ${this._config.fontFamily}`, this._tmpCtx.textBaseline = s.TEXT_BASELINE;
            const D = 1 === h.length && (0, o.isPowerlineGlyph)(h.charCodeAt(0)),
              T = 1 === h.length && (0, o.isRestrictedPowerlineGlyph)(h.charCodeAt(0)),
              k = this._getForegroundColor(t, S, M, i, b, L, f, C, u, (0, o.treatGlyphAsBackgroundColor)(h.charCodeAt(0)));
            this._tmpCtx.fillStyle = k.css;
            const E = T ? 0 : 4;
            let B = !1;
            !1 !== this._config.customGlyphs && (B = (0, r.tryDrawCustomChar)(this._tmpCtx, h, E, E, this._config.deviceCellWidth, this._config.deviceCellHeight, this._config.fontSize, this._config.devicePixelRatio));
            let $,
              P = !D;
            if ($ = "number" == typeof e ? this._unicodeService.wcwidth(e) : this._unicodeService.getStringCellWidth(e), m) {
              this._tmpCtx.save();
              const e = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 15)),
                t = e % 2 == 1 ? .5 : 0;
              if (this._tmpCtx.lineWidth = e, this._workAttributeData.isUnderlineColorDefault()) this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle;else if (this._workAttributeData.isUnderlineColorRGB()) P = !1, this._tmpCtx.strokeStyle = `rgb(${c.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else {
                P = !1;
                let e = this._workAttributeData.getUnderlineColor();
                this._config.drawBoldTextInBrightColors && this._workAttributeData.isBold() && e < 8 && (e += 8), this._tmpCtx.strokeStyle = this._getColorFromAnsiIndex(e).css;
              }
              this._tmpCtx.beginPath();
              const i = E,
                s = Math.ceil(E + this._config.deviceCharHeight) - t - (a ? 2 * e : 0),
                r = s + e,
                n = s + 2 * e;
              let l = this._workAttributeData.getUnderlineVariantOffset();
              for (let a = 0; a < $; a++) {
                this._tmpCtx.save();
                const h = i + a * this._config.deviceCellWidth,
                  c = i + (a + 1) * this._config.deviceCellWidth,
                  d = h + this._config.deviceCellWidth / 2;
                switch (this._workAttributeData.extended.underlineStyle) {
                  case 2:
                    this._tmpCtx.moveTo(h, s), this._tmpCtx.lineTo(c, s), this._tmpCtx.moveTo(h, n), this._tmpCtx.lineTo(c, n);
                    break;
                  case 3:
                    const i = e <= 1 ? n : Math.ceil(E + this._config.deviceCharHeight - e / 2) - t,
                      a = e <= 1 ? s : Math.ceil(E + this._config.deviceCharHeight + e / 2) - t,
                      _ = new Path2D();
                    _.rect(h, s, this._config.deviceCellWidth, n - s), this._tmpCtx.clip(_), this._tmpCtx.moveTo(h - this._config.deviceCellWidth / 2, r), this._tmpCtx.bezierCurveTo(h - this._config.deviceCellWidth / 2, a, h, a, h, r), this._tmpCtx.bezierCurveTo(h, i, d, i, d, r), this._tmpCtx.bezierCurveTo(d, a, c, a, c, r), this._tmpCtx.bezierCurveTo(c, i, c + this._config.deviceCellWidth / 2, i, c + this._config.deviceCellWidth / 2, r);
                    break;
                  case 4:
                    const u = 0 === l ? 0 : l >= e ? 2 * e - l : e - l;
                    !1 == !(l >= e) || 0 === u ? (this._tmpCtx.setLineDash([Math.round(e), Math.round(e)]), this._tmpCtx.moveTo(h + u, s), this._tmpCtx.lineTo(c, s)) : (this._tmpCtx.setLineDash([Math.round(e), Math.round(e)]), this._tmpCtx.moveTo(h, s), this._tmpCtx.lineTo(h + u, s), this._tmpCtx.moveTo(h + u + e, s), this._tmpCtx.lineTo(c, s)), l = (0, o.computeNextVariantOffset)(c - h, e, l);
                    break;
                  case 5:
                    const g = .6,
                      f = .3,
                      v = c - h,
                      C = Math.floor(g * v),
                      p = Math.floor(f * v),
                      m = v - C - p;
                    this._tmpCtx.setLineDash([C, p, m]), this._tmpCtx.moveTo(h, s), this._tmpCtx.lineTo(c, s);
                    break;
                  default:
                    this._tmpCtx.moveTo(h, s), this._tmpCtx.lineTo(c, s);
                }
                this._tmpCtx.stroke(), this._tmpCtx.restore();
              }
              if (this._tmpCtx.restore(), !B && this._config.fontSize >= 12 && !this._config.allowTransparency && " " !== h) {
                this._tmpCtx.save(), this._tmpCtx.textBaseline = "alphabetic";
                const t = this._tmpCtx.measureText(h);
                if (this._tmpCtx.restore(), "actualBoundingBoxDescent" in t && t.actualBoundingBoxDescent > 0) {
                  this._tmpCtx.save();
                  const t = new Path2D();
                  t.rect(i, s - Math.ceil(e / 2), this._config.deviceCellWidth * $, n - s + Math.ceil(e / 2)), this._tmpCtx.clip(t), this._tmpCtx.lineWidth = 3 * this._config.devicePixelRatio, this._tmpCtx.strokeStyle = y.css, this._tmpCtx.strokeText(h, E, E + this._config.deviceCharHeight), this._tmpCtx.restore();
                }
              }
            }
            if (w) {
              const e = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 15)),
                t = e % 2 == 1 ? .5 : 0;
              this._tmpCtx.lineWidth = e, this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle, this._tmpCtx.beginPath(), this._tmpCtx.moveTo(E, E + t), this._tmpCtx.lineTo(E + this._config.deviceCharWidth * $, E + t), this._tmpCtx.stroke();
            }
            if (B || this._tmpCtx.fillText(h, E, E + this._config.deviceCharHeight), "_" === h && !this._config.allowTransparency) {
              let e = v(this._tmpCtx.getImageData(E, E, this._config.deviceCellWidth, this._config.deviceCellHeight), y, k, P);
              if (e) for (let t = 1; t <= 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(h, E, E + this._config.deviceCharHeight - t), e = v(this._tmpCtx.getImageData(E, E, this._config.deviceCellWidth, this._config.deviceCellHeight), y, k, P), e); t++);
            }
            if (x) {
              const e = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 10)),
                t = this._tmpCtx.lineWidth % 2 == 1 ? .5 : 0;
              this._tmpCtx.lineWidth = e, this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle, this._tmpCtx.beginPath(), this._tmpCtx.moveTo(E, E + Math.floor(this._config.deviceCharHeight / 2) - t), this._tmpCtx.lineTo(E + this._config.deviceCharWidth * $, E + Math.floor(this._config.deviceCharHeight / 2) - t), this._tmpCtx.stroke();
            }
            this._tmpCtx.restore();
            const O = this._tmpCtx.getImageData(0, 0, this._tmpCanvas.width, this._tmpCanvas.height);
            let I;
            if (I = this._config.allowTransparency ? function (e) {
              for (let t = 0; t < e.data.length; t += 4) if (e.data[t + 3] > 0) return !1;
              return !0;
            }(O) : v(O, y, k, P), I) return _;
            const F = this._findGlyphBoundingBox(O, this._workBoundingBox, l, T, B, E);
            let W, H;
            for (;;) {
              if (0 === this._activePages.length) {
                const e = this._createNewPage();
                W = e, H = e.currentRow, H.height = F.size.y;
                break;
              }
              W = this._activePages[this._activePages.length - 1], H = W.currentRow;
              for (const e of this._activePages) F.size.y <= e.currentRow.height && (W = e, H = e.currentRow);
              for (let e = this._activePages.length - 1; e >= 0; e--) for (const t of this._activePages[e].fixedRows) t.height <= H.height && F.size.y <= t.height && (W = this._activePages[e], H = t);
              if (H.y + F.size.y >= W.canvas.height || H.height > F.size.y + 2) {
                let e = !1;
                if (W.currentRow.y + W.currentRow.height + F.size.y >= W.canvas.height) {
                  let t;
                  for (const e of this._activePages) if (e.currentRow.y + e.currentRow.height + F.size.y < e.canvas.height) {
                    t = e;
                    break;
                  }
                  if (t) W = t;else if (g.maxAtlasPages && this._pages.length >= g.maxAtlasPages && H.y + F.size.y <= W.canvas.height && H.height >= F.size.y && H.x + F.size.x <= W.canvas.width) e = !0;else {
                    const t = this._createNewPage();
                    W = t, H = t.currentRow, H.height = F.size.y, e = !0;
                  }
                }
                e || (W.currentRow.height > 0 && W.fixedRows.push(W.currentRow), H = {
                  x: 0,
                  y: W.currentRow.y + W.currentRow.height,
                  height: F.size.y
                }, W.fixedRows.push(H), W.currentRow = {
                  x: 0,
                  y: H.y + H.height,
                  height: 0
                });
              }
              if (H.x + F.size.x <= W.canvas.width) break;
              H === W.currentRow ? (H.x = 0, H.y += H.height, H.height = 0) : W.fixedRows.splice(W.fixedRows.indexOf(H), 1);
            }
            return F.texturePage = this._pages.indexOf(W), F.texturePosition.x = H.x, F.texturePosition.y = H.y, F.texturePositionClipSpace.x = H.x / W.canvas.width, F.texturePositionClipSpace.y = H.y / W.canvas.height, F.sizeClipSpace.x /= W.canvas.width, F.sizeClipSpace.y /= W.canvas.height, H.height = Math.max(H.height, F.size.y), H.x += F.size.x, W.ctx.putImageData(O, F.texturePosition.x - this._workBoundingBox.left, F.texturePosition.y - this._workBoundingBox.top, this._workBoundingBox.left, this._workBoundingBox.top, F.size.x, F.size.y), W.addGlyph(F), W.version++, F;
          }
          _findGlyphBoundingBox(e, t, i, s, r, o) {
            t.top = 0;
            const n = s ? this._config.deviceCellHeight : this._tmpCanvas.height,
              a = s ? this._config.deviceCellWidth : i;
            let h = !1;
            for (let i = 0; i < n; i++) {
              for (let s = 0; s < a; s++) {
                const r = i * this._tmpCanvas.width * 4 + 4 * s + 3;
                if (0 !== e.data[r]) {
                  t.top = i, h = !0;
                  break;
                }
              }
              if (h) break;
            }
            t.left = 0, h = !1;
            for (let i = 0; i < o + a; i++) {
              for (let s = 0; s < n; s++) {
                const r = s * this._tmpCanvas.width * 4 + 4 * i + 3;
                if (0 !== e.data[r]) {
                  t.left = i, h = !0;
                  break;
                }
              }
              if (h) break;
            }
            t.right = a, h = !1;
            for (let i = o + a - 1; i >= o; i--) {
              for (let s = 0; s < n; s++) {
                const r = s * this._tmpCanvas.width * 4 + 4 * i + 3;
                if (0 !== e.data[r]) {
                  t.right = i, h = !0;
                  break;
                }
              }
              if (h) break;
            }
            t.bottom = n, h = !1;
            for (let i = n - 1; i >= 0; i--) {
              for (let s = 0; s < a; s++) {
                const r = i * this._tmpCanvas.width * 4 + 4 * s + 3;
                if (0 !== e.data[r]) {
                  t.bottom = i, h = !0;
                  break;
                }
              }
              if (h) break;
            }
            return {
              texturePage: 0,
              texturePosition: {
                x: 0,
                y: 0
              },
              texturePositionClipSpace: {
                x: 0,
                y: 0
              },
              size: {
                x: t.right - t.left + 1,
                y: t.bottom - t.top + 1
              },
              sizeClipSpace: {
                x: t.right - t.left + 1,
                y: t.bottom - t.top + 1
              },
              offset: {
                x: -t.left + o + (s || r ? Math.floor((this._config.deviceCellWidth - this._config.deviceCharWidth) / 2) : 0),
                y: -t.top + o + (s || r ? 1 === this._config.lineHeight ? 0 : Math.round((this._config.deviceCellHeight - this._config.deviceCharHeight) / 2) : 0)
              }
            };
          }
        }
        t.TextureAtlas = g;
        class f {
          get percentageUsed() {
            return this._usedPixels / (this.canvas.width * this.canvas.height);
          }
          get glyphs() {
            return this._glyphs;
          }
          addGlyph(e) {
            this._glyphs.push(e), this._usedPixels += e.size.x * e.size.y;
          }
          constructor(e, t, i) {
            if (this._usedPixels = 0, this._glyphs = [], this.version = 0, this.currentRow = {
              x: 0,
              y: 0,
              height: 0
            }, this.fixedRows = [], i) for (const e of i) this._glyphs.push(...e.glyphs), this._usedPixels += e._usedPixels;
            this.canvas = C(e, t, t), 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 v(e, t, i, s) {
          const r = t.rgba >>> 24,
            o = t.rgba >>> 16 & 255,
            n = t.rgba >>> 8 & 255,
            a = i.rgba >>> 24,
            h = i.rgba >>> 16 & 255,
            l = i.rgba >>> 8 & 255,
            c = Math.floor((Math.abs(r - a) + Math.abs(o - h) + Math.abs(n - l)) / 12);
          let d = !0;
          for (let t = 0; t < e.data.length; t += 4) e.data[t] === r && e.data[t + 1] === o && e.data[t + 2] === n || s && Math.abs(e.data[t] - r) + Math.abs(e.data[t + 1] - o) + Math.abs(e.data[t + 2] - n) < c ? e.data[t + 3] = 0 : d = !1;
          return d;
        }
        function C(e, t, i) {
          const s = e.createElement("canvas");
          return s.width = t, s.height = i, s;
        }
      },
      577: function (e, t, i) {
        var s = this && this.__decorate || function (e, t, i, s) {
            var r,
              o = arguments.length,
              n = o < 3 ? t : null === s ? s = Object.getOwnPropertyDescriptor(t, i) : s;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(e, t, i, s);else for (var a = e.length - 1; a >= 0; a--) (r = e[a]) && (n = (o < 3 ? r(n) : o > 3 ? r(t, i, n) : r(t, i)) || n);
            return o > 3 && n && Object.defineProperty(t, i, n), n;
          },
          r = this && this.__param || function (e, t) {
            return function (i, s) {
              t(i, s, e);
            };
          };
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.CharacterJoinerService = t.JoinedCellData = void 0;
        const o = i(147),
          n = i(855),
          a = i(782),
          h = i(97);
        class l extends o.AttributeData {
          constructor(e, t, i) {
            super(), this.content = 0, this.combinedData = "", this.fg = e.fg, this.bg = e.bg, this.combinedData = t, this._width = i;
          }
          isCombined() {
            return 2097152;
          }
          getWidth() {
            return this._width;
          }
          getChars() {
            return this.combinedData;
          }
          getCode() {
            return 2097151;
          }
          setFromCharData(e) {
            throw new Error("not implemented");
          }
          getAsCharData() {
            return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
          }
        }
        t.JoinedCellData = l;
        let c = t.CharacterJoinerService = class e {
          constructor(e) {
            this._bufferService = e, this._characterJoiners = [], this._nextCharacterJoinerId = 0, this._workCell = new a.CellData();
          }
          register(e) {
            const t = {
              id: this._nextCharacterJoinerId++,
              handler: e
            };
            return this._characterJoiners.push(t), t.id;
          }
          deregister(e) {
            for (let t = 0; t < this._characterJoiners.length; t++) if (this._characterJoiners[t].id === e) return this._characterJoiners.splice(t, 1), !0;
            return !1;
          }
          getJoinedCharacters(e) {
            if (0 === this._characterJoiners.length) return [];
            const t = this._bufferService.buffer.lines.get(e);
            if (!t || 0 === t.length) return [];
            const i = [],
              s = t.translateToString(!0);
            let r = 0,
              o = 0,
              a = 0,
              h = t.getFg(0),
              l = t.getBg(0);
            for (let e = 0; e < t.getTrimmedLength(); e++) if (t.loadCell(e, this._workCell), 0 !== this._workCell.getWidth()) {
              if (this._workCell.fg !== h || this._workCell.bg !== l) {
                if (e - r > 1) {
                  const e = this._getJoinedRanges(s, a, o, t, r);
                  for (let t = 0; t < e.length; t++) i.push(e[t]);
                }
                r = e, a = o, h = this._workCell.fg, l = this._workCell.bg;
              }
              o += this._workCell.getChars().length || n.WHITESPACE_CELL_CHAR.length;
            }
            if (this._bufferService.cols - r > 1) {
              const e = this._getJoinedRanges(s, a, o, t, r);
              for (let t = 0; t < e.length; t++) i.push(e[t]);
            }
            return i;
          }
          _getJoinedRanges(t, i, s, r, o) {
            const n = t.substring(i, s);
            let a = [];
            try {
              a = this._characterJoiners[0].handler(n);
            } catch (e) {
              console.error(e);
            }
            for (let t = 1; t < this._characterJoiners.length; t++) try {
              const i = this._characterJoiners[t].handler(n);
              for (let t = 0; t < i.length; t++) e._mergeRanges(a, i[t]);
            } catch (e) {
              console.error(e);
            }
            return this._stringRangesToCellRanges(a, r, o), a;
          }
          _stringRangesToCellRanges(e, t, i) {
            let s = 0,
              r = !1,
              o = 0,
              a = e[s];
            if (a) {
              for (let h = i; h < this._bufferService.cols; h++) {
                const i = t.getWidth(h),
                  l = t.getString(h).length || n.WHITESPACE_CELL_CHAR.length;
                if (0 !== i) {
                  if (!r && a[0] <= o && (a[0] = h, r = !0), a[1] <= o) {
                    if (a[1] = h, a = e[++s], !a) break;
                    a[0] <= o ? (a[0] = h, r = !0) : r = !1;
                  }
                  o += l;
                }
              }
              a && (a[1] = this._bufferService.cols);
            }
          }
          static _mergeRanges(e, t) {
            let i = !1;
            for (let s = 0; s < e.length; s++) {
              const r = e[s];
              if (i) {
                if (t[1] <= r[0]) return e[s - 1][1] = t[1], e;
                if (t[1] <= r[1]) return e[s - 1][1] = Math.max(t[1], r[1]), e.splice(s, 1), e;
                e.splice(s, 1), s--;
              } else {
                if (t[1] <= r[0]) return e.splice(s, 0, t), e;
                if (t[1] <= r[1]) return r[0] = Math.min(t[0], r[0]), e;
                t[0] < r[1] && (r[0] = Math.min(t[0], r[0]), i = !0);
              }
            }
            return i ? e[e.length - 1][1] = t[1] : e.push(t), e;
          }
        };
        t.CharacterJoinerService = c = s([r(0, h.IBufferService)], c);
      },
      160: (e, t) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.contrastRatio = t.toPaddedHex = t.rgba = t.rgb = t.css = t.color = t.channels = t.NULL_COLOR = void 0;
        let i = 0,
          s = 0,
          r = 0,
          o = 0;
        var n, a, h, l, c;
        function d(e) {
          const t = e.toString(16);
          return t.length < 2 ? "0" + t : t;
        }
        function _(e, t) {
          return e < t ? (t + .05) / (e + .05) : (e + .05) / (t + .05);
        }
        t.NULL_COLOR = {
          css: "#00000000",
          rgba: 0
        }, function (e) {
          e.toCss = function (e, t, i, s) {
            return void 0 !== s ? `#${d(e)}${d(t)}${d(i)}${d(s)}` : `#${d(e)}${d(t)}${d(i)}`;
          }, e.toRgba = function (e, t, i, s = 255) {
            return (e << 24 | t << 16 | i << 8 | s) >>> 0;
          }, e.toColor = function (t, i, s, r) {
            return {
              css: e.toCss(t, i, s, r),
              rgba: e.toRgba(t, i, s, r)
            };
          };
        }(n || (t.channels = n = {})), function (e) {
          function t(e, t) {
            return o = Math.round(255 * t), [i, s, r] = c.toChannels(e.rgba), {
              css: n.toCss(i, s, r, o),
              rgba: n.toRgba(i, s, r, o)
            };
          }
          e.blend = function (e, t) {
            if (o = (255 & t.rgba) / 255, 1 === o) return {
              css: t.css,
              rgba: t.rgba
            };
            const a = t.rgba >> 24 & 255,
              h = t.rgba >> 16 & 255,
              l = t.rgba >> 8 & 255,
              c = e.rgba >> 24 & 255,
              d = e.rgba >> 16 & 255,
              _ = e.rgba >> 8 & 255;
            return i = c + Math.round((a - c) * o), s = d + Math.round((h - d) * o), r = _ + Math.round((l - _) * o), {
              css: n.toCss(i, s, r),
              rgba: n.toRgba(i, s, r)
            };
          }, e.isOpaque = function (e) {
            return 255 == (255 & e.rgba);
          }, e.ensureContrastRatio = function (e, t, i) {
            const s = c.ensureContrastRatio(e.rgba, t.rgba, i);
            if (s) return n.toColor(s >> 24 & 255, s >> 16 & 255, s >> 8 & 255);
          }, e.opaque = function (e) {
            const t = (255 | e.rgba) >>> 0;
            return [i, s, r] = c.toChannels(t), {
              css: n.toCss(i, s, r),
              rgba: t
            };
          }, e.opacity = t, e.multiplyOpacity = function (e, i) {
            return o = 255 & e.rgba, t(e, o * i / 255);
          }, e.toColorRGB = function (e) {
            return [e.rgba >> 24 & 255, e.rgba >> 16 & 255, e.rgba >> 8 & 255];
          };
        }(a || (t.color = a = {})), function (e) {
          let t, a;
          try {
            const e = document.createElement("canvas");
            e.width = 1, e.height = 1;
            const i = e.getContext("2d", {
              willReadFrequently: !0
            });
            i && (t = i, t.globalCompositeOperation = "copy", a = t.createLinearGradient(0, 0, 1, 1));
          } catch {}
          e.toColor = function (e) {
            if (e.match(/#[\da-f]{3,8}/i)) switch (e.length) {
              case 4:
                return i = parseInt(e.slice(1, 2).repeat(2), 16), s = parseInt(e.slice(2, 3).repeat(2), 16), r = parseInt(e.slice(3, 4).repeat(2), 16), n.toColor(i, s, r);
              case 5:
                return i = parseInt(e.slice(1, 2).repeat(2), 16), s = parseInt(e.slice(2, 3).repeat(2), 16), r = parseInt(e.slice(3, 4).repeat(2), 16), o = parseInt(e.slice(4, 5).repeat(2), 16), n.toColor(i, s, r, o);
              case 7:
                return {
                  css: e,
                  rgba: (parseInt(e.slice(1), 16) << 8 | 255) >>> 0
                };
              case 9:
                return {
                  css: e,
                  rgba: parseInt(e.slice(1), 16) >>> 0
                };
            }
            const h = e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);
            if (h) return i = parseInt(h[1]), s = parseInt(h[2]), r = parseInt(h[3]), o = Math.round(255 * (void 0 === h[5] ? 1 : parseFloat(h[5]))), n.toColor(i, s, r, o);
            if (!t || !a) throw new Error("css.toColor: Unsupported css format");
            if (t.fillStyle = a, t.fillStyle = e, "string" != typeof t.fillStyle) throw new Error("css.toColor: Unsupported css format");
            if (t.fillRect(0, 0, 1, 1), [i, s, r, o] = t.getImageData(0, 0, 1, 1).data, 255 !== o) throw new Error("css.toColor: Unsupported css format");
            return {
              rgba: n.toRgba(i, s, r, o),
              css: e
            };
          };
        }(h || (t.css = h = {})), function (e) {
          function t(e, t, i) {
            const s = e / 255,
              r = t / 255,
              o = i / 255;
            return .2126 * (s <= .03928 ? s / 12.92 : Math.pow((s + .055) / 1.055, 2.4)) + .7152 * (r <= .03928 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4)) + .0722 * (o <= .03928 ? o / 12.92 : Math.pow((o + .055) / 1.055, 2.4));
          }
          e.relativeLuminance = function (e) {
            return t(e >> 16 & 255, e >> 8 & 255, 255 & e);
          }, e.relativeLuminance2 = t;
        }(l || (t.rgb = l = {})), function (e) {
          function t(e, t, i) {
            const s = e >> 24 & 255,
              r = e >> 16 & 255,
              o = e >> 8 & 255;
            let n = t >> 24 & 255,
              a = t >> 16 & 255,
              h = t >> 8 & 255,
              c = _(l.relativeLuminance2(n, a, h), l.relativeLuminance2(s, r, o));
            for (; c < i && (n > 0 || a > 0 || h > 0);) n -= Math.max(0, Math.ceil(.1 * n)), a -= Math.max(0, Math.ceil(.1 * a)), h -= Math.max(0, Math.ceil(.1 * h)), c = _(l.relativeLuminance2(n, a, h), l.relativeLuminance2(s, r, o));
            return (n << 24 | a << 16 | h << 8 | 255) >>> 0;
          }
          function a(e, t, i) {
            const s = e >> 24 & 255,
              r = e >> 16 & 255,
              o = e >> 8 & 255;
            let n = t >> 24 & 255,
              a = t >> 16 & 255,
              h = t >> 8 & 255,
              c = _(l.relativeLuminance2(n, a, h), l.relativeLuminance2(s, r, o));
            for (; c < i && (n < 255 || a < 255 || h < 255);) n = Math.min(255, n + Math.ceil(.1 * (255 - n))), a = Math.min(255, a + Math.ceil(.1 * (255 - a))), h = Math.min(255, h + Math.ceil(.1 * (255 - h))), c = _(l.relativeLuminance2(n, a, h), l.relativeLuminance2(s, r, o));
            return (n << 24 | a << 16 | h << 8 | 255) >>> 0;
          }
          e.blend = function (e, t) {
            if (o = (255 & t) / 255, 1 === o) return t;
            const a = t >> 24 & 255,
              h = t >> 16 & 255,
              l = t >> 8 & 255,
              c = e >> 24 & 255,
              d = e >> 16 & 255,
              _ = e >> 8 & 255;
            return i = c + Math.round((a - c) * o), s = d + Math.round((h - d) * o), r = _ + Math.round((l - _) * o), n.toRgba(i, s, r);
          }, e.ensureContrastRatio = function (e, i, s) {
            const r = l.relativeLuminance(e >> 8),
              o = l.relativeLuminance(i >> 8);
            if (_(r, o) < s) {
              if (o < r) {
                const o = t(e, i, s),
                  n = _(r, l.relativeLuminance(o >> 8));
                if (n < s) {
                  const t = a(e, i, s);
                  return n > _(r, l.relativeLuminance(t >> 8)) ? o : t;
                }
                return o;
              }
              const n = a(e, i, s),
                h = _(r, l.relativeLuminance(n >> 8));
              if (h < s) {
                const o = t(e, i, s);
                return h > _(r, l.relativeLuminance(o >> 8)) ? n : o;
              }
              return n;
            }
          }, e.reduceLuminance = t, e.increaseLuminance = a, e.toChannels = function (e) {
            return [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, 255 & e];
          };
        }(c || (t.rgba = c = {})), t.toPaddedHex = d, t.contrastRatio = _;
      },
      345: (e, t) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.runAndSubscribe = t.forwardEvent = t.EventEmitter = void 0, t.EventEmitter = class {
          constructor() {
            this._listeners = [], this._disposed = !1;
          }
          get event() {
            return this._event || (this._event = e => (this._listeners.push(e), {
              dispose: () => {
                if (!this._disposed) for (let t = 0; t < this._listeners.length; t++) if (this._listeners[t] === e) return void this._listeners.splice(t, 1);
              }
            })), this._event;
          }
          fire(e, t) {
            const i = [];
            for (let e = 0; e < this._listeners.length; e++) i.push(this._listeners[e]);
            for (let s = 0; s < i.length; s++) i[s].call(void 0, e, t);
          }
          dispose() {
            this.clearListeners(), this._disposed = !0;
          }
          clearListeners() {
            this._listeners && (this._listeners.length = 0);
          }
        }, t.forwardEvent = function (e, t) {
          return e(e => t.fire(e));
        }, t.runAndSubscribe = function (e, t) {
          return t(void 0), e(e => t(e));
        };
      },
      859: (e, t) => {
        function i(e) {
          for (const t of e) t.dispose();
          e.length = 0;
        }
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.getDisposeArrayDisposable = t.disposeArray = t.toDisposable = t.MutableDisposable = t.Disposable = void 0, t.Disposable = class {
          constructor() {
            this._disposables = [], this._isDisposed = !1;
          }
          dispose() {
            this._isDisposed = !0;
            for (const e of this._disposables) e.dispose();
            this._disposables.length = 0;
          }
          register(e) {
            return this._disposables.push(e), e;
          }
          unregister(e) {
            const t = this._disposables.indexOf(e);
            -1 !== t && this._disposables.splice(t, 1);
          }
        }, t.MutableDisposable = class {
          constructor() {
            this._isDisposed = !1;
          }
          get value() {
            return this._isDisposed ? void 0 : this._value;
          }
          set value(e) {
            this._isDisposed || e === this._value || (this._value?.dispose(), this._value = e);
          }
          clear() {
            this.value = void 0;
          }
          dispose() {
            this._isDisposed = !0, this._value?.dispose(), this._value = void 0;
          }
        }, t.toDisposable = function (e) {
          return {
            dispose: e
          };
        }, t.disposeArray = i, t.getDisposeArrayDisposable = function (e) {
          return {
            dispose: () => i(e)
          };
        };
      },
      485: (e, t) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.FourKeyMap = t.TwoKeyMap = void 0;
        class i {
          constructor() {
            this._data = {};
          }
          set(e, t, i) {
            this._data[e] || (this._data[e] = {}), this._data[e][t] = i;
          }
          get(e, t) {
            return this._data[e] ? this._data[e][t] : void 0;
          }
          clear() {
            this._data = {};
          }
        }
        t.TwoKeyMap = i, t.FourKeyMap = class {
          constructor() {
            this._data = new i();
          }
          set(e, t, s, r, o) {
            this._data.get(e, t) || this._data.set(e, t, new i()), this._data.get(e, t).set(s, r, o);
          }
          get(e, t, i, s) {
            return this._data.get(e, t)?.get(i, s);
          }
          clear() {
            this._data.clear();
          }
        };
      },
      399: (e, t) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.isChromeOS = t.isLinux = t.isWindows = t.isIphone = t.isIpad = t.isMac = t.getSafariVersion = t.isSafari = t.isLegacyEdge = t.isFirefox = t.isNode = void 0, t.isNode = "undefined" != typeof process && "title" in process;
        const i = t.isNode ? "node" : navigator.userAgent,
          s = t.isNode ? "node" : navigator.platform;
        t.isFirefox = i.includes("Firefox"), t.isLegacyEdge = i.includes("Edge"), t.isSafari = /^((?!chrome|android).)*safari/i.test(i), t.getSafariVersion = function () {
          if (!t.isSafari) return 0;
          const e = i.match(/Version\/(\d+)/);
          return null === e || e.length < 2 ? 0 : parseInt(e[1]);
        }, t.isMac = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"].includes(s), t.isIpad = "iPad" === s, t.isIphone = "iPhone" === s, t.isWindows = ["Windows", "Win16", "Win32", "WinCE"].includes(s), t.isLinux = s.indexOf("Linux") >= 0, t.isChromeOS = /\bCrOS\b/.test(i);
      },
      385: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.DebouncedIdleTask = t.IdleTaskQueue = t.PriorityTaskQueue = void 0;
        const s = i(399);
        class r {
          constructor() {
            this._tasks = [], this._i = 0;
          }
          enqueue(e) {
            this._tasks.push(e), this._start();
          }
          flush() {
            for (; this._i < this._tasks.length;) this._tasks[this._i]() || this._i++;
            this.clear();
          }
          clear() {
            this._idleCallback && (this._cancelCallback(this._idleCallback), this._idleCallback = void 0), this._i = 0, this._tasks.length = 0;
          }
          _start() {
            this._idleCallback || (this._idleCallback = this._requestCallback(this._process.bind(this)));
          }
          _process(e) {
            this._idleCallback = void 0;
            let t = 0,
              i = 0,
              s = e.timeRemaining(),
              r = 0;
            for (; this._i < this._tasks.length;) {
              if (t = Date.now(), this._tasks[this._i]() || this._i++, t = Math.max(1, Date.now() - t), i = Math.max(t, i), r = e.timeRemaining(), 1.5 * i > r) return s - t < -20 && console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s - t))}ms`), void this._start();
              s = r;
            }
            this.clear();
          }
        }
        class o extends r {
          _requestCallback(e) {
            return setTimeout(() => e(this._createDeadline(16)));
          }
          _cancelCallback(e) {
            clearTimeout(e);
          }
          _createDeadline(e) {
            const t = Date.now() + e;
            return {
              timeRemaining: () => Math.max(0, t - Date.now())
            };
          }
        }
        t.PriorityTaskQueue = o, t.IdleTaskQueue = !s.isNode && "requestIdleCallback" in window ? class extends r {
          _requestCallback(e) {
            return requestIdleCallback(e);
          }
          _cancelCallback(e) {
            cancelIdleCallback(e);
          }
        } : o, t.DebouncedIdleTask = class {
          constructor() {
            this._queue = new t.IdleTaskQueue();
          }
          set(e) {
            this._queue.clear(), this._queue.enqueue(e);
          }
          flush() {
            this._queue.flush();
          }
        };
      },
      147: (e, t) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.ExtendedAttrs = t.AttributeData = void 0;
        class i {
          constructor() {
            this.fg = 0, this.bg = 0, this.extended = new s();
          }
          static toColorRGB(e) {
            return [e >>> 16 & 255, e >>> 8 & 255, 255 & e];
          }
          static fromColorRGB(e) {
            return (255 & e[0]) << 16 | (255 & e[1]) << 8 | 255 & e[2];
          }
          clone() {
            const e = new i();
            return e.fg = this.fg, e.bg = this.bg, e.extended = this.extended.clone(), e;
          }
          isInverse() {
            return 67108864 & this.fg;
          }
          isBold() {
            return 134217728 & this.fg;
          }
          isUnderline() {
            return this.hasExtendedAttrs() && 0 !== this.extended.underlineStyle ? 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 == (50331648 & this.fg);
          }
          isBgRGB() {
            return 50331648 == (50331648 & this.bg);
          }
          isFgPalette() {
            return 16777216 == (50331648 & this.fg) || 33554432 == (50331648 & this.fg);
          }
          isBgPalette() {
            return 16777216 == (50331648 & this.bg) || 33554432 == (50331648 & this.bg);
          }
          isFgDefault() {
            return 0 == (50331648 & this.fg);
          }
          isBgDefault() {
            return 0 == (50331648 & this.bg);
          }
          isAttributeDefault() {
            return 0 === this.fg && 0 === this.bg;
          }
          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 == (50331648 & this.extended.underlineColor) : this.isFgRGB();
          }
          isUnderlineColorPalette() {
            return 268435456 & this.bg && ~this.extended.underlineColor ? 16777216 == (50331648 & this.extended.underlineColor) || 33554432 == (50331648 & this.extended.underlineColor) : this.isFgPalette();
          }
          isUnderlineColorDefault() {
            return 268435456 & this.bg && ~this.extended.underlineColor ? 0 == (50331648 & this.extended.underlineColor) : this.isFgDefault();
          }
          getUnderlineStyle() {
            return 268435456 & this.fg ? 268435456 & this.bg ? this.extended.underlineStyle : 1 : 0;
          }
          getUnderlineVariantOffset() {
            return this.extended.underlineVariantOffset;
          }
        }
        t.AttributeData = i;
        class s {
          get ext() {
            return this._urlId ? -469762049 & this._ext | this.underlineStyle << 26 : this._ext;
          }
          set ext(e) {
            this._ext = e;
          }
          get underlineStyle() {
            return this._urlId ? 5 : (469762048 & this._ext) >> 26;
          }
          set underlineStyle(e) {
            this._ext &= -469762049, this._ext |= e << 26 & 469762048;
          }
          get underlineColor() {
            return 67108863 & this._ext;
          }
          set underlineColor(e) {
            this._ext &= -67108864, this._ext |= 67108863 & e;
          }
          get urlId() {
            return this._urlId;
          }
          set urlId(e) {
            this._urlId = e;
          }
          get underlineVariantOffset() {
            const e = (3758096384 & this._ext) >> 29;
            return e < 0 ? 4294967288 ^ e : e;
          }
          set underlineVariantOffset(e) {
            this._ext &= 536870911, this._ext |= e << 29 & 3758096384;
          }
          constructor(e = 0, t = 0) {
            this._ext = 0, this._urlId = 0, this._ext = e, this._urlId = t;
          }
          clone() {
            return new s(this._ext, this._urlId);
          }
          isEmpty() {
            return 0 === this.underlineStyle && 0 === this._urlId;
          }
        }
        t.ExtendedAttrs = s;
      },
      782: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.CellData = void 0;
        const s = i(133),
          r = i(855),
          o = i(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(e) {
            const t = new n();
            return t.setFromCharData(e), t;
          }
          isCombined() {
            return 2097152 & this.content;
          }
          getWidth() {
            return this.content >> 22;
          }
          getChars() {
            return 2097152 & this.content ? this.combinedData : 2097151 & this.content ? (0, s.stringFromCodePoint)(2097151 & this.content) : "";
          }
          getCode() {
            return this.isCombined() ? this.combinedData.charCodeAt(this.combinedData.length - 1) : 2097151 & this.content;
          }
          setFromCharData(e) {
            this.fg = e[r.CHAR_DATA_ATTR_INDEX], this.bg = 0;
            let t = !1;
            if (e[r.CHAR_DATA_CHAR_INDEX].length > 2) t = !0;else if (2 === e[r.CHAR_DATA_CHAR_INDEX].length) {
              const i = e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);
              if (55296 <= i && i <= 56319) {
                const s = e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);
                56320 <= s && s <= 57343 ? this.content = 1024 * (i - 55296) + s - 56320 + 65536 | e[r.CHAR_DATA_WIDTH_INDEX] << 22 : t = !0;
              } else t = !0;
            } else this.content = e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | e[r.CHAR_DATA_WIDTH_INDEX] << 22;
            t && (this.combinedData = e[r.CHAR_DATA_CHAR_INDEX], this.content = 2097152 | e[r.CHAR_DATA_WIDTH_INDEX] << 22);
          }
          getAsCharData() {
            return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
          }
        }
        t.CellData = n;
      },
      855: (e, t) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.WHITESPACE_CELL_CODE = t.WHITESPACE_CELL_WIDTH = t.WHITESPACE_CELL_CHAR = t.NULL_CELL_CODE = t.NULL_CELL_WIDTH = t.NULL_CELL_CHAR = t.CHAR_DATA_CODE_INDEX = t.CHAR_DATA_WIDTH_INDEX = t.CHAR_DATA_CHAR_INDEX = t.CHAR_DATA_ATTR_INDEX = t.DEFAULT_EXT = t.DEFAULT_ATTR = t.DEFAULT_COLOR = void 0, t.DEFAULT_COLOR = 0, t.DEFAULT_ATTR = 256 | t.DEFAULT_COLOR << 9, t.DEFAULT_EXT = 0, t.CHAR_DATA_ATTR_INDEX = 0, t.CHAR_DATA_CHAR_INDEX = 1, t.CHAR_DATA_WIDTH_INDEX = 2, t.CHAR_DATA_CODE_INDEX = 3, t.NULL_CELL_CHAR = "", t.NULL_CELL_WIDTH = 1, t.NULL_CELL_CODE = 0, t.WHITESPACE_CELL_CHAR = " ", t.WHITESPACE_CELL_WIDTH = 1, t.WHITESPACE_CELL_CODE = 32;
      },
      133: (e, t) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.Utf8ToUtf32 = t.StringToUtf32 = t.utf32ToString = t.stringFromCodePoint = void 0, t.stringFromCodePoint = function (e) {
          return e > 65535 ? (e -= 65536, String.fromCharCode(55296 + (e >> 10)) + String.fromCharCode(e % 1024 + 56320)) : String.fromCharCode(e);
        }, t.utf32ToString = function (e, t = 0, i = e.length) {
          let s = "";
          for (let r = t; r < i; ++r) {
            let t = e[r];
            t > 65535 ? (t -= 65536, s += String.fromCharCode(55296 + (t >> 10)) + String.fromCharCode(t % 1024 + 56320)) : s += String.fromCharCode(t);
          }
          return s;
        }, t.StringToUtf32 = class {
          constructor() {
            this._interim = 0;
          }
          clear() {
            this._interim = 0;
          }
          decode(e, t) {
            const i = e.length;
            if (!i) return 0;
            let s = 0,
              r = 0;
            if (this._interim) {
              const i = e.charCodeAt(r++);
              56320 <= i && i <= 57343 ? t[s++] = 1024 * (this._interim - 55296) + i - 56320 + 65536 : (t[s++] = this._interim, t[s++] = i), this._interim = 0;
            }
            for (let o = r; o < i; ++o) {
              const r = e.charCodeAt(o);
              if (55296 <= r && r <= 56319) {
                if (++o >= i) return this._interim = r, s;
                const n = e.charCodeAt(o);
                56320 <= n && n <= 57343 ? t[s++] = 1024 * (r - 55296) + n - 56320 + 65536 : (t[s++] = r, t[s++] = n);
              } else 65279 !== r && (t[s++] = r);
            }
            return s;
          }
        }, t.Utf8ToUtf32 = class {
          constructor() {
            this.interim = new Uint8Array(3);
          }
          clear() {
            this.interim.fill(0);
          }
          decode(e, t) {
            const i = e.length;
            if (!i) return 0;
            let s,
              r,
              o,
              n,
              a = 0,
              h = 0,
              l = 0;
            if (this.interim[0]) {
              let s = !1,
                r = this.interim[0];
              r &= 192 == (224 & r) ? 31 : 224 == (240 & r) ? 15 : 7;
              let o,
                n = 0;
              for (; (o = 63 & this.interim[++n]) && n < 4;) r <<= 6, r |= o;
              const h = 192 == (224 & this.interim[0]) ? 2 : 224 == (240 & this.interim[0]) ? 3 : 4,
                c = h - n;
              for (; l < c;) {
                if (l >= i) return 0;
                if (o = e[l++], 128 != (192 & o)) {
                  l--, s = !0;
                  break;
                }
                this.interim[n++] = o, r <<= 6, r |= 63 & o;
              }
              s || (2 === h ? r < 128 ? l-- : t[a++] = r : 3 === h ? r < 2048 || r >= 55296 && r <= 57343 || 65279 === r || (t[a++] = r) : r < 65536 || r > 1114111 || (t[a++] = r)), this.interim.fill(0);
            }
            const c = i - 4;
            let d = l;
            for (; d < i;) {
              for (; !(!(d < c) || 128 & (s = e[d]) || 128 & (r = e[d + 1]) || 128 & (o = e[d + 2]) || 128 & (n = e[d + 3]));) t[a++] = s, t[a++] = r, t[a++] = o, t[a++] = n, d += 4;
              if (s = e[d++], s < 128) t[a++] = s;else if (192 == (224 & s)) {
                if (d >= i) return this.interim[0] = s, a;
                if (r = e[d++], 128 != (192 & r)) {
                  d--;
                  continue;
                }
                if (h = (31 & s) << 6 | 63 & r, h < 128) {
                  d--;
                  continue;
                }
                t[a++] = h;
              } else if (224 == (240 & s)) {
                if (d >= i) return this.interim[0] = s, a;
                if (r = e[d++], 128 != (192 & r)) {
                  d--;
                  continue;
                }
                if (d >= i) return this.interim[0] = s, this.interim[1] = r, a;
                if (o = e[d++], 128 != (192 & o)) {
                  d--;
                  continue;
                }
                if (h = (15 & s) << 12 | (63 & r) << 6 | 63 & o, h < 2048 || h >= 55296 && h <= 57343 || 65279 === h) continue;
                t[a++] = h;
              } else if (240 == (248 & s)) {
                if (d >= i) return this.interim[0] = s, a;
                if (r = e[d++], 128 != (192 & r)) {
                  d--;
                  continue;
                }
                if (d >= i) return this.interim[0] = s, this.interim[1] = r, a;
                if (o = e[d++], 128 != (192 & o)) {
                  d--;
                  continue;
                }
                if (d >= i) return this.interim[0] = s, this.interim[1] = r, this.interim[2] = o, a;
                if (n = e[d++], 128 != (192 & n)) {
                  d--;
                  continue;
                }
                if (h = (7 & s) << 18 | (63 & r) << 12 | (63 & o) << 6 | 63 & n, h < 65536 || h > 1114111) continue;
                t[a++] = h;
              }
            }
            return a;
          }
        };
      },
      776: function (e, t, i) {
        var s = this && this.__decorate || function (e, t, i, s) {
            var r,
              o = arguments.length,
              n = o < 3 ? t : null === s ? s = Object.getOwnPropertyDescriptor(t, i) : s;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(e, t, i, s);else for (var a = e.length - 1; a >= 0; a--) (r = e[a]) && (n = (o < 3 ? r(n) : o > 3 ? r(t, i, n) : r(t, i)) || n);
            return o > 3 && n && Object.defineProperty(t, i, n), n;
          },
          r = this && this.__param || function (e, t) {
            return function (i, s) {
              t(i, s, e);
            };
          };
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.traceCall = t.setTraceLogger = t.LogService = void 0;
        const o = i(859),
          n = i(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
          };
        let h,
          l = t.LogService = class extends o.Disposable {
            get logLevel() {
              return this._logLevel;
            }
            constructor(e) {
              super(), this._optionsService = e, this._logLevel = n.LogLevelEnum.OFF, this._updateLogLevel(), this.register(this._optionsService.onSpecificOptionChange("logLevel", () => this._updateLogLevel())), h = this;
            }
            _updateLogLevel() {
              this._logLevel = a[this._optionsService.rawOptions.logLevel];
            }
            _evalLazyOptionalParams(e) {
              for (let t = 0; t < e.length; t++) "function" == typeof e[t] && (e[t] = e[t]());
            }
            _log(e, t, i) {
              this._evalLazyOptionalParams(i), e.call(console, (this._optionsService.options.logger ? "" : "xterm.js: ") + t, ...i);
            }
            trace(e, ...t) {
              this._logLevel <= n.LogLevelEnum.TRACE && this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger) ?? console.log, e, t);
            }
            debug(e, ...t) {
              this._logLevel <= n.LogLevelEnum.DEBUG && this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger) ?? console.log, e, t);
            }
            info(e, ...t) {
              this._logLevel <= n.LogLevelEnum.INFO && this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger) ?? console.info, e, t);
            }
            warn(e, ...t) {
              this._logLevel <= n.LogLevelEnum.WARN && this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger) ?? console.warn, e, t);
            }
            error(e, ...t) {
              this._logLevel <= n.LogLevelEnum.ERROR && this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger) ?? console.error, e, t);
            }
          };
        t.LogService = l = s([r(0, n.IOptionsService)], l), t.setTraceLogger = function (e) {
          h = e;
        }, t.traceCall = function (e, t, i) {
          if ("function" != typeof i.value) throw new Error("not supported");
          const s = i.value;
          i.value = function (...e) {
            if (h.logLevel !== n.LogLevelEnum.TRACE) return s.apply(this, e);
            h.trace(`GlyphRenderer#${s.name}(${e.map(e => JSON.stringify(e)).join(", ")})`);
            const t = s.apply(this, e);
            return h.trace(`GlyphRenderer#${s.name} return`, t), t;
          };
        };
      },
      726: (e, t) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.createDecorator = t.getServiceDependencies = t.serviceRegistry = void 0;
        const i = "di$target",
          s = "di$dependencies";
        t.serviceRegistry = new Map(), t.getServiceDependencies = function (e) {
          return e[s] || [];
        }, t.createDecorator = function (e) {
          if (t.serviceRegistry.has(e)) return t.serviceRegistry.get(e);
          const r = function (e, t, o) {
            if (3 !== arguments.length) throw new Error("@IServiceName-decorator can only be used to decorate a parameter");
            !function (e, t, r) {
              t[i] === t ? t[s].push({
                id: e,
                index: r
              }) : (t[s] = [{
                id: e,
                index: r
              }], t[i] = t);
            }(r, e, o);
          };
          return r.toString = () => e, t.serviceRegistry.set(e, r), r;
        };
      },
      97: (e, t, i) => {
        Object.defineProperty(t, "__esModule", {
          value: !0
        }), t.IDecorationService = t.IUnicodeService = t.IOscLinkService = t.IOptionsService = t.ILogService = t.LogLevelEnum = t.IInstantiationService = t.ICharsetService = t.ICoreService = t.ICoreMouseService = t.IBufferService = void 0;
        const s = i(726);
        var r;
        t.IBufferService = (0, s.createDecorator)("BufferService"), t.ICoreMouseService = (0, s.createDecorator)("CoreMouseService"), t.ICoreService = (0, s.createDecorator)("CoreService"), t.ICharsetService = (0, s.createDecorator)("CharsetService"), t.IInstantiationService = (0, s.createDecorator)("InstantiationService"), function (e) {
          e[e.TRACE = 0] = "TRACE", e[e.DEBUG = 1] = "DEBUG", e[e.INFO = 2] = "INFO", e[e.WARN = 3] = "WARN", e[e.ERROR = 4] = "ERROR", e[e.OFF = 5] = "OFF";
        }(r || (t.LogLevelEnum = r = {})), t.ILogService = (0, s.createDecorator)("LogService"), t.IOptionsService = (0, s.createDecorator)("OptionsService"), t.IOscLinkService = (0, s.createDecorator)("OscLinkService"), t.IUnicodeService = (0, s.createDecorator)("UnicodeService"), t.IDecorationService = (0, s.createDecorator)("DecorationService");
      }
    },
    t = {};
  function i(s) {
    var r = t[s];
    if (void 0 !== r) return r.exports;
    var o = t[s] = {
      exports: {}
    };
    return e[s].call(o.exports, o, o.exports, i), o.exports;
  }
  var s = {};
  return (() => {
    var e = s;
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.CanvasAddon = void 0;
    const t = i(345),
      r = i(859),
      o = i(776),
      n = i(949);
    class a extends r.Disposable {
      constructor() {
        super(...arguments), this._onChangeTextureAtlas = this.register(new t.EventEmitter()), this.onChangeTextureAtlas = this._onChangeTextureAtlas.event, this._onAddTextureAtlasCanvas = this.register(new t.EventEmitter()), this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event;
      }
      get textureAtlas() {
        return this._renderer?.textureAtlas;
      }
      activate(e) {
        const i = e._core;
        if (!e.element) return void this.register(i.onWillOpen(() => this.activate(e)));
        this._terminal = e;
        const s = i.coreService,
          a = i.optionsService,
          h = i.screenElement,
          l = i.linkifier,
          c = i,
          d = c._bufferService,
          _ = c._renderService,
          u = c._characterJoinerService,
          g = c._charSizeService,
          f = c._coreBrowserService,
          v = c._decorationService,
          C = c._logService,
          p = c._themeService;
        (0, o.setTraceLogger)(C), this._renderer = new n.CanvasRenderer(e, h, l, d, g, a, u, s, f, v, p), this.register((0, t.forwardEvent)(this._renderer.onChangeTextureAtlas, this._onChangeTextureAtlas)), this.register((0, t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas)), _.setRenderer(this._renderer), _.handleResize(d.cols, d.rows), this.register((0, r.toDisposable)(() => {
          _.setRenderer(this._terminal._core._createRenderer()), _.handleResize(e.cols, e.rows), this._renderer?.dispose(), this._renderer = void 0;
        }));
      }
      clearTextureAtlas() {
        this._renderer?.clearTextureAtlas();
      }
    }
    e.CanvasAddon = a;
  })(), s;
})());

/***/ },

/***/ 3478
/*!**********************************************!*\
  !*** ./node_modules/zmodem.js/src/zerror.js ***!
  \**********************************************/
(module) {

"use strict";


var Zmodem = module.exports;
function _crc_message(got, expected) {
  this.got = got.slice(0);
  this.expected = expected.slice(0);
  return "CRC check failed! (got: " + got.join() + "; expected: " + expected.join() + ")";
}
function _pass(val) {
  return val;
}
const TYPE_MESSAGE = {
  aborted: "Session aborted",
  peer_aborted: "Peer aborted session",
  already_aborted: "Session already aborted",
  crc: _crc_message,
  validation: _pass
};
function _generate_message(type) {
  const msg = TYPE_MESSAGE[type];
  switch (typeof msg) {
    case "string":
      return msg;
    case "function":
      var args_after_type = [].slice.call(arguments).slice(1);
      return msg.apply(this, args_after_type);
  }
  return null;
}
Zmodem.Error = class ZmodemError extends Error {
  constructor(msg_or_type) {
    super();
    var generated = _generate_message.apply(this, arguments);
    if (generated) {
      this.type = msg_or_type;
      this.message = generated;
    } else {
      this.message = msg_or_type;
    }
  }
};

/***/ },

/***/ 3479
/*!******************************************!*\
  !*** ../node_modules/object-is/index.js ***!
  \******************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var define = __webpack_require__(/*! define-properties */ 2445);
var callBind = __webpack_require__(/*! call-bind */ 3990);
var implementation = __webpack_require__(/*! ./implementation */ 88);
var getPolyfill = __webpack_require__(/*! ./polyfill */ 4301);
var shim = __webpack_require__(/*! ./shim */ 1243);
var polyfill = callBind(getPolyfill(), Object);
define(polyfill, {
  getPolyfill: getPolyfill,
  implementation: implementation,
  shim: shim
});
module.exports = polyfill;

/***/ },

/***/ 3568
/*!*********************************************!*\
  !*** ./node_modules/zmodem.js/src/zmlib.js ***!
  \*********************************************/
(module) {

"use strict";


var Zmodem = module.exports;
const ZDLE = 0x18,
  XON = 0x11,
  XOFF = 0x13,
  XON_HIGH = 0x80 | XON,
  XOFF_HIGH = 0x80 | XOFF,
  CAN = 0x18 //NB: same character as ZDLE
;

/**
 * Tools and constants that are useful for ZMODEM.
 *
 * @exports ZMLIB
 */
Zmodem.ZMLIB = {
  /**
   * @property {number} The ZDLE constant, which ZMODEM uses for escaping
   */
  ZDLE: ZDLE,
  /**
   * @property {number} XON - ASCII XON
   */
  XON: XON,
  /**
   * @property {number} XOFF - ASCII XOFF
   */
  XOFF: XOFF,
  /**
   * @property {number[]} ABORT_SEQUENCE - ZMODEM’s abort sequence
   */
  ABORT_SEQUENCE: [CAN, CAN, CAN, CAN, CAN],
  /**
   * Remove octet values from the given array that ZMODEM always ignores.
   * This will mutate the given array.
   *
   * @param {number[]} octets - The octet values to transform.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *      This object is mutated in the function.
   *
   * @returns {number[]} The passed-in array. This is the same object that is
   *      passed in.
   */
  strip_ignored_bytes: function strip_ignored_bytes(octets) {
    for (var o = octets.length - 1; o >= 0; o--) {
      switch (octets[o]) {
        case XON:
        case XON_HIGH:
        case XOFF:
        case XOFF_HIGH:
          octets.splice(o, 1);
          continue;
      }
    }
    return octets;
  },
  /**
   * Like Array.prototype.indexOf, but searches for a subarray
   * rather than just a particular value.
   *
   * @param {Array} haystack - The array to search, i.e., the bigger.
   *
   * @param {Array} needle - The array whose values to find,
   *      i.e., the smaller.
   *
   * @returns {number} The position in “haystack” where “needle”
   *      first appears—or, -1 if “needle” doesn’t appear anywhere
   *      in “haystack”.
   */
  find_subarray: function find_subarray(haystack, needle) {
    var h = 0,
      n;
    var start = Date.now();
    HAYSTACK: while (h !== -1) {
      h = haystack.indexOf(needle[0], h);
      if (h === -1) break HAYSTACK;
      for (n = 1; n < needle.length; n++) {
        if (haystack[h + n] !== needle[n]) {
          h++;
          continue HAYSTACK;
        }
      }
      return h;
    }
    return -1;
  }
};

/***/ },

/***/ 3606
/*!********************************************************************!*\
  !*** ../app/node_modules/regexp.prototype.flags/implementation.js ***!
  \********************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var setFunctionName = __webpack_require__(/*! set-function-name */ 8323);
var $TypeError = __webpack_require__(/*! es-errors/type */ 9176);
var $Object = Object;
module.exports = setFunctionName(function flags() {
  if (this == null || this !== $Object(this)) {
    throw new $TypeError('RegExp.prototype.flags getter called on non-object');
  }
  var result = '';
  if (this.hasIndices) {
    result += 'd';
  }
  if (this.global) {
    result += 'g';
  }
  if (this.ignoreCase) {
    result += 'i';
  }
  if (this.multiline) {
    result += 'm';
  }
  if (this.dotAll) {
    result += 's';
  }
  if (this.unicode) {
    result += 'u';
  }
  if (this.unicodeSets) {
    result += 'v';
  }
  if (this.sticky) {
    result += 'y';
  }
  return result;
}, 'get flags', true);

/***/ },

/***/ 3607
/*!***********************************************!*\
  !*** ../app/node_modules/is-weakset/index.js ***!
  \***********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ 6852);
var callBound = __webpack_require__(/*! call-bound */ 4731);
var $WeakSet = GetIntrinsic('%WeakSet%', true);

/** @type {undefined | (<V>(thisArg: Set<V>, value: V) => boolean)} */
var $setHas = callBound('WeakSet.prototype.has', true);
if ($setHas) {
  /** @type {undefined | (<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean)} */
  var $mapHas = callBound('WeakMap.prototype.has', true);

  /** @type {import('.')} */
  module.exports = function isWeakSet(x) {
    if (!x || typeof x !== 'object') {
      return false;
    }
    try {
      // @ts-expect-error TS can't figure out that $setHas is always truthy here
      $setHas(x, $setHas);
      if ($mapHas) {
        try {
          // @ts-expect-error this indeed might not be a weak collection
          $mapHas(x, $mapHas);
        } catch (e) {
          return true;
        }
      }
      // @ts-expect-error TS can't figure out that $WeakSet is always truthy here
      return x instanceof $WeakSet; // core-js workaround, pre-v3
    } catch (e) {}
    return false;
  };
} else {
  /** @type {import('.')} */
  // @ts-expect-error
  module.exports = function isWeakSet(x) {
    // eslint-disable-line no-unused-vars
    // `WeakSet` does not exist, or does not have a `has` method
    return false;
  };
}

/***/ },

/***/ 3629
/*!**************************************************!*\
  !*** ../app/node_modules/math-intrinsics/pow.js ***!
  \**************************************************/
(module) {

"use strict";


/** @type {import('./pow')} */
module.exports = Math.pow;

/***/ },

/***/ 3651
/*!**************************************!*\
  !*** ./node_modules/crc-32/crc32.js ***!
  \**************************************/
(__unused_webpack_module, exports) {

/* crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
/* vim: set ts=2: */
/*exported CRC32 */
var CRC32;
(function (factory) {
  /*jshint ignore:start */
  /*eslint-disable */
  if (typeof DO_NOT_EXPORT_CRC === 'undefined') {
    if (true) {
      factory(exports);
    } else // removed by dead control flow
{}
  } else {
    factory(CRC32 = {});
  }
  /*eslint-enable */
  /*jshint ignore:end */
})(function (CRC32) {
  CRC32.version = '1.2.0';
  /* see perf/crc32table.js */
  /*global Int32Array */
  function signed_crc_table() {
    var c = 0,
      table = new Array(256);
    for (var n = 0; n != 256; ++n) {
      c = n;
      c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
      c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
      c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
      c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
      c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
      c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
      c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
      c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1;
      table[n] = c;
    }
    return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;
  }
  var T = signed_crc_table();
  function crc32_bstr(bstr, seed) {
    var C = seed ^ -1,
      L = bstr.length - 1;
    for (var i = 0; i < L;) {
      C = C >>> 8 ^ T[(C ^ bstr.charCodeAt(i++)) & 0xFF];
      C = C >>> 8 ^ T[(C ^ bstr.charCodeAt(i++)) & 0xFF];
    }
    if (i === L) C = C >>> 8 ^ T[(C ^ bstr.charCodeAt(i)) & 0xFF];
    return C ^ -1;
  }
  function crc32_buf(buf, seed) {
    if (buf.length > 10000) return crc32_buf_8(buf, seed);
    var C = seed ^ -1,
      L = buf.length - 3;
    for (var i = 0; i < L;) {
      C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
      C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
      C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
      C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
    }
    while (i < L + 3) C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
    return C ^ -1;
  }
  function crc32_buf_8(buf, seed) {
    var C = seed ^ -1,
      L = buf.length - 7;
    for (var i = 0; i < L;) {
      C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
      C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
      C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
      C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
      C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
      C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
      C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
      C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
    }
    while (i < L + 7) C = C >>> 8 ^ T[(C ^ buf[i++]) & 0xFF];
    return C ^ -1;
  }
  function crc32_str(str, seed) {
    var C = seed ^ -1;
    for (var i = 0, L = str.length, c, d; i < L;) {
      c = str.charCodeAt(i++);
      if (c < 0x80) {
        C = C >>> 8 ^ T[(C ^ c) & 0xFF];
      } else if (c < 0x800) {
        C = C >>> 8 ^ T[(C ^ (192 | c >> 6 & 31)) & 0xFF];
        C = C >>> 8 ^ T[(C ^ (128 | c & 63)) & 0xFF];
      } else if (c >= 0xD800 && c < 0xE000) {
        c = (c & 1023) + 64;
        d = str.charCodeAt(i++) & 1023;
        C = C >>> 8 ^ T[(C ^ (240 | c >> 8 & 7)) & 0xFF];
        C = C >>> 8 ^ T[(C ^ (128 | c >> 2 & 63)) & 0xFF];
        C = C >>> 8 ^ T[(C ^ (128 | d >> 6 & 15 | (c & 3) << 4)) & 0xFF];
        C = C >>> 8 ^ T[(C ^ (128 | d & 63)) & 0xFF];
      } else {
        C = C >>> 8 ^ T[(C ^ (224 | c >> 12 & 15)) & 0xFF];
        C = C >>> 8 ^ T[(C ^ (128 | c >> 6 & 63)) & 0xFF];
        C = C >>> 8 ^ T[(C ^ (128 | c & 63)) & 0xFF];
      }
    }
    return C ^ -1;
  }
  CRC32.table = T;
  // $FlowIgnore
  CRC32.bstr = crc32_bstr;
  // $FlowIgnore
  CRC32.buf = crc32_buf;
  // $FlowIgnore
  CRC32.str = crc32_str;
});

/***/ },

/***/ 3656
/*!**************************************!*\
  !*** ./node_modules/hexer/render.js ***!
  \**************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var color = (__webpack_require__(/*! ansi-color */ 1852)/* .set */ .h);
function pad(c, s, width) {
  while (s.length < width) s = c + s;
  return s;
}
function byte2hex(b) {
  return pad('0', b.toString(16), 2);
}
function byte2char(c) {
  if (c > 0x1f && c < 0x7f) {
    return String.fromCharCode(c);
  } else {
    return '.';
  }
  // TODO: could provide perhaps some unicode renderings for certain control chars
}
function renderColoredHuman(c) {
  if (c > 0x1f && c < 0x7f) {
    return String.fromCharCode(c);
  } else {
    return color('.', 'black+bold');
  }
}

// istanbul ignore next
function stripColor(str) {
  while (true) {
    var i = str.indexOf('\x1b[');
    if (i < 0) return str;
    var j = str.indexOf('m', i);
    if (j < 0) return str;
    str = str.slice(0, i) + str.slice(j + 1);
  }
}
module.exports.coloredHeadSep = color(':', 'cyan') + ' ';
module.exports.coloredOptions = {
  headSep: module.exports.coloredHeadSep,
  renderHuman: renderColoredHuman
};
module.exports.pad = pad;
module.exports.byte2hex = byte2hex;
module.exports.byte2char = byte2char;
module.exports.renderHuman = renderColoredHuman;
module.exports.stripColor = stripColor;

/***/ },

/***/ 3688
/*!*****************************************************!*\
  !*** ../app/node_modules/side-channel-map/index.js ***!
  \*****************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ 6852);
var callBound = __webpack_require__(/*! call-bound */ 4731);
var inspect = __webpack_require__(/*! object-inspect */ 3808);
var $TypeError = __webpack_require__(/*! es-errors/type */ 9176);
var $Map = GetIntrinsic('%Map%', true);

/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
var $mapGet = callBound('Map.prototype.get', true);
/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
var $mapSet = callBound('Map.prototype.set', true);
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
var $mapHas = callBound('Map.prototype.has', true);
/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
var $mapDelete = callBound('Map.prototype.delete', true);
/** @type {<K, V>(thisArg: Map<K, V>) => number} */
var $mapSize = callBound('Map.prototype.size', true);

/** @type {import('.')} */
module.exports = !!$Map && /** @type {Exclude<import('.'), false>} */function getSideChannelMap() {
  /** @typedef {ReturnType<typeof getSideChannelMap>} Channel */
  /** @typedef {Parameters<Channel['get']>[0]} K */
  /** @typedef {Parameters<Channel['set']>[1]} V */

  /** @type {Map<K, V> | undefined} */var $m;

  /** @type {Channel} */
  var channel = {
    assert: function (key) {
      if (!channel.has(key)) {
        throw new $TypeError('Side channel does not contain ' + inspect(key));
      }
    },
    'delete': function (key) {
      if ($m) {
        var result = $mapDelete($m, key);
        if ($mapSize($m) === 0) {
          $m = void undefined;
        }
        return result;
      }
      return false;
    },
    get: function (key) {
      // eslint-disable-line consistent-return
      if ($m) {
        return $mapGet($m, key);
      }
    },
    has: function (key) {
      if ($m) {
        return $mapHas($m, key);
      }
      return false;
    },
    set: function (key, value) {
      if (!$m) {
        // @ts-expect-error TS can't handle narrowing a variable inside a closure
        $m = new $Map();
      }
      $mapSet($m, key, value);
    }
  };

  // @ts-expect-error TODO: figure out why TS is erroring here
  return channel;
};

/***/ },

/***/ 3700
/*!*********************************!*\
  !*** external "tabby-settings" ***!
  \*********************************/
(module) {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__3700__;

/***/ },

/***/ 3769
/*!***********************************************!*\
  !*** ./node_modules/zmodem.js/src/zsentry.js ***!
  \***********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var Zmodem = module.exports;
Object.assign(Zmodem, __webpack_require__(/*! ./zmlib */ 3568), __webpack_require__(/*! ./zsession */ 2624));
const MIN_ZM_HEX_START_LENGTH = 20,
  MAX_ZM_HEX_START_LENGTH = 21,
  // **, ZDLE, 'B0'
  //ZRQINIT’s next byte will be '0'; ZRINIT’s will be '1'.
  COMMON_ZM_HEX_START = [42, 42, 24, 66, 48],
  SENTRY_CONSTRUCTOR_REQUIRED_ARGS = ["to_terminal", "on_detect", "on_retract", "sender"],
  ASTERISK = 42;

/**
 * An instance of this object is passed to the Sentry’s on_detect
 * callback each time the Sentry object sees what looks like the
 * start of a ZMODEM session.
 *
 * Note that it is possible for a detection to be “retracted”
 * if the Sentry consumes bytes afterward that are not ZMODEM.
 * When this happens, the Sentry’s `retract` event will fire,
 * after which the Detection object is no longer usable.
 */
class Detection {
  /**
   * Not called directly.
   */
  constructor(session_type, accepter, denier, checker) {
    //confirm() - user confirms that ZMODEM is desired
    this._confirmer = accepter;

    //deny() - user declines ZMODEM; send abort sequence
    //
    //TODO: It might be ideal to forgo the session “peaceably”,
    //i.e., such that the peer doesn’t end in error. That’s
    //possible if we’re the sender, we accept the session,
    //then we just send a close(), but it doesn’t seem to be
    //possible for a receiver. Thus, let’s just leave it so
    //it’s at least consistent (and simpler, too).
    this._denier = denier;
    this._is_valid = checker;
    this._session_type = session_type;
  }

  /**
   * Confirm that the detected ZMODEM sequence indicates the
   * start of a ZMODEM session.
   *
   * @return {Session} The ZMODEM Session object (i.e., either a
   *  Send or Receive instance).
   */
  confirm() {
    return this._confirmer.apply(this, arguments);
  }

  /**
   * Tell the Sentry that the detected bytes sequence is
   * **NOT** intended to be the start of a ZMODEM session.
   */
  deny() {
    return this._denier.apply(this, arguments);
  }

  /**
   * Tells whether the Detection is still valid; i.e., whether
   * the Sentry has `consume()`d bytes that invalidate the
   * Detection.
   *
   * @returns {boolean} Whether the Detection is valid.
   */
  is_valid() {
    return this._is_valid.apply(this, arguments);
  }

  /**
   * Gives the session’s role.
   *
   * @returns {string} One of:
   * - `receive`
   * - `send`
   */
  get_session_role() {
    return this._session_type;
  }
}

/**
 * Class that parses an input stream for the beginning of a
 * ZMODEM session. We look for the tell-tale signs
 * of a ZMODEM transfer and allow the client to determine whether
 * it’s really ZMODEM or not.
 *
 * This is the “mother” class for zmodem.js;
 * all other class instances are created, directly or indirectly,
 * by an instance of this class.
 *
 * This logic is not unlikely to need tweaking, and it can never
 * be fully bulletproof; if it could be bulletproof it would be
 * simpler since there wouldn’t need to be the .confirm()/.deny()
 * step.
 *
 * One thing you could do to make things a bit simpler *is* just
 * to make that assumption for your users--i.e., to .confirm()
 * Detection objects automatically. That’ll be one less step
 * for the user, but an unaccustomed user might find that a bit
 * confusing. It’s also then possible to have a “false positive”:
 * a text stream that contains a ZMODEM initialization string but
 * isn’t, in fact, meant to start a ZMODEM session.
 *
 * Workflow:
 *  - parse all input with .consume(). As long as nothing looks
 *      like ZMODEM, all the traffic will go to to_terminal().
 *
 *  - when a “tell-tale” sequence of bytes arrives, we create a
 *      Detection object and pass it to the “on_detect” handler.
 *
 *  - Either .confirm() or .deny() with the Detection object.
 *      This is the user’s chance to say, “yeah, I know those
 *      bytes look like ZMODEM, but they’re not. So back off!”
 *
 *      If you .confirm(), the Session object is returned, and
 *      further input that goes to the Sentry’s .consume() will
 *      go to the (now-active) Session object.
 *
 *  - Sometimes additional traffic arrives that makes it apparent
 *      that no ZMODEM session is intended to start; in this case,
 *      the Sentry marks the Detection as “stale” and calls the
 *      `on_retract` handler. Any attempt from here to .confirm()
 *      on the Detection object will prompt an exception.
 *
 *      (This “retraction” behavior will only happen prior to
 *      .confirm() or .deny() being called on the Detection object.
 *      Beyond that point, either the Session has to deal with the
 *      “garbage”, or it’s back to the terminal anyway.
 *
 *  - Once the Session object is done, the Sentry will again send
 *      all traffic to to_terminal().
 */
Zmodem.Sentry = class ZmodemSentry {
  /**
   * Invoked directly. Creates a new Sentry that inspects all
   * traffic before it goes to the terminal.
   *
   * @param {Object} options - The Sentry parameters
   *
   * @param {Function} options.to_terminal - Handler that sends
   * traffic to the terminal object. Receives an iterable object
   * (e.g., an Array) that contains octet numbers.
   *
   * @param {Function} options.on_detect - Handler for new
   * detection events. Receives a new Detection object.
   *
   * @param {Function} options.on_retract - Handler for retraction
   * events. Receives no input.
   *
   * @param {Function} options.sender - Handler that sends traffic to
   * the peer. If, for example, your application uses WebSocket to talk
   * to the peer, use this to send data to the WebSocket instance.
   */
  constructor(options) {
    if (!options) throw "Need options!";
    var sentry = this;
    SENTRY_CONSTRUCTOR_REQUIRED_ARGS.forEach(function (arg) {
      if (!options[arg]) {
        throw "Need “" + arg + "”!";
      }
      sentry["_" + arg] = options[arg];
    });
    this._cache = [];
  }
  _after_session_end() {
    this._zsession = null;
  }

  /**
   * “Consumes” a piece of input:
   *
   *  - If there is no active or pending ZMODEM session, the text is
   *      all output. (This is regardless of whether we’ve got a new
   *      Detection.)
   *
   *  - If there is no active ZMODEM session and the input **ends** with
   *      a ZRINIT or ZRQINIT, then a new Detection object is created,
   *      and it is passed to the “on_detect” function.
   *      If there was another pending Detection object, it is retracted.
   *
   *  - If there is no active ZMODEM session and the input does NOT end
   *      with a ZRINIT or ZRQINIT, then any pending Detection object is
   *      retracted.
   *
   *  - If there is an active ZMODEM session, the input is passed to it.
   *      Any non-ZMODEM data (i.e., “garbage”) parsed from the input
   *      is sent to output.
   *      If the ZMODEM session ends, any post-ZMODEM part of the input
   *      is sent to output.
   *
   *  @param {number[] | ArrayBuffer} input - Octets to parse as input.
   */
  consume(input) {
    if (!(input instanceof Array)) {
      input = Array.prototype.slice.call(new Uint8Array(input));
    }
    if (this._zsession) {
      var session_before_consume = this._zsession;
      session_before_consume.consume(input);
      if (session_before_consume.has_ended()) {
        if (session_before_consume.type === "receive") {
          input = session_before_consume.get_trailing_bytes();
        } else {
          input = [];
        }
      } else return;
    }
    var new_session = this._parse(input);
    var to_terminal = input;
    if (new_session) {
      let replacement_detect = !!this._parsed_session;
      if (replacement_detect) {
        //no terminal output if the new session is of the
        //same type as the old
        if (this._parsed_session.type === new_session.type) {
          to_terminal = [];
        }
        this._on_retract();
      }
      this._parsed_session = new_session;
      var sentry = this;
      function checker() {
        return sentry._parsed_session === new_session;
      }

      //This runs with the Sentry object as the context.
      function accepter() {
        if (!this.is_valid()) {
          throw "Stale ZMODEM session!";
        }
        new_session.on("garbage", sentry._to_terminal);
        new_session.on("session_end", sentry._after_session_end.bind(sentry));
        new_session.set_sender(sentry._sender);
        delete sentry._parsed_session;
        return sentry._zsession = new_session;
      }
      ;
      function denier() {
        if (!this.is_valid()) return;
      }
      ;
      this._on_detect(new Detection(new_session.type, accepter, this._send_abort.bind(this), checker));
    } else {
      /*
      if (this._parsed_session) {
          this._session_stale_because = 'Non-ZMODEM output received after ZMODEM initialization.';
      }
      */

      var expired_session = this._parsed_session;
      this._parsed_session = null;
      if (expired_session) {
        //If we got a single “C” after parsing a session,
        //that means our peer is trying to downgrade to YMODEM.
        //That won’t work, so we just send the ABORT_SEQUENCE
        //right away.
        if (to_terminal.length === 1 && to_terminal[0] === 67) {
          this._send_abort();
        }
        this._on_retract();
      }
    }
    this._to_terminal(to_terminal);
  }

  /**
   * @return {Session|null} The sentry’s current Session object, or
   *      null if there is none.
   */
  get_confirmed_session() {
    return this._zsession || null;
  }
  _send_abort() {
    this._sender(Zmodem.ZMLIB.ABORT_SEQUENCE);
  }

  /**
   * Parse an input stream and decide how much of it goes to the
   * terminal or to a new Session object.
   *
   * This will accommodate input strings that are fragmented
   * across calls to this function; e.g., if you send the first
   * two bytes at the end of one parse() call then send the rest
   * at the beginning of the next, parse() will recognize it as
   * the beginning of a ZMODEM session.
   *
   * In order to keep from blocking any actual useful data to the
   * terminal in real-time, this will send on the initial
   * ZRINIT/ZRQINIT bytes to the terminal. They’re meant to go to the
   * terminal anyway, so that should be fine.
   *
   * @private
   *
   * @param {Array|Uint8Array} array_like - The input bytes.
   *      Each member should be a number between 0 and 255 (inclusive).
   *
   * @return {Array} A two-member list:
   *      0) the bytes that should be printed on the terminal
   *      1) the created Session object (if any)
   */
  _parse(array_like) {
    var cache = this._cache;
    cache.push.apply(cache, array_like);
    while (true) {
      let common_hex_at = Zmodem.ZMLIB.find_subarray(cache, COMMON_ZM_HEX_START);
      if (-1 === common_hex_at) break;
      let before_common_hex = cache.splice(0, common_hex_at);
      let zsession;
      try {
        zsession = Zmodem.Session.parse(cache);
      } catch (err) {//ignore errors
        //console.log(err);
      }
      if (!zsession) break;

      //Don’t need to parse the trailing XON.
      if (cache.length === 1 && cache[0] === Zmodem.ZMLIB.XON) {
        cache.shift();
      }

      //If there are still bytes in the cache,
      //then we don’t have a ZMODEM session. This logic depends
      //on the sender only sending one initial header.
      return cache.length ? null : zsession;
    }
    cache.splice(MAX_ZM_HEX_START_LENGTH);
    return null;
  }
};

/***/ },

/***/ 3773
/*!********************************************!*\
  !*** ./node_modules/zmodem.js/src/text.js ***!
  \********************************************/
(module) {

class _my_TextEncoder {
  encode(text) {
    text = unescape(encodeURIComponent(text));
    var bytes = new Array(text.length);
    for (var b = 0; b < text.length; b++) {
      bytes[b] = text.charCodeAt(b);
    }
    return new Uint8Array(bytes);
  }
}
class _my_TextDecoder {
  decode(bytes) {
    return decodeURIComponent(escape(String.fromCharCode.apply(String, bytes)));
  }
}
var Zmodem = module.exports;

/**
 * A limited-use compatibility shim for TextEncoder and TextDecoder.
 * Useful because both Edge and node.js still lack support for these
 * as of October 2017.
 *
 * @exports Text
 */
Zmodem.Text = {
  Encoder: typeof TextEncoder !== "undefined" ? TextEncoder : _my_TextEncoder,
  Decoder: typeof TextDecoder !== "undefined" ? TextDecoder : _my_TextDecoder
};

/***/ },

/***/ 3805
/*!**********************************************************************!*\
  !*** ./src/components/loginScriptsSettings.component.pug?ngResource ***!
  \**********************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/loginScriptsSettings.component.pug?ngResource */ 5516);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 3808
/*!***************************************************!*\
  !*** ../app/node_modules/object-inspect/index.js ***!
  \***************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var hasMap = typeof Map === 'function' && Map.prototype;
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
var mapForEach = hasMap && Map.prototype.forEach;
var hasSet = typeof Set === 'function' && Set.prototype;
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
var setForEach = hasSet && Set.prototype.forEach;
var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
var booleanValueOf = Boolean.prototype.valueOf;
var objectToString = Object.prototype.toString;
var functionToString = Function.prototype.toString;
var $match = String.prototype.match;
var $slice = String.prototype.slice;
var $replace = String.prototype.replace;
var $toUpperCase = String.prototype.toUpperCase;
var $toLowerCase = String.prototype.toLowerCase;
var $test = RegExp.prototype.test;
var $concat = Array.prototype.concat;
var $join = Array.prototype.join;
var $arrSlice = Array.prototype.slice;
var $floor = Math.floor;
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
var gOPS = Object.getOwnPropertySymbols;
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
// ie, `has-tostringtag/shams
var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') ? Symbol.toStringTag : null;
var isEnumerable = Object.prototype.propertyIsEnumerable;
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype // eslint-disable-line no-proto
? function (O) {
  return O.__proto__; // eslint-disable-line no-proto
} : null);
function addNumericSeparator(num, str) {
  if (num === Infinity || num === -Infinity || num !== num || num && num > -1000 && num < 1000 || $test.call(/e/, str)) {
    return str;
  }
  var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
  if (typeof num === 'number') {
    var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
    if (int !== num) {
      var intStr = String(int);
      var dec = $slice.call(str, intStr.length + 1);
      return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
    }
  }
  return $replace.call(str, sepRegex, '$&_');
}
var utilInspect = __webpack_require__(/*! ./util.inspect */ 9004);
var inspectCustom = utilInspect.custom;
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
var quotes = {
  __proto__: null,
  'double': '"',
  single: "'"
};
var quoteREs = {
  __proto__: null,
  'double': /(["\\])/g,
  single: /(['\\])/g
};
module.exports = function inspect_(obj, options, depth, seen) {
  var opts = options || {};
  if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {
    throw new TypeError('option "quoteStyle" must be "single" or "double"');
  }
  if (has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) {
    throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
  }
  var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
  if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
    throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
  }
  if (has(opts, 'indent') && opts.indent !== null && opts.indent !== '\t' && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) {
    throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
  }
  if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
    throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
  }
  var numericSeparator = opts.numericSeparator;
  if (typeof obj === 'undefined') {
    return 'undefined';
  }
  if (obj === null) {
    return 'null';
  }
  if (typeof obj === 'boolean') {
    return obj ? 'true' : 'false';
  }
  if (typeof obj === 'string') {
    return inspectString(obj, opts);
  }
  if (typeof obj === 'number') {
    if (obj === 0) {
      return Infinity / obj > 0 ? '0' : '-0';
    }
    var str = String(obj);
    return numericSeparator ? addNumericSeparator(obj, str) : str;
  }
  if (typeof obj === 'bigint') {
    var bigIntStr = String(obj) + 'n';
    return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
  }
  var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
  if (typeof depth === 'undefined') {
    depth = 0;
  }
  if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
    return isArray(obj) ? '[Array]' : '[Object]';
  }
  var indent = getIndent(opts, depth);
  if (typeof seen === 'undefined') {
    seen = [];
  } else if (indexOf(seen, obj) >= 0) {
    return '[Circular]';
  }
  function inspect(value, from, noIndent) {
    if (from) {
      seen = $arrSlice.call(seen);
      seen.push(from);
    }
    if (noIndent) {
      var newOpts = {
        depth: opts.depth
      };
      if (has(opts, 'quoteStyle')) {
        newOpts.quoteStyle = opts.quoteStyle;
      }
      return inspect_(value, newOpts, depth + 1, seen);
    }
    return inspect_(value, opts, depth + 1, seen);
  }
  if (typeof obj === 'function' && !isRegExp(obj)) {
    // in older engines, regexes are callable
    var name = nameOf(obj);
    var keys = arrObjKeys(obj, inspect);
    return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
  }
  if (isSymbol(obj)) {
    var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
    return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
  }
  if (isElement(obj)) {
    var s = '<' + $toLowerCase.call(String(obj.nodeName));
    var attrs = obj.attributes || [];
    for (var i = 0; i < attrs.length; i++) {
      s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
    }
    s += '>';
    if (obj.childNodes && obj.childNodes.length) {
      s += '...';
    }
    s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
    return s;
  }
  if (isArray(obj)) {
    if (obj.length === 0) {
      return '[]';
    }
    var xs = arrObjKeys(obj, inspect);
    if (indent && !singleLineValues(xs)) {
      return '[' + indentedJoin(xs, indent) + ']';
    }
    return '[ ' + $join.call(xs, ', ') + ' ]';
  }
  if (isError(obj)) {
    var parts = arrObjKeys(obj, inspect);
    if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
      return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
    }
    if (parts.length === 0) {
      return '[' + String(obj) + ']';
    }
    return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
  }
  if (typeof obj === 'object' && customInspect) {
    if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
      return utilInspect(obj, {
        depth: maxDepth - depth
      });
    } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
      return obj.inspect();
    }
  }
  if (isMap(obj)) {
    var mapParts = [];
    if (mapForEach) {
      mapForEach.call(obj, function (value, key) {
        mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
      });
    }
    return collectionOf('Map', mapSize.call(obj), mapParts, indent);
  }
  if (isSet(obj)) {
    var setParts = [];
    if (setForEach) {
      setForEach.call(obj, function (value) {
        setParts.push(inspect(value, obj));
      });
    }
    return collectionOf('Set', setSize.call(obj), setParts, indent);
  }
  if (isWeakMap(obj)) {
    return weakCollectionOf('WeakMap');
  }
  if (isWeakSet(obj)) {
    return weakCollectionOf('WeakSet');
  }
  if (isWeakRef(obj)) {
    return weakCollectionOf('WeakRef');
  }
  if (isNumber(obj)) {
    return markBoxed(inspect(Number(obj)));
  }
  if (isBigInt(obj)) {
    return markBoxed(inspect(bigIntValueOf.call(obj)));
  }
  if (isBoolean(obj)) {
    return markBoxed(booleanValueOf.call(obj));
  }
  if (isString(obj)) {
    return markBoxed(inspect(String(obj)));
  }
  // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
  /* eslint-env browser */
  if (typeof window !== 'undefined' && obj === window) {
    return '{ [object Window] }';
  }
  if (typeof globalThis !== 'undefined' && obj === globalThis || typeof global !== 'undefined' && obj === global) {
    return '{ [object globalThis] }';
  }
  if (!isDate(obj) && !isRegExp(obj)) {
    var ys = arrObjKeys(obj, inspect);
    var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
    var protoTag = obj instanceof Object ? '' : 'null prototype';
    var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
    var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
    var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
    if (ys.length === 0) {
      return tag + '{}';
    }
    if (indent) {
      return tag + '{' + indentedJoin(ys, indent) + '}';
    }
    return tag + '{ ' + $join.call(ys, ', ') + ' }';
  }
  return String(obj);
};
function wrapQuotes(s, defaultStyle, opts) {
  var style = opts.quoteStyle || defaultStyle;
  var quoteChar = quotes[style];
  return quoteChar + s + quoteChar;
}
function quote(s) {
  return $replace.call(String(s), /"/g, '&quot;');
}
function canTrustToString(obj) {
  return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));
}
function isArray(obj) {
  return toStr(obj) === '[object Array]' && canTrustToString(obj);
}
function isDate(obj) {
  return toStr(obj) === '[object Date]' && canTrustToString(obj);
}
function isRegExp(obj) {
  return toStr(obj) === '[object RegExp]' && canTrustToString(obj);
}
function isError(obj) {
  return toStr(obj) === '[object Error]' && canTrustToString(obj);
}
function isString(obj) {
  return toStr(obj) === '[object String]' && canTrustToString(obj);
}
function isNumber(obj) {
  return toStr(obj) === '[object Number]' && canTrustToString(obj);
}
function isBoolean(obj) {
  return toStr(obj) === '[object Boolean]' && canTrustToString(obj);
}

// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
function isSymbol(obj) {
  if (hasShammedSymbols) {
    return obj && typeof obj === 'object' && obj instanceof Symbol;
  }
  if (typeof obj === 'symbol') {
    return true;
  }
  if (!obj || typeof obj !== 'object' || !symToString) {
    return false;
  }
  try {
    symToString.call(obj);
    return true;
  } catch (e) {}
  return false;
}
function isBigInt(obj) {
  if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
    return false;
  }
  try {
    bigIntValueOf.call(obj);
    return true;
  } catch (e) {}
  return false;
}
var hasOwn = Object.prototype.hasOwnProperty || function (key) {
  return key in this;
};
function has(obj, key) {
  return hasOwn.call(obj, key);
}
function toStr(obj) {
  return objectToString.call(obj);
}
function nameOf(f) {
  if (f.name) {
    return f.name;
  }
  var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
  if (m) {
    return m[1];
  }
  return null;
}
function indexOf(xs, x) {
  if (xs.indexOf) {
    return xs.indexOf(x);
  }
  for (var i = 0, l = xs.length; i < l; i++) {
    if (xs[i] === x) {
      return i;
    }
  }
  return -1;
}
function isMap(x) {
  if (!mapSize || !x || typeof x !== 'object') {
    return false;
  }
  try {
    mapSize.call(x);
    try {
      setSize.call(x);
    } catch (s) {
      return true;
    }
    return x instanceof Map; // core-js workaround, pre-v2.5.0
  } catch (e) {}
  return false;
}
function isWeakMap(x) {
  if (!weakMapHas || !x || typeof x !== 'object') {
    return false;
  }
  try {
    weakMapHas.call(x, weakMapHas);
    try {
      weakSetHas.call(x, weakSetHas);
    } catch (s) {
      return true;
    }
    return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
  } catch (e) {}
  return false;
}
function isWeakRef(x) {
  if (!weakRefDeref || !x || typeof x !== 'object') {
    return false;
  }
  try {
    weakRefDeref.call(x);
    return true;
  } catch (e) {}
  return false;
}
function isSet(x) {
  if (!setSize || !x || typeof x !== 'object') {
    return false;
  }
  try {
    setSize.call(x);
    try {
      mapSize.call(x);
    } catch (m) {
      return true;
    }
    return x instanceof Set; // core-js workaround, pre-v2.5.0
  } catch (e) {}
  return false;
}
function isWeakSet(x) {
  if (!weakSetHas || !x || typeof x !== 'object') {
    return false;
  }
  try {
    weakSetHas.call(x, weakSetHas);
    try {
      weakMapHas.call(x, weakMapHas);
    } catch (s) {
      return true;
    }
    return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
  } catch (e) {}
  return false;
}
function isElement(x) {
  if (!x || typeof x !== 'object') {
    return false;
  }
  if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
    return true;
  }
  return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
}
function inspectString(str, opts) {
  if (str.length > opts.maxStringLength) {
    var remaining = str.length - opts.maxStringLength;
    var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
    return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
  }
  var quoteRE = quoteREs[opts.quoteStyle || 'single'];
  quoteRE.lastIndex = 0;
  // eslint-disable-next-line no-control-regex
  var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte);
  return wrapQuotes(s, 'single', opts);
}
function lowbyte(c) {
  var n = c.charCodeAt(0);
  var x = {
    8: 'b',
    9: 't',
    10: 'n',
    12: 'f',
    13: 'r'
  }[n];
  if (x) {
    return '\\' + x;
  }
  return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
}
function markBoxed(str) {
  return 'Object(' + str + ')';
}
function weakCollectionOf(type) {
  return type + ' { ? }';
}
function collectionOf(type, size, entries, indent) {
  var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
  return type + ' (' + size + ') {' + joinedEntries + '}';
}
function singleLineValues(xs) {
  for (var i = 0; i < xs.length; i++) {
    if (indexOf(xs[i], '\n') >= 0) {
      return false;
    }
  }
  return true;
}
function getIndent(opts, depth) {
  var baseIndent;
  if (opts.indent === '\t') {
    baseIndent = '\t';
  } else if (typeof opts.indent === 'number' && opts.indent > 0) {
    baseIndent = $join.call(Array(opts.indent + 1), ' ');
  } else {
    return null;
  }
  return {
    base: baseIndent,
    prev: $join.call(Array(depth + 1), baseIndent)
  };
}
function indentedJoin(xs, indent) {
  if (xs.length === 0) {
    return '';
  }
  var lineJoiner = '\n' + indent.prev + indent.base;
  return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
}
function arrObjKeys(obj, inspect) {
  var isArr = isArray(obj);
  var xs = [];
  if (isArr) {
    xs.length = obj.length;
    for (var i = 0; i < obj.length; i++) {
      xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
    }
  }
  var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
  var symMap;
  if (hasShammedSymbols) {
    symMap = {};
    for (var k = 0; k < syms.length; k++) {
      symMap['$' + syms[k]] = syms[k];
    }
  }
  for (var key in obj) {
    // eslint-disable-line no-restricted-syntax
    if (!has(obj, key)) {
      continue;
    } // eslint-disable-line no-restricted-syntax, no-continue
    if (isArr && String(Number(key)) === key && key < obj.length) {
      continue;
    } // eslint-disable-line no-restricted-syntax, no-continue
    if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
      // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
      continue; // eslint-disable-line no-restricted-syntax, no-continue
    } else if ($test.call(/[^\w$]/, key)) {
      xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
    } else {
      xs.push(key + ': ' + inspect(obj[key], obj));
    }
  }
  if (typeof gOPS === 'function') {
    for (var j = 0; j < syms.length; j++) {
      if (isEnumerable.call(obj, syms[j])) {
        xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
      }
    }
  }
  return xs;
}

/***/ },

/***/ 3894
/*!*****************************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/inputProcessingSettings.component.pug?ngResource ***!
  \*****************************************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cdiv class=\"form-line\"\u003E\n  \u003Cdiv class=\"header\"\u003E\n    \u003Cdiv class=\"title\" translate\u003EBackspace key mode\u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cselect class=\"form-control\" [(ngModel)]=\"options.backspace\"\u003E\n    \u003Coption *ngFor=\"let mode of backspaceModes\" [value]=\"mode.key\"\u003E{{mode.name|translate}}\u003C\u002Foption\u003E\n  \u003C\u002Fselect\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 3961
/*!***********************!*\
  !*** external "rxjs" ***!
  \***********************/
(module) {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__3961__;

/***/ },

/***/ 3990
/*!**********************************************!*\
  !*** ../app/node_modules/call-bind/index.js ***!
  \**********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var setFunctionLength = __webpack_require__(/*! set-function-length */ 4992);
var $defineProperty = __webpack_require__(/*! es-define-property */ 5832);
var callBindBasic = __webpack_require__(/*! call-bind-apply-helpers */ 5603);
var applyBind = __webpack_require__(/*! call-bind-apply-helpers/applyBind */ 5168);
module.exports = function callBind(originalFunction) {
  var func = callBindBasic(arguments);
  var adjustedLength = originalFunction.length - (arguments.length - 1);
  return setFunctionLength(func, 1 + (adjustedLength > 0 ? adjustedLength : 0), true);
};
if ($defineProperty) {
  $defineProperty(module.exports, 'apply', {
    value: applyBind
  });
} else {
  module.exports.apply = applyBind;
}

/***/ },

/***/ 4026
/*!**********************************************!*\
  !*** ../app/node_modules/is-bigint/index.js ***!
  \**********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var hasBigInts = __webpack_require__(/*! has-bigints */ 7567)();
if (hasBigInts) {
  var bigIntValueOf = BigInt.prototype.valueOf;
  /** @type {(value: object) => value is BigInt} */
  var tryBigInt = function tryBigIntObject(value) {
    try {
      bigIntValueOf.call(value);
      return true;
    } catch (e) {}
    return false;
  };

  /** @type {import('.')} */
  module.exports = function isBigInt(value) {
    if (value === null || typeof value === 'undefined' || typeof value === 'boolean' || typeof value === 'string' || typeof value === 'number' || typeof value === 'symbol' || typeof value === 'function') {
      return false;
    }
    if (typeof value === 'bigint') {
      return true;
    }
    return tryBigInt(value);
  };
} else {
  /** @type {import('.')} */
  module.exports = function isBigInt(value) {
    return  false && 0;
  };
}

/***/ },

/***/ 4031
/*!**********************************************!*\
  !*** ../app/node_modules/es-errors/range.js ***!
  \**********************************************/
(module) {

"use strict";


/** @type {import('./range')} */
module.exports = RangeError;

/***/ },

/***/ 4085
/*!**************************************************************************!*\
  !*** ./src/components/streamProcessingSettings.component.pug?ngResource ***!
  \**************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/streamProcessingSettings.component.pug?ngResource */ 6980);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 4139
/*!*************************************************!*\
  !*** ../app/node_modules/object.assign/shim.js ***!
  \*************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var define = __webpack_require__(/*! define-properties */ 2445);
var getPolyfill = __webpack_require__(/*! ./polyfill */ 8349);
module.exports = function shimAssign() {
  var polyfill = getPolyfill();
  define(Object, {
    assign: polyfill
  }, {
    assign: function () {
      return Object.assign !== polyfill;
    }
  });
  return polyfill;
};

/***/ },

/***/ 4234
/*!*********************!*\
  !*** external "os" ***!
  \*********************/
(module) {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__4234__;

/***/ },

/***/ 4281
/*!******************************************************!*\
  !*** ../app/node_modules/is-boolean-object/index.js ***!
  \******************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var callBound = __webpack_require__(/*! call-bound */ 4731);
var $boolToStr = callBound('Boolean.prototype.toString');
var $toString = callBound('Object.prototype.toString');

/** @type {import('.')} */
var tryBooleanObject = function booleanBrandCheck(value) {
  try {
    $boolToStr(value);
    return true;
  } catch (e) {
    return false;
  }
};
var boolClass = '[object Boolean]';
var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ 6565)();

/** @type {import('.')} */
module.exports = function isBoolean(value) {
  if (typeof value === 'boolean') {
    return true;
  }
  if (value === null || typeof value !== 'object') {
    return false;
  }
  return hasToStringTag ? tryBooleanObject(value) : $toString(value) === boolClass;
};

/***/ },

/***/ 4301
/*!*********************************************!*\
  !*** ../node_modules/object-is/polyfill.js ***!
  \*********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var implementation = __webpack_require__(/*! ./implementation */ 88);
module.exports = function getPolyfill() {
  return typeof Object.is === 'function' ? Object.is : implementation;
};

/***/ },

/***/ 4358
/*!**********************************!*\
  !*** external "@angular/common" ***!
  \**********************************/
(module) {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__4358__;

/***/ },

/***/ 4448
/*!****************************************!*\
  !*** ../app/node_modules/gopd/gOPD.js ***!
  \****************************************/
(module) {

"use strict";


/** @type {import('./gOPD')} */
module.exports = Object.getOwnPropertyDescriptor;

/***/ },

/***/ 4466
/*!*********************************************************!*\
  !*** ../app/node_modules/define-data-property/index.js ***!
  \*********************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var $defineProperty = __webpack_require__(/*! es-define-property */ 5832);
var $SyntaxError = __webpack_require__(/*! es-errors/syntax */ 6543);
var $TypeError = __webpack_require__(/*! es-errors/type */ 9176);
var gopd = __webpack_require__(/*! gopd */ 1284);

/** @type {import('.')} */
module.exports = function defineDataProperty(obj, property, value) {
  if (!obj || typeof obj !== 'object' && typeof obj !== 'function') {
    throw new $TypeError('`obj` must be an object or a function`');
  }
  if (typeof property !== 'string' && typeof property !== 'symbol') {
    throw new $TypeError('`property` must be a string or a symbol`');
  }
  if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
    throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
  }
  if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
    throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
  }
  if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
    throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
  }
  if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
    throw new $TypeError('`loose`, if provided, must be a boolean');
  }
  var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
  var nonWritable = arguments.length > 4 ? arguments[4] : null;
  var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
  var loose = arguments.length > 6 ? arguments[6] : false;

  /* @type {false | TypedPropertyDescriptor<unknown>} */
  var desc = !!gopd && gopd(obj, property);
  if ($defineProperty) {
    $defineProperty(obj, property, {
      configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
      enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
      value: value,
      writable: nonWritable === null && desc ? desc.writable : !nonWritable
    });
  } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) {
    // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
    obj[property] = value; // eslint-disable-line no-param-reassign
  } else {
    throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
  }
};

/***/ },

/***/ 4523
/*!***************************************************!*\
  !*** ../app/node_modules/is-date-object/index.js ***!
  \***************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var callBound = __webpack_require__(/*! call-bound */ 4731);
var getDay = callBound('Date.prototype.getDay');
/** @type {import('.')} */
var tryDateObject = function tryDateGetDayCall(value) {
  try {
    getDay(value);
    return true;
  } catch (e) {
    return false;
  }
};

/** @type {(value: unknown) => string} */
var toStr = callBound('Object.prototype.toString');
var dateClass = '[object Date]';
var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ 6565)();

/** @type {import('.')} */
module.exports = function isDateObject(value) {
  if (typeof value !== 'object' || value === null) {
    return false;
  }
  return hasToStringTag ? tryDateObject(value) : toStr(value) === dateClass;
};

/***/ },

/***/ 4623
/*!****************************************************************!*\
  !*** ../node_modules/style-loader/dist/runtime/styleDomAPI.js ***!
  \****************************************************************/
(module) {

"use strict";


/* istanbul ignore next  */
function apply(styleElement, options, obj) {
  var css = "";
  if (obj.supports) {
    css += "@supports (".concat(obj.supports, ") {");
  }
  if (obj.media) {
    css += "@media ".concat(obj.media, " {");
  }
  var needLayer = typeof obj.layer !== "undefined";
  if (needLayer) {
    css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
  }
  css += obj.css;
  if (needLayer) {
    css += "}";
  }
  if (obj.media) {
    css += "}";
  }
  if (obj.supports) {
    css += "}";
  }
  var sourceMap = obj.sourceMap;
  if (sourceMap && typeof btoa !== "undefined") {
    css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  }

  // For old IE
  /* istanbul ignore if  */
  options.styleTagTransform(css, styleElement, options.options);
}
function removeStyleElement(styleElement) {
  // istanbul ignore if
  if (styleElement.parentNode === null) {
    return false;
  }
  styleElement.parentNode.removeChild(styleElement);
}

/* istanbul ignore next  */
function domAPI(options) {
  if (typeof document === "undefined") {
    return {
      update: function update() {},
      remove: function remove() {}
    };
  }
  var styleElement = options.insertStyleElement(options);
  return {
    update: function update(obj) {
      apply(styleElement, options, obj);
    },
    remove: function remove() {
      removeStyleElement(styleElement);
    }
  };
}
module.exports = domAPI;

/***/ },

/***/ 4731
/*!***********************************************!*\
  !*** ../app/node_modules/call-bound/index.js ***!
  \***********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ 6852);
var callBindBasic = __webpack_require__(/*! call-bind-apply-helpers */ 5603);

/** @type {(thisArg: string, searchString: string, position?: number) => number} */
var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);

/** @type {import('.')} */
module.exports = function callBoundIntrinsic(name, allowMissing) {
  /* eslint no-extra-parens: 0 */

  var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */GetIntrinsic(name, !!allowMissing);
  if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
    return callBindBasic(/** @type {const} */[intrinsic]);
  }
  return intrinsic;
};

/***/ },

/***/ 4732
/*!*******************************************!*\
  !*** ../node_modules/clone-deep/index.js ***!
  \*******************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


/**
 * Module dependenices
 */
const clone = __webpack_require__(/*! shallow-clone */ 4978);
const typeOf = __webpack_require__(/*! kind-of */ 7866);
const isPlainObject = __webpack_require__(/*! is-plain-object */ 2185);
function cloneDeep(val, instanceClone) {
  switch (typeOf(val)) {
    case 'object':
      return cloneObjectDeep(val, instanceClone);
    case 'array':
      return cloneArrayDeep(val, instanceClone);
    default:
      {
        return clone(val);
      }
  }
}
function cloneObjectDeep(val, instanceClone) {
  if (typeof instanceClone === 'function') {
    return instanceClone(val);
  }
  if (instanceClone || isPlainObject(val)) {
    const res = new val.constructor();
    for (let key in val) {
      res[key] = cloneDeep(val[key], instanceClone);
    }
    return res;
  }
  return val;
}
function cloneArrayDeep(val, instanceClone) {
  const res = new val.constructor(val.length);
  for (let i = 0; i < val.length; i++) {
    res[i] = cloneDeep(val[i], instanceClone);
  }
  return res;
}

/**
 * Expose `cloneDeep`
 */

module.exports = cloneDeep;

/***/ },

/***/ 4744
/*!************************************************!*\
  !*** ./node_modules/cli-spinner/spinners.json ***!
  \************************************************/
(module) {

"use strict";
module.exports = /*#__PURE__*/JSON.parse('["|/-\\\\","⠂-–—–-","◐◓◑◒","◴◷◶◵","◰◳◲◱","▖▘▝▗","■□▪▫","▌▀▐▄","▉▊▋▌▍▎▏▎▍▌▋▊▉","▁▃▄▅▆▇█▇▆▅▄▃","←↖↑↗→↘↓↙","┤┘┴└├┌┬┐","◢◣◤◥",".oO°Oo.",".oO@*",["🌍","🌎","🌏"],"◡◡ ⊙⊙ ◠◠","☱☲☴","⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏","⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓","⠄⠆⠇⠋⠙⠸⠰⠠⠰⠸⠙⠋⠇⠆","⠋⠙⠚⠒⠂⠂⠒⠲⠴⠦⠖⠒⠐⠐⠒⠓⠋","⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠴⠲⠒⠂⠂⠒⠚⠙⠉⠁","⠈⠉⠋⠓⠒⠐⠐⠒⠖⠦⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈","⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈","⢄⢂⢁⡁⡈⡐⡠","⢹⢺⢼⣸⣇⡧⡗⡏","⣾⣽⣻⢿⡿⣟⣯⣷","⠁⠂⠄⡀⢀⠠⠐⠈",["🌑","🌒","🌓","🌔","🌕","🌝","🌖","🌗","🌘","🌚"],["🕛","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚"]]');

/***/ },

/***/ 4749
/*!*******************************************!*\
  !*** ../app/node_modules/is-map/index.js ***!
  \*******************************************/
(module) {

"use strict";


/** @const */
var $Map = typeof Map === 'function' && Map.prototype ? Map : null;
var $Set = typeof Set === 'function' && Set.prototype ? Set : null;
var exported;
if (!$Map) {
  /** @type {import('.')} */
  // eslint-disable-next-line no-unused-vars
  exported = function isMap(x) {
    // `Map` is not present in this environment.
    return false;
  };
}
var $mapHas = $Map ? Map.prototype.has : null;
var $setHas = $Set ? Set.prototype.has : null;
if (!exported && !$mapHas) {
  /** @type {import('.')} */
  // eslint-disable-next-line no-unused-vars
  exported = function isMap(x) {
    // `Map` does not have a `has` method
    return false;
  };
}

/** @type {import('.')} */
module.exports = exported || function isMap(x) {
  if (!x || typeof x !== 'object') {
    return false;
  }
  try {
    $mapHas.call(x);
    if ($setHas) {
      try {
        $setHas.call(x);
      } catch (e) {
        return true;
      }
    }
    // @ts-expect-error TS can't figure out that $Map is always truthy here
    return x instanceof $Map; // core-js workaround, pre-v2.5.0
  } catch (e) {}
  return false;
};

/***/ },

/***/ 4848
/*!*************************************************!*\
  !*** ./node_modules/binstring/lib/binstring.js ***!
  \*************************************************/
(module) {

"use strict";


function bufferToBytes(data) {
  var rs = [];
  for (var i = 0; i < data.length; i++) {
    rs.push(data[i]);
  }
  return rs;
}
var binString = module.exports = function binString(data, options) {
  // Set default options
  options = options || {};
  if (Array.isArray(data)) {
    data = new Buffer(data);
  } else if (typeof data == 'number') {
    data = new Buffer(data.toString(16), 'hex');
  } else if (typeof data == 'string') {
    if (!options.in) {
      // Quack, quack! Duck-type the input
      if (data.slice(0, 2) == '0x') {
        data = new Buffer(data.slice(2), 'hex');
      } else {
        // Binary string
        data = new Buffer(data, 'binary');
      }
    } else {
      data = new Buffer(data, options.in);
    }
  }
  if (!options.out) options.out = 'buffer';

  // Convert
  switch (options.out) {
    case 'buffer':
      return data;
    case 'hex':
      return data.toString('hex');
    case 'binary':
      return data.toString('binary');
    case 'utf8':
      return data.toString('utf8');
    case 'base64':
      return data.toString('base64');
    case 'bytes':
      return bufferToBytes(data);
    default:
      throw new Error('Output format "' + options.out + '" not understood');
  }
};

/***/ },

/***/ 4900
/*!**************************************************!*\
  !*** ../app/node_modules/object.assign/index.js ***!
  \**************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var defineProperties = __webpack_require__(/*! define-properties */ 2445);
var callBind = __webpack_require__(/*! call-bind */ 3990);
var implementation = __webpack_require__(/*! ./implementation */ 6056);
var getPolyfill = __webpack_require__(/*! ./polyfill */ 8349);
var shim = __webpack_require__(/*! ./shim */ 4139);
var polyfill = callBind.apply(getPolyfill());
// eslint-disable-next-line no-unused-vars
var bound = function assign(target, source1) {
  return polyfill(Object, arguments);
};
defineProperties(bound, {
  getPolyfill: getPolyfill,
  implementation: implementation,
  shim: shim
});
module.exports = bound;

/***/ },

/***/ 4902
/*!***************************!*\
  !*** external "readline" ***!
  \***************************/
(module) {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__4902__;

/***/ },

/***/ 4978
/*!**********************************************!*\
  !*** ../node_modules/shallow-clone/index.js ***!
  \**********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/*!
 * shallow-clone <https://github.com/jonschlinkert/shallow-clone>
 *
 * Copyright (c) 2015-present, Jon Schlinkert.
 * Released under the MIT License.
 */



const valueOf = Symbol.prototype.valueOf;
const typeOf = __webpack_require__(/*! kind-of */ 7866);
function clone(val, deep) {
  switch (typeOf(val)) {
    case 'array':
      return val.slice();
    case 'object':
      return Object.assign({}, val);
    case 'date':
      return new val.constructor(Number(val));
    case 'map':
      return new Map(val);
    case 'set':
      return new Set(val);
    case 'buffer':
      return cloneBuffer(val);
    case 'symbol':
      return cloneSymbol(val);
    case 'arraybuffer':
      return cloneArrayBuffer(val);
    case 'float32array':
    case 'float64array':
    case 'int16array':
    case 'int32array':
    case 'int8array':
    case 'uint16array':
    case 'uint32array':
    case 'uint8clampedarray':
    case 'uint8array':
      return cloneTypedArray(val);
    case 'regexp':
      return cloneRegExp(val);
    case 'error':
      return Object.create(val);
    default:
      {
        return val;
      }
  }
}
function cloneRegExp(val) {
  const flags = val.flags !== void 0 ? val.flags : /\w+$/.exec(val) || void 0;
  const re = new val.constructor(val.source, flags);
  re.lastIndex = val.lastIndex;
  return re;
}
function cloneArrayBuffer(val) {
  const res = new val.constructor(val.byteLength);
  new Uint8Array(res).set(new Uint8Array(val));
  return res;
}
function cloneTypedArray(val, deep) {
  return new val.constructor(val.buffer, val.byteOffset, val.length);
}
function cloneBuffer(val) {
  const len = val.length;
  const buf = Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : Buffer.from(len);
  val.copy(buf);
  return buf;
}
function cloneSymbol(val) {
  return valueOf ? Object(valueOf.call(val)) : {};
}

/**
 * Expose `clone`
 */

module.exports = clone;

/***/ },

/***/ 4992
/*!********************************************************!*\
  !*** ../app/node_modules/set-function-length/index.js ***!
  \********************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ 6852);
var define = __webpack_require__(/*! define-data-property */ 4466);
var hasDescriptors = __webpack_require__(/*! has-property-descriptors */ 947)();
var gOPD = __webpack_require__(/*! gopd */ 1284);
var $TypeError = __webpack_require__(/*! es-errors/type */ 9176);
var $floor = GetIntrinsic('%Math.floor%');

/** @type {import('.')} */
module.exports = function setFunctionLength(fn, length) {
  if (typeof fn !== 'function') {
    throw new $TypeError('`fn` is not a function');
  }
  if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
    throw new $TypeError('`length` must be a positive 32-bit integer');
  }
  var loose = arguments.length > 2 && !!arguments[2];
  var functionLengthIsConfigurable = true;
  var functionLengthIsWritable = true;
  if ('length' in fn && gOPD) {
    var desc = gOPD(fn, 'length');
    if (desc && !desc.configurable) {
      functionLengthIsConfigurable = false;
    }
    if (desc && !desc.writable) {
      functionLengthIsWritable = false;
    }
  }
  if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
    if (hasDescriptors) {
      define(/** @type {Parameters<define>[0]} */fn, 'length', length, true, true);
    } else {
      define(/** @type {Parameters<define>[0]} */fn, 'length', length);
    }
  }
  return fn;
};

/***/ },

/***/ 5141
/*!************************************************!*\
  !*** ../app/node_modules/is-callable/index.js ***!
  \************************************************/
(module) {

"use strict";


var fnToStr = Function.prototype.toString;
var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
var badArrayLike;
var isCallableMarker;
if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
  try {
    badArrayLike = Object.defineProperty({}, 'length', {
      get: function () {
        throw isCallableMarker;
      }
    });
    isCallableMarker = {};
    // eslint-disable-next-line no-throw-literal
    reflectApply(function () {
      throw 42;
    }, null, badArrayLike);
  } catch (_) {
    if (_ !== isCallableMarker) {
      reflectApply = null;
    }
  }
} else {
  reflectApply = null;
}
var constructorRegex = /^\s*class\b/;
var isES6ClassFn = function isES6ClassFunction(value) {
  try {
    var fnStr = fnToStr.call(value);
    return constructorRegex.test(fnStr);
  } catch (e) {
    return false; // not a function
  }
};
var tryFunctionObject = function tryFunctionToStr(value) {
  try {
    if (isES6ClassFn(value)) {
      return false;
    }
    fnToStr.call(value);
    return true;
  } catch (e) {
    return false;
  }
};
var toStr = Object.prototype.toString;
var objectClass = '[object Object]';
var fnClass = '[object Function]';
var genClass = '[object GeneratorFunction]';
var ddaClass = '[object HTMLAllCollection]'; // IE 11
var ddaClass2 = '[object HTML document.all class]';
var ddaClass3 = '[object HTMLCollection]'; // IE 9-10
var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`

var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing

var isDDA = function isDocumentDotAll() {
  return false;
};
if (typeof document === 'object') {
  // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly
  var all = document.all;
  if (toStr.call(all) === toStr.call(document.all)) {
    isDDA = function isDocumentDotAll(value) {
      /* globals document: false */
      // in IE 6-8, typeof document.all is "object" and it's truthy
      if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {
        try {
          var str = toStr.call(value);
          return (str === ddaClass || str === ddaClass2 || str === ddaClass3 // opera 12.16
          || str === objectClass // IE 6-8
          ) && value('') == null; // eslint-disable-line eqeqeq
        } catch (e) {/**/}
      }
      return false;
    };
  }
}
module.exports = reflectApply ? function isCallable(value) {
  if (isDDA(value)) {
    return true;
  }
  if (!value) {
    return false;
  }
  if (typeof value !== 'function' && typeof value !== 'object') {
    return false;
  }
  try {
    reflectApply(value, null, badArrayLike);
  } catch (e) {
    if (e !== isCallableMarker) {
      return false;
    }
  }
  return !isES6ClassFn(value) && tryFunctionObject(value);
} : function isCallable(value) {
  if (isDDA(value)) {
    return true;
  }
  if (!value) {
    return false;
  }
  if (typeof value !== 'function' && typeof value !== 'object') {
    return false;
  }
  if (hasToStringTag) {
    return tryFunctionObject(value);
  }
  if (isES6ClassFn(value)) {
    return false;
  }
  var strClass = toStr.call(value);
  if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) {
    return false;
  }
  return tryFunctionObject(value);
};

/***/ },

/***/ 5168
/*!****************************************************************!*\
  !*** ../app/node_modules/call-bind-apply-helpers/applyBind.js ***!
  \****************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var bind = __webpack_require__(/*! function-bind */ 438);
var $apply = __webpack_require__(/*! ./functionApply */ 6803);
var actualApply = __webpack_require__(/*! ./actualApply */ 6129);

/** @type {import('./applyBind')} */
module.exports = function applyBind() {
  return actualApply(bind, $apply, arguments);
};

/***/ },

/***/ 5250
/*!*************************************************************!*\
  !*** ./src/components/colorPicker.component.pug?ngResource ***!
  \*************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/colorPicker.component.pug?ngResource */ 2861);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 5334
/*!*****************************************************************************!*\
  !*** ../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
  \*****************************************************************************/
(module) {

"use strict";


var stylesInDOM = [];
function getIndexByIdentifier(identifier) {
  var result = -1;
  for (var i = 0; i < stylesInDOM.length; i++) {
    if (stylesInDOM[i].identifier === identifier) {
      result = i;
      break;
    }
  }
  return result;
}
function modulesToDom(list, options) {
  var idCountMap = {};
  var identifiers = [];
  for (var i = 0; i < list.length; i++) {
    var item = list[i];
    var id = options.base ? item[0] + options.base : item[0];
    var count = idCountMap[id] || 0;
    var identifier = "".concat(id, " ").concat(count);
    idCountMap[id] = count + 1;
    var indexByIdentifier = getIndexByIdentifier(identifier);
    var obj = {
      css: item[1],
      media: item[2],
      sourceMap: item[3],
      supports: item[4],
      layer: item[5]
    };
    if (indexByIdentifier !== -1) {
      stylesInDOM[indexByIdentifier].references++;
      stylesInDOM[indexByIdentifier].updater(obj);
    } else {
      var updater = addElementStyle(obj, options);
      options.byIndex = i;
      stylesInDOM.splice(i, 0, {
        identifier: identifier,
        updater: updater,
        references: 1
      });
    }
    identifiers.push(identifier);
  }
  return identifiers;
}
function addElementStyle(obj, options) {
  var api = options.domAPI(options);
  api.update(obj);
  var updater = function updater(newObj) {
    if (newObj) {
      if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
        return;
      }
      api.update(obj = newObj);
    } else {
      api.remove();
    }
  };
  return updater;
}
module.exports = function (list, options) {
  options = options || {};
  list = list || [];
  var lastIdentifiers = modulesToDom(list, options);
  return function update(newList) {
    newList = newList || [];
    for (var i = 0; i < lastIdentifiers.length; i++) {
      var identifier = lastIdentifiers[i];
      var index = getIndexByIdentifier(identifier);
      stylesInDOM[index].references--;
    }
    var newLastIdentifiers = modulesToDom(newList, options);
    for (var _i = 0; _i < lastIdentifiers.length; _i++) {
      var _identifier = lastIdentifiers[_i];
      var _index = getIndexByIdentifier(_identifier);
      if (stylesInDOM[_index].references === 0) {
        stylesInDOM[_index].updater();
        stylesInDOM.splice(_index, 1);
      }
    }
    lastIdentifiers = newLastIdentifiers;
  };
};

/***/ },

/***/ 5367
/*!**********************************************************************!*\
  !*** ../node_modules/style-loader/dist/runtime/styleTagTransform.js ***!
  \**********************************************************************/
(module) {

"use strict";


/* istanbul ignore next  */
function styleTagTransform(css, styleElement) {
  if (styleElement.styleSheet) {
    styleElement.styleSheet.cssText = css;
  } else {
    while (styleElement.firstChild) {
      styleElement.removeChild(styleElement.firstChild);
    }
    styleElement.appendChild(document.createTextNode(css));
  }
}
module.exports = styleTagTransform;

/***/ },

/***/ 5405
/*!*******************************************!*\
  !*** ../node_modules/deep-equal/index.js ***!
  \*******************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var objectKeys = __webpack_require__(/*! object-keys */ 2560);
var isArguments = __webpack_require__(/*! is-arguments */ 8303);
var is = __webpack_require__(/*! object-is */ 3479);
var isRegex = __webpack_require__(/*! is-regex */ 1476);
var flags = __webpack_require__(/*! regexp.prototype.flags */ 9470);
var isArray = __webpack_require__(/*! isarray */ 9547);
var isDate = __webpack_require__(/*! is-date-object */ 4523);
var whichBoxedPrimitive = __webpack_require__(/*! which-boxed-primitive */ 3010);
var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ 6852);
var callBound = __webpack_require__(/*! call-bind/callBound */ 9414);
var whichCollection = __webpack_require__(/*! which-collection */ 7554);
var getIterator = __webpack_require__(/*! es-get-iterator */ 1055);
var getSideChannel = __webpack_require__(/*! side-channel */ 6227);
var whichTypedArray = __webpack_require__(/*! which-typed-array */ 6086);
var assign = __webpack_require__(/*! object.assign */ 4900);
var $getTime = callBound('Date.prototype.getTime');
var gPO = Object.getPrototypeOf;
var $objToString = callBound('Object.prototype.toString');
var $Set = GetIntrinsic('%Set%', true);
var $mapHas = callBound('Map.prototype.has', true);
var $mapGet = callBound('Map.prototype.get', true);
var $mapSize = callBound('Map.prototype.size', true);
var $setAdd = callBound('Set.prototype.add', true);
var $setDelete = callBound('Set.prototype.delete', true);
var $setHas = callBound('Set.prototype.has', true);
var $setSize = callBound('Set.prototype.size', true);

// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L401-L414
function setHasEqualElement(set, val1, opts, channel) {
  var i = getIterator(set);
  var result;
  while ((result = i.next()) && !result.done) {
    if (internalDeepEqual(val1, result.value, opts, channel)) {
      // eslint-disable-line no-use-before-define
      // Remove the matching element to make sure we do not check that again.
      $setDelete(set, result.value);
      return true;
    }
  }
  return false;
}

// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L416-L439
function findLooseMatchingPrimitives(prim) {
  if (typeof prim === 'undefined') {
    return null;
  }
  if (typeof prim === 'object') {
    // Only pass in null as object!
    return void 0;
  }
  if (typeof prim === 'symbol') {
    return false;
  }
  if (typeof prim === 'string' || typeof prim === 'number') {
    // Loose equal entries exist only if the string is possible to convert to a regular number and not NaN.
    return +prim === +prim; // eslint-disable-line no-implicit-coercion
  }
  return true;
}

// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L449-L460
function mapMightHaveLoosePrim(a, b, prim, item, opts, channel) {
  var altValue = findLooseMatchingPrimitives(prim);
  if (altValue != null) {
    return altValue;
  }
  var curB = $mapGet(b, altValue);
  var looseOpts = assign({}, opts, {
    strict: false
  });
  if (typeof curB === 'undefined' && !$mapHas(b, altValue)
  // eslint-disable-next-line no-use-before-define
  || !internalDeepEqual(item, curB, looseOpts, channel)) {
    return false;
  }
  // eslint-disable-next-line no-use-before-define
  return !$mapHas(a, altValue) && internalDeepEqual(item, curB, looseOpts, channel);
}

// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L441-L447
function setMightHaveLoosePrim(a, b, prim) {
  var altValue = findLooseMatchingPrimitives(prim);
  if (altValue != null) {
    return altValue;
  }
  return $setHas(b, altValue) && !$setHas(a, altValue);
}

// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L518-L533
function mapHasEqualEntry(set, map, key1, item1, opts, channel) {
  var i = getIterator(set);
  var result;
  var key2;
  while ((result = i.next()) && !result.done) {
    key2 = result.value;
    if (
    // eslint-disable-next-line no-use-before-define
    internalDeepEqual(key1, key2, opts, channel)
    // eslint-disable-next-line no-use-before-define
    && internalDeepEqual(item1, $mapGet(map, key2), opts, channel)) {
      $setDelete(set, key2);
      return true;
    }
  }
  return false;
}
function internalDeepEqual(actual, expected, options, channel) {
  var opts = options || {};

  // 7.1. All identical values are equivalent, as determined by ===.
  if (opts.strict ? is(actual, expected) : actual === expected) {
    return true;
  }
  var actualBoxed = whichBoxedPrimitive(actual);
  var expectedBoxed = whichBoxedPrimitive(expected);
  if (actualBoxed !== expectedBoxed) {
    return false;
  }

  // 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.
  if (!actual || !expected || typeof actual !== 'object' && typeof expected !== 'object') {
    return opts.strict ? is(actual, expected) : actual == expected; // eslint-disable-line eqeqeq
  }

  /*
   * 7.4. For all other Object pairs, including Array objects, equivalence is
   * determined by having the same number of owned properties (as verified
   * with Object.prototype.hasOwnProperty.call), the same set of keys
   * (although not necessarily the same order), equivalent values for every
   * corresponding key, and an identical 'prototype' property. Note: this
   * accounts for both named and indexed properties on Arrays.
   */
  // see https://github.com/nodejs/node/commit/d3aafd02efd3a403d646a3044adcf14e63a88d32 for memos/channel inspiration

  var hasActual = channel.has(actual);
  var hasExpected = channel.has(expected);
  var sentinel;
  if (hasActual && hasExpected) {
    if (channel.get(actual) === channel.get(expected)) {
      return true;
    }
  } else {
    sentinel = {};
  }
  if (!hasActual) {
    channel.set(actual, sentinel);
  }
  if (!hasExpected) {
    channel.set(expected, sentinel);
  }

  // eslint-disable-next-line no-use-before-define
  return objEquiv(actual, expected, opts, channel);
}
function isBuffer(x) {
  if (!x || typeof x !== 'object' || typeof x.length !== 'number') {
    return false;
  }
  if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
    return false;
  }
  if (x.length > 0 && typeof x[0] !== 'number') {
    return false;
  }
  return !!(x.constructor && x.constructor.isBuffer && x.constructor.isBuffer(x));
}
function setEquiv(a, b, opts, channel) {
  if ($setSize(a) !== $setSize(b)) {
    return false;
  }
  var iA = getIterator(a);
  var iB = getIterator(b);
  var resultA;
  var resultB;
  var set;
  while ((resultA = iA.next()) && !resultA.done) {
    if (resultA.value && typeof resultA.value === 'object') {
      if (!set) {
        set = new $Set();
      }
      $setAdd(set, resultA.value);
    } else if (!$setHas(b, resultA.value)) {
      if (opts.strict) {
        return false;
      }
      if (!setMightHaveLoosePrim(a, b, resultA.value)) {
        return false;
      }
      if (!set) {
        set = new $Set();
      }
      $setAdd(set, resultA.value);
    }
  }
  if (set) {
    while ((resultB = iB.next()) && !resultB.done) {
      // We have to check if a primitive value is already matching and only if it's not, go hunting for it.
      if (resultB.value && typeof resultB.value === 'object') {
        if (!setHasEqualElement(set, resultB.value, opts.strict, channel)) {
          return false;
        }
      } else if (!opts.strict && !$setHas(a, resultB.value) && !setHasEqualElement(set, resultB.value, opts.strict, channel)) {
        return false;
      }
    }
    return $setSize(set) === 0;
  }
  return true;
}
function mapEquiv(a, b, opts, channel) {
  if ($mapSize(a) !== $mapSize(b)) {
    return false;
  }
  var iA = getIterator(a);
  var iB = getIterator(b);
  var resultA;
  var resultB;
  var set;
  var key;
  var item1;
  var item2;
  while ((resultA = iA.next()) && !resultA.done) {
    key = resultA.value[0];
    item1 = resultA.value[1];
    if (key && typeof key === 'object') {
      if (!set) {
        set = new $Set();
      }
      $setAdd(set, key);
    } else {
      item2 = $mapGet(b, key);
      if (typeof item2 === 'undefined' && !$mapHas(b, key) || !internalDeepEqual(item1, item2, opts, channel)) {
        if (opts.strict) {
          return false;
        }
        if (!mapMightHaveLoosePrim(a, b, key, item1, opts, channel)) {
          return false;
        }
        if (!set) {
          set = new $Set();
        }
        $setAdd(set, key);
      }
    }
  }
  if (set) {
    while ((resultB = iB.next()) && !resultB.done) {
      key = resultB.value[0];
      item2 = resultB.value[1];
      if (key && typeof key === 'object') {
        if (!mapHasEqualEntry(set, a, key, item2, opts, channel)) {
          return false;
        }
      } else if (!opts.strict && (!a.has(key) || !internalDeepEqual($mapGet(a, key), item2, opts, channel)) && !mapHasEqualEntry(set, a, key, item2, assign({}, opts, {
        strict: false
      }), channel)) {
        return false;
      }
    }
    return $setSize(set) === 0;
  }
  return true;
}
function objEquiv(a, b, opts, channel) {
  /* eslint max-statements: [2, 100], max-lines-per-function: [2, 120], max-depth: [2, 5] */
  var i, key;
  if (typeof a !== typeof b) {
    return false;
  }
  if (a == null || b == null) {
    return false;
  }
  if ($objToString(a) !== $objToString(b)) {
    return false;
  }
  if (isArguments(a) !== isArguments(b)) {
    return false;
  }
  var aIsArray = isArray(a);
  var bIsArray = isArray(b);
  if (aIsArray !== bIsArray) {
    return false;
  }

  // TODO: replace when a cross-realm brand check is available
  var aIsError = a instanceof Error;
  var bIsError = b instanceof Error;
  if (aIsError !== bIsError) {
    return false;
  }
  if (aIsError || bIsError) {
    if (a.name !== b.name || a.message !== b.message) {
      return false;
    }
  }
  var aIsRegex = isRegex(a);
  var bIsRegex = isRegex(b);
  if (aIsRegex !== bIsRegex) {
    return false;
  }
  if ((aIsRegex || bIsRegex) && (a.source !== b.source || flags(a) !== flags(b))) {
    return false;
  }
  var aIsDate = isDate(a);
  var bIsDate = isDate(b);
  if (aIsDate !== bIsDate) {
    return false;
  }
  if (aIsDate || bIsDate) {
    // && would work too, because both are true or both false here
    if ($getTime(a) !== $getTime(b)) {
      return false;
    }
  }
  if (opts.strict && gPO && gPO(a) !== gPO(b)) {
    return false;
  }
  if (whichTypedArray(a) !== whichTypedArray(b)) {
    return false;
  }
  var aIsBuffer = isBuffer(a);
  var bIsBuffer = isBuffer(b);
  if (aIsBuffer !== bIsBuffer) {
    return false;
  }
  if (aIsBuffer || bIsBuffer) {
    // && would work too, because both are true or both false here
    if (a.length !== b.length) {
      return false;
    }
    for (i = 0; i < a.length; i++) {
      if (a[i] !== b[i]) {
        return false;
      }
    }
    return true;
  }
  if (typeof a !== typeof b) {
    return false;
  }
  var ka = objectKeys(a);
  var kb = objectKeys(b);
  // having the same number of owned properties (keys incorporates hasOwnProperty)
  if (ka.length !== kb.length) {
    return false;
  }

  // the same set of keys (although not necessarily the same order),
  ka.sort();
  kb.sort();
  // ~~~cheap key test
  for (i = ka.length - 1; i >= 0; i--) {
    if (ka[i] != kb[i]) {
      return false;
    } // eslint-disable-line eqeqeq
  }

  // equivalent values for every corresponding key, and ~~~possibly expensive deep test
  for (i = ka.length - 1; i >= 0; i--) {
    key = ka[i];
    if (!internalDeepEqual(a[key], b[key], opts, channel)) {
      return false;
    }
  }
  var aCollection = whichCollection(a);
  var bCollection = whichCollection(b);
  if (aCollection !== bCollection) {
    return false;
  }
  if (aCollection === 'Set' || bCollection === 'Set') {
    // aCollection === bCollection
    return setEquiv(a, b, opts, channel);
  }
  if (aCollection === 'Map') {
    // aCollection === bCollection
    return mapEquiv(a, b, opts, channel);
  }
  return true;
}
module.exports = function deepEqual(a, b, opts) {
  return internalDeepEqual(a, b, opts, getSideChannel());
};

/***/ },

/***/ 5516
/*!**************************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/loginScriptsSettings.component.pug?ngResource ***!
  \**************************************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cdiv\u003E\n  \u003C!--TODO ([sortablejs]='scripts')--\u003E\n  \u003Cdiv class=\"input-group flex-grow-1\" *ngFor=\"let script of scripts\"\u003E\n    \u003Cinput class=\"form-control\" type=\"text\" placeholder=\"Expect\" [(ngModel)]=\"script.expect\"\u003E\n    \u003Cinput class=\"form-control\" type=\"text\" placeholder=\"Send\" [(ngModel)]=\"script.send\"\u003E\n    \u003Cdiv class=\"input-group-text p-0 border-0\"\u003E\n      \u003Cdiv class=\"hover-reveal\" ngbDropdown\u003E\n        \u003Cbutton class=\"btn btn-link btn-sm\" ngbDropdownToggle\u003E\u003Ci class=\"fas fa-fw fa-cog\"\u003E\u003C\u002Fi\u003E\u003C\u002Fbutton\u003E\n        \u003Cdiv class=\"dropdown-menu-right\" ngbDropdownMenu\u003E\u003Ca class=\"dropdown-item\" href=\"#\" (click)=\"script.isRegex = false\" [class.active]=\"!script.isRegex\"\u003E\u003Ci class=\"fas fa-fw\" [class.fa-check]=\"!script.isRegex\"\u003E\u003C\u002Fi\u003E\u003Cspan translate\u003EExact match\u003C\u002Fspan\u003E\u003C\u002Fa\u003E\u003Ca class=\"dropdown-item\" href=\"#\" (click)=\"script.isRegex = true\" [class.active]=\"script.isRegex\"\u003E\u003Ci class=\"fas fa-fw\" [class.fa-check]=\"script.isRegex\"\u003E\u003C\u002Fi\u003E\u003Cspan translate\u003ERegex\u003C\u002Fspan\u003E\u003C\u002Fa\u003E\u003Ca class=\"dropdown-item\" href=\"#\" (click)=\"script.optional = !script.optional\" [class.active]=\"script.optional\"\u003E\u003Ci class=\"fas fa-fw\" [class.fa-check]=\"script.optional\"\u003E\u003C\u002Fi\u003E\u003Cspan translate\u003EOptional\u003C\u002Fspan\u003E\u003C\u002Fa\u003E\u003C\u002Fdiv\u003E\n      \u003C\u002Fdiv\u003E\n      \u003Cbutton class=\"btn btn-link btn-sm hover-reveal\" (click)=\"deleteScript(script)\"\u003E\u003Ci class=\"fas fa-fw fa-trash-alt\"\u003E\u003C\u002Fi\u003E\u003C\u002Fbutton\u003E\n    \u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cbutton class=\"btn btn-secondary mt-2\" (click)=\"addScript()\"\u003E\u003Ci class=\"fas fa-plus\"\u003E\u003C\u002Fi\u003E\u003Cspan translate\u003ENew item\u003C\u002Fspan\u003E\u003C\u002Fbutton\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 5534
/*!***************************************************!*\
  !*** ../app/node_modules/math-intrinsics/sign.js ***!
  \***************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var $isNaN = __webpack_require__(/*! ./isNaN */ 954);

/** @type {import('./sign')} */
module.exports = function sign(number) {
  if ($isNaN(number) || number === 0) {
    return number;
  }
  return number < 0 ? -1 : +1;
};

/***/ },

/***/ 5603
/*!************************************************************!*\
  !*** ../app/node_modules/call-bind-apply-helpers/index.js ***!
  \************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var bind = __webpack_require__(/*! function-bind */ 438);
var $TypeError = __webpack_require__(/*! es-errors/type */ 9176);
var $call = __webpack_require__(/*! ./functionCall */ 711);
var $actualApply = __webpack_require__(/*! ./actualApply */ 6129);

/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
module.exports = function callBindBasic(args) {
  if (args.length < 1 || typeof args[0] !== 'function') {
    throw new $TypeError('a function is required');
  }
  return $actualApply(bind, $call, args);
};

/***/ },

/***/ 5717
/*!***********************************************************************!*\
  !*** ./src/components/appearanceSettingsTab.component.pug?ngResource ***!
  \***********************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/appearanceSettingsTab.component.pug?ngResource */ 9258);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 5743
/*!**********************!*\
  !*** ./src/bell.ogg ***!
  \**********************/
(module) {

"use strict";
module.exports = "data:audio/ogg;base64, ";

/***/ },

/***/ 5821
/*!*********************************************************!*\
  !*** ../app/node_modules/functions-have-names/index.js ***!
  \*********************************************************/
(module) {

"use strict";


var functionsHaveNames = function functionsHaveNames() {
  return typeof function f() {}.name === 'string';
};
var gOPD = Object.getOwnPropertyDescriptor;
if (gOPD) {
  try {
    gOPD([], 'length');
  } catch (e) {
    // IE 8 has a broken gOPD
    gOPD = null;
  }
}
functionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {
  if (!functionsHaveNames() || !gOPD) {
    return false;
  }
  var desc = gOPD(function () {}, 'name');
  return !!desc && !!desc.configurable;
};
var $bind = Function.prototype.bind;
functionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() {
  return functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== '';
};
module.exports = functionsHaveNames;

/***/ },

/***/ 5832
/*!*******************************************************!*\
  !*** ../app/node_modules/es-define-property/index.js ***!
  \*******************************************************/
(module) {

"use strict";


/** @type {import('.')} */
var $defineProperty = Object.defineProperty || false;
if ($defineProperty) {
  try {
    $defineProperty({}, 'a', {
      value: 1
    });
  } catch (e) {
    // IE 8 has a broken defineProperty
    $defineProperty = false;
  }
}
module.exports = $defineProperty;

/***/ },

/***/ 5860
/*!*********************************************************!*\
  !*** ../app/node_modules/object-keys/implementation.js ***!
  \*********************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var keysShim;
if (!Object.keys) {
  // modified from https://github.com/es-shims/es5-shim
  var has = Object.prototype.hasOwnProperty;
  var toStr = Object.prototype.toString;
  var isArgs = __webpack_require__(/*! ./isArguments */ 6564); // eslint-disable-line global-require
  var isEnumerable = Object.prototype.propertyIsEnumerable;
  var hasDontEnumBug = !isEnumerable.call({
    toString: null
  }, 'toString');
  var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
  var dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'];
  var equalsConstructorPrototype = function (o) {
    var ctor = o.constructor;
    return ctor && ctor.prototype === o;
  };
  var excludedKeys = {
    $applicationCache: true,
    $console: true,
    $external: true,
    $frame: true,
    $frameElement: true,
    $frames: true,
    $innerHeight: true,
    $innerWidth: true,
    $onmozfullscreenchange: true,
    $onmozfullscreenerror: true,
    $outerHeight: true,
    $outerWidth: true,
    $pageXOffset: true,
    $pageYOffset: true,
    $parent: true,
    $scrollLeft: true,
    $scrollTop: true,
    $scrollX: true,
    $scrollY: true,
    $self: true,
    $webkitIndexedDB: true,
    $webkitStorageInfo: true,
    $window: true
  };
  var hasAutomationEqualityBug = function () {
    /* global window */
    if (typeof window === 'undefined') {
      return false;
    }
    for (var k in window) {
      try {
        if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
          try {
            equalsConstructorPrototype(window[k]);
          } catch (e) {
            return true;
          }
        }
      } catch (e) {
        return true;
      }
    }
    return false;
  }();
  var equalsConstructorPrototypeIfNotBuggy = function (o) {
    /* global window */
    if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
      return equalsConstructorPrototype(o);
    }
    try {
      return equalsConstructorPrototype(o);
    } catch (e) {
      return false;
    }
  };
  keysShim = function keys(object) {
    var isObject = object !== null && typeof object === 'object';
    var isFunction = toStr.call(object) === '[object Function]';
    var isArguments = isArgs(object);
    var isString = isObject && toStr.call(object) === '[object String]';
    var theKeys = [];
    if (!isObject && !isFunction && !isArguments) {
      throw new TypeError('Object.keys called on a non-object');
    }
    var skipProto = hasProtoEnumBug && isFunction;
    if (isString && object.length > 0 && !has.call(object, 0)) {
      for (var i = 0; i < object.length; ++i) {
        theKeys.push(String(i));
      }
    }
    if (isArguments && object.length > 0) {
      for (var j = 0; j < object.length; ++j) {
        theKeys.push(String(j));
      }
    } else {
      for (var name in object) {
        if (!(skipProto && name === 'prototype') && has.call(object, name)) {
          theKeys.push(String(name));
        }
      }
    }
    if (hasDontEnumBug) {
      var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
      for (var k = 0; k < dontEnums.length; ++k) {
        if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
          theKeys.push(dontEnums[k]);
        }
      }
    }
    return theKeys;
  };
}
module.exports = keysShim;

/***/ },

/***/ 5955
/*!******************************************************!*\
  !*** ../node_modules/css-loader/dist/runtime/api.js ***!
  \******************************************************/
(module) {

"use strict";


/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/
module.exports = function (cssWithMappingToString) {
  var list = [];

  // return the list of modules as css string
  list.toString = function toString() {
    return this.map(function (item) {
      var content = "";
      var needLayer = typeof item[5] !== "undefined";
      if (item[4]) {
        content += "@supports (".concat(item[4], ") {");
      }
      if (item[2]) {
        content += "@media ".concat(item[2], " {");
      }
      if (needLayer) {
        content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
      }
      content += cssWithMappingToString(item);
      if (needLayer) {
        content += "}";
      }
      if (item[2]) {
        content += "}";
      }
      if (item[4]) {
        content += "}";
      }
      return content;
    }).join("");
  };

  // import a list of modules into the list
  list.i = function i(modules, media, dedupe, supports, layer) {
    if (typeof modules === "string") {
      modules = [[null, modules, undefined]];
    }
    var alreadyImportedModules = {};
    if (dedupe) {
      for (var k = 0; k < this.length; k++) {
        var id = this[k][0];
        if (id != null) {
          alreadyImportedModules[id] = true;
        }
      }
    }
    for (var _k = 0; _k < modules.length; _k++) {
      var item = [].concat(modules[_k]);
      if (dedupe && alreadyImportedModules[item[0]]) {
        continue;
      }
      if (typeof layer !== "undefined") {
        if (typeof item[5] === "undefined") {
          item[5] = layer;
        } else {
          item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
          item[5] = layer;
        }
      }
      if (media) {
        if (!item[2]) {
          item[2] = media;
        } else {
          item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
          item[2] = media;
        }
      }
      if (supports) {
        if (!item[4]) {
          item[4] = "".concat(supports);
        } else {
          item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
          item[4] = supports;
        }
      }
      list.push(item);
    }
  };
  return list;
};

/***/ },

/***/ 6045
/*!********************************************!*\
  !*** ../node_modules/shell-quote/index.js ***!
  \********************************************/
(__unused_webpack_module, exports) {

"use strict";


exports.quote = function (xs) {
  return xs.map(function (s) {
    if (s && typeof s === 'object') {
      return s.op.replace(/(.)/g, '\\$1');
    } else if (/["\s]/.test(s) && !/'/.test(s)) {
      return "'" + s.replace(/(['\\])/g, '\\$1') + "'";
    } else if (/["'\s]/.test(s)) {
      return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"';
    }
    return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, '$1\\$2');
  }).join(' ');
};

// '<(' is process substitution operator and
// can be parsed the same as control operator
var CONTROL = '(?:' + ['\\|\\|', '\\&\\&', ';;', '\\|\\&', '\\<\\(', '>>', '>\\&', '[&;()|<>]'].join('|') + ')';
var META = '|&;()<> \\t';
var BAREWORD = '(\\\\[\'"' + META + ']|[^\\s\'"' + META + '])+';
var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
var DOUBLE_QUOTE = '\'((\\\\\'|[^\'])*?)\'';
var TOKEN = '';
for (var i = 0; i < 4; i++) {
  TOKEN += (Math.pow(16, 8) * Math.random()).toString(16);
}
function parse(s, env, opts) {
  var chunker = new RegExp(['(' + CONTROL + ')',
  // control chars
  '(' + BAREWORD + '|' + SINGLE_QUOTE + '|' + DOUBLE_QUOTE + ')*'].join('|'), 'g');
  var match = s.match(chunker).filter(Boolean);
  if (!match) {
    return [];
  }
  if (!env) {
    env = {};
  }
  if (!opts) {
    opts = {};
  }
  var commented = false;
  function getVar(_, pre, key) {
    var r = typeof env === 'function' ? env(key) : env[key];
    if (r === undefined && key != '') {
      r = '';
    } else if (r === undefined) {
      r = '$';
    }
    if (typeof r === 'object') {
      return pre + TOKEN + JSON.stringify(r) + TOKEN;
    }
    return pre + r;
  }
  return match.map(function (s, j) {
    if (commented) {
      return void undefined;
    }
    if (RegExp('^' + CONTROL + '$').test(s)) {
      return {
        op: s
      };
    }

    // Hand-written scanner/parser for Bash quoting rules:
    //
    // 1. inside single quotes, all characters are printed literally.
    // 2. inside double quotes, all characters are printed literally
    //    except variables prefixed by '$' and backslashes followed by
    //    either a double quote or another backslash.
    // 3. outside of any quotes, backslashes are treated as escape
    //    characters and not printed (unless they are themselves escaped)
    // 4. quote context can switch mid-token if there is no whitespace
    //     between the two quote contexts (e.g. all'one'"token" parses as
    //     "allonetoken")
    var SQ = "'";
    var DQ = '"';
    var DS = '$';
    var BS = opts.escape || '\\';
    var quote = false;
    var esc = false;
    var out = '';
    var isGlob = false;
    var i;
    function parseEnvVar() {
      i += 1;
      var varend;
      var varname;
      // debugger
      if (s.charAt(i) === '{') {
        i += 1;
        if (s.charAt(i) === '}') {
          throw new Error('Bad substitution: ' + s.substr(i - 2, 3));
        }
        varend = s.indexOf('}', i);
        if (varend < 0) {
          throw new Error('Bad substitution: ' + s.substr(i));
        }
        varname = s.substr(i, varend - i);
        i = varend;
      } else if (/[*@#?$!_-]/.test(s.charAt(i))) {
        varname = s.charAt(i);
        i += 1;
      } else {
        varend = s.substr(i).match(/[^\w\d_]/);
        if (!varend) {
          varname = s.substr(i);
          i = s.length;
        } else {
          varname = s.substr(i, varend.index);
          i += varend.index - 1;
        }
      }
      return getVar(null, '', varname);
    }
    for (i = 0; i < s.length; i++) {
      var c = s.charAt(i);
      isGlob = isGlob || !quote && (c === '*' || c === '?');
      if (esc) {
        out += c;
        esc = false;
      } else if (quote) {
        if (c === quote) {
          quote = false;
        } else if (quote == SQ) {
          out += c;
        } else {
          // Double quote
          if (c === BS) {
            i += 1;
            c = s.charAt(i);
            if (c === DQ || c === BS || c === DS) {
              out += c;
            } else {
              out += BS + c;
            }
          } else if (c === DS) {
            out += parseEnvVar();
          } else {
            out += c;
          }
        }
      } else if (c === DQ || c === SQ) {
        quote = c;
      } else if (RegExp('^' + CONTROL + '$').test(c)) {
        return {
          op: s
        };
      } else if (/^#$/.test(c)) {
        commented = true;
        if (out.length) {
          return [out, {
            comment: s.slice(i + 1) + match.slice(j + 1).join(' ')
          }];
        }
        return [{
          comment: s.slice(i + 1) + match.slice(j + 1).join(' ')
        }];
      } else if (c === BS) {
        esc = true;
      } else if (c === DS) {
        out += parseEnvVar();
      } else {
        out += c;
      }
    }
    if (isGlob) {
      return {
        op: 'glob',
        pattern: out
      };
    }
    return out;
  }).reduce(function (prev, arg) {
    // finalize parsed aruments
    if (arg === undefined) {
      return prev;
    }
    return prev.concat(arg);
  }, []);
}
exports.parse = function (s, env, opts) {
  var mapped = parse(s, env, opts);
  if (typeof env !== 'function') {
    return mapped;
  }
  return mapped.reduce(function (acc, s) {
    if (typeof s === 'object') {
      return acc.concat(s);
    }
    var xs = s.split(RegExp('(' + TOKEN + '.*?' + TOKEN + ')', 'g'));
    if (xs.length === 1) {
      return acc.concat(xs[0]);
    }
    return acc.concat(xs.filter(Boolean).map(function (x) {
      if (RegExp('^' + TOKEN).test(x)) {
        return JSON.parse(x.split(TOKEN)[1]);
      }
      return x;
    }));
  }, []);
};

/***/ },

/***/ 6056
/*!***********************************************************!*\
  !*** ../app/node_modules/object.assign/implementation.js ***!
  \***********************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


// modified from https://github.com/es-shims/es6-shim
var objectKeys = __webpack_require__(/*! object-keys */ 2560);
var hasSymbols = __webpack_require__(/*! has-symbols/shams */ 9944)();
var callBound = __webpack_require__(/*! call-bound */ 4731);
var $Object = __webpack_require__(/*! es-object-atoms */ 2897);
var $push = callBound('Array.prototype.push');
var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
var originalGetSymbols = hasSymbols ? $Object.getOwnPropertySymbols : null;

// eslint-disable-next-line no-unused-vars
module.exports = function assign(target, source1) {
  if (target == null) {
    throw new TypeError('target must be an object');
  }
  var to = $Object(target); // step 1
  if (arguments.length === 1) {
    return to; // step 2
  }
  for (var s = 1; s < arguments.length; ++s) {
    var from = $Object(arguments[s]); // step 3.a.i

    // step 3.a.ii:
    var keys = objectKeys(from);
    var getSymbols = hasSymbols && ($Object.getOwnPropertySymbols || originalGetSymbols);
    if (getSymbols) {
      var syms = getSymbols(from);
      for (var j = 0; j < syms.length; ++j) {
        var key = syms[j];
        if ($propIsEnumerable(from, key)) {
          $push(keys, key);
        }
      }
    }

    // step 3.a.iii:
    for (var i = 0; i < keys.length; ++i) {
      var nextKey = keys[i];
      if ($propIsEnumerable(from, nextKey)) {
        // step 3.a.iii.2
        var propValue = from[nextKey]; // step 3.a.iii.2.a
        to[nextKey] = propValue; // step 3.a.iii.2.b
      }
    }
  }
  return to; // step 4
};

/***/ },

/***/ 6086
/*!******************************************************!*\
  !*** ../app/node_modules/which-typed-array/index.js ***!
  \******************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var forEach = __webpack_require__(/*! for-each */ 9413);
var availableTypedArrays = __webpack_require__(/*! available-typed-arrays */ 988);
var callBind = __webpack_require__(/*! call-bind */ 3990);
var callBound = __webpack_require__(/*! call-bound */ 4731);
var gOPD = __webpack_require__(/*! gopd */ 1284);
var getProto = __webpack_require__(/*! get-proto */ 3077);
var $toString = callBound('Object.prototype.toString');
var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ 6565)();
var g = typeof globalThis === 'undefined' ? global : globalThis;
var typedArrays = availableTypedArrays();
var $slice = callBound('String.prototype.slice');

/** @type {<T = unknown>(array: readonly T[], value: unknown) => number} */
var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {
  for (var i = 0; i < array.length; i += 1) {
    if (array[i] === value) {
      return i;
    }
  }
  return -1;
};

/** @typedef {import('./types').Getter} Getter */
/** @type {import('./types').Cache} */
var cache = {
  __proto__: null
};
if (hasToStringTag && gOPD && getProto) {
  forEach(typedArrays, function (typedArray) {
    var arr = new g[typedArray]();
    if (Symbol.toStringTag in arr && getProto) {
      var proto = getProto(arr);
      // @ts-expect-error TS won't narrow inside a closure
      var descriptor = gOPD(proto, Symbol.toStringTag);
      if (!descriptor && proto) {
        var superProto = getProto(proto);
        // @ts-expect-error TS won't narrow inside a closure
        descriptor = gOPD(superProto, Symbol.toStringTag);
      }
      // @ts-expect-error TODO: fix
      cache['$' + typedArray] = callBind(descriptor.get);
    }
  });
} else {
  forEach(typedArrays, function (typedArray) {
    var arr = new g[typedArray]();
    var fn = arr.slice || arr.set;
    if (fn) {
      cache[(/** @type {`$${import('.').TypedArrayName}`} */'$' + typedArray)] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */
      // @ts-expect-error TODO FIXME
      callBind(fn);
    }
  });
}

/** @type {(value: object) => false | import('.').TypedArrayName} */
var tryTypedArrays = function tryAllTypedArrays(value) {
  /** @type {ReturnType<typeof tryAllTypedArrays>} */var found = false;
  forEach(/** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */cache, /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
  function (getter, typedArray) {
    if (!found) {
      try {
        // @ts-expect-error a throw is fine here
        if ('$' + getter(value) === typedArray) {
          found = /** @type {import('.').TypedArrayName} */$slice(typedArray, 1);
        }
      } catch (e) {/**/}
    }
  });
  return found;
};

/** @type {(value: object) => false | import('.').TypedArrayName} */
var trySlices = function tryAllSlices(value) {
  /** @type {ReturnType<typeof tryAllSlices>} */var found = false;
  forEach(/** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */cache, /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */function (getter, name) {
    if (!found) {
      try {
        // @ts-expect-error a throw is fine here
        getter(value);
        found = /** @type {import('.').TypedArrayName} */$slice(name, 1);
      } catch (e) {/**/}
    }
  });
  return found;
};

/** @type {import('.')} */
module.exports = function whichTypedArray(value) {
  if (!value || typeof value !== 'object') {
    return false;
  }
  if (!hasToStringTag) {
    /** @type {string} */
    var tag = $slice($toString(value), 8, -1);
    if ($indexOf(typedArrays, tag) > -1) {
      return tag;
    }
    if (tag !== 'Object') {
      return false;
    }
    // node < 0.6 hits here on real Typed Arrays
    return trySlices(value);
  }
  if (!gOPD) {
    return null;
  } // unknown engine
  return tryTypedArrays(value);
};

/***/ },

/***/ 6107
/*!****************************************************!*\
  !*** ../app/node_modules/math-intrinsics/round.js ***!
  \****************************************************/
(module) {

"use strict";


/** @type {import('./round')} */
module.exports = Math.round;

/***/ },

/***/ 6129
/*!******************************************************************!*\
  !*** ../app/node_modules/call-bind-apply-helpers/actualApply.js ***!
  \******************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var bind = __webpack_require__(/*! function-bind */ 438);
var $apply = __webpack_require__(/*! ./functionApply */ 6803);
var $call = __webpack_require__(/*! ./functionCall */ 711);
var $reflectApply = __webpack_require__(/*! ./reflectApply */ 9648);

/** @type {import('./actualApply')} */
module.exports = $reflectApply || bind.call($call, $apply);

/***/ },

/***/ 6177
/*!**********************************!*\
  !*** ./src/icons/arrow-down.svg ***!
  \**********************************/
(module) {

module.exports = "<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fal\" data-icon=\"arrow-down\" class=\"svg-inline--fa fa-arrow-down\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><path fill=\"currentColor\" d=\"M378.8 309.8l-176 165.9C199.7 478.6 195.9 480 192 480s-7.719-1.426-10.77-4.31l-176-165.9C-1.297 303.6-1.781 293.1 4.156 286.3c5.953-6.838 16.09-7.259 22.61-1.134L176 425.9V48.59c0-9.171 7.156-16.59 15.1-16.59S208 39.42 208 48.59v377.3l149.2-140.7c6.516-6.125 16.66-5.704 22.61 1.134C385.8 293.1 385.3 303.6 378.8 309.8z\"></path></svg>"

/***/ },

/***/ 6227
/*!*************************************************!*\
  !*** ../app/node_modules/side-channel/index.js ***!
  \*************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var $TypeError = __webpack_require__(/*! es-errors/type */ 9176);
var inspect = __webpack_require__(/*! object-inspect */ 3808);
var getSideChannelList = __webpack_require__(/*! side-channel-list */ 6654);
var getSideChannelMap = __webpack_require__(/*! side-channel-map */ 3688);
var getSideChannelWeakMap = __webpack_require__(/*! side-channel-weakmap */ 7528);
var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;

/** @type {import('.')} */
module.exports = function getSideChannel() {
  /** @typedef {ReturnType<typeof getSideChannel>} Channel */

  /** @type {Channel | undefined} */var $channelData;

  /** @type {Channel} */
  var channel = {
    assert: function (key) {
      if (!channel.has(key)) {
        throw new $TypeError('Side channel does not contain ' + inspect(key));
      }
    },
    'delete': function (key) {
      return !!$channelData && $channelData['delete'](key);
    },
    get: function (key) {
      return $channelData && $channelData.get(key);
    },
    has: function (key) {
      return !!$channelData && $channelData.has(key);
    },
    set: function (key, value) {
      if (!$channelData) {
        $channelData = makeChannel();
      }
      $channelData.set(key, value);
    }
  };
  // @ts-expect-error TODO: figure out why this is erroring
  return channel;
};

/***/ },

/***/ 6248
/*!**********************************************!*\
  !*** ./node_modules/zmodem.js/src/encode.js ***!
  \**********************************************/
(module) {

"use strict";


var Zmodem = module.exports;
const HEX_DIGITS = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 97, 98, 99, 100, 101, 102];
const HEX_OCTET_VALUE = {};
for (var hd = 0; hd < HEX_DIGITS.length; hd++) {
  HEX_OCTET_VALUE[HEX_DIGITS[hd]] = hd;
}

/**
 * General, non-ZMODEM-specific encoding logic.
 *
 * @exports ENCODELIB
 */
Zmodem.ENCODELIB = {
  /**
   * Return an array with the given number as 2 big-endian bytes.
   *
   * @param {number} number - The number to encode.
   *
   * @returns {number[]} The octet values.
   */
  pack_u16_be: function pack_u16_be(number) {
    if (number > 0xffff) throw "Number cannot exceed 16 bits: " + number;
    return [number >> 8, number & 0xff];
  },
  /**
   * Return an array with the given number as 4 little-endian bytes.
   *
   * @param {number} number - The number to encode.
   *
   * @returns {number[]} The octet values.
   */
  pack_u32_le: function pack_u32_le(number) {
    //Can’t bit-shift because that runs into JS’s bit-shift problem.
    //(See _updcrc32() for an example.)
    var high_bytes = number / 65536; //fraction is ok

    //a little-endian 4-byte sequence
    return [number & 0xff, (number & 65535) >> 8, high_bytes & 0xff, high_bytes >> 8];
  },
  /**
   * The inverse of pack_u16_be() - i.e., take in 2 octet values
   * and parse them as an unsigned, 2-byte big-endian number.
   *
   * @param {number[]} octets - The octet values (2 of them).
   *
   * @returns {number} The decoded number.
   */
  unpack_u16_be: function unpack_u16_be(bytes_arr) {
    return (bytes_arr[0] << 8) + bytes_arr[1];
  },
  /**
   * The inverse of pack_u32_le() - i.e., take in a 4-byte sequence
   * and parse it as an unsigned, 4-byte little-endian number.
   *
   * @param {number[]} octets - The octet values (4 of them).
   *
   * @returns {number} The decoded number.
   */
  unpack_u32_le: function unpack_u32_le(octets) {
    //<sigh> … (254 << 24 is -33554432, according to JavaScript)
    return octets[0] + (octets[1] << 8) + (octets[2] << 16) + octets[3] * 16777216;
  },
  /**
   * Encode a series of octet values to be the octet values that
   * correspond to the ASCII hex characters for each octet. The
   * returned array is suitable for use as binary data.
   *
   * For example:
   *
   *      Original    Hex     Returned
   *      254         fe      102, 101
   *       12         0c      48, 99
   *      129         81      56, 49
   *
   * @param {number[]} octets - The original octet values.
   *
   * @returns {number[]} The octet values that correspond to an ASCII
   *  representation of the given octets.
   */
  octets_to_hex: function octets_to_hex(octets) {
    var hex = [];
    for (var o = 0; o < octets.length; o++) {
      hex.push(HEX_DIGITS[octets[o] >> 4], HEX_DIGITS[octets[o] & 0x0f]);
    }
    return hex;
  },
  /**
   * The inverse of octets_to_hex(): takes an array
   * of hex octet pairs and returns their octet values.
   *
   * @param {number[]} hex_octets - The hex octet values.
   *
   * @returns {number[]} The parsed octet values.
   */
  parse_hex_octets: function parse_hex_octets(hex_octets) {
    var octets = new Array(hex_octets.length / 2);
    for (var i = 0; i < octets.length; i++) {
      octets[i] = (HEX_OCTET_VALUE[hex_octets[2 * i]] << 4) + HEX_OCTET_VALUE[hex_octets[1 + 2 * i]];
    }
    return octets;
  }
};

/***/ },

/***/ 6342
/*!*******************************************!*\
  !*** ./node_modules/cli-spinner/index.js ***!
  \*******************************************/
(__unused_webpack_module, exports, __webpack_require__) {

var readline = __webpack_require__(/*! readline */ 4902);
var defaultSpinnerString = 0;
var defaultSpinnerDelay = 60;
function defaultOnTick(msg) {
  this.clearLine(this.stream);
  this.stream.write(msg);
}
;
var Spinner = function (options) {
  if (!(this instanceof Spinner)) return new Spinner(options);
  if (typeof options === "string") {
    options = {
      text: options
    };
  } else if (!options) {
    options = {};
  }
  this.text = options.text || '';
  this.setSpinnerString(defaultSpinnerString);
  this.setSpinnerDelay(defaultSpinnerDelay);
  this.onTick = options.onTick || defaultOnTick;
  this.stream = options.stream || process.stdout;
};
Spinner.spinners = __webpack_require__(/*! ./spinners.json */ 4744);
Spinner.setDefaultSpinnerString = function (value) {
  defaultSpinnerString = value;
  return this;
};
Spinner.setDefaultSpinnerDelay = function (value) {
  defaultSpinnerDelay = value;
  return this;
};
Spinner.prototype.start = function () {
  if (this.stream === process.stdout && this.stream.isTTY !== true) {
    return this;
  }
  var current = 0;
  var self = this;
  var iteration = function () {
    var msg = self.text.indexOf('%s') > -1 ? self.text.replace('%s', self.chars[current]) : self.chars[current] + ' ' + self.text;
    self.onTick(msg);
    current = ++current % self.chars.length;
  };
  iteration();
  this.id = setInterval(iteration, this.delay);
  return this;
};
Spinner.prototype.isSpinning = function () {
  return this.id !== undefined;
};
Spinner.prototype.setSpinnerDelay = function (n) {
  this.delay = n;
  return this;
};
Spinner.prototype.setSpinnerString = function (str) {
  const map = mapToSpinner(str, this.spinners);
  this.chars = Array.isArray(map) ? map : map.split('');
  return this;
};
Spinner.prototype.setSpinnerTitle = function (str) {
  this.text = str;
  return this;
};
Spinner.prototype.stop = function (clear) {
  if (this.isSpinning === false) {
    return this;
  }
  clearInterval(this.id);
  this.id = undefined;
  if (clear) {
    this.clearLine(this.stream);
  }
  return this;
};
Spinner.prototype.clearLine = function (stream) {
  readline.clearLine(stream, 0);
  readline.cursorTo(stream, 0);
  return this;
};

// Helpers

function isInt(value) {
  return typeof value === 'number' && value % 1 === 0;
}
function mapToSpinner(value, spinners) {
  // Not an integer, return as strng
  if (!isInt(value)) {
    return value + '';
  }
  var length = Spinner.spinners.length;

  // Check if index is within bounds
  value = value >= length ? 0 : value;
  // If negative, count from the end
  value = value < 0 ? length + value : value;
  return Spinner.spinners[value];
}
exports.y = Spinner;

/***/ },

/***/ 6347
/*!**********************************!*\
  !*** ./src/icons/whole-word.svg ***!
  \**********************************/
(module) {

module.exports = "<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fal\" data-icon=\"input-text\" class=\"svg-inline--fa fa-input-text\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 512\"><path fill=\"currentColor\" d=\"M576 64H63.1C28.65 64 0 92.65 0 128v256c0 35.35 28.65 64 63.1 64H576C611.3 448 640 419.3 640 384V128C640 92.65 611.3 64 576 64zM608 384c0 17.64-14.35 32-31.1 32H63.1C46.35 416 32 401.6 32 384V128c0-17.64 14.35-32 31.1-32H576C593.6 96 608 110.4 608 128V384zM405.6 248.5C412.2 239.3 416 228.1 416 216C416 185.1 390.9 160 360 160H304C295.2 160 288 167.2 288 176v160C288 344.8 295.2 352 304 352h72c30.88 0 56-25.12 56-56C432 275.1 421.4 258.4 405.6 248.5zM320 192h40C373.2 192 384 202.8 384 216S373.2 240 360 240H320V192zM376 320H320V272h56c13.22 0 24 10.77 24 24C400 309.2 389.2 320 376 320zM190.8 170.1c-4.812-12.16-24.88-12.16-29.69 0l-64 160c-3.281 8.188 .6875 17.5 8.906 20.78c8.219 3.312 17.5-.7187 20.78-8.906l15.33-38.31C142.8 303.7 143.4 304 144 304h64c.6484 0 1.201-.2949 1.83-.3691l15.33 38.31C227.7 348.2 233.7 352 240 352c1.969 0 4-.375 5.938-1.156c8.219-3.281 12.19-12.59 8.906-20.78L190.8 170.1zM154.8 272L176 219.1L197.2 272H154.8z\"></path></svg>"

/***/ },

/***/ 6392
/*!**************************************!*\
  !*** ../app/node_modules/uuid/v1.js ***!
  \**************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var rng = __webpack_require__(/*! ./lib/rng */ 1488);
var bytesToUuid = __webpack_require__(/*! ./lib/bytesToUuid */ 8516);

// **`v1()` - Generate time-based UUID**
//
// Inspired by https://github.com/LiosK/UUID.js
// and http://docs.python.org/library/uuid.html

var _nodeId;
var _clockseq;

// Previous uuid creation time
var _lastMSecs = 0;
var _lastNSecs = 0;

// See https://github.com/uuidjs/uuid for API details
function v1(options, buf, offset) {
  var i = buf && offset || 0;
  var b = buf || [];
  options = options || {};
  var node = options.node || _nodeId;
  var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;

  // node and clockseq need to be initialized to random values if they're not
  // specified.  We do this lazily to minimize issues related to insufficient
  // system entropy.  See #189
  if (node == null || clockseq == null) {
    var seedBytes = rng();
    if (node == null) {
      // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
      node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
    }
    if (clockseq == null) {
      // Per 4.2.2, randomize (14 bit) clockseq
      clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
    }
  }

  // UUID timestamps are 100 nano-second units since the Gregorian epoch,
  // (1582-10-15 00:00).  JSNumbers aren't precise enough for this, so
  // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
  // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
  var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();

  // Per 4.2.1.2, use count of uuid's generated during the current clock
  // cycle to simulate higher resolution clock
  var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;

  // Time since last uuid creation (in msecs)
  var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000;

  // Per 4.2.1.2, Bump clockseq on clock regression
  if (dt < 0 && options.clockseq === undefined) {
    clockseq = clockseq + 1 & 0x3fff;
  }

  // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
  // time interval
  if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
    nsecs = 0;
  }

  // Per 4.2.1.2 Throw error if too many uuids are requested
  if (nsecs >= 10000) {
    throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
  }
  _lastMSecs = msecs;
  _lastNSecs = nsecs;
  _clockseq = clockseq;

  // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
  msecs += 12219292800000;

  // `time_low`
  var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
  b[i++] = tl >>> 24 & 0xff;
  b[i++] = tl >>> 16 & 0xff;
  b[i++] = tl >>> 8 & 0xff;
  b[i++] = tl & 0xff;

  // `time_mid`
  var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
  b[i++] = tmh >>> 8 & 0xff;
  b[i++] = tmh & 0xff;

  // `time_high_and_version`
  b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
  b[i++] = tmh >>> 16 & 0xff;

  // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
  b[i++] = clockseq >>> 8 | 0x80;

  // `clock_seq_low`
  b[i++] = clockseq & 0xff;

  // `node`
  for (var n = 0; n < 6; ++n) {
    b[i + n] = node[n];
  }
  return buf ? buf : bytesToUuid(b);
}
module.exports = v1;

/***/ },

/***/ 6523
/*!*****************************!*\
  !*** external "ngx-toastr" ***!
  \*****************************/
(module) {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__6523__;

/***/ },

/***/ 6543
/*!***********************************************!*\
  !*** ../app/node_modules/es-errors/syntax.js ***!
  \***********************************************/
(module) {

"use strict";


/** @type {import('./syntax')} */
module.exports = SyntaxError;

/***/ },

/***/ 6557
/*!**************************************************************!*\
  !*** ../app/node_modules/get-proto/Object.getPrototypeOf.js ***!
  \**************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var $Object = __webpack_require__(/*! es-object-atoms */ 2897);

/** @type {import('./Object.getPrototypeOf')} */
module.exports = $Object.getPrototypeOf || null;

/***/ },

/***/ 6563
/*!********************************************!*\
  !*** ./node_modules/zmodem.js/src/zdle.js ***!
  \********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var Zmodem = module.exports;
Object.assign(Zmodem, __webpack_require__(/*! ./zmlib */ 3568));

//encode() variables - declare them here so we don’t
//create them in the function.
var encode_cur, encode_todo;
const ZDLE = Zmodem.ZMLIB.ZDLE;

/**
 * Class that handles ZDLE encoding and decoding.
 * Encoding is subject to a given configuration--specifically, whether
 * we want to escape all control characters. Decoding is static; however
 * a given string is encoded we can always decode it.
 */
Zmodem.ZDLE = class ZmodemZDLE {
  /**
   * Create a ZDLE encoder.
   *
   * @param {object} [config] - The initial configuration.
   * @param {object} config.escape_ctrl_chars - Whether the ZDLE encoder
   *  should escape control characters.
   */
  constructor(config) {
    this._config = {};
    if (config) {
      this.set_escape_ctrl_chars(!!config.escape_ctrl_chars);
    }
  }

  /**
   * Enable or disable control-character escaping.
   * You should probably enable this for sender sessions.
   *
   * @param {boolean} value - Whether to enable (true) or disable (false).
   */
  set_escape_ctrl_chars(value) {
    if (typeof value !== "boolean") throw "need boolean!";
    if (value !== this._config.escape_ctrl_chars) {
      this._config.escape_ctrl_chars = value;
      this._setup_zdle_table();
    }
  }

  /**
   * Whether or not control-character escaping is enabled.
   *
   * @return {boolean} Whether the escaping is on (true) or off (false).
   */
  escapes_ctrl_chars() {
    return !!this._config.escape_ctrl_chars;
  }

  //I don’t know of any Zmodem implementations that use ZESC8
  //(“escape_8th_bit”)??

  /*
  ZMODEM software escapes ZDLE, 020, 0220, 021, 0221, 023, and 0223.  If
  preceded by 0100 or 0300 (@), 015 and 0215 are also escaped to protect the
  Telenet command escape CR-@-CR.
  */

  /**
   * Encode an array of octet values and return it.
   * This will mutate the given array.
   *
   * @param {number[]} octets - The octet values to transform.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *      This object is mutated in the function.
   *
   * @returns {number[]} The passed-in array, transformed. This is the
   *  same object that is passed in.
   */
  encode(octets) {
    //NB: Performance matters here!

    if (!this._zdle_table) throw "No ZDLE encode table configured!";
    var zdle_table = this._zdle_table;
    var last_code = this._lastcode;
    var arrbuf = new ArrayBuffer(2 * octets.length);
    var arrbuf_uint8 = new Uint8Array(arrbuf);
    var escctl_yn = this._config.escape_ctrl_chars;
    var arrbuf_i = 0;
    for (encode_cur = 0; encode_cur < octets.length; encode_cur++) {
      encode_todo = zdle_table[octets[encode_cur]];
      if (!encode_todo) {
        console.trace();
        console.error("bad encode() call:", JSON.stringify(octets));
        this._lastcode = last_code;
        throw "Invalid octet: " + octets[encode_cur];
      }
      last_code = octets[encode_cur];
      if (encode_todo === 1) {
        //Do nothing; we append last_code below.
      }

      //0x40 = '@'; i.e., only escape if the last
      //octet was '@'.
      else if (escctl_yn || encode_todo === 2 || (last_code & 0x7f) === 0x40) {
        arrbuf_uint8[arrbuf_i] = ZDLE;
        arrbuf_i++;
        last_code ^= 0x40; //0100
      }
      arrbuf_uint8[arrbuf_i] = last_code;
      arrbuf_i++;
    }
    this._lastcode = last_code;
    octets.splice(0);
    octets.push.apply(octets, new Uint8Array(arrbuf, 0, arrbuf_i));
    return octets;
  }

  /**
   * Decode an array of octet values and return it.
   * This will mutate the given array.
   *
   * @param {number[]} octets - The octet values to transform.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *      This object is mutated in the function.
   *
   * @returns {number[]} The passed-in array.
   *  This is the same object that is passed in.
   */
  static decode(octets) {
    for (var o = octets.length - 1; o >= 0; o--) {
      if (octets[o] === ZDLE) {
        octets.splice(o, 2, octets[o + 1] - 64);
      }
    }
    return octets;
  }

  /**
   * Remove, ZDLE-decode, and return bytes from the passed-in array.
   * If the requested number of ZDLE-encoded bytes isn’t available,
   * then the passed-in array is unmodified (and the return is undefined).
   *
   * @param {number[]} octets - The octet values to transform.
   *      Each array member should be an 8-bit unsigned integer (0-255).
   *      This object is mutated in the function.
   *
   * @param {number} offset - The number of (undecoded) bytes to skip
   *      at the beginning of the “octets” array.
   *
   * @param {number} count - The number of bytes (octet values) to return.
   *
   * @returns {number[]|undefined} An array with the requested number of
   *      decoded octet values, or undefined if that number of decoded
   *      octets isn’t available (given the passed-in offset).
   */
  static splice(octets, offset, count) {
    var so_far = 0;
    if (!offset) offset = 0;
    for (var i = offset; i < octets.length && so_far < count; i++) {
      so_far++;
      if (octets[i] === ZDLE) i++;
    }
    if (so_far === count) {
      //Don’t accept trailing ZDLE. This check works
      //because of the i++ logic above.
      if (octets.length === i - 1) return;
      octets.splice(0, offset);
      return ZmodemZDLE.decode(octets.splice(0, i - offset));
    }
    return;
  }
  _setup_zdle_table() {
    var zsendline_tab = new Array(256);
    for (var i = 0; i < zsendline_tab.length; i++) {
      //1 = never escape
      //2 = always escape
      //3 = escape only if the previous byte was '@'

      //Never escape characters from 0x20 (32) to 0x7f (127).
      //This is the range of printable characters, plus DEL.
      //I guess ZMODEM doesn’t consider DEL to be a control character?
      if (i & 0x60) {
        zsendline_tab[i] = 1;
      } else {
        switch (i) {
          case ZDLE: //NB: no (ZDLE | 0x80)
          case Zmodem.ZMLIB.XOFF:
          case Zmodem.ZMLIB.XON:
          case Zmodem.ZMLIB.XOFF | 0x80:
          case Zmodem.ZMLIB.XON | 0x80:
            zsendline_tab[i] = 2;
            break;
          case 0x10: // 020
          case 0x90:
            // 0220
            zsendline_tab[i] = this._config.turbo_escape ? 1 : 2;
            break;
          case 0x0d: // 015
          case 0x8d:
            // 0215
            zsendline_tab[i] = this._config.escape_ctrl_chars ? 2 : !this._config.turbo_escape ? 3 : 1;
            break;
          default:
            zsendline_tab[i] = this._config.escape_ctrl_chars ? 2 : 1;
        }
      }
    }
    this._zdle_table = zsendline_tab;
  }
};

/***/ },

/***/ 6564
/*!******************************************************!*\
  !*** ../app/node_modules/object-keys/isArguments.js ***!
  \******************************************************/
(module) {

"use strict";


var toStr = Object.prototype.toString;
module.exports = function isArguments(value) {
  var str = toStr.call(value);
  var isArgs = str === '[object Arguments]';
  if (!isArgs) {
    isArgs = str !== '[object Array]' && value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value.callee) === '[object Function]';
  }
  return isArgs;
};

/***/ },

/***/ 6565
/*!****************************************************!*\
  !*** ../app/node_modules/has-tostringtag/shams.js ***!
  \****************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var hasSymbols = __webpack_require__(/*! has-symbols/shams */ 9944);

/** @type {import('.')} */
module.exports = function hasToStringTagShams() {
  return hasSymbols() && !!Symbol.toStringTag;
};

/***/ },

/***/ 6627
/*!*********************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/terminalToolbar.component.pug?ngResource ***!
  \*********************************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cdiv class=\"content\" cdkDropList cdkAutoDropGroup=\"app-tabs\"\u003E\u003Ci class=\"fas fa-grip-vertical drag-handle\" *ngIf=\"shouldShowDragHandle\" cdkDrag [cdkDragData]=\"tab\" (cdkDragStarted)=\"onTabDragStart()\" (cdkDragEnded)=\"onTabDragEnd()\"\u003E\u003C\u002Fi\u003E\n  \u003Cng-content\u003E\u003C\u002Fng-content\u003E\n  \u003Cbutton class=\"btn btn-sm btn-link\" *ngIf=\"tab.enableToolbar\" (click)=\"tab.togglePinToolbar()\" (mouseenter)=\"tab.showToolbar()\" (mouseleave)=\"tab.hideToolbar()\"\u003E\u003Ci class=\"fas fa-thumbtack\"\u003E\u003C\u002Fi\u003E\u003Cspan *ngIf=\"tab.pinToolbar\" translate\u003EUnpin\u003C\u002Fspan\u003E\u003Cspan *ngIf=\"!tab.pinToolbar\" translate\u003EPin\u003C\u002Fspan\u003E\u003C\u002Fbutton\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 6654
/*!******************************************************!*\
  !*** ../app/node_modules/side-channel-list/index.js ***!
  \******************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var inspect = __webpack_require__(/*! object-inspect */ 3808);
var $TypeError = __webpack_require__(/*! es-errors/type */ 9176);

/*
* This function traverses the list returning the node corresponding to the given key.
*
* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.
* By doing so, all the recently used nodes can be accessed relatively quickly.
*/
/** @type {import('./list.d.ts').listGetNode} */
// eslint-disable-next-line consistent-return
var listGetNode = function (list, key, isDelete) {
  /** @type {typeof list | NonNullable<(typeof list)['next']>} */
  var prev = list;
  /** @type {(typeof list)['next']} */
  var curr;
  // eslint-disable-next-line eqeqeq
  for (; (curr = prev.next) != null; prev = curr) {
    if (curr.key === key) {
      prev.next = curr.next;
      if (!isDelete) {
        // eslint-disable-next-line no-extra-parens
        curr.next = /** @type {NonNullable<typeof list.next>} */list.next;
        list.next = curr; // eslint-disable-line no-param-reassign
      }
      return curr;
    }
  }
};

/** @type {import('./list.d.ts').listGet} */
var listGet = function (objects, key) {
  if (!objects) {
    return void undefined;
  }
  var node = listGetNode(objects, key);
  return node && node.value;
};
/** @type {import('./list.d.ts').listSet} */
var listSet = function (objects, key, value) {
  var node = listGetNode(objects, key);
  if (node) {
    node.value = value;
  } else {
    // Prepend the new node to the beginning of the list
    objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */{
      // eslint-disable-line no-param-reassign, no-extra-parens
      key: key,
      next: objects.next,
      value: value
    };
  }
};
/** @type {import('./list.d.ts').listHas} */
var listHas = function (objects, key) {
  if (!objects) {
    return false;
  }
  return !!listGetNode(objects, key);
};
/** @type {import('./list.d.ts').listDelete} */
// eslint-disable-next-line consistent-return
var listDelete = function (objects, key) {
  if (objects) {
    return listGetNode(objects, key, true);
  }
};

/** @type {import('.')} */
module.exports = function getSideChannelList() {
  /** @typedef {ReturnType<typeof getSideChannelList>} Channel */
  /** @typedef {Parameters<Channel['get']>[0]} K */
  /** @typedef {Parameters<Channel['set']>[1]} V */

  /** @type {import('./list.d.ts').RootNode<V, K> | undefined} */var $o;

  /** @type {Channel} */
  var channel = {
    assert: function (key) {
      if (!channel.has(key)) {
        throw new $TypeError('Side channel does not contain ' + inspect(key));
      }
    },
    'delete': function (key) {
      var root = $o && $o.next;
      var deletedNode = listDelete($o, key);
      if (deletedNode && root && root === deletedNode) {
        $o = void undefined;
      }
      return !!deletedNode;
    },
    get: function (key) {
      return listGet($o, key);
    },
    has: function (key) {
      return listHas($o, key);
    },
    set: function (key, value) {
      if (!$o) {
        // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
        $o = {
          next: void undefined
        };
      }
      // eslint-disable-next-line no-extra-parens
      listSet(/** @type {NonNullable<typeof $o>} */$o, key, value);
    }
  };
  // @ts-expect-error TODO: figure out why this is erroring
  return channel;
};

/***/ },

/***/ 6757
/*!*****************************************!*\
  !*** ../app/node_modules/uuid/index.js ***!
  \*****************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var v1 = __webpack_require__(/*! ./v1 */ 6392);
var v4 = __webpack_require__(/*! ./v4 */ 2443);
var uuid = v4;
uuid.v1 = v1;
uuid.v4 = v4;
module.exports = uuid;

/***/ },

/***/ 6775
/*!****************************************************************************************!*\
  !*** ../node_modules/css-loader/dist/cjs.js!./node_modules/@xterm/xterm/css/xterm.css ***!
  \****************************************************************************************/
(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ 1333);
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../node_modules/css-loader/dist/runtime/api.js */ 5955);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, "/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * https://github.com/chjj/term.js\n * @license MIT\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Originally forked from (with the author's permission):\n *   Fabrice Bellard's javascript vt100 for jslinux:\n *   http://bellard.org/jslinux/\n *   Copyright (c) 2011 Fabrice Bellard\n *   The original design remains. The terminal itself\n *   has been extended to include xterm CSI codes, among\n *   other features.\n */\n\n/**\n *  Default styles for xterm.js\n */\n\n.xterm {\n    cursor: text;\n    position: relative;\n    user-select: none;\n    -ms-user-select: none;\n    -webkit-user-select: none;\n}\n\n.xterm.focus,\n.xterm:focus {\n    outline: none;\n}\n\n.xterm .xterm-helpers {\n    position: absolute;\n    top: 0;\n    /**\n     * The z-index of the helpers must be higher than the canvases in order for\n     * IMEs to appear on top.\n     */\n    z-index: 5;\n}\n\n.xterm .xterm-helper-textarea {\n    padding: 0;\n    border: 0;\n    margin: 0;\n    /* Move textarea out of the screen to the far left, so that the cursor is not visible */\n    position: absolute;\n    opacity: 0;\n    left: -9999em;\n    top: 0;\n    width: 0;\n    height: 0;\n    z-index: -5;\n    /** Prevent wrapping so the IME appears against the textarea at the correct position */\n    white-space: nowrap;\n    overflow: hidden;\n    resize: none;\n}\n\n.xterm .composition-view {\n    /* TODO: Composition position got messed up somewhere */\n    background: #000;\n    color: #FFF;\n    display: none;\n    position: absolute;\n    white-space: nowrap;\n    z-index: 1;\n}\n\n.xterm .composition-view.active {\n    display: block;\n}\n\n.xterm .xterm-viewport {\n    /* On OS X this is required in order for the scroll bar to appear fully opaque */\n    background-color: #000;\n    overflow-y: scroll;\n    cursor: default;\n    position: absolute;\n    right: 0;\n    left: 0;\n    top: 0;\n    bottom: 0;\n}\n\n.xterm .xterm-screen {\n    position: relative;\n}\n\n.xterm .xterm-screen canvas {\n    position: absolute;\n    left: 0;\n    top: 0;\n}\n\n.xterm-char-measure-element {\n    display: inline-block;\n    visibility: hidden;\n    position: absolute;\n    top: 0;\n    left: -9999em;\n    line-height: normal;\n}\n\n.xterm.enable-mouse-events {\n    /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */\n    cursor: default;\n}\n\n.xterm.xterm-cursor-pointer,\n.xterm .xterm-cursor-pointer {\n    cursor: pointer;\n}\n\n.xterm.column-select.focus {\n    /* Column selection mode */\n    cursor: crosshair;\n}\n\n.xterm .xterm-accessibility:not(.debug),\n.xterm .xterm-message {\n    position: absolute;\n    left: 0;\n    top: 0;\n    bottom: 0;\n    right: 0;\n    z-index: 10;\n    color: transparent;\n    pointer-events: none;\n}\n\n.xterm .xterm-accessibility-tree:not(.debug) *::selection {\n  color: transparent;\n}\n\n.xterm .xterm-accessibility-tree {\n  font-family: monospace;\n  user-select: text;\n  white-space: pre;\n}\n\n.xterm .xterm-accessibility-tree > div {\n  transform-origin: left;\n  width: fit-content;\n}\n\n.xterm .live-region {\n    position: absolute;\n    left: -9999px;\n    width: 1px;\n    height: 1px;\n    overflow: hidden;\n}\n\n.xterm-dim {\n    /* Dim should not apply to background, so the opacity of the foreground color is applied\n     * explicitly in the generated class and reset to 1 here */\n    opacity: 1 !important;\n}\n\n.xterm-underline-1 { text-decoration: underline; }\n.xterm-underline-2 { text-decoration: double underline; }\n.xterm-underline-3 { text-decoration: wavy underline; }\n.xterm-underline-4 { text-decoration: dotted underline; }\n.xterm-underline-5 { text-decoration: dashed underline; }\n\n.xterm-overline {\n    text-decoration: overline;\n}\n\n.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }\n.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }\n.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }\n.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }\n.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }\n\n.xterm-strikethrough {\n    text-decoration: line-through;\n}\n\n.xterm-screen .xterm-decoration-container .xterm-decoration {\n\tz-index: 6;\n\tposition: absolute;\n}\n\n.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {\n\tz-index: 7;\n}\n\n.xterm-decoration-overview-ruler {\n    z-index: 8;\n    position: absolute;\n    top: 0;\n    right: 0;\n    pointer-events: none;\n}\n\n.xterm-decoration-top {\n    z-index: 2;\n    position: relative;\n}\n\n\n\n/* Derived from vs/base/browser/ui/scrollbar/media/scrollbar.css */\n\n/* xterm.js customization: Override xterm's cursor style */\n.xterm .xterm-scrollable-element > .scrollbar {\n    cursor: default;\n}\n\n/* Arrows */\n.xterm .xterm-scrollable-element > .scrollbar > .scra {\n\tcursor: pointer;\n\tfont-size: 11px !important;\n}\n\n.xterm .xterm-scrollable-element > .visible {\n\topacity: 1;\n\n\t/* Background rule added for IE9 - to allow clicks on dom node */\n\tbackground:rgba(0,0,0,0);\n\n\ttransition: opacity 100ms linear;\n\t/* In front of peek view */\n\tz-index: 11;\n}\n.xterm .xterm-scrollable-element > .invisible {\n\topacity: 0;\n\tpointer-events: none;\n}\n.xterm .xterm-scrollable-element > .invisible.fade {\n\ttransition: opacity 800ms linear;\n}\n\n/* Scrollable Content Inset Shadow */\n.xterm .xterm-scrollable-element > .shadow {\n\tposition: absolute;\n\tdisplay: none;\n}\n.xterm .xterm-scrollable-element > .shadow.top {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 3px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset;\n}\n.xterm .xterm-scrollable-element > .shadow.left {\n\tdisplay: block;\n\ttop: 3px;\n\tleft: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbox-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;\n}\n.xterm .xterm-scrollable-element > .shadow.top-left-corner {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 0;\n\theight: 3px;\n\twidth: 3px;\n}\n.xterm .xterm-scrollable-element > .shadow.top.left {\n\tbox-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;\n}\n", "",{"version":3,"sources":["webpack://./node_modules/@xterm/xterm/css/xterm.css"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BE;;AAEF;;EAEE;;AAEF;IACI,YAAY;IACZ,kBAAkB;IAClB,iBAAiB;IACjB,qBAAqB;IACrB,yBAAyB;AAC7B;;AAEA;;IAEI,aAAa;AACjB;;AAEA;IACI,kBAAkB;IAClB,MAAM;IACN;;;MAGE;IACF,UAAU;AACd;;AAEA;IACI,UAAU;IACV,SAAS;IACT,SAAS;IACT,uFAAuF;IACvF,kBAAkB;IAClB,UAAU;IACV,aAAa;IACb,MAAM;IACN,QAAQ;IACR,SAAS;IACT,WAAW;IACX,sFAAsF;IACtF,mBAAmB;IACnB,gBAAgB;IAChB,YAAY;AAChB;;AAEA;IACI,uDAAuD;IACvD,gBAAgB;IAChB,WAAW;IACX,aAAa;IACb,kBAAkB;IAClB,mBAAmB;IACnB,UAAU;AACd;;AAEA;IACI,cAAc;AAClB;;AAEA;IACI,gFAAgF;IAChF,sBAAsB;IACtB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;IAClB,QAAQ;IACR,OAAO;IACP,MAAM;IACN,SAAS;AACb;;AAEA;IACI,kBAAkB;AACtB;;AAEA;IACI,kBAAkB;IAClB,OAAO;IACP,MAAM;AACV;;AAEA;IACI,qBAAqB;IACrB,kBAAkB;IAClB,kBAAkB;IAClB,MAAM;IACN,aAAa;IACb,mBAAmB;AACvB;;AAEA;IACI,oFAAoF;IACpF,eAAe;AACnB;;AAEA;;IAEI,eAAe;AACnB;;AAEA;IACI,0BAA0B;IAC1B,iBAAiB;AACrB;;AAEA;;IAEI,kBAAkB;IAClB,OAAO;IACP,MAAM;IACN,SAAS;IACT,QAAQ;IACR,WAAW;IACX,kBAAkB;IAClB,oBAAoB;AACxB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,sBAAsB;EACtB,iBAAiB;EACjB,gBAAgB;AAClB;;AAEA;EACE,sBAAsB;EACtB,kBAAkB;AACpB;;AAEA;IACI,kBAAkB;IAClB,aAAa;IACb,UAAU;IACV,WAAW;IACX,gBAAgB;AACpB;;AAEA;IACI;8DAC0D;IAC1D,qBAAqB;AACzB;;AAEA,qBAAqB,0BAA0B,EAAE;AACjD,qBAAqB,iCAAiC,EAAE;AACxD,qBAAqB,+BAA+B,EAAE;AACtD,qBAAqB,iCAAiC,EAAE;AACxD,qBAAqB,iCAAiC,EAAE;;AAExD;IACI,yBAAyB;AAC7B;;AAEA,oCAAoC,mCAAmC,EAAE;AACzE,oCAAoC,0CAA0C,EAAE;AAChF,oCAAoC,wCAAwC,EAAE;AAC9E,oCAAoC,0CAA0C,EAAE;AAChF,oCAAoC,0CAA0C,EAAE;;AAEhF;IACI,6BAA6B;AACjC;;AAEA;CACC,UAAU;CACV,kBAAkB;AACnB;;AAEA;CACC,UAAU;AACX;;AAEA;IACI,UAAU;IACV,kBAAkB;IAClB,MAAM;IACN,QAAQ;IACR,oBAAoB;AACxB;;AAEA;IACI,UAAU;IACV,kBAAkB;AACtB;;;;AAIA,kEAAkE;;AAElE,0DAA0D;AAC1D;IACI,eAAe;AACnB;;AAEA,WAAW;AACX;CACC,eAAe;CACf,0BAA0B;AAC3B;;AAEA;CACC,UAAU;;CAEV,gEAAgE;CAChE,wBAAwB;;CAExB,gCAAgC;CAChC,0BAA0B;CAC1B,WAAW;AACZ;AACA;CACC,UAAU;CACV,oBAAoB;AACrB;AACA;CACC,gCAAgC;AACjC;;AAEA,oCAAoC;AACpC;CACC,kBAAkB;CAClB,aAAa;AACd;AACA;CACC,cAAc;CACd,MAAM;CACN,SAAS;CACT,WAAW;CACX,WAAW;CACX,qEAAqE;AACtE;AACA;CACC,cAAc;CACd,QAAQ;CACR,OAAO;CACP,YAAY;CACZ,UAAU;CACV,qEAAqE;AACtE;AACA;CACC,cAAc;CACd,MAAM;CACN,OAAO;CACP,WAAW;CACX,UAAU;AACX;AACA;CACC,qEAAqE;AACtE","sourcesContent":["/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * https://github.com/chjj/term.js\n * @license MIT\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Originally forked from (with the author's permission):\n *   Fabrice Bellard's javascript vt100 for jslinux:\n *   http://bellard.org/jslinux/\n *   Copyright (c) 2011 Fabrice Bellard\n *   The original design remains. The terminal itself\n *   has been extended to include xterm CSI codes, among\n *   other features.\n */\n\n/**\n *  Default styles for xterm.js\n */\n\n.xterm {\n    cursor: text;\n    position: relative;\n    user-select: none;\n    -ms-user-select: none;\n    -webkit-user-select: none;\n}\n\n.xterm.focus,\n.xterm:focus {\n    outline: none;\n}\n\n.xterm .xterm-helpers {\n    position: absolute;\n    top: 0;\n    /**\n     * The z-index of the helpers must be higher than the canvases in order for\n     * IMEs to appear on top.\n     */\n    z-index: 5;\n}\n\n.xterm .xterm-helper-textarea {\n    padding: 0;\n    border: 0;\n    margin: 0;\n    /* Move textarea out of the screen to the far left, so that the cursor is not visible */\n    position: absolute;\n    opacity: 0;\n    left: -9999em;\n    top: 0;\n    width: 0;\n    height: 0;\n    z-index: -5;\n    /** Prevent wrapping so the IME appears against the textarea at the correct position */\n    white-space: nowrap;\n    overflow: hidden;\n    resize: none;\n}\n\n.xterm .composition-view {\n    /* TODO: Composition position got messed up somewhere */\n    background: #000;\n    color: #FFF;\n    display: none;\n    position: absolute;\n    white-space: nowrap;\n    z-index: 1;\n}\n\n.xterm .composition-view.active {\n    display: block;\n}\n\n.xterm .xterm-viewport {\n    /* On OS X this is required in order for the scroll bar to appear fully opaque */\n    background-color: #000;\n    overflow-y: scroll;\n    cursor: default;\n    position: absolute;\n    right: 0;\n    left: 0;\n    top: 0;\n    bottom: 0;\n}\n\n.xterm .xterm-screen {\n    position: relative;\n}\n\n.xterm .xterm-screen canvas {\n    position: absolute;\n    left: 0;\n    top: 0;\n}\n\n.xterm-char-measure-element {\n    display: inline-block;\n    visibility: hidden;\n    position: absolute;\n    top: 0;\n    left: -9999em;\n    line-height: normal;\n}\n\n.xterm.enable-mouse-events {\n    /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */\n    cursor: default;\n}\n\n.xterm.xterm-cursor-pointer,\n.xterm .xterm-cursor-pointer {\n    cursor: pointer;\n}\n\n.xterm.column-select.focus {\n    /* Column selection mode */\n    cursor: crosshair;\n}\n\n.xterm .xterm-accessibility:not(.debug),\n.xterm .xterm-message {\n    position: absolute;\n    left: 0;\n    top: 0;\n    bottom: 0;\n    right: 0;\n    z-index: 10;\n    color: transparent;\n    pointer-events: none;\n}\n\n.xterm .xterm-accessibility-tree:not(.debug) *::selection {\n  color: transparent;\n}\n\n.xterm .xterm-accessibility-tree {\n  font-family: monospace;\n  user-select: text;\n  white-space: pre;\n}\n\n.xterm .xterm-accessibility-tree > div {\n  transform-origin: left;\n  width: fit-content;\n}\n\n.xterm .live-region {\n    position: absolute;\n    left: -9999px;\n    width: 1px;\n    height: 1px;\n    overflow: hidden;\n}\n\n.xterm-dim {\n    /* Dim should not apply to background, so the opacity of the foreground color is applied\n     * explicitly in the generated class and reset to 1 here */\n    opacity: 1 !important;\n}\n\n.xterm-underline-1 { text-decoration: underline; }\n.xterm-underline-2 { text-decoration: double underline; }\n.xterm-underline-3 { text-decoration: wavy underline; }\n.xterm-underline-4 { text-decoration: dotted underline; }\n.xterm-underline-5 { text-decoration: dashed underline; }\n\n.xterm-overline {\n    text-decoration: overline;\n}\n\n.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }\n.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }\n.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }\n.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }\n.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }\n\n.xterm-strikethrough {\n    text-decoration: line-through;\n}\n\n.xterm-screen .xterm-decoration-container .xterm-decoration {\n\tz-index: 6;\n\tposition: absolute;\n}\n\n.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {\n\tz-index: 7;\n}\n\n.xterm-decoration-overview-ruler {\n    z-index: 8;\n    position: absolute;\n    top: 0;\n    right: 0;\n    pointer-events: none;\n}\n\n.xterm-decoration-top {\n    z-index: 2;\n    position: relative;\n}\n\n\n\n/* Derived from vs/base/browser/ui/scrollbar/media/scrollbar.css */\n\n/* xterm.js customization: Override xterm's cursor style */\n.xterm .xterm-scrollable-element > .scrollbar {\n    cursor: default;\n}\n\n/* Arrows */\n.xterm .xterm-scrollable-element > .scrollbar > .scra {\n\tcursor: pointer;\n\tfont-size: 11px !important;\n}\n\n.xterm .xterm-scrollable-element > .visible {\n\topacity: 1;\n\n\t/* Background rule added for IE9 - to allow clicks on dom node */\n\tbackground:rgba(0,0,0,0);\n\n\ttransition: opacity 100ms linear;\n\t/* In front of peek view */\n\tz-index: 11;\n}\n.xterm .xterm-scrollable-element > .invisible {\n\topacity: 0;\n\tpointer-events: none;\n}\n.xterm .xterm-scrollable-element > .invisible.fade {\n\ttransition: opacity 800ms linear;\n}\n\n/* Scrollable Content Inset Shadow */\n.xterm .xterm-scrollable-element > .shadow {\n\tposition: absolute;\n\tdisplay: none;\n}\n.xterm .xterm-scrollable-element > .shadow.top {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 3px;\n\theight: 3px;\n\twidth: 100%;\n\tbox-shadow: var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset;\n}\n.xterm .xterm-scrollable-element > .shadow.left {\n\tdisplay: block;\n\ttop: 3px;\n\tleft: 0;\n\theight: 100%;\n\twidth: 3px;\n\tbox-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;\n}\n.xterm .xterm-scrollable-element > .shadow.top-left-corner {\n\tdisplay: block;\n\ttop: 0;\n\tleft: 0;\n\theight: 3px;\n\twidth: 3px;\n}\n.xterm .xterm-scrollable-element > .shadow.top.left {\n\tbox-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ },

/***/ 6803
/*!********************************************************************!*\
  !*** ../app/node_modules/call-bind-apply-helpers/functionApply.js ***!
  \********************************************************************/
(module) {

"use strict";


/** @type {import('./functionApply')} */
module.exports = Function.prototype.apply;

/***/ },

/***/ 6852
/*!**************************************************!*\
  !*** ../app/node_modules/get-intrinsic/index.js ***!
  \**************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var undefined;
var $Object = __webpack_require__(/*! es-object-atoms */ 2897);
var $Error = __webpack_require__(/*! es-errors */ 8458);
var $EvalError = __webpack_require__(/*! es-errors/eval */ 1578);
var $RangeError = __webpack_require__(/*! es-errors/range */ 4031);
var $ReferenceError = __webpack_require__(/*! es-errors/ref */ 2323);
var $SyntaxError = __webpack_require__(/*! es-errors/syntax */ 6543);
var $TypeError = __webpack_require__(/*! es-errors/type */ 9176);
var $URIError = __webpack_require__(/*! es-errors/uri */ 9448);
var abs = __webpack_require__(/*! math-intrinsics/abs */ 9683);
var floor = __webpack_require__(/*! math-intrinsics/floor */ 3413);
var max = __webpack_require__(/*! math-intrinsics/max */ 9197);
var min = __webpack_require__(/*! math-intrinsics/min */ 743);
var pow = __webpack_require__(/*! math-intrinsics/pow */ 3629);
var round = __webpack_require__(/*! math-intrinsics/round */ 6107);
var sign = __webpack_require__(/*! math-intrinsics/sign */ 5534);
var $Function = Function;

// eslint-disable-next-line consistent-return
var getEvalledConstructor = function (expressionSyntax) {
  try {
    return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
  } catch (e) {}
};
var $gOPD = __webpack_require__(/*! gopd */ 1284);
var $defineProperty = __webpack_require__(/*! es-define-property */ 5832);
var throwTypeError = function () {
  throw new $TypeError();
};
var ThrowTypeError = $gOPD ? function () {
  try {
    // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
    arguments.callee; // IE 8 does not throw here
    return throwTypeError;
  } catch (calleeThrows) {
    try {
      // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
      return $gOPD(arguments, 'callee').get;
    } catch (gOPDthrows) {
      return throwTypeError;
    }
  }
}() : throwTypeError;
var hasSymbols = __webpack_require__(/*! has-symbols */ 8354)();
var getProto = __webpack_require__(/*! get-proto */ 3077);
var $ObjectGPO = __webpack_require__(/*! get-proto/Object.getPrototypeOf */ 6557);
var $ReflectGPO = __webpack_require__(/*! get-proto/Reflect.getPrototypeOf */ 2007);
var $apply = __webpack_require__(/*! call-bind-apply-helpers/functionApply */ 6803);
var $call = __webpack_require__(/*! call-bind-apply-helpers/functionCall */ 711);
var needsEval = {};
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
var INTRINSICS = {
  __proto__: null,
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
  '%Array%': Array,
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
  '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
  '%AsyncFromSyncIteratorPrototype%': undefined,
  '%AsyncFunction%': needsEval,
  '%AsyncGenerator%': needsEval,
  '%AsyncGeneratorFunction%': needsEval,
  '%AsyncIteratorPrototype%': needsEval,
  '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
  '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
  '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
  '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
  '%Boolean%': Boolean,
  '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
  '%Date%': Date,
  '%decodeURI%': decodeURI,
  '%decodeURIComponent%': decodeURIComponent,
  '%encodeURI%': encodeURI,
  '%encodeURIComponent%': encodeURIComponent,
  '%Error%': $Error,
  '%eval%': eval,
  // eslint-disable-line no-eval
  '%EvalError%': $EvalError,
  '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array,
  '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
  '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
  '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
  '%Function%': $Function,
  '%GeneratorFunction%': needsEval,
  '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
  '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
  '%isFinite%': isFinite,
  '%isNaN%': isNaN,
  '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
  '%JSON%': typeof JSON === 'object' ? JSON : undefined,
  '%Map%': typeof Map === 'undefined' ? undefined : Map,
  '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
  '%Math%': Math,
  '%Number%': Number,
  '%Object%': $Object,
  '%Object.getOwnPropertyDescriptor%': $gOPD,
  '%parseFloat%': parseFloat,
  '%parseInt%': parseInt,
  '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
  '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
  '%RangeError%': $RangeError,
  '%ReferenceError%': $ReferenceError,
  '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
  '%RegExp%': RegExp,
  '%Set%': typeof Set === 'undefined' ? undefined : Set,
  '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
  '%String%': String,
  '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
  '%Symbol%': hasSymbols ? Symbol : undefined,
  '%SyntaxError%': $SyntaxError,
  '%ThrowTypeError%': ThrowTypeError,
  '%TypedArray%': TypedArray,
  '%TypeError%': $TypeError,
  '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
  '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
  '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
  '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
  '%URIError%': $URIError,
  '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
  '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
  '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
  '%Function.prototype.call%': $call,
  '%Function.prototype.apply%': $apply,
  '%Object.defineProperty%': $defineProperty,
  '%Object.getPrototypeOf%': $ObjectGPO,
  '%Math.abs%': abs,
  '%Math.floor%': floor,
  '%Math.max%': max,
  '%Math.min%': min,
  '%Math.pow%': pow,
  '%Math.round%': round,
  '%Math.sign%': sign,
  '%Reflect.getPrototypeOf%': $ReflectGPO
};
if (getProto) {
  try {
    null.error; // eslint-disable-line no-unused-expressions
  } catch (e) {
    // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
    var errorProto = getProto(getProto(e));
    INTRINSICS['%Error.prototype%'] = errorProto;
  }
}
var doEval = function doEval(name) {
  var value;
  if (name === '%AsyncFunction%') {
    value = getEvalledConstructor('async function () {}');
  } else if (name === '%GeneratorFunction%') {
    value = getEvalledConstructor('function* () {}');
  } else if (name === '%AsyncGeneratorFunction%') {
    value = getEvalledConstructor('async function* () {}');
  } else if (name === '%AsyncGenerator%') {
    var fn = doEval('%AsyncGeneratorFunction%');
    if (fn) {
      value = fn.prototype;
    }
  } else if (name === '%AsyncIteratorPrototype%') {
    var gen = doEval('%AsyncGenerator%');
    if (gen && getProto) {
      value = getProto(gen.prototype);
    }
  }
  INTRINSICS[name] = value;
  return value;
};
var LEGACY_ALIASES = {
  __proto__: null,
  '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
  '%ArrayPrototype%': ['Array', 'prototype'],
  '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
  '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
  '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
  '%ArrayProto_values%': ['Array', 'prototype', 'values'],
  '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
  '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
  '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
  '%BooleanPrototype%': ['Boolean', 'prototype'],
  '%DataViewPrototype%': ['DataView', 'prototype'],
  '%DatePrototype%': ['Date', 'prototype'],
  '%ErrorPrototype%': ['Error', 'prototype'],
  '%EvalErrorPrototype%': ['EvalError', 'prototype'],
  '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
  '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
  '%FunctionPrototype%': ['Function', 'prototype'],
  '%Generator%': ['GeneratorFunction', 'prototype'],
  '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
  '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
  '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
  '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
  '%JSONParse%': ['JSON', 'parse'],
  '%JSONStringify%': ['JSON', 'stringify'],
  '%MapPrototype%': ['Map', 'prototype'],
  '%NumberPrototype%': ['Number', 'prototype'],
  '%ObjectPrototype%': ['Object', 'prototype'],
  '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
  '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
  '%PromisePrototype%': ['Promise', 'prototype'],
  '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
  '%Promise_all%': ['Promise', 'all'],
  '%Promise_reject%': ['Promise', 'reject'],
  '%Promise_resolve%': ['Promise', 'resolve'],
  '%RangeErrorPrototype%': ['RangeError', 'prototype'],
  '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
  '%RegExpPrototype%': ['RegExp', 'prototype'],
  '%SetPrototype%': ['Set', 'prototype'],
  '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
  '%StringPrototype%': ['String', 'prototype'],
  '%SymbolPrototype%': ['Symbol', 'prototype'],
  '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
  '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
  '%TypeErrorPrototype%': ['TypeError', 'prototype'],
  '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
  '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
  '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
  '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
  '%URIErrorPrototype%': ['URIError', 'prototype'],
  '%WeakMapPrototype%': ['WeakMap', 'prototype'],
  '%WeakSetPrototype%': ['WeakSet', 'prototype']
};
var bind = __webpack_require__(/*! function-bind */ 438);
var hasOwn = __webpack_require__(/*! hasown */ 1766);
var $concat = bind.call($call, Array.prototype.concat);
var $spliceApply = bind.call($apply, Array.prototype.splice);
var $replace = bind.call($call, String.prototype.replace);
var $strSlice = bind.call($call, String.prototype.slice);
var $exec = bind.call($call, RegExp.prototype.exec);

/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
var stringToPath = function stringToPath(string) {
  var first = $strSlice(string, 0, 1);
  var last = $strSlice(string, -1);
  if (first === '%' && last !== '%') {
    throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
  } else if (last === '%' && first !== '%') {
    throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
  }
  var result = [];
  $replace(string, rePropName, function (match, number, quote, subString) {
    result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
  });
  return result;
};
/* end adaptation */

var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
  var intrinsicName = name;
  var alias;
  if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
    alias = LEGACY_ALIASES[intrinsicName];
    intrinsicName = '%' + alias[0] + '%';
  }
  if (hasOwn(INTRINSICS, intrinsicName)) {
    var value = INTRINSICS[intrinsicName];
    if (value === needsEval) {
      value = doEval(intrinsicName);
    }
    if (typeof value === 'undefined' && !allowMissing) {
      throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
    }
    return {
      alias: alias,
      name: intrinsicName,
      value: value
    };
  }
  throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
};
module.exports = function GetIntrinsic(name, allowMissing) {
  if (typeof name !== 'string' || name.length === 0) {
    throw new $TypeError('intrinsic name must be a non-empty string');
  }
  if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
    throw new $TypeError('"allowMissing" argument must be a boolean');
  }
  if ($exec(/^%?[^%]*%?$/, name) === null) {
    throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
  }
  var parts = stringToPath(name);
  var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
  var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
  var intrinsicRealName = intrinsic.name;
  var value = intrinsic.value;
  var skipFurtherCaching = false;
  var alias = intrinsic.alias;
  if (alias) {
    intrinsicBaseName = alias[0];
    $spliceApply(parts, $concat([0, 1], alias));
  }
  for (var i = 1, isOwn = true; i < parts.length; i += 1) {
    var part = parts[i];
    var first = $strSlice(part, 0, 1);
    var last = $strSlice(part, -1);
    if ((first === '"' || first === "'" || first === '`' || last === '"' || last === "'" || last === '`') && first !== last) {
      throw new $SyntaxError('property names with quotes must have matching quotes');
    }
    if (part === 'constructor' || !isOwn) {
      skipFurtherCaching = true;
    }
    intrinsicBaseName += '.' + part;
    intrinsicRealName = '%' + intrinsicBaseName + '%';
    if (hasOwn(INTRINSICS, intrinsicRealName)) {
      value = INTRINSICS[intrinsicRealName];
    } else if (value != null) {
      if (!(part in value)) {
        if (!allowMissing) {
          throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
        }
        return void undefined;
      }
      if ($gOPD && i + 1 >= parts.length) {
        var desc = $gOPD(value, part);
        isOwn = !!desc;

        // By convention, when a data property is converted to an accessor
        // property to emulate a data property that does not suffer from
        // the override mistake, that accessor's getter is marked with
        // an `originalValue` property. Here, when we detect this, we
        // uphold the illusion by pretending to see that original data
        // property, i.e., returning the value rather than the getter
        // itself.
        if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
          value = desc.get;
        } else {
          value = value[part];
        }
      } else {
        isOwn = hasOwn(value, part);
        value = value[part];
      }
      if (isOwn && !skipFurtherCaching) {
        INTRINSICS[intrinsicRealName] = value;
      }
    }
  }
  return value;
};

/***/ },

/***/ 6919
/*!**************************************************************!*\
  !*** ../app/node_modules/regexp.prototype.flags/polyfill.js ***!
  \**************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var implementation = __webpack_require__(/*! ./implementation */ 3606);
var supportsDescriptors = (__webpack_require__(/*! define-properties */ 2445).supportsDescriptors);
var $gOPD = Object.getOwnPropertyDescriptor;
module.exports = function getPolyfill() {
  if (supportsDescriptors && /a/mig.flags === 'gim') {
    var descriptor = $gOPD(RegExp.prototype, 'flags');
    if (descriptor && typeof descriptor.get === 'function' && 'dotAll' in RegExp.prototype && 'hasIndices' in RegExp.prototype) {
      /* eslint getter-return: 0 */
      var calls = '';
      var o = {};
      Object.defineProperty(o, 'hasIndices', {
        get: function () {
          calls += 'd';
        }
      });
      Object.defineProperty(o, 'sticky', {
        get: function () {
          calls += 'y';
        }
      });
      descriptor.get.call(o);
      if (calls === 'dy') {
        return descriptor.get;
      }
    }
  }
  return implementation;
};

/***/ },

/***/ 6925
/*!*************************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/colorSchemeSelector.component.pug?ngResource ***!
  \*************************************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cdiv class=\"head\"\u003E\n  \u003Cdiv class=\"bg-dark p-3 mb-4\" *ngIf=\"model != undefined\"\u003E\n    \u003Cdiv class=\"d-flex align-items-center\"\u003E\u003Cspan\u003E{{model.name}}\u003C\u002Fspan\u003E\n      \u003Cdiv class=\"me-auto\"\u003E\u003C\u002Fdiv\u003E\u003Ca class=\"btn-link\" (click)=\"selectScheme(undefined); $event.preventDefault()\" href=\"#\" translate\u003EClear\u003C\u002Fa\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ccolor-scheme-preview [scheme]=\"model\"\u003E\u003C\u002Fcolor-scheme-preview\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"input-group mb-3\"\u003E\n    \u003Cdiv class=\"input-group-text\"\u003E\u003Ci class=\"fas fa-fw fa-search\"\u003E\u003C\u002Fi\u003E\u003C\u002Fdiv\u003E\n    \u003Cinput class=\"form-control\" type=\"search\" [placeholder]=\"&quot;Search color schemes&quot;|translate\" [(ngModel)]=\"filter\"\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"body\"\u003E\n  \u003Cdiv class=\"list-group list-group-light mb-3\"\u003E\n    \u003Cng-container *ngFor=\"let scheme of allColorSchemes\"\u003E\n      \u003Cdiv class=\"list-group-item list-group-item-action\" [hidden]=\"filter &amp;&amp; !scheme.name.toLowerCase().includes(filter.toLowerCase())\" (click)=\"selectScheme(scheme)\"\u003E\n        \u003Cdiv class=\"d-flex w-100 align-items-center\"\u003E\u003Ci class=\"fas fa-fw\" [class.fa-check]=\"model?.name === scheme.name\"\u003E\u003C\u002Fi\u003E\n          \u003Cdiv class=\"ms-2\"\u003E\u003C\u002Fdiv\u003E\n          \u003Cdiv class=\"me-auto\"\u003E{{scheme.name}}\u003C\u002Fdiv\u003E\n        \u003C\u002Fdiv\u003E\n        \u003Ccolor-scheme-preview [scheme]=\"scheme\"\u003E\u003C\u002Fcolor-scheme-preview\u003E\n      \u003C\u002Fdiv\u003E\n    \u003C\u002Fng-container\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 6980
/*!******************************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/streamProcessingSettings.component.pug?ngResource ***!
  \******************************************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cdiv class=\"form-line\"\u003E\n  \u003Cdiv class=\"header\"\u003E\n    \u003Cdiv class=\"title\" translate\u003EInput mode\u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"d-flex\" ngbDropdown\u003E\n    \u003Cbutton class=\"btn btn-secondary btn-tab-bar\" ngbDropdownToggle\u003E{{getInputModeName(options.inputMode)}}\u003C\u002Fbutton\u003E\n    \u003Cdiv ngbDropdownMenu\u003E\u003Ca class=\"d-flex flex-column\" *ngFor=\"let mode of inputModes\" (click)=\"setInputMode(mode.key)\" ngbDropdownItem\u003E\n        \u003Cdiv\u003E{{mode.name|translate}}\u003C\u002Fdiv\u003E\n        \u003Cdiv class=\"text-muted\"\u003E{{mode.description|translate}}\u003C\u002Fdiv\u003E\u003C\u002Fa\u003E\u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"form-line\"\u003E\n  \u003Cdiv class=\"header\"\u003E\n    \u003Cdiv class=\"title\" translate\u003EInput newlines\u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cselect class=\"form-control\" [(ngModel)]=\"options.inputNewlines\"\u003E\n    \u003Coption [ngValue]=\"mode.key\" *ngFor=\"let mode of newlineModes\"\u003E{{mode.name|translate}}\u003C\u002Foption\u003E\n  \u003C\u002Fselect\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"form-line\"\u003E\n  \u003Cdiv class=\"header\"\u003E\n    \u003Cdiv class=\"title\" translate\u003EOutput mode\u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"d-flex\" ngbDropdown\u003E\n    \u003Cbutton class=\"btn btn-secondary btn-tab-bar\" ngbDropdownToggle\u003E{{getOutputModeName(options.outputMode)}}\u003C\u002Fbutton\u003E\n    \u003Cdiv ngbDropdownMenu\u003E\u003Ca class=\"d-flex flex-column\" *ngFor=\"let mode of outputModes\" (click)=\"setOutputMode(mode.key)\" ngbDropdownItem\u003E\n        \u003Cdiv\u003E{{mode.name|translate}}\u003C\u002Fdiv\u003E\n        \u003Cdiv class=\"text-muted\"\u003E{{mode.description|translate}}\u003C\u002Fdiv\u003E\u003C\u002Fa\u003E\u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"form-line\"\u003E\n  \u003Cdiv class=\"header\"\u003E\n    \u003Cdiv class=\"title\" translate\u003EOutput newlines\u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cselect class=\"form-control\" [(ngModel)]=\"options.outputNewlines\"\u003E\n    \u003Coption [ngValue]=\"mode.key\" *ngFor=\"let mode of newlineModes\"\u003E{{mode.name|translate}}\u003C\u002Foption\u003E\n  \u003C\u002Fselect\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 6982
/*!*************************!*\
  !*** external "crypto" ***!
  \*************************/
(module) {

"use strict";
module.exports = require("crypto");

/***/ },

/***/ 7061
/*!*************************************************************************************************************************************************!*\
  !*** ../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./src/components/terminalToolbar.component.scss?ngResource ***!
  \*************************************************************************************************************************************************/
(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ 1333);
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ 5955);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ":host{padding:5px 15px 5px 15px;display:flex;z-index:3;overflow:hidden}:host ::ng-deep .btn{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.content{flex-grow:1;display:flex;align-items:center}.drag-handle{margin:0 10px 0 0;cursor:move;opacity:.3}", "",{"version":3,"sources":["webpack://./src/components/terminalToolbar.component.scss"],"names":[],"mappings":"AAAA,MACI,yBAAA,CACA,YAAA,CACA,SAAA,CACA,eAAA,CAEA,qBACI,kBAAA,CACA,sBAAA,CACA,eAAA,CAIR,SACI,WAAA,CACA,YAAA,CACA,kBAAA,CAGJ,aACI,iBAAA,CACA,WAAA,CACA,UAAA","sourcesContent":[":host {\n    padding: 5px 15px 5px 15px;\n    display: flex;\n    z-index: 3;\n    overflow: hidden;\n\n    ::ng-deep .btn {\n        white-space: nowrap;\n        text-overflow: ellipsis;\n        overflow: hidden;\n    }\n}\n\n.content {\n    flex-grow: 1;\n    display: flex;\n    align-items: center;\n}\n\n.drag-handle {\n    margin: 0 10px 0 0;\n    cursor: move;\n    opacity: .3;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ },

/***/ 7129
/*!*************************************************************!*\
  !*** ./src/components/searchPanel.component.pug?ngResource ***!
  \*************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/searchPanel.component.pug?ngResource */ 9250);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 7182
/*!*********************************!*\
  !*** external "@angular/forms" ***!
  \*********************************/
(module) {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__7182__;

/***/ },

/***/ 7417
/*!***************************************************!*\
  !*** ./node_modules/zmodem.js/src/zvalidation.js ***!
  \***************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var Zmodem = module.exports;
Object.assign(Zmodem, __webpack_require__(/*! ./zerror */ 3478));
const LOOKS_LIKE_ZMODEM_HEADER = /\*\x18[AC]|\*\*\x18B/;
function _validate_number(key, value) {
  if (value < 0) {
    throw new Zmodem.Error("validation", "“" + key + "” (" + value + ") must be nonnegative.");
  }
  if (value !== Math.floor(value)) {
    throw new Zmodem.Error("validation", "“" + key + "” (" + value + ") must be an integer.");
  }
}

/** Validation logic for zmodem.js
 *
 * @exports Validation
 */
Zmodem.Validation = {
  /**
   * Validates and normalizes a set of parameters for an offer to send.
   * NOTE: This returns “mtime” as epoch seconds, not a Date. This is
   * inconsistent with the get_details() method in Session, but it’s
   * more useful for sending over the wire.
   *
   * @param {FileDetails} params - The file details. Some fairly trivial
   * variances from the specification are allowed.
   *
   * @return {FileDetails} The parameters that should be sent. `mtime`
   * will be a Date rather than a number.
   */
  offer_parameters: function offer_parameters(params) {
    if (!params.name) {
      throw new Zmodem.Error("validation", "Need “name”!");
    }
    if (typeof params.name !== "string") {
      throw new Zmodem.Error("validation", "“name” (" + params.name + ") must be a string!");
    }

    //So that we can override values as is useful
    //without affecting the passed-in object.
    params = Object.assign({}, params);
    if (LOOKS_LIKE_ZMODEM_HEADER.test(params.name)) {
      console.warn("The filename " + JSON.stringify(name) + " contains characters that look like a ZMODEM header. This could corrupt the ZMODEM session; consider renaming it so that the filename doesn’t contain control characters.");
    }
    if (params.serial !== null && params.serial !== undefined) {
      throw new Zmodem.Error("validation", "“serial” is meaningless.");
    }
    params.serial = null;
    ["size", "mode", "files_remaining", "bytes_remaining"].forEach(function (k) {
      var ok;
      switch (typeof params[k]) {
        case "object":
          ok = params[k] === null;
          break;
        case "undefined":
          params[k] = null;
          ok = true;
          break;
        case "number":
          _validate_number(k, params[k]);
          ok = true;
          break;
      }
      if (!ok) {
        throw new Zmodem.Error("validation", "“" + k + "” (" + params[k] + ") must be null, undefined, or a number.");
      }
    });
    if (typeof params.mode === "number") {
      params.mode |= 0x8000;
    }
    if (params.files_remaining === 0) {
      throw new Zmodem.Error("validation", "“files_remaining”, if given, must be positive.");
    }
    var mtime_ok;
    switch (typeof params.mtime) {
      case "object":
        mtime_ok = true;
        if (params.mtime instanceof Date) {
          var date_obj = params.mtime;
          params.mtime = Math.floor(date_obj.getTime() / 1000);
          if (params.mtime < 0) {
            throw new Zmodem.Error("validation", "“mtime” (" + date_obj + ") must not be earlier than 1970.");
          }
        } else if (params.mtime !== null) {
          mtime_ok = false;
        }
        break;
      case "undefined":
        params.mtime = null;
        mtime_ok = true;
        break;
      case "number":
        _validate_number("mtime", params.mtime);
        mtime_ok = true;
        break;
    }
    if (!mtime_ok) {
      throw new Zmodem.Error("validation", "“mtime” (" + params.mtime + ") must be null, undefined, a Date, or a number.");
    }
    return params;
  }
};

/***/ },

/***/ 7528
/*!*********************************************************!*\
  !*** ../app/node_modules/side-channel-weakmap/index.js ***!
  \*********************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ 6852);
var callBound = __webpack_require__(/*! call-bound */ 4731);
var inspect = __webpack_require__(/*! object-inspect */ 3808);
var getSideChannelMap = __webpack_require__(/*! side-channel-map */ 3688);
var $TypeError = __webpack_require__(/*! es-errors/type */ 9176);
var $WeakMap = GetIntrinsic('%WeakMap%', true);

/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
var $weakMapGet = callBound('WeakMap.prototype.get', true);
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
var $weakMapSet = callBound('WeakMap.prototype.set', true);
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
var $weakMapHas = callBound('WeakMap.prototype.has', true);
/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
var $weakMapDelete = callBound('WeakMap.prototype.delete', true);

/** @type {import('.')} */
module.exports = $WeakMap ? /** @type {Exclude<import('.'), false>} */function getSideChannelWeakMap() {
  /** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */
  /** @typedef {Parameters<Channel['get']>[0]} K */
  /** @typedef {Parameters<Channel['set']>[1]} V */

  /** @type {WeakMap<K & object, V> | undefined} */var $wm;
  /** @type {Channel | undefined} */
  var $m;

  /** @type {Channel} */
  var channel = {
    assert: function (key) {
      if (!channel.has(key)) {
        throw new $TypeError('Side channel does not contain ' + inspect(key));
      }
    },
    'delete': function (key) {
      if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
        if ($wm) {
          return $weakMapDelete($wm, key);
        }
      } else if (getSideChannelMap) {
        if ($m) {
          return $m['delete'](key);
        }
      }
      return false;
    },
    get: function (key) {
      if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
        if ($wm) {
          return $weakMapGet($wm, key);
        }
      }
      return $m && $m.get(key);
    },
    has: function (key) {
      if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
        if ($wm) {
          return $weakMapHas($wm, key);
        }
      }
      return !!$m && $m.has(key);
    },
    set: function (key, value) {
      if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
        if (!$wm) {
          $wm = new $WeakMap();
        }
        $weakMapSet($wm, key, value);
      } else if (getSideChannelMap) {
        if (!$m) {
          $m = getSideChannelMap();
        }
        // eslint-disable-next-line no-extra-parens
        /** @type {NonNullable<typeof $m>} */
        $m.set(key, value);
      }
    }
  };

  // @ts-expect-error TODO: figure out why this is erroring
  return channel;
} : getSideChannelMap;

/***/ },

/***/ 7554
/*!*****************************************************!*\
  !*** ../app/node_modules/which-collection/index.js ***!
  \*****************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var isMap = __webpack_require__(/*! is-map */ 4749);
var isSet = __webpack_require__(/*! is-set */ 2595);
var isWeakMap = __webpack_require__(/*! is-weakmap */ 681);
var isWeakSet = __webpack_require__(/*! is-weakset */ 3607);

/** @type {import('.')} */
module.exports = function whichCollection(/** @type {unknown} */value) {
  if (value && typeof value === 'object') {
    if (isMap(value)) {
      return 'Map';
    }
    if (isSet(value)) {
      return 'Set';
    }
    if (isWeakMap(value)) {
      return 'WeakMap';
    }
    if (isWeakSet(value)) {
      return 'WeakSet';
    }
  }
  return false;
};

/***/ },

/***/ 7562
/*!******************************************!*\
  !*** ../node_modules/slugify/slugify.js ***!
  \******************************************/
(module) {

;
(function (name, root, factory) {
  if (true) {
    module.exports = factory();
    module.exports["default"] = factory();
  }
  /* istanbul ignore next */else // removed by dead control flow
{}
})('slugify', this, function () {
  var charMap = JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","ǈ":"LJ","ǉ":"lj","ǋ":"NJ","ǌ":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E\'","Ը":"Y\'","Թ":"T\'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C\'","Կ":"K","Հ":"H","Ձ":"D\'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R\'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P\'","Ք":"Q\'","Օ":"O\'\'","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"\'","’":"\'","“":"\\\"","”":"\\\"","„":"\\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}');
  var locales = JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');
  function replace(string, options) {
    if (typeof string !== 'string') {
      throw new Error('slugify: string argument expected');
    }
    options = typeof options === 'string' ? {
      replacement: options
    } : options || {};
    var locale = locales[options.locale] || {};
    var replacement = options.replacement === undefined ? '-' : options.replacement;
    var trim = options.trim === undefined ? true : options.trim;
    var slug = string.normalize().split('')
    // replace characters based on charMap
    .reduce(function (result, ch) {
      var appendChar = locale[ch];
      if (appendChar === undefined) appendChar = charMap[ch];
      if (appendChar === undefined) appendChar = ch;
      if (appendChar === replacement) appendChar = ' ';
      return result + appendChar
      // remove not allowed characters
      .replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]+/g, '');
    }, '');
    if (options.strict) {
      slug = slug.replace(/[^A-Za-z0-9\s]/g, '');
    }
    if (trim) {
      slug = slug.trim();
    }

    // Replace spaces with replacement character, treating multiple consecutive
    // spaces as a single space.
    slug = slug.replace(/\s+/g, replacement);
    if (options.lower) {
      slug = slug.toLowerCase();
    }
    return slug;
  }
  replace.extend = function (customMap) {
    Object.assign(charMap, customMap);
  };
  return replace;
});

/***/ },

/***/ 7567
/*!************************************************!*\
  !*** ../app/node_modules/has-bigints/index.js ***!
  \************************************************/
(module) {

"use strict";


var $BigInt = typeof BigInt !== 'undefined' && BigInt;

/** @type {import('.')} */
module.exports = function hasNativeBigInts() {
  return typeof $BigInt === 'function' && typeof BigInt === 'function' && typeof $BigInt(42) === 'bigint' // eslint-disable-line no-magic-numbers
  && typeof BigInt(42) === 'bigint'; // eslint-disable-line no-magic-numbers
};

/***/ },

/***/ 7603
/*!*********************************************!*\
  !*** ./node_modules/ansi-colors/symbols.js ***!
  \*********************************************/
(module) {

"use strict";


const isHyper = typeof process !== 'undefined' && process.env.TERM_PROGRAM === 'Hyper';
const isWindows = typeof process !== 'undefined' && process.platform === 'win32';
const isLinux = typeof process !== 'undefined' && process.platform === 'linux';
const common = {
  ballotDisabled: '☒',
  ballotOff: '☐',
  ballotOn: '☑',
  bullet: '•',
  bulletWhite: '◦',
  fullBlock: '█',
  heart: '❤',
  identicalTo: '≡',
  line: '─',
  mark: '※',
  middot: '·',
  minus: '－',
  multiplication: '×',
  obelus: '÷',
  pencilDownRight: '✎',
  pencilRight: '✏',
  pencilUpRight: '✐',
  percent: '%',
  pilcrow2: '❡',
  pilcrow: '¶',
  plusMinus: '±',
  question: '?',
  section: '§',
  starsOff: '☆',
  starsOn: '★',
  upDownArrow: '↕'
};
const windows = Object.assign({}, common, {
  check: '√',
  cross: '×',
  ellipsisLarge: '...',
  ellipsis: '...',
  info: 'i',
  questionSmall: '?',
  pointer: '>',
  pointerSmall: '»',
  radioOff: '( )',
  radioOn: '(*)',
  warning: '‼'
});
const other = Object.assign({}, common, {
  ballotCross: '✘',
  check: '✔',
  cross: '✖',
  ellipsisLarge: '⋯',
  ellipsis: '…',
  info: 'ℹ',
  questionFull: '？',
  questionSmall: '﹖',
  pointer: isLinux ? '▸' : '❯',
  pointerSmall: isLinux ? '‣' : '›',
  radioOff: '◯',
  radioOn: '◉',
  warning: '⚠'
});
module.exports = isWindows && !isHyper ? windows : other;
Reflect.defineProperty(module.exports, 'common', {
  enumerable: false,
  value: common
});
Reflect.defineProperty(module.exports, 'windows', {
  enumerable: false,
  value: windows
});
Reflect.defineProperty(module.exports, 'other', {
  enumerable: false,
  value: other
});

/***/ },

/***/ 7650
/*!*****************************!*\
  !*** external "tabby-core" ***!
  \*****************************/
(module) {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__7650__;

/***/ },

/***/ 7748
/*!*************************!*\
  !*** external "stream" ***!
  \*************************/
(module) {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__7748__;

/***/ },

/***/ 7840
/*!*********************************************!*\
  !*** ./node_modules/hexer/hex_transform.js ***!
  \*********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var extend = __webpack_require__(/*! xtend */ 1837);
var util = __webpack_require__(/*! util */ 9023);
var Transform = (__webpack_require__(/*! stream */ 7748).Transform);
var render = __webpack_require__(/*! ./render */ 3656);
function HexTransform(options) {
  if (!(this instanceof HexTransform)) {
    return new HexTransform(options);
  }
  // istanbul ignore next
  if (!options) options = {};
  if (options.colored) options = extend(render.coloredOptions, options);
  Transform.call(this, options);
  var self = this;
  self.options = options;
  self.prefix = self.options.prefix || '';
  self.cols = self.options.cols || 16;
  self.group = self.options.group || 2;
  self.gutter = self.options.gutter || 0;
  // istanbul ignore if
  self.annotateLine = options.annotateLine || null;
  self.decorateHexen = self.options.decorateHexen || noopDecorate;
  self.decorateHuman = self.options.decorateHuman || noopDecorate;
  self.renderHexen = self.options.renderHexen || render.byte2hex;
  self.renderHuman = self.options.renderHuman || render.byte2char;
  // istanbul ignore next
  self.groupSeparator = self.options.groupSeparator === undefined ? ' ' : self.options.groupSeparator;
  self.headSep = self.options.headSep === undefined ? ': ' : self.options.headSep;
  // istanbul ignore next
  self.divide = self.options.divide === undefined ? '  ' : self.options.divide;
  // istanbul ignore next
  self.emptyHexen = self.options.emptyHexen === undefined ? '  ' : self.options.emptyHexen;
  self.emptyHuman = self.options.emptyHuman || '';
  self.nullHuman = self.options.nullHuman || '';
  self.offsetWidth = self.options.offsetWidth || 8;
  self.gutter = Math.max(self.offsetWidth, self.gutter);
  self.line = '';
  self.hexen = '';
  self.human = '';
  self.reset();
}
util.inherits(HexTransform, Transform);
HexTransform.prototype.reset = function reset() {
  var self = this;
  self._finishLine();
  self.screenOffset = 0;
  self.totalOffset = 0;
};
HexTransform.prototype._transform = function transform(chunk, encoding, done) {
  var self = this;
  for (var offset = 0; offset < chunk.length; offset++) {
    if (self.screenOffset % self.cols === 0) {
      self._finishLine();
      self._startLine();
    }
    self._addByte(chunk[offset]);
  }
  done(null);
};
HexTransform.prototype._flush = function flush(done) {
  var self = this;
  if (self.totalOffset === 0 && self.nullHuman) {
    self._startLine();
    self.human += self.nullHuman;
  }
  self._finishLine();
  done(null);
};
HexTransform.prototype._startLine = function startLine() {
  var self = this;
  var head = render.pad('0', self.totalOffset.toString(16), self.offsetWidth);
  self.line = self.prefix + render.pad(' ', head, self.gutter) + self.headSep;
};
HexTransform.prototype._finishLine = function finishLine() {
  var self = this;
  if (self.line.length) {
    var rem = self.screenOffset % self.cols;
    if (rem !== 0 || self.totalOffset === 0 && self.nullHuman) {
      rem = self.cols - rem;
      for (var i = 0; i < rem; i++) {
        self._addEmpty();
      }
    }
    self.line += self.hexen + self.divide + self.human;
    // istanbul ignore if
    if (self.annotateLine) {
      self.line += self.annotateLine(self.totalOffset - self.cols, self.totalOffset);
    }
    self.line += '\n';
    self.push(self.line);
    self.line = '';
    self.hexen = '';
    self.human = '';
  }
};
HexTransform.prototype._addEmpty = function addEmpty() {
  var self = this;
  self._addPart(self.emptyHexen, self.emptyHuman);
};
HexTransform.prototype._addByte = function addByte(b) {
  var self = this;
  var hexen = self.renderHexen(b);
  var human = self.renderHuman(b);
  self._addPart(hexen, human, b);
};
HexTransform.prototype._addPart = function addByte(hexen, human, b) {
  var self = this;
  hexen = self.decorateHexen(self.totalOffset, self.screenOffset, hexen, b);
  human = self.decorateHuman(self.totalOffset, self.screenOffset, human, b);
  var isStartOfRow = self.screenOffset % self.cols === 0;
  var isStartOfGroup = self.screenOffset % self.group === 0;
  if (!isStartOfRow && isStartOfGroup) {
    self.hexen += self.groupSeparator;
  }
  self.hexen += hexen;
  self.human += human;
  self.totalOffset++;
  self.screenOffset++;
};
function noopDecorate(offset, screenOffset, s) {
  return s;
}
module.exports = HexTransform;

/***/ },

/***/ 7866
/*!****************************************!*\
  !*** ../node_modules/kind-of/index.js ***!
  \****************************************/
(module) {

var toString = Object.prototype.toString;
module.exports = function kindOf(val) {
  if (val === void 0) return 'undefined';
  if (val === null) return 'null';
  var type = typeof val;
  if (type === 'boolean') return 'boolean';
  if (type === 'string') return 'string';
  if (type === 'number') return 'number';
  if (type === 'symbol') return 'symbol';
  if (type === 'function') {
    return isGeneratorFn(val) ? 'generatorfunction' : 'function';
  }
  if (isArray(val)) return 'array';
  if (isBuffer(val)) return 'buffer';
  if (isArguments(val)) return 'arguments';
  if (isDate(val)) return 'date';
  if (isError(val)) return 'error';
  if (isRegexp(val)) return 'regexp';
  switch (ctorName(val)) {
    case 'Symbol':
      return 'symbol';
    case 'Promise':
      return 'promise';

    // Set, Map, WeakSet, WeakMap
    case 'WeakMap':
      return 'weakmap';
    case 'WeakSet':
      return 'weakset';
    case 'Map':
      return 'map';
    case 'Set':
      return 'set';

    // 8-bit typed arrays
    case 'Int8Array':
      return 'int8array';
    case 'Uint8Array':
      return 'uint8array';
    case 'Uint8ClampedArray':
      return 'uint8clampedarray';

    // 16-bit typed arrays
    case 'Int16Array':
      return 'int16array';
    case 'Uint16Array':
      return 'uint16array';

    // 32-bit typed arrays
    case 'Int32Array':
      return 'int32array';
    case 'Uint32Array':
      return 'uint32array';
    case 'Float32Array':
      return 'float32array';
    case 'Float64Array':
      return 'float64array';
  }
  if (isGeneratorObj(val)) {
    return 'generator';
  }

  // Non-plain objects
  type = toString.call(val);
  switch (type) {
    case '[object Object]':
      return 'object';
    // iterators
    case '[object Map Iterator]':
      return 'mapiterator';
    case '[object Set Iterator]':
      return 'setiterator';
    case '[object String Iterator]':
      return 'stringiterator';
    case '[object Array Iterator]':
      return 'arrayiterator';
  }

  // other
  return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
};
function ctorName(val) {
  return typeof val.constructor === 'function' ? val.constructor.name : null;
}
function isArray(val) {
  if (Array.isArray) return Array.isArray(val);
  return val instanceof Array;
}
function isError(val) {
  return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
}
function isDate(val) {
  if (val instanceof Date) return true;
  return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
}
function isRegexp(val) {
  if (val instanceof RegExp) return true;
  return typeof val.flags === 'string' && typeof val.ignoreCase === 'boolean' && typeof val.multiline === 'boolean' && typeof val.global === 'boolean';
}
function isGeneratorFn(name, val) {
  return ctorName(name) === 'GeneratorFunction';
}
function isGeneratorObj(val) {
  return typeof val.throw === 'function' && typeof val.return === 'function' && typeof val.next === 'function';
}
function isArguments(val) {
  try {
    if (typeof val.length === 'number' && typeof val.callee === 'function') {
      return true;
    }
  } catch (err) {
    if (err.message.indexOf('callee') !== -1) {
      return true;
    }
  }
  return false;
}

/**
 * If you need to support Safari 5-7 (8-10 yr-old browser),
 * take a look at https://github.com/feross/is-buffer
 */

function isBuffer(val) {
  if (val.constructor && typeof val.constructor.isBuffer === 'function') {
    return val.constructor.isBuffer(val);
  }
  return false;
}

/***/ },

/***/ 8093
/*!*********************************************************************************************************************************************!*\
  !*** ../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./src/components/searchPanel.component.scss?ngResource ***!
  \*********************************************************************************************************************************************/
(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ 1333);
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ 5955);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ":host{position:fixed;width:600px;max-width:80vw;right:40px;height:36px;z-index:5;border-radius:0 0 5px 5px;background:rgba(0,0,0,.95);border:1px solid rgba(0,0,0,.5);border-top:0;display:flex}:host button{padding:0 6px;margin:4px 2px;flex-shrink:0}.result-counter{font-size:.7rem;opacity:.5}:host ::ng-deep svg{height:16px}", "",{"version":3,"sources":["webpack://./src/components/searchPanel.component.scss"],"names":[],"mappings":"AAAA,MACI,cAAA,CACA,WAAA,CACA,cAAA,CACA,UAAA,CACA,WAAA,CACA,SAAA,CACA,yBAAA,CACA,0BAAA,CACA,+BAAA,CACA,YAAA,CACA,YAAA,CAEA,aACI,aAAA,CACA,cAAA,CACA,aAAA,CAIR,gBACI,eAAA,CACA,UAAA,CAGJ,oBACI,WAAA","sourcesContent":[":host {\n    position: fixed;\n    width: 600px;\n    max-width: 80vw;\n    right: 40px;\n    height: 36px;\n    z-index: 5;\n    border-radius: 0 0 5px 5px;\n    background: rgba(0, 0, 0, .95);\n    border: 1px solid rgba(0, 0, 0, .5);\n    border-top: 0;\n    display: flex;\n\n    button {\n        padding: 0 6px;\n        margin: 4px 2px;\n        flex-shrink: 0;\n    }\n}\n\n.result-counter {\n    font-size: 0.7rem;\n    opacity: .5;\n}\n\n:host ::ng-deep svg {\n    height: 16px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ },

/***/ 8111
/*!*********************************************************************!*\
  !*** ./src/components/terminalSettingsTab.component.pug?ngResource ***!
  \*********************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/terminalSettingsTab.component.pug?ngResource */ 9408);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 8201
/*!********************************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/colorSchemeSettingsForMode.component.pug?ngResource ***!
  \********************************************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cdiv class=\"head\"\u003E\n  \u003Cdiv class=\"d-flex align-items-center\" *ngIf=\"!editing\"\u003E\u003Cstrong class=\"me-2\" translate\u003ECurrent color scheme\u003C\u002Fstrong\u003E\u003Cspan\u003E{{getCurrentSchemeName()}}\u003C\u002Fspan\u003E\n    \u003Cdiv class=\"me-auto\"\u003E\u003C\u002Fdiv\u003E\n    \u003Cdiv class=\"btn-toolbar\"\u003E\n      \u003Cbutton class=\"btn btn-secondary\" (click)=\"editScheme()\"\u003E\u003Ci class=\"fas fa-pen\"\u003E\u003C\u002Fi\u003E\u003Cspan translate\u003EEdit\u003C\u002Fspan\u003E\u003C\u002Fbutton\u003E\n      \u003Cdiv class=\"me-1\"\u003E\u003C\u002Fdiv\u003E\n      \u003Cbutton class=\"btn btn-danger\" (click)=\"deleteScheme(config.store.terminal[this.configKey])\" *ngIf=\"currentCustomScheme\"\u003E\u003Ci class=\"fas fa-trash\"\u003E\u003C\u002Fi\u003E\u003Cspan translate\u003EDelete\u003C\u002Fspan\u003E\u003C\u002Fbutton\u003E\n    \u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv *ngIf=\"editing\"\u003E\n    \u003Cdiv class=\"mb-3\"\u003E\n      \u003Clabel translate\u003EName\u003C\u002Flabel\u003E\n      \u003Cinput class=\"form-control\" type=\"text\" [(ngModel)]=\"config.store.terminal[this.configKey].name\"\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cdiv class=\"mb-3\"\u003E\n      \u003Ccolor-picker [(model)]=\"config.store.terminal[this.configKey].foreground\" (modelChange)=\"config.save()\" title=\"FG\" hint=\"Foreground\"\u003E\u003C\u002Fcolor-picker\u003E\n      \u003Ccolor-picker [(model)]=\"config.store.terminal[this.configKey].background\" (modelChange)=\"config.save()\" title=\"BG\" hint=\"Background\"\u003E\u003C\u002Fcolor-picker\u003E\n      \u003Ccolor-picker [(model)]=\"config.store.terminal[this.configKey].cursor\" (modelChange)=\"config.save()\" title=\"CU\" hint=\"Cursor color\"\u003E\u003C\u002Fcolor-picker\u003E\n      \u003Ccolor-picker [(model)]=\"config.store.terminal[this.configKey].cursorAccent\" (modelChange)=\"config.save()\" title=\"CA\" hint=\"Block cursor foreground\"\u003E\u003C\u002Fcolor-picker\u003E\n      \u003Ccolor-picker [(model)]=\"config.store.terminal[this.configKey].selection\" (modelChange)=\"config.save()\" title=\"SB\" hint=\"Selection background\"\u003E\u003C\u002Fcolor-picker\u003E\n      \u003Ccolor-picker [(model)]=\"config.store.terminal[this.configKey].selectionForeground\" (modelChange)=\"config.save()\" title=\"SF\" hint=\"Selection foreground\"\u003E\u003C\u002Fcolor-picker\u003E\n      \u003Ccolor-picker *ngFor=\"let _ of config.store.terminal[this.configKey].colors; let idx = index; trackBy: colorsTrackBy\" [(model)]=\"config.store.terminal[this.configKey].colors[idx]\" (modelChange)=\"config.save()\" [title]=\"idx.toString()\" hint=\"ANSI color {{idx}}\"\u003E\u003C\u002Fcolor-picker\u003E\n    \u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Ccolor-scheme-preview [scheme]=\"config.store.terminal[this.configKey]\"\u003E\u003C\u002Fcolor-scheme-preview\u003E\n  \u003Cdiv class=\"btn-toolbar d-flex mt-2\" *ngIf=\"editing\"\u003E\n    \u003Cdiv class=\"me-auto\"\u003E\u003C\u002Fdiv\u003E\n    \u003Cbutton class=\"btn btn-primary\" (click)=\"saveScheme()\"\u003E\u003Ci class=\"fas fa-check\"\u003E\u003C\u002Fi\u003E\u003Cspan translate\u003ESave\u003C\u002Fspan\u003E\u003C\u002Fbutton\u003E\n    \u003Cdiv class=\"me-1\"\u003E\u003C\u002Fdiv\u003E\n    \u003Cbutton class=\"btn btn-secondary\" (click)=\"cancelEditing()\"\u003E\u003Ci class=\"fas fa-times\"\u003E\u003C\u002Fi\u003E\u003Cspan translate\u003ECancel\u003C\u002Fspan\u003E\u003C\u002Fbutton\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Chr class=\"mt-3 mb-4\"\u003E\n  \u003Cdiv class=\"input-group mb-3\"\u003E\n    \u003Cdiv class=\"input-group-text\"\u003E\u003Ci class=\"fas fa-fw fa-search\"\u003E\u003C\u002Fi\u003E\u003C\u002Fdiv\u003E\n    \u003Cinput class=\"form-control\" type=\"search\" [placeholder]=\"&quot;Search color schemes&quot;|translate\" [(ngModel)]=\"filter\"\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"body\"\u003E\n  \u003Cdiv class=\"list-group list-group-light mb-3\"\u003E\n    \u003Cng-container *ngFor=\"let scheme of allColorSchemes\"\u003E\n      \u003Cdiv class=\"list-group-item list-group-item-action\" [hidden]=\"filter &amp;&amp; !scheme.name.toLowerCase().includes(filter.toLowerCase())\" (click)=\"selectScheme(scheme)\" [class.active]=\"(currentCustomScheme || currentStockScheme) === scheme\"\u003E\n        \u003Cdiv class=\"d-flex w-100 align-items-center\"\u003E\u003Ci class=\"fas fa-fw\" [class.fa-check]=\"(currentCustomScheme || currentStockScheme) === scheme\"\u003E\u003C\u002Fi\u003E\n          \u003Cdiv class=\"ms-2\"\u003E\u003C\u002Fdiv\u003E\n          \u003Cdiv class=\"me-auto\"\u003E\u003Cspan\u003E{{scheme.name}}\u003C\u002Fspan\u003E\n            \u003Cdiv class=\"badge text-bg-info ms-2\" *ngIf=\"customColorSchemes.includes(scheme)\" translate\u003ECustom\u003C\u002Fdiv\u003E\n          \u003C\u002Fdiv\u003E\n          \u003Cdiv\u003E\n            \u003Cdiv class=\"d-flex\"\u003E\n              \u003Cdiv class=\"swatch\" *ngFor=\"let index of colorIndexes.slice(0, 8)\" [style.background-color]=\"scheme.colors[index]\"\u003E\u003C\u002Fdiv\u003E\n            \u003C\u002Fdiv\u003E\n            \u003Cdiv class=\"d-flex\"\u003E\n              \u003Cdiv class=\"swatch\" *ngFor=\"let index of colorIndexes.slice(8, 16)\" [style.background-color]=\"scheme.colors[index]\"\u003E\u003C\u002Fdiv\u003E\n            \u003C\u002Fdiv\u003E\n          \u003C\u002Fdiv\u003E\n        \u003C\u002Fdiv\u003E\n        \u003Ccolor-scheme-preview [scheme]=\"scheme\"\u003E\u003C\u002Fcolor-scheme-preview\u003E\n      \u003C\u002Fdiv\u003E\n    \u003C\u002Fng-container\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 8303
/*!*********************************************!*\
  !*** ../node_modules/is-arguments/index.js ***!
  \*********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ 6565)();
var callBound = __webpack_require__(/*! call-bind/callBound */ 9414);
var $toString = callBound('Object.prototype.toString');
var isStandardArguments = function isArguments(value) {
  if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {
    return false;
  }
  return $toString(value) === '[object Arguments]';
};
var isLegacyArguments = function isArguments(value) {
  if (isStandardArguments(value)) {
    return true;
  }
  return value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && $toString(value) !== '[object Array]' && $toString(value.callee) === '[object Function]';
};
var supportsStandardArguments = function () {
  return isStandardArguments(arguments);
}();
isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests

module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;

/***/ },

/***/ 8323
/*!******************************************************!*\
  !*** ../app/node_modules/set-function-name/index.js ***!
  \******************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var define = __webpack_require__(/*! define-data-property */ 4466);
var hasDescriptors = __webpack_require__(/*! has-property-descriptors */ 947)();
var functionsHaveConfigurableNames = (__webpack_require__(/*! functions-have-names */ 5821).functionsHaveConfigurableNames)();
var $TypeError = __webpack_require__(/*! es-errors/type */ 9176);

/** @type {import('.')} */
module.exports = function setFunctionName(fn, name) {
  if (typeof fn !== 'function') {
    throw new $TypeError('`fn` is not a function');
  }
  var loose = arguments.length > 2 && !!arguments[2];
  if (!loose || functionsHaveConfigurableNames) {
    if (hasDescriptors) {
      define(/** @type {Parameters<define>[0]} */fn, 'name', name, true, true);
    } else {
      define(/** @type {Parameters<define>[0]} */fn, 'name', name);
    }
  }
  return fn;
};

/***/ },

/***/ 8349
/*!*****************************************************!*\
  !*** ../app/node_modules/object.assign/polyfill.js ***!
  \*****************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var implementation = __webpack_require__(/*! ./implementation */ 6056);
var lacksProperEnumerationOrder = function () {
  if (!Object.assign) {
    return false;
  }
  /*
   * v8, specifically in node 4.x, has a bug with incorrect property enumeration order
   * note: this does not detect the bug unless there's 20 characters
   */
  var str = 'abcdefghijklmnopqrst';
  var letters = str.split('');
  var map = {};
  for (var i = 0; i < letters.length; ++i) {
    map[letters[i]] = letters[i];
  }
  var obj = Object.assign({}, map);
  var actual = '';
  for (var k in obj) {
    actual += k;
  }
  return str !== actual;
};
var assignHasPendingExceptions = function () {
  if (!Object.assign || !Object.preventExtensions) {
    return false;
  }
  /*
   * Firefox 37 still has "pending exception" logic in its Object.assign implementation,
   * which is 72% slower than our shim, and Firefox 40's native implementation.
   */
  var thrower = Object.preventExtensions({
    1: 2
  });
  try {
    Object.assign(thrower, 'xy');
  } catch (e) {
    return thrower[1] === 'y';
  }
  return false;
};
module.exports = function getPolyfill() {
  if (!Object.assign) {
    return implementation;
  }
  if (lacksProperEnumerationOrder()) {
    return implementation;
  }
  if (assignHasPendingExceptions()) {
    return implementation;
  }
  return Object.assign;
};

/***/ },

/***/ 8354
/*!************************************************!*\
  !*** ../app/node_modules/has-symbols/index.js ***!
  \************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var origSymbol = typeof Symbol !== 'undefined' && Symbol;
var hasSymbolSham = __webpack_require__(/*! ./shams */ 9944);

/** @type {import('.')} */
module.exports = function hasNativeSymbols() {
  if (typeof origSymbol !== 'function') {
    return false;
  }
  if (typeof Symbol !== 'function') {
    return false;
  }
  if (typeof origSymbol('foo') !== 'symbol') {
    return false;
  }
  if (typeof Symbol('bar') !== 'symbol') {
    return false;
  }
  return hasSymbolSham();
};

/***/ },

/***/ 8375
/*!*******************************************************!*\
  !*** ./src/components/baseTerminalTab.component.scss ***!
  \*******************************************************/
(module, __unused_webpack_exports, __webpack_require__) {


        var result = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./baseTerminalTab.component.scss */ 1290);

        if (result && result.__esModule) {
            result = result.default;
        }

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ },

/***/ 8458
/*!**********************************************!*\
  !*** ../app/node_modules/es-errors/index.js ***!
  \**********************************************/
(module) {

"use strict";


/** @type {import('.')} */
module.exports = Error;

/***/ },

/***/ 8480
/*!****************************************************!*\
  !*** ../app/node_modules/safe-regex-test/index.js ***!
  \****************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var callBound = __webpack_require__(/*! call-bound */ 4731);
var isRegex = __webpack_require__(/*! is-regex */ 1476);
var $exec = callBound('RegExp.prototype.exec');
var $TypeError = __webpack_require__(/*! es-errors/type */ 9176);

/** @type {import('.')} */
module.exports = function regexTester(regex) {
  if (!isRegex(regex)) {
    throw new $TypeError('`regex` must be a RegExp');
  }
  return function test(s) {
    return $exec(regex, s) !== null;
  };
};

/***/ },

/***/ 8516
/*!***************************************************!*\
  !*** ../app/node_modules/uuid/lib/bytesToUuid.js ***!
  \***************************************************/
(module) {

/**
 * Convert array of 16 byte values to UUID string format of the form:
 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
 */
var byteToHex = [];
for (var i = 0; i < 256; ++i) {
  byteToHex[i] = (i + 0x100).toString(16).substr(1);
}
function bytesToUuid(buf, offset) {
  var i = offset || 0;
  var bth = byteToHex;
  // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join('');
}
module.exports = bytesToUuid;

/***/ },

/***/ 8570
/*!**********************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/baseTerminalTab.component.pug ***!
  \**********************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cdiv class=\"terminal-toolbar-spacer\"\u003E\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"content\" #content [style.opacity]=\"frontendIsReady ? 1 : 0\"\u003E\u003C\u002Fdiv\u003E\n\u003Csearch-panel *ngIf=\"showSearchPanel &amp;&amp; hasFocus &amp;&amp; frontend\" @toolbarSlide [@.disabled]=\"!config.store.accessibility.animations\" [frontend]=\"frontend\" (close)=\"showSearchPanel = false; frontend.cancelSearch()\"\u003E\u003C\u002Fsearch-panel\u003E\n\u003Cbutton class=\"btn btn-sm btn-link toolbar-pin-button\" *ngIf=\"enableToolbar &amp;&amp; !pinToolbar\" (click)=\"togglePinToolbar()\" (mouseenter)=\"showToolbar()\" (mouseleave)=\"hideToolbar()\"\u003E\u003Ci class=\"fas fa-wrench\"\u003E\u003C\u002Fi\u003E\u003C\u002Fbutton\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 8700
/*!**************************************************************!*\
  !*** ./src/components/colorPicker.component.scss?ngResource ***!
  \**************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {


        var result = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./colorPicker.component.scss?ngResource */ 799);

        if (result && result.__esModule) {
            result = result.default;
        }

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ },

/***/ 8810
/*!****************************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/colorSchemeSettingsTab.component.pug?ngResource ***!
  \****************************************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Ch3 class=\"mb-3\" translate\u003EColor schemes\u003C\u002Fh3\u003E\n\u003Cdiv class=\"form-line mb-4\"\u003E\n  \u003Cdiv class=\"header\"\u003E\n    \u003Cdiv class=\"title\" translate\u003ESwitch color scheme\u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"btn-group\" role=\"group\"\u003E\n    \u003Cinput class=\"btn-check\" type=\"radio\" name=\"colorSchemeMode\" [(ngModel)]=\"config.store.appearance.colorSchemeMode\" (ngModelChange)=\"config.save()\" id=\"colorSchemeModeAuto\" [value]=\"&quot;auto&quot;\"\u003E\n    \u003Clabel class=\"btn btn-secondary\" for=\"colorSchemeModeAuto\"\u003E\u003Cspan translate\u003EFrom system\u003C\u002Fspan\u003E\u003C\u002Flabel\u003E\n    \u003Cinput class=\"btn-check\" type=\"radio\" name=\"colorSchemeMode\" [(ngModel)]=\"config.store.appearance.colorSchemeMode\" (ngModelChange)=\"config.save()\" id=\"colorSchemeModeDark\" [value]=\"&quot;dark&quot;\"\u003E\n    \u003Clabel class=\"btn btn-secondary\" for=\"colorSchemeModeDark\"\u003E\u003Cspan translate\u003EAlways dark\u003C\u002Fspan\u003E\u003C\u002Flabel\u003E\n    \u003Cinput class=\"btn-check\" type=\"radio\" name=\"colorSchemeMode\" [(ngModel)]=\"config.store.appearance.colorSchemeMode\" (ngModelChange)=\"config.save()\" id=\"colorSchemeModeLight\" [value]=\"&quot;light&quot;\"\u003E\n    \u003Clabel class=\"btn btn-secondary\" for=\"colorSchemeModeLight\"\u003E\u003Cspan translate\u003EAlways light\u003C\u002Fspan\u003E\u003C\u002Flabel\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cul class=\"nav-tabs\" ngbNav #nav=\"ngbNav\" [activeId]=\"defaultTab\"\u003E\n  \u003Cli ngbNavItem=\"dark\"\u003E\u003Ca ngbNavLink translate\u003EDark mode\u003C\u002Fa\u003E\n    \u003Cng-template ngbNavContent\u003E\n      \u003Ccolor-scheme-settings-for-mode configKey=\"colorScheme\"\u003E\u003C\u002Fcolor-scheme-settings-for-mode\u003E\n    \u003C\u002Fng-template\u003E\n  \u003C\u002Fli\u003E\n  \u003Cli ngbNavItem=\"light\"\u003E\u003Ca ngbNavLink translate\u003ELight mode\u003C\u002Fa\u003E\n    \u003Cng-template ngbNavContent\u003E\n      \u003Ccolor-scheme-settings-for-mode configKey=\"lightColorScheme\"\u003E\u003C\u002Fcolor-scheme-settings-for-mode\u003E\n    \u003C\u002Fng-template\u003E\n  \u003C\u002Fli\u003E\n\u003C\u002Ful\u003E\n\u003Cdiv [ngbNavOutlet]=\"nav\"\u003E\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 8862
/*!***********************************************************!*\
  !*** ../app/node_modules/function-bind/implementation.js ***!
  \***********************************************************/
(module) {

"use strict";


/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var toStr = Object.prototype.toString;
var max = Math.max;
var funcType = '[object Function]';
var concatty = function concatty(a, b) {
  var arr = [];
  for (var i = 0; i < a.length; i += 1) {
    arr[i] = a[i];
  }
  for (var j = 0; j < b.length; j += 1) {
    arr[j + a.length] = b[j];
  }
  return arr;
};
var slicy = function slicy(arrLike, offset) {
  var arr = [];
  for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
    arr[j] = arrLike[i];
  }
  return arr;
};
var joiny = function (arr, joiner) {
  var str = '';
  for (var i = 0; i < arr.length; i += 1) {
    str += arr[i];
    if (i + 1 < arr.length) {
      str += joiner;
    }
  }
  return str;
};
module.exports = function bind(that) {
  var target = this;
  if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
    throw new TypeError(ERROR_MESSAGE + target);
  }
  var args = slicy(arguments, 1);
  var bound;
  var binder = function () {
    if (this instanceof bound) {
      var result = target.apply(this, concatty(args, arguments));
      if (Object(result) === result) {
        return result;
      }
      return this;
    }
    return target.apply(that, concatty(args, arguments));
  };
  var boundLength = max(0, target.length - args.length);
  var boundArgs = [];
  for (var i = 0; i < boundLength; i++) {
    boundArgs[i] = '$' + i;
  }
  bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
  if (target.prototype) {
    var Empty = function Empty() {};
    Empty.prototype = target.prototype;
    bound.prototype = new Empty();
    Empty.prototype = null;
  }
  return bound;
};

/***/ },

/***/ 8869
/*!*********************************************************************!*\
  !*** ../node_modules/style-loader/dist/runtime/insertBySelector.js ***!
  \*********************************************************************/
(module) {

"use strict";


var memo = {};

/* istanbul ignore next  */
function getTarget(target) {
  if (typeof memo[target] === "undefined") {
    var styleTarget = document.querySelector(target);

    // Special case to return head of iframe instead of iframe itself
    if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
      try {
        // This will throw an exception if access to iframe is blocked
        // due to cross-origin restrictions
        styleTarget = styleTarget.contentDocument.head;
      } catch (e) {
        // istanbul ignore next
        styleTarget = null;
      }
    }
    memo[target] = styleTarget;
  }
  return memo[target];
}

/* istanbul ignore next  */
function insertBySelector(insert, style) {
  var target = getTarget(insert);
  if (!target) {
    throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  }
  target.appendChild(style);
}
module.exports = insertBySelector;

/***/ },

/***/ 8915
/*!**********************************************!*\
  !*** ./node_modules/buffer-replace/index.js ***!
  \**********************************************/
(module) {

"use strict";


const replace = (buf, a, b) => {
  if (!Buffer.isBuffer(buf)) buf = Buffer(buf);
  const idx = buf.indexOf(a);
  if (idx === -1) return buf;
  if (!Buffer.isBuffer(b)) b = Buffer(b);
  const before = buf.slice(0, idx);
  const after = replace(buf.slice(idx + a.length), a, b);
  return Buffer.concat([before, b, after], idx + b.length + after.length);
};
module.exports = replace;

/***/ },

/***/ 9004
/*!**********************************************************!*\
  !*** ../app/node_modules/object-inspect/util.inspect.js ***!
  \**********************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

module.exports = __webpack_require__(/*! util */ 9023).inspect;

/***/ },

/***/ 9023
/*!***********************!*\
  !*** external "util" ***!
  \***********************/
(module) {

"use strict";
module.exports = require("util");

/***/ },

/***/ 9041
/*!***************************************************************!*\
  !*** ../app/node_modules/possible-typed-array-names/index.js ***!
  \***************************************************************/
(module) {

"use strict";


/** @type {import('.')} */
module.exports = ['Float16Array', 'Float32Array', 'Float64Array', 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'BigInt64Array', 'BigUint64Array'];

/***/ },

/***/ 9176
/*!*********************************************!*\
  !*** ../app/node_modules/es-errors/type.js ***!
  \*********************************************/
(module) {

"use strict";


/** @type {import('./type')} */
module.exports = TypeError;

/***/ },

/***/ 9197
/*!**************************************************!*\
  !*** ../app/node_modules/math-intrinsics/max.js ***!
  \**************************************************/
(module) {

"use strict";


/** @type {import('./max')} */
module.exports = Math.max;

/***/ },

/***/ 9250
/*!*****************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/searchPanel.component.pug?ngResource ***!
  \*****************************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cdiv class=\"input-group\"\u003E\n  \u003Cinput class=\"search-input form-control\" type=\"text\" [(ngModel)]=\"query\" (ngModelChange)=\"onQueryChange()\" [class.text-danger]=\"state.resultCount == 0\" (click)=\"$event.stopPropagation()\" (keyup.enter)=\"findPrevious()\" (keyup.up)=\"findPrevious()\" (keyup.down)=\"findNext()\" (keyup.esc)=\"close.emit()\" [placeholder]=\"&quot;Search&quot;|translate\"\u003E\n  \u003Cdiv class=\"input-group-text result-counter\" *ngIf=\"state.resultCount &gt; 0\"\u003E{{(state.resultIndex ?? 0) + 1}} \u002F {{state.resultCount}}\u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cng-container *ngIf=\"state.resultCount &gt; 0\"\u003E\n  \u003Cbutton class=\"btn btn-link\" (click)=\"findPrevious()\" [ngbTooltip]=\"&quot;Search up&quot;|translate\" placement=\"bottom\" [fastHtmlBind]=\"icons.arrowUp\"\u003E\u003C\u002Fbutton\u003E\n  \u003Cbutton class=\"btn btn-link\" (click)=\"findNext()\" [ngbTooltip]=\"&quot;Search down&quot;|translate\" placement=\"bottom\" [fastHtmlBind]=\"icons.arrowDown\"\u003E\u003C\u002Fbutton\u003E\n\u003C\u002Fng-container\u003E\n\u003Cdiv class=\"me-2\"\u003E\u003C\u002Fdiv\u003E\n\u003Cbutton class=\"btn\" (click)=\"options.caseSensitive = !options.caseSensitive; saveSearchOptions()\" [class.btn-link]=\"!options.caseSensitive\" [class.btn-info]=\"options.caseSensitive\" [ngbTooltip]=\"&quot;Case sensitivity&quot;|translate\" placement=\"bottom\" [fastHtmlBind]=\"icons.case\"\u003E\u003C\u002Fbutton\u003E\n\u003Cbutton class=\"btn\" (click)=\"options.regex = !options.regex; saveSearchOptions()\" [class.btn-link]=\"!options.regex\" [class.btn-info]=\"options.regex\" [ngbTooltip]=\"&quot;Regular expression&quot;|translate\" placement=\"bottom\" [fastHtmlBind]=\"icons.regexp\"\u003E\u003C\u002Fbutton\u003E\n\u003Cbutton class=\"btn\" (click)=\"options.wholeWord = !options.wholeWord; saveSearchOptions()\" [class.btn-link]=\"!options.wholeWord\" [class.btn-info]=\"options.wholeWord\" [ngbTooltip]=\"&quot;Whole word&quot;|translate\" placement=\"bottom\" [fastHtmlBind]=\"icons.wholeWord\"\u003E\u003C\u002Fbutton\u003E\n\u003Cdiv class=\"me-2\"\u003E\u003C\u002Fdiv\u003E\n\u003Cbutton class=\"btn btn-link\" (click)=\"close.emit()\" [fastHtmlBind]=\"icons.close\"\u003E\u003C\u002Fbutton\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 9258
/*!***************************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/appearanceSettingsTab.component.pug?ngResource ***!
  \***************************************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Ch3 class=\"mb-3\" translate\u003EAppearance\u003C\u002Fh3\u003E\n\u003Cdiv class=\"form-line\"\u003E\n  \u003Cdiv class=\"header\"\u003E\n    \u003Cdiv class=\"title\" translate\u003EFont\u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"input-group w-75\"\u003E\n    \u003Cinput class=\"form-control\" type=\"text\" [ngbTypeahead]=\"fontAutocomplete\" [(ngModel)]=\"config.store.terminal.font\" (ngModelChange)=\"config.save()\"\u003E\n    \u003Cinput class=\"form-control font-size-input\" type=\"number\" max=\"48\" [(ngModel)]=\"config.store.terminal.fontSize\" (ngModelChange)=\"fixFontSize(); config.save()\"\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"row\"\u003E\n  \u003Cdiv class=\"col-12 col-md-6\"\u003E\n    \u003Cdiv class=\"form-line\"\u003E\n      \u003Cdiv class=\"header\"\u003E\n        \u003Cdiv class=\"title\" translate\u003EEnable font ligatures\u003C\u002Fdiv\u003E\n      \u003C\u002Fdiv\u003E\n      \u003Ctoggle [(ngModel)]=\"config.store.terminal.ligatures\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cdiv class=\"form-line\"\u003E\n      \u003Cdiv class=\"header\"\u003E\n        \u003Cdiv class=\"title\" translate\u003ENormal font weight\u003C\u002Fdiv\u003E\n      \u003C\u002Fdiv\u003E\n      \u003Cinput class=\"form-control\" type=\"number\" min=\"100\" max=\"900\" step=\"100\" [(ngModel)]=\"config.store.terminal.fontWeight\" (ngModelChange)=\"config.save()\"\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cdiv class=\"form-line\"\u003E\n      \u003Cdiv class=\"header\"\u003E\n        \u003Cdiv class=\"title\" translate\u003EBold font weight\u003C\u002Fdiv\u003E\n      \u003C\u002Fdiv\u003E\n      \u003Cinput class=\"form-control\" type=\"number\" min=\"100\" max=\"900\" step=\"100\" [(ngModel)]=\"config.store.terminal.fontWeightBold\" (ngModelChange)=\"config.save()\"\u003E\n    \u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"col-12 col-md-6\"\u003E\n    \u003Ccolor-scheme-preview [scheme]=\"config.store.terminal.colorScheme\" [fontPreview]=\"true\"\u003E\u003C\u002Fcolor-scheme-preview\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"content-box\"\u003E\n  \u003Cdiv class=\"form-line\" *ngIf=\"!themes.findCurrentTheme().followsColorScheme\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ETerminal background\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cdiv class=\"btn-group\" role=\"group\"\u003E\n      \u003Cinput class=\"btn-check\" type=\"radio\" name=\"background\" [(ngModel)]=\"config.store.terminal.background\" (ngModelChange)=\"config.save()\" id=\"backgroundTheme\" [value]=\"&quot;theme&quot;\"\u003E\n      \u003Clabel class=\"btn btn-secondary\" for=\"backgroundTheme\"\u003E\u003Cspan translate\u003EFrom theme\u003C\u002Fspan\u003E\u003C\u002Flabel\u003E\n      \u003Cinput class=\"btn-check\" type=\"radio\" name=\"background\" [(ngModel)]=\"config.store.terminal.background\" (ngModelChange)=\"config.save()\" id=\"backgroundColorScheme\" [value]=\"&quot;colorScheme&quot;\"\u003E\n      \u003Clabel class=\"btn btn-secondary\" for=\"backgroundColorScheme\"\u003E\u003Cspan translate\u003EFrom color scheme\u003C\u002Fspan\u003E\u003C\u002Flabel\u003E\n    \u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ECursor shape\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cdiv class=\"btn-group\" role=\"group\"\u003E\n      \u003Cinput class=\"btn-check\" type=\"radio\" name=\"cursor\" [(ngModel)]=\"config.store.terminal.cursor\" (ngModelChange)=\"config.save()\" id=\"cursorBlock\" [value]=\"&quot;block&quot;\"\u003E\n      \u003Clabel class=\"btn btn-secondary\" for=\"cursorBlock\"\u003E█\u003C\u002Flabel\u003E\n      \u003Cinput class=\"btn-check\" type=\"radio\" name=\"cursor\" [(ngModel)]=\"config.store.terminal.cursor\" (ngModelChange)=\"config.save()\" id=\"cursorBeam\" [value]=\"&quot;beam&quot;\"\u003E\n      \u003Clabel class=\"btn btn-secondary\" for=\"cursorBeam\"\u003E|\u003C\u002Flabel\u003E\n      \u003Cinput class=\"btn-check\" type=\"radio\" name=\"cursor\" [(ngModel)]=\"config.store.terminal.cursor\" (ngModelChange)=\"config.save()\" id=\"cursorUnderline\" [value]=\"&quot;underline&quot;\"\u003E\n      \u003Clabel class=\"btn btn-secondary\" for=\"cursorUnderline\"\u003E▁\u003C\u002Flabel\u003E\n    \u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003EBlink cursor\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.cursorBlink\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003EMinimum contrast ratio\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cinput class=\"form-control\" type=\"number\" min=\"1\" max=\"21\" step=\"0.5\" [(ngModel)]=\"config.store.terminal.minimumContrastRatio\" (ngModelChange)=\"config.save()\"\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003EFallback font\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003EA second font family used to display characters missing in the main font\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cinput class=\"form-control\" type=\"text\" [ngbTypeahead]=\"fontAutocomplete\" [(ngModel)]=\"config.store.terminal.fallbackFont\" (ngModelChange)=\"config.save()\"\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ELine padding\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003EAdditional space between lines\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cinput class=\"form-control\" type=\"number\" [(ngModel)]=\"config.store.terminal.linePadding\" (ngModelChange)=\"config.save()\"\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ECustom CSS\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Ctextarea class=\"form-control mb-5\" [(ngModel)]=\"config.store.appearance.css\" (ngModelChange)=\"saveConfiguration()\"\u003E\u003C\u002Ftextarea\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 9408
/*!*************************************************************************************************************************************!*\
  !*** ../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/terminalSettingsTab.component.pug?ngResource ***!
  \*************************************************************************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var pug = __webpack_require__(/*! !../../../node_modules/pug-runtime/index.js */ 1836);

function template(locals) {var pug_html = "", pug_mixins = {}, pug_interp;var pug_indent = [];
pug_html = pug_html + "\n\u003Cdiv\u003E\n  \u003Ch3 class=\"mb-3\" translate\u003ERendering\u003C\u002Fh3\u003E\n  \u003Cdiv class=\"form-line\" *ngIf=\"hostApp.platform !== Platform.Web\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003EFrontend\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003ESwitches terminal frontend implementation (experimental)\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cselect class=\"form-control\" [(ngModel)]=\"config.store.terminal.frontend\" (ngModelChange)=\"config.save()\"\u003E\n      \u003Coption value=\"xterm-webgl\"\u003Exterm (WebGL)\u003C\u002Foption\u003E\n      \u003Coption value=\"xterm\"\u003Exterm (canvas)\u003C\u002Foption\u003E\n    \u003C\u002Fselect\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003EScrollback\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003ENumber of lines kept in the buffer\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cinput class=\"form-control\" type=\"number\" [(ngModel)]=\"config.store.terminal.scrollbackLines\" (ngModelChange)=\"config.save()\"\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003EDraw bold text in bright colors\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.drawBoldTextInBrightColors\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ESixel graphics support (experimental)\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003EDisplay images via Sixel escape sequences\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.sixel\" (ngModelChange)=\"config.save(); config.requestRestart()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"mt-4\"\u003E\n  \u003Ch3 translate\u003EKeyboard\u003C\u002Fh3\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate=\"Use {altKeyName} as the Meta key\" [translateParams]=\"{altKeyName: altKeyName}\"\u003E\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003ELets the shell handle Meta key instead of OS\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.altIsMeta\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003EScroll on input\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003EScrolls the terminal to the bottom on user input\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.scrollOnInput\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"mt-4\"\u003E\n  \u003Ch3 translate\u003EMouse\u003C\u002Fh3\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ERight click\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" *ngIf=\"config.store.terminal.rightClick == &quot;paste&quot;\" translate\u003ELong-click for context menu\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cselect class=\"form-control\" [(ngModel)]=\"config.store.terminal.rightClick\" (ngModelChange)=\"config.save()\"\u003E\n      \u003Coption ngValue=\"off\" translate\u003EOff\u003C\u002Foption\u003E\n      \u003Coption ngValue=\"menu\" translate\u003EContext menu\u003C\u002Foption\u003E\n      \u003Coption ngValue=\"paste\" translate\u003EPaste\u003C\u002Foption\u003E\n      \u003Coption ngValue=\"clipboard\" translate\u003EPaste if no selection, else copy\u003C\u002Foption\u003E\n    \u003C\u002Fselect\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003EPaste on middle-click\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.pasteOnMiddleClick\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003EWord separators\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003EDouble-click selection will stop at these characters\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cinput class=\"form-control\" type=\"text\" placeholder=\" ()[]{}'&quot;\" [(ngModel)]=\"config.store.terminal.wordSeparator\" (ngModelChange)=\"config.save()\"\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\" *ngIf=\"config.store.clickableLinks\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ERequire a key to click links\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003EWhen enabled, links are only clickable while holding this key\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cselect class=\"form-control\" [(ngModel)]=\"config.store.clickableLinks.modifier\" (ngModelChange)=\"config.save()\"\u003E\n      \u003Coption [ngValue]=\"null\" translate\u003ENo modifier\u003C\u002Foption\u003E\n      \u003Coption value=\"ctrlKey\" *ngIf=\"hostApp.platform !== Platform.macOS\"\u003ECtrl\u003C\u002Foption\u003E\n      \u003Coption value=\"altKey\"\u003E{{altKeyName}}\u003C\u002Foption\u003E\n      \u003Coption value=\"shiftKey\"\u003EShift\u003C\u002Foption\u003E\n      \u003Coption value=\"metaKey\"\u003E{{metaKeyName}}\u003C\u002Foption\u003E\n    \u003C\u002Fselect\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"mt-4\"\u003E\n  \u003Ch3 translate\u003EClipboard\u003C\u002Fh3\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ECopy on select\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.copyOnSelect\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ECopy with formatting\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.copyAsHTML\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003EBracketed paste (requires shell support)\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003EPrevents accidental execution of pasted commands\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.bracketedPaste\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003EWarn on multi-line paste\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003EShow a confirmation box when pasting multiple lines\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.warnOnMultilinePaste\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ETrim whitespace and newlines\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003ERemove whitespace and newlines around the copied text\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.trimWhitespaceOnPaste\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"mt-4\"\u003E\n  \u003Ch3 translate\u003ESound\u003C\u002Fh3\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ETerminal bell\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Cdiv class=\"btn-group\"\u003E\n      \u003Cinput class=\"btn-check\" type=\"radio\" name=\"bell\" [(ngModel)]=\"config.store.terminal.bell\" (ngModelChange)=\"config.save()\" id=\"bellOff\" [value]=\"&quot;off&quot;\"\u003E\n      \u003Clabel class=\"btn btn-secondary\" for=\"bellOff\"\u003E\u003Cspan translate\u003EOff\u003C\u002Fspan\u003E\u003C\u002Flabel\u003E\n      \u003Cinput class=\"btn-check\" type=\"radio\" name=\"bell\" [(ngModel)]=\"config.store.terminal.bell\" (ngModelChange)=\"config.save()\" id=\"bellVisual\" [value]=\"&quot;visual&quot;\"\u003E\n      \u003Clabel class=\"btn btn-secondary\" for=\"bellVisual\"\u003E\u003Cspan translate\u003EVisual\u003C\u002Fspan\u003E\u003C\u002Flabel\u003E\n      \u003Cinput class=\"btn-check\" type=\"radio\" name=\"bell\" [(ngModel)]=\"config.store.terminal.bell\" (ngModelChange)=\"config.save()\" id=\"bellAudible\" [value]=\"&quot;audible&quot;\"\u003E\n      \u003Clabel class=\"btn btn-secondary\" for=\"bellAudible\"\u003E\u003Cspan translate\u003EAudible\u003C\u002Fspan\u003E\u003C\u002Flabel\u003E\n    \u003C\u002Fdiv\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"alert alert-info d-flex align-items-center\" *ngIf=\"config.store.terminal.bell != &quot;audible&quot; &amp;&amp; (config.store.terminal.profile || &quot;&quot;).startsWith(&quot;wsl&quot;)\"\u003E\n    \u003Cdiv class=\"me-auto\" translate\u003EWSL terminal bell can only be muted via Volume Mixer\u003C\u002Fdiv\u003E\n    \u003Cbutton class=\"btn btn-secondary\" (click)=\"openWSLVolumeMixer()\" translate\u003EShow Mixer\u003C\u002Fbutton\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"mt-4\"\u003E\n  \u003Ch3 translate\u003EStartup\u003C\u002Fh3\u003E\n  \u003Cdiv class=\"form-line\" *ngIf=\"hostApp.platform !== Platform.Web\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003EAuto-open a terminal on app start\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.autoOpen\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ERestore terminal tabs on app start\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.recoverTabs\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E\n\u003Cdiv class=\"mt-4\" *ngIf=\"hostApp.platform === Platform.Windows\"\u003E\n  \u003Ch3 translate\u003EWindows\u003C\u002Fh3\u003E\n  \u003Cdiv class=\"form-line\"\u003E\n    \u003Cdiv class=\"header\"\u003E\n      \u003Cdiv class=\"title\" translate\u003ESet Tabby as %COMSPEC%\u003C\u002Fdiv\u003E\n      \u003Cdiv class=\"description\" translate\u003EAllows opening .bat files in tabs, but breaks some shells\u003C\u002Fdiv\u003E\n    \u003C\u002Fdiv\u003E\n    \u003Ctoggle [(ngModel)]=\"config.store.terminal.setComSpec\" (ngModelChange)=\"config.save()\"\u003E\u003C\u002Ftoggle\u003E\n  \u003C\u002Fdiv\u003E\n\u003C\u002Fdiv\u003E";;return pug_html;};
module.exports = template;

/***/ },

/***/ 9413
/*!*********************************************!*\
  !*** ../app/node_modules/for-each/index.js ***!
  \*********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var isCallable = __webpack_require__(/*! is-callable */ 5141);
var toStr = Object.prototype.toString;
var hasOwnProperty = Object.prototype.hasOwnProperty;

/** @type {<This, A extends readonly unknown[]>(arr: A, iterator: (this: This | void, value: A[number], index: number, arr: A) => void, receiver: This | undefined) => void} */
var forEachArray = function forEachArray(array, iterator, receiver) {
  for (var i = 0, len = array.length; i < len; i++) {
    if (hasOwnProperty.call(array, i)) {
      if (receiver == null) {
        iterator(array[i], i, array);
      } else {
        iterator.call(receiver, array[i], i, array);
      }
    }
  }
};

/** @type {<This, S extends string>(string: S, iterator: (this: This | void, value: S[number], index: number, string: S) => void, receiver: This | undefined) => void} */
var forEachString = function forEachString(string, iterator, receiver) {
  for (var i = 0, len = string.length; i < len; i++) {
    // no such thing as a sparse string.
    if (receiver == null) {
      iterator(string.charAt(i), i, string);
    } else {
      iterator.call(receiver, string.charAt(i), i, string);
    }
  }
};

/** @type {<This, O>(obj: O, iterator: (this: This | void, value: O[keyof O], index: keyof O, obj: O) => void, receiver: This | undefined) => void} */
var forEachObject = function forEachObject(object, iterator, receiver) {
  for (var k in object) {
    if (hasOwnProperty.call(object, k)) {
      if (receiver == null) {
        iterator(object[k], k, object);
      } else {
        iterator.call(receiver, object[k], k, object);
      }
    }
  }
};

/** @type {(x: unknown) => x is readonly unknown[]} */
function isArray(x) {
  return toStr.call(x) === '[object Array]';
}

/** @type {import('.')._internal} */
module.exports = function forEach(list, iterator, thisArg) {
  if (!isCallable(iterator)) {
    throw new TypeError('iterator must be a function');
  }
  var receiver;
  if (arguments.length >= 3) {
    receiver = thisArg;
  }
  if (isArray(list)) {
    forEachArray(list, iterator, receiver);
  } else if (typeof list === 'string') {
    forEachString(list, iterator, receiver);
  } else {
    forEachObject(list, iterator, receiver);
  }
};

/***/ },

/***/ 9414
/*!**************************************************!*\
  !*** ../app/node_modules/call-bind/callBound.js ***!
  \**************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ 6852);
var callBind = __webpack_require__(/*! ./ */ 3990);
var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
module.exports = function callBoundIntrinsic(name, allowMissing) {
  var intrinsic = GetIntrinsic(name, !!allowMissing);
  if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
    return callBind(intrinsic);
  }
  return intrinsic;
};

/***/ },

/***/ 9448
/*!********************************************!*\
  !*** ../app/node_modules/es-errors/uri.js ***!
  \********************************************/
(module) {

"use strict";


/** @type {import('./uri')} */
module.exports = URIError;

/***/ },

/***/ 9470
/*!***********************************************************!*\
  !*** ../app/node_modules/regexp.prototype.flags/index.js ***!
  \***********************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var define = __webpack_require__(/*! define-properties */ 2445);
var callBind = __webpack_require__(/*! call-bind */ 3990);
var implementation = __webpack_require__(/*! ./implementation */ 3606);
var getPolyfill = __webpack_require__(/*! ./polyfill */ 6919);
var shim = __webpack_require__(/*! ./shim */ 1625);
var flagsBound = callBind(getPolyfill());
define(flagsBound, {
  getPolyfill: getPolyfill,
  implementation: implementation,
  shim: shim
});
module.exports = flagsBound;

/***/ },

/***/ 9527
/*!********************************************************************!*\
  !*** ./src/components/colorSchemePreview.component.pug?ngResource ***!
  \********************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/colorSchemePreview.component.pug?ngResource */ 474);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 9546
/*!****************************************************************************************************************************************************!*\
  !*** ../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./src/components/colorSchemePreview.component.scss?ngResource ***!
  \****************************************************************************************************************************************************/
(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/sourceMaps.js */ 1333);
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ 5955);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ":host{display:block}.preview{margin-top:10px;margin-left:10px;padding:5px 10px;border-radius:4px;overflow:hidden}.preview span{white-space:pre}", "",{"version":3,"sources":["webpack://./src/components/colorSchemePreview.component.scss"],"names":[],"mappings":"AAAA,MACI,aAAA,CAGJ,SACI,eAAA,CACA,gBAAA,CACA,gBAAA,CACA,iBAAA,CACA,eAAA,CAEA,cACI,eAAA","sourcesContent":[":host {\n    display: block;\n}\n\n.preview {\n    margin-top: 10px;\n    margin-left: 10px;\n    padding: 5px 10px;\n    border-radius: 4px;\n    overflow: hidden;\n\n    span {\n        white-space: pre;\n    }\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ },

/***/ 9547
/*!********************************************!*\
  !*** ../app/node_modules/isarray/index.js ***!
  \********************************************/
(module) {

var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
  return toString.call(arr) == '[object Array]';
};

/***/ },

/***/ 9648
/*!*******************************************************************!*\
  !*** ../app/node_modules/call-bind-apply-helpers/reflectApply.js ***!
  \*******************************************************************/
(module) {

"use strict";


/** @type {import('./reflectApply')} */
module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;

/***/ },

/***/ 9683
/*!**************************************************!*\
  !*** ../app/node_modules/math-intrinsics/abs.js ***!
  \**************************************************/
(module) {

"use strict";


/** @type {import('./abs')} */
module.exports = Math.abs;

/***/ },

/***/ 9691
/*!*****************************!*\
  !*** ./src/icons/close.svg ***!
  \*****************************/
(module) {

module.exports = "<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fal\" data-icon=\"xmark\" class=\"svg-inline--fa fa-xmark\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\"><path fill=\"currentColor\" d=\"M315.3 411.3c-6.253 6.253-16.37 6.253-22.63 0L160 278.6l-132.7 132.7c-6.253 6.253-16.37 6.253-22.63 0c-6.253-6.253-6.253-16.37 0-22.63L137.4 256L4.69 123.3c-6.253-6.253-6.253-16.37 0-22.63c6.253-6.253 16.37-6.253 22.63 0L160 233.4l132.7-132.7c6.253-6.253 16.37-6.253 22.63 0c6.253 6.253 6.253 16.37 0 22.63L182.6 256l132.7 132.7C321.6 394.9 321.6 405.1 315.3 411.3z\"></path></svg>"

/***/ },

/***/ 9702
/*!*****************************************************************************!*\
  !*** ./src/components/colorSchemeSettingsForMode.component.scss?ngResource ***!
  \*****************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {


        var result = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./colorSchemeSettingsForMode.component.scss?ngResource */ 3139);

        if (result && result.__esModule) {
            result = result.default;
        }

        if (typeof result === "string") {
            module.exports = result;
        } else {
            module.exports = result.toString();
        }
    

/***/ },

/***/ 9738
/*!******************************!*\
  !*** ./src/icons/regexp.svg ***!
  \******************************/
(module) {

module.exports = "<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fal\" data-icon=\"asterisk\" class=\"svg-inline--fa fa-asterisk\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path fill=\"currentColor\" d=\"M413.8 368.1C410.8 373.2 405.5 376 399.1 376c-2.766 0-5.562-.7187-8.125-2.219L240 284V464c0 8.844-7.156 16-15.1 16S208 472.8 208 464V284l-151.9 89.73C53.58 375.3 50.79 376 48.02 376c-5.469 0-10.8-2.812-13.8-7.859c-4.484-7.609-1.969-17.42 5.641-21.92L192.5 256L39.86 165.8c-7.609-4.5-10.12-14.31-5.641-21.92c4.531-7.578 14.31-10.06 21.92-5.641L208 227.1V48C208 39.16 215.2 32 224 32S240 39.16 240 48v179.1l151.9-89.73c7.641-4.422 17.42-1.938 21.92 5.641c4.484 7.609 1.969 17.42-5.641 21.92L255.5 256l152.7 90.22C415.7 350.7 418.3 360.5 413.8 368.1z\"></path></svg>"

/***/ },

/***/ 9765
/*!*********************************************!*\
  !*** external "@ng-bootstrap/ng-bootstrap" ***!
  \*********************************************/
(module) {

"use strict";
module.exports = __WEBPACK_EXTERNAL_MODULE__9765__;

/***/ },

/***/ 9868
/*!*****************************************************************!*\
  !*** ./src/components/terminalToolbar.component.pug?ngResource ***!
  \*****************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

var req = __webpack_require__(/*! !!../node_modules/pug-loader/index.js??ruleSet[1].rules[4].use[1]!./src/components/terminalToolbar.component.pug?ngResource */ 6627);
module.exports = (req['default'] || req).apply(req, [])

/***/ },

/***/ 9875
/*!***********************************************!*\
  !*** ../app/node_modules/dunder-proto/get.js ***!
  \***********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var callBind = __webpack_require__(/*! call-bind-apply-helpers */ 5603);
var gOPD = __webpack_require__(/*! gopd */ 1284);
var hasProtoAccessor;
try {
  // eslint-disable-next-line no-extra-parens, no-proto
  hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */[].__proto__ === Array.prototype;
} catch (e) {
  if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
    throw e;
  }
}

// eslint-disable-next-line no-extra-parens
var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */'__proto__');
var $Object = Object;
var $getPrototypeOf = $Object.getPrototypeOf;

/** @type {import('./get')} */
module.exports = desc && typeof desc.get === 'function' ? callBind([desc.get]) : typeof $getPrototypeOf === 'function' ? /** @type {import('./get')} */function getDunder(value) {
  // eslint-disable-next-line eqeqeq
  return $getPrototypeOf(value == null ? value : $Object(value));
} : false;

/***/ },

/***/ 9885
/*!**********************************************!*\
  !*** ../app/node_modules/is-symbol/index.js ***!
  \**********************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var callBound = __webpack_require__(/*! call-bound */ 4731);
var $toString = callBound('Object.prototype.toString');
var hasSymbols = __webpack_require__(/*! has-symbols */ 8354)();
var safeRegexTest = __webpack_require__(/*! safe-regex-test */ 8480);
if (hasSymbols) {
  var $symToStr = callBound('Symbol.prototype.toString');
  var isSymString = safeRegexTest(/^Symbol\(.*\)$/);

  /** @type {(value: object) => value is Symbol} */
  var isSymbolObject = function isRealSymbolObject(value) {
    if (typeof value.valueOf() !== 'symbol') {
      return false;
    }
    return isSymString($symToStr(value));
  };

  /** @type {import('.')} */
  module.exports = function isSymbol(value) {
    if (typeof value === 'symbol') {
      return true;
    }
    if (!value || typeof value !== 'object' || $toString(value) !== '[object Symbol]') {
      return false;
    }
    try {
      return isSymbolObject(value);
    } catch (e) {
      return false;
    }
  };
} else {
  /** @type {import('.')} */
  module.exports = function isSymbol(value) {
    // this environment does not support Symbols.
    return  false && 0;
  };
}

/***/ },

/***/ 9944
/*!************************************************!*\
  !*** ../app/node_modules/has-symbols/shams.js ***!
  \************************************************/
(module) {

"use strict";


/** @type {import('./shams')} */
/* eslint complexity: [2, 18], max-statements: [2, 33] */
module.exports = function hasSymbols() {
  if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') {
    return false;
  }
  if (typeof Symbol.iterator === 'symbol') {
    return true;
  }

  /** @type {{ [k in symbol]?: unknown }} */
  var obj = {};
  var sym = Symbol('test');
  var symObj = Object(sym);
  if (typeof sym === 'string') {
    return false;
  }
  if (Object.prototype.toString.call(sym) !== '[object Symbol]') {
    return false;
  }
  if (Object.prototype.toString.call(symObj) !== '[object Symbol]') {
    return false;
  }

  // temp disabled per https://github.com/ljharb/object.assign/issues/17
  // if (sym instanceof Symbol) { return false; }
  // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
  // if (!(symObj instanceof Symbol)) { return false; }

  // if (typeof Symbol.prototype.toString !== 'function') { return false; }
  // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }

  var symVal = 42;
  obj[sym] = symVal;
  for (var _ in obj) {
    return false;
  } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
  if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) {
    return false;
  }
  if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) {
    return false;
  }
  var syms = Object.getOwnPropertySymbols(obj);
  if (syms.length !== 1 || syms[0] !== sym) {
    return false;
  }
  if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
    return false;
  }
  if (typeof Object.getOwnPropertyDescriptor === 'function') {
    // eslint-disable-next-line no-extra-parens
    var descriptor = /** @type {PropertyDescriptor} */Object.getOwnPropertyDescriptor(obj, sym);
    if (descriptor.value !== symVal || descriptor.enumerable !== true) {
      return false;
    }
  }
  return true;
};

/***/ }

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Check if module exists (development only)
/******/ 		if (__webpack_modules__[moduleId] === undefined) {
/******/ 			var e = new Error("Cannot find module '" + moduleId + "'");
/******/ 			e.code = 'MODULE_NOT_FOUND';
/******/ 			throw e;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			id: moduleId,
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = __webpack_modules__;
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/nonce */
/******/ 	(() => {
/******/ 		__webpack_require__.nc = undefined;
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/require chunk loading */
/******/ 	(() => {
/******/ 		__webpack_require__.b = require("node:url").pathToFileURL(__filename);
/******/ 		
/******/ 		// object to store loaded chunks
/******/ 		// "1" means "loaded", otherwise not loaded yet
/******/ 		var installedChunks = {
/******/ 			792: 1
/******/ 		};
/******/ 		
/******/ 		// no on chunks loaded
/******/ 		
/******/ 		// no chunk install function needed
/******/ 		
/******/ 		// no chunk loading
/******/ 		
/******/ 		// no external install chunk
/******/ 		
/******/ 		// no HMR
/******/ 		
/******/ 		// no HMR manifest
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
(() => {
"use strict";
/*!***********************************!*\
  !*** ./src/index.ts + 51 modules ***!
  \***********************************/
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  BaseSession: () => (/* reexport */ BaseSession),
  BaseTerminalTabComponent: () => (/* reexport */ BaseTerminalTabComponent),
  ConnectableTerminalTabComponent: () => (/* reexport */ ConnectableTerminalTabComponent),
  Frontend: () => (/* reexport */ Frontend),
  InputProcessor: () => (/* reexport */ InputProcessor),
  LoginScriptProcessor: () => (/* reexport */ LoginScriptProcessor),
  LoginScriptsSettingsComponent: () => (/* reexport */ LoginScriptsSettingsComponent),
  MultifocusService: () => (/* reexport */ MultifocusService),
  OSCProcessor: () => (/* reexport */ OSCProcessor),
  SessionMiddleware: () => (/* reexport */ SessionMiddleware),
  SessionMiddlewareStack: () => (/* reexport */ SessionMiddlewareStack),
  StreamProcessingSettingsComponent: () => (/* reexport */ StreamProcessingSettingsComponent),
  TerminalColorSchemeProvider: () => (/* reexport */ TerminalColorSchemeProvider),
  TerminalContextMenuItemProvider: () => (/* reexport */ TerminalContextMenuItemProvider),
  TerminalDecorator: () => (/* reexport */ TerminalDecorator),
  TerminalStreamProcessor: () => (/* reexport */ TerminalStreamProcessor),
  UTF8SplitterMiddleware: () => (/* reexport */ UTF8SplitterMiddleware),
  XTermFrontend: () => (/* reexport */ XTermFrontend),
  XTermWebGLFrontend: () => (/* reexport */ XTermWebGLFrontend),
  "default": () => (/* binding */ src)
});

;// ./node_modules/tslib/tslib.es6.js
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */

var extendStatics = function (d, b) {
  extendStatics = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (d, b) {
    d.__proto__ = b;
  } || function (d, b) {
    for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
  };
  return extendStatics(d, b);
};
function __extends(d, b) {
  if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  extendStatics(d, b);
  function __() {
    this.constructor = d;
  }
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function () {
  __assign = Object.assign || function __assign(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];
      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
    }
    return t;
  };
  return __assign.apply(this, arguments);
};
function __rest(s, e) {
  var t = {};
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  }
  return t;
}
function __decorate(decorators, target, key, desc) {
  var c = arguments.length,
    r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
    d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
  return function (target, key) {
    decorator(target, key, paramIndex);
  };
}
function __metadata(metadataKey, metadataValue) {
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
  function adopt(value) {
    return value instanceof P ? value : new P(function (resolve) {
      resolve(value);
    });
  }
  return new (P || (P = Promise))(function (resolve, reject) {
    function fulfilled(value) {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    }
    function rejected(value) {
      try {
        step(generator["throw"](value));
      } catch (e) {
        reject(e);
      }
    }
    function step(result) {
      result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
    }
    step((generator = generator.apply(thisArg, _arguments || [])).next());
  });
}
function __generator(thisArg, body) {
  var _ = {
      label: 0,
      sent: function () {
        if (t[0] & 1) throw t[1];
        return t[1];
      },
      trys: [],
      ops: []
    },
    f,
    y,
    t,
    g;
  return g = {
    next: verb(0),
    "throw": verb(1),
    "return": verb(2)
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
    return this;
  }), g;
  function verb(n) {
    return function (v) {
      return step([n, v]);
    };
  }
  function step(op) {
    if (f) throw new TypeError("Generator is already executing.");
    while (_) try {
      if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
      if (y = 0, t) op = [op[0] & 2, t.value];
      switch (op[0]) {
        case 0:
        case 1:
          t = op;
          break;
        case 4:
          _.label++;
          return {
            value: op[1],
            done: false
          };
        case 5:
          _.label++;
          y = op[1];
          op = [0];
          continue;
        case 7:
          op = _.ops.pop();
          _.trys.pop();
          continue;
        default:
          if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
            _ = 0;
            continue;
          }
          if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
            _.label = op[1];
            break;
          }
          if (op[0] === 6 && _.label < t[1]) {
            _.label = t[1];
            t = op;
            break;
          }
          if (t && _.label < t[2]) {
            _.label = t[2];
            _.ops.push(op);
            break;
          }
          if (t[2]) _.ops.pop();
          _.trys.pop();
          continue;
      }
      op = body.call(thisArg, _);
    } catch (e) {
      op = [6, e];
      y = 0;
    } finally {
      f = t = 0;
    }
    if (op[0] & 5) throw op[1];
    return {
      value: op[0] ? op[1] : void 0,
      done: true
    };
  }
}
var __createBinding = Object.create ? function (o, m, k, k2) {
  if (k2 === undefined) k2 = k;
  Object.defineProperty(o, k2, {
    enumerable: true,
    get: function () {
      return m[k];
    }
  });
} : function (o, m, k, k2) {
  if (k2 === undefined) k2 = k;
  o[k2] = m[k];
};
function __exportStar(m, o) {
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
function __values(o) {
  var s = typeof Symbol === "function" && Symbol.iterator,
    m = s && o[s],
    i = 0;
  if (m) return m.call(o);
  if (o && typeof o.length === "number") return {
    next: function () {
      if (o && i >= o.length) o = void 0;
      return {
        value: o && o[i++],
        done: !o
      };
    }
  };
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
  var m = typeof Symbol === "function" && o[Symbol.iterator];
  if (!m) return o;
  var i = m.call(o),
    r,
    ar = [],
    e;
  try {
    while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  } catch (error) {
    e = {
      error: error
    };
  } finally {
    try {
      if (r && !r.done && (m = i["return"])) m.call(i);
    } finally {
      if (e) throw e.error;
    }
  }
  return ar;
}

/** @deprecated */
function __spread() {
  for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
  return ar;
}

/** @deprecated */
function __spreadArrays() {
  for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
  return r;
}
function __spreadArray(to, from, pack) {
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
    if (ar || !(i in from)) {
      if (!ar) ar = Array.prototype.slice.call(from, 0, i);
      ar[i] = from[i];
    }
  }
  return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
  return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var g = generator.apply(thisArg, _arguments || []),
    i,
    q = [];
  return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
    return this;
  }, i;
  function verb(n) {
    if (g[n]) i[n] = function (v) {
      return new Promise(function (a, b) {
        q.push([n, v, a, b]) > 1 || resume(n, v);
      });
    };
  }
  function resume(n, v) {
    try {
      step(g[n](v));
    } catch (e) {
      settle(q[0][3], e);
    }
  }
  function step(r) {
    r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
  }
  function fulfill(value) {
    resume("next", value);
  }
  function reject(value) {
    resume("throw", value);
  }
  function settle(f, v) {
    if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
  }
}
function __asyncDelegator(o) {
  var i, p;
  return i = {}, verb("next"), verb("throw", function (e) {
    throw e;
  }), verb("return"), i[Symbol.iterator] = function () {
    return this;
  }, i;
  function verb(n, f) {
    i[n] = o[n] ? function (v) {
      return (p = !p) ? {
        value: __await(o[n](v)),
        done: n === "return"
      } : f ? f(v) : v;
    } : f;
  }
}
function __asyncValues(o) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var m = o[Symbol.asyncIterator],
    i;
  return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
    return this;
  }, i);
  function verb(n) {
    i[n] = o[n] && function (v) {
      return new Promise(function (resolve, reject) {
        v = o[n](v), settle(resolve, reject, v.done, v.value);
      });
    };
  }
  function settle(resolve, reject, d, v) {
    Promise.resolve(v).then(function (v) {
      resolve({
        value: v,
        done: d
      });
    }, reject);
  }
}
function __makeTemplateObject(cooked, raw) {
  if (Object.defineProperty) {
    Object.defineProperty(cooked, "raw", {
      value: raw
    });
  } else {
    cooked.raw = raw;
  }
  return cooked;
}
;
var __setModuleDefault = Object.create ? function (o, v) {
  Object.defineProperty(o, "default", {
    enumerable: true,
    value: v
  });
} : function (o, v) {
  o["default"] = v;
};
function __importStar(mod) {
  if (mod && mod.__esModule) return mod;
  var result = {};
  if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  __setModuleDefault(result, mod);
  return result;
}
function __importDefault(mod) {
  return mod && mod.__esModule ? mod : {
    default: mod
  };
}
function __classPrivateFieldGet(receiver, state, kind, f) {
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
  if (kind === "m") throw new TypeError("Private method is not writable");
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
}
// EXTERNAL MODULE: external "@angular/core"
var core_ = __webpack_require__(860);
// EXTERNAL MODULE: external "@angular/common"
var common_ = __webpack_require__(4358);
// EXTERNAL MODULE: external "@angular/forms"
var forms_ = __webpack_require__(7182);
// EXTERNAL MODULE: external "@ng-bootstrap/ng-bootstrap"
var ng_bootstrap_ = __webpack_require__(9765);
// EXTERNAL MODULE: external "ngx-toastr"
var external_ngx_toastr_ = __webpack_require__(6523);
// EXTERNAL MODULE: external "@angular/animations"
var animations_ = __webpack_require__(1448);
;// ./node_modules/ngx-colors/fesm2015/ngx-colors.mjs






const _c0 = ["hueSlider"];
const _c1 = ["alphaSlider"];
function ColorPickerComponent_div_2_Template(rf, ctx) {
  if (rf & 1) {
    const _r6 = core_["ɵɵgetCurrentView"]();
    core_["ɵɵelementStart"](0, "div", 8);
    core_["ɵɵlistener"]("newValue", function ColorPickerComponent_div_2_Template_div_newValue_0_listener($event) {
      core_["ɵɵrestoreView"](_r6);
      const ctx_r5 = core_["ɵɵnextContext"]();
      return core_["ɵɵresetView"](ctx_r5.onSliderChange("saturation-lightness", $event));
    });
    core_["ɵɵelementStart"](1, "div", 9);
    core_["ɵɵelement"](2, "div");
    core_["ɵɵelementEnd"]()();
  }
  if (rf & 2) {
    const ctx_r1 = core_["ɵɵnextContext"]();
    core_["ɵɵstyleProp"]("background-color", ctx_r1.hueSliderColor);
    core_["ɵɵproperty"]("rgX", 1)("rgY", 1);
    core_["ɵɵadvance"](1);
    core_["ɵɵstyleProp"]("top", ctx_r1.slider == null ? null : ctx_r1.slider.v, "px")("left", ctx_r1.slider == null ? null : ctx_r1.slider.s, "px");
  }
}
function ColorPickerComponent_div_4_Template(rf, ctx) {
  if (rf & 1) {
    core_["ɵɵelementStart"](0, "div", 10);
    core_["ɵɵelement"](1, "div", 11)(2, "div", 12);
    core_["ɵɵelementEnd"]();
  }
  if (rf & 2) {
    const ctx_r2 = core_["ɵɵnextContext"]();
    core_["ɵɵadvance"](2);
    core_["ɵɵstyleProp"]("background-color", ctx_r2.selectedColor);
  }
}
function ColorPickerComponent_div_6_Template(rf, ctx) {
  if (rf & 1) {
    const _r9 = core_["ɵɵgetCurrentView"]();
    core_["ɵɵelementStart"](0, "div", 13, 14);
    core_["ɵɵlistener"]("newValue", function ColorPickerComponent_div_6_Template_div_newValue_0_listener($event) {
      core_["ɵɵrestoreView"](_r9);
      const ctx_r8 = core_["ɵɵnextContext"]();
      return core_["ɵɵresetView"](ctx_r8.onSliderChange("hue", $event));
    });
    core_["ɵɵelementStart"](2, "div", 15)(3, "div");
    core_["ɵɵelement"](4, "div");
    core_["ɵɵelementEnd"]()()();
  }
  if (rf & 2) {
    const ctx_r3 = core_["ɵɵnextContext"]();
    core_["ɵɵproperty"]("rgX", 1);
    core_["ɵɵadvance"](2);
    core_["ɵɵstyleProp"]("left", ctx_r3.slider == null ? null : ctx_r3.slider.h, "px");
  }
}
function ColorPickerComponent_div_7_Template(rf, ctx) {
  if (rf & 1) {
    const _r12 = core_["ɵɵgetCurrentView"]();
    core_["ɵɵelementStart"](0, "div", 16, 17);
    core_["ɵɵlistener"]("newValue", function ColorPickerComponent_div_7_Template_div_newValue_0_listener($event) {
      core_["ɵɵrestoreView"](_r12);
      const ctx_r11 = core_["ɵɵnextContext"]();
      return core_["ɵɵresetView"](ctx_r11.onSliderChange("alpha", $event));
    });
    core_["ɵɵelement"](2, "div", 18);
    core_["ɵɵelementStart"](3, "div", 15)(4, "div");
    core_["ɵɵelement"](5, "div");
    core_["ɵɵelementEnd"]()()();
  }
  if (rf & 2) {
    const ctx_r4 = core_["ɵɵnextContext"]();
    core_["ɵɵproperty"]("rgX", 1);
    core_["ɵɵadvance"](2);
    core_["ɵɵproperty"]("ngStyle", ctx_r4.getBackgroundColor(ctx_r4.alphaSliderColor));
    core_["ɵɵadvance"](1);
    core_["ɵɵstyleProp"]("left", ctx_r4.slider == null ? null : ctx_r4.slider.a, "px");
  }
}
const _c2 = ["dialog"];
function PanelComponent_ng_container_2_ng_container_2_div_3_Template(rf, ctx) {
  if (rf & 1) {
    core_["ɵɵelement"](0, "div", 11);
  }
}
function PanelComponent_ng_container_2_ng_container_2_Template(rf, ctx) {
  if (rf & 1) {
    const _r12 = core_["ɵɵgetCurrentView"]();
    core_["ɵɵelementContainerStart"](0);
    core_["ɵɵelementStart"](1, "div", 8)(2, "div", 9);
    core_["ɵɵlistener"]("click", function PanelComponent_ng_container_2_ng_container_2_Template_div_click_2_listener() {
      const restoredCtx = core_["ɵɵrestoreView"](_r12);
      const color_r8 = restoredCtx.$implicit;
      const ctx_r11 = core_["ɵɵnextContext"](2);
      return core_["ɵɵresetView"](ctx_r11.onColorClick(color_r8));
    });
    core_["ɵɵtemplate"](3, PanelComponent_ng_container_2_ng_container_2_div_3_Template, 1, 0, "div", 10);
    core_["ɵɵelementEnd"]()();
    core_["ɵɵelementContainerEnd"]();
  }
  if (rf & 2) {
    const color_r8 = ctx.$implicit;
    const i_r9 = ctx.index;
    const ctx_r5 = core_["ɵɵnextContext"](2);
    core_["ɵɵadvance"](2);
    core_["ɵɵclassProp"]("colornull", !color_r8);
    core_["ɵɵproperty"]("ngStyle", ctx_r5.getBackgroundColor(color_r8));
    core_["ɵɵadvance"](1);
    core_["ɵɵproperty"]("ngIf", i_r9 == ctx_r5.indexSeleccionado);
  }
}
function PanelComponent_ng_container_2_div_3_div_1_Template(rf, ctx) {
  if (rf & 1) {
    core_["ɵɵelement"](0, "div", 17);
  }
  if (rf & 2) {
    const ctx_r13 = core_["ɵɵnextContext"](3);
    core_["ɵɵproperty"]("ngStyle", ctx_r13.getBackgroundColor(ctx_r13.color));
  }
}
function PanelComponent_ng_container_2_div_3_Template(rf, ctx) {
  if (rf & 1) {
    const _r15 = core_["ɵɵgetCurrentView"]();
    core_["ɵɵelementStart"](0, "div", 12);
    core_["ɵɵlistener"]("click", function PanelComponent_ng_container_2_div_3_Template_div_click_0_listener() {
      core_["ɵɵrestoreView"](_r15);
      const ctx_r14 = core_["ɵɵnextContext"](2);
      return core_["ɵɵresetView"](ctx_r14.addColor());
    });
    core_["ɵɵtemplate"](1, PanelComponent_ng_container_2_div_3_div_1_Template, 1, 1, "div", 13);
    core_["ɵɵnamespaceSVG"]();
    core_["ɵɵelementStart"](2, "svg", 14);
    core_["ɵɵelement"](3, "path", 15)(4, "path", 16);
    core_["ɵɵelementEnd"]()();
  }
  if (rf & 2) {
    const ctx_r6 = core_["ɵɵnextContext"](2);
    core_["ɵɵadvance"](1);
    core_["ɵɵproperty"]("ngIf", !ctx_r6.indexSeleccionado);
  }
}
function PanelComponent_ng_container_2_color_picker_4_Template(rf, ctx) {
  if (rf & 1) {
    const _r17 = core_["ɵɵgetCurrentView"]();
    core_["ɵɵelementStart"](0, "color-picker", 18);
    core_["ɵɵlistener"]("colorChange", function PanelComponent_ng_container_2_color_picker_4_Template_color_picker_colorChange_0_listener($event) {
      core_["ɵɵrestoreView"](_r17);
      const ctx_r16 = core_["ɵɵnextContext"](2);
      return core_["ɵɵresetView"](ctx_r16.onChangeColorPicker($event));
    })("onAlphaChange", function PanelComponent_ng_container_2_color_picker_4_Template_color_picker_onAlphaChange_0_listener($event) {
      core_["ɵɵrestoreView"](_r17);
      const ctx_r18 = core_["ɵɵnextContext"](2);
      return core_["ɵɵresetView"](ctx_r18.onAlphaChange($event));
    });
    core_["ɵɵelementEnd"]();
  }
  if (rf & 2) {
    const ctx_r7 = core_["ɵɵnextContext"](2);
    core_["ɵɵproperty"]("controls", ctx_r7.colorPickerControls)("color", ctx_r7.hsva);
  }
}
function PanelComponent_ng_container_2_Template(rf, ctx) {
  if (rf & 1) {
    core_["ɵɵelementContainerStart"](0);
    core_["ɵɵelementStart"](1, "div", 4);
    core_["ɵɵtemplate"](2, PanelComponent_ng_container_2_ng_container_2_Template, 4, 4, "ng-container", 5);
    core_["ɵɵtemplate"](3, PanelComponent_ng_container_2_div_3_Template, 5, 1, "div", 6);
    core_["ɵɵtemplate"](4, PanelComponent_ng_container_2_color_picker_4_Template, 1, 2, "color-picker", 7);
    core_["ɵɵelementEnd"]();
    core_["ɵɵelementContainerEnd"]();
  }
  if (rf & 2) {
    const ctx_r1 = core_["ɵɵnextContext"]();
    core_["ɵɵadvance"](1);
    core_["ɵɵproperty"]("@colorsAnimation", ctx_r1.colorsAnimationEffect);
    core_["ɵɵadvance"](1);
    core_["ɵɵproperty"]("ngForOf", ctx_r1.palette);
    core_["ɵɵadvance"](1);
    core_["ɵɵproperty"]("ngIf", !ctx_r1.hideColorPicker && ctx_r1.colorPickerControls != "only-alpha");
    core_["ɵɵadvance"](1);
    core_["ɵɵproperty"]("ngIf", !ctx_r1.hideColorPicker && ctx_r1.colorPickerControls == "only-alpha");
  }
}
function PanelComponent_ng_container_3_ng_container_7_div_3_Template(rf, ctx) {
  if (rf & 1) {
    core_["ɵɵelement"](0, "div", 11);
  }
}
const _c3 = function (a0) {
  return {
    background: a0
  };
};
function PanelComponent_ng_container_3_ng_container_7_Template(rf, ctx) {
  if (rf & 1) {
    const _r23 = core_["ɵɵgetCurrentView"]();
    core_["ɵɵnamespaceSVG"]();
    core_["ɵɵnamespaceHTML"]();
    core_["ɵɵelementContainerStart"](0);
    core_["ɵɵelementStart"](1, "div", 8)(2, "div", 24);
    core_["ɵɵlistener"]("click", function PanelComponent_ng_container_3_ng_container_7_Template_div_click_2_listener() {
      const restoredCtx = core_["ɵɵrestoreView"](_r23);
      const variant_r20 = restoredCtx.$implicit;
      const ctx_r22 = core_["ɵɵnextContext"](2);
      return core_["ɵɵresetView"](ctx_r22.changeColor(variant_r20));
    });
    core_["ɵɵtemplate"](3, PanelComponent_ng_container_3_ng_container_7_div_3_Template, 1, 0, "div", 10);
    core_["ɵɵelementEnd"]()();
    core_["ɵɵelementContainerEnd"]();
  }
  if (rf & 2) {
    const variant_r20 = ctx.$implicit;
    const ctx_r19 = core_["ɵɵnextContext"](2);
    core_["ɵɵadvance"](2);
    core_["ɵɵclassProp"]("colornull", !variant_r20);
    core_["ɵɵproperty"]("ngStyle", core_["ɵɵpureFunction1"](4, _c3, variant_r20));
    core_["ɵɵadvance"](1);
    core_["ɵɵproperty"]("ngIf", ctx_r19.isSelected(variant_r20));
  }
}
function PanelComponent_ng_container_3_Template(rf, ctx) {
  if (rf & 1) {
    const _r25 = core_["ɵɵgetCurrentView"]();
    core_["ɵɵelementContainerStart"](0);
    core_["ɵɵelementStart"](1, "div", 4)(2, "div", 19)(3, "div", 20);
    core_["ɵɵlistener"]("click", function PanelComponent_ng_container_3_Template_div_click_3_listener() {
      core_["ɵɵrestoreView"](_r25);
      const ctx_r24 = core_["ɵɵnextContext"]();
      return core_["ɵɵresetView"](ctx_r24.onClickBack());
    });
    core_["ɵɵnamespaceSVG"]();
    core_["ɵɵelementStart"](4, "svg", 21);
    core_["ɵɵelement"](5, "path", 22)(6, "path", 23);
    core_["ɵɵelementEnd"]()()();
    core_["ɵɵtemplate"](7, PanelComponent_ng_container_3_ng_container_7_Template, 4, 6, "ng-container", 5);
    core_["ɵɵelementEnd"]();
    core_["ɵɵelementContainerEnd"]();
  }
  if (rf & 2) {
    const ctx_r2 = core_["ɵɵnextContext"]();
    core_["ɵɵadvance"](1);
    core_["ɵɵproperty"]("@colorsAnimation", ctx_r2.colorsAnimationEffect);
    core_["ɵɵadvance"](6);
    core_["ɵɵproperty"]("ngForOf", ctx_r2.variants);
  }
}
function PanelComponent_ng_container_4_Template(rf, ctx) {
  if (rf & 1) {
    const _r27 = core_["ɵɵgetCurrentView"]();
    core_["ɵɵelementContainerStart"](0);
    core_["ɵɵelementStart"](1, "div", 25)(2, "div", 26);
    core_["ɵɵlistener"]("click", function PanelComponent_ng_container_4_Template_div_click_2_listener() {
      core_["ɵɵrestoreView"](_r27);
      const ctx_r26 = core_["ɵɵnextContext"]();
      return core_["ɵɵresetView"](ctx_r26.onClickBack());
    });
    core_["ɵɵnamespaceSVG"]();
    core_["ɵɵelementStart"](3, "svg", 21);
    core_["ɵɵelement"](4, "path", 22)(5, "path", 23);
    core_["ɵɵelementEnd"]()();
    core_["ɵɵnamespaceHTML"]();
    core_["ɵɵelementStart"](6, "button", 27);
    core_["ɵɵlistener"]("click", function PanelComponent_ng_container_4_Template_button_click_6_listener() {
      core_["ɵɵrestoreView"](_r27);
      const ctx_r28 = core_["ɵɵnextContext"]();
      return core_["ɵɵresetView"](ctx_r28.emitClose("cancel"));
    });
    core_["ɵɵtext"](7);
    core_["ɵɵelementEnd"]();
    core_["ɵɵelementStart"](8, "button", 27);
    core_["ɵɵlistener"]("click", function PanelComponent_ng_container_4_Template_button_click_8_listener() {
      core_["ɵɵrestoreView"](_r27);
      const ctx_r29 = core_["ɵɵnextContext"]();
      return core_["ɵɵresetView"](ctx_r29.emitClose("accept"));
    });
    core_["ɵɵtext"](9);
    core_["ɵɵelementEnd"]()();
    core_["ɵɵelementStart"](10, "div", 28)(11, "color-picker", 29);
    core_["ɵɵlistener"]("sliderChange", function PanelComponent_ng_container_4_Template_color_picker_sliderChange_11_listener($event) {
      core_["ɵɵrestoreView"](_r27);
      const ctx_r30 = core_["ɵɵnextContext"]();
      return core_["ɵɵresetView"](ctx_r30.onChangeColorPicker($event));
    });
    core_["ɵɵelementEnd"]()();
    core_["ɵɵelementContainerEnd"]();
  }
  if (rf & 2) {
    const ctx_r3 = core_["ɵɵnextContext"]();
    core_["ɵɵadvance"](7);
    core_["ɵɵtextInterpolate1"](" ", ctx_r3.cancelLabel, " ");
    core_["ɵɵadvance"](2);
    core_["ɵɵtextInterpolate1"](" ", ctx_r3.acceptLabel, " ");
    core_["ɵɵadvance"](2);
    core_["ɵɵproperty"]("controls", ctx_r3.colorPickerControls)("color", ctx_r3.hsva);
  }
}
function PanelComponent_div_5_Template(rf, ctx) {
  if (rf & 1) {
    const _r33 = core_["ɵɵgetCurrentView"]();
    core_["ɵɵelementStart"](0, "div", 30)(1, "p", 31);
    core_["ɵɵlistener"]("click", function PanelComponent_div_5_Template_p_click_1_listener() {
      core_["ɵɵrestoreView"](_r33);
      const ctx_r32 = core_["ɵɵnextContext"]();
      return core_["ɵɵresetView"](ctx_r32.nextFormat());
    });
    core_["ɵɵtext"](2);
    core_["ɵɵelementEnd"]();
    core_["ɵɵelementStart"](3, "div", 32)(4, "input", 33, 34);
    core_["ɵɵlistener"]("keyup", function PanelComponent_div_5_Template_input_keyup_4_listener() {
      core_["ɵɵrestoreView"](_r33);
      const _r31 = core_["ɵɵreference"](5);
      const ctx_r34 = core_["ɵɵnextContext"]();
      return core_["ɵɵresetView"](ctx_r34.changeColorManual(_r31.value));
    })("keydown.enter", function PanelComponent_div_5_Template_input_keydown_enter_4_listener() {
      core_["ɵɵrestoreView"](_r33);
      const ctx_r35 = core_["ɵɵnextContext"]();
      return core_["ɵɵresetView"](ctx_r35.emitClose("accept"));
    });
    core_["ɵɵelementEnd"]()()();
  }
  if (rf & 2) {
    const ctx_r4 = core_["ɵɵnextContext"]();
    core_["ɵɵadvance"](2);
    core_["ɵɵtextInterpolate"](ctx_r4.colorFormats[ctx_r4.format]);
    core_["ɵɵadvance"](2);
    core_["ɵɵstyleProp"]("font-size", ctx_r4.color && ctx_r4.color.length > 23 ? 9 : 10, "px")("letter-spacing", ctx_r4.color && ctx_r4.color.length > 16 ? 0 : 1.5, "px");
    core_["ɵɵproperty"]("value", ctx_r4.color);
  }
}
var ColorFormats;
(function (ColorFormats) {
  ColorFormats[ColorFormats["HEX"] = 0] = "HEX";
  ColorFormats[ColorFormats["RGBA"] = 1] = "RGBA";
  ColorFormats[ColorFormats["HSLA"] = 2] = "HSLA";
  ColorFormats[ColorFormats["CMYK"] = 3] = "CMYK";
})(ColorFormats || (ColorFormats = {}));
const defaultColors = [{
  color: "rojo",
  preview: "#E57373",
  variants: ["#FFEBEE", "#FFCDD2", "#EF9A9A", "#E57373", "#EF5350", "#F44336", "#E53935", "#D32F2F", "#C62828"]
}, {
  color: "rosa",
  preview: "#F06292",
  variants: ["#FCE4EC", "#F8BBD0", "#F48FB1", "#F06292", "#EC407A", "#E91E63", "#D81B60", "#C2185B", "#AD1457"]
}, {
  color: "purpura",
  preview: "#BA68C8",
  variants: ["#F3E5F5", "#E1BEE7", "#CE93D8", "#BA68C8", "#AB47BC", "#9C27B0", "#8E24AA", "#7B1FA2", "#6A1B9A"]
}, {
  color: "purpura oscuro",
  preview: "#9575CD",
  variants: ["#EDE7F6", "#D1C4E9", "#B39DDB", "#9575CD", "#7E57C2", "#673AB7", "#5E35B1", "#512DA8", "#4527A0"]
}, {
  color: "indigo",
  preview: "#7986CB",
  variants: ["#E8EAF6", "#C5CAE9", "#9FA8DA", "#7986CB", "#5C6BC0", "#3F51B5", "#3949AB", "#303F9F", "#283593"]
}, {
  color: "azul",
  preview: "#64B5F6",
  variants: ["#E3F2FD", "#BBDEFB", "#90CAF9", "#64B5F6", "#42A5F5", "#2196F3", "#1E88E5", "#1976D2", "#1565C0"]
}, {
  color: "celeste",
  preview: "#4FC3F7",
  variants: ["#E1F5FE", "#B3E5FC", "#81D4FA", "#4FC3F7", "#29B6F6", "#03A9F4", "#039BE5", "#0288D1", "#0277BD"]
}, {
  color: "cyan",
  preview: "#4DD0E1",
  variants: ["#E0F7FA", "#B2EBF2", "#80DEEA", "#4DD0E1", "#26C6DA", "#00BCD4", "#00ACC1", "#0097A7", "#00838F"]
}, {
  color: "color",
  preview: "#4DB6AC",
  variants: ["#E0F2F1", "#B2DFDB", "#80CBC4", "#4DB6AC", "#26A69A", "#009688", "#00897B", "#00796B", "#00695C"]
}, {
  color: "verde",
  preview: "#81C784",
  variants: ["#E8F5E9", "#C8E6C9", "#A5D6A7", "#81C784", "#66BB6A", "#4CAF50", "#43A047", "#388E3C", "#2E7D32"]
}, {
  color: "verde claro",
  preview: "#AED581",
  variants: ["#F1F8E9", "#DCEDC8", "#C5E1A5", "#AED581", "#9CCC65", "#8BC34A", "#7CB342", "#689F38", "#558B2F"]
}, {
  color: "lima",
  preview: "#DCE775",
  variants: ["#F9FBE7", "#F0F4C3", "#E6EE9C", "#DCE775", "#D4E157", "#CDDC39", "#C0CA33", "#AFB42B", "#9E9D24"]
}, {
  color: "amarillo",
  preview: "#FFF176",
  variants: ["#FFFDE7", "#FFF9C4", "#FFF59D", "#FFF176", "#FFEE58", "#FFEB3B", "#FDD835", "#FBC02D", "#F9A825"]
}, {
  color: "ambar",
  preview: "#FFD54F",
  variants: ["#FFF8E1", "#FFECB3", "#FFE082", "#FFD54F", "#FFCA28", "#FFC107", "#FFB300", "#FFA000", "#FF8F00"]
}, {
  color: "naranja",
  preview: "#FFB74D",
  variants: ["#FFF3E0", "#FFE0B2", "#FFCC80", "#FFB74D", "#FFA726", "#FF9800", "#FB8C00", "#F57C00", "#EF6C00"]
}, {
  color: "naranja oscuro",
  preview: "#FF8A65",
  variants: ["#FBE9E7", "#FFCCBC", "#FFAB91", "#FF8A65", "#FF7043", "#FF5722", "#F4511E", "#E64A19", "#D84315"]
}, {
  color: "marron",
  preview: "#A1887F",
  variants: ["#EFEBE9", "#D7CCC8", "#BCAAA4", "#A1887F", "#8D6E63", "#795548", "#6D4C41", "#5D4037", "#4E342E"]
}, {
  color: "escala de grises",
  preview: "#E0E0E0",
  variants: ["#FFFFFF", "#FAFAFA", "#F5F5F5", "#EEEEEE", "#E0E0E0", "#BDBDBD", "#9E9E9E", "#757575", "#616161", "#424242", "#000000"]
}, {
  color: "azul gris",
  preview: "#90A4AE",
  variants: ["#ECEFF1", "#CFD8DC", "#B0BEC5", "#90A4AE", "#78909C", "#607D8B", "#546E7A", "#455A64", "#37474F"]
}];
const formats = ['hex', 'rgba', 'hsla'];
class Rgba {
  constructor(r, g, b, a) {
    this.r = r;
    this.g = g;
    this.b = b;
    this.a = a;
  }
  denormalize() {
    this.r = Math.round(this.r * 255);
    this.g = Math.round(this.g * 255);
    this.b = Math.round(this.b * 255);
    return this;
  }
  toString() {
    this.denormalize();
    let output = 'rgb' + (this.a != 1 ? 'a(' : '(') + this.r + ', ' + this.g + ', ' + this.b + (this.a != 1 ? ', ' + this.a.toPrecision(2) + ')' : ')');
    return output;
  }
}
class Hsva {
  constructor(h, s, v, a) {
    this.h = h;
    this.s = s;
    this.v = v;
    this.a = a;
    this.onChange = new core_.EventEmitter(true);
  }
  onColorChange(value) {
    this.s = value.s / value.rgX;
    this.v = value.v / value.rgY;
  }
  onHueChange(value) {
    this.h = value.v / value.rgX;
    // this.sliderH = this.hsva.h;
  }
  onValueChange(value) {
    this.v = value.v / value.rgX;
  }
  onAlphaChange(value) {
    this.a = value.v / value.rgX;
  }
}
class Hsla {
  constructor(h, s, l, a) {
    this.h = h;
    this.s = s;
    this.l = l;
    this.a = a;
  }
  denormalize() {
    this.h = Math.round(this.h * 360);
    this.s = Math.round(this.s * 100);
    this.l = Math.round(this.l * 100);
    return this;
  }
  toString() {
    let output = 'hsl' + (this.a != 1 ? 'a(' : '(') + this.h + ', ' + this.s + '%, ' + this.l + '%' + (this.a != 1 ? ', ' + this.a.toPrecision(2) + ')' : ')');
    return output;
  }
}
class Cmyk {
  constructor(c, m, y, k, a = 1) {
    this.c = c;
    this.m = m;
    this.y = y;
    this.k = k;
    this.a = a;
  }
}
class NgxColor {
  constructor(params) {
    if (params) {
      this.preview = params.preview;
      this.variants = params.variants;
    }
  }
}
class ConverterService {
  // private active: ColorPickerComponent | null = null;
  constructor() {}
  // public setActive(active: ColorPickerComponent | null): void {
  //   this.active = active;
  // }
  toFormat(hsva, format) {
    var output = "";
    if (hsva) {
      switch (format) {
        case ColorFormats.HEX:
          var rgba = this.hsvaToRgba(hsva);
          rgba.denormalize();
          var output = this.rgbaToHex(rgba, true);
          break;
        case ColorFormats.HSLA:
          var hsla = this.hsva2hsla(hsva);
          hsla.denormalize();
          var output = hsla.toString();
          break;
        case ColorFormats.RGBA:
          var rgba = this.hsvaToRgba(hsva);
          var output = rgba.toString();
          break;
        case ColorFormats.CMYK:
          var rgba = this.hsvaToRgba(hsva);
          var cmyk = this.rgbaToCmyk(rgba);
          break;
      }
    }
    return output;
  }
  stringToFormat(color, format) {
    var hsva = this.stringToHsva(color, true);
    return this.toFormat(hsva, format);
  }
  hsva2hsla(hsva) {
    const h = hsva.h,
      s = hsva.s,
      v = hsva.v,
      a = hsva.a;
    if (v === 0) {
      return new Hsla(h, 0, 0, a);
    } else if (s === 0 && v === 1) {
      return new Hsla(h, 1, 1, a);
    } else {
      const l = v * (2 - s) / 2;
      return new Hsla(h, v * s / (1 - Math.abs(2 * l - 1)), l, a);
    }
  }
  hsla2hsva(hsla) {
    const h = Math.min(hsla.h, 1),
      s = Math.min(hsla.s, 1);
    const l = Math.min(hsla.l, 1),
      a = Math.min(hsla.a, 1);
    if (l === 0) {
      return new Hsva(h, 0, 0, a);
    } else {
      const v = l + s * (1 - Math.abs(2 * l - 1)) / 2;
      return new Hsva(h, 2 * (v - l) / v, v, a);
    }
  }
  hsvaToRgba(hsva) {
    let r, g, b;
    const h = hsva.h,
      s = hsva.s,
      v = hsva.v,
      a = hsva.a;
    const i = Math.floor(h * 6);
    const f = h * 6 - i;
    const p = v * (1 - s);
    const q = v * (1 - f * s);
    const t = v * (1 - (1 - f) * s);
    switch (i % 6) {
      case 0:
        r = v, g = t, b = p;
        break;
      case 1:
        r = q, g = v, b = p;
        break;
      case 2:
        r = p, g = v, b = t;
        break;
      case 3:
        r = p, g = q, b = v;
        break;
      case 4:
        r = t, g = p, b = v;
        break;
      case 5:
        r = v, g = p, b = q;
        break;
      default:
        r = 0, g = 0, b = 0;
    }
    return new Rgba(r, g, b, a);
  }
  cmykToRgb(cmyk) {
    const r = (1 - cmyk.c) * (1 - cmyk.k);
    const g = (1 - cmyk.m) * (1 - cmyk.k);
    const b = (1 - cmyk.y) * (1 - cmyk.k);
    return new Rgba(r, g, b, cmyk.a);
  }
  rgbaToCmyk(rgba) {
    const k = 1 - Math.max(rgba.r, rgba.g, rgba.b);
    if (k === 1) {
      return new Cmyk(0, 0, 0, 1, rgba.a);
    } else {
      const c = (1 - rgba.r - k) / (1 - k);
      const m = (1 - rgba.g - k) / (1 - k);
      const y = (1 - rgba.b - k) / (1 - k);
      return new Cmyk(c, m, y, k, rgba.a);
    }
  }
  rgbaToHsva(rgba) {
    let h, s;
    const r = Math.min(rgba.r, 1),
      g = Math.min(rgba.g, 1);
    const b = Math.min(rgba.b, 1),
      a = Math.min(rgba.a, 1);
    const max = Math.max(r, g, b),
      min = Math.min(r, g, b);
    const v = max,
      d = max - min;
    s = max === 0 ? 0 : d / max;
    if (max === min) {
      h = 0;
    } else {
      switch (max) {
        case r:
          h = (g - b) / d + (g < b ? 6 : 0);
          break;
        case g:
          h = (b - r) / d + 2;
          break;
        case b:
          h = (r - g) / d + 4;
          break;
        default:
          h = 0;
      }
      h /= 6;
    }
    return new Hsva(h, s, v, a);
  }
  rgbaToHex(rgba, allowHex8) {
    /* tslint:disable:no-bitwise */
    let hex = "#" + (1 << 24 | rgba.r << 16 | rgba.g << 8 | rgba.b).toString(16).substr(1);
    if (rgba.a != 1) {
      hex += (1 << 8 | Math.round(rgba.a * 255)).toString(16).substr(1);
    }
    /* tslint:enable:no-bitwise */
    return hex;
  }
  normalizeCMYK(cmyk) {
    return new Cmyk(cmyk.c / 100, cmyk.m / 100, cmyk.y / 100, cmyk.k / 100, cmyk.a);
  }
  denormalizeCMYK(cmyk) {
    return new Cmyk(Math.floor(cmyk.c * 100), Math.floor(cmyk.m * 100), Math.floor(cmyk.y * 100), Math.floor(cmyk.k * 100), cmyk.a);
  }
  denormalizeRGBA(rgba) {
    return new Rgba(Math.round(rgba.r * 255), Math.round(rgba.g * 255), Math.round(rgba.b * 255), rgba.a);
  }
  stringToHsva(colorString = "", allowHex8 = true) {
    let hsva = null;
    colorString = (colorString || "").toLowerCase();
    const stringParsers = [{
      re: /(rgb)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*%?,\s*(\d{1,3})\s*%?(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
      parse: function (execResult) {
        return new Rgba(parseInt(execResult[2], 10) / 255, parseInt(execResult[3], 10) / 255, parseInt(execResult[4], 10) / 255, isNaN(parseFloat(execResult[5])) ? 1 : parseFloat(execResult[5]));
      }
    }, {
      re: /(hsl)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
      parse: function (execResult) {
        return new Hsla(parseInt(execResult[2], 10) / 360, parseInt(execResult[3], 10) / 100, parseInt(execResult[4], 10) / 100, isNaN(parseFloat(execResult[5])) ? 1 : parseFloat(execResult[5]));
      }
    }];
    if (allowHex8) {
      stringParsers.push({
        re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})?$/,
        parse: function (execResult) {
          return new Rgba(parseInt(execResult[1], 16) / 255, parseInt(execResult[2], 16) / 255, parseInt(execResult[3], 16) / 255, parseInt(execResult[4] || "FF", 16) / 255);
        }
      });
    } else {
      stringParsers.push({
        re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,
        parse: function (execResult) {
          return new Rgba(parseInt(execResult[1], 16) / 255, parseInt(execResult[2], 16) / 255, parseInt(execResult[3], 16) / 255, 1);
        }
      });
    }
    stringParsers.push({
      re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,
      parse: function (execResult) {
        return new Rgba(parseInt(execResult[1] + execResult[1], 16) / 255, parseInt(execResult[2] + execResult[2], 16) / 255, parseInt(execResult[3] + execResult[3], 16) / 255, 1);
      }
    });
    for (const key in stringParsers) {
      if (stringParsers.hasOwnProperty(key)) {
        const parser = stringParsers[key];
        const match = parser.re.exec(colorString),
          color = match && parser.parse(match);
        if (color) {
          if (color instanceof Rgba) {
            hsva = this.rgbaToHsva(color);
          } else if (color instanceof Hsla) {
            hsva = this.hsla2hsva(color);
          }
          return hsva;
        }
      }
    }
    return hsva;
  }
  outputFormat(hsva) {
    return this.hsvaToRgba(hsva).toString();
  }
  getFormatByString(color) {
    if (color) {
      color = color.toLowerCase();
      let regexHex = /(#([\da-f]{3}(?:[\da-f]{3})?(?:[\da-f]{2})?))/;
      let regexRGBA = /(rgba\((\d{1,3},\s?){3}(1|0?\.\d+)\)|rgb\(\d{1,3}(,\s?\d{1,3}){2}\))/;
      let regexHSLA = /(hsla\((\d{1,3}%?,\s?){3}(1|0?\.\d+)\)|hsl\(\d{1,3}%?(,\s?\d{1,3}%?){2}\))/;
      if (regexHex.test(color)) {
        return "hex";
      } else if (regexRGBA.test(color)) {
        return "rgba";
      } else if (regexHSLA.test(color)) {
        return "hsla";
      }
    }
    return "hex";
  }
}
ConverterService.ɵfac = function ConverterService_Factory(t) {
  return new (t || ConverterService)();
};
ConverterService.ɵprov = /* @__PURE__ */core_["ɵɵdefineInjectable"]({
  token: ConverterService,
  factory: ConverterService.ɵfac
});
(function () {
  (typeof ngDevMode === "undefined" || ngDevMode) && core_["ɵsetClassMetadata"](ConverterService, [{
    type: core_.Injectable
  }], function () {
    return [];
  }, null);
})();
class SliderPosition {
  constructor(h, s, v, a) {
    this.h = h;
    this.s = s;
    this.v = v;
    this.a = a;
  }
}
class SliderDimension {
  constructor(h, s, v, a) {
    this.h = h;
    this.s = s;
    this.v = v;
    this.a = a;
  }
}
class SliderDirective {
  mouseDown(event) {
    this.start(event);
  }
  touchStart(event) {
    this.start(event);
  }
  constructor(elRef) {
    this.elRef = elRef;
    this.dragEnd = new core_.EventEmitter();
    this.dragStart = new core_.EventEmitter();
    this.newValue = new core_.EventEmitter();
    this.listenerMove = event => this.move(event);
    this.listenerStop = () => this.stop();
  }
  move(event) {
    event.preventDefault();
    this.setCursor(event);
  }
  start(event) {
    this.setCursor(event);
    event.stopPropagation();
    document.addEventListener('mouseup', this.listenerStop);
    document.addEventListener('touchend', this.listenerStop);
    document.addEventListener('mousemove', this.listenerMove);
    document.addEventListener('touchmove', this.listenerMove);
    this.dragStart.emit();
  }
  stop() {
    document.removeEventListener('mouseup', this.listenerStop);
    document.removeEventListener('touchend', this.listenerStop);
    document.removeEventListener('mousemove', this.listenerMove);
    document.removeEventListener('touchmove', this.listenerMove);
    this.dragEnd.emit();
  }
  getX(event) {
    const position = this.elRef.nativeElement.getBoundingClientRect();
    const pageX = event.pageX !== undefined ? event.pageX : event.touches[0].pageX;
    return pageX - position.left - window.pageXOffset;
  }
  getY(event) {
    const position = this.elRef.nativeElement.getBoundingClientRect();
    const pageY = event.pageY !== undefined ? event.pageY : event.touches[0].pageY;
    return pageY - position.top - window.pageYOffset;
  }
  setCursor(event) {
    const width = this.elRef.nativeElement.offsetWidth;
    const height = this.elRef.nativeElement.offsetHeight;
    const x = Math.max(0, Math.min(this.getX(event), width));
    const y = Math.max(0, Math.min(this.getY(event), height));
    if (this.rgX !== undefined && this.rgY !== undefined) {
      this.newValue.emit({
        s: x / width,
        v: 1 - y / height,
        rgX: this.rgX,
        rgY: this.rgY
      });
    } else if (this.rgX === undefined && this.rgY !== undefined) {
      this.newValue.emit({
        v: y / height,
        rgY: this.rgY
      });
    } else if (this.rgX !== undefined && this.rgY === undefined) {
      this.newValue.emit({
        v: x / width,
        rgX: this.rgX
      });
    }
  }
}
SliderDirective.ɵfac = function SliderDirective_Factory(t) {
  return new (t || SliderDirective)(core_["ɵɵdirectiveInject"](core_.ElementRef));
};
SliderDirective.ɵdir = /* @__PURE__ */core_["ɵɵdefineDirective"]({
  type: SliderDirective,
  selectors: [["", "slider", ""]],
  hostBindings: function SliderDirective_HostBindings(rf, ctx) {
    if (rf & 1) {
      core_["ɵɵlistener"]("mousedown", function SliderDirective_mousedown_HostBindingHandler($event) {
        return ctx.mouseDown($event);
      })("touchstart", function SliderDirective_touchstart_HostBindingHandler($event) {
        return ctx.touchStart($event);
      });
    }
  },
  inputs: {
    rgX: "rgX",
    rgY: "rgY",
    slider: "slider"
  },
  outputs: {
    dragEnd: "dragEnd",
    dragStart: "dragStart",
    newValue: "newValue"
  }
});
(function () {
  (typeof ngDevMode === "undefined" || ngDevMode) && core_["ɵsetClassMetadata"](SliderDirective, [{
    type: core_.Directive,
    args: [{
      selector: '[slider]'
    }]
  }], function () {
    return [{
      type: core_.ElementRef
    }];
  }, {
    rgX: [{
      type: core_.Input
    }],
    rgY: [{
      type: core_.Input
    }],
    slider: [{
      type: core_.Input
    }],
    dragEnd: [{
      type: core_.Output
    }],
    dragStart: [{
      type: core_.Output
    }],
    newValue: [{
      type: core_.Output
    }],
    mouseDown: [{
      type: core_.HostListener,
      args: ['mousedown', ['$event']]
    }],
    touchStart: [{
      type: core_.HostListener,
      args: ['touchstart', ['$event']]
    }]
  });
})();
class ColorPickerComponent {
  constructor(service, cdr) {
    this.service = service;
    this.cdr = cdr;
    //IO color
    this.color = new Hsva(0, 1, 1, 1);
    this.controls = "default";
    this.sliderChange = new core_.EventEmitter(false);
    this.onAlphaChange = new core_.EventEmitter(false);
    //Event triggered when any slider change
    // @Output() colorSelectedChange:EventEmitter<Hsva> = new EventEmitter<Hsva>(false);
    this.hsva = new Hsva(0, 1, 1, 1);
    this.selectedColor = "#000000";
    this.fallbackColor = "#000000";
  }
  ngOnInit() {
    if (!this.color) {
      this.color = new Hsva(0, 1, 1, 1);
    }
    this.slider = new SliderPosition(0, 0, 0, 0);
    this.update();
  }
  ngOnDestroy() {}
  ngOnChanges(changes) {
    if (changes.color && this.color) {
      this.update();
    }
  }
  ngAfterViewInit() {
    var _a, _b;
    const hueWidth = ((_a = this.hueSlider) === null || _a === void 0 ? void 0 : _a.nativeElement.offsetWidth) || 140;
    const alphaWidth = ((_b = this.alphaSlider) === null || _b === void 0 ? void 0 : _b.nativeElement.offsetWidth) || 140;
    this.sliderDimMax = new SliderDimension(hueWidth, 220, 130, alphaWidth);
    this.update();
  }
  onSliderChange(type, event) {
    switch (type) {
      case "saturation-lightness":
        this.hsva.onColorChange(event);
        break;
      case "hue":
        this.hsva.onHueChange(event);
        break;
      case "alpha":
        this.hsva.onAlphaChange(event);
        this.onAlphaChange.emit(event);
        break;
      case "value":
        this.hsva.onValueChange(event);
        break;
    }
    // this.sHue = this.hsva.h;
    this.update();
    this.setColor(this.outputColor);
  }
  setColor(color) {
    this.color = color;
    this.sliderChange.emit(this.color);
  }
  getBackgroundColor(color) {
    return {
      background: "linear-gradient(90deg, rgba(36,0,0,0) 0%, " + color + " 100%)"
    };
  }
  update() {
    this.hsva = this.color;
    if (this.sliderDimMax) {
      let rgba = this.service.hsvaToRgba(this.hsva).denormalize();
      let hue = this.service.hsvaToRgba(new Hsva(this.hsva.h, 1, 1, 1)).denormalize();
      this.hueSliderColor = "rgb(" + hue.r + "," + hue.g + "," + hue.b + ")";
      this.alphaSliderColor = "rgb(" + rgba.r + "," + rgba.g + "," + rgba.b + ")";
      this.outputColor = this.hsva;
      this.selectedColor = this.service.hsvaToRgba(this.hsva).toString();
      this.slider = new SliderPosition(
      // (this.sHue || this.hsva.h) * this.sliderDimMax.h - 8,
      this.hsva.h * this.sliderDimMax.h - 5, this.hsva.s * this.sliderDimMax.s - 8, (1 - this.hsva.v) * this.sliderDimMax.v - 8, this.hsva.a * this.sliderDimMax.a - 5);
      this.cdr.detectChanges();
    }
  }
}
ColorPickerComponent.ɵfac = function ColorPickerComponent_Factory(t) {
  return new (t || ColorPickerComponent)(core_["ɵɵdirectiveInject"](ConverterService), core_["ɵɵdirectiveInject"](core_.ChangeDetectorRef));
};
ColorPickerComponent.ɵcmp = /* @__PURE__ */core_["ɵɵdefineComponent"]({
  type: ColorPickerComponent,
  selectors: [["color-picker"]],
  viewQuery: function ColorPickerComponent_Query(rf, ctx) {
    if (rf & 1) {
      core_["ɵɵviewQuery"](_c0, 5);
      core_["ɵɵviewQuery"](_c1, 5);
    }
    if (rf & 2) {
      let _t;
      core_["ɵɵqueryRefresh"](_t = core_["ɵɵloadQuery"]()) && (ctx.hueSlider = _t.first);
      core_["ɵɵqueryRefresh"](_t = core_["ɵɵloadQuery"]()) && (ctx.alphaSlider = _t.first);
    }
  },
  inputs: {
    color: "color",
    controls: "controls"
  },
  outputs: {
    sliderChange: "sliderChange",
    onAlphaChange: "onAlphaChange"
  },
  features: [core_["ɵɵNgOnChangesFeature"]],
  decls: 8,
  vars: 4,
  consts: [[1, "color-picker", 3, "click"], ["dialogPopup", ""], ["class", "saturation-lightness", 3, "slider", "rgX", "rgY", "background-color", "newValue", 4, "ngIf"], [1, "hue-alpha", "box"], ["class", "left", 4, "ngIf"], [1, "right"], ["class", "hue", 3, "slider", "rgX", "newValue", 4, "ngIf"], ["class", "alpha", 3, "slider", "rgX", "newValue", 4, "ngIf"], [1, "saturation-lightness", 3, "slider", "rgX", "rgY", "newValue"], [1, "cursor"], [1, "left"], [1, "selected-color-background"], [1, "selected-color"], [1, "hue", 3, "slider", "rgX", "newValue"], ["hueSlider", ""], [1, "sliderCursor"], [1, "alpha", 3, "slider", "rgX", "newValue"], ["alphaSlider", ""], [1, "alpha-gradient", 3, "ngStyle"]],
  template: function ColorPickerComponent_Template(rf, ctx) {
    if (rf & 1) {
      core_["ɵɵelementStart"](0, "div", 0, 1);
      core_["ɵɵlistener"]("click", function ColorPickerComponent_Template_div_click_0_listener($event) {
        return $event.stopPropagation();
      });
      core_["ɵɵtemplate"](2, ColorPickerComponent_div_2_Template, 3, 8, "div", 2);
      core_["ɵɵelementStart"](3, "div", 3);
      core_["ɵɵtemplate"](4, ColorPickerComponent_div_4_Template, 3, 2, "div", 4);
      core_["ɵɵelementStart"](5, "div", 5);
      core_["ɵɵtemplate"](6, ColorPickerComponent_div_6_Template, 5, 3, "div", 6);
      core_["ɵɵtemplate"](7, ColorPickerComponent_div_7_Template, 6, 4, "div", 7);
      core_["ɵɵelementEnd"]()()();
    }
    if (rf & 2) {
      core_["ɵɵadvance"](2);
      core_["ɵɵproperty"]("ngIf", ctx.controls != "only-alpha");
      core_["ɵɵadvance"](2);
      core_["ɵɵproperty"]("ngIf", ctx.controls != "only-alpha");
      core_["ɵɵadvance"](2);
      core_["ɵɵproperty"]("ngIf", ctx.controls != "only-alpha");
      core_["ɵɵadvance"](1);
      core_["ɵɵproperty"]("ngIf", ctx.controls != "no-alpha");
    }
  },
  dependencies: [common_.NgIf, common_.NgStyle, SliderDirective],
  styles: [".color-picker{position:relative;z-index:1000;width:220px;height:auto;cursor:default;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;touch-action:none}.color-picker *{box-sizing:border-box;margin:0;font-size:11px}.color-picker input{width:0;height:26px;min-width:0;font-size:13px;text-align:center;color:#000}.color-picker input:invalid,.color-picker input:-moz-ui-invalid,.color-picker input:-moz-submit-invalid{box-shadow:none}.color-picker input::-webkit-inner-spin-button,.color-picker input::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.color-picker .sliderCursor{width:10px;border-radius:5px;position:absolute;margin-top:-3px;border:1px solid black}.color-picker .sliderCursor>div{border:2px solid white;border-radius:5px}.color-picker .sliderCursor>div>div{border-radius:5px;border:1px solid black;height:24px}.color-picker .cursor{position:absolute;width:21px;border:3px solid black;border-radius:100%;margin:-2px 0 0 -2px}.color-picker .cursor>div{height:15px;border:3px solid white;border-radius:100%}.color-picker .box{display:flex;padding:4px 8px}.color-picker .left{position:relative;padding:16px 8px}.color-picker .right{flex:1 1 auto;display:flex;flex-direction:column;gap:10px;padding:12px 8px}.color-picker .hue-alpha{display:flex;align-items:center;margin-bottom:3px}.color-picker .hue{direction:ltr;width:100%;height:24px;border:none;border-radius:5px;position:relative;cursor:pointer;background-size:100% 100%;background:linear-gradient(to right,red 0%,#ff0 17%,lime 33%,cyan 50%,blue 66%,#f0f 83%,red 100%)}.color-picker .alpha{direction:ltr;position:relative;width:100%;height:24px;border:none;border-radius:5px;cursor:pointer;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px}.color-picker .alpha-gradient{width:100%;height:100%;border-radius:5px;position:absolute}.color-picker .selected-color{position:absolute;top:16px;left:8px;width:40px;height:40px;box-shadow:0 1px 1px 1px #00000026;border-radius:50%}.color-picker .selected-color-background{width:40px;height:40px;border-radius:50%;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px}.color-picker .saturation-lightness{direction:ltr;cursor:crosshair;width:100%;position:relative;height:130px;border:none;touch-action:manipulation;background-image:linear-gradient(to top,#000 0%,transparent 100%),linear-gradient(to right,#fff 0%,transparent 100%)}\n"],
  encapsulation: 2
});
(function () {
  (typeof ngDevMode === "undefined" || ngDevMode) && core_["ɵsetClassMetadata"](ColorPickerComponent, [{
    type: core_.Component,
    args: [{
      selector: "color-picker",
      encapsulation: core_.ViewEncapsulation.None,
      template: "<div #dialogPopup class=\"color-picker\" (click)=\"$event.stopPropagation()\">\n  <div\n    class=\"saturation-lightness\"\n    *ngIf=\"this.controls != 'only-alpha'\"\n    [slider]\n    [rgX]=\"1\"\n    [rgY]=\"1\"\n    [style.background-color]=\"hueSliderColor\"\n    (newValue)=\"onSliderChange('saturation-lightness', $event)\"\n  >\n    <div class=\"cursor\" [style.top.px]=\"slider?.v\" [style.left.px]=\"slider?.s\">\n      <div></div>\n    </div>\n  </div>\n\n  <div class=\"hue-alpha box\">\n    <div class=\"left\" *ngIf=\"this.controls != 'only-alpha'\">\n      <div class=\"selected-color-background\"></div>\n      <div\n        class=\"selected-color\"\n        [style.background-color]=\"selectedColor\"\n      ></div>\n    </div>\n\n    <div class=\"right\">\n      <div\n        *ngIf=\"this.controls != 'only-alpha'\"\n        #hueSlider\n        class=\"hue\"\n        [slider]\n        [rgX]=\"1\"\n        (newValue)=\"onSliderChange('hue', $event)\"\n      >\n        <div class=\"sliderCursor\" [style.left.px]=\"slider?.h\">\n          <div><div></div></div>\n        </div>\n      </div>\n\n      <div\n        *ngIf=\"this.controls != 'no-alpha'\"\n        #alphaSlider\n        class=\"alpha\"\n        [slider]\n        [rgX]=\"1\"\n        (newValue)=\"onSliderChange('alpha', $event)\"\n      >\n        <div\n          class=\"alpha-gradient\"\n          [ngStyle]=\"getBackgroundColor(alphaSliderColor)\"\n        ></div>\n        <div class=\"sliderCursor\" [style.left.px]=\"slider?.a\">\n          <div><div></div></div>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n",
      styles: [".color-picker{position:relative;z-index:1000;width:220px;height:auto;cursor:default;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;touch-action:none}.color-picker *{box-sizing:border-box;margin:0;font-size:11px}.color-picker input{width:0;height:26px;min-width:0;font-size:13px;text-align:center;color:#000}.color-picker input:invalid,.color-picker input:-moz-ui-invalid,.color-picker input:-moz-submit-invalid{box-shadow:none}.color-picker input::-webkit-inner-spin-button,.color-picker input::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.color-picker .sliderCursor{width:10px;border-radius:5px;position:absolute;margin-top:-3px;border:1px solid black}.color-picker .sliderCursor>div{border:2px solid white;border-radius:5px}.color-picker .sliderCursor>div>div{border-radius:5px;border:1px solid black;height:24px}.color-picker .cursor{position:absolute;width:21px;border:3px solid black;border-radius:100%;margin:-2px 0 0 -2px}.color-picker .cursor>div{height:15px;border:3px solid white;border-radius:100%}.color-picker .box{display:flex;padding:4px 8px}.color-picker .left{position:relative;padding:16px 8px}.color-picker .right{flex:1 1 auto;display:flex;flex-direction:column;gap:10px;padding:12px 8px}.color-picker .hue-alpha{display:flex;align-items:center;margin-bottom:3px}.color-picker .hue{direction:ltr;width:100%;height:24px;border:none;border-radius:5px;position:relative;cursor:pointer;background-size:100% 100%;background:linear-gradient(to right,red 0%,#ff0 17%,lime 33%,cyan 50%,blue 66%,#f0f 83%,red 100%)}.color-picker .alpha{direction:ltr;position:relative;width:100%;height:24px;border:none;border-radius:5px;cursor:pointer;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px}.color-picker .alpha-gradient{width:100%;height:100%;border-radius:5px;position:absolute}.color-picker .selected-color{position:absolute;top:16px;left:8px;width:40px;height:40px;box-shadow:0 1px 1px 1px #00000026;border-radius:50%}.color-picker .selected-color-background{width:40px;height:40px;border-radius:50%;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px}.color-picker .saturation-lightness{direction:ltr;cursor:crosshair;width:100%;position:relative;height:130px;border:none;touch-action:manipulation;background-image:linear-gradient(to top,#000 0%,transparent 100%),linear-gradient(to right,#fff 0%,transparent 100%)}\n"]
    }]
  }], function () {
    return [{
      type: ConverterService
    }, {
      type: core_.ChangeDetectorRef
    }];
  }, {
    color: [{
      type: core_.Input
    }],
    controls: [{
      type: core_.Input
    }],
    sliderChange: [{
      type: core_.Output
    }],
    onAlphaChange: [{
      type: core_.Output
    }],
    hueSlider: [{
      type: core_.ViewChild,
      args: ["hueSlider", {
        static: false
      }]
    }],
    alphaSlider: [{
      type: core_.ViewChild,
      args: ["alphaSlider", {
        static: false
      }]
    }]
  });
})();
class PanelComponent {
  click(event) {
    if (this.isOutside(event)) {
      this.emitClose("cancel");
    }
  }
  onScroll() {
    this.onScreenMovement();
  }
  onResize() {
    this.onScreenMovement();
  }
  constructor(service, cdr) {
    this.service = service;
    this.cdr = cdr;
    this.color = "#000000";
    this.previewColor = "#000000";
    this.hsva = new Hsva(0, 1, 1, 1);
    this.colorsAnimationEffect = "slide-in";
    this.palette = defaultColors;
    this.variants = [];
    this.colorFormats = formats;
    this.format = ColorFormats.HEX;
    this.canChangeFormat = true;
    this.menu = 1;
    this.hideColorPicker = false;
    this.hideTextInput = false;
    this.colorPickerControls = "default";
  }
  ngOnInit() {
    this.setPosition();
    this.hsva = this.service.stringToHsva(this.color);
    this.indexSeleccionado = this.findIndexSelectedColor(this.palette);
  }
  ngAfterViewInit() {
    this.setPositionY();
  }
  onScreenMovement() {
    this.setPosition();
    this.setPositionY();
    if (!this.panelRef.nativeElement.style.transition) {
      this.panelRef.nativeElement.style.transition = "transform 0.5s ease-out";
    }
  }
  findIndexSelectedColor(colors) {
    let resultIndex = undefined;
    if (this.color) {
      for (let i = 0; i < colors.length; i++) {
        const color = colors[i];
        if (typeof color == "string") {
          if (this.service.stringToFormat(this.color, ColorFormats.HEX) == this.service.stringToFormat(color, ColorFormats.HEX)) {
            resultIndex = i;
          }
        } else if (color === undefined) {
          this.color = undefined;
        } else {
          if (this.findIndexSelectedColor(color.variants) != undefined) {
            resultIndex = i;
          }
        }
      }
    }
    return resultIndex;
  }
  iniciate(triggerInstance, triggerElementRef, color, palette, animation, format, hideTextInput, hideColorPicker, acceptLabel, cancelLabel, colorPickerControls, position) {
    this.colorPickerControls = colorPickerControls;
    this.triggerInstance = triggerInstance;
    this.TriggerBBox = triggerElementRef;
    this.color = color;
    this.hideColorPicker = hideColorPicker;
    this.hideTextInput = hideTextInput;
    this.acceptLabel = acceptLabel;
    this.cancelLabel = cancelLabel;
    if (format) {
      if (formats.includes(format)) {
        this.format = formats.indexOf(format.toLowerCase());
        this.canChangeFormat = false;
        if (this.service.getFormatByString(this.color) != format.toLowerCase()) {
          this.setColor(this.service.stringToHsva(this.color));
        }
      } else {
        console.error("Format provided is invalid, using HEX");
        this.format = ColorFormats.HEX;
      }
    } else {
      this.format = formats.indexOf(this.service.getFormatByString(this.color));
    }
    this.previewColor = this.color;
    this.palette = palette !== null && palette !== void 0 ? palette : defaultColors;
    this.colorsAnimationEffect = animation;
    if (position == "top") {
      let TriggerBBox = this.TriggerBBox.nativeElement.getBoundingClientRect();
      this.positionString = "transform: translateY(calc( -100% - " + TriggerBBox.height + "px ))";
    }
  }
  setPosition() {
    if (this.TriggerBBox) {
      const panelWidth = 250;
      const viewportOffset = this.TriggerBBox.nativeElement.getBoundingClientRect();
      this.top = viewportOffset.top + viewportOffset.height;
      if (viewportOffset.left + panelWidth > window.innerWidth) {
        this.left = viewportOffset.right < panelWidth ? window.innerWidth / 2 - panelWidth / 2 : viewportOffset.right - panelWidth;
      } else {
        this.left = viewportOffset.left;
      }
    }
  }
  setPositionY() {
    const triggerBBox = this.TriggerBBox.nativeElement.getBoundingClientRect();
    const panelBBox = this.panelRef.nativeElement.getBoundingClientRect();
    const panelHeight = panelBBox.height;
    // Check for space below the trigger
    if (triggerBBox.bottom + panelHeight > window.innerHeight) {
      // there is no space, move panel over the trigger
      this.positionString = triggerBBox.top < panelBBox.height ? "transform: translateY(-" + triggerBBox.bottom + "px );" : "transform: translateY(calc( -100% - " + triggerBBox.height + "px ));";
    } else {
      this.positionString = "";
    }
    this.cdr.detectChanges();
  }
  hasVariant(color) {
    if (!this.previewColor) {
      return false;
    }
    return typeof color != "string" && color.variants.some(v => v.toUpperCase() == this.previewColor.toUpperCase());
  }
  isSelected(color) {
    if (!this.previewColor) {
      return false;
    }
    return typeof color == "string" && color.toUpperCase() == this.previewColor.toUpperCase();
  }
  getBackgroundColor(color) {
    if (typeof color == "string") {
      return {
        background: color
      };
    } else {
      return {
        background: color === null || color === void 0 ? void 0 : color.preview
      };
    }
  }
  onAlphaChange(event) {
    this.palette = this.ChangeAlphaOnPalette(event, this.palette);
  }
  ChangeAlphaOnPalette(alpha, colors) {
    var result = [];
    for (let i = 0; i < colors.length; i++) {
      const color = colors[i];
      if (typeof color == "string") {
        let newColor = this.service.stringToHsva(color);
        newColor.onAlphaChange(alpha);
        result.push(this.service.toFormat(newColor, this.format));
      } else {
        let newColor = new NgxColor();
        let newColorPreview = this.service.stringToHsva(color.preview);
        newColorPreview.onAlphaChange(alpha);
        newColor.preview = this.service.toFormat(newColorPreview, this.format);
        newColor.variants = this.ChangeAlphaOnPalette(alpha, color.variants);
        result.push(newColor);
      }
    }
    return result;
  }
  /**
   * Change color from default colors
   * @param string color
   */
  changeColor(color) {
    this.setColor(this.service.stringToHsva(color));
    // this.triggerInstance.onChange();
    this.emitClose("accept");
  }
  onChangeColorPicker(event) {
    this.temporalColor = event;
    this.color = this.service.toFormat(event, this.format);
    // this.setColor(event);
    this.triggerInstance.sliderChange(this.service.toFormat(event, this.format));
  }
  changeColorManual(color) {
    this.previewColor = color;
    this.color = color;
    this.hsva = this.service.stringToHsva(color);
    this.temporalColor = this.hsva;
    this.triggerInstance.setColor(this.color);
    // this.triggerInstance.onChange();
  }
  setColor(value) {
    this.hsva = value;
    this.color = this.service.toFormat(value, this.format);
    this.setPreviewColor(value);
    this.triggerInstance.setColor(this.color);
  }
  setPreviewColor(value) {
    this.previewColor = value ? this.service.hsvaToRgba(value).toString() : undefined;
  }
  onChange() {
    // this.triggerInstance.onChange();
  }
  onColorClick(color) {
    if (typeof color == "string" || color === undefined) {
      this.changeColor(color);
    } else {
      this.variants = color.variants;
      this.menu = 2;
    }
  }
  addColor() {
    this.menu = 3;
    this.backupColor = this.color;
    // this.color = "#FF0000";
    this.temporalColor = this.service.stringToHsva(this.color);
  }
  nextFormat() {
    if (this.canChangeFormat) {
      this.format = (this.format + 1) % this.colorFormats.length;
      this.setColor(this.hsva);
    }
  }
  emitClose(status) {
    if (this.menu == 3) {
      if (status == "cancel") {} else if (status == "accept") {
        this.setColor(this.temporalColor);
      }
    }
    this.triggerInstance.close();
  }
  onClickBack() {
    if (this.menu == 3) {
      this.color = this.backupColor;
      this.hsva = this.service.stringToHsva(this.color);
    }
    this.indexSeleccionado = this.findIndexSelectedColor(this.palette);
    this.menu = 1;
  }
  isOutside(event) {
    return event.target.classList.contains("ngx-colors-overlay");
  }
}
PanelComponent.ɵfac = function PanelComponent_Factory(t) {
  return new (t || PanelComponent)(core_["ɵɵdirectiveInject"](ConverterService), core_["ɵɵdirectiveInject"](core_.ChangeDetectorRef));
};
PanelComponent.ɵcmp = /* @__PURE__ */core_["ɵɵdefineComponent"]({
  type: PanelComponent,
  selectors: [["ngx-colors-panel"]],
  viewQuery: function PanelComponent_Query(rf, ctx) {
    if (rf & 1) {
      core_["ɵɵviewQuery"](_c2, 5);
    }
    if (rf & 2) {
      let _t;
      core_["ɵɵqueryRefresh"](_t = core_["ɵɵloadQuery"]()) && (ctx.panelRef = _t.first);
    }
  },
  hostVars: 4,
  hostBindings: function PanelComponent_HostBindings(rf, ctx) {
    if (rf & 1) {
      core_["ɵɵlistener"]("mousedown", function PanelComponent_mousedown_HostBindingHandler($event) {
        return ctx.click($event);
      }, false, core_["ɵɵresolveDocument"])("scroll", function PanelComponent_scroll_HostBindingHandler() {
        return ctx.onScroll();
      }, false, core_["ɵɵresolveDocument"])("resize", function PanelComponent_resize_HostBindingHandler() {
        return ctx.onResize();
      }, false, core_["ɵɵresolveWindow"]);
    }
    if (rf & 2) {
      core_["ɵɵstyleProp"]("top", ctx.top, "px")("left", ctx.left, "px");
    }
  },
  decls: 6,
  vars: 6,
  consts: [[1, "opened"], ["dialog", ""], [4, "ngIf"], ["class", "manual-input-wrapper", 4, "ngIf"], [1, "colors"], [4, "ngFor", "ngForOf"], ["style", "background: rgb(245 245 245); position: relative", "class", "circle button", 3, "click", 4, "ngIf"], [3, "controls", "color", "colorChange", "onAlphaChange", 4, "ngIf"], [1, "circle", "wrapper", "color"], [1, "circle", "color", "circle-border", 3, "ngStyle", "click"], ["class", "selected", 4, "ngIf"], [1, "selected"], [1, "circle", "button", 2, "background", "rgb(245 245 245)", "position", "relative", 3, "click"], ["style", "\n            position: absolute;\n            height: 7px;\n            width: 7px;\n            border: 1px solid rgba(0, 0, 0, 0.03);\n            border-radius: 100%;\n            top: 0;\n            right: 0;\n          ", 3, "ngStyle", 4, "ngIf"], ["xmlns", "http://www.w3.org/2000/svg", "height", "24px", "viewBox", "0 0 24 24", "width", "24px", "fill", "#222222"], ["d", "M24 24H0V0h24v24z", "fill", "none", "opacity", ".87"], ["d", "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z"], [2, "position", "absolute", "height", "7px", "width", "7px", "border", "1px solid rgba(0, 0, 0, 0.03)", "border-radius", "100%", "top", "0", "right", "0", 3, "ngStyle"], [3, "controls", "color", "colorChange", "onAlphaChange"], [1, "circle", "wrapper"], [1, "add", 3, "click"], ["xmlns", "http://www.w3.org/2000/svg", "width", "24", "height", "24", "viewBox", "0 0 24 24"], ["d", "M0 0h24v24H0z", "fill", "none"], ["d", "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"], [1, "circle", "circle-border", 3, "ngStyle", "click"], [1, "nav-wrapper"], [1, "round-button", "button", 2, "float", "left", 3, "click"], [2, "float", "right", 3, "click"], [1, "color-picker-wrapper"], [3, "controls", "color", "sliderChange"], [1, "manual-input-wrapper"], [3, "click"], [1, "g-input"], ["placeholder", "#FFFFFF", "type", "text", 3, "value", "keyup", "keydown.enter"], ["paintInput", ""]],
  template: function PanelComponent_Template(rf, ctx) {
    if (rf & 1) {
      core_["ɵɵelementStart"](0, "div", 0, 1);
      core_["ɵɵtemplate"](2, PanelComponent_ng_container_2_Template, 5, 4, "ng-container", 2);
      core_["ɵɵtemplate"](3, PanelComponent_ng_container_3_Template, 8, 2, "ng-container", 2);
      core_["ɵɵtemplate"](4, PanelComponent_ng_container_4_Template, 12, 4, "ng-container", 2);
      core_["ɵɵtemplate"](5, PanelComponent_div_5_Template, 6, 6, "div", 3);
      core_["ɵɵelementEnd"]();
    }
    if (rf & 2) {
      core_["ɵɵstyleMap"](ctx.positionString);
      core_["ɵɵadvance"](2);
      core_["ɵɵproperty"]("ngIf", ctx.menu == 1);
      core_["ɵɵadvance"](1);
      core_["ɵɵproperty"]("ngIf", ctx.menu == 2);
      core_["ɵɵadvance"](1);
      core_["ɵɵproperty"]("ngIf", ctx.menu == 3);
      core_["ɵɵadvance"](1);
      core_["ɵɵproperty"]("ngIf", !ctx.hideTextInput);
    }
  },
  dependencies: [common_.NgForOf, common_.NgIf, common_.NgStyle, ColorPickerComponent],
  styles: ["[_nghost-%COMP%]{position:fixed;z-index:2001}.hidden[_ngcontent-%COMP%]{display:none}.button[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center}.top[_ngcontent-%COMP%]{transform:translateY(-100%)}.opened[_ngcontent-%COMP%]{box-sizing:border-box;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;background:#fff;width:250px;border-radius:5px;position:absolute}.opened[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{border:none;font-family:inherit;font-size:12px;background-color:unset;-webkit-user-select:none;user-select:none;padding:10px;letter-spacing:1px;color:#222;border-radius:3px;line-height:20px}.opened[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:hover, .opened[_ngcontent-%COMP%]   .button[_ngcontent-%COMP%]:hover{background-color:#0000000d;transition:opacity .2s cubic-bezier(.35,0,.25,1),background-color .2s cubic-bezier(.35,0,.25,1);transition-property:opacity,background-color;transition-duration:.2s,.2s;transition-timing-function:cubic-bezier(.35,0,.25,1),cubic-bezier(.35,0,.25,1);transition-delay:0s,0s}.opened[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:focus{outline:none}.opened[_ngcontent-%COMP%]   .colors[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;margin:15px}.opened[_ngcontent-%COMP%]   .colors[_ngcontent-%COMP%]   .circle[_ngcontent-%COMP%]{height:34px;width:34px;box-sizing:border-box;border-radius:100%;cursor:pointer}.opened[_ngcontent-%COMP%]   .colors[_ngcontent-%COMP%]   .circle[_ngcontent-%COMP%]   .add[_ngcontent-%COMP%]{font-size:20px;line-height:45px;text-align:center}.opened[_ngcontent-%COMP%]   .colors[_ngcontent-%COMP%]   .circle[_ngcontent-%COMP%]   .selected[_ngcontent-%COMP%]{border:2px solid white;border-radius:100%;height:28px;width:28px;box-sizing:border-box;margin:2px}.opened[_ngcontent-%COMP%]   .colors[_ngcontent-%COMP%]   .circle.colornull[_ngcontent-%COMP%]{background:linear-gradient(135deg,rgba(236,236,236,.7) 0%,rgba(236,236,236,.7) 45%,#de0f00 50%,rgba(236,236,236,.7) 55%,rgba(236,236,236,.7) 100%)}.opened[_ngcontent-%COMP%]   .colors[_ngcontent-%COMP%]   .circle.wrapper[_ngcontent-%COMP%]{margin:0 5px 5px;flex:34px 0 0}.opened[_ngcontent-%COMP%]   .colors[_ngcontent-%COMP%]   .circle.button[_ngcontent-%COMP%]{margin:0 5px 5px}.opened[_ngcontent-%COMP%]   .colors[_ngcontent-%COMP%]   .circle.wrapper.color[_ngcontent-%COMP%]{background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px}.opened[_ngcontent-%COMP%]   .colors[_ngcontent-%COMP%]   .circle-border[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.03)}.opened[_ngcontent-%COMP%]   .color-picker-wrapper[_ngcontent-%COMP%]{margin:5px 15px}.opened[_ngcontent-%COMP%]   .nav-wrapper[_ngcontent-%COMP%]{overflow:hidden;margin:5px}.opened[_ngcontent-%COMP%]   .nav-wrapper[_ngcontent-%COMP%]   .round-button[_ngcontent-%COMP%]{padding:5px 0;width:40px;height:40px;box-sizing:border-box;border-radius:100%;text-align:center;line-height:45px}.opened[_ngcontent-%COMP%]   .manual-input-wrapper[_ngcontent-%COMP%]{display:flex;margin:15px;font-family:sans-serif}.opened[_ngcontent-%COMP%]   .manual-input-wrapper[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0;text-align:center;font-size:10px;letter-spacing:1.5px;text-transform:uppercase;line-height:48px;width:145px;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.opened[_ngcontent-%COMP%]   .manual-input-wrapper[_ngcontent-%COMP%]   .g-input[_ngcontent-%COMP%]{border:1px solid #e8ebed;height:45px;border-radius:5px;width:100%}.opened[_ngcontent-%COMP%]   .manual-input-wrapper[_ngcontent-%COMP%]   .g-input[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{font-size:9px;border:none;width:100%;text-transform:uppercase;outline:none;text-align:center;letter-spacing:1px;color:#595b65;height:100%;border-radius:5px;margin:0;padding:0}"],
  data: {
    animation: [(0,animations_.trigger)("colorsAnimation", [(0,animations_.transition)("void => slide-in", [
    // Initially all colors are hidden
    (0,animations_.query)(":enter", (0,animations_.style)({
      opacity: 0
    }), {
      optional: true
    }),
    //slide-in animation
    (0,animations_.query)(":enter", (0,animations_.stagger)("10ms", [(0,animations_.animate)(".3s ease-in", (0,animations_.keyframes)([(0,animations_.style)({
      opacity: 0,
      transform: "translatex(-50%)",
      offset: 0
    }), (0,animations_.style)({
      opacity: 0.5,
      transform: "translatex(-10px) scale(1.1)",
      offset: 0.3
    }), (0,animations_.style)({
      opacity: 1,
      transform: "translatex(0)",
      offset: 1
    })]))]), {
      optional: true
    })]),
    //popup animation
    (0,animations_.transition)("void => popup", [(0,animations_.query)(":enter", (0,animations_.style)({
      opacity: 0,
      transform: "scale(0)"
    }), {
      optional: true
    }), (0,animations_.query)(":enter", (0,animations_.stagger)("10ms", [(0,animations_.animate)("500ms ease-out", (0,animations_.keyframes)([(0,animations_.style)({
      opacity: 0.5,
      transform: "scale(.5)",
      offset: 0.3
    }), (0,animations_.style)({
      opacity: 1,
      transform: "scale(1.1)",
      offset: 0.8
    }), (0,animations_.style)({
      opacity: 1,
      transform: "scale(1)",
      offset: 1
    })]))]), {
      optional: true
    })])])]
  }
});
(function () {
  (typeof ngDevMode === "undefined" || ngDevMode) && core_["ɵsetClassMetadata"](PanelComponent, [{
    type: core_.Component,
    args: [{
      selector: "ngx-colors-panel",
      animations: [(0,animations_.trigger)("colorsAnimation", [(0,animations_.transition)("void => slide-in", [
      // Initially all colors are hidden
      (0,animations_.query)(":enter", (0,animations_.style)({
        opacity: 0
      }), {
        optional: true
      }),
      //slide-in animation
      (0,animations_.query)(":enter", (0,animations_.stagger)("10ms", [(0,animations_.animate)(".3s ease-in", (0,animations_.keyframes)([(0,animations_.style)({
        opacity: 0,
        transform: "translatex(-50%)",
        offset: 0
      }), (0,animations_.style)({
        opacity: 0.5,
        transform: "translatex(-10px) scale(1.1)",
        offset: 0.3
      }), (0,animations_.style)({
        opacity: 1,
        transform: "translatex(0)",
        offset: 1
      })]))]), {
        optional: true
      })]),
      //popup animation
      (0,animations_.transition)("void => popup", [(0,animations_.query)(":enter", (0,animations_.style)({
        opacity: 0,
        transform: "scale(0)"
      }), {
        optional: true
      }), (0,animations_.query)(":enter", (0,animations_.stagger)("10ms", [(0,animations_.animate)("500ms ease-out", (0,animations_.keyframes)([(0,animations_.style)({
        opacity: 0.5,
        transform: "scale(.5)",
        offset: 0.3
      }), (0,animations_.style)({
        opacity: 1,
        transform: "scale(1.1)",
        offset: 0.8
      }), (0,animations_.style)({
        opacity: 1,
        transform: "scale(1)",
        offset: 1
      })]))]), {
        optional: true
      })])])],
      template: "<div class=\"opened\" [style]=\"positionString\" #dialog>\n  <ng-container *ngIf=\"menu == 1\">\n    <div class=\"colors\" [@colorsAnimation]=\"colorsAnimationEffect\">\n      <ng-container *ngFor=\"let color of palette; let i = index\">\n        <div class=\"circle wrapper color\">\n          <div\n            (click)=\"onColorClick(color)\"\n            class=\"circle color circle-border\"\n            [class.colornull]=\"!color\"\n            [ngStyle]=\"getBackgroundColor(color)\"\n          >\n            <div *ngIf=\"i == this.indexSeleccionado\" class=\"selected\"></div>\n          </div>\n        </div>\n      </ng-container>\n      <div\n        style=\"background: rgb(245 245 245); position: relative\"\n        (click)=\"addColor()\"\n        *ngIf=\"!hideColorPicker && this.colorPickerControls != 'only-alpha'\"\n        class=\"circle button\"\n      >\n        <div\n          *ngIf=\"!this.indexSeleccionado\"\n          style=\"\n            position: absolute;\n            height: 7px;\n            width: 7px;\n            border: 1px solid rgba(0, 0, 0, 0.03);\n            border-radius: 100%;\n            top: 0;\n            right: 0;\n          \"\n          [ngStyle]=\"getBackgroundColor(color)\"\n        ></div>\n        <svg\n          xmlns=\"http://www.w3.org/2000/svg\"\n          height=\"24px\"\n          viewBox=\"0 0 24 24\"\n          width=\"24px\"\n          fill=\"#222222\"\n        >\n          <path d=\"M24 24H0V0h24v24z\" fill=\"none\" opacity=\".87\" />\n          <path d=\"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z\" />\n        </svg>\n        <!-- <div class=\"add\">\n          <icons icon=\"add\"></icons>\n        </div> -->\n      </div>\n      <color-picker\n        *ngIf=\"!hideColorPicker && this.colorPickerControls == 'only-alpha'\"\n        [controls]=\"colorPickerControls\"\n        [color]=\"hsva\"\n        (colorChange)=\"onChangeColorPicker($event)\"\n        (onAlphaChange)=\"onAlphaChange($event)\"\n      ></color-picker>\n    </div>\n  </ng-container>\n  <ng-container *ngIf=\"menu == 2\">\n    <div class=\"colors\" [@colorsAnimation]=\"colorsAnimationEffect\">\n      <div class=\"circle wrapper\">\n        <div (click)=\"onClickBack()\" class=\"add\">\n          <svg\n            xmlns=\"http://www.w3.org/2000/svg\"\n            width=\"24\"\n            height=\"24\"\n            viewBox=\"0 0 24 24\"\n          >\n            <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n            <path\n              d=\"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\"\n            />\n          </svg>\n        </div>\n      </div>\n\n      <ng-container *ngFor=\"let variant of variants\">\n        <div class=\"circle wrapper color\">\n          <div\n            [class.colornull]=\"!variant\"\n            (click)=\"changeColor(variant)\"\n            class=\"circle circle-border\"\n            [ngStyle]=\"{ background: variant }\"\n          >\n            <div *ngIf=\"isSelected(variant)\" class=\"selected\"></div>\n          </div>\n        </div>\n      </ng-container>\n    </div>\n  </ng-container>\n  <ng-container *ngIf=\"menu == 3\">\n    <div class=\"nav-wrapper\">\n      <div\n        (click)=\"onClickBack()\"\n        class=\"round-button button\"\n        style=\"float: left\"\n      >\n        <svg\n          xmlns=\"http://www.w3.org/2000/svg\"\n          width=\"24\"\n          height=\"24\"\n          viewBox=\"0 0 24 24\"\n        >\n          <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n          <path\n            d=\"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\"\n          />\n        </svg>\n      </div>\n      <button (click)=\"emitClose('cancel')\" style=\"float: right\">\n        {{ cancelLabel }}\n      </button>\n      <button (click)=\"emitClose('accept')\" style=\"float: right\">\n        {{ acceptLabel }}\n      </button>\n    </div>\n    <div class=\"color-picker-wrapper\">\n      <!-- <span [(colorPicker)]=\"color\"></span> -->\n      <color-picker\n        [controls]=\"colorPickerControls\"\n        [color]=\"hsva\"\n        (sliderChange)=\"onChangeColorPicker($event)\"\n      ></color-picker>\n    </div>\n  </ng-container>\n  <div class=\"manual-input-wrapper\" *ngIf=\"!hideTextInput\">\n    <p (click)=\"nextFormat()\">{{ colorFormats[format] }}</p>\n    <div class=\"g-input\">\n      <input\n        placeholder=\"#FFFFFF\"\n        type=\"text\"\n        [value]=\"color\"\n        [style.font-size.px]=\"color && color.length > 23 ? 9 : 10\"\n        [style.letter-spacing.px]=\"color && color.length > 16 ? 0 : 1.5\"\n        (keyup)=\"changeColorManual(paintInput.value)\"\n        (keydown.enter)=\"emitClose('accept')\"\n        #paintInput\n      />\n    </div>\n  </div>\n</div>\n",
      styles: [":host{position:fixed;z-index:2001}.hidden{display:none}.button{display:flex;align-items:center;justify-content:center}.top{transform:translateY(-100%)}.opened{box-sizing:border-box;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;background:#fff;width:250px;border-radius:5px;position:absolute}.opened button{border:none;font-family:inherit;font-size:12px;background-color:unset;-webkit-user-select:none;user-select:none;padding:10px;letter-spacing:1px;color:#222;border-radius:3px;line-height:20px}.opened button:hover,.opened .button:hover{background-color:#0000000d;transition:opacity .2s cubic-bezier(.35,0,.25,1),background-color .2s cubic-bezier(.35,0,.25,1);transition-property:opacity,background-color;transition-duration:.2s,.2s;transition-timing-function:cubic-bezier(.35,0,.25,1),cubic-bezier(.35,0,.25,1);transition-delay:0s,0s}.opened button:focus{outline:none}.opened .colors{display:flex;flex-wrap:wrap;align-items:center;margin:15px}.opened .colors .circle{height:34px;width:34px;box-sizing:border-box;border-radius:100%;cursor:pointer}.opened .colors .circle .add{font-size:20px;line-height:45px;text-align:center}.opened .colors .circle .selected{border:2px solid white;border-radius:100%;height:28px;width:28px;box-sizing:border-box;margin:2px}.opened .colors .circle.colornull{background:linear-gradient(135deg,rgba(236,236,236,.7) 0%,rgba(236,236,236,.7) 45%,#de0f00 50%,rgba(236,236,236,.7) 55%,rgba(236,236,236,.7) 100%)}.opened .colors .circle.wrapper{margin:0 5px 5px;flex:34px 0 0}.opened .colors .circle.button{margin:0 5px 5px}.opened .colors .circle.wrapper.color{background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px}.opened .colors .circle-border{border:1px solid rgba(0,0,0,.03)}.opened .color-picker-wrapper{margin:5px 15px}.opened .nav-wrapper{overflow:hidden;margin:5px}.opened .nav-wrapper .round-button{padding:5px 0;width:40px;height:40px;box-sizing:border-box;border-radius:100%;text-align:center;line-height:45px}.opened .manual-input-wrapper{display:flex;margin:15px;font-family:sans-serif}.opened .manual-input-wrapper p{margin:0;text-align:center;font-size:10px;letter-spacing:1.5px;text-transform:uppercase;line-height:48px;width:145px;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.opened .manual-input-wrapper .g-input{border:1px solid #e8ebed;height:45px;border-radius:5px;width:100%}.opened .manual-input-wrapper .g-input input{font-size:9px;border:none;width:100%;text-transform:uppercase;outline:none;text-align:center;letter-spacing:1px;color:#595b65;height:100%;border-radius:5px;margin:0;padding:0}\n"]
    }]
  }], function () {
    return [{
      type: ConverterService
    }, {
      type: core_.ChangeDetectorRef
    }];
  }, {
    click: [{
      type: core_.HostListener,
      args: ["document:mousedown", ["$event"]]
    }],
    onScroll: [{
      type: core_.HostListener,
      args: ["document:scroll"]
    }],
    onResize: [{
      type: core_.HostListener,
      args: ["window:resize"]
    }],
    top: [{
      type: core_.HostBinding,
      args: ["style.top.px"]
    }],
    left: [{
      type: core_.HostBinding,
      args: ["style.left.px"]
    }],
    panelRef: [{
      type: core_.ViewChild,
      args: ["dialog"]
    }]
  });
})();
const OVERLAY_STYLES = {
  position: 'fixed',
  height: '100%',
  width: '100%',
  'z-index': 2000,
  top: 0,
  left: 0
};
class PanelFactoryService {
  constructor(resolver, applicationRef, injector) {
    this.resolver = resolver;
    this.applicationRef = applicationRef;
    this.injector = injector;
  }
  createPanel(attachTo, overlayClassName) {
    if (this.componentRef != undefined) {
      this.removePanel();
    }
    const factory = this.resolver.resolveComponentFactory(PanelComponent);
    this.componentRef = factory.create(this.injector);
    this.applicationRef.attachView(this.componentRef.hostView);
    const domElem = this.componentRef.hostView.rootNodes[0];
    this.overlay = document.createElement("div");
    this.overlay.id = "ngx-colors-overlay";
    this.overlay.classList.add("ngx-colors-overlay");
    this.overlay.classList.add(overlayClassName);
    Object.keys(OVERLAY_STYLES).forEach(attr => {
      this.overlay.style[attr] = OVERLAY_STYLES[attr];
    });
    if (attachTo) {
      document.getElementById(attachTo).appendChild(this.overlay);
    } else {
      document.body.appendChild(this.overlay);
    }
    this.overlay.appendChild(domElem);
    return this.componentRef;
  }
  removePanel() {
    this.applicationRef.detachView(this.componentRef.hostView);
    this.componentRef.destroy();
    this.overlay.remove();
  }
}
PanelFactoryService.ɵfac = function PanelFactoryService_Factory(t) {
  return new (t || PanelFactoryService)(core_["ɵɵinject"](core_.ComponentFactoryResolver), core_["ɵɵinject"](core_.ApplicationRef), core_["ɵɵinject"](core_.Injector));
};
PanelFactoryService.ɵprov = /* @__PURE__ */core_["ɵɵdefineInjectable"]({
  token: PanelFactoryService,
  factory: PanelFactoryService.ɵfac
});
(function () {
  (typeof ngDevMode === "undefined" || ngDevMode) && core_["ɵsetClassMetadata"](PanelFactoryService, [{
    type: core_.Injectable
  }], function () {
    return [{
      type: core_.ComponentFactoryResolver
    }, {
      type: core_.ApplicationRef
    }, {
      type: core_.Injector
    }];
  }, null);
})();
class NgxColorsTriggerDirective {
  onClick() {
    this.open();
  }
  constructor(triggerRef, panelFactory) {
    this.triggerRef = triggerRef;
    this.panelFactory = panelFactory;
    //Main input/output of the color picker
    // @Input() color = '#000000';
    // @Output() colorChange:EventEmitter<string> = new EventEmitter<string>();
    this.color = "";
    //This defines the type of animation for the palatte.(slide-in | popup)
    this.colorsAnimation = "slide-in";
    this.position = "bottom";
    this.attachTo = undefined;
    this.overlayClassName = undefined;
    this.colorPickerControls = "default";
    this.acceptLabel = "ACCEPT";
    this.cancelLabel = "CANCEL";
    // This event is trigger every time the selected color change
    this.change = new core_.EventEmitter();
    // This event is trigger every time the user change the color using the panel
    this.input = new core_.EventEmitter();
    // This event is trigger every time the user change the color using the panel
    this.slider = new core_.EventEmitter();
    this.isDisabled = false;
    this.onTouchedCallback = () => {};
    this.onChangeCallback = () => {};
  }
  open() {
    if (!this.isDisabled) {
      this.panelRef = this.panelFactory.createPanel(this.attachTo, this.overlayClassName);
      this.panelRef.instance.iniciate(this, this.triggerRef, this.color, this.palette, this.colorsAnimation, this.format, this.hideTextInput, this.hideColorPicker, this.acceptLabel, this.cancelLabel, this.colorPickerControls, this.position);
    }
  }
  close() {
    this.panelFactory.removePanel();
    this.onTouchedCallback();
  }
  onChange() {
    this.onChangeCallback(this.color);
  }
  setDisabledState(isDisabled) {
    this.isDisabled = isDisabled;
    this.triggerRef.nativeElement.style.opacity = isDisabled ? 0.5 : 1;
  }
  setColor(color) {
    this.writeValue(color);
    this.input.emit(color);
  }
  sliderChange(color) {
    this.slider.emit(color);
  }
  get value() {
    return this.color;
  }
  set value(value) {
    this.setColor(value);
    this.onChangeCallback(value);
  }
  writeValue(value) {
    if (value !== this.color) {
      this.color = value;
      this.onChange();
      this.change.emit(value);
    }
  }
  registerOnChange(fn) {
    this.onChangeCallback = fn;
  }
  registerOnTouched(fn) {
    this.onTouchedCallback = fn;
  }
}
NgxColorsTriggerDirective.ɵfac = function NgxColorsTriggerDirective_Factory(t) {
  return new (t || NgxColorsTriggerDirective)(core_["ɵɵdirectiveInject"](core_.ElementRef), core_["ɵɵdirectiveInject"](PanelFactoryService));
};
NgxColorsTriggerDirective.ɵdir = /* @__PURE__ */core_["ɵɵdefineDirective"]({
  type: NgxColorsTriggerDirective,
  selectors: [["", "ngx-colors-trigger", ""]],
  hostBindings: function NgxColorsTriggerDirective_HostBindings(rf, ctx) {
    if (rf & 1) {
      core_["ɵɵlistener"]("click", function NgxColorsTriggerDirective_click_HostBindingHandler() {
        return ctx.onClick();
      });
    }
  },
  inputs: {
    colorsAnimation: "colorsAnimation",
    palette: "palette",
    format: "format",
    position: "position",
    hideTextInput: "hideTextInput",
    hideColorPicker: "hideColorPicker",
    attachTo: "attachTo",
    overlayClassName: "overlayClassName",
    colorPickerControls: "colorPickerControls",
    acceptLabel: "acceptLabel",
    cancelLabel: "cancelLabel"
  },
  outputs: {
    change: "change",
    input: "input",
    slider: "slider"
  },
  features: [core_["ɵɵProvidersFeature"]([{
    provide: forms_.NG_VALUE_ACCESSOR,
    useExisting: (0,core_.forwardRef)(() => NgxColorsTriggerDirective),
    multi: true
  }])]
});
(function () {
  (typeof ngDevMode === "undefined" || ngDevMode) && core_["ɵsetClassMetadata"](NgxColorsTriggerDirective, [{
    type: core_.Directive,
    args: [{
      selector: "[ngx-colors-trigger]",
      providers: [{
        provide: forms_.NG_VALUE_ACCESSOR,
        useExisting: (0,core_.forwardRef)(() => NgxColorsTriggerDirective),
        multi: true
      }]
    }]
  }], function () {
    return [{
      type: core_.ElementRef
    }, {
      type: PanelFactoryService
    }];
  }, {
    colorsAnimation: [{
      type: core_.Input
    }],
    palette: [{
      type: core_.Input
    }],
    format: [{
      type: core_.Input
    }],
    position: [{
      type: core_.Input
    }],
    hideTextInput: [{
      type: core_.Input
    }],
    hideColorPicker: [{
      type: core_.Input
    }],
    attachTo: [{
      type: core_.Input
    }],
    overlayClassName: [{
      type: core_.Input
    }],
    colorPickerControls: [{
      type: core_.Input
    }],
    acceptLabel: [{
      type: core_.Input
    }],
    cancelLabel: [{
      type: core_.Input
    }],
    change: [{
      type: core_.Output
    }],
    input: [{
      type: core_.Output
    }],
    slider: [{
      type: core_.Output
    }],
    onClick: [{
      type: core_.HostListener,
      args: ["click"]
    }]
  });
})();
class NgxColorsComponent {
  constructor(cdRef, triggerDirective) {
    this.cdRef = cdRef;
    this.triggerDirective = triggerDirective;
    this.triggerDirectiveColorChangeSubscription = null;
    //IO color
    this.color = this.triggerDirective.color;
  }
  ngOnInit() {
    this.triggerDirectiveColorChangeSubscription = this.triggerDirective.change.subscribe(color => {
      this.color = color;
      this.cdRef.markForCheck();
    });
  }
  ngOnDestroy() {
    if (this.triggerDirectiveColorChangeSubscription) {
      this.triggerDirectiveColorChangeSubscription.unsubscribe();
    }
  }
}
NgxColorsComponent.ɵfac = function NgxColorsComponent_Factory(t) {
  return new (t || NgxColorsComponent)(core_["ɵɵdirectiveInject"](core_.ChangeDetectorRef), core_["ɵɵdirectiveInject"](NgxColorsTriggerDirective, 1));
};
NgxColorsComponent.ɵcmp = /* @__PURE__ */core_["ɵɵdefineComponent"]({
  type: NgxColorsComponent,
  selectors: [["ngx-colors"]],
  decls: 4,
  vars: 5,
  consts: [[1, "app-color-picker"], [1, "preview"], [1, "preview-background"], [1, "circle", 3, "ngStyle"]],
  template: function NgxColorsComponent_Template(rf, ctx) {
    if (rf & 1) {
      core_["ɵɵelementStart"](0, "div", 0)(1, "div", 1)(2, "div", 2);
      core_["ɵɵelement"](3, "div", 3);
      core_["ɵɵelementEnd"]()()();
    }
    if (rf & 2) {
      core_["ɵɵadvance"](3);
      core_["ɵɵclassProp"]("colornull", !ctx.color);
      core_["ɵɵproperty"]("ngStyle", core_["ɵɵpureFunction1"](3, _c3, ctx.color));
    }
  },
  dependencies: [common_.NgStyle],
  styles: ["[_nghost-%COMP%]   .app-color-picker[_ngcontent-%COMP%]{line-height:1px;font-family:sans-serif}[_nghost-%COMP%]   .app-color-picker[_ngcontent-%COMP%]   .preview[_ngcontent-%COMP%]{margin:2px;display:inline-block;box-sizing:border-box;border-radius:100%;background:white;cursor:pointer;padding:3px;box-shadow:0 1px 1px #0003,0 1px 1px 1px #00000024,0 1px 1px 1px #0000001f}[_nghost-%COMP%]   .app-color-picker[_ngcontent-%COMP%]   .preview[_ngcontent-%COMP%]   .preview-background[_ngcontent-%COMP%]{background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px;border-radius:100%}[_nghost-%COMP%]   .app-color-picker[_ngcontent-%COMP%]   .preview[_ngcontent-%COMP%]   .circle[_ngcontent-%COMP%]{height:20px;width:20px;box-sizing:border-box;border-radius:100%;cursor:pointer}[_nghost-%COMP%]   .app-color-picker[_ngcontent-%COMP%]   .preview[_ngcontent-%COMP%]   .circle.colornull[_ngcontent-%COMP%]{background:linear-gradient(135deg,rgba(236,236,236,.7) 0%,rgba(236,236,236,.7) 45%,#de0f00 50%,rgba(236,236,236,.7) 55%,rgba(236,236,236,.7) 100%)}[_nghost-%COMP%]   .app-color-picker[_ngcontent-%COMP%]   .preview[_ngcontent-%COMP%]   .noselected[_ngcontent-%COMP%]{background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px}"]
});
(function () {
  (typeof ngDevMode === "undefined" || ngDevMode) && core_["ɵsetClassMetadata"](NgxColorsComponent, [{
    type: core_.Component,
    args: [{
      selector: 'ngx-colors',
      template: "<div class=\"app-color-picker\">\n  <div class=\"preview\">\n    <div class=\"preview-background\">\n      <div\n        class=\"circle\"\n        [class.colornull]=\"!color\"\n        [ngStyle]=\"{ background: color }\"\n      ></div>\n    </div>\n  </div>\n</div>\n",
      styles: [":host .app-color-picker{line-height:1px;font-family:sans-serif}:host .app-color-picker .preview{margin:2px;display:inline-block;box-sizing:border-box;border-radius:100%;background:white;cursor:pointer;padding:3px;box-shadow:0 1px 1px #0003,0 1px 1px 1px #00000024,0 1px 1px 1px #0000001f}:host .app-color-picker .preview .preview-background{background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px;border-radius:100%}:host .app-color-picker .preview .circle{height:20px;width:20px;box-sizing:border-box;border-radius:100%;cursor:pointer}:host .app-color-picker .preview .circle.colornull{background:linear-gradient(135deg,rgba(236,236,236,.7) 0%,rgba(236,236,236,.7) 45%,#de0f00 50%,rgba(236,236,236,.7) 55%,rgba(236,236,236,.7) 100%)}:host .app-color-picker .preview .noselected{background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0px}\n"]
    }]
  }], function () {
    return [{
      type: core_.ChangeDetectorRef
    }, {
      type: NgxColorsTriggerDirective,
      decorators: [{
        type: core_.Host
      }]
    }];
  }, null);
})();
class NgxColorsModule {}
NgxColorsModule.ɵfac = function NgxColorsModule_Factory(t) {
  return new (t || NgxColorsModule)();
};
NgxColorsModule.ɵmod = /* @__PURE__ */core_["ɵɵdefineNgModule"]({
  type: NgxColorsModule,
  declarations: [NgxColorsComponent, ColorPickerComponent, SliderDirective, PanelComponent, NgxColorsTriggerDirective],
  imports: [common_.CommonModule],
  exports: [NgxColorsComponent, NgxColorsTriggerDirective]
});
NgxColorsModule.ɵinj = /* @__PURE__ */core_["ɵɵdefineInjector"]({
  providers: [ConverterService, PanelFactoryService],
  imports: [common_.CommonModule]
});
(function () {
  (typeof ngDevMode === "undefined" || ngDevMode) && core_["ɵsetClassMetadata"](NgxColorsModule, [{
    type: core_.NgModule,
    args: [{
      declarations: [NgxColorsComponent, ColorPickerComponent, SliderDirective, PanelComponent, NgxColorsTriggerDirective],
      imports: [common_.CommonModule],
      providers: [ConverterService, PanelFactoryService],
      exports: [NgxColorsComponent, NgxColorsTriggerDirective]
    }]
  }], null, null);
})();
function validColorValidator() {
  return control => {
    const value = control.value;
    if (!value) {
      return null;
    }
    const rgbTest = /^\s*rgba?\(\s*(1?\d{1,2}|2[0-4]\d|25[0-5])\s*,\s*(1?\d{1,2}|2[0-4]\d|25[0-5])\s*,\s*(1?\d{1,2}|2[0-4]\d|25[0-5])\s*(,\s*(0\.\d{1,2}|1))?\s*\)\s*$/i;
    const hslTest = /^\s*hsla?\(\s*([0-2]?\d{1,2}|3[0-5]\d|360)\s*,\s*(0|[1-9]{1,2}|100)\%\s*,\s*(0|[1-9]{1,2}|100)\%\s*(,\s*(0\.\d{1,2}|1))?\s*\)\s*$/i;
    const hexTest = /^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
    const colorValid = rgbTest.test(value) || hslTest.test(value) || hexTest.test(value);
    return !colorValid ? {
      invalidColor: true
    } : null;
  };
}

/*
 * Public API Surface of ngx-colors
 */

/**
 * Generated bundle index. Do not edit.
 */


// EXTERNAL MODULE: external "tabby-core"
var external_tabby_core_ = __webpack_require__(7650);
var external_tabby_core_default = /*#__PURE__*/__webpack_require__.n(external_tabby_core_);
// EXTERNAL MODULE: external "tabby-settings"
var external_tabby_settings_ = __webpack_require__(3700);
// EXTERNAL MODULE: ./src/components/appearanceSettingsTab.component.pug?ngResource
var appearanceSettingsTab_componentngResource = __webpack_require__(5717);
var appearanceSettingsTab_componentngResource_default = /*#__PURE__*/__webpack_require__.n(appearanceSettingsTab_componentngResource);
// EXTERNAL MODULE: ./src/components/appearanceSettingsTab.component.scss?ngResource
var components_appearanceSettingsTab_componentngResource = __webpack_require__(2069);
var components_appearanceSettingsTab_componentngResource_default = /*#__PURE__*/__webpack_require__.n(components_appearanceSettingsTab_componentngResource);
// EXTERNAL MODULE: external "rxjs"
var external_rxjs_ = __webpack_require__(3961);
;// ../node_modules/utils-decorators/dist/esm/debounce/debouncify.js
function debouncify(originalMethod, delayMs) {
  let handler;
  return function (...args) {
    clearTimeout(handler);
    handler = setTimeout(() => {
      originalMethod.apply(this, args);
    }, delayMs);
  };
}
;// ../node_modules/utils-decorators/dist/esm/debounce/debounce.js

function debounce(delayMs) {
  return (target, propertyName, descriptor) => {
    if (descriptor.value) {
      const methodsMap = new WeakMap();
      const originalMethod = descriptor.value;
      descriptor.value = function (...args) {
        if (!methodsMap.has(this)) {
          methodsMap.set(this, debouncify(originalMethod, delayMs).bind(this));
        }
        methodsMap.get(this)(...args);
      };
      return descriptor;
    }
    throw new Error('@debounce is applicable only on a methods.');
  };
}
;// ./src/components/appearanceSettingsTab.component.ts



/* eslint-disable @typescript-eslint/explicit-module-boundary-types */




/** @hidden */
let AppearanceSettingsTabComponent = class AppearanceSettingsTabComponent {
    constructor(config, themes, platform) {
        this.config = config;
        this.themes = themes;
        this.platform = platform;
        this.fonts = [];
        this.fontAutocomplete = (text$) => {
            return text$.pipe((0,external_rxjs_.debounceTime)(200), (0,external_rxjs_.distinctUntilChanged)(), (0,external_rxjs_.map)(query => this.fonts.filter(v => new RegExp(query, 'gi').test(v))), (0,external_rxjs_.map)(list => Array.from(new Set(list))));
        };
    }
    ngOnInit() {
        return __awaiter(this, void 0, void 0, function* () {
            this.fonts = yield this.platform.listFonts();
        });
    }
    getPreviewFontFamily() {
        return (0,external_tabby_core_.getCSSFontFamily)(this.config.store);
    }
    saveConfiguration(requireRestart) {
        this.config.save();
        if (requireRestart) {
            this.config.requestRestart();
        }
    }
    fixFontSize() {
        this.config.store.terminal.fontSize = Math.min(50, Math.max(5, this.config.store.terminal.fontSize));
    }
};
AppearanceSettingsTabComponent.ctorParameters = () => [
    { type: external_tabby_core_.ConfigService },
    { type: external_tabby_core_.ThemesService },
    { type: external_tabby_core_.PlatformService }
];
__decorate([
    debounce(500),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Boolean]),
    __metadata("design:returntype", void 0)
], AppearanceSettingsTabComponent.prototype, "saveConfiguration", null);
AppearanceSettingsTabComponent = __decorate([
    (0,core_.Component)({
        template: (appearanceSettingsTab_componentngResource_default()),
        styles: [(components_appearanceSettingsTab_componentngResource_default())]
    }),
    __metadata("design:paramtypes", [external_tabby_core_.ConfigService,
        external_tabby_core_.ThemesService,
        external_tabby_core_.PlatformService])
], AppearanceSettingsTabComponent);


// EXTERNAL MODULE: ./src/components/colorSchemeSettingsTab.component.pug?ngResource
var colorSchemeSettingsTab_componentngResource = __webpack_require__(1991);
var colorSchemeSettingsTab_componentngResource_default = /*#__PURE__*/__webpack_require__.n(colorSchemeSettingsTab_componentngResource);
;// ./src/components/colorSchemeSettingsTab.component.ts




/** @hidden */
let ColorSchemeSettingsTabComponent = class ColorSchemeSettingsTabComponent {
    constructor(platform, config) {
        this.config = config;
        this.defaultTab = 'dark';
        this.defaultTab = platform.getTheme();
    }
};
ColorSchemeSettingsTabComponent.ctorParameters = () => [
    { type: external_tabby_core_.PlatformService },
    { type: external_tabby_core_.ConfigService }
];
ColorSchemeSettingsTabComponent = __decorate([
    (0,core_.Component)({
        template: (colorSchemeSettingsTab_componentngResource_default()),
    }),
    __metadata("design:paramtypes", [external_tabby_core_.PlatformService,
        external_tabby_core_.ConfigService])
], ColorSchemeSettingsTabComponent);


// EXTERNAL MODULE: ./src/components/terminalSettingsTab.component.pug?ngResource
var terminalSettingsTab_componentngResource = __webpack_require__(8111);
var terminalSettingsTab_componentngResource_default = /*#__PURE__*/__webpack_require__.n(terminalSettingsTab_componentngResource);
;// ./src/components/terminalSettingsTab.component.ts




/** @hidden */
let TerminalSettingsTabComponent = class TerminalSettingsTabComponent {
    constructor(config, hostApp, platform) {
        this.config = config;
        this.hostApp = hostApp;
        this.platform = platform;
        this.Platform = external_tabby_core_.Platform;
        this.altKeyName = external_tabby_core_.altKeyName;
        this.metaKeyName = external_tabby_core_.metaKeyName;
    }
    openWSLVolumeMixer() {
        this.platform.openPath('sndvol.exe');
        this.platform.exec('wsl.exe', ['tput', 'bel']);
    }
};
TerminalSettingsTabComponent.ctorParameters = () => [
    { type: external_tabby_core_.ConfigService },
    { type: external_tabby_core_.HostAppService },
    { type: external_tabby_core_.PlatformService }
];
TerminalSettingsTabComponent.propDecorators = {
    true: [{ type: core_.HostBinding, args: ['class.content-box',] }]
};
TerminalSettingsTabComponent = __decorate([
    (0,core_.Component)({
        template: (terminalSettingsTab_componentngResource_default()),
    }),
    __metadata("design:paramtypes", [external_tabby_core_.ConfigService,
        external_tabby_core_.HostAppService,
        external_tabby_core_.PlatformService])
], TerminalSettingsTabComponent);


// EXTERNAL MODULE: ./src/components/colorPicker.component.pug?ngResource
var colorPicker_componentngResource = __webpack_require__(5250);
var colorPicker_componentngResource_default = /*#__PURE__*/__webpack_require__.n(colorPicker_componentngResource);
// EXTERNAL MODULE: ./src/components/colorPicker.component.scss?ngResource
var components_colorPicker_componentngResource = __webpack_require__(8700);
var components_colorPicker_componentngResource_default = /*#__PURE__*/__webpack_require__.n(components_colorPicker_componentngResource);
;// ./src/components/colorPicker.component.ts




/** @hidden */
let colorPicker_component_ColorPickerComponent = class ColorPickerComponent {
    constructor() {
        this.modelChange = new core_.EventEmitter();
    }
};
colorPicker_component_ColorPickerComponent.propDecorators = {
    model: [{ type: core_.Input }],
    title: [{ type: core_.Input }],
    hint: [{ type: core_.Input }],
    modelChange: [{ type: core_.Output }]
};
colorPicker_component_ColorPickerComponent = __decorate([
    (0,core_.Component)({
        selector: 'color-picker',
        template: (colorPicker_componentngResource_default()),
        styles: [(components_colorPicker_componentngResource_default())]
    })
], colorPicker_component_ColorPickerComponent);


// EXTERNAL MODULE: ./src/components/colorSchemePreview.component.pug?ngResource
var colorSchemePreview_componentngResource = __webpack_require__(9527);
var colorSchemePreview_componentngResource_default = /*#__PURE__*/__webpack_require__.n(colorSchemePreview_componentngResource);
// EXTERNAL MODULE: ./src/components/colorSchemePreview.component.scss?ngResource
var components_colorSchemePreview_componentngResource = __webpack_require__(2943);
var components_colorSchemePreview_componentngResource_default = /*#__PURE__*/__webpack_require__.n(components_colorSchemePreview_componentngResource);
;// ./src/components/colorSchemePreview.component.ts





/** @hidden */
let ColorSchemePreviewComponent = class ColorSchemePreviewComponent extends external_tabby_core_.BaseComponent {
    constructor(config, changeDetector) {
        super();
        this.config = config;
        this.fontPreview = false;
        this.subscribeUntilDestroyed(config.changed$, () => {
            changeDetector.markForCheck();
        });
    }
    getPreviewFontFamily() {
        return (0,external_tabby_core_.getCSSFontFamily)(this.config.store);
    }
};
ColorSchemePreviewComponent.ctorParameters = () => [
    { type: external_tabby_core_.ConfigService },
    { type: core_.ChangeDetectorRef }
];
ColorSchemePreviewComponent.propDecorators = {
    scheme: [{ type: core_.Input }],
    fontPreview: [{ type: core_.Input }]
};
ColorSchemePreviewComponent = __decorate([
    (0,core_.Component)({
        selector: 'color-scheme-preview',
        template: (colorSchemePreview_componentngResource_default()),
        changeDetection: core_.ChangeDetectionStrategy.OnPush,
        styles: [(components_colorSchemePreview_componentngResource_default())]
    }),
    __metadata("design:paramtypes", [external_tabby_core_.ConfigService,
        core_.ChangeDetectorRef])
], ColorSchemePreviewComponent);


// EXTERNAL MODULE: ./src/components/searchPanel.component.pug?ngResource
var searchPanel_componentngResource = __webpack_require__(7129);
var searchPanel_componentngResource_default = /*#__PURE__*/__webpack_require__.n(searchPanel_componentngResource);
// EXTERNAL MODULE: ./src/components/searchPanel.component.scss?ngResource
var components_searchPanel_componentngResource = __webpack_require__(161);
var components_searchPanel_componentngResource_default = /*#__PURE__*/__webpack_require__.n(components_searchPanel_componentngResource);
;// ./src/frontends/frontend.ts

/**
 * Extend to add support for a different VT frontend implementation
 */
class Frontend {
    get ready$() { return this.ready; }
    get title$() { return this.title; }
    get alternateScreenActive$() { return this.alternateScreenActive; }
    get mouseEvent$() { return this.mouseEvent; }
    get bell$() { return this.bell; }
    get contentUpdated$() { return this.contentUpdated; }
    get input$() { return this.input; }
    get resize$() { return this.resize; }
    get dragOver$() { return this.dragOver; }
    get drop$() { return this.drop; }
    get destroyed$() { return this.destroyed; }
    constructor(injector) {
        this.injector = injector;
        this.enableResizing = true;
        this.ready = new external_rxjs_.AsyncSubject();
        this.title = new external_rxjs_.ReplaySubject(1);
        this.alternateScreenActive = new external_rxjs_.BehaviorSubject(false);
        this.mouseEvent = new external_rxjs_.Subject();
        this.bell = new external_rxjs_.Subject();
        this.contentUpdated = new external_rxjs_.Subject();
        this.input = new external_rxjs_.Subject();
        this.resize = new external_rxjs_.ReplaySubject(1);
        this.dragOver = new external_rxjs_.Subject();
        this.drop = new external_rxjs_.Subject();
        this.destroyed = new external_rxjs_.Subject();
    }
    destroy() {
        this.destroyed.next();
        for (const o of [
            this.ready,
            this.title,
            this.alternateScreenActive,
            this.mouseEvent,
            this.bell,
            this.contentUpdated,
            this.input,
            this.resize,
            this.dragOver,
            this.drop,
            this.destroyed,
        ]) {
            o.complete();
        }
    }
    detach(host) { } // eslint-disable-line
}

;// ./src/components/searchPanel.component.ts







let SearchPanelComponent = class SearchPanelComponent {
    constructor(notifications, translate, config) {
        this.notifications = notifications;
        this.translate = translate;
        this.config = config;
        this.state = { resultCount: 0 };
        this.options = Object.assign({ incremental: true }, this.config.store.terminal.searchOptions);
        this.close = new core_.EventEmitter();
        this.queryChanged = new external_rxjs_.Subject();
        this.icons = {
            'case': __webpack_require__(/*! ../icons/case.svg */ 1045),
            regexp: __webpack_require__(/*! ../icons/regexp.svg */ 9738),
            wholeWord: __webpack_require__(/*! ../icons/whole-word.svg */ 6347),
            arrowUp: __webpack_require__(/*! ../icons/arrow-up.svg */ 830),
            arrowDown: __webpack_require__(/*! ../icons/arrow-down.svg */ 6177),
            close: __webpack_require__(/*! ../icons/close.svg */ 9691),
        };
        this.queryChanged.pipe((0,external_rxjs_.debounceTime)(250)).subscribe(() => {
            this.findPrevious(true);
        });
    }
    onQueryChange() {
        this.state = { resultCount: 0 };
        this.queryChanged.next(this.query);
    }
    findNext(incremental = false) {
        if (!this.query) {
            return;
        }
        this.state = this.frontend.findNext(this.query, Object.assign(Object.assign({}, this.options), { incremental: incremental || undefined }));
        if (!this.state.resultCount) {
            this.notifications.notice(this.translate.instant('Not found'));
        }
    }
    findPrevious(incremental = false) {
        if (!this.query) {
            return;
        }
        this.state = this.frontend.findPrevious(this.query, Object.assign(Object.assign({}, this.options), { incremental: incremental || undefined }));
        if (!this.state.resultCount) {
            this.notifications.notice(this.translate.instant('Not found'));
        }
    }
    saveSearchOptions() {
        this.config.store.terminal.searchOptions.regex = this.options.regex;
        this.config.store.terminal.searchOptions.caseSensitive = this.options.caseSensitive;
        this.config.store.terminal.searchOptions.wholeWord = this.options.wholeWord;
        this.config.save();
    }
    ngOnDestroy() {
        this.queryChanged.complete();
    }
};
SearchPanelComponent.ctorParameters = () => [
    { type: external_tabby_core_.NotificationsService },
    { type: external_tabby_core_.TranslateService },
    { type: external_tabby_core_.ConfigService }
];
SearchPanelComponent.propDecorators = {
    query: [{ type: core_.Input }],
    frontend: [{ type: core_.Input }],
    close: [{ type: core_.Output }]
};
SearchPanelComponent = __decorate([
    (0,core_.Component)({
        selector: 'search-panel',
        template: (searchPanel_componentngResource_default()),
        styles: [(components_searchPanel_componentngResource_default())]
    }),
    __metadata("design:paramtypes", [external_tabby_core_.NotificationsService,
        external_tabby_core_.TranslateService,
        external_tabby_core_.ConfigService])
], SearchPanelComponent);


// EXTERNAL MODULE: ./src/components/streamProcessingSettings.component.pug?ngResource
var streamProcessingSettings_componentngResource = __webpack_require__(4085);
var streamProcessingSettings_componentngResource_default = /*#__PURE__*/__webpack_require__.n(streamProcessingSettings_componentngResource);
;// ../node_modules/@biesbjerg/ngx-translate-extract-marker/__ivy_ngcc__/esm2015/lib/ngx-translate-extract-marker.js
/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
/**
 * @template T
 * @param {?} key
 * @return {?}
 */
function marker(key) {
  return key;
}
;// ./src/components/streamProcessingSettings.component.ts


/* eslint-disable @typescript-eslint/explicit-module-boundary-types */


/** @hidden */
let StreamProcessingSettingsComponent = class StreamProcessingSettingsComponent {
    constructor() {
        this.inputModes = [
            {
                key: null,
                name: marker('Normal'),
                description: marker('Input is sent as you type'),
            },
            {
                key: 'local-echo',
                name: marker('Local echo'),
                description: marker('Immediately echoes your input locally'),
            },
            {
                key: 'readline',
                name: marker('Line by line'),
                description: marker('Line editor, input is sent after you press Enter'),
            },
            {
                key: 'readline-hex',
                name: marker('Hexadecimal'),
                description: marker('Send bytes by typing in hex values'),
            },
        ];
        this.outputModes = [
            {
                key: null,
                name: marker('Normal'),
                description: marker('Output is shown as it is received'),
            },
            {
                key: 'hex',
                name: marker('Hexadecimal'),
                description: marker('Output is shown as a hexdump'),
            },
        ];
        this.newlineModes = [
            { key: null, name: marker('Keep') },
            { key: 'strip', name: marker('Strip') },
            { key: 'cr', name: marker('Force CR') },
            { key: 'lf', name: marker('Force LF') },
            { key: 'crlf', name: marker('Force CRLF') },
            { key: 'implicit_cr', name: marker('Implicit CR in every LF') },
            { key: 'implicit_lf', name: marker('Implicit LF in every CR') },
        ];
    }
    getInputModeName(key) {
        var _a;
        return (_a = this.inputModes.find(x => x.key === key)) === null || _a === void 0 ? void 0 : _a.name;
    }
    getOutputModeName(key) {
        var _a;
        return (_a = this.outputModes.find(x => x.key === key)) === null || _a === void 0 ? void 0 : _a.name;
    }
    setInputMode(mode) {
        this.options.inputMode = mode;
    }
    setOutputMode(mode) {
        this.options.outputMode = mode;
    }
};
StreamProcessingSettingsComponent.propDecorators = {
    options: [{ type: core_.Input }]
};
StreamProcessingSettingsComponent = __decorate([
    (0,core_.Component)({
        selector: 'stream-processing-settings',
        template: (streamProcessingSettings_componentngResource_default()),
    })
], StreamProcessingSettingsComponent);


// EXTERNAL MODULE: ./src/components/loginScriptsSettings.component.pug?ngResource
var loginScriptsSettings_componentngResource = __webpack_require__(3805);
var loginScriptsSettings_componentngResource_default = /*#__PURE__*/__webpack_require__.n(loginScriptsSettings_componentngResource);
;// ./src/components/loginScriptsSettings.component.ts


/* eslint-disable @typescript-eslint/explicit-module-boundary-types */


/** @hidden */
let LoginScriptsSettingsComponent = class LoginScriptsSettingsComponent {
    constructor(platform, translate) {
        this.platform = platform;
        this.translate = translate;
    }
    ngOnInit() {
        this.scripts = this.options.scripts;
    }
    deleteScript(script) {
        return __awaiter(this, void 0, void 0, function* () {
            if ((yield this.platform.showMessageBox({
                type: 'warning',
                message: this.translate.instant('Delete this script?'),
                detail: script.expect,
                buttons: [
                    this.translate.instant('Delete'),
                    this.translate.instant('Keep'),
                ],
                defaultId: 0,
                cancelId: 1,
            })).response === 0) {
                this.scripts = this.scripts.filter(x => x !== script);
            }
        });
    }
    addScript() {
        this.scripts.push({ expect: '', send: '' });
    }
    save() {
        this.options.scripts = this.scripts;
    }
};
LoginScriptsSettingsComponent.ctorParameters = () => [
    { type: external_tabby_core_.PlatformService },
    { type: external_tabby_core_.TranslateService }
];
LoginScriptsSettingsComponent.propDecorators = {
    options: [{ type: core_.Input }]
};
LoginScriptsSettingsComponent = __decorate([
    (0,core_.Component)({
        selector: 'login-scripts-settings',
        template: (loginScriptsSettings_componentngResource_default()),
    }),
    __metadata("design:paramtypes", [external_tabby_core_.PlatformService,
        external_tabby_core_.TranslateService])
], LoginScriptsSettingsComponent);


// EXTERNAL MODULE: ./src/components/terminalToolbar.component.pug?ngResource
var terminalToolbar_componentngResource = __webpack_require__(9868);
var terminalToolbar_componentngResource_default = /*#__PURE__*/__webpack_require__.n(terminalToolbar_componentngResource);
// EXTERNAL MODULE: ./src/components/terminalToolbar.component.scss?ngResource
var components_terminalToolbar_componentngResource = __webpack_require__(3306);
var components_terminalToolbar_componentngResource_default = /*#__PURE__*/__webpack_require__.n(components_terminalToolbar_componentngResource);
// EXTERNAL MODULE: ./node_modules/cli-spinner/index.js
var cli_spinner = __webpack_require__(6342);
// EXTERNAL MODULE: ./node_modules/ansi-colors/index.js
var ansi_colors = __webpack_require__(582);
var ansi_colors_default = /*#__PURE__*/__webpack_require__.n(ansi_colors);
// EXTERNAL MODULE: ../node_modules/deep-equal/index.js
var deep_equal = __webpack_require__(5405);
var deep_equal_default = /*#__PURE__*/__webpack_require__.n(deep_equal);
;// ./node_modules/@xterm/xterm/lib/xterm.mjs
/**
 * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
 * @license MIT
 *
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * @license MIT
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
var zs = Object.defineProperty;
var Rl = Object.getOwnPropertyDescriptor;
var Ll = (s, t) => {
  for (var e in t) zs(s, e, {
    get: t[e],
    enumerable: !0
  });
};
var M = (s, t, e, i) => {
    for (var r = i > 1 ? void 0 : i ? Rl(t, e) : t, n = s.length - 1, o; n >= 0; n--) (o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
    return i && r && zs(t, e, r), r;
  },
  S = (s, t) => (e, i) => t(e, i, s);
var Gs = "Terminal input",
  mi = {
    get: () => Gs,
    set: s => Gs = s
  },
  $s = "Too much output to announce, navigate to rows manually to read",
  _i = {
    get: () => $s,
    set: s => $s = s
  };
function Al(s) {
  return s.replace(/\r?\n/g, "\r");
}
function kl(s, t) {
  return t ? "\x1B[200~" + s + "\x1B[201~" : s;
}
function Vs(s, t) {
  s.clipboardData && s.clipboardData.setData("text/plain", t.selectionText), s.preventDefault();
}
function qs(s, t, e, i) {
  if (s.stopPropagation(), s.clipboardData) {
    let r = s.clipboardData.getData("text/plain");
    Cn(r, t, e, i);
  }
}
function Cn(s, t, e, i) {
  s = Al(s), s = kl(s, e.decPrivateModes.bracketedPasteMode && i.rawOptions.ignoreBracketedPasteMode !== !0), e.triggerDataEvent(s, !0), t.value = "";
}
function Mn(s, t, e) {
  let i = e.getBoundingClientRect(),
    r = s.clientX - i.left - 10,
    n = s.clientY - i.top - 10;
  t.style.width = "20px", t.style.height = "20px", t.style.left = `${r}px`, t.style.top = `${n}px`, t.style.zIndex = "1000", t.focus();
}
function Pn(s, t, e, i, r) {
  Mn(s, t, e), r && i.rightClickSelect(s), t.value = i.selectionText, t.select();
}
function Ce(s) {
  return s > 65535 ? (s -= 65536, String.fromCharCode((s >> 10) + 55296) + String.fromCharCode(s % 1024 + 56320)) : String.fromCharCode(s);
}
function It(s, t = 0, e = s.length) {
  let i = "";
  for (let r = t; r < e; ++r) {
    let n = s[r];
    n > 65535 ? (n -= 65536, i += String.fromCharCode((n >> 10) + 55296) + String.fromCharCode(n % 1024 + 56320)) : i += String.fromCharCode(n);
  }
  return i;
}
var er = class {
    constructor() {
      this._interim = 0;
    }
    clear() {
      this._interim = 0;
    }
    decode(t, e) {
      let i = t.length;
      if (!i) return 0;
      let r = 0,
        n = 0;
      if (this._interim) {
        let o = t.charCodeAt(n++);
        56320 <= o && o <= 57343 ? e[r++] = (this._interim - 55296) * 1024 + o - 56320 + 65536 : (e[r++] = this._interim, e[r++] = o), this._interim = 0;
      }
      for (let o = n; o < i; ++o) {
        let l = t.charCodeAt(o);
        if (55296 <= l && l <= 56319) {
          if (++o >= i) return this._interim = l, r;
          let a = t.charCodeAt(o);
          56320 <= a && a <= 57343 ? e[r++] = (l - 55296) * 1024 + a - 56320 + 65536 : (e[r++] = l, e[r++] = a);
          continue;
        }
        l !== 65279 && (e[r++] = l);
      }
      return r;
    }
  },
  tr = class {
    constructor() {
      this.interim = new Uint8Array(3);
    }
    clear() {
      this.interim.fill(0);
    }
    decode(t, e) {
      let i = t.length;
      if (!i) return 0;
      let r = 0,
        n,
        o,
        l,
        a,
        u = 0,
        h = 0;
      if (this.interim[0]) {
        let _ = !1,
          p = this.interim[0];
        p &= (p & 224) === 192 ? 31 : (p & 240) === 224 ? 15 : 7;
        let m = 0,
          f;
        for (; (f = this.interim[++m] & 63) && m < 4;) p <<= 6, p |= f;
        let A = (this.interim[0] & 224) === 192 ? 2 : (this.interim[0] & 240) === 224 ? 3 : 4,
          R = A - m;
        for (; h < R;) {
          if (h >= i) return 0;
          if (f = t[h++], (f & 192) !== 128) {
            h--, _ = !0;
            break;
          } else this.interim[m++] = f, p <<= 6, p |= f & 63;
        }
        _ || (A === 2 ? p < 128 ? h-- : e[r++] = p : A === 3 ? p < 2048 || p >= 55296 && p <= 57343 || p === 65279 || (e[r++] = p) : p < 65536 || p > 1114111 || (e[r++] = p)), this.interim.fill(0);
      }
      let c = i - 4,
        d = h;
      for (; d < i;) {
        for (; d < c && !((n = t[d]) & 128) && !((o = t[d + 1]) & 128) && !((l = t[d + 2]) & 128) && !((a = t[d + 3]) & 128);) e[r++] = n, e[r++] = o, e[r++] = l, e[r++] = a, d += 4;
        if (n = t[d++], n < 128) e[r++] = n;else if ((n & 224) === 192) {
          if (d >= i) return this.interim[0] = n, r;
          if (o = t[d++], (o & 192) !== 128) {
            d--;
            continue;
          }
          if (u = (n & 31) << 6 | o & 63, u < 128) {
            d--;
            continue;
          }
          e[r++] = u;
        } else if ((n & 240) === 224) {
          if (d >= i) return this.interim[0] = n, r;
          if (o = t[d++], (o & 192) !== 128) {
            d--;
            continue;
          }
          if (d >= i) return this.interim[0] = n, this.interim[1] = o, r;
          if (l = t[d++], (l & 192) !== 128) {
            d--;
            continue;
          }
          if (u = (n & 15) << 12 | (o & 63) << 6 | l & 63, u < 2048 || u >= 55296 && u <= 57343 || u === 65279) continue;
          e[r++] = u;
        } else if ((n & 248) === 240) {
          if (d >= i) return this.interim[0] = n, r;
          if (o = t[d++], (o & 192) !== 128) {
            d--;
            continue;
          }
          if (d >= i) return this.interim[0] = n, this.interim[1] = o, r;
          if (l = t[d++], (l & 192) !== 128) {
            d--;
            continue;
          }
          if (d >= i) return this.interim[0] = n, this.interim[1] = o, this.interim[2] = l, r;
          if (a = t[d++], (a & 192) !== 128) {
            d--;
            continue;
          }
          if (u = (n & 7) << 18 | (o & 63) << 12 | (l & 63) << 6 | a & 63, u < 65536 || u > 1114111) continue;
          e[r++] = u;
        }
      }
      return r;
    }
  };
var ir = "";
var we = " ";
var De = class s {
    constructor() {
      this.fg = 0;
      this.bg = 0;
      this.extended = new rt();
    }
    static toColorRGB(t) {
      return [t >>> 16 & 255, t >>> 8 & 255, t & 255];
    }
    static fromColorRGB(t) {
      return (t[0] & 255) << 16 | (t[1] & 255) << 8 | t[2] & 255;
    }
    clone() {
      let t = new s();
      return t.fg = this.fg, t.bg = this.bg, t.extended = this.extended.clone(), t;
    }
    isInverse() {
      return this.fg & 67108864;
    }
    isBold() {
      return this.fg & 134217728;
    }
    isUnderline() {
      return this.hasExtendedAttrs() && this.extended.underlineStyle !== 0 ? 1 : this.fg & 268435456;
    }
    isBlink() {
      return this.fg & 536870912;
    }
    isInvisible() {
      return this.fg & 1073741824;
    }
    isItalic() {
      return this.bg & 67108864;
    }
    isDim() {
      return this.bg & 134217728;
    }
    isStrikethrough() {
      return this.fg & 2147483648;
    }
    isProtected() {
      return this.bg & 536870912;
    }
    isOverline() {
      return this.bg & 1073741824;
    }
    getFgColorMode() {
      return this.fg & 50331648;
    }
    getBgColorMode() {
      return this.bg & 50331648;
    }
    isFgRGB() {
      return (this.fg & 50331648) === 50331648;
    }
    isBgRGB() {
      return (this.bg & 50331648) === 50331648;
    }
    isFgPalette() {
      return (this.fg & 50331648) === 16777216 || (this.fg & 50331648) === 33554432;
    }
    isBgPalette() {
      return (this.bg & 50331648) === 16777216 || (this.bg & 50331648) === 33554432;
    }
    isFgDefault() {
      return (this.fg & 50331648) === 0;
    }
    isBgDefault() {
      return (this.bg & 50331648) === 0;
    }
    isAttributeDefault() {
      return this.fg === 0 && this.bg === 0;
    }
    getFgColor() {
      switch (this.fg & 50331648) {
        case 16777216:
        case 33554432:
          return this.fg & 255;
        case 50331648:
          return this.fg & 16777215;
        default:
          return -1;
      }
    }
    getBgColor() {
      switch (this.bg & 50331648) {
        case 16777216:
        case 33554432:
          return this.bg & 255;
        case 50331648:
          return this.bg & 16777215;
        default:
          return -1;
      }
    }
    hasExtendedAttrs() {
      return this.bg & 268435456;
    }
    updateExtended() {
      this.extended.isEmpty() ? this.bg &= -268435457 : this.bg |= 268435456;
    }
    getUnderlineColor() {
      if (this.bg & 268435456 && ~this.extended.underlineColor) switch (this.extended.underlineColor & 50331648) {
        case 16777216:
        case 33554432:
          return this.extended.underlineColor & 255;
        case 50331648:
          return this.extended.underlineColor & 16777215;
        default:
          return this.getFgColor();
      }
      return this.getFgColor();
    }
    getUnderlineColorMode() {
      return this.bg & 268435456 && ~this.extended.underlineColor ? this.extended.underlineColor & 50331648 : this.getFgColorMode();
    }
    isUnderlineColorRGB() {
      return this.bg & 268435456 && ~this.extended.underlineColor ? (this.extended.underlineColor & 50331648) === 50331648 : this.isFgRGB();
    }
    isUnderlineColorPalette() {
      return this.bg & 268435456 && ~this.extended.underlineColor ? (this.extended.underlineColor & 50331648) === 16777216 || (this.extended.underlineColor & 50331648) === 33554432 : this.isFgPalette();
    }
    isUnderlineColorDefault() {
      return this.bg & 268435456 && ~this.extended.underlineColor ? (this.extended.underlineColor & 50331648) === 0 : this.isFgDefault();
    }
    getUnderlineStyle() {
      return this.fg & 268435456 ? this.bg & 268435456 ? this.extended.underlineStyle : 1 : 0;
    }
    getUnderlineVariantOffset() {
      return this.extended.underlineVariantOffset;
    }
  },
  rt = class s {
    constructor(t = 0, e = 0) {
      this._ext = 0;
      this._urlId = 0;
      this._ext = t, this._urlId = e;
    }
    get ext() {
      return this._urlId ? this._ext & -469762049 | this.underlineStyle << 26 : this._ext;
    }
    set ext(t) {
      this._ext = t;
    }
    get underlineStyle() {
      return this._urlId ? 5 : (this._ext & 469762048) >> 26;
    }
    set underlineStyle(t) {
      this._ext &= -469762049, this._ext |= t << 26 & 469762048;
    }
    get underlineColor() {
      return this._ext & 67108863;
    }
    set underlineColor(t) {
      this._ext &= -67108864, this._ext |= t & 67108863;
    }
    get urlId() {
      return this._urlId;
    }
    set urlId(t) {
      this._urlId = t;
    }
    get underlineVariantOffset() {
      let t = (this._ext & 3758096384) >> 29;
      return t < 0 ? t ^ 4294967288 : t;
    }
    set underlineVariantOffset(t) {
      this._ext &= 536870911, this._ext |= t << 29 & 3758096384;
    }
    clone() {
      return new s(this._ext, this._urlId);
    }
    isEmpty() {
      return this.underlineStyle === 0 && this._urlId === 0;
    }
  };
var q = class s extends De {
  constructor() {
    super(...arguments);
    this.content = 0;
    this.fg = 0;
    this.bg = 0;
    this.extended = new rt();
    this.combinedData = "";
  }
  static fromCharData(e) {
    let i = new s();
    return i.setFromCharData(e), i;
  }
  isCombined() {
    return this.content & 2097152;
  }
  getWidth() {
    return this.content >> 22;
  }
  getChars() {
    return this.content & 2097152 ? this.combinedData : this.content & 2097151 ? Ce(this.content & 2097151) : "";
  }
  getCode() {
    return this.isCombined() ? this.combinedData.charCodeAt(this.combinedData.length - 1) : this.content & 2097151;
  }
  setFromCharData(e) {
    this.fg = e[0], this.bg = 0;
    let i = !1;
    if (e[1].length > 2) i = !0;else if (e[1].length === 2) {
      let r = e[1].charCodeAt(0);
      if (55296 <= r && r <= 56319) {
        let n = e[1].charCodeAt(1);
        56320 <= n && n <= 57343 ? this.content = (r - 55296) * 1024 + n - 56320 + 65536 | e[2] << 22 : i = !0;
      } else i = !0;
    } else this.content = e[1].charCodeAt(0) | e[2] << 22;
    i && (this.combinedData = e[1], this.content = 2097152 | e[2] << 22);
  }
  getAsCharData() {
    return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
  }
};
var js = "di$target",
  Hn = "di$dependencies",
  Fn = new Map();
function Xs(s) {
  return s[Hn] || [];
}
function ie(s) {
  if (Fn.has(s)) return Fn.get(s);
  let t = function (e, i, r) {
    if (arguments.length !== 3) throw new Error("@IServiceName-decorator can only be used to decorate a parameter");
    Pl(t, e, r);
  };
  return t._id = s, Fn.set(s, t), t;
}
function Pl(s, t, e) {
  t[js] === t ? t[Hn].push({
    id: s,
    index: e
  }) : (t[Hn] = [{
    id: s,
    index: e
  }], t[js] = t);
}
var F = ie("BufferService"),
  rr = ie("CoreMouseService"),
  ge = ie("CoreService"),
  Zs = ie("CharsetService"),
  xt = ie("InstantiationService");
var nr = ie("LogService"),
  H = ie("OptionsService"),
  sr = ie("OscLinkService"),
  Js = ie("UnicodeService"),
  Be = ie("DecorationService");
var wt = class {
  constructor(t, e, i) {
    this._bufferService = t;
    this._optionsService = e;
    this._oscLinkService = i;
  }
  provideLinks(t, e) {
    let i = this._bufferService.buffer.lines.get(t - 1);
    if (!i) {
      e(void 0);
      return;
    }
    let r = [],
      n = this._optionsService.rawOptions.linkHandler,
      o = new q(),
      l = i.getTrimmedLength(),
      a = -1,
      u = -1,
      h = !1;
    for (let c = 0; c < l; c++) if (!(u === -1 && !i.hasContent(c))) {
      if (i.loadCell(c, o), o.hasExtendedAttrs() && o.extended.urlId) {
        if (u === -1) {
          u = c, a = o.extended.urlId;
          continue;
        } else h = o.extended.urlId !== a;
      } else u !== -1 && (h = !0);
      if (h || u !== -1 && c === l - 1) {
        let d = this._oscLinkService.getLinkData(a)?.uri;
        if (d) {
          let _ = {
              start: {
                x: u + 1,
                y: t
              },
              end: {
                x: c + (!h && c === l - 1 ? 1 : 0),
                y: t
              }
            },
            p = !1;
          if (!n?.allowNonHttpProtocols) try {
            let m = new URL(d);
            ["http:", "https:"].includes(m.protocol) || (p = !0);
          } catch {
            p = !0;
          }
          p || r.push({
            text: d,
            range: _,
            activate: (m, f) => n ? n.activate(m, f, _) : Ol(m, f),
            hover: (m, f) => n?.hover?.(m, f, _),
            leave: (m, f) => n?.leave?.(m, f, _)
          });
        }
        h = !1, o.hasExtendedAttrs() && o.extended.urlId ? (u = c, a = o.extended.urlId) : (u = -1, a = -1);
      }
    }
    e(r);
  }
};
wt = M([S(0, F), S(1, H), S(2, sr)], wt);
function Ol(s, t) {
  if (confirm(`Do you want to navigate to ${t}?

WARNING: This link could potentially be dangerous`)) {
    let i = window.open();
    if (i) {
      try {
        i.opener = null;
      } catch {}
      i.location.href = t;
    } else console.warn("Opening link blocked as opener could not be cleared");
  }
}
var nt = ie("CharSizeService"),
  ae = ie("CoreBrowserService"),
  Dt = ie("MouseService"),
  ce = ie("RenderService"),
  Qs = ie("SelectionService"),
  or = ie("CharacterJoinerService"),
  Re = ie("ThemeService"),
  lr = ie("LinkProviderService");
var Wn = class {
    constructor() {
      this.listeners = [], this.unexpectedErrorHandler = function (t) {
        setTimeout(() => {
          throw t.stack ? ar.isErrorNoTelemetry(t) ? new ar(t.message + `

` + t.stack) : new Error(t.message + `

` + t.stack) : t;
        }, 0);
      };
    }
    addListener(t) {
      return this.listeners.push(t), () => {
        this._removeListener(t);
      };
    }
    emit(t) {
      this.listeners.forEach(e => {
        e(t);
      });
    }
    _removeListener(t) {
      this.listeners.splice(this.listeners.indexOf(t), 1);
    }
    setUnexpectedErrorHandler(t) {
      this.unexpectedErrorHandler = t;
    }
    getUnexpectedErrorHandler() {
      return this.unexpectedErrorHandler;
    }
    onUnexpectedError(t) {
      this.unexpectedErrorHandler(t), this.emit(t);
    }
    onUnexpectedExternalError(t) {
      this.unexpectedErrorHandler(t);
    }
  },
  Bl = new Wn();
function Lt(s) {
  Nl(s) || Bl.onUnexpectedError(s);
}
var Un = "Canceled";
function Nl(s) {
  return s instanceof bi ? !0 : s instanceof Error && s.name === Un && s.message === Un;
}
var bi = class extends Error {
  constructor() {
    super(Un), this.name = this.message;
  }
};
function eo(s) {
  return s ? new Error(`Illegal argument: ${s}`) : new Error("Illegal argument");
}
var ar = class s extends Error {
    constructor(t) {
      super(t), this.name = "CodeExpectedError";
    }
    static fromError(t) {
      if (t instanceof s) return t;
      let e = new s();
      return e.message = t.message, e.stack = t.stack, e;
    }
    static isErrorNoTelemetry(t) {
      return t.name === "CodeExpectedError";
    }
  },
  Rt = class s extends Error {
    constructor(t) {
      super(t || "An unexpected bug occurred."), Object.setPrototypeOf(this, s.prototype);
    }
  };
function Fl(s, t, e = 0, i = s.length) {
  let r = e,
    n = i;
  for (; r < n;) {
    let o = Math.floor((r + n) / 2);
    t(s[o]) ? r = o + 1 : n = o;
  }
  return r - 1;
}
var cr = class cr {
  constructor(t) {
    this._array = t;
    this._findLastMonotonousLastIdx = 0;
  }
  findLastMonotonous(t) {
    if (cr.assertInvariants) {
      if (this._prevFindLastPredicate) {
        for (let i of this._array) if (this._prevFindLastPredicate(i) && !t(i)) throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");
      }
      this._prevFindLastPredicate = t;
    }
    let e = Fl(this._array, t, this._findLastMonotonousLastIdx);
    return this._findLastMonotonousLastIdx = e + 1, e === -1 ? void 0 : this._array[e];
  }
};
cr.assertInvariants = !1;
var to = (/* unused pure expression or super */ null && (cr));
function Se(s, t = 0) {
  return s[s.length - (1 + t)];
}
var ro;
(l => {
  function s(a) {
    return a < 0;
  }
  l.isLessThan = s;
  function t(a) {
    return a <= 0;
  }
  l.isLessThanOrEqual = t;
  function e(a) {
    return a > 0;
  }
  l.isGreaterThan = e;
  function i(a) {
    return a === 0;
  }
  l.isNeitherLessOrGreaterThan = i, l.greaterThan = 1, l.lessThan = -1, l.neitherLessOrGreaterThan = 0;
})(ro ||= {});
function no(s, t) {
  return (e, i) => t(s(e), s(i));
}
var so = (s, t) => s - t;
var At = class At {
  constructor(t) {
    this.iterate = t;
  }
  forEach(t) {
    this.iterate(e => (t(e), !0));
  }
  toArray() {
    let t = [];
    return this.iterate(e => (t.push(e), !0)), t;
  }
  filter(t) {
    return new At(e => this.iterate(i => t(i) ? e(i) : !0));
  }
  map(t) {
    return new At(e => this.iterate(i => e(t(i))));
  }
  some(t) {
    let e = !1;
    return this.iterate(i => (e = t(i), !e)), e;
  }
  findFirst(t) {
    let e;
    return this.iterate(i => t(i) ? (e = i, !1) : !0), e;
  }
  findLast(t) {
    let e;
    return this.iterate(i => (t(i) && (e = i), !0)), e;
  }
  findLastMaxBy(t) {
    let e,
      i = !0;
    return this.iterate(r => ((i || ro.isGreaterThan(t(r, e))) && (i = !1, e = r), !0)), e;
  }
};
At.empty = new At(t => {});
var io = (/* unused pure expression or super */ null && (At));
function co(s, t) {
  let e = Object.create(null);
  for (let i of s) {
    let r = t(i),
      n = e[r];
    n || (n = e[r] = []), n.push(i);
  }
  return e;
}
var lo,
  ao,
  oo = class {
    constructor(t, e) {
      this.toKey = e;
      this._map = new Map();
      this[lo] = "SetWithKey";
      for (let i of t) this.add(i);
    }
    get size() {
      return this._map.size;
    }
    add(t) {
      let e = this.toKey(t);
      return this._map.set(e, t), this;
    }
    delete(t) {
      return this._map.delete(this.toKey(t));
    }
    has(t) {
      return this._map.has(this.toKey(t));
    }
    *entries() {
      for (let t of this._map.values()) yield [t, t];
    }
    keys() {
      return this.values();
    }
    *values() {
      for (let t of this._map.values()) yield t;
    }
    clear() {
      this._map.clear();
    }
    forEach(t, e) {
      this._map.forEach(i => t.call(e, i, i, this));
    }
    [(ao = Symbol.iterator, lo = Symbol.toStringTag, ao)]() {
      return this.values();
    }
  };
var ur = class {
  constructor() {
    this.map = new Map();
  }
  add(t, e) {
    let i = this.map.get(t);
    i || (i = new Set(), this.map.set(t, i)), i.add(e);
  }
  delete(t, e) {
    let i = this.map.get(t);
    i && (i.delete(e), i.size === 0 && this.map.delete(t));
  }
  forEach(t, e) {
    let i = this.map.get(t);
    i && i.forEach(e);
  }
  get(t) {
    let e = this.map.get(t);
    return e || new Set();
  }
};
function Kn(s, t) {
  let e = this,
    i = !1,
    r;
  return function () {
    if (i) return r;
    if (i = !0, t) try {
      r = s.apply(e, arguments);
    } finally {
      t();
    } else r = s.apply(e, arguments);
    return r;
  };
}
var zn;
(O => {
  function s(I) {
    return I && typeof I == "object" && typeof I[Symbol.iterator] == "function";
  }
  O.is = s;
  let t = Object.freeze([]);
  function e() {
    return t;
  }
  O.empty = e;
  function* i(I) {
    yield I;
  }
  O.single = i;
  function r(I) {
    return s(I) ? I : i(I);
  }
  O.wrap = r;
  function n(I) {
    return I || t;
  }
  O.from = n;
  function* o(I) {
    for (let k = I.length - 1; k >= 0; k--) yield I[k];
  }
  O.reverse = o;
  function l(I) {
    return !I || I[Symbol.iterator]().next().done === !0;
  }
  O.isEmpty = l;
  function a(I) {
    return I[Symbol.iterator]().next().value;
  }
  O.first = a;
  function u(I, k) {
    let P = 0;
    for (let oe of I) if (k(oe, P++)) return !0;
    return !1;
  }
  O.some = u;
  function h(I, k) {
    for (let P of I) if (k(P)) return P;
  }
  O.find = h;
  function* c(I, k) {
    for (let P of I) k(P) && (yield P);
  }
  O.filter = c;
  function* d(I, k) {
    let P = 0;
    for (let oe of I) yield k(oe, P++);
  }
  O.map = d;
  function* _(I, k) {
    let P = 0;
    for (let oe of I) yield* k(oe, P++);
  }
  O.flatMap = _;
  function* p(...I) {
    for (let k of I) yield* k;
  }
  O.concat = p;
  function m(I, k, P) {
    let oe = P;
    for (let Me of I) oe = k(oe, Me);
    return oe;
  }
  O.reduce = m;
  function* f(I, k, P = I.length) {
    for (k < 0 && (k += I.length), P < 0 ? P += I.length : P > I.length && (P = I.length); k < P; k++) yield I[k];
  }
  O.slice = f;
  function A(I, k = Number.POSITIVE_INFINITY) {
    let P = [];
    if (k === 0) return [P, I];
    let oe = I[Symbol.iterator]();
    for (let Me = 0; Me < k; Me++) {
      let Pe = oe.next();
      if (Pe.done) return [P, O.empty()];
      P.push(Pe.value);
    }
    return [P, {
      [Symbol.iterator]() {
        return oe;
      }
    }];
  }
  O.consume = A;
  async function R(I) {
    let k = [];
    for await (let P of I) k.push(P);
    return Promise.resolve(k);
  }
  O.asyncToArray = R;
})(zn ||= {});
var Wl = !1,
  dt = null,
  hr = class hr {
    constructor() {
      this.livingDisposables = new Map();
    }
    getDisposableData(t) {
      let e = this.livingDisposables.get(t);
      return e || (e = {
        parent: null,
        source: null,
        isSingleton: !1,
        value: t,
        idx: hr.idx++
      }, this.livingDisposables.set(t, e)), e;
    }
    trackDisposable(t) {
      let e = this.getDisposableData(t);
      e.source || (e.source = new Error().stack);
    }
    setParent(t, e) {
      let i = this.getDisposableData(t);
      i.parent = e;
    }
    markAsDisposed(t) {
      this.livingDisposables.delete(t);
    }
    markAsSingleton(t) {
      this.getDisposableData(t).isSingleton = !0;
    }
    getRootParent(t, e) {
      let i = e.get(t);
      if (i) return i;
      let r = t.parent ? this.getRootParent(this.getDisposableData(t.parent), e) : t;
      return e.set(t, r), r;
    }
    getTrackedDisposables() {
      let t = new Map();
      return [...this.livingDisposables.entries()].filter(([, i]) => i.source !== null && !this.getRootParent(i, t).isSingleton).flatMap(([i]) => i);
    }
    computeLeakingDisposables(t = 10, e) {
      let i;
      if (e) i = e;else {
        let a = new Map(),
          u = [...this.livingDisposables.values()].filter(c => c.source !== null && !this.getRootParent(c, a).isSingleton);
        if (u.length === 0) return;
        let h = new Set(u.map(c => c.value));
        if (i = u.filter(c => !(c.parent && h.has(c.parent))), i.length === 0) throw new Error("There are cyclic diposable chains!");
      }
      if (!i) return;
      function r(a) {
        function u(c, d) {
          for (; c.length > 0 && d.some(_ => typeof _ == "string" ? _ === c[0] : c[0].match(_));) c.shift();
        }
        let h = a.source.split(`
`).map(c => c.trim().replace("at ", "")).filter(c => c !== "");
        return u(h, ["Error", /^trackDisposable \(.*\)$/, /^DisposableTracker.trackDisposable \(.*\)$/]), h.reverse();
      }
      let n = new ur();
      for (let a of i) {
        let u = r(a);
        for (let h = 0; h <= u.length; h++) n.add(u.slice(0, h).join(`
`), a);
      }
      i.sort(no(a => a.idx, so));
      let o = "",
        l = 0;
      for (let a of i.slice(0, t)) {
        l++;
        let u = r(a),
          h = [];
        for (let c = 0; c < u.length; c++) {
          let d = u[c];
          d = `(shared with ${n.get(u.slice(0, c + 1).join(`
`)).size}/${i.length} leaks) at ${d}`;
          let p = n.get(u.slice(0, c).join(`
`)),
            m = co([...p].map(f => r(f)[c]), f => f);
          delete m[u[c]];
          for (let [f, A] of Object.entries(m)) h.unshift(`    - stacktraces of ${A.length} other leaks continue with ${f}`);
          h.unshift(d);
        }
        o += `


==================== Leaking disposable ${l}/${i.length}: ${a.value.constructor.name} ====================
${h.join(`
`)}
============================================================

`;
      }
      return i.length > t && (o += `


... and ${i.length - t} more leaking disposables

`), {
        leaks: i,
        details: o
      };
    }
  };
hr.idx = 0;
var uo = (/* unused pure expression or super */ null && (hr));
function Ul(s) {
  dt = s;
}
if (Wl) {
  let s = "__is_disposable_tracked__";
  Ul(new class {
    trackDisposable(t) {
      let e = new Error("Potentially leaked disposable").stack;
      setTimeout(() => {
        t[s] || console.log(e);
      }, 3e3);
    }
    setParent(t, e) {
      if (t && t !== D.None) try {
        t[s] = !0;
      } catch {}
    }
    markAsDisposed(t) {
      if (t && t !== D.None) try {
        t[s] = !0;
      } catch {}
    }
    markAsSingleton(t) {}
  }());
}
function fr(s) {
  return dt?.trackDisposable(s), s;
}
function pr(s) {
  dt?.markAsDisposed(s);
}
function vi(s, t) {
  dt?.setParent(s, t);
}
function Kl(s, t) {
  if (dt) for (let e of s) dt.setParent(e, t);
}
function Gn(s) {
  return dt?.markAsSingleton(s), s;
}
function Ne(s) {
  if (zn.is(s)) {
    let t = [];
    for (let e of s) if (e) try {
      e.dispose();
    } catch (i) {
      t.push(i);
    }
    if (t.length === 1) throw t[0];
    if (t.length > 1) throw new AggregateError(t, "Encountered errors while disposing of store");
    return Array.isArray(s) ? [] : s;
  } else if (s) return s.dispose(), s;
}
function ho(...s) {
  let t = C(() => Ne(s));
  return Kl(s, t), t;
}
function C(s) {
  let t = fr({
    dispose: Kn(() => {
      pr(t), s();
    })
  });
  return t;
}
var dr = class dr {
  constructor() {
    this._toDispose = new Set();
    this._isDisposed = !1;
    fr(this);
  }
  dispose() {
    this._isDisposed || (pr(this), this._isDisposed = !0, this.clear());
  }
  get isDisposed() {
    return this._isDisposed;
  }
  clear() {
    if (this._toDispose.size !== 0) try {
      Ne(this._toDispose);
    } finally {
      this._toDispose.clear();
    }
  }
  add(t) {
    if (!t) return t;
    if (t === this) throw new Error("Cannot register a disposable on itself!");
    return vi(t, this), this._isDisposed ? dr.DISABLE_DISPOSED_WARNING || console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack) : this._toDispose.add(t), t;
  }
  delete(t) {
    if (t) {
      if (t === this) throw new Error("Cannot dispose a disposable on itself!");
      this._toDispose.delete(t), t.dispose();
    }
  }
  deleteAndLeak(t) {
    t && this._toDispose.has(t) && (this._toDispose.delete(t), vi(t, null));
  }
};
dr.DISABLE_DISPOSED_WARNING = !1;
var Ee = dr,
  D = class {
    constructor() {
      this._store = new Ee();
      fr(this), vi(this._store, this);
    }
    dispose() {
      pr(this), this._store.dispose();
    }
    _register(t) {
      if (t === this) throw new Error("Cannot register a disposable on itself!");
      return this._store.add(t);
    }
  };
D.None = Object.freeze({
  dispose() {}
});
var ye = class {
  constructor() {
    this._isDisposed = !1;
    fr(this);
  }
  get value() {
    return this._isDisposed ? void 0 : this._value;
  }
  set value(t) {
    this._isDisposed || t === this._value || (this._value?.dispose(), t && vi(t, this), this._value = t);
  }
  clear() {
    this.value = void 0;
  }
  dispose() {
    this._isDisposed = !0, pr(this), this._value?.dispose(), this._value = void 0;
  }
  clearAndLeak() {
    let t = this._value;
    return this._value = void 0, t && vi(t, null), t;
  }
};
var fe = typeof window == "object" ? window : globalThis;
var kt = class kt {
  constructor(t) {
    this.element = t, this.next = kt.Undefined, this.prev = kt.Undefined;
  }
};
kt.Undefined = new kt(void 0);
var G = kt,
  Ct = class {
    constructor() {
      this._first = G.Undefined;
      this._last = G.Undefined;
      this._size = 0;
    }
    get size() {
      return this._size;
    }
    isEmpty() {
      return this._first === G.Undefined;
    }
    clear() {
      let t = this._first;
      for (; t !== G.Undefined;) {
        let e = t.next;
        t.prev = G.Undefined, t.next = G.Undefined, t = e;
      }
      this._first = G.Undefined, this._last = G.Undefined, this._size = 0;
    }
    unshift(t) {
      return this._insert(t, !1);
    }
    push(t) {
      return this._insert(t, !0);
    }
    _insert(t, e) {
      let i = new G(t);
      if (this._first === G.Undefined) this._first = i, this._last = i;else if (e) {
        let n = this._last;
        this._last = i, i.prev = n, n.next = i;
      } else {
        let n = this._first;
        this._first = i, i.next = n, n.prev = i;
      }
      this._size += 1;
      let r = !1;
      return () => {
        r || (r = !0, this._remove(i));
      };
    }
    shift() {
      if (this._first !== G.Undefined) {
        let t = this._first.element;
        return this._remove(this._first), t;
      }
    }
    pop() {
      if (this._last !== G.Undefined) {
        let t = this._last.element;
        return this._remove(this._last), t;
      }
    }
    _remove(t) {
      if (t.prev !== G.Undefined && t.next !== G.Undefined) {
        let e = t.prev;
        e.next = t.next, t.next.prev = e;
      } else t.prev === G.Undefined && t.next === G.Undefined ? (this._first = G.Undefined, this._last = G.Undefined) : t.next === G.Undefined ? (this._last = this._last.prev, this._last.next = G.Undefined) : t.prev === G.Undefined && (this._first = this._first.next, this._first.prev = G.Undefined);
      this._size -= 1;
    }
    *[Symbol.iterator]() {
      let t = this._first;
      for (; t !== G.Undefined;) yield t.element, t = t.next;
    }
  };
var zl = globalThis.performance && typeof globalThis.performance.now == "function",
  mr = class s {
    static create(t) {
      return new s(t);
    }
    constructor(t) {
      this._now = zl && t === !1 ? Date.now : globalThis.performance.now.bind(globalThis.performance), this._startTime = this._now(), this._stopTime = -1;
    }
    stop() {
      this._stopTime = this._now();
    }
    reset() {
      this._startTime = this._now(), this._stopTime = -1;
    }
    elapsed() {
      return this._stopTime !== -1 ? this._stopTime - this._startTime : this._now() - this._startTime;
    }
  };
var Gl = !1,
  fo = !1,
  $l = !1,
  $;
(Qe => {
  Qe.None = () => D.None;
  function t(y) {
    if ($l) {
      let {
          onDidAddListener: T
        } = y,
        g = gi.create(),
        w = 0;
      y.onDidAddListener = () => {
        ++w === 2 && (console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"), g.print()), T?.();
      };
    }
  }
  function e(y, T) {
    return d(y, () => {}, 0, void 0, !0, void 0, T);
  }
  Qe.defer = e;
  function i(y) {
    return (T, g = null, w) => {
      let E = !1,
        x;
      return x = y(N => {
        if (!E) return x ? x.dispose() : E = !0, T.call(g, N);
      }, null, w), E && x.dispose(), x;
    };
  }
  Qe.once = i;
  function r(y, T, g) {
    return h((w, E = null, x) => y(N => w.call(E, T(N)), null, x), g);
  }
  Qe.map = r;
  function n(y, T, g) {
    return h((w, E = null, x) => y(N => {
      T(N), w.call(E, N);
    }, null, x), g);
  }
  Qe.forEach = n;
  function o(y, T, g) {
    return h((w, E = null, x) => y(N => T(N) && w.call(E, N), null, x), g);
  }
  Qe.filter = o;
  function l(y) {
    return y;
  }
  Qe.signal = l;
  function a(...y) {
    return (T, g = null, w) => {
      let E = ho(...y.map(x => x(N => T.call(g, N))));
      return c(E, w);
    };
  }
  Qe.any = a;
  function u(y, T, g, w) {
    let E = g;
    return r(y, x => (E = T(E, x), E), w);
  }
  Qe.reduce = u;
  function h(y, T) {
    let g,
      w = {
        onWillAddFirstListener() {
          g = y(E.fire, E);
        },
        onDidRemoveLastListener() {
          g?.dispose();
        }
      };
    T || t(w);
    let E = new v(w);
    return T?.add(E), E.event;
  }
  function c(y, T) {
    return T instanceof Array ? T.push(y) : T && T.add(y), y;
  }
  function d(y, T, g = 100, w = !1, E = !1, x, N) {
    let Z,
      te,
      Oe,
      ze = 0,
      le,
      et = {
        leakWarningThreshold: x,
        onWillAddFirstListener() {
          Z = y(ht => {
            ze++, te = T(te, ht), w && !Oe && (me.fire(te), te = void 0), le = () => {
              let fi = te;
              te = void 0, Oe = void 0, (!w || ze > 1) && me.fire(fi), ze = 0;
            }, typeof g == "number" ? (clearTimeout(Oe), Oe = setTimeout(le, g)) : Oe === void 0 && (Oe = 0, queueMicrotask(le));
          });
        },
        onWillRemoveListener() {
          E && ze > 0 && le?.();
        },
        onDidRemoveLastListener() {
          le = void 0, Z.dispose();
        }
      };
    N || t(et);
    let me = new v(et);
    return N?.add(me), me.event;
  }
  Qe.debounce = d;
  function _(y, T = 0, g) {
    return Qe.debounce(y, (w, E) => w ? (w.push(E), w) : [E], T, void 0, !0, void 0, g);
  }
  Qe.accumulate = _;
  function p(y, T = (w, E) => w === E, g) {
    let w = !0,
      E;
    return o(y, x => {
      let N = w || !T(x, E);
      return w = !1, E = x, N;
    }, g);
  }
  Qe.latch = p;
  function m(y, T, g) {
    return [Qe.filter(y, T, g), Qe.filter(y, w => !T(w), g)];
  }
  Qe.split = m;
  function f(y, T = !1, g = [], w) {
    let E = g.slice(),
      x = y(te => {
        E ? E.push(te) : Z.fire(te);
      });
    w && w.add(x);
    let N = () => {
        E?.forEach(te => Z.fire(te)), E = null;
      },
      Z = new v({
        onWillAddFirstListener() {
          x || (x = y(te => Z.fire(te)), w && w.add(x));
        },
        onDidAddFirstListener() {
          E && (T ? setTimeout(N) : N());
        },
        onDidRemoveLastListener() {
          x && x.dispose(), x = null;
        }
      });
    return w && w.add(Z), Z.event;
  }
  Qe.buffer = f;
  function A(y, T) {
    return (w, E, x) => {
      let N = T(new O());
      return y(function (Z) {
        let te = N.evaluate(Z);
        te !== R && w.call(E, te);
      }, void 0, x);
    };
  }
  Qe.chain = A;
  let R = Symbol("HaltChainable");
  class O {
    constructor() {
      this.steps = [];
    }
    map(T) {
      return this.steps.push(T), this;
    }
    forEach(T) {
      return this.steps.push(g => (T(g), g)), this;
    }
    filter(T) {
      return this.steps.push(g => T(g) ? g : R), this;
    }
    reduce(T, g) {
      let w = g;
      return this.steps.push(E => (w = T(w, E), w)), this;
    }
    latch(T = (g, w) => g === w) {
      let g = !0,
        w;
      return this.steps.push(E => {
        let x = g || !T(E, w);
        return g = !1, w = E, x ? E : R;
      }), this;
    }
    evaluate(T) {
      for (let g of this.steps) if (T = g(T), T === R) break;
      return T;
    }
  }
  function I(y, T, g = w => w) {
    let w = (...Z) => N.fire(g(...Z)),
      E = () => y.on(T, w),
      x = () => y.removeListener(T, w),
      N = new v({
        onWillAddFirstListener: E,
        onDidRemoveLastListener: x
      });
    return N.event;
  }
  Qe.fromNodeEventEmitter = I;
  function k(y, T, g = w => w) {
    let w = (...Z) => N.fire(g(...Z)),
      E = () => y.addEventListener(T, w),
      x = () => y.removeEventListener(T, w),
      N = new v({
        onWillAddFirstListener: E,
        onDidRemoveLastListener: x
      });
    return N.event;
  }
  Qe.fromDOMEventEmitter = k;
  function P(y) {
    return new Promise(T => i(y)(T));
  }
  Qe.toPromise = P;
  function oe(y) {
    let T = new v();
    return y.then(g => {
      T.fire(g);
    }, () => {
      T.fire(void 0);
    }).finally(() => {
      T.dispose();
    }), T.event;
  }
  Qe.fromPromise = oe;
  function Me(y, T) {
    return y(g => T.fire(g));
  }
  Qe.forward = Me;
  function Pe(y, T, g) {
    return T(g), y(w => T(w));
  }
  Qe.runAndSubscribe = Pe;
  class Ke {
    constructor(T, g) {
      this._observable = T;
      this._counter = 0;
      this._hasChanged = !1;
      let w = {
        onWillAddFirstListener: () => {
          T.addObserver(this);
        },
        onDidRemoveLastListener: () => {
          T.removeObserver(this);
        }
      };
      g || t(w), this.emitter = new v(w), g && g.add(this.emitter);
    }
    beginUpdate(T) {
      this._counter++;
    }
    handlePossibleChange(T) {}
    handleChange(T, g) {
      this._hasChanged = !0;
    }
    endUpdate(T) {
      this._counter--, this._counter === 0 && (this._observable.reportChanges(), this._hasChanged && (this._hasChanged = !1, this.emitter.fire(this._observable.get())));
    }
  }
  function di(y, T) {
    return new Ke(y, T).emitter.event;
  }
  Qe.fromObservable = di;
  function V(y) {
    return (T, g, w) => {
      let E = 0,
        x = !1,
        N = {
          beginUpdate() {
            E++;
          },
          endUpdate() {
            E--, E === 0 && (y.reportChanges(), x && (x = !1, T.call(g)));
          },
          handlePossibleChange() {},
          handleChange() {
            x = !0;
          }
        };
      y.addObserver(N), y.reportChanges();
      let Z = {
        dispose() {
          y.removeObserver(N);
        }
      };
      return w instanceof Ee ? w.add(Z) : Array.isArray(w) && w.push(Z), Z;
    };
  }
  Qe.fromObservableLight = V;
})($ ||= {});
var Mt = class Mt {
  constructor(t) {
    this.listenerCount = 0;
    this.invocationCount = 0;
    this.elapsedOverall = 0;
    this.durations = [];
    this.name = `${t}_${Mt._idPool++}`, Mt.all.add(this);
  }
  start(t) {
    this._stopWatch = new mr(), this.listenerCount = t;
  }
  stop() {
    if (this._stopWatch) {
      let t = this._stopWatch.elapsed();
      this.durations.push(t), this.elapsedOverall += t, this.invocationCount += 1, this._stopWatch = void 0;
    }
  }
};
Mt.all = new Set(), Mt._idPool = 0;
var $n = Mt,
  po = -1;
var br = class br {
  constructor(t, e, i = (br._idPool++).toString(16).padStart(3, "0")) {
    this._errorHandler = t;
    this.threshold = e;
    this.name = i;
    this._warnCountdown = 0;
  }
  dispose() {
    this._stacks?.clear();
  }
  check(t, e) {
    let i = this.threshold;
    if (i <= 0 || e < i) return;
    this._stacks || (this._stacks = new Map());
    let r = this._stacks.get(t.value) || 0;
    if (this._stacks.set(t.value, r + 1), this._warnCountdown -= 1, this._warnCountdown <= 0) {
      this._warnCountdown = i * .5;
      let [n, o] = this.getMostFrequentStack(),
        l = `[${this.name}] potential listener LEAK detected, having ${e} listeners already. MOST frequent listener (${o}):`;
      console.warn(l), console.warn(n);
      let a = new qn(l, n);
      this._errorHandler(a);
    }
    return () => {
      let n = this._stacks.get(t.value) || 0;
      this._stacks.set(t.value, n - 1);
    };
  }
  getMostFrequentStack() {
    if (!this._stacks) return;
    let t,
      e = 0;
    for (let [i, r] of this._stacks) (!t || e < r) && (t = [i, r], e = r);
    return t;
  }
};
br._idPool = 1;
var Vn = br,
  gi = class s {
    constructor(t) {
      this.value = t;
    }
    static create() {
      let t = new Error();
      return new s(t.stack ?? "");
    }
    print() {
      console.warn(this.value.split(`
`).slice(2).join(`
`));
    }
  },
  qn = class extends Error {
    constructor(t, e) {
      super(t), this.name = "ListenerLeakError", this.stack = e;
    }
  },
  Yn = class extends Error {
    constructor(t, e) {
      super(t), this.name = "ListenerRefusalError", this.stack = e;
    }
  },
  Vl = 0,
  Pt = class {
    constructor(t) {
      this.value = t;
      this.id = Vl++;
    }
  },
  ql = 2,
  Yl = (s, t) => {
    if (s instanceof Pt) t(s);else for (let e = 0; e < s.length; e++) {
      let i = s[e];
      i && t(i);
    }
  },
  _r;
if (Gl) {
  let s = [];
  setInterval(() => {
    s.length !== 0 && (console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"), console.warn(s.join(`
`)), s.length = 0);
  }, 3e3), _r = new FinalizationRegistry(t => {
    typeof t == "string" && s.push(t);
  });
}
var v = class {
  constructor(t) {
    this._size = 0;
    this._options = t, this._leakageMon = po > 0 || this._options?.leakWarningThreshold ? new Vn(t?.onListenerError ?? Lt, this._options?.leakWarningThreshold ?? po) : void 0, this._perfMon = this._options?._profName ? new $n(this._options._profName) : void 0, this._deliveryQueue = this._options?.deliveryQueue;
  }
  dispose() {
    if (!this._disposed) {
      if (this._disposed = !0, this._deliveryQueue?.current === this && this._deliveryQueue.reset(), this._listeners) {
        if (fo) {
          let t = this._listeners;
          queueMicrotask(() => {
            Yl(t, e => e.stack?.print());
          });
        }
        this._listeners = void 0, this._size = 0;
      }
      this._options?.onDidRemoveLastListener?.(), this._leakageMon?.dispose();
    }
  }
  get event() {
    return this._event ??= (t, e, i) => {
      if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) {
        let a = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;
        console.warn(a);
        let u = this._leakageMon.getMostFrequentStack() ?? ["UNKNOWN stack", -1],
          h = new Yn(`${a}. HINT: Stack shows most frequent listener (${u[1]}-times)`, u[0]);
        return (this._options?.onListenerError || Lt)(h), D.None;
      }
      if (this._disposed) return D.None;
      e && (t = t.bind(e));
      let r = new Pt(t),
        n,
        o;
      this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * .2) && (r.stack = gi.create(), n = this._leakageMon.check(r.stack, this._size + 1)), fo && (r.stack = o ?? gi.create()), this._listeners ? this._listeners instanceof Pt ? (this._deliveryQueue ??= new jn(), this._listeners = [this._listeners, r]) : this._listeners.push(r) : (this._options?.onWillAddFirstListener?.(this), this._listeners = r, this._options?.onDidAddFirstListener?.(this)), this._size++;
      let l = C(() => {
        _r?.unregister(l), n?.(), this._removeListener(r);
      });
      if (i instanceof Ee ? i.add(l) : Array.isArray(i) && i.push(l), _r) {
        let a = new Error().stack.split(`
`).slice(2, 3).join(`
`).trim(),
          u = /(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);
        _r.register(l, u?.[2] ?? a, l);
      }
      return l;
    }, this._event;
  }
  _removeListener(t) {
    if (this._options?.onWillRemoveListener?.(this), !this._listeners) return;
    if (this._size === 1) {
      this._listeners = void 0, this._options?.onDidRemoveLastListener?.(this), this._size = 0;
      return;
    }
    let e = this._listeners,
      i = e.indexOf(t);
    if (i === -1) throw console.log("disposed?", this._disposed), console.log("size?", this._size), console.log("arr?", JSON.stringify(this._listeners)), new Error("Attempted to dispose unknown listener");
    this._size--, e[i] = void 0;
    let r = this._deliveryQueue.current === this;
    if (this._size * ql <= e.length) {
      let n = 0;
      for (let o = 0; o < e.length; o++) e[o] ? e[n++] = e[o] : r && (this._deliveryQueue.end--, n < this._deliveryQueue.i && this._deliveryQueue.i--);
      e.length = n;
    }
  }
  _deliver(t, e) {
    if (!t) return;
    let i = this._options?.onListenerError || Lt;
    if (!i) {
      t.value(e);
      return;
    }
    try {
      t.value(e);
    } catch (r) {
      i(r);
    }
  }
  _deliverQueue(t) {
    let e = t.current._listeners;
    for (; t.i < t.end;) this._deliver(e[t.i++], t.value);
    t.reset();
  }
  fire(t) {
    if (this._deliveryQueue?.current && (this._deliverQueue(this._deliveryQueue), this._perfMon?.stop()), this._perfMon?.start(this._size), this._listeners) if (this._listeners instanceof Pt) this._deliver(this._listeners, t);else {
      let e = this._deliveryQueue;
      e.enqueue(this, t, this._listeners.length), this._deliverQueue(e);
    }
    this._perfMon?.stop();
  }
  hasListeners() {
    return this._size > 0;
  }
};
var jn = class {
  constructor() {
    this.i = -1;
    this.end = 0;
  }
  enqueue(t, e, i) {
    this.i = 0, this.end = i, this.current = t, this.value = e;
  }
  reset() {
    this.i = this.end, this.current = void 0, this.value = void 0;
  }
};
var gr = class gr {
  constructor() {
    this.mapWindowIdToZoomLevel = new Map();
    this._onDidChangeZoomLevel = new v();
    this.onDidChangeZoomLevel = this._onDidChangeZoomLevel.event;
    this.mapWindowIdToZoomFactor = new Map();
    this._onDidChangeFullscreen = new v();
    this.onDidChangeFullscreen = this._onDidChangeFullscreen.event;
    this.mapWindowIdToFullScreen = new Map();
  }
  getZoomLevel(t) {
    return this.mapWindowIdToZoomLevel.get(this.getWindowId(t)) ?? 0;
  }
  setZoomLevel(t, e) {
    if (this.getZoomLevel(e) === t) return;
    let i = this.getWindowId(e);
    this.mapWindowIdToZoomLevel.set(i, t), this._onDidChangeZoomLevel.fire(i);
  }
  getZoomFactor(t) {
    return this.mapWindowIdToZoomFactor.get(this.getWindowId(t)) ?? 1;
  }
  setZoomFactor(t, e) {
    this.mapWindowIdToZoomFactor.set(this.getWindowId(e), t);
  }
  setFullscreen(t, e) {
    if (this.isFullscreen(e) === t) return;
    let i = this.getWindowId(e);
    this.mapWindowIdToFullScreen.set(i, t), this._onDidChangeFullscreen.fire(i);
  }
  isFullscreen(t) {
    return !!this.mapWindowIdToFullScreen.get(this.getWindowId(t));
  }
  getWindowId(t) {
    return t.vscodeWindowId;
  }
};
gr.INSTANCE = new gr();
var Si = gr;
function Xl(s, t, e) {
  typeof t == "string" && (t = s.matchMedia(t)), t.addEventListener("change", e);
}
var Eu = Si.INSTANCE.onDidChangeZoomLevel;
function mo(s) {
  return Si.INSTANCE.getZoomFactor(s);
}
var Tu = Si.INSTANCE.onDidChangeFullscreen,
  Ot = typeof navigator == "object" ? navigator.userAgent : "",
  Ei = Ot.indexOf("Firefox") >= 0,
  Bt = Ot.indexOf("AppleWebKit") >= 0,
  Ti = Ot.indexOf("Chrome") >= 0,
  Sr = !Ti && Ot.indexOf("Safari") >= 0;
var Iu = Ot.indexOf("Electron/") >= 0,
  yu = Ot.indexOf("Android") >= 0,
  vr = !1;
if (typeof fe.matchMedia == "function") {
  let s = fe.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),
    t = fe.matchMedia("(display-mode: fullscreen)");
  vr = s.matches, Xl(fe, s, ({
    matches: e
  }) => {
    vr && t.matches || (vr = e);
  });
}
function _o() {
  return vr;
}
var Nt = "en",
  yr = !1,
  xr = !1,
  Ii = !1,
  Zl = (/* unused pure expression or super */ null && (!1)),
  vo = !1,
  go = !1,
  Jl = (/* unused pure expression or super */ null && (!1)),
  Ql = (/* unused pure expression or super */ null && (!1)),
  ea = (/* unused pure expression or super */ null && (!1)),
  ta = (/* unused pure expression or super */ null && (!1)),
  Tr,
  Ir = Nt,
  bo = (/* unused pure expression or super */ null && (Nt)),
  ia,
  $e,
  Ve = globalThis,
  xe;
typeof Ve.vscode < "u" && typeof Ve.vscode.process < "u" ? xe = Ve.vscode.process : typeof process < "u" && typeof process?.versions?.node == "string" && (xe = process);
var So = typeof xe?.versions?.electron == "string",
  ra = So && xe?.type === "renderer";
if (typeof xe == "object") {
  yr = xe.platform === "win32", xr = xe.platform === "darwin", Ii = xe.platform === "linux", Zl = Ii && !!xe.env.SNAP && !!xe.env.SNAP_REVISION, Jl = So, ea = !!xe.env.CI || !!xe.env.BUILD_ARTIFACTSTAGINGDIRECTORY, Tr = Nt, Ir = Nt;
  let s = xe.env.VSCODE_NLS_CONFIG;
  if (s) try {
    let t = JSON.parse(s);
    Tr = t.userLocale, bo = t.osLocale, Ir = t.resolvedLanguage || Nt, ia = t.languagePack?.translationsConfigFile;
  } catch {}
  vo = !0;
} else typeof navigator == "object" && !ra ? ($e = navigator.userAgent, yr = $e.indexOf("Windows") >= 0, xr = $e.indexOf("Macintosh") >= 0, Ql = ($e.indexOf("Macintosh") >= 0 || $e.indexOf("iPad") >= 0 || $e.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0, Ii = $e.indexOf("Linux") >= 0, ta = $e?.indexOf("Mobi") >= 0, go = !0, Ir = globalThis._VSCODE_NLS_LANGUAGE || Nt, Tr = navigator.language.toLowerCase(), bo = Tr) : console.error("Unable to resolve platform.");
var Xn = 0;
xr ? Xn = 1 : yr ? Xn = 3 : Ii && (Xn = 2);
var wr = yr,
  Te = xr,
  Zn = Ii;
var Dr = vo;
var na = go && typeof Ve.importScripts == "function",
  xu = na ? Ve.origin : void 0;
var Fe = $e,
  st = Ir,
  sa;
(i => {
  function s() {
    return st;
  }
  i.value = s;
  function t() {
    return st.length === 2 ? st === "en" : st.length >= 3 ? st[0] === "e" && st[1] === "n" && st[2] === "-" : !1;
  }
  i.isDefaultVariant = t;
  function e() {
    return st === "en";
  }
  i.isDefault = e;
})(sa ||= {});
var oa = typeof Ve.postMessage == "function" && !Ve.importScripts,
  Eo = (() => {
    if (oa) {
      let s = [];
      Ve.addEventListener("message", e => {
        if (e.data && e.data.vscodeScheduleAsyncWork) for (let i = 0, r = s.length; i < r; i++) {
          let n = s[i];
          if (n.id === e.data.vscodeScheduleAsyncWork) {
            s.splice(i, 1), n.callback();
            return;
          }
        }
      });
      let t = 0;
      return e => {
        let i = ++t;
        s.push({
          id: i,
          callback: e
        }), Ve.postMessage({
          vscodeScheduleAsyncWork: i
        }, "*");
      };
    }
    return s => setTimeout(s);
  })();
var la = !!(Fe && Fe.indexOf("Chrome") >= 0),
  wu = !!(Fe && Fe.indexOf("Firefox") >= 0),
  Du = !!(!la && Fe && Fe.indexOf("Safari") >= 0),
  Ru = !!(Fe && Fe.indexOf("Edg/") >= 0),
  Lu = !!(Fe && Fe.indexOf("Android") >= 0);
var ot = typeof navigator == "object" ? navigator : {},
  aa = {
    clipboard: {
      writeText: Dr || document.queryCommandSupported && document.queryCommandSupported("copy") || !!(ot && ot.clipboard && ot.clipboard.writeText),
      readText: Dr || !!(ot && ot.clipboard && ot.clipboard.readText)
    },
    keyboard: Dr || _o() ? 0 : ot.keyboard || Sr ? 1 : 2,
    touch: "ontouchstart" in fe || ot.maxTouchPoints > 0,
    pointerEvents: fe.PointerEvent && ("ontouchstart" in fe || navigator.maxTouchPoints > 0)
  };
var yi = class {
    constructor() {
      this._keyCodeToStr = [], this._strToKeyCode = Object.create(null);
    }
    define(t, e) {
      this._keyCodeToStr[t] = e, this._strToKeyCode[e.toLowerCase()] = t;
    }
    keyCodeToStr(t) {
      return this._keyCodeToStr[t];
    }
    strToKeyCode(t) {
      return this._strToKeyCode[t.toLowerCase()] || 0;
    }
  },
  Jn = new yi(),
  To = new yi(),
  Io = new yi(),
  yo = new Array(230);
var Qn;
(o => {
  function s(l) {
    return Jn.keyCodeToStr(l);
  }
  o.toString = s;
  function t(l) {
    return Jn.strToKeyCode(l);
  }
  o.fromString = t;
  function e(l) {
    return To.keyCodeToStr(l);
  }
  o.toUserSettingsUS = e;
  function i(l) {
    return Io.keyCodeToStr(l);
  }
  o.toUserSettingsGeneral = i;
  function r(l) {
    return To.strToKeyCode(l) || Io.strToKeyCode(l);
  }
  o.fromUserSettings = r;
  function n(l) {
    if (l >= 98 && l <= 113) return null;
    switch (l) {
      case 16:
        return "Up";
      case 18:
        return "Down";
      case 15:
        return "Left";
      case 17:
        return "Right";
    }
    return Jn.keyCodeToStr(l);
  }
  o.toElectronAccelerator = n;
})(Qn ||= {});
var Rr = class s {
  constructor(t, e, i, r, n) {
    this.ctrlKey = t;
    this.shiftKey = e;
    this.altKey = i;
    this.metaKey = r;
    this.keyCode = n;
  }
  equals(t) {
    return t instanceof s && this.ctrlKey === t.ctrlKey && this.shiftKey === t.shiftKey && this.altKey === t.altKey && this.metaKey === t.metaKey && this.keyCode === t.keyCode;
  }
  getHashCode() {
    let t = this.ctrlKey ? "1" : "0",
      e = this.shiftKey ? "1" : "0",
      i = this.altKey ? "1" : "0",
      r = this.metaKey ? "1" : "0";
    return `K${t}${e}${i}${r}${this.keyCode}`;
  }
  isModifierKey() {
    return this.keyCode === 0 || this.keyCode === 5 || this.keyCode === 57 || this.keyCode === 6 || this.keyCode === 4;
  }
  toKeybinding() {
    return new es([this]);
  }
  isDuplicateModifierCase() {
    return this.ctrlKey && this.keyCode === 5 || this.shiftKey && this.keyCode === 4 || this.altKey && this.keyCode === 6 || this.metaKey && this.keyCode === 57;
  }
};
var es = class {
  constructor(t) {
    if (t.length === 0) throw eo("chords");
    this.chords = t;
  }
  getHashCode() {
    let t = "";
    for (let e = 0, i = this.chords.length; e < i; e++) e !== 0 && (t += ";"), t += this.chords[e].getHashCode();
    return t;
  }
  equals(t) {
    if (t === null || this.chords.length !== t.chords.length) return !1;
    for (let e = 0; e < this.chords.length; e++) if (!this.chords[e].equals(t.chords[e])) return !1;
    return !0;
  }
};
function ca(s) {
  if (s.charCode) {
    let e = String.fromCharCode(s.charCode).toUpperCase();
    return Qn.fromString(e);
  }
  let t = s.keyCode;
  if (t === 3) return 7;
  if (Ei) switch (t) {
    case 59:
      return 85;
    case 60:
      if (Zn) return 97;
      break;
    case 61:
      return 86;
    case 107:
      return 109;
    case 109:
      return 111;
    case 173:
      return 88;
    case 224:
      if (Te) return 57;
      break;
  } else if (Bt) {
    if (Te && t === 93) return 57;
    if (!Te && t === 92) return 57;
  }
  return yo[t] || 0;
}
var ua = Te ? 256 : 2048,
  ha = 512,
  da = 1024,
  fa = Te ? 2048 : 256;
var ft = class {
  constructor(t) {
    this._standardKeyboardEventBrand = !0;
    let e = t;
    this.browserEvent = e, this.target = e.target, this.ctrlKey = e.ctrlKey, this.shiftKey = e.shiftKey, this.altKey = e.altKey, this.metaKey = e.metaKey, this.altGraphKey = e.getModifierState?.("AltGraph"), this.keyCode = ca(e), this.code = e.code, this.ctrlKey = this.ctrlKey || this.keyCode === 5, this.altKey = this.altKey || this.keyCode === 6, this.shiftKey = this.shiftKey || this.keyCode === 4, this.metaKey = this.metaKey || this.keyCode === 57, this._asKeybinding = this._computeKeybinding(), this._asKeyCodeChord = this._computeKeyCodeChord();
  }
  preventDefault() {
    this.browserEvent && this.browserEvent.preventDefault && this.browserEvent.preventDefault();
  }
  stopPropagation() {
    this.browserEvent && this.browserEvent.stopPropagation && this.browserEvent.stopPropagation();
  }
  toKeyCodeChord() {
    return this._asKeyCodeChord;
  }
  equals(t) {
    return this._asKeybinding === t;
  }
  _computeKeybinding() {
    let t = 0;
    this.keyCode !== 5 && this.keyCode !== 4 && this.keyCode !== 6 && this.keyCode !== 57 && (t = this.keyCode);
    let e = 0;
    return this.ctrlKey && (e |= ua), this.altKey && (e |= ha), this.shiftKey && (e |= da), this.metaKey && (e |= fa), e |= t, e;
  }
  _computeKeyCodeChord() {
    let t = 0;
    return this.keyCode !== 5 && this.keyCode !== 4 && this.keyCode !== 6 && this.keyCode !== 57 && (t = this.keyCode), new Rr(this.ctrlKey, this.shiftKey, this.altKey, this.metaKey, t);
  }
};
var wo = new WeakMap();
function pa(s) {
  if (!s.parent || s.parent === s) return null;
  try {
    let t = s.location,
      e = s.parent.location;
    if (t.origin !== "null" && e.origin !== "null" && t.origin !== e.origin) return null;
  } catch {
    return null;
  }
  return s.parent;
}
var Lr = class {
  static getSameOriginWindowChain(t) {
    let e = wo.get(t);
    if (!e) {
      e = [], wo.set(t, e);
      let i = t,
        r;
      do r = pa(i), r ? e.push({
        window: new WeakRef(i),
        iframeElement: i.frameElement || null
      }) : e.push({
        window: new WeakRef(i),
        iframeElement: null
      }), i = r; while (i);
    }
    return e.slice(0);
  }
  static getPositionOfChildWindowRelativeToAncestorWindow(t, e) {
    if (!e || t === e) return {
      top: 0,
      left: 0
    };
    let i = 0,
      r = 0,
      n = this.getSameOriginWindowChain(t);
    for (let o of n) {
      let l = o.window.deref();
      if (i += l?.scrollY ?? 0, r += l?.scrollX ?? 0, l === e || !o.iframeElement) break;
      let a = o.iframeElement.getBoundingClientRect();
      i += a.top, r += a.left;
    }
    return {
      top: i,
      left: r
    };
  }
};
var qe = class {
  constructor(t, e) {
    this.timestamp = Date.now(), this.browserEvent = e, this.leftButton = e.button === 0, this.middleButton = e.button === 1, this.rightButton = e.button === 2, this.buttons = e.buttons, this.target = e.target, this.detail = e.detail || 1, e.type === "dblclick" && (this.detail = 2), this.ctrlKey = e.ctrlKey, this.shiftKey = e.shiftKey, this.altKey = e.altKey, this.metaKey = e.metaKey, typeof e.pageX == "number" ? (this.posx = e.pageX, this.posy = e.pageY) : (this.posx = e.clientX + this.target.ownerDocument.body.scrollLeft + this.target.ownerDocument.documentElement.scrollLeft, this.posy = e.clientY + this.target.ownerDocument.body.scrollTop + this.target.ownerDocument.documentElement.scrollTop);
    let i = Lr.getPositionOfChildWindowRelativeToAncestorWindow(t, e.view);
    this.posx -= i.left, this.posy -= i.top;
  }
  preventDefault() {
    this.browserEvent.preventDefault();
  }
  stopPropagation() {
    this.browserEvent.stopPropagation();
  }
};
var xi = class {
  constructor(t, e = 0, i = 0) {
    this.browserEvent = t || null, this.target = t ? t.target || t.targetNode || t.srcElement : null, this.deltaY = i, this.deltaX = e;
    let r = !1;
    if (Ti) {
      let n = navigator.userAgent.match(/Chrome\/(\d+)/);
      r = (n ? parseInt(n[1]) : 123) <= 122;
    }
    if (t) {
      let n = t,
        o = t,
        l = t.view?.devicePixelRatio || 1;
      if (typeof n.wheelDeltaY < "u") r ? this.deltaY = n.wheelDeltaY / (120 * l) : this.deltaY = n.wheelDeltaY / 120;else if (typeof o.VERTICAL_AXIS < "u" && o.axis === o.VERTICAL_AXIS) this.deltaY = -o.detail / 3;else if (t.type === "wheel") {
        let a = t;
        a.deltaMode === a.DOM_DELTA_LINE ? Ei && !Te ? this.deltaY = -t.deltaY / 3 : this.deltaY = -t.deltaY : this.deltaY = -t.deltaY / 40;
      }
      if (typeof n.wheelDeltaX < "u") Sr && wr ? this.deltaX = -(n.wheelDeltaX / 120) : r ? this.deltaX = n.wheelDeltaX / (120 * l) : this.deltaX = n.wheelDeltaX / 120;else if (typeof o.HORIZONTAL_AXIS < "u" && o.axis === o.HORIZONTAL_AXIS) this.deltaX = -t.detail / 3;else if (t.type === "wheel") {
        let a = t;
        a.deltaMode === a.DOM_DELTA_LINE ? Ei && !Te ? this.deltaX = -t.deltaX / 3 : this.deltaX = -t.deltaX : this.deltaX = -t.deltaX / 40;
      }
      this.deltaY === 0 && this.deltaX === 0 && t.wheelDelta && (r ? this.deltaY = t.wheelDelta / (120 * l) : this.deltaY = t.wheelDelta / 120);
    }
  }
  preventDefault() {
    this.browserEvent?.preventDefault();
  }
  stopPropagation() {
    this.browserEvent?.stopPropagation();
  }
};
var Do = Object.freeze(function (s, t) {
    let e = setTimeout(s.bind(t), 0);
    return {
      dispose() {
        clearTimeout(e);
      }
    };
  }),
  ma;
(i => {
  function s(r) {
    return r === i.None || r === i.Cancelled || r instanceof ts ? !0 : !r || typeof r != "object" ? !1 : typeof r.isCancellationRequested == "boolean" && typeof r.onCancellationRequested == "function";
  }
  i.isCancellationToken = s, i.None = Object.freeze({
    isCancellationRequested: !1,
    onCancellationRequested: $.None
  }), i.Cancelled = Object.freeze({
    isCancellationRequested: !0,
    onCancellationRequested: Do
  });
})(ma ||= {});
var ts = class {
  constructor() {
    this._isCancelled = !1;
    this._emitter = null;
  }
  cancel() {
    this._isCancelled || (this._isCancelled = !0, this._emitter && (this._emitter.fire(void 0), this.dispose()));
  }
  get isCancellationRequested() {
    return this._isCancelled;
  }
  get onCancellationRequested() {
    return this._isCancelled ? Do : (this._emitter || (this._emitter = new v()), this._emitter.event);
  }
  dispose() {
    this._emitter && (this._emitter.dispose(), this._emitter = null);
  }
};
var _a = Symbol("MicrotaskDelay");
var Ye = class {
    constructor(t, e) {
      this._isDisposed = !1;
      this._token = -1, typeof t == "function" && typeof e == "number" && this.setIfNotSet(t, e);
    }
    dispose() {
      this.cancel(), this._isDisposed = !0;
    }
    cancel() {
      this._token !== -1 && (clearTimeout(this._token), this._token = -1);
    }
    cancelAndSet(t, e) {
      if (this._isDisposed) throw new Rt("Calling 'cancelAndSet' on a disposed TimeoutTimer");
      this.cancel(), this._token = setTimeout(() => {
        this._token = -1, t();
      }, e);
    }
    setIfNotSet(t, e) {
      if (this._isDisposed) throw new Rt("Calling 'setIfNotSet' on a disposed TimeoutTimer");
      this._token === -1 && (this._token = setTimeout(() => {
        this._token = -1, t();
      }, e));
    }
  },
  kr = class {
    constructor() {
      this.disposable = void 0;
      this.isDisposed = !1;
    }
    cancel() {
      this.disposable?.dispose(), this.disposable = void 0;
    }
    cancelAndSet(t, e, i = globalThis) {
      if (this.isDisposed) throw new Rt("Calling 'cancelAndSet' on a disposed IntervalTimer");
      this.cancel();
      let r = i.setInterval(() => {
        t();
      }, e);
      this.disposable = C(() => {
        i.clearInterval(r), this.disposable = void 0;
      });
    }
    dispose() {
      this.cancel(), this.isDisposed = !0;
    }
  };
var ba, Ar;
(function () {
  typeof globalThis.requestIdleCallback != "function" || typeof globalThis.cancelIdleCallback != "function" ? Ar = (s, t) => {
    Eo(() => {
      if (e) return;
      let i = Date.now() + 15;
      t(Object.freeze({
        didTimeout: !0,
        timeRemaining() {
          return Math.max(0, i - Date.now());
        }
      }));
    });
    let e = !1;
    return {
      dispose() {
        e || (e = !0);
      }
    };
  } : Ar = (s, t, e) => {
    let i = s.requestIdleCallback(t, typeof e == "number" ? {
        timeout: e
      } : void 0),
      r = !1;
    return {
      dispose() {
        r || (r = !0, s.cancelIdleCallback(i));
      }
    };
  }, ba = s => Ar(globalThis, s);
})();
var va;
(e => {
  async function s(i) {
    let r,
      n = await Promise.all(i.map(o => o.then(l => l, l => {
        r || (r = l);
      })));
    if (typeof r < "u") throw r;
    return n;
  }
  e.settled = s;
  function t(i) {
    return new Promise(async (r, n) => {
      try {
        await i(r, n);
      } catch (o) {
        n(o);
      }
    });
  }
  e.withAsyncBody = t;
})(va ||= {});
var _e = class _e {
  static fromArray(t) {
    return new _e(e => {
      e.emitMany(t);
    });
  }
  static fromPromise(t) {
    return new _e(async e => {
      e.emitMany(await t);
    });
  }
  static fromPromises(t) {
    return new _e(async e => {
      await Promise.all(t.map(async i => e.emitOne(await i)));
    });
  }
  static merge(t) {
    return new _e(async e => {
      await Promise.all(t.map(async i => {
        for await (let r of i) e.emitOne(r);
      }));
    });
  }
  constructor(t, e) {
    this._state = 0, this._results = [], this._error = null, this._onReturn = e, this._onStateChanged = new v(), queueMicrotask(async () => {
      let i = {
        emitOne: r => this.emitOne(r),
        emitMany: r => this.emitMany(r),
        reject: r => this.reject(r)
      };
      try {
        await Promise.resolve(t(i)), this.resolve();
      } catch (r) {
        this.reject(r);
      } finally {
        i.emitOne = void 0, i.emitMany = void 0, i.reject = void 0;
      }
    });
  }
  [Symbol.asyncIterator]() {
    let t = 0;
    return {
      next: async () => {
        do {
          if (this._state === 2) throw this._error;
          if (t < this._results.length) return {
            done: !1,
            value: this._results[t++]
          };
          if (this._state === 1) return {
            done: !0,
            value: void 0
          };
          await $.toPromise(this._onStateChanged.event);
        } while (!0);
      },
      return: async () => (this._onReturn?.(), {
        done: !0,
        value: void 0
      })
    };
  }
  static map(t, e) {
    return new _e(async i => {
      for await (let r of t) i.emitOne(e(r));
    });
  }
  map(t) {
    return _e.map(this, t);
  }
  static filter(t, e) {
    return new _e(async i => {
      for await (let r of t) e(r) && i.emitOne(r);
    });
  }
  filter(t) {
    return _e.filter(this, t);
  }
  static coalesce(t) {
    return _e.filter(t, e => !!e);
  }
  coalesce() {
    return _e.coalesce(this);
  }
  static async toPromise(t) {
    let e = [];
    for await (let i of t) e.push(i);
    return e;
  }
  toPromise() {
    return _e.toPromise(this);
  }
  emitOne(t) {
    this._state === 0 && (this._results.push(t), this._onStateChanged.fire());
  }
  emitMany(t) {
    this._state === 0 && (this._results = this._results.concat(t), this._onStateChanged.fire());
  }
  resolve() {
    this._state === 0 && (this._state = 1, this._onStateChanged.fire());
  }
  reject(t) {
    this._state === 0 && (this._state = 2, this._error = t, this._onStateChanged.fire());
  }
};
_e.EMPTY = _e.fromArray([]);
var Ro = (/* unused pure expression or super */ null && (_e));
function Lo(s) {
  return 55296 <= s && s <= 56319;
}
function is(s) {
  return 56320 <= s && s <= 57343;
}
function Ao(s, t) {
  return (s - 55296 << 10) + (t - 56320) + 65536;
}
function Mo(s) {
  return ns(s, 0);
}
function ns(s, t) {
  switch (typeof s) {
    case "object":
      return s === null ? je(349, t) : Array.isArray(s) ? Ea(s, t) : Ta(s, t);
    case "string":
      return Po(s, t);
    case "boolean":
      return Sa(s, t);
    case "number":
      return je(s, t);
    case "undefined":
      return je(937, t);
    default:
      return je(617, t);
  }
}
function je(s, t) {
  return (t << 5) - t + s | 0;
}
function Sa(s, t) {
  return je(s ? 433 : 863, t);
}
function Po(s, t) {
  t = je(149417, t);
  for (let e = 0, i = s.length; e < i; e++) t = je(s.charCodeAt(e), t);
  return t;
}
function Ea(s, t) {
  return t = je(104579, t), s.reduce((e, i) => ns(i, e), t);
}
function Ta(s, t) {
  return t = je(181387, t), Object.keys(s).sort().reduce((e, i) => (e = Po(i, e), ns(s[i], e)), t);
}
function rs(s, t, e = 32) {
  let i = e - t,
    r = ~((1 << i) - 1);
  return (s << t | (r & s) >>> i) >>> 0;
}
function ko(s, t = 0, e = s.byteLength, i = 0) {
  for (let r = 0; r < e; r++) s[t + r] = i;
}
function Ia(s, t, e = "0") {
  for (; s.length < t;) s = e + s;
  return s;
}
function wi(s, t = 32) {
  return s instanceof ArrayBuffer ? Array.from(new Uint8Array(s)).map(e => e.toString(16).padStart(2, "0")).join("") : Ia((s >>> 0).toString(16), t / 4);
}
var Cr = class Cr {
  constructor() {
    this._h0 = 1732584193;
    this._h1 = 4023233417;
    this._h2 = 2562383102;
    this._h3 = 271733878;
    this._h4 = 3285377520;
    this._buff = new Uint8Array(67), this._buffDV = new DataView(this._buff.buffer), this._buffLen = 0, this._totalLen = 0, this._leftoverHighSurrogate = 0, this._finished = !1;
  }
  update(t) {
    let e = t.length;
    if (e === 0) return;
    let i = this._buff,
      r = this._buffLen,
      n = this._leftoverHighSurrogate,
      o,
      l;
    for (n !== 0 ? (o = n, l = -1, n = 0) : (o = t.charCodeAt(0), l = 0);;) {
      let a = o;
      if (Lo(o)) {
        if (l + 1 < e) {
          let u = t.charCodeAt(l + 1);
          is(u) ? (l++, a = Ao(o, u)) : a = 65533;
        } else {
          n = o;
          break;
        }
      } else is(o) && (a = 65533);
      if (r = this._push(i, r, a), l++, l < e) o = t.charCodeAt(l);else break;
    }
    this._buffLen = r, this._leftoverHighSurrogate = n;
  }
  _push(t, e, i) {
    return i < 128 ? t[e++] = i : i < 2048 ? (t[e++] = 192 | (i & 1984) >>> 6, t[e++] = 128 | (i & 63) >>> 0) : i < 65536 ? (t[e++] = 224 | (i & 61440) >>> 12, t[e++] = 128 | (i & 4032) >>> 6, t[e++] = 128 | (i & 63) >>> 0) : (t[e++] = 240 | (i & 1835008) >>> 18, t[e++] = 128 | (i & 258048) >>> 12, t[e++] = 128 | (i & 4032) >>> 6, t[e++] = 128 | (i & 63) >>> 0), e >= 64 && (this._step(), e -= 64, this._totalLen += 64, t[0] = t[64], t[1] = t[65], t[2] = t[66]), e;
  }
  digest() {
    return this._finished || (this._finished = !0, this._leftoverHighSurrogate && (this._leftoverHighSurrogate = 0, this._buffLen = this._push(this._buff, this._buffLen, 65533)), this._totalLen += this._buffLen, this._wrapUp()), wi(this._h0) + wi(this._h1) + wi(this._h2) + wi(this._h3) + wi(this._h4);
  }
  _wrapUp() {
    this._buff[this._buffLen++] = 128, ko(this._buff, this._buffLen), this._buffLen > 56 && (this._step(), ko(this._buff));
    let t = 8 * this._totalLen;
    this._buffDV.setUint32(56, Math.floor(t / 4294967296), !1), this._buffDV.setUint32(60, t % 4294967296, !1), this._step();
  }
  _step() {
    let t = Cr._bigBlock32,
      e = this._buffDV;
    for (let c = 0; c < 64; c += 4) t.setUint32(c, e.getUint32(c, !1), !1);
    for (let c = 64; c < 320; c += 4) t.setUint32(c, rs(t.getUint32(c - 12, !1) ^ t.getUint32(c - 32, !1) ^ t.getUint32(c - 56, !1) ^ t.getUint32(c - 64, !1), 1), !1);
    let i = this._h0,
      r = this._h1,
      n = this._h2,
      o = this._h3,
      l = this._h4,
      a,
      u,
      h;
    for (let c = 0; c < 80; c++) c < 20 ? (a = r & n | ~r & o, u = 1518500249) : c < 40 ? (a = r ^ n ^ o, u = 1859775393) : c < 60 ? (a = r & n | r & o | n & o, u = 2400959708) : (a = r ^ n ^ o, u = 3395469782), h = rs(i, 5) + a + l + u + t.getUint32(c * 4, !1) & 4294967295, l = o, o = n, n = rs(r, 30), r = i, i = h;
    this._h0 = this._h0 + i & 4294967295, this._h1 = this._h1 + r & 4294967295, this._h2 = this._h2 + n & 4294967295, this._h3 = this._h3 + o & 4294967295, this._h4 = this._h4 + l & 4294967295;
  }
};
Cr._bigBlock32 = new DataView(new ArrayBuffer(320));
var Co = (/* unused pure expression or super */ null && (Cr));
var {
  registerWindow: Bh,
  getWindow: be,
  getDocument: Nh,
  getWindows: Fh,
  getWindowsCount: Hh,
  getWindowId: Oo,
  getWindowById: Wh,
  hasWindow: Uh,
  onDidRegisterWindow: No,
  onWillUnregisterWindow: Kh,
  onDidUnregisterWindow: zh
} = function () {
  let s = new Map();
  fe;
  let t = {
    window: fe,
    disposables: new Ee()
  };
  s.set(fe.vscodeWindowId, t);
  let e = new v(),
    i = new v(),
    r = new v();
  function n(o, l) {
    return (typeof o == "number" ? s.get(o) : void 0) ?? (l ? t : void 0);
  }
  return {
    onDidRegisterWindow: e.event,
    onWillUnregisterWindow: r.event,
    onDidUnregisterWindow: i.event,
    registerWindow(o) {
      if (s.has(o.vscodeWindowId)) return D.None;
      let l = new Ee(),
        a = {
          window: o,
          disposables: l.add(new Ee())
        };
      return s.set(o.vscodeWindowId, a), l.add(C(() => {
        s.delete(o.vscodeWindowId), i.fire(o);
      })), l.add(L(o, Y.BEFORE_UNLOAD, () => {
        r.fire(o);
      })), e.fire(a), l;
    },
    getWindows() {
      return s.values();
    },
    getWindowsCount() {
      return s.size;
    },
    getWindowId(o) {
      return o.vscodeWindowId;
    },
    hasWindow(o) {
      return s.has(o);
    },
    getWindowById: n,
    getWindow(o) {
      let l = o;
      if (l?.ownerDocument?.defaultView) return l.ownerDocument.defaultView.window;
      let a = o;
      return a?.view ? a.view.window : fe;
    },
    getDocument(o) {
      return be(o).document;
    }
  };
}();
var ss = class {
  constructor(t, e, i, r) {
    this._node = t, this._type = e, this._handler = i, this._options = r || !1, this._node.addEventListener(this._type, this._handler, this._options);
  }
  dispose() {
    this._handler && (this._node.removeEventListener(this._type, this._handler, this._options), this._node = null, this._handler = null);
  }
};
function L(s, t, e, i) {
  return new ss(s, t, e, i);
}
function ya(s, t) {
  return function (e) {
    return t(new qe(s, e));
  };
}
function xa(s) {
  return function (t) {
    return s(new ft(t));
  };
}
var os = function (t, e, i, r) {
  let n = i;
  return e === "click" || e === "mousedown" || e === "contextmenu" ? n = ya(be(t), i) : (e === "keydown" || e === "keypress" || e === "keyup") && (n = xa(i)), L(t, e, n, r);
};
var wa, mt;
var Mr = class extends kr {
    constructor(t) {
      super(), this.defaultTarget = t && be(t);
    }
    cancelAndSet(t, e, i) {
      return super.cancelAndSet(t, e, i ?? this.defaultTarget);
    }
  },
  Di = class {
    constructor(t, e = 0) {
      this._runner = t, this.priority = e, this._canceled = !1;
    }
    dispose() {
      this._canceled = !0;
    }
    execute() {
      if (!this._canceled) try {
        this._runner();
      } catch (t) {
        Lt(t);
      }
    }
    static sort(t, e) {
      return e.priority - t.priority;
    }
  };
(function () {
  let s = new Map(),
    t = new Map(),
    e = new Map(),
    i = new Map(),
    r = n => {
      e.set(n, !1);
      let o = s.get(n) ?? [];
      for (t.set(n, o), s.set(n, []), i.set(n, !0); o.length > 0;) o.sort(Di.sort), o.shift().execute();
      i.set(n, !1);
    };
  mt = (n, o, l = 0) => {
    let a = Oo(n),
      u = new Di(o, l),
      h = s.get(a);
    return h || (h = [], s.set(a, h)), h.push(u), e.get(a) || (e.set(a, !0), n.requestAnimationFrame(() => r(a))), u;
  }, wa = (n, o, l) => {
    let a = Oo(n);
    if (i.get(a)) {
      let u = new Di(o, l),
        h = t.get(a);
      return h || (h = [], t.set(a, h)), h.push(u), u;
    } else return mt(n, o, l);
  };
})();
var pt = class pt {
  constructor(t, e) {
    this.width = t;
    this.height = e;
  }
  with(t = this.width, e = this.height) {
    return t !== this.width || e !== this.height ? new pt(t, e) : this;
  }
  static is(t) {
    return typeof t == "object" && typeof t.height == "number" && typeof t.width == "number";
  }
  static lift(t) {
    return t instanceof pt ? t : new pt(t.width, t.height);
  }
  static equals(t, e) {
    return t === e ? !0 : !t || !e ? !1 : t.width === e.width && t.height === e.height;
  }
};
pt.None = new pt(0, 0);
var Bo = (/* unused pure expression or super */ null && (pt));
function Fo(s) {
  let t = s.getBoundingClientRect(),
    e = be(s);
  return {
    left: t.left + e.scrollX,
    top: t.top + e.scrollY,
    width: t.width,
    height: t.height
  };
}
var Gh = new class {
  constructor() {
    this.mutationObservers = new Map();
  }
  observe(s, t, e) {
    let i = this.mutationObservers.get(s);
    i || (i = new Map(), this.mutationObservers.set(s, i));
    let r = Mo(e),
      n = i.get(r);
    if (n) n.users += 1;else {
      let o = new v(),
        l = new MutationObserver(u => o.fire(u));
      l.observe(s, e);
      let a = n = {
        users: 1,
        observer: l,
        onDidMutate: o.event
      };
      t.add(C(() => {
        a.users -= 1, a.users === 0 && (o.dispose(), l.disconnect(), i?.delete(r), i?.size === 0 && this.mutationObservers.delete(s));
      })), i.set(r, n);
    }
    return n.onDidMutate;
  }
}();
var Y = {
  CLICK: "click",
  AUXCLICK: "auxclick",
  DBLCLICK: "dblclick",
  MOUSE_UP: "mouseup",
  MOUSE_DOWN: "mousedown",
  MOUSE_OVER: "mouseover",
  MOUSE_MOVE: "mousemove",
  MOUSE_OUT: "mouseout",
  MOUSE_ENTER: "mouseenter",
  MOUSE_LEAVE: "mouseleave",
  MOUSE_WHEEL: "wheel",
  POINTER_UP: "pointerup",
  POINTER_DOWN: "pointerdown",
  POINTER_MOVE: "pointermove",
  POINTER_LEAVE: "pointerleave",
  CONTEXT_MENU: "contextmenu",
  WHEEL: "wheel",
  KEY_DOWN: "keydown",
  KEY_PRESS: "keypress",
  KEY_UP: "keyup",
  LOAD: "load",
  BEFORE_UNLOAD: "beforeunload",
  UNLOAD: "unload",
  PAGE_SHOW: "pageshow",
  PAGE_HIDE: "pagehide",
  PASTE: "paste",
  ABORT: "abort",
  ERROR: "error",
  RESIZE: "resize",
  SCROLL: "scroll",
  FULLSCREEN_CHANGE: "fullscreenchange",
  WK_FULLSCREEN_CHANGE: "webkitfullscreenchange",
  SELECT: "select",
  CHANGE: "change",
  SUBMIT: "submit",
  RESET: "reset",
  FOCUS: "focus",
  FOCUS_IN: "focusin",
  FOCUS_OUT: "focusout",
  BLUR: "blur",
  INPUT: "input",
  STORAGE: "storage",
  DRAG_START: "dragstart",
  DRAG: "drag",
  DRAG_ENTER: "dragenter",
  DRAG_LEAVE: "dragleave",
  DRAG_OVER: "dragover",
  DROP: "drop",
  DRAG_END: "dragend",
  ANIMATION_START: Bt ? "webkitAnimationStart" : "animationstart",
  ANIMATION_END: Bt ? "webkitAnimationEnd" : "animationend",
  ANIMATION_ITERATION: Bt ? "webkitAnimationIteration" : "animationiteration"
};
var Da = /([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;
function Ho(s, t, e, ...i) {
  let r = Da.exec(t);
  if (!r) throw new Error("Bad use of emmet");
  let n = r[1] || "div",
    o;
  return s !== "http://www.w3.org/1999/xhtml" ? o = document.createElementNS(s, n) : o = document.createElement(n), r[3] && (o.id = r[3]), r[4] && (o.className = r[4].replace(/\./g, " ").trim()), e && Object.entries(e).forEach(([l, a]) => {
    typeof a > "u" || (/^on\w+$/.test(l) ? o[l] = a : l === "selected" ? a && o.setAttribute(l, "true") : o.setAttribute(l, a));
  }), o.append(...i), o;
}
function Ra(s, t, ...e) {
  return Ho("http://www.w3.org/1999/xhtml", s, t, ...e);
}
Ra.SVG = function (s, t, ...e) {
  return Ho("http://www.w3.org/2000/svg", s, t, ...e);
};
var ls = class {
  constructor(t) {
    this.domNode = t;
    this._maxWidth = "";
    this._width = "";
    this._height = "";
    this._top = "";
    this._left = "";
    this._bottom = "";
    this._right = "";
    this._paddingTop = "";
    this._paddingLeft = "";
    this._paddingBottom = "";
    this._paddingRight = "";
    this._fontFamily = "";
    this._fontWeight = "";
    this._fontSize = "";
    this._fontStyle = "";
    this._fontFeatureSettings = "";
    this._fontVariationSettings = "";
    this._textDecoration = "";
    this._lineHeight = "";
    this._letterSpacing = "";
    this._className = "";
    this._display = "";
    this._position = "";
    this._visibility = "";
    this._color = "";
    this._backgroundColor = "";
    this._layerHint = !1;
    this._contain = "none";
    this._boxShadow = "";
  }
  setMaxWidth(t) {
    let e = Ie(t);
    this._maxWidth !== e && (this._maxWidth = e, this.domNode.style.maxWidth = this._maxWidth);
  }
  setWidth(t) {
    let e = Ie(t);
    this._width !== e && (this._width = e, this.domNode.style.width = this._width);
  }
  setHeight(t) {
    let e = Ie(t);
    this._height !== e && (this._height = e, this.domNode.style.height = this._height);
  }
  setTop(t) {
    let e = Ie(t);
    this._top !== e && (this._top = e, this.domNode.style.top = this._top);
  }
  setLeft(t) {
    let e = Ie(t);
    this._left !== e && (this._left = e, this.domNode.style.left = this._left);
  }
  setBottom(t) {
    let e = Ie(t);
    this._bottom !== e && (this._bottom = e, this.domNode.style.bottom = this._bottom);
  }
  setRight(t) {
    let e = Ie(t);
    this._right !== e && (this._right = e, this.domNode.style.right = this._right);
  }
  setPaddingTop(t) {
    let e = Ie(t);
    this._paddingTop !== e && (this._paddingTop = e, this.domNode.style.paddingTop = this._paddingTop);
  }
  setPaddingLeft(t) {
    let e = Ie(t);
    this._paddingLeft !== e && (this._paddingLeft = e, this.domNode.style.paddingLeft = this._paddingLeft);
  }
  setPaddingBottom(t) {
    let e = Ie(t);
    this._paddingBottom !== e && (this._paddingBottom = e, this.domNode.style.paddingBottom = this._paddingBottom);
  }
  setPaddingRight(t) {
    let e = Ie(t);
    this._paddingRight !== e && (this._paddingRight = e, this.domNode.style.paddingRight = this._paddingRight);
  }
  setFontFamily(t) {
    this._fontFamily !== t && (this._fontFamily = t, this.domNode.style.fontFamily = this._fontFamily);
  }
  setFontWeight(t) {
    this._fontWeight !== t && (this._fontWeight = t, this.domNode.style.fontWeight = this._fontWeight);
  }
  setFontSize(t) {
    let e = Ie(t);
    this._fontSize !== e && (this._fontSize = e, this.domNode.style.fontSize = this._fontSize);
  }
  setFontStyle(t) {
    this._fontStyle !== t && (this._fontStyle = t, this.domNode.style.fontStyle = this._fontStyle);
  }
  setFontFeatureSettings(t) {
    this._fontFeatureSettings !== t && (this._fontFeatureSettings = t, this.domNode.style.fontFeatureSettings = this._fontFeatureSettings);
  }
  setFontVariationSettings(t) {
    this._fontVariationSettings !== t && (this._fontVariationSettings = t, this.domNode.style.fontVariationSettings = this._fontVariationSettings);
  }
  setTextDecoration(t) {
    this._textDecoration !== t && (this._textDecoration = t, this.domNode.style.textDecoration = this._textDecoration);
  }
  setLineHeight(t) {
    let e = Ie(t);
    this._lineHeight !== e && (this._lineHeight = e, this.domNode.style.lineHeight = this._lineHeight);
  }
  setLetterSpacing(t) {
    let e = Ie(t);
    this._letterSpacing !== e && (this._letterSpacing = e, this.domNode.style.letterSpacing = this._letterSpacing);
  }
  setClassName(t) {
    this._className !== t && (this._className = t, this.domNode.className = this._className);
  }
  toggleClassName(t, e) {
    this.domNode.classList.toggle(t, e), this._className = this.domNode.className;
  }
  setDisplay(t) {
    this._display !== t && (this._display = t, this.domNode.style.display = this._display);
  }
  setPosition(t) {
    this._position !== t && (this._position = t, this.domNode.style.position = this._position);
  }
  setVisibility(t) {
    this._visibility !== t && (this._visibility = t, this.domNode.style.visibility = this._visibility);
  }
  setColor(t) {
    this._color !== t && (this._color = t, this.domNode.style.color = this._color);
  }
  setBackgroundColor(t) {
    this._backgroundColor !== t && (this._backgroundColor = t, this.domNode.style.backgroundColor = this._backgroundColor);
  }
  setLayerHinting(t) {
    this._layerHint !== t && (this._layerHint = t, this.domNode.style.transform = this._layerHint ? "translate3d(0px, 0px, 0px)" : "");
  }
  setBoxShadow(t) {
    this._boxShadow !== t && (this._boxShadow = t, this.domNode.style.boxShadow = t);
  }
  setContain(t) {
    this._contain !== t && (this._contain = t, this.domNode.style.contain = this._contain);
  }
  setAttribute(t, e) {
    this.domNode.setAttribute(t, e);
  }
  removeAttribute(t) {
    this.domNode.removeAttribute(t);
  }
  appendChild(t) {
    this.domNode.appendChild(t.domNode);
  }
  removeChild(t) {
    this.domNode.removeChild(t.domNode);
  }
};
function Ie(s) {
  return typeof s == "number" ? `${s}px` : s;
}
function _t(s) {
  return new ls(s);
}
var Wt = class {
  constructor() {
    this._hooks = new Ee();
    this._pointerMoveCallback = null;
    this._onStopCallback = null;
  }
  dispose() {
    this.stopMonitoring(!1), this._hooks.dispose();
  }
  stopMonitoring(t, e) {
    if (!this.isMonitoring()) return;
    this._hooks.clear(), this._pointerMoveCallback = null;
    let i = this._onStopCallback;
    this._onStopCallback = null, t && i && i(e);
  }
  isMonitoring() {
    return !!this._pointerMoveCallback;
  }
  startMonitoring(t, e, i, r, n) {
    this.isMonitoring() && this.stopMonitoring(!1), this._pointerMoveCallback = r, this._onStopCallback = n;
    let o = t;
    try {
      t.setPointerCapture(e), this._hooks.add(C(() => {
        try {
          t.releasePointerCapture(e);
        } catch {}
      }));
    } catch {
      o = be(t);
    }
    this._hooks.add(L(o, Y.POINTER_MOVE, l => {
      if (l.buttons !== i) {
        this.stopMonitoring(!0);
        return;
      }
      l.preventDefault(), this._pointerMoveCallback(l);
    })), this._hooks.add(L(o, Y.POINTER_UP, l => this.stopMonitoring(!0)));
  }
};
function Wo(s, t, e) {
  let i = null,
    r = null;
  if (typeof e.value == "function" ? (i = "value", r = e.value, r.length !== 0 && console.warn("Memoize should only be used in functions with zero parameters")) : typeof e.get == "function" && (i = "get", r = e.get), !r) throw new Error("not supported");
  let n = `$memoize$${t}`;
  e[i] = function (...o) {
    return this.hasOwnProperty(n) || Object.defineProperty(this, n, {
      configurable: !1,
      enumerable: !1,
      writable: !1,
      value: r.apply(this, o)
    }), this[n];
  };
}
var He;
(n => (n.Tap = "-xterm-gesturetap", n.Change = "-xterm-gesturechange", n.Start = "-xterm-gesturestart", n.End = "-xterm-gesturesend", n.Contextmenu = "-xterm-gesturecontextmenu"))(He ||= {});
var Q = class Q extends D {
  constructor() {
    super();
    this.dispatched = !1;
    this.targets = new Ct();
    this.ignoreTargets = new Ct();
    this.activeTouches = {}, this.handle = null, this._lastSetTapCountTime = 0, this._register($.runAndSubscribe(No, ({
      window: e,
      disposables: i
    }) => {
      i.add(L(e.document, "touchstart", r => this.onTouchStart(r), {
        passive: !1
      })), i.add(L(e.document, "touchend", r => this.onTouchEnd(e, r))), i.add(L(e.document, "touchmove", r => this.onTouchMove(r), {
        passive: !1
      }));
    }, {
      window: fe,
      disposables: this._store
    }));
  }
  static addTarget(e) {
    if (!Q.isTouchDevice()) return D.None;
    Q.INSTANCE || (Q.INSTANCE = Gn(new Q()));
    let i = Q.INSTANCE.targets.push(e);
    return C(i);
  }
  static ignoreTarget(e) {
    if (!Q.isTouchDevice()) return D.None;
    Q.INSTANCE || (Q.INSTANCE = Gn(new Q()));
    let i = Q.INSTANCE.ignoreTargets.push(e);
    return C(i);
  }
  static isTouchDevice() {
    return "ontouchstart" in fe || navigator.maxTouchPoints > 0;
  }
  dispose() {
    this.handle && (this.handle.dispose(), this.handle = null), super.dispose();
  }
  onTouchStart(e) {
    let i = Date.now();
    this.handle && (this.handle.dispose(), this.handle = null);
    for (let r = 0, n = e.targetTouches.length; r < n; r++) {
      let o = e.targetTouches.item(r);
      this.activeTouches[o.identifier] = {
        id: o.identifier,
        initialTarget: o.target,
        initialTimeStamp: i,
        initialPageX: o.pageX,
        initialPageY: o.pageY,
        rollingTimestamps: [i],
        rollingPageX: [o.pageX],
        rollingPageY: [o.pageY]
      };
      let l = this.newGestureEvent(He.Start, o.target);
      l.pageX = o.pageX, l.pageY = o.pageY, this.dispatchEvent(l);
    }
    this.dispatched && (e.preventDefault(), e.stopPropagation(), this.dispatched = !1);
  }
  onTouchEnd(e, i) {
    let r = Date.now(),
      n = Object.keys(this.activeTouches).length;
    for (let o = 0, l = i.changedTouches.length; o < l; o++) {
      let a = i.changedTouches.item(o);
      if (!this.activeTouches.hasOwnProperty(String(a.identifier))) {
        console.warn("move of an UNKNOWN touch", a);
        continue;
      }
      let u = this.activeTouches[a.identifier],
        h = Date.now() - u.initialTimeStamp;
      if (h < Q.HOLD_DELAY && Math.abs(u.initialPageX - Se(u.rollingPageX)) < 30 && Math.abs(u.initialPageY - Se(u.rollingPageY)) < 30) {
        let c = this.newGestureEvent(He.Tap, u.initialTarget);
        c.pageX = Se(u.rollingPageX), c.pageY = Se(u.rollingPageY), this.dispatchEvent(c);
      } else if (h >= Q.HOLD_DELAY && Math.abs(u.initialPageX - Se(u.rollingPageX)) < 30 && Math.abs(u.initialPageY - Se(u.rollingPageY)) < 30) {
        let c = this.newGestureEvent(He.Contextmenu, u.initialTarget);
        c.pageX = Se(u.rollingPageX), c.pageY = Se(u.rollingPageY), this.dispatchEvent(c);
      } else if (n === 1) {
        let c = Se(u.rollingPageX),
          d = Se(u.rollingPageY),
          _ = Se(u.rollingTimestamps) - u.rollingTimestamps[0],
          p = c - u.rollingPageX[0],
          m = d - u.rollingPageY[0],
          f = [...this.targets].filter(A => u.initialTarget instanceof Node && A.contains(u.initialTarget));
        this.inertia(e, f, r, Math.abs(p) / _, p > 0 ? 1 : -1, c, Math.abs(m) / _, m > 0 ? 1 : -1, d);
      }
      this.dispatchEvent(this.newGestureEvent(He.End, u.initialTarget)), delete this.activeTouches[a.identifier];
    }
    this.dispatched && (i.preventDefault(), i.stopPropagation(), this.dispatched = !1);
  }
  newGestureEvent(e, i) {
    let r = document.createEvent("CustomEvent");
    return r.initEvent(e, !1, !0), r.initialTarget = i, r.tapCount = 0, r;
  }
  dispatchEvent(e) {
    if (e.type === He.Tap) {
      let i = new Date().getTime(),
        r = 0;
      i - this._lastSetTapCountTime > Q.CLEAR_TAP_COUNT_TIME ? r = 1 : r = 2, this._lastSetTapCountTime = i, e.tapCount = r;
    } else (e.type === He.Change || e.type === He.Contextmenu) && (this._lastSetTapCountTime = 0);
    if (e.initialTarget instanceof Node) {
      for (let r of this.ignoreTargets) if (r.contains(e.initialTarget)) return;
      let i = [];
      for (let r of this.targets) if (r.contains(e.initialTarget)) {
        let n = 0,
          o = e.initialTarget;
        for (; o && o !== r;) n++, o = o.parentElement;
        i.push([n, r]);
      }
      i.sort((r, n) => r[0] - n[0]);
      for (let [r, n] of i) n.dispatchEvent(e), this.dispatched = !0;
    }
  }
  inertia(e, i, r, n, o, l, a, u, h) {
    this.handle = mt(e, () => {
      let c = Date.now(),
        d = c - r,
        _ = 0,
        p = 0,
        m = !0;
      n += Q.SCROLL_FRICTION * d, a += Q.SCROLL_FRICTION * d, n > 0 && (m = !1, _ = o * n * d), a > 0 && (m = !1, p = u * a * d);
      let f = this.newGestureEvent(He.Change);
      f.translationX = _, f.translationY = p, i.forEach(A => A.dispatchEvent(f)), m || this.inertia(e, i, c, n, o, l + _, a, u, h + p);
    });
  }
  onTouchMove(e) {
    let i = Date.now();
    for (let r = 0, n = e.changedTouches.length; r < n; r++) {
      let o = e.changedTouches.item(r);
      if (!this.activeTouches.hasOwnProperty(String(o.identifier))) {
        console.warn("end of an UNKNOWN touch", o);
        continue;
      }
      let l = this.activeTouches[o.identifier],
        a = this.newGestureEvent(He.Change, l.initialTarget);
      a.translationX = o.pageX - Se(l.rollingPageX), a.translationY = o.pageY - Se(l.rollingPageY), a.pageX = o.pageX, a.pageY = o.pageY, this.dispatchEvent(a), l.rollingPageX.length > 3 && (l.rollingPageX.shift(), l.rollingPageY.shift(), l.rollingTimestamps.shift()), l.rollingPageX.push(o.pageX), l.rollingPageY.push(o.pageY), l.rollingTimestamps.push(i);
    }
    this.dispatched && (e.preventDefault(), e.stopPropagation(), this.dispatched = !1);
  }
};
Q.SCROLL_FRICTION = -.005, Q.HOLD_DELAY = 700, Q.CLEAR_TAP_COUNT_TIME = 400, M([Wo], Q, "isTouchDevice", 1);
var Pr = Q;
var lt = class extends D {
  onclick(t, e) {
    this._register(L(t, Y.CLICK, i => e(new qe(be(t), i))));
  }
  onmousedown(t, e) {
    this._register(L(t, Y.MOUSE_DOWN, i => e(new qe(be(t), i))));
  }
  onmouseover(t, e) {
    this._register(L(t, Y.MOUSE_OVER, i => e(new qe(be(t), i))));
  }
  onmouseleave(t, e) {
    this._register(L(t, Y.MOUSE_LEAVE, i => e(new qe(be(t), i))));
  }
  onkeydown(t, e) {
    this._register(L(t, Y.KEY_DOWN, i => e(new ft(i))));
  }
  onkeyup(t, e) {
    this._register(L(t, Y.KEY_UP, i => e(new ft(i))));
  }
  oninput(t, e) {
    this._register(L(t, Y.INPUT, e));
  }
  onblur(t, e) {
    this._register(L(t, Y.BLUR, e));
  }
  onfocus(t, e) {
    this._register(L(t, Y.FOCUS, e));
  }
  onchange(t, e) {
    this._register(L(t, Y.CHANGE, e));
  }
  ignoreGesture(t) {
    return Pr.ignoreTarget(t);
  }
};
var Uo = 11,
  Or = class extends lt {
    constructor(t) {
      super(), this._onActivate = t.onActivate, this.bgDomNode = document.createElement("div"), this.bgDomNode.className = "arrow-background", this.bgDomNode.style.position = "absolute", this.bgDomNode.style.width = t.bgWidth + "px", this.bgDomNode.style.height = t.bgHeight + "px", typeof t.top < "u" && (this.bgDomNode.style.top = "0px"), typeof t.left < "u" && (this.bgDomNode.style.left = "0px"), typeof t.bottom < "u" && (this.bgDomNode.style.bottom = "0px"), typeof t.right < "u" && (this.bgDomNode.style.right = "0px"), this.domNode = document.createElement("div"), this.domNode.className = t.className, this.domNode.style.position = "absolute", this.domNode.style.width = Uo + "px", this.domNode.style.height = Uo + "px", typeof t.top < "u" && (this.domNode.style.top = t.top + "px"), typeof t.left < "u" && (this.domNode.style.left = t.left + "px"), typeof t.bottom < "u" && (this.domNode.style.bottom = t.bottom + "px"), typeof t.right < "u" && (this.domNode.style.right = t.right + "px"), this._pointerMoveMonitor = this._register(new Wt()), this._register(os(this.bgDomNode, Y.POINTER_DOWN, e => this._arrowPointerDown(e))), this._register(os(this.domNode, Y.POINTER_DOWN, e => this._arrowPointerDown(e))), this._pointerdownRepeatTimer = this._register(new Mr()), this._pointerdownScheduleRepeatTimer = this._register(new Ye());
    }
    _arrowPointerDown(t) {
      if (!t.target || !(t.target instanceof Element)) return;
      let e = () => {
        this._pointerdownRepeatTimer.cancelAndSet(() => this._onActivate(), 1e3 / 24, be(t));
      };
      this._onActivate(), this._pointerdownRepeatTimer.cancel(), this._pointerdownScheduleRepeatTimer.cancelAndSet(e, 200), this._pointerMoveMonitor.startMonitoring(t.target, t.pointerId, t.buttons, i => {}, () => {
        this._pointerdownRepeatTimer.cancel(), this._pointerdownScheduleRepeatTimer.cancel();
      }), t.preventDefault();
    }
  };
var cs = class s {
    constructor(t, e, i, r, n, o, l) {
      this._forceIntegerValues = t;
      this._scrollStateBrand = void 0;
      this._forceIntegerValues && (e = e | 0, i = i | 0, r = r | 0, n = n | 0, o = o | 0, l = l | 0), this.rawScrollLeft = r, this.rawScrollTop = l, e < 0 && (e = 0), r + e > i && (r = i - e), r < 0 && (r = 0), n < 0 && (n = 0), l + n > o && (l = o - n), l < 0 && (l = 0), this.width = e, this.scrollWidth = i, this.scrollLeft = r, this.height = n, this.scrollHeight = o, this.scrollTop = l;
    }
    equals(t) {
      return this.rawScrollLeft === t.rawScrollLeft && this.rawScrollTop === t.rawScrollTop && this.width === t.width && this.scrollWidth === t.scrollWidth && this.scrollLeft === t.scrollLeft && this.height === t.height && this.scrollHeight === t.scrollHeight && this.scrollTop === t.scrollTop;
    }
    withScrollDimensions(t, e) {
      return new s(this._forceIntegerValues, typeof t.width < "u" ? t.width : this.width, typeof t.scrollWidth < "u" ? t.scrollWidth : this.scrollWidth, e ? this.rawScrollLeft : this.scrollLeft, typeof t.height < "u" ? t.height : this.height, typeof t.scrollHeight < "u" ? t.scrollHeight : this.scrollHeight, e ? this.rawScrollTop : this.scrollTop);
    }
    withScrollPosition(t) {
      return new s(this._forceIntegerValues, this.width, this.scrollWidth, typeof t.scrollLeft < "u" ? t.scrollLeft : this.rawScrollLeft, this.height, this.scrollHeight, typeof t.scrollTop < "u" ? t.scrollTop : this.rawScrollTop);
    }
    createScrollEvent(t, e) {
      let i = this.width !== t.width,
        r = this.scrollWidth !== t.scrollWidth,
        n = this.scrollLeft !== t.scrollLeft,
        o = this.height !== t.height,
        l = this.scrollHeight !== t.scrollHeight,
        a = this.scrollTop !== t.scrollTop;
      return {
        inSmoothScrolling: e,
        oldWidth: t.width,
        oldScrollWidth: t.scrollWidth,
        oldScrollLeft: t.scrollLeft,
        width: this.width,
        scrollWidth: this.scrollWidth,
        scrollLeft: this.scrollLeft,
        oldHeight: t.height,
        oldScrollHeight: t.scrollHeight,
        oldScrollTop: t.scrollTop,
        height: this.height,
        scrollHeight: this.scrollHeight,
        scrollTop: this.scrollTop,
        widthChanged: i,
        scrollWidthChanged: r,
        scrollLeftChanged: n,
        heightChanged: o,
        scrollHeightChanged: l,
        scrollTopChanged: a
      };
    }
  },
  Ri = class extends D {
    constructor(e) {
      super();
      this._scrollableBrand = void 0;
      this._onScroll = this._register(new v());
      this.onScroll = this._onScroll.event;
      this._smoothScrollDuration = e.smoothScrollDuration, this._scheduleAtNextAnimationFrame = e.scheduleAtNextAnimationFrame, this._state = new cs(e.forceIntegerValues, 0, 0, 0, 0, 0, 0), this._smoothScrolling = null;
    }
    dispose() {
      this._smoothScrolling && (this._smoothScrolling.dispose(), this._smoothScrolling = null), super.dispose();
    }
    setSmoothScrollDuration(e) {
      this._smoothScrollDuration = e;
    }
    validateScrollPosition(e) {
      return this._state.withScrollPosition(e);
    }
    getScrollDimensions() {
      return this._state;
    }
    setScrollDimensions(e, i) {
      let r = this._state.withScrollDimensions(e, i);
      this._setState(r, !!this._smoothScrolling), this._smoothScrolling?.acceptScrollDimensions(this._state);
    }
    getFutureScrollPosition() {
      return this._smoothScrolling ? this._smoothScrolling.to : this._state;
    }
    getCurrentScrollPosition() {
      return this._state;
    }
    setScrollPositionNow(e) {
      let i = this._state.withScrollPosition(e);
      this._smoothScrolling && (this._smoothScrolling.dispose(), this._smoothScrolling = null), this._setState(i, !1);
    }
    setScrollPositionSmooth(e, i) {
      if (this._smoothScrollDuration === 0) return this.setScrollPositionNow(e);
      if (this._smoothScrolling) {
        e = {
          scrollLeft: typeof e.scrollLeft > "u" ? this._smoothScrolling.to.scrollLeft : e.scrollLeft,
          scrollTop: typeof e.scrollTop > "u" ? this._smoothScrolling.to.scrollTop : e.scrollTop
        };
        let r = this._state.withScrollPosition(e);
        if (this._smoothScrolling.to.scrollLeft === r.scrollLeft && this._smoothScrolling.to.scrollTop === r.scrollTop) return;
        let n;
        i ? n = new Nr(this._smoothScrolling.from, r, this._smoothScrolling.startTime, this._smoothScrolling.duration) : n = this._smoothScrolling.combine(this._state, r, this._smoothScrollDuration), this._smoothScrolling.dispose(), this._smoothScrolling = n;
      } else {
        let r = this._state.withScrollPosition(e);
        this._smoothScrolling = Nr.start(this._state, r, this._smoothScrollDuration);
      }
      this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {
        this._smoothScrolling && (this._smoothScrolling.animationFrameDisposable = null, this._performSmoothScrolling());
      });
    }
    hasPendingScrollAnimation() {
      return !!this._smoothScrolling;
    }
    _performSmoothScrolling() {
      if (!this._smoothScrolling) return;
      let e = this._smoothScrolling.tick(),
        i = this._state.withScrollPosition(e);
      if (this._setState(i, !0), !!this._smoothScrolling) {
        if (e.isDone) {
          this._smoothScrolling.dispose(), this._smoothScrolling = null;
          return;
        }
        this._smoothScrolling.animationFrameDisposable = this._scheduleAtNextAnimationFrame(() => {
          this._smoothScrolling && (this._smoothScrolling.animationFrameDisposable = null, this._performSmoothScrolling());
        });
      }
    }
    _setState(e, i) {
      let r = this._state;
      r.equals(e) || (this._state = e, this._onScroll.fire(this._state.createScrollEvent(r, i)));
    }
  },
  Br = class {
    constructor(t, e, i) {
      this.scrollLeft = t, this.scrollTop = e, this.isDone = i;
    }
  };
function as(s, t) {
  let e = t - s;
  return function (i) {
    return s + e * ka(i);
  };
}
function La(s, t, e) {
  return function (i) {
    return i < e ? s(i / e) : t((i - e) / (1 - e));
  };
}
var Nr = class s {
  constructor(t, e, i, r) {
    this.from = t, this.to = e, this.duration = r, this.startTime = i, this.animationFrameDisposable = null, this._initAnimations();
  }
  _initAnimations() {
    this.scrollLeft = this._initAnimation(this.from.scrollLeft, this.to.scrollLeft, this.to.width), this.scrollTop = this._initAnimation(this.from.scrollTop, this.to.scrollTop, this.to.height);
  }
  _initAnimation(t, e, i) {
    if (Math.abs(t - e) > 2.5 * i) {
      let n, o;
      return t < e ? (n = t + .75 * i, o = e - .75 * i) : (n = t - .75 * i, o = e + .75 * i), La(as(t, n), as(o, e), .33);
    }
    return as(t, e);
  }
  dispose() {
    this.animationFrameDisposable !== null && (this.animationFrameDisposable.dispose(), this.animationFrameDisposable = null);
  }
  acceptScrollDimensions(t) {
    this.to = t.withScrollPosition(this.to), this._initAnimations();
  }
  tick() {
    return this._tick(Date.now());
  }
  _tick(t) {
    let e = (t - this.startTime) / this.duration;
    if (e < 1) {
      let i = this.scrollLeft(e),
        r = this.scrollTop(e);
      return new Br(i, r, !1);
    }
    return new Br(this.to.scrollLeft, this.to.scrollTop, !0);
  }
  combine(t, e, i) {
    return s.start(t, e, i);
  }
  static start(t, e, i) {
    i = i + 10;
    let r = Date.now() - 10;
    return new s(t, e, r, i);
  }
};
function Aa(s) {
  return Math.pow(s, 3);
}
function ka(s) {
  return 1 - Aa(1 - s);
}
var Fr = class extends D {
  constructor(t, e, i) {
    super(), this._visibility = t, this._visibleClassName = e, this._invisibleClassName = i, this._domNode = null, this._isVisible = !1, this._isNeeded = !1, this._rawShouldBeVisible = !1, this._shouldBeVisible = !1, this._revealTimer = this._register(new Ye());
  }
  setVisibility(t) {
    this._visibility !== t && (this._visibility = t, this._updateShouldBeVisible());
  }
  setShouldBeVisible(t) {
    this._rawShouldBeVisible = t, this._updateShouldBeVisible();
  }
  _applyVisibilitySetting() {
    return this._visibility === 2 ? !1 : this._visibility === 3 ? !0 : this._rawShouldBeVisible;
  }
  _updateShouldBeVisible() {
    let t = this._applyVisibilitySetting();
    this._shouldBeVisible !== t && (this._shouldBeVisible = t, this.ensureVisibility());
  }
  setIsNeeded(t) {
    this._isNeeded !== t && (this._isNeeded = t, this.ensureVisibility());
  }
  setDomNode(t) {
    this._domNode = t, this._domNode.setClassName(this._invisibleClassName), this.setShouldBeVisible(!1);
  }
  ensureVisibility() {
    if (!this._isNeeded) {
      this._hide(!1);
      return;
    }
    this._shouldBeVisible ? this._reveal() : this._hide(!0);
  }
  _reveal() {
    this._isVisible || (this._isVisible = !0, this._revealTimer.setIfNotSet(() => {
      this._domNode?.setClassName(this._visibleClassName);
    }, 0));
  }
  _hide(t) {
    this._revealTimer.cancel(), this._isVisible && (this._isVisible = !1, this._domNode?.setClassName(this._invisibleClassName + (t ? " fade" : "")));
  }
};
var Ca = 140,
  Ut = class extends lt {
    constructor(t) {
      super(), this._lazyRender = t.lazyRender, this._host = t.host, this._scrollable = t.scrollable, this._scrollByPage = t.scrollByPage, this._scrollbarState = t.scrollbarState, this._visibilityController = this._register(new Fr(t.visibility, "visible scrollbar " + t.extraScrollbarClassName, "invisible scrollbar " + t.extraScrollbarClassName)), this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()), this._pointerMoveMonitor = this._register(new Wt()), this._shouldRender = !0, this.domNode = _t(document.createElement("div")), this.domNode.setAttribute("role", "presentation"), this.domNode.setAttribute("aria-hidden", "true"), this._visibilityController.setDomNode(this.domNode), this.domNode.setPosition("absolute"), this._register(L(this.domNode.domNode, Y.POINTER_DOWN, e => this._domNodePointerDown(e)));
    }
    _createArrow(t) {
      let e = this._register(new Or(t));
      this.domNode.domNode.appendChild(e.bgDomNode), this.domNode.domNode.appendChild(e.domNode);
    }
    _createSlider(t, e, i, r) {
      this.slider = _t(document.createElement("div")), this.slider.setClassName("slider"), this.slider.setPosition("absolute"), this.slider.setTop(t), this.slider.setLeft(e), typeof i == "number" && this.slider.setWidth(i), typeof r == "number" && this.slider.setHeight(r), this.slider.setLayerHinting(!0), this.slider.setContain("strict"), this.domNode.domNode.appendChild(this.slider.domNode), this._register(L(this.slider.domNode, Y.POINTER_DOWN, n => {
        n.button === 0 && (n.preventDefault(), this._sliderPointerDown(n));
      })), this.onclick(this.slider.domNode, n => {
        n.leftButton && n.stopPropagation();
      });
    }
    _onElementSize(t) {
      return this._scrollbarState.setVisibleSize(t) && (this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()), this._shouldRender = !0, this._lazyRender || this.render()), this._shouldRender;
    }
    _onElementScrollSize(t) {
      return this._scrollbarState.setScrollSize(t) && (this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()), this._shouldRender = !0, this._lazyRender || this.render()), this._shouldRender;
    }
    _onElementScrollPosition(t) {
      return this._scrollbarState.setScrollPosition(t) && (this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()), this._shouldRender = !0, this._lazyRender || this.render()), this._shouldRender;
    }
    beginReveal() {
      this._visibilityController.setShouldBeVisible(!0);
    }
    beginHide() {
      this._visibilityController.setShouldBeVisible(!1);
    }
    render() {
      this._shouldRender && (this._shouldRender = !1, this._renderDomNode(this._scrollbarState.getRectangleLargeSize(), this._scrollbarState.getRectangleSmallSize()), this._updateSlider(this._scrollbarState.getSliderSize(), this._scrollbarState.getArrowSize() + this._scrollbarState.getSliderPosition()));
    }
    _domNodePointerDown(t) {
      t.target === this.domNode.domNode && this._onPointerDown(t);
    }
    delegatePointerDown(t) {
      let e = this.domNode.domNode.getClientRects()[0].top,
        i = e + this._scrollbarState.getSliderPosition(),
        r = e + this._scrollbarState.getSliderPosition() + this._scrollbarState.getSliderSize(),
        n = this._sliderPointerPosition(t);
      i <= n && n <= r ? t.button === 0 && (t.preventDefault(), this._sliderPointerDown(t)) : this._onPointerDown(t);
    }
    _onPointerDown(t) {
      let e, i;
      if (t.target === this.domNode.domNode && typeof t.offsetX == "number" && typeof t.offsetY == "number") e = t.offsetX, i = t.offsetY;else {
        let n = Fo(this.domNode.domNode);
        e = t.pageX - n.left, i = t.pageY - n.top;
      }
      let r = this._pointerDownRelativePosition(e, i);
      this._setDesiredScrollPositionNow(this._scrollByPage ? this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r) : this._scrollbarState.getDesiredScrollPositionFromOffset(r)), t.button === 0 && (t.preventDefault(), this._sliderPointerDown(t));
    }
    _sliderPointerDown(t) {
      if (!t.target || !(t.target instanceof Element)) return;
      let e = this._sliderPointerPosition(t),
        i = this._sliderOrthogonalPointerPosition(t),
        r = this._scrollbarState.clone();
      this.slider.toggleClassName("active", !0), this._pointerMoveMonitor.startMonitoring(t.target, t.pointerId, t.buttons, n => {
        let o = this._sliderOrthogonalPointerPosition(n),
          l = Math.abs(o - i);
        if (wr && l > Ca) {
          this._setDesiredScrollPositionNow(r.getScrollPosition());
          return;
        }
        let u = this._sliderPointerPosition(n) - e;
        this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(u));
      }, () => {
        this.slider.toggleClassName("active", !1), this._host.onDragEnd();
      }), this._host.onDragStart();
    }
    _setDesiredScrollPositionNow(t) {
      let e = {};
      this.writeScrollPosition(e, t), this._scrollable.setScrollPositionNow(e);
    }
    updateScrollbarSize(t) {
      this._updateScrollbarSize(t), this._scrollbarState.setScrollbarSize(t), this._shouldRender = !0, this._lazyRender || this.render();
    }
    isNeeded() {
      return this._scrollbarState.isNeeded();
    }
  };
var Kt = class s {
  constructor(t, e, i, r, n, o) {
    this._scrollbarSize = Math.round(e), this._oppositeScrollbarSize = Math.round(i), this._arrowSize = Math.round(t), this._visibleSize = r, this._scrollSize = n, this._scrollPosition = o, this._computedAvailableSize = 0, this._computedIsNeeded = !1, this._computedSliderSize = 0, this._computedSliderRatio = 0, this._computedSliderPosition = 0, this._refreshComputedValues();
  }
  clone() {
    return new s(this._arrowSize, this._scrollbarSize, this._oppositeScrollbarSize, this._visibleSize, this._scrollSize, this._scrollPosition);
  }
  setVisibleSize(t) {
    let e = Math.round(t);
    return this._visibleSize !== e ? (this._visibleSize = e, this._refreshComputedValues(), !0) : !1;
  }
  setScrollSize(t) {
    let e = Math.round(t);
    return this._scrollSize !== e ? (this._scrollSize = e, this._refreshComputedValues(), !0) : !1;
  }
  setScrollPosition(t) {
    let e = Math.round(t);
    return this._scrollPosition !== e ? (this._scrollPosition = e, this._refreshComputedValues(), !0) : !1;
  }
  setScrollbarSize(t) {
    this._scrollbarSize = Math.round(t);
  }
  setOppositeScrollbarSize(t) {
    this._oppositeScrollbarSize = Math.round(t);
  }
  static _computeValues(t, e, i, r, n) {
    let o = Math.max(0, i - t),
      l = Math.max(0, o - 2 * e),
      a = r > 0 && r > i;
    if (!a) return {
      computedAvailableSize: Math.round(o),
      computedIsNeeded: a,
      computedSliderSize: Math.round(l),
      computedSliderRatio: 0,
      computedSliderPosition: 0
    };
    let u = Math.round(Math.max(20, Math.floor(i * l / r))),
      h = (l - u) / (r - i),
      c = n * h;
    return {
      computedAvailableSize: Math.round(o),
      computedIsNeeded: a,
      computedSliderSize: Math.round(u),
      computedSliderRatio: h,
      computedSliderPosition: Math.round(c)
    };
  }
  _refreshComputedValues() {
    let t = s._computeValues(this._oppositeScrollbarSize, this._arrowSize, this._visibleSize, this._scrollSize, this._scrollPosition);
    this._computedAvailableSize = t.computedAvailableSize, this._computedIsNeeded = t.computedIsNeeded, this._computedSliderSize = t.computedSliderSize, this._computedSliderRatio = t.computedSliderRatio, this._computedSliderPosition = t.computedSliderPosition;
  }
  getArrowSize() {
    return this._arrowSize;
  }
  getScrollPosition() {
    return this._scrollPosition;
  }
  getRectangleLargeSize() {
    return this._computedAvailableSize;
  }
  getRectangleSmallSize() {
    return this._scrollbarSize;
  }
  isNeeded() {
    return this._computedIsNeeded;
  }
  getSliderSize() {
    return this._computedSliderSize;
  }
  getSliderPosition() {
    return this._computedSliderPosition;
  }
  getDesiredScrollPositionFromOffset(t) {
    if (!this._computedIsNeeded) return 0;
    let e = t - this._arrowSize - this._computedSliderSize / 2;
    return Math.round(e / this._computedSliderRatio);
  }
  getDesiredScrollPositionFromOffsetPaged(t) {
    if (!this._computedIsNeeded) return 0;
    let e = t - this._arrowSize,
      i = this._scrollPosition;
    return e < this._computedSliderPosition ? i -= this._visibleSize : i += this._visibleSize, i;
  }
  getDesiredScrollPositionFromDelta(t) {
    if (!this._computedIsNeeded) return 0;
    let e = this._computedSliderPosition + t;
    return Math.round(e / this._computedSliderRatio);
  }
};
var Wr = class extends Ut {
  constructor(t, e, i) {
    let r = t.getScrollDimensions(),
      n = t.getCurrentScrollPosition();
    if (super({
      lazyRender: e.lazyRender,
      host: i,
      scrollbarState: new Kt(e.horizontalHasArrows ? e.arrowSize : 0, e.horizontal === 2 ? 0 : e.horizontalScrollbarSize, e.vertical === 2 ? 0 : e.verticalScrollbarSize, r.width, r.scrollWidth, n.scrollLeft),
      visibility: e.horizontal,
      extraScrollbarClassName: "horizontal",
      scrollable: t,
      scrollByPage: e.scrollByPage
    }), e.horizontalHasArrows) throw new Error("horizontalHasArrows is not supported in xterm.js");
    this._createSlider(Math.floor((e.horizontalScrollbarSize - e.horizontalSliderSize) / 2), 0, void 0, e.horizontalSliderSize);
  }
  _updateSlider(t, e) {
    this.slider.setWidth(t), this.slider.setLeft(e);
  }
  _renderDomNode(t, e) {
    this.domNode.setWidth(t), this.domNode.setHeight(e), this.domNode.setLeft(0), this.domNode.setBottom(0);
  }
  onDidScroll(t) {
    return this._shouldRender = this._onElementScrollSize(t.scrollWidth) || this._shouldRender, this._shouldRender = this._onElementScrollPosition(t.scrollLeft) || this._shouldRender, this._shouldRender = this._onElementSize(t.width) || this._shouldRender, this._shouldRender;
  }
  _pointerDownRelativePosition(t, e) {
    return t;
  }
  _sliderPointerPosition(t) {
    return t.pageX;
  }
  _sliderOrthogonalPointerPosition(t) {
    return t.pageY;
  }
  _updateScrollbarSize(t) {
    this.slider.setHeight(t);
  }
  writeScrollPosition(t, e) {
    t.scrollLeft = e;
  }
  updateOptions(t) {
    this.updateScrollbarSize(t.horizontal === 2 ? 0 : t.horizontalScrollbarSize), this._scrollbarState.setOppositeScrollbarSize(t.vertical === 2 ? 0 : t.verticalScrollbarSize), this._visibilityController.setVisibility(t.horizontal), this._scrollByPage = t.scrollByPage;
  }
};
var Ur = class extends Ut {
  constructor(t, e, i) {
    let r = t.getScrollDimensions(),
      n = t.getCurrentScrollPosition();
    if (super({
      lazyRender: e.lazyRender,
      host: i,
      scrollbarState: new Kt(e.verticalHasArrows ? e.arrowSize : 0, e.vertical === 2 ? 0 : e.verticalScrollbarSize, 0, r.height, r.scrollHeight, n.scrollTop),
      visibility: e.vertical,
      extraScrollbarClassName: "vertical",
      scrollable: t,
      scrollByPage: e.scrollByPage
    }), e.verticalHasArrows) throw new Error("horizontalHasArrows is not supported in xterm.js");
    this._createSlider(0, Math.floor((e.verticalScrollbarSize - e.verticalSliderSize) / 2), e.verticalSliderSize, void 0);
  }
  _updateSlider(t, e) {
    this.slider.setHeight(t), this.slider.setTop(e);
  }
  _renderDomNode(t, e) {
    this.domNode.setWidth(e), this.domNode.setHeight(t), this.domNode.setRight(0), this.domNode.setTop(0);
  }
  onDidScroll(t) {
    return this._shouldRender = this._onElementScrollSize(t.scrollHeight) || this._shouldRender, this._shouldRender = this._onElementScrollPosition(t.scrollTop) || this._shouldRender, this._shouldRender = this._onElementSize(t.height) || this._shouldRender, this._shouldRender;
  }
  _pointerDownRelativePosition(t, e) {
    return e;
  }
  _sliderPointerPosition(t) {
    return t.pageY;
  }
  _sliderOrthogonalPointerPosition(t) {
    return t.pageX;
  }
  _updateScrollbarSize(t) {
    this.slider.setWidth(t);
  }
  writeScrollPosition(t, e) {
    t.scrollTop = e;
  }
  updateOptions(t) {
    this.updateScrollbarSize(t.vertical === 2 ? 0 : t.verticalScrollbarSize), this._scrollbarState.setOppositeScrollbarSize(0), this._visibilityController.setVisibility(t.vertical), this._scrollByPage = t.scrollByPage;
  }
};
var Ma = 500,
  Ko = 50,
  zo = !0,
  us = class {
    constructor(t, e, i) {
      this.timestamp = t, this.deltaX = e, this.deltaY = i, this.score = 0;
    }
  },
  zr = class zr {
    constructor() {
      this._capacity = 5, this._memory = [], this._front = -1, this._rear = -1;
    }
    isPhysicalMouseWheel() {
      if (this._front === -1 && this._rear === -1) return !1;
      let t = 1,
        e = 0,
        i = 1,
        r = this._rear;
      do {
        let n = r === this._front ? t : Math.pow(2, -i);
        if (t -= n, e += this._memory[r].score * n, r === this._front) break;
        r = (this._capacity + r - 1) % this._capacity, i++;
      } while (!0);
      return e <= .5;
    }
    acceptStandardWheelEvent(t) {
      if (Ti) {
        let e = be(t.browserEvent),
          i = mo(e);
        this.accept(Date.now(), t.deltaX * i, t.deltaY * i);
      } else this.accept(Date.now(), t.deltaX, t.deltaY);
    }
    accept(t, e, i) {
      let r = null,
        n = new us(t, e, i);
      this._front === -1 && this._rear === -1 ? (this._memory[0] = n, this._front = 0, this._rear = 0) : (r = this._memory[this._rear], this._rear = (this._rear + 1) % this._capacity, this._rear === this._front && (this._front = (this._front + 1) % this._capacity), this._memory[this._rear] = n), n.score = this._computeScore(n, r);
    }
    _computeScore(t, e) {
      if (Math.abs(t.deltaX) > 0 && Math.abs(t.deltaY) > 0) return 1;
      let i = .5;
      if ((!this._isAlmostInt(t.deltaX) || !this._isAlmostInt(t.deltaY)) && (i += .25), e) {
        let r = Math.abs(t.deltaX),
          n = Math.abs(t.deltaY),
          o = Math.abs(e.deltaX),
          l = Math.abs(e.deltaY),
          a = Math.max(Math.min(r, o), 1),
          u = Math.max(Math.min(n, l), 1),
          h = Math.max(r, o),
          c = Math.max(n, l);
        h % a === 0 && c % u === 0 && (i -= .5);
      }
      return Math.min(Math.max(i, 0), 1);
    }
    _isAlmostInt(t) {
      return Math.abs(Math.round(t) - t) < .01;
    }
  };
zr.INSTANCE = new zr();
var hs = zr,
  ds = class extends lt {
    constructor(e, i, r) {
      super();
      this._onScroll = this._register(new v());
      this.onScroll = this._onScroll.event;
      this._onWillScroll = this._register(new v());
      this.onWillScroll = this._onWillScroll.event;
      this._options = Pa(i), this._scrollable = r, this._register(this._scrollable.onScroll(o => {
        this._onWillScroll.fire(o), this._onDidScroll(o), this._onScroll.fire(o);
      }));
      let n = {
        onMouseWheel: o => this._onMouseWheel(o),
        onDragStart: () => this._onDragStart(),
        onDragEnd: () => this._onDragEnd()
      };
      this._verticalScrollbar = this._register(new Ur(this._scrollable, this._options, n)), this._horizontalScrollbar = this._register(new Wr(this._scrollable, this._options, n)), this._domNode = document.createElement("div"), this._domNode.className = "xterm-scrollable-element " + this._options.className, this._domNode.setAttribute("role", "presentation"), this._domNode.style.position = "relative", this._domNode.appendChild(e), this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode), this._domNode.appendChild(this._verticalScrollbar.domNode.domNode), this._options.useShadows ? (this._leftShadowDomNode = _t(document.createElement("div")), this._leftShadowDomNode.setClassName("shadow"), this._domNode.appendChild(this._leftShadowDomNode.domNode), this._topShadowDomNode = _t(document.createElement("div")), this._topShadowDomNode.setClassName("shadow"), this._domNode.appendChild(this._topShadowDomNode.domNode), this._topLeftShadowDomNode = _t(document.createElement("div")), this._topLeftShadowDomNode.setClassName("shadow"), this._domNode.appendChild(this._topLeftShadowDomNode.domNode)) : (this._leftShadowDomNode = null, this._topShadowDomNode = null, this._topLeftShadowDomNode = null), this._listenOnDomNode = this._options.listenOnDomNode || this._domNode, this._mouseWheelToDispose = [], this._setListeningToMouseWheel(this._options.handleMouseWheel), this.onmouseover(this._listenOnDomNode, o => this._onMouseOver(o)), this.onmouseleave(this._listenOnDomNode, o => this._onMouseLeave(o)), this._hideTimeout = this._register(new Ye()), this._isDragging = !1, this._mouseIsOver = !1, this._shouldRender = !0, this._revealOnScroll = !0;
    }
    get options() {
      return this._options;
    }
    dispose() {
      this._mouseWheelToDispose = Ne(this._mouseWheelToDispose), super.dispose();
    }
    getDomNode() {
      return this._domNode;
    }
    getOverviewRulerLayoutInfo() {
      return {
        parent: this._domNode,
        insertBefore: this._verticalScrollbar.domNode.domNode
      };
    }
    delegateVerticalScrollbarPointerDown(e) {
      this._verticalScrollbar.delegatePointerDown(e);
    }
    getScrollDimensions() {
      return this._scrollable.getScrollDimensions();
    }
    setScrollDimensions(e) {
      this._scrollable.setScrollDimensions(e, !1);
    }
    updateClassName(e) {
      this._options.className = e, Te && (this._options.className += " mac"), this._domNode.className = "xterm-scrollable-element " + this._options.className;
    }
    updateOptions(e) {
      typeof e.handleMouseWheel < "u" && (this._options.handleMouseWheel = e.handleMouseWheel, this._setListeningToMouseWheel(this._options.handleMouseWheel)), typeof e.mouseWheelScrollSensitivity < "u" && (this._options.mouseWheelScrollSensitivity = e.mouseWheelScrollSensitivity), typeof e.fastScrollSensitivity < "u" && (this._options.fastScrollSensitivity = e.fastScrollSensitivity), typeof e.scrollPredominantAxis < "u" && (this._options.scrollPredominantAxis = e.scrollPredominantAxis), typeof e.horizontal < "u" && (this._options.horizontal = e.horizontal), typeof e.vertical < "u" && (this._options.vertical = e.vertical), typeof e.horizontalScrollbarSize < "u" && (this._options.horizontalScrollbarSize = e.horizontalScrollbarSize), typeof e.verticalScrollbarSize < "u" && (this._options.verticalScrollbarSize = e.verticalScrollbarSize), typeof e.scrollByPage < "u" && (this._options.scrollByPage = e.scrollByPage), this._horizontalScrollbar.updateOptions(this._options), this._verticalScrollbar.updateOptions(this._options), this._options.lazyRender || this._render();
    }
    setRevealOnScroll(e) {
      this._revealOnScroll = e;
    }
    delegateScrollFromMouseWheelEvent(e) {
      this._onMouseWheel(new xi(e));
    }
    _setListeningToMouseWheel(e) {
      if (this._mouseWheelToDispose.length > 0 !== e && (this._mouseWheelToDispose = Ne(this._mouseWheelToDispose), e)) {
        let r = n => {
          this._onMouseWheel(new xi(n));
        };
        this._mouseWheelToDispose.push(L(this._listenOnDomNode, Y.MOUSE_WHEEL, r, {
          passive: !1
        }));
      }
    }
    _onMouseWheel(e) {
      if (e.browserEvent?.defaultPrevented) return;
      let i = hs.INSTANCE;
      zo && i.acceptStandardWheelEvent(e);
      let r = !1;
      if (e.deltaY || e.deltaX) {
        let o = e.deltaY * this._options.mouseWheelScrollSensitivity,
          l = e.deltaX * this._options.mouseWheelScrollSensitivity;
        this._options.scrollPredominantAxis && (this._options.scrollYToX && l + o === 0 ? l = o = 0 : Math.abs(o) >= Math.abs(l) ? l = 0 : o = 0), this._options.flipAxes && ([o, l] = [l, o]);
        let a = !Te && e.browserEvent && e.browserEvent.shiftKey;
        (this._options.scrollYToX || a) && !l && (l = o, o = 0), e.browserEvent && e.browserEvent.altKey && (l = l * this._options.fastScrollSensitivity, o = o * this._options.fastScrollSensitivity);
        let u = this._scrollable.getFutureScrollPosition(),
          h = {};
        if (o) {
          let c = Ko * o,
            d = u.scrollTop - (c < 0 ? Math.floor(c) : Math.ceil(c));
          this._verticalScrollbar.writeScrollPosition(h, d);
        }
        if (l) {
          let c = Ko * l,
            d = u.scrollLeft - (c < 0 ? Math.floor(c) : Math.ceil(c));
          this._horizontalScrollbar.writeScrollPosition(h, d);
        }
        h = this._scrollable.validateScrollPosition(h), (u.scrollLeft !== h.scrollLeft || u.scrollTop !== h.scrollTop) && (zo && this._options.mouseWheelSmoothScroll && i.isPhysicalMouseWheel() ? this._scrollable.setScrollPositionSmooth(h) : this._scrollable.setScrollPositionNow(h), r = !0);
      }
      let n = r;
      !n && this._options.alwaysConsumeMouseWheel && (n = !0), !n && this._options.consumeMouseWheelIfScrollbarIsNeeded && (this._verticalScrollbar.isNeeded() || this._horizontalScrollbar.isNeeded()) && (n = !0), n && (e.preventDefault(), e.stopPropagation());
    }
    _onDidScroll(e) {
      this._shouldRender = this._horizontalScrollbar.onDidScroll(e) || this._shouldRender, this._shouldRender = this._verticalScrollbar.onDidScroll(e) || this._shouldRender, this._options.useShadows && (this._shouldRender = !0), this._revealOnScroll && this._reveal(), this._options.lazyRender || this._render();
    }
    renderNow() {
      if (!this._options.lazyRender) throw new Error("Please use `lazyRender` together with `renderNow`!");
      this._render();
    }
    _render() {
      if (this._shouldRender && (this._shouldRender = !1, this._horizontalScrollbar.render(), this._verticalScrollbar.render(), this._options.useShadows)) {
        let e = this._scrollable.getCurrentScrollPosition(),
          i = e.scrollTop > 0,
          r = e.scrollLeft > 0,
          n = r ? " left" : "",
          o = i ? " top" : "",
          l = r || i ? " top-left-corner" : "";
        this._leftShadowDomNode.setClassName(`shadow${n}`), this._topShadowDomNode.setClassName(`shadow${o}`), this._topLeftShadowDomNode.setClassName(`shadow${l}${o}${n}`);
      }
    }
    _onDragStart() {
      this._isDragging = !0, this._reveal();
    }
    _onDragEnd() {
      this._isDragging = !1, this._hide();
    }
    _onMouseLeave(e) {
      this._mouseIsOver = !1, this._hide();
    }
    _onMouseOver(e) {
      this._mouseIsOver = !0, this._reveal();
    }
    _reveal() {
      this._verticalScrollbar.beginReveal(), this._horizontalScrollbar.beginReveal(), this._scheduleHide();
    }
    _hide() {
      !this._mouseIsOver && !this._isDragging && (this._verticalScrollbar.beginHide(), this._horizontalScrollbar.beginHide());
    }
    _scheduleHide() {
      !this._mouseIsOver && !this._isDragging && this._hideTimeout.cancelAndSet(() => this._hide(), Ma);
    }
  };
var Kr = class extends ds {
  constructor(t, e, i) {
    super(t, e, i);
  }
  setScrollPosition(t) {
    t.reuseAnimation ? this._scrollable.setScrollPositionSmooth(t, t.reuseAnimation) : this._scrollable.setScrollPositionNow(t);
  }
  getScrollPosition() {
    return this._scrollable.getCurrentScrollPosition();
  }
};
function Pa(s) {
  let t = {
    lazyRender: typeof s.lazyRender < "u" ? s.lazyRender : !1,
    className: typeof s.className < "u" ? s.className : "",
    useShadows: typeof s.useShadows < "u" ? s.useShadows : !0,
    handleMouseWheel: typeof s.handleMouseWheel < "u" ? s.handleMouseWheel : !0,
    flipAxes: typeof s.flipAxes < "u" ? s.flipAxes : !1,
    consumeMouseWheelIfScrollbarIsNeeded: typeof s.consumeMouseWheelIfScrollbarIsNeeded < "u" ? s.consumeMouseWheelIfScrollbarIsNeeded : !1,
    alwaysConsumeMouseWheel: typeof s.alwaysConsumeMouseWheel < "u" ? s.alwaysConsumeMouseWheel : !1,
    scrollYToX: typeof s.scrollYToX < "u" ? s.scrollYToX : !1,
    mouseWheelScrollSensitivity: typeof s.mouseWheelScrollSensitivity < "u" ? s.mouseWheelScrollSensitivity : 1,
    fastScrollSensitivity: typeof s.fastScrollSensitivity < "u" ? s.fastScrollSensitivity : 5,
    scrollPredominantAxis: typeof s.scrollPredominantAxis < "u" ? s.scrollPredominantAxis : !0,
    mouseWheelSmoothScroll: typeof s.mouseWheelSmoothScroll < "u" ? s.mouseWheelSmoothScroll : !0,
    arrowSize: typeof s.arrowSize < "u" ? s.arrowSize : 11,
    listenOnDomNode: typeof s.listenOnDomNode < "u" ? s.listenOnDomNode : null,
    horizontal: typeof s.horizontal < "u" ? s.horizontal : 1,
    horizontalScrollbarSize: typeof s.horizontalScrollbarSize < "u" ? s.horizontalScrollbarSize : 10,
    horizontalSliderSize: typeof s.horizontalSliderSize < "u" ? s.horizontalSliderSize : 0,
    horizontalHasArrows: typeof s.horizontalHasArrows < "u" ? s.horizontalHasArrows : !1,
    vertical: typeof s.vertical < "u" ? s.vertical : 1,
    verticalScrollbarSize: typeof s.verticalScrollbarSize < "u" ? s.verticalScrollbarSize : 10,
    verticalHasArrows: typeof s.verticalHasArrows < "u" ? s.verticalHasArrows : !1,
    verticalSliderSize: typeof s.verticalSliderSize < "u" ? s.verticalSliderSize : 0,
    scrollByPage: typeof s.scrollByPage < "u" ? s.scrollByPage : !1
  };
  return t.horizontalSliderSize = typeof s.horizontalSliderSize < "u" ? s.horizontalSliderSize : t.horizontalScrollbarSize, t.verticalSliderSize = typeof s.verticalSliderSize < "u" ? s.verticalSliderSize : t.verticalScrollbarSize, Te && (t.className += " mac"), t;
}
var zt = class extends D {
  constructor(e, i, r, n, o, l, a, u) {
    super();
    this._bufferService = r;
    this._optionsService = a;
    this._renderService = u;
    this._onRequestScrollLines = this._register(new v());
    this.onRequestScrollLines = this._onRequestScrollLines.event;
    this._isSyncing = !1;
    this._isHandlingScroll = !1;
    this._suppressOnScrollHandler = !1;
    let h = this._register(new Ri({
      forceIntegerValues: !1,
      smoothScrollDuration: this._optionsService.rawOptions.smoothScrollDuration,
      scheduleAtNextAnimationFrame: c => mt(n.window, c)
    }));
    this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration", () => {
      h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration);
    })), this._scrollableElement = this._register(new Kr(i, {
      vertical: 1,
      horizontal: 2,
      useShadows: !1,
      mouseWheelSmoothScroll: !0,
      ...this._getChangeOptions()
    }, h)), this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity", "fastScrollSensitivity", "overviewRuler"], () => this._scrollableElement.updateOptions(this._getChangeOptions()))), this._register(o.onProtocolChange(c => {
      this._scrollableElement.updateOptions({
        handleMouseWheel: !(c & 16)
      });
    })), this._scrollableElement.setScrollDimensions({
      height: 0,
      scrollHeight: 0
    }), this._register($.runAndSubscribe(l.onChangeColors, () => {
      this._scrollableElement.getDomNode().style.backgroundColor = l.colors.background.css;
    })), e.appendChild(this._scrollableElement.getDomNode()), this._register(C(() => this._scrollableElement.getDomNode().remove())), this._styleElement = n.mainDocument.createElement("style"), i.appendChild(this._styleElement), this._register(C(() => this._styleElement.remove())), this._register($.runAndSubscribe(l.onChangeColors, () => {
      this._styleElement.textContent = [".xterm .xterm-scrollable-element > .scrollbar > .slider {", `  background: ${l.colors.scrollbarSliderBackground.css};`, "}", ".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {", `  background: ${l.colors.scrollbarSliderHoverBackground.css};`, "}", ".xterm .xterm-scrollable-element > .scrollbar > .slider.active {", `  background: ${l.colors.scrollbarSliderActiveBackground.css};`, "}"].join(`
`);
    })), this._register(this._bufferService.onResize(() => this.queueSync())), this._register(this._bufferService.buffers.onBufferActivate(() => {
      this._latestYDisp = void 0, this.queueSync();
    })), this._register(this._bufferService.onScroll(() => this._sync())), this._register(this._scrollableElement.onScroll(c => this._handleScroll(c)));
  }
  scrollLines(e) {
    let i = this._scrollableElement.getScrollPosition();
    this._scrollableElement.setScrollPosition({
      reuseAnimation: !0,
      scrollTop: i.scrollTop + e * this._renderService.dimensions.css.cell.height
    });
  }
  scrollToLine(e, i) {
    i && (this._latestYDisp = e), this._scrollableElement.setScrollPosition({
      reuseAnimation: !i,
      scrollTop: e * this._renderService.dimensions.css.cell.height
    });
  }
  _getChangeOptions() {
    return {
      mouseWheelScrollSensitivity: this._optionsService.rawOptions.scrollSensitivity,
      fastScrollSensitivity: this._optionsService.rawOptions.fastScrollSensitivity,
      verticalScrollbarSize: this._optionsService.rawOptions.overviewRuler?.width || 14
    };
  }
  queueSync(e) {
    e !== void 0 && (this._latestYDisp = e), this._queuedAnimationFrame === void 0 && (this._queuedAnimationFrame = this._renderService.addRefreshCallback(() => {
      this._queuedAnimationFrame = void 0, this._sync(this._latestYDisp);
    }));
  }
  _sync(e = this._bufferService.buffer.ydisp) {
    !this._renderService || this._isSyncing || (this._isSyncing = !0, this._suppressOnScrollHandler = !0, this._scrollableElement.setScrollDimensions({
      height: this._renderService.dimensions.css.canvas.height,
      scrollHeight: this._renderService.dimensions.css.cell.height * this._bufferService.buffer.lines.length
    }), this._suppressOnScrollHandler = !1, e !== this._latestYDisp && this._scrollableElement.setScrollPosition({
      scrollTop: e * this._renderService.dimensions.css.cell.height
    }), this._isSyncing = !1);
  }
  _handleScroll(e) {
    if (!this._renderService || this._isHandlingScroll || this._suppressOnScrollHandler) return;
    this._isHandlingScroll = !0;
    let i = Math.round(e.scrollTop / this._renderService.dimensions.css.cell.height),
      r = i - this._bufferService.buffer.ydisp;
    r !== 0 && (this._latestYDisp = i, this._onRequestScrollLines.fire(r)), this._isHandlingScroll = !1;
  }
};
zt = M([S(2, F), S(3, ae), S(4, rr), S(5, Re), S(6, H), S(7, ce)], zt);
var Gt = class extends D {
  constructor(e, i, r, n, o) {
    super();
    this._screenElement = e;
    this._bufferService = i;
    this._coreBrowserService = r;
    this._decorationService = n;
    this._renderService = o;
    this._decorationElements = new Map();
    this._altBufferIsActive = !1;
    this._dimensionsChanged = !1;
    this._container = document.createElement("div"), this._container.classList.add("xterm-decoration-container"), this._screenElement.appendChild(this._container), this._register(this._renderService.onRenderedViewportChange(() => this._doRefreshDecorations())), this._register(this._renderService.onDimensionsChange(() => {
      this._dimensionsChanged = !0, this._queueRefresh();
    })), this._register(this._coreBrowserService.onDprChange(() => this._queueRefresh())), this._register(this._bufferService.buffers.onBufferActivate(() => {
      this._altBufferIsActive = this._bufferService.buffer === this._bufferService.buffers.alt;
    })), this._register(this._decorationService.onDecorationRegistered(() => this._queueRefresh())), this._register(this._decorationService.onDecorationRemoved(l => this._removeDecoration(l))), this._register(C(() => {
      this._container.remove(), this._decorationElements.clear();
    }));
  }
  _queueRefresh() {
    this._animationFrame === void 0 && (this._animationFrame = this._renderService.addRefreshCallback(() => {
      this._doRefreshDecorations(), this._animationFrame = void 0;
    }));
  }
  _doRefreshDecorations() {
    for (let e of this._decorationService.decorations) this._renderDecoration(e);
    this._dimensionsChanged = !1;
  }
  _renderDecoration(e) {
    this._refreshStyle(e), this._dimensionsChanged && this._refreshXPosition(e);
  }
  _createElement(e) {
    let i = this._coreBrowserService.mainDocument.createElement("div");
    i.classList.add("xterm-decoration"), i.classList.toggle("xterm-decoration-top-layer", e?.options?.layer === "top"), i.style.width = `${Math.round((e.options.width || 1) * this._renderService.dimensions.css.cell.width)}px`, i.style.height = `${(e.options.height || 1) * this._renderService.dimensions.css.cell.height}px`, i.style.top = `${(e.marker.line - this._bufferService.buffers.active.ydisp) * this._renderService.dimensions.css.cell.height}px`, i.style.lineHeight = `${this._renderService.dimensions.css.cell.height}px`;
    let r = e.options.x ?? 0;
    return r && r > this._bufferService.cols && (i.style.display = "none"), this._refreshXPosition(e, i), i;
  }
  _refreshStyle(e) {
    let i = e.marker.line - this._bufferService.buffers.active.ydisp;
    if (i < 0 || i >= this._bufferService.rows) e.element && (e.element.style.display = "none", e.onRenderEmitter.fire(e.element));else {
      let r = this._decorationElements.get(e);
      r || (r = this._createElement(e), e.element = r, this._decorationElements.set(e, r), this._container.appendChild(r), e.onDispose(() => {
        this._decorationElements.delete(e), r.remove();
      })), r.style.display = this._altBufferIsActive ? "none" : "block", this._altBufferIsActive || (r.style.width = `${Math.round((e.options.width || 1) * this._renderService.dimensions.css.cell.width)}px`, r.style.height = `${(e.options.height || 1) * this._renderService.dimensions.css.cell.height}px`, r.style.top = `${i * this._renderService.dimensions.css.cell.height}px`, r.style.lineHeight = `${this._renderService.dimensions.css.cell.height}px`), e.onRenderEmitter.fire(r);
    }
  }
  _refreshXPosition(e, i = e.element) {
    if (!i) return;
    let r = e.options.x ?? 0;
    (e.options.anchor || "left") === "right" ? i.style.right = r ? `${r * this._renderService.dimensions.css.cell.width}px` : "" : i.style.left = r ? `${r * this._renderService.dimensions.css.cell.width}px` : "";
  }
  _removeDecoration(e) {
    this._decorationElements.get(e)?.remove(), this._decorationElements.delete(e), e.dispose();
  }
};
Gt = M([S(1, F), S(2, ae), S(3, Be), S(4, ce)], Gt);
var Gr = 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(t) {
    if (t.options.overviewRulerOptions) {
      for (let e of this._zones) if (e.color === t.options.overviewRulerOptions.color && e.position === t.options.overviewRulerOptions.position) {
        if (this._lineIntersectsZone(e, t.marker.line)) return;
        if (this._lineAdjacentToZone(e, t.marker.line, t.options.overviewRulerOptions.position)) {
          this._addLineToZone(e, t.marker.line);
          return;
        }
      }
      if (this._zonePoolIndex < this._zonePool.length) {
        this._zonePool[this._zonePoolIndex].color = t.options.overviewRulerOptions.color, this._zonePool[this._zonePoolIndex].position = t.options.overviewRulerOptions.position, this._zonePool[this._zonePoolIndex].startBufferLine = t.marker.line, this._zonePool[this._zonePoolIndex].endBufferLine = t.marker.line, this._zones.push(this._zonePool[this._zonePoolIndex++]);
        return;
      }
      this._zones.push({
        color: t.options.overviewRulerOptions.color,
        position: t.options.overviewRulerOptions.position,
        startBufferLine: t.marker.line,
        endBufferLine: t.marker.line
      }), this._zonePool.push(this._zones[this._zones.length - 1]), this._zonePoolIndex++;
    }
  }
  setPadding(t) {
    this._linePadding = t;
  }
  _lineIntersectsZone(t, e) {
    return e >= t.startBufferLine && e <= t.endBufferLine;
  }
  _lineAdjacentToZone(t, e, i) {
    return e >= t.startBufferLine - this._linePadding[i || "full"] && e <= t.endBufferLine + this._linePadding[i || "full"];
  }
  _addLineToZone(t, e) {
    t.startBufferLine = Math.min(t.startBufferLine, e), t.endBufferLine = Math.max(t.endBufferLine, e);
  }
};
var We = {
    full: 0,
    left: 0,
    center: 0,
    right: 0
  },
  at = {
    full: 0,
    left: 0,
    center: 0,
    right: 0
  },
  Li = {
    full: 0,
    left: 0,
    center: 0,
    right: 0
  },
  bt = class extends D {
    constructor(e, i, r, n, o, l, a, u) {
      super();
      this._viewportElement = e;
      this._screenElement = i;
      this._bufferService = r;
      this._decorationService = n;
      this._renderService = o;
      this._optionsService = l;
      this._themeService = a;
      this._coreBrowserService = u;
      this._colorZoneStore = new Gr();
      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), this._register(C(() => this._canvas?.remove()));
      let h = this._canvas.getContext("2d");
      if (h) this._ctx = h;else throw new Error("Ctx cannot be null");
      this._register(this._decorationService.onDecorationRegistered(() => this._queueRefresh(void 0, !0))), this._register(this._decorationService.onDecorationRemoved(() => this._queueRefresh(void 0, !0))), this._register(this._renderService.onRenderedViewportChange(() => this._queueRefresh())), this._register(this._bufferService.buffers.onBufferActivate(() => {
        this._canvas.style.display = this._bufferService.buffer === this._bufferService.buffers.alt ? "none" : "block";
      })), this._register(this._bufferService.onScroll(() => {
        this._lastKnownBufferLength !== this._bufferService.buffers.normal.lines.length && (this._refreshDrawHeightConstants(), this._refreshColorZonePadding());
      })), this._register(this._renderService.onRender(() => {
        (!this._containerHeight || this._containerHeight !== this._screenElement.clientHeight) && (this._queueRefresh(!0), this._containerHeight = this._screenElement.clientHeight);
      })), this._register(this._coreBrowserService.onDprChange(() => this._queueRefresh(!0))), this._register(this._optionsService.onSpecificOptionChange("overviewRuler", () => this._queueRefresh(!0))), this._register(this._themeService.onChangeColors(() => this._queueRefresh())), this._queueRefresh(!0);
    }
    get _width() {
      return this._optionsService.options.overviewRuler?.width || 0;
    }
    _refreshDrawConstants() {
      let e = Math.floor((this._canvas.width - 1) / 3),
        i = Math.ceil((this._canvas.width - 1) / 3);
      at.full = this._canvas.width, at.left = e, at.center = i, at.right = e, this._refreshDrawHeightConstants(), Li.full = 1, Li.left = 1, Li.center = 1 + at.left, Li.right = 1 + at.left + at.center;
    }
    _refreshDrawHeightConstants() {
      We.full = Math.round(2 * this._coreBrowserService.dpr);
      let e = this._canvas.height / this._bufferService.buffer.lines.length,
        i = Math.round(Math.max(Math.min(e, 12), 6) * this._coreBrowserService.dpr);
      We.left = i, We.center = i, We.right = i;
    }
    _refreshColorZonePadding() {
      this._colorZoneStore.setPadding({
        full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * We.full),
        left: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * We.left),
        center: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * We.center),
        right: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * We.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 i of this._decorationService.decorations) this._colorZoneStore.addDecoration(i);
      this._ctx.lineWidth = 1, this._renderRulerOutline();
      let e = this._colorZoneStore.zones;
      for (let i of e) i.position !== "full" && this._renderColorZone(i);
      for (let i of e) i.position === "full" && this._renderColorZone(i);
      this._shouldUpdateDimensions = !1, this._shouldUpdateAnchor = !1;
    }
    _renderRulerOutline() {
      this._ctx.fillStyle = this._themeService.colors.overviewRulerBorder.css, this._ctx.fillRect(0, 0, 1, this._canvas.height), this._optionsService.rawOptions.overviewRuler.showTopBorder && this._ctx.fillRect(1, 0, this._canvas.width - 1, 1), this._optionsService.rawOptions.overviewRuler.showBottomBorder && this._ctx.fillRect(1, this._canvas.height - 1, this._canvas.width - 1, this._canvas.height);
    }
    _renderColorZone(e) {
      this._ctx.fillStyle = e.color, this._ctx.fillRect(Li[e.position || "full"], Math.round((this._canvas.height - 1) * (e.startBufferLine / this._bufferService.buffers.active.lines.length) - We[e.position || "full"] / 2), at[e.position || "full"], Math.round((this._canvas.height - 1) * ((e.endBufferLine - e.startBufferLine) / this._bufferService.buffers.active.lines.length) + We[e.position || "full"]));
    }
    _queueRefresh(e, i) {
      this._shouldUpdateDimensions = e || this._shouldUpdateDimensions, this._shouldUpdateAnchor = i || this._shouldUpdateAnchor, this._animationFrame === void 0 && (this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {
        this._refreshDecorations(), this._animationFrame = void 0;
      }));
    }
  };
bt = M([S(2, F), S(3, Be), S(4, ce), S(5, H), S(6, Re), S(7, ae)], bt);
var b;
(E => (E.NUL = "\0", E.SOH = "", E.STX = "", E.ETX = "", E.EOT = "", E.ENQ = "", E.ACK = "", E.BEL = "\x07", E.BS = "\b", E.HT = "	", E.LF = `
`, E.VT = "\v", E.FF = "\f", E.CR = "\r", E.SO = "", E.SI = "", E.DLE = "", E.DC1 = "", E.DC2 = "", E.DC3 = "", E.DC4 = "", E.NAK = "", E.SYN = "", E.ETB = "", E.CAN = "", E.EM = "", E.SUB = "", E.ESC = "\x1B", E.FS = "", E.GS = "", E.RS = "", E.US = "", E.SP = " ", E.DEL = "\x7F"))(b ||= {});
var Ai;
(g => (g.PAD = "\x80", g.HOP = "\x81", g.BPH = "\x82", g.NBH = "\x83", g.IND = "\x84", g.NEL = "\x85", g.SSA = "\x86", g.ESA = "\x87", g.HTS = "\x88", g.HTJ = "\x89", g.VTS = "\x8A", g.PLD = "\x8B", g.PLU = "\x8C", g.RI = "\x8D", g.SS2 = "\x8E", g.SS3 = "\x8F", g.DCS = "\x90", g.PU1 = "\x91", g.PU2 = "\x92", g.STS = "\x93", g.CCH = "\x94", g.MW = "\x95", g.SPA = "\x96", g.EPA = "\x97", g.SOS = "\x98", g.SGCI = "\x99", g.SCI = "\x9A", g.CSI = "\x9B", g.ST = "\x9C", g.OSC = "\x9D", g.PM = "\x9E", g.APC = "\x9F"))(Ai ||= {});
var fs;
(t => t.ST = `${b.ESC}\\`)(fs ||= {});
var $t = class {
  constructor(t, e, i, r, n, o) {
    this._textarea = t;
    this._compositionView = e;
    this._bufferService = i;
    this._optionsService = r;
    this._coreService = n;
    this._renderService = o;
    this._isComposing = !1, this._isSendingComposition = !1, this._compositionPosition = {
      start: 0,
      end: 0
    }, this._dataAlreadySent = "";
  }
  get isComposing() {
    return this._isComposing;
  }
  compositionstart() {
    this._isComposing = !0, this._compositionPosition.start = this._textarea.value.length, this._compositionView.textContent = "", this._dataAlreadySent = "", this._compositionView.classList.add("active");
  }
  compositionupdate(t) {
    this._compositionView.textContent = t.data, this.updateCompositionElements(), setTimeout(() => {
      this._compositionPosition.end = this._textarea.value.length;
    }, 0);
  }
  compositionend() {
    this._finalizeComposition(!0);
  }
  keydown(t) {
    if (this._isComposing || this._isSendingComposition) {
      if (t.keyCode === 20 || t.keyCode === 229 || t.keyCode === 16 || t.keyCode === 17 || t.keyCode === 18) return !1;
      this._finalizeComposition(!1);
    }
    return t.keyCode === 229 ? (this._handleAnyTextareaChanges(), !1) : !0;
  }
  _finalizeComposition(t) {
    if (this._compositionView.classList.remove("active"), this._isComposing = !1, t) {
      let e = {
        start: this._compositionPosition.start,
        end: this._compositionPosition.end
      };
      this._isSendingComposition = !0, setTimeout(() => {
        if (this._isSendingComposition) {
          this._isSendingComposition = !1;
          let i;
          e.start += this._dataAlreadySent.length, this._isComposing ? i = this._textarea.value.substring(e.start, this._compositionPosition.start) : i = this._textarea.value.substring(e.start), i.length > 0 && this._coreService.triggerDataEvent(i, !0);
        }
      }, 0);
    } else {
      this._isSendingComposition = !1;
      let e = this._textarea.value.substring(this._compositionPosition.start, this._compositionPosition.end);
      this._coreService.triggerDataEvent(e, !0);
    }
  }
  _handleAnyTextareaChanges() {
    let t = this._textarea.value;
    setTimeout(() => {
      if (!this._isComposing) {
        let e = this._textarea.value,
          i = e.replace(t, "");
        this._dataAlreadySent = i, e.length > t.length ? this._coreService.triggerDataEvent(i, !0) : e.length < t.length ? this._coreService.triggerDataEvent(`${b.DEL}`, !0) : e.length === t.length && e !== t && this._coreService.triggerDataEvent(e, !0);
      }
    }, 0);
  }
  updateCompositionElements(t) {
    if (this._isComposing) {
      if (this._bufferService.buffer.isCursorInViewport) {
        let e = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1),
          i = this._renderService.dimensions.css.cell.height,
          r = this._bufferService.buffer.y * this._renderService.dimensions.css.cell.height,
          n = e * this._renderService.dimensions.css.cell.width;
        this._compositionView.style.left = n + "px", this._compositionView.style.top = r + "px", this._compositionView.style.height = i + "px", this._compositionView.style.lineHeight = i + "px", this._compositionView.style.fontFamily = this._optionsService.rawOptions.fontFamily, this._compositionView.style.fontSize = this._optionsService.rawOptions.fontSize + "px";
        let o = this._compositionView.getBoundingClientRect();
        this._textarea.style.left = n + "px", this._textarea.style.top = r + "px", this._textarea.style.width = Math.max(o.width, 1) + "px", this._textarea.style.height = Math.max(o.height, 1) + "px", this._textarea.style.lineHeight = o.height + "px";
      }
      t || setTimeout(() => this.updateCompositionElements(!0), 0);
    }
  }
};
$t = M([S(2, F), S(3, H), S(4, ge), S(5, ce)], $t);
var ue = 0,
  he = 0,
  de = 0,
  J = 0,
  ps = {
    css: "#00000000",
    rgba: 0
  },
  j;
(i => {
  function s(r, n, o, l) {
    return l !== void 0 ? `#${vt(r)}${vt(n)}${vt(o)}${vt(l)}` : `#${vt(r)}${vt(n)}${vt(o)}`;
  }
  i.toCss = s;
  function t(r, n, o, l = 255) {
    return (r << 24 | n << 16 | o << 8 | l) >>> 0;
  }
  i.toRgba = t;
  function e(r, n, o, l) {
    return {
      css: i.toCss(r, n, o, l),
      rgba: i.toRgba(r, n, o, l)
    };
  }
  i.toColor = e;
})(j ||= {});
var U;
(l => {
  function s(a, u) {
    if (J = (u.rgba & 255) / 255, J === 1) return {
      css: u.css,
      rgba: u.rgba
    };
    let h = u.rgba >> 24 & 255,
      c = u.rgba >> 16 & 255,
      d = u.rgba >> 8 & 255,
      _ = a.rgba >> 24 & 255,
      p = a.rgba >> 16 & 255,
      m = a.rgba >> 8 & 255;
    ue = _ + Math.round((h - _) * J), he = p + Math.round((c - p) * J), de = m + Math.round((d - m) * J);
    let f = j.toCss(ue, he, de),
      A = j.toRgba(ue, he, de);
    return {
      css: f,
      rgba: A
    };
  }
  l.blend = s;
  function t(a) {
    return (a.rgba & 255) === 255;
  }
  l.isOpaque = t;
  function e(a, u, h) {
    let c = $r.ensureContrastRatio(a.rgba, u.rgba, h);
    if (c) return j.toColor(c >> 24 & 255, c >> 16 & 255, c >> 8 & 255);
  }
  l.ensureContrastRatio = e;
  function i(a) {
    let u = (a.rgba | 255) >>> 0;
    return [ue, he, de] = $r.toChannels(u), {
      css: j.toCss(ue, he, de),
      rgba: u
    };
  }
  l.opaque = i;
  function r(a, u) {
    return J = Math.round(u * 255), [ue, he, de] = $r.toChannels(a.rgba), {
      css: j.toCss(ue, he, de, J),
      rgba: j.toRgba(ue, he, de, J)
    };
  }
  l.opacity = r;
  function n(a, u) {
    return J = a.rgba & 255, r(a, J * u / 255);
  }
  l.multiplyOpacity = n;
  function o(a) {
    return [a.rgba >> 24 & 255, a.rgba >> 16 & 255, a.rgba >> 8 & 255];
  }
  l.toColorRGB = o;
})(U ||= {});
var z;
(i => {
  let s, t;
  try {
    let r = document.createElement("canvas");
    r.width = 1, r.height = 1;
    let n = r.getContext("2d", {
      willReadFrequently: !0
    });
    n && (s = n, s.globalCompositeOperation = "copy", t = s.createLinearGradient(0, 0, 1, 1));
  } catch {}
  function e(r) {
    if (r.match(/#[\da-f]{3,8}/i)) switch (r.length) {
      case 4:
        return ue = parseInt(r.slice(1, 2).repeat(2), 16), he = parseInt(r.slice(2, 3).repeat(2), 16), de = parseInt(r.slice(3, 4).repeat(2), 16), j.toColor(ue, he, de);
      case 5:
        return ue = parseInt(r.slice(1, 2).repeat(2), 16), he = parseInt(r.slice(2, 3).repeat(2), 16), de = parseInt(r.slice(3, 4).repeat(2), 16), J = parseInt(r.slice(4, 5).repeat(2), 16), j.toColor(ue, he, de, J);
      case 7:
        return {
          css: r,
          rgba: (parseInt(r.slice(1), 16) << 8 | 255) >>> 0
        };
      case 9:
        return {
          css: r,
          rgba: parseInt(r.slice(1), 16) >>> 0
        };
    }
    let n = r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);
    if (n) return ue = parseInt(n[1]), he = parseInt(n[2]), de = parseInt(n[3]), J = Math.round((n[5] === void 0 ? 1 : parseFloat(n[5])) * 255), j.toColor(ue, he, de, J);
    if (!s || !t) throw new Error("css.toColor: Unsupported css format");
    if (s.fillStyle = t, s.fillStyle = r, typeof s.fillStyle != "string") throw new Error("css.toColor: Unsupported css format");
    if (s.fillRect(0, 0, 1, 1), [ue, he, de, J] = s.getImageData(0, 0, 1, 1).data, J !== 255) throw new Error("css.toColor: Unsupported css format");
    return {
      rgba: j.toRgba(ue, he, de, J),
      css: r
    };
  }
  i.toColor = e;
})(z ||= {});
var ve;
(e => {
  function s(i) {
    return t(i >> 16 & 255, i >> 8 & 255, i & 255);
  }
  e.relativeLuminance = s;
  function t(i, r, n) {
    let o = i / 255,
      l = r / 255,
      a = n / 255,
      u = o <= .03928 ? o / 12.92 : Math.pow((o + .055) / 1.055, 2.4),
      h = l <= .03928 ? l / 12.92 : Math.pow((l + .055) / 1.055, 2.4),
      c = a <= .03928 ? a / 12.92 : Math.pow((a + .055) / 1.055, 2.4);
    return u * .2126 + h * .7152 + c * .0722;
  }
  e.relativeLuminance2 = t;
})(ve ||= {});
var $r;
(n => {
  function s(o, l) {
    if (J = (l & 255) / 255, J === 1) return l;
    let a = l >> 24 & 255,
      u = l >> 16 & 255,
      h = l >> 8 & 255,
      c = o >> 24 & 255,
      d = o >> 16 & 255,
      _ = o >> 8 & 255;
    return ue = c + Math.round((a - c) * J), he = d + Math.round((u - d) * J), de = _ + Math.round((h - _) * J), j.toRgba(ue, he, de);
  }
  n.blend = s;
  function t(o, l, a) {
    let u = ve.relativeLuminance(o >> 8),
      h = ve.relativeLuminance(l >> 8);
    if (Xe(u, h) < a) {
      if (h < u) {
        let p = e(o, l, a),
          m = Xe(u, ve.relativeLuminance(p >> 8));
        if (m < a) {
          let f = i(o, l, a),
            A = Xe(u, ve.relativeLuminance(f >> 8));
          return m > A ? p : f;
        }
        return p;
      }
      let d = i(o, l, a),
        _ = Xe(u, ve.relativeLuminance(d >> 8));
      if (_ < a) {
        let p = e(o, l, a),
          m = Xe(u, ve.relativeLuminance(p >> 8));
        return _ > m ? d : p;
      }
      return d;
    }
  }
  n.ensureContrastRatio = t;
  function e(o, l, a) {
    let u = o >> 24 & 255,
      h = o >> 16 & 255,
      c = o >> 8 & 255,
      d = l >> 24 & 255,
      _ = l >> 16 & 255,
      p = l >> 8 & 255,
      m = Xe(ve.relativeLuminance2(d, _, p), ve.relativeLuminance2(u, h, c));
    for (; m < a && (d > 0 || _ > 0 || p > 0);) d -= Math.max(0, Math.ceil(d * .1)), _ -= Math.max(0, Math.ceil(_ * .1)), p -= Math.max(0, Math.ceil(p * .1)), m = Xe(ve.relativeLuminance2(d, _, p), ve.relativeLuminance2(u, h, c));
    return (d << 24 | _ << 16 | p << 8 | 255) >>> 0;
  }
  n.reduceLuminance = e;
  function i(o, l, a) {
    let u = o >> 24 & 255,
      h = o >> 16 & 255,
      c = o >> 8 & 255,
      d = l >> 24 & 255,
      _ = l >> 16 & 255,
      p = l >> 8 & 255,
      m = Xe(ve.relativeLuminance2(d, _, p), ve.relativeLuminance2(u, h, c));
    for (; m < a && (d < 255 || _ < 255 || p < 255);) d = Math.min(255, d + Math.ceil((255 - d) * .1)), _ = Math.min(255, _ + Math.ceil((255 - _) * .1)), p = Math.min(255, p + Math.ceil((255 - p) * .1)), m = Xe(ve.relativeLuminance2(d, _, p), ve.relativeLuminance2(u, h, c));
    return (d << 24 | _ << 16 | p << 8 | 255) >>> 0;
  }
  n.increaseLuminance = i;
  function r(o) {
    return [o >> 24 & 255, o >> 16 & 255, o >> 8 & 255, o & 255];
  }
  n.toChannels = r;
})($r ||= {});
function vt(s) {
  let t = s.toString(16);
  return t.length < 2 ? "0" + t : t;
}
function Xe(s, t) {
  return s < t ? (t + .05) / (s + .05) : (s + .05) / (t + .05);
}
var Vr = class extends De {
    constructor(e, i, r) {
      super();
      this.content = 0;
      this.combinedData = "";
      this.fg = e.fg, this.bg = e.bg, this.combinedData = i, this._width = r;
    }
    isCombined() {
      return 2097152;
    }
    getWidth() {
      return this._width;
    }
    getChars() {
      return this.combinedData;
    }
    getCode() {
      return 2097151;
    }
    setFromCharData(e) {
      throw new Error("not implemented");
    }
    getAsCharData() {
      return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
    }
  },
  ct = class {
    constructor(t) {
      this._bufferService = t;
      this._characterJoiners = [];
      this._nextCharacterJoinerId = 0;
      this._workCell = new q();
    }
    register(t) {
      let e = {
        id: this._nextCharacterJoinerId++,
        handler: t
      };
      return this._characterJoiners.push(e), e.id;
    }
    deregister(t) {
      for (let e = 0; e < this._characterJoiners.length; e++) if (this._characterJoiners[e].id === t) return this._characterJoiners.splice(e, 1), !0;
      return !1;
    }
    getJoinedCharacters(t) {
      if (this._characterJoiners.length === 0) return [];
      let e = this._bufferService.buffer.lines.get(t);
      if (!e || e.length === 0) return [];
      let i = [],
        r = e.translateToString(!0),
        n = 0,
        o = 0,
        l = 0,
        a = e.getFg(0),
        u = e.getBg(0);
      for (let h = 0; h < e.getTrimmedLength(); h++) if (e.loadCell(h, this._workCell), this._workCell.getWidth() !== 0) {
        if (this._workCell.fg !== a || this._workCell.bg !== u) {
          if (h - n > 1) {
            let c = this._getJoinedRanges(r, l, o, e, n);
            for (let d = 0; d < c.length; d++) i.push(c[d]);
          }
          n = h, l = o, a = this._workCell.fg, u = this._workCell.bg;
        }
        o += this._workCell.getChars().length || we.length;
      }
      if (this._bufferService.cols - n > 1) {
        let h = this._getJoinedRanges(r, l, o, e, n);
        for (let c = 0; c < h.length; c++) i.push(h[c]);
      }
      return i;
    }
    _getJoinedRanges(t, e, i, r, n) {
      let o = t.substring(e, i),
        l = [];
      try {
        l = this._characterJoiners[0].handler(o);
      } catch (a) {
        console.error(a);
      }
      for (let a = 1; a < this._characterJoiners.length; a++) try {
        let u = this._characterJoiners[a].handler(o);
        for (let h = 0; h < u.length; h++) ct._mergeRanges(l, u[h]);
      } catch (u) {
        console.error(u);
      }
      return this._stringRangesToCellRanges(l, r, n), l;
    }
    _stringRangesToCellRanges(t, e, i) {
      let r = 0,
        n = !1,
        o = 0,
        l = t[r];
      if (l) {
        for (let a = i; a < this._bufferService.cols; a++) {
          let u = e.getWidth(a),
            h = e.getString(a).length || we.length;
          if (u !== 0) {
            if (!n && l[0] <= o && (l[0] = a, n = !0), l[1] <= o) {
              if (l[1] = a, l = t[++r], !l) break;
              l[0] <= o ? (l[0] = a, n = !0) : n = !1;
            }
            o += h;
          }
        }
        l && (l[1] = this._bufferService.cols);
      }
    }
    static _mergeRanges(t, e) {
      let i = !1;
      for (let r = 0; r < t.length; r++) {
        let n = t[r];
        if (i) {
          if (e[1] <= n[0]) return t[r - 1][1] = e[1], t;
          if (e[1] <= n[1]) return t[r - 1][1] = Math.max(e[1], n[1]), t.splice(r, 1), t;
          t.splice(r, 1), r--;
        } else {
          if (e[1] <= n[0]) return t.splice(r, 0, e), t;
          if (e[1] <= n[1]) return n[0] = Math.min(e[0], n[0]), t;
          e[0] < n[1] && (n[0] = Math.min(e[0], n[0]), i = !0);
          continue;
        }
      }
      return i ? t[t.length - 1][1] = e[1] : t.push(e), t;
    }
  };
ct = M([S(0, F)], ct);
function Oa(s) {
  return 57508 <= s && s <= 57558;
}
function Ba(s) {
  return 9472 <= s && s <= 9631;
}
function $o(s) {
  return Oa(s) || Ba(s);
}
function Vo() {
  return {
    css: {
      canvas: qr(),
      cell: qr()
    },
    device: {
      canvas: qr(),
      cell: qr(),
      char: {
        width: 0,
        height: 0,
        left: 0,
        top: 0
      }
    }
  };
}
function qr() {
  return {
    width: 0,
    height: 0
  };
}
var Vt = class {
  constructor(t, e, i, r, n, o, l) {
    this._document = t;
    this._characterJoinerService = e;
    this._optionsService = i;
    this._coreBrowserService = r;
    this._coreService = n;
    this._decorationService = o;
    this._themeService = l;
    this._workCell = new q();
    this._columnSelectMode = !1;
    this.defaultSpacing = 0;
  }
  handleSelectionChanged(t, e, i) {
    this._selectionStart = t, this._selectionEnd = e, this._columnSelectMode = i;
  }
  createRow(t, e, i, r, n, o, l, a, u, h, c) {
    let d = [],
      _ = this._characterJoinerService.getJoinedCharacters(e),
      p = this._themeService.colors,
      m = t.getNoBgTrimmedLength();
    i && m < o + 1 && (m = o + 1);
    let f,
      A = 0,
      R = "",
      O = 0,
      I = 0,
      k = 0,
      P = 0,
      oe = !1,
      Me = 0,
      Pe = !1,
      Ke = 0,
      di = 0,
      V = [],
      Qe = h !== -1 && c !== -1;
    for (let y = 0; y < m; y++) {
      t.loadCell(y, this._workCell);
      let T = this._workCell.getWidth();
      if (T === 0) continue;
      let g = !1,
        w = y >= di,
        E = y,
        x = this._workCell;
      if (_.length > 0 && y === _[0][0] && w) {
        let W = _.shift(),
          An = this._isCellInSelection(W[0], e);
        for (O = W[0] + 1; O < W[1]; O++) w &&= An === this._isCellInSelection(O, e);
        w &&= !i || o < W[0] || o >= W[1], w ? (g = !0, x = new Vr(this._workCell, t.translateToString(!0, W[0], W[1]), W[1] - W[0]), E = W[1] - 1, T = x.getWidth()) : di = W[1];
      }
      let N = this._isCellInSelection(y, e),
        Z = i && y === o,
        te = Qe && y >= h && y <= c,
        Oe = !1;
      this._decorationService.forEachDecorationAtCell(y, e, void 0, W => {
        Oe = !0;
      });
      let ze = x.getChars() || we;
      if (ze === " " && (x.isUnderline() || x.isOverline()) && (ze = "\xA0"), Ke = T * a - u.get(ze, x.isBold(), x.isItalic()), !f) f = this._document.createElement("span");else if (A && (N && Pe || !N && !Pe && x.bg === I) && (N && Pe && p.selectionForeground || x.fg === k) && x.extended.ext === P && te === oe && Ke === Me && !Z && !g && !Oe && w) {
        x.isInvisible() ? R += we : R += ze, A++;
        continue;
      } else A && (f.textContent = R), f = this._document.createElement("span"), A = 0, R = "";
      if (I = x.bg, k = x.fg, P = x.extended.ext, oe = te, Me = Ke, Pe = N, g && o >= y && o <= E && (o = y), !this._coreService.isCursorHidden && Z && this._coreService.isCursorInitialized) {
        if (V.push("xterm-cursor"), this._coreBrowserService.isFocused) l && V.push("xterm-cursor-blink"), V.push(r === "bar" ? "xterm-cursor-bar" : r === "underline" ? "xterm-cursor-underline" : "xterm-cursor-block");else if (n) switch (n) {
          case "outline":
            V.push("xterm-cursor-outline");
            break;
          case "block":
            V.push("xterm-cursor-block");
            break;
          case "bar":
            V.push("xterm-cursor-bar");
            break;
          case "underline":
            V.push("xterm-cursor-underline");
            break;
          default:
            break;
        }
      }
      if (x.isBold() && V.push("xterm-bold"), x.isItalic() && V.push("xterm-italic"), x.isDim() && V.push("xterm-dim"), x.isInvisible() ? R = we : R = x.getChars() || we, x.isUnderline() && (V.push(`xterm-underline-${x.extended.underlineStyle}`), R === " " && (R = "\xA0"), !x.isUnderlineColorDefault())) if (x.isUnderlineColorRGB()) f.style.textDecorationColor = `rgb(${De.toColorRGB(x.getUnderlineColor()).join(",")})`;else {
        let W = x.getUnderlineColor();
        this._optionsService.rawOptions.drawBoldTextInBrightColors && x.isBold() && W < 8 && (W += 8), f.style.textDecorationColor = p.ansi[W].css;
      }
      x.isOverline() && (V.push("xterm-overline"), R === " " && (R = "\xA0")), x.isStrikethrough() && V.push("xterm-strikethrough"), te && (f.style.textDecoration = "underline");
      let le = x.getFgColor(),
        et = x.getFgColorMode(),
        me = x.getBgColor(),
        ht = x.getBgColorMode(),
        fi = !!x.isInverse();
      if (fi) {
        let W = le;
        le = me, me = W;
        let An = et;
        et = ht, ht = An;
      }
      let tt,
        Qi,
        pi = !1;
      this._decorationService.forEachDecorationAtCell(y, e, void 0, W => {
        W.options.layer !== "top" && pi || (W.backgroundColorRGB && (ht = 50331648, me = W.backgroundColorRGB.rgba >> 8 & 16777215, tt = W.backgroundColorRGB), W.foregroundColorRGB && (et = 50331648, le = W.foregroundColorRGB.rgba >> 8 & 16777215, Qi = W.foregroundColorRGB), pi = W.options.layer === "top");
      }), !pi && N && (tt = this._coreBrowserService.isFocused ? p.selectionBackgroundOpaque : p.selectionInactiveBackgroundOpaque, me = tt.rgba >> 8 & 16777215, ht = 50331648, pi = !0, p.selectionForeground && (et = 50331648, le = p.selectionForeground.rgba >> 8 & 16777215, Qi = p.selectionForeground)), pi && V.push("xterm-decoration-top");
      let it;
      switch (ht) {
        case 16777216:
        case 33554432:
          it = p.ansi[me], V.push(`xterm-bg-${me}`);
          break;
        case 50331648:
          it = j.toColor(me >> 16, me >> 8 & 255, me & 255), this._addStyle(f, `background-color:#${qo((me >>> 0).toString(16), "0", 6)}`);
          break;
        case 0:
        default:
          fi ? (it = p.foreground, V.push(`xterm-bg-${257}`)) : it = p.background;
      }
      switch (tt || x.isDim() && (tt = U.multiplyOpacity(it, .5)), et) {
        case 16777216:
        case 33554432:
          x.isBold() && le < 8 && this._optionsService.rawOptions.drawBoldTextInBrightColors && (le += 8), this._applyMinimumContrast(f, it, p.ansi[le], x, tt, void 0) || V.push(`xterm-fg-${le}`);
          break;
        case 50331648:
          let W = j.toColor(le >> 16 & 255, le >> 8 & 255, le & 255);
          this._applyMinimumContrast(f, it, W, x, tt, Qi) || this._addStyle(f, `color:#${qo(le.toString(16), "0", 6)}`);
          break;
        case 0:
        default:
          this._applyMinimumContrast(f, it, p.foreground, x, tt, Qi) || fi && V.push(`xterm-fg-${257}`);
      }
      V.length && (f.className = V.join(" "), V.length = 0), !Z && !g && !Oe && w ? A++ : f.textContent = R, Ke !== this.defaultSpacing && (f.style.letterSpacing = `${Ke}px`), d.push(f), y = E;
    }
    return f && A && (f.textContent = R), d;
  }
  _applyMinimumContrast(t, e, i, r, n, o) {
    if (this._optionsService.rawOptions.minimumContrastRatio === 1 || $o(r.getCode())) return !1;
    let l = this._getContrastCache(r),
      a;
    if (!n && !o && (a = l.getColor(e.rgba, i.rgba)), a === void 0) {
      let u = this._optionsService.rawOptions.minimumContrastRatio / (r.isDim() ? 2 : 1);
      a = U.ensureContrastRatio(n || e, o || i, u), l.setColor((n || e).rgba, (o || i).rgba, a ?? null);
    }
    return a ? (this._addStyle(t, `color:${a.css}`), !0) : !1;
  }
  _getContrastCache(t) {
    return t.isDim() ? this._themeService.colors.halfContrastCache : this._themeService.colors.contrastCache;
  }
  _addStyle(t, e) {
    t.setAttribute("style", `${t.getAttribute("style") || ""}${e};`);
  }
  _isCellInSelection(t, e) {
    let i = this._selectionStart,
      r = this._selectionEnd;
    return !i || !r ? !1 : this._columnSelectMode ? i[0] <= r[0] ? t >= i[0] && e >= i[1] && t < r[0] && e <= r[1] : t < i[0] && e >= i[1] && t >= r[0] && e <= r[1] : e > i[1] && e < r[1] || i[1] === r[1] && e === i[1] && t >= i[0] && t < r[0] || i[1] < r[1] && e === r[1] && t < r[0] || i[1] < r[1] && e === i[1] && t >= i[0];
  }
};
Vt = M([S(1, or), S(2, H), S(3, ae), S(4, ge), S(5, Be), S(6, Re)], Vt);
function qo(s, t, e) {
  for (; s.length < e;) s = t + s;
  return s;
}
var Yr = class {
  constructor(t, e) {
    this._flat = new Float32Array(256);
    this._font = "";
    this._fontSize = 0;
    this._weight = "normal";
    this._weightBold = "bold";
    this._measureElements = [];
    this._container = t.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 i = t.createElement("span");
    i.classList.add("xterm-char-measure-element");
    let r = t.createElement("span");
    r.classList.add("xterm-char-measure-element"), r.style.fontWeight = "bold";
    let n = t.createElement("span");
    n.classList.add("xterm-char-measure-element"), n.style.fontStyle = "italic";
    let o = t.createElement("span");
    o.classList.add("xterm-char-measure-element"), o.style.fontWeight = "bold", o.style.fontStyle = "italic", this._measureElements = [i, r, n, o], this._container.appendChild(i), this._container.appendChild(r), this._container.appendChild(n), this._container.appendChild(o), e.appendChild(this._container), this.clear();
  }
  dispose() {
    this._container.remove(), this._measureElements.length = 0, this._holey = void 0;
  }
  clear() {
    this._flat.fill(-9999), this._holey = new Map();
  }
  setFont(t, e, i, r) {
    t === this._font && e === this._fontSize && i === this._weight && r === this._weightBold || (this._font = t, this._fontSize = e, this._weight = i, this._weightBold = r, this._container.style.fontFamily = this._font, this._container.style.fontSize = `${this._fontSize}px`, this._measureElements[0].style.fontWeight = `${i}`, this._measureElements[1].style.fontWeight = `${r}`, this._measureElements[2].style.fontWeight = `${i}`, this._measureElements[3].style.fontWeight = `${r}`, this.clear());
  }
  get(t, e, i) {
    let r = 0;
    if (!e && !i && t.length === 1 && (r = t.charCodeAt(0)) < 256) {
      if (this._flat[r] !== -9999) return this._flat[r];
      let l = this._measure(t, 0);
      return l > 0 && (this._flat[r] = l), l;
    }
    let n = t;
    e && (n += "B"), i && (n += "I");
    let o = this._holey.get(n);
    if (o === void 0) {
      let l = 0;
      e && (l |= 1), i && (l |= 2), o = this._measure(t, l), o > 0 && this._holey.set(n, o);
    }
    return o;
  }
  _measure(t, e) {
    let i = this._measureElements[e];
    return i.textContent = t.repeat(32), i.offsetWidth / 32;
  }
};
var ms = class {
  constructor() {
    this.clear();
  }
  clear() {
    this.hasSelection = !1, this.columnSelectMode = !1, this.viewportStartRow = 0, this.viewportEndRow = 0, this.viewportCappedStartRow = 0, this.viewportCappedEndRow = 0, this.startCol = 0, this.endCol = 0, this.selectionStart = void 0, this.selectionEnd = void 0;
  }
  update(t, e, i, r = !1) {
    if (this.selectionStart = e, this.selectionEnd = i, !e || !i || e[0] === i[0] && e[1] === i[1]) {
      this.clear();
      return;
    }
    let n = t.buffers.active.ydisp,
      o = e[1] - n,
      l = i[1] - n,
      a = Math.max(o, 0),
      u = Math.min(l, t.rows - 1);
    if (a >= t.rows || u < 0) {
      this.clear();
      return;
    }
    this.hasSelection = !0, this.columnSelectMode = r, this.viewportStartRow = o, this.viewportEndRow = l, this.viewportCappedStartRow = a, this.viewportCappedEndRow = u, this.startCol = e[0], this.endCol = i[0];
  }
  isCellSelected(t, e, i) {
    return this.hasSelection ? (i -= t.buffer.active.viewportY, this.columnSelectMode ? this.startCol <= this.endCol ? e >= this.startCol && i >= this.viewportCappedStartRow && e < this.endCol && i <= this.viewportCappedEndRow : e < this.startCol && i >= this.viewportCappedStartRow && e >= this.endCol && i <= this.viewportCappedEndRow : i > this.viewportStartRow && i < this.viewportEndRow || this.viewportStartRow === this.viewportEndRow && i === this.viewportStartRow && e >= this.startCol && e < this.endCol || this.viewportStartRow < this.viewportEndRow && i === this.viewportEndRow && e < this.endCol || this.viewportStartRow < this.viewportEndRow && i === this.viewportStartRow && e >= this.startCol) : !1;
  }
};
function Yo() {
  return new ms();
}
var _s = "xterm-dom-renderer-owner-",
  Le = "xterm-rows",
  jr = "xterm-fg-",
  jo = "xterm-bg-",
  ki = "xterm-focus",
  Xr = "xterm-selection",
  Na = 1,
  Yt = class extends D {
    constructor(e, i, r, n, o, l, a, u, h, c, d, _, p, m) {
      super();
      this._terminal = e;
      this._document = i;
      this._element = r;
      this._screenElement = n;
      this._viewportElement = o;
      this._helperContainer = l;
      this._linkifier2 = a;
      this._charSizeService = h;
      this._optionsService = c;
      this._bufferService = d;
      this._coreService = _;
      this._coreBrowserService = p;
      this._themeService = m;
      this._terminalClass = Na++;
      this._rowElements = [];
      this._selectionRenderModel = Yo();
      this.onRequestRedraw = this._register(new v()).event;
      this._rowContainer = this._document.createElement("div"), this._rowContainer.classList.add(Le), 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(Xr), this._selectionContainer.setAttribute("aria-hidden", "true"), this.dimensions = Vo(), this._updateDimensions(), this._register(this._optionsService.onOptionChange(() => this._handleOptionsChanged())), this._register(this._themeService.onChangeColors(f => this._injectCss(f))), this._injectCss(this._themeService.colors), this._rowFactory = u.createInstance(Vt, document), this._element.classList.add(_s + this._terminalClass), this._screenElement.appendChild(this._rowContainer), this._screenElement.appendChild(this._selectionContainer), this._register(this._linkifier2.onShowLinkUnderline(f => this._handleLinkHover(f))), this._register(this._linkifier2.onHideLinkUnderline(f => this._handleLinkLeave(f))), this._register(C(() => {
        this._element.classList.remove(_s + this._terminalClass), this._rowContainer.remove(), this._selectionContainer.remove(), this._widthCache.dispose(), this._themeStyleElement.remove(), this._dimensionsStyleElement.remove();
      })), this._widthCache = new Yr(this._document, this._helperContainer), this._widthCache.setFont(this._optionsService.rawOptions.fontFamily, this._optionsService.rawOptions.fontSize, this._optionsService.rawOptions.fontWeight, this._optionsService.rawOptions.fontWeightBold), this._setDefaultSpacing();
    }
    _updateDimensions() {
      let e = this._coreBrowserService.dpr;
      this.dimensions.device.char.width = this._charSizeService.width * e, this.dimensions.device.char.height = Math.ceil(this._charSizeService.height * e), this.dimensions.device.cell.width = this.dimensions.device.char.width + Math.round(this._optionsService.rawOptions.letterSpacing), this.dimensions.device.cell.height = Math.floor(this.dimensions.device.char.height * this._optionsService.rawOptions.lineHeight), this.dimensions.device.char.left = 0, this.dimensions.device.char.top = 0, this.dimensions.device.canvas.width = this.dimensions.device.cell.width * this._bufferService.cols, this.dimensions.device.canvas.height = this.dimensions.device.cell.height * this._bufferService.rows, this.dimensions.css.canvas.width = Math.round(this.dimensions.device.canvas.width / e), this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / e), this.dimensions.css.cell.width = this.dimensions.css.canvas.width / this._bufferService.cols, this.dimensions.css.cell.height = this.dimensions.css.canvas.height / this._bufferService.rows;
      for (let r of this._rowElements) r.style.width = `${this.dimensions.css.canvas.width}px`, r.style.height = `${this.dimensions.css.cell.height}px`, r.style.lineHeight = `${this.dimensions.css.cell.height}px`, r.style.overflow = "hidden";
      this._dimensionsStyleElement || (this._dimensionsStyleElement = this._document.createElement("style"), this._screenElement.appendChild(this._dimensionsStyleElement));
      let i = `${this._terminalSelector} .${Le} span { display: inline-block; height: 100%; vertical-align: top;}`;
      this._dimensionsStyleElement.textContent = i, this._selectionContainer.style.height = this._viewportElement.style.height, this._screenElement.style.width = `${this.dimensions.css.canvas.width}px`, this._screenElement.style.height = `${this.dimensions.css.canvas.height}px`;
    }
    _injectCss(e) {
      this._themeStyleElement || (this._themeStyleElement = this._document.createElement("style"), this._screenElement.appendChild(this._themeStyleElement));
      let i = `${this._terminalSelector} .${Le} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;
      i += `${this._terminalSelector} .${Le} .xterm-dim { color: ${U.multiplyOpacity(e.foreground, .5).css};}`, i += `${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;
      let r = `blink_underline_${this._terminalClass}`,
        n = `blink_bar_${this._terminalClass}`,
        o = `blink_block_${this._terminalClass}`;
      i += `@keyframes ${r} { 50% {  border-bottom-style: hidden; }}`, i += `@keyframes ${n} { 50% {  box-shadow: none; }}`, i += `@keyframes ${o} { 0% {  background-color: ${e.cursor.css};  color: ${e.cursorAccent.css}; } 50% {  background-color: inherit;  color: ${e.cursor.css}; }}`, i += `${this._terminalSelector} .${Le}.${ki} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Le}.${ki} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Le}.${ki} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Le} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`, i += `${this._terminalSelector} .${Xr} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Xr} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Xr} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;
      for (let [l, a] of e.ansi.entries()) i += `${this._terminalSelector} .${jr}${l} { color: ${a.css}; }${this._terminalSelector} .${jr}${l}.xterm-dim { color: ${U.multiplyOpacity(a, .5).css}; }${this._terminalSelector} .${jo}${l} { background-color: ${a.css}; }`;
      i += `${this._terminalSelector} .${jr}${257} { color: ${U.opaque(e.background).css}; }${this._terminalSelector} .${jr}${257}.xterm-dim { color: ${U.multiplyOpacity(U.opaque(e.background), .5).css}; }${this._terminalSelector} .${jo}${257} { background-color: ${e.foreground.css}; }`, this._themeStyleElement.textContent = i;
    }
    _setDefaultSpacing() {
      let e = this.dimensions.css.cell.width - this._widthCache.get("W", !1, !1);
      this._rowContainer.style.letterSpacing = `${e}px`, this._rowFactory.defaultSpacing = e;
    }
    handleDevicePixelRatioChange() {
      this._updateDimensions(), this._widthCache.clear(), this._setDefaultSpacing();
    }
    _refreshRowElements(e, i) {
      for (let r = this._rowElements.length; r <= i; r++) {
        let n = this._document.createElement("div");
        this._rowContainer.appendChild(n), this._rowElements.push(n);
      }
      for (; this._rowElements.length > i;) this._rowContainer.removeChild(this._rowElements.pop());
    }
    handleResize(e, i) {
      this._refreshRowElements(e, i), 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(ki), this.renderRows(0, this._bufferService.rows - 1);
    }
    handleFocus() {
      this._rowContainer.classList.add(ki), this.renderRows(this._bufferService.buffer.y, this._bufferService.buffer.y);
    }
    handleSelectionChanged(e, i, r) {
      if (this._selectionContainer.replaceChildren(), this._rowFactory.handleSelectionChanged(e, i, r), this.renderRows(0, this._bufferService.rows - 1), !e || !i || (this._selectionRenderModel.update(this._terminal, e, i, r), !this._selectionRenderModel.hasSelection)) return;
      let n = this._selectionRenderModel.viewportStartRow,
        o = this._selectionRenderModel.viewportEndRow,
        l = this._selectionRenderModel.viewportCappedStartRow,
        a = this._selectionRenderModel.viewportCappedEndRow,
        u = this._document.createDocumentFragment();
      if (r) {
        let h = e[0] > i[0];
        u.appendChild(this._createSelectionElement(l, h ? i[0] : e[0], h ? e[0] : i[0], a - l + 1));
      } else {
        let h = n === l ? e[0] : 0,
          c = l === o ? i[0] : this._bufferService.cols;
        u.appendChild(this._createSelectionElement(l, h, c));
        let d = a - l - 1;
        if (u.appendChild(this._createSelectionElement(l + 1, 0, this._bufferService.cols, d)), l !== a) {
          let _ = o === a ? i[0] : this._bufferService.cols;
          u.appendChild(this._createSelectionElement(a, 0, _));
        }
      }
      this._selectionContainer.appendChild(u);
    }
    _createSelectionElement(e, i, r, n = 1) {
      let o = this._document.createElement("div"),
        l = i * this.dimensions.css.cell.width,
        a = this.dimensions.css.cell.width * (r - i);
      return l + a > this.dimensions.css.canvas.width && (a = this.dimensions.css.canvas.width - l), o.style.height = `${n * this.dimensions.css.cell.height}px`, o.style.top = `${e * this.dimensions.css.cell.height}px`, o.style.left = `${l}px`, o.style.width = `${a}px`, o;
    }
    handleCursorMove() {}
    _handleOptionsChanged() {
      this._updateDimensions(), this._injectCss(this._themeService.colors), this._widthCache.setFont(this._optionsService.rawOptions.fontFamily, this._optionsService.rawOptions.fontSize, this._optionsService.rawOptions.fontWeight, this._optionsService.rawOptions.fontWeightBold), this._setDefaultSpacing();
    }
    clear() {
      for (let e of this._rowElements) e.replaceChildren();
    }
    renderRows(e, i) {
      let r = this._bufferService.buffer,
        n = r.ybase + r.y,
        o = Math.min(r.x, this._bufferService.cols - 1),
        l = this._coreService.decPrivateModes.cursorBlink ?? this._optionsService.rawOptions.cursorBlink,
        a = this._coreService.decPrivateModes.cursorStyle ?? this._optionsService.rawOptions.cursorStyle,
        u = this._optionsService.rawOptions.cursorInactiveStyle;
      for (let h = e; h <= i; h++) {
        let c = h + r.ydisp,
          d = this._rowElements[h],
          _ = r.lines.get(c);
        if (!d || !_) break;
        d.replaceChildren(...this._rowFactory.createRow(_, c, c === n, a, u, o, l, this.dimensions.css.cell.width, this._widthCache, -1, -1));
      }
    }
    get _terminalSelector() {
      return `.${_s}${this._terminalClass}`;
    }
    _handleLinkHover(e) {
      this._setCellUnderline(e.x1, e.x2, e.y1, e.y2, e.cols, !0);
    }
    _handleLinkLeave(e) {
      this._setCellUnderline(e.x1, e.x2, e.y1, e.y2, e.cols, !1);
    }
    _setCellUnderline(e, i, r, n, o, l) {
      r < 0 && (e = 0), n < 0 && (i = 0);
      let a = this._bufferService.rows - 1;
      r = Math.max(Math.min(r, a), 0), n = Math.max(Math.min(n, a), 0), o = Math.min(o, this._bufferService.cols);
      let u = this._bufferService.buffer,
        h = u.ybase + u.y,
        c = Math.min(u.x, o - 1),
        d = this._optionsService.rawOptions.cursorBlink,
        _ = this._optionsService.rawOptions.cursorStyle,
        p = this._optionsService.rawOptions.cursorInactiveStyle;
      for (let m = r; m <= n; ++m) {
        let f = m + u.ydisp,
          A = this._rowElements[m],
          R = u.lines.get(f);
        if (!A || !R) break;
        A.replaceChildren(...this._rowFactory.createRow(R, f, f === h, _, p, c, d, this.dimensions.css.cell.width, this._widthCache, l ? m === r ? e : 0 : -1, l ? (m === n ? i : o) - 1 : -1));
      }
    }
  };
Yt = M([S(7, xt), S(8, nt), S(9, H), S(10, F), S(11, ge), S(12, ae), S(13, Re)], Yt);
var jt = class extends D {
  constructor(e, i, r) {
    super();
    this._optionsService = r;
    this.width = 0;
    this.height = 0;
    this._onCharSizeChange = this._register(new v());
    this.onCharSizeChange = this._onCharSizeChange.event;
    try {
      this._measureStrategy = this._register(new vs(this._optionsService));
    } catch {
      this._measureStrategy = this._register(new bs(e, i, this._optionsService));
    }
    this._register(this._optionsService.onMultipleOptionChange(["fontFamily", "fontSize"], () => this.measure()));
  }
  get hasValidSize() {
    return this.width > 0 && this.height > 0;
  }
  measure() {
    let e = this._measureStrategy.measure();
    (e.width !== this.width || e.height !== this.height) && (this.width = e.width, this.height = e.height, this._onCharSizeChange.fire());
  }
};
jt = M([S(2, H)], jt);
var Zr = class extends D {
    constructor() {
      super(...arguments);
      this._result = {
        width: 0,
        height: 0
      };
    }
    _validateAndSet(e, i) {
      e !== void 0 && e > 0 && i !== void 0 && i > 0 && (this._result.width = e, this._result.height = i);
    }
  },
  bs = class extends Zr {
    constructor(e, i, r) {
      super();
      this._document = e;
      this._parentElement = i;
      this._optionsService = r;
      this._measureElement = this._document.createElement("span"), this._measureElement.classList.add("xterm-char-measure-element"), this._measureElement.textContent = "W".repeat(32), this._measureElement.setAttribute("aria-hidden", "true"), this._measureElement.style.whiteSpace = "pre", this._measureElement.style.fontKerning = "none", this._parentElement.appendChild(this._measureElement);
    }
    measure() {
      return this._measureElement.style.fontFamily = this._optionsService.rawOptions.fontFamily, this._measureElement.style.fontSize = `${this._optionsService.rawOptions.fontSize}px`, this._validateAndSet(Number(this._measureElement.offsetWidth) / 32, Number(this._measureElement.offsetHeight)), this._result;
    }
  },
  vs = class extends Zr {
    constructor(e) {
      super();
      this._optionsService = e;
      this._canvas = new OffscreenCanvas(100, 100), this._ctx = this._canvas.getContext("2d");
      let i = this._ctx.measureText("W");
      if (!("width" in i && "fontBoundingBoxAscent" in i && "fontBoundingBoxDescent" in i)) throw new Error("Required font metrics not supported");
    }
    measure() {
      this._ctx.font = `${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;
      let e = this._ctx.measureText("W");
      return this._validateAndSet(e.width, e.fontBoundingBoxAscent + e.fontBoundingBoxDescent), this._result;
    }
  };
var Jr = class extends D {
    constructor(e, i, r) {
      super();
      this._textarea = e;
      this._window = i;
      this.mainDocument = r;
      this._isFocused = !1;
      this._cachedIsFocused = void 0;
      this._screenDprMonitor = this._register(new gs(this._window));
      this._onDprChange = this._register(new v());
      this.onDprChange = this._onDprChange.event;
      this._onWindowChange = this._register(new v());
      this.onWindowChange = this._onWindowChange.event;
      this._register(this.onWindowChange(n => this._screenDprMonitor.setWindow(n))), this._register($.forward(this._screenDprMonitor.onDprChange, this._onDprChange)), this._register(L(this._textarea, "focus", () => this._isFocused = !0)), this._register(L(this._textarea, "blur", () => this._isFocused = !1));
    }
    get window() {
      return this._window;
    }
    set window(e) {
      this._window !== e && (this._window = e, this._onWindowChange.fire(this._window));
    }
    get dpr() {
      return this.window.devicePixelRatio;
    }
    get isFocused() {
      return this._cachedIsFocused === void 0 && (this._cachedIsFocused = this._isFocused && this._textarea.ownerDocument.hasFocus(), queueMicrotask(() => this._cachedIsFocused = void 0)), this._cachedIsFocused;
    }
  },
  gs = class extends D {
    constructor(e) {
      super();
      this._parentWindow = e;
      this._windowResizeListener = this._register(new ye());
      this._onDprChange = this._register(new v());
      this.onDprChange = this._onDprChange.event;
      this._outerListener = () => this._setDprAndFireIfDiffers(), this._currentDevicePixelRatio = this._parentWindow.devicePixelRatio, this._updateDpr(), this._setWindowResizeListener(), this._register(C(() => this.clearListener()));
    }
    setWindow(e) {
      this._parentWindow = e, this._setWindowResizeListener(), this._setDprAndFireIfDiffers();
    }
    _setWindowResizeListener() {
      this._windowResizeListener.value = L(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);
    }
  };
var Qr = class extends D {
  constructor() {
    super();
    this.linkProviders = [];
    this._register(C(() => this.linkProviders.length = 0));
  }
  registerLinkProvider(e) {
    return this.linkProviders.push(e), {
      dispose: () => {
        let i = this.linkProviders.indexOf(e);
        i !== -1 && this.linkProviders.splice(i, 1);
      }
    };
  }
};
function Ci(s, t, e) {
  let i = e.getBoundingClientRect(),
    r = s.getComputedStyle(e),
    n = parseInt(r.getPropertyValue("padding-left")),
    o = parseInt(r.getPropertyValue("padding-top"));
  return [t.clientX - i.left - n, t.clientY - i.top - o];
}
function Xo(s, t, e, i, r, n, o, l, a) {
  if (!n) return;
  let u = Ci(s, t, e);
  if (u) return u[0] = Math.ceil((u[0] + (a ? o / 2 : 0)) / o), u[1] = Math.ceil(u[1] / l), u[0] = Math.min(Math.max(u[0], 1), i + (a ? 1 : 0)), u[1] = Math.min(Math.max(u[1], 1), r), u;
}
var Xt = class {
  constructor(t, e) {
    this._renderService = t;
    this._charSizeService = e;
  }
  getCoords(t, e, i, r, n) {
    return Xo(window, t, e, i, r, this._charSizeService.hasValidSize, this._renderService.dimensions.css.cell.width, this._renderService.dimensions.css.cell.height, n);
  }
  getMouseReportCoords(t, e) {
    let i = Ci(window, t, e);
    if (this._charSizeService.hasValidSize) return i[0] = Math.min(Math.max(i[0], 0), this._renderService.dimensions.css.canvas.width - 1), i[1] = Math.min(Math.max(i[1], 0), this._renderService.dimensions.css.canvas.height - 1), {
      col: Math.floor(i[0] / this._renderService.dimensions.css.cell.width),
      row: Math.floor(i[1] / this._renderService.dimensions.css.cell.height),
      x: Math.floor(i[0]),
      y: Math.floor(i[1])
    };
  }
};
Xt = M([S(0, ce), S(1, nt)], Xt);
var en = class {
  constructor(t, e) {
    this._renderCallback = t;
    this._coreBrowserService = e;
    this._refreshCallbacks = [];
  }
  dispose() {
    this._animationFrame && (this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame), this._animationFrame = void 0);
  }
  addRefreshCallback(t) {
    return this._refreshCallbacks.push(t), this._animationFrame || (this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh())), this._animationFrame;
  }
  refresh(t, e, i) {
    this._rowCount = i, t = t !== void 0 ? t : 0, e = e !== void 0 ? e : this._rowCount - 1, this._rowStart = this._rowStart !== void 0 ? Math.min(this._rowStart, t) : t, this._rowEnd = this._rowEnd !== void 0 ? Math.max(this._rowEnd, e) : e, !this._animationFrame && (this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh()));
  }
  _innerRefresh() {
    if (this._animationFrame = void 0, this._rowStart === void 0 || this._rowEnd === void 0 || this._rowCount === void 0) {
      this._runRefreshCallbacks();
      return;
    }
    let t = Math.max(this._rowStart, 0),
      e = Math.min(this._rowEnd, this._rowCount - 1);
    this._rowStart = void 0, this._rowEnd = void 0, this._renderCallback(t, e), this._runRefreshCallbacks();
  }
  _runRefreshCallbacks() {
    for (let t of this._refreshCallbacks) t(0);
    this._refreshCallbacks = [];
  }
};
var tn = {};
Ll(tn, {
  getSafariVersion: () => Ha,
  isChromeOS: () => Ts,
  isFirefox: () => Ss,
  isIpad: () => Wa,
  isIphone: () => Ua,
  isLegacyEdge: () => Fa,
  isLinux: () => Bi,
  isMac: () => Zt,
  isNode: () => Mi,
  isSafari: () => Zo,
  isWindows: () => Es
});
var Mi = typeof process < "u" && "title" in process,
  Pi = Mi ? "node" : navigator.userAgent,
  Oi = Mi ? "node" : navigator.platform,
  Ss = Pi.includes("Firefox"),
  Fa = Pi.includes("Edge"),
  Zo = /^((?!chrome|android).)*safari/i.test(Pi);
function Ha() {
  if (!Zo) return 0;
  let s = Pi.match(/Version\/(\d+)/);
  return s === null || s.length < 2 ? 0 : parseInt(s[1]);
}
var Zt = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"].includes(Oi),
  Wa = Oi === "iPad",
  Ua = Oi === "iPhone",
  Es = ["Windows", "Win16", "Win32", "WinCE"].includes(Oi),
  Bi = Oi.indexOf("Linux") >= 0,
  Ts = /\bCrOS\b/.test(Pi);
var rn = class {
    constructor() {
      this._tasks = [];
      this._i = 0;
    }
    enqueue(t) {
      this._tasks.push(t), 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(t) {
      this._idleCallback = void 0;
      let e = 0,
        i = 0,
        r = t.timeRemaining(),
        n = 0;
      for (; this._i < this._tasks.length;) {
        if (e = performance.now(), this._tasks[this._i]() || this._i++, e = Math.max(1, performance.now() - e), i = Math.max(e, i), n = t.timeRemaining(), i * 1.5 > n) {
          r - e < -20 && console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r - e))}ms`), this._start();
          return;
        }
        r = n;
      }
      this.clear();
    }
  },
  Is = class extends rn {
    _requestCallback(t) {
      return setTimeout(() => t(this._createDeadline(16)));
    }
    _cancelCallback(t) {
      clearTimeout(t);
    }
    _createDeadline(t) {
      let e = performance.now() + t;
      return {
        timeRemaining: () => Math.max(0, e - performance.now())
      };
    }
  },
  ys = class extends rn {
    _requestCallback(t) {
      return requestIdleCallback(t);
    }
    _cancelCallback(t) {
      cancelIdleCallback(t);
    }
  },
  Jt = !Mi && "requestIdleCallback" in window ? ys : Is,
  nn = class {
    constructor() {
      this._queue = new Jt();
    }
    set(t) {
      this._queue.clear(), this._queue.enqueue(t);
    }
    flush() {
      this._queue.flush();
    }
  };
var Qt = class extends D {
  constructor(e, i, r, n, o, l, a, u, h) {
    super();
    this._rowCount = e;
    this._optionsService = r;
    this._charSizeService = n;
    this._coreService = o;
    this._coreBrowserService = u;
    this._renderer = this._register(new ye());
    this._pausedResizeTask = new nn();
    this._observerDisposable = this._register(new ye());
    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 v());
    this.onDimensionsChange = this._onDimensionsChange.event;
    this._onRenderedViewportChange = this._register(new v());
    this.onRenderedViewportChange = this._onRenderedViewportChange.event;
    this._onRender = this._register(new v());
    this.onRender = this._onRender.event;
    this._onRefreshRequest = this._register(new v());
    this.onRefreshRequest = this._onRefreshRequest.event;
    this._renderDebouncer = new en((c, d) => this._renderRows(c, d), this._coreBrowserService), this._register(this._renderDebouncer), this._syncOutputHandler = new xs(this._coreBrowserService, this._coreService, () => this._fullRefresh()), this._register(C(() => this._syncOutputHandler.dispose())), this._register(this._coreBrowserService.onDprChange(() => this.handleDevicePixelRatioChange())), this._register(a.onResize(() => this._fullRefresh())), this._register(a.buffers.onBufferActivate(() => this._renderer.value?.clear())), this._register(this._optionsService.onOptionChange(() => this._handleOptionsChanged())), this._register(this._charSizeService.onCharSizeChange(() => this.handleCharSizeChanged())), this._register(l.onDecorationRegistered(() => this._fullRefresh())), this._register(l.onDecorationRemoved(() => this._fullRefresh())), this._register(this._optionsService.onMultipleOptionChange(["customGlyphs", "drawBoldTextInBrightColors", "letterSpacing", "lineHeight", "fontFamily", "fontSize", "fontWeight", "fontWeightBold", "minimumContrastRatio", "rescaleOverlappingGlyphs"], () => {
      this.clear(), this.handleResize(a.cols, a.rows), this._fullRefresh();
    })), this._register(this._optionsService.onMultipleOptionChange(["cursorBlink", "cursorStyle"], () => this.refreshRows(a.buffer.y, a.buffer.y, !0))), this._register(h.onChangeColors(() => this._fullRefresh())), this._registerIntersectionObserver(this._coreBrowserService.window, i), this._register(this._coreBrowserService.onWindowChange(c => this._registerIntersectionObserver(c, i)));
  }
  get dimensions() {
    return this._renderer.value.dimensions;
  }
  _registerIntersectionObserver(e, i) {
    if ("IntersectionObserver" in e) {
      let r = new e.IntersectionObserver(n => this._handleIntersectionChange(n[n.length - 1]), {
        threshold: 0
      });
      r.observe(i), this._observerDisposable.value = C(() => r.disconnect());
    }
  }
  _handleIntersectionChange(e) {
    this._isPaused = e.isIntersecting === void 0 ? e.intersectionRatio === 0 : !e.isIntersecting, !this._isPaused && !this._charSizeService.hasValidSize && this._charSizeService.measure(), !this._isPaused && this._needsFullRefresh && (this._pausedResizeTask.flush(), this.refreshRows(0, this._rowCount - 1), this._needsFullRefresh = !1);
  }
  refreshRows(e, i, r = !1) {
    if (this._isPaused) {
      this._needsFullRefresh = !0;
      return;
    }
    if (this._coreService.decPrivateModes.synchronizedOutput) {
      this._syncOutputHandler.bufferRows(e, i);
      return;
    }
    let n = this._syncOutputHandler.flush();
    n && (e = Math.min(e, n.start), i = Math.max(i, n.end)), r || (this._isNextRenderRedrawOnly = !1), this._renderDebouncer.refresh(e, i, this._rowCount);
  }
  _renderRows(e, i) {
    if (this._renderer.value) {
      if (this._coreService.decPrivateModes.synchronizedOutput) {
        this._syncOutputHandler.bufferRows(e, i);
        return;
      }
      e = Math.min(e, this._rowCount - 1), i = Math.min(i, this._rowCount - 1), this._renderer.value.renderRows(e, i), this._needsSelectionRefresh && (this._renderer.value.handleSelectionChanged(this._selectionState.start, this._selectionState.end, this._selectionState.columnSelectMode), this._needsSelectionRefresh = !1), this._isNextRenderRedrawOnly || this._onRenderedViewportChange.fire({
        start: e,
        end: i
      }), this._onRender.fire({
        start: e,
        end: i
      }), this._isNextRenderRedrawOnly = !0;
    }
  }
  resize(e, i) {
    this._rowCount = i, this._fireOnCanvasResize();
  }
  _handleOptionsChanged() {
    this._renderer.value && (this.refreshRows(0, this._rowCount - 1), this._fireOnCanvasResize());
  }
  _fireOnCanvasResize() {
    this._renderer.value && (this._renderer.value.dimensions.css.canvas.width === this._canvasWidth && this._renderer.value.dimensions.css.canvas.height === this._canvasHeight || this._onDimensionsChange.fire(this._renderer.value.dimensions));
  }
  hasRenderer() {
    return !!this._renderer.value;
  }
  setRenderer(e) {
    this._renderer.value = e, this._renderer.value && (this._renderer.value.onRequestRedraw(i => this.refreshRows(i.start, i.end, !0)), this._needsSelectionRefresh = !0, this._fullRefresh());
  }
  addRefreshCallback(e) {
    return this._renderDebouncer.addRefreshCallback(e);
  }
  _fullRefresh() {
    this._isPaused ? this._needsFullRefresh = !0 : this.refreshRows(0, this._rowCount - 1);
  }
  clearTextureAtlas() {
    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(e, i) {
    this._renderer.value && (this._isPaused ? this._pausedResizeTask.set(() => this._renderer.value?.handleResize(e, i)) : this._renderer.value.handleResize(e, i), this._fullRefresh());
  }
  handleCharSizeChanged() {
    this._renderer.value?.handleCharSizeChanged();
  }
  handleBlur() {
    this._renderer.value?.handleBlur();
  }
  handleFocus() {
    this._renderer.value?.handleFocus();
  }
  handleSelectionChanged(e, i, r) {
    this._selectionState.start = e, this._selectionState.end = i, this._selectionState.columnSelectMode = r, this._renderer.value?.handleSelectionChanged(e, i, r);
  }
  handleCursorMove() {
    this._renderer.value?.handleCursorMove();
  }
  clear() {
    this._renderer.value?.clear();
  }
};
Qt = M([S(2, H), S(3, nt), S(4, ge), S(5, Be), S(6, F), S(7, ae), S(8, Re)], Qt);
var xs = class {
  constructor(t, e, i) {
    this._coreBrowserService = t;
    this._coreService = e;
    this._onTimeout = i;
    this._start = 0;
    this._end = 0;
    this._isBuffering = !1;
  }
  bufferRows(t, e) {
    this._isBuffering ? (this._start = Math.min(this._start, t), this._end = Math.max(this._end, e)) : (this._start = t, this._end = e, this._isBuffering = !0), this._timeout === void 0 && (this._timeout = this._coreBrowserService.window.setTimeout(() => {
      this._timeout = void 0, this._coreService.decPrivateModes.synchronizedOutput = !1, this._onTimeout();
    }, 1e3));
  }
  flush() {
    if (this._timeout !== void 0 && (this._coreBrowserService.window.clearTimeout(this._timeout), this._timeout = void 0), !this._isBuffering) return;
    let t = {
      start: this._start,
      end: this._end
    };
    return this._isBuffering = !1, t;
  }
  dispose() {
    this._timeout !== void 0 && (this._coreBrowserService.window.clearTimeout(this._timeout), this._timeout = void 0);
  }
};
function Jo(s, t, e, i) {
  let r = e.buffer.x,
    n = e.buffer.y;
  if (!e.buffer.hasScrollback) return Ga(r, n, s, t, e, i) + sn(n, t, e, i) + $a(r, n, s, t, e, i);
  let o;
  if (n === t) return o = r > s ? "D" : "C", Fi(Math.abs(r - s), Ni(o, i));
  o = n > t ? "D" : "C";
  let l = Math.abs(n - t),
    a = za(n > t ? s : r, e) + (l - 1) * e.cols + 1 + Ka(n > t ? r : s, e);
  return Fi(a, Ni(o, i));
}
function Ka(s, t) {
  return s - 1;
}
function za(s, t) {
  return t.cols - s;
}
function Ga(s, t, e, i, r, n) {
  return sn(t, i, r, n).length === 0 ? "" : Fi(el(s, t, s, t - gt(t, r), !1, r).length, Ni("D", n));
}
function sn(s, t, e, i) {
  let r = s - gt(s, e),
    n = t - gt(t, e),
    o = Math.abs(r - n) - Va(s, t, e);
  return Fi(o, Ni(Qo(s, t), i));
}
function $a(s, t, e, i, r, n) {
  let o;
  sn(t, i, r, n).length > 0 ? o = i - gt(i, r) : o = t;
  let l = i,
    a = qa(s, t, e, i, r, n);
  return Fi(el(s, o, e, l, a === "C", r).length, Ni(a, n));
}
function Va(s, t, e) {
  let i = 0,
    r = s - gt(s, e),
    n = t - gt(t, e);
  for (let o = 0; o < Math.abs(r - n); o++) {
    let l = Qo(s, t) === "A" ? -1 : 1;
    e.buffer.lines.get(r + l * o)?.isWrapped && i++;
  }
  return i;
}
function gt(s, t) {
  let e = 0,
    i = t.buffer.lines.get(s),
    r = i?.isWrapped;
  for (; r && s >= 0 && s < t.rows;) e++, i = t.buffer.lines.get(--s), r = i?.isWrapped;
  return e;
}
function qa(s, t, e, i, r, n) {
  let o;
  return sn(e, i, r, n).length > 0 ? o = i - gt(i, r) : o = t, s < e && o <= i || s >= e && o < i ? "C" : "D";
}
function Qo(s, t) {
  return s > t ? "A" : "B";
}
function el(s, t, e, i, r, n) {
  let o = s,
    l = t,
    a = "";
  for (; (o !== e || l !== i) && l >= 0 && l < n.buffer.lines.length;) o += r ? 1 : -1, r && o > n.cols - 1 ? (a += n.buffer.translateBufferLineToString(l, !1, s, o), o = 0, s = 0, l++) : !r && o < 0 && (a += n.buffer.translateBufferLineToString(l, !1, 0, s + 1), o = n.cols - 1, s = o, l--);
  return a + n.buffer.translateBufferLineToString(l, !1, s, o);
}
function Ni(s, t) {
  let e = t ? "O" : "[";
  return b.ESC + e + s;
}
function Fi(s, t) {
  s = Math.floor(s);
  let e = "";
  for (let i = 0; i < s; i++) e += t;
  return e;
}
var on = class {
  constructor(t) {
    this._bufferService = t;
    this.isSelectAllActive = !1;
    this.selectionStartLength = 0;
  }
  clearSelection() {
    this.selectionStart = void 0, this.selectionEnd = void 0, this.isSelectAllActive = !1, this.selectionStartLength = 0;
  }
  get finalSelectionStart() {
    return this.isSelectAllActive ? [0, 0] : !this.selectionEnd || !this.selectionStart ? this.selectionStart : this.areSelectionValuesReversed() ? this.selectionEnd : this.selectionStart;
  }
  get finalSelectionEnd() {
    if (this.isSelectAllActive) return [this._bufferService.cols, this._bufferService.buffer.ybase + this._bufferService.rows - 1];
    if (this.selectionStart) {
      if (!this.selectionEnd || this.areSelectionValuesReversed()) {
        let t = this.selectionStart[0] + this.selectionStartLength;
        return t > this._bufferService.cols ? t % this._bufferService.cols === 0 ? [this._bufferService.cols, this.selectionStart[1] + Math.floor(t / this._bufferService.cols) - 1] : [t % this._bufferService.cols, this.selectionStart[1] + Math.floor(t / this._bufferService.cols)] : [t, this.selectionStart[1]];
      }
      if (this.selectionStartLength && this.selectionEnd[1] === this.selectionStart[1]) {
        let t = this.selectionStart[0] + this.selectionStartLength;
        return t > this._bufferService.cols ? [t % this._bufferService.cols, this.selectionStart[1] + Math.floor(t / this._bufferService.cols)] : [Math.max(t, this.selectionEnd[0]), this.selectionEnd[1]];
      }
      return this.selectionEnd;
    }
  }
  areSelectionValuesReversed() {
    let t = this.selectionStart,
      e = this.selectionEnd;
    return !t || !e ? !1 : t[1] > e[1] || t[1] === e[1] && t[0] > e[0];
  }
  handleTrim(t) {
    return this.selectionStart && (this.selectionStart[1] -= t), this.selectionEnd && (this.selectionEnd[1] -= t), this.selectionEnd && this.selectionEnd[1] < 0 ? (this.clearSelection(), !0) : (this.selectionStart && this.selectionStart[1] < 0 && (this.selectionStart[1] = 0), !1);
  }
};
function ws(s, t) {
  if (s.start.y > s.end.y) throw new Error(`Buffer range end (${s.end.x}, ${s.end.y}) cannot be before start (${s.start.x}, ${s.start.y})`);
  return t * (s.end.y - s.start.y) + (s.end.x - s.start.x + 1);
}
var Ds = 50,
  Ya = 15,
  ja = 50,
  Xa = 500,
  Za = "\xA0",
  Ja = new RegExp(Za, "g");
var ei = class extends D {
  constructor(e, i, r, n, o, l, a, u, h) {
    super();
    this._element = e;
    this._screenElement = i;
    this._linkifier = r;
    this._bufferService = n;
    this._coreService = o;
    this._mouseService = l;
    this._optionsService = a;
    this._renderService = u;
    this._coreBrowserService = h;
    this._dragScrollAmount = 0;
    this._enabled = !0;
    this._workCell = new q();
    this._mouseDownTimeStamp = 0;
    this._oldHasSelection = !1;
    this._oldSelectionStart = void 0;
    this._oldSelectionEnd = void 0;
    this._onLinuxMouseSelection = this._register(new v());
    this.onLinuxMouseSelection = this._onLinuxMouseSelection.event;
    this._onRedrawRequest = this._register(new v());
    this.onRequestRedraw = this._onRedrawRequest.event;
    this._onSelectionChange = this._register(new v());
    this.onSelectionChange = this._onSelectionChange.event;
    this._onRequestScrollLines = this._register(new v());
    this.onRequestScrollLines = this._onRequestScrollLines.event;
    this._mouseMoveListener = c => this._handleMouseMove(c), this._mouseUpListener = c => this._handleMouseUp(c), this._coreService.onUserInput(() => {
      this.hasSelection && this.clearSelection();
    }), this._trimListener = this._bufferService.buffer.lines.onTrim(c => this._handleTrim(c)), this._register(this._bufferService.buffers.onBufferActivate(c => this._handleBufferActivate(c))), this.enable(), this._model = new on(this._bufferService), this._activeSelectionMode = 0, this._register(C(() => {
      this._removeMouseDownListeners();
    })), this._register(this._bufferService.onResize(c => {
      c.rowsChanged && this.clearSelection();
    }));
  }
  reset() {
    this.clearSelection();
  }
  disable() {
    this.clearSelection(), this._enabled = !1;
  }
  enable() {
    this._enabled = !0;
  }
  get selectionStart() {
    return this._model.finalSelectionStart;
  }
  get selectionEnd() {
    return this._model.finalSelectionEnd;
  }
  get hasSelection() {
    let e = this._model.finalSelectionStart,
      i = this._model.finalSelectionEnd;
    return !e || !i ? !1 : e[0] !== i[0] || e[1] !== i[1];
  }
  get selectionText() {
    let e = this._model.finalSelectionStart,
      i = this._model.finalSelectionEnd;
    if (!e || !i) return "";
    let r = this._bufferService.buffer,
      n = [];
    if (this._activeSelectionMode === 3) {
      if (e[0] === i[0]) return "";
      let l = e[0] < i[0] ? e[0] : i[0],
        a = e[0] < i[0] ? i[0] : e[0];
      for (let u = e[1]; u <= i[1]; u++) {
        let h = r.translateBufferLineToString(u, !0, l, a);
        n.push(h);
      }
    } else {
      let l = e[1] === i[1] ? i[0] : void 0;
      n.push(r.translateBufferLineToString(e[1], !0, e[0], l));
      for (let a = e[1] + 1; a <= i[1] - 1; a++) {
        let u = r.lines.get(a),
          h = r.translateBufferLineToString(a, !0);
        u?.isWrapped ? n[n.length - 1] += h : n.push(h);
      }
      if (e[1] !== i[1]) {
        let a = r.lines.get(i[1]),
          u = r.translateBufferLineToString(i[1], !0, 0, i[0]);
        a && a.isWrapped ? n[n.length - 1] += u : n.push(u);
      }
    }
    return n.map(l => l.replace(Ja, " ")).join(Es ? `\r
` : `
`);
  }
  clearSelection() {
    this._model.clearSelection(), this._removeMouseDownListeners(), this.refresh(), this._onSelectionChange.fire();
  }
  refresh(e) {
    this._refreshAnimationFrame || (this._refreshAnimationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._refresh())), Bi && e && this.selectionText.length && this._onLinuxMouseSelection.fire(this.selectionText);
  }
  _refresh() {
    this._refreshAnimationFrame = void 0, this._onRedrawRequest.fire({
      start: this._model.finalSelectionStart,
      end: this._model.finalSelectionEnd,
      columnSelectMode: this._activeSelectionMode === 3
    });
  }
  _isClickInSelection(e) {
    let i = this._getMouseBufferCoords(e),
      r = this._model.finalSelectionStart,
      n = this._model.finalSelectionEnd;
    return !r || !n || !i ? !1 : this._areCoordsInSelection(i, r, n);
  }
  isCellInSelection(e, i) {
    let r = this._model.finalSelectionStart,
      n = this._model.finalSelectionEnd;
    return !r || !n ? !1 : this._areCoordsInSelection([e, i], r, n);
  }
  _areCoordsInSelection(e, i, r) {
    return e[1] > i[1] && e[1] < r[1] || i[1] === r[1] && e[1] === i[1] && e[0] >= i[0] && e[0] < r[0] || i[1] < r[1] && e[1] === r[1] && e[0] < r[0] || i[1] < r[1] && e[1] === i[1] && e[0] >= i[0];
  }
  _selectWordAtCursor(e, i) {
    let r = this._linkifier.currentLink?.link?.range;
    if (r) return this._model.selectionStart = [r.start.x - 1, r.start.y - 1], this._model.selectionStartLength = ws(r, this._bufferService.cols), this._model.selectionEnd = void 0, !0;
    let n = this._getMouseBufferCoords(e);
    return n ? (this._selectWordAt(n, i), this._model.selectionEnd = void 0, !0) : !1;
  }
  selectAll() {
    this._model.isSelectAllActive = !0, this.refresh(), this._onSelectionChange.fire();
  }
  selectLines(e, i) {
    this._model.clearSelection(), e = Math.max(e, 0), i = Math.min(i, this._bufferService.buffer.lines.length - 1), this._model.selectionStart = [0, e], this._model.selectionEnd = [this._bufferService.cols, i], this.refresh(), this._onSelectionChange.fire();
  }
  _handleTrim(e) {
    this._model.handleTrim(e) && this.refresh();
  }
  _getMouseBufferCoords(e) {
    let i = this._mouseService.getCoords(e, this._screenElement, this._bufferService.cols, this._bufferService.rows, !0);
    if (i) return i[0]--, i[1]--, i[1] += this._bufferService.buffer.ydisp, i;
  }
  _getMouseEventScrollAmount(e) {
    let i = Ci(this._coreBrowserService.window, e, this._screenElement)[1],
      r = this._renderService.dimensions.css.canvas.height;
    return i >= 0 && i <= r ? 0 : (i > r && (i -= r), i = Math.min(Math.max(i, -Ds), Ds), i /= Ds, i / Math.abs(i) + Math.round(i * (Ya - 1)));
  }
  shouldForceSelection(e) {
    return Zt ? e.altKey && this._optionsService.rawOptions.macOptionClickForcesSelection : e.shiftKey;
  }
  handleMouseDown(e) {
    if (this._mouseDownTimeStamp = e.timeStamp, !(e.button === 2 && this.hasSelection) && e.button === 0) {
      if (!this._enabled) {
        if (!this.shouldForceSelection(e)) return;
        e.stopPropagation();
      }
      e.preventDefault(), this._dragScrollAmount = 0, this._enabled && e.shiftKey ? this._handleIncrementalClick(e) : e.detail === 1 ? this._handleSingleClick(e) : e.detail === 2 ? this._handleDoubleClick(e) : e.detail === 3 && this._handleTripleClick(e), this._addMouseDownListeners(), this.refresh(!0);
    }
  }
  _addMouseDownListeners() {
    this._screenElement.ownerDocument && (this._screenElement.ownerDocument.addEventListener("mousemove", this._mouseMoveListener), this._screenElement.ownerDocument.addEventListener("mouseup", this._mouseUpListener)), this._dragScrollIntervalTimer = this._coreBrowserService.window.setInterval(() => this._dragScroll(), ja);
  }
  _removeMouseDownListeners() {
    this._screenElement.ownerDocument && (this._screenElement.ownerDocument.removeEventListener("mousemove", this._mouseMoveListener), this._screenElement.ownerDocument.removeEventListener("mouseup", this._mouseUpListener)), this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer), this._dragScrollIntervalTimer = void 0;
  }
  _handleIncrementalClick(e) {
    this._model.selectionStart && (this._model.selectionEnd = this._getMouseBufferCoords(e));
  }
  _handleSingleClick(e) {
    if (this._model.selectionStartLength = 0, this._model.isSelectAllActive = !1, this._activeSelectionMode = this.shouldColumnSelect(e) ? 3 : 0, this._model.selectionStart = this._getMouseBufferCoords(e), !this._model.selectionStart) return;
    this._model.selectionEnd = void 0;
    let i = this._bufferService.buffer.lines.get(this._model.selectionStart[1]);
    i && i.length !== this._model.selectionStart[0] && i.hasWidth(this._model.selectionStart[0]) === 0 && this._model.selectionStart[0]++;
  }
  _handleDoubleClick(e) {
    this._selectWordAtCursor(e, !0) && (this._activeSelectionMode = 1);
  }
  _handleTripleClick(e) {
    let i = this._getMouseBufferCoords(e);
    i && (this._activeSelectionMode = 2, this._selectLineAt(i[1]));
  }
  shouldColumnSelect(e) {
    return e.altKey && !(Zt && this._optionsService.rawOptions.macOptionClickForcesSelection);
  }
  _handleMouseMove(e) {
    if (e.stopImmediatePropagation(), !this._model.selectionStart) return;
    let i = this._model.selectionEnd ? [this._model.selectionEnd[0], this._model.selectionEnd[1]] : null;
    if (this._model.selectionEnd = this._getMouseBufferCoords(e), !this._model.selectionEnd) {
      this.refresh(!0);
      return;
    }
    this._activeSelectionMode === 2 ? this._model.selectionEnd[1] < this._model.selectionStart[1] ? this._model.selectionEnd[0] = 0 : this._model.selectionEnd[0] = this._bufferService.cols : this._activeSelectionMode === 1 && this._selectToWordAt(this._model.selectionEnd), this._dragScrollAmount = this._getMouseEventScrollAmount(e), this._activeSelectionMode !== 3 && (this._dragScrollAmount > 0 ? this._model.selectionEnd[0] = this._bufferService.cols : this._dragScrollAmount < 0 && (this._model.selectionEnd[0] = 0));
    let r = this._bufferService.buffer;
    if (this._model.selectionEnd[1] < r.lines.length) {
      let n = r.lines.get(this._model.selectionEnd[1]);
      n && n.hasWidth(this._model.selectionEnd[0]) === 0 && this._model.selectionEnd[0] < this._bufferService.cols && this._model.selectionEnd[0]++;
    }
    (!i || i[0] !== this._model.selectionEnd[0] || i[1] !== this._model.selectionEnd[1]) && this.refresh(!0);
  }
  _dragScroll() {
    if (!(!this._model.selectionEnd || !this._model.selectionStart) && this._dragScrollAmount) {
      this._onRequestScrollLines.fire({
        amount: this._dragScrollAmount,
        suppressScrollEvent: !1
      });
      let e = this._bufferService.buffer;
      this._dragScrollAmount > 0 ? (this._activeSelectionMode !== 3 && (this._model.selectionEnd[0] = this._bufferService.cols), this._model.selectionEnd[1] = Math.min(e.ydisp + this._bufferService.rows, e.lines.length - 1)) : (this._activeSelectionMode !== 3 && (this._model.selectionEnd[0] = 0), this._model.selectionEnd[1] = e.ydisp), this.refresh();
    }
  }
  _handleMouseUp(e) {
    let i = e.timeStamp - this._mouseDownTimeStamp;
    if (this._removeMouseDownListeners(), this.selectionText.length <= 1 && i < Xa && e.altKey && this._optionsService.rawOptions.altClickMovesCursor) {
      if (this._bufferService.buffer.ybase === this._bufferService.buffer.ydisp) {
        let r = this._mouseService.getCoords(e, this._element, this._bufferService.cols, this._bufferService.rows, !1);
        if (r && r[0] !== void 0 && r[1] !== void 0) {
          let n = Jo(r[0] - 1, r[1] - 1, this._bufferService, this._coreService.decPrivateModes.applicationCursorKeys);
          this._coreService.triggerDataEvent(n, !0);
        }
      }
    } else this._fireEventIfSelectionChanged();
  }
  _fireEventIfSelectionChanged() {
    let e = this._model.finalSelectionStart,
      i = this._model.finalSelectionEnd,
      r = !!e && !!i && (e[0] !== i[0] || e[1] !== i[1]);
    if (!r) {
      this._oldHasSelection && this._fireOnSelectionChange(e, i, r);
      return;
    }
    !e || !i || (!this._oldSelectionStart || !this._oldSelectionEnd || e[0] !== this._oldSelectionStart[0] || e[1] !== this._oldSelectionStart[1] || i[0] !== this._oldSelectionEnd[0] || i[1] !== this._oldSelectionEnd[1]) && this._fireOnSelectionChange(e, i, r);
  }
  _fireOnSelectionChange(e, i, r) {
    this._oldSelectionStart = e, this._oldSelectionEnd = i, this._oldHasSelection = r, this._onSelectionChange.fire();
  }
  _handleBufferActivate(e) {
    this.clearSelection(), this._trimListener.dispose(), this._trimListener = e.activeBuffer.lines.onTrim(i => this._handleTrim(i));
  }
  _convertViewportColToCharacterIndex(e, i) {
    let r = i;
    for (let n = 0; i >= n; n++) {
      let o = e.loadCell(n, this._workCell).getChars().length;
      this._workCell.getWidth() === 0 ? r-- : o > 1 && i !== n && (r += o - 1);
    }
    return r;
  }
  setSelection(e, i, r) {
    this._model.clearSelection(), this._removeMouseDownListeners(), this._model.selectionStart = [e, i], this._model.selectionStartLength = r, this.refresh(), this._fireEventIfSelectionChanged();
  }
  rightClickSelect(e) {
    this._isClickInSelection(e) || (this._selectWordAtCursor(e, !1) && this.refresh(!0), this._fireEventIfSelectionChanged());
  }
  _getWordAt(e, i, r = !0, n = !0) {
    if (e[0] >= this._bufferService.cols) return;
    let o = this._bufferService.buffer,
      l = o.lines.get(e[1]);
    if (!l) return;
    let a = o.translateBufferLineToString(e[1], !1),
      u = this._convertViewportColToCharacterIndex(l, e[0]),
      h = u,
      c = e[0] - u,
      d = 0,
      _ = 0,
      p = 0,
      m = 0;
    if (a.charAt(u) === " ") {
      for (; u > 0 && a.charAt(u - 1) === " ";) u--;
      for (; h < a.length && a.charAt(h + 1) === " ";) h++;
    } else {
      let R = e[0],
        O = e[0];
      l.getWidth(R) === 0 && (d++, R--), l.getWidth(O) === 2 && (_++, O++);
      let I = l.getString(O).length;
      for (I > 1 && (m += I - 1, h += I - 1); R > 0 && u > 0 && !this._isCharWordSeparator(l.loadCell(R - 1, this._workCell));) {
        l.loadCell(R - 1, this._workCell);
        let k = this._workCell.getChars().length;
        this._workCell.getWidth() === 0 ? (d++, R--) : k > 1 && (p += k - 1, u -= k - 1), u--, R--;
      }
      for (; O < l.length && h + 1 < a.length && !this._isCharWordSeparator(l.loadCell(O + 1, this._workCell));) {
        l.loadCell(O + 1, this._workCell);
        let k = this._workCell.getChars().length;
        this._workCell.getWidth() === 2 ? (_++, O++) : k > 1 && (m += k - 1, h += k - 1), h++, O++;
      }
    }
    h++;
    let f = u + c - d + p,
      A = Math.min(this._bufferService.cols, h - u + d + _ - p - m);
    if (!(!i && a.slice(u, h).trim() === "")) {
      if (r && f === 0 && l.getCodePoint(0) !== 32) {
        let R = o.lines.get(e[1] - 1);
        if (R && l.isWrapped && R.getCodePoint(this._bufferService.cols - 1) !== 32) {
          let O = this._getWordAt([this._bufferService.cols - 1, e[1] - 1], !1, !0, !1);
          if (O) {
            let I = this._bufferService.cols - O.start;
            f -= I, A += I;
          }
        }
      }
      if (n && f + A === this._bufferService.cols && l.getCodePoint(this._bufferService.cols - 1) !== 32) {
        let R = o.lines.get(e[1] + 1);
        if (R?.isWrapped && R.getCodePoint(0) !== 32) {
          let O = this._getWordAt([0, e[1] + 1], !1, !1, !0);
          O && (A += O.length);
        }
      }
      return {
        start: f,
        length: A
      };
    }
  }
  _selectWordAt(e, i) {
    let r = this._getWordAt(e, i);
    if (r) {
      for (; r.start < 0;) r.start += this._bufferService.cols, e[1]--;
      this._model.selectionStart = [r.start, e[1]], this._model.selectionStartLength = r.length;
    }
  }
  _selectToWordAt(e) {
    let i = this._getWordAt(e, !0);
    if (i) {
      let r = e[1];
      for (; i.start < 0;) i.start += this._bufferService.cols, r--;
      if (!this._model.areSelectionValuesReversed()) for (; i.start + i.length > this._bufferService.cols;) i.length -= this._bufferService.cols, r++;
      this._model.selectionEnd = [this._model.areSelectionValuesReversed() ? i.start : i.start + i.length, r];
    }
  }
  _isCharWordSeparator(e) {
    return e.getWidth() === 0 ? !1 : this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars()) >= 0;
  }
  _selectLineAt(e) {
    let i = this._bufferService.buffer.getWrappedRangeForLine(e),
      r = {
        start: {
          x: 0,
          y: i.first
        },
        end: {
          x: this._bufferService.cols - 1,
          y: i.last
        }
      };
    this._model.selectionStart = [0, i.first], this._model.selectionEnd = void 0, this._model.selectionStartLength = ws(r, this._bufferService.cols);
  }
};
ei = M([S(3, F), S(4, ge), S(5, Dt), S(6, H), S(7, ce), S(8, ae)], ei);
var Hi = class {
  constructor() {
    this._data = {};
  }
  set(t, e, i) {
    this._data[t] || (this._data[t] = {}), this._data[t][e] = i;
  }
  get(t, e) {
    return this._data[t] ? this._data[t][e] : void 0;
  }
  clear() {
    this._data = {};
  }
};
var Wi = class {
  constructor() {
    this._color = new Hi();
    this._css = new Hi();
  }
  setCss(t, e, i) {
    this._css.set(t, e, i);
  }
  getCss(t, e) {
    return this._css.get(t, e);
  }
  setColor(t, e, i) {
    this._color.set(t, e, i);
  }
  getColor(t, e) {
    return this._color.get(t, e);
  }
  clear() {
    this._color.clear(), this._css.clear();
  }
};
var re = Object.freeze((() => {
  let s = [z.toColor("#2e3436"), z.toColor("#cc0000"), z.toColor("#4e9a06"), z.toColor("#c4a000"), z.toColor("#3465a4"), z.toColor("#75507b"), z.toColor("#06989a"), z.toColor("#d3d7cf"), z.toColor("#555753"), z.toColor("#ef2929"), z.toColor("#8ae234"), z.toColor("#fce94f"), z.toColor("#729fcf"), z.toColor("#ad7fa8"), z.toColor("#34e2e2"), z.toColor("#eeeeec")],
    t = [0, 95, 135, 175, 215, 255];
  for (let e = 0; e < 216; e++) {
    let i = t[e / 36 % 6 | 0],
      r = t[e / 6 % 6 | 0],
      n = t[e % 6];
    s.push({
      css: j.toCss(i, r, n),
      rgba: j.toRgba(i, r, n)
    });
  }
  for (let e = 0; e < 24; e++) {
    let i = 8 + e * 10;
    s.push({
      css: j.toCss(i, i, i),
      rgba: j.toRgba(i, i, i)
    });
  }
  return s;
})());
var St = z.toColor("#ffffff"),
  Ki = z.toColor("#000000"),
  tl = z.toColor("#ffffff"),
  il = Ki,
  Ui = {
    css: "rgba(255, 255, 255, 0.3)",
    rgba: 4294967117
  },
  Qa = St,
  ti = class extends D {
    constructor(e) {
      super();
      this._optionsService = e;
      this._contrastCache = new Wi();
      this._halfContrastCache = new Wi();
      this._onChangeColors = this._register(new v());
      this.onChangeColors = this._onChangeColors.event;
      this._colors = {
        foreground: St,
        background: Ki,
        cursor: tl,
        cursorAccent: il,
        selectionForeground: void 0,
        selectionBackgroundTransparent: Ui,
        selectionBackgroundOpaque: U.blend(Ki, Ui),
        selectionInactiveBackgroundTransparent: Ui,
        selectionInactiveBackgroundOpaque: U.blend(Ki, Ui),
        scrollbarSliderBackground: U.opacity(St, .2),
        scrollbarSliderHoverBackground: U.opacity(St, .4),
        scrollbarSliderActiveBackground: U.opacity(St, .5),
        overviewRulerBorder: St,
        ansi: re.slice(),
        contrastCache: this._contrastCache,
        halfContrastCache: this._halfContrastCache
      }, this._updateRestoreColors(), this._setTheme(this._optionsService.rawOptions.theme), this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio", () => this._contrastCache.clear())), this._register(this._optionsService.onSpecificOptionChange("theme", () => this._setTheme(this._optionsService.rawOptions.theme)));
    }
    get colors() {
      return this._colors;
    }
    _setTheme(e = {}) {
      let i = this._colors;
      if (i.foreground = K(e.foreground, St), i.background = K(e.background, Ki), i.cursor = U.blend(i.background, K(e.cursor, tl)), i.cursorAccent = U.blend(i.background, K(e.cursorAccent, il)), i.selectionBackgroundTransparent = K(e.selectionBackground, Ui), i.selectionBackgroundOpaque = U.blend(i.background, i.selectionBackgroundTransparent), i.selectionInactiveBackgroundTransparent = K(e.selectionInactiveBackground, i.selectionBackgroundTransparent), i.selectionInactiveBackgroundOpaque = U.blend(i.background, i.selectionInactiveBackgroundTransparent), i.selectionForeground = e.selectionForeground ? K(e.selectionForeground, ps) : void 0, i.selectionForeground === ps && (i.selectionForeground = void 0), U.isOpaque(i.selectionBackgroundTransparent) && (i.selectionBackgroundTransparent = U.opacity(i.selectionBackgroundTransparent, .3)), U.isOpaque(i.selectionInactiveBackgroundTransparent) && (i.selectionInactiveBackgroundTransparent = U.opacity(i.selectionInactiveBackgroundTransparent, .3)), i.scrollbarSliderBackground = K(e.scrollbarSliderBackground, U.opacity(i.foreground, .2)), i.scrollbarSliderHoverBackground = K(e.scrollbarSliderHoverBackground, U.opacity(i.foreground, .4)), i.scrollbarSliderActiveBackground = K(e.scrollbarSliderActiveBackground, U.opacity(i.foreground, .5)), i.overviewRulerBorder = K(e.overviewRulerBorder, Qa), i.ansi = re.slice(), i.ansi[0] = K(e.black, re[0]), i.ansi[1] = K(e.red, re[1]), i.ansi[2] = K(e.green, re[2]), i.ansi[3] = K(e.yellow, re[3]), i.ansi[4] = K(e.blue, re[4]), i.ansi[5] = K(e.magenta, re[5]), i.ansi[6] = K(e.cyan, re[6]), i.ansi[7] = K(e.white, re[7]), i.ansi[8] = K(e.brightBlack, re[8]), i.ansi[9] = K(e.brightRed, re[9]), i.ansi[10] = K(e.brightGreen, re[10]), i.ansi[11] = K(e.brightYellow, re[11]), i.ansi[12] = K(e.brightBlue, re[12]), i.ansi[13] = K(e.brightMagenta, re[13]), i.ansi[14] = K(e.brightCyan, re[14]), i.ansi[15] = K(e.brightWhite, re[15]), e.extendedAnsi) {
        let r = Math.min(i.ansi.length - 16, e.extendedAnsi.length);
        for (let n = 0; n < r; n++) i.ansi[n + 16] = K(e.extendedAnsi[n], re[n + 16]);
      }
      this._contrastCache.clear(), this._halfContrastCache.clear(), this._updateRestoreColors(), this._onChangeColors.fire(this.colors);
    }
    restoreColor(e) {
      this._restoreColor(e), this._onChangeColors.fire(this.colors);
    }
    _restoreColor(e) {
      if (e === void 0) {
        for (let i = 0; i < this._restoreColors.ansi.length; ++i) this._colors.ansi[i] = this._restoreColors.ansi[i];
        return;
      }
      switch (e) {
        case 256:
          this._colors.foreground = this._restoreColors.foreground;
          break;
        case 257:
          this._colors.background = this._restoreColors.background;
          break;
        case 258:
          this._colors.cursor = this._restoreColors.cursor;
          break;
        default:
          this._colors.ansi[e] = this._restoreColors.ansi[e];
      }
    }
    modifyColors(e) {
      e(this._colors), this._onChangeColors.fire(this.colors);
    }
    _updateRestoreColors() {
      this._restoreColors = {
        foreground: this._colors.foreground,
        background: this._colors.background,
        cursor: this._colors.cursor,
        ansi: this._colors.ansi.slice()
      };
    }
  };
ti = M([S(0, H)], ti);
function K(s, t) {
  if (s !== void 0) try {
    return z.toColor(s);
  } catch {}
  return t;
}
var Rs = class {
    constructor(...t) {
      this._entries = new Map();
      for (let [e, i] of t) this.set(e, i);
    }
    set(t, e) {
      let i = this._entries.get(t);
      return this._entries.set(t, e), i;
    }
    forEach(t) {
      for (let [e, i] of this._entries.entries()) t(e, i);
    }
    has(t) {
      return this._entries.has(t);
    }
    get(t) {
      return this._entries.get(t);
    }
  },
  ln = class {
    constructor() {
      this._services = new Rs();
      this._services.set(xt, this);
    }
    setService(t, e) {
      this._services.set(t, e);
    }
    getService(t) {
      return this._services.get(t);
    }
    createInstance(t, ...e) {
      let i = Xs(t).sort((o, l) => o.index - l.index),
        r = [];
      for (let o of i) {
        let l = this._services.get(o.id);
        if (!l) throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${o.id._id}.`);
        r.push(l);
      }
      let n = i.length > 0 ? i[0].index : e.length;
      if (e.length !== n) throw new Error(`[createInstance] First service dependency of ${t.name} at position ${n + 1} conflicts with ${e.length} static arguments`);
      return new t(...e, ...r);
    }
  };
var ec = {
    trace: 0,
    debug: 1,
    info: 2,
    warn: 3,
    error: 4,
    off: 5
  },
  tc = "xterm.js: ",
  ii = class extends D {
    constructor(e) {
      super();
      this._optionsService = e;
      this._logLevel = 5;
      this._updateLogLevel(), this._register(this._optionsService.onSpecificOptionChange("logLevel", () => this._updateLogLevel())), ic = this;
    }
    get logLevel() {
      return this._logLevel;
    }
    _updateLogLevel() {
      this._logLevel = ec[this._optionsService.rawOptions.logLevel];
    }
    _evalLazyOptionalParams(e) {
      for (let i = 0; i < e.length; i++) typeof e[i] == "function" && (e[i] = e[i]());
    }
    _log(e, i, r) {
      this._evalLazyOptionalParams(r), e.call(console, (this._optionsService.options.logger ? "" : tc) + i, ...r);
    }
    trace(e, ...i) {
      this._logLevel <= 0 && this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger) ?? console.log, e, i);
    }
    debug(e, ...i) {
      this._logLevel <= 1 && this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger) ?? console.log, e, i);
    }
    info(e, ...i) {
      this._logLevel <= 2 && this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger) ?? console.info, e, i);
    }
    warn(e, ...i) {
      this._logLevel <= 3 && this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger) ?? console.warn, e, i);
    }
    error(e, ...i) {
      this._logLevel <= 4 && this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger) ?? console.error, e, i);
    }
  };
ii = M([S(0, H)], ii);
var ic;
var zi = class extends D {
  constructor(e) {
    super();
    this._maxLength = e;
    this.onDeleteEmitter = this._register(new v());
    this.onDelete = this.onDeleteEmitter.event;
    this.onInsertEmitter = this._register(new v());
    this.onInsert = this.onInsertEmitter.event;
    this.onTrimEmitter = this._register(new v());
    this.onTrim = this.onTrimEmitter.event;
    this._array = new Array(this._maxLength), this._startIndex = 0, this._length = 0;
  }
  get maxLength() {
    return this._maxLength;
  }
  set maxLength(e) {
    if (this._maxLength === e) return;
    let i = new Array(e);
    for (let r = 0; r < Math.min(e, this.length); r++) i[r] = this._array[this._getCyclicIndex(r)];
    this._array = i, this._maxLength = e, this._startIndex = 0;
  }
  get length() {
    return this._length;
  }
  set length(e) {
    if (e > this._length) for (let i = this._length; i < e; i++) this._array[i] = void 0;
    this._length = e;
  }
  get(e) {
    return this._array[this._getCyclicIndex(e)];
  }
  set(e, i) {
    this._array[this._getCyclicIndex(e)] = i;
  }
  push(e) {
    this._array[this._getCyclicIndex(this._length)] = e, this._length === this._maxLength ? (this._startIndex = ++this._startIndex % this._maxLength, this.onTrimEmitter.fire(1)) : this._length++;
  }
  recycle() {
    if (this._length !== this._maxLength) throw new Error("Can only recycle when the buffer is full");
    return this._startIndex = ++this._startIndex % this._maxLength, this.onTrimEmitter.fire(1), this._array[this._getCyclicIndex(this._length - 1)];
  }
  get isFull() {
    return this._length === this._maxLength;
  }
  pop() {
    return this._array[this._getCyclicIndex(this._length-- - 1)];
  }
  splice(e, i, ...r) {
    if (i) {
      for (let n = e; n < this._length - i; n++) this._array[this._getCyclicIndex(n)] = this._array[this._getCyclicIndex(n + i)];
      this._length -= i, this.onDeleteEmitter.fire({
        index: e,
        amount: i
      });
    }
    for (let n = this._length - 1; n >= e; n--) this._array[this._getCyclicIndex(n + r.length)] = this._array[this._getCyclicIndex(n)];
    for (let n = 0; n < r.length; n++) this._array[this._getCyclicIndex(e + n)] = r[n];
    if (r.length && this.onInsertEmitter.fire({
      index: e,
      amount: r.length
    }), this._length + r.length > this._maxLength) {
      let n = this._length + r.length - this._maxLength;
      this._startIndex += n, this._length = this._maxLength, this.onTrimEmitter.fire(n);
    } else this._length += r.length;
  }
  trimStart(e) {
    e > this._length && (e = this._length), this._startIndex += e, this._length -= e, this.onTrimEmitter.fire(e);
  }
  shiftElements(e, i, r) {
    if (!(i <= 0)) {
      if (e < 0 || e >= this._length) throw new Error("start argument out of range");
      if (e + r < 0) throw new Error("Cannot shift elements in list beyond index 0");
      if (r > 0) {
        for (let o = i - 1; o >= 0; o--) this.set(e + o + r, this.get(e + o));
        let n = e + i + r - this._length;
        if (n > 0) for (this._length += n; this._length > this._maxLength;) this._length--, this._startIndex++, this.onTrimEmitter.fire(1);
      } else for (let n = 0; n < i; n++) this.set(e + n + r, this.get(e + n));
    }
  }
  _getCyclicIndex(e) {
    return (this._startIndex + e) % this._maxLength;
  }
};
var B = 3;
var X = Object.freeze(new De()),
  an = 0,
  Ls = 2,
  Ze = class s {
    constructor(t, e, i = !1) {
      this.isWrapped = i;
      this._combined = {};
      this._extendedAttrs = {};
      this._data = new Uint32Array(t * B);
      let r = e || q.fromCharData([0, ir, 1, 0]);
      for (let n = 0; n < t; ++n) this.setCell(n, r);
      this.length = t;
    }
    get(t) {
      let e = this._data[t * B + 0],
        i = e & 2097151;
      return [this._data[t * B + 1], e & 2097152 ? this._combined[t] : i ? Ce(i) : "", e >> 22, e & 2097152 ? this._combined[t].charCodeAt(this._combined[t].length - 1) : i];
    }
    set(t, e) {
      this._data[t * B + 1] = e[0], e[1].length > 1 ? (this._combined[t] = e[1], this._data[t * B + 0] = t | 2097152 | e[2] << 22) : this._data[t * B + 0] = e[1].charCodeAt(0) | e[2] << 22;
    }
    getWidth(t) {
      return this._data[t * B + 0] >> 22;
    }
    hasWidth(t) {
      return this._data[t * B + 0] & 12582912;
    }
    getFg(t) {
      return this._data[t * B + 1];
    }
    getBg(t) {
      return this._data[t * B + 2];
    }
    hasContent(t) {
      return this._data[t * B + 0] & 4194303;
    }
    getCodePoint(t) {
      let e = this._data[t * B + 0];
      return e & 2097152 ? this._combined[t].charCodeAt(this._combined[t].length - 1) : e & 2097151;
    }
    isCombined(t) {
      return this._data[t * B + 0] & 2097152;
    }
    getString(t) {
      let e = this._data[t * B + 0];
      return e & 2097152 ? this._combined[t] : e & 2097151 ? Ce(e & 2097151) : "";
    }
    isProtected(t) {
      return this._data[t * B + 2] & 536870912;
    }
    loadCell(t, e) {
      return an = t * B, e.content = this._data[an + 0], e.fg = this._data[an + 1], e.bg = this._data[an + 2], e.content & 2097152 && (e.combinedData = this._combined[t]), e.bg & 268435456 && (e.extended = this._extendedAttrs[t]), e;
    }
    setCell(t, e) {
      e.content & 2097152 && (this._combined[t] = e.combinedData), e.bg & 268435456 && (this._extendedAttrs[t] = e.extended), this._data[t * B + 0] = e.content, this._data[t * B + 1] = e.fg, this._data[t * B + 2] = e.bg;
    }
    setCellFromCodepoint(t, e, i, r) {
      r.bg & 268435456 && (this._extendedAttrs[t] = r.extended), this._data[t * B + 0] = e | i << 22, this._data[t * B + 1] = r.fg, this._data[t * B + 2] = r.bg;
    }
    addCodepointToCell(t, e, i) {
      let r = this._data[t * B + 0];
      r & 2097152 ? this._combined[t] += Ce(e) : r & 2097151 ? (this._combined[t] = Ce(r & 2097151) + Ce(e), r &= -2097152, r |= 2097152) : r = e | 1 << 22, i && (r &= -12582913, r |= i << 22), this._data[t * B + 0] = r;
    }
    insertCells(t, e, i) {
      if (t %= this.length, t && this.getWidth(t - 1) === 2 && this.setCellFromCodepoint(t - 1, 0, 1, i), e < this.length - t) {
        let r = new q();
        for (let n = this.length - t - e - 1; n >= 0; --n) this.setCell(t + e + n, this.loadCell(t + n, r));
        for (let n = 0; n < e; ++n) this.setCell(t + n, i);
      } else for (let r = t; r < this.length; ++r) this.setCell(r, i);
      this.getWidth(this.length - 1) === 2 && this.setCellFromCodepoint(this.length - 1, 0, 1, i);
    }
    deleteCells(t, e, i) {
      if (t %= this.length, e < this.length - t) {
        let r = new q();
        for (let n = 0; n < this.length - t - e; ++n) this.setCell(t + n, this.loadCell(t + e + n, r));
        for (let n = this.length - e; n < this.length; ++n) this.setCell(n, i);
      } else for (let r = t; r < this.length; ++r) this.setCell(r, i);
      t && this.getWidth(t - 1) === 2 && this.setCellFromCodepoint(t - 1, 0, 1, i), this.getWidth(t) === 0 && !this.hasContent(t) && this.setCellFromCodepoint(t, 0, 1, i);
    }
    replaceCells(t, e, i, r = !1) {
      if (r) {
        for (t && this.getWidth(t - 1) === 2 && !this.isProtected(t - 1) && this.setCellFromCodepoint(t - 1, 0, 1, i), e < this.length && this.getWidth(e - 1) === 2 && !this.isProtected(e) && this.setCellFromCodepoint(e, 0, 1, i); t < e && t < this.length;) this.isProtected(t) || this.setCell(t, i), t++;
        return;
      }
      for (t && this.getWidth(t - 1) === 2 && this.setCellFromCodepoint(t - 1, 0, 1, i), e < this.length && this.getWidth(e - 1) === 2 && this.setCellFromCodepoint(e, 0, 1, i); t < e && t < this.length;) this.setCell(t++, i);
    }
    resize(t, e) {
      if (t === this.length) return this._data.length * 4 * Ls < this._data.buffer.byteLength;
      let i = t * B;
      if (t > this.length) {
        if (this._data.buffer.byteLength >= i * 4) this._data = new Uint32Array(this._data.buffer, 0, i);else {
          let r = new Uint32Array(i);
          r.set(this._data), this._data = r;
        }
        for (let r = this.length; r < t; ++r) this.setCell(r, e);
      } else {
        this._data = this._data.subarray(0, i);
        let r = Object.keys(this._combined);
        for (let o = 0; o < r.length; o++) {
          let l = parseInt(r[o], 10);
          l >= t && delete this._combined[l];
        }
        let n = Object.keys(this._extendedAttrs);
        for (let o = 0; o < n.length; o++) {
          let l = parseInt(n[o], 10);
          l >= t && delete this._extendedAttrs[l];
        }
      }
      return this.length = t, i * 4 * Ls < this._data.buffer.byteLength;
    }
    cleanupMemory() {
      if (this._data.length * 4 * Ls < this._data.buffer.byteLength) {
        let t = new Uint32Array(this._data.length);
        return t.set(this._data), this._data = t, 1;
      }
      return 0;
    }
    fill(t, e = !1) {
      if (e) {
        for (let i = 0; i < this.length; ++i) this.isProtected(i) || this.setCell(i, t);
        return;
      }
      this._combined = {}, this._extendedAttrs = {};
      for (let i = 0; i < this.length; ++i) this.setCell(i, t);
    }
    copyFrom(t) {
      this.length !== t.length ? this._data = new Uint32Array(t._data) : this._data.set(t._data), this.length = t.length, this._combined = {};
      for (let e in t._combined) this._combined[e] = t._combined[e];
      this._extendedAttrs = {};
      for (let e in t._extendedAttrs) this._extendedAttrs[e] = t._extendedAttrs[e];
      this.isWrapped = t.isWrapped;
    }
    clone() {
      let t = new s(0);
      t._data = new Uint32Array(this._data), t.length = this.length;
      for (let e in this._combined) t._combined[e] = this._combined[e];
      for (let e in this._extendedAttrs) t._extendedAttrs[e] = this._extendedAttrs[e];
      return t.isWrapped = this.isWrapped, t;
    }
    getTrimmedLength() {
      for (let t = this.length - 1; t >= 0; --t) if (this._data[t * B + 0] & 4194303) return t + (this._data[t * B + 0] >> 22);
      return 0;
    }
    getNoBgTrimmedLength() {
      for (let t = this.length - 1; t >= 0; --t) if (this._data[t * B + 0] & 4194303 || this._data[t * B + 2] & 50331648) return t + (this._data[t * B + 0] >> 22);
      return 0;
    }
    copyCellsFrom(t, e, i, r, n) {
      let o = t._data;
      if (n) for (let a = r - 1; a >= 0; a--) {
        for (let u = 0; u < B; u++) this._data[(i + a) * B + u] = o[(e + a) * B + u];
        o[(e + a) * B + 2] & 268435456 && (this._extendedAttrs[i + a] = t._extendedAttrs[e + a]);
      } else for (let a = 0; a < r; a++) {
        for (let u = 0; u < B; u++) this._data[(i + a) * B + u] = o[(e + a) * B + u];
        o[(e + a) * B + 2] & 268435456 && (this._extendedAttrs[i + a] = t._extendedAttrs[e + a]);
      }
      let l = Object.keys(t._combined);
      for (let a = 0; a < l.length; a++) {
        let u = parseInt(l[a], 10);
        u >= e && (this._combined[u - e + i] = t._combined[u]);
      }
    }
    translateToString(t, e, i, r) {
      e = e ?? 0, i = i ?? this.length, t && (i = Math.min(i, this.getTrimmedLength())), r && (r.length = 0);
      let n = "";
      for (; e < i;) {
        let o = this._data[e * B + 0],
          l = o & 2097151,
          a = o & 2097152 ? this._combined[e] : l ? Ce(l) : we;
        if (n += a, r) for (let u = 0; u < a.length; ++u) r.push(e);
        e += o >> 22 || 1;
      }
      return r && r.push(e), n;
    }
  };
function sl(s, t, e, i, r, n) {
  let o = [];
  for (let l = 0; l < s.length - 1; l++) {
    let a = l,
      u = s.get(++a);
    if (!u.isWrapped) continue;
    let h = [s.get(l)];
    for (; a < s.length && u.isWrapped;) h.push(u), u = s.get(++a);
    if (!n && i >= l && i < a) {
      l += h.length - 1;
      continue;
    }
    let c = 0,
      d = ri(h, c, t),
      _ = 1,
      p = 0;
    for (; _ < h.length;) {
      let f = ri(h, _, t),
        A = f - p,
        R = e - d,
        O = Math.min(A, R);
      h[c].copyCellsFrom(h[_], p, d, O, !1), d += O, d === e && (c++, d = 0), p += O, p === f && (_++, p = 0), d === 0 && c !== 0 && h[c - 1].getWidth(e - 1) === 2 && (h[c].copyCellsFrom(h[c - 1], e - 1, d++, 1, !1), h[c - 1].setCell(e - 1, r));
    }
    h[c].replaceCells(d, e, r);
    let m = 0;
    for (let f = h.length - 1; f > 0 && (f > c || h[f].getTrimmedLength() === 0); f--) m++;
    m > 0 && (o.push(l + h.length - m), o.push(m)), l += h.length - 1;
  }
  return o;
}
function ol(s, t) {
  let e = [],
    i = 0,
    r = t[i],
    n = 0;
  for (let o = 0; o < s.length; o++) if (r === o) {
    let l = t[++i];
    s.onDeleteEmitter.fire({
      index: o - n,
      amount: l
    }), o += l - 1, n += l, r = t[++i];
  } else e.push(o);
  return {
    layout: e,
    countRemoved: n
  };
}
function ll(s, t) {
  let e = [];
  for (let i = 0; i < t.length; i++) e.push(s.get(t[i]));
  for (let i = 0; i < e.length; i++) s.set(i, e[i]);
  s.length = t.length;
}
function al(s, t, e) {
  let i = [],
    r = s.map((a, u) => ri(s, u, t)).reduce((a, u) => a + u),
    n = 0,
    o = 0,
    l = 0;
  for (; l < r;) {
    if (r - l < e) {
      i.push(r - l);
      break;
    }
    n += e;
    let a = ri(s, o, t);
    n > a && (n -= a, o++);
    let u = s[o].getWidth(n - 1) === 2;
    u && n--;
    let h = u ? e - 1 : e;
    i.push(h), l += h;
  }
  return i;
}
function ri(s, t, e) {
  if (t === s.length - 1) return s[t].getTrimmedLength();
  let i = !s[t].hasContent(e - 1) && s[t].getWidth(e - 1) === 1,
    r = s[t + 1].getWidth(0) === 2;
  return i && r ? e - 1 : e;
}
var un = class un {
  constructor(t) {
    this.line = t;
    this.isDisposed = !1;
    this._disposables = [];
    this._id = un._nextId++;
    this._onDispose = this.register(new v());
    this.onDispose = this._onDispose.event;
  }
  get id() {
    return this._id;
  }
  dispose() {
    this.isDisposed || (this.isDisposed = !0, this.line = -1, this._onDispose.fire(), Ne(this._disposables), this._disposables.length = 0);
  }
  register(t) {
    return this._disposables.push(t), t;
  }
};
un._nextId = 1;
var cn = un;
var ne = {},
  Je = ne.B;
ne[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"
};
ne.A = {
  "#": "\xA3"
};
ne.B = void 0;
ne[4] = {
  "#": "\xA3",
  "@": "\xBE",
  "[": "ij",
  "\\": "\xBD",
  "]": "|",
  "{": "\xA8",
  "|": "f",
  "}": "\xBC",
  "~": "\xB4"
};
ne.C = ne[5] = {
  "[": "\xC4",
  "\\": "\xD6",
  "]": "\xC5",
  "^": "\xDC",
  "`": "\xE9",
  "{": "\xE4",
  "|": "\xF6",
  "}": "\xE5",
  "~": "\xFC"
};
ne.R = {
  "#": "\xA3",
  "@": "\xE0",
  "[": "\xB0",
  "\\": "\xE7",
  "]": "\xA7",
  "{": "\xE9",
  "|": "\xF9",
  "}": "\xE8",
  "~": "\xA8"
};
ne.Q = {
  "@": "\xE0",
  "[": "\xE2",
  "\\": "\xE7",
  "]": "\xEA",
  "^": "\xEE",
  "`": "\xF4",
  "{": "\xE9",
  "|": "\xF9",
  "}": "\xE8",
  "~": "\xFB"
};
ne.K = {
  "@": "\xA7",
  "[": "\xC4",
  "\\": "\xD6",
  "]": "\xDC",
  "{": "\xE4",
  "|": "\xF6",
  "}": "\xFC",
  "~": "\xDF"
};
ne.Y = {
  "#": "\xA3",
  "@": "\xA7",
  "[": "\xB0",
  "\\": "\xE7",
  "]": "\xE9",
  "`": "\xF9",
  "{": "\xE0",
  "|": "\xF2",
  "}": "\xE8",
  "~": "\xEC"
};
ne.E = ne[6] = {
  "@": "\xC4",
  "[": "\xC6",
  "\\": "\xD8",
  "]": "\xC5",
  "^": "\xDC",
  "`": "\xE4",
  "{": "\xE6",
  "|": "\xF8",
  "}": "\xE5",
  "~": "\xFC"
};
ne.Z = {
  "#": "\xA3",
  "@": "\xA7",
  "[": "\xA1",
  "\\": "\xD1",
  "]": "\xBF",
  "{": "\xB0",
  "|": "\xF1",
  "}": "\xE7"
};
ne.H = ne[7] = {
  "@": "\xC9",
  "[": "\xC4",
  "\\": "\xD6",
  "]": "\xC5",
  "^": "\xDC",
  "`": "\xE9",
  "{": "\xE4",
  "|": "\xF6",
  "}": "\xE5",
  "~": "\xFC"
};
ne["="] = {
  "#": "\xF9",
  "@": "\xE0",
  "[": "\xE9",
  "\\": "\xE7",
  "]": "\xEA",
  "^": "\xEE",
  _: "\xE8",
  "`": "\xF4",
  "{": "\xE4",
  "|": "\xF6",
  "}": "\xFC",
  "~": "\xFB"
};
var cl = 4294967295,
  $i = class {
    constructor(t, e, i) {
      this._hasScrollback = t;
      this._optionsService = e;
      this._bufferService = i;
      this.ydisp = 0;
      this.ybase = 0;
      this.y = 0;
      this.x = 0;
      this.tabs = {};
      this.savedY = 0;
      this.savedX = 0;
      this.savedCurAttrData = X.clone();
      this.savedCharset = Je;
      this.markers = [];
      this._nullCell = q.fromCharData([0, ir, 1, 0]);
      this._whitespaceCell = q.fromCharData([0, we, 1, 32]);
      this._isClearing = !1;
      this._memoryCleanupQueue = new Jt();
      this._memoryCleanupPosition = 0;
      this._cols = this._bufferService.cols, this._rows = this._bufferService.rows, this.lines = new zi(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops();
    }
    getNullCell(t) {
      return t ? (this._nullCell.fg = t.fg, this._nullCell.bg = t.bg, this._nullCell.extended = t.extended) : (this._nullCell.fg = 0, this._nullCell.bg = 0, this._nullCell.extended = new rt()), this._nullCell;
    }
    getWhitespaceCell(t) {
      return t ? (this._whitespaceCell.fg = t.fg, this._whitespaceCell.bg = t.bg, this._whitespaceCell.extended = t.extended) : (this._whitespaceCell.fg = 0, this._whitespaceCell.bg = 0, this._whitespaceCell.extended = new rt()), this._whitespaceCell;
    }
    getBlankLine(t, e) {
      return new Ze(this._bufferService.cols, this.getNullCell(t), e);
    }
    get hasScrollback() {
      return this._hasScrollback && this.lines.maxLength > this._rows;
    }
    get isCursorInViewport() {
      let e = this.ybase + this.y - this.ydisp;
      return e >= 0 && e < this._rows;
    }
    _getCorrectBufferLength(t) {
      if (!this._hasScrollback) return t;
      let e = t + this._optionsService.rawOptions.scrollback;
      return e > cl ? cl : e;
    }
    fillViewportRows(t) {
      if (this.lines.length === 0) {
        t === void 0 && (t = X);
        let e = this._rows;
        for (; e--;) this.lines.push(this.getBlankLine(t));
      }
    }
    clear() {
      this.ydisp = 0, this.ybase = 0, this.y = 0, this.x = 0, this.lines = new zi(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops();
    }
    resize(t, e) {
      let i = this.getNullCell(X),
        r = 0,
        n = this._getCorrectBufferLength(e);
      if (n > this.lines.maxLength && (this.lines.maxLength = n), this.lines.length > 0) {
        if (this._cols < t) for (let l = 0; l < this.lines.length; l++) r += +this.lines.get(l).resize(t, i);
        let o = 0;
        if (this._rows < e) for (let l = this._rows; l < e; l++) this.lines.length < e + this.ybase && (this._optionsService.rawOptions.windowsMode || this._optionsService.rawOptions.windowsPty.backend !== void 0 || this._optionsService.rawOptions.windowsPty.buildNumber !== void 0 ? this.lines.push(new Ze(t, i)) : this.ybase > 0 && this.lines.length <= this.ybase + this.y + o + 1 ? (this.ybase--, o++, this.ydisp > 0 && this.ydisp--) : this.lines.push(new Ze(t, i)));else for (let l = this._rows; l > e; l--) this.lines.length > e + this.ybase && (this.lines.length > this.ybase + this.y + 1 ? this.lines.pop() : (this.ybase++, this.ydisp++));
        if (n < this.lines.maxLength) {
          let l = this.lines.length - n;
          l > 0 && (this.lines.trimStart(l), this.ybase = Math.max(this.ybase - l, 0), this.ydisp = Math.max(this.ydisp - l, 0), this.savedY = Math.max(this.savedY - l, 0)), this.lines.maxLength = n;
        }
        this.x = Math.min(this.x, t - 1), this.y = Math.min(this.y, e - 1), o && (this.y += o), this.savedX = Math.min(this.savedX, t - 1), this.scrollTop = 0;
      }
      if (this.scrollBottom = e - 1, this._isReflowEnabled && (this._reflow(t, e), this._cols > t)) for (let o = 0; o < this.lines.length; o++) r += +this.lines.get(o).resize(t, i);
      this._cols = t, this._rows = e, this._memoryCleanupQueue.clear(), r > .1 * this.lines.length && (this._memoryCleanupPosition = 0, this._memoryCleanupQueue.enqueue(() => this._batchedMemoryCleanup()));
    }
    _batchedMemoryCleanup() {
      let t = !0;
      this._memoryCleanupPosition >= this.lines.length && (this._memoryCleanupPosition = 0, t = !1);
      let e = 0;
      for (; this._memoryCleanupPosition < this.lines.length;) if (e += this.lines.get(this._memoryCleanupPosition++).cleanupMemory(), e > 100) return !0;
      return t;
    }
    get _isReflowEnabled() {
      let t = this._optionsService.rawOptions.windowsPty;
      return t && t.buildNumber ? this._hasScrollback && t.backend === "conpty" && t.buildNumber >= 21376 : this._hasScrollback && !this._optionsService.rawOptions.windowsMode;
    }
    _reflow(t, e) {
      this._cols !== t && (t > this._cols ? this._reflowLarger(t, e) : this._reflowSmaller(t, e));
    }
    _reflowLarger(t, e) {
      let i = this._optionsService.rawOptions.reflowCursorLine,
        r = sl(this.lines, this._cols, t, this.ybase + this.y, this.getNullCell(X), i);
      if (r.length > 0) {
        let n = ol(this.lines, r);
        ll(this.lines, n.layout), this._reflowLargerAdjustViewport(t, e, n.countRemoved);
      }
    }
    _reflowLargerAdjustViewport(t, e, i) {
      let r = this.getNullCell(X),
        n = i;
      for (; n-- > 0;) this.ybase === 0 ? (this.y > 0 && this.y--, this.lines.length < e && this.lines.push(new Ze(t, r))) : (this.ydisp === this.ybase && this.ydisp--, this.ybase--);
      this.savedY = Math.max(this.savedY - i, 0);
    }
    _reflowSmaller(t, e) {
      let i = this._optionsService.rawOptions.reflowCursorLine,
        r = this.getNullCell(X),
        n = [],
        o = 0;
      for (let l = this.lines.length - 1; l >= 0; l--) {
        let a = this.lines.get(l);
        if (!a || !a.isWrapped && a.getTrimmedLength() <= t) continue;
        let u = [a];
        for (; a.isWrapped && l > 0;) a = this.lines.get(--l), u.unshift(a);
        if (!i) {
          let I = this.ybase + this.y;
          if (I >= l && I < l + u.length) continue;
        }
        let h = u[u.length - 1].getTrimmedLength(),
          c = al(u, this._cols, t),
          d = c.length - u.length,
          _;
        this.ybase === 0 && this.y !== this.lines.length - 1 ? _ = Math.max(0, this.y - this.lines.maxLength + d) : _ = Math.max(0, this.lines.length - this.lines.maxLength + d);
        let p = [];
        for (let I = 0; I < d; I++) {
          let k = this.getBlankLine(X, !0);
          p.push(k);
        }
        p.length > 0 && (n.push({
          start: l + u.length + o,
          newLines: p
        }), o += p.length), u.push(...p);
        let m = c.length - 1,
          f = c[m];
        f === 0 && (m--, f = c[m]);
        let A = u.length - d - 1,
          R = h;
        for (; A >= 0;) {
          let I = Math.min(R, f);
          if (u[m] === void 0) break;
          if (u[m].copyCellsFrom(u[A], R - I, f - I, I, !0), f -= I, f === 0 && (m--, f = c[m]), R -= I, R === 0) {
            A--;
            let k = Math.max(A, 0);
            R = ri(u, k, this._cols);
          }
        }
        for (let I = 0; I < u.length; I++) c[I] < t && u[I].setCell(c[I], r);
        let O = d - _;
        for (; O-- > 0;) this.ybase === 0 ? this.y < e - 1 ? (this.y++, this.lines.pop()) : (this.ybase++, this.ydisp++) : this.ybase < Math.min(this.lines.maxLength, this.lines.length + o) - e && (this.ybase === this.ydisp && this.ydisp++, this.ybase++);
        this.savedY = Math.min(this.savedY + d, this.ybase + e - 1);
      }
      if (n.length > 0) {
        let l = [],
          a = [];
        for (let f = 0; f < this.lines.length; f++) a.push(this.lines.get(f));
        let u = this.lines.length,
          h = u - 1,
          c = 0,
          d = n[c];
        this.lines.length = Math.min(this.lines.maxLength, this.lines.length + o);
        let _ = 0;
        for (let f = Math.min(this.lines.maxLength - 1, u + o - 1); f >= 0; f--) if (d && d.start > h + _) {
          for (let A = d.newLines.length - 1; A >= 0; A--) this.lines.set(f--, d.newLines[A]);
          f++, l.push({
            index: h + 1,
            amount: d.newLines.length
          }), _ += d.newLines.length, d = n[++c];
        } else this.lines.set(f, a[h--]);
        let p = 0;
        for (let f = l.length - 1; f >= 0; f--) l[f].index += p, this.lines.onInsertEmitter.fire(l[f]), p += l[f].amount;
        let m = Math.max(0, u + o - this.lines.maxLength);
        m > 0 && this.lines.onTrimEmitter.fire(m);
      }
    }
    translateBufferLineToString(t, e, i = 0, r) {
      let n = this.lines.get(t);
      return n ? n.translateToString(e, i, r) : "";
    }
    getWrappedRangeForLine(t) {
      let e = t,
        i = t;
      for (; e > 0 && this.lines.get(e).isWrapped;) e--;
      for (; i + 1 < this.lines.length && this.lines.get(i + 1).isWrapped;) i++;
      return {
        first: e,
        last: i
      };
    }
    setupTabStops(t) {
      for (t != null ? this.tabs[t] || (t = this.prevStop(t)) : (this.tabs = {}, t = 0); t < this._cols; t += this._optionsService.rawOptions.tabStopWidth) this.tabs[t] = !0;
    }
    prevStop(t) {
      for (t == null && (t = this.x); !this.tabs[--t] && t > 0;);
      return t >= this._cols ? this._cols - 1 : t < 0 ? 0 : t;
    }
    nextStop(t) {
      for (t == null && (t = this.x); !this.tabs[++t] && t < this._cols;);
      return t >= this._cols ? this._cols - 1 : t < 0 ? 0 : t;
    }
    clearMarkers(t) {
      this._isClearing = !0;
      for (let e = 0; e < this.markers.length; e++) this.markers[e].line === t && (this.markers[e].dispose(), this.markers.splice(e--, 1));
      this._isClearing = !1;
    }
    clearAllMarkers() {
      this._isClearing = !0;
      for (let t = 0; t < this.markers.length; t++) this.markers[t].dispose();
      this.markers.length = 0, this._isClearing = !1;
    }
    addMarker(t) {
      let e = new cn(t);
      return this.markers.push(e), e.register(this.lines.onTrim(i => {
        e.line -= i, e.line < 0 && e.dispose();
      })), e.register(this.lines.onInsert(i => {
        e.line >= i.index && (e.line += i.amount);
      })), e.register(this.lines.onDelete(i => {
        e.line >= i.index && e.line < i.index + i.amount && e.dispose(), e.line > i.index && (e.line -= i.amount);
      })), e.register(e.onDispose(() => this._removeMarker(e))), e;
    }
    _removeMarker(t) {
      this._isClearing || this.markers.splice(this.markers.indexOf(t), 1);
    }
  };
var hn = class extends D {
  constructor(e, i) {
    super();
    this._optionsService = e;
    this._bufferService = i;
    this._onBufferActivate = this._register(new v());
    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 $i(!0, this._optionsService, this._bufferService), this._normal.fillViewportRows(), this._alt = new $i(!1, this._optionsService, this._bufferService), this._activeBuffer = this._normal, this._onBufferActivate.fire({
      activeBuffer: this._normal,
      inactiveBuffer: this._alt
    }), this.setupTabStops();
  }
  get alt() {
    return this._alt;
  }
  get active() {
    return this._activeBuffer;
  }
  get normal() {
    return this._normal;
  }
  activateNormalBuffer() {
    this._activeBuffer !== this._normal && (this._normal.x = this._alt.x, this._normal.y = this._alt.y, this._alt.clearAllMarkers(), this._alt.clear(), this._activeBuffer = this._normal, this._onBufferActivate.fire({
      activeBuffer: this._normal,
      inactiveBuffer: this._alt
    }));
  }
  activateAltBuffer(e) {
    this._activeBuffer !== this._alt && (this._alt.fillViewportRows(e), this._alt.x = this._normal.x, this._alt.y = this._normal.y, this._activeBuffer = this._alt, this._onBufferActivate.fire({
      activeBuffer: this._alt,
      inactiveBuffer: this._normal
    }));
  }
  resize(e, i) {
    this._normal.resize(e, i), this._alt.resize(e, i), this.setupTabStops(e);
  }
  setupTabStops(e) {
    this._normal.setupTabStops(e), this._alt.setupTabStops(e);
  }
};
var ks = 2,
  Cs = 1,
  ni = class extends D {
    constructor(e) {
      super();
      this.isUserScrolling = !1;
      this._onResize = this._register(new v());
      this.onResize = this._onResize.event;
      this._onScroll = this._register(new v());
      this.onScroll = this._onScroll.event;
      this.cols = Math.max(e.rawOptions.cols || 0, ks), this.rows = Math.max(e.rawOptions.rows || 0, Cs), this.buffers = this._register(new hn(e, this)), this._register(this.buffers.onBufferActivate(i => {
        this._onScroll.fire(i.activeBuffer.ydisp);
      }));
    }
    get buffer() {
      return this.buffers.active;
    }
    resize(e, i) {
      let r = this.cols !== e,
        n = this.rows !== i;
      this.cols = e, this.rows = i, this.buffers.resize(e, i), this._onResize.fire({
        cols: e,
        rows: i,
        colsChanged: r,
        rowsChanged: n
      });
    }
    reset() {
      this.buffers.reset(), this.isUserScrolling = !1;
    }
    scroll(e, i = !1) {
      let r = this.buffer,
        n;
      n = this._cachedBlankLine, (!n || n.length !== this.cols || n.getFg(0) !== e.fg || n.getBg(0) !== e.bg) && (n = r.getBlankLine(e, i), this._cachedBlankLine = n), n.isWrapped = i;
      let o = r.ybase + r.scrollTop,
        l = r.ybase + r.scrollBottom;
      if (r.scrollTop === 0) {
        let a = r.lines.isFull;
        l === r.lines.length - 1 ? a ? r.lines.recycle().copyFrom(n) : r.lines.push(n.clone()) : r.lines.splice(l + 1, 0, n.clone()), a ? this.isUserScrolling && (r.ydisp = Math.max(r.ydisp - 1, 0)) : (r.ybase++, this.isUserScrolling || r.ydisp++);
      } else {
        let a = l - o + 1;
        r.lines.shiftElements(o + 1, a - 1, -1), r.lines.set(l, n.clone());
      }
      this.isUserScrolling || (r.ydisp = r.ybase), this._onScroll.fire(r.ydisp);
    }
    scrollLines(e, i) {
      let r = this.buffer;
      if (e < 0) {
        if (r.ydisp === 0) return;
        this.isUserScrolling = !0;
      } else e + r.ydisp >= r.ybase && (this.isUserScrolling = !1);
      let n = r.ydisp;
      r.ydisp = Math.max(Math.min(r.ydisp + e, r.ybase), 0), n !== r.ydisp && (i || this._onScroll.fire(r.ydisp));
    }
  };
ni = M([S(0, H)], ni);
var si = {
    cols: 80,
    rows: 24,
    cursorBlink: !1,
    cursorStyle: "block",
    cursorWidth: 1,
    cursorInactiveStyle: "outline",
    customGlyphs: !0,
    drawBoldTextInBrightColors: !0,
    documentOverride: null,
    fastScrollModifier: "alt",
    fastScrollSensitivity: 5,
    fontFamily: "monospace",
    fontSize: 15,
    fontWeight: "normal",
    fontWeightBold: "bold",
    ignoreBracketedPasteMode: !1,
    lineHeight: 1,
    letterSpacing: 0,
    linkHandler: null,
    logLevel: "info",
    logger: null,
    scrollback: 1e3,
    scrollOnEraseInDisplay: !1,
    scrollOnUserInput: !0,
    scrollSensitivity: 1,
    screenReaderMode: !1,
    smoothScrollDuration: 0,
    macOptionIsMeta: !1,
    macOptionClickForcesSelection: !1,
    minimumContrastRatio: 1,
    disableStdin: !1,
    allowProposedApi: !1,
    allowTransparency: !1,
    tabStopWidth: 8,
    theme: {},
    reflowCursorLine: !1,
    rescaleOverlappingGlyphs: !1,
    rightClickSelectsWord: Zt,
    windowOptions: {},
    windowsMode: !1,
    windowsPty: {},
    wordSeparator: " ()[]{}',\"`",
    altClickMovesCursor: !0,
    convertEol: !1,
    termName: "xterm",
    cancelEvents: !1,
    overviewRuler: {}
  },
  nc = ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
  dn = class extends D {
    constructor(e) {
      super();
      this._onOptionChange = this._register(new v());
      this.onOptionChange = this._onOptionChange.event;
      let i = {
        ...si
      };
      for (let r in e) if (r in i) try {
        let n = e[r];
        i[r] = this._sanitizeAndValidateOption(r, n);
      } catch (n) {
        console.error(n);
      }
      this.rawOptions = i, this.options = {
        ...i
      }, this._setupOptions(), this._register(C(() => {
        this.rawOptions.linkHandler = null, this.rawOptions.documentOverride = null;
      }));
    }
    onSpecificOptionChange(e, i) {
      return this.onOptionChange(r => {
        r === e && i(this.rawOptions[e]);
      });
    }
    onMultipleOptionChange(e, i) {
      return this.onOptionChange(r => {
        e.indexOf(r) !== -1 && i();
      });
    }
    _setupOptions() {
      let e = r => {
          if (!(r in si)) throw new Error(`No option with key "${r}"`);
          return this.rawOptions[r];
        },
        i = (r, n) => {
          if (!(r in si)) throw new Error(`No option with key "${r}"`);
          n = this._sanitizeAndValidateOption(r, n), this.rawOptions[r] !== n && (this.rawOptions[r] = n, this._onOptionChange.fire(r));
        };
      for (let r in this.rawOptions) {
        let n = {
          get: e.bind(this, r),
          set: i.bind(this, r)
        };
        Object.defineProperty(this.options, r, n);
      }
    }
    _sanitizeAndValidateOption(e, i) {
      switch (e) {
        case "cursorStyle":
          if (i || (i = si[e]), !sc(i)) throw new Error(`"${i}" is not a valid value for ${e}`);
          break;
        case "wordSeparator":
          i || (i = si[e]);
          break;
        case "fontWeight":
        case "fontWeightBold":
          if (typeof i == "number" && 1 <= i && i <= 1e3) break;
          i = nc.includes(i) ? i : si[e];
          break;
        case "cursorWidth":
          i = Math.floor(i);
        case "lineHeight":
        case "tabStopWidth":
          if (i < 1) throw new Error(`${e} cannot be less than 1, value: ${i}`);
          break;
        case "minimumContrastRatio":
          i = Math.max(1, Math.min(21, Math.round(i * 10) / 10));
          break;
        case "scrollback":
          if (i = Math.min(i, 4294967295), i < 0) throw new Error(`${e} cannot be less than 0, value: ${i}`);
          break;
        case "fastScrollSensitivity":
        case "scrollSensitivity":
          if (i <= 0) throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);
          break;
        case "rows":
        case "cols":
          if (!i && i !== 0) throw new Error(`${e} must be numeric, value: ${i}`);
          break;
        case "windowsPty":
          i = i ?? {};
          break;
      }
      return i;
    }
  };
function sc(s) {
  return s === "block" || s === "underline" || s === "bar";
}
function oi(s, t = 5) {
  if (typeof s != "object") return s;
  let e = Array.isArray(s) ? [] : {};
  for (let i in s) e[i] = t <= 1 ? s[i] : s[i] && oi(s[i], t - 1);
  return e;
}
var ul = Object.freeze({
    insertMode: !1
  }),
  hl = Object.freeze({
    applicationCursorKeys: !1,
    applicationKeypad: !1,
    bracketedPasteMode: !1,
    cursorBlink: void 0,
    cursorStyle: void 0,
    origin: !1,
    reverseWraparound: !1,
    sendFocus: !1,
    synchronizedOutput: !1,
    wraparound: !0
  }),
  li = class extends D {
    constructor(e, i, r) {
      super();
      this._bufferService = e;
      this._logService = i;
      this._optionsService = r;
      this.isCursorInitialized = !1;
      this.isCursorHidden = !1;
      this._onData = this._register(new v());
      this.onData = this._onData.event;
      this._onUserInput = this._register(new v());
      this.onUserInput = this._onUserInput.event;
      this._onBinary = this._register(new v());
      this.onBinary = this._onBinary.event;
      this._onRequestScrollToBottom = this._register(new v());
      this.onRequestScrollToBottom = this._onRequestScrollToBottom.event;
      this.modes = oi(ul), this.decPrivateModes = oi(hl);
    }
    reset() {
      this.modes = oi(ul), this.decPrivateModes = oi(hl);
    }
    triggerDataEvent(e, i = !1) {
      if (this._optionsService.rawOptions.disableStdin) return;
      let r = this._bufferService.buffer;
      i && this._optionsService.rawOptions.scrollOnUserInput && r.ybase !== r.ydisp && this._onRequestScrollToBottom.fire(), i && this._onUserInput.fire(), this._logService.debug(`sending data "${e}"`), this._logService.trace("sending data (codes)", () => e.split("").map(n => n.charCodeAt(0))), this._onData.fire(e);
    }
    triggerBinaryEvent(e) {
      this._optionsService.rawOptions.disableStdin || (this._logService.debug(`sending binary "${e}"`), this._logService.trace("sending binary (codes)", () => e.split("").map(i => i.charCodeAt(0))), this._onBinary.fire(e));
    }
  };
li = M([S(0, F), S(1, nr), S(2, H)], li);
var dl = {
  NONE: {
    events: 0,
    restrict: () => !1
  },
  X10: {
    events: 1,
    restrict: s => s.button === 4 || s.action !== 1 ? !1 : (s.ctrl = !1, s.alt = !1, s.shift = !1, !0)
  },
  VT200: {
    events: 19,
    restrict: s => s.action !== 32
  },
  DRAG: {
    events: 23,
    restrict: s => !(s.action === 32 && s.button === 3)
  },
  ANY: {
    events: 31,
    restrict: s => !0
  }
};
function Ms(s, t) {
  let e = (s.ctrl ? 16 : 0) | (s.shift ? 4 : 0) | (s.alt ? 8 : 0);
  return s.button === 4 ? (e |= 64, e |= s.action) : (e |= s.button & 3, s.button & 4 && (e |= 64), s.button & 8 && (e |= 128), s.action === 32 ? e |= 32 : s.action === 0 && !t && (e |= 3)), e;
}
var Ps = String.fromCharCode,
  fl = {
    DEFAULT: s => {
      let t = [Ms(s, !1) + 32, s.col + 32, s.row + 32];
      return t[0] > 255 || t[1] > 255 || t[2] > 255 ? "" : `\x1B[M${Ps(t[0])}${Ps(t[1])}${Ps(t[2])}`;
    },
    SGR: s => {
      let t = s.action === 0 && s.button !== 4 ? "m" : "M";
      return `\x1B[<${Ms(s, !0)};${s.col};${s.row}${t}`;
    },
    SGR_PIXELS: s => {
      let t = s.action === 0 && s.button !== 4 ? "m" : "M";
      return `\x1B[<${Ms(s, !0)};${s.x};${s.y}${t}`;
    }
  },
  ai = class extends D {
    constructor(e, i, r) {
      super();
      this._bufferService = e;
      this._coreService = i;
      this._optionsService = r;
      this._protocols = {};
      this._encodings = {};
      this._activeProtocol = "";
      this._activeEncoding = "";
      this._lastEvent = null;
      this._wheelPartialScroll = 0;
      this._onProtocolChange = this._register(new v());
      this.onProtocolChange = this._onProtocolChange.event;
      for (let n of Object.keys(dl)) this.addProtocol(n, dl[n]);
      for (let n of Object.keys(fl)) this.addEncoding(n, fl[n]);
      this.reset();
    }
    addProtocol(e, i) {
      this._protocols[e] = i;
    }
    addEncoding(e, i) {
      this._encodings[e] = i;
    }
    get activeProtocol() {
      return this._activeProtocol;
    }
    get areMouseEventsActive() {
      return this._protocols[this._activeProtocol].events !== 0;
    }
    set activeProtocol(e) {
      if (!this._protocols[e]) throw new Error(`unknown protocol "${e}"`);
      this._activeProtocol = e, this._onProtocolChange.fire(this._protocols[e].events);
    }
    get activeEncoding() {
      return this._activeEncoding;
    }
    set activeEncoding(e) {
      if (!this._encodings[e]) throw new Error(`unknown encoding "${e}"`);
      this._activeEncoding = e;
    }
    reset() {
      this.activeProtocol = "NONE", this.activeEncoding = "DEFAULT", this._lastEvent = null, this._wheelPartialScroll = 0;
    }
    consumeWheelEvent(e, i, r) {
      if (e.deltaY === 0 || e.shiftKey || i === void 0 || r === void 0) return 0;
      let n = i / r,
        o = this._applyScrollModifier(e.deltaY, e);
      return e.deltaMode === WheelEvent.DOM_DELTA_PIXEL ? (o /= n + 0, Math.abs(e.deltaY) < 50 && (o *= .3), this._wheelPartialScroll += o, o = Math.floor(Math.abs(this._wheelPartialScroll)) * (this._wheelPartialScroll > 0 ? 1 : -1), this._wheelPartialScroll %= 1) : e.deltaMode === WheelEvent.DOM_DELTA_PAGE && (o *= this._bufferService.rows), o;
    }
    _applyScrollModifier(e, i) {
      return i.altKey || i.ctrlKey || i.shiftKey ? e * this._optionsService.rawOptions.fastScrollSensitivity * this._optionsService.rawOptions.scrollSensitivity : e * this._optionsService.rawOptions.scrollSensitivity;
    }
    triggerMouseEvent(e) {
      if (e.col < 0 || e.col >= this._bufferService.cols || e.row < 0 || e.row >= this._bufferService.rows || e.button === 4 && e.action === 32 || e.button === 3 && e.action !== 32 || e.button !== 4 && (e.action === 2 || e.action === 3) || (e.col++, e.row++, e.action === 32 && this._lastEvent && this._equalEvents(this._lastEvent, e, this._activeEncoding === "SGR_PIXELS")) || !this._protocols[this._activeProtocol].restrict(e)) return !1;
      let i = this._encodings[this._activeEncoding](e);
      return i && (this._activeEncoding === "DEFAULT" ? this._coreService.triggerBinaryEvent(i) : this._coreService.triggerDataEvent(i, !0)), this._lastEvent = e, !0;
    }
    explainEvents(e) {
      return {
        down: !!(e & 1),
        up: !!(e & 2),
        drag: !!(e & 4),
        move: !!(e & 8),
        wheel: !!(e & 16)
      };
    }
    _equalEvents(e, i, r) {
      if (r) {
        if (e.x !== i.x || e.y !== i.y) return !1;
      } else if (e.col !== i.col || e.row !== i.row) return !1;
      return !(e.button !== i.button || e.action !== i.action || e.ctrl !== i.ctrl || e.alt !== i.alt || e.shift !== i.shift);
    }
  };
ai = M([S(0, F), S(1, ge), S(2, H)], ai);
var Os = [[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]],
  ac = [[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]],
  se;
function cc(s, t) {
  let e = 0,
    i = t.length - 1,
    r;
  if (s < t[0][0] || s > t[i][1]) return !1;
  for (; i >= e;) if (r = e + i >> 1, s > t[r][1]) e = r + 1;else if (s < t[r][0]) i = r - 1;else return !0;
  return !1;
}
var fn = class {
  constructor() {
    this.version = "6";
    if (!se) {
      se = new Uint8Array(65536), se.fill(1), se[0] = 0, se.fill(0, 1, 32), se.fill(0, 127, 160), se.fill(2, 4352, 4448), se[9001] = 2, se[9002] = 2, se.fill(2, 11904, 42192), se[12351] = 1, se.fill(2, 44032, 55204), se.fill(2, 63744, 64256), se.fill(2, 65040, 65050), se.fill(2, 65072, 65136), se.fill(2, 65280, 65377), se.fill(2, 65504, 65511);
      for (let t = 0; t < Os.length; ++t) se.fill(0, Os[t][0], Os[t][1] + 1);
    }
  }
  wcwidth(t) {
    return t < 32 ? 0 : t < 127 ? 1 : t < 65536 ? se[t] : cc(t, ac) ? 0 : t >= 131072 && t <= 196605 || t >= 196608 && t <= 262141 ? 2 : 1;
  }
  charProperties(t, e) {
    let i = this.wcwidth(t),
      r = i === 0 && e !== 0;
    if (r) {
      let n = Ae.extractWidth(e);
      n === 0 ? r = !1 : n > i && (i = n);
    }
    return Ae.createPropertyValue(0, i, r);
  }
};
var Ae = class s {
  constructor() {
    this._providers = Object.create(null);
    this._active = "";
    this._onChange = new v();
    this.onChange = this._onChange.event;
    let t = new fn();
    this.register(t), this._active = t.version, this._activeProvider = t;
  }
  static extractShouldJoin(t) {
    return (t & 1) !== 0;
  }
  static extractWidth(t) {
    return t >> 1 & 3;
  }
  static extractCharKind(t) {
    return t >> 3;
  }
  static createPropertyValue(t, e, i = !1) {
    return (t & 16777215) << 3 | (e & 3) << 1 | (i ? 1 : 0);
  }
  dispose() {
    this._onChange.dispose();
  }
  get versions() {
    return Object.keys(this._providers);
  }
  get activeVersion() {
    return this._active;
  }
  set activeVersion(t) {
    if (!this._providers[t]) throw new Error(`unknown Unicode version "${t}"`);
    this._active = t, this._activeProvider = this._providers[t], this._onChange.fire(t);
  }
  register(t) {
    this._providers[t.version] = t;
  }
  wcwidth(t) {
    return this._activeProvider.wcwidth(t);
  }
  getStringCellWidth(t) {
    let e = 0,
      i = 0,
      r = t.length;
    for (let n = 0; n < r; ++n) {
      let o = t.charCodeAt(n);
      if (55296 <= o && o <= 56319) {
        if (++n >= r) return e + this.wcwidth(o);
        let u = t.charCodeAt(n);
        56320 <= u && u <= 57343 ? o = (o - 55296) * 1024 + u - 56320 + 65536 : e += this.wcwidth(u);
      }
      let l = this.charProperties(o, i),
        a = s.extractWidth(l);
      s.extractShouldJoin(l) && (a -= s.extractWidth(i)), e += a, i = l;
    }
    return e;
  }
  charProperties(t, e) {
    return this._activeProvider.charProperties(t, e);
  }
};
var pn = class {
  constructor() {
    this.glevel = 0;
    this._charsets = [];
  }
  reset() {
    this.charset = void 0, this._charsets = [], this.glevel = 0;
  }
  setgLevel(t) {
    this.glevel = t, this.charset = this._charsets[t];
  }
  setgCharset(t, e) {
    this._charsets[t] = e, this.glevel === t && (this.charset = e);
  }
};
function Bs(s) {
  let e = s.buffer.lines.get(s.buffer.ybase + s.buffer.y - 1)?.get(s.cols - 1),
    i = s.buffer.lines.get(s.buffer.ybase + s.buffer.y);
  i && e && (i.isWrapped = e[3] !== 0 && e[3] !== 32);
}
var Vi = 2147483647,
  uc = 256,
  ci = class s {
    constructor(t = 32, e = 32) {
      this.maxLength = t;
      this.maxSubParamsLength = e;
      if (e > uc) throw new Error("maxSubParamsLength must not be greater than 256");
      this.params = new Int32Array(t), this.length = 0, this._subParams = new Int32Array(e), this._subParamsLength = 0, this._subParamsIdx = new Uint16Array(t), this._rejectDigits = !1, this._rejectSubDigits = !1, this._digitIsSub = !1;
    }
    static fromArray(t) {
      let e = new s();
      if (!t.length) return e;
      for (let i = Array.isArray(t[0]) ? 1 : 0; i < t.length; ++i) {
        let r = t[i];
        if (Array.isArray(r)) for (let n = 0; n < r.length; ++n) e.addSubParam(r[n]);else e.addParam(r);
      }
      return e;
    }
    clone() {
      let t = new s(this.maxLength, this.maxSubParamsLength);
      return t.params.set(this.params), t.length = this.length, t._subParams.set(this._subParams), t._subParamsLength = this._subParamsLength, t._subParamsIdx.set(this._subParamsIdx), t._rejectDigits = this._rejectDigits, t._rejectSubDigits = this._rejectSubDigits, t._digitIsSub = this._digitIsSub, t;
    }
    toArray() {
      let t = [];
      for (let e = 0; e < this.length; ++e) {
        t.push(this.params[e]);
        let i = this._subParamsIdx[e] >> 8,
          r = this._subParamsIdx[e] & 255;
        r - i > 0 && t.push(Array.prototype.slice.call(this._subParams, i, r));
      }
      return t;
    }
    reset() {
      this.length = 0, this._subParamsLength = 0, this._rejectDigits = !1, this._rejectSubDigits = !1, this._digitIsSub = !1;
    }
    addParam(t) {
      if (this._digitIsSub = !1, this.length >= this.maxLength) {
        this._rejectDigits = !0;
        return;
      }
      if (t < -1) throw new Error("values lesser than -1 are not allowed");
      this._subParamsIdx[this.length] = this._subParamsLength << 8 | this._subParamsLength, this.params[this.length++] = t > Vi ? Vi : t;
    }
    addSubParam(t) {
      if (this._digitIsSub = !0, !!this.length) {
        if (this._rejectDigits || this._subParamsLength >= this.maxSubParamsLength) {
          this._rejectSubDigits = !0;
          return;
        }
        if (t < -1) throw new Error("values lesser than -1 are not allowed");
        this._subParams[this._subParamsLength++] = t > Vi ? Vi : t, this._subParamsIdx[this.length - 1]++;
      }
    }
    hasSubParams(t) {
      return (this._subParamsIdx[t] & 255) - (this._subParamsIdx[t] >> 8) > 0;
    }
    getSubParams(t) {
      let e = this._subParamsIdx[t] >> 8,
        i = this._subParamsIdx[t] & 255;
      return i - e > 0 ? this._subParams.subarray(e, i) : null;
    }
    getSubParamsAll() {
      let t = {};
      for (let e = 0; e < this.length; ++e) {
        let i = this._subParamsIdx[e] >> 8,
          r = this._subParamsIdx[e] & 255;
        r - i > 0 && (t[e] = this._subParams.slice(i, r));
      }
      return t;
    }
    addDigit(t) {
      let e;
      if (this._rejectDigits || !(e = this._digitIsSub ? this._subParamsLength : this.length) || this._digitIsSub && this._rejectSubDigits) return;
      let i = this._digitIsSub ? this._subParams : this.params,
        r = i[e - 1];
      i[e - 1] = ~r ? Math.min(r * 10 + t, Vi) : t;
    }
  };
var qi = [],
  mn = class {
    constructor() {
      this._state = 0;
      this._active = qi;
      this._id = -1;
      this._handlers = Object.create(null);
      this._handlerFb = () => {};
      this._stack = {
        paused: !1,
        loopPosition: 0,
        fallThrough: !1
      };
    }
    registerHandler(t, e) {
      this._handlers[t] === void 0 && (this._handlers[t] = []);
      let i = this._handlers[t];
      return i.push(e), {
        dispose: () => {
          let r = i.indexOf(e);
          r !== -1 && i.splice(r, 1);
        }
      };
    }
    clearHandler(t) {
      this._handlers[t] && delete this._handlers[t];
    }
    setHandlerFallback(t) {
      this._handlerFb = t;
    }
    dispose() {
      this._handlers = Object.create(null), this._handlerFb = () => {}, this._active = qi;
    }
    reset() {
      if (this._state === 2) for (let t = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; t >= 0; --t) this._active[t].end(!1);
      this._stack.paused = !1, this._active = qi, this._id = -1, this._state = 0;
    }
    _start() {
      if (this._active = this._handlers[this._id] || qi, !this._active.length) this._handlerFb(this._id, "START");else for (let t = this._active.length - 1; t >= 0; t--) this._active[t].start();
    }
    _put(t, e, i) {
      if (!this._active.length) this._handlerFb(this._id, "PUT", It(t, e, i));else for (let r = this._active.length - 1; r >= 0; r--) this._active[r].put(t, e, i);
    }
    start() {
      this.reset(), this._state = 1;
    }
    put(t, e, i) {
      if (this._state !== 3) {
        if (this._state === 1) for (; e < i;) {
          let r = t[e++];
          if (r === 59) {
            this._state = 2, this._start();
            break;
          }
          if (r < 48 || 57 < r) {
            this._state = 3;
            return;
          }
          this._id === -1 && (this._id = 0), this._id = this._id * 10 + r - 48;
        }
        this._state === 2 && i - e > 0 && this._put(t, e, i);
      }
    }
    end(t, e = !0) {
      if (this._state !== 0) {
        if (this._state !== 3) if (this._state === 1 && this._start(), !this._active.length) this._handlerFb(this._id, "END", t);else {
          let i = !1,
            r = this._active.length - 1,
            n = !1;
          if (this._stack.paused && (r = this._stack.loopPosition - 1, i = e, n = this._stack.fallThrough, this._stack.paused = !1), !n && i === !1) {
            for (; r >= 0 && (i = this._active[r].end(t), i !== !0); r--) if (i instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = r, this._stack.fallThrough = !1, i;
            r--;
          }
          for (; r >= 0; r--) if (i = this._active[r].end(!1), i instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = r, this._stack.fallThrough = !0, i;
        }
        this._active = qi, this._id = -1, this._state = 0;
      }
    }
  },
  pe = class {
    constructor(t) {
      this._handler = t;
      this._data = "";
      this._hitLimit = !1;
    }
    start() {
      this._data = "", this._hitLimit = !1;
    }
    put(t, e, i) {
      this._hitLimit || (this._data += It(t, e, i), this._data.length > 1e7 && (this._data = "", this._hitLimit = !0));
    }
    end(t) {
      let e = !1;
      if (this._hitLimit) e = !1;else if (t && (e = this._handler(this._data), e instanceof Promise)) return e.then(i => (this._data = "", this._hitLimit = !1, i));
      return this._data = "", this._hitLimit = !1, e;
    }
  };
var Yi = [],
  _n = class {
    constructor() {
      this._handlers = Object.create(null);
      this._active = Yi;
      this._ident = 0;
      this._handlerFb = () => {};
      this._stack = {
        paused: !1,
        loopPosition: 0,
        fallThrough: !1
      };
    }
    dispose() {
      this._handlers = Object.create(null), this._handlerFb = () => {}, this._active = Yi;
    }
    registerHandler(t, e) {
      this._handlers[t] === void 0 && (this._handlers[t] = []);
      let i = this._handlers[t];
      return i.push(e), {
        dispose: () => {
          let r = i.indexOf(e);
          r !== -1 && i.splice(r, 1);
        }
      };
    }
    clearHandler(t) {
      this._handlers[t] && delete this._handlers[t];
    }
    setHandlerFallback(t) {
      this._handlerFb = t;
    }
    reset() {
      if (this._active.length) for (let t = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; t >= 0; --t) this._active[t].unhook(!1);
      this._stack.paused = !1, this._active = Yi, this._ident = 0;
    }
    hook(t, e) {
      if (this.reset(), this._ident = t, this._active = this._handlers[t] || Yi, !this._active.length) this._handlerFb(this._ident, "HOOK", e);else for (let i = this._active.length - 1; i >= 0; i--) this._active[i].hook(e);
    }
    put(t, e, i) {
      if (!this._active.length) this._handlerFb(this._ident, "PUT", It(t, e, i));else for (let r = this._active.length - 1; r >= 0; r--) this._active[r].put(t, e, i);
    }
    unhook(t, e = !0) {
      if (!this._active.length) this._handlerFb(this._ident, "UNHOOK", t);else {
        let i = !1,
          r = this._active.length - 1,
          n = !1;
        if (this._stack.paused && (r = this._stack.loopPosition - 1, i = e, n = this._stack.fallThrough, this._stack.paused = !1), !n && i === !1) {
          for (; r >= 0 && (i = this._active[r].unhook(t), i !== !0); r--) if (i instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = r, this._stack.fallThrough = !1, i;
          r--;
        }
        for (; r >= 0; r--) if (i = this._active[r].unhook(!1), i instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = r, this._stack.fallThrough = !0, i;
      }
      this._active = Yi, this._ident = 0;
    }
  },
  ji = new ci();
ji.addParam(0);
var Xi = class {
  constructor(t) {
    this._handler = t;
    this._data = "";
    this._params = ji;
    this._hitLimit = !1;
  }
  hook(t) {
    this._params = t.length > 1 || t.params[0] ? t.clone() : ji, this._data = "", this._hitLimit = !1;
  }
  put(t, e, i) {
    this._hitLimit || (this._data += It(t, e, i), this._data.length > 1e7 && (this._data = "", this._hitLimit = !0));
  }
  unhook(t) {
    let e = !1;
    if (this._hitLimit) e = !1;else if (t && (e = this._handler(this._data, this._params), e instanceof Promise)) return e.then(i => (this._params = ji, this._data = "", this._hitLimit = !1, i));
    return this._params = ji, this._data = "", this._hitLimit = !1, e;
  }
};
var Fs = class {
    constructor(t) {
      this.table = new Uint8Array(t);
    }
    setDefault(t, e) {
      this.table.fill(t << 4 | e);
    }
    add(t, e, i, r) {
      this.table[e << 8 | t] = i << 4 | r;
    }
    addMany(t, e, i, r) {
      for (let n = 0; n < t.length; n++) this.table[e << 8 | t[n]] = i << 4 | r;
    }
  },
  ke = 160,
  hc = function () {
    let s = new Fs(4095),
      e = Array.apply(null, Array(256)).map((a, u) => u),
      i = (a, u) => e.slice(a, u),
      r = i(32, 127),
      n = i(0, 24);
    n.push(25), n.push.apply(n, i(28, 32));
    let o = i(0, 14),
      l;
    s.setDefault(1, 0), s.addMany(r, 0, 2, 0);
    for (l in o) s.addMany([24, 26, 153, 154], l, 3, 0), s.addMany(i(128, 144), l, 3, 0), s.addMany(i(144, 152), l, 3, 0), s.add(156, l, 0, 0), s.add(27, l, 11, 1), s.add(157, l, 4, 8), s.addMany([152, 158, 159], l, 0, 7), s.add(155, l, 11, 3), s.add(144, l, 11, 9);
    return s.addMany(n, 0, 3, 0), s.addMany(n, 1, 3, 1), s.add(127, 1, 0, 1), s.addMany(n, 8, 0, 8), s.addMany(n, 3, 3, 3), s.add(127, 3, 0, 3), s.addMany(n, 4, 3, 4), s.add(127, 4, 0, 4), s.addMany(n, 6, 3, 6), s.addMany(n, 5, 3, 5), s.add(127, 5, 0, 5), s.addMany(n, 2, 3, 2), s.add(127, 2, 0, 2), s.add(93, 1, 4, 8), s.addMany(r, 8, 5, 8), s.add(127, 8, 5, 8), s.addMany([156, 27, 24, 26, 7], 8, 6, 0), s.addMany(i(28, 32), 8, 0, 8), s.addMany([88, 94, 95], 1, 0, 7), s.addMany(r, 7, 0, 7), s.addMany(n, 7, 0, 7), s.add(156, 7, 0, 0), s.add(127, 7, 0, 7), s.add(91, 1, 11, 3), s.addMany(i(64, 127), 3, 7, 0), s.addMany(i(48, 60), 3, 8, 4), s.addMany([60, 61, 62, 63], 3, 9, 4), s.addMany(i(48, 60), 4, 8, 4), s.addMany(i(64, 127), 4, 7, 0), s.addMany([60, 61, 62, 63], 4, 0, 6), s.addMany(i(32, 64), 6, 0, 6), s.add(127, 6, 0, 6), s.addMany(i(64, 127), 6, 0, 0), s.addMany(i(32, 48), 3, 9, 5), s.addMany(i(32, 48), 5, 9, 5), s.addMany(i(48, 64), 5, 0, 6), s.addMany(i(64, 127), 5, 7, 0), s.addMany(i(32, 48), 4, 9, 5), s.addMany(i(32, 48), 1, 9, 2), s.addMany(i(32, 48), 2, 9, 2), s.addMany(i(48, 127), 2, 10, 0), s.addMany(i(48, 80), 1, 10, 0), s.addMany(i(81, 88), 1, 10, 0), s.addMany([89, 90, 92], 1, 10, 0), s.addMany(i(96, 127), 1, 10, 0), s.add(80, 1, 11, 9), s.addMany(n, 9, 0, 9), s.add(127, 9, 0, 9), s.addMany(i(28, 32), 9, 0, 9), s.addMany(i(32, 48), 9, 9, 12), s.addMany(i(48, 60), 9, 8, 10), s.addMany([60, 61, 62, 63], 9, 9, 10), s.addMany(n, 11, 0, 11), s.addMany(i(32, 128), 11, 0, 11), s.addMany(i(28, 32), 11, 0, 11), s.addMany(n, 10, 0, 10), s.add(127, 10, 0, 10), s.addMany(i(28, 32), 10, 0, 10), s.addMany(i(48, 60), 10, 8, 10), s.addMany([60, 61, 62, 63], 10, 0, 11), s.addMany(i(32, 48), 10, 9, 12), s.addMany(n, 12, 0, 12), s.add(127, 12, 0, 12), s.addMany(i(28, 32), 12, 0, 12), s.addMany(i(32, 48), 12, 9, 12), s.addMany(i(48, 64), 12, 0, 11), s.addMany(i(64, 127), 12, 12, 13), s.addMany(i(64, 127), 10, 12, 13), s.addMany(i(64, 127), 9, 12, 13), s.addMany(n, 13, 13, 13), s.addMany(r, 13, 13, 13), s.add(127, 13, 0, 13), s.addMany([27, 156, 24, 26], 13, 14, 0), s.add(ke, 0, 2, 0), s.add(ke, 8, 5, 8), s.add(ke, 6, 0, 6), s.add(ke, 11, 0, 11), s.add(ke, 13, 13, 13), s;
  }(),
  bn = class extends D {
    constructor(e = hc) {
      super();
      this._transitions = e;
      this._parseStack = {
        state: 0,
        handlers: [],
        handlerPos: 0,
        transition: 0,
        chunkPos: 0
      };
      this.initialState = 0, this.currentState = this.initialState, this._params = new ci(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0, this._printHandlerFb = (i, r, n) => {}, this._executeHandlerFb = i => {}, this._csiHandlerFb = (i, r) => {}, this._escHandlerFb = i => {}, this._errorHandlerFb = i => i, this._printHandler = this._printHandlerFb, this._executeHandlers = Object.create(null), this._csiHandlers = Object.create(null), this._escHandlers = Object.create(null), this._register(C(() => {
        this._csiHandlers = Object.create(null), this._executeHandlers = Object.create(null), this._escHandlers = Object.create(null);
      })), this._oscParser = this._register(new mn()), this._dcsParser = this._register(new _n()), this._errorHandler = this._errorHandlerFb, this.registerEscHandler({
        final: "\\"
      }, () => !0);
    }
    _identifier(e, i = [64, 126]) {
      let r = 0;
      if (e.prefix) {
        if (e.prefix.length > 1) throw new Error("only one byte as prefix supported");
        if (r = e.prefix.charCodeAt(0), r && 60 > r || r > 63) throw new Error("prefix must be in range 0x3c .. 0x3f");
      }
      if (e.intermediates) {
        if (e.intermediates.length > 2) throw new Error("only two bytes as intermediates are supported");
        for (let o = 0; o < e.intermediates.length; ++o) {
          let l = e.intermediates.charCodeAt(o);
          if (32 > l || l > 47) throw new Error("intermediate must be in range 0x20 .. 0x2f");
          r <<= 8, r |= l;
        }
      }
      if (e.final.length !== 1) throw new Error("final must be a single byte");
      let n = e.final.charCodeAt(0);
      if (i[0] > n || n > i[1]) throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);
      return r <<= 8, r |= n, r;
    }
    identToString(e) {
      let i = [];
      for (; e;) i.push(String.fromCharCode(e & 255)), e >>= 8;
      return i.reverse().join("");
    }
    setPrintHandler(e) {
      this._printHandler = e;
    }
    clearPrintHandler() {
      this._printHandler = this._printHandlerFb;
    }
    registerEscHandler(e, i) {
      let r = this._identifier(e, [48, 126]);
      this._escHandlers[r] === void 0 && (this._escHandlers[r] = []);
      let n = this._escHandlers[r];
      return n.push(i), {
        dispose: () => {
          let o = n.indexOf(i);
          o !== -1 && n.splice(o, 1);
        }
      };
    }
    clearEscHandler(e) {
      this._escHandlers[this._identifier(e, [48, 126])] && delete this._escHandlers[this._identifier(e, [48, 126])];
    }
    setEscHandlerFallback(e) {
      this._escHandlerFb = e;
    }
    setExecuteHandler(e, i) {
      this._executeHandlers[e.charCodeAt(0)] = i;
    }
    clearExecuteHandler(e) {
      this._executeHandlers[e.charCodeAt(0)] && delete this._executeHandlers[e.charCodeAt(0)];
    }
    setExecuteHandlerFallback(e) {
      this._executeHandlerFb = e;
    }
    registerCsiHandler(e, i) {
      let r = this._identifier(e);
      this._csiHandlers[r] === void 0 && (this._csiHandlers[r] = []);
      let n = this._csiHandlers[r];
      return n.push(i), {
        dispose: () => {
          let o = n.indexOf(i);
          o !== -1 && n.splice(o, 1);
        }
      };
    }
    clearCsiHandler(e) {
      this._csiHandlers[this._identifier(e)] && delete this._csiHandlers[this._identifier(e)];
    }
    setCsiHandlerFallback(e) {
      this._csiHandlerFb = e;
    }
    registerDcsHandler(e, i) {
      return this._dcsParser.registerHandler(this._identifier(e), i);
    }
    clearDcsHandler(e) {
      this._dcsParser.clearHandler(this._identifier(e));
    }
    setDcsHandlerFallback(e) {
      this._dcsParser.setHandlerFallback(e);
    }
    registerOscHandler(e, i) {
      return this._oscParser.registerHandler(e, i);
    }
    clearOscHandler(e) {
      this._oscParser.clearHandler(e);
    }
    setOscHandlerFallback(e) {
      this._oscParser.setHandlerFallback(e);
    }
    setErrorHandler(e) {
      this._errorHandler = e;
    }
    clearErrorHandler() {
      this._errorHandler = this._errorHandlerFb;
    }
    reset() {
      this.currentState = this.initialState, this._oscParser.reset(), this._dcsParser.reset(), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0, this._parseStack.state !== 0 && (this._parseStack.state = 2, this._parseStack.handlers = []);
    }
    _preserveStack(e, i, r, n, o) {
      this._parseStack.state = e, this._parseStack.handlers = i, this._parseStack.handlerPos = r, this._parseStack.transition = n, this._parseStack.chunkPos = o;
    }
    parse(e, i, r) {
      let n = 0,
        o = 0,
        l = 0,
        a;
      if (this._parseStack.state) if (this._parseStack.state === 2) this._parseStack.state = 0, l = this._parseStack.chunkPos + 1;else {
        if (r === void 0 || this._parseStack.state === 1) throw this._parseStack.state = 1, new Error("improper continuation due to previous async handler, giving up parsing");
        let u = this._parseStack.handlers,
          h = this._parseStack.handlerPos - 1;
        switch (this._parseStack.state) {
          case 3:
            if (r === !1 && h > -1) {
              for (; h >= 0 && (a = u[h](this._params), a !== !0); h--) if (a instanceof Promise) return this._parseStack.handlerPos = h, a;
            }
            this._parseStack.handlers = [];
            break;
          case 4:
            if (r === !1 && h > -1) {
              for (; h >= 0 && (a = u[h](), a !== !0); h--) if (a instanceof Promise) return this._parseStack.handlerPos = h, a;
            }
            this._parseStack.handlers = [];
            break;
          case 6:
            if (n = e[this._parseStack.chunkPos], a = this._dcsParser.unhook(n !== 24 && n !== 26, r), a) return a;
            n === 27 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0;
            break;
          case 5:
            if (n = e[this._parseStack.chunkPos], a = this._oscParser.end(n !== 24 && n !== 26, r), a) return a;
            n === 27 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0;
            break;
        }
        this._parseStack.state = 0, l = this._parseStack.chunkPos + 1, this.precedingJoinState = 0, this.currentState = this._parseStack.transition & 15;
      }
      for (let u = l; u < i; ++u) {
        switch (n = e[u], o = this._transitions.table[this.currentState << 8 | (n < 160 ? n : ke)], o >> 4) {
          case 2:
            for (let m = u + 1;; ++m) {
              if (m >= i || (n = e[m]) < 32 || n > 126 && n < ke) {
                this._printHandler(e, u, m), u = m - 1;
                break;
              }
              if (++m >= i || (n = e[m]) < 32 || n > 126 && n < ke) {
                this._printHandler(e, u, m), u = m - 1;
                break;
              }
              if (++m >= i || (n = e[m]) < 32 || n > 126 && n < ke) {
                this._printHandler(e, u, m), u = m - 1;
                break;
              }
              if (++m >= i || (n = e[m]) < 32 || n > 126 && n < ke) {
                this._printHandler(e, u, m), u = m - 1;
                break;
              }
            }
            break;
          case 3:
            this._executeHandlers[n] ? this._executeHandlers[n]() : this._executeHandlerFb(n), this.precedingJoinState = 0;
            break;
          case 0:
            break;
          case 1:
            if (this._errorHandler({
              position: u,
              code: n,
              currentState: this.currentState,
              collect: this._collect,
              params: this._params,
              abort: !1
            }).abort) return;
            break;
          case 7:
            let c = this._csiHandlers[this._collect << 8 | n],
              d = c ? c.length - 1 : -1;
            for (; d >= 0 && (a = c[d](this._params), a !== !0); d--) if (a instanceof Promise) return this._preserveStack(3, c, d, o, u), a;
            d < 0 && this._csiHandlerFb(this._collect << 8 | n, this._params), this.precedingJoinState = 0;
            break;
          case 8:
            do switch (n) {
              case 59:
                this._params.addParam(0);
                break;
              case 58:
                this._params.addSubParam(-1);
                break;
              default:
                this._params.addDigit(n - 48);
            } while (++u < i && (n = e[u]) > 47 && n < 60);
            u--;
            break;
          case 9:
            this._collect <<= 8, this._collect |= n;
            break;
          case 10:
            let _ = this._escHandlers[this._collect << 8 | n],
              p = _ ? _.length - 1 : -1;
            for (; p >= 0 && (a = _[p](), a !== !0); p--) if (a instanceof Promise) return this._preserveStack(4, _, p, o, u), a;
            p < 0 && this._escHandlerFb(this._collect << 8 | n), this.precedingJoinState = 0;
            break;
          case 11:
            this._params.reset(), this._params.addParam(0), this._collect = 0;
            break;
          case 12:
            this._dcsParser.hook(this._collect << 8 | n, this._params);
            break;
          case 13:
            for (let m = u + 1;; ++m) if (m >= i || (n = e[m]) === 24 || n === 26 || n === 27 || n > 127 && n < ke) {
              this._dcsParser.put(e, u, m), u = m - 1;
              break;
            }
            break;
          case 14:
            if (a = this._dcsParser.unhook(n !== 24 && n !== 26), a) return this._preserveStack(6, [], 0, o, u), a;
            n === 27 && (o |= 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 m = u + 1;; m++) if (m >= i || (n = e[m]) < 32 || n > 127 && n < ke) {
              this._oscParser.put(e, u, m), u = m - 1;
              break;
            }
            break;
          case 6:
            if (a = this._oscParser.end(n !== 24 && n !== 26), a) return this._preserveStack(5, [], 0, o, u), a;
            n === 27 && (o |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0;
            break;
        }
        this.currentState = o & 15;
      }
    }
  };
var dc = /^([\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})$/,
  fc = /^[\da-f]+$/;
function Ws(s) {
  if (!s) return;
  let t = s.toLowerCase();
  if (t.indexOf("rgb:") === 0) {
    t = t.slice(4);
    let e = dc.exec(t);
    if (e) {
      let i = e[1] ? 15 : e[4] ? 255 : e[7] ? 4095 : 65535;
      return [Math.round(parseInt(e[1] || e[4] || e[7] || e[10], 16) / i * 255), Math.round(parseInt(e[2] || e[5] || e[8] || e[11], 16) / i * 255), Math.round(parseInt(e[3] || e[6] || e[9] || e[12], 16) / i * 255)];
    }
  } else if (t.indexOf("#") === 0 && (t = t.slice(1), fc.exec(t) && [3, 6, 9, 12].includes(t.length))) {
    let e = t.length / 3,
      i = [0, 0, 0];
    for (let r = 0; r < 3; ++r) {
      let n = parseInt(t.slice(e * r, e * r + e), 16);
      i[r] = e === 1 ? n << 4 : e === 2 ? n : e === 3 ? n >> 4 : n >> 8;
    }
    return i;
  }
}
function Hs(s, t) {
  let e = s.toString(16),
    i = e.length < 2 ? "0" + e : e;
  switch (t) {
    case 4:
      return e[0];
    case 8:
      return i;
    case 12:
      return (i + i).slice(0, 3);
    default:
      return i + i;
  }
}
function ml(s, t = 16) {
  let [e, i, r] = s;
  return `rgb:${Hs(e, t)}/${Hs(i, t)}/${Hs(r, t)}`;
}
var mc = {
    "(": 0,
    ")": 1,
    "*": 2,
    "+": 3,
    "-": 1,
    ".": 2
  },
  ut = 131072,
  _l = 10;
function bl(s, t) {
  if (s > 24) return t.setWinLines || !1;
  switch (s) {
    case 1:
      return !!t.restoreWin;
    case 2:
      return !!t.minimizeWin;
    case 3:
      return !!t.setWinPosition;
    case 4:
      return !!t.setWinSizePixels;
    case 5:
      return !!t.raiseWin;
    case 6:
      return !!t.lowerWin;
    case 7:
      return !!t.refreshWin;
    case 8:
      return !!t.setWinSizeChars;
    case 9:
      return !!t.maximizeWin;
    case 10:
      return !!t.fullscreenWin;
    case 11:
      return !!t.getWinState;
    case 13:
      return !!t.getWinPosition;
    case 14:
      return !!t.getWinSizePixels;
    case 15:
      return !!t.getScreenSizePixels;
    case 16:
      return !!t.getCellSizePixels;
    case 18:
      return !!t.getWinSizeChars;
    case 19:
      return !!t.getScreenSizeChars;
    case 20:
      return !!t.getIconTitle;
    case 21:
      return !!t.getWinTitle;
    case 22:
      return !!t.pushTitle;
    case 23:
      return !!t.popTitle;
    case 24:
      return !!t.setWinLines;
  }
  return !1;
}
var vl = 5e3,
  gl = 0,
  vn = class extends D {
    constructor(e, i, r, n, o, l, a, u, h = new bn()) {
      super();
      this._bufferService = e;
      this._charsetService = i;
      this._coreService = r;
      this._logService = n;
      this._optionsService = o;
      this._oscLinkService = l;
      this._coreMouseService = a;
      this._unicodeService = u;
      this._parser = h;
      this._parseBuffer = new Uint32Array(4096);
      this._stringDecoder = new er();
      this._utf8Decoder = new tr();
      this._windowTitle = "";
      this._iconName = "";
      this._windowTitleStack = [];
      this._iconNameStack = [];
      this._curAttrData = X.clone();
      this._eraseAttrDataInternal = X.clone();
      this._onRequestBell = this._register(new v());
      this.onRequestBell = this._onRequestBell.event;
      this._onRequestRefreshRows = this._register(new v());
      this.onRequestRefreshRows = this._onRequestRefreshRows.event;
      this._onRequestReset = this._register(new v());
      this.onRequestReset = this._onRequestReset.event;
      this._onRequestSendFocus = this._register(new v());
      this.onRequestSendFocus = this._onRequestSendFocus.event;
      this._onRequestSyncScrollBar = this._register(new v());
      this.onRequestSyncScrollBar = this._onRequestSyncScrollBar.event;
      this._onRequestWindowsOptionsReport = this._register(new v());
      this.onRequestWindowsOptionsReport = this._onRequestWindowsOptionsReport.event;
      this._onA11yChar = this._register(new v());
      this.onA11yChar = this._onA11yChar.event;
      this._onA11yTab = this._register(new v());
      this.onA11yTab = this._onA11yTab.event;
      this._onCursorMove = this._register(new v());
      this.onCursorMove = this._onCursorMove.event;
      this._onLineFeed = this._register(new v());
      this.onLineFeed = this._onLineFeed.event;
      this._onScroll = this._register(new v());
      this.onScroll = this._onScroll.event;
      this._onTitleChange = this._register(new v());
      this.onTitleChange = this._onTitleChange.event;
      this._onColor = this._register(new v());
      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 Zi(this._bufferService), this._activeBuffer = this._bufferService.buffer, this._register(this._bufferService.buffers.onBufferActivate(c => this._activeBuffer = c.activeBuffer)), this._parser.setCsiHandlerFallback((c, d) => {
        this._logService.debug("Unknown CSI code: ", {
          identifier: this._parser.identToString(c),
          params: d.toArray()
        });
      }), this._parser.setEscHandlerFallback(c => {
        this._logService.debug("Unknown ESC code: ", {
          identifier: this._parser.identToString(c)
        });
      }), this._parser.setExecuteHandlerFallback(c => {
        this._logService.debug("Unknown EXECUTE code: ", {
          code: c
        });
      }), this._parser.setOscHandlerFallback((c, d, _) => {
        this._logService.debug("Unknown OSC code: ", {
          identifier: c,
          action: d,
          data: _
        });
      }), this._parser.setDcsHandlerFallback((c, d, _) => {
        d === "HOOK" && (_ = _.toArray()), this._logService.debug("Unknown DCS code: ", {
          identifier: this._parser.identToString(c),
          action: d,
          payload: _
        });
      }), this._parser.setPrintHandler((c, d, _) => this.print(c, d, _)), this._parser.registerCsiHandler({
        final: "@"
      }, c => this.insertChars(c)), this._parser.registerCsiHandler({
        intermediates: " ",
        final: "@"
      }, c => this.scrollLeft(c)), this._parser.registerCsiHandler({
        final: "A"
      }, c => this.cursorUp(c)), this._parser.registerCsiHandler({
        intermediates: " ",
        final: "A"
      }, c => this.scrollRight(c)), this._parser.registerCsiHandler({
        final: "B"
      }, c => this.cursorDown(c)), this._parser.registerCsiHandler({
        final: "C"
      }, c => this.cursorForward(c)), this._parser.registerCsiHandler({
        final: "D"
      }, c => this.cursorBackward(c)), this._parser.registerCsiHandler({
        final: "E"
      }, c => this.cursorNextLine(c)), this._parser.registerCsiHandler({
        final: "F"
      }, c => this.cursorPrecedingLine(c)), this._parser.registerCsiHandler({
        final: "G"
      }, c => this.cursorCharAbsolute(c)), this._parser.registerCsiHandler({
        final: "H"
      }, c => this.cursorPosition(c)), this._parser.registerCsiHandler({
        final: "I"
      }, c => this.cursorForwardTab(c)), this._parser.registerCsiHandler({
        final: "J"
      }, c => this.eraseInDisplay(c, !1)), this._parser.registerCsiHandler({
        prefix: "?",
        final: "J"
      }, c => this.eraseInDisplay(c, !0)), this._parser.registerCsiHandler({
        final: "K"
      }, c => this.eraseInLine(c, !1)), this._parser.registerCsiHandler({
        prefix: "?",
        final: "K"
      }, c => this.eraseInLine(c, !0)), this._parser.registerCsiHandler({
        final: "L"
      }, c => this.insertLines(c)), this._parser.registerCsiHandler({
        final: "M"
      }, c => this.deleteLines(c)), this._parser.registerCsiHandler({
        final: "P"
      }, c => this.deleteChars(c)), this._parser.registerCsiHandler({
        final: "S"
      }, c => this.scrollUp(c)), this._parser.registerCsiHandler({
        final: "T"
      }, c => this.scrollDown(c)), this._parser.registerCsiHandler({
        final: "X"
      }, c => this.eraseChars(c)), this._parser.registerCsiHandler({
        final: "Z"
      }, c => this.cursorBackwardTab(c)), this._parser.registerCsiHandler({
        final: "`"
      }, c => this.charPosAbsolute(c)), this._parser.registerCsiHandler({
        final: "a"
      }, c => this.hPositionRelative(c)), this._parser.registerCsiHandler({
        final: "b"
      }, c => this.repeatPrecedingCharacter(c)), this._parser.registerCsiHandler({
        final: "c"
      }, c => this.sendDeviceAttributesPrimary(c)), this._parser.registerCsiHandler({
        prefix: ">",
        final: "c"
      }, c => this.sendDeviceAttributesSecondary(c)), this._parser.registerCsiHandler({
        final: "d"
      }, c => this.linePosAbsolute(c)), this._parser.registerCsiHandler({
        final: "e"
      }, c => this.vPositionRelative(c)), this._parser.registerCsiHandler({
        final: "f"
      }, c => this.hVPosition(c)), this._parser.registerCsiHandler({
        final: "g"
      }, c => this.tabClear(c)), this._parser.registerCsiHandler({
        final: "h"
      }, c => this.setMode(c)), this._parser.registerCsiHandler({
        prefix: "?",
        final: "h"
      }, c => this.setModePrivate(c)), this._parser.registerCsiHandler({
        final: "l"
      }, c => this.resetMode(c)), this._parser.registerCsiHandler({
        prefix: "?",
        final: "l"
      }, c => this.resetModePrivate(c)), this._parser.registerCsiHandler({
        final: "m"
      }, c => this.charAttributes(c)), this._parser.registerCsiHandler({
        final: "n"
      }, c => this.deviceStatus(c)), this._parser.registerCsiHandler({
        prefix: "?",
        final: "n"
      }, c => this.deviceStatusPrivate(c)), this._parser.registerCsiHandler({
        intermediates: "!",
        final: "p"
      }, c => this.softReset(c)), this._parser.registerCsiHandler({
        intermediates: " ",
        final: "q"
      }, c => this.setCursorStyle(c)), this._parser.registerCsiHandler({
        final: "r"
      }, c => this.setScrollRegion(c)), this._parser.registerCsiHandler({
        final: "s"
      }, c => this.saveCursor(c)), this._parser.registerCsiHandler({
        final: "t"
      }, c => this.windowOptions(c)), this._parser.registerCsiHandler({
        final: "u"
      }, c => this.restoreCursor(c)), this._parser.registerCsiHandler({
        intermediates: "'",
        final: "}"
      }, c => this.insertColumns(c)), this._parser.registerCsiHandler({
        intermediates: "'",
        final: "~"
      }, c => this.deleteColumns(c)), this._parser.registerCsiHandler({
        intermediates: '"',
        final: "q"
      }, c => this.selectProtected(c)), this._parser.registerCsiHandler({
        intermediates: "$",
        final: "p"
      }, c => this.requestMode(c, !0)), this._parser.registerCsiHandler({
        prefix: "?",
        intermediates: "$",
        final: "p"
      }, c => this.requestMode(c, !1)), this._parser.setExecuteHandler(b.BEL, () => this.bell()), this._parser.setExecuteHandler(b.LF, () => this.lineFeed()), this._parser.setExecuteHandler(b.VT, () => this.lineFeed()), this._parser.setExecuteHandler(b.FF, () => this.lineFeed()), this._parser.setExecuteHandler(b.CR, () => this.carriageReturn()), this._parser.setExecuteHandler(b.BS, () => this.backspace()), this._parser.setExecuteHandler(b.HT, () => this.tab()), this._parser.setExecuteHandler(b.SO, () => this.shiftOut()), this._parser.setExecuteHandler(b.SI, () => this.shiftIn()), this._parser.setExecuteHandler(Ai.IND, () => this.index()), this._parser.setExecuteHandler(Ai.NEL, () => this.nextLine()), this._parser.setExecuteHandler(Ai.HTS, () => this.tabSet()), this._parser.registerOscHandler(0, new pe(c => (this.setTitle(c), this.setIconName(c), !0))), this._parser.registerOscHandler(1, new pe(c => this.setIconName(c))), this._parser.registerOscHandler(2, new pe(c => this.setTitle(c))), this._parser.registerOscHandler(4, new pe(c => this.setOrReportIndexedColor(c))), this._parser.registerOscHandler(8, new pe(c => this.setHyperlink(c))), this._parser.registerOscHandler(10, new pe(c => this.setOrReportFgColor(c))), this._parser.registerOscHandler(11, new pe(c => this.setOrReportBgColor(c))), this._parser.registerOscHandler(12, new pe(c => this.setOrReportCursorColor(c))), this._parser.registerOscHandler(104, new pe(c => this.restoreIndexedColor(c))), this._parser.registerOscHandler(110, new pe(c => this.restoreFgColor(c))), this._parser.registerOscHandler(111, new pe(c => this.restoreBgColor(c))), this._parser.registerOscHandler(112, new pe(c => this.restoreCursorColor(c))), this._parser.registerEscHandler({
        final: "7"
      }, () => this.saveCursor()), this._parser.registerEscHandler({
        final: "8"
      }, () => this.restoreCursor()), this._parser.registerEscHandler({
        final: "D"
      }, () => this.index()), this._parser.registerEscHandler({
        final: "E"
      }, () => this.nextLine()), this._parser.registerEscHandler({
        final: "H"
      }, () => this.tabSet()), this._parser.registerEscHandler({
        final: "M"
      }, () => this.reverseIndex()), this._parser.registerEscHandler({
        final: "="
      }, () => this.keypadApplicationMode()), this._parser.registerEscHandler({
        final: ">"
      }, () => this.keypadNumericMode()), this._parser.registerEscHandler({
        final: "c"
      }, () => this.fullReset()), this._parser.registerEscHandler({
        final: "n"
      }, () => this.setgLevel(2)), this._parser.registerEscHandler({
        final: "o"
      }, () => this.setgLevel(3)), this._parser.registerEscHandler({
        final: "|"
      }, () => this.setgLevel(3)), this._parser.registerEscHandler({
        final: "}"
      }, () => this.setgLevel(2)), this._parser.registerEscHandler({
        final: "~"
      }, () => this.setgLevel(1)), this._parser.registerEscHandler({
        intermediates: "%",
        final: "@"
      }, () => this.selectDefaultCharset()), this._parser.registerEscHandler({
        intermediates: "%",
        final: "G"
      }, () => this.selectDefaultCharset());
      for (let c in ne) this._parser.registerEscHandler({
        intermediates: "(",
        final: c
      }, () => this.selectCharset("(" + c)), this._parser.registerEscHandler({
        intermediates: ")",
        final: c
      }, () => this.selectCharset(")" + c)), this._parser.registerEscHandler({
        intermediates: "*",
        final: c
      }, () => this.selectCharset("*" + c)), this._parser.registerEscHandler({
        intermediates: "+",
        final: c
      }, () => this.selectCharset("+" + c)), this._parser.registerEscHandler({
        intermediates: "-",
        final: c
      }, () => this.selectCharset("-" + c)), this._parser.registerEscHandler({
        intermediates: ".",
        final: c
      }, () => this.selectCharset("." + c)), this._parser.registerEscHandler({
        intermediates: "/",
        final: c
      }, () => this.selectCharset("/" + c));
      this._parser.registerEscHandler({
        intermediates: "#",
        final: "8"
      }, () => this.screenAlignmentPattern()), this._parser.setErrorHandler(c => (this._logService.error("Parsing error: ", c), c)), this._parser.registerDcsHandler({
        intermediates: "$",
        final: "q"
      }, new Xi((c, d) => this.requestStatusString(c, d)));
    }
    getAttrData() {
      return this._curAttrData;
    }
    _preserveStack(e, i, r, n) {
      this._parseStack.paused = !0, this._parseStack.cursorStartX = e, this._parseStack.cursorStartY = i, this._parseStack.decodedLength = r, this._parseStack.position = n;
    }
    _logSlowResolvingAsync(e) {
      this._logService.logLevel <= 3 && Promise.race([e, new Promise((i, r) => setTimeout(() => r("#SLOW_TIMEOUT"), vl))]).catch(i => {
        if (i !== "#SLOW_TIMEOUT") throw i;
        console.warn(`async parser handler taking longer than ${vl} ms`);
      });
    }
    _getCurrentLinkId() {
      return this._curAttrData.extended.urlId;
    }
    parse(e, i) {
      let r,
        n = this._activeBuffer.x,
        o = this._activeBuffer.y,
        l = 0,
        a = this._parseStack.paused;
      if (a) {
        if (r = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, i)) return this._logSlowResolvingAsync(r), r;
        n = this._parseStack.cursorStartX, o = this._parseStack.cursorStartY, this._parseStack.paused = !1, e.length > ut && (l = this._parseStack.position + ut);
      }
      if (this._logService.logLevel <= 1 && this._logService.debug(`parsing data ${typeof e == "string" ? ` "${e}"` : ` "${Array.prototype.map.call(e, c => String.fromCharCode(c)).join("")}"`}`), this._logService.logLevel === 0 && this._logService.trace("parsing data (codes)", typeof e == "string" ? e.split("").map(c => c.charCodeAt(0)) : e), this._parseBuffer.length < e.length && this._parseBuffer.length < ut && (this._parseBuffer = new Uint32Array(Math.min(e.length, ut))), a || this._dirtyRowTracker.clearRange(), e.length > ut) for (let c = l; c < e.length; c += ut) {
        let d = c + ut < e.length ? c + ut : e.length,
          _ = typeof e == "string" ? this._stringDecoder.decode(e.substring(c, d), this._parseBuffer) : this._utf8Decoder.decode(e.subarray(c, d), this._parseBuffer);
        if (r = this._parser.parse(this._parseBuffer, _)) return this._preserveStack(n, o, _, c), this._logSlowResolvingAsync(r), r;
      } else if (!a) {
        let c = typeof e == "string" ? this._stringDecoder.decode(e, this._parseBuffer) : this._utf8Decoder.decode(e, this._parseBuffer);
        if (r = this._parser.parse(this._parseBuffer, c)) return this._preserveStack(n, o, c, 0), this._logSlowResolvingAsync(r), r;
      }
      (this._activeBuffer.x !== n || this._activeBuffer.y !== o) && this._onCursorMove.fire();
      let u = this._dirtyRowTracker.end + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp),
        h = this._dirtyRowTracker.start + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
      h < this._bufferService.rows && this._onRequestRefreshRows.fire({
        start: Math.min(h, this._bufferService.rows - 1),
        end: Math.min(u, this._bufferService.rows - 1)
      });
    }
    print(e, i, r) {
      let n,
        o,
        l = this._charsetService.charset,
        a = this._optionsService.rawOptions.screenReaderMode,
        u = this._bufferService.cols,
        h = this._coreService.decPrivateModes.wraparound,
        c = this._coreService.modes.insertMode,
        d = this._curAttrData,
        _ = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
      this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._activeBuffer.x && r - i > 0 && _.getWidth(this._activeBuffer.x - 1) === 2 && _.setCellFromCodepoint(this._activeBuffer.x - 1, 0, 1, d);
      let p = this._parser.precedingJoinState;
      for (let m = i; m < r; ++m) {
        if (n = e[m], n < 127 && l) {
          let O = l[String.fromCharCode(n)];
          O && (n = O.charCodeAt(0));
        }
        let f = this._unicodeService.charProperties(n, p);
        o = Ae.extractWidth(f);
        let A = Ae.extractShouldJoin(f),
          R = A ? Ae.extractWidth(p) : 0;
        if (p = f, a && this._onA11yChar.fire(Ce(n)), this._getCurrentLinkId() && this._oscLinkService.addLineToLink(this._getCurrentLinkId(), this._activeBuffer.ybase + this._activeBuffer.y), this._activeBuffer.x + o - R > u) {
          if (h) {
            let O = _,
              I = this._activeBuffer.x - R;
            for (this._activeBuffer.x = R, 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), _ = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y), R > 0 && _ instanceof Ze && _.copyCellsFrom(O, I, 0, R, !1); I < u;) O.setCellFromCodepoint(I++, 0, 1, d);
          } else if (this._activeBuffer.x = u - 1, o === 2) continue;
        }
        if (A && this._activeBuffer.x) {
          let O = _.getWidth(this._activeBuffer.x - 1) ? 1 : 2;
          _.addCodepointToCell(this._activeBuffer.x - O, n, o);
          for (let I = o - R; --I >= 0;) _.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, d);
          continue;
        }
        if (c && (_.insertCells(this._activeBuffer.x, o - R, this._activeBuffer.getNullCell(d)), _.getWidth(u - 1) === 2 && _.setCellFromCodepoint(u - 1, 0, 1, d)), _.setCellFromCodepoint(this._activeBuffer.x++, n, o, d), o > 0) for (; --o;) _.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, d);
      }
      this._parser.precedingJoinState = p, this._activeBuffer.x < u && r - i > 0 && _.getWidth(this._activeBuffer.x) === 0 && !_.hasContent(this._activeBuffer.x) && _.setCellFromCodepoint(this._activeBuffer.x, 0, 1, d), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
    }
    registerCsiHandler(e, i) {
      return e.final === "t" && !e.prefix && !e.intermediates ? this._parser.registerCsiHandler(e, r => bl(r.params[0], this._optionsService.rawOptions.windowOptions) ? i(r) : !0) : this._parser.registerCsiHandler(e, i);
    }
    registerDcsHandler(e, i) {
      return this._parser.registerDcsHandler(e, new Xi(i));
    }
    registerEscHandler(e, i) {
      return this._parser.registerEscHandler(e, i);
    }
    registerOscHandler(e, i) {
      return this._parser.registerOscHandler(e, new pe(i));
    }
    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 e = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
        e.hasWidth(this._activeBuffer.x) && !e.hasContent(this._activeBuffer.x) && this._activeBuffer.x--;
      }
      return this._restrictCursor(), !0;
    }
    tab() {
      if (this._activeBuffer.x >= this._bufferService.cols) return !0;
      let e = this._activeBuffer.x;
      return this._activeBuffer.x = this._activeBuffer.nextStop(), this._optionsService.rawOptions.screenReaderMode && this._onA11yTab.fire(this._activeBuffer.x - e), !0;
    }
    shiftOut() {
      return this._charsetService.setgLevel(1), !0;
    }
    shiftIn() {
      return this._charsetService.setgLevel(0), !0;
    }
    _restrictCursor(e = this._bufferService.cols - 1) {
      this._activeBuffer.x = Math.min(e, Math.max(0, this._activeBuffer.x)), this._activeBuffer.y = this._coreService.decPrivateModes.origin ? Math.min(this._activeBuffer.scrollBottom, Math.max(this._activeBuffer.scrollTop, this._activeBuffer.y)) : Math.min(this._bufferService.rows - 1, Math.max(0, this._activeBuffer.y)), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
    }
    _setCursor(e, i) {
      this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._coreService.decPrivateModes.origin ? (this._activeBuffer.x = e, this._activeBuffer.y = this._activeBuffer.scrollTop + i) : (this._activeBuffer.x = e, this._activeBuffer.y = i), this._restrictCursor(), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
    }
    _moveCursor(e, i) {
      this._restrictCursor(), this._setCursor(this._activeBuffer.x + e, this._activeBuffer.y + i);
    }
    cursorUp(e) {
      let i = this._activeBuffer.y - this._activeBuffer.scrollTop;
      return i >= 0 ? this._moveCursor(0, -Math.min(i, e.params[0] || 1)) : this._moveCursor(0, -(e.params[0] || 1)), !0;
    }
    cursorDown(e) {
      let i = this._activeBuffer.scrollBottom - this._activeBuffer.y;
      return i >= 0 ? this._moveCursor(0, Math.min(i, e.params[0] || 1)) : this._moveCursor(0, e.params[0] || 1), !0;
    }
    cursorForward(e) {
      return this._moveCursor(e.params[0] || 1, 0), !0;
    }
    cursorBackward(e) {
      return this._moveCursor(-(e.params[0] || 1), 0), !0;
    }
    cursorNextLine(e) {
      return this.cursorDown(e), this._activeBuffer.x = 0, !0;
    }
    cursorPrecedingLine(e) {
      return this.cursorUp(e), this._activeBuffer.x = 0, !0;
    }
    cursorCharAbsolute(e) {
      return this._setCursor((e.params[0] || 1) - 1, this._activeBuffer.y), !0;
    }
    cursorPosition(e) {
      return this._setCursor(e.length >= 2 ? (e.params[1] || 1) - 1 : 0, (e.params[0] || 1) - 1), !0;
    }
    charPosAbsolute(e) {
      return this._setCursor((e.params[0] || 1) - 1, this._activeBuffer.y), !0;
    }
    hPositionRelative(e) {
      return this._moveCursor(e.params[0] || 1, 0), !0;
    }
    linePosAbsolute(e) {
      return this._setCursor(this._activeBuffer.x, (e.params[0] || 1) - 1), !0;
    }
    vPositionRelative(e) {
      return this._moveCursor(0, e.params[0] || 1), !0;
    }
    hVPosition(e) {
      return this.cursorPosition(e), !0;
    }
    tabClear(e) {
      let i = e.params[0];
      return i === 0 ? delete this._activeBuffer.tabs[this._activeBuffer.x] : i === 3 && (this._activeBuffer.tabs = {}), !0;
    }
    cursorForwardTab(e) {
      if (this._activeBuffer.x >= this._bufferService.cols) return !0;
      let i = e.params[0] || 1;
      for (; i--;) this._activeBuffer.x = this._activeBuffer.nextStop();
      return !0;
    }
    cursorBackwardTab(e) {
      if (this._activeBuffer.x >= this._bufferService.cols) return !0;
      let i = e.params[0] || 1;
      for (; i--;) this._activeBuffer.x = this._activeBuffer.prevStop();
      return !0;
    }
    selectProtected(e) {
      let i = e.params[0];
      return i === 1 && (this._curAttrData.bg |= 536870912), (i === 2 || i === 0) && (this._curAttrData.bg &= -536870913), !0;
    }
    _eraseInBufferLine(e, i, r, n = !1, o = !1) {
      let l = this._activeBuffer.lines.get(this._activeBuffer.ybase + e);
      l.replaceCells(i, r, this._activeBuffer.getNullCell(this._eraseAttrData()), o), n && (l.isWrapped = !1);
    }
    _resetBufferLine(e, i = !1) {
      let r = this._activeBuffer.lines.get(this._activeBuffer.ybase + e);
      r && (r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()), i), this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + e), r.isWrapped = !1);
    }
    eraseInDisplay(e, i = !1) {
      this._restrictCursor(this._bufferService.cols);
      let r;
      switch (e.params[0]) {
        case 0:
          for (r = this._activeBuffer.y, this._dirtyRowTracker.markDirty(r), this._eraseInBufferLine(r++, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, i); r < this._bufferService.rows; r++) this._resetBufferLine(r, i);
          this._dirtyRowTracker.markDirty(r);
          break;
        case 1:
          for (r = this._activeBuffer.y, this._dirtyRowTracker.markDirty(r), this._eraseInBufferLine(r, 0, this._activeBuffer.x + 1, !0, i), this._activeBuffer.x + 1 >= this._bufferService.cols && (this._activeBuffer.lines.get(r + 1).isWrapped = !1); r--;) this._resetBufferLine(r, i);
          this._dirtyRowTracker.markDirty(0);
          break;
        case 2:
          if (this._optionsService.rawOptions.scrollOnEraseInDisplay) {
            for (r = this._bufferService.rows, this._dirtyRowTracker.markRangeDirty(0, r - 1); r-- && !this._activeBuffer.lines.get(this._activeBuffer.ybase + r)?.getTrimmedLength(););
            for (; r >= 0; r--) this._bufferService.scroll(this._eraseAttrData());
          } else {
            for (r = this._bufferService.rows, this._dirtyRowTracker.markDirty(r - 1); r--;) this._resetBufferLine(r, i);
            this._dirtyRowTracker.markDirty(0);
          }
          break;
        case 3:
          let n = this._activeBuffer.lines.length - this._bufferService.rows;
          n > 0 && (this._activeBuffer.lines.trimStart(n), this._activeBuffer.ybase = Math.max(this._activeBuffer.ybase - n, 0), this._activeBuffer.ydisp = Math.max(this._activeBuffer.ydisp - n, 0), this._onScroll.fire(0));
          break;
      }
      return !0;
    }
    eraseInLine(e, i = !1) {
      switch (this._restrictCursor(this._bufferService.cols), e.params[0]) {
        case 0:
          this._eraseInBufferLine(this._activeBuffer.y, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, i);
          break;
        case 1:
          this._eraseInBufferLine(this._activeBuffer.y, 0, this._activeBuffer.x + 1, !1, i);
          break;
        case 2:
          this._eraseInBufferLine(this._activeBuffer.y, 0, this._bufferService.cols, !0, i);
          break;
      }
      return this._dirtyRowTracker.markDirty(this._activeBuffer.y), !0;
    }
    insertLines(e) {
      this._restrictCursor();
      let i = e.params[0] || 1;
      if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0;
      let r = this._activeBuffer.ybase + this._activeBuffer.y,
        n = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom,
        o = this._bufferService.rows - 1 + this._activeBuffer.ybase - n + 1;
      for (; i--;) this._activeBuffer.lines.splice(o - 1, 1), this._activeBuffer.lines.splice(r, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));
      return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, !0;
    }
    deleteLines(e) {
      this._restrictCursor();
      let i = e.params[0] || 1;
      if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0;
      let r = this._activeBuffer.ybase + this._activeBuffer.y,
        n;
      for (n = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom, n = this._bufferService.rows - 1 + this._activeBuffer.ybase - n; i--;) this._activeBuffer.lines.splice(r, 1), this._activeBuffer.lines.splice(n, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));
      return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, !0;
    }
    insertChars(e) {
      this._restrictCursor();
      let i = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
      return i && (i.insertCells(this._activeBuffer.x, e.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), !0;
    }
    deleteChars(e) {
      this._restrictCursor();
      let i = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
      return i && (i.deleteCells(this._activeBuffer.x, e.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), !0;
    }
    scrollUp(e) {
      let i = e.params[0] || 1;
      for (; i--;) this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 1), this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));
      return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
    }
    scrollDown(e) {
      let i = e.params[0] || 1;
      for (; i--;) 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(X));
      return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
    }
    scrollLeft(e) {
      if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0;
      let i = e.params[0] || 1;
      for (let r = this._activeBuffer.scrollTop; r <= this._activeBuffer.scrollBottom; ++r) {
        let n = this._activeBuffer.lines.get(this._activeBuffer.ybase + r);
        n.deleteCells(0, i, this._activeBuffer.getNullCell(this._eraseAttrData())), n.isWrapped = !1;
      }
      return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
    }
    scrollRight(e) {
      if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0;
      let i = e.params[0] || 1;
      for (let r = this._activeBuffer.scrollTop; r <= this._activeBuffer.scrollBottom; ++r) {
        let n = this._activeBuffer.lines.get(this._activeBuffer.ybase + r);
        n.insertCells(0, i, this._activeBuffer.getNullCell(this._eraseAttrData())), n.isWrapped = !1;
      }
      return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
    }
    insertColumns(e) {
      if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0;
      let i = e.params[0] || 1;
      for (let r = this._activeBuffer.scrollTop; r <= this._activeBuffer.scrollBottom; ++r) {
        let n = this._activeBuffer.lines.get(this._activeBuffer.ybase + r);
        n.insertCells(this._activeBuffer.x, i, this._activeBuffer.getNullCell(this._eraseAttrData())), n.isWrapped = !1;
      }
      return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
    }
    deleteColumns(e) {
      if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0;
      let i = e.params[0] || 1;
      for (let r = this._activeBuffer.scrollTop; r <= this._activeBuffer.scrollBottom; ++r) {
        let n = this._activeBuffer.lines.get(this._activeBuffer.ybase + r);
        n.deleteCells(this._activeBuffer.x, i, this._activeBuffer.getNullCell(this._eraseAttrData())), n.isWrapped = !1;
      }
      return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
    }
    eraseChars(e) {
      this._restrictCursor();
      let i = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
      return i && (i.replaceCells(this._activeBuffer.x, this._activeBuffer.x + (e.params[0] || 1), this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), !0;
    }
    repeatPrecedingCharacter(e) {
      let i = this._parser.precedingJoinState;
      if (!i) return !0;
      let r = e.params[0] || 1,
        n = Ae.extractWidth(i),
        o = this._activeBuffer.x - n,
        a = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).getString(o),
        u = new Uint32Array(a.length * r),
        h = 0;
      for (let d = 0; d < a.length;) {
        let _ = a.codePointAt(d) || 0;
        u[h++] = _, d += _ > 65535 ? 2 : 1;
      }
      let c = h;
      for (let d = 1; d < r; ++d) u.copyWithin(c, 0, h), c += h;
      return this.print(u, 0, c), !0;
    }
    sendDeviceAttributesPrimary(e) {
      return e.params[0] > 0 || (this._is("xterm") || this._is("rxvt-unicode") || this._is("screen") ? this._coreService.triggerDataEvent(b.ESC + "[?1;2c") : this._is("linux") && this._coreService.triggerDataEvent(b.ESC + "[?6c")), !0;
    }
    sendDeviceAttributesSecondary(e) {
      return e.params[0] > 0 || (this._is("xterm") ? this._coreService.triggerDataEvent(b.ESC + "[>0;276;0c") : this._is("rxvt-unicode") ? this._coreService.triggerDataEvent(b.ESC + "[>85;95;0c") : this._is("linux") ? this._coreService.triggerDataEvent(e.params[0] + "c") : this._is("screen") && this._coreService.triggerDataEvent(b.ESC + "[>83;40003;0c")), !0;
    }
    _is(e) {
      return (this._optionsService.rawOptions.termName + "").indexOf(e) === 0;
    }
    setMode(e) {
      for (let i = 0; i < e.length; i++) switch (e.params[i]) {
        case 4:
          this._coreService.modes.insertMode = !0;
          break;
        case 20:
          this._optionsService.options.convertEol = !0;
          break;
      }
      return !0;
    }
    setModePrivate(e) {
      for (let i = 0; i < e.length; i++) switch (e.params[i]) {
        case 1:
          this._coreService.decPrivateModes.applicationCursorKeys = !0;
          break;
        case 2:
          this._charsetService.setgCharset(0, Je), this._charsetService.setgCharset(1, Je), this._charsetService.setgCharset(2, Je), this._charsetService.setgCharset(3, Je);
          break;
        case 3:
          this._optionsService.rawOptions.windowOptions.setWinLines && (this._bufferService.resize(132, this._bufferService.rows), this._onRequestReset.fire());
          break;
        case 6:
          this._coreService.decPrivateModes.origin = !0, this._setCursor(0, 0);
          break;
        case 7:
          this._coreService.decPrivateModes.wraparound = !0;
          break;
        case 12:
          this._optionsService.options.cursorBlink = !0;
          break;
        case 45:
          this._coreService.decPrivateModes.reverseWraparound = !0;
          break;
        case 66:
          this._logService.debug("Serial port requested application keypad."), this._coreService.decPrivateModes.applicationKeypad = !0, this._onRequestSyncScrollBar.fire();
          break;
        case 9:
          this._coreMouseService.activeProtocol = "X10";
          break;
        case 1e3:
          this._coreMouseService.activeProtocol = "VT200";
          break;
        case 1002:
          this._coreMouseService.activeProtocol = "DRAG";
          break;
        case 1003:
          this._coreMouseService.activeProtocol = "ANY";
          break;
        case 1004:
          this._coreService.decPrivateModes.sendFocus = !0, this._onRequestSendFocus.fire();
          break;
        case 1005:
          this._logService.debug("DECSET 1005 not supported (see #2507)");
          break;
        case 1006:
          this._coreMouseService.activeEncoding = "SGR";
          break;
        case 1015:
          this._logService.debug("DECSET 1015 not supported (see #2507)");
          break;
        case 1016:
          this._coreMouseService.activeEncoding = "SGR_PIXELS";
          break;
        case 25:
          this._coreService.isCursorHidden = !1;
          break;
        case 1048:
          this.saveCursor();
          break;
        case 1049:
          this.saveCursor();
        case 47:
        case 1047:
          this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()), this._coreService.isCursorInitialized = !0, this._onRequestRefreshRows.fire(void 0), this._onRequestSyncScrollBar.fire();
          break;
        case 2004:
          this._coreService.decPrivateModes.bracketedPasteMode = !0;
          break;
        case 2026:
          this._coreService.decPrivateModes.synchronizedOutput = !0;
          break;
      }
      return !0;
    }
    resetMode(e) {
      for (let i = 0; i < e.length; i++) switch (e.params[i]) {
        case 4:
          this._coreService.modes.insertMode = !1;
          break;
        case 20:
          this._optionsService.options.convertEol = !1;
          break;
      }
      return !0;
    }
    resetModePrivate(e) {
      for (let i = 0; i < e.length; i++) switch (e.params[i]) {
        case 1:
          this._coreService.decPrivateModes.applicationCursorKeys = !1;
          break;
        case 3:
          this._optionsService.rawOptions.windowOptions.setWinLines && (this._bufferService.resize(80, this._bufferService.rows), this._onRequestReset.fire());
          break;
        case 6:
          this._coreService.decPrivateModes.origin = !1, this._setCursor(0, 0);
          break;
        case 7:
          this._coreService.decPrivateModes.wraparound = !1;
          break;
        case 12:
          this._optionsService.options.cursorBlink = !1;
          break;
        case 45:
          this._coreService.decPrivateModes.reverseWraparound = !1;
          break;
        case 66:
          this._logService.debug("Switching back to normal keypad."), this._coreService.decPrivateModes.applicationKeypad = !1, this._onRequestSyncScrollBar.fire();
          break;
        case 9:
        case 1e3:
        case 1002:
        case 1003:
          this._coreMouseService.activeProtocol = "NONE";
          break;
        case 1004:
          this._coreService.decPrivateModes.sendFocus = !1;
          break;
        case 1005:
          this._logService.debug("DECRST 1005 not supported (see #2507)");
          break;
        case 1006:
          this._coreMouseService.activeEncoding = "DEFAULT";
          break;
        case 1015:
          this._logService.debug("DECRST 1015 not supported (see #2507)");
          break;
        case 1016:
          this._coreMouseService.activeEncoding = "DEFAULT";
          break;
        case 25:
          this._coreService.isCursorHidden = !0;
          break;
        case 1048:
          this.restoreCursor();
          break;
        case 1049:
        case 47:
        case 1047:
          this._bufferService.buffers.activateNormalBuffer(), e.params[i] === 1049 && this.restoreCursor(), this._coreService.isCursorInitialized = !0, this._onRequestRefreshRows.fire(void 0), this._onRequestSyncScrollBar.fire();
          break;
        case 2004:
          this._coreService.decPrivateModes.bracketedPasteMode = !1;
          break;
        case 2026:
          this._coreService.decPrivateModes.synchronizedOutput = !1, this._onRequestRefreshRows.fire(void 0);
          break;
      }
      return !0;
    }
    requestMode(e, i) {
      let r;
      (P => (P[P.NOT_RECOGNIZED = 0] = "NOT_RECOGNIZED", P[P.SET = 1] = "SET", P[P.RESET = 2] = "RESET", P[P.PERMANENTLY_SET = 3] = "PERMANENTLY_SET", P[P.PERMANENTLY_RESET = 4] = "PERMANENTLY_RESET"))(r ||= {});
      let n = this._coreService.decPrivateModes,
        {
          activeProtocol: o,
          activeEncoding: l
        } = this._coreMouseService,
        a = this._coreService,
        {
          buffers: u,
          cols: h
        } = this._bufferService,
        {
          active: c,
          alt: d
        } = u,
        _ = this._optionsService.rawOptions,
        p = (A, R) => (a.triggerDataEvent(`${b.ESC}[${i ? "" : "?"}${A};${R}$y`), !0),
        m = A => A ? 1 : 2,
        f = e.params[0];
      return i ? f === 2 ? p(f, 4) : f === 4 ? p(f, m(a.modes.insertMode)) : f === 12 ? p(f, 3) : f === 20 ? p(f, m(_.convertEol)) : p(f, 0) : f === 1 ? p(f, m(n.applicationCursorKeys)) : f === 3 ? p(f, _.windowOptions.setWinLines ? h === 80 ? 2 : h === 132 ? 1 : 0 : 0) : f === 6 ? p(f, m(n.origin)) : f === 7 ? p(f, m(n.wraparound)) : f === 8 ? p(f, 3) : f === 9 ? p(f, m(o === "X10")) : f === 12 ? p(f, m(_.cursorBlink)) : f === 25 ? p(f, m(!a.isCursorHidden)) : f === 45 ? p(f, m(n.reverseWraparound)) : f === 66 ? p(f, m(n.applicationKeypad)) : f === 67 ? p(f, 4) : f === 1e3 ? p(f, m(o === "VT200")) : f === 1002 ? p(f, m(o === "DRAG")) : f === 1003 ? p(f, m(o === "ANY")) : f === 1004 ? p(f, m(n.sendFocus)) : f === 1005 ? p(f, 4) : f === 1006 ? p(f, m(l === "SGR")) : f === 1015 ? p(f, 4) : f === 1016 ? p(f, m(l === "SGR_PIXELS")) : f === 1048 ? p(f, 1) : f === 47 || f === 1047 || f === 1049 ? p(f, m(c === d)) : f === 2004 ? p(f, m(n.bracketedPasteMode)) : f === 2026 ? p(f, m(n.synchronizedOutput)) : p(f, 0);
    }
    _updateAttrColor(e, i, r, n, o) {
      return i === 2 ? (e |= 50331648, e &= -16777216, e |= De.fromColorRGB([r, n, o])) : i === 5 && (e &= -50331904, e |= 33554432 | r & 255), e;
    }
    _extractColor(e, i, r) {
      let n = [0, 0, -1, 0, 0, 0],
        o = 0,
        l = 0;
      do {
        if (n[l + o] = e.params[i + l], e.hasSubParams(i + l)) {
          let a = e.getSubParams(i + l),
            u = 0;
          do n[1] === 5 && (o = 1), n[l + u + 1 + o] = a[u]; while (++u < a.length && u + l + 1 + o < n.length);
          break;
        }
        if (n[1] === 5 && l + o >= 2 || n[1] === 2 && l + o >= 5) break;
        n[1] && (o = 1);
      } while (++l + i < e.length && l + o < n.length);
      for (let a = 2; a < n.length; ++a) n[a] === -1 && (n[a] = 0);
      switch (n[0]) {
        case 38:
          r.fg = this._updateAttrColor(r.fg, n[1], n[3], n[4], n[5]);
          break;
        case 48:
          r.bg = this._updateAttrColor(r.bg, n[1], n[3], n[4], n[5]);
          break;
        case 58:
          r.extended = r.extended.clone(), r.extended.underlineColor = this._updateAttrColor(r.extended.underlineColor, n[1], n[3], n[4], n[5]);
      }
      return l;
    }
    _processUnderline(e, i) {
      i.extended = i.extended.clone(), (!~e || e > 5) && (e = 1), i.extended.underlineStyle = e, i.fg |= 268435456, e === 0 && (i.fg &= -268435457), i.updateExtended();
    }
    _processSGR0(e) {
      e.fg = X.fg, e.bg = X.bg, e.extended = e.extended.clone(), e.extended.underlineStyle = 0, e.extended.underlineColor &= -67108864, e.updateExtended();
    }
    charAttributes(e) {
      if (e.length === 1 && e.params[0] === 0) return this._processSGR0(this._curAttrData), !0;
      let i = e.length,
        r,
        n = this._curAttrData;
      for (let o = 0; o < i; o++) r = e.params[o], r >= 30 && r <= 37 ? (n.fg &= -50331904, n.fg |= 16777216 | r - 30) : r >= 40 && r <= 47 ? (n.bg &= -50331904, n.bg |= 16777216 | r - 40) : r >= 90 && r <= 97 ? (n.fg &= -50331904, n.fg |= 16777216 | r - 90 | 8) : r >= 100 && r <= 107 ? (n.bg &= -50331904, n.bg |= 16777216 | r - 100 | 8) : r === 0 ? this._processSGR0(n) : r === 1 ? n.fg |= 134217728 : r === 3 ? n.bg |= 67108864 : r === 4 ? (n.fg |= 268435456, this._processUnderline(e.hasSubParams(o) ? e.getSubParams(o)[0] : 1, n)) : r === 5 ? n.fg |= 536870912 : r === 7 ? n.fg |= 67108864 : r === 8 ? n.fg |= 1073741824 : r === 9 ? n.fg |= 2147483648 : r === 2 ? n.bg |= 134217728 : r === 21 ? this._processUnderline(2, n) : r === 22 ? (n.fg &= -134217729, n.bg &= -134217729) : r === 23 ? n.bg &= -67108865 : r === 24 ? (n.fg &= -268435457, this._processUnderline(0, n)) : r === 25 ? n.fg &= -536870913 : r === 27 ? n.fg &= -67108865 : r === 28 ? n.fg &= -1073741825 : r === 29 ? n.fg &= 2147483647 : r === 39 ? (n.fg &= -67108864, n.fg |= X.fg & 16777215) : r === 49 ? (n.bg &= -67108864, n.bg |= X.bg & 16777215) : r === 38 || r === 48 || r === 58 ? o += this._extractColor(e, o, n) : r === 53 ? n.bg |= 1073741824 : r === 55 ? n.bg &= -1073741825 : r === 59 ? (n.extended = n.extended.clone(), n.extended.underlineColor = -1, n.updateExtended()) : r === 100 ? (n.fg &= -67108864, n.fg |= X.fg & 16777215, n.bg &= -67108864, n.bg |= X.bg & 16777215) : this._logService.debug("Unknown SGR attribute: %d.", r);
      return !0;
    }
    deviceStatus(e) {
      switch (e.params[0]) {
        case 5:
          this._coreService.triggerDataEvent(`${b.ESC}[0n`);
          break;
        case 6:
          let i = this._activeBuffer.y + 1,
            r = this._activeBuffer.x + 1;
          this._coreService.triggerDataEvent(`${b.ESC}[${i};${r}R`);
          break;
      }
      return !0;
    }
    deviceStatusPrivate(e) {
      switch (e.params[0]) {
        case 6:
          let i = this._activeBuffer.y + 1,
            r = this._activeBuffer.x + 1;
          this._coreService.triggerDataEvent(`${b.ESC}[?${i};${r}R`);
          break;
        case 15:
          break;
        case 25:
          break;
        case 26:
          break;
        case 53:
          break;
      }
      return !0;
    }
    softReset(e) {
      return this._coreService.isCursorHidden = !1, this._onRequestSyncScrollBar.fire(), this._activeBuffer.scrollTop = 0, this._activeBuffer.scrollBottom = this._bufferService.rows - 1, this._curAttrData = X.clone(), this._coreService.reset(), this._charsetService.reset(), this._activeBuffer.savedX = 0, this._activeBuffer.savedY = this._activeBuffer.ybase, this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg, this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg, this._activeBuffer.savedCharset = this._charsetService.charset, this._coreService.decPrivateModes.origin = !1, !0;
    }
    setCursorStyle(e) {
      let i = e.length === 0 ? 1 : e.params[0];
      if (i === 0) this._coreService.decPrivateModes.cursorStyle = void 0, this._coreService.decPrivateModes.cursorBlink = void 0;else {
        switch (i) {
          case 1:
          case 2:
            this._coreService.decPrivateModes.cursorStyle = "block";
            break;
          case 3:
          case 4:
            this._coreService.decPrivateModes.cursorStyle = "underline";
            break;
          case 5:
          case 6:
            this._coreService.decPrivateModes.cursorStyle = "bar";
            break;
        }
        let r = i % 2 === 1;
        this._coreService.decPrivateModes.cursorBlink = r;
      }
      return !0;
    }
    setScrollRegion(e) {
      let i = e.params[0] || 1,
        r;
      return (e.length < 2 || (r = e.params[1]) > this._bufferService.rows || r === 0) && (r = this._bufferService.rows), r > i && (this._activeBuffer.scrollTop = i - 1, this._activeBuffer.scrollBottom = r - 1, this._setCursor(0, 0)), !0;
    }
    windowOptions(e) {
      if (!bl(e.params[0], this._optionsService.rawOptions.windowOptions)) return !0;
      let i = e.length > 1 ? e.params[1] : 0;
      switch (e.params[0]) {
        case 14:
          i !== 2 && this._onRequestWindowsOptionsReport.fire(0);
          break;
        case 16:
          this._onRequestWindowsOptionsReport.fire(1);
          break;
        case 18:
          this._bufferService && this._coreService.triggerDataEvent(`${b.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);
          break;
        case 22:
          (i === 0 || i === 2) && (this._windowTitleStack.push(this._windowTitle), this._windowTitleStack.length > _l && this._windowTitleStack.shift()), (i === 0 || i === 1) && (this._iconNameStack.push(this._iconName), this._iconNameStack.length > _l && this._iconNameStack.shift());
          break;
        case 23:
          (i === 0 || i === 2) && this._windowTitleStack.length && this.setTitle(this._windowTitleStack.pop()), (i === 0 || i === 1) && this._iconNameStack.length && this.setIconName(this._iconNameStack.pop());
          break;
      }
      return !0;
    }
    saveCursor(e) {
      return this._activeBuffer.savedX = this._activeBuffer.x, this._activeBuffer.savedY = this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg, this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg, this._activeBuffer.savedCharset = this._charsetService.charset, !0;
    }
    restoreCursor(e) {
      return this._activeBuffer.x = this._activeBuffer.savedX || 0, this._activeBuffer.y = Math.max(this._activeBuffer.savedY - this._activeBuffer.ybase, 0), this._curAttrData.fg = this._activeBuffer.savedCurAttrData.fg, this._curAttrData.bg = this._activeBuffer.savedCurAttrData.bg, this._charsetService.charset = this._savedCharset, this._activeBuffer.savedCharset && (this._charsetService.charset = this._activeBuffer.savedCharset), this._restrictCursor(), !0;
    }
    setTitle(e) {
      return this._windowTitle = e, this._onTitleChange.fire(e), !0;
    }
    setIconName(e) {
      return this._iconName = e, !0;
    }
    setOrReportIndexedColor(e) {
      let i = [],
        r = e.split(";");
      for (; r.length > 1;) {
        let n = r.shift(),
          o = r.shift();
        if (/^\d+$/.exec(n)) {
          let l = parseInt(n);
          if (Sl(l)) if (o === "?") i.push({
            type: 0,
            index: l
          });else {
            let a = Ws(o);
            a && i.push({
              type: 1,
              index: l,
              color: a
            });
          }
        }
      }
      return i.length && this._onColor.fire(i), !0;
    }
    setHyperlink(e) {
      let i = e.indexOf(";");
      if (i === -1) return !0;
      let r = e.slice(0, i).trim(),
        n = e.slice(i + 1);
      return n ? this._createHyperlink(r, n) : r.trim() ? !1 : this._finishHyperlink();
    }
    _createHyperlink(e, i) {
      this._getCurrentLinkId() && this._finishHyperlink();
      let r = e.split(":"),
        n,
        o = r.findIndex(l => l.startsWith("id="));
      return o !== -1 && (n = r[o].slice(3) || void 0), this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = this._oscLinkService.registerLink({
        id: n,
        uri: i
      }), this._curAttrData.updateExtended(), !0;
    }
    _finishHyperlink() {
      return this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = 0, this._curAttrData.updateExtended(), !0;
    }
    _setOrReportSpecialColor(e, i) {
      let r = e.split(";");
      for (let n = 0; n < r.length && !(i >= this._specialColors.length); ++n, ++i) if (r[n] === "?") this._onColor.fire([{
        type: 0,
        index: this._specialColors[i]
      }]);else {
        let o = Ws(r[n]);
        o && this._onColor.fire([{
          type: 1,
          index: this._specialColors[i],
          color: o
        }]);
      }
      return !0;
    }
    setOrReportFgColor(e) {
      return this._setOrReportSpecialColor(e, 0);
    }
    setOrReportBgColor(e) {
      return this._setOrReportSpecialColor(e, 1);
    }
    setOrReportCursorColor(e) {
      return this._setOrReportSpecialColor(e, 2);
    }
    restoreIndexedColor(e) {
      if (!e) return this._onColor.fire([{
        type: 2
      }]), !0;
      let i = [],
        r = e.split(";");
      for (let n = 0; n < r.length; ++n) if (/^\d+$/.exec(r[n])) {
        let o = parseInt(r[n]);
        Sl(o) && i.push({
          type: 2,
          index: o
        });
      }
      return i.length && this._onColor.fire(i), !0;
    }
    restoreFgColor(e) {
      return this._onColor.fire([{
        type: 2,
        index: 256
      }]), !0;
    }
    restoreBgColor(e) {
      return this._onColor.fire([{
        type: 2,
        index: 257
      }]), !0;
    }
    restoreCursorColor(e) {
      return this._onColor.fire([{
        type: 2,
        index: 258
      }]), !0;
    }
    nextLine() {
      return this._activeBuffer.x = 0, this.index(), !0;
    }
    keypadApplicationMode() {
      return this._logService.debug("Serial port requested application keypad."), this._coreService.decPrivateModes.applicationKeypad = !0, this._onRequestSyncScrollBar.fire(), !0;
    }
    keypadNumericMode() {
      return this._logService.debug("Switching back to normal keypad."), this._coreService.decPrivateModes.applicationKeypad = !1, this._onRequestSyncScrollBar.fire(), !0;
    }
    selectDefaultCharset() {
      return this._charsetService.setgLevel(0), this._charsetService.setgCharset(0, Je), !0;
    }
    selectCharset(e) {
      return e.length !== 2 ? (this.selectDefaultCharset(), !0) : (e[0] === "/" || this._charsetService.setgCharset(mc[e[0]], ne[e[1]] || Je), !0);
    }
    index() {
      return this._restrictCursor(), this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData())) : this._activeBuffer.y >= this._bufferService.rows && (this._activeBuffer.y = this._bufferService.rows - 1), this._restrictCursor(), !0;
    }
    tabSet() {
      return this._activeBuffer.tabs[this._activeBuffer.x] = !0, !0;
    }
    reverseIndex() {
      if (this._restrictCursor(), this._activeBuffer.y === this._activeBuffer.scrollTop) {
        let e = this._activeBuffer.scrollBottom - this._activeBuffer.scrollTop;
        this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase + this._activeBuffer.y, e, 1), this._activeBuffer.lines.set(this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.getBlankLine(this._eraseAttrData())), this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);
      } else this._activeBuffer.y--, this._restrictCursor();
      return !0;
    }
    fullReset() {
      return this._parser.reset(), this._onRequestReset.fire(), !0;
    }
    reset() {
      this._curAttrData = X.clone(), this._eraseAttrDataInternal = X.clone();
    }
    _eraseAttrData() {
      return this._eraseAttrDataInternal.bg &= -67108864, this._eraseAttrDataInternal.bg |= this._curAttrData.bg & 67108863, this._eraseAttrDataInternal;
    }
    setgLevel(e) {
      return this._charsetService.setgLevel(e), !0;
    }
    screenAlignmentPattern() {
      let e = new q();
      e.content = 1 << 22 | 69, e.fg = this._curAttrData.fg, e.bg = this._curAttrData.bg, this._setCursor(0, 0);
      for (let i = 0; i < this._bufferService.rows; ++i) {
        let r = this._activeBuffer.ybase + this._activeBuffer.y + i,
          n = this._activeBuffer.lines.get(r);
        n && (n.fill(e), n.isWrapped = !1);
      }
      return this._dirtyRowTracker.markAllDirty(), this._setCursor(0, 0), !0;
    }
    requestStatusString(e, i) {
      let r = a => (this._coreService.triggerDataEvent(`${b.ESC}${a}${b.ESC}\\`), !0),
        n = this._bufferService.buffer,
        o = this._optionsService.rawOptions,
        l = {
          block: 2,
          underline: 4,
          bar: 6
        };
      return r(e === '"q' ? `P1$r${this._curAttrData.isProtected() ? 1 : 0}"q` : e === '"p' ? 'P1$r61;1"p' : e === "r" ? `P1$r${n.scrollTop + 1};${n.scrollBottom + 1}r` : e === "m" ? "P1$r0m" : e === " q" ? `P1$r${l[o.cursorStyle] - (o.cursorBlink ? 1 : 0)} q` : "P0$r");
    }
    markRangeDirty(e, i) {
      this._dirtyRowTracker.markRangeDirty(e, i);
    }
  },
  Zi = class {
    constructor(t) {
      this._bufferService = t;
      this.clearRange();
    }
    clearRange() {
      this.start = this._bufferService.buffer.y, this.end = this._bufferService.buffer.y;
    }
    markDirty(t) {
      t < this.start ? this.start = t : t > this.end && (this.end = t);
    }
    markRangeDirty(t, e) {
      t > e && (gl = t, t = e, e = gl), t < this.start && (this.start = t), e > this.end && (this.end = e);
    }
    markAllDirty() {
      this.markRangeDirty(0, this._bufferService.rows - 1);
    }
  };
Zi = M([S(0, F)], Zi);
function Sl(s) {
  return 0 <= s && s < 256;
}
var _c = 5e7,
  El = 12,
  bc = 50,
  gn = class extends D {
    constructor(e) {
      super();
      this._action = e;
      this._writeBuffer = [];
      this._callbacks = [];
      this._pendingData = 0;
      this._bufferOffset = 0;
      this._isSyncWriting = !1;
      this._syncCalls = 0;
      this._didUserInput = !1;
      this._onWriteParsed = this._register(new v());
      this.onWriteParsed = this._onWriteParsed.event;
    }
    handleUserInput() {
      this._didUserInput = !0;
    }
    writeSync(e, i) {
      if (i !== void 0 && this._syncCalls > i) {
        this._syncCalls = 0;
        return;
      }
      if (this._pendingData += e.length, this._writeBuffer.push(e), this._callbacks.push(void 0), this._syncCalls++, this._isSyncWriting) return;
      this._isSyncWriting = !0;
      let r;
      for (; r = this._writeBuffer.shift();) {
        this._action(r);
        let n = this._callbacks.shift();
        n && n();
      }
      this._pendingData = 0, this._bufferOffset = 2147483647, this._isSyncWriting = !1, this._syncCalls = 0;
    }
    write(e, i) {
      if (this._pendingData > _c) throw new Error("write data discarded, use flow control to avoid losing data");
      if (!this._writeBuffer.length) {
        if (this._bufferOffset = 0, this._didUserInput) {
          this._didUserInput = !1, this._pendingData += e.length, this._writeBuffer.push(e), this._callbacks.push(i), this._innerWrite();
          return;
        }
        setTimeout(() => this._innerWrite());
      }
      this._pendingData += e.length, this._writeBuffer.push(e), this._callbacks.push(i);
    }
    _innerWrite(e = 0, i = !0) {
      let r = e || performance.now();
      for (; this._writeBuffer.length > this._bufferOffset;) {
        let n = this._writeBuffer[this._bufferOffset],
          o = this._action(n, i);
        if (o) {
          let a = u => performance.now() - r >= El ? setTimeout(() => this._innerWrite(0, u)) : this._innerWrite(r, u);
          o.catch(u => (queueMicrotask(() => {
            throw u;
          }), Promise.resolve(!1))).then(a);
          return;
        }
        let l = this._callbacks[this._bufferOffset];
        if (l && l(), this._bufferOffset++, this._pendingData -= n.length, performance.now() - r >= El) break;
      }
      this._writeBuffer.length > this._bufferOffset ? (this._bufferOffset > bc && (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();
    }
  };
var ui = class {
  constructor(t) {
    this._bufferService = t;
    this._nextId = 1;
    this._entriesWithId = new Map();
    this._dataByLinkId = new Map();
  }
  registerLink(t) {
    let e = this._bufferService.buffer;
    if (t.id === void 0) {
      let a = e.addMarker(e.ybase + e.y),
        u = {
          data: t,
          id: this._nextId++,
          lines: [a]
        };
      return a.onDispose(() => this._removeMarkerFromLink(u, a)), this._dataByLinkId.set(u.id, u), u.id;
    }
    let i = t,
      r = this._getEntryIdKey(i),
      n = this._entriesWithId.get(r);
    if (n) return this.addLineToLink(n.id, e.ybase + e.y), n.id;
    let o = e.addMarker(e.ybase + e.y),
      l = {
        id: this._nextId++,
        key: this._getEntryIdKey(i),
        data: i,
        lines: [o]
      };
    return o.onDispose(() => this._removeMarkerFromLink(l, o)), this._entriesWithId.set(l.key, l), this._dataByLinkId.set(l.id, l), l.id;
  }
  addLineToLink(t, e) {
    let i = this._dataByLinkId.get(t);
    if (i && i.lines.every(r => r.line !== e)) {
      let r = this._bufferService.buffer.addMarker(e);
      i.lines.push(r), r.onDispose(() => this._removeMarkerFromLink(i, r));
    }
  }
  getLinkData(t) {
    return this._dataByLinkId.get(t)?.data;
  }
  _getEntryIdKey(t) {
    return `${t.id};;${t.uri}`;
  }
  _removeMarkerFromLink(t, e) {
    let i = t.lines.indexOf(e);
    i !== -1 && (t.lines.splice(i, 1), t.lines.length === 0 && (t.data.id !== void 0 && this._entriesWithId.delete(t.key), this._dataByLinkId.delete(t.id)));
  }
};
ui = M([S(0, F)], ui);
var Tl = !1,
  Sn = class extends D {
    constructor(e) {
      super();
      this._windowsWrappingHeuristics = this._register(new ye());
      this._onBinary = this._register(new v());
      this.onBinary = this._onBinary.event;
      this._onData = this._register(new v());
      this.onData = this._onData.event;
      this._onLineFeed = this._register(new v());
      this.onLineFeed = this._onLineFeed.event;
      this._onResize = this._register(new v());
      this.onResize = this._onResize.event;
      this._onWriteParsed = this._register(new v());
      this.onWriteParsed = this._onWriteParsed.event;
      this._onScroll = this._register(new v());
      this._instantiationService = new ln(), this.optionsService = this._register(new dn(e)), this._instantiationService.setService(H, this.optionsService), this._bufferService = this._register(this._instantiationService.createInstance(ni)), this._instantiationService.setService(F, this._bufferService), this._logService = this._register(this._instantiationService.createInstance(ii)), this._instantiationService.setService(nr, this._logService), this.coreService = this._register(this._instantiationService.createInstance(li)), this._instantiationService.setService(ge, this.coreService), this.coreMouseService = this._register(this._instantiationService.createInstance(ai)), this._instantiationService.setService(rr, this.coreMouseService), this.unicodeService = this._register(this._instantiationService.createInstance(Ae)), this._instantiationService.setService(Js, this.unicodeService), this._charsetService = this._instantiationService.createInstance(pn), this._instantiationService.setService(Zs, this._charsetService), this._oscLinkService = this._instantiationService.createInstance(ui), this._instantiationService.setService(sr, this._oscLinkService), this._inputHandler = this._register(new vn(this._bufferService, this._charsetService, this.coreService, this._logService, this.optionsService, this._oscLinkService, this.coreMouseService, this.unicodeService)), this._register($.forward(this._inputHandler.onLineFeed, this._onLineFeed)), this._register(this._inputHandler), this._register($.forward(this._bufferService.onResize, this._onResize)), this._register($.forward(this.coreService.onData, this._onData)), this._register($.forward(this.coreService.onBinary, this._onBinary)), this._register(this.coreService.onRequestScrollToBottom(() => this.scrollToBottom(!0))), this._register(this.coreService.onUserInput(() => this._writeBuffer.handleUserInput())), this._register(this.optionsService.onMultipleOptionChange(["windowsMode", "windowsPty"], () => this._handleWindowsPtyOptionChange())), this._register(this._bufferService.onScroll(() => {
        this._onScroll.fire({
          position: this._bufferService.buffer.ydisp
        }), this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);
      })), this._writeBuffer = this._register(new gn((i, r) => this._inputHandler.parse(i, r))), this._register($.forward(this._writeBuffer.onWriteParsed, this._onWriteParsed));
    }
    get onScroll() {
      return this._onScrollApi || (this._onScrollApi = this._register(new v()), this._onScroll.event(e => {
        this._onScrollApi?.fire(e.position);
      })), this._onScrollApi.event;
    }
    get cols() {
      return this._bufferService.cols;
    }
    get rows() {
      return this._bufferService.rows;
    }
    get buffers() {
      return this._bufferService.buffers;
    }
    get options() {
      return this.optionsService.options;
    }
    set options(e) {
      for (let i in e) this.optionsService.options[i] = e[i];
    }
    write(e, i) {
      this._writeBuffer.write(e, i);
    }
    writeSync(e, i) {
      this._logService.logLevel <= 3 && !Tl && (this._logService.warn("writeSync is unreliable and will be removed soon."), Tl = !0), this._writeBuffer.writeSync(e, i);
    }
    input(e, i = !0) {
      this.coreService.triggerDataEvent(e, i);
    }
    resize(e, i) {
      isNaN(e) || isNaN(i) || (e = Math.max(e, ks), i = Math.max(i, Cs), this._bufferService.resize(e, i));
    }
    scroll(e, i = !1) {
      this._bufferService.scroll(e, i);
    }
    scrollLines(e, i) {
      this._bufferService.scrollLines(e, i);
    }
    scrollPages(e) {
      this.scrollLines(e * (this.rows - 1));
    }
    scrollToTop() {
      this.scrollLines(-this._bufferService.buffer.ydisp);
    }
    scrollToBottom(e) {
      this.scrollLines(this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
    }
    scrollToLine(e) {
      let i = e - this._bufferService.buffer.ydisp;
      i !== 0 && this.scrollLines(i);
    }
    registerEscHandler(e, i) {
      return this._inputHandler.registerEscHandler(e, i);
    }
    registerDcsHandler(e, i) {
      return this._inputHandler.registerDcsHandler(e, i);
    }
    registerCsiHandler(e, i) {
      return this._inputHandler.registerCsiHandler(e, i);
    }
    registerOscHandler(e, i) {
      return this._inputHandler.registerOscHandler(e, i);
    }
    _setup() {
      this._handleWindowsPtyOptionChange();
    }
    reset() {
      this._inputHandler.reset(), this._bufferService.reset(), this._charsetService.reset(), this.coreService.reset(), this.coreMouseService.reset();
    }
    _handleWindowsPtyOptionChange() {
      let e = !1,
        i = this.optionsService.rawOptions.windowsPty;
      i && i.buildNumber !== void 0 && i.buildNumber !== void 0 ? e = i.backend === "conpty" && i.buildNumber < 21376 : this.optionsService.rawOptions.windowsMode && (e = !0), e ? this._enableWindowsWrappingHeuristics() : this._windowsWrappingHeuristics.clear();
    }
    _enableWindowsWrappingHeuristics() {
      if (!this._windowsWrappingHeuristics.value) {
        let e = [];
        e.push(this.onLineFeed(Bs.bind(null, this._bufferService))), e.push(this.registerCsiHandler({
          final: "H"
        }, () => (Bs(this._bufferService), !1))), this._windowsWrappingHeuristics.value = C(() => {
          for (let i of e) i.dispose();
        });
      }
    }
  };
var gc = {
  48: ["0", ")"],
  49: ["1", "!"],
  50: ["2", "@"],
  51: ["3", "#"],
  52: ["4", "$"],
  53: ["5", "%"],
  54: ["6", "^"],
  55: ["7", "&"],
  56: ["8", "*"],
  57: ["9", "("],
  186: [";", ":"],
  187: ["=", "+"],
  188: [",", "<"],
  189: ["-", "_"],
  190: [".", ">"],
  191: ["/", "?"],
  192: ["`", "~"],
  219: ["[", "{"],
  220: ["\\", "|"],
  221: ["]", "}"],
  222: ["'", '"']
};
function Il(s, t, e, i) {
  let r = {
      type: 0,
      cancel: !1,
      key: void 0
    },
    n = (s.shiftKey ? 1 : 0) | (s.altKey ? 2 : 0) | (s.ctrlKey ? 4 : 0) | (s.metaKey ? 8 : 0);
  switch (s.keyCode) {
    case 0:
      s.key === "UIKeyInputUpArrow" ? t ? r.key = b.ESC + "OA" : r.key = b.ESC + "[A" : s.key === "UIKeyInputLeftArrow" ? t ? r.key = b.ESC + "OD" : r.key = b.ESC + "[D" : s.key === "UIKeyInputRightArrow" ? t ? r.key = b.ESC + "OC" : r.key = b.ESC + "[C" : s.key === "UIKeyInputDownArrow" && (t ? r.key = b.ESC + "OB" : r.key = b.ESC + "[B");
      break;
    case 8:
      r.key = s.ctrlKey ? "\b" : b.DEL, s.altKey && (r.key = b.ESC + r.key);
      break;
    case 9:
      if (s.shiftKey) {
        r.key = b.ESC + "[Z";
        break;
      }
      r.key = b.HT, r.cancel = !0;
      break;
    case 13:
      r.key = s.altKey ? b.ESC + b.CR : b.CR, r.cancel = !0;
      break;
    case 27:
      r.key = b.ESC, s.altKey && (r.key = b.ESC + b.ESC), r.cancel = !0;
      break;
    case 37:
      if (s.metaKey) break;
      n ? r.key = b.ESC + "[1;" + (n + 1) + "D" : t ? r.key = b.ESC + "OD" : r.key = b.ESC + "[D";
      break;
    case 39:
      if (s.metaKey) break;
      n ? r.key = b.ESC + "[1;" + (n + 1) + "C" : t ? r.key = b.ESC + "OC" : r.key = b.ESC + "[C";
      break;
    case 38:
      if (s.metaKey) break;
      n ? r.key = b.ESC + "[1;" + (n + 1) + "A" : t ? r.key = b.ESC + "OA" : r.key = b.ESC + "[A";
      break;
    case 40:
      if (s.metaKey) break;
      n ? r.key = b.ESC + "[1;" + (n + 1) + "B" : t ? r.key = b.ESC + "OB" : r.key = b.ESC + "[B";
      break;
    case 45:
      !s.shiftKey && !s.ctrlKey && (r.key = b.ESC + "[2~");
      break;
    case 46:
      n ? r.key = b.ESC + "[3;" + (n + 1) + "~" : r.key = b.ESC + "[3~";
      break;
    case 36:
      n ? r.key = b.ESC + "[1;" + (n + 1) + "H" : t ? r.key = b.ESC + "OH" : r.key = b.ESC + "[H";
      break;
    case 35:
      n ? r.key = b.ESC + "[1;" + (n + 1) + "F" : t ? r.key = b.ESC + "OF" : r.key = b.ESC + "[F";
      break;
    case 33:
      s.shiftKey ? r.type = 2 : s.ctrlKey ? r.key = b.ESC + "[5;" + (n + 1) + "~" : r.key = b.ESC + "[5~";
      break;
    case 34:
      s.shiftKey ? r.type = 3 : s.ctrlKey ? r.key = b.ESC + "[6;" + (n + 1) + "~" : r.key = b.ESC + "[6~";
      break;
    case 112:
      n ? r.key = b.ESC + "[1;" + (n + 1) + "P" : r.key = b.ESC + "OP";
      break;
    case 113:
      n ? r.key = b.ESC + "[1;" + (n + 1) + "Q" : r.key = b.ESC + "OQ";
      break;
    case 114:
      n ? r.key = b.ESC + "[1;" + (n + 1) + "R" : r.key = b.ESC + "OR";
      break;
    case 115:
      n ? r.key = b.ESC + "[1;" + (n + 1) + "S" : r.key = b.ESC + "OS";
      break;
    case 116:
      n ? r.key = b.ESC + "[15;" + (n + 1) + "~" : r.key = b.ESC + "[15~";
      break;
    case 117:
      n ? r.key = b.ESC + "[17;" + (n + 1) + "~" : r.key = b.ESC + "[17~";
      break;
    case 118:
      n ? r.key = b.ESC + "[18;" + (n + 1) + "~" : r.key = b.ESC + "[18~";
      break;
    case 119:
      n ? r.key = b.ESC + "[19;" + (n + 1) + "~" : r.key = b.ESC + "[19~";
      break;
    case 120:
      n ? r.key = b.ESC + "[20;" + (n + 1) + "~" : r.key = b.ESC + "[20~";
      break;
    case 121:
      n ? r.key = b.ESC + "[21;" + (n + 1) + "~" : r.key = b.ESC + "[21~";
      break;
    case 122:
      n ? r.key = b.ESC + "[23;" + (n + 1) + "~" : r.key = b.ESC + "[23~";
      break;
    case 123:
      n ? r.key = b.ESC + "[24;" + (n + 1) + "~" : r.key = b.ESC + "[24~";
      break;
    default:
      if (s.ctrlKey && !s.shiftKey && !s.altKey && !s.metaKey) s.keyCode >= 65 && s.keyCode <= 90 ? r.key = String.fromCharCode(s.keyCode - 64) : s.keyCode === 32 ? r.key = b.NUL : s.keyCode >= 51 && s.keyCode <= 55 ? r.key = String.fromCharCode(s.keyCode - 51 + 27) : s.keyCode === 56 ? r.key = b.DEL : s.keyCode === 219 ? r.key = b.ESC : s.keyCode === 220 ? r.key = b.FS : s.keyCode === 221 && (r.key = b.GS);else if ((!e || i) && s.altKey && !s.metaKey) {
        let l = gc[s.keyCode]?.[s.shiftKey ? 1 : 0];
        if (l) r.key = b.ESC + l;else if (s.keyCode >= 65 && s.keyCode <= 90) {
          let a = s.ctrlKey ? s.keyCode - 64 : s.keyCode + 32,
            u = String.fromCharCode(a);
          s.shiftKey && (u = u.toUpperCase()), r.key = b.ESC + u;
        } else if (s.keyCode === 32) r.key = b.ESC + (s.ctrlKey ? b.NUL : " ");else if (s.key === "Dead" && s.code.startsWith("Key")) {
          let a = s.code.slice(3, 4);
          s.shiftKey || (a = a.toLowerCase()), r.key = b.ESC + a, r.cancel = !0;
        }
      } else e && !s.altKey && !s.ctrlKey && !s.shiftKey && s.metaKey ? s.keyCode === 65 && (r.type = 1) : s.key && !s.ctrlKey && !s.altKey && !s.metaKey && s.keyCode >= 48 && s.key.length === 1 ? r.key = s.key : s.key && s.ctrlKey && (s.key === "_" && (r.key = b.US), s.key === "@" && (r.key = b.NUL));
      break;
  }
  return r;
}
var ee = 0,
  En = class {
    constructor(t) {
      this._getKey = t;
      this._array = [];
      this._insertedValues = [];
      this._flushInsertedTask = new Jt();
      this._isFlushingInserted = !1;
      this._deletedIndices = [];
      this._flushDeletedTask = new Jt();
      this._isFlushingDeleted = !1;
    }
    clear() {
      this._array.length = 0, this._insertedValues.length = 0, this._flushInsertedTask.clear(), this._isFlushingInserted = !1, this._deletedIndices.length = 0, this._flushDeletedTask.clear(), this._isFlushingDeleted = !1;
    }
    insert(t) {
      this._flushCleanupDeleted(), this._insertedValues.length === 0 && this._flushInsertedTask.enqueue(() => this._flushInserted()), this._insertedValues.push(t);
    }
    _flushInserted() {
      let t = this._insertedValues.sort((n, o) => this._getKey(n) - this._getKey(o)),
        e = 0,
        i = 0,
        r = new Array(this._array.length + this._insertedValues.length);
      for (let n = 0; n < r.length; n++) i >= this._array.length || this._getKey(t[e]) <= this._getKey(this._array[i]) ? (r[n] = t[e], e++) : r[n] = this._array[i++];
      this._array = r, this._insertedValues.length = 0;
    }
    _flushCleanupInserted() {
      !this._isFlushingInserted && this._insertedValues.length > 0 && this._flushInsertedTask.flush();
    }
    delete(t) {
      if (this._flushCleanupInserted(), this._array.length === 0) return !1;
      let e = this._getKey(t);
      if (e === void 0 || (ee = this._search(e), ee === -1) || this._getKey(this._array[ee]) !== e) return !1;
      do if (this._array[ee] === t) return this._deletedIndices.length === 0 && this._flushDeletedTask.enqueue(() => this._flushDeleted()), this._deletedIndices.push(ee), !0; while (++ee < this._array.length && this._getKey(this._array[ee]) === e);
      return !1;
    }
    _flushDeleted() {
      this._isFlushingDeleted = !0;
      let t = this._deletedIndices.sort((n, o) => n - o),
        e = 0,
        i = new Array(this._array.length - t.length),
        r = 0;
      for (let n = 0; n < this._array.length; n++) t[e] === n ? e++ : i[r++] = this._array[n];
      this._array = i, this._deletedIndices.length = 0, this._isFlushingDeleted = !1;
    }
    _flushCleanupDeleted() {
      !this._isFlushingDeleted && this._deletedIndices.length > 0 && this._flushDeletedTask.flush();
    }
    *getKeyIterator(t) {
      if (this._flushCleanupInserted(), this._flushCleanupDeleted(), this._array.length !== 0 && (ee = this._search(t), !(ee < 0 || ee >= this._array.length) && this._getKey(this._array[ee]) === t)) do yield this._array[ee]; while (++ee < this._array.length && this._getKey(this._array[ee]) === t);
    }
    forEachByKey(t, e) {
      if (this._flushCleanupInserted(), this._flushCleanupDeleted(), this._array.length !== 0 && (ee = this._search(t), !(ee < 0 || ee >= this._array.length) && this._getKey(this._array[ee]) === t)) do e(this._array[ee]); while (++ee < this._array.length && this._getKey(this._array[ee]) === t);
    }
    values() {
      return this._flushCleanupInserted(), this._flushCleanupDeleted(), [...this._array].values();
    }
    _search(t) {
      let e = 0,
        i = this._array.length - 1;
      for (; i >= e;) {
        let r = e + i >> 1,
          n = this._getKey(this._array[r]);
        if (n > t) i = r - 1;else if (n < t) e = r + 1;else {
          for (; r > 0 && this._getKey(this._array[r - 1]) === t;) r--;
          return r;
        }
      }
      return e;
    }
  };
var Us = 0,
  yl = 0,
  Tn = class extends D {
    constructor() {
      super();
      this._decorations = new En(e => e?.marker.line);
      this._onDecorationRegistered = this._register(new v());
      this.onDecorationRegistered = this._onDecorationRegistered.event;
      this._onDecorationRemoved = this._register(new v());
      this.onDecorationRemoved = this._onDecorationRemoved.event;
      this._register(C(() => this.reset()));
    }
    get decorations() {
      return this._decorations.values();
    }
    registerDecoration(e) {
      if (e.marker.isDisposed) return;
      let i = new Ks(e);
      if (i) {
        let r = i.marker.onDispose(() => i.dispose()),
          n = i.onDispose(() => {
            n.dispose(), i && (this._decorations.delete(i) && this._onDecorationRemoved.fire(i), r.dispose());
          });
        this._decorations.insert(i), this._onDecorationRegistered.fire(i);
      }
      return i;
    }
    reset() {
      for (let e of this._decorations.values()) e.dispose();
      this._decorations.clear();
    }
    *getDecorationsAtCell(e, i, r) {
      let n = 0,
        o = 0;
      for (let l of this._decorations.getKeyIterator(i)) n = l.options.x ?? 0, o = n + (l.options.width ?? 1), e >= n && e < o && (!r || (l.options.layer ?? "bottom") === r) && (yield l);
    }
    forEachDecorationAtCell(e, i, r, n) {
      this._decorations.forEachByKey(i, o => {
        Us = o.options.x ?? 0, yl = Us + (o.options.width ?? 1), e >= Us && e < yl && (!r || (o.options.layer ?? "bottom") === r) && n(o);
      });
    }
  },
  Ks = class extends Ee {
    constructor(e) {
      super();
      this.options = e;
      this.onRenderEmitter = this.add(new v());
      this.onRender = this.onRenderEmitter.event;
      this._onDispose = this.add(new v());
      this.onDispose = this._onDispose.event;
      this._cachedBg = null;
      this._cachedFg = null;
      this.marker = e.marker, this.options.overviewRulerOptions && !this.options.overviewRulerOptions.position && (this.options.overviewRulerOptions.position = "full");
    }
    get backgroundColorRGB() {
      return this._cachedBg === null && (this.options.backgroundColor ? this._cachedBg = z.toColor(this.options.backgroundColor) : this._cachedBg = void 0), this._cachedBg;
    }
    get foregroundColorRGB() {
      return this._cachedFg === null && (this.options.foregroundColor ? this._cachedFg = z.toColor(this.options.foregroundColor) : this._cachedFg = void 0), this._cachedFg;
    }
    dispose() {
      this._onDispose.fire(), super.dispose();
    }
  };
var Sc = 1e3,
  In = class {
    constructor(t, e = Sc) {
      this._renderCallback = t;
      this._debounceThresholdMS = e;
      this._lastRefreshMs = 0;
      this._additionalRefreshRequested = !1;
    }
    dispose() {
      this._refreshTimeoutID && clearTimeout(this._refreshTimeoutID);
    }
    refresh(t, e, i) {
      this._rowCount = i, t = t !== void 0 ? t : 0, e = e !== void 0 ? e : this._rowCount - 1, this._rowStart = this._rowStart !== void 0 ? Math.min(this._rowStart, t) : t, this._rowEnd = this._rowEnd !== void 0 ? Math.max(this._rowEnd, e) : e;
      let r = performance.now();
      if (r - this._lastRefreshMs >= this._debounceThresholdMS) this._lastRefreshMs = r, this._innerRefresh();else if (!this._additionalRefreshRequested) {
        let n = r - this._lastRefreshMs,
          o = this._debounceThresholdMS - n;
        this._additionalRefreshRequested = !0, this._refreshTimeoutID = window.setTimeout(() => {
          this._lastRefreshMs = performance.now(), this._innerRefresh(), this._additionalRefreshRequested = !1, this._refreshTimeoutID = void 0;
        }, o);
      }
    }
    _innerRefresh() {
      if (this._rowStart === void 0 || this._rowEnd === void 0 || this._rowCount === void 0) return;
      let t = Math.max(this._rowStart, 0),
        e = Math.min(this._rowEnd, this._rowCount - 1);
      this._rowStart = void 0, this._rowEnd = void 0, this._renderCallback(t, e);
    }
  };
var xl = 20;
var wl = !1,
  Tt = class extends D {
    constructor(e, i, r, n) {
      super();
      this._terminal = e;
      this._coreBrowserService = r;
      this._renderService = n;
      this._rowColumns = new WeakMap();
      this._liveRegionLineCount = 0;
      this._charsToConsume = [];
      this._charsToAnnounce = "";
      let o = this._coreBrowserService.mainDocument;
      this._accessibilityContainer = o.createElement("div"), this._accessibilityContainer.classList.add("xterm-accessibility"), this._rowContainer = o.createElement("div"), this._rowContainer.setAttribute("role", "list"), this._rowContainer.classList.add("xterm-accessibility-tree"), this._rowElements = [];
      for (let l = 0; l < this._terminal.rows; l++) this._rowElements[l] = this._createAccessibilityTreeNode(), this._rowContainer.appendChild(this._rowElements[l]);
      if (this._topBoundaryFocusListener = l => this._handleBoundaryFocus(l, 0), this._bottomBoundaryFocusListener = l => this._handleBoundaryFocus(l, 1), this._rowElements[0].addEventListener("focus", this._topBoundaryFocusListener), this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._accessibilityContainer.appendChild(this._rowContainer), this._liveRegion = o.createElement("div"), this._liveRegion.classList.add("live-region"), this._liveRegion.setAttribute("aria-live", "assertive"), this._accessibilityContainer.appendChild(this._liveRegion), this._liveRegionDebouncer = this._register(new In(this._renderRows.bind(this))), !this._terminal.element) throw new Error("Cannot enable accessibility before Terminal.open");
      wl ? (this._accessibilityContainer.classList.add("debug"), this._rowContainer.classList.add("debug"), this._debugRootContainer = o.createElement("div"), this._debugRootContainer.classList.add("xterm"), this._debugRootContainer.appendChild(o.createTextNode("------start a11y------")), this._debugRootContainer.appendChild(this._accessibilityContainer), this._debugRootContainer.appendChild(o.createTextNode("------end a11y------")), this._terminal.element.insertAdjacentElement("afterend", this._debugRootContainer)) : this._terminal.element.insertAdjacentElement("afterbegin", this._accessibilityContainer), this._register(this._terminal.onResize(l => this._handleResize(l.rows))), this._register(this._terminal.onRender(l => this._refreshRows(l.start, l.end))), this._register(this._terminal.onScroll(() => this._refreshRows())), this._register(this._terminal.onA11yChar(l => this._handleChar(l))), this._register(this._terminal.onLineFeed(() => this._handleChar(`
`))), this._register(this._terminal.onA11yTab(l => this._handleTab(l))), this._register(this._terminal.onKey(l => this._handleKey(l.key))), this._register(this._terminal.onBlur(() => this._clearLiveRegion())), this._register(this._renderService.onDimensionsChange(() => this._refreshRowsDimensions())), this._register(L(o, "selectionchange", () => this._handleSelectionChange())), this._register(this._coreBrowserService.onDprChange(() => this._refreshRowsDimensions())), this._refreshRowsDimensions(), this._refreshRows(), this._register(C(() => {
        wl ? this._debugRootContainer.remove() : this._accessibilityContainer.remove(), this._rowElements.length = 0;
      }));
    }
    _handleTab(e) {
      for (let i = 0; i < e; i++) this._handleChar(" ");
    }
    _handleChar(e) {
      this._liveRegionLineCount < xl + 1 && (this._charsToConsume.length > 0 ? this._charsToConsume.shift() !== e && (this._charsToAnnounce += e) : this._charsToAnnounce += e, e === `
` && (this._liveRegionLineCount++, this._liveRegionLineCount === xl + 1 && (this._liveRegion.textContent += _i.get())));
    }
    _clearLiveRegion() {
      this._liveRegion.textContent = "", this._liveRegionLineCount = 0;
    }
    _handleKey(e) {
      this._clearLiveRegion(), /\p{Control}/u.test(e) || this._charsToConsume.push(e);
    }
    _refreshRows(e, i) {
      this._liveRegionDebouncer.refresh(e, i, this._terminal.rows);
    }
    _renderRows(e, i) {
      let r = this._terminal.buffer,
        n = r.lines.length.toString();
      for (let o = e; o <= i; o++) {
        let l = r.lines.get(r.ydisp + o),
          a = [],
          u = l?.translateToString(!0, void 0, void 0, a) || "",
          h = (r.ydisp + o + 1).toString(),
          c = this._rowElements[o];
        c && (u.length === 0 ? (c.textContent = "\xA0", this._rowColumns.set(c, [0, 1])) : (c.textContent = u, this._rowColumns.set(c, a)), c.setAttribute("aria-posinset", h), c.setAttribute("aria-setsize", n), this._alignRowWidth(c));
      }
      this._announceCharacters();
    }
    _announceCharacters() {
      this._charsToAnnounce.length !== 0 && (this._liveRegion.textContent += this._charsToAnnounce, this._charsToAnnounce = "");
    }
    _handleBoundaryFocus(e, i) {
      let r = e.target,
        n = this._rowElements[i === 0 ? 1 : this._rowElements.length - 2],
        o = r.getAttribute("aria-posinset"),
        l = i === 0 ? "1" : `${this._terminal.buffer.lines.length}`;
      if (o === l || e.relatedTarget !== n) return;
      let a, u;
      if (i === 0 ? (a = r, u = this._rowElements.pop(), this._rowContainer.removeChild(u)) : (a = this._rowElements.shift(), u = r, this._rowContainer.removeChild(a)), a.removeEventListener("focus", this._topBoundaryFocusListener), u.removeEventListener("focus", this._bottomBoundaryFocusListener), i === 0) {
        let h = this._createAccessibilityTreeNode();
        this._rowElements.unshift(h), this._rowContainer.insertAdjacentElement("afterbegin", h);
      } else {
        let h = this._createAccessibilityTreeNode();
        this._rowElements.push(h), this._rowContainer.appendChild(h);
      }
      this._rowElements[0].addEventListener("focus", this._topBoundaryFocusListener), this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._terminal.scrollLines(i === 0 ? -1 : 1), this._rowElements[i === 0 ? 1 : this._rowElements.length - 2].focus(), e.preventDefault(), e.stopImmediatePropagation();
    }
    _handleSelectionChange() {
      if (this._rowElements.length === 0) return;
      let e = this._coreBrowserService.mainDocument.getSelection();
      if (!e) return;
      if (e.isCollapsed) {
        this._rowContainer.contains(e.anchorNode) && this._terminal.clearSelection();
        return;
      }
      if (!e.anchorNode || !e.focusNode) {
        console.error("anchorNode and/or focusNode are null");
        return;
      }
      let i = {
          node: e.anchorNode,
          offset: e.anchorOffset
        },
        r = {
          node: e.focusNode,
          offset: e.focusOffset
        };
      if ((i.node.compareDocumentPosition(r.node) & Node.DOCUMENT_POSITION_PRECEDING || i.node === r.node && i.offset > r.offset) && ([i, r] = [r, i]), i.node.compareDocumentPosition(this._rowElements[0]) & (Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_FOLLOWING) && (i = {
        node: this._rowElements[0].childNodes[0],
        offset: 0
      }), !this._rowContainer.contains(i.node)) return;
      let n = this._rowElements.slice(-1)[0];
      if (r.node.compareDocumentPosition(n) & (Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_PRECEDING) && (r = {
        node: n,
        offset: n.textContent?.length ?? 0
      }), !this._rowContainer.contains(r.node)) return;
      let o = ({
          node: u,
          offset: h
        }) => {
          let c = u instanceof Text ? u.parentNode : u,
            d = parseInt(c?.getAttribute("aria-posinset"), 10) - 1;
          if (isNaN(d)) return console.warn("row is invalid. Race condition?"), null;
          let _ = this._rowColumns.get(c);
          if (!_) return console.warn("columns is null. Race condition?"), null;
          let p = h < _.length ? _[h] : _.slice(-1)[0] + 1;
          return p >= this._terminal.cols && (++d, p = 0), {
            row: d,
            column: p
          };
        },
        l = o(i),
        a = o(r);
      if (!(!l || !a)) {
        if (l.row > a.row || l.row === a.row && l.column >= a.column) throw new Error("invalid range");
        this._terminal.select(l.column, l.row, (a.row - l.row) * this._terminal.cols - l.column + a.column);
      }
    }
    _handleResize(e) {
      this._rowElements[this._rowElements.length - 1].removeEventListener("focus", this._bottomBoundaryFocusListener);
      for (let i = this._rowContainer.children.length; i < this._terminal.rows; i++) this._rowElements[i] = this._createAccessibilityTreeNode(), this._rowContainer.appendChild(this._rowElements[i]);
      for (; this._rowElements.length > e;) this._rowContainer.removeChild(this._rowElements.pop());
      this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._refreshRowsDimensions();
    }
    _createAccessibilityTreeNode() {
      let e = this._coreBrowserService.mainDocument.createElement("div");
      return e.setAttribute("role", "listitem"), e.tabIndex = -1, this._refreshRowDimensions(e), e;
    }
    _refreshRowsDimensions() {
      if (this._renderService.dimensions.css.cell.height) {
        Object.assign(this._accessibilityContainer.style, {
          width: `${this._renderService.dimensions.css.canvas.width}px`,
          fontSize: `${this._terminal.options.fontSize}px`
        }), this._rowElements.length !== this._terminal.rows && this._handleResize(this._terminal.rows);
        for (let e = 0; e < this._terminal.rows; e++) this._refreshRowDimensions(this._rowElements[e]), this._alignRowWidth(this._rowElements[e]);
      }
    }
    _refreshRowDimensions(e) {
      e.style.height = `${this._renderService.dimensions.css.cell.height}px`;
    }
    _alignRowWidth(e) {
      e.style.transform = "";
      let i = e.getBoundingClientRect().width,
        r = this._rowColumns.get(e)?.slice(-1)?.[0];
      if (!r) return;
      let n = r * this._renderService.dimensions.css.cell.width;
      e.style.transform = `scaleX(${n / i})`;
    }
  };
Tt = M([S(1, xt), S(2, ae), S(3, ce)], Tt);
var hi = class extends D {
  constructor(e, i, r, n, o) {
    super();
    this._element = e;
    this._mouseService = i;
    this._renderService = r;
    this._bufferService = n;
    this._linkProviderService = o;
    this._linkCacheDisposables = [];
    this._isMouseOut = !0;
    this._wasResized = !1;
    this._activeLine = -1;
    this._onShowLinkUnderline = this._register(new v());
    this.onShowLinkUnderline = this._onShowLinkUnderline.event;
    this._onHideLinkUnderline = this._register(new v());
    this.onHideLinkUnderline = this._onHideLinkUnderline.event;
    this._register(C(() => {
      Ne(this._linkCacheDisposables), this._linkCacheDisposables.length = 0, this._lastMouseEvent = void 0, this._activeProviderReplies?.clear();
    })), this._register(this._bufferService.onResize(() => {
      this._clearCurrentLink(), this._wasResized = !0;
    })), this._register(L(this._element, "mouseleave", () => {
      this._isMouseOut = !0, this._clearCurrentLink();
    })), this._register(L(this._element, "mousemove", this._handleMouseMove.bind(this))), this._register(L(this._element, "mousedown", this._handleMouseDown.bind(this))), this._register(L(this._element, "mouseup", this._handleMouseUp.bind(this)));
  }
  get currentLink() {
    return this._currentLink;
  }
  _handleMouseMove(e) {
    this._lastMouseEvent = e;
    let i = this._positionFromMouseEvent(e, this._element, this._mouseService);
    if (!i) return;
    this._isMouseOut = !1;
    let r = e.composedPath();
    for (let n = 0; n < r.length; n++) {
      let o = r[n];
      if (o.classList.contains("xterm")) break;
      if (o.classList.contains("xterm-hover")) return;
    }
    (!this._lastBufferCell || i.x !== this._lastBufferCell.x || i.y !== this._lastBufferCell.y) && (this._handleHover(i), this._lastBufferCell = i);
  }
  _handleHover(e) {
    if (this._activeLine !== e.y || this._wasResized) {
      this._clearCurrentLink(), this._askForLink(e, !1), this._wasResized = !1;
      return;
    }
    this._currentLink && this._linkAtPosition(this._currentLink.link, e) || (this._clearCurrentLink(), this._askForLink(e, !0));
  }
  _askForLink(e, i) {
    (!this._activeProviderReplies || !i) && (this._activeProviderReplies?.forEach(n => {
      n?.forEach(o => {
        o.link.dispose && o.link.dispose();
      });
    }), this._activeProviderReplies = new Map(), this._activeLine = e.y);
    let r = !1;
    for (let [n, o] of this._linkProviderService.linkProviders.entries()) i ? this._activeProviderReplies?.get(n) && (r = this._checkLinkProviderResult(n, e, r)) : o.provideLinks(e.y, l => {
      if (this._isMouseOut) return;
      let a = l?.map(u => ({
        link: u
      }));
      this._activeProviderReplies?.set(n, a), r = this._checkLinkProviderResult(n, e, r), this._activeProviderReplies?.size === this._linkProviderService.linkProviders.length && this._removeIntersectingLinks(e.y, this._activeProviderReplies);
    });
  }
  _removeIntersectingLinks(e, i) {
    let r = new Set();
    for (let n = 0; n < i.size; n++) {
      let o = i.get(n);
      if (o) for (let l = 0; l < o.length; l++) {
        let a = o[l],
          u = a.link.range.start.y < e ? 0 : a.link.range.start.x,
          h = a.link.range.end.y > e ? this._bufferService.cols : a.link.range.end.x;
        for (let c = u; c <= h; c++) {
          if (r.has(c)) {
            o.splice(l--, 1);
            break;
          }
          r.add(c);
        }
      }
    }
  }
  _checkLinkProviderResult(e, i, r) {
    if (!this._activeProviderReplies) return r;
    let n = this._activeProviderReplies.get(e),
      o = !1;
    for (let l = 0; l < e; l++) (!this._activeProviderReplies.has(l) || this._activeProviderReplies.get(l)) && (o = !0);
    if (!o && n) {
      let l = n.find(a => this._linkAtPosition(a.link, i));
      l && (r = !0, this._handleNewLink(l));
    }
    if (this._activeProviderReplies.size === this._linkProviderService.linkProviders.length && !r) for (let l = 0; l < this._activeProviderReplies.size; l++) {
      let a = this._activeProviderReplies.get(l)?.find(u => this._linkAtPosition(u.link, i));
      if (a) {
        r = !0, this._handleNewLink(a);
        break;
      }
    }
    return r;
  }
  _handleMouseDown() {
    this._mouseDownLink = this._currentLink;
  }
  _handleMouseUp(e) {
    if (!this._currentLink) return;
    let i = this._positionFromMouseEvent(e, this._element, this._mouseService);
    i && this._mouseDownLink && Ec(this._mouseDownLink.link, this._currentLink.link) && this._linkAtPosition(this._currentLink.link, i) && this._currentLink.link.activate(e, this._currentLink.link.text);
  }
  _clearCurrentLink(e, i) {
    !this._currentLink || !this._lastMouseEvent || (!e || !i || this._currentLink.link.range.start.y >= e && this._currentLink.link.range.end.y <= i) && (this._linkLeave(this._element, this._currentLink.link, this._lastMouseEvent), this._currentLink = void 0, Ne(this._linkCacheDisposables), this._linkCacheDisposables.length = 0);
  }
  _handleNewLink(e) {
    if (!this._lastMouseEvent) return;
    let i = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService);
    i && this._linkAtPosition(e.link, i) && (this._currentLink = e, this._currentLink.state = {
      decorations: {
        underline: e.link.decorations === void 0 ? !0 : e.link.decorations.underline,
        pointerCursor: e.link.decorations === void 0 ? !0 : e.link.decorations.pointerCursor
      },
      isHovered: !0
    }, this._linkHover(this._element, e.link, this._lastMouseEvent), e.link.decorations = {}, Object.defineProperties(e.link.decorations, {
      pointerCursor: {
        get: () => this._currentLink?.state?.decorations.pointerCursor,
        set: r => {
          this._currentLink?.state && this._currentLink.state.decorations.pointerCursor !== r && (this._currentLink.state.decorations.pointerCursor = r, this._currentLink.state.isHovered && this._element.classList.toggle("xterm-cursor-pointer", r));
        }
      },
      underline: {
        get: () => this._currentLink?.state?.decorations.underline,
        set: r => {
          this._currentLink?.state && this._currentLink?.state?.decorations.underline !== r && (this._currentLink.state.decorations.underline = r, this._currentLink.state.isHovered && this._fireUnderlineEvent(e.link, r));
        }
      }
    }), this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r => {
      if (!this._currentLink) return;
      let n = r.start === 0 ? 0 : r.start + 1 + this._bufferService.buffer.ydisp,
        o = this._bufferService.buffer.ydisp + 1 + r.end;
      if (this._currentLink.link.range.start.y >= n && this._currentLink.link.range.end.y <= o && (this._clearCurrentLink(n, o), this._lastMouseEvent)) {
        let l = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService);
        l && this._askForLink(l, !1);
      }
    })));
  }
  _linkHover(e, i, r) {
    this._currentLink?.state && (this._currentLink.state.isHovered = !0, this._currentLink.state.decorations.underline && this._fireUnderlineEvent(i, !0), this._currentLink.state.decorations.pointerCursor && e.classList.add("xterm-cursor-pointer")), i.hover && i.hover(r, i.text);
  }
  _fireUnderlineEvent(e, i) {
    let r = e.range,
      n = this._bufferService.buffer.ydisp,
      o = this._createLinkUnderlineEvent(r.start.x - 1, r.start.y - n - 1, r.end.x, r.end.y - n - 1, void 0);
    (i ? this._onShowLinkUnderline : this._onHideLinkUnderline).fire(o);
  }
  _linkLeave(e, i, r) {
    this._currentLink?.state && (this._currentLink.state.isHovered = !1, this._currentLink.state.decorations.underline && this._fireUnderlineEvent(i, !1), this._currentLink.state.decorations.pointerCursor && e.classList.remove("xterm-cursor-pointer")), i.leave && i.leave(r, i.text);
  }
  _linkAtPosition(e, i) {
    let r = e.range.start.y * this._bufferService.cols + e.range.start.x,
      n = e.range.end.y * this._bufferService.cols + e.range.end.x,
      o = i.y * this._bufferService.cols + i.x;
    return r <= o && o <= n;
  }
  _positionFromMouseEvent(e, i, r) {
    let n = r.getCoords(e, i, this._bufferService.cols, this._bufferService.rows);
    if (n) return {
      x: n[0],
      y: n[1] + this._bufferService.buffer.ydisp
    };
  }
  _createLinkUnderlineEvent(e, i, r, n, o) {
    return {
      x1: e,
      y1: i,
      x2: r,
      y2: n,
      cols: this._bufferService.cols,
      fg: o
    };
  }
};
hi = M([S(1, Dt), S(2, ce), S(3, F), S(4, lr)], hi);
function Ec(s, t) {
  return s.text === t.text && s.range.start.x === t.range.start.x && s.range.start.y === t.range.start.y && s.range.end.x === t.range.end.x && s.range.end.y === t.range.end.y;
}
var yn = class extends Sn {
  constructor(e = {}) {
    super(e);
    this._linkifier = this._register(new ye());
    this.browser = tn;
    this._keyDownHandled = !1;
    this._keyDownSeen = !1;
    this._keyPressHandled = !1;
    this._unprocessedDeadKey = !1;
    this._accessibilityManager = this._register(new ye());
    this._onCursorMove = this._register(new v());
    this.onCursorMove = this._onCursorMove.event;
    this._onKey = this._register(new v());
    this.onKey = this._onKey.event;
    this._onRender = this._register(new v());
    this.onRender = this._onRender.event;
    this._onSelectionChange = this._register(new v());
    this.onSelectionChange = this._onSelectionChange.event;
    this._onTitleChange = this._register(new v());
    this.onTitleChange = this._onTitleChange.event;
    this._onBell = this._register(new v());
    this.onBell = this._onBell.event;
    this._onFocus = this._register(new v());
    this._onBlur = this._register(new v());
    this._onA11yCharEmitter = this._register(new v());
    this._onA11yTabEmitter = this._register(new v());
    this._onWillOpen = this._register(new v());
    this._setup(), this._decorationService = this._instantiationService.createInstance(Tn), this._instantiationService.setService(Be, this._decorationService), this._linkProviderService = this._instantiationService.createInstance(Qr), this._instantiationService.setService(lr, this._linkProviderService), this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(wt)), this._register(this._inputHandler.onRequestBell(() => this._onBell.fire())), this._register(this._inputHandler.onRequestRefreshRows(i => this.refresh(i?.start ?? 0, i?.end ?? this.rows - 1))), this._register(this._inputHandler.onRequestSendFocus(() => this._reportFocus())), this._register(this._inputHandler.onRequestReset(() => this.reset())), this._register(this._inputHandler.onRequestWindowsOptionsReport(i => this._reportWindowsOptions(i))), this._register(this._inputHandler.onColor(i => this._handleColorEvent(i))), this._register($.forward(this._inputHandler.onCursorMove, this._onCursorMove)), this._register($.forward(this._inputHandler.onTitleChange, this._onTitleChange)), this._register($.forward(this._inputHandler.onA11yChar, this._onA11yCharEmitter)), this._register($.forward(this._inputHandler.onA11yTab, this._onA11yTabEmitter)), this._register(this._bufferService.onResize(i => this._afterResize(i.cols, i.rows))), this._register(C(() => {
      this._customKeyEventHandler = void 0, this.element?.parentNode?.removeChild(this.element);
    }));
  }
  get linkifier() {
    return this._linkifier.value;
  }
  get onFocus() {
    return this._onFocus.event;
  }
  get onBlur() {
    return this._onBlur.event;
  }
  get onA11yChar() {
    return this._onA11yCharEmitter.event;
  }
  get onA11yTab() {
    return this._onA11yTabEmitter.event;
  }
  get onWillOpen() {
    return this._onWillOpen.event;
  }
  _handleColorEvent(e) {
    if (this._themeService) for (let i of e) {
      let r,
        n = "";
      switch (i.index) {
        case 256:
          r = "foreground", n = "10";
          break;
        case 257:
          r = "background", n = "11";
          break;
        case 258:
          r = "cursor", n = "12";
          break;
        default:
          r = "ansi", n = "4;" + i.index;
      }
      switch (i.type) {
        case 0:
          let o = U.toColorRGB(r === "ansi" ? this._themeService.colors.ansi[i.index] : this._themeService.colors[r]);
          this.coreService.triggerDataEvent(`${b.ESC}]${n};${ml(o)}${fs.ST}`);
          break;
        case 1:
          if (r === "ansi") this._themeService.modifyColors(l => l.ansi[i.index] = j.toColor(...i.color));else {
            let l = r;
            this._themeService.modifyColors(a => a[l] = j.toColor(...i.color));
          }
          break;
        case 2:
          this._themeService.restoreColor(i.index);
          break;
      }
    }
  }
  _setup() {
    super._setup(), this._customKeyEventHandler = void 0;
  }
  get buffer() {
    return this.buffers.active;
  }
  focus() {
    this.textarea && this.textarea.focus({
      preventScroll: !0
    });
  }
  _handleScreenReaderModeOptionChange(e) {
    e ? !this._accessibilityManager.value && this._renderService && (this._accessibilityManager.value = this._instantiationService.createInstance(Tt, this)) : this._accessibilityManager.clear();
  }
  _handleTextAreaFocus(e) {
    this.coreService.decPrivateModes.sendFocus && this.coreService.triggerDataEvent(b.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(b.ESC + "[O"), this.element.classList.remove("focus"), this._onBlur.fire();
  }
  _syncTextArea() {
    if (!this.textarea || !this.buffer.isCursorInViewport || this._compositionHelper.isComposing || !this._renderService) return;
    let e = this.buffer.ybase + this.buffer.y,
      i = this.buffer.lines.get(e);
    if (!i) return;
    let r = Math.min(this.buffer.x, this.cols - 1),
      n = this._renderService.dimensions.css.cell.height,
      o = i.getWidth(r),
      l = this._renderService.dimensions.css.cell.width * o,
      a = this.buffer.y * this._renderService.dimensions.css.cell.height,
      u = r * this._renderService.dimensions.css.cell.width;
    this.textarea.style.left = u + "px", this.textarea.style.top = a + "px", this.textarea.style.width = l + "px", this.textarea.style.height = n + "px", this.textarea.style.lineHeight = n + "px", this.textarea.style.zIndex = "-5";
  }
  _initGlobal() {
    this._bindKeys(), this._register(L(this.element, "copy", i => {
      this.hasSelection() && Vs(i, this._selectionService);
    }));
    let e = i => qs(i, this.textarea, this.coreService, this.optionsService);
    this._register(L(this.textarea, "paste", e)), this._register(L(this.element, "paste", e)), Ss ? this._register(L(this.element, "mousedown", i => {
      i.button === 2 && Pn(i, this.textarea, this.screenElement, this._selectionService, this.options.rightClickSelectsWord);
    })) : this._register(L(this.element, "contextmenu", i => {
      Pn(i, this.textarea, this.screenElement, this._selectionService, this.options.rightClickSelectsWord);
    })), Bi && this._register(L(this.element, "auxclick", i => {
      i.button === 1 && Mn(i, this.textarea, this.screenElement);
    }));
  }
  _bindKeys() {
    this._register(L(this.textarea, "keyup", e => this._keyUp(e), !0)), this._register(L(this.textarea, "keydown", e => this._keyDown(e), !0)), this._register(L(this.textarea, "keypress", e => this._keyPress(e), !0)), this._register(L(this.textarea, "compositionstart", () => this._compositionHelper.compositionstart())), this._register(L(this.textarea, "compositionupdate", e => this._compositionHelper.compositionupdate(e))), this._register(L(this.textarea, "compositionend", () => this._compositionHelper.compositionend())), this._register(L(this.textarea, "input", e => this._inputEvent(e), !0)), this._register(this.onRender(() => this._compositionHelper.updateCompositionElements()));
  }
  open(e) {
    if (!e) throw new Error("Terminal requires a parent element.");
    if (e.isConnected || this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"), this.element?.ownerDocument.defaultView && this._coreBrowserService) {
      this.element.ownerDocument.defaultView !== this._coreBrowserService.window && (this._coreBrowserService.window = this.element.ownerDocument.defaultView);
      return;
    }
    this._document = e.ownerDocument, this.options.documentOverride && this.options.documentOverride instanceof Document && (this._document = this.optionsService.rawOptions.documentOverride), this.element = this._document.createElement("div"), this.element.dir = "ltr", this.element.classList.add("terminal"), this.element.classList.add("xterm"), e.appendChild(this.element);
    let i = this._document.createDocumentFragment();
    this._viewportElement = this._document.createElement("div"), this._viewportElement.classList.add("xterm-viewport"), i.appendChild(this._viewportElement), this.screenElement = this._document.createElement("div"), this.screenElement.classList.add("xterm-screen"), this._register(L(this.screenElement, "mousemove", o => this.updateCursorStyle(o))), this._helperContainer = this._document.createElement("div"), this._helperContainer.classList.add("xterm-helpers"), this.screenElement.appendChild(this._helperContainer), i.appendChild(this.screenElement);
    let r = this.textarea = this._document.createElement("textarea");
    this.textarea.classList.add("xterm-helper-textarea"), this.textarea.setAttribute("aria-label", mi.get()), Ts || this.textarea.setAttribute("aria-multiline", "false"), this.textarea.setAttribute("autocorrect", "off"), this.textarea.setAttribute("autocapitalize", "off"), this.textarea.setAttribute("spellcheck", "false"), this.textarea.tabIndex = 0, this._register(this.optionsService.onSpecificOptionChange("disableStdin", () => r.readOnly = this.optionsService.rawOptions.disableStdin)), this.textarea.readOnly = this.optionsService.rawOptions.disableStdin, this._coreBrowserService = this._register(this._instantiationService.createInstance(Jr, this.textarea, e.ownerDocument.defaultView ?? window, this._document ?? typeof window < "u" ? window.document : null)), this._instantiationService.setService(ae, this._coreBrowserService), this._register(L(this.textarea, "focus", o => this._handleTextAreaFocus(o))), this._register(L(this.textarea, "blur", () => this._handleTextAreaBlur())), this._helperContainer.appendChild(this.textarea), this._charSizeService = this._instantiationService.createInstance(jt, this._document, this._helperContainer), this._instantiationService.setService(nt, this._charSizeService), this._themeService = this._instantiationService.createInstance(ti), this._instantiationService.setService(Re, this._themeService), this._characterJoinerService = this._instantiationService.createInstance(ct), this._instantiationService.setService(or, this._characterJoinerService), this._renderService = this._register(this._instantiationService.createInstance(Qt, this.rows, this.screenElement)), this._instantiationService.setService(ce, this._renderService), this._register(this._renderService.onRenderedViewportChange(o => this._onRender.fire(o))), this.onResize(o => this._renderService.resize(o.cols, o.rows)), this._compositionView = this._document.createElement("div"), this._compositionView.classList.add("composition-view"), this._compositionHelper = this._instantiationService.createInstance($t, this.textarea, this._compositionView), this._helperContainer.appendChild(this._compositionView), this._mouseService = this._instantiationService.createInstance(Xt), this._instantiationService.setService(Dt, this._mouseService);
    let n = this._linkifier.value = this._register(this._instantiationService.createInstance(hi, this.screenElement));
    this.element.appendChild(i);
    try {
      this._onWillOpen.fire(this.element);
    } catch {}
    this._renderService.hasRenderer() || this._renderService.setRenderer(this._createRenderer()), this._register(this.onCursorMove(() => {
      this._renderService.handleCursorMove(), this._syncTextArea();
    })), this._register(this.onResize(() => this._renderService.handleResize(this.cols, this.rows))), this._register(this.onBlur(() => this._renderService.handleBlur())), this._register(this.onFocus(() => this._renderService.handleFocus())), this._viewport = this._register(this._instantiationService.createInstance(zt, this.element, this.screenElement)), this._register(this._viewport.onRequestScrollLines(o => {
      super.scrollLines(o, !1), this.refresh(0, this.rows - 1);
    })), this._selectionService = this._register(this._instantiationService.createInstance(ei, this.element, this.screenElement, n)), this._instantiationService.setService(Qs, this._selectionService), this._register(this._selectionService.onRequestScrollLines(o => this.scrollLines(o.amount, o.suppressScrollEvent))), this._register(this._selectionService.onSelectionChange(() => this._onSelectionChange.fire())), this._register(this._selectionService.onRequestRedraw(o => this._renderService.handleSelectionChanged(o.start, o.end, o.columnSelectMode))), this._register(this._selectionService.onLinuxMouseSelection(o => {
      this.textarea.value = o, this.textarea.focus(), this.textarea.select();
    })), this._register($.any(this._onScroll.event, this._inputHandler.onScroll)(() => {
      this._selectionService.refresh(), this._viewport?.queueSync();
    })), this._register(this._instantiationService.createInstance(Gt, this.screenElement)), this._register(L(this.element, "mousedown", o => this._selectionService.handleMouseDown(o))), 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(Tt, this)), this._register(this.optionsService.onSpecificOptionChange("screenReaderMode", o => this._handleScreenReaderModeOptionChange(o))), this.options.overviewRuler.width && (this._overviewRulerRenderer = this._register(this._instantiationService.createInstance(bt, this._viewportElement, this.screenElement))), this.optionsService.onSpecificOptionChange("overviewRuler", o => {
      !this._overviewRulerRenderer && o && this._viewportElement && this.screenElement && (this._overviewRulerRenderer = this._register(this._instantiationService.createInstance(bt, this._viewportElement, this.screenElement)));
    }), this._charSizeService.measure(), this.refresh(0, this.rows - 1), this._initGlobal(), this.bindMouse();
  }
  _createRenderer() {
    return this._instantiationService.createInstance(Yt, this, this._document, this.element, this.screenElement, this._viewportElement, this._helperContainer, this.linkifier);
  }
  bindMouse() {
    let e = this,
      i = this.element;
    function r(l) {
      let a = e._mouseService.getMouseReportCoords(l, e.screenElement);
      if (!a) return !1;
      let u, h;
      switch (l.overrideType || l.type) {
        case "mousemove":
          h = 32, l.buttons === void 0 ? (u = 3, l.button !== void 0 && (u = l.button < 3 ? l.button : 3)) : u = l.buttons & 1 ? 0 : l.buttons & 4 ? 1 : l.buttons & 2 ? 2 : 3;
          break;
        case "mouseup":
          h = 0, u = l.button < 3 ? l.button : 3;
          break;
        case "mousedown":
          h = 1, u = l.button < 3 ? l.button : 3;
          break;
        case "wheel":
          if (e._customWheelEventHandler && e._customWheelEventHandler(l) === !1) return !1;
          let c = l.deltaY;
          if (c === 0 || e.coreMouseService.consumeWheelEvent(l, e._renderService?.dimensions?.device?.cell?.height, e._coreBrowserService?.dpr) === 0) return !1;
          h = c < 0 ? 0 : 1, u = 4;
          break;
        default:
          return !1;
      }
      return h === void 0 || u === void 0 || u > 4 ? !1 : e.coreMouseService.triggerMouseEvent({
        col: a.col,
        row: a.row,
        x: a.x,
        y: a.y,
        button: u,
        action: h,
        ctrl: l.ctrlKey,
        alt: l.altKey,
        shift: l.shiftKey
      });
    }
    let n = {
        mouseup: null,
        wheel: null,
        mousedrag: null,
        mousemove: null
      },
      o = {
        mouseup: l => (r(l), l.buttons || (this._document.removeEventListener("mouseup", n.mouseup), n.mousedrag && this._document.removeEventListener("mousemove", n.mousedrag)), this.cancel(l)),
        wheel: l => (r(l), this.cancel(l, !0)),
        mousedrag: l => {
          l.buttons && r(l);
        },
        mousemove: l => {
          l.buttons || r(l);
        }
      };
    this._register(this.coreMouseService.onProtocolChange(l => {
      l ? (this.optionsService.rawOptions.logLevel === "debug" && this._logService.debug("Binding to mouse events:", this.coreMouseService.explainEvents(l)), 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()), l & 8 ? n.mousemove || (i.addEventListener("mousemove", o.mousemove), n.mousemove = o.mousemove) : (i.removeEventListener("mousemove", n.mousemove), n.mousemove = null), l & 16 ? n.wheel || (i.addEventListener("wheel", o.wheel, {
        passive: !1
      }), n.wheel = o.wheel) : (i.removeEventListener("wheel", n.wheel), n.wheel = null), l & 2 ? n.mouseup || (n.mouseup = o.mouseup) : (this._document.removeEventListener("mouseup", n.mouseup), n.mouseup = null), l & 4 ? n.mousedrag || (n.mousedrag = o.mousedrag) : (this._document.removeEventListener("mousemove", n.mousedrag), n.mousedrag = null);
    })), this.coreMouseService.activeProtocol = this.coreMouseService.activeProtocol, this._register(L(i, "mousedown", l => {
      if (l.preventDefault(), this.focus(), !(!this.coreMouseService.areMouseEventsActive || this._selectionService.shouldForceSelection(l))) return r(l), n.mouseup && this._document.addEventListener("mouseup", n.mouseup), n.mousedrag && this._document.addEventListener("mousemove", n.mousedrag), this.cancel(l);
    })), this._register(L(i, "wheel", l => {
      if (!n.wheel) {
        if (this._customWheelEventHandler && this._customWheelEventHandler(l) === !1) return !1;
        if (!this.buffer.hasScrollback) {
          if (l.deltaY === 0) return !1;
          if (e.coreMouseService.consumeWheelEvent(l, e._renderService?.dimensions?.device?.cell?.height, e._coreBrowserService?.dpr) === 0) return this.cancel(l, !0);
          let h = b.ESC + (this.coreService.decPrivateModes.applicationCursorKeys ? "O" : "[") + (l.deltaY < 0 ? "A" : "B");
          return this.coreService.triggerDataEvent(h, !0), this.cancel(l, !0);
        }
      }
    }, {
      passive: !1
    }));
  }
  refresh(e, i) {
    this._renderService?.refreshRows(e, i);
  }
  updateCursorStyle(e) {
    this._selectionService?.shouldColumnSelect(e) ? this.element.classList.add("column-select") : this.element.classList.remove("column-select");
  }
  _showCursor() {
    this.coreService.isCursorInitialized || (this.coreService.isCursorInitialized = !0, this.refresh(this.buffer.y, this.buffer.y));
  }
  scrollLines(e, i) {
    this._viewport ? this._viewport.scrollLines(e) : super.scrollLines(e, i), this.refresh(0, this.rows - 1);
  }
  scrollPages(e) {
    this.scrollLines(e * (this.rows - 1));
  }
  scrollToTop() {
    this.scrollLines(-this._bufferService.buffer.ydisp);
  }
  scrollToBottom(e) {
    e && this._viewport ? this._viewport.scrollToLine(this.buffer.ybase, !0) : this.scrollLines(this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
  }
  scrollToLine(e) {
    let i = e - this._bufferService.buffer.ydisp;
    i !== 0 && this.scrollLines(i);
  }
  paste(e) {
    Cn(e, this.textarea, this.coreService, this.optionsService);
  }
  attachCustomKeyEventHandler(e) {
    this._customKeyEventHandler = e;
  }
  attachCustomWheelEventHandler(e) {
    this._customWheelEventHandler = e;
  }
  registerLinkProvider(e) {
    return this._linkProviderService.registerLinkProvider(e);
  }
  registerCharacterJoiner(e) {
    if (!this._characterJoinerService) throw new Error("Terminal must be opened first");
    let i = this._characterJoinerService.register(e);
    return this.refresh(0, this.rows - 1), i;
  }
  deregisterCharacterJoiner(e) {
    if (!this._characterJoinerService) throw new Error("Terminal must be opened first");
    this._characterJoinerService.deregister(e) && this.refresh(0, this.rows - 1);
  }
  get markers() {
    return this.buffer.markers;
  }
  registerMarker(e) {
    return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + e);
  }
  registerDecoration(e) {
    return this._decorationService.registerDecoration(e);
  }
  hasSelection() {
    return this._selectionService ? this._selectionService.hasSelection : !1;
  }
  select(e, i, r) {
    this._selectionService.setSelection(e, i, r);
  }
  getSelection() {
    return this._selectionService ? this._selectionService.selectionText : "";
  }
  getSelectionPosition() {
    if (!(!this._selectionService || !this._selectionService.hasSelection)) return {
      start: {
        x: this._selectionService.selectionStart[0],
        y: this._selectionService.selectionStart[1]
      },
      end: {
        x: this._selectionService.selectionEnd[0],
        y: this._selectionService.selectionEnd[1]
      }
    };
  }
  clearSelection() {
    this._selectionService?.clearSelection();
  }
  selectAll() {
    this._selectionService?.selectAll();
  }
  selectLines(e, i) {
    this._selectionService?.selectLines(e, i);
  }
  _keyDown(e) {
    if (this._keyDownHandled = !1, this._keyDownSeen = !0, this._customKeyEventHandler && this._customKeyEventHandler(e) === !1) return !1;
    let i = this.browser.isMac && this.options.macOptionIsMeta && e.altKey;
    if (!i && !this._compositionHelper.keydown(e)) return this.options.scrollOnUserInput && this.buffer.ybase !== this.buffer.ydisp && this.scrollToBottom(!0), !1;
    !i && (e.key === "Dead" || e.key === "AltGraph") && (this._unprocessedDeadKey = !0);
    let r = Il(e, this.coreService.decPrivateModes.applicationCursorKeys, this.browser.isMac, this.options.macOptionIsMeta);
    if (this.updateCursorStyle(e), r.type === 3 || r.type === 2) {
      let n = this.rows - 1;
      return this.scrollLines(r.type === 2 ? -n : n), this.cancel(e, !0);
    }
    if (r.type === 1 && this.selectAll(), this._isThirdLevelShift(this.browser, e) || (r.cancel && this.cancel(e, !0), !r.key) || e.key && !e.ctrlKey && !e.altKey && !e.metaKey && e.key.length === 1 && e.key.charCodeAt(0) >= 65 && e.key.charCodeAt(0) <= 90) return !0;
    if (this._unprocessedDeadKey) return this._unprocessedDeadKey = !1, !0;
    if ((r.key === b.ETX || r.key === b.CR) && (this.textarea.value = ""), this._onKey.fire({
      key: r.key,
      domEvent: e
    }), this._showCursor(), this.coreService.triggerDataEvent(r.key, !0), !this.optionsService.rawOptions.screenReaderMode || e.altKey || e.ctrlKey) return this.cancel(e, !0);
    this._keyDownHandled = !0;
  }
  _isThirdLevelShift(e, i) {
    let r = e.isMac && !this.options.macOptionIsMeta && i.altKey && !i.ctrlKey && !i.metaKey || e.isWindows && i.altKey && i.ctrlKey && !i.metaKey || e.isWindows && i.getModifierState("AltGraph");
    return i.type === "keypress" ? r : r && (!i.keyCode || i.keyCode > 47);
  }
  _keyUp(e) {
    this._keyDownSeen = !1, !(this._customKeyEventHandler && this._customKeyEventHandler(e) === !1) && (Tc(e) || this.focus(), this.updateCursorStyle(e), this._keyPressHandled = !1);
  }
  _keyPress(e) {
    let i;
    if (this._keyPressHandled = !1, this._keyDownHandled || this._customKeyEventHandler && this._customKeyEventHandler(e) === !1) return !1;
    if (this.cancel(e), e.charCode) i = e.charCode;else if (e.which === null || e.which === void 0) i = e.keyCode;else if (e.which !== 0 && e.charCode !== 0) i = e.which;else return !1;
    return !i || (e.altKey || e.ctrlKey || e.metaKey) && !this._isThirdLevelShift(this.browser, e) ? !1 : (i = String.fromCharCode(i), this._onKey.fire({
      key: i,
      domEvent: e
    }), this._showCursor(), this.coreService.triggerDataEvent(i, !0), this._keyPressHandled = !0, this._unprocessedDeadKey = !1, !0);
  }
  _inputEvent(e) {
    if (e.data && e.inputType === "insertText" && (!e.composed || !this._keyDownSeen) && !this.optionsService.rawOptions.screenReaderMode) {
      if (this._keyPressHandled) return !1;
      this._unprocessedDeadKey = !1;
      let i = e.data;
      return this.coreService.triggerDataEvent(i, !0), this.cancel(e), !0;
    }
    return !1;
  }
  resize(e, i) {
    if (e === this.cols && i === this.rows) {
      this._charSizeService && !this._charSizeService.hasValidSize && this._charSizeService.measure();
      return;
    }
    super.resize(e, i);
  }
  _afterResize(e, i) {
    this._charSizeService?.measure();
  }
  clear() {
    if (!(this.buffer.ybase === 0 && this.buffer.y === 0)) {
      this.buffer.clearAllMarkers(), this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)), this.buffer.lines.length = 1, this.buffer.ydisp = 0, this.buffer.ybase = 0, this.buffer.y = 0;
      for (let e = 1; e < this.rows; e++) this.buffer.lines.push(this.buffer.getBlankLine(X));
      this._onScroll.fire({
        position: this.buffer.ydisp
      }), this.refresh(0, this.rows - 1);
    }
  }
  reset() {
    this.options.rows = this.rows, this.options.cols = this.cols;
    let e = this._customKeyEventHandler;
    this._setup(), super.reset(), this._selectionService?.reset(), this._decorationService.reset(), this._customKeyEventHandler = e, this.refresh(0, this.rows - 1);
  }
  clearTextureAtlas() {
    this._renderService?.clearTextureAtlas();
  }
  _reportFocus() {
    this.element?.classList.contains("focus") ? this.coreService.triggerDataEvent(b.ESC + "[I") : this.coreService.triggerDataEvent(b.ESC + "[O");
  }
  _reportWindowsOptions(e) {
    if (this._renderService) switch (e) {
      case 0:
        let i = this._renderService.dimensions.css.canvas.width.toFixed(0),
          r = this._renderService.dimensions.css.canvas.height.toFixed(0);
        this.coreService.triggerDataEvent(`${b.ESC}[4;${r};${i}t`);
        break;
      case 1:
        let n = this._renderService.dimensions.css.cell.width.toFixed(0),
          o = this._renderService.dimensions.css.cell.height.toFixed(0);
        this.coreService.triggerDataEvent(`${b.ESC}[6;${o};${n}t`);
        break;
    }
  }
  cancel(e, i) {
    if (!(!this.options.cancelEvents && !i)) return e.preventDefault(), e.stopPropagation(), !1;
  }
};
function Tc(s) {
  return s.keyCode === 16 || s.keyCode === 17 || s.keyCode === 18;
}
var xn = class {
  constructor() {
    this._addons = [];
  }
  dispose() {
    for (let t = this._addons.length - 1; t >= 0; t--) this._addons[t].instance.dispose();
  }
  loadAddon(t, e) {
    let i = {
      instance: e,
      dispose: e.dispose,
      isDisposed: !1
    };
    this._addons.push(i), e.dispose = () => this._wrappedAddonDispose(i), e.activate(t);
  }
  _wrappedAddonDispose(t) {
    if (t.isDisposed) return;
    let e = -1;
    for (let i = 0; i < this._addons.length; i++) if (this._addons[i] === t) {
      e = i;
      break;
    }
    if (e === -1) throw new Error("Could not dispose an addon that has not been loaded");
    t.isDisposed = !0, t.dispose.apply(t.instance), this._addons.splice(e, 1);
  }
};
var wn = class {
  constructor(t) {
    this._line = t;
  }
  get isWrapped() {
    return this._line.isWrapped;
  }
  get length() {
    return this._line.length;
  }
  getCell(t, e) {
    if (!(t < 0 || t >= this._line.length)) return e ? (this._line.loadCell(t, e), e) : this._line.loadCell(t, new q());
  }
  translateToString(t, e, i) {
    return this._line.translateToString(t, e, i);
  }
};
var Ji = class {
  constructor(t, e) {
    this._buffer = t;
    this.type = e;
  }
  init(t) {
    return this._buffer = t, 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(t) {
    let e = this._buffer.lines.get(t);
    if (e) return new wn(e);
  }
  getNullCell() {
    return new q();
  }
};
var Dn = class extends D {
  constructor(e) {
    super();
    this._core = e;
    this._onBufferChange = this._register(new v());
    this.onBufferChange = this._onBufferChange.event;
    this._normal = new Ji(this._core.buffers.normal, "normal"), this._alternate = new Ji(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);
  }
};
var Rn = class {
  constructor(t) {
    this._core = t;
  }
  registerCsiHandler(t, e) {
    return this._core.registerCsiHandler(t, i => e(i.toArray()));
  }
  addCsiHandler(t, e) {
    return this.registerCsiHandler(t, e);
  }
  registerDcsHandler(t, e) {
    return this._core.registerDcsHandler(t, (i, r) => e(i, r.toArray()));
  }
  addDcsHandler(t, e) {
    return this.registerDcsHandler(t, e);
  }
  registerEscHandler(t, e) {
    return this._core.registerEscHandler(t, e);
  }
  addEscHandler(t, e) {
    return this.registerEscHandler(t, e);
  }
  registerOscHandler(t, e) {
    return this._core.registerOscHandler(t, e);
  }
  addOscHandler(t, e) {
    return this.registerOscHandler(t, e);
  }
};
var Ln = class {
  constructor(t) {
    this._core = t;
  }
  register(t) {
    this._core.unicodeService.register(t);
  }
  get versions() {
    return this._core.unicodeService.versions;
  }
  get activeVersion() {
    return this._core.unicodeService.activeVersion;
  }
  set activeVersion(t) {
    this._core.unicodeService.activeVersion = t;
  }
};
var Ic = ["cols", "rows"],
  Ue = 0,
  Dl = class extends D {
    constructor(t) {
      super(), this._core = this._register(new yn(t)), this._addonManager = this._register(new xn()), this._publicOptions = {
        ...this._core.options
      };
      let e = r => this._core.options[r],
        i = (r, n) => {
          this._checkReadonlyOptions(r), this._core.options[r] = n;
        };
      for (let r in this._core.options) {
        let n = {
          get: e.bind(this, r),
          set: i.bind(this, r)
        };
        Object.defineProperty(this._publicOptions, r, n);
      }
    }
    _checkReadonlyOptions(t) {
      if (Ic.includes(t)) throw new Error(`Option "${t}" 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 Rn(this._core)), this._parser;
    }
    get unicode() {
      return this._checkProposedApi(), new Ln(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 Dn(this._core))), this._buffer;
    }
    get markers() {
      return this._checkProposedApi(), this._core.markers;
    }
    get modes() {
      let t = this._core.coreService.decPrivateModes,
        e = "none";
      switch (this._core.coreMouseService.activeProtocol) {
        case "X10":
          e = "x10";
          break;
        case "VT200":
          e = "vt200";
          break;
        case "DRAG":
          e = "drag";
          break;
        case "ANY":
          e = "any";
          break;
      }
      return {
        applicationCursorKeysMode: t.applicationCursorKeys,
        applicationKeypadMode: t.applicationKeypad,
        bracketedPasteMode: t.bracketedPasteMode,
        insertMode: this._core.coreService.modes.insertMode,
        mouseTrackingMode: e,
        originMode: t.origin,
        reverseWraparoundMode: t.reverseWraparound,
        sendFocusMode: t.sendFocus,
        synchronizedOutputMode: t.synchronizedOutput,
        wraparoundMode: t.wraparound
      };
    }
    get options() {
      return this._publicOptions;
    }
    set options(t) {
      for (let e in t) this._publicOptions[e] = t[e];
    }
    blur() {
      this._core.blur();
    }
    focus() {
      this._core.focus();
    }
    input(t, e = !0) {
      this._core.input(t, e);
    }
    resize(t, e) {
      this._verifyIntegers(t, e), this._core.resize(t, e);
    }
    open(t) {
      this._core.open(t);
    }
    attachCustomKeyEventHandler(t) {
      this._core.attachCustomKeyEventHandler(t);
    }
    attachCustomWheelEventHandler(t) {
      this._core.attachCustomWheelEventHandler(t);
    }
    registerLinkProvider(t) {
      return this._core.registerLinkProvider(t);
    }
    registerCharacterJoiner(t) {
      return this._checkProposedApi(), this._core.registerCharacterJoiner(t);
    }
    deregisterCharacterJoiner(t) {
      this._checkProposedApi(), this._core.deregisterCharacterJoiner(t);
    }
    registerMarker(t = 0) {
      return this._verifyIntegers(t), this._core.registerMarker(t);
    }
    registerDecoration(t) {
      return this._checkProposedApi(), this._verifyPositiveIntegers(t.x ?? 0, t.width ?? 0, t.height ?? 0), this._core.registerDecoration(t);
    }
    hasSelection() {
      return this._core.hasSelection();
    }
    select(t, e, i) {
      this._verifyIntegers(t, e, i), this._core.select(t, e, i);
    }
    getSelection() {
      return this._core.getSelection();
    }
    getSelectionPosition() {
      return this._core.getSelectionPosition();
    }
    clearSelection() {
      this._core.clearSelection();
    }
    selectAll() {
      this._core.selectAll();
    }
    selectLines(t, e) {
      this._verifyIntegers(t, e), this._core.selectLines(t, e);
    }
    dispose() {
      super.dispose();
    }
    scrollLines(t) {
      this._verifyIntegers(t), this._core.scrollLines(t);
    }
    scrollPages(t) {
      this._verifyIntegers(t), this._core.scrollPages(t);
    }
    scrollToTop() {
      this._core.scrollToTop();
    }
    scrollToBottom() {
      this._core.scrollToBottom();
    }
    scrollToLine(t) {
      this._verifyIntegers(t), this._core.scrollToLine(t);
    }
    clear() {
      this._core.clear();
    }
    write(t, e) {
      this._core.write(t, e);
    }
    writeln(t, e) {
      this._core.write(t), this._core.write(`\r
`, e);
    }
    paste(t) {
      this._core.paste(t);
    }
    refresh(t, e) {
      this._verifyIntegers(t, e), this._core.refresh(t, e);
    }
    reset() {
      this._core.reset();
    }
    clearTextureAtlas() {
      this._core.clearTextureAtlas();
    }
    loadAddon(t) {
      this._addonManager.loadAddon(this, t);
    }
    static get strings() {
      return {
        get promptLabel() {
          return mi.get();
        },
        set promptLabel(t) {
          mi.set(t);
        },
        get tooMuchOutput() {
          return _i.get();
        },
        set tooMuchOutput(t) {
          _i.set(t);
        }
      };
    }
    _verifyIntegers(...t) {
      for (Ue of t) if (Ue === 1 / 0 || isNaN(Ue) || Ue % 1 !== 0) throw new Error("This API only accepts integers");
    }
    _verifyPositiveIntegers(...t) {
      for (Ue of t) if (Ue && (Ue === 1 / 0 || isNaN(Ue) || Ue % 1 !== 0 || Ue < 0)) throw new Error("This API only accepts positive integers");
    }
  };

;// ./node_modules/@xterm/addon-fit/lib/addon-fit.mjs
/**
 * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
 * @license MIT
 *
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * @license MIT
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
var h = 2,
  _ = 1,
  o = class {
    activate(e) {
      this._terminal = e;
    }
    dispose() {}
    fit() {
      let e = this.proposeDimensions();
      if (!e || !this._terminal || isNaN(e.cols) || isNaN(e.rows)) return;
      let t = this._terminal._core;
      (this._terminal.rows !== e.rows || this._terminal.cols !== e.cols) && (t._renderService.clear(), this._terminal.resize(e.cols, e.rows));
    }
    proposeDimensions() {
      if (!this._terminal || !this._terminal.element || !this._terminal.element.parentElement) return;
      let t = this._terminal._core._renderService.dimensions;
      if (t.css.cell.width === 0 || t.css.cell.height === 0) return;
      let s = this._terminal.options.scrollback === 0 ? 0 : this._terminal.options.overviewRuler?.width || 14,
        r = window.getComputedStyle(this._terminal.element.parentElement),
        l = parseInt(r.getPropertyValue("height")),
        a = Math.max(0, parseInt(r.getPropertyValue("width"))),
        i = window.getComputedStyle(this._terminal.element),
        n = {
          top: parseInt(i.getPropertyValue("padding-top")),
          bottom: parseInt(i.getPropertyValue("padding-bottom")),
          right: parseInt(i.getPropertyValue("padding-right")),
          left: parseInt(i.getPropertyValue("padding-left"))
        },
        m = n.top + n.bottom,
        d = n.right + n.left,
        c = l - m,
        p = a - d - s;
      return {
        cols: Math.max(h, Math.floor(p / t.css.cell.width)),
        rows: Math.max(_, Math.floor(c / t.css.cell.height))
      };
    }
  };

;// ./node_modules/@xterm/addon-clipboard/lib/addon-clipboard.mjs
/**
 * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
 * @license MIT
 *
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * @license MIT
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
var addon_clipboard_U = "3.7.8",
  addon_clipboard_$ = addon_clipboard_U,
  f = typeof Buffer == "function",
  addon_clipboard_ = typeof TextDecoder == "function" ? new TextDecoder() : void 0,
  addon_clipboard_C = typeof TextEncoder == "function" ? new TextEncoder() : void 0,
  N = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  c = Array.prototype.slice.call(N),
  d = (e => {
    let t = {};
    return e.forEach((r, o) => t[r] = o), t;
  })(c),
  k = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,
  n = String.fromCharCode.bind(String),
  addon_clipboard_B = typeof Uint8Array.from == "function" ? Uint8Array.from.bind(Uint8Array) : e => new Uint8Array(Array.prototype.slice.call(e, 0)),
  addon_clipboard_S = e => e.replace(/=/g, "").replace(/[+\/]/g, t => t == "+" ? "-" : "_"),
  I = e => e.replace(/[^A-Za-z0-9\+\/]/g, ""),
  addon_clipboard_F = e => {
    let t,
      r,
      o,
      i,
      s = "",
      l = e.length % 3;
    for (let a = 0; a < e.length;) {
      if ((r = e.charCodeAt(a++)) > 255 || (o = e.charCodeAt(a++)) > 255 || (i = e.charCodeAt(a++)) > 255) throw new TypeError("invalid character found");
      t = r << 16 | o << 8 | i, s += c[t >> 18 & 63] + c[t >> 12 & 63] + c[t >> 6 & 63] + c[t & 63];
    }
    return l ? s.slice(0, l - 3) + "===".substring(l) : s;
  },
  m = typeof btoa == "function" ? e => btoa(e) : f ? e => Buffer.from(e, "binary").toString("base64") : addon_clipboard_F,
  addon_clipboard_b = f ? e => Buffer.from(e).toString("base64") : e => {
    let r = [];
    for (let o = 0, i = e.length; o < i; o += 4096) r.push(n.apply(null, e.subarray(o, o + 4096)));
    return m(r.join(""));
  },
  x = (e, t = !1) => t ? addon_clipboard_S(addon_clipboard_b(e)) : addon_clipboard_b(e),
  addon_clipboard_H = e => {
    if (e.length < 2) {
      var t = e.charCodeAt(0);
      return t < 128 ? e : t < 2048 ? n(192 | t >>> 6) + n(128 | t & 63) : n(224 | t >>> 12 & 15) + n(128 | t >>> 6 & 63) + n(128 | t & 63);
    } else {
      var t = 65536 + (e.charCodeAt(0) - 55296) * 1024 + (e.charCodeAt(1) - 56320);
      return n(240 | t >>> 18 & 7) + n(128 | t >>> 12 & 63) + n(128 | t >>> 6 & 63) + n(128 | t & 63);
    }
  },
  addon_clipboard_J = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,
  P = e => e.replace(addon_clipboard_J, addon_clipboard_H),
  T = f ? e => Buffer.from(e, "utf8").toString("base64") : addon_clipboard_C ? e => addon_clipboard_b(addon_clipboard_C.encode(e)) : e => m(P(e)),
  p = (e, t = !1) => t ? addon_clipboard_S(T(e)) : T(e),
  addon_clipboard_v = e => p(e, !0),
  addon_clipboard_q = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,
  addon_clipboard_G = e => {
    switch (e.length) {
      case 4:
        var t = (7 & e.charCodeAt(0)) << 18 | (63 & e.charCodeAt(1)) << 12 | (63 & e.charCodeAt(2)) << 6 | 63 & e.charCodeAt(3),
          r = t - 65536;
        return n((r >>> 10) + 55296) + n((r & 1023) + 56320);
      case 3:
        return n((15 & e.charCodeAt(0)) << 12 | (63 & e.charCodeAt(1)) << 6 | 63 & e.charCodeAt(2));
      default:
        return n((31 & e.charCodeAt(0)) << 6 | 63 & e.charCodeAt(1));
    }
  },
  addon_clipboard_D = e => e.replace(addon_clipboard_q, addon_clipboard_G),
  w = e => {
    if (e = e.replace(/\s+/g, ""), !k.test(e)) throw new TypeError("malformed base64.");
    e += "==".slice(2 - (e.length & 3));
    let t,
      r,
      o,
      i = [];
    for (let s = 0; s < e.length;) t = d[e.charAt(s++)] << 18 | d[e.charAt(s++)] << 12 | (r = d[e.charAt(s++)]) << 6 | (o = d[e.charAt(s++)]), r === 64 ? i.push(n(t >> 16 & 255)) : o === 64 ? i.push(n(t >> 16 & 255, t >> 8 & 255)) : i.push(n(t >> 16 & 255, t >> 8 & 255, t & 255));
    return i.join("");
  },
  y = typeof atob == "function" ? e => atob(I(e)) : f ? e => Buffer.from(e, "base64").toString("binary") : w,
  R = f ? e => addon_clipboard_B(Buffer.from(e, "base64")) : e => addon_clipboard_B(y(e).split("").map(t => t.charCodeAt(0))),
  E = e => R(O(e)),
  addon_clipboard_K = f ? e => Buffer.from(e, "base64").toString("utf8") : addon_clipboard_ ? e => addon_clipboard_.decode(R(e)) : e => addon_clipboard_D(y(e)),
  O = e => I(e.replace(/[-_]/g, t => t == "-" ? "+" : "/")),
  addon_clipboard_h = e => addon_clipboard_K(O(e)),
  addon_clipboard_M = e => {
    if (typeof e != "string") return !1;
    let t = e.replace(/\s+/g, "").replace(/={0,2}$/, "");
    return !/[^\s0-9a-zA-Z\+/]/.test(t) || !/[^\s0-9a-zA-Z\-_]/.test(t);
  },
  addon_clipboard_z = e => ({
    value: e,
    enumerable: !1,
    writable: !0,
    configurable: !0
  }),
  Z = function () {
    let e = (t, r) => Object.defineProperty(String.prototype, t, addon_clipboard_z(r));
    e("fromBase64", function () {
      return addon_clipboard_h(this);
    }), e("toBase64", function (t) {
      return p(this, t);
    }), e("toBase64URI", function () {
      return p(this, !0);
    }), e("toBase64URL", function () {
      return p(this, !0);
    }), e("toUint8Array", function () {
      return E(this);
    });
  },
  V = function () {
    let e = (t, r) => Object.defineProperty(Uint8Array.prototype, t, addon_clipboard_z(r));
    e("toBase64", function (t) {
      return x(this, t);
    }), e("toBase64URI", function () {
      return x(this, !0);
    }), e("toBase64URL", function () {
      return x(this, !0);
    });
  },
  addon_clipboard_Q = () => {
    Z(), V();
  },
  u = {
    version: addon_clipboard_U,
    VERSION: addon_clipboard_$,
    atob: y,
    atobPolyfill: w,
    btoa: m,
    btoaPolyfill: addon_clipboard_F,
    fromBase64: addon_clipboard_h,
    toBase64: p,
    encode: p,
    encodeURI: addon_clipboard_v,
    encodeURL: addon_clipboard_v,
    utob: P,
    btou: addon_clipboard_D,
    decode: addon_clipboard_h,
    isValid: addon_clipboard_M,
    fromUint8Array: x,
    toUint8Array: E,
    extendString: Z,
    extendUint8Array: V,
    extendBuiltins: addon_clipboard_Q
  };
var addon_clipboard_j = class {
    constructor(t = new A(), r = new g()) {
      this._base64 = t;
      this._provider = r;
    }
    activate(t) {
      this._terminal = t, this._disposable = t.parser.registerOscHandler(52, r => this._setOrReportClipboard(r));
    }
    dispose() {
      return this._disposable?.dispose();
    }
    _readText(t, r) {
      let o = this._base64.encodeText(r);
      this._terminal?.input(`\x1B]52;${t};${o}\x07`, !1);
    }
    _setOrReportClipboard(t) {
      let r = t.split(";");
      if (r.length < 2) return !0;
      let o = r[0],
        i = r[1];
      if (i === "?") {
        let a = this._provider.readText(o);
        return a instanceof Promise ? a.then(L => (this._readText(o, L), !0)) : (this._readText(o, a), !0);
      }
      let s = "";
      try {
        s = this._base64.decodeText(i);
      } catch {}
      let l = this._provider.writeText(o, s);
      return l instanceof Promise ? l.then(() => !0) : !0;
    }
  },
  g = class {
    async readText(t) {
      return t !== "c" ? Promise.resolve("") : navigator.clipboard.readText();
    }
    async writeText(t, r) {
      return t !== "c" ? Promise.resolve() : navigator.clipboard.writeText(r);
    }
  },
  A = class {
    encodeText(t) {
      return u.encode(t);
    }
    decodeText(t) {
      let r = u.decode(t);
      return !u.isValid(t) || u.encode(r) !== t ? "" : r;
    }
  };

;// ./node_modules/@xterm/addon-ligatures/lib/addon-ligatures.mjs
/**
 * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
 * @license MIT
 *
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * @license MIT
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
var rl = Object.create;
var addon_ligatures_Fa = Object.defineProperty;
var addon_ligatures_tl = Object.getOwnPropertyDescriptor;
var nl = Object.getOwnPropertyNames;
var addon_ligatures_al = Object.getPrototypeOf,
  addon_ligatures_sl = Object.prototype.hasOwnProperty;
var me = (s => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(s, {
  get: (o, c) => (typeof require < "u" ? require : o)[c]
}) : s)(function (s) {
  if (typeof require < "u") return require.apply(this, arguments);
  throw Error('Dynamic require of "' + s + '" is not supported');
});
var addon_ligatures_q = (s, o) => () => (o || s((o = {
  exports: {}
}).exports, o), o.exports);
var addon_ligatures_il = (s, o, c, h) => {
  if (o && typeof o == "object" || typeof o == "function") for (let p of nl(o)) !addon_ligatures_sl.call(s, p) && p !== c && addon_ligatures_Fa(s, p, {
    get: () => o[p],
    enumerable: !(h = addon_ligatures_tl(o, p)) || h.enumerable
  });
  return s;
};
var addon_ligatures_ol = (s, o, c) => (c = s != null ? rl(addon_ligatures_al(s)) : {}, addon_ligatures_il(o || !s || !s.__esModule ? addon_ligatures_Fa(c, "default", {
  value: s,
  enumerable: !0
}) : c, s));
var addon_ligatures_Ua = addon_ligatures_q((Pr, Ta) => {
  (function (s, o) {
    typeof Pr == "object" && typeof Ta < "u" ? o(Pr) : typeof define == "function" && define.amd ? define(["exports"], o) : o(s.opentype = s.opentype || {});
  })(Pr, function (s) {
    "use strict";

    var o = 0,
      c = -3;
    function h() {
      this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
    }
    function p(e, r) {
      this.source = e, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = r, this.destLen = 0, this.ltree = new h(), this.dtree = new h();
    }
    var m = new h(),
      b = new h(),
      F = new Uint8Array(30),
      U = new Uint16Array(30),
      I = new Uint8Array(30),
      z = new Uint16Array(30),
      B = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]),
      W = new h(),
      X = new Uint8Array(320);
    function Z(e, r, t, n) {
      var a, i;
      for (a = 0; a < t; ++a) e[a] = 0;
      for (a = 0; a < 30 - t; ++a) e[a + t] = a / t | 0;
      for (i = n, a = 0; a < 30; ++a) r[a] = i, i += 1 << e[a];
    }
    function xe(e, r) {
      var t;
      for (t = 0; t < 7; ++t) e.table[t] = 0;
      for (e.table[7] = 24, e.table[8] = 152, e.table[9] = 112, t = 0; t < 24; ++t) e.trans[t] = 256 + t;
      for (t = 0; t < 144; ++t) e.trans[24 + t] = t;
      for (t = 0; t < 8; ++t) e.trans[168 + t] = 280 + t;
      for (t = 0; t < 112; ++t) e.trans[176 + t] = 144 + t;
      for (t = 0; t < 5; ++t) r.table[t] = 0;
      for (r.table[5] = 32, t = 0; t < 32; ++t) r.trans[t] = t;
    }
    var Ne = new Uint16Array(16);
    function Ee(e, r, t, n) {
      var a, i;
      for (a = 0; a < 16; ++a) e.table[a] = 0;
      for (a = 0; a < n; ++a) e.table[r[t + a]]++;
      for (e.table[0] = 0, i = 0, a = 0; a < 16; ++a) Ne[a] = i, i += e.table[a];
      for (a = 0; a < n; ++a) r[t + a] && (e.trans[Ne[r[t + a]]++] = a);
    }
    function yr(e) {
      e.bitcount-- || (e.tag = e.source[e.sourceIndex++], e.bitcount = 7);
      var r = e.tag & 1;
      return e.tag >>>= 1, r;
    }
    function ue(e, r, t) {
      if (!r) return t;
      for (; e.bitcount < 24;) e.tag |= e.source[e.sourceIndex++] << e.bitcount, e.bitcount += 8;
      var n = e.tag & 65535 >>> 16 - r;
      return e.tag >>>= r, e.bitcount -= r, n + t;
    }
    function Qr(e, r) {
      for (; e.bitcount < 24;) e.tag |= e.source[e.sourceIndex++] << e.bitcount, e.bitcount += 8;
      var t = 0,
        n = 0,
        a = 0,
        i = e.tag;
      do n = 2 * n + (i & 1), i >>>= 1, ++a, t += r.table[a], n -= r.table[a]; while (n >= 0);
      return e.tag = i, e.bitcount -= a, r.trans[t + n];
    }
    function ks(e, r, t) {
      var n, a, i, u, f, l;
      for (n = ue(e, 5, 257), a = ue(e, 5, 1), i = ue(e, 4, 4), u = 0; u < 19; ++u) X[u] = 0;
      for (u = 0; u < i; ++u) {
        var d = ue(e, 3, 0);
        X[B[u]] = d;
      }
      for (Ee(W, X, 0, 19), f = 0; f < n + a;) {
        var v = Qr(e, W);
        switch (v) {
          case 16:
            var x = X[f - 1];
            for (l = ue(e, 2, 3); l; --l) X[f++] = x;
            break;
          case 17:
            for (l = ue(e, 3, 3); l; --l) X[f++] = 0;
            break;
          case 18:
            for (l = ue(e, 7, 11); l; --l) X[f++] = 0;
            break;
          default:
            X[f++] = v;
            break;
        }
      }
      Ee(r, X, 0, n), Ee(t, X, n, a);
    }
    function tn(e, r, t) {
      for (;;) {
        var n = Qr(e, r);
        if (n === 256) return o;
        if (n < 256) e.dest[e.destLen++] = n;else {
          var a, i, u, f;
          for (n -= 257, a = ue(e, F[n], U[n]), i = Qr(e, t), u = e.destLen - ue(e, I[i], z[i]), f = u; f < u + a; ++f) e.dest[e.destLen++] = e.dest[f];
        }
      }
    }
    function Os(e) {
      for (var r, t, n; e.bitcount > 8;) e.sourceIndex--, e.bitcount -= 8;
      if (r = e.source[e.sourceIndex + 1], r = 256 * r + e.source[e.sourceIndex], t = e.source[e.sourceIndex + 3], t = 256 * t + e.source[e.sourceIndex + 2], r !== (~t & 65535)) return c;
      for (e.sourceIndex += 4, n = r; n; --n) e.dest[e.destLen++] = e.source[e.sourceIndex++];
      return e.bitcount = 0, o;
    }
    function ws(e, r) {
      var t = new p(e, r),
        n,
        a,
        i;
      do {
        switch (n = yr(t), a = ue(t, 2, 0), a) {
          case 0:
            i = Os(t);
            break;
          case 1:
            i = tn(t, m, b);
            break;
          case 2:
            ks(t, t.ltree, t.dtree), i = tn(t, t.ltree, t.dtree);
            break;
          default:
            i = c;
        }
        if (i !== o) throw new Error("Data error");
      } while (!n);
      return t.destLen < t.dest.length ? typeof t.dest.slice == "function" ? t.dest.slice(0, t.destLen) : t.dest.subarray(0, t.destLen) : t.dest;
    }
    xe(m, b), Z(F, U, 4, 3), Z(I, z, 2, 1), F[28] = 0, U[28] = 258;
    var Cs = ws;
    function Ze(e, r, t, n, a) {
      return Math.pow(1 - a, 3) * e + 3 * Math.pow(1 - a, 2) * a * r + 3 * (1 - a) * Math.pow(a, 2) * t + Math.pow(a, 3) * n;
    }
    function we() {
      this.x1 = Number.NaN, this.y1 = Number.NaN, this.x2 = Number.NaN, this.y2 = Number.NaN;
    }
    we.prototype.isEmpty = function () {
      return isNaN(this.x1) || isNaN(this.y1) || isNaN(this.x2) || isNaN(this.y2);
    }, we.prototype.addPoint = function (e, r) {
      typeof e == "number" && ((isNaN(this.x1) || isNaN(this.x2)) && (this.x1 = e, this.x2 = e), e < this.x1 && (this.x1 = e), e > this.x2 && (this.x2 = e)), typeof r == "number" && ((isNaN(this.y1) || isNaN(this.y2)) && (this.y1 = r, this.y2 = r), r < this.y1 && (this.y1 = r), r > this.y2 && (this.y2 = r));
    }, we.prototype.addX = function (e) {
      this.addPoint(e, null);
    }, we.prototype.addY = function (e) {
      this.addPoint(null, e);
    }, we.prototype.addBezier = function (e, r, t, n, a, i, u, f) {
      var l = this,
        d = [e, r],
        v = [t, n],
        x = [a, i],
        g = [u, f];
      this.addPoint(e, r), this.addPoint(u, f);
      for (var y = 0; y <= 1; y++) {
        var T = 6 * d[y] - 12 * v[y] + 6 * x[y],
          w = -3 * d[y] + 9 * v[y] - 9 * x[y] + 3 * g[y],
          E = 3 * v[y] - 3 * d[y];
        if (w === 0) {
          if (T === 0) continue;
          var O = -E / T;
          0 < O && O < 1 && (y === 0 && l.addX(Ze(d[y], v[y], x[y], g[y], O)), y === 1 && l.addY(Ze(d[y], v[y], x[y], g[y], O)));
          continue;
        }
        var G = Math.pow(T, 2) - 4 * E * w;
        if (!(G < 0)) {
          var C = (-T + Math.sqrt(G)) / (2 * w);
          0 < C && C < 1 && (y === 0 && l.addX(Ze(d[y], v[y], x[y], g[y], C)), y === 1 && l.addY(Ze(d[y], v[y], x[y], g[y], C)));
          var _ = (-T - Math.sqrt(G)) / (2 * w);
          0 < _ && _ < 1 && (y === 0 && l.addX(Ze(d[y], v[y], x[y], g[y], _)), y === 1 && l.addY(Ze(d[y], v[y], x[y], g[y], _)));
        }
      }
    }, we.prototype.addQuad = function (e, r, t, n, a, i) {
      var u = e + .6666666666666666 * (t - e),
        f = r + 2 / 3 * (n - r),
        l = u + 1 / 3 * (a - e),
        d = f + 1 / 3 * (i - r);
      this.addBezier(e, r, u, f, l, d, a, i);
    };
    function Q() {
      this.commands = [], this.fill = "black", this.stroke = null, this.strokeWidth = 1;
    }
    Q.prototype.moveTo = function (e, r) {
      this.commands.push({
        type: "M",
        x: e,
        y: r
      });
    }, Q.prototype.lineTo = function (e, r) {
      this.commands.push({
        type: "L",
        x: e,
        y: r
      });
    }, Q.prototype.curveTo = Q.prototype.bezierCurveTo = function (e, r, t, n, a, i) {
      this.commands.push({
        type: "C",
        x1: e,
        y1: r,
        x2: t,
        y2: n,
        x: a,
        y: i
      });
    }, Q.prototype.quadTo = Q.prototype.quadraticCurveTo = function (e, r, t, n) {
      this.commands.push({
        type: "Q",
        x1: e,
        y1: r,
        x: t,
        y: n
      });
    }, Q.prototype.close = Q.prototype.closePath = function () {
      this.commands.push({
        type: "Z"
      });
    }, Q.prototype.extend = function (e) {
      if (e.commands) e = e.commands;else if (e instanceof we) {
        var r = e;
        this.moveTo(r.x1, r.y1), this.lineTo(r.x2, r.y1), this.lineTo(r.x2, r.y2), this.lineTo(r.x1, r.y2), this.close();
        return;
      }
      Array.prototype.push.apply(this.commands, e);
    }, Q.prototype.getBoundingBox = function () {
      for (var e = this, r = new we(), t = 0, n = 0, a = 0, i = 0, u = 0; u < this.commands.length; u++) {
        var f = e.commands[u];
        switch (f.type) {
          case "M":
            r.addPoint(f.x, f.y), t = a = f.x, n = i = f.y;
            break;
          case "L":
            r.addPoint(f.x, f.y), a = f.x, i = f.y;
            break;
          case "Q":
            r.addQuad(a, i, f.x1, f.y1, f.x, f.y), a = f.x, i = f.y;
            break;
          case "C":
            r.addBezier(a, i, f.x1, f.y1, f.x2, f.y2, f.x, f.y), a = f.x, i = f.y;
            break;
          case "Z":
            a = t, i = n;
            break;
          default:
            throw new Error("Unexpected path command " + f.type);
        }
      }
      return r.isEmpty() && r.addPoint(0, 0), r;
    }, Q.prototype.draw = function (e) {
      var r = this;
      e.beginPath();
      for (var t = 0; t < this.commands.length; t += 1) {
        var n = r.commands[t];
        n.type === "M" ? e.moveTo(n.x, n.y) : n.type === "L" ? e.lineTo(n.x, n.y) : n.type === "C" ? e.bezierCurveTo(n.x1, n.y1, n.x2, n.y2, n.x, n.y) : n.type === "Q" ? e.quadraticCurveTo(n.x1, n.y1, n.x, n.y) : n.type === "Z" && e.closePath();
      }
      this.fill && (e.fillStyle = this.fill, e.fill()), this.stroke && (e.strokeStyle = this.stroke, e.lineWidth = this.strokeWidth, e.stroke());
    }, Q.prototype.toPathData = function (e) {
      var r = this;
      e = e !== void 0 ? e : 2;
      function t(f) {
        return Math.round(f) === f ? "" + Math.round(f) : f.toFixed(e);
      }
      function n() {
        for (var f = arguments, l = "", d = 0; d < arguments.length; d += 1) {
          var v = f[d];
          v >= 0 && d > 0 && (l += " "), l += t(v);
        }
        return l;
      }
      for (var a = "", i = 0; i < this.commands.length; i += 1) {
        var u = r.commands[i];
        u.type === "M" ? a += "M" + n(u.x, u.y) : u.type === "L" ? a += "L" + n(u.x, u.y) : u.type === "C" ? a += "C" + n(u.x1, u.y1, u.x2, u.y2, u.x, u.y) : u.type === "Q" ? a += "Q" + n(u.x1, u.y1, u.x, u.y) : u.type === "Z" && (a += "Z");
      }
      return a;
    }, Q.prototype.toSVG = function (e) {
      var r = '<path d="';
      return r += this.toPathData(e), r += '"', this.fill && this.fill !== "black" && (this.fill === null ? r += ' fill="none"' : r += ' fill="' + this.fill + '"'), this.stroke && (r += ' stroke="' + this.stroke + '" stroke-width="' + this.strokeWidth + '"'), r += "/>", r;
    }, Q.prototype.toDOMElement = function (e) {
      var r = this.toPathData(e),
        t = document.createElementNS("http://www.w3.org/2000/svg", "path");
      return t.setAttribute("d", r), t;
    };
    function nn(e) {
      throw new Error(e);
    }
    function an(e, r) {
      e || nn(r);
    }
    var N = {
        fail: nn,
        argument: an,
        assert: an
      },
      sn = 32768,
      on = 2147483648,
      Qe = {},
      k = {},
      P = {};
    function be(e) {
      return function () {
        return e;
      };
    }
    k.BYTE = function (e) {
      return N.argument(e >= 0 && e <= 255, "Byte value should be between 0 and 255."), [e];
    }, P.BYTE = be(1), k.CHAR = function (e) {
      return [e.charCodeAt(0)];
    }, P.CHAR = be(1), k.CHARARRAY = function (e) {
      for (var r = [], t = 0; t < e.length; t += 1) r[t] = e.charCodeAt(t);
      return r;
    }, P.CHARARRAY = function (e) {
      return e.length;
    }, k.USHORT = function (e) {
      return [e >> 8 & 255, e & 255];
    }, P.USHORT = be(2), k.SHORT = function (e) {
      return e >= sn && (e = -(2 * sn - e)), [e >> 8 & 255, e & 255];
    }, P.SHORT = be(2), k.UINT24 = function (e) {
      return [e >> 16 & 255, e >> 8 & 255, e & 255];
    }, P.UINT24 = be(3), k.ULONG = function (e) {
      return [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
    }, P.ULONG = be(4), k.LONG = function (e) {
      return e >= on && (e = -(2 * on - e)), [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
    }, P.LONG = be(4), k.FIXED = k.ULONG, P.FIXED = P.ULONG, k.FWORD = k.SHORT, P.FWORD = P.SHORT, k.UFWORD = k.USHORT, P.UFWORD = P.USHORT, k.LONGDATETIME = function (e) {
      return [0, 0, 0, 0, e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
    }, P.LONGDATETIME = be(8), k.TAG = function (e) {
      return N.argument(e.length === 4, "Tag should be exactly 4 ASCII characters."), [e.charCodeAt(0), e.charCodeAt(1), e.charCodeAt(2), e.charCodeAt(3)];
    }, P.TAG = be(4), k.Card8 = k.BYTE, P.Card8 = P.BYTE, k.Card16 = k.USHORT, P.Card16 = P.USHORT, k.OffSize = k.BYTE, P.OffSize = P.BYTE, k.SID = k.USHORT, P.SID = P.USHORT, k.NUMBER = function (e) {
      return e >= -107 && e <= 107 ? [e + 139] : e >= 108 && e <= 1131 ? (e = e - 108, [(e >> 8) + 247, e & 255]) : e >= -1131 && e <= -108 ? (e = -e - 108, [(e >> 8) + 251, e & 255]) : e >= -32768 && e <= 32767 ? k.NUMBER16(e) : k.NUMBER32(e);
    }, P.NUMBER = function (e) {
      return k.NUMBER(e).length;
    }, k.NUMBER16 = function (e) {
      return [28, e >> 8 & 255, e & 255];
    }, P.NUMBER16 = be(3), k.NUMBER32 = function (e) {
      return [29, e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
    }, P.NUMBER32 = be(5), k.REAL = function (e) {
      var r = e.toString(),
        t = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(r);
      if (t) {
        var n = parseFloat("1e" + ((t[2] ? +t[2] : 0) + t[1].length));
        r = (Math.round(e * n) / n).toString();
      }
      for (var a = "", i = 0, u = r.length; i < u; i += 1) {
        var f = r[i];
        f === "e" ? a += r[++i] === "-" ? "c" : "b" : f === "." ? a += "a" : f === "-" ? a += "e" : a += f;
      }
      a += a.length & 1 ? "f" : "ff";
      for (var l = [30], d = 0, v = a.length; d < v; d += 2) l.push(parseInt(a.substr(d, 2), 16));
      return l;
    }, P.REAL = function (e) {
      return k.REAL(e).length;
    }, k.NAME = k.CHARARRAY, P.NAME = P.CHARARRAY, k.STRING = k.CHARARRAY, P.STRING = P.CHARARRAY, Qe.UTF8 = function (e, r, t) {
      for (var n = [], a = t, i = 0; i < a; i++, r += 1) n[i] = e.getUint8(r);
      return String.fromCharCode.apply(null, n);
    }, Qe.UTF16 = function (e, r, t) {
      for (var n = [], a = t / 2, i = 0; i < a; i++, r += 2) n[i] = e.getUint16(r);
      return String.fromCharCode.apply(null, n);
    }, k.UTF16 = function (e) {
      for (var r = [], t = 0; t < e.length; t += 1) {
        var n = e.charCodeAt(t);
        r[r.length] = n >> 8 & 255, r[r.length] = n & 255;
      }
      return r;
    }, P.UTF16 = function (e) {
      return e.length * 2;
    };
    var Jr = {
      "x-mac-croatian": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\u0160\u2122\xB4\xA8\u2260\u017D\xD8\u221E\xB1\u2264\u2265\u2206\xB5\u2202\u2211\u220F\u0161\u222B\xAA\xBA\u03A9\u017E\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u0106\xAB\u010C\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u0110\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\uF8FF\xA9\u2044\u20AC\u2039\u203A\xC6\xBB\u2013\xB7\u201A\u201E\u2030\xC2\u0107\xC1\u010D\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u0111\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u03C0\xCB\u02DA\xB8\xCA\xE6\u02C7",
      "x-mac-cyrillic": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u2020\xB0\u0490\xA3\xA7\u2022\xB6\u0406\xAE\xA9\u2122\u0402\u0452\u2260\u0403\u0453\u221E\xB1\u2264\u2265\u0456\xB5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040A\u045A\u0458\u0405\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\u040B\u045B\u040C\u045C\u0455\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u201E\u040E\u045E\u040F\u045F\u2116\u0401\u0451\u044F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E",
      "x-mac-gaelic": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u1E02\xB1\u2264\u2265\u1E03\u010A\u010B\u1E0A\u1E0B\u1E1E\u1E1F\u0120\u0121\u1E40\xE6\xF8\u1E41\u1E56\u1E57\u027C\u0192\u017F\u1E60\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\u1E61\u1E9B\xFF\u0178\u1E6A\u20AC\u2039\u203A\u0176\u0177\u1E6B\xB7\u1EF2\u1EF3\u204A\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u2663\xD2\xDA\xDB\xD9\u0131\xDD\xFD\u0174\u0175\u1E84\u1E85\u1E80\u1E81\u1E82\u1E83",
      "x-mac-greek": "\xC4\xB9\xB2\xC9\xB3\xD6\xDC\u0385\xE0\xE2\xE4\u0384\xA8\xE7\xE9\xE8\xEA\xEB\xA3\u2122\xEE\xEF\u2022\xBD\u2030\xF4\xF6\xA6\u20AC\xF9\xFB\xFC\u2020\u0393\u0394\u0398\u039B\u039E\u03A0\xDF\xAE\xA9\u03A3\u03AA\xA7\u2260\xB0\xB7\u0391\xB1\u2264\u2265\xA5\u0392\u0395\u0396\u0397\u0399\u039A\u039C\u03A6\u03AB\u03A8\u03A9\u03AC\u039D\xAC\u039F\u03A1\u2248\u03A4\xAB\xBB\u2026\xA0\u03A5\u03A7\u0386\u0388\u0153\u2013\u2015\u201C\u201D\u2018\u2019\xF7\u0389\u038A\u038C\u038E\u03AD\u03AE\u03AF\u03CC\u038F\u03CD\u03B1\u03B2\u03C8\u03B4\u03B5\u03C6\u03B3\u03B7\u03B9\u03BE\u03BA\u03BB\u03BC\u03BD\u03BF\u03C0\u03CE\u03C1\u03C3\u03C4\u03B8\u03C9\u03C2\u03C7\u03C5\u03B6\u03CA\u03CB\u0390\u03B0\xAD",
      "x-mac-icelandic": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\xDD\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\xD0\xF0\xDE\xFE\xFD\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7",
      "x-mac-inuit": "\u1403\u1404\u1405\u1406\u140A\u140B\u1431\u1432\u1433\u1434\u1438\u1439\u1449\u144E\u144F\u1450\u1451\u1455\u1456\u1466\u146D\u146E\u146F\u1470\u1472\u1473\u1483\u148B\u148C\u148D\u148E\u1490\u1491\xB0\u14A1\u14A5\u14A6\u2022\xB6\u14A7\xAE\xA9\u2122\u14A8\u14AA\u14AB\u14BB\u14C2\u14C3\u14C4\u14C5\u14C7\u14C8\u14D0\u14EF\u14F0\u14F1\u14F2\u14F4\u14F5\u1505\u14D5\u14D6\u14D7\u14D8\u14DA\u14DB\u14EA\u1528\u1529\u152A\u152B\u152D\u2026\xA0\u152E\u153E\u1555\u1556\u1557\u2013\u2014\u201C\u201D\u2018\u2019\u1558\u1559\u155A\u155D\u1546\u1547\u1548\u1549\u154B\u154C\u1550\u157F\u1580\u1581\u1582\u1583\u1584\u1585\u158F\u1590\u1591\u1592\u1593\u1594\u1595\u1671\u1672\u1673\u1674\u1675\u1676\u1596\u15A0\u15A1\u15A2\u15A3\u15A4\u15A5\u15A6\u157C\u0141\u0142",
      "x-mac-ce": "\xC4\u0100\u0101\xC9\u0104\xD6\xDC\xE1\u0105\u010C\xE4\u010D\u0106\u0107\xE9\u0179\u017A\u010E\xED\u010F\u0112\u0113\u0116\xF3\u0117\xF4\xF6\xF5\xFA\u011A\u011B\xFC\u2020\xB0\u0118\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\u0119\xA8\u2260\u0123\u012E\u012F\u012A\u2264\u2265\u012B\u0136\u2202\u2211\u0142\u013B\u013C\u013D\u013E\u0139\u013A\u0145\u0146\u0143\xAC\u221A\u0144\u0147\u2206\xAB\xBB\u2026\xA0\u0148\u0150\xD5\u0151\u014C\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\u014D\u0154\u0155\u0158\u2039\u203A\u0159\u0156\u0157\u0160\u201A\u201E\u0161\u015A\u015B\xC1\u0164\u0165\xCD\u017D\u017E\u016A\xD3\xD4\u016B\u016E\xDA\u016F\u0170\u0171\u0172\u0173\xDD\xFD\u0137\u017B\u0141\u017C\u0122\u02C7",
      macintosh: "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7",
      "x-mac-romanian": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\u0102\u0218\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\u0103\u0219\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\u2039\u203A\u021A\u021B\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7",
      "x-mac-turkish": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u011E\u011F\u0130\u0131\u015E\u015F\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\uF8A0\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"
    };
    Qe.MACSTRING = function (e, r, t, n) {
      var a = Jr[n];
      if (a !== void 0) {
        for (var i = "", u = 0; u < t; u++) {
          var f = e.getUint8(r + u);
          f <= 127 ? i += String.fromCharCode(f) : i += a[f & 127];
        }
        return i;
      }
    };
    var xr = typeof WeakMap == "function" && new WeakMap(),
      br,
      Ls = function (e) {
        if (!br) {
          br = {};
          for (var r in Jr) br[r] = new String(r);
        }
        var t = br[e];
        if (t !== void 0) {
          if (xr) {
            var n = xr.get(t);
            if (n !== void 0) return n;
          }
          var a = Jr[e];
          if (a !== void 0) {
            for (var i = {}, u = 0; u < a.length; u++) i[a.charCodeAt(u)] = u + 128;
            return xr && xr.set(t, i), i;
          }
        }
      };
    k.MACSTRING = function (e, r) {
      var t = Ls(r);
      if (t !== void 0) {
        for (var n = [], a = 0; a < e.length; a++) {
          var i = e.charCodeAt(a);
          if (i >= 128 && (i = t[i], i === void 0)) return;
          n[a] = i;
        }
        return n;
      }
    }, P.MACSTRING = function (e, r) {
      var t = k.MACSTRING(e, r);
      return t !== void 0 ? t.length : 0;
    };
    function Kr(e) {
      return e >= -128 && e <= 127;
    }
    function Is(e, r, t) {
      for (var n = 0, a = e.length; r < a && n < 64 && e[r] === 0;) ++r, ++n;
      return t.push(128 | n - 1), r;
    }
    function As(e, r, t) {
      for (var n = 0, a = e.length, i = r; i < a && n < 64;) {
        var u = e[i];
        if (!Kr(u) || u === 0 && i + 1 < a && e[i + 1] === 0) break;
        ++i, ++n;
      }
      t.push(n - 1);
      for (var f = r; f < i; ++f) t.push(e[f] + 256 & 255);
      return i;
    }
    function Bs(e, r, t) {
      for (var n = 0, a = e.length, i = r; i < a && n < 64;) {
        var u = e[i];
        if (u === 0 || Kr(u) && i + 1 < a && Kr(e[i + 1])) break;
        ++i, ++n;
      }
      t.push(64 | n - 1);
      for (var f = r; f < i; ++f) {
        var l = e[f];
        t.push(l + 65536 >> 8 & 255, l + 256 & 255);
      }
      return i;
    }
    k.VARDELTAS = function (e) {
      for (var r = 0, t = []; r < e.length;) {
        var n = e[r];
        n === 0 ? r = Is(e, r, t) : n >= -128 && n <= 127 ? r = As(e, r, t) : r = Bs(e, r, t);
      }
      return t;
    }, k.INDEX = function (e) {
      for (var r = 1, t = [r], n = [], a = 0; a < e.length; a += 1) {
        var i = k.OBJECT(e[a]);
        Array.prototype.push.apply(n, i), r += i.length, t.push(r);
      }
      if (n.length === 0) return [0, 0];
      for (var u = [], f = 1 + Math.floor(Math.log(r) / Math.log(2)) / 8 | 0, l = [void 0, k.BYTE, k.USHORT, k.UINT24, k.ULONG][f], d = 0; d < t.length; d += 1) {
        var v = l(t[d]);
        Array.prototype.push.apply(u, v);
      }
      return Array.prototype.concat(k.Card16(e.length), k.OffSize(f), u, n);
    }, P.INDEX = function (e) {
      return k.INDEX(e).length;
    }, k.DICT = function (e) {
      for (var r = [], t = Object.keys(e), n = t.length, a = 0; a < n; a += 1) {
        var i = parseInt(t[a], 0),
          u = e[i];
        r = r.concat(k.OPERAND(u.value, u.type)), r = r.concat(k.OPERATOR(i));
      }
      return r;
    }, P.DICT = function (e) {
      return k.DICT(e).length;
    }, k.OPERATOR = function (e) {
      return e < 1200 ? [e] : [12, e - 1200];
    }, k.OPERAND = function (e, r) {
      var t = [];
      if (Array.isArray(r)) for (var n = 0; n < r.length; n += 1) N.argument(e.length === r.length, "Not enough arguments given for type" + r), t = t.concat(k.OPERAND(e[n], r[n]));else if (r === "SID") t = t.concat(k.NUMBER(e));else if (r === "offset") t = t.concat(k.NUMBER32(e));else if (r === "number") t = t.concat(k.NUMBER(e));else if (r === "real") t = t.concat(k.REAL(e));else throw new Error("Unknown operand type " + r);
      return t;
    }, k.OP = k.BYTE, P.OP = P.BYTE;
    var Sr = typeof WeakMap == "function" && new WeakMap();
    k.CHARSTRING = function (e) {
      if (Sr) {
        var r = Sr.get(e);
        if (r !== void 0) return r;
      }
      for (var t = [], n = e.length, a = 0; a < n; a += 1) {
        var i = e[a];
        t = t.concat(k[i.type](i.value));
      }
      return Sr && Sr.set(e, t), t;
    }, P.CHARSTRING = function (e) {
      return k.CHARSTRING(e).length;
    }, k.OBJECT = function (e) {
      var r = k[e.type];
      return N.argument(r !== void 0, "No encoding function for type " + e.type), r(e.value);
    }, P.OBJECT = function (e) {
      var r = P[e.type];
      return N.argument(r !== void 0, "No sizeOf function for type " + e.type), r(e.value);
    }, k.TABLE = function (e) {
      for (var r = [], t = e.fields.length, n = [], a = [], i = 0; i < t; i += 1) {
        var u = e.fields[i],
          f = k[u.type];
        N.argument(f !== void 0, "No encoding function for field type " + u.type + " (" + u.name + ")");
        var l = e[u.name];
        l === void 0 && (l = u.value);
        var d = f(l);
        u.type === "TABLE" ? (a.push(r.length), r = r.concat([0, 0]), n.push(d)) : r = r.concat(d);
      }
      for (var v = 0; v < n.length; v += 1) {
        var x = a[v],
          g = r.length;
        N.argument(g < 65536, "Table " + e.tableName + " too big."), r[x] = g >> 8, r[x + 1] = g & 255, r = r.concat(n[v]);
      }
      return r;
    }, P.TABLE = function (e) {
      for (var r = 0, t = e.fields.length, n = 0; n < t; n += 1) {
        var a = e.fields[n],
          i = P[a.type];
        N.argument(i !== void 0, "No sizeOf function for field type " + a.type + " (" + a.name + ")");
        var u = e[a.name];
        u === void 0 && (u = a.value), r += i(u), a.type === "TABLE" && (r += 2);
      }
      return r;
    }, k.RECORD = k.TABLE, P.RECORD = P.TABLE, k.LITERAL = function (e) {
      return e;
    }, P.LITERAL = function (e) {
      return e.length;
    };
    function te(e, r, t) {
      for (var n = this, a = 0; a < r.length; a += 1) {
        var i = r[a];
        n[i.name] = i.value;
      }
      if (this.tableName = e, this.fields = r, t) for (var u = Object.keys(t), f = 0; f < u.length; f += 1) {
        var l = u[f],
          d = t[l];
        n[l] !== void 0 && (n[l] = d);
      }
    }
    te.prototype.encode = function () {
      return k.TABLE(this);
    }, te.prototype.sizeOf = function () {
      return P.TABLE(this);
    };
    function or(e, r, t) {
      t === void 0 && (t = r.length);
      var n = new Array(r.length + 1);
      n[0] = {
        name: e + "Count",
        type: "USHORT",
        value: t
      };
      for (var a = 0; a < r.length; a++) n[a + 1] = {
        name: e + a,
        type: "USHORT",
        value: r[a]
      };
      return n;
    }
    function $r(e, r, t) {
      var n = r.length,
        a = new Array(n + 1);
      a[0] = {
        name: e + "Count",
        type: "USHORT",
        value: n
      };
      for (var i = 0; i < n; i++) a[i + 1] = {
        name: e + i,
        type: "TABLE",
        value: t(r[i], i)
      };
      return a;
    }
    function Fr(e, r, t) {
      var n = r.length,
        a = [];
      a[0] = {
        name: e + "Count",
        type: "USHORT",
        value: n
      };
      for (var i = 0; i < n; i++) a = a.concat(t(r[i], i));
      return a;
    }
    function Tr(e) {
      e.format === 1 ? te.call(this, "coverageTable", [{
        name: "coverageFormat",
        type: "USHORT",
        value: 1
      }].concat(or("glyph", e.glyphs))) : N.assert(!1, "Can't create coverage table format 2 yet.");
    }
    Tr.prototype = Object.create(te.prototype), Tr.prototype.constructor = Tr;
    function Ur(e) {
      te.call(this, "scriptListTable", Fr("scriptRecord", e, function (r, t) {
        var n = r.script,
          a = n.defaultLangSys;
        return N.assert(!!a, "Unable to write GSUB: script " + r.tag + " has no default language system."), [{
          name: "scriptTag" + t,
          type: "TAG",
          value: r.tag
        }, {
          name: "script" + t,
          type: "TABLE",
          value: new te("scriptTable", [{
            name: "defaultLangSys",
            type: "TABLE",
            value: new te("defaultLangSys", [{
              name: "lookupOrder",
              type: "USHORT",
              value: 0
            }, {
              name: "reqFeatureIndex",
              type: "USHORT",
              value: a.reqFeatureIndex
            }].concat(or("featureIndex", a.featureIndexes)))
          }].concat(Fr("langSys", n.langSysRecords, function (i, u) {
            var f = i.langSys;
            return [{
              name: "langSysTag" + u,
              type: "TAG",
              value: i.tag
            }, {
              name: "langSys" + u,
              type: "TABLE",
              value: new te("langSys", [{
                name: "lookupOrder",
                type: "USHORT",
                value: 0
              }, {
                name: "reqFeatureIndex",
                type: "USHORT",
                value: f.reqFeatureIndex
              }].concat(or("featureIndex", f.featureIndexes)))
            }];
          })))
        }];
      }));
    }
    Ur.prototype = Object.create(te.prototype), Ur.prototype.constructor = Ur;
    function Er(e) {
      te.call(this, "featureListTable", Fr("featureRecord", e, function (r, t) {
        var n = r.feature;
        return [{
          name: "featureTag" + t,
          type: "TAG",
          value: r.tag
        }, {
          name: "feature" + t,
          type: "TABLE",
          value: new te("featureTable", [{
            name: "featureParams",
            type: "USHORT",
            value: n.featureParams
          }].concat(or("lookupListIndex", n.lookupListIndexes)))
        }];
      }));
    }
    Er.prototype = Object.create(te.prototype), Er.prototype.constructor = Er;
    function kr(e, r) {
      te.call(this, "lookupListTable", $r("lookup", e, function (t) {
        var n = r[t.lookupType];
        return N.assert(!!n, "Unable to write GSUB lookup type " + t.lookupType + " tables."), new te("lookupTable", [{
          name: "lookupType",
          type: "USHORT",
          value: t.lookupType
        }, {
          name: "lookupFlag",
          type: "USHORT",
          value: t.lookupFlag
        }].concat($r("subtable", t.subtables, n)));
      }));
    }
    kr.prototype = Object.create(te.prototype), kr.prototype.constructor = kr;
    var D = {
      Table: te,
      Record: te,
      Coverage: Tr,
      ScriptList: Ur,
      FeatureList: Er,
      LookupList: kr,
      ushortList: or,
      tableList: $r,
      recordList: Fr
    };
    function un(e, r) {
      return e.getUint8(r);
    }
    function Or(e, r) {
      return e.getUint16(r, !1);
    }
    function Rs(e, r) {
      return e.getInt16(r, !1);
    }
    function et(e, r) {
      return e.getUint32(r, !1);
    }
    function ln(e, r) {
      var t = e.getInt16(r, !1),
        n = e.getUint16(r + 2, !1);
      return t + n / 65535;
    }
    function Ds(e, r) {
      for (var t = "", n = r; n < r + 4; n += 1) t += String.fromCharCode(e.getInt8(n));
      return t;
    }
    function Ps(e, r, t) {
      for (var n = 0, a = 0; a < t; a += 1) n <<= 8, n += e.getUint8(r + a);
      return n;
    }
    function Ms(e, r, t) {
      for (var n = [], a = r; a < t; a += 1) n.push(e.getUint8(a));
      return n;
    }
    function Gs(e) {
      for (var r = "", t = 0; t < e.length; t += 1) r += String.fromCharCode(e[t]);
      return r;
    }
    var Ns = {
      byte: 1,
      uShort: 2,
      short: 2,
      uLong: 4,
      fixed: 4,
      longDateTime: 8,
      tag: 4
    };
    function S(e, r) {
      this.data = e, this.offset = r, this.relativeOffset = 0;
    }
    S.prototype.parseByte = function () {
      var e = this.data.getUint8(this.offset + this.relativeOffset);
      return this.relativeOffset += 1, e;
    }, S.prototype.parseChar = function () {
      var e = this.data.getInt8(this.offset + this.relativeOffset);
      return this.relativeOffset += 1, e;
    }, S.prototype.parseCard8 = S.prototype.parseByte, S.prototype.parseUShort = function () {
      var e = this.data.getUint16(this.offset + this.relativeOffset);
      return this.relativeOffset += 2, e;
    }, S.prototype.parseCard16 = S.prototype.parseUShort, S.prototype.parseSID = S.prototype.parseUShort, S.prototype.parseOffset16 = S.prototype.parseUShort, S.prototype.parseShort = function () {
      var e = this.data.getInt16(this.offset + this.relativeOffset);
      return this.relativeOffset += 2, e;
    }, S.prototype.parseF2Dot14 = function () {
      var e = this.data.getInt16(this.offset + this.relativeOffset) / 16384;
      return this.relativeOffset += 2, e;
    }, S.prototype.parseULong = function () {
      var e = et(this.data, this.offset + this.relativeOffset);
      return this.relativeOffset += 4, e;
    }, S.prototype.parseOffset32 = S.prototype.parseULong, S.prototype.parseFixed = function () {
      var e = ln(this.data, this.offset + this.relativeOffset);
      return this.relativeOffset += 4, e;
    }, S.prototype.parseString = function (e) {
      var r = this.data,
        t = this.offset + this.relativeOffset,
        n = "";
      this.relativeOffset += e;
      for (var a = 0; a < e; a++) n += String.fromCharCode(r.getUint8(t + a));
      return n;
    }, S.prototype.parseTag = function () {
      return this.parseString(4);
    }, S.prototype.parseLongDateTime = function () {
      var e = et(this.data, this.offset + this.relativeOffset + 4);
      return e -= 2082844800, this.relativeOffset += 8, e;
    }, S.prototype.parseVersion = function (e) {
      var r = Or(this.data, this.offset + this.relativeOffset),
        t = Or(this.data, this.offset + this.relativeOffset + 2);
      return this.relativeOffset += 4, e === void 0 && (e = 4096), r + t / e / 10;
    }, S.prototype.skip = function (e, r) {
      r === void 0 && (r = 1), this.relativeOffset += Ns[e] * r;
    }, S.prototype.parseULongList = function (e) {
      e === void 0 && (e = this.parseULong());
      for (var r = new Array(e), t = this.data, n = this.offset + this.relativeOffset, a = 0; a < e; a++) r[a] = t.getUint32(n), n += 4;
      return this.relativeOffset += e * 4, r;
    }, S.prototype.parseOffset16List = S.prototype.parseUShortList = function (e) {
      e === void 0 && (e = this.parseUShort());
      for (var r = new Array(e), t = this.data, n = this.offset + this.relativeOffset, a = 0; a < e; a++) r[a] = t.getUint16(n), n += 2;
      return this.relativeOffset += e * 2, r;
    }, S.prototype.parseShortList = function (e) {
      for (var r = new Array(e), t = this.data, n = this.offset + this.relativeOffset, a = 0; a < e; a++) r[a] = t.getInt16(n), n += 2;
      return this.relativeOffset += e * 2, r;
    }, S.prototype.parseByteList = function (e) {
      for (var r = new Array(e), t = this.data, n = this.offset + this.relativeOffset, a = 0; a < e; a++) r[a] = t.getUint8(n++);
      return this.relativeOffset += e, r;
    }, S.prototype.parseList = function (e, r) {
      var t = this;
      r || (r = e, e = this.parseUShort());
      for (var n = new Array(e), a = 0; a < e; a++) n[a] = r.call(t);
      return n;
    }, S.prototype.parseList32 = function (e, r) {
      var t = this;
      r || (r = e, e = this.parseULong());
      for (var n = new Array(e), a = 0; a < e; a++) n[a] = r.call(t);
      return n;
    }, S.prototype.parseRecordList = function (e, r) {
      var t = this;
      r || (r = e, e = this.parseUShort());
      for (var n = new Array(e), a = Object.keys(r), i = 0; i < e; i++) {
        for (var u = {}, f = 0; f < a.length; f++) {
          var l = a[f],
            d = r[l];
          u[l] = d.call(t);
        }
        n[i] = u;
      }
      return n;
    }, S.prototype.parseRecordList32 = function (e, r) {
      var t = this;
      r || (r = e, e = this.parseULong());
      for (var n = new Array(e), a = Object.keys(r), i = 0; i < e; i++) {
        for (var u = {}, f = 0; f < a.length; f++) {
          var l = a[f],
            d = r[l];
          u[l] = d.call(t);
        }
        n[i] = u;
      }
      return n;
    }, S.prototype.parseStruct = function (e) {
      var r = this;
      if (typeof e == "function") return e.call(this);
      for (var t = Object.keys(e), n = {}, a = 0; a < t.length; a++) {
        var i = t[a],
          u = e[i];
        n[i] = u.call(r);
      }
      return n;
    }, S.prototype.parseValueRecord = function (e) {
      if (e === void 0 && (e = this.parseUShort()), e !== 0) {
        var r = {};
        return e & 1 && (r.xPlacement = this.parseShort()), e & 2 && (r.yPlacement = this.parseShort()), e & 4 && (r.xAdvance = this.parseShort()), e & 8 && (r.yAdvance = this.parseShort()), e & 16 && (r.xPlaDevice = void 0, this.parseShort()), e & 32 && (r.yPlaDevice = void 0, this.parseShort()), e & 64 && (r.xAdvDevice = void 0, this.parseShort()), e & 128 && (r.yAdvDevice = void 0, this.parseShort()), r;
      }
    }, S.prototype.parseValueRecordList = function () {
      for (var e = this, r = this.parseUShort(), t = this.parseUShort(), n = new Array(t), a = 0; a < t; a++) n[a] = e.parseValueRecord(r);
      return n;
    }, S.prototype.parsePointer = function (e) {
      var r = this.parseOffset16();
      if (r > 0) return new S(this.data, this.offset + r).parseStruct(e);
    }, S.prototype.parsePointer32 = function (e) {
      var r = this.parseOffset32();
      if (r > 0) return new S(this.data, this.offset + r).parseStruct(e);
    }, S.prototype.parseListOfLists = function (e) {
      for (var r = this, t = this.parseOffset16List(), n = t.length, a = this.relativeOffset, i = new Array(n), u = 0; u < n; u++) {
        var f = t[u];
        if (f === 0) {
          i[u] = void 0;
          continue;
        }
        if (r.relativeOffset = f, e) {
          for (var l = r.parseOffset16List(), d = new Array(l.length), v = 0; v < l.length; v++) r.relativeOffset = f + l[v], d[v] = e.call(r);
          i[u] = d;
        } else i[u] = r.parseUShortList();
      }
      return this.relativeOffset = a, i;
    }, S.prototype.parseCoverage = function () {
      var e = this,
        r = this.offset + this.relativeOffset,
        t = this.parseUShort(),
        n = this.parseUShort();
      if (t === 1) return {
        format: 1,
        glyphs: this.parseUShortList(n)
      };
      if (t === 2) {
        for (var a = new Array(n), i = 0; i < n; i++) a[i] = {
          start: e.parseUShort(),
          end: e.parseUShort(),
          index: e.parseUShort()
        };
        return {
          format: 2,
          ranges: a
        };
      }
      throw new Error("0x" + r.toString(16) + ": Coverage format must be 1 or 2.");
    }, S.prototype.parseClassDef = function () {
      var e = this.offset + this.relativeOffset,
        r = this.parseUShort();
      if (r === 1) return {
        format: 1,
        startGlyph: this.parseUShort(),
        classes: this.parseUShortList()
      };
      if (r === 2) return {
        format: 2,
        ranges: this.parseRecordList({
          start: S.uShort,
          end: S.uShort,
          classId: S.uShort
        })
      };
      throw new Error("0x" + e.toString(16) + ": ClassDef format must be 1 or 2.");
    }, S.list = function (e, r) {
      return function () {
        return this.parseList(e, r);
      };
    }, S.list32 = function (e, r) {
      return function () {
        return this.parseList32(e, r);
      };
    }, S.recordList = function (e, r) {
      return function () {
        return this.parseRecordList(e, r);
      };
    }, S.recordList32 = function (e, r) {
      return function () {
        return this.parseRecordList32(e, r);
      };
    }, S.pointer = function (e) {
      return function () {
        return this.parsePointer(e);
      };
    }, S.pointer32 = function (e) {
      return function () {
        return this.parsePointer32(e);
      };
    }, S.tag = S.prototype.parseTag, S.byte = S.prototype.parseByte, S.uShort = S.offset16 = S.prototype.parseUShort, S.uShortList = S.prototype.parseUShortList, S.uLong = S.offset32 = S.prototype.parseULong, S.uLongList = S.prototype.parseULongList, S.struct = S.prototype.parseStruct, S.coverage = S.prototype.parseCoverage, S.classDef = S.prototype.parseClassDef;
    var fn = {
      reserved: S.uShort,
      reqFeatureIndex: S.uShort,
      featureIndexes: S.uShortList
    };
    S.prototype.parseScriptList = function () {
      return this.parsePointer(S.recordList({
        tag: S.tag,
        script: S.pointer({
          defaultLangSys: S.pointer(fn),
          langSysRecords: S.recordList({
            tag: S.tag,
            langSys: S.pointer(fn)
          })
        })
      })) || [];
    }, S.prototype.parseFeatureList = function () {
      return this.parsePointer(S.recordList({
        tag: S.tag,
        feature: S.pointer({
          featureParams: S.offset16,
          lookupListIndexes: S.uShortList
        })
      })) || [];
    }, S.prototype.parseLookupList = function (e) {
      return this.parsePointer(S.list(S.pointer(function () {
        var r = this.parseUShort();
        N.argument(1 <= r && r <= 9, "GPOS/GSUB lookup type " + r + " unknown.");
        var t = this.parseUShort(),
          n = t & 16;
        return {
          lookupType: r,
          lookupFlag: t,
          subtables: this.parseList(S.pointer(e[r])),
          markFilteringSet: n ? this.parseUShort() : void 0
        };
      }))) || [];
    }, S.prototype.parseFeatureVariationsList = function () {
      return this.parsePointer32(function () {
        var e = this.parseUShort(),
          r = this.parseUShort();
        N.argument(e === 1 && r < 1, "GPOS/GSUB feature variations table unknown.");
        var t = this.parseRecordList32({
          conditionSetOffset: S.offset32,
          featureTableSubstitutionOffset: S.offset32
        });
        return t;
      }) || [];
    };
    var A = {
      getByte: un,
      getCard8: un,
      getUShort: Or,
      getCard16: Or,
      getShort: Rs,
      getULong: et,
      getFixed: ln,
      getTag: Ds,
      getOffset: Ps,
      getBytes: Ms,
      bytesToString: Gs,
      Parser: S
    };
    function _s(e, r) {
      r.parseUShort(), e.length = r.parseULong(), e.language = r.parseULong();
      var t;
      e.groupCount = t = r.parseULong(), e.glyphIndexMap = {};
      for (var n = 0; n < t; n += 1) for (var a = r.parseULong(), i = r.parseULong(), u = r.parseULong(), f = a; f <= i; f += 1) e.glyphIndexMap[f] = u, u++;
    }
    function Hs(e, r, t, n, a) {
      e.length = r.parseUShort(), e.language = r.parseUShort();
      var i;
      e.segCount = i = r.parseUShort() >> 1, r.skip("uShort", 3), e.glyphIndexMap = {};
      for (var u = new A.Parser(t, n + a + 14), f = new A.Parser(t, n + a + 16 + i * 2), l = new A.Parser(t, n + a + 16 + i * 4), d = new A.Parser(t, n + a + 16 + i * 6), v = n + a + 16 + i * 8, x = 0; x < i - 1; x += 1) for (var g = void 0, y = u.parseUShort(), T = f.parseUShort(), w = l.parseShort(), E = d.parseUShort(), O = T; O <= y; O += 1) E !== 0 ? (v = d.offset + d.relativeOffset - 2, v += E, v += (O - T) * 2, g = A.getUShort(t, v), g !== 0 && (g = g + w & 65535)) : g = O + w & 65535, e.glyphIndexMap[O] = g;
    }
    function zs(e, r) {
      var t = {};
      t.version = A.getUShort(e, r), N.argument(t.version === 0, "cmap table version should be 0."), t.numTables = A.getUShort(e, r + 2);
      for (var n = -1, a = t.numTables - 1; a >= 0; a -= 1) {
        var i = A.getUShort(e, r + 4 + a * 8),
          u = A.getUShort(e, r + 4 + a * 8 + 2);
        if (i === 3 && (u === 0 || u === 1 || u === 10)) {
          n = A.getULong(e, r + 4 + a * 8 + 4);
          break;
        }
      }
      if (n === -1) throw new Error("No valid cmap sub-tables found.");
      var f = new A.Parser(e, r + n);
      if (t.format = f.parseUShort(), t.format === 12) _s(t, f);else if (t.format === 4) Hs(t, f, e, r, n);else throw new Error("Only format 4 and 12 cmap tables are supported (found format " + t.format + ").");
      return t;
    }
    function qs(e, r, t) {
      e.segments.push({
        end: r,
        start: r,
        delta: -(r - t),
        offset: 0,
        glyphIndex: t
      });
    }
    function Ws(e) {
      e.segments.push({
        end: 65535,
        start: 65535,
        delta: 1,
        offset: 0
      });
    }
    function Vs(e) {
      var r = !0,
        t;
      for (t = e.length - 1; t > 0; t -= 1) {
        var n = e.get(t);
        if (n.unicode > 65535) {
          console.log("Adding CMAP format 12 (needed!)"), r = !1;
          break;
        }
      }
      var a = [{
        name: "version",
        type: "USHORT",
        value: 0
      }, {
        name: "numTables",
        type: "USHORT",
        value: r ? 1 : 2
      }, {
        name: "platformID",
        type: "USHORT",
        value: 3
      }, {
        name: "encodingID",
        type: "USHORT",
        value: 1
      }, {
        name: "offset",
        type: "ULONG",
        value: r ? 12 : 20
      }];
      r || (a = a.concat([{
        name: "cmap12PlatformID",
        type: "USHORT",
        value: 3
      }, {
        name: "cmap12EncodingID",
        type: "USHORT",
        value: 10
      }, {
        name: "cmap12Offset",
        type: "ULONG",
        value: 0
      }])), a = a.concat([{
        name: "format",
        type: "USHORT",
        value: 4
      }, {
        name: "cmap4Length",
        type: "USHORT",
        value: 0
      }, {
        name: "language",
        type: "USHORT",
        value: 0
      }, {
        name: "segCountX2",
        type: "USHORT",
        value: 0
      }, {
        name: "searchRange",
        type: "USHORT",
        value: 0
      }, {
        name: "entrySelector",
        type: "USHORT",
        value: 0
      }, {
        name: "rangeShift",
        type: "USHORT",
        value: 0
      }]);
      var i = new D.Table("cmap", a);
      for (i.segments = [], t = 0; t < e.length; t += 1) {
        for (var u = e.get(t), f = 0; f < u.unicodes.length; f += 1) qs(i, u.unicodes[f], t);
        i.segments = i.segments.sort(function (G, C) {
          return G.start - C.start;
        });
      }
      Ws(i);
      var l = i.segments.length,
        d = 0,
        v = [],
        x = [],
        g = [],
        y = [],
        T = [],
        w = [];
      for (t = 0; t < l; t += 1) {
        var E = i.segments[t];
        E.end <= 65535 && E.start <= 65535 ? (v = v.concat({
          name: "end_" + t,
          type: "USHORT",
          value: E.end
        }), x = x.concat({
          name: "start_" + t,
          type: "USHORT",
          value: E.start
        }), g = g.concat({
          name: "idDelta_" + t,
          type: "SHORT",
          value: E.delta
        }), y = y.concat({
          name: "idRangeOffset_" + t,
          type: "USHORT",
          value: E.offset
        }), E.glyphId !== void 0 && (T = T.concat({
          name: "glyph_" + t,
          type: "USHORT",
          value: E.glyphId
        }))) : d += 1, !r && E.glyphIndex !== void 0 && (w = w.concat({
          name: "cmap12Start_" + t,
          type: "ULONG",
          value: E.start
        }), w = w.concat({
          name: "cmap12End_" + t,
          type: "ULONG",
          value: E.end
        }), w = w.concat({
          name: "cmap12Glyph_" + t,
          type: "ULONG",
          value: E.glyphIndex
        }));
      }
      if (i.segCountX2 = (l - d) * 2, i.searchRange = Math.pow(2, Math.floor(Math.log(l - d) / Math.log(2))) * 2, i.entrySelector = Math.log(i.searchRange / 2) / Math.log(2), i.rangeShift = i.segCountX2 - i.searchRange, i.fields = i.fields.concat(v), i.fields.push({
        name: "reservedPad",
        type: "USHORT",
        value: 0
      }), i.fields = i.fields.concat(x), i.fields = i.fields.concat(g), i.fields = i.fields.concat(y), i.fields = i.fields.concat(T), i.cmap4Length = 14 + v.length * 2 + 2 + x.length * 2 + g.length * 2 + y.length * 2 + T.length * 2, !r) {
        var O = 16 + w.length * 4;
        i.cmap12Offset = 12 + 2 * 2 + 4 + i.cmap4Length, i.fields = i.fields.concat([{
          name: "cmap12Format",
          type: "USHORT",
          value: 12
        }, {
          name: "cmap12Reserved",
          type: "USHORT",
          value: 0
        }, {
          name: "cmap12Length",
          type: "ULONG",
          value: O
        }, {
          name: "cmap12Language",
          type: "ULONG",
          value: 0
        }, {
          name: "cmap12nGroups",
          type: "ULONG",
          value: w.length / 3
        }]), i.fields = i.fields.concat(w);
      }
      return i;
    }
    var cn = {
        parse: zs,
        make: Vs
      },
      wr = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "266 ff", "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"],
      Xs = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "", "endash", "dagger", "daggerdbl", "periodcentered", "", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "", "questiondown", "", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "", "ring", "cedilla", "", "hungarumlaut", "ogonek", "caron", "emdash", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "AE", "", "ordfeminine", "", "", "", "", "Lslash", "Oslash", "OE", "ordmasculine", "", "", "", "", "", "ae", "", "", "", "dotlessi", "", "", "lslash", "oslash", "oe", "germandbls"],
      Ys = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "", "", "isuperior", "", "", "lsuperior", "msuperior", "nsuperior", "osuperior", "", "", "rsuperior", "ssuperior", "tsuperior", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdownsmall", "centoldstyle", "Lslashsmall", "", "", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "", "Dotaccentsmall", "", "", "Macronsmall", "", "", "figuredash", "hypheninferior", "", "", "Ogoneksmall", "Ringsmall", "Cedillasmall", "", "", "", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"],
      _e = [".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", "Zcaron", "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", "Thorn", "thorn", "minus", "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", "Ccaron", "ccaron", "dcroat"];
    function hn(e) {
      this.font = e;
    }
    hn.prototype.charToGlyphIndex = function (e) {
      var r = e.charCodeAt(0),
        t = this.font.glyphs;
      if (t) {
        for (var n = 0; n < t.length; n += 1) for (var a = t.get(n), i = 0; i < a.unicodes.length; i += 1) if (a.unicodes[i] === r) return n;
      }
      return null;
    };
    function pn(e) {
      this.cmap = e;
    }
    pn.prototype.charToGlyphIndex = function (e) {
      return this.cmap.glyphIndexMap[e.charCodeAt(0)] || 0;
    };
    function Cr(e, r) {
      this.encoding = e, this.charset = r;
    }
    Cr.prototype.charToGlyphIndex = function (e) {
      var r = e.charCodeAt(0),
        t = this.encoding[r];
      return this.charset.indexOf(t);
    };
    function rt(e) {
      var r = this;
      switch (e.version) {
        case 1:
          this.names = _e.slice();
          break;
        case 2:
          this.names = new Array(e.numberOfGlyphs);
          for (var t = 0; t < e.numberOfGlyphs; t++) e.glyphNameIndex[t] < _e.length ? r.names[t] = _e[e.glyphNameIndex[t]] : r.names[t] = e.names[e.glyphNameIndex[t] - _e.length];
          break;
        case 2.5:
          this.names = new Array(e.numberOfGlyphs);
          for (var n = 0; n < e.numberOfGlyphs; n++) r.names[n] = _e[n + e.glyphNameIndex[n]];
          break;
        case 3:
          this.names = [];
          break;
        default:
          this.names = [];
          break;
      }
    }
    rt.prototype.nameToGlyphIndex = function (e) {
      return this.names.indexOf(e);
    }, rt.prototype.glyphIndexToName = function (e) {
      return this.names[e];
    };
    function js(e) {
      for (var r, t = e.tables.cmap.glyphIndexMap, n = Object.keys(t), a = 0; a < n.length; a += 1) {
        var i = n[a],
          u = t[i];
        r = e.glyphs.get(u), r.addUnicode(parseInt(i));
      }
      for (var f = 0; f < e.glyphs.length; f += 1) r = e.glyphs.get(f), e.cffEncoding ? e.isCIDFont ? r.name = "gid" + f : r.name = e.cffEncoding.charset[f] : e.glyphNames.names && (r.name = e.glyphNames.glyphIndexToName(f));
    }
    function Zs(e, r, t, n, a) {
      e.beginPath(), e.moveTo(r, t), e.lineTo(n, a), e.stroke();
    }
    var He = {
      line: Zs
    };
    function dn(e, r, t, n, a) {
      var i;
      return (r & n) > 0 ? (i = e.parseByte(), (r & a) === 0 && (i = -i), i = t + i) : (r & a) > 0 ? i = t : i = t + e.parseShort(), i;
    }
    function Qs(e, r, t) {
      var n = new A.Parser(r, t);
      e.numberOfContours = n.parseShort(), e._xMin = n.parseShort(), e._yMin = n.parseShort(), e._xMax = n.parseShort(), e._yMax = n.parseShort();
      var a, i;
      if (e.numberOfContours > 0) {
        for (var u = e.endPointIndices = [], f = 0; f < e.numberOfContours; f += 1) u.push(n.parseUShort());
        e.instructionLength = n.parseUShort(), e.instructions = [];
        for (var l = 0; l < e.instructionLength; l += 1) e.instructions.push(n.parseByte());
        var d = u[u.length - 1] + 1;
        a = [];
        for (var v = 0; v < d; v += 1) if (i = n.parseByte(), a.push(i), (i & 8) > 0) for (var x = n.parseByte(), g = 0; g < x; g += 1) a.push(i), v += 1;
        if (N.argument(a.length === d, "Bad flags."), u.length > 0) {
          var y = [],
            T;
          if (d > 0) {
            for (var w = 0; w < d; w += 1) i = a[w], T = {}, T.onCurve = !!(i & 1), T.lastPointOfContour = u.indexOf(w) >= 0, y.push(T);
            for (var E = 0, O = 0; O < d; O += 1) i = a[O], T = y[O], T.x = dn(n, i, E, 2, 16), E = T.x;
            for (var G = 0, C = 0; C < d; C += 1) i = a[C], T = y[C], T.y = dn(n, i, G, 4, 32), G = T.y;
          }
          e.points = y;
        } else e.points = [];
      } else if (e.numberOfContours === 0) e.points = [];else {
        e.isComposite = !0, e.points = [], e.components = [];
        for (var _ = !0; _;) {
          a = n.parseUShort();
          var R = {
            glyphIndex: n.parseUShort(),
            xScale: 1,
            scale01: 0,
            scale10: 0,
            yScale: 1,
            dx: 0,
            dy: 0
          };
          (a & 1) > 0 ? (a & 2) > 0 ? (R.dx = n.parseShort(), R.dy = n.parseShort()) : R.matchedPoints = [n.parseUShort(), n.parseUShort()] : (a & 2) > 0 ? (R.dx = n.parseChar(), R.dy = n.parseChar()) : R.matchedPoints = [n.parseByte(), n.parseByte()], (a & 8) > 0 ? R.xScale = R.yScale = n.parseF2Dot14() : (a & 64) > 0 ? (R.xScale = n.parseF2Dot14(), R.yScale = n.parseF2Dot14()) : (a & 128) > 0 && (R.xScale = n.parseF2Dot14(), R.scale01 = n.parseF2Dot14(), R.scale10 = n.parseF2Dot14(), R.yScale = n.parseF2Dot14()), e.components.push(R), _ = !!(a & 32);
        }
        if (a & 256) {
          e.instructionLength = n.parseUShort(), e.instructions = [];
          for (var M = 0; M < e.instructionLength; M += 1) e.instructions.push(n.parseByte());
        }
      }
    }
    function tt(e, r) {
      for (var t = [], n = 0; n < e.length; n += 1) {
        var a = e[n],
          i = {
            x: r.xScale * a.x + r.scale01 * a.y + r.dx,
            y: r.scale10 * a.x + r.yScale * a.y + r.dy,
            onCurve: a.onCurve,
            lastPointOfContour: a.lastPointOfContour
          };
        t.push(i);
      }
      return t;
    }
    function Js(e) {
      for (var r = [], t = [], n = 0; n < e.length; n += 1) {
        var a = e[n];
        t.push(a), a.lastPointOfContour && (r.push(t), t = []);
      }
      return N.argument(t.length === 0, "There are still points left in the current contour."), r;
    }
    function vn(e) {
      var r = new Q();
      if (!e) return r;
      for (var t = Js(e), n = 0; n < t.length; ++n) {
        var a = t[n],
          i = null,
          u = a[a.length - 1],
          f = a[0];
        if (u.onCurve) r.moveTo(u.x, u.y);else if (f.onCurve) r.moveTo(f.x, f.y);else {
          var l = {
            x: (u.x + f.x) * .5,
            y: (u.y + f.y) * .5
          };
          r.moveTo(l.x, l.y);
        }
        for (var d = 0; d < a.length; ++d) if (i = u, u = f, f = a[(d + 1) % a.length], u.onCurve) r.lineTo(u.x, u.y);else {
          var v = i,
            x = f;
          i.onCurve || (v = {
            x: (u.x + i.x) * .5,
            y: (u.y + i.y) * .5
          }, r.lineTo(v.x, v.y)), f.onCurve || (x = {
            x: (u.x + f.x) * .5,
            y: (u.y + f.y) * .5
          }), r.lineTo(v.x, v.y), r.quadraticCurveTo(u.x, u.y, x.x, x.y);
        }
        r.closePath();
      }
      return r;
    }
    function Ks(e, r) {
      if (r.isComposite) for (var t = 0; t < r.components.length; t += 1) {
        var n = r.components[t],
          a = e.get(n.glyphIndex);
        if (a.getPath(), a.points) {
          var i = void 0;
          if (n.matchedPoints === void 0) i = tt(a.points, n);else {
            if (n.matchedPoints[0] > r.points.length - 1 || n.matchedPoints[1] > a.points.length - 1) throw Error("Matched points out of range in " + r.name);
            var u = r.points[n.matchedPoints[0]],
              f = a.points[n.matchedPoints[1]],
              l = {
                xScale: n.xScale,
                scale01: n.scale01,
                scale10: n.scale10,
                yScale: n.yScale,
                dx: 0,
                dy: 0
              };
            f = tt([f], l)[0], l.dx = u.x - f.x, l.dy = u.y - f.y, i = tt(a.points, l);
          }
          r.points = r.points.concat(i);
        }
      }
      return vn(r.points);
    }
    function $s(e, r, t, n) {
      for (var a = new Je.GlyphSet(n), i = 0; i < t.length - 1; i += 1) {
        var u = t[i],
          f = t[i + 1];
        u !== f ? a.push(i, Je.ttfGlyphLoader(n, i, Qs, e, r + u, Ks)) : a.push(i, Je.glyphLoader(n, i));
      }
      return a;
    }
    var gn = {
      getPath: vn,
      parse: $s
    };
    function ei(e, r) {
      var t = r || new Q();
      return {
        configurable: !0,
        get: function () {
          return typeof t == "function" && (t = t()), t;
        },
        set: function (n) {
          t = n;
        }
      };
    }
    function pe(e) {
      this.bindConstructorValues(e);
    }
    pe.prototype.bindConstructorValues = function (e) {
      this.index = e.index || 0, this.name = e.name || null, this.unicode = e.unicode || void 0, this.unicodes = e.unicodes || e.unicode !== void 0 ? [e.unicode] : [], e.xMin && (this.xMin = e.xMin), e.yMin && (this.yMin = e.yMin), e.xMax && (this.xMax = e.xMax), e.yMax && (this.yMax = e.yMax), e.advanceWidth && (this.advanceWidth = e.advanceWidth), Object.defineProperty(this, "path", ei(this, e.path));
    }, pe.prototype.addUnicode = function (e) {
      this.unicodes.length === 0 && (this.unicode = e), this.unicodes.push(e);
    }, pe.prototype.getBoundingBox = function () {
      return this.path.getBoundingBox();
    }, pe.prototype.getPath = function (e, r, t, n, a) {
      e = e !== void 0 ? e : 0, r = r !== void 0 ? r : 0, t = t !== void 0 ? t : 72;
      var i, u;
      n || (n = {});
      var f = n.xScale,
        l = n.yScale;
      if (n.hinting && a && a.hinting && (u = this.path && a.hinting.exec(this, t)), u) i = gn.getPath(u).commands, e = Math.round(e), r = Math.round(r), f = l = 1;else {
        i = this.path.commands;
        var d = 1 / this.path.unitsPerEm * t;
        f === void 0 && (f = d), l === void 0 && (l = d);
      }
      for (var v = new Q(), x = 0; x < i.length; x += 1) {
        var g = i[x];
        g.type === "M" ? v.moveTo(e + g.x * f, r + -g.y * l) : g.type === "L" ? v.lineTo(e + g.x * f, r + -g.y * l) : g.type === "Q" ? v.quadraticCurveTo(e + g.x1 * f, r + -g.y1 * l, e + g.x * f, r + -g.y * l) : g.type === "C" ? v.curveTo(e + g.x1 * f, r + -g.y1 * l, e + g.x2 * f, r + -g.y2 * l, e + g.x * f, r + -g.y * l) : g.type === "Z" && v.closePath();
      }
      return v;
    }, pe.prototype.getContours = function () {
      var e = this;
      if (this.points === void 0) return [];
      for (var r = [], t = [], n = 0; n < this.points.length; n += 1) {
        var a = e.points[n];
        t.push(a), a.lastPointOfContour && (r.push(t), t = []);
      }
      return N.argument(t.length === 0, "There are still points left in the current contour."), r;
    }, pe.prototype.getMetrics = function () {
      for (var e = this.path.commands, r = [], t = [], n = 0; n < e.length; n += 1) {
        var a = e[n];
        a.type !== "Z" && (r.push(a.x), t.push(a.y)), (a.type === "Q" || a.type === "C") && (r.push(a.x1), t.push(a.y1)), a.type === "C" && (r.push(a.x2), t.push(a.y2));
      }
      var i = {
        xMin: Math.min.apply(null, r),
        yMin: Math.min.apply(null, t),
        xMax: Math.max.apply(null, r),
        yMax: Math.max.apply(null, t),
        leftSideBearing: this.leftSideBearing
      };
      return isFinite(i.xMin) || (i.xMin = 0), isFinite(i.xMax) || (i.xMax = this.advanceWidth), isFinite(i.yMin) || (i.yMin = 0), isFinite(i.yMax) || (i.yMax = 0), i.rightSideBearing = this.advanceWidth - i.leftSideBearing - (i.xMax - i.xMin), i;
    }, pe.prototype.draw = function (e, r, t, n, a) {
      this.getPath(r, t, n, a).draw(e);
    }, pe.prototype.drawPoints = function (e, r, t, n) {
      function a(x, g, y, T) {
        var w = Math.PI * 2;
        e.beginPath();
        for (var E = 0; E < x.length; E += 1) e.moveTo(g + x[E].x * T, y + x[E].y * T), e.arc(g + x[E].x * T, y + x[E].y * T, 2, 0, w, !1);
        e.closePath(), e.fill();
      }
      r = r !== void 0 ? r : 0, t = t !== void 0 ? t : 0, n = n !== void 0 ? n : 24;
      for (var i = 1 / this.path.unitsPerEm * n, u = [], f = [], l = this.path, d = 0; d < l.commands.length; d += 1) {
        var v = l.commands[d];
        v.x !== void 0 && u.push({
          x: v.x,
          y: -v.y
        }), v.x1 !== void 0 && f.push({
          x: v.x1,
          y: -v.y1
        }), v.x2 !== void 0 && f.push({
          x: v.x2,
          y: -v.y2
        });
      }
      e.fillStyle = "blue", a(u, r, t, i), e.fillStyle = "red", a(f, r, t, i);
    }, pe.prototype.drawMetrics = function (e, r, t, n) {
      var a;
      r = r !== void 0 ? r : 0, t = t !== void 0 ? t : 0, n = n !== void 0 ? n : 24, a = 1 / this.path.unitsPerEm * n, e.lineWidth = 1, e.strokeStyle = "black", He.line(e, r, -1e4, r, 1e4), He.line(e, -1e4, t, 1e4, t);
      var i = this.xMin || 0,
        u = this.yMin || 0,
        f = this.xMax || 0,
        l = this.yMax || 0,
        d = this.advanceWidth || 0;
      e.strokeStyle = "blue", He.line(e, r + i * a, -1e4, r + i * a, 1e4), He.line(e, r + f * a, -1e4, r + f * a, 1e4), He.line(e, -1e4, t + -u * a, 1e4, t + -u * a), He.line(e, -1e4, t + -l * a, 1e4, t + -l * a), e.strokeStyle = "green", He.line(e, r + d * a, -1e4, r + d * a, 1e4);
    };
    function Lr(e, r, t) {
      Object.defineProperty(e, r, {
        get: function () {
          return e.path, e[t];
        },
        set: function (n) {
          e[t] = n;
        },
        enumerable: !0,
        configurable: !0
      });
    }
    function nt(e, r) {
      var t = this;
      if (this.font = e, this.glyphs = {}, Array.isArray(r)) for (var n = 0; n < r.length; n++) t.glyphs[n] = r[n];
      this.length = r && r.length || 0;
    }
    nt.prototype.get = function (e) {
      return typeof this.glyphs[e] == "function" && (this.glyphs[e] = this.glyphs[e]()), this.glyphs[e];
    }, nt.prototype.push = function (e, r) {
      this.glyphs[e] = r, this.length++;
    };
    function ri(e, r) {
      return new pe({
        index: r,
        font: e
      });
    }
    function ti(e, r, t, n, a, i) {
      return function () {
        var u = new pe({
          index: r,
          font: e
        });
        return u.path = function () {
          t(u, n, a);
          var f = i(e.glyphs, u);
          return f.unitsPerEm = e.unitsPerEm, f;
        }, Lr(u, "xMin", "_xMin"), Lr(u, "xMax", "_xMax"), Lr(u, "yMin", "_yMin"), Lr(u, "yMax", "_yMax"), u;
      };
    }
    function ni(e, r, t, n) {
      return function () {
        var a = new pe({
          index: r,
          font: e
        });
        return a.path = function () {
          var i = t(e, a, n);
          return i.unitsPerEm = e.unitsPerEm, i;
        }, a;
      };
    }
    var Je = {
      GlyphSet: nt,
      glyphLoader: ri,
      ttfGlyphLoader: ti,
      cffGlyphLoader: ni
    };
    function mn(e, r) {
      if (e === r) return !0;
      if (Array.isArray(e) && Array.isArray(r)) {
        if (e.length !== r.length) return !1;
        for (var t = 0; t < e.length; t += 1) if (!mn(e[t], r[t])) return !1;
        return !0;
      } else return !1;
    }
    function at(e) {
      var r;
      return e.length < 1240 ? r = 107 : e.length < 33900 ? r = 1131 : r = 32768, r;
    }
    function Re(e, r, t) {
      var n = [],
        a = [],
        i = A.getCard16(e, r),
        u,
        f;
      if (i !== 0) {
        var l = A.getByte(e, r + 2);
        u = r + (i + 1) * l + 2;
        for (var d = r + 3, v = 0; v < i + 1; v += 1) n.push(A.getOffset(e, d, l)), d += l;
        f = u + n[i];
      } else f = r + 2;
      for (var x = 0; x < n.length - 1; x += 1) {
        var g = A.getBytes(e, u + n[x], u + n[x + 1]);
        t && (g = t(g)), a.push(g);
      }
      return {
        objects: a,
        startOffset: r,
        endOffset: f
      };
    }
    function ai(e) {
      for (var r = "", t = 15, n = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"];;) {
        var a = e.parseByte(),
          i = a >> 4,
          u = a & 15;
        if (i === t || (r += n[i], u === t)) break;
        r += n[u];
      }
      return parseFloat(r);
    }
    function si(e, r) {
      var t, n, a, i;
      if (r === 28) return t = e.parseByte(), n = e.parseByte(), t << 8 | n;
      if (r === 29) return t = e.parseByte(), n = e.parseByte(), a = e.parseByte(), i = e.parseByte(), t << 24 | n << 16 | a << 8 | i;
      if (r === 30) return ai(e);
      if (r >= 32 && r <= 246) return r - 139;
      if (r >= 247 && r <= 250) return t = e.parseByte(), (r - 247) * 256 + t + 108;
      if (r >= 251 && r <= 254) return t = e.parseByte(), -(r - 251) * 256 - t - 108;
      throw new Error("Invalid b0 " + r);
    }
    function ii(e) {
      for (var r = {}, t = 0; t < e.length; t += 1) {
        var n = e[t][0],
          a = e[t][1],
          i = void 0;
        if (a.length === 1 ? i = a[0] : i = a, r.hasOwnProperty(n) && !isNaN(r[n])) throw new Error("Object " + r + " already has key " + n);
        r[n] = i;
      }
      return r;
    }
    function yn(e, r, t) {
      r = r !== void 0 ? r : 0;
      var n = new A.Parser(e, r),
        a = [],
        i = [];
      for (t = t !== void 0 ? t : e.length; n.relativeOffset < t;) {
        var u = n.parseByte();
        u <= 21 ? (u === 12 && (u = 1200 + n.parseByte()), a.push([u, i]), i = []) : i.push(si(n, u));
      }
      return ii(a);
    }
    function ur(e, r) {
      return r <= 390 ? r = wr[r] : r = e[r - 391], r;
    }
    function xn(e, r, t) {
      for (var n = {}, a, i = 0; i < r.length; i += 1) {
        var u = r[i];
        if (Array.isArray(u.type)) {
          var f = [];
          f.length = u.type.length;
          for (var l = 0; l < u.type.length; l++) a = e[u.op] !== void 0 ? e[u.op][l] : void 0, a === void 0 && (a = u.value !== void 0 && u.value[l] !== void 0 ? u.value[l] : null), u.type[l] === "SID" && (a = ur(t, a)), f[l] = a;
          n[u.name] = f;
        } else a = e[u.op], a === void 0 && (a = u.value !== void 0 ? u.value : null), u.type === "SID" && (a = ur(t, a)), n[u.name] = a;
      }
      return n;
    }
    function oi(e, r) {
      var t = {};
      return t.formatMajor = A.getCard8(e, r), t.formatMinor = A.getCard8(e, r + 1), t.size = A.getCard8(e, r + 2), t.offsetSize = A.getCard8(e, r + 3), t.startOffset = r, t.endOffset = r + 4, t;
    }
    var bn = [{
        name: "version",
        op: 0,
        type: "SID"
      }, {
        name: "notice",
        op: 1,
        type: "SID"
      }, {
        name: "copyright",
        op: 1200,
        type: "SID"
      }, {
        name: "fullName",
        op: 2,
        type: "SID"
      }, {
        name: "familyName",
        op: 3,
        type: "SID"
      }, {
        name: "weight",
        op: 4,
        type: "SID"
      }, {
        name: "isFixedPitch",
        op: 1201,
        type: "number",
        value: 0
      }, {
        name: "italicAngle",
        op: 1202,
        type: "number",
        value: 0
      }, {
        name: "underlinePosition",
        op: 1203,
        type: "number",
        value: -100
      }, {
        name: "underlineThickness",
        op: 1204,
        type: "number",
        value: 50
      }, {
        name: "paintType",
        op: 1205,
        type: "number",
        value: 0
      }, {
        name: "charstringType",
        op: 1206,
        type: "number",
        value: 2
      }, {
        name: "fontMatrix",
        op: 1207,
        type: ["real", "real", "real", "real", "real", "real"],
        value: [.001, 0, 0, .001, 0, 0]
      }, {
        name: "uniqueId",
        op: 13,
        type: "number"
      }, {
        name: "fontBBox",
        op: 5,
        type: ["number", "number", "number", "number"],
        value: [0, 0, 0, 0]
      }, {
        name: "strokeWidth",
        op: 1208,
        type: "number",
        value: 0
      }, {
        name: "xuid",
        op: 14,
        type: [],
        value: null
      }, {
        name: "charset",
        op: 15,
        type: "offset",
        value: 0
      }, {
        name: "encoding",
        op: 16,
        type: "offset",
        value: 0
      }, {
        name: "charStrings",
        op: 17,
        type: "offset",
        value: 0
      }, {
        name: "private",
        op: 18,
        type: ["number", "offset"],
        value: [0, 0]
      }, {
        name: "ros",
        op: 1230,
        type: ["SID", "SID", "number"]
      }, {
        name: "cidFontVersion",
        op: 1231,
        type: "number",
        value: 0
      }, {
        name: "cidFontRevision",
        op: 1232,
        type: "number",
        value: 0
      }, {
        name: "cidFontType",
        op: 1233,
        type: "number",
        value: 0
      }, {
        name: "cidCount",
        op: 1234,
        type: "number",
        value: 8720
      }, {
        name: "uidBase",
        op: 1235,
        type: "number"
      }, {
        name: "fdArray",
        op: 1236,
        type: "offset"
      }, {
        name: "fdSelect",
        op: 1237,
        type: "offset"
      }, {
        name: "fontName",
        op: 1238,
        type: "SID"
      }],
      Sn = [{
        name: "subrs",
        op: 19,
        type: "offset",
        value: 0
      }, {
        name: "defaultWidthX",
        op: 20,
        type: "number",
        value: 0
      }, {
        name: "nominalWidthX",
        op: 21,
        type: "number",
        value: 0
      }];
    function ui(e, r) {
      var t = yn(e, 0, e.byteLength);
      return xn(t, bn, r);
    }
    function Fn(e, r, t, n) {
      var a = yn(e, r, t);
      return xn(a, Sn, n);
    }
    function Tn(e, r, t, n) {
      for (var a = [], i = 0; i < t.length; i += 1) {
        var u = new DataView(new Uint8Array(t[i]).buffer),
          f = ui(u, n);
        f._subrs = [], f._subrsBias = 0;
        var l = f.private[0],
          d = f.private[1];
        if (l !== 0 && d !== 0) {
          var v = Fn(e, d + r, l, n);
          if (f._defaultWidthX = v.defaultWidthX, f._nominalWidthX = v.nominalWidthX, v.subrs !== 0) {
            var x = d + v.subrs,
              g = Re(e, x + r);
            f._subrs = g.objects, f._subrsBias = at(f._subrs);
          }
          f._privateDict = v;
        }
        a.push(f);
      }
      return a;
    }
    function li(e, r, t, n) {
      var a,
        i,
        u = new A.Parser(e, r);
      t -= 1;
      var f = [".notdef"],
        l = u.parseCard8();
      if (l === 0) for (var d = 0; d < t; d += 1) a = u.parseSID(), f.push(ur(n, a));else if (l === 1) for (; f.length <= t;) {
        a = u.parseSID(), i = u.parseCard8();
        for (var v = 0; v <= i; v += 1) f.push(ur(n, a)), a += 1;
      } else if (l === 2) for (; f.length <= t;) {
        a = u.parseSID(), i = u.parseCard16();
        for (var x = 0; x <= i; x += 1) f.push(ur(n, a)), a += 1;
      } else throw new Error("Unknown charset format " + l);
      return f;
    }
    function fi(e, r, t) {
      var n,
        a = {},
        i = new A.Parser(e, r),
        u = i.parseCard8();
      if (u === 0) for (var f = i.parseCard8(), l = 0; l < f; l += 1) n = i.parseCard8(), a[n] = l;else if (u === 1) {
        var d = i.parseCard8();
        n = 1;
        for (var v = 0; v < d; v += 1) for (var x = i.parseCard8(), g = i.parseCard8(), y = x; y <= x + g; y += 1) a[y] = n, n += 1;
      } else throw new Error("Unknown encoding format " + u);
      return new Cr(a, t);
    }
    function ci(e, r, t) {
      var n,
        a,
        i,
        u,
        f = new Q(),
        l = [],
        d = 0,
        v = !1,
        x = !1,
        g = 0,
        y = 0,
        T,
        w,
        E,
        O;
      if (e.isCIDFont) {
        var G = e.tables.cff.topDict._fdSelect[r.index],
          C = e.tables.cff.topDict._fdArray[G];
        T = C._subrs, w = C._subrsBias, E = C._defaultWidthX, O = C._nominalWidthX;
      } else T = e.tables.cff.topDict._subrs, w = e.tables.cff.topDict._subrsBias, E = e.tables.cff.topDict._defaultWidthX, O = e.tables.cff.topDict._nominalWidthX;
      var _ = E;
      function R(Y, $) {
        x && f.closePath(), f.moveTo(Y, $), x = !0;
      }
      function M() {
        var Y;
        Y = l.length % 2 !== 0, Y && !v && (_ = l.shift() + O), d += l.length >> 1, l.length = 0, v = !0;
      }
      function ce(Y) {
        for (var $, le, he, de, ge, K, ee, ne, ae, se, fe, ve, j = 0; j < Y.length;) {
          var ie = Y[j];
          switch (j += 1, ie) {
            case 1:
              M();
              break;
            case 3:
              M();
              break;
            case 4:
              l.length > 1 && !v && (_ = l.shift() + O, v = !0), y += l.pop(), R(g, y);
              break;
            case 5:
              for (; l.length > 0;) g += l.shift(), y += l.shift(), f.lineTo(g, y);
              break;
            case 6:
              for (; l.length > 0 && (g += l.shift(), f.lineTo(g, y), l.length !== 0);) y += l.shift(), f.lineTo(g, y);
              break;
            case 7:
              for (; l.length > 0 && (y += l.shift(), f.lineTo(g, y), l.length !== 0);) g += l.shift(), f.lineTo(g, y);
              break;
            case 8:
              for (; l.length > 0;) n = g + l.shift(), a = y + l.shift(), i = n + l.shift(), u = a + l.shift(), g = i + l.shift(), y = u + l.shift(), f.curveTo(n, a, i, u, g, y);
              break;
            case 10:
              ge = l.pop() + w, K = T[ge], K && ce(K);
              break;
            case 11:
              return;
            case 12:
              switch (ie = Y[j], j += 1, ie) {
                case 35:
                  n = g + l.shift(), a = y + l.shift(), i = n + l.shift(), u = a + l.shift(), ee = i + l.shift(), ne = u + l.shift(), ae = ee + l.shift(), se = ne + l.shift(), fe = ae + l.shift(), ve = se + l.shift(), g = fe + l.shift(), y = ve + l.shift(), l.shift(), f.curveTo(n, a, i, u, ee, ne), f.curveTo(ae, se, fe, ve, g, y);
                  break;
                case 34:
                  n = g + l.shift(), a = y, i = n + l.shift(), u = a + l.shift(), ee = i + l.shift(), ne = u, ae = ee + l.shift(), se = u, fe = ae + l.shift(), ve = y, g = fe + l.shift(), f.curveTo(n, a, i, u, ee, ne), f.curveTo(ae, se, fe, ve, g, y);
                  break;
                case 36:
                  n = g + l.shift(), a = y + l.shift(), i = n + l.shift(), u = a + l.shift(), ee = i + l.shift(), ne = u, ae = ee + l.shift(), se = u, fe = ae + l.shift(), ve = se + l.shift(), g = fe + l.shift(), f.curveTo(n, a, i, u, ee, ne), f.curveTo(ae, se, fe, ve, g, y);
                  break;
                case 37:
                  n = g + l.shift(), a = y + l.shift(), i = n + l.shift(), u = a + l.shift(), ee = i + l.shift(), ne = u + l.shift(), ae = ee + l.shift(), se = ne + l.shift(), fe = ae + l.shift(), ve = se + l.shift(), Math.abs(fe - g) > Math.abs(ve - y) ? g = fe + l.shift() : y = ve + l.shift(), f.curveTo(n, a, i, u, ee, ne), f.curveTo(ae, se, fe, ve, g, y);
                  break;
                default:
                  console.log("Glyph " + r.index + ": unknown operator 1200" + ie), l.length = 0;
              }
              break;
            case 14:
              l.length > 0 && !v && (_ = l.shift() + O, v = !0), x && (f.closePath(), x = !1);
              break;
            case 18:
              M();
              break;
            case 19:
            case 20:
              M(), j += d + 7 >> 3;
              break;
            case 21:
              l.length > 2 && !v && (_ = l.shift() + O, v = !0), y += l.pop(), g += l.pop(), R(g, y);
              break;
            case 22:
              l.length > 1 && !v && (_ = l.shift() + O, v = !0), g += l.pop(), R(g, y);
              break;
            case 23:
              M();
              break;
            case 24:
              for (; l.length > 2;) n = g + l.shift(), a = y + l.shift(), i = n + l.shift(), u = a + l.shift(), g = i + l.shift(), y = u + l.shift(), f.curveTo(n, a, i, u, g, y);
              g += l.shift(), y += l.shift(), f.lineTo(g, y);
              break;
            case 25:
              for (; l.length > 6;) g += l.shift(), y += l.shift(), f.lineTo(g, y);
              n = g + l.shift(), a = y + l.shift(), i = n + l.shift(), u = a + l.shift(), g = i + l.shift(), y = u + l.shift(), f.curveTo(n, a, i, u, g, y);
              break;
            case 26:
              for (l.length % 2 && (g += l.shift()); l.length > 0;) n = g, a = y + l.shift(), i = n + l.shift(), u = a + l.shift(), g = i, y = u + l.shift(), f.curveTo(n, a, i, u, g, y);
              break;
            case 27:
              for (l.length % 2 && (y += l.shift()); l.length > 0;) n = g + l.shift(), a = y, i = n + l.shift(), u = a + l.shift(), g = i + l.shift(), y = u, f.curveTo(n, a, i, u, g, y);
              break;
            case 28:
              $ = Y[j], le = Y[j + 1], l.push(($ << 24 | le << 16) >> 16), j += 2;
              break;
            case 29:
              ge = l.pop() + e.gsubrsBias, K = e.gsubrs[ge], K && ce(K);
              break;
            case 30:
              for (; l.length > 0 && (n = g, a = y + l.shift(), i = n + l.shift(), u = a + l.shift(), g = i + l.shift(), y = u + (l.length === 1 ? l.shift() : 0), f.curveTo(n, a, i, u, g, y), l.length !== 0);) n = g + l.shift(), a = y, i = n + l.shift(), u = a + l.shift(), y = u + l.shift(), g = i + (l.length === 1 ? l.shift() : 0), f.curveTo(n, a, i, u, g, y);
              break;
            case 31:
              for (; l.length > 0 && (n = g + l.shift(), a = y, i = n + l.shift(), u = a + l.shift(), y = u + l.shift(), g = i + (l.length === 1 ? l.shift() : 0), f.curveTo(n, a, i, u, g, y), l.length !== 0);) n = g, a = y + l.shift(), i = n + l.shift(), u = a + l.shift(), g = i + l.shift(), y = u + (l.length === 1 ? l.shift() : 0), f.curveTo(n, a, i, u, g, y);
              break;
            default:
              ie < 32 ? console.log("Glyph " + r.index + ": unknown operator " + ie) : ie < 247 ? l.push(ie - 139) : ie < 251 ? ($ = Y[j], j += 1, l.push((ie - 247) * 256 + $ + 108)) : ie < 255 ? ($ = Y[j], j += 1, l.push(-(ie - 251) * 256 - $ - 108)) : ($ = Y[j], le = Y[j + 1], he = Y[j + 2], de = Y[j + 3], j += 4, l.push(($ << 24 | le << 16 | he << 8 | de) / 65536));
          }
        }
      }
      return ce(t), r.advanceWidth = _, f;
    }
    function hi(e, r, t, n) {
      var a = [],
        i,
        u = new A.Parser(e, r),
        f = u.parseCard8();
      if (f === 0) for (var l = 0; l < t; l++) {
        if (i = u.parseCard8(), i >= n) throw new Error("CFF table CID Font FDSelect has bad FD index value " + i + " (FD count " + n + ")");
        a.push(i);
      } else if (f === 3) {
        var d = u.parseCard16(),
          v = u.parseCard16();
        if (v !== 0) throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID " + v);
        for (var x, g = 0; g < d; g++) {
          if (i = u.parseCard8(), x = u.parseCard16(), i >= n) throw new Error("CFF table CID Font FDSelect has bad FD index value " + i + " (FD count " + n + ")");
          if (x > t) throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID " + x);
          for (; v < x; v++) a.push(i);
          v = x;
        }
        if (x !== t) throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID " + x);
      } else throw new Error("CFF Table CID Font FDSelect table has unsupported format " + f);
      return a;
    }
    function pi(e, r, t) {
      t.tables.cff = {};
      var n = oi(e, r),
        a = Re(e, n.endOffset, A.bytesToString),
        i = Re(e, a.endOffset),
        u = Re(e, i.endOffset, A.bytesToString),
        f = Re(e, u.endOffset);
      t.gsubrs = f.objects, t.gsubrsBias = at(t.gsubrs);
      var l = Tn(e, r, i.objects, u.objects);
      if (l.length !== 1) throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + l.length);
      var d = l[0];
      if (t.tables.cff.topDict = d, d._privateDict && (t.defaultWidthX = d._privateDict.defaultWidthX, t.nominalWidthX = d._privateDict.nominalWidthX), d.ros[0] !== void 0 && d.ros[1] !== void 0 && (t.isCIDFont = !0), t.isCIDFont) {
        var v = d.fdArray,
          x = d.fdSelect;
        if (v === 0 || x === 0) throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
        v += r;
        var g = Re(e, v),
          y = Tn(e, r, g.objects, u.objects);
        d._fdArray = y, x += r, d._fdSelect = hi(e, x, t.numGlyphs, y.length);
      }
      var T = r + d.private[1],
        w = Fn(e, T, d.private[0], u.objects);
      if (t.defaultWidthX = w.defaultWidthX, t.nominalWidthX = w.nominalWidthX, w.subrs !== 0) {
        var E = T + w.subrs,
          O = Re(e, E);
        t.subrs = O.objects, t.subrsBias = at(t.subrs);
      } else t.subrs = [], t.subrsBias = 0;
      var G = Re(e, r + d.charStrings);
      t.nGlyphs = G.objects.length;
      var C = li(e, r + d.charset, t.nGlyphs, u.objects);
      d.encoding === 0 ? t.cffEncoding = new Cr(Xs, C) : d.encoding === 1 ? t.cffEncoding = new Cr(Ys, C) : t.cffEncoding = fi(e, r + d.encoding, C), t.encoding = t.encoding || t.cffEncoding, t.glyphs = new Je.GlyphSet(t);
      for (var _ = 0; _ < t.nGlyphs; _ += 1) {
        var R = G.objects[_];
        t.glyphs.push(_, Je.cffGlyphLoader(t, _, ci, R));
      }
    }
    function Un(e, r) {
      var t,
        n = wr.indexOf(e);
      return n >= 0 && (t = n), n = r.indexOf(e), n >= 0 ? t = n + wr.length : (t = wr.length + r.length, r.push(e)), t;
    }
    function di() {
      return new D.Record("Header", [{
        name: "major",
        type: "Card8",
        value: 1
      }, {
        name: "minor",
        type: "Card8",
        value: 0
      }, {
        name: "hdrSize",
        type: "Card8",
        value: 4
      }, {
        name: "major",
        type: "Card8",
        value: 1
      }]);
    }
    function vi(e) {
      var r = new D.Record("Name INDEX", [{
        name: "names",
        type: "INDEX",
        value: []
      }]);
      r.names = [];
      for (var t = 0; t < e.length; t += 1) r.names.push({
        name: "name_" + t,
        type: "NAME",
        value: e[t]
      });
      return r;
    }
    function En(e, r, t) {
      for (var n = {}, a = 0; a < e.length; a += 1) {
        var i = e[a],
          u = r[i.name];
        u !== void 0 && !mn(u, i.value) && (i.type === "SID" && (u = Un(u, t)), n[i.op] = {
          name: i.name,
          type: i.type,
          value: u
        });
      }
      return n;
    }
    function kn(e, r) {
      var t = new D.Record("Top DICT", [{
        name: "dict",
        type: "DICT",
        value: {}
      }]);
      return t.dict = En(bn, e, r), t;
    }
    function On(e) {
      var r = new D.Record("Top DICT INDEX", [{
        name: "topDicts",
        type: "INDEX",
        value: []
      }]);
      return r.topDicts = [{
        name: "topDict_0",
        type: "TABLE",
        value: e
      }], r;
    }
    function gi(e) {
      var r = new D.Record("String INDEX", [{
        name: "strings",
        type: "INDEX",
        value: []
      }]);
      r.strings = [];
      for (var t = 0; t < e.length; t += 1) r.strings.push({
        name: "string_" + t,
        type: "STRING",
        value: e[t]
      });
      return r;
    }
    function mi() {
      return new D.Record("Global Subr INDEX", [{
        name: "subrs",
        type: "INDEX",
        value: []
      }]);
    }
    function yi(e, r) {
      for (var t = new D.Record("Charsets", [{
          name: "format",
          type: "Card8",
          value: 0
        }]), n = 0; n < e.length; n += 1) {
        var a = e[n],
          i = Un(a, r);
        t.fields.push({
          name: "glyph_" + n,
          type: "SID",
          value: i
        });
      }
      return t;
    }
    function xi(e) {
      var r = [],
        t = e.path;
      r.push({
        name: "width",
        type: "NUMBER",
        value: e.advanceWidth
      });
      for (var n = 0, a = 0, i = 0; i < t.commands.length; i += 1) {
        var u = void 0,
          f = void 0,
          l = t.commands[i];
        if (l.type === "Q") {
          var d = .3333333333333333,
            v = 2 / 3;
          l = {
            type: "C",
            x: l.x,
            y: l.y,
            x1: d * n + v * l.x1,
            y1: d * a + v * l.y1,
            x2: d * l.x + v * l.x1,
            y2: d * l.y + v * l.y1
          };
        }
        if (l.type === "M") u = Math.round(l.x - n), f = Math.round(l.y - a), r.push({
          name: "dx",
          type: "NUMBER",
          value: u
        }), r.push({
          name: "dy",
          type: "NUMBER",
          value: f
        }), r.push({
          name: "rmoveto",
          type: "OP",
          value: 21
        }), n = Math.round(l.x), a = Math.round(l.y);else if (l.type === "L") u = Math.round(l.x - n), f = Math.round(l.y - a), r.push({
          name: "dx",
          type: "NUMBER",
          value: u
        }), r.push({
          name: "dy",
          type: "NUMBER",
          value: f
        }), r.push({
          name: "rlineto",
          type: "OP",
          value: 5
        }), n = Math.round(l.x), a = Math.round(l.y);else if (l.type === "C") {
          var x = Math.round(l.x1 - n),
            g = Math.round(l.y1 - a),
            y = Math.round(l.x2 - l.x1),
            T = Math.round(l.y2 - l.y1);
          u = Math.round(l.x - l.x2), f = Math.round(l.y - l.y2), r.push({
            name: "dx1",
            type: "NUMBER",
            value: x
          }), r.push({
            name: "dy1",
            type: "NUMBER",
            value: g
          }), r.push({
            name: "dx2",
            type: "NUMBER",
            value: y
          }), r.push({
            name: "dy2",
            type: "NUMBER",
            value: T
          }), r.push({
            name: "dx",
            type: "NUMBER",
            value: u
          }), r.push({
            name: "dy",
            type: "NUMBER",
            value: f
          }), r.push({
            name: "rrcurveto",
            type: "OP",
            value: 8
          }), n = Math.round(l.x), a = Math.round(l.y);
        }
      }
      return r.push({
        name: "endchar",
        type: "OP",
        value: 14
      }), r;
    }
    function bi(e) {
      for (var r = new D.Record("CharStrings INDEX", [{
          name: "charStrings",
          type: "INDEX",
          value: []
        }]), t = 0; t < e.length; t += 1) {
        var n = e.get(t),
          a = xi(n);
        r.charStrings.push({
          name: n.name,
          type: "CHARSTRING",
          value: a
        });
      }
      return r;
    }
    function Si(e, r) {
      var t = new D.Record("Private DICT", [{
        name: "dict",
        type: "DICT",
        value: {}
      }]);
      return t.dict = En(Sn, e, r), t;
    }
    function Fi(e, r) {
      for (var t = new D.Table("CFF ", [{
          name: "header",
          type: "RECORD"
        }, {
          name: "nameIndex",
          type: "RECORD"
        }, {
          name: "topDictIndex",
          type: "RECORD"
        }, {
          name: "stringIndex",
          type: "RECORD"
        }, {
          name: "globalSubrIndex",
          type: "RECORD"
        }, {
          name: "charsets",
          type: "RECORD"
        }, {
          name: "charStringsIndex",
          type: "RECORD"
        }, {
          name: "privateDict",
          type: "RECORD"
        }]), n = 1 / r.unitsPerEm, a = {
          version: r.version,
          fullName: r.fullName,
          familyName: r.familyName,
          weight: r.weightName,
          fontBBox: r.fontBBox || [0, 0, 0, 0],
          fontMatrix: [n, 0, 0, n, 0, 0],
          charset: 999,
          encoding: 0,
          charStrings: 999,
          private: [0, 999]
        }, i = {}, u = [], f, l = 1; l < e.length; l += 1) f = e.get(l), u.push(f.name);
      var d = [];
      t.header = di(), t.nameIndex = vi([r.postScriptName]);
      var v = kn(a, d);
      t.topDictIndex = On(v), t.globalSubrIndex = mi(), t.charsets = yi(u, d), t.charStringsIndex = bi(e), t.privateDict = Si(i, d), t.stringIndex = gi(d);
      var x = t.header.sizeOf() + t.nameIndex.sizeOf() + t.topDictIndex.sizeOf() + t.stringIndex.sizeOf() + t.globalSubrIndex.sizeOf();
      return a.charset = x, a.encoding = 0, a.charStrings = a.charset + t.charsets.sizeOf(), a.private[1] = a.charStrings + t.charStringsIndex.sizeOf(), v = kn(a, d), t.topDictIndex = On(v), t;
    }
    var wn = {
      parse: pi,
      make: Fi
    };
    function Ti(e, r) {
      var t = {},
        n = new A.Parser(e, r);
      return t.version = n.parseVersion(), t.fontRevision = Math.round(n.parseFixed() * 1e3) / 1e3, t.checkSumAdjustment = n.parseULong(), t.magicNumber = n.parseULong(), N.argument(t.magicNumber === 1594834165, "Font header has wrong magic number."), t.flags = n.parseUShort(), t.unitsPerEm = n.parseUShort(), t.created = n.parseLongDateTime(), t.modified = n.parseLongDateTime(), t.xMin = n.parseShort(), t.yMin = n.parseShort(), t.xMax = n.parseShort(), t.yMax = n.parseShort(), t.macStyle = n.parseUShort(), t.lowestRecPPEM = n.parseUShort(), t.fontDirectionHint = n.parseShort(), t.indexToLocFormat = n.parseShort(), t.glyphDataFormat = n.parseShort(), t;
    }
    function Ui(e) {
      var r = Math.round(new Date().getTime() / 1e3) + 2082844800,
        t = r;
      return e.createdTimestamp && (t = e.createdTimestamp + 2082844800), new D.Table("head", [{
        name: "version",
        type: "FIXED",
        value: 65536
      }, {
        name: "fontRevision",
        type: "FIXED",
        value: 65536
      }, {
        name: "checkSumAdjustment",
        type: "ULONG",
        value: 0
      }, {
        name: "magicNumber",
        type: "ULONG",
        value: 1594834165
      }, {
        name: "flags",
        type: "USHORT",
        value: 0
      }, {
        name: "unitsPerEm",
        type: "USHORT",
        value: 1e3
      }, {
        name: "created",
        type: "LONGDATETIME",
        value: t
      }, {
        name: "modified",
        type: "LONGDATETIME",
        value: r
      }, {
        name: "xMin",
        type: "SHORT",
        value: 0
      }, {
        name: "yMin",
        type: "SHORT",
        value: 0
      }, {
        name: "xMax",
        type: "SHORT",
        value: 0
      }, {
        name: "yMax",
        type: "SHORT",
        value: 0
      }, {
        name: "macStyle",
        type: "USHORT",
        value: 0
      }, {
        name: "lowestRecPPEM",
        type: "USHORT",
        value: 0
      }, {
        name: "fontDirectionHint",
        type: "SHORT",
        value: 2
      }, {
        name: "indexToLocFormat",
        type: "SHORT",
        value: 0
      }, {
        name: "glyphDataFormat",
        type: "SHORT",
        value: 0
      }], e);
    }
    var Cn = {
      parse: Ti,
      make: Ui
    };
    function Ei(e, r) {
      var t = {},
        n = new A.Parser(e, r);
      return t.version = n.parseVersion(), t.ascender = n.parseShort(), t.descender = n.parseShort(), t.lineGap = n.parseShort(), t.advanceWidthMax = n.parseUShort(), t.minLeftSideBearing = n.parseShort(), t.minRightSideBearing = n.parseShort(), t.xMaxExtent = n.parseShort(), t.caretSlopeRise = n.parseShort(), t.caretSlopeRun = n.parseShort(), t.caretOffset = n.parseShort(), n.relativeOffset += 8, t.metricDataFormat = n.parseShort(), t.numberOfHMetrics = n.parseUShort(), t;
    }
    function ki(e) {
      return new D.Table("hhea", [{
        name: "version",
        type: "FIXED",
        value: 65536
      }, {
        name: "ascender",
        type: "FWORD",
        value: 0
      }, {
        name: "descender",
        type: "FWORD",
        value: 0
      }, {
        name: "lineGap",
        type: "FWORD",
        value: 0
      }, {
        name: "advanceWidthMax",
        type: "UFWORD",
        value: 0
      }, {
        name: "minLeftSideBearing",
        type: "FWORD",
        value: 0
      }, {
        name: "minRightSideBearing",
        type: "FWORD",
        value: 0
      }, {
        name: "xMaxExtent",
        type: "FWORD",
        value: 0
      }, {
        name: "caretSlopeRise",
        type: "SHORT",
        value: 1
      }, {
        name: "caretSlopeRun",
        type: "SHORT",
        value: 0
      }, {
        name: "caretOffset",
        type: "SHORT",
        value: 0
      }, {
        name: "reserved1",
        type: "SHORT",
        value: 0
      }, {
        name: "reserved2",
        type: "SHORT",
        value: 0
      }, {
        name: "reserved3",
        type: "SHORT",
        value: 0
      }, {
        name: "reserved4",
        type: "SHORT",
        value: 0
      }, {
        name: "metricDataFormat",
        type: "SHORT",
        value: 0
      }, {
        name: "numberOfHMetrics",
        type: "USHORT",
        value: 0
      }], e);
    }
    var Ln = {
      parse: Ei,
      make: ki
    };
    function Oi(e, r, t, n, a) {
      for (var i, u, f = new A.Parser(e, r), l = 0; l < n; l += 1) {
        l < t && (i = f.parseUShort(), u = f.parseShort());
        var d = a.get(l);
        d.advanceWidth = i, d.leftSideBearing = u;
      }
    }
    function wi(e) {
      for (var r = new D.Table("hmtx", []), t = 0; t < e.length; t += 1) {
        var n = e.get(t),
          a = n.advanceWidth || 0,
          i = n.leftSideBearing || 0;
        r.fields.push({
          name: "advanceWidth_" + t,
          type: "USHORT",
          value: a
        }), r.fields.push({
          name: "leftSideBearing_" + t,
          type: "SHORT",
          value: i
        });
      }
      return r;
    }
    var In = {
      parse: Oi,
      make: wi
    };
    function Ci(e) {
      for (var r = new D.Table("ltag", [{
          name: "version",
          type: "ULONG",
          value: 1
        }, {
          name: "flags",
          type: "ULONG",
          value: 0
        }, {
          name: "numTags",
          type: "ULONG",
          value: e.length
        }]), t = "", n = 12 + e.length * 4, a = 0; a < e.length; ++a) {
        var i = t.indexOf(e[a]);
        i < 0 && (i = t.length, t += e[a]), r.fields.push({
          name: "offset " + a,
          type: "USHORT",
          value: n + i
        }), r.fields.push({
          name: "length " + a,
          type: "USHORT",
          value: e[a].length
        });
      }
      return r.fields.push({
        name: "stringPool",
        type: "CHARARRAY",
        value: t
      }), r;
    }
    function Li(e, r) {
      var t = new A.Parser(e, r),
        n = t.parseULong();
      N.argument(n === 1, "Unsupported ltag table version."), t.skip("uLong", 1);
      for (var a = t.parseULong(), i = [], u = 0; u < a; u++) {
        for (var f = "", l = r + t.parseUShort(), d = t.parseUShort(), v = l; v < l + d; ++v) f += String.fromCharCode(e.getInt8(v));
        i.push(f);
      }
      return i;
    }
    var An = {
      make: Ci,
      parse: Li
    };
    function Ii(e, r) {
      var t = {},
        n = new A.Parser(e, r);
      return t.version = n.parseVersion(), t.numGlyphs = n.parseUShort(), t.version === 1 && (t.maxPoints = n.parseUShort(), t.maxContours = n.parseUShort(), t.maxCompositePoints = n.parseUShort(), t.maxCompositeContours = n.parseUShort(), t.maxZones = n.parseUShort(), t.maxTwilightPoints = n.parseUShort(), t.maxStorage = n.parseUShort(), t.maxFunctionDefs = n.parseUShort(), t.maxInstructionDefs = n.parseUShort(), t.maxStackElements = n.parseUShort(), t.maxSizeOfInstructions = n.parseUShort(), t.maxComponentElements = n.parseUShort(), t.maxComponentDepth = n.parseUShort()), t;
    }
    function Ai(e) {
      return new D.Table("maxp", [{
        name: "version",
        type: "FIXED",
        value: 20480
      }, {
        name: "numGlyphs",
        type: "USHORT",
        value: e
      }]);
    }
    var Bn = {
        parse: Ii,
        make: Ai
      },
      Rn = ["copyright", "fontFamily", "fontSubfamily", "uniqueID", "fullName", "version", "postScriptName", "trademark", "manufacturer", "designer", "description", "manufacturerURL", "designerURL", "license", "licenseURL", "reserved", "preferredFamily", "preferredSubfamily", "compatibleFullName", "sampleText", "postScriptFindFontName", "wwsFamily", "wwsSubfamily"],
      Dn = {
        0: "en",
        1: "fr",
        2: "de",
        3: "it",
        4: "nl",
        5: "sv",
        6: "es",
        7: "da",
        8: "pt",
        9: "no",
        10: "he",
        11: "ja",
        12: "ar",
        13: "fi",
        14: "el",
        15: "is",
        16: "mt",
        17: "tr",
        18: "hr",
        19: "zh-Hant",
        20: "ur",
        21: "hi",
        22: "th",
        23: "ko",
        24: "lt",
        25: "pl",
        26: "hu",
        27: "es",
        28: "lv",
        29: "se",
        30: "fo",
        31: "fa",
        32: "ru",
        33: "zh",
        34: "nl-BE",
        35: "ga",
        36: "sq",
        37: "ro",
        38: "cz",
        39: "sk",
        40: "si",
        41: "yi",
        42: "sr",
        43: "mk",
        44: "bg",
        45: "uk",
        46: "be",
        47: "uz",
        48: "kk",
        49: "az-Cyrl",
        50: "az-Arab",
        51: "hy",
        52: "ka",
        53: "mo",
        54: "ky",
        55: "tg",
        56: "tk",
        57: "mn-CN",
        58: "mn",
        59: "ps",
        60: "ks",
        61: "ku",
        62: "sd",
        63: "bo",
        64: "ne",
        65: "sa",
        66: "mr",
        67: "bn",
        68: "as",
        69: "gu",
        70: "pa",
        71: "or",
        72: "ml",
        73: "kn",
        74: "ta",
        75: "te",
        76: "si",
        77: "my",
        78: "km",
        79: "lo",
        80: "vi",
        81: "id",
        82: "tl",
        83: "ms",
        84: "ms-Arab",
        85: "am",
        86: "ti",
        87: "om",
        88: "so",
        89: "sw",
        90: "rw",
        91: "rn",
        92: "ny",
        93: "mg",
        94: "eo",
        128: "cy",
        129: "eu",
        130: "ca",
        131: "la",
        132: "qu",
        133: "gn",
        134: "ay",
        135: "tt",
        136: "ug",
        137: "dz",
        138: "jv",
        139: "su",
        140: "gl",
        141: "af",
        142: "br",
        143: "iu",
        144: "gd",
        145: "gv",
        146: "ga",
        147: "to",
        148: "el-polyton",
        149: "kl",
        150: "az",
        151: "nn"
      },
      Bi = {
        0: 0,
        1: 0,
        2: 0,
        3: 0,
        4: 0,
        5: 0,
        6: 0,
        7: 0,
        8: 0,
        9: 0,
        10: 5,
        11: 1,
        12: 4,
        13: 0,
        14: 6,
        15: 0,
        16: 0,
        17: 0,
        18: 0,
        19: 2,
        20: 4,
        21: 9,
        22: 21,
        23: 3,
        24: 29,
        25: 29,
        26: 29,
        27: 29,
        28: 29,
        29: 0,
        30: 0,
        31: 4,
        32: 7,
        33: 25,
        34: 0,
        35: 0,
        36: 0,
        37: 0,
        38: 29,
        39: 29,
        40: 0,
        41: 5,
        42: 7,
        43: 7,
        44: 7,
        45: 7,
        46: 7,
        47: 7,
        48: 7,
        49: 7,
        50: 4,
        51: 24,
        52: 23,
        53: 7,
        54: 7,
        55: 7,
        56: 7,
        57: 27,
        58: 7,
        59: 4,
        60: 4,
        61: 4,
        62: 4,
        63: 26,
        64: 9,
        65: 9,
        66: 9,
        67: 13,
        68: 13,
        69: 11,
        70: 10,
        71: 12,
        72: 17,
        73: 16,
        74: 14,
        75: 15,
        76: 18,
        77: 19,
        78: 20,
        79: 22,
        80: 30,
        81: 0,
        82: 0,
        83: 0,
        84: 4,
        85: 28,
        86: 28,
        87: 28,
        88: 0,
        89: 0,
        90: 0,
        91: 0,
        92: 0,
        93: 0,
        94: 0,
        128: 0,
        129: 0,
        130: 0,
        131: 0,
        132: 0,
        133: 0,
        134: 0,
        135: 7,
        136: 4,
        137: 26,
        138: 0,
        139: 0,
        140: 0,
        141: 0,
        142: 0,
        143: 28,
        144: 0,
        145: 0,
        146: 0,
        147: 0,
        148: 6,
        149: 0,
        150: 0,
        151: 0
      },
      Pn = {
        1078: "af",
        1052: "sq",
        1156: "gsw",
        1118: "am",
        5121: "ar-DZ",
        15361: "ar-BH",
        3073: "ar",
        2049: "ar-IQ",
        11265: "ar-JO",
        13313: "ar-KW",
        12289: "ar-LB",
        4097: "ar-LY",
        6145: "ary",
        8193: "ar-OM",
        16385: "ar-QA",
        1025: "ar-SA",
        10241: "ar-SY",
        7169: "aeb",
        14337: "ar-AE",
        9217: "ar-YE",
        1067: "hy",
        1101: "as",
        2092: "az-Cyrl",
        1068: "az",
        1133: "ba",
        1069: "eu",
        1059: "be",
        2117: "bn",
        1093: "bn-IN",
        8218: "bs-Cyrl",
        5146: "bs",
        1150: "br",
        1026: "bg",
        1027: "ca",
        3076: "zh-HK",
        5124: "zh-MO",
        2052: "zh",
        4100: "zh-SG",
        1028: "zh-TW",
        1155: "co",
        1050: "hr",
        4122: "hr-BA",
        1029: "cs",
        1030: "da",
        1164: "prs",
        1125: "dv",
        2067: "nl-BE",
        1043: "nl",
        3081: "en-AU",
        10249: "en-BZ",
        4105: "en-CA",
        9225: "en-029",
        16393: "en-IN",
        6153: "en-IE",
        8201: "en-JM",
        17417: "en-MY",
        5129: "en-NZ",
        13321: "en-PH",
        18441: "en-SG",
        7177: "en-ZA",
        11273: "en-TT",
        2057: "en-GB",
        1033: "en",
        12297: "en-ZW",
        1061: "et",
        1080: "fo",
        1124: "fil",
        1035: "fi",
        2060: "fr-BE",
        3084: "fr-CA",
        1036: "fr",
        5132: "fr-LU",
        6156: "fr-MC",
        4108: "fr-CH",
        1122: "fy",
        1110: "gl",
        1079: "ka",
        3079: "de-AT",
        1031: "de",
        5127: "de-LI",
        4103: "de-LU",
        2055: "de-CH",
        1032: "el",
        1135: "kl",
        1095: "gu",
        1128: "ha",
        1037: "he",
        1081: "hi",
        1038: "hu",
        1039: "is",
        1136: "ig",
        1057: "id",
        1117: "iu",
        2141: "iu-Latn",
        2108: "ga",
        1076: "xh",
        1077: "zu",
        1040: "it",
        2064: "it-CH",
        1041: "ja",
        1099: "kn",
        1087: "kk",
        1107: "km",
        1158: "quc",
        1159: "rw",
        1089: "sw",
        1111: "kok",
        1042: "ko",
        1088: "ky",
        1108: "lo",
        1062: "lv",
        1063: "lt",
        2094: "dsb",
        1134: "lb",
        1071: "mk",
        2110: "ms-BN",
        1086: "ms",
        1100: "ml",
        1082: "mt",
        1153: "mi",
        1146: "arn",
        1102: "mr",
        1148: "moh",
        1104: "mn",
        2128: "mn-CN",
        1121: "ne",
        1044: "nb",
        2068: "nn",
        1154: "oc",
        1096: "or",
        1123: "ps",
        1045: "pl",
        1046: "pt",
        2070: "pt-PT",
        1094: "pa",
        1131: "qu-BO",
        2155: "qu-EC",
        3179: "qu",
        1048: "ro",
        1047: "rm",
        1049: "ru",
        9275: "smn",
        4155: "smj-NO",
        5179: "smj",
        3131: "se-FI",
        1083: "se",
        2107: "se-SE",
        8251: "sms",
        6203: "sma-NO",
        7227: "sms",
        1103: "sa",
        7194: "sr-Cyrl-BA",
        3098: "sr",
        6170: "sr-Latn-BA",
        2074: "sr-Latn",
        1132: "nso",
        1074: "tn",
        1115: "si",
        1051: "sk",
        1060: "sl",
        11274: "es-AR",
        16394: "es-BO",
        13322: "es-CL",
        9226: "es-CO",
        5130: "es-CR",
        7178: "es-DO",
        12298: "es-EC",
        17418: "es-SV",
        4106: "es-GT",
        18442: "es-HN",
        2058: "es-MX",
        19466: "es-NI",
        6154: "es-PA",
        15370: "es-PY",
        10250: "es-PE",
        20490: "es-PR",
        3082: "es",
        1034: "es",
        21514: "es-US",
        14346: "es-UY",
        8202: "es-VE",
        2077: "sv-FI",
        1053: "sv",
        1114: "syr",
        1064: "tg",
        2143: "tzm",
        1097: "ta",
        1092: "tt",
        1098: "te",
        1054: "th",
        1105: "bo",
        1055: "tr",
        1090: "tk",
        1152: "ug",
        1058: "uk",
        1070: "hsb",
        1056: "ur",
        2115: "uz-Cyrl",
        1091: "uz",
        1066: "vi",
        1106: "cy",
        1160: "wo",
        1157: "sah",
        1144: "ii",
        1130: "yo"
      };
    function Ri(e, r, t) {
      switch (e) {
        case 0:
          if (r === 65535) return "und";
          if (t) return t[r];
          break;
        case 1:
          return Dn[r];
        case 3:
          return Pn[r];
      }
    }
    var st = "utf-16",
      Di = {
        0: "macintosh",
        1: "x-mac-japanese",
        2: "x-mac-chinesetrad",
        3: "x-mac-korean",
        6: "x-mac-greek",
        7: "x-mac-cyrillic",
        9: "x-mac-devanagai",
        10: "x-mac-gurmukhi",
        11: "x-mac-gujarati",
        12: "x-mac-oriya",
        13: "x-mac-bengali",
        14: "x-mac-tamil",
        15: "x-mac-telugu",
        16: "x-mac-kannada",
        17: "x-mac-malayalam",
        18: "x-mac-sinhalese",
        19: "x-mac-burmese",
        20: "x-mac-khmer",
        21: "x-mac-thai",
        22: "x-mac-lao",
        23: "x-mac-georgian",
        24: "x-mac-armenian",
        25: "x-mac-chinesesimp",
        26: "x-mac-tibetan",
        27: "x-mac-mongolian",
        28: "x-mac-ethiopic",
        29: "x-mac-ce",
        30: "x-mac-vietnamese",
        31: "x-mac-extarabic"
      },
      Pi = {
        15: "x-mac-icelandic",
        17: "x-mac-turkish",
        18: "x-mac-croatian",
        24: "x-mac-ce",
        25: "x-mac-ce",
        26: "x-mac-ce",
        27: "x-mac-ce",
        28: "x-mac-ce",
        30: "x-mac-icelandic",
        37: "x-mac-romanian",
        38: "x-mac-ce",
        39: "x-mac-ce",
        40: "x-mac-ce",
        143: "x-mac-inuit",
        146: "x-mac-gaelic"
      };
    function Mn(e, r, t) {
      switch (e) {
        case 0:
          return st;
        case 1:
          return Pi[t] || Di[r];
        case 3:
          if (r === 1 || r === 10) return st;
          break;
      }
    }
    function Mi(e, r, t) {
      for (var n = {}, a = new A.Parser(e, r), i = a.parseUShort(), u = a.parseUShort(), f = a.offset + a.parseUShort(), l = 0; l < u; l++) {
        var d = a.parseUShort(),
          v = a.parseUShort(),
          x = a.parseUShort(),
          g = a.parseUShort(),
          y = Rn[g] || g,
          T = a.parseUShort(),
          w = a.parseUShort(),
          E = Ri(d, x, t),
          O = Mn(d, v, x);
        if (O !== void 0 && E !== void 0) {
          var G = void 0;
          if (O === st ? G = Qe.UTF16(e, f + w, T) : G = Qe.MACSTRING(e, f + w, T, O), G) {
            var C = n[y];
            C === void 0 && (C = n[y] = {}), C[E] = G;
          }
        }
      }
      var _ = 0;
      return i === 1 && (_ = a.parseUShort()), n;
    }
    function it(e) {
      var r = {};
      for (var t in e) r[e[t]] = parseInt(t);
      return r;
    }
    function Gn(e, r, t, n, a, i) {
      return new D.Record("NameRecord", [{
        name: "platformID",
        type: "USHORT",
        value: e
      }, {
        name: "encodingID",
        type: "USHORT",
        value: r
      }, {
        name: "languageID",
        type: "USHORT",
        value: t
      }, {
        name: "nameID",
        type: "USHORT",
        value: n
      }, {
        name: "length",
        type: "USHORT",
        value: a
      }, {
        name: "offset",
        type: "USHORT",
        value: i
      }]);
    }
    function Gi(e, r) {
      var t = e.length,
        n = r.length - t + 1;
      e: for (var a = 0; a < n; a++) for (; a < n; a++) {
        for (var i = 0; i < t; i++) if (r[a + i] !== e[i]) continue e;
        return a;
      }
      return -1;
    }
    function Nn(e, r) {
      var t = Gi(e, r);
      if (t < 0) {
        t = r.length;
        for (var n = 0, a = e.length; n < a; ++n) r.push(e[n]);
      }
      return t;
    }
    function Ni(e, r) {
      var t,
        n = [],
        a = {},
        i = it(Rn);
      for (var u in e) {
        var f = i[u];
        if (f === void 0 && (f = u), t = parseInt(f), isNaN(t)) throw new Error('Name table entry "' + u + '" does not exist, see nameTableNames for complete list.');
        a[t] = e[u], n.push(t);
      }
      for (var l = it(Dn), d = it(Pn), v = [], x = [], g = 0; g < n.length; g++) {
        t = n[g];
        var y = a[t];
        for (var T in y) {
          var w = y[T],
            E = 1,
            O = l[T],
            G = Bi[O],
            C = Mn(E, G, O),
            _ = k.MACSTRING(w, C);
          _ === void 0 && (E = 0, O = r.indexOf(T), O < 0 && (O = r.length, r.push(T)), G = 4, _ = k.UTF16(w));
          var R = Nn(_, x);
          v.push(Gn(E, G, O, t, _.length, R));
          var M = d[T];
          if (M !== void 0) {
            var ce = k.UTF16(w),
              Y = Nn(ce, x);
            v.push(Gn(3, 1, M, t, ce.length, Y));
          }
        }
      }
      v.sort(function (he, de) {
        return he.platformID - de.platformID || he.encodingID - de.encodingID || he.languageID - de.languageID || he.nameID - de.nameID;
      });
      for (var $ = new D.Table("name", [{
          name: "format",
          type: "USHORT",
          value: 0
        }, {
          name: "count",
          type: "USHORT",
          value: v.length
        }, {
          name: "stringOffset",
          type: "USHORT",
          value: 6 + v.length * 12
        }]), le = 0; le < v.length; le++) $.fields.push({
        name: "record_" + le,
        type: "RECORD",
        value: v[le]
      });
      return $.fields.push({
        name: "strings",
        type: "LITERAL",
        value: x
      }), $;
    }
    var _n = {
        parse: Mi,
        make: Ni
      },
      ot = [{
        begin: 0,
        end: 127
      }, {
        begin: 128,
        end: 255
      }, {
        begin: 256,
        end: 383
      }, {
        begin: 384,
        end: 591
      }, {
        begin: 592,
        end: 687
      }, {
        begin: 688,
        end: 767
      }, {
        begin: 768,
        end: 879
      }, {
        begin: 880,
        end: 1023
      }, {
        begin: 11392,
        end: 11519
      }, {
        begin: 1024,
        end: 1279
      }, {
        begin: 1328,
        end: 1423
      }, {
        begin: 1424,
        end: 1535
      }, {
        begin: 42240,
        end: 42559
      }, {
        begin: 1536,
        end: 1791
      }, {
        begin: 1984,
        end: 2047
      }, {
        begin: 2304,
        end: 2431
      }, {
        begin: 2432,
        end: 2559
      }, {
        begin: 2560,
        end: 2687
      }, {
        begin: 2688,
        end: 2815
      }, {
        begin: 2816,
        end: 2943
      }, {
        begin: 2944,
        end: 3071
      }, {
        begin: 3072,
        end: 3199
      }, {
        begin: 3200,
        end: 3327
      }, {
        begin: 3328,
        end: 3455
      }, {
        begin: 3584,
        end: 3711
      }, {
        begin: 3712,
        end: 3839
      }, {
        begin: 4256,
        end: 4351
      }, {
        begin: 6912,
        end: 7039
      }, {
        begin: 4352,
        end: 4607
      }, {
        begin: 7680,
        end: 7935
      }, {
        begin: 7936,
        end: 8191
      }, {
        begin: 8192,
        end: 8303
      }, {
        begin: 8304,
        end: 8351
      }, {
        begin: 8352,
        end: 8399
      }, {
        begin: 8400,
        end: 8447
      }, {
        begin: 8448,
        end: 8527
      }, {
        begin: 8528,
        end: 8591
      }, {
        begin: 8592,
        end: 8703
      }, {
        begin: 8704,
        end: 8959
      }, {
        begin: 8960,
        end: 9215
      }, {
        begin: 9216,
        end: 9279
      }, {
        begin: 9280,
        end: 9311
      }, {
        begin: 9312,
        end: 9471
      }, {
        begin: 9472,
        end: 9599
      }, {
        begin: 9600,
        end: 9631
      }, {
        begin: 9632,
        end: 9727
      }, {
        begin: 9728,
        end: 9983
      }, {
        begin: 9984,
        end: 10175
      }, {
        begin: 12288,
        end: 12351
      }, {
        begin: 12352,
        end: 12447
      }, {
        begin: 12448,
        end: 12543
      }, {
        begin: 12544,
        end: 12591
      }, {
        begin: 12592,
        end: 12687
      }, {
        begin: 43072,
        end: 43135
      }, {
        begin: 12800,
        end: 13055
      }, {
        begin: 13056,
        end: 13311
      }, {
        begin: 44032,
        end: 55215
      }, {
        begin: 55296,
        end: 57343
      }, {
        begin: 67840,
        end: 67871
      }, {
        begin: 19968,
        end: 40959
      }, {
        begin: 57344,
        end: 63743
      }, {
        begin: 12736,
        end: 12783
      }, {
        begin: 64256,
        end: 64335
      }, {
        begin: 64336,
        end: 65023
      }, {
        begin: 65056,
        end: 65071
      }, {
        begin: 65040,
        end: 65055
      }, {
        begin: 65104,
        end: 65135
      }, {
        begin: 65136,
        end: 65279
      }, {
        begin: 65280,
        end: 65519
      }, {
        begin: 65520,
        end: 65535
      }, {
        begin: 3840,
        end: 4095
      }, {
        begin: 1792,
        end: 1871
      }, {
        begin: 1920,
        end: 1983
      }, {
        begin: 3456,
        end: 3583
      }, {
        begin: 4096,
        end: 4255
      }, {
        begin: 4608,
        end: 4991
      }, {
        begin: 5024,
        end: 5119
      }, {
        begin: 5120,
        end: 5759
      }, {
        begin: 5760,
        end: 5791
      }, {
        begin: 5792,
        end: 5887
      }, {
        begin: 6016,
        end: 6143
      }, {
        begin: 6144,
        end: 6319
      }, {
        begin: 10240,
        end: 10495
      }, {
        begin: 40960,
        end: 42127
      }, {
        begin: 5888,
        end: 5919
      }, {
        begin: 66304,
        end: 66351
      }, {
        begin: 66352,
        end: 66383
      }, {
        begin: 66560,
        end: 66639
      }, {
        begin: 118784,
        end: 119039
      }, {
        begin: 119808,
        end: 120831
      }, {
        begin: 1044480,
        end: 1048573
      }, {
        begin: 65024,
        end: 65039
      }, {
        begin: 917504,
        end: 917631
      }, {
        begin: 6400,
        end: 6479
      }, {
        begin: 6480,
        end: 6527
      }, {
        begin: 6528,
        end: 6623
      }, {
        begin: 6656,
        end: 6687
      }, {
        begin: 11264,
        end: 11359
      }, {
        begin: 11568,
        end: 11647
      }, {
        begin: 19904,
        end: 19967
      }, {
        begin: 43008,
        end: 43055
      }, {
        begin: 65536,
        end: 65663
      }, {
        begin: 65856,
        end: 65935
      }, {
        begin: 66432,
        end: 66463
      }, {
        begin: 66464,
        end: 66527
      }, {
        begin: 66640,
        end: 66687
      }, {
        begin: 66688,
        end: 66735
      }, {
        begin: 67584,
        end: 67647
      }, {
        begin: 68096,
        end: 68191
      }, {
        begin: 119552,
        end: 119647
      }, {
        begin: 73728,
        end: 74751
      }, {
        begin: 119648,
        end: 119679
      }, {
        begin: 7040,
        end: 7103
      }, {
        begin: 7168,
        end: 7247
      }, {
        begin: 7248,
        end: 7295
      }, {
        begin: 43136,
        end: 43231
      }, {
        begin: 43264,
        end: 43311
      }, {
        begin: 43312,
        end: 43359
      }, {
        begin: 43520,
        end: 43615
      }, {
        begin: 65936,
        end: 65999
      }, {
        begin: 66e3,
        end: 66047
      }, {
        begin: 66208,
        end: 66271
      }, {
        begin: 127024,
        end: 127135
      }];
    function _i(e) {
      for (var r = 0; r < ot.length; r += 1) {
        var t = ot[r];
        if (e >= t.begin && e < t.end) return r;
      }
      return -1;
    }
    function Hi(e, r) {
      var t = {},
        n = new A.Parser(e, r);
      t.version = n.parseUShort(), t.xAvgCharWidth = n.parseShort(), t.usWeightClass = n.parseUShort(), t.usWidthClass = n.parseUShort(), t.fsType = n.parseUShort(), t.ySubscriptXSize = n.parseShort(), t.ySubscriptYSize = n.parseShort(), t.ySubscriptXOffset = n.parseShort(), t.ySubscriptYOffset = n.parseShort(), t.ySuperscriptXSize = n.parseShort(), t.ySuperscriptYSize = n.parseShort(), t.ySuperscriptXOffset = n.parseShort(), t.ySuperscriptYOffset = n.parseShort(), t.yStrikeoutSize = n.parseShort(), t.yStrikeoutPosition = n.parseShort(), t.sFamilyClass = n.parseShort(), t.panose = [];
      for (var a = 0; a < 10; a++) t.panose[a] = n.parseByte();
      return t.ulUnicodeRange1 = n.parseULong(), t.ulUnicodeRange2 = n.parseULong(), t.ulUnicodeRange3 = n.parseULong(), t.ulUnicodeRange4 = n.parseULong(), t.achVendID = String.fromCharCode(n.parseByte(), n.parseByte(), n.parseByte(), n.parseByte()), t.fsSelection = n.parseUShort(), t.usFirstCharIndex = n.parseUShort(), t.usLastCharIndex = n.parseUShort(), t.sTypoAscender = n.parseShort(), t.sTypoDescender = n.parseShort(), t.sTypoLineGap = n.parseShort(), t.usWinAscent = n.parseUShort(), t.usWinDescent = n.parseUShort(), t.version >= 1 && (t.ulCodePageRange1 = n.parseULong(), t.ulCodePageRange2 = n.parseULong()), t.version >= 2 && (t.sxHeight = n.parseShort(), t.sCapHeight = n.parseShort(), t.usDefaultChar = n.parseUShort(), t.usBreakChar = n.parseUShort(), t.usMaxContent = n.parseUShort()), t;
    }
    function zi(e) {
      return new D.Table("OS/2", [{
        name: "version",
        type: "USHORT",
        value: 3
      }, {
        name: "xAvgCharWidth",
        type: "SHORT",
        value: 0
      }, {
        name: "usWeightClass",
        type: "USHORT",
        value: 0
      }, {
        name: "usWidthClass",
        type: "USHORT",
        value: 0
      }, {
        name: "fsType",
        type: "USHORT",
        value: 0
      }, {
        name: "ySubscriptXSize",
        type: "SHORT",
        value: 650
      }, {
        name: "ySubscriptYSize",
        type: "SHORT",
        value: 699
      }, {
        name: "ySubscriptXOffset",
        type: "SHORT",
        value: 0
      }, {
        name: "ySubscriptYOffset",
        type: "SHORT",
        value: 140
      }, {
        name: "ySuperscriptXSize",
        type: "SHORT",
        value: 650
      }, {
        name: "ySuperscriptYSize",
        type: "SHORT",
        value: 699
      }, {
        name: "ySuperscriptXOffset",
        type: "SHORT",
        value: 0
      }, {
        name: "ySuperscriptYOffset",
        type: "SHORT",
        value: 479
      }, {
        name: "yStrikeoutSize",
        type: "SHORT",
        value: 49
      }, {
        name: "yStrikeoutPosition",
        type: "SHORT",
        value: 258
      }, {
        name: "sFamilyClass",
        type: "SHORT",
        value: 0
      }, {
        name: "bFamilyType",
        type: "BYTE",
        value: 0
      }, {
        name: "bSerifStyle",
        type: "BYTE",
        value: 0
      }, {
        name: "bWeight",
        type: "BYTE",
        value: 0
      }, {
        name: "bProportion",
        type: "BYTE",
        value: 0
      }, {
        name: "bContrast",
        type: "BYTE",
        value: 0
      }, {
        name: "bStrokeVariation",
        type: "BYTE",
        value: 0
      }, {
        name: "bArmStyle",
        type: "BYTE",
        value: 0
      }, {
        name: "bLetterform",
        type: "BYTE",
        value: 0
      }, {
        name: "bMidline",
        type: "BYTE",
        value: 0
      }, {
        name: "bXHeight",
        type: "BYTE",
        value: 0
      }, {
        name: "ulUnicodeRange1",
        type: "ULONG",
        value: 0
      }, {
        name: "ulUnicodeRange2",
        type: "ULONG",
        value: 0
      }, {
        name: "ulUnicodeRange3",
        type: "ULONG",
        value: 0
      }, {
        name: "ulUnicodeRange4",
        type: "ULONG",
        value: 0
      }, {
        name: "achVendID",
        type: "CHARARRAY",
        value: "XXXX"
      }, {
        name: "fsSelection",
        type: "USHORT",
        value: 0
      }, {
        name: "usFirstCharIndex",
        type: "USHORT",
        value: 0
      }, {
        name: "usLastCharIndex",
        type: "USHORT",
        value: 0
      }, {
        name: "sTypoAscender",
        type: "SHORT",
        value: 0
      }, {
        name: "sTypoDescender",
        type: "SHORT",
        value: 0
      }, {
        name: "sTypoLineGap",
        type: "SHORT",
        value: 0
      }, {
        name: "usWinAscent",
        type: "USHORT",
        value: 0
      }, {
        name: "usWinDescent",
        type: "USHORT",
        value: 0
      }, {
        name: "ulCodePageRange1",
        type: "ULONG",
        value: 0
      }, {
        name: "ulCodePageRange2",
        type: "ULONG",
        value: 0
      }, {
        name: "sxHeight",
        type: "SHORT",
        value: 0
      }, {
        name: "sCapHeight",
        type: "SHORT",
        value: 0
      }, {
        name: "usDefaultChar",
        type: "USHORT",
        value: 0
      }, {
        name: "usBreakChar",
        type: "USHORT",
        value: 0
      }, {
        name: "usMaxContext",
        type: "USHORT",
        value: 0
      }], e);
    }
    var ut = {
      parse: Hi,
      make: zi,
      unicodeRanges: ot,
      getUnicodeRange: _i
    };
    function qi(e, r) {
      var t = {},
        n = new A.Parser(e, r);
      switch (t.version = n.parseVersion(), t.italicAngle = n.parseFixed(), t.underlinePosition = n.parseShort(), t.underlineThickness = n.parseShort(), t.isFixedPitch = n.parseULong(), t.minMemType42 = n.parseULong(), t.maxMemType42 = n.parseULong(), t.minMemType1 = n.parseULong(), t.maxMemType1 = n.parseULong(), t.version) {
        case 1:
          t.names = _e.slice();
          break;
        case 2:
          t.numberOfGlyphs = n.parseUShort(), t.glyphNameIndex = new Array(t.numberOfGlyphs);
          for (var a = 0; a < t.numberOfGlyphs; a++) t.glyphNameIndex[a] = n.parseUShort();
          t.names = [];
          for (var i = 0; i < t.numberOfGlyphs; i++) if (t.glyphNameIndex[i] >= _e.length) {
            var u = n.parseChar();
            t.names.push(n.parseString(u));
          }
          break;
        case 2.5:
          t.numberOfGlyphs = n.parseUShort(), t.offset = new Array(t.numberOfGlyphs);
          for (var f = 0; f < t.numberOfGlyphs; f++) t.offset[f] = n.parseChar();
          break;
      }
      return t;
    }
    function Wi() {
      return new D.Table("post", [{
        name: "version",
        type: "FIXED",
        value: 196608
      }, {
        name: "italicAngle",
        type: "FIXED",
        value: 0
      }, {
        name: "underlinePosition",
        type: "FWORD",
        value: 0
      }, {
        name: "underlineThickness",
        type: "FWORD",
        value: 0
      }, {
        name: "isFixedPitch",
        type: "ULONG",
        value: 0
      }, {
        name: "minMemType42",
        type: "ULONG",
        value: 0
      }, {
        name: "maxMemType42",
        type: "ULONG",
        value: 0
      }, {
        name: "minMemType1",
        type: "ULONG",
        value: 0
      }, {
        name: "maxMemType1",
        type: "ULONG",
        value: 0
      }]);
    }
    var Hn = {
        parse: qi,
        make: Wi
      },
      Se = new Array(9);
    Se[1] = function () {
      var r = this.offset + this.relativeOffset,
        t = this.parseUShort();
      if (t === 1) return {
        substFormat: 1,
        coverage: this.parsePointer(S.coverage),
        deltaGlyphId: this.parseUShort()
      };
      if (t === 2) return {
        substFormat: 2,
        coverage: this.parsePointer(S.coverage),
        substitute: this.parseOffset16List()
      };
      N.assert(!1, "0x" + r.toString(16) + ": lookup type 1 format must be 1 or 2.");
    }, Se[2] = function () {
      var r = this.parseUShort();
      return N.argument(r === 1, "GSUB Multiple Substitution Subtable identifier-format must be 1"), {
        substFormat: r,
        coverage: this.parsePointer(S.coverage),
        sequences: this.parseListOfLists()
      };
    }, Se[3] = function () {
      var r = this.parseUShort();
      return N.argument(r === 1, "GSUB Alternate Substitution Subtable identifier-format must be 1"), {
        substFormat: r,
        coverage: this.parsePointer(S.coverage),
        alternateSets: this.parseListOfLists()
      };
    }, Se[4] = function () {
      var r = this.parseUShort();
      return N.argument(r === 1, "GSUB ligature table identifier-format must be 1"), {
        substFormat: r,
        coverage: this.parsePointer(S.coverage),
        ligatureSets: this.parseListOfLists(function () {
          return {
            ligGlyph: this.parseUShort(),
            components: this.parseUShortList(this.parseUShort() - 1)
          };
        })
      };
    };
    var Ke = {
      sequenceIndex: S.uShort,
      lookupListIndex: S.uShort
    };
    Se[5] = function () {
      var r = this.offset + this.relativeOffset,
        t = this.parseUShort();
      if (t === 1) return {
        substFormat: t,
        coverage: this.parsePointer(S.coverage),
        ruleSets: this.parseListOfLists(function () {
          var i = this.parseUShort(),
            u = this.parseUShort();
          return {
            input: this.parseUShortList(i - 1),
            lookupRecords: this.parseRecordList(u, Ke)
          };
        })
      };
      if (t === 2) return {
        substFormat: t,
        coverage: this.parsePointer(S.coverage),
        classDef: this.parsePointer(S.classDef),
        classSets: this.parseListOfLists(function () {
          var i = this.parseUShort(),
            u = this.parseUShort();
          return {
            classes: this.parseUShortList(i - 1),
            lookupRecords: this.parseRecordList(u, Ke)
          };
        })
      };
      if (t === 3) {
        var n = this.parseUShort(),
          a = this.parseUShort();
        return {
          substFormat: t,
          coverages: this.parseList(n, S.pointer(S.coverage)),
          lookupRecords: this.parseRecordList(a, Ke)
        };
      }
      N.assert(!1, "0x" + r.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
    }, Se[6] = function () {
      var r = this.offset + this.relativeOffset,
        t = this.parseUShort();
      if (t === 1) return {
        substFormat: 1,
        coverage: this.parsePointer(S.coverage),
        chainRuleSets: this.parseListOfLists(function () {
          return {
            backtrack: this.parseUShortList(),
            input: this.parseUShortList(this.parseShort() - 1),
            lookahead: this.parseUShortList(),
            lookupRecords: this.parseRecordList(Ke)
          };
        })
      };
      if (t === 2) return {
        substFormat: 2,
        coverage: this.parsePointer(S.coverage),
        backtrackClassDef: this.parsePointer(S.classDef),
        inputClassDef: this.parsePointer(S.classDef),
        lookaheadClassDef: this.parsePointer(S.classDef),
        chainClassSet: this.parseListOfLists(function () {
          return {
            backtrack: this.parseUShortList(),
            input: this.parseUShortList(this.parseShort() - 1),
            lookahead: this.parseUShortList(),
            lookupRecords: this.parseRecordList(Ke)
          };
        })
      };
      if (t === 3) return {
        substFormat: 3,
        backtrackCoverage: this.parseList(S.pointer(S.coverage)),
        inputCoverage: this.parseList(S.pointer(S.coverage)),
        lookaheadCoverage: this.parseList(S.pointer(S.coverage)),
        lookupRecords: this.parseRecordList(Ke)
      };
      N.assert(!1, "0x" + r.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
    }, Se[7] = function () {
      var r = this.parseUShort();
      N.argument(r === 1, "GSUB Extension Substitution subtable identifier-format must be 1");
      var t = this.parseUShort(),
        n = new S(this.data, this.offset + this.parseULong());
      return {
        substFormat: 1,
        lookupType: t,
        extension: Se[t].call(n)
      };
    }, Se[8] = function () {
      var r = this.parseUShort();
      return N.argument(r === 1, "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"), {
        substFormat: r,
        coverage: this.parsePointer(S.coverage),
        backtrackCoverage: this.parseList(S.pointer(S.coverage)),
        lookaheadCoverage: this.parseList(S.pointer(S.coverage)),
        substitutes: this.parseUShortList()
      };
    };
    function Vi(e, r) {
      r = r || 0;
      var t = new S(e, r),
        n = t.parseVersion(1);
      return N.argument(n === 1 || n === 1.1, "Unsupported GSUB table version."), n === 1 ? {
        version: n,
        scripts: t.parseScriptList(),
        features: t.parseFeatureList(),
        lookups: t.parseLookupList(Se)
      } : {
        version: n,
        scripts: t.parseScriptList(),
        features: t.parseFeatureList(),
        lookups: t.parseLookupList(Se),
        variations: t.parseFeatureVariationsList()
      };
    }
    var Ir = new Array(9);
    Ir[1] = function (r) {
      return r.substFormat === 1 ? new D.Table("substitutionTable", [{
        name: "substFormat",
        type: "USHORT",
        value: 1
      }, {
        name: "coverage",
        type: "TABLE",
        value: new D.Coverage(r.coverage)
      }, {
        name: "deltaGlyphID",
        type: "USHORT",
        value: r.deltaGlyphId
      }]) : new D.Table("substitutionTable", [{
        name: "substFormat",
        type: "USHORT",
        value: 2
      }, {
        name: "coverage",
        type: "TABLE",
        value: new D.Coverage(r.coverage)
      }].concat(D.ushortList("substitute", r.substitute)));
    }, Ir[3] = function (r) {
      return N.assert(r.substFormat === 1, "Lookup type 3 substFormat must be 1."), new D.Table("substitutionTable", [{
        name: "substFormat",
        type: "USHORT",
        value: 1
      }, {
        name: "coverage",
        type: "TABLE",
        value: new D.Coverage(r.coverage)
      }].concat(D.tableList("altSet", r.alternateSets, function (t) {
        return new D.Table("alternateSetTable", D.ushortList("alternate", t));
      })));
    }, Ir[4] = function (r) {
      return N.assert(r.substFormat === 1, "Lookup type 4 substFormat must be 1."), new D.Table("substitutionTable", [{
        name: "substFormat",
        type: "USHORT",
        value: 1
      }, {
        name: "coverage",
        type: "TABLE",
        value: new D.Coverage(r.coverage)
      }].concat(D.tableList("ligSet", r.ligatureSets, function (t) {
        return new D.Table("ligatureSetTable", D.tableList("ligature", t, function (n) {
          return new D.Table("ligatureTable", [{
            name: "ligGlyph",
            type: "USHORT",
            value: n.ligGlyph
          }].concat(D.ushortList("component", n.components, n.components.length + 1)));
        }));
      })));
    };
    function Xi(e) {
      return new D.Table("GSUB", [{
        name: "version",
        type: "ULONG",
        value: 65536
      }, {
        name: "scripts",
        type: "TABLE",
        value: new D.ScriptList(e.scripts)
      }, {
        name: "features",
        type: "TABLE",
        value: new D.FeatureList(e.features)
      }, {
        name: "lookups",
        type: "TABLE",
        value: new D.LookupList(e.lookups, Ir)
      }]);
    }
    var zn = {
      parse: Vi,
      make: Xi
    };
    function Yi(e, r) {
      var t = new A.Parser(e, r),
        n = t.parseULong();
      N.argument(n === 1, "Unsupported META table version."), t.parseULong(), t.parseULong();
      for (var a = t.parseULong(), i = {}, u = 0; u < a; u++) {
        var f = t.parseTag(),
          l = t.parseULong(),
          d = t.parseULong(),
          v = Qe.UTF8(e, r + l, d);
        i[f] = v;
      }
      return i;
    }
    function ji(e) {
      var r = Object.keys(e).length,
        t = "",
        n = 16 + r * 12,
        a = new D.Table("meta", [{
          name: "version",
          type: "ULONG",
          value: 1
        }, {
          name: "flags",
          type: "ULONG",
          value: 0
        }, {
          name: "offset",
          type: "ULONG",
          value: n
        }, {
          name: "numTags",
          type: "ULONG",
          value: r
        }]);
      for (var i in e) {
        var u = t.length;
        t += e[i], a.fields.push({
          name: "tag " + i,
          type: "TAG",
          value: i
        }), a.fields.push({
          name: "offset " + i,
          type: "ULONG",
          value: n + u
        }), a.fields.push({
          name: "length " + i,
          type: "ULONG",
          value: e[i].length
        });
      }
      return a.fields.push({
        name: "stringPool",
        type: "CHARARRAY",
        value: t
      }), a;
    }
    var qn = {
      parse: Yi,
      make: ji
    };
    function Wn(e) {
      return Math.log(e) / Math.log(2) | 0;
    }
    function lt(e) {
      for (; e.length % 4 !== 0;) e.push(0);
      for (var r = 0, t = 0; t < e.length; t += 4) r += (e[t] << 24) + (e[t + 1] << 16) + (e[t + 2] << 8) + e[t + 3];
      return r %= Math.pow(2, 32), r;
    }
    function Vn(e, r, t, n) {
      return new D.Record("Table Record", [{
        name: "tag",
        type: "TAG",
        value: e !== void 0 ? e : ""
      }, {
        name: "checkSum",
        type: "ULONG",
        value: r !== void 0 ? r : 0
      }, {
        name: "offset",
        type: "ULONG",
        value: t !== void 0 ? t : 0
      }, {
        name: "length",
        type: "ULONG",
        value: n !== void 0 ? n : 0
      }]);
    }
    function Xn(e) {
      var r = new D.Table("sfnt", [{
        name: "version",
        type: "TAG",
        value: "OTTO"
      }, {
        name: "numTables",
        type: "USHORT",
        value: 0
      }, {
        name: "searchRange",
        type: "USHORT",
        value: 0
      }, {
        name: "entrySelector",
        type: "USHORT",
        value: 0
      }, {
        name: "rangeShift",
        type: "USHORT",
        value: 0
      }]);
      r.tables = e, r.numTables = e.length;
      var t = Math.pow(2, Wn(r.numTables));
      r.searchRange = 16 * t, r.entrySelector = Wn(t), r.rangeShift = r.numTables * 16 - r.searchRange;
      for (var n = [], a = [], i = r.sizeOf() + Vn().sizeOf() * r.numTables; i % 4 !== 0;) i += 1, a.push({
        name: "padding",
        type: "BYTE",
        value: 0
      });
      for (var u = 0; u < e.length; u += 1) {
        var f = e[u];
        N.argument(f.tableName.length === 4, "Table name" + f.tableName + " is invalid.");
        var l = f.sizeOf(),
          d = Vn(f.tableName, lt(f.encode()), i, l);
        for (n.push({
          name: d.tag + " Table Record",
          type: "RECORD",
          value: d
        }), a.push({
          name: f.tableName + " table",
          type: "RECORD",
          value: f
        }), i += l, N.argument(!isNaN(i), "Something went wrong calculating the offset."); i % 4 !== 0;) i += 1, a.push({
          name: "padding",
          type: "BYTE",
          value: 0
        });
      }
      return n.sort(function (v, x) {
        return v.value.tag > x.value.tag ? 1 : -1;
      }), r.fields = r.fields.concat(n), r.fields = r.fields.concat(a), r;
    }
    function Yn(e, r, t) {
      for (var n = 0; n < r.length; n += 1) {
        var a = e.charToGlyphIndex(r[n]);
        if (a > 0) {
          var i = e.glyphs.get(a);
          return i.getMetrics();
        }
      }
      return t;
    }
    function Zi(e) {
      for (var r = 0, t = 0; t < e.length; t += 1) r += e[t];
      return r / e.length;
    }
    function Qi(e) {
      for (var r = [], t = [], n = [], a = [], i = [], u = [], f = [], l, d = 0, v = 0, x = 0, g = 0, y = 0, T = 0; T < e.glyphs.length; T += 1) {
        var w = e.glyphs.get(T),
          E = w.unicode | 0;
        if (isNaN(w.advanceWidth)) throw new Error("Glyph " + w.name + " (" + T + "): advanceWidth is not a number.");
        (l > E || l === void 0) && E > 0 && (l = E), d < E && (d = E);
        var O = ut.getUnicodeRange(E);
        if (O < 32) v |= 1 << O;else if (O < 64) x |= 1 << O - 32;else if (O < 96) g |= 1 << O - 64;else if (O < 123) y |= 1 << O - 96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");
        if (w.name !== ".notdef") {
          var G = w.getMetrics();
          r.push(G.xMin), t.push(G.yMin), n.push(G.xMax), a.push(G.yMax), u.push(G.leftSideBearing), f.push(G.rightSideBearing), i.push(w.advanceWidth);
        }
      }
      var C = {
        xMin: Math.min.apply(null, r),
        yMin: Math.min.apply(null, t),
        xMax: Math.max.apply(null, n),
        yMax: Math.max.apply(null, a),
        advanceWidthMax: Math.max.apply(null, i),
        advanceWidthAvg: Zi(i),
        minLeftSideBearing: Math.min.apply(null, u),
        maxLeftSideBearing: Math.max.apply(null, u),
        minRightSideBearing: Math.min.apply(null, f)
      };
      C.ascender = e.ascender, C.descender = e.descender;
      var _ = Cn.make({
          flags: 3,
          unitsPerEm: e.unitsPerEm,
          xMin: C.xMin,
          yMin: C.yMin,
          xMax: C.xMax,
          yMax: C.yMax,
          lowestRecPPEM: 3,
          createdTimestamp: e.createdTimestamp
        }),
        R = Ln.make({
          ascender: C.ascender,
          descender: C.descender,
          advanceWidthMax: C.advanceWidthMax,
          minLeftSideBearing: C.minLeftSideBearing,
          minRightSideBearing: C.minRightSideBearing,
          xMaxExtent: C.maxLeftSideBearing + (C.xMax - C.xMin),
          numberOfHMetrics: e.glyphs.length
        }),
        M = Bn.make(e.glyphs.length),
        ce = ut.make({
          xAvgCharWidth: Math.round(C.advanceWidthAvg),
          usWeightClass: e.tables.os2.usWeightClass,
          usWidthClass: e.tables.os2.usWidthClass,
          usFirstCharIndex: l,
          usLastCharIndex: d,
          ulUnicodeRange1: v,
          ulUnicodeRange2: x,
          ulUnicodeRange3: g,
          ulUnicodeRange4: y,
          fsSelection: e.tables.os2.fsSelection,
          sTypoAscender: C.ascender,
          sTypoDescender: C.descender,
          sTypoLineGap: 0,
          usWinAscent: C.yMax,
          usWinDescent: Math.abs(C.yMin),
          ulCodePageRange1: 1,
          sxHeight: Yn(e, "xyvw", {
            yMax: Math.round(C.ascender / 2)
          }).yMax,
          sCapHeight: Yn(e, "HIKLEFJMNTZBDPRAGOQSUVWXY", C).yMax,
          usDefaultChar: e.hasChar(" ") ? 32 : 0,
          usBreakChar: e.hasChar(" ") ? 32 : 0
        }),
        Y = In.make(e.glyphs),
        $ = cn.make(e.glyphs),
        le = e.getEnglishName("fontFamily"),
        he = e.getEnglishName("fontSubfamily"),
        de = le + " " + he,
        ge = e.getEnglishName("postScriptName");
      ge || (ge = le.replace(/\s/g, "") + "-" + he);
      var K = {};
      for (var ee in e.names) K[ee] = e.names[ee];
      K.uniqueID || (K.uniqueID = {
        en: e.getEnglishName("manufacturer") + ":" + de
      }), K.postScriptName || (K.postScriptName = {
        en: ge
      }), K.preferredFamily || (K.preferredFamily = e.names.fontFamily), K.preferredSubfamily || (K.preferredSubfamily = e.names.fontSubfamily);
      var ne = [],
        ae = _n.make(K, ne),
        se = ne.length > 0 ? An.make(ne) : void 0,
        fe = Hn.make(),
        ve = wn.make(e.glyphs, {
          version: e.getEnglishName("version"),
          fullName: de,
          familyName: le,
          weightName: he,
          postScriptName: ge,
          unitsPerEm: e.unitsPerEm,
          fontBBox: [0, C.yMin, C.ascender, C.advanceWidthMax]
        }),
        j = e.metas && Object.keys(e.metas).length > 0 ? qn.make(e.metas) : void 0,
        ie = [_, R, M, ce, ae, $, fe, ve, Y];
      se && ie.push(se), e.tables.gsub && ie.push(zn.make(e.tables.gsub)), j && ie.push(j);
      for (var gt = Xn(ie), $u = gt.encode(), el = lt($u), mt = gt.fields, Sa = !1, Dr = 0; Dr < mt.length; Dr += 1) if (mt[Dr].name === "head table") {
        mt[Dr].value.checkSumAdjustment = 2981146554 - el, Sa = !0;
        break;
      }
      if (!Sa) throw new Error("Could not find head table with checkSum to adjust.");
      return gt;
    }
    var Ji = {
      make: Xn,
      fontToTable: Qi,
      computeCheckSum: lt
    };
    function ft(e, r) {
      for (var t = 0, n = e.length - 1; t <= n;) {
        var a = t + n >>> 1,
          i = e[a].tag;
        if (i === r) return a;
        i < r ? t = a + 1 : n = a - 1;
      }
      return -t - 1;
    }
    function jn(e, r) {
      for (var t = 0, n = e.length - 1; t <= n;) {
        var a = t + n >>> 1,
          i = e[a];
        if (i === r) return a;
        i < r ? t = a + 1 : n = a - 1;
      }
      return -t - 1;
    }
    function Zn(e, r) {
      for (var t, n = 0, a = e.length - 1; n <= a;) {
        var i = n + a >>> 1;
        t = e[i];
        var u = t.start;
        if (u === r) return t;
        u < r ? n = i + 1 : a = i - 1;
      }
      if (n > 0) return t = e[n - 1], r > t.end ? 0 : t;
    }
    function lr(e, r) {
      this.font = e, this.tableName = r;
    }
    lr.prototype = {
      searchTag: ft,
      binSearch: jn,
      getTable: function (e) {
        var r = this.font.tables[this.tableName];
        return !r && e && (r = this.font.tables[this.tableName] = this.createDefaultTable()), r;
      },
      getScriptNames: function () {
        var e = this.getTable();
        return e ? e.scripts.map(function (r) {
          return r.tag;
        }) : [];
      },
      getDefaultScriptName: function () {
        var e = this.getTable();
        if (e) {
          for (var r = !1, t = 0; t < e.scripts.length; t++) {
            var n = e.scripts[t].tag;
            if (n === "DFLT") return n;
            n === "latn" && (r = !0);
          }
          if (r) return "latn";
        }
      },
      getScriptTable: function (e, r) {
        var t = this.getTable(r);
        if (t) {
          e = e || "DFLT";
          var n = t.scripts,
            a = ft(t.scripts, e);
          if (a >= 0) return n[a].script;
          if (r) {
            var i = {
              tag: e,
              script: {
                defaultLangSys: {
                  reserved: 0,
                  reqFeatureIndex: 65535,
                  featureIndexes: []
                },
                langSysRecords: []
              }
            };
            return n.splice(-1 - a, 0, i), i.script;
          }
        }
      },
      getLangSysTable: function (e, r, t) {
        var n = this.getScriptTable(e, t);
        if (n) {
          if (!r || r === "dflt" || r === "DFLT") return n.defaultLangSys;
          var a = ft(n.langSysRecords, r);
          if (a >= 0) return n.langSysRecords[a].langSys;
          if (t) {
            var i = {
              tag: r,
              langSys: {
                reserved: 0,
                reqFeatureIndex: 65535,
                featureIndexes: []
              }
            };
            return n.langSysRecords.splice(-1 - a, 0, i), i.langSys;
          }
        }
      },
      getFeatureTable: function (e, r, t, n) {
        var a = this.getLangSysTable(e, r, n);
        if (a) {
          for (var i, u = a.featureIndexes, f = this.font.tables[this.tableName].features, l = 0; l < u.length; l++) if (i = f[u[l]], i.tag === t) return i.feature;
          if (n) {
            var d = f.length;
            return N.assert(d === 0 || t >= f[d - 1].tag, "Features must be added in alphabetical order."), i = {
              tag: t,
              feature: {
                params: 0,
                lookupListIndexes: []
              }
            }, f.push(i), u.push(d), i.feature;
          }
        }
      },
      getLookupTables: function (e, r, t, n, a) {
        var i = this.getFeatureTable(e, r, t, a),
          u = [];
        if (i) {
          for (var f, l = i.lookupListIndexes, d = this.font.tables[this.tableName].lookups, v = 0; v < l.length; v++) f = d[l[v]], f.lookupType === n && u.push(f);
          if (u.length === 0 && a) {
            f = {
              lookupType: n,
              lookupFlag: 0,
              subtables: [],
              markFilteringSet: void 0
            };
            var x = d.length;
            return d.push(f), l.push(x), [f];
          }
        }
        return u;
      },
      getGlyphClass: function (e, r) {
        switch (e.format) {
          case 1:
            return e.startGlyph <= r && r < e.startGlyph + e.classes.length ? e.classes[r - e.startGlyph] : 0;
          case 2:
            var t = Zn(e.ranges, r);
            return t ? t.classId : 0;
        }
      },
      getCoverageIndex: function (e, r) {
        switch (e.format) {
          case 1:
            var t = jn(e.glyphs, r);
            return t >= 0 ? t : -1;
          case 2:
            var n = Zn(e.ranges, r);
            return n ? n.index + r - n.start : -1;
        }
      },
      expandCoverage: function (e) {
        if (e.format === 1) return e.glyphs;
        for (var r = [], t = e.ranges, n = 0; n < t.length; n++) for (var a = t[n], i = a.start, u = a.end, f = i; f <= u; f++) r.push(f);
        return r;
      }
    };
    function Ar(e) {
      lr.call(this, e, "gpos");
    }
    Ar.prototype = lr.prototype, Ar.prototype.getKerningValue = function (e, r, t) {
      for (var n = this, a = 0; a < e.length; a++) for (var i = e[a].subtables, u = 0; u < i.length; u++) {
        var f = i[u],
          l = n.getCoverageIndex(f.coverage, r);
        if (!(l < 0)) switch (f.posFormat) {
          case 1:
            for (var d = f.pairSets[l], v = 0; v < d.length; v++) {
              var x = d[v];
              if (x.secondGlyph === t) return x.value1 && x.value1.xAdvance || 0;
            }
            break;
          case 2:
            var g = n.getGlyphClass(f.classDef1, r),
              y = n.getGlyphClass(f.classDef2, t),
              T = f.classRecords[g][y];
            return T.value1 && T.value1.xAdvance || 0;
        }
      }
      return 0;
    }, Ar.prototype.getKerningTables = function (e, r) {
      if (this.font.tables.gpos) return this.getLookupTables(e, r, "kern", 2);
    };
    function Fe(e) {
      lr.call(this, e, "gsub");
    }
    function Ki(e, r) {
      var t = e.length;
      if (t !== r.length) return !1;
      for (var n = 0; n < t; n++) if (e[n] !== r[n]) return !1;
      return !0;
    }
    function Qn(e, r, t) {
      for (var n = e.subtables, a = 0; a < n.length; a++) {
        var i = n[a];
        if (i.substFormat === r) return i;
      }
      if (t) return n.push(t), t;
    }
    Fe.prototype = lr.prototype, Fe.prototype.createDefaultTable = function () {
      return {
        version: 1,
        scripts: [{
          tag: "DFLT",
          script: {
            defaultLangSys: {
              reserved: 0,
              reqFeatureIndex: 65535,
              featureIndexes: []
            },
            langSysRecords: []
          }
        }],
        features: [],
        lookups: []
      };
    }, Fe.prototype.getSingle = function (e, r, t) {
      for (var n = this, a = [], i = this.getLookupTables(r, t, e, 1), u = 0; u < i.length; u++) for (var f = i[u].subtables, l = 0; l < f.length; l++) {
        var d = f[l],
          v = n.expandCoverage(d.coverage),
          x = void 0;
        if (d.substFormat === 1) {
          var g = d.deltaGlyphId;
          for (x = 0; x < v.length; x++) {
            var y = v[x];
            a.push({
              sub: y,
              by: y + g
            });
          }
        } else {
          var T = d.substitute;
          for (x = 0; x < v.length; x++) a.push({
            sub: v[x],
            by: T[x]
          });
        }
      }
      return a;
    }, Fe.prototype.getAlternates = function (e, r, t) {
      for (var n = this, a = [], i = this.getLookupTables(r, t, e, 3), u = 0; u < i.length; u++) for (var f = i[u].subtables, l = 0; l < f.length; l++) for (var d = f[l], v = n.expandCoverage(d.coverage), x = d.alternateSets, g = 0; g < v.length; g++) a.push({
        sub: v[g],
        by: x[g]
      });
      return a;
    }, Fe.prototype.getLigatures = function (e, r, t) {
      for (var n = this, a = [], i = this.getLookupTables(r, t, e, 4), u = 0; u < i.length; u++) for (var f = i[u].subtables, l = 0; l < f.length; l++) for (var d = f[l], v = n.expandCoverage(d.coverage), x = d.ligatureSets, g = 0; g < v.length; g++) for (var y = v[g], T = x[g], w = 0; w < T.length; w++) {
        var E = T[w];
        a.push({
          sub: [y].concat(E.components),
          by: E.ligGlyph
        });
      }
      return a;
    }, Fe.prototype.addSingle = function (e, r, t, n) {
      var a = this.getLookupTables(t, n, e, 1, !0)[0],
        i = Qn(a, 2, {
          substFormat: 2,
          coverage: {
            format: 1,
            glyphs: []
          },
          substitute: []
        });
      N.assert(i.coverage.format === 1, "Ligature: unable to modify coverage table format " + i.coverage.format);
      var u = r.sub,
        f = this.binSearch(i.coverage.glyphs, u);
      f < 0 && (f = -1 - f, i.coverage.glyphs.splice(f, 0, u), i.substitute.splice(f, 0, 0)), i.substitute[f] = r.by;
    }, Fe.prototype.addAlternate = function (e, r, t, n) {
      var a = this.getLookupTables(t, n, e, 3, !0)[0],
        i = Qn(a, 1, {
          substFormat: 1,
          coverage: {
            format: 1,
            glyphs: []
          },
          alternateSets: []
        });
      N.assert(i.coverage.format === 1, "Ligature: unable to modify coverage table format " + i.coverage.format);
      var u = r.sub,
        f = this.binSearch(i.coverage.glyphs, u);
      f < 0 && (f = -1 - f, i.coverage.glyphs.splice(f, 0, u), i.alternateSets.splice(f, 0, 0)), i.alternateSets[f] = r.by;
    }, Fe.prototype.addLigature = function (e, r, t, n) {
      var a = this.getLookupTables(t, n, e, 4, !0)[0],
        i = a.subtables[0];
      i || (i = {
        substFormat: 1,
        coverage: {
          format: 1,
          glyphs: []
        },
        ligatureSets: []
      }, a.subtables[0] = i), N.assert(i.coverage.format === 1, "Ligature: unable to modify coverage table format " + i.coverage.format);
      var u = r.sub[0],
        f = r.sub.slice(1),
        l = {
          ligGlyph: r.by,
          components: f
        },
        d = this.binSearch(i.coverage.glyphs, u);
      if (d >= 0) {
        for (var v = i.ligatureSets[d], x = 0; x < v.length; x++) if (Ki(v[x].components, f)) return;
        v.push(l);
      } else d = -1 - d, i.coverage.glyphs.splice(d, 0, u), i.ligatureSets.splice(d, 0, [l]);
    }, Fe.prototype.getFeature = function (e, r, t) {
      if (/ss\d\d/.test(e)) return this.getSingle(e, r, t);
      switch (e) {
        case "aalt":
        case "salt":
          return this.getSingle(e, r, t).concat(this.getAlternates(e, r, t));
        case "dlig":
        case "liga":
        case "rlig":
          return this.getLigatures(e, r, t);
      }
    }, Fe.prototype.add = function (e, r, t, n) {
      if (/ss\d\d/.test(e)) return this.addSingle(e, r, t, n);
      switch (e) {
        case "aalt":
        case "salt":
          return typeof r.by == "number" ? this.addSingle(e, r, t, n) : this.addAlternate(e, r, t, n);
        case "dlig":
        case "liga":
        case "rlig":
          return this.addLigature(e, r, t, n);
      }
    };
    function $i() {
      return typeof window < "u";
    }
    function Jn(e) {
      for (var r = new ArrayBuffer(e.length), t = new Uint8Array(r), n = 0; n < e.length; ++n) t[n] = e[n];
      return r;
    }
    function eo(e) {
      for (var r = new Buffer(e.byteLength), t = new Uint8Array(e), n = 0; n < r.length; ++n) r[n] = t[n];
      return r;
    }
    function $e(e, r) {
      if (!e) throw r;
    }
    var Kn, ze, $n, ct;
    function ea(e) {
      this.font = e, this._fpgmState = this._prepState = void 0, this._errorState = 0;
    }
    function ro(e) {
      return e;
    }
    function ra(e) {
      return Math.sign(e) * Math.round(Math.abs(e));
    }
    function to(e) {
      return Math.sign(e) * Math.round(Math.abs(e * 2)) / 2;
    }
    function no(e) {
      return Math.sign(e) * (Math.round(Math.abs(e) + .5) - .5);
    }
    function ao(e) {
      return Math.sign(e) * Math.ceil(Math.abs(e));
    }
    function so(e) {
      return Math.sign(e) * Math.floor(Math.abs(e));
    }
    var ta = function (e) {
        var r = this.srPeriod,
          t = this.srPhase,
          n = this.srThreshold,
          a = 1;
        return e < 0 && (e = -e, a = -1), e += n - t, e = Math.trunc(e / r) * r, e += t, e < 0 ? t * a : e * a;
      },
      ke = {
        x: 1,
        y: 0,
        axis: "x",
        distance: function (e, r, t, n) {
          return (t ? e.xo : e.x) - (n ? r.xo : r.x);
        },
        interpolate: function (e, r, t, n) {
          var a, i, u, f, l, d, v;
          if (!n || n === this) {
            if (a = e.xo - r.xo, i = e.xo - t.xo, l = r.x - r.xo, d = t.x - t.xo, u = Math.abs(a), f = Math.abs(i), v = u + f, v === 0) {
              e.x = e.xo + (l + d) / 2;
              return;
            }
            e.x = e.xo + (l * f + d * u) / v;
            return;
          }
          if (a = n.distance(e, r, !0, !0), i = n.distance(e, t, !0, !0), l = n.distance(r, r, !1, !0), d = n.distance(t, t, !1, !0), u = Math.abs(a), f = Math.abs(i), v = u + f, v === 0) {
            ke.setRelative(e, e, (l + d) / 2, n, !0);
            return;
          }
          ke.setRelative(e, e, (l * f + d * u) / v, n, !0);
        },
        normalSlope: Number.NEGATIVE_INFINITY,
        setRelative: function (e, r, t, n, a) {
          if (!n || n === this) {
            e.x = (a ? r.xo : r.x) + t;
            return;
          }
          var i = a ? r.xo : r.x,
            u = a ? r.yo : r.y,
            f = i + t * n.x,
            l = u + t * n.y;
          e.x = f + (e.y - l) / n.normalSlope;
        },
        slope: 0,
        touch: function (e) {
          e.xTouched = !0;
        },
        touched: function (e) {
          return e.xTouched;
        },
        untouch: function (e) {
          e.xTouched = !1;
        }
      },
      Ce = {
        x: 0,
        y: 1,
        axis: "y",
        distance: function (e, r, t, n) {
          return (t ? e.yo : e.y) - (n ? r.yo : r.y);
        },
        interpolate: function (e, r, t, n) {
          var a, i, u, f, l, d, v;
          if (!n || n === this) {
            if (a = e.yo - r.yo, i = e.yo - t.yo, l = r.y - r.yo, d = t.y - t.yo, u = Math.abs(a), f = Math.abs(i), v = u + f, v === 0) {
              e.y = e.yo + (l + d) / 2;
              return;
            }
            e.y = e.yo + (l * f + d * u) / v;
            return;
          }
          if (a = n.distance(e, r, !0, !0), i = n.distance(e, t, !0, !0), l = n.distance(r, r, !1, !0), d = n.distance(t, t, !1, !0), u = Math.abs(a), f = Math.abs(i), v = u + f, v === 0) {
            Ce.setRelative(e, e, (l + d) / 2, n, !0);
            return;
          }
          Ce.setRelative(e, e, (l * f + d * u) / v, n, !0);
        },
        normalSlope: 0,
        setRelative: function (e, r, t, n, a) {
          if (!n || n === this) {
            e.y = (a ? r.yo : r.y) + t;
            return;
          }
          var i = a ? r.xo : r.x,
            u = a ? r.yo : r.y,
            f = i + t * n.x,
            l = u + t * n.y;
          e.y = l + n.normalSlope * (e.x - f);
        },
        slope: Number.POSITIVE_INFINITY,
        touch: function (e) {
          e.yTouched = !0;
        },
        touched: function (e) {
          return e.yTouched;
        },
        untouch: function (e) {
          e.yTouched = !1;
        }
      };
    Object.freeze(ke), Object.freeze(Ce);
    function fr(e, r) {
      this.x = e, this.y = r, this.axis = void 0, this.slope = r / e, this.normalSlope = -e / r, Object.freeze(this);
    }
    fr.prototype.distance = function (e, r, t, n) {
      return this.x * ke.distance(e, r, t, n) + this.y * Ce.distance(e, r, t, n);
    }, fr.prototype.interpolate = function (e, r, t, n) {
      var a, i, u, f, l, d, v;
      if (u = n.distance(e, r, !0, !0), f = n.distance(e, t, !0, !0), a = n.distance(r, r, !1, !0), i = n.distance(t, t, !1, !0), l = Math.abs(u), d = Math.abs(f), v = l + d, v === 0) {
        this.setRelative(e, e, (a + i) / 2, n, !0);
        return;
      }
      this.setRelative(e, e, (a * d + i * l) / v, n, !0);
    }, fr.prototype.setRelative = function (e, r, t, n, a) {
      n = n || this;
      var i = a ? r.xo : r.x,
        u = a ? r.yo : r.y,
        f = i + t * n.x,
        l = u + t * n.y,
        d = n.normalSlope,
        v = this.slope,
        x = e.x,
        g = e.y;
      e.x = (v * x - d * f + l - g) / (v - d), e.y = v * (e.x - x) + g;
    }, fr.prototype.touch = function (e) {
      e.xTouched = !0, e.yTouched = !0;
    };
    function cr(e, r) {
      var t = Math.sqrt(e * e + r * r);
      return e /= t, r /= t, e === 1 && r === 0 ? ke : e === 0 && r === 1 ? Ce : new fr(e, r);
    }
    function Le(e, r, t, n) {
      this.x = this.xo = Math.round(e * 64) / 64, this.y = this.yo = Math.round(r * 64) / 64, this.lastPointOfContour = t, this.onCurve = n, this.prevPointOnContour = void 0, this.nextPointOnContour = void 0, this.xTouched = !1, this.yTouched = !1, Object.preventExtensions(this);
    }
    Le.prototype.nextTouched = function (e) {
      for (var r = this.nextPointOnContour; !e.touched(r) && r !== this;) r = r.nextPointOnContour;
      return r;
    }, Le.prototype.prevTouched = function (e) {
      for (var r = this.prevPointOnContour; !e.touched(r) && r !== this;) r = r.prevPointOnContour;
      return r;
    };
    var hr = Object.freeze(new Le(0, 0)),
      io = {
        cvCutIn: 17 / 16,
        deltaBase: 9,
        deltaShift: .125,
        loop: 1,
        minDis: 1,
        autoFlip: !0
      };
    function De(e, r) {
      switch (this.env = e, this.stack = [], this.prog = r, e) {
        case "glyf":
          this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
        case "prep":
          this.fv = this.pv = this.dpv = ke, this.round = ra;
      }
    }
    ea.prototype.exec = function (e, r) {
      if (typeof r != "number") throw new Error("Point size is not a number!");
      if (!(this._errorState > 2)) {
        var t = this.font,
          n = this._prepState;
        if (!n || n.ppem !== r) {
          var a = this._fpgmState;
          if (!a) {
            De.prototype = io, a = this._fpgmState = new De("fpgm", t.tables.fpgm), a.funcs = [], a.font = t, s.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
            try {
              ze(a);
            } catch (d) {
              console.log("Hinting error in FPGM:" + d), this._errorState = 3;
              return;
            }
          }
          De.prototype = a, n = this._prepState = new De("prep", t.tables.prep), n.ppem = r;
          var i = t.tables.cvt;
          if (i) for (var u = n.cvt = new Array(i.length), f = r / t.unitsPerEm, l = 0; l < i.length; l++) u[l] = i[l] * f;else n.cvt = [];
          s.DEBUG && (console.log("---EXEC PREP---"), n.step = -1);
          try {
            ze(n);
          } catch (d) {
            this._errorState < 2 && console.log("Hinting error in PREP:" + d), this._errorState = 2;
          }
        }
        if (!(this._errorState > 1)) try {
          return $n(e, n);
        } catch (d) {
          this._errorState < 1 && (console.log("Hinting error:" + d), console.log("Note: further hinting errors are silenced")), this._errorState = 1;
          return;
        }
      }
    }, $n = function (e, r) {
      var t = r.ppem / r.font.unitsPerEm,
        n = t,
        a = e.components,
        i,
        u,
        f;
      if (De.prototype = r, !a) f = new De("glyf", e.instructions), s.DEBUG && (console.log("---EXEC GLYPH---"), f.step = -1), ct(e, f, t, n), u = f.gZone;else {
        var l = r.font;
        u = [], i = [];
        for (var d = 0; d < a.length; d++) {
          var v = a[d],
            x = l.glyphs.get(v.glyphIndex);
          f = new De("glyf", x.instructions), s.DEBUG && (console.log("---EXEC COMP " + d + "---"), f.step = -1), ct(x, f, t, n);
          for (var g = Math.round(v.dx * t), y = Math.round(v.dy * n), T = f.gZone, w = f.contours, E = 0; E < T.length; E++) {
            var O = T[E];
            O.xTouched = O.yTouched = !1, O.xo = O.x = O.x + g, O.yo = O.y = O.y + y;
          }
          var G = u.length;
          u.push.apply(u, T);
          for (var C = 0; C < w.length; C++) i.push(w[C] + G);
        }
        e.instructions && !f.inhibitGridFit && (f = new De("glyf", e.instructions), f.gZone = f.z0 = f.z1 = f.z2 = u, f.contours = i, u.push(new Le(0, 0), new Le(Math.round(e.advanceWidth * t), 0)), s.DEBUG && (console.log("---EXEC COMPOSITE---"), f.step = -1), ze(f), u.length -= 2);
      }
      return u;
    }, ct = function (e, r, t, n) {
      for (var a = e.points || [], i = a.length, u = r.gZone = r.z0 = r.z1 = r.z2 = [], f = r.contours = [], l, d = 0; d < i; d++) l = a[d], u[d] = new Le(l.x * t, l.y * n, l.lastPointOfContour, l.onCurve);
      for (var v, x, g = 0; g < i; g++) l = u[g], v || (v = l, f.push(g)), l.lastPointOfContour ? (l.nextPointOnContour = v, v.prevPointOnContour = l, v = void 0) : (x = u[g + 1], l.nextPointOnContour = x, x.prevPointOnContour = l);
      if (!r.inhibitGridFit) {
        if (s.DEBUG) {
          console.log("PROCESSING GLYPH", r.stack);
          for (var y = 0; y < i; y++) console.log(y, u[y].x, u[y].y);
        }
        if (u.push(new Le(0, 0), new Le(Math.round(e.advanceWidth * t), 0)), ze(r), u.length -= 2, s.DEBUG) {
          console.log("FINISHED GLYPH", r.stack);
          for (var T = 0; T < i; T++) console.log(T, u[T].x, u[T].y);
        }
      }
    }, ze = function (e) {
      var r = e.prog;
      if (r) {
        var t = r.length,
          n;
        for (e.ip = 0; e.ip < t; e.ip++) {
          if (s.DEBUG && e.step++, n = Kn[r[e.ip]], !n) throw new Error("unknown instruction: 0x" + Number(r[e.ip]).toString(16));
          n(e);
        }
      }
    };
    function Br(e) {
      for (var r = e.tZone = new Array(e.gZone.length), t = 0; t < r.length; t++) r[t] = new Le(0, 0);
    }
    function na(e, r) {
      var t = e.prog,
        n = e.ip,
        a = 1,
        i;
      do if (i = t[++n], i === 88) a++;else if (i === 89) a--;else if (i === 64) n += t[n + 1] + 1;else if (i === 65) n += 2 * t[n + 1] + 1;else if (i >= 176 && i <= 183) n += i - 176 + 1;else if (i >= 184 && i <= 191) n += (i - 184 + 1) * 2;else if (r && a === 1 && i === 27) break; while (a > 0);
      e.ip = n;
    }
    function aa(e, r) {
      s.DEBUG && console.log(r.step, "SVTCA[" + e.axis + "]"), r.fv = r.pv = r.dpv = e;
    }
    function sa(e, r) {
      s.DEBUG && console.log(r.step, "SPVTCA[" + e.axis + "]"), r.pv = r.dpv = e;
    }
    function ia(e, r) {
      s.DEBUG && console.log(r.step, "SFVTCA[" + e.axis + "]"), r.fv = e;
    }
    function oa(e, r) {
      var t = r.stack,
        n = t.pop(),
        a = t.pop(),
        i = r.z2[n],
        u = r.z1[a];
      s.DEBUG && console.log("SPVTL[" + e + "]", n, a);
      var f, l;
      e ? (f = i.y - u.y, l = u.x - i.x) : (f = u.x - i.x, l = u.y - i.y), r.pv = r.dpv = cr(f, l);
    }
    function ua(e, r) {
      var t = r.stack,
        n = t.pop(),
        a = t.pop(),
        i = r.z2[n],
        u = r.z1[a];
      s.DEBUG && console.log("SFVTL[" + e + "]", n, a);
      var f, l;
      e ? (f = i.y - u.y, l = u.x - i.x) : (f = u.x - i.x, l = u.y - i.y), r.fv = cr(f, l);
    }
    function oo(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "SPVFS[]", t, n), e.pv = e.dpv = cr(n, t);
    }
    function uo(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "SPVFS[]", t, n), e.fv = cr(n, t);
    }
    function lo(e) {
      var r = e.stack,
        t = e.pv;
      s.DEBUG && console.log(e.step, "GPV[]"), r.push(t.x * 16384), r.push(t.y * 16384);
    }
    function fo(e) {
      var r = e.stack,
        t = e.fv;
      s.DEBUG && console.log(e.step, "GFV[]"), r.push(t.x * 16384), r.push(t.y * 16384);
    }
    function co(e) {
      e.fv = e.pv, s.DEBUG && console.log(e.step, "SFVTPV[]");
    }
    function ho(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop(),
        a = r.pop(),
        i = r.pop(),
        u = r.pop(),
        f = e.z0,
        l = e.z1,
        d = f[t],
        v = f[n],
        x = l[a],
        g = l[i],
        y = e.z2[u];
      s.DEBUG && console.log("ISECT[], ", t, n, a, i, u);
      var T = d.x,
        w = d.y,
        E = v.x,
        O = v.y,
        G = x.x,
        C = x.y,
        _ = g.x,
        R = g.y,
        M = (T - E) * (C - R) - (w - O) * (G - _),
        ce = T * O - w * E,
        Y = G * R - C * _;
      y.x = (ce * (G - _) - Y * (T - E)) / M, y.y = (ce * (C - R) - Y * (w - O)) / M;
    }
    function po(e) {
      e.rp0 = e.stack.pop(), s.DEBUG && console.log(e.step, "SRP0[]", e.rp0);
    }
    function vo(e) {
      e.rp1 = e.stack.pop(), s.DEBUG && console.log(e.step, "SRP1[]", e.rp1);
    }
    function go(e) {
      e.rp2 = e.stack.pop(), s.DEBUG && console.log(e.step, "SRP2[]", e.rp2);
    }
    function mo(e) {
      var r = e.stack.pop();
      switch (s.DEBUG && console.log(e.step, "SZP0[]", r), e.zp0 = r, r) {
        case 0:
          e.tZone || Br(e), e.z0 = e.tZone;
          break;
        case 1:
          e.z0 = e.gZone;
          break;
        default:
          throw new Error("Invalid zone pointer");
      }
    }
    function yo(e) {
      var r = e.stack.pop();
      switch (s.DEBUG && console.log(e.step, "SZP1[]", r), e.zp1 = r, r) {
        case 0:
          e.tZone || Br(e), e.z1 = e.tZone;
          break;
        case 1:
          e.z1 = e.gZone;
          break;
        default:
          throw new Error("Invalid zone pointer");
      }
    }
    function xo(e) {
      var r = e.stack.pop();
      switch (s.DEBUG && console.log(e.step, "SZP2[]", r), e.zp2 = r, r) {
        case 0:
          e.tZone || Br(e), e.z2 = e.tZone;
          break;
        case 1:
          e.z2 = e.gZone;
          break;
        default:
          throw new Error("Invalid zone pointer");
      }
    }
    function bo(e) {
      var r = e.stack.pop();
      switch (s.DEBUG && console.log(e.step, "SZPS[]", r), e.zp0 = e.zp1 = e.zp2 = r, r) {
        case 0:
          e.tZone || Br(e), e.z0 = e.z1 = e.z2 = e.tZone;
          break;
        case 1:
          e.z0 = e.z1 = e.z2 = e.gZone;
          break;
        default:
          throw new Error("Invalid zone pointer");
      }
    }
    function So(e) {
      e.loop = e.stack.pop(), s.DEBUG && console.log(e.step, "SLOOP[]", e.loop);
    }
    function Fo(e) {
      s.DEBUG && console.log(e.step, "RTG[]"), e.round = ra;
    }
    function To(e) {
      s.DEBUG && console.log(e.step, "RTHG[]"), e.round = no;
    }
    function Uo(e) {
      var r = e.stack.pop();
      s.DEBUG && console.log(e.step, "SMD[]", r), e.minDis = r / 64;
    }
    function Eo(e) {
      s.DEBUG && console.log(e.step, "ELSE[]"), na(e, !1);
    }
    function ko(e) {
      var r = e.stack.pop();
      s.DEBUG && console.log(e.step, "JMPR[]", r), e.ip += r - 1;
    }
    function Oo(e) {
      var r = e.stack.pop();
      s.DEBUG && console.log(e.step, "SCVTCI[]", r), e.cvCutIn = r / 64;
    }
    function wo(e) {
      var r = e.stack;
      s.DEBUG && console.log(e.step, "DUP[]"), r.push(r[r.length - 1]);
    }
    function ht(e) {
      s.DEBUG && console.log(e.step, "POP[]"), e.stack.pop();
    }
    function Co(e) {
      s.DEBUG && console.log(e.step, "CLEAR[]"), e.stack.length = 0;
    }
    function Lo(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "SWAP[]"), r.push(t), r.push(n);
    }
    function Io(e) {
      var r = e.stack;
      s.DEBUG && console.log(e.step, "DEPTH[]"), r.push(r.length);
    }
    function Ao(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "LOOPCALL[]", t, n);
      var a = e.ip,
        i = e.prog;
      e.prog = e.funcs[t];
      for (var u = 0; u < n; u++) ze(e), s.DEBUG && console.log(++e.step, u + 1 < n ? "next loopcall" : "done loopcall", u);
      e.ip = a, e.prog = i;
    }
    function Bo(e) {
      var r = e.stack.pop();
      s.DEBUG && console.log(e.step, "CALL[]", r);
      var t = e.ip,
        n = e.prog;
      e.prog = e.funcs[r], ze(e), e.ip = t, e.prog = n, s.DEBUG && console.log(++e.step, "returning from", r);
    }
    function Ro(e) {
      var r = e.stack,
        t = r.pop();
      s.DEBUG && console.log(e.step, "CINDEX[]", t), r.push(r[r.length - t]);
    }
    function Do(e) {
      var r = e.stack,
        t = r.pop();
      s.DEBUG && console.log(e.step, "MINDEX[]", t), r.push(r.splice(r.length - t, 1)[0]);
    }
    function Po(e) {
      if (e.env !== "fpgm") throw new Error("FDEF not allowed here");
      var r = e.stack,
        t = e.prog,
        n = e.ip,
        a = r.pop(),
        i = n;
      for (s.DEBUG && console.log(e.step, "FDEF[]", a); t[++n] !== 45;);
      e.ip = n, e.funcs[a] = t.slice(i + 1, n);
    }
    function la(e, r) {
      var t = r.stack.pop(),
        n = r.z0[t],
        a = r.fv,
        i = r.pv;
      s.DEBUG && console.log(r.step, "MDAP[" + e + "]", t);
      var u = i.distance(n, hr);
      e && (u = r.round(u)), a.setRelative(n, hr, u, i), a.touch(n), r.rp0 = r.rp1 = t;
    }
    function fa(e, r) {
      var t = r.z2,
        n = t.length - 2,
        a,
        i,
        u;
      s.DEBUG && console.log(r.step, "IUP[" + e.axis + "]");
      for (var f = 0; f < n; f++) a = t[f], !e.touched(a) && (i = a.prevTouched(e), i !== a && (u = a.nextTouched(e), i === u && e.setRelative(a, a, e.distance(i, i, !1, !0), e, !0), e.interpolate(a, i, u, e)));
    }
    function ca(e, r) {
      for (var t = r.stack, n = e ? r.rp1 : r.rp2, a = (e ? r.z0 : r.z1)[n], i = r.fv, u = r.pv, f = r.loop, l = r.z2; f--;) {
        var d = t.pop(),
          v = l[d],
          x = u.distance(a, a, !1, !0);
        i.setRelative(v, v, x, u), i.touch(v), s.DEBUG && console.log(r.step, (r.loop > 1 ? "loop " + (r.loop - f) + ": " : "") + "SHP[" + (e ? "rp1" : "rp2") + "]", d);
      }
      r.loop = 1;
    }
    function ha(e, r) {
      var t = r.stack,
        n = e ? r.rp1 : r.rp2,
        a = (e ? r.z0 : r.z1)[n],
        i = r.fv,
        u = r.pv,
        f = t.pop(),
        l = r.z2[r.contours[f]],
        d = l;
      s.DEBUG && console.log(r.step, "SHC[" + e + "]", f);
      var v = u.distance(a, a, !1, !0);
      do d !== a && i.setRelative(d, d, v, u), d = d.nextPointOnContour; while (d !== l);
    }
    function pa(e, r) {
      var t = r.stack,
        n = e ? r.rp1 : r.rp2,
        a = (e ? r.z0 : r.z1)[n],
        i = r.fv,
        u = r.pv,
        f = t.pop();
      s.DEBUG && console.log(r.step, "SHZ[" + e + "]", f);
      var l;
      switch (f) {
        case 0:
          l = r.tZone;
          break;
        case 1:
          l = r.gZone;
          break;
        default:
          throw new Error("Invalid zone");
      }
      for (var d, v = u.distance(a, a, !1, !0), x = l.length - 2, g = 0; g < x; g++) d = l[g], i.setRelative(d, d, v, u);
    }
    function Mo(e) {
      for (var r = e.stack, t = e.loop, n = e.fv, a = r.pop() / 64, i = e.z2; t--;) {
        var u = r.pop(),
          f = i[u];
        s.DEBUG && console.log(e.step, (e.loop > 1 ? "loop " + (e.loop - t) + ": " : "") + "SHPIX[]", u, a), n.setRelative(f, f, a), n.touch(f);
      }
      e.loop = 1;
    }
    function Go(e) {
      for (var r = e.stack, t = e.rp1, n = e.rp2, a = e.loop, i = e.z0[t], u = e.z1[n], f = e.fv, l = e.dpv, d = e.z2; a--;) {
        var v = r.pop(),
          x = d[v];
        s.DEBUG && console.log(e.step, (e.loop > 1 ? "loop " + (e.loop - a) + ": " : "") + "IP[]", v, t, "<->", n), f.interpolate(x, i, u, l), f.touch(x);
      }
      e.loop = 1;
    }
    function da(e, r) {
      var t = r.stack,
        n = t.pop() / 64,
        a = t.pop(),
        i = r.z1[a],
        u = r.z0[r.rp0],
        f = r.fv,
        l = r.pv;
      f.setRelative(i, u, n, l), f.touch(i), s.DEBUG && console.log(r.step, "MSIRP[" + e + "]", n, a), r.rp1 = r.rp0, r.rp2 = a, e && (r.rp0 = a);
    }
    function No(e) {
      for (var r = e.stack, t = e.rp0, n = e.z0[t], a = e.loop, i = e.fv, u = e.pv, f = e.z1; a--;) {
        var l = r.pop(),
          d = f[l];
        s.DEBUG && console.log(e.step, (e.loop > 1 ? "loop " + (e.loop - a) + ": " : "") + "ALIGNRP[]", l), i.setRelative(d, n, 0, u), i.touch(d);
      }
      e.loop = 1;
    }
    function _o(e) {
      s.DEBUG && console.log(e.step, "RTDG[]"), e.round = to;
    }
    function va(e, r) {
      var t = r.stack,
        n = t.pop(),
        a = t.pop(),
        i = r.z0[a],
        u = r.fv,
        f = r.pv,
        l = r.cvt[n];
      s.DEBUG && console.log(r.step, "MIAP[" + e + "]", n, "(", l, ")", a);
      var d = f.distance(i, hr);
      e && (Math.abs(d - l) < r.cvCutIn && (d = l), d = r.round(d)), u.setRelative(i, hr, d, f), r.zp0 === 0 && (i.xo = i.x, i.yo = i.y), u.touch(i), r.rp0 = r.rp1 = a;
    }
    function Ho(e) {
      var r = e.prog,
        t = e.ip,
        n = e.stack,
        a = r[++t];
      s.DEBUG && console.log(e.step, "NPUSHB[]", a);
      for (var i = 0; i < a; i++) n.push(r[++t]);
      e.ip = t;
    }
    function zo(e) {
      var r = e.ip,
        t = e.prog,
        n = e.stack,
        a = t[++r];
      s.DEBUG && console.log(e.step, "NPUSHW[]", a);
      for (var i = 0; i < a; i++) {
        var u = t[++r] << 8 | t[++r];
        u & 32768 && (u = -((u ^ 65535) + 1)), n.push(u);
      }
      e.ip = r;
    }
    function qo(e) {
      var r = e.stack,
        t = e.store;
      t || (t = e.store = []);
      var n = r.pop(),
        a = r.pop();
      s.DEBUG && console.log(e.step, "WS", n, a), t[a] = n;
    }
    function Wo(e) {
      var r = e.stack,
        t = e.store,
        n = r.pop();
      s.DEBUG && console.log(e.step, "RS", n);
      var a = t && t[n] || 0;
      r.push(a);
    }
    function Vo(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "WCVTP", t, n), e.cvt[n] = t / 64;
    }
    function Xo(e) {
      var r = e.stack,
        t = r.pop();
      s.DEBUG && console.log(e.step, "RCVT", t), r.push(e.cvt[t] * 64);
    }
    function ga(e, r) {
      var t = r.stack,
        n = t.pop(),
        a = r.z2[n];
      s.DEBUG && console.log(r.step, "GC[" + e + "]", n), t.push(r.dpv.distance(a, hr, e, !1) * 64);
    }
    function ma(e, r) {
      var t = r.stack,
        n = t.pop(),
        a = t.pop(),
        i = r.z1[n],
        u = r.z0[a],
        f = r.dpv.distance(u, i, e, e);
      s.DEBUG && console.log(r.step, "MD[" + e + "]", n, a, "->", f), r.stack.push(Math.round(f * 64));
    }
    function Yo(e) {
      s.DEBUG && console.log(e.step, "MPPEM[]"), e.stack.push(e.ppem);
    }
    function jo(e) {
      s.DEBUG && console.log(e.step, "FLIPON[]"), e.autoFlip = !0;
    }
    function Zo(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "LT[]", t, n), r.push(n < t ? 1 : 0);
    }
    function Qo(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "LTEQ[]", t, n), r.push(n <= t ? 1 : 0);
    }
    function Jo(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "GT[]", t, n), r.push(n > t ? 1 : 0);
    }
    function Ko(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "GTEQ[]", t, n), r.push(n >= t ? 1 : 0);
    }
    function $o(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "EQ[]", t, n), r.push(t === n ? 1 : 0);
    }
    function eu(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "NEQ[]", t, n), r.push(t !== n ? 1 : 0);
    }
    function ru(e) {
      var r = e.stack,
        t = r.pop();
      s.DEBUG && console.log(e.step, "ODD[]", t), r.push(Math.trunc(t) % 2 ? 1 : 0);
    }
    function tu(e) {
      var r = e.stack,
        t = r.pop();
      s.DEBUG && console.log(e.step, "EVEN[]", t), r.push(Math.trunc(t) % 2 ? 0 : 1);
    }
    function nu(e) {
      var r = e.stack.pop(),
        t;
      s.DEBUG && console.log(e.step, "IF[]", r), r || (na(e, !0), s.DEBUG && console.log(e.step, t === 27 ? "ELSE[]" : "EIF[]"));
    }
    function au(e) {
      s.DEBUG && console.log(e.step, "EIF[]");
    }
    function su(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "AND[]", t, n), r.push(t && n ? 1 : 0);
    }
    function iu(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "OR[]", t, n), r.push(t || n ? 1 : 0);
    }
    function ou(e) {
      var r = e.stack,
        t = r.pop();
      s.DEBUG && console.log(e.step, "NOT[]", t), r.push(t ? 0 : 1);
    }
    function pt(e, r) {
      var t = r.stack,
        n = t.pop(),
        a = r.fv,
        i = r.pv,
        u = r.ppem,
        f = r.deltaBase + (e - 1) * 16,
        l = r.deltaShift,
        d = r.z0;
      s.DEBUG && console.log(r.step, "DELTAP[" + e + "]", n, t);
      for (var v = 0; v < n; v++) {
        var x = t.pop(),
          g = t.pop(),
          y = f + ((g & 240) >> 4);
        if (y === u) {
          var T = (g & 15) - 8;
          T >= 0 && T++, s.DEBUG && console.log(r.step, "DELTAPFIX", x, "by", T * l);
          var w = d[x];
          a.setRelative(w, w, T * l, i);
        }
      }
    }
    function uu(e) {
      var r = e.stack,
        t = r.pop();
      s.DEBUG && console.log(e.step, "SDB[]", t), e.deltaBase = t;
    }
    function lu(e) {
      var r = e.stack,
        t = r.pop();
      s.DEBUG && console.log(e.step, "SDS[]", t), e.deltaShift = Math.pow(.5, t);
    }
    function fu(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "ADD[]", t, n), r.push(n + t);
    }
    function cu(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "SUB[]", t, n), r.push(n - t);
    }
    function hu(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "DIV[]", t, n), r.push(n * 64 / t);
    }
    function pu(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "MUL[]", t, n), r.push(n * t / 64);
    }
    function du(e) {
      var r = e.stack,
        t = r.pop();
      s.DEBUG && console.log(e.step, "ABS[]", t), r.push(Math.abs(t));
    }
    function vu(e) {
      var r = e.stack,
        t = r.pop();
      s.DEBUG && console.log(e.step, "NEG[]", t), r.push(-t);
    }
    function gu(e) {
      var r = e.stack,
        t = r.pop();
      s.DEBUG && console.log(e.step, "FLOOR[]", t), r.push(Math.floor(t / 64) * 64);
    }
    function mu(e) {
      var r = e.stack,
        t = r.pop();
      s.DEBUG && console.log(e.step, "CEILING[]", t), r.push(Math.ceil(t / 64) * 64);
    }
    function Rr(e, r) {
      var t = r.stack,
        n = t.pop();
      s.DEBUG && console.log(r.step, "ROUND[]"), t.push(r.round(n / 64) * 64);
    }
    function yu(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "WCVTF[]", t, n), e.cvt[n] = t * e.ppem / e.font.unitsPerEm;
    }
    function dt(e, r) {
      var t = r.stack,
        n = t.pop(),
        a = r.ppem,
        i = r.deltaBase + (e - 1) * 16,
        u = r.deltaShift;
      s.DEBUG && console.log(r.step, "DELTAC[" + e + "]", n, t);
      for (var f = 0; f < n; f++) {
        var l = t.pop(),
          d = t.pop(),
          v = i + ((d & 240) >> 4);
        if (v === a) {
          var x = (d & 15) - 8;
          x >= 0 && x++;
          var g = x * u;
          s.DEBUG && console.log(r.step, "DELTACFIX", l, "by", g), r.cvt[l] += g;
        }
      }
    }
    function xu(e) {
      var r = e.stack.pop();
      s.DEBUG && console.log(e.step, "SROUND[]", r), e.round = ta;
      var t;
      switch (r & 192) {
        case 0:
          t = .5;
          break;
        case 64:
          t = 1;
          break;
        case 128:
          t = 2;
          break;
        default:
          throw new Error("invalid SROUND value");
      }
      switch (e.srPeriod = t, r & 48) {
        case 0:
          e.srPhase = 0;
          break;
        case 16:
          e.srPhase = .25 * t;
          break;
        case 32:
          e.srPhase = .5 * t;
          break;
        case 48:
          e.srPhase = .75 * t;
          break;
        default:
          throw new Error("invalid SROUND value");
      }
      r &= 15, r === 0 ? e.srThreshold = 0 : e.srThreshold = (r / 8 - .5) * t;
    }
    function bu(e) {
      var r = e.stack.pop();
      s.DEBUG && console.log(e.step, "S45ROUND[]", r), e.round = ta;
      var t;
      switch (r & 192) {
        case 0:
          t = Math.sqrt(2) / 2;
          break;
        case 64:
          t = Math.sqrt(2);
          break;
        case 128:
          t = 2 * Math.sqrt(2);
          break;
        default:
          throw new Error("invalid S45ROUND value");
      }
      switch (e.srPeriod = t, r & 48) {
        case 0:
          e.srPhase = 0;
          break;
        case 16:
          e.srPhase = .25 * t;
          break;
        case 32:
          e.srPhase = .5 * t;
          break;
        case 48:
          e.srPhase = .75 * t;
          break;
        default:
          throw new Error("invalid S45ROUND value");
      }
      r &= 15, r === 0 ? e.srThreshold = 0 : e.srThreshold = (r / 8 - .5) * t;
    }
    function Su(e) {
      s.DEBUG && console.log(e.step, "ROFF[]"), e.round = ro;
    }
    function Fu(e) {
      s.DEBUG && console.log(e.step, "RUTG[]"), e.round = ao;
    }
    function Tu(e) {
      s.DEBUG && console.log(e.step, "RDTG[]"), e.round = so;
    }
    function Uu(e) {
      var r = e.stack.pop();
      s.DEBUG && console.log(e.step, "SCANCTRL[]", r);
    }
    function ya(e, r) {
      var t = r.stack,
        n = t.pop(),
        a = t.pop(),
        i = r.z2[n],
        u = r.z1[a];
      s.DEBUG && console.log(r.step, "SDPVTL[" + e + "]", n, a);
      var f, l;
      e ? (f = i.y - u.y, l = u.x - i.x) : (f = u.x - i.x, l = u.y - i.y), r.dpv = cr(f, l);
    }
    function Eu(e) {
      var r = e.stack,
        t = r.pop(),
        n = 0;
      s.DEBUG && console.log(e.step, "GETINFO[]", t), t & 1 && (n = 35), t & 32 && (n |= 4096), r.push(n);
    }
    function ku(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop(),
        a = r.pop();
      s.DEBUG && console.log(e.step, "ROLL[]"), r.push(n), r.push(t), r.push(a);
    }
    function Ou(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "MAX[]", t, n), r.push(Math.max(n, t));
    }
    function wu(e) {
      var r = e.stack,
        t = r.pop(),
        n = r.pop();
      s.DEBUG && console.log(e.step, "MIN[]", t, n), r.push(Math.min(n, t));
    }
    function Cu(e) {
      var r = e.stack.pop();
      s.DEBUG && console.log(e.step, "SCANTYPE[]", r);
    }
    function Lu(e) {
      var r = e.stack.pop(),
        t = e.stack.pop();
      switch (s.DEBUG && console.log(e.step, "INSTCTRL[]", r, t), r) {
        case 1:
          e.inhibitGridFit = !!t;
          return;
        case 2:
          e.ignoreCvt = !!t;
          return;
        default:
          throw new Error("invalid INSTCTRL[] selector");
      }
    }
    function Pe(e, r) {
      var t = r.stack,
        n = r.prog,
        a = r.ip;
      s.DEBUG && console.log(r.step, "PUSHB[" + e + "]");
      for (var i = 0; i < e; i++) t.push(n[++a]);
      r.ip = a;
    }
    function Me(e, r) {
      var t = r.ip,
        n = r.prog,
        a = r.stack;
      s.DEBUG && console.log(r.ip, "PUSHW[" + e + "]");
      for (var i = 0; i < e; i++) {
        var u = n[++t] << 8 | n[++t];
        u & 32768 && (u = -((u ^ 65535) + 1)), a.push(u);
      }
      r.ip = t;
    }
    function L(e, r, t, n, a, i) {
      var u = i.stack,
        f = e && u.pop(),
        l = u.pop(),
        d = i.rp0,
        v = i.z0[d],
        x = i.z1[l],
        g = i.minDis,
        y = i.fv,
        T = i.dpv,
        w,
        E,
        O,
        G;
      E = w = T.distance(x, v, !0, !0), O = E >= 0 ? 1 : -1, E = Math.abs(E), e && (G = i.cvt[f], n && Math.abs(E - G) < i.cvCutIn && (E = G)), t && E < g && (E = g), n && (E = i.round(E)), y.setRelative(x, v, O * E, T), y.touch(x), s.DEBUG && console.log(i.step, (e ? "MIRP[" : "MDRP[") + (r ? "M" : "m") + (t ? ">" : "_") + (n ? "R" : "_") + (a === 0 ? "Gr" : a === 1 ? "Bl" : a === 2 ? "Wh" : "") + "]", e ? f + "(" + i.cvt[f] + "," + G + ")" : "", l, "(d =", w, "->", O * E, ")"), i.rp1 = i.rp0, i.rp2 = l, r && (i.rp0 = l);
    }
    Kn = [aa.bind(void 0, Ce), aa.bind(void 0, ke), sa.bind(void 0, Ce), sa.bind(void 0, ke), ia.bind(void 0, Ce), ia.bind(void 0, ke), oa.bind(void 0, 0), oa.bind(void 0, 1), ua.bind(void 0, 0), ua.bind(void 0, 1), oo, uo, lo, fo, co, ho, po, vo, go, mo, yo, xo, bo, So, Fo, To, Uo, Eo, ko, Oo, void 0, void 0, wo, ht, Co, Lo, Io, Ro, Do, void 0, void 0, void 0, Ao, Bo, Po, void 0, la.bind(void 0, 0), la.bind(void 0, 1), fa.bind(void 0, Ce), fa.bind(void 0, ke), ca.bind(void 0, 0), ca.bind(void 0, 1), ha.bind(void 0, 0), ha.bind(void 0, 1), pa.bind(void 0, 0), pa.bind(void 0, 1), Mo, Go, da.bind(void 0, 0), da.bind(void 0, 1), No, _o, va.bind(void 0, 0), va.bind(void 0, 1), Ho, zo, qo, Wo, Vo, Xo, ga.bind(void 0, 0), ga.bind(void 0, 1), void 0, ma.bind(void 0, 0), ma.bind(void 0, 1), Yo, void 0, jo, void 0, void 0, Zo, Qo, Jo, Ko, $o, eu, ru, tu, nu, au, su, iu, ou, pt.bind(void 0, 1), uu, lu, fu, cu, hu, pu, du, vu, gu, mu, Rr.bind(void 0, 0), Rr.bind(void 0, 1), Rr.bind(void 0, 2), Rr.bind(void 0, 3), void 0, void 0, void 0, void 0, yu, pt.bind(void 0, 2), pt.bind(void 0, 3), dt.bind(void 0, 1), dt.bind(void 0, 2), dt.bind(void 0, 3), xu, bu, void 0, void 0, Su, void 0, Fu, Tu, ht, ht, void 0, void 0, void 0, void 0, void 0, Uu, ya.bind(void 0, 0), ya.bind(void 0, 1), Eu, void 0, ku, Ou, wu, Cu, Lu, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, Pe.bind(void 0, 1), Pe.bind(void 0, 2), Pe.bind(void 0, 3), Pe.bind(void 0, 4), Pe.bind(void 0, 5), Pe.bind(void 0, 6), Pe.bind(void 0, 7), Pe.bind(void 0, 8), Me.bind(void 0, 1), Me.bind(void 0, 2), Me.bind(void 0, 3), Me.bind(void 0, 4), Me.bind(void 0, 5), Me.bind(void 0, 6), Me.bind(void 0, 7), Me.bind(void 0, 8), L.bind(void 0, 0, 0, 0, 0, 0), L.bind(void 0, 0, 0, 0, 0, 1), L.bind(void 0, 0, 0, 0, 0, 2), L.bind(void 0, 0, 0, 0, 0, 3), L.bind(void 0, 0, 0, 0, 1, 0), L.bind(void 0, 0, 0, 0, 1, 1), L.bind(void 0, 0, 0, 0, 1, 2), L.bind(void 0, 0, 0, 0, 1, 3), L.bind(void 0, 0, 0, 1, 0, 0), L.bind(void 0, 0, 0, 1, 0, 1), L.bind(void 0, 0, 0, 1, 0, 2), L.bind(void 0, 0, 0, 1, 0, 3), L.bind(void 0, 0, 0, 1, 1, 0), L.bind(void 0, 0, 0, 1, 1, 1), L.bind(void 0, 0, 0, 1, 1, 2), L.bind(void 0, 0, 0, 1, 1, 3), L.bind(void 0, 0, 1, 0, 0, 0), L.bind(void 0, 0, 1, 0, 0, 1), L.bind(void 0, 0, 1, 0, 0, 2), L.bind(void 0, 0, 1, 0, 0, 3), L.bind(void 0, 0, 1, 0, 1, 0), L.bind(void 0, 0, 1, 0, 1, 1), L.bind(void 0, 0, 1, 0, 1, 2), L.bind(void 0, 0, 1, 0, 1, 3), L.bind(void 0, 0, 1, 1, 0, 0), L.bind(void 0, 0, 1, 1, 0, 1), L.bind(void 0, 0, 1, 1, 0, 2), L.bind(void 0, 0, 1, 1, 0, 3), L.bind(void 0, 0, 1, 1, 1, 0), L.bind(void 0, 0, 1, 1, 1, 1), L.bind(void 0, 0, 1, 1, 1, 2), L.bind(void 0, 0, 1, 1, 1, 3), L.bind(void 0, 1, 0, 0, 0, 0), L.bind(void 0, 1, 0, 0, 0, 1), L.bind(void 0, 1, 0, 0, 0, 2), L.bind(void 0, 1, 0, 0, 0, 3), L.bind(void 0, 1, 0, 0, 1, 0), L.bind(void 0, 1, 0, 0, 1, 1), L.bind(void 0, 1, 0, 0, 1, 2), L.bind(void 0, 1, 0, 0, 1, 3), L.bind(void 0, 1, 0, 1, 0, 0), L.bind(void 0, 1, 0, 1, 0, 1), L.bind(void 0, 1, 0, 1, 0, 2), L.bind(void 0, 1, 0, 1, 0, 3), L.bind(void 0, 1, 0, 1, 1, 0), L.bind(void 0, 1, 0, 1, 1, 1), L.bind(void 0, 1, 0, 1, 1, 2), L.bind(void 0, 1, 0, 1, 1, 3), L.bind(void 0, 1, 1, 0, 0, 0), L.bind(void 0, 1, 1, 0, 0, 1), L.bind(void 0, 1, 1, 0, 0, 2), L.bind(void 0, 1, 1, 0, 0, 3), L.bind(void 0, 1, 1, 0, 1, 0), L.bind(void 0, 1, 1, 0, 1, 1), L.bind(void 0, 1, 1, 0, 1, 2), L.bind(void 0, 1, 1, 0, 1, 3), L.bind(void 0, 1, 1, 1, 0, 0), L.bind(void 0, 1, 1, 1, 0, 1), L.bind(void 0, 1, 1, 1, 0, 2), L.bind(void 0, 1, 1, 1, 0, 3), L.bind(void 0, 1, 1, 1, 1, 0), L.bind(void 0, 1, 1, 1, 1, 1), L.bind(void 0, 1, 1, 1, 1, 2), L.bind(void 0, 1, 1, 1, 1, 3)];
    function V(e) {
      e = e || {}, e.empty || ($e(e.familyName, "When creating a new Font object, familyName is required."), $e(e.styleName, "When creating a new Font object, styleName is required."), $e(e.unitsPerEm, "When creating a new Font object, unitsPerEm is required."), $e(e.ascender, "When creating a new Font object, ascender is required."), $e(e.descender, "When creating a new Font object, descender is required."), $e(e.descender < 0, "Descender should be negative (e.g. -512)."), this.names = {
        fontFamily: {
          en: e.familyName || " "
        },
        fontSubfamily: {
          en: e.styleName || " "
        },
        fullName: {
          en: e.fullName || e.familyName + " " + e.styleName
        },
        postScriptName: {
          en: e.postScriptName || e.familyName + e.styleName
        },
        designer: {
          en: e.designer || " "
        },
        designerURL: {
          en: e.designerURL || " "
        },
        manufacturer: {
          en: e.manufacturer || " "
        },
        manufacturerURL: {
          en: e.manufacturerURL || " "
        },
        license: {
          en: e.license || " "
        },
        licenseURL: {
          en: e.licenseURL || " "
        },
        version: {
          en: e.version || "Version 0.1"
        },
        description: {
          en: e.description || " "
        },
        copyright: {
          en: e.copyright || " "
        },
        trademark: {
          en: e.trademark || " "
        }
      }, this.unitsPerEm = e.unitsPerEm || 1e3, this.ascender = e.ascender, this.descender = e.descender, this.createdTimestamp = e.createdTimestamp, this.tables = {
        os2: {
          usWeightClass: e.weightClass || this.usWeightClasses.MEDIUM,
          usWidthClass: e.widthClass || this.usWidthClasses.MEDIUM,
          fsSelection: e.fsSelection || this.fsSelectionValues.REGULAR
        }
      }), this.supported = !0, this.glyphs = new Je.GlyphSet(this, e.glyphs || []), this.encoding = new hn(this), this.position = new Ar(this), this.substitution = new Fe(this), this.tables = this.tables || {}, Object.defineProperty(this, "hinting", {
        get: function () {
          if (this._hinting) return this._hinting;
          if (this.outlinesFormat === "truetype") return this._hinting = new ea(this);
        }
      });
    }
    V.prototype.hasChar = function (e) {
      return this.encoding.charToGlyphIndex(e) !== null;
    }, V.prototype.charToGlyphIndex = function (e) {
      return this.encoding.charToGlyphIndex(e);
    }, V.prototype.charToGlyph = function (e) {
      var r = this.charToGlyphIndex(e),
        t = this.glyphs.get(r);
      return t || (t = this.glyphs.get(0)), t;
    }, V.prototype.stringToGlyphs = function (e, r) {
      var t = this;
      r = r || this.defaultRenderOptions;
      for (var n = [], a = 0; a < e.length; a += 1) {
        var i = e[a];
        n.push(t.charToGlyphIndex(i));
      }
      var u = n.length;
      if (r.features) {
        var f = r.script || this.substitution.getDefaultScriptName(),
          l = [];
        r.features.liga && (l = l.concat(this.substitution.getFeature("liga", f, r.language))), r.features.rlig && (l = l.concat(this.substitution.getFeature("rlig", f, r.language)));
        for (var d = 0; d < u; d += 1) for (var v = 0; v < l.length; v++) {
          for (var x = l[v], g = x.sub, y = g.length, T = 0; T < y && g[T] === n[d + T];) T++;
          T === y && (n.splice(d, y, x.by), u = u - y + 1);
        }
      }
      for (var w = new Array(u), E = this.glyphs.get(0), O = 0; O < u; O += 1) w[O] = t.glyphs.get(n[O]) || E;
      return w;
    }, V.prototype.nameToGlyphIndex = function (e) {
      return this.glyphNames.nameToGlyphIndex(e);
    }, V.prototype.nameToGlyph = function (e) {
      var r = this.nameToGlyphIndex(e),
        t = this.glyphs.get(r);
      return t || (t = this.glyphs.get(0)), t;
    }, V.prototype.glyphIndexToName = function (e) {
      return this.glyphNames.glyphIndexToName ? this.glyphNames.glyphIndexToName(e) : "";
    }, V.prototype.getKerningValue = function (e, r) {
      return e = e.index || e, r = r.index || r, this.kerningPairs[e + "," + r] || 0;
    }, V.prototype.defaultRenderOptions = {
      kerning: !0,
      features: {
        liga: !0,
        rlig: !0
      }
    }, V.prototype.forEachGlyph = function (e, r, t, n, a, i) {
      var u = this;
      r = r !== void 0 ? r : 0, t = t !== void 0 ? t : 0, n = n !== void 0 ? n : 72, a = a || this.defaultRenderOptions;
      var f = 1 / this.unitsPerEm * n,
        l = this.stringToGlyphs(e, a),
        d;
      if (a.kerning) {
        var v = a.script || this.position.getDefaultScriptName();
        d = this.position.getKerningTables(v, a.language);
      }
      for (var x = 0; x < l.length; x += 1) {
        var g = l[x];
        if (i.call(u, g, r, t, n, a), g.advanceWidth && (r += g.advanceWidth * f), a.kerning && x < l.length - 1) {
          var y = d ? u.position.getKerningValue(d, g.index, l[x + 1].index) : u.getKerningValue(g, l[x + 1]);
          r += y * f;
        }
        a.letterSpacing ? r += a.letterSpacing * n : a.tracking && (r += a.tracking / 1e3 * n);
      }
      return r;
    }, V.prototype.getPath = function (e, r, t, n, a) {
      var i = new Q();
      return this.forEachGlyph(e, r, t, n, a, function (u, f, l, d) {
        var v = u.getPath(f, l, d, a, this);
        i.extend(v);
      }), i;
    }, V.prototype.getPaths = function (e, r, t, n, a) {
      var i = [];
      return this.forEachGlyph(e, r, t, n, a, function (u, f, l, d) {
        var v = u.getPath(f, l, d, a, this);
        i.push(v);
      }), i;
    }, V.prototype.getAdvanceWidth = function (e, r, t) {
      return this.forEachGlyph(e, 0, 0, r, t, function () {});
    }, V.prototype.draw = function (e, r, t, n, a, i) {
      this.getPath(r, t, n, a, i).draw(e);
    }, V.prototype.drawPoints = function (e, r, t, n, a, i) {
      this.forEachGlyph(r, t, n, a, i, function (u, f, l, d) {
        u.drawPoints(e, f, l, d);
      });
    }, V.prototype.drawMetrics = function (e, r, t, n, a, i) {
      this.forEachGlyph(r, t, n, a, i, function (u, f, l, d) {
        u.drawMetrics(e, f, l, d);
      });
    }, V.prototype.getEnglishName = function (e) {
      var r = this.names[e];
      if (r) return r.en;
    }, V.prototype.validate = function () {
      var e = [],
        r = this;
      function t(a, i) {
        a || e.push(i);
      }
      function n(a) {
        var i = r.getEnglishName(a);
        t(i && i.trim().length > 0, "No English " + a + " specified.");
      }
      n("fontFamily"), n("weightName"), n("manufacturer"), n("copyright"), n("version"), t(this.unitsPerEm > 0, "No unitsPerEm specified.");
    }, V.prototype.toTables = function () {
      return Ji.fontToTable(this);
    }, V.prototype.toBuffer = function () {
      return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."), this.toArrayBuffer();
    }, V.prototype.toArrayBuffer = function () {
      for (var e = this.toTables(), r = e.encode(), t = new ArrayBuffer(r.length), n = new Uint8Array(t), a = 0; a < r.length; a++) n[a] = r[a];
      return t;
    }, V.prototype.download = function (e) {
      var r = this.getEnglishName("fontFamily"),
        t = this.getEnglishName("fontSubfamily");
      e = e || r.replace(/\s/g, "") + "-" + t + ".otf";
      var n = this.toArrayBuffer();
      if ($i()) window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem, window.requestFileSystem(window.TEMPORARY, n.byteLength, function (u) {
        u.root.getFile(e, {
          create: !0
        }, function (f) {
          f.createWriter(function (l) {
            var d = new DataView(n),
              v = new Blob([d], {
                type: "font/opentype"
              });
            l.write(v), l.addEventListener("writeend", function () {
              location.href = f.toURL();
            }, !1);
          });
        });
      }, function (u) {
        throw new Error(u.name + ": " + u.message);
      });else {
        var a = me("fs"),
          i = eo(n);
        a.writeFileSync(e, i);
      }
    }, V.prototype.fsSelectionValues = {
      ITALIC: 1,
      UNDERSCORE: 2,
      NEGATIVE: 4,
      OUTLINED: 8,
      STRIKEOUT: 16,
      BOLD: 32,
      REGULAR: 64,
      USER_TYPO_METRICS: 128,
      WWS: 256,
      OBLIQUE: 512
    }, V.prototype.usWidthClasses = {
      ULTRA_CONDENSED: 1,
      EXTRA_CONDENSED: 2,
      CONDENSED: 3,
      SEMI_CONDENSED: 4,
      MEDIUM: 5,
      SEMI_EXPANDED: 6,
      EXPANDED: 7,
      EXTRA_EXPANDED: 8,
      ULTRA_EXPANDED: 9
    }, V.prototype.usWeightClasses = {
      THIN: 100,
      EXTRA_LIGHT: 200,
      LIGHT: 300,
      NORMAL: 400,
      MEDIUM: 500,
      SEMI_BOLD: 600,
      BOLD: 700,
      EXTRA_BOLD: 800,
      BLACK: 900
    };
    function xa(e, r) {
      var t = JSON.stringify(e),
        n = 256;
      for (var a in r) {
        var i = parseInt(a);
        if (!(!i || i < 256)) {
          if (JSON.stringify(r[a]) === t) return i;
          n <= i && (n = i + 1);
        }
      }
      return r[n] = e, n;
    }
    function Iu(e, r, t) {
      var n = xa(r.name, t);
      return [{
        name: "tag_" + e,
        type: "TAG",
        value: r.tag
      }, {
        name: "minValue_" + e,
        type: "FIXED",
        value: r.minValue << 16
      }, {
        name: "defaultValue_" + e,
        type: "FIXED",
        value: r.defaultValue << 16
      }, {
        name: "maxValue_" + e,
        type: "FIXED",
        value: r.maxValue << 16
      }, {
        name: "flags_" + e,
        type: "USHORT",
        value: 0
      }, {
        name: "nameID_" + e,
        type: "USHORT",
        value: n
      }];
    }
    function Au(e, r, t) {
      var n = {},
        a = new A.Parser(e, r);
      return n.tag = a.parseTag(), n.minValue = a.parseFixed(), n.defaultValue = a.parseFixed(), n.maxValue = a.parseFixed(), a.skip("uShort", 1), n.name = t[a.parseUShort()] || {}, n;
    }
    function Bu(e, r, t, n) {
      for (var a = xa(r.name, n), i = [{
          name: "nameID_" + e,
          type: "USHORT",
          value: a
        }, {
          name: "flags_" + e,
          type: "USHORT",
          value: 0
        }], u = 0; u < t.length; ++u) {
        var f = t[u].tag;
        i.push({
          name: "axis_" + e + " " + f,
          type: "FIXED",
          value: r.coordinates[f] << 16
        });
      }
      return i;
    }
    function Ru(e, r, t, n) {
      var a = {},
        i = new A.Parser(e, r);
      a.name = n[i.parseUShort()] || {}, i.skip("uShort", 1), a.coordinates = {};
      for (var u = 0; u < t.length; ++u) a.coordinates[t[u].tag] = i.parseFixed();
      return a;
    }
    function Du(e, r) {
      var t = new D.Table("fvar", [{
        name: "version",
        type: "ULONG",
        value: 65536
      }, {
        name: "offsetToData",
        type: "USHORT",
        value: 0
      }, {
        name: "countSizePairs",
        type: "USHORT",
        value: 2
      }, {
        name: "axisCount",
        type: "USHORT",
        value: e.axes.length
      }, {
        name: "axisSize",
        type: "USHORT",
        value: 20
      }, {
        name: "instanceCount",
        type: "USHORT",
        value: e.instances.length
      }, {
        name: "instanceSize",
        type: "USHORT",
        value: 4 + e.axes.length * 4
      }]);
      t.offsetToData = t.sizeOf();
      for (var n = 0; n < e.axes.length; n++) t.fields = t.fields.concat(Iu(n, e.axes[n], r));
      for (var a = 0; a < e.instances.length; a++) t.fields = t.fields.concat(Bu(a, e.instances[a], e.axes, r));
      return t;
    }
    function Pu(e, r, t) {
      var n = new A.Parser(e, r),
        a = n.parseULong();
      N.argument(a === 65536, "Unsupported fvar table version.");
      var i = n.parseOffset16();
      n.skip("uShort", 1);
      for (var u = n.parseUShort(), f = n.parseUShort(), l = n.parseUShort(), d = n.parseUShort(), v = [], x = 0; x < u; x++) v.push(Au(e, r + i + x * f, t));
      for (var g = [], y = r + i + u * f, T = 0; T < l; T++) g.push(Ru(e, y + T * d, v, t));
      return {
        axes: v,
        instances: g
      };
    }
    var Mu = {
        make: Du,
        parse: Pu
      },
      Te = new Array(10);
    Te[1] = function () {
      var r = this.offset + this.relativeOffset,
        t = this.parseUShort();
      if (t === 1) return {
        posFormat: 1,
        coverage: this.parsePointer(S.coverage),
        value: this.parseValueRecord()
      };
      if (t === 2) return {
        posFormat: 2,
        coverage: this.parsePointer(S.coverage),
        values: this.parseValueRecordList()
      };
      N.assert(!1, "0x" + r.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
    }, Te[2] = function () {
      var r = this.offset + this.relativeOffset,
        t = this.parseUShort(),
        n = this.parsePointer(S.coverage),
        a = this.parseUShort(),
        i = this.parseUShort();
      if (t === 1) return {
        posFormat: t,
        coverage: n,
        valueFormat1: a,
        valueFormat2: i,
        pairSets: this.parseList(S.pointer(S.list(function () {
          return {
            secondGlyph: this.parseUShort(),
            value1: this.parseValueRecord(a),
            value2: this.parseValueRecord(i)
          };
        })))
      };
      if (t === 2) {
        var u = this.parsePointer(S.classDef),
          f = this.parsePointer(S.classDef),
          l = this.parseUShort(),
          d = this.parseUShort();
        return {
          posFormat: t,
          coverage: n,
          valueFormat1: a,
          valueFormat2: i,
          classDef1: u,
          classDef2: f,
          class1Count: l,
          class2Count: d,
          classRecords: this.parseList(l, S.list(d, function () {
            return {
              value1: this.parseValueRecord(a),
              value2: this.parseValueRecord(i)
            };
          }))
        };
      }
      N.assert(!1, "0x" + r.toString(16) + ": GPOS lookup type 2 format must be 1 or 2.");
    }, Te[3] = function () {
      return {
        error: "GPOS Lookup 3 not supported"
      };
    }, Te[4] = function () {
      return {
        error: "GPOS Lookup 4 not supported"
      };
    }, Te[5] = function () {
      return {
        error: "GPOS Lookup 5 not supported"
      };
    }, Te[6] = function () {
      return {
        error: "GPOS Lookup 6 not supported"
      };
    }, Te[7] = function () {
      return {
        error: "GPOS Lookup 7 not supported"
      };
    }, Te[8] = function () {
      return {
        error: "GPOS Lookup 8 not supported"
      };
    }, Te[9] = function () {
      return {
        error: "GPOS Lookup 9 not supported"
      };
    };
    function Gu(e, r) {
      r = r || 0;
      var t = new S(e, r),
        n = t.parseVersion(1);
      return N.argument(n === 1 || n === 1.1, "Unsupported GPOS table version " + n), n === 1 ? {
        version: n,
        scripts: t.parseScriptList(),
        features: t.parseFeatureList(),
        lookups: t.parseLookupList(Te)
      } : {
        version: n,
        scripts: t.parseScriptList(),
        features: t.parseFeatureList(),
        lookups: t.parseLookupList(Te),
        variations: t.parseFeatureVariationsList()
      };
    }
    var Nu = new Array(10);
    function _u(e) {
      return new D.Table("GPOS", [{
        name: "version",
        type: "ULONG",
        value: 65536
      }, {
        name: "scripts",
        type: "TABLE",
        value: new D.ScriptList(e.scripts)
      }, {
        name: "features",
        type: "TABLE",
        value: new D.FeatureList(e.features)
      }, {
        name: "lookups",
        type: "TABLE",
        value: new D.LookupList(e.lookups, Nu)
      }]);
    }
    var Hu = {
      parse: Gu,
      make: _u
    };
    function zu(e) {
      var r = {};
      e.skip("uShort");
      var t = e.parseUShort();
      N.argument(t === 0, "Unsupported kern sub-table version."), e.skip("uShort", 2);
      var n = e.parseUShort();
      e.skip("uShort", 3);
      for (var a = 0; a < n; a += 1) {
        var i = e.parseUShort(),
          u = e.parseUShort(),
          f = e.parseShort();
        r[i + "," + u] = f;
      }
      return r;
    }
    function qu(e) {
      var r = {};
      e.skip("uShort");
      var t = e.parseULong();
      t > 1 && console.warn("Only the first kern subtable is supported."), e.skip("uLong");
      var n = e.parseUShort(),
        a = n & 255;
      if (e.skip("uShort"), a === 0) {
        var i = e.parseUShort();
        e.skip("uShort", 3);
        for (var u = 0; u < i; u += 1) {
          var f = e.parseUShort(),
            l = e.parseUShort(),
            d = e.parseShort();
          r[f + "," + l] = d;
        }
      }
      return r;
    }
    function Wu(e, r) {
      var t = new A.Parser(e, r),
        n = t.parseUShort();
      if (n === 0) return zu(t);
      if (n === 1) return qu(t);
      throw new Error("Unsupported kern table version (" + n + ").");
    }
    var Vu = {
      parse: Wu
    };
    function Xu(e, r, t, n) {
      for (var a = new A.Parser(e, r), i = n ? a.parseUShort : a.parseULong, u = [], f = 0; f < t + 1; f += 1) {
        var l = i.call(a);
        n && (l *= 2), u.push(l);
      }
      return u;
    }
    var Yu = {
      parse: Xu
    };
    function ju(e, r) {
      var t = me("fs");
      t.readFile(e, function (n, a) {
        if (n) return r(n.message);
        r(null, Jn(a));
      });
    }
    function Zu(e, r) {
      var t = new XMLHttpRequest();
      t.open("get", e, !0), t.responseType = "arraybuffer", t.onload = function () {
        return t.response ? r(null, t.response) : r("Font could not be loaded: " + t.statusText);
      }, t.onerror = function () {
        r("Font could not be loaded");
      }, t.send();
    }
    function ba(e, r) {
      for (var t = [], n = 12, a = 0; a < r; a += 1) {
        var i = A.getTag(e, n),
          u = A.getULong(e, n + 4),
          f = A.getULong(e, n + 8),
          l = A.getULong(e, n + 12);
        t.push({
          tag: i,
          checksum: u,
          offset: f,
          length: l,
          compression: !1
        }), n += 16;
      }
      return t;
    }
    function Qu(e, r) {
      for (var t = [], n = 44, a = 0; a < r; a += 1) {
        var i = A.getTag(e, n),
          u = A.getULong(e, n + 4),
          f = A.getULong(e, n + 8),
          l = A.getULong(e, n + 12),
          d = void 0;
        f < l ? d = "WOFF" : d = !1, t.push({
          tag: i,
          offset: u,
          compression: d,
          compressedLength: f,
          length: l
        }), n += 20;
      }
      return t;
    }
    function J(e, r) {
      if (r.compression === "WOFF") {
        var t = new Uint8Array(e.buffer, r.offset + 2, r.compressedLength - 2),
          n = new Uint8Array(r.length);
        if (Cs(t, n), n.byteLength !== r.length) throw new Error("Decompression error: " + r.tag + " decompressed length doesn't match recorded length");
        var a = new DataView(n.buffer, 0);
        return {
          data: a,
          offset: 0
        };
      } else return {
        data: e,
        offset: r.offset
      };
    }
    function vt(e) {
      var r,
        t,
        n = new V({
          empty: !0
        }),
        a = new DataView(e, 0),
        i,
        u = [],
        f = A.getTag(a, 0);
      if (f === "\0\0\0" || f === "true" || f === "typ1") n.outlinesFormat = "truetype", i = A.getUShort(a, 4), u = ba(a, i);else if (f === "OTTO") n.outlinesFormat = "cff", i = A.getUShort(a, 4), u = ba(a, i);else if (f === "wOFF") {
        var l = A.getTag(a, 4);
        if (l === "\0\0\0") n.outlinesFormat = "truetype";else if (l === "OTTO") n.outlinesFormat = "cff";else throw new Error("Unsupported OpenType flavor " + f);
        i = A.getUShort(a, 12), u = Qu(a, i);
      } else throw new Error("Unsupported OpenType signature " + f);
      for (var d, v, x, g, y, T, w, E, O, G, C, _ = 0; _ < i; _ += 1) {
        var R = u[_],
          M = void 0;
        switch (R.tag) {
          case "cmap":
            M = J(a, R), n.tables.cmap = cn.parse(M.data, M.offset), n.encoding = new pn(n.tables.cmap);
            break;
          case "cvt ":
            M = J(a, R), C = new A.Parser(M.data, M.offset), n.tables.cvt = C.parseShortList(R.length / 2);
            break;
          case "fvar":
            v = R;
            break;
          case "fpgm":
            M = J(a, R), C = new A.Parser(M.data, M.offset), n.tables.fpgm = C.parseByteList(R.length);
            break;
          case "head":
            M = J(a, R), n.tables.head = Cn.parse(M.data, M.offset), n.unitsPerEm = n.tables.head.unitsPerEm, r = n.tables.head.indexToLocFormat;
            break;
          case "hhea":
            M = J(a, R), n.tables.hhea = Ln.parse(M.data, M.offset), n.ascender = n.tables.hhea.ascender, n.descender = n.tables.hhea.descender, n.numberOfHMetrics = n.tables.hhea.numberOfHMetrics;
            break;
          case "hmtx":
            T = R;
            break;
          case "ltag":
            M = J(a, R), t = An.parse(M.data, M.offset);
            break;
          case "maxp":
            M = J(a, R), n.tables.maxp = Bn.parse(M.data, M.offset), n.numGlyphs = n.tables.maxp.numGlyphs;
            break;
          case "name":
            O = R;
            break;
          case "OS/2":
            M = J(a, R), n.tables.os2 = ut.parse(M.data, M.offset);
            break;
          case "post":
            M = J(a, R), n.tables.post = Hn.parse(M.data, M.offset), n.glyphNames = new rt(n.tables.post);
            break;
          case "prep":
            M = J(a, R), C = new A.Parser(M.data, M.offset), n.tables.prep = C.parseByteList(R.length);
            break;
          case "glyf":
            x = R;
            break;
          case "loca":
            E = R;
            break;
          case "CFF ":
            d = R;
            break;
          case "kern":
            w = R;
            break;
          case "GPOS":
            g = R;
            break;
          case "GSUB":
            y = R;
            break;
          case "meta":
            G = R;
            break;
        }
      }
      var ce = J(a, O);
      if (n.tables.name = _n.parse(ce.data, ce.offset, t), n.names = n.tables.name, x && E) {
        var Y = r === 0,
          $ = J(a, E),
          le = Yu.parse($.data, $.offset, n.numGlyphs, Y),
          he = J(a, x);
        n.glyphs = gn.parse(he.data, he.offset, le, n);
      } else if (d) {
        var de = J(a, d);
        wn.parse(de.data, de.offset, n);
      } else throw new Error("Font doesn't contain TrueType or CFF outlines.");
      var ge = J(a, T);
      if (In.parse(ge.data, ge.offset, n.numberOfHMetrics, n.numGlyphs, n.glyphs), js(n), w) {
        var K = J(a, w);
        n.kerningPairs = Vu.parse(K.data, K.offset);
      } else n.kerningPairs = {};
      if (g) {
        var ee = J(a, g);
        n.tables.gpos = Hu.parse(ee.data, ee.offset);
      }
      if (y) {
        var ne = J(a, y);
        n.tables.gsub = zn.parse(ne.data, ne.offset);
      }
      if (v) {
        var ae = J(a, v);
        n.tables.fvar = Mu.parse(ae.data, ae.offset, n.names);
      }
      if (G) {
        var se = J(a, G);
        n.tables.meta = qn.parse(se.data, se.offset), n.metas = n.tables.meta;
      }
      return n;
    }
    function Ju(e, r) {
      var t = typeof window > "u",
        n = t ? ju : Zu;
      n(e, function (a, i) {
        if (a) return r(a);
        var u;
        try {
          u = vt(i);
        } catch (f) {
          return r(f, null);
        }
        return r(null, u);
      });
    }
    function Ku(e) {
      var r = me("fs"),
        t = r.readFileSync(e);
      return vt(Jn(t));
    }
    s.Font = V, s.Glyph = pe, s.Path = Q, s.BoundingBox = we, s._parse = A, s.parse = vt, s.load = Ju, s.loadSync = Ku, Object.defineProperty(s, "__esModule", {
      value: !0
    });
  });
});
var addon_ligatures_ka = addon_ligatures_q((_f, Ea) => {
  "use strict";

  Ea.exports = function (s) {
    s.prototype[Symbol.iterator] = function* () {
      for (let o = this.head; o; o = o.next) yield o.value;
    };
  };
});
var addon_ligatures_wa = addon_ligatures_q((Hf, Oa) => {
  "use strict";

  Oa.exports = H;
  H.Node = qe;
  H.create = H;
  function H(s) {
    var o = this;
    if (o instanceof H || (o = new H()), o.tail = null, o.head = null, o.length = 0, s && typeof s.forEach == "function") s.forEach(function (p) {
      o.push(p);
    });else if (arguments.length > 0) for (var c = 0, h = arguments.length; c < h; c++) o.push(arguments[c]);
    return o;
  }
  H.prototype.removeNode = function (s) {
    if (s.list !== this) throw new Error("removing node which does not belong to this list");
    var o = s.next,
      c = s.prev;
    return o && (o.prev = c), c && (c.next = o), s === this.head && (this.head = o), s === this.tail && (this.tail = c), s.list.length--, s.next = null, s.prev = null, s.list = null, o;
  };
  H.prototype.unshiftNode = function (s) {
    if (s !== this.head) {
      s.list && s.list.removeNode(s);
      var o = this.head;
      s.list = this, s.next = o, o && (o.prev = s), this.head = s, this.tail || (this.tail = s), this.length++;
    }
  };
  H.prototype.pushNode = function (s) {
    if (s !== this.tail) {
      s.list && s.list.removeNode(s);
      var o = this.tail;
      s.list = this, s.prev = o, o && (o.next = s), this.tail = s, this.head || (this.head = s), this.length++;
    }
  };
  H.prototype.push = function () {
    for (var s = 0, o = arguments.length; s < o; s++) ll(this, arguments[s]);
    return this.length;
  };
  H.prototype.unshift = function () {
    for (var s = 0, o = arguments.length; s < o; s++) fl(this, arguments[s]);
    return this.length;
  };
  H.prototype.pop = function () {
    if (this.tail) {
      var s = this.tail.value;
      return this.tail = this.tail.prev, this.tail ? this.tail.next = null : this.head = null, this.length--, s;
    }
  };
  H.prototype.shift = function () {
    if (this.head) {
      var s = this.head.value;
      return this.head = this.head.next, this.head ? this.head.prev = null : this.tail = null, this.length--, s;
    }
  };
  H.prototype.forEach = function (s, o) {
    o = o || this;
    for (var c = this.head, h = 0; c !== null; h++) s.call(o, c.value, h, this), c = c.next;
  };
  H.prototype.forEachReverse = function (s, o) {
    o = o || this;
    for (var c = this.tail, h = this.length - 1; c !== null; h--) s.call(o, c.value, h, this), c = c.prev;
  };
  H.prototype.get = function (s) {
    for (var o = 0, c = this.head; c !== null && o < s; o++) c = c.next;
    if (o === s && c !== null) return c.value;
  };
  H.prototype.getReverse = function (s) {
    for (var o = 0, c = this.tail; c !== null && o < s; o++) c = c.prev;
    if (o === s && c !== null) return c.value;
  };
  H.prototype.map = function (s, o) {
    o = o || this;
    for (var c = new H(), h = this.head; h !== null;) c.push(s.call(o, h.value, this)), h = h.next;
    return c;
  };
  H.prototype.mapReverse = function (s, o) {
    o = o || this;
    for (var c = new H(), h = this.tail; h !== null;) c.push(s.call(o, h.value, this)), h = h.prev;
    return c;
  };
  H.prototype.reduce = function (s, o) {
    var c,
      h = this.head;
    if (arguments.length > 1) c = o;else if (this.head) h = this.head.next, c = this.head.value;else throw new TypeError("Reduce of empty list with no initial value");
    for (var p = 0; h !== null; p++) c = s(c, h.value, p), h = h.next;
    return c;
  };
  H.prototype.reduceReverse = function (s, o) {
    var c,
      h = this.tail;
    if (arguments.length > 1) c = o;else if (this.tail) h = this.tail.prev, c = this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");
    for (var p = this.length - 1; h !== null; p--) c = s(c, h.value, p), h = h.prev;
    return c;
  };
  H.prototype.toArray = function () {
    for (var s = new Array(this.length), o = 0, c = this.head; c !== null; o++) s[o] = c.value, c = c.next;
    return s;
  };
  H.prototype.toArrayReverse = function () {
    for (var s = new Array(this.length), o = 0, c = this.tail; c !== null; o++) s[o] = c.value, c = c.prev;
    return s;
  };
  H.prototype.slice = function (s, o) {
    o = o || this.length, o < 0 && (o += this.length), s = s || 0, s < 0 && (s += this.length);
    var c = new H();
    if (o < s || o < 0) return c;
    s < 0 && (s = 0), o > this.length && (o = this.length);
    for (var h = 0, p = this.head; p !== null && h < s; h++) p = p.next;
    for (; p !== null && h < o; h++, p = p.next) c.push(p.value);
    return c;
  };
  H.prototype.sliceReverse = function (s, o) {
    o = o || this.length, o < 0 && (o += this.length), s = s || 0, s < 0 && (s += this.length);
    var c = new H();
    if (o < s || o < 0) return c;
    s < 0 && (s = 0), o > this.length && (o = this.length);
    for (var h = this.length, p = this.tail; p !== null && h > o; h--) p = p.prev;
    for (; p !== null && h > s; h--, p = p.prev) c.push(p.value);
    return c;
  };
  H.prototype.splice = function (s, o, ...c) {
    s > this.length && (s = this.length - 1), s < 0 && (s = this.length + s);
    for (var h = 0, p = this.head; p !== null && h < s; h++) p = p.next;
    for (var m = [], h = 0; p && h < o; h++) m.push(p.value), p = this.removeNode(p);
    p === null && (p = this.tail), p !== this.head && p !== this.tail && (p = p.prev);
    for (var h = 0; h < c.length; h++) p = ul(this, p, c[h]);
    return m;
  };
  H.prototype.reverse = function () {
    for (var s = this.head, o = this.tail, c = s; c !== null; c = c.prev) {
      var h = c.prev;
      c.prev = c.next, c.next = h;
    }
    return this.head = o, this.tail = s, this;
  };
  function ul(s, o, c) {
    var h = o === s.head ? new qe(c, null, o, s) : new qe(c, o, o.next, s);
    return h.next === null && (s.tail = h), h.prev === null && (s.head = h), s.length++, h;
  }
  function ll(s, o) {
    s.tail = new qe(o, s.tail, null, s), s.head || (s.head = s.tail), s.length++;
  }
  function fl(s, o) {
    s.head = new qe(o, null, s.head, s), s.tail || (s.tail = s.head), s.length++;
  }
  function qe(s, o, c, h) {
    if (!(this instanceof qe)) return new qe(s, o, c, h);
    this.list = h, this.value = s, o ? (o.next = this, this.prev = o) : this.prev = null, c ? (c.prev = this, this.next = c) : this.next = null;
  }
  try {
    addon_ligatures_ka()(H);
  } catch {}
});
var addon_ligatures_Ba = addon_ligatures_q((zf, Aa) => {
  "use strict";

  var cl = addon_ligatures_wa(),
    We = Symbol("max"),
    Ae = Symbol("length"),
    er = Symbol("lengthCalculator"),
    dr = Symbol("allowStale"),
    Ve = Symbol("maxAge"),
    Ie = Symbol("dispose"),
    Ca = Symbol("noDisposeOnSet"),
    re = Symbol("lruList"),
    Ue = Symbol("cache"),
    Ia = Symbol("updateAgeOnGet"),
    yt = () => 1,
    bt = class {
      constructor(o) {
        if (typeof o == "number" && (o = {
          max: o
        }), o || (o = {}), o.max && (typeof o.max != "number" || o.max < 0)) throw new TypeError("max must be a non-negative number");
        let c = this[We] = o.max || 1 / 0,
          h = o.length || yt;
        if (this[er] = typeof h != "function" ? yt : h, this[dr] = o.stale || !1, o.maxAge && typeof o.maxAge != "number") throw new TypeError("maxAge must be a number");
        this[Ve] = o.maxAge || 0, this[Ie] = o.dispose, this[Ca] = o.noDisposeOnSet || !1, this[Ia] = o.updateAgeOnGet || !1, this.reset();
      }
      set max(o) {
        if (typeof o != "number" || o < 0) throw new TypeError("max must be a non-negative number");
        this[We] = o || 1 / 0, pr(this);
      }
      get max() {
        return this[We];
      }
      set allowStale(o) {
        this[dr] = !!o;
      }
      get allowStale() {
        return this[dr];
      }
      set maxAge(o) {
        if (typeof o != "number") throw new TypeError("maxAge must be a non-negative number");
        this[Ve] = o, pr(this);
      }
      get maxAge() {
        return this[Ve];
      }
      set lengthCalculator(o) {
        typeof o != "function" && (o = yt), o !== this[er] && (this[er] = o, this[Ae] = 0, this[re].forEach(c => {
          c.length = this[er](c.value, c.key), this[Ae] += c.length;
        })), pr(this);
      }
      get lengthCalculator() {
        return this[er];
      }
      get length() {
        return this[Ae];
      }
      get itemCount() {
        return this[re].length;
      }
      rforEach(o, c) {
        c = c || this;
        for (let h = this[re].tail; h !== null;) {
          let p = h.prev;
          La(this, o, h, c), h = p;
        }
      }
      forEach(o, c) {
        c = c || this;
        for (let h = this[re].head; h !== null;) {
          let p = h.next;
          La(this, o, h, c), h = p;
        }
      }
      keys() {
        return this[re].toArray().map(o => o.key);
      }
      values() {
        return this[re].toArray().map(o => o.value);
      }
      reset() {
        this[Ie] && this[re] && this[re].length && this[re].forEach(o => this[Ie](o.key, o.value)), this[Ue] = new Map(), this[re] = new cl(), this[Ae] = 0;
      }
      dump() {
        return this[re].map(o => Mr(this, o) ? !1 : {
          k: o.key,
          v: o.value,
          e: o.now + (o.maxAge || 0)
        }).toArray().filter(o => o);
      }
      dumpLru() {
        return this[re];
      }
      set(o, c, h) {
        if (h = h || this[Ve], h && typeof h != "number") throw new TypeError("maxAge must be a number");
        let p = h ? Date.now() : 0,
          m = this[er](c, o);
        if (this[Ue].has(o)) {
          if (m > this[We]) return rr(this, this[Ue].get(o)), !1;
          let U = this[Ue].get(o).value;
          return this[Ie] && (this[Ca] || this[Ie](o, U.value)), U.now = p, U.maxAge = h, U.value = c, this[Ae] += m - U.length, U.length = m, this.get(o), pr(this), !0;
        }
        let b = new St(o, c, m, p, h);
        return b.length > this[We] ? (this[Ie] && this[Ie](o, c), !1) : (this[Ae] += b.length, this[re].unshift(b), this[Ue].set(o, this[re].head), pr(this), !0);
      }
      has(o) {
        if (!this[Ue].has(o)) return !1;
        let c = this[Ue].get(o).value;
        return !Mr(this, c);
      }
      get(o) {
        return xt(this, o, !0);
      }
      peek(o) {
        return xt(this, o, !1);
      }
      pop() {
        let o = this[re].tail;
        return o ? (rr(this, o), o.value) : null;
      }
      del(o) {
        rr(this, this[Ue].get(o));
      }
      load(o) {
        this.reset();
        let c = Date.now();
        for (let h = o.length - 1; h >= 0; h--) {
          let p = o[h],
            m = p.e || 0;
          if (m === 0) this.set(p.k, p.v);else {
            let b = m - c;
            b > 0 && this.set(p.k, p.v, b);
          }
        }
      }
      prune() {
        this[Ue].forEach((o, c) => xt(this, c, !1));
      }
    },
    xt = (s, o, c) => {
      let h = s[Ue].get(o);
      if (h) {
        let p = h.value;
        if (Mr(s, p)) {
          if (rr(s, h), !s[dr]) return;
        } else c && (s[Ia] && (h.value.now = Date.now()), s[re].unshiftNode(h));
        return p.value;
      }
    },
    Mr = (s, o) => {
      if (!o || !o.maxAge && !s[Ve]) return !1;
      let c = Date.now() - o.now;
      return o.maxAge ? c > o.maxAge : s[Ve] && c > s[Ve];
    },
    pr = s => {
      if (s[Ae] > s[We]) for (let o = s[re].tail; s[Ae] > s[We] && o !== null;) {
        let c = o.prev;
        rr(s, o), o = c;
      }
    },
    rr = (s, o) => {
      if (o) {
        let c = o.value;
        s[Ie] && s[Ie](c.key, c.value), s[Ae] -= c.length, s[Ue].delete(c.key), s[re].removeNode(o);
      }
    },
    St = class {
      constructor(o, c, h, p, m) {
        this.key = o, this.value = c, this.length = h, this.now = p, this.maxAge = m || 0;
      }
    },
    La = (s, o, c, h) => {
      let p = c.value;
      Mr(s, p) && (rr(s, c), s[dr] || (p = void 0)), p && o.call(h, p.value, p.key, s);
    };
  Aa.exports = bt;
});
var Et = addon_ligatures_q(Ut => {
  "use strict";

  Object.defineProperty(Ut, "__esModule", {
    value: !0
  });
  function hl(s) {
    let o = {
      individual: {},
      range: []
    };
    for (let c of s) Tt(o, c);
    return o;
  }
  Ut.default = hl;
  function Tt(s, o) {
    for (let [c, h] of Object.entries(o.individual)) if (s.individual[c]) tr(s.individual[c], h);else {
      let p = !1;
      for (let [m, {
        range: b,
        entry: F
      }] of s.range.entries()) {
        let U = Ft(Number(c), b);
        if (U.both !== null) {
          p = !0, s.individual[c] = h, tr(s.individual[c], oe(F)), s.range.splice(m, 1);
          for (let I of U.second) Array.isArray(I) ? s.range.push({
            range: I,
            entry: oe(F)
          }) : s.individual[I] = oe(F);
        }
      }
      p || (s.individual[c] = h);
    }
    for (let {
      range: c,
      entry: h
    } of o.range) {
      let p = [c];
      for (let m = 0; m < s.range.length; m++) {
        let {
          range: b,
          entry: F
        } = s.range[m];
        for (let [U, I] of p.entries()) if (Array.isArray(I)) {
          let z = pl(I, b);
          if (z.both === null) continue;
          s.range.splice(m, 1), m--;
          let B = oe(F);
          Array.isArray(z.both) ? s.range.push({
            range: z.both,
            entry: B
          }) : s.individual[z.both] = B, tr(B, oe(h));
          for (let W of z.second) Array.isArray(W) ? s.range.push({
            range: W,
            entry: oe(F)
          }) : s.individual[W] = oe(F);
          p = z.first;
        } else {
          let z = Ft(I, b);
          if (z.both === null) continue;
          s.individual[I] = oe(h), tr(s.individual[I], oe(F)), s.range.splice(m, 1), m--;
          for (let B of z.second) Array.isArray(B) ? s.range.push({
            range: B,
            entry: oe(F)
          }) : s.individual[B] = oe(F);
          p.splice(U, 1, ...z.first);
          break;
        }
      }
      for (let m of Object.keys(s.individual)) for (let [b, F] of p.entries()) if (Array.isArray(F)) {
        let U = Ft(Number(m), F);
        if (U.both === null) continue;
        tr(s.individual[m], oe(h)), p.splice(b, 1, ...U.second);
        break;
      } else if (Number(m) === F) {
        tr(s.individual[m], oe(h));
        break;
      }
      for (let m of p) Array.isArray(m) ? s.range.push({
        range: m,
        entry: oe(h)
      }) : s.individual[m] = oe(h);
    }
  }
  function tr(s, o) {
    o.lookup && (!s.lookup || s.lookup.index > o.lookup.index || s.lookup.index === o.lookup.index && s.lookup.subIndex > o.lookup.subIndex) && (s.lookup = o.lookup), o.forward && (s.forward ? Tt(s.forward, o.forward) : s.forward = o.forward), o.reverse && (s.reverse ? Tt(s.reverse, o.reverse) : s.reverse = o.reverse);
  }
  function pl(s, o) {
    let c = {
      first: [],
      second: [],
      both: null
    };
    if (s[0] < o[1] && o[0] < s[1]) {
      let h = Math.max(s[0], o[0]),
        p = Math.min(s[1], o[1]);
      c.both = Xe(h, p);
    }
    if (s[0] < o[0]) {
      let h = s[0],
        p = Math.min(o[0], s[1]);
      c.first.push(Xe(h, p));
    } else if (o[0] < s[0]) {
      let h = o[0],
        p = Math.min(o[1], s[0]);
      c.second.push(Xe(h, p));
    }
    if (s[1] > o[1]) {
      let h = Math.max(s[0], o[1]),
        p = s[1];
      c.first.push(Xe(h, p));
    } else if (o[1] > s[1]) {
      let h = Math.max(s[1], o[0]),
        p = o[1];
      c.second.push(Xe(h, p));
    }
    return c;
  }
  function Ft(s, o) {
    if (s < o[0] || s > o[1]) return {
      first: [s],
      second: [o],
      both: null
    };
    let c = {
      first: [],
      second: [],
      both: s
    };
    return o[0] < s && c.second.push(Xe(o[0], s)), o[1] > s && c.second.push(Xe(s + 1, o[1])), c;
  }
  function Xe(s, o) {
    return o - s === 1 ? s : [s, o];
  }
  function oe(s) {
    let o = {};
    return s.forward && (o.forward = Ra(s.forward)), s.reverse && (o.reverse = Ra(s.reverse)), s.lookup && (o.lookup = {
      contextRange: s.lookup.contextRange.slice(),
      index: s.lookup.index,
      length: s.lookup.length,
      subIndex: s.lookup.subIndex,
      substitutions: s.lookup.substitutions.slice()
    }), o;
  }
  function Ra(s) {
    let o = {};
    for (let [c, h] of Object.entries(s.individual)) o[c] = oe(h);
    return {
      individual: o,
      range: s.range.map(({
        range: c,
        entry: h
      }) => ({
        range: c.slice(),
        entry: oe(h)
      }))
    };
  }
});
var addon_ligatures_Pa = addon_ligatures_q(kt => {
  "use strict";

  Object.defineProperty(kt, "__esModule", {
    value: !0
  });
  function Da(s, o, c, h) {
    let p = o[h],
      m = s[p];
    if (!m) return;
    let b = m.lookup;
    if (m.reverse) {
      let U = dl(m.reverse, o, c);
      (!b && U || U && b && (b.index > U.index || b.index === U.index && b.subIndex > U.subIndex)) && (b = U);
    }
    if (++h >= o.length || !m.forward) return b;
    let F = Da(m.forward, o, c, h);
    return (!b && F || F && b && (b.index > F.index || b.index === F.index && b.subIndex > F.subIndex)) && (b = F), b;
  }
  kt.default = Da;
  function dl(s, o, c) {
    let h = s[o[--c]],
      p = h && h.lookup;
    for (; h && ((!p && h.lookup || h.lookup && p && p.index > h.lookup.index) && (p = h.lookup), !(--c < 0 || !h.reverse));) h = h.reverse[o[c]];
    return p;
  }
});
var addon_ligatures_Ma = addon_ligatures_q(Ot => {
  "use strict";

  Object.defineProperty(Ot, "__esModule", {
    value: !0
  });
  function vl(s, o, c) {
    let h = !1;
    for (let p = 0; p < s.length; p++) {
      let m = s[p];
      if (h) {
        if (c <= m[0]) return s[p - 1][1] = c, s;
        if (c <= m[1]) return s[p - 1][1] = Math.max(c, m[1]), s.splice(p, 1), h = !1, s;
        s.splice(p, 1), p--;
      } else {
        if (c <= m[0]) return s.splice(p, 0, [o, c]), s;
        if (c <= m[1]) return m[0] = Math.min(o, m[0]), s;
        if (o < m[1]) m[0] = Math.min(o, m[0]), h = !0;else continue;
      }
    }
    return h ? s[s.length - 1][1] = c : s.push([o, c]), s;
  }
  Ot.default = vl;
});
var addon_ligatures_nr = addon_ligatures_q(Gr => {
  "use strict";

  Object.defineProperty(Gr, "__esModule", {
    value: !0
  });
  function gl(s, o) {
    switch (s.format) {
      case 1:
        let c = s.glyphs.indexOf(o);
        return c !== -1 ? c : null;
      case 2:
        let h = s.ranges.find(p => p.start <= o && p.end >= o);
        return h ? h.index : null;
    }
  }
  Gr.default = gl;
  function ml(s) {
    switch (s.format) {
      case 1:
        return s.glyphs.map((c, h) => ({
          glyphId: c,
          index: h
        }));
      case 2:
        let o = [];
        for (let [c, h] of s.ranges.entries()) h.end === h.start ? o.push({
          glyphId: h.start,
          index: c
        }) : o.push({
          glyphId: [h.start, h.end + 1],
          index: c
        });
        return o;
    }
  }
  Gr.listGlyphsByIndex = ml;
});
var addon_ligatures_Ga = addon_ligatures_q(Nr => {
  "use strict";

  Object.defineProperty(Nr, "__esModule", {
    value: !0
  });
  var yl = addon_ligatures_nr();
  function xl(s, o) {
    let c = o[0],
      h = wt(s, c),
      p = o[0] + 1,
      m = new Map();
    for (; p < o[1];) wt(s, p) !== h && (p - c <= 1 ? m.set(c, h) : m.set([c, p], h)), p++;
    return p - c <= 1 ? m.set(c, h) : m.set([c, p], h), m;
  }
  Nr.getRangeSubstitutionGlyphs = xl;
  function wt(s, o) {
    let c = yl.default(s.coverage, o);
    if (c === null) return null;
    switch (s.substFormat) {
      case 1:
        return (o + s.deltaGlyphId) % 2 ** 16;
      case 2:
        return s.substitute[c] != null ? s.substitute[c] : null;
    }
  }
  Nr.getIndividualSubstitutionGlyph = wt;
});
var addon_ligatures_vr = addon_ligatures_q(ar => {
  "use strict";

  Object.defineProperty(ar, "__esModule", {
    value: !0
  });
  var Na = addon_ligatures_Ga();
  function bl(s, o, c, h, p) {
    let m = [];
    for (let b of c) {
      b.entry.forward = {
        individual: {},
        range: []
      };
      for (let F of s) m.push(..._a(b.entry.forward, h, p, o, F).map(({
        entry: U,
        substitution: I
      }) => ({
        entry: U,
        substitutions: [...b.substitutions, I]
      })));
    }
    return m;
  }
  ar.processInputPosition = bl;
  function Sl(s, o) {
    let c = [];
    for (let h of o) for (let p of s) {
      let m = {};
      h.entry.forward || (h.entry.forward = {
        individual: {},
        range: []
      }), c.push({
        entry: m,
        substitutions: h.substitutions
      }), Array.isArray(p) ? h.entry.forward.range.push({
        entry: m,
        range: p
      }) : h.entry.forward.individual[p] = m;
    }
    return c;
  }
  ar.processLookaheadPosition = Sl;
  function Fl(s, o) {
    let c = [];
    for (let h of o) for (let p of s) {
      let m = {};
      h.entry.reverse || (h.entry.reverse = {
        individual: {},
        range: []
      }), c.push({
        entry: m,
        substitutions: h.substitutions
      }), Array.isArray(p) ? h.entry.reverse.range.push({
        entry: m,
        range: p
      }) : h.entry.reverse.individual[p] = m;
    }
    return c;
  }
  ar.processBacktrackPosition = Fl;
  function _a(s, o, c, h, p) {
    let m = [];
    if (!Array.isArray(p)) s.individual[p] = {}, m.push({
      entry: s.individual[p],
      substitution: Ul(o, c, h, p)
    });else {
      let b = Tl(o, c, h, p);
      for (let [F, U] of b) {
        let I = {};
        Array.isArray(F) ? s.range.push({
          range: F,
          entry: I
        }) : s.individual[F] = {}, m.push({
          entry: I,
          substitution: U
        });
      }
    }
    return m;
  }
  ar.getInputTree = _a;
  function Tl(s, o, c, h) {
    for (let p of s.filter(m => m.sequenceIndex === c)) for (let m of o[p.lookupListIndex].subtables) {
      let b = Na.getRangeSubstitutionGlyphs(m, h);
      if (!Array.from(b.values()).every(F => F !== null)) return b;
    }
    return new Map([[h, null]]);
  }
  function Ul(s, o, c, h) {
    for (let p of s.filter(m => m.sequenceIndex === c)) for (let m of o[p.lookupListIndex].subtables) {
      let b = Na.getIndividualSubstitutionGlyph(m, h);
      if (b !== null) return b;
    }
    return null;
  }
});
var addon_ligatures_Ha = addon_ligatures_q(Ct => {
  "use strict";

  Object.defineProperty(Ct, "__esModule", {
    value: !0
  });
  var El = addon_ligatures_nr(),
    _r = addon_ligatures_vr();
  function kl(s, o, c) {
    let h = {
        individual: {},
        range: []
      },
      p = El.listGlyphsByIndex(s.coverage);
    for (let {
      glyphId: m,
      index: b
    } of p) {
      let F = s.chainRuleSets[b];
      if (F) for (let [U, I] of F.entries()) {
        let z = _r.getInputTree(h, I.lookupRecords, o, 0, m).map(({
          entry: B,
          substitution: W
        }) => ({
          entry: B,
          substitutions: [W]
        }));
        for (let [B, W] of I.input.entries()) z = _r.processInputPosition([W], B + 1, z, I.lookupRecords, o);
        for (let B of I.lookahead) z = _r.processLookaheadPosition([B], z);
        for (let B of I.backtrack) z = _r.processBacktrackPosition([B], z);
        for (let {
          entry: B,
          substitutions: W
        } of z) B.lookup = {
          substitutions: W,
          length: I.input.length + 1,
          index: c,
          subIndex: U,
          contextRange: [-1 * I.backtrack.length, 1 + I.input.length + I.lookahead.length]
        };
      }
    }
    return h;
  }
  Ct.default = kl;
});
var addon_ligatures_za = addon_ligatures_q(Hr => {
  "use strict";

  Object.defineProperty(Hr, "__esModule", {
    value: !0
  });
  function Ol(s, o) {
    switch (s.format) {
      case 2:
        return Array.isArray(o) ? wl(s, o) : new Map([[o, Lt(s, o)]]);
      default:
        return new Map([[o, null]]);
    }
  }
  Hr.default = Ol;
  function wl(s, o) {
    let c = o[0],
      h = Lt(s, c),
      p = o[0] + 1,
      m = new Map();
    for (; p < o[1];) Lt(s, p) !== h && (p - c <= 1 ? m.set(c, h) : m.set([c, p], h)), p++;
    return p - c <= 1 ? m.set(c, h) : m.set([c, p], h), m;
  }
  function Lt(s, o) {
    for (let c of s.ranges) if (c.start <= o && c.end >= o) return c.classId;
    return null;
  }
  function Cl(s, o) {
    switch (s.format) {
      case 2:
        let c = [];
        for (let h of s.ranges) h.classId === o && (h.end === h.start ? c.push(h.start) : c.push([h.start, h.end + 1]));
        return c;
      default:
        return [];
    }
  }
  Hr.listClassGlyphs = Cl;
});
var addon_ligatures_qa = addon_ligatures_q(It => {
  "use strict";

  Object.defineProperty(It, "__esModule", {
    value: !0
  });
  var Ll = Et(),
    Il = addon_ligatures_nr(),
    zr = addon_ligatures_za(),
    qr = addon_ligatures_vr();
  function Al(s, o, c) {
    let h = [],
      p = Il.listGlyphsByIndex(s.coverage);
    for (let {
      glyphId: m
    } of p) {
      let b = zr.default(s.inputClassDef, m);
      for (let [F, U] of b.entries()) {
        if (U === null) continue;
        let I = s.chainClassSet[U];
        if (I) for (let [z, B] of I.entries()) {
          let W = {
              individual: {},
              range: []
            },
            X = qr.getInputTree(W, B.lookupRecords, o, 0, F).map(({
              entry: Z,
              substitution: xe
            }) => ({
              entry: Z,
              substitutions: [xe]
            }));
          for (let [Z, xe] of B.input.entries()) X = qr.processInputPosition(zr.listClassGlyphs(s.inputClassDef, xe), Z + 1, X, B.lookupRecords, o);
          for (let Z of B.lookahead) X = qr.processLookaheadPosition(zr.listClassGlyphs(s.lookaheadClassDef, Z), X);
          for (let Z of B.backtrack) X = qr.processBacktrackPosition(zr.listClassGlyphs(s.backtrackClassDef, Z), X);
          for (let {
            entry: Z,
            substitutions: xe
          } of X) Z.lookup = {
            substitutions: xe,
            index: c,
            subIndex: z,
            length: B.input.length + 1,
            contextRange: [-1 * B.backtrack.length, 1 + B.input.length + B.lookahead.length]
          };
          h.push(W);
        }
      }
    }
    return Ll.default(h);
  }
  It.default = Al;
});
var addon_ligatures_Wa = addon_ligatures_q(At => {
  "use strict";

  Object.defineProperty(At, "__esModule", {
    value: !0
  });
  var Wr = addon_ligatures_nr(),
    Vr = addon_ligatures_vr();
  function Bl(s, o, c) {
    let h = {
        individual: {},
        range: []
      },
      p = Wr.listGlyphsByIndex(s.inputCoverage[0]);
    for (let {
      glyphId: m
    } of p) {
      let b = Vr.getInputTree(h, s.lookupRecords, o, 0, m).map(({
        entry: F,
        substitution: U
      }) => ({
        entry: F,
        substitutions: [U]
      }));
      for (let [F, U] of s.inputCoverage.slice(1).entries()) b = Vr.processInputPosition(Wr.listGlyphsByIndex(U).map(I => I.glyphId), F + 1, b, s.lookupRecords, o);
      for (let F of s.lookaheadCoverage) b = Vr.processLookaheadPosition(Wr.listGlyphsByIndex(F).map(U => U.glyphId), b);
      for (let F of s.backtrackCoverage) b = Vr.processBacktrackPosition(Wr.listGlyphsByIndex(F).map(U => U.glyphId), b);
      for (let {
        entry: F,
        substitutions: U
      } of b) F.lookup = {
        substitutions: U,
        index: c,
        subIndex: 0,
        length: s.inputCoverage.length,
        contextRange: [-1 * s.backtrackCoverage.length, s.inputCoverage.length + s.lookaheadCoverage.length]
      };
    }
    return h;
  }
  At.default = Bl;
});
var addon_ligatures_Xa = addon_ligatures_q(Rt => {
  "use strict";

  Object.defineProperty(Rt, "__esModule", {
    value: !0
  });
  var Bt = addon_ligatures_nr(),
    Va = addon_ligatures_vr();
  function Rl(s, o) {
    let c = {
        individual: {},
        range: []
      },
      h = Bt.listGlyphsByIndex(s.coverage);
    for (let {
      glyphId: p,
      index: m
    } of h) {
      let b = {};
      Array.isArray(p) ? c.range.push({
        entry: b,
        range: p
      }) : c.individual[p] = b;
      let F = [{
        entry: b,
        substitutions: [s.substitutes[m]]
      }];
      for (let U of s.lookaheadCoverage) F = Va.processLookaheadPosition(Bt.listGlyphsByIndex(U).map(I => I.glyphId), F);
      for (let U of s.backtrackCoverage) F = Va.processBacktrackPosition(Bt.listGlyphsByIndex(U).map(I => I.glyphId), F);
      for (let {
        entry: U,
        substitutions: I
      } of F) U.lookup = {
        substitutions: I,
        index: o,
        subIndex: 0,
        length: 1,
        contextRange: [-1 * s.backtrackCoverage.length, 1 + s.lookaheadCoverage.length]
      };
    }
    return c;
  }
  Rt.default = Rl;
});
var addon_ligatures_ja = addon_ligatures_q(Pt => {
  "use strict";

  Object.defineProperty(Pt, "__esModule", {
    value: !0
  });
  function Dt(s) {
    let o = {};
    for (let [c, h] of Object.entries(s.individual)) o[c] = Ya(h);
    for (let {
      range: c,
      entry: h
    } of s.range) {
      let p = Ya(h);
      for (let m = c[0]; m < c[1]; m++) o[m] = p;
    }
    return o;
  }
  Pt.default = Dt;
  function Ya(s) {
    let o = {};
    return s.forward && (o.forward = Dt(s.forward)), s.reverse && (o.reverse = Dt(s.reverse)), s.lookup && (o.lookup = s.lookup), o;
  }
});
var addon_ligatures_$a = addon_ligatures_q(Mt => {
  "use strict";

  Object.defineProperty(Mt, "__esModule", {
    value: !0
  });
  var Za = me("fs"),
    Qa = me("util"),
    Ja = me("path"),
    Dl = Qa.promisify(Za.readdir),
    Pl = Qa.promisify(Za.stat);
  async function Ml(s, o) {
    let c = new Set();
    return await Promise.all(s.map(async h => {
      let p = await Ka(Ja.resolve(h), new RegExp(`\\.${o.map(m => `(?:${m})`).join("|")}$`, "i"));
      for (let m of p) c.add(m);
    })), [...c];
  }
  Mt.default = Ml;
  async function Ka(s, o, c = 10) {
    if (c <= 0) return [];
    let h;
    try {
      h = await Dl(s);
    } catch {
      return [];
    }
    let p = [];
    return await Promise.all(h.map(async m => {
      let b = Ja.join(s, m),
        F;
      try {
        F = await Pl(b);
      } catch {
        return;
      }
      F.isFile() && o.test(b) ? p.push(b) : F.isDirectory() && p.push(...(await Ka(b, o, c - 1)));
    })), p;
  }
});
var addon_ligatures_rs = addon_ligatures_q((_t, es) => {
  "use strict";

  Object.defineProperty(_t, "__esModule", {
    value: !0
  });
  var Ye = me("path"),
    Gt = me("os"),
    Gl = addon_ligatures_$a(),
    Nl = {
      win32: () => {
        let s = Ye.join(process.env.WINDIR || "C:\\Windows", "Fonts"),
          o = "Microsoft\\Windows\\Fonts",
          c;
        return process.env.LOCALAPPDATA ? c = Ye.join(process.env.LOCALAPPDATA, o) : process.env.APPDATA ? c = Ye.join(process.env.APPDATA, "Local", o) : process.env.USERPROFILE && (c = Ye.join(process.env.USERPROFILE, "AppData", "Local", o)), c ? [s, c] : [s];
      },
      darwin: () => {
        let s = Gt.homedir();
        return [...(s ? [Ye.join(s, "/Library/Fonts")] : []), "/Library/Fonts", "/Network/Library/Fonts", "/System/Library/Fonts", "/System Folder/Fonts"];
      },
      linux: () => {
        let s = Gt.homedir();
        return ["/usr/share/fonts", "/usr/local/share/fonts", ...(s ? [Ye.join(s, ".fonts"), Ye.join(s, ".local/share/fonts")] : [])];
      }
    };
  function Nt(s) {
    let o = Object.assign({
        extensions: ["ttf", "otf", "ttc", "woff", "woff2"],
        additionalFolders: []
      }, s),
      c = Gt.platform(),
      h = Nl[c];
    if (!h) throw new Error(`Unsupported platform: ${c}`);
    let p = h();
    return Gl.default([...p, ...o.additionalFolders], o.extensions);
  }
  es.exports = Object.assign(Nt, {
    default: Nt
  });
  _t.default = Nt;
});
var addon_ligatures_ns = addon_ligatures_q((qt, ts) => {
  "use strict";

  Object.defineProperty(qt, "__esModule", {
    value: !0
  });
  var _l = me("stream"),
    Ht = class extends _l.Writable {
      constructor() {
        super(...arguments), this.offset = 0, this._waiters = [], this._closed = !1;
      }
      _write(o, c, h) {
        let p = 0,
          m = () => {
            for (; this._waiters.length > 0;) {
              let b = this._waiters[0];
              if (this._buffer) {
                let F = this._buffer.size - this._buffer.offset;
                if (F + o.length >= b.size) {
                  if (b.skip) this._buffer = void 0, b.resolve();else {
                    let U = Math.min(F, b.size),
                      I = Buffer.alloc(b.size);
                    this._buffer.buf.copy(I, 0, this._buffer.offset, this._buffer.offset + U), o.copy(I, U, 0, b.size - U), b.resolve(I);
                  }
                  if (this.offset += b.size, this._waiters.shift(), this._buffer = void 0, F + o.length === b.size) {
                    h();
                    break;
                  } else p += b.size - F;
                } else {
                  if (!b.skip) {
                    let U = Buffer.alloc(F + o.length);
                    this._buffer.buf.copy(U, 0, this._buffer.offset, this._buffer.size), o.copy(U, F, 0, o.length), this._buffer.buf = U;
                  }
                  this._buffer.offset = 0, this._buffer.size = F + o.length, h();
                  break;
                }
              } else if (o.length - p >= b.size) {
                if (b.skip ? b.resolve() : b.resolve(o.slice(p, p + b.size)), this.offset += b.size, this._waiters.shift(), p += b.size, o.length === p) {
                  h();
                  break;
                }
              } else {
                this._buffer = {
                  buf: b.skip ? void 0 : o.slice(p),
                  offset: 0,
                  size: o.length - p
                }, p = o.length, h();
                break;
              }
            }
            this._processTrigger = o.length - p > 0 ? m : void 0;
          };
        m();
      }
      _destroy(o, c) {
        this._processTrigger = void 0;
        for (let h of this._waiters) h.reject(o || new Error("stream destroyed"));
        this._waiters = [], this._closed = !0;
      }
      _final(o) {
        this._processTrigger = void 0;
        for (let c of this._waiters) c.reject(new Error("not enough data in stream"));
        this._waiters = [], this._closed = !0;
      }
      read(o) {
        return new Promise((c, h) => {
          this._closed && h(new Error("stream is closed")), this._waiters.push({
            resolve: c,
            reject: h,
            size: o,
            skip: !1
          }), this._processTrigger && this._processTrigger();
        });
      }
      skip(o) {
        return new Promise((c, h) => {
          this._closed && h(new Error("stream is closed")), this._waiters.push({
            resolve: c,
            reject: h,
            size: o,
            skip: !0
          }), this._processTrigger && this._processTrigger();
        });
      }
    };
  function zt() {
    return new Ht();
  }
  ts.exports = Object.assign(zt, {
    default: zt
  });
  qt.default = zt;
});
var addon_ligatures_as = addon_ligatures_q(Vt => {
  "use strict";

  Object.defineProperty(Vt, "__esModule", {
    value: !0
  });
  var Hl = ["copyright", "fontFamily", "fontSubfamily", "uniqueID", "fullName", "version", "postScriptName", "trademark", "manufacturer", "designer", "description", "manufacturerURL", "designerURL", "license", "licenseURL", "reserved", "preferredFamily", "preferredSubfamily", "compatibleFullName", "sampleText", "postScriptFindFontName", "wwsFamily", "wwsSubfamily"],
    zl = {
      0: "en",
      1: "fr",
      2: "de",
      3: "it",
      4: "nl",
      5: "sv",
      6: "es",
      7: "da",
      8: "pt",
      9: "no",
      10: "he",
      11: "ja",
      12: "ar",
      13: "fi",
      14: "el",
      15: "is",
      16: "mt",
      17: "tr",
      18: "hr",
      19: "zh-Hant",
      20: "ur",
      21: "hi",
      22: "th",
      23: "ko",
      24: "lt",
      25: "pl",
      26: "hu",
      27: "es",
      28: "lv",
      29: "se",
      30: "fo",
      31: "fa",
      32: "ru",
      33: "zh",
      34: "nl-BE",
      35: "ga",
      36: "sq",
      37: "ro",
      38: "cz",
      39: "sk",
      40: "si",
      41: "yi",
      42: "sr",
      43: "mk",
      44: "bg",
      45: "uk",
      46: "be",
      47: "uz",
      48: "kk",
      49: "az-Cyrl",
      50: "az-Arab",
      51: "hy",
      52: "ka",
      53: "mo",
      54: "ky",
      55: "tg",
      56: "tk",
      57: "mn-CN",
      58: "mn",
      59: "ps",
      60: "ks",
      61: "ku",
      62: "sd",
      63: "bo",
      64: "ne",
      65: "sa",
      66: "mr",
      67: "bn",
      68: "as",
      69: "gu",
      70: "pa",
      71: "or",
      72: "ml",
      73: "kn",
      74: "ta",
      75: "te",
      76: "si",
      77: "my",
      78: "km",
      79: "lo",
      80: "vi",
      81: "id",
      82: "tl",
      83: "ms",
      84: "ms-Arab",
      85: "am",
      86: "ti",
      87: "om",
      88: "so",
      89: "sw",
      90: "rw",
      91: "rn",
      92: "ny",
      93: "mg",
      94: "eo",
      128: "cy",
      129: "eu",
      130: "ca",
      131: "la",
      132: "qu",
      133: "gn",
      134: "ay",
      135: "tt",
      136: "ug",
      137: "dz",
      138: "jv",
      139: "su",
      140: "gl",
      141: "af",
      142: "br",
      143: "iu",
      144: "gd",
      145: "gv",
      146: "ga",
      147: "to",
      148: "el-polyton",
      149: "kl",
      150: "az",
      151: "nn"
    },
    ql = {
      1078: "af",
      1052: "sq",
      1156: "gsw",
      1118: "am",
      5121: "ar-DZ",
      15361: "ar-BH",
      3073: "ar",
      2049: "ar-IQ",
      11265: "ar-JO",
      13313: "ar-KW",
      12289: "ar-LB",
      4097: "ar-LY",
      6145: "ary",
      8193: "ar-OM",
      16385: "ar-QA",
      1025: "ar-SA",
      10241: "ar-SY",
      7169: "aeb",
      14337: "ar-AE",
      9217: "ar-YE",
      1067: "hy",
      1101: "as",
      2092: "az-Cyrl",
      1068: "az",
      1133: "ba",
      1069: "eu",
      1059: "be",
      2117: "bn",
      1093: "bn-IN",
      8218: "bs-Cyrl",
      5146: "bs",
      1150: "br",
      1026: "bg",
      1027: "ca",
      3076: "zh-HK",
      5124: "zh-MO",
      2052: "zh",
      4100: "zh-SG",
      1028: "zh-TW",
      1155: "co",
      1050: "hr",
      4122: "hr-BA",
      1029: "cs",
      1030: "da",
      1164: "prs",
      1125: "dv",
      2067: "nl-BE",
      1043: "nl",
      3081: "en-AU",
      10249: "en-BZ",
      4105: "en-CA",
      9225: "en-029",
      16393: "en-IN",
      6153: "en-IE",
      8201: "en-JM",
      17417: "en-MY",
      5129: "en-NZ",
      13321: "en-PH",
      18441: "en-SG",
      7177: "en-ZA",
      11273: "en-TT",
      2057: "en-GB",
      1033: "en",
      12297: "en-ZW",
      1061: "et",
      1080: "fo",
      1124: "fil",
      1035: "fi",
      2060: "fr-BE",
      3084: "fr-CA",
      1036: "fr",
      5132: "fr-LU",
      6156: "fr-MC",
      4108: "fr-CH",
      1122: "fy",
      1110: "gl",
      1079: "ka",
      3079: "de-AT",
      1031: "de",
      5127: "de-LI",
      4103: "de-LU",
      2055: "de-CH",
      1032: "el",
      1135: "kl",
      1095: "gu",
      1128: "ha",
      1037: "he",
      1081: "hi",
      1038: "hu",
      1039: "is",
      1136: "ig",
      1057: "id",
      1117: "iu",
      2141: "iu-Latn",
      2108: "ga",
      1076: "xh",
      1077: "zu",
      1040: "it",
      2064: "it-CH",
      1041: "ja",
      1099: "kn",
      1087: "kk",
      1107: "km",
      1158: "quc",
      1159: "rw",
      1089: "sw",
      1111: "kok",
      1042: "ko",
      1088: "ky",
      1108: "lo",
      1062: "lv",
      1063: "lt",
      2094: "dsb",
      1134: "lb",
      1071: "mk",
      2110: "ms-BN",
      1086: "ms",
      1100: "ml",
      1082: "mt",
      1153: "mi",
      1146: "arn",
      1102: "mr",
      1148: "moh",
      1104: "mn",
      2128: "mn-CN",
      1121: "ne",
      1044: "nb",
      2068: "nn",
      1154: "oc",
      1096: "or",
      1123: "ps",
      1045: "pl",
      1046: "pt",
      2070: "pt-PT",
      1094: "pa",
      1131: "qu-BO",
      2155: "qu-EC",
      3179: "qu",
      1048: "ro",
      1047: "rm",
      1049: "ru",
      9275: "smn",
      4155: "smj-NO",
      5179: "smj",
      3131: "se-FI",
      1083: "se",
      2107: "se-SE",
      8251: "sms",
      6203: "sma-NO",
      7227: "sms",
      1103: "sa",
      7194: "sr-Cyrl-BA",
      3098: "sr",
      6170: "sr-Latn-BA",
      2074: "sr-Latn",
      1132: "nso",
      1074: "tn",
      1115: "si",
      1051: "sk",
      1060: "sl",
      11274: "es-AR",
      16394: "es-BO",
      13322: "es-CL",
      9226: "es-CO",
      5130: "es-CR",
      7178: "es-DO",
      12298: "es-EC",
      17418: "es-SV",
      4106: "es-GT",
      18442: "es-HN",
      2058: "es-MX",
      19466: "es-NI",
      6154: "es-PA",
      15370: "es-PY",
      10250: "es-PE",
      20490: "es-PR",
      3082: "es",
      1034: "es",
      21514: "es-US",
      14346: "es-UY",
      8202: "es-VE",
      2077: "sv-FI",
      1053: "sv",
      1114: "syr",
      1064: "tg",
      2143: "tzm",
      1097: "ta",
      1092: "tt",
      1098: "te",
      1054: "th",
      1105: "bo",
      1055: "tr",
      1090: "tk",
      1152: "ug",
      1058: "uk",
      1070: "hsb",
      1056: "ur",
      2115: "uz-Cyrl",
      1091: "uz",
      1066: "vi",
      1106: "cy",
      1160: "wo",
      1157: "sah",
      1144: "ii",
      1130: "yo"
    };
  function Wl(s, o, c) {
    switch (s) {
      case 0:
        if (o === 65535) return "und";
        if (c) return c[o];
        break;
      case 1:
        return zl[o];
      case 3:
        return ql[o];
    }
  }
  var Wt = "utf-16",
    Vl = {
      0: "macintosh",
      1: "x-mac-japanese",
      2: "x-mac-chinesetrad",
      3: "x-mac-korean",
      6: "x-mac-greek",
      7: "x-mac-cyrillic",
      9: "x-mac-devanagai",
      10: "x-mac-gurmukhi",
      11: "x-mac-gujarati",
      12: "x-mac-oriya",
      13: "x-mac-bengali",
      14: "x-mac-tamil",
      15: "x-mac-telugu",
      16: "x-mac-kannada",
      17: "x-mac-malayalam",
      18: "x-mac-sinhalese",
      19: "x-mac-burmese",
      20: "x-mac-khmer",
      21: "x-mac-thai",
      22: "x-mac-lao",
      23: "x-mac-georgian",
      24: "x-mac-armenian",
      25: "x-mac-chinesesimp",
      26: "x-mac-tibetan",
      27: "x-mac-mongolian",
      28: "x-mac-ethiopic",
      29: "x-mac-ce",
      30: "x-mac-vietnamese",
      31: "x-mac-extarabic"
    },
    Xl = {
      15: "x-mac-icelandic",
      17: "x-mac-turkish",
      18: "x-mac-croatian",
      24: "x-mac-ce",
      25: "x-mac-ce",
      26: "x-mac-ce",
      27: "x-mac-ce",
      28: "x-mac-ce",
      30: "x-mac-icelandic",
      37: "x-mac-romanian",
      38: "x-mac-ce",
      39: "x-mac-ce",
      40: "x-mac-ce",
      143: "x-mac-inuit",
      146: "x-mac-gaelic"
    };
  function Yl(s, o, c) {
    switch (s) {
      case 0:
        return Wt;
      case 1:
        return Xl[c] || Vl[o];
      case 3:
        if (o === 1 || o === 10) return Wt;
        break;
    }
  }
  function jl(s, o) {
    let c = {},
      h = s.readUInt16BE(2),
      p = s.readUInt16BE(4),
      m = 6;
    for (let b = 0; b < h; b++) {
      let F = s.readUInt16BE(m + 0),
        U = s.readUInt16BE(m + 2),
        I = s.readUInt16BE(m + 4),
        z = s.readUInt16BE(m + 6),
        B = Hl[z] || String(z),
        W = s.readUInt16BE(m + 8),
        X = s.readUInt16BE(m + 10),
        Z = Wl(F, I, o),
        xe = Yl(F, U, I);
      if (m += 12, xe !== void 0 && Z !== void 0) {
        let Ne;
        if (xe === Wt) {
          let Ee = W / 2,
            yr = Array(Ee);
          for (let ue = 0; ue < Ee; ue++) yr[ue] = s.readUInt16BE(p + X + ue * 2);
          Ne = String.fromCharCode(...yr);
        } else Ne = Ql(s, p + X, W, xe);
        if (Ne) {
          let Ee = c[B];
          Ee === void 0 && (Ee = c[B] = {}), Ee[Z] = Ne;
        }
      }
    }
    return c;
  }
  Vt.default = jl;
  var Zl = {
    "x-mac-croatian": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\u0160\u2122\xB4\xA8\u2260\u017D\xD8\u221E\xB1\u2264\u2265\u2206\xB5\u2202\u2211\u220F\u0161\u222B\xAA\xBA\u03A9\u017E\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u0106\xAB\u010C\u2026 \xC0\xC3\xD5\u0152\u0153\u0110\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\uF8FF\xA9\u2044\u20AC\u2039\u203A\xC6\xBB\u2013\xB7\u201A\u201E\u2030\xC2\u0107\xC1\u010D\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u0111\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u03C0\xCB\u02DA\xB8\xCA\xE6\u02C7",
    "x-mac-cyrillic": "\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u2020\xB0\u0490\xA3\xA7\u2022\xB6\u0406\xAE\xA9\u2122\u0402\u0452\u2260\u0403\u0453\u221E\xB1\u2264\u2265\u0456\xB5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040A\u045A\u0458\u0405\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026 \u040B\u045B\u040C\u045C\u0455\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u201E\u040E\u045E\u040F\u045F\u2116\u0401\u0451\u044F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E",
    "x-mac-gaelic": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u1E02\xB1\u2264\u2265\u1E03\u010A\u010B\u1E0A\u1E0B\u1E1E\u1E1F\u0120\u0121\u1E40\xE6\xF8\u1E41\u1E56\u1E57\u027C\u0192\u017F\u1E60\xAB\xBB\u2026 \xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\u1E61\u1E9B\xFF\u0178\u1E6A\u20AC\u2039\u203A\u0176\u0177\u1E6B\xB7\u1EF2\u1EF3\u204A\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u2663\xD2\xDA\xDB\xD9\u0131\xDD\xFD\u0174\u0175\u1E84\u1E85\u1E80\u1E81\u1E82\u1E83",
    "x-mac-greek": "\xC4\xB9\xB2\xC9\xB3\xD6\xDC\u0385\xE0\xE2\xE4\u0384\xA8\xE7\xE9\xE8\xEA\xEB\xA3\u2122\xEE\xEF\u2022\xBD\u2030\xF4\xF6\xA6\u20AC\xF9\xFB\xFC\u2020\u0393\u0394\u0398\u039B\u039E\u03A0\xDF\xAE\xA9\u03A3\u03AA\xA7\u2260\xB0\xB7\u0391\xB1\u2264\u2265\xA5\u0392\u0395\u0396\u0397\u0399\u039A\u039C\u03A6\u03AB\u03A8\u03A9\u03AC\u039D\xAC\u039F\u03A1\u2248\u03A4\xAB\xBB\u2026 \u03A5\u03A7\u0386\u0388\u0153\u2013\u2015\u201C\u201D\u2018\u2019\xF7\u0389\u038A\u038C\u038E\u03AD\u03AE\u03AF\u03CC\u038F\u03CD\u03B1\u03B2\u03C8\u03B4\u03B5\u03C6\u03B3\u03B7\u03B9\u03BE\u03BA\u03BB\u03BC\u03BD\u03BF\u03C0\u03CE\u03C1\u03C3\u03C4\u03B8\u03C9\u03C2\u03C7\u03C5\u03B6\u03CA\u03CB\u0390\u03B0\xAD",
    "x-mac-icelandic": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\xDD\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026 \xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\xD0\xF0\xDE\xFE\xFD\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7",
    "x-mac-inuit": "\u1403\u1404\u1405\u1406\u140A\u140B\u1431\u1432\u1433\u1434\u1438\u1439\u1449\u144E\u144F\u1450\u1451\u1455\u1456\u1466\u146D\u146E\u146F\u1470\u1472\u1473\u1483\u148B\u148C\u148D\u148E\u1490\u1491\xB0\u14A1\u14A5\u14A6\u2022\xB6\u14A7\xAE\xA9\u2122\u14A8\u14AA\u14AB\u14BB\u14C2\u14C3\u14C4\u14C5\u14C7\u14C8\u14D0\u14EF\u14F0\u14F1\u14F2\u14F4\u14F5\u1505\u14D5\u14D6\u14D7\u14D8\u14DA\u14DB\u14EA\u1528\u1529\u152A\u152B\u152D\u2026 \u152E\u153E\u1555\u1556\u1557\u2013\u2014\u201C\u201D\u2018\u2019\u1558\u1559\u155A\u155D\u1546\u1547\u1548\u1549\u154B\u154C\u1550\u157F\u1580\u1581\u1582\u1583\u1584\u1585\u158F\u1590\u1591\u1592\u1593\u1594\u1595\u1671\u1672\u1673\u1674\u1675\u1676\u1596\u15A0\u15A1\u15A2\u15A3\u15A4\u15A5\u15A6\u157C\u0141\u0142",
    "x-mac-ce": "\xC4\u0100\u0101\xC9\u0104\xD6\xDC\xE1\u0105\u010C\xE4\u010D\u0106\u0107\xE9\u0179\u017A\u010E\xED\u010F\u0112\u0113\u0116\xF3\u0117\xF4\xF6\xF5\xFA\u011A\u011B\xFC\u2020\xB0\u0118\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\u0119\xA8\u2260\u0123\u012E\u012F\u012A\u2264\u2265\u012B\u0136\u2202\u2211\u0142\u013B\u013C\u013D\u013E\u0139\u013A\u0145\u0146\u0143\xAC\u221A\u0144\u0147\u2206\xAB\xBB\u2026 \u0148\u0150\xD5\u0151\u014C\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\u014D\u0154\u0155\u0158\u2039\u203A\u0159\u0156\u0157\u0160\u201A\u201E\u0161\u015A\u015B\xC1\u0164\u0165\xCD\u017D\u017E\u016A\xD3\xD4\u016B\u016E\xDA\u016F\u0170\u0171\u0172\u0173\xDD\xFD\u0137\u017B\u0141\u017C\u0122\u02C7",
    macintosh: "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026 \xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7",
    "x-mac-romanian": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\u0102\u0218\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\u0103\u0219\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026 \xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\u2039\u203A\u021A\u021B\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7",
    "x-mac-turkish": "\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026 \xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u011E\u011F\u0130\u0131\u015E\u015F\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\uF8A0\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"
  };
  function Ql(s, o, c, h) {
    let p = Zl[h];
    if (p === void 0) return;
    let m = "";
    for (let b = 0; b < c; b++) {
      let F = s.readUInt8(o + b);
      F <= 127 ? m += String.fromCharCode(F) : m += p[F & 127];
    }
    return m;
  }
});
var addon_ligatures_ss = addon_ligatures_q(Xt => {
  "use strict";

  Object.defineProperty(Xt, "__esModule", {
    value: !0
  });
  function Jl(s) {
    if (s.readUInt32BE(0) !== 1) throw new Error("Unsupported ltag table version.");
    let c = s.readUInt32BE(8),
      h = [];
    for (let p = 0; p < c; p++) {
      let m = "",
        b = s.readUInt16BE(12 + p * 4),
        F = s.readUInt16BE(14 + p * 4);
      for (let U = b; U < b + F; ++U) m += String.fromCharCode(s.readInt8(U));
      h.push(m);
    }
    return h;
  }
  Xt.default = Jl;
});
var addon_ligatures_is = addon_ligatures_q(Yt => {
  "use strict";

  Object.defineProperty(Yt, "__esModule", {
    value: !0
  });
  function Kl(s) {
    if (s.length < 78) return;
    let o = {
      version: s.readUInt16BE(0),
      xAvgCharWidth: s.readUInt16BE(2),
      usWeightClass: s.readUInt16BE(4),
      usWidthClass: s.readUInt16BE(6),
      fsType: s.readUInt16BE(8),
      ySubscriptXSize: s.readInt16BE(10),
      ySubscriptYSize: s.readInt16BE(12),
      ySubscriptXOffset: s.readInt16BE(14),
      ySubscriptYOffset: s.readInt16BE(16),
      ySuperscriptXSize: s.readInt16BE(18),
      ySuperscriptYSize: s.readInt16BE(20),
      ySuperscriptXOffset: s.readInt16BE(22),
      ySuperscriptYOffset: s.readInt16BE(24),
      yStrikeoutSize: s.readInt16BE(26),
      yStrikeoutPosition: s.readInt16BE(28),
      sFamilyClass: s.readInt16BE(30),
      panose: [s.readUInt8(32), s.readUInt8(33), s.readUInt8(34), s.readUInt8(35), s.readUInt8(36), s.readUInt8(37), s.readUInt8(38), s.readUInt8(39), s.readUInt8(40), s.readUInt8(41)],
      ulUnicodeRange1: s.readUInt32BE(42),
      ulUnicodeRange2: s.readUInt32BE(46),
      ulUnicodeRange3: s.readUInt32BE(50),
      ulUnicodeRange4: s.readUInt32BE(54),
      achVendID: String.fromCharCode(s.readUInt8(58), s.readUInt8(59), s.readUInt8(60), s.readUInt8(61)),
      fsSelection: s.readUInt16BE(62),
      usFirstCharIndex: s.readUInt16BE(64),
      usLastCharIndex: s.readUInt16BE(66),
      sTypoAscender: s.readInt16BE(68),
      sTypoDescender: s.readInt16BE(70),
      sTypoLineGap: s.readInt16BE(72),
      usWinAscent: s.readUInt16BE(74),
      usWinDescent: s.readUInt16BE(76)
    };
    return o.version >= 1 && s.length >= 86 && (o.ulCodePageRange1 = s.readUInt32BE(78), o.ulCodePageRange2 = s.readUInt32BE(82)), o.version >= 2 && s.length >= 96 && (o.sxHeight = s.readInt16BE(86), o.sCapHeight = s.readInt16BE(88), o.usDefaultChar = s.readUInt16BE(90), o.usBreakChar = s.readUInt16BE(92), o.usMaxContent = s.readUInt16BE(94)), o;
  }
  Yt.default = Kl;
});
var addon_ligatures_jt = addon_ligatures_q(Xr => {
  "use strict";

  Object.defineProperty(Xr, "__esModule", {
    value: !0
  });
  function $l(s, o) {
    return s + o / 2 ** 16;
  }
  Xr.formatFixed = $l;
  function ef(s, o) {
    return (s * 2 ** 32 + o - 2082844800) * 1e3;
  }
  Xr.formatLongDateTime = ef;
});
var addon_ligatures_os = addon_ligatures_q(Zt => {
  "use strict";

  Object.defineProperty(Zt, "__esModule", {
    value: !0
  });
  var Yr = addon_ligatures_jt();
  function rf(s) {
    return {
      version: Yr.formatFixed(s.readUInt16BE(0), s.readUInt16BE(2)),
      fontRevision: Yr.formatFixed(s.readUInt16BE(4), s.readUInt16BE(6)),
      checkSumAdjustment: s.readUInt32BE(8),
      magicNumber: s.readUInt32BE(12),
      flags: s.readUInt16BE(16),
      unitsPerEm: s.readUInt16BE(18),
      created: Yr.formatLongDateTime(s.readUInt32BE(20), s.readUInt32BE(24)),
      modified: Yr.formatLongDateTime(s.readUInt32BE(28), s.readUInt32BE(32)),
      xMin: s.readInt16BE(36),
      yMin: s.readInt16BE(38),
      xMax: s.readInt16BE(40),
      yMax: s.readInt16BE(42),
      macStyle: s.readUInt16BE(44),
      lowestRecPPEM: s.readUInt16BE(46),
      fontDirectionHint: s.readInt16BE(48),
      indexToLocFormat: s.readInt16BE(50),
      glyphDataFormat: s.readInt16BE(52)
    };
  }
  Zt.default = rf;
});
var addon_ligatures_ls = addon_ligatures_q(Qt => {
  "use strict";

  Object.defineProperty(Qt, "__esModule", {
    value: !0
  });
  var us = addon_ligatures_jt();
  function tf(s) {
    return {
      version: us.formatFixed(s.readUInt16BE(0), s.readUInt16BE(2)),
      italicAngle: us.formatFixed(s.readUInt16BE(4), s.readUInt16BE(6)),
      underlinePosition: s.readInt16BE(8),
      underlineThickness: s.readInt16BE(10),
      isFixedPitch: s.readUInt32BE(12),
      minMemType42: s.readUInt32BE(16),
      maxMemType42: s.readUInt32BE(20),
      minMemType1: s.readUInt32BE(24),
      maxMemType1: s.readUInt32BE(28)
    };
  }
  Qt.default = tf;
});
var addon_ligatures_fs = addon_ligatures_q(Jt => {
  "use strict";

  Object.defineProperty(Jt, "__esModule", {
    value: !0
  });
  var nf = me("fs"),
    af = addon_ligatures_ns(),
    sf = addon_ligatures_as(),
    of = addon_ligatures_ss(),
    uf = addon_ligatures_is(),
    lf = addon_ligatures_os(),
    ff = addon_ligatures_ls(),
    Ge;
  (function (s) {
    s[s.TrueType = 0] = "TrueType", s[s.CFF = 1] = "CFF", s[s.Woff = 2] = "Woff";
  })(Ge || (Ge = {}));
  var sr = {
    name: {
      tag: Buffer.from("name"),
      parse: sf.default
    },
    ltag: {
      tag: Buffer.from("ltag"),
      parse: of.default
    },
    os2: {
      tag: Buffer.from("OS/2"),
      parse: uf.default
    },
    head: {
      tag: Buffer.from("head"),
      parse: lf.default
    },
    post: {
      tag: Buffer.from("post"),
      parse: ff.default
    }
  };
  async function cf(s) {
    return new Promise((o, c) => {
      (async () => {
        let h = af.default(),
          p = nf.createReadStream(s),
          m = !1,
          b = () => {
            m = !0;
          };
        p.once("close", b), p.once("end", b), p.once("error", F => {
          m = !0, c(F);
        }), p.pipe(h);
        try {
          switch (hf(await h.read(4))) {
            case Ge.TrueType:
            case Ge.CFF:
              let U = (await h.read(2)).readUInt16BE(0);
              await h.skip(6);
              let I = await pf(h, U),
                z = Object.entries(I).sort((X, Z) => X[1].offset - Z[1].offset),
                B = {};
              for (let [X, Z] of z) await h.skip(Z.offset - h.offset), B[X] = await h.read(Z.length);
              let W = [];
              if (B.ltag && (W = sr.ltag.parse(B.ltag)), !B.name) throw new Error(`missing required OpenType table 'name' in font file: ${s}`);
              return {
                names: sr.name.parse(B.name, W),
                os2: B.os2 && sr.os2.parse(B.os2),
                head: B.head && sr.head.parse(B.head),
                post: B.post && sr.post.parse(B.post)
              };
            case Ge.Woff:
            default:
              throw new Error("provided font type is not supported yet");
          }
        } finally {
          p.unpipe(h), m || (p.destroy(), h.destroy());
        }
      })().then(o, c);
    });
  }
  Jt.default = cf;
  var gr = {
    one: Buffer.from([0, 1, 0, 0]),
    otto: Buffer.from("OTTO"),
    true: Buffer.from("true"),
    typ1: Buffer.from("typ1"),
    woff: Buffer.from("wOFF")
  };
  function hf(s) {
    if (s.equals(gr.one) || s.equals(gr.true) || s.equals(gr.typ1)) return Ge.TrueType;
    if (s.equals(gr.otto)) return Ge.CFF;
    if (s.equals(gr.woff)) return Ge.Woff;
    throw new Error(`Unsupported signature type: ${s}`);
  }
  async function pf(s, o) {
    let c = {};
    for (let h = 0; h < o; h++) {
      let p = await s.read(4),
        m = await s.read(12);
      for (let [b, F] of Object.entries(sr)) if (p.equals(F.tag) && (c[b] = {
        offset: m.readUInt32BE(4),
        length: m.readUInt32BE(8)
      }, c.name && c.ltag && c.os2)) return c;
    }
    return c;
  }
});
var addon_ligatures_Kt = addon_ligatures_q(Oe => {
  "use strict";

  Object.defineProperty(Oe, "__esModule", {
    value: !0
  });
  var df = me("os"),
    je;
  (function (s) {
    s.Serif = "serif", s.SansSerif = "sansSerif", s.Monospace = "monospace", s.Cursive = "cursive", s.Unknown = "unknown";
  })(je = Oe.Type || (Oe.Type = {}));
  var ye;
  (function (s) {
    s.Regular = "regular", s.Italic = "italic", s.Oblique = "oblique", s.Bold = "bold", s.BoldItalic = "boldItalic", s.BoldOblique = "boldOblique", s.Other = "other";
  })(ye = Oe.Style || (Oe.Style = {}));
  var vf = [" Regular", " Bold", " Bold Italic", " Bold Oblique", " Italic", " Oblique"];
  function gf(s, o) {
    let c = s.names.preferredFamily && s.names.preferredFamily[o] ? s.names.preferredFamily[o] : s.names.fontFamily[o];
    if (df.platform() === "win32") {
      let h = s.names.preferredSubfamily && s.names.preferredSubfamily[o] ? s.names.preferredSubfamily[o] : s.names.fontSubfamily[o],
        p = `${c} ${h}`,
        m = -1;
      for (let b of vf) {
        let F = p.lastIndexOf(b);
        if (F !== -1) {
          m = F;
          break;
        }
      }
      return m !== -1 ? p.substring(0, m) : p;
    }
    return c;
  }
  Oe.name = gf;
  function mf(s) {
    if (s.os2) switch (s.os2.panose[0]) {
      case 2:
        return s.os2.panose[3] === 9 ? je.Monospace : s.os2.panose[1] >= 11 && s.os2.panose[1] <= 15 || s.os2.panose[1] === 0 ? je.SansSerif : je.Serif;
      case 3:
        return je.Cursive;
    } else if (s.post && s.post.isFixedPitch) return je.Monospace;
    return je.Unknown;
  }
  Oe.type = mf;
  function cs(s) {
    if (!s.os2 && !s.head) return ye.Other;
    let o = s.os2 ? s.os2.fsSelection & 32 : s.head.macStyle & 1,
      c = s.os2 ? s.os2.fsSelection & 1 : s.post ? s.post.italicAngle < 0 : s.head.macStyle & 2,
      h = s.os2 ? s.os2.fsSelection & 512 : s.post ? s.post.italicAngle > 0 : 0,
      p = s.os2 ? s.os2.fsSelection & 320 : 1;
    return o ? h ? ye.BoldOblique : c ? ye.BoldItalic : ye.Bold : h ? ye.Oblique : c ? ye.Italic : p ? ye.Regular : ye.Other;
  }
  Oe.style = cs;
  var yf = [ye.Bold, ye.BoldItalic, ye.BoldOblique];
  function xf(s) {
    return s.os2 ? s.os2.usWeightClass : yf.includes(cs(s)) ? 700 : 400;
  }
  Oe.weight = xf;
});
var addon_ligatures_gs = addon_ligatures_q(Be => {
  "use strict";

  var bf = Be && Be.__rest || function (s, o) {
    var c = {};
    for (var h in s) Object.prototype.hasOwnProperty.call(s, h) && o.indexOf(h) < 0 && (c[h] = s[h]);
    if (s != null && typeof Object.getOwnPropertySymbols == "function") for (var p = 0, h = Object.getOwnPropertySymbols(s); p < h.length; p++) o.indexOf(h[p]) < 0 && (c[h[p]] = s[h[p]]);
    return c;
  };
  Object.defineProperty(Be, "__esModule", {
    value: !0
  });
  var Sf = addon_ligatures_rs(),
    hs = addon_ligatures_fs(),
    jr = addon_ligatures_Kt(),
    ps = addon_ligatures_Kt();
  Be.Type = ps.Type;
  Be.Style = ps.Style;
  async function ds(s) {
    let o = Object.assign({
        concurrency: 4,
        language: "en",
        onFontError: null
      }, s),
      c = await Sf.default({
        extensions: ["ttf", "otf"]
      }),
      h = await Uf(async m => {
        try {
          let b = await hs.default(m);
          return vs(m, b, o.language);
        } catch (b) {
          o.onFontError && o.onFontError(m, b);
        }
      }, c, o.concurrency),
      p = {};
    for (let m of h.filter(b => b)) {
      let {
          name: b
        } = m,
        F = bf(m, ["name"]);
      p[b] || (p[b] = []), p[b].push(F);
    }
    return p;
  }
  Be.list = ds;
  async function Ff(s, o) {
    return (await ds(o))[s] || [];
  }
  Be.listVariants = Ff;
  async function Tf(s, o) {
    let c = Object.assign({
        language: "en"
      }, o),
      h = await hs.default(s);
    return vs(s, h, c.language);
  }
  Be.get = Tf;
  function vs(s, o, c) {
    return {
      name: jr.name(o, c),
      path: s,
      type: jr.type(o),
      weight: jr.weight(o),
      style: jr.style(o)
    };
  }
  async function Uf(s, o, c) {
    let h = [],
      p = 0,
      m = async F => {
        h.push(await s(o[F])), p < o.length && (await m(p++));
      },
      b = [];
    for (; p < o.length && p < c; p++) b.push(m(p));
    return await Promise.all(b), h;
  }
});
var addon_ligatures_Ss = addon_ligatures_q(mr => {
  "use strict";

  Object.defineProperty(mr, "__esModule", {
    value: !0
  });
  var xs = addon_ligatures_Ua(),
    Ef = addon_ligatures_Ba(),
    kf = Et(),
    ms = addon_ligatures_Pa(),
    ys = addon_ligatures_Ma(),
    Of = addon_ligatures_Ha(),
    wf = addon_ligatures_qa(),
    Cf = addon_ligatures_Wa(),
    Lf = addon_ligatures_Xa(),
    If = addon_ligatures_ja(),
    Zr = class {
      constructor(o, c) {
        this._lookupTrees = [], this._glyphLookups = {}, this._font = o, c.cacheSize > 0 && (this._cache = new Ef({
          max: c.cacheSize,
          length: (F, U) => U.length
        }));
        let p = (this._font.tables.gsub && this._font.tables.gsub.features.filter(F => F.tag === "calt") || []).reduce((F, U) => [...F, ...U.feature.lookupListIndexes], []),
          m = this._font.tables.gsub && this._font.tables.gsub.lookups || [],
          b = m.filter((F, U) => p.some(I => I === U));
        for (let [F, U] of b.entries()) {
          let I = [];
          switch (U.lookupType) {
            case 6:
              for (let [B, W] of U.subtables.entries()) switch (W.substFormat) {
                case 1:
                  I.push(Of.default(W, m, B));
                  break;
                case 2:
                  I.push(wf.default(W, m, B));
                  break;
                case 3:
                  I.push(Cf.default(W, m, B));
                  break;
              }
              break;
            case 8:
              for (let [B, W] of U.subtables.entries()) I.push(Lf.default(W, B));
              break;
          }
          let z = If.default(kf.default(I));
          this._lookupTrees.push({
            tree: z,
            processForward: U.lookupType !== 8
          });
          for (let B of Object.keys(z)) this._glyphLookups[B] || (this._glyphLookups[B] = []), this._glyphLookups[B].push(F);
        }
      }
      findLigatures(o) {
        let c = this._cache && this._cache.get(o);
        if (c && !Array.isArray(c)) return c;
        let h = [];
        for (let b of o) h.push(this._font.charToGlyphIndex(b));
        if (this._lookupTrees.length === 0) return {
          inputGlyphs: h,
          outputGlyphs: h,
          contextRanges: []
        };
        let p = this._findInternal(h.slice()),
          m = {
            inputGlyphs: h,
            outputGlyphs: p.sequence,
            contextRanges: p.ranges
          };
        return this._cache && this._cache.set(o, m), m;
      }
      findLigatureRanges(o) {
        if (this._lookupTrees.length === 0) return [];
        let c = this._cache && this._cache.get(o);
        if (c) return Array.isArray(c) ? c : c.contextRanges;
        let h = [];
        for (let m of o) h.push(this._font.charToGlyphIndex(m));
        let p = this._findInternal(h);
        return this._cache && this._cache.set(o, p.ranges), p.ranges;
      }
      _findInternal(o) {
        let c = [],
          h = this._getNextLookup(o, 0);
        for (; h.index !== null;) {
          let p = this._lookupTrees[h.index];
          if (p.processForward) {
            let m = h.last;
            for (let b = h.first; b < m; b++) {
              let F = ms.default(p.tree, o, b, b);
              if (F) {
                for (let U = 0; U < F.substitutions.length; U++) {
                  let I = F.substitutions[U];
                  I !== null && (o[b + U] = I);
                }
                ys.default(c, F.contextRange[0] + b, F.contextRange[1] + b), b + F.length >= m && (m = b + F.length + 1), b += F.length - 1;
              }
            }
          } else for (let m = h.last - 1; m >= h.first; m--) {
            let b = ms.default(p.tree, o, m, m);
            if (b) {
              for (let F = 0; F < b.substitutions.length; F++) {
                let U = b.substitutions[F];
                U !== null && (o[m + F] = U);
              }
              ys.default(c, b.contextRange[0] + m, b.contextRange[1] + m), m -= b.length - 1;
            }
          }
          h = this._getNextLookup(o, h.index + 1);
        }
        return {
          sequence: o,
          ranges: c
        };
      }
      _getNextLookup(o, c) {
        let h = {
          index: null,
          first: 1 / 0,
          last: -1
        };
        for (let p = 0; p < o.length; p++) {
          let m = this._glyphLookups[o[p]];
          if (m) for (let b = 0; b < m.length; b++) {
            let F = m[b];
            if (F >= c) {
              (h.index === null || F <= h.index) && (h.index = F, h.first > p && (h.first = p), h.last = p + 1);
              break;
            }
          }
        }
        return h;
      }
    };
  async function Af(s, o) {
    let [c] = await Promise.resolve().then(() => addon_ligatures_gs()).then(h => h.listVariants(s));
    if (!c) throw new Error(`Font ${s} not found`);
    return bs(c.path, o);
  }
  mr.load = Af;
  async function bs(s, o) {
    let c = await Promise.resolve().then(() => me("util")).then(h => h.promisify(xs.load)(s));
    return new Zr(c, Object.assign({
      cacheSize: 0
    }, o));
  }
  mr.loadFile = bs;
  function Bf(s, o) {
    let c = xs.parse(s);
    return new Zr(c, Object.assign({
      cacheSize: 0
    }, o));
  }
  mr.loadBuffer = Bf;
});
var addon_ligatures_Ts = addon_ligatures_ol(addon_ligatures_Ss());
function addon_ligatures_en(s) {
  if (typeof s != "string") throw new Error("Font family must be a string");
  let o = {
      input: s,
      offset: 0
    },
    c = [],
    h = "";
  for (; o.offset < o.input.length;) {
    let p = o.input[o.offset++];
    switch (p) {
      case "'":
      case '"':
        h += Rf(o, p);
        break;
      case ",":
        c.push(h), h = "";
        break;
      default:
        /\s/.test(p) || (o.offset--, h += Df(o), c.push(h), h = "");
    }
  }
  return c;
}
function Rf(s, o) {
  let c = "",
    h = !1;
  for (; s.offset < s.input.length;) {
    let p = s.input[s.offset++];
    if (h) /[\dA-Fa-f]/.test(p) ? (s.offset--, c += addon_ligatures_Fs(s)) : p !== `
` && (c += p), h = !1;else switch (p) {
      case o:
        return c;
      case "\\":
        h = !0;
        break;
      default:
        c += p;
    }
  }
  throw new Error("Unterminated string");
}
function Df(s) {
  let o = "",
    c = !1;
  for (; s.offset < s.input.length;) {
    let h = s.input[s.offset++];
    if (c) /[\dA-Fa-f]/.test(h) ? (s.offset--, o += addon_ligatures_Fs(s)) : o += h, c = !1;else switch (h) {
      case "\\":
        c = !0;
        break;
      case ",":
        return o;
      default:
        /\s/.test(h) ? o.endsWith(" ") || (o += " ") : o += h;
    }
  }
  return o;
}
function addon_ligatures_Fs(s) {
  let o = "";
  for (; s.offset < s.input.length;) {
    let c = s.input[s.offset++];
    if (/\s/.test(c)) return addon_ligatures_$t(o);
    if (o.length >= 6 || !/[\dA-Fa-f]/.test(c)) return s.offset--, addon_ligatures_$t(o);
    o += c;
  }
  return addon_ligatures_$t(o);
}
function addon_ligatures_$t(s) {
  return String.fromCodePoint(parseInt(s, 16));
}
var addon_ligatures_ir;
async function addon_ligatures_rn(s, o) {
  if (!addon_ligatures_ir) {
    if (typeof navigator < "u" && "fonts" in navigator) {
      try {
        let p = await navigator.permissions.request?.({
          name: "local-fonts"
        });
        if (p && p.state !== "granted") throw new Error("Permission to access local fonts not granted.");
      } catch (p) {
        if (p.name !== "TypeError") throw p;
      }
      let h = {};
      try {
        let p = await navigator.fonts.query();
        for (let m of p) h.hasOwnProperty(m.family) || (h[m.family] = []), h[m.family].push(m);
        addon_ligatures_ir = Promise.resolve(h);
      } catch (p) {
        console.error(p.name, p.message);
      }
    } else if (typeof window < "u" && "queryLocalFonts" in window) {
      let h = {};
      try {
        let p = await window.queryLocalFonts();
        for (let m of p) h.hasOwnProperty(m.family) || (h[m.family] = []), h[m.family].push(m);
        addon_ligatures_ir = Promise.resolve(h);
      } catch (p) {
        console.error(p.name, p.message);
      }
    }
    addon_ligatures_ir || (addon_ligatures_ir = Promise.resolve({}));
  }
  let c = await addon_ligatures_ir;
  for (let h of addon_ligatures_en(s)) {
    if (Pf.includes(h)) return;
    if (c.hasOwnProperty(h) && c[h].length > 0) {
      let p = c[h][0];
      if ("blob" in p) {
        let b = await (await p.blob()).arrayBuffer();
        return (0, addon_ligatures_Ts.loadBuffer)(b, {
          cacheSize: o
        });
      }
      return;
    }
  }
}
var Pf = ["serif", "sans-serif", "cursive", "fantasy", "monospace", "system-ui", "emoji", "math", "fangsong"];
var Mf = 1e5;
function addon_ligatures_Us(s, o = []) {
  let c,
    h,
    p = 0,
    m;
  return s.registerCharacterJoiner(b => {
    let F = s.options.fontFamily;
    if (F && (p === 0 || c !== F)) {
      h = void 0, p = 1, c = F;
      let U = c;
      addon_ligatures_rn(U, Mf).then(I => {
        U === s.options.fontFamily && (p = 2, h = I, I && s.refresh(0, s.rows - 1));
      }).catch(I => {
        U === s.options.fontFamily && (p = 3, s.options.logLevel === "debug" && console.debug(m, new Error("Failure while loading font")), h = void 0, m = I);
      });
    }
    return h && p === 2 ? h.findLigatureRanges(b).map(U => [U[0], U[1]]) : Gf(b, o);
  });
}
function Gf(s, o) {
  let c = [];
  for (let h = 0; h < s.length; h++) for (let p = 0; p < o.length; p++) if (s.startsWith(o[p], h)) {
    c.push([h, h + o[p].length]), h += o[p].length - 1;
    break;
  }
  return c;
}
var addon_ligatures_Es = class {
  constructor(o) {
    this._fallbackLigatures = (o?.fallbackLigatures || ["<--", "<---", "<<-", "<-", "->", "->>", "-->", "--->", "<==", "<===", "<<=", "<=", "=>", "=>>", "==>", "===>", ">=", ">>=", "<->", "<-->", "<--->", "<---->", "<=>", "<==>", "<===>", "<====>", "::", ":::", "<~~", "</", "</>", "/>", "~~>", "==", "!=", "/=", "~=", "<>", "===", "!==", "!===", "<:", ":=", "*=", "*+", "<*", "<*>", "*>", "<|", "<|>", "|>", "+*", "=*", "=:", ":>", "/*", "*/", "+++", "<!--", "<!---"]).sort((c, h) => h.length - c.length), this._fontFeatureSettings = o?.fontFeatureSettings;
  }
  activate(o) {
    if (!o.element) throw new Error("Cannot activate LigaturesAddon before open is called");
    this._terminal = o, this._characterJoinerId = addon_ligatures_Us(o, this._fallbackLigatures), o.element.style.fontFeatureSettings = this._fontFeatureSettings ?? '"calt" on';
  }
  dispose() {
    this._characterJoinerId !== void 0 && (this._terminal?.deregisterCharacterJoiner(this._characterJoinerId), this._characterJoinerId = void 0), this._terminal?.element && (this._terminal.element.style.fontFeatureSettings = "");
  }
};

;// ./node_modules/@xterm/addon-search/lib/addon-search.mjs
/**
 * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
 * @license MIT
 *
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * @license MIT
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
var addon_search_Re = class {
    constructor() {
      this.listeners = [], this.unexpectedErrorHandler = function (e) {
        setTimeout(() => {
          throw e.stack ? addon_search_ae.isErrorNoTelemetry(e) ? new addon_search_ae(e.message + `

` + e.stack) : new Error(e.message + `

` + e.stack) : e;
        }, 0);
      };
    }
    addListener(e) {
      return this.listeners.push(e), () => {
        this._removeListener(e);
      };
    }
    emit(e) {
      this.listeners.forEach(t => {
        t(e);
      });
    }
    _removeListener(e) {
      this.listeners.splice(this.listeners.indexOf(e), 1);
    }
    setUnexpectedErrorHandler(e) {
      this.unexpectedErrorHandler = e;
    }
    getUnexpectedErrorHandler() {
      return this.unexpectedErrorHandler;
    }
    onUnexpectedError(e) {
      this.unexpectedErrorHandler(e), this.emit(e);
    }
    onUnexpectedExternalError(e) {
      this.unexpectedErrorHandler(e);
    }
  },
  addon_search_pt = new addon_search_Re();
function le(r) {
  addon_search_ft(r) || addon_search_pt.onUnexpectedError(r);
}
var addon_search_Ce = "Canceled";
function addon_search_ft(r) {
  return r instanceof addon_search_ee ? !0 : r instanceof Error && r.name === addon_search_Ce && r.message === addon_search_Ce;
}
var addon_search_ee = class extends Error {
  constructor() {
    super(addon_search_Ce), this.name = this.message;
  }
};
var addon_search_ae = class r extends Error {
  constructor(e) {
    super(e), this.name = "CodeExpectedError";
  }
  static fromError(e) {
    if (e instanceof r) return e;
    let t = new r();
    return t.message = e.message, t.stack = e.stack, t;
  }
  static isErrorNoTelemetry(e) {
    return e.name === "CodeExpectedError";
  }
};
function addon_search_mt(r, e, t = 0, n = r.length) {
  let i = t,
    s = n;
  for (; i < s;) {
    let a = Math.floor((i + s) / 2);
    e(r[a]) ? i = a + 1 : s = a;
  }
  return i - 1;
}
var addon_search_ue = class ue {
  constructor(e) {
    this._array = e;
    this._findLastMonotonousLastIdx = 0;
  }
  findLastMonotonous(e) {
    if (ue.assertInvariants) {
      if (this._prevFindLastPredicate) {
        for (let n of this._array) if (this._prevFindLastPredicate(n) && !e(n)) throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");
      }
      this._prevFindLastPredicate = e;
    }
    let t = addon_search_mt(this._array, e, this._findLastMonotonousLastIdx);
    return this._findLastMonotonousLastIdx = t + 1, t === -1 ? void 0 : this._array[t];
  }
};
addon_search_ue.assertInvariants = !1;
var Ke = (/* unused pure expression or super */ null && (addon_search_ue));
var Qe;
(h => {
  function r(u) {
    return u < 0;
  }
  h.isLessThan = r;
  function e(u) {
    return u <= 0;
  }
  h.isLessThanOrEqual = e;
  function t(u) {
    return u > 0;
  }
  h.isGreaterThan = t;
  function n(u) {
    return u === 0;
  }
  h.isNeitherLessOrGreaterThan = n, h.greaterThan = 1, h.lessThan = -1, h.neitherLessOrGreaterThan = 0;
})(Qe ||= {});
function addon_search_$e(r, e) {
  return (t, n) => e(r(t), r(n));
}
var addon_search_Be = (r, e) => r - e;
var addon_search_V = class V {
  constructor(e) {
    this.iterate = e;
  }
  forEach(e) {
    this.iterate(t => (e(t), !0));
  }
  toArray() {
    let e = [];
    return this.iterate(t => (e.push(t), !0)), e;
  }
  filter(e) {
    return new V(t => this.iterate(n => e(n) ? t(n) : !0));
  }
  map(e) {
    return new V(t => this.iterate(n => t(e(n))));
  }
  some(e) {
    let t = !1;
    return this.iterate(n => (t = e(n), !t)), t;
  }
  findFirst(e) {
    let t;
    return this.iterate(n => e(n) ? (t = n, !1) : !0), t;
  }
  findLast(e) {
    let t;
    return this.iterate(n => (e(n) && (t = n), !0)), t;
  }
  findLastMaxBy(e) {
    let t,
      n = !0;
    return this.iterate(i => ((n || Qe.isGreaterThan(e(i, t))) && (n = !1, t = i), !0)), t;
  }
};
addon_search_V.empty = new addon_search_V(e => {});
var addon_search_He = (/* unused pure expression or super */ null && (addon_search_V));
function addon_search_Xe(r, e) {
  let t = Object.create(null);
  for (let n of r) {
    let i = e(n),
      s = t[i];
    s || (s = t[i] = []), s.push(n);
  }
  return t;
}
var addon_search_Ye,
  addon_search_Je,
  Ge = class {
    constructor(e, t) {
      this.toKey = t;
      this._map = new Map();
      this[addon_search_Ye] = "SetWithKey";
      for (let n of e) this.add(n);
    }
    get size() {
      return this._map.size;
    }
    add(e) {
      let t = this.toKey(e);
      return this._map.set(t, e), this;
    }
    delete(e) {
      return this._map.delete(this.toKey(e));
    }
    has(e) {
      return this._map.has(this.toKey(e));
    }
    *entries() {
      for (let e of this._map.values()) yield [e, e];
    }
    keys() {
      return this.values();
    }
    *values() {
      for (let e of this._map.values()) yield e;
    }
    clear() {
      this._map.clear();
    }
    forEach(e, t) {
      this._map.forEach(n => e.call(t, n, n, this));
    }
    [(addon_search_Je = Symbol.iterator, addon_search_Ye = Symbol.toStringTag, addon_search_Je)]() {
      return this.values();
    }
  };
var addon_search_ce = class {
  constructor() {
    this.map = new Map();
  }
  add(e, t) {
    let n = this.map.get(e);
    n || (n = new Set(), this.map.set(e, n)), n.add(t);
  }
  delete(e, t) {
    let n = this.map.get(e);
    n && (n.delete(t), n.size === 0 && this.map.delete(e));
  }
  forEach(e, t) {
    let n = this.map.get(e);
    n && n.forEach(t);
  }
  get(e) {
    let t = this.map.get(e);
    return t || new Set();
  }
};
function Pe(r, e) {
  let t = this,
    n = !1,
    i;
  return function () {
    if (n) return i;
    if (n = !0, e) try {
      i = r.apply(t, arguments);
    } finally {
      e();
    } else i = r.apply(t, arguments);
    return i;
  };
}
var addon_search_Le;
(z => {
  function r(m) {
    return m && typeof m == "object" && typeof m[Symbol.iterator] == "function";
  }
  z.is = r;
  let e = Object.freeze([]);
  function t() {
    return e;
  }
  z.empty = t;
  function* n(m) {
    yield m;
  }
  z.single = n;
  function i(m) {
    return r(m) ? m : n(m);
  }
  z.wrap = i;
  function s(m) {
    return m || e;
  }
  z.from = s;
  function* a(m) {
    for (let _ = m.length - 1; _ >= 0; _--) yield m[_];
  }
  z.reverse = a;
  function h(m) {
    return !m || m[Symbol.iterator]().next().done === !0;
  }
  z.isEmpty = h;
  function u(m) {
    return m[Symbol.iterator]().next().value;
  }
  z.first = u;
  function p(m, _) {
    let y = 0;
    for (let L of m) if (_(L, y++)) return !0;
    return !1;
  }
  z.some = p;
  function T(m, _) {
    for (let y of m) if (_(y)) return y;
  }
  z.find = T;
  function* v(m, _) {
    for (let y of m) _(y) && (yield y);
  }
  z.filter = v;
  function* I(m, _) {
    let y = 0;
    for (let L of m) yield _(L, y++);
  }
  z.map = I;
  function* E(m, _) {
    let y = 0;
    for (let L of m) yield* _(L, y++);
  }
  z.flatMap = E;
  function* S(...m) {
    for (let _ of m) yield* _;
  }
  z.concat = S;
  function D(m, _, y) {
    let L = y;
    for (let X of m) L = _(L, X);
    return L;
  }
  z.reduce = D;
  function* x(m, _, y = m.length) {
    for (_ < 0 && (_ += m.length), y < 0 ? y += m.length : y > m.length && (y = m.length); _ < y; _++) yield m[_];
  }
  z.slice = x;
  function J(m, _ = Number.POSITIVE_INFINITY) {
    let y = [];
    if (_ === 0) return [y, m];
    let L = m[Symbol.iterator]();
    for (let X = 0; X < _; X++) {
      let Se = L.next();
      if (Se.done) return [y, z.empty()];
      y.push(Se.value);
    }
    return [y, {
      [Symbol.iterator]() {
        return L;
      }
    }];
  }
  z.consume = J;
  async function q(m) {
    let _ = [];
    for await (let y of m) _.push(y);
    return Promise.resolve(_);
  }
  z.asyncToArray = q;
})(addon_search_Le ||= {});
var addon_search_Tt = !1,
  addon_search_K = null,
  addon_search_de = class de {
    constructor() {
      this.livingDisposables = new Map();
    }
    getDisposableData(e) {
      let t = this.livingDisposables.get(e);
      return t || (t = {
        parent: null,
        source: null,
        isSingleton: !1,
        value: e,
        idx: de.idx++
      }, this.livingDisposables.set(e, t)), t;
    }
    trackDisposable(e) {
      let t = this.getDisposableData(e);
      t.source || (t.source = new Error().stack);
    }
    setParent(e, t) {
      let n = this.getDisposableData(e);
      n.parent = t;
    }
    markAsDisposed(e) {
      this.livingDisposables.delete(e);
    }
    markAsSingleton(e) {
      this.getDisposableData(e).isSingleton = !0;
    }
    getRootParent(e, t) {
      let n = t.get(e);
      if (n) return n;
      let i = e.parent ? this.getRootParent(this.getDisposableData(e.parent), t) : e;
      return t.set(e, i), i;
    }
    getTrackedDisposables() {
      let e = new Map();
      return [...this.livingDisposables.entries()].filter(([, n]) => n.source !== null && !this.getRootParent(n, e).isSingleton).flatMap(([n]) => n);
    }
    computeLeakingDisposables(e = 10, t) {
      let n;
      if (t) n = t;else {
        let u = new Map(),
          p = [...this.livingDisposables.values()].filter(v => v.source !== null && !this.getRootParent(v, u).isSingleton);
        if (p.length === 0) return;
        let T = new Set(p.map(v => v.value));
        if (n = p.filter(v => !(v.parent && T.has(v.parent))), n.length === 0) throw new Error("There are cyclic diposable chains!");
      }
      if (!n) return;
      function i(u) {
        function p(v, I) {
          for (; v.length > 0 && I.some(E => typeof E == "string" ? E === v[0] : v[0].match(E));) v.shift();
        }
        let T = u.source.split(`
`).map(v => v.trim().replace("at ", "")).filter(v => v !== "");
        return p(T, ["Error", /^trackDisposable \(.*\)$/, /^DisposableTracker.trackDisposable \(.*\)$/]), T.reverse();
      }
      let s = new addon_search_ce();
      for (let u of n) {
        let p = i(u);
        for (let T = 0; T <= p.length; T++) s.add(p.slice(0, T).join(`
`), u);
      }
      n.sort(addon_search_$e(u => u.idx, addon_search_Be));
      let a = "",
        h = 0;
      for (let u of n.slice(0, e)) {
        h++;
        let p = i(u),
          T = [];
        for (let v = 0; v < p.length; v++) {
          let I = p[v];
          I = `(shared with ${s.get(p.slice(0, v + 1).join(`
`)).size}/${n.length} leaks) at ${I}`;
          let S = s.get(p.slice(0, v).join(`
`)),
            D = addon_search_Xe([...S].map(x => i(x)[v]), x => x);
          delete D[p[v]];
          for (let [x, J] of Object.entries(D)) T.unshift(`    - stacktraces of ${J.length} other leaks continue with ${x}`);
          T.unshift(I);
        }
        a += `


==================== Leaking disposable ${h}/${n.length}: ${u.value.constructor.name} ====================
${T.join(`
`)}
============================================================

`;
      }
      return n.length > e && (a += `


... and ${n.length - e} more leaking disposables

`), {
        leaks: n,
        details: a
      };
    }
  };
addon_search_de.idx = 0;
var addon_search_Ze = (/* unused pure expression or super */ null && (addon_search_de));
function addon_search_vt(r) {
  addon_search_K = r;
}
if (addon_search_Tt) {
  let r = "__is_disposable_tracked__";
  addon_search_vt(new class {
    trackDisposable(e) {
      let t = new Error("Potentially leaked disposable").stack;
      setTimeout(() => {
        e[r] || console.log(t);
      }, 3e3);
    }
    setParent(e, t) {
      if (e && e !== addon_search_k.None) try {
        e[r] = !0;
      } catch {}
    }
    markAsDisposed(e) {
      if (e && e !== addon_search_k.None) try {
        e[r] = !0;
      } catch {}
    }
    markAsSingleton(e) {}
  }());
}
function addon_search_pe(r) {
  return addon_search_K?.trackDisposable(r), r;
}
function addon_search_fe(r) {
  addon_search_K?.markAsDisposed(r);
}
function te(r, e) {
  addon_search_K?.setParent(r, e);
}
function addon_search_bt(r, e) {
  if (addon_search_K) for (let t of r) addon_search_K.setParent(t, e);
}
function addon_search_Q(r) {
  if (addon_search_Le.is(r)) {
    let e = [];
    for (let t of r) if (t) try {
      t.dispose();
    } catch (n) {
      e.push(n);
    }
    if (e.length === 1) throw e[0];
    if (e.length > 1) throw new AggregateError(e, "Encountered errors while disposing of store");
    return Array.isArray(r) ? [] : r;
  } else if (r) return r.dispose(), r;
}
function addon_search_me(...r) {
  let e = addon_search_A(() => addon_search_Q(r));
  return addon_search_bt(r, e), e;
}
function addon_search_A(r) {
  let e = addon_search_pe({
    dispose: Pe(() => {
      addon_search_fe(e), r();
    })
  });
  return e;
}
var addon_search_he = class he {
  constructor() {
    this._toDispose = new Set();
    this._isDisposed = !1;
    addon_search_pe(this);
  }
  dispose() {
    this._isDisposed || (addon_search_fe(this), this._isDisposed = !0, this.clear());
  }
  get isDisposed() {
    return this._isDisposed;
  }
  clear() {
    if (this._toDispose.size !== 0) try {
      addon_search_Q(this._toDispose);
    } finally {
      this._toDispose.clear();
    }
  }
  add(e) {
    if (!e) return e;
    if (e === this) throw new Error("Cannot register a disposable on itself!");
    return te(e, this), this._isDisposed ? he.DISABLE_DISPOSED_WARNING || console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack) : this._toDispose.add(e), e;
  }
  delete(e) {
    if (e) {
      if (e === this) throw new Error("Cannot dispose a disposable on itself!");
      this._toDispose.delete(e), e.dispose();
    }
  }
  deleteAndLeak(e) {
    e && this._toDispose.has(e) && (this._toDispose.delete(e), te(e, null));
  }
};
addon_search_he.DISABLE_DISPOSED_WARNING = !1;
var addon_search_H = addon_search_he,
  addon_search_k = class {
    constructor() {
      this._store = new addon_search_H();
      addon_search_pe(this), te(this._store, this);
    }
    dispose() {
      addon_search_fe(this), this._store.dispose();
    }
    _register(e) {
      if (e === this) throw new Error("Cannot register a disposable on itself!");
      return this._store.add(e);
    }
  };
addon_search_k.None = Object.freeze({
  dispose() {}
});
var addon_search_F = class {
  constructor() {
    this._isDisposed = !1;
    addon_search_pe(this);
  }
  get value() {
    return this._isDisposed ? void 0 : this._value;
  }
  set value(e) {
    this._isDisposed || e === this._value || (this._value?.dispose(), e && te(e, this), this._value = e);
  }
  clear() {
    this.value = void 0;
  }
  dispose() {
    this._isDisposed = !0, addon_search_fe(this), this._value?.dispose(), this._value = void 0;
  }
  clearAndLeak() {
    let e = this._value;
    return this._value = void 0, e && te(e, null), e;
  }
};
var addon_search_$ = class $ {
  constructor(e) {
    this.element = e, this.next = $.Undefined, this.prev = $.Undefined;
  }
};
addon_search_$.Undefined = new addon_search_$(void 0);
var et = (/* unused pure expression or super */ null && (addon_search_$));
var addon_search_t = globalThis.performance && typeof globalThis.performance.now == "function",
  addon_search_Te = class r {
    static create(e) {
      return new r(e);
    }
    constructor(e) {
      this._now = addon_search_t && e === !1 ? Date.now : globalThis.performance.now.bind(globalThis.performance), this._startTime = this._now(), this._stopTime = -1;
    }
    stop() {
      this._stopTime = this._now();
    }
    reset() {
      this._startTime = this._now(), this._stopTime = -1;
    }
    elapsed() {
      return this._stopTime !== -1 ? this._stopTime - this._startTime : this._now() - this._startTime;
    }
  };
var addon_search_gt = !1,
  tt = !1,
  yt = !1,
  addon_search_ie;
(re => {
  re.None = () => addon_search_k.None;
  function e(d) {
    if (yt) {
      let {
          onDidAddListener: o
        } = d,
        c = addon_search_ne.create(),
        l = 0;
      d.onDidAddListener = () => {
        ++l === 2 && (console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"), c.print()), o?.();
      };
    }
  }
  function t(d, o) {
    return I(d, () => {}, 0, void 0, !0, void 0, o);
  }
  re.defer = t;
  function n(d) {
    return (o, c = null, l) => {
      let f = !1,
        b;
      return b = d(g => {
        if (!f) return b ? b.dispose() : f = !0, o.call(c, g);
      }, null, l), f && b.dispose(), b;
    };
  }
  re.once = n;
  function i(d, o, c) {
    return T((l, f = null, b) => d(g => l.call(f, o(g)), null, b), c);
  }
  re.map = i;
  function s(d, o, c) {
    return T((l, f = null, b) => d(g => {
      o(g), l.call(f, g);
    }, null, b), c);
  }
  re.forEach = s;
  function a(d, o, c) {
    return T((l, f = null, b) => d(g => o(g) && l.call(f, g), null, b), c);
  }
  re.filter = a;
  function h(d) {
    return d;
  }
  re.signal = h;
  function u(...d) {
    return (o, c = null, l) => {
      let f = addon_search_me(...d.map(b => b(g => o.call(c, g))));
      return v(f, l);
    };
  }
  re.any = u;
  function p(d, o, c, l) {
    let f = c;
    return i(d, b => (f = o(f, b), f), l);
  }
  re.reduce = p;
  function T(d, o) {
    let c,
      l = {
        onWillAddFirstListener() {
          c = d(f.fire, f);
        },
        onDidRemoveLastListener() {
          c?.dispose();
        }
      };
    o || e(l);
    let f = new addon_search_C(l);
    return o?.add(f), f.event;
  }
  function v(d, o) {
    return o instanceof Array ? o.push(d) : o && o.add(d), d;
  }
  function I(d, o, c = 100, l = !1, f = !1, b, g) {
    let w,
      R,
      U,
      se = 0,
      Z,
      Ve = {
        leakWarningThreshold: b,
        onWillAddFirstListener() {
          w = d(dt => {
            se++, R = o(R, dt), l && !U && (oe.fire(R), R = void 0), Z = () => {
              let ht = R;
              R = void 0, U = void 0, (!l || se > 1) && oe.fire(ht), se = 0;
            }, typeof c == "number" ? (clearTimeout(U), U = setTimeout(Z, c)) : U === void 0 && (U = 0, queueMicrotask(Z));
          });
        },
        onWillRemoveListener() {
          f && se > 0 && Z?.();
        },
        onDidRemoveLastListener() {
          Z = void 0, w.dispose();
        }
      };
    g || e(Ve);
    let oe = new addon_search_C(Ve);
    return g?.add(oe), oe.event;
  }
  re.debounce = I;
  function E(d, o = 0, c) {
    return re.debounce(d, (l, f) => l ? (l.push(f), l) : [f], o, void 0, !0, void 0, c);
  }
  re.accumulate = E;
  function S(d, o = (l, f) => l === f, c) {
    let l = !0,
      f;
    return a(d, b => {
      let g = l || !o(b, f);
      return l = !1, f = b, g;
    }, c);
  }
  re.latch = S;
  function D(d, o, c) {
    return [re.filter(d, o, c), re.filter(d, l => !o(l), c)];
  }
  re.split = D;
  function x(d, o = !1, c = [], l) {
    let f = c.slice(),
      b = d(R => {
        f ? f.push(R) : w.fire(R);
      });
    l && l.add(b);
    let g = () => {
        f?.forEach(R => w.fire(R)), f = null;
      },
      w = new addon_search_C({
        onWillAddFirstListener() {
          b || (b = d(R => w.fire(R)), l && l.add(b));
        },
        onDidAddFirstListener() {
          f && (o ? setTimeout(g) : g());
        },
        onDidRemoveLastListener() {
          b && b.dispose(), b = null;
        }
      });
    return l && l.add(w), w.event;
  }
  re.buffer = x;
  function J(d, o) {
    return (l, f, b) => {
      let g = o(new z());
      return d(function (w) {
        let R = g.evaluate(w);
        R !== q && l.call(f, R);
      }, void 0, b);
    };
  }
  re.chain = J;
  let q = Symbol("HaltChainable");
  class z {
    constructor() {
      this.steps = [];
    }
    map(o) {
      return this.steps.push(o), this;
    }
    forEach(o) {
      return this.steps.push(c => (o(c), c)), this;
    }
    filter(o) {
      return this.steps.push(c => o(c) ? c : q), this;
    }
    reduce(o, c) {
      let l = c;
      return this.steps.push(f => (l = o(l, f), l)), this;
    }
    latch(o = (c, l) => c === l) {
      let c = !0,
        l;
      return this.steps.push(f => {
        let b = c || !o(f, l);
        return c = !1, l = f, b ? f : q;
      }), this;
    }
    evaluate(o) {
      for (let c of this.steps) if (o = c(o), o === q) break;
      return o;
    }
  }
  function m(d, o, c = l => l) {
    let l = (...w) => g.fire(c(...w)),
      f = () => d.on(o, l),
      b = () => d.removeListener(o, l),
      g = new addon_search_C({
        onWillAddFirstListener: f,
        onDidRemoveLastListener: b
      });
    return g.event;
  }
  re.fromNodeEventEmitter = m;
  function _(d, o, c = l => l) {
    let l = (...w) => g.fire(c(...w)),
      f = () => d.addEventListener(o, l),
      b = () => d.removeEventListener(o, l),
      g = new addon_search_C({
        onWillAddFirstListener: f,
        onDidRemoveLastListener: b
      });
    return g.event;
  }
  re.fromDOMEventEmitter = _;
  function y(d) {
    return new Promise(o => n(d)(o));
  }
  re.toPromise = y;
  function L(d) {
    let o = new addon_search_C();
    return d.then(c => {
      o.fire(c);
    }, () => {
      o.fire(void 0);
    }).finally(() => {
      o.dispose();
    }), o.event;
  }
  re.fromPromise = L;
  function X(d, o) {
    return d(c => o.fire(c));
  }
  re.forward = X;
  function Se(d, o, c) {
    return o(c), d(l => o(l));
  }
  re.runAndSubscribe = Se;
  class ct {
    constructor(o, c) {
      this._observable = o;
      this._counter = 0;
      this._hasChanged = !1;
      let l = {
        onWillAddFirstListener: () => {
          o.addObserver(this);
        },
        onDidRemoveLastListener: () => {
          o.removeObserver(this);
        }
      };
      c || e(l), this.emitter = new addon_search_C(l), c && c.add(this.emitter);
    }
    beginUpdate(o) {
      this._counter++;
    }
    handlePossibleChange(o) {}
    handleChange(o, c) {
      this._hasChanged = !0;
    }
    endUpdate(o) {
      this._counter--, this._counter === 0 && (this._observable.reportChanges(), this._hasChanged && (this._hasChanged = !1, this.emitter.fire(this._observable.get())));
    }
  }
  function zt(d, o) {
    return new ct(d, o).emitter.event;
  }
  re.fromObservable = zt;
  function Ut(d) {
    return (o, c, l) => {
      let f = 0,
        b = !1,
        g = {
          beginUpdate() {
            f++;
          },
          endUpdate() {
            f--, f === 0 && (d.reportChanges(), b && (b = !1, o.call(c)));
          },
          handlePossibleChange() {},
          handleChange() {
            b = !0;
          }
        };
      d.addObserver(g), d.reportChanges();
      let w = {
        dispose() {
          d.removeObserver(g);
        }
      };
      return l instanceof addon_search_H ? l.add(w) : Array.isArray(l) && l.push(w), w;
    };
  }
  re.fromObservableLight = Ut;
})(addon_search_ie ||= {});
var addon_search_B = class B {
  constructor(e) {
    this.listenerCount = 0;
    this.invocationCount = 0;
    this.elapsedOverall = 0;
    this.durations = [];
    this.name = `${e}_${B._idPool++}`, B.all.add(this);
  }
  start(e) {
    this._stopWatch = new addon_search_Te(), this.listenerCount = e;
  }
  stop() {
    if (this._stopWatch) {
      let e = this._stopWatch.elapsed();
      this.durations.push(e), this.elapsedOverall += e, this.invocationCount += 1, this._stopWatch = void 0;
    }
  }
};
addon_search_B.all = new Set(), addon_search_B._idPool = 0;
var Oe = addon_search_B,
  addon_search_nt = -1;
var addon_search_be = class be {
  constructor(e, t, n = (be._idPool++).toString(16).padStart(3, "0")) {
    this._errorHandler = e;
    this.threshold = t;
    this.name = n;
    this._warnCountdown = 0;
  }
  dispose() {
    this._stacks?.clear();
  }
  check(e, t) {
    let n = this.threshold;
    if (n <= 0 || t < n) return;
    this._stacks || (this._stacks = new Map());
    let i = this._stacks.get(e.value) || 0;
    if (this._stacks.set(e.value, i + 1), this._warnCountdown -= 1, this._warnCountdown <= 0) {
      this._warnCountdown = n * .5;
      let [s, a] = this.getMostFrequentStack(),
        h = `[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${a}):`;
      console.warn(h), console.warn(s);
      let u = new Me(h, s);
      this._errorHandler(u);
    }
    return () => {
      let s = this._stacks.get(e.value) || 0;
      this._stacks.set(e.value, s - 1);
    };
  }
  getMostFrequentStack() {
    if (!this._stacks) return;
    let e,
      t = 0;
    for (let [n, i] of this._stacks) (!e || t < i) && (e = [n, i], t = i);
    return e;
  }
};
addon_search_be._idPool = 1;
var addon_search_Ae = addon_search_be,
  addon_search_ne = class r {
    constructor(e) {
      this.value = e;
    }
    static create() {
      let e = new Error();
      return new r(e.stack ?? "");
    }
    print() {
      console.warn(this.value.split(`
`).slice(2).join(`
`));
    }
  },
  Me = class extends Error {
    constructor(e, t) {
      super(e), this.name = "ListenerLeakError", this.stack = t;
    }
  },
  addon_search_Fe = class extends Error {
    constructor(e, t) {
      super(e), this.name = "ListenerRefusalError", this.stack = t;
    }
  },
  addon_search_xt = 0,
  addon_search_G = class {
    constructor(e) {
      this.value = e;
      this.id = addon_search_xt++;
    }
  },
  addon_search_It = 2,
  addon_search_Dt = (r, e) => {
    if (r instanceof addon_search_G) e(r);else for (let t = 0; t < r.length; t++) {
      let n = r[t];
      n && e(n);
    }
  },
  addon_search_ve;
if (addon_search_gt) {
  let r = [];
  setInterval(() => {
    r.length !== 0 && (console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"), console.warn(r.join(`
`)), r.length = 0);
  }, 3e3), addon_search_ve = new FinalizationRegistry(e => {
    typeof e == "string" && r.push(e);
  });
}
var addon_search_C = class {
  constructor(e) {
    this._size = 0;
    this._options = e, this._leakageMon = addon_search_nt > 0 || this._options?.leakWarningThreshold ? new addon_search_Ae(e?.onListenerError ?? le, this._options?.leakWarningThreshold ?? addon_search_nt) : void 0, this._perfMon = this._options?._profName ? new Oe(this._options._profName) : void 0, this._deliveryQueue = this._options?.deliveryQueue;
  }
  dispose() {
    if (!this._disposed) {
      if (this._disposed = !0, this._deliveryQueue?.current === this && this._deliveryQueue.reset(), this._listeners) {
        if (tt) {
          let e = this._listeners;
          queueMicrotask(() => {
            addon_search_Dt(e, t => t.stack?.print());
          });
        }
        this._listeners = void 0, this._size = 0;
      }
      this._options?.onDidRemoveLastListener?.(), this._leakageMon?.dispose();
    }
  }
  get event() {
    return this._event ??= (e, t, n) => {
      if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) {
        let u = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;
        console.warn(u);
        let p = this._leakageMon.getMostFrequentStack() ?? ["UNKNOWN stack", -1],
          T = new addon_search_Fe(`${u}. HINT: Stack shows most frequent listener (${p[1]}-times)`, p[0]);
        return (this._options?.onListenerError || le)(T), addon_search_k.None;
      }
      if (this._disposed) return addon_search_k.None;
      t && (e = e.bind(t));
      let i = new addon_search_G(e),
        s,
        a;
      this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * .2) && (i.stack = addon_search_ne.create(), s = this._leakageMon.check(i.stack, this._size + 1)), tt && (i.stack = a ?? addon_search_ne.create()), this._listeners ? this._listeners instanceof addon_search_G ? (this._deliveryQueue ??= new addon_search_Ne(), this._listeners = [this._listeners, i]) : this._listeners.push(i) : (this._options?.onWillAddFirstListener?.(this), this._listeners = i, this._options?.onDidAddFirstListener?.(this)), this._size++;
      let h = addon_search_A(() => {
        addon_search_ve?.unregister(h), s?.(), this._removeListener(i);
      });
      if (n instanceof addon_search_H ? n.add(h) : Array.isArray(n) && n.push(h), addon_search_ve) {
        let u = new Error().stack.split(`
`).slice(2, 3).join(`
`).trim(),
          p = /(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(u);
        addon_search_ve.register(h, p?.[2] ?? u, h);
      }
      return h;
    }, this._event;
  }
  _removeListener(e) {
    if (this._options?.onWillRemoveListener?.(this), !this._listeners) return;
    if (this._size === 1) {
      this._listeners = void 0, this._options?.onDidRemoveLastListener?.(this), this._size = 0;
      return;
    }
    let t = this._listeners,
      n = t.indexOf(e);
    if (n === -1) throw console.log("disposed?", this._disposed), console.log("size?", this._size), console.log("arr?", JSON.stringify(this._listeners)), new Error("Attempted to dispose unknown listener");
    this._size--, t[n] = void 0;
    let i = this._deliveryQueue.current === this;
    if (this._size * addon_search_It <= t.length) {
      let s = 0;
      for (let a = 0; a < t.length; a++) t[a] ? t[s++] = t[a] : i && (this._deliveryQueue.end--, s < this._deliveryQueue.i && this._deliveryQueue.i--);
      t.length = s;
    }
  }
  _deliver(e, t) {
    if (!e) return;
    let n = this._options?.onListenerError || le;
    if (!n) {
      e.value(t);
      return;
    }
    try {
      e.value(t);
    } catch (i) {
      n(i);
    }
  }
  _deliverQueue(e) {
    let t = e.current._listeners;
    for (; e.i < e.end;) this._deliver(t[e.i++], e.value);
    e.reset();
  }
  fire(e) {
    if (this._deliveryQueue?.current && (this._deliverQueue(this._deliveryQueue), this._perfMon?.stop()), this._perfMon?.start(this._size), this._listeners) if (this._listeners instanceof addon_search_G) this._deliver(this._listeners, e);else {
      let t = this._deliveryQueue;
      t.enqueue(this, e, this._listeners.length), this._deliverQueue(t);
    }
    this._perfMon?.stop();
  }
  hasListeners() {
    return this._size > 0;
  }
};
var addon_search_Ne = class {
  constructor() {
    this.i = -1;
    this.end = 0;
  }
  enqueue(e, t, n) {
    this.i = 0, this.end = n, this.current = e, this.value = t;
  }
  reset() {
    this.i = this.end, this.current = void 0, this.value = void 0;
  }
};
var it = Object.freeze(function (r, e) {
    let t = setTimeout(r.bind(e), 0);
    return {
      dispose() {
        clearTimeout(t);
      }
    };
  }),
  addon_search_Et;
(n => {
  function r(i) {
    return i === n.None || i === n.Cancelled || i instanceof addon_search_We ? !0 : !i || typeof i != "object" ? !1 : typeof i.isCancellationRequested == "boolean" && typeof i.onCancellationRequested == "function";
  }
  n.isCancellationToken = r, n.None = Object.freeze({
    isCancellationRequested: !1,
    onCancellationRequested: addon_search_ie.None
  }), n.Cancelled = Object.freeze({
    isCancellationRequested: !0,
    onCancellationRequested: it
  });
})(addon_search_Et ||= {});
var addon_search_We = class {
  constructor() {
    this._isCancelled = !1;
    this._emitter = null;
  }
  cancel() {
    this._isCancelled || (this._isCancelled = !0, this._emitter && (this._emitter.fire(void 0), this.dispose()));
  }
  get isCancellationRequested() {
    return this._isCancelled;
  }
  get onCancellationRequested() {
    return this._isCancelled ? it : (this._emitter || (this._emitter = new addon_search_C()), this._emitter.event);
  }
  dispose() {
    this._emitter && (this._emitter.dispose(), this._emitter = null);
  }
};
var addon_search_Y = "en",
  addon_search_qe = !1,
  ze = !1,
  addon_search_ge = !1,
  addon_search_wt = (/* unused pure expression or super */ null && (!1)),
  addon_search_kt = (/* unused pure expression or super */ null && (!1)),
  addon_search_st = !1,
  addon_search_St = (/* unused pure expression or super */ null && (!1)),
  addon_search_Rt = (/* unused pure expression or super */ null && (!1)),
  addon_search_Ct = (/* unused pure expression or super */ null && (!1)),
  addon_search_Pt = (/* unused pure expression or super */ null && (!1)),
  addon_search_e,
  addon_search_ye = addon_search_Y,
  addon_search_rt = (/* unused pure expression or super */ null && (addon_search_Y)),
  addon_search_Lt,
  addon_search_N,
  W = globalThis,
  addon_search_O;
typeof W.vscode < "u" && typeof W.vscode.process < "u" ? addon_search_O = W.vscode.process : typeof process < "u" && typeof process?.versions?.node == "string" && (addon_search_O = process);
var addon_search_ot = typeof addon_search_O?.versions?.electron == "string",
  addon_search_Ot = addon_search_ot && addon_search_O?.type === "renderer";
if (typeof addon_search_O == "object") {
  addon_search_qe = addon_search_O.platform === "win32", ze = addon_search_O.platform === "darwin", addon_search_ge = addon_search_O.platform === "linux", addon_search_wt = addon_search_ge && !!addon_search_O.env.SNAP && !!addon_search_O.env.SNAP_REVISION, addon_search_St = addon_search_ot, addon_search_Ct = !!addon_search_O.env.CI || !!addon_search_O.env.BUILD_ARTIFACTSTAGINGDIRECTORY, addon_search_e = addon_search_Y, addon_search_ye = addon_search_Y;
  let r = addon_search_O.env.VSCODE_NLS_CONFIG;
  if (r) try {
    let e = JSON.parse(r);
    addon_search_e = e.userLocale, addon_search_rt = e.osLocale, addon_search_ye = e.resolvedLanguage || addon_search_Y, addon_search_Lt = e.languagePack?.translationsConfigFile;
  } catch {}
  addon_search_kt = !0;
} else typeof navigator == "object" && !addon_search_Ot ? (addon_search_N = navigator.userAgent, addon_search_qe = addon_search_N.indexOf("Windows") >= 0, ze = addon_search_N.indexOf("Macintosh") >= 0, addon_search_Rt = (addon_search_N.indexOf("Macintosh") >= 0 || addon_search_N.indexOf("iPad") >= 0 || addon_search_N.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0, addon_search_ge = addon_search_N.indexOf("Linux") >= 0, addon_search_Pt = addon_search_N?.indexOf("Mobi") >= 0, addon_search_st = !0, addon_search_ye = globalThis._VSCODE_NLS_LANGUAGE || addon_search_Y, addon_search_e = navigator.language.toLowerCase(), addon_search_rt = addon_search_e) : console.error("Unable to resolve platform.");
var addon_search_je = 0;
ze ? addon_search_je = 1 : addon_search_qe ? addon_search_je = 3 : addon_search_ge && (addon_search_je = 2);
var addon_search_At = addon_search_st && typeof W.importScripts == "function",
  addon_search_gn = addon_search_At ? W.origin : void 0;
var addon_search_M = addon_search_N,
  addon_search_j = addon_search_ye,
  addon_search_Mt;
(n => {
  function r() {
    return addon_search_j;
  }
  n.value = r;
  function e() {
    return addon_search_j.length === 2 ? addon_search_j === "en" : addon_search_j.length >= 3 ? addon_search_j[0] === "e" && addon_search_j[1] === "n" && addon_search_j[2] === "-" : !1;
  }
  n.isDefaultVariant = e;
  function t() {
    return addon_search_j === "en";
  }
  n.isDefault = t;
})(addon_search_Mt ||= {});
var Ft = typeof W.postMessage == "function" && !W.importScripts,
  addon_search_at = (() => {
    if (Ft) {
      let r = [];
      W.addEventListener("message", t => {
        if (t.data && t.data.vscodeScheduleAsyncWork) for (let n = 0, i = r.length; n < i; n++) {
          let s = r[n];
          if (s.id === t.data.vscodeScheduleAsyncWork) {
            r.splice(n, 1), s.callback();
            return;
          }
        }
      });
      let e = 0;
      return t => {
        let n = ++e;
        r.push({
          id: n,
          callback: t
        }), W.postMessage({
          vscodeScheduleAsyncWork: n
        }, "*");
      };
    }
    return r => setTimeout(r);
  })();
var addon_search_Nt = !!(addon_search_M && addon_search_M.indexOf("Chrome") >= 0),
  addon_search_yn = !!(addon_search_M && addon_search_M.indexOf("Firefox") >= 0),
  addon_search_xn = !!(!addon_search_Nt && addon_search_M && addon_search_M.indexOf("Safari") >= 0),
  addon_search_In = !!(addon_search_M && addon_search_M.indexOf("Edg/") >= 0),
  addon_search_Dn = !!(addon_search_M && addon_search_M.indexOf("Android") >= 0);
var addon_search_Wt = Symbol("MicrotaskDelay");
function addon_search_xe(r, e = 0, t) {
  let n = setTimeout(() => {
      r(), t && i.dispose();
    }, e),
    i = addon_search_A(() => {
      clearTimeout(n), t?.deleteAndLeak(i);
    });
  return t?.add(i), i;
}
var addon_search_jt, addon_search_Ue;
(function () {
  typeof globalThis.requestIdleCallback != "function" || typeof globalThis.cancelIdleCallback != "function" ? addon_search_Ue = (r, e) => {
    addon_search_at(() => {
      if (t) return;
      let n = Date.now() + 15;
      e(Object.freeze({
        didTimeout: !0,
        timeRemaining() {
          return Math.max(0, n - Date.now());
        }
      }));
    });
    let t = !1;
    return {
      dispose() {
        t || (t = !0);
      }
    };
  } : addon_search_Ue = (r, e, t) => {
    let n = r.requestIdleCallback(e, typeof t == "number" ? {
        timeout: t
      } : void 0),
      i = !1;
    return {
      dispose() {
        i || (i = !0, r.cancelIdleCallback(n));
      }
    };
  }, addon_search_jt = r => addon_search_Ue(globalThis, r);
})();
var qt;
(t => {
  async function r(n) {
    let i,
      s = await Promise.all(n.map(a => a.then(h => h, h => {
        i || (i = h);
      })));
    if (typeof i < "u") throw i;
    return s;
  }
  t.settled = r;
  function e(n) {
    return new Promise(async (i, s) => {
      try {
        await n(i, s);
      } catch (a) {
        s(a);
      }
    });
  }
  t.withAsyncBody = e;
})(qt ||= {});
var addon_search_P = class P {
  static fromArray(e) {
    return new P(t => {
      t.emitMany(e);
    });
  }
  static fromPromise(e) {
    return new P(async t => {
      t.emitMany(await e);
    });
  }
  static fromPromises(e) {
    return new P(async t => {
      await Promise.all(e.map(async n => t.emitOne(await n)));
    });
  }
  static merge(e) {
    return new P(async t => {
      await Promise.all(e.map(async n => {
        for await (let i of n) t.emitOne(i);
      }));
    });
  }
  constructor(e, t) {
    this._state = 0, this._results = [], this._error = null, this._onReturn = t, this._onStateChanged = new addon_search_C(), queueMicrotask(async () => {
      let n = {
        emitOne: i => this.emitOne(i),
        emitMany: i => this.emitMany(i),
        reject: i => this.reject(i)
      };
      try {
        await Promise.resolve(e(n)), this.resolve();
      } catch (i) {
        this.reject(i);
      } finally {
        n.emitOne = void 0, n.emitMany = void 0, n.reject = void 0;
      }
    });
  }
  [Symbol.asyncIterator]() {
    let e = 0;
    return {
      next: async () => {
        do {
          if (this._state === 2) throw this._error;
          if (e < this._results.length) return {
            done: !1,
            value: this._results[e++]
          };
          if (this._state === 1) return {
            done: !0,
            value: void 0
          };
          await addon_search_ie.toPromise(this._onStateChanged.event);
        } while (!0);
      },
      return: async () => (this._onReturn?.(), {
        done: !0,
        value: void 0
      })
    };
  }
  static map(e, t) {
    return new P(async n => {
      for await (let i of e) n.emitOne(t(i));
    });
  }
  map(e) {
    return P.map(this, e);
  }
  static filter(e, t) {
    return new P(async n => {
      for await (let i of e) t(i) && n.emitOne(i);
    });
  }
  filter(e) {
    return P.filter(this, e);
  }
  static coalesce(e) {
    return P.filter(e, t => !!t);
  }
  coalesce() {
    return P.coalesce(this);
  }
  static async toPromise(e) {
    let t = [];
    for await (let n of e) t.push(n);
    return t;
  }
  toPromise() {
    return P.toPromise(this);
  }
  emitOne(e) {
    this._state === 0 && (this._results.push(e), this._onStateChanged.fire());
  }
  emitMany(e) {
    this._state === 0 && (this._results = this._results.concat(e), this._onStateChanged.fire());
  }
  resolve() {
    this._state === 0 && (this._state = 1, this._onStateChanged.fire());
  }
  reject(e) {
    this._state === 0 && (this._state = 2, this._error = e, this._onStateChanged.fire());
  }
};
addon_search_P.EMPTY = addon_search_P.fromArray([]);
var addon_search_lt = (/* unused pure expression or super */ null && (addon_search_P));
var addon_search_Ie = class extends addon_search_k {
  constructor(t) {
    super();
    this._terminal = t;
    this._linesCacheTimeout = this._register(new addon_search_F());
    this._linesCacheDisposables = this._register(new addon_search_F());
    this._register(addon_search_A(() => this._destroyLinesCache()));
  }
  initLinesCache() {
    this._linesCache || (this._linesCache = new Array(this._terminal.buffer.active.length), this._linesCacheDisposables.value = addon_search_me(this._terminal.onLineFeed(() => this._destroyLinesCache()), this._terminal.onCursorMove(() => this._destroyLinesCache()), this._terminal.onResize(() => this._destroyLinesCache()))), this._linesCacheTimeout.value = addon_search_xe(() => this._destroyLinesCache(), 15e3);
  }
  _destroyLinesCache() {
    this._linesCache = void 0, this._linesCacheDisposables.clear(), this._linesCacheTimeout.clear();
  }
  getLineFromCache(t) {
    return this._linesCache?.[t];
  }
  setLineInCache(t, n) {
    this._linesCache && (this._linesCache[t] = n);
  }
  translateBufferLineToStringWithWrap(t, n) {
    let i = [],
      s = [0],
      a = this._terminal.buffer.active.getLine(t);
    for (; a;) {
      let h = this._terminal.buffer.active.getLine(t + 1),
        u = h ? h.isWrapped : !1,
        p = a.translateToString(!u && n);
      if (u && h) {
        let T = a.getCell(a.length - 1);
        T && T.getCode() === 0 && T.getWidth() === 1 && h.getCell(0)?.getWidth() === 2 && (p = p.slice(0, -1));
      }
      if (i.push(p), u) s.push(s[s.length - 1] + p.length);else break;
      t++, a = h;
    }
    return [i.join(""), s];
  }
};
var addon_search_De = class {
  get cachedSearchTerm() {
    return this._cachedSearchTerm;
  }
  set cachedSearchTerm(e) {
    this._cachedSearchTerm = e;
  }
  get lastSearchOptions() {
    return this._lastSearchOptions;
  }
  set lastSearchOptions(e) {
    this._lastSearchOptions = e;
  }
  isValidSearchTerm(e) {
    return !!(e && e.length > 0);
  }
  didOptionsChange(e) {
    return this._lastSearchOptions ? e ? this._lastSearchOptions.caseSensitive !== e.caseSensitive || this._lastSearchOptions.regex !== e.regex || this._lastSearchOptions.wholeWord !== e.wholeWord : !1 : !0;
  }
  shouldUpdateHighlighting(e, t) {
    return t?.decorations ? this._cachedSearchTerm === void 0 || e !== this._cachedSearchTerm || this.didOptionsChange(t) : !1;
  }
  clearCachedTerm() {
    this._cachedSearchTerm = void 0;
  }
  reset() {
    this._cachedSearchTerm = void 0, this._lastSearchOptions = void 0;
  }
};
var addon_search_Ee = class {
  constructor(e, t) {
    this._terminal = e;
    this._lineCache = t;
  }
  find(e, t, n, i) {
    if (!e || e.length === 0) {
      this._terminal.clearSelection();
      return;
    }
    if (n > this._terminal.cols) throw new Error(`Invalid col: ${n} to search in terminal of ${this._terminal.cols} cols`);
    this._lineCache.initLinesCache();
    let s = {
        startRow: t,
        startCol: n
      },
      a = this._findInLine(e, s, i);
    if (!a) for (let h = t + 1; h < this._terminal.buffer.active.baseY + this._terminal.rows && (s.startRow = h, s.startCol = 0, a = this._findInLine(e, s, i), !a); h++);
    return a;
  }
  findNextWithSelection(e, t, n) {
    if (!e || e.length === 0) {
      this._terminal.clearSelection();
      return;
    }
    let i = this._terminal.getSelectionPosition();
    this._terminal.clearSelection();
    let s = 0,
      a = 0;
    i && (n === e ? (s = i.end.x, a = i.end.y) : (s = i.start.x, a = i.start.y)), this._lineCache.initLinesCache();
    let h = {
        startRow: a,
        startCol: s
      },
      u = this._findInLine(e, h, t);
    if (!u) for (let p = a + 1; p < this._terminal.buffer.active.baseY + this._terminal.rows && (h.startRow = p, h.startCol = 0, u = this._findInLine(e, h, t), !u); p++);
    if (!u && a !== 0) for (let p = 0; p < a && (h.startRow = p, h.startCol = 0, u = this._findInLine(e, h, t), !u); p++);
    return !u && i && (h.startRow = i.start.y, h.startCol = 0, u = this._findInLine(e, h, t)), u;
  }
  findPreviousWithSelection(e, t, n) {
    if (!e || e.length === 0) {
      this._terminal.clearSelection();
      return;
    }
    let i = this._terminal.getSelectionPosition();
    this._terminal.clearSelection();
    let s = this._terminal.buffer.active.baseY + this._terminal.rows - 1,
      a = this._terminal.cols,
      h = !0;
    this._lineCache.initLinesCache();
    let u = {
        startRow: s,
        startCol: a
      },
      p;
    if (i && (u.startRow = s = i.start.y, u.startCol = a = i.start.x, n !== e && (p = this._findInLine(e, u, t, !1), p || (u.startRow = s = i.end.y, u.startCol = a = i.end.x))), p || (p = this._findInLine(e, u, t, h)), !p) {
      u.startCol = Math.max(u.startCol, this._terminal.cols);
      for (let T = s - 1; T >= 0 && (u.startRow = T, p = this._findInLine(e, u, t, h), !p); T--);
    }
    if (!p && s !== this._terminal.buffer.active.baseY + this._terminal.rows - 1) for (let T = this._terminal.buffer.active.baseY + this._terminal.rows - 1; T >= s && (u.startRow = T, p = this._findInLine(e, u, t, h), !p); T--);
    return p;
  }
  _isWholeWord(e, t, n) {
    return (e === 0 || " ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e - 1])) && (e + n.length === t.length || " ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e + n.length]));
  }
  _findInLine(e, t, n = {}, i = !1) {
    let s = t.startRow,
      a = t.startCol;
    if (this._terminal.buffer.active.getLine(s)?.isWrapped) {
      if (i) {
        t.startCol += this._terminal.cols;
        return;
      }
      return t.startRow--, t.startCol += this._terminal.cols, this._findInLine(e, t, n);
    }
    let u = this._lineCache.getLineFromCache(s);
    u || (u = this._lineCache.translateBufferLineToStringWithWrap(s, !0), this._lineCache.setLineInCache(s, u));
    let [p, T] = u,
      v = this._bufferColsToStringOffset(s, a),
      I = e,
      E = p;
    n.regex || (I = n.caseSensitive ? e : e.toLowerCase(), E = n.caseSensitive ? p : p.toLowerCase());
    let S = -1;
    if (n.regex) {
      let D = RegExp(I, n.caseSensitive ? "g" : "gi"),
        x;
      if (i) for (; x = D.exec(E.slice(0, v));) S = D.lastIndex - x[0].length, e = x[0], D.lastIndex -= e.length - 1;else x = D.exec(E.slice(v)), x && x[0].length > 0 && (S = v + (D.lastIndex - x[0].length), e = x[0]);
    } else i ? v - I.length >= 0 && (S = E.lastIndexOf(I, v - I.length)) : S = E.indexOf(I, v);
    if (S >= 0) {
      if (n.wholeWord && !this._isWholeWord(S, E, e)) return;
      let D = 0;
      for (; D < T.length - 1 && S >= T[D + 1];) D++;
      let x = D;
      for (; x < T.length - 1 && S + e.length >= T[x + 1];) x++;
      let J = S - T[D],
        q = S + e.length - T[x],
        z = this._stringLengthToBufferSize(s + D, J),
        _ = this._stringLengthToBufferSize(s + x, q) - z + this._terminal.cols * (x - D);
      return {
        term: e,
        col: z,
        row: s + D,
        size: _
      };
    }
  }
  _stringLengthToBufferSize(e, t) {
    let n = this._terminal.buffer.active.getLine(e);
    if (!n) return 0;
    for (let i = 0; i < t; i++) {
      let s = n.getCell(i);
      if (!s) break;
      let a = s.getChars();
      a.length > 1 && (t -= a.length - 1);
      let h = n.getCell(i + 1);
      h && h.getWidth() === 0 && t++;
    }
    return t;
  }
  _bufferColsToStringOffset(e, t) {
    let n = e,
      i = 0,
      s = this._terminal.buffer.active.getLine(n);
    for (; t > 0 && s;) {
      for (let a = 0; a < t && a < this._terminal.cols; a++) {
        let h = s.getCell(a);
        if (!h) break;
        h.getWidth() && (i += h.getCode() === 0 ? 1 : h.getChars().length);
      }
      if (n++, s = this._terminal.buffer.active.getLine(n), s && !s.isWrapped) break;
      t -= this._terminal.cols;
    }
    return i;
  }
};
var addon_search_we = class extends addon_search_k {
  constructor(t) {
    super();
    this._terminal = t;
    this._highlightDecorations = [];
    this._highlightedLines = new Set();
    this._register(addon_search_A(() => this.clearHighlightDecorations()));
  }
  createHighlightDecorations(t, n) {
    this.clearHighlightDecorations();
    for (let i of t) {
      let s = this._createResultDecorations(i, n, !1);
      if (s) for (let a of s) this._storeDecoration(a, i);
    }
  }
  createActiveDecoration(t, n) {
    let i = this._createResultDecorations(t, n, !0);
    if (i) return {
      decorations: i,
      match: t,
      dispose() {
        addon_search_Q(i);
      }
    };
  }
  clearHighlightDecorations() {
    addon_search_Q(this._highlightDecorations), this._highlightDecorations = [], this._highlightedLines.clear();
  }
  _storeDecoration(t, n) {
    this._highlightedLines.add(t.marker.line), this._highlightDecorations.push({
      decoration: t,
      match: n,
      dispose() {
        t.dispose();
      }
    });
  }
  _applyStyles(t, n, i) {
    t.classList.contains("xterm-find-result-decoration") || (t.classList.add("xterm-find-result-decoration"), n && (t.style.outline = `1px solid ${n}`)), i && t.classList.add("xterm-find-active-result-decoration");
  }
  _createResultDecorations(t, n, i) {
    let s = [],
      a = t.col,
      h = t.size,
      u = -this._terminal.buffer.active.baseY - this._terminal.buffer.active.cursorY + t.row;
    for (; h > 0;) {
      let T = Math.min(this._terminal.cols - a, h);
      s.push([u, a, T]), a = 0, h -= T, u++;
    }
    let p = [];
    for (let T of s) {
      let v = this._terminal.registerMarker(T[0]),
        I = this._terminal.registerDecoration({
          marker: v,
          x: T[1],
          width: T[2],
          backgroundColor: i ? n.activeMatchBackground : n.matchBackground,
          overviewRulerOptions: this._highlightedLines.has(v.line) ? void 0 : {
            color: i ? n.activeMatchColorOverviewRuler : n.matchOverviewRuler,
            position: "center"
          }
        });
      if (I) {
        let E = [];
        E.push(v), E.push(I.onRender(S => this._applyStyles(S, i ? n.activeMatchBorder : n.matchBorder, !1))), E.push(I.onDispose(() => addon_search_Q(E))), p.push(I);
      }
    }
    return p.length === 0 ? void 0 : p;
  }
};
var addon_search_ke = class extends addon_search_k {
  constructor() {
    super(...arguments);
    this._searchResults = [];
    this._onDidChangeResults = this._register(new addon_search_C());
  }
  get onDidChangeResults() {
    return this._onDidChangeResults.event;
  }
  get searchResults() {
    return this._searchResults;
  }
  get selectedDecoration() {
    return this._selectedDecoration;
  }
  set selectedDecoration(t) {
    this._selectedDecoration = t;
  }
  updateResults(t, n) {
    this._searchResults = t.slice(0, n);
  }
  clearResults() {
    this._searchResults = [];
  }
  clearSelectedDecoration() {
    this._selectedDecoration && (this._selectedDecoration.dispose(), this._selectedDecoration = void 0);
  }
  findResultIndex(t) {
    for (let n = 0; n < this._searchResults.length; n++) {
      let i = this._searchResults[n];
      if (i.row === t.row && i.col === t.col && i.size === t.size) return n;
    }
    return -1;
  }
  fireResultsChanged(t) {
    if (!t) return;
    let n = -1;
    this._selectedDecoration && (n = this.findResultIndex(this._selectedDecoration.match)), this._onDidChangeResults.fire({
      resultIndex: n,
      resultCount: this._searchResults.length
    });
  }
  reset() {
    this.clearSelectedDecoration(), this.clearResults();
  }
};
var addon_search_ut = class extends addon_search_k {
  constructor(t) {
    super();
    this._highlightTimeout = this._register(new addon_search_F());
    this._lineCache = this._register(new addon_search_F());
    this._state = new addon_search_De();
    this._resultTracker = this._register(new addon_search_ke());
    this._highlightLimit = t?.highlightLimit ?? 1e3;
  }
  get onDidChangeResults() {
    return this._resultTracker.onDidChangeResults;
  }
  activate(t) {
    this._terminal = t, this._lineCache.value = new addon_search_Ie(t), this._engine = new addon_search_Ee(t, this._lineCache.value), this._decorationManager = new addon_search_we(t), this._register(this._terminal.onWriteParsed(() => this._updateMatches())), this._register(this._terminal.onResize(() => this._updateMatches())), this._register(addon_search_A(() => this.clearDecorations()));
  }
  _updateMatches() {
    this._highlightTimeout.clear(), this._state.cachedSearchTerm && this._state.lastSearchOptions?.decorations && (this._highlightTimeout.value = addon_search_xe(() => {
      let t = this._state.cachedSearchTerm;
      this._state.clearCachedTerm(), this.findPrevious(t, {
        ...this._state.lastSearchOptions,
        incremental: !0
      }, {
        noScroll: !0
      });
    }, 200));
  }
  clearDecorations(t) {
    this._resultTracker.clearSelectedDecoration(), this._decorationManager?.clearHighlightDecorations(), this._resultTracker.clearResults(), t || this._state.clearCachedTerm();
  }
  clearActiveDecoration() {
    this._resultTracker.clearSelectedDecoration();
  }
  findNext(t, n, i) {
    if (!this._terminal || !this._engine) throw new Error("Cannot use addon until it has been loaded");
    this._state.lastSearchOptions = n, this._state.shouldUpdateHighlighting(t, n) && this._highlightAllMatches(t, n);
    let s = this._findNextAndSelect(t, n, i);
    return this._fireResults(n), this._state.cachedSearchTerm = t, s;
  }
  _highlightAllMatches(t, n) {
    if (!this._terminal || !this._engine || !this._decorationManager) throw new Error("Cannot use addon until it has been loaded");
    if (!this._state.isValidSearchTerm(t)) {
      this.clearDecorations();
      return;
    }
    this.clearDecorations(!0);
    let i = [],
      s,
      a = this._engine.find(t, 0, 0, n);
    for (; a && (s?.row !== a.row || s?.col !== a.col) && !(i.length >= this._highlightLimit);) s = a, i.push(s), a = this._engine.find(t, s.col + s.term.length >= this._terminal.cols ? s.row + 1 : s.row, s.col + s.term.length >= this._terminal.cols ? 0 : s.col + 1, n);
    this._resultTracker.updateResults(i, this._highlightLimit), n.decorations && this._decorationManager.createHighlightDecorations(i, n.decorations);
  }
  _findNextAndSelect(t, n, i) {
    if (!this._terminal || !this._engine) return !1;
    if (!this._state.isValidSearchTerm(t)) return this._terminal.clearSelection(), this.clearDecorations(), !1;
    let s = this._engine.findNextWithSelection(t, n, this._state.cachedSearchTerm);
    return this._selectResult(s, n?.decorations, i?.noScroll);
  }
  findPrevious(t, n, i) {
    if (!this._terminal || !this._engine) throw new Error("Cannot use addon until it has been loaded");
    this._state.lastSearchOptions = n, this._state.shouldUpdateHighlighting(t, n) && this._highlightAllMatches(t, n);
    let s = this._findPreviousAndSelect(t, n, i);
    return this._fireResults(n), this._state.cachedSearchTerm = t, s;
  }
  _fireResults(t) {
    this._resultTracker.fireResultsChanged(!!t?.decorations);
  }
  _findPreviousAndSelect(t, n, i) {
    if (!this._terminal || !this._engine) return !1;
    if (!this._state.isValidSearchTerm(t)) return this._terminal.clearSelection(), this.clearDecorations(), !1;
    let s = this._engine.findPreviousWithSelection(t, n, this._state.cachedSearchTerm);
    return this._selectResult(s, n?.decorations, i?.noScroll);
  }
  _selectResult(t, n, i) {
    if (!this._terminal || !this._decorationManager) return !1;
    if (this._resultTracker.clearSelectedDecoration(), !t) return this._terminal.clearSelection(), !1;
    if (this._terminal.select(t.col, t.row, t.size), n) {
      let s = this._decorationManager.createActiveDecoration(t, n);
      s && (this._resultTracker.selectedDecoration = s);
    }
    if (!i && (t.row >= this._terminal.buffer.active.viewportY + this._terminal.rows || t.row < this._terminal.buffer.active.viewportY)) {
      let s = t.row - this._terminal.buffer.active.viewportY;
      s -= Math.floor(this._terminal.rows / 2), this._terminal.scrollLines(s);
    }
    return !0;
  }
};

;// ./node_modules/@xterm/addon-webgl/lib/addon-webgl.mjs
/**
 * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
 * @license MIT
 *
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * @license MIT
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
var addon_webgl_Lr = Object.defineProperty;
var addon_webgl_wr = Object.getOwnPropertyDescriptor;
var addon_webgl_Yi = (i, e, t, n) => {
    for (var s = n > 1 ? void 0 : n ? addon_webgl_wr(e, t) : e, o = i.length - 1, r; o >= 0; o--) (r = i[o]) && (s = (n ? r(e, t, s) : r(s)) || s);
    return n && s && addon_webgl_Lr(e, t, s), s;
  },
  Qi = (i, e) => (t, n) => e(t, n, i);
var pi = class {
    constructor() {
      this.listeners = [], this.unexpectedErrorHandler = function (e) {
        setTimeout(() => {
          throw e.stack ? addon_webgl_bt.isErrorNoTelemetry(e) ? new addon_webgl_bt(e.message + `

` + e.stack) : new Error(e.message + `

` + e.stack) : e;
        }, 0);
      };
    }
    addListener(e) {
      return this.listeners.push(e), () => {
        this._removeListener(e);
      };
    }
    emit(e) {
      this.listeners.forEach(t => {
        t(e);
      });
    }
    _removeListener(e) {
      this.listeners.splice(this.listeners.indexOf(e), 1);
    }
    setUnexpectedErrorHandler(e) {
      this.unexpectedErrorHandler = e;
    }
    getUnexpectedErrorHandler() {
      return this.unexpectedErrorHandler;
    }
    onUnexpectedError(e) {
      this.unexpectedErrorHandler(e), this.emit(e);
    }
    onUnexpectedExternalError(e) {
      this.unexpectedErrorHandler(e);
    }
  },
  addon_webgl_Rr = new pi();
function addon_webgl_Pe(i) {
  addon_webgl_Dr(i) || addon_webgl_Rr.onUnexpectedError(i);
}
var fi = "Canceled";
function addon_webgl_Dr(i) {
  return i instanceof addon_webgl_Ye ? !0 : i instanceof Error && i.name === fi && i.message === fi;
}
var addon_webgl_Ye = class extends Error {
  constructor() {
    super(fi), this.name = this.message;
  }
};
var addon_webgl_bt = class i extends Error {
  constructor(e) {
    super(e), this.name = "CodeExpectedError";
  }
  static fromError(e) {
    if (e instanceof i) return e;
    let t = new i();
    return t.message = e.message, t.stack = e.stack, t;
  }
  static isErrorNoTelemetry(e) {
    return e.name === "CodeExpectedError";
  }
};
function addon_webgl_Mr(i, e, t = 0, n = i.length) {
  let s = t,
    o = n;
  for (; s < o;) {
    let r = Math.floor((s + o) / 2);
    e(i[r]) ? s = r + 1 : o = r;
  }
  return s - 1;
}
var addon_webgl_vt = class vt {
  constructor(e) {
    this._array = e;
    this._findLastMonotonousLastIdx = 0;
  }
  findLastMonotonous(e) {
    if (vt.assertInvariants) {
      if (this._prevFindLastPredicate) {
        for (let n of this._array) if (this._prevFindLastPredicate(n) && !e(n)) throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");
      }
      this._prevFindLastPredicate = e;
    }
    let t = addon_webgl_Mr(this._array, e, this._findLastMonotonousLastIdx);
    return this._findLastMonotonousLastIdx = t + 1, t === -1 ? void 0 : this._array[t];
  }
};
addon_webgl_vt.assertInvariants = !1;
var addon_webgl_Zi = (/* unused pure expression or super */ null && (addon_webgl_vt));
var addon_webgl_en;
(a => {
  function i(l) {
    return l < 0;
  }
  a.isLessThan = i;
  function e(l) {
    return l <= 0;
  }
  a.isLessThanOrEqual = e;
  function t(l) {
    return l > 0;
  }
  a.isGreaterThan = t;
  function n(l) {
    return l === 0;
  }
  a.isNeitherLessOrGreaterThan = n, a.greaterThan = 1, a.lessThan = -1, a.neitherLessOrGreaterThan = 0;
})(addon_webgl_en ||= {});
function addon_webgl_tn(i, e) {
  return (t, n) => e(i(t), i(n));
}
var addon_webgl_nn = (i, e) => i - e;
var addon_webgl_Be = class Be {
  constructor(e) {
    this.iterate = e;
  }
  forEach(e) {
    this.iterate(t => (e(t), !0));
  }
  toArray() {
    let e = [];
    return this.iterate(t => (e.push(t), !0)), e;
  }
  filter(e) {
    return new Be(t => this.iterate(n => e(n) ? t(n) : !0));
  }
  map(e) {
    return new Be(t => this.iterate(n => t(e(n))));
  }
  some(e) {
    let t = !1;
    return this.iterate(n => (t = e(n), !t)), t;
  }
  findFirst(e) {
    let t;
    return this.iterate(n => e(n) ? (t = n, !1) : !0), t;
  }
  findLast(e) {
    let t;
    return this.iterate(n => (e(n) && (t = n), !0)), t;
  }
  findLastMaxBy(e) {
    let t,
      n = !0;
    return this.iterate(s => ((n || addon_webgl_en.isGreaterThan(e(s, t))) && (n = !1, t = s), !0)), t;
  }
};
addon_webgl_Be.empty = new addon_webgl_Be(e => {});
var addon_webgl_Ji = (/* unused pure expression or super */ null && (addon_webgl_Be));
function addon_webgl_an(i, e) {
  let t = Object.create(null);
  for (let n of i) {
    let s = e(n),
      o = t[s];
    o || (o = t[s] = []), o.push(n);
  }
  return t;
}
var addon_webgl_sn,
  addon_webgl_on,
  addon_webgl_rn = class {
    constructor(e, t) {
      this.toKey = t;
      this._map = new Map();
      this[addon_webgl_sn] = "SetWithKey";
      for (let n of e) this.add(n);
    }
    get size() {
      return this._map.size;
    }
    add(e) {
      let t = this.toKey(e);
      return this._map.set(t, e), this;
    }
    delete(e) {
      return this._map.delete(this.toKey(e));
    }
    has(e) {
      return this._map.has(this.toKey(e));
    }
    *entries() {
      for (let e of this._map.values()) yield [e, e];
    }
    keys() {
      return this.values();
    }
    *values() {
      for (let e of this._map.values()) yield e;
    }
    clear() {
      this._map.clear();
    }
    forEach(e, t) {
      this._map.forEach(n => e.call(t, n, n, this));
    }
    [(addon_webgl_on = Symbol.iterator, addon_webgl_sn = Symbol.toStringTag, addon_webgl_on)]() {
      return this.values();
    }
  };
var addon_webgl_Tt = class {
  constructor() {
    this.map = new Map();
  }
  add(e, t) {
    let n = this.map.get(e);
    n || (n = new Set(), this.map.set(e, n)), n.add(t);
  }
  delete(e, t) {
    let n = this.map.get(e);
    n && (n.delete(t), n.size === 0 && this.map.delete(e));
  }
  forEach(e, t) {
    let n = this.map.get(e);
    n && n.forEach(t);
  }
  get(e) {
    let t = this.map.get(e);
    return t || new Set();
  }
};
function addon_webgl_mi(i, e) {
  let t = this,
    n = !1,
    s;
  return function () {
    if (n) return s;
    if (n = !0, e) try {
      s = i.apply(t, arguments);
    } finally {
      e();
    } else s = i.apply(t, arguments);
    return s;
  };
}
var addon_webgl_i;
(W => {
  function i(E) {
    return E && typeof E == "object" && typeof E[Symbol.iterator] == "function";
  }
  W.is = i;
  let e = Object.freeze([]);
  function t() {
    return e;
  }
  W.empty = t;
  function* n(E) {
    yield E;
  }
  W.single = n;
  function s(E) {
    return i(E) ? E : n(E);
  }
  W.wrap = s;
  function o(E) {
    return E || e;
  }
  W.from = o;
  function* r(E) {
    for (let y = E.length - 1; y >= 0; y--) yield E[y];
  }
  W.reverse = r;
  function a(E) {
    return !E || E[Symbol.iterator]().next().done === !0;
  }
  W.isEmpty = a;
  function l(E) {
    return E[Symbol.iterator]().next().value;
  }
  W.first = l;
  function u(E, y) {
    let w = 0;
    for (let G of E) if (y(G, w++)) return !0;
    return !1;
  }
  W.some = u;
  function c(E, y) {
    for (let w of E) if (y(w)) return w;
  }
  W.find = c;
  function* d(E, y) {
    for (let w of E) y(w) && (yield w);
  }
  W.filter = d;
  function* h(E, y) {
    let w = 0;
    for (let G of E) yield y(G, w++);
  }
  W.map = h;
  function* f(E, y) {
    let w = 0;
    for (let G of E) yield* y(G, w++);
  }
  W.flatMap = f;
  function* I(...E) {
    for (let y of E) yield* y;
  }
  W.concat = I;
  function L(E, y, w) {
    let G = w;
    for (let ue of E) G = y(G, ue);
    return G;
  }
  W.reduce = L;
  function* M(E, y, w = E.length) {
    for (y < 0 && (y += E.length), w < 0 ? w += E.length : w > E.length && (w = E.length); y < w; y++) yield E[y];
  }
  W.slice = M;
  function q(E, y = Number.POSITIVE_INFINITY) {
    let w = [];
    if (y === 0) return [w, E];
    let G = E[Symbol.iterator]();
    for (let ue = 0; ue < y; ue++) {
      let Se = G.next();
      if (Se.done) return [w, W.empty()];
      w.push(Se.value);
    }
    return [w, {
      [Symbol.iterator]() {
        return G;
      }
    }];
  }
  W.consume = q;
  async function S(E) {
    let y = [];
    for await (let w of E) y.push(w);
    return Promise.resolve(y);
  }
  W.asyncToArray = S;
})(addon_webgl_i ||= {});
var addon_webgl_Ar = !1,
  addon_webgl_Ne = null,
  addon_webgl_gt = class gt {
    constructor() {
      this.livingDisposables = new Map();
    }
    getDisposableData(e) {
      let t = this.livingDisposables.get(e);
      return t || (t = {
        parent: null,
        source: null,
        isSingleton: !1,
        value: e,
        idx: gt.idx++
      }, this.livingDisposables.set(e, t)), t;
    }
    trackDisposable(e) {
      let t = this.getDisposableData(e);
      t.source || (t.source = new Error().stack);
    }
    setParent(e, t) {
      let n = this.getDisposableData(e);
      n.parent = t;
    }
    markAsDisposed(e) {
      this.livingDisposables.delete(e);
    }
    markAsSingleton(e) {
      this.getDisposableData(e).isSingleton = !0;
    }
    getRootParent(e, t) {
      let n = t.get(e);
      if (n) return n;
      let s = e.parent ? this.getRootParent(this.getDisposableData(e.parent), t) : e;
      return t.set(e, s), s;
    }
    getTrackedDisposables() {
      let e = new Map();
      return [...this.livingDisposables.entries()].filter(([, n]) => n.source !== null && !this.getRootParent(n, e).isSingleton).flatMap(([n]) => n);
    }
    computeLeakingDisposables(e = 10, t) {
      let n;
      if (t) n = t;else {
        let l = new Map(),
          u = [...this.livingDisposables.values()].filter(d => d.source !== null && !this.getRootParent(d, l).isSingleton);
        if (u.length === 0) return;
        let c = new Set(u.map(d => d.value));
        if (n = u.filter(d => !(d.parent && c.has(d.parent))), n.length === 0) throw new Error("There are cyclic diposable chains!");
      }
      if (!n) return;
      function s(l) {
        function u(d, h) {
          for (; d.length > 0 && h.some(f => typeof f == "string" ? f === d[0] : d[0].match(f));) d.shift();
        }
        let c = l.source.split(`
`).map(d => d.trim().replace("at ", "")).filter(d => d !== "");
        return u(c, ["Error", /^trackDisposable \(.*\)$/, /^DisposableTracker.trackDisposable \(.*\)$/]), c.reverse();
      }
      let o = new addon_webgl_Tt();
      for (let l of n) {
        let u = s(l);
        for (let c = 0; c <= u.length; c++) o.add(u.slice(0, c).join(`
`), l);
      }
      n.sort(addon_webgl_tn(l => l.idx, addon_webgl_nn));
      let r = "",
        a = 0;
      for (let l of n.slice(0, e)) {
        a++;
        let u = s(l),
          c = [];
        for (let d = 0; d < u.length; d++) {
          let h = u[d];
          h = `(shared with ${o.get(u.slice(0, d + 1).join(`
`)).size}/${n.length} leaks) at ${h}`;
          let I = o.get(u.slice(0, d).join(`
`)),
            L = addon_webgl_an([...I].map(M => s(M)[d]), M => M);
          delete L[u[d]];
          for (let [M, q] of Object.entries(L)) c.unshift(`    - stacktraces of ${q.length} other leaks continue with ${M}`);
          c.unshift(h);
        }
        r += `


==================== Leaking disposable ${a}/${n.length}: ${l.value.constructor.name} ====================
${c.join(`
`)}
============================================================

`;
      }
      return n.length > e && (r += `


... and ${n.length - e} more leaking disposables

`), {
        leaks: n,
        details: r
      };
    }
  };
addon_webgl_gt.idx = 0;
var addon_webgl_ln = (/* unused pure expression or super */ null && (addon_webgl_gt));
function addon_webgl_Sr(i) {
  addon_webgl_Ne = i;
}
if (addon_webgl_Ar) {
  let i = "__is_disposable_tracked__";
  addon_webgl_Sr(new class {
    trackDisposable(e) {
      let t = new Error("Potentially leaked disposable").stack;
      setTimeout(() => {
        e[i] || console.log(t);
      }, 3e3);
    }
    setParent(e, t) {
      if (e && e !== addon_webgl_B.None) try {
        e[i] = !0;
      } catch {}
    }
    markAsDisposed(e) {
      if (e && e !== addon_webgl_B.None) try {
        e[i] = !0;
      } catch {}
    }
    markAsSingleton(e) {}
  }());
}
function addon_webgl_Et(i) {
  return addon_webgl_Ne?.trackDisposable(i), i;
}
function addon_webgl_yt(i) {
  addon_webgl_Ne?.markAsDisposed(i);
}
function addon_webgl_Qe(i, e) {
  addon_webgl_Ne?.setParent(i, e);
}
function addon_webgl_Or(i, e) {
  if (addon_webgl_Ne) for (let t of i) addon_webgl_Ne.setParent(t, e);
}
function addon_webgl_un(i) {
  if (addon_webgl_i.is(i)) {
    let e = [];
    for (let t of i) if (t) try {
      t.dispose();
    } catch (n) {
      e.push(n);
    }
    if (e.length === 1) throw e[0];
    if (e.length > 1) throw new AggregateError(e, "Encountered errors while disposing of store");
    return Array.isArray(i) ? [] : i;
  } else if (i) return i.dispose(), i;
}
function addon_webgl_It(...i) {
  let e = addon_webgl_O(() => addon_webgl_un(i));
  return addon_webgl_Or(i, e), e;
}
function addon_webgl_O(i) {
  let e = addon_webgl_Et({
    dispose: addon_webgl_mi(() => {
      addon_webgl_yt(e), i();
    })
  });
  return e;
}
var addon_webgl_xt = class xt {
  constructor() {
    this._toDispose = new Set();
    this._isDisposed = !1;
    addon_webgl_Et(this);
  }
  dispose() {
    this._isDisposed || (addon_webgl_yt(this), this._isDisposed = !0, this.clear());
  }
  get isDisposed() {
    return this._isDisposed;
  }
  clear() {
    if (this._toDispose.size !== 0) try {
      addon_webgl_un(this._toDispose);
    } finally {
      this._toDispose.clear();
    }
  }
  add(e) {
    if (!e) return e;
    if (e === this) throw new Error("Cannot register a disposable on itself!");
    return addon_webgl_Qe(e, this), this._isDisposed ? xt.DISABLE_DISPOSED_WARNING || console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack) : this._toDispose.add(e), e;
  }
  delete(e) {
    if (e) {
      if (e === this) throw new Error("Cannot dispose a disposable on itself!");
      this._toDispose.delete(e), e.dispose();
    }
  }
  deleteAndLeak(e) {
    e && this._toDispose.has(e) && (this._toDispose.delete(e), addon_webgl_Qe(e, null));
  }
};
addon_webgl_xt.DISABLE_DISPOSED_WARNING = !1;
var addon_webgl_fe = addon_webgl_xt,
  addon_webgl_B = class {
    constructor() {
      this._store = new addon_webgl_fe();
      addon_webgl_Et(this), addon_webgl_Qe(this._store, this);
    }
    dispose() {
      addon_webgl_yt(this), this._store.dispose();
    }
    _register(e) {
      if (e === this) throw new Error("Cannot register a disposable on itself!");
      return this._store.add(e);
    }
  };
addon_webgl_B.None = Object.freeze({
  dispose() {}
});
var addon_webgl_be = class {
  constructor() {
    this._isDisposed = !1;
    addon_webgl_Et(this);
  }
  get value() {
    return this._isDisposed ? void 0 : this._value;
  }
  set value(e) {
    this._isDisposed || e === this._value || (this._value?.dispose(), e && addon_webgl_Qe(e, this), this._value = e);
  }
  clear() {
    this.value = void 0;
  }
  dispose() {
    this._isDisposed = !0, addon_webgl_yt(this), this._value?.dispose(), this._value = void 0;
  }
  clearAndLeak() {
    let e = this._value;
    return this._value = void 0, e && addon_webgl_Qe(e, null), e;
  }
};
var addon_webgl_Lt = typeof process < "u" && "title" in process,
  addon_webgl_Ze = addon_webgl_Lt ? "node" : navigator.userAgent,
  addon_webgl_bi = addon_webgl_Lt ? "node" : navigator.platform,
  addon_webgl_cn = addon_webgl_Ze.includes("Firefox"),
  addon_webgl_dn = addon_webgl_Ze.includes("Edge"),
  addon_webgl_vi = /^((?!chrome|android).)*safari/i.test(addon_webgl_Ze);
function addon_webgl_hn() {
  if (!addon_webgl_vi) return 0;
  let i = addon_webgl_Ze.match(/Version\/(\d+)/);
  return i === null || i.length < 2 ? 0 : parseInt(i[1]);
}
var addon_webgl_oo = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"].includes(addon_webgl_bi);
var addon_webgl_ao = ["Windows", "Win16", "Win32", "WinCE"].includes(addon_webgl_bi),
  addon_webgl_lo = addon_webgl_bi.indexOf("Linux") >= 0,
  addon_webgl_uo = /\bCrOS\b/.test(addon_webgl_Ze);
var addon_webgl_pn = "";
var addon_webgl_K = 0,
  addon_webgl_V = 0,
  addon_webgl_C = 0,
  addon_webgl_U = 0,
  addon_webgl_Z = {
    css: "#00000000",
    rgba: 0
  },
  addon_webgl_X;
(n => {
  function i(s, o, r, a) {
    return a !== void 0 ? `#${addon_webgl_Oe(s)}${addon_webgl_Oe(o)}${addon_webgl_Oe(r)}${addon_webgl_Oe(a)}` : `#${addon_webgl_Oe(s)}${addon_webgl_Oe(o)}${addon_webgl_Oe(r)}`;
  }
  n.toCss = i;
  function e(s, o, r, a = 255) {
    return (s << 24 | o << 16 | r << 8 | a) >>> 0;
  }
  n.toRgba = e;
  function t(s, o, r, a) {
    return {
      css: n.toCss(s, o, r, a),
      rgba: n.toRgba(s, o, r, a)
    };
  }
  n.toColor = t;
})(addon_webgl_X ||= {});
var addon_webgl_Ue;
(a => {
  function i(l, u) {
    if (addon_webgl_U = (u.rgba & 255) / 255, addon_webgl_U === 1) return {
      css: u.css,
      rgba: u.rgba
    };
    let c = u.rgba >> 24 & 255,
      d = u.rgba >> 16 & 255,
      h = u.rgba >> 8 & 255,
      f = l.rgba >> 24 & 255,
      I = l.rgba >> 16 & 255,
      L = l.rgba >> 8 & 255;
    addon_webgl_K = f + Math.round((c - f) * addon_webgl_U), addon_webgl_V = I + Math.round((d - I) * addon_webgl_U), addon_webgl_C = L + Math.round((h - L) * addon_webgl_U);
    let M = addon_webgl_X.toCss(addon_webgl_K, addon_webgl_V, addon_webgl_C),
      q = addon_webgl_X.toRgba(addon_webgl_K, addon_webgl_V, addon_webgl_C);
    return {
      css: M,
      rgba: q
    };
  }
  a.blend = i;
  function e(l) {
    return (l.rgba & 255) === 255;
  }
  a.isOpaque = e;
  function t(l, u, c) {
    let d = addon_webgl_Te.ensureContrastRatio(l.rgba, u.rgba, c);
    if (d) return addon_webgl_X.toColor(d >> 24 & 255, d >> 16 & 255, d >> 8 & 255);
  }
  a.ensureContrastRatio = t;
  function n(l) {
    let u = (l.rgba | 255) >>> 0;
    return [addon_webgl_K, addon_webgl_V, addon_webgl_C] = addon_webgl_Te.toChannels(u), {
      css: addon_webgl_X.toCss(addon_webgl_K, addon_webgl_V, addon_webgl_C),
      rgba: u
    };
  }
  a.opaque = n;
  function s(l, u) {
    return addon_webgl_U = Math.round(u * 255), [addon_webgl_K, addon_webgl_V, addon_webgl_C] = addon_webgl_Te.toChannels(l.rgba), {
      css: addon_webgl_X.toCss(addon_webgl_K, addon_webgl_V, addon_webgl_C, addon_webgl_U),
      rgba: addon_webgl_X.toRgba(addon_webgl_K, addon_webgl_V, addon_webgl_C, addon_webgl_U)
    };
  }
  a.opacity = s;
  function o(l, u) {
    return addon_webgl_U = l.rgba & 255, s(l, addon_webgl_U * u / 255);
  }
  a.multiplyOpacity = o;
  function r(l) {
    return [l.rgba >> 24 & 255, l.rgba >> 16 & 255, l.rgba >> 8 & 255];
  }
  a.toColorRGB = r;
})(addon_webgl_Ue ||= {});
var addon_webgl_Fr;
(n => {
  let i, e;
  try {
    let s = document.createElement("canvas");
    s.width = 1, s.height = 1;
    let o = s.getContext("2d", {
      willReadFrequently: !0
    });
    o && (i = o, i.globalCompositeOperation = "copy", e = i.createLinearGradient(0, 0, 1, 1));
  } catch {}
  function t(s) {
    if (s.match(/#[\da-f]{3,8}/i)) switch (s.length) {
      case 4:
        return addon_webgl_K = parseInt(s.slice(1, 2).repeat(2), 16), addon_webgl_V = parseInt(s.slice(2, 3).repeat(2), 16), addon_webgl_C = parseInt(s.slice(3, 4).repeat(2), 16), addon_webgl_X.toColor(addon_webgl_K, addon_webgl_V, addon_webgl_C);
      case 5:
        return addon_webgl_K = parseInt(s.slice(1, 2).repeat(2), 16), addon_webgl_V = parseInt(s.slice(2, 3).repeat(2), 16), addon_webgl_C = parseInt(s.slice(3, 4).repeat(2), 16), addon_webgl_U = parseInt(s.slice(4, 5).repeat(2), 16), addon_webgl_X.toColor(addon_webgl_K, addon_webgl_V, addon_webgl_C, addon_webgl_U);
      case 7:
        return {
          css: s,
          rgba: (parseInt(s.slice(1), 16) << 8 | 255) >>> 0
        };
      case 9:
        return {
          css: s,
          rgba: parseInt(s.slice(1), 16) >>> 0
        };
    }
    let o = s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);
    if (o) return addon_webgl_K = parseInt(o[1]), addon_webgl_V = parseInt(o[2]), addon_webgl_C = parseInt(o[3]), addon_webgl_U = Math.round((o[5] === void 0 ? 1 : parseFloat(o[5])) * 255), addon_webgl_X.toColor(addon_webgl_K, addon_webgl_V, addon_webgl_C, addon_webgl_U);
    if (!i || !e) throw new Error("css.toColor: Unsupported css format");
    if (i.fillStyle = e, i.fillStyle = s, typeof i.fillStyle != "string") throw new Error("css.toColor: Unsupported css format");
    if (i.fillRect(0, 0, 1, 1), [addon_webgl_K, addon_webgl_V, addon_webgl_C, addon_webgl_U] = i.getImageData(0, 0, 1, 1).data, addon_webgl_U !== 255) throw new Error("css.toColor: Unsupported css format");
    return {
      rgba: addon_webgl_X.toRgba(addon_webgl_K, addon_webgl_V, addon_webgl_C, addon_webgl_U),
      css: s
    };
  }
  n.toColor = t;
})(addon_webgl_Fr ||= {});
var addon_webgl_Y;
(t => {
  function i(n) {
    return e(n >> 16 & 255, n >> 8 & 255, n & 255);
  }
  t.relativeLuminance = i;
  function e(n, s, o) {
    let r = n / 255,
      a = s / 255,
      l = o / 255,
      u = r <= .03928 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4),
      c = a <= .03928 ? a / 12.92 : Math.pow((a + .055) / 1.055, 2.4),
      d = l <= .03928 ? l / 12.92 : Math.pow((l + .055) / 1.055, 2.4);
    return u * .2126 + c * .7152 + d * .0722;
  }
  t.relativeLuminance2 = e;
})(addon_webgl_Y ||= {});
var addon_webgl_Te;
(o => {
  function i(r, a) {
    if (addon_webgl_U = (a & 255) / 255, addon_webgl_U === 1) return a;
    let l = a >> 24 & 255,
      u = a >> 16 & 255,
      c = a >> 8 & 255,
      d = r >> 24 & 255,
      h = r >> 16 & 255,
      f = r >> 8 & 255;
    return addon_webgl_K = d + Math.round((l - d) * addon_webgl_U), addon_webgl_V = h + Math.round((u - h) * addon_webgl_U), addon_webgl_C = f + Math.round((c - f) * addon_webgl_U), addon_webgl_X.toRgba(addon_webgl_K, addon_webgl_V, addon_webgl_C);
  }
  o.blend = i;
  function e(r, a, l) {
    let u = addon_webgl_Y.relativeLuminance(r >> 8),
      c = addon_webgl_Y.relativeLuminance(a >> 8);
    if (addon_webgl_ve(u, c) < l) {
      if (c < u) {
        let I = t(r, a, l),
          L = addon_webgl_ve(u, addon_webgl_Y.relativeLuminance(I >> 8));
        if (L < l) {
          let M = n(r, a, l),
            q = addon_webgl_ve(u, addon_webgl_Y.relativeLuminance(M >> 8));
          return L > q ? I : M;
        }
        return I;
      }
      let h = n(r, a, l),
        f = addon_webgl_ve(u, addon_webgl_Y.relativeLuminance(h >> 8));
      if (f < l) {
        let I = t(r, a, l),
          L = addon_webgl_ve(u, addon_webgl_Y.relativeLuminance(I >> 8));
        return f > L ? h : I;
      }
      return h;
    }
  }
  o.ensureContrastRatio = e;
  function t(r, a, l) {
    let u = r >> 24 & 255,
      c = r >> 16 & 255,
      d = r >> 8 & 255,
      h = a >> 24 & 255,
      f = a >> 16 & 255,
      I = a >> 8 & 255,
      L = addon_webgl_ve(addon_webgl_Y.relativeLuminance2(h, f, I), addon_webgl_Y.relativeLuminance2(u, c, d));
    for (; L < l && (h > 0 || f > 0 || I > 0);) h -= Math.max(0, Math.ceil(h * .1)), f -= Math.max(0, Math.ceil(f * .1)), I -= Math.max(0, Math.ceil(I * .1)), L = addon_webgl_ve(addon_webgl_Y.relativeLuminance2(h, f, I), addon_webgl_Y.relativeLuminance2(u, c, d));
    return (h << 24 | f << 16 | I << 8 | 255) >>> 0;
  }
  o.reduceLuminance = t;
  function n(r, a, l) {
    let u = r >> 24 & 255,
      c = r >> 16 & 255,
      d = r >> 8 & 255,
      h = a >> 24 & 255,
      f = a >> 16 & 255,
      I = a >> 8 & 255,
      L = addon_webgl_ve(addon_webgl_Y.relativeLuminance2(h, f, I), addon_webgl_Y.relativeLuminance2(u, c, d));
    for (; L < l && (h < 255 || f < 255 || I < 255);) h = Math.min(255, h + Math.ceil((255 - h) * .1)), f = Math.min(255, f + Math.ceil((255 - f) * .1)), I = Math.min(255, I + Math.ceil((255 - I) * .1)), L = addon_webgl_ve(addon_webgl_Y.relativeLuminance2(h, f, I), addon_webgl_Y.relativeLuminance2(u, c, d));
    return (h << 24 | f << 16 | I << 8 | 255) >>> 0;
  }
  o.increaseLuminance = n;
  function s(r) {
    return [r >> 24 & 255, r >> 16 & 255, r >> 8 & 255, r & 255];
  }
  o.toChannels = s;
})(addon_webgl_Te ||= {});
function addon_webgl_Oe(i) {
  let e = i.toString(16);
  return e.length < 2 ? "0" + e : e;
}
function addon_webgl_ve(i, e) {
  return i < e ? (e + .05) / (i + .05) : (i + .05) / (e + .05);
}
function addon_webgl_F(i) {
  if (!i) throw new Error("value must not be falsy");
  return i;
}
function addon_webgl_Rt(i) {
  return 57508 <= i && i <= 57558;
}
function addon_webgl_fn(i) {
  return 57520 <= i && i <= 57527;
}
function addon_webgl_kr(i) {
  return 57344 <= i && i <= 63743;
}
function addon_webgl_Pr(i) {
  return 9472 <= i && i <= 9631;
}
function addon_webgl_Br(i) {
  return i >= 128512 && i <= 128591 || i >= 127744 && i <= 128511 || i >= 128640 && i <= 128767 || i >= 9728 && i <= 9983 || i >= 9984 && i <= 10175 || i >= 65024 && i <= 65039 || i >= 129280 && i <= 129535 || i >= 127462 && i <= 127487;
}
function addon_webgl_mn(i, e, t, n) {
  return e === 1 && t > Math.ceil(n * 1.5) && i !== void 0 && i > 255 && !addon_webgl_Br(i) && !addon_webgl_Rt(i) && !addon_webgl_kr(i);
}
function addon_webgl_Dt(i) {
  return addon_webgl_Rt(i) || addon_webgl_Pr(i);
}
function addon_webgl_n() {
  return {
    css: {
      canvas: addon_webgl_wt(),
      cell: addon_webgl_wt()
    },
    device: {
      canvas: addon_webgl_wt(),
      cell: addon_webgl_wt(),
      char: {
        width: 0,
        height: 0,
        left: 0,
        top: 0
      }
    }
  };
}
function addon_webgl_wt() {
  return {
    width: 0,
    height: 0
  };
}
function addon_webgl_bn(i, e, t = 0) {
  return (i - (Math.round(e) * 2 - t)) % (Math.round(e) * 2);
}
var addon_webgl_j = 0,
  addon_webgl_z = 0,
  addon_webgl_me = !1,
  addon_webgl_ge = !1,
  addon_webgl_Mt = !1,
  addon_webgl_J,
  addon_webgl_Ti = 0,
  addon_webgl_At = class {
    constructor(e, t, n, s, o, r) {
      this._terminal = e;
      this._optionService = t;
      this._selectionRenderModel = n;
      this._decorationService = s;
      this._coreBrowserService = o;
      this._themeService = r;
      this.result = {
        fg: 0,
        bg: 0,
        ext: 0
      };
    }
    resolve(e, t, n, s) {
      if (this.result.bg = e.bg, this.result.fg = e.fg, this.result.ext = e.bg & 268435456 ? e.extended.ext : 0, addon_webgl_z = 0, addon_webgl_j = 0, addon_webgl_ge = !1, addon_webgl_me = !1, addon_webgl_Mt = !1, addon_webgl_J = this._themeService.colors, addon_webgl_Ti = 0, e.getCode() !== 0 && e.extended.underlineStyle === 4) {
        let r = Math.max(1, Math.floor(this._optionService.rawOptions.fontSize * this._coreBrowserService.dpr / 15));
        addon_webgl_Ti = t * s % (Math.round(r) * 2);
      }
      if (this._decorationService.forEachDecorationAtCell(t, n, "bottom", r => {
        r.backgroundColorRGB && (addon_webgl_z = r.backgroundColorRGB.rgba >> 8 & 16777215, addon_webgl_ge = !0), r.foregroundColorRGB && (addon_webgl_j = r.foregroundColorRGB.rgba >> 8 & 16777215, addon_webgl_me = !0);
      }), addon_webgl_Mt = this._selectionRenderModel.isCellSelected(this._terminal, t, n), addon_webgl_Mt) {
        if (this.result.fg & 67108864 || (this.result.bg & 50331648) !== 0) {
          if (this.result.fg & 67108864) switch (this.result.fg & 50331648) {
            case 16777216:
            case 33554432:
              addon_webgl_z = this._themeService.colors.ansi[this.result.fg & 255].rgba;
              break;
            case 50331648:
              addon_webgl_z = (this.result.fg & 16777215) << 8 | 255;
              break;
            case 0:
            default:
              addon_webgl_z = this._themeService.colors.foreground.rgba;
          } else switch (this.result.bg & 50331648) {
            case 16777216:
            case 33554432:
              addon_webgl_z = this._themeService.colors.ansi[this.result.bg & 255].rgba;
              break;
            case 50331648:
              addon_webgl_z = (this.result.bg & 16777215) << 8 | 255;
              break;
          }
          addon_webgl_z = addon_webgl_Te.blend(addon_webgl_z, (this._coreBrowserService.isFocused ? addon_webgl_J.selectionBackgroundOpaque : addon_webgl_J.selectionInactiveBackgroundOpaque).rgba & 4294967040 | 128) >> 8 & 16777215;
        } else addon_webgl_z = (this._coreBrowserService.isFocused ? addon_webgl_J.selectionBackgroundOpaque : addon_webgl_J.selectionInactiveBackgroundOpaque).rgba >> 8 & 16777215;
        if (addon_webgl_ge = !0, addon_webgl_J.selectionForeground && (addon_webgl_j = addon_webgl_J.selectionForeground.rgba >> 8 & 16777215, addon_webgl_me = !0), addon_webgl_Dt(e.getCode())) {
          if (this.result.fg & 67108864 && (this.result.bg & 50331648) === 0) addon_webgl_j = (this._coreBrowserService.isFocused ? addon_webgl_J.selectionBackgroundOpaque : addon_webgl_J.selectionInactiveBackgroundOpaque).rgba >> 8 & 16777215;else {
            if (this.result.fg & 67108864) switch (this.result.bg & 50331648) {
              case 16777216:
              case 33554432:
                addon_webgl_j = this._themeService.colors.ansi[this.result.bg & 255].rgba;
                break;
              case 50331648:
                addon_webgl_j = (this.result.bg & 16777215) << 8 | 255;
                break;
            } else switch (this.result.fg & 50331648) {
              case 16777216:
              case 33554432:
                addon_webgl_j = this._themeService.colors.ansi[this.result.fg & 255].rgba;
                break;
              case 50331648:
                addon_webgl_j = (this.result.fg & 16777215) << 8 | 255;
                break;
              case 0:
              default:
                addon_webgl_j = this._themeService.colors.foreground.rgba;
            }
            addon_webgl_j = addon_webgl_Te.blend(addon_webgl_j, (this._coreBrowserService.isFocused ? addon_webgl_J.selectionBackgroundOpaque : addon_webgl_J.selectionInactiveBackgroundOpaque).rgba & 4294967040 | 128) >> 8 & 16777215;
          }
          addon_webgl_me = !0;
        }
      }
      this._decorationService.forEachDecorationAtCell(t, n, "top", r => {
        r.backgroundColorRGB && (addon_webgl_z = r.backgroundColorRGB.rgba >> 8 & 16777215, addon_webgl_ge = !0), r.foregroundColorRGB && (addon_webgl_j = r.foregroundColorRGB.rgba >> 8 & 16777215, addon_webgl_me = !0);
      }), addon_webgl_ge && (addon_webgl_Mt ? addon_webgl_z = e.bg & -16777216 & -134217729 | addon_webgl_z | 50331648 : addon_webgl_z = e.bg & -16777216 | addon_webgl_z | 50331648), addon_webgl_me && (addon_webgl_j = e.fg & -16777216 & -67108865 | addon_webgl_j | 50331648), this.result.fg & 67108864 && (addon_webgl_ge && !addon_webgl_me && ((this.result.bg & 50331648) === 0 ? addon_webgl_j = this.result.fg & -134217728 | addon_webgl_J.background.rgba >> 8 & 16777215 & 16777215 | 50331648 : addon_webgl_j = this.result.fg & -134217728 | this.result.bg & 67108863, addon_webgl_me = !0), !addon_webgl_ge && addon_webgl_me && ((this.result.fg & 50331648) === 0 ? addon_webgl_z = this.result.bg & -67108864 | addon_webgl_J.foreground.rgba >> 8 & 16777215 & 16777215 | 50331648 : addon_webgl_z = this.result.bg & -67108864 | this.result.fg & 67108863, addon_webgl_ge = !0)), addon_webgl_J = void 0, this.result.bg = addon_webgl_ge ? addon_webgl_z : this.result.bg, this.result.fg = addon_webgl_me ? addon_webgl_j : this.result.fg, this.result.ext &= 536870911, this.result.ext |= addon_webgl_Ti << 29 & 3758096384;
    }
  };
var addon_webgl_gn = .5,
  addon_webgl_St = addon_webgl_cn || addon_webgl_dn ? "bottom" : "ideographic";
var Hr = {
    "\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
    }]
  },
  addon_webgl_Wr = {
    "\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]]
  };
var addon_webgl_Gr = {
  "\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: (i, e) => `M0,${.5 - e} L1,${.5 - e} M0,${.5 + e} L1,${.5 + e}`
  },
  "\u2551": {
    1: (i, e) => `M${.5 - i},0 L${.5 - i},1 M${.5 + i},0 L${.5 + i},1`
  },
  "\u2552": {
    1: (i, e) => `M.5,1 L.5,${.5 - e} L1,${.5 - e} M.5,${.5 + e} L1,${.5 + e}`
  },
  "\u2553": {
    1: (i, e) => `M${.5 - i},1 L${.5 - i},.5 L1,.5 M${.5 + i},.5 L${.5 + i},1`
  },
  "\u2554": {
    1: (i, e) => `M1,${.5 - e} L${.5 - i},${.5 - e} L${.5 - i},1 M1,${.5 + e} L${.5 + i},${.5 + e} L${.5 + i},1`
  },
  "\u2555": {
    1: (i, e) => `M0,${.5 - e} L.5,${.5 - e} L.5,1 M0,${.5 + e} L.5,${.5 + e}`
  },
  "\u2556": {
    1: (i, e) => `M${.5 + i},1 L${.5 + i},.5 L0,.5 M${.5 - i},.5 L${.5 - i},1`
  },
  "\u2557": {
    1: (i, e) => `M0,${.5 + e} L${.5 - i},${.5 + e} L${.5 - i},1 M0,${.5 - e} L${.5 + i},${.5 - e} L${.5 + i},1`
  },
  "\u2558": {
    1: (i, e) => `M.5,0 L.5,${.5 + e} L1,${.5 + e} M.5,${.5 - e} L1,${.5 - e}`
  },
  "\u2559": {
    1: (i, e) => `M1,.5 L${.5 - i},.5 L${.5 - i},0 M${.5 + i},.5 L${.5 + i},0`
  },
  "\u255A": {
    1: (i, e) => `M1,${.5 - e} L${.5 + i},${.5 - e} L${.5 + i},0 M1,${.5 + e} L${.5 - i},${.5 + e} L${.5 - i},0`
  },
  "\u255B": {
    1: (i, e) => `M0,${.5 + e} L.5,${.5 + e} L.5,0 M0,${.5 - e} L.5,${.5 - e}`
  },
  "\u255C": {
    1: (i, e) => `M0,.5 L${.5 + i},.5 L${.5 + i},0 M${.5 - i},.5 L${.5 - i},0`
  },
  "\u255D": {
    1: (i, e) => `M0,${.5 - e} L${.5 - i},${.5 - e} L${.5 - i},0 M0,${.5 + e} L${.5 + i},${.5 + e} L${.5 + i},0`
  },
  "\u255E": {
    1: (i, e) => `M.5,0 L.5,1 M.5,${.5 - e} L1,${.5 - e} M.5,${.5 + e} L1,${.5 + e}`
  },
  "\u255F": {
    1: (i, e) => `M${.5 - i},0 L${.5 - i},1 M${.5 + i},0 L${.5 + i},1 M${.5 + i},.5 L1,.5`
  },
  "\u2560": {
    1: (i, e) => `M${.5 - i},0 L${.5 - i},1 M1,${.5 + e} L${.5 + i},${.5 + e} L${.5 + i},1 M1,${.5 - e} L${.5 + i},${.5 - e} L${.5 + i},0`
  },
  "\u2561": {
    1: (i, e) => `M.5,0 L.5,1 M0,${.5 - e} L.5,${.5 - e} M0,${.5 + e} L.5,${.5 + e}`
  },
  "\u2562": {
    1: (i, e) => `M0,.5 L${.5 - i},.5 M${.5 - i},0 L${.5 - i},1 M${.5 + i},0 L${.5 + i},1`
  },
  "\u2563": {
    1: (i, e) => `M${.5 + i},0 L${.5 + i},1 M0,${.5 + e} L${.5 - i},${.5 + e} L${.5 - i},1 M0,${.5 - e} L${.5 - i},${.5 - e} L${.5 - i},0`
  },
  "\u2564": {
    1: (i, e) => `M0,${.5 - e} L1,${.5 - e} M0,${.5 + e} L1,${.5 + e} M.5,${.5 + e} L.5,1`
  },
  "\u2565": {
    1: (i, e) => `M0,.5 L1,.5 M${.5 - i},.5 L${.5 - i},1 M${.5 + i},.5 L${.5 + i},1`
  },
  "\u2566": {
    1: (i, e) => `M0,${.5 - e} L1,${.5 - e} M0,${.5 + e} L${.5 - i},${.5 + e} L${.5 - i},1 M1,${.5 + e} L${.5 + i},${.5 + e} L${.5 + i},1`
  },
  "\u2567": {
    1: (i, e) => `M.5,0 L.5,${.5 - e} M0,${.5 - e} L1,${.5 - e} M0,${.5 + e} L1,${.5 + e}`
  },
  "\u2568": {
    1: (i, e) => `M0,.5 L1,.5 M${.5 - i},.5 L${.5 - i},0 M${.5 + i},.5 L${.5 + i},0`
  },
  "\u2569": {
    1: (i, e) => `M0,${.5 + e} L1,${.5 + e} M0,${.5 - e} L${.5 - i},${.5 - e} L${.5 - i},0 M1,${.5 - e} L${.5 + i},${.5 - e} L${.5 + i},0`
  },
  "\u256A": {
    1: (i, e) => `M.5,0 L.5,1 M0,${.5 - e} L1,${.5 - e} M0,${.5 + e} L1,${.5 + e}`
  },
  "\u256B": {
    1: (i, e) => `M0,.5 L1,.5 M${.5 - i},0 L${.5 - i},1 M${.5 + i},0 L${.5 + i},1`
  },
  "\u256C": {
    1: (i, e) => `M0,${.5 + e} L${.5 - i},${.5 + e} L${.5 - i},1 M1,${.5 + e} L${.5 + i},${.5 + e} L${.5 + i},1 M0,${.5 - e} L${.5 - i},${.5 - e} L${.5 - i},0 M1,${.5 - e} L${.5 + i},${.5 - e} L${.5 + i},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: (i, e) => `M.5,1 L.5,${.5 + e / .15 * .5} C.5,${.5 + e / .15 * .5},.5,.5,1,.5`
  },
  "\u256E": {
    1: (i, e) => `M.5,1 L.5,${.5 + e / .15 * .5} C.5,${.5 + e / .15 * .5},.5,.5,0,.5`
  },
  "\u256F": {
    1: (i, e) => `M.5,0 L.5,${.5 - e / .15 * .5} C.5,${.5 - e / .15 * .5},.5,.5,0,.5`
  },
  "\u2570": {
    1: (i, e) => `M.5,0 L.5,${.5 - e / .15 * .5} C.5,${.5 - e / .15 * .5},.5,.5,1,.5`
  }
};
var addon_webgl_et = {
  "\uE0A0": {
    d: "M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",
    type: 0
  },
  "\uE0A1": {
    d: "M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",
    type: 0
  },
  "\uE0A2": {
    d: "M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",
    type: 0
  },
  "\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
  }
};
addon_webgl_et["\uE0BB"] = addon_webgl_et["\uE0BD"];
addon_webgl_et["\uE0BF"] = addon_webgl_et["\uE0B9"];
function addon_webgl_yn(i, e, t, n, s, o, r, a) {
  let l = Hr[e];
  if (l) return addon_webgl_$r(i, l, t, n, s, o), !0;
  let u = addon_webgl_Wr[e];
  if (u) return addon_webgl_Kr(i, u, t, n, s, o), !0;
  let c = addon_webgl_Gr[e];
  if (c) return addon_webgl_Vr(i, c, t, n, s, o, a), !0;
  let d = addon_webgl_et[e];
  return d ? (addon_webgl_Cr(i, d, t, n, s, o, r, a), !0) : !1;
}
function addon_webgl_$r(i, e, t, n, s, o) {
  for (let r = 0; r < e.length; r++) {
    let a = e[r],
      l = s / 8,
      u = o / 8;
    i.fillRect(t + a.x * l, n + a.y * u, a.w * l, a.h * u);
  }
}
var addon_webgl_xn = new Map();
function addon_webgl_Kr(i, e, t, n, s, o) {
  let r = addon_webgl_xn.get(e);
  r || (r = new Map(), addon_webgl_xn.set(e, r));
  let a = i.fillStyle;
  if (typeof a != "string") throw new Error(`Unexpected fillStyle type "${a}"`);
  let l = r.get(a);
  if (!l) {
    let u = e[0].length,
      c = e.length,
      d = i.canvas.ownerDocument.createElement("canvas");
    d.width = u, d.height = c;
    let h = addon_webgl_F(d.getContext("2d")),
      f = new ImageData(u, c),
      I,
      L,
      M,
      q;
    if (a.startsWith("#")) I = parseInt(a.slice(1, 3), 16), L = parseInt(a.slice(3, 5), 16), M = parseInt(a.slice(5, 7), 16), q = a.length > 7 && parseInt(a.slice(7, 9), 16) || 1;else if (a.startsWith("rgba")) [I, L, M, q] = a.substring(5, a.length - 1).split(",").map(S => parseFloat(S));else throw new Error(`Unexpected fillStyle color format "${a}" when drawing pattern glyph`);
    for (let S = 0; S < c; S++) for (let W = 0; W < u; W++) f.data[(S * u + W) * 4] = I, f.data[(S * u + W) * 4 + 1] = L, f.data[(S * u + W) * 4 + 2] = M, f.data[(S * u + W) * 4 + 3] = e[S][W] * (q * 255);
    h.putImageData(f, 0, 0), l = addon_webgl_F(i.createPattern(d, null)), r.set(a, l);
  }
  i.fillStyle = l, i.fillRect(t, n, s, o);
}
function addon_webgl_Vr(i, e, t, n, s, o, r) {
  i.strokeStyle = i.fillStyle;
  for (let [a, l] of Object.entries(e)) {
    i.beginPath(), i.lineWidth = r * Number.parseInt(a);
    let u;
    if (typeof l == "function") {
      let d = .15 / o * s;
      u = l(.15, d);
    } else u = l;
    for (let c of u.split(" ")) {
      let d = c[0],
        h = addon_webgl_In[d];
      if (!h) {
        console.error(`Could not find drawing instructions for "${d}"`);
        continue;
      }
      let f = c.substring(1).split(",");
      !f[0] || !f[1] || h(i, addon_webgl_Ln(f, s, o, t, n, !0, r));
    }
    i.stroke(), i.closePath();
  }
}
function addon_webgl_Cr(i, e, t, n, s, o, r, a) {
  let l = new Path2D();
  l.rect(t, n, s, o), i.clip(l), i.beginPath();
  let u = r / 12;
  i.lineWidth = a * u;
  for (let c of e.d.split(" ")) {
    let d = c[0],
      h = addon_webgl_In[d];
    if (!h) {
      console.error(`Could not find drawing instructions for "${d}"`);
      continue;
    }
    let f = c.substring(1).split(",");
    !f[0] || !f[1] || h(i, addon_webgl_Ln(f, s, o, t, n, !1, a, (e.leftPadding ?? 0) * (u / 2), (e.rightPadding ?? 0) * (u / 2)));
  }
  e.type === 1 ? (i.strokeStyle = i.fillStyle, i.stroke()) : i.fill(), i.closePath();
}
function addon_webgl_En(i, e, t = 0) {
  return Math.max(Math.min(i, e), t);
}
var addon_webgl_In = {
  C: (i, e) => i.bezierCurveTo(e[0], e[1], e[2], e[3], e[4], e[5]),
  L: (i, e) => i.lineTo(e[0], e[1]),
  M: (i, e) => i.moveTo(e[0], e[1])
};
function addon_webgl_Ln(i, e, t, n, s, o, r, a = 0, l = 0) {
  let u = i.map(c => parseFloat(c) || parseInt(c));
  if (u.length < 2) throw new Error("Too few arguments for instruction");
  for (let c = 0; c < u.length; c += 2) u[c] *= e - a * r - l * r, o && u[c] !== 0 && (u[c] = addon_webgl_En(Math.round(u[c] + .5) - .5, e, 0)), u[c] += n + a * r;
  for (let c = 1; c < u.length; c += 2) u[c] *= t, o && u[c] !== 0 && (u[c] = addon_webgl_En(Math.round(u[c] + .5) - .5, t, 0)), u[c] += s;
  return u;
}
var addon_webgl_Ot = class {
    constructor() {
      this._data = {};
    }
    set(e, t, n) {
      this._data[e] || (this._data[e] = {}), this._data[e][t] = n;
    }
    get(e, t) {
      return this._data[e] ? this._data[e][t] : void 0;
    }
    clear() {
      this._data = {};
    }
  },
  addon_webgl_tt = class {
    constructor() {
      this._data = new addon_webgl_Ot();
    }
    set(e, t, n, s, o) {
      this._data.get(e, t) || this._data.set(e, t, new addon_webgl_Ot()), this._data.get(e, t).set(n, s, o);
    }
    get(e, t, n, s) {
      return this._data.get(e, t)?.get(n, s);
    }
    clear() {
      this._data.clear();
    }
  };
var addon_webgl_Ft = class {
    constructor() {
      this._tasks = [];
      this._i = 0;
    }
    enqueue(e) {
      this._tasks.push(e), this._start();
    }
    flush() {
      for (; this._i < this._tasks.length;) this._tasks[this._i]() || this._i++;
      this.clear();
    }
    clear() {
      this._idleCallback && (this._cancelCallback(this._idleCallback), this._idleCallback = void 0), this._i = 0, this._tasks.length = 0;
    }
    _start() {
      this._idleCallback || (this._idleCallback = this._requestCallback(this._process.bind(this)));
    }
    _process(e) {
      this._idleCallback = void 0;
      let t = 0,
        n = 0,
        s = e.timeRemaining(),
        o = 0;
      for (; this._i < this._tasks.length;) {
        if (t = performance.now(), this._tasks[this._i]() || this._i++, t = Math.max(1, performance.now() - t), n = Math.max(t, n), o = e.timeRemaining(), n * 1.5 > o) {
          s - t < -20 && console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s - t))}ms`), this._start();
          return;
        }
        s = o;
      }
      this.clear();
    }
  },
  addon_webgl_gi = class extends addon_webgl_Ft {
    _requestCallback(e) {
      return setTimeout(() => e(this._createDeadline(16)));
    }
    _cancelCallback(e) {
      clearTimeout(e);
    }
    _createDeadline(e) {
      let t = performance.now() + e;
      return {
        timeRemaining: () => Math.max(0, t - performance.now())
      };
    }
  },
  addon_webgl_xi = class extends addon_webgl_Ft {
    _requestCallback(e) {
      return requestIdleCallback(e);
    }
    _cancelCallback(e) {
      cancelIdleCallback(e);
    }
  },
  addon_webgl_wn = !addon_webgl_Lt && "requestIdleCallback" in window ? addon_webgl_xi : addon_webgl_gi;
var addon_webgl_he = class i {
    constructor() {
      this.fg = 0;
      this.bg = 0;
      this.extended = new addon_webgl_it();
    }
    static toColorRGB(e) {
      return [e >>> 16 & 255, e >>> 8 & 255, e & 255];
    }
    static fromColorRGB(e) {
      return (e[0] & 255) << 16 | (e[1] & 255) << 8 | e[2] & 255;
    }
    clone() {
      let e = new i();
      return e.fg = this.fg, e.bg = this.bg, e.extended = this.extended.clone(), e;
    }
    isInverse() {
      return this.fg & 67108864;
    }
    isBold() {
      return this.fg & 134217728;
    }
    isUnderline() {
      return this.hasExtendedAttrs() && this.extended.underlineStyle !== 0 ? 1 : this.fg & 268435456;
    }
    isBlink() {
      return this.fg & 536870912;
    }
    isInvisible() {
      return this.fg & 1073741824;
    }
    isItalic() {
      return this.bg & 67108864;
    }
    isDim() {
      return this.bg & 134217728;
    }
    isStrikethrough() {
      return this.fg & 2147483648;
    }
    isProtected() {
      return this.bg & 536870912;
    }
    isOverline() {
      return this.bg & 1073741824;
    }
    getFgColorMode() {
      return this.fg & 50331648;
    }
    getBgColorMode() {
      return this.bg & 50331648;
    }
    isFgRGB() {
      return (this.fg & 50331648) === 50331648;
    }
    isBgRGB() {
      return (this.bg & 50331648) === 50331648;
    }
    isFgPalette() {
      return (this.fg & 50331648) === 16777216 || (this.fg & 50331648) === 33554432;
    }
    isBgPalette() {
      return (this.bg & 50331648) === 16777216 || (this.bg & 50331648) === 33554432;
    }
    isFgDefault() {
      return (this.fg & 50331648) === 0;
    }
    isBgDefault() {
      return (this.bg & 50331648) === 0;
    }
    isAttributeDefault() {
      return this.fg === 0 && this.bg === 0;
    }
    getFgColor() {
      switch (this.fg & 50331648) {
        case 16777216:
        case 33554432:
          return this.fg & 255;
        case 50331648:
          return this.fg & 16777215;
        default:
          return -1;
      }
    }
    getBgColor() {
      switch (this.bg & 50331648) {
        case 16777216:
        case 33554432:
          return this.bg & 255;
        case 50331648:
          return this.bg & 16777215;
        default:
          return -1;
      }
    }
    hasExtendedAttrs() {
      return this.bg & 268435456;
    }
    updateExtended() {
      this.extended.isEmpty() ? this.bg &= -268435457 : this.bg |= 268435456;
    }
    getUnderlineColor() {
      if (this.bg & 268435456 && ~this.extended.underlineColor) switch (this.extended.underlineColor & 50331648) {
        case 16777216:
        case 33554432:
          return this.extended.underlineColor & 255;
        case 50331648:
          return this.extended.underlineColor & 16777215;
        default:
          return this.getFgColor();
      }
      return this.getFgColor();
    }
    getUnderlineColorMode() {
      return this.bg & 268435456 && ~this.extended.underlineColor ? this.extended.underlineColor & 50331648 : this.getFgColorMode();
    }
    isUnderlineColorRGB() {
      return this.bg & 268435456 && ~this.extended.underlineColor ? (this.extended.underlineColor & 50331648) === 50331648 : this.isFgRGB();
    }
    isUnderlineColorPalette() {
      return this.bg & 268435456 && ~this.extended.underlineColor ? (this.extended.underlineColor & 50331648) === 16777216 || (this.extended.underlineColor & 50331648) === 33554432 : this.isFgPalette();
    }
    isUnderlineColorDefault() {
      return this.bg & 268435456 && ~this.extended.underlineColor ? (this.extended.underlineColor & 50331648) === 0 : this.isFgDefault();
    }
    getUnderlineStyle() {
      return this.fg & 268435456 ? this.bg & 268435456 ? this.extended.underlineStyle : 1 : 0;
    }
    getUnderlineVariantOffset() {
      return this.extended.underlineVariantOffset;
    }
  },
  addon_webgl_it = class i {
    constructor(e = 0, t = 0) {
      this._ext = 0;
      this._urlId = 0;
      this._ext = e, this._urlId = t;
    }
    get ext() {
      return this._urlId ? this._ext & -469762049 | this.underlineStyle << 26 : this._ext;
    }
    set ext(e) {
      this._ext = e;
    }
    get underlineStyle() {
      return this._urlId ? 5 : (this._ext & 469762048) >> 26;
    }
    set underlineStyle(e) {
      this._ext &= -469762049, this._ext |= e << 26 & 469762048;
    }
    get underlineColor() {
      return this._ext & 67108863;
    }
    set underlineColor(e) {
      this._ext &= -67108864, this._ext |= e & 67108863;
    }
    get urlId() {
      return this._urlId;
    }
    set urlId(e) {
      this._urlId = e;
    }
    get underlineVariantOffset() {
      let e = (this._ext & 3758096384) >> 29;
      return e < 0 ? e ^ 4294967288 : e;
    }
    set underlineVariantOffset(e) {
      this._ext &= 536870911, this._ext |= e << 29 & 3758096384;
    }
    clone() {
      return new i(this._ext, this._urlId);
    }
    isEmpty() {
      return this.underlineStyle === 0 && this._urlId === 0;
    }
  };
var addon_webgl_He = class He {
  constructor(e) {
    this.element = e, this.next = He.Undefined, this.prev = He.Undefined;
  }
};
addon_webgl_He.Undefined = new addon_webgl_He(void 0);
var addon_webgl_Rn = (/* unused pure expression or super */ null && (addon_webgl_He));
var addon_webgl_zr = globalThis.performance && typeof globalThis.performance.now == "function",
  addon_webgl_kt = class i {
    static create(e) {
      return new i(e);
    }
    constructor(e) {
      this._now = addon_webgl_zr && e === !1 ? Date.now : globalThis.performance.now.bind(globalThis.performance), this._startTime = this._now(), this._stopTime = -1;
    }
    stop() {
      this._stopTime = this._now();
    }
    reset() {
      this._startTime = this._now(), this._stopTime = -1;
    }
    elapsed() {
      return this._stopTime !== -1 ? this._stopTime - this._startTime : this._now() - this._startTime;
    }
  };
var addon_webgl_qr = !1,
  addon_webgl_Dn = !1,
  addon_webgl_jr = !1,
  addon_webgl_ee;
(se => {
  se.None = () => addon_webgl_B.None;
  function e(v) {
    if (addon_webgl_jr) {
      let {
          onDidAddListener: p
        } = v,
        g = addon_webgl_nt.create(),
        b = 0;
      v.onDidAddListener = () => {
        ++b === 2 && (console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"), g.print()), p?.();
      };
    }
  }
  function t(v, p) {
    return h(v, () => {}, 0, void 0, !0, void 0, p);
  }
  se.defer = t;
  function n(v) {
    return (p, g = null, b) => {
      let m = !1,
        _;
      return _ = v(T => {
        if (!m) return _ ? _.dispose() : m = !0, p.call(g, T);
      }, null, b), m && _.dispose(), _;
    };
  }
  se.once = n;
  function s(v, p, g) {
    return c((b, m = null, _) => v(T => b.call(m, p(T)), null, _), g);
  }
  se.map = s;
  function o(v, p, g) {
    return c((b, m = null, _) => v(T => {
      p(T), b.call(m, T);
    }, null, _), g);
  }
  se.forEach = o;
  function r(v, p, g) {
    return c((b, m = null, _) => v(T => p(T) && b.call(m, T), null, _), g);
  }
  se.filter = r;
  function a(v) {
    return v;
  }
  se.signal = a;
  function l(...v) {
    return (p, g = null, b) => {
      let m = addon_webgl_It(...v.map(_ => _(T => p.call(g, T))));
      return d(m, b);
    };
  }
  se.any = l;
  function u(v, p, g, b) {
    let m = g;
    return s(v, _ => (m = p(m, _), m), b);
  }
  se.reduce = u;
  function c(v, p) {
    let g,
      b = {
        onWillAddFirstListener() {
          g = v(m.fire, m);
        },
        onDidRemoveLastListener() {
          g?.dispose();
        }
      };
    p || e(b);
    let m = new addon_webgl_D(b);
    return p?.add(m), m.event;
  }
  function d(v, p) {
    return p instanceof Array ? p.push(v) : p && p.add(v), v;
  }
  function h(v, p, g = 100, b = !1, m = !1, _, T) {
    let x,
      R,
      $,
      P = 0,
      de,
      Re = {
        leakWarningThreshold: _,
        onWillAddFirstListener() {
          x = v(ie => {
            P++, R = p(R, ie), b && !$ && (oe.fire(R), R = void 0), de = () => {
              let N = R;
              R = void 0, $ = void 0, (!b || P > 1) && oe.fire(N), P = 0;
            }, typeof g == "number" ? (clearTimeout($), $ = setTimeout(de, g)) : $ === void 0 && ($ = 0, queueMicrotask(de));
          });
        },
        onWillRemoveListener() {
          m && P > 0 && de?.();
        },
        onDidRemoveLastListener() {
          de = void 0, x.dispose();
        }
      };
    T || e(Re);
    let oe = new addon_webgl_D(Re);
    return T?.add(oe), oe.event;
  }
  se.debounce = h;
  function f(v, p = 0, g) {
    return se.debounce(v, (b, m) => b ? (b.push(m), b) : [m], p, void 0, !0, void 0, g);
  }
  se.accumulate = f;
  function I(v, p = (b, m) => b === m, g) {
    let b = !0,
      m;
    return r(v, _ => {
      let T = b || !p(_, m);
      return b = !1, m = _, T;
    }, g);
  }
  se.latch = I;
  function L(v, p, g) {
    return [se.filter(v, p, g), se.filter(v, b => !p(b), g)];
  }
  se.split = L;
  function M(v, p = !1, g = [], b) {
    let m = g.slice(),
      _ = v(R => {
        m ? m.push(R) : x.fire(R);
      });
    b && b.add(_);
    let T = () => {
        m?.forEach(R => x.fire(R)), m = null;
      },
      x = new addon_webgl_D({
        onWillAddFirstListener() {
          _ || (_ = v(R => x.fire(R)), b && b.add(_));
        },
        onDidAddFirstListener() {
          m && (p ? setTimeout(T) : T());
        },
        onDidRemoveLastListener() {
          _ && _.dispose(), _ = null;
        }
      });
    return b && b.add(x), x.event;
  }
  se.buffer = M;
  function q(v, p) {
    return (b, m, _) => {
      let T = p(new W());
      return v(function (x) {
        let R = T.evaluate(x);
        R !== S && b.call(m, R);
      }, void 0, _);
    };
  }
  se.chain = q;
  let S = Symbol("HaltChainable");
  class W {
    constructor() {
      this.steps = [];
    }
    map(p) {
      return this.steps.push(p), this;
    }
    forEach(p) {
      return this.steps.push(g => (p(g), g)), this;
    }
    filter(p) {
      return this.steps.push(g => p(g) ? g : S), this;
    }
    reduce(p, g) {
      let b = g;
      return this.steps.push(m => (b = p(b, m), b)), this;
    }
    latch(p = (g, b) => g === b) {
      let g = !0,
        b;
      return this.steps.push(m => {
        let _ = g || !p(m, b);
        return g = !1, b = m, _ ? m : S;
      }), this;
    }
    evaluate(p) {
      for (let g of this.steps) if (p = g(p), p === S) break;
      return p;
    }
  }
  function E(v, p, g = b => b) {
    let b = (...x) => T.fire(g(...x)),
      m = () => v.on(p, b),
      _ = () => v.removeListener(p, b),
      T = new addon_webgl_D({
        onWillAddFirstListener: m,
        onDidRemoveLastListener: _
      });
    return T.event;
  }
  se.fromNodeEventEmitter = E;
  function y(v, p, g = b => b) {
    let b = (...x) => T.fire(g(...x)),
      m = () => v.addEventListener(p, b),
      _ = () => v.removeEventListener(p, b),
      T = new addon_webgl_D({
        onWillAddFirstListener: m,
        onDidRemoveLastListener: _
      });
    return T.event;
  }
  se.fromDOMEventEmitter = y;
  function w(v) {
    return new Promise(p => n(v)(p));
  }
  se.toPromise = w;
  function G(v) {
    let p = new addon_webgl_D();
    return v.then(g => {
      p.fire(g);
    }, () => {
      p.fire(void 0);
    }).finally(() => {
      p.dispose();
    }), p.event;
  }
  se.fromPromise = G;
  function ue(v, p) {
    return v(g => p.fire(g));
  }
  se.forward = ue;
  function Se(v, p, g) {
    return p(g), v(b => p(b));
  }
  se.runAndSubscribe = Se;
  class ce {
    constructor(p, g) {
      this._observable = p;
      this._counter = 0;
      this._hasChanged = !1;
      let b = {
        onWillAddFirstListener: () => {
          p.addObserver(this);
        },
        onDidRemoveLastListener: () => {
          p.removeObserver(this);
        }
      };
      g || e(b), this.emitter = new addon_webgl_D(b), g && g.add(this.emitter);
    }
    beginUpdate(p) {
      this._counter++;
    }
    handlePossibleChange(p) {}
    handleChange(p, g) {
      this._hasChanged = !0;
    }
    endUpdate(p) {
      this._counter--, this._counter === 0 && (this._observable.reportChanges(), this._hasChanged && (this._hasChanged = !1, this.emitter.fire(this._observable.get())));
    }
  }
  function we(v, p) {
    return new ce(v, p).emitter.event;
  }
  se.fromObservable = we;
  function A(v) {
    return (p, g, b) => {
      let m = 0,
        _ = !1,
        T = {
          beginUpdate() {
            m++;
          },
          endUpdate() {
            m--, m === 0 && (v.reportChanges(), _ && (_ = !1, p.call(g)));
          },
          handlePossibleChange() {},
          handleChange() {
            _ = !0;
          }
        };
      v.addObserver(T), v.reportChanges();
      let x = {
        dispose() {
          v.removeObserver(T);
        }
      };
      return b instanceof addon_webgl_fe ? b.add(x) : Array.isArray(b) && b.push(x), x;
    };
  }
  se.fromObservableLight = A;
})(addon_webgl_ee ||= {});
var addon_webgl_We = class We {
  constructor(e) {
    this.listenerCount = 0;
    this.invocationCount = 0;
    this.elapsedOverall = 0;
    this.durations = [];
    this.name = `${e}_${We._idPool++}`, We.all.add(this);
  }
  start(e) {
    this._stopWatch = new addon_webgl_kt(), this.listenerCount = e;
  }
  stop() {
    if (this._stopWatch) {
      let e = this._stopWatch.elapsed();
      this.durations.push(e), this.elapsedOverall += e, this.invocationCount += 1, this._stopWatch = void 0;
    }
  }
};
addon_webgl_We.all = new Set(), addon_webgl_We._idPool = 0;
var addon_webgl_Ei = addon_webgl_We,
  addon_webgl_Mn = -1;
var addon_webgl_Bt = class Bt {
  constructor(e, t, n = (Bt._idPool++).toString(16).padStart(3, "0")) {
    this._errorHandler = e;
    this.threshold = t;
    this.name = n;
    this._warnCountdown = 0;
  }
  dispose() {
    this._stacks?.clear();
  }
  check(e, t) {
    let n = this.threshold;
    if (n <= 0 || t < n) return;
    this._stacks || (this._stacks = new Map());
    let s = this._stacks.get(e.value) || 0;
    if (this._stacks.set(e.value, s + 1), this._warnCountdown -= 1, this._warnCountdown <= 0) {
      this._warnCountdown = n * .5;
      let [o, r] = this.getMostFrequentStack(),
        a = `[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r}):`;
      console.warn(a), console.warn(o);
      let l = new addon_webgl_Ii(a, o);
      this._errorHandler(l);
    }
    return () => {
      let o = this._stacks.get(e.value) || 0;
      this._stacks.set(e.value, o - 1);
    };
  }
  getMostFrequentStack() {
    if (!this._stacks) return;
    let e,
      t = 0;
    for (let [n, s] of this._stacks) (!e || t < s) && (e = [n, s], t = s);
    return e;
  }
};
addon_webgl_Bt._idPool = 1;
var addon_webgl_yi = addon_webgl_Bt,
  addon_webgl_nt = class i {
    constructor(e) {
      this.value = e;
    }
    static create() {
      let e = new Error();
      return new i(e.stack ?? "");
    }
    print() {
      console.warn(this.value.split(`
`).slice(2).join(`
`));
    }
  },
  addon_webgl_Ii = class extends Error {
    constructor(e, t) {
      super(e), this.name = "ListenerLeakError", this.stack = t;
    }
  },
  addon_webgl_Li = class extends Error {
    constructor(e, t) {
      super(e), this.name = "ListenerRefusalError", this.stack = t;
    }
  },
  addon_webgl_Xr = 0,
  addon_webgl_Ge = class {
    constructor(e) {
      this.value = e;
      this.id = addon_webgl_Xr++;
    }
  },
  addon_webgl_Yr = 2,
  addon_webgl_Qr = (i, e) => {
    if (i instanceof addon_webgl_Ge) e(i);else for (let t = 0; t < i.length; t++) {
      let n = i[t];
      n && e(n);
    }
  },
  addon_webgl_Pt;
if (addon_webgl_qr) {
  let i = [];
  setInterval(() => {
    i.length !== 0 && (console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"), console.warn(i.join(`
`)), i.length = 0);
  }, 3e3), addon_webgl_Pt = new FinalizationRegistry(e => {
    typeof e == "string" && i.push(e);
  });
}
var addon_webgl_D = class {
  constructor(e) {
    this._size = 0;
    this._options = e, this._leakageMon = addon_webgl_Mn > 0 || this._options?.leakWarningThreshold ? new addon_webgl_yi(e?.onListenerError ?? addon_webgl_Pe, this._options?.leakWarningThreshold ?? addon_webgl_Mn) : void 0, this._perfMon = this._options?._profName ? new addon_webgl_Ei(this._options._profName) : void 0, this._deliveryQueue = this._options?.deliveryQueue;
  }
  dispose() {
    if (!this._disposed) {
      if (this._disposed = !0, this._deliveryQueue?.current === this && this._deliveryQueue.reset(), this._listeners) {
        if (addon_webgl_Dn) {
          let e = this._listeners;
          queueMicrotask(() => {
            addon_webgl_Qr(e, t => t.stack?.print());
          });
        }
        this._listeners = void 0, this._size = 0;
      }
      this._options?.onDidRemoveLastListener?.(), this._leakageMon?.dispose();
    }
  }
  get event() {
    return this._event ??= (e, t, n) => {
      if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) {
        let l = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;
        console.warn(l);
        let u = this._leakageMon.getMostFrequentStack() ?? ["UNKNOWN stack", -1],
          c = new addon_webgl_Li(`${l}. HINT: Stack shows most frequent listener (${u[1]}-times)`, u[0]);
        return (this._options?.onListenerError || addon_webgl_Pe)(c), addon_webgl_B.None;
      }
      if (this._disposed) return addon_webgl_B.None;
      t && (e = e.bind(t));
      let s = new addon_webgl_Ge(e),
        o,
        r;
      this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * .2) && (s.stack = addon_webgl_nt.create(), o = this._leakageMon.check(s.stack, this._size + 1)), addon_webgl_Dn && (s.stack = r ?? addon_webgl_nt.create()), this._listeners ? this._listeners instanceof addon_webgl_Ge ? (this._deliveryQueue ??= new addon_webgl_wi(), this._listeners = [this._listeners, s]) : this._listeners.push(s) : (this._options?.onWillAddFirstListener?.(this), this._listeners = s, this._options?.onDidAddFirstListener?.(this)), this._size++;
      let a = addon_webgl_O(() => {
        addon_webgl_Pt?.unregister(a), o?.(), this._removeListener(s);
      });
      if (n instanceof addon_webgl_fe ? n.add(a) : Array.isArray(n) && n.push(a), addon_webgl_Pt) {
        let l = new Error().stack.split(`
`).slice(2, 3).join(`
`).trim(),
          u = /(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(l);
        addon_webgl_Pt.register(a, u?.[2] ?? l, a);
      }
      return a;
    }, this._event;
  }
  _removeListener(e) {
    if (this._options?.onWillRemoveListener?.(this), !this._listeners) return;
    if (this._size === 1) {
      this._listeners = void 0, this._options?.onDidRemoveLastListener?.(this), this._size = 0;
      return;
    }
    let t = this._listeners,
      n = t.indexOf(e);
    if (n === -1) throw console.log("disposed?", this._disposed), console.log("size?", this._size), console.log("arr?", JSON.stringify(this._listeners)), new Error("Attempted to dispose unknown listener");
    this._size--, t[n] = void 0;
    let s = this._deliveryQueue.current === this;
    if (this._size * addon_webgl_Yr <= t.length) {
      let o = 0;
      for (let r = 0; r < t.length; r++) t[r] ? t[o++] = t[r] : s && (this._deliveryQueue.end--, o < this._deliveryQueue.i && this._deliveryQueue.i--);
      t.length = o;
    }
  }
  _deliver(e, t) {
    if (!e) return;
    let n = this._options?.onListenerError || addon_webgl_Pe;
    if (!n) {
      e.value(t);
      return;
    }
    try {
      e.value(t);
    } catch (s) {
      n(s);
    }
  }
  _deliverQueue(e) {
    let t = e.current._listeners;
    for (; e.i < e.end;) this._deliver(t[e.i++], e.value);
    e.reset();
  }
  fire(e) {
    if (this._deliveryQueue?.current && (this._deliverQueue(this._deliveryQueue), this._perfMon?.stop()), this._perfMon?.start(this._size), this._listeners) if (this._listeners instanceof addon_webgl_Ge) this._deliver(this._listeners, e);else {
      let t = this._deliveryQueue;
      t.enqueue(this, e, this._listeners.length), this._deliverQueue(t);
    }
    this._perfMon?.stop();
  }
  hasListeners() {
    return this._size > 0;
  }
};
var addon_webgl_wi = class {
  constructor() {
    this.i = -1;
    this.end = 0;
  }
  enqueue(e, t, n) {
    this.i = 0, this.end = n, this.current = e, this.value = t;
  }
  reset() {
    this.i = this.end, this.current = void 0, this.value = void 0;
  }
};
var An = {
    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
    }
  },
  addon_webgl_rt = 2;
var addon_webgl_st,
  addon_webgl_ae = class i {
    constructor(e, t, n) {
      this._document = e;
      this._config = t;
      this._unicodeService = n;
      this._didWarmUp = !1;
      this._cacheMap = new addon_webgl_tt();
      this._cacheMapCombined = new addon_webgl_tt();
      this._pages = [];
      this._activePages = [];
      this._workBoundingBox = {
        top: 0,
        left: 0,
        bottom: 0,
        right: 0
      };
      this._workAttributeData = new addon_webgl_he();
      this._textureSize = 512;
      this._onAddTextureAtlasCanvas = new addon_webgl_D();
      this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event;
      this._onRemoveTextureAtlasCanvas = new addon_webgl_D();
      this.onRemoveTextureAtlasCanvas = this._onRemoveTextureAtlasCanvas.event;
      this._requestClearModel = !1;
      this._createNewPage(), this._tmpCanvas = addon_webgl_Sn(e, this._config.deviceCellWidth * 4 + addon_webgl_rt * 2, this._config.deviceCellHeight + addon_webgl_rt * 2), this._tmpCtx = addon_webgl_F(this._tmpCanvas.getContext("2d", {
        alpha: this._config.allowTransparency,
        willReadFrequently: !0
      }));
    }
    get pages() {
      return this._pages;
    }
    dispose() {
      this._tmpCanvas.remove();
      for (let e of this.pages) e.canvas.remove();
      this._onAddTextureAtlasCanvas.dispose();
    }
    warmUp() {
      this._didWarmUp || (this._doWarmUp(), this._didWarmUp = !0);
    }
    _doWarmUp() {
      let e = new addon_webgl_wn();
      for (let t = 33; t < 126; t++) e.enqueue(() => {
        if (!this._cacheMap.get(t, 0, 0, 0)) {
          let n = this._drawToCache(t, 0, 0, 0, !1, void 0);
          this._cacheMap.set(t, 0, 0, 0, n);
        }
      });
    }
    beginFrame() {
      return this._requestClearModel;
    }
    clearTexture() {
      if (!(this._pages[0].currentRow.x === 0 && this._pages[0].currentRow.y === 0)) {
        for (let e of this._pages) e.clear();
        this._cacheMap.clear(), this._cacheMapCombined.clear(), this._didWarmUp = !1;
      }
    }
    _createNewPage() {
      if (i.maxAtlasPages && this._pages.length >= Math.max(4, i.maxAtlasPages)) {
        let t = this._pages.filter(u => u.canvas.width * 2 <= (i.maxTextureSize || 4096)).sort((u, c) => c.canvas.width !== u.canvas.width ? c.canvas.width - u.canvas.width : c.percentageUsed - u.percentageUsed),
          n = -1,
          s = 0;
        for (let u = 0; u < t.length; u++) if (t[u].canvas.width !== s) n = u, s = t[u].canvas.width;else if (u - n === 3) break;
        let o = t.slice(n, n + 4),
          r = o.map(u => u.glyphs[0].texturePage).sort((u, c) => u > c ? 1 : -1),
          a = this.pages.length - o.length,
          l = this._mergePages(o, a);
        l.version++;
        for (let u = r.length - 1; u >= 0; u--) this._deletePage(r[u]);
        this.pages.push(l), this._requestClearModel = !0, this._onAddTextureAtlasCanvas.fire(l.canvas);
      }
      let e = new addon_webgl_ot(this._document, this._textureSize);
      return this._pages.push(e), this._activePages.push(e), this._onAddTextureAtlasCanvas.fire(e.canvas), e;
    }
    _mergePages(e, t) {
      let n = e[0].canvas.width * 2,
        s = new addon_webgl_ot(this._document, n, e);
      for (let [o, r] of e.entries()) {
        let a = o * r.canvas.width % n,
          l = Math.floor(o / 2) * r.canvas.height;
        s.ctx.drawImage(r.canvas, a, l);
        for (let c of r.glyphs) c.texturePage = t, c.sizeClipSpace.x = c.size.x / n, c.sizeClipSpace.y = c.size.y / n, c.texturePosition.x += a, c.texturePosition.y += l, c.texturePositionClipSpace.x = c.texturePosition.x / n, c.texturePositionClipSpace.y = c.texturePosition.y / n;
        this._onRemoveTextureAtlasCanvas.fire(r.canvas);
        let u = this._activePages.indexOf(r);
        u !== -1 && this._activePages.splice(u, 1);
      }
      return s;
    }
    _deletePage(e) {
      this._pages.splice(e, 1);
      for (let t = e; t < this._pages.length; t++) {
        let n = this._pages[t];
        for (let s of n.glyphs) s.texturePage--;
        n.version++;
      }
    }
    getRasterizedGlyphCombinedChar(e, t, n, s, o, r) {
      return this._getFromCacheMap(this._cacheMapCombined, e, t, n, s, o, r);
    }
    getRasterizedGlyph(e, t, n, s, o, r) {
      return this._getFromCacheMap(this._cacheMap, e, t, n, s, o, r);
    }
    _getFromCacheMap(e, t, n, s, o, r, a) {
      return addon_webgl_st = e.get(t, n, s, o), addon_webgl_st || (addon_webgl_st = this._drawToCache(t, n, s, o, r, a), e.set(t, n, s, o, addon_webgl_st)), addon_webgl_st;
    }
    _getColorFromAnsiIndex(e) {
      if (e >= this._config.colors.ansi.length) throw new Error("No color found for idx " + e);
      return this._config.colors.ansi[e];
    }
    _getBackgroundColor(e, t, n, s) {
      if (this._config.allowTransparency) return addon_webgl_Z;
      let o;
      switch (e) {
        case 16777216:
        case 33554432:
          o = this._getColorFromAnsiIndex(t);
          break;
        case 50331648:
          let r = addon_webgl_he.toColorRGB(t);
          o = addon_webgl_X.toColor(r[0], r[1], r[2]);
          break;
        case 0:
        default:
          n ? o = addon_webgl_Ue.opaque(this._config.colors.foreground) : o = this._config.colors.background;
          break;
      }
      return this._config.allowTransparency || (o = addon_webgl_Ue.opaque(o)), o;
    }
    _getForegroundColor(e, t, n, s, o, r, a, l, u, c) {
      let d = this._getMinimumContrastColor(e, t, n, s, o, r, a, u, l, c);
      if (d) return d;
      let h;
      switch (o) {
        case 16777216:
        case 33554432:
          this._config.drawBoldTextInBrightColors && u && r < 8 && (r += 8), h = this._getColorFromAnsiIndex(r);
          break;
        case 50331648:
          let f = addon_webgl_he.toColorRGB(r);
          h = addon_webgl_X.toColor(f[0], f[1], f[2]);
          break;
        case 0:
        default:
          a ? h = this._config.colors.background : h = this._config.colors.foreground;
      }
      return this._config.allowTransparency && (h = addon_webgl_Ue.opaque(h)), l && (h = addon_webgl_Ue.multiplyOpacity(h, addon_webgl_gn)), h;
    }
    _resolveBackgroundRgba(e, t, n) {
      switch (e) {
        case 16777216:
        case 33554432:
          return this._getColorFromAnsiIndex(t).rgba;
        case 50331648:
          return t << 8;
        case 0:
        default:
          return n ? this._config.colors.foreground.rgba : this._config.colors.background.rgba;
      }
    }
    _resolveForegroundRgba(e, t, n, s) {
      switch (e) {
        case 16777216:
        case 33554432:
          return this._config.drawBoldTextInBrightColors && s && t < 8 && (t += 8), this._getColorFromAnsiIndex(t).rgba;
        case 50331648:
          return t << 8;
        case 0:
        default:
          return n ? this._config.colors.background.rgba : this._config.colors.foreground.rgba;
      }
    }
    _getMinimumContrastColor(e, t, n, s, o, r, a, l, u, c) {
      if (this._config.minimumContrastRatio === 1 || c) return;
      let d = this._getContrastCache(u),
        h = d.getColor(e, s);
      if (h !== void 0) return h || void 0;
      let f = this._resolveBackgroundRgba(t, n, a),
        I = this._resolveForegroundRgba(o, r, a, l),
        L = addon_webgl_Te.ensureContrastRatio(f, I, this._config.minimumContrastRatio / (u ? 2 : 1));
      if (!L) {
        d.setColor(e, s, null);
        return;
      }
      let M = addon_webgl_X.toColor(L >> 24 & 255, L >> 16 & 255, L >> 8 & 255);
      return d.setColor(e, s, M), M;
    }
    _getContrastCache(e) {
      return e ? this._config.colors.halfContrastCache : this._config.colors.contrastCache;
    }
    _drawToCache(e, t, n, s, o, r) {
      let a = typeof e == "number" ? String.fromCharCode(e) : e;
      r && this._tmpCanvas.parentElement !== r && (this._tmpCanvas.style.display = "none", r.append(this._tmpCanvas));
      let l = Math.min(this._config.deviceCellWidth * Math.max(a.length, 2) + addon_webgl_rt * 2, this._config.deviceMaxTextureSize);
      this._tmpCanvas.width < l && (this._tmpCanvas.width = l);
      let u = Math.min(this._config.deviceCellHeight + addon_webgl_rt * 4, this._textureSize);
      if (this._tmpCanvas.height < u && (this._tmpCanvas.height = u), this._tmpCtx.save(), this._workAttributeData.fg = n, this._workAttributeData.bg = t, this._workAttributeData.extended.ext = s, !!this._workAttributeData.isInvisible()) return An;
      let d = !!this._workAttributeData.isBold(),
        h = !!this._workAttributeData.isInverse(),
        f = !!this._workAttributeData.isDim(),
        I = !!this._workAttributeData.isItalic(),
        L = !!this._workAttributeData.isUnderline(),
        M = !!this._workAttributeData.isStrikethrough(),
        q = !!this._workAttributeData.isOverline(),
        S = this._workAttributeData.getFgColor(),
        W = this._workAttributeData.getFgColorMode(),
        E = this._workAttributeData.getBgColor(),
        y = this._workAttributeData.getBgColorMode();
      if (h) {
        let x = S;
        S = E, E = x;
        let R = W;
        W = y, y = R;
      }
      let w = this._getBackgroundColor(y, E, h, f);
      this._tmpCtx.globalCompositeOperation = "copy", this._tmpCtx.fillStyle = w.css, this._tmpCtx.fillRect(0, 0, this._tmpCanvas.width, this._tmpCanvas.height), this._tmpCtx.globalCompositeOperation = "source-over";
      let G = d ? this._config.fontWeightBold : this._config.fontWeight,
        ue = I ? "italic" : "";
      this._tmpCtx.font = `${ue} ${G} ${this._config.fontSize * this._config.devicePixelRatio}px ${this._config.fontFamily}`, this._tmpCtx.textBaseline = addon_webgl_St;
      let Se = a.length === 1 && addon_webgl_Rt(a.charCodeAt(0)),
        ce = a.length === 1 && addon_webgl_fn(a.charCodeAt(0)),
        we = this._getForegroundColor(t, y, E, n, W, S, h, f, d, addon_webgl_Dt(a.charCodeAt(0)));
      this._tmpCtx.fillStyle = we.css;
      let A = ce ? 0 : addon_webgl_rt * 2,
        se = !1;
      this._config.customGlyphs !== !1 && (se = addon_webgl_yn(this._tmpCtx, a, A, A, this._config.deviceCellWidth, this._config.deviceCellHeight, this._config.fontSize, this._config.devicePixelRatio));
      let v = !Se,
        p;
      if (typeof e == "number" ? p = this._unicodeService.wcwidth(e) : p = this._unicodeService.getStringCellWidth(e), L) {
        this._tmpCtx.save();
        let x = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 15)),
          R = x % 2 === 1 ? .5 : 0;
        if (this._tmpCtx.lineWidth = x, this._workAttributeData.isUnderlineColorDefault()) this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle;else if (this._workAttributeData.isUnderlineColorRGB()) v = !1, this._tmpCtx.strokeStyle = `rgb(${addon_webgl_he.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else {
          v = !1;
          let ie = this._workAttributeData.getUnderlineColor();
          this._config.drawBoldTextInBrightColors && this._workAttributeData.isBold() && ie < 8 && (ie += 8), this._tmpCtx.strokeStyle = this._getColorFromAnsiIndex(ie).css;
        }
        this._tmpCtx.beginPath();
        let $ = A,
          P = Math.ceil(A + this._config.deviceCharHeight) - R - (o ? x * 2 : 0),
          de = P + x,
          Re = P + x * 2,
          oe = this._workAttributeData.getUnderlineVariantOffset();
        for (let ie = 0; ie < p; ie++) {
          this._tmpCtx.save();
          let N = $ + ie * this._config.deviceCellWidth,
            ne = $ + (ie + 1) * this._config.deviceCellWidth,
            di = N + this._config.deviceCellWidth / 2;
          switch (this._workAttributeData.extended.underlineStyle) {
            case 2:
              this._tmpCtx.moveTo(N, P), this._tmpCtx.lineTo(ne, P), this._tmpCtx.moveTo(N, Re), this._tmpCtx.lineTo(ne, Re);
              break;
            case 3:
              let ft = x <= 1 ? Re : Math.ceil(A + this._config.deviceCharHeight - x / 2) - R,
                mt = x <= 1 ? P : Math.ceil(A + this._config.deviceCharHeight + x / 2) - R,
                qi = new Path2D();
              qi.rect(N, P, this._config.deviceCellWidth, Re - P), this._tmpCtx.clip(qi), this._tmpCtx.moveTo(N - this._config.deviceCellWidth / 2, de), this._tmpCtx.bezierCurveTo(N - this._config.deviceCellWidth / 2, mt, N, mt, N, de), this._tmpCtx.bezierCurveTo(N, ft, di, ft, di, de), this._tmpCtx.bezierCurveTo(di, mt, ne, mt, ne, de), this._tmpCtx.bezierCurveTo(ne, ft, ne + this._config.deviceCellWidth / 2, ft, ne + this._config.deviceCellWidth / 2, de);
              break;
            case 4:
              let _t = oe === 0 ? 0 : oe >= x ? x * 2 - oe : x - oe;
              !(oe >= x) === !1 || _t === 0 ? (this._tmpCtx.setLineDash([Math.round(x), Math.round(x)]), this._tmpCtx.moveTo(N + _t, P), this._tmpCtx.lineTo(ne, P)) : (this._tmpCtx.setLineDash([Math.round(x), Math.round(x)]), this._tmpCtx.moveTo(N, P), this._tmpCtx.lineTo(N + _t, P), this._tmpCtx.moveTo(N + _t + x, P), this._tmpCtx.lineTo(ne, P)), oe = addon_webgl_bn(ne - N, x, oe);
              break;
            case 5:
              let Er = .6,
                yr = .3,
                hi = ne - N,
                ji = Math.floor(Er * hi),
                Xi = Math.floor(yr * hi),
                Ir = hi - ji - Xi;
              this._tmpCtx.setLineDash([ji, Xi, Ir]), this._tmpCtx.moveTo(N, P), this._tmpCtx.lineTo(ne, P);
              break;
            case 1:
            default:
              this._tmpCtx.moveTo(N, P), this._tmpCtx.lineTo(ne, P);
              break;
          }
          this._tmpCtx.stroke(), this._tmpCtx.restore();
        }
        if (this._tmpCtx.restore(), !se && this._config.fontSize >= 12 && !this._config.allowTransparency && a !== " ") {
          this._tmpCtx.save(), this._tmpCtx.textBaseline = "alphabetic";
          let ie = this._tmpCtx.measureText(a);
          if (this._tmpCtx.restore(), "actualBoundingBoxDescent" in ie && ie.actualBoundingBoxDescent > 0) {
            this._tmpCtx.save();
            let N = new Path2D();
            N.rect($, P - Math.ceil(x / 2), this._config.deviceCellWidth * p, Re - P + Math.ceil(x / 2)), this._tmpCtx.clip(N), this._tmpCtx.lineWidth = this._config.devicePixelRatio * 3, this._tmpCtx.strokeStyle = w.css, this._tmpCtx.strokeText(a, A, A + this._config.deviceCharHeight), this._tmpCtx.restore();
          }
        }
      }
      if (q) {
        let x = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 15)),
          R = x % 2 === 1 ? .5 : 0;
        this._tmpCtx.lineWidth = x, this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle, this._tmpCtx.beginPath(), this._tmpCtx.moveTo(A, A + R), this._tmpCtx.lineTo(A + this._config.deviceCharWidth * p, A + R), this._tmpCtx.stroke();
      }
      if (se || this._tmpCtx.fillText(a, A, A + this._config.deviceCharHeight), a === "_" && !this._config.allowTransparency) {
        let x = addon_webgl_Di(this._tmpCtx.getImageData(A, A, this._config.deviceCellWidth, this._config.deviceCellHeight), w, we, v);
        if (x) for (let R = 1; R <= 5 && (this._tmpCtx.save(), this._tmpCtx.fillStyle = w.css, this._tmpCtx.fillRect(0, 0, this._tmpCanvas.width, this._tmpCanvas.height), this._tmpCtx.restore(), this._tmpCtx.fillText(a, A, A + this._config.deviceCharHeight - R), x = addon_webgl_Di(this._tmpCtx.getImageData(A, A, this._config.deviceCellWidth, this._config.deviceCellHeight), w, we, v), !!x); R++);
      }
      if (M) {
        let x = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 10)),
          R = this._tmpCtx.lineWidth % 2 === 1 ? .5 : 0;
        this._tmpCtx.lineWidth = x, this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle, this._tmpCtx.beginPath(), this._tmpCtx.moveTo(A, A + Math.floor(this._config.deviceCharHeight / 2) - R), this._tmpCtx.lineTo(A + this._config.deviceCharWidth * p, A + Math.floor(this._config.deviceCharHeight / 2) - R), this._tmpCtx.stroke();
      }
      this._tmpCtx.restore();
      let g = this._tmpCtx.getImageData(0, 0, this._tmpCanvas.width, this._tmpCanvas.height),
        b;
      if (this._config.allowTransparency ? b = addon_webgl_Jr(g) : b = addon_webgl_Di(g, w, we, v), b) return An;
      let m = this._findGlyphBoundingBox(g, this._workBoundingBox, l, ce, se, A),
        _,
        T;
      for (;;) {
        if (this._activePages.length === 0) {
          let x = this._createNewPage();
          _ = x, T = x.currentRow, T.height = m.size.y;
          break;
        }
        _ = this._activePages[this._activePages.length - 1], T = _.currentRow;
        for (let x of this._activePages) m.size.y <= x.currentRow.height && (_ = x, T = x.currentRow);
        for (let x = this._activePages.length - 1; x >= 0; x--) for (let R of this._activePages[x].fixedRows) R.height <= T.height && m.size.y <= R.height && (_ = this._activePages[x], T = R);
        if (m.size.x > this._textureSize) {
          this._overflowSizePage || (this._overflowSizePage = new addon_webgl_ot(this._document, this._config.deviceMaxTextureSize), this.pages.push(this._overflowSizePage), this._requestClearModel = !0, this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)), _ = this._overflowSizePage, T = this._overflowSizePage.currentRow, T.x + m.size.x >= _.canvas.width && (T.x = 0, T.y += T.height, T.height = 0);
          break;
        }
        if (T.y + m.size.y >= _.canvas.height || T.height > m.size.y + 2) {
          let x = !1;
          if (_.currentRow.y + _.currentRow.height + m.size.y >= _.canvas.height) {
            let R;
            for (let $ of this._activePages) if ($.currentRow.y + $.currentRow.height + m.size.y < $.canvas.height) {
              R = $;
              break;
            }
            if (R) _ = R;else if (i.maxAtlasPages && this._pages.length >= i.maxAtlasPages && T.y + m.size.y <= _.canvas.height && T.height >= m.size.y && T.x + m.size.x <= _.canvas.width) x = !0;else {
              let $ = this._createNewPage();
              _ = $, T = $.currentRow, T.height = m.size.y, x = !0;
            }
          }
          x || (_.currentRow.height > 0 && _.fixedRows.push(_.currentRow), T = {
            x: 0,
            y: _.currentRow.y + _.currentRow.height,
            height: m.size.y
          }, _.fixedRows.push(T), _.currentRow = {
            x: 0,
            y: T.y + T.height,
            height: 0
          });
        }
        if (T.x + m.size.x <= _.canvas.width) break;
        T === _.currentRow ? (T.x = 0, T.y += T.height, T.height = 0) : _.fixedRows.splice(_.fixedRows.indexOf(T), 1);
      }
      return m.texturePage = this._pages.indexOf(_), m.texturePosition.x = T.x, m.texturePosition.y = T.y, m.texturePositionClipSpace.x = T.x / _.canvas.width, m.texturePositionClipSpace.y = T.y / _.canvas.height, m.sizeClipSpace.x /= _.canvas.width, m.sizeClipSpace.y /= _.canvas.height, T.height = Math.max(T.height, m.size.y), T.x += m.size.x, _.ctx.putImageData(g, m.texturePosition.x - this._workBoundingBox.left, m.texturePosition.y - this._workBoundingBox.top, this._workBoundingBox.left, this._workBoundingBox.top, m.size.x, m.size.y), _.addGlyph(m), _.version++, m;
    }
    _findGlyphBoundingBox(e, t, n, s, o, r) {
      t.top = 0;
      let a = s ? this._config.deviceCellHeight : this._tmpCanvas.height,
        l = s ? this._config.deviceCellWidth : n,
        u = !1;
      for (let c = 0; c < a; c++) {
        for (let d = 0; d < l; d++) {
          let h = c * this._tmpCanvas.width * 4 + d * 4 + 3;
          if (e.data[h] !== 0) {
            t.top = c, u = !0;
            break;
          }
        }
        if (u) break;
      }
      t.left = 0, u = !1;
      for (let c = 0; c < r + l; c++) {
        for (let d = 0; d < a; d++) {
          let h = d * this._tmpCanvas.width * 4 + c * 4 + 3;
          if (e.data[h] !== 0) {
            t.left = c, u = !0;
            break;
          }
        }
        if (u) break;
      }
      t.right = l, u = !1;
      for (let c = r + l - 1; c >= r; c--) {
        for (let d = 0; d < a; d++) {
          let h = d * this._tmpCanvas.width * 4 + c * 4 + 3;
          if (e.data[h] !== 0) {
            t.right = c, u = !0;
            break;
          }
        }
        if (u) break;
      }
      t.bottom = a, u = !1;
      for (let c = a - 1; c >= 0; c--) {
        for (let d = 0; d < l; d++) {
          let h = c * this._tmpCanvas.width * 4 + d * 4 + 3;
          if (e.data[h] !== 0) {
            t.bottom = c, u = !0;
            break;
          }
        }
        if (u) break;
      }
      return {
        texturePage: 0,
        texturePosition: {
          x: 0,
          y: 0
        },
        texturePositionClipSpace: {
          x: 0,
          y: 0
        },
        size: {
          x: t.right - t.left + 1,
          y: t.bottom - t.top + 1
        },
        sizeClipSpace: {
          x: t.right - t.left + 1,
          y: t.bottom - t.top + 1
        },
        offset: {
          x: -t.left + r + (s || o ? Math.floor((this._config.deviceCellWidth - this._config.deviceCharWidth) / 2) : 0),
          y: -t.top + r + (s || o ? this._config.lineHeight === 1 ? 0 : Math.round((this._config.deviceCellHeight - this._config.deviceCharHeight) / 2) : 0)
        }
      };
    }
  },
  addon_webgl_ot = class {
    constructor(e, t, n) {
      this._usedPixels = 0;
      this._glyphs = [];
      this.version = 0;
      this.currentRow = {
        x: 0,
        y: 0,
        height: 0
      };
      this.fixedRows = [];
      if (n) for (let s of n) this._glyphs.push(...s.glyphs), this._usedPixels += s._usedPixels;
      this.canvas = addon_webgl_Sn(e, t, t), this.ctx = addon_webgl_F(this.canvas.getContext("2d", {
        alpha: !0
      }));
    }
    get percentageUsed() {
      return this._usedPixels / (this.canvas.width * this.canvas.height);
    }
    get glyphs() {
      return this._glyphs;
    }
    addGlyph(e) {
      this._glyphs.push(e), this._usedPixels += e.size.x * e.size.y;
    }
    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 addon_webgl_Di(i, e, t, n) {
  let s = e.rgba >>> 24,
    o = e.rgba >>> 16 & 255,
    r = e.rgba >>> 8 & 255,
    a = t.rgba >>> 24,
    l = t.rgba >>> 16 & 255,
    u = t.rgba >>> 8 & 255,
    c = Math.floor((Math.abs(s - a) + Math.abs(o - l) + Math.abs(r - u)) / 12),
    d = !0;
  for (let h = 0; h < i.data.length; h += 4) i.data[h] === s && i.data[h + 1] === o && i.data[h + 2] === r || n && Math.abs(i.data[h] - s) + Math.abs(i.data[h + 1] - o) + Math.abs(i.data[h + 2] - r) < c ? i.data[h + 3] = 0 : d = !1;
  return d;
}
function addon_webgl_Jr(i) {
  for (let e = 0; e < i.data.length; e += 4) if (i.data[e + 3] > 0) return !1;
  return !0;
}
function addon_webgl_Sn(i, e, t) {
  let n = i.createElement("canvas");
  return n.width = e, n.height = t, n;
}
function On(i, e, t, n, s, o, r, a) {
  let l = {
    foreground: o.foreground,
    background: o.background,
    cursor: addon_webgl_Z,
    cursorAccent: addon_webgl_Z,
    selectionForeground: addon_webgl_Z,
    selectionBackgroundTransparent: addon_webgl_Z,
    selectionBackgroundOpaque: addon_webgl_Z,
    selectionInactiveBackgroundTransparent: addon_webgl_Z,
    selectionInactiveBackgroundOpaque: addon_webgl_Z,
    overviewRulerBorder: addon_webgl_Z,
    scrollbarSliderBackground: addon_webgl_Z,
    scrollbarSliderHoverBackground: addon_webgl_Z,
    scrollbarSliderActiveBackground: addon_webgl_Z,
    ansi: o.ansi.slice(),
    contrastCache: o.contrastCache,
    halfContrastCache: o.halfContrastCache
  };
  return {
    customGlyphs: s.customGlyphs,
    devicePixelRatio: r,
    deviceMaxTextureSize: a,
    letterSpacing: s.letterSpacing,
    lineHeight: s.lineHeight,
    deviceCellWidth: i,
    deviceCellHeight: e,
    deviceCharWidth: t,
    deviceCharHeight: n,
    fontFamily: s.fontFamily,
    fontSize: s.fontSize,
    fontWeight: s.fontWeight,
    fontWeightBold: s.fontWeightBold,
    allowTransparency: s.allowTransparency,
    drawBoldTextInBrightColors: s.drawBoldTextInBrightColors,
    minimumContrastRatio: s.minimumContrastRatio,
    colors: l
  };
}
function addon_webgl_Mi(i, e) {
  for (let t = 0; t < i.colors.ansi.length; t++) if (i.colors.ansi[t].rgba !== e.colors.ansi[t].rgba) return !1;
  return i.devicePixelRatio === e.devicePixelRatio && i.customGlyphs === e.customGlyphs && i.lineHeight === e.lineHeight && i.letterSpacing === e.letterSpacing && i.fontFamily === e.fontFamily && i.fontSize === e.fontSize && i.fontWeight === e.fontWeight && i.fontWeightBold === e.fontWeightBold && i.allowTransparency === e.allowTransparency && i.deviceCharWidth === e.deviceCharWidth && i.deviceCharHeight === e.deviceCharHeight && i.drawBoldTextInBrightColors === e.drawBoldTextInBrightColors && i.minimumContrastRatio === e.minimumContrastRatio && i.colors.foreground.rgba === e.colors.foreground.rgba && i.colors.background.rgba === e.colors.background.rgba;
}
function addon_webgl_Fn(i) {
  return (i & 50331648) === 16777216 || (i & 50331648) === 33554432;
}
var addon_webgl_le = [];
function addon_webgl_Nt(i, e, t, n, s, o, r, a, l) {
  let u = On(n, s, o, r, e, t, a, l);
  for (let h = 0; h < addon_webgl_le.length; h++) {
    let f = addon_webgl_le[h],
      I = f.ownedBy.indexOf(i);
    if (I >= 0) {
      if (addon_webgl_Mi(f.config, u)) return f.atlas;
      f.ownedBy.length === 1 ? (f.atlas.dispose(), addon_webgl_le.splice(h, 1)) : f.ownedBy.splice(I, 1);
      break;
    }
  }
  for (let h = 0; h < addon_webgl_le.length; h++) {
    let f = addon_webgl_le[h];
    if (addon_webgl_Mi(f.config, u)) return f.ownedBy.push(i), f.atlas;
  }
  let c = i._core,
    d = {
      atlas: new addon_webgl_ae(document, u, c.unicodeService),
      config: u,
      ownedBy: [i]
    };
  return addon_webgl_le.push(d), d.atlas;
}
function addon_webgl_Ai(i) {
  for (let e = 0; e < addon_webgl_le.length; e++) {
    let t = addon_webgl_le[e].ownedBy.indexOf(i);
    if (t !== -1) {
      addon_webgl_le[e].ownedBy.length === 1 ? (addon_webgl_le[e].atlas.dispose(), addon_webgl_le.splice(e, 1)) : addon_webgl_le[e].ownedBy.splice(t, 1);
      break;
    }
  }
}
var addon_webgl_Ut = 600,
  Ht = class {
    constructor(e, t) {
      this._renderCallback = e;
      this._coreBrowserService = t;
      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(e = addon_webgl_Ut) {
      this._blinkInterval && (this._coreBrowserService.window.clearInterval(this._blinkInterval), this._blinkInterval = void 0), this._blinkStartTimeout = this._coreBrowserService.window.setTimeout(() => {
        if (this._animationTimeRestarted) {
          let t = addon_webgl_Ut - (Date.now() - this._animationTimeRestarted);
          if (this._animationTimeRestarted = void 0, t > 0) {
            this._restartInterval(t);
            return;
          }
        }
        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 t = addon_webgl_Ut - (Date.now() - this._animationTimeRestarted);
            this._animationTimeRestarted = void 0, this._restartInterval(t);
            return;
          }
          this.isCursorVisible = !this.isCursorVisible, this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {
            this._renderCallback(), this._animationFrame = void 0;
          });
        }, addon_webgl_Ut);
      }, e);
    }
    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();
    }
  };
function addon_webgl_Si(i, e, t) {
  let n = new e.ResizeObserver(s => {
    let o = s.find(l => l.target === i);
    if (!o) return;
    if (!("devicePixelContentBoxSize" in o)) {
      n?.disconnect(), n = void 0;
      return;
    }
    let r = o.devicePixelContentBoxSize[0].inlineSize,
      a = o.devicePixelContentBoxSize[0].blockSize;
    r > 0 && a > 0 && t(r, a);
  });
  try {
    n.observe(i, {
      box: ["device-pixel-content-box"]
    });
  } catch {
    n.disconnect(), n = void 0;
  }
  return addon_webgl_O(() => n?.disconnect());
}
function kn(i) {
  return i > 65535 ? (i -= 65536, String.fromCharCode((i >> 10) + 55296) + String.fromCharCode(i % 1024 + 56320)) : String.fromCharCode(i);
}
var addon_webgl_at = class i extends addon_webgl_he {
  constructor() {
    super(...arguments);
    this.content = 0;
    this.fg = 0;
    this.bg = 0;
    this.extended = new addon_webgl_it();
    this.combinedData = "";
  }
  static fromCharData(t) {
    let n = new i();
    return n.setFromCharData(t), n;
  }
  isCombined() {
    return this.content & 2097152;
  }
  getWidth() {
    return this.content >> 22;
  }
  getChars() {
    return this.content & 2097152 ? this.combinedData : this.content & 2097151 ? kn(this.content & 2097151) : "";
  }
  getCode() {
    return this.isCombined() ? this.combinedData.charCodeAt(this.combinedData.length - 1) : this.content & 2097151;
  }
  setFromCharData(t) {
    this.fg = t[0], this.bg = 0;
    let n = !1;
    if (t[1].length > 2) n = !0;else if (t[1].length === 2) {
      let s = t[1].charCodeAt(0);
      if (55296 <= s && s <= 56319) {
        let o = t[1].charCodeAt(1);
        56320 <= o && o <= 57343 ? this.content = (s - 55296) * 1024 + o - 56320 + 65536 | t[2] << 22 : n = !0;
      } else n = !0;
    } else this.content = t[1].charCodeAt(0) | t[2] << 22;
    n && (this.combinedData = t[1], this.content = 2097152 | t[2] << 22);
  }
  getAsCharData() {
    return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
  }
};
var addon_webgl_Gt = new Float32Array([2, 0, 0, 0, 0, -2, 0, 0, 0, 0, 1, 0, -1, 1, 0, 1]);
function addon_webgl_$t(i, e, t) {
  let n = addon_webgl_F(i.createProgram());
  if (i.attachShader(n, addon_webgl_F(addon_webgl_Pn(i, i.VERTEX_SHADER, e))), i.attachShader(n, addon_webgl_F(addon_webgl_Pn(i, i.FRAGMENT_SHADER, t))), i.linkProgram(n), i.getProgramParameter(n, i.LINK_STATUS)) return n;
  console.error(i.getProgramInfoLog(n)), i.deleteProgram(n);
}
function addon_webgl_Pn(i, e, t) {
  let n = addon_webgl_F(i.createShader(e));
  if (i.shaderSource(n, t), i.compileShader(n), i.getShaderParameter(n, i.COMPILE_STATUS)) return n;
  console.error(i.getShaderInfoLog(n)), i.deleteShader(n);
}
function Bn(i, e) {
  let t = Math.min(i.length * 2, e),
    n = new Float32Array(t);
  for (let s = 0; s < i.length; s++) n[s] = i[s];
  return n;
}
var addon_webgl_Wt = class {
  constructor(e) {
    this.texture = e, this.version = -1;
  }
};
var addon_webgl_is = `#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 addon_webgl_ns(i) {
  let e = "";
  for (let t = 1; t < i; t++) e += ` else if (v_texpage == ${t}) { outColor = texture(u_texture[${t}], v_texcoord); }`;
  return `#version 300 es
precision lowp float;

in vec2 v_texcoord;
flat in int v_texpage;

uniform sampler2D u_texture[${i}];

out vec4 outColor;

void main() {
  if (v_texpage == 0) {
    outColor = texture(u_texture[0], v_texcoord);
  } ${e}
}`;
}
var addon_webgl_De = 11,
  addon_webgl_Ve = addon_webgl_De * Float32Array.BYTES_PER_ELEMENT,
  addon_webgl_rs = 2,
  addon_webgl_H = 0,
  addon_webgl_k,
  addon_webgl_Fi = 0,
  addon_webgl_lt = 0,
  addon_webgl_Kt = class extends addon_webgl_B {
    constructor(t, n, s, o) {
      super();
      this._terminal = t;
      this._gl = n;
      this._dimensions = s;
      this._optionsService = o;
      this._activeBuffer = 0;
      this._vertices = {
        count: 0,
        attributes: new Float32Array(0),
        attributesBuffers: [new Float32Array(0), new Float32Array(0)]
      };
      let r = this._gl;
      addon_webgl_ae.maxAtlasPages === void 0 && (addon_webgl_ae.maxAtlasPages = Math.min(32, addon_webgl_F(r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS))), addon_webgl_ae.maxTextureSize = addon_webgl_F(r.getParameter(r.MAX_TEXTURE_SIZE))), this._program = addon_webgl_F(addon_webgl_$t(r, addon_webgl_is, addon_webgl_ns(addon_webgl_ae.maxAtlasPages))), this._register(addon_webgl_O(() => r.deleteProgram(this._program))), this._projectionLocation = addon_webgl_F(r.getUniformLocation(this._program, "u_projection")), this._resolutionLocation = addon_webgl_F(r.getUniformLocation(this._program, "u_resolution")), this._textureLocation = addon_webgl_F(r.getUniformLocation(this._program, "u_texture")), this._vertexArrayObject = r.createVertexArray(), r.bindVertexArray(this._vertexArrayObject);
      let a = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]),
        l = r.createBuffer();
      this._register(addon_webgl_O(() => r.deleteBuffer(l))), r.bindBuffer(r.ARRAY_BUFFER, l), r.bufferData(r.ARRAY_BUFFER, a, r.STATIC_DRAW), r.enableVertexAttribArray(0), r.vertexAttribPointer(0, 2, this._gl.FLOAT, !1, 0, 0);
      let u = new Uint8Array([0, 1, 2, 3]),
        c = r.createBuffer();
      this._register(addon_webgl_O(() => r.deleteBuffer(c))), r.bindBuffer(r.ELEMENT_ARRAY_BUFFER, c), r.bufferData(r.ELEMENT_ARRAY_BUFFER, u, r.STATIC_DRAW), this._attributesBuffer = addon_webgl_F(r.createBuffer()), this._register(addon_webgl_O(() => r.deleteBuffer(this._attributesBuffer))), r.bindBuffer(r.ARRAY_BUFFER, this._attributesBuffer), r.enableVertexAttribArray(2), r.vertexAttribPointer(2, 2, r.FLOAT, !1, addon_webgl_Ve, 0), r.vertexAttribDivisor(2, 1), r.enableVertexAttribArray(3), r.vertexAttribPointer(3, 2, r.FLOAT, !1, addon_webgl_Ve, 2 * Float32Array.BYTES_PER_ELEMENT), r.vertexAttribDivisor(3, 1), r.enableVertexAttribArray(4), r.vertexAttribPointer(4, 1, r.FLOAT, !1, addon_webgl_Ve, 4 * Float32Array.BYTES_PER_ELEMENT), r.vertexAttribDivisor(4, 1), r.enableVertexAttribArray(5), r.vertexAttribPointer(5, 2, r.FLOAT, !1, addon_webgl_Ve, 5 * Float32Array.BYTES_PER_ELEMENT), r.vertexAttribDivisor(5, 1), r.enableVertexAttribArray(6), r.vertexAttribPointer(6, 2, r.FLOAT, !1, addon_webgl_Ve, 7 * Float32Array.BYTES_PER_ELEMENT), r.vertexAttribDivisor(6, 1), r.enableVertexAttribArray(1), r.vertexAttribPointer(1, 2, r.FLOAT, !1, addon_webgl_Ve, 9 * Float32Array.BYTES_PER_ELEMENT), r.vertexAttribDivisor(1, 1), r.useProgram(this._program);
      let d = new Int32Array(addon_webgl_ae.maxAtlasPages);
      for (let h = 0; h < addon_webgl_ae.maxAtlasPages; h++) d[h] = h;
      r.uniform1iv(this._textureLocation, d), r.uniformMatrix4fv(this._projectionLocation, !1, addon_webgl_Gt), this._atlasTextures = [];
      for (let h = 0; h < addon_webgl_ae.maxAtlasPages; h++) {
        let f = new addon_webgl_Wt(addon_webgl_F(r.createTexture()));
        this._register(addon_webgl_O(() => r.deleteTexture(f.texture))), r.activeTexture(r.TEXTURE0 + h), r.bindTexture(r.TEXTURE_2D, f.texture), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, 1, 1, 0, r.RGBA, r.UNSIGNED_BYTE, new Uint8Array([255, 0, 0, 255])), this._atlasTextures[h] = f;
      }
      r.enable(r.BLEND), r.blendFunc(r.SRC_ALPHA, r.ONE_MINUS_SRC_ALPHA), this.handleResize();
    }
    beginFrame() {
      return this._atlas ? this._atlas.beginFrame() : !0;
    }
    updateCell(t, n, s, o, r, a, l, u, c) {
      this._updateCell(this._vertices.attributes, t, n, s, o, r, a, l, u, c);
    }
    _updateCell(t, n, s, o, r, a, l, u, c, d) {
      if (addon_webgl_H = (s * this._terminal.cols + n) * addon_webgl_De, o === 0 || o === void 0) {
        t.fill(0, addon_webgl_H, addon_webgl_H + addon_webgl_De - 1 - addon_webgl_rs);
        return;
      }
      this._atlas && (u && u.length > 1 ? addon_webgl_k = this._atlas.getRasterizedGlyphCombinedChar(u, r, a, l, !1, this._terminal.element) : addon_webgl_k = this._atlas.getRasterizedGlyph(o, r, a, l, !1, this._terminal.element), addon_webgl_Fi = Math.floor((this._dimensions.device.cell.width - this._dimensions.device.char.width) / 2), r !== d && addon_webgl_k.offset.x > addon_webgl_Fi ? (addon_webgl_lt = addon_webgl_k.offset.x - addon_webgl_Fi, t[addon_webgl_H] = -(addon_webgl_k.offset.x - addon_webgl_lt) + this._dimensions.device.char.left, t[addon_webgl_H + 1] = -addon_webgl_k.offset.y + this._dimensions.device.char.top, t[addon_webgl_H + 2] = (addon_webgl_k.size.x - addon_webgl_lt) / this._dimensions.device.canvas.width, t[addon_webgl_H + 3] = addon_webgl_k.size.y / this._dimensions.device.canvas.height, t[addon_webgl_H + 4] = addon_webgl_k.texturePage, t[addon_webgl_H + 5] = addon_webgl_k.texturePositionClipSpace.x + addon_webgl_lt / this._atlas.pages[addon_webgl_k.texturePage].canvas.width, t[addon_webgl_H + 6] = addon_webgl_k.texturePositionClipSpace.y, t[addon_webgl_H + 7] = addon_webgl_k.sizeClipSpace.x - addon_webgl_lt / this._atlas.pages[addon_webgl_k.texturePage].canvas.width, t[addon_webgl_H + 8] = addon_webgl_k.sizeClipSpace.y) : (t[addon_webgl_H] = -addon_webgl_k.offset.x + this._dimensions.device.char.left, t[addon_webgl_H + 1] = -addon_webgl_k.offset.y + this._dimensions.device.char.top, t[addon_webgl_H + 2] = addon_webgl_k.size.x / this._dimensions.device.canvas.width, t[addon_webgl_H + 3] = addon_webgl_k.size.y / this._dimensions.device.canvas.height, t[addon_webgl_H + 4] = addon_webgl_k.texturePage, t[addon_webgl_H + 5] = addon_webgl_k.texturePositionClipSpace.x, t[addon_webgl_H + 6] = addon_webgl_k.texturePositionClipSpace.y, t[addon_webgl_H + 7] = addon_webgl_k.sizeClipSpace.x, t[addon_webgl_H + 8] = addon_webgl_k.sizeClipSpace.y), this._optionsService.rawOptions.rescaleOverlappingGlyphs && addon_webgl_mn(o, c, addon_webgl_k.size.x, this._dimensions.device.cell.width) && (t[addon_webgl_H + 2] = (this._dimensions.device.cell.width - 1) / this._dimensions.device.canvas.width));
    }
    clear() {
      let t = this._terminal,
        n = t.cols * t.rows * addon_webgl_De;
      this._vertices.count !== n ? this._vertices.attributes = new Float32Array(n) : this._vertices.attributes.fill(0);
      let s = 0;
      for (; s < this._vertices.attributesBuffers.length; s++) this._vertices.count !== n ? this._vertices.attributesBuffers[s] = new Float32Array(n) : this._vertices.attributesBuffers[s].fill(0);
      this._vertices.count = n, s = 0;
      for (let o = 0; o < t.rows; o++) for (let r = 0; r < t.cols; r++) this._vertices.attributes[s + 9] = r / t.cols, this._vertices.attributes[s + 10] = o / t.rows, s += addon_webgl_De;
    }
    handleResize() {
      let t = this._gl;
      t.useProgram(this._program), t.viewport(0, 0, t.canvas.width, t.canvas.height), t.uniform2f(this._resolutionLocation, t.canvas.width, t.canvas.height), this.clear();
    }
    render(t) {
      if (!this._atlas) return;
      let n = this._gl;
      n.useProgram(this._program), n.bindVertexArray(this._vertexArrayObject), this._activeBuffer = (this._activeBuffer + 1) % 2;
      let s = this._vertices.attributesBuffers[this._activeBuffer],
        o = 0;
      for (let r = 0; r < t.lineLengths.length; r++) {
        let a = r * this._terminal.cols * addon_webgl_De,
          l = this._vertices.attributes.subarray(a, a + t.lineLengths[r] * addon_webgl_De);
        s.set(l, o), o += l.length;
      }
      n.bindBuffer(n.ARRAY_BUFFER, this._attributesBuffer), n.bufferData(n.ARRAY_BUFFER, s.subarray(0, o), n.STREAM_DRAW);
      for (let r = 0; r < this._atlas.pages.length; r++) this._atlas.pages[r].version !== this._atlasTextures[r].version && this._bindAtlasPageTexture(n, this._atlas, r);
      n.drawElementsInstanced(n.TRIANGLE_STRIP, 4, n.UNSIGNED_BYTE, 0, o / addon_webgl_De);
    }
    setAtlas(t) {
      this._atlas = t;
      for (let n of this._atlasTextures) n.version = -1;
    }
    _bindAtlasPageTexture(t, n, s) {
      t.activeTexture(t.TEXTURE0 + s), t.bindTexture(t.TEXTURE_2D, this._atlasTextures[s].texture), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, n.pages[s].canvas), t.generateMipmap(t.TEXTURE_2D), this._atlasTextures[s].version = n.pages[s].version;
    }
    setDimensions(t) {
      this._dimensions = t;
    }
  };
var addon_webgl_ki = class {
  constructor() {
    this.clear();
  }
  clear() {
    this.hasSelection = !1, this.columnSelectMode = !1, this.viewportStartRow = 0, this.viewportEndRow = 0, this.viewportCappedStartRow = 0, this.viewportCappedEndRow = 0, this.startCol = 0, this.endCol = 0, this.selectionStart = void 0, this.selectionEnd = void 0;
  }
  update(e, t, n, s = !1) {
    if (this.selectionStart = t, this.selectionEnd = n, !t || !n || t[0] === n[0] && t[1] === n[1]) {
      this.clear();
      return;
    }
    let o = e.buffers.active.ydisp,
      r = t[1] - o,
      a = n[1] - o,
      l = Math.max(r, 0),
      u = Math.min(a, e.rows - 1);
    if (l >= e.rows || u < 0) {
      this.clear();
      return;
    }
    this.hasSelection = !0, this.columnSelectMode = s, this.viewportStartRow = r, this.viewportEndRow = a, this.viewportCappedStartRow = l, this.viewportCappedEndRow = u, this.startCol = t[0], this.endCol = n[0];
  }
  isCellSelected(e, t, n) {
    return this.hasSelection ? (n -= e.buffer.active.viewportY, this.columnSelectMode ? this.startCol <= this.endCol ? t >= this.startCol && n >= this.viewportCappedStartRow && t < this.endCol && n <= this.viewportCappedEndRow : t < this.startCol && n >= this.viewportCappedStartRow && t >= this.endCol && n <= this.viewportCappedEndRow : n > this.viewportStartRow && n < this.viewportEndRow || this.viewportStartRow === this.viewportEndRow && n === this.viewportStartRow && t >= this.startCol && t < this.endCol || this.viewportStartRow < this.viewportEndRow && n === this.viewportEndRow && t < this.endCol || this.viewportStartRow < this.viewportEndRow && n === this.viewportStartRow && t >= this.startCol) : !1;
  }
};
function Nn() {
  return new addon_webgl_ki();
}
var addon_webgl_Ce = 4,
  addon_webgl_ze = 1,
  addon_webgl_qe = 2,
  addon_webgl_Ct = 3,
  addon_webgl_Un = 2147483648,
  addon_webgl_Vt = class {
    constructor() {
      this.cells = new Uint32Array(0), this.lineLengths = new Uint32Array(0), this.selection = Nn();
    }
    resize(e, t) {
      let n = e * t * addon_webgl_Ce;
      n !== this.cells.length && (this.cells = new Uint32Array(n), this.lineLengths = new Uint32Array(t));
    }
    clear() {
      this.cells.fill(0, 0), this.lineLengths.fill(0, 0);
    }
  };
var addon_webgl_ss = `#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;
}`,
  addon_webgl_os = `#version 300 es
precision lowp float;

in vec4 v_color;

out vec4 outColor;

void main() {
  outColor = v_color;
}`,
  addon_webgl_Ee = 8,
  addon_webgl_Pi = addon_webgl_Ee * Float32Array.BYTES_PER_ELEMENT,
  addon_webgl_as = 20 * addon_webgl_Ee,
  addon_webgl_zt = class {
    constructor() {
      this.attributes = new Float32Array(addon_webgl_as), this.count = 0;
    }
  },
  addon_webgl_xe = 0,
  addon_webgl_Hn = 0,
  addon_webgl_Wn = 0,
  addon_webgl_Gn = 0,
  addon_webgl_$n = 0,
  addon_webgl_Kn = 0,
  addon_webgl_Vn = 0,
  addon_webgl_qt = class extends addon_webgl_B {
    constructor(t, n, s, o) {
      super();
      this._terminal = t;
      this._gl = n;
      this._dimensions = s;
      this._themeService = o;
      this._vertices = new addon_webgl_zt();
      this._verticesCursor = new addon_webgl_zt();
      let r = this._gl;
      this._program = addon_webgl_F(addon_webgl_$t(r, addon_webgl_ss, addon_webgl_os)), this._register(addon_webgl_O(() => r.deleteProgram(this._program))), this._projectionLocation = addon_webgl_F(r.getUniformLocation(this._program, "u_projection")), this._vertexArrayObject = r.createVertexArray(), r.bindVertexArray(this._vertexArrayObject);
      let a = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]),
        l = r.createBuffer();
      this._register(addon_webgl_O(() => r.deleteBuffer(l))), r.bindBuffer(r.ARRAY_BUFFER, l), r.bufferData(r.ARRAY_BUFFER, a, r.STATIC_DRAW), r.enableVertexAttribArray(3), r.vertexAttribPointer(3, 2, this._gl.FLOAT, !1, 0, 0);
      let u = new Uint8Array([0, 1, 2, 3]),
        c = r.createBuffer();
      this._register(addon_webgl_O(() => r.deleteBuffer(c))), r.bindBuffer(r.ELEMENT_ARRAY_BUFFER, c), r.bufferData(r.ELEMENT_ARRAY_BUFFER, u, r.STATIC_DRAW), this._attributesBuffer = addon_webgl_F(r.createBuffer()), this._register(addon_webgl_O(() => r.deleteBuffer(this._attributesBuffer))), r.bindBuffer(r.ARRAY_BUFFER, this._attributesBuffer), r.enableVertexAttribArray(0), r.vertexAttribPointer(0, 2, r.FLOAT, !1, addon_webgl_Pi, 0), r.vertexAttribDivisor(0, 1), r.enableVertexAttribArray(1), r.vertexAttribPointer(1, 2, r.FLOAT, !1, addon_webgl_Pi, 2 * Float32Array.BYTES_PER_ELEMENT), r.vertexAttribDivisor(1, 1), r.enableVertexAttribArray(2), r.vertexAttribPointer(2, 4, r.FLOAT, !1, addon_webgl_Pi, 4 * Float32Array.BYTES_PER_ELEMENT), r.vertexAttribDivisor(2, 1), this._updateCachedColors(o.colors), this._register(this._themeService.onChangeColors(d => {
        this._updateCachedColors(d), this._updateViewportRectangle();
      }));
    }
    renderBackgrounds() {
      this._renderVertices(this._vertices);
    }
    renderCursor() {
      this._renderVertices(this._verticesCursor);
    }
    _renderVertices(t) {
      let n = this._gl;
      n.useProgram(this._program), n.bindVertexArray(this._vertexArrayObject), n.uniformMatrix4fv(this._projectionLocation, !1, addon_webgl_Gt), n.bindBuffer(n.ARRAY_BUFFER, this._attributesBuffer), n.bufferData(n.ARRAY_BUFFER, t.attributes, n.DYNAMIC_DRAW), n.drawElementsInstanced(this._gl.TRIANGLE_STRIP, 4, n.UNSIGNED_BYTE, 0, t.count);
    }
    handleResize() {
      this._updateViewportRectangle();
    }
    setDimensions(t) {
      this._dimensions = t;
    }
    _updateCachedColors(t) {
      this._bgFloat = this._colorToFloat32Array(t.background), this._cursorFloat = this._colorToFloat32Array(t.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(t) {
      let n = this._terminal,
        s = this._vertices,
        o = 1,
        r,
        a,
        l,
        u,
        c,
        d,
        h,
        f,
        I,
        L,
        M;
      for (r = 0; r < n.rows; r++) {
        for (l = -1, u = 0, c = 0, d = !1, a = 0; a < n.cols; a++) h = (r * n.cols + a) * addon_webgl_Ce, f = t.cells[h + addon_webgl_ze], I = t.cells[h + addon_webgl_qe], L = !!(I & 67108864), (f !== u || I !== c && (d || L)) && ((u !== 0 || d && c !== 0) && (M = o++ * addon_webgl_Ee, this._updateRectangle(s, M, c, u, l, a, r)), l = a, u = f, c = I, d = L);
        (u !== 0 || d && c !== 0) && (M = o++ * addon_webgl_Ee, this._updateRectangle(s, M, c, u, l, n.cols, r));
      }
      s.count = o;
    }
    updateCursor(t) {
      let n = this._verticesCursor,
        s = t.cursor;
      if (!s || s.style === "block") {
        n.count = 0;
        return;
      }
      let o,
        r = 0;
      (s.style === "bar" || s.style === "outline") && (o = r++ * addon_webgl_Ee, this._addRectangleFloat(n.attributes, o, s.x * this._dimensions.device.cell.width, s.y * this._dimensions.device.cell.height, s.style === "bar" ? s.dpr * s.cursorWidth : s.dpr, this._dimensions.device.cell.height, this._cursorFloat)), (s.style === "underline" || s.style === "outline") && (o = r++ * addon_webgl_Ee, this._addRectangleFloat(n.attributes, o, s.x * this._dimensions.device.cell.width, (s.y + 1) * this._dimensions.device.cell.height - s.dpr, s.width * this._dimensions.device.cell.width, s.dpr, this._cursorFloat)), s.style === "outline" && (o = r++ * addon_webgl_Ee, this._addRectangleFloat(n.attributes, o, s.x * this._dimensions.device.cell.width, s.y * this._dimensions.device.cell.height, s.width * this._dimensions.device.cell.width, s.dpr, this._cursorFloat), o = r++ * addon_webgl_Ee, this._addRectangleFloat(n.attributes, o, (s.x + s.width) * this._dimensions.device.cell.width - s.dpr, s.y * this._dimensions.device.cell.height, s.dpr, this._dimensions.device.cell.height, this._cursorFloat)), n.count = r;
    }
    _updateRectangle(t, n, s, o, r, a, l) {
      if (s & 67108864) switch (s & 50331648) {
        case 16777216:
        case 33554432:
          addon_webgl_xe = this._themeService.colors.ansi[s & 255].rgba;
          break;
        case 50331648:
          addon_webgl_xe = (s & 16777215) << 8;
          break;
        case 0:
        default:
          addon_webgl_xe = this._themeService.colors.foreground.rgba;
      } else switch (o & 50331648) {
        case 16777216:
        case 33554432:
          addon_webgl_xe = this._themeService.colors.ansi[o & 255].rgba;
          break;
        case 50331648:
          addon_webgl_xe = (o & 16777215) << 8;
          break;
        case 0:
        default:
          addon_webgl_xe = this._themeService.colors.background.rgba;
      }
      t.attributes.length < n + 4 && (t.attributes = Bn(t.attributes, this._terminal.rows * this._terminal.cols * addon_webgl_Ee)), addon_webgl_Hn = r * this._dimensions.device.cell.width, addon_webgl_Wn = l * this._dimensions.device.cell.height, addon_webgl_Gn = (addon_webgl_xe >> 24 & 255) / 255, addon_webgl_$n = (addon_webgl_xe >> 16 & 255) / 255, addon_webgl_Kn = (addon_webgl_xe >> 8 & 255) / 255, addon_webgl_Vn = 1, this._addRectangle(t.attributes, n, addon_webgl_Hn, addon_webgl_Wn, (a - r) * this._dimensions.device.cell.width, this._dimensions.device.cell.height, addon_webgl_Gn, addon_webgl_$n, addon_webgl_Kn, addon_webgl_Vn);
    }
    _addRectangle(t, n, s, o, r, a, l, u, c, d) {
      t[n] = s / this._dimensions.device.canvas.width, t[n + 1] = o / this._dimensions.device.canvas.height, t[n + 2] = r / this._dimensions.device.canvas.width, t[n + 3] = a / this._dimensions.device.canvas.height, t[n + 4] = l, t[n + 5] = u, t[n + 6] = c, t[n + 7] = d;
    }
    _addRectangleFloat(t, n, s, o, r, a, l) {
      t[n] = s / this._dimensions.device.canvas.width, t[n + 1] = o / this._dimensions.device.canvas.height, t[n + 2] = r / this._dimensions.device.canvas.width, t[n + 3] = a / this._dimensions.device.canvas.height, t[n + 4] = l[0], t[n + 5] = l[1], t[n + 6] = l[2], t[n + 7] = l[3];
    }
    _colorToFloat32Array(t) {
      return new Float32Array([(t.rgba >> 24 & 255) / 255, (t.rgba >> 16 & 255) / 255, (t.rgba >> 8 & 255) / 255, (t.rgba & 255) / 255]);
    }
  };
var addon_webgl_jt = class extends addon_webgl_B {
  constructor(t, n, s, o, r, a, l, u) {
    super();
    this._container = n;
    this._alpha = r;
    this._coreBrowserService = a;
    this._optionsService = l;
    this._themeService = u;
    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-${s}-layer`), this._canvas.style.zIndex = o.toString(), this._initCanvas(), this._container.appendChild(this._canvas), this._register(this._themeService.onChangeColors(c => {
      this._refreshCharAtlas(t, c), this.reset(t);
    })), this._register(addon_webgl_O(() => {
      this._canvas.remove();
    }));
  }
  _initCanvas() {
    this._ctx = addon_webgl_F(this._canvas.getContext("2d", {
      alpha: this._alpha
    })), this._alpha || this._clearAll();
  }
  handleBlur(t) {}
  handleFocus(t) {}
  handleCursorMove(t) {}
  handleGridChanged(t, n, s) {}
  handleSelectionChanged(t, n, s, o = !1) {}
  _setTransparency(t, n) {
    if (n === this._alpha) return;
    let s = this._canvas;
    this._alpha = n, this._canvas = this._canvas.cloneNode(), this._initCanvas(), this._container.replaceChild(this._canvas, s), this._refreshCharAtlas(t, this._themeService.colors), this.handleGridChanged(t, 0, t.rows - 1);
  }
  _refreshCharAtlas(t, n) {
    this._deviceCharWidth <= 0 && this._deviceCharHeight <= 0 || (this._charAtlas = addon_webgl_Nt(t, this._optionsService.rawOptions, n, this._deviceCellWidth, this._deviceCellHeight, this._deviceCharWidth, this._deviceCharHeight, this._coreBrowserService.dpr, 2048), this._charAtlas.warmUp());
  }
  resize(t, n) {
    this._deviceCellWidth = n.device.cell.width, this._deviceCellHeight = n.device.cell.height, this._deviceCharWidth = n.device.char.width, this._deviceCharHeight = n.device.char.height, this._deviceCharLeft = n.device.char.left, this._deviceCharTop = n.device.char.top, this._canvas.width = n.device.canvas.width, this._canvas.height = n.device.canvas.height, this._canvas.style.width = `${n.css.canvas.width}px`, this._canvas.style.height = `${n.css.canvas.height}px`, this._alpha || this._clearAll(), this._refreshCharAtlas(t, this._themeService.colors);
  }
  _fillBottomLineAtCells(t, n, s = 1) {
    this._ctx.fillRect(t * this._deviceCellWidth, (n + 1) * this._deviceCellHeight - this._coreBrowserService.dpr - 1, s * 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(t, n, s, o) {
    this._alpha ? this._ctx.clearRect(t * this._deviceCellWidth, n * this._deviceCellHeight, s * this._deviceCellWidth, o * this._deviceCellHeight) : (this._ctx.fillStyle = this._themeService.colors.background.css, this._ctx.fillRect(t * this._deviceCellWidth, n * this._deviceCellHeight, s * this._deviceCellWidth, o * this._deviceCellHeight));
  }
  _fillCharTrueColor(t, n, s, o) {
    this._ctx.font = this._getFont(t, !1, !1), this._ctx.textBaseline = addon_webgl_St, this._clipCell(s, o, n.getWidth()), this._ctx.fillText(n.getChars(), s * this._deviceCellWidth + this._deviceCharLeft, o * this._deviceCellHeight + this._deviceCharTop + this._deviceCharHeight);
  }
  _clipCell(t, n, s) {
    this._ctx.beginPath(), this._ctx.rect(t * this._deviceCellWidth, n * this._deviceCellHeight, s * this._deviceCellWidth, this._deviceCellHeight), this._ctx.clip();
  }
  _getFont(t, n, s) {
    let o = n ? t.options.fontWeightBold : t.options.fontWeight;
    return `${s ? "italic" : ""} ${o} ${t.options.fontSize * this._coreBrowserService.dpr}px ${t.options.fontFamily}`;
  }
};
var addon_webgl_Xt = class extends addon_webgl_jt {
  constructor(e, t, n, s, o, r, a) {
    super(n, e, "link", t, !0, o, r, a), this._register(s.onShowLinkUnderline(l => this._handleShowLinkUnderline(l))), this._register(s.onHideLinkUnderline(l => this._handleHideLinkUnderline(l)));
  }
  resize(e, t) {
    super.resize(e, t), this._state = void 0;
  }
  reset(e) {
    this._clearCurrentLink();
  }
  _clearCurrentLink() {
    if (this._state) {
      this._clearCells(this._state.x1, this._state.y1, this._state.cols - this._state.x1, 1);
      let e = this._state.y2 - this._state.y1 - 1;
      e > 0 && this._clearCells(0, this._state.y1 + 1, this._state.cols, e), this._clearCells(0, this._state.y2, this._state.x2, 1), this._state = void 0;
    }
  }
  _handleShowLinkUnderline(e) {
    if (e.fg === 257 ? this._ctx.fillStyle = this._themeService.colors.background.css : e.fg !== void 0 && addon_webgl_Fn(e.fg) ? this._ctx.fillStyle = this._themeService.colors.ansi[e.fg].css : this._ctx.fillStyle = this._themeService.colors.foreground.css, e.y1 === e.y2) this._fillBottomLineAtCells(e.x1, e.y1, e.x2 - e.x1);else {
      this._fillBottomLineAtCells(e.x1, e.y1, e.cols - e.x1);
      for (let t = e.y1 + 1; t < e.y2; t++) this._fillBottomLineAtCells(0, t, e.cols);
      this._fillBottomLineAtCells(0, e.y2, e.x2);
    }
    this._state = e;
  }
  _handleHideLinkUnderline(e) {
    this._clearCurrentLink();
  }
};
var addon_webgl_te = typeof window == "object" ? window : globalThis;
var addon_webgl_Zt = class Zt {
  constructor() {
    this.mapWindowIdToZoomLevel = new Map();
    this._onDidChangeZoomLevel = new addon_webgl_D();
    this.onDidChangeZoomLevel = this._onDidChangeZoomLevel.event;
    this.mapWindowIdToZoomFactor = new Map();
    this._onDidChangeFullscreen = new addon_webgl_D();
    this.onDidChangeFullscreen = this._onDidChangeFullscreen.event;
    this.mapWindowIdToFullScreen = new Map();
  }
  getZoomLevel(e) {
    return this.mapWindowIdToZoomLevel.get(this.getWindowId(e)) ?? 0;
  }
  setZoomLevel(e, t) {
    if (this.getZoomLevel(t) === e) return;
    let n = this.getWindowId(t);
    this.mapWindowIdToZoomLevel.set(n, e), this._onDidChangeZoomLevel.fire(n);
  }
  getZoomFactor(e) {
    return this.mapWindowIdToZoomFactor.get(this.getWindowId(e)) ?? 1;
  }
  setZoomFactor(e, t) {
    this.mapWindowIdToZoomFactor.set(this.getWindowId(t), e);
  }
  setFullscreen(e, t) {
    if (this.isFullscreen(t) === e) return;
    let n = this.getWindowId(t);
    this.mapWindowIdToFullScreen.set(n, e), this._onDidChangeFullscreen.fire(n);
  }
  isFullscreen(e) {
    return !!this.mapWindowIdToFullScreen.get(this.getWindowId(e));
  }
  getWindowId(e) {
    return e.vscodeWindowId;
  }
};
addon_webgl_Zt.INSTANCE = new addon_webgl_Zt();
var addon_webgl_Qt = addon_webgl_Zt;
function addon_webgl_us(i, e, t) {
  typeof e == "string" && (e = i.matchMedia(e)), e.addEventListener("change", t);
}
var addon_webgl_Wa = addon_webgl_Qt.INSTANCE.onDidChangeZoomLevel;
var addon_webgl_Ga = addon_webgl_Qt.INSTANCE.onDidChangeFullscreen,
  addon_webgl_je = typeof navigator == "object" ? navigator.userAgent : "",
  addon_webgl_Cn = addon_webgl_je.indexOf("Firefox") >= 0,
  addon_webgl_ut = addon_webgl_je.indexOf("AppleWebKit") >= 0,
  addon_webgl_zn = addon_webgl_je.indexOf("Chrome") >= 0,
  addon_webgl_Bi = !addon_webgl_zn && addon_webgl_je.indexOf("Safari") >= 0;
var addon_webgl_$a = addon_webgl_je.indexOf("Electron/") >= 0,
  addon_webgl_Ka = addon_webgl_je.indexOf("Android") >= 0,
  addon_webgl_Yt = !1;
if (typeof addon_webgl_te.matchMedia == "function") {
  let i = addon_webgl_te.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),
    e = addon_webgl_te.matchMedia("(display-mode: fullscreen)");
  addon_webgl_Yt = i.matches, addon_webgl_us(addon_webgl_te, i, ({
    matches: t
  }) => {
    addon_webgl_Yt && e.matches || (addon_webgl_Yt = t);
  });
}
function addon_webgl_qn() {
  return addon_webgl_Yt;
}
var addon_webgl_Xe = "en",
  addon_webgl_Ui = !1,
  addon_webgl_ni = !1,
  addon_webgl_ti = !1,
  addon_webgl_cs = (/* unused pure expression or super */ null && (!1)),
  addon_webgl_Xn = !1,
  addon_webgl_Yn = !1,
  addon_webgl_ds = (/* unused pure expression or super */ null && (!1)),
  addon_webgl_hs = (/* unused pure expression or super */ null && (!1)),
  addon_webgl_ps = (/* unused pure expression or super */ null && (!1)),
  addon_webgl_fs = (/* unused pure expression or super */ null && (!1)),
  addon_webgl_ei,
  addon_webgl_ii = addon_webgl_Xe,
  addon_webgl_jn = (/* unused pure expression or super */ null && (addon_webgl_Xe)),
  addon_webgl_ms,
  addon_webgl_ye,
  addon_webgl_Ie = globalThis,
  addon_webgl_re;
typeof addon_webgl_Ie.vscode < "u" && typeof addon_webgl_Ie.vscode.process < "u" ? addon_webgl_re = addon_webgl_Ie.vscode.process : typeof process < "u" && typeof process?.versions?.node == "string" && (addon_webgl_re = process);
var addon_webgl_Qn = typeof addon_webgl_re?.versions?.electron == "string",
  addon_webgl_s = addon_webgl_Qn && addon_webgl_re?.type === "renderer";
if (typeof addon_webgl_re == "object") {
  addon_webgl_Ui = addon_webgl_re.platform === "win32", addon_webgl_ni = addon_webgl_re.platform === "darwin", addon_webgl_ti = addon_webgl_re.platform === "linux", addon_webgl_cs = addon_webgl_ti && !!addon_webgl_re.env.SNAP && !!addon_webgl_re.env.SNAP_REVISION, addon_webgl_ds = addon_webgl_Qn, addon_webgl_ps = !!addon_webgl_re.env.CI || !!addon_webgl_re.env.BUILD_ARTIFACTSTAGINGDIRECTORY, addon_webgl_ei = addon_webgl_Xe, addon_webgl_ii = addon_webgl_Xe;
  let i = addon_webgl_re.env.VSCODE_NLS_CONFIG;
  if (i) try {
    let e = JSON.parse(i);
    addon_webgl_ei = e.userLocale, addon_webgl_jn = e.osLocale, addon_webgl_ii = e.resolvedLanguage || addon_webgl_Xe, addon_webgl_ms = e.languagePack?.translationsConfigFile;
  } catch {}
  addon_webgl_Xn = !0;
} else typeof navigator == "object" && !addon_webgl_s ? (addon_webgl_ye = navigator.userAgent, addon_webgl_Ui = addon_webgl_ye.indexOf("Windows") >= 0, addon_webgl_ni = addon_webgl_ye.indexOf("Macintosh") >= 0, addon_webgl_hs = (addon_webgl_ye.indexOf("Macintosh") >= 0 || addon_webgl_ye.indexOf("iPad") >= 0 || addon_webgl_ye.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0, addon_webgl_ti = addon_webgl_ye.indexOf("Linux") >= 0, addon_webgl_fs = addon_webgl_ye?.indexOf("Mobi") >= 0, addon_webgl_Yn = !0, addon_webgl_ii = globalThis._VSCODE_NLS_LANGUAGE || addon_webgl_Xe, addon_webgl_ei = navigator.language.toLowerCase(), addon_webgl_jn = addon_webgl_ei) : console.error("Unable to resolve platform.");
var addon_webgl_Ni = 0;
addon_webgl_ni ? addon_webgl_Ni = 1 : addon_webgl_Ui ? addon_webgl_Ni = 3 : addon_webgl_ti && (addon_webgl_Ni = 2);
var addon_webgl_ct = (/* unused pure expression or super */ null && (addon_webgl_ni));
var addon_webgl_ri = addon_webgl_Xn;
var addon_webgl_bs = addon_webgl_Yn && typeof addon_webgl_Ie.importScripts == "function",
  addon_webgl_Va = addon_webgl_bs ? addon_webgl_Ie.origin : void 0;
var addon_webgl_e = addon_webgl_ye,
  addon_webgl_Me = addon_webgl_ii,
  addon_webgl_vs;
(n => {
  function i() {
    return addon_webgl_Me;
  }
  n.value = i;
  function e() {
    return addon_webgl_Me.length === 2 ? addon_webgl_Me === "en" : addon_webgl_Me.length >= 3 ? addon_webgl_Me[0] === "e" && addon_webgl_Me[1] === "n" && addon_webgl_Me[2] === "-" : !1;
  }
  n.isDefaultVariant = e;
  function t() {
    return addon_webgl_Me === "en";
  }
  n.isDefault = t;
})(addon_webgl_vs ||= {});
var addon_webgl_Ts = typeof addon_webgl_Ie.postMessage == "function" && !addon_webgl_Ie.importScripts,
  addon_webgl_Zn = (() => {
    if (addon_webgl_Ts) {
      let i = [];
      addon_webgl_Ie.addEventListener("message", t => {
        if (t.data && t.data.vscodeScheduleAsyncWork) for (let n = 0, s = i.length; n < s; n++) {
          let o = i[n];
          if (o.id === t.data.vscodeScheduleAsyncWork) {
            i.splice(n, 1), o.callback();
            return;
          }
        }
      });
      let e = 0;
      return t => {
        let n = ++e;
        i.push({
          id: n,
          callback: t
        }), addon_webgl_Ie.postMessage({
          vscodeScheduleAsyncWork: n
        }, "*");
      };
    }
    return i => setTimeout(i);
  })();
var addon_webgl_gs = !!(addon_webgl_e && addon_webgl_e.indexOf("Chrome") >= 0),
  addon_webgl_Ca = !!(addon_webgl_e && addon_webgl_e.indexOf("Firefox") >= 0),
  addon_webgl_za = !!(!addon_webgl_gs && addon_webgl_e && addon_webgl_e.indexOf("Safari") >= 0),
  addon_webgl_qa = !!(addon_webgl_e && addon_webgl_e.indexOf("Edg/") >= 0),
  addon_webgl_ja = !!(addon_webgl_e && addon_webgl_e.indexOf("Android") >= 0);
var addon_webgl_Ae = typeof navigator == "object" ? navigator : {},
  addon_webgl_xs = {
    clipboard: {
      writeText: addon_webgl_ri || document.queryCommandSupported && document.queryCommandSupported("copy") || !!(addon_webgl_Ae && addon_webgl_Ae.clipboard && addon_webgl_Ae.clipboard.writeText),
      readText: addon_webgl_ri || !!(addon_webgl_Ae && addon_webgl_Ae.clipboard && addon_webgl_Ae.clipboard.readText)
    },
    keyboard: addon_webgl_ri || addon_webgl_qn() ? 0 : addon_webgl_Ae.keyboard || addon_webgl_Bi ? 1 : 2,
    touch: "ontouchstart" in addon_webgl_te || addon_webgl_Ae.maxTouchPoints > 0,
    pointerEvents: addon_webgl_te.PointerEvent && ("ontouchstart" in addon_webgl_te || navigator.maxTouchPoints > 0)
  };
var addon_webgl_dt = class {
    constructor() {
      this._keyCodeToStr = [], this._strToKeyCode = Object.create(null);
    }
    define(e, t) {
      this._keyCodeToStr[e] = t, this._strToKeyCode[t.toLowerCase()] = e;
    }
    keyCodeToStr(e) {
      return this._keyCodeToStr[e];
    }
    strToKeyCode(e) {
      return this._strToKeyCode[e.toLowerCase()] || 0;
    }
  },
  addon_webgl_Hi = new addon_webgl_dt(),
  addon_webgl_Jn = new addon_webgl_dt(),
  addon_webgl_er = new addon_webgl_dt(),
  addon_webgl_Es = new Array(230);
var addon_webgl_tr;
(r => {
  function i(a) {
    return addon_webgl_Hi.keyCodeToStr(a);
  }
  r.toString = i;
  function e(a) {
    return addon_webgl_Hi.strToKeyCode(a);
  }
  r.fromString = e;
  function t(a) {
    return addon_webgl_Jn.keyCodeToStr(a);
  }
  r.toUserSettingsUS = t;
  function n(a) {
    return addon_webgl_er.keyCodeToStr(a);
  }
  r.toUserSettingsGeneral = n;
  function s(a) {
    return addon_webgl_Jn.strToKeyCode(a) || addon_webgl_er.strToKeyCode(a);
  }
  r.fromUserSettings = s;
  function o(a) {
    if (a >= 98 && a <= 113) return null;
    switch (a) {
      case 16:
        return "Up";
      case 18:
        return "Down";
      case 15:
        return "Left";
      case 17:
        return "Right";
    }
    return addon_webgl_Hi.keyCodeToStr(a);
  }
  r.toElectronAccelerator = o;
})(addon_webgl_tr ||= {});
var addon_webgl_ul = (/* unused pure expression or super */ null && (addon_webgl_ct ? 256 : 2048)),
  addon_webgl_cl = 512,
  addon_webgl_dl = 1024,
  addon_webgl_hl = (/* unused pure expression or super */ null && (addon_webgl_ct ? 2048 : 256));
var addon_webgl_nr = Object.freeze(function (i, e) {
    let t = setTimeout(i.bind(e), 0);
    return {
      dispose() {
        clearTimeout(t);
      }
    };
  }),
  addon_webgl_Is;
(n => {
  function i(s) {
    return s === n.None || s === n.Cancelled || s instanceof addon_webgl_Wi ? !0 : !s || typeof s != "object" ? !1 : typeof s.isCancellationRequested == "boolean" && typeof s.onCancellationRequested == "function";
  }
  n.isCancellationToken = i, n.None = Object.freeze({
    isCancellationRequested: !1,
    onCancellationRequested: addon_webgl_ee.None
  }), n.Cancelled = Object.freeze({
    isCancellationRequested: !0,
    onCancellationRequested: addon_webgl_nr
  });
})(addon_webgl_Is ||= {});
var addon_webgl_Wi = class {
  constructor() {
    this._isCancelled = !1;
    this._emitter = null;
  }
  cancel() {
    this._isCancelled || (this._isCancelled = !0, this._emitter && (this._emitter.fire(void 0), this.dispose()));
  }
  get isCancellationRequested() {
    return this._isCancelled;
  }
  get onCancellationRequested() {
    return this._isCancelled ? addon_webgl_nr : (this._emitter || (this._emitter = new addon_webgl_D()), this._emitter.event);
  }
  dispose() {
    this._emitter && (this._emitter.dispose(), this._emitter = null);
  }
};
var addon_webgl_Ls = Symbol("MicrotaskDelay");
var addon_webgl_ws, addon_webgl_oi;
(function () {
  typeof globalThis.requestIdleCallback != "function" || typeof globalThis.cancelIdleCallback != "function" ? addon_webgl_oi = (i, e) => {
    addon_webgl_Zn(() => {
      if (t) return;
      let n = Date.now() + 15;
      e(Object.freeze({
        didTimeout: !0,
        timeRemaining() {
          return Math.max(0, n - Date.now());
        }
      }));
    });
    let t = !1;
    return {
      dispose() {
        t || (t = !0);
      }
    };
  } : addon_webgl_oi = (i, e, t) => {
    let n = i.requestIdleCallback(e, typeof t == "number" ? {
        timeout: t
      } : void 0),
      s = !1;
    return {
      dispose() {
        s || (s = !0, i.cancelIdleCallback(n));
      }
    };
  }, addon_webgl_ws = i => addon_webgl_oi(globalThis, i);
})();
var addon_webgl_Rs;
(t => {
  async function i(n) {
    let s,
      o = await Promise.all(n.map(r => r.then(a => a, a => {
        s || (s = a);
      })));
    if (typeof s < "u") throw s;
    return o;
  }
  t.settled = i;
  function e(n) {
    return new Promise(async (s, o) => {
      try {
        await n(s, o);
      } catch (r) {
        o(r);
      }
    });
  }
  t.withAsyncBody = e;
})(addon_webgl_Rs ||= {});
var addon_webgl_Q = class Q {
  static fromArray(e) {
    return new Q(t => {
      t.emitMany(e);
    });
  }
  static fromPromise(e) {
    return new Q(async t => {
      t.emitMany(await e);
    });
  }
  static fromPromises(e) {
    return new Q(async t => {
      await Promise.all(e.map(async n => t.emitOne(await n)));
    });
  }
  static merge(e) {
    return new Q(async t => {
      await Promise.all(e.map(async n => {
        for await (let s of n) t.emitOne(s);
      }));
    });
  }
  constructor(e, t) {
    this._state = 0, this._results = [], this._error = null, this._onReturn = t, this._onStateChanged = new addon_webgl_D(), queueMicrotask(async () => {
      let n = {
        emitOne: s => this.emitOne(s),
        emitMany: s => this.emitMany(s),
        reject: s => this.reject(s)
      };
      try {
        await Promise.resolve(e(n)), this.resolve();
      } catch (s) {
        this.reject(s);
      } finally {
        n.emitOne = void 0, n.emitMany = void 0, n.reject = void 0;
      }
    });
  }
  [Symbol.asyncIterator]() {
    let e = 0;
    return {
      next: async () => {
        do {
          if (this._state === 2) throw this._error;
          if (e < this._results.length) return {
            done: !1,
            value: this._results[e++]
          };
          if (this._state === 1) return {
            done: !0,
            value: void 0
          };
          await addon_webgl_ee.toPromise(this._onStateChanged.event);
        } while (!0);
      },
      return: async () => (this._onReturn?.(), {
        done: !0,
        value: void 0
      })
    };
  }
  static map(e, t) {
    return new Q(async n => {
      for await (let s of e) n.emitOne(t(s));
    });
  }
  map(e) {
    return Q.map(this, e);
  }
  static filter(e, t) {
    return new Q(async n => {
      for await (let s of e) t(s) && n.emitOne(s);
    });
  }
  filter(e) {
    return Q.filter(this, e);
  }
  static coalesce(e) {
    return Q.filter(e, t => !!t);
  }
  coalesce() {
    return Q.coalesce(this);
  }
  static async toPromise(e) {
    let t = [];
    for await (let n of e) t.push(n);
    return t;
  }
  toPromise() {
    return Q.toPromise(this);
  }
  emitOne(e) {
    this._state === 0 && (this._results.push(e), this._onStateChanged.fire());
  }
  emitMany(e) {
    this._state === 0 && (this._results = this._results.concat(e), this._onStateChanged.fire());
  }
  resolve() {
    this._state === 0 && (this._state = 1, this._onStateChanged.fire());
  }
  reject(e) {
    this._state === 0 && (this._state = 2, this._error = e, this._onStateChanged.fire());
  }
};
addon_webgl_Q.EMPTY = addon_webgl_Q.fromArray([]);
var addon_webgl_rr = (/* unused pure expression or super */ null && (addon_webgl_Q));
function addon_webgl_sr(i) {
  return 55296 <= i && i <= 56319;
}
function Gi(i) {
  return 56320 <= i && i <= 57343;
}
function addon_webgl_or(i, e) {
  return (i - 55296 << 10) + (e - 56320) + 65536;
}
function addon_webgl_ur(i) {
  return addon_webgl_Ki(i, 0);
}
function addon_webgl_Ki(i, e) {
  switch (typeof i) {
    case "object":
      return i === null ? addon_webgl_Le(349, e) : Array.isArray(i) ? As(i, e) : addon_webgl_Ss(i, e);
    case "string":
      return addon_webgl_cr(i, e);
    case "boolean":
      return addon_webgl_Ms(i, e);
    case "number":
      return addon_webgl_Le(i, e);
    case "undefined":
      return addon_webgl_Le(937, e);
    default:
      return addon_webgl_Le(617, e);
  }
}
function addon_webgl_Le(i, e) {
  return (e << 5) - e + i | 0;
}
function addon_webgl_Ms(i, e) {
  return addon_webgl_Le(i ? 433 : 863, e);
}
function addon_webgl_cr(i, e) {
  e = addon_webgl_Le(149417, e);
  for (let t = 0, n = i.length; t < n; t++) e = addon_webgl_Le(i.charCodeAt(t), e);
  return e;
}
function As(i, e) {
  return e = addon_webgl_Le(104579, e), i.reduce((t, n) => addon_webgl_Ki(n, t), e);
}
function addon_webgl_Ss(i, e) {
  return e = addon_webgl_Le(181387, e), Object.keys(i).sort().reduce((t, n) => (t = addon_webgl_cr(n, t), addon_webgl_Ki(i[n], t)), e);
}
function addon_webgl_$i(i, e, t = 32) {
  let n = t - e,
    s = ~((1 << n) - 1);
  return (i << e | (s & i) >>> n) >>> 0;
}
function addon_webgl_ar(i, e = 0, t = i.byteLength, n = 0) {
  for (let s = 0; s < t; s++) i[e + s] = n;
}
function addon_webgl_Os(i, e, t = "0") {
  for (; i.length < e;) i = t + i;
  return i;
}
function ht(i, e = 32) {
  return i instanceof ArrayBuffer ? Array.from(new Uint8Array(i)).map(t => t.toString(16).padStart(2, "0")).join("") : addon_webgl_Os((i >>> 0).toString(16), e / 4);
}
var addon_webgl_ai = class ai {
  constructor() {
    this._h0 = 1732584193;
    this._h1 = 4023233417;
    this._h2 = 2562383102;
    this._h3 = 271733878;
    this._h4 = 3285377520;
    this._buff = new Uint8Array(67), this._buffDV = new DataView(this._buff.buffer), this._buffLen = 0, this._totalLen = 0, this._leftoverHighSurrogate = 0, this._finished = !1;
  }
  update(e) {
    let t = e.length;
    if (t === 0) return;
    let n = this._buff,
      s = this._buffLen,
      o = this._leftoverHighSurrogate,
      r,
      a;
    for (o !== 0 ? (r = o, a = -1, o = 0) : (r = e.charCodeAt(0), a = 0);;) {
      let l = r;
      if (addon_webgl_sr(r)) {
        if (a + 1 < t) {
          let u = e.charCodeAt(a + 1);
          Gi(u) ? (a++, l = addon_webgl_or(r, u)) : l = 65533;
        } else {
          o = r;
          break;
        }
      } else Gi(r) && (l = 65533);
      if (s = this._push(n, s, l), a++, a < t) r = e.charCodeAt(a);else break;
    }
    this._buffLen = s, this._leftoverHighSurrogate = o;
  }
  _push(e, t, n) {
    return n < 128 ? e[t++] = n : n < 2048 ? (e[t++] = 192 | (n & 1984) >>> 6, e[t++] = 128 | (n & 63) >>> 0) : n < 65536 ? (e[t++] = 224 | (n & 61440) >>> 12, e[t++] = 128 | (n & 4032) >>> 6, e[t++] = 128 | (n & 63) >>> 0) : (e[t++] = 240 | (n & 1835008) >>> 18, e[t++] = 128 | (n & 258048) >>> 12, e[t++] = 128 | (n & 4032) >>> 6, e[t++] = 128 | (n & 63) >>> 0), t >= 64 && (this._step(), t -= 64, this._totalLen += 64, e[0] = e[64], e[1] = e[65], e[2] = e[66]), t;
  }
  digest() {
    return this._finished || (this._finished = !0, this._leftoverHighSurrogate && (this._leftoverHighSurrogate = 0, this._buffLen = this._push(this._buff, this._buffLen, 65533)), this._totalLen += this._buffLen, this._wrapUp()), ht(this._h0) + ht(this._h1) + ht(this._h2) + ht(this._h3) + ht(this._h4);
  }
  _wrapUp() {
    this._buff[this._buffLen++] = 128, addon_webgl_ar(this._buff, this._buffLen), this._buffLen > 56 && (this._step(), addon_webgl_ar(this._buff));
    let e = 8 * this._totalLen;
    this._buffDV.setUint32(56, Math.floor(e / 4294967296), !1), this._buffDV.setUint32(60, e % 4294967296, !1), this._step();
  }
  _step() {
    let e = ai._bigBlock32,
      t = this._buffDV;
    for (let d = 0; d < 64; d += 4) e.setUint32(d, t.getUint32(d, !1), !1);
    for (let d = 64; d < 320; d += 4) e.setUint32(d, addon_webgl_$i(e.getUint32(d - 12, !1) ^ e.getUint32(d - 32, !1) ^ e.getUint32(d - 56, !1) ^ e.getUint32(d - 64, !1), 1), !1);
    let n = this._h0,
      s = this._h1,
      o = this._h2,
      r = this._h3,
      a = this._h4,
      l,
      u,
      c;
    for (let d = 0; d < 80; d++) d < 20 ? (l = s & o | ~s & r, u = 1518500249) : d < 40 ? (l = s ^ o ^ r, u = 1859775393) : d < 60 ? (l = s & o | s & r | o & r, u = 2400959708) : (l = s ^ o ^ r, u = 3395469782), c = addon_webgl_$i(n, 5) + l + a + u + e.getUint32(d * 4, !1) & 4294967295, a = r, r = o, o = addon_webgl_$i(s, 30), s = n, n = c;
    this._h0 = this._h0 + n & 4294967295, this._h1 = this._h1 + s & 4294967295, this._h2 = this._h2 + o & 4294967295, this._h3 = this._h3 + r & 4294967295, this._h4 = this._h4 + a & 4294967295;
  }
};
addon_webgl_ai._bigBlock32 = new DataView(new ArrayBuffer(320));
var addon_webgl_lr = (/* unused pure expression or super */ null && (addon_webgl_ai));
var {
  registerWindow: fu,
  getWindow: addon_webgl_Fs,
  getDocument: mu,
  getWindows: _u,
  getWindowsCount: bu,
  getWindowId: addon_webgl_dr,
  getWindowById: vu,
  hasWindow: addon_webgl_Tu,
  onDidRegisterWindow: gu,
  onWillUnregisterWindow: addon_webgl_xu,
  onDidUnregisterWindow: addon_webgl_Eu
} = function () {
  let i = new Map();
  addon_webgl_te;
  let e = {
    window: addon_webgl_te,
    disposables: new addon_webgl_fe()
  };
  i.set(addon_webgl_te.vscodeWindowId, e);
  let t = new addon_webgl_D(),
    n = new addon_webgl_D(),
    s = new addon_webgl_D();
  function o(r, a) {
    return (typeof r == "number" ? i.get(r) : void 0) ?? (a ? e : void 0);
  }
  return {
    onDidRegisterWindow: t.event,
    onWillUnregisterWindow: s.event,
    onDidUnregisterWindow: n.event,
    registerWindow(r) {
      if (i.has(r.vscodeWindowId)) return addon_webgl_B.None;
      let a = new addon_webgl_fe(),
        l = {
          window: r,
          disposables: a.add(new addon_webgl_fe())
        };
      return i.set(r.vscodeWindowId, l), a.add(addon_webgl_O(() => {
        i.delete(r.vscodeWindowId), n.fire(r);
      })), a.add(addon_webgl_li(r, addon_webgl_Ps.BEFORE_UNLOAD, () => {
        s.fire(r);
      })), t.fire(l), a;
    },
    getWindows() {
      return i.values();
    },
    getWindowsCount() {
      return i.size;
    },
    getWindowId(r) {
      return r.vscodeWindowId;
    },
    hasWindow(r) {
      return i.has(r);
    },
    getWindowById: o,
    getWindow(r) {
      let a = r;
      if (a?.ownerDocument?.defaultView) return a.ownerDocument.defaultView.window;
      let l = r;
      return l?.view ? l.view.window : addon_webgl_te;
    },
    getDocument(r) {
      return addon_webgl_Fs(r).document;
    }
  };
}();
var addon_webgl_Vi = class {
  constructor(e, t, n, s) {
    this._node = e, this._type = t, this._handler = n, this._options = s || !1, this._node.addEventListener(this._type, this._handler, this._options);
  }
  dispose() {
    this._handler && (this._node.removeEventListener(this._type, this._handler, this._options), this._node = null, this._handler = null);
  }
};
function addon_webgl_li(i, e, t, n) {
  return new addon_webgl_Vi(i, e, t, n);
}
var addon_webgl_ks, addon_webgl_hr;
var addon_webgl_pt = class {
  constructor(e, t = 0) {
    this._runner = e, this.priority = t, this._canceled = !1;
  }
  dispose() {
    this._canceled = !0;
  }
  execute() {
    if (!this._canceled) try {
      this._runner();
    } catch (e) {
      addon_webgl_Pe(e);
    }
  }
  static sort(e, t) {
    return t.priority - e.priority;
  }
};
(function () {
  let i = new Map(),
    e = new Map(),
    t = new Map(),
    n = new Map(),
    s = o => {
      t.set(o, !1);
      let r = i.get(o) ?? [];
      for (e.set(o, r), i.set(o, []), n.set(o, !0); r.length > 0;) r.sort(addon_webgl_pt.sort), r.shift().execute();
      n.set(o, !1);
    };
  addon_webgl_hr = (o, r, a = 0) => {
    let l = addon_webgl_dr(o),
      u = new addon_webgl_pt(r, a),
      c = i.get(l);
    return c || (c = [], i.set(l, c)), c.push(u), t.get(l) || (t.set(l, !0), o.requestAnimationFrame(() => s(l))), u;
  }, addon_webgl_ks = (o, r, a) => {
    let l = addon_webgl_dr(o);
    if (n.get(l)) {
      let u = new addon_webgl_pt(r, a),
        c = e.get(l);
      return c || (c = [], e.set(l, c)), c.push(u), u;
    } else return addon_webgl_hr(o, r, a);
  };
})();
var addon_webgl_ke = class ke {
  constructor(e, t) {
    this.width = e;
    this.height = t;
  }
  with(e = this.width, t = this.height) {
    return e !== this.width || t !== this.height ? new ke(e, t) : this;
  }
  static is(e) {
    return typeof e == "object" && typeof e.height == "number" && typeof e.width == "number";
  }
  static lift(e) {
    return e instanceof ke ? e : new ke(e.width, e.height);
  }
  static equals(e, t) {
    return e === t ? !0 : !e || !t ? !1 : e.width === t.width && e.height === t.height;
  }
};
addon_webgl_ke.None = new addon_webgl_ke(0, 0);
var addon_webgl_pr = (/* unused pure expression or super */ null && (addon_webgl_ke));
var addon_webgl_yu = new class {
  constructor() {
    this.mutationObservers = new Map();
  }
  observe(i, e, t) {
    let n = this.mutationObservers.get(i);
    n || (n = new Map(), this.mutationObservers.set(i, n));
    let s = addon_webgl_ur(t),
      o = n.get(s);
    if (o) o.users += 1;else {
      let r = new addon_webgl_D(),
        a = new MutationObserver(u => r.fire(u));
      a.observe(i, t);
      let l = o = {
        users: 1,
        observer: a,
        onDidMutate: r.event
      };
      e.add(addon_webgl_O(() => {
        l.users -= 1, l.users === 0 && (r.dispose(), a.disconnect(), n?.delete(s), n?.size === 0 && this.mutationObservers.delete(i));
      })), n.set(s, o);
    }
    return o.onDidMutate;
  }
}();
var addon_webgl_Ps = {
  CLICK: "click",
  AUXCLICK: "auxclick",
  DBLCLICK: "dblclick",
  MOUSE_UP: "mouseup",
  MOUSE_DOWN: "mousedown",
  MOUSE_OVER: "mouseover",
  MOUSE_MOVE: "mousemove",
  MOUSE_OUT: "mouseout",
  MOUSE_ENTER: "mouseenter",
  MOUSE_LEAVE: "mouseleave",
  MOUSE_WHEEL: "wheel",
  POINTER_UP: "pointerup",
  POINTER_DOWN: "pointerdown",
  POINTER_MOVE: "pointermove",
  POINTER_LEAVE: "pointerleave",
  CONTEXT_MENU: "contextmenu",
  WHEEL: "wheel",
  KEY_DOWN: "keydown",
  KEY_PRESS: "keypress",
  KEY_UP: "keyup",
  LOAD: "load",
  BEFORE_UNLOAD: "beforeunload",
  UNLOAD: "unload",
  PAGE_SHOW: "pageshow",
  PAGE_HIDE: "pagehide",
  PASTE: "paste",
  ABORT: "abort",
  ERROR: "error",
  RESIZE: "resize",
  SCROLL: "scroll",
  FULLSCREEN_CHANGE: "fullscreenchange",
  WK_FULLSCREEN_CHANGE: "webkitfullscreenchange",
  SELECT: "select",
  CHANGE: "change",
  SUBMIT: "submit",
  RESET: "reset",
  FOCUS: "focus",
  FOCUS_IN: "focusin",
  FOCUS_OUT: "focusout",
  BLUR: "blur",
  INPUT: "input",
  STORAGE: "storage",
  DRAG_START: "dragstart",
  DRAG: "drag",
  DRAG_ENTER: "dragenter",
  DRAG_LEAVE: "dragleave",
  DRAG_OVER: "dragover",
  DROP: "drop",
  DRAG_END: "dragend",
  ANIMATION_START: addon_webgl_ut ? "webkitAnimationStart" : "animationstart",
  ANIMATION_END: addon_webgl_ut ? "webkitAnimationEnd" : "animationend",
  ANIMATION_ITERATION: addon_webgl_ut ? "webkitAnimationIteration" : "animationiteration"
};
var addon_webgl_Bs = /([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;
function addon_webgl_fr(i, e, t, ...n) {
  let s = addon_webgl_Bs.exec(e);
  if (!s) throw new Error("Bad use of emmet");
  let o = s[1] || "div",
    r;
  return i !== "http://www.w3.org/1999/xhtml" ? r = document.createElementNS(i, o) : r = document.createElement(o), s[3] && (r.id = s[3]), s[4] && (r.className = s[4].replace(/\./g, " ").trim()), t && Object.entries(t).forEach(([a, l]) => {
    typeof l > "u" || (/^on\w+$/.test(a) ? r[a] = l : a === "selected" ? l && r.setAttribute(a, "true") : r.setAttribute(a, l));
  }), r.append(...n), r;
}
function Ns(i, e, ...t) {
  return addon_webgl_fr("http://www.w3.org/1999/xhtml", i, e, ...t);
}
Ns.SVG = function (i, e, ...t) {
  return addon_webgl_fr("http://www.w3.org/2000/svg", i, e, ...t);
};
var addon_webgl_ui = class extends addon_webgl_B {
    constructor(t, n, s, o, r, a, l, u, c) {
      super();
      this._terminal = t;
      this._characterJoinerService = n;
      this._charSizeService = s;
      this._coreBrowserService = o;
      this._coreService = r;
      this._decorationService = a;
      this._optionsService = l;
      this._themeService = u;
      this._cursorBlinkStateManager = new addon_webgl_be();
      this._charAtlasDisposable = this._register(new addon_webgl_be());
      this._observerDisposable = this._register(new addon_webgl_be());
      this._model = new addon_webgl_Vt();
      this._workCell = new addon_webgl_at();
      this._workCell2 = new addon_webgl_at();
      this._rectangleRenderer = this._register(new addon_webgl_be());
      this._glyphRenderer = this._register(new addon_webgl_be());
      this._onChangeTextureAtlas = this._register(new addon_webgl_D());
      this.onChangeTextureAtlas = this._onChangeTextureAtlas.event;
      this._onAddTextureAtlasCanvas = this._register(new addon_webgl_D());
      this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event;
      this._onRemoveTextureAtlasCanvas = this._register(new addon_webgl_D());
      this.onRemoveTextureAtlasCanvas = this._onRemoveTextureAtlasCanvas.event;
      this._onRequestRedraw = this._register(new addon_webgl_D());
      this.onRequestRedraw = this._onRequestRedraw.event;
      this._onContextLoss = this._register(new addon_webgl_D());
      this.onContextLoss = this._onContextLoss.event;
      this._canvas = this._coreBrowserService.mainDocument.createElement("canvas");
      let d = {
        antialias: !1,
        depth: !1,
        preserveDrawingBuffer: c
      };
      if (this._gl = this._canvas.getContext("webgl2", d), !this._gl) throw new Error("WebGL2 not supported " + this._gl);
      this._register(this._themeService.onChangeColors(() => this._handleColorChange())), this._cellColorResolver = new addon_webgl_At(this._terminal, this._optionsService, this._model.selection, this._decorationService, this._coreBrowserService, this._themeService), this._core = this._terminal._core, this._renderLayers = [new addon_webgl_Xt(this._core.screenElement, 2, this._terminal, this._core.linkifier, this._coreBrowserService, l, this._themeService)], this.dimensions = addon_webgl_n(), this._devicePixelRatio = this._coreBrowserService.dpr, this._updateDimensions(), this._updateCursorBlink(), this._register(l.onOptionChange(() => this._handleOptionsChanged())), this._deviceMaxTextureSize = this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE), this._register(addon_webgl_li(this._canvas, "webglcontextlost", h => {
        console.log("webglcontextlost event received"), h.preventDefault(), this._contextRestorationTimeout = setTimeout(() => {
          this._contextRestorationTimeout = void 0, console.warn("webgl context not restored; firing onContextLoss"), this._onContextLoss.fire(h);
        }, 3e3);
      })), this._register(addon_webgl_li(this._canvas, "webglcontextrestored", h => {
        console.warn("webglcontextrestored event received"), clearTimeout(this._contextRestorationTimeout), this._contextRestorationTimeout = void 0, addon_webgl_Ai(this._terminal), this._initializeWebGLState(), this._requestRedrawViewport();
      })), this._observerDisposable.value = addon_webgl_Si(this._canvas, this._coreBrowserService.window, (h, f) => this._setCanvasDevicePixelDimensions(h, f)), this._register(this._coreBrowserService.onWindowChange(h => {
        this._observerDisposable.value = addon_webgl_Si(this._canvas, h, (f, I) => this._setCanvasDevicePixelDimensions(f, I));
      })), this._core.screenElement.appendChild(this._canvas), [this._rectangleRenderer.value, this._glyphRenderer.value] = this._initializeWebGLState(), this._isAttached = this._core.screenElement.isConnected, this._register(addon_webgl_O(() => {
        for (let h of this._renderLayers) h.dispose();
        this._canvas.parentElement?.removeChild(this._canvas), addon_webgl_Ai(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(t, n) {
      this._updateDimensions(), this._model.resize(this._terminal.cols, this._terminal.rows);
      for (let s of this._renderLayers) s.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 t of this._renderLayers) t.handleBlur(this._terminal);
      this._cursorBlinkStateManager.value?.pause(), this._requestRedrawViewport();
    }
    handleFocus() {
      for (let t of this._renderLayers) t.handleFocus(this._terminal);
      this._cursorBlinkStateManager.value?.resume(), this._requestRedrawViewport();
    }
    handleSelectionChanged(t, n, s) {
      for (let o of this._renderLayers) o.handleSelectionChanged(this._terminal, t, n, s);
      this._model.selection.update(this._core, t, n, s), this._requestRedrawViewport();
    }
    handleCursorMove() {
      for (let t of this._renderLayers) t.handleCursorMove(this._terminal);
      this._cursorBlinkStateManager.value?.restartBlinkAnimation();
    }
    _handleOptionsChanged() {
      this._updateDimensions(), this._refreshCharAtlas(), this._updateCursorBlink();
    }
    _initializeWebGLState() {
      return this._rectangleRenderer.value = new addon_webgl_qt(this._terminal, this._gl, this.dimensions, this._themeService), this._glyphRenderer.value = new addon_webgl_Kt(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) {
        this._isAttached = !1;
        return;
      }
      let t = addon_webgl_Nt(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._deviceMaxTextureSize);
      this._charAtlas !== t && (this._onChangeTextureAtlas.fire(t.pages[0].canvas), this._charAtlasDisposable.value = addon_webgl_It(addon_webgl_ee.forward(t.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas), addon_webgl_ee.forward(t.onRemoveTextureAtlasCanvas, this._onRemoveTextureAtlasCanvas))), this._charAtlas = t, this._charAtlas.warmUp(), this._glyphRenderer.value?.setAtlas(this._charAtlas);
    }
    _clearModel(t) {
      this._model.clear(), t && this._glyphRenderer.value?.clear();
    }
    clearTextureAtlas() {
      this._charAtlas?.clearTexture(), this._clearModel(!0), this._requestRedrawViewport();
    }
    clear() {
      this._clearModel(!0);
      for (let t of this._renderLayers) t.reset(this._terminal);
      this._cursorBlinkStateManager.value?.restartBlinkAnimation(), this._updateCursorBlink();
    }
    renderRows(t, n) {
      if (!this._isAttached) if (this._core.screenElement?.isConnected && this._charSizeService.width && this._charSizeService.height) this._updateDimensions(), this._refreshCharAtlas(), this._isAttached = !0;else return;
      for (let s of this._renderLayers) s.handleGridChanged(this._terminal, t, n);
      !this._glyphRenderer.value || !this._rectangleRenderer.value || (this._glyphRenderer.value.beginFrame() ? (this._clearModel(!0), this._updateModel(0, this._terminal.rows - 1)) : this._updateModel(t, n), this._rectangleRenderer.value.renderBackgrounds(), this._glyphRenderer.value.render(this._model), (!this._cursorBlinkStateManager.value || this._cursorBlinkStateManager.value.isCursorVisible) && this._rectangleRenderer.value.renderCursor());
    }
    _updateCursorBlink() {
      this._coreService.decPrivateModes.cursorBlink ?? this._terminal.options.cursorBlink ? this._cursorBlinkStateManager.value = new Ht(() => {
        this._requestRedrawCursor();
      }, this._coreBrowserService) : this._cursorBlinkStateManager.clear(), this._requestRedrawCursor();
    }
    _updateModel(t, n) {
      let s = this._core,
        o = this._workCell,
        r,
        a,
        l,
        u,
        c,
        d,
        h = 0,
        f = !0,
        I,
        L,
        M,
        q,
        S,
        W,
        E,
        y,
        w;
      t = addon_webgl_mr(t, s.rows - 1, 0), n = addon_webgl_mr(n, s.rows - 1, 0);
      let G = this._coreService.decPrivateModes.cursorStyle ?? s.options.cursorStyle ?? "block",
        ue = this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY,
        Se = ue - s.buffer.ydisp,
        ce = Math.min(this._terminal.buffer.active.cursorX, s.cols - 1),
        we = -1,
        A = this._coreService.isCursorInitialized && !this._coreService.isCursorHidden && (!this._cursorBlinkStateManager.value || this._cursorBlinkStateManager.value.isCursorVisible);
      this._model.cursor = void 0;
      let se = !1;
      for (a = t; a <= n; a++) for (l = a + s.buffer.ydisp, u = s.buffer.lines.get(l), this._model.lineLengths[a] = 0, M = ue === l, h = 0, c = this._characterJoinerService.getJoinedCharacters(l), y = 0; y < s.cols; y++) {
        if (r = this._cellColorResolver.result.bg, u.loadCell(y, o), y === 0 && (r = this._cellColorResolver.result.bg), d = !1, f = y >= h, I = y, c.length > 0 && y === c[0][0] && f) {
          L = c.shift();
          let v = this._model.selection.isCellSelected(this._terminal, L[0], l);
          for (E = L[0] + 1; E < L[1]; E++) f &&= v === this._model.selection.isCellSelected(this._terminal, E, l);
          f &&= !M || ce < L[0] || ce >= L[1], f ? (d = !0, o = new addon_webgl_Ci(o, u.translateToString(!0, L[0], L[1]), L[1] - L[0]), I = L[1] - 1) : h = L[1];
        }
        if (q = o.getChars(), S = o.getCode(), E = (a * s.cols + y) * addon_webgl_Ce, this._cellColorResolver.resolve(o, y, l, this.dimensions.device.cell.width), A && l === ue && (y === ce && (this._model.cursor = {
          x: ce,
          y: Se,
          width: o.getWidth(),
          style: this._coreBrowserService.isFocused ? G : s.options.cursorInactiveStyle,
          cursorWidth: s.options.cursorWidth,
          dpr: this._devicePixelRatio
        }, we = ce + o.getWidth() - 1), y >= ce && y <= we && (this._coreBrowserService.isFocused && G === "block" || this._coreBrowserService.isFocused === !1 && s.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)), S !== 0 && (this._model.lineLengths[a] = y + 1), !(this._model.cells[E] === S && this._model.cells[E + addon_webgl_ze] === this._cellColorResolver.result.bg && this._model.cells[E + addon_webgl_qe] === this._cellColorResolver.result.fg && this._model.cells[E + addon_webgl_Ct] === this._cellColorResolver.result.ext) && (se = !0, q.length > 1 && (S |= addon_webgl_Un), this._model.cells[E] = S, this._model.cells[E + addon_webgl_ze] = this._cellColorResolver.result.bg, this._model.cells[E + addon_webgl_qe] = this._cellColorResolver.result.fg, this._model.cells[E + addon_webgl_Ct] = this._cellColorResolver.result.ext, W = o.getWidth(), this._glyphRenderer.value.updateCell(y, a, S, this._cellColorResolver.result.bg, this._cellColorResolver.result.fg, this._cellColorResolver.result.ext, q, W, r), d)) {
          for (o = this._workCell, y++; y <= I; y++) w = (a * s.cols + y) * addon_webgl_Ce, this._glyphRenderer.value.updateCell(y, a, 0, 0, 0, 0, addon_webgl_pn, 0, 0), this._model.cells[w] = 0, this._model.cells[w + addon_webgl_ze] = this._cellColorResolver.result.bg, this._model.cells[w + addon_webgl_qe] = this._cellColorResolver.result.fg, this._model.cells[w + addon_webgl_Ct] = this._cellColorResolver.result.ext;
          y--;
        }
      }
      se && 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(t, n) {
      this._canvas.width === t && this._canvas.height === n || (this._canvas.width = t, this._canvas.height = n, this._requestRedrawViewport());
    }
    _requestRedrawViewport() {
      this._onRequestRedraw.fire({
        start: 0,
        end: this._terminal.rows - 1
      });
    }
    _requestRedrawCursor() {
      let t = this._terminal.buffer.active.cursorY;
      this._onRequestRedraw.fire({
        start: t,
        end: t
      });
    }
  },
  addon_webgl_Ci = class extends addon_webgl_he {
    constructor(t, n, s) {
      super();
      this.content = 0;
      this.combinedData = "";
      this.fg = t.fg, this.bg = t.bg, this.combinedData = n, this._width = s;
    }
    isCombined() {
      return 2097152;
    }
    getWidth() {
      return this._width;
    }
    getChars() {
      return this.combinedData;
    }
    getCode() {
      return 2097151;
    }
    setFromCharData(t) {
      throw new Error("not implemented");
    }
    getAsCharData() {
      return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
    }
  };
function addon_webgl_mr(i, e, t = 0) {
  return Math.max(Math.min(i, e), t);
}
var addon_webgl_r = "di$target",
  addon_webgl_br = "di$dependencies",
  addon_webgl_zi = new Map();
function addon_webgl_pe(i) {
  if (addon_webgl_zi.has(i)) return addon_webgl_zi.get(i);
  let e = function (t, n, s) {
    if (arguments.length !== 3) throw new Error("@IServiceName-decorator can only be used to decorate a parameter");
    addon_webgl_Us(e, t, s);
  };
  return e._id = i, addon_webgl_zi.set(i, e), e;
}
function addon_webgl_Us(i, e, t) {
  e[addon_webgl_r] === e ? e[addon_webgl_br].push({
    id: i,
    index: t
  }) : (e[addon_webgl_br] = [{
    id: i,
    index: t
  }], e[addon_webgl_r] = e);
}
var Vu = addon_webgl_pe("BufferService"),
  Cu = addon_webgl_pe("CoreMouseService"),
  zu = addon_webgl_pe("CoreService"),
  qu = addon_webgl_pe("CharsetService"),
  ju = addon_webgl_pe("InstantiationService");
var Xu = addon_webgl_pe("LogService"),
  addon_webgl_vr = addon_webgl_pe("OptionsService"),
  Yu = addon_webgl_pe("OscLinkService"),
  Qu = addon_webgl_pe("UnicodeService"),
  Zu = addon_webgl_pe("DecorationService");
var addon_webgl_Hs = {
    trace: 0,
    debug: 1,
    info: 2,
    warn: 3,
    error: 4,
    off: 5
  },
  addon_webgl_Ws = "xterm.js: ",
  addon_webgl_ci = class extends addon_webgl_B {
    constructor(t) {
      super();
      this._optionsService = t;
      this._logLevel = 5;
      this._updateLogLevel(), this._register(this._optionsService.onSpecificOptionChange("logLevel", () => this._updateLogLevel())), addon_webgl_Tr = this;
    }
    get logLevel() {
      return this._logLevel;
    }
    _updateLogLevel() {
      this._logLevel = addon_webgl_Hs[this._optionsService.rawOptions.logLevel];
    }
    _evalLazyOptionalParams(t) {
      for (let n = 0; n < t.length; n++) typeof t[n] == "function" && (t[n] = t[n]());
    }
    _log(t, n, s) {
      this._evalLazyOptionalParams(s), t.call(console, (this._optionsService.options.logger ? "" : addon_webgl_Ws) + n, ...s);
    }
    trace(t, ...n) {
      this._logLevel <= 0 && this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger) ?? console.log, t, n);
    }
    debug(t, ...n) {
      this._logLevel <= 1 && this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger) ?? console.log, t, n);
    }
    info(t, ...n) {
      this._logLevel <= 2 && this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger) ?? console.info, t, n);
    }
    warn(t, ...n) {
      this._logLevel <= 3 && this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger) ?? console.warn, t, n);
    }
    error(t, ...n) {
      this._logLevel <= 4 && this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger) ?? console.error, t, n);
    }
  };
addon_webgl_ci = addon_webgl_Yi([Qi(0, addon_webgl_vr)], addon_webgl_ci);
var addon_webgl_Tr;
function addon_webgl_gr(i) {
  addon_webgl_Tr = i;
}
var addon_webgl_xr = class extends addon_webgl_B {
  constructor(t) {
    if (addon_webgl_vi && addon_webgl_hn() < 16) {
      let n = {
        antialias: !1,
        depth: !1,
        preserveDrawingBuffer: !0
      };
      if (!document.createElement("canvas").getContext("webgl2", n)) throw new Error("Webgl2 is only supported on Safari 16 and above");
    }
    super();
    this._preserveDrawingBuffer = t;
    this._onChangeTextureAtlas = this._register(new addon_webgl_D());
    this.onChangeTextureAtlas = this._onChangeTextureAtlas.event;
    this._onAddTextureAtlasCanvas = this._register(new addon_webgl_D());
    this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event;
    this._onRemoveTextureAtlasCanvas = this._register(new addon_webgl_D());
    this.onRemoveTextureAtlasCanvas = this._onRemoveTextureAtlasCanvas.event;
    this._onContextLoss = this._register(new addon_webgl_D());
    this.onContextLoss = this._onContextLoss.event;
  }
  activate(t) {
    let n = t._core;
    if (!t.element) {
      this._register(n.onWillOpen(() => this.activate(t)));
      return;
    }
    this._terminal = t;
    let s = n.coreService,
      o = n.optionsService,
      r = n,
      a = r._renderService,
      l = r._characterJoinerService,
      u = r._charSizeService,
      c = r._coreBrowserService,
      d = r._decorationService,
      h = r._logService,
      f = r._themeService;
    addon_webgl_gr(h), this._renderer = this._register(new addon_webgl_ui(t, l, u, c, s, d, o, f, this._preserveDrawingBuffer)), this._register(addon_webgl_ee.forward(this._renderer.onContextLoss, this._onContextLoss)), this._register(addon_webgl_ee.forward(this._renderer.onChangeTextureAtlas, this._onChangeTextureAtlas)), this._register(addon_webgl_ee.forward(this._renderer.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas)), this._register(addon_webgl_ee.forward(this._renderer.onRemoveTextureAtlasCanvas, this._onRemoveTextureAtlasCanvas)), a.setRenderer(this._renderer), this._register(addon_webgl_O(() => {
      if (this._terminal._core._store._isDisposed) return;
      let I = this._terminal._core._renderService;
      I.setRenderer(this._terminal._core._createRenderer()), I.handleResize(t.cols, t.rows);
    }));
  }
  get textureAtlas() {
    return this._renderer?.textureAtlas;
  }
  clearTextureAtlas() {
    this._renderer?.clearTextureAtlas();
  }
};

;// ./node_modules/@xterm/addon-unicode11/lib/addon-unicode11.mjs
/**
 * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
 * @license MIT
 *
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * @license MIT
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
var addon_unicode11_ue = [[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]],
  addon_unicode11_qe = [[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]],
  addon_unicode11_A;
function addon_unicode11_He(r, e) {
  let t = 0,
    n = e.length - 1,
    o;
  if (r < e[0][0] || r > e[n][1]) return !1;
  for (; n >= t;) if (o = t + n >> 1, r > e[o][1]) t = o + 1;else if (r < e[o][0]) n = o - 1;else return !0;
  return !1;
}
var addon_unicode11_H = class {
  constructor() {
    this.version = "6";
    if (!addon_unicode11_A) {
      addon_unicode11_A = new Uint8Array(65536), addon_unicode11_A.fill(1), addon_unicode11_A[0] = 0, addon_unicode11_A.fill(0, 1, 32), addon_unicode11_A.fill(0, 127, 160), addon_unicode11_A.fill(2, 4352, 4448), addon_unicode11_A[9001] = 2, addon_unicode11_A[9002] = 2, addon_unicode11_A.fill(2, 11904, 42192), addon_unicode11_A[12351] = 1, addon_unicode11_A.fill(2, 44032, 55204), addon_unicode11_A.fill(2, 63744, 64256), addon_unicode11_A.fill(2, 65040, 65050), addon_unicode11_A.fill(2, 65072, 65136), addon_unicode11_A.fill(2, 65280, 65377), addon_unicode11_A.fill(2, 65504, 65511);
      for (let e = 0; e < addon_unicode11_ue.length; ++e) addon_unicode11_A.fill(0, addon_unicode11_ue[e][0], addon_unicode11_ue[e][1] + 1);
    }
  }
  wcwidth(e) {
    return e < 32 ? 0 : e < 127 ? 1 : e < 65536 ? addon_unicode11_A[e] : addon_unicode11_He(e, addon_unicode11_qe) ? 0 : e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141 ? 2 : 1;
  }
  charProperties(e, t) {
    let n = this.wcwidth(e),
      o = n === 0 && t !== 0;
    if (o) {
      let d = addon_unicode11_w.extractWidth(t);
      d === 0 ? o = !1 : d > n && (n = d);
    }
    return addon_unicode11_w.createPropertyValue(0, n, o);
  }
};
var addon_unicode11_de = class {
    constructor() {
      this.listeners = [], this.unexpectedErrorHandler = function (e) {
        setTimeout(() => {
          throw e.stack ? addon_unicode11_J.isErrorNoTelemetry(e) ? new addon_unicode11_J(e.message + `

` + e.stack) : new Error(e.message + `

` + e.stack) : e;
        }, 0);
      };
    }
    addListener(e) {
      return this.listeners.push(e), () => {
        this._removeListener(e);
      };
    }
    emit(e) {
      this.listeners.forEach(t => {
        t(e);
      });
    }
    _removeListener(e) {
      this.listeners.splice(this.listeners.indexOf(e), 1);
    }
    setUnexpectedErrorHandler(e) {
      this.unexpectedErrorHandler = e;
    }
    getUnexpectedErrorHandler() {
      return this.unexpectedErrorHandler;
    }
    onUnexpectedError(e) {
      this.unexpectedErrorHandler(e), this.emit(e);
    }
    onUnexpectedExternalError(e) {
      this.unexpectedErrorHandler(e);
    }
  },
  addon_unicode11_Ge = new addon_unicode11_de();
function addon_unicode11_Y(r) {
  addon_unicode11_Je(r) || addon_unicode11_Ge.onUnexpectedError(r);
}
var addon_unicode11_ce = "Canceled";
function addon_unicode11_Je(r) {
  return r instanceof addon_unicode11_G ? !0 : r instanceof Error && r.name === addon_unicode11_ce && r.message === addon_unicode11_ce;
}
var addon_unicode11_G = class extends Error {
  constructor() {
    super(addon_unicode11_ce), this.name = this.message;
  }
};
var addon_unicode11_J = class r extends Error {
  constructor(e) {
    super(e), this.name = "CodeExpectedError";
  }
  static fromError(e) {
    if (e instanceof r) return e;
    let t = new r();
    return t.message = e.message, t.stack = e.stack, t;
  }
  static isErrorNoTelemetry(e) {
    return e.name === "CodeExpectedError";
  }
};
function addon_unicode11_pe(r, e) {
  let t = this,
    n = !1,
    o;
  return function () {
    if (n) return o;
    if (n = !0, e) try {
      o = r.apply(t, arguments);
    } finally {
      e();
    } else o = r.apply(t, arguments);
    return o;
  };
}
function addon_unicode11_Ye(r, e, t = 0, n = r.length) {
  let o = t,
    d = n;
  for (; o < d;) {
    let v = Math.floor((o + d) / 2);
    e(r[v]) ? o = v + 1 : d = v;
  }
  return o - 1;
}
var addon_unicode11_X = class X {
  constructor(e) {
    this._array = e;
    this._findLastMonotonousLastIdx = 0;
  }
  findLastMonotonous(e) {
    if (X.assertInvariants) {
      if (this._prevFindLastPredicate) {
        for (let n of this._array) if (this._prevFindLastPredicate(n) && !e(n)) throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");
      }
      this._prevFindLastPredicate = e;
    }
    let t = addon_unicode11_Ye(this._array, e, this._findLastMonotonousLastIdx);
    return this._findLastMonotonousLastIdx = t + 1, t === -1 ? void 0 : this._array[t];
  }
};
addon_unicode11_X.assertInvariants = !1;
var addon_unicode11_e = (/* unused pure expression or super */ null && (addon_unicode11_X));
var addon_unicode11_Be;
(E => {
  function r(p) {
    return p < 0;
  }
  E.isLessThan = r;
  function e(p) {
    return p <= 0;
  }
  E.isLessThanOrEqual = e;
  function t(p) {
    return p > 0;
  }
  E.isGreaterThan = t;
  function n(p) {
    return p === 0;
  }
  E.isNeitherLessOrGreaterThan = n, E.greaterThan = 1, E.lessThan = -1, E.neitherLessOrGreaterThan = 0;
})(addon_unicode11_Be ||= {});
function addon_unicode11_we(r, e) {
  return (t, n) => e(r(t), r(n));
}
var addon_unicode11_ke = (r, e) => r - e;
var addon_unicode11_R = class R {
  constructor(e) {
    this.iterate = e;
  }
  forEach(e) {
    this.iterate(t => (e(t), !0));
  }
  toArray() {
    let e = [];
    return this.iterate(t => (e.push(t), !0)), e;
  }
  filter(e) {
    return new R(t => this.iterate(n => e(n) ? t(n) : !0));
  }
  map(e) {
    return new R(t => this.iterate(n => t(e(n))));
  }
  some(e) {
    let t = !1;
    return this.iterate(n => (t = e(n), !t)), t;
  }
  findFirst(e) {
    let t;
    return this.iterate(n => e(n) ? (t = n, !1) : !0), t;
  }
  findLast(e) {
    let t;
    return this.iterate(n => (e(n) && (t = n), !0)), t;
  }
  findLastMaxBy(e) {
    let t,
      n = !0;
    return this.iterate(o => ((n || addon_unicode11_Be.isGreaterThan(e(o, t))) && (n = !1, t = o), !0)), t;
  }
};
addon_unicode11_R.empty = new addon_unicode11_R(e => {});
var addon_unicode11_Ie = (/* unused pure expression or super */ null && (addon_unicode11_R));
function addon_unicode11_Oe(r, e) {
  let t = Object.create(null);
  for (let n of r) {
    let o = e(n),
      d = t[o];
    d || (d = t[o] = []), d.push(n);
  }
  return t;
}
var addon_unicode11_Se,
  addon_unicode11_Re,
  addon_unicode11_Le = class {
    constructor(e, t) {
      this.toKey = t;
      this._map = new Map();
      this[addon_unicode11_Se] = "SetWithKey";
      for (let n of e) this.add(n);
    }
    get size() {
      return this._map.size;
    }
    add(e) {
      let t = this.toKey(e);
      return this._map.set(t, e), this;
    }
    delete(e) {
      return this._map.delete(this.toKey(e));
    }
    has(e) {
      return this._map.has(this.toKey(e));
    }
    *entries() {
      for (let e of this._map.values()) yield [e, e];
    }
    keys() {
      return this.values();
    }
    *values() {
      for (let e of this._map.values()) yield e;
    }
    clear() {
      this._map.clear();
    }
    forEach(e, t) {
      this._map.forEach(n => e.call(t, n, n, this));
    }
    [(addon_unicode11_Re = Symbol.iterator, addon_unicode11_Se = Symbol.toStringTag, addon_unicode11_Re)]() {
      return this.values();
    }
  };
var addon_unicode11_Z = class {
  constructor() {
    this.map = new Map();
  }
  add(e, t) {
    let n = this.map.get(e);
    n || (n = new Set(), this.map.set(e, n)), n.add(t);
  }
  delete(e, t) {
    let n = this.map.get(e);
    n && (n.delete(t), n.size === 0 && this.map.delete(e));
  }
  forEach(e, t) {
    let n = this.map.get(e);
    n && n.forEach(t);
  }
  get(e) {
    let t = this.map.get(e);
    return t || new Set();
  }
};
var addon_unicode11_fe;
(le => {
  function r(u) {
    return u && typeof u == "object" && typeof u[Symbol.iterator] == "function";
  }
  le.is = r;
  let e = Object.freeze([]);
  function t() {
    return e;
  }
  le.empty = t;
  function* n(u) {
    yield u;
  }
  le.single = n;
  function o(u) {
    return r(u) ? u : n(u);
  }
  le.wrap = o;
  function d(u) {
    return u || e;
  }
  le.from = d;
  function* v(u) {
    for (let f = u.length - 1; f >= 0; f--) yield u[f];
  }
  le.reverse = v;
  function E(u) {
    return !u || u[Symbol.iterator]().next().done === !0;
  }
  le.isEmpty = E;
  function p(u) {
    return u[Symbol.iterator]().next().value;
  }
  le.first = p;
  function b(u, f) {
    let m = 0;
    for (let g of u) if (f(g, m++)) return !0;
    return !1;
  }
  le.some = b;
  function D(u, f) {
    for (let m of u) if (f(m)) return m;
  }
  le.find = D;
  function* T(u, f) {
    for (let m of u) f(m) && (yield m);
  }
  le.filter = T;
  function* B(u, f) {
    let m = 0;
    for (let g of u) yield f(g, m++);
  }
  le.map = B;
  function* L(u, f) {
    let m = 0;
    for (let g of u) yield* f(g, m++);
  }
  le.flatMap = L;
  function* oe(...u) {
    for (let f of u) yield* f;
  }
  le.concat = oe;
  function z(u, f, m) {
    let g = m;
    for (let W of u) g = f(g, W);
    return g;
  }
  le.reduce = z;
  function* k(u, f, m = u.length) {
    for (f < 0 && (f += u.length), m < 0 ? m += u.length : m > u.length && (m = u.length); f < m; f++) yield u[f];
  }
  le.slice = k;
  function ae(u, f = Number.POSITIVE_INFINITY) {
    let m = [];
    if (f === 0) return [m, u];
    let g = u[Symbol.iterator]();
    for (let W = 0; W < f; W++) {
      let xe = g.next();
      if (xe.done) return [m, le.empty()];
      m.push(xe.value);
    }
    return [m, {
      [Symbol.iterator]() {
        return g;
      }
    }];
  }
  le.consume = ae;
  async function V(u) {
    let f = [];
    for await (let m of u) f.push(m);
    return Promise.resolve(f);
  }
  le.asyncToArray = V;
})(addon_unicode11_fe ||= {});
var addon_unicode11_Xe = !1,
  addon_unicode11_O = null,
  addon_unicode11_ee = class ee {
    constructor() {
      this.livingDisposables = new Map();
    }
    getDisposableData(e) {
      let t = this.livingDisposables.get(e);
      return t || (t = {
        parent: null,
        source: null,
        isSingleton: !1,
        value: e,
        idx: ee.idx++
      }, this.livingDisposables.set(e, t)), t;
    }
    trackDisposable(e) {
      let t = this.getDisposableData(e);
      t.source || (t.source = new Error().stack);
    }
    setParent(e, t) {
      let n = this.getDisposableData(e);
      n.parent = t;
    }
    markAsDisposed(e) {
      this.livingDisposables.delete(e);
    }
    markAsSingleton(e) {
      this.getDisposableData(e).isSingleton = !0;
    }
    getRootParent(e, t) {
      let n = t.get(e);
      if (n) return n;
      let o = e.parent ? this.getRootParent(this.getDisposableData(e.parent), t) : e;
      return t.set(e, o), o;
    }
    getTrackedDisposables() {
      let e = new Map();
      return [...this.livingDisposables.entries()].filter(([, n]) => n.source !== null && !this.getRootParent(n, e).isSingleton).flatMap(([n]) => n);
    }
    computeLeakingDisposables(e = 10, t) {
      let n;
      if (t) n = t;else {
        let p = new Map(),
          b = [...this.livingDisposables.values()].filter(T => T.source !== null && !this.getRootParent(T, p).isSingleton);
        if (b.length === 0) return;
        let D = new Set(b.map(T => T.value));
        if (n = b.filter(T => !(T.parent && D.has(T.parent))), n.length === 0) throw new Error("There are cyclic diposable chains!");
      }
      if (!n) return;
      function o(p) {
        function b(T, B) {
          for (; T.length > 0 && B.some(L => typeof L == "string" ? L === T[0] : T[0].match(L));) T.shift();
        }
        let D = p.source.split(`
`).map(T => T.trim().replace("at ", "")).filter(T => T !== "");
        return b(D, ["Error", /^trackDisposable \(.*\)$/, /^DisposableTracker.trackDisposable \(.*\)$/]), D.reverse();
      }
      let d = new addon_unicode11_Z();
      for (let p of n) {
        let b = o(p);
        for (let D = 0; D <= b.length; D++) d.add(b.slice(0, D).join(`
`), p);
      }
      n.sort(addon_unicode11_we(p => p.idx, addon_unicode11_ke));
      let v = "",
        E = 0;
      for (let p of n.slice(0, e)) {
        E++;
        let b = o(p),
          D = [];
        for (let T = 0; T < b.length; T++) {
          let B = b[T];
          B = `(shared with ${d.get(b.slice(0, T + 1).join(`
`)).size}/${n.length} leaks) at ${B}`;
          let oe = d.get(b.slice(0, T).join(`
`)),
            z = addon_unicode11_Oe([...oe].map(k => o(k)[T]), k => k);
          delete z[b[T]];
          for (let [k, ae] of Object.entries(z)) D.unshift(`    - stacktraces of ${ae.length} other leaks continue with ${k}`);
          D.unshift(B);
        }
        v += `


==================== Leaking disposable ${E}/${n.length}: ${p.value.constructor.name} ====================
${D.join(`
`)}
============================================================

`;
      }
      return n.length > e && (v += `


... and ${n.length - e} more leaking disposables

`), {
        leaks: n,
        details: v
      };
    }
  };
addon_unicode11_ee.idx = 0;
var addon_unicode11_Ue = (/* unused pure expression or super */ null && (addon_unicode11_ee));
function addon_unicode11_Ze(r) {
  addon_unicode11_O = r;
}
if (addon_unicode11_Xe) {
  let r = "__is_disposable_tracked__";
  addon_unicode11_Ze(new class {
    trackDisposable(e) {
      let t = new Error("Potentially leaked disposable").stack;
      setTimeout(() => {
        e[r] || console.log(t);
      }, 3e3);
    }
    setParent(e, t) {
      if (e && e !== addon_unicode11_.None) try {
        e[r] = !0;
      } catch {}
    }
    markAsDisposed(e) {
      if (e && e !== addon_unicode11_.None) try {
        e[r] = !0;
      } catch {}
    }
    markAsSingleton(e) {}
  }());
}
function addon_unicode11_Te(r) {
  return addon_unicode11_O?.trackDisposable(r), r;
}
function addon_unicode11_ve(r) {
  addon_unicode11_O?.markAsDisposed(r);
}
function addon_unicode11_he(r, e) {
  addon_unicode11_O?.setParent(r, e);
}
function addon_unicode11_et(r, e) {
  if (addon_unicode11_O) for (let t of r) addon_unicode11_O.setParent(t, e);
}
function addon_unicode11_Pe(r) {
  if (addon_unicode11_fe.is(r)) {
    let e = [];
    for (let t of r) if (t) try {
      t.dispose();
    } catch (n) {
      e.push(n);
    }
    if (e.length === 1) throw e[0];
    if (e.length > 1) throw new AggregateError(e, "Encountered errors while disposing of store");
    return Array.isArray(r) ? [] : r;
  } else if (r) return r.dispose(), r;
}
function addon_unicode11_Me(...r) {
  let e = addon_unicode11_me(() => addon_unicode11_Pe(r));
  return addon_unicode11_et(r, e), e;
}
function addon_unicode11_me(r) {
  let e = addon_unicode11_Te({
    dispose: addon_unicode11_pe(() => {
      addon_unicode11_ve(e), r();
    })
  });
  return e;
}
var addon_unicode11_te = class te {
  constructor() {
    this._toDispose = new Set();
    this._isDisposed = !1;
    addon_unicode11_Te(this);
  }
  dispose() {
    this._isDisposed || (addon_unicode11_ve(this), this._isDisposed = !0, this.clear());
  }
  get isDisposed() {
    return this._isDisposed;
  }
  clear() {
    if (this._toDispose.size !== 0) try {
      addon_unicode11_Pe(this._toDispose);
    } finally {
      this._toDispose.clear();
    }
  }
  add(e) {
    if (!e) return e;
    if (e === this) throw new Error("Cannot register a disposable on itself!");
    return addon_unicode11_he(e, this), this._isDisposed ? te.DISABLE_DISPOSED_WARNING || console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack) : this._toDispose.add(e), e;
  }
  delete(e) {
    if (e) {
      if (e === this) throw new Error("Cannot dispose a disposable on itself!");
      this._toDispose.delete(e), e.dispose();
    }
  }
  deleteAndLeak(e) {
    e && this._toDispose.has(e) && (this._toDispose.delete(e), addon_unicode11_he(e, null));
  }
};
addon_unicode11_te.DISABLE_DISPOSED_WARNING = !1;
var addon_unicode11_U = addon_unicode11_te,
  addon_unicode11_ = class {
    constructor() {
      this._store = new addon_unicode11_U();
      addon_unicode11_Te(this), addon_unicode11_he(this._store, this);
    }
    dispose() {
      addon_unicode11_ve(this), this._store.dispose();
    }
    _register(e) {
      if (e === this) throw new Error("Cannot register a disposable on itself!");
      return this._store.add(e);
    }
  };
addon_unicode11_.None = Object.freeze({
  dispose() {}
});
var addon_unicode11_P = class P {
  constructor(e) {
    this.element = e, this.next = P.Undefined, this.prev = P.Undefined;
  }
};
addon_unicode11_P.Undefined = new addon_unicode11_P(void 0);
var addon_unicode11_Ne = (/* unused pure expression or super */ null && (addon_unicode11_P));
var addon_unicode11_tt = globalThis.performance && typeof globalThis.performance.now == "function",
  addon_unicode11_ne = class r {
    static create(e) {
      return new r(e);
    }
    constructor(e) {
      this._now = addon_unicode11_tt && e === !1 ? Date.now : globalThis.performance.now.bind(globalThis.performance), this._startTime = this._now(), this._stopTime = -1;
    }
    stop() {
      this._stopTime = this._now();
    }
    reset() {
      this._startTime = this._now(), this._stopTime = -1;
    }
    elapsed() {
      return this._stopTime !== -1 ? this._stopTime - this._startTime : this._now() - this._startTime;
    }
  };
var addon_unicode11_nt = !1,
  addon_unicode11_Ve = !1,
  addon_unicode11_rt = !1,
  addon_unicode11_it;
(Q => {
  Q.None = () => addon_unicode11_.None;
  function e(l) {
    if (addon_unicode11_rt) {
      let {
          onDidAddListener: i
        } = l,
        a = addon_unicode11_K.create(),
        s = 0;
      l.onDidAddListener = () => {
        ++s === 2 && (console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"), a.print()), i?.();
      };
    }
  }
  function t(l, i) {
    return B(l, () => {}, 0, void 0, !0, void 0, i);
  }
  Q.defer = t;
  function n(l) {
    return (i, a = null, s) => {
      let x = !1,
        c;
      return c = l(h => {
        if (!x) return c ? c.dispose() : x = !0, i.call(a, h);
      }, null, s), x && c.dispose(), c;
    };
  }
  Q.once = n;
  function o(l, i, a) {
    return D((s, x = null, c) => l(h => s.call(x, i(h)), null, c), a);
  }
  Q.map = o;
  function d(l, i, a) {
    return D((s, x = null, c) => l(h => {
      i(h), s.call(x, h);
    }, null, c), a);
  }
  Q.forEach = d;
  function v(l, i, a) {
    return D((s, x = null, c) => l(h => i(h) && s.call(x, h), null, c), a);
  }
  Q.filter = v;
  function E(l) {
    return l;
  }
  Q.signal = E;
  function p(...l) {
    return (i, a = null, s) => {
      let x = addon_unicode11_Me(...l.map(c => c(h => i.call(a, h))));
      return T(x, s);
    };
  }
  Q.any = p;
  function b(l, i, a, s) {
    let x = a;
    return o(l, c => (x = i(x, c), x), s);
  }
  Q.reduce = b;
  function D(l, i) {
    let a,
      s = {
        onWillAddFirstListener() {
          a = l(x.fire, x);
        },
        onDidRemoveLastListener() {
          a?.dispose();
        }
      };
    i || e(s);
    let x = new addon_unicode11_C(s);
    return i?.add(x), x.event;
  }
  function T(l, i) {
    return i instanceof Array ? i.push(l) : i && i.add(l), l;
  }
  function B(l, i, a = 100, s = !1, x = !1, c, h) {
    let F,
      y,
      S,
      $ = 0,
      j,
      Ce = {
        leakWarningThreshold: c,
        onWillAddFirstListener() {
          F = l(Qe => {
            $++, y = i(y, Qe), s && !S && (q.fire(y), y = void 0), j = () => {
              let $e = y;
              y = void 0, S = void 0, (!s || $ > 1) && q.fire($e), $ = 0;
            }, typeof a == "number" ? (clearTimeout(S), S = setTimeout(j, a)) : S === void 0 && (S = 0, queueMicrotask(j));
          });
        },
        onWillRemoveListener() {
          x && $ > 0 && j?.();
        },
        onDidRemoveLastListener() {
          j = void 0, F.dispose();
        }
      };
    h || e(Ce);
    let q = new addon_unicode11_C(Ce);
    return h?.add(q), q.event;
  }
  Q.debounce = B;
  function L(l, i = 0, a) {
    return Q.debounce(l, (s, x) => s ? (s.push(x), s) : [x], i, void 0, !0, void 0, a);
  }
  Q.accumulate = L;
  function oe(l, i = (s, x) => s === x, a) {
    let s = !0,
      x;
    return v(l, c => {
      let h = s || !i(c, x);
      return s = !1, x = c, h;
    }, a);
  }
  Q.latch = oe;
  function z(l, i, a) {
    return [Q.filter(l, i, a), Q.filter(l, s => !i(s), a)];
  }
  Q.split = z;
  function k(l, i = !1, a = [], s) {
    let x = a.slice(),
      c = l(y => {
        x ? x.push(y) : F.fire(y);
      });
    s && s.add(c);
    let h = () => {
        x?.forEach(y => F.fire(y)), x = null;
      },
      F = new addon_unicode11_C({
        onWillAddFirstListener() {
          c || (c = l(y => F.fire(y)), s && s.add(c));
        },
        onDidAddFirstListener() {
          x && (i ? setTimeout(h) : h());
        },
        onDidRemoveLastListener() {
          c && c.dispose(), c = null;
        }
      });
    return s && s.add(F), F.event;
  }
  Q.buffer = k;
  function ae(l, i) {
    return (s, x, c) => {
      let h = i(new le());
      return l(function (F) {
        let y = h.evaluate(F);
        y !== V && s.call(x, y);
      }, void 0, c);
    };
  }
  Q.chain = ae;
  let V = Symbol("HaltChainable");
  class le {
    constructor() {
      this.steps = [];
    }
    map(i) {
      return this.steps.push(i), this;
    }
    forEach(i) {
      return this.steps.push(a => (i(a), a)), this;
    }
    filter(i) {
      return this.steps.push(a => i(a) ? a : V), this;
    }
    reduce(i, a) {
      let s = a;
      return this.steps.push(x => (s = i(s, x), s)), this;
    }
    latch(i = (a, s) => a === s) {
      let a = !0,
        s;
      return this.steps.push(x => {
        let c = a || !i(x, s);
        return a = !1, s = x, c ? x : V;
      }), this;
    }
    evaluate(i) {
      for (let a of this.steps) if (i = a(i), i === V) break;
      return i;
    }
  }
  function u(l, i, a = s => s) {
    let s = (...F) => h.fire(a(...F)),
      x = () => l.on(i, s),
      c = () => l.removeListener(i, s),
      h = new addon_unicode11_C({
        onWillAddFirstListener: x,
        onDidRemoveLastListener: c
      });
    return h.event;
  }
  Q.fromNodeEventEmitter = u;
  function f(l, i, a = s => s) {
    let s = (...F) => h.fire(a(...F)),
      x = () => l.addEventListener(i, s),
      c = () => l.removeEventListener(i, s),
      h = new addon_unicode11_C({
        onWillAddFirstListener: x,
        onDidRemoveLastListener: c
      });
    return h.event;
  }
  Q.fromDOMEventEmitter = f;
  function m(l) {
    return new Promise(i => n(l)(i));
  }
  Q.toPromise = m;
  function g(l) {
    let i = new addon_unicode11_C();
    return l.then(a => {
      i.fire(a);
    }, () => {
      i.fire(void 0);
    }).finally(() => {
      i.dispose();
    }), i.event;
  }
  Q.fromPromise = g;
  function W(l, i) {
    return l(a => i.fire(a));
  }
  Q.forward = W;
  function xe(l, i, a) {
    return i(a), l(s => i(s));
  }
  Q.runAndSubscribe = xe;
  class ze {
    constructor(i, a) {
      this._observable = i;
      this._counter = 0;
      this._hasChanged = !1;
      let s = {
        onWillAddFirstListener: () => {
          i.addObserver(this);
        },
        onDidRemoveLastListener: () => {
          i.removeObserver(this);
        }
      };
      a || e(s), this.emitter = new addon_unicode11_C(s), a && a.add(this.emitter);
    }
    beginUpdate(i) {
      this._counter++;
    }
    handlePossibleChange(i) {}
    handleChange(i, a) {
      this._hasChanged = !0;
    }
    endUpdate(i) {
      this._counter--, this._counter === 0 && (this._observable.reportChanges(), this._hasChanged && (this._hasChanged = !1, this.emitter.fire(this._observable.get())));
    }
  }
  function ut(l, i) {
    return new ze(l, i).emitter.event;
  }
  Q.fromObservable = ut;
  function dt(l) {
    return (i, a, s) => {
      let x = 0,
        c = !1,
        h = {
          beginUpdate() {
            x++;
          },
          endUpdate() {
            x--, x === 0 && (l.reportChanges(), c && (c = !1, i.call(a)));
          },
          handlePossibleChange() {},
          handleChange() {
            c = !0;
          }
        };
      l.addObserver(h), l.reportChanges();
      let F = {
        dispose() {
          l.removeObserver(h);
        }
      };
      return s instanceof addon_unicode11_U ? s.add(F) : Array.isArray(s) && s.push(F), F;
    };
  }
  Q.fromObservableLight = dt;
})(addon_unicode11_it ||= {});
var addon_unicode11_M = class M {
  constructor(e) {
    this.listenerCount = 0;
    this.invocationCount = 0;
    this.elapsedOverall = 0;
    this.durations = [];
    this.name = `${e}_${M._idPool++}`, M.all.add(this);
  }
  start(e) {
    this._stopWatch = new addon_unicode11_ne(), this.listenerCount = e;
  }
  stop() {
    if (this._stopWatch) {
      let e = this._stopWatch.elapsed();
      this.durations.push(e), this.elapsedOverall += e, this.invocationCount += 1, this._stopWatch = void 0;
    }
  }
};
addon_unicode11_M.all = new Set(), addon_unicode11_M._idPool = 0;
var addon_unicode11_be = addon_unicode11_M,
  addon_unicode11_We = -1;
var addon_unicode11_ie = class ie {
  constructor(e, t, n = (ie._idPool++).toString(16).padStart(3, "0")) {
    this._errorHandler = e;
    this.threshold = t;
    this.name = n;
    this._warnCountdown = 0;
  }
  dispose() {
    this._stacks?.clear();
  }
  check(e, t) {
    let n = this.threshold;
    if (n <= 0 || t < n) return;
    this._stacks || (this._stacks = new Map());
    let o = this._stacks.get(e.value) || 0;
    if (this._stacks.set(e.value, o + 1), this._warnCountdown -= 1, this._warnCountdown <= 0) {
      this._warnCountdown = n * .5;
      let [d, v] = this.getMostFrequentStack(),
        E = `[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${v}):`;
      console.warn(E), console.warn(d);
      let p = new addon_unicode11_De(E, d);
      this._errorHandler(p);
    }
    return () => {
      let d = this._stacks.get(e.value) || 0;
      this._stacks.set(e.value, d - 1);
    };
  }
  getMostFrequentStack() {
    if (!this._stacks) return;
    let e,
      t = 0;
    for (let [n, o] of this._stacks) (!e || t < o) && (e = [n, o], t = o);
    return e;
  }
};
addon_unicode11_ie._idPool = 1;
var addon_unicode11_Ee = addon_unicode11_ie,
  addon_unicode11_K = class r {
    constructor(e) {
      this.value = e;
    }
    static create() {
      let e = new Error();
      return new r(e.stack ?? "");
    }
    print() {
      console.warn(this.value.split(`
`).slice(2).join(`
`));
    }
  },
  addon_unicode11_De = class extends Error {
    constructor(e, t) {
      super(e), this.name = "ListenerLeakError", this.stack = t;
    }
  },
  addon_unicode11_Ae = class extends Error {
    constructor(e, t) {
      super(e), this.name = "ListenerRefusalError", this.stack = t;
    }
  },
  addon_unicode11_st = 0,
  addon_unicode11_N = class {
    constructor(e) {
      this.value = e;
      this.id = addon_unicode11_st++;
    }
  },
  addon_unicode11_ot = 2,
  addon_unicode11_at = (r, e) => {
    if (r instanceof addon_unicode11_N) e(r);else for (let t = 0; t < r.length; t++) {
      let n = r[t];
      n && e(n);
    }
  },
  addon_unicode11_re;
if (addon_unicode11_nt) {
  let r = [];
  setInterval(() => {
    r.length !== 0 && (console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"), console.warn(r.join(`
`)), r.length = 0);
  }, 3e3), addon_unicode11_re = new FinalizationRegistry(e => {
    typeof e == "string" && r.push(e);
  });
}
var addon_unicode11_C = class {
  constructor(e) {
    this._size = 0;
    this._options = e, this._leakageMon = addon_unicode11_We > 0 || this._options?.leakWarningThreshold ? new addon_unicode11_Ee(e?.onListenerError ?? addon_unicode11_Y, this._options?.leakWarningThreshold ?? addon_unicode11_We) : void 0, this._perfMon = this._options?._profName ? new addon_unicode11_be(this._options._profName) : void 0, this._deliveryQueue = this._options?.deliveryQueue;
  }
  dispose() {
    if (!this._disposed) {
      if (this._disposed = !0, this._deliveryQueue?.current === this && this._deliveryQueue.reset(), this._listeners) {
        if (addon_unicode11_Ve) {
          let e = this._listeners;
          queueMicrotask(() => {
            addon_unicode11_at(e, t => t.stack?.print());
          });
        }
        this._listeners = void 0, this._size = 0;
      }
      this._options?.onDidRemoveLastListener?.(), this._leakageMon?.dispose();
    }
  }
  get event() {
    return this._event ??= (e, t, n) => {
      if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) {
        let p = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;
        console.warn(p);
        let b = this._leakageMon.getMostFrequentStack() ?? ["UNKNOWN stack", -1],
          D = new addon_unicode11_Ae(`${p}. HINT: Stack shows most frequent listener (${b[1]}-times)`, b[0]);
        return (this._options?.onListenerError || addon_unicode11_Y)(D), addon_unicode11_.None;
      }
      if (this._disposed) return addon_unicode11_.None;
      t && (e = e.bind(t));
      let o = new addon_unicode11_N(e),
        d,
        v;
      this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * .2) && (o.stack = addon_unicode11_K.create(), d = this._leakageMon.check(o.stack, this._size + 1)), addon_unicode11_Ve && (o.stack = v ?? addon_unicode11_K.create()), this._listeners ? this._listeners instanceof addon_unicode11_N ? (this._deliveryQueue ??= new addon_unicode11_Fe(), this._listeners = [this._listeners, o]) : this._listeners.push(o) : (this._options?.onWillAddFirstListener?.(this), this._listeners = o, this._options?.onDidAddFirstListener?.(this)), this._size++;
      let E = addon_unicode11_me(() => {
        addon_unicode11_re?.unregister(E), d?.(), this._removeListener(o);
      });
      if (n instanceof addon_unicode11_U ? n.add(E) : Array.isArray(n) && n.push(E), addon_unicode11_re) {
        let p = new Error().stack.split(`
`).slice(2, 3).join(`
`).trim(),
          b = /(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(p);
        addon_unicode11_re.register(E, b?.[2] ?? p, E);
      }
      return E;
    }, this._event;
  }
  _removeListener(e) {
    if (this._options?.onWillRemoveListener?.(this), !this._listeners) return;
    if (this._size === 1) {
      this._listeners = void 0, this._options?.onDidRemoveLastListener?.(this), this._size = 0;
      return;
    }
    let t = this._listeners,
      n = t.indexOf(e);
    if (n === -1) throw console.log("disposed?", this._disposed), console.log("size?", this._size), console.log("arr?", JSON.stringify(this._listeners)), new Error("Attempted to dispose unknown listener");
    this._size--, t[n] = void 0;
    let o = this._deliveryQueue.current === this;
    if (this._size * addon_unicode11_ot <= t.length) {
      let d = 0;
      for (let v = 0; v < t.length; v++) t[v] ? t[d++] = t[v] : o && (this._deliveryQueue.end--, d < this._deliveryQueue.i && this._deliveryQueue.i--);
      t.length = d;
    }
  }
  _deliver(e, t) {
    if (!e) return;
    let n = this._options?.onListenerError || addon_unicode11_Y;
    if (!n) {
      e.value(t);
      return;
    }
    try {
      e.value(t);
    } catch (o) {
      n(o);
    }
  }
  _deliverQueue(e) {
    let t = e.current._listeners;
    for (; e.i < e.end;) this._deliver(t[e.i++], e.value);
    e.reset();
  }
  fire(e) {
    if (this._deliveryQueue?.current && (this._deliverQueue(this._deliveryQueue), this._perfMon?.stop()), this._perfMon?.start(this._size), this._listeners) if (this._listeners instanceof addon_unicode11_N) this._deliver(this._listeners, e);else {
      let t = this._deliveryQueue;
      t.enqueue(this, e, this._listeners.length), this._deliverQueue(t);
    }
    this._perfMon?.stop();
  }
  hasListeners() {
    return this._size > 0;
  }
};
var addon_unicode11_Fe = class {
  constructor() {
    this.i = -1;
    this.end = 0;
  }
  enqueue(e, t, n) {
    this.i = 0, this.end = n, this.current = e, this.value = t;
  }
  reset() {
    this.i = this.end, this.current = void 0, this.value = void 0;
  }
};
var addon_unicode11_w = class r {
  constructor() {
    this._providers = Object.create(null);
    this._active = "";
    this._onChange = new addon_unicode11_C();
    this.onChange = this._onChange.event;
    let e = new addon_unicode11_H();
    this.register(e), this._active = e.version, this._activeProvider = e;
  }
  static extractShouldJoin(e) {
    return (e & 1) !== 0;
  }
  static extractWidth(e) {
    return e >> 1 & 3;
  }
  static extractCharKind(e) {
    return e >> 3;
  }
  static createPropertyValue(e, t, n = !1) {
    return (e & 16777215) << 3 | (t & 3) << 1 | (n ? 1 : 0);
  }
  dispose() {
    this._onChange.dispose();
  }
  get versions() {
    return Object.keys(this._providers);
  }
  get activeVersion() {
    return this._active;
  }
  set activeVersion(e) {
    if (!this._providers[e]) throw new Error(`unknown Unicode version "${e}"`);
    this._active = e, this._activeProvider = this._providers[e], this._onChange.fire(e);
  }
  register(e) {
    this._providers[e.version] = e;
  }
  wcwidth(e) {
    return this._activeProvider.wcwidth(e);
  }
  getStringCellWidth(e) {
    let t = 0,
      n = 0,
      o = e.length;
    for (let d = 0; d < o; ++d) {
      let v = e.charCodeAt(d);
      if (55296 <= v && v <= 56319) {
        if (++d >= o) return t + this.wcwidth(v);
        let b = e.charCodeAt(d);
        56320 <= b && b <= 57343 ? v = (v - 55296) * 1024 + b - 56320 + 65536 : t += this.wcwidth(b);
      }
      let E = this.charProperties(v, n),
        p = r.extractWidth(E);
      r.extractShouldJoin(E) && (p -= r.extractWidth(n)), t += p, n = E;
    }
    return t;
  }
  charProperties(e, t) {
    return this._activeProvider.charProperties(e, t);
  }
};
var addon_unicode11_ye = [[768, 879], [1155, 1161], [1425, 1469], [1471, 1471], [1473, 1474], [1476, 1477], [1479, 1479], [1536, 1541], [1552, 1562], [1564, 1564], [1611, 1631], [1648, 1648], [1750, 1757], [1759, 1764], [1767, 1768], [1770, 1773], [1807, 1807], [1809, 1809], [1840, 1866], [1958, 1968], [2027, 2035], [2045, 2045], [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2093], [2137, 2139], [2259, 2306], [2362, 2362], [2364, 2364], [2369, 2376], [2381, 2381], [2385, 2391], [2402, 2403], [2433, 2433], [2492, 2492], [2497, 2500], [2509, 2509], [2530, 2531], [2558, 2558], [2561, 2562], [2620, 2620], [2625, 2626], [2631, 2632], [2635, 2637], [2641, 2641], [2672, 2673], [2677, 2677], [2689, 2690], [2748, 2748], [2753, 2757], [2759, 2760], [2765, 2765], [2786, 2787], [2810, 2815], [2817, 2817], [2876, 2876], [2879, 2879], [2881, 2884], [2893, 2893], [2902, 2902], [2914, 2915], [2946, 2946], [3008, 3008], [3021, 3021], [3072, 3072], [3076, 3076], [3134, 3136], [3142, 3144], [3146, 3149], [3157, 3158], [3170, 3171], [3201, 3201], [3260, 3260], [3263, 3263], [3270, 3270], [3276, 3277], [3298, 3299], [3328, 3329], [3387, 3388], [3393, 3396], [3405, 3405], [3426, 3427], [3530, 3530], [3538, 3540], [3542, 3542], [3633, 3633], [3636, 3642], [3655, 3662], [3761, 3761], [3764, 3772], [3784, 3789], [3864, 3865], [3893, 3893], [3895, 3895], [3897, 3897], [3953, 3966], [3968, 3972], [3974, 3975], [3981, 3991], [3993, 4028], [4038, 4038], [4141, 4144], [4146, 4151], [4153, 4154], [4157, 4158], [4184, 4185], [4190, 4192], [4209, 4212], [4226, 4226], [4229, 4230], [4237, 4237], [4253, 4253], [4448, 4607], [4957, 4959], [5906, 5908], [5938, 5940], [5970, 5971], [6002, 6003], [6068, 6069], [6071, 6077], [6086, 6086], [6089, 6099], [6109, 6109], [6155, 6158], [6277, 6278], [6313, 6313], [6432, 6434], [6439, 6440], [6450, 6450], [6457, 6459], [6679, 6680], [6683, 6683], [6742, 6742], [6744, 6750], [6752, 6752], [6754, 6754], [6757, 6764], [6771, 6780], [6783, 6783], [6832, 6846], [6912, 6915], [6964, 6964], [6966, 6970], [6972, 6972], [6978, 6978], [7019, 7027], [7040, 7041], [7074, 7077], [7080, 7081], [7083, 7085], [7142, 7142], [7144, 7145], [7149, 7149], [7151, 7153], [7212, 7219], [7222, 7223], [7376, 7378], [7380, 7392], [7394, 7400], [7405, 7405], [7412, 7412], [7416, 7417], [7616, 7673], [7675, 7679], [8203, 8207], [8234, 8238], [8288, 8292], [8294, 8303], [8400, 8432], [11503, 11505], [11647, 11647], [11744, 11775], [12330, 12333], [12441, 12442], [42607, 42610], [42612, 42621], [42654, 42655], [42736, 42737], [43010, 43010], [43014, 43014], [43019, 43019], [43045, 43046], [43204, 43205], [43232, 43249], [43263, 43263], [43302, 43309], [43335, 43345], [43392, 43394], [43443, 43443], [43446, 43449], [43452, 43453], [43493, 43493], [43561, 43566], [43569, 43570], [43573, 43574], [43587, 43587], [43596, 43596], [43644, 43644], [43696, 43696], [43698, 43700], [43703, 43704], [43710, 43711], [43713, 43713], [43756, 43757], [43766, 43766], [44005, 44005], [44008, 44008], [44013, 44013], [64286, 64286], [65024, 65039], [65056, 65071], [65279, 65279], [65529, 65531]],
  addon_unicode11_lt = [[66045, 66045], [66272, 66272], [66422, 66426], [68097, 68099], [68101, 68102], [68108, 68111], [68152, 68154], [68159, 68159], [68325, 68326], [68900, 68903], [69446, 69456], [69633, 69633], [69688, 69702], [69759, 69761], [69811, 69814], [69817, 69818], [69821, 69821], [69837, 69837], [69888, 69890], [69927, 69931], [69933, 69940], [70003, 70003], [70016, 70017], [70070, 70078], [70089, 70092], [70191, 70193], [70196, 70196], [70198, 70199], [70206, 70206], [70367, 70367], [70371, 70378], [70400, 70401], [70459, 70460], [70464, 70464], [70502, 70508], [70512, 70516], [70712, 70719], [70722, 70724], [70726, 70726], [70750, 70750], [70835, 70840], [70842, 70842], [70847, 70848], [70850, 70851], [71090, 71093], [71100, 71101], [71103, 71104], [71132, 71133], [71219, 71226], [71229, 71229], [71231, 71232], [71339, 71339], [71341, 71341], [71344, 71349], [71351, 71351], [71453, 71455], [71458, 71461], [71463, 71467], [71727, 71735], [71737, 71738], [72148, 72151], [72154, 72155], [72160, 72160], [72193, 72202], [72243, 72248], [72251, 72254], [72263, 72263], [72273, 72278], [72281, 72283], [72330, 72342], [72344, 72345], [72752, 72758], [72760, 72765], [72767, 72767], [72850, 72871], [72874, 72880], [72882, 72883], [72885, 72886], [73009, 73014], [73018, 73018], [73020, 73021], [73023, 73029], [73031, 73031], [73104, 73105], [73109, 73109], [73111, 73111], [73459, 73460], [78896, 78904], [92912, 92916], [92976, 92982], [94031, 94031], [94095, 94098], [113821, 113822], [113824, 113827], [119143, 119145], [119155, 119170], [119173, 119179], [119210, 119213], [119362, 119364], [121344, 121398], [121403, 121452], [121461, 121461], [121476, 121476], [121499, 121503], [121505, 121519], [122880, 122886], [122888, 122904], [122907, 122913], [122915, 122916], [122918, 122922], [123184, 123190], [123628, 123631], [125136, 125142], [125252, 125258], [917505, 917505], [917536, 917631], [917760, 917999]],
  addon_unicode11_ge = [[4352, 4447], [8986, 8987], [9001, 9002], [9193, 9196], [9200, 9200], [9203, 9203], [9725, 9726], [9748, 9749], [9800, 9811], [9855, 9855], [9875, 9875], [9889, 9889], [9898, 9899], [9917, 9918], [9924, 9925], [9934, 9934], [9940, 9940], [9962, 9962], [9970, 9971], [9973, 9973], [9978, 9978], [9981, 9981], [9989, 9989], [9994, 9995], [10024, 10024], [10060, 10060], [10062, 10062], [10067, 10069], [10071, 10071], [10133, 10135], [10160, 10160], [10175, 10175], [11035, 11036], [11088, 11088], [11093, 11093], [11904, 11929], [11931, 12019], [12032, 12245], [12272, 12283], [12288, 12329], [12334, 12350], [12353, 12438], [12443, 12543], [12549, 12591], [12593, 12686], [12688, 12730], [12736, 12771], [12784, 12830], [12832, 12871], [12880, 19903], [19968, 42124], [42128, 42182], [43360, 43388], [44032, 55203], [63744, 64255], [65040, 65049], [65072, 65106], [65108, 65126], [65128, 65131], [65281, 65376], [65504, 65510]],
  addon_unicode11_xt = [[94176, 94179], [94208, 100343], [100352, 101106], [110592, 110878], [110928, 110930], [110948, 110951], [110960, 111355], [126980, 126980], [127183, 127183], [127374, 127374], [127377, 127386], [127488, 127490], [127504, 127547], [127552, 127560], [127568, 127569], [127584, 127589], [127744, 127776], [127789, 127797], [127799, 127868], [127870, 127891], [127904, 127946], [127951, 127955], [127968, 127984], [127988, 127988], [127992, 128062], [128064, 128064], [128066, 128252], [128255, 128317], [128331, 128334], [128336, 128359], [128378, 128378], [128405, 128406], [128420, 128420], [128507, 128591], [128640, 128709], [128716, 128716], [128720, 128722], [128725, 128725], [128747, 128748], [128756, 128762], [128992, 129003], [129293, 129393], [129395, 129398], [129402, 129442], [129445, 129450], [129454, 129482], [129485, 129535], [129648, 129651], [129656, 129658], [129664, 129666], [129680, 129685], [131072, 196605], [196608, 262141]],
  addon_unicode11_I;
function addon_unicode11_je(r, e) {
  let t = 0,
    n = e.length - 1,
    o;
  if (r < e[0][0] || r > e[n][1]) return !1;
  for (; n >= t;) if (o = t + n >> 1, r > e[o][1]) t = o + 1;else if (r < e[o][0]) n = o - 1;else return !0;
  return !1;
}
var addon_unicode11_se = class {
  constructor() {
    this.version = "11";
    if (!addon_unicode11_I) {
      addon_unicode11_I = new Uint8Array(65536), addon_unicode11_I.fill(1), addon_unicode11_I[0] = 0, addon_unicode11_I.fill(0, 1, 32), addon_unicode11_I.fill(0, 127, 160);
      for (let e = 0; e < addon_unicode11_ye.length; ++e) addon_unicode11_I.fill(0, addon_unicode11_ye[e][0], addon_unicode11_ye[e][1] + 1);
      for (let e = 0; e < addon_unicode11_ge.length; ++e) addon_unicode11_I.fill(2, addon_unicode11_ge[e][0], addon_unicode11_ge[e][1] + 1);
    }
  }
  wcwidth(e) {
    return e < 32 ? 0 : e < 127 ? 1 : e < 65536 ? addon_unicode11_I[e] : addon_unicode11_je(e, addon_unicode11_lt) ? 0 : addon_unicode11_je(e, addon_unicode11_xt) ? 2 : 1;
  }
  charProperties(e, t) {
    let n = this.wcwidth(e),
      o = n === 0 && t !== 0;
    if (o) {
      let d = addon_unicode11_w.extractWidth(t);
      d === 0 ? o = !1 : d > n && (n = d);
    }
    return addon_unicode11_w.createPropertyValue(0, n, o);
  }
};
var addon_unicode11_Ke = class {
  activate(e) {
    e.unicode.register(new addon_unicode11_se());
  }
  dispose() {}
};

;// ./node_modules/@xterm/addon-serialize/lib/addon-serialize.mjs
/**
 * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
 * @license MIT
 *
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * @license MIT
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
var addon_serialize_m = 0,
  addon_serialize_p = 0,
  addon_serialize_g = 0,
  addon_serialize_b = 0;
var addon_serialize_I;
(r => {
  function u(t, a, s, i) {
    return i !== void 0 ? `#${addon_serialize_B(t)}${addon_serialize_B(a)}${addon_serialize_B(s)}${addon_serialize_B(i)}` : `#${addon_serialize_B(t)}${addon_serialize_B(a)}${addon_serialize_B(s)}`;
  }
  r.toCss = u;
  function o(t, a, s, i = 255) {
    return (t << 24 | a << 16 | s << 8 | i) >>> 0;
  }
  r.toRgba = o;
  function e(t, a, s, i) {
    return {
      css: r.toCss(t, a, s, i),
      rgba: r.toRgba(t, a, s, i)
    };
  }
  r.toColor = e;
})(addon_serialize_I ||= {});
var addon_serialize_$;
(i => {
  function u(n, l) {
    if (addon_serialize_b = (l.rgba & 255) / 255, addon_serialize_b === 1) return {
      css: l.css,
      rgba: l.rgba
    };
    let f = l.rgba >> 24 & 255,
      d = l.rgba >> 16 & 255,
      c = l.rgba >> 8 & 255,
      C = n.rgba >> 24 & 255,
      h = n.rgba >> 16 & 255,
      x = n.rgba >> 8 & 255;
    addon_serialize_m = C + Math.round((f - C) * addon_serialize_b), addon_serialize_p = h + Math.round((d - h) * addon_serialize_b), addon_serialize_g = x + Math.round((c - x) * addon_serialize_b);
    let R = addon_serialize_I.toCss(addon_serialize_m, addon_serialize_p, addon_serialize_g),
      L = addon_serialize_I.toRgba(addon_serialize_m, addon_serialize_p, addon_serialize_g);
    return {
      css: R,
      rgba: L
    };
  }
  i.blend = u;
  function o(n) {
    return (n.rgba & 255) === 255;
  }
  i.isOpaque = o;
  function e(n, l, f) {
    let d = addon_serialize_y.ensureContrastRatio(n.rgba, l.rgba, f);
    if (d) return addon_serialize_I.toColor(d >> 24 & 255, d >> 16 & 255, d >> 8 & 255);
  }
  i.ensureContrastRatio = e;
  function r(n) {
    let l = (n.rgba | 255) >>> 0;
    return [addon_serialize_m, addon_serialize_p, addon_serialize_g] = addon_serialize_y.toChannels(l), {
      css: addon_serialize_I.toCss(addon_serialize_m, addon_serialize_p, addon_serialize_g),
      rgba: l
    };
  }
  i.opaque = r;
  function t(n, l) {
    return addon_serialize_b = Math.round(l * 255), [addon_serialize_m, addon_serialize_p, addon_serialize_g] = addon_serialize_y.toChannels(n.rgba), {
      css: addon_serialize_I.toCss(addon_serialize_m, addon_serialize_p, addon_serialize_g, addon_serialize_b),
      rgba: addon_serialize_I.toRgba(addon_serialize_m, addon_serialize_p, addon_serialize_g, addon_serialize_b)
    };
  }
  i.opacity = t;
  function a(n, l) {
    return addon_serialize_b = n.rgba & 255, t(n, addon_serialize_b * l / 255);
  }
  i.multiplyOpacity = a;
  function s(n) {
    return [n.rgba >> 24 & 255, n.rgba >> 16 & 255, n.rgba >> 8 & 255];
  }
  i.toColorRGB = s;
})(addon_serialize_$ ||= {});
var addon_serialize_;
(r => {
  let u, o;
  try {
    let t = document.createElement("canvas");
    t.width = 1, t.height = 1;
    let a = t.getContext("2d", {
      willReadFrequently: !0
    });
    a && (u = a, u.globalCompositeOperation = "copy", o = u.createLinearGradient(0, 0, 1, 1));
  } catch {}
  function e(t) {
    if (t.match(/#[\da-f]{3,8}/i)) switch (t.length) {
      case 4:
        return addon_serialize_m = parseInt(t.slice(1, 2).repeat(2), 16), addon_serialize_p = parseInt(t.slice(2, 3).repeat(2), 16), addon_serialize_g = parseInt(t.slice(3, 4).repeat(2), 16), addon_serialize_I.toColor(addon_serialize_m, addon_serialize_p, addon_serialize_g);
      case 5:
        return addon_serialize_m = parseInt(t.slice(1, 2).repeat(2), 16), addon_serialize_p = parseInt(t.slice(2, 3).repeat(2), 16), addon_serialize_g = parseInt(t.slice(3, 4).repeat(2), 16), addon_serialize_b = parseInt(t.slice(4, 5).repeat(2), 16), addon_serialize_I.toColor(addon_serialize_m, addon_serialize_p, addon_serialize_g, addon_serialize_b);
      case 7:
        return {
          css: t,
          rgba: (parseInt(t.slice(1), 16) << 8 | 255) >>> 0
        };
      case 9:
        return {
          css: t,
          rgba: parseInt(t.slice(1), 16) >>> 0
        };
    }
    let a = t.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);
    if (a) return addon_serialize_m = parseInt(a[1]), addon_serialize_p = parseInt(a[2]), addon_serialize_g = parseInt(a[3]), addon_serialize_b = Math.round((a[5] === void 0 ? 1 : parseFloat(a[5])) * 255), addon_serialize_I.toColor(addon_serialize_m, addon_serialize_p, addon_serialize_g, addon_serialize_b);
    if (!u || !o) throw new Error("css.toColor: Unsupported css format");
    if (u.fillStyle = o, u.fillStyle = t, typeof u.fillStyle != "string") throw new Error("css.toColor: Unsupported css format");
    if (u.fillRect(0, 0, 1, 1), [addon_serialize_m, addon_serialize_p, addon_serialize_g, addon_serialize_b] = u.getImageData(0, 0, 1, 1).data, addon_serialize_b !== 255) throw new Error("css.toColor: Unsupported css format");
    return {
      rgba: addon_serialize_I.toRgba(addon_serialize_m, addon_serialize_p, addon_serialize_g, addon_serialize_b),
      css: t
    };
  }
  r.toColor = e;
})(addon_serialize_ ||= {});
var addon_serialize_v;
(e => {
  function u(r) {
    return o(r >> 16 & 255, r >> 8 & 255, r & 255);
  }
  e.relativeLuminance = u;
  function o(r, t, a) {
    let s = r / 255,
      i = t / 255,
      n = a / 255,
      l = s <= .03928 ? s / 12.92 : Math.pow((s + .055) / 1.055, 2.4),
      f = i <= .03928 ? i / 12.92 : Math.pow((i + .055) / 1.055, 2.4),
      d = n <= .03928 ? n / 12.92 : Math.pow((n + .055) / 1.055, 2.4);
    return l * .2126 + f * .7152 + d * .0722;
  }
  e.relativeLuminance2 = o;
})(addon_serialize_v ||= {});
var addon_serialize_y;
(a => {
  function u(s, i) {
    if (addon_serialize_b = (i & 255) / 255, addon_serialize_b === 1) return i;
    let n = i >> 24 & 255,
      l = i >> 16 & 255,
      f = i >> 8 & 255,
      d = s >> 24 & 255,
      c = s >> 16 & 255,
      C = s >> 8 & 255;
    return addon_serialize_m = d + Math.round((n - d) * addon_serialize_b), addon_serialize_p = c + Math.round((l - c) * addon_serialize_b), addon_serialize_g = C + Math.round((f - C) * addon_serialize_b), addon_serialize_I.toRgba(addon_serialize_m, addon_serialize_p, addon_serialize_g);
  }
  a.blend = u;
  function o(s, i, n) {
    let l = addon_serialize_v.relativeLuminance(s >> 8),
      f = addon_serialize_v.relativeLuminance(i >> 8);
    if (addon_serialize_F(l, f) < n) {
      if (f < l) {
        let h = e(s, i, n),
          x = addon_serialize_F(l, addon_serialize_v.relativeLuminance(h >> 8));
        if (x < n) {
          let R = r(s, i, n),
            L = addon_serialize_F(l, addon_serialize_v.relativeLuminance(R >> 8));
          return x > L ? h : R;
        }
        return h;
      }
      let c = r(s, i, n),
        C = addon_serialize_F(l, addon_serialize_v.relativeLuminance(c >> 8));
      if (C < n) {
        let h = e(s, i, n),
          x = addon_serialize_F(l, addon_serialize_v.relativeLuminance(h >> 8));
        return C > x ? c : h;
      }
      return c;
    }
  }
  a.ensureContrastRatio = o;
  function e(s, i, n) {
    let l = s >> 24 & 255,
      f = s >> 16 & 255,
      d = s >> 8 & 255,
      c = i >> 24 & 255,
      C = i >> 16 & 255,
      h = i >> 8 & 255,
      x = addon_serialize_F(addon_serialize_v.relativeLuminance2(c, C, h), addon_serialize_v.relativeLuminance2(l, f, d));
    for (; x < n && (c > 0 || C > 0 || h > 0);) c -= Math.max(0, Math.ceil(c * .1)), C -= Math.max(0, Math.ceil(C * .1)), h -= Math.max(0, Math.ceil(h * .1)), x = addon_serialize_F(addon_serialize_v.relativeLuminance2(c, C, h), addon_serialize_v.relativeLuminance2(l, f, d));
    return (c << 24 | C << 16 | h << 8 | 255) >>> 0;
  }
  a.reduceLuminance = e;
  function r(s, i, n) {
    let l = s >> 24 & 255,
      f = s >> 16 & 255,
      d = s >> 8 & 255,
      c = i >> 24 & 255,
      C = i >> 16 & 255,
      h = i >> 8 & 255,
      x = addon_serialize_F(addon_serialize_v.relativeLuminance2(c, C, h), addon_serialize_v.relativeLuminance2(l, f, d));
    for (; x < n && (c < 255 || C < 255 || h < 255);) c = Math.min(255, c + Math.ceil((255 - c) * .1)), C = Math.min(255, C + Math.ceil((255 - C) * .1)), h = Math.min(255, h + Math.ceil((255 - h) * .1)), x = addon_serialize_F(addon_serialize_v.relativeLuminance2(c, C, h), addon_serialize_v.relativeLuminance2(l, f, d));
    return (c << 24 | C << 16 | h << 8 | 255) >>> 0;
  }
  a.increaseLuminance = r;
  function t(s) {
    return [s >> 24 & 255, s >> 16 & 255, s >> 8 & 255, s & 255];
  }
  a.toChannels = t;
})(addon_serialize_y ||= {});
function addon_serialize_B(u) {
  let o = u.toString(16);
  return o.length < 2 ? "0" + o : o;
}
function addon_serialize_F(u, o) {
  return u < o ? (o + .05) / (u + .05) : (u + .05) / (o + .05);
}
var addon_serialize_E = Object.freeze((() => {
  let u = [addon_serialize_.toColor("#2e3436"), addon_serialize_.toColor("#cc0000"), addon_serialize_.toColor("#4e9a06"), addon_serialize_.toColor("#c4a000"), addon_serialize_.toColor("#3465a4"), addon_serialize_.toColor("#75507b"), addon_serialize_.toColor("#06989a"), addon_serialize_.toColor("#d3d7cf"), addon_serialize_.toColor("#555753"), addon_serialize_.toColor("#ef2929"), addon_serialize_.toColor("#8ae234"), addon_serialize_.toColor("#fce94f"), addon_serialize_.toColor("#729fcf"), addon_serialize_.toColor("#ad7fa8"), addon_serialize_.toColor("#34e2e2"), addon_serialize_.toColor("#eeeeec")],
    o = [0, 95, 135, 175, 215, 255];
  for (let e = 0; e < 216; e++) {
    let r = o[e / 36 % 6 | 0],
      t = o[e / 6 % 6 | 0],
      a = o[e % 6];
    u.push({
      css: addon_serialize_I.toCss(r, t, a),
      rgba: addon_serialize_I.toRgba(r, t, a)
    });
  }
  for (let e = 0; e < 24; e++) {
    let r = 8 + e * 10;
    u.push({
      css: addon_serialize_I.toCss(r, r, r),
      rgba: addon_serialize_I.toRgba(r, r, r)
    });
  }
  return u;
})());
function addon_serialize_A(u, o, e) {
  return Math.max(o, Math.min(u, e));
}
function addon_serialize_O(u) {
  switch (u) {
    case "&":
      return "&amp;";
    case "<":
      return "&lt;";
  }
  return u;
}
var addon_serialize_S = class {
  constructor(o) {
    this._buffer = o;
  }
  serialize(o, e) {
    let r = this._buffer.getNullCell(),
      t = this._buffer.getNullCell(),
      a = r,
      s = o.start.y,
      i = o.end.y,
      n = o.start.x,
      l = o.end.x;
    this._beforeSerialize(i - s, s, i);
    for (let f = s; f <= i; f++) {
      let d = this._buffer.getLine(f);
      if (d) {
        let c = f === o.start.y ? n : 0,
          C = f === o.end.y ? l : d.length;
        for (let h = c; h < C; h++) {
          let x = d.getCell(h, a === r ? t : r);
          if (!x) {
            console.warn(`Can't get cell at row=${f}, col=${h}`);
            continue;
          }
          this._nextCell(x, a, f, h), a = x;
        }
      }
      this._rowEnd(f, f === i);
    }
    return this._afterSerialize(), this._serializeString(e);
  }
  _nextCell(o, e, r, t) {}
  _rowEnd(o, e) {}
  _beforeSerialize(o, e, r) {}
  _afterSerialize() {}
  _serializeString(o) {
    return "";
  }
};
function addon_serialize_T(u, o) {
  return u.getFgColorMode() === o.getFgColorMode() && u.getFgColor() === o.getFgColor();
}
function addon_serialize_w(u, o) {
  return u.getBgColorMode() === o.getBgColorMode() && u.getBgColor() === o.getBgColor();
}
function addon_serialize_z(u, o) {
  return u.isInverse() === o.isInverse() && u.isBold() === o.isBold() && u.isUnderline() === o.isUnderline() && u.isOverline() === o.isOverline() && u.isBlink() === o.isBlink() && u.isInvisible() === o.isInvisible() && u.isItalic() === o.isItalic() && u.isDim() === o.isDim() && u.isStrikethrough() === o.isStrikethrough();
}
var addon_serialize_k = class extends addon_serialize_S {
    constructor(e, r) {
      super(e);
      this._terminal = r;
      this._rowIndex = 0;
      this._allRows = new Array();
      this._allRowSeparators = new Array();
      this._currentRow = "";
      this._nullCellCount = 0;
      this._cursorStyle = this._buffer.getNullCell();
      this._cursorStyleRow = 0;
      this._cursorStyleCol = 0;
      this._backgroundCell = this._buffer.getNullCell();
      this._firstRow = 0;
      this._lastCursorRow = 0;
      this._lastCursorCol = 0;
      this._lastContentCursorRow = 0;
      this._lastContentCursorCol = 0;
      this._thisRowLastChar = this._buffer.getNullCell();
      this._thisRowLastSecondChar = this._buffer.getNullCell();
      this._nextRowFirstChar = this._buffer.getNullCell();
    }
    _beforeSerialize(e, r, t) {
      this._allRows = new Array(e), this._lastContentCursorRow = r, this._lastCursorRow = r, this._firstRow = r;
    }
    _rowEnd(e, r) {
      this._nullCellCount > 0 && !addon_serialize_w(this._cursorStyle, this._backgroundCell) && (this._currentRow += `\x1B[${this._nullCellCount}X`);
      let t = "";
      if (!r) {
        e - this._firstRow >= this._terminal.rows && this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol, this._backgroundCell);
        let a = this._buffer.getLine(e),
          s = this._buffer.getLine(e + 1);
        if (!s.isWrapped) t = `\r
`, this._lastCursorRow = e + 1, this._lastCursorCol = 0;else {
          t = "";
          let i = a.getCell(a.length - 1, this._thisRowLastChar),
            n = a.getCell(a.length - 2, this._thisRowLastSecondChar),
            l = s.getCell(0, this._nextRowFirstChar),
            f = l.getWidth() > 1,
            d = !1;
          (l.getChars() && f ? this._nullCellCount <= 1 : this._nullCellCount <= 0) && ((i.getChars() || i.getWidth() === 0) && addon_serialize_w(i, l) && (d = !0), f && (n.getChars() || n.getWidth() === 0) && addon_serialize_w(i, l) && addon_serialize_w(n, l) && (d = !0)), d || (t = "-".repeat(this._nullCellCount + 1), t += "\x1B[1D\x1B[1X", this._nullCellCount > 0 && (t += "\x1B[A", t += `\x1B[${a.length - this._nullCellCount}C`, t += `\x1B[${this._nullCellCount}X`, t += `\x1B[${a.length - this._nullCellCount}D`, t += "\x1B[B"), this._lastContentCursorRow = e + 1, this._lastContentCursorCol = 0, this._lastCursorRow = e + 1, this._lastCursorCol = 0);
        }
      }
      this._allRows[this._rowIndex] = this._currentRow, this._allRowSeparators[this._rowIndex++] = t, this._currentRow = "", this._nullCellCount = 0;
    }
    _diffStyle(e, r) {
      let t = [],
        a = !addon_serialize_T(e, r),
        s = !addon_serialize_w(e, r),
        i = !addon_serialize_z(e, r);
      if (a || s || i) if (e.isAttributeDefault()) r.isAttributeDefault() || t.push(0);else {
        if (a) {
          let n = e.getFgColor();
          e.isFgRGB() ? t.push(38, 2, n >>> 16 & 255, n >>> 8 & 255, n & 255) : e.isFgPalette() ? n >= 16 ? t.push(38, 5, n) : t.push(n & 8 ? 90 + (n & 7) : 30 + (n & 7)) : t.push(39);
        }
        if (s) {
          let n = e.getBgColor();
          e.isBgRGB() ? t.push(48, 2, n >>> 16 & 255, n >>> 8 & 255, n & 255) : e.isBgPalette() ? n >= 16 ? t.push(48, 5, n) : t.push(n & 8 ? 100 + (n & 7) : 40 + (n & 7)) : t.push(49);
        }
        i && (e.isInverse() !== r.isInverse() && t.push(e.isInverse() ? 7 : 27), e.isBold() !== r.isBold() && t.push(e.isBold() ? 1 : 22), e.isUnderline() !== r.isUnderline() && t.push(e.isUnderline() ? 4 : 24), e.isOverline() !== r.isOverline() && t.push(e.isOverline() ? 53 : 55), e.isBlink() !== r.isBlink() && t.push(e.isBlink() ? 5 : 25), e.isInvisible() !== r.isInvisible() && t.push(e.isInvisible() ? 8 : 28), e.isItalic() !== r.isItalic() && t.push(e.isItalic() ? 3 : 23), e.isDim() !== r.isDim() && t.push(e.isDim() ? 2 : 22), e.isStrikethrough() !== r.isStrikethrough() && t.push(e.isStrikethrough() ? 9 : 29));
      }
      return t;
    }
    _nextCell(e, r, t, a) {
      if (e.getWidth() === 0) return;
      let i = e.getChars() === "",
        n = this._diffStyle(e, this._cursorStyle);
      if (i ? !addon_serialize_w(this._cursorStyle, e) : n.length > 0) {
        this._nullCellCount > 0 && (addon_serialize_w(this._cursorStyle, this._backgroundCell) || (this._currentRow += `\x1B[${this._nullCellCount}X`), this._currentRow += `\x1B[${this._nullCellCount}C`, this._nullCellCount = 0), this._lastContentCursorRow = this._lastCursorRow = t, this._lastContentCursorCol = this._lastCursorCol = a, this._currentRow += `\x1B[${n.join(";")}m`;
        let f = this._buffer.getLine(t);
        f !== void 0 && (f.getCell(a, this._cursorStyle), this._cursorStyleRow = t, this._cursorStyleCol = a);
      }
      i ? this._nullCellCount += e.getWidth() : (this._nullCellCount > 0 && (addon_serialize_w(this._cursorStyle, this._backgroundCell) ? this._currentRow += `\x1B[${this._nullCellCount}C` : (this._currentRow += `\x1B[${this._nullCellCount}X`, this._currentRow += `\x1B[${this._nullCellCount}C`), this._nullCellCount = 0), this._currentRow += e.getChars(), this._lastContentCursorRow = this._lastCursorRow = t, this._lastContentCursorCol = this._lastCursorCol = a + e.getWidth());
    }
    _serializeString(e) {
      let r = this._allRows.length;
      this._buffer.length - this._firstRow <= this._terminal.rows && (r = this._lastContentCursorRow + 1 - this._firstRow, this._lastCursorCol = this._lastContentCursorCol, this._lastCursorRow = this._lastContentCursorRow);
      let t = "";
      for (let i = 0; i < r; i++) t += this._allRows[i], i + 1 < r && (t += this._allRowSeparators[i]);
      if (!e) {
        let i = this._buffer.baseY + this._buffer.cursorY,
          n = this._buffer.cursorX,
          l = i !== this._lastCursorRow || n !== this._lastCursorCol,
          f = c => {
            c > 0 ? t += `\x1B[${c}C` : c < 0 && (t += `\x1B[${-c}D`);
          };
        l && ((c => {
          c > 0 ? t += `\x1B[${c}B` : c < 0 && (t += `\x1B[${-c}A`);
        })(i - this._lastCursorRow), f(n - this._lastCursorCol));
      }
      let a = this._terminal._core._inputHandler._curAttrData,
        s = this._diffStyle(a, this._cursorStyle);
      return s.length > 0 && (t += `\x1B[${s.join(";")}m`), t;
    }
  },
  addon_serialize_D = class {
    activate(o) {
      this._terminal = o;
    }
    _serializeBufferByScrollback(o, e, r) {
      let t = e.length,
        a = r === void 0 ? t : addon_serialize_A(r + o.rows, 0, t);
      return this._serializeBufferByRange(o, e, {
        start: t - a,
        end: t - 1
      }, !1);
    }
    _serializeBufferByRange(o, e, r, t) {
      return new addon_serialize_k(e, o).serialize({
        start: {
          x: 0,
          y: typeof r.start == "number" ? r.start : r.start.line
        },
        end: {
          x: o.cols,
          y: typeof r.end == "number" ? r.end : r.end.line
        }
      }, t);
    }
    _serializeBufferAsHTML(o, e) {
      let r = o.buffer.active,
        t = new addon_serialize_M(r, o, e),
        a = e.onlySelection ?? !1,
        s = e.range;
      if (s) return t.serialize({
        start: {
          x: s.startCol,
          y: (typeof s.startLine == "number", s.startLine)
        },
        end: {
          x: o.cols,
          y: (typeof s.endLine == "number", s.endLine)
        }
      });
      if (!a) {
        let n = r.length,
          l = e.scrollback,
          f = l === void 0 ? n : addon_serialize_A(l + o.rows, 0, n);
        return t.serialize({
          start: {
            x: 0,
            y: n - f
          },
          end: {
            x: o.cols,
            y: n - 1
          }
        });
      }
      let i = this._terminal?.getSelectionPosition();
      return i !== void 0 ? t.serialize({
        start: {
          x: i.start.x,
          y: i.start.y
        },
        end: {
          x: i.end.x,
          y: i.end.y
        }
      }) : "";
    }
    _serializeModes(o) {
      let e = "",
        r = o.modes;
      if (r.applicationCursorKeysMode && (e += "\x1B[?1h"), r.applicationKeypadMode && (e += "\x1B[?66h"), r.bracketedPasteMode && (e += "\x1B[?2004h"), r.insertMode && (e += "\x1B[4h"), r.originMode && (e += "\x1B[?6h"), r.reverseWraparoundMode && (e += "\x1B[?45h"), r.sendFocusMode && (e += "\x1B[?1004h"), r.wraparoundMode === !1 && (e += "\x1B[?7l"), r.mouseTrackingMode !== "none") switch (r.mouseTrackingMode) {
        case "x10":
          e += "\x1B[?9h";
          break;
        case "vt200":
          e += "\x1B[?1000h";
          break;
        case "drag":
          e += "\x1B[?1002h";
          break;
        case "any":
          e += "\x1B[?1003h";
          break;
      }
      return e;
    }
    serialize(o) {
      if (!this._terminal) throw new Error("Cannot use addon until it has been loaded");
      let e = o?.range ? this._serializeBufferByRange(this._terminal, this._terminal.buffer.normal, o.range, !0) : this._serializeBufferByScrollback(this._terminal, this._terminal.buffer.normal, o?.scrollback);
      if (!o?.excludeAltBuffer && this._terminal.buffer.active.type === "alternate") {
        let r = this._serializeBufferByScrollback(this._terminal, this._terminal.buffer.alternate, void 0);
        e += `\x1B[?1049h\x1B[H${r}`;
      }
      return o?.excludeModes || (e += this._serializeModes(this._terminal)), e;
    }
    serializeAsHTML(o) {
      if (!this._terminal) throw new Error("Cannot use addon until it has been loaded");
      return this._serializeBufferAsHTML(this._terminal, o || {});
    }
    dispose() {}
  },
  addon_serialize_M = class extends addon_serialize_S {
    constructor(e, r, t) {
      super(e);
      this._terminal = r;
      this._options = t;
      this._currentRow = "";
      this._htmlContent = "";
      r._core._themeService ? this._ansiColors = r._core._themeService.colors.ansi : this._ansiColors = addon_serialize_E;
    }
    _padStart(e, r, t) {
      return r = r >> 0, t = t ?? " ", e.length > r ? e : (r -= e.length, r > t.length && (t += t.repeat(r / t.length)), t.slice(0, r) + e);
    }
    _beforeSerialize(e, r, t) {
      this._htmlContent += "<html><body><!--StartFragment--><pre>";
      let a = "#000000",
        s = "#ffffff";
      (this._options.includeGlobalBackground ?? !1) && (a = this._terminal.options.theme?.foreground ?? "#ffffff", s = this._terminal.options.theme?.background ?? "#000000");
      let i = [];
      i.push("color: " + a + ";"), i.push("background-color: " + s + ";"), i.push("font-family: " + this._terminal.options.fontFamily + ";"), i.push("font-size: " + this._terminal.options.fontSize + "px;"), this._htmlContent += "<div style='" + i.join(" ") + "'>";
    }
    _afterSerialize() {
      this._htmlContent += "</div>", this._htmlContent += "</pre><!--EndFragment--></body></html>";
    }
    _rowEnd(e, r) {
      this._htmlContent += "<div><span>" + this._currentRow + "</span></div>", this._currentRow = "";
    }
    _getHexColor(e, r) {
      let t = r ? e.getFgColor() : e.getBgColor();
      if (r ? e.isFgRGB() : e.isBgRGB()) return "#" + [t >> 16 & 255, t >> 8 & 255, t & 255].map(s => this._padStart(s.toString(16), 2, "0")).join("");
      if (r ? e.isFgPalette() : e.isBgPalette()) return this._ansiColors[t].css;
    }
    _diffStyle(e, r) {
      let t = [],
        a = !addon_serialize_T(e, r),
        s = !addon_serialize_w(e, r),
        i = !addon_serialize_z(e, r);
      if (a || s || i) {
        let n = this._getHexColor(e, !0);
        n && t.push("color: " + n + ";");
        let l = this._getHexColor(e, !1);
        return l && t.push("background-color: " + l + ";"), e.isInverse() && t.push("color: #000000; background-color: #BFBFBF;"), e.isBold() && t.push("font-weight: bold;"), e.isUnderline() && e.isOverline() ? t.push("text-decoration: overline underline;") : e.isUnderline() ? t.push("text-decoration: underline;") : e.isOverline() && t.push("text-decoration: overline;"), e.isBlink() && t.push("text-decoration: blink;"), e.isInvisible() && t.push("visibility: hidden;"), e.isItalic() && t.push("font-style: italic;"), e.isDim() && t.push("opacity: 0.5;"), e.isStrikethrough() && t.push("text-decoration: line-through;"), t;
      }
    }
    _nextCell(e, r, t, a) {
      if (e.getWidth() === 0) return;
      let i = e.getChars() === "",
        n = this._diffStyle(e, r);
      n && (this._currentRow += n.length === 0 ? "</span><span>" : "</span><span style='" + n.join(" ") + "'>"), i ? this._currentRow += " " : this._currentRow += addon_serialize_O(e.getChars());
    }
    _serializeString() {
      return this._htmlContent;
    }
  };

;// ./node_modules/@xterm/addon-image/lib/addon-image.mjs
/**
 * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
 * @license MIT
 *
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * @license MIT
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
var addon_image_st = Object.create;
var addon_image_be = Object.defineProperty;
var addon_image_nt = Object.getOwnPropertyDescriptor;
var addon_image_At = Object.getOwnPropertyNames;
var addon_image_ot = Object.getPrototypeOf,
  addon_image_at = Object.prototype.hasOwnProperty;
var addon_image_N = (r, e) => () => (e || r((e = {
  exports: {}
}).exports, e), e.exports);
var addon_image_lt = (r, e, t, i) => {
  if (e && typeof e == "object" || typeof e == "function") for (let s of addon_image_At(e)) !addon_image_at.call(r, s) && s !== t && addon_image_be(r, s, {
    get: () => e[s],
    enumerable: !(i = addon_image_nt(e, s)) || i.enumerable
  });
  return r;
};
var addon_image_Y = (r, e, t) => (t = r != null ? addon_image_st(addon_image_ot(r)) : {}, addon_image_lt(e || !r || !r.__esModule ? addon_image_be(t, "default", {
  value: r,
  enumerable: !0
}) : t, r));
var addon_image_W = addon_image_N(u => {
  "use strict";

  Object.defineProperty(u, "__esModule", {
    value: !0
  });
  u.DEFAULT_FOREGROUND = u.DEFAULT_BACKGROUND = u.PALETTE_ANSI_256 = u.PALETTE_VT340_GREY = u.PALETTE_VT340_COLOR = u.normalizeHLS = u.normalizeRGB = u.nearestColorIndex = u.fromRGBA8888 = u.toRGBA8888 = u.alpha = u.blue = u.green = u.red = u.BIG_ENDIAN = void 0;
  u.BIG_ENDIAN = new Uint8Array(new Uint32Array([4278190080]).buffer)[0] === 255;
  u.BIG_ENDIAN && console.warn("BE platform detected. This version of node-sixel works only on LE properly.");
  function we(r) {
    return r & 255;
  }
  u.red = we;
  function xe(r) {
    return r >>> 8 & 255;
  }
  u.green = xe;
  function ye(r) {
    return r >>> 16 & 255;
  }
  u.blue = ye;
  function ct(r) {
    return r >>> 24 & 255;
  }
  u.alpha = ct;
  function m(r, e, t, i = 255) {
    return ((i & 255) << 24 | (t & 255) << 16 | (e & 255) << 8 | r & 255) >>> 0;
  }
  u.toRGBA8888 = m;
  function dt(r) {
    return [r & 255, r >> 8 & 255, r >> 16 & 255, r >>> 24];
  }
  u.fromRGBA8888 = dt;
  function ht(r, e) {
    let t = we(r),
      i = xe(r),
      s = ye(r),
      n = Number.MAX_SAFE_INTEGER,
      A = -1;
    for (let o = 0; o < e.length; ++o) {
      let a = t - e[o][0],
        c = i - e[o][1],
        h = s - e[o][2],
        l = a * a + c * c + h * h;
      if (!l) return o;
      l < n && (n = l, A = o);
    }
    return A;
  }
  u.nearestColorIndex = ht;
  function de(r, e, t) {
    return Math.max(r, Math.min(t, e));
  }
  function he(r, e, t) {
    return t < 0 && (t += 1), t > 1 && (t -= 1), t * 6 < 1 ? e + (r - e) * 6 * t : t * 2 < 1 ? r : t * 3 < 2 ? e + (r - e) * (4 - t * 6) : e;
  }
  function gt(r, e, t) {
    if (!t) {
      let n = Math.round(e * 255);
      return m(n, n, n);
    }
    let i = e < .5 ? e * (1 + t) : e + t - e * t,
      s = 2 * e - i;
    return m(de(0, 255, Math.round(he(i, s, r + 1 / 3) * 255)), de(0, 255, Math.round(he(i, s, r) * 255)), de(0, 255, Math.round(he(i, s, r - 1 / 3) * 255)));
  }
  function g(r, e, t) {
    return (4278190080 | Math.round(t / 100 * 255) << 16 | Math.round(e / 100 * 255) << 8 | Math.round(r / 100 * 255)) >>> 0;
  }
  u.normalizeRGB = g;
  function ut(r, e, t) {
    return gt((r + 240 % 360) / 360, e / 100, t / 100);
  }
  u.normalizeHLS = ut;
  u.PALETTE_VT340_COLOR = new Uint32Array([g(0, 0, 0), g(20, 20, 80), g(80, 13, 13), g(20, 80, 20), g(80, 20, 80), g(20, 80, 80), g(80, 80, 20), g(53, 53, 53), g(26, 26, 26), g(33, 33, 60), g(60, 26, 26), g(33, 60, 33), g(60, 33, 60), g(33, 60, 60), g(60, 60, 33), g(80, 80, 80)]);
  u.PALETTE_VT340_GREY = new Uint32Array([g(0, 0, 0), g(13, 13, 13), g(26, 26, 26), g(40, 40, 40), g(6, 6, 6), g(20, 20, 20), g(33, 33, 33), g(46, 46, 46), g(0, 0, 0), g(13, 13, 13), g(26, 26, 26), g(40, 40, 40), g(6, 6, 6), g(20, 20, 20), g(33, 33, 33), g(46, 46, 46)]);
  u.PALETTE_ANSI_256 = (() => {
    let r = [m(0, 0, 0), m(205, 0, 0), m(0, 205, 0), m(205, 205, 0), m(0, 0, 238), m(205, 0, 205), m(0, 250, 205), m(229, 229, 229), m(127, 127, 127), m(255, 0, 0), m(0, 255, 0), m(255, 255, 0), m(92, 92, 255), m(255, 0, 255), m(0, 255, 255), m(255, 255, 255)],
      e = [0, 95, 135, 175, 215, 255];
    for (let t = 0; t < 6; ++t) for (let i = 0; i < 6; ++i) for (let s = 0; s < 6; ++s) r.push(m(e[t], e[i], e[s]));
    for (let t = 8; t <= 238; t += 10) r.push(m(t, t, t));
    return new Uint32Array(r);
  })();
  u.DEFAULT_BACKGROUND = m(0, 0, 0, 255);
  u.DEFAULT_FOREGROUND = m(255, 255, 255, 255);
});
var addon_image_Ke = addon_image_N(re => {
  "use strict";

  Object.defineProperty(re, "__esModule", {
    value: !0
  });
  re.InWasm = void 0;
  function R(r) {
    if (typeof Buffer < "u") return Buffer.from(r, "base64");
    let e = atob(r),
      t = new Uint8Array(e.length);
    for (let i = 0; i < t.length; ++i) t[i] = e.charCodeAt(i);
    return t;
  }
  function Tt(r) {
    if (r.d) {
      let {
          t: e,
          s: t,
          d: i
        } = r,
        s,
        n,
        A = WebAssembly;
      return e === 2 ? t ? () => s || (s = R(i)) : () => Promise.resolve(s || (s = R(i))) : e === 1 ? t ? () => n || (n = new A.Module(s || (s = R(i)))) : () => n ? Promise.resolve(n) : A.compile(s || (s = R(i))).then(o => n = o) : t ? o => new A.Instance(n || (n = new A.Module(s || (s = R(i)))), o) : o => n ? A.instantiate(n, o) : A.instantiate(s || (s = R(i)), o).then(a => (n = a.module) && a.instance);
    }
    if (typeof _wasmCtx > "u") throw new Error('must run "inwasm"');
    _wasmCtx.add(r);
  }
  re.InWasm = Tt;
});
var addon_image_Oe = addon_image_N(Ce => {
  "use strict";

  Object.defineProperty(Ce, "__esModule", {
    value: !0
  });
  var bt = addon_image_Ke(),
    wt = (0, bt.InWasm)({
      s: 1,
      t: 0,
      d: "AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqxAwKuAQEFf0GIKCgCAEGgKGohAUGEKCgCACIAQYAoKAIAQQFrQXxxIgJIBEAgAkGgKGohAyAAQaAoaiEAA0AgAC0AA0ECdCgCgCAgAC0AAkECdCgCgBggAC0AAUECdCgCgBAgAC0AAEECdCgCgAhycnIiBEH///8HSwRAQQEPCyABIAQ2AgAgAUEDaiEBIABBBGoiACADSQ0ACwtBhCggAjYCAEGIKCABQaAoazYCAEEAC/4BAQZ/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQQEhAxAADQFBgCgoAgAhAUGEKCgCACEAC0EBIQMgASAAayIEQQJIDQAgAEGhKGotAABBAnQoAoAQIABBoChqLQAAQQJ0KAKACHIhAQJAIARBAkYEQEEBIQIMAQtBASECIAAtAKIoIgVBPUcEQEECIQIgBUECdCgCgBggAXIhAQsgBEEERw0AIAAtAKMoIgBBPUYNACACQQFqIQIgAEECdCgCgCAgAXIhAQsgAUH///8HSw0AQYgoKAIAQaAoaiABNgIAQYgoQYgoKAIAIAJqIgA2AgAgAEGQKCgCAEchAwsgAwsAdglwcm9kdWNlcnMBDHByb2Nlc3NlZC1ieQEFY2xhbmdWMTguMC4wIChodHRwczovL2dpdGh1Yi5jb20vbGx2bS9sbHZtLXByb2plY3QgZDFlNjg1ZGY0NWRjNTk0NGI0M2QyNTQ3ZDAxMzhjZDRhM2VlNGVmZSkALA90YXJnZXRfZmVhdHVyZXMCKw9tdXRhYmxlLWdsb2JhbHMrCHNpZ24tZXh0"
    }),
    x = new Uint8Array("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").map(r => r.charCodeAt(0))),
    L = new Uint32Array(1024);
  L.fill(4278190080);
  for (let r = 0; r < x.length; ++r) L[x[r]] = r << 2;
  for (let r = 0; r < x.length; ++r) L[256 + x[r]] = r >> 4 | (r << 4 & 255) << 8;
  for (let r = 0; r < x.length; ++r) L[512 + x[r]] = r >> 2 << 8 | (r << 6 & 255) << 16;
  for (let r = 0; r < x.length; ++r) L[768 + x[r]] = r << 16;
  var xt = new Uint8Array(0),
    me = class {
      constructor(e) {
        this.keepSize = e;
      }
      get data8() {
        return this._inst ? this._d.subarray(0, this._m32[1282]) : xt;
      }
      release() {
        this._inst && (this._mem.buffer.byteLength > this.keepSize ? this._inst = this._m32 = this._d = this._mem = null : (this._m32[1280] = 0, this._m32[1281] = 0, this._m32[1282] = 0));
      }
      init(e) {
        let t = this._m32,
          i = (Math.ceil(e / 3) + 1288) * 4;
        this._inst ? this._mem.buffer.byteLength < i && (this._mem.grow(Math.ceil((i - this._mem.buffer.byteLength) / 65536)), t = new Uint32Array(this._mem.buffer, 0), this._d = new Uint8Array(this._mem.buffer, 1288 * 4)) : (this._mem = new WebAssembly.Memory({
          initial: Math.ceil(i / 65536)
        }), this._inst = wt({
          env: {
            memory: this._mem
          }
        }), t = new Uint32Array(this._mem.buffer, 0), t.set(L, 256), this._d = new Uint8Array(this._mem.buffer, 1288 * 4)), t[1284] = e, t[1283] = Math.ceil(e / 3) * 4, t[1280] = 0, t[1281] = 0, t[1282] = 0, this._m32 = t;
      }
      put(e, t, i) {
        if (!this._inst) return 1;
        let s = this._m32;
        return i - t + s[1280] > s[1283] ? 1 : (this._d.set(e.subarray(t, i), s[1280]), s[1280] += i - t, s[1280] - s[1281] >= 131072 ? this._inst.exports.dec() : 0);
      }
      end() {
        return this._inst ? this._inst.exports.end() : 1;
      }
    };
  Ce.default = me;
});
var addon_image_je = addon_image_N(oe => {
  "use strict";

  Object.defineProperty(oe, "__esModule", {
    value: !0
  });
  oe.LIMITS = void 0;
  oe.LIMITS = {
    CHUNK_SIZE: 16384,
    PALETTE_SIZE: 4096,
    MAX_WIDTH: 16384,
    BYTES: " "
  };
});
var addon_image_Xe = addon_image_N(b => {
  "use strict";

  Object.defineProperty(b, "__esModule", {
    value: !0
  });
  b.decodeAsync = b.decode = b.Decoder = b.DecoderAsync = void 0;
  var U = addon_image_W(),
    Q = addon_image_je();
  function kt(r) {
    if (typeof Buffer < "u") return Buffer.from(r, "base64");
    let e = atob(r),
      t = new Uint8Array(e.length);
    for (let i = 0; i < t.length; ++i) t[i] = e.charCodeAt(i);
    return t;
  }
  var Ve = kt(Q.LIMITS.BYTES),
    K,
    ae = new Uint32Array(),
    _e = class {
      constructor() {
        this.bandHandler = e => 1, this.modeHandler = e => 1;
      }
      handle_band(e) {
        return this.bandHandler(e);
      }
      mode_parsed(e) {
        return this.modeHandler(e);
      }
    },
    Mt = {
      memoryLimit: 2048 * 65536,
      sixelColor: U.DEFAULT_FOREGROUND,
      fillColor: U.DEFAULT_BACKGROUND,
      palette: U.PALETTE_VT340_COLOR,
      paletteLimit: Q.LIMITS.PALETTE_SIZE,
      truncate: !0
    };
  function Ze(r) {
    let e = new _e(),
      t = {
        env: {
          handle_band: e.handle_band.bind(e),
          mode_parsed: e.mode_parsed.bind(e)
        }
      };
    return WebAssembly.instantiate(K || Ve, t).then(i => (K = K || i.module, new O(r, i.instance || i, e)));
  }
  b.DecoderAsync = Ze;
  var O = class {
    constructor(e, t, i) {
      if (this._PIXEL_OFFSET = Q.LIMITS.MAX_WIDTH + 4, this._canvas = ae, this._bandWidths = [], this._maxWidth = 0, this._minWidth = Q.LIMITS.MAX_WIDTH, this._lastOffset = 0, this._currentHeight = 0, this._opts = Object.assign({}, Mt, e), this._opts.paletteLimit > Q.LIMITS.PALETTE_SIZE) throw new Error(`DecoderOptions.paletteLimit must not exceed ${Q.LIMITS.PALETTE_SIZE}`);
      if (t) i.bandHandler = this._handle_band.bind(this), i.modeHandler = this._initCanvas.bind(this);else {
        let s = K || (K = new WebAssembly.Module(Ve));
        t = new WebAssembly.Instance(s, {
          env: {
            handle_band: this._handle_band.bind(this),
            mode_parsed: this._initCanvas.bind(this)
          }
        });
      }
      this._instance = t, this._wasm = this._instance.exports, this._chunk = new Uint8Array(this._wasm.memory.buffer, this._wasm.get_chunk_address(), Q.LIMITS.CHUNK_SIZE), this._states = new Uint32Array(this._wasm.memory.buffer, this._wasm.get_state_address(), 12), this._palette = new Uint32Array(this._wasm.memory.buffer, this._wasm.get_palette_address(), Q.LIMITS.PALETTE_SIZE), this._palette.set(this._opts.palette), this._pSrc = new Uint32Array(this._wasm.memory.buffer, this._wasm.get_p0_address()), this._wasm.init(U.DEFAULT_FOREGROUND, 0, this._opts.paletteLimit, 0);
    }
    get _fillColor() {
      return this._states[0];
    }
    get _truncate() {
      return this._states[8];
    }
    get _rasterWidth() {
      return this._states[6];
    }
    get _rasterHeight() {
      return this._states[7];
    }
    get _width() {
      return this._states[2] ? this._states[2] - 4 : 0;
    }
    get _height() {
      return this._states[3];
    }
    get _level() {
      return this._states[9];
    }
    get _mode() {
      return this._states[10];
    }
    get _paletteLimit() {
      return this._states[11];
    }
    _initCanvas(e) {
      if (e === 2) {
        let t = this.width * this.height;
        if (t > this._canvas.length) {
          if (this._opts.memoryLimit && t * 4 > this._opts.memoryLimit) throw this.release(), new Error("image exceeds memory limit");
          this._canvas = new Uint32Array(t);
        }
        this._maxWidth = this._width;
      } else if (e === 1) if (this._level === 2) {
        let t = Math.min(this._rasterWidth, Q.LIMITS.MAX_WIDTH) * this._rasterHeight;
        if (t > this._canvas.length) {
          if (this._opts.memoryLimit && t * 4 > this._opts.memoryLimit) throw this.release(), new Error("image exceeds memory limit");
          this._canvas = new Uint32Array(t);
        }
      } else this._canvas.length < 65536 && (this._canvas = new Uint32Array(65536));
      return 0;
    }
    _realloc(e, t) {
      let i = e + t;
      if (i > this._canvas.length) {
        if (this._opts.memoryLimit && i * 4 > this._opts.memoryLimit) throw this.release(), new Error("image exceeds memory limit");
        let s = new Uint32Array(Math.ceil(i / 65536) * 65536);
        s.set(this._canvas), this._canvas = s;
      }
    }
    _handle_band(e) {
      let t = this._PIXEL_OFFSET,
        i = this._lastOffset;
      if (this._mode === 2) {
        let s = this.height - this._currentHeight,
          n = 0;
        for (; n < 6 && s > 0;) this._canvas.set(this._pSrc.subarray(t * n, t * n + e), i + e * n), n++, s--;
        this._lastOffset += e * n, this._currentHeight += n;
      } else if (this._mode === 1) {
        this._realloc(i, e * 6), this._maxWidth = Math.max(this._maxWidth, e), this._minWidth = Math.min(this._minWidth, e);
        for (let s = 0; s < 6; ++s) this._canvas.set(this._pSrc.subarray(t * s, t * s + e), i + e * s);
        this._bandWidths.push(e), this._lastOffset += e * 6, this._currentHeight += 6;
      }
      return 0;
    }
    get width() {
      return this._mode !== 1 ? this._width : Math.max(this._maxWidth, this._wasm.current_width());
    }
    get height() {
      return this._mode !== 1 ? this._height : this._wasm.current_width() ? this._bandWidths.length * 6 + this._wasm.current_height() : this._bandWidths.length * 6;
    }
    get palette() {
      return this._palette.subarray(0, this._paletteLimit);
    }
    get memoryUsage() {
      return this._canvas.byteLength + this._wasm.memory.buffer.byteLength + 8 * this._bandWidths.length;
    }
    get properties() {
      return {
        width: this.width,
        height: this.height,
        mode: this._mode,
        level: this._level,
        truncate: !!this._truncate,
        paletteLimit: this._paletteLimit,
        fillColor: this._fillColor,
        memUsage: this.memoryUsage,
        rasterAttributes: {
          numerator: this._states[4],
          denominator: this._states[5],
          width: this._rasterWidth,
          height: this._rasterHeight
        }
      };
    }
    init(e = this._opts.fillColor, t = this._opts.palette, i = this._opts.paletteLimit, s = this._opts.truncate) {
      this._wasm.init(this._opts.sixelColor, e, i, s ? 1 : 0), t && this._palette.set(t.subarray(0, Q.LIMITS.PALETTE_SIZE)), this._bandWidths.length = 0, this._maxWidth = 0, this._minWidth = Q.LIMITS.MAX_WIDTH, this._lastOffset = 0, this._currentHeight = 0;
    }
    decode(e, t = 0, i = e.length) {
      let s = t;
      for (; s < i;) {
        let n = Math.min(i - s, Q.LIMITS.CHUNK_SIZE);
        this._chunk.set(e.subarray(s, s += n)), this._wasm.decode(0, n);
      }
    }
    decodeString(e, t = 0, i = e.length) {
      let s = t;
      for (; s < i;) {
        let n = Math.min(i - s, Q.LIMITS.CHUNK_SIZE);
        for (let A = 0, o = s; A < n; ++A, ++o) this._chunk[A] = e.charCodeAt(o);
        s += n, this._wasm.decode(0, n);
      }
    }
    get data32() {
      if (this._mode === 0 || !this.width || !this.height) return ae;
      let e = this._wasm.current_width();
      if (this._mode === 2) {
        let t = this.height - this._currentHeight;
        if (t > 0) {
          let i = this._PIXEL_OFFSET,
            s = this._lastOffset,
            n = 0;
          for (; n < 6 && t > 0;) this._canvas.set(this._pSrc.subarray(i * n, i * n + e), s + e * n), n++, t--;
          t && this._canvas.fill(this._fillColor, s + e * n);
        }
        return this._canvas.subarray(0, this.width * this.height);
      }
      if (this._mode === 1) {
        if (this._minWidth === this._maxWidth) {
          let n = !1;
          if (e) if (e !== this._minWidth) n = !0;else {
            let A = this._PIXEL_OFFSET,
              o = this._lastOffset;
            this._realloc(o, e * 6);
            for (let a = 0; a < 6; ++a) this._canvas.set(this._pSrc.subarray(A * a, A * a + e), o + e * a);
          }
          if (!n) return this._canvas.subarray(0, this.width * this.height);
        }
        let t = new Uint32Array(this.width * this.height);
        t.fill(this._fillColor);
        let i = 0,
          s = 0;
        for (let n = 0; n < this._bandWidths.length; ++n) {
          let A = this._bandWidths[n];
          for (let o = 0; o < 6; ++o) t.set(this._canvas.subarray(s, s += A), i), i += this.width;
        }
        if (e) {
          let n = this._PIXEL_OFFSET,
            A = this._wasm.current_height();
          for (let o = 0; o < A; ++o) t.set(this._pSrc.subarray(n * o, n * o + e), i + this.width * o);
        }
        return t;
      }
      return ae;
    }
    get data8() {
      return new Uint8ClampedArray(this.data32.buffer, 0, this.width * this.height * 4);
    }
    release() {
      this._canvas = ae, this._bandWidths.length = 0, this._maxWidth = 0, this._minWidth = Q.LIMITS.MAX_WIDTH, this._wasm.init(U.DEFAULT_FOREGROUND, 0, this._opts.paletteLimit, 0);
    }
  };
  b.Decoder = O;
  function Rt(r, e) {
    let t = new O(e);
    return t.init(), typeof r == "string" ? t.decodeString(r) : t.decode(r), {
      width: t.width,
      height: t.height,
      data32: t.data32,
      data8: t.data8
    };
  }
  b.decode = Rt;
  async function Lt(r, e) {
    let t = await Ze(e);
    return t.init(), typeof r == "string" ? t.decodeString(r) : t.decode(r), {
      width: t.width,
      height: t.height,
      data32: t.data32,
      data8: t.data8
    };
  }
  b.decodeAsync = Lt;
});
var addon_image_fe = addon_image_Y(addon_image_W());
var addon_image_ge = class {
    constructor() {
      this.listeners = [], this.unexpectedErrorHandler = function (e) {
        setTimeout(() => {
          throw e.stack ? addon_image_z.isErrorNoTelemetry(e) ? new addon_image_z(e.message + `

` + e.stack) : new Error(e.message + `

` + e.stack) : e;
        }, 0);
      };
    }
    addListener(e) {
      return this.listeners.push(e), () => {
        this._removeListener(e);
      };
    }
    emit(e) {
      this.listeners.forEach(t => {
        t(e);
      });
    }
    _removeListener(e) {
      this.listeners.splice(this.listeners.indexOf(e), 1);
    }
    setUnexpectedErrorHandler(e) {
      this.unexpectedErrorHandler = e;
    }
    getUnexpectedErrorHandler() {
      return this.unexpectedErrorHandler;
    }
    onUnexpectedError(e) {
      this.unexpectedErrorHandler(e), this.emit(e);
    }
    onUnexpectedExternalError(e) {
      this.unexpectedErrorHandler(e);
    }
  },
  addon_image_Jt = new addon_image_ge();
var addon_image_z = class r extends Error {
  constructor(e) {
    super(e), this.name = "CodeExpectedError";
  }
  static fromError(e) {
    if (e instanceof r) return e;
    let t = new r();
    return t.message = e.message, t.stack = e.stack, t;
  }
  static isErrorNoTelemetry(e) {
    return e.name === "CodeExpectedError";
  }
};
function addon_image_It(r, e, t = 0, i = r.length) {
  let s = t,
    n = i;
  for (; s < n;) {
    let A = Math.floor((s + n) / 2);
    e(r[A]) ? s = A + 1 : n = A;
  }
  return s - 1;
}
var addon_image_q = class q {
  constructor(e) {
    this._array = e;
    this._findLastMonotonousLastIdx = 0;
  }
  findLastMonotonous(e) {
    if (q.assertInvariants) {
      if (this._prevFindLastPredicate) {
        for (let i of this._array) if (this._prevFindLastPredicate(i) && !e(i)) throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");
      }
      this._prevFindLastPredicate = e;
    }
    let t = addon_image_It(this._array, e, this._findLastMonotonousLastIdx);
    return this._findLastMonotonousLastIdx = t + 1, t === -1 ? void 0 : this._array[t];
  }
};
addon_image_q.assertInvariants = !1;
var addon_image_ve = (/* unused pure expression or super */ null && (addon_image_q));
var addon_image_ke;
(o => {
  function r(a) {
    return a < 0;
  }
  o.isLessThan = r;
  function e(a) {
    return a <= 0;
  }
  o.isLessThanOrEqual = e;
  function t(a) {
    return a > 0;
  }
  o.isGreaterThan = t;
  function i(a) {
    return a === 0;
  }
  o.isNeitherLessOrGreaterThan = i, o.greaterThan = 1, o.lessThan = -1, o.neitherLessOrGreaterThan = 0;
})(addon_image_ke ||= {});
function addon_image_Me(r, e) {
  return (t, i) => e(r(t), r(i));
}
var addon_image_Re = (r, e) => r - e;
var addon_image_M = class M {
  constructor(e) {
    this.iterate = e;
  }
  forEach(e) {
    this.iterate(t => (e(t), !0));
  }
  toArray() {
    let e = [];
    return this.iterate(t => (e.push(t), !0)), e;
  }
  filter(e) {
    return new M(t => this.iterate(i => e(i) ? t(i) : !0));
  }
  map(e) {
    return new M(t => this.iterate(i => t(e(i))));
  }
  some(e) {
    let t = !1;
    return this.iterate(i => (t = e(i), !t)), t;
  }
  findFirst(e) {
    let t;
    return this.iterate(i => e(i) ? (t = i, !1) : !0), t;
  }
  findLast(e) {
    let t;
    return this.iterate(i => (e(i) && (t = i), !0)), t;
  }
  findLastMaxBy(e) {
    let t,
      i = !0;
    return this.iterate(s => ((i || addon_image_ke.isGreaterThan(e(s, t))) && (i = !1, t = s), !0)), t;
  }
};
addon_image_M.empty = new addon_image_M(e => {});
var addon_image_Se = (/* unused pure expression or super */ null && (addon_image_M));
function addon_image_Fe(r, e) {
  let t = Object.create(null);
  for (let i of r) {
    let s = e(i),
      n = t[s];
    n || (n = t[s] = []), n.push(i);
  }
  return t;
}
var addon_image_Ne,
  addon_image_He,
  addon_image_Le = class {
    constructor(e, t) {
      this.toKey = t;
      this._map = new Map();
      this[addon_image_Ne] = "SetWithKey";
      for (let i of e) this.add(i);
    }
    get size() {
      return this._map.size;
    }
    add(e) {
      let t = this.toKey(e);
      return this._map.set(t, e), this;
    }
    delete(e) {
      return this._map.delete(this.toKey(e));
    }
    has(e) {
      return this._map.has(this.toKey(e));
    }
    *entries() {
      for (let e of this._map.values()) yield [e, e];
    }
    keys() {
      return this.values();
    }
    *values() {
      for (let e of this._map.values()) yield e;
    }
    clear() {
      this._map.clear();
    }
    forEach(e, t) {
      this._map.forEach(i => e.call(t, i, i, this));
    }
    [(addon_image_He = Symbol.iterator, addon_image_Ne = Symbol.toStringTag, addon_image_He)]() {
      return this.values();
    }
  };
var addon_image_j = class {
  constructor() {
    this.map = new Map();
  }
  add(e, t) {
    let i = this.map.get(e);
    i || (i = new Set(), this.map.set(e, i)), i.add(t);
  }
  delete(e, t) {
    let i = this.map.get(e);
    i && (i.delete(t), i.size === 0 && this.map.delete(e));
  }
  forEach(e, t) {
    let i = this.map.get(e);
    i && i.forEach(t);
  }
  get(e) {
    let t = this.map.get(e);
    return t || new Set();
  }
};
function addon_image_Ge(r, e) {
  let t = this,
    i = !1,
    s;
  return function () {
    if (i) return s;
    if (i = !0, e) try {
      s = r.apply(t, arguments);
    } finally {
      e();
    } else s = r.apply(t, arguments);
    return s;
  };
}
var addon_image_ue;
(rt => {
  function r(d) {
    return d && typeof d == "object" && typeof d[Symbol.iterator] == "function";
  }
  rt.is = r;
  let e = Object.freeze([]);
  function t() {
    return e;
  }
  rt.empty = t;
  function* i(d) {
    yield d;
  }
  rt.single = i;
  function s(d) {
    return r(d) ? d : i(d);
  }
  rt.wrap = s;
  function n(d) {
    return d || e;
  }
  rt.from = n;
  function* A(d) {
    for (let p = d.length - 1; p >= 0; p--) yield d[p];
  }
  rt.reverse = A;
  function o(d) {
    return !d || d[Symbol.iterator]().next().done === !0;
  }
  rt.isEmpty = o;
  function a(d) {
    return d[Symbol.iterator]().next().value;
  }
  rt.first = a;
  function c(d, p) {
    let f = 0;
    for (let D of d) if (p(D, f++)) return !0;
    return !1;
  }
  rt.some = c;
  function h(d, p) {
    for (let f of d) if (p(f)) return f;
  }
  rt.find = h;
  function* l(d, p) {
    for (let f of d) p(f) && (yield f);
  }
  rt.filter = l;
  function* I(d, p) {
    let f = 0;
    for (let D of d) yield p(D, f++);
  }
  rt.map = I;
  function* E(d, p) {
    let f = 0;
    for (let D of d) yield* p(D, f++);
  }
  rt.flatMap = E;
  function* C(...d) {
    for (let p of d) yield* p;
  }
  rt.concat = C;
  function _(d, p, f) {
    let D = f;
    for (let P of d) D = p(D, P);
    return D;
  }
  rt.reduce = _;
  function* B(d, p, f = d.length) {
    for (p < 0 && (p += d.length), f < 0 ? f += d.length : f > d.length && (f = d.length); p < f; p++) yield d[p];
  }
  rt.slice = B;
  function y(d, p = Number.POSITIVE_INFINITY) {
    let f = [];
    if (p === 0) return [f, d];
    let D = d[Symbol.iterator]();
    for (let P = 0; P < p; P++) {
      let Te = D.next();
      if (Te.done) return [f, rt.empty()];
      f.push(Te.value);
    }
    return [f, {
      [Symbol.iterator]() {
        return D;
      }
    }];
  }
  rt.consume = y;
  async function k(d) {
    let p = [];
    for await (let f of d) p.push(f);
    return Promise.resolve(p);
  }
  rt.asyncToArray = k;
})(addon_image_ue ||= {});
var addon_image_pt = !1,
  addon_image_$ = null,
  addon_image_Z = class Z {
    constructor() {
      this.livingDisposables = new Map();
    }
    getDisposableData(e) {
      let t = this.livingDisposables.get(e);
      return t || (t = {
        parent: null,
        source: null,
        isSingleton: !1,
        value: e,
        idx: Z.idx++
      }, this.livingDisposables.set(e, t)), t;
    }
    trackDisposable(e) {
      let t = this.getDisposableData(e);
      t.source || (t.source = new Error().stack);
    }
    setParent(e, t) {
      let i = this.getDisposableData(e);
      i.parent = t;
    }
    markAsDisposed(e) {
      this.livingDisposables.delete(e);
    }
    markAsSingleton(e) {
      this.getDisposableData(e).isSingleton = !0;
    }
    getRootParent(e, t) {
      let i = t.get(e);
      if (i) return i;
      let s = e.parent ? this.getRootParent(this.getDisposableData(e.parent), t) : e;
      return t.set(e, s), s;
    }
    getTrackedDisposables() {
      let e = new Map();
      return [...this.livingDisposables.entries()].filter(([, i]) => i.source !== null && !this.getRootParent(i, e).isSingleton).flatMap(([i]) => i);
    }
    computeLeakingDisposables(e = 10, t) {
      let i;
      if (t) i = t;else {
        let a = new Map(),
          c = [...this.livingDisposables.values()].filter(l => l.source !== null && !this.getRootParent(l, a).isSingleton);
        if (c.length === 0) return;
        let h = new Set(c.map(l => l.value));
        if (i = c.filter(l => !(l.parent && h.has(l.parent))), i.length === 0) throw new Error("There are cyclic diposable chains!");
      }
      if (!i) return;
      function s(a) {
        function c(l, I) {
          for (; l.length > 0 && I.some(E => typeof E == "string" ? E === l[0] : l[0].match(E));) l.shift();
        }
        let h = a.source.split(`
`).map(l => l.trim().replace("at ", "")).filter(l => l !== "");
        return c(h, ["Error", /^trackDisposable \(.*\)$/, /^DisposableTracker.trackDisposable \(.*\)$/]), h.reverse();
      }
      let n = new addon_image_j();
      for (let a of i) {
        let c = s(a);
        for (let h = 0; h <= c.length; h++) n.add(c.slice(0, h).join(`
`), a);
      }
      i.sort(addon_image_Me(a => a.idx, addon_image_Re));
      let A = "",
        o = 0;
      for (let a of i.slice(0, e)) {
        o++;
        let c = s(a),
          h = [];
        for (let l = 0; l < c.length; l++) {
          let I = c[l];
          I = `(shared with ${n.get(c.slice(0, l + 1).join(`
`)).size}/${i.length} leaks) at ${I}`;
          let C = n.get(c.slice(0, l).join(`
`)),
            _ = addon_image_Fe([...C].map(B => s(B)[l]), B => B);
          delete _[c[l]];
          for (let [B, y] of Object.entries(_)) h.unshift(`    - stacktraces of ${y.length} other leaks continue with ${B}`);
          h.unshift(I);
        }
        A += `


==================== Leaking disposable ${o}/${i.length}: ${a.value.constructor.name} ====================
${h.join(`
`)}
============================================================

`;
      }
      return i.length > e && (A += `


... and ${i.length - e} more leaking disposables

`), {
        leaks: i,
        details: A
      };
    }
  };
addon_image_Z.idx = 0;
var addon_image_Je = (/* unused pure expression or super */ null && (addon_image_Z));
function addon_image_ft(r) {
  addon_image_$ = r;
}
if (addon_image_pt) {
  let r = "__is_disposable_tracked__";
  addon_image_ft(new class {
    trackDisposable(e) {
      let t = new Error("Potentially leaked disposable").stack;
      setTimeout(() => {
        e[r] || console.log(t);
      }, 3e3);
    }
    setParent(e, t) {
      if (e && e !== addon_image_v.None) try {
        e[r] = !0;
      } catch {}
    }
    markAsDisposed(e) {
      if (e && e !== addon_image_v.None) try {
        e[r] = !0;
      } catch {}
    }
    markAsSingleton(e) {}
  }());
}
function addon_image_ee(r) {
  return addon_image_$?.trackDisposable(r), r;
}
function addon_image_te(r) {
  addon_image_$?.markAsDisposed(r);
}
function addon_image_H(r, e) {
  addon_image_$?.setParent(r, e);
}
function addon_image_mt(r) {
  if (addon_image_ue.is(r)) {
    let e = [];
    for (let t of r) if (t) try {
      t.dispose();
    } catch (i) {
      e.push(i);
    }
    if (e.length === 1) throw e[0];
    if (e.length > 1) throw new AggregateError(e, "Encountered errors while disposing of store");
    return Array.isArray(r) ? [] : r;
  } else if (r) return r.dispose(), r;
}
function addon_image_Ue(r) {
  let e = addon_image_ee({
    dispose: addon_image_Ge(() => {
      addon_image_te(e), r();
    })
  });
  return e;
}
var addon_image_X = class X {
  constructor() {
    this._toDispose = new Set();
    this._isDisposed = !1;
    addon_image_ee(this);
  }
  dispose() {
    this._isDisposed || (addon_image_te(this), this._isDisposed = !0, this.clear());
  }
  get isDisposed() {
    return this._isDisposed;
  }
  clear() {
    if (this._toDispose.size !== 0) try {
      addon_image_mt(this._toDispose);
    } finally {
      this._toDispose.clear();
    }
  }
  add(e) {
    if (!e) return e;
    if (e === this) throw new Error("Cannot register a disposable on itself!");
    return addon_image_H(e, this), this._isDisposed ? X.DISABLE_DISPOSED_WARNING || console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack) : this._toDispose.add(e), e;
  }
  delete(e) {
    if (e) {
      if (e === this) throw new Error("Cannot dispose a disposable on itself!");
      this._toDispose.delete(e), e.dispose();
    }
  }
  deleteAndLeak(e) {
    e && this._toDispose.has(e) && (this._toDispose.delete(e), addon_image_H(e, null));
  }
};
addon_image_X.DISABLE_DISPOSED_WARNING = !1;
var addon_image_Ie = addon_image_X,
  addon_image_v = class {
    constructor() {
      this._store = new addon_image_Ie();
      addon_image_ee(this), addon_image_H(this._store, this);
    }
    dispose() {
      addon_image_te(this), this._store.dispose();
    }
    _register(e) {
      if (e === this) throw new Error("Cannot register a disposable on itself!");
      return this._store.add(e);
    }
  };
addon_image_v.None = Object.freeze({
  dispose() {}
});
var addon_image_V = class {
  constructor() {
    this._isDisposed = !1;
    addon_image_ee(this);
  }
  get value() {
    return this._isDisposed ? void 0 : this._value;
  }
  set value(e) {
    this._isDisposed || e === this._value || (this._value?.dispose(), e && addon_image_H(e, this), this._value = e);
  }
  clear() {
    this.value = void 0;
  }
  dispose() {
    this._isDisposed = !0, addon_image_te(this), this._value?.dispose(), this._value = void 0;
  }
  clearAndLeak() {
    let e = this._value;
    return this._value = void 0, e && addon_image_H(e, null), e;
  }
};
var addon_image_Ct = 4096,
  addon_image_pe = 24,
  addon_image_T = class r extends addon_image_v {
    constructor(t) {
      super();
      this._terminal = t;
      this._optionsRefresh = this._register(new addon_image_V());
      this._oldOpen = this._terminal._core.open, this._terminal._core.open = i => {
        this._oldOpen?.call(this._terminal._core, i), this._open();
      }, this._terminal._core.screenElement && this._open(), this._optionsRefresh.value = this._terminal._core.optionsService.onOptionChange(i => {
        i === "fontSize" && (this.rescaleCanvas(), this._renderService?.refreshRows(0, this._terminal.rows));
      }), this._register(addon_image_Ue(() => {
        this.removeLayerFromDom(), this._terminal._core && this._oldOpen && (this._terminal._core.open = this._oldOpen, this._oldOpen = void 0), this._renderService && this._oldSetRenderer && (this._renderService.setRenderer = this._oldSetRenderer, this._oldSetRenderer = void 0), this._renderService = void 0, this.canvas = void 0, this._ctx = void 0, this._placeholderBitmap?.close(), this._placeholderBitmap = void 0, this._placeholder = void 0;
      }));
    }
    static createCanvas(t, i, s) {
      let n = (t || document).createElement("canvas");
      return n.width = i | 0, n.height = s | 0, n;
    }
    static createImageData(t, i, s, n) {
      if (typeof ImageData != "function") {
        let A = t.createImageData(i, s);
        return n && A.data.set(new Uint8ClampedArray(n, 0, i * s * 4)), A;
      }
      return n ? new ImageData(new Uint8ClampedArray(n, 0, i * s * 4), i, s) : new ImageData(i, s);
    }
    static createImageBitmap(t) {
      return typeof createImageBitmap != "function" ? Promise.resolve(void 0) : createImageBitmap(t);
    }
    showPlaceholder(t) {
      t ? !this._placeholder && this.cellSize.height !== -1 && this._createPlaceHolder(Math.max(this.cellSize.height + 1, addon_image_pe)) : (this._placeholderBitmap?.close(), this._placeholderBitmap = void 0, this._placeholder = void 0), this._renderService?.refreshRows(0, this._terminal.rows);
    }
    get dimensions() {
      return this._renderService?.dimensions;
    }
    get cellSize() {
      return {
        width: this.dimensions?.css.cell.width || -1,
        height: this.dimensions?.css.cell.height || -1
      };
    }
    clearLines(t, i) {
      this._ctx?.clearRect(0, t * (this.dimensions?.css.cell.height || 0), this.dimensions?.css.canvas.width || 0, (++i - t) * (this.dimensions?.css.cell.height || 0));
    }
    clearAll() {
      this._ctx?.clearRect(0, 0, this.canvas?.width || 0, this.canvas?.height || 0);
    }
    draw(t, i, s, n, A = 1) {
      if (!this._ctx) return;
      let {
        width: o,
        height: a
      } = this.cellSize;
      if (o === -1 || a === -1) return;
      this._rescaleImage(t, o, a);
      let c = t.actual,
        h = Math.ceil(c.width / o),
        l = i % h * o,
        I = Math.floor(i / h) * a,
        E = s * o,
        C = n * a,
        _ = A * o + l > c.width ? c.width - l : A * o,
        B = I + a > c.height ? c.height - I : a;
      this._ctx.drawImage(c, Math.floor(l), Math.floor(I), Math.ceil(_), Math.ceil(B), Math.floor(E), Math.floor(C), Math.ceil(_), Math.ceil(B));
    }
    extractTile(t, i) {
      let {
        width: s,
        height: n
      } = this.cellSize;
      if (s === -1 || n === -1) return;
      this._rescaleImage(t, s, n);
      let A = t.actual,
        o = Math.ceil(A.width / s),
        a = i % o * s,
        c = Math.floor(i / o) * n,
        h = s + a > A.width ? A.width - a : s,
        l = c + n > A.height ? A.height - c : n,
        I = r.createCanvas(this.document, h, l),
        E = I.getContext("2d");
      if (E) return E.drawImage(A, Math.floor(a), Math.floor(c), Math.floor(h), Math.floor(l), 0, 0, Math.floor(h), Math.floor(l)), I;
    }
    drawPlaceholder(t, i, s = 1) {
      if (this._ctx) {
        let {
          width: n,
          height: A
        } = this.cellSize;
        if (n === -1 || A === -1 || (this._placeholder ? A >= this._placeholder.height && this._createPlaceHolder(A + 1) : this._createPlaceHolder(Math.max(A + 1, addon_image_pe)), !this._placeholder)) return;
        this._ctx.drawImage(this._placeholderBitmap || this._placeholder, t * n, i * A % 2 ? 0 : 1, n * s, A, t * n, i * A, n * s, A);
      }
    }
    rescaleCanvas() {
      this.canvas && (this.canvas.width !== this.dimensions.css.canvas.width || this.canvas.height !== this.dimensions.css.canvas.height) && (this.canvas.width = this.dimensions.css.canvas.width || 0, this.canvas.height = this.dimensions.css.canvas.height || 0);
    }
    _rescaleImage(t, i, s) {
      if (i === t.actualCellSize.width && s === t.actualCellSize.height) return;
      let {
        width: n,
        height: A
      } = t.origCellSize;
      if (i === n && s === A) {
        t.actual = t.orig, t.actualCellSize.width = n, t.actualCellSize.height = A;
        return;
      }
      let o = r.createCanvas(this.document, Math.ceil(t.orig.width * i / n), Math.ceil(t.orig.height * s / A)),
        a = o.getContext("2d");
      a && (a.drawImage(t.orig, 0, 0, o.width, o.height), t.actual = o, t.actualCellSize.width = i, t.actualCellSize.height = s);
    }
    _open() {
      this._renderService = this._terminal._core._renderService, this._oldSetRenderer = this._renderService.setRenderer.bind(this._renderService), this._renderService.setRenderer = t => {
        this.removeLayerFromDom(), this._oldSetRenderer?.call(this._renderService, t);
      };
    }
    insertLayerToDom() {
      this.document && this._terminal._core.screenElement ? this.canvas || (this.canvas = r.createCanvas(this.document, this.dimensions?.css.canvas.width || 0, this.dimensions?.css.canvas.height || 0), this.canvas.classList.add("xterm-image-layer"), this._terminal._core.screenElement.appendChild(this.canvas), this._ctx = this.canvas.getContext("2d", {
        alpha: !0,
        desynchronized: !0
      }), this.clearAll()) : console.warn("image addon: cannot insert output canvas to DOM, missing document or screenElement");
    }
    removeLayerFromDom() {
      this.canvas && (this._ctx = void 0, this.canvas.remove(), this.canvas = void 0);
    }
    _createPlaceHolder(t = addon_image_pe) {
      this._placeholderBitmap?.close(), this._placeholderBitmap = void 0;
      let i = 32,
        s = r.createCanvas(this.document, i, t),
        n = s.getContext("2d", {
          alpha: !1
        });
      if (!n) return;
      let A = r.createImageData(n, i, t),
        o = new Uint32Array(A.data.buffer),
        a = (0, addon_image_fe.toRGBA8888)(0, 0, 0),
        c = (0, addon_image_fe.toRGBA8888)(255, 255, 255);
      o.fill(a);
      for (let I = 0; I < t; ++I) {
        let E = I % 2,
          C = I * i;
        for (let _ = 0; _ < i; _ += 2) o[C + _ + E] = c;
      }
      n.putImageData(A, 0, 0);
      let h = screen.width + i - 1 & ~(i - 1) || addon_image_Ct;
      this._placeholder = r.createCanvas(this.document, h, t);
      let l = this._placeholder.getContext("2d", {
        alpha: !1
      });
      if (!l) {
        this._placeholder = void 0;
        return;
      }
      for (let I = 0; I < h; I += i) l.drawImage(s, I, 0);
      r.createImageBitmap(this._placeholder).then(I => this._placeholderBitmap = I);
    }
    get document() {
      return this._terminal._core._coreBrowserService?.window.document;
    }
  };
var addon_image_S = {
    width: 7,
    height: 14
  },
  addon_image_G = class r {
    constructor(e = 0, t = 0, i = -1, s = -1) {
      this.imageId = i;
      this.tileId = s;
      this._ext = 0;
      this._urlId = 0;
      this._ext = e, this._urlId = t;
    }
    get ext() {
      return this._urlId ? this._ext & -469762049 | this.underlineStyle << 26 : this._ext;
    }
    set ext(e) {
      this._ext = e;
    }
    get underlineStyle() {
      return this._urlId ? 5 : (this._ext & 469762048) >> 26;
    }
    set underlineStyle(e) {
      this._ext &= -469762049, this._ext |= e << 26 & 469762048;
    }
    get underlineColor() {
      return this._ext & 67108863;
    }
    set underlineColor(e) {
      this._ext &= -67108864, this._ext |= e & 67108863;
    }
    get underlineVariantOffset() {
      let e = (this._ext & 3758096384) >> 29;
      return e < 0 ? e ^ 4294967288 : e;
    }
    set underlineVariantOffset(e) {
      this._ext &= 536870911, this._ext |= e << 29 & 3758096384;
    }
    get urlId() {
      return this._urlId;
    }
    set urlId(e) {
      this._urlId = e;
    }
    clone() {
      return new r(this._ext, this._urlId, this.imageId, this.tileId);
    }
    isEmpty() {
      return this.underlineStyle === 0 && this._urlId === 0 && this.imageId === -1;
    }
  },
  addon_image_F = new addon_image_G(),
  addon_image_ie = class {
    constructor(e, t, i) {
      this._terminal = e;
      this._renderer = t;
      this._opts = i;
      this._images = new Map();
      this._lastId = 0;
      this._lowestId = 0;
      this._fullyCleared = !1;
      this._needsFullClear = !1;
      this._pixelLimit = 25e5;
      try {
        this.setLimit(this._opts.storageLimit);
      } catch (s) {
        console.error(s.message), console.warn(`storageLimit is set to ${this.getLimit()} MB`);
      }
      this._viewportMetrics = {
        cols: this._terminal.cols,
        rows: this._terminal.rows
      };
    }
    dispose() {
      this.reset();
    }
    reset() {
      for (let e of this._images.values()) e.marker?.dispose();
      this._images.clear(), this._renderer.clearAll();
    }
    getLimit() {
      return this._pixelLimit * 4 / 1e6;
    }
    setLimit(e) {
      if (e < .5 || e > 1e3) throw RangeError("invalid storageLimit, should be at least 0.5 MB and not exceed 1G");
      this._pixelLimit = e / 4 * 1e6 >>> 0, this._evictOldest(0);
    }
    getUsage() {
      return this._getStoredPixels() * 4 / 1e6;
    }
    _getStoredPixels() {
      let e = 0;
      for (let t of this._images.values()) t.orig && (e += t.orig.width * t.orig.height, t.actual && t.actual !== t.orig && (e += t.actual.width * t.actual.height));
      return e;
    }
    _delImg(e) {
      let t = this._images.get(e);
      this._images.delete(e), t && window.ImageBitmap && t.orig instanceof ImageBitmap && t.orig.close();
    }
    wipeAlternate() {
      let e = [];
      for (let [t, i] of this._images.entries()) i.bufferType === "alternate" && (i.marker?.dispose(), e.push(t));
      for (let t of e) this._delImg(t);
      this._needsFullClear = !0, this._fullyCleared = !1;
    }
    advanceCursor(e) {
      if (this._opts.sixelScrolling) {
        let t = this._renderer.cellSize;
        (t.width === -1 || t.height === -1) && (t = addon_image_S);
        let i = Math.ceil(e / t.height);
        for (let s = 1; s < i; ++s) this._terminal._core._inputHandler.lineFeed();
      }
    }
    addImage(e) {
      this._evictOldest(e.width * e.height);
      let t = this._renderer.cellSize;
      (t.width === -1 || t.height === -1) && (t = addon_image_S);
      let i = Math.ceil(e.width / t.width),
        s = Math.ceil(e.height / t.height),
        n = ++this._lastId,
        A = this._terminal._core.buffer,
        o = this._terminal.cols,
        a = this._terminal.rows,
        c = A.x,
        h = A.y,
        l = c,
        I = 0;
      this._opts.sixelScrolling || (A.x = 0, A.y = 0, l = 0), this._terminal._core._inputHandler._dirtyRowTracker.markDirty(A.y);
      for (let B = 0; B < s; ++B) {
        let y = A.lines.get(A.y + A.ybase);
        for (let k = 0; k < i && !(l + k >= o); ++k) this._writeToCell(y, l + k, n, B * i + k), I++;
        if (this._opts.sixelScrolling) B < s - 1 && this._terminal._core._inputHandler.lineFeed();else if (++A.y >= a) break;
        A.x = l;
      }
      this._terminal._core._inputHandler._dirtyRowTracker.markDirty(A.y), this._opts.sixelScrolling ? A.x = l : (A.x = c, A.y = h);
      let E = [];
      for (let [B, y] of this._images.entries()) y.tileCount < 1 && (y.marker?.dispose(), E.push(B));
      for (let B of E) this._delImg(B);
      let C = this._terminal.registerMarker(0);
      C?.onDispose(() => {
        this._images.get(n) && this._delImg(n);
      }), this._terminal.buffer.active.type === "alternate" && this._evictOnAlternate();
      let _ = {
        orig: e,
        origCellSize: t,
        actual: e,
        actualCellSize: {
          ...t
        },
        marker: C || void 0,
        tileCount: I,
        bufferType: this._terminal.buffer.active.type
      };
      this._images.set(n, _);
    }
    render(e) {
      if (!this._renderer.canvas && this._images.size && (this._renderer.insertLayerToDom(), !this._renderer.canvas)) return;
      if (this._renderer.rescaleCanvas(), !this._images.size) {
        this._fullyCleared || (this._renderer.clearAll(), this._fullyCleared = !0, this._needsFullClear = !1), this._renderer.canvas && this._renderer.removeLayerFromDom();
        return;
      }
      this._needsFullClear && (this._renderer.clearAll(), this._fullyCleared = !0, this._needsFullClear = !1);
      let {
          start: t,
          end: i
        } = e,
        s = this._terminal._core.buffer,
        n = this._terminal._core.cols;
      this._renderer.clearLines(t, i);
      for (let A = t; A <= i; ++A) {
        let o = s.lines.get(A + s.ydisp);
        if (!o) return;
        for (let a = 0; a < n; ++a) if (o.getBg(a) & 268435456) {
          let c = o._extendedAttrs[a] || addon_image_F,
            h = c.imageId;
          if (h === void 0 || h === -1) continue;
          let l = this._images.get(h);
          if (c.tileId !== -1) {
            let I = c.tileId,
              E = a,
              C = 1;
            for (; ++a < n && o.getBg(a) & 268435456 && (c = o._extendedAttrs[a] || addon_image_F) && c.imageId === h && c.tileId === I + C;) C++;
            a--, l ? l.actual && this._renderer.draw(l, I, E, A, C) : this._opts.showPlaceholder && this._renderer.drawPlaceholder(E, A, C), this._fullyCleared = !1;
          }
        }
      }
    }
    viewportResize(e) {
      if (!this._images.size) {
        this._viewportMetrics = e;
        return;
      }
      if (this._viewportMetrics.cols >= e.cols) {
        this._viewportMetrics = e;
        return;
      }
      let t = this._terminal._core.buffer,
        i = t.lines.length,
        s = this._viewportMetrics.cols - 1;
      for (let n = 0; n < i; ++n) {
        let A = t.lines.get(n);
        if (A.getBg(s) & 268435456) {
          let o = A._extendedAttrs[s] || addon_image_F,
            a = o.imageId;
          if (a === void 0 || a === -1) continue;
          let c = this._images.get(a);
          if (!c) continue;
          let h = Math.ceil((c.actual?.width || 0) / c.actualCellSize.width);
          if (o.tileId % h + 1 >= h) continue;
          let l = !1;
          for (let C = s + 1; C > e.cols; ++C) if (A._data[C * 3 + 0] & 4194303) {
            l = !0;
            break;
          }
          if (l) continue;
          let I = Math.min(e.cols, h - o.tileId % h + s),
            E = o.tileId;
          for (let C = s + 1; C < I; ++C) this._writeToCell(A, C, a, ++E), c.tileCount++;
        }
      }
      this._viewportMetrics = e;
    }
    getImageAtBufferCell(e, t) {
      let s = this._terminal._core.buffer.lines.get(t);
      if (s && s.getBg(e) & 268435456) {
        let n = s._extendedAttrs[e] || addon_image_F;
        if (n.imageId && n.imageId !== -1) {
          let A = this._images.get(n.imageId)?.orig;
          if (window.ImageBitmap && A instanceof ImageBitmap) {
            let o = addon_image_T.createCanvas(window.document, A.width, A.height);
            return o.getContext("2d")?.drawImage(A, 0, 0, A.width, A.height), o;
          }
          return A;
        }
      }
    }
    extractTileAtBufferCell(e, t) {
      let s = this._terminal._core.buffer.lines.get(t);
      if (s && s.getBg(e) & 268435456) {
        let n = s._extendedAttrs[e] || addon_image_F;
        if (n.imageId && n.imageId !== -1 && n.tileId !== -1) {
          let A = this._images.get(n.imageId);
          if (A) return this._renderer.extractTile(A, n.tileId);
        }
      }
    }
    _evictOldest(e) {
      let t = this._getStoredPixels(),
        i = t;
      for (; this._pixelLimit < i + e && this._images.size;) {
        let s = this._images.get(++this._lowestId);
        s && s.orig && (i -= s.orig.width * s.orig.height, s.actual && s.orig !== s.actual && (i -= s.actual.width * s.actual.height), s.marker?.dispose(), this._delImg(this._lowestId));
      }
      return t - i;
    }
    _writeToCell(e, t, i, s) {
      if (e._data[t * 3 + 2] & 268435456) {
        let n = e._extendedAttrs[t];
        if (n) {
          if (n.imageId !== void 0) {
            let A = this._images.get(n.imageId);
            A && A.tileCount--, n.imageId = i, n.tileId = s;
            return;
          }
          e._extendedAttrs[t] = new addon_image_G(n.ext, n.urlId, i, s);
          return;
        }
      }
      e._data[t * 3 + 2] |= 268435456, e._extendedAttrs[t] = new addon_image_G(0, 0, i, s);
    }
    _evictOnAlternate() {
      for (let i of this._images.values()) i.bufferType === "alternate" && (i.tileCount = 0);
      let e = this._terminal._core.buffer;
      for (let i = 0; i < this._terminal.rows; ++i) {
        let s = e.lines.get(i);
        if (s) {
          for (let n = 0; n < this._terminal.cols; ++n) if (s._data[n * 3 + 2] & 268435456) {
            let A = s._extendedAttrs[n]?.imageId;
            if (A) {
              let o = this._images.get(A);
              o && o.tileCount++;
            }
          }
        }
      }
      let t = [];
      for (let [i, s] of this._images.entries()) s.bufferType === "alternate" && !s.tileCount && (s.marker?.dispose(), t.push(i));
      for (let i of t) this._delImg(i);
    }
  };
var addon_image_qe = addon_image_Y(addon_image_Oe());
function addon_image_se(r) {
  let e = "";
  for (let t = 0; t < r.length; ++t) e += String.fromCharCode(r[t]);
  return e;
}
function addon_image_Ee(r) {
  let e = 0;
  for (let t = 0; t < r.length; ++t) {
    if (r[t] < 48 || r[t] > 57) throw new Error("illegal char");
    e = e * 10 + r[t] - 48;
  }
  return e;
}
function addon_image_Pe(r) {
  let e = addon_image_se(r);
  if (!e.match(/^((auto)|(\d+?((px)|(%)){0,1}))$/)) throw new Error("illegal size");
  return e;
}
function addon_image_yt(r) {
  if (typeof Buffer < "u") return Buffer.from(addon_image_se(r), "base64").toString();
  let e = atob(addon_image_se(r)),
    t = new Uint8Array(e.length);
  for (let i = 0; i < t.length; ++i) t[i] = e.charCodeAt(i);
  return new TextDecoder().decode(t);
}
var addon_image_Ye = {
    inline: addon_image_Ee,
    size: addon_image_Ee,
    name: addon_image_yt,
    width: addon_image_Pe,
    height: addon_image_Pe,
    preserveAspectRatio: addon_image_Ee
  },
  addon_image_We = [70, 105, 108, 101],
  addon_image_Be = 1024,
  addon_image_ne = class {
    constructor() {
      this.state = 0;
      this._buffer = new Uint32Array(addon_image_Be);
      this._position = 0;
      this._key = "";
      this.fields = {};
    }
    reset() {
      this._buffer.fill(0), this.state = 0, this._position = 0, this.fields = {}, this._key = "";
    }
    parse(e, t, i) {
      let s = this.state,
        n = this._position,
        A = this._buffer;
      if (s === 1 || s === 4 || s === 0 && n > 6) return -1;
      for (let o = t; o < i; ++o) {
        let a = e[o];
        switch (a) {
          case 59:
            if (!this._storeValue(n)) return this._a();
            s = 2, n = 0;
            break;
          case 61:
            if (s === 0) {
              for (let c = 0; c < addon_image_We.length; ++c) if (A[c] !== addon_image_We[c]) return this._a();
              s = 2, n = 0;
            } else if (s === 2) {
              if (!this._storeKey(n)) return this._a();
              s = 3, n = 0;
            } else if (s === 3) {
              if (n >= addon_image_Be) return this._a();
              A[n++] = a;
            }
            break;
          case 58:
            return s === 3 && !this._storeValue(n) ? this._a() : (this.state = 4, o + 1);
          default:
            if (n >= addon_image_Be) return this._a();
            A[n++] = a;
        }
      }
      return this.state = s, this._position = n, -2;
    }
    _a() {
      return this.state = 1, -1;
    }
    _storeKey(e) {
      let t = addon_image_se(this._buffer.subarray(0, e));
      return t ? (this._key = t, this.fields[t] = null, !0) : !1;
    }
    _storeValue(e) {
      if (this._key) {
        try {
          let t = this._buffer.slice(0, e);
          this.fields[this._key] = addon_image_Ye[this._key] ? addon_image_Ye[this._key](t) : t;
        } catch {
          return !1;
        }
        return !0;
      }
      return !1;
    }
  };
var addon_image_J = {
  mime: "unsupported",
  width: 0,
  height: 0
};
function addon_image_ze(r) {
  if (r.length < 24) return addon_image_J;
  let e = new Uint32Array(r.buffer, r.byteOffset, 6);
  if (e[0] === 1196314761 && e[1] === 169478669 && e[3] === 1380206665) return {
    mime: "image/png",
    width: r[16] << 24 | r[17] << 16 | r[18] << 8 | r[19],
    height: r[20] << 24 | r[21] << 16 | r[22] << 8 | r[23]
  };
  if (r[0] === 255 && r[1] === 216 && r[2] === 255) {
    let [t, i] = addon_image_vt(r);
    return {
      mime: "image/jpeg",
      width: t,
      height: i
    };
  }
  return e[0] === 944130375 && (r[4] === 55 || r[4] === 57) && r[5] === 97 ? {
    mime: "image/gif",
    width: r[7] << 8 | r[6],
    height: r[9] << 8 | r[8]
  } : addon_image_J;
}
function addon_image_vt(r) {
  let e = r.length,
    t = 4,
    i = r[t] << 8 | r[t + 1];
  for (;;) {
    if (t += i, t >= e) return [0, 0];
    if (r[t] !== 255) return [0, 0];
    if (r[t + 1] === 192 || r[t + 1] === 194) return t + 8 < e ? [r[t + 7] << 8 | r[t + 8], r[t + 5] << 8 | r[t + 6]] : [0, 0];
    t += 2, i = r[t] << 8 | r[t + 1];
  }
}
var addon_image_St = 4194304,
  addon_image_Qe = {
    name: "Unnamed file",
    size: 0,
    width: "auto",
    height: "auto",
    preserveAspectRatio: 1,
    inline: 0
  },
  addon_image_Ae = class {
    constructor(e, t, i, s) {
      this._opts = e;
      this._renderer = t;
      this._storage = i;
      this._coreTerminal = s;
      this._aborted = !1;
      this._hp = new addon_image_ne();
      this._header = addon_image_Qe;
      this._dec = new addon_image_qe.default(addon_image_St);
      this._metrics = addon_image_J;
    }
    reset() {}
    start() {
      this._aborted = !1, this._header = addon_image_Qe, this._metrics = addon_image_J, this._hp.reset();
    }
    put(e, t, i) {
      if (!this._aborted) if (this._hp.state === 4) this._dec.put(e, t, i) && (this._dec.release(), this._aborted = !0);else {
        let s = this._hp.parse(e, t, i);
        if (s === -1) {
          this._aborted = !0;
          return;
        }
        if (s > 0) {
          if (this._header = Object.assign({}, addon_image_Qe, this._hp.fields), !this._header.inline || !this._header.size || this._header.size > this._opts.iipSizeLimit) {
            this._aborted = !0;
            return;
          }
          this._dec.init(this._header.size), this._dec.put(e, s, i) && (this._dec.release(), this._aborted = !0);
        }
      }
    }
    end(e) {
      if (this._aborted) return !0;
      let t = 0,
        i = 0,
        s = !0;
      if ((s = e) && (s = !this._dec.end()) && (this._metrics = addon_image_ze(this._dec.data8), (s = this._metrics.mime !== "unsupported") && (t = this._metrics.width, i = this._metrics.height, (s = t && i && t * i < this._opts.pixelLimit) && ([t, i] = this._resize(t, i).map(Math.floor), s = t && i && t * i < this._opts.pixelLimit))), !s) return this._dec.release(), !0;
      let n = new Blob([this._dec.data8], {
        type: this._metrics.mime
      });
      if (this._dec.release(), !window.createImageBitmap) {
        let A = URL.createObjectURL(n),
          o = new Image();
        return new Promise(a => {
          o.addEventListener("load", () => {
            URL.revokeObjectURL(A);
            let c = addon_image_T.createCanvas(window.document, t, i);
            c.getContext("2d")?.drawImage(o, 0, 0, t, i), this._storage.addImage(c), a(!0);
          }), o.src = A, setTimeout(() => a(!0), 1e3);
        });
      }
      return createImageBitmap(n, {
        resizeWidth: t,
        resizeHeight: i
      }).then(A => (this._storage.addImage(A), !0));
    }
    _resize(e, t) {
      let i = this._renderer.dimensions?.css.cell.width || addon_image_S.width,
        s = this._renderer.dimensions?.css.cell.height || addon_image_S.height,
        n = this._renderer.dimensions?.css.canvas.width || i * this._coreTerminal.cols,
        A = this._renderer.dimensions?.css.canvas.height || s * this._coreTerminal.rows,
        o = this._dim(this._header.width, n, i),
        a = this._dim(this._header.height, A, s);
      if (!o && !a) {
        let c = n / e,
          h = (A - s) / t,
          l = Math.min(c, h);
        return l < 1 ? [e * l, t * l] : [e, t];
      }
      return o ? this._header.preserveAspectRatio || !o || !a ? [o, t * o / e] : [o, a] : [e * a / t, a];
    }
    _dim(e, t, i) {
      return e === "auto" ? 0 : e.endsWith("%") ? parseInt(e.slice(0, -1)) * t / 100 : e.endsWith("px") ? parseInt(e.slice(0, -2)) : parseInt(e) * i;
    }
  };
var addon_image_w = addon_image_Y(addon_image_W());
var addon_image_$e = addon_image_Y(addon_image_Xe());
var addon_image_Nt = 4194304,
  addon_image_De = addon_image_w.PALETTE_ANSI_256;
addon_image_De.set(addon_image_w.PALETTE_VT340_COLOR);
var addon_image_ce = class {
  constructor(e, t, i) {
    this._opts = e;
    this._storage = t;
    this._coreTerminal = i;
    this._size = 0;
    this._aborted = !1;
    (0, addon_image_$e.DecoderAsync)({
      memoryLimit: this._opts.pixelLimit * 4,
      palette: addon_image_De,
      paletteLimit: this._opts.sixelPaletteLimit
    }).then(s => this._dec = s);
  }
  reset() {
    this._dec && (this._dec.release(), this._dec._palette.fill(0), this._dec.init(0, addon_image_De, this._opts.sixelPaletteLimit));
  }
  hook(e) {
    if (this._size = 0, this._aborted = !1, this._dec) {
      let t = e.params[1] === 1 ? 0 : addon_image_Ht(this._coreTerminal._core._inputHandler._curAttrData, this._coreTerminal._core._themeService?.colors);
      this._dec.init(t, null, this._opts.sixelPaletteLimit);
    }
  }
  put(e, t, i) {
    if (!(this._aborted || !this._dec)) {
      if (this._size += i - t, this._size > this._opts.sixelSizeLimit) {
        console.warn("SIXEL: too much data, aborting"), this._aborted = !0, this._dec.release();
        return;
      }
      try {
        this._dec.decode(e, t, i);
      } catch (s) {
        console.warn(`SIXEL: error while decoding image - ${s}`), this._aborted = !0, this._dec.release();
      }
    }
  }
  unhook(e) {
    if (this._aborted || !e || !this._dec) return !0;
    let t = this._dec.width,
      i = this._dec.height;
    if (!t || !i) return i && this._storage.advanceCursor(i), !0;
    let s = addon_image_T.createCanvas(void 0, t, i);
    return s.getContext("2d")?.putImageData(new ImageData(this._dec.data8, t, i), 0, 0), this._dec.memoryUsage > addon_image_Nt && this._dec.release(), this._storage.addImage(s), !0;
  }
};
function addon_image_Ht(r, e) {
  let t = 0;
  if (!e) return t;
  if (r.isInverse()) {
    if (r.isFgDefault()) t = addon_image_le(e.foreground.rgba);else if (r.isFgRGB()) {
      let i = r.constructor.toColorRGB(r.getFgColor());
      t = (0, addon_image_w.toRGBA8888)(...i);
    } else t = addon_image_le(e.ansi[r.getFgColor()].rgba);
  } else if (r.isBgDefault()) t = addon_image_le(e.background.rgba);else if (r.isBgRGB()) {
    let i = r.constructor.toColorRGB(r.getBgColor());
    t = (0, addon_image_w.toRGBA8888)(...i);
  } else t = addon_image_le(e.ansi[r.getBgColor()].rgba);
  return t;
}
function addon_image_le(r) {
  return addon_image_w.BIG_ENDIAN ? r : (r & 255) << 24 | (r >>> 8 & 255) << 16 | (r >>> 16 & 255) << 8 | r >>> 24 & 255;
}
var addon_image_et = {
    enableSizeReports: !0,
    pixelLimit: 16777216,
    sixelSupport: !0,
    sixelScrolling: !0,
    sixelPaletteLimit: 256,
    sixelSizeLimit: 25e6,
    storageLimit: 128,
    showPlaceholder: !0,
    iipSupport: !0,
    iipSizeLimit: 2e7
  },
  addon_image_tt = 4096;
var addon_image_it = class {
  constructor(e) {
    this._disposables = [];
    this._handlers = new Map();
    this._opts = Object.assign({}, addon_image_et, e), this._defaultOpts = Object.assign({}, addon_image_et, e);
  }
  dispose() {
    for (let e of this._disposables) e.dispose();
    this._disposables.length = 0, this._handlers.clear();
  }
  _disposeLater(...e) {
    for (let t of e) this._disposables.push(t);
  }
  activate(e) {
    if (this._terminal = e, this._renderer = new addon_image_T(e), this._storage = new addon_image_ie(e, this._renderer, this._opts), this._opts.enableSizeReports) {
      let t = e.options.windowOptions || {};
      t.getWinSizePixels = !0, t.getCellSizePixels = !0, t.getWinSizeChars = !0, e.options.windowOptions = t;
    }
    if (this._disposeLater(this._renderer, this._storage, e.parser.registerCsiHandler({
      prefix: "?",
      final: "h"
    }, t => this._decset(t)), e.parser.registerCsiHandler({
      prefix: "?",
      final: "l"
    }, t => this._decrst(t)), e.parser.registerCsiHandler({
      final: "c"
    }, t => this._da1(t)), e.parser.registerCsiHandler({
      prefix: "?",
      final: "S"
    }, t => this._xtermGraphicsAttributes(t)), e.onRender(t => this._storage?.render(t)), e.parser.registerCsiHandler({
      intermediates: "!",
      final: "p"
    }, () => this.reset()), e.parser.registerEscHandler({
      final: "c"
    }, () => this.reset()), e._core._inputHandler.onRequestReset(() => this.reset()), e.buffer.onBufferChange(() => this._storage?.wipeAlternate()), e.onResize(t => this._storage?.viewportResize(t))), this._opts.sixelSupport) {
      let t = new addon_image_ce(this._opts, this._storage, e);
      this._handlers.set("sixel", t), this._disposeLater(e._core._inputHandler._parser.registerDcsHandler({
        final: "q"
      }, t));
    }
    if (this._opts.iipSupport) {
      let t = new addon_image_Ae(this._opts, this._renderer, this._storage, e);
      this._handlers.set("iip", t), this._disposeLater(e._core._inputHandler._parser.registerOscHandler(1337, t));
    }
  }
  reset() {
    this._opts.sixelScrolling = this._defaultOpts.sixelScrolling, this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit, this._storage?.reset();
    for (let e of this._handlers.values()) e.reset();
    return !1;
  }
  get storageLimit() {
    return this._storage?.getLimit() || -1;
  }
  set storageLimit(e) {
    this._storage?.setLimit(e), this._opts.storageLimit = e;
  }
  get storageUsage() {
    return this._storage ? this._storage.getUsage() : -1;
  }
  get showPlaceholder() {
    return this._opts.showPlaceholder;
  }
  set showPlaceholder(e) {
    this._opts.showPlaceholder = e, this._renderer?.showPlaceholder(e);
  }
  getImageAtBufferCell(e, t) {
    return this._storage?.getImageAtBufferCell(e, t);
  }
  extractTileAtBufferCell(e, t) {
    return this._storage?.extractTileAtBufferCell(e, t);
  }
  _report(e) {
    this._terminal?._core.coreService.triggerDataEvent(e);
  }
  _decset(e) {
    for (let t = 0; t < e.length; ++t) switch (e[t]) {
      case 80:
        this._opts.sixelScrolling = !1;
        break;
    }
    return !1;
  }
  _decrst(e) {
    for (let t = 0; t < e.length; ++t) switch (e[t]) {
      case 80:
        this._opts.sixelScrolling = !0;
        break;
    }
    return !1;
  }
  _da1(e) {
    return e[0] ? !0 : this._opts.sixelSupport ? (this._report("\x1B[?62;4;9;22c"), !0) : !1;
  }
  _xtermGraphicsAttributes(e) {
    if (e.length < 2) return !0;
    if (e[0] === 1) switch (e[1]) {
      case 1:
        return this._report(`\x1B[?${e[0]};0;${this._opts.sixelPaletteLimit}S`), !0;
      case 2:
        this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit, this._report(`\x1B[?${e[0]};0;${this._opts.sixelPaletteLimit}S`);
        for (let t of this._handlers.values()) t.reset();
        return !0;
      case 3:
        return e.length > 2 && !(e[2] instanceof Array) && e[2] <= addon_image_tt ? (this._opts.sixelPaletteLimit = e[2], this._report(`\x1B[?${e[0]};0;${this._opts.sixelPaletteLimit}S`)) : this._report(`\x1B[?${e[0]};2S`), !0;
      case 4:
        return this._report(`\x1B[?${e[0]};0;${addon_image_tt}S`), !0;
      default:
        return this._report(`\x1B[?${e[0]};2S`), !0;
    }
    if (e[0] === 2) switch (e[1]) {
      case 1:
        let t = this._renderer?.dimensions?.css.canvas.width,
          i = this._renderer?.dimensions?.css.canvas.height;
        if (!t || !i) {
          let n = addon_image_S;
          t = (this._terminal?.cols || 80) * n.width, i = (this._terminal?.rows || 24) * n.height;
        }
        if (t * i < this._opts.pixelLimit) this._report(`\x1B[?${e[0]};0;${t.toFixed(0)};${i.toFixed(0)}S`);else {
          let n = Math.floor(Math.sqrt(this._opts.pixelLimit));
          this._report(`\x1B[?${e[0]};0;${n};${n}S`);
        }
        return !0;
      case 4:
        let s = Math.floor(Math.sqrt(this._opts.pixelLimit));
        return this._report(`\x1B[?${e[0]};0;${s};${s}S`), !0;
      default:
        return this._report(`\x1B[?${e[0]};2S`), !0;
    }
    return this._report(`\x1B[?${e[0]};1S`), !0;
  }
};

// EXTERNAL MODULE: ./node_modules/@xterm/addon-canvas/lib/addon-canvas.js
var addon_canvas = __webpack_require__(3421);
;// ./src/helpers.ts
function getTerminalBackgroundColor(config, themes, scheme) {
    const appTheme = themes.findCurrentTheme();
    const appColorScheme = themes._getActiveColorScheme();
    // Use non transparent background when:
    // - legacy theme and user choses colorScheme based BG
    // - or new theme but profile-specific scheme is used
    const shouldUseCSBackground = !appTheme.followsColorScheme && config.store.terminal.background === 'colorScheme'
        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
        || appTheme.followsColorScheme && (scheme === null || scheme === void 0 ? void 0 : scheme.name) !== appColorScheme.name;
    return shouldUseCSBackground && scheme ? scheme.background : null;
}

// EXTERNAL MODULE: ../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(5334);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ../node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(4623);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ../node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(8869);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(1734);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ../node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(658);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ../node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(5367);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ../node_modules/css-loader/dist/cjs.js!./src/frontends/xterm.css
var xterm = __webpack_require__(2187);
;// ./src/frontends/xterm.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var update = injectStylesIntoStyleTag_default()(xterm/* default */.A, options);




       /* harmony default export */ const frontends_xterm = (xterm/* default */.A && xterm/* default */.A.locals ? xterm/* default */.A.locals : undefined);

;// ./src/frontends/xtermFrontend.ts

















const COLOR_NAMES = [
    'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white',
    'brightBlack', 'brightRed', 'brightGreen', 'brightYellow', 'brightBlue', 'brightMagenta', 'brightCyan', 'brightWhite',
];
class FlowControl {
    constructor(xterm) {
        this.xterm = xterm;
        this.blocked = false;
        this.blocked$ = new external_rxjs_.BehaviorSubject(false);
        this.pendingCallbacks = 0;
        this.lowWatermark = 5;
        this.highWatermark = 10;
        this.bytesWritten = 0;
        this.bytesThreshold = 1024 * 128;
    }
    write(data) {
        return __awaiter(this, void 0, void 0, function* () {
            if (this.blocked) {
                yield (0,external_rxjs_.firstValueFrom)(this.blocked$.pipe((0,external_rxjs_.filter)(x => !x)));
            }
            this.bytesWritten += data.length;
            if (this.bytesWritten > this.bytesThreshold) {
                this.pendingCallbacks++;
                this.bytesWritten = 0;
                if (!this.blocked && this.pendingCallbacks > this.highWatermark) {
                    this.blocked = true;
                    this.blocked$.next(true);
                }
                this.xterm.write(data, () => {
                    this.pendingCallbacks--;
                    if (this.blocked && this.pendingCallbacks < this.lowWatermark) {
                        this.blocked = false;
                        this.blocked$.next(false);
                    }
                });
            }
            else {
                this.xterm.write(data);
            }
        });
    }
}
/** @hidden */
class XTermFrontend extends Frontend {
    constructor(injector) {
        super(injector);
        this.enableResizing = true;
        this.enableWebGL = false;
        this.configuredFontSize = 0;
        this.configuredLinePadding = 0;
        this.zoom = 0;
        this.configuredTheme = {};
        this.copyOnSelect = false;
        this.preventNextOnSelectionChangeEvent = false;
        this.search = new addon_search_ut();
        this.searchState = { resultCount: 0 };
        this.fitAddon = new o();
        this.serializeAddon = new addon_serialize_D();
        this.opened = false;
        this.pinnedToBottom = true;
        this.configService = injector.get(external_tabby_core_.ConfigService);
        this.hotkeysService = injector.get(external_tabby_core_.HotkeysService);
        this.platformService = injector.get(external_tabby_core_.PlatformService);
        this.hostApp = injector.get(external_tabby_core_.HostAppService);
        this.themes = injector.get(external_tabby_core_.ThemesService);
        this.notifications = injector.get(external_tabby_core_.NotificationsService);
        this.translate = injector.get(external_tabby_core_.TranslateService);
        this.xterm = new Dl({
            allowTransparency: true,
            allowProposedApi: true,
            overviewRuler: {
                width: 8,
                showBottomBorder: false,
                showTopBorder: false,
            },
            reflowCursorLine: true,
            windowsPty: process.platform === 'win32' ? {
                backend: this.configService.store.terminal.useConPTY ? 'conpty' : 'winpty',
                buildNumber: (0,external_tabby_core_.getWindows10Build)(),
            } : undefined,
        });
        this.flowControl = new FlowControl(this.xterm);
        this.xtermCore = this.xterm['_core'];
        this.xterm.onBinary(data => {
            this.input.next(Buffer.from(data, 'binary'));
        });
        this.xterm.onData(data => {
            this.input.next(Buffer.from(data, 'utf-8'));
        });
        this.xterm.onResize(({ cols, rows }) => {
            this.resize.next({ rows, columns: cols });
        });
        this.xterm.onTitleChange(title => {
            this.title.next(title);
        });
        this.xterm.onSelectionChange(() => {
            if (this.getSelection()) {
                if (this.copyOnSelect && !this.preventNextOnSelectionChangeEvent) {
                    this.copySelection();
                }
                this.preventNextOnSelectionChangeEvent = false;
            }
        });
        this.xterm.onBell(() => {
            this.bell.next();
        });
        this.xterm.loadAddon(this.fitAddon);
        this.xterm.loadAddon(this.serializeAddon);
        this.xterm.loadAddon(new addon_unicode11_Ke());
        this.xterm.loadAddon(new addon_clipboard_j(undefined, {
            readText: () => __awaiter(this, void 0, void 0, function* () {
                return this.platformService.readClipboard();
            }),
            writeText: (_, text) => __awaiter(this, void 0, void 0, function* () {
                this.platformService.setClipboard({ text });
                this.notifications.notice(this.translate.instant('Copied'));
            }),
        }));
        this.xterm.unicode.activeVersion = '11';
        if (this.configService.store.terminal.sixel) {
            this.xterm.loadAddon(new addon_image_it());
        }
        const keyboardEventHandler = (name, event) => {
            if (this.isAlternateScreenActive()) {
                let modifiers = 0;
                modifiers += event.ctrlKey ? 1 : 0;
                modifiers += event.altKey ? 1 : 0;
                modifiers += event.shiftKey ? 1 : 0;
                modifiers += event.metaKey ? 1 : 0;
                if (event.key.startsWith('Arrow') && modifiers === 1) {
                    return true;
                }
            }
            // Ctrl-/
            if (event.type === 'keydown' && event.key === '/' && event.ctrlKey) {
                this.input.next(Buffer.from('\u001f', 'binary'));
                return false;
            }
            // Ctrl-@
            if (event.type === 'keydown' && event.key === '@' && event.ctrlKey) {
                this.input.next(Buffer.from('\u0000', 'binary'));
                return false;
            }
            this.hotkeysService.pushKeyEvent(name, event);
            let ret = true;
            if (this.hotkeysService.matchActiveHotkey(true) !== null) {
                event.stopPropagation();
                event.preventDefault();
                ret = false;
            }
            return ret;
        };
        this.xterm.attachCustomKeyEventHandler((event) => {
            if (this.hostApp.platform !== external_tabby_core_.Platform.Web) {
                if (event.getModifierState('Meta') && event.key.toLowerCase() === 'v' ||
                    event.key === 'Insert' && event.shiftKey) {
                    event.preventDefault();
                    return false;
                }
            }
            if (event.getModifierState('Meta') && event.key.startsWith('Arrow')) {
                return false;
            }
            return keyboardEventHandler('keydown', event);
        });
        this.xtermCore._scrollToBottom = this.xtermCore.scrollToBottom.bind(this.xtermCore);
        this.xtermCore.scrollToBottom = () => null;
        // NOTE: xterm.onScroll only fires for content-driven scroll (new lines),
        // NOT for user wheel/keyboard scroll (xterm.js #3864, #3201). During
        // fast output, viewportY transiently equals baseY during xterm's
        // internal processing, so onScroll would falsely re-pin. We do NOT
        // use onScroll for pin state. Re-pinning happens only via:
        //   - wheel/keyboard event listeners (below)
        //   - explicit scrollToBottom() calls
        this.resizeHandler = () => {
            try {
                if (this.xterm.element && getComputedStyle(this.xterm.element).getPropertyValue('height') !== 'auto') {
                    const savedPinned = this.pinnedToBottom;
                    const savedViewportY = this.xterm.buffer.active.viewportY;
                    this.fitAddon.fit();
                    this.xterm.refresh(0, this.xterm.rows - 1);
                    if (savedPinned) {
                        this.xtermCore._scrollToBottom();
                    }
                    else {
                        // Restore the previous scroll position after fit
                        const maxScroll = this.xterm.buffer.active.baseY;
                        const targetY = Math.min(savedViewportY, maxScroll);
                        this.xterm.scrollToLine(targetY);
                    }
                }
            }
            catch (e) {
                // tends to throw when element wasn't shown yet
                console.warn('Could not resize xterm', e);
            }
        };
        const oldKeyUp = this.xtermCore._keyUp.bind(this.xtermCore);
        this.xtermCore._keyUp = (e) => {
            this.xtermCore.updateCursorStyle(e);
            if (keyboardEventHandler('keyup', e)) {
                oldKeyUp(e);
            }
        };
        this.xterm.buffer.onBufferChange(() => {
            const altBufferActive = this.xterm.buffer.active.type === 'alternate';
            this.alternateScreenActive.next(altBufferActive);
        });
    }
    isAtBottom() {
        const buffer = this.xterm.buffer.active;
        return buffer.viewportY >= buffer.baseY - 1;
    }
    updatePinnedState() {
        this.pinnedToBottom = this.isAtBottom();
    }
    attach(host, profile) {
        return __awaiter(this, void 0, void 0, function* () {
            this.element = host;
            this.xterm.open(host);
            this.opened = true;
            // Work around font loading bugs
            yield new Promise(resolve => setTimeout(resolve, this.hostApp.platform === external_tabby_core_.Platform.Web ? 1000 : 0));
            // Just configure the colors to avoid a flash
            this.configureColors(profile.terminalColorScheme);
            if (this.enableWebGL) {
                this.webGLAddon = new addon_webgl_xr();
                this.xterm.loadAddon(this.webGLAddon);
                this.platformService.displayMetricsChanged$.pipe((0,external_rxjs_.takeUntil)(this.destroyed$)).subscribe(() => {
                    var _a;
                    (_a = this.webGLAddon) === null || _a === void 0 ? void 0 : _a.clearTextureAtlas();
                });
            }
            else {
                this.canvasAddon = new addon_canvas.CanvasAddon();
                this.xterm.loadAddon(this.canvasAddon);
                this.platformService.displayMetricsChanged$.pipe((0,external_rxjs_.takeUntil)(this.destroyed$)).subscribe(() => {
                    var _a;
                    (_a = this.canvasAddon) === null || _a === void 0 ? void 0 : _a.clearTextureAtlas();
                });
            }
            // Allow an animation frame
            yield new Promise(r => setTimeout(r, 100));
            this.ready.next();
            this.ready.complete();
            this.xterm.loadAddon(this.search);
            this.search.onDidChangeResults(state => {
                this.searchState = state;
            });
            window.addEventListener('resize', this.resizeHandler);
            this.resizeHandler();
            // Allow an animation frame
            yield new Promise(r => setTimeout(r, 0));
            // User-initiated scroll detection: only wheel and keyboard events
            // should unpin. xterm.onScroll is content-driven only and must never
            // unpin (see constructor comment). Use capture phase — xterm.js
            // handles wheel/key events on its internal viewport element and may
            // stop propagation, so bubbling listeners on host would never fire.
            host.addEventListener('wheel', (event) => {
                // Immediately unpin on scroll-up so that writes arriving before
                // the next animation frame don't yank the viewport back down.
                if (event.deltaY < 0) {
                    this.pinnedToBottom = false;
                }
                requestAnimationFrame(() => this.updatePinnedState());
            }, { capture: true, passive: true });
            this.hotkeysService.hotkey$
                .pipe((0,external_rxjs_.takeUntil)(this.destroyed$), (0,external_rxjs_.filter)(hk => [
                'scroll-up',
                'scroll-down',
                'scroll-page-up',
                'scroll-page-down',
                'scroll-to-top',
                'scroll-to-bottom',
            ].includes(hk))).subscribe(hk => {
                if ([
                    'scroll-up',
                    'scroll-page-up',
                    'scroll-to-top',
                ].includes(hk)) {
                    this.pinnedToBottom = false;
                }
                requestAnimationFrame(() => this.updatePinnedState());
            });
            host.addEventListener('dragOver', (event) => this.dragOver.next(event));
            host.addEventListener('drop', event => this.drop.next(event));
            host.addEventListener('mousedown', event => this.mouseEvent.next(event));
            host.addEventListener('mouseup', event => this.mouseEvent.next(event));
            host.addEventListener('mousewheel', event => this.mouseEvent.next(event));
            host.addEventListener('contextmenu', event => {
                event.preventDefault();
                event.stopPropagation();
            });
            this.resizeObserver = new window['ResizeObserver'](() => setTimeout(() => this.resizeHandler()));
            this.resizeObserver.observe(host);
        });
    }
    detach(_host) {
        var _a;
        window.removeEventListener('resize', this.resizeHandler);
        (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
        delete this.resizeObserver;
    }
    destroy() {
        var _a, _b;
        super.destroy();
        (_a = this.webGLAddon) === null || _a === void 0 ? void 0 : _a.dispose();
        (_b = this.canvasAddon) === null || _b === void 0 ? void 0 : _b.dispose();
        this.xterm.dispose();
    }
    getSelection() {
        return this.xterm.getSelection();
    }
    copySelection() {
        const text = this.getSelection();
        if (!text.trim().length) {
            return;
        }
        if (text.length < 1024 * 32 && this.configService.store.terminal.copyAsHTML) {
            this.platformService.setClipboard({
                text: this.getSelection(),
                html: this.getSelectionAsHTML(),
            });
        }
        else {
            this.platformService.setClipboard({
                text: this.getSelection(),
            });
        }
    }
    selectAll() {
        this.xterm.selectAll();
    }
    clearSelection() {
        this.xterm.clearSelection();
    }
    focus() {
        setTimeout(() => this.xterm.focus());
    }
    write(data) {
        return __awaiter(this, void 0, void 0, function* () {
            // Capture pinned state before the write — the async write yields
            // to the event loop, and RAF callbacks (e.g. from wheel events)
            // could change pinnedToBottom mid-write.
            const wasPinned = this.pinnedToBottom;
            const savedViewportY = this.xterm.buffer.active.viewportY;
            yield this.flowControl.write(data);
            if (wasPinned) {
                this.xtermCore._scrollToBottom();
            }
            else {
                // Restore scroll position — xterm internally disturbs viewportY
                // during fast output, and the patched-out scrollToBottom no-op
                // prevents xterm from correcting it.
                const maxScroll = this.xterm.buffer.active.baseY;
                const targetY = Math.min(savedViewportY, maxScroll);
                if (this.xterm.buffer.active.viewportY !== targetY) {
                    this.xterm.scrollToLine(targetY);
                }
            }
        });
    }
    clear() {
        this.xterm.clear();
    }
    visualBell() {
        if (this.element) {
            this.element.style.animation = 'none';
            setTimeout(() => {
                this.element.style.animation = 'terminalShakeFrames 0.3s ease';
            });
        }
    }
    scrollToTop() {
        this.pinnedToBottom = false;
        this.xterm.scrollToTop();
    }
    scrollPages(pages) {
        this.xterm.scrollPages(pages);
        this.updatePinnedState();
    }
    scrollLines(amount) {
        this.xterm.scrollLines(amount);
        this.updatePinnedState();
    }
    scrollToBottom() {
        this.pinnedToBottom = true;
        this.xtermCore._scrollToBottom();
    }
    configureColors(scheme) {
        var _a, _b, _c;
        const appColorScheme = this.themes._getActiveColorScheme();
        scheme = scheme !== null && scheme !== void 0 ? scheme : appColorScheme;
        const theme = {
            foreground: scheme.foreground,
            selectionBackground: (_a = scheme.selection) !== null && _a !== void 0 ? _a : '#88888888',
            selectionForeground: (_b = scheme.selectionForeground) !== null && _b !== void 0 ? _b : undefined,
            background: (_c = getTerminalBackgroundColor(this.configService, this.themes, scheme)) !== null && _c !== void 0 ? _c : '#00000000',
            cursor: scheme.cursor,
            cursorAccent: scheme.cursorAccent,
            overviewRulerBorder: scheme.background,
        };
        for (let i = 0; i < COLOR_NAMES.length; i++) {
            theme[COLOR_NAMES[i]] = scheme.colors[i];
        }
        theme.scrollbarSliderBackground = theme.brightBlack;
        theme.scrollbarSliderHoverBackground = theme.brightBlack;
        theme.scrollbarSliderHoverBackground = theme.brightBlack;
        if (!deep_equal_default()(this.configuredTheme, theme)) {
            this.xterm.options.theme = theme;
            this.configuredTheme = theme;
        }
    }
    configure(profile) {
        const config = this.configService.store;
        setImmediate(() => {
            if (this.xterm.cols && this.xterm.rows && this.xtermCore.charMeasure) {
                if (this.xtermCore.charMeasure) {
                    this.xtermCore.charMeasure.measure(this.xtermCore.options);
                }
                if (this.xtermCore.renderer) {
                    this.xtermCore.renderer._updateDimensions();
                }
                this.resizeHandler();
            }
        });
        this.xtermCore.browser = Object.assign(Object.assign({}, this.xtermCore.browser), { isWindows: this.hostApp.platform === external_tabby_core_.Platform.Windows, isLinux: this.hostApp.platform === external_tabby_core_.Platform.Linux, isMac: this.hostApp.platform === external_tabby_core_.Platform.macOS });
        this.xterm.options.fontFamily = (0,external_tabby_core_.getCSSFontFamily)(config);
        this.xterm.options.cursorStyle = {
            beam: 'bar',
        }[config.terminal.cursor] || config.terminal.cursor;
        this.xterm.options.cursorBlink = config.terminal.cursorBlink;
        this.xterm.options.macOptionIsMeta = config.terminal.altIsMeta;
        this.xterm.options.scrollback = config.terminal.scrollbackLines;
        this.xterm.options.wordSeparator = config.terminal.wordSeparator;
        this.xterm.options.drawBoldTextInBrightColors = config.terminal.drawBoldTextInBrightColors;
        this.xterm.options.fontWeight = config.terminal.fontWeight;
        this.xterm.options.fontWeightBold = config.terminal.fontWeightBold;
        this.xterm.options.minimumContrastRatio = config.terminal.minimumContrastRatio;
        this.configuredFontSize = config.terminal.fontSize;
        this.configuredLinePadding = config.terminal.linePadding;
        this.setFontSize();
        this.copyOnSelect = config.terminal.copyOnSelect;
        this.configureColors(profile.terminalColorScheme);
        if (this.opened && config.terminal.ligatures && !this.ligaturesAddon && this.hostApp.platform !== external_tabby_core_.Platform.Web) {
            this.ligaturesAddon = new addon_ligatures_Es();
            this.xterm.loadAddon(this.ligaturesAddon);
        }
    }
    setZoom(zoom) {
        this.zoom = zoom;
        this.setFontSize();
        this.resizeHandler();
    }
    getSearchOptions(searchOptions) {
        return Object.assign(Object.assign({}, searchOptions), { decorations: {
                matchOverviewRuler: '#888888',
                activeMatchColorOverviewRuler: '#ffff00',
                matchBackground: '#888888',
                activeMatchBackground: '#ffff00',
            } });
    }
    wrapSearchResult(result) {
        if (!result) {
            return { resultCount: 0 };
        }
        return this.searchState;
    }
    findNext(term, searchOptions) {
        if (this.copyOnSelect) {
            this.preventNextOnSelectionChangeEvent = true;
        }
        return this.wrapSearchResult(this.search.findNext(term, this.getSearchOptions(searchOptions)));
    }
    findPrevious(term, searchOptions) {
        if (this.copyOnSelect) {
            this.preventNextOnSelectionChangeEvent = true;
        }
        return this.wrapSearchResult(this.search.findPrevious(term, this.getSearchOptions(searchOptions)));
    }
    cancelSearch() {
        this.search.clearDecorations();
        this.focus();
    }
    saveState() {
        return this.serializeAddon.serialize({
            excludeAltBuffer: true,
            excludeModes: true,
            scrollback: 1000,
        });
    }
    restoreState(state) {
        this.xterm.write(state);
    }
    supportsBracketedPaste() {
        return this.xterm.modes.bracketedPasteMode;
    }
    isAlternateScreenActive() {
        return this.xterm.buffer.active.type === 'alternate';
    }
    setFontSize() {
        const scale = Math.pow(1.1, this.zoom);
        this.xterm.options.fontSize = this.configuredFontSize * scale;
        // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
        this.xterm.options.lineHeight = Math.max(1, (this.configuredFontSize + this.configuredLinePadding * 2) / this.configuredFontSize);
        this.resizeHandler();
    }
    getSelectionAsHTML() {
        return this.serializeAddon.serializeAsHTML({ includeGlobalBackground: true, onlySelection: true });
    }
}
/** @hidden */
class XTermWebGLFrontend extends XTermFrontend {
    constructor() {
        super(...arguments);
        this.enableWebGL = true;
    }
}

;// ./src/api/decorator.ts
/**
 * Extend to automatically run actions on new terminals
 */
class TerminalDecorator {
    constructor() {
        this.smartSubscriptions = new Map();
    }
    /**
     * Called when a new terminal tab starts
     */
    attach(terminal) { } // eslint-disable-line
    /**
     * Called before a terminal tab is destroyed.
     * Make sure to call super()
     */
    detach(terminal) {
        var _a;
        for (const s of (_a = this.smartSubscriptions.get(terminal)) !== null && _a !== void 0 ? _a : []) {
            s.unsubscribe();
        }
        this.smartSubscriptions.delete(terminal);
    }
    /**
     * Automatically cancel @subscription once detached from @terminal
     */
    subscribeUntilDetached(terminal, subscription) {
        var _a;
        if (!subscription) {
            return;
        }
        if (!this.smartSubscriptions.has(terminal)) {
            this.smartSubscriptions.set(terminal, []);
        }
        (_a = this.smartSubscriptions.get(terminal)) === null || _a === void 0 ? void 0 : _a.push(subscription);
    }
}

;// ./src/services/multifocus.service.ts




let MultifocusService = class MultifocusService {
    constructor(app, hotkeys, translate) {
        this.app = app;
        this.inputSubscription = null;
        this.currentTab = null;
        this.warningElement = document.createElement('div');
        this.warningElement.className = 'broadcast-status-warning';
        this.warningElement.innerText = translate.instant('Broadcast mode. Click anywhere to cancel.');
        this.warningElement.style.display = 'none';
        document.body.appendChild(this.warningElement);
        hotkeys.hotkey$.subscribe(hotkey => {
            switch (hotkey) {
                case 'focus-all-tabs':
                    this.focusAllTabs();
                    break;
                case 'pane-focus-all':
                    this.focusAllPanes();
                    break;
            }
        });
    }
    start(currentTab, tabs) {
        var _a, _b;
        if (this.inputSubscription) {
            return;
        }
        if (currentTab.parent instanceof external_tabby_core_.SplitTabComponent) {
            const parent = currentTab.parent;
            parent._allFocusMode = true;
            parent.layout();
        }
        this.currentTab = currentTab;
        this.inputSubscription = (_b = (_a = currentTab.frontend) === null || _a === void 0 ? void 0 : _a.input$.subscribe(data => {
            for (const tab of tabs) {
                if (tab !== currentTab) {
                    tab.sendInput(data);
                }
            }
        })) !== null && _b !== void 0 ? _b : null;
    }
    cancel() {
        var _a;
        this.warningElement.style.display = 'none';
        document.querySelector('app-root')['style'].border = 'none';
        if (!this.inputSubscription) {
            return;
        }
        this.inputSubscription.unsubscribe();
        this.inputSubscription = null;
        if (((_a = this.currentTab) === null || _a === void 0 ? void 0 : _a.parent) instanceof external_tabby_core_.SplitTabComponent) {
            this.currentTab.parent._allFocusMode = false;
            this.currentTab.parent.layout();
        }
        this.currentTab = null;
    }
    focusAllTabs() {
        let currentTab = this.app.activeTab;
        if (currentTab && currentTab instanceof external_tabby_core_.SplitTabComponent) {
            currentTab = currentTab.getFocusedTab();
        }
        if (!currentTab || !(currentTab instanceof BaseTerminalTabComponent)) {
            return;
        }
        const tabs = this.app.tabs
            .map((t => {
            if (t instanceof BaseTerminalTabComponent) {
                return [t];
            }
            else if (t instanceof external_tabby_core_.SplitTabComponent) {
                return t.getAllTabs()
                    .filter(x => x instanceof BaseTerminalTabComponent);
            }
            else {
                return [];
            }
        }))
            .flat();
        this.start(currentTab, tabs);
        this.warningElement.style.display = 'block';
        document.querySelector('app-root')['style'].border = '5px solid red';
    }
    focusAllPanes() {
        const currentTab = this.app.activeTab;
        if (!currentTab || !(currentTab instanceof external_tabby_core_.SplitTabComponent)) {
            return;
        }
        const pane = currentTab.getFocusedTab();
        if (!pane || !(pane instanceof BaseTerminalTabComponent)) {
            return;
        }
        const tabs = currentTab.getAllTabs().filter(t => t instanceof BaseTerminalTabComponent);
        // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
        this.start(pane, tabs);
    }
};
MultifocusService.ctorParameters = () => [
    { type: external_tabby_core_.AppService },
    { type: external_tabby_core_.HotkeysService },
    { type: external_tabby_core_.TranslateService }
];
MultifocusService = __decorate([
    (0,core_.Injectable)({ providedIn: 'root' }),
    __metadata("design:paramtypes", [external_tabby_core_.AppService,
        external_tabby_core_.HotkeysService,
        external_tabby_core_.TranslateService])
], MultifocusService);


;// ./src/api/baseTerminalTab.component.ts
var BaseTerminalTabComponent_1;












const INACTIVE_TAB_UNLOAD_DELAY = 1000 * 30;
const OSC_FOCUS_IN = Buffer.from('\x1b[I');
const OSC_FOCUS_OUT = Buffer.from('\x1b[O');
/**
 * A class to base your custom terminal tabs on
 */
let BaseTerminalTabComponent = BaseTerminalTabComponent_1 = class BaseTerminalTabComponent extends external_tabby_core_.BaseTabComponent {
    get input$() {
        if (!this.frontend) {
            throw new Error('Frontend not ready');
        }
        return this.frontend.input$;
    }
    get output$() { return this.output; }
    get binaryOutput$() { return this.binaryOutput; }
    get resize$() {
        if (!this.frontend) {
            throw new Error('Frontend not ready');
        }
        return this.frontend.resize$;
    }
    get alternateScreenActive$() {
        if (!this.frontend) {
            throw new Error('Frontend not ready');
        }
        return this.frontend.alternateScreenActive$;
    }
    get frontendReady$() { return this.frontendReady; }
    get sessionChanged$() { return this.sessionChanged; }
    constructor(injector) {
        super(injector);
        this.injector = injector;
        this.session = null;
        this.savedStateIsLive = false;
        this.zoom = 0;
        this.showSearchPanel = false;
        this.backgroundColor = null;
        this.enableToolbar = false;
        this.pinToolbar = false;
        this.revealToolbar = false;
        /** @hidden */
        this.frontendIsReady = false;
        this.frontendReady = new external_rxjs_.Subject();
        /**
         * Enables normal passthrough from session output to terminal input
         */
        this.enablePassthrough = true;
        /**
         * Disables display of dynamic window/tab title provided by the shell
         */
        this.disableDynamicTitle = false;
        this.alternateScreenActive = false;
        this.decorators = [];
        this.output = new external_rxjs_.Subject();
        this.binaryOutput = new external_rxjs_.Subject();
        this.sessionChanged = new external_rxjs_.Subject();
        this.recentInputs = '';
        this.termContainerSubscriptions = new external_tabby_core_.SubscriptionContainer();
        this.sessionHandlers = new external_tabby_core_.SubscriptionContainer();
        this.spinner = new cli_spinner/* Spinner */.y({
            stream: {
                write: x => {
                    try {
                        if (!this.frontend) {
                            return;
                        }
                        this.writeRaw(x);
                    }
                    catch (_a) {
                        this.spinner.stop();
                    }
                },
            },
        });
        this.spinnerActive = false;
        this.spinnerPaused = false;
        this.toolbarRevealTimeout = new external_tabby_core_.ResettableTimeout(() => {
            this.revealToolbar = false;
        }, 1000);
        this.frontendWriteLock = Promise.resolve();
        this.rightMouseDownTime = 0;
        this.config = injector.get(external_tabby_core_.ConfigService);
        this.element = injector.get(core_.ElementRef);
        this.zone = injector.get(core_.NgZone);
        this.app = injector.get(external_tabby_core_.AppService);
        this.hostApp = injector.get(external_tabby_core_.HostAppService);
        this.hotkeys = injector.get(external_tabby_core_.HotkeysService);
        this.platform = injector.get(external_tabby_core_.PlatformService);
        this.notifications = injector.get(external_tabby_core_.NotificationsService);
        this.log = injector.get(external_tabby_core_.LogService);
        this.decorators = injector.get(TerminalDecorator, null, core_.InjectFlags.Optional);
        this.contextMenuProviders = injector.get(external_tabby_core_.TabContextMenuItemProvider, null, core_.InjectFlags.Optional);
        this.hostWindow = injector.get(external_tabby_core_.HostWindowService);
        this.translate = injector.get(external_tabby_core_.TranslateService);
        this.multifocus = injector.get(MultifocusService);
        this.themes = injector.get(external_tabby_core_.ThemesService);
        this.logger = this.log.create('baseTerminalTab');
        this.setTitle(this.translate.instant('Terminal'));
        this.subscribeUntilDestroyed(this.hotkeys.unfilteredHotkey$, (hotkey) => __awaiter(this, void 0, void 0, function* () {
            if (!this.hasFocus) {
                return;
            }
            if (hotkey === 'search') {
                this.showSearchPanel = true;
                setImmediate(() => {
                    var _a, _b;
                    const input = this.element.nativeElement.querySelector('.search-input');
                    const selectedText = ((_b = (_a = this.frontend) === null || _a === void 0 ? void 0 : _a.getSelection()) !== null && _b !== void 0 ? _b : '').trim();
                    if (input && selectedText.length) {
                        input.value = selectedText;
                    }
                    input === null || input === void 0 ? void 0 : input.focus();
                    input === null || input === void 0 ? void 0 : input.select();
                });
            }
        }));
        this.subscribeUntilDestroyed(this.hotkeys.hotkey$, (hotkey) => __awaiter(this, void 0, void 0, function* () {
            var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
            if (!this.hasFocus) {
                return;
            }
            switch (hotkey) {
                case 'ctrl-c':
                    if ((_a = this.frontend) === null || _a === void 0 ? void 0 : _a.getSelection()) {
                        this.frontend.copySelection();
                        this.frontend.clearSelection();
                        this.notifications.notice(this.translate.instant('Copied'));
                    }
                    else {
                        this.forEachFocusedTerminalPane(tab => tab.sendInput('\x03'));
                    }
                    break;
                case 'copy':
                    (_b = this.frontend) === null || _b === void 0 ? void 0 : _b.copySelection();
                    (_c = this.frontend) === null || _c === void 0 ? void 0 : _c.clearSelection();
                    this.notifications.notice(this.translate.instant('Copied'));
                    break;
                case 'paste':
                    this.forEachFocusedTerminalPane(tab => tab.paste());
                    break;
                case 'select-all':
                    (_d = this.frontend) === null || _d === void 0 ? void 0 : _d.selectAll();
                    break;
                case 'clear':
                    this.forEachFocusedTerminalPane(tab => { var _a; return (_a = tab.frontend) === null || _a === void 0 ? void 0 : _a.clear(); });
                    break;
                case 'zoom-in':
                    this.forEachFocusedTerminalPane(tab => tab.zoomIn());
                    break;
                case 'zoom-out':
                    this.forEachFocusedTerminalPane(tab => tab.zoomOut());
                    break;
                case 'reset-zoom':
                    this.forEachFocusedTerminalPane(tab => tab.resetZoom());
                    break;
                case 'previous-word':
                    this.forEachFocusedTerminalPane(tab => {
                        tab.sendInput({
                            [external_tabby_core_.Platform.Windows]: '\x1b[1;5D',
                            [external_tabby_core_.Platform.macOS]: '\x1bb',
                            [external_tabby_core_.Platform.Linux]: '\x1bb',
                        }[this.hostApp.platform]);
                    });
                    break;
                case 'next-word':
                    this.forEachFocusedTerminalPane(tab => {
                        tab.sendInput({
                            [external_tabby_core_.Platform.Windows]: '\x1b[1;5C',
                            [external_tabby_core_.Platform.macOS]: '\x1bf',
                            [external_tabby_core_.Platform.Linux]: '\x1bf',
                        }[this.hostApp.platform]);
                    });
                    break;
                case 'delete-line':
                    this.forEachFocusedTerminalPane(tab => {
                        tab.sendInput('\x1bw');
                    });
                    break;
                case 'delete-previous-word':
                    this.forEachFocusedTerminalPane(tab => {
                        tab.sendInput('\u0017');
                    });
                    break;
                case 'delete-next-word':
                    this.forEachFocusedTerminalPane(tab => {
                        tab.sendInput({
                            [external_tabby_core_.Platform.Windows]: '\x1bd\x1b[3;5~',
                            [external_tabby_core_.Platform.macOS]: '\x1bd',
                            [external_tabby_core_.Platform.Linux]: '\x1bd',
                        }[this.hostApp.platform]);
                    });
                    break;
                case 'copy-current-path':
                    this.copyCurrentPath();
                    break;
                case 'scroll-to-top':
                    (_e = this.frontend) === null || _e === void 0 ? void 0 : _e.scrollToTop();
                    break;
                case 'scroll-page-up':
                    (_f = this.frontend) === null || _f === void 0 ? void 0 : _f.scrollPages(-1);
                    break;
                case 'scroll-up':
                    (_g = this.frontend) === null || _g === void 0 ? void 0 : _g.scrollLines(-1);
                    break;
                case 'scroll-down':
                    (_h = this.frontend) === null || _h === void 0 ? void 0 : _h.scrollLines(1);
                    break;
                case 'scroll-page-down':
                    (_j = this.frontend) === null || _j === void 0 ? void 0 : _j.scrollPages(1);
                    break;
                case 'scroll-to-bottom':
                    (_k = this.frontend) === null || _k === void 0 ? void 0 : _k.scrollToBottom();
                    break;
            }
        }));
        this.bellPlayer = document.createElement('audio');
        this.bellPlayer.src = __webpack_require__(/*! ../bell.ogg */ 5743);
        this.bellPlayer.load();
        this.contextMenuProviders.sort((a, b) => a.weight - b.weight);
    }
    /** @hidden */
    ngOnInit() {
        var _a, _b;
        this.pinToolbar = this.enableToolbar && ((_a = window.localStorage.pinTerminalToolbar) !== null && _a !== void 0 ? _a : 'true') === 'true';
        this.focused$.subscribe(() => {
            var _a;
            this.configure();
            (_a = this.frontend) === null || _a === void 0 ? void 0 : _a.focus();
        });
        this.subscribeUntilDestroyed(this.platform.themeChanged$, () => {
            this.configure();
        });
        // Check if the the WebGL renderer is compatible with xterm.js:
        // - https://github.com/Eugeny/tabby/issues/8884
        // - https://github.com/microsoft/vscode/issues/190195
        // - https://github.com/xtermjs/xterm.js/issues/4665
        // - https://bugs.chromium.org/p/chromium/issues/detail?id=1476475
        //
        // Inspired by https://github.com/microsoft/vscode/pull/191795
        let enable8884Workarround = false;
        const checkCanvas = document.createElement('canvas');
        const checkGl = checkCanvas.getContext('webgl2');
        const debugInfo = checkGl === null || checkGl === void 0 ? void 0 : checkGl.getExtension('WEBGL_debug_renderer_info');
        if (checkGl && debugInfo) {
            const renderer = checkGl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
            if (renderer.startsWith('ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero)')) {
                enable8884Workarround = true;
            }
        }
        const cls = enable8884Workarround ? XTermFrontend : (_b = {
            xterm: XTermFrontend,
            'xterm-webgl': XTermWebGLFrontend,
        }[this.config.store.terminal.frontend]) !== null && _b !== void 0 ? _b : XTermFrontend;
        this.frontend = new cls(this.injector);
        this.frontendReady$.pipe((0,external_rxjs_.first)()).subscribe(() => {
            this.onFrontendReady();
        });
        this.frontend.resize$.pipe((0,external_rxjs_.first)()).subscribe(({ columns, rows }) => __awaiter(this, void 0, void 0, function* () {
            var _c;
            this.size = { columns, rows };
            this.frontendReady.next();
            this.frontendReady.complete();
            this.config.enabledServices(this.decorators).forEach(decorator => {
                try {
                    decorator.attach(this);
                }
                catch (e) {
                    this.logger.warn('Decorator attach() throws', e);
                }
            });
            setTimeout(() => {
                var _a;
                (_a = this.session) === null || _a === void 0 ? void 0 : _a.resize(columns, rows);
            }, 1000);
            (_c = this.session) === null || _c === void 0 ? void 0 : _c.releaseInitialDataBuffer();
            this.sessionChanged$.subscribe(() => {
                var _a;
                (_a = this.session) === null || _a === void 0 ? void 0 : _a.releaseInitialDataBuffer();
            });
        }));
        this.alternateScreenActive$.subscribe(x => {
            this.alternateScreenActive = x;
        });
        setImmediate(() => __awaiter(this, void 0, void 0, function* () {
            var _d, _e;
            if (this.hasFocus) {
                yield ((_d = this.frontend) === null || _d === void 0 ? void 0 : _d.attach(this.content.nativeElement, this.profile));
                (_e = this.frontend) === null || _e === void 0 ? void 0 : _e.configure(this.profile);
            }
            else {
                this.focused$.pipe((0,external_rxjs_.first)()).subscribe(() => __awaiter(this, void 0, void 0, function* () {
                    var _f, _g;
                    yield ((_f = this.frontend) === null || _f === void 0 ? void 0 : _f.attach(this.content.nativeElement, this.profile));
                    (_g = this.frontend) === null || _g === void 0 ? void 0 : _g.configure(this.profile);
                }));
            }
        }));
        this.attachTermContainerHandlers();
        this.configure();
        setTimeout(() => {
            this.binaryOutput$.subscribe(() => {
                this.displayActivity();
            });
        }, 1000);
        this.frontend.bell$.subscribe(() => {
            var _a;
            if (this.config.store.terminal.bell === 'visual') {
                (_a = this.frontend) === null || _a === void 0 ? void 0 : _a.visualBell();
            }
            if (this.config.store.terminal.bell === 'audible') {
                this.bellPlayer.play();
            }
        });
        this.frontend.focus();
        this.blurred$.subscribe(() => {
            this.multifocus.cancel();
        });
        this.visibility$
            .pipe((0,external_rxjs_.debounce)(visibility => (0,external_rxjs_.interval)(visibility ? 0 : INACTIVE_TAB_UNLOAD_DELAY)))
            .subscribe(visibility => {
            var _a;
            if (this.frontend instanceof XTermFrontend) {
                if (visibility) {
                    this.frontend.xterm.refresh(0, this.frontend.xterm.rows - 1);
                }
                else {
                    (_a = this.frontend.xterm.element) === null || _a === void 0 ? void 0 : _a.querySelectorAll('canvas').forEach(c => {
                        c.height = c.width = 0;
                        c.style.height = c.style.width = '0px';
                    });
                }
            }
        });
    }
    onFrontendReady() {
        this.frontendIsReady = true;
        if (this.savedState) {
            this.frontend.restoreState(this.savedState);
            if (!this.savedStateIsLive) {
                this.frontend.write('\r\n\r\n');
                this.frontend.write(ansi_colors_default().bgWhite.black(' * ') + ansi_colors_default().bgBlackBright.white(' History restored '));
                this.frontend.write('\r\n\r\n');
            }
        }
        this.input$.subscribe(data => {
            this.recentInputs += data;
            this.recentInputs = this.recentInputs.substring(this.recentInputs.length - 32);
        });
    }
    buildContextMenu() {
        return __awaiter(this, void 0, void 0, function* () {
            let items = [];
            for (const section of yield Promise.all(this.contextMenuProviders.map(x => x.getItems(this)))) {
                items = items.concat(section);
                items.push({ type: 'separator' });
            }
            items.splice(items.length - 1, 1);
            return items;
        });
    }
    /**
     * Feeds input into the active session
     */
    sendInput(data) {
        var _a, _b;
        if (!(data instanceof Buffer)) {
            data = Buffer.from(data, 'utf-8');
        }
        (_a = this.session) === null || _a === void 0 ? void 0 : _a.feedFromTerminal(data);
        if (this.config.store.terminal.scrollOnInput && !data.equals(OSC_FOCUS_IN) && !data.equals(OSC_FOCUS_OUT)) {
            (_b = this.frontend) === null || _b === void 0 ? void 0 : _b.scrollToBottom();
        }
    }
    /**
     * Feeds input into the terminal frontend
     */
    write(data) {
        return __awaiter(this, void 0, void 0, function* () {
            this.frontendWriteLock = this.frontendWriteLock.then(() => this.withSpinnerPaused(() => this.writeRaw(data)));
            yield this.frontendWriteLock;
        });
    }
    writeRaw(data) {
        return __awaiter(this, void 0, void 0, function* () {
            if (!this.frontend) {
                throw new Error('Frontend not ready');
            }
            if (this.config.store.terminal.detectProgress) {
                const percentageMatch = /(^|[^\d])(\d+(\.\d+)?)%([^\d]|$)/.exec(data);
                if (!this.alternateScreenActive && percentageMatch) {
                    const percentage = percentageMatch[3] ? parseFloat(percentageMatch[2]) : parseInt(percentageMatch[2]);
                    if (percentage > 0 && percentage <= 100) {
                        this.setProgress(percentage);
                    }
                }
                else {
                    this.setProgress(null);
                }
            }
            yield this.frontend.write(data);
        });
    }
    paste() {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            let data = this.platform.readClipboard();
            if (this.hostApp.platform === external_tabby_core_.Platform.Windows) {
                data = data.replaceAll('\r\n', '\r');
            }
            else {
                data = data.replaceAll('\n', '\r');
            }
            if (this.config.store.terminal.trimWhitespaceOnPaste && data.indexOf('\n') === data.length - 1) {
                // Ends with a newline and has no other line breaks
                data = data.substring(0, data.length - 1);
            }
            if (!this.alternateScreenActive) {
                if ((data.includes('\r') || data.includes('\n')) && this.config.store.terminal.warnOnMultilinePaste) {
                    const buttons = [
                        this.translate.instant('Paste'),
                        this.translate.instant('Cancel'),
                    ];
                    const result = (yield this.platform.showMessageBox({
                        type: 'warning',
                        detail: data.slice(0, 1000),
                        message: this.translate.instant('Paste multiple lines?'),
                        buttons,
                        defaultId: 0,
                        cancelId: 1,
                    })).response;
                    if (result === 1) {
                        return;
                    }
                }
                else {
                    if (this.config.store.terminal.trimWhitespaceOnPaste) {
                        data = data.trimEnd();
                        if (!data.includes('\r')) {
                            data = data.trimStart();
                        }
                    }
                }
            }
            if (this.config.store.terminal.bracketedPaste && ((_a = this.frontend) === null || _a === void 0 ? void 0 : _a.supportsBracketedPaste())) {
                data = `\x1b[200~${data}\x1b[201~`;
            }
            this.sendInput(data);
        });
    }
    /**
     * Applies the user settings to the terminal
     */
    configure() {
        var _a;
        (_a = this.frontend) === null || _a === void 0 ? void 0 : _a.configure(this.profile);
        this.backgroundColor = getTerminalBackgroundColor(this.config, this.themes, this.profile.terminalColorScheme);
    }
    zoomIn() {
        var _a;
        this.zoom++;
        (_a = this.frontend) === null || _a === void 0 ? void 0 : _a.setZoom(this.zoom);
    }
    zoomOut() {
        var _a;
        this.zoom--;
        (_a = this.frontend) === null || _a === void 0 ? void 0 : _a.setZoom(this.zoom);
    }
    resetZoom() {
        var _a;
        this.zoom = 0;
        (_a = this.frontend) === null || _a === void 0 ? void 0 : _a.setZoom(this.zoom);
    }
    copyCurrentPath() {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            let cwd = null;
            if ((_a = this.session) === null || _a === void 0 ? void 0 : _a.supportsWorkingDirectory()) {
                cwd = yield this.session.getWorkingDirectory();
            }
            if (cwd) {
                this.platform.setClipboard({ text: cwd });
                this.notifications.notice(this.translate.instant('Copied'));
            }
            else {
                this.notifications.error(this.translate.instant('Shell does not support current path detection'));
            }
        });
    }
    /** @hidden */
    ngOnDestroy() {
        super.ngOnDestroy();
        this.stopSpinner();
    }
    destroy() {
        const _super = Object.create(null, {
            destroy: { get: () => super.destroy }
        });
        var _a, _b, _c;
        return __awaiter(this, void 0, void 0, function* () {
            (_a = this.frontend) === null || _a === void 0 ? void 0 : _a.detach(this.content.nativeElement);
            (_b = this.frontend) === null || _b === void 0 ? void 0 : _b.destroy();
            this.frontend = undefined;
            this.content.nativeElement.remove();
            this.detachTermContainerHandlers();
            this.config.enabledServices(this.decorators).forEach(decorator => {
                try {
                    decorator.detach(this);
                }
                catch (e) {
                    this.logger.warn('Decorator attach() throws', e);
                }
            });
            this.output.complete();
            this.binaryOutput.complete();
            this.frontendReady.complete();
            _super.destroy.call(this);
            if ((_c = this.session) === null || _c === void 0 ? void 0 : _c.open) {
                yield this.session.destroy();
            }
        });
    }
    detachTermContainerHandlers() {
        this.termContainerSubscriptions.cancelAll();
    }
    handleRightMouseDown(event) {
        return __awaiter(this, void 0, void 0, function* () {
            event.preventDefault();
            event.stopPropagation();
            this.rightMouseDownTime = Date.now();
            if (this.config.store.terminal.rightClick === 'menu') {
                this.platform.popupContextMenu(yield this.buildContextMenu(), event);
            }
        });
    }
    handleRightMouseUp(event) {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            event.preventDefault();
            event.stopPropagation();
            if (this.config.store.terminal.rightClick === 'paste'
                || this.config.store.terminal.rightClick === 'clipboard') {
                const duration = Date.now() - this.rightMouseDownTime;
                if (duration < 250) {
                    if (this.config.store.terminal.rightClick === 'paste') {
                        this.paste();
                    }
                    else if (this.config.store.terminal.rightClick === 'clipboard') {
                        if ((_a = this.frontend) === null || _a === void 0 ? void 0 : _a.getSelection()) {
                            this.frontend.copySelection();
                            this.frontend.clearSelection();
                        }
                        else {
                            this.paste();
                        }
                    }
                }
                else {
                    this.platform.popupContextMenu(yield this.buildContextMenu(), event);
                }
            }
        });
    }
    attachTermContainerHandlers() {
        this.detachTermContainerHandlers();
        if (!this.frontend) {
            throw new Error('Frontend not ready');
        }
        const maybeConfigure = () => {
            if (this.hasFocus) {
                setTimeout(() => this.configure(), 250);
            }
        };
        this.termContainerSubscriptions.subscribe(this.frontend.title$, title => this.zone.run(() => {
            if (!this.disableDynamicTitle) {
                this.setTitle(title);
            }
        }));
        this.termContainerSubscriptions.subscribe(this.focused$, () => this.frontend && (this.frontend.enableResizing = true));
        this.termContainerSubscriptions.subscribe(this.blurred$, () => this.frontend && (this.frontend.enableResizing = false));
        this.termContainerSubscriptions.subscribe(this.frontend.mouseEvent$, event => {
            if (event.type === 'mousedown') {
                if (event.which === 1) {
                    this.multifocus.cancel();
                }
                if (event.which === 2) {
                    if (this.config.store.terminal.pasteOnMiddleClick) {
                        this.paste();
                    }
                    event.preventDefault();
                    event.stopPropagation();
                    return;
                }
                if (event.which === 3 || event.which === 1 && event.ctrlKey) {
                    this.handleRightMouseDown(event);
                    return;
                }
            }
            if (event.type === 'mouseup') {
                if (event.which === 3 || event.which === 1 && event.ctrlKey) {
                    this.handleRightMouseUp(event);
                    return;
                }
            }
            if (event.type === 'mousewheel') {
                let wheelDeltaY = 0;
                if ('wheelDeltaY' in event) {
                    wheelDeltaY = event['wheelDeltaY'];
                }
                else {
                    wheelDeltaY = event.deltaY;
                }
                if (event.altKey) {
                    event.preventDefault();
                    const delta = Math.round(wheelDeltaY / 50);
                    this.sendInput((delta > 0 ? '\u001bOA' : '\u001bOB').repeat(Math.abs(delta)));
                }
            }
        });
        this.termContainerSubscriptions.subscribe(this.frontend.input$, data => {
            this.sendInput(data);
        });
        this.termContainerSubscriptions.subscribe(this.frontend.resize$.pipe((0,external_rxjs_.auditTime)(100)), ({ columns, rows }) => {
            this.logger.debug(`Resizing to ${columns}x${rows}`);
            this.size = { columns, rows };
            this.zone.run(() => {
                var _a;
                if ((_a = this.session) === null || _a === void 0 ? void 0 : _a.open) {
                    this.session.resize(columns, rows);
                }
            });
        });
        this.termContainerSubscriptions.subscribe(this.platform.displayMetricsChanged$, maybeConfigure);
        this.termContainerSubscriptions.subscribe(this.hostWindow.windowMoved$, maybeConfigure);
    }
    setSession(session, destroyOnSessionClose = false) {
        if (session) {
            if (this.session) {
                this.setSession(null);
            }
            this.detachSessionHandlers();
            this.session = session;
            this.attachSessionHandlers(destroyOnSessionClose);
        }
        else {
            this.detachSessionHandlers();
            this.session = null;
        }
        this.sessionChanged.next(session);
    }
    showToolbar() {
        this.revealToolbar = true;
        this.toolbarRevealTimeout.clear();
    }
    hideToolbar() {
        this.toolbarRevealTimeout.set();
    }
    togglePinToolbar() {
        this.pinToolbar = !this.pinToolbar;
        window.localStorage.pinTerminalToolbar = this.pinToolbar;
    }
    get hasTitleInset() {
        return this.hostApp.platform === external_tabby_core_.Platform.macOS && this.config.store.appearance.tabsLocation !== 'top' && this.config.store.appearance.frame === 'thin';
    }
    attachSessionHandler(observable, handler) {
        this.sessionHandlers.subscribe(observable, handler);
    }
    attachSessionHandlers(destroyOnSessionClose = false) {
        if (!this.session) {
            throw new Error('Session not set');
        }
        // this.session.output$.bufferTime(10).subscribe((datas) => {
        this.attachSessionHandler(this.session.output$, data => {
            if (this.enablePassthrough) {
                this.output.next(data);
                this.write(data);
            }
        });
        this.attachSessionHandler(this.session.binaryOutput$, data => {
            if (this.enablePassthrough) {
                this.binaryOutput.next(data);
            }
        });
        this.attachSessionHandler(this.session.closed$, () => {
            this.onSessionClosed(destroyOnSessionClose);
        });
        this.attachSessionHandler(this.session.destroyed$, () => {
            this.onSessionDestroyed();
        });
    }
    /**
     * Method called when session is closed.
     */
    onSessionClosed(destroyOnSessionClose = false) {
        if (destroyOnSessionClose || this.shouldTabBeDestroyedOnSessionClose()) {
            this.destroy();
        }
    }
    /**
     * Return true if tab should be destroyed on session closed.
     */
    shouldTabBeDestroyedOnSessionClose() {
        const behavior = this.profile.behaviorOnSessionEnd;
        return behavior === 'close' || behavior === 'auto' && this.isSessionExplicitlyTerminated();
    }
    /**
     * Method called when session is destroyed. Set the session to null
     */
    onSessionDestroyed() {
        this.setSession(null);
    }
    detachSessionHandlers() {
        this.sessionHandlers.cancelAll();
    }
    startSpinner(text) {
        if (this.spinnerActive || this.spinnerPaused) {
            return;
        }
        if (text) {
            this.spinner.text = text;
        }
        this.spinner.setSpinnerString(6);
        this.spinnerActive = true;
        this.zone.runOutsideAngular(() => {
            this.spinner.start();
        });
    }
    stopSpinner() {
        if (!this.spinnerActive) {
            return;
        }
        this.spinner.stop(true);
        this.spinnerActive = false;
    }
    withSpinnerPaused(work) {
        return __awaiter(this, void 0, void 0, function* () {
            this.spinnerPaused = true;
            if (this.spinnerActive) {
                this.spinner.stop(true);
            }
            try {
                yield work();
            }
            finally {
                this.spinnerPaused = false;
                if (this.spinnerActive) {
                    this.zone.runOutsideAngular(() => {
                        this.spinner.start();
                    });
                }
            }
        });
    }
    forEachFocusedTerminalPane(cb) {
        if (this.parent && this.parent instanceof external_tabby_core_.SplitTabComponent && this.parent._allFocusMode) {
            for (const tab of this.parent.getAllTabs()) {
                if (tab instanceof BaseTerminalTabComponent_1) {
                    cb(tab);
                }
            }
        }
        else {
            cb(this);
        }
    }
    /**
     * Return true if the user explicitly exit the session
     */
    isSessionExplicitlyTerminated() {
        return false;
    }
};
BaseTerminalTabComponent.template = __webpack_require__(/*! ../components/baseTerminalTab.component.pug */ 2643);
BaseTerminalTabComponent.styles = [__webpack_require__(/*! ../components/baseTerminalTab.component.scss */ 8375)];
BaseTerminalTabComponent.animations = [
    (0,animations_.trigger)('toolbarSlide', [
        (0,animations_.transition)(':enter', [
            (0,animations_.style)({
                transform: 'translateY(-25%)',
                opacity: '0',
            }),
            (0,animations_.animate)('100ms ease-out', (0,animations_.style)({
                transform: 'translateY(0%)',
                opacity: '1',
            })),
        ]),
        (0,animations_.transition)(':leave', [
            (0,animations_.animate)('100ms ease-out', (0,animations_.style)({
                transform: 'translateY(-25%)',
                opacity: '0',
            })),
        ]),
    ]),
    (0,animations_.trigger)('panelSlide', [
        (0,animations_.transition)(':enter', [
            (0,animations_.style)({
                transform: 'translateY(25%)',
                opacity: '0',
            }),
            (0,animations_.animate)('100ms ease-out', (0,animations_.style)({
                transform: 'translateY(0%)',
                opacity: '1',
            })),
        ]),
        (0,animations_.transition)(':leave', [
            (0,animations_.animate)('100ms ease-out', (0,animations_.style)({
                transform: 'translateY(25%)',
                opacity: '0',
            })),
        ]),
    ]),
];
BaseTerminalTabComponent.ctorParameters = () => [
    { type: core_.Injector }
];
BaseTerminalTabComponent.propDecorators = {
    zoom: [{ type: core_.Input }],
    showSearchPanel: [{ type: core_.Input }],
    content: [{ type: core_.ViewChild, args: ['content',] }],
    backgroundColor: [{ type: core_.HostBinding, args: ['style.background-color',] }],
    enableToolbar: [{ type: core_.HostBinding, args: ['class.toolbar-enabled',] }],
    pinToolbar: [{ type: core_.HostBinding, args: ['class.toolbar-pinned',] }],
    revealToolbar: [{ type: core_.HostBinding, args: ['class.toolbar-revealed',] }],
    searchPanel: [{ type: core_.ViewChild, args: [SearchPanelComponent, { 'static': false },] }],
    hasTitleInset: [{ type: core_.HostBinding, args: ['class.with-title-inset',] }]
};
BaseTerminalTabComponent = BaseTerminalTabComponent_1 = __decorate([
    (0,core_.Component)({ template: '' }),
    __metadata("design:paramtypes", [core_.Injector])
], BaseTerminalTabComponent);


;// ./src/components/terminalToolbar.component.ts



/* eslint-disable @typescript-eslint/explicit-module-boundary-types */



/** @hidden */
let TerminalToolbarComponent = class TerminalToolbarComponent {
    // eslint-disable-next-line @typescript-eslint/no-useless-constructor
    constructor(app) {
        this.app = app;
    }
    onTabDragStart() {
        this.app.emitTabDragStarted(this.tab);
    }
    onTabDragEnd() {
        setTimeout(() => {
            this.app.emitTabDragEnded();
            this.app.emitTabsChanged();
        });
    }
    get shouldShowDragHandle() {
        return this.tab.topmostParent instanceof external_tabby_core_.SplitTabComponent && this.tab.topmostParent.getAllTabs().length > 1;
    }
    onMouseEnter() {
        this.tab.showToolbar();
    }
    onMouseLeave() {
        this.tab.hideToolbar();
    }
};
TerminalToolbarComponent.ctorParameters = () => [
    { type: external_tabby_core_.AppService }
];
TerminalToolbarComponent.propDecorators = {
    tab: [{ type: core_.Input }],
    onMouseEnter: [{ type: core_.HostListener, args: ['mouseenter',] }],
    onMouseLeave: [{ type: core_.HostListener, args: ['mouseleave',] }]
};
TerminalToolbarComponent = __decorate([
    (0,core_.Component)({
        selector: 'terminal-toolbar',
        template: (terminalToolbar_componentngResource_default()),
        styles: [(components_terminalToolbar_componentngResource_default())]
    }),
    __metadata("design:paramtypes", [external_tabby_core_.AppService])
], TerminalToolbarComponent);


// EXTERNAL MODULE: ./src/components/colorSchemeSelector.component.pug?ngResource
var colorSchemeSelector_componentngResource = __webpack_require__(882);
var colorSchemeSelector_componentngResource_default = /*#__PURE__*/__webpack_require__.n(colorSchemeSelector_componentngResource);
;// ./src/api/colorSchemeProvider.ts
/**
 * Extend to add more terminal color schemes
 */
class TerminalColorSchemeProvider {
}

;// ./src/components/colorSchemeSelector.component.ts


/* eslint-disable @typescript-eslint/explicit-module-boundary-types */




marker('Search color schemes');
/** @hidden */
let ColorSchemeSelectorComponent = class ColorSchemeSelectorComponent {
    constructor(colorSchemeProviders, changeDetector, config) {
        this.colorSchemeProviders = colorSchemeProviders;
        this.changeDetector = changeDetector;
        this.config = config;
        this.allColorSchemes = [];
        this.filter = '';
        this.modelChange = new core_.EventEmitter();
    }
    ngOnInit() {
        return __awaiter(this, void 0, void 0, function* () {
            const stockColorSchemes = (yield Promise.all(this.config.enabledServices(this.colorSchemeProviders).map(x => x.getSchemes()))).reduce((a, b) => a.concat(b));
            stockColorSchemes.sort((a, b) => a.name.localeCompare(b.name));
            const customColorSchemes = this.config.store.terminal.customColorSchemes;
            this.allColorSchemes = customColorSchemes.concat(stockColorSchemes);
            this.changeDetector.markForCheck();
        });
    }
    selectScheme(scheme) {
        this.model = scheme;
        this.modelChange.emit(scheme);
        this.changeDetector.markForCheck();
    }
};
ColorSchemeSelectorComponent.ctorParameters = () => [
    { type: Array, decorators: [{ type: core_.Inject, args: [TerminalColorSchemeProvider,] }] },
    { type: core_.ChangeDetectorRef },
    { type: external_tabby_core_.ConfigService }
];
ColorSchemeSelectorComponent.propDecorators = {
    model: [{ type: core_.Input }],
    modelChange: [{ type: core_.Output }],
    true: [{ type: core_.HostBinding, args: ['class.content-box',] }]
};
ColorSchemeSelectorComponent = __decorate([
    (0,core_.Component)({
        selector: 'color-scheme-selector',
        template: (colorSchemeSelector_componentngResource_default()),
        changeDetection: core_.ChangeDetectionStrategy.OnPush,
        styles: ["\n        :host {\n            display: block;\n            max-height: 100vh;\n            overflow-y: auto;\n        }\n    "]
    }),
    __metadata("design:paramtypes", [Array, core_.ChangeDetectorRef,
        external_tabby_core_.ConfigService])
], ColorSchemeSelectorComponent);


// EXTERNAL MODULE: ./src/components/inputProcessingSettings.component.pug?ngResource
var inputProcessingSettings_componentngResource = __webpack_require__(2657);
var inputProcessingSettings_componentngResource_default = /*#__PURE__*/__webpack_require__.n(inputProcessingSettings_componentngResource);
;// ./src/components/inputProcessingSettings.component.ts


/* eslint-disable @typescript-eslint/explicit-module-boundary-types */


/** @hidden */
let InputProcessingSettingsComponent = class InputProcessingSettingsComponent {
    constructor() {
        this.backspaceModes = [
            {
                key: 'backspace',
                name: marker('Pass-through'),
            },
            {
                key: 'ctrl-h',
                name: 'Ctrl-H',
            },
            {
                key: 'ctrl-?',
                name: 'Ctrl-?',
            },
            {
                key: 'delete',
                name: 'Delete (CSI 3~)',
            },
        ];
    }
    getBackspaceModeName(key) {
        var _a;
        return (_a = this.backspaceModes.find(x => x.key === key)) === null || _a === void 0 ? void 0 : _a.name;
    }
    setBackspaceMode(mode) {
        this.options.backspace = mode;
    }
};
InputProcessingSettingsComponent.propDecorators = {
    options: [{ type: core_.Input }]
};
InputProcessingSettingsComponent = __decorate([
    (0,core_.Component)({
        selector: 'input-processing-settings',
        template: (inputProcessingSettings_componentngResource_default()),
    })
], InputProcessingSettingsComponent);


// EXTERNAL MODULE: ./src/components/colorSchemeSettingsForMode.component.pug?ngResource
var colorSchemeSettingsForMode_componentngResource = __webpack_require__(204);
var colorSchemeSettingsForMode_componentngResource_default = /*#__PURE__*/__webpack_require__.n(colorSchemeSettingsForMode_componentngResource);
// EXTERNAL MODULE: ./src/components/colorSchemeSettingsForMode.component.scss?ngResource
var components_colorSchemeSettingsForMode_componentngResource = __webpack_require__(9702);
var components_colorSchemeSettingsForMode_componentngResource_default = /*#__PURE__*/__webpack_require__.n(components_colorSchemeSettingsForMode_componentngResource);
;// ./src/components/colorSchemeSettingsForMode.component.ts



/* eslint-disable @typescript-eslint/explicit-module-boundary-types */





marker('Search color schemes');
/** @hidden */
let ColorSchemeSettingsForModeComponent = class ColorSchemeSettingsForModeComponent {
    constructor(colorSchemeProviders, changeDetector, platform, translate, config) {
        this.colorSchemeProviders = colorSchemeProviders;
        this.changeDetector = changeDetector;
        this.platform = platform;
        this.translate = translate;
        this.config = config;
        this.stockColorSchemes = [];
        this.customColorSchemes = [];
        this.allColorSchemes = [];
        this.filter = '';
        this.editing = false;
        this.colorIndexes = [...new Array(16).keys()];
        this.currentStockScheme = null;
        this.currentCustomScheme = null;
    }
    ngOnInit() {
        return __awaiter(this, void 0, void 0, function* () {
            this.stockColorSchemes = (yield Promise.all(this.config.enabledServices(this.colorSchemeProviders).map(x => x.getSchemes()))).reduce((a, b) => a.concat(b));
            this.stockColorSchemes.sort((a, b) => a.name.localeCompare(b.name));
            this.customColorSchemes = this.config.store.terminal.customColorSchemes;
            this.changeDetector.markForCheck();
            this.update();
        });
    }
    ngOnChanges() {
        this.update();
    }
    selectScheme(scheme) {
        this.config.store.terminal[this.configKey] = Object.assign({}, scheme);
        this.config.save();
        this.cancelEditing();
        this.update();
    }
    update() {
        this.currentCustomScheme = this.findMatchingScheme(this.config.store.terminal[this.configKey], this.customColorSchemes);
        this.currentStockScheme = this.findMatchingScheme(this.config.store.terminal[this.configKey], this.stockColorSchemes);
        this.allColorSchemes = this.customColorSchemes.concat(this.stockColorSchemes);
        this.changeDetector.markForCheck();
    }
    editScheme() {
        this.editing = true;
    }
    saveScheme() {
        this.customColorSchemes = this.customColorSchemes.filter(x => x.name !== this.config.store.terminal[this.configKey].name);
        this.customColorSchemes.push(this.config.store.terminal[this.configKey]);
        this.config.store.terminal.customColorSchemes = this.customColorSchemes;
        this.config.save();
        this.cancelEditing();
        this.update();
    }
    cancelEditing() {
        this.editing = false;
    }
    deleteScheme(scheme) {
        return __awaiter(this, void 0, void 0, function* () {
            if ((yield this.platform.showMessageBox({
                type: 'warning',
                message: this.translate.instant('Delete "{name}"?', scheme),
                buttons: [
                    this.translate.instant('Delete'),
                    this.translate.instant('Keep'),
                ],
                defaultId: 1,
                cancelId: 1,
            })).response === 0) {
                this.customColorSchemes = this.customColorSchemes.filter(x => x.name !== scheme.name);
                this.config.store.terminal.customColorSchemes = this.customColorSchemes;
                this.config.save();
                this.update();
            }
        });
    }
    getCurrentSchemeName() {
        var _a, _b, _c;
        return (_c = (_b = ((_a = this.currentCustomScheme) !== null && _a !== void 0 ? _a : this.currentStockScheme)) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : 'Custom';
    }
    findMatchingScheme(scheme, schemes) {
        var _a;
        return (_a = schemes.find(x => deep_equal_default()(x, scheme))) !== null && _a !== void 0 ? _a : null;
    }
    colorsTrackBy(index) {
        return index;
    }
};
ColorSchemeSettingsForModeComponent.ctorParameters = () => [
    { type: Array, decorators: [{ type: core_.Inject, args: [TerminalColorSchemeProvider,] }] },
    { type: core_.ChangeDetectorRef },
    { type: external_tabby_core_.PlatformService },
    { type: external_tabby_core_.TranslateService },
    { type: external_tabby_core_.ConfigService }
];
ColorSchemeSettingsForModeComponent.propDecorators = {
    configKey: [{ type: core_.Input }],
    stockColorSchemes: [{ type: core_.Input }],
    customColorSchemes: [{ type: core_.Input }],
    allColorSchemes: [{ type: core_.Input }],
    filter: [{ type: core_.Input }],
    editing: [{ type: core_.Input }],
    true: [{ type: core_.HostBinding, args: ['class.content-box',] }]
};
ColorSchemeSettingsForModeComponent = __decorate([
    (0,core_.Component)({
        selector: 'color-scheme-settings-for-mode',
        template: (colorSchemeSettingsForMode_componentngResource_default()),
        changeDetection: core_.ChangeDetectionStrategy.OnPush,
        styles: [(components_colorSchemeSettingsForMode_componentngResource_default())]
    }),
    __metadata("design:paramtypes", [Array, core_.ChangeDetectorRef,
        external_tabby_core_.PlatformService,
        external_tabby_core_.TranslateService,
        external_tabby_core_.ConfigService])
], ColorSchemeSettingsForModeComponent);


;// ./src/api/contextMenuProvider.ts
/**
 * Extend to add more terminal context menu items
 * @deprecated
 */
class TerminalContextMenuItemProvider {
}

;// ./src/settings.ts







/** @hidden */
let AppearanceSettingsTabProvider = class AppearanceSettingsTabProvider extends external_tabby_settings_.SettingsTabProvider {
    constructor(translate) {
        super();
        this.translate = translate;
        this.id = 'terminal-appearance';
        this.icon = 'swatchbook';
        this.title = this.translate.instant('Appearance');
        this.prioritized = true;
    }
    getComponentType() {
        return AppearanceSettingsTabComponent;
    }
};
AppearanceSettingsTabProvider.ctorParameters = () => [
    { type: external_tabby_core_.TranslateService }
];
AppearanceSettingsTabProvider = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.TranslateService])
], AppearanceSettingsTabProvider);

/** @hidden */
let ColorSchemeSettingsTabProvider = class ColorSchemeSettingsTabProvider extends external_tabby_settings_.SettingsTabProvider {
    constructor(translate) {
        super();
        this.translate = translate;
        this.id = 'terminal-color-scheme';
        this.icon = 'palette';
        this.title = this.translate.instant('Color scheme');
    }
    getComponentType() {
        return ColorSchemeSettingsTabComponent;
    }
};
ColorSchemeSettingsTabProvider.ctorParameters = () => [
    { type: external_tabby_core_.TranslateService }
];
ColorSchemeSettingsTabProvider = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.TranslateService])
], ColorSchemeSettingsTabProvider);

/** @hidden */
let TerminalSettingsTabProvider = class TerminalSettingsTabProvider extends external_tabby_settings_.SettingsTabProvider {
    constructor(translate) {
        super();
        this.translate = translate;
        this.id = 'terminal';
        this.icon = 'terminal';
        this.title = this.translate.instant('Terminal');
        this.prioritized = true;
    }
    getComponentType() {
        return TerminalSettingsTabComponent;
    }
};
TerminalSettingsTabProvider.ctorParameters = () => [
    { type: external_tabby_core_.TranslateService }
];
TerminalSettingsTabProvider = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.TranslateService])
], TerminalSettingsTabProvider);


;// ./src/features/debug.ts




/** @hidden */
let DebugDecorator = class DebugDecorator extends TerminalDecorator {
    constructor(platform) {
        super();
        this.platform = platform;
    }
    attach(terminal) {
        var _a;
        let sessionOutputBuffer = '';
        const bufferLength = 8192;
        const handler = data => {
            sessionOutputBuffer += data;
            if (sessionOutputBuffer.length > bufferLength) {
                sessionOutputBuffer = sessionOutputBuffer.substring(sessionOutputBuffer.length - bufferLength);
            }
        };
        this.subscribeUntilDetached(terminal, terminal.sessionChanged$.subscribe(session => {
            this.subscribeUntilDetached(terminal, session === null || session === void 0 ? void 0 : session.output$.subscribe(handler));
        }));
        this.subscribeUntilDetached(terminal, (_a = terminal.session) === null || _a === void 0 ? void 0 : _a.output$.subscribe(handler));
        terminal.addEventListenerUntilDestroyed(terminal.content.nativeElement, 'keyup', (e) => {
            // Ctrl-Shift-Alt-1
            if (e.which === 49 && e.ctrlKey && e.shiftKey && e.altKey) {
                this.doSaveState(terminal);
            }
            // Ctrl-Shift-Alt-2
            if (e.which === 50 && e.ctrlKey && e.shiftKey && e.altKey) {
                this.doLoadState(terminal);
            }
            // Ctrl-Shift-Alt-3
            if (e.which === 51 && e.ctrlKey && e.shiftKey && e.altKey) {
                this.doCopyState(terminal);
            }
            // Ctrl-Shift-Alt-4
            if (e.which === 52 && e.ctrlKey && e.shiftKey && e.altKey) {
                this.doPasteState(terminal);
            }
            // Ctrl-Shift-Alt-5
            if (e.which === 53 && e.ctrlKey && e.shiftKey && e.altKey) {
                this.doSaveOutput(sessionOutputBuffer);
            }
            // Ctrl-Shift-Alt-6
            if (e.which === 54 && e.ctrlKey && e.shiftKey && e.altKey) {
                this.doLoadOutput(terminal);
            }
            // Ctrl-Shift-Alt-7
            if (e.which === 55 && e.ctrlKey && e.shiftKey && e.altKey) {
                this.doCopyOutput(sessionOutputBuffer);
            }
            // Ctrl-Shift-Alt-8
            if (e.which === 56 && e.ctrlKey && e.shiftKey && e.altKey) {
                this.doPasteOutput(terminal);
            }
        });
    }
    loadFile() {
        return __awaiter(this, void 0, void 0, function* () {
            const transfer = yield this.platform.startUpload();
            if (!transfer.length) {
                return null;
            }
            const data = yield transfer[0].readAll();
            transfer[0].close();
            return data.toString();
        });
    }
    saveFile(content, name) {
        return __awaiter(this, void 0, void 0, function* () {
            const data = Buffer.from(content);
            const transfer = yield this.platform.startDownload(name, 0o644, data.length);
            if (transfer) {
                transfer.write(data);
                transfer.close();
            }
        });
    }
    doSaveState(terminal) {
        this.saveFile(terminal.frontend.saveState(), 'state.txt');
    }
    doCopyState(terminal) {
        return __awaiter(this, void 0, void 0, function* () {
            const data = '```' + JSON.stringify(terminal.frontend.saveState()) + '```';
            this.platform.setClipboard({ text: data });
        });
    }
    doLoadState(terminal) {
        return __awaiter(this, void 0, void 0, function* () {
            const data = yield this.loadFile();
            if (data) {
                terminal.frontend.restoreState(data);
            }
        });
    }
    doPasteState(terminal) {
        return __awaiter(this, void 0, void 0, function* () {
            let data = this.platform.readClipboard();
            if (data) {
                if (data.startsWith('`')) {
                    data = data.substring(3, data.length - 3);
                }
                terminal.frontend.restoreState(JSON.parse(data));
            }
        });
    }
    doSaveOutput(buffer) {
        this.saveFile(buffer, 'output.txt');
    }
    doCopyOutput(buffer) {
        return __awaiter(this, void 0, void 0, function* () {
            const data = '```' + JSON.stringify(buffer) + '```';
            this.platform.setClipboard({ text: data });
        });
    }
    doLoadOutput(terminal) {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            const data = yield this.loadFile();
            if (data) {
                yield ((_a = terminal.frontend) === null || _a === void 0 ? void 0 : _a.write(data));
            }
        });
    }
    doPasteOutput(terminal) {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            let data = this.platform.readClipboard();
            if (data) {
                if (data.startsWith('`')) {
                    data = data.substring(3, data.length - 3);
                }
                yield ((_a = terminal.frontend) === null || _a === void 0 ? void 0 : _a.write(JSON.parse(data)));
            }
        });
    }
};
DebugDecorator.ctorParameters = () => [
    { type: external_tabby_core_.PlatformService }
];
DebugDecorator = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.PlatformService])
], DebugDecorator);


// EXTERNAL MODULE: ./node_modules/zmodem.js/index.js
var zmodem_js = __webpack_require__(701);
;// ./src/api/middleware.ts


class SessionMiddleware {
    constructor() {
        this.outputToSession = new external_rxjs_.Subject();
        this.outputToTerminal = new external_rxjs_.Subject();
    }
    get outputToSession$() { return this.outputToSession; }
    get outputToTerminal$() { return this.outputToTerminal; }
    feedFromSession(data) {
        this.outputToTerminal.next(data);
    }
    feedFromTerminal(data) {
        this.outputToSession.next(data);
    }
    close() {
        this.outputToSession.complete();
        this.outputToTerminal.complete();
    }
}
class SessionMiddlewareStack extends SessionMiddleware {
    constructor() {
        super();
        this.stack = [];
        this.subs = new external_tabby_core_.SubscriptionContainer();
        this.push(new SessionMiddleware());
    }
    push(middleware) {
        this.stack.push(middleware);
        this.relink();
    }
    unshift(middleware) {
        this.stack.unshift(middleware);
        this.relink();
    }
    remove(middleware) {
        this.stack = this.stack.filter(m => m !== middleware);
        this.relink();
    }
    replace(middleware, newMiddleware) {
        const index = this.stack.indexOf(middleware);
        if (index >= 0) {
            this.stack[index].close();
            this.stack[index] = newMiddleware;
        }
        else {
            this.stack.push(newMiddleware);
        }
        this.relink();
    }
    feedFromSession(data) {
        this.stack[0].feedFromSession(data);
    }
    feedFromTerminal(data) {
        this.stack[this.stack.length - 1].feedFromTerminal(data);
    }
    close() {
        for (const m of this.stack) {
            m.close();
        }
        this.subs.cancelAll();
        super.close();
    }
    relink() {
        this.subs.cancelAll();
        for (let i = 0; i < this.stack.length - 1; i++) {
            this.subs.subscribe(this.stack[i].outputToTerminal$, x => this.stack[i + 1].feedFromSession(x));
        }
        this.subs.subscribe(this.stack[this.stack.length - 1].outputToTerminal$, x => this.outputToTerminal.next(x));
        for (let i = this.stack.length - 2; i >= 0; i--) {
            this.subs.subscribe(this.stack[i + 1].outputToSession$, x => this.stack[i].feedFromTerminal(x));
        }
        this.subs.subscribe(this.stack[0].outputToSession$, x => this.outputToSession.next(x));
    }
}

;// ./src/features/zmodem.ts








const SPACER = '            ';
class ZModemMiddleware extends SessionMiddleware {
    constructor(log, hotkeys, platform) {
        super();
        this.platform = platform;
        this.isActive = false;
        this.activeSession = null;
        this.cancelEvent = this.outputToSession$.pipe((0,external_rxjs_.filter)(x => x.length === 1 && x[0] === 3));
        this.logger = log.create('zmodem');
        this.sentry = new zmodem_js.Sentry({
            to_terminal: data => {
                if (this.isActive && this.activeSession) {
                    this.outputToTerminal.next(Buffer.from(data));
                }
            },
            sender: data => this.outputToSession.next(Buffer.from(data)),
            on_detect: (detection) => __awaiter(this, void 0, void 0, function* () {
                try {
                    this.isActive = true;
                    yield this.process(detection);
                }
                finally {
                    this.isActive = false;
                }
            }),
            on_retract: () => {
                this.showMessage('transfer cancelled');
                this.activeSession = null;
                this.isActive = false;
            },
        });
    }
    feedFromSession(data) {
        var _a;
        if (this.isActive || this.activeSession) {
            try {
                this.sentry.consume(data);
            }
            catch (e) {
                this.showMessage(ansi_colors_default().bgRed.black(' Error ') + ' ' + e);
                this.logger.error('protocol error', e);
                (_a = this.activeSession) === null || _a === void 0 ? void 0 : _a.abort();
                this.activeSession = null;
                this.isActive = false;
                // Don't forward the problematic data to terminal
                return;
            }
        }
        else {
            try {
                this.sentry.consume(data);
            }
            catch (e) {
                this.logger.error('zmodem detection error', e);
            }
            this.outputToTerminal.next(data);
        }
    }
    process(detection) {
        return __awaiter(this, void 0, void 0, function* () {
            this.showMessage(ansi_colors_default().bgBlue.black(' ZMODEM ') + ' Session started');
            this.showMessage('------------------------');
            const zsession = detection.confirm();
            this.activeSession = zsession;
            this.logger.info('new session', zsession);
            try {
                if (zsession.type === 'send') {
                    const transfers = yield this.platform.startUpload({ multiple: true });
                    let filesRemaining = transfers.length;
                    let sizeRemaining = transfers.reduce((a, b) => a + b.getSize(), 0);
                    for (const transfer of transfers) {
                        yield this.sendFile(zsession, transfer, filesRemaining, sizeRemaining);
                        filesRemaining--;
                        sizeRemaining -= transfer.getSize();
                    }
                    yield zsession.close();
                }
                else {
                    zsession.on('offer', xfer => {
                        this.receiveFile(xfer, zsession);
                    });
                    zsession.start();
                    yield new Promise(resolve => zsession.on('session_end', resolve));
                }
                this.showMessage(ansi_colors_default().bgBlue.black(' ZMODEM ') + ' Complete');
            }
            catch (error) {
                this.logger.error('ZMODEM session error', error);
                this.showMessage(ansi_colors_default().bgRed.black(' ZMODEM ') + ` Session failed: ${error.message}`);
                try {
                    zsession.abort();
                }
                catch (_a) { }
            }
            finally {
                this.activeSession = null;
            }
        });
    }
    receiveFile(xfer, zsession) {
        return __awaiter(this, void 0, void 0, function* () {
            const details = xfer.get_details();
            this.showMessage(ansi_colors_default().bgYellow.black(' Offered ') + ' ' + details.name, true);
            this.logger.info('offered', xfer);
            const transfer = yield this.platform.startDownload(details.name, 0o644, details.size);
            if (!transfer) {
                this.showMessage(ansi_colors_default().bgRed.black(' Rejected ') + ' ' + details.name);
                xfer.skip();
                return;
            }
            let canceled = false;
            const cancelSubscription = this.cancelEvent.subscribe(() => {
                try {
                    zsession._skip();
                }
                catch (_a) { }
                canceled = true;
            });
            try {
                yield Promise.race([
                    xfer.accept({
                        on_input: chunk => {
                            if (canceled) {
                                return;
                            }
                            transfer.write(Buffer.from(chunk));
                            this.showMessage(ansi_colors_default().bgYellow.black(' ' + Math.round(100 * transfer.getCompletedBytes() / details.size).toString().padStart(3, ' ') + '% ') + ' ' + details.name, true);
                        },
                    }),
                    this.cancelEvent.pipe((0,external_rxjs_.first)()).toPromise(),
                ]);
                // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
                if (canceled) {
                    transfer.cancel();
                    this.showMessage(ansi_colors_default().bgRed.black(' Canceled ') + ' ' + details.name);
                }
                else {
                    transfer.close();
                    this.showMessage(ansi_colors_default().bgGreen.black(' Received ') + ' ' + details.name);
                }
            }
            catch (_a) {
                this.showMessage(ansi_colors_default().bgRed.black(' Error ') + ' ' + details.name);
            }
            cancelSubscription.unsubscribe();
        });
    }
    sendFile(zsession, transfer, filesRemaining, sizeRemaining) {
        return __awaiter(this, void 0, void 0, function* () {
            const offer = {
                name: transfer.getName(),
                size: transfer.getSize(),
                mode: transfer.getMode(),
                files_remaining: filesRemaining,
                bytes_remaining: sizeRemaining,
            };
            this.logger.info('offering', offer);
            this.showMessage(ansi_colors_default().bgYellow.black(' Offered ') + ' ' + offer.name, true);
            const xfer = yield zsession.send_offer(offer);
            if (xfer) {
                let canceled = false;
                const cancelSubscription = this.cancelEvent.subscribe(() => {
                    canceled = true;
                });
                while (true) {
                    const chunk = yield transfer.read();
                    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
                    if (canceled || !chunk.length) {
                        break;
                    }
                    yield xfer.send(chunk);
                    this.showMessage(ansi_colors_default().bgYellow.black(' ' + Math.round(100 * transfer.getCompletedBytes() / offer.size).toString().padStart(3, ' ') + '% ') + offer.name, true);
                }
                // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
                if (canceled) {
                    transfer.cancel();
                }
                else {
                    transfer.close();
                }
                yield xfer.end();
                // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
                if (canceled) {
                    this.showMessage(ansi_colors_default().bgRed.black(' Canceled ') + ' ' + offer.name);
                }
                else {
                    this.showMessage(ansi_colors_default().bgGreen.black(' Sent ') + ' ' + offer.name);
                }
                cancelSubscription.unsubscribe();
            }
            else {
                transfer.cancel();
                this.showMessage(ansi_colors_default().bgRed.black(' Rejected ') + ' ' + offer.name);
                this.logger.warn('rejected by the other side');
            }
        });
    }
    showMessage(msg, overwrite = false) {
        this.outputToTerminal.next(Buffer.from(`\r${msg}${SPACER}`));
        if (!overwrite) {
            this.outputToTerminal.next(Buffer.from('\r\n'));
        }
    }
}
/** @hidden */
let ZModemDecorator = class ZModemDecorator extends TerminalDecorator {
    constructor(log, hotkeys, platform) {
        super();
        this.log = log;
        this.hotkeys = hotkeys;
        this.platform = platform;
    }
    attach(terminal) {
        setTimeout(() => {
            this.attachToSession(terminal);
            this.subscribeUntilDetached(terminal, terminal.sessionChanged$.subscribe(() => {
                this.attachToSession(terminal);
            }));
        });
    }
    attachToSession(terminal) {
        if (!terminal.session) {
            return;
        }
        terminal.session.middleware.unshift(new ZModemMiddleware(this.log, this.hotkeys, this.platform));
    }
};
ZModemDecorator.ctorParameters = () => [
    { type: external_tabby_core_.LogService },
    { type: external_tabby_core_.HotkeysService },
    { type: external_tabby_core_.PlatformService }
];
ZModemDecorator = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.LogService,
        external_tabby_core_.HotkeysService,
        external_tabby_core_.PlatformService])
], ZModemDecorator);


;// ./src/colorSchemes.ts
var DefaultColorSchemes_1;



let DefaultColorSchemes = DefaultColorSchemes_1 = class DefaultColorSchemes extends TerminalColorSchemeProvider {
    getSchemes() {
        return __awaiter(this, void 0, void 0, function* () {
            return [
                DefaultColorSchemes_1.defaultColorScheme,
                DefaultColorSchemes_1.defaultLightColorScheme,
            ];
        });
    }
};
DefaultColorSchemes.defaultColorScheme = {
    name: 'Tabby Default',
    foreground: '#cacaca',
    background: '#171717',
    cursor: '#bbbbbb',
    colors: [
        '#000000',
        '#ff615a',
        '#b1e969',
        '#ebd99c',
        '#5da9f6',
        '#e86aff',
        '#82fff7',
        '#dedacf',
        '#313131',
        '#f58c80',
        '#ddf88f',
        '#eee5b2',
        '#a5c7ff',
        '#ddaaff',
        '#b7fff9',
        '#ffffff',
    ],
    selection: undefined,
    cursorAccent: undefined,
};
DefaultColorSchemes.defaultLightColorScheme = {
    name: 'Tabby Default Light',
    foreground: '#4d4d4c',
    background: '#ffffff',
    cursor: '#4d4d4c',
    colors: [
        '#000000',
        '#c82829',
        '#718c00',
        '#eab700',
        '#4271ae',
        '#8959a8',
        '#3e999f',
        '#ffffff',
        '#000000',
        '#c82829',
        '#718c00',
        '#eab700',
        '#4271ae',
        '#8959a8',
        '#3e999f',
        '#ffffff',
    ],
    selection: undefined,
    cursorAccent: undefined,
};
DefaultColorSchemes = DefaultColorSchemes_1 = __decorate([
    (0,core_.Injectable)({ providedIn: 'root' })
], DefaultColorSchemes);


;// ./src/config.ts


/** @hidden */
class TerminalConfigProvider extends external_tabby_core_.ConfigProvider {
    constructor() {
        super(...arguments);
        this.defaults = {
            hotkeys: {
                'copy-current-path': [],
            },
            terminal: {
                frontend: 'xterm-webgl',
                fontSize: 14,
                fontWeight: 400,
                fontWeightBold: 700,
                fallbackFont: null,
                linePadding: 0,
                bell: 'off',
                bracketedPaste: true,
                background: 'theme',
                ligatures: false,
                cursor: 'block',
                cursorBlink: true,
                hideTabIndex: false,
                showTabProfileIcon: false,
                hideCloseButton: false,
                hideTabOptionsButton: false,
                rightClick: 'menu',
                pasteOnMiddleClick: true,
                copyOnSelect: false,
                copyAsHTML: true,
                scrollOnInput: true,
                altIsMeta: false,
                wordSeparator: ' ()[]{}\'"',
                colorScheme: Object.assign({ __nonStructural: true }, DefaultColorSchemes.defaultColorScheme),
                lightColorScheme: Object.assign({ __nonStructural: true }, DefaultColorSchemes.defaultLightColorScheme),
                customColorSchemes: [],
                warnOnMultilinePaste: true,
                searchRegexAlwaysEnabled: false,
                searchOptions: {
                    regex: false,
                    wholeWord: false,
                    caseSensitive: false,
                },
                detectProgress: true,
                scrollbackLines: 25000,
                drawBoldTextInBrightColors: true,
                sixel: true,
                minimumContrastRatio: 4,
                trimWhitespaceOnPaste: true,
            },
        };
        this.platformDefaults = {
            [external_tabby_core_.Platform.macOS]: {
                terminal: {
                    font: 'Menlo',
                },
                hotkeys: {
                    'ctrl-c': ['Ctrl-C'],
                    copy: [
                        '⌘-C',
                    ],
                    paste: [
                        '⌘-V',
                    ],
                    clear: [
                        '⌘-K',
                    ],
                    'select-all': ['⌘-A'],
                    'zoom-in': [
                        '⌘-=',
                        '⌘-Shift-=',
                    ],
                    'zoom-out': [
                        '⌘--',
                        '⌘-Shift--',
                    ],
                    'reset-zoom': [
                        '⌘-0',
                    ],
                    home: ['⌘-Left', 'Home'],
                    end: ['⌘-Right', 'End'],
                    'previous-word': ['⌥-Left'],
                    'next-word': ['⌥-Right'],
                    'delete-previous-word': ['⌥-Backspace'],
                    'delete-line': ['⌘-Backspace'],
                    'delete-next-word': ['⌥-Delete'],
                    search: [
                        '⌘-F',
                    ],
                    'pane-focus-all': [
                        '⌘-Shift-I',
                    ],
                    'focus-all-tabs': [
                        '⌘-⌥-Shift-I',
                    ],
                    'scroll-to-top': ['Shift-PageUp'],
                    'scroll-page-up': ['⌥-PageUp'],
                    'scroll-up': ['Ctrl-Shift-Up'],
                    'scroll-down': ['Ctrl-Shift-Down'],
                    'scroll-page-down': ['⌥-PageDown'],
                    'scroll-to-bottom': ['Shift-PageDown'],
                },
            },
            [external_tabby_core_.Platform.Windows]: {
                terminal: {
                    font: 'Consolas',
                    rightClick: 'clipboard',
                    pasteOnMiddleClick: false,
                    copyOnSelect: true,
                },
                hotkeys: {
                    'ctrl-c': ['Ctrl-C'],
                    copy: [
                        'Ctrl-Shift-C',
                    ],
                    paste: [
                        'Ctrl-Shift-V',
                        'Shift-Insert',
                    ],
                    'select-all': ['Ctrl-Shift-A'],
                    clear: [],
                    'zoom-in': [
                        'Ctrl-=',
                        'Ctrl-Shift-=',
                    ],
                    'zoom-out': [
                        'Ctrl--',
                        'Ctrl-Shift--',
                    ],
                    'reset-zoom': [
                        'Ctrl-0',
                    ],
                    home: ['Home'],
                    end: ['End'],
                    'previous-word': ['Ctrl-Left'],
                    'next-word': ['Ctrl-Right'],
                    'delete-previous-word': ['Ctrl-Backspace'],
                    'delete-line': ['Ctrl-Shift-Backspace'],
                    'delete-next-word': ['Ctrl-Delete'],
                    search: [
                        'Ctrl-Shift-F',
                    ],
                    'pane-focus-all': [
                        'Ctrl-Shift-I',
                    ],
                    'focus-all-tabs': [
                        'Ctrl-Alt-Shift-I',
                    ],
                    'scroll-to-top': ['Ctrl-PageUp'],
                    'scroll-page-up': ['Alt-PageUp'],
                    'scroll-up': ['Ctrl-Shift-Up'],
                    'scroll-down': ['Ctrl-Shift-Down'],
                    'scroll-page-down': ['Alt-PageDown'],
                    'scroll-to-bottom': ['Ctrl-PageDown'],
                },
            },
            [external_tabby_core_.Platform.Linux]: {
                terminal: {
                    font: 'Liberation Mono',
                    pasteOnMiddleClick: false, // handled by OS
                },
                hotkeys: {
                    'ctrl-c': ['Ctrl-C'],
                    copy: [
                        'Ctrl-Shift-C',
                    ],
                    paste: [
                        'Ctrl-Shift-V',
                        'Shift-Insert',
                    ],
                    'select-all': ['Ctrl-Shift-A'],
                    clear: [],
                    'zoom-in': [
                        'Ctrl-=',
                        'Ctrl-Shift-=',
                    ],
                    'zoom-out': [
                        'Ctrl--',
                        'Ctrl-Shift--',
                    ],
                    'reset-zoom': [
                        'Ctrl-0',
                    ],
                    home: ['Home'],
                    end: ['End'],
                    'previous-word': ['Ctrl-Left'],
                    'next-word': ['Ctrl-Right'],
                    'delete-previous-word': ['Ctrl-Backspace'],
                    'delete-line': ['Ctrl-Shift-Backspace'],
                    'delete-next-word': ['Ctrl-Delete'],
                    search: [
                        'Ctrl-Shift-F',
                    ],
                    'pane-focus-all': [
                        'Ctrl-Shift-I',
                    ],
                    'focus-all-tabs': [
                        'Ctrl-Alt-Shift-I',
                    ],
                    'scroll-to-top': ['Ctrl-PageUp'],
                    'scroll-page-up': ['Alt-PageUp'],
                    'scroll-up': ['Ctrl-Shift-Up'],
                    'scroll-down': ['Ctrl-Shift-Down'],
                    'scroll-page-down': ['Alt-PageDown'],
                    'scroll-to-bottom': ['Ctrl-PageDown'],
                },
            },
        };
    }
}

;// ./src/hotkeys.ts



/** @hidden */
let TerminalHotkeyProvider = class TerminalHotkeyProvider extends external_tabby_core_.HotkeyProvider {
    constructor(translate) {
        super();
        this.translate = translate;
        this.hotkeys = [
            {
                id: 'copy',
                name: this.translate.instant('Copy to clipboard'),
            },
            {
                id: 'paste',
                name: this.translate.instant('Paste from clipboard'),
            },
            {
                id: 'select-all',
                name: this.translate.instant('Select all'),
            },
            {
                id: 'home',
                name: this.translate.instant('Beginning of the line'),
            },
            {
                id: 'end',
                name: this.translate.instant('End of the line'),
            },
            {
                id: 'previous-word',
                name: this.translate.instant('Jump to previous word'),
            },
            {
                id: 'next-word',
                name: this.translate.instant('Jump to next word'),
            },
            {
                id: 'delete-previous-word',
                name: this.translate.instant('Delete previous word'),
            },
            {
                id: 'delete-line',
                name: this.translate.instant('Delete entire line'),
            },
            {
                id: 'delete-next-word',
                name: this.translate.instant('Delete next word'),
            },
            {
                id: 'clear',
                name: this.translate.instant('Clear terminal'),
            },
            {
                id: 'zoom-in',
                name: this.translate.instant('Zoom in'),
            },
            {
                id: 'zoom-out',
                name: this.translate.instant('Zoom out'),
            },
            {
                id: 'reset-zoom',
                name: this.translate.instant('Reset zoom'),
            },
            {
                id: 'ctrl-c',
                name: this.translate.instant('Intelligent Ctrl-C (copy/abort)'),
            },
            {
                id: 'copy-current-path',
                name: this.translate.instant('Copy current path'),
            },
            {
                id: 'search',
                name: this.translate.instant('Search'),
            },
            {
                id: 'pane-focus-all',
                name: this.translate.instant('Focus all panes at once (broadcast)'),
            },
            {
                id: 'focus-all-tabs',
                name: this.translate.instant('Focus all tabs at once (broadcast)'),
            },
            {
                id: 'scroll-to-top',
                name: this.translate.instant('Scroll terminal to top'),
            },
            {
                id: 'scroll-page-up',
                name: this.translate.instant('Scroll terminal one page up'),
            },
            {
                id: 'scroll-up',
                name: this.translate.instant('Scroll terminal one line up'),
            },
            {
                id: 'scroll-down',
                name: this.translate.instant('Scroll terminal one line down'),
            },
            {
                id: 'scroll-page-down',
                name: this.translate.instant('Scroll terminal one page down'),
            },
            {
                id: 'scroll-to-bottom',
                name: this.translate.instant('Scroll terminal to bottom'),
            },
            {
                id: 'reconnect-tab',
                name: this.translate.instant('Reconnect current tab (Serial/Telnet/SSH)'),
            },
            {
                id: 'disconnect-tab',
                name: this.translate.instant('Disconnect current tab (Serial/Telnet/SSH)'),
            },
        ];
    }
    provide() {
        return __awaiter(this, void 0, void 0, function* () {
            return this.hotkeys;
        });
    }
};
TerminalHotkeyProvider.ctorParameters = () => [
    { type: external_tabby_core_.TranslateService }
];
TerminalHotkeyProvider = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.TranslateService])
], TerminalHotkeyProvider);


;// ./src/api/connectableTerminalTab.component.ts





/**
 * A class to base your custom connectable terminal tabs on
 */
let ConnectableTerminalTabComponent = class ConnectableTerminalTabComponent extends BaseTerminalTabComponent {
    constructor(injector) {
        super(injector);
        this.injector = injector;
        this.reconnectOffered = false;
        this.isDisconnectedByHand = false;
        this.subscribeUntilDestroyed(this.hotkeys.hotkey$, hotkey => {
            if (!this.hasFocus) {
                return;
            }
            switch (hotkey) {
                case 'reconnect-tab':
                    this.reconnect();
                    this.notifications.notice(this.translate.instant('Reconnect'));
                    break;
                case 'disconnect-tab':
                    this.disconnect();
                    this.notifications.notice(this.translate.instant('Disconnect'));
                    break;
            }
        });
    }
    ngOnInit() {
        this.logger = this.log.create(`${this.profile.type}Tab`);
        super.ngOnInit();
    }
    onFrontendReady() {
        this.initializeSession().then(() => {
            this.clearServiceMessagesOnConnect();
        });
        super.onFrontendReady();
    }
    /**
    * Initialize Connectable Session.
    * Set reconnectOffered to false
    */
    initializeSession() {
        return __awaiter(this, void 0, void 0, function* () {
            this.reconnectOffered = false;
            this.isDisconnectedByHand = false;
        });
    }
    /**
    * Method called when session is destroyed. Handle the tab behavior on session end for connectable tab
    */
    onSessionDestroyed() {
        super.onSessionDestroyed();
        if (this.frontend) {
            if (this.profile.behaviorOnSessionEnd === 'reconnect' && !this.isDisconnectedByHand) {
                this.reconnect();
            }
            else if (this.profile.behaviorOnSessionEnd === 'keep' || !this.shouldTabBeDestroyedOnSessionClose()) {
                this.offerReconnection();
            }
        }
    }
    /**
    * Offering reconnection to the user if it hasn't been done yet.
    * Set reconnectOffered to true
    */
    offerReconnection() {
        if (!this.reconnectOffered) {
            this.reconnectOffered = true;
            this.write(this.translate.instant(marker('Press any key to reconnect')) + '\r\n');
            this.input$.pipe((0,external_rxjs_.first)()).subscribe(() => {
                var _a;
                if (!((_a = this.session) === null || _a === void 0 ? void 0 : _a.open) && this.reconnectOffered) {
                    this.reconnect();
                }
            });
        }
    }
    /**
     * Return true if tab should be destroyed on session closed.
     */
    shouldTabBeDestroyedOnSessionClose() {
        if (this.isDisconnectedByHand) {
            return false;
        }
        return super.shouldTabBeDestroyedOnSessionClose();
    }
    getRecoveryToken(options) {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            return {
                type: `app:${this.profile.type}-tab`,
                profile: this.profile,
                savedState: (options === null || options === void 0 ? void 0 : options.includeState) && ((_a = this.frontend) === null || _a === void 0 ? void 0 : _a.saveState()),
            };
        });
    }
    disconnect() {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            this.isDisconnectedByHand = true;
            yield ((_a = this.session) === null || _a === void 0 ? void 0 : _a.destroy());
        });
    }
    reconnect() {
        var _a, _b;
        return __awaiter(this, void 0, void 0, function* () {
            (_a = this.session) === null || _a === void 0 ? void 0 : _a.destroy();
            yield this.initializeSession();
            this.clearServiceMessagesOnConnect();
            (_b = this.session) === null || _b === void 0 ? void 0 : _b.releaseInitialDataBuffer();
        });
    }
    clearServiceMessagesOnConnect() {
        var _a, _b;
        if (this.profile.clearServiceMessagesOnConnect && ((_a = this.session) === null || _a === void 0 ? void 0 : _a.open)) {
            (_b = this.frontend) === null || _b === void 0 ? void 0 : _b.clear();
        }
    }
};
ConnectableTerminalTabComponent.ctorParameters = () => [
    { type: core_.Injector }
];
ConnectableTerminalTabComponent = __decorate([
    (0,core_.Component)({ template: '' }),
    __metadata("design:paramtypes", [core_.Injector])
], ConnectableTerminalTabComponent);


// EXTERNAL MODULE: ../app/node_modules/uuid/index.js
var uuid = __webpack_require__(6757);
// EXTERNAL MODULE: ../node_modules/slugify/slugify.js
var slugify = __webpack_require__(7562);
var slugify_default = /*#__PURE__*/__webpack_require__.n(slugify);
;// ./src/tabContextMenu.ts










/** @hidden */
let CopyPasteContextMenu = class CopyPasteContextMenu extends external_tabby_core_.TabContextMenuItemProvider {
    constructor(notifications, translate) {
        super();
        this.notifications = notifications;
        this.translate = translate;
        this.weight = -10;
    }
    getItems(tab, tabHeader) {
        return __awaiter(this, void 0, void 0, function* () {
            if (tabHeader) {
                return [];
            }
            if (tab instanceof BaseTerminalTabComponent) {
                return [
                    {
                        label: this.translate.instant('Copy'),
                        click: () => {
                            setTimeout(() => {
                                var _a;
                                (_a = tab.frontend) === null || _a === void 0 ? void 0 : _a.copySelection();
                                this.notifications.notice(this.translate.instant('Copied'));
                            });
                        },
                    },
                    {
                        label: this.translate.instant('Paste'),
                        click: () => tab.paste(),
                    },
                ];
            }
            return [];
        });
    }
};
CopyPasteContextMenu.ctorParameters = () => [
    { type: external_tabby_core_.NotificationsService },
    { type: external_tabby_core_.TranslateService }
];
CopyPasteContextMenu = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.NotificationsService,
        external_tabby_core_.TranslateService])
], CopyPasteContextMenu);

/** @hidden */
let MiscContextMenu = class MiscContextMenu extends external_tabby_core_.TabContextMenuItemProvider {
    constructor(translate, multifocus) {
        super();
        this.translate = translate;
        this.multifocus = multifocus;
        this.weight = 1;
    }
    getItems(tab) {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            const items = [];
            if (tab instanceof BaseTerminalTabComponent && tab.enableToolbar && !tab.pinToolbar) {
                items.push({
                    label: this.translate.instant('Show toolbar'),
                    click: () => {
                        tab.pinToolbar = true;
                    },
                });
            }
            if (tab instanceof BaseTerminalTabComponent && ((_a = tab.session) === null || _a === void 0 ? void 0 : _a.supportsWorkingDirectory())) {
                items.push({
                    label: this.translate.instant('Copy current path'),
                    click: () => tab.copyCurrentPath(),
                });
            }
            items.push({
                label: this.translate.instant('Focus all tabs'),
                click: () => {
                    this.multifocus.focusAllTabs();
                },
            });
            if (tab.parent instanceof external_tabby_core_.SplitTabComponent && tab.parent.getAllTabs().length > 1) {
                items.push({
                    label: this.translate.instant('Focus all panes'),
                    click: () => {
                        this.multifocus.focusAllPanes();
                    },
                });
            }
            return items;
        });
    }
};
MiscContextMenu.ctorParameters = () => [
    { type: external_tabby_core_.TranslateService },
    { type: MultifocusService }
];
MiscContextMenu = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.TranslateService,
        MultifocusService])
], MiscContextMenu);

/** @hidden */
let ReconnectContextMenu = class ReconnectContextMenu extends external_tabby_core_.TabContextMenuItemProvider {
    constructor(translate, notifications) {
        super();
        this.translate = translate;
        this.notifications = notifications;
        this.weight = 1;
    }
    getItems(tab) {
        return __awaiter(this, void 0, void 0, function* () {
            if (tab instanceof ConnectableTerminalTabComponent) {
                return [
                    {
                        label: this.translate.instant('Disconnect'),
                        click: () => {
                            setTimeout(() => {
                                tab.disconnect();
                                this.notifications.notice(this.translate.instant('Disconnect'));
                            });
                        },
                    },
                    {
                        label: this.translate.instant('Reconnect'),
                        click: () => {
                            setTimeout(() => {
                                tab.reconnect();
                                this.notifications.notice(this.translate.instant('Reconnect'));
                            });
                        },
                    },
                ];
            }
            return [];
        });
    }
};
ReconnectContextMenu.ctorParameters = () => [
    { type: external_tabby_core_.TranslateService },
    { type: external_tabby_core_.NotificationsService }
];
ReconnectContextMenu = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.TranslateService,
        external_tabby_core_.NotificationsService])
], ReconnectContextMenu);

/** @hidden */
let LegacyContextMenu = class LegacyContextMenu extends external_tabby_core_.TabContextMenuItemProvider {
    constructor(contextMenuProviders) {
        super();
        this.contextMenuProviders = contextMenuProviders;
        this.weight = 1;
    }
    getItems(tab) {
        return __awaiter(this, void 0, void 0, function* () {
            if (!this.contextMenuProviders) {
                return [];
            }
            if (tab instanceof BaseTerminalTabComponent) {
                let items = [];
                for (const p of this.contextMenuProviders) {
                    items = items.concat(yield p.getItems(tab));
                }
                return items;
            }
            return [];
        });
    }
};
LegacyContextMenu.ctorParameters = () => [
    { type: Array, decorators: [{ type: core_.Optional }, { type: core_.Inject, args: [TerminalContextMenuItemProvider,] }] }
];
LegacyContextMenu = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [Object])
], LegacyContextMenu);

/** @hidden */
let SaveAsProfileContextMenu = class SaveAsProfileContextMenu extends external_tabby_core_.TabContextMenuItemProvider {
    constructor(config, ngbModal, notifications, translate) {
        super();
        this.config = config;
        this.ngbModal = ngbModal;
        this.notifications = notifications;
        this.translate = translate;
    }
    getItems(tab) {
        return __awaiter(this, void 0, void 0, function* () {
            if (tab instanceof BaseTerminalTabComponent) {
                return [
                    {
                        label: this.translate.instant('Save as profile'),
                        click: () => __awaiter(this, void 0, void 0, function* () {
                            var _a, _b, _c;
                            const modal = this.ngbModal.open(external_tabby_core_.PromptModalComponent);
                            modal.componentInstance.prompt = this.translate.instant('New profile name');
                            modal.componentInstance.value = tab.profile.name;
                            const name = (_a = (yield modal.result.catch(() => null))) === null || _a === void 0 ? void 0 : _a.value;
                            if (!name) {
                                return;
                            }
                            const options = JSON.parse(JSON.stringify(tab.profile.options));
                            const cwd = (_c = yield ((_b = tab.session) === null || _b === void 0 ? void 0 : _b.getWorkingDirectory())) !== null && _c !== void 0 ? _c : tab.profile.options.cwd;
                            if (cwd) {
                                options.cwd = cwd;
                            }
                            const profile = {
                                type: tab.profile.type,
                                name,
                                options,
                            };
                            profile.id = `${profile.type}:custom:${slugify_default()(name)}:${(0,uuid.v4)()}`;
                            profile.group = tab.profile.group;
                            profile.icon = tab.profile.icon;
                            profile.color = tab.profile.color;
                            profile.disableDynamicTitle = tab.profile.disableDynamicTitle;
                            profile.behaviorOnSessionEnd = tab.profile.behaviorOnSessionEnd;
                            this.config.store.profiles = [
                                ...this.config.store.profiles,
                                profile,
                            ];
                            this.config.save();
                            this.notifications.info(this.translate.instant('Saved'));
                        }),
                    },
                ];
            }
            return [];
        });
    }
};
SaveAsProfileContextMenu.ctorParameters = () => [
    { type: external_tabby_core_.ConfigService },
    { type: ng_bootstrap_.NgbModal },
    { type: external_tabby_core_.NotificationsService },
    { type: external_tabby_core_.TranslateService }
];
SaveAsProfileContextMenu = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.ConfigService,
        ng_bootstrap_.NgbModal,
        external_tabby_core_.NotificationsService,
        external_tabby_core_.TranslateService])
], SaveAsProfileContextMenu);


// EXTERNAL MODULE: ../node_modules/shell-quote/index.js
var shell_quote = __webpack_require__(6045);
;// ./src/cli.ts





let TerminalCLIHandler = class TerminalCLIHandler extends external_tabby_core_.CLIHandler {
    constructor(app, hostWindow) {
        super();
        this.app = app;
        this.hostWindow = hostWindow;
        this.firstMatchOnly = true;
        this.priority = 0;
    }
    handle(event) {
        return __awaiter(this, void 0, void 0, function* () {
            const op = event.argv._[0];
            if (op === 'paste') {
                let text = event.argv.text;
                if (event.argv.escape) {
                    text = shell_quote.quote([text]);
                }
                this.handlePaste(text);
                return true;
            }
            return false;
        });
    }
    handlePaste(text) {
        if (this.app.activeTab instanceof BaseTerminalTabComponent && this.app.activeTab.session) {
            this.app.activeTab.sendInput(text);
            this.hostWindow.bringToFront();
        }
    }
};
TerminalCLIHandler.ctorParameters = () => [
    { type: external_tabby_core_.AppService },
    { type: external_tabby_core_.HostWindowService }
];
TerminalCLIHandler = __decorate([
    (0,core_.Injectable)(),
    __metadata("design:paramtypes", [external_tabby_core_.AppService,
        external_tabby_core_.HostWindowService])
], TerminalCLIHandler);


// EXTERNAL MODULE: ./node_modules/hexer/index.js
var hexer = __webpack_require__(2902);
var hexer_default = /*#__PURE__*/__webpack_require__.n(hexer);
// EXTERNAL MODULE: ./node_modules/buffer-replace/index.js
var buffer_replace = __webpack_require__(8915);
var buffer_replace_default = /*#__PURE__*/__webpack_require__.n(buffer_replace);
// EXTERNAL MODULE: ./node_modules/binstring/lib/binstring.js
var binstring = __webpack_require__(4848);
var binstring_default = /*#__PURE__*/__webpack_require__.n(binstring);
// EXTERNAL MODULE: external "stream"
var external_stream_ = __webpack_require__(7748);
// EXTERNAL MODULE: external "readline"
var external_readline_ = __webpack_require__(4902);
;// ./src/middleware/streamProcessing.ts








class TerminalStreamProcessor extends SessionMiddleware {
    constructor(options) {
        super();
        this.options = options;
        this.forceEcho = false;
        this.inputReadline = null;
        this.inputPromptVisible = false;
        this.started = false;
        this.inputReadlineInStream = new external_stream_.PassThrough();
        this.inputReadlineOutStream = new external_stream_.PassThrough();
        this.inputReadlineOutStream.on('data', data => {
            this.outputToTerminal.next(Buffer.from(data));
        });
        this.outputToTerminal$.pipe((0,external_rxjs_.debounce)(() => (0,external_rxjs_.interval)(500))).subscribe(() => {
            if (this.started) {
                this.onOutputSettled();
            }
        });
    }
    start() {
        this.inputReadline = (0,external_readline_.createInterface)({
            input: this.inputReadlineInStream,
            output: this.inputReadlineOutStream,
            terminal: true,
            prompt: this.options.inputMode === 'readline-hex' ? 'hex> ' : '> ',
        });
        this.inputReadline.on('line', line => {
            this.onTerminalInput(Buffer.from(line + '\n'));
            this.resetInputPrompt();
        });
        this.started = true;
    }
    feedFromSession(data) {
        var _a;
        if ((_a = this.options.inputMode) === null || _a === void 0 ? void 0 : _a.startsWith('readline')) {
            if (this.inputPromptVisible) {
                (0,external_readline_.clearLine)(this.inputReadlineOutStream, 0);
                this.outputToTerminal.next(Buffer.from('\r'));
                this.inputPromptVisible = false;
            }
        }
        data = this.replaceNewlines(data, this.options.outputNewlines);
        if (this.options.outputMode === 'hex') {
            this.outputToTerminal.next(Buffer.concat([
                Buffer.from('\r\n'),
                Buffer.from(hexer_default()(data, {
                    group: 1,
                    gutter: 4,
                    divide: ansi_colors_default().gray(' ｜ '),
                    emptyHuman: ansi_colors_default().gray('╳'),
                }).replaceAll('\n', '\r\n')),
                Buffer.from('\r\n\n'),
            ]));
        }
        else {
            this.outputToTerminal.next(data);
        }
    }
    feedFromTerminal(data) {
        var _a;
        if (this.options.inputMode === 'local-echo' || this.forceEcho) {
            this.outputToTerminal.next(this.replaceNewlines(data, 'crlf'));
        }
        if ((_a = this.options.inputMode) === null || _a === void 0 ? void 0 : _a.startsWith('readline')) {
            this.inputReadlineInStream.write(data);
        }
        else {
            this.onTerminalInput(data);
        }
    }
    resize() {
        var _a;
        if ((_a = this.options.inputMode) === null || _a === void 0 ? void 0 : _a.startsWith('readline')) {
            this.inputReadlineOutStream.emit('resize');
        }
    }
    close() {
        var _a;
        (_a = this.inputReadline) === null || _a === void 0 ? void 0 : _a.close();
        super.close();
    }
    onTerminalInput(data) {
        if (this.options.inputMode === 'readline-hex') {
            const tokens = data.toString().split(/\s/g);
            data = Buffer.concat(tokens.filter(t => !!t).map(t => {
                if (t.startsWith('0x')) {
                    t = t.substring(2);
                }
                return binstring_default()(t, { 'in': 'hex' });
            }));
        }
        data = this.replaceNewlines(data, this.options.inputNewlines);
        this.outputToSession.next(data);
    }
    onOutputSettled() {
        var _a;
        if (((_a = this.options.inputMode) === null || _a === void 0 ? void 0 : _a.startsWith('readline')) && !this.inputPromptVisible) {
            this.resetInputPrompt();
        }
    }
    resetInputPrompt() {
        var _a;
        this.outputToTerminal.next(Buffer.from('\r\n'));
        (_a = this.inputReadline) === null || _a === void 0 ? void 0 : _a.prompt(true);
        this.inputPromptVisible = true;
    }
    replaceNewlines(data, mode) {
        if (!mode) {
            return data;
        }
        else if (mode === 'implicit_cr') {
            return buffer_replace_default()(data, '\n', '\r\n');
        }
        else if (mode === 'implicit_lf') {
            return buffer_replace_default()(data, '\r', '\r\n');
        }
        data = buffer_replace_default()(data, '\r\n', '\n');
        data = buffer_replace_default()(data, '\r', '\n');
        const replacement = {
            strip: '',
            cr: '\r',
            lf: '\n',
            crlf: '\r\n',
        }[mode];
        return buffer_replace_default()(data, '\n', replacement);
    }
}

// EXTERNAL MODULE: ../node_modules/clone-deep/index.js
var clone_deep = __webpack_require__(4732);
var clone_deep_default = /*#__PURE__*/__webpack_require__.n(clone_deep);
;// ./src/middleware/loginScriptProcessing.ts


class LoginScriptProcessor extends SessionMiddleware {
    constructor(logger, options) {
        super();
        this.logger = logger;
        this.remainingScripts = [];
        this.escapeSeqMap = {
            a: '\x07',
            b: '\x08',
            e: '\x1b',
            f: '\x0c',
            n: '\x0a',
            r: '\x0d',
            t: '\x09',
            v: '\x0b',
        };
        this.remainingScripts = clone_deep_default()(options.scripts);
        for (const script of this.remainingScripts) {
            if (!script.isRegex) {
                script.expect = this.unescape(script.expect);
            }
            script.send = this.unescape(script.send);
        }
    }
    feedFromSession(data) {
        const dataString = data.toString();
        for (const script of this.remainingScripts) {
            if (!script.expect) {
                continue;
            }
            let match = false;
            if (script.isRegex) {
                const re = new RegExp(script.expect, 'g');
                match = re.test(dataString);
            }
            else {
                match = dataString.includes(script.expect);
            }
            if (match) {
                this.logger.info('Executing script:', script);
                this.outputToSession.next(Buffer.from(script.send + '\n'));
                this.remainingScripts = this.remainingScripts.filter(x => x !== script);
            }
            else {
                if (script.optional) {
                    this.logger.debug('Skip optional script: ' + script.expect);
                    this.remainingScripts = this.remainingScripts.filter(x => x !== script);
                }
                else {
                    break;
                }
            }
        }
        super.feedFromSession(data);
    }
    executeUnconditionalScripts() {
        for (const script of this.remainingScripts) {
            if (!script.expect) {
                this.logger.info('Executing script:', script.send);
                this.outputToSession.next(Buffer.from(script.send + '\n'));
                this.remainingScripts = this.remainingScripts.filter(x => x !== script);
            }
            else {
                break;
            }
        }
    }
    unescape(line) {
        line = line.replace(/\\((x\d{2})|(u\d{4}))/g, (match, g) => {
            return String.fromCharCode(parseInt(g.substr(1), 16));
        });
        return line.replace(/\\(.)/g, (match, g) => {
            return this.escapeSeqMap[g] || g;
        });
    }
}

// EXTERNAL MODULE: external "os"
var external_os_ = __webpack_require__(4234);
;// ./src/middleware/oscProcessing.ts



const OSCPrefix = Buffer.from('\x1b]');
const OSCSuffixes = [Buffer.from('\x07'), Buffer.from('\x1b\\')];
class OSCProcessor extends SessionMiddleware {
    constructor() {
        super(...arguments);
        this.cwdReported = new external_rxjs_.Subject();
        this.buffer = null;
    }
    get cwdReported$() { return this.cwdReported; }
    feedFromSession(data) {
        // Prepend any buffered data from previous chunks
        if (this.buffer) {
            data = Buffer.concat([this.buffer, data]);
            this.buffer = null;
        }
        let startIndex = 0;
        const processedData = [];
        while (startIndex < data.length) {
            const prefixIndex = data.indexOf(OSCPrefix, startIndex);
            if (prefixIndex === -1) {
                // No more OSC sequences, pass remaining data
                if (startIndex < data.length) {
                    processedData.push(data.subarray(startIndex));
                }
                break;
            }
            // Pass data before this OSC sequence
            if (prefixIndex > startIndex) {
                processedData.push(data.subarray(startIndex, prefixIndex));
            }
            // Look for suffix after the prefix
            const suffixSearchStart = prefixIndex + OSCPrefix.length;
            let foundSuffix = null;
            for (const suffix of OSCSuffixes) {
                const suffixIndex = data.indexOf(suffix, suffixSearchStart);
                if (suffixIndex !== -1) {
                    if (!foundSuffix || suffixIndex < foundSuffix[1]) {
                        foundSuffix = [suffix, suffixIndex];
                    }
                }
            }
            if (!foundSuffix) {
                // No suffix found - buffer the rest and wait for next chunk
                this.buffer = data.subarray(prefixIndex);
                break;
            }
            // Extract OSC string (between prefix and suffix)
            const oscString = data.subarray(suffixSearchStart, foundSuffix[1]).toString();
            const [oscCodeString, ...oscParams] = oscString.split(';');
            const oscCode = parseInt(oscCodeString);
            if (oscCode === 1337) {
                const paramString = oscParams.join(';');
                if (paramString.startsWith('CurrentDir=')) {
                    let reportedCWD = paramString.split('=', 2)[1];
                    if (reportedCWD.startsWith('~')) {
                        reportedCWD = external_os_.homedir() + reportedCWD.substring(1);
                    }
                    this.cwdReported.next(reportedCWD);
                }
                else {
                    console.debug('Unsupported OSC 1337 parameter:', paramString);
                }
            }
            // Move past this OSC sequence
            startIndex = foundSuffix[1] + foundSuffix[0].length;
        }
        // Pass through all processed data
        if (processedData.length > 0) {
            super.feedFromSession(Buffer.concat(processedData));
        }
    }
    close() {
        this.cwdReported.complete();
        super.close();
    }
}

;// ./src/middleware/utf8Splitter.ts


/**
 * Ensures that the session output is chunked at UTF8 character boundaries.
 */
class UTF8SplitterMiddleware extends SessionMiddleware {
    constructor() {
        super(...arguments);
        this.decoder = new external_tabby_core_.UTF8Splitter();
    }
    feedFromSession(data) {
        super.feedFromSession(this.decoder.write(data));
    }
    close() {
        const remainder = this.decoder.flush();
        if (remainder.length) {
            super.feedFromSession(remainder);
        }
        super.close();
    }
}

;// ./src/middleware/inputProcessing.ts

class InputProcessor extends SessionMiddleware {
    constructor(options) {
        super();
        this.options = options;
    }
    feedFromTerminal(data) {
        if (data.length === 1 && data[0] === 0x7f) {
            if (this.options.backspace === 'ctrl-h') {
                data = Buffer.from('\x08');
            }
            else if (this.options.backspace === 'ctrl-?') {
                data = Buffer.from('\x7f');
            }
            else if (this.options.backspace === 'delete') {
                data = Buffer.from('\x1b[3~');
            }
            else {
                data = Buffer.from('\x7f');
            }
        }
        this.outputToSession.next(data);
    }
}

;// ./src/session.ts





/**
 * A session object for a [[BaseTerminalTabComponent]]
 * Extend this to implement custom I/O and process management for your terminal tab
 */
class BaseSession {
    get output$() { return this.output; }
    get binaryOutput$() { return this.binaryOutput; }
    get closed$() { return this.closed; }
    get destroyed$() { return this.destroyed; }
    constructor(logger) {
        this.logger = logger;
        this.oscProcessor = new OSCProcessor();
        this.middleware = new SessionMiddlewareStack();
        this.output = new external_rxjs_.Subject();
        this.binaryOutput = new external_rxjs_.Subject();
        this.closed = new external_rxjs_.Subject();
        this.destroyed = new external_rxjs_.Subject();
        this.loginScriptProcessor = null;
        this.initialDataBuffer = Buffer.from('');
        this.initialDataBufferReleased = false;
        this.middleware.push(this.oscProcessor);
        this.oscProcessor.cwdReported$.subscribe(cwd => {
            this.reportedCWD = cwd;
        });
        this.middleware.outputToTerminal$.subscribe(data => {
            if (!this.initialDataBufferReleased) {
                this.initialDataBuffer = Buffer.concat([this.initialDataBuffer, data]);
            }
            else {
                this.output.next(data.toString());
                this.binaryOutput.next(data);
            }
        });
        this.middleware.outputToSession$.subscribe(data => this.write(data));
    }
    feedFromTerminal(data) {
        this.middleware.feedFromTerminal(data);
    }
    emitOutput(data) {
        this.middleware.feedFromSession(data);
    }
    releaseInitialDataBuffer() {
        this.initialDataBufferReleased = true;
        this.output.next(this.initialDataBuffer.toString());
        this.binaryOutput.next(this.initialDataBuffer);
        this.initialDataBuffer = Buffer.from('');
    }
    setLoginScriptsOptions(options) {
        const newProcessor = new LoginScriptProcessor(this.logger, options);
        if (this.loginScriptProcessor) {
            this.middleware.replace(this.loginScriptProcessor, newProcessor);
        }
        else {
            this.middleware.push(newProcessor);
        }
        this.loginScriptProcessor = newProcessor;
    }
    destroy() {
        return __awaiter(this, void 0, void 0, function* () {
            if (this.open) {
                this.logger.info('Destroying');
                this.open = false;
                this.closed.next();
                this.destroyed.next();
                yield this.gracefullyKillProcess();
            }
            this.middleware.close();
            this.closed.complete();
            this.destroyed.complete();
            this.output.complete();
            this.binaryOutput.complete();
        });
    }
}

;// ./src/index.ts


































/** @hidden */
let TerminalModule = class TerminalModule {
}; // eslint-disable-line @typescript-eslint/no-extraneous-class
TerminalModule = __decorate([
    (0,core_.NgModule)({
        imports: [
            common_.CommonModule,
            forms_.FormsModule,
            ng_bootstrap_.NgbModule,
            external_ngx_toastr_.ToastrModule,
            (external_tabby_core_default()),
            NgxColorsModule,
        ],
        providers: [
            { provide: external_tabby_settings_.SettingsTabProvider, useClass: AppearanceSettingsTabProvider, multi: true },
            { provide: external_tabby_settings_.SettingsTabProvider, useClass: ColorSchemeSettingsTabProvider, multi: true },
            { provide: external_tabby_settings_.SettingsTabProvider, useClass: TerminalSettingsTabProvider, multi: true },
            { provide: external_tabby_core_.ConfigProvider, useClass: TerminalConfigProvider, multi: true },
            { provide: external_tabby_core_.HotkeyProvider, useClass: TerminalHotkeyProvider, multi: true },
            { provide: TerminalDecorator, useClass: ZModemDecorator, multi: true },
            { provide: TerminalDecorator, useClass: DebugDecorator, multi: true },
            { provide: external_tabby_core_.TabContextMenuItemProvider, useClass: CopyPasteContextMenu, multi: true },
            { provide: external_tabby_core_.TabContextMenuItemProvider, useClass: MiscContextMenu, multi: true },
            { provide: external_tabby_core_.TabContextMenuItemProvider, useClass: LegacyContextMenu, multi: true },
            { provide: external_tabby_core_.TabContextMenuItemProvider, useClass: ReconnectContextMenu, multi: true },
            { provide: external_tabby_core_.TabContextMenuItemProvider, useClass: SaveAsProfileContextMenu, multi: true },
            { provide: external_tabby_core_.CLIHandler, useClass: TerminalCLIHandler, multi: true },
            { provide: TerminalColorSchemeProvider, useClass: DefaultColorSchemes, multi: true },
        ],
        declarations: [
            colorPicker_component_ColorPickerComponent,
            ColorSchemePreviewComponent,
            ColorSchemeSelectorComponent,
            AppearanceSettingsTabComponent,
            ColorSchemeSettingsTabComponent,
            TerminalSettingsTabComponent,
            SearchPanelComponent,
            StreamProcessingSettingsComponent,
            LoginScriptsSettingsComponent,
            TerminalToolbarComponent,
            InputProcessingSettingsComponent,
            ColorSchemeSettingsForModeComponent,
        ],
        exports: [
            colorPicker_component_ColorPickerComponent,
            ColorSchemeSelectorComponent,
            SearchPanelComponent,
            StreamProcessingSettingsComponent,
            LoginScriptsSettingsComponent,
            TerminalToolbarComponent,
            InputProcessingSettingsComponent,
        ],
    })
], TerminalModule);
/* harmony default export */ const src = (TerminalModule);















})();

/******/ 	return __webpack_exports__;
/******/ })()
;
});
//# sourceMappingURL=../../../app.asar.unpacked/assets/webpack/index.js.map