/* ***************************************************************************** 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. *****************************************************************************/ function aa(b){return b&&b.__esModule&&Object.prototype.hasOwnProperty.call(b,"default")?b["default"]:b}function ba(b,a){return a={exports:{}},b(a,a.exports),a.exports} var ca=ba(function(b){!function(a,c){b.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=33)}([function(a,b,d){Object.defineProperty(b, "__esModule",{value:!0});a=d(14);b.IBufferService=a.createDecorator("BufferService");b.ICoreMouseService=a.createDecorator("CoreMouseService");b.ICoreService=a.createDecorator("CoreService");b.IDirtyRowService=a.createDecorator("DirtyRowService");b.IInstantiationService=a.createDecorator("InstantiationService");b.ILogService=a.createDecorator("LogService");b.IOptionsService=a.createDecorator("OptionsService")},function(a,b){Object.defineProperty(b,"__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>22},b.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?f.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[h.CHAR_DATA_ATTR_INDEX];this.bg=0;var b=!1;if(2=c){var d=a[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=d&&57343>=d?this.content=1024*(c-55296)+d-56320+65536|a[h.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=a[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[h.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=a[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|a[h.CHAR_DATA_WIDTH_INDEX]<<22)},b.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}, b}(d(6).AttributeData);b.CellData=a},function(a,b){Object.defineProperty(b,"__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}();b.AttributeData=a},function(a,b){Object.defineProperty(b,"__esModule",{value:!0});b.addDisposableDomListener=function(a,b,c,f){return a.addEventListener(b,c,f),{dispose:function(){c&&a.removeEventListener(b,c,f)}}}},function(a,b){Object.defineProperty(b,"__esModule",{value:!0});b.stringFromCodePoint=function(a){return 65535>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)};b.utf32ToString=function(a,b,c){void 0===b&&(b=0);void 0===c&&(c=a.length);for(var d="";b>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<=(q= a.charCodeAt(e++))&&57343>=q?b[d++]=1024*(this._interim-55296)+q-56320+65536:(b[d++]=this._interim,b[d++]=q),this._interim=0);e=g){if(++e>=c)return this._interim=g,d;var q;56320<=(q=a.charCodeAt(e))&&57343>=q?b[d++]=1024*(g-55296)+q-56320+65536:(b[d++]=g,b[d++]=q)}else b[d++]=g}return d},a}();b.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,g,q,t=0,v=0,l=0;if(this.interim[0]){var n=!1,y=this.interim[0];y&=192==(224&y)?31:224==(240&y)?15:7;for(var B=0,O;(O=63&this.interim[++B])&&4>B;)y<<=6,y|=O;for(var X=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,M=X-B;l=c)return 0;if(128!=(192&(O=a[l++]))){l--;n=!0;break}this.interim[B++]=O;y<<=6;y|=63&O}n||(2===X?128>y?l--:b[t++]=y:3===X?2048>y||55296<=y&&57343>=y||(b[t++]=y):65536>y||1114111(d=a[l++]))b[t++]=d;else if(192==(224&d)){if(l>=c)return this.interim[0]=d,t;128!=(192&(e=a[l++]))?l--:128>(v=(31&d)<<6|63&e)?l--:b[t++]=v}else if(224==(240&d)){if(l>=c)return this.interim[0]=d,t;if(128!=(192&(e=a[l++])))l--;else{if(l>=c)return this.interim[0]=d,this.interim[1]=e,t;128!=(192&(g=a[l++]))?l--:2048>(v=(15&d)<<12|(63&e)<<6|63&g)||55296<=v&&57343>=v|| (b[t++]=v)}}else if(240==(248&d)){if(l>=c)return this.interim[0]=d,t;if(128!=(192&(e=a[l++])))l--;else{if(l>=c)return this.interim[0]=d,this.interim[1]=e,t;if(128!=(192&(g=a[l++])))l--;else{if(l>=c)return this.interim[0]=d,this.interim[1]=e,this.interim[2]=g,t;128!=(192&(q=a[l++]))?l--:65536>(v=(7&d)<<18|(63&e)<<12|(63&g)<<6|63&q)||1114111a.length?"0"+a:a}function e(a,b,d,e){return void 0!==e?"#"+c(a)+c(b)+c(d)+c(e):"#"+c(a)+c(b)+c(d)}function g(a,b,c,d){return void 0===d&&(d=255),(a<<24|b<<16|c<<8|d)>>>0}function f(a){return[a>>24&255,a>>16&255,a>>8&255,255&a]}function h(a){return k(a>>16&255,a>>8&255,255&a)}function k(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 r(a,b){return a>8),e=h(b>>8);if(r(d,e)>24&255,e=a>>16&255;a=a>>8&255;var g=b>>24&255,f=b>>16&255;b=b>>8&255;for(var l=r(k(g,b,f),k(d,e,a));l>>0}function l(a,b,c){var d=a>>24&255,e=a>>16&255;a=a>>8&255;var g=b>>24&255,f=b>>16&255;b=b>>8&255;for(var l=r(k(g,b,f),k(d,e,a));lg||255>f||255>b);)g=Math.min(255,g+Math.ceil(.1*(255-g))),f=Math.min(255,f+Math.ceil(.1*(255-f))),l=r(k(g,b=Math.min(255,b+Math.ceil(.1*(255-b))),f),k(d,e,a));return(g<<24|f<<16|b<<8|255)>>>0}Object.defineProperty(b,"__esModule",{value:!0});b.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)}};b.fromCss=function(a){return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0}};b.toPaddedHex=c;b.toCss=e;b.toRgba=g;b.fromRgba=f;b.opaque=function(a){a=(255|a.rgba)>>>0;var b=f(a);return{css:e(b[0],b[1],b[2]),rgba:a}};b.rgbRelativeLuminance=h;b.rgbRelativeLuminance2=k;b.contrastRatio=r;b.rgbaToColor=q;b.ensureContrastRatioRgba= t;b.ensureContrastRatio=function(a,b,c){if(a=t(a.rgba,b.rgba,c))return q(a>>24&255,a>>16&255,a>>8&255)};b.reduceLuminance=v;b.increaseLuminance=l},function(a,b){Object.defineProperty(b,"__esModule",{value:!0});var c=(a="undefined"==typeof navigator)?"node":navigator.userAgent;a=a?"node":navigator.platform;b.isFirefox=!!~c.indexOf("Firefox");b.isSafari=/^((?!chrome|android).)*safari/i.test(c);c=0<=["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(a);b.isMac=c;b.isIpad="iPad"===a;b.isIphone="iPhone"=== a;c=0<=["Windows","Win16","Win32","WinCE"].indexOf(a);b.isWindows=c;b.isLinux=0<=a.indexOf("Linux")},function(a,b){Object.defineProperty(b,"__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"})(b.C0||(b.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"})(b.C1||(b.C1={}))},function(a,b,d){Object.defineProperty(b,"__esModule",{value:!0});var c=d(3),g=d(9),f=d(24),h=d(6),k=d(27),r=d(10);a=function(){function a(a,b,c,d,e,g,f,k){this._container=a;this._alpha=d;this._colors=e;this._rendererId=g;this._bufferService=f;this._optionsService=k;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= k.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.prototype.onSelectionChanged=function(){},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=f.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,b,d){var e,f,l=this._getContrastColor(a);l||a.isFgRGB()||a.isBgRGB()?this._drawUncachedChars(a,b,d,l):(a.isInverse()?(e=a.isBgDefault()?g.INVERTED_DEFAULT_COLOR:a.getBgColor(),f=a.isFgDefault()?g.INVERTED_DEFAULT_COLOR:a.getFgColor()):(f=a.isBgDefault()?c.DEFAULT_COLOR:a.getBgColor(),e=a.isFgDefault()?c.DEFAULT_COLOR:a.getFgColor()),e+=this._optionsService.options.drawBoldTextInBrightColors&&a.isBold()&&8>e?8:0,this._currentGlyphIdentifier.chars= a.getChars()||c.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=a.getCode()||c.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=f,this._currentGlyphIdentifier.fg=e,this._currentGlyphIdentifier.bold=!!a.isBold(),this._currentGlyphIdentifier.dim=!!a.isDim(),this._currentGlyphIdentifier.italic=!!a.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,b*this._scaledCellWidth+this._scaledCharLeft,d*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(a, b,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=r.opaque(this._colors.background).css:a.isBgRGB()?this._ctx.fillStyle="rgb("+h.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("+h.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=g.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(),g=!!a.isInverse(),f=!!a.isInverse();if(g){var k=b;b=d;d=k;k=c;c=e;e=k}d=this._resolveBackgroundRgba(e,d,g);b=this._resolveForegroundRgba(c,b,g,f);if(b=r.ensureContrastRatioRgba(d,b,this._optionsService.options.minimumContrastRatio))return b= {css:r.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}();b.BaseRenderLayer=a},function(a,b){Object.defineProperty(b,"__esModule",{value:!0});b.serviceRegistry=new Map;b.getServiceDependencies=function(a){return a.di$dependencies||[]};b.createDecorator=function(a){function c(a,b,d){if(3!==arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");var e=c;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.serviceRegistry.has(a)?b.serviceRegistry.get(a):(c.toString=function(){return a},b.serviceRegistry.set(a,c),c)}},function(a,b){function c(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>22,2097152&b?this._combined[a].charCodeAt(this._combined[a].length-1):d]},a.prototype.set=function(a,b){this._data[3*a+1]=b[g.CHAR_DATA_ATTR_INDEX];1>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 b=this._data[3*a];return 2097152&b?this._combined[a]:2097151&b?c.stringFromCodePoint(2097151&b):""},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,b){var d=this._data[3*a];2097152&d?this._combined[a]+=c.stringFromCodePoint(b):(2097151&d?(this._combined[a]=c.stringFromCodePoint(2097151&d)+c.stringFromCodePoint(b),d&=-2097152,d|=2097152):d=b|4194304,this._data[3*a]=d)},a.prototype.insertCells=function(a,b,c){if(a%=this.length,bthis.length){var c=new Uint32Array(3*a);this.length&&(3*a=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>22);return 0},a.prototype.copyCellsFrom=function(a,b,c,d,e){var g=a._data;if(e)for(var f=d-1;0<=f;f--)for(e=0;3>e;e++)this._data[3*(c+f)+e]=g[3*(b+f)+e];else for(f=0;fe;e++)this._data[3*(c+f)+e]=g[3*(b+f)+e];d=Object.keys(a._combined);for(e=0;e=b&&(this._combined[g-b+c]=a._combined[g])},a.prototype.translateToString=function(a,b,d){void 0===a&&(a=!1); void 0===b&&(b=0);void 0===d&&(d=this.length);a&&(d=Math.min(d,this.getTrimmedLength()));for(a="";b>22||1}return a},a}();b.BufferLine=a},function(a,b){Object.defineProperty(b,"__esModule",{value:!0});b.promptLabel="Terminal input";b.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(a,b){Object.defineProperty(b,"__esModule",{value:!0}); b.CHARSETS={};b.DEFAULT_CHARSET=b.CHARSETS.B;b.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"};b.CHARSETS.A={"#":"\u00a3"};b.CHARSETS.B=null;b.CHARSETS[4]={"#":"\u00a3","@":"\u00be","[":"ij","\\":"\u00bd", "]":"|","{":"\u00a8","|":"f","}":"\u00bc","~":"\u00b4"};b.CHARSETS.C=b.CHARSETS[5]={"[":"\u00c4","\\":"\u00d6","]":"\u00c5","^":"\u00dc","`":"\u00e9","{":"\u00e4","|":"\u00f6","}":"\u00e5","~":"\u00fc"};b.CHARSETS.R={"#":"\u00a3","@":"\u00e0","[":"\u00b0","\\":"\u00e7","]":"\u00a7","{":"\u00e9","|":"\u00f9","}":"\u00e8","~":"\u00a8"};b.CHARSETS.Q={"@":"\u00e0","[":"\u00e2","\\":"\u00e7","]":"\u00ea","^":"\u00ee","`":"\u00f4","{":"\u00e9","|":"\u00f9","}":"\u00e8","~":"\u00fb"};b.CHARSETS.K={"@":"\u00a7", "[":"\u00c4","\\":"\u00d6","]":"\u00dc","{":"\u00e4","|":"\u00f6","}":"\u00fc","~":"\u00df"};b.CHARSETS.Y={"#":"\u00a3","@":"\u00a7","[":"\u00b0","\\":"\u00e7","]":"\u00e9","`":"\u00f9","{":"\u00e0","|":"\u00f2","}":"\u00e8","~":"\u00ec"};b.CHARSETS.E=b.CHARSETS[6]={"@":"\u00c4","[":"\u00c6","\\":"\u00d8","]":"\u00c5","^":"\u00dc","`":"\u00e4","{":"\u00e6","|":"\u00f8","}":"\u00e5","~":"\u00fc"};b.CHARSETS.Z={"#":"\u00a3","@":"\u00a7","[":"\u00a1","\\":"\u00d1","]":"\u00bf","{":"\u00b0","|":"\u00f1", "}":"\u00e7"};b.CHARSETS.H=b.CHARSETS[7]={"@":"\u00c9","[":"\u00c4","\\":"\u00d6","]":"\u00c5","^":"\u00dc","`":"\u00e9","{":"\u00e4","|":"\u00f6","}":"\u00e5","~":"\u00fc"};b.CHARSETS["="]={"#":"\u00f9","@":"\u00e0","[":"\u00e9","\\":"\u00e7","]":"\u00ea","^":"\u00ee",_:"\u00e8","`":"\u00f4","{":"\u00e4","|":"\u00f6","}":"\u00fc","~":"\u00fb"}},function(a,b,d){Object.defineProperty(b,"__esModule",{value:!0});var c=d(15);b.wcwidth=function(a){var b=[[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,g=new Uint8Array(65536);c.fill(g,1);g[0]=a.nul;c.fill(g,a.control,1,32);c.fill(g,a.control,127,160);c.fill(g,2,4352,4448);g[9001]=2;g[9002]=2;c.fill(g,2,11904,42192);g[12351]=1;c.fill(g,2,44032,55204);c.fill(g,2,63744,64256);c.fill(g,2,65040,65050);c.fill(g,2,65072,65136);c.fill(g,2,65280, 65377);c.fill(g,2,65504,65511);for(a=0;aa)a=0|e;else if(127>a)a=1;else if(65536>a)a=g[a];else{a:{var b=a;var c,f=0,q=d.length-1;if(!(bd[q][1]))for(;q>=f;)if(b>d[c=f+q>>1][1])f=c+1;else{if(!(b=a||196608<=a&&262141>=a?2:1}return a}}({nul:0,control:0});b.getStringCellWidth=function(a){for(var c=0,d=a.length,e=0;e= g){if(++e>=d)return c+b.wcwidth(g);var q=a.charCodeAt(e);56320<=q&&57343>=q?g=1024*(g-55296)+q-56320+65536:c+=b.wcwidth(q)}c+=b.wcwidth(g)}return c}},function(a,b){Object.defineProperty(b,"__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>8,d=255&this._subParamsIdx[b];0=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=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(-1>a)throw Error("values lesser than -1 are not allowed"); this._subParams[this._subParamsLength++]=2147483647>8)},a.prototype.getSubParams=function(a){var b=this._subParamsIdx[a]>>8;a=255&this._subParamsIdx[a];return 0>8,d=255&this._subParamsIdx[b];0d||57c.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}();b.OscHandler= a},function(a,b){Object.defineProperty(b,"__esModule",{value:!0});b.PAYLOAD_LIMIT=1E7},function(a,b,d){Object.defineProperty(b,"__esModule",{value:!0});var c=d(8),g=d(20),f=d(22),h=[];a=function(){function a(){this._handlers=Object.create(null);this._active=h;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=h;this._ident=0},a.prototype.hook=function(a,b){if(this.reset(),this._ident=a,this._active=this._handlers[a]||h,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,b,d){if(this._active.length)for(var e=this._active.length-1;0<=e;e--)this._active[e].put(a,b,d);else this._handlerFb(this._ident,"PUT",c.utf32ToString(a,b,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=h;this._ident=0},a}();b.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,b,d){this._hitLimit||(this._data+=c.utf32ToString(a,b,d),this._data.length>f.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 g.Params)), this._params=void 0,this._data="",this._hitLimit=!1,b},a}();b.DcsHandler=a},function(a,b,d){Object.defineProperty(b,"__esModule",{value:!0});var c=d(25),g=d(43),f=[];b.acquireCharAtlas=function(a,b,d,e,t){a=c.generateConfig(e,t,a,d);for(d=0;dd;d++){var e=b[d/36%6|0],g=b[d/6%6|0],f=b[d%6];a.push({css:c.toCss(e,g, f),rgba:c.toRgba(e,g,f)})}for(d=0;24>d;d++)b=8+10*d,a.push({css:c.toCss(b,b,b),rgba:c.toRgba(b,b,b)});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 g.ColorContrastCache;this.colors={foreground:f,background:h,cursor:k,cursorAccent:r, selection:q,selectionOpaque:c.blend(h,q),ansi:b.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,f);this.colors.background=this._parseColor(a.background,h);this.colors.cursor=this._parseColor(a.cursor,k,!0);this.colors.cursorAccent=this._parseColor(a.cursorAccent,r,!0);this.colors.selection= this._parseColor(a.selection,q,!0);this.colors.selectionOpaque=c.blend(this.colors.background,this.colors.selection);this.colors.ansi[0]=this._parseColor(a.black,b.DEFAULT_ANSI_COLORS[0]);this.colors.ansi[1]=this._parseColor(a.red,b.DEFAULT_ANSI_COLORS[1]);this.colors.ansi[2]=this._parseColor(a.green,b.DEFAULT_ANSI_COLORS[2]);this.colors.ansi[3]=this._parseColor(a.yellow,b.DEFAULT_ANSI_COLORS[3]);this.colors.ansi[4]=this._parseColor(a.blue,b.DEFAULT_ANSI_COLORS[4]);this.colors.ansi[5]=this._parseColor(a.magenta, b.DEFAULT_ANSI_COLORS[5]);this.colors.ansi[6]=this._parseColor(a.cyan,b.DEFAULT_ANSI_COLORS[6]);this.colors.ansi[7]=this._parseColor(a.white,b.DEFAULT_ANSI_COLORS[7]);this.colors.ansi[8]=this._parseColor(a.brightBlack,b.DEFAULT_ANSI_COLORS[8]);this.colors.ansi[9]=this._parseColor(a.brightRed,b.DEFAULT_ANSI_COLORS[9]);this.colors.ansi[10]=this._parseColor(a.brightGreen,b.DEFAULT_ANSI_COLORS[10]);this.colors.ansi[11]=this._parseColor(a.brightYellow,b.DEFAULT_ANSI_COLORS[11]);this.colors.ansi[12]=this._parseColor(a.brightBlue, b.DEFAULT_ANSI_COLORS[12]);this.colors.ansi[13]=this._parseColor(a.brightMagenta,b.DEFAULT_ANSI_COLORS[13]);this.colors.ansi[14]=this._parseColor(a.brightCyan,b.DEFAULT_ANSI_COLORS[14]);this.colors.ansi[15]=this._parseColor(a.brightWhite,b.DEFAULT_ANSI_COLORS[15]);this._contrastCache.clear()},a.prototype._parseColor=function(a,b,d){if(void 0===d&&(d=this.allowTransparency),void 0===a)return b;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=a,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+ a+" is invalid using fallback "+b.css),b;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 "+b.css+"."),b;if(5===a.length){e=parseInt(a.substr(1),16);a=16*(e>>12&15);b=16*(e>>8&15);d=16*(e>>4&15);e=16*(15&e);var g=c.toRgba(a,b,d,e)}else a=(g=parseInt(a.substr(1),16))>>24&255,b=g>>16&255,d=g>>8&255,e=255&g;return{rgba:g,css:c.toCss(a,b,d,e)}}return{css:a, rgba:c.toRgba(e[0],e[1],e[2],e[3])}},a}();b.ColorManager=a},function(a,b){Object.defineProperty(b,"__esModule",{value:!0});b.throwIfFalsy=function(a){if(!a)throw Error("value must not be falsy");return a}},function(a,b,d){var c,g=this&&this.__extends||(c=function(a,b){return(c=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 d(){this.constructor=a}c(a,b);a.prototype=null=== b?Object.create(b):(d.prototype=b.prototype,new d)});Object.defineProperty(b,"__esModule",{value:!0});a=d(6);var f=d(3),h=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 g(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(){throw Error("not implemented");},b.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},b}(a.AttributeData);b.JoinedCellData=d;d=function(){function a(a){this._bufferService=a;this._characterJoiners=[];this._nextCharacterJoinerId=0;this._workCell=new h.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=b?a[e]:a[e]?f(a[e],b-1):a[e];return c}},function(a,b,d){Object.defineProperty(b, "__esModule",{value:!0});var c=d(34),g=d(17),f=d(78);a=function(){function a(a){this._core=new c.Terminal(a);this._addonManager=new f.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 q(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 h(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 g},enumerable:!0,configurable:!0}),a.prototype._verifyIntegers=function(){for(var a=[],b=0;ba||a>=this._line.length))return new r(this._line,a)},a.prototype.translateToString=function(a,b,c){return this._line.translateToString(a,b,c)},a}(),r=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}(),q=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,b,d){var c,g=this&&this.__extends||(c=function(a,b){return(c=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 d(){this.constructor=a}c(a,b);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)});Object.defineProperty(b, "__esModule",{value:!0});var f=d(35),h=d(36),k=d(37),r=d(12),q=d(38),t=d(40),v=d(50),l=d(51),n=d(11),y=d(7),B=d(17),O=d(54),X=d(55),M=d(56),ha=d(57),R=d(59),C=d(1),H=d(16),qa=d(60),V=d(26),ra=d(61),I=d(0),sa=d(62),ta=d(4),ja=d(63),Fa=d(64);a=d(2);var Sa=d(70),xa=d(71),ma=d(72),P=d(73),ya=d(74),ua=d(75),J=d(76),G=d(77),da="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=n,c.mouseEvents=0,c._keyDownHandled=!1,c._blankLine= null,c._onCursorMove=new C.EventEmitter,c._onData=new C.EventEmitter,c._onBinary=new C.EventEmitter,c._onKey=new C.EventEmitter,c._onLineFeed=new C.EventEmitter,c._onRender=new C.EventEmitter,c._onResize=new C.EventEmitter,c._onScroll=new C.EventEmitter,c._onSelectionChange=new C.EventEmitter,c._onTitleChange=new C.EventEmitter,c._onFocus=new C.EventEmitter,c._onBlur=new C.EventEmitter,c.onA11yCharEmitter=new C.EventEmitter,c.onA11yTabEmitter=new C.EventEmitter,c._instantiationService=new ya.InstantiationService, c.optionsService=new sa.OptionsService(b),c._instantiationService.setService(I.IOptionsService,c.optionsService),c._bufferService=c._instantiationService.createInstance(Fa.BufferService),c._instantiationService.setService(I.IBufferService,c._bufferService),c._logService=c._instantiationService.createInstance(ma.LogService),c._instantiationService.setService(I.ILogService,c._logService),c._coreService=c._instantiationService.createInstance(xa.CoreService,function(){return c.scrollToBottom()}),c._instantiationService.setService(I.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(ua.CoreMouseService),c._instantiationService.setService(I.ICoreMouseService,c._coreMouseService),c._dirtyRowService=c._instantiationService.createInstance(P.DirtyRowService),c._instantiationService.setService(I.IDirtyRowService,c._dirtyRowService),c._setupOptionsListeners(),c._setup(),c._writeBuffer= new J.WriteBuffer(function(a){return c._inputHandler.parse(a)}),c}return g(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=da?da.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=H.DEFAULT_ATTR_DATA.clone();this._eraseAttrData=H.DEFAULT_ATTR_DATA.clone();this.params=[];this.currentParam=0;this._userScrolling=!1;this._inputHandler=new q.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 v.Linkifier(this._bufferService,this._logService);this.options.windowsMode&&this._enableWindowsMode()},b.prototype._enableWindowsMode=function(){this._windowsMode||(this._windowsMode= this.onLineFeed(qa.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,g,f;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 M.AccessibilityManager(a,a._renderService)):(null===(g=a._accessibilityManager)|| void 0===g||g.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===(f=a._windowsMode)||void 0===f||f.dispose(),a._windowsMode=void 0)}})},b.prototype._onTextAreaFocus=function(a){this.sendFocus&&this._coreService.triggerDataEvent(r.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(r.C0.ESC+"[O");this.element.classList.remove("focus");this._onBlur.fire()},b.prototype._initGlobal=function(){function a(a){return k.handlePasteEvent(a,b.textarea,b.bracketedPasteMode,b._coreService)}var b=this;this._bindKeys();this.register(y.addDisposableDomListener(this.element, "copy",function(a){b.hasSelection()&&k.copyHandler(a,b._selectionService)}));this.register(y.addDisposableDomListener(this.textarea,"paste",a));this.register(y.addDisposableDomListener(this.element,"paste",a));n.isFirefox?this.register(y.addDisposableDomListener(this.element,"mousedown",function(a){2===a.button&&k.rightClickHandler(a,b.textarea,b.screenElement,b._selectionService,b.options.rightClickSelectsWord)})):this.register(y.addDisposableDomListener(this.element,"contextmenu",function(a){k.rightClickHandler(a, b.textarea,b.screenElement,b._selectionService,b.options.rightClickSelectsWord)}));n.isLinux&&this.register(y.addDisposableDomListener(this.element,"auxclick",function(a){1===a.button&&k.moveTextAreaUnderMouseCursor(a,b.textarea,b.screenElement)}))},b.prototype._bindKeys=function(){var a=this;this.register(y.addDisposableDomListener(this.textarea,"keyup",function(b){return a._keyUp(b)},!0));this.register(y.addDisposableDomListener(this.textarea,"keydown",function(b){return a._keyDown(b)},!0));this.register(y.addDisposableDomListener(this.textarea, "keypress",function(b){return a._keyPress(b)},!0));this.register(y.addDisposableDomListener(this.textarea,"compositionstart",function(){return a._compositionHelper.compositionstart()}));this.register(y.addDisposableDomListener(this.textarea,"compositionupdate",function(b){return a._compositionHelper.compositionupdate(b)}));this.register(y.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.");da.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=da.createDocumentFragment();this._viewportElement=da.createElement("div");this._viewportElement.classList.add("xterm-viewport");a.appendChild(this._viewportElement);this._viewportScrollArea=da.createElement("div");this._viewportScrollArea.classList.add("xterm-scroll-area");this._viewportElement.appendChild(this._viewportScrollArea);this.screenElement=da.createElement("div");this.screenElement.classList.add("xterm-screen"); this._helperContainer=da.createElement("div");this._helperContainer.classList.add("xterm-helpers");this.screenElement.appendChild(this._helperContainer);a.appendChild(this.screenElement);this.textarea=da.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea");this.textarea.setAttribute("aria-label",B.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(y.addDisposableDomListener(this.textarea,"focus",function(a){return b._onTextAreaFocus(a)}));this.register(y.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(ta.ICoreBrowserService,c);this._charSizeService=this._instantiationService.createInstance(ja.CharSizeService, this._document,this._helperContainer);this._instantiationService.setService(ta.ICharSizeService,this._charSizeService);this._compositionView=da.createElement("div");this._compositionView.classList.add("composition-view");this._compositionHelper=this._instantiationService.createInstance(f.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 V.ColorManager(da,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(ra.RenderService,a,this.rows,this.screenElement);this._instantiationService.setService(ta.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(O.SoundService);this._instantiationService.setService(ta.ISoundService,this._soundService);this._mouseService=this._instantiationService.createInstance(Sa.MouseService);this._instantiationService.setService(ta.IMouseService,this._mouseService);this.viewport=this._instantiationService.createInstance(h.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(l.SelectionService, function(a,c){return b.scrollLines(a,c)},this.element,this.screenElement);this._instantiationService.setService(ta.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(y.addDisposableDomListener(this._viewportElement,"scroll",function(){return b._selectionService.refresh()}));this._mouseZoneManager=this._instantiationService.createInstance(X.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(y.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 M.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(t.Renderer,this._colorManager.colors,this.screenElement,this.linkifier);case "dom":return this._instantiationService.createInstance(ha.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){a.buttons||e(a)}function b(a){a.buttons&&e(a)}function c(a){return e(a),a.preventDefault(),g.cancel(a)}function d(a){return e(a),a.buttons||(g._document.removeEventListener("mouseup",q),h&&g._document.removeEventListener("mousemove",h)),g.cancel(a)} function e(a){var b,c;if(!(b=f._mouseService.getRawByteCoords(a,f.screenElement,f.cols,f.rows)))return!1;switch(a.overrideType||a.type){case "mousemove":var d=32;void 0===a.buttons?(c=3,void 0!==a.button&&(c=3>a.button?a.button:3)):c=1&a.buttons?0:4&a.buttons?1:2&a.buttons?2:3;break;case "mouseup":d=0;c=3>a.button?a.button:3;break;case "mousedown":d=1;c=3>a.button?a.button:3;break;case "wheel":0!==a.deltaY&&(d=0>a.deltaY?0:1);c=4;break;default:return!1}return!(void 0===d||void 0===c||4a.deltaY?"A":"B");for(var c="",d=0;da){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){k.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=R.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!==r.C0.ETX&&b.key!==r.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||47g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a, b,c,d);else for(var q=a.length-1;0<=q;q--)(e=a[q])&&(f=(3>g?e(f):3g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var l=a.length-1;0<=l;l--)(e=a[l])&&(f=(3>g?e(f):3b&&0!==this._viewportElement.scrollTop||0",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(f.C0.BEL,function(){return n.bell()});n._parser.setExecuteHandler(f.C0.LF,function(){return n.lineFeed()});n._parser.setExecuteHandler(f.C0.VT,function(){return n.lineFeed()});n._parser.setExecuteHandler(f.C0.FF,function(){return n.lineFeed()});n._parser.setExecuteHandler(f.C0.CR,function(){return n.carriageReturn()});n._parser.setExecuteHandler(f.C0.BS,function(){return n.backspace()}); n._parser.setExecuteHandler(f.C0.HT,function(){return n.tab()});n._parser.setExecuteHandler(f.C0.SO,function(){return n.shiftOut()});n._parser.setExecuteHandler(f.C0.SI,function(){return n.shiftIn()});n._parser.setExecuteHandler(f.C1.IND,function(){return n.index()});n._parser.setExecuteHandler(f.C1.NEL,function(){return n.nextLine()});n._parser.setExecuteHandler(f.C1.HTS,function(){return n.tabSet()});n._parser.setOscHandler(0,new O.OscHandler(function(a){return n.setTitle(a)}));n._parser.setOscHandler(2, new O.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()});var H=this,qa;for(qa in h.CHARSETS)B(qa);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 ha(n._bufferService,n._coreService,n._logService,n._optionsService)),n}return g(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.lengththis._parseBuffer.length&&(this._parseBuffer=new Uint32Array(Math.min(a.length,131072))),this._dirtyRowService.clearRange(),131072d&&g){var B=g[String.fromCharCode(d)];B&&(d=B.charCodeAt(0))}if(f&&this._terminal.onA11yCharEmitter.fire(t.stringFromCodePoint(d)),b||!e.x){if(e.x+b-1>=l)if(q)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),r=e.lines.get(e.y+e.ybase);else if(e.x=l-1,2===b)continue;if(h&&(r.insertCells(e.x,b,e.getNullCell(v)),2===r.getWidth(l-1)&&r.setCellFromCodePoint(l-1,n.NULL_CELL_CODE,n.NULL_CELL_WIDTH,v.fg,v.bg)),r.setCellFromCodePoint(e.x++,d,b,v.fg,v.bg),0=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.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.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,0b.scrollBottom||b.yb.scrollBottom||b.yb.scrollBottom||b.yb.scrollBottom||b.yb.scrollBottom||b.yb.scrollBottom||b.y0;276;0c"):this._terminal.is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._coreService.triggerDataEvent(a.params[0]+"c"):this._terminal.is("screen")&& this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c"))},b.prototype.setMode=function(a){for(var b=0;b=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=v.DEFAULT_ATTR_DATA.fg,d.bg=v.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&v.DEFAULT_ATTR_DATA.fg):49===b?(d.bg&=-67108864, d.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):38===b||48===b?e+=this._extractColor(a,e,d):100===b?(d.fg&=-67108864,d.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,d.bg&=-67108864,d.bg|=16777215&v.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(f.C0.ESC+"[0n");break;case 6:this._coreService.triggerDataEvent(f.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(f.C0.ESC+"[?"+(this._bufferService.buffer.y+1)+";"+(this._bufferService.buffer.x+1)+"R")}},b.prototype.softReset=function(){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=v.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(){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(){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,h.DEFAULT_CHARSET)},b.prototype.selectCharset=function(a){2===a.length?"/"!==a[0]&&this._terminal.setgCharset(M[a[0]], h.CHARSETS[a[1]]||h.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 y.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;cc||63e||47a||a>b[1])throw Error("final must be in range "+b[0]+" .. "+b[1]);return c<<=8,c|a},c.prototype.identToString=function(a){for(var b=[];a;)b.push(String.fromCharCode(255&a)),a>>=8;return b.reverse().join("")},c.prototype.dispose=function(){this._csiHandlers=Object.create(null);this._executeHandlers=Object.create(null);this._escHandlers=Object.create(null);this._oscParser.dispose();this._dcsParser.dispose()}, c.prototype.setPrintHandler=function(a){this._printHandler=a},c.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},c.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)}}},c.prototype.setEscHandler=function(a,b){this._escHandlers[this._identifier(a,[48,126])]=[b]},c.prototype.clearEscHandler= function(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]},c.prototype.setEscHandlerFallback=function(a){this._escHandlerFb=a},c.prototype.setExecuteHandler=function(a,b){this._executeHandlers[a.charCodeAt(0)]=b},c.prototype.clearExecuteHandler=function(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]},c.prototype.setExecuteHandlerFallback=function(a){this._executeHandlerFb=a},c.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)}}},c.prototype.setCsiHandler=function(a,b){this._csiHandlers[this._identifier(a)]=[b]},c.prototype.clearCsiHandler=function(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]},c.prototype.setCsiHandlerFallback=function(a){this._csiHandlerFb=a},c.prototype.addDcsHandler= function(a,b){return this._dcsParser.addHandler(this._identifier(a),b)},c.prototype.setDcsHandler=function(a,b){this._dcsParser.setHandler(this._identifier(a),b)},c.prototype.clearDcsHandler=function(a){this._dcsParser.clearHandler(this._identifier(a))},c.prototype.setDcsHandlerFallback=function(a){this._dcsParser.setHandlerFallback(a)},c.prototype.addOscHandler=function(a,b){return this._oscParser.addHandler(a,b)},c.prototype.setOscHandler=function(a,b){this._oscParser.setHandler(a,b)},c.prototype.clearOscHandler= function(a){this._oscParser.clearHandler(a)},c.prototype.setOscHandlerFallback=function(a){this._oscParser.setHandlerFallback(a)},c.prototype.setErrorHandler=function(a){this._errorHandler=a},c.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},c.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},c.prototype.parse=function(a, b){for(var c=0,d,e=this.currentState,g=this._oscParser,f=this._dcsParser,q=this._collect,l=this._params,h=this.TRANSITIONS.table,k=0;k(c=a[k])?c:160)])>>4){case 2:for(e=k+1;;++e){if(e>=b||32>(c=a[e])||126c){this._printHandler(a,k,e);k=e-1;break}if(++e>=b||32>(c=a[e])||126c){this._printHandler(a,k,e);k=e-1;break}if(++e>=b||32>(c=a[e])||126c){this._printHandler(a,k,e);k=e-1;break}if(++e>=b||32>(c=a[e])||126c){this._printHandler(a,k,e);k= 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:k,code:c,currentState:e,collect:q,params:l,abort:!1}).abort)return;break;case 7:for(var r=(e=this._csiHandlers[q<<8|c])?e.length-1:-1;0<=r&&!1===e[r](l);r--);0>r&&this._csiHandlerFb(q<<8|c,l);this.precedingCodepoint=0;break;case 8:do switch(c){case 59:l.addParam(0);break;case 58:l.addSubParam(-1);break;default:l.addDigit(c-48)}while(++k< b&&47<(c=a[k])&&60>c);k--;break;case 9:q<<=8;q|=c;break;case 10:for(r=(e=this._escHandlers[q<<8|c])?e.length-1:-1;0<=r&&!1===e[r]();r--);0>r&&this._escHandlerFb(q<<8|c);this.precedingCodepoint=0;break;case 11:l.reset();l.addParam(0);q=0;break;case 12:f.hook(q<<8|c,l);break;case 13:for(e=k+1;;++e)if(e>=b||24===(c=a[e])||26===c||27===c||127c){f.put(a,k,e);k=e-1;break}break;case 14:f.unhook(24!==c&&26!==c);27===c&&(d|=1);l.reset();l.addParam(0);this.precedingCodepoint=q=0;break;case 4:g.start(); break;case 5:for(e=k+1;;e++)if(e>=b||32>(c=a[e])||127=c){g.put(a,k,e);k=e-1;break}break;case 6:g.end(24!==c&&26!==c),27===c&&(d|=1),l.reset(),l.addParam(0),this.precedingCodepoint=q=0}e=15&d}this._collect=q;this.currentState=e},c}(a.Disposable);b.EscapeSequenceParser=d},function(a,b,d){var c,g=this&&this.__extends||(c=function(a,b){return(c=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 d(){this.constructor=a}c(a,b);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)}),f=this&&this.__decorate||function(a,b,c,d){var e,g=arguments.length,f=3>g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var q=a.length-1;0<=q;q--)(e=a[q])&&(f=(3>g?e(f):3e&&(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("+h.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);b.TextRenderLayer=d},function(a,b){Object.defineProperty(b,"__esModule",{value:!0});a=function(){function a(){this.cache=[]}return a.prototype.resize=function(a,b){for(var c=0;cthis._drawToCacheCount?(f=this._cacheMap.sizea.code}, b.prototype._toCoordinateX=function(a){return a%this._width*this._config.scaledCharWidth},b.prototype._toCoordinateY=function(a){return Math.floor(a/this._width)*this._config.scaledCharHeight},b.prototype._drawFromCache=function(a,b,c,d){if(!b.isEmpty){var e=this._toCoordinateX(b.index),g=this._toCoordinateY(b.index);a.drawImage(b.inBitmap?this._bitmap:this._cacheCanvas,e,g,this._config.scaledCharWidth,this._config.scaledCharHeight,c,d,this._config.scaledCharWidth,this._config.scaledCharHeight)}}, b.prototype._getColorFromAnsiIndex=function(a){return aa.bg?this._getColorFromAnsiIndex(a.bg):this._config.colors.background},b.prototype._getForegroundColor=function(a){return a.fg===h.INVERTED_DEFAULT_COLOR?v.opaque(this._config.colors.background):256>a.fg?this._getColorFromAnsiIndex(a.fg): this._config.colors.foreground},b.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=h.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,g=c.rgba>>>16&255;c=c.rgba>>>8&255;for(var f=0;f=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=this._bufferService.rows||0>f||((this._ctx.fillStyle=this._colors.selection.css,c)?(d=a[0],this._fillCells(d,g,b[0]-d,f-g+1)):(d=d===g?a[0]:0,this._fillCells(d,g,(g===f?b[0]:this._bufferService.cols)-d,1),(this._fillCells(0,g+1,this._bufferService.cols,Math.max(f-g-1,0)),g!==f)&&this._fillCells(0,f,e===f?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);b.SelectionRenderLayer=a},function(a, b,d){var c,g=this&&this.__extends||(c=function(a,b){return(c=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 d(){this.constructor=a}c(a,b);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)});Object.defineProperty(b,"__esModule",{value:!0});a=d(13);var f=d(5);d=function(a){function b(b,c,d,e,g,h,k,r,X){b=a.call(this,b,"cursor",c,!0,d,e,h,k)||this;return b._onRequestRefreshRowsEvent= g,b.bufferService=h,b.optionsService=k,b._coreService=r,b._coreBrowserService=X,b._cell=new f.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 g(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 h(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(){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},b.prototype._render=function(){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var a=this._bufferService.buffer.ybase+this._bufferService.buffer.y,b=a-this._bufferService.buffer.ydisp;if(0>b||b>=this._bufferService.rows)this._clearCursor();else if(this._bufferService.buffer.lines.get(a).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,a=this._optionsService.options.cursorStyle,a&&"block"!==a?this._cursorRenderers[a](this._bufferService.buffer.x,b,this._cell):this._renderBlurCursor(this._bufferService.buffer.x,b,this._cell),this._ctx.restore(),this._state.x=this._bufferService.buffer.x,this._state.y=b,this._state.isFocused=!1,this._state.style=a,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===b&&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,b, this._cell);this._ctx.restore();this._state.x=this._bufferService.buffer.x;this._state.y=b;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){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){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);b.CursorRenderLayer=d;var h=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.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;ch)return"break";var l=q._bufferService.buffer.stringIndexToBufferIndex(a,h);if(0>l[0])return"break";var k=q._bufferService.buffer.lines.get(l[0]);if(!k)return"break";var r=(k=k.getFg(l[1]))?k>>9&511:void 0;c.validationCallback?c.validationCallback(d,function(a){g._rowsTimeoutId||a&&g._addLink(l[1],l[0]-g._bufferService.buffer.ydisp,d,c,r)}):q._addLink(l[1],l[0]-q._bufferService.buffer.ydisp,d,c,r)}for(var e,g=this,f=new RegExp(c.regex.source, (c.regex.flags||"")+"g"),h=-1,q=this;null!==(e=f.exec(b))&&"break"!==d(););},a.prototype._addLink=function(a,b,d,e,f){var l=this;if(this._mouseZoneManager&&this._element){var h=g.getStringCellWidth(d),q=a%this._bufferService.cols,k=b+Math.floor(a/this._bufferService.cols),r=(q+h)%this._bufferService.cols,t=k+Math.floor((q+h)/this._bufferService.cols);0===r&&(r=this._bufferService.cols,t--);this._mouseZoneManager.add(new c(q+1,k+1,r+1,t+1,function(a){if(e.handler)return e.handler(a,d);window.open(d, "_blank")},function(){l._onLinkHover.fire(l._createLinkHoverEvent(q,k,r,t,f));l._element.classList.add("xterm-cursor-pointer")},function(a){l._onLinkTooltip.fire(l._createLinkHoverEvent(q,k,r,t,f));e.hoverTooltipCallback&&e.hoverTooltipCallback(a,d,{start:{x:q,y:k},end:{x:r,y:t}})},function(){l._onLinkLeave.fire(l._createLinkHoverEvent(q,k,r,t,f));l._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}();b.Linkifier=a;b.MouseZone=c},function(a,b,d){var c=this&&this.__decorate||function(a,b,c,d){var e,g=arguments.length,f=3>g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var l=a.length-1;0<=l;l--)(e=a[l])&&(f=(3>g?e(f):3b[1]&&a[1]=b[0]&&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=v.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 f.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&&!(f.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._dragScrollAmount&&(this._model.selectionEnd[0]=0)),a=this._bufferService.buffer,this._model.selectionEnd[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=l.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=this._bufferService.cols)){var e=this._bufferService.buffer,g=e.lines.get(a[1]);if(g){var f=e.translateBufferLineToString(a[1],!1),l=this._convertViewportColToCharacterIndex(g,a),h=l,q=a[0]-l,k=0,r=0,n=0,t=0;if(" "===f.charAt(l)){for(;0b.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=c([g(3,q.ICharSizeService),g(4,t.IBufferService),g(5,t.ICoreService),g(6,q.IMouseService),g(7,t.IOptionsService)],a)}();b.SelectionService=a},function(a,b){Object.defineProperty(b,"__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}();b.SelectionModel=a},function(a,b,d){function c(a,b,c,d){var e=a-g(c,a),f=b-g(c,b);e=Math.abs(e-f);f=0;for(var l=a-g(c,a),h=b-g(c,b),q=0;qb?"A":"B")?-1:1)*q);n&&n.isWrapped&&f++}return r(e-f,k(a>b?"A":"B",d))}function g(a,b){for(var c=0,d=a.buffer.lines.get(b),e=d&&d.isWrapped;e&&0<=b&&b=d&&lg.cols-1?(l+=g.buffer.translateBufferLineToString(b,!1,a,f),f=0,a=0,b++):!e&&0>f&&(l+=g.buffer.translateBufferLineToString(b, !1,0,a+1),a=f=g.cols-1,b--);return l+g.buffer.translateBufferLineToString(b,!1,a,f)}function k(a,b){return q.C0.ESC+(b?"O":"[")+a}function r(a,b){a=Math.floor(a);for(var c="",d=0;dg?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(f=(3>g?e(f):3g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var l=a.length-1;0<=l;l--)(e=a[l])&&(f=(3>g?e(f):3a&&d.y1<=b+1||d.y2>a&&d.y2<=b+1||d.y1b+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(){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=d.x1&&a=d.x1||b===d.y2&&ad.y1&&ba;)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;bthis._liveRegionLineCount&&(0g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(f=(3>g?e(f):3b;)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,g=Math.max(d,0),f=Math.min(e,this._bufferService.rows-1);if(!(g>=this._bufferService.rows||0>f)){var h=document.createDocumentFragment();c?h.appendChild(this._createSelectionElement(g, a[0],b[0],f-g+1)):(h.appendChild(this._createSelectionElement(g,d===g?a[0]:0,g===f?b[0]:this._bufferService.cols)),(h.appendChild(this._createSelectionElement(g+1,0,this._bufferService.cols,f-g-1)),g!==f)&&h.appendChild(this._createSelectionElement(f,0,e===f?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 g=this._rowElements[a];g.innerHTML="";var f=a+this._bufferService.buffer.ydisp,h=this._bufferService.buffer.lines.get(f);g.appendChild(this._rowFactory.createRow(h,f===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(){return-1},b.prototype.deregisterCharacterJoiner=function(){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,g){for(;a!==b||c!==d;){var f=this._rowElements[c];if(!f)break;(f=f.children[a])&&(f.style.textDecoration=g?"underline":"none");++a>=e&&(a=0,c++)}},b=f([h(5,q.ICharSizeService),h(6,t.IOptionsService), h(7,t.IBufferService)],b)}(a.Disposable);b.DomRenderer=d},function(a,b,d){function c(a,b,c){for(;a.lengtht&&this._optionsService.options.drawBoldTextInBrightColors&&(t+=8);this._applyMinimumContrast(n,this._colors.background, this._colors.ansi[t])||n.classList.add("xterm-fg-"+t);break;case 50331648:v=k.rgbaToColor(t>>16&255,t>>8&255,255&t);this._applyMinimumContrast(n,this._colors.background,v)||this._addStyle(n,"color:#"+c(t.toString(16),"0",6));break;default:this._applyMinimumContrast(n,this._colors.background,this._colors.foreground)||qa&&n.classList.add("xterm-fg-"+g.INVERTED_DEFAULT_COLOR)}switch(H){case 16777216:case 33554432:n.classList.add("xterm-bg-"+C);break;case 50331648:this._addStyle(n,"background-color:#"+ c(C.toString(16),"0",6));break;default:qa&&n.classList.add("xterm-bg-"+g.INVERTED_DEFAULT_COLOR)}l.appendChild(n)}}return l},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=k.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}();b.DomRendererRowFactory=a},function(a,b,d){Object.defineProperty(b,"__esModule",{value:!0});var c=d(12),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"], 220:["\\","|"],221:["]","}"],222:["'",'"']};b.evaluateKeyboardEvent=function(a,b,d,e){var f={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?f.key=b?c.C0.ESC+"OA":c.C0.ESC+"[A":"UIKeyInputLeftArrow"===a.key?f.key=b?c.C0.ESC+"OD":c.C0.ESC+"[D":"UIKeyInputRightArrow"===a.key?f.key=b?c.C0.ESC+"OC":c.C0.ESC+"[C":"UIKeyInputDownArrow"===a.key&&(f.key=b?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:if(a.shiftKey){f.key= c.C0.BS;break}if(a.altKey){f.key=c.C0.ESC+c.C0.DEL;break}f.key=c.C0.DEL;break;case 9:if(a.shiftKey){f.key=c.C0.ESC+"[Z";break}f.key=c.C0.HT;f.cancel=!0;break;case 13:f.key=c.C0.CR;f.cancel=!0;break;case 27:f.key=c.C0.ESC;f.cancel=!0;break;case 37:if(a.metaKey)break;h?(f.key=c.C0.ESC+"[1;"+(h+1)+"D",f.key===c.C0.ESC+"[1;3D"&&(f.key=c.C0.ESC+(d?"b":"[1;5D"))):f.key=b?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(a.metaKey)break;h?(f.key=c.C0.ESC+"[1;"+(h+1)+"C",f.key===c.C0.ESC+"[1;3C"&&(f.key=c.C0.ESC+ (d?"f":"[1;5C"))):f.key=b?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(a.metaKey)break;h?(f.key=c.C0.ESC+"[1;"+(h+1)+"A",d||f.key!==c.C0.ESC+"[1;3A"||(f.key=c.C0.ESC+"[1;5A")):f.key=b?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(a.metaKey)break;h?(f.key=c.C0.ESC+"[1;"+(h+1)+"B",d||f.key!==c.C0.ESC+"[1;3B"||(f.key=c.C0.ESC+"[1;5B")):f.key=b?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:a.shiftKey||a.ctrlKey||(f.key=c.C0.ESC+"[2~");break;case 46:f.key=h?c.C0.ESC+"[3;"+(h+1)+"~":c.C0.ESC+"[3~";break;case 36:f.key= h?c.C0.ESC+"[1;"+(h+1)+"H":b?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:f.key=h?c.C0.ESC+"[1;"+(h+1)+"F":b?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:a.shiftKey?f.type=2:f.key=c.C0.ESC+"[5~";break;case 34:a.shiftKey?f.type=3:f.key=c.C0.ESC+"[6~";break;case 112:f.key=h?c.C0.ESC+"[1;"+(h+1)+"P":c.C0.ESC+"OP";break;case 113:f.key=h?c.C0.ESC+"[1;"+(h+1)+"Q":c.C0.ESC+"OQ";break;case 114:f.key=h?c.C0.ESC+"[1;"+(h+1)+"R":c.C0.ESC+"OR";break;case 115:f.key=h?c.C0.ESC+"[1;"+(h+1)+"S":c.C0.ESC+"OS";break;case 116:f.key= h?c.C0.ESC+"[15;"+(h+1)+"~":c.C0.ESC+"[15~";break;case 117:f.key=h?c.C0.ESC+"[17;"+(h+1)+"~":c.C0.ESC+"[17~";break;case 118:f.key=h?c.C0.ESC+"[18;"+(h+1)+"~":c.C0.ESC+"[18~";break;case 119:f.key=h?c.C0.ESC+"[19;"+(h+1)+"~":c.C0.ESC+"[19~";break;case 120:f.key=h?c.C0.ESC+"[20;"+(h+1)+"~":c.C0.ESC+"[20~";break;case 121:f.key=h?c.C0.ESC+"[21;"+(h+1)+"~":c.C0.ESC+"[21~";break;case 122:f.key=h?c.C0.ESC+"[23;"+(h+1)+"~":c.C0.ESC+"[23~";break;case 123:f.key=h?c.C0.ESC+"[24;"+(h+1)+"~":c.C0.ESC+"[24~";break; default:!a.ctrlKey||a.shiftKey||a.altKey||a.metaKey?d&&!e||!a.altKey||a.metaKey?d&&!a.altKey&&!a.ctrlKey&&a.metaKey?65===a.keyCode&&(f.type=1):a.key&&!a.ctrlKey&&!a.altKey&&!a.metaKey&&48<=a.keyCode&&1===a.key.length?f.key=a.key:a.key&&a.ctrlKey&&"_"===a.key&&(f.key=c.C0.US):(b=(b=g[a.keyCode])&&b[a.shiftKey?1:0])?f.key=c.C0.ESC+b:65<=a.keyCode&&90>=a.keyCode&&(f.key=c.C0.ESC+String.fromCharCode(a.ctrlKey?a.keyCode-64:a.keyCode+32)):65<=a.keyCode&&90>=a.keyCode?f.key=String.fromCharCode(a.keyCode- 64):32===a.keyCode?f.key=c.C0.NUL:51<=a.keyCode&&55>=a.keyCode?f.key=String.fromCharCode(a.keyCode-51+27):56===a.keyCode?f.key=c.C0.DEL:219===a.keyCode?f.key=c.C0.ESC:220===a.keyCode?f.key=c.C0.FS:221===a.keyCode&&(f.key=c.C0.GS)}return f}},function(a,b,d){Object.defineProperty(b,"__esModule",{value:!0});var c=d(3);b.handleWindowsModeLineFeed=function(a){var b,d=null===(b=a.buffer.lines.get(a.buffer.ybase+a.buffer.y-1))||void 0===b?void 0:b.get(a.cols-1);(a=a.buffer.lines.get(a.buffer.ybase+a.buffer.y))&& d&&(a.isWrapped=d[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&d[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},function(a,b,d){var c,g=this&&this.__extends||(c=function(a,b){return(c=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 d(){this.constructor=a}c(a,b);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)}),f=this&&this.__decorate||function(a, b,c,d){var e,g=arguments.length,f=3>g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(f=(3>g?e(f):3c)throw Error(a+" cannot be less than 1, value: "+c);break;case "minimumContrastRatio":c=Math.max(1,Math.min(21,Math.round(10*c)/10));case "scrollback":if(0>(c=Math.min(c,4294967295)))throw Error(a+" cannot be less than 0, value: "+c);break;case "fastScrollSensitivity":case "scrollSensitivity":if(0>=c)throw Error(a+" cannot be less than or equal to 0, value: "+c);}return c},a.prototype.getOption=function(a){if(!(a in b.DEFAULT_OPTIONS))throw Error('No option with key "'+ a+'"');return this.options[a]},a}();b.OptionsService=d},function(a,b,d){var c=this&&this.__decorate||function(a,b,c,d){var e,g=arguments.length,f=3>g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(f=(3>g?e(f):3g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(f=(3>g?e(f):3 this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"isCursorInViewport",{get:function(){var a=this.ybase+this.y-this.ydisp;return 0<=a&&ab.MAX_BUFFER_SIZE?b.MAX_BUFFER_SIZE:a},a.prototype.fillViewportRows=function(a){if(0===this.lines.length){void 0===a&&(a=g.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 c.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(g.DEFAULT_ATTR_DATA),d=this._getCorrectBufferLength(b);if(d>this.lines.maxLength&&(this.lines.maxLength=d),0b;f--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));da))for(e=0;ethis._cols?this._reflowLarger(a,b):this._reflowSmaller(a,b))},a.prototype._reflowLarger=function(a,b){var c=k.reflowLargerGetLinesToRemove(this.lines,this._cols,a,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));0=f&&hf+r){for(n=t.newLines.length-1;0<=n;n--)this.lines.set(h--,t.newLines[n]);h++;a.push({index:f+1,amount:t.newLines.length});r+=t.newLines.length;t=d[++l]}else this.lines.set(h, c[f--]);d=0;for(h=a.length-1;0<=h;h--)a[h].index+=d,this.lines.onInsertEmitter.fire(a[h]),d+=a[h].amount;e=Math.max(0,b+e-this.lines.maxLength);0b)return[a,g];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=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?this._cols-1:0>a?0:a},a.prototype.addMarker=function(a){var b=this,c=new r.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.linea.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 t(this,a,b,c,d,e)},a}();b.Buffer=a;var t=function(){function a(a,b,c,d,e,g){void 0===c&&(c=0);void 0===d&&(d=a.lines.length);void 0===e&&(e=0);void 0===g&&(g=0);this._buffer=a;this._trimRight=b;this._startIndex=c; this._endIndex=d;this._startOverscan=e;this._endOverscan=g;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._currentthis._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}();b.BufferStringIterator=t},function(a,b,d){Object.defineProperty(b,"__esModule",{value:!0});var c=d(1);a=function(){function a(a){this._maxLength=a;this.onDeleteEmitter=new c.EventEmitter;this.onInsertEmitter=new c.EventEmitter; this.onTrimEmitter=new c.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;cthis._length)for(var b=this._length;b=a;d--)this._array[this._getCyclicIndex(d+c.length)]=this._array[this._getCyclicIndex(d)];for(d=0;dthis._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(0this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(d=0;d=g&&hf||0===l[n].getTrimmedLength());n--)v++;0v&&(f-=v,q++);(v=2===a[q].getWidth(f-1))&&f--;v=v?d-1:d;e.push(v);t+= v}return e};b.getWrappedLineTrimmedLength=c},function(a,b,d){var c,g=this&&this.__extends||(c=function(a,b){return(c=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 d(){this.constructor=a}c(a,b);a.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)});Object.defineProperty(b,"__esModule",{value:!0});var f=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 f.EventEmitter,d}return g(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);b.Marker=a},function(a,b,d){var c= this&&this.__decorate||function(a,b,c,d){var e,g=arguments.length,f=3>g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(f=(3>g?e(f):3g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(f=(3>g?e(f):3g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"== typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(f=(3>g?e(f):3g?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"== typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a,b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(f=(3>g?e(f):3this._end&&(this._end=a)},a.prototype.markRangeDirty=function(a,b){if(a>b){var c=a;a=b;b=c}athis._end&&(this._end=b)},a.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows- 1)},a=c([g(0,f.IBufferService)],a)}();b.DirtyRowService=a},function(a,b,d){var c=this&&this.__spreadArrays||function(){for(var a=0,b=0,c=arguments.length;bg?b:null===d?d=Object.getOwnPropertyDescriptor(b,c):d;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(a, b,c,d);else for(var h=a.length-1;0<=h;h--)(e=a[h])&&(f=(3>g?e(f):3a.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=g([f(0,h.IBufferService),f(1,h.ICoreService)],a)}();b.CoreMouseService= a},function(a,b){Object.defineProperty(b,"__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;bthis._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?(50h[0]&&c[1]=b.length&&(b=void 0);return{value:b&&b[c++],done:!b}}}} function Ba(b,a){var c="function"===typeof Symbol&&b[Symbol.iterator];if(!c)return b;b=c.call(b);var d,e=[];try{for(;(void 0===a||0b;++b)Ma[b]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[b],Na["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(b)]=b;Na[45]=62;Na[95]=63} function Ra(b,a,c){for(var d=[],e=a;e>18&63]+Ma[a>>12&63]+Ma[a>>6&63]+Ma[a&63]);return d.join("")}function Ta(b){Pa||Qa();for(var a=b.length,c=a%3,d="",e=[],g=0,f=a-c;gf?f:g+16383));1===c?(b=b[a-1],d+=Ma[b>>2],d+=Ma[b<<4&63],d+="=="):2===c&&(b=(b[a-2]<<8)+b[a-1],d+=Ma[b>>10],d+=Ma[b>>4&63],d+=Ma[b<<2&63],d+="=");e.push(d);return e.join("")} function Ua(b,a,c,d,e){var g=8*e-d-1,f=(1<>1,k=-7;e=c?e-1:0;var r=c?-1:1,q=b[a+e];e+=r;c=q&(1<<-k)-1;q>>=-k;for(k+=g;0>=-k;for(k+=d;0>1,q=23===e?Math.pow(2,-24)-Math.pow(2,-77):0;g=d?0:g-1;var t=d?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,d=k):(d=Math.floor(Math.log(a)/Math.LN2),1>a*(f=Math.pow(2,-d))&&(d--,f*=2),a=1<=d+r?a+q/f:a+q*Math.pow(2,1-r),2<=a*f&&(d++,f/=2),d+r>=k?(a=0,d=k):1<=d+r?(a=(a*f-1)*Math.pow(2,e),d+=r):(a=a*Math.pow(2,r-1)*Math.pow(2,e),d=0));8<=e;b[c+g]=a&255,g+=t,a/=256,e-=8);d=d<c||a.byteLengthb)throw new RangeError('"size" argument must not be negative');}A.alloc=function(b,a,c){kb(b);return b=0>=b?bb(null,b):void 0!==a?"string"===typeof c?bb(null,b).fill(a,c):bb(null,b).fill(a):bb(null,b)};function cb(b,a){kb(a);b=bb(b,0>a?0:lb(a)|0);if(!A.TYPED_ARRAY_SUPPORT)for(var c=0;ca.length?0:lb(a.length)|0;b=bb(b,c);for(var d=0;d=(A.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(A.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return b|0}A.isBuffer=nb;function mb(b){return!(null==b||!b._isBuffer)} A.compare=function(b,a){if(!mb(b)||!mb(a))throw new TypeError("Arguments must be Buffers");if(b===a)return 0;for(var c=b.length,d=a.length,e=0,g=Math.min(c,d);e>>1;case "base64":return pb(b).length; default:if(d)return ob(b).length;a=(""+a).toLowerCase();d=!0}}A.byteLength=fb; function rb(b,a,c){var d=!1;if(void 0===a||0>a)a=0;if(a>this.length)return"";if(void 0===c||c>this.length)c=this.length;if(0>=c)return"";c>>>=0;a>>>=0;if(c<=a)return"";for(b||(b="utf8");;)switch(b){case "hex":b=a;a=c;c=this.length;if(!b||0>b)b=0;if(!a||0>a||a>c)a=c;d="";for(c=b;cd?"0"+d.toString(16):d.toString(16),d=b+d;return d;case "utf8":case "utf-8":return sb(this,a,c);case "ascii":b="";for(c=Math.min(this.length,c);a"}; A.prototype.compare=function(b,a,c,d,e){if(!mb(b))throw new TypeError("Argument must be a Buffer");void 0===a&&(a=0);void 0===c&&(c=b?b.length:0);void 0===d&&(d=0);void 0===e&&(e=this.length);if(0>a||c>b.length||0>d||e>this.length)throw new RangeError("out of range index");if(d>=e&&a>=c)return 0;if(d>=e)return-1;if(a>=c)return 1;a>>>=0;c>>>=0;d>>>=0;e>>>=0;if(this===b)return 0;var g=e-d,f=c-a,h=Math.min(g,f);d=this.slice(d,e);b=b.slice(a,c);for(a=0;ac&&(c=-2147483648);c=+c;isNaN(c)&&(c=e?0:b.length-1);0>c&&(c=b.length+c);if(c>=b.length){if(e)return-1;c=b.length-1}else if(0>c)if(e)c=0;else return-1;"string"===typeof a&&(a=A.from(a,d));if(mb(a))return 0===a.length?-1:vb(b,a,c,d,e);if("number"===typeof a)return a&=255,A.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(b,a,c): Uint8Array.prototype.lastIndexOf.call(b,a,c):vb(b,[a],c,d,e);throw new TypeError("val must be string, number or Buffer");} function vb(b,a,c,d,e){function g(a,b){return 1===f?a[b]:a.readUInt16BE(b*f)}var f=1,h=b.length,k=a.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(2>b.length||2>a.length)return-1;f=2;h/=2;k/=2;c/=2}if(e)for(d=-1;ch&&(c=h-k);0<=c;c--){h=!0;for(d=0;de)c=e;if(0c||0>a)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");for(e=!1;;)switch(d){case "hex":a:{a= Number(a)||0;d=this.length-a;c?(c=Number(c),c>d&&(c=d)):c=d;d=b.length;if(0!==d%2)throw new TypeError("Invalid hex string");c>d/2&&(c=d/2);for(d=0;d(e-=2));++f){var h=d.charCodeAt(f);b=h>>8;h%=256;g.push(h);g.push(b)}return wb(g,this,a,c);default:if(e)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase();e=!0}};A.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}}; function sb(b,a,c){c=Math.min(b.length,c);for(var d=[];ae&&(g=e);break;case 2:var h=b[a+1];128===(h&192)&&(e=(e&31)<<6|h&63,127e||57343e&&(g= e))}null===g?(g=65533,f=1):65535>>10&1023|55296),g=56320|g&1023);d.push(g);a+=f}b=d.length;if(b<=yb)d=String.fromCharCode.apply(String,d);else{c="";for(a=0;ab?(b+=c,0>b&&(b=0)):b>c&&(b=c);0>a?(a+=c,0>a&&(a=0)):a>c&&(a=c);ab)throw new RangeError("offset is not uint");if(b+a>c)throw new RangeError("Trying to access beyond buffer length");} A.prototype.readUIntLE=function(b,a,c){b|=0;a|=0;c||D(b,a,this.length);c=this[b];for(var d=1,e=0;++e=128*d&&(c-=Math.pow(2,8*a));return c}; A.prototype.readIntBE=function(b,a,c){b|=0;a|=0;c||D(b,a,this.length);c=a;for(var d=1,e=this[b+--c];0=128*d&&(e-=Math.pow(2,8*a));return e};A.prototype.readInt8=function(b,a){a||D(b,1,this.length);return this[b]&128?-1*(255-this[b]+1):this[b]};A.prototype.readInt16LE=function(b,a){a||D(b,2,this.length);b=this[b]|this[b+1]<<8;return b&32768?b|4294901760:b}; A.prototype.readInt16BE=function(b,a){a||D(b,2,this.length);b=this[b+1]|this[b]<<8;return b&32768?b|4294901760:b};A.prototype.readInt32LE=function(b,a){a||D(b,4,this.length);return this[b]|this[b+1]<<8|this[b+2]<<16|this[b+3]<<24};A.prototype.readInt32BE=function(b,a){a||D(b,4,this.length);return this[b]<<24|this[b+1]<<16|this[b+2]<<8|this[b+3]};A.prototype.readFloatLE=function(b,a){a||D(b,4,this.length);return Ua(this,b,!0,23,4)}; A.prototype.readFloatBE=function(b,a){a||D(b,4,this.length);return Ua(this,b,!1,23,4)};A.prototype.readDoubleLE=function(b,a){a||D(b,8,this.length);return Ua(this,b,!0,52,8)};A.prototype.readDoubleBE=function(b,a){a||D(b,8,this.length);return Ua(this,b,!1,52,8)};function zb(b,a,c,d,e,g){if(!mb(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>e||ab.length)throw new RangeError("Index out of range");} A.prototype.writeUIntLE=function(b,a,c,d){b=+b;a|=0;c|=0;d||zb(this,b,a,c,Math.pow(2,8*c)-1,0);d=1;var e=0;for(this[a]=b&255;++ea&&(a=65535+a+1);for(var e=0,g=Math.min(b.length-c,2);e>>8*(d?e:1-e)}A.prototype.writeUInt16LE=function(b,a,c){b=+b;a|=0;c||zb(this,b,a,2,65535,0);A.TYPED_ARRAY_SUPPORT?(this[a]=b&255,this[a+1]=b>>>8):Ab(this,b,a,!0);return a+2};A.prototype.writeUInt16BE=function(b,a,c){b=+b;a|=0;c||zb(this,b,a,2,65535,0);A.TYPED_ARRAY_SUPPORT?(this[a]=b>>>8,this[a+1]=b&255):Ab(this,b,a,!1);return a+2}; function Bb(b,a,c,d){0>a&&(a=4294967295+a+1);for(var e=0,g=Math.min(b.length-c,4);e>>8*(d?e:3-e)&255}A.prototype.writeUInt32LE=function(b,a,c){b=+b;a|=0;c||zb(this,b,a,4,4294967295,0);A.TYPED_ARRAY_SUPPORT?(this[a+3]=b>>>24,this[a+2]=b>>>16,this[a+1]=b>>>8,this[a]=b&255):Bb(this,b,a,!0);return a+4}; A.prototype.writeUInt32BE=function(b,a,c){b=+b;a|=0;c||zb(this,b,a,4,4294967295,0);A.TYPED_ARRAY_SUPPORT?(this[a]=b>>>24,this[a+1]=b>>>16,this[a+2]=b>>>8,this[a+3]=b&255):Bb(this,b,a,!1);return a+4};A.prototype.writeIntLE=function(b,a,c,d){b=+b;a|=0;d||(d=Math.pow(2,8*c-1),zb(this,b,a,c,d-1,-d));d=0;var e=1,g=0;for(this[a]=b&255;++db&&0===g&&0!==this[a+d-1]&&(g=1),this[a+d]=(b/e>>0)-g&255;return a+c}; A.prototype.writeIntBE=function(b,a,c,d){b=+b;a|=0;d||(d=Math.pow(2,8*c-1),zb(this,b,a,c,d-1,-d));d=c-1;var e=1,g=0;for(this[a+d]=b&255;0<=--d&&(e*=256);)0>b&&0===g&&0!==this[a+d+1]&&(g=1),this[a+d]=(b/e>>0)-g&255;return a+c};A.prototype.writeInt8=function(b,a,c){b=+b;a|=0;c||zb(this,b,a,1,127,-128);A.TYPED_ARRAY_SUPPORT||(b=Math.floor(b));0>b&&(b=255+b+1);this[a]=b&255;return a+1}; A.prototype.writeInt16LE=function(b,a,c){b=+b;a|=0;c||zb(this,b,a,2,32767,-32768);A.TYPED_ARRAY_SUPPORT?(this[a]=b&255,this[a+1]=b>>>8):Ab(this,b,a,!0);return a+2};A.prototype.writeInt16BE=function(b,a,c){b=+b;a|=0;c||zb(this,b,a,2,32767,-32768);A.TYPED_ARRAY_SUPPORT?(this[a]=b>>>8,this[a+1]=b&255):Ab(this,b,a,!1);return a+2}; A.prototype.writeInt32LE=function(b,a,c){b=+b;a|=0;c||zb(this,b,a,4,2147483647,-2147483648);A.TYPED_ARRAY_SUPPORT?(this[a]=b&255,this[a+1]=b>>>8,this[a+2]=b>>>16,this[a+3]=b>>>24):Bb(this,b,a,!0);return a+4};A.prototype.writeInt32BE=function(b,a,c){b=+b;a|=0;c||zb(this,b,a,4,2147483647,-2147483648);0>b&&(b=4294967295+b+1);A.TYPED_ARRAY_SUPPORT?(this[a]=b>>>24,this[a+1]=b>>>16,this[a+2]=b>>>8,this[a+3]=b&255):Bb(this,b,a,!1);return a+4}; function Cb(b,a,c,d){if(c+d>b.length)throw new RangeError("Index out of range");if(0>c)throw new RangeError("Index out of range");}A.prototype.writeFloatLE=function(b,a,c){c||Cb(this,b,a,4);Va(this,b,a,!0,23,4);return a+4};A.prototype.writeFloatBE=function(b,a,c){c||Cb(this,b,a,4);Va(this,b,a,!1,23,4);return a+4};A.prototype.writeDoubleLE=function(b,a,c){c||Cb(this,b,a,8);Va(this,b,a,!0,52,8);return a+8};A.prototype.writeDoubleBE=function(b,a,c){c||Cb(this,b,a,8);Va(this,b,a,!1,52,8);return a+8}; A.prototype.copy=function(b,a,c,d){c||(c=0);d||0===d||(d=this.length);a>=b.length&&(a=b.length);a||(a=0);0a)throw new RangeError("targetStart out of bounds");if(0>c||c>=this.length)throw new RangeError("sourceStart out of bounds");if(0>d)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length);b.length-ae|| !A.TYPED_ARRAY_SUPPORT)for(d=0;de&&(b=e)}if(void 0!==d&&"string"!==typeof d)throw new TypeError("encoding must be a string");if("string"===typeof d&&!A.isEncoding(d))throw new TypeError("Unknown encoding: "+d);}else"number"===typeof b&&(b&=255);if(0>a||this.length>>= 0;c=void 0===c?this.length:c>>>0;b||(b=0);if("number"===typeof b)for(d=a;dc){if(!e){if(56319c){-1<(a-=3)&&g.push(239,191,189);e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&-1<(a-=3)&&g.push(239,191,189);e=null;if(128>c){if(0>--a)break;g.push(c)}else if(2048>c){if(0>(a-=2))break;g.push(c>>6|192,c&63|128)}else if(65536>c){if(0>(a-=3))break; g.push(c>>12|224,c>>6&63|128,c&63|128)}else if(1114112>c){if(0>(a-=4))break;g.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw Error("Invalid code point");}return g}function xb(b){for(var a=[],c=0;cb.length)b="";else for(;0!==b.length%4;)b+="=";Pa||Qa();var a=b.length;if(0>16&255;d[g++]=f>>8&255;d[g++]=f&255}2===c?(f=Na[b.charCodeAt(a)]<<2|Na[b.charCodeAt(a+ 1)]>>4,d[g++]=f&255):1===c&&(f=Na[b.charCodeAt(a)]<<10|Na[b.charCodeAt(a+1)]<<4|Na[b.charCodeAt(a+2)]>>2,d[g++]=f>>8&255,d[g++]=f&255);return d}function wb(b,a,c,d){for(var e=0;e=a.length||e>=b.length);++e)a[e+c]=b[e];return e}function nb(b){return null!=b&&(!!b._isBuffer||Eb(b)||"function"===typeof b.readFloatLE&&"function"===typeof b.slice&&Eb(b.slice(0,0)))}function Eb(b){return!!b.constructor&&"function"===typeof b.constructor.isBuffer&&b.constructor.isBuffer(b)} var Fb=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:ab,Buffer:A,SlowBuffer:function(b){+b!=b&&(b=0);return A.alloc(+b)},isBuffer:nb}),E=Ea(function(b,a){function c(a){for(var b=[],c=1;ca&&(c--,a+=1E9));return[c,a]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-ac)/1E3}},cc="function"===typeof Object.create?function(b,a){b.super_=a;b.prototype=Object.create(a.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}})}:function(b,a){function c(){}b.super_=a;c.prototype=a.prototype;b.prototype=new c;b.prototype.constructor=b},fc=/%[sdj%]/g; function gc(b){if(!hc(b)){for(var a=[],c=0;c=e)return a;switch(a){case "%s":return String(d[c++]);case "%d":return Number(d[c++]);case "%j":try{return JSON.stringify(d[c++])}catch(h){return"[Circular]"}default:return a}});for(var g=d[c];cc)return Kc(a)?b.stylize(RegExp.prototype.toString.call(a),"regexp"):b.stylize("[Object]","special");b.seen.push(a);e=f? Nc(b,a,c,g,e):e.map(function(d){return Oc(b,a,c,g,d,f)});b.seen.pop();return Wc(e,d,h)}function Hc(b,a){if(lc(a))return b.stylize("undefined","undefined");if(hc(a))return a="'"+JSON.stringify(a).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'",b.stylize(a,"string");if(Xc(a))return b.stylize(""+a,"number");if(xc(a))return b.stylize(""+a,"boolean");if(null===a)return b.stylize("null","null")}function Jc(b){return"["+Error.prototype.toString.call(b)+"]"} function Nc(b,a,c,d,e){for(var g=[],f=0,h=a.length;fb.seen.indexOf(a.value)?(h=null===c?Ec(b,a.value,null):Ec(b,a.value,c-1),-1b?"0"+b.toString(10):b.toString(10)}var kd="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "); function ld(){var b=new Date,a=[jd(b.getHours()),jd(b.getMinutes()),jd(b.getSeconds())].join(":");return[b.getDate(),kd[b.getMonth()],a].join(" ")}function yc(b,a){if(!a||!jc(a))return b;for(var c=Object.keys(a),d=c.length;d--;)b[c[d]]=a[c[d]];return b} var md={inherits:cc,_extend:yc,log:function(){console.log("%s - %s",ld(),gc.apply(null,arguments))},isBuffer:function(b){return nb(b)},isPrimitive:id,isFunction:Gc,isError:Ic,isDate:Lc,isObject:jc,isRegExp:Kc,isUndefined:lc,isSymbol:function(b){return"symbol"===typeof b},isString:hc,isNumber:Xc,isNullOrUndefined:function(b){return null==b},isNull:function(b){return null===b},isBoolean:xc,isArray:Mc,inspect:ic,deprecate:kc,format:gc,debuglog:oc}; function nd(b,a){if(b===a)return 0;for(var c=b.length,d=a.length,e=0,g=Math.min(c,d);e 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")});Da(Ud); var Vd=Ea(function(b,a){Object.defineProperty(a,"__esModule",{value:!0});a.ENCODING_UTF8="utf8";a.assertEncoding=function(a){if(a&&!E.Buffer.isEncoding(a))throw new Ud.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",a);};a.strToEncoding=function(b,d){return d&&d!==a.ENCODING_UTF8?"buffer"===d?new E.Buffer(b):(new E.Buffer(b)).toString(d):b}});Da(Vd); var Wd=Ea(function(b,a){Object.defineProperty(a,"__esModule",{value:!0});var c=z.constants.S_IFMT,d=z.constants.S_IFDIR,e=z.constants.S_IFREG,g=z.constants.S_IFBLK,f=z.constants.S_IFCHR,h=z.constants.S_IFLNK,k=z.constants.S_IFIFO,r=z.constants.S_IFSOCK;b=function(){function a(){this.name="";this.mode=0}a.build=function(b,c){var d=new a,e=b.getNode().mode;d.name=Vd.strToEncoding(b.getName(),c);d.mode=e;return d};a.prototype._checkModeProperty=function(a){return(this.mode&c)===a};a.prototype.isDirectory= function(){return this._checkModeProperty(d)};a.prototype.isFile=function(){return this._checkModeProperty(e)};a.prototype.isBlockDevice=function(){return this._checkModeProperty(g)};a.prototype.isCharacterDevice=function(){return this._checkModeProperty(f)};a.prototype.isSymbolicLink=function(){return this._checkModeProperty(h)};a.prototype.isFIFO=function(){return this._checkModeProperty(k)};a.prototype.isSocket=function(){return this._checkModeProperty(r)};return a}();a.Dirent=b;a.default=b}); Da(Wd);function Xd(b,a){for(var c=0,d=b.length-1;0<=d;d--){var e=b[d];"."===e?b.splice(d,1):".."===e?(b.splice(d,1),c++):c&&(b.splice(d,1),c--)}if(a)for(;c--;c)b.unshift("..");return b}var Yd=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; function Zd(){for(var b="",a=!1,c=arguments.length-1;-1<=c&&!a;c--){var d=0<=c?arguments[c]:"/";if("string"!==typeof d)throw new TypeError("Arguments to path.resolve must be strings");d&&(b=d+"/"+b,a="/"===d.charAt(0))}b=Xd($d(b.split("/"),function(a){return!!a}),!a).join("/");return(a?"/":"")+b||"."}function ae(b){var a=be(b),c="/"===ce(b,-1);(b=Xd($d(b.split("/"),function(a){return!!a}),!a).join("/"))||a||(b=".");b&&c&&(b+="/");return(a?"/":"")+b}function be(b){return"/"===b.charAt(0)} function de(b,a){function c(a){for(var b=0;bc?[]:a.slice(b,c-b+1)}b=Zd(b).substr(1);a=Zd(a).substr(1);b=c(b.split("/"));a=c(a.split("/"));for(var d=Math.min(b.length,a.length),e=d,g=0;ga&&(a=b.length+a);return b.substr(a,c)},fe=Ea(function(b,a){Object.defineProperty(a,"__esModule",{value:!0});b="function"===typeof setImmediate?setImmediate.bind(x):setTimeout.bind(x);a.default=b});Da(fe); var ge=Ea(function(b,a){function c(){var a=bc||{};a.getuid||(a.getuid=function(){return 0});a.getgid||(a.getgid=function(){return 0});a.cwd||(a.cwd=function(){return"/"});a.nextTick||(a.nextTick=fe.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=c;a.default=c()});Da(ge);function he(){}he.prototype=Object.create(null);function L(){L.init.call(this)}L.EventEmitter=L; L.usingDomains=!1;L.prototype.domain=void 0;L.prototype._events=void 0;L.prototype._maxListeners=void 0;L.defaultMaxListeners=10;L.init=function(){this.domain=null;this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new he,this._eventsCount=0);this._maxListeners=this._maxListeners||void 0};L.prototype.setMaxListeners=function(b){if("number"!==typeof b||0>b||isNaN(b))throw new TypeError('"n" argument must be a positive number');this._maxListeners=b;return this}; L.prototype.getMaxListeners=function(){return void 0===this._maxListeners?L.defaultMaxListeners:this._maxListeners}; L.prototype.emit=function(b){var a,c,d="error"===b;if(a=this._events)d=d&&null==a.error;else if(!d)return!1;var e=this.domain;if(d){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[b];if(!e)return!1;a="function"===typeof e;var g=arguments.length;switch(g){case 1:if(a)e.call(this);else for(a= e.length,e=ie(e,a),d=0;dc&&(g.warned=!0,c=Error("Possible EventEmitter memory leak detected. "+g.length+ " "+a+" listeners added. Use emitter.setMaxListeners() to increase limit"),c.name="MaxListenersExceededWarning",c.emitter=b,c.type=a,c.count=g.length,"function"===typeof console.warn?console.warn(c):console.log(c))):(e[a]=c,++b._eventsCount);return b}L.prototype.addListener=function(b,a){return je(this,b,a,!1)};L.prototype.on=L.prototype.addListener;L.prototype.prependListener=function(b,a){return je(this,b,a,!0)}; function ke(b,a,c){function d(){b.removeListener(a,d);e||(e=!0,c.apply(b,arguments))}var e=!1;d.listener=c;return d}L.prototype.once=function(b,a){if("function"!==typeof a)throw new TypeError('"listener" argument must be a function');this.on(b,ke(this,b,a));return this};L.prototype.prependOnceListener=function(b,a){if("function"!==typeof a)throw new TypeError('"listener" argument must be a function');this.prependListener(b,ke(this,b,a));return this}; L.prototype.removeListener=function(b,a){var c;if("function"!==typeof a)throw new TypeError('"listener" argument must be a function');var d=this._events;if(!d)return this;var e=d[b];if(!e)return this;if(e===a||e.listener&&e.listener===a)0===--this._eventsCount?this._events=new he:(delete d[b],d.removeListener&&this.emit("removeListener",b,e.listener||a));else if("function"!==typeof e){var g=-1;for(c=e.length;0 g)return this;if(1===e.length){e[0]=void 0;if(0===--this._eventsCount)return this._events=new he,this;delete d[b]}else{c=g+1;for(var h=e.length;cthis.buf.length){var e=E.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};b.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=E.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};b.prototype.truncate=function(a){void 0===a&&(a=0);if(a)if(this.buf||(this.buf=E.bufferAllocUnsafe(0)),a<=this.buf.length)this.buf=this.buf.slice(0,a);else{var b=E.bufferAllocUnsafe(0);this.buf.copy(b);b.fill(0,a)}else this.buf=E.bufferAllocUnsafe(0);this.touch()}; b.prototype.chmod=function(a){this.perm=a;this.mode=this.mode&-512|a;this.touch()};b.prototype.chown=function(a,b){this.uid=a;this.gid=b;this.touch()};b.prototype.touch=function(){this.mtime=new Date;this.emit("change",this)};b.prototype.canRead=function(a,b){void 0===a&&(a=ge.default.getuid());void 0===b&&(b=ge.default.getgid());return this.perm&4||b===this.gid&&this.perm&32||a===this.uid&&this.perm&256?!0:!1};b.prototype.canWrite=function(a,b){void 0===a&&(a=ge.default.getuid());void 0===b&&(b= ge.default.getgid());return this.perm&2||b===this.gid&&this.perm&16||a===this.uid&&this.perm&128?!0:!1};b.prototype.del=function(){this.emit("delete",this)};b.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 b}(L.EventEmitter);a.Node=b;b=function(b){function d(a,c,d){var e=b.call(this)||this;e.children= {};e.steps=[];e.ino=0;e.length=0;e.vol=a;e.parent=c;e.steps=c?c.steps.concat([d]):[d];return e}c(d,b);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}(L.EventEmitter);a.Link=b;b=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 Ka.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&h&&(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=b});Da(me);var pe=me.Node,qe=Ea(function(b,a){Object.defineProperty(a,"__esModule",{value:!0});a.default=function(a,b,e){var c=setTimeout.apply(null,arguments);c&&"object"===typeof c&&"function"===typeof c.unref&&c.unref();return c}});Da(qe); function re(){this.tail=this.head=null;this.length=0}re.prototype.push=function(b){b={data:b,next:null};0>>0);for(var a=this.head,c=0;a;)a.data.copy(b,c),c+=a.data.length,a=a.next;return b}; var se=A.isEncoding||function(b){switch(b&&b.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}}; function te(b){this.encoding=(b||"utf8").toLowerCase().replace(/[-_]/,"");if(b&&!se(b))throw Error("Unknown encoding: "+b);switch(this.encoding){case "utf8":this.surrogateSize=3;break;case "ucs2":case "utf16le":this.surrogateSize=2;this.detectIncompleteChar=ue;break;case "base64":this.surrogateSize=3;this.detectIncompleteChar=Ee;break;default:this.write=Fe;return}this.charBuffer=new A(6);this.charLength=this.charReceived=0} te.prototype.write=function(b){for(var a="";this.charLength;){a=b.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:b.length;b.copy(this.charBuffer,this.charReceived,0,a);this.charReceived+=a;if(this.charReceived=c)this.charLength+=this.surrogateSize,a="";else{this.charReceived=this.charLength=0;if(0===b.length)return a; break}}this.detectIncompleteChar(b);var d=b.length;this.charLength&&(b.copy(this.charBuffer,0,b.length-this.charReceived,d),d-=this.charReceived);a+=b.toString(this.encoding,0,d);d=a.length-1;c=a.charCodeAt(d);return 55296<=c&&56319>=c?(c=this.surrogateSize,this.charLength+=c,this.charReceived+=c,this.charBuffer.copy(this.charBuffer,c,0,c),b.copy(this.charBuffer,0,0,c),a.substring(0,d)):a}; te.prototype.detectIncompleteChar=function(b){for(var a=3<=b.length?3:b.length;0>5){this.charLength=2;break}if(2>=a&&14==c>>4){this.charLength=3;break}if(3>=a&&30==c>>3){this.charLength=4;break}}this.charReceived=a};te.prototype.end=function(b){var a="";b&&b.length&&(a=this.write(b));this.charReceived&&(b=this.encoding,a+=this.charBuffer.slice(0,this.charReceived).toString(b));return a};function Fe(b){return b.toString(this.encoding)} function ue(b){this.charLength=(this.charReceived=b.length%2)?2:0}function Ee(b){this.charLength=(this.charReceived=b.length%3)?3:0}N.ReadableState=Ge;var Q=oc("stream");cc(N,L);function He(b,a,c){if("function"===typeof b.prependListener)return b.prependListener(a,c);if(b._events&&b._events[a])Array.isArray(b._events[a])?b._events[a].unshift(c):b._events[a]=[c,b._events[a]];else b.on(a,c)} function Ge(b,a){b=b||{};this.objectMode=!!b.objectMode;a instanceof Ie&&(this.objectMode=this.objectMode||!!b.readableObjectMode);a=b.highWaterMark;var c=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:c;this.highWaterMark=~~this.highWaterMark;this.buffer=new re;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=b.defaultEncoding|| "utf8";this.ranOut=!1;this.awaitDrain=0;this.readingMore=!1;this.encoding=this.decoder=null;b.encoding&&(this.decoder=new te(b.encoding),this.encoding=b.encoding)}function N(b){if(!(this instanceof N))return new N(b);this._readableState=new Ge(b,this);this.readable=!0;b&&"function"===typeof b.read&&(this._read=b.read);L.call(this)} N.prototype.push=function(b,a){var c=this._readableState;c.objectMode||"string"!==typeof b||(a=a||c.defaultEncoding,a!==c.encoding&&(b=A.from(b,a),a=""));return Je(this,c,b,a,!1)};N.prototype.unshift=function(b){return Je(this,this._readableState,b,"",!0)};N.prototype.isPaused=function(){return!1===this._readableState.flowing}; function Je(b,a,c,d,e){var g=c,f=null;nb(g)||"string"===typeof g||null===g||void 0===g||a.objectMode||(f=new TypeError("Invalid non-string/buffer chunk"));if(g=f)b.emit("error",g);else if(null===c)a.reading=!1,a.ended||(a.decoder&&(c=a.decoder.end())&&c.length&&(a.buffer.push(c),a.length+=a.objectMode?1:c.length),a.ended=!0,Ke(b));else if(a.objectMode||c&&0=b||0===a.length&&a.ended)return 0;if(a.objectMode)return 1;if(b!==b)return a.flowing&&a.length?a.buffer.head.data.length:a.length;if(b>a.highWaterMark){var c=b;8388608<=c?c=8388608:(c--,c|=c>>>1,c|=c>>>2,c|=c>>>4,c|=c>>>8,c|=c>>>16,c++);a.highWaterMark=c}return b<=a.length?b:a.ended?a.length:(a.needReadable=!0,0)} N.prototype.read=function(b){Q("read",b);b=parseInt(b,10);var a=this._readableState,c=b;0!==b&&(a.emittedReadable=!1);if(0===b&&a.needReadable&&(a.length>=a.highWaterMark||a.ended))return Q("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?Ne(this):Ke(this),null;b=Me(b,a);if(0===b&&a.ended)return 0===a.length&&Ne(this),null;var d=a.needReadable;Q("need readable",d);if(0===a.length||a.length-b=a.length)c=a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.head.data:a.buffer.concat(a.length),a.buffer.clear();else{c=a.buffer;a=a.decoder;if(bg.length?g.length:b;e=f===g.length?e+g:e+g.slice(0, b);b-=f;if(0===b){f===g.length?(++d,c.head=a.next?a.next:c.tail=null):(c.head=a,a.data=g.slice(f));break}++d}c.length-=d;c=e}else{a=A.allocUnsafe(b);d=c.head;e=1;d.data.copy(a);for(b-=d.data.length;d=d.next;){g=d.data;f=b>g.length?g.length:b;g.copy(a,a.length-b,0,f);b-=f;if(0===b){f===g.length?(++e,c.head=d.next?d.next:c.tail=null):(c.head=d,d.data=g.slice(f));break}++e}c.length-=e;c=a}a=c}c=a}return c} function Ne(b){var a=b._readableState;if(0arguments.length?b:sf.apply(null,[b].concat(rf.call(arguments,2)))}},uf=Ea(function(b,a){function c(a,b,c){void 0===c&&(c=function(a){return a});return function(){for(var e=[],f=0;f= 0x80 (not a basic code point)","invalid-input":"Invalid input"},yf=Math.floor,zf=String.fromCharCode; function Af(b,a){var c=b.split("@"),d="";1b)-((0!=a)<<5)} function Cf(b){return Af(b,function(a){if(vf.test(a)){var b,d=[],e=[],g=0;for(b=a.length;g=f&&gq&&d.push(zf(q))}for((g=b=d.length)&&d.push("-");g=e&&qyf((2147483647-k)/v))throw new RangeError(xf.overflow); k+=(t-e)*v;e=t;for(f=0;f=r+26?26:t-r;if(l>1;for(k+=yf(k/r);455a&&(d=a);for(a=0;a"` \r\n\t'.split("")),Tf=["'"].concat(Sf),Uf=["%","/","?",";","#"].concat(Tf),Vf=["/","?","#"],Wf=255,Xf=/^[+a-z0-9A-Z_-]{0,63}$/,Yf=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Zf={javascript:!0,"javascript:":!0},$f={javascript:!0,"javascript:":!0},ag={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0}; function Jf(b,a,c){if(b&&jc(b)&&b instanceof Nf)return b;var d=new Nf;d.parse(b,a,c);return d}Nf.prototype.parse=function(b,a,c){return bg(this,b,a,c)}; function bg(b,a,c,d){if(!hc(a))throw new TypeError("Parameter 'url' must be a string, not "+typeof a);var e=a.indexOf("?");e=-1!==e&&eWf?"":b.hostname.toLowerCase();f||(b.hostname=Cf(b.hostname));d=b.port?":"+b.port:"";b.host=(b.hostname||"")+d; b.href+=b.host;f&&(b.hostname=b.hostname.substr(1,b.hostname.length-2),"/"!==e[0]&&(e="/"+e))}if(!Zf[g])for(d=0,a=Tf.length;dg.length&&g.unshift("");a.pathname=g.join("/")}a.search=b.search;a.query=b.query;a.host=b.host||"";a.auth=b.auth;a.hostname=b.hostname||b.host;a.port=b.port;if(a.pathname||a.search)a.path=(a.pathname||"")+(a.search||"");a.slashes= a.slashes||b.slashes;a.href=a.format();return a}c=a.pathname&&"/"===a.pathname.charAt(0);var f=b.host||b.pathname&&"/"===b.pathname.charAt(0),h=c=f||c||a.host&&b.pathname;d=a.pathname&&a.pathname.split("/")||[];e=a.protocol&&!ag[a.protocol];g=b.pathname&&b.pathname.split("/")||[];e&&(a.hostname="",a.port=null,a.host&&(""===d[0]?d[0]=a.host:d.unshift(a.host)),a.host="",b.protocol&&(b.hostname=null,b.port=null,b.host&&(""===g[0]?g[0]=b.host:g.unshift(b.host)),b.host=null),c=c&&(""===g[0]||""===d[0])); if(f)a.host=b.host||""===b.host?b.host:a.host,a.hostname=b.hostname||""===b.hostname?b.hostname:a.hostname,a.search=b.search,a.query=b.query,d=g;else if(g.length)d||(d=[]),d.pop(),d=d.concat(g),a.search=b.search,a.query=b.query;else if(null!=b.search){e&&(a.hostname=a.host=d.shift(),e=a.host&&0d)d=b;else{for(;c(b,d);)d--;d=b.substr(0,d+1)}return d.replace(/^([a-zA-Z]+:|\.\/)/,"")}return a}Object.defineProperty(a,"__esModule",{value:!0});a.unixify=d;a.correctPath=function(a){return d(a.replace(/^\\\\\?\\.:\\/, "\\"))};var e="win32"===bc.platform});Da(eg); var fg=Ea(function(b,a){function c(a,b){void 0===b&&(b=ge.default.cwd());return Fa(b,a)}function d(a,b){return"function"===typeof a?[e(),a]:[e(a),t(b)]}function e(a){void 0===a&&(a={});return ja({},Sb,a)}function g(a){return"number"===typeof a?ja({},Qc,{mode:a}):ja({},Qc,a)}function f(a,b,c,d){void 0===b&&(b="");void 0===c&&(c="");void 0===d&&(d="");var e="";c&&(e=" '"+c+"'");d&&(e+=" -> '"+d+"'");switch(a){case "ENOENT":return"ENOENT: no such file or directory, "+b+e;case "EBADF":return"EBADF: bad file descriptor, "+ b+e;case "EINVAL":return"EINVAL: invalid argument, "+b+e;case "EPERM":return"EPERM: operation not permitted, "+b+e;case "EPROTO":return"EPROTO: protocol error, "+b+e;case "EEXIST":return"EEXIST: file already exists, "+b+e;case "ENOTDIR":return"ENOTDIR: not a directory, "+b+e;case "EISDIR":return"EISDIR: illegal operation on a directory, "+b+e;case "EACCES":return"EACCES: permission denied, "+b+e;case "ENOTEMPTY":return"ENOTEMPTY: directory not empty, "+b+e;case "EMFILE":return"EMFILE: too many open files, "+ b+e;case "ENOSYS":return"ENOSYS: function not implemented, "+b+e;default:return a+": error occurred, "+b+e}}function h(a,b,c,d,e){void 0===b&&(b="");void 0===c&&(c="");void 0===d&&(d="");void 0===e&&(e=Error);b=new e(f(a,b,c,d));b.code=a;return b}function k(a){if("number"===typeof a)return a;if("string"===typeof a){var b=Ia[a];if("undefined"!==typeof b)return b}throw new Ud.TypeError("ERR_INVALID_OPT_VALUE","flags",a);}function r(a,b){if(b){var c=typeof b;switch(c){case "string":a=ja({},a,{encoding:b}); break;case "object":a=ja({},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&&Vd.assertEncoding(a.encoding);return a}function q(a){return function(b){return r(a,b)}}function t(a){if("function"!==typeof a)throw TypeError(za.CB);return a}function v(a){return function(b,c){return"function"===typeof b?[a(),b]:[a(b),t(c)]}}function l(a){if("string"!==typeof a&&!E.Buffer.isBuffer(a)){try{if(!(a instanceof Of.URL))throw new TypeError(za.PATH_STR);}catch(hb){throw new TypeError(za.PATH_STR);}if(""!==a.hostname)throw new Ud.TypeError("ERR_INVALID_FILE_URL_HOST",ge.default.platform);a=a.pathname;for(var b=0;b>>0!==a)throw TypeError(za.FD);}function R(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 C(a){if("number"!==typeof a)throw TypeError(za.UID);}function H(a){if("number"!==typeof a)throw TypeError(za.GID);}function qa(a){a.emit("stop")}function V(a,b,c){if(!(this instanceof V))return new V(a,b,c);this._vol= a;c=ja({},r(c,{}));void 0===c.highWaterMark&&(c.highWaterMark=65536);qf.Readable.call(this,c);this.path=l(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 ra(){this.close()}function I(a,b,c){if(!(this instanceof I))return new I(a,b,c);this._vol=a;c=ja({},r(c,{}));qf.Writable.call(this,c);this.path=l(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 sa=x&&x.__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)}}(),ta=x&&x.__spreadArrays||function(){for(var a=0,b=0,c=arguments.length;b>>0!==a)throw TypeError(za.FD);a=this.getFileByFd(a);if(!a)throw h("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 d=y(a),e=this.getLink(d);if(e)return e.getNode();if(b&P&&(b=this.getLinkParent(d)))return e=this.createLink(b,d[d.length-1],!1,c), e.getNode();throw h("ENOENT","getNodeByIdOrCreate",l(a));};a.prototype.wrapAsync=function(a,b,c){var d=this;t(c);fe.default(function(){try{c(null,a.apply(d,b))}catch(Ya){c(Ya)}})};a.prototype._toJSON=function(a,b,c){var d;void 0===a&&(a=this.root);void 0===b&&(b={});var e=!0,f=a.children;a.getNode().isFile()&&(f=(d={},d[a.getName()]=a.parent.getChild(a.getName()),d),a=a.parent);for(var g in f){e=!1;f=a.getChild(g);if(!f)throw Error("_toJSON: unexpected undefined");d=f.getNode();d.isFile()?(f=f.getPath(), c&&(f=qb(c,f)),b[f]=d.getString()):d.isDirectory()&&this._toJSON(f,b,c)}a=a.getPath();c&&(a=qb(c,a));a&&e&&(b[a]=null);return b};a.prototype.toJSON=function(a,b,c){void 0===b&&(b={});void 0===c&&(c=!1);var d=[];if(a){a instanceof Array||(a=[a]);for(var e=0;e=this.maxFiles)throw h("EMFILE","open",a.getPath());var d=a;c&&(d=this.resolveSymlinks(a));if(!d)throw h("ENOENT","open",a.getPath());c=d.getNode();if(c.isDirectory()){if((b&(Sa|ma|xa))!==Sa)throw h("EISDIR","open",a.getPath());}else if(b&da)throw h("ENOTDIR","open",a.getPath());if(!(b&xa||c.canRead()))throw h("EACCES","open",a.getPath());a=new this.props.File(a,c,b,this.newFdNumber());this.fds[a.fd]=a;this.openFiles++;b&ua&&a.truncate();return a};a.prototype.openFile=function(a, b,c,d){void 0===d&&(d=!0);var e=n(a),f=d?this.getResolvedLink(e):this.getLink(e);if(!f&&b&P){var g=this.getResolvedLink(e.slice(0,e.length-1));if(!g)throw h("ENOENT","open",ia+e.join(ia));b&P&&"number"===typeof c&&(f=this.createLink(g,e[e.length-1],!1,c))}if(f)return this.openLink(f,b,d);throw h("ENOENT","open",a);};a.prototype.openBase=function(a,b,c,d){void 0===d&&(d=!0);b=this.openFile(a,b,c,d);if(!b)throw h("ENOENT","open",a);return b.fd};a.prototype.openSync=function(a,b,c){void 0===c&&(c=438); c=M(c);a=l(a);b=k(b);return this.openBase(a,b,c)};a.prototype.open=function(a,b,c,d){var e=c;"function"===typeof c&&(e=438,d=c);c=M(e||438);a=l(a);b=k(b);this.wrapAsync(this.openBase,[a,b,c],d)};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){ha(a);a=this.getFileByFdOrThrow(a,"close");this.closeFile(a)};a.prototype.close=function(a,b){ha(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 h("ENOENT");return a}return this.openFile(l(a),b,c)};a.prototype.readBase=function(a,b,c,d,e){return this.getFileByFdOrThrow(a).read(b,Number(c),Number(d),e)};a.prototype.readSync=function(a,b,c,d,e){ha(a);return this.readBase(a,b,c,d,e)};a.prototype.read=function(a,b,c,d,e,f){var g=this;t(f);if(0===d)return ge.default.nextTick(function(){f&&f(null,0,b)});fe.default(function(){try{var h=g.readBase(a,b,c,d,e);f(null,h,b)}catch(Tc){f(Tc)}})}; a.prototype.readFileBase=function(a,b,c){var d="number"===typeof a&&a>>>0===a;if(!d){var e=l(a);e=n(e);if((e=this.getResolvedLink(e))&&e.getNode().isDirectory())throw h("EISDIR","open",e.getPath());a=this.openSync(a,b)}try{var f=O(this.getFileByFdOrThrow(a).getBuffer(),c)}finally{d||this.closeSync(a)}return f};a.prototype.readFileSync=function(a,b){b=Ga(b);var c=k(b.flag);return this.readFileBase(a,c,b.encoding)};a.prototype.readFile=function(a,b,c){c=v(Ga)(b,c);b=c[0];c=c[1];var d=k(b.flag);this.wrapAsync(this.readFileBase, [a,d,b.encoding],c)};a.prototype.writeBase=function(a,b,c,d,e){return this.getFileByFdOrThrow(a,"write").write(b,c,d,e)};a.prototype.writeSync=function(a,b,c,d,e){ha(a);var f="string"!==typeof b;if(f){var g=(c||0)|0,h=d;c=e}else var k=d;b=B(b,k);f?"undefined"===typeof h&&(h=b.length):(g=0,h=b.length);return this.writeBase(a,b,g,h,c)};a.prototype.write=function(a,b,c,d,e,f){var g=this;ha(a);var h=typeof b,k=typeof c,l=typeof d,p=typeof e;if("string"!==h)if("function"===k)var n=c;else if("function"=== l){var q=c|0;n=d}else if("function"===p){q=c|0;var gb=d;n=e}else{q=c|0;gb=d;var Xa=e;n=f}else if("function"===k)n=c;else if("function"===l)Xa=c,n=d;else if("function"===p){Xa=c;var r=d;n=e}var hb=B(b,r);"string"!==h?"undefined"===typeof gb&&(gb=hb.length):(q=0,gb=hb.length);var C=t(n);fe.default(function(){try{var c=g.writeBase(a,hb,q,gb,Xa);"string"!==h?C(null,c,hb):C(null,c,b)}catch(oe){C(oe)}})};a.prototype.writeFileBase=function(a,b,c,d){var e="number"===typeof a;a=e?a:this.openBase(l(a),c,d); d=0;var f=b.length;c=c&J?void 0:0;try{for(;0=a.nlink&&this.deleteNode(a)};a.prototype.unlinkSync=function(a){a=l(a);this.unlinkBase(a)};a.prototype.unlink=function(a,b){a=l(a);this.wrapAsync(this.unlinkBase,[a],b)};a.prototype.symlinkBase=function(a,b){var c=n(b),d=this.getLinkParent(c);if(!d)throw h("ENOENT","symlink",a,b);c=c[c.length-1];if(d.getChild(c))throw h("EEXIST","symlink",a,b);b=d.createChild(c);b.getNode().makeSymlink(n(a));return b};a.prototype.symlinkSync=function(a,b){a=l(a);b=l(b);this.symlinkBase(a,b)};a.prototype.symlink= function(a,b,c,d){c=t("function"===typeof c?c:d);a=l(a);b=l(b);this.wrapAsync(this.symlinkBase,[a,b],c)};a.prototype.realpathBase=function(a,b){var c=n(a);c=this.getResolvedLink(c);if(!c)throw h("ENOENT","realpath",a);return Vd.strToEncoding(c.getPath(),b)};a.prototype.realpathSync=function(a,b){return this.realpathBase(l(a),Cc(b).encoding)};a.prototype.realpath=function(a,b,c){c=Hd(b,c);b=c[0];c=c[1];a=l(a);this.wrapAsync(this.realpathBase,[a,b.encoding],c)};a.prototype.lstatBase=function(a,b){void 0=== b&&(b=!1);var c=this.getLink(n(a));if(!c)throw h("ENOENT","lstat",a);return Ka.default.build(c.getNode(),b)};a.prototype.lstatSync=function(a,b){return this.lstatBase(l(a),e(b).bigint)};a.prototype.lstat=function(a,b,c){c=d(b,c);b=c[0];c=c[1];this.wrapAsync(this.lstatBase,[l(a),b.bigint],c)};a.prototype.statBase=function(a,b){void 0===b&&(b=!1);var c=this.getResolvedLink(n(a));if(!c)throw h("ENOENT","stat",a);return Ka.default.build(c.getNode(),b)};a.prototype.statSync=function(a,b){return this.statBase(l(a), e(b).bigint)};a.prototype.stat=function(a,b,c){c=d(b,c);b=c[0];c=c[1];this.wrapAsync(this.statBase,[l(a),b.bigint],c)};a.prototype.fstatBase=function(a,b){void 0===b&&(b=!1);a=this.getFileByFd(a);if(!a)throw h("EBADF","fstat");return Ka.default.build(a.node,b)};a.prototype.fstatSync=function(a,b){return this.fstatBase(a,e(b).bigint)};a.prototype.fstat=function(a,b,c){b=d(b,c);this.wrapAsync(this.fstatBase,[a,b[0].bigint],b[1])};a.prototype.renameBase=function(a,b){var c=this.getLink(n(a));if(!c)throw h("ENOENT", "rename",a,b);var d=n(b),e=this.getLinkParent(d);if(!e)throw h("ENOENT","rename",a,b);(a=c.parent)&&a.deleteChild(c);c.steps=ta(e.steps,[d[d.length-1]]);e.setChild(c.getName(),c)};a.prototype.renameSync=function(a,b){a=l(a);b=l(b);this.renameBase(a,b)};a.prototype.rename=function(a,b,c){a=l(a);b=l(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(l(a))}catch(Xa){return!1}};a.prototype.exists= function(a,b){var c=this,d=l(a);if("function"!==typeof b)throw Error(za.CB);fe.default(function(){try{b(c.existsBase(d))}catch(Ya){b(!1)}})};a.prototype.accessBase=function(a){this.getLinkOrThrow(a,"access")};a.prototype.accessSync=function(a,b){void 0===b&&(b=Hb);a=l(a);this.accessBase(a,b|0)};a.prototype.access=function(a,b,c){var d=Hb;"function"!==typeof b&&(d=b|0,b=t(c));a=l(a);this.wrapAsync(this.accessBase,[a,d],b)};a.prototype.appendFileSync=function(a,b,c){void 0===c&&(c=ec);c=Ac(c);c.flag&& a>>>0!==a||(c.flag="a");this.writeFileSync(a,b,c)};a.prototype.appendFile=function(a,b,c,d){d=Gd(c,d);c=d[0];d=d[1];c.flag&&a>>>0!==a||(c.flag="a");this.writeFile(a,b,c,d)};a.prototype.readdirBase=function(a,b){var c=n(a);c=this.getResolvedLink(c);if(!c)throw h("ENOENT","readdir",a);if(!c.getNode().isDirectory())throw h("ENOTDIR","scandir",a);if(b.withFileTypes){var d=[];for(e in c.children)(a=c.getChild(e))&&d.push(Wd.default.build(a,b.encoding));p||"buffer"===b.encoding||d.sort(function(a,b){return a.name< b.name?-1:a.name>b.name?1:0});return d}var e=[];for(d in c.children)e.push(Vd.strToEncoding(d,b.encoding));p||"buffer"===b.encoding||e.sort();return e};a.prototype.readdirSync=function(a,b){b=rc(b);a=l(a);return this.readdirBase(a,b)};a.prototype.readdir=function(a,b,c){c=ne(b,c);b=c[0];c=c[1];a=l(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 h("EINVAL","readlink",a);a=ia+c.symlink.join(ia); return Vd.strToEncoding(a,b)};a.prototype.readlinkSync=function(a,b){b=u(b);a=l(a);return this.readlinkBase(a,b.encoding)};a.prototype.readlink=function(a,b,c){c=Dc(b,c);b=c[0];c=c[1];a=l(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 d="number"===typeof b?b:0;b=t("number"===typeof b?c:b);this.wrapAsync(this.ftruncateBase,[a,d],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 d="number"===typeof b?b:0;b=t("number"===typeof b?c:b);if(a>>>0===a)return this.ftruncate(a,d,b);this.wrapAsync(this.truncateBase,[a,d],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, R(b),R(c))};a.prototype.futimes=function(a,b,c,d){this.wrapAsync(this.futimesBase,[a,R(b),R(c)],d)};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(l(a),R(b),R(c))};a.prototype.utimes=function(a,b,c,d){this.wrapAsync(this.utimesBase,[l(a),R(b),R(c)],d)};a.prototype.mkdirBase=function(a,b){var c=n(a);if(!c.length)throw h("EISDIR","mkdir",a);var d=this.getLinkParentAsDirOrThrow(a, "mkdir");c=c[c.length-1];if(d.getChild(c))throw h("EEXIST","mkdir",a);d.createChild(c,this.createNode(!0,b))};a.prototype.mkdirpBase=function(a,b){a=n(a);for(var c=this.root,d=0;dthis.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= l(a);this.setTimeout=b?setTimeout:qe.default;this.interval=c;this.prev=this.vol.statSync(this.filename);this.loop()};b.prototype.stop=function(){clearTimeout(this.timeoutRef);ge.default.nextTick(qa,this)};return b}(L.EventEmitter);a.StatWatcher=sc;var Z;md.inherits(V,qf.Readable);a.ReadStream=V;V.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())})};V.prototype._read= function(a){if("number"!==typeof this.fd)return this.once("open",function(){this._read(a)});if(!this.destroyed){if(!Z||128>Z.length-Z.used)Z=E.bufferAllocUnsafe(this._readableState.highWaterMark),Z.used=0;var b=Z,c=Math.min(Z.length-Z.used,a),d=Z.used;void 0!==this.pos&&(c=Math.min(this.end-this.pos+1,c));if(0>=c)return this.push(null);var e=this;this._vol.read(this.fd,Z,Z.used,c,this.pos,function(a,c){a?(e.autoClose&&e.destroy&&e.destroy(),e.emit("error",a)):(a=null,0h[0]&&c[1]c&&(e=0,d+=1));return{row:d,col:e}} for(var wg=function(){function b(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}b.prototype._getAsyncRead=function(){var a=this,b,d;return{promise:new Promise(function(c,g){b=function(b){a._promptPrefix="";a._continuationPromptPrefix="";c(b)};d=g}),resolve:b,reject:d}};b.prototype.read=function(a,b){void 0===b&&(b="> ");0a.length&&(this._cursor=a.length);var e=this.applyPromptOffset(a,this._cursor);b=vg(c,c.length,this._termSize.cols).row+1;e=vg(c,e,this._termSize.cols);c=e.col;b=b-e.row-1;this.xterm.write("\r");for(e=0;e< b;++e)this.xterm.write("\u001b[F");for(e=0;ea&&(a=0);a>this._input.length&&(a=this._input.length);this._writeCursorPosition(a)};b.prototype.setCursorDirectly=function(a){this._writeCursorPosition(a)};b.prototype._writeCursorPosition=function(a){var b=this.applyPrompts(this._input);vg(b,b.length,this._termSize.cols);var d=this.applyPromptOffset(this._input,this._cursor),e=vg(b,d,this._termSize.cols);d=e.col;e=e.row; var g=this.applyPromptOffset(this._input,a);g=vg(b,g,this._termSize.cols);b=g.col;g=g.row;if(g>e)for(var f=e;fd)for(f=d;fDg;Dg++)Cg+=(Math.pow(16,8)*Math.random()).toString(16);function Eg(b,a,c){b=Fg(b,a,c);return"function"!==typeof a?b:b.reduce(function(a,b){if("object"===typeof b)return a.concat(b);b=b.split(RegExp("("+Cg+".*?"+Cg+")","g"));return 1===b.length?a.concat(b[0]):a.concat(b.filter(Boolean).map(function(a){return RegExp("^"+Cg).test(a)?JSON.parse(a.split(Cg)[1]):a}))},[])} function Fg(b,a,c){var d=b.match(/((?:\|\||\&\&|;;|\|\&|\<\(|>>|>\&|[&;()|<>]))|((\\['"|&;()<> \t]|[^\s'"|&;()<> \t])+|"((\\"|[^"])*?)"|'((\\'|[^'])*?)')*/g).filter(Boolean),e=!1;if(!d)return[];a||(a={});c||(c={});return d.map(function(b,f){function g(){l+=1;if("{"===b.charAt(l)){l+=1;if("}"===b.charAt(l))throw Error("Bad substitution: "+b.substr(l-2,3));var c=b.indexOf("}",l);if(0>c)throw Error("Bad substitution: "+b.substr(l));var d=b.substr(l,c-l);l=c}else/[*@#?$!_\-]/.test(b.charAt(l))?(d=b.charAt(l), l+=1):(c=b.substr(l).match(/[^\w\d_]/))?(d=b.substr(l,c.index),l+=c.index-1):(d=b.substr(l),l=b.length);c=d;d="function"===typeof a?a(c):a[c];void 0===d&&""!=c?d="":void 0===d&&(d="$");c="object"===typeof d?""+Cg+JSON.stringify(d)+Cg:""+d;return c}if(!e){if(/^(?:\|\||\&\&|;;|\|\&|\<\(|>>|>\&|[&;()|<>])$/.test(b))return{op:b};for(var k=c.escape||"\\",r=!1,q=!1,t="",v=!1,l=0,n=b.length;l>|>\&|[&;()|<>])$/.test(y))return{op:b};if(/^#$/.test(y))return e=!0,t.length?[t,{comment:b.slice(l+1)+d.slice(f+1).join(" ")}]:[{comment:b.slice(l+1)+d.slice(f+1).join(" ")}];y===k?q=!0:t="$"===y?t+g():t+y}}return v?{op:"glob",pattern:t}:t}}).reduce(function(a,b){return void 0===b?a:a.concat(b)},[])} function Gg(b,a){void 0===a&&(a=!0);var c,d=[],e=/\w+/g;for(c=e.exec(b);c;)a?d.push(c.index):d.push(c.index+c[0].length),c=e.exec(b);return d}function Hg(b,a){b=Gg(b,!0).reverse().find(function(b){return ba});return void 0===c?b.length:c} function Jg(b){return""===b.trim()?!1:0!==(b.match(/'/g)||[]).length%2||0!==(b.match(/"/g)||[]).length%2||""===b.split(/(\|\||\||&&)/g).pop().trim()||b.endsWith("\\")&&!b.endsWith("\\\\")?!0:!1}function Kg(b){return null!==b.match(/[^\\][ \t]$/m)}function Lg(b){return""===b.trim()||Kg(b)?"":Eg(b).pop()||""} function Mg(b,a){var c=Eg(a),d=c.length-1,e=c[d]||"";""===a.trim()?(d=0,e=""):Kg(a)&&(d+=1,e="");return b.reduce(function(a,b){try{var e=b(d,c);return a.concat(e)}catch(k){return console.error("Auto-complete error:",k),a}},[]).filter(function(a){return a.startsWith(e)})} var Ng=function(){function b(a){this.size=a;this.entries=[];this.cursor=0}b.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)};b.prototype.includes=function(a){return this.entries.includes(a)};b.prototype.rewind=function(){this.cursor=this.entries.length};b.prototype.getPrevious=function(){var a=Math.max(0,this.cursor-1);this.cursor=a;return this.entries[a]};b.prototype.getNext= function(){var a=Math.min(this.entries.length,this.cursor+1);this.cursor=a;return this.entries[a]};return b}(); let Og=Symbol("Comlink.proxy"),Pg=Symbol("Comlink.endpoint"),Qg=Symbol("Comlink.releaseProxy"),Rg=new WeakSet,zh=new Map([["proxy",{canHandle:b=>b&&b[Og],serialize(b){const {port1:a,port2:c}=new MessageChannel;Sg(b,a);return[c,[c]]},deserialize:b=>{b.start();return yh(b,[],void 0)}}],["throw",{canHandle:b=>Rg.has(b),serialize(b){const a=b instanceof Error;let c=b;a&&(c={isError:a,message:b.message,stack:b.stack});return[c,[]]},deserialize(b){if(b.isError)throw Object.assign(Error(),b);throw b;}}]]); function Sg(b,a=self){a.addEventListener("message",function e(d){if(d&&d.data){var {id:g,type:f,path:h}=Object.assign({path:[]},d.data),k=(d.data.argumentList||[]).map(Ah);try{let a=h.slice(0,-1).reduce((a,b)=>a[b],b),e=h.reduce((a,b)=>a[b],b);switch(f){case 0:var r=e;break;case 1:a[h.slice(-1)[0]]=Ah(d.data.value);r=!0;break;case 2:r=e.apply(a,k);break;case 3:{let a=new e(...k);r=Bh(a)}break;case 4:{let {port1:a,port2:d}=new MessageChannel;Sg(b,d);r=Ch(a,[a])}break;case 5:r=void 0}}catch(q){r=q, Rg.add(q)}Promise.resolve(r).catch(a=>{Rg.add(a);return a}).then(b=>{let [d,h]=Dh(b);a.postMessage(Object.assign(Object.assign({},d),{id:g}),h);5===f&&(a.removeEventListener("message",e),"MessagePort"===a.constructor.name&&a.close())})}});a.start&&a.start()}function Eh(b){if(b)throw Error("Proxy has been released and is not useable");} function yh(b,a=[],c=function(){}){let d=!1,e=new Proxy(c,{get(c,f){Eh(d);if(f===Qg)return()=>Fh(b,{type:5,path:a.map(a=>a.toString())}).then(()=>{"MessagePort"===b.constructor.name&&b.close();d=!0});if("then"===f){if(0===a.length)return{then:()=>e};c=Fh(b,{type:0,path:a.map(a=>a.toString())}).then(Ah);return c.then.bind(c)}return yh(b,[...a,f])},set(c,e,h){Eh(d);const [f,g]=Dh(h);return Fh(b,{type:1,path:[...a,e].map(a=>a.toString()),value:f},g).then(Ah)},apply(c,e,h){Eh(d);c=a[a.length-1];if(c=== Pg)return Fh(b,{type:4}).then(Ah);if("bind"===c)return yh(b,a.slice(0,-1));const [f,g]=Gh(h);return Fh(b,{type:2,path:a.map(a=>a.toString()),argumentList:f},g).then(Ah)},construct(c,e){Eh(d);const [f,g]=Gh(e);return Fh(b,{type:3,path:a.map(a=>a.toString()),argumentList:f},g).then(Ah)}});return e}function Gh(b){b=b.map(Dh);return[b.map(a=>a[0]),Array.prototype.concat.apply([],b.map(a=>a[1]))]}let Hh=new WeakMap;function Ch(b,a){Hh.set(b,a);return b} function Bh(b){return Object.assign(b,{[Og]:!0})}function Dh(b){for(let [a,c]of zh)if(c.canHandle(b)){let [d,e]=c.serialize(b);return[{type:3,name:a,value:d},e]}return[{type:0,value:b},Hh.get(b)||[]]}function Ah(b){switch(b.type){case 3:return zh.get(b.name).deserialize(b.value);case 0:return b.value}} function Fh(b,a,c){return new Promise(d=>{let e=Ih();b.addEventListener("message",function h(a){a.data&&a.data.id&&a.data.id===e&&(b.removeEventListener("message",h),d(a.data))});b.start&&b.start();b.postMessage(Object.assign({id:e},a),c)})}function Ih(){return Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var Jh=Array.isArray||function(b){return"[object Array]"==Object.prototype.toString.call(b)}; function Kh(b,a){if(b.map)return b.map(a);for(var c=[],d=0;da&&(uc=0,ve={line:1,column:1,seenCR:!1});var b=ve,d;for(d=uc;dZc&&(Zc=m,we=[]),we.push(a))}function r(){var a,b;var c=m;var d=[];var e=m;var g=[];for(a=G();a!==p;)g.push(a),a=G();if(g!==p)if(a=q(),a!==p){var h=[];for(b=G();b!==p;)h.push(b),b=G();h!==p?e=g=[g,a,h]:(m=e,e=u)}else m=e,e=u;else m=e,e=u;if(e!==p)for(;e!==p;){d.push(e);e=m;g=[];for(a=G();a!==p;)g.push(a),a=G();if(g!==p)if(a=q(),a!==p){h=[];for(b=G();b!==p;)h.push(b),b=G();h!==p?e=g=[g,a,h]:(m=e,e=u)}else m=e,e=u;else m=e,e=u}else d=u;d!==p&&(F=c, d=f(d));return d}function q(){var a,b;w++;var c=m;var d=t();if(d!==p){var e=[];var f=m;var h=[];for(a=J();a!==p;)h.push(a),a=J();if(h!==p)if(a=v(),a!==p){var l=[];for(b=G();b!==p;)l.push(b),b=G();l!==p?(b=t(),b!==p?f=h=[h,a,l,b]:(m=f,f=u)):(m=f,f=u)}else m=f,f=u;else m=f,f=u;for(;f!==p;){e.push(f);f=m;h=[];for(a=J();a!==p;)h.push(a),a=J();if(h!==p)if(a=v(),a!==p){l=[];for(b=G();b!==p;)l.push(b),b=G();l!==p?(b=t(),b!==p?f=h=[h,a,l,b]:(m=f,f=u)):(m=f,f=u)}else m=f,f=u;else m=f,f=u}if(e!==p){f=m;h=[]; for(a=J();a!==p;)h.push(a),a=J();h!==p?(a=v(),a!==p?f=h=[h,a]:(m=f,f=u)):(m=f,f=u);f===p&&(f=Ga);f!==p?(F=c,c=d=g(d,e)):(m=c,c=u)}else m=c,c=u}else m=c,c=u;w--;c===p&&0===w&&k(Dc);return c}function t(){var a=m;var b=l();if(b===p&&(b=B(),b===p)){var d;var e=m;c.substr(m,5)===Sb?(b=Sb,m+=5):(b=p,0===w&&k(Rc));b===p&&(c.substr(m,5)===Ub?(b=Ub,m+=5):(b=p,0===w&&k(sc)));if(b!==p){var f=[];var g=G();if(g!==p)for(;g!==p;)f.push(g),g=G();else f=u;if(f!==p)if(g=y(),g!==p){f=[];for(d=G();d!==p;)f.push(d),d= G();f!==p?(c.substr(m,2)===Z?(d=Z,m+=2):(d=p,0===w&&k(tc)),d!==p?(f=G(),f!==p?(f=r(),f!==p?(c.substr(m,4)===Pc?(d=Pc,m+=4):(d=p,0===w&&k(gb)),d!==p?(F=e,e=b={type:b+"-loop",test:g,body:f}):(m=e,e=u)):(m=e,e=u)):(m=e,e=u)):(m=e,e=u)):(m=e,e=u)}else m=e,e=u;else m=e,e=u}else m=e,e=u;b=e;if(b===p){e=m;c.substr(m,2)===Xa?(b=Xa,m+=2):(b=p,0===w&&k(hb));if(b!==p){g=[];b=G();if(b!==p)for(;b!==p;)g.push(b),b=G();else g=u;if(g!==p)if(b=r(),b!==p)if(c.substr(m,4)===Tb?(g=Tb,m+=4):(g=p,0===w&&k(Ya)),g!==p){f= [];g=G();if(g!==p)for(;g!==p;)f.push(g),g=G();else f=u;if(f!==p)if(g=r(),g!==p){f=[];for(d=n();d!==p;)f.push(d),d=n();if(f!==p){d=m;if(c.substr(m,4)===ib){var h=ib;m+=4}else h=p,0===w&&k(xg);if(h!==p){var q=r();q!==p?d=h=[h,q]:(m=d,d=u)}else m=d,d=u;d===p&&(d=Ga);d!==p?(c.substr(m,2)===Sc?(h=Sc,m+=2):(h=p,0===w&&k(Tc)),h!==p?(F=e,e=b={type:"ifElse",test:b,body:g,elifBlocks:f.length?f:null,elseBody:d?d[1]:null}):(m=e,e=u)):(m=e,e=u)}else m=e,e=u}else m=e,e=u;else m=e,e=u}else m=e,e=u;else m=e,e=u; else m=e,e=u}else m=e,e=u;b=e}}if(b!==p){e=m;g=[];for(f=J();f!==p;)g.push(f),f=J();if(g!==p){f=m;c.substr(m,2)===dc?(d=dc,m+=2):(d=p,0===w&&k(Bc));d===p&&(c.substr(m,2)===ec?(d=ec,m+=2):(d=p,0===w&&k(Ac)));if(d!==p){h=[];for(q=G();q!==p;)h.push(q),q=G();h!==p?(q=t(),q!==p?(F=f,f=d=[d,q]):(m=f,f=u)):(m=f,f=u)}else m=f,f=u;f!==p?e=g=[g,f]:(m=e,e=u)}else m=e,e=u;e===p&&(e=Ga);e!==p?(F=a,a=b,"undefined"!==typeof e&&e?(e=e[1],a.control=e[0],a.next=e[1]):(a.control=";",a.next=null)):(m=a,a=u)}else m=a, a=u;return a}function v(){var a=m;if(38===c.charCodeAt(m)){var b=Gd;m++}else b=p,0===w&&k(Cc);b===p&&(59===c.charCodeAt(m)?(b=Hd,m++):(b=p,0===w&&k(Qc)),b===p&&(10===c.charCodeAt(m)?(b=qc,m++):(b=p,0===w&&k(rc))));b!==p&&(F=a,b="\n"==b?";":b);return b}function l(){w++;var a=m;var b=[];var d=m;var f=B();f===p&&(f=ya());if(f!==p){var g=[];var h=J();if(h!==p)for(;h!==p;)g.push(h),h=J();else g=u;g!==p?d=f=[f,g]:(m=d,d=u)}else m=d,d=u;for(;d!==p;)if(b.push(d),d=m,f=B(),f===p&&(f=ya()),f!==p){g=[];h=J(); if(h!==p)for(;h!==p;)g.push(h),h=J();else g=u;g!==p?d=f=[f,g]:(m=d,d=u)}else m=d,d=u;if(b!==p)if(d=O(),d===p&&(d=X()),d!==p){f=[];g=m;h=[];var n=J();if(n!==p)for(;n!==p;)h.push(n),n=J();else h=u;h!==p?(n=ya(),n===p&&(n=M()),n!==p?g=h=[h,n]:(m=g,g=u)):(m=g,g=u);for(;g!==p;){f.push(g);g=m;h=[];n=J();if(n!==p)for(;n!==p;)h.push(n),n=J();else h=u;h!==p?(n=ya(),n===p&&(n=M()),n!==p?g=h=[h,n]:(m=g,g=u)):(m=g,g=u)}if(f!==p){g=m;h=[];for(n=J();n!==p;)h.push(n),n=J();if(h!==p){var q;n=m;if(124===c.charCodeAt(m)){var r= Wj;m++}else r=p,0===w&&k(Xj);if(r!==p){r=[];for(q=G();q!==p;)r.push(q),q=G();r!==p?(q=l(),q!==p?(F=n,n=r={type:"pipe",command:q}):(m=n,n=u)):(m=n,n=u)}else m=n,n=u;n!==p?g=h=[h,n]:(m=g,g=u)}else m=g,g=u;g===p&&(g=Ga);g!==p?(F=a,a=b=e(b,d,f,g)):(m=a,a=u)}else m=a,a=u}else m=a,a=u;else m=a,a=u;w--;a===p&&0===w&&k(ne);return a}function n(){var a=m;if(c.substr(m,4)===Uc){var b=Uc;m+=4}else b=p,0===w&&k(yg);if(b!==p){var d=[];b=G();if(b!==p)for(;b!==p;)d.push(b),b=G();else d=u;if(d!==p)if(b=y(),b!==p)if(c.substr(m, 4)===Tb?(d=Tb,m+=4):(d=p,0===w&&k(Ya)),d!==p){d=[];var e=G();if(e!==p)for(;e!==p;)d.push(e),e=G();else d=u;d!==p?(e=r(),e!==p?(F=a,a=b={type:"ifElse",test:b,body:e}):(m=a,a=u)):(m=a,a=u)}else m=a,a=u;else m=a,a=u;else m=a,a=u}else m=a,a=u;return a}function y(){var a=m;var b=r();b!==p&&(F=a);return b}function B(){var a=m;var b=Sa();if(b!==p){if(61===c.charCodeAt(m)){var d=Cj;m++}else d=p,0===w&&k(Dj);d!==p?(d=M(),d!==p?(F=a,a=b={type:"variableAssignment",name:b,value:d}):(m=a,a=u)):(m=a,a=u)}else m= a,a=u;return a}function O(){var a;w++;var b=a=m;w++;var c=ya();w--;c===p?b=Ha:(m=b,b=u);if(b!==p)if(c=m,w++,b=da(),w--,b===p?c=Ha:(m=c,c=u),c!==p)if(b=m,w++,c=B(),w--,c===p?b=Ha:(m=b,b=u),b!==p){c=m;b=[];var d=H();d===p&&(d=ha(),d===p&&(d=Fa(),d===p&&(d=xa(),d===p&&(d=ma(),d===p&&(d=ra(),d===p&&(d=I()))))));if(d!==p)for(;d!==p;)b.push(d),d=H(),d===p&&(d=ha(),d===p&&(d=Fa(),d===p&&(d=xa(),d===p&&(d=ma(),d===p&&(d=ra(),d===p&&(d=I()))))));else b=u;b!==p&&(F=c,b=ia(b));c=b;c===p&&(c=X());c!==p?(F=a, a=c):(m=a,a=u)}else m=a,a=u;else m=a,a=u;else m=a,a=u;w--;a===p&&0===w&&k(Ej);return a}function X(){if(91===c.charCodeAt(m)){var a=zg;m++}else a=p,0===w&&k(Ag);a===p&&(c.substr(m,2)===Vc?(a=Vc,m+=2):(a=p,0===w&&k(Bg)));return a}function M(){w++;var a=O();if(a===p){a=m;if(Yj.test(c.charAt(m))){var b=c.charAt(m);m++}else b=p,0===w&&k(Zj);if(b!==p){if(40===c.charCodeAt(m)){var d=Ug;m++}else d=p,0===w&&k(Vg);if(d!==p)if(d=q(),d!==p){if(41===c.charCodeAt(m)){var e=Wg;m++}else e=p,0===w&&k(Xg);e!==p?(F= a,a=b={type:"processSubstitution",readWrite:b,commands:d}):(m=a,a=u)}else m=a,a=u;else m=a,a=u}else m=a,a=u}w--;a===p&&0===w&&k(oe);return a}function ha(){var a=m;var b=[];var c=R();if(c!==p)for(;c!==p;)b.push(c),c=R();else b=u;b!==p&&(F=a,b=Hb(b));return b}function R(){var a=m;if(92===c.charCodeAt(m)){var b=Yg;m++}else b=p,0===w&&k(Zg);if(b!==p){var d=C();d!==p?(F=a,a=d):(m=a,a=u)}else m=a,a=u;a===p&&(b=a=m,w++,d=C(),w--,d===p?b=Ha:(m=b,b=u),b!==p?(c.length>m?(d=c.charAt(m),m++):(d=p,0===w&&k(Za)), d!==p?(F=a,a=d):(m=a,a=u)):(m=a,a=u));return a}function C(){if(ak.test(c.charAt(m))){var a=c.charAt(m);m++}else a=p,0===w&&k(bk);return a}function H(){var a;var b=m;var d=[];for(a=R();a!==p;)d.push(a),a=R();if(d!==p){a=[];42===c.charCodeAt(m)?(d=$g,m++):(d=p,0===w&&k(ah));d===p&&(63===c.charCodeAt(m)?(d=xe,m++):(d=p,0===w&&k(ye)),d===p&&(d=qa(),d===p&&(d=V())));if(d!==p)for(;d!==p;)a.push(d),42===c.charCodeAt(m)?(d=$g,m++):(d=p,0===w&&k(ah)),d===p&&(63===c.charCodeAt(m)?(d=xe,m++):(d=p,0===w&&k(ye)), d===p&&(d=qa(),d===p&&(d=V())));else a=u;if(a!==p){d=[];for(a=R();a!==p;)d.push(a),a=R();d!==p?(F=b,b=d={type:"glob",value:c.substring(F,m)}):(m=b,b=u)}else m=b,b=u}else m=b,b=u;return b}function qa(){var a;var b=a=m;if(91===c.charCodeAt(m)){var d=zg;m++}else d=p,0===w&&k(Ag);if(d!==p){var e=m;w++;if(45===c.charCodeAt(m)){var f=$c;m++}else f=p,0===w&&k(ad);w--;f===p?e=Ha:(m=e,e=u);if(e!==p)if(c.length>m?(f=c.charAt(m),m++):(f=p,0===w&&k(Za)),f!==p){if(45===c.charCodeAt(m)){var g=$c;m++}else g=p,0=== w&&k(ad);if(g!==p){var h=m;w++;if(45===c.charCodeAt(m)){var l=$c;m++}else l=p,0===w&&k(ad);w--;l===p?h=Ha:(m=h,h=u);if(h!==p)if(c.length>m?(l=c.charAt(m),m++):(l=p,0===w&&k(Za)),l!==p){if(93===c.charCodeAt(m)){var n=ck;m++}else n=p,0===w&&k(dk);n!==p?b=d=[d,e,f,g,h,l,n]:(m=b,b=u)}else m=b,b=u;else m=b,b=u}else m=b,b=u}else m=b,b=u;else m=b,b=u}else m=b,b=u;b!==p&&(b=c.substring(a,m));return b}function V(){var a;var b=a=m;if(c.length>m){var d=c.charAt(m);m++}else d=p,0===w&&k(Za);d===p&&(d=Ga);if(d!== p){var e=m;w++;if(36===c.charCodeAt(m)){var f=ze;m++}else f=p,0===w&&k(Ae);w--;f===p?e=Ha:(m=e,e=u);e!==p?b=d=[d,e]:(m=b,b=u)}else m=b,b=u;if(b!==p)if(123===c.charCodeAt(m)?(d=ek,m++):(d=p,0===w&&k(fk)),d!==p){e=[];f=R();if(f!==p)for(;f!==p;)e.push(f),f=R();else e=u;e!==p?(125===c.charCodeAt(m)?(f=bh,m++):(f=p,0===w&&k(ch)),f!==p?a=b=[b,d,e,f]:(m=a,a=u)):(m=a,a=u)}else m=a,a=u;else m=a,a=u;return a}function ra(){var a=m;if(39===c.charCodeAt(m)){var b=Be;m++}else b=p,0===w&&k(Ce);if(b!==p){b=m;var d= [];if(dh.test(c.charAt(m))){var e=c.charAt(m);m++}else e=p,0===w&&k(eh);for(;e!==p;)d.push(e),dh.test(c.charAt(m))?(e=c.charAt(m),m++):(e=p,0===w&&k(eh));d!==p&&(d=c.substring(b,m));b=d;b!==p?(39===c.charCodeAt(m)?(d=Be,m++):(d=p,0===w&&k(Ce)),d!==p?(F=a,a=b=Hb(b)):(m=a,a=u)):(m=a,a=u)}else m=a,a=u;return a}function I(){var a=m;if(34===c.charCodeAt(m)){var b=bd;m++}else b=p,0===w&&k(cd);if(b!==p){b=[];var e=ja();if(e===p){e=[];var f=sa();if(f!==p)for(;f!==p;)e.push(f),f=sa();else e=u}for(;e!==p;)if(b.push(e), e=ja(),e===p)if(e=[],f=sa(),f!==p)for(;f!==p;)e.push(f),f=sa();else e=u;b!==p?(34===c.charCodeAt(m)?(e=bd,m++):(e=p,0===w&&k(cd)),e!==p?(F=a,a=b=d(b)):(m=a,a=u)):(m=a,a=u)}else m=a,a=u;return a}function sa(){var a=m;if(92===c.charCodeAt(m)){var b=Yg;m++}else b=p,0===w&&k(Zg);if(b!==p){var d=ta();d!==p?(F=a,a=d):(m=a,a=u)}else m=a,a=u;a===p&&(a=m,c.substr(m,2)===dd?(b=dd,m+=2):(b=p,0===w&&k(fh)),b!==p&&(F=a,b="\\"),a=b,a===p&&(b=a=m,w++,d=ta(),w--,d===p?b=Ha:(m=b,b=u),b!==p?(c.length>m?(d=c.charAt(m), m++):(d=p,0===w&&k(Za)),d!==p?(F=a,a=d):(m=a,a=u)):(m=a,a=u)));return a}function ta(){if(34===c.charCodeAt(m)){var a=bd;m++}else a=p,0===w&&k(cd);a===p&&(36===c.charCodeAt(m)?(a=ze,m++):(a=p,0===w&&k(Ae)),a===p&&(96===c.charCodeAt(m)?(a=vc,m++):(a=p,0===w&&k(wc))));return a}function ja(){var a=ma();a===p&&(a=Fa(),a===p&&(a=xa()));return a}function Fa(){var a=m;if(36===c.charCodeAt(m)){var b=ze;m++}else b=p,0===w&&k(Ae);b!==p?(b=Sa(),b===p&&(63===c.charCodeAt(m)?(b=xe,m++):(b=p,0===w&&k(ye))),b!== p?(F=a,a=b={type:"variable",name:b}):(m=a,a=u)):(m=a,a=u);return a}function Sa(){var a=m;var b=[];if(gh.test(c.charAt(m))){var d=c.charAt(m);m++}else d=p,0===w&&k(hh);if(d!==p)for(;d!==p;)b.push(d),gh.test(c.charAt(m))?(d=c.charAt(m),m++):(d=p,0===w&&k(hh));else b=u;b!==p&&(F=a,b=c.substring(F,m));return b}function xa(){var a=m;if(c.substr(m,2)===ed){var b=ed;m+=2}else b=p,0===w&&k(ih);if(b!==p){b=[];if(jh.test(c.charAt(m))){var d=c.charAt(m);m++}else d=p,0===w&&k(kh);for(;d!==p;)b.push(d),jh.test(c.charAt(m))? (d=c.charAt(m),m++):(d=p,0===w&&k(kh));b!==p?(125===c.charCodeAt(m)?(d=bh,m++):(d=p,0===w&&k(ch)),d!==p?(F=a,a=b={type:"variableSubstitution",expression:b.join("")}):(m=a,a=u)):(m=a,a=u)}else m=a,a=u;return a}function ma(){var b=m;if(c.substr(m,2)===fd){var d=fd;m+=2}else d=p,0===w&&k(lh);if(d!==p)if(d=q(),d!==p){if(41===c.charCodeAt(m)){var e=Wg;m++}else e=p,0===w&&k(Xg);e!==p?(F=b,b=d={type:"commandSubstitution",commands:d}):(m=b,b=u)}else m=b,b=u;else m=b,b=u;if(b===p)if(b=m,96===c.charCodeAt(m)? (d=vc,m++):(d=p,0===w&&k(wc)),d!==p){d=[];e=P();if(e!==p)for(;e!==p;)d.push(e),e=P();else d=u;d!==p?(96===c.charCodeAt(m)?(e=vc,m++):(e=p,0===w&&k(wc)),e!==p?(F=b,b=d={type:"commandSubstitution",commands:a(d.join(""))}):(m=b,b=u)):(m=b,b=u)}else m=b,b=u;return b}function P(){var a=m;if(c.substr(m,2)===mh){var b=mh;m+=2}else b=p,0===w&&k(gk);b!==p&&(F=a,b="`");a=b;if(a===p&&(a=m,c.substr(m,2)===dd?(b=dd,m+=2):(b=p,0===w&&k(fh)),b!==p&&(F=a,b="\\"),a=b,a===p)){b=a=m;w++;if(96===c.charCodeAt(m)){var d= vc;m++}else d=p,0===w&&k(wc);w--;d===p?b=Ha:(m=b,b=u);b!==p?(c.length>m?(d=c.charAt(m),m++):(d=p,0===w&&k(Za)),d!==p?(F=a,a=d):(m=a,a=u)):(m=a,a=u)}return a}function ya(){var a=m;var b=ua();b===p&&(b=Ga);if(b!==p){if(c.substr(m,2)===gd){var d=gd;m+=2}else d=p,0===w&&k(nh);d===p&&(c.substr(m,2)===hd?(d=hd,m+=2):(d=p,0===w&&k(oh)));if(d!==p){var e=ua();if(e!==p){if(45===c.charCodeAt(m)){var f=$c;m++}else f=p,0===w&&k(ad);f!==p?(F=a,a=b,null==a&&(a="<"==d[0]?0:1),a=b={type:"moveFd",fd:a,op:d,dest:e}): (m=a,a=u)}else m=a,a=u}else m=a,a=u}else m=a,a=u;d=a;if(d===p){a=m;b=ua();b===p&&(b=Ga);if(b!==p)if(c.substr(m,2)===gd?(d=gd,m+=2):(d=p,0===w&&k(nh)),d===p&&(c.substr(m,2)===hd?(d=hd,m+=2):(d=p,0===w&&k(oh))),d!==p){f=[];for(e=J();e!==p;)f.push(e),e=J();f!==p?(e=ua(),e!==p?(F=a,a=b,null==a&&(a="<"==d[0]?0:1),a=b={type:"duplicateFd",srcFd:a,op:d,destFd:e}):(m=a,a=u)):(m=a,a=u)}else m=a,a=u;else m=a,a=u;d=a;if(d===p)if(d=m,e=ua(),e===p&&(e=Ga),e!==p)if(60===c.charCodeAt(m)?(a=hk,m++):(a=p,0===w&&k(ik)), a===p&&(62===c.charCodeAt(m)?(a=jk,m++):(a=p,0===w&&k(kk)),a===p&&(c.substr(m,2)===ph?(a=ph,m+=2):(a=p,0===w&&k(lk)),a===p&&(c.substr(m,2)===qh?(a=qh,m+=2):(a=p,0===w&&k(mk)),a===p&&(c.substr(m,2)===rh?(a=rh,m+=2):(a=p,0===w&&k(nk)),a===p&&(c.substr(m,3)===sh?(a=sh,m+=3):(a=p,0===w&&k(ok))))))),a!==p){f=[];for(b=J();b!==p;)f.push(b),b=J();f!==p?(b=M(),b!==p?(F=d,d=e,null==d&&(d="<"==a[0]?0:1),d=e={type:"redirectFd",fd:d,op:a,filename:b}):(m=d,d=u)):(m=d,d=u)}else m=d,d=u;else m=d,d=u}return d}function ua(){var a= m;var b=[];if(th.test(c.charAt(m))){var d=c.charAt(m);m++}else d=p,0===w&&k(uh);if(d!==p)for(;d!==p;)b.push(d),th.test(c.charAt(m))?(d=c.charAt(m),m++):(d=p,0===w&&k(uh));else b=u;b!==p&&(F=a,b=parseInt(b.join(""),10));return b}function J(){if(32===c.charCodeAt(m)){var a=pk;m++}else a=p,0===w&&k(qk);a===p&&(9===c.charCodeAt(m)?(a=rk,m++):(a=p,0===w&&k(sk)));return a}function G(){var a=J();a===p&&(10===c.charCodeAt(m)?(a=qc,m++):(a=p,0===w&&k(rc)));return a}function da(){var a=m;if(c.substr(m,5)=== Sb){var b=Sb;m+=5}else b=p,0===w&&k(Rc);b===p&&(c.substr(m,5)===Ub?(b=Ub,m+=5):(b=p,0===w&&k(sc)),b===p&&(c.substr(m,3)===vh?(b=vh,m+=3):(b=p,0===w&&k(tk)),b===p&&(c.substr(m,4)===Pc?(b=Pc,m+=4):(b=p,0===w&&k(gb)),b===p&&(c.substr(m,2)===Z?(b=Z,m+=2):(b=p,0===w&&k(tc)),b===p&&(c.substr(m,4)===wh?(b=wh,m+=4):(b=p,0===w&&k(uk)),b===p&&(c.substr(m,4)===xh?(b=xh,m+=4):(b=p,0===w&&k(vk)),b===p&&(c.substr(m,2)===Xa?(b=Xa,m+=2):(b=p,0===w&&k(hb)),b===p&&(c.substr(m,4)===Tb?(b=Tb,m+=4):(b=p,0===w&&k(Ya)), b===p&&(c.substr(m,4)===ib?(b=ib,m+=4):(b=p,0===w&&k(xg)),b===p&&(c.substr(m,4)===Uc?(b=Uc,m+=4):(b=p,0===w&&k(yg)),b===p&&(c.substr(m,2)===Sc?(b=Sc,m+=2):(b=p,0===w&&k(Tc)),b===p&&(c.substr(m,2)===Vc?(b=Vc,m+=2):(b=p,0===w&&k(Bg))))))))))))));if(b!==p){var d=[];var e=G();if(e!==p)for(;e!==p;)d.push(e),e=G();else d=u;d===p&&(d=m,w++,c.length>m?(e=c.charAt(m),m++):(e=p,0===w&&k(Za)),w--,e===p?d=Ha:(m=d,d=u));d!==p?a=b=[b,d]:(m=a,a=u)}else m=a,a=u;return a}function Hb(a){return{type:"literal",value:Tg(a)? a.join(""):a}}function Ed(a){return a[0]}function Fd(a){return a[1]}function ia(a){for(var b=[a[0]],c=a.length,d=a[0],e,f=1;fm){var e=c.charAt(m); m++}else e=p,0===w&&k(Za);for(;e!==p;)d.push(e),c.length>m?(e=c.charAt(m),m++):(e=p,0===w&&k(Za));d!==p?a=b=[b,d]:(m=a,a=u)}else m=a,a=u;return a}},Ia=r,u=p,Dc={type:"other",description:"a list of statements"},Ga=null,dc="&&",Bc={type:"literal",value:"&&",description:'"&&"'},ec="||",Ac={type:"literal",value:"||",description:'"||"'},Gd="&",Cc={type:"literal",value:"&",description:'"&"'},Hd=";",Qc={type:"literal",value:";",description:'";"'},qc="\n",rc={type:"literal",value:"\n",description:'"\\n"'}, ne={type:"other",description:"a single command"},Sb="while",Rc={type:"literal",value:"while",description:'"while"'},Ub="until",sc={type:"literal",value:"until",description:'"until"'},Z="do",tc={type:"literal",value:"do",description:'"do"'},Pc="done",gb={type:"literal",value:"done",description:'"done"'},Xa="if",hb={type:"literal",value:"if",description:'"if"'},Tb="then",Ya={type:"literal",value:"then",description:'"then"'},ib="else",xg={type:"literal",value:"else",description:'"else"'},Sc="fi",Tc= {type:"literal",value:"fi",description:'"fi"'},Uc="elif",yg={type:"literal",value:"elif",description:'"elif"'},Cj="=",Dj={type:"literal",value:"=",description:'"="'},Ej={type:"other",description:"command name"},Ha=void 0,zg="[",Ag={type:"literal",value:"[",description:'"["'},Vc="[[",Bg={type:"literal",value:"[[",description:'"[["'},oe={type:"other",description:"command argument"},Yg="\\",Zg={type:"literal",value:"\\",description:'"\\\\"'},Za={type:"any",description:"any character"},ak=/^[$"';&<>\n()[*?|` ]/, bk={type:"class",value:"[$\"';&<>\\n()[*?|` ]",description:"[$\"';&<>\\n()[*?|` ]"},$g="*",ah={type:"literal",value:"*",description:'"*"'},xe="?",ye={type:"literal",value:"?",description:'"?"'},$c="-",ad={type:"literal",value:"-",description:'"-"'},ck="]",dk={type:"literal",value:"]",description:'"]"'},ze="$",Ae={type:"literal",value:"$",description:'"$"'},ek="{",fk={type:"literal",value:"{",description:'"{"'},bh="}",ch={type:"literal",value:"}",description:'"}"'},Be="'",Ce={type:"literal",value:"'", description:'"\'"'},dh=/^[^']/,eh={type:"class",value:"[^']",description:"[^']"},bd='"',cd={type:"literal",value:'"',description:'"\\""'},dd="\\\\",fh={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},vc="`",wc={type:"literal",value:"`",description:'"`"'},gh=/^[a-zA-Z0-9_]/,hh={type:"class",value:"[a-zA-Z0-9_]",description:"[a-zA-Z0-9_]"},ed="${",ih={type:"literal",value:"${",description:'"${"'},jh=/^[^}]/,kh={type:"class",value:"[^}]",description:"[^}]"},fd="$(",lh={type:"literal",value:"$(", description:'"$("'},Wg=")",Xg={type:"literal",value:")",description:'")"'},mh="\\`",gk={type:"literal",value:"\\`",description:'"\\\\`"'},Yj=/^[<>]/,Zj={type:"class",value:"[<>]",description:"[<>]"},Ug="(",Vg={type:"literal",value:"(",description:'"("'},Wj="|",Xj={type:"literal",value:"|",description:'"|"'},gd="<&",nh={type:"literal",value:"<&",description:'"<&"'},hd=">&",oh={type:"literal",value:">&",description:'">&"'},hk="<",ik={type:"literal",value:"<",description:'"<"'},jk=">",kk={type:"literal", value:">",description:'">"'},ph=">|",lk={type:"literal",value:">|",description:'">|"'},qh="&>",mk={type:"literal",value:"&>",description:'"&>"'},rh=">>",nk={type:"literal",value:">>",description:'">>"'},sh="&>>",ok={type:"literal",value:"&>>",description:'"&>>"'},th=/^[0-9]/,uh={type:"class",value:"[0-9]",description:"[0-9]"},pk=" ",qk={type:"literal",value:" ",description:'" "'},rk="\t",sk={type:"literal",value:"\t",description:'"\\t"'},vh="for",tk={type:"literal",value:"for",description:'"for"'}, wh="case",uk={type:"literal",value:"case",description:'"case"'},xh="esac",vk={type:"literal",value:"esac",description:'"esac"'},m=0,F=0,uc=0,ve={line:1,column:1,seenCR:!1},Zc=0,we=[],w=0;if("startRule"in qb){if(!(qb.startRule in za))throw Error("Can't start parsing from rule \""+qb.startRule+'".');Ia=za[qb.startRule]}var Tg=Jh,Yc=Kh;var De=Ia();if(De!==p&&m===c.length)return De;De!==p&&mb.description?1:0});b=b.length&&(b=void 0);return{value:b&&b[c++],done:!b}}}} function Uh(b,a){var c="function"===typeof Symbol&&b[Symbol.iterator];if(!c)return b;b=c.call(b);var d,e=[];try{for(;(void 0===a||0b;++b)Zh[b]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[b],$h["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(b)]=b;$h[45]=62;$h[95]=63} function di(b,a,c){for(var d=[],e=a;e>18&63]+Zh[a>>12&63]+Zh[a>>6&63]+Zh[a&63]);return d.join("")}function ei(b){bi||ci();for(var a=b.length,c=a%3,d="",e=[],g=0,f=a-c;gf?f:g+16383));1===c?(b=b[a-1],d+=Zh[b>>2],d+=Zh[b<<4&63],d+="=="):2===c&&(b=(b[a-2]<<8)+b[a-1],d+=Zh[b>>10],d+=Zh[b>>4&63],d+=Zh[b<<2&63],d+="=");e.push(d);return e.join("")} function fi(b,a,c,d,e){var g=8*e-d-1,f=(1<>1,k=-7;e=c?e-1:0;var r=c?-1:1,q=b[a+e];e+=r;c=q&(1<<-k)-1;q>>=-k;for(k+=g;0>=-k;for(k+=d;0>1,q=23===e?Math.pow(2,-24)-Math.pow(2,-77):0;g=d?0:g-1;var t=d?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,d=k):(d=Math.floor(Math.log(a)/Math.LN2),1>a*(f=Math.pow(2,-d))&&(d--,f*=2),a=1<=d+r?a+q/f:a+q*Math.pow(2,1-r),2<=a*f&&(d++,f/=2),d+r>=k?(a=0,d=k):1<=d+r?(a=(a*f-1)*Math.pow(2,e),d+=r):(a=a*Math.pow(2,r-1)*Math.pow(2,e),d=0));8<=e;b[c+g]=a&255,g+=t,a/=256,e-=8);d=d<c||a.byteLengthb)throw new RangeError('"size" argument must not be negative');}T.alloc=function(b,a,c){qi(b);return b=0>=b?ki(null,b):void 0!==a?"string"===typeof c?ki(null,b).fill(a,c):ki(null,b).fill(a):ki(null,b)};function li(b,a){qi(a);b=ki(b,0>a?0:ri(a)|0);if(!T.TYPED_ARRAY_SUPPORT)for(var c=0;ca.length?0:ri(a.length)|0;b=ki(b,c);for(var d=0;d=(T.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(T.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return b|0}T.isBuffer=ti;function si(b){return!(null==b||!b._isBuffer)} T.compare=function(b,a){if(!si(b)||!si(a))throw new TypeError("Arguments must be Buffers");if(b===a)return 0;for(var c=b.length,d=a.length,e=0,g=Math.min(c,d);e>>1;case "base64":return vi(b).length; default:if(d)return ui(b).length;a=(""+a).toLowerCase();d=!0}}T.byteLength=oi; function wi(b,a,c){var d=!1;if(void 0===a||0>a)a=0;if(a>this.length)return"";if(void 0===c||c>this.length)c=this.length;if(0>=c)return"";c>>>=0;a>>>=0;if(c<=a)return"";for(b||(b="utf8");;)switch(b){case "hex":b=a;a=c;c=this.length;if(!b||0>b)b=0;if(!a||0>a||a>c)a=c;d="";for(c=b;cd?"0"+d.toString(16):d.toString(16),d=b+d;return d;case "utf8":case "utf-8":return xi(this,a,c);case "ascii":b="";for(c=Math.min(this.length,c);a"}; T.prototype.compare=function(b,a,c,d,e){if(!si(b))throw new TypeError("Argument must be a Buffer");void 0===a&&(a=0);void 0===c&&(c=b?b.length:0);void 0===d&&(d=0);void 0===e&&(e=this.length);if(0>a||c>b.length||0>d||e>this.length)throw new RangeError("out of range index");if(d>=e&&a>=c)return 0;if(d>=e)return-1;if(a>=c)return 1;a>>>=0;c>>>=0;d>>>=0;e>>>=0;if(this===b)return 0;var g=e-d,f=c-a,h=Math.min(g,f);d=this.slice(d,e);b=b.slice(a,c);for(a=0;ac&&(c=-2147483648);c=+c;isNaN(c)&&(c=e?0:b.length-1);0>c&&(c=b.length+c);if(c>=b.length){if(e)return-1;c=b.length-1}else if(0>c)if(e)c=0;else return-1;"string"===typeof a&&(a=T.from(a,d));if(si(a))return 0===a.length?-1:Ai(b,a,c,d,e);if("number"===typeof a)return a&=255,T.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(b,a,c): Uint8Array.prototype.lastIndexOf.call(b,a,c):Ai(b,[a],c,d,e);throw new TypeError("val must be string, number or Buffer");} function Ai(b,a,c,d,e){function g(a,b){return 1===f?a[b]:a.readUInt16BE(b*f)}var f=1,h=b.length,k=a.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(2>b.length||2>a.length)return-1;f=2;h/=2;k/=2;c/=2}if(e)for(d=-1;ch&&(c=h-k);0<=c;c--){h=!0;for(d=0;de)c=e;if(0c||0>a)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");for(e=!1;;)switch(d){case "hex":a:{a= Number(a)||0;d=this.length-a;c?(c=Number(c),c>d&&(c=d)):c=d;d=b.length;if(0!==d%2)throw new TypeError("Invalid hex string");c>d/2&&(c=d/2);for(d=0;d(e-=2));++f){var h=d.charCodeAt(f);b=h>>8;h%=256;g.push(h);g.push(b)}return Bi(g,this,a,c);default:if(e)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase();e=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}}; function xi(b,a,c){c=Math.min(b.length,c);for(var d=[];ae&&(g=e);break;case 2:var h=b[a+1];128===(h&192)&&(e=(e&31)<<6|h&63,127e||57343e&&(g= e))}null===g?(g=65533,f=1):65535>>10&1023|55296),g=56320|g&1023);d.push(g);a+=f}b=d.length;if(b<=Di)d=String.fromCharCode.apply(String,d);else{c="";for(a=0;ab?(b+=c,0>b&&(b=0)):b>c&&(b=c);0>a?(a+=c,0>a&&(a=0)):a>c&&(a=c);ab)throw new RangeError("offset is not uint");if(b+a>c)throw new RangeError("Trying to access beyond buffer length");} T.prototype.readUIntLE=function(b,a,c){b|=0;a|=0;c||Ei(b,a,this.length);c=this[b];for(var d=1,e=0;++e=128*d&&(c-=Math.pow(2,8*a));return c};T.prototype.readIntBE=function(b,a,c){b|=0;a|=0;c||Ei(b,a,this.length);c=a;for(var d=1,e=this[b+--c];0=128*d&&(e-=Math.pow(2,8*a));return e};T.prototype.readInt8=function(b,a){a||Ei(b,1,this.length);return this[b]&128?-1*(255-this[b]+1):this[b]}; T.prototype.readInt16LE=function(b,a){a||Ei(b,2,this.length);b=this[b]|this[b+1]<<8;return b&32768?b|4294901760:b};T.prototype.readInt16BE=function(b,a){a||Ei(b,2,this.length);b=this[b+1]|this[b]<<8;return b&32768?b|4294901760:b};T.prototype.readInt32LE=function(b,a){a||Ei(b,4,this.length);return this[b]|this[b+1]<<8|this[b+2]<<16|this[b+3]<<24};T.prototype.readInt32BE=function(b,a){a||Ei(b,4,this.length);return this[b]<<24|this[b+1]<<16|this[b+2]<<8|this[b+3]}; T.prototype.readFloatLE=function(b,a){a||Ei(b,4,this.length);return fi(this,b,!0,23,4)};T.prototype.readFloatBE=function(b,a){a||Ei(b,4,this.length);return fi(this,b,!1,23,4)};T.prototype.readDoubleLE=function(b,a){a||Ei(b,8,this.length);return fi(this,b,!0,52,8)};T.prototype.readDoubleBE=function(b,a){a||Ei(b,8,this.length);return fi(this,b,!1,52,8)}; function Fi(b,a,c,d,e,g){if(!si(b))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>e||ab.length)throw new RangeError("Index out of range");}T.prototype.writeUIntLE=function(b,a,c,d){b=+b;a|=0;c|=0;d||Fi(this,b,a,c,Math.pow(2,8*c)-1,0);d=1;var e=0;for(this[a]=b&255;++ea&&(a=65535+a+1);for(var e=0,g=Math.min(b.length-c,2);e>>8*(d?e:1-e)} T.prototype.writeUInt16LE=function(b,a,c){b=+b;a|=0;c||Fi(this,b,a,2,65535,0);T.TYPED_ARRAY_SUPPORT?(this[a]=b&255,this[a+1]=b>>>8):Gi(this,b,a,!0);return a+2};T.prototype.writeUInt16BE=function(b,a,c){b=+b;a|=0;c||Fi(this,b,a,2,65535,0);T.TYPED_ARRAY_SUPPORT?(this[a]=b>>>8,this[a+1]=b&255):Gi(this,b,a,!1);return a+2};function Hi(b,a,c,d){0>a&&(a=4294967295+a+1);for(var e=0,g=Math.min(b.length-c,4);e>>8*(d?e:3-e)&255} T.prototype.writeUInt32LE=function(b,a,c){b=+b;a|=0;c||Fi(this,b,a,4,4294967295,0);T.TYPED_ARRAY_SUPPORT?(this[a+3]=b>>>24,this[a+2]=b>>>16,this[a+1]=b>>>8,this[a]=b&255):Hi(this,b,a,!0);return a+4};T.prototype.writeUInt32BE=function(b,a,c){b=+b;a|=0;c||Fi(this,b,a,4,4294967295,0);T.TYPED_ARRAY_SUPPORT?(this[a]=b>>>24,this[a+1]=b>>>16,this[a+2]=b>>>8,this[a+3]=b&255):Hi(this,b,a,!1);return a+4}; T.prototype.writeIntLE=function(b,a,c,d){b=+b;a|=0;d||(d=Math.pow(2,8*c-1),Fi(this,b,a,c,d-1,-d));d=0;var e=1,g=0;for(this[a]=b&255;++db&&0===g&&0!==this[a+d-1]&&(g=1),this[a+d]=(b/e>>0)-g&255;return a+c};T.prototype.writeIntBE=function(b,a,c,d){b=+b;a|=0;d||(d=Math.pow(2,8*c-1),Fi(this,b,a,c,d-1,-d));d=c-1;var e=1,g=0;for(this[a+d]=b&255;0<=--d&&(e*=256);)0>b&&0===g&&0!==this[a+d+1]&&(g=1),this[a+d]=(b/e>>0)-g&255;return a+c}; T.prototype.writeInt8=function(b,a,c){b=+b;a|=0;c||Fi(this,b,a,1,127,-128);T.TYPED_ARRAY_SUPPORT||(b=Math.floor(b));0>b&&(b=255+b+1);this[a]=b&255;return a+1};T.prototype.writeInt16LE=function(b,a,c){b=+b;a|=0;c||Fi(this,b,a,2,32767,-32768);T.TYPED_ARRAY_SUPPORT?(this[a]=b&255,this[a+1]=b>>>8):Gi(this,b,a,!0);return a+2};T.prototype.writeInt16BE=function(b,a,c){b=+b;a|=0;c||Fi(this,b,a,2,32767,-32768);T.TYPED_ARRAY_SUPPORT?(this[a]=b>>>8,this[a+1]=b&255):Gi(this,b,a,!1);return a+2}; T.prototype.writeInt32LE=function(b,a,c){b=+b;a|=0;c||Fi(this,b,a,4,2147483647,-2147483648);T.TYPED_ARRAY_SUPPORT?(this[a]=b&255,this[a+1]=b>>>8,this[a+2]=b>>>16,this[a+3]=b>>>24):Hi(this,b,a,!0);return a+4};T.prototype.writeInt32BE=function(b,a,c){b=+b;a|=0;c||Fi(this,b,a,4,2147483647,-2147483648);0>b&&(b=4294967295+b+1);T.TYPED_ARRAY_SUPPORT?(this[a]=b>>>24,this[a+1]=b>>>16,this[a+2]=b>>>8,this[a+3]=b&255):Hi(this,b,a,!1);return a+4}; function Ii(b,a,c,d){if(c+d>b.length)throw new RangeError("Index out of range");if(0>c)throw new RangeError("Index out of range");}T.prototype.writeFloatLE=function(b,a,c){c||Ii(this,b,a,4);gi(this,b,a,!0,23,4);return a+4};T.prototype.writeFloatBE=function(b,a,c){c||Ii(this,b,a,4);gi(this,b,a,!1,23,4);return a+4};T.prototype.writeDoubleLE=function(b,a,c){c||Ii(this,b,a,8);gi(this,b,a,!0,52,8);return a+8};T.prototype.writeDoubleBE=function(b,a,c){c||Ii(this,b,a,8);gi(this,b,a,!1,52,8);return a+8}; T.prototype.copy=function(b,a,c,d){c||(c=0);d||0===d||(d=this.length);a>=b.length&&(a=b.length);a||(a=0);0a)throw new RangeError("targetStart out of bounds");if(0>c||c>=this.length)throw new RangeError("sourceStart out of bounds");if(0>d)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length);b.length-ae|| !T.TYPED_ARRAY_SUPPORT)for(d=0;de&&(b=e)}if(void 0!==d&&"string"!==typeof d)throw new TypeError("encoding must be a string");if("string"===typeof d&&!T.isEncoding(d))throw new TypeError("Unknown encoding: "+d);}else"number"===typeof b&&(b&=255);if(0>a||this.length>>= 0;c=void 0===c?this.length:c>>>0;b||(b=0);if("number"===typeof b)for(d=a;dc){if(!e){if(56319c){-1<(a-=3)&&g.push(239,191,189);e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&-1<(a-=3)&&g.push(239,191,189);e=null;if(128>c){if(0>--a)break;g.push(c)}else if(2048>c){if(0>(a-=2))break;g.push(c>>6|192,c&63|128)}else if(65536>c){if(0>(a-=3))break; g.push(c>>12|224,c>>6&63|128,c&63|128)}else if(1114112>c){if(0>(a-=4))break;g.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw Error("Invalid code point");}return g}function Ci(b){for(var a=[],c=0;cb.length)b="";else for(;0!==b.length%4;)b+="=";bi||ci();var a=b.length;if(0>16&255;d[g++]=f>>8&255;d[g++]=f&255}2===c?(f=$h[b.charCodeAt(a)]<<2|$h[b.charCodeAt(a+ 1)]>>4,d[g++]=f&255):1===c&&(f=$h[b.charCodeAt(a)]<<10|$h[b.charCodeAt(a+1)]<<4|$h[b.charCodeAt(a+2)]>>2,d[g++]=f>>8&255,d[g++]=f&255);return d}function Bi(b,a,c,d){for(var e=0;e=a.length||e>=b.length);++e)a[e+c]=b[e];return e}function ti(b){return null!=b&&(!!b._isBuffer||Ki(b)||"function"===typeof b.readFloatLE&&"function"===typeof b.slice&&Ki(b.slice(0,0)))}function Ki(b){return!!b.constructor&&"function"===typeof b.constructor.isBuffer&&b.constructor.isBuffer(b)} var Li=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:ji,Buffer:T,SlowBuffer:function(b){+b!=b&&(b=0);return T.alloc(+b)},isBuffer:ti}),U=T,Mi="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof pa?pa:"undefined"!==typeof self?self:{};function Ni(b,a){return a={exports:{}},b(a,a.exports),a.exports}function Oi(){throw Error("setTimeout has not been defined");}function Pi(){throw Error("clearTimeout has not been defined");}var Qi=Oi,Ri=Pi; "function"===typeof Yh.setTimeout&&(Qi=setTimeout);"function"===typeof Yh.clearTimeout&&(Ri=clearTimeout);function Si(b){if(Qi===setTimeout)return setTimeout(b,0);if((Qi===Oi||!Qi)&&setTimeout)return Qi=setTimeout,setTimeout(b,0);try{return Qi(b,0)}catch(a){try{return Qi.call(null,b,0)}catch(c){return Qi.call(this,b,0)}}} function Ti(b){if(Ri===clearTimeout)return clearTimeout(b);if((Ri===Pi||!Ri)&&clearTimeout)return Ri=clearTimeout,clearTimeout(b);try{return Ri(b)}catch(a){try{return Ri.call(null,b)}catch(c){return Ri.call(this,b)}}}var Ui=[],Vi=!1,Wi,Xi=-1;function Yi(){Vi&&Wi&&(Vi=!1,Wi.length?Ui=Wi.concat(Ui):Xi=-1,Ui.length&&Zi())}function Zi(){if(!Vi){var b=Si(Yi);Vi=!0;for(var a=Ui.length;a;){Wi=Ui;for(Ui=[];++Xia&&(c--,a+=1E9));return[c,a]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-ej)/1E3}},gj=Ni(function(b,a){function c(a,b){for(var c in a)b[c]=a[c]}function d(a,b,c){return e(a,b,c)}var e=Li.Buffer;e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?b.exports=Li:(c(Li,a),a.Buffer=d);d.prototype=Object.create(e.prototype);c(e,d);d.from=function(a,b,c){if("number"===typeof a)throw new TypeError("Argument must not be a number"); return e(a,b,c)};d.alloc=function(a,b,c){if("number"!==typeof a)throw new TypeError("Argument must be a number");a=e(a);void 0!==b?"string"===typeof c?a.fill(b,c):a.fill(b):a.fill(0);return a};d.allocUnsafe=function(a){if("number"!==typeof a)throw new TypeError("Argument must be a number");return e(a)};d.allocUnsafeSlow=function(a){if("number"!==typeof a)throw new TypeError("Argument must be a number");return Li.SlowBuffer(a)}}),hj=Ni(function(b,a){function c(){throw Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11"); }function d(a,b){if("number"!==typeof a||a!==a)throw new TypeError("offset must be a number");if(a>t||0>a)throw new TypeError("offset must be a uint32");if(a>r||a>b)throw new RangeError("offset out of range");}function e(a,b,c){if("number"!==typeof a||a!==a)throw new TypeError("size must be a number");if(a>t||0>a)throw new TypeError("size must be a uint32");if(a+b>c||a>r)throw new RangeError("buffer too small");}function g(a,b,c,g){if(!(k.isBuffer(a)||a instanceof Mi.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); if("function"===typeof b)g=b,b=0,c=a.length;else if("function"===typeof c)g=c,c=a.length-b;else if("function"!==typeof g)throw new TypeError('"cb" argument must be a function');d(b,a.length);e(c,b,a.length);return f(a,b,c,g)}function f(a,b,c,d){b=new Uint8Array(a.buffer,b,c);q.getRandomValues(b);if(d)$i(function(){d(null,a)});else return a}function h(a,b,c){"undefined"===typeof b&&(b=0);if(!(k.isBuffer(a)||a instanceof Mi.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); d(b,a.length);void 0===c&&(c=a.length-b);e(c,b,a.length);return f(a,b,c)}var k=gj.Buffer,r=gj.kMaxLength,q=Mi.crypto||Mi.msCrypto,t=Math.pow(2,32)-1;q&&q.getRandomValues?(a.randomFill=g,a.randomFillSync=h):(a.randomFill=c,a.randomFillSync=c)}),ij=Ni(function(b){b.exports=hj}).randomFillSync,jj=Math.floor(.001*(Date.now()-performance.now()));function kj(b){if("string"!==typeof b)throw new TypeError("Path must be a string. Received "+JSON.stringify(b));} function lj(b,a){for(var c="",d=0,e=-1,g=0,f,h=0;h<=b.length;++h){if(hc.length||2!==d||46!==c.charCodeAt(c.length-1)||46!==c.charCodeAt(c.length-2))if(2h){if(47=== a.charCodeAt(g+r))return a.slice(g+r+1);if(0===r)return a.slice(g+r)}else e>h&&(47===b.charCodeAt(c+r)?k=r:0===r&&(k=0));break}var q=b.charCodeAt(c+r),t=a.charCodeAt(g+r);if(q!==t)break;else 47===q&&(k=r)}e="";for(r=c+k+1;r<=d;++r)if(r===d||47===b.charCodeAt(r))e=0===e.length?e+"..":e+"/..";if(0=e;--r)if(c=b.charCodeAt(r),47===c){if(!k){f=r+1;break}}else-1===h&&(k=!1,h=r+1),46=== c?-1===g?g=r:1!==q&&(q=1):-1!==g&&(q=-1);-1===g||-1===h||0===q||1===q&&g===h-1&&g===f+1?-1!==h&&(a.base=0===f&&d?a.name=b.slice(1,h):a.name=b.slice(f,h)):(0===f&&d?(a.name=b.slice(1,g),a.base=b.slice(1,h)):(a.name=b.slice(f,g),a.base=b.slice(f,h)),a.ext=b.slice(g,h));0a&&(c--,a+=1E9));return[c,a]}),exit:function(b){throw new pj(b);},kill:function(b){throw new qj(b);},randomFillSync:ij,isTTY:function(){return!0},path:oj,fs:null},W,sj=S(1),tj=S(2),uj=S(4),vj=S(8),wj=S(16),xj=S(32),yj=S(64),zj=S(128),Aj=S(256),Bj=S(512),Fj=S(1024),Gj=S(2048),Hj=S(4096),Ij=S(8192),Jj=S(16384),Kj=S(32768),Lj=S(65536),Mj=S(131072),Nj=S(262144),Oj=S(524288),Pj=S(1048576), Qj=S(2097152),Rj=S(4194304),Sj=S(8388608),Tj=S(16777216),Uj=S(33554432),Vj=S(67108864),wk=S(134217728),xk=S(268435456),yk=sj|tj|uj|vj|wj|xj|yj|zj|Aj|Bj|Fj|Gj|Hj|Ij|Jj|Kj|Lj|Mj|Nj|Oj|Pj|Qj|Sj|Rj|Tj|Vj|Uj|wk|xk,zk=sj|tj|uj|vj|wj|xj|yj|zj|Aj|Qj|Rj|Sj|wk,Ak=S(0),Bk=vj|wj|zj|Bj|Fj|Gj|Hj|Ij|Jj|Kj|Lj|Mj|Nj|Oj|Pj|Qj|Sj|Tj|Vj|Uj|wk,Ck=Bk|zk,Dk=tj|vj|yj|Qj|wk|xk,Ek=tj|vj|yj|Qj|wk,Fk=S(0),Gk={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},Hk=(W={},W[6]="SIGHUP",W[8]="SIGINT",W[11]="SIGQUIT",W[7]="SIGILL",W[15]="SIGTRAP",W[0]="SIGABRT",W[2]="SIGBUS",W[5]="SIGFPE",W[9]="SIGKILL",W[20]="SIGUSR1",W[12]="SIGSEGV",W[21]="SIGUSR2",W[10]="SIGPIPE",W[1]="SIGALRM",W[14]="SIGTERM",W[3]="SIGCHLD",W[4]="SIGCONT",W[13]= "SIGSTOP",W[16]="SIGTSTP",W[17]="SIGTTIN",W[18]="SIGTTOU",W[19]="SIGURG",W[23]="SIGXCPU",W[24]="SIGXFSZ",W[22]="SIGVTALRM",W),Ik=sj|tj|wj|zj|Qj|wk,Jk=sj|yj|wj|zj|Qj|wk;function Kk(b){var a=Math.trunc(b);b=S(Math.round(1E6*(b-a)));return S(a)*S(1E6)+b}function Lk(b){"number"===typeof b&&(b=Math.trunc(b));b=S(b);return Number(b/S(1E6))} function Y(b){return function(){for(var a=[],c=0;ca.rights.base||(a.rights.inheriting|c)>a.rights.inheriting)return 63;a.rights.base= b;a.rights.inheriting=c;return 0}),fd_filestat_get:Y(function(a,b){a=d(a,Qj);var c=t.fstatSync(a.real);f.refreshMemory();f.view.setBigUint64(b,S(c.dev),!0);b+=8;f.view.setBigUint64(b,S(c.ino),!0);b+=8;f.view.setUint8(b,a.filetype);b+=8;f.view.setBigUint64(b,S(c.nlink),!0);b+=8;f.view.setBigUint64(b,S(c.size),!0);b+=8;f.view.setBigUint64(b,Kk(c.atimeMs),!0);b+=8;f.view.setBigUint64(b,Kk(c.mtimeMs),!0);f.view.setBigUint64(b+8,Kk(c.ctimeMs),!0);return 0}),fd_filestat_set_size:Y(function(a,b){a=d(a,Rj); t.ftruncateSync(a.real,Number(b));return 0}),fd_filestat_set_times:Y(function(a,c,e,f){a=d(a,Sj);var g=t.fstatSync(a.real),h=g.atime;g=g.mtime;var k=Lk(b(0));if(3===(f&3)||12===(f&12))return 28;1===(f&1)?h=Lk(c):2===(f&2)&&(h=k);4===(f&4)?g=Lk(e):8===(f&8)&&(g=k);t.futimesSync(a.real,new Date(h),new Date(g));return 0}),fd_prestat_get:Y(function(a,b){a=d(a,S(0));if(!a.path)return 28;f.refreshMemory();f.view.setUint8(b,0);f.view.setUint32(b+4,U.byteLength(a.fakePath),!0);return 0}),fd_prestat_dir_name:Y(function(a, b,c){a=d(a,S(0));if(!a.path)return 28;f.refreshMemory();U.from(f.memory.buffer).write(a.fakePath,b,c,"utf8");return 0}),fd_pwrite:Y(function(a,b,c,g,h){var k=d(a,yj|uj),l=0;e(b,c).forEach(function(a){for(var b=0;bc)break;f.view.setBigUint64(b,S(e+1),!0);b+=8;if(b-k>c)break;var q=t.statSync(v.resolve(a.path,l.name));f.view.setBigUint64(b,S(q.ino),!0);b+=8;if(b-k>c)break;f.view.setUint32(b,n,!0);b+=4;if(b-k>c)break;switch(!0){case q.isBlockDevice():q=1;break;case q.isCharacterDevice():q=2;break;case q.isDirectory():q=3;break;case q.isFIFO():q=6;break;case q.isFile():q=4;break;case q.isSocket():q= 6;break;case q.isSymbolicLink():q=7;break;default:q=0}f.view.setUint8(b,q);b+=1;b+=3;if(b+n>=k+c)break;U.from(f.memory.buffer).write(l.name,b);b+=n}f.view.setUint32(g,Math.min(b-k,c),!0);return 0}),fd_renumber:Y(function(a,b){d(a,S(0));d(b,S(0));t.closeSync(f.FD_MAP.get(a).real);f.FD_MAP.set(a,f.FD_MAP.get(b));f.FD_MAP.delete(b);return 0}),fd_seek:Y(function(a,b,c,e){a=d(a,uj);f.refreshMemory();switch(c){case 1:a.offset=(a.offset?a.offset:S(0))+S(b);break;case 2:c=t.fstatSync(a.real).size;a.offset= S(c)+S(b);break;case 0:a.offset=S(b)}f.view.setBigUint64(e,a.offset,!0);return 0}),fd_tell:Y(function(a,b){a=d(a,xj);f.refreshMemory();a.offset||(a.offset=S(0));f.view.setBigUint64(b,a.offset,!0);return 0}),fd_sync:Y(function(a){a=d(a,wj);t.fsyncSync(a.real);return 0}),path_create_directory:Y(function(a,b,c){a=d(a,Bj);if(!a.path)return 28;f.refreshMemory();b=U.from(f.memory.buffer,b,c).toString();t.mkdirSync(v.resolve(a.path,b));return 0}),path_filestat_get:Y(function(a,b,c,e,g){a=d(a,Nj);if(!a.path)return 28; f.refreshMemory();c=U.from(f.memory.buffer,c,e).toString();c=t.statSync(v.resolve(a.path,c));f.view.setBigUint64(g,S(c.dev),!0);g+=8;f.view.setBigUint64(g,S(c.ino),!0);g+=8;f.view.setUint8(g,Ok(f,void 0,c).filetype);g+=8;f.view.setBigUint64(g,S(c.nlink),!0);g+=8;f.view.setBigUint64(g,S(c.size),!0);g+=8;f.view.setBigUint64(g,Kk(c.atimeMs),!0);g+=8;f.view.setBigUint64(g,Kk(c.mtimeMs),!0);f.view.setBigUint64(g+8,Kk(c.ctimeMs),!0);return 0}),path_filestat_set_times:Y(function(a,c,e,g,h,k,l){a=d(a,Pj); if(!a.path)return 28;f.refreshMemory();var n=t.fstatSync(a.real);c=n.atime;n=n.mtime;var q=Lk(b(0));if(3===(l&3)||12===(l&12))return 28;1===(l&1)?c=Lk(h):2===(l&2)&&(c=q);4===(l&4)?n=Lk(k):8===(l&8)&&(n=q);e=U.from(f.memory.buffer,e,g).toString();t.utimesSync(v.resolve(a.path,e),new Date(c),new Date(n));return 0}),path_link:Y(function(a,b,c,e,g,h,k){a=d(a,Gj);g=d(g,Hj);if(!a.path||!g.path)return 28;f.refreshMemory();c=U.from(f.memory.buffer,c,e).toString();h=U.from(f.memory.buffer,h,k).toString(); t.linkSync(v.resolve(a.path,c),v.resolve(g.path,h));return 0}),path_open:Y(function(a,b,c,e,g,h,k,l,n){b=d(a,Ij);h=S(h);k=S(k);a=(h&(tj|Jj))!==S(0);var q=(h&(sj|yj|Aj|Rj))!==S(0);if(q&&a)var r=t.constants.O_RDWR;else a?r=t.constants.O_RDONLY:q&&(r=t.constants.O_WRONLY);a=h|Ij;h|=k;0!==(g&1)&&(r|=t.constants.O_CREAT,a|=Fj);0!==(g&2)&&(r|=t.constants.O_DIRECTORY);0!==(g&4)&&(r|=t.constants.O_EXCL);0!==(g&8)&&(r|=t.constants.O_TRUNC,a|=Oj);0!==(l&1)&&(r|=t.constants.O_APPEND);0!==(l&2)&&(r=t.constants.O_DSYNC? r|t.constants.O_DSYNC:r|t.constants.O_SYNC,h|=sj);0!==(l&4)&&(r|=t.constants.O_NONBLOCK);0!==(l&8)&&(r=t.constants.O_RSYNC?r|t.constants.O_RSYNC:r|t.constants.O_SYNC,h|=wj);0!==(l&16)&&(r|=t.constants.O_SYNC,h|=wj);q&&0===(r&(t.constants.O_APPEND|t.constants.O_TRUNC))&&(h|=uj);f.refreshMemory();c=U.from(f.memory.buffer,c,e).toString();c=v.resolve(b.path,c);if(v.relative(b.path,c).startsWith(".."))return 76;try{var y=t.realpathSync(c);if(v.relative(b.path,y).startsWith(".."))return 76}catch(P){if("ENOENT"=== P.code)y=c;else throw P;}try{var C=t.statSync(y).isDirectory()}catch(P){}r=!q&&C?t.openSync(y,t.constants.O_RDONLY):t.openSync(y,r);C=Vh(f.FD_MAP.keys()).reverse()[0]+1;f.FD_MAP.set(C,{real:r,filetype:void 0,rights:{base:a,inheriting:h},path:y});Nk(f,C);f.view.setUint32(n,C,!0);return 0}),path_readlink:Y(function(a,b,c,e,g,h){a=d(a,Kj);if(!a.path)return 28;f.refreshMemory();b=U.from(f.memory.buffer,b,c).toString();b=v.resolve(a.path,b);b=t.readlinkSync(b);e=U.from(f.memory.buffer).write(b,e,g);f.view.setUint32(h, e,!0);return 0}),path_remove_directory:Y(function(a,b,c){a=d(a,Uj);if(!a.path)return 28;f.refreshMemory();b=U.from(f.memory.buffer,b,c).toString();t.rmdirSync(v.resolve(a.path,b));return 0}),path_rename:Y(function(a,b,c,e,g,h){a=d(a,Lj);e=d(e,Mj);if(!a.path||!e.path)return 28;f.refreshMemory();b=U.from(f.memory.buffer,b,c).toString();g=U.from(f.memory.buffer,g,h).toString();t.renameSync(v.resolve(a.path,b),v.resolve(e.path,g));return 0}),path_symlink:Y(function(a,b,c,e,g){c=d(c,Tj);if(!c.path)return 28; f.refreshMemory();a=U.from(f.memory.buffer,a,b).toString();e=U.from(f.memory.buffer,e,g).toString();t.symlinkSync(a,v.resolve(c.path,e));return 0}),path_unlink_file:Y(function(a,b,c){a=d(a,Vj);if(!a.path)return 28;f.refreshMemory();b=U.from(f.memory.buffer,b,c).toString();t.unlinkSync(v.resolve(a.path,b));return 0}),poll_oneoff:function(a,c,d,e){var g=0,h=0;f.refreshMemory();for(var k=0;kh?n:h);f.view.setBigUint64(c,l,!0);c+=8;f.view.setUint16(c,t,!0);c+=2;f.view.setUint8(c,0);c+=1;c+=5;g+=1;break;case 1:case 2:a+=3;f.view.getUint32(a,!0);a+=4;f.view.setBigUint64(c,l,!0);c+=8;f.view.setUint16(c,52,!0);c+=2;f.view.setUint8(c,n);c+=1;c+=5;g+=1;break;default:return 28}}for(f.view.setUint32(e, g,!0);q.hrtime() "+e);return e}catch(I){throw console.log("Catched error: "+I),I;}}})}b.prototype.refreshMemory=function(){this.view&&0!==this.view.buffer.byteLength||(this.view=new Xh(this.memory.buffer))};b.prototype.setMemory=function(a){this.memory=a};b.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()};b.prototype.getImportNamespace=function(a){var b,d=null;try{for(var e=Th(WebAssembly.Module.imports(a)),g=e.next();!g.done;g=e.next()){var f=g.value;if("function"===f.kind&&f.module.startsWith("wasi_"))if(!d)d=f.module;else if(d!==f.module)throw Error("Multiple namespaces detected.");}}catch(k){var h={error:k}}finally{try{g&& !g.done&&(b=e.return)&&b.call(e)}finally{if(h)throw h.error;}}return d};b.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");}};b.defaultBindings=rj;return b}(),Qk=function(){function b(a){this.options=a}b.prototype.run=function(){return rg(this,void 0,void 0,function(){return sg(this, function(){throw Error("run not implemented by the Command subclass");})})};return b}(),Rk=function(b){function a(a){var c=b.call(this,a)||this;if(!a.module)throw Error("Did not find a WebAssembly.Module for the WASI Command");return c}pg(a,b);a.prototype.run=function(a){return rg(this,void 0,void 0,function(){var b,c,g,f;return sg(this,function(d){switch(d.label){case 0:return b={preopens:qg({".":".","/":"/"},this.options.preopens||{}),env:this.options.env,args:this.options.args,bindings:qg(qg({}, Pk.defaultBindings),{fs:a.fs})},c=new Pk(b),g=this.options.module,[4,WebAssembly.instantiate(g,qg({},c.getImports(g)))];case 1:return f=d.sent(),c.start(f),[2]}})})};return a}(Qk),Sk=function(b){function a(a){var c=b.call(this,a)||this;if(!a.callback)throw Error("The Command Options provided are not for a Callback Command");c.callback=a.callback;return c}pg(a,b);a.prototype.run=function(a){return rg(this,void 0,void 0,function(){var b;return sg(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 a}(Qk),Tk=function(){function b(a,b,d,e,g,f,h,k,r){var c=this;this.stdinPrompt="";this.commandOptions=a;this.wasmFs=new mg;this.wasmFs.fromJSON(b);this.originalWasmFsJson=b;this.ioDevices=new Qh(this.wasmFs);this.ioDeviceWindow=f;this.ioDevices.setWindowSizeCallback(function(){var a=c.ioDevices.getWindowSize();c.ioDeviceWindow.resize(a[0],a[1])});this.ioDevices.setBufferIndexDisplayCallback(function(){var a= c.ioDevices.getFrameBuffer();c.ioDeviceWindow.drawRgbaArrayToFrameBuffer(a)});this.ioDevices.setInputCallback(function(){if(c.sharedIoDeviceInput){c.ioDeviceWindow.getInputBuffer();Atomics.wait(c.sharedIoDeviceInput,0,-1);var a=c.sharedIoDeviceInput[0];c.sharedIoDeviceInput[0]=-1;if(0<~]))/g, ""):"";return a.length};b.prototype.stdinRead=function(a){if(0!==this.readStdinCounter%2)return this.readStdinCounter++,0;if(this.pipedStdin){var b=this.pipedStdin;this.pipedStdin="";this.readStdinCounter++}else if(this.sharedStdin&&this.startStdinReadCallback){this.startStdinReadCallback();Atomics.wait(this.sharedStdin,0,-1);b=this.sharedStdin[0];this.sharedStdin[0]=-1;for(var d=new Uint8Array(b),e=0;e\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 \n \n ';this.popupWindow.document.head.innerHTML="\n Wasmer Experimental Framebuffer\n ";this.popupCanvas=this.popupWindow.document.querySelector("#io-device-framebuffer");this.popupCanvasContext=this.popupCanvas.getContext("2d");this.popupImageData=this.popupCanvasContext.getImageData(0,0,a,b);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))};b.prototype._append32BitIntToByteArray=function(a,b){for(var c=0;4>c;c++){var e=a;e&=255<<8*c;e>>=8*c;b.push(e)}};b.prototype._eventListenerKeydown=function(a){a.preventDefault();this.popupKeyCodes.includes(a.keyCode)||this.popupKeyCodes.push(a.keyCode)};b.prototype._eventListenerKeyup=function(a){a.preventDefault(); a=this.popupKeyCodes.indexOf(a.keyCode);-1=d&&a.x<=e&&(h=a.x-d);a.y>=g&&a.y<=f&&(k=a.y-g);if(void 0!==h&&void 0!==k)return{x:this.popupCanvas.width/b.width*h,y:this.popupCanvas.height/b.height*k}}};return b}();function Vk(b){return b&&("[object Function]"===Object.prototype.toString.call(b)||"function"===typeof b||b instanceof Function)} var Wk,Xk=function(){function b(a,b,d,e,g){this.wasmTerminalConfig=a;this.commandString=b;this.commandStartReadCallback=d;this.commandEndCallback=e;g&&(this.wasmTty=g);this.commandOptionsForProcessesToRun=[];this.spawnedProcessObjects=[];this.spawnedProcesses=0;this.pipedStdinDataForNextProcess=new Uint8Array;this.isRunning=!1;this.supportsSharedArrayBuffer=this.wasmTerminalConfig.processWorkerUrl&&window.SharedArrayBuffer&&window.Atomics}b.prototype.runCommand=function(){return rg(this,void 0,void 0, function(){var a,b,d;return sg(this,function(c){switch(c.label){case 0:a=Mh(this.commandString),c.label=1;case 1:c.trys.push([1,3,,4]);if(1this.spawnedProcesses&&2>this.spawnedProcessObjects.length&&aa+1&&(d=void 0!==this.commandOptionsForProcessesToRun[a+1].callback),this.supportsSharedArrayBuffer&&!d&&this._tryToSpawnProcess(a+1),[2]}})})};b.prototype._spawnProcessAsWorker=function(a){return rg(this,void 0,void 0,function(){var b,d,e,g,f,h,k,r,q,t;return sg(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;return[4,this._getBlobUrlForProcessWorker(b,this.wasmTty)];case 1:return d=c.sent(),e=new Worker(d),g=yh(e,[],void 0),f=new SharedArrayBuffer(8192),h=this.wasmTerminalConfig.wasmFs.toJSON(),k=new SharedArrayBuffer(8192),r=new Uk(k),[4,new g(this.commandOptionsForProcessesToRun[a],h,Bh(this._processDataCallback.bind(this,{commandOptionIndex:a,sync:!1})),Bh(this._processEndCallback.bind(this,{commandOptionIndex:a,processWorker:e})),Bh(this._processErrorCallback.bind(this, {commandOptionIndex:a})),Bh(r),k,f,Bh(this._processStartStdinReadCallback.bind(this)))];case 2:return q=c.sent(),t=new Int32Array(f),t[0]=-1,[2,{process:q,commandOptionIndex:a,ioDeviceWindow:r,worker:e,sharedStdin:t}]}})})};b.prototype._spawnProcessAsService=function(a){return rg(this,void 0,void 0,function(){var b,d,e;return sg(this,function(){b=this.wasmTerminalConfig.wasmFs.toJSON();d=new Uk;e=new Tk(this.commandOptionsForProcessesToRun[a],b,this._processDataCallback.bind(this,{commandOptionIndex:a, sync:!0}),this._processEndCallback.bind(this,{commandOptionIndex:a}),this._processErrorCallback.bind(this,{commandOptionIndex:a}),d);return[2,{process:e,commandOptionIndex:a,ioDeviceWindow:d}]})})};b.prototype._processDataCallback=function(a,b){var c=a.commandOptionIndex;a=a.sync;this.isRunning&&(cc?this._addStdinToSharedStdin(b, 1):(c=new Uint8Array(b.length+this.pipedStdinDataForNextProcess.length),c.set(this.pipedStdinDataForNextProcess),c.set(b,this.pipedStdinDataForNextProcess.length),this.pipedStdinDataForNextProcess=c):(b=(new TextDecoder("utf-8")).decode(b),this.wasmTty&&this.wasmTty.print(b,a)))};b.prototype._processEndCallback=function(a,b){var c=a.commandOptionIndex;(a=a.processWorker)&&a.terminate();b&&this.wasmTerminalConfig.wasmFs.fromJSON(b);ca&&(a=Math.max(a,-c.wasmTty.getCursor()),c.wasmTty.setCursorDirectly(c.wasmTty.getCursor()+a))};this.handleCursorErase=function(a){a?0>=c.wasmTty.getCursor()||(a=c.wasmTty.getInput().substr(0, c.wasmTty.getCursor()-1)+c.wasmTty.getInput().substr(c.wasmTty.getCursor()),c.wasmTty.clearInput(),c.wasmTty.setCursorDirectly(c.wasmTty.getCursor()-1),c.wasmTty.setInput(a,!0)):(a=c.wasmTty.getInput().substr(0,c.wasmTty.getCursor())+c.wasmTty.getInput().substr(c.wasmTty.getCursor()+1),c.wasmTty.setInput(a))};this.handleCursorInsert=function(a){var b=c.wasmTty.getInput().substr(0,c.wasmTty.getCursor())+a+c.wasmTty.getInput().substr(c.wasmTty.getCursor());c.wasmTty.setCursorDirectly(c.wasmTty.getCursor()+ a.length);c.wasmTty.setInput(b)};this.handleReadComplete=function(){c._activePrompt&&c._activePrompt.resolve&&(c._activePrompt.resolve(c.wasmTty.getInput()),c._activePrompt=void 0);c.wasmTty.print("\r\n");c._active=!1};this.handleTermData=function(a){if(c._active||"\u0003"===a){if(c.wasmTty.getFirstInit()&&c._activePrompt){var b=c.wasmTty.getBuffer().getLine(c.wasmTty.getBuffer().cursorY+c.wasmTty.getBuffer().baseY).translateToString(!1,0,c.wasmTty.getBuffer().cursorX);c._activePrompt.promptPrefix= b;c.wasmTty.setPromptPrefix(b);c.wasmTty.setFirstInit(!1)}c._activeCharPrompt&&c._activeCharPrompt.resolve?(c._activeCharPrompt.resolve(a),c._activeCharPrompt=void 0,c.wasmTty.print("\r\n")):3b||127===b)switch(a){case "\r":case "\n":case "\r":Jg(c.wasmTty.getInput())?c.handleCursorInsert("\n"):c.handleReadComplete();break;case "\u007f":case "\b":case "\u0004":c.handleCursorErase(!0);break;case "\t":if(0e&&(e=0);a>document.body.scrollHeight&&(a=document.body.scrollHeight);window.scrollTo(e,a)}};b.prototype.print=function(a,b){var c=this;a=a.replace(/\n\n/g,"\n \n");this.isOpen?this.wasmShell.isPrompting?this.wasmShell.printAndRestartPrompt(function(){c.wasmTty.print(a+"\n",b)}):this.wasmTty.print(a,b):this.pendingPrintOnOpen=this.pendingPrintOnOpen?this.pendingPrintOnOpen+a:a};b.prototype.runCommand=function(a){this.wasmShell.isPrompting()&&(this.wasmTty.setInput(a),this.wasmShell.handleReadComplete())}; b.prototype.destroy=function(){this.xterm.dispose();delete this.xterm};b.prototype.onPaste=function(a){this.wasmTty.print(a)};return b}(); function bl(b){return rg(void 0,void 0,void 0,function(){var a,c,d,e;return sg(this,function(g){switch(g.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:b}})})]; case 1:return a=g.sent(),[4,a.json()];case 2:c=g.sent();d=function(a,b){a=a[b[0]];b.shift();return a?1