securityos/node_modules/@wasmer/wasm-terminal/lib/unoptimized/wasm-terminal.iife.js

1009 lines
751 KiB
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
/*
*****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
*****************************************************************************/
'use strict';var WasmTerminal=function(Jc){function Kc(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d["default"]:d}function Lc(d,a){return a={exports:{}},d(a,a.exports),a.exports}function mg(d,a,b,c){return new (b||(b=Promise))(function(e,f){function h(a){try{k(c.next(a))}catch(t){f(t)}}function g(a){try{k(c["throw"](a))}catch(t){f(t)}}function k(a){a.done?e(a.value):(new b(function(b){b(a.value)})).then(h,g)}k((c=c.apply(d,a||[])).next())})}function ng(d,a){function b(a){return function(b){return c([a,
b])}}function c(b){if(f)throw new TypeError("Generator is already executing.");for(;e;)try{if(f=1,h&&(g=b[0]&2?h["return"]:b[0]?h["throw"]||((g=h["return"])&&g.call(h),0):h.next)&&!(g=g.call(h,b[1])).done)return g;if(h=0,g)b=[b[0]&2,g.value];switch(b[0]){case 0:case 1:g=b;break;case 4:return e.label++,{value:b[1],done:!1};case 5:e.label++;h=b[1];b=[0];continue;case 7:b=e.ops.pop();e.trys.pop();continue;default:if(!(g=e.trys,g=0<g.length&&g[g.length-1])&&(6===b[0]||2===b[0])){e=0;continue}if(3===b[0]&&
(!g||b[1]>g[0]&&b[1]<g[3]))e.label=b[1];else if(6===b[0]&&e.label<g[1])e.label=g[1],g=b;else if(g&&e.label<g[2])e.label=g[2],e.ops.push(b);else{g[2]&&e.ops.pop();e.trys.pop();continue}}b=a.call(d,e)}catch(t){b=[6,t],h=0}finally{f=g=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}var e={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},f,h,g,k;return k={next:b(0),"throw":b(1),"return":b(2)},"function"===typeof Symbol&&(k[Symbol.iterator]=function(){return this}),
k}function Mc(d){var a="function"===typeof Symbol&&d[Symbol.iterator],b=0;return a?a.call(d):{next:function(){d&&b>=d.length&&(d=void 0);return{value:d&&d[b++],done:!d}}}}function og(d,a){var b="function"===typeof Symbol&&d[Symbol.iterator];if(!b)return d;d=b.call(d);var c,e=[];try{for(;(void 0===a||0<a--)&&!(c=d.next()).done;)e.push(c.value)}catch(h){var f={error:h}}finally{try{c&&!c.done&&(b=d["return"])&&b.call(d)}finally{if(f)throw f.error;}}return e}function pg(){for(var d=[],a=0;a<arguments.length;a++)d=
d.concat(og(arguments[a]));return d}function P(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d["default"]:d}function ba(d,a){return a={exports:{}},d(a,a.exports),a.exports}function Rd(){Nc=!0;for(var d=0;64>d;++d)oa[d]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[d],ia["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(d)]=d;ia[45]=62;ia[95]=63}function qg(d,a,b){for(var c=[],e=a;e<b;e+=3)a=(d[e]<<16)+(d[e+1]<<8)+d[e+
2],c.push(oa[a>>18&63]+oa[a>>12&63]+oa[a>>6&63]+oa[a&63]);return c.join("")}function Sd(d){Nc||Rd();for(var a=d.length,b=a%3,c="",e=[],f=0,h=a-b;f<h;f+=16383)e.push(qg(d,f,f+16383>h?h:f+16383));1===b?(d=d[a-1],c+=oa[d>>2],c+=oa[d<<4&63],c+="=="):2===b&&(d=(d[a-2]<<8)+d[a-1],c+=oa[d>>10],c+=oa[d>>4&63],c+=oa[d<<2&63],c+="=");e.push(c);return e.join("")}function Wb(d,a,b,c,e){var f=8*e-c-1,h=(1<<f)-1,g=h>>1,k=-7;e=b?e-1:0;var q=b?-1:1,t=d[a+e];e+=q;b=t&(1<<-k)-1;t>>=-k;for(k+=f;0<k;b=256*b+d[a+e],e+=
q,k-=8);f=b&(1<<-k)-1;b>>=-k;for(k+=c;0<k;f=256*f+d[a+e],e+=q,k-=8);if(0===b)b=1-g;else{if(b===h)return f?NaN:Infinity*(t?-1:1);f+=Math.pow(2,c);b-=g}return(t?-1:1)*f*Math.pow(2,b-c)}function mc(d,a,b,c,e,f){var h,g=8*f-e-1,k=(1<<g)-1,q=k>>1,t=23===e?Math.pow(2,-24)-Math.pow(2,-77):0;f=c?0:f-1;var p=c?1:-1,v=0>a||0===a&&0>1/a?1:0;a=Math.abs(a);for(isNaN(a)||Infinity===a?(a=isNaN(a)?1:0,c=k):(c=Math.floor(Math.log(a)/Math.LN2),1>a*(h=Math.pow(2,-c))&&(c--,h*=2),a=1<=c+q?a+t/h:a+t*Math.pow(2,1-q),2<=
a*h&&(c++,h/=2),c+q>=k?(a=0,c=k):1<=c+q?(a=(a*h-1)*Math.pow(2,e),c+=q):(a=a*Math.pow(2,q-1)*Math.pow(2,e),c=0));8<=e;d[b+f]=a&255,f+=p,a/=256,e-=8);c=c<<e|a;for(g+=e;0<g;d[b+f]=c&255,f+=p,c/=256,g-=8);d[b+f-p]|=128*v}function ta(d,a){if((u.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<a)throw new RangeError("Invalid typed array length");u.TYPED_ARRAY_SUPPORT?(d=new Uint8Array(a),d.__proto__=u.prototype):(null===d&&(d=new u(a)),d.length=a);return d}function u(d,a,b){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof
u))return new u(d,a,b);if("number"===typeof d){if("string"===typeof a)throw Error("If encoding is specified then the first argument must be a string");return Oc(this,d)}return Td(this,d,a,b)}function Td(d,a,b,c){if("number"===typeof a)throw new TypeError('"value" argument must not be a number');if("undefined"!==typeof ArrayBuffer&&a instanceof ArrayBuffer){a.byteLength;if(0>b||a.byteLength<b)throw new RangeError("'offset' is out of bounds");if(a.byteLength<b+(c||0))throw new RangeError("'length' is out of bounds");
a=void 0===b&&void 0===c?new Uint8Array(a):void 0===c?new Uint8Array(a,b):new Uint8Array(a,b,c);u.TYPED_ARRAY_SUPPORT?(d=a,d.__proto__=u.prototype):d=Pc(d,a);return d}if("string"===typeof a){c=d;d=b;if("string"!==typeof d||""===d)d="utf8";if(!u.isEncoding(d))throw new TypeError('"encoding" must be a valid string encoding');b=Ud(a,d)|0;c=ta(c,b);a=c.write(a,d);a!==b&&(c=c.slice(0,a));return c}return rg(d,a)}function Vd(d){if("number"!==typeof d)throw new TypeError('"size" argument must be a number');
if(0>d)throw new RangeError('"size" argument must not be negative');}function Oc(d,a){Vd(a);d=ta(d,0>a?0:Qc(a)|0);if(!u.TYPED_ARRAY_SUPPORT)for(var b=0;b<a;++b)d[b]=0;return d}function Pc(d,a){var b=0>a.length?0:Qc(a.length)|0;d=ta(d,b);for(var c=0;c<b;c+=1)d[c]=a[c]&255;return d}function rg(d,a){if(ja(a)){var b=Qc(a.length)|0;d=ta(d,b);if(0===d.length)return d;a.copy(d,0,0,b);return d}if(a){if("undefined"!==typeof ArrayBuffer&&a.buffer instanceof ArrayBuffer||"length"in a)return(b="number"!==typeof a.length)||
(b=a.length,b=b!==b),b?ta(d,0):Pc(d,a);if("Buffer"===a.type&&Wd(a.data))return Pc(d,a.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");}function Qc(d){if(d>=(u.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(u.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return d|0}function ja(d){return!(null==d||!d._isBuffer)}function Ud(d,a){if(ja(d))return d.length;
if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(d)||d instanceof ArrayBuffer))return d.byteLength;"string"!==typeof d&&(d=""+d);var b=d.length;if(0===b)return 0;for(var c=!1;;)switch(a){case "ascii":case "latin1":case "binary":return b;case "utf8":case "utf-8":case void 0:return nc(d).length;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*b;case "hex":return b>>>1;case "base64":return Xd(d).length;default:if(c)return nc(d).length;a=
(""+a).toLowerCase();c=!0}}function sg(d,a,b){var c=!1;if(void 0===a||0>a)a=0;if(a>this.length)return"";if(void 0===b||b>this.length)b=this.length;if(0>=b)return"";b>>>=0;a>>>=0;if(b<=a)return"";for(d||(d="utf8");;)switch(d){case "hex":d=a;a=b;b=this.length;if(!d||0>d)d=0;if(!a||0>a||a>b)a=b;c="";for(b=d;b<a;++b)d=c,c=this[b],c=16>c?"0"+c.toString(16):c.toString(16),c=d+c;return c;case "utf8":case "utf-8":return Yd(this,a,b);case "ascii":d="";for(b=Math.min(this.length,b);a<b;++a)d+=String.fromCharCode(this[a]&
127);return d;case "latin1":case "binary":d="";for(b=Math.min(this.length,b);a<b;++a)d+=String.fromCharCode(this[a]);return d;case "base64":return a=0===a&&b===this.length?Sd(this):Sd(this.slice(a,b)),a;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":a=this.slice(a,b);b="";for(d=0;d<a.length;d+=2)b+=String.fromCharCode(a[d]+256*a[d+1]);return b;default:if(c)throw new TypeError("Unknown encoding: "+d);d=(d+"").toLowerCase();c=!0}}function db(d,a,b){var c=d[a];d[a]=d[b];d[b]=c}function Zd(d,
a,b,c,e){if(0===d.length)return-1;"string"===typeof b?(c=b,b=0):2147483647<b?b=2147483647:-2147483648>b&&(b=-2147483648);b=+b;isNaN(b)&&(b=e?0:d.length-1);0>b&&(b=d.length+b);if(b>=d.length){if(e)return-1;b=d.length-1}else if(0>b)if(e)b=0;else return-1;"string"===typeof a&&(a=u.from(a,c));if(ja(a))return 0===a.length?-1:$d(d,a,b,c,e);if("number"===typeof a)return a&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(d,a,b):Uint8Array.prototype.lastIndexOf.call(d,
a,b):$d(d,[a],b,c,e);throw new TypeError("val must be string, number or Buffer");}function $d(d,a,b,c,e){function f(a,b){return 1===h?a[b]:a.readUInt16BE(b*h)}var h=1,g=d.length,k=a.length;if(void 0!==c&&(c=String(c).toLowerCase(),"ucs2"===c||"ucs-2"===c||"utf16le"===c||"utf-16le"===c)){if(2>d.length||2>a.length)return-1;h=2;g/=2;k/=2;b/=2}if(e)for(c=-1;b<g;b++)if(f(d,b)===f(a,-1===c?0:b-c)){if(-1===c&&(c=b),b-c+1===k)return c*h}else-1!==c&&(b-=b-c),c=-1;else for(b+k>g&&(b=g-k);0<=b;b--){g=!0;for(c=
0;c<k;c++)if(f(d,b+c)!==f(a,c)){g=!1;break}if(g)return b}return-1}function Yd(d,a,b){b=Math.min(d.length,b);for(var c=[];a<b;){var e=d[a],f=null,h=239<e?4:223<e?3:191<e?2:1;if(a+h<=b)switch(h){case 1:128>e&&(f=e);break;case 2:var g=d[a+1];128===(g&192)&&(e=(e&31)<<6|g&63,127<e&&(f=e));break;case 3:g=d[a+1];var k=d[a+2];128===(g&192)&&128===(k&192)&&(e=(e&15)<<12|(g&63)<<6|k&63,2047<e&&(55296>e||57343<e)&&(f=e));break;case 4:g=d[a+1];k=d[a+2];var q=d[a+3];128===(g&192)&&128===(k&192)&&128===(q&192)&&
(e=(e&15)<<18|(g&63)<<12|(k&63)<<6|q&63,65535<e&&1114112>e&&(f=e))}null===f?(f=65533,h=1):65535<f&&(f-=65536,c.push(f>>>10&1023|55296),f=56320|f&1023);c.push(f);a+=h}d=c.length;if(d<=ae)c=String.fromCharCode.apply(String,c);else{b="";for(a=0;a<d;)b+=String.fromCharCode.apply(String,c.slice(a,a+=ae));c=b}return c}function Q(d,a,b){if(0!==d%1||0>d)throw new RangeError("offset is not uint");if(d+a>b)throw new RangeError("Trying to access beyond buffer length");}function V(d,a,b,c,e,f){if(!ja(d))throw new TypeError('"buffer" argument must be a Buffer instance');
if(a>e||a<f)throw new RangeError('"value" argument is out of bounds');if(b+c>d.length)throw new RangeError("Index out of range");}function oc(d,a,b,c){0>a&&(a=65535+a+1);for(var e=0,f=Math.min(d.length-b,2);e<f;++e)d[b+e]=(a&255<<8*(c?e:1-e))>>>8*(c?e:1-e)}function pc(d,a,b,c){0>a&&(a=4294967295+a+1);for(var e=0,f=Math.min(d.length-b,4);e<f;++e)d[b+e]=a>>>8*(c?e:3-e)&255}function Xb(d,a,b,c){if(b+c>d.length)throw new RangeError("Index out of range");if(0>b)throw new RangeError("Index out of range");
}function nc(d,a){a=a||Infinity;for(var b,c=d.length,e=null,f=[],h=0;h<c;++h){b=d.charCodeAt(h);if(55295<b&&57344>b){if(!e){if(56319<b){-1<(a-=3)&&f.push(239,191,189);continue}else if(h+1===c){-1<(a-=3)&&f.push(239,191,189);continue}e=b;continue}if(56320>b){-1<(a-=3)&&f.push(239,191,189);e=b;continue}b=(e-55296<<10|b-56320)+65536}else e&&-1<(a-=3)&&f.push(239,191,189);e=null;if(128>b){if(0>--a)break;f.push(b)}else if(2048>b){if(0>(a-=2))break;f.push(b>>6|192,b&63|128)}else if(65536>b){if(0>(a-=3))break;
f.push(b>>12|224,b>>6&63|128,b&63|128)}else if(1114112>b){if(0>(a-=4))break;f.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw Error("Invalid code point");}return f}function be(d){for(var a=[],b=0;b<d.length;++b)a.push(d.charCodeAt(b)&255);return a}function Xd(d){d=(d.trim?d.trim():d.replace(/^\s+|\s+$/g,"")).replace(tg,"");if(2>d.length)d="";else for(;0!==d.length%4;)d+="=";Nc||Rd();var a=d.length;if(0<a%4)throw Error("Invalid string. Length must be a multiple of 4");var b="="===d[a-
2]?2:"="===d[a-1]?1:0,c=new ug(3*a/4-b),e=0<b?a-4:a,f=0;for(a=0;a<e;a+=4){var h=ia[d.charCodeAt(a)]<<18|ia[d.charCodeAt(a+1)]<<12|ia[d.charCodeAt(a+2)]<<6|ia[d.charCodeAt(a+3)];c[f++]=h>>16&255;c[f++]=h>>8&255;c[f++]=h&255}2===b?(h=ia[d.charCodeAt(a)]<<2|ia[d.charCodeAt(a+1)]>>4,c[f++]=h&255):1===b&&(h=ia[d.charCodeAt(a)]<<10|ia[d.charCodeAt(a+1)]<<4|ia[d.charCodeAt(a+2)]>>2,c[f++]=h>>8&255,c[f++]=h&255);return c}function Jb(d,a,b,c){for(var e=0;e<c&&!(e+b>=a.length||e>=d.length);++e)a[e+b]=d[e];
return e}function pa(d){return null!=d&&(!!d._isBuffer||ce(d)||"function"===typeof d.readFloatLE&&"function"===typeof d.slice&&ce(d.slice(0,0)))}function ce(d){return!!d.constructor&&"function"===typeof d.constructor.isBuffer&&d.constructor.isBuffer(d)}function de(){throw Error("setTimeout has not been defined");}function ee(){throw Error("clearTimeout has not been defined");}function fe(d){if(Na===setTimeout)return setTimeout(d,0);if((Na===de||!Na)&&setTimeout)return Na=setTimeout,setTimeout(d,0);
try{return Na(d,0)}catch(a){try{return Na.call(null,d,0)}catch(b){return Na.call(this,d,0)}}}function vg(d){if(Ca===clearTimeout)return clearTimeout(d);if((Ca===ee||!Ca)&&clearTimeout)return Ca=clearTimeout,clearTimeout(d);try{return Ca(d)}catch(a){try{return Ca.call(null,d)}catch(b){return Ca.call(this,d)}}}function wg(){rb&&sb&&(rb=!1,sb.length?ua=sb.concat(ua):qc=-1,ua.length&&ge())}function ge(){if(!rb){var d=fe(wg);rb=!0;for(var a=ua.length;a;){sb=ua;for(ua=[];++qc<a;)sb&&sb[qc].run();qc=-1;
a=ua.length}sb=null;rb=!1;vg(d)}}function ea(d){var a=Array(arguments.length-1);if(1<arguments.length)for(var b=1;b<arguments.length;b++)a[b-1]=arguments[b];ua.push(new he(d,a));1!==ua.length||rb||fe(ge)}function he(d,a){this.fun=d;this.array=a}function tb(){}function Rc(d){if(!eb(d)){for(var a=[],b=0;b<arguments.length;b++)a.push(qa(arguments[b]));return a.join(" ")}b=1;var c=arguments,e=c.length;a=String(d).replace(xg,function(a){if("%%"===a)return"%";if(b>=e)return a;switch(a){case "%s":return String(c[b++]);
case "%d":return Number(c[b++]);case "%j":try{return JSON.stringify(c[b++])}catch(g){return"[Circular]"}default:return a}});for(var f=c[b];b<e;f=c[++b])a=null!==f&&Oa(f)?a+(" "+qa(f)):a+(" "+f);return a}function Sc(d,a){if(va(fb.process))return function(){return Sc(d,a).apply(this,arguments)};if(!0===gb.noDeprecation)return d;var b=!1;return function(){if(!b){if(gb.throwDeprecation)throw Error(a);gb.traceDeprecation?console.trace(a):console.error(a);b=!0}return d.apply(this,arguments)}}function ie(d){va(Tc)&&
(Tc=gb.env.NODE_DEBUG||"");d=d.toUpperCase();Yb[d]||((new RegExp("\\b"+d+"\\b","i")).test(Tc)?Yb[d]=function(){var a=Rc.apply(null,arguments);console.error("%s %d: %s",d,0,a)}:Yb[d]=function(){});return Yb[d]}function qa(d,a){var b={seen:[],stylize:yg};3<=arguments.length&&(b.depth=arguments[2]);4<=arguments.length&&(b.colors=arguments[3]);Uc(a)?b.showHidden=a:a&&je(b,a);va(b.showHidden)&&(b.showHidden=!1);va(b.depth)&&(b.depth=2);va(b.colors)&&(b.colors=!1);va(b.customInspect)&&(b.customInspect=
!0);b.colors&&(b.stylize=zg);return rc(b,d,b.depth)}function zg(d,a){return(a=qa.styles[a])?"\u001b["+qa.colors[a][0]+"m"+d+"\u001b["+qa.colors[a][1]+"m":d}function yg(d){return d}function Ag(d){var a={};d.forEach(function(b){a[b]=!0});return a}function rc(d,a,b){if(d.customInspect&&a&&hb(a.inspect)&&a.inspect!==qa&&(!a.constructor||a.constructor.prototype!==a)){var c=a.inspect(b,d);eb(c)||(c=rc(d,c,b));return c}if(c=Bg(d,a))return c;var e=Object.keys(a),f=Ag(e);d.showHidden&&(e=Object.getOwnPropertyNames(a));
if(Kb(a)&&(0<=e.indexOf("message")||0<=e.indexOf("description")))return Vc(a);if(0===e.length){if(hb(a))return d.stylize("[Function"+(a.name?": "+a.name:"")+"]","special");if(ub(a))return d.stylize(RegExp.prototype.toString.call(a),"regexp");if(Lb(a))return d.stylize(Date.prototype.toString.call(a),"date");if(Kb(a))return Vc(a)}c="";var h=!1,g=["{","}"];ke(a)&&(h=!0,g=["[","]"]);hb(a)&&(c=" [Function"+(a.name?": "+a.name:"")+"]");ub(a)&&(c=" "+RegExp.prototype.toString.call(a));Lb(a)&&(c=" "+Date.prototype.toUTCString.call(a));
Kb(a)&&(c=" "+Vc(a));if(0===e.length&&(!h||0==a.length))return g[0]+c+g[1];if(0>b)return ub(a)?d.stylize(RegExp.prototype.toString.call(a),"regexp"):d.stylize("[Object]","special");d.seen.push(a);e=h?Cg(d,a,b,f,e):e.map(function(c){return Wc(d,a,b,f,c,h)});d.seen.pop();return Dg(e,c,g)}function Bg(d,a){if(va(a))return d.stylize("undefined","undefined");if(eb(a))return a="'"+JSON.stringify(a).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'",d.stylize(a,"string");if(le(a))return d.stylize(""+
a,"number");if(Uc(a))return d.stylize(""+a,"boolean");if(null===a)return d.stylize("null","null")}function Vc(d){return"["+Error.prototype.toString.call(d)+"]"}function Cg(d,a,b,c,e){for(var f=[],h=0,g=a.length;h<g;++h)Object.prototype.hasOwnProperty.call(a,String(h))?f.push(Wc(d,a,b,c,String(h),!0)):f.push("");e.forEach(function(e){e.match(/^\d+$/)||f.push(Wc(d,a,b,c,e,!0))});return f}function Wc(d,a,b,c,e,f){var h,g;a=Object.getOwnPropertyDescriptor(a,e)||{value:a[e]};a.get?g=a.set?d.stylize("[Getter/Setter]",
"special"):d.stylize("[Getter]","special"):a.set&&(g=d.stylize("[Setter]","special"));Object.prototype.hasOwnProperty.call(c,e)||(h="["+e+"]");g||(0>d.seen.indexOf(a.value)?(g=null===b?rc(d,a.value,null):rc(d,a.value,b-1),-1<g.indexOf("\n")&&(g=f?g.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+g.split("\n").map(function(a){return" "+a}).join("\n"))):g=d.stylize("[Circular]","special"));if(va(h)){if(f&&e.match(/^\d+$/))return g;h=JSON.stringify(""+e);h.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?
(h=h.substr(1,h.length-2),h=d.stylize(h,"name")):(h=h.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),h=d.stylize(h,"string"))}return h+": "+g}function Dg(d,a,b){return 60<d.reduce(function(a,b){b.indexOf("\n");return a+b.replace(/\u001b\[\d\d?m/g,"").length+1},0)?b[0]+(""===a?"":a+"\n ")+" "+d.join(",\n ")+" "+b[1]:b[0]+a+" "+d.join(", ")+" "+b[1]}function ke(d){return Array.isArray(d)}function Uc(d){return"boolean"===typeof d}function le(d){return"number"===typeof d}function eb(d){return"string"===
typeof d}function va(d){return void 0===d}function ub(d){return Oa(d)&&"[object RegExp]"===Object.prototype.toString.call(d)}function Oa(d){return"object"===typeof d&&null!==d}function Lb(d){return Oa(d)&&"[object Date]"===Object.prototype.toString.call(d)}function Kb(d){return Oa(d)&&("[object Error]"===Object.prototype.toString.call(d)||d instanceof Error)}function hb(d){return"function"===typeof d}function Xc(d){return null===d||"boolean"===typeof d||"number"===typeof d||"string"===typeof d||"symbol"===
typeof d||"undefined"===typeof d}function Yc(d){return 10>d?"0"+d.toString(10):d.toString(10)}function Eg(){var d=new Date,a=[Yc(d.getHours()),Yc(d.getMinutes()),Yc(d.getSeconds())].join(":");return[d.getDate(),Fg[d.getMonth()],a].join(" ")}function je(d,a){if(!a||!Oa(a))return d;for(var b=Object.keys(a),c=b.length;c--;)d[b[c]]=a[b[c]];return d}function me(d,a){if(d===a)return 0;for(var b=d.length,c=a.length,e=0,f=Math.min(b,c);e<f;++e)if(d[e]!==a[e]){b=d[e];c=a[e];break}return b<c?-1:c<b?1:0}function ne(){return"undefined"!==
typeof Zc?Zc:Zc=function(){return"foo"===function(){}.name}()}function oe(d){return pa(d)||"function"!==typeof fb.ArrayBuffer?!1:"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(d):d?d instanceof DataView||d.buffer&&d.buffer instanceof ArrayBuffer?!0:!1:!1}function L(d,a){d||aa(d,!0,a,"==",$c)}function pe(d){if(hb(d))return ne()?d.name:(d=d.toString().match(Gg))&&d[1]}function ad(d){this.name="AssertionError";this.actual=d.actual;this.expected=d.expected;this.operator=d.operator;d.message?
(this.message=d.message,this.generatedMessage=!1):(this.message=qe(re(this.actual),128)+" "+this.operator+" "+qe(re(this.expected),128),this.generatedMessage=!0);var a=d.stackStartFunction||aa;Error.captureStackTrace?Error.captureStackTrace(this,a):(d=Error(),d.stack&&(d=d.stack,a=pe(a),a=d.indexOf("\n"+a),0<=a&&(a=d.indexOf("\n",a+1),d=d.substring(a+1)),this.stack=d))}function qe(d,a){return"string"===typeof d?d.length<a?d:d.slice(0,a):d}function re(d){if(ne()||!hb(d))return qa(d);d=pe(d);return"[Function"+
(d?": "+d:"")+"]"}function aa(d,a,b,c,e){throw new ad({message:b,actual:d,expected:a,operator:c,stackStartFunction:e});}function $c(d,a){d||aa(d,!0,a,"==",$c)}function se(d,a,b){d!=a&&aa(d,a,b,"==",se)}function te(d,a,b){d==a&&aa(d,a,b,"!=",te)}function ue(d,a,b){vb(d,a,!1)||aa(d,a,b,"deepEqual",ue)}function ve(d,a,b){vb(d,a,!0)||aa(d,a,b,"deepStrictEqual",ve)}function vb(d,a,b,c){if(d===a)return!0;if(pa(d)&&pa(a))return 0===me(d,a);if(Lb(d)&&Lb(a))return d.getTime()===a.getTime();if(ub(d)&&ub(a))return d.source===
a.source&&d.global===a.global&&d.multiline===a.multiline&&d.lastIndex===a.lastIndex&&d.ignoreCase===a.ignoreCase;if(null!==d&&"object"===typeof d||null!==a&&"object"===typeof a){if(!oe(d)||!oe(a)||Object.prototype.toString.call(d)!==Object.prototype.toString.call(a)||d instanceof Float32Array||d instanceof Float64Array){if(pa(d)!==pa(a))return!1;c=c||{actual:[],expected:[]};var e=c.actual.indexOf(d);if(-1!==e&&e===c.expected.indexOf(a))return!0;c.actual.push(d);c.expected.push(a);return Hg(d,a,b,
c)}return 0===me(new Uint8Array(d.buffer),new Uint8Array(a.buffer))}return b?d===a:d==a}function Hg(d,a,b,c){if(null===d||void 0===d||null===a||void 0===a)return!1;if(Xc(d)||Xc(a))return d===a;if(b&&Object.getPrototypeOf(d)!==Object.getPrototypeOf(a))return!1;var e="[object Arguments]"==Object.prototype.toString.call(d),f="[object Arguments]"==Object.prototype.toString.call(a);if(e&&!f||!e&&f)return!1;if(e)return d=we.call(d),a=we.call(a),vb(d,a,b);e=xe(d);var h=xe(a);if(e.length!==h.length)return!1;
e.sort();h.sort();for(f=e.length-1;0<=f;f--)if(e[f]!==h[f])return!1;for(f=e.length-1;0<=f;f--)if(h=e[f],!vb(d[h],a[h],b,c))return!1;return!0}function ye(d,a,b){vb(d,a,!1)&&aa(d,a,b,"notDeepEqual",ye)}function ze(d,a,b){vb(d,a,!0)&&aa(d,a,b,"notDeepStrictEqual",ze)}function Ae(d,a,b){d!==a&&aa(d,a,b,"===",Ae)}function Be(d,a,b){d===a&&aa(d,a,b,"!==",Be)}function Ce(d,a){if(!d||!a)return!1;if("[object RegExp]"==Object.prototype.toString.call(a))return a.test(d);try{if(d instanceof a)return!0}catch(b){}return Error.isPrototypeOf(a)?
!1:!0===a.call({},d)}function De(d,a,b,c){if("function"!==typeof a)throw new TypeError('"block" argument must be a function');"string"===typeof b&&(c=b,b=null);try{a()}catch(g){var e=g}a=e;c=(b&&b.name?" ("+b.name+").":".")+(c?" "+c:".");d&&!a&&aa(a,b,"Missing expected exception"+c);e="string"===typeof c;var f=!d&&Kb(a),h=!d&&a&&!b;(f&&e&&Ce(a,b)||h)&&aa(a,b,"Got unwanted exception"+c);if(d&&a&&b&&!Ce(a,b)||!d&&a)throw a;}function Ig(d,a){for(var b=0,c=d.length-1;0<=c;c--){var e=d[c];"."===e?d.splice(c,
1):".."===e?(d.splice(c,1),b++):b&&(d.splice(c,1),b--)}if(a)for(;b--;b)d.unshift("..");return d}function bd(){for(var d="",a=!1,b=arguments.length-1;-1<=b&&!a;b--){var c=0<=b?arguments[b]:"/";if("string"!==typeof c)throw new TypeError("Arguments to path.resolve must be strings");c&&(d=c+"/"+d,a="/"===c.charAt(0))}d=Ig(Jg(d.split("/"),function(a){return!!a}),!a).join("/");return(a?"/":"")+d||"."}function Zb(d,a){function b(a){for(var b=0;b<a.length&&""===a[b];b++);for(var c=a.length-1;0<=c&&""===a[c];c--);
return b>c?[]:a.slice(b,c-b+1)}d=bd(d).substr(1);a=bd(a).substr(1);d=b(d.split("/"));a=b(a.split("/"));for(var c=Math.min(d.length,a.length),e=c,f=0;f<c;f++)if(d[f]!==a[f]){e=f;break}c=[];for(f=e;f<d.length;f++)c.push("..");c=c.concat(a.slice(e));return c.join("/")}function Jg(d,a){if(d.filter)return d.filter(a);for(var b=[],c=0;c<d.length;c++)a(d[c],c,d)&&b.push(d[c]);return b}function ib(){}function J(){J.init.call(this)}function Ee(d,a,b,c){var e;if("function"!==typeof b)throw new TypeError('"listener" argument must be a function');
if(e=d._events){e.newListener&&(d.emit("newListener",a,b.listener?b.listener:b),e=d._events);var f=e[a]}else e=d._events=new ib,d._eventsCount=0;f?("function"===typeof f?f=e[a]=c?[b,f]:[f,b]:c?f.unshift(b):f.push(b),f.warned||(b=void 0===d._maxListeners?J.defaultMaxListeners:d._maxListeners)&&0<b&&f.length>b&&(f.warned=!0,b=Error("Possible EventEmitter memory leak detected. "+f.length+" "+a+" listeners added. Use emitter.setMaxListeners() to increase limit"),b.name="MaxListenersExceededWarning",b.emitter=
d,b.type=a,b.count=f.length,"function"===typeof console.warn?console.warn(b):console.log(b))):(e[a]=b,++d._eventsCount);return d}function Fe(d,a,b){function c(){d.removeListener(a,c);e||(e=!0,b.apply(d,arguments))}var e=!1;c.listener=b;return c}function Ge(d){var a=this._events;if(a){d=a[d];if("function"===typeof d)return 1;if(d)return d.length}return 0}function Mb(d,a){for(var b=Array(a);a--;)b[a]=d[a];return b}function Pa(){this.tail=this.head=null;this.length=0}function $b(d){this.encoding=(d||
"utf8").toLowerCase().replace(/[-_]/,"");if(d&&!Kg(d))throw Error("Unknown encoding: "+d);switch(this.encoding){case "utf8":this.surrogateSize=3;break;case "ucs2":case "utf16le":this.surrogateSize=2;this.detectIncompleteChar=Lg;break;case "base64":this.surrogateSize=3;this.detectIncompleteChar=Mg;break;default:this.write=Ng;return}this.charBuffer=new u(6);this.charLength=this.charReceived=0}function Ng(d){return d.toString(this.encoding)}function Lg(d){this.charLength=(this.charReceived=d.length%
2)?2:0}function Mg(d){this.charLength=(this.charReceived=d.length%3)?3:0}function Og(d,a,b){if("function"===typeof d.prependListener)return d.prependListener(a,b);if(d._events&&d._events[a])Array.isArray(d._events[a])?d._events[a].unshift(b):d._events[a]=[b,d._events[a]];else d.on(a,b)}function He(d,a){d=d||{};this.objectMode=!!d.objectMode;a instanceof ka&&(this.objectMode=this.objectMode||!!d.readableObjectMode);a=d.highWaterMark;var b=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:b;this.highWaterMark=
~~this.highWaterMark;this.buffer=new Pa;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.reading=this.endEmitted=this.ended=!1;this.sync=!0;this.resumeScheduled=this.readableListening=this.emittedReadable=this.needReadable=!1;this.defaultEncoding=d.defaultEncoding||"utf8";this.ranOut=!1;this.awaitDrain=0;this.readingMore=!1;this.encoding=this.decoder=null;d.encoding&&(this.decoder=new $b(d.encoding),this.encoding=d.encoding)}function R(d){if(!(this instanceof R))return new R(d);
this._readableState=new He(d,this);this.readable=!0;d&&"function"===typeof d.read&&(this._read=d.read);J.call(this)}function Ie(d,a,b,c,e){var f=b,h=null;pa(f)||"string"===typeof f||null===f||void 0===f||a.objectMode||(h=new TypeError("Invalid non-string/buffer chunk"));if(f=h)d.emit("error",f);else if(null===b)a.reading=!1,a.ended||(a.decoder&&(b=a.decoder.end())&&b.length&&(a.buffer.push(b),a.length+=a.objectMode?1:b.length),a.ended=!0,sc(d));else if(a.objectMode||b&&0<b.length)if(a.ended&&!e)d.emit("error",
Error("stream.push() after EOF"));else if(a.endEmitted&&e)d.emit("error",Error("stream.unshift() after end event"));else{if(a.decoder&&!e&&!c){b=a.decoder.write(b);var g=!a.objectMode&&0===b.length}e||(a.reading=!1);g||(a.flowing&&0===a.length&&!a.sync?(d.emit("data",b),d.read(0)):(a.length+=a.objectMode?1:b.length,e?a.buffer.unshift(b):a.buffer.push(b),a.needReadable&&sc(d)));a.readingMore||(a.readingMore=!0,ea(Pg,d,a))}else e||(a.reading=!1);return!a.ended&&(a.needReadable||a.length<a.highWaterMark||
0===a.length)}function Je(d,a){if(0>=d||0===a.length&&a.ended)return 0;if(a.objectMode)return 1;if(d!==d)return a.flowing&&a.length?a.buffer.head.data.length:a.length;if(d>a.highWaterMark){var b=d;8388608<=b?b=8388608:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++);a.highWaterMark=b}return d<=a.length?d:a.ended?a.length:(a.needReadable=!0,0)}function sc(d){var a=d._readableState;a.needReadable=!1;a.emittedReadable||(G("emitReadable",a.flowing),a.emittedReadable=!0,a.sync?ea(Ke,d):Ke(d))}function Ke(d){G("emit readable");
d.emit("readable");cd(d)}function Pg(d,a){for(var b=a.length;!a.reading&&!a.flowing&&!a.ended&&a.length<a.highWaterMark&&(G("maybeReadMore read 0"),d.read(0),b!==a.length);)b=a.length;a.readingMore=!1}function Qg(d){return function(){var a=d._readableState;G("pipeOnDrain",a.awaitDrain);a.awaitDrain&&a.awaitDrain--;0===a.awaitDrain&&d.listeners("data").length&&(a.flowing=!0,cd(d))}}function Rg(d){G("readable nexttick read 0");d.read(0)}function Sg(d,a){a.reading||(G("resume read 0"),d.read(0));a.resumeScheduled=
!1;a.awaitDrain=0;d.emit("resume");cd(d);a.flowing&&!a.reading&&d.read(0)}function cd(d){var a=d._readableState;for(G("flow",a.flowing);a.flowing&&null!==d.read(););}function Le(d,a){if(0===a.length)return null;if(a.objectMode)var b=a.buffer.shift();else if(!d||d>=a.length)b=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.head.data:a.buffer.concat(a.length),a.buffer.clear();else{b=a.buffer;a=a.decoder;if(d<b.head.data.length)a=b.head.data.slice(0,d),b.head.data=b.head.data.slice(d);else{if(d===
b.head.data.length)b=b.shift();else if(a){a=b.head;var c=1,e=a.data;for(d-=e.length;a=a.next;){var f=a.data,h=d>f.length?f.length:d;e=h===f.length?e+f:e+f.slice(0,d);d-=h;if(0===d){h===f.length?(++c,b.head=a.next?a.next:b.tail=null):(b.head=a,a.data=f.slice(h));break}++c}b.length-=c;b=e}else{a=u.allocUnsafe(d);c=b.head;e=1;c.data.copy(a);for(d-=c.data.length;c=c.next;){f=c.data;h=d>f.length?f.length:d;f.copy(a,a.length-d,0,h);d-=h;if(0===d){h===f.length?(++e,b.head=c.next?c.next:b.tail=null):(b.head=
c,c.data=f.slice(h));break}++e}b.length-=e;b=a}a=b}b=a}return b}function dd(d){var a=d._readableState;if(0<a.length)throw Error('"endReadable()" called on non-empty stream');a.endEmitted||(a.ended=!0,ea(Tg,a,d))}function Tg(d,a){d.endEmitted||0!==d.length||(d.endEmitted=!0,a.readable=!1,a.emit("end"))}function Ug(d,a){for(var b=0,c=d.length;b<c;b++)a(d[b],b)}function Me(d,a){for(var b=0,c=d.length;b<c;b++)if(d[b]===a)return b;return-1}function Vg(){}function Wg(d,a,b){this.chunk=d;this.encoding=a;
this.callback=b;this.next=null}function ed(d,a){Object.defineProperty(this,"buffer",{get:Sc(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")});d=d||{};this.objectMode=!!d.objectMode;a instanceof ka&&(this.objectMode=this.objectMode||!!d.writableObjectMode);var b=d.highWaterMark,c=this.objectMode?16:16384;this.highWaterMark=b||0===b?b:c;this.highWaterMark=~~this.highWaterMark;this.finished=this.ended=this.ending=this.needDrain=!1;this.decodeStrings=
!1!==d.decodeStrings;this.defaultEncoding=d.defaultEncoding||"utf8";this.length=0;this.writing=!1;this.corked=0;this.sync=!0;this.bufferProcessing=!1;this.onwrite=function(b){var c=a._writableState,d=c.sync,e=c.writecb;c.writing=!1;c.writecb=null;c.length-=c.writelen;c.writelen=0;b?(--c.pendingcb,d?ea(e,b):e(b),a._writableState.errorEmitted=!0,a.emit("error",b)):((b=Ne(c))||c.corked||c.bufferProcessing||!c.bufferedRequest||Oe(a,c),d?ea(Pe,a,c,b,e):Pe(a,c,b,e))};this.writecb=null;this.writelen=0;this.lastBufferedRequest=
this.bufferedRequest=null;this.pendingcb=0;this.errorEmitted=this.prefinished=!1;this.bufferedRequestCount=0;this.corkedRequestsFree=new Qe(this)}function N(d){if(!(this instanceof N||this instanceof ka))return new N(d);this._writableState=new ed(d,this);this.writable=!0;d&&("function"===typeof d.write&&(this._write=d.write),"function"===typeof d.writev&&(this._writev=d.writev));J.call(this)}function fd(d,a,b,c,e,f,h){a.writelen=c;a.writecb=h;a.writing=!0;a.sync=!0;b?d._writev(e,a.onwrite):d._write(e,
f,a.onwrite);a.sync=!1}function Pe(d,a,b,c){!b&&0===a.length&&a.needDrain&&(a.needDrain=!1,d.emit("drain"));a.pendingcb--;c();Re(d,a)}function Oe(d,a){a.bufferProcessing=!0;var b=a.bufferedRequest;if(d._writev&&b&&b.next){var c=Array(a.bufferedRequestCount),e=a.corkedRequestsFree;e.entry=b;for(var f=0;b;)c[f]=b,b=b.next,f+=1;fd(d,a,!0,a.length,c,"",e.finish);a.pendingcb++;a.lastBufferedRequest=null;e.next?(a.corkedRequestsFree=e.next,e.next=null):a.corkedRequestsFree=new Qe(a)}else{for(;b&&(c=b.chunk,
fd(d,a,!1,a.objectMode?1:c.length,c,b.encoding,b.callback),b=b.next,!a.writing););null===b&&(a.lastBufferedRequest=null)}a.bufferedRequestCount=0;a.bufferedRequest=b;a.bufferProcessing=!1}function Ne(d){return d.ending&&0===d.length&&null===d.bufferedRequest&&!d.finished&&!d.writing}function Re(d,a){var b=Ne(a);b&&(0===a.pendingcb?(a.prefinished||(a.prefinished=!0,d.emit("prefinish")),a.finished=!0,d.emit("finish")):a.prefinished||(a.prefinished=!0,d.emit("prefinish")));return b}function Qe(d){var a=
this;this.entry=this.next=null;this.finish=function(b){var c=a.entry;for(a.entry=null;c;){var e=c.callback;d.pendingcb--;e(b);c=c.next}d.corkedRequestsFree?d.corkedRequestsFree.next=a:d.corkedRequestsFree=a}}function ka(d){if(!(this instanceof ka))return new ka(d);R.call(this,d);N.call(this,d);d&&!1===d.readable&&(this.readable=!1);d&&!1===d.writable&&(this.writable=!1);this.allowHalfOpen=!0;d&&!1===d.allowHalfOpen&&(this.allowHalfOpen=!1);this.once("end",Xg)}function Xg(){this.allowHalfOpen||this._writableState.ended||
ea(Yg,this)}function Yg(d){d.end()}function Zg(d){this.afterTransform=function(a,b){var c=d._transformState;c.transforming=!1;var e=c.writecb;e?(c.writechunk=null,c.writecb=null,null!==b&&void 0!==b&&d.push(b),e(a),a=d._readableState,a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&d._read(a.highWaterMark),a=void 0):a=d.emit("error",Error("no writecb in Transform class"));return a};this.transforming=this.needTransform=!1;this.writeencoding=this.writechunk=this.writecb=null}function la(d){if(!(this instanceof
la))return new la(d);ka.call(this,d);this._transformState=new Zg(this);var a=this;this._readableState.needReadable=!0;this._readableState.sync=!1;d&&("function"===typeof d.transform&&(this._transform=d.transform),"function"===typeof d.flush&&(this._flush=d.flush));this.once("prefinish",function(){"function"===typeof this._flush?this._flush(function(b){Se(a,b)}):Se(a)})}function Se(d,a){if(a)return d.emit("error",a);a=d._transformState;if(d._writableState.length)throw Error("Calling transform done when ws.length != 0");
if(a.transforming)throw Error("Calling transform done when still transforming");return d.push(null)}function ac(d){if(!(this instanceof ac))return new ac(d);la.call(this,d)}function wa(){J.call(this)}function $g(d,a){var b=d.split("@"),c="";1<b.length&&(c=b[0]+"@",d=b[1]);d=d.replace(ah,".");d=d.split(".");b=d.length;for(var e=[];b--;)e[b]=a(d[b]);a=e.join(".");return c+a}function Te(d,a){return d+22+75*(26>d)-((0!=a)<<5)}function bh(d){return $g(d,function(a){if(ch.test(a)){var b,c=[],d=[],f=0;for(b=
a.length;f<b;){var h=a.charCodeAt(f++);if(55296<=h&&56319>=h&&f<b){var g=a.charCodeAt(f++);56320==(g&64512)?d.push(((h&1023)<<10)+(g&1023)+65536):(d.push(h),f--)}else d.push(h)}a=d;g=a.length;d=128;var k=0,q=72;for(h=0;h<g;++h){var t=a[h];128>t&&c.push(gd(t))}for((f=b=c.length)&&c.push("-");f<g;){var p=2147483647;for(h=0;h<g;++h)t=a[h],t>=d&&t<p&&(p=t);var v=f+1;if(p-d>Qa((2147483647-k)/v))throw new RangeError(Ue.overflow);k+=(p-d)*v;d=p;for(h=0;h<g;++h){t=a[h];if(t<d&&2147483647<++k)throw new RangeError(Ue.overflow);
if(t==d){var n=k;for(p=36;;p+=36){t=p<=q?1:p>=q+26?26:p-q;if(n<t)break;var r=n-t;n=36-t;c.push(gd(Te(t+r%n,0)));n=Qa(r/n)}c.push(gd(Te(n,0)));q=v;p=0;k=f==b?Qa(k/700):k>>1;for(k+=Qa(k/q);455<k;p+=36)k=Qa(k/35);q=Qa(p+36*k/(k+38));k=0;++f}}++k;++d}c="xn--"+c.join("")}else c=a;return c})}function bc(d){switch(typeof d){case "string":return d;case "boolean":return d?"true":"false";case "number":return isFinite(d)?d:"";default:return""}}function dh(d,a,b,c){a=a||"&";b=b||"=";null===d&&(d=void 0);return"object"===
typeof d?Ve(eh(d),function(c){var f=encodeURIComponent(bc(c))+b;return We(d[c])?Ve(d[c],function(a){return f+encodeURIComponent(bc(a))}).join(a):f+encodeURIComponent(bc(d[c]))}).join(a):c?encodeURIComponent(bc(c))+b+encodeURIComponent(bc(d)):""}function Ve(d,a){if(d.map)return d.map(a);for(var b=[],c=0;c<d.length;c++)b.push(a(d[c],c));return b}function Xe(d,a,b,c){b=b||"=";var e={};if("string"!==typeof d||0===d.length)return e;var f=/\+/g;d=d.split(a||"&");a=1E3;c&&"number"===typeof c.maxKeys&&(a=
c.maxKeys);c=d.length;0<a&&c>a&&(c=a);for(a=0;a<c;++a){var h=d[a].replace(f,"%20"),g=h.indexOf(b);if(0<=g){var k=h.substr(0,g);h=h.substr(g+1)}else k=h,h="";k=decodeURIComponent(k);h=decodeURIComponent(h);Object.prototype.hasOwnProperty.call(e,k)?We(e[k])?e[k].push(h):e[k]=[e[k],h]:e[k]=h}return e}function xa(){this.href=this.path=this.pathname=this.query=this.search=this.hash=this.hostname=this.port=this.host=this.auth=this.slashes=this.protocol=null}function cc(d,a,b){if(d&&Oa(d)&&d instanceof xa)return d;
var c=new xa;c.parse(d,a,b);return c}function Ye(d,a,b,c){if(!eb(a))throw new TypeError("Parameter 'url' must be a string, not "+typeof a);var e=a.indexOf("?");e=-1!==e&&e<a.indexOf("#")?"?":"#";a=a.split(e);a[0]=a[0].replace(/\\/g,"/");a=a.join(e);e=a.trim();if(!c&&1===a.split("#").length&&(a=fh.exec(e)))return d.path=e,d.href=e,d.pathname=a[1],a[2]?(d.search=a[2],d.query=b?Xe(d.search.substr(1)):d.search.substr(1)):b&&(d.search="",d.query={}),d;if(a=gh.exec(e)){a=a[0];var f=a.toLowerCase();d.protocol=
f;e=e.substr(a.length)}if(c||a||e.match(/^\/\/[^@\/]+@[^@\/]+/)){var h="//"===e.substr(0,2);!h||a&&hd[a]||(e=e.substr(2),d.slashes=!0)}if(!hd[a]&&(h||a&&!Ra[a])){a=-1;for(c=0;c<Ze.length;c++)h=e.indexOf(Ze[c]),-1!==h&&(-1===a||h<a)&&(a=h);h=-1===a?e.lastIndexOf("@"):e.lastIndexOf("@",a);-1!==h&&(c=e.slice(0,h),e=e.slice(h+1),d.auth=decodeURIComponent(c));a=-1;for(c=0;c<$e.length;c++)h=e.indexOf($e[c]),-1!==h&&(-1===a||h<a)&&(a=h);-1===a&&(a=e.length);d.host=e.slice(0,a);e=e.slice(a);af(d);d.hostname=
d.hostname||"";h="["===d.hostname[0]&&"]"===d.hostname[d.hostname.length-1];if(!h){var g=d.hostname.split(/\./);c=0;for(a=g.length;c<a;c++){var k=g[c];if(k&&!k.match(bf)){for(var q="",t=0,p=k.length;t<p;t++)q=127<k.charCodeAt(t)?q+"x":q+k[t];if(!q.match(bf)){a=g.slice(0,c);c=g.slice(c+1);if(k=k.match(hh))a.push(k[1]),c.unshift(k[2]);c.length&&(e="/"+c.join(".")+e);d.hostname=a.join(".");break}}}}d.hostname=d.hostname.length>ih?"":d.hostname.toLowerCase();h||(d.hostname=bh(d.hostname));c=d.port?":"+
d.port:"";d.host=(d.hostname||"")+c;d.href+=d.host;h&&(d.hostname=d.hostname.substr(1,d.hostname.length-2),"/"!==e[0]&&(e="/"+e))}if(!jh[f])for(c=0,a=id.length;c<a;c++)h=id[c],-1!==e.indexOf(h)&&(k=encodeURIComponent(h),k===h&&(k=escape(h)),e=e.split(h).join(k));c=e.indexOf("#");-1!==c&&(d.hash=e.substr(c),e=e.slice(0,c));c=e.indexOf("?");-1!==c?(d.search=e.substr(c),d.query=e.substr(c+1),b&&(d.query=Xe(d.query)),e=e.slice(0,c)):b&&(d.search="",d.query={});e&&(d.pathname=e);Ra[f]&&d.hostname&&!d.pathname&&
(d.pathname="/");if(d.pathname||d.search)c=d.pathname||"",d.path=c+(d.search||"");d.href=jd(d);return d}function jd(d){var a=d.auth||"";a&&(a=encodeURIComponent(a),a=a.replace(/%3A/i,":"),a+="@");var b=d.protocol||"",c=d.pathname||"",e=d.hash||"",f=!1,h="";d.host?f=a+d.host:d.hostname&&(f=a+(-1===d.hostname.indexOf(":")?d.hostname:"["+this.hostname+"]"),d.port&&(f+=":"+d.port));d.query&&Oa(d.query)&&Object.keys(d.query).length&&(h=dh(d.query));a=d.search||h&&"?"+h||"";b&&":"!==b.substr(-1)&&(b+=":");
d.slashes||(!b||Ra[b])&&!1!==f?(f="//"+(f||""),c&&"/"!==c.charAt(0)&&(c="/"+c)):f||(f="");e&&"#"!==e.charAt(0)&&(e="#"+e);a&&"?"!==a.charAt(0)&&(a="?"+a);c=c.replace(/[?#]/g,function(a){return encodeURIComponent(a)});a=a.replace("#","%23");return b+f+c+a+e}function af(d){var a=d.host,b=kh.exec(a);b&&(b=b[0],":"!==b&&(d.port=b.substr(1)),a=a.substr(0,a.length-b.length));a&&(d.hostname=a)}function cf(d,a){function b(){this.constructor=d}kd(d,a);d.prototype=null===a?Object.create(a):(b.prototype=a.prototype,
new b)}function Y(d,a,b,c){return new (b||(b=Promise))(function(e,f){function h(a){try{k(c.next(a))}catch(t){f(t)}}function g(a){try{k(c["throw"](a))}catch(t){f(t)}}function k(a){a.done?e(a.value):(new b(function(b){b(a.value)})).then(h,g)}k((c=c.apply(d,a||[])).next())})}function Z(d,a){function b(a){return function(b){return c([a,b])}}function c(b){if(f)throw new TypeError("Generator is already executing.");for(;e;)try{if(f=1,h&&(g=b[0]&2?h["return"]:b[0]?h["throw"]||((g=h["return"])&&g.call(h),
0):h.next)&&!(g=g.call(h,b[1])).done)return g;if(h=0,g)b=[b[0]&2,g.value];switch(b[0]){case 0:case 1:g=b;break;case 4:return e.label++,{value:b[1],done:!1};case 5:e.label++;h=b[1];b=[0];continue;case 7:b=e.ops.pop();e.trys.pop();continue;default:if(!(g=e.trys,g=0<g.length&&g[g.length-1])&&(6===b[0]||2===b[0])){e=0;continue}if(3===b[0]&&(!g||b[1]>g[0]&&b[1]<g[3]))e.label=b[1];else if(6===b[0]&&e.label<g[1])e.label=g[1],g=b;else if(g&&e.label<g[2])e.label=g[2],e.ops.push(b);else{g[2]&&e.ops.pop();e.trys.pop();
continue}}b=a.call(d,e)}catch(t){b=[6,t],h=0}finally{f=g=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}var e={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},f,h,g,k;return k={next:b(0),"throw":b(1),"return":b(2)},"function"===typeof Symbol&&(k[Symbol.iterator]=function(){return this}),k}function ld(d,a){var b="function"===typeof Symbol&&d[Symbol.iterator];if(!b)return d;d=b.call(d);var c,e=[];try{for(;(void 0===a||0<a--)&&!(c=d.next()).done;)e.push(c.value)}catch(h){var f=
{error:h}}finally{try{c&&!c.done&&(b=d["return"])&&b.call(d)}finally{if(f)throw f.error;}}return e}function lh(){for(var d=[],a=0;a<arguments.length;a++)d=d.concat(ld(arguments[a]));return d}function Sa(d,a,b){for(var c=0,e=0,f=0;f<a;++f)"\n"===d.charAt(f)?(e=0,c+=1):(e+=1,e>b&&(e=0,c+=1));return{row:c,col:e}}function mh(d,a,b){var c=d.match(/((?:\|\||\&\&|;;|\|\&|\<\(|>>|>\&|[&;()|<>]))|((\\['"|&;()<> \t]|[^\s'"|&;()<> \t])+|"((\\"|[^"])*?)"|'((\\'|[^'])*?)')*/g).filter(Boolean),e=!1;if(!c)return[];
a||(a={});b||(b={});return c.map(function(d,h){function f(){n+=1;if("{"===d.charAt(n)){n+=1;if("}"===d.charAt(n))throw Error("Bad substitution: "+d.substr(n-2,3));var b=d.indexOf("}",n);if(0>b)throw Error("Bad substitution: "+d.substr(n));var c=d.substr(n,b-n);n=b}else/[*@#?$!_\-]/.test(d.charAt(n))?(c=d.charAt(n),n+=1):(b=d.substr(n).match(/[^\w\d_]/))?(c=d.substr(n,b.index),n+=b.index-1):(c=d.substr(n),n=d.length);b=c;c="function"===typeof a?a(b):a[b];void 0===c&&""!=b?c="":void 0===c&&(c="$");
b="object"===typeof c?""+Ga+JSON.stringify(c)+Ga:""+c;return b}if(!e){if(/^(?:\|\||\&\&|;;|\|\&|\<\(|>>|>\&|[&;()|<>])$/.test(d))return{op:d};for(var k=b.escape||"\\",q=!1,t=!1,p="",v=!1,n=0,r=d.length;n<r;n++){var x=d.charAt(n);v=v||!q&&("*"===x||"?"===x);if(t)p+=x,t=!1;else if(q)x===q?q=!1:"'"==q?p+=x:x===k?(n+=1,x=d.charAt(n),p='"'===x||x===k||"$"===x?p+x:p+(k+x)):p="$"===x?p+f():p+x;else if('"'===x||"'"===x)q=x;else{if(/^(?:\|\||\&\&|;;|\|\&|\<\(|>>|>\&|[&;()|<>])$/.test(x))return{op:d};if(/^#$/.test(x))return e=
!0,p.length?[p,{comment:d.slice(n+1)+c.slice(h+1).join(" ")}]:[{comment:d.slice(n+1)+c.slice(h+1).join(" ")}];x===k?t=!0:p="$"===x?p+f():p+x}}return v?{op:"glob",pattern:p}:p}}).reduce(function(a,b){return void 0===b?a:a.concat(b)},[])}function df(d,a){void 0===a&&(a=!0);var b,c=[],e=/\w+/g;for(b=e.exec(d);b;)a?c.push(b.index):c.push(b.index+b[0].length),b=e.exec(d);return c}function ef(d,a){d=df(d,!0).reverse().find(function(b){return b<a});return void 0===d?0:d}function nh(d,a){var b=df(d,!1).find(function(b){return b>
a});return void 0===b?d.length:b}function oh(d){return""===d.trim()?!1:0!==(d.match(/'/g)||[]).length%2||0!==(d.match(/"/g)||[]).length%2||""===d.split(/(\|\||\||&&)/g).pop().trim()||d.endsWith("\\")&&!d.endsWith("\\\\")?!0:!1}function md(d){return null!==d.match(/[^\\][ \t]$/m)}function ph(d){return""===d.trim()||md(d)?"":ff(d).pop()||""}function qh(d,a){var b=ff(a),c=b.length-1,e=b[c]||"";""===a.trim()?(c=0,e=""):md(a)&&(c+=1,e="");return d.reduce(function(a,d){try{var f=d(c,b);return a.concat(f)}catch(k){return console.error("Auto-complete error:",
k),a}},[]).filter(function(a){return a.startsWith(e)})}function gf(d,a=self){a.addEventListener("message",function e(c){if(c&&c.data){var {id:f,type:h,path:g}=Object.assign({path:[]},c.data),k=(c.data.argumentList||[]).map(Ha);try{let a=g.slice(0,-1).reduce((a,c)=>a[c],d),f=g.reduce((a,c)=>a[c],d);switch(h){case 0:var q=f;break;case 1:a[g.slice(-1)[0]]=Ha(c.data.value);q=!0;break;case 2:q=f.apply(a,k);break;case 3:{let a=new f(...k);q=Nb(a)}break;case 4:{let {port1:a,port2:c}=new MessageChannel;gf(d,
c);q=rh(a,[a])}break;case 5:q=void 0}}catch(t){q=t,nd.add(t)}Promise.resolve(q).catch(a=>{nd.add(a);return a}).then(c=>{let [d,g]=od(c);a.postMessage(Object.assign(Object.assign({},d),{id:f}),g);5===h&&(a.removeEventListener("message",e),"MessagePort"===a.constructor.name&&a.close())})}});a.start&&a.start()}function tc(d){if(d)throw Error("Proxy has been released and is not useable");}function dc(d,a=[],b=function(){}){let c=!1,e=new Proxy(b,{get(b,h){tc(c);if(h===sh)return()=>Ta(d,{type:5,path:a.map(a=>
a.toString())}).then(()=>{"MessagePort"===d.constructor.name&&d.close();c=!0});if("then"===h){if(0===a.length)return{then:()=>e};b=Ta(d,{type:0,path:a.map(a=>a.toString())}).then(Ha);return b.then.bind(b)}return dc(d,[...a,h])},set(b,e,g){tc(c);const [f,h]=od(g);return Ta(d,{type:1,path:[...a,e].map(a=>a.toString()),value:f},h).then(Ha)},apply(b,e,g){tc(c);b=a[a.length-1];if(b===th)return Ta(d,{type:4}).then(Ha);if("bind"===b)return dc(d,a.slice(0,-1));const [f,h]=hf(g);return Ta(d,{type:2,path:a.map(a=>
a.toString()),argumentList:f},h).then(Ha)},construct(b,e){tc(c);const [f,h]=hf(e);return Ta(d,{type:3,path:a.map(a=>a.toString()),argumentList:f},h).then(Ha)}});return e}function hf(d){d=d.map(od);return[d.map(a=>a[0]),Array.prototype.concat.apply([],d.map(a=>a[1]))]}function rh(d,a){jf.set(d,a);return d}function Nb(d){return Object.assign(d,{[kf]:!0})}function od(d){for(let [a,b]of lf)if(b.canHandle(d)){let [c,e]=b.serialize(d);return[{type:3,name:a,value:c},e]}return[{type:0,value:d},jf.get(d)||
[]]}function Ha(d){switch(d.type){case 3:return lf.get(d.name).deserialize(d.value);case 0:return d.value}}function Ta(d,a,b){return new Promise(c=>{let e=uh();d.addEventListener("message",function g(a){a.data&&a.data.id&&a.data.id===e&&(d.removeEventListener("message",g),c(a.data))});d.start&&d.start();d.postMessage(Object.assign({id:e},a),b)})}function uh(){return Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function pd(d,a){pd=Object.setPrototypeOf||
{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};return pd(d,a)}function qd(d,a){function b(){this.constructor=d}pd(d,a);d.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function ec(d){var a="function"===typeof Symbol&&d[Symbol.iterator],b=0;return a?a.call(d):{next:function(){d&&b>=d.length&&(d=void 0);return{value:d&&d[b++],done:!d}}}}function uc(d,a){var b="function"===typeof Symbol&&d[Symbol.iterator];
if(!b)return d;d=b.call(d);var c,e=[];try{for(;(void 0===a||0<a--)&&!(c=d.next()).done;)e.push(c.value)}catch(h){var f={error:h}}finally{try{c&&!c.done&&(b=d["return"])&&b.call(d)}finally{if(f)throw f.error;}}return e}function vc(){for(var d=[],a=0;a<arguments.length;a++)d=d.concat(uc(arguments[a]));return d}function mf(){rd=!0;for(var d=0;64>d;++d)fa[d]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[d],ma["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(d)]=
d;ma[45]=62;ma[95]=63}function vh(d,a,b){for(var c=[],e=a;e<b;e+=3)a=(d[e]<<16)+(d[e+1]<<8)+d[e+2],c.push(fa[a>>18&63]+fa[a>>12&63]+fa[a>>6&63]+fa[a&63]);return c.join("")}function nf(d){rd||mf();for(var a=d.length,b=a%3,c="",e=[],f=0,h=a-b;f<h;f+=16383)e.push(vh(d,f,f+16383>h?h:f+16383));1===b?(d=d[a-1],c+=fa[d>>2],c+=fa[d<<4&63],c+="=="):2===b&&(d=(d[a-2]<<8)+d[a-1],c+=fa[d>>10],c+=fa[d>>4&63],c+=fa[d<<2&63],c+="=");e.push(c);return e.join("")}function wc(d,a,b,c,e){var f=8*e-c-1,h=(1<<f)-1,g=h>>
1,k=-7;e=b?e-1:0;var q=b?-1:1,t=d[a+e];e+=q;b=t&(1<<-k)-1;t>>=-k;for(k+=f;0<k;b=256*b+d[a+e],e+=q,k-=8);f=b&(1<<-k)-1;b>>=-k;for(k+=c;0<k;f=256*f+d[a+e],e+=q,k-=8);if(0===b)b=1-g;else{if(b===h)return f?NaN:Infinity*(t?-1:1);f+=Math.pow(2,c);b-=g}return(t?-1:1)*f*Math.pow(2,b-c)}function xc(d,a,b,c,e,f){var h,g=8*f-e-1,k=(1<<g)-1,q=k>>1,t=23===e?Math.pow(2,-24)-Math.pow(2,-77):0;f=c?0:f-1;var p=c?1:-1,v=0>a||0===a&&0>1/a?1:0;a=Math.abs(a);for(isNaN(a)||Infinity===a?(a=isNaN(a)?1:0,c=k):(c=Math.floor(Math.log(a)/
Math.LN2),1>a*(h=Math.pow(2,-c))&&(c--,h*=2),a=1<=c+q?a+t/h:a+t*Math.pow(2,1-q),2<=a*h&&(c++,h/=2),c+q>=k?(a=0,c=k):1<=c+q?(a=(a*h-1)*Math.pow(2,e),c+=q):(a=a*Math.pow(2,q-1)*Math.pow(2,e),c=0));8<=e;d[b+f]=a&255,f+=p,a/=256,e-=8);c=c<<e|a;for(g+=e;0<g;d[b+f]=c&255,f+=p,c/=256,g-=8);d[b+f-p]|=128*v}function Ia(d,a){if((z.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<a)throw new RangeError("Invalid typed array length");z.TYPED_ARRAY_SUPPORT?(d=new Uint8Array(a),d.__proto__=z.prototype):(null===d&&(d=
new z(a)),d.length=a);return d}function z(d,a,b){if(!(z.TYPED_ARRAY_SUPPORT||this instanceof z))return new z(d,a,b);if("number"===typeof d){if("string"===typeof a)throw Error("If encoding is specified then the first argument must be a string");return sd(this,d)}return of(this,d,a,b)}function of(d,a,b,c){if("number"===typeof a)throw new TypeError('"value" argument must not be a number');if("undefined"!==typeof ArrayBuffer&&a instanceof ArrayBuffer){a.byteLength;if(0>b||a.byteLength<b)throw new RangeError("'offset' is out of bounds");
if(a.byteLength<b+(c||0))throw new RangeError("'length' is out of bounds");a=void 0===b&&void 0===c?new Uint8Array(a):void 0===c?new Uint8Array(a,b):new Uint8Array(a,b,c);z.TYPED_ARRAY_SUPPORT?(d=a,d.__proto__=z.prototype):d=td(d,a);return d}if("string"===typeof a){c=d;d=b;if("string"!==typeof d||""===d)d="utf8";if(!z.isEncoding(d))throw new TypeError('"encoding" must be a valid string encoding');b=pf(a,d)|0;c=Ia(c,b);a=c.write(a,d);a!==b&&(c=c.slice(0,a));return c}return wh(d,a)}function qf(d){if("number"!==
typeof d)throw new TypeError('"size" argument must be a number');if(0>d)throw new RangeError('"size" argument must not be negative');}function sd(d,a){qf(a);d=Ia(d,0>a?0:ud(a)|0);if(!z.TYPED_ARRAY_SUPPORT)for(var b=0;b<a;++b)d[b]=0;return d}function td(d,a){var b=0>a.length?0:ud(a.length)|0;d=Ia(d,b);for(var c=0;c<b;c+=1)d[c]=a[c]&255;return d}function wh(d,a){if(ra(a)){var b=ud(a.length)|0;d=Ia(d,b);if(0===d.length)return d;a.copy(d,0,0,b);return d}if(a){if("undefined"!==typeof ArrayBuffer&&a.buffer instanceof
ArrayBuffer||"length"in a)return(b="number"!==typeof a.length)||(b=a.length,b=b!==b),b?Ia(d,0):td(d,a);if("Buffer"===a.type&&rf(a.data))return td(d,a.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");}function ud(d){if(d>=(z.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(z.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return d|0}function ra(d){return!(null==
d||!d._isBuffer)}function pf(d,a){if(ra(d))return d.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(d)||d instanceof ArrayBuffer))return d.byteLength;"string"!==typeof d&&(d=""+d);var b=d.length;if(0===b)return 0;for(var c=!1;;)switch(a){case "ascii":case "latin1":case "binary":return b;case "utf8":case "utf-8":case void 0:return fc(d).length;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*b;case "hex":return b>>>1;case "base64":return sf(d).length;
default:if(c)return fc(d).length;a=(""+a).toLowerCase();c=!0}}function xh(d,a,b){var c=!1;if(void 0===a||0>a)a=0;if(a>this.length)return"";if(void 0===b||b>this.length)b=this.length;if(0>=b)return"";b>>>=0;a>>>=0;if(b<=a)return"";for(d||(d="utf8");;)switch(d){case "hex":d=a;a=b;b=this.length;if(!d||0>d)d=0;if(!a||0>a||a>b)a=b;c="";for(b=d;b<a;++b)d=c,c=this[b],c=16>c?"0"+c.toString(16):c.toString(16),c=d+c;return c;case "utf8":case "utf-8":return tf(this,a,b);case "ascii":d="";for(b=Math.min(this.length,
b);a<b;++a)d+=String.fromCharCode(this[a]&127);return d;case "latin1":case "binary":d="";for(b=Math.min(this.length,b);a<b;++a)d+=String.fromCharCode(this[a]);return d;case "base64":return a=0===a&&b===this.length?nf(this):nf(this.slice(a,b)),a;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":a=this.slice(a,b);b="";for(d=0;d<a.length;d+=2)b+=String.fromCharCode(a[d]+256*a[d+1]);return b;default:if(c)throw new TypeError("Unknown encoding: "+d);d=(d+"").toLowerCase();c=!0}}function wb(d,a,b){var c=
d[a];d[a]=d[b];d[b]=c}function uf(d,a,b,c,e){if(0===d.length)return-1;"string"===typeof b?(c=b,b=0):2147483647<b?b=2147483647:-2147483648>b&&(b=-2147483648);b=+b;isNaN(b)&&(b=e?0:d.length-1);0>b&&(b=d.length+b);if(b>=d.length){if(e)return-1;b=d.length-1}else if(0>b)if(e)b=0;else return-1;"string"===typeof a&&(a=z.from(a,c));if(ra(a))return 0===a.length?-1:vf(d,a,b,c,e);if("number"===typeof a)return a&=255,z.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(d,
a,b):Uint8Array.prototype.lastIndexOf.call(d,a,b):vf(d,[a],b,c,e);throw new TypeError("val must be string, number or Buffer");}function vf(d,a,b,c,e){function f(a,b){return 1===h?a[b]:a.readUInt16BE(b*h)}var h=1,g=d.length,k=a.length;if(void 0!==c&&(c=String(c).toLowerCase(),"ucs2"===c||"ucs-2"===c||"utf16le"===c||"utf-16le"===c)){if(2>d.length||2>a.length)return-1;h=2;g/=2;k/=2;b/=2}if(e)for(c=-1;b<g;b++)if(f(d,b)===f(a,-1===c?0:b-c)){if(-1===c&&(c=b),b-c+1===k)return c*h}else-1!==c&&(b-=b-c),c=
-1;else for(b+k>g&&(b=g-k);0<=b;b--){g=!0;for(c=0;c<k;c++)if(f(d,b+c)!==f(a,c)){g=!1;break}if(g)return b}return-1}function tf(d,a,b){b=Math.min(d.length,b);for(var c=[];a<b;){var e=d[a],f=null,h=239<e?4:223<e?3:191<e?2:1;if(a+h<=b)switch(h){case 1:128>e&&(f=e);break;case 2:var g=d[a+1];128===(g&192)&&(e=(e&31)<<6|g&63,127<e&&(f=e));break;case 3:g=d[a+1];var k=d[a+2];128===(g&192)&&128===(k&192)&&(e=(e&15)<<12|(g&63)<<6|k&63,2047<e&&(55296>e||57343<e)&&(f=e));break;case 4:g=d[a+1];k=d[a+2];var q=d[a+
3];128===(g&192)&&128===(k&192)&&128===(q&192)&&(e=(e&15)<<18|(g&63)<<12|(k&63)<<6|q&63,65535<e&&1114112>e&&(f=e))}null===f?(f=65533,h=1):65535<f&&(f-=65536,c.push(f>>>10&1023|55296),f=56320|f&1023);c.push(f);a+=h}d=c.length;if(d<=wf)c=String.fromCharCode.apply(String,c);else{b="";for(a=0;a<d;)b+=String.fromCharCode.apply(String,c.slice(a,a+=wf));c=b}return c}function W(d,a,b){if(0!==d%1||0>d)throw new RangeError("offset is not uint");if(d+a>b)throw new RangeError("Trying to access beyond buffer length");
}function ca(d,a,b,c,e,f){if(!ra(d))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>e||a<f)throw new RangeError('"value" argument is out of bounds');if(b+c>d.length)throw new RangeError("Index out of range");}function yc(d,a,b,c){0>a&&(a=65535+a+1);for(var e=0,f=Math.min(d.length-b,2);e<f;++e)d[b+e]=(a&255<<8*(c?e:1-e))>>>8*(c?e:1-e)}function gc(d,a,b,c){0>a&&(a=4294967295+a+1);for(var e=0,f=Math.min(d.length-b,4);e<f;++e)d[b+e]=a>>>8*(c?e:3-e)&255}function zc(d,a,b,c){if(b+
c>d.length)throw new RangeError("Index out of range");if(0>b)throw new RangeError("Index out of range");}function fc(d,a){a=a||Infinity;for(var b,c=d.length,e=null,f=[],h=0;h<c;++h){b=d.charCodeAt(h);if(55295<b&&57344>b){if(!e){if(56319<b){-1<(a-=3)&&f.push(239,191,189);continue}else if(h+1===c){-1<(a-=3)&&f.push(239,191,189);continue}e=b;continue}if(56320>b){-1<(a-=3)&&f.push(239,191,189);e=b;continue}b=(e-55296<<10|b-56320)+65536}else e&&-1<(a-=3)&&f.push(239,191,189);e=null;if(128>b){if(0>--a)break;
f.push(b)}else if(2048>b){if(0>(a-=2))break;f.push(b>>6|192,b&63|128)}else if(65536>b){if(0>(a-=3))break;f.push(b>>12|224,b>>6&63|128,b&63|128)}else if(1114112>b){if(0>(a-=4))break;f.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw Error("Invalid code point");}return f}function xf(d){for(var a=[],b=0;b<d.length;++b)a.push(d.charCodeAt(b)&255);return a}function sf(d){d=(d.trim?d.trim():d.replace(/^\s+|\s+$/g,"")).replace(yh,"");if(2>d.length)d="";else for(;0!==d.length%4;)d+="=";rd||mf();
var a=d.length;if(0<a%4)throw Error("Invalid string. Length must be a multiple of 4");var b="="===d[a-2]?2:"="===d[a-1]?1:0,c=new zh(3*a/4-b),e=0<b?a-4:a,f=0;for(a=0;a<e;a+=4){var h=ma[d.charCodeAt(a)]<<18|ma[d.charCodeAt(a+1)]<<12|ma[d.charCodeAt(a+2)]<<6|ma[d.charCodeAt(a+3)];c[f++]=h>>16&255;c[f++]=h>>8&255;c[f++]=h&255}2===b?(h=ma[d.charCodeAt(a)]<<2|ma[d.charCodeAt(a+1)]>>4,c[f++]=h&255):1===b&&(h=ma[d.charCodeAt(a)]<<10|ma[d.charCodeAt(a+1)]<<4|ma[d.charCodeAt(a+2)]>>2,c[f++]=h>>8&255,c[f++]=
h&255);return c}function Ob(d,a,b,c){for(var e=0;e<c&&!(e+b>=a.length||e>=d.length);++e)a[e+b]=d[e];return e}function yf(d){return null!=d&&(!!d._isBuffer||zf(d)||"function"===typeof d.readFloatLE&&"function"===typeof d.slice&&zf(d.slice(0,0)))}function zf(d){return!!d.constructor&&"function"===typeof d.constructor.isBuffer&&d.constructor.isBuffer(d)}function vd(d,a){return a={exports:{}},d(a,a.exports),a.exports}function Af(){throw Error("setTimeout has not been defined");}function Bf(){throw Error("clearTimeout has not been defined");
}function Cf(d){if(jb===setTimeout)return setTimeout(d,0);if((jb===Af||!jb)&&setTimeout)return jb=setTimeout,setTimeout(d,0);try{return jb(d,0)}catch(a){try{return jb.call(null,d,0)}catch(b){return jb.call(this,d,0)}}}function Ah(d){if(kb===clearTimeout)return clearTimeout(d);if((kb===Bf||!kb)&&clearTimeout)return kb=clearTimeout,clearTimeout(d);try{return kb(d)}catch(a){try{return kb.call(null,d)}catch(b){return kb.call(this,d)}}}function Bh(){xb&&yb&&(xb=!1,yb.length?Aa=yb.concat(Aa):hc=-1,Aa.length&&
Df())}function Df(){if(!xb){var d=Cf(Bh);xb=!0;for(var a=Aa.length;a;){yb=Aa;for(Aa=[];++hc<a;)yb&&yb[hc].run();hc=-1;a=Aa.length}yb=null;xb=!1;Ah(d)}}function Ef(d){var a=Array(arguments.length-1);if(1<arguments.length)for(var b=1;b<arguments.length;b++)a[b-1]=arguments[b];Aa.push(new Ff(d,a));1!==Aa.length||xb||Cf(Df)}function Ff(d,a){this.fun=d;this.array=a}function Ua(){}function ya(d){if("string"!==typeof d)throw new TypeError("Path must be a string. Received "+JSON.stringify(d));}function Gf(d,
a){for(var b="",c=0,e=-1,f=0,h,g=0;g<=d.length;++g){if(g<d.length)h=d.charCodeAt(g);else if(47===h)break;else h=47;if(47===h){if(e!==g-1&&1!==f)if(e!==g-1&&2===f){if(2>b.length||2!==c||46!==b.charCodeAt(b.length-1)||46!==b.charCodeAt(b.length-2))if(2<b.length){if(e=b.lastIndexOf("/"),e!==b.length-1){-1===e?(b="",c=0):(b=b.slice(0,e),c=b.length-1-b.lastIndexOf("/"));e=g;f=0;continue}}else if(2===b.length||1===b.length){b="";c=0;e=g;f=0;continue}a&&(b=0<b.length?b+"/..":"..",c=2)}else b=0<b.length?
b+("/"+d.slice(e+1,g)):d.slice(e+1,g),c=g-e-1;e=g;f=0}else 46===h&&-1!==f?++f:f=-1}return b}function Va(d){var a=Math.trunc(d);d=A(Math.round(1E6*(d-a)));return A(a)*A(1E6)+d}function Ja(d){"number"===typeof d&&(d=Math.trunc(d));d=A(d);return Number(d/A(1E6))}function E(d){return function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];try{return d.apply(void 0,vc(a))}catch(c){if(c&&c.code&&"string"===typeof c.code)return Ch[c.code]||28;if(c instanceof wd)return c.errno;throw c;}}}function Hf(d,
a){var b=d.FD_MAP.get(a);if(!b)throw new wd(8);if(void 0===b.filetype){var c=d.bindings.fs.fstatSync(b.real);d=If(d,a,c);a=d.rightsBase;c=d.rightsInheriting;b.filetype=d.filetype;b.rights||(b.rights={base:a,inheriting:c})}return b}function If(d,a,b){switch(!0){case b.isBlockDevice():return{filetype:1,rightsBase:Ka,rightsInheriting:Ka};case b.isCharacterDevice():return void 0!==a&&d.bindings.isTTY(a)?{filetype:2,rightsBase:Dh,rightsInheriting:Eh}:{filetype:2,rightsBase:Ka,rightsInheriting:Ka};case b.isDirectory():return{filetype:3,
rightsBase:xd,rightsInheriting:Jf};case b.isFIFO():return{filetype:6,rightsBase:Kf,rightsInheriting:Ka};case b.isFile():return{filetype:4,rightsBase:Lf,rightsInheriting:Fh};case b.isSocket():return{filetype:6,rightsBase:Kf,rightsInheriting:Ka};case b.isSymbolicLink():return{filetype:7,rightsBase:A(0),rightsInheriting:A(0)};default:return{filetype:0,rightsBase:A(0),rightsInheriting:A(0)}}}var Mf=Lc(function(d,a){!function(a,c){d.exports=c()}(window,function(){return function(a){function b(c){if(d[c])return d[c].exports;
var f=d[c]={i:c,l:!1,exports:{}};return a[c].call(f.exports,f,f.exports,b),f.l=!0,f.exports}var d={};return b.m=a,b.c=d,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"});Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if((1&c&&(a=b(a)),8&c)||4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),
Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var f in a)b.d(d,f,function(b){return a[b]}.bind(null,f));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a.default}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=33)}([function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=d(14);c.IBufferService=a.createDecorator("BufferService");c.ICoreMouseService=a.createDecorator("CoreMouseService");
c.ICoreService=a.createDecorator("CoreService");c.IDirtyRowService=a.createDecorator("DirtyRowService");c.IInstantiationService=a.createDecorator("InstantiationService");c.ILogService=a.createDecorator("LogService");c.IOptionsService=a.createDecorator("OptionsService")},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=function(){function a(){this._listeners=[];this._disposed=!1}return Object.defineProperty(a.prototype,"event",{get:function(){var a=this;return this._event||(this._event=
function(b){return a._listeners.push(b),{dispose:function(){if(!a._disposed)for(var c=0;c<a._listeners.length;c++)if(a._listeners[c]===b)return void a._listeners.splice(c,1)}}}),this._event},enumerable:!0,configurable:!0}),a.prototype.fire=function(a){for(var b=[],c=0;c<this._listeners.length;c++)b.push(this._listeners[c]);for(c=0;c<b.length;c++)b[c].call(void 0,a)},a.prototype.dispose=function(){this._listeners&&(this._listeners.length=0);this._disposed=!0},a}();c.EventEmitter=a},function(a,c,d){Object.defineProperty(c,
"__esModule",{value:!0});a=function(){function a(){this._disposables=[];this._isDisposed=!1}return a.prototype.dispose=function(){this._isDisposed=!0;this._disposables.forEach(function(a){return a.dispose()});this._disposables.length=0},a.prototype.register=function(a){this._disposables.push(a)},a.prototype.unregister=function(a){a=this._disposables.indexOf(a);-1!==a&&this._disposables.splice(a,1)},a}();c.Disposable=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});c.DEFAULT_COLOR=
256;c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9;c.CHAR_DATA_ATTR_INDEX=0;c.CHAR_DATA_CHAR_INDEX=1;c.CHAR_DATA_WIDTH_INDEX=2;c.CHAR_DATA_CODE_INDEX=3;c.NULL_CELL_CHAR="";c.NULL_CELL_WIDTH=1;c.NULL_CELL_CODE=0;c.WHITESPACE_CELL_CHAR=" ";c.WHITESPACE_CELL_WIDTH=1;c.WHITESPACE_CELL_CODE=32},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=d(14);c.ICharSizeService=a.createDecorator("CharSizeService");c.ICoreBrowserService=a.createDecorator("CoreBrowserService");c.IMouseService=a.createDecorator("MouseService");
c.IRenderService=a.createDecorator("RenderService");c.ISelectionService=a.createDecorator("SelectionService");c.ISoundService=a.createDecorator("SoundService")},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,
new d)});Object.defineProperty(c,"__esModule",{value:!0});var g=d(8),k=d(3);a=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b.content=0,b.fg=0,b.bg=0,b.combinedData="",b}return e(b,a),b.fromCharData=function(a){var c=new b;return c.setFromCharData(a),c},b.prototype.isCombined=function(){return 2097152&this.content},b.prototype.getWidth=function(){return this.content>>22},b.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?
g.stringFromCodePoint(2097151&this.content):""},b.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},b.prototype.setFromCharData=function(a){this.fg=a[k.CHAR_DATA_ATTR_INDEX];this.bg=0;var b=!1;if(2<a[k.CHAR_DATA_CHAR_INDEX].length)b=!0;else if(2===a[k.CHAR_DATA_CHAR_INDEX].length){var c=a[k.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&56319>=c){var d=a[k.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=d&&57343>=d?this.content=
1024*(c-55296)+d-56320+65536|a[k.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=a[k.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[k.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=a[k.CHAR_DATA_CHAR_INDEX],this.content=2097152|a[k.CHAR_DATA_WIDTH_INDEX]<<22)},b.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},b}(d(6).AttributeData);c.CellData=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=function(){function a(){this.bg=
this.fg=0}return a.toColorRGB=function(a){return[a>>>16&255,a>>>8&255,255&a]},a.fromColorRGB=function(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]},a.prototype.clone=function(){var b=new a;return b.fg=this.fg,b.bg=this.bg,b},a.prototype.isInverse=function(){return 67108864&this.fg},a.prototype.isBold=function(){return 134217728&this.fg},a.prototype.isUnderline=function(){return 268435456&this.fg},a.prototype.isBlink=function(){return 536870912&this.fg},a.prototype.isInvisible=function(){return 1073741824&
this.fg},a.prototype.isItalic=function(){return 67108864&this.bg},a.prototype.isDim=function(){return 134217728&this.bg},a.prototype.getFgColorMode=function(){return 50331648&this.fg},a.prototype.getBgColorMode=function(){return 50331648&this.bg},a.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},a.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},a.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},a.prototype.isBgPalette=
function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},a.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},a.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},a.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},a.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&
this.bg;default:return-1}},a}();c.AttributeData=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});c.addDisposableDomListener=function(a,b,c,d){return a.addEventListener(b,c,d),{dispose:function(){c&&a.removeEventListener(b,c,d)}}}},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});c.stringFromCodePoint=function(a){return 65535<a?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)};c.utf32ToString=function(a,b,c){void 0===
b&&(b=0);void 0===c&&(c=a.length);for(var d="";b<c;++b){var e=a[b];65535<e?(e-=65536,d+=String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):d+=String.fromCharCode(e)}return d};a=function(){function a(){this._interim=0}return a.prototype.clear=function(){this._interim=0},a.prototype.decode=function(a,b){var c=a.length;if(!c)return 0;var d=0,e=0;for(this._interim&&(56320<=(h=a.charCodeAt(e++))&&57343>=h?b[d++]=1024*(this._interim-55296)+h-56320+65536:(b[d++]=this._interim,b[d++]=h),
this._interim=0);e<c;++e){var f=a.charCodeAt(e);if(55296<=f&&56319>=f){if(++e>=c)return this._interim=f,d;var h;56320<=(h=a.charCodeAt(e))&&57343>=h?b[d++]=1024*(f-55296)+h-56320+65536:(b[d++]=f,b[d++]=h)}else b[d++]=f}return d},a}();c.StringToUtf32=a;a=function(){function a(){this.interim=new Uint8Array(3)}return a.prototype.clear=function(){this.interim.fill(0)},a.prototype.decode=function(a,b){var c=a.length;if(!c)return 0;var d,e,f,h,g=0,r=0,x=0;if(this.interim[0]){var D=!1,H=this.interim[0];
H&=192==(224&H)?31:224==(240&H)?15:7;for(var La=0,Da;(Da=63&this.interim[++La])&&4>La;)H<<=6,H|=Da;for(var Pb=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,Dc=Pb-La;x<Dc;){if(x>=c)return 0;if(128!=(192&(Da=a[x++]))){x--;D=!0;break}this.interim[La++]=Da;H<<=6;H|=63&Da}D||(2===Pb?128>H?x--:b[g++]=H:3===Pb?2048>H||55296<=H&&57343>=H||(b[g++]=H):65536>H||1114111<H||(b[g++]=H));this.interim.fill(0)}for(D=c-4;x<c;){for(;!(!(x<D)||128&(d=a[x])||128&(e=a[x+1])||128&(f=a[x+2])||128&(h=a[x+3]));)b[g++]=
d,b[g++]=e,b[g++]=f,b[g++]=h,x+=4;if(128>(d=a[x++]))b[g++]=d;else if(192==(224&d)){if(x>=c)return this.interim[0]=d,g;128!=(192&(e=a[x++]))?x--:128>(r=(31&d)<<6|63&e)?x--:b[g++]=r}else if(224==(240&d)){if(x>=c)return this.interim[0]=d,g;if(128!=(192&(e=a[x++])))x--;else{if(x>=c)return this.interim[0]=d,this.interim[1]=e,g;128!=(192&(f=a[x++]))?x--:2048>(r=(15&d)<<12|(63&e)<<6|63&f)||55296<=r&&57343>=r||(b[g++]=r)}}else if(240==(248&d)){if(x>=c)return this.interim[0]=d,g;if(128!=(192&(e=a[x++])))x--;
else{if(x>=c)return this.interim[0]=d,this.interim[1]=e,g;if(128!=(192&(f=a[x++])))x--;else{if(x>=c)return this.interim[0]=d,this.interim[1]=e,this.interim[2]=f,g;128!=(192&(h=a[x++]))?x--:65536>(r=(7&d)<<18|(63&e)<<12|(63&f)<<6|63&h)||1114111<r||(b[g++]=r)}}}}return g},a}();c.Utf8ToUtf32=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});c.INVERTED_DEFAULT_COLOR=257;c.DIM_OPACITY=.5;c.CHAR_ATLAS_CELL_SPACING=1},function(a,c,d){function b(a){a=a.toString(16);return 2>a.length?"0"+
a:a}function e(a,c,d,e){return void 0!==e?"#"+b(a)+b(c)+b(d)+b(e):"#"+b(a)+b(c)+b(d)}function g(a,b,c,d){return void 0===d&&(d=255),(a<<24|b<<16|c<<8|d)>>>0}function k(a){return[a>>24&255,a>>16&255,a>>8&255,255&a]}function q(a){return t(a>>16&255,a>>8&255,255&a)}function t(a,b,c){a/=255;b/=255;c/=255;return.2126*(.03928>=a?a/12.92:Math.pow((a+.055)/1.055,2.4))+.7152*(.03928>=b?b/12.92:Math.pow((b+.055)/1.055,2.4))+.0722*(.03928>=c?c/12.92:Math.pow((c+.055)/1.055,2.4))}function p(a,b){return a<b?(b+
.05)/(a+.05):(a+.05)/(b+.05)}function v(a,b,c){return{css:e(a,b,c),rgba:g(a,b,c)}}function n(a,b,c){var d=q(a>>8),e=q(b>>8);if(p(d,e)<c)return e<d?r(a,b,c):x(a,b,c)}function r(a,b,c){var d=a>>24&255,e=a>>16&255;a=a>>8&255;var f=b>>24&255,h=b>>16&255;b=b>>8&255;for(var g=p(t(f,b,h),t(d,e,a));g<c&&(0<f||0<h||0<b);)f-=Math.max(0,Math.ceil(.1*f)),h-=Math.max(0,Math.ceil(.1*h)),g=p(t(f,b-=Math.max(0,Math.ceil(.1*b)),h),t(d,e,a));return(f<<24|h<<16|b<<8|255)>>>0}function x(a,b,c){var d=a>>24&255,e=a>>16&
255;a=a>>8&255;var f=b>>24&255,h=b>>16&255;b=b>>8&255;for(var g=p(t(f,b,h),t(d,e,a));g<c&&(255>f||255>h||255>b);)f=Math.min(255,f+Math.ceil(.1*(255-f))),h=Math.min(255,h+Math.ceil(.1*(255-h))),g=p(t(f,b=Math.min(255,b+Math.ceil(.1*(255-b))),h),t(d,e,a));return(f<<24|h<<16|b<<8|255)>>>0}Object.defineProperty(c,"__esModule",{value:!0});c.blend=function(a,b){var c=(255&b.rgba)/255;if(1===c)return{css:b.css,rgba:b.rgba};var d=a.rgba>>24&255,f=a.rgba>>16&255;a=a.rgba>>8&255;d+=Math.round(((b.rgba>>24&
255)-d)*c);f+=Math.round(((b.rgba>>16&255)-f)*c);b=a+Math.round(((b.rgba>>8&255)-a)*c);return{css:e(d,f,b),rgba:g(d,f,b)}};c.fromCss=function(a){return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0}};c.toPaddedHex=b;c.toCss=e;c.toRgba=g;c.fromRgba=k;c.opaque=function(a){a=(255|a.rgba)>>>0;var b=k(a);return{css:e(b[0],b[1],b[2]),rgba:a}};c.rgbRelativeLuminance=q;c.rgbRelativeLuminance2=t;c.contrastRatio=p;c.rgbaToColor=v;c.ensureContrastRatioRgba=n;c.ensureContrastRatio=function(a,b,c){if(a=n(a.rgba,
b.rgba,c))return v(a>>24&255,a>>16&255,a>>8&255)};c.reduceLuminance=r;c.increaseLuminance=x},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});d=(a="undefined"==typeof navigator)?"node":navigator.userAgent;a=a?"node":navigator.platform;c.isFirefox=!!~d.indexOf("Firefox");c.isSafari=/^((?!chrome|android).)*safari/i.test(d);d=0<=["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(a);c.isMac=d;c.isIpad="iPad"===a;c.isIphone="iPhone"===a;d=0<=["Windows","Win16","Win32","WinCE"].indexOf(a);
c.isWindows=d;c.isLinux=0<=a.indexOf("Linux")},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});(function(a){a.NUL="\x00";a.SOH="\u0001";a.STX="\u0002";a.ETX="\u0003";a.EOT="\u0004";a.ENQ="\u0005";a.ACK="\u0006";a.BEL="\u0007";a.BS="\b";a.HT="\t";a.LF="\n";a.VT="\v";a.FF="\f";a.CR="\r";a.SO="\u000e";a.SI="\u000f";a.DLE="\u0010";a.DC1="\u0011";a.DC2="\u0012";a.DC3="\u0013";a.DC4="\u0014";a.NAK="\u0015";a.SYN="\u0016";a.ETB="\u0017";a.CAN="\u0018";a.EM="\u0019";a.SUB="\u001a";a.ESC=
"\u001b";a.FS="\u001c";a.GS="\u001d";a.RS="\u001e";a.US="\u001f";a.SP=" ";a.DEL="\u007f"})(c.C0||(c.C0={}));(function(a){a.PAD="\u0080";a.HOP="\u0081";a.BPH="\u0082";a.NBH="\u0083";a.IND="\u0084";a.NEL="\u0085";a.SSA="\u0086";a.ESA="\u0087";a.HTS="\u0088";a.HTJ="\u0089";a.VTS="\u008a";a.PLD="\u008b";a.PLU="\u008c";a.RI="\u008d";a.SS2="\u008e";a.SS3="\u008f";a.DCS="\u0090";a.PU1="\u0091";a.PU2="\u0092";a.STS="\u0093";a.CCH="\u0094";a.MW="\u0095";a.SPA="\u0096";a.EPA="\u0097";a.SOS="\u0098";a.SGCI=
"\u0099";a.SCI="\u009a";a.CSI="\u009b";a.ST="\u009c";a.OSC="\u009d";a.PM="\u009e";a.APC="\u009f"})(c.C1||(c.C1={}))},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(3),e=d(9),g=d(24),k=d(6),q=d(27),t=d(10);a=function(){function a(a,b,c,d,e,f,h,g){this._container=a;this._alpha=d;this._colors=e;this._rendererId=f;this._bufferService=h;this._optionsService=g;this._scaledCharTop=this._scaledCharLeft=this._scaledCellHeight=this._scaledCellWidth=this._scaledCharHeight=this._scaledCharWidth=
0;this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1};this._canvas=document.createElement("canvas");this._canvas.classList.add("xterm-"+b+"-layer");this._canvas.style.zIndex=c.toString();this._initCanvas();this._container.appendChild(this._canvas)}return a.prototype.dispose=function(){var a;this._container.removeChild(this._canvas);null===(a=this._charAtlas)||void 0===a||a.dispose()},a.prototype._initCanvas=function(){this._ctx=q.throwIfFalsy(this._canvas.getContext("2d",
{alpha:this._alpha}));this._alpha||this._clearAll()},a.prototype.onOptionsChanged=function(){},a.prototype.onBlur=function(){},a.prototype.onFocus=function(){},a.prototype.onCursorMove=function(){},a.prototype.onGridChanged=function(a,b){},a.prototype.onSelectionChanged=function(a,b,c){},a.prototype.setColors=function(a){this._refreshCharAtlas(a)},a.prototype._setTransparency=function(a){if(a!==this._alpha){var b=this._canvas;this._alpha=a;this._canvas=this._canvas.cloneNode();this._initCanvas();
this._container.replaceChild(this._canvas,b);this._refreshCharAtlas(this._colors);this.onGridChanged(0,this._bufferService.rows-1)}},a.prototype._refreshCharAtlas=function(a){0>=this._scaledCharWidth&&0>=this._scaledCharHeight||(this._charAtlas=g.acquireCharAtlas(this._optionsService.options,this._rendererId,a,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},a.prototype.resize=function(a){this._scaledCellWidth=a.scaledCellWidth;this._scaledCellHeight=a.scaledCellHeight;this._scaledCharWidth=
a.scaledCharWidth;this._scaledCharHeight=a.scaledCharHeight;this._scaledCharLeft=a.scaledCharLeft;this._scaledCharTop=a.scaledCharTop;this._canvas.width=a.scaledCanvasWidth;this._canvas.height=a.scaledCanvasHeight;this._canvas.style.width=a.canvasWidth+"px";this._canvas.style.height=a.canvasHeight+"px";this._alpha||this._clearAll();this._refreshCharAtlas(this._colors)},a.prototype._fillCells=function(a,b,c,d){this._ctx.fillRect(a*this._scaledCellWidth,b*this._scaledCellHeight,c*this._scaledCellWidth,
d*this._scaledCellHeight)},a.prototype._fillBottomLineAtCells=function(a,b,c){void 0===c&&(c=1);this._ctx.fillRect(a*this._scaledCellWidth,(b+1)*this._scaledCellHeight-window.devicePixelRatio-1,c*this._scaledCellWidth,window.devicePixelRatio)},a.prototype._fillLeftLineAtCell=function(a,b){this._ctx.fillRect(a*this._scaledCellWidth,b*this._scaledCellHeight,window.devicePixelRatio,this._scaledCellHeight)},a.prototype._strokeRectAtCell=function(a,b,c,d){this._ctx.lineWidth=window.devicePixelRatio;this._ctx.strokeRect(a*
this._scaledCellWidth+window.devicePixelRatio/2,b*this._scaledCellHeight+window.devicePixelRatio/2,c*this._scaledCellWidth-window.devicePixelRatio,d*this._scaledCellHeight-window.devicePixelRatio)},a.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},a.prototype._clearCells=function(a,b,c,d){this._alpha?this._ctx.clearRect(a*this._scaledCellWidth,
b*this._scaledCellHeight,c*this._scaledCellWidth,d*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(a*this._scaledCellWidth,b*this._scaledCellHeight,c*this._scaledCellWidth,d*this._scaledCellHeight))},a.prototype._fillCharTrueColor=function(a,b,c){this._ctx.font=this._getFont(!1,!1);this._ctx.textBaseline="middle";this._clipRow(c);this._ctx.fillText(a.getChars(),b*this._scaledCellWidth+this._scaledCharLeft,c*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/
2)},a.prototype._drawChars=function(a,c,d){var f,h,g=this._getContrastColor(a);g||a.isFgRGB()||a.isBgRGB()?this._drawUncachedChars(a,c,d,g):(a.isInverse()?(f=a.isBgDefault()?e.INVERTED_DEFAULT_COLOR:a.getBgColor(),h=a.isFgDefault()?e.INVERTED_DEFAULT_COLOR:a.getFgColor()):(h=a.isBgDefault()?b.DEFAULT_COLOR:a.getBgColor(),f=a.isFgDefault()?b.DEFAULT_COLOR:a.getFgColor()),f+=this._optionsService.options.drawBoldTextInBrightColors&&a.isBold()&&8>f?8:0,this._currentGlyphIdentifier.chars=a.getChars()||
b.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=a.getCode()||b.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=h,this._currentGlyphIdentifier.fg=f,this._currentGlyphIdentifier.bold=!!a.isBold(),this._currentGlyphIdentifier.dim=!!a.isDim(),this._currentGlyphIdentifier.italic=!!a.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,c*this._scaledCellWidth+this._scaledCharLeft,d*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(a,c,
d))},a.prototype._drawUncachedChars=function(a,b,c,d){(this._ctx.save(),this._ctx.font=this._getFont(!!a.isBold(),!!a.isItalic()),this._ctx.textBaseline="middle",a.isInverse())?d?this._ctx.fillStyle=d.css:a.isBgDefault()?this._ctx.fillStyle=t.opaque(this._colors.background).css:a.isBgRGB()?this._ctx.fillStyle="rgb("+k.AttributeData.toColorRGB(a.getBgColor()).join(",")+")":(d=a.getBgColor(),this._optionsService.options.drawBoldTextInBrightColors&&a.isBold()&&8>d&&(d+=8),this._ctx.fillStyle=this._colors.ansi[d].css):
d?this._ctx.fillStyle=d.css:a.isFgDefault()?this._ctx.fillStyle=this._colors.foreground.css:a.isFgRGB()?this._ctx.fillStyle="rgb("+k.AttributeData.toColorRGB(a.getFgColor()).join(",")+")":(d=a.getFgColor(),this._optionsService.options.drawBoldTextInBrightColors&&a.isBold()&&8>d&&(d+=8),this._ctx.fillStyle=this._colors.ansi[d].css);this._clipRow(c);a.isDim()&&(this._ctx.globalAlpha=e.DIM_OPACITY);this._ctx.fillText(a.getChars(),b*this._scaledCellWidth+this._scaledCharLeft,c*this._scaledCellHeight+
this._scaledCharTop+this._scaledCharHeight/2);this._ctx.restore()},a.prototype._clipRow=function(a){this._ctx.beginPath();this._ctx.rect(0,a*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight);this._ctx.clip()},a.prototype._getFont=function(a,b){return(b?"italic":"")+" "+(a?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},
a.prototype._getContrastColor=function(a){if(1!==this._optionsService.options.minimumContrastRatio){var b=this._colors.contrastCache.getColor(a.bg,a.fg);if(void 0!==b)return b||void 0;b=a.getFgColor();var c=a.getFgColorMode(),d=a.getBgColor(),e=a.getBgColorMode(),f=!!a.isInverse(),h=!!a.isInverse();if(f){var g=b;b=d;d=g;g=c;c=e;e=g}d=this._resolveBackgroundRgba(e,d,f);b=this._resolveForegroundRgba(c,b,f,h);if(b=t.ensureContrastRatioRgba(d,b,this._optionsService.options.minimumContrastRatio))return b=
{css:t.toCss(b>>24&255,b>>16&255,b>>8&255),rgba:b},this._colors.contrastCache.setColor(a.bg,a.fg,b),b;this._colors.contrastCache.setColor(a.bg,a.fg,null)}},a.prototype._resolveBackgroundRgba=function(a,b,c){switch(a){case 16777216:case 33554432:return this._colors.ansi[b].rgba;case 50331648:return b<<8;default:return c?this._colors.foreground.rgba:this._colors.background.rgba}},a.prototype._resolveForegroundRgba=function(a,b,c,d){switch(a){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&
d&&8>b&&(b+=8),this._colors.ansi[b].rgba;case 50331648:return b<<8;default:return c?this._colors.background.rgba:this._colors.foreground.rgba}},a}();c.BaseRenderLayer=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});c.serviceRegistry=new Map;c.getServiceDependencies=function(a){return a.di$dependencies||[]};c.createDecorator=function(a){if(c.serviceRegistry.has(a))return c.serviceRegistry.get(a);var b=function(a,c,d){if(3!==arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");
var e=b;a.di$target===a?a.di$dependencies.push({id:e,index:d}):(a.di$dependencies=[{id:e,index:d}],a.di$target=a)};return b.toString=function(){return a},c.serviceRegistry.set(a,b),b}},function(a,c,d){function b(a,b,c,d){if(void 0===c&&(c=0),void 0===d&&(d=a.length),c>=a.length)return a;c=(a.length+c)%a.length;for(d=d>=a.length?a.length:(a.length+d)%a.length;c<d;++c)a[c]=b;return a}Object.defineProperty(c,"__esModule",{value:!0});c.fill=function(a,c,d,e){return a.fill?a.fill(c,d,e):b(a,c,d,e)};c.fillFallback=
b;c.concat=function(a,b){var c=new a.constructor(a.length+b.length);return c.set(a),c.set(b,a.length),c}},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(8),e=d(3),g=d(5);a=d(6);c.DEFAULT_ATTR_DATA=Object.freeze(new a.AttributeData);a=function(){function a(a,b,c){void 0===c&&(c=!1);this.isWrapped=c;this._combined={};this._data=new Uint32Array(3*a);b=b||g.CellData.fromCharData([0,e.NULL_CELL_CHAR,e.NULL_CELL_WIDTH,e.NULL_CELL_CODE]);for(c=0;c<a;++c)this.setCell(c,b);this.length=
a}return a.prototype.get=function(a){var c=this._data[3*a],d=2097151&c;return[this._data[3*a+1],2097152&c?this._combined[a]:d?b.stringFromCodePoint(d):"",c>>22,2097152&c?this._combined[a].charCodeAt(this._combined[a].length-1):d]},a.prototype.set=function(a,b){this._data[3*a+1]=b[e.CHAR_DATA_ATTR_INDEX];1<b[e.CHAR_DATA_CHAR_INDEX].length?(this._combined[a]=b[1],this._data[3*a]=2097152|a|b[e.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*a]=b[e.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[e.CHAR_DATA_WIDTH_INDEX]<<
22},a.prototype.getWidth=function(a){return this._data[3*a]>>22},a.prototype.hasWidth=function(a){return 12582912&this._data[3*a]},a.prototype.getFg=function(a){return this._data[3*a+1]},a.prototype.getBg=function(a){return this._data[3*a+2]},a.prototype.hasContent=function(a){return 4194303&this._data[3*a]},a.prototype.getCodePoint=function(a){var b=this._data[3*a];return 2097152&b?this._combined[a].charCodeAt(this._combined[a].length-1):2097151&b},a.prototype.isCombined=function(a){return 2097152&
this._data[3*a]},a.prototype.getString=function(a){var c=this._data[3*a];return 2097152&c?this._combined[a]:2097151&c?b.stringFromCodePoint(2097151&c):""},a.prototype.loadCell=function(a,b){var c=3*a;return b.content=this._data[c+0],b.fg=this._data[c+1],b.bg=this._data[c+2],2097152&b.content&&(b.combinedData=this._combined[a]),b},a.prototype.setCell=function(a,b){2097152&b.content&&(this._combined[a]=b.combinedData);this._data[3*a]=b.content;this._data[3*a+1]=b.fg;this._data[3*a+2]=b.bg},a.prototype.setCellFromCodePoint=
function(a,b,c,d,e){this._data[3*a]=b|c<<22;this._data[3*a+1]=d;this._data[3*a+2]=e},a.prototype.addCodepointToCell=function(a,c){var d=this._data[3*a];2097152&d?this._combined[a]+=b.stringFromCodePoint(c):(2097151&d?(this._combined[a]=b.stringFromCodePoint(2097151&d)+b.stringFromCodePoint(c),d&=-2097152,d|=2097152):d=c|4194304,this._data[3*a]=d)},a.prototype.insertCells=function(a,b,c){if(a%=this.length,b<this.length-a){for(var d=new g.CellData,e=this.length-a-b-1;0<=e;--e)this.setCell(a+b+e,this.loadCell(a+
e,d));for(e=0;e<b;++e)this.setCell(a+e,c)}else for(e=a;e<this.length;++e)this.setCell(e,c)},a.prototype.deleteCells=function(a,b,c){if(a%=this.length,b<this.length-a){for(var d=new g.CellData,e=0;e<this.length-a-b;++e)this.setCell(a+e,this.loadCell(a+b+e,d));e=this.length-b}else e=a;for(;e<this.length;++e)this.setCell(e,c)},a.prototype.replaceCells=function(a,b,c){for(;a<b&&a<this.length;)this.setCell(a++,c)},a.prototype.resize=function(a,b){if(a!==this.length){if(a>this.length){var c=new Uint32Array(3*
a);this.length&&(3*a<this._data.length?c.set(this._data.subarray(0,3*a)):c.set(this._data));this._data=c;for(c=this.length;c<a;++c)this.setCell(c,b)}else if(a)for((c=new Uint32Array(3*a)).set(this._data.subarray(0,3*a)),this._data=c,b=Object.keys(this._combined),c=0;c<b.length;c++){var d=parseInt(b[c],10);d>=a&&delete this._combined[d]}else this._data=new Uint32Array(0),this._combined={};this.length=a}},a.prototype.fill=function(a){this._combined={};for(var b=0;b<this.length;++b)this.setCell(b,a)},
a.prototype.copyFrom=function(a){for(var b in this.length!==a.length?this._data=new Uint32Array(a._data):this._data.set(a._data),this.length=a.length,this._combined={},a._combined)this._combined[b]=a._combined[b];this.isWrapped=a.isWrapped},a.prototype.clone=function(){var b=new a(0),c;for(c in b._data=new Uint32Array(this._data),b.length=this.length,this._combined)b._combined[c]=this._combined[c];return b.isWrapped=this.isWrapped,b},a.prototype.getTrimmedLength=function(){for(var a=this.length-1;0<=
a;--a)if(4194303&this._data[3*a])return a+(this._data[3*a]>>22);return 0},a.prototype.copyCellsFrom=function(a,b,c,d,e){var f=a._data;if(e)for(var g=d-1;0<=g;g--)for(e=0;3>e;e++)this._data[3*(c+g)+e]=f[3*(b+g)+e];else for(g=0;g<d;g++)for(e=0;3>e;e++)this._data[3*(c+g)+e]=f[3*(b+g)+e];d=Object.keys(a._combined);for(e=0;e<d.length;e++)f=parseInt(d[e],10),f>=b&&(this._combined[f-b+c]=a._combined[f])},a.prototype.translateToString=function(a,c,d){void 0===a&&(a=!1);void 0===c&&(c=0);void 0===d&&(d=this.length);
a&&(d=Math.min(d,this.getTrimmedLength()));for(a="";c<d;){var f=this._data[3*c],g=2097151&f;a+=2097152&f?this._combined[c]:g?b.stringFromCodePoint(g):e.WHITESPACE_CELL_CHAR;c+=f>>22||1}return a},a}();c.BufferLine=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});c.promptLabel="Terminal input";c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});c.CHARSETS={};c.DEFAULT_CHARSET=c.CHARSETS.B;
c.CHARSETS[0]={"`":"\u25c6",a:"\u2592",b:"\t",c:"\f",d:"\r",e:"\n",f:"\u00b0",g:"\u00b1",h:"\u2424",i:"\v",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","}":"\u00a3","~":"\u00b7"};c.CHARSETS.A={"#":"\u00a3"};c.CHARSETS.B=null;c.CHARSETS[4]={"#":"\u00a3","@":"\u00be","[":"ij","\\":"\u00bd","]":"|","{":"\u00a8","|":"f","}":"\u00bc","~":"\u00b4"};
c.CHARSETS.C=c.CHARSETS[5]={"[":"\u00c4","\\":"\u00d6","]":"\u00c5","^":"\u00dc","`":"\u00e9","{":"\u00e4","|":"\u00f6","}":"\u00e5","~":"\u00fc"};c.CHARSETS.R={"#":"\u00a3","@":"\u00e0","[":"\u00b0","\\":"\u00e7","]":"\u00a7","{":"\u00e9","|":"\u00f9","}":"\u00e8","~":"\u00a8"};c.CHARSETS.Q={"@":"\u00e0","[":"\u00e2","\\":"\u00e7","]":"\u00ea","^":"\u00ee","`":"\u00f4","{":"\u00e9","|":"\u00f9","}":"\u00e8","~":"\u00fb"};c.CHARSETS.K={"@":"\u00a7","[":"\u00c4","\\":"\u00d6","]":"\u00dc","{":"\u00e4",
"|":"\u00f6","}":"\u00fc","~":"\u00df"};c.CHARSETS.Y={"#":"\u00a3","@":"\u00a7","[":"\u00b0","\\":"\u00e7","]":"\u00e9","`":"\u00f9","{":"\u00e0","|":"\u00f2","}":"\u00e8","~":"\u00ec"};c.CHARSETS.E=c.CHARSETS[6]={"@":"\u00c4","[":"\u00c6","\\":"\u00d8","]":"\u00c5","^":"\u00dc","`":"\u00e4","{":"\u00e6","|":"\u00f8","}":"\u00e5","~":"\u00fc"};c.CHARSETS.Z={"#":"\u00a3","@":"\u00a7","[":"\u00a1","\\":"\u00d1","]":"\u00bf","{":"\u00b0","|":"\u00f1","}":"\u00e7"};c.CHARSETS.H=c.CHARSETS[7]={"@":"\u00c9",
"[":"\u00c4","\\":"\u00d6","]":"\u00c5","^":"\u00dc","`":"\u00e9","{":"\u00e4","|":"\u00f6","}":"\u00e5","~":"\u00fc"};c.CHARSETS["="]={"#":"\u00f9","@":"\u00e0","[":"\u00e9","\\":"\u00e7","]":"\u00ea","^":"\u00ee",_:"\u00e8","`":"\u00f4","{":"\u00e4","|":"\u00f6","}":"\u00fc","~":"\u00fb"}},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(15);c.wcwidth=function(a){var c=[[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]],d=[[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]],e=0|a.control,f=new Uint8Array(65536);b.fill(f,1);f[0]=a.nul;b.fill(f,a.control,1,32);b.fill(f,a.control,127,160);b.fill(f,2,4352,4448);f[9001]=2;f[9002]=2;b.fill(f,2,11904,42192);f[12351]=1;b.fill(f,2,44032,55204);b.fill(f,2,63744,64256);b.fill(f,2,65040,65050);b.fill(f,2,65072,65136);b.fill(f,2,65280,65377);b.fill(f,2,65504,65511);for(a=0;a<c.length;++a)b.fill(f,
0,c[a][0],c[a][1]+1);return function(a){if(32>a)a=0|e;else if(127>a)a=1;else if(65536>a)a=f[a];else{a:{var b=a;var c,g=0,h=d.length-1;if(!(b<d[0][0]||b>d[h][1]))for(;h>=g;)if(b>d[c=g+h>>1][1])g=c+1;else{if(!(b<d[c][0])){b=!0;break a}h=c-1}b=!1}a=b?0:131072<=a&&196605>=a||196608<=a&&262141>=a?2:1}return a}}({nul:0,control:0});c.getStringCellWidth=function(a){for(var b=0,d=a.length,e=0;e<d;++e){var f=a.charCodeAt(e);if(55296<=f&&56319>=f){if(++e>=d)return b+c.wcwidth(f);var h=a.charCodeAt(e);56320<=
h&&57343>=h?f=1024*(f-55296)+h-56320+65536:b+=c.wcwidth(h)}b+=c.wcwidth(f)}return b}},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=function(){function a(a,b){if(void 0===a&&(a=32),void 0===b&&(b=32),this.maxLength=a,this.maxSubParamsLength=b,256<b)throw Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(a);this.length=0;this._subParams=new Int32Array(b);this._subParamsLength=0;this._subParamsIdx=new Uint16Array(a);this._digitIsSub=this._rejectSubDigits=
this._rejectDigits=!1}return a.fromArray=function(b){var c=new a;if(!b.length)return c;for(var d=b[0]instanceof Array?1:0;d<b.length;++d){var e=b[d];if(e instanceof Array)for(var f=0;f<e.length;++f)c.addSubParam(e[f]);else c.addParam(e)}return c},a.prototype.clone=function(){var b=new a(this.maxLength,this.maxSubParamsLength);return b.params.set(this.params),b.length=this.length,b._subParams.set(this._subParams),b._subParamsLength=this._subParamsLength,b._subParamsIdx.set(this._subParamsIdx),b._rejectDigits=
this._rejectDigits,b._rejectSubDigits=this._rejectSubDigits,b._digitIsSub=this._digitIsSub,b},a.prototype.toArray=function(){for(var a=[],b=0;b<this.length;++b){a.push(this.params[b]);var c=this._subParamsIdx[b]>>8,d=255&this._subParamsIdx[b];0<d-c&&a.push(Array.prototype.slice.call(this._subParams,c,d))}return a},a.prototype.reset=function(){this._subParamsLength=this.length=0;this._digitIsSub=this._rejectSubDigits=this._rejectDigits=!1},a.prototype.addParam=function(a){if(this._digitIsSub=!1,this.length>=
this.maxLength)this._rejectDigits=!0;else{if(-1>a)throw Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength;this.params[this.length++]=2147483647<a?2147483647:a}},a.prototype.addSubParam=function(a){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(-1>a)throw Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=
2147483647<a?2147483647:a;this._subParamsIdx[this.length-1]++}},a.prototype.hasSubParams=function(a){return 0<(255&this._subParamsIdx[a])-(this._subParamsIdx[a]>>8)},a.prototype.getSubParams=function(a){var b=this._subParamsIdx[a]>>8;a=255&this._subParamsIdx[a];return 0<a-b?this._subParams.subarray(b,a):null},a.prototype.getSubParamsAll=function(){for(var a={},b=0;b<this.length;++b){var c=this._subParamsIdx[b]>>8,d=255&this._subParamsIdx[b];0<d-c&&(a[b]=this._subParams.slice(c,d))}return a},a.prototype.addDigit=
function(a){var b;if(!(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var c=this._digitIsSub?this._subParams:this.params,d=c[b-1];c[b-1]=~d?Math.min(10*d+a,2147483647):a}},a}();c.Params=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(22),e=d(8);a=function(){function a(){this._state=0;this._id=-1;this._handlers=Object.create(null);this._handlerFb=function(){}}return a.prototype.addHandler=function(a,
b){void 0===this._handlers[a]&&(this._handlers[a]=[]);var c=this._handlers[a];return c.push(b),{dispose:function(){var a=c.indexOf(b);-1!==a&&c.splice(a,1)}}},a.prototype.setHandler=function(a,b){this._handlers[a]=[b]},a.prototype.clearHandler=function(a){this._handlers[a]&&delete this._handlers[a]},a.prototype.setHandlerFallback=function(a){this._handlerFb=a},a.prototype.dispose=function(){this._handlers=Object.create(null);this._handlerFb=function(){}},a.prototype.reset=function(){2===this._state&&
this.end(!1);this._id=-1;this._state=0},a.prototype._start=function(){var a=this._handlers[this._id];if(a)for(var b=a.length-1;0<=b;b--)a[b].start();else this._handlerFb(this._id,"START")},a.prototype._put=function(a,b,c){var d=this._handlers[this._id];if(d)for(var f=d.length-1;0<=f;f--)d[f].put(a,b,c);else this._handlerFb(this._id,"PUT",e.utf32ToString(a,b,c))},a.prototype._end=function(a){var b=this._handlers[this._id];if(b){for(var c=b.length-1;0<=c&&!1===b[c].end(a);c--);for(c--;0<=c;c--)b[c].end(!1)}else this._handlerFb(this._id,
"END",a)},a.prototype.start=function(){this.reset();this._id=-1;this._state=1},a.prototype.put=function(a,b,c){if(3!==this._state){if(1===this._state)for(;b<c;){var d=a[b++];if(59===d){this._state=2;this._start();break}if(48>d||57<d)return void(this._state=3);-1===this._id&&(this._id=0);this._id=10*this._id+d-48}2===this._state&&0<c-b&&this._put(a,b,c)}},a.prototype.end=function(a){0!==this._state&&(3!==this._state&&(1===this._state&&this._start(),this._end(a)),this._id=-1,this._state=0)},a}();c.OscParser=
a;a=function(){function a(a){this._handler=a;this._data="";this._hitLimit=!1}return a.prototype.start=function(){this._data="";this._hitLimit=!1},a.prototype.put=function(a,c,d){this._hitLimit||(this._data+=e.utf32ToString(a,c,d),this._data.length>b.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},a.prototype.end=function(a){var b;return this._hitLimit?b=!1:a&&(b=this._handler(this._data)),this._data="",this._hitLimit=!1,b},a}();c.OscHandler=a},function(a,c,d){Object.defineProperty(c,"__esModule",
{value:!0});c.PAYLOAD_LIMIT=1E7},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(8),e=d(20),g=d(22),k=[];a=function(){function a(){this._handlers=Object.create(null);this._active=k;this._ident=0;this._handlerFb=function(){}}return a.prototype.dispose=function(){this._handlers=Object.create(null);this._handlerFb=function(){}},a.prototype.addHandler=function(a,b){void 0===this._handlers[a]&&(this._handlers[a]=[]);var c=this._handlers[a];return c.push(b),{dispose:function(){var a=
c.indexOf(b);-1!==a&&c.splice(a,1)}}},a.prototype.setHandler=function(a,b){this._handlers[a]=[b]},a.prototype.clearHandler=function(a){this._handlers[a]&&delete this._handlers[a]},a.prototype.setHandlerFallback=function(a){this._handlerFb=a},a.prototype.reset=function(){this._active.length&&this.unhook(!1);this._active=k;this._ident=0},a.prototype.hook=function(a,b){if(this.reset(),this._ident=a,this._active=this._handlers[a]||k,this._active.length)for(a=this._active.length-1;0<=a;a--)this._active[a].hook(b);
else this._handlerFb(this._ident,"HOOK",b)},a.prototype.put=function(a,c,d){if(this._active.length)for(var e=this._active.length-1;0<=e;e--)this._active[e].put(a,c,d);else this._handlerFb(this._ident,"PUT",b.utf32ToString(a,c,d))},a.prototype.unhook=function(a){if(this._active.length){for(var b=this._active.length-1;0<=b&&!1===this._active[b].unhook(a);b--);for(b--;0<=b;b--)this._active[b].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",a);this._active=k;this._ident=0},a}();c.DcsParser=a;a=function(){function a(a){this._handler=
a;this._data="";this._hitLimit=!1}return a.prototype.hook=function(a){this._params=a.clone();this._data="";this._hitLimit=!1},a.prototype.put=function(a,c,d){this._hitLimit||(this._data+=b.utf32ToString(a,c,d),this._data.length>g.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},a.prototype.unhook=function(a){var b;return this._hitLimit?b=!1:a&&(b=this._handler(this._data,this._params?this._params:new e.Params)),this._params=void 0,this._data="",this._hitLimit=!1,b},a}();c.DcsHandler=a},function(a,
c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(25),e=d(43),g=[];c.acquireCharAtlas=function(a,c,d,f,h){a=b.generateConfig(f,h,a,d);for(d=0;d<g.length;d++)if(f=(h=g[d]).ownedBy.indexOf(c),0<=f){if(b.configEquals(h.config,a))return h.atlas;1===h.ownedBy.length?(h.atlas.dispose(),g.splice(d,1)):h.ownedBy.splice(f,1);break}for(d=0;d<g.length;d++)if(h=g[d],b.configEquals(h.config,a))return h.ownedBy.push(c),h.atlas;c={atlas:new e.DynamicCharAtlas(document,a),config:a,ownedBy:[c]};return g.push(c),
c.atlas};c.removeTerminalFromCache=function(a){for(var b=0;b<g.length;b++){var c=g[b].ownedBy.indexOf(a);if(-1!==c){1===g[b].ownedBy.length?(g[b].atlas.dispose(),g.splice(b,1)):g[b].ownedBy.splice(c,1);break}}}},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(3);c.generateConfig=function(a,b,c,d){d={foreground:d.foreground,background:d.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:d.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:a,
scaledCharHeight:b,fontFamily:c.fontFamily,fontSize:c.fontSize,fontWeight:c.fontWeight,fontWeightBold:c.fontWeightBold,allowTransparency:c.allowTransparency,colors:d}};c.configEquals=function(a,b){for(var c=0;c<a.colors.ansi.length;c++)if(a.colors.ansi[c].rgba!==b.colors.ansi[c].rgba)return!1;return a.devicePixelRatio===b.devicePixelRatio&&a.fontFamily===b.fontFamily&&a.fontSize===b.fontSize&&a.fontWeight===b.fontWeight&&a.fontWeightBold===b.fontWeightBold&&a.allowTransparency===b.allowTransparency&&
a.scaledCharWidth===b.scaledCharWidth&&a.scaledCharHeight===b.scaledCharHeight&&a.colors.foreground===b.colors.foreground&&a.colors.background===b.colors.background};c.is256Color=function(a){return a<b.DEFAULT_COLOR}},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(10),e=d(45),g=b.fromCss("#ffffff"),k=b.fromCss("#000000"),q=b.fromCss("#ffffff"),t=b.fromCss("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=function(){for(var a=[b.fromCss("#2e3436"),
b.fromCss("#cc0000"),b.fromCss("#4e9a06"),b.fromCss("#c4a000"),b.fromCss("#3465a4"),b.fromCss("#75507b"),b.fromCss("#06989a"),b.fromCss("#d3d7cf"),b.fromCss("#555753"),b.fromCss("#ef2929"),b.fromCss("#8ae234"),b.fromCss("#fce94f"),b.fromCss("#729fcf"),b.fromCss("#ad7fa8"),b.fromCss("#34e2e2"),b.fromCss("#eeeeec")],c=[0,95,135,175,215,255],d=0;216>d;d++){var e=c[d/36%6|0],f=c[d/6%6|0],g=c[d%6];a.push({css:b.toCss(e,f,g),rgba:b.toRgba(e,f,g)})}for(d=0;24>d;d++)c=8+10*d,a.push({css:b.toCss(c,c,c),rgba:b.toRgba(c,
c,c)});return a}();a=function(){function a(a,d){this.allowTransparency=d;a=a.createElement("canvas");a.width=1;a.height=1;a=a.getContext("2d");if(!a)throw Error("Could not get rendering context");this._ctx=a;this._ctx.globalCompositeOperation="copy";this._litmusColor=this._ctx.createLinearGradient(0,0,1,1);this._contrastCache=new e.ColorContrastCache;this.colors={foreground:g,background:k,cursor:q,cursorAccent:t,selection:p,selectionOpaque:b.blend(k,p),ansi:c.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}
return a.prototype.onOptionsChange=function(a){"minimumContrastRatio"===a&&this._contrastCache.clear()},a.prototype.setTheme=function(a){void 0===a&&(a={});this.colors.foreground=this._parseColor(a.foreground,g);this.colors.background=this._parseColor(a.background,k);this.colors.cursor=this._parseColor(a.cursor,q,!0);this.colors.cursorAccent=this._parseColor(a.cursorAccent,t,!0);this.colors.selection=this._parseColor(a.selection,p,!0);this.colors.selectionOpaque=b.blend(this.colors.background,this.colors.selection);
this.colors.ansi[0]=this._parseColor(a.black,c.DEFAULT_ANSI_COLORS[0]);this.colors.ansi[1]=this._parseColor(a.red,c.DEFAULT_ANSI_COLORS[1]);this.colors.ansi[2]=this._parseColor(a.green,c.DEFAULT_ANSI_COLORS[2]);this.colors.ansi[3]=this._parseColor(a.yellow,c.DEFAULT_ANSI_COLORS[3]);this.colors.ansi[4]=this._parseColor(a.blue,c.DEFAULT_ANSI_COLORS[4]);this.colors.ansi[5]=this._parseColor(a.magenta,c.DEFAULT_ANSI_COLORS[5]);this.colors.ansi[6]=this._parseColor(a.cyan,c.DEFAULT_ANSI_COLORS[6]);this.colors.ansi[7]=
this._parseColor(a.white,c.DEFAULT_ANSI_COLORS[7]);this.colors.ansi[8]=this._parseColor(a.brightBlack,c.DEFAULT_ANSI_COLORS[8]);this.colors.ansi[9]=this._parseColor(a.brightRed,c.DEFAULT_ANSI_COLORS[9]);this.colors.ansi[10]=this._parseColor(a.brightGreen,c.DEFAULT_ANSI_COLORS[10]);this.colors.ansi[11]=this._parseColor(a.brightYellow,c.DEFAULT_ANSI_COLORS[11]);this.colors.ansi[12]=this._parseColor(a.brightBlue,c.DEFAULT_ANSI_COLORS[12]);this.colors.ansi[13]=this._parseColor(a.brightMagenta,c.DEFAULT_ANSI_COLORS[13]);
this.colors.ansi[14]=this._parseColor(a.brightCyan,c.DEFAULT_ANSI_COLORS[14]);this.colors.ansi[15]=this._parseColor(a.brightWhite,c.DEFAULT_ANSI_COLORS[15]);this._contrastCache.clear()},a.prototype._parseColor=function(a,c,d){if(void 0===d&&(d=this.allowTransparency),void 0===a)return c;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=a,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+a+" is invalid using fallback "+c.css),c;this._ctx.fillRect(0,0,1,1);var e=this._ctx.getImageData(0,
0,1,1).data;if(255!==e[3]){if(!d)return console.warn("Color: "+a+" is using transparency, but allowTransparency is false. Using fallback "+c.css+"."),c;if(5===a.length){e=parseInt(a.substr(1),16);a=16*(e>>12&15);c=16*(e>>8&15);d=16*(e>>4&15);e=16*(15&e);var f=b.toRgba(a,c,d,e)}else a=(f=parseInt(a.substr(1),16))>>24&255,c=f>>16&255,d=f>>8&255,e=255&f;return{rgba:f,css:b.toCss(a,c,d,e)}}return{css:a,rgba:b.toRgba(e[0],e[1],e[2],e[3])}},a}();c.ColorManager=a},function(a,c,d){Object.defineProperty(c,
"__esModule",{value:!0});c.throwIfFalsy=function(a){if(!a)throw Error("value must not be falsy");return a}},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)});Object.defineProperty(c,"__esModule",{value:!0});
a=d(6);var g=d(3),k=d(5);d=function(a){function b(b,c,d){var e=a.call(this)||this;return e.content=0,e.fg=b.fg,e.bg=b.bg,e.combinedData=c,e._width=d,e}return e(b,a),b.prototype.isCombined=function(){return 2097152},b.prototype.getWidth=function(){return this._width},b.prototype.getChars=function(){return this.combinedData},b.prototype.getCode=function(){return 2097151},b.prototype.setFromCharData=function(a){throw Error("not implemented");},b.prototype.getAsCharData=function(){return[this.fg,this.getChars(),
this.getWidth(),this.getCode()]},b}(a.AttributeData);c.JoinedCellData=d;d=function(){function a(a){this._bufferService=a;this._characterJoiners=[];this._nextCharacterJoinerId=0;this._workCell=new k.CellData}return a.prototype.registerCharacterJoiner=function(a){a={id:this._nextCharacterJoinerId++,handler:a};return this._characterJoiners.push(a),a.id},a.prototype.deregisterCharacterJoiner=function(a){for(var b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===a)return this._characterJoiners.splice(b,
1),!0;return!1},a.prototype.getJoinedCharacters=function(a){if(0===this._characterJoiners.length)return[];a=this._bufferService.buffer.lines.get(a);if(!a||0===a.length)return[];for(var b=[],c=a.translateToString(!0),d=0,e=0,f=0,h=a.getFg(0),t=a.getBg(0),k=0;k<a.getTrimmedLength();k++)if(a.loadCell(k,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==h||this._workCell.bg!==t){if(1<k-d)for(d=this._getJoinedRanges(c,f,e,a,d),f=0;f<d.length;f++)b.push(d[f]);d=k;f=e;h=this._workCell.fg;
t=this._workCell.bg}e+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(1<this._bufferService.cols-d)for(d=this._getJoinedRanges(c,f,e,a,d),f=0;f<d.length;f++)b.push(d[f]);return b},a.prototype._getJoinedRanges=function(b,c,d,e,f){b=b.substring(c,d);c=this._characterJoiners[0].handler(b);for(d=1;d<this._characterJoiners.length;d++)for(var g=this._characterJoiners[d].handler(b),h=0;h<g.length;h++)a._mergeRanges(c,g[h]);return this._stringRangesToCellRanges(c,e,f),c},a.prototype._stringRangesToCellRanges=
function(a,b,c){var d=0,e=!1,f=0,h=a[d];if(h){for(;c<this._bufferService.cols;c++){var v=b.getWidth(c),k=b.getString(c).length||g.WHITESPACE_CELL_CHAR.length;if(0!==v){if(!e&&h[0]<=f&&(h[0]=c,e=!0),h[1]<=f){if(h[1]=c,!(h=a[++d]))break;h[0]<=f?(h[0]=c,e=!0):e=!1}f+=k}}h&&(h[1]=this._bufferService.cols)}},a._mergeRanges=function(a,b){for(var c=!1,d=0;d<a.length;d++){var e=a[d];if(c){if(b[1]<=e[0])return a[d-1][1]=b[1],a;if(b[1]<=e[1])return a[d-1][1]=Math.max(b[1],e[1]),a.splice(d,1),a;a.splice(d,1);
d--}else{if(b[1]<=e[0])return a.splice(d,0,b),a;if(b[1]<=e[1])return e[0]=Math.min(b[0],e[0]),a;b[0]<e[1]&&(e[0]=Math.min(b[0],e[0]),c=!0)}}return c?a[a.length-1][1]=b[1]:a.push(b),a},a}();c.CharacterJoinerRegistry=d},function(a,c,d){function b(a,b){b=b.getBoundingClientRect();return[a.clientX-b.left,a.clientY-b.top]}Object.defineProperty(c,"__esModule",{value:!0});c.getCoordsRelativeToElement=b;c.getCoords=function(a,c,d,e,f,p,v,n){if(f&&(a=b(a,c)))return a[0]=Math.ceil((a[0]+(n?p/2:0))/p),a[1]=
Math.ceil(a[1]/v),a[0]=Math.min(Math.max(a[0],1),d+(n?1:0)),a[1]=Math.min(Math.max(a[1],1),e),a};c.getRawByteCoords=function(a){if(a)return{x:a[0]+32,y:a[1]+32}}},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=function(){function a(a){this._renderCallback=a}return a.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},a.prototype.refresh=function(a,b,c){var d=this;this._rowCount=c;a=void 0!==a?a:0;b=
void 0!==b?b:this._rowCount-1;this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,a):a;this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,b):b;this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return d._innerRefresh()}))},a.prototype._innerRefresh=function(){void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(this._rowStart=Math.max(this._rowStart,0),this._rowEnd=Math.min(this._rowEnd,this._rowCount-1),this._renderCallback(this._rowStart,
this._rowEnd),this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0)},a}();c.RenderDebouncer=a},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)});Object.defineProperty(c,"__esModule",
{value:!0});a=function(a){function b(){var b=null!==a&&a.apply(this,arguments)||this;return b._currentDevicePixelRatio=window.devicePixelRatio,b}return e(b,a),b.prototype.setListener=function(a){var b=this;this._listener&&this.clearListener();this._listener=a;this._outerListener=function(){b._listener&&(b._listener(window.devicePixelRatio,b._currentDevicePixelRatio),b._updateDpr())};this._updateDpr()},b.prototype.dispose=function(){a.prototype.dispose.call(this);this.clearListener()},b.prototype._updateDpr=
function(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},b.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),
this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},b}(d(2).Disposable);c.ScreenDprMonitor=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});c.clone=function k(a,b){if(void 0===b&&(b=5),"object"!=typeof a)return a;var c=Array.isArray(a)?[]:{},d;for(d in a)c[d]=1>=b?a[d]:a[d]?k(a[d],b-1):a[d];return c}},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(34),e=d(17),g=d(78);a=function(){function a(a){this._core=new b.Terminal(a);
this._addonManager=new g.AddonManager}return Object.defineProperty(a.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onData",{get:function(){return this._core.onData},
enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!0,
configurable:!0}),Object.defineProperty(a.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"element",{get:function(){return this._core.element},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"parser",{get:function(){return this._parser||(this._parser=new p(this._core)),this._parser},
enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"rows",{get:function(){return this._core.rows},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"cols",{get:function(){return this._core.cols},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"buffer",{get:function(){return new k(this._core.buffer)},enumerable:!0,configurable:!0}),
Object.defineProperty(a.prototype,"markers",{get:function(){return this._core.markers},enumerable:!0,configurable:!0}),a.prototype.blur=function(){this._core.blur()},a.prototype.focus=function(){this._core.focus()},a.prototype.resize=function(a,b){this._verifyIntegers(a,b);this._core.resize(a,b)},a.prototype.open=function(a){this._core.open(a)},a.prototype.attachCustomKeyEventHandler=function(a){this._core.attachCustomKeyEventHandler(a)},a.prototype.registerLinkMatcher=function(a,b,c){return this._core.registerLinkMatcher(a,
b,c)},a.prototype.deregisterLinkMatcher=function(a){this._core.deregisterLinkMatcher(a)},a.prototype.registerCharacterJoiner=function(a){return this._core.registerCharacterJoiner(a)},a.prototype.deregisterCharacterJoiner=function(a){this._core.deregisterCharacterJoiner(a)},a.prototype.addMarker=function(a){return this._verifyIntegers(a),this._core.addMarker(a)},a.prototype.hasSelection=function(){return this._core.hasSelection()},a.prototype.select=function(a,b,c){this._verifyIntegers(a,b,c);this._core.select(a,
b,c)},a.prototype.getSelection=function(){return this._core.getSelection()},a.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},a.prototype.clearSelection=function(){this._core.clearSelection()},a.prototype.selectAll=function(){this._core.selectAll()},a.prototype.selectLines=function(a,b){this._verifyIntegers(a,b);this._core.selectLines(a,b)},a.prototype.dispose=function(){this._addonManager.dispose();this._core.dispose()},a.prototype.scrollLines=function(a){this._verifyIntegers(a);
this._core.scrollLines(a)},a.prototype.scrollPages=function(a){this._verifyIntegers(a);this._core.scrollPages(a)},a.prototype.scrollToTop=function(){this._core.scrollToTop()},a.prototype.scrollToBottom=function(){this._core.scrollToBottom()},a.prototype.scrollToLine=function(a){this._verifyIntegers(a);this._core.scrollToLine(a)},a.prototype.clear=function(){this._core.clear()},a.prototype.write=function(a,b){this._core.write(a,b)},a.prototype.writeUtf8=function(a,b){this._core.write(a,b)},a.prototype.writeln=
function(a,b){this._core.write(a);this._core.write("\r\n",b)},a.prototype.paste=function(a){this._core.paste(a)},a.prototype.getOption=function(a){return this._core.optionsService.getOption(a)},a.prototype.setOption=function(a,b){this._core.optionsService.setOption(a,b)},a.prototype.refresh=function(a,b){this._verifyIntegers(a,b);this._core.refresh(a,b)},a.prototype.reset=function(){this._core.reset()},a.prototype.loadAddon=function(a){return this._addonManager.loadAddon(this,a)},Object.defineProperty(a,
"strings",{get:function(){return e},enumerable:!0,configurable:!0}),a.prototype._verifyIntegers=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];a.forEach(function(a){if(a===1/0||isNaN(a)||0!=a%1)throw Error("This API only accepts integers");})},a}();c.Terminal=a;var k=function(){function a(a){this._buffer=a}return Object.defineProperty(a.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"cursorX",{get:function(){return this._buffer.x},
enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!0,configurable:!0}),a.prototype.getLine=function(a){if(a=this._buffer.lines.get(a))return new q(a)},a}(),q=function(){function a(a){this._line=
a}return Object.defineProperty(a.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!0,configurable:!0}),a.prototype.getCell=function(a){if(!(0>a||a>=this._line.length))return new t(this._line,a)},a.prototype.translateToString=function(a,b,c){return this._line.translateToString(a,b,c)},a}(),t=function(){function a(a,b){this._line=a;this._x=b}return Object.defineProperty(a.prototype,"char",{get:function(){return this._line.getString(this._x)},enumerable:!0,configurable:!0}),
Object.defineProperty(a.prototype,"width",{get:function(){return this._line.getWidth(this._x)},enumerable:!0,configurable:!0}),a}(),p=function(){function a(a){this._core=a}return a.prototype.addCsiHandler=function(a,b){return this._core.addCsiHandler(a,function(a){return b(a.toArray())})},a.prototype.addDcsHandler=function(a,b){return this._core.addDcsHandler(a,function(a,c){return b(a,c.toArray())})},a.prototype.addEscHandler=function(a,b){return this._core.addEscHandler(a,b)},a.prototype.addOscHandler=
function(a,b){return this._core.addOscHandler(a,b)},a}()},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)});Object.defineProperty(c,"__esModule",{value:!0});var g=d(35),k=d(36),q=d(37),t=d(12),p=d(38),
v=d(40),n=d(50),r=d(51),x=d(11),D=d(7),H=d(17),La=d(54),Da=d(55),Pb=d(56),Dc=d(57),Gh=d(59),B=d(1),X=d(16),Ma=d(60),sa=d(26),Ac=d(61),T=d(0),Wa=d(62),u=d(4),z=d(63),lb=d(64);a=d(2);var A=d(70),Qb=d(71),M=d(72),C=d(73),I=d(74),J=d(75),E=d(76),G=d(77),F="undefined"!=typeof window?window.document:null;d=function(a){function b(b){void 0===b&&(b={});var c=a.call(this)||this;return c.browser=x,c.mouseEvents=0,c._keyDownHandled=!1,c._blankLine=null,c._onCursorMove=new B.EventEmitter,c._onData=new B.EventEmitter,
c._onBinary=new B.EventEmitter,c._onKey=new B.EventEmitter,c._onLineFeed=new B.EventEmitter,c._onRender=new B.EventEmitter,c._onResize=new B.EventEmitter,c._onScroll=new B.EventEmitter,c._onSelectionChange=new B.EventEmitter,c._onTitleChange=new B.EventEmitter,c._onFocus=new B.EventEmitter,c._onBlur=new B.EventEmitter,c.onA11yCharEmitter=new B.EventEmitter,c.onA11yTabEmitter=new B.EventEmitter,c._instantiationService=new I.InstantiationService,c.optionsService=new Wa.OptionsService(b),c._instantiationService.setService(T.IOptionsService,
c.optionsService),c._bufferService=c._instantiationService.createInstance(lb.BufferService),c._instantiationService.setService(T.IBufferService,c._bufferService),c._logService=c._instantiationService.createInstance(M.LogService),c._instantiationService.setService(T.ILogService,c._logService),c._coreService=c._instantiationService.createInstance(Qb.CoreService,function(){return c.scrollToBottom()}),c._instantiationService.setService(T.ICoreService,c._coreService),c._coreService.onData(function(a){return c._onData.fire(a)}),
c._coreService.onBinary(function(a){return c._onBinary.fire(a)}),c._coreMouseService=c._instantiationService.createInstance(J.CoreMouseService),c._instantiationService.setService(T.ICoreMouseService,c._coreMouseService),c._dirtyRowService=c._instantiationService.createInstance(C.DirtyRowService),c._instantiationService.setService(T.IDirtyRowService,c._dirtyRowService),c._setupOptionsListeners(),c._setup(),c._writeBuffer=new E.WriteBuffer(function(a){return c._inputHandler.parse(a)}),c}return e(b,
a),Object.defineProperty(b.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),
Object.defineProperty(b.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,
"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,
"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onA11yChar",{get:function(){return this.onA11yCharEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,
"onA11yTab",{get:function(){return this.onA11yTabEmitter.event},enumerable:!0,configurable:!0}),b.prototype.dispose=function(){var b,c,d,e;this._isDisposed||(a.prototype.dispose.call(this),null===(b=this._windowsMode)||void 0===b||b.dispose(),this._windowsMode=void 0,null===(c=this._renderService)||void 0===c||c.dispose(),this._customKeyEventHandler=null,this.write=function(){},null===(e=null===(d=this.element)||void 0===d?void 0:d.parentNode)||void 0===e||e.removeChild(this.element))},b.prototype._setup=
function(){var a=this;this._parent=F?F.body:null;this._customKeyEventHandler=null;this.insertMode=this.originMode=this.applicationKeypad=!1;this.wraparoundMode=!0;this.bracketedPasteMode=!1;this.gcharset=this.charset=null;this.glevel=0;this.charsets=[null];this.curAttrData=X.DEFAULT_ATTR_DATA.clone();this._eraseAttrData=X.DEFAULT_ATTR_DATA.clone();this.params=[];this.currentParam=0;this._userScrolling=!1;this._inputHandler=new p.InputHandler(this,this._bufferService,this._coreService,this._dirtyRowService,
this._logService,this.optionsService,this._coreMouseService);this._inputHandler.onCursorMove(function(){return a._onCursorMove.fire()});this._inputHandler.onLineFeed(function(){return a._onLineFeed.fire()});this.register(this._inputHandler);this.linkifier=this.linkifier||new n.Linkifier(this._bufferService,this._logService);this.options.windowsMode&&this._enableWindowsMode()},b.prototype._enableWindowsMode=function(){this._windowsMode||(this._windowsMode=this.onLineFeed(Ma.handleWindowsModeLineFeed.bind(null,
this._bufferService)))},Object.defineProperty(b.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!0,configurable:!0}),b.prototype.eraseAttrData=function(){return this._eraseAttrData.bg&=-67108864,this._eraseAttrData.bg|=67108863&this.curAttrData.bg,this._eraseAttrData},b.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},
b.prototype._setupOptionsListeners=function(){var a=this;this.optionsService.onOptionChange(function(b){var c,d,e,f,g;switch(b){case "fontFamily":case "fontSize":null===(c=a._renderService)||void 0===c||c.clear();null===(d=a._charSizeService)||void 0===d||d.measure();break;case "drawBoldTextInBrightColors":case "letterSpacing":case "lineHeight":case "fontWeight":case "fontWeightBold":case "minimumContrastRatio":a._renderService&&(a._renderService.clear(),a._renderService.onResize(a.cols,a.rows),a.refresh(0,
a.rows-1));break;case "rendererType":a._renderService&&(a._renderService.setRenderer(a._createRenderer()),a._renderService.onResize(a.cols,a.rows));break;case "scrollback":a.buffers.resize(a.cols,a.rows);null===(e=a.viewport)||void 0===e||e.syncScrollArea();break;case "screenReaderMode":a.optionsService.options.screenReaderMode?!a._accessibilityManager&&a._renderService&&(a._accessibilityManager=new Pb.AccessibilityManager(a,a._renderService)):(null===(f=a._accessibilityManager)||void 0===f||f.dispose(),
a._accessibilityManager=null);break;case "tabStopWidth":a.buffers.setupTabStops();break;case "theme":a._setTheme(a.optionsService.options.theme);break;case "windowsMode":a.optionsService.options.windowsMode?a._enableWindowsMode():(null===(g=a._windowsMode)||void 0===g||g.dispose(),a._windowsMode=void 0)}})},b.prototype._onTextAreaFocus=function(a){this.sendFocus&&this._coreService.triggerDataEvent(t.C0.ESC+"[I");this.updateCursorStyle(a);this.element.classList.add("focus");this.showCursor();this._onFocus.fire()},
b.prototype.blur=function(){return this.textarea.blur()},b.prototype._onTextAreaBlur=function(){this.textarea.value="";this.refresh(this.buffer.y,this.buffer.y);this.sendFocus&&this._coreService.triggerDataEvent(t.C0.ESC+"[O");this.element.classList.remove("focus");this._onBlur.fire()},b.prototype._initGlobal=function(){var a=this;this._bindKeys();this.register(D.addDisposableDomListener(this.element,"copy",function(b){a.hasSelection()&&q.copyHandler(b,a._selectionService)}));var b=function(b){return q.handlePasteEvent(b,
a.textarea,a.bracketedPasteMode,a._coreService)};this.register(D.addDisposableDomListener(this.textarea,"paste",b));this.register(D.addDisposableDomListener(this.element,"paste",b));x.isFirefox?this.register(D.addDisposableDomListener(this.element,"mousedown",function(b){2===b.button&&q.rightClickHandler(b,a.textarea,a.screenElement,a._selectionService,a.options.rightClickSelectsWord)})):this.register(D.addDisposableDomListener(this.element,"contextmenu",function(b){q.rightClickHandler(b,a.textarea,
a.screenElement,a._selectionService,a.options.rightClickSelectsWord)}));x.isLinux&&this.register(D.addDisposableDomListener(this.element,"auxclick",function(b){1===b.button&&q.moveTextAreaUnderMouseCursor(b,a.textarea,a.screenElement)}))},b.prototype._bindKeys=function(){var a=this;this.register(D.addDisposableDomListener(this.textarea,"keyup",function(b){return a._keyUp(b)},!0));this.register(D.addDisposableDomListener(this.textarea,"keydown",function(b){return a._keyDown(b)},!0));this.register(D.addDisposableDomListener(this.textarea,
"keypress",function(b){return a._keyPress(b)},!0));this.register(D.addDisposableDomListener(this.textarea,"compositionstart",function(){return a._compositionHelper.compositionstart()}));this.register(D.addDisposableDomListener(this.textarea,"compositionupdate",function(b){return a._compositionHelper.compositionupdate(b)}));this.register(D.addDisposableDomListener(this.textarea,"compositionend",function(){return a._compositionHelper.compositionend()}));this.register(this.onRender(function(){return a._compositionHelper.updateCompositionElements()}));
this.register(this.onRender(function(b){return a._queueLinkification(b.start,b.end)}))},b.prototype.open=function(a){var b=this;if(this._parent=a||this._parent,!this._parent)throw Error("Terminal requires a parent element.");F.body.contains(a)||this._logService.warn("Terminal.open was called on an element that was not attached to the DOM");this._document=this._parent.ownerDocument;this.element=this._document.createElement("div");this.element.dir="ltr";this.element.classList.add("terminal");this.element.classList.add("xterm");
this.element.setAttribute("tabindex","0");this._parent.appendChild(this.element);a=F.createDocumentFragment();this._viewportElement=F.createElement("div");this._viewportElement.classList.add("xterm-viewport");a.appendChild(this._viewportElement);this._viewportScrollArea=F.createElement("div");this._viewportScrollArea.classList.add("xterm-scroll-area");this._viewportElement.appendChild(this._viewportScrollArea);this.screenElement=F.createElement("div");this.screenElement.classList.add("xterm-screen");
this._helperContainer=F.createElement("div");this._helperContainer.classList.add("xterm-helpers");this.screenElement.appendChild(this._helperContainer);a.appendChild(this.screenElement);this.textarea=F.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea");this.textarea.setAttribute("aria-label",H.promptLabel);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(D.addDisposableDomListener(this.textarea,"focus",function(a){return b._onTextAreaFocus(a)}));this.register(D.addDisposableDomListener(this.textarea,"blur",function(){return b._onTextAreaBlur()}));this._helperContainer.appendChild(this.textarea);var c=this._instantiationService.createInstance(G.CoreBrowserService,this.textarea);this._instantiationService.setService(u.ICoreBrowserService,c);this._charSizeService=this._instantiationService.createInstance(z.CharSizeService,
this._document,this._helperContainer);this._instantiationService.setService(u.ICharSizeService,this._charSizeService);this._compositionView=F.createElement("div");this._compositionView.classList.add("composition-view");this._compositionHelper=this._instantiationService.createInstance(g.CompositionHelper,this.textarea,this._compositionView);this._helperContainer.appendChild(this._compositionView);this.element.appendChild(a);this._theme=this.options.theme||this._theme;this.options.theme=void 0;this._colorManager=
new sa.ColorManager(F,this.options.allowTransparency);this.optionsService.onOptionChange(function(a){return b._colorManager.onOptionsChange(a)});this._colorManager.setTheme(this._theme);a=this._createRenderer();this._renderService=this._instantiationService.createInstance(Ac.RenderService,a,this.rows,this.screenElement);this._instantiationService.setService(u.IRenderService,this._renderService);this._renderService.onRender(function(a){return b._onRender.fire(a)});this.onResize(function(a){return b._renderService.resize(a.cols,
a.rows)});this._soundService=this._instantiationService.createInstance(La.SoundService);this._instantiationService.setService(u.ISoundService,this._soundService);this._mouseService=this._instantiationService.createInstance(A.MouseService);this._instantiationService.setService(u.IMouseService,this._mouseService);this.viewport=this._instantiationService.createInstance(k.Viewport,function(a,c){return b.scrollLines(a,c)},this._viewportElement,this._viewportScrollArea);this.viewport.onThemeChange(this._colorManager.colors);
this.register(this.viewport);this.register(this.onCursorMove(function(){return b._renderService.onCursorMove()}));this.register(this.onResize(function(){return b._renderService.onResize(b.cols,b.rows)}));this.register(this.onBlur(function(){return b._renderService.onBlur()}));this.register(this.onFocus(function(){return b._renderService.onFocus()}));this.register(this._renderService.onDimensionsChange(function(){return b.viewport.syncScrollArea()}));this._selectionService=this._instantiationService.createInstance(r.SelectionService,
function(a,c){return b.scrollLines(a,c)},this.element,this.screenElement);this._instantiationService.setService(u.ISelectionService,this._selectionService);this.register(this._selectionService.onSelectionChange(function(){return b._onSelectionChange.fire()}));this.register(this._selectionService.onRedrawRequest(function(a){return b._renderService.onSelectionChanged(a.start,a.end,a.columnSelectMode)}));this.register(this._selectionService.onLinuxMouseSelection(function(a){b.textarea.value=a;b.textarea.focus();
b.textarea.select()}));this.register(this.onScroll(function(){b.viewport.syncScrollArea();b._selectionService.refresh()}));this.register(D.addDisposableDomListener(this._viewportElement,"scroll",function(){return b._selectionService.refresh()}));this._mouseZoneManager=this._instantiationService.createInstance(Da.MouseZoneManager,this.element,this.screenElement);this.register(this._mouseZoneManager);this.register(this.onScroll(function(){return b._mouseZoneManager.clearAll()}));this.linkifier.attachToDom(this.element,
this._mouseZoneManager);this.register(D.addDisposableDomListener(this.element,"mousedown",function(a){return b._selectionService.onMouseDown(a)}));this.mouseEvents?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable();this.options.screenReaderMode&&(this._accessibilityManager=new Pb.AccessibilityManager(this,this._renderService));this._charSizeService.measure();this.refresh(0,this.rows-1);this._initGlobal();this.bindMouse()},b.prototype._createRenderer=
function(){switch(this.options.rendererType){case "canvas":return this._instantiationService.createInstance(v.Renderer,this._colorManager.colors,this.screenElement,this.linkifier);case "dom":return this._instantiationService.createInstance(Dc.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier);default:throw Error('Unrecognized rendererType "'+this.options.rendererType+'"');}},b.prototype._setTheme=function(a){var b,c,d;this._theme=a;null===(b=
this._colorManager)||void 0===b||b.setTheme(a);null===(c=this._renderService)||void 0===c||c.setColors(this._colorManager.colors);null===(d=this.viewport)||void 0===d||d.onThemeChange(this._colorManager.colors)},b.prototype.bindMouse=function(){function a(a){var b,d;if(!(b=c._mouseService.getRawByteCoords(a,c.screenElement,c.cols,c.rows)))return!1;switch(a.overrideType||a.type){case "mousemove":var e=32;void 0===a.buttons?(d=3,void 0!==a.button&&(d=3>a.button?a.button:3)):d=1&a.buttons?0:4&a.buttons?
1:2&a.buttons?2:3;break;case "mouseup":e=0;d=3>a.button?a.button:3;break;case "mousedown":e=1;d=3>a.button?a.button:3;break;case "wheel":0!==a.deltaY&&(e=0>a.deltaY?0:1);d=4;break;default:return!1}return!(void 0===e||void 0===d||4<d)&&c._coreMouseService.triggerMouseEvent({col:b.x-33,row:b.y-33,button:d,action:e,ctrl:a.ctrlKey,alt:a.altKey,shift:a.shiftKey})}var b=this,c=this,d=this.element,e=null,f=null,g=null,h=null,r=function(c){return a(c),c.buttons||(b._document.removeEventListener("mouseup",
e),g&&b._document.removeEventListener("mousemove",g)),b.cancel(c)},k=function(c){return a(c),c.preventDefault(),b.cancel(c)},v=function(b){b.buttons&&a(b)},p=function(b){b.buttons||a(b)};this._coreMouseService.onProtocolChange(function(a){(b.mouseEvents=a)?("debug"===b.optionsService.options.logLevel&&b._logService.debug("Binding to mouse events:",b._coreMouseService.explainEvents(a)),b.element.classList.add("enable-mouse-events"),b._selectionService.disable()):(b._logService.debug("Unbinding from mouse events."),
b.element.classList.remove("enable-mouse-events"),b._selectionService.enable());8&a?h||(d.addEventListener("mousemove",p),h=p):(d.removeEventListener("mousemove",h),h=null);16&a?f||(d.addEventListener("wheel",k),f=k):(d.removeEventListener("wheel",f),f=null);2&a?e||(e=r):(b._document.removeEventListener("mouseup",e),e=null);4&a?g||(g=v):(b._document.removeEventListener("mousemove",g),g=null)});this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol;this.register(D.addDisposableDomListener(d,
"mousedown",function(c){if(c.preventDefault(),b.focus(),b.mouseEvents&&!b._selectionService.shouldForceSelection(c))return a(c),e&&b._document.addEventListener("mouseup",e),g&&b._document.addEventListener("mousemove",g),b.cancel(c)}));this.register(D.addDisposableDomListener(d,"wheel",function(a){if(!f&&!b.buffer.hasScrollback){var c=b.viewport.getLinesScrolled(a);if(0!==c){a=t.C0.ESC+(b._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(0>a.deltaY?"A":"B");for(var d="",e=0;e<Math.abs(c);e++)d+=
a;b._coreService.triggerDataEvent(d,!0)}}}));this.register(D.addDisposableDomListener(d,"wheel",function(a){if(!f)return b.viewport.onWheel(a)?void 0:b.cancel(a)}));this.register(D.addDisposableDomListener(d,"touchstart",function(a){if(!b.mouseEvents)return b.viewport.onTouchStart(a),b.cancel(a)}));this.register(D.addDisposableDomListener(d,"touchmove",function(a){if(!b.mouseEvents)return b.viewport.onTouchMove(a)?void 0:b.cancel(a)}))},b.prototype.refresh=function(a,b){var c;null===(c=this._renderService)||
void 0===c||c.refreshRows(a,b)},b.prototype._queueLinkification=function(a,b){var c;null===(c=this.linkifier)||void 0===c||c.linkifyRows(a,b)},b.prototype.updateCursorStyle=function(a){this._selectionService&&this._selectionService.shouldColumnSelect(a)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},b.prototype.showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},
b.prototype.scroll=function(a){void 0===a&&(a=!1);var b=this._blankLine;var c=this.eraseAttrData();b&&b.length===this.cols&&b.getFg(0)===c.fg&&b.getBg(0)===c.bg||(b=this.buffer.getBlankLine(c,a),this._blankLine=b);b.isWrapped=a;c=this.buffer.ybase+this.buffer.scrollTop;a=this.buffer.ybase+this.buffer.scrollBottom;0===this.buffer.scrollTop?(c=this.buffer.lines.isFull,a===this.buffer.lines.length-1?c?this.buffer.lines.recycle().copyFrom(b):this.buffer.lines.push(b.clone()):this.buffer.lines.splice(a+
1,0,b.clone()),c?this._userScrolling&&(this.buffer.ydisp=Math.max(this.buffer.ydisp-1,0)):(this.buffer.ybase++,this._userScrolling||this.buffer.ydisp++)):(this.buffer.lines.shiftElements(c+1,a-c+1-1,-1),this.buffer.lines.set(a,b.clone()));this._userScrolling||(this.buffer.ydisp=this.buffer.ybase);this._dirtyRowService.markRangeDirty(this.buffer.scrollTop,this.buffer.scrollBottom);this._onScroll.fire(this.buffer.ydisp)},b.prototype.scrollLines=function(a,b){if(0>a){if(0===this.buffer.ydisp)return;
this._userScrolling=!0}else a+this.buffer.ydisp>=this.buffer.ybase&&(this._userScrolling=!1);var c=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+a,this.buffer.ybase),0);c!==this.buffer.ydisp&&(b||this._onScroll.fire(this.buffer.ydisp),this.refresh(0,this.rows-1))},b.prototype.scrollPages=function(a){this.scrollLines(a*(this.rows-1))},b.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},b.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-
this.buffer.ydisp)},b.prototype.scrollToLine=function(a){a-=this.buffer.ydisp;0!==a&&this.scrollLines(a)},b.prototype.paste=function(a){q.paste(a,this.textarea,this.bracketedPasteMode,this._coreService)},b.prototype.attachCustomKeyEventHandler=function(a){this._customKeyEventHandler=a},b.prototype.addEscHandler=function(a,b){return this._inputHandler.addEscHandler(a,b)},b.prototype.addDcsHandler=function(a,b){return this._inputHandler.addDcsHandler(a,b)},b.prototype.addCsiHandler=function(a,b){return this._inputHandler.addCsiHandler(a,
b)},b.prototype.addOscHandler=function(a,b){return this._inputHandler.addOscHandler(a,b)},b.prototype.registerLinkMatcher=function(a,b,c){a=this.linkifier.registerLinkMatcher(a,b,c);return this.refresh(0,this.rows-1),a},b.prototype.deregisterLinkMatcher=function(a){this.linkifier.deregisterLinkMatcher(a)&&this.refresh(0,this.rows-1)},b.prototype.registerCharacterJoiner=function(a){a=this._renderService.registerCharacterJoiner(a);return this.refresh(0,this.rows-1),a},b.prototype.deregisterCharacterJoiner=
function(a){this._renderService.deregisterCharacterJoiner(a)&&this.refresh(0,this.rows-1)},Object.defineProperty(b.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!0,configurable:!0}),b.prototype.addMarker=function(a){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+a)},b.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},b.prototype.select=function(a,b,c){this._selectionService.setSelection(a,
b,c)},b.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},b.prototype.getSelectionPosition=function(){if(this._selectionService.hasSelection)return{startColumn:this._selectionService.selectionStart[0],startRow:this._selectionService.selectionStart[1],endColumn:this._selectionService.selectionEnd[0],endRow:this._selectionService.selectionEnd[1]}},b.prototype.clearSelection=function(){var a;null===(a=this._selectionService)||void 0===a||a.clearSelection()},
b.prototype.selectAll=function(){var a;null===(a=this._selectionService)||void 0===a||a.selectAll()},b.prototype.selectLines=function(a,b){var c;null===(c=this._selectionService)||void 0===c||c.selectLines(a,b)},b.prototype._keyDown=function(a){if(this._keyDownHandled=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(a))return!1;if(!this._compositionHelper.keydown(a))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var b=Gh.evaluateKeyboardEvent(a,this._coreService.decPrivateModes.applicationCursorKeys,
this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(a),3===b.type||2===b.type){var c=this.rows-1;return this.scrollLines(2===b.type?-c:c),this.cancel(a,!0)}return 1===b.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,a)||(b.cancel&&this.cancel(a,!0),!b.key||(b.key!==t.C0.ETX&&b.key!==t.C0.CR||(this.textarea.value=""),this._onKey.fire({key:b.key,domEvent:a}),this.showCursor(),this._coreService.triggerDataEvent(b.key,!0),this.optionsService.options.screenReaderMode?
void(this._keyDownHandled=!0):this.cancel(a,!0)))},b.prototype._isThirdLevelShift=function(a,b){a=a.isMac&&!this.options.macOptionIsMeta&&b.altKey&&!b.ctrlKey&&!b.metaKey||a.isWindows&&b.altKey&&b.ctrlKey&&!b.metaKey;return"keypress"===b.type?a:a&&(!b.keyCode||47<b.keyCode)},b.prototype.setgLevel=function(a){this.glevel=a;this.charset=this.charsets[a]},b.prototype.setgCharset=function(a,b){this.charsets[a]=b;this.glevel===a&&(this.charset=b)},b.prototype._keyUp=function(a){this._customKeyEventHandler&&
!1===this._customKeyEventHandler(a)||(16===a.keyCode||17===a.keyCode||18===a.keyCode||this.focus(),this.updateCursorStyle(a))},b.prototype._keyPress=function(a){if(this._keyDownHandled||this._customKeyEventHandler&&!1===this._customKeyEventHandler(a))return!1;if(this.cancel(a),a.charCode)var b=a.charCode;else if(null===a.which||void 0===a.which)b=a.keyCode;else{if(0===a.which||0===a.charCode)return!1;b=a.which}return!(!b||(a.altKey||a.ctrlKey||a.metaKey)&&!this._isThirdLevelShift(this.browser,a))&&
(b=String.fromCharCode(b),this._onKey.fire({key:b,domEvent:a}),this.showCursor(),this._coreService.triggerDataEvent(b,!0),!0)},b.prototype.bell=function(){var a=this;this._soundBell()&&this._soundService.playBellSound();this._visualBell()&&(this.element.classList.add("visual-bell-active"),clearTimeout(this._visualBellTimer),this._visualBellTimer=window.setTimeout(function(){a.element.classList.remove("visual-bell-active")},200))},b.prototype.resize=function(a,b){var c;isNaN(a)||isNaN(b)||(a!==this.cols||
b!==this.rows?(a<lb.MINIMUM_COLS&&(a=lb.MINIMUM_COLS),b<lb.MINIMUM_ROWS&&(b=lb.MINIMUM_ROWS),this.buffers.resize(a,b),this._bufferService.resize(a,b),this.buffers.setupTabStops(this.cols),null===(c=this._charSizeService)||void 0===c||c.measure(),this.viewport.syncScrollArea(!0),this.refresh(0,this.rows-1),this._onResize.fire({cols:a,rows:b})):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure())},b.prototype.clear=function(){if(0!==this.buffer.ybase||0!==this.buffer.y){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(var a=1;a<this.rows;a++)this.buffer.lines.push(this.buffer.getBlankLine(X.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1);this._onScroll.fire(this.buffer.ydisp)}},b.prototype.is=function(a){return 0===(this.options.termName+"").indexOf(a)},b.prototype.handleTitle=function(a){this._onTitleChange.fire(a)},b.prototype.reset=function(){var a,b;this.options.rows=
this.rows;this.options.cols=this.cols;var c=this._customKeyEventHandler,d=this._inputHandler,e=this._userScrolling;this._setup();this._bufferService.reset();this._coreService.reset();this._coreMouseService.reset();null===(a=this._selectionService)||void 0===a||a.reset();this._customKeyEventHandler=c;this._inputHandler=d;this._userScrolling=e;this.refresh(0,this.rows-1);null===(b=this.viewport)||void 0===b||b.syncScrollArea()},b.prototype.cancel=function(a,b){if(this.options.cancelEvents||b)return a.preventDefault(),
a.stopPropagation(),!1},b.prototype._visualBell=function(){return!1},b.prototype._soundBell=function(){return"sound"===this.options.bellStyle},b.prototype.write=function(a,b){this._writeBuffer.write(a,b)},b.prototype.writeSync=function(a){this._writeBuffer.writeSync(a)},b}(a.Disposable);c.Terminal=d},function(a,c,d){var b=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=
Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},e=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,"__esModule",{value:!0});var g=d(4),k=d(0);a=function(){function a(a,b,c,d,e,f){this._textarea=a;this._compositionView=b;this._bufferService=c;this._optionsService=d;this._charSizeService=e;this._coreService=f;this._isSendingComposition=this._isComposing=
!1;this._compositionPosition={start:0,end:0}}return a.prototype.compositionstart=function(){this._isComposing=!0;this._compositionPosition.start=this._textarea.value.length;this._compositionView.textContent="";this._compositionView.classList.add("active")},a.prototype.compositionupdate=function(a){var b=this;this._compositionView.textContent=a.data;this.updateCompositionElements();setTimeout(function(){b._compositionPosition.end=b._textarea.value.length},0)},a.prototype.compositionend=function(){this._finalizeComposition(!0)},
a.prototype.keydown=function(a){if(this._isComposing||this._isSendingComposition){if(229===a.keyCode||16===a.keyCode||17===a.keyCode||18===a.keyCode)return!1;this._finalizeComposition(!1)}return 229!==a.keyCode||(this._handleAnyTextareaChanges(),!1)},a.prototype._finalizeComposition=function(a){var b=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),a){var c=this._compositionPosition.start,d=this._compositionPosition.end;this._isSendingComposition=
!0;setTimeout(function(){if(b._isSendingComposition){b._isSendingComposition=!1;var a=b._isComposing?b._textarea.value.substring(c,d):b._textarea.value.substring(c);b._coreService.triggerDataEvent(a,!0)}},0)}else this._isSendingComposition=!1,a=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end),this._coreService.triggerDataEvent(a,!0)},a.prototype._handleAnyTextareaChanges=function(){var a=this,b=this._textarea.value;setTimeout(function(){if(!a._isComposing){var c=
a._textarea.value.replace(b,"");0<c.length&&a._coreService.triggerDataEvent(c,!0)}},0)},a.prototype.updateCompositionElements=function(a){var b=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var c=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),d=this._bufferService.buffer.y*c,e=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=e+"px";this._compositionView.style.top=d+"px";this._compositionView.style.height=
c+"px";this._compositionView.style.lineHeight=c+"px";this._compositionView.style.fontFamily=this._optionsService.options.fontFamily;this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";c=this._compositionView.getBoundingClientRect();this._textarea.style.left=e+"px";this._textarea.style.top=d+"px";this._textarea.style.width=c.width+"px";this._textarea.style.height=c.height+"px";this._textarea.style.lineHeight=c.height+"px"}a||setTimeout(function(){return b.updateCompositionElements(!0)},
0)}},a.prototype._clearTextareaPosition=function(){this._textarea.style.left="";this._textarea.style.top=""},a=b([e(2,k.IBufferService),e(3,k.IOptionsService),e(4,g.ICharSizeService),e(5,k.ICoreService)],a)}();c.CompositionHelper=a},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=
a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}),g=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},k=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,
"__esModule",{value:!0});a=d(2);var q=d(7),t=d(4),p=d(0);d=function(a){function b(b,c,d,e,f,g,h){var r=a.call(this)||this;return r._scrollLines=b,r._viewportElement=c,r._scrollArea=d,r._bufferService=e,r._optionsService=f,r._charSizeService=g,r._renderService=h,r.scrollBarWidth=0,r._currentRowHeight=0,r._lastRecordedBufferLength=0,r._lastRecordedViewportHeight=0,r._lastRecordedBufferHeight=0,r._lastTouchY=0,r._lastScrollTop=0,r._wheelPartialScroll=0,r._refreshAnimationFrame=null,r._ignoreNextScrollEvent=
!1,r.scrollBarWidth=r._viewportElement.offsetWidth-r._scrollArea.offsetWidth||15,r.register(q.addDisposableDomListener(r._viewportElement,"scroll",r._onScroll.bind(r))),setTimeout(function(){return r.syncScrollArea()},0),r}return e(b,a),b.prototype.onThemeChange=function(a){this._viewportElement.style.backgroundColor=a.background.css},b.prototype._refresh=function(a){var b=this;if(a)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&cancelAnimationFrame(this._refreshAnimationFrame));
null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return b._innerRefresh()}))},b.prototype._innerRefresh=function(){if(0<this._charSizeService.height){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio;this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var a=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);
this._lastRecordedBufferHeight!==a&&(this._lastRecordedBufferHeight=a,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a);this._refreshAnimationFrame=null},b.prototype.syncScrollArea=function(a){if(void 0===a&&(a=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=
this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight?this._lastScrollTop===this._bufferService.buffer.ydisp*this._currentRowHeight&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(a):this._refresh(a)},b.prototype._onScroll=function(a){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)this._ignoreNextScrollEvent?
this._ignoreNextScrollEvent=!1:this._scrollLines(Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp,!0)},b.prototype._bubbleScroll=function(a,b){var c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(0>b&&0!==this._viewportElement.scrollTop||0<b&&c<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)},b.prototype.onWheel=function(a){var b=this._getPixelsScrolled(a);return 0!==b&&(this._viewportElement.scrollTop+=b,this._bubbleScroll(a,
b))},b.prototype._getPixelsScrolled=function(a){if(0===a.deltaY)return 0;var b=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?b*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(b*=this._currentRowHeight*this._bufferService.rows),b},b.prototype.getLinesScrolled=function(a){if(0===a.deltaY)return 0;var b=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(b/=this._currentRowHeight+0,this._wheelPartialScroll+=b,
b=Math.floor(Math.abs(this._wheelPartialScroll))*(0<this._wheelPartialScroll?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(b*=this._bufferService.rows),b},b.prototype._applyScrollModifier=function(a,b){var c=this._optionsService.options.fastScrollModifier;return"alt"===c&&b.altKey||"ctrl"===c&&b.ctrlKey||"shift"===c&&b.shiftKey?a*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:a*this._optionsService.options.scrollSensitivity},
b.prototype.onTouchStart=function(a){this._lastTouchY=a.touches[0].pageY},b.prototype.onTouchMove=function(a){var b=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,0!==b&&(this._viewportElement.scrollTop+=b,this._bubbleScroll(a,b))},b=g([k(3,p.IBufferService),k(4,p.IOptionsService),k(5,t.ICharSizeService),k(6,t.IRenderService)],b)}(a.Disposable);c.Viewport=d},function(a,c,d){function b(a){return a.replace(/\r?\n/g,"\r")}function e(a,b){return b?"\u001b[200~"+a+"\u001b[201~":
a}function g(a,c,d,f){a=e(a=b(a),d);f.triggerDataEvent(a,!0);c.value=""}function k(a,b,c){var d=c.getBoundingClientRect();c=a.clientX-d.left-10;a=a.clientY-d.top-10;b.style.position="absolute";b.style.width="20px";b.style.height="20px";b.style.left=c+"px";b.style.top=a+"px";b.style.zIndex="1000";b.focus();setTimeout(function(){b.style.position="";b.style.width="";b.style.height="";b.style.left="";b.style.top="";b.style.zIndex=""},200)}Object.defineProperty(c,"__esModule",{value:!0});c.prepareTextForTerminal=
b;c.bracketTextForPaste=e;c.copyHandler=function(a,b){a.clipboardData&&a.clipboardData.setData("text/plain",b.selectionText);a.preventDefault()};c.handlePasteEvent=function(a,b,c,d){a.stopPropagation();a.clipboardData&&g(a.clipboardData.getData("text/plain"),b,c,d)};c.paste=g;c.moveTextAreaUnderMouseCursor=k;c.rightClickHandler=function(a,b,c,d,e){k(a,b,c);e&&!d.isClickInSelection(a)&&d.selectWordAtCursor(a);b.value=d.selectionText;b.select()}},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,
c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)});Object.defineProperty(c,"__esModule",{value:!0});var g=d(12),k=d(18),q=d(19),t=d(39);a=d(2);var p=d(15),v=d(8),n=d(16),r=d(1),x=d(3),D=d(5),H=d(6),La=d(21),Da=d(23),Pb={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Dc=
function(){function a(a,b,c,d){this._bufferService=a;this._coreService=b;this._logService=c;this._optionsService=d;this._data=new Uint32Array(0)}return a.prototype.hook=function(a){this._data=new Uint32Array(0)},a.prototype.put=function(a,b,c){this._data=p.concat(this._data,a.subarray(b,c))},a.prototype.unhook=function(a){if(a)switch(a=v.utf32ToString(this._data),this._data=new Uint32Array(0),a){case '"q':return this._coreService.triggerDataEvent(g.C0.ESC+'P1$r0"q'+g.C0.ESC+"\\");case '"p':return this._coreService.triggerDataEvent(g.C0.ESC+
'P1$r61"p'+g.C0.ESC+"\\");case "r":return this._coreService.triggerDataEvent(g.C0.ESC+"P1$r"+(this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r")+g.C0.ESC+"\\");case "m":return this._coreService.triggerDataEvent(g.C0.ESC+"P1$r0m"+g.C0.ESC+"\\");case " q":return a={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle],a-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(g.C0.ESC+"P1$r"+a+" q"+g.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",
a),this._coreService.triggerDataEvent(g.C0.ESC+"P0$r"+g.C0.ESC+"\\")}else this._data=new Uint32Array(0)},a}();d=function(a){function b(b,c,d,e,f,h,p,q){void 0===q&&(q=new t.EscapeSequenceParser);var n=a.call(this)||this;n._terminal=b;n._bufferService=c;n._coreService=d;n._dirtyRowService=e;n._logService=f;n._optionsService=h;n._coreMouseService=p;n._parser=q;n._parseBuffer=new Uint32Array(4096);n._stringDecoder=new v.StringToUtf32;n._utf8Decoder=new v.Utf8ToUtf32;n._workCell=new D.CellData;n._onCursorMove=
new r.EventEmitter;n._onLineFeed=new r.EventEmitter;n._onScroll=new r.EventEmitter;n.register(n._parser);n._parser.setCsiHandlerFallback(function(a,b){n._logService.debug("Unknown CSI code: ",{identifier:n._parser.identToString(a),params:b.toArray()})});n._parser.setEscHandlerFallback(function(a){n._logService.debug("Unknown ESC code: ",{identifier:n._parser.identToString(a)})});n._parser.setExecuteHandlerFallback(function(a){n._logService.debug("Unknown EXECUTE code: ",{code:a})});n._parser.setOscHandlerFallback(function(a,
b,c){n._logService.debug("Unknown OSC code: ",{identifier:a,action:b,data:c})});n._parser.setDcsHandlerFallback(function(a,b,c){"HOOK"===b&&(c=c.toArray());n._logService.debug("Unknown DCS code: ",{identifier:n._parser.identToString(a),action:b,payload:c})});n._parser.setPrintHandler(function(a,b,c){return n.print(a,b,c)});n._parser.setCsiHandler({final:"@"},function(a){return n.insertChars(a)});n._parser.setCsiHandler({intermediates:" ",final:"@"},function(a){return n.scrollLeft(a)});n._parser.setCsiHandler({final:"A"},
function(a){return n.cursorUp(a)});n._parser.setCsiHandler({intermediates:" ",final:"A"},function(a){return n.scrollRight(a)});n._parser.setCsiHandler({final:"B"},function(a){return n.cursorDown(a)});n._parser.setCsiHandler({final:"C"},function(a){return n.cursorForward(a)});n._parser.setCsiHandler({final:"D"},function(a){return n.cursorBackward(a)});n._parser.setCsiHandler({final:"E"},function(a){return n.cursorNextLine(a)});n._parser.setCsiHandler({final:"F"},function(a){return n.cursorPrecedingLine(a)});
n._parser.setCsiHandler({final:"G"},function(a){return n.cursorCharAbsolute(a)});n._parser.setCsiHandler({final:"H"},function(a){return n.cursorPosition(a)});n._parser.setCsiHandler({final:"I"},function(a){return n.cursorForwardTab(a)});n._parser.setCsiHandler({final:"J"},function(a){return n.eraseInDisplay(a)});n._parser.setCsiHandler({prefix:"?",final:"J"},function(a){return n.eraseInDisplay(a)});n._parser.setCsiHandler({final:"K"},function(a){return n.eraseInLine(a)});n._parser.setCsiHandler({prefix:"?",
final:"K"},function(a){return n.eraseInLine(a)});n._parser.setCsiHandler({final:"L"},function(a){return n.insertLines(a)});n._parser.setCsiHandler({final:"M"},function(a){return n.deleteLines(a)});n._parser.setCsiHandler({final:"P"},function(a){return n.deleteChars(a)});n._parser.setCsiHandler({final:"S"},function(a){return n.scrollUp(a)});n._parser.setCsiHandler({final:"T"},function(a){return n.scrollDown(a)});n._parser.setCsiHandler({final:"X"},function(a){return n.eraseChars(a)});n._parser.setCsiHandler({final:"Z"},
function(a){return n.cursorBackwardTab(a)});n._parser.setCsiHandler({final:"`"},function(a){return n.charPosAbsolute(a)});n._parser.setCsiHandler({final:"a"},function(a){return n.hPositionRelative(a)});n._parser.setCsiHandler({final:"b"},function(a){return n.repeatPrecedingCharacter(a)});n._parser.setCsiHandler({final:"c"},function(a){return n.sendDeviceAttributesPrimary(a)});n._parser.setCsiHandler({prefix:">",final:"c"},function(a){return n.sendDeviceAttributesSecondary(a)});n._parser.setCsiHandler({final:"d"},
function(a){return n.linePosAbsolute(a)});n._parser.setCsiHandler({final:"e"},function(a){return n.vPositionRelative(a)});n._parser.setCsiHandler({final:"f"},function(a){return n.hVPosition(a)});n._parser.setCsiHandler({final:"g"},function(a){return n.tabClear(a)});n._parser.setCsiHandler({final:"h"},function(a){return n.setMode(a)});n._parser.setCsiHandler({prefix:"?",final:"h"},function(a){return n.setModePrivate(a)});n._parser.setCsiHandler({final:"l"},function(a){return n.resetMode(a)});n._parser.setCsiHandler({prefix:"?",
final:"l"},function(a){return n.resetModePrivate(a)});n._parser.setCsiHandler({final:"m"},function(a){return n.charAttributes(a)});n._parser.setCsiHandler({final:"n"},function(a){return n.deviceStatus(a)});n._parser.setCsiHandler({prefix:"?",final:"n"},function(a){return n.deviceStatusPrivate(a)});n._parser.setCsiHandler({intermediates:"!",final:"p"},function(a){return n.softReset(a)});n._parser.setCsiHandler({intermediates:" ",final:"q"},function(a){return n.setCursorStyle(a)});n._parser.setCsiHandler({final:"r"},
function(a){return n.setScrollRegion(a)});n._parser.setCsiHandler({final:"s"},function(a){return n.saveCursor(a)});n._parser.setCsiHandler({final:"u"},function(a){return n.restoreCursor(a)});n._parser.setCsiHandler({intermediates:"'",final:"}"},function(a){return n.insertColumns(a)});n._parser.setCsiHandler({intermediates:"'",final:"~"},function(a){return n.deleteColumns(a)});n._parser.setExecuteHandler(g.C0.BEL,function(){return n.bell()});n._parser.setExecuteHandler(g.C0.LF,function(){return n.lineFeed()});
n._parser.setExecuteHandler(g.C0.VT,function(){return n.lineFeed()});n._parser.setExecuteHandler(g.C0.FF,function(){return n.lineFeed()});n._parser.setExecuteHandler(g.C0.CR,function(){return n.carriageReturn()});n._parser.setExecuteHandler(g.C0.BS,function(){return n.backspace()});n._parser.setExecuteHandler(g.C0.HT,function(){return n.tab()});n._parser.setExecuteHandler(g.C0.SO,function(){return n.shiftOut()});n._parser.setExecuteHandler(g.C0.SI,function(){return n.shiftIn()});n._parser.setExecuteHandler(g.C1.IND,
function(){return n.index()});n._parser.setExecuteHandler(g.C1.NEL,function(){return n.nextLine()});n._parser.setExecuteHandler(g.C1.HTS,function(){return n.tabSet()});n._parser.setOscHandler(0,new La.OscHandler(function(a){return n.setTitle(a)}));n._parser.setOscHandler(2,new La.OscHandler(function(a){return n.setTitle(a)}));n._parser.setEscHandler({final:"7"},function(){return n.saveCursor()});n._parser.setEscHandler({final:"8"},function(){return n.restoreCursor()});n._parser.setEscHandler({final:"D"},
function(){return n.index()});n._parser.setEscHandler({final:"E"},function(){return n.nextLine()});n._parser.setEscHandler({final:"H"},function(){return n.tabSet()});n._parser.setEscHandler({final:"M"},function(){return n.reverseIndex()});n._parser.setEscHandler({final:"="},function(){return n.keypadApplicationMode()});n._parser.setEscHandler({final:">"},function(){return n.keypadNumericMode()});n._parser.setEscHandler({final:"c"},function(){return n.reset()});n._parser.setEscHandler({final:"n"},
function(){return n.setgLevel(2)});n._parser.setEscHandler({final:"o"},function(){return n.setgLevel(3)});n._parser.setEscHandler({final:"|"},function(){return n.setgLevel(3)});n._parser.setEscHandler({final:"}"},function(){return n.setgLevel(2)});n._parser.setEscHandler({final:"~"},function(){return n.setgLevel(1)});n._parser.setEscHandler({intermediates:"%",final:"@"},function(){return n.selectDefaultCharset()});n._parser.setEscHandler({intermediates:"%",final:"G"},function(){return n.selectDefaultCharset()});
b=function(a){H._parser.setEscHandler({intermediates:"(",final:a},function(){return n.selectCharset("("+a)});H._parser.setEscHandler({intermediates:")",final:a},function(){return n.selectCharset(")"+a)});H._parser.setEscHandler({intermediates:"*",final:a},function(){return n.selectCharset("*"+a)});H._parser.setEscHandler({intermediates:"+",final:a},function(){return n.selectCharset("+"+a)});H._parser.setEscHandler({intermediates:"-",final:a},function(){return n.selectCharset("-"+a)});H._parser.setEscHandler({intermediates:".",
final:a},function(){return n.selectCharset("."+a)});H._parser.setEscHandler({intermediates:"/",final:a},function(){return n.selectCharset("/"+a)})};var H=this,x;for(x in k.CHARSETS)b(x);return n._parser.setEscHandler({intermediates:"#",final:"8"},function(){return n.screenAlignmentPattern()}),n._parser.setErrorHandler(function(a){return n._logService.error("Parsing error: ",a),a}),n._parser.setDcsHandler({intermediates:"$",final:"q"},new Dc(n._bufferService,n._coreService,n._logService,n._optionsService)),
n}return e(b,a),Object.defineProperty(b.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),b.prototype.dispose=function(){a.prototype.dispose.call(this)},b.prototype.parse=function(a){var b=this._bufferService.buffer,
c=b.x,d=b.y;if(this._logService.debug("parsing data",a),this._parseBuffer.length<a.length&&131072>this._parseBuffer.length&&(this._parseBuffer=new Uint32Array(Math.min(a.length,131072))),this._dirtyRowService.clearRange(),131072<a.length)for(var e=0;e<a.length;e+=131072){var f=e+131072<a.length?e+131072:a.length;f="string"==typeof a?this._stringDecoder.decode(a.substring(e,f),this._parseBuffer):this._utf8Decoder.decode(a.subarray(e,f),this._parseBuffer);this._parser.parse(this._parseBuffer,f)}else f=
"string"==typeof a?this._stringDecoder.decode(a,this._parseBuffer):this._utf8Decoder.decode(a,this._parseBuffer),this._parser.parse(this._parseBuffer,f);(b=this._bufferService.buffer).x===c&&b.y===d||this._onCursorMove.fire();this._terminal.refresh(this._dirtyRowService.start,this._dirtyRowService.end)},b.prototype.print=function(a,b,c){var d,e=this._bufferService.buffer,f=this._terminal.charset,g=this._optionsService.options.screenReaderMode,h=this._bufferService.cols,r=this._terminal.wraparoundMode,
n=this._terminal.insertMode,k=this._terminal.curAttrData,p=e.lines.get(e.y+e.ybase);this._dirtyRowService.markDirty(e.y);for(var t=b;t<c;++t){if(d=a[t],b=q.wcwidth(d),127>d&&f){var D=f[String.fromCharCode(d)];D&&(d=D.charCodeAt(0))}if(g&&this._terminal.onA11yCharEmitter.fire(v.stringFromCodePoint(d)),b||!e.x){if(e.x+b-1>=h)if(r)e.x=0,e.y++,e.y===e.scrollBottom+1?(e.y--,this._terminal.scroll(!0)):(e.y>=this._bufferService.rows&&(e.y=this._bufferService.rows-1),e.lines.get(e.y).isWrapped=!0),p=e.lines.get(e.y+
e.ybase);else if(e.x=h-1,2===b)continue;if(n&&(p.insertCells(e.x,b,e.getNullCell(k)),2===p.getWidth(h-1)&&p.setCellFromCodePoint(h-1,x.NULL_CELL_CODE,x.NULL_CELL_WIDTH,k.fg,k.bg)),p.setCellFromCodePoint(e.x++,d,b,k.fg,k.bg),0<b)for(;--b;)p.setCellFromCodePoint(e.x++,0,0,k.fg,k.bg)}else p.getWidth(e.x-1)?p.addCodepointToCell(e.x-1,d):p.addCodepointToCell(e.x-2,d)}c&&(p.loadCell(e.x-1,this._workCell),2===this._workCell.getWidth()||65535<this._workCell.getCode()?this._parser.precedingCodepoint=0:this._workCell.isCombined()?
this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content);this._dirtyRowService.markDirty(e.y)},b.prototype.addCsiHandler=function(a,b){return this._parser.addCsiHandler(a,b)},b.prototype.addDcsHandler=function(a,b){return this._parser.addDcsHandler(a,new Da.DcsHandler(b))},b.prototype.addEscHandler=function(a,b){return this._parser.addEscHandler(a,b)},b.prototype.addOscHandler=function(a,b){return this._parser.addOscHandler(a,
new La.OscHandler(b))},b.prototype.bell=function(){this._terminal.bell()},b.prototype.lineFeed=function(){var a=this._bufferService.buffer;this._dirtyRowService.markDirty(a.y);this._optionsService.options.convertEol&&(a.x=0);a.y++;a.y===a.scrollBottom+1?(a.y--,this._terminal.scroll()):a.y>=this._bufferService.rows&&(a.y=this._bufferService.rows-1);a.x>=this._bufferService.cols&&a.x--;this._dirtyRowService.markDirty(a.y);this._onLineFeed.fire()},b.prototype.carriageReturn=function(){this._bufferService.buffer.x=
0},b.prototype.backspace=function(){this._restrictCursor();0<this._bufferService.buffer.x&&this._bufferService.buffer.x--},b.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var a=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop();this._optionsService.options.screenReaderMode&&this._terminal.onA11yTabEmitter.fire(this._bufferService.buffer.x-a)}},b.prototype.shiftOut=function(){this._terminal.setgLevel(1)},b.prototype.shiftIn=
function(){this._terminal.setgLevel(0)},b.prototype._restrictCursor=function(){this._bufferService.buffer.x=Math.min(this._bufferService.cols-1,Math.max(0,this._bufferService.buffer.x));this._bufferService.buffer.y=this._terminal.originMode?Math.min(this._bufferService.buffer.scrollBottom,Math.max(this._bufferService.buffer.scrollTop,this._bufferService.buffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._bufferService.buffer.y));this._dirtyRowService.markDirty(this._bufferService.buffer.y)},
b.prototype._setCursor=function(a,b){this._dirtyRowService.markDirty(this._bufferService.buffer.y);this._terminal.originMode?(this._bufferService.buffer.x=a,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+b):(this._bufferService.buffer.x=a,this._bufferService.buffer.y=b);this._restrictCursor();this._dirtyRowService.markDirty(this._bufferService.buffer.y)},b.prototype._moveCursor=function(a,b){this._restrictCursor();this._setCursor(this._bufferService.buffer.x+a,this._bufferService.buffer.y+
b)},b.prototype.cursorUp=function(a){var b=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;0<=b?this._moveCursor(0,-Math.min(b,a.params[0]||1)):this._moveCursor(0,-(a.params[0]||1))},b.prototype.cursorDown=function(a){var b=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;0<=b?this._moveCursor(0,Math.min(b,a.params[0]||1)):this._moveCursor(0,a.params[0]||1)},b.prototype.cursorForward=function(a){this._moveCursor(a.params[0]||1,0)},b.prototype.cursorBackward=function(a){this._moveCursor(-(a.params[0]||
1),0)},b.prototype.cursorNextLine=function(a){this.cursorDown(a);this._bufferService.buffer.x=0},b.prototype.cursorPrecedingLine=function(a){this.cursorUp(a);this._bufferService.buffer.x=0},b.prototype.cursorCharAbsolute=function(a){this._setCursor((a.params[0]||1)-1,this._bufferService.buffer.y)},b.prototype.cursorPosition=function(a){this._setCursor(2<=a.length?(a.params[1]||1)-1:0,(a.params[0]||1)-1)},b.prototype.charPosAbsolute=function(a){this._setCursor((a.params[0]||1)-1,this._bufferService.buffer.y)},
b.prototype.hPositionRelative=function(a){this._moveCursor(a.params[0]||1,0)},b.prototype.linePosAbsolute=function(a){this._setCursor(this._bufferService.buffer.x,(a.params[0]||1)-1)},b.prototype.vPositionRelative=function(a){this._moveCursor(0,a.params[0]||1)},b.prototype.hVPosition=function(a){this.cursorPosition(a)},b.prototype.tabClear=function(a){a=a.params[0];0===a?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:3===a&&(this._bufferService.buffer.tabs={})},b.prototype.cursorForwardTab=
function(a){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(a=a.params[0]||1;a--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},b.prototype.cursorBackwardTab=function(a){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){a=a.params[0]||1;for(var b=this._bufferService.buffer;a--;)b.x=b.prevStop()}},b.prototype._eraseInBufferLine=function(a,b,c,d){void 0===d&&(d=!1);a=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+a);a.replaceCells(b,
c,this._bufferService.buffer.getNullCell(this._terminal.eraseAttrData()));d&&(a.isWrapped=!1)},b.prototype._resetBufferLine=function(a){a=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+a);a.fill(this._bufferService.buffer.getNullCell(this._terminal.eraseAttrData()));a.isWrapped=!1},b.prototype.eraseInDisplay=function(a){switch(this._restrictCursor(),a.params[0]){case 0:a=this._bufferService.buffer.y;this._dirtyRowService.markDirty(a);for(this._eraseInBufferLine(a++,this._bufferService.buffer.x,
this._bufferService.cols,0===this._bufferService.buffer.x);a<this._bufferService.rows;a++)this._resetBufferLine(a);this._dirtyRowService.markDirty(a);break;case 1:a=this._bufferService.buffer.y;this._dirtyRowService.markDirty(a);this._eraseInBufferLine(a,0,this._bufferService.buffer.x+1,!0);for(this._bufferService.buffer.x+1>=this._bufferService.cols&&(this._bufferService.buffer.lines.get(a+1).isWrapped=!1);a--;)this._resetBufferLine(a);this._dirtyRowService.markDirty(0);break;case 2:a=this._bufferService.rows;
for(this._dirtyRowService.markDirty(a-1);a--;)this._resetBufferLine(a);this._dirtyRowService.markDirty(0);break;case 3:a=this._bufferService.buffer.lines.length-this._bufferService.rows,0<a&&(this._bufferService.buffer.lines.trimStart(a),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-a,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-a,0),this._onScroll.fire(0))}},b.prototype.eraseInLine=function(a){switch(this._restrictCursor(),a.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,
this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}this._dirtyRowService.markDirty(this._bufferService.buffer.y)},b.prototype.insertLines=function(a){this._restrictCursor();a=a.params[0]||1;var b=this._bufferService.buffer;if(!(b.y>b.scrollBottom||b.y<b.scrollTop)){for(var c=b.y+b.ybase,d=this._bufferService.rows-
1+b.ybase-(this._bufferService.rows-1-b.scrollBottom)+1;a--;)b.lines.splice(d-1,1),b.lines.splice(c,0,b.getBlankLine(this._terminal.eraseAttrData()));this._dirtyRowService.markRangeDirty(b.y,b.scrollBottom);b.x=0}},b.prototype.deleteLines=function(a){this._restrictCursor();a=a.params[0]||1;var b=this._bufferService.buffer;if(!(b.y>b.scrollBottom||b.y<b.scrollTop)){var c=b.y+b.ybase;var d=this._bufferService.rows-1-b.scrollBottom;for(d=this._bufferService.rows-1+b.ybase-d;a--;)b.lines.splice(c,1),
b.lines.splice(d,0,b.getBlankLine(this._terminal.eraseAttrData()));this._dirtyRowService.markRangeDirty(b.y,b.scrollBottom);b.x=0}},b.prototype.insertChars=function(a){this._restrictCursor();var b=this._bufferService.buffer.lines.get(this._bufferService.buffer.y+this._bufferService.buffer.ybase);b&&(b.insertCells(this._bufferService.buffer.x,a.params[0]||1,this._bufferService.buffer.getNullCell(this._terminal.eraseAttrData())),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},b.prototype.deleteChars=
function(a){this._restrictCursor();var b=this._bufferService.buffer.lines.get(this._bufferService.buffer.y+this._bufferService.buffer.ybase);b&&(b.deleteCells(this._bufferService.buffer.x,a.params[0]||1,this._bufferService.buffer.getNullCell(this._terminal.eraseAttrData())),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},b.prototype.scrollUp=function(a){a=a.params[0]||1;for(var b=this._bufferService.buffer;a--;)b.lines.splice(b.ybase+b.scrollTop,1),b.lines.splice(b.ybase+b.scrollBottom,
0,b.getBlankLine(this._terminal.eraseAttrData()));this._dirtyRowService.markRangeDirty(b.scrollTop,b.scrollBottom)},b.prototype.scrollDown=function(a){a=a.params[0]||1;for(var b=this._bufferService.buffer;a--;)b.lines.splice(b.ybase+b.scrollBottom,1),b.lines.splice(b.ybase+b.scrollTop,0,b.getBlankLine(n.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(b.scrollTop,b.scrollBottom)},b.prototype.scrollLeft=function(a){var b=this._bufferService.buffer;if(!(b.y>b.scrollBottom||b.y<b.scrollTop)){a=
a.params[0]||1;for(var c=b.scrollTop;c<=b.scrollBottom;++c){var d=b.lines.get(b.ybase+c);d.deleteCells(0,a,b.getNullCell(this._terminal.eraseAttrData()));d.isWrapped=!1}this._dirtyRowService.markRangeDirty(b.scrollTop,b.scrollBottom)}},b.prototype.scrollRight=function(a){var b=this._bufferService.buffer;if(!(b.y>b.scrollBottom||b.y<b.scrollTop)){a=a.params[0]||1;for(var c=b.scrollTop;c<=b.scrollBottom;++c){var d=b.lines.get(b.ybase+c);d.insertCells(0,a,b.getNullCell(this._terminal.eraseAttrData()));
d.isWrapped=!1}this._dirtyRowService.markRangeDirty(b.scrollTop,b.scrollBottom)}},b.prototype.insertColumns=function(a){var b=this._bufferService.buffer;if(!(b.y>b.scrollBottom||b.y<b.scrollTop)){a=a.params[0]||1;for(var c=b.scrollTop;c<=b.scrollBottom;++c){var d=this._bufferService.buffer.lines.get(b.ybase+c);d.insertCells(b.x,a,b.getNullCell(this._terminal.eraseAttrData()));d.isWrapped=!1}this._dirtyRowService.markRangeDirty(b.scrollTop,b.scrollBottom)}},b.prototype.deleteColumns=function(a){var b=
this._bufferService.buffer;if(!(b.y>b.scrollBottom||b.y<b.scrollTop)){a=a.params[0]||1;for(var c=b.scrollTop;c<=b.scrollBottom;++c){var d=b.lines.get(b.ybase+c);d.deleteCells(b.x,a,b.getNullCell(this._terminal.eraseAttrData()));d.isWrapped=!1}this._dirtyRowService.markRangeDirty(b.scrollTop,b.scrollBottom)}},b.prototype.eraseChars=function(a){this._restrictCursor();var b=this._bufferService.buffer.lines.get(this._bufferService.buffer.y+this._bufferService.buffer.ybase);b&&(b.replaceCells(this._bufferService.buffer.x,
this._bufferService.buffer.x+(a.params[0]||1),this._bufferService.buffer.getNullCell(this._terminal.eraseAttrData())),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},b.prototype.repeatPrecedingCharacter=function(a){if(this._parser.precedingCodepoint){a=a.params[0]||1;for(var b=new Uint32Array(a),c=0;c<a;++c)b[c]=this._parser.precedingCodepoint;this.print(b,0,b.length)}},b.prototype.sendDeviceAttributesPrimary=function(a){0<a.params[0]||(this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||
this._terminal.is("screen")?this._coreService.triggerDataEvent(g.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._coreService.triggerDataEvent(g.C0.ESC+"[?6c"))},b.prototype.sendDeviceAttributesSecondary=function(a){0<a.params[0]||(this._terminal.is("xterm")?this._coreService.triggerDataEvent(g.C0.ESC+"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._coreService.triggerDataEvent(g.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._coreService.triggerDataEvent(a.params[0]+"c"):this._terminal.is("screen")&&
this._coreService.triggerDataEvent(g.C0.ESC+"[>83;40003;0c"))},b.prototype.setMode=function(a){for(var b=0;b<a.length;b++)switch(a.params[b]){case 4:this._terminal.insertMode=!0}},b.prototype.setModePrivate=function(a){for(var b=0;b<a.length;b++)switch(a.params[b]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._terminal.setgCharset(0,k.DEFAULT_CHARSET);this._terminal.setgCharset(1,k.DEFAULT_CHARSET);this._terminal.setgCharset(2,k.DEFAULT_CHARSET);this._terminal.setgCharset(3,
k.DEFAULT_CHARSET);break;case 3:this._terminal.savedCols=this._bufferService.cols;this._terminal.resize(132,this._bufferService.rows);this._terminal.reset();break;case 6:this._terminal.originMode=!0;this._setCursor(0,0);break;case 7:this._terminal.wraparoundMode=!0;break;case 66:this._logService.debug("Serial port requested application keypad.");this._terminal.applicationKeypad=!0;this._terminal.viewport&&this._terminal.viewport.syncScrollArea();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._terminal.sendFocus=!0;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 25:this._coreService.isCursorHidden=!1;
break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._terminal.eraseAttrData());this._terminal.refresh(0,this._bufferService.rows-1);this._terminal.viewport&&this._terminal.viewport.syncScrollArea();this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!0}},b.prototype.resetMode=function(a){for(var b=0;b<a.length;b++)switch(a.params[b]){case 4:this._terminal.insertMode=!1}},b.prototype.resetModePrivate=
function(a){for(var b=0;b<a.length;b++)switch(a.params[b]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:132===this._bufferService.cols&&this._terminal.savedCols&&this._terminal.resize(this._terminal.savedCols,this._bufferService.rows);delete this._terminal.savedCols;this._terminal.reset();break;case 6:this._terminal.originMode=!1;this._setCursor(0,0);break;case 7:this._terminal.wraparoundMode=!1;break;case 66:this._logService.debug("Switching back to normal keypad.");
this._terminal.applicationKeypad=!1;this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1E3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._terminal.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 25:this._coreService.isCursorHidden=
!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer();1049===a.params[b]&&this.restoreCursor();this._terminal.refresh(0,this._bufferService.rows-1);this._terminal.viewport&&this._terminal.viewport.syncScrollArea();this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!1}},b.prototype._extractColor=function(a,b,c){var d=[0,0,-1,0,0,0],e=0,f=0;do{if(d[f+e]=a.params[b+f],a.hasSubParams(b+f)){a=a.getSubParams(b+
f);b=0;do 5===d[1]&&(e=1),d[f+b+1+e]=a[b];while(++b<a.length&&b+f+1+e<d.length);break}if(5===d[1]&&2<=f+e||2===d[1]&&5<=f+e)break;d[1]&&(e=1)}while(++f+b<a.length&&f+e<d.length);for(b=2;b<d.length;++b)-1===d[b]&&(d[b]=0);return 38===d[0]?2===d[1]?(c.fg|=50331648,c.fg&=-16777216,c.fg|=H.AttributeData.fromColorRGB([d[3],d[4],d[5]])):5===d[1]&&(c.fg&=-50331904,c.fg=c.fg|33554432|255&d[3]):48===d[0]&&(2===d[1]?(c.bg|=50331648,c.bg&=-16777216,c.bg|=H.AttributeData.fromColorRGB([d[3],d[4],d[5]])):5===d[1]&&
(c.bg&=-50331904,c.bg=c.bg|33554432|255&d[3])),f},b.prototype.charAttributes=function(a){if(1===a.length&&0===a.params[0])return this._terminal.curAttrData.fg=n.DEFAULT_ATTR_DATA.fg,void(this._terminal.curAttrData.bg=n.DEFAULT_ATTR_DATA.bg);for(var b,c=a.length,d=this._terminal.curAttrData,e=0;e<c;e++)30<=(b=a.params[e])&&37>=b?(d.fg&=-50331904,d.fg=d.fg|16777216|b-30):40<=b&&47>=b?(d.bg&=-50331904,d.bg=d.bg|16777216|b-40):90<=b&&97>=b?(d.fg&=-50331904,d.fg=d.fg|16777224|b-90):100<=b&&107>=b?(d.bg&=
-50331904,d.bg=d.bg|16777224|b-100):0===b?(d.fg=n.DEFAULT_ATTR_DATA.fg,d.bg=n.DEFAULT_ATTR_DATA.bg):1===b?d.fg|=134217728:3===b?d.bg|=67108864:4===b?d.fg|=268435456:5===b?d.fg|=536870912:7===b?d.fg|=67108864:8===b?d.fg|=1073741824:2===b?d.bg|=134217728:22===b?(d.fg&=-134217729,d.bg&=-134217729):23===b?d.bg&=-67108865:24===b?d.fg&=-268435457:25===b?d.fg&=-536870913:27===b?d.fg&=-67108865:28===b?d.fg&=-1073741825:39===b?(d.fg&=-67108864,d.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):49===b?(d.bg&=-67108864,
d.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):38===b||48===b?e+=this._extractColor(a,e,d):100===b?(d.fg&=-67108864,d.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,d.bg&=-67108864,d.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",b)},b.prototype.deviceStatus=function(a){switch(a.params[0]){case 5:this._coreService.triggerDataEvent(g.C0.ESC+"[0n");break;case 6:this._coreService.triggerDataEvent(g.C0.ESC+"["+(this._bufferService.buffer.y+1)+";"+(this._bufferService.buffer.x+1)+
"R")}},b.prototype.deviceStatusPrivate=function(a){switch(a.params[0]){case 6:this._coreService.triggerDataEvent(g.C0.ESC+"[?"+(this._bufferService.buffer.y+1)+";"+(this._bufferService.buffer.x+1)+"R")}},b.prototype.softReset=function(a){this._coreService.isCursorHidden=!1;this._terminal.insertMode=!1;this._terminal.originMode=!1;this._terminal.wraparoundMode=!0;this._terminal.applicationKeypad=!1;this._terminal.viewport&&this._terminal.viewport.syncScrollArea();this._coreService.decPrivateModes.applicationCursorKeys=
!1;this._bufferService.buffer.scrollTop=0;this._bufferService.buffer.scrollBottom=this._bufferService.rows-1;this._terminal.curAttrData=n.DEFAULT_ATTR_DATA.clone();this._bufferService.buffer.x=this._bufferService.buffer.y=0;this._terminal.charset=null;this._terminal.glevel=0;this._terminal.charsets=[null]},b.prototype.setCursorStyle=function(a){a=a.params[0]||1;switch(a){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";
break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}this._optionsService.options.cursorBlink=1==a%2},b.prototype.setScrollRegion=function(a){var b,c=a.params[0]||1;(2>a.length||(b=a.params[1])>this._bufferService.rows||0===b)&&(b=this._bufferService.rows);b>c&&(this._bufferService.buffer.scrollTop=c-1,this._bufferService.buffer.scrollBottom=b-1,this._setCursor(0,0))},b.prototype.saveCursor=function(a){this._bufferService.buffer.savedX=this._bufferService.buffer.x;this._bufferService.buffer.savedY=
this._bufferService.buffer.ybase+this._bufferService.buffer.y;this._bufferService.buffer.savedCurAttrData.fg=this._terminal.curAttrData.fg;this._bufferService.buffer.savedCurAttrData.bg=this._terminal.curAttrData.bg;this._bufferService.buffer.savedCharset=this._terminal.charset},b.prototype.restoreCursor=function(a){this._bufferService.buffer.x=this._bufferService.buffer.savedX||0;this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0);this._terminal.curAttrData.fg=
this._bufferService.buffer.savedCurAttrData.fg;this._terminal.curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg;this._terminal.charset=this._savedCharset;this._bufferService.buffer.savedCharset&&(this._terminal.charset=this._bufferService.buffer.savedCharset);this._restrictCursor()},b.prototype.setTitle=function(a){this._terminal.handleTitle(a)},b.prototype.nextLine=function(){this._bufferService.buffer.x=0;this.index()},b.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad.");
this._terminal.applicationKeypad=!0;this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},b.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad.");this._terminal.applicationKeypad=!1;this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},b.prototype.selectDefaultCharset=function(){this._terminal.setgLevel(0);this._terminal.setgCharset(0,k.DEFAULT_CHARSET)},b.prototype.selectCharset=function(a){2===a.length?"/"!==a[0]&&this._terminal.setgCharset(Pb[a[0]],
k.CHARSETS[a[1]]||k.DEFAULT_CHARSET):this.selectDefaultCharset()},b.prototype.index=function(){this._restrictCursor();var a=this._bufferService.buffer;this._bufferService.buffer.y++;a.y===a.scrollBottom+1?(a.y--,this._terminal.scroll()):a.y>=this._bufferService.rows&&(a.y=this._bufferService.rows-1);this._restrictCursor()},b.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},b.prototype.reverseIndex=function(){this._restrictCursor();var a=this._bufferService.buffer;
a.y===a.scrollTop?(a.lines.shiftElements(a.y+a.ybase,a.scrollBottom-a.scrollTop,1),a.lines.set(a.y+a.ybase,a.getBlankLine(this._terminal.eraseAttrData())),this._dirtyRowService.markRangeDirty(a.scrollTop,a.scrollBottom)):(a.y--,this._restrictCursor())},b.prototype.reset=function(){this._parser.reset();this._terminal.reset()},b.prototype.setgLevel=function(a){this._terminal.setgLevel(a)},b.prototype.screenAlignmentPattern=function(){var a=new D.CellData;a.content=4194373;a.fg=this._terminal.curAttrData.fg;
a.bg=this._terminal.curAttrData.bg;var b=this._bufferService.buffer;this._setCursor(0,0);for(var c=0;c<this._bufferService.rows;++c){var d=b.y+b.ybase+c;b.lines.get(d).fill(a);b.lines.get(d).isWrapped=!1}this._dirtyRowService.markAllDirty();this._setCursor(0,0)},b}(a.Disposable);c.InputHandler=d},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&
(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)});Object.defineProperty(c,"__esModule",{value:!0});a=d(2);var g=d(15),k=d(20),q=d(21),t=d(23),p=function(){function a(a){this.table=new Uint8Array(a)}return a.prototype.setDefault=function(a,b){g.fill(this.table,a<<4|b)},a.prototype.add=function(a,b,c,d){this.table[b<<8|a]=c<<4|d},a.prototype.addMany=function(a,b,c,d){for(var e=0;e<a.length;e++)this.table[b<<
8|a[e]]=c<<4|d},a}();c.TransitionTable=p;c.VT500_TRANSITION_TABLE=function(){var a=new p(4095),b=Array.apply(null,Array(256)).map(function(a,b){return b}),c=function(a,c){return b.slice(a,c)},d=c(32,127),e=c(0,24);e.push(25);e.push.apply(e,c(28,32));var f,g=c(0,14);for(f in a.setDefault(1,0),a.addMany(d,0,2,0),g)a.addMany([24,26,153,154],f,3,0),a.addMany(c(128,144),f,3,0),a.addMany(c(144,152),f,3,0),a.add(156,f,0,0),a.add(27,f,11,1),a.add(157,f,4,8),a.addMany([152,158,159],f,0,7),a.add(155,f,11,3),
a.add(144,f,11,9);return a.addMany(e,0,3,0),a.addMany(e,1,3,1),a.add(127,1,0,1),a.addMany(e,8,0,8),a.addMany(e,3,3,3),a.add(127,3,0,3),a.addMany(e,4,3,4),a.add(127,4,0,4),a.addMany(e,6,3,6),a.addMany(e,5,3,5),a.add(127,5,0,5),a.addMany(e,2,3,2),a.add(127,2,0,2),a.add(93,1,4,8),a.addMany(d,8,5,8),a.add(127,8,5,8),a.addMany([156,27,24,26,7],8,6,0),a.addMany(c(28,32),8,0,8),a.addMany([88,94,95],1,0,7),a.addMany(d,7,0,7),a.addMany(e,7,0,7),a.add(156,7,0,0),a.add(127,7,0,7),a.add(91,1,11,3),a.addMany(c(64,
127),3,7,0),a.addMany(c(48,60),3,8,4),a.addMany([60,61,62,63],3,9,4),a.addMany(c(48,60),4,8,4),a.addMany(c(64,127),4,7,0),a.addMany([60,61,62,63],4,0,6),a.addMany(c(32,64),6,0,6),a.add(127,6,0,6),a.addMany(c(64,127),6,0,0),a.addMany(c(32,48),3,9,5),a.addMany(c(32,48),5,9,5),a.addMany(c(48,64),5,0,6),a.addMany(c(64,127),5,7,0),a.addMany(c(32,48),4,9,5),a.addMany(c(32,48),1,9,2),a.addMany(c(32,48),2,9,2),a.addMany(c(48,127),2,10,0),a.addMany(c(48,80),1,10,0),a.addMany(c(81,88),1,10,0),a.addMany([89,
90,92],1,10,0),a.addMany(c(96,127),1,10,0),a.add(80,1,11,9),a.addMany(e,9,0,9),a.add(127,9,0,9),a.addMany(c(28,32),9,0,9),a.addMany(c(32,48),9,9,12),a.addMany(c(48,60),9,8,10),a.addMany([60,61,62,63],9,9,10),a.addMany(e,11,0,11),a.addMany(c(32,128),11,0,11),a.addMany(c(28,32),11,0,11),a.addMany(e,10,0,10),a.add(127,10,0,10),a.addMany(c(28,32),10,0,10),a.addMany(c(48,60),10,8,10),a.addMany([60,61,62,63],10,0,11),a.addMany(c(32,48),10,9,12),a.addMany(e,12,0,12),a.add(127,12,0,12),a.addMany(c(28,32),
12,0,12),a.addMany(c(32,48),12,9,12),a.addMany(c(48,64),12,0,11),a.addMany(c(64,127),12,12,13),a.addMany(c(64,127),10,12,13),a.addMany(c(64,127),9,12,13),a.addMany(e,13,13,13),a.addMany(d,13,13,13),a.add(127,13,0,13),a.addMany([27,156,24,26],13,14,0),a.add(160,0,2,0),a.add(160,8,5,8),a.add(160,6,0,6),a.add(160,11,0,11),a.add(160,13,13,13),a}();d=function(a){function b(b){void 0===b&&(b=c.VT500_TRANSITION_TABLE);var d=a.call(this)||this;return d.TRANSITIONS=b,d.initialState=0,d.currentState=d.initialState,
d._params=new k.Params,d._params.addParam(0),d._collect=0,d.precedingCodepoint=0,d._printHandlerFb=function(a,b,c){},d._executeHandlerFb=function(a){},d._csiHandlerFb=function(a,b){},d._escHandlerFb=function(a){},d._errorHandlerFb=function(a){return a},d._printHandler=d._printHandlerFb,d._executeHandlers=Object.create(null),d._csiHandlers=Object.create(null),d._escHandlers=Object.create(null),d._oscParser=new q.OscParser,d._dcsParser=new t.DcsParser,d._errorHandler=d._errorHandlerFb,d.setEscHandler({final:"\\"},
function(){}),d}return e(b,a),b.prototype._identifier=function(a,b){void 0===b&&(b=[64,126]);var c=0;if(a.prefix){if(1<a.prefix.length)throw Error("only one byte as prefix supported");if((c=a.prefix.charCodeAt(0))&&60>c||63<c)throw Error("prefix must be in range 0x3c .. 0x3f");}if(a.intermediates){if(2<a.intermediates.length)throw Error("only two bytes as intermediates are supported");for(var d=0;d<a.intermediates.length;++d){var e=a.intermediates.charCodeAt(d);if(32>e||47<e)throw Error("intermediate must be in range 0x20 .. 0x2f");
c<<=8;c|=e}}if(1!==a.final.length)throw Error("final must be a single byte");a=a.final.charCodeAt(0);if(b[0]>a||a>b[1])throw Error("final must be in range "+b[0]+" .. "+b[1]);return c<<=8,c|a},b.prototype.identToString=function(a){for(var b=[];a;)b.push(String.fromCharCode(255&a)),a>>=8;return b.reverse().join("")},b.prototype.dispose=function(){this._csiHandlers=Object.create(null);this._executeHandlers=Object.create(null);this._escHandlers=Object.create(null);this._oscParser.dispose();this._dcsParser.dispose()},
b.prototype.setPrintHandler=function(a){this._printHandler=a},b.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},b.prototype.addEscHandler=function(a,b){a=this._identifier(a,[48,126]);void 0===this._escHandlers[a]&&(this._escHandlers[a]=[]);var c=this._escHandlers[a];return c.push(b),{dispose:function(){var a=c.indexOf(b);-1!==a&&c.splice(a,1)}}},b.prototype.setEscHandler=function(a,b){this._escHandlers[this._identifier(a,[48,126])]=[b]},b.prototype.clearEscHandler=
function(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]},b.prototype.setEscHandlerFallback=function(a){this._escHandlerFb=a},b.prototype.setExecuteHandler=function(a,b){this._executeHandlers[a.charCodeAt(0)]=b},b.prototype.clearExecuteHandler=function(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]},b.prototype.setExecuteHandlerFallback=function(a){this._executeHandlerFb=a},b.prototype.addCsiHandler=
function(a,b){a=this._identifier(a);void 0===this._csiHandlers[a]&&(this._csiHandlers[a]=[]);var c=this._csiHandlers[a];return c.push(b),{dispose:function(){var a=c.indexOf(b);-1!==a&&c.splice(a,1)}}},b.prototype.setCsiHandler=function(a,b){this._csiHandlers[this._identifier(a)]=[b]},b.prototype.clearCsiHandler=function(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]},b.prototype.setCsiHandlerFallback=function(a){this._csiHandlerFb=a},b.prototype.addDcsHandler=
function(a,b){return this._dcsParser.addHandler(this._identifier(a),b)},b.prototype.setDcsHandler=function(a,b){this._dcsParser.setHandler(this._identifier(a),b)},b.prototype.clearDcsHandler=function(a){this._dcsParser.clearHandler(this._identifier(a))},b.prototype.setDcsHandlerFallback=function(a){this._dcsParser.setHandlerFallback(a)},b.prototype.addOscHandler=function(a,b){return this._oscParser.addHandler(a,b)},b.prototype.setOscHandler=function(a,b){this._oscParser.setHandler(a,b)},b.prototype.clearOscHandler=
function(a){this._oscParser.clearHandler(a)},b.prototype.setOscHandlerFallback=function(a){this._oscParser.setHandlerFallback(a)},b.prototype.setErrorHandler=function(a){this._errorHandler=a},b.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},b.prototype.reset=function(){this.currentState=this.initialState;this._oscParser.reset();this._dcsParser.reset();this._params.reset();this._params.addParam(0);this.precedingCodepoint=this._collect=0},b.prototype.parse=function(a,
b){for(var c=0,d,e=this.currentState,f=this._oscParser,g=this._dcsParser,h=this._collect,k=this._params,n=this.TRANSITIONS.table,p=0;p<b;++p){switch((d=n[e<<8|(160>(c=a[p])?c:160)])>>4){case 2:for(e=p+1;;++e){if(e>=b||32>(c=a[e])||126<c&&160>c){this._printHandler(a,p,e);p=e-1;break}if(++e>=b||32>(c=a[e])||126<c&&160>c){this._printHandler(a,p,e);p=e-1;break}if(++e>=b||32>(c=a[e])||126<c&&160>c){this._printHandler(a,p,e);p=e-1;break}if(++e>=b||32>(c=a[e])||126<c&&160>c){this._printHandler(a,p,e);p=
e-1;break}}break;case 3:this._executeHandlers[c]?this._executeHandlers[c]():this._executeHandlerFb(c);this.precedingCodepoint=0;break;case 1:if(this._errorHandler({position:p,code:c,currentState:e,collect:h,params:k,abort:!1}).abort)return;break;case 7:for(var r=(e=this._csiHandlers[h<<8|c])?e.length-1:-1;0<=r&&!1===e[r](k);r--);0>r&&this._csiHandlerFb(h<<8|c,k);this.precedingCodepoint=0;break;case 8:do switch(c){case 59:k.addParam(0);break;case 58:k.addSubParam(-1);break;default:k.addDigit(c-48)}while(++p<
b&&47<(c=a[p])&&60>c);p--;break;case 9:h<<=8;h|=c;break;case 10:for(r=(e=this._escHandlers[h<<8|c])?e.length-1:-1;0<=r&&!1===e[r]();r--);0>r&&this._escHandlerFb(h<<8|c);this.precedingCodepoint=0;break;case 11:k.reset();k.addParam(0);h=0;break;case 12:g.hook(h<<8|c,k);break;case 13:for(e=p+1;;++e)if(e>=b||24===(c=a[e])||26===c||27===c||127<c&&160>c){g.put(a,p,e);p=e-1;break}break;case 14:g.unhook(24!==c&&26!==c);27===c&&(d|=1);k.reset();k.addParam(0);this.precedingCodepoint=h=0;break;case 4:f.start();
break;case 5:for(e=p+1;;e++)if(e>=b||32>(c=a[e])||127<c&&159>=c){f.put(a,p,e);p=e-1;break}break;case 6:f.end(24!==c&&26!==c),27===c&&(d|=1),k.reset(),k.addParam(0),this.precedingCodepoint=h=0}e=15&d}this._collect=h;this.currentState=e},b}(a.Disposable);c.EscapeSequenceParser=d},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,
c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}),g=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},k=this&&this.__param||function(a,
b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,"__esModule",{value:!0});var q=d(41),t=d(47),p=d(48),v=d(49),n=d(28);a=d(2);var r=d(4),x=d(0),D=d(24),H=d(1),La=1;d=function(a){function b(b,c,d,e,f,g,h,k){var r=a.call(this)||this;r._colors=b;r._screenElement=c;r._linkifier=d;r._bufferService=e;r._charSizeService=f;r._optionsService=g;r.coreService=h;r.coreBrowserService=k;r._id=La++;r._onRequestRefreshRows=new H.EventEmitter;b=r._optionsService.options.allowTransparency;return r._characterJoinerRegistry=
new n.CharacterJoinerRegistry(r._bufferService),r._renderLayers=[new q.TextRenderLayer(r._screenElement,0,r._colors,r._characterJoinerRegistry,b,r._id,r._bufferService,g),new t.SelectionRenderLayer(r._screenElement,1,r._colors,r._id,r._bufferService,g),new v.LinkRenderLayer(r._screenElement,2,r._colors,r._id,r._linkifier,r._bufferService,g),new p.CursorRenderLayer(r._screenElement,3,r._colors,r._id,r._onRequestRefreshRows,r._bufferService,g,h,k)],r.dimensions={scaledCharWidth:0,scaledCharHeight:0,
scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},r._devicePixelRatio=window.devicePixelRatio,r._updateDimensions(),r.onOptionsChanged(),r}return e(b,a),Object.defineProperty(b.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!0,configurable:!0}),b.prototype.dispose=function(){a.prototype.dispose.call(this);this._renderLayers.forEach(function(a){return a.dispose()});
D.removeTerminalFromCache(this._id)},b.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},b.prototype.setColors=function(a){var b=this;this._colors=a;this._renderLayers.forEach(function(a){a.setColors(b._colors);a.reset()})},b.prototype.onResize=function(a,b){var c=this;this._updateDimensions();this._renderLayers.forEach(function(a){return a.resize(c.dimensions)});
this._screenElement.style.width=this.dimensions.canvasWidth+"px";this._screenElement.style.height=this.dimensions.canvasHeight+"px"},b.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},b.prototype.onBlur=function(){this._runOperation(function(a){return a.onBlur()})},b.prototype.onFocus=function(){this._runOperation(function(a){return a.onFocus()})},b.prototype.onSelectionChanged=function(a,b,c){void 0===c&&(c=!1);this._runOperation(function(d){return d.onSelectionChanged(a,
b,c)})},b.prototype.onCursorMove=function(){this._runOperation(function(a){return a.onCursorMove()})},b.prototype.onOptionsChanged=function(){this._runOperation(function(a){return a.onOptionsChanged()})},b.prototype.clear=function(){this._runOperation(function(a){return a.reset()})},b.prototype._runOperation=function(a){this._renderLayers.forEach(function(b){return a(b)})},b.prototype.renderRows=function(a,b){this._renderLayers.forEach(function(c){return c.onGridChanged(a,b)})},b.prototype._updateDimensions=
function(){this._charSizeService.hasValidSize&&(this.dimensions.scaledCharWidth=Math.floor(this._charSizeService.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharTop=1===this._optionsService.options.lineHeight?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/
2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._optionsService.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._bufferService.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._bufferService.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=
Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols)},b.prototype.registerCharacterJoiner=function(a){return this._characterJoinerRegistry.registerCharacterJoiner(a)},b.prototype.deregisterCharacterJoiner=function(a){return this._characterJoinerRegistry.deregisterCharacterJoiner(a)},b=g([k(3,x.IBufferService),
k(4,r.ICharSizeService),k(5,x.IOptionsService),k(6,x.ICoreService),k(7,r.ICoreBrowserService)],b)}(a.Disposable);c.Renderer=d},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)});Object.defineProperty(c,
"__esModule",{value:!0});var g=d(42);a=d(13);var k=d(6),q=d(3),t=d(28),p=d(5);d=function(a){function b(b,c,d,e,f,h,k,n){b=a.call(this,b,"text",c,f,d,h,k,n)||this;return b.bufferService=k,b.optionsService=n,b._characterWidth=0,b._characterFont="",b._characterOverlapCache={},b._workCell=new p.CellData,b._state=new g.GridCache,b._characterJoinerRegistry=e,b}return e(b,a),b.prototype.resize=function(b){a.prototype.resize.call(this,b);var c=this._getFont(!1,!1);this._characterWidth===b.scaledCharWidth&&
this._characterFont===c||(this._characterWidth=b.scaledCharWidth,this._characterFont=c,this._characterOverlapCache={});this._state.clear();this._state.resize(this._bufferService.cols,this._bufferService.rows)},b.prototype.reset=function(){this._state.clear();this._clearAll()},b.prototype._forEachCell=function(a,b,c,d){for(;a<=b;a++){var e=a+this._bufferService.buffer.ydisp,f=this._bufferService.buffer.lines.get(e);e=c?c.getJoinedCharacters(e):[];for(var g=0;g<this._bufferService.cols;g++){f.loadCell(g,
this._workCell);var h=this._workCell,k=!1,n=g;0!==h.getWidth()&&(0<e.length&&g===e[0][0]&&(k=!0,n=e.shift(),h=new t.JoinedCellData(this._workCell,f.translateToString(!0,n[0],n[1]),n[1]-n[0]),n=n[1]-1),!k&&this._isOverlapping(h)&&n<f.length-1&&f.getCodePoint(n+1)===q.NULL_CELL_CODE&&(h.content&=-12582913,h.content|=8388608),d(h,g,a),g=n)}}},b.prototype._drawBackground=function(a,b){var c=this,d=this._ctx,e=this._bufferService.cols,f=0,g=0,h=null;d.save();this._forEachCell(a,b,null,function(a,b,n){var p=
null;a.isInverse()?p=a.isFgDefault()?c._colors.foreground.css:a.isFgRGB()?"rgb("+k.AttributeData.toColorRGB(a.getFgColor()).join(",")+")":c._colors.ansi[a.getFgColor()].css:a.isBgRGB()?p="rgb("+k.AttributeData.toColorRGB(a.getBgColor()).join(",")+")":a.isBgPalette()&&(p=c._colors.ansi[a.getBgColor()].css);null===h&&(f=b,g=n);n!==g?(d.fillStyle=h||"",c._fillCells(f,g,e-f,1),f=b,g=n):h!==p&&(d.fillStyle=h||"",c._fillCells(f,g,b-f,1),f=b,g=n);h=p});null!==h&&(d.fillStyle=h,this._fillCells(f,g,e-f,1));
d.restore()},b.prototype._drawForeground=function(a,b){var c=this;this._forEachCell(a,b,this._characterJoinerRegistry,function(a,b,d){if(!a.isInvisible()&&(c._drawChars(a,b,d),a.isUnderline())){if(c._ctx.save(),a.isInverse())if(a.isBgDefault())c._ctx.fillStyle=c._colors.background.css;else if(a.isBgRGB())c._ctx.fillStyle="rgb("+k.AttributeData.toColorRGB(a.getBgColor()).join(",")+")";else{var e=a.getBgColor();c._optionsService.options.drawBoldTextInBrightColors&&a.isBold()&&8>e&&(e+=8);c._ctx.fillStyle=
c._colors.ansi[e].css}else a.isFgDefault()?c._ctx.fillStyle=c._colors.foreground.css:a.isFgRGB()?c._ctx.fillStyle="rgb("+k.AttributeData.toColorRGB(a.getFgColor()).join(",")+")":(e=a.getFgColor(),c._optionsService.options.drawBoldTextInBrightColors&&a.isBold()&&8>e&&(e+=8),c._ctx.fillStyle=c._colors.ansi[e].css);c._fillBottomLineAtCells(b,d,a.getWidth());c._ctx.restore()}})},b.prototype.onGridChanged=function(a,b){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,
a,this._bufferService.cols,b-a+1),this._drawBackground(a,b),this._drawForeground(a,b))},b.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},b.prototype._isOverlapping=function(a){if(1!==a.getWidth()||256>a.getCode())return!1;a=a.getChars();if(this._characterOverlapCache.hasOwnProperty(a))return this._characterOverlapCache[a];this._ctx.save();this._ctx.font=this._characterFont;var b=Math.floor(this._ctx.measureText(a).width)>this._characterWidth;
return this._ctx.restore(),this._characterOverlapCache[a]=b,b},b}(a.BaseRenderLayer);c.TextRenderLayer=d},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=function(){function a(){this.cache=[]}return a.prototype.resize=function(a,b){for(var c=0;c<a;c++){this.cache.length<=c&&this.cache.push([]);for(var d=this.cache[c].length;d<b;d++)this.cache[c].push(void 0);this.cache[c].length=b}this.cache.length=a},a.prototype.clear=function(){for(var a=0;a<this.cache.length;a++)for(var b=0;b<
this.cache[a].length;b++)this.cache[a][b]=void 0},a}();c.GridCache=a},function(a,c,d){function b(a){return a.code<<21|a.bg<<12|a.fg<<3|(a.bold?0:4)+(a.dim?0:2)+(a.italic?0:1)}var e,g=this&&this.__extends||(e=function(a,b){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,b)},function(a,b){function c(){this.constructor=a}e(a,b);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,
new c)});Object.defineProperty(c,"__esModule",{value:!0});var k=d(9);a=d(44);var q=d(26),t=d(46),p=d(11),v=d(27),n=d(10),r={css:"rgba(0, 0, 0, 0)",rgba:0};c.getGlyphCacheKey=b;d=function(a){function c(b,c){var d=a.call(this)||this;d._config=c;d._drawToCacheCount=0;d._glyphsWaitingOnBitmap=[];d._bitmapCommitTimeout=null;d._bitmap=null;d._cacheCanvas=b.createElement("canvas");d._cacheCanvas.width=1024;d._cacheCanvas.height=1024;d._cacheCtx=v.throwIfFalsy(d._cacheCanvas.getContext("2d",{alpha:!0}));
b=b.createElement("canvas");b.width=d._config.scaledCharWidth;b.height=d._config.scaledCharHeight;d._tmpCtx=v.throwIfFalsy(b.getContext("2d",{alpha:d._config.allowTransparency}));d._width=Math.floor(1024/d._config.scaledCharWidth);d._height=Math.floor(1024/d._config.scaledCharHeight);b=d._width*d._height;return d._cacheMap=new t.LRUMap(b),d._cacheMap.prealloc(b),d}return g(c,a),c.prototype.dispose=function(){null!==this._bitmapCommitTimeout&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=
null)},c.prototype.beginFrame=function(){this._drawToCacheCount=0},c.prototype.draw=function(a,c,d,e){if(32===c.code)return!0;if(!this._canCache(c))return!1;var f=b(c),g=this._cacheMap.get(f);return null!=g?(this._drawFromCache(a,g,d,e),!0):100>this._drawToCacheCount?(g=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index,c=this._drawToCache(c,g),this._cacheMap.set(f,c),this._drawFromCache(a,c,d,e),!0):!1},c.prototype._canCache=function(a){return 256>a.code},
c.prototype._toCoordinateX=function(a){return a%this._width*this._config.scaledCharWidth},c.prototype._toCoordinateY=function(a){return Math.floor(a/this._width)*this._config.scaledCharHeight},c.prototype._drawFromCache=function(a,b,c,d){if(!b.isEmpty){var e=this._toCoordinateX(b.index),f=this._toCoordinateY(b.index);a.drawImage(b.inBitmap?this._bitmap:this._cacheCanvas,e,f,this._config.scaledCharWidth,this._config.scaledCharHeight,c,d,this._config.scaledCharWidth,this._config.scaledCharHeight)}},
c.prototype._getColorFromAnsiIndex=function(a){return a<this._config.colors.ansi.length?this._config.colors.ansi[a]:q.DEFAULT_ANSI_COLORS[a]},c.prototype._getBackgroundColor=function(a){return this._config.allowTransparency?r:a.bg===k.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:256>a.bg?this._getColorFromAnsiIndex(a.bg):this._config.colors.background},c.prototype._getForegroundColor=function(a){return a.fg===k.INVERTED_DEFAULT_COLOR?n.opaque(this._config.colors.background):256>a.fg?this._getColorFromAnsiIndex(a.fg):
this._config.colors.foreground},c.prototype._drawToCache=function(a,b){this._drawToCacheCount++;this._tmpCtx.save();var c=this._getBackgroundColor(a);this._tmpCtx.globalCompositeOperation="copy";this._tmpCtx.fillStyle=c.css;this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight);this._tmpCtx.globalCompositeOperation="source-over";this._tmpCtx.font=(a.italic?"italic":"")+" "+(a.bold?this._config.fontWeightBold:this._config.fontWeight)+" "+this._config.fontSize*this._config.devicePixelRatio+
"px "+this._config.fontFamily;this._tmpCtx.textBaseline="middle";this._tmpCtx.fillStyle=this._getForegroundColor(a).css;a.dim&&(this._tmpCtx.globalAlpha=k.DIM_OPACITY);this._tmpCtx.fillText(a.chars,0,this._config.scaledCharHeight/2);this._tmpCtx.restore();a=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight);var d=!1;if(!this._config.allowTransparency){d=!0;var e=c.rgba>>>24,f=c.rgba>>>16&255;c=c.rgba>>>8&255;for(var g=0;g<a.data.length;g+=4)a.data[g]===e&&a.data[g+
1]===f&&a.data[g+2]===c?a.data[g+3]=0:d=!1}c=this._toCoordinateX(b);e=this._toCoordinateY(b);this._cacheCtx.putImageData(a,c,e);b={index:b,isEmpty:d,inBitmap:!1};return this._addGlyphToBitmap(b),b},c.prototype._addGlyphToBitmap=function(a){var b=this;"createImageBitmap"in window&&!p.isFirefox&&!p.isSafari&&(this._glyphsWaitingOnBitmap.push(a),null===this._bitmapCommitTimeout&&(this._bitmapCommitTimeout=window.setTimeout(function(){return b._generateBitmap()},100)))},c.prototype._generateBitmap=function(){var a=
this,b=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[];window.createImageBitmap(this._cacheCanvas).then(function(c){a._bitmap=c;for(c=0;c<b.length;c++)b[c].inBitmap=!0});this._bitmapCommitTimeout=null},c}(a.BaseCharAtlas);c.DynamicCharAtlas=d;d=function(a){function b(b,c){return a.call(this)||this}return g(b,a),b.prototype.draw=function(a,b,c,d){return!1},b}(a.BaseCharAtlas);c.NoneCharAtlas=d},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=function(){function a(){this._didWarmUp=
!1}return a.prototype.dispose=function(){},a.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},a.prototype._doWarmUp=function(){},a.prototype.beginFrame=function(){},a}();c.BaseCharAtlas=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=function(){function a(){this._color={};this._rgba={}}return a.prototype.clear=function(){this._color={};this._rgba={}},a.prototype.setCss=function(a,b,c){this._rgba[a]||(this._rgba[a]={});this._rgba[a][b]=c},a.prototype.getCss=
function(a,b){return this._rgba[a]?this._rgba[a][b]:void 0},a.prototype.setColor=function(a,b,c){this._color[a]||(this._color[a]={});this._color[a][b]=c},a.prototype.getColor=function(a,b){return this._color[a]?this._color[a][b]:void 0},a}();c.ColorContrastCache=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=function(){function a(a){this.capacity=a;this._map={};this._tail=this._head=null;this._nodePool=[];this.size=0}return a.prototype._unlinkNode=function(a){var b=a.prev,c=
a.next;a===this._head&&(this._head=c);a===this._tail&&(this._tail=b);null!==b&&(b.next=c);null!==c&&(c.prev=b)},a.prototype._appendNode=function(a){var b=this._tail;null!==b&&(b.next=a);a.prev=b;a.next=null;this._tail=a;null===this._head&&(this._head=a)},a.prototype.prealloc=function(a){for(var b=this._nodePool,c=0;c<a;c++)b.push({prev:null,next:null,key:null,value:null})},a.prototype.get=function(a){a=this._map[a];return void 0!==a?(this._unlinkNode(a),this._appendNode(a),a.value):null},a.prototype.peekValue=
function(a){a=this._map[a];return void 0!==a?a.value:null},a.prototype.peek=function(){var a=this._head;return null===a?null:a.value},a.prototype.set=function(a,b){var c=this._map[a];if(void 0!==c)c=this._map[a],this._unlinkNode(c),c.value=b;else if(this.size>=this.capacity)c=this._head,this._unlinkNode(c),delete this._map[c.key],c.key=a,c.value=b,this._map[a]=c;else{var d=this._nodePool;0<d.length?((c=d.pop()).key=a,c.value=b):c={prev:null,next:null,key:a,value:b};this._map[a]=c;this.size++}this._appendNode(c)},
a}();c.LRUMap=a},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)});Object.defineProperty(c,"__esModule",{value:!0});a=function(a){function b(b,c,d,e,f,g){b=a.call(this,b,"selection",c,!0,d,e,f,g)||this;
return b.bufferService=f,b.optionsService=g,b._clearState(),b}return e(b,a),b.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},b.prototype.resize=function(b){a.prototype.resize.call(this,b);this._clearState()},b.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},b.prototype.onSelectionChanged=function(a,b,c){if(this._didStateChange(a,b,c,this._bufferService.buffer.ydisp))if(this._clearAll(),
a&&b){var d=a[1]-this._bufferService.buffer.ydisp,e=b[1]-this._bufferService.buffer.ydisp,f=Math.max(d,0),g=Math.min(e,this._bufferService.rows-1);f>=this._bufferService.rows||0>g||((this._ctx.fillStyle=this._colors.selection.css,c)?(d=a[0],this._fillCells(d,f,b[0]-d,g-f+1)):(d=d===f?a[0]:0,this._fillCells(d,f,(f===g?b[0]:this._bufferService.cols)-d,1),(this._fillCells(0,f+1,this._bufferService.cols,Math.max(g-f-1,0)),f!==g)&&this._fillCells(0,g,e===g?b[0]:this._bufferService.cols,1)),this._state.start=
[a[0],a[1]],this._state.end=[b[0],b[1]],this._state.columnSelectMode=c,this._state.ydisp=this._bufferService.buffer.ydisp)}else this._clearState()},b.prototype._didStateChange=function(a,b,c,d){return!this._areCoordinatesEqual(a,this._state.start)||!this._areCoordinatesEqual(b,this._state.end)||c!==this._state.columnSelectMode||d!==this._state.ydisp},b.prototype._areCoordinatesEqual=function(a,b){return!(!a||!b)&&a[0]===b[0]&&a[1]===b[1]},b}(d(13).BaseRenderLayer);c.SelectionRenderLayer=a},function(a,
c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)});Object.defineProperty(c,"__esModule",{value:!0});a=d(13);var g=d(5);d=function(a){function b(b,c,d,e,f,h,k,q,t){b=a.call(this,b,"cursor",c,!0,d,e,h,k)||this;return b._onRequestRefreshRowsEvent=
f,b.bufferService=h,b.optionsService=k,b._coreService=q,b._coreBrowserService=t,b._cell=new g.CellData,b._state={x:0,y:0,isFocused:!1,style:"",width:0},b._cursorRenderers={bar:b._renderBarCursor.bind(b),block:b._renderBlockCursor.bind(b),underline:b._renderUnderlineCursor.bind(b)},b}return e(b,a),b.prototype.resize=function(b){a.prototype.resize.call(this,b);this._state={x:0,y:0,isFocused:!1,style:"",width:0}},b.prototype.reset=function(){this._clearCursor();this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),
this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},b.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause();this._onRequestRefreshRowsEvent.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},b.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRefreshRowsEvent.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},b.prototype.onOptionsChanged=
function(){var a,b=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new k(this._coreBrowserService.isFocused,function(){b._render(!0)})):(null===(a=this._cursorBlinkStateManager)||void 0===a||a.dispose(),this._cursorBlinkStateManager=void 0);this._onRequestRefreshRowsEvent.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},b.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},
b.prototype.onGridChanged=function(a,b){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},b.prototype._render=function(a){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var b=this._bufferService.buffer.ybase+this._bufferService.buffer.y;a=b-this._bufferService.buffer.ydisp;if(0>a||a>=this._bufferService.rows)this._clearCursor();else if(this._bufferService.buffer.lines.get(b).loadCell(this._bufferService.buffer.x,
this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,b=this._optionsService.options.cursorStyle,b&&"block"!==b?this._cursorRenderers[b](this._bufferService.buffer.x,a,this._cell):this._renderBlurCursor(this._bufferService.buffer.x,a,this._cell),this._ctx.restore(),this._state.x=this._bufferService.buffer.x,this._state.y=a,this._state.isFocused=!1,this._state.style=b,void(this._state.width=
this._cell.getWidth());if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===this._bufferService.buffer.x&&this._state.y===a&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save();this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](this._bufferService.buffer.x,a,
this._cell);this._ctx.restore();this._state.x=this._bufferService.buffer.x;this._state.y=a;this._state.isFocused=!1;this._state.style=this._optionsService.options.cursorStyle;this._state.width=this._cell.getWidth()}else this._clearCursor()}}else this._clearCursor()},b.prototype._clearCursor=function(){this._state&&(this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},b.prototype._renderBarCursor=function(a,b,c){this._ctx.save();this._ctx.fillStyle=
this._colors.cursor.css;this._fillLeftLineAtCell(a,b);this._ctx.restore()},b.prototype._renderBlockCursor=function(a,b,c){this._ctx.save();this._ctx.fillStyle=this._colors.cursor.css;this._fillCells(a,b,c.getWidth(),1);this._ctx.fillStyle=this._colors.cursorAccent.css;this._fillCharTrueColor(c,a,b);this._ctx.restore()},b.prototype._renderUnderlineCursor=function(a,b,c){this._ctx.save();this._ctx.fillStyle=this._colors.cursor.css;this._fillBottomLineAtCells(a,b);this._ctx.restore()},b.prototype._renderBlurCursor=
function(a,b,c){this._ctx.save();this._ctx.strokeStyle=this._colors.cursor.css;this._strokeRectAtCell(a,b,c.getWidth(),1);this._ctx.restore()},b}(a.BaseRenderLayer);c.CursorRenderLayer=d;var k=function(){function a(a,b){this._renderCallback=b;this.isCursorVisible=!0;a&&this._restartInterval()}return Object.defineProperty(a.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),a.prototype.dispose=function(){this._blinkInterval&&
(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0);this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0);this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},a.prototype.restartBlinkAnimation=function(){var a=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){a._renderCallback();
a._animationFrame=void 0})))},a.prototype._restartInterval=function(a){var b=this;void 0===a&&(a=600);this._blinkInterval&&window.clearInterval(this._blinkInterval);this._blinkStartTimeout=setTimeout(function(){if(b._animationTimeRestarted){var a=600-(Date.now()-b._animationTimeRestarted);if(b._animationTimeRestarted=void 0,0<a)return void b._restartInterval(a)}b.isCursorVisible=!1;b._animationFrame=window.requestAnimationFrame(function(){b._renderCallback();b._animationFrame=void 0});b._blinkInterval=
setInterval(function(){if(b._animationTimeRestarted){var a=600-(Date.now()-b._animationTimeRestarted);return b._animationTimeRestarted=void 0,void b._restartInterval(a)}b.isCursorVisible=!b.isCursorVisible;b._animationFrame=window.requestAnimationFrame(function(){b._renderCallback();b._animationFrame=void 0})},600)},a)},a.prototype.pause=function(){this.isCursorVisible=!0;this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0);this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),
this._blinkStartTimeout=void 0);this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},a.prototype.resume=function(){this._animationTimeRestarted=void 0;this._restartInterval();this.restartBlinkAnimation()},a}()},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=
a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)});Object.defineProperty(c,"__esModule",{value:!0});a=d(13);var g=d(9),k=d(25);d=function(a){function b(b,c,d,e,f,g,h){var k=a.call(this,b,"link",c,!0,d,e,g,h)||this;return k.bufferService=g,k.optionsService=h,f.onLinkHover(function(a){return k._onLinkHover(a)}),f.onLinkLeave(function(a){return k._onLinkLeave(a)}),k}return e(b,a),b.prototype.resize=function(b){a.prototype.resize.call(this,b);this._state=void 0},b.prototype.reset=
function(){this._clearCurrentLink()},b.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var a=this._state.y2-this._state.y1-1;0<a&&this._clearCells(0,this._state.y1+1,this._state.cols,a);this._clearCells(0,this._state.y2,this._state.x2,1);this._state=void 0}},b.prototype._onLinkHover=function(a){if(a.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:a.fg&&k.is256Color(a.fg)?this._ctx.fillStyle=
this._colors.ansi[a.fg].css:this._ctx.fillStyle=this._colors.foreground.css,a.y1===a.y2)this._fillBottomLineAtCells(a.x1,a.y1,a.x2-a.x1);else{this._fillBottomLineAtCells(a.x1,a.y1,a.cols-a.x1);for(var b=a.y1+1;b<a.y2;b++)this._fillBottomLineAtCells(0,b,a.cols);this._fillBottomLineAtCells(0,a.y2,a.x2)}this._state=a},b.prototype._onLinkLeave=function(a){this._clearCurrentLink()},b}(a.BaseRenderLayer);c.LinkRenderLayer=d},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(19),e=
d(1);a=function(){function a(a,b){this._bufferService=a;this._logService=b;this._linkMatchers=[];this._nextLinkMatcherId=0;this._onLinkHover=new e.EventEmitter;this._onLinkLeave=new e.EventEmitter;this._onLinkTooltip=new e.EventEmitter;this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(a.prototype,"onLinkHover",{get:function(){return this._onLinkHover.event},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onLinkLeave",{get:function(){return this._onLinkLeave.event},
enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!0,configurable:!0}),a.prototype.attachToDom=function(a,b){this._element=a;this._mouseZoneManager=b},a.prototype.linkifyRows=function(b,c){var d=this;this._mouseZoneManager&&(void 0===this._rowsToLinkify.start||void 0===this._rowsToLinkify.end?(this._rowsToLinkify.start=b,this._rowsToLinkify.end=c):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,
b),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,c)),this._mouseZoneManager.clearAll(b,c),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return d._linkifyRows()},a._timeBeforeLatency))},a.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var a=this._bufferService.buffer;if(void 0!==this._rowsToLinkify.start&&void 0!==this._rowsToLinkify.end){var b=a.ydisp+this._rowsToLinkify.start;if(!(b>=a.lines.length)){var c=Math.ceil(2E3/
this._bufferService.cols);for(a=this._bufferService.buffer.iterator(!1,b,a.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,c,c);a.hasNext();)for(b=a.next(),c=0;c<this._linkMatchers.length;c++)this._doLinkifyRow(b.range.first,b.content,this._linkMatchers[c]);this._rowsToLinkify.start=void 0;this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},a.prototype.registerLinkMatcher=function(a,b,c){if(void 0===c&&(c={}),!b)throw Error("handler must be defined");
a={id:this._nextLinkMatcherId++,regex:a,handler:b,matchIndex:c.matchIndex,validationCallback:c.validationCallback,hoverTooltipCallback:c.tooltipCallback,hoverLeaveCallback:c.leaveCallback,willLinkActivate:c.willLinkActivate,priority:c.priority||0};return this._addLinkMatcherToList(a),a.id},a.prototype._addLinkMatcherToList=function(a){if(0!==this._linkMatchers.length){for(var b=this._linkMatchers.length-1;0<=b;b--)if(a.priority<=this._linkMatchers[b].priority)return void this._linkMatchers.splice(b+
1,0,a);this._linkMatchers.splice(0,0,a)}else this._linkMatchers.push(a)},a.prototype.deregisterLinkMatcher=function(a){for(var b=0;b<this._linkMatchers.length;b++)if(this._linkMatchers[b].id===a)return this._linkMatchers.splice(b,1),!0;return!1},a.prototype._doLinkifyRow=function(a,b,c){for(var d,e=this,f=new RegExp(c.regex.source,(c.regex.flags||"")+"g"),g=-1,h=function(){var h=d["number"!=typeof c.matchIndex?0:c.matchIndex];if(!h)return k._logService.debug("match found without corresponding matchIndex",
d,c),"break";if(g=b.indexOf(h,g+1),f.lastIndex=g+h.length,0>g)return"break";var n=k._bufferService.buffer.stringIndexToBufferIndex(a,g);if(0>n[0])return"break";var r=k._bufferService.buffer.lines.get(n[0]);if(!r)return"break";var p=(r=r.getFg(n[1]))?r>>9&511:void 0;c.validationCallback?c.validationCallback(h,function(a){e._rowsTimeoutId||a&&e._addLink(n[1],n[0]-e._bufferService.buffer.ydisp,h,c,p)}):k._addLink(n[1],n[0]-k._bufferService.buffer.ydisp,h,c,p)},k=this;null!==(d=f.exec(b))&&"break"!==
h(););},a.prototype._addLink=function(a,c,d,e,f){var h=this;if(this._mouseZoneManager&&this._element){var k=b.getStringCellWidth(d),n=a%this._bufferService.cols,p=c+Math.floor(a/this._bufferService.cols),q=(n+k)%this._bufferService.cols,t=p+Math.floor((n+k)/this._bufferService.cols);0===q&&(q=this._bufferService.cols,t--);this._mouseZoneManager.add(new g(n+1,p+1,q+1,t+1,function(a){if(e.handler)return e.handler(a,d);window.open(d,"_blank")},function(){h._onLinkHover.fire(h._createLinkHoverEvent(n,
p,q,t,f));h._element.classList.add("xterm-cursor-pointer")},function(a){h._onLinkTooltip.fire(h._createLinkHoverEvent(n,p,q,t,f));e.hoverTooltipCallback&&e.hoverTooltipCallback(a,d,{start:{x:n,y:p},end:{x:q,y:t}})},function(){h._onLinkLeave.fire(h._createLinkHoverEvent(n,p,q,t,f));h._element.classList.remove("xterm-cursor-pointer");e.hoverLeaveCallback&&e.hoverLeaveCallback()},function(a){return!e.willLinkActivate||e.willLinkActivate(a,d)}))}},a.prototype._createLinkHoverEvent=function(a,b,c,d,e){return{x1:a,
y1:b,x2:c,y2:d,cols:this._bufferService.cols,fg:e}},a._timeBeforeLatency=200,a}();c.Linkifier=a;var g=function(a,b,c,d,e,f,g,h,D){this.x1=a;this.y1=b;this.x2=c;this.y2=d;this.clickCallback=e;this.hoverCallback=f;this.tooltipCallback=g;this.leaveCallback=h;this.willLinkActivate=D};c.MouseZone=g},function(a,c,d){var b=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=
Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},e=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,"__esModule",{value:!0});var g=d(11),k=d(52),q=d(5),t=d(1),p=d(4),v=d(0),n=d(29),r=d(53);a=String.fromCharCode(160);var x=new RegExp(a,"g");a=function(){function a(a,b,c,d,e,f,g,h){var n=this;this._scrollLines=a;this._element=b;this._screenElement=c;this._charSizeService=
d;this._bufferService=e;this._coreService=f;this._mouseService=g;this._optionsService=h;this._dragScrollAmount=0;this._enabled=!0;this._workCell=new q.CellData;this._mouseDownTimeStamp=0;this._onLinuxMouseSelection=new t.EventEmitter;this._onRedrawRequest=new t.EventEmitter;this._onSelectionChange=new t.EventEmitter;this._mouseMoveListener=function(a){return n._onMouseMove(a)};this._mouseUpListener=function(a){return n._onMouseUp(a)};this._coreService.onUserInput(function(){n.hasSelection&&n.clearSelection()});
this._trimListener=this._bufferService.buffer.lines.onTrim(function(a){return n._onTrim(a)});this._bufferService.buffers.onBufferActivate(function(a){return n._onBufferActivate(a)});this.enable();this._model=new k.SelectionModel(this._bufferService);this._activeSelectionMode=0}return Object.defineProperty(a.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onRedrawRequest",{get:function(){return this._onRedrawRequest.event},
enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),a.prototype.dispose=function(){this._removeMouseDownListeners()},a.prototype.reset=function(){this.clearSelection()},a.prototype.disable=function(){this.clearSelection();this._enabled=!1},a.prototype.enable=function(){this._enabled=!0},Object.defineProperty(a.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},
enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"hasSelection",{get:function(){var a=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!(!a||!b)&&(a[0]!==b[0]||a[1]!==b[1])},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"selectionText",{get:function(){var a=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;
if(!a||!b)return"";var c=this._bufferService.buffer,d=[];if(3===this._activeSelectionMode){if(a[0]===b[0])return"";for(var e=a[1];e<=b[1];e++){var f=c.translateBufferLineToString(e,!0,a[0],b[0]);d.push(f)}}else{d.push(c.translateBufferLineToString(a[1],!0,a[0],a[1]===b[1]?b[0]:void 0));for(e=a[1]+1;e<=b[1]-1;e++){var h=c.lines.get(e);f=c.translateBufferLineToString(e,!0);h&&h.isWrapped?d[d.length-1]+=f:d.push(f)}a[1]!==b[1]&&(h=c.lines.get(b[1]),f=c.translateBufferLineToString(b[1],!0,0,b[0]),h&&
h.isWrapped?d[d.length-1]+=f:d.push(f))}return d.map(function(a){return a.replace(x," ")}).join(g.isWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),a.prototype.clearSelection=function(){this._model.clearSelection();this._removeMouseDownListeners();this.refresh();this._onSelectionChange.fire()},a.prototype.refresh=function(a){var b=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return b._refresh()})),g.isLinux&&a)&&this.selectionText.length&&
this._onLinuxMouseSelection.fire(this.selectionText)},a.prototype._refresh=function(){this._refreshAnimationFrame=void 0;this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},a.prototype.isClickInSelection=function(a){a=this._getMouseBufferCoords(a);var b=this._model.finalSelectionStart,c=this._model.finalSelectionEnd;return!!(b&&c&&a)&&this._areCoordsInSelection(a,b,c)},a.prototype._areCoordsInSelection=
function(a,b,c){return a[1]>b[1]&&a[1]<c[1]||b[1]===c[1]&&a[1]===b[1]&&a[0]>=b[0]&&a[0]<c[0]||b[1]<c[1]&&a[1]===c[1]&&a[0]<c[0]||b[1]<c[1]&&a[1]===b[1]&&a[0]>=b[0]},a.prototype.selectWordAtCursor=function(a){(a=this._getMouseBufferCoords(a))&&(this._selectWordAt(a,!1),this._model.selectionEnd=void 0,this.refresh(!0))},a.prototype.selectAll=function(){this._model.isSelectAllActive=!0;this.refresh();this._onSelectionChange.fire()},a.prototype.selectLines=function(a,b){this._model.clearSelection();a=
Math.max(a,0);b=Math.min(b,this._bufferService.buffer.lines.length-1);this._model.selectionStart=[0,a];this._model.selectionEnd=[this._bufferService.cols,b];this.refresh();this._onSelectionChange.fire()},a.prototype._onTrim=function(a){this._model.onTrim(a)&&this.refresh()},a.prototype._getMouseBufferCoords=function(a){if(a=this._mouseService.getCoords(a,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0))return a[0]--,a[1]--,a[1]+=this._bufferService.buffer.ydisp,a},a.prototype._getMouseEventScrollAmount=
function(a){a=n.getCoordsRelativeToElement(a,this._screenElement)[1];var b=this._bufferService.rows*Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight);return 0<=a&&a<=b?0:(a>b&&(a-=b),a=Math.min(Math.max(a,-50),50),(a/=50)/Math.abs(a)+Math.round(14*a))},a.prototype.shouldForceSelection=function(a){return g.isMac?a.altKey&&this._optionsService.options.macOptionClickForcesSelection:a.shiftKey},a.prototype.onMouseDown=function(a){if(this._mouseDownTimeStamp=a.timeStamp,(2!==
a.button||!this.hasSelection)&&0===a.button){if(!this._enabled){if(!this.shouldForceSelection(a))return;a.stopPropagation()}a.preventDefault();this._dragScrollAmount=0;this._enabled&&a.shiftKey?this._onIncrementalClick(a):1===a.detail?this._onSingleClick(a):2===a.detail?this._onDoubleClick(a):3===a.detail&&this._onTripleClick(a);this._addMouseDownListeners();this.refresh(!0)}},a.prototype._addMouseDownListeners=function(){var a=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",
this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener));this._dragScrollIntervalTimer=window.setInterval(function(){return a._dragScroll()},50)},a.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener));clearInterval(this._dragScrollIntervalTimer);
this._dragScrollIntervalTimer=void 0},a.prototype._onIncrementalClick=function(a){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(a))},a.prototype._onSingleClick=function(a){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(a)?3:0,this._model.selectionStart=this._getMouseBufferCoords(a),this._model.selectionStart)this._model.selectionEnd=void 0,(a=this._bufferService.buffer.lines.get(this._model.selectionStart[1]))&&
a.length!==this._model.selectionStart[0]&&0===a.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++},a.prototype._onDoubleClick=function(a){(a=this._getMouseBufferCoords(a))&&(this._activeSelectionMode=1,this._selectWordAt(a,!0))},a.prototype._onTripleClick=function(a){(a=this._getMouseBufferCoords(a))&&(this._activeSelectionMode=2,this._selectLineAt(a[1]))},a.prototype.shouldColumnSelect=function(a){return a.altKey&&!(g.isMac&&this._optionsService.options.macOptionClickForcesSelection)},
a.prototype._onMouseMove=function(a){if(a.stopImmediatePropagation(),this._model.selectionStart){var b=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;(this._model.selectionEnd=this._getMouseBufferCoords(a),this._model.selectionEnd)?(2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),
this._dragScrollAmount=this._getMouseEventScrollAmount(a),3!==this._activeSelectionMode&&(0<this._dragScrollAmount?this._model.selectionEnd[0]=this._bufferService.cols:0>this._dragScrollAmount&&(this._model.selectionEnd[0]=0)),a=this._bufferService.buffer,this._model.selectionEnd[1]<a.lines.length&&(a=a.lines.get(this._model.selectionEnd[1]))&&0===a.hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++,b&&b[0]===this._model.selectionEnd[0]&&b[1]===this._model.selectionEnd[1]||this.refresh(!0)):
this.refresh(!0)}},a.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._scrollLines(this._dragScrollAmount,!1);var a=this._bufferService.buffer;0<this._dragScrollAmount?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(a.ydisp+this._bufferService.rows,a.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=
a.ydisp);this.refresh()}},a.prototype._onMouseUp=function(a){var b=a.timeStamp-this._mouseDownTimeStamp;(this._removeMouseDownListeners(),1>=this.selectionText.length&&500>b)?a.altKey&&this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp&&(a=this._mouseService.getCoords(a,this._element,this._bufferService.cols,this._bufferService.rows,!1))&&void 0!==a[0]&&void 0!==a[1]&&(a=r.moveToCellSequence(a[0]-1,a[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys),
this._coreService.triggerDataEvent(a,!0)):this.hasSelection&&this._onSelectionChange.fire()},a.prototype._onBufferActivate=function(a){var b=this;this.clearSelection();this._trimListener.dispose();this._trimListener=a.activeBuffer.lines.onTrim(function(a){return b._onTrim(a)})},a.prototype._convertViewportColToCharacterIndex=function(a,b){for(var c=b[0],d=0;b[0]>=d;d++){var e=a.loadCell(d,this._workCell).getChars().length;0===this._workCell.getWidth()?c--:1<e&&b[0]!==d&&(c+=e-1)}return c},a.prototype.setSelection=
function(a,b,c){this._model.clearSelection();this._removeMouseDownListeners();this._model.selectionStart=[a,b];this._model.selectionStartLength=c;this.refresh()},a.prototype._getWordAt=function(a,b,c,d){if(void 0===c&&(c=!0),void 0===d&&(d=!0),!(a[0]>=this._bufferService.cols)){var e=this._bufferService.buffer,f=e.lines.get(a[1]);if(f){var g=e.translateBufferLineToString(a[1],!1),h=this._convertViewportColToCharacterIndex(f,a),n=h,k=a[0]-h,r=0,p=0,q=0,t=0;if(" "===g.charAt(h)){for(;0<h&&" "===g.charAt(h-
1);)h--;for(;n<g.length&&" "===g.charAt(n+1);)n++}else{var v=a[0],x=a[0];0===f.getWidth(v)&&(r++,v--);2===f.getWidth(x)&&(p++,x++);var D=f.getString(x).length;for(1<D&&(t+=D-1,n+=D-1);0<v&&0<h&&!this._isCharWordSeparator(f.loadCell(v-1,this._workCell));)f.loadCell(v-1,this._workCell),D=this._workCell.getChars().length,0===this._workCell.getWidth()?(r++,v--):1<D&&(q+=D-1,h-=D-1),h--,v--;for(;x<f.length&&n+1<g.length&&!this._isCharWordSeparator(f.loadCell(x+1,this._workCell));)f.loadCell(x+1,this._workCell),
v=this._workCell.getChars().length,2===this._workCell.getWidth()?(p++,x++):1<v&&(t+=v-1,n+=v-1),n++,x++}n++;k=h+k-r+q;r=Math.min(this._bufferService.cols,n-h+r+p-q-t);if(b||""!==g.slice(h,n).trim())return c&&0===k&&32!==f.getCodePoint(0)&&(b=e.lines.get(a[1]-1))&&f.isWrapped&&32!==b.getCodePoint(this._bufferService.cols-1)&&(b=this._getWordAt([this._bufferService.cols-1,a[1]-1],!1,!0,!1))&&(b=this._bufferService.cols-b.start,k-=b,r+=b),d&&k+r===this._bufferService.cols&&32!==f.getCodePoint(this._bufferService.cols-
1)&&(d=e.lines.get(a[1]+1))&&d.isWrapped&&32!==d.getCodePoint(0)&&(a=this._getWordAt([0,a[1]+1],!1,!1,!0))&&(r+=a.length),{start:k,length:r}}}},a.prototype._selectWordAt=function(a,b){if(b=this._getWordAt(a,b)){for(;0>b.start;)b.start+=this._bufferService.cols,a[1]--;this._model.selectionStart=[b.start,a[1]];this._model.selectionStartLength=b.length}},a.prototype._selectToWordAt=function(a){var b=this._getWordAt(a,!0);if(b){for(a=a[1];0>b.start;)b.start+=this._bufferService.cols,a--;if(!this._model.areSelectionValuesReversed())for(;b.start+
b.length>this._bufferService.cols;)b.length-=this._bufferService.cols,a++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,a]}},a.prototype._isCharWordSeparator=function(a){return 0!==a.getWidth()&&0<=this._optionsService.options.wordSeparator.indexOf(a.getChars())},a.prototype._selectLineAt=function(a){a=this._bufferService.buffer.getWrappedRangeForLine(a);this._model.selectionStart=[0,a.first];this._model.selectionEnd=[this._bufferService.cols,a.last];
this._model.selectionStartLength=0},a=b([e(3,p.ICharSizeService),e(4,v.IBufferService),e(5,v.ICoreService),e(6,p.IMouseService),e(7,v.IOptionsService)],a)}();c.SelectionService=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=function(){function a(a){this._bufferService=a;this.isSelectAllActive=!1;this.selectionStartLength=0}return a.prototype.clearSelection=function(){this.selectionEnd=this.selectionStart=void 0;this.isSelectAllActive=!1;this.selectionStartLength=0},Object.defineProperty(a.prototype,
"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var a=this.selectionStart[0]+
this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!0,configurable:!0}),a.prototype.areSelectionValuesReversed=function(){var a=this.selectionStart,b=this.selectionEnd;
return!(!a||!b)&&(a[1]>b[1]||a[1]===b[1]&&a[0]>b[0])},a.prototype.onTrim=function(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&0>this.selectionEnd[1]?(this.clearSelection(),!0):(this.selectionStart&&0>this.selectionStart[1]&&(this.selectionStart[1]=0),!1)},a}();c.SelectionModel=a},function(a,c,d){function b(a,b,c,d){var f=a-e(c,a),g=b-e(c,b);f=Math.abs(f-g);g=0;for(var h=a-e(c,a),n=b-e(c,b),k=0;k<Math.abs(h-n);k++){var r=
c.buffer.lines.get(h+("A"===(a>b?"A":"B")?-1:1)*k);r&&r.isWrapped&&g++}return t(f-g,q(a>b?"A":"B",d))}function e(a,b){for(var c=0,d=a.buffer.lines.get(b),e=d&&d.isWrapped;e&&0<=b&&b<a.rows;)c++,e=(d=a.buffer.lines.get(--b))&&d.isWrapped;return c}function g(a,c,d,f,g,h){var k;return k=0<b(d,f,g,h).length?f-e(g,f):c,a<d&&k<=f||a>=d&&k<f?"C":"D"}function k(a,b,c,d,e,f){for(var g=a,h="";g!==c||b!==d;)g+=e?1:-1,e&&g>f.cols-1?(h+=f.buffer.translateBufferLineToString(b,!1,a,g),g=0,a=0,b++):!e&&0>g&&(h+=
f.buffer.translateBufferLineToString(b,!1,0,a+1),a=g=f.cols-1,b--);return h+f.buffer.translateBufferLineToString(b,!1,a,g)}function q(a,b){return p.C0.ESC+(b?"O":"[")+a}function t(a,b){a=Math.floor(a);for(var c="",d=0;d<a;d++)c+=b;return c}Object.defineProperty(c,"__esModule",{value:!0});var p=d(12);c.moveToCellSequence=function(a,c,d,f){var h=d.buffer.x,n=d.buffer.y;return d.buffer.hasScrollback?function(a,b,c,d,e,f){b=g(a,b,c,d,e,f);return t(Math.abs(a-c),q(b,f))}(h,n,a,c,d,f):function(a,c,d,f,
g,h){return 0===b(c,f,g,h).length?"":t(k(a,c,a,c-e(g,c),!1,g).length,q("D",h))}(h,n,0,c,d,f)+b(n,c,d,f)+function(a,c,d,f,h,n){var r=0<b(c,f,h,n).length?f-e(h,f):c;c=g(a,c,d,f,h,n);return t(k(a,r,d,f,"C"===c,h).length,q(c,n))}(h,n,a,c,d,f)}},function(a,c,d){var b=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-
1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},e=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,"__esModule",{value:!0});var g=d(0);a=function(){function a(a){this._optionsService=a}return Object.defineProperty(a,"audioContext",{get:function(){if(!a._audioContext){var b=window.AudioContext||window.webkitAudioContext;if(!b)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),
null;a._audioContext=new b}return a._audioContext},enumerable:!0,configurable:!0}),a.prototype.playBellSound=function(){var b=a.audioContext;if(b){var c=b.createBufferSource();b.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(a){c.buffer=a;c.connect(b.destination);c.start(0)})}},a.prototype._base64ToArrayBuffer=function(a){a=window.atob(a);for(var b=a.length,c=new Uint8Array(b),d=0;d<b;d++)c[d]=a.charCodeAt(d);return c.buffer},a.prototype._removeMimeType=
function(a){return a.split(",")[1]},a=b([e(0,g.IOptionsService)],a)}();c.SoundService=a},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}),g=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,
g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},k=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,"__esModule",{value:!0});a=d(2);var q=d(7),t=d(4),p=d(0);d=function(a){function b(b,c,d,e,f){var g=a.call(this)||this;return g._element=
b,g._screenElement=c,g._bufferService=d,g._mouseService=e,g._selectionService=f,g._zones=[],g._areZonesActive=!1,g._lastHoverCoords=[void 0,void 0],g._initialSelectionLength=0,g.register(q.addDisposableDomListener(g._element,"mousedown",function(a){return g._onMouseDown(a)})),g._mouseMoveListener=function(a){return g._onMouseMove(a)},g._mouseLeaveListener=function(a){return g._onMouseLeave(a)},g._clickListener=function(a){return g._onClick(a)},g}return e(b,a),b.prototype.dispose=function(){a.prototype.dispose.call(this);
this._deactivate()},b.prototype.add=function(a){this._zones.push(a);1===this._zones.length&&this._activate()},b.prototype.clearAll=function(a,b){if(0!==this._zones.length){a&&b||(a=0,b=this._bufferService.rows-1);for(var c=0;c<this._zones.length;c++){var d=this._zones[c];(d.y1>a&&d.y1<=b+1||d.y2>a&&d.y2<=b+1||d.y1<a&&d.y2>b+1)&&(this._currentZone&&this._currentZone===d&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(c--,1))}0===this._zones.length&&this._deactivate()}},
b.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},b.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),
this._element.removeEventListener("click",this._clickListener))},b.prototype._onMouseMove=function(a){this._lastHoverCoords[0]===a.pageX&&this._lastHoverCoords[1]===a.pageY||(this._onHover(a),this._lastHoverCoords=[a.pageX,a.pageY])},b.prototype._onHover=function(a){var b=this,c=this._findZoneEventAt(a);c!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),c&&(this._currentZone=c,c.hoverCallback&&
c.hoverCallback(a),this._tooltipTimeout=setTimeout(function(){return b._onTooltip(a)},500)))},b.prototype._onTooltip=function(a){this._tooltipTimeout=void 0;var b=this._findZoneEventAt(a);b&&b.tooltipCallback&&b.tooltipCallback(a)},b.prototype._onMouseDown=function(a){var b;(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive)&&(null===(b=this._findZoneEventAt(a))||void 0===b?0:b.willLinkActivate(a))&&(a.preventDefault(),a.stopImmediatePropagation())},b.prototype._onMouseLeave=
function(a){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},b.prototype._onClick=function(a){var b=this._findZoneEventAt(a),c=this._getSelectionLength();b&&c===this._initialSelectionLength&&(b.clickCallback(a),a.preventDefault(),a.stopImmediatePropagation())},b.prototype._getSelectionLength=function(){var a=this._selectionService.selectionText;return a?a.length:0},b.prototype._findZoneEventAt=function(a){var b=
this._mouseService.getCoords(a,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(b){a=b[0];b=b[1];for(var c=0;c<this._zones.length;c++){var d=this._zones[c];if(d.y1===d.y2){if(b===d.y1&&a>=d.x1&&a<d.x2)return d}else if(b===d.y1&&a>=d.x1||b===d.y2&&a<d.x2||b>d.y1&&b<d.y2)return d}}},b=g([k(2,p.IBufferService),k(3,t.IMouseService),k(4,t.ISelectionService)],b)}(a.Disposable);c.MouseZoneManager=d},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||
{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)});Object.defineProperty(c,"__esModule",{value:!0});var g=d(17),k=d(11),q=d(30),t=d(7);a=d(2);var p=d(31);d=function(a){function b(b,c){var d=a.call(this)||this;d._terminal=b;d._renderService=c;d._liveRegionLineCount=0;d._charsToConsume=[];d._charsToAnnounce=
"";d._accessibilityTreeRoot=document.createElement("div");d._accessibilityTreeRoot.classList.add("xterm-accessibility");d._rowContainer=document.createElement("div");d._rowContainer.classList.add("xterm-accessibility-tree");d._rowElements=[];for(b=0;b<d._terminal.rows;b++)d._rowElements[b]=d._createAccessibilityTreeNode(),d._rowContainer.appendChild(d._rowElements[b]);return d._topBoundaryFocusListener=function(a){return d._onBoundaryFocus(a,0)},d._bottomBoundaryFocusListener=function(a){return d._onBoundaryFocus(a,
1)},d._rowElements[0].addEventListener("focus",d._topBoundaryFocusListener),d._rowElements[d._rowElements.length-1].addEventListener("focus",d._bottomBoundaryFocusListener),d._refreshRowsDimensions(),d._accessibilityTreeRoot.appendChild(d._rowContainer),d._renderRowsDebouncer=new q.RenderDebouncer(d._renderRows.bind(d)),d._refreshRows(),d._liveRegion=document.createElement("div"),d._liveRegion.classList.add("live-region"),d._liveRegion.setAttribute("aria-live","assertive"),d._accessibilityTreeRoot.appendChild(d._liveRegion),
d._terminal.element.insertAdjacentElement("afterbegin",d._accessibilityTreeRoot),d.register(d._renderRowsDebouncer),d.register(d._terminal.onResize(function(a){return d._onResize(a.rows)})),d.register(d._terminal.onRender(function(a){return d._refreshRows(a.start,a.end)})),d.register(d._terminal.onScroll(function(){return d._refreshRows()})),d.register(d._terminal.onA11yChar(function(a){return d._onChar(a)})),d.register(d._terminal.onLineFeed(function(){return d._onChar("\n")})),d.register(d._terminal.onA11yTab(function(a){return d._onTab(a)})),
d.register(d._terminal.onKey(function(a){return d._onKey(a.key)})),d.register(d._terminal.onBlur(function(){return d._clearLiveRegion()})),d.register(d._renderService.onDimensionsChange(function(){return d._refreshRowsDimensions()})),d._screenDprMonitor=new p.ScreenDprMonitor,d.register(d._screenDprMonitor),d._screenDprMonitor.setListener(function(){return d._refreshRowsDimensions()}),d.register(t.addDisposableDomListener(window,"resize",function(){return d._refreshRowsDimensions()})),d}return e(b,
a),b.prototype.dispose=function(){a.prototype.dispose.call(this);this._terminal.element.removeChild(this._accessibilityTreeRoot);this._rowElements.length=0},b.prototype._onBoundaryFocus=function(a,b){var c=a.target,d=this._rowElements[0===b?1:this._rowElements.length-2];if(c.getAttribute("aria-posinset")!==(0===b?"1":""+this._terminal.buffer.lines.length)&&a.relatedTarget===d){var e,f;(0===b?(e=c,f=this._rowElements.pop(),this._rowContainer.removeChild(f)):(e=this._rowElements.shift(),f=c,this._rowContainer.removeChild(e)),
e.removeEventListener("focus",this._topBoundaryFocusListener),f.removeEventListener("focus",this._bottomBoundaryFocusListener),0===b)?(c=this._createAccessibilityTreeNode(),this._rowElements.unshift(c),this._rowContainer.insertAdjacentElement("afterbegin",c)):(c=this._createAccessibilityTreeNode(),this._rowElements.push(c),this._rowContainer.appendChild(c));this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener);this._rowElements[this._rowElements.length-1].addEventListener("focus",
this._bottomBoundaryFocusListener);this._terminal.scrollLines(0===b?-1:1);this._rowElements[0===b?1:this._rowElements.length-2].focus();a.preventDefault();a.stopImmediatePropagation()}},b.prototype._onResize=function(a){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);
for(;this._rowElements.length>a;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener);this._refreshRowsDimensions()},b.prototype._createAccessibilityTreeNode=function(){var a=document.createElement("div");return a.setAttribute("role","listitem"),a.tabIndex=-1,this._refreshRowDimensions(a),a},b.prototype._onTab=function(a){for(var b=0;b<a;b++)this._onChar(" ")},b.prototype._onChar=function(a){var b=
this;21>this._liveRegionLineCount&&(0<this._charsToConsume.length?this._charsToConsume.shift()!==a&&(this._charsToAnnounce+=a):this._charsToAnnounce+=a,"\n"===a&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=g.tooMuchOutput)),k.isMac&&this._liveRegion.textContent&&0<this._liveRegion.textContent.length&&!this._liveRegion.parentNode&&setTimeout(function(){b._accessibilityTreeRoot.appendChild(b._liveRegion)},0))},b.prototype._clearLiveRegion=function(){this._liveRegion.textContent=
"";this._liveRegionLineCount=0;k.isMac&&this._liveRegion.parentNode&&this._accessibilityTreeRoot.removeChild(this._liveRegion)},b.prototype._onKey=function(a){this._clearLiveRegion();this._charsToConsume.push(a)},b.prototype._refreshRows=function(a,b){this._renderRowsDebouncer.refresh(a,b,this._terminal.rows)},b.prototype._renderRows=function(a,b){for(var c=this._terminal.buffer,d=c.lines.length.toString();a<=b;a++){var e=c.translateBufferLineToString(c.ydisp+a,!0),f=(c.ydisp+a+1).toString(),g=this._rowElements[a];
g&&(0===e.length?g.innerHTML="&nbsp;":g.textContent=e,g.setAttribute("aria-posinset",f),g.setAttribute("aria-setsize",d))}this._announceCharacters()},b.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var a=0;a<this._terminal.rows;a++)this._refreshRowDimensions(this._rowElements[a])}},b.prototype._refreshRowDimensions=function(a){a.style.height=this._renderService.dimensions.actualCellHeight+
"px"},b.prototype._announceCharacters=function(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},b}(a.Disposable);c.AccessibilityManager=d},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===
c?Object.create(c):(d.prototype=c.prototype,new d)}),g=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},k=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,"__esModule",
{value:!0});var q=d(58),t=d(9);a=d(2);var p=d(4),v=d(0),n=d(1),r=d(10),x=1;d=function(a){function b(b,c,d,e,f,g,h,k){var p=a.call(this)||this;return p._colors=b,p._element=c,p._screenElement=d,p._viewportElement=e,p._linkifier=f,p._charSizeService=g,p._optionsService=h,p._bufferService=k,p._terminalClass=x++,p._rowElements=[],p._onRequestRefreshRows=new n.EventEmitter,p._rowContainer=document.createElement("div"),p._rowContainer.classList.add("xterm-rows"),p._rowContainer.style.lineHeight="normal",
p._rowContainer.setAttribute("aria-hidden","true"),p._refreshRowElements(p._bufferService.cols,p._bufferService.rows),p._selectionContainer=document.createElement("div"),p._selectionContainer.classList.add("xterm-selection"),p._selectionContainer.setAttribute("aria-hidden","true"),p.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},
p._updateDimensions(),p._injectCss(),p._rowFactory=new q.DomRendererRowFactory(document,p._optionsService,p._colors),p._element.classList.add("xterm-dom-renderer-owner-"+p._terminalClass),p._screenElement.appendChild(p._rowContainer),p._screenElement.appendChild(p._selectionContainer),p._linkifier.onLinkHover(function(a){return p._onLinkHover(a)}),p._linkifier.onLinkLeave(function(a){return p._onLinkLeave(a)}),p}return e(b,a),Object.defineProperty(b.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},
enumerable:!0,configurable:!0}),b.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass);this._screenElement.removeChild(this._rowContainer);this._screenElement.removeChild(this._selectionContainer);this._screenElement.removeChild(this._themeStyleElement);this._screenElement.removeChild(this._dimensionsStyleElement);a.prototype.dispose.call(this)},b.prototype._updateDimensions=function(){var a=this;this.dimensions.scaledCharWidth=this._charSizeService.width*
window.devicePixelRatio;this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio);this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing);this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight);this.dimensions.scaledCharLeft=0;this.dimensions.scaledCharTop=0;this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols;
this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows;this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio);this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio);this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols;this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;this._rowElements.forEach(function(b){b.style.width=
a.dimensions.canvasWidth+"px";b.style.height=a.dimensions.actualCellHeight+"px";b.style.lineHeight=a.dimensions.actualCellHeight+"px";b.style.overflow="hidden"});this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));this._dimensionsStyleElement.innerHTML=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";
this._selectionContainer.style.height=this._viewportElement.style.height;this._screenElement.style.width=this.dimensions.canvasWidth+"px";this._screenElement.style.height=this.dimensions.canvasHeight+"px"},b.prototype.setColors=function(a){this._colors=a;this._injectCss()},b.prototype._injectCss=function(){var a=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var b=this._terminalSelector+" .xterm-rows { color: "+
this._colors.foreground.css+"; background-color: "+this._colors.background.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";b+=this._terminalSelector+" span:not(."+q.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+q.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+q.ITALIC_CLASS+" { font-style: italic;}";
b+="@keyframes blink_box_shadow { 50% { box-shadow: none; }}";b+="@keyframes blink_block { 0% { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+"; } 50% { background-color: "+this._colors.cursorAccent.css+"; color: "+this._colors.cursor.css+"; }}";b+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+q.CURSOR_CLASS+"."+q.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+
q.CURSOR_CLASS+"."+q.CURSOR_BLINK_CLASS+":not(."+q.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+q.CURSOR_CLASS+"."+q.CURSOR_BLINK_CLASS+"."+q.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+q.CURSOR_CLASS+"."+q.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+
" .xterm-rows ."+q.CURSOR_CLASS+"."+q.CURSOR_STYLE_BAR_CLASS+" { box-shadow: 1px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+q.CURSOR_CLASS+"."+q.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}";b+=this._terminalSelector+" .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" .xterm-selection div { position: absolute; background-color: "+this._colors.selection.css+
";}";this._colors.ansi.forEach(function(c,d){b+=a._terminalSelector+" .xterm-fg-"+d+" { color: "+c.css+"; }"+a._terminalSelector+" .xterm-bg-"+d+" { background-color: "+c.css+"; }"});b+=this._terminalSelector+" .xterm-fg-"+t.INVERTED_DEFAULT_COLOR+" { color: "+r.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+t.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }";this._themeStyleElement.innerHTML=b},b.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},
b.prototype._refreshRowElements=function(a,b){for(a=this._rowElements.length;a<=b;a++){var c=document.createElement("div");this._rowContainer.appendChild(c);this._rowElements.push(c)}for(;this._rowElements.length>b;)this._rowContainer.removeChild(this._rowElements.pop())},b.prototype.onResize=function(a,b){this._refreshRowElements(a,b);this._updateDimensions()},b.prototype.onCharSizeChanged=function(){this._updateDimensions()},b.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},
b.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},b.prototype.onSelectionChanged=function(a,b,c){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(a&&b){var d=a[1]-this._bufferService.buffer.ydisp,e=b[1]-this._bufferService.buffer.ydisp,f=Math.max(d,0),g=Math.min(e,this._bufferService.rows-1);if(!(f>=this._bufferService.rows||0>g)){var h=document.createDocumentFragment();c?h.appendChild(this._createSelectionElement(f,
a[0],b[0],g-f+1)):(h.appendChild(this._createSelectionElement(f,d===f?a[0]:0,f===g?b[0]:this._bufferService.cols)),(h.appendChild(this._createSelectionElement(f+1,0,this._bufferService.cols,g-f-1)),f!==g)&&h.appendChild(this._createSelectionElement(g,0,e===g?b[0]:this._bufferService.cols)));this._selectionContainer.appendChild(h)}}},b.prototype._createSelectionElement=function(a,b,c,d){void 0===d&&(d=1);var e=document.createElement("div");return e.style.height=d*this.dimensions.actualCellHeight+"px",
e.style.top=a*this.dimensions.actualCellHeight+"px",e.style.left=b*this.dimensions.actualCellWidth+"px",e.style.width=this.dimensions.actualCellWidth*(c-b)+"px",e},b.prototype.onCursorMove=function(){},b.prototype.onOptionsChanged=function(){this._updateDimensions();this._injectCss()},b.prototype.clear=function(){this._rowElements.forEach(function(a){return a.innerHTML=""})},b.prototype.renderRows=function(a,b){for(var c=this._bufferService.buffer.ybase+this._bufferService.buffer.y,d=this._bufferService.buffer.x,
e=this._optionsService.options.cursorBlink;a<=b;a++){var f=this._rowElements[a];f.innerHTML="";var g=a+this._bufferService.buffer.ydisp,h=this._bufferService.buffer.lines.get(g);f.appendChild(this._rowFactory.createRow(h,g===c,this._optionsService.options.cursorStyle,d,e,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(b.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!0,configurable:!0}),b.prototype.registerCharacterJoiner=
function(a){return-1},b.prototype.deregisterCharacterJoiner=function(a){return!1},b.prototype._onLinkHover=function(a){this._setCellUnderline(a.x1,a.x2,a.y1,a.y2,a.cols,!0)},b.prototype._onLinkLeave=function(a){this._setCellUnderline(a.x1,a.x2,a.y1,a.y2,a.cols,!1)},b.prototype._setCellUnderline=function(a,b,c,d,e,f){for(;a!==b||c!==d;){var g=this._rowElements[c];if(!g)break;(g=g.children[a])&&(g.style.textDecoration=f?"underline":"none");++a>=e&&(a=0,c++)}},b=g([k(5,p.ICharSizeService),k(6,v.IOptionsService),
k(7,v.IBufferService)],b)}(a.Disposable);c.DomRenderer=d},function(a,c,d){function b(a,b,c){for(;a.length<c;)a=b+a;return a}Object.defineProperty(c,"__esModule",{value:!0});var e=d(9),g=d(3),k=d(5),q=d(10);c.BOLD_CLASS="xterm-bold";c.DIM_CLASS="xterm-dim";c.ITALIC_CLASS="xterm-italic";c.UNDERLINE_CLASS="xterm-underline";c.CURSOR_CLASS="xterm-cursor";c.CURSOR_BLINK_CLASS="xterm-cursor-blink";c.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block";c.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar";c.CURSOR_STYLE_UNDERLINE_CLASS=
"xterm-cursor-underline";a=function(){function a(a,b,c){this._document=a;this._optionsService=b;this._colors=c;this._workCell=new k.CellData}return a.prototype.setColors=function(a){this._colors=a},a.prototype.createRow=function(a,d,f,h,k,t,H){var n=this._document.createDocumentFragment(),p=0;for(H=Math.min(a.length,H)-1;0<=H;H--)if(a.loadCell(H,this._workCell).getCode()!==g.NULL_CELL_CODE||d&&H===h){p=H+1;break}for(H=0;H<p;H++){a.loadCell(H,this._workCell);var r=this._workCell.getWidth();if(0!==
r){var v=this._document.createElement("span");if(1<r&&(v.style.width=t*r+"px"),d&&H===h)switch(v.classList.add(c.CURSOR_CLASS),k&&v.classList.add(c.CURSOR_BLINK_CLASS),f){case "bar":v.classList.add(c.CURSOR_STYLE_BAR_CLASS);break;case "underline":v.classList.add(c.CURSOR_STYLE_UNDERLINE_CLASS);break;default:v.classList.add(c.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&v.classList.add(c.BOLD_CLASS);this._workCell.isItalic()&&v.classList.add(c.ITALIC_CLASS);this._workCell.isDim()&&v.classList.add(c.DIM_CLASS);
this._workCell.isUnderline()&&v.classList.add(c.UNDERLINE_CLASS);v.textContent=this._workCell.getChars()||g.WHITESPACE_CELL_CHAR;r=this._workCell.getFgColor();var x=this._workCell.getFgColorMode(),B=this._workCell.getBgColor(),D=this._workCell.getBgColorMode(),Ma=!!this._workCell.isInverse();if(Ma){var u=r;r=B;B=u;u=x;x=D;D=u}switch(x){case 16777216:case 33554432:this._workCell.isBold()&&8>r&&this._optionsService.options.drawBoldTextInBrightColors&&(r+=8);this._applyMinimumContrast(v,this._colors.background,
this._colors.ansi[r])||v.classList.add("xterm-fg-"+r);break;case 50331648:x=q.rgbaToColor(r>>16&255,r>>8&255,255&r);this._applyMinimumContrast(v,this._colors.background,x)||this._addStyle(v,"color:#"+b(r.toString(16),"0",6));break;default:this._applyMinimumContrast(v,this._colors.background,this._colors.foreground)||Ma&&v.classList.add("xterm-fg-"+e.INVERTED_DEFAULT_COLOR)}switch(D){case 16777216:case 33554432:v.classList.add("xterm-bg-"+B);break;case 50331648:this._addStyle(v,"background-color:#"+
b(B.toString(16),"0",6));break;default:Ma&&v.classList.add("xterm-bg-"+e.INVERTED_DEFAULT_COLOR)}n.appendChild(v)}}return n},a.prototype._applyMinimumContrast=function(a,b,c){if(1===this._optionsService.options.minimumContrastRatio)return!1;var d=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return void 0===d&&(d=q.ensureContrastRatio(b,c,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,null!=d?d:
null)),!!d&&(this._addStyle(a,"color:"+d.css),!0)},a.prototype._addStyle=function(a,b){a.setAttribute("style",""+(a.getAttribute("style")||"")+b+";")},a}();c.DomRendererRowFactory=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(12),e={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:["'",'"']};c.evaluateKeyboardEvent=function(a,c,d,f){var g={type:0,cancel:!1,key:void 0},h=(a.shiftKey?1:0)|(a.altKey?2:0)|(a.ctrlKey?4:0)|(a.metaKey?8:0);switch(a.keyCode){case 0:"UIKeyInputUpArrow"===a.key?g.key=c?b.C0.ESC+"OA":b.C0.ESC+"[A":"UIKeyInputLeftArrow"===a.key?g.key=c?b.C0.ESC+"OD":b.C0.ESC+"[D":"UIKeyInputRightArrow"===a.key?g.key=c?b.C0.ESC+"OC":b.C0.ESC+"[C":"UIKeyInputDownArrow"===a.key&&(g.key=c?b.C0.ESC+"OB":b.C0.ESC+"[B");break;case 8:if(a.shiftKey){g.key=
b.C0.BS;break}if(a.altKey){g.key=b.C0.ESC+b.C0.DEL;break}g.key=b.C0.DEL;break;case 9:if(a.shiftKey){g.key=b.C0.ESC+"[Z";break}g.key=b.C0.HT;g.cancel=!0;break;case 13:g.key=b.C0.CR;g.cancel=!0;break;case 27:g.key=b.C0.ESC;g.cancel=!0;break;case 37:if(a.metaKey)break;h?(g.key=b.C0.ESC+"[1;"+(h+1)+"D",g.key===b.C0.ESC+"[1;3D"&&(g.key=b.C0.ESC+(d?"b":"[1;5D"))):g.key=c?b.C0.ESC+"OD":b.C0.ESC+"[D";break;case 39:if(a.metaKey)break;h?(g.key=b.C0.ESC+"[1;"+(h+1)+"C",g.key===b.C0.ESC+"[1;3C"&&(g.key=b.C0.ESC+
(d?"f":"[1;5C"))):g.key=c?b.C0.ESC+"OC":b.C0.ESC+"[C";break;case 38:if(a.metaKey)break;h?(g.key=b.C0.ESC+"[1;"+(h+1)+"A",d||g.key!==b.C0.ESC+"[1;3A"||(g.key=b.C0.ESC+"[1;5A")):g.key=c?b.C0.ESC+"OA":b.C0.ESC+"[A";break;case 40:if(a.metaKey)break;h?(g.key=b.C0.ESC+"[1;"+(h+1)+"B",d||g.key!==b.C0.ESC+"[1;3B"||(g.key=b.C0.ESC+"[1;5B")):g.key=c?b.C0.ESC+"OB":b.C0.ESC+"[B";break;case 45:a.shiftKey||a.ctrlKey||(g.key=b.C0.ESC+"[2~");break;case 46:g.key=h?b.C0.ESC+"[3;"+(h+1)+"~":b.C0.ESC+"[3~";break;case 36:g.key=
h?b.C0.ESC+"[1;"+(h+1)+"H":c?b.C0.ESC+"OH":b.C0.ESC+"[H";break;case 35:g.key=h?b.C0.ESC+"[1;"+(h+1)+"F":c?b.C0.ESC+"OF":b.C0.ESC+"[F";break;case 33:a.shiftKey?g.type=2:g.key=b.C0.ESC+"[5~";break;case 34:a.shiftKey?g.type=3:g.key=b.C0.ESC+"[6~";break;case 112:g.key=h?b.C0.ESC+"[1;"+(h+1)+"P":b.C0.ESC+"OP";break;case 113:g.key=h?b.C0.ESC+"[1;"+(h+1)+"Q":b.C0.ESC+"OQ";break;case 114:g.key=h?b.C0.ESC+"[1;"+(h+1)+"R":b.C0.ESC+"OR";break;case 115:g.key=h?b.C0.ESC+"[1;"+(h+1)+"S":b.C0.ESC+"OS";break;case 116:g.key=
h?b.C0.ESC+"[15;"+(h+1)+"~":b.C0.ESC+"[15~";break;case 117:g.key=h?b.C0.ESC+"[17;"+(h+1)+"~":b.C0.ESC+"[17~";break;case 118:g.key=h?b.C0.ESC+"[18;"+(h+1)+"~":b.C0.ESC+"[18~";break;case 119:g.key=h?b.C0.ESC+"[19;"+(h+1)+"~":b.C0.ESC+"[19~";break;case 120:g.key=h?b.C0.ESC+"[20;"+(h+1)+"~":b.C0.ESC+"[20~";break;case 121:g.key=h?b.C0.ESC+"[21;"+(h+1)+"~":b.C0.ESC+"[21~";break;case 122:g.key=h?b.C0.ESC+"[23;"+(h+1)+"~":b.C0.ESC+"[23~";break;case 123:g.key=h?b.C0.ESC+"[24;"+(h+1)+"~":b.C0.ESC+"[24~";break;
default:!a.ctrlKey||a.shiftKey||a.altKey||a.metaKey?d&&!f||!a.altKey||a.metaKey?d&&!a.altKey&&!a.ctrlKey&&a.metaKey?65===a.keyCode&&(g.type=1):a.key&&!a.ctrlKey&&!a.altKey&&!a.metaKey&&48<=a.keyCode&&1===a.key.length?g.key=a.key:a.key&&a.ctrlKey&&"_"===a.key&&(g.key=b.C0.US):(c=(c=e[a.keyCode])&&c[a.shiftKey?1:0])?g.key=b.C0.ESC+c:65<=a.keyCode&&90>=a.keyCode&&(g.key=b.C0.ESC+String.fromCharCode(a.ctrlKey?a.keyCode-64:a.keyCode+32)):65<=a.keyCode&&90>=a.keyCode?g.key=String.fromCharCode(a.keyCode-
64):32===a.keyCode?g.key=b.C0.NUL:51<=a.keyCode&&55>=a.keyCode?g.key=String.fromCharCode(a.keyCode-51+27):56===a.keyCode?g.key=b.C0.DEL:219===a.keyCode?g.key=b.C0.ESC:220===a.keyCode?g.key=b.C0.FS:221===a.keyCode&&(g.key=b.C0.GS)}return g}},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(3);c.handleWindowsModeLineFeed=function(a){var c,d=null===(c=a.buffer.lines.get(a.buffer.ybase+a.buffer.y-1))||void 0===c?void 0:c.get(a.cols-1);(a=a.buffer.lines.get(a.buffer.ybase+a.buffer.y))&&
d&&(a.isWrapped=d[b.CHAR_DATA_CODE_INDEX]!==b.NULL_CELL_CODE&&d[b.CHAR_DATA_CODE_INDEX]!==b.WHITESPACE_CELL_CODE)}},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}),g=this&&this.__decorate||function(a,
b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},k=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,"__esModule",{value:!0});var q=d(30),t=d(1);a=d(2);var p=d(31),v=d(7),n=d(0),r=d(4);d=function(a){function b(b,
c,d,e,f){var g=a.call(this)||this;if(g._renderer=b,g._rowCount=c,g.screenElement=d,g.optionsService=e,g.charSizeService=f,g._isPaused=!1,g._needsFullRefresh=!1,g._canvasWidth=0,g._canvasHeight=0,g._onDimensionsChange=new t.EventEmitter,g._onRender=new t.EventEmitter,g._onRefreshRequest=new t.EventEmitter,g._renderDebouncer=new q.RenderDebouncer(function(a,b){return g._renderRows(a,b)}),g.register(g._renderDebouncer),g._screenDprMonitor=new p.ScreenDprMonitor,g._screenDprMonitor.setListener(function(){return g.onDevicePixelRatioChange()}),
g.register(g._screenDprMonitor),g.register(e.onOptionChange(function(){return g._renderer.onOptionsChanged()})),g.register(f.onCharSizeChange(function(){return g.onCharSizeChanged()})),g._renderer.onRequestRefreshRows(function(a){return g.refreshRows(a.start,a.end)}),g.register(v.addDisposableDomListener(window,"resize",function(){return g.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var h=new IntersectionObserver(function(a){return g._onIntersectionChange(a[a.length-1])},{threshold:0});
h.observe(d);g.register({dispose:function(){return h.disconnect()}})}return g}return e(b,a),Object.defineProperty(b.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,
"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!0,configurable:!0}),b.prototype._onIntersectionChange=function(a){this._isPaused=0===a.intersectionRatio;!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},b.prototype.refreshRows=function(a,b){this._isPaused?this._needsFullRefresh=!0:this._renderDebouncer.refresh(a,b,this._rowCount)},b.prototype._renderRows=function(a,b){this._renderer.renderRows(a,b);this._onRender.fire({start:a,
end:b})},b.prototype.resize=function(a,b){this._rowCount=b;this._fireOnCanvasResize()},b.prototype.changeOptions=function(){this._renderer.onOptionsChanged();this.refreshRows(0,this._rowCount-1);this._fireOnCanvasResize()},b.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},b.prototype.dispose=function(){this._renderer.dispose();a.prototype.dispose.call(this)},
b.prototype.setRenderer=function(a){var b=this;this._renderer.dispose();this._renderer=a;this._renderer.onRequestRefreshRows(function(a){return b.refreshRows(a.start,a.end)});this.refreshRows(0,this._rowCount-1)},b.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},b.prototype.setColors=function(a){this._renderer.setColors(a);this._fullRefresh()},b.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange();
this.refreshRows(0,this._rowCount-1)},b.prototype.onResize=function(a,b){this._renderer.onResize(a,b);this._fullRefresh()},b.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},b.prototype.onBlur=function(){this._renderer.onBlur()},b.prototype.onFocus=function(){this._renderer.onFocus()},b.prototype.onSelectionChanged=function(a,b,c){this._renderer.onSelectionChanged(a,b,c)},b.prototype.onCursorMove=function(){this._renderer.onCursorMove()},b.prototype.clear=function(){this._renderer.clear()},
b.prototype.registerCharacterJoiner=function(a){return this._renderer.registerCharacterJoiner(a)},b.prototype.deregisterCharacterJoiner=function(a){return this._renderer.deregisterCharacterJoiner(a)},b=g([k(3,n.IOptionsService),k(4,r.ICharSizeService)],b)}(a.Disposable);c.RenderService=d},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(1);a=d(11);var e=d(32);c.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq";
c.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",bellSound:c.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,logLevel:"info",scrollback:1E3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,
allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:a.isMac,rendererType:"canvas",windowsMode:!1,convertEol:!1,termName:"xterm",screenKeys:!1,cancelEvents:!1,useFlowControl:!1,wordSeparator:" ()[]{}',:;\"`"});var g=["cols","rows"];d=function(){function a(a){var d=this;this._onOptionChange=new b.EventEmitter;this.options=e.clone(c.DEFAULT_OPTIONS);Object.keys(a).forEach(function(b){b in d.options&&(d.options[b]=a[b])})}return Object.defineProperty(a.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},
enumerable:!0,configurable:!0}),a.prototype.setOption=function(a,b){if(!(a in c.DEFAULT_OPTIONS))throw Error('No option with key "'+a+'"');if(-1!==g.indexOf(a))throw Error('Option "'+a+'" can only be set in the constructor');this.options[a]!==b&&(b=this._sanitizeAndValidateOption(a,b),this.options[a]!==b&&(this.options[a]=b,this._onOptionChange.fire(a)))},a.prototype._sanitizeAndValidateOption=function(a,b){switch(a){case "bellStyle":case "cursorStyle":case "fontWeight":case "fontWeightBold":case "rendererType":case "wordSeparator":b||
(b=c.DEFAULT_OPTIONS[a]);break;case "lineHeight":case "tabStopWidth":if(1>b)throw Error(a+" cannot be less than 1, value: "+b);break;case "minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));case "scrollback":if(0>(b=Math.min(b,4294967295)))throw Error(a+" cannot be less than 0, value: "+b);break;case "fastScrollSensitivity":case "scrollSensitivity":if(0>=b)throw Error(a+" cannot be less than or equal to 0, value: "+b);}return b},a.prototype.getOption=function(a){if(!(a in c.DEFAULT_OPTIONS))throw Error('No option with key "'+
a+'"');return this.options[a]},a}();c.OptionsService=d},function(a,c,d){var b=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},e=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,
"__esModule",{value:!0});var g=d(0),k=d(1);a=function(){function a(a,b,c){this.document=a;this.parentElement=b;this._optionsService=c;this.height=this.width=0;this._onCharSizeChange=new k.EventEmitter;this._measureStrategy=new q(a,b,this._optionsService)}return Object.defineProperty(a.prototype,"hasValidSize",{get:function(){return 0<this.width&&0<this.height},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},
enumerable:!0,configurable:!0}),a.prototype.measure=function(){var a=this._measureStrategy.measure();a.width===this.width&&a.height===this.height||(this.width=a.width,this.height=a.height,this._onCharSizeChange.fire())},a=b([e(2,g.IOptionsService)],a)}();c.CharSizeService=a;var q=function(){function a(a,b,c){this._document=a;this._parentElement=b;this._optionsService=c;this._result={width:0,height:0};this._measureElement=this._document.createElement("span");this._measureElement.classList.add("xterm-char-measure-element");
this._measureElement.textContent="W";this._measureElement.setAttribute("aria-hidden","true");this._parentElement.appendChild(this._measureElement)}return a.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily;this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var a=this._measureElement.getBoundingClientRect();return 0!==a.width&&0!==a.height&&(this._result.width=a.width,this._result.height=Math.ceil(a.height)),this._result},
a}()},function(a,c,d){var b=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},e=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,"__esModule",{value:!0});var g=d(0),
k=d(65);c.MINIMUM_COLS=2;c.MINIMUM_ROWS=1;a=function(){function a(a){this._optionsService=a;this.cols=Math.max(a.options.cols,c.MINIMUM_COLS);this.rows=Math.max(a.options.rows,c.MINIMUM_ROWS);this.buffers=new k.BufferSet(a,this)}return Object.defineProperty(a.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),a.prototype.resize=function(a,b){this.cols=a;this.rows=b},a.prototype.reset=function(){this.buffers=new k.BufferSet(this._optionsService,this)},a=
b([e(0,g.IOptionsService)],a)}();c.BufferService=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(66),e=d(1);a=function(){function a(a,c){this.optionsService=a;this.bufferService=c;this._onBufferActivate=new e.EventEmitter;this._normal=new b.Buffer(!0,a,c);this._normal.fillViewportRows();this._alt=new b.Buffer(!1,a,c);this._activeBuffer=this._normal;this.setupTabStops()}return Object.defineProperty(a.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},
enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"alt",{get:function(){return this._alt},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"normal",{get:function(){return this._normal},enumerable:!0,configurable:!0}),a.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,
this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},a.prototype.activateAltBuffer=function(a){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(a),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}))},a.prototype.resize=function(a,b){this._normal.resize(a,b);this._alt.resize(a,b)},a.prototype.setupTabStops=
function(a){this._normal.setupTabStops(a);this._alt.setupTabStops(a)},a}();c.BufferSet=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(67),e=d(16),g=d(5),k=d(3),q=d(68),t=d(69),p=d(18);c.MAX_BUFFER_SIZE=4294967295;a=function(){function a(a,c,d){this._hasScrollback=a;this._optionsService=c;this._bufferService=d;this.savedX=this.savedY=this.x=this.y=this.ybase=this.ydisp=0;this.savedCurAttrData=e.DEFAULT_ATTR_DATA.clone();this.savedCharset=p.DEFAULT_CHARSET;this.markers=
[];this._nullCell=g.CellData.fromCharData([0,k.NULL_CELL_CHAR,k.NULL_CELL_WIDTH,k.NULL_CELL_CODE]);this._whitespaceCell=g.CellData.fromCharData([0,k.WHITESPACE_CELL_CHAR,k.WHITESPACE_CELL_WIDTH,k.WHITESPACE_CELL_CODE]);this._cols=this._bufferService.cols;this._rows=this._bufferService.rows;this.lines=new b.CircularList(this._getCorrectBufferLength(this._rows));this.scrollTop=0;this.scrollBottom=this._rows-1;this.setupTabStops()}return a.prototype.getNullCell=function(a){return a?(this._nullCell.fg=
a.fg,this._nullCell.bg=a.bg):(this._nullCell.fg=0,this._nullCell.bg=0),this._nullCell},a.prototype.getWhitespaceCell=function(a){return a?(this._whitespaceCell.fg=a.fg,this._whitespaceCell.bg=a.bg):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0),this._whitespaceCell},a.prototype.getBlankLine=function(a,b){return new e.BufferLine(this._bufferService.cols,this.getNullCell(a),b)},Object.defineProperty(a.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>
this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"isCursorInViewport",{get:function(){var a=this.ybase+this.y-this.ydisp;return 0<=a&&a<this._rows},enumerable:!0,configurable:!0}),a.prototype._getCorrectBufferLength=function(a){if(!this._hasScrollback)return a;a+=this._optionsService.options.scrollback;return a>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:a},a.prototype.fillViewportRows=function(a){if(0===this.lines.length){void 0===a&&(a=e.DEFAULT_ATTR_DATA);for(var b=this._rows;b--;)this.lines.push(this.getBlankLine(a))}},
a.prototype.clear=function(){this.x=this.y=this.ybase=this.ydisp=0;this.lines=new b.CircularList(this._getCorrectBufferLength(this._rows));this.scrollTop=0;this.scrollBottom=this._rows-1;this.setupTabStops()},a.prototype.resize=function(a,b){var c=this.getNullCell(e.DEFAULT_ATTR_DATA),d=this._getCorrectBufferLength(b);if(d>this.lines.maxLength&&(this.lines.maxLength=d),0<this.lines.length){if(this._cols<a)for(var f=0;f<this.lines.length;f++)this.lines.get(f).resize(a,c);f=0;if(this._rows<b)for(var g=
this._rows;g<b;g++)this.lines.length<b+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new e.BufferLine(a,c)):0<this.ybase&&this.lines.length<=this.ybase+this.y+f+1?(this.ybase--,f++,0<this.ydisp&&this.ydisp--):this.lines.push(new e.BufferLine(a,c)));else for(g=this._rows;g>b;g--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));d<this.lines.maxLength&&(g=this.lines.length-d,0<g&&(this.lines.trimStart(g),this.ybase=
Math.max(this.ybase-g,0),this.ydisp=Math.max(this.ydisp-g,0),this.savedY=Math.max(this.savedY-g,0)),this.lines.maxLength=d);this.x=Math.min(this.x,a-1);this.y=Math.min(this.y,b-1);f&&(this.y+=f);this.savedX=Math.min(this.savedX,a-1);this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(a,b),this._cols>a))for(f=0;f<this.lines.length;f++)this.lines.get(f).resize(a,c);this._cols=a;this._rows=b},Object.defineProperty(a.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&
!this._optionsService.options.windowsMode},enumerable:!0,configurable:!0}),a.prototype._reflow=function(a,b){this._cols!==a&&(a>this._cols?this._reflowLarger(a,b):this._reflowSmaller(a,b))},a.prototype._reflowLarger=function(a,b){var c=q.reflowLargerGetLinesToRemove(this.lines,this._cols,a,this.ybase+this.y,this.getNullCell(e.DEFAULT_ATTR_DATA));0<c.length&&(c=q.reflowLargerCreateNewLayout(this.lines,c),q.reflowLargerApplyNewLayout(this.lines,c.layout),this._reflowLargerAdjustViewport(a,b,c.countRemoved))},
a.prototype._reflowLargerAdjustViewport=function(a,b,c){for(var d=this.getNullCell(e.DEFAULT_ATTR_DATA),f=c;0<f--;)0===this.ybase?(0<this.y&&this.y--,this.lines.length<b&&this.lines.push(new e.BufferLine(a,d))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-c,0)},a.prototype._reflowSmaller=function(a,b){for(var c=this.getNullCell(e.DEFAULT_ATTR_DATA),d=[],f=0,g=this.lines.length-1;0<=g;g--){var h=this.lines.get(g);if(!(!h||!h.isWrapped&&h.getTrimmedLength()<=
a)){for(var k=[h];h.isWrapped&&0<g;)h=this.lines.get(--g),k.unshift(h);h=this.ybase+this.y;if(!(h>=g&&h<g+k.length)){var n=k[k.length-1].getTrimmedLength(),p=q.reflowSmallerGetNewLineLengths(k,this._cols,a),t=p.length-k.length;var r=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+t):Math.max(0,this.lines.length-this.lines.maxLength+t);var v=[];for(h=0;h<t;h++){var x=this.getBlankLine(e.DEFAULT_ATTR_DATA,!0);v.push(x)}0<v.length&&(d.push({start:g+k.length+f,newLines:v}),
f+=v.length);k.push.apply(k,v);h=p.length-1;v=p[h];0===v&&(v=p[--h]);for(x=k.length-t-1;0<=x;){var u=Math.min(n,v);if(k[h].copyCellsFrom(k[x],n-u,v-u,u,!0),0===(v-=u)&&(v=p[--h]),0===(n-=u))x--,n=q.getWrappedLineTrimmedLength(k,Math.max(x,0),this._cols)}for(h=0;h<k.length;h++)p[h]<a&&k[h].setCell(p[h],c);for(h=t-r;0<h--;)0===this.ybase?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+f)-b&&(this.ybase===this.ydisp&&this.ydisp++,
this.ybase++);this.savedY=Math.min(this.savedY+t,this.ybase+b-1)}}}if(0<d.length){a=[];c=[];for(h=0;h<this.lines.length;h++)c.push(this.lines.get(h));b=this.lines.length;g=b-1;k=0;t=d[k];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+f);p=0;for(h=Math.min(this.lines.maxLength-1,b+f-1);0<=h;h--)if(t&&t.start>g+p){for(r=t.newLines.length-1;0<=r;r--)this.lines.set(h--,t.newLines[r]);h++;a.push({index:g+1,amount:t.newLines.length});p+=t.newLines.length;t=d[++k]}else this.lines.set(h,
c[g--]);d=0;for(h=a.length-1;0<=h;h--)a[h].index+=d,this.lines.onInsertEmitter.fire(a[h]),d+=a[h].amount;f=Math.max(0,b+f-this.lines.maxLength);0<f&&this.lines.onTrimEmitter.fire(f)}},a.prototype.stringIndexToBufferIndex=function(a,b,c){for(void 0===c&&(c=!1);b;){var d=this.lines.get(a);if(!d)return[-1,-1];for(var e=c?d.getTrimmedLength():d.length,f=0;f<e;++f)if(d.get(f)[k.CHAR_DATA_WIDTH_INDEX]&&(b-=d.get(f)[k.CHAR_DATA_CHAR_INDEX].length||1),0>b)return[a,f];a++}return[a,0]},a.prototype.translateBufferLineToString=
function(a,b,c,d){void 0===c&&(c=0);return(a=this.lines.get(a))?a.translateToString(b,c,d):""},a.prototype.getWrappedRangeForLine=function(a){for(var b=a;0<b&&this.lines.get(b).isWrapped;)b--;for(;a+1<this.lines.length&&this.lines.get(a+1).isWrapped;)a++;return{first:b,last:a}},a.prototype.setupTabStops=function(a){for(null!=a?this.tabs[a]||(a=this.prevStop(a)):(this.tabs={},a=0);a<this._cols;a+=this._optionsService.options.tabStopWidth)this.tabs[a]=!0},a.prototype.prevStop=function(a){for(null==
a&&(a=this.x);!this.tabs[--a]&&0<a;);return a>=this._cols?this._cols-1:0>a?0:a},a.prototype.nextStop=function(a){for(null==a&&(a=this.x);!this.tabs[++a]&&a<this._cols;);return a>=this._cols?this._cols-1:0>a?0:a},a.prototype.addMarker=function(a){var b=this,c=new t.Marker(a);return this.markers.push(c),c.register(this.lines.onTrim(function(a){c.line-=a;0>c.line&&c.dispose()})),c.register(this.lines.onInsert(function(a){c.line>=a.index&&(c.line+=a.amount)})),c.register(this.lines.onDelete(function(a){c.line>=
a.index&&c.line<a.index+a.amount&&c.dispose();c.line>a.index&&(c.line-=a.amount)})),c.register(c.onDispose(function(){return b._removeMarker(c)})),c},a.prototype._removeMarker=function(a){this.markers.splice(this.markers.indexOf(a),1)},a.prototype.iterator=function(a,b,c,d,e){return new v(this,a,b,c,d,e)},a}();c.Buffer=a;var v=function(){function a(a,b,c,d,e,f){void 0===c&&(c=0);void 0===d&&(d=a.lines.length);void 0===e&&(e=0);void 0===f&&(f=0);this._buffer=a;this._trimRight=b;this._startIndex=c;
this._endIndex=d;this._startOverscan=e;this._endOverscan=f;0>this._startIndex&&(this._startIndex=0);this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length);this._current=this._startIndex}return a.prototype.hasNext=function(){return this._current<this._endIndex},a.prototype.next=function(){var a=this._buffer.getWrappedRangeForLine(this._current);a.first<this._startIndex-this._startOverscan&&(a.first=this._startIndex-this._startOverscan);a.last>this._endIndex+this._endOverscan&&
(a.last=this._endIndex+this._endOverscan);a.first=Math.max(a.first,0);a.last=Math.min(a.last,this._buffer.lines.length);for(var b="",c=a.first;c<=a.last;++c)b+=this._buffer.translateBufferLineToString(c,this._trimRight);return this._current=a.last+1,{range:a,content:b}},a}();c.BufferStringIterator=v},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});var b=d(1);a=function(){function a(a){this._maxLength=a;this.onDeleteEmitter=new b.EventEmitter;this.onInsertEmitter=new b.EventEmitter;
this.onTrimEmitter=new b.EventEmitter;this._array=Array(this._maxLength);this._length=this._startIndex=0}return Object.defineProperty(a.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,
"maxLength",{get:function(){return this._maxLength},set:function(a){if(this._maxLength!==a){for(var b=Array(a),c=0;c<Math.min(a,this.length);c++)b[c]=this._array[this._getCyclicIndex(c)];this._array=b;this._maxLength=a;this._startIndex=0}},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"length",{get:function(){return this._length},set:function(a){if(a>this._length)for(var b=this._length;b<a;b++)this._array[b]=void 0;this._length=a},enumerable:!0,configurable:!0}),a.prototype.get=
function(a){return this._array[this._getCyclicIndex(a)]},a.prototype.set=function(a,b){this._array[this._getCyclicIndex(a)]=b},a.prototype.push=function(a){this._array[this._getCyclicIndex(this._length)]=a;this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},a.prototype.recycle=function(){if(this._length!==this._maxLength)throw 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)]},Object.defineProperty(a.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!0,configurable:!0}),a.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length-- -1)]},a.prototype.splice=function(a,b){for(var c=[],d=2;d<arguments.length;d++)c[d-2]=arguments[d];if(b){for(d=a;d<this._length-b;d++)this._array[this._getCyclicIndex(d)]=this._array[this._getCyclicIndex(d+b)];this._length-=
b}for(d=this._length-1;d>=a;d--)this._array[this._getCyclicIndex(d+c.length)]=this._array[this._getCyclicIndex(d)];for(d=0;d<c.length;d++)this._array[this._getCyclicIndex(a+d)]=c[d];this._length+c.length>this._maxLength?(c=this._length+c.length-this._maxLength,this._startIndex+=c,this._length=this._maxLength,this.onTrimEmitter.fire(c)):this._length+=c.length},a.prototype.trimStart=function(a){a>this._length&&(a=this._length);this._startIndex+=a;this._length-=a;this.onTrimEmitter.fire(a)},a.prototype.shiftElements=
function(a,b,c){if(!(0>=b)){if(0>a||a>=this._length)throw Error("start argument out of range");if(0>a+c)throw Error("Cannot shift elements in list beyond index 0");if(0<c){for(var d=b-1;0<=d;d--)this.set(a+d+c,this.get(a+d));a=a+b+c-this._length;if(0<a)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(d=0;d<b;d++)this.set(a+d+c,this.get(a+d))}},a.prototype._getCyclicIndex=function(a){return(this._startIndex+a)%this._maxLength},
a}();c.CircularList=a},function(a,c,d){function b(a,b,c){if(b===a.length-1)return a[b].getTrimmedLength();var d=!a[b].hasContent(c-1)&&1===a[b].getWidth(c-1);a=2===a[b+1].getWidth(0);return d&&a?c-1:c}Object.defineProperty(c,"__esModule",{value:!0});c.reflowLargerGetLinesToRemove=function(a,c,d,e,f){for(var g=[],h=0;h<a.length-1;h++){var k=h,q=a.get(++k);if(q.isWrapped){for(var t=[a.get(h)];k<a.length&&q.isWrapped;)t.push(q),q=a.get(++k);if(!(e>=h&&e<k)){k=0;q=b(t,k,c);for(var u=1,z=0;u<t.length;){var A=
b(t,u,c),Da=Math.min(A-z,d-q);t[k].copyCellsFrom(t[u],z,q,Da,!1);(q+=Da)===d&&(k++,q=0);(z+=Da)===A&&(u++,z=0);0===q&&0!==k&&2===t[k-1].getWidth(d-1)&&(t[k].copyCellsFrom(t[k-1],d-1,q++,1,!1),t[k-1].setCell(d-1,f))}t[k].replaceCells(q,d,f);q=0;for(u=t.length-1;0<u&&(u>k||0===t[u].getTrimmedLength());u--)q++;0<q&&(g.push(h+t.length-q),g.push(q))}h+=t.length-1}}return g};c.reflowLargerCreateNewLayout=function(a,b){for(var c=[],d=0,e=b[d],f=0,g=0;g<a.length;g++)e===g?(e=b[++d],a.onDeleteEmitter.fire({index:g-
f,amount:e}),g+=e-1,f+=e,e=b[++d]):c.push(g);return{layout:c,countRemoved:f}};c.reflowLargerApplyNewLayout=function(a,b){for(var c=[],d=0;d<b.length;d++)c.push(a.get(b[d]));for(d=0;d<c.length;d++)a.set(d,c[d]);a.length=b.length};c.reflowSmallerGetNewLineLengths=function(a,c,d){for(var e=[],f=a.map(function(d,e){return b(a,e,c)}).reduce(function(a,b){return a+b}),g=0,h=0,k=0;k<f;){if(f-k<d){e.push(f-k);break}g+=d;var r=b(a,h,c);g>r&&(g-=r,h++);(r=2===a[h].getWidth(g-1))&&g--;r=r?d-1:d;e.push(r);k+=
r}return e};c.getWrappedLineTrimmedLength=b},function(a,c,d){var b,e=this&&this.__extends||(b=function(a,c){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])})(a,c)},function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)});Object.defineProperty(c,"__esModule",{value:!0});var g=d(1);a=function(a){function b(c){var d=a.call(this)||
this;return d.line=c,d._id=b._nextId++,d.isDisposed=!1,d._onDispose=new g.EventEmitter,d}return e(b,a),Object.defineProperty(b.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!0,configurable:!0}),b.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},b._nextId=1,b}(d(2).Disposable);c.Marker=a},function(a,c,d){var b=
this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},e=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,"__esModule",{value:!0});var g=d(4),k=d(29);a=function(){function a(a,
b){this._renderService=a;this._charSizeService=b}return a.prototype.getCoords=function(a,b,c,d,e){return k.getCoords(a,b,c,d,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,e)},a.prototype.getRawByteCoords=function(a,b,c,d){a=this.getCoords(a,b,c,d);return k.getRawByteCoords(a)},a=b([e(0,g.IRenderService),e(1,g.ICharSizeService)],a)}();c.MouseService=a},function(a,c,d){var b=this&&this.__decorate||function(a,b,c,d){var e,
f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},e=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,"__esModule",{value:!0});var g=d(0),k=d(1),q=d(32),t=Object.freeze({applicationCursorKeys:!1});a=function(){function a(a,
b,c,d){this._scrollToBottom=a;this._bufferService=b;this._logService=c;this._optionsService=d;this.isCursorHidden=this.isCursorInitialized=!1;this._onData=new k.EventEmitter;this._onUserInput=new k.EventEmitter;this._onBinary=new k.EventEmitter;this.decPrivateModes=q.clone(t)}return Object.defineProperty(a.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!0,
configurable:!0}),Object.defineProperty(a.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!0,configurable:!0}),a.prototype.reset=function(){this.decPrivateModes=q.clone(t)},a.prototype.triggerDataEvent=function(a,b){if(void 0===b&&(b=!1),!this._optionsService.options.disableStdin){var c=this._bufferService.buffer;c.ybase!==c.ydisp&&this._scrollToBottom();b&&this._onUserInput.fire();this._logService.debug('sending data "'+a+'"',function(){return a.split("").map(function(a){return a.charCodeAt(0)})});
this._onData.fire(a)}},a.prototype.triggerBinaryEvent=function(a){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+a+'"',function(){return a.split("").map(function(a){return a.charCodeAt(0)})}),this._onBinary.fire(a))},a=b([e(1,g.IBufferService),e(2,g.ILogService),e(3,g.IOptionsService)],a)}();c.CoreService=a},function(a,c,d){var b=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==
typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},e=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}},g=this&&this.__spreadArrays||function(){for(var a=0,b=0,c=arguments.length;b<c;b++)a+=arguments[b].length;a=Array(a);var d=0;for(b=0;b<c;b++)for(var e=arguments[b],f=0,g=e.length;f<g;f++,d++)a[d]=e[f];return a};Object.defineProperty(c,
"__esModule",{value:!0});var k,q=d(0);!function(a){a[a.DEBUG=0]="DEBUG";a[a.INFO=1]="INFO";a[a.WARN=2]="WARN";a[a.ERROR=3]="ERROR";a[a.OFF=4]="OFF"}(k=c.LogLevel||(c.LogLevel={}));var t={debug:k.DEBUG,info:k.INFO,warn:k.WARN,error:k.ERROR,off:k.OFF};a=function(){function a(a){var b=this;this._optionsService=a;this._updateLogLevel();this._optionsService.onOptionChange(function(a){"logLevel"===a&&b._updateLogLevel()})}return a.prototype._updateLogLevel=function(){this._logLevel=t[this._optionsService.options.logLevel]},
a.prototype._evalLazyOptionalParams=function(a){for(var b=0;b<a.length;b++)"function"==typeof a[b]&&(a[b]=a[b]())},a.prototype._log=function(a,b,c){this._evalLazyOptionalParams(c);a.call.apply(a,g([console,"xterm.js: "+b],c))},a.prototype.debug=function(a){for(var b=[],c=1;c<arguments.length;c++)b[c-1]=arguments[c];this._logLevel<=k.DEBUG&&this._log(console.log,a,b)},a.prototype.info=function(a){for(var b=[],c=1;c<arguments.length;c++)b[c-1]=arguments[c];this._logLevel<=k.INFO&&this._log(console.info,
a,b)},a.prototype.warn=function(a){for(var b=[],c=1;c<arguments.length;c++)b[c-1]=arguments[c];this._logLevel<=k.WARN&&this._log(console.warn,a,b)},a.prototype.error=function(a){for(var b=[],c=1;c<arguments.length;c++)b[c-1]=arguments[c];this._logLevel<=k.ERROR&&this._log(console.error,a,b)},a=b([e(0,q.IOptionsService)],a)}();c.LogService=a},function(a,c,d){var b=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==
typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},e=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,"__esModule",{value:!0});var g=d(0);a=function(){function a(a){this._bufferService=a;this.clearRange()}return Object.defineProperty(a.prototype,"start",{get:function(){return this._start},enumerable:!0,
configurable:!0}),Object.defineProperty(a.prototype,"end",{get:function(){return this._end},enumerable:!0,configurable:!0}),a.prototype.clearRange=function(){this._end=this._start=this._bufferService.buffer.y},a.prototype.markDirty=function(a){a<this._start?this._start=a:a>this._end&&(this._end=a)},a.prototype.markRangeDirty=function(a,b){if(a>b){var c=a;a=b;b=c}a<this._start&&(this._start=a);b>this._end&&(this._end=b)},a.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-
1)},a=b([e(0,g.IBufferService)],a)}();c.DirtyRowService=a},function(a,c,d){var b=this&&this.__spreadArrays||function(){for(var a=0,b=0,c=arguments.length;b<c;b++)a+=arguments[b].length;a=Array(a);var d=0;for(b=0;b<c;b++)for(var e=arguments[b],f=0,g=e.length;f<g;f++,d++)a[d]=e[f];return a};Object.defineProperty(c,"__esModule",{value:!0});var e=d(0),g=d(14),k=function(){function a(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];this._entries=new Map;for(b=0;b<a.length;b++){var c=a[b];this.set(c[0],
c[1])}}return a.prototype.set=function(a,b){var c=this._entries.get(a);return this._entries.set(a,b),c},a.prototype.forEach=function(a){this._entries.forEach(function(b,c){return a(c,b)})},a.prototype.has=function(a){return this._entries.has(a)},a.prototype.get=function(a){return this._entries.get(a)},a}();c.ServiceCollection=k;a=function(){function a(){this._services=new k;this._services.set(e.IInstantiationService,this)}return a.prototype.setService=function(a,b){this._services.set(a,b)},a.prototype.createInstance=
function(a){for(var c=[],d=1;d<arguments.length;d++)c[d-1]=arguments[d];var e=g.getServiceDependencies(a).sort(function(a,b){return a.index-b.index});d=[];for(var f=0;f<e.length;f++){var h=e[f],k=this._services.get(h.id);if(!k)throw Error("[createInstance] "+a.name+" depends on UNKNOWN service "+h.id+".");d.push(k)}e=0<e.length?e[0].index:c.length;if(c.length!==e)throw Error("[createInstance] First service dependency of "+a.name+" at position "+(e+1)+" conflicts with "+c.length+" static arguments");
return new (a.bind.apply(a,b([void 0],b(c,d))))},a}();c.InstantiationService=a},function(a,c,d){function b(a,b){var c=(a.ctrl?16:0)|(a.shift?4:0)|(a.alt?8:0);return 4===a.button?(c|=64,c|=a.action):(c|=3&a.button,4&a.button&&(c|=64),8&a.button&&(c|=128),32===a.action?c|=32:0!==a.action||b||(c|=3)),c}var e=this&&this.__decorate||function(a,b,c,d){var e,f=arguments.length,g=3>f?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)g=Reflect.decorate(a,
b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(g=(3>f?e(g):3<f?e(b,c,g):e(b,c))||g);return 3<f&&g&&Object.defineProperty(b,c,g),g},g=this&&this.__param||function(a,b){return function(c,d){b(c,d,a)}};Object.defineProperty(c,"__esModule",{value:!0});var k=d(0),q=d(1),t={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(a){return 4!==a.button&&1===a.action&&(a.ctrl=!1,a.alt=!1,a.shift=!1,!0)}},VT200:{events:19,restrict:function(a){return 32!==a.action}},DRAG:{events:23,
restrict:function(a){return 32!==a.action||3!==a.button}},ANY:{events:31,restrict:function(a){return!0}}},p=String.fromCharCode,v={DEFAULT:function(a){a=[b(a,!1)+32,a.col+32,a.row+32];return 255<a[0]||255<a[1]||255<a[2]?"":"\u001b[M"+p(a[0])+p(a[1])+p(a[2])},SGR:function(a){var c=0===a.action&&4!==a.button?"m":"M";return"\u001b[<"+b(a,!0)+";"+a.col+";"+a.row+c}};a=function(){function a(a,b){var c=this;this._bufferService=a;this._coreService=b;this._protocols={};this._encodings={};this._activeEncoding=
this._activeProtocol="";this._onProtocolChange=new q.EventEmitter;this._lastEvent=null;Object.keys(t).forEach(function(a){return c.addProtocol(a,t[a])});Object.keys(v).forEach(function(a){return c.addEncoding(a,v[a])});this.reset()}return a.prototype.addProtocol=function(a,b){this._protocols[a]=b},a.prototype.addEncoding=function(a,b){this._encodings[a]=b},Object.defineProperty(a.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(a){if(!this._protocols[a])throw Error('unknown protocol "'+
a+'"');this._activeProtocol=a;this._onProtocolChange.fire(this._protocols[a].events)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(a){if(!this._encodings[a])throw Error('unknown encoding "'+a+'"');this._activeEncoding=a},enumerable:!0,configurable:!0}),a.prototype.reset=function(){this.activeProtocol="NONE";this.activeEncoding="DEFAULT";this._lastEvent=null},Object.defineProperty(a.prototype,"onProtocolChange",
{get:function(){return this._onProtocolChange.event},enumerable:!0,configurable:!0}),a.prototype.triggerMouseEvent=function(a){if(0>a.col||a.col>=this._bufferService.cols||0>a.row||a.row>=this._bufferService.rows||4===a.button&&32===a.action||3===a.button&&32!==a.action||4!==a.button&&(2===a.action||3===a.action)||(a.col++,a.row++,32===a.action&&this._lastEvent&&this._compareEvents(this._lastEvent,a))||!this._protocols[this._activeProtocol].restrict(a))return!1;var b=this._encodings[this._activeEncoding](a);
return b&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!0)),this._lastEvent=a,!0},a.prototype.explainEvents=function(a){return{DOWN:!!(1&a),UP:!!(2&a),DRAG:!!(4&a),MOVE:!!(8&a),WHEEL:!!(16&a)}},a.prototype._compareEvents=function(a,b){return a.col===b.col&&a.row===b.row&&a.button===b.button&&a.action===b.action&&a.ctrl===b.ctrl&&a.alt===b.alt&&a.shift===b.shift},a=e([g(0,k.IBufferService),g(1,k.ICoreService)],a)}();c.CoreMouseService=
a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=function(){function a(a){this._action=a;this._writeBuffer=[];this._callbacks=[];this._bufferOffset=this._pendingData=0}return a.prototype.writeSync=function(a){if(this._writeBuffer.length){for(var b=this._bufferOffset;b<this._writeBuffer.length;++b){var c=this._callbacks[b];this._action(this._writeBuffer[b]);c&&c()}this._writeBuffer=[];this._callbacks=[];this._pendingData=0;this._bufferOffset=2147483647}this._action(a)},a.prototype.write=
function(a,b){var c=this;if(5E7<this._pendingData)throw Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return c._innerWrite()}));this._pendingData+=a.length;this._writeBuffer.push(a);this._callbacks.push(b)},a.prototype._innerWrite=function(){for(var a=this,b=Date.now();this._writeBuffer.length>this._bufferOffset;){var c=this._writeBuffer[this._bufferOffset],d=this._callbacks[this._bufferOffset];if(this._bufferOffset++,
this._action(c),this._pendingData-=c.length,d&&d(),12<=Date.now()-b)break}this._writeBuffer.length>this._bufferOffset?(50<this._bufferOffset&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return a._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},a}();c.WriteBuffer=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});
a=function(){function a(a){this._textarea=a}return Object.defineProperty(a.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!0,configurable:!0}),a}();c.CoreBrowserService=a},function(a,c,d){Object.defineProperty(c,"__esModule",{value:!0});a=function(){function a(){this._addons=[]}return a.prototype.dispose=function(){for(var a=this._addons.length-1;0<=a;a--)this._addons[a].instance.dispose()},a.prototype.loadAddon=function(a,b){var c=
this,d={instance:b,dispose:b.dispose,isDisposed:!1};this._addons.push(d);b.dispose=function(){return c._wrappedAddonDispose(d)};b.activate(a)},a.prototype._wrappedAddonDispose=function(a){if(!a.isDisposed){for(var b=-1,c=0;c<this._addons.length;c++)if(this._addons[c]===a){b=c;break}if(-1===b)throw Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0;a.dispose.apply(a.instance);this._addons.splice(b,1)}},a}();c.AddonManager=a}])})}),Hh=Kc(Mf),Ih=Mf.Terminal,Nf=Lc(function(d,
a){!function(a,c){d.exports=c()}(window,function(){return function(a){function b(c){if(d[c])return d[c].exports;var e=d[c]={i:c,l:!1,exports:{}};return a[c].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var d={};return b.m=a,b.c=d,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"});Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,
c){if((1&c&&(a=b(a)),8&c)||4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a.default}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=0)}([function(a,c,d){Object.defineProperty(c,
"__esModule",{value:!0});a=function(){function a(){}return a.prototype.activate=function(a){this._terminal=a},a.prototype.dispose=function(){},a.prototype.fit=function(){var a=this.proposeDimensions();if(a&&this._terminal){var b=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(b._renderService.clear(),this._terminal.resize(a.cols,a.rows))}},a.prototype.proposeDimensions=function(){if(this._terminal&&this._terminal.element.parentElement){var a=this._terminal._core,
b=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(b.getPropertyValue("height"));b=Math.max(0,parseInt(b.getPropertyValue("width")));var d=window.getComputedStyle(this._terminal.element);c-=parseInt(d.getPropertyValue("padding-top"))+parseInt(d.getPropertyValue("padding-bottom"));b=b-(parseInt(d.getPropertyValue("padding-right"))+parseInt(d.getPropertyValue("padding-left")))-a.viewport.scrollBarWidth;return{cols:Math.floor(b/a._renderService.dimensions.actualCellWidth),rows:Math.floor(c/
a._renderService.dimensions.actualCellHeight)}}},a}();c.FitAddon=a}])})});Kc(Nf);var Jh=Nf.FitAddon,Of=Lc(function(d,a){!function(a,c){d.exports=c()}(window,function(){return function(a){function b(c){if(d[c])return d[c].exports;var e=d[c]={i:c,l:!1,exports:{}};return a[c].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var d={};return b.m=a,b.c=d,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,
Symbol.toStringTag,{value:"Module"});Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if((1&c&&(a=b(a)),8&c)||4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a.default}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,
b)},b.p="",b(b.s=0)}([function(a,c,d){function b(a,b){window.open(b,"_blank")}Object.defineProperty(c,"__esModule",{value:!0});var e=/(?:^|[^\da-z\.-]+)((https?:\/\/)((([\da-z\.-]+)\.([a-z\.]{2,6}))|((\d{1,3}\.){3}\d{1,3})|(localhost))(:\d{1,5})?((\/[\/\w\.\-%~:+]*)*([^:"'\s]))?(\?[0-9\w\[\]\(\)\/\?\!#@$%&'*+,:;~\=\.\-]*)?(#[0-9\w\[\]\(\)\/\?\!#@$%&'*+,:;~\=\.\-]*)?)($|[^\/\w\.\-%]+)/;a=function(){function a(a,c){void 0===a&&(a=b);void 0===c&&(c={});this._handler=a;this._options=c;this._options.matchIndex=
1}return a.prototype.activate=function(a){this._terminal=a;this._linkMatcherId=this._terminal.registerLinkMatcher(e,this._handler,this._options)},a.prototype.dispose=function(){void 0!==this._linkMatcherId&&void 0!==this._terminal&&this._terminal.deregisterLinkMatcher(this._linkMatcherId)},a}();c.WebLinksAddon=a}])})});Kc(Of);var Kh=Of.WebLinksAddon,za="undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{},S="undefined"!==typeof globalThis?globalThis:
"undefined"!==typeof window?window:"undefined"!==typeof za?za:"undefined"!==typeof self?self:{},I=ba(function(d,a){Object.defineProperty(a,"__esModule",{value:!0});a.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,
S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}});P(I);var Lh=ba(function(d,a){a.default="function"===typeof BigInt?BigInt:function(){throw Error("BigInt is not supported in this environment.");}}),zb=ba(function(d,a){Object.defineProperty(a,
"__esModule",{value:!0});var b=I.constants.S_IFMT,c=I.constants.S_IFDIR,e=I.constants.S_IFREG,f=I.constants.S_IFBLK,h=I.constants.S_IFCHR,g=I.constants.S_IFLNK,k=I.constants.S_IFIFO,q=I.constants.S_IFSOCK;d=function(){function a(){}a.build=function(b,c){void 0===c&&(c=!1);var d=new a,e=b.gid,f=b.atime,g=b.mtime,h=b.ctime;c=c?Lh.default:function(a){return a};d.uid=c(b.uid);d.gid=c(e);d.rdev=c(0);d.blksize=c(4096);d.ino=c(b.ino);d.size=c(b.getSize());d.blocks=c(1);d.atime=f;d.mtime=g;d.ctime=h;d.birthtime=
h;d.atimeMs=c(f.getTime());d.mtimeMs=c(g.getTime());e=c(h.getTime());d.ctimeMs=e;d.birthtimeMs=e;d.dev=c(0);d.mode=c(b.mode);d.nlink=c(b.nlink);return d};a.prototype._checkModeProperty=function(a){return(Number(this.mode)&b)===a};a.prototype.isDirectory=function(){return this._checkModeProperty(c)};a.prototype.isFile=function(){return this._checkModeProperty(e)};a.prototype.isBlockDevice=function(){return this._checkModeProperty(f)};a.prototype.isCharacterDevice=function(){return this._checkModeProperty(h)};
a.prototype.isSymbolicLink=function(){return this._checkModeProperty(g)};a.prototype.isFIFO=function(){return this._checkModeProperty(k)};a.prototype.isSocket=function(){return this._checkModeProperty(q)};return a}();a.Stats=d;a.default=d});P(zb);var fb="undefined"!==typeof za?za:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{},oa=[],ia=[],ug="undefined"!==typeof Uint8Array?Uint8Array:Array,Nc=!1,Mh={}.toString,Wd=Array.isArray||function(d){return"[object Array]"==Mh.call(d)};
u.TYPED_ARRAY_SUPPORT=void 0!==fb.TYPED_ARRAY_SUPPORT?fb.TYPED_ARRAY_SUPPORT:!0;var Nh=u.TYPED_ARRAY_SUPPORT?2147483647:1073741823;u.poolSize=8192;u._augment=function(d){d.__proto__=u.prototype;return d};u.from=function(d,a,b){return Td(null,d,a,b)};u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array);u.alloc=function(d,a,b){Vd(d);return d=0>=d?ta(null,d):void 0!==a?"string"===typeof b?ta(null,d).fill(a,b):ta(null,d).fill(a):ta(null,d)};u.allocUnsafe=function(d){return Oc(null,
d)};u.allocUnsafeSlow=function(d){return Oc(null,d)};u.isBuffer=pa;u.compare=function(d,a){if(!ja(d)||!ja(a))throw new TypeError("Arguments must be Buffers");if(d===a)return 0;for(var b=d.length,c=a.length,e=0,f=Math.min(b,c);e<f;++e)if(d[e]!==a[e]){b=d[e];c=a[e];break}return b<c?-1:c<b?1:0};u.isEncoding=function(d){switch(String(d).toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "latin1":case "binary":case "base64":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return!0;
default:return!1}};u.concat=function(d,a){if(!Wd(d))throw new TypeError('"list" argument must be an Array of Buffers');if(0===d.length)return u.alloc(0);var b;if(void 0===a)for(b=a=0;b<d.length;++b)a+=d[b].length;a=u.allocUnsafe(a);var c=0;for(b=0;b<d.length;++b){var e=d[b];if(!ja(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(a,c);c+=e.length}return a};u.byteLength=Ud;u.prototype._isBuffer=!0;u.prototype.swap16=function(){var d=this.length;if(0!==d%2)throw new RangeError("Buffer size must be a multiple of 16-bits");
for(var a=0;a<d;a+=2)db(this,a,a+1);return this};u.prototype.swap32=function(){var d=this.length;if(0!==d%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var a=0;a<d;a+=4)db(this,a,a+3),db(this,a+1,a+2);return this};u.prototype.swap64=function(){var d=this.length;if(0!==d%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var a=0;a<d;a+=8)db(this,a,a+7),db(this,a+1,a+6),db(this,a+2,a+5),db(this,a+3,a+4);return this};u.prototype.toString=function(){var d=
this.length|0;return 0===d?"":0===arguments.length?Yd(this,0,d):sg.apply(this,arguments)};u.prototype.equals=function(d){if(!ja(d))throw new TypeError("Argument must be a Buffer");return this===d?!0:0===u.compare(this,d)};u.prototype.inspect=function(){var d="";0<this.length&&(d=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(d+=" ... "));return"<Buffer "+d+">"};u.prototype.compare=function(d,a,b,c,e){if(!ja(d))throw new TypeError("Argument must be a Buffer");void 0===a&&(a=0);
void 0===b&&(b=d?d.length:0);void 0===c&&(c=0);void 0===e&&(e=this.length);if(0>a||b>d.length||0>c||e>this.length)throw new RangeError("out of range index");if(c>=e&&a>=b)return 0;if(c>=e)return-1;if(a>=b)return 1;a>>>=0;b>>>=0;c>>>=0;e>>>=0;if(this===d)return 0;var f=e-c,h=b-a,g=Math.min(f,h);c=this.slice(c,e);d=d.slice(a,b);for(a=0;a<g;++a)if(c[a]!==d[a]){f=c[a];h=d[a];break}return f<h?-1:h<f?1:0};u.prototype.includes=function(d,a,b){return-1!==this.indexOf(d,a,b)};u.prototype.indexOf=function(d,
a,b){return Zd(this,d,a,b,!0)};u.prototype.lastIndexOf=function(d,a,b){return Zd(this,d,a,b,!1)};u.prototype.write=function(d,a,b,c){if(void 0===a)c="utf8",b=this.length,a=0;else if(void 0===b&&"string"===typeof a)c=a,b=this.length,a=0;else if(isFinite(a))a|=0,isFinite(b)?(b|=0,void 0===c&&(c="utf8")):(c=b,b=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var e=this.length-a;if(void 0===b||b>e)b=e;if(0<d.length&&(0>b||0>a)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");
c||(c="utf8");for(e=!1;;)switch(c){case "hex":a:{a=Number(a)||0;c=this.length-a;b?(b=Number(b),b>c&&(b=c)):b=c;c=d.length;if(0!==c%2)throw new TypeError("Invalid hex string");b>c/2&&(b=c/2);for(c=0;c<b;++c){e=parseInt(d.substr(2*c,2),16);if(isNaN(e)){d=c;break a}this[a+c]=e}d=c}return d;case "utf8":case "utf-8":return Jb(nc(d,this.length-a),this,a,b);case "ascii":return Jb(be(d),this,a,b);case "latin1":case "binary":return Jb(be(d),this,a,b);case "base64":return Jb(Xd(d),this,a,b);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":c=
d;e=this.length-a;for(var f=[],h=0;h<c.length&&!(0>(e-=2));++h){var g=c.charCodeAt(h);d=g>>8;g%=256;f.push(g);f.push(d)}return Jb(f,this,a,b);default:if(e)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase();e=!0}};u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ae=4096;u.prototype.slice=function(d,a){var b=this.length;d=~~d;a=void 0===a?b:~~a;0>d?(d+=b,0>d&&(d=0)):d>b&&(d=b);0>a?(a+=b,0>a&&(a=0)):a>b&&(a=b);a<d&&(a=d);if(u.TYPED_ARRAY_SUPPORT)a=
this.subarray(d,a),a.__proto__=u.prototype;else{b=a-d;a=new u(b,void 0);for(var c=0;c<b;++c)a[c]=this[c+d]}return a};u.prototype.readUIntLE=function(d,a,b){d|=0;a|=0;b||Q(d,a,this.length);b=this[d];for(var c=1,e=0;++e<a&&(c*=256);)b+=this[d+e]*c;return b};u.prototype.readUIntBE=function(d,a,b){d|=0;a|=0;b||Q(d,a,this.length);b=this[d+--a];for(var c=1;0<a&&(c*=256);)b+=this[d+--a]*c;return b};u.prototype.readUInt8=function(d,a){a||Q(d,1,this.length);return this[d]};u.prototype.readUInt16LE=function(d,
a){a||Q(d,2,this.length);return this[d]|this[d+1]<<8};u.prototype.readUInt16BE=function(d,a){a||Q(d,2,this.length);return this[d]<<8|this[d+1]};u.prototype.readUInt32LE=function(d,a){a||Q(d,4,this.length);return(this[d]|this[d+1]<<8|this[d+2]<<16)+16777216*this[d+3]};u.prototype.readUInt32BE=function(d,a){a||Q(d,4,this.length);return 16777216*this[d]+(this[d+1]<<16|this[d+2]<<8|this[d+3])};u.prototype.readIntLE=function(d,a,b){d|=0;a|=0;b||Q(d,a,this.length);b=this[d];for(var c=1,e=0;++e<a&&(c*=256);)b+=
this[d+e]*c;b>=128*c&&(b-=Math.pow(2,8*a));return b};u.prototype.readIntBE=function(d,a,b){d|=0;a|=0;b||Q(d,a,this.length);b=a;for(var c=1,e=this[d+--b];0<b&&(c*=256);)e+=this[d+--b]*c;e>=128*c&&(e-=Math.pow(2,8*a));return e};u.prototype.readInt8=function(d,a){a||Q(d,1,this.length);return this[d]&128?-1*(255-this[d]+1):this[d]};u.prototype.readInt16LE=function(d,a){a||Q(d,2,this.length);d=this[d]|this[d+1]<<8;return d&32768?d|4294901760:d};u.prototype.readInt16BE=function(d,a){a||Q(d,2,this.length);
d=this[d+1]|this[d]<<8;return d&32768?d|4294901760:d};u.prototype.readInt32LE=function(d,a){a||Q(d,4,this.length);return this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24};u.prototype.readInt32BE=function(d,a){a||Q(d,4,this.length);return this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]};u.prototype.readFloatLE=function(d,a){a||Q(d,4,this.length);return Wb(this,d,!0,23,4)};u.prototype.readFloatBE=function(d,a){a||Q(d,4,this.length);return Wb(this,d,!1,23,4)};u.prototype.readDoubleLE=function(d,a){a||
Q(d,8,this.length);return Wb(this,d,!0,52,8)};u.prototype.readDoubleBE=function(d,a){a||Q(d,8,this.length);return Wb(this,d,!1,52,8)};u.prototype.writeUIntLE=function(d,a,b,c){d=+d;a|=0;b|=0;c||V(this,d,a,b,Math.pow(2,8*b)-1,0);c=1;var e=0;for(this[a]=d&255;++e<b&&(c*=256);)this[a+e]=d/c&255;return a+b};u.prototype.writeUIntBE=function(d,a,b,c){d=+d;a|=0;b|=0;c||V(this,d,a,b,Math.pow(2,8*b)-1,0);c=b-1;var e=1;for(this[a+c]=d&255;0<=--c&&(e*=256);)this[a+c]=d/e&255;return a+b};u.prototype.writeUInt8=
function(d,a,b){d=+d;a|=0;b||V(this,d,a,1,255,0);u.TYPED_ARRAY_SUPPORT||(d=Math.floor(d));this[a]=d&255;return a+1};u.prototype.writeUInt16LE=function(d,a,b){d=+d;a|=0;b||V(this,d,a,2,65535,0);u.TYPED_ARRAY_SUPPORT?(this[a]=d&255,this[a+1]=d>>>8):oc(this,d,a,!0);return a+2};u.prototype.writeUInt16BE=function(d,a,b){d=+d;a|=0;b||V(this,d,a,2,65535,0);u.TYPED_ARRAY_SUPPORT?(this[a]=d>>>8,this[a+1]=d&255):oc(this,d,a,!1);return a+2};u.prototype.writeUInt32LE=function(d,a,b){d=+d;a|=0;b||V(this,d,a,4,
4294967295,0);u.TYPED_ARRAY_SUPPORT?(this[a+3]=d>>>24,this[a+2]=d>>>16,this[a+1]=d>>>8,this[a]=d&255):pc(this,d,a,!0);return a+4};u.prototype.writeUInt32BE=function(d,a,b){d=+d;a|=0;b||V(this,d,a,4,4294967295,0);u.TYPED_ARRAY_SUPPORT?(this[a]=d>>>24,this[a+1]=d>>>16,this[a+2]=d>>>8,this[a+3]=d&255):pc(this,d,a,!1);return a+4};u.prototype.writeIntLE=function(d,a,b,c){d=+d;a|=0;c||(c=Math.pow(2,8*b-1),V(this,d,a,b,c-1,-c));c=0;var e=1,f=0;for(this[a]=d&255;++c<b&&(e*=256);)0>d&&0===f&&0!==this[a+c-
1]&&(f=1),this[a+c]=(d/e>>0)-f&255;return a+b};u.prototype.writeIntBE=function(d,a,b,c){d=+d;a|=0;c||(c=Math.pow(2,8*b-1),V(this,d,a,b,c-1,-c));c=b-1;var e=1,f=0;for(this[a+c]=d&255;0<=--c&&(e*=256);)0>d&&0===f&&0!==this[a+c+1]&&(f=1),this[a+c]=(d/e>>0)-f&255;return a+b};u.prototype.writeInt8=function(d,a,b){d=+d;a|=0;b||V(this,d,a,1,127,-128);u.TYPED_ARRAY_SUPPORT||(d=Math.floor(d));0>d&&(d=255+d+1);this[a]=d&255;return a+1};u.prototype.writeInt16LE=function(d,a,b){d=+d;a|=0;b||V(this,d,a,2,32767,
-32768);u.TYPED_ARRAY_SUPPORT?(this[a]=d&255,this[a+1]=d>>>8):oc(this,d,a,!0);return a+2};u.prototype.writeInt16BE=function(d,a,b){d=+d;a|=0;b||V(this,d,a,2,32767,-32768);u.TYPED_ARRAY_SUPPORT?(this[a]=d>>>8,this[a+1]=d&255):oc(this,d,a,!1);return a+2};u.prototype.writeInt32LE=function(d,a,b){d=+d;a|=0;b||V(this,d,a,4,2147483647,-2147483648);u.TYPED_ARRAY_SUPPORT?(this[a]=d&255,this[a+1]=d>>>8,this[a+2]=d>>>16,this[a+3]=d>>>24):pc(this,d,a,!0);return a+4};u.prototype.writeInt32BE=function(d,a,b){d=
+d;a|=0;b||V(this,d,a,4,2147483647,-2147483648);0>d&&(d=4294967295+d+1);u.TYPED_ARRAY_SUPPORT?(this[a]=d>>>24,this[a+1]=d>>>16,this[a+2]=d>>>8,this[a+3]=d&255):pc(this,d,a,!1);return a+4};u.prototype.writeFloatLE=function(d,a,b){b||Xb(this,d,a,4);mc(this,d,a,!0,23,4);return a+4};u.prototype.writeFloatBE=function(d,a,b){b||Xb(this,d,a,4);mc(this,d,a,!1,23,4);return a+4};u.prototype.writeDoubleLE=function(d,a,b){b||Xb(this,d,a,8);mc(this,d,a,!0,52,8);return a+8};u.prototype.writeDoubleBE=function(d,
a,b){b||Xb(this,d,a,8);mc(this,d,a,!1,52,8);return a+8};u.prototype.copy=function(d,a,b,c){b||(b=0);c||0===c||(c=this.length);a>=d.length&&(a=d.length);a||(a=0);0<c&&c<b&&(c=b);if(c===b||0===d.length||0===this.length)return 0;if(0>a)throw new RangeError("targetStart out of bounds");if(0>b||b>=this.length)throw new RangeError("sourceStart out of bounds");if(0>c)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length);d.length-a<c-b&&(c=d.length-a+b);var e=c-b;if(this===d&&b<a&&
a<c)for(c=e-1;0<=c;--c)d[c+a]=this[c+b];else if(1E3>e||!u.TYPED_ARRAY_SUPPORT)for(c=0;c<e;++c)d[c+a]=this[c+b];else Uint8Array.prototype.set.call(d,this.subarray(b,b+e),a);return e};u.prototype.fill=function(d,a,b,c){if("string"===typeof d){"string"===typeof a?(c=a,a=0,b=this.length):"string"===typeof b&&(c=b,b=this.length);if(1===d.length){var e=d.charCodeAt(0);256>e&&(d=e)}if(void 0!==c&&"string"!==typeof c)throw new TypeError("encoding must be a string");if("string"===typeof c&&!u.isEncoding(c))throw new TypeError("Unknown encoding: "+
c);}else"number"===typeof d&&(d&=255);if(0>a||this.length<a||this.length<b)throw new RangeError("Out of range index");if(b<=a)return this;a>>>=0;b=void 0===b?this.length:b>>>0;d||(d=0);if("number"===typeof d)for(c=a;c<b;++c)this[c]=d;else for(d=ja(d)?d:nc((new u(d,c)).toString()),e=d.length,c=0;c<b-a;++c)this[c+a]=d[c%e];return this};var tg=/[^+\/0-9A-Za-z-_]/g,Rb=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:Nh,Buffer:u,SlowBuffer:function(d){+d!=d&&(d=0);return u.alloc(+d)},isBuffer:pa}),
U=ba(function(d,a){function b(a){for(var b=[],d=1;d<arguments.length;d++)b[d-1]=arguments[d];return new (Rb.Buffer.bind.apply(Rb.Buffer,c([void 0,a],b)))}var c=S&&S.__spreadArrays||function(){for(var a=0,b=0,c=arguments.length;b<c;b++)a+=arguments[b].length;a=Array(a);var d=0;for(b=0;b<c;b++)for(var k=arguments[b],q=0,t=k.length;q<t;q++,d++)a[d]=k[q];return a};Object.defineProperty(a,"__esModule",{value:!0});a.Buffer=Rb.Buffer;a.bufferAllocUnsafe=Rb.Buffer.allocUnsafe||b;a.bufferFrom=Rb.Buffer.from||
b});P(U);var Na=de,Ca=ee;"function"===typeof fb.setTimeout&&(Na=setTimeout);"function"===typeof fb.clearTimeout&&(Ca=clearTimeout);var ua=[],rb=!1,sb,qc=-1;he.prototype.run=function(){this.fun.apply(null,this.array)};var Ab=fb.performance||{},Oh=Ab.now||Ab.mozNow||Ab.msNow||Ab.oNow||Ab.webkitNow||function(){return(new Date).getTime()},Ph=new Date,gb={nextTick:ea,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:tb,addListener:tb,once:tb,off:tb,removeListener:tb,removeAllListeners:tb,
emit:tb,binding:function(){throw Error("process.binding is not supported");},cwd:function(){return"/"},chdir:function(){throw Error("process.chdir is not supported");},umask:function(){return 0},hrtime:function(d){var a=.001*Oh.call(Ab),b=Math.floor(a);a=Math.floor(a%1*1E9);d&&(b-=d[0],a-=d[1],0>a&&(b--,a+=1E9));return[b,a]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Ph)/1E3}},Xa="function"===typeof Object.create?function(d,a){d.super_=a;d.prototype=Object.create(a.prototype,
{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}})}:function(d,a){function b(){}d.super_=a;b.prototype=a.prototype;d.prototype=new b;d.prototype.constructor=d},xg=/%[sdj%]/g,Yb={},Tc;qa.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};qa.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",
regexp:"red"};var Fg="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),jc={inherits:Xa,_extend:je,log:function(){console.log("%s - %s",Eg(),Rc.apply(null,arguments))},isBuffer:function(d){return pa(d)},isPrimitive:Xc,isFunction:hb,isError:Kb,isDate:Lb,isObject:Oa,isRegExp:ub,isUndefined:va,isSymbol:function(d){return"symbol"===typeof d},isString:eb,isNumber:le,isNullOrUndefined:function(d){return null==d},isNull:function(d){return null===d},isBoolean:Uc,isArray:ke,inspect:qa,deprecate:Sc,
format:Rc,debuglog:ie},Qh=Object.prototype.hasOwnProperty,xe=Object.keys||function(d){var a=[],b;for(b in d)Qh.call(d,b)&&a.push(b);return a},we=Array.prototype.slice,Zc,Gg=/\s*function\s+([^\(\s]*)\s*/;L.AssertionError=ad;Xa(ad,Error);L.fail=aa;L.ok=$c;L.equal=se;L.notEqual=te;L.deepEqual=ue;L.deepStrictEqual=ve;L.notDeepEqual=ye;L.notDeepStrictEqual=ze;L.strictEqual=Ae;L.notStrictEqual=Be;L.throws=function(d,a,b){De(!0,d,a,b)};L.doesNotThrow=function(d,a,b){De(!1,d,a,b)};L.ifError=function(d){if(d)throw d;
};var kc=ba(function(d,a){function b(a){return function(a){function b(b){for(var d=[],e=1;e<arguments.length;e++)d[e-1]=arguments[e];d=a.call(this,c(b,d))||this;d.code=b;d[g]=b;d.name=a.prototype.name+" ["+d[g]+"]";return d}h(b,a);return b}(a)}function c(a,b){L.strictEqual(typeof a,"string");var c=k[a];L(c,"An invalid error message key was used: "+a+".");if("function"===typeof c)a=c;else{a=jc.format;if(void 0===b||0===b.length)return c;b.unshift(c)}return String(a.apply(null,b))}function e(a,b){k[a]=
"function"===typeof b?b:String(b)}function f(a,b){L(a,"expected is required");L("string"===typeof b,"thing is required");if(Array.isArray(a)){var c=a.length;L(0<c,"At least one expected value needs to be specified");a=a.map(function(a){return String(a)});return 2<c?"one of "+b+" "+a.slice(0,c-1).join(", ")+", or "+a[c-1]:2===c?"one of "+b+" "+a[0]+" or "+a[1]:"of "+b+" "+a[0]}return"of "+b+" "+String(a)}var h=S&&S.__extends||function(){function a(b,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof
Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return a(b,c)}return function(b,c){function d(){this.constructor=b}a(b,c);b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();Object.defineProperty(a,"__esModule",{value:!0});var g="undefined"===typeof Symbol?"_kCode":Symbol("code"),k={};d=function(b){function c(c){if("object"!==typeof c||null===c)throw new a.TypeError("ERR_INVALID_ARG_TYPE","options","object");var d=c.message?
b.call(this,c.message)||this:b.call(this,jc.inspect(c.actual).slice(0,128)+" "+(c.operator+" "+jc.inspect(c.expected).slice(0,128)))||this;d.generatedMessage=!c.message;d.name="AssertionError [ERR_ASSERTION]";d.code="ERR_ASSERTION";d.actual=c.actual;d.expected=c.expected;d.operator=c.operator;a.Error.captureStackTrace(d,c.stackStartFunction);return d}h(c,b);return c}(S.Error);a.AssertionError=d;a.message=c;a.E=e;a.Error=b(S.Error);a.TypeError=b(S.TypeError);a.RangeError=b(S.RangeError);e("ERR_ARG_NOT_ITERABLE",
"%s must be iterable");e("ERR_ASSERTION","%s");e("ERR_BUFFER_OUT_OF_BOUNDS",function(a,b){return b?"Attempt to write outside buffer bounds":'"'+a+'" is outside of buffer bounds'});e("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received");e("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s");e("ERR_CPU_USAGE","Unable to obtain cpu usage %s");e("ERR_DNS_SET_SERVERS_FAILED",function(a,b){return'c-ares failed to set servers: "'+a+'" ['+b+"]"});e("ERR_FALSY_VALUE_REJECTION",
"Promise was rejected with falsy value");e("ERR_ENCODING_NOT_SUPPORTED",function(a){return'The "'+a+'" encoding is not supported'});e("ERR_ENCODING_INVALID_ENCODED_DATA",function(a){return"The encoded data was not valid for encoding "+a});e("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client");e("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s");e("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding");e("ERR_INDEX_OUT_OF_RANGE","Index out of range");
e("ERR_INVALID_ARG_TYPE",function(a,b,c){L(a,"name is required");if(b.includes("not ")){var d="must not be";b=b.split("not ")[1]}else d="must be";if(Array.isArray(a))d="The "+a.map(function(a){return'"'+a+'"'}).join(", ")+" arguments "+d+" "+f(b,"type");else if(a.includes(" argument"))d="The "+a+" "+d+" "+f(b,"type");else{var e=a.includes(".")?"property":"argument";d='The "'+a+'" '+e+" "+d+" "+f(b,"type")}3<=arguments.length&&(d+=". Received type "+(null!==c?typeof c:"null"));return d});e("ERR_INVALID_ARRAY_LENGTH",
function(a,b,c){L.strictEqual(typeof c,"number");return'The array "'+a+'" (length '+c+") must be of length "+b+"."});e("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s");e("ERR_INVALID_CALLBACK","Callback must be a function");e("ERR_INVALID_CHAR","Invalid character in %s");e("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column");e("ERR_INVALID_FD",'"fd" must be a positive integer: %s');e("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s');
e("ERR_INVALID_FILE_URL_PATH","File URL path %s");e("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent");e("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s");e("ERR_INVALID_OPT_VALUE",function(a,b){return'The value "'+String(b)+'" is invalid for option "'+a+'"'});e("ERR_INVALID_OPT_VALUE_ENCODING",function(a){return'The value "'+String(a)+'" is invalid for option "encoding"'});e("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL');e("ERR_INVALID_SYNC_FORK_INPUT",
"Asynchronous forks do not support Buffer, Uint8Array or string input: %s");e("ERR_INVALID_THIS",'Value of "this" must be of type %s');e("ERR_INVALID_TUPLE","%s must be an iterable %s tuple");e("ERR_INVALID_URL","Invalid URL: %s");e("ERR_INVALID_URL_SCHEME",function(a){return"The URL must be "+f(a,"scheme")});e("ERR_IPC_CHANNEL_CLOSED","Channel closed");e("ERR_IPC_DISCONNECTED","IPC channel is already disconnected");e("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe");e("ERR_IPC_SYNC_FORK",
"IPC cannot be used with synchronous forks");e("ERR_MISSING_ARGS",function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];L(0<a.length,"At least one arg needs to be specified");b="The ";var c=a.length;a=a.map(function(a){return'"'+a+'"'});switch(c){case 1:b+=a[0]+" argument";break;case 2:b+=a[0]+" and "+a[1]+" arguments";break;default:b+=a.slice(0,c-1).join(", "),b+=", and "+a[c-1]+" arguments"}return b+" must be specified"});e("ERR_MULTIPLE_CALLBACK","Callback called multiple times");
e("ERR_NAPI_CONS_FUNCTION","Constructor must be a function");e("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object");e("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support");e("ERR_NO_LONGER_SUPPORTED","%s is no longer supported");e("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s");e("ERR_SOCKET_ALREADY_BOUND","Socket is already bound");e("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536");e("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6");
e("ERR_SOCKET_CANNOT_SEND","Unable to send data");e("ERR_SOCKET_CLOSED","Socket is closed");e("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running");e("ERR_STDERR_CLOSE","process.stderr cannot be closed");e("ERR_STDOUT_CLOSE","process.stdout cannot be closed");e("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode");e("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s");e("ERR_TLS_DH_PARAM_SIZE",function(a){return"DH parameter size "+a+" is less than 2048"});
e("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout");e("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate");e("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext');e("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected");e("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming");e("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0");e("ERR_UNKNOWN_ENCODING","Unknown encoding: %s");
e("ERR_UNKNOWN_SIGNAL","Unknown signal: %s");e("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type");e("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type");e("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl")});P(kc);var da=ba(function(d,a){Object.defineProperty(a,"__esModule",{value:!0});a.ENCODING_UTF8="utf8";a.assertEncoding=function(a){if(a&&!U.Buffer.isEncoding(a))throw new kc.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",a);};a.strToEncoding=function(b,
c){return c&&c!==a.ENCODING_UTF8?"buffer"===c?new U.Buffer(b):(new U.Buffer(b)).toString(c):b}});P(da);var yd=ba(function(d,a){Object.defineProperty(a,"__esModule",{value:!0});var b=I.constants.S_IFMT,c=I.constants.S_IFDIR,e=I.constants.S_IFREG,f=I.constants.S_IFBLK,h=I.constants.S_IFCHR,g=I.constants.S_IFLNK,k=I.constants.S_IFIFO,q=I.constants.S_IFSOCK;d=function(){function a(){this.name="";this.mode=0}a.build=function(b,c){var d=new a,e=b.getNode().mode;d.name=da.strToEncoding(b.getName(),c);d.mode=
e;return d};a.prototype._checkModeProperty=function(a){return(this.mode&b)===a};a.prototype.isDirectory=function(){return this._checkModeProperty(c)};a.prototype.isFile=function(){return this._checkModeProperty(e)};a.prototype.isBlockDevice=function(){return this._checkModeProperty(f)};a.prototype.isCharacterDevice=function(){return this._checkModeProperty(h)};a.prototype.isSymbolicLink=function(){return this._checkModeProperty(g)};a.prototype.isFIFO=function(){return this._checkModeProperty(k)};
a.prototype.isSocket=function(){return this._checkModeProperty(q)};return a}();a.Dirent=d;a.default=d});P(yd);"ab".substr(-1);var Ya=ba(function(d,a){Object.defineProperty(a,"__esModule",{value:!0});d="function"===typeof setImmediate?setImmediate.bind(S):setTimeout.bind(S);a.default=d});P(Ya);var na=ba(function(d,a){function b(){var a=gb||{};a.getuid||(a.getuid=function(){return 0});a.getgid||(a.getgid=function(){return 0});a.cwd||(a.cwd=function(){return"/"});a.nextTick||(a.nextTick=Ya.default);
a.emitWarning||(a.emitWarning=function(a,b){console.warn(""+b+(b?": ":"")+a)});a.env||(a.env={});return a}Object.defineProperty(a,"__esModule",{value:!0});a.createProcess=b;a.default=b()});P(na);ib.prototype=Object.create(null);J.EventEmitter=J;J.usingDomains=!1;J.prototype.domain=void 0;J.prototype._events=void 0;J.prototype._maxListeners=void 0;J.defaultMaxListeners=10;J.init=function(){this.domain=null;this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new ib,this._eventsCount=
0);this._maxListeners=this._maxListeners||void 0};J.prototype.setMaxListeners=function(d){if("number"!==typeof d||0>d||isNaN(d))throw new TypeError('"n" argument must be a positive number');this._maxListeners=d;return this};J.prototype.getMaxListeners=function(){return void 0===this._maxListeners?J.defaultMaxListeners:this._maxListeners};J.prototype.emit=function(d){var a,b,c="error"===d;if(a=this._events)c=c&&null==a.error;else if(!c)return!1;var e=this.domain;if(c){a=arguments[1];if(e)a||(a=Error('Uncaught, unspecified "error" event')),
a.domainEmitter=this,a.domain=e,a.domainThrown=!1,e.emit("error",a);else{if(a instanceof Error)throw a;e=Error('Uncaught, unspecified "error" event. ('+a+")");e.context=a;throw e;}return!1}e=a[d];if(!e)return!1;a="function"===typeof e;var f=arguments.length;switch(f){case 1:if(a)e.call(this);else for(a=e.length,e=Mb(e,a),c=0;c<a;++c)e[c].call(this);break;case 2:c=arguments[1];if(a)e.call(this,c);else for(a=e.length,e=Mb(e,a),f=0;f<a;++f)e[f].call(this,c);break;case 3:c=arguments[1];f=arguments[2];
if(a)e.call(this,c,f);else for(a=e.length,e=Mb(e,a),b=0;b<a;++b)e[b].call(this,c,f);break;case 4:c=arguments[1];f=arguments[2];b=arguments[3];if(a)e.call(this,c,f,b);else{a=e.length;e=Mb(e,a);for(var h=0;h<a;++h)e[h].call(this,c,f,b)}break;default:c=Array(f-1);for(b=1;b<f;b++)c[b-1]=arguments[b];if(a)e.apply(this,c);else for(a=e.length,e=Mb(e,a),f=0;f<a;++f)e[f].apply(this,c)}return!0};J.prototype.addListener=function(d,a){return Ee(this,d,a,!1)};J.prototype.on=J.prototype.addListener;J.prototype.prependListener=
function(d,a){return Ee(this,d,a,!0)};J.prototype.once=function(d,a){if("function"!==typeof a)throw new TypeError('"listener" argument must be a function');this.on(d,Fe(this,d,a));return this};J.prototype.prependOnceListener=function(d,a){if("function"!==typeof a)throw new TypeError('"listener" argument must be a function');this.prependListener(d,Fe(this,d,a));return this};J.prototype.removeListener=function(d,a){var b;if("function"!==typeof a)throw new TypeError('"listener" argument must be a function');
var c=this._events;if(!c)return this;var e=c[d];if(!e)return this;if(e===a||e.listener&&e.listener===a)0===--this._eventsCount?this._events=new ib:(delete c[d],c.removeListener&&this.emit("removeListener",d,e.listener||a));else if("function"!==typeof e){var f=-1;for(b=e.length;0<b--;)if(e[b]===a||e[b].listener&&e[b].listener===a){var h=e[b].listener;f=b;break}if(0>f)return this;if(1===e.length){e[0]=void 0;if(0===--this._eventsCount)return this._events=new ib,this;delete c[d]}else{b=f+1;for(var g=
e.length;b<g;f+=1,b+=1)e[f]=e[b];e.pop()}c.removeListener&&this.emit("removeListener",d,h||a)}return this};J.prototype.removeAllListeners=function(d){var a=this._events;if(!a)return this;if(!a.removeListener)return 0===arguments.length?(this._events=new ib,this._eventsCount=0):a[d]&&(0===--this._eventsCount?this._events=new ib:delete a[d]),this;if(0===arguments.length){a=Object.keys(a);for(var b=0,c;b<a.length;++b)c=a[b],"removeListener"!==c&&this.removeAllListeners(c);this.removeAllListeners("removeListener");
this._events=new ib;this._eventsCount=0;return this}a=a[d];if("function"===typeof a)this.removeListener(d,a);else if(a){do this.removeListener(d,a[a.length-1]);while(a[0])}return this};J.prototype.listeners=function(d){var a=this._events;if(a)if(d=a[d])if("function"===typeof d)d=[d.listener||d];else{a=Array(d.length);for(var b=0;b<a.length;++b)a[b]=d[b].listener||d[b];d=a}else d=[];else d=[];return d};J.listenerCount=function(d,a){return"function"===typeof d.listenerCount?d.listenerCount(a):Ge.call(d,
a)};J.prototype.listenerCount=Ge;J.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]};var nb=ba(function(d,a){var b=S&&S.__extends||function(){function a(b,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return a(b,c)}return function(b,c){function d(){this.constructor=b}a(b,c);b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();Object.defineProperty(a,
"__esModule",{value:!0});var c=I.constants.S_IFMT,e=I.constants.S_IFDIR,f=I.constants.S_IFREG,h=I.constants.S_IFLNK,g=I.constants.O_APPEND;a.SEP="/";d=function(a){function d(b,c){void 0===c&&(c=438);var d=a.call(this)||this;d.uid=na.default.getuid();d.gid=na.default.getgid();d.atime=new Date;d.mtime=new Date;d.ctime=new Date;d.perm=438;d.mode=f;d.nlink=1;d.perm=c;d.mode|=c;d.ino=b;return d}b(d,a);d.prototype.getString=function(a){void 0===a&&(a="utf8");return this.getBuffer().toString(a)};d.prototype.setString=
function(a){this.buf=U.bufferFrom(a,"utf8");this.touch()};d.prototype.getBuffer=function(){this.buf||this.setBuffer(U.bufferAllocUnsafe(0));return U.bufferFrom(this.buf)};d.prototype.setBuffer=function(a){this.buf=U.bufferFrom(a);this.touch()};d.prototype.getSize=function(){return this.buf?this.buf.length:0};d.prototype.setModeProperty=function(a){this.mode=this.mode&~c|a};d.prototype.setIsFile=function(){this.setModeProperty(f)};d.prototype.setIsDirectory=function(){this.setModeProperty(e)};d.prototype.setIsSymlink=
function(){this.setModeProperty(h)};d.prototype.isFile=function(){return(this.mode&c)===f};d.prototype.isDirectory=function(){return(this.mode&c)===e};d.prototype.isSymlink=function(){return(this.mode&c)===h};d.prototype.makeSymlink=function(a){this.symlink=a;this.setIsSymlink()};d.prototype.write=function(a,b,c,d){void 0===b&&(b=0);void 0===c&&(c=a.length);void 0===d&&(d=0);this.buf||(this.buf=U.bufferAllocUnsafe(0));if(d+c>this.buf.length){var e=U.bufferAllocUnsafe(d+c);this.buf.copy(e,0,0,this.buf.length);
this.buf=e}a.copy(this.buf,d,b,b+c);this.touch();return c};d.prototype.read=function(a,b,c,d){void 0===b&&(b=0);void 0===c&&(c=a.byteLength);void 0===d&&(d=0);this.buf||(this.buf=U.bufferAllocUnsafe(0));c>a.byteLength&&(c=a.byteLength);c+d>this.buf.length&&(c=this.buf.length-d);this.buf.copy(a,b,d,d+c);return c};d.prototype.truncate=function(a){void 0===a&&(a=0);if(a)if(this.buf||(this.buf=U.bufferAllocUnsafe(0)),a<=this.buf.length)this.buf=this.buf.slice(0,a);else{var b=U.bufferAllocUnsafe(0);this.buf.copy(b);
b.fill(0,a)}else this.buf=U.bufferAllocUnsafe(0);this.touch()};d.prototype.chmod=function(a){this.perm=a;this.mode=this.mode&-512|a;this.touch()};d.prototype.chown=function(a,b){this.uid=a;this.gid=b;this.touch()};d.prototype.touch=function(){this.mtime=new Date;this.emit("change",this)};d.prototype.canRead=function(a,b){void 0===a&&(a=na.default.getuid());void 0===b&&(b=na.default.getgid());return this.perm&4||b===this.gid&&this.perm&32||a===this.uid&&this.perm&256?!0:!1};d.prototype.canWrite=function(a,
b){void 0===a&&(a=na.default.getuid());void 0===b&&(b=na.default.getgid());return this.perm&2||b===this.gid&&this.perm&16||a===this.uid&&this.perm&128?!0:!1};d.prototype.del=function(){this.emit("delete",this)};d.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}};return d}(J.EventEmitter);a.Node=d;d=function(c){function d(a,
b,d){var e=c.call(this)||this;e.children={};e.steps=[];e.ino=0;e.length=0;e.vol=a;e.parent=b;e.steps=b?b.steps.concat([d]):[d];return e}b(d,c);d.prototype.setNode=function(a){this.node=a;this.ino=a.ino};d.prototype.getNode=function(){return this.node};d.prototype.createChild=function(a,b){void 0===b&&(b=this.vol.createNode());var c=new d(this.vol,this,a);c.setNode(b);b.isDirectory();this.setChild(a,c);return c};d.prototype.setChild=function(a,b){void 0===b&&(b=new d(this.vol,this,a));this.children[a]=
b;b.parent=this;this.length++;this.emit("child:add",b,this);return b};d.prototype.deleteChild=function(a){delete this.children[a.getName()];this.length--;this.emit("child:delete",a,this)};d.prototype.getChild=function(a){if(Object.hasOwnProperty.call(this.children,a))return this.children[a]};d.prototype.getPath=function(){return this.steps.join(a.SEP)};d.prototype.getName=function(){return this.steps[this.steps.length-1]};d.prototype.walk=function(a,b,c){void 0===b&&(b=a.length);void 0===c&&(c=0);
if(c>=a.length||c>=b)return this;var d=this.getChild(a[c]);return d?d.walk(a,b,c+1):null};d.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}};return d}(J.EventEmitter);a.Link=d;d=function(){function a(a,b,c,d){this.position=0;this.link=a;this.node=b;this.flags=c;this.fd=d}a.prototype.getString=function(){return this.node.getString()};a.prototype.setString=function(a){this.node.setString(a)};a.prototype.getBuffer=function(){return this.node.getBuffer()};
a.prototype.setBuffer=function(a){this.node.setBuffer(a)};a.prototype.getSize=function(){return this.node.getSize()};a.prototype.truncate=function(a){this.node.truncate(a)};a.prototype.seekTo=function(a){this.position=a};a.prototype.stats=function(){return zb.default.build(this.node)};a.prototype.write=function(a,b,c,d){void 0===b&&(b=0);void 0===c&&(c=a.length);"number"!==typeof d&&(d=this.position);this.flags&g&&(d=this.getSize());a=this.node.write(a,b,c,d);this.position=d+a;return a};a.prototype.read=
function(a,b,c,d){void 0===b&&(b=0);void 0===c&&(c=a.byteLength);"number"!==typeof d&&(d=this.position);a=this.node.read(a,b,c,d);this.position=d+a;return a};a.prototype.chmod=function(a){this.node.chmod(a)};a.prototype.chown=function(a,b){this.node.chown(a,b)};return a}();a.File=d});P(nb);var Rh=nb.Node,Pf=ba(function(d,a){Object.defineProperty(a,"__esModule",{value:!0});a.default=function(a,c,d){var b=setTimeout.apply(null,arguments);b&&"object"===typeof b&&"function"===typeof b.unref&&b.unref();
return b}});P(Pf);Pa.prototype.push=function(d){d={data:d,next:null};0<this.length?this.tail.next=d:this.head=d;this.tail=d;++this.length};Pa.prototype.unshift=function(d){d={data:d,next:this.head};0===this.length&&(this.tail=d);this.head=d;++this.length};Pa.prototype.shift=function(){if(0!==this.length){var d=this.head.data;this.head=1===this.length?this.tail=null:this.head.next;--this.length;return d}};Pa.prototype.clear=function(){this.head=this.tail=null;this.length=0};Pa.prototype.join=function(d){if(0===
this.length)return"";for(var a=this.head,b=""+a.data;a=a.next;)b+=d+a.data;return b};Pa.prototype.concat=function(d){if(0===this.length)return u.alloc(0);if(1===this.length)return this.head.data;d=u.allocUnsafe(d>>>0);for(var a=this.head,b=0;a;)a.data.copy(d,b),b+=a.data.length,a=a.next;return d};var Kg=u.isEncoding||function(d){switch(d&&d.toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "binary":case "base64":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":case "raw":return!0;
default:return!1}};$b.prototype.write=function(d){for(var a="";this.charLength;){a=d.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:d.length;d.copy(this.charBuffer,this.charReceived,0,a);this.charReceived+=a;if(this.charReceived<this.charLength)return"";d=d.slice(a,d.length);a=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var b=a.charCodeAt(a.length-1);if(55296<=b&&56319>=b)this.charLength+=this.surrogateSize,a="";else{this.charReceived=this.charLength=
0;if(0===d.length)return a;break}}this.detectIncompleteChar(d);var c=d.length;this.charLength&&(d.copy(this.charBuffer,0,d.length-this.charReceived,c),c-=this.charReceived);a+=d.toString(this.encoding,0,c);c=a.length-1;b=a.charCodeAt(c);return 55296<=b&&56319>=b?(b=this.surrogateSize,this.charLength+=b,this.charReceived+=b,this.charBuffer.copy(this.charBuffer,b,0,b),d.copy(this.charBuffer,0,0,b),a.substring(0,c)):a};$b.prototype.detectIncompleteChar=function(d){for(var a=3<=d.length?3:d.length;0<
a;a--){var b=d[d.length-a];if(1==a&&6==b>>5){this.charLength=2;break}if(2>=a&&14==b>>4){this.charLength=3;break}if(3>=a&&30==b>>3){this.charLength=4;break}}this.charReceived=a};$b.prototype.end=function(d){var a="";d&&d.length&&(a=this.write(d));this.charReceived&&(d=this.encoding,a+=this.charBuffer.slice(0,this.charReceived).toString(d));return a};R.ReadableState=He;var G=ie("stream");Xa(R,J);R.prototype.push=function(d,a){var b=this._readableState;b.objectMode||"string"!==typeof d||(a=a||b.defaultEncoding,
a!==b.encoding&&(d=u.from(d,a),a=""));return Ie(this,b,d,a,!1)};R.prototype.unshift=function(d){return Ie(this,this._readableState,d,"",!0)};R.prototype.isPaused=function(){return!1===this._readableState.flowing};R.prototype.setEncoding=function(d){this._readableState.decoder=new $b(d);this._readableState.encoding=d;return this};R.prototype.read=function(d){G("read",d);d=parseInt(d,10);var a=this._readableState,b=d;0!==d&&(a.emittedReadable=!1);if(0===d&&a.needReadable&&(a.length>=a.highWaterMark||
a.ended))return G("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?dd(this):sc(this),null;d=Je(d,a);if(0===d&&a.ended)return 0===a.length&&dd(this),null;var c=a.needReadable;G("need readable",c);if(0===a.length||a.length-d<a.highWaterMark)c=!0,G("length less than watermark",c);a.ended||a.reading?G("reading or ended",!1):c&&(G("do read"),a.reading=!0,a.sync=!0,0===a.length&&(a.needReadable=!0),this._read(a.highWaterMark),a.sync=!1,a.reading||(d=Je(b,a)));c=0<d?Le(d,a):null;null===c?(a.needReadable=
!0,d=0):a.length-=d;0===a.length&&(a.ended||(a.needReadable=!0),b!==d&&a.ended&&dd(this));null!==c&&this.emit("data",c);return c};R.prototype._read=function(){this.emit("error",Error("not implemented"))};R.prototype.pipe=function(d,a){function b(a){G("onunpipe");a===t&&e()}function c(){G("onend");d.end()}function e(){G("cleanup");d.removeListener("close",g);d.removeListener("finish",k);d.removeListener("drain",v);d.removeListener("error",h);d.removeListener("unpipe",b);t.removeListener("end",c);t.removeListener("end",
e);t.removeListener("data",f);n=!0;!p.awaitDrain||d._writableState&&!d._writableState.needDrain||v()}function f(a){G("ondata");r=!1;!1!==d.write(a)||r||((1===p.pipesCount&&p.pipes===d||1<p.pipesCount&&-1!==Me(p.pipes,d))&&!n&&(G("false write response, pause",t._readableState.awaitDrain),t._readableState.awaitDrain++,r=!0),t.pause())}function h(a){G("onerror",a);q();d.removeListener("error",h);0===d.listeners("error").length&&d.emit("error",a)}function g(){d.removeListener("finish",k);q()}function k(){G("onfinish");
d.removeListener("close",g);q()}function q(){G("unpipe");t.unpipe(d)}var t=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=d;break;case 1:p.pipes=[p.pipes,d];break;default:p.pipes.push(d)}p.pipesCount+=1;G("pipe count=%d opts=%j",p.pipesCount,a);a=a&&!1===a.end?e:c;if(p.endEmitted)ea(a);else t.once("end",a);d.on("unpipe",b);var v=Qg(t);d.on("drain",v);var n=!1,r=!1;t.on("data",f);Og(d,"error",h);d.once("close",g);d.once("finish",k);d.emit("pipe",t);p.flowing||(G("pipe resume"),t.resume());
return d};R.prototype.unpipe=function(d){var a=this._readableState;if(0===a.pipesCount)return this;if(1===a.pipesCount){if(d&&d!==a.pipes)return this;d||(d=a.pipes);a.pipes=null;a.pipesCount=0;a.flowing=!1;d&&d.emit("unpipe",this);return this}if(!d){d=a.pipes;var b=a.pipesCount;a.pipes=null;a.pipesCount=0;a.flowing=!1;for(a=0;a<b;a++)d[a].emit("unpipe",this);return this}b=Me(a.pipes,d);if(-1===b)return this;a.pipes.splice(b,1);--a.pipesCount;1===a.pipesCount&&(a.pipes=a.pipes[0]);d.emit("unpipe",
this);return this};R.prototype.on=function(d,a){a=J.prototype.on.call(this,d,a);"data"===d?!1!==this._readableState.flowing&&this.resume():"readable"===d&&(d=this._readableState,d.endEmitted||d.readableListening||(d.readableListening=d.needReadable=!0,d.emittedReadable=!1,d.reading?d.length&&sc(this):ea(Rg,this)));return a};R.prototype.addListener=R.prototype.on;R.prototype.resume=function(){var d=this._readableState;d.flowing||(G("resume"),d.flowing=!0,d.resumeScheduled||(d.resumeScheduled=!0,ea(Sg,
this,d)));return this};R.prototype.pause=function(){G("call pause flowing=%j",this._readableState.flowing);!1!==this._readableState.flowing&&(G("pause"),this._readableState.flowing=!1,this.emit("pause"));return this};R.prototype.wrap=function(d){var a=this._readableState,b=!1,c=this;d.on("end",function(){G("wrapped end");if(a.decoder&&!a.ended){var b=a.decoder.end();b&&b.length&&c.push(b)}c.push(null)});d.on("data",function(e){G("wrapped data");a.decoder&&(e=a.decoder.write(e));a.objectMode&&(null===
e||void 0===e)||!(a.objectMode||e&&e.length)||c.push(e)||(b=!0,d.pause())});for(var e in d)void 0===this[e]&&"function"===typeof d[e]&&(this[e]=function(a){return function(){return d[a].apply(d,arguments)}}(e));Ug(["error","close","destroy","pause","resume"],function(a){d.on(a,c.emit.bind(c,a))});c._read=function(a){G("wrapped _read",a);b&&(b=!1,d.resume())};return c};R._fromList=Le;N.WritableState=ed;Xa(N,J);ed.prototype.getBuffer=function(){for(var d=this.bufferedRequest,a=[];d;)a.push(d),d=d.next;
return a};N.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};N.prototype.write=function(d,a,b){var c=this._writableState,e=!1;"function"===typeof a&&(b=a,a=null);u.isBuffer(d)?a="buffer":a||(a=c.defaultEncoding);"function"!==typeof b&&(b=Vg);if(c.ended)c=b,d=Error("write after end"),this.emit("error",d),ea(c,d);else{var f=b,h=!0,g=!1;null===d?g=new TypeError("May not write null values to stream"):u.isBuffer(d)||"string"===typeof d||void 0===d||c.objectMode||(g=new TypeError("Invalid non-string/buffer chunk"));
g&&(this.emit("error",g),ea(f,g),h=!1);h&&(c.pendingcb++,e=a,c.objectMode||!1===c.decodeStrings||"string"!==typeof d||(d=u.from(d,e)),u.isBuffer(d)&&(e="buffer"),f=c.objectMode?1:d.length,c.length+=f,a=c.length<c.highWaterMark,a||(c.needDrain=!0),c.writing||c.corked?(f=c.lastBufferedRequest,c.lastBufferedRequest=new Wg(d,e,b),f?f.next=c.lastBufferedRequest:c.bufferedRequest=c.lastBufferedRequest,c.bufferedRequestCount+=1):fd(this,c,!1,f,d,e,b),e=a)}return e};N.prototype.cork=function(){this._writableState.corked++};
N.prototype.uncork=function(){var d=this._writableState;d.corked&&(d.corked--,d.writing||d.corked||d.finished||d.bufferProcessing||!d.bufferedRequest||Oe(this,d))};N.prototype.setDefaultEncoding=function(d){"string"===typeof d&&(d=d.toLowerCase());if(!(-1<"hex utf8 utf-8 ascii binary base64 ucs2 ucs-2 utf16le utf-16le raw".split(" ").indexOf((d+"").toLowerCase())))throw new TypeError("Unknown encoding: "+d);this._writableState.defaultEncoding=d;return this};N.prototype._write=function(d,a,b){b(Error("not implemented"))};
N.prototype._writev=null;N.prototype.end=function(d,a,b){var c=this._writableState;"function"===typeof d?(b=d,a=d=null):"function"===typeof a&&(b=a,a=null);null!==d&&void 0!==d&&this.write(d,a);c.corked&&(c.corked=1,this.uncork());if(!c.ending&&!c.finished){d=b;c.ending=!0;Re(this,c);if(d)if(c.finished)ea(d);else this.once("finish",d);c.ended=!0;this.writable=!1}};Xa(ka,R);for(var Qf=Object.keys(N.prototype),zd=0;zd<Qf.length;zd++){var Ad=Qf[zd];ka.prototype[Ad]||(ka.prototype[Ad]=N.prototype[Ad])}Xa(la,
ka);la.prototype.push=function(d,a){this._transformState.needTransform=!1;return ka.prototype.push.call(this,d,a)};la.prototype._transform=function(){throw Error("Not implemented");};la.prototype._write=function(d,a,b){var c=this._transformState;c.writecb=b;c.writechunk=d;c.writeencoding=a;c.transforming||(d=this._readableState,(c.needTransform||d.needReadable||d.length<d.highWaterMark)&&this._read(d.highWaterMark))};la.prototype._read=function(){var d=this._transformState;null!==d.writechunk&&d.writecb&&
!d.transforming?(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform)):d.needTransform=!0};Xa(ac,la);ac.prototype._transform=function(d,a,b){b(null,d)};Xa(wa,J);wa.Readable=R;wa.Writable=N;wa.Duplex=ka;wa.Transform=la;wa.PassThrough=ac;wa.Stream=wa;wa.prototype.pipe=function(d,a){function b(a){d.writable&&!1===d.write(a)&&k.pause&&k.pause()}function c(){k.readable&&k.resume&&k.resume()}function e(){q||(q=!0,d.end())}function f(){q||(q=!0,"function"===typeof d.destroy&&
d.destroy())}function h(a){g();if(0===J.listenerCount(this,"error"))throw a;}function g(){k.removeListener("data",b);d.removeListener("drain",c);k.removeListener("end",e);k.removeListener("close",f);k.removeListener("error",h);d.removeListener("error",h);k.removeListener("end",g);k.removeListener("close",g);d.removeListener("close",g)}var k=this;k.on("data",b);d.on("drain",c);d._isStdio||a&&!1===a.end||(k.on("end",e),k.on("close",f));var q=!1;k.on("error",h);d.on("error",h);k.on("end",g);k.on("close",
g);d.on("close",g);d.emit("pipe",k);return d};var Sh=Array.prototype.slice,Th=function c(a,b){for(var e in b)a[e]=b[e];return 3>arguments.length?a:c.apply(null,[a].concat(Sh.call(arguments,2)))},Rf=ba(function(a,b){function c(a,b,c){void 0===c&&(c=function(a){return a});return function(){for(var f=[],g=0;g<arguments.length;g++)f[g]=arguments[g];return new Promise(function(g,h){a[b].bind(a).apply(void 0,e(f,[function(a,b){return a?h(a):g(c(b))}]))})}}var e=S&&S.__spreadArrays||function(){for(var a=
0,b=0,c=arguments.length;b<c;b++)a+=arguments[b].length;a=Array(a);var e=0;for(b=0;b<c;b++)for(var f=arguments[b],p=0,v=f.length;p<v;p++,e++)a[e]=f[p];return a};Object.defineProperty(b,"__esModule",{value:!0});var f=function(){function a(a,b){this.vol=a;this.fd=b}a.prototype.appendFile=function(a,b){return c(this.vol,"appendFile")(this.fd,a,b)};a.prototype.chmod=function(a){return c(this.vol,"fchmod")(this.fd,a)};a.prototype.chown=function(a,b){return c(this.vol,"fchown")(this.fd,a,b)};a.prototype.close=
function(){return c(this.vol,"close")(this.fd)};a.prototype.datasync=function(){return c(this.vol,"fdatasync")(this.fd)};a.prototype.read=function(a,b,e,f){return c(this.vol,"read",function(b){return{bytesRead:b,buffer:a}})(this.fd,a,b,e,f)};a.prototype.readFile=function(a){return c(this.vol,"readFile")(this.fd,a)};a.prototype.stat=function(a){return c(this.vol,"fstat")(this.fd,a)};a.prototype.sync=function(){return c(this.vol,"fsync")(this.fd)};a.prototype.truncate=function(a){return c(this.vol,
"ftruncate")(this.fd,a)};a.prototype.utimes=function(a,b){return c(this.vol,"futimes")(this.fd,a,b)};a.prototype.write=function(a,b,e,f){return c(this.vol,"write",function(b){return{bytesWritten:b,buffer:a}})(this.fd,a,b,e,f)};a.prototype.writeFile=function(a,b){return c(this.vol,"writeFile")(this.fd,a,b)};return a}();b.FileHandle=f;b.default=function(a){return"undefined"===typeof Promise?null:{FileHandle:f,access:function(b,e){return c(a,"access")(b,e)},appendFile:function(b,e,h){return c(a,"appendFile")(b instanceof
f?b.fd:b,e,h)},chmod:function(b,e){return c(a,"chmod")(b,e)},chown:function(b,e,f){return c(a,"chown")(b,e,f)},copyFile:function(b,e,f){return c(a,"copyFile")(b,e,f)},lchmod:function(b,e){return c(a,"lchmod")(b,e)},lchown:function(b,e,f){return c(a,"lchown")(b,e,f)},link:function(b,e){return c(a,"link")(b,e)},lstat:function(b,e){return c(a,"lstat")(b,e)},mkdir:function(b,e){return c(a,"mkdir")(b,e)},mkdtemp:function(b,e){return c(a,"mkdtemp")(b,e)},open:function(b,e,h){return c(a,"open",function(b){return new f(a,
b)})(b,e,h)},readdir:function(b,e){return c(a,"readdir")(b,e)},readFile:function(b,e){return c(a,"readFile")(b instanceof f?b.fd:b,e)},readlink:function(b,e){return c(a,"readlink")(b,e)},realpath:function(b,e){return c(a,"realpath")(b,e)},rename:function(b,e){return c(a,"rename")(b,e)},rmdir:function(b){return c(a,"rmdir")(b)},stat:function(b,e){return c(a,"stat")(b,e)},symlink:function(b,e,f){return c(a,"symlink")(b,e,f)},truncate:function(b,e){return c(a,"truncate")(b,e)},unlink:function(b){return c(a,
"unlink")(b)},utimes:function(b,e,f){return c(a,"utimes")(b,e,f)},writeFile:function(b,e,h){return c(a,"writeFile")(b instanceof f?b.fd:b,e,h)}}}});P(Rf);var ch=/[^\x20-\x7E]/,ah=/[\x2E\u3002\uFF0E\uFF61]/g,Ue={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Qa=Math.floor,gd=String.fromCharCode,We=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},eh=Object.keys||
function(a){var b=[],c;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c);return b},Uh={parse:cc,resolve:function(a,b){return cc(a,!1,!0).resolve(b)},resolveObject:function(a,b){return a?cc(a,!1,!0).resolveObject(b):b},format:function(a){eb(a)&&(a=Ye({},a));return jd(a)},Url:xa},gh=/^([a-z0-9.+-]+:)/i,kh=/:[0-9]*$/,fh=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Vh="{}|\\^`".split("").concat('<>"` \r\n\t'.split("")),id=["'"].concat(Vh),$e=["%","/","?",";","#"].concat(id),Ze=["/","?","#"],ih=
255,bf=/^[+a-z0-9A-Z_-]{0,63}$/,hh=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,jh={javascript:!0,"javascript:":!0},hd={javascript:!0,"javascript:":!0},Ra={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};xa.prototype.parse=function(a,b,c){return Ye(this,a,b,c)};xa.prototype.format=function(){return jd(this)};xa.prototype.resolve=function(a){return this.resolveObject(cc(a,!1,!0)).format()};xa.prototype.resolveObject=function(a){if(eb(a)){var b=new xa;b.parse(a,
!1,!0);a=b}b=new xa;for(var c=Object.keys(this),e=0;e<c.length;e++){var f=c[e];b[f]=this[f]}b.hash=a.hash;if(""===a.href)return b.href=b.format(),b;if(a.slashes&&!a.protocol){c=Object.keys(a);for(e=0;e<c.length;e++)f=c[e],"protocol"!==f&&(b[f]=a[f]);Ra[b.protocol]&&b.hostname&&!b.pathname&&(b.path=b.pathname="/");b.href=b.format();return b}var h;if(a.protocol&&a.protocol!==b.protocol){if(!Ra[a.protocol]){c=Object.keys(a);for(e=0;e<c.length;e++)f=c[e],b[f]=a[f];b.href=b.format();return b}b.protocol=
a.protocol;if(a.host||hd[a.protocol])b.pathname=a.pathname;else{for(h=(a.pathname||"").split("/");h.length&&!(a.host=h.shift()););a.host||(a.host="");a.hostname||(a.hostname="");""!==h[0]&&h.unshift("");2>h.length&&h.unshift("");b.pathname=h.join("/")}b.search=a.search;b.query=a.query;b.host=a.host||"";b.auth=a.auth;b.hostname=a.hostname||a.host;b.port=a.port;if(b.pathname||b.search)b.path=(b.pathname||"")+(b.search||"");b.slashes=b.slashes||a.slashes;b.href=b.format();return b}c=b.pathname&&"/"===
b.pathname.charAt(0);var g=a.host||a.pathname&&"/"===a.pathname.charAt(0),k=c=g||c||b.host&&a.pathname;e=b.pathname&&b.pathname.split("/")||[];f=b.protocol&&!Ra[b.protocol];h=a.pathname&&a.pathname.split("/")||[];f&&(b.hostname="",b.port=null,b.host&&(""===e[0]?e[0]=b.host:e.unshift(b.host)),b.host="",a.protocol&&(a.hostname=null,a.port=null,a.host&&(""===h[0]?h[0]=a.host:h.unshift(a.host)),a.host=null),c=c&&(""===h[0]||""===e[0]));if(g)b.host=a.host||""===a.host?a.host:b.host,b.hostname=a.hostname||
""===a.hostname?a.hostname:b.hostname,b.search=a.search,b.query=a.query,e=h;else if(h.length)e||(e=[]),e.pop(),e=e.concat(h),b.search=a.search,b.query=a.query;else if(null!=a.search){f&&(b.hostname=b.host=e.shift(),f=b.host&&0<b.host.indexOf("@")?b.host.split("@"):!1)&&(b.auth=f.shift(),b.host=b.hostname=f.shift());b.search=a.search;b.query=a.query;if(null!==b.pathname||null!==b.search)b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"");b.href=b.format();return b}if(!e.length)return b.pathname=
null,b.path=b.search?"/"+b.search:null,b.href=b.format(),b;g=e.slice(-1)[0];h=(b.host||a.host||1<e.length)&&("."===g||".."===g)||""===g;for(var q=0,t=e.length;0<=t;t--)g=e[t],"."===g?e.splice(t,1):".."===g?(e.splice(t,1),q++):q&&(e.splice(t,1),q--);if(!c&&!k)for(;q--;q)e.unshift("..");!c||""===e[0]||e[0]&&"/"===e[0].charAt(0)||e.unshift("");h&&"/"!==e.join("/").substr(-1)&&e.push("");k=""===e[0]||e[0]&&"/"===e[0].charAt(0);f&&(b.hostname=b.host=k?"":e.length?e.shift():"",f=b.host&&0<b.host.indexOf("@")?
b.host.split("@"):!1)&&(b.auth=f.shift(),b.host=b.hostname=f.shift());(c||b.host&&e.length)&&!k&&e.unshift("");e.length?b.pathname=e.join("/"):(b.pathname=null,b.path=null);if(null!==b.pathname||null!==b.search)b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"");b.auth=a.auth||b.auth;b.slashes=b.slashes||a.slashes;b.href=b.format();return b};xa.prototype.parseHost=function(){return af(this)};var Sf=ba(function(a,b){function c(a,b){a=a[b];return 0<b&&("/"===a||f&&"\\"===a)}function e(a){var b=
1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;if(f){var e=a;if("string"!==typeof e)throw new TypeError("expected a string");e=e.replace(/[\\\/]+/g,"/");if(!1!==b)if(b=e,e=b.length-1,2>e)e=b;else{for(;c(b,e);)e--;e=b.substr(0,e+1)}return e.replace(/^([a-zA-Z]+:|\.\/)/,"")}return a}Object.defineProperty(b,"__esModule",{value:!0});b.unixify=e;b.correctPath=function(a){return e(a.replace(/^\\\\\?\\.:\\/,"\\"))};var f="win32"===gb.platform});P(Sf);var Bb=ba(function(a,b){function c(a,b){void 0===
b&&(b=na.default.cwd());return lb(b,a)}function e(a,b){return"function"===typeof a?[f(),a]:[f(a),v(b)]}function f(a){void 0===a&&(a={});return Ba({},za,a)}function h(a){return"number"===typeof a?Ba({},xa,{mode:a}):Ba({},xa,a)}function g(a,b,c,e){void 0===b&&(b="");void 0===c&&(c="");void 0===e&&(e="");var f="";c&&(f=" '"+c+"'");e&&(f+=" -> '"+e+"'");switch(a){case "ENOENT":return"ENOENT: no such file or directory, "+b+f;case "EBADF":return"EBADF: bad file descriptor, "+b+f;case "EINVAL":return"EINVAL: invalid argument, "+
b+f;case "EPERM":return"EPERM: operation not permitted, "+b+f;case "EPROTO":return"EPROTO: protocol error, "+b+f;case "EEXIST":return"EEXIST: file already exists, "+b+f;case "ENOTDIR":return"ENOTDIR: not a directory, "+b+f;case "EISDIR":return"EISDIR: illegal operation on a directory, "+b+f;case "EACCES":return"EACCES: permission denied, "+b+f;case "ENOTEMPTY":return"ENOTEMPTY: directory not empty, "+b+f;case "EMFILE":return"EMFILE: too many open files, "+b+f;case "ENOSYS":return"ENOSYS: function not implemented, "+
b+f;default:return a+": error occurred, "+b+f}}function k(a,b,c,e,f){void 0===b&&(b="");void 0===c&&(c="");void 0===e&&(e="");void 0===f&&(f=Error);b=new f(g(a,b,c,e));b.code=a;return b}function q(a){if("number"===typeof a)return a;if("string"===typeof a){var b=V[a];if("undefined"!==typeof b)return b}throw new kc.TypeError("ERR_INVALID_OPT_VALUE","flags",a);}function t(a,b){if(b){var c=typeof b;switch(c){case "string":a=Ba({},a,{encoding:b});break;case "object":a=Ba({},a,b);break;default:throw TypeError("Expected options to be either an object or a string, but got "+
c+" instead");}}else return a;"buffer"!==a.encoding&&da.assertEncoding(a.encoding);return a}function p(a){return function(b){return t(a,b)}}function v(a){if("function"!==typeof a)throw TypeError(P.CB);return a}function n(a){return function(b,c){return"function"===typeof b?[a(),b]:[a(b),v(c)]}}function r(a){if("string"!==typeof a&&!U.Buffer.isBuffer(a)){try{if(!(a instanceof Uh.URL))throw new TypeError(P.PATH_STR);}catch(Bc){throw new TypeError(P.PATH_STR);}if(""!==a.hostname)throw new kc.TypeError("ERR_INVALID_FILE_URL_HOST",
na.default.platform);a=a.pathname;for(var b=0;b<a.length;b++)if("%"===a[b]){var c=a.codePointAt(b+2)|32;if("2"===a[b+1]&&102===c)throw new kc.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters");}a=decodeURIComponent(a)}a=String(a);F(a);return a}function x(a,b){return(a=c(a,b).substr(1))?a.split(N):[]}function u(a){return x(r(a))}function z(a,b){void 0===b&&(b=da.ENCODING_UTF8);return U.Buffer.isBuffer(a)?a:a instanceof Uint8Array?U.bufferFrom(a):U.bufferFrom(String(a),b)}
function A(a,b){return b&&"buffer"!==b?a.toString(b):a}function F(a,b){if(-1!==(""+a).indexOf("\x00")){a=Error("Path must be a string without null bytes");a.code="ENOENT";if("function"!==typeof b)throw a;na.default.nextTick(b,a);return!1}return!0}function E(a,b){a="number"===typeof a?a:"string"===typeof a?parseInt(a,8):b?E(b):void 0;if("number"!==typeof a||isNaN(a))throw new TypeError(P.MODE_INT);return a}function G(a){if(a>>>0!==a)throw TypeError(P.FD);}function L(a){if("string"===typeof a&&+a==
a)return+a;if(a instanceof Date)return a.getTime()/1E3;if(isFinite(a))return 0>a?Date.now()/1E3:a;throw Error("Cannot parse time: "+a);}function B(a){if("number"!==typeof a)throw TypeError(P.UID);}function X(a){if("number"!==typeof a)throw TypeError(P.GID);}function Ma(a){a.emit("stop")}function sa(a,b,c){if(!(this instanceof sa))return new sa(a,b,c);this._vol=a;c=Ba({},t(c,{}));void 0===c.highWaterMark&&(c.highWaterMark=65536);wa.Readable.call(this,c);this.path=r(b);this.fd=void 0===c.fd?null:c.fd;
this.flags=void 0===c.flags?"r":c.flags;this.mode=void 0===c.mode?438:c.mode;this.start=c.start;this.end=c.end;this.autoClose=void 0===c.autoClose?!0:c.autoClose;this.pos=void 0;this.bytesRead=0;if(void 0!==this.start){if("number"!==typeof this.start)throw new TypeError('"start" option must be a Number');if(void 0===this.end)this.end=Infinity;else if("number"!==typeof this.end)throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw Error('"start" option must be <= "end" option');
this.pos=this.start}"number"!==typeof this.fd&&this.open();this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}function Ac(){this.close()}function T(a,b,c){if(!(this instanceof T))return new T(a,b,c);this._vol=a;c=Ba({},t(c,{}));wa.Writable.call(this,c);this.path=r(b);this.fd=void 0===c.fd?null:c.fd;this.flags=void 0===c.flags?"w":c.flags;this.mode=void 0===c.mode?438:c.mode;this.start=c.start;this.autoClose=void 0===c.autoClose?!0:!!c.autoClose;this.pos=void 0;this.bytesWritten=
0;if(void 0!==this.start){if("number"!==typeof this.start)throw new TypeError('"start" option must be a Number');if(0>this.start)throw Error('"start" must be >= zero');this.pos=this.start}c.encoding&&this.setDefaultEncoding(c.encoding);"number"!==typeof this.fd&&this.open();this.once("finish",function(){this.autoClose&&this.close()})}var Wa=S&&S.__extends||function(){function a(b,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&
(a[c]=b[c])};return a(b,c)}return function(b,c){function e(){this.constructor=b}a(b,c);b.prototype=null===c?Object.create(c):(e.prototype=c.prototype,new e)}}(),ic=S&&S.__spreadArrays||function(){for(var a=0,b=0,c=arguments.length;b<c;b++)a+=arguments[b].length;a=Array(a);var e=0;for(b=0;b<c;b++)for(var f=arguments[b],g=0,h=f.length;g<h;g++,e++)a[e]=f[g];return a};Object.defineProperty(b,"__esModule",{value:!0});var Ba=Th,lb=bd,mb=I.constants.O_RDONLY,Qb=I.constants.O_WRONLY,M=I.constants.O_RDWR,
C=I.constants.O_CREAT,R=I.constants.O_EXCL,O=I.constants.O_TRUNC,Q=I.constants.O_APPEND,W=I.constants.O_SYNC,Y=I.constants.O_DIRECTORY,Z=I.constants.F_OK,m=I.constants.COPYFILE_EXCL,ba=I.constants.COPYFILE_FICLONE_FORCE,N="/",w="win32"===na.default.platform,P={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",
MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},V;(function(a){a[a.r=mb]="r";a[a["r+"]=M]="r+";a[a.rs=mb|W]="rs";a[a.sr=a.rs]="sr";a[a["rs+"]=M|W]="rs+";a[a["sr+"]=a["rs+"]]="sr+";a[a.w=Qb|C|O]="w";a[a.wx=Qb|C|O|R]="wx";a[a.xw=a.wx]="xw";a[a["w+"]=M|C|O]="w+";a[a["wx+"]=M|C|O|R]="wx+";a[a["xw+"]=a["wx+"]]=
"xw+";a[a.a=Qb|Q|C]="a";a[a.ax=Qb|Q|C|R]="ax";a[a.xa=a.ax]="xa";a[a["a+"]=M|Q|C]="a+";a[a["ax+"]=M|Q|C|R]="ax+";a[a["xa+"]=a["ax+"]]="xa+"})(V=b.FLAGS||(b.FLAGS={}));b.flagsToNumber=q;a={encoding:"utf8"};var aa=p(a),ca=n(aa),ea=p({flag:"r"}),ia={encoding:"utf8",mode:438,flag:V[V.w]},ka=p(ia),ma={encoding:"utf8",mode:438,flag:V[V.a]},oa=p(ma),ja=n(oa),qa=p(a),la=n(qa),xa={mode:511,recursive:!1},fa={recursive:!1},ra=p({encoding:"utf8",withFileTypes:!1}),ya=n(ra),za={bigint:!1};b.pathToFilename=r;if(w){var ta=
c,pa=Sf.unixify;c=function(a,b){return pa(ta(a,b))}}b.filenameToSteps=x;b.pathToSteps=u;b.dataToStr=function(a,b){void 0===b&&(b=da.ENCODING_UTF8);return U.Buffer.isBuffer(a)?a.toString(b):a instanceof Uint8Array?U.bufferFrom(a).toString(b):String(a)};b.dataToBuffer=z;b.bufferToEncoding=A;b.toUnixTimestamp=L;a=function(){function a(a){void 0===a&&(a={});this.ino=0;this.inodes={};this.releasedInos=[];this.fds={};this.releasedFds=[];this.maxFiles=1E4;this.openFiles=0;this.promisesApi=Rf.default(this);
this.statWatchers={};this.props=Ba({Node:nb.Node,Link:nb.Link,File:nb.File},a);a=this.createLink();a.setNode(this.createNode(!0));var b=this;this.StatWatcher=function(a){function c(){return a.call(this,b)||this}Wa(c,a);return c}(ua);this.ReadStream=function(a){function c(){for(var c=[],e=0;e<arguments.length;e++)c[e]=arguments[e];return a.apply(this,ic([b],c))||this}Wa(c,a);return c}(sa);this.WriteStream=function(a){function c(){for(var c=[],e=0;e<arguments.length;e++)c[e]=arguments[e];return a.apply(this,
ic([b],c))||this}Wa(c,a);return c}(T);this.FSWatcher=function(a){function c(){return a.call(this,b)||this}Wa(c,a);return c}(va);this.root=a}a.fromJSON=function(b,c){var e=new a;e.fromJSON(b,c);return e};Object.defineProperty(a.prototype,"promises",{get:function(){if(null===this.promisesApi)throw Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!0,configurable:!0});a.prototype.createLink=function(a,b,c,e){void 0===c&&(c=!1);if(!a)return new this.props.Link(this,
null,"");if(!b)throw Error("createLink: name cannot be empty");return a.createChild(b,this.createNode(c,e))};a.prototype.deleteLink=function(a){var b=a.parent;return b?(b.deleteChild(a),!0):!1};a.prototype.newInoNumber=function(){var a=this.releasedInos.pop();return a?a:this.ino=(this.ino+1)%4294967295};a.prototype.newFdNumber=function(){var b=this.releasedFds.pop();return"number"===typeof b?b:a.fd--};a.prototype.createNode=function(a,b){void 0===a&&(a=!1);b=new this.props.Node(this.newInoNumber(),
b);a&&b.setIsDirectory();return this.inodes[b.ino]=b};a.prototype.getNode=function(a){return this.inodes[a]};a.prototype.deleteNode=function(a){a.del();delete this.inodes[a.ino];this.releasedInos.push(a.ino)};a.prototype.genRndStr=function(){var a=(Math.random()+1).toString(36).substr(2,6);return 6===a.length?a:this.genRndStr()};a.prototype.getLink=function(a){return this.root.walk(a)};a.prototype.getLinkOrThrow=function(a,b){var c=x(a);c=this.getLink(c);if(!c)throw k("ENOENT",b,a);return c};a.prototype.getResolvedLink=
function(a){a="string"===typeof a?x(a):a;for(var b=this.root,c=0;c<a.length;){b=b.getChild(a[c]);if(!b)return null;var e=b.getNode();e.isSymlink()?(a=e.symlink.concat(a.slice(c+1)),b=this.root,c=0):c++}return b};a.prototype.getResolvedLinkOrThrow=function(a,b){var c=this.getResolvedLink(a);if(!c)throw k("ENOENT",b,a);return c};a.prototype.resolveSymlinks=function(a){return this.getResolvedLink(a.steps.slice(1))};a.prototype.getLinkAsDirOrThrow=function(a,b){var c=this.getLinkOrThrow(a,b);if(!c.getNode().isDirectory())throw k("ENOTDIR",
b,a);return c};a.prototype.getLinkParent=function(a){return this.root.walk(a,a.length-1)};a.prototype.getLinkParentAsDirOrThrow=function(a,b){a=a instanceof Array?a:x(a);var c=this.getLinkParent(a);if(!c)throw k("ENOENT",b,N+a.join(N));if(!c.getNode().isDirectory())throw k("ENOTDIR",b,N+a.join(N));return c};a.prototype.getFileByFd=function(a){return this.fds[String(a)]};a.prototype.getFileByFdOrThrow=function(a,b){if(a>>>0!==a)throw TypeError(P.FD);a=this.getFileByFd(a);if(!a)throw k("EBADF",b);return a};
a.prototype.getNodeByIdOrCreate=function(a,b,c){if("number"===typeof a){a=this.getFileByFd(a);if(!a)throw Error("File nto found");return a.node}var e=u(a),f=this.getLink(e);if(f)return f.getNode();if(b&C&&(b=this.getLinkParent(e)))return f=this.createLink(b,e[e.length-1],!1,c),f.getNode();throw k("ENOENT","getNodeByIdOrCreate",r(a));};a.prototype.wrapAsync=function(a,b,c){var e=this;v(c);Ya.default(function(){try{c(null,a.apply(e,b))}catch(Ec){c(Ec)}})};a.prototype._toJSON=function(a,b,c){var e;void 0===
a&&(a=this.root);void 0===b&&(b={});var f=!0,g=a.children;a.getNode().isFile()&&(g=(e={},e[a.getName()]=a.parent.getChild(a.getName()),e),a=a.parent);for(var h in g){f=!1;g=a.getChild(h);if(!g)throw Error("_toJSON: unexpected undefined");e=g.getNode();e.isFile()?(g=g.getPath(),c&&(g=Zb(c,g)),b[g]=e.getString()):e.isDirectory()&&this._toJSON(g,b,c)}a=a.getPath();c&&(a=Zb(c,a));a&&f&&(b[a]=null);return b};a.prototype.toJSON=function(a,b,c){void 0===b&&(b={});void 0===c&&(c=!1);var e=[];if(a){a instanceof
Array||(a=[a]);for(var f=0;f<a.length;f++){var g=r(a[f]);(g=this.getResolvedLink(g))&&e.push(g)}}else e.push(this.root);if(!e.length)return b;for(f=0;f<e.length;f++)g=e[f],this._toJSON(g,b,c?g.getPath():"");return b};a.prototype.fromJSON=function(a,b){void 0===b&&(b=na.default.cwd());for(var e in a){var f=a[e];if("string"===typeof f){e=c(e,b);var g=x(e);1<g.length&&(g=N+g.slice(0,g.length-1).join(N),this.mkdirpBase(g,511));this.writeFileSync(e,f)}else this.mkdirpBase(e,511)}};a.prototype.reset=function(){this.ino=
0;this.inodes={};this.releasedInos=[];this.fds={};this.releasedFds=[];this.openFiles=0;this.root=this.createLink();this.root.setNode(this.createNode(!0))};a.prototype.mountSync=function(a,b){this.fromJSON(b,a)};a.prototype.openLink=function(a,b,c){void 0===c&&(c=!0);if(this.openFiles>=this.maxFiles)throw k("EMFILE","open",a.getPath());var e=a;c&&(e=this.resolveSymlinks(a));if(!e)throw k("ENOENT","open",a.getPath());c=e.getNode();if(c.isDirectory()){if((b&(mb|M|Qb))!==mb)throw k("EISDIR","open",a.getPath());
}else if(b&Y)throw k("ENOTDIR","open",a.getPath());if(!(b&Qb||c.canRead()))throw k("EACCES","open",a.getPath());a=new this.props.File(a,c,b,this.newFdNumber());this.fds[a.fd]=a;this.openFiles++;b&O&&a.truncate();return a};a.prototype.openFile=function(a,b,c,e){void 0===e&&(e=!0);var f=x(a),g=e?this.getResolvedLink(f):this.getLink(f);if(!g&&b&C){var h=this.getResolvedLink(f.slice(0,f.length-1));if(!h)throw k("ENOENT","open",N+f.join(N));b&C&&"number"===typeof c&&(g=this.createLink(h,f[f.length-1],
!1,c))}if(g)return this.openLink(g,b,e);throw k("ENOENT","open",a);};a.prototype.openBase=function(a,b,c,e){void 0===e&&(e=!0);b=this.openFile(a,b,c,e);if(!b)throw k("ENOENT","open",a);return b.fd};a.prototype.openSync=function(a,b,c){void 0===c&&(c=438);c=E(c);a=r(a);b=q(b);return this.openBase(a,b,c)};a.prototype.open=function(a,b,c,e){var f=c;"function"===typeof c&&(f=438,e=c);c=E(f||438);a=r(a);b=q(b);this.wrapAsync(this.openBase,[a,b,c],e)};a.prototype.closeFile=function(a){this.fds[a.fd]&&(this.openFiles--,
delete this.fds[a.fd],this.releasedFds.push(a.fd))};a.prototype.closeSync=function(a){G(a);a=this.getFileByFdOrThrow(a,"close");this.closeFile(a)};a.prototype.close=function(a,b){G(a);this.wrapAsync(this.closeSync,[a],b)};a.prototype.openFileOrGetById=function(a,b,c){if("number"===typeof a){a=this.fds[a];if(!a)throw k("ENOENT");return a}return this.openFile(r(a),b,c)};a.prototype.readBase=function(a,b,c,e,f){return this.getFileByFdOrThrow(a).read(b,Number(c),Number(e),f)};a.prototype.readSync=function(a,
b,c,e,f){G(a);return this.readBase(a,b,c,e,f)};a.prototype.read=function(a,b,c,e,f,g){var h=this;v(g);if(0===e)return na.default.nextTick(function(){g&&g(null,0,b)});Ya.default(function(){try{var k=h.readBase(a,b,c,e,f);g(null,k,b)}catch(Wh){g(Wh)}})};a.prototype.readFileBase=function(a,b,c){var e="number"===typeof a&&a>>>0===a;if(!e){var f=r(a);f=x(f);if((f=this.getResolvedLink(f))&&f.getNode().isDirectory())throw k("EISDIR","open",f.getPath());a=this.openSync(a,b)}try{var g=A(this.getFileByFdOrThrow(a).getBuffer(),
c)}finally{e||this.closeSync(a)}return g};a.prototype.readFileSync=function(a,b){b=ea(b);var c=q(b.flag);return this.readFileBase(a,c,b.encoding)};a.prototype.readFile=function(a,b,c){c=n(ea)(b,c);b=c[0];c=c[1];var e=q(b.flag);this.wrapAsync(this.readFileBase,[a,e,b.encoding],c)};a.prototype.writeBase=function(a,b,c,e,f){return this.getFileByFdOrThrow(a,"write").write(b,c,e,f)};a.prototype.writeSync=function(a,b,c,e,f){G(a);var g="string"!==typeof b;if(g){var h=(c||0)|0,k=e;c=f}else var n=e;b=z(b,
n);g?"undefined"===typeof k&&(k=b.length):(h=0,k=b.length);return this.writeBase(a,b,h,k,c)};a.prototype.write=function(a,b,c,e,f,g){var h=this;G(a);var k=typeof b,n=typeof c,m=typeof e,Tf=typeof f;if("string"!==k)if("function"===n)var Ea=c;else if("function"===m){var p=c|0;Ea=e}else if("function"===Tf){p=c|0;var Bc=e;Ea=f}else{p=c|0;Bc=e;var r=f;Ea=g}else if("function"===n)Ea=c;else if("function"===m)r=c,Ea=e;else if("function"===Tf){r=c;var t=e;Ea=f}var q=z(b,t);"string"!==k?"undefined"===typeof Bc&&
(Bc=q.length):(p=0,Bc=q.length);var B=v(Ea);Ya.default(function(){try{var c=h.writeBase(a,q,p,Bc,r);"string"!==k?B(null,c,q):B(null,c,b)}catch(Xh){B(Xh)}})};a.prototype.writeFileBase=function(a,b,c,e){var f="number"===typeof a;a=f?a:this.openBase(r(a),c,e);e=0;var g=b.length;c=c&Q?void 0:0;try{for(;0<g;){var h=this.writeSync(a,b,e,g,c);e+=h;g-=h;void 0!==c&&(c+=h)}}finally{f||this.closeSync(a)}};a.prototype.writeFileSync=function(a,b,c){var e=ka(c);c=q(e.flag);var f=E(e.mode);b=z(b,e.encoding);this.writeFileBase(a,
b,c,f)};a.prototype.writeFile=function(a,b,c,e){var f=c;"function"===typeof c&&(f=ia,e=c);c=v(e);var g=ka(f);f=q(g.flag);e=E(g.mode);b=z(b,g.encoding);this.wrapAsync(this.writeFileBase,[a,b,f,e],c)};a.prototype.linkBase=function(a,b){var c=x(a),e=this.getLink(c);if(!e)throw k("ENOENT","link",a,b);var f=x(b);c=this.getLinkParent(f);if(!c)throw k("ENOENT","link",a,b);f=f[f.length-1];if(c.getChild(f))throw k("EEXIST","link",a,b);a=e.getNode();a.nlink++;c.createChild(f,a)};a.prototype.copyFileBase=function(a,
b,c){var e=this.readFileSync(a);if(c&m&&this.existsSync(b))throw k("EEXIST","copyFile",a,b);if(c&ba)throw k("ENOSYS","copyFile",a,b);this.writeFileBase(b,e,V.w,438)};a.prototype.copyFileSync=function(a,b,c){a=r(a);b=r(b);return this.copyFileBase(a,b,(c||0)|0)};a.prototype.copyFile=function(a,b,c,e){a=r(a);b=r(b);if("function"===typeof c)var f=0;else f=c,c=e;v(c);this.wrapAsync(this.copyFileBase,[a,b,f],c)};a.prototype.linkSync=function(a,b){a=r(a);b=r(b);this.linkBase(a,b)};a.prototype.link=function(a,
b,c){a=r(a);b=r(b);this.wrapAsync(this.linkBase,[a,b],c)};a.prototype.unlinkBase=function(a){var b=x(a);b=this.getLink(b);if(!b)throw k("ENOENT","unlink",a);if(b.length)throw Error("Dir not empty...");this.deleteLink(b);a=b.getNode();a.nlink--;0>=a.nlink&&this.deleteNode(a)};a.prototype.unlinkSync=function(a){a=r(a);this.unlinkBase(a)};a.prototype.unlink=function(a,b){a=r(a);this.wrapAsync(this.unlinkBase,[a],b)};a.prototype.symlinkBase=function(a,b){var c=x(b),e=this.getLinkParent(c);if(!e)throw k("ENOENT",
"symlink",a,b);c=c[c.length-1];if(e.getChild(c))throw k("EEXIST","symlink",a,b);b=e.createChild(c);b.getNode().makeSymlink(x(a));return b};a.prototype.symlinkSync=function(a,b){a=r(a);b=r(b);this.symlinkBase(a,b)};a.prototype.symlink=function(a,b,c,e){c=v("function"===typeof c?c:e);a=r(a);b=r(b);this.wrapAsync(this.symlinkBase,[a,b],c)};a.prototype.realpathBase=function(a,b){var c=x(a);c=this.getResolvedLink(c);if(!c)throw k("ENOENT","realpath",a);return da.strToEncoding(c.getPath(),b)};a.prototype.realpathSync=
function(a,b){return this.realpathBase(r(a),qa(b).encoding)};a.prototype.realpath=function(a,b,c){c=la(b,c);b=c[0];c=c[1];a=r(a);this.wrapAsync(this.realpathBase,[a,b.encoding],c)};a.prototype.lstatBase=function(a,b){void 0===b&&(b=!1);var c=this.getLink(x(a));if(!c)throw k("ENOENT","lstat",a);return zb.default.build(c.getNode(),b)};a.prototype.lstatSync=function(a,b){return this.lstatBase(r(a),f(b).bigint)};a.prototype.lstat=function(a,b,c){c=e(b,c);b=c[0];c=c[1];this.wrapAsync(this.lstatBase,[r(a),
b.bigint],c)};a.prototype.statBase=function(a,b){void 0===b&&(b=!1);var c=this.getResolvedLink(x(a));if(!c)throw k("ENOENT","stat",a);return zb.default.build(c.getNode(),b)};a.prototype.statSync=function(a,b){return this.statBase(r(a),f(b).bigint)};a.prototype.stat=function(a,b,c){c=e(b,c);b=c[0];c=c[1];this.wrapAsync(this.statBase,[r(a),b.bigint],c)};a.prototype.fstatBase=function(a,b){void 0===b&&(b=!1);a=this.getFileByFd(a);if(!a)throw k("EBADF","fstat");return zb.default.build(a.node,b)};a.prototype.fstatSync=
function(a,b){return this.fstatBase(a,f(b).bigint)};a.prototype.fstat=function(a,b,c){b=e(b,c);this.wrapAsync(this.fstatBase,[a,b[0].bigint],b[1])};a.prototype.renameBase=function(a,b){var c=this.getLink(x(a));if(!c)throw k("ENOENT","rename",a,b);var e=x(b),f=this.getLinkParent(e);if(!f)throw k("ENOENT","rename",a,b);(a=c.parent)&&a.deleteChild(c);c.steps=ic(f.steps,[e[e.length-1]]);f.setChild(c.getName(),c)};a.prototype.renameSync=function(a,b){a=r(a);b=r(b);this.renameBase(a,b)};a.prototype.rename=
function(a,b,c){a=r(a);b=r(b);this.wrapAsync(this.renameBase,[a,b],c)};a.prototype.existsBase=function(a){return!!this.statBase(a)};a.prototype.existsSync=function(a){try{return this.existsBase(r(a))}catch(Ea){return!1}};a.prototype.exists=function(a,b){var c=this,e=r(a);if("function"!==typeof b)throw Error(P.CB);Ya.default(function(){try{b(c.existsBase(e))}catch(Ec){b(!1)}})};a.prototype.accessBase=function(a){this.getLinkOrThrow(a,"access")};a.prototype.accessSync=function(a,b){void 0===b&&(b=Z);
a=r(a);this.accessBase(a,b|0)};a.prototype.access=function(a,b,c){var e=Z;"function"!==typeof b&&(e=b|0,b=v(c));a=r(a);this.wrapAsync(this.accessBase,[a,e],b)};a.prototype.appendFileSync=function(a,b,c){void 0===c&&(c=ma);c=oa(c);c.flag&&a>>>0!==a||(c.flag="a");this.writeFileSync(a,b,c)};a.prototype.appendFile=function(a,b,c,e){e=ja(c,e);c=e[0];e=e[1];c.flag&&a>>>0!==a||(c.flag="a");this.writeFile(a,b,c,e)};a.prototype.readdirBase=function(a,b){var c=x(a);c=this.getResolvedLink(c);if(!c)throw k("ENOENT",
"readdir",a);if(!c.getNode().isDirectory())throw k("ENOTDIR","scandir",a);if(b.withFileTypes){var e=[];for(f in c.children)(a=c.getChild(f))&&e.push(yd.default.build(a,b.encoding));w||"buffer"===b.encoding||e.sort(function(a,b){return a.name<b.name?-1:a.name>b.name?1:0});return e}var f=[];for(e in c.children)f.push(da.strToEncoding(e,b.encoding));w||"buffer"===b.encoding||f.sort();return f};a.prototype.readdirSync=function(a,b){b=ra(b);a=r(a);return this.readdirBase(a,b)};a.prototype.readdir=function(a,
b,c){c=ya(b,c);b=c[0];c=c[1];a=r(a);this.wrapAsync(this.readdirBase,[a,b],c)};a.prototype.readlinkBase=function(a,b){var c=this.getLinkOrThrow(a,"readlink").getNode();if(!c.isSymlink())throw k("EINVAL","readlink",a);a=N+c.symlink.join(N);return da.strToEncoding(a,b)};a.prototype.readlinkSync=function(a,b){b=aa(b);a=r(a);return this.readlinkBase(a,b.encoding)};a.prototype.readlink=function(a,b,c){c=ca(b,c);b=c[0];c=c[1];a=r(a);this.wrapAsync(this.readlinkBase,[a,b.encoding],c)};a.prototype.fsyncBase=
function(a){this.getFileByFdOrThrow(a,"fsync")};a.prototype.fsyncSync=function(a){this.fsyncBase(a)};a.prototype.fsync=function(a,b){this.wrapAsync(this.fsyncBase,[a],b)};a.prototype.fdatasyncBase=function(a){this.getFileByFdOrThrow(a,"fdatasync")};a.prototype.fdatasyncSync=function(a){this.fdatasyncBase(a)};a.prototype.fdatasync=function(a,b){this.wrapAsync(this.fdatasyncBase,[a],b)};a.prototype.ftruncateBase=function(a,b){this.getFileByFdOrThrow(a,"ftruncate").truncate(b)};a.prototype.ftruncateSync=
function(a,b){this.ftruncateBase(a,b)};a.prototype.ftruncate=function(a,b,c){var e="number"===typeof b?b:0;b=v("number"===typeof b?c:b);this.wrapAsync(this.ftruncateBase,[a,e],b)};a.prototype.truncateBase=function(a,b){a=this.openSync(a,"r+");try{this.ftruncateSync(a,b)}finally{this.closeSync(a)}};a.prototype.truncateSync=function(a,b){if(a>>>0===a)return this.ftruncateSync(a,b);this.truncateBase(a,b)};a.prototype.truncate=function(a,b,c){var e="number"===typeof b?b:0;b=v("number"===typeof b?c:b);
if(a>>>0===a)return this.ftruncate(a,e,b);this.wrapAsync(this.truncateBase,[a,e],b)};a.prototype.futimesBase=function(a,b,c){a=this.getFileByFdOrThrow(a,"futimes").node;a.atime=new Date(1E3*b);a.mtime=new Date(1E3*c)};a.prototype.futimesSync=function(a,b,c){this.futimesBase(a,L(b),L(c))};a.prototype.futimes=function(a,b,c,e){this.wrapAsync(this.futimesBase,[a,L(b),L(c)],e)};a.prototype.utimesBase=function(a,b,c){a=this.openSync(a,"r+");try{this.futimesBase(a,b,c)}finally{this.closeSync(a)}};a.prototype.utimesSync=
function(a,b,c){this.utimesBase(r(a),L(b),L(c))};a.prototype.utimes=function(a,b,c,e){this.wrapAsync(this.utimesBase,[r(a),L(b),L(c)],e)};a.prototype.mkdirBase=function(a,b){var c=x(a);if(!c.length)throw k("EISDIR","mkdir",a);var e=this.getLinkParentAsDirOrThrow(a,"mkdir");c=c[c.length-1];if(e.getChild(c))throw k("EEXIST","mkdir",a);e.createChild(c,this.createNode(!0,b))};a.prototype.mkdirpBase=function(a,b){a=x(a);for(var c=this.root,e=0;e<a.length;e++){var f=a[e];if(!c.getNode().isDirectory())throw k("ENOTDIR",
"mkdir",c.getPath());var g=c.getChild(f);if(g)if(g.getNode().isDirectory())c=g;else throw k("ENOTDIR","mkdir",g.getPath());else c=c.createChild(f,this.createNode(!0,b))}};a.prototype.mkdirSync=function(a,b){b=h(b);var c=E(b.mode,511);a=r(a);b.recursive?this.mkdirpBase(a,c):this.mkdirBase(a,c)};a.prototype.mkdir=function(a,b,c){var e=h(b);b=v("function"===typeof b?b:c);c=E(e.mode,511);a=r(a);e.recursive?this.wrapAsync(this.mkdirpBase,[a,c],b):this.wrapAsync(this.mkdirBase,[a,c],b)};a.prototype.mkdirpSync=
function(a,b){this.mkdirSync(a,{mode:b,recursive:!0})};a.prototype.mkdirp=function(a,b,c){var e="function"===typeof b?void 0:b;b=v("function"===typeof b?b:c);this.mkdir(a,{mode:e,recursive:!0},b)};a.prototype.mkdtempBase=function(a,b,c){void 0===c&&(c=5);var e=a+this.genRndStr();try{return this.mkdirBase(e,511),da.strToEncoding(e,b)}catch(Ec){if("EEXIST"===Ec.code){if(1<c)return this.mkdtempBase(a,b,c-1);throw Error("Could not create temp dir.");}throw Ec;}};a.prototype.mkdtempSync=function(a,b){b=
aa(b).encoding;if(!a||"string"!==typeof a)throw new TypeError("filename prefix is required");F(a);return this.mkdtempBase(a,b)};a.prototype.mkdtemp=function(a,b,c){c=ca(b,c);b=c[0].encoding;c=c[1];if(!a||"string"!==typeof a)throw new TypeError("filename prefix is required");F(a)&&this.wrapAsync(this.mkdtempBase,[a,b],c)};a.prototype.rmdirBase=function(a,b){b=Ba({},fa,b);var c=this.getLinkAsDirOrThrow(a,"rmdir");if(c.length&&!b.recursive)throw k("ENOTEMPTY","rmdir",a);this.deleteLink(c)};a.prototype.rmdirSync=
function(a,b){this.rmdirBase(r(a),b)};a.prototype.rmdir=function(a,b,c){var e=Ba({},fa,b);b=v("function"===typeof b?b:c);this.wrapAsync(this.rmdirBase,[r(a),e],b)};a.prototype.fchmodBase=function(a,b){this.getFileByFdOrThrow(a,"fchmod").chmod(b)};a.prototype.fchmodSync=function(a,b){this.fchmodBase(a,E(b))};a.prototype.fchmod=function(a,b,c){this.wrapAsync(this.fchmodBase,[a,E(b)],c)};a.prototype.chmodBase=function(a,b){a=this.openSync(a,"r+");try{this.fchmodBase(a,b)}finally{this.closeSync(a)}};
a.prototype.chmodSync=function(a,b){b=E(b);a=r(a);this.chmodBase(a,b)};a.prototype.chmod=function(a,b,c){b=E(b);a=r(a);this.wrapAsync(this.chmodBase,[a,b],c)};a.prototype.lchmodBase=function(a,b){a=this.openBase(a,M,0,!1);try{this.fchmodBase(a,b)}finally{this.closeSync(a)}};a.prototype.lchmodSync=function(a,b){b=E(b);a=r(a);this.lchmodBase(a,b)};a.prototype.lchmod=function(a,b,c){b=E(b);a=r(a);this.wrapAsync(this.lchmodBase,[a,b],c)};a.prototype.fchownBase=function(a,b,c){this.getFileByFdOrThrow(a,
"fchown").chown(b,c)};a.prototype.fchownSync=function(a,b,c){B(b);X(c);this.fchownBase(a,b,c)};a.prototype.fchown=function(a,b,c,e){B(b);X(c);this.wrapAsync(this.fchownBase,[a,b,c],e)};a.prototype.chownBase=function(a,b,c){this.getResolvedLinkOrThrow(a,"chown").getNode().chown(b,c)};a.prototype.chownSync=function(a,b,c){B(b);X(c);this.chownBase(r(a),b,c)};a.prototype.chown=function(a,b,c,e){B(b);X(c);this.wrapAsync(this.chownBase,[r(a),b,c],e)};a.prototype.lchownBase=function(a,b,c){this.getLinkOrThrow(a,
"lchown").getNode().chown(b,c)};a.prototype.lchownSync=function(a,b,c){B(b);X(c);this.lchownBase(r(a),b,c)};a.prototype.lchown=function(a,b,c,e){B(b);X(c);this.wrapAsync(this.lchownBase,[r(a),b,c],e)};a.prototype.watchFile=function(a,b,c){a=r(a);var e=b;"function"===typeof e&&(c=b,e=null);if("function"!==typeof c)throw Error('"watchFile()" requires a listener function');b=5007;var f=!0;e&&"object"===typeof e&&("number"===typeof e.interval&&(b=e.interval),"boolean"===typeof e.persistent&&(f=e.persistent));
(e=this.statWatchers[a])||(e=new this.StatWatcher,e.start(a,f,b),this.statWatchers[a]=e);e.addListener("change",c);return e};a.prototype.unwatchFile=function(a,b){a=r(a);var c=this.statWatchers[a];c&&("function"===typeof b?c.removeListener("change",b):c.removeAllListeners("change"),0===c.listenerCount("change")&&(c.stop(),delete this.statWatchers[a]))};a.prototype.createReadStream=function(a,b){return new this.ReadStream(a,b)};a.prototype.createWriteStream=function(a,b){return new this.WriteStream(a,
b)};a.prototype.watch=function(a,b,c){a=r(a);var e=b;"function"===typeof b&&(c=b,e=null);var f=aa(e);b=f.persistent;e=f.recursive;f=f.encoding;void 0===b&&(b=!0);void 0===e&&(e=!1);var g=new this.FSWatcher;g.start(a,b,e,f);c&&g.addListener("change",c);return g};a.fd=2147483647;return a}();b.Volume=a;var ua=function(a){function b(b){var c=a.call(this)||this;c.onInterval=function(){try{var a=c.vol.statSync(c.filename);c.hasChanged(a)&&(c.emit("change",a,c.prev),c.prev=a)}finally{c.loop()}};c.vol=b;
return c}Wa(b,a);b.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)};b.prototype.hasChanged=function(a){return a.mtimeMs>this.prev.mtimeMs||a.nlink!==this.prev.nlink?!0:!1};b.prototype.start=function(a,b,c){void 0===b&&(b=!0);void 0===c&&(c=5007);this.filename=r(a);this.setTimeout=b?setTimeout:Pf.default;this.interval=c;this.prev=this.vol.statSync(this.filename);this.loop()};b.prototype.stop=function(){clearTimeout(this.timeoutRef);na.default.nextTick(Ma,this)};
return b}(J.EventEmitter);b.StatWatcher=ua;var ha;jc.inherits(sa,wa.Readable);b.ReadStream=sa;sa.prototype.open=function(){var a=this;this._vol.open(this.path,this.flags,this.mode,function(b,c){b?(a.autoClose&&a.destroy&&a.destroy(),a.emit("error",b)):(a.fd=c,a.emit("open",c),a.read())})};sa.prototype._read=function(a){if("number"!==typeof this.fd)return this.once("open",function(){this._read(a)});if(!this.destroyed){if(!ha||128>ha.length-ha.used)ha=U.bufferAllocUnsafe(this._readableState.highWaterMark),
ha.used=0;var b=ha,c=Math.min(ha.length-ha.used,a),e=ha.used;void 0!==this.pos&&(c=Math.min(this.end-this.pos+1,c));if(0>=c)return this.push(null);var f=this;this._vol.read(this.fd,ha,ha.used,c,this.pos,function(a,c){a?(f.autoClose&&f.destroy&&f.destroy(),f.emit("error",a)):(a=null,0<c&&(f.bytesRead+=c,a=b.slice(e,e+c)),f.push(a))});void 0!==this.pos&&(this.pos+=c);ha.used+=c}};sa.prototype._destroy=function(a,b){this.close(function(c){b(a||c)})};sa.prototype.close=function(a){var b=this;if(a)this.once("close",
a);if(this.closed||"number"!==typeof this.fd){if("number"!==typeof this.fd){this.once("open",Ac);return}return na.default.nextTick(function(){return b.emit("close")})}this.closed=!0;this._vol.close(this.fd,function(a){a?b.emit("error",a):b.emit("close")});this.fd=null};jc.inherits(T,wa.Writable);b.WriteStream=T;T.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(a,b){a?(this.autoClose&&this.destroy&&this.destroy(),this.emit("error",a)):(this.fd=b,this.emit("open",b))}.bind(this))};
T.prototype._write=function(a,b,c){if(!(a instanceof U.Buffer))return this.emit("error",Error("Invalid data"));if("number"!==typeof this.fd)return this.once("open",function(){this._write(a,b,c)});var e=this;this._vol.write(this.fd,a,0,a.length,this.pos,function(a,b){if(a)return e.autoClose&&e.destroy&&e.destroy(),c(a);e.bytesWritten+=b;c()});void 0!==this.pos&&(this.pos+=a.length)};T.prototype._writev=function(a,b){if("number"!==typeof this.fd)return this.once("open",function(){this._writev(a,b)});
for(var c=this,e=a.length,f=Array(e),g=0,h=0;h<e;h++){var k=a[h].chunk;f[h]=k;g+=k.length}e=U.Buffer.concat(f);this._vol.write(this.fd,e,0,e.length,this.pos,function(a,e){if(a)return c.destroy&&c.destroy(),b(a);c.bytesWritten+=e;b()});void 0!==this.pos&&(this.pos+=g)};T.prototype._destroy=sa.prototype._destroy;T.prototype.close=sa.prototype.close;T.prototype.destroySoon=T.prototype.end;var va=function(a){function b(b){var c=a.call(this)||this;c._filename="";c._filenameEncoded="";c._recursive=!1;c._encoding=
da.ENCODING_UTF8;c._onNodeChange=function(){c._emit("change")};c._onParentChild=function(a){a.getName()===c._getName()&&c._emit("rename")};c._emit=function(a){c.emit("change",a,c._filenameEncoded)};c._persist=function(){c._timer=setTimeout(c._persist,1E6)};c._vol=b;return c}Wa(b,a);b.prototype._getName=function(){return this._steps[this._steps.length-1]};b.prototype.start=function(a,b,c,e){void 0===b&&(b=!0);void 0===c&&(c=!1);void 0===e&&(e=da.ENCODING_UTF8);this._filename=r(a);this._steps=x(this._filename);
this._filenameEncoded=da.strToEncoding(this._filename);this._recursive=c;this._encoding=e;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(Bd){throw b=Error("watch "+this._filename+" "+Bd.code),b.code=Bd.code,b.errno=Bd.code,b;}this._link.getNode().on("change",this._onNodeChange);this._link.on("child:add",this._onNodeChange);this._link.on("child:delete",this._onNodeChange);if(a=this._link.parent)a.setMaxListeners(a.getMaxListeners()+1),a.on("child:delete",this._onParentChild);
b&&this._persist()};b.prototype.close=function(){clearTimeout(this._timer);this._link.getNode().removeListener("change",this._onNodeChange);var a=this._link.parent;a&&a.removeListener("child:delete",this._onParentChild)};return b}(J.EventEmitter);b.FSWatcher=va});P(Bb);var Yh=Bb.pathToFilename,Zh=Bb.filenameToSteps,Uf=Bb.Volume,Cd=ba(function(a,b){Object.defineProperty(b,"__esModule",{value:!0});b.fsProps="constants F_OK R_OK W_OK X_OK Stats".split(" ");b.fsSyncMethods="renameSync ftruncateSync truncateSync chownSync fchownSync lchownSync chmodSync fchmodSync lchmodSync statSync lstatSync fstatSync linkSync symlinkSync readlinkSync realpathSync unlinkSync rmdirSync mkdirSync mkdirpSync readdirSync closeSync openSync utimesSync futimesSync fsyncSync writeSync readSync readFileSync writeFileSync appendFileSync existsSync accessSync fdatasyncSync mkdtempSync copyFileSync createReadStream createWriteStream".split(" ");
b.fsAsyncMethods="rename ftruncate truncate chown fchown lchown chmod fchmod lchmod stat lstat fstat link symlink readlink realpath unlink rmdir mkdir mkdirp readdir close open utimes futimes fsync write read readFile writeFile appendFile exists access fdatasync mkdtemp copyFile watchFile unwatchFile watch".split(" ")});P(Cd);var Vf=ba(function(a,b){function c(a){for(var b={F_OK:g,R_OK:k,W_OK:q,X_OK:t,constants:I.constants,Stats:zb.default,Dirent:yd.default},c=0,e=f;c<e.length;c++){var p=e[c];"function"===
typeof a[p]&&(b[p]=a[p].bind(a))}c=0;for(e=h;c<e.length;c++)p=e[c],"function"===typeof a[p]&&(b[p]=a[p].bind(a));b.StatWatcher=a.StatWatcher;b.FSWatcher=a.FSWatcher;b.WriteStream=a.WriteStream;b.ReadStream=a.ReadStream;b.promises=a.promises;b._toUnixTimestamp=Bb.toUnixTimestamp;return b}var e=S&&S.__assign||function(){e=Object.assign||function(a){for(var b,c=1,e=arguments.length;c<e;c++){b=arguments[c];for(var f in b)Object.prototype.hasOwnProperty.call(b,f)&&(a[f]=b[f])}return a};return e.apply(this,
arguments)};Object.defineProperty(b,"__esModule",{value:!0});var f=Cd.fsSyncMethods,h=Cd.fsAsyncMethods,g=I.constants.F_OK,k=I.constants.R_OK,q=I.constants.W_OK,t=I.constants.X_OK;b.Volume=Bb.Volume;b.vol=new Bb.Volume;b.createFsFromVolume=c;b.fs=c(b.vol);a.exports=e(e({},a.exports),b.fs);a.exports.semantic=!0});P(Vf);var Wf=Vf.createFsFromVolume;Rh.prototype.emit=function(a){for(var b,c,e=[],f=1;f<arguments.length;f++)e[f-1]=arguments[f];f=this.listeners(a);try{for(var h=Mc(f),g=h.next();!g.done;g=
h.next()){var k=g.value;try{k.apply(void 0,pg(e))}catch(q){console.error(q)}}}catch(q){b={error:q}}finally{try{g&&!g.done&&(c=h.return)&&c.call(h)}finally{if(b)throw b.error;}}return 0<f.length};for(var Xf=function(){function a(){this.volume=new Uf;this.fs=Wf(this.volume);this.fromJSON({"/dev/stdin":"","/dev/stdout":"","/dev/stderr":""})}a.prototype._toJSON=function(a,c,e){void 0===c&&(c={});var b=!0,h;for(h in a.children){b=!1;var g=a.getChild(h);if(g){var k=g.getNode();k&&k.isFile()?(g=g.getPath(),
e&&(g=Zb(e,g)),c[g]=k.getBuffer()):k&&k.isDirectory()&&this._toJSON(g,c,e)}}a=a.getPath();e&&(a=Zb(e,a));a&&b&&(c[a]=null);return c};a.prototype.toJSON=function(a,c,e){var b,h;void 0===c&&(c={});void 0===e&&(e=!1);var g=[];if(a){a instanceof Array||(a=[a]);try{for(var k=Mc(a),q=k.next();!q.done;q=k.next()){var t=Yh(q.value),p=this.volume.getResolvedLink(t);p&&g.push(p)}}catch(D){var v={error:D}}finally{try{q&&!q.done&&(b=k.return)&&b.call(k)}finally{if(v)throw v.error;}}}else g.push(this.volume.root);
if(!g.length)return c;try{for(var n=Mc(g),r=n.next();!r.done;r=n.next())p=r.value,this._toJSON(p,c,e?p.getPath():"")}catch(D){var x={error:D}}finally{try{r&&!r.done&&(h=n.return)&&h.call(n)}finally{if(x)throw x.error;}}return c};a.prototype.fromJSONFixed=function(a,c){for(var b in c){var f=c[b];if(f?null!==Object.getPrototypeOf(f):null!==f){var h=Zh(b);1<h.length&&(h="/"+h.slice(0,h.length-1).join("/"),a.mkdirpBase(h,511));a.writeFileSync(b,f||"")}else a.mkdirpBase(b,511)}};a.prototype.fromJSON=function(a){this.volume=
new Uf;this.fromJSONFixed(this.volume,a);this.fs=Wf(this.volume);this.volume.releasedFds=[0,1,2];a=this.volume.openSync("/dev/stderr","w");var b=this.volume.openSync("/dev/stdout","w"),e=this.volume.openSync("/dev/stdin","r");if(2!==a)throw Error("invalid handle for stderr: "+a);if(1!==b)throw Error("invalid handle for stdout: "+b);if(0!==e)throw Error("invalid handle for stdin: "+e);};a.prototype.getStdOut=function(){return mg(this,void 0,void 0,function(){var a,c=this;return ng(this,function(){a=
new Promise(function(a){a(c.fs.readFileSync("/dev/stdout","utf8"))});return[2,a]})})};return a}(),Yf=function(){return function(a){if(!a)throw Error("You must provide a config for the Wasm terminal.");if(!a.fetchCommand)throw Error("You must provide a fetchCommand for the Wasm terminal config, to handle fetching commands to be run");a.processWorkerUrl||console.warn("Note: It is HIGHLY reccomended you pass in the processWorkerUrl in the terminal config to create process workers. Without this, some wasi programs will not work.");
a.processWorkerUrl&&console.warn("The unoptimized bundle of wasm-terminal is currently being used. The process worker does not need to be passed, as it is already inlined into the bundle. If you would like to pass in the process worker url and improve performance, please use the optimized bundle. Instructions can be found in the documentation.");this.fetchCommand=a.fetchCommand;this.processWorkerUrl=a.processWorkerUrl;this.wasmFs=a.wasmFs?a.wasmFs:new Xf}}(),kd=function(a,b){kd=Object.setPrototypeOf||
{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return kd(a,b)},$a=function(){$a=Object.assign||function(a){for(var b,c=1,e=arguments.length;c<e;c++){b=arguments[c];for(var f in b)Object.prototype.hasOwnProperty.call(b,f)&&(a[f]=b[f])}return a};return $a.apply(this,arguments)},$h=function(){function a(a){this._firstInit=!0;this.xterm=a;this._termSize={cols:this.xterm.cols,rows:this.xterm.rows};this._input=this._continuationPromptPrefix=
this._promptPrefix="";this._cursor=0}a.prototype._getAsyncRead=function(){var a=this,c,e;return{promise:new Promise(function(b,h){c=function(c){a._promptPrefix="";a._continuationPromptPrefix="";b(c)};e=h}),resolve:c,reject:e}};a.prototype.read=function(a,c){void 0===c&&(c="> ");0<a.length&&this.print(a);this._firstInit=!0;this._promptPrefix=a;this._continuationPromptPrefix=c;this._input="";this._cursor=0;return $a({promptPrefix:a,continuationPromptPrefix:c},this._getAsyncRead())};a.prototype.readChar=
function(a){0<a.length&&this.print(a);return $a({promptPrefix:a},this._getAsyncRead())};a.prototype.println=function(a){this.print(a+"\n")};a.prototype.print=function(a,c){var b=this;a=a.replace(/[\r\n]+/g,"\n").replace(/\n/g,"\r\n");c?(this.xterm._core.writeSync(a),this.xterm._core._renderService._renderer._runOperation(function(a){return a.onGridChanged(0,b.xterm.rows-1)})):this.xterm.write(a)};a.prototype.printWide=function(a,c){void 0===c&&(c=2);if(0===a.length)return this.println("");c=a.reduce(function(a,
b){return Math.max(a,b.length)},0)+c;for(var b=Math.floor(this._termSize.cols/c),f=Math.ceil(a.length/b),h=0,g=0;g<f;++g){for(var k="",q=0;q<b;++q)if(h<a.length){var t=a[h++];t+=" ".repeat(c-t.length);k+=t}this.println(k)}};a.prototype.printStatus=function(a,c){this.print("\u001b[s",c);this.print(a,c)};a.prototype.clearStatus=function(a){this.print("\u001b[u",a);this.print("\u001b[1000D",a);this.print("\u001b[0J",a)};a.prototype.applyPrompts=function(a){return this._promptPrefix+a.replace(/\n/g,"\n"+
this._continuationPromptPrefix)};a.prototype.applyPromptOffset=function(a,c){return this.applyPrompts(a.substr(0,c)).length};a.prototype.clearInput=function(){var a=this.applyPrompts(this._input),c=Sa(a,a.length,this._termSize.cols).row+1,e=this.applyPromptOffset(this._input,this._cursor);a=Sa(a,e,this._termSize.cols).row;a=c-a-1;for(e=0;e<a;++e)this.xterm.write("\u001b[E");this.xterm.write("\r\u001b[K");for(e=1;e<c;++e)this.xterm.write("\u001b[F\u001b[K")};a.prototype.clearTty=function(){this.xterm.write("\u001b[2J");
this.xterm.write("\u001b[0;0H");this._cursor=0};a.prototype.getFirstInit=function(){return this._firstInit};a.prototype.getPromptPrefix=function(){return this._promptPrefix};a.prototype.getContinuationPromptPrefix=function(){return this._continuationPromptPrefix};a.prototype.getTermSize=function(){return this._termSize};a.prototype.getInput=function(){return this._input};a.prototype.getCursor=function(){return this._cursor};a.prototype.getSize=function(){return this._termSize};a.prototype.getBuffer=
function(){return this.xterm.buffer};a.prototype.setInput=function(a,c){void 0===c&&(c=!1);c||this.clearInput();var b=this.applyPrompts(a);this.print(b);this._cursor>a.length&&(this._cursor=a.length);var f=this.applyPromptOffset(a,this._cursor);c=Sa(b,b.length,this._termSize.cols).row+1;f=Sa(b,f,this._termSize.cols);b=f.col;c=c-f.row-1;this.xterm.write("\r");for(f=0;f<c;++f)this.xterm.write("\u001b[F");for(f=0;f<b;++f)this.xterm.write("\u001b[C");this._input=a};a.prototype.setCursor=function(a){0>
a&&(a=0);a>this._input.length&&(a=this._input.length);this._writeCursorPosition(a)};a.prototype.setCursorDirectly=function(a){this._writeCursorPosition(a)};a.prototype._writeCursorPosition=function(a){var b=this.applyPrompts(this._input);Sa(b,b.length,this._termSize.cols);var e=this.applyPromptOffset(this._input,this._cursor),f=Sa(b,e,this._termSize.cols);e=f.col;f=f.row;var h=this.applyPromptOffset(this._input,a);h=Sa(b,h,this._termSize.cols);b=h.col;h=h.row;if(h>f)for(var g=f;g<h;++g)this.xterm.write("\u001b[B");
else for(g=h;g<f;++g)this.xterm.write("\u001b[A");if(b>e)for(g=e;g<b;++g)this.xterm.write("\u001b[C");else for(g=b;g<e;++g)this.xterm.write("\u001b[D");this._cursor=a};a.prototype.setTermSize=function(a,c){this._termSize={cols:a,rows:c}};a.prototype.setFirstInit=function(a){this._firstInit=a};a.prototype.setPromptPrefix=function(a){this._promptPrefix=a};a.prototype.setContinuationPromptPrefix=function(a){this._continuationPromptPrefix=a};return a}(),Ga="",Zf=0;4>Zf;Zf++)Ga+=(Math.pow(16,8)*Math.random()).toString(16);
var ff=function(a,b,c){a=mh(a,b,c);return"function"!==typeof b?a:a.reduce(function(a,b){if("object"===typeof b)return a.concat(b);b=b.split(RegExp("("+Ga+".*?"+Ga+")","g"));return 1===b.length?a.concat(b[0]):a.concat(b.filter(Boolean).map(function(a){return RegExp("^"+Ga).test(a)?JSON.parse(a.split(Ga)[1]):a}))},[])},ai=function(){function a(a){this.size=a;this.entries=[];this.cursor=0}a.prototype.push=function(a){""!==a.trim()&&a!==this.entries[this.entries.length-1]&&(this.entries.push(a),this.entries.length>
this.size&&this.entries.pop(),this.cursor=this.entries.length)};a.prototype.includes=function(a){return this.entries.includes(a)};a.prototype.rewind=function(){this.cursor=this.entries.length};a.prototype.getPrevious=function(){var a=Math.max(0,this.cursor-1);this.cursor=a;return this.entries[a]};a.prototype.getNext=function(){var a=Math.min(this.entries.length,this.cursor+1);this.cursor=a;return this.entries[a]};return a}();let kf=Symbol("Comlink.proxy"),th=Symbol("Comlink.endpoint"),sh=Symbol("Comlink.releaseProxy"),
nd=new WeakSet,lf=new Map([["proxy",{canHandle:a=>a&&a[kf],serialize(a){const {port1:b,port2:c}=new MessageChannel;gf(a,b);return[c,[c]]},deserialize:a=>{a.start();return dc(a,[],void 0)}}],["throw",{canHandle:a=>nd.has(a),serialize(a){const b=a instanceof Error;let c=a;b&&(c={isError:b,message:a.message,stack:a.stack});return[c,[]]},deserialize(a){if(a.isError)throw Object.assign(Error(),a);throw a;}}]]),jf=new WeakMap;var bi=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)},
di=function(a,b){if(a.map)return a.map(b);for(var c=[],e=0;e<a.length;e++){var f=a[e];ci.call(a,e)&&c.push(b(f,e,a))}return c},ci=Object.prototype.hasOwnProperty,ag=function(a,b){b?"string"==typeof b&&(b={startRule:b}):b={};return $f.parse(a,b)},$f=function(){function a(a,b,f,h,g,k){this.message=a;this.expected=b;this.found=f;this.offset=h;this.line=g;this.column=k;this.name="SyntaxError"}function b(c){function e(a){if(Fc!==a){Fc>a&&(Fc=0,Sb={line:1,column:1,seenCR:!1});var b=Sb,e;for(e=Fc;e<a;e++){var f=
c.charAt(e);"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}Fc=a}return Sb}function f(a){l<Db||(l>Db&&(Db=l,Ub=[]),Ub.push(a))}function h(){var a,b;var c=l;var e=[];var f=l;var h=[];for(a=C();a!==m;)h.push(a),a=C();if(h!==m)if(a=g(),a!==m){var k=[];for(b=C();b!==m;)k.push(b),b=C();k!==m?f=h=[h,a,k]:(l=f,f=w)}else l=f,f=w;else l=f,f=w;if(f!==m)for(;f!==m;){e.push(f);f=l;h=[];for(a=C();a!==m;)h.push(a),
a=C();if(h!==m)if(a=g(),a!==m){k=[];for(b=C();b!==m;)k.push(b),b=C();k!==m?f=h=[h,a,k]:(l=f,f=w)}else l=f,f=w;else l=f,f=w}else e=w;e!==m&&(K=c,e=W(e));return e}function g(){var a,b;y++;var c=l;var e=k();if(e!==m){var g=[];var h=l;var n=[];for(a=M();a!==m;)n.push(a),a=M();if(n!==m)if(a=q(),a!==m){var p=[];for(b=C();b!==m;)p.push(b),b=C();p!==m?(b=k(),b!==m?h=n=[n,a,p,b]:(l=h,h=w)):(l=h,h=w)}else l=h,h=w;else l=h,h=w;for(;h!==m;){g.push(h);h=l;n=[];for(a=M();a!==m;)n.push(a),a=M();if(n!==m)if(a=q(),
a!==m){p=[];for(b=C();b!==m;)p.push(b),b=C();p!==m?(b=k(),b!==m?h=n=[n,a,p,b]:(l=h,h=w)):(l=h,h=w)}else l=h,h=w;else l=h,h=w}if(g!==m){h=l;n=[];for(a=M();a!==m;)n.push(a),a=M();n!==m?(a=q(),a!==m?h=n=[n,a]:(l=h,h=w)):(l=h,h=w);h===m&&(h=S);h!==m?(K=c,c=e=aa(e,g)):(l=c,c=w)}else l=c,c=w}else l=c,c=w;y--;c===m&&0===y&&f(Z);return c}function k(){var a=l;var b=t();if(b===m&&(b=n(),b===m)){var e;var g=l;c.substr(l,5)===fa?(b=fa,l+=5):(b=m,0===y&&f(ra));b===m&&(c.substr(l,5)===ja?(b=ja,l+=5):(b=m,0===y&&
f(ua)));if(b!==m){var r=[];var q=C();if(q!==m)for(;q!==m;)r.push(q),q=C();else r=w;if(r!==m)if(q=v(),q!==m){r=[];for(e=C();e!==m;)r.push(e),e=C();r!==m?(c.substr(l,2)===ha?(e=ha,l+=2):(e=m,0===y&&f(va)),e!==m?(r=C(),r!==m?(r=h(),r!==m?(c.substr(l,4)===la?(e=la,l+=4):(e=m,0===y&&f(ya)),e!==m?(K=g,g=b={type:b+"-loop",test:q,body:r}):(l=g,g=w)):(l=g,g=w)):(l=g,g=w)):(l=g,g=w)):(l=g,g=w)}else l=g,g=w;else l=g,g=w}else l=g,g=w;b=g;if(b===m){g=l;c.substr(l,2)===Ea?(b=Ea,l+=2):(b=m,0===y&&f(za));if(b!==
m){q=[];b=C();if(b!==m)for(;b!==m;)q.push(b),b=C();else q=w;if(q!==m)if(b=h(),b!==m)if(c.substr(l,4)===da?(q=da,l+=4):(q=m,0===y&&f(ta)),q!==m){r=[];q=C();if(q!==m)for(;q!==m;)r.push(q),q=C();else r=w;if(r!==m)if(q=h(),q!==m){r=[];for(e=p();e!==m;)r.push(e),e=p();if(r!==m){e=l;if(c.substr(l,4)===pa){var B=pa;l+=4}else B=m,0===y&&f(Ia);if(B!==m){var X=h();X!==m?e=B=[B,X]:(l=e,e=w)}else l=e,e=w;e===m&&(e=S);e!==m?(c.substr(l,2)===Aa?(B=Aa,l+=2):(B=m,0===y&&f(Na)),B!==m?(K=g,g=b={type:"ifElse",test:b,
body:q,elifBlocks:r.length?r:null,elseBody:e?e[1]:null}):(l=g,g=w)):(l=g,g=w)}else l=g,g=w}else l=g,g=w;else l=g,g=w}else l=g,g=w;else l=g,g=w;else l=g,g=w}else l=g,g=w;b=g}}if(b!==m){g=l;q=[];for(r=M();r!==m;)q.push(r),r=M();if(q!==m){r=l;c.substr(l,2)===Y?(e=Y,l+=2):(e=m,0===y&&f(ba));e===m&&(c.substr(l,2)===ca?(e=ca,l+=2):(e=m,0===y&&f(ea)));if(e!==m){B=[];for(X=C();X!==m;)B.push(X),X=C();B!==m?(X=k(),X!==m?(K=r,r=e=[e,X]):(l=r,r=w)):(l=r,r=w)}else l=r,r=w;r!==m?g=q=[q,r]:(l=g,g=w)}else l=g,g=
w;g===m&&(g=S);g!==m?(K=a,a=b,"undefined"!==typeof g&&g?(g=g[1],a.control=g[0],a.next=g[1]):(a.control=";",a.next=null)):(l=a,a=w)}else l=a,a=w;return a}function q(){var a=l;if(38===c.charCodeAt(l)){var b=ia;l++}else b=m,0===y&&f(ka);b===m&&(59===c.charCodeAt(l)?(b=ma,l++):(b=m,0===y&&f(na)),b===m&&(10===c.charCodeAt(l)?(b=oa,l++):(b=m,0===y&&f(qa))));b!==m&&(K=a,b="\n"==b?";":b);return b}function t(){y++;var a=l;var b=[];var e=l;var g=n();g===m&&(g=mb());if(g!==m){var h=[];var k=M();if(k!==m)for(;k!==
m;)h.push(k),k=M();else h=w;h!==m?e=g=[g,h]:(l=e,e=w)}else l=e,e=w;for(;e!==m;)if(b.push(e),e=l,g=n(),g===m&&(g=mb()),g!==m){h=[];k=M();if(k!==m)for(;k!==m;)h.push(k),k=M();else h=w;h!==m?e=g=[g,h]:(l=e,e=w)}else l=e,e=w;if(b!==m)if(e=r(),e===m&&(e=x()),e!==m){g=[];h=l;k=[];var p=M();if(p!==m)for(;p!==m;)k.push(p),p=M();else k=w;k!==m?(p=mb(),p===m&&(p=u()),p!==m?h=k=[k,p]:(l=h,h=w)):(l=h,h=w);for(;h!==m;){g.push(h);h=l;k=[];p=M();if(p!==m)for(;p!==m;)k.push(p),p=M();else k=w;k!==m?(p=mb(),p===m&&
(p=u()),p!==m?h=k=[k,p]:(l=h,h=w)):(l=h,h=w)}if(g!==m){h=l;k=[];for(p=M();p!==m;)k.push(p),p=M();if(k!==m){var q;p=l;if(124===c.charCodeAt(l)){var B=jc;l++}else B=m,0===y&&f(kc);if(B!==m){B=[];for(q=C();q!==m;)B.push(q),q=C();B!==m?(q=t(),q!==m?(K=p,p=B={type:"pipe",command:q}):(l=p,p=w)):(l=p,p=w)}else l=p,p=w;p!==m?h=k=[k,p]:(l=h,h=w)}else l=h,h=w;h===m&&(h=S);h!==m?(K=a,a=b=xa(b,e,g,h)):(l=a,a=w)}else l=a,a=w}else l=a,a=w;else l=a,a=w;y--;a===m&&0===y&&f(wa);return a}function p(){var a=l;if(c.substr(l,
4)===Ca){var b=Ca;l+=4}else b=m,0===y&&f(Oa);if(b!==m){var e=[];b=C();if(b!==m)for(;b!==m;)e.push(b),b=C();else e=w;if(e!==m)if(b=v(),b!==m)if(c.substr(l,4)===da?(e=da,l+=4):(e=m,0===y&&f(ta)),e!==m){e=[];var g=C();if(g!==m)for(;g!==m;)e.push(g),g=C();else e=w;e!==m?(g=h(),g!==m?(K=a,a=b={type:"ifElse",test:b,body:g}):(l=a,a=w)):(l=a,a=w)}else l=a,a=w;else l=a,a=w;else l=a,a=w}else l=a,a=w;return a}function v(){var a=l;var b=h();b!==m&&(K=a);return b}function n(){var a=l;var b=Wa();if(b!==m){if(61===
c.charCodeAt(l)){var e=ib;l++}else e=m,0===y&&f(jb);e!==m?(e=u(),e!==m?(K=a,a=b={type:"variableAssignment",name:b,value:e}):(l=a,a=w)):(l=a,a=w)}else l=a,a=w;return a}function r(){var a;y++;var b=a=l;y++;var c=mb();y--;c===m?b=Za:(l=b,b=w);if(b!==m)if(c=l,y++,b=L(),y--,b===m?c=Za:(l=c,c=w),c!==m)if(b=l,y++,c=n(),y--,c===m?b=Za:(l=b,b=w),b!==m){c=l;b=[];var e=F();e===m&&(e=z(),e===m&&(e=T(),e===m&&(e=ic(),e===m&&(e=Ba(),e===m&&(e=B(),e===m&&(e=X()))))));if(e!==m)for(;e!==m;)b.push(e),e=F(),e===m&&
(e=z(),e===m&&(e=T(),e===m&&(e=ic(),e===m&&(e=Ba(),e===m&&(e=B(),e===m&&(e=X()))))));else b=w;b!==m&&(K=c,b=P(b));c=b;c===m&&(c=x());c!==m?(K=a,a=c):(l=a,a=w)}else l=a,a=w;else l=a,a=w;else l=a,a=w;y--;a===m&&0===y&&f(kb);return a}function x(){if(91===c.charCodeAt(l)){var a=Xa;l++}else a=m,0===y&&f($a);a===m&&(c.substr(l,2)===Fa?(a=Fa,l+=2):(a=m,0===y&&f(ab)));return a}function u(){y++;var a=r();if(a===m){a=l;if(ac.test(c.charAt(l))){var b=c.charAt(l);l++}else b=m,0===y&&f(bc);if(b!==m){if(40===c.charCodeAt(l)){var e=
Ob;l++}else e=m,0===y&&f(Rb);if(e!==m)if(e=g(),e!==m){if(41===c.charCodeAt(l)){var h=Kb;l++}else h=m,0===y&&f(Lb);h!==m?(K=a,a=b={type:"processSubstitution",readWrite:b,commands:e}):(l=a,a=w)}else l=a,a=w;else l=a,a=w}else l=a,a=w}y--;a===m&&0===y&&f(pb);return a}function z(){var a=l;var b=[];var c=A();if(c!==m)for(;c!==m;)b.push(c),c=A();else b=w;b!==m&&(K=a,b=N(b));return b}function A(){var a=l;if(92===c.charCodeAt(l)){var b=cb;l++}else b=m,0===y&&f(db);if(b!==m){var e=E();e!==m?(K=a,a=e):(l=a,
a=w)}else l=a,a=w;a===m&&(b=a=l,y++,e=E(),y--,e===m?b=Za:(l=b,b=w),b!==m?(c.length>l?(e=c.charAt(l),l++):(e=m,0===y&&f(Cb)),e!==m?(K=a,a=e):(l=a,a=w)):(l=a,a=w));return a}function E(){if(sb.test(c.charAt(l))){var a=c.charAt(l);l++}else a=m,0===y&&f(tb);return a}function F(){var a;var b=l;var e=[];for(a=A();a!==m;)e.push(a),a=A();if(e!==m){a=[];42===c.charCodeAt(l)?(e=eb,l++):(e=m,0===y&&f(fb));e===m&&(63===c.charCodeAt(l)?(e=Pa,l++):(e=m,0===y&&f(Sa)),e===m&&(e=I(),e===m&&(e=J())));if(e!==m)for(;e!==
m;)a.push(e),42===c.charCodeAt(l)?(e=eb,l++):(e=m,0===y&&f(fb)),e===m&&(63===c.charCodeAt(l)?(e=Pa,l++):(e=m,0===y&&f(Sa)),e===m&&(e=I(),e===m&&(e=J())));else a=w;if(a!==m){e=[];for(a=A();a!==m;)e.push(a),a=A();e!==m?(K=b,b=e={type:"glob",value:c.substring(K,l)}):(l=b,b=w)}else l=b,b=w}else l=b,b=w;return b}function I(){var a;var b=a=l;if(91===c.charCodeAt(l)){var e=Xa;l++}else e=m,0===y&&f($a);if(e!==m){var g=l;y++;if(45===c.charCodeAt(l)){var h=Ga;l++}else h=m,0===y&&f(Ha);y--;h===m?g=Za:(l=g,g=
w);if(g!==m)if(c.length>l?(h=c.charAt(l),l++):(h=m,0===y&&f(Cb)),h!==m){if(45===c.charCodeAt(l)){var k=Ga;l++}else k=m,0===y&&f(Ha);if(k!==m){var n=l;y++;if(45===c.charCodeAt(l)){var p=Ga;l++}else p=m,0===y&&f(Ha);y--;p===m?n=Za:(l=n,n=w);if(n!==m)if(c.length>l?(p=c.charAt(l),l++):(p=m,0===y&&f(Cb)),p!==m){if(93===c.charCodeAt(l)){var r=wb;l++}else r=m,0===y&&f(yb);r!==m?b=e=[e,g,h,k,n,p,r]:(l=b,b=w)}else l=b,b=w;else l=b,b=w}else l=b,b=w}else l=b,b=w;else l=b,b=w}else l=b,b=w;b!==m&&(b=c.substring(a,
l));return b}function J(){var a;var b=a=l;if(c.length>l){var e=c.charAt(l);l++}else e=m,0===y&&f(Cb);e===m&&(e=S);if(e!==m){var g=l;y++;if(36===c.charCodeAt(l)){var h=Ua;l++}else h=m,0===y&&f(Va);y--;h===m?g=Za:(l=g,g=w);g!==m?b=e=[e,g]:(l=b,b=w)}else l=b,b=w;if(b!==m)if(123===c.charCodeAt(l)?(e=Bb,l++):(e=m,0===y&&f(Fb)),e!==m){g=[];h=A();if(h!==m)for(;h!==m;)g.push(h),h=A();else g=w;g!==m?(125===c.charCodeAt(l)?(h=qb,l++):(h=m,0===y&&f(rb)),h!==m?a=b=[b,e,g,h]:(l=a,a=w)):(l=a,a=w)}else l=a,a=w;
else l=a,a=w;return a}function B(){var a=l;if(39===c.charCodeAt(l)){var b=gb;l++}else b=m,0===y&&f(hb);if(b!==m){b=l;var e=[];if(ub.test(c.charAt(l))){var g=c.charAt(l);l++}else g=m,0===y&&f(vb);for(;g!==m;)e.push(g),ub.test(c.charAt(l))?(g=c.charAt(l),l++):(g=m,0===y&&f(vb));e!==m&&(e=c.substring(b,l));b=e;b!==m?(39===c.charCodeAt(l)?(e=gb,l++):(e=m,0===y&&f(hb)),e!==m?(K=a,a=b=N(b)):(l=a,a=w)):(l=a,a=w)}else l=a,a=w;return a}function X(){var a=l;if(34===c.charCodeAt(l)){var b=Qa;l++}else b=m,0===
y&&f(Ra);if(b!==m){b=[];var e=Ac();if(e===m){e=[];var g=Ma();if(g!==m)for(;g!==m;)e.push(g),g=Ma();else e=w}for(;e!==m;)if(b.push(e),e=Ac(),e===m)if(e=[],g=Ma(),g!==m)for(;g!==m;)e.push(g),g=Ma();else e=w;b!==m?(34===c.charCodeAt(l)?(e=Qa,l++):(e=m,0===y&&f(Ra)),e!==m?(K=a,a=b=Nb(b)):(l=a,a=w)):(l=a,a=w)}else l=a,a=w;return a}function Ma(){var a=l;if(92===c.charCodeAt(l)){var b=cb;l++}else b=m,0===y&&f(db);if(b!==m){var e=sa();e!==m?(K=a,a=e):(l=a,a=w)}else l=a,a=w;a===m&&(a=l,c.substr(l,2)===Ta?
(b=Ta,l+=2):(b=m,0===y&&f(xb)),b!==m&&(K=a,b="\\"),a=b,a===m&&(b=a=l,y++,e=sa(),y--,e===m?b=Za:(l=b,b=w),b!==m?(c.length>l?(e=c.charAt(l),l++):(e=m,0===y&&f(Cb)),e!==m?(K=a,a=e):(l=a,a=w)):(l=a,a=w)));return a}function sa(){if(34===c.charCodeAt(l)){var a=Qa;l++}else a=m,0===y&&f(Ra);a===m&&(36===c.charCodeAt(l)?(a=Ua,l++):(a=m,0===y&&f(Va)),a===m&&(96===c.charCodeAt(l)?(a=Ja,l++):(a=m,0===y&&f(Ka))));return a}function Ac(){var a=Ba();a===m&&(a=T(),a===m&&(a=ic()));return a}function T(){var a=l;if(36===
c.charCodeAt(l)){var b=Ua;l++}else b=m,0===y&&f(Va);b!==m?(b=Wa(),b===m&&(63===c.charCodeAt(l)?(b=Pa,l++):(b=m,0===y&&f(Sa))),b!==m?(K=a,a=b={type:"variable",name:b}):(l=a,a=w)):(l=a,a=w);return a}function Wa(){var a=l;var b=[];if(zb.test(c.charAt(l))){var e=c.charAt(l);l++}else e=m,0===y&&f(Ab);if(e!==m)for(;e!==m;)b.push(e),zb.test(c.charAt(l))?(e=c.charAt(l),l++):(e=m,0===y&&f(Ab));else b=w;b!==m&&(K=a,b=c.substring(K,l));return b}function ic(){var a=l;if(c.substr(l,2)===Ya){var b=Ya;l+=2}else b=
m,0===y&&f(Eb);if(b!==m){b=[];if(Gb.test(c.charAt(l))){var e=c.charAt(l);l++}else e=m,0===y&&f(Hb);for(;e!==m;)b.push(e),Gb.test(c.charAt(l))?(e=c.charAt(l),l++):(e=m,0===y&&f(Hb));b!==m?(125===c.charCodeAt(l)?(e=qb,l++):(e=m,0===y&&f(rb)),e!==m?(K=a,a=b={type:"variableSubstitution",expression:b.join("")}):(l=a,a=w)):(l=a,a=w)}else l=a,a=w;return a}function Ba(){var a=l;if(c.substr(l,2)===bb){var e=bb;l+=2}else e=m,0===y&&f(Jb);if(e!==m)if(e=g(),e!==m){if(41===c.charCodeAt(l)){var h=Kb;l++}else h=
m,0===y&&f(Lb);h!==m?(K=a,a=e={type:"commandSubstitution",commands:e}):(l=a,a=w)}else l=a,a=w;else l=a,a=w;if(a===m)if(a=l,96===c.charCodeAt(l)?(e=Ja,l++):(e=m,0===y&&f(Ka)),e!==m){e=[];h=lb();if(h!==m)for(;h!==m;)e.push(h),h=lb();else e=w;e!==m?(96===c.charCodeAt(l)?(h=Ja,l++):(h=m,0===y&&f(Ka)),h!==m?(K=a,a=e={type:"commandSubstitution",commands:b(e.join(""))}):(l=a,a=w)):(l=a,a=w)}else l=a,a=w;return a}function lb(){var a=l;if(c.substr(l,2)===Mb){var b=Mb;l+=2}else b=m,0===y&&f($b);b!==m&&(K=a,
b="`");a=b;if(a===m&&(a=l,c.substr(l,2)===Ta?(b=Ta,l+=2):(b=m,0===y&&f(xb)),b!==m&&(K=a,b="\\"),a=b,a===m)){b=a=l;y++;if(96===c.charCodeAt(l)){var e=Ja;l++}else e=m,0===y&&f(Ka);y--;e===m?b=Za:(l=b,b=w);b!==m?(c.length>l?(e=c.charAt(l),l++):(e=m,0===y&&f(Cb)),e!==m?(K=a,a=e):(l=a,a=w)):(l=a,a=w)}return a}function mb(){var a=l;var b=G();b===m&&(b=S);if(b!==m){if(c.substr(l,2)===nb){var e=nb;l+=2}else e=m,0===y&&f(Tb);e===m&&(c.substr(l,2)===ob?(e=ob,l+=2):(e=m,0===y&&f(Wb)));if(e!==m){var g=G();if(g!==
m){if(45===c.charCodeAt(l)){var h=Ga;l++}else h=m,0===y&&f(Ha);h!==m?(K=a,a=b,null==a&&(a="<"==e[0]?0:1),a=b={type:"moveFd",fd:a,op:e,dest:g}):(l=a,a=w)}else l=a,a=w}else l=a,a=w}else l=a,a=w;e=a;if(e===m){a=l;b=G();b===m&&(b=S);if(b!==m)if(c.substr(l,2)===nb?(e=nb,l+=2):(e=m,0===y&&f(Tb)),e===m&&(c.substr(l,2)===ob?(e=ob,l+=2):(e=m,0===y&&f(Wb))),e!==m){h=[];for(g=M();g!==m;)h.push(g),g=M();h!==m?(g=G(),g!==m?(K=a,a=b,null==a&&(a="<"==e[0]?0:1),a=b={type:"duplicateFd",srcFd:a,op:e,destFd:g}):(l=
a,a=w)):(l=a,a=w)}else l=a,a=w;else l=a,a=w;e=a;if(e===m)if(e=l,g=G(),g===m&&(g=S),g!==m)if(60===c.charCodeAt(l)?(a=mc,l++):(a=m,0===y&&f(nc)),a===m&&(62===c.charCodeAt(l)?(a=oc,l++):(a=m,0===y&&f(pc)),a===m&&(c.substr(l,2)===Xb?(a=Xb,l+=2):(a=m,0===y&&f(qc)),a===m&&(c.substr(l,2)===Yb?(a=Yb,l+=2):(a=m,0===y&&f(rc)),a===m&&(c.substr(l,2)===Zb?(a=Zb,l+=2):(a=m,0===y&&f(sc)),a===m&&(c.substr(l,3)===cc?(a=cc,l+=3):(a=m,0===y&&f(tc))))))),a!==m){h=[];for(b=M();b!==m;)h.push(b),b=M();h!==m?(b=u(),b!==
m?(K=e,e=g,null==e&&(e="<"==a[0]?0:1),e=g={type:"redirectFd",fd:e,op:a,filename:b}):(l=e,e=w)):(l=e,e=w)}else l=e,e=w;else l=e,e=w}return e}function G(){var a=l;var b=[];if(dc.test(c.charAt(l))){var e=c.charAt(l);l++}else e=m,0===y&&f(ec);if(e!==m)for(;e!==m;)b.push(e),dc.test(c.charAt(l))?(e=c.charAt(l),l++):(e=m,0===y&&f(ec));else b=w;b!==m&&(K=a,b=parseInt(b.join(""),10));return b}function M(){if(32===c.charCodeAt(l)){var a=uc;l++}else a=m,0===y&&f(vc);a===m&&(9===c.charCodeAt(l)?(a=wc,l++):(a=
m,0===y&&f(xc)));return a}function C(){var a=M();a===m&&(10===c.charCodeAt(l)?(a=oa,l++):(a=m,0===y&&f(qa)));return a}function L(){var a=l;if(c.substr(l,5)===fa){var b=fa;l+=5}else b=m,0===y&&f(ra);b===m&&(c.substr(l,5)===ja?(b=ja,l+=5):(b=m,0===y&&f(ua)),b===m&&(c.substr(l,3)===fc?(b=fc,l+=3):(b=m,0===y&&f(yc)),b===m&&(c.substr(l,4)===la?(b=la,l+=4):(b=m,0===y&&f(ya)),b===m&&(c.substr(l,2)===ha?(b=ha,l+=2):(b=m,0===y&&f(va)),b===m&&(c.substr(l,4)===gc?(b=gc,l+=4):(b=m,0===y&&f(zc)),b===m&&(c.substr(l,
4)===hc?(b=hc,l+=4):(b=m,0===y&&f(Cc)),b===m&&(c.substr(l,2)===Ea?(b=Ea,l+=2):(b=m,0===y&&f(za)),b===m&&(c.substr(l,4)===da?(b=da,l+=4):(b=m,0===y&&f(ta)),b===m&&(c.substr(l,4)===pa?(b=pa,l+=4):(b=m,0===y&&f(Ia)),b===m&&(c.substr(l,4)===Ca?(b=Ca,l+=4):(b=m,0===y&&f(Oa)),b===m&&(c.substr(l,2)===Aa?(b=Aa,l+=2):(b=m,0===y&&f(Na)),b===m&&(c.substr(l,2)===Fa?(b=Fa,l+=2):(b=m,0===y&&f(ab))))))))))))));if(b!==m){var e=[];var g=C();if(g!==m)for(;g!==m;)e.push(g),g=C();else e=w;e===m&&(e=l,y++,c.length>l?
(g=c.charAt(l),l++):(g=m,0===y&&f(Cb)),y--,g===m?e=Za:(l=e,e=w));e!==m?a=b=[b,e]:(l=a,a=w)}else l=a,a=w;return a}function N(a){return{type:"literal",value:lc(a)?a.join(""):a}}function O(a){return a[0]}function R(a){return a[1]}function P(a){for(var b=[a[0]],c=a.length,e=a[0],f,g=1;g<c;g++)f=a[g],"concatenation"==f.type&&(f=P(f.pieces)),"concatenation"==f.type?b=b.concat(f.pieces):"literal"!=f.type&&"glob"!=f.type||"literal"!=e.type&&"glob"!=e.type?(b.push(f),e=f):(e.value+=f.value,"glob"!=e.type&&
"glob"==f.type&&(e.type="glob"));return 1==b.length?b[0]:{type:"concatenation",pieces:b}}var Q=1<arguments.length?arguments[1]:{},m={},U={script:h,command:t,argument:u,continuationStart:function(){var a;var b=a=l;y++;var e=L();e===m&&(34===c.charCodeAt(l)?(e=Qa,l++):(e=m,0===y&&f(Ra)),e===m&&(39===c.charCodeAt(l)?(e=gb,l++):(e=m,0===y&&f(hb)),e===m&&(96===c.charCodeAt(l)?(e=Ja,l++):(e=m,0===y&&f(Ka)),e===m&&(c.substr(l,2)===bb?(e=bb,l+=2):(e=m,0===y&&f(Jb)),e===m&&(c.substr(l,2)===Ya?(e=Ya,l+=2):
(e=m,0===y&&f(Eb)),e===m&&(40===c.charCodeAt(l)?(e=Ob,l++):(e=m,0===y&&f(Rb))))))));y--;e!==m?(l=b,b=Za):b=w;if(b!==m){e=[];if(c.length>l){var g=c.charAt(l);l++}else g=m,0===y&&f(Cb);for(;g!==m;)e.push(g),c.length>l?(g=c.charAt(l),l++):(g=m,0===y&&f(Cb));e!==m?a=b=[b,e]:(l=a,a=w)}else l=a,a=w;return a}},V=h,w=m,W=function(a){var b=[];Ib(a,function(a){b=b.concat(a[1])});return b},Z={type:"other",description:"a list of statements"},S=null,aa=function(a,b,c){var e=[a],f=a;Ib(b,function(a,b,c){for(b=
f;b.next;)b=b.next;b.control=a[1];e.push(f=a[3])});return e},Y="&&",ba={type:"literal",value:"&&",description:'"&&"'},ca="||",ea={type:"literal",value:"||",description:'"||"'},ia="&",ka={type:"literal",value:"&",description:'"&"'},ma=";",na={type:"literal",value:";",description:'";"'},oa="\n",qa={type:"literal",value:"\n",description:'"\\n"'},wa={type:"other",description:"a single command"},xa=function(a,b,c,e){var f={type:"command",command:b,args:[],redirects:[],env:{},control:";",next:null};Ib(a,
O).concat(Ib(c,R)).forEach(function(a){if(a&&a.type)switch(a.type){case "moveFd":case "duplicateFd":case "redirectFd":return f.redirects.push(a);case "variableAssignment":return f.env[a.name]=a.value;default:f.args.push(a)}});e&&f.redirects.push(e[1]);return f},fa="while",ra={type:"literal",value:"while",description:'"while"'},ja="until",ua={type:"literal",value:"until",description:'"until"'},ha="do",va={type:"literal",value:"do",description:'"do"'},la="done",ya={type:"literal",value:"done",description:'"done"'},
Ea="if",za={type:"literal",value:"if",description:'"if"'},da="then",ta={type:"literal",value:"then",description:'"then"'},pa="else",Ia={type:"literal",value:"else",description:'"else"'},Aa="fi",Na={type:"literal",value:"fi",description:'"fi"'},Ca="elif",Oa={type:"literal",value:"elif",description:'"elif"'},ib="=",jb={type:"literal",value:"=",description:'"="'},kb={type:"other",description:"command name"},Za=void 0,Xa="[",$a={type:"literal",value:"[",description:'"["'},Fa="[[",ab={type:"literal",value:"[[",
description:'"[["'},pb={type:"other",description:"command argument"},cb="\\",db={type:"literal",value:"\\",description:'"\\\\"'},Cb={type:"any",description:"any character"},sb=/^[$"';&<>\n()[*?|` ]/,tb={type:"class",value:"[$\"';&<>\\n()[*?|` ]",description:"[$\"';&<>\\n()[*?|` ]"},eb="*",fb={type:"literal",value:"*",description:'"*"'},Pa="?",Sa={type:"literal",value:"?",description:'"?"'},Ga="-",Ha={type:"literal",value:"-",description:'"-"'},wb="]",yb={type:"literal",value:"]",description:'"]"'},
Ua="$",Va={type:"literal",value:"$",description:'"$"'},Bb="{",Fb={type:"literal",value:"{",description:'"{"'},qb="}",rb={type:"literal",value:"}",description:'"}"'},gb="'",hb={type:"literal",value:"'",description:'"\'"'},ub=/^[^']/,vb={type:"class",value:"[^']",description:"[^']"},Qa='"',Ra={type:"literal",value:'"',description:'"\\""'},Nb=function(a){a=a.map(function(a){return lc(a)?N(a):a});return P(a)},Ta="\\\\",xb={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},Ja="`",Ka={type:"literal",
value:"`",description:'"`"'},zb=/^[a-zA-Z0-9_]/,Ab={type:"class",value:"[a-zA-Z0-9_]",description:"[a-zA-Z0-9_]"},Ya="${",Eb={type:"literal",value:"${",description:'"${"'},Gb=/^[^}]/,Hb={type:"class",value:"[^}]",description:"[^}]"},bb="$(",Jb={type:"literal",value:"$(",description:'"$("'},Kb=")",Lb={type:"literal",value:")",description:'")"'},Mb="\\`",$b={type:"literal",value:"\\`",description:'"\\\\`"'},ac=/^[<>]/,bc={type:"class",value:"[<>]",description:"[<>]"},Ob="(",Rb={type:"literal",value:"(",
description:'"("'},jc="|",kc={type:"literal",value:"|",description:'"|"'},nb="<&",Tb={type:"literal",value:"<&",description:'"<&"'},ob=">&",Wb={type:"literal",value:">&",description:'">&"'},mc="<",nc={type:"literal",value:"<",description:'"<"'},oc=">",pc={type:"literal",value:">",description:'">"'},Xb=">|",qc={type:"literal",value:">|",description:'">|"'},Yb="&>",rc={type:"literal",value:"&>",description:'"&>"'},Zb=">>",sc={type:"literal",value:">>",description:'">>"'},cc="&>>",tc={type:"literal",
value:"&>>",description:'"&>>"'},dc=/^[0-9]/,ec={type:"class",value:"[0-9]",description:"[0-9]"},uc=" ",vc={type:"literal",value:" ",description:'" "'},wc="\t",xc={type:"literal",value:"\t",description:'"\\t"'},fc="for",yc={type:"literal",value:"for",description:'"for"'},gc="case",zc={type:"literal",value:"case",description:'"case"'},hc="esac",Cc={type:"literal",value:"esac",description:'"esac"'},l=0,K=0,Fc=0,Sb={line:1,column:1,seenCR:!1},Db=0,Ub=[],y=0;if("startRule"in Q){if(!(Q.startRule in U))throw Error("Can't start parsing from rule \""+
Q.startRule+'".');V=U[Q.startRule]}var lc=bi,Ib=di;var Vb=V();if(Vb!==m&&l===c.length)return Vb;Vb!==m&&l<c.length&&f({type:"end",description:"end of input"});throw function(b,f,g){function h(a){var b=1;for(a.sort(function(a,b){return a.description<b.description?-1:a.description>b.description?1:0});b<a.length;)a[b-1]===a[b]?a.splice(b,1):b++}function k(a,b){function c(a){function b(a){return a.charCodeAt(0).toString(16).toUpperCase()}return a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,
"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(a){return"\\x0"+b(a)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(a){return"\\x"+b(a)}).replace(/[\u0180-\u0FFF]/g,function(a){return"\\u0"+b(a)}).replace(/[\u1080-\uFFFF]/g,function(a){return"\\u"+b(a)})}var e=Array(a.length),f;for(f=0;f<a.length;f++)e[f]=a[f].description;a=1<a.length?e.slice(0,-1).join(", ")+" or "+e[a.length-1]:e[0];b=b?'"'+c(b)+'"':"end of input";
return"Expected "+a+" but "+b+" found."}var l=e(g),n=g<c.length?c.charAt(g):null;null!==f&&h(f);return new a(null!==b?b:k(f,n),f,n,g,l.line,l.column)}(null,Ub,Db);}(function(a,b){function c(){this.constructor=a}c.prototype=b.prototype;a.prototype=new c})(a,Error);return{SyntaxError:a,parse:b}}();ag.SyntaxError=$f.SyntaxError;var Cc=void 0;"object"===typeof window?Cc=window.TextDecoder:"object"===typeof self?Cc=self.TextDecoder:"function"===typeof require&&(Cc=require("util").TextDecoder);var ei=function(){function a(a){this.wasmFs=
a;this.wasmFs.volume.mkdirSync("/_wasmer/dev/fb0",{recursive:!0});this.wasmFs.volume.writeFileSync("/_wasmer/dev/fb0/fb","");this.wasmFs.volume.writeFileSync("/_wasmer/dev/fb0/virtual_size","");this.wasmFs.volume.writeFileSync("/_wasmer/dev/fb0/draw","");this.wasmFs.volume.writeFileSync("/_wasmer/dev/fb0/input","");this.windowSizeCallback=function(){};this.bufferIndexDisplayCallback=function(){};this.inputCallback=function(){return new Uint8Array};this.fdFrameBuffer=this.wasmFs.volume.openSync("/_wasmer/dev/fb0/fb",
"w+");this.fdBufferIndexDisplay=this.wasmFs.volume.openSync("/_wasmer/dev/fb0/draw","w+");this.fdWindowSize=this.wasmFs.fs.openSync("/_wasmer/dev/fb0/virtual_size","w+");this.fdInput=this.wasmFs.volume.openSync("/_wasmer/dev/fb0/input","w+");var b=this,e=this.wasmFs.volume.fds[this.fdInput].node.read;this.wasmFs.volume.fds[this.fdInput].node.read=function(){var a=b.inputCallback();b.wasmFs.volume.writeFileSync("/_wasmer/dev/fb0/input",a);a=Array.prototype.slice.call(arguments);return e.apply(b.wasmFs.volume.fds[b.fdInput].node,
a)};var f=this.wasmFs.volume.fds[this.fdWindowSize].node.write;this.wasmFs.volume.fds[this.fdWindowSize].node.write=function(){var a=Array.prototype.slice.call(arguments);a=f.apply(b.wasmFs.volume.fds[b.fdWindowSize].node,a);b.windowSizeCallback();return a};var h=this.wasmFs.volume.fds[this.fdBufferIndexDisplay].node.write;this.wasmFs.volume.fds[this.fdBufferIndexDisplay].node.write=function(){var a=Array.prototype.slice.call(arguments);a=h.apply(b.wasmFs.volume.fds[b.fdBufferIndexDisplay].node,a);
b.bufferIndexDisplayCallback();return a}}a.prototype.getFrameBuffer=function(){return this.wasmFs.fs.readFileSync("/_wasmer/dev/fb0/fb")};a.prototype.getWindowSize=function(){var a=this.wasmFs.fs.readFileSync("/_wasmer/dev/fb0/virtual_size");return 0<a.length?(a=(new Cc("utf-8")).decode(a).split("x"),[parseInt(a[0],10),parseInt(a[1],10)]):[0,0]};a.prototype.setWindowSizeCallback=function(a){this.windowSizeCallback=a};a.prototype.setBufferIndexDisplayCallback=function(a){this.bufferIndexDisplayCallback=
a};a.prototype.setInputCallback=function(a){this.inputCallback=a};return a}(),fi="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof za?za:{},A="undefined"!==typeof BigInt?BigInt:fi.BigInt||Number,Sb=DataView;Sb.prototype.setBigUint64||(Sb.prototype.setBigUint64=function(a,b,c){if(b<Math.pow(2,32)){b=Number(b);var e=0}else{e=b.toString(2);b="";for(var f=0;f<64-e.length;f++)b+="0";b+=e;e=parseInt(b.substring(0,32),2);b=parseInt(b.substring(32),2)}this.setUint32(a+(c?0:4),b,c);this.setUint32(a+
(c?4:0),e,c)},Sb.prototype.getBigUint64=function(a,b){var c=this.getUint32(a+(b?0:4),b);a=this.getUint32(a+(b?4:0),b);c=c.toString(2);a=a.toString(2);b="";for(var e=0;e<32-c.length;e++)b+="0";return A("0b"+a+(b+c))});var Tb="undefined"!==typeof za?za:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{},fa=[],ma=[],zh="undefined"!==typeof Uint8Array?Uint8Array:Array,rd=!1,gi={}.toString,rf=Array.isArray||function(a){return"[object Array]"==gi.call(a)};z.TYPED_ARRAY_SUPPORT=void 0!==
Tb.TYPED_ARRAY_SUPPORT?Tb.TYPED_ARRAY_SUPPORT:!0;var hi=z.TYPED_ARRAY_SUPPORT?2147483647:1073741823;z.poolSize=8192;z._augment=function(a){a.__proto__=z.prototype;return a};z.from=function(a,b,c){return of(null,a,b,c)};z.TYPED_ARRAY_SUPPORT&&(z.prototype.__proto__=Uint8Array.prototype,z.__proto__=Uint8Array);z.alloc=function(a,b,c){qf(a);return a=0>=a?Ia(null,a):void 0!==b?"string"===typeof c?Ia(null,a).fill(b,c):Ia(null,a).fill(b):Ia(null,a)};z.allocUnsafe=function(a){return sd(null,a)};z.allocUnsafeSlow=
function(a){return sd(null,a)};z.isBuffer=yf;z.compare=function(a,b){if(!ra(a)||!ra(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,e=b.length,f=0,h=Math.min(c,e);f<h;++f)if(a[f]!==b[f]){c=a[f];e=b[f];break}return c<e?-1:e<c?1:0};z.isEncoding=function(a){switch(String(a).toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "latin1":case "binary":case "base64":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return!0;default:return!1}};
z.concat=function(a,b){if(!rf(a))throw new TypeError('"list" argument must be an Array of Buffers');if(0===a.length)return z.alloc(0);var c;if(void 0===b)for(c=b=0;c<a.length;++c)b+=a[c].length;b=z.allocUnsafe(b);var e=0;for(c=0;c<a.length;++c){var f=a[c];if(!ra(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(b,e);e+=f.length}return b};z.byteLength=pf;z.prototype._isBuffer=!0;z.prototype.swap16=function(){var a=this.length;if(0!==a%2)throw new RangeError("Buffer size must be a multiple of 16-bits");
for(var b=0;b<a;b+=2)wb(this,b,b+1);return this};z.prototype.swap32=function(){var a=this.length;if(0!==a%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var b=0;b<a;b+=4)wb(this,b,b+3),wb(this,b+1,b+2);return this};z.prototype.swap64=function(){var a=this.length;if(0!==a%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var b=0;b<a;b+=8)wb(this,b,b+7),wb(this,b+1,b+6),wb(this,b+2,b+5),wb(this,b+3,b+4);return this};z.prototype.toString=function(){var a=
this.length|0;return 0===a?"":0===arguments.length?tf(this,0,a):xh.apply(this,arguments)};z.prototype.equals=function(a){if(!ra(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:0===z.compare(this,a)};z.prototype.inspect=function(){var a="";0<this.length&&(a=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(a+=" ... "));return"<Buffer "+a+">"};z.prototype.compare=function(a,b,c,e,f){if(!ra(a))throw new TypeError("Argument must be a Buffer");void 0===b&&(b=0);
void 0===c&&(c=a?a.length:0);void 0===e&&(e=0);void 0===f&&(f=this.length);if(0>b||c>a.length||0>e||f>this.length)throw new RangeError("out of range index");if(e>=f&&b>=c)return 0;if(e>=f)return-1;if(b>=c)return 1;b>>>=0;c>>>=0;e>>>=0;f>>>=0;if(this===a)return 0;var h=f-e,g=c-b,k=Math.min(h,g);e=this.slice(e,f);a=a.slice(b,c);for(b=0;b<k;++b)if(e[b]!==a[b]){h=e[b];g=a[b];break}return h<g?-1:g<h?1:0};z.prototype.includes=function(a,b,c){return-1!==this.indexOf(a,b,c)};z.prototype.indexOf=function(a,
b,c){return uf(this,a,b,c,!0)};z.prototype.lastIndexOf=function(a,b,c){return uf(this,a,b,c,!1)};z.prototype.write=function(a,b,c,e){if(void 0===b)e="utf8",c=this.length,b=0;else if(void 0===c&&"string"===typeof b)e=b,c=this.length,b=0;else if(isFinite(b))b|=0,isFinite(c)?(c|=0,void 0===e&&(e="utf8")):(e=c,c=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-b;if(void 0===c||c>f)c=f;if(0<a.length&&(0>c||0>b)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");
e||(e="utf8");for(f=!1;;)switch(e){case "hex":a:{b=Number(b)||0;e=this.length-b;c?(c=Number(c),c>e&&(c=e)):c=e;e=a.length;if(0!==e%2)throw new TypeError("Invalid hex string");c>e/2&&(c=e/2);for(e=0;e<c;++e){f=parseInt(a.substr(2*e,2),16);if(isNaN(f)){a=e;break a}this[b+e]=f}a=e}return a;case "utf8":case "utf-8":return Ob(fc(a,this.length-b),this,b,c);case "ascii":return Ob(xf(a),this,b,c);case "latin1":case "binary":return Ob(xf(a),this,b,c);case "base64":return Ob(sf(a),this,b,c);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":e=
a;f=this.length-b;for(var h=[],g=0;g<e.length&&!(0>(f-=2));++g){var k=e.charCodeAt(g);a=k>>8;k%=256;h.push(k);h.push(a)}return Ob(h,this,b,c);default:if(f)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase();f=!0}};z.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var wf=4096;z.prototype.slice=function(a,b){var c=this.length;a=~~a;b=void 0===b?c:~~b;0>a?(a+=c,0>a&&(a=0)):a>c&&(a=c);0>b?(b+=c,0>b&&(b=0)):b>c&&(b=c);b<a&&(b=a);if(z.TYPED_ARRAY_SUPPORT)b=
this.subarray(a,b),b.__proto__=z.prototype;else{c=b-a;b=new z(c,void 0);for(var e=0;e<c;++e)b[e]=this[e+a]}return b};z.prototype.readUIntLE=function(a,b,c){a|=0;b|=0;c||W(a,b,this.length);c=this[a];for(var e=1,f=0;++f<b&&(e*=256);)c+=this[a+f]*e;return c};z.prototype.readUIntBE=function(a,b,c){a|=0;b|=0;c||W(a,b,this.length);c=this[a+--b];for(var e=1;0<b&&(e*=256);)c+=this[a+--b]*e;return c};z.prototype.readUInt8=function(a,b){b||W(a,1,this.length);return this[a]};z.prototype.readUInt16LE=function(a,
b){b||W(a,2,this.length);return this[a]|this[a+1]<<8};z.prototype.readUInt16BE=function(a,b){b||W(a,2,this.length);return this[a]<<8|this[a+1]};z.prototype.readUInt32LE=function(a,b){b||W(a,4,this.length);return(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]};z.prototype.readUInt32BE=function(a,b){b||W(a,4,this.length);return 16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])};z.prototype.readIntLE=function(a,b,c){a|=0;b|=0;c||W(a,b,this.length);c=this[a];for(var e=1,f=0;++f<b&&(e*=256);)c+=
this[a+f]*e;c>=128*e&&(c-=Math.pow(2,8*b));return c};z.prototype.readIntBE=function(a,b,c){a|=0;b|=0;c||W(a,b,this.length);c=b;for(var e=1,f=this[a+--c];0<c&&(e*=256);)f+=this[a+--c]*e;f>=128*e&&(f-=Math.pow(2,8*b));return f};z.prototype.readInt8=function(a,b){b||W(a,1,this.length);return this[a]&128?-1*(255-this[a]+1):this[a]};z.prototype.readInt16LE=function(a,b){b||W(a,2,this.length);a=this[a]|this[a+1]<<8;return a&32768?a|4294901760:a};z.prototype.readInt16BE=function(a,b){b||W(a,2,this.length);
a=this[a+1]|this[a]<<8;return a&32768?a|4294901760:a};z.prototype.readInt32LE=function(a,b){b||W(a,4,this.length);return this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24};z.prototype.readInt32BE=function(a,b){b||W(a,4,this.length);return this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]};z.prototype.readFloatLE=function(a,b){b||W(a,4,this.length);return wc(this,a,!0,23,4)};z.prototype.readFloatBE=function(a,b){b||W(a,4,this.length);return wc(this,a,!1,23,4)};z.prototype.readDoubleLE=function(a,b){b||
W(a,8,this.length);return wc(this,a,!0,52,8)};z.prototype.readDoubleBE=function(a,b){b||W(a,8,this.length);return wc(this,a,!1,52,8)};z.prototype.writeUIntLE=function(a,b,c,e){a=+a;b|=0;c|=0;e||ca(this,a,b,c,Math.pow(2,8*c)-1,0);e=1;var f=0;for(this[b]=a&255;++f<c&&(e*=256);)this[b+f]=a/e&255;return b+c};z.prototype.writeUIntBE=function(a,b,c,e){a=+a;b|=0;c|=0;e||ca(this,a,b,c,Math.pow(2,8*c)-1,0);e=c-1;var f=1;for(this[b+e]=a&255;0<=--e&&(f*=256);)this[b+e]=a/f&255;return b+c};z.prototype.writeUInt8=
function(a,b,c){a=+a;b|=0;c||ca(this,a,b,1,255,0);z.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));this[b]=a&255;return b+1};z.prototype.writeUInt16LE=function(a,b,c){a=+a;b|=0;c||ca(this,a,b,2,65535,0);z.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):yc(this,a,b,!0);return b+2};z.prototype.writeUInt16BE=function(a,b,c){a=+a;b|=0;c||ca(this,a,b,2,65535,0);z.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&255):yc(this,a,b,!1);return b+2};z.prototype.writeUInt32LE=function(a,b,c){a=+a;b|=0;c||ca(this,a,
b,4,4294967295,0);z.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=a&255):gc(this,a,b,!0);return b+4};z.prototype.writeUInt32BE=function(a,b,c){a=+a;b|=0;c||ca(this,a,b,4,4294967295,0);z.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a&255):gc(this,a,b,!1);return b+4};z.prototype.writeIntLE=function(a,b,c,e){a=+a;b|=0;e||(e=Math.pow(2,8*c-1),ca(this,a,b,c,e-1,-e));e=0;var f=1,h=0;for(this[b]=a&255;++e<c&&(f*=256);)0>a&&0===h&&0!==this[b+
e-1]&&(h=1),this[b+e]=(a/f>>0)-h&255;return b+c};z.prototype.writeIntBE=function(a,b,c,e){a=+a;b|=0;e||(e=Math.pow(2,8*c-1),ca(this,a,b,c,e-1,-e));e=c-1;var f=1,h=0;for(this[b+e]=a&255;0<=--e&&(f*=256);)0>a&&0===h&&0!==this[b+e+1]&&(h=1),this[b+e]=(a/f>>0)-h&255;return b+c};z.prototype.writeInt8=function(a,b,c){a=+a;b|=0;c||ca(this,a,b,1,127,-128);z.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));0>a&&(a=255+a+1);this[b]=a&255;return b+1};z.prototype.writeInt16LE=function(a,b,c){a=+a;b|=0;c||ca(this,a,b,2,
32767,-32768);z.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):yc(this,a,b,!0);return b+2};z.prototype.writeInt16BE=function(a,b,c){a=+a;b|=0;c||ca(this,a,b,2,32767,-32768);z.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&255):yc(this,a,b,!1);return b+2};z.prototype.writeInt32LE=function(a,b,c){a=+a;b|=0;c||ca(this,a,b,4,2147483647,-2147483648);z.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):gc(this,a,b,!0);return b+4};z.prototype.writeInt32BE=function(a,
b,c){a=+a;b|=0;c||ca(this,a,b,4,2147483647,-2147483648);0>a&&(a=4294967295+a+1);z.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a&255):gc(this,a,b,!1);return b+4};z.prototype.writeFloatLE=function(a,b,c){c||zc(this,a,b,4);xc(this,a,b,!0,23,4);return b+4};z.prototype.writeFloatBE=function(a,b,c){c||zc(this,a,b,4);xc(this,a,b,!1,23,4);return b+4};z.prototype.writeDoubleLE=function(a,b,c){c||zc(this,a,b,8);xc(this,a,b,!0,52,8);return b+8};z.prototype.writeDoubleBE=function(a,
b,c){c||zc(this,a,b,8);xc(this,a,b,!1,52,8);return b+8};z.prototype.copy=function(a,b,c,e){c||(c=0);e||0===e||(e=this.length);b>=a.length&&(b=a.length);b||(b=0);0<e&&e<c&&(e=c);if(e===c||0===a.length||0===this.length)return 0;if(0>b)throw new RangeError("targetStart out of bounds");if(0>c||c>=this.length)throw new RangeError("sourceStart out of bounds");if(0>e)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length);a.length-b<e-c&&(e=a.length-b+c);var f=e-c;if(this===a&&c<b&&
b<e)for(e=f-1;0<=e;--e)a[e+b]=this[e+c];else if(1E3>f||!z.TYPED_ARRAY_SUPPORT)for(e=0;e<f;++e)a[e+b]=this[e+c];else Uint8Array.prototype.set.call(a,this.subarray(c,c+f),b);return f};z.prototype.fill=function(a,b,c,e){if("string"===typeof a){"string"===typeof b?(e=b,b=0,c=this.length):"string"===typeof c&&(e=c,c=this.length);if(1===a.length){var f=a.charCodeAt(0);256>f&&(a=f)}if(void 0!==e&&"string"!==typeof e)throw new TypeError("encoding must be a string");if("string"===typeof e&&!z.isEncoding(e))throw new TypeError("Unknown encoding: "+
e);}else"number"===typeof a&&(a&=255);if(0>b||this.length<b||this.length<c)throw new RangeError("Out of range index");if(c<=b)return this;b>>>=0;c=void 0===c?this.length:c>>>0;a||(a=0);if("number"===typeof a)for(e=b;e<c;++e)this[e]=a;else for(a=ra(a)?a:fc((new z(a,e)).toString()),f=a.length,e=0;e<c-b;++e)this[e+b]=a[e%f];return this};var yh=/[^+\/0-9A-Za-z-_]/g,Db=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:hi,Buffer:z,SlowBuffer:function(a){+a!=a&&(a=0);return z.alloc(+a)},isBuffer:yf}),
O=z,Ub="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof za?za:"undefined"!==typeof self?self:{},jb=Af,kb=Bf;"function"===typeof Tb.setTimeout&&(jb=setTimeout);"function"===typeof Tb.clearTimeout&&(kb=clearTimeout);var Aa=[],xb=!1,yb,hc=-1;Ff.prototype.run=function(){this.fun.apply(null,this.array)};var Eb=Tb.performance||{},ii=Eb.now||Eb.mozNow||Eb.msNow||Eb.oNow||Eb.webkitNow||function(){return(new Date).getTime()},ji=new Date,ki={nextTick:Ef,title:"browser",
browser:!0,env:{},argv:[],version:"",versions:{},on:Ua,addListener:Ua,once:Ua,off:Ua,removeListener:Ua,removeAllListeners:Ua,emit:Ua,binding:function(){throw Error("process.binding is not supported");},cwd:function(){return"/"},chdir:function(){throw Error("process.chdir is not supported");},umask:function(){return 0},hrtime:function(a){var b=.001*ii.call(Eb),c=Math.floor(b);b=Math.floor(b%1*1E9);a&&(c-=a[0],b-=a[1],0>b&&(c--,b+=1E9));return[c,b]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-
ji)/1E3}},bg=vd(function(a,b){function c(a,b){for(var c in a)b[c]=a[c]}function e(a,b,c){return f(a,b,c)}var f=Db.Buffer;f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?a.exports=Db:(c(Db,b),b.Buffer=e);e.prototype=Object.create(f.prototype);c(f,e);e.from=function(a,b,c){if("number"===typeof a)throw new TypeError("Argument must not be a number");return f(a,b,c)};e.alloc=function(a,b,c){if("number"!==typeof a)throw new TypeError("Argument must be a number");a=f(a);void 0!==b?"string"===typeof c?
a.fill(b,c):a.fill(b):a.fill(0);return a};e.allocUnsafe=function(a){if("number"!==typeof a)throw new TypeError("Argument must be a number");return f(a)};e.allocUnsafeSlow=function(a){if("number"!==typeof a)throw new TypeError("Argument must be a number");return Db.SlowBuffer(a)}}),li=vd(function(a,b){function c(){throw Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11");}function e(a,b){if("number"!==typeof a||a!==a)throw new TypeError("offset must be a number");
if(a>v||0>a)throw new TypeError("offset must be a uint32");if(a>t||a>b)throw new RangeError("offset out of range");}function f(a,b,c){if("number"!==typeof a||a!==a)throw new TypeError("size must be a number");if(a>v||0>a)throw new TypeError("size must be a uint32");if(a+b>c||a>t)throw new RangeError("buffer too small");}function h(a,b,c,h){if(!(q.isBuffer(a)||a instanceof Ub.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"===typeof b)h=b,b=0,c=a.length;
else if("function"===typeof c)h=c,c=a.length-b;else if("function"!==typeof h)throw new TypeError('"cb" argument must be a function');e(b,a.length);f(c,b,a.length);return g(a,b,c,h)}function g(a,b,c,e){b=new Uint8Array(a.buffer,b,c);p.getRandomValues(b);if(e)Ef(function(){e(null,a)});else return a}function k(a,b,c){"undefined"===typeof b&&(b=0);if(!(q.isBuffer(a)||a instanceof Ub.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');e(b,a.length);void 0===c&&(c=a.length-
b);f(c,b,a.length);return g(a,b,c)}var q=bg.Buffer,t=bg.kMaxLength,p=Ub.crypto||Ub.msCrypto,v=Math.pow(2,32)-1;p&&p.getRandomValues?(b.randomFill=h,b.randomFillSync=k):(b.randomFill=c,b.randomFillSync=c)}),mi=vd(function(a){a.exports=li}).randomFillSync,ni=Math.floor(.001*(Date.now()-performance.now())),ob={resolve:function(){for(var a="",b=!1,c,e=arguments.length-1;-1<=e&&!b;e--){if(0<=e)var f=arguments[e];else void 0===c&&(c=ki.cwd()),f=c;ya(f);0!==f.length&&(a=f+"/"+a,b=47===f.charCodeAt(0))}a=
Gf(a,!b);return b?0<a.length?"/"+a:"/":0<a.length?a:"."},normalize:function(a){ya(a);if(0===a.length)return".";var b=47===a.charCodeAt(0),c=47===a.charCodeAt(a.length-1);a=Gf(a,!b);0!==a.length||b||(a=".");0<a.length&&c&&(a+="/");return b?"/"+a:a},isAbsolute:function(a){ya(a);return 0<a.length&&47===a.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var a,b=0;b<arguments.length;++b){var c=arguments[b];ya(c);0<c.length&&(a=void 0===a?c:a+("/"+c))}return void 0===a?".":ob.normalize(a)},
relative:function(a,b){ya(a);ya(b);if(a===b)return"";a=ob.resolve(a);b=ob.resolve(b);if(a===b)return"";for(var c=1;c<a.length&&47===a.charCodeAt(c);++c);for(var e=a.length,f=e-c,h=1;h<b.length&&47===b.charCodeAt(h);++h);for(var g=b.length-h,k=f<g?f:g,q=-1,t=0;t<=k;++t){if(t===k){if(g>k){if(47===b.charCodeAt(h+t))return b.slice(h+t+1);if(0===t)return b.slice(h+t)}else f>k&&(47===a.charCodeAt(c+t)?q=t:0===t&&(q=0));break}var p=a.charCodeAt(c+t),v=b.charCodeAt(h+t);if(p!==v)break;else 47===p&&(q=t)}f=
"";for(t=c+q+1;t<=e;++t)if(t===e||47===a.charCodeAt(t))f=0===f.length?f+"..":f+"/..";if(0<f.length)return f+b.slice(h+q);h+=q;47===b.charCodeAt(h)&&++h;return b.slice(h)},_makeLong:function(a){return a},dirname:function(a){ya(a);if(0===a.length)return".";for(var b=a.charCodeAt(0),c=47===b,e=-1,f=!0,h=a.length-1;1<=h;--h)if(b=a.charCodeAt(h),47===b){if(!f){e=h;break}}else f=!1;return-1===e?c?"/":".":c&&1===e?"//":a.slice(0,e)},basename:function(a,b){if(void 0!==b&&"string"!==typeof b)throw new TypeError('"ext" argument must be a string');
ya(a);var c=0,e=-1,f=!0,h;if(void 0!==b&&0<b.length&&b.length<=a.length){if(b.length===a.length&&b===a)return"";var g=b.length-1,k=-1;for(h=a.length-1;0<=h;--h){var q=a.charCodeAt(h);if(47===q){if(!f){c=h+1;break}}else-1===k&&(f=!1,k=h+1),0<=g&&(q===b.charCodeAt(g)?-1===--g&&(e=h):(g=-1,e=k))}c===e?e=k:-1===e&&(e=a.length);return a.slice(c,e)}for(h=a.length-1;0<=h;--h)if(47===a.charCodeAt(h)){if(!f){c=h+1;break}}else-1===e&&(f=!1,e=h+1);return-1===e?"":a.slice(c,e)},extname:function(a){ya(a);for(var b=
-1,c=0,e=-1,f=!0,h=0,g=a.length-1;0<=g;--g){var k=a.charCodeAt(g);if(47===k){if(!f){c=g+1;break}}else-1===e&&(f=!1,e=g+1),46===k?-1===b?b=g:1!==h&&(h=1):-1!==b&&(h=-1)}return-1===b||-1===e||0===h||1===h&&b===e-1&&b===c+1?"":a.slice(b,e)},format:function(a){if(null===a||"object"!==typeof a)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof a);var b=a.dir||a.root,c=a.base||(a.name||"")+(a.ext||"");return a=b?b===a.root?b+c:b+"/"+c:c},parse:function(a){ya(a);
var b={root:"",dir:"",base:"",ext:"",name:""};if(0===a.length)return b;var c=a.charCodeAt(0),e=47===c;if(e){b.root="/";var f=1}else f=0;for(var h=-1,g=0,k=-1,q=!0,t=a.length-1,p=0;t>=f;--t)if(c=a.charCodeAt(t),47===c){if(!q){g=t+1;break}}else-1===k&&(q=!1,k=t+1),46===c?-1===h?h=t:1!==p&&(p=1):-1!==h&&(p=-1);-1===h||-1===k||0===p||1===p&&h===k-1&&h===g+1?-1!==k&&(b.base=0===g&&e?b.name=a.slice(1,k):b.name=a.slice(g,k)):(0===g&&e?(b.name=a.slice(1,h),b.base=a.slice(1,k)):(b.name=a.slice(g,h),b.base=
a.slice(g,k)),b.ext=a.slice(h,k));0<g?b.dir=a.slice(0,g-1):e&&(b.dir="/");return b},sep:"/",delimiter:":",win32:null,posix:null},cg=ob.posix=ob,oi=Object.freeze({__proto__:null,"default":cg,__moduleExports:cg}),eg={hrtime:function(a){return function(b){b=a(b);return 1E9*b[0]+b[1]}}(function(a){var b=.001*performance.now(),c=Math.floor(b)+ni;b=Math.floor(b%1*1E9);a&&(c-=a[0],b-=a[1],0>b&&(c--,b+=1E9));return[c,b]}),exit:function(a){throw new dg(a);},kill:function(a){throw new pi(a);},randomFillSync:mi,
isTTY:function(){return!0},path:oi,fs:null},F,Fb=A(1),Fa=A(2),Gb=A(4),Hb=A(8),ab=A(16),Dd=A(32),pb=A(64),bb=A(128),lc=A(256),Ed=A(512),Fd=A(1024),Gd=A(2048),Hd=A(4096),Ib=A(8192),Vb=A(16384),Id=A(32768),Jd=A(65536),Kd=A(131072),Ld=A(262144),Md=A(524288),Nd=A(1048576),cb=A(2097152),Gc=A(4194304),Hc=A(8388608),Od=A(16777216),Pd=A(33554432),Qd=A(67108864),qb=A(134217728),fg=A(268435456),Ka=Fb|Fa|Gb|Hb|ab|Dd|pb|bb|lc|Ed|Fd|Gd|Hd|Ib|Vb|Id|Jd|Kd|Ld|Md|Nd|cb|Hc|Gc|Od|Qd|Pd|qb|fg,Lf=Fb|Fa|Gb|Hb|ab|Dd|pb|
bb|lc|cb|Gc|Hc|qb,Fh=A(0),xd=Hb|ab|bb|Ed|Fd|Gd|Hd|Ib|Vb|Id|Jd|Kd|Ld|Md|Nd|cb|Hc|Od|Qd|Pd|qb,Jf=xd|Lf,Kf=Fa|Hb|pb|cb|qb|fg,Dh=Fa|Hb|pb|cb|qb,Eh=A(0),Ch={E2BIG:1,EACCES:2,EADDRINUSE:3,EADDRNOTAVAIL:4,EAFNOSUPPORT:5,EALREADY:7,EAGAIN:6,EBADF:8,EBADMSG:9,EBUSY:10,ECANCELED:11,ECHILD:12,ECONNABORTED:13,ECONNREFUSED:14,ECONNRESET:15,EDEADLOCK:16,EDESTADDRREQ:17,EDOM:18,EDQUOT:19,EEXIST:20,EFAULT:21,EFBIG:22,EHOSTDOWN:23,EHOSTUNREACH:23,EIDRM:24,EILSEQ:25,EINPROGRESS:26,EINTR:27,EINVAL:28,EIO:29,EISCONN:30,
EISDIR:31,ELOOP:32,EMFILE:33,EMLINK:34,EMSGSIZE:35,EMULTIHOP:36,ENAMETOOLONG:37,ENETDOWN:38,ENETRESET:39,ENETUNREACH:40,ENFILE:41,ENOBUFS:42,ENODEV:43,ENOENT:44,ENOEXEC:45,ENOLCK:46,ENOLINK:47,ENOMEM:48,ENOMSG:49,ENOPROTOOPT:50,ENOSPC:51,ENOSYS:52,ENOTCONN:53,ENOTDIR:54,ENOTEMPTY:55,ENOTRECOVERABLE:56,ENOTSOCK:57,ENOTTY:59,ENXIO:60,EOVERFLOW:61,EOWNERDEAD:62,EPERM:63,EPIPE:64,EPROTO:65,EPROTONOSUPPORT:66,EPROTOTYPE:67,ERANGE:68,EROFS:69,ESPIPE:70,ESRCH:71,ESTALE:72,ETIMEDOUT:73,ETXTBSY:74,EXDEV:75},
gg=(F={},F[6]="SIGHUP",F[8]="SIGINT",F[11]="SIGQUIT",F[7]="SIGILL",F[15]="SIGTRAP",F[0]="SIGABRT",F[2]="SIGBUS",F[5]="SIGFPE",F[9]="SIGKILL",F[20]="SIGUSR1",F[12]="SIGSEGV",F[21]="SIGUSR2",F[10]="SIGPIPE",F[1]="SIGALRM",F[14]="SIGTERM",F[3]="SIGCHLD",F[4]="SIGCONT",F[13]="SIGSTOP",F[16]="SIGTSTP",F[17]="SIGTTIN",F[18]="SIGTTOU",F[19]="SIGURG",F[23]="SIGXCPU",F[24]="SIGXFSZ",F[22]="SIGVTALRM",F),qi=Fb|Fa|ab|bb|cb|qb,hg=Fb|pb|ab|bb|cb|qb,wd=function(a){function b(c){var e=a.call(this)||this;e.errno=
c;Object.setPrototypeOf(e,b.prototype);return e}qd(b,a);return b}(Error),dg=function(a){function b(c){var e=a.call(this,"WASI Exit error: "+c)||this;e.code=c;Object.setPrototypeOf(e,b.prototype);return e}qd(b,a);return b}(Error),pi=function(a){function b(c){var e=a.call(this,"WASI Kill signal: "+c)||this;e.signal=c;Object.setPrototypeOf(e,b.prototype);return e}qd(b,a);return b}(Error),ig=function(){function a(a){function b(a){switch(a){case 1:return p.hrtime();case 0:return Va(Date.now());case 2:case 3:return p.hrtime()-
L;default:return null}}function e(a,b){a=Hf(g,a);if(b!==A(0)&&(a.rights.base&b)===A(0))throw new wd(63);return a}function f(a,b){g.refreshMemory();return Array.from({length:b},function(b,c){c=a+8*c;b=g.view.getUint32(c,!0);c=g.view.getUint32(c+4,!0);return new Uint8Array(g.memory.buffer,b,c)})}var h,g=this,k={};a&&a.preopens?k=a.preopens:a&&a.preopenDirectories&&(k=a.preopenDirectories);var q={};a&&a.env&&(q=a.env);var t=[];a&&a.args&&(t=a.args);var p=eg;a&&a.bindings&&(p=a.bindings);this.view=this.memory=
void 0;this.bindings=p;this.FD_MAP=new Map([[0,{real:0,filetype:2,rights:{base:qi,inheriting:A(0)},path:void 0}],[1,{real:1,filetype:2,rights:{base:hg,inheriting:A(0)},path:void 0}],[2,{real:2,filetype:2,rights:{base:hg,inheriting:A(0)},path:void 0}]]);var v=this.bindings.fs,n=this.bindings.path;try{for(var r=ec(Object.entries(k)),u=r.next();!u.done;u=r.next()){var z=uc(u.value,2),H=z[0],F=z[1],I=v.openSync(F,v.constants.O_RDONLY),J=vc(this.FD_MAP.keys()).reverse()[0]+1;this.FD_MAP.set(J,{real:I,
filetype:3,rights:{base:xd,inheriting:Jf},fakePath:H,path:F})}}catch(B){var G={error:B}}finally{try{u&&!u.done&&(h=r.return)&&h.call(r)}finally{if(G)throw G.error;}}var L=p.hrtime();this.wasiImport={args_get:function(a,b){g.refreshMemory();var c=a,e=b;t.forEach(function(a){g.view.setUint32(c,e,!0);c+=4;e+=O.from(g.memory.buffer).write(a+"\x00",e)});return 0},args_sizes_get:function(a,b){g.refreshMemory();g.view.setUint32(a,t.length,!0);a=t.reduce(function(a,b){return a+O.byteLength(b)+1},0);g.view.setUint32(b,
a,!0);return 0},environ_get:function(a,b){g.refreshMemory();var c=a,e=b;Object.entries(q).forEach(function(a){var b=uc(a,2);a=b[0];b=b[1];g.view.setUint32(c,e,!0);c+=4;e+=O.from(g.memory.buffer).write(a+"="+b+"\x00",e)});return 0},environ_sizes_get:function(a,b){g.refreshMemory();var c=Object.entries(q).map(function(a){a=uc(a,2);return a[0]+"="+a[1]+"\x00"}),e=c.reduce(function(a,b){return a+O.byteLength(b)},0);g.view.setUint32(a,c.length,!0);g.view.setUint32(b,e,!0);return 0},clock_res_get:function(a,
b){switch(a){case 1:case 2:case 3:var c=A(1);break;case 0:c=A(1E3)}g.view.setBigUint64(b,c);return 0},clock_time_get:function(a,c,e){g.refreshMemory();a=b(a);if(null===a)return 28;g.view.setBigUint64(e,A(a),!0);return 0},fd_advise:E(function(a){e(a,bb);return 52}),fd_allocate:E(function(a){e(a,lc);return 52}),fd_close:E(function(a){var b=e(a,A(0));v.closeSync(b.real);g.FD_MAP.delete(a);return 0}),fd_datasync:E(function(a){a=e(a,Fb);v.fdatasyncSync(a.real);return 0}),fd_fdstat_get:E(function(a,b){a=
e(a,A(0));g.refreshMemory();g.view.setUint8(b,a.filetype);g.view.setUint16(b+2,0,!0);g.view.setUint16(b+4,0,!0);g.view.setBigUint64(b+8,A(a.rights.base),!0);g.view.setBigUint64(b+8+8,A(a.rights.inheriting),!0);return 0}),fd_fdstat_set_flags:E(function(a){e(a,Hb);return 52}),fd_fdstat_set_rights:E(function(a,b,c){a=e(a,A(0));if((a.rights.base|b)>a.rights.base||(a.rights.inheriting|c)>a.rights.inheriting)return 63;a.rights.base=b;a.rights.inheriting=c;return 0}),fd_filestat_get:E(function(a,b){a=e(a,
cb);var c=v.fstatSync(a.real);g.refreshMemory();g.view.setBigUint64(b,A(c.dev),!0);b+=8;g.view.setBigUint64(b,A(c.ino),!0);b+=8;g.view.setUint8(b,a.filetype);b+=8;g.view.setBigUint64(b,A(c.nlink),!0);b+=8;g.view.setBigUint64(b,A(c.size),!0);b+=8;g.view.setBigUint64(b,Va(c.atimeMs),!0);b+=8;g.view.setBigUint64(b,Va(c.mtimeMs),!0);g.view.setBigUint64(b+8,Va(c.ctimeMs),!0);return 0}),fd_filestat_set_size:E(function(a,b){a=e(a,Gc);v.ftruncateSync(a.real,Number(b));return 0}),fd_filestat_set_times:E(function(a,
c,f,g){a=e(a,Hc);var h=v.fstatSync(a.real),k=h.atime;h=h.mtime;var n=Ja(b(0));if(3===(g&3)||12===(g&12))return 28;1===(g&1)?k=Ja(c):2===(g&2)&&(k=n);4===(g&4)?h=Ja(f):8===(g&8)&&(h=n);v.futimesSync(a.real,new Date(k),new Date(h));return 0}),fd_prestat_get:E(function(a,b){a=e(a,A(0));if(!a.path)return 28;g.refreshMemory();g.view.setUint8(b,0);g.view.setUint32(b+4,O.byteLength(a.fakePath),!0);return 0}),fd_prestat_dir_name:E(function(a,b,c){a=e(a,A(0));if(!a.path)return 28;g.refreshMemory();O.from(g.memory.buffer).write(a.fakePath,
b,c,"utf8");return 0}),fd_pwrite:E(function(a,b,c,h,k){var n=e(a,pb|Gb),p=0;f(b,c).forEach(function(a){for(var b=0;b<a.byteLength;)b+=v.writeSync(n.real,a,b,a.byteLength-b,Number(h)+p+b);p+=b});g.view.setUint32(k,p,!0);return 0}),fd_write:E(function(a,b,c,h){var k=e(a,pb),n=0;f(b,c).forEach(function(a){for(var b=0;b<a.byteLength;){var c=v.writeSync(k.real,a,b,a.byteLength-b,k.offset?Number(k.offset):null);k.offset&&(k.offset+=A(c));b+=c}n+=b});g.view.setUint32(h,n,!0);return 0}),fd_pread:E(function(a,
b,c,h,k){var n;a=e(a,Fa|Gb);var p=0;try{var q=ec(f(b,c)),r=q.next();a:for(;!r.done;r=q.next()){var t=r.value;for(b=0;b<t.byteLength;){var B=t.byteLength-b,u=v.readSync(a.real,t,b,t.byteLength-b,Number(h)+p+b);b+=u;p+=u;if(0===u||u<B)break a}p+=b}}catch(C){var x={error:C}}finally{try{r&&!r.done&&(n=q.return)&&n.call(q)}finally{if(x)throw x.error;}}g.view.setUint32(k,p,!0);return 0}),fd_read:E(function(a,b,c,h){var k;a=e(a,Fa);var n=0===a.real,p=0;try{var q=ec(f(b,c)),r=q.next();a:for(;!r.done;r=q.next()){var t=
r.value;for(b=0;b<t.byteLength;){var B=t.byteLength-b,u=v.readSync(a.real,t,b,B,n||void 0===a.offset?null:Number(a.offset));n||(a.offset=(a.offset?a.offset:A(0))+A(u));b+=u;p+=u;if(0===u||u<B)break a}}}catch(C){var x={error:C}}finally{try{r&&!r.done&&(k=q.return)&&k.call(q)}finally{if(x)throw x.error;}}g.view.setUint32(h,p,!0);return 0}),fd_readdir:E(function(a,b,c,f,h){a=e(a,Vb);g.refreshMemory();var k=v.readdirSync(a.path,{withFileTypes:!0}),p=b;for(f=Number(f);f<k.length;f+=1){var q=k[f],r=O.byteLength(q.name);
if(b-p>c)break;g.view.setBigUint64(b,A(f+1),!0);b+=8;if(b-p>c)break;var t=v.statSync(n.resolve(a.path,q.name));g.view.setBigUint64(b,A(t.ino),!0);b+=8;if(b-p>c)break;g.view.setUint32(b,r,!0);b+=4;if(b-p>c)break;switch(!0){case t.isBlockDevice():t=1;break;case t.isCharacterDevice():t=2;break;case t.isDirectory():t=3;break;case t.isFIFO():t=6;break;case t.isFile():t=4;break;case t.isSocket():t=6;break;case t.isSymbolicLink():t=7;break;default:t=0}g.view.setUint8(b,t);b+=1;b+=3;if(b+r>=p+c)break;O.from(g.memory.buffer).write(q.name,
b);b+=r}g.view.setUint32(h,Math.min(b-p,c),!0);return 0}),fd_renumber:E(function(a,b){e(a,A(0));e(b,A(0));v.closeSync(g.FD_MAP.get(a).real);g.FD_MAP.set(a,g.FD_MAP.get(b));g.FD_MAP.delete(b);return 0}),fd_seek:E(function(a,b,c,f){a=e(a,Gb);g.refreshMemory();switch(c){case 1:a.offset=(a.offset?a.offset:A(0))+A(b);break;case 2:c=v.fstatSync(a.real).size;a.offset=A(c)+A(b);break;case 0:a.offset=A(b)}g.view.setBigUint64(f,a.offset,!0);return 0}),fd_tell:E(function(a,b){a=e(a,Dd);g.refreshMemory();a.offset||
(a.offset=A(0));g.view.setBigUint64(b,a.offset,!0);return 0}),fd_sync:E(function(a){a=e(a,ab);v.fsyncSync(a.real);return 0}),path_create_directory:E(function(a,b,c){a=e(a,Ed);if(!a.path)return 28;g.refreshMemory();b=O.from(g.memory.buffer,b,c).toString();v.mkdirSync(n.resolve(a.path,b));return 0}),path_filestat_get:E(function(a,b,c,f,h){a=e(a,Ld);if(!a.path)return 28;g.refreshMemory();c=O.from(g.memory.buffer,c,f).toString();c=v.statSync(n.resolve(a.path,c));g.view.setBigUint64(h,A(c.dev),!0);h+=
8;g.view.setBigUint64(h,A(c.ino),!0);h+=8;g.view.setUint8(h,If(g,void 0,c).filetype);h+=8;g.view.setBigUint64(h,A(c.nlink),!0);h+=8;g.view.setBigUint64(h,A(c.size),!0);h+=8;g.view.setBigUint64(h,Va(c.atimeMs),!0);h+=8;g.view.setBigUint64(h,Va(c.mtimeMs),!0);g.view.setBigUint64(h+8,Va(c.ctimeMs),!0);return 0}),path_filestat_set_times:E(function(a,c,f,h,k,p,q){a=e(a,Nd);if(!a.path)return 28;g.refreshMemory();var r=v.fstatSync(a.real);c=r.atime;r=r.mtime;var t=Ja(b(0));if(3===(q&3)||12===(q&12))return 28;
1===(q&1)?c=Ja(k):2===(q&2)&&(c=t);4===(q&4)?r=Ja(p):8===(q&8)&&(r=t);f=O.from(g.memory.buffer,f,h).toString();v.utimesSync(n.resolve(a.path,f),new Date(c),new Date(r));return 0}),path_link:E(function(a,b,c,f,h,k,p){a=e(a,Gd);h=e(h,Hd);if(!a.path||!h.path)return 28;g.refreshMemory();c=O.from(g.memory.buffer,c,f).toString();k=O.from(g.memory.buffer,k,p).toString();v.linkSync(n.resolve(a.path,c),n.resolve(h.path,k));return 0}),path_open:E(function(a,b,c,f,h,k,p,q,r){b=e(a,Ib);k=A(k);p=A(p);a=(k&(Fa|
Vb))!==A(0);var t=(k&(Fb|pb|lc|Gc))!==A(0);if(t&&a)var u=v.constants.O_RDWR;else a?u=v.constants.O_RDONLY:t&&(u=v.constants.O_WRONLY);a=k|Ib;k|=p;0!==(h&1)&&(u|=v.constants.O_CREAT,a|=Fd);0!==(h&2)&&(u|=v.constants.O_DIRECTORY);0!==(h&4)&&(u|=v.constants.O_EXCL);0!==(h&8)&&(u|=v.constants.O_TRUNC,a|=Md);0!==(q&1)&&(u|=v.constants.O_APPEND);0!==(q&2)&&(u=v.constants.O_DSYNC?u|v.constants.O_DSYNC:u|v.constants.O_SYNC,k|=Fb);0!==(q&4)&&(u|=v.constants.O_NONBLOCK);0!==(q&8)&&(u=v.constants.O_RSYNC?u|
v.constants.O_RSYNC:u|v.constants.O_SYNC,k|=ab);0!==(q&16)&&(u|=v.constants.O_SYNC,k|=ab);t&&0===(u&(v.constants.O_APPEND|v.constants.O_TRUNC))&&(k|=Gb);g.refreshMemory();c=O.from(g.memory.buffer,c,f).toString();c=n.resolve(b.path,c);if(n.relative(b.path,c).startsWith(".."))return 76;try{var x=v.realpathSync(c);if(n.relative(b.path,x).startsWith(".."))return 76}catch(C){if("ENOENT"===C.code)x=c;else throw C;}try{var z=v.statSync(x).isDirectory()}catch(C){}u=!t&&z?v.openSync(x,v.constants.O_RDONLY):
v.openSync(x,u);z=vc(g.FD_MAP.keys()).reverse()[0]+1;g.FD_MAP.set(z,{real:u,filetype:void 0,rights:{base:a,inheriting:k},path:x});Hf(g,z);g.view.setUint32(r,z,!0);return 0}),path_readlink:E(function(a,b,c,f,h,k){a=e(a,Id);if(!a.path)return 28;g.refreshMemory();b=O.from(g.memory.buffer,b,c).toString();b=n.resolve(a.path,b);b=v.readlinkSync(b);f=O.from(g.memory.buffer).write(b,f,h);g.view.setUint32(k,f,!0);return 0}),path_remove_directory:E(function(a,b,c){a=e(a,Pd);if(!a.path)return 28;g.refreshMemory();
b=O.from(g.memory.buffer,b,c).toString();v.rmdirSync(n.resolve(a.path,b));return 0}),path_rename:E(function(a,b,c,f,h,k){a=e(a,Jd);f=e(f,Kd);if(!a.path||!f.path)return 28;g.refreshMemory();b=O.from(g.memory.buffer,b,c).toString();h=O.from(g.memory.buffer,h,k).toString();v.renameSync(n.resolve(a.path,b),n.resolve(f.path,h));return 0}),path_symlink:E(function(a,b,c,f,h){c=e(c,Od);if(!c.path)return 28;g.refreshMemory();a=O.from(g.memory.buffer,a,b).toString();f=O.from(g.memory.buffer,f,h).toString();
v.symlinkSync(a,n.resolve(c.path,f));return 0}),path_unlink_file:E(function(a,b,c){a=e(a,Qd);if(!a.path)return 28;g.refreshMemory();b=O.from(g.memory.buffer,b,c).toString();v.unlinkSync(n.resolve(a.path,b));return 0}),poll_oneoff:function(a,c,e,f){var h=0,k=0;g.refreshMemory();for(var n=0;n<e;n+=1){var q=g.view.getBigUint64(a,!0);a+=8;var r=g.view.getUint8(a);a+=1;switch(r){case 0:a+=7;g.view.getBigUint64(a,!0);a+=8;var t=g.view.getUint32(a,!0);a+=4;a+=4;r=g.view.getBigUint64(a,!0);a+=8;g.view.getBigUint64(a,
!0);a+=8;var v=g.view.getUint16(a,!0);a+=2;a+=6;var u=1===v;v=0;t=A(b(t));null===t?v=28:(r=u?r:t+r,k=r>k?r:k);g.view.setBigUint64(c,q,!0);c+=8;g.view.setUint16(c,v,!0);c+=2;g.view.setUint8(c,0);c+=1;c+=5;h+=1;break;case 1:case 2:a+=3;g.view.getUint32(a,!0);a+=4;g.view.setBigUint64(c,q,!0);c+=8;g.view.setUint16(c,52,!0);c+=2;g.view.setUint8(c,r);c+=1;c+=5;h+=1;break;default:return 28}}for(g.view.setUint32(f,h,!0);p.hrtime()<k;);return 0},proc_exit:function(a){p.exit(a);return 0},proc_raise:function(a){if(!(a in
gg))return 28;p.kill(gg[a]);return 0},random_get:function(a,b){g.refreshMemory();p.randomFillSync(new Uint8Array(g.memory.buffer),a,b);return 0},sched_yield:function(){return 0},sock_recv:function(){return 52},sock_send:function(){return 52},sock_shutdown:function(){return 52}};a.traceSyscalls&&Object.keys(this.wasiImport).forEach(function(a){var b=g.wasiImport[a];g.wasiImport[a]=function(){for(var c=[],e=0;e<arguments.length;e++)c[e]=arguments[e];console.log("WASI: wasiImport called: "+a+" ("+c+
")");try{var f=b.apply(void 0,vc(c));console.log("WASI: => "+f);return f}catch(T){throw console.log("Catched error: "+T),T;}}})}a.prototype.refreshMemory=function(){this.view&&0!==this.view.buffer.byteLength||(this.view=new Sb(this.memory.buffer))};a.prototype.setMemory=function(a){this.memory=a};a.prototype.start=function(a){a=a.exports;if(null===a||"object"!==typeof a)throw Error("instance.exports must be an Object. Received "+a+".");var b=a.memory;if(!(b instanceof WebAssembly.Memory))throw Error("instance.exports.memory must be a WebAssembly.Memory. Recceived "+
b+".");this.setMemory(b);a._start&&a._start()};a.prototype.getImportNamespace=function(a){var b,e=null;try{for(var f=ec(WebAssembly.Module.imports(a)),h=f.next();!h.done;h=f.next()){var g=h.value;if("function"===g.kind&&g.module.startsWith("wasi_"))if(!e)e=g.module;else if(e!==g.module)throw Error("Multiple namespaces detected.");}}catch(q){var k={error:q}}finally{try{h&&!h.done&&(b=f.return)&&b.call(f)}finally{if(k)throw k.error;}}return e};a.prototype.getImports=function(a){switch(this.getImportNamespace(a)){case "wasi_unstable":return{wasi_unstable:this.wasiImport};
case "wasi_snapshot_preview1":return{wasi_snapshot_preview1:this.wasiImport};default:throw Error("Can't detect a WASI namespace for the WebAssembly Module");}};a.defaultBindings=eg;return a}(),jg=function(){function a(a){this.options=a}a.prototype.run=function(a){return Y(this,void 0,void 0,function(){return Z(this,function(a){throw Error("run not implemented by the Command subclass");})})};return a}(),ri=function(a){function b(b){var c=a.call(this,b)||this;if(!b.module)throw Error("Did not find a WebAssembly.Module for the WASI Command");
return c}cf(b,a);b.prototype.run=function(a){return Y(this,void 0,void 0,function(){var b,c,h,g;return Z(this,function(e){switch(e.label){case 0:return b={preopens:$a({".":".","/":"/"},this.options.preopens||{}),env:this.options.env,args:this.options.args,bindings:$a($a({},ig.defaultBindings),{fs:a.fs})},c=new ig(b),h=this.options.module,[4,WebAssembly.instantiate(h,$a({},c.getImports(h)))];case 1:return g=e.sent(),c.start(g),[2]}})})};return b}(jg),si=function(a){function b(b){var c=a.call(this,
b)||this;if(!b.callback)throw Error("The Command Options provided are not for a Callback Command");c.callback=b.callback;return c}cf(b,a);b.prototype.run=function(a){return Y(this,void 0,void 0,function(){var b;return Z(this,function(c){switch(c.label){case 0:return[4,Promise.resolve(this.callback(this.options,a))];case 1:return b=c.sent(),"string"==typeof b&&a.fs.writeFileSync("/dev/stdout",(new TextEncoder).encode(b+"\n")),[2]}})})};return b}(jg),ti=function(){function a(a,c,e,f,h,g,k,q,t){var b=
this;this.stdinPrompt="";this.commandOptions=a;this.wasmFs=new Xf;this.wasmFs.fromJSON(c);this.originalWasmFsJson=c;this.ioDevices=new ei(this.wasmFs);this.ioDeviceWindow=g;this.ioDevices.setWindowSizeCallback(function(){var a=b.ioDevices.getWindowSize();b.ioDeviceWindow.resize(a[0],a[1])});this.ioDevices.setBufferIndexDisplayCallback(function(){var a=b.ioDevices.getFrameBuffer();b.ioDeviceWindow.drawRgbaArrayToFrameBuffer(a)});this.ioDevices.setInputCallback(function(){if(b.sharedIoDeviceInput){b.ioDeviceWindow.getInputBuffer();
Atomics.wait(b.sharedIoDeviceInput,0,-1);var a=b.sharedIoDeviceInput[0];b.sharedIoDeviceInput[0]=-1;if(0<a){for(var c=new Uint8Array(a),e=0;e<a;e++)c[e]=b.sharedIoDeviceInput[e+1];return c}return new Uint8Array}return b.ioDeviceWindow.getInputBuffer()});this.dataCallback=e;this.endCallback=f;this.errorCallback=h;c=void 0;k&&(c=new Int32Array(k));this.sharedIoDeviceInput=c;k=void 0;q&&(k=new Int32Array(q));this.command=a.module?new ri(a):new si(a);this.wasmFs.volume.fds[0].node.read=this.stdinRead.bind(this);
this.wasmFs.volume.fds[1].node.write=this.stdoutWrite.bind(this);this.wasmFs.volume.fds[2].node.write=this.stdoutWrite.bind(this);a=this.wasmFs.volume.openSync("/dev/tty","w+");this.wasmFs.volume.fds[a].node.read=this.stdinRead.bind(this);this.wasmFs.volume.fds[a].node.write=this.stdoutWrite.bind(this);this.sharedStdin=k;this.startStdinReadCallback=t;this.readStdinCounter=0;this.pipedStdin=""}a.prototype.start=function(a){return Y(this,void 0,void 0,function(){var b,e,f,h=this;return Z(this,function(c){switch(c.label){case 0:b=
function(){h.ioDeviceWindow.resize(0,0);setTimeout(function(){h.endCallback(h.wasmFs.toJSON())},50)},c.label=1;case 1:return c.trys.push([1,3,,4]),a&&(this.pipedStdin=(new TextDecoder("utf-8")).decode(a)),[4,this.command.run(this.wasmFs)];case 2:return c.sent(),b(),[3,4];case 3:e=c.sent();if(e instanceof dg)return b(),[2];f="Unknown Error";if(void 0!==e.code)f="exited with code: "+e.code;else if(void 0!==e.signal)f="killed with signal: "+e.signal;else if(void 0!==e.user)return b(),[2];console.error(e);
this.errorCallback(f,this.wasmFs.toJSON(),void 0!==e.user);return[3,4];case 4:return[2]}})})};a.prototype.stdoutWrite=function(a,c,e,f){this.dataCallback&&this.dataCallback(a);c=(new TextDecoder("utf-8")).decode(a).split("\n");this.stdinPrompt=0<c.length?c[c.length-1].replace(/[\u001B\u009B][[\]()#;?]*(?:(?:(?:[a-zA-Z\d]*(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-ntqry=><~]))/g,""):"";return a.length};a.prototype.stdinRead=function(a,c,e,f){if(0!==this.readStdinCounter%
2)return this.readStdinCounter++,0;if(this.pipedStdin)c=this.pipedStdin,this.pipedStdin="",this.readStdinCounter++;else if(this.sharedStdin&&this.startStdinReadCallback){this.startStdinReadCallback();Atomics.wait(this.sharedStdin,0,-1);c=this.sharedStdin[0];this.sharedStdin[0]=-1;e=new Uint8Array(c);for(f=0;f<c;f++)e[f]=this.sharedStdin[1+f];c=(new TextDecoder("utf-8")).decode(e)}else{c=prompt("Please enter text for stdin:\n"+this.stdinPrompt);if(null===c)throw this.dataCallback&&this.dataCallback((new TextEncoder).encode("\n")),
a=Error("Process killed by user"),a.user=!0,a;c+="\n";this.dataCallback&&this.dataCallback((new TextEncoder).encode(c))}if(!c)return 0;c=(new TextEncoder).encode(c);for(e=0;e<c.length;++e)a[e]=c[e];return c.length};return a}(),kg=function(){function a(a){this.oldPopupKeyCodes=[];this.popupKeyCodes=[];this.oldMouseMovePosition={x:0,y:0};this.mouseMovePosition={x:0,y:0};this.mouseMiddleClickPosition=this.mouseRightClickPosition=this.mouseLeftClickPosition=void 0;a&&(this.sharedIoDeviceInput=new Int32Array(a))}
a.prototype.resize=function(a,c){0===a&&0===c?this.close():this.popupWindow&&this.popupCanvas&&this.popupCanvasContext?(this.popupCanvas.width=a,this.popupCanvas.height=c,this.popupImageData=this.popupCanvasContext.getImageData(0,0,a,c)):this._open(a,c)};a.prototype.close=function(){this.popupWindow&&(this.popupWindow.close(),this.popupWindow=void 0)};a.prototype.drawRgbaArrayToFrameBuffer=function(a){this.popupCanvas&&this.popupCanvasContext&&this.popupImageData&&(this.popupImageData.data.set(a),
this.popupCanvasContext.putImageData(this.popupImageData,0,0))};a.prototype.getInputBuffer=function(){var a=this,c=[];this.popupKeyCodes.forEach(function(b){a.oldPopupKeyCodes.includes(b)||(c.push(1),c.push(b))});if(this.oldMouseMovePosition.x!==this.mouseMovePosition.x||this.oldMouseMovePosition.y!==this.mouseMovePosition.y)c.push(2),this._append32BitIntToByteArray(this.mouseMovePosition.x,c),this._append32BitIntToByteArray(this.mouseMovePosition.y,c);this.oldMouseMovePosition=this.mouseMovePosition;
this.oldPopupKeyCodes.forEach(function(b){a.popupKeyCodes.includes(b)||(c.push(3),c.push(b))});this.oldPopupKeyCodes=this.popupKeyCodes.slice(0);this.mouseLeftClickPosition&&(c.push(4),this._append32BitIntToByteArray(this.mouseLeftClickPosition.x,c),this._append32BitIntToByteArray(this.mouseLeftClickPosition.y,c),this.mouseLeftClickPosition=void 0);this.mouseRightClickPosition&&(c.push(5),this._append32BitIntToByteArray(this.mouseRightClickPosition.x,c),this._append32BitIntToByteArray(this.mouseRightClickPosition.y,
c),this.mouseRightClickPosition=void 0);this.mouseMiddleClickPosition&&(c.push(4),this._append32BitIntToByteArray(this.mouseMiddleClickPosition.x,c),this._append32BitIntToByteArray(this.mouseMiddleClickPosition.y,c),this.mouseMiddleClickPosition=void 0);var e=new Uint8Array(c);if(this.sharedIoDeviceInput){for(var f=0;f<e.length;f++)this.sharedIoDeviceInput[f+1]=e[f];this.sharedIoDeviceInput[0]=e.length;Atomics.notify(this.sharedIoDeviceInput,0,1)}return e};a.prototype._open=function(a,c){var b=Math.min(Math.floor(screen.width/
a),Math.floor(screen.height/c));this.popupWindow=window.open("about:blank","WasmerExperimentalFramebuffer","width="+a*b+",height="+c*b);this.popupWindow.document.body.innerHTML='\n <style>\n html, body {\n width: 100%;\n height: 100%;\n }\n\n body {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n\n margin: 0px;\n margin-left: auto;\n margin-right: auto;\n }\n\n #io-device-framebuffer {\n\n width: 100%;\n height: auto;\n\n /* Will Keep pixel art looking good */\n image-rendering: pixelated;\n image-rendering: -moz-crisp-edges;\n image-rendering: crisp-edges;\n }\n </style>\n <canvas id="io-device-framebuffer" width="'+
a+'" height="'+c+'"></canvas>\n ';this.popupWindow.document.head.innerHTML="\n <title>Wasmer Experimental Framebuffer</title>\n ";this.popupCanvas=this.popupWindow.document.querySelector("#io-device-framebuffer");this.popupCanvasContext=this.popupCanvas.getContext("2d");this.popupImageData=this.popupCanvasContext.getImageData(0,0,a,c);this.popupWindow.document.addEventListener("keydown",this._eventListenerKeydown.bind(this));this.popupWindow.document.addEventListener("keyup",this._eventListenerKeyup.bind(this));
this.popupWindow.document.addEventListener("mousemove",this._eventListenerMousemove.bind(this));this.popupWindow.document.addEventListener("click",this._eventListenerClick.bind(this))};a.prototype._append32BitIntToByteArray=function(a,c){for(var b=0;4>b;b++){var f=a;f&=255<<8*b;f>>=8*b;c.push(f)}};a.prototype._eventListenerKeydown=function(a){a.preventDefault();this.popupKeyCodes.includes(a.keyCode)||this.popupKeyCodes.push(a.keyCode)};a.prototype._eventListenerKeyup=function(a){a.preventDefault();
a=this.popupKeyCodes.indexOf(a.keyCode);-1<a&&this.popupKeyCodes.splice(a,1)};a.prototype._eventListenerMousemove=function(a){a=this._getPositionFromMouseEvent(a);void 0!==a&&(this.mouseMovePosition=a)};a.prototype._eventListenerClick=function(a){var b=this._getPositionFromMouseEvent(a);void 0!==b&&(0===a.button?this.mouseLeftClickPosition=b:1===a.button?this.mouseMiddleClickPosition=b:2===a.button&&(this.mouseRightClickPosition=b))};a.prototype._getPositionFromMouseEvent=function(a){if(this.popupCanvas){var b=
this.popupCanvas.getBoundingClientRect(),e=b.x,f=b.x+b.width,h=b.y,g=b.y+b.height,k=void 0,q=void 0;a.x>=e&&a.x<=f&&(k=a.x-e);a.y>=h&&a.y<=g&&(q=a.y-h);if(void 0!==k&&void 0!==q)return{x:this.popupCanvas.width/b.width*k,y:this.popupCanvas.height/b.height*q}}};return a}(),ui=function(a){return a&&("[object Function]"===Object.prototype.toString.call(a)||"function"===typeof a||a instanceof Function)},Ic,vi=function(){function a(a,c,e,f,h){this.wasmTerminalConfig=a;this.commandString=c;this.commandStartReadCallback=
e;this.commandEndCallback=f;h&&(this.wasmTty=h);this.commandOptionsForProcessesToRun=[];this.spawnedProcessObjects=[];this.spawnedProcesses=0;this.pipedStdinDataForNextProcess=new Uint8Array;this.isRunning=!1;this.supportsSharedArrayBuffer=this.wasmTerminalConfig.processWorkerUrl&&window.SharedArrayBuffer&&window.Atomics}a.prototype.runCommand=function(){return Y(this,void 0,void 0,function(){var a,c,e;return Z(this,function(b){switch(b.label){case 0:a=ag(this.commandString),b.label=1;case 1:b.trys.push([1,
3,,4]);if(1<a.length)throw Error("Only one command permitted");if("command"!==a[0].type)throw Error("Only commands allowed");c=this;return[4,this._getCommandOptionsFromAST(a[0],this.wasmTerminalConfig,this.wasmTty)];case 2:return c.commandOptionsForProcessesToRun=b.sent(),[3,4];case 3:return e=b.sent(),this.wasmTty&&(this.wasmTty.print("\r\n"),this.wasmTty.print("wasm shell: parse error ("+e.toString()+")\r\n")),console.error(e),this.commandEndCallback(),[2];case 4:return this.isRunning=!0,[4,this._tryToSpawnProcess(0)];
case 5:return b.sent(),[2]}})})};a.prototype.kill=function(){this.isRunning&&(this.spawnedProcessObjects.forEach(function(a){a.worker&&a.worker.terminate();a.ioDeviceWindow&&a.ioDeviceWindow.close()}),this.commandOptionsForProcessesToRun=[],this.spawnedProcessObjects=[],this.isRunning=!1,this.commandEndCallback())};a.prototype._addStdinToSharedStdin=function(a,c){if(this.spawnedProcessObjects[c]){var b=this.spawnedProcessObjects[c].sharedStdin,f=1;0<b[0]&&(f=b[0]);a.forEach(function(a,c){b[f+c]=a});
b[0]=f+a.length-1;Atomics.notify(b,0,1)}};a.prototype._tryToSpawnProcess=function(a){return Y(this,void 0,void 0,function(){return Z(this,function(b){switch(b.label){case 0:if(!(a+1>this.spawnedProcesses&&2>this.spawnedProcessObjects.length&&a<this.commandOptionsForProcessesToRun.length))return[3,2];this.spawnedProcesses++;return[4,this._spawnProcess(a)];case 1:b.sent(),b.label=2;case 2:return[2]}})})};a.prototype._spawnProcess=function(a){return Y(this,void 0,void 0,function(){var b,e;return Z(this,
function(c){switch(c.label){case 0:return b=void 0,this.commandOptionsForProcessesToRun[a].module&&this.supportsSharedArrayBuffer?[4,this._spawnProcessAsWorker(a)]:[3,2];case 1:return b=c.sent(),[3,4];case 2:return[4,this._spawnProcessAsService(a)];case 3:b=c.sent(),c.label=4;case 4:return this.spawnedProcessObjects.push(b),b.process.start(0<this.pipedStdinDataForNextProcess.length?this.pipedStdinDataForNextProcess:void 0),0<this.pipedStdinDataForNextProcess.length&&(this.pipedStdinDataForNextProcess=
new Uint8Array),e=!1,this.commandOptionsForProcessesToRun.length>a+1&&(e=void 0!==this.commandOptionsForProcessesToRun[a+1].callback),this.supportsSharedArrayBuffer&&!e&&this._tryToSpawnProcess(a+1),[2]}})})};a.prototype._spawnProcessAsWorker=function(a){return Y(this,void 0,void 0,function(){var b,e,f,h,g,k,q,t,p,u;return Z(this,function(c){switch(c.label){case 0:if(!this.wasmTerminalConfig.processWorkerUrl)throw Error("Terminal Config missing the Process Worker URL");b=this.wasmTerminalConfig.processWorkerUrl;
b="data:application/javascript;base64,LyoKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgICBDb3B5cmlnaHQgKGMpIE1pY3Jvc29mdCBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KICAgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOyB5b3UgbWF5IG5vdCB1c2UKICAgIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlCiAgICBMaWNlbnNlIGF0IGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAoKICAgIFRISVMgQ09ERSBJUyBQUk9WSURFRCBPTiBBTiAqQVMgSVMqIEJBU0lTLCBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkKICAgIEtJTkQsIEVJVEhFUiBFWFBSRVNTIE9SIElNUExJRUQsIElOQ0xVRElORyBXSVRIT1VUIExJTUlUQVRJT04gQU5ZIElNUExJRUQKICAgIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBUSVRMRSwgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UsCiAgICBNRVJDSEFOVEFCTElUWSBPUiBOT04tSU5GUklOR0VNRU5ULgoKICAgIFNlZSB0aGUgQXBhY2hlIFZlcnNpb24gMi4wIExpY2Vuc2UgZm9yIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucwogICAgYW5kIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KJ3VzZSBzdHJpY3QnOyhmdW5jdGlvbigpe2Z1bmN0aW9uIG1jKGMsYT1zZWxmKXthLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGZ1bmN0aW9uIGUoZCl7aWYoZCYmZC5kYXRhKXt2YXIge2lkOmYsdHlwZTpnLHBhdGg6aH09T2JqZWN0LmFzc2lnbih7cGF0aDpbXX0sZC5kYXRhKSxrPShkLmRhdGEuYXJndW1lbnRMaXN0fHxbXSkubWFwKEZhKTt0cnl7bGV0IGE9aC5zbGljZSgwLC0xKS5yZWR1Y2UoKGEsYyk9PmFbY10sYyksZT1oLnJlZHVjZSgoYSxjKT0+YVtjXSxjKTtzd2l0Y2goZyl7Y2FzZSAwOnZhciB0PWU7YnJlYWs7Y2FzZSAxOmFbaC5zbGljZSgtMSlbMF1dPUZhKGQuZGF0YS52YWx1ZSk7dD0hMDticmVhaztjYXNlIDI6dD1lLmFwcGx5KGEsayk7YnJlYWs7Y2FzZSAzOntsZXQgYT1uZXcgZSguLi5rKTt0PU9iamVjdC5hc3NpZ24oYSx7W3ZkXTohMH0pfWJyZWFrO2Nhc2UgNDp7bGV0IHtwb3J0MTphLHBvcnQyOmR9PW5ldyBNZXNzYWdlQ2hhbm5lbDttYyhjLGQpO3Q9CkNmKGEsW2FdKX1icmVhaztjYXNlIDU6dD12b2lkIDB9fWNhdGNoKHEpe3Q9cSxuYy5hZGQocSl9UHJvbWlzZS5yZXNvbHZlKHQpLmNhdGNoKGE9PntuYy5hZGQoYSk7cmV0dXJuIGF9KS50aGVuKGM9PntsZXQgW2QsaF09b2MoYyk7YS5wb3N0TWVzc2FnZShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sZCkse2lkOmZ9KSxoKTs1PT09ZyYmKGEucmVtb3ZlRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZSksIk1lc3NhZ2VQb3J0Ij09PWEuY29uc3RydWN0b3IubmFtZSYmYS5jbG9zZSgpKX0pfX0pO2Euc3RhcnQmJmEuc3RhcnQoKX1mdW5jdGlvbiBEYihjKXtpZihjKXRocm93IEVycm9yKCJQcm94eSBoYXMgYmVlbiByZWxlYXNlZCBhbmQgaXMgbm90IHVzZWFibGUiKTt9ZnVuY3Rpb24gcGMoYyxhPVtdLGI9ZnVuY3Rpb24oKXt9KXtsZXQgZD0hMSxlPW5ldyBQcm94eShiLHtnZXQoYixnKXtEYihkKTtpZihnPT09RGYpcmV0dXJuKCk9PlRhKGMse3R5cGU6NSxwYXRoOmEubWFwKGE9PgphLnRvU3RyaW5nKCkpfSkudGhlbigoKT0+eyJNZXNzYWdlUG9ydCI9PT1jLmNvbnN0cnVjdG9yLm5hbWUmJmMuY2xvc2UoKTtkPSEwfSk7aWYoInRoZW4iPT09Zyl7aWYoMD09PWEubGVuZ3RoKXJldHVybnt0aGVuOigpPT5lfTtiPVRhKGMse3R5cGU6MCxwYXRoOmEubWFwKGE9PmEudG9TdHJpbmcoKSl9KS50aGVuKEZhKTtyZXR1cm4gYi50aGVuLmJpbmQoYil9cmV0dXJuIHBjKGMsWy4uLmEsZ10pfSxzZXQoYixlLGgpe0RiKGQpO2NvbnN0IFtmLGddPW9jKGgpO3JldHVybiBUYShjLHt0eXBlOjEscGF0aDpbLi4uYSxlXS5tYXAoYT0+YS50b1N0cmluZygpKSx2YWx1ZTpmfSxnKS50aGVuKEZhKX0sYXBwbHkoYixlLGgpe0RiKGQpO2I9YVthLmxlbmd0aC0xXTtpZihiPT09RWYpcmV0dXJuIFRhKGMse3R5cGU6NH0pLnRoZW4oRmEpO2lmKCJiaW5kIj09PWIpcmV0dXJuIHBjKGMsYS5zbGljZSgwLC0xKSk7Y29uc3QgW2YsZ109d2QoaCk7cmV0dXJuIFRhKGMse3R5cGU6MixwYXRoOmEubWFwKGE9PgphLnRvU3RyaW5nKCkpLGFyZ3VtZW50TGlzdDpmfSxnKS50aGVuKEZhKX0sY29uc3RydWN0KGIsZSl7RGIoZCk7Y29uc3QgW2YsZ109d2QoZSk7cmV0dXJuIFRhKGMse3R5cGU6MyxwYXRoOmEubWFwKGE9PmEudG9TdHJpbmcoKSksYXJndW1lbnRMaXN0OmZ9LGcpLnRoZW4oRmEpfX0pO3JldHVybiBlfWZ1bmN0aW9uIHdkKGMpe2M9Yy5tYXAob2MpO3JldHVybltjLm1hcChhPT5hWzBdKSxBcnJheS5wcm90b3R5cGUuY29uY2F0LmFwcGx5KFtdLGMubWFwKGE9PmFbMV0pKV19ZnVuY3Rpb24gQ2YoYyxhKXt4ZC5zZXQoYyxhKTtyZXR1cm4gY31mdW5jdGlvbiBvYyhjKXtmb3IobGV0IFthLGJdb2YgeWQpaWYoYi5jYW5IYW5kbGUoYykpe2xldCBbZCxlXT1iLnNlcmlhbGl6ZShjKTtyZXR1cm5be3R5cGU6MyxuYW1lOmEsdmFsdWU6ZH0sZV19cmV0dXJuW3t0eXBlOjAsdmFsdWU6Y30seGQuZ2V0KGMpfHxbXV19ZnVuY3Rpb24gRmEoYyl7c3dpdGNoKGMudHlwZSl7Y2FzZSAzOnJldHVybiB5ZC5nZXQoYy5uYW1lKS5kZXNlcmlhbGl6ZShjLnZhbHVlKTsKY2FzZSAwOnJldHVybiBjLnZhbHVlfX1mdW5jdGlvbiBUYShjLGEsYil7cmV0dXJuIG5ldyBQcm9taXNlKGQ9PntsZXQgZT1GZigpO2MuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24gaChhKXthLmRhdGEmJmEuZGF0YS5pZCYmY
return[4,this._getBlobUrlForProcessWorker(b,this.wasmTty)];case 1:return e=c.sent(),f=new Worker(e),h=dc(f,[],void 0),g=new SharedArrayBuffer(8192),k=this.wasmTerminalConfig.wasmFs.toJSON(),q=new SharedArrayBuffer(8192),t=new kg(q),[4,new h(this.commandOptionsForProcessesToRun[a],k,Nb(this._processDataCallback.bind(this,{commandOptionIndex:a,sync:!1})),Nb(this._processEndCallback.bind(this,{commandOptionIndex:a,processWorker:f})),Nb(this._processErrorCallback.bind(this,{commandOptionIndex:a})),Nb(t),
q,g,Nb(this._processStartStdinReadCallback.bind(this)))];case 2:return p=c.sent(),u=new Int32Array(g),u[0]=-1,[2,{process:p,commandOptionIndex:a,ioDeviceWindow:t,worker:f,sharedStdin:u}]}})})};a.prototype._spawnProcessAsService=function(a){return Y(this,void 0,void 0,function(){var b,e,f;return Z(this,function(c){b=this.wasmTerminalConfig.wasmFs.toJSON();e=new kg;f=new ti(this.commandOptionsForProcessesToRun[a],b,this._processDataCallback.bind(this,{commandOptionIndex:a,sync:!0}),this._processEndCallback.bind(this,
{commandOptionIndex:a}),this._processErrorCallback.bind(this,{commandOptionIndex:a}),e);return[2,{process:f,commandOptionIndex:a,ioDeviceWindow:e}]})})};a.prototype._processDataCallback=function(a,c){var b=a.commandOptionIndex;a=a.sync;this.isRunning&&(b<this.commandOptionsForProcessesToRun.length-1?this.supportsSharedArrayBuffer&&1<this.spawnedProcessObjects.length&&this.spawnedProcessObjects[this.spawnedProcessObjects.length-1].commandOptionIndex>b?this._addStdinToSharedStdin(c,1):(b=new Uint8Array(c.length+
this.pipedStdinDataForNextProcess.length),b.set(this.pipedStdinDataForNextProcess),b.set(c,this.pipedStdinDataForNextProcess.length),this.pipedStdinDataForNextProcess=b):(c=(new TextDecoder("utf-8")).decode(c),this.wasmTty&&this.wasmTty.print(c,a)))};a.prototype._processEndCallback=function(a,c){var b=a.commandOptionIndex;(a=a.processWorker)&&a.terminate();c&&this.wasmTerminalConfig.wasmFs.fromJSON(c);b<this.commandOptionsForProcessesToRun.length-1?this._tryToSpawnProcess(b+1):(this.isRunning=!1,
this.commandEndCallback());this.spawnedProcessObjects.shift()};a.prototype._processErrorCallback=function(a,c,e){console.error(this.commandOptionsForProcessesToRun[a.commandOptionIndex].args[0]+": "+c);e&&this.wasmTerminalConfig.wasmFs.fromJSON(e);this.kill();this.commandEndCallback()};a.prototype._processStartStdinReadCallback=function(){var a=this;this.commandStartReadCallback().then(function(b){b=(new TextEncoder).encode(b+"\n");a._addStdinToSharedStdin(b,0)})};a.prototype._getBlobUrlForProcessWorker=
function(a,c){return Y(this,void 0,void 0,function(){var b,f;return Z(this,function(e){switch(e.label){case 0:if(Ic)return[2,Ic];c&&c.printStatus("[INFO] Downloading the process Web Worker (This happens once)...");return[4,Promise.all([fetch(a).then(function(a){return a.text()}),new Promise(function(a){return setTimeout(a,500)})]).then(function(a){return a[0]})];case 1:return b=e.sent(),c&&c.clearStatus(),f=new Blob([b]),Ic=window.URL.createObjectURL(f),[2,Ic]}})})};a.prototype._getCommandOptionsFromAST=
function(a,c,e){return Y(this,void 0,void 0,function(){var b,h,g,k,q,t,p,u,n,r,x,z,A=this;return Z(this,function(f){switch(f.label){case 0:return b=[],h=a.command.value,g=a.args.map(function(a){return a.value}),k=lh([h],g),q=Object.entries(a.env).map(function(a){a=ld(a,2);return[a[0],a[1].value]}),t={},q.forEach(function(a){a=ld(a,2);t[a[0]]=a[1]}),e&&(p=e.getTermSize(),u=p.rows,n=p.cols,t.LINES=u,t.COLUMNS=n),r=function(){return Y(A,void 0,void 0,function(){var f,g;return Z(this,function(h){switch(h.label){case 0:return a.redirects?
(f=a.redirects[0])&&"pipe"===f.type?[4,this._getCommandOptionsFromAST(f.command,c,e)]:[3,2]:[3,2];case 1:g=h.sent(),b=b.concat(g),h.label=2;case 2:return[2]}})})},[4,r()];case 1:return f.sent(),e&&e.printStatus("[INFO] Fetching the command "+h+" ..."),[4,c.fetchCommand({args:k,env:t})];case 2:return x=f.sent(),e&&e.clearStatus(),x instanceof Uint8Array?[4,WebAssembly.compile(x)]:[3,4];case 3:return z=f.sent(),b.unshift({args:k,env:t,module:z}),[3,5];case 4:ui(x)?b.unshift({args:k,env:t,callback:x}):
b.unshift(x),f.label=5;case 5:return[2,b]}})})};return a}(),wi=function(){function a(a,c,e){var b=this;void 0===e&&(e={historySize:10,maxAutocompleteEntries:100});this.handleCursorMove=function(a){0<a?(a=Math.min(a,b.wasmTty.getInput().length-b.wasmTty.getCursor()),b.wasmTty.setCursorDirectly(b.wasmTty.getCursor()+a)):0>a&&(a=Math.max(a,-b.wasmTty.getCursor()),b.wasmTty.setCursorDirectly(b.wasmTty.getCursor()+a))};this.handleCursorErase=function(a){a?0>=b.wasmTty.getCursor()||(a=b.wasmTty.getInput().substr(0,
b.wasmTty.getCursor()-1)+b.wasmTty.getInput().substr(b.wasmTty.getCursor()),b.wasmTty.clearInput(),b.wasmTty.setCursorDirectly(b.wasmTty.getCursor()-1),b.wasmTty.setInput(a,!0)):(a=b.wasmTty.getInput().substr(0,b.wasmTty.getCursor())+b.wasmTty.getInput().substr(b.wasmTty.getCursor()+1),b.wasmTty.setInput(a))};this.handleCursorInsert=function(a){var c=b.wasmTty.getInput().substr(0,b.wasmTty.getCursor())+a+b.wasmTty.getInput().substr(b.wasmTty.getCursor());b.wasmTty.setCursorDirectly(b.wasmTty.getCursor()+
a.length);b.wasmTty.setInput(c)};this.handleReadComplete=function(){b._activePrompt&&b._activePrompt.resolve&&(b._activePrompt.resolve(b.wasmTty.getInput()),b._activePrompt=void 0);b.wasmTty.print("\r\n");b._active=!1};this.handleTermData=function(a){if(b._active||"\u0003"===a){if(b.wasmTty.getFirstInit()&&b._activePrompt){var c=b.wasmTty.getBuffer().getLine(b.wasmTty.getBuffer().cursorY+b.wasmTty.getBuffer().baseY).translateToString(!1,0,b.wasmTty.getBuffer().cursorX);b._activePrompt.promptPrefix=
c;b.wasmTty.setPromptPrefix(c);b.wasmTty.setFirstInit(!1)}b._activeCharPrompt&&b._activeCharPrompt.resolve?(b._activeCharPrompt.resolve(a),b._activeCharPrompt=void 0,b.wasmTty.print("\r\n")):3<a.length&&27!==a.charCodeAt(0)?(a=a.replace(/[\r\n]+/g,"\r"),Array.from(a).forEach(function(a){return b.handleData(a)})):b.handleData(a)}};this.handleData=function(a){if(b._active||"\u0003"===a){var c=a.charCodeAt(0);if(27===c)switch(a.substr(1)){case "[A":b.history&&(a=b.history.getPrevious())&&(b.wasmTty.setInput(a),
b.wasmTty.setCursor(a.length));break;case "[B":b.history&&((a=b.history.getNext())||(a=""),b.wasmTty.setInput(a),b.wasmTty.setCursor(a.length));break;case "[D":b.handleCursorMove(-1);break;case "[C":b.handleCursorMove(1);break;case "[3~":b.handleCursorErase(!1);break;case "[F":b.wasmTty.setCursor(b.wasmTty.getInput().length);break;case "[H":b.wasmTty.setCursor(0);break;case "b":(a=ef(b.wasmTty.getInput(),b.wasmTty.getCursor()))&&b.wasmTty.setCursor(a);break;case "f":(a=nh(b.wasmTty.getInput(),b.wasmTty.getCursor()))&&
b.wasmTty.setCursor(a);break;case "\u007f":if(a=ef(b.wasmTty.getInput(),b.wasmTty.getCursor()))b.wasmTty.setInput(b.wasmTty.getInput().substr(0,a)+b.wasmTty.getInput().substr(b.wasmTty.getCursor())),b.wasmTty.setCursor(a)}else if(32>c||127===c)switch(a){case "\r":case "\n":case "\r":oh(b.wasmTty.getInput())?b.handleCursorInsert("\n"):b.handleReadComplete();break;case "\u007f":case "\b":case "\u0004":b.handleCursorErase(!0);break;case "\t":if(0<b._autocompleteHandlers.length){a=b.wasmTty.getInput().substr(0,
b.wasmTty.getCursor());c=md(a);var e=qh(b._autocompleteHandlers,a);e.sort();0===e.length?c||b.handleCursorInsert(" "):1===e.length?(a=ph(a),b.handleCursorInsert(e[0].substr(a.length)+" ")):e.length<=b.maxAutocompleteEntries?b.printAndRestartPrompt(function(){b.wasmTty.printWide(e)}):b.printAndRestartPrompt(function(){return b.wasmTty.readChar("Display all "+e.length+" possibilities? (y or n)").promise.then(function(a){"y"!==a&&"Y"!==a||b.wasmTty.printWide(e)})})}else b.handleCursorInsert(" ");
break;case "\u0001":b.wasmTty.setCursor(0);break;case "\u0002":b.handleCursorMove(-1);break;case "\u0003":case "\u001a":a=b.wasmTty.getInput();b.wasmTty.setCursor(a.length);b.wasmTty.setInput("");b.wasmTty.setCursorDirectly(0);b.wasmTty.print(a+"^C\r\n");b.history&&b.history.rewind();b.commandRunner&&(b.commandRunner.kill(),b.commandRunner=void 0);b.resolveActiveRead();break;case "\u0005":b.wasmTty.setCursor(b.wasmTty.getInput().length);break;case "\u0006":b.handleCursorMove(1);break;case "\u0007":b.history&&
b.history.rewind();b.wasmTty.setInput("");break;case "\x0B":b.wasmTty.setInput(b.wasmTty.getInput().substring(0,b.wasmTty.getCursor()));b.wasmTty.setCursor(b.wasmTty.getInput().length);break;case "\f":b.wasmTty.clearTty();b.wasmTty.print("$ "+b.wasmTty.getInput());break;case "\u000e":b.history&&((a=b.history.getNext())||(a=""),b.wasmTty.setInput(a),b.wasmTty.setCursor(a.length));break;case "\u0010":b.history&&(a=b.history.getPrevious())&&(b.wasmTty.setInput(a),b.wasmTty.setCursor(a.length));break;
case "\u0015":b.wasmTty.setInput(b.wasmTty.getInput().substring(b.wasmTty.getCursor())),b.wasmTty.setCursor(0)}else b.handleCursorInsert(a)}};this.wasmTerminalConfig=a;this.wasmTty=c;this.history=new ai(e.historySize);this.commandRunner=void 0;this.maxAutocompleteEntries=e.maxAutocompleteEntries;this._autocompleteHandlers=[function(a,c){return b.history.entries}];this._active=!1}a.prototype.prompt=function(){return Y(this,void 0,void 0,function(){var a,c;return Z(this,function(b){switch(b.label){case 0:if(this._activePrompt)return[2];
b.label=1;case 1:return b.trys.push([1,4,,5]),this._activePrompt=this.wasmTty.read("$ "),this._active=!0,[4,this._activePrompt.promise];case 2:a=b.sent();this.commandRunner&&this.commandRunner.kill();if(""===a)return this.prompt(),[2];if("!!"===a)if(this.history&&0<this.history.entries.length)a=this.history.entries[this.history.entries.length-1];else throw Error("No Previous command in History");else this.history&&this.history.push(this.wasmTty.getInput());this.commandRunner=this.getCommandRunner(a);
return[4,this.commandRunner.runCommand()];case 3:return b.sent(),[3,5];case 4:return c=b.sent(),this.wasmTty.println(""+c.toString()),this.prompt(),[3,5];case 5:return[2]}})})};a.prototype.isPrompting=function(){return this._active};a.prototype.getCommandRunner=function(a){var b=this;return new vi(this.wasmTerminalConfig,a,function(){return Y(b,void 0,void 0,function(){return Z(this,function(a){this._activePrompt=this.wasmTty.read("");this._active=!0;return[2,this._activePrompt.promise]})})},function(){setTimeout(function(){b.prompt()})},
this.wasmTty)};a.prototype.printAndRestartPrompt=function(a){var b=this;this.wasmTty.getCursor();this.wasmTty.setCursor(this.wasmTty.getInput().length);this.wasmTty.print("\r\n");var e=function(){b.wasmTty.setCursor(b.wasmTty.getCursor());b.wasmTty.setInput(b.wasmTty.getInput())};(a=a())?a.then(e):e()};a.prototype.resolveActiveRead=function(){this._activePrompt&&this._activePrompt.resolve&&(this._activePrompt.resolve(""),this._activePrompt=void 0);this._activeCharPrompt&&this._activeCharPrompt.resolve&&
(this._activeCharPrompt.resolve(""),this._activeCharPrompt=void 0);this._active=!1};a.prototype.rejectActiveRead=function(a){void 0===a&&(a="aborted");(this._activePrompt||this._activeCharPrompt)&&this.wasmTty.print("\r\n");this._activePrompt&&this._activePrompt.reject&&(this._activePrompt.reject(Error(a)),this._activePrompt=void 0);this._activeCharPrompt&&this._activeCharPrompt.reject&&(this._activeCharPrompt.reject(Error(a)),this._activeCharPrompt=void 0);this._active=!1};return a}(),xi=Ih||Hh.Terminal,
lg=["click","tap"],yi=function(){function a(a){var b=this;this.handleTermResize=function(a){var c=a.rows;a=a.cols;b.wasmTty.clearInput();b.wasmTty.setTermSize(a,c);b.wasmTty.setInput(b.wasmTty.getInput(),!0)};this.wasmTerminalConfig=new Yf(a);this.xterm=new xi({});this.resizeEvent=this.xterm.onResize(this.handleTermResize);this.xterm.onKey(function(a){if(" "===a.key)return a.domEvent.preventDefault(),!1});this.container=void 0;this.webLinksAddon=new Kh;this.fitAddon=new Jh;this.xterm.loadAddon(this.fitAddon);
this.xterm.loadAddon(this.webLinksAddon);this.wasmTerminalConfig=new Yf(a);this.wasmTty=new $h(this.xterm);this.wasmShell=new wi(this.wasmTerminalConfig,this.wasmTty);this.dataEvent=this.xterm.onData(this.wasmShell.handleTermData);this.isOpen=!1;this.pendingPrintOnOpen=""}a.prototype.open=function(a){var b=this,e=this.focus.bind(this);void 0!==this.container&&lg.forEach(function(a){b.container.removeEventListener(a,e)});this.container=a;this.xterm.open(a);this.isOpen=!0;setTimeout(function(){void 0!==
b.container&&lg.forEach(function(a){b.container.addEventListener(a,e)});b.pendingPrintOnOpen&&(b.wasmTty.print(b.pendingPrintOnOpen+"\n"),b.pendingPrintOnOpen="");b.wasmShell.prompt()})};a.prototype.fit=function(){this.fitAddon.fit()};a.prototype.focus=function(){this.xterm.focus();this.scrollToCursor()};a.prototype.scrollToCursor=function(){if(this.container){var a=this.wasmTty.getBuffer().cursorY,c=this.wasmTty.getSize(),e=this.container.getBoundingClientRect(),f=e.left;a=e.top+a/c.rows*e.height+
10;0>f&&(f=0);a>document.body.scrollHeight&&(a=document.body.scrollHeight);window.scrollTo(f,a)}};a.prototype.print=function(a,c){var b=this;a=a.replace(/\n\n/g,"\n \n");this.isOpen?this.wasmShell.isPrompting?this.wasmShell.printAndRestartPrompt(function(){b.wasmTty.print(a+"\n",c)}):this.wasmTty.print(a,c):this.pendingPrintOnOpen=this.pendingPrintOnOpen?this.pendingPrintOnOpen+a:a};a.prototype.runCommand=function(a){this.wasmShell.isPrompting()&&(this.wasmTty.setInput(a),this.wasmShell.handleReadComplete())};
a.prototype.destroy=function(){this.xterm.dispose();delete this.xterm};a.prototype.onPaste=function(a){this.wasmTty.print(a)};return a}(),zi=function(a){return Y(void 0,void 0,void 0,function(){var b,c,e,f;return Z(this,function(h){switch(h.label){case 0:return[4,fetch("https://registry.wapm.io/graphql",{method:"POST",mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({operationName:"shellGetCommandQuery",query:"query shellGetCommandQuery($command: String!) {\n command: getCommand(name: $command) {\n command\n module {\n abi\n publicUrl\n }\n packageVersion {\n package {\n displayName\n }\n }\n }\n}",
variables:{command:a}})})];case 1:return b=h.sent(),[4,b.json()];case 2:c=h.sent();e=function(a,b){a=a[b[0]];b.shift();return a?1<b.length?e(a,b):!0:!1};if(e(c,["data","command","module","publicUrl"])){f=c.data.command.module;if("wasi"!==f.abi)throw Error(a+" does not use the wasi abi. Currently, only the wasi abi is supported on the wapm shell.");return[2,f.publicUrl]}throw Error("command not found "+a);}})})},Ai=function(a){return Y(void 0,void 0,void 0,function(){var b,c;return Z(this,function(e){switch(e.label){case 0:return[4,
fetch(a)];case 1:return b=e.sent(),[4,b.arrayBuffer()];case 2:return c=e.sent(),[2,new Uint8Array(c)]}})})};Jc.default=yi;Jc.fetchCommandFromWAPM=function(a){var b=a.args;return Y(void 0,void 0,void 0,function(){var a,e;return Z(this,function(c){switch(c.label){case 0:return a=b[0],[4,zi(a)];case 1:return e=c.sent(),[4,Ai(e)];case 2:return[2,c.sent()]}})})};return Jc}({})