!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var r in i)("object"==typeof exports?exports:e)[r]=i[r]}}(window,function(){return r={},n.m=i=[function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(14);t.IBufferService=r.createDecorator("BufferService"),t.ICoreMouseService=r.createDecorator("CoreMouseService"),t.ICoreService=r.createDecorator("CoreService"),t.ICharsetService=r.createDecorator("CharsetService"),t.IDirtyRowService=r.createDecorator("DirtyRowService"),t.IInstantiationService=r.createDecorator("InstantiationService"),t.ILogService=r.createDecorator("LogService"),t.IOptionsService=r.createDecorator("OptionsService"),t.IUnicodeService=r.createDecorator("UnicodeService")},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(Object.defineProperty(n.prototype,"event",{get:function(){var i=this;return this._event||(this._event=function(t){return i._listeners.push(t),{dispose:function(){if(!i._disposed)for(var e=0;e>22},l.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?s.stringFromCodePoint(2097151&this.content):""},l.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},l.prototype.setFromCharData=function(e){this.fg=e[a.CHAR_DATA_ATTR_INDEX],this.bg=0;var t=!1;if(2>>16&255,e>>>8&255,255&e]},n.fromColorRGB=function(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},n.prototype.clone=function(){var e=new n;return e.fg=this.fg,e.bg=this.bg,e},n.prototype.isInverse=function(){return 67108864&this.fg},n.prototype.isBold=function(){return 134217728&this.fg},n.prototype.isUnderline=function(){return 268435456&this.fg},n.prototype.isBlink=function(){return 536870912&this.fg},n.prototype.isInvisible=function(){return 1073741824&this.fg},n.prototype.isItalic=function(){return 67108864&this.bg},n.prototype.isDim=function(){return 134217728&this.bg},n.prototype.getFgColorMode=function(){return 50331648&this.fg},n.prototype.getBgColorMode=function(){return 50331648&this.bg},n.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},n.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},n.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},n.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},n.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},n.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},n.prototype.isAttributeDefault=function(){return 0===this.fg&&0===this.bg},n.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},n.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},n);function n(){this.fg=0,this.bg=0}t.AttributeData=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringFromCodePoint=function(e){return 65535>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.length);for(var r="",n=t;n>10))+String.fromCharCode(o%1024+56320)):r+=String.fromCharCode(o)}return r};var r=(n.prototype.clear=function(){this._interim=0},n.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r=0,n=0;this._interim&&(56320<=(a=e.charCodeAt(n++))&&a<=57343?t[r++]=1024*(this._interim-55296)+a-56320+65536:(t[r++]=this._interim,t[r++]=a),this._interim=0);for(var o=n;o=i)return this._interim=s,r;var a;56320<=(a=e.charCodeAt(o))&&a<=57343?t[r++]=1024*(s-55296)+a-56320+65536:(t[r++]=s,t[r++]=a)}else t[r++]=s}return r},n);function n(){this._interim=0}t.StringToUtf32=r;var o=(s.prototype.clear=function(){this.interim.fill(0)},s.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r,n,o,s,a=0,c=0,l=0;if(this.interim[0]){var h=!1,u=this.interim[0];u&=192==(224&u)?31:224==(240&u)?15:7;for(var f=0,_=void 0;(_=63&this.interim[++f])&&f<4;)u<<=6,u|=_;for(var d=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,p=d-f;l>24&255,n=e>>16&255,o=e>>8&255,s=t>>24&255,a=t>>16&255,c=t>>8&255,l=u(h.relativeLuminance2(s,c,a),h.relativeLuminance2(r,n,o));l>>0}function _(e,t,i){for(var r=e>>24&255,n=e>>16&255,o=e>>8&255,s=t>>24&255,a=t>>16&255,c=t>>8&255,l=u(h.relativeLuminance2(s,c,a),h.relativeLuminance2(r,n,o));l>>0}function d(e,t,i){var r=e/255,n=t/255,o=i/255;return.2126*(r<=.03928?r/12.92:Math.pow((.055+r)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((.055+n)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((.055+o)/1.055,2.4))}Object.defineProperty(t,"__esModule",{value:!0}),(a=f=t.channels||(t.channels={})).toCss=function(e,t,i,r){return void 0!==r?"#"+c(e)+c(t)+c(i)+c(r):"#"+c(e)+c(t)+c(i)},a.toRgba=function(e,t,i,r){return void 0===r&&(r=255),(e<<24|t<<16|i<<8|r)>>>0},(r=t.color||(t.color={})).blend=function(e,t){var i=(255&t.rgba)/255;if(1==i)return{css:t.css,rgba:t.rgba};var r=t.rgba>>24&255,n=t.rgba>>16&255,o=t.rgba>>8&255,s=e.rgba>>24&255,a=e.rgba>>16&255,c=e.rgba>>8&255,l=s+Math.round((r-s)*i),h=a+Math.round((n-a)*i),u=c+Math.round((o-c)*i);return{css:f.toCss(l,h,u),rgba:f.toRgba(l,h,u)}},r.ensureContrastRatio=function(e,t,i){var r=s.ensureContrastRatio(e.rgba,t.rgba,i);if(r)return s.toColor(r>>24&255,r>>16&255,r>>8&255)},r.opaque=function(e){var t=(255|e.rgba)>>>0,i=s.toChannels(t),r=i[0],n=i[1],o=i[2];return{css:f.toCss(r,n,o),rgba:t}},(t.css||(t.css={})).toColor=function(e){return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0}},(o=h=t.rgb||(t.rgb={})).relativeLuminance=function(e){return d(e>>16&255,e>>8&255,255&e)},o.relativeLuminance2=d,(n=s=t.rgba||(t.rgba={})).ensureContrastRatio=function(e,t,i){var r=h.relativeLuminance(e>>8),n=h.relativeLuminance(t>>8);if(u(r,n)>24&255,e>>16&255,e>>8&255,255&e]},n.toColor=function(e,t,i){return{css:f.toCss(e,t,i),rgba:f.toRgba(e,t,i)}},t.toPaddedHex=c,t.contrastRatio=u},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="undefined"==typeof navigator,n=r?"node":navigator.userAgent,o=r?"node":navigator.platform;function s(e,t){return 0<=e.indexOf(t)}t.isFirefox=!!~n.indexOf("Firefox"),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.isMac=s(["Macintosh","MacIntel","MacPPC","Mac68K"],o),t.isIpad="iPad"===o,t.isIphone="iPhone"===o,t.isWindows=s(["Windows","Win16","Win32","WinCE"],o),t.isLinux=0<=o.indexOf("Linux")},function(e,t,i){"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),(n=t.C0||(t.C0={})).NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="",n.BS="\b",n.HT="\t",n.LF="\n",n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL="",(r=t.C1||(t.C1={})).PAD="€",r.HOP="",r.BPH="‚",r.NBH="ƒ",r.IND="„",r.NEL="…",r.SSA="†",r.ESA="‡",r.HTS="ˆ",r.HTJ="‰",r.VTS="Š",r.PLD="‹",r.PLU="Œ",r.RI="",r.SS2="Ž",r.SS3="",r.DCS="",r.PU1="‘",r.PU2="’",r.STS="“",r.CCH="”",r.MW="•",r.SPA="–",r.EPA="—",r.SOS="˜",r.SGCI="™",r.SCI="š",r.CSI="›",r.ST="œ",r.OSC="",r.PM="ž",r.APC="Ÿ"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(3),a=i(9),r=i(23),c=i(6),n=i(26),d=i(10),o=(l.prototype.dispose=function(){var e;this._container.removeChild(this._canvas),null===(e=this._charAtlas)||void 0===e||e.dispose()},l.prototype._initCanvas=function(){this._ctx=n.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},l.prototype.onOptionsChanged=function(){},l.prototype.onBlur=function(){},l.prototype.onFocus=function(){},l.prototype.onCursorMove=function(){},l.prototype.onGridChanged=function(e,t){},l.prototype.onSelectionChanged=function(e,t,i){void 0===i&&(i=!1)},l.prototype.setColors=function(e){this._refreshCharAtlas(e)},l.prototype._setTransparency=function(e){if(e!==this._alpha){var t=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,t),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},l.prototype._refreshCharAtlas=function(e){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=r.acquireCharAtlas(this._optionsService.options,this._rendererId,e,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},l.prototype.resize=function(e){this._scaledCellWidth=e.scaledCellWidth,this._scaledCellHeight=e.scaledCellHeight,this._scaledCharWidth=e.scaledCharWidth,this._scaledCharHeight=e.scaledCharHeight,this._scaledCharLeft=e.scaledCharLeft,this._scaledCharTop=e.scaledCharTop,this._canvas.width=e.scaledCanvasWidth,this._canvas.height=e.scaledCanvasHeight,this._canvas.style.width=e.canvasWidth+"px",this._canvas.style.height=e.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},l.prototype._fillCells=function(e,t,i,r){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight)},l.prototype._fillBottomLineAtCells=function(e,t,i){void 0===i&&(i=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,i*this._scaledCellWidth,window.devicePixelRatio)},l.prototype._fillLeftLineAtCell=function(e,t,i){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio*i,this._scaledCellHeight)},l.prototype._strokeRectAtCell=function(e,t,i,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,i*this._scaledCellWidth-window.devicePixelRatio,r*this._scaledCellHeight-window.devicePixelRatio)},l.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))},l.prototype._clearCells=function(e,t,i,r){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight))},l.prototype._fillCharTrueColor=function(e,t,i){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(i),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},l.prototype._drawChars=function(e,t,i){var r,n,o=this._getContrastColor(e);o||e.isFgRGB()||e.isBgRGB()?this._drawUncachedChars(e,t,i,o):(e.isInverse()?(r=e.isBgDefault()?a.INVERTED_DEFAULT_COLOR:e.getBgColor(),n=e.isFgDefault()?a.INVERTED_DEFAULT_COLOR:e.getFgColor()):(n=e.isBgDefault()?s.DEFAULT_COLOR:e.getBgColor(),r=e.isFgDefault()?s.DEFAULT_COLOR:e.getFgColor()),r+=this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&r<8?8:0,this._currentGlyphIdentifier.chars=e.getChars()||s.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=e.getCode()||s.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=n,this._currentGlyphIdentifier.fg=r,this._currentGlyphIdentifier.bold=!!e.isBold(),this._currentGlyphIdentifier.dim=!!e.isDim(),this._currentGlyphIdentifier.italic=!!e.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,t*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(e,t,i))},l.prototype._drawUncachedChars=function(e,t,i,r){if(this._ctx.save(),this._ctx.font=this._getFont(!!e.isBold(),!!e.isItalic()),this._ctx.textBaseline="middle",e.isInverse())if(r)this._ctx.fillStyle=r.css;else if(e.isBgDefault())this._ctx.fillStyle=d.color.opaque(this._colors.background).css;else if(e.isBgRGB())this._ctx.fillStyle="rgb("+c.AttributeData.toColorRGB(e.getBgColor()).join(",")+")";else{var n=e.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&n<8&&(n+=8),this._ctx.fillStyle=this._colors.ansi[n].css}else if(r)this._ctx.fillStyle=r.css;else if(e.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(e.isFgRGB())this._ctx.fillStyle="rgb("+c.AttributeData.toColorRGB(e.getFgColor()).join(",")+")";else{var o=e.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&o<8&&(o+=8),this._ctx.fillStyle=this._colors.ansi[o].css}this._clipRow(i),e.isDim()&&(this._ctx.globalAlpha=a.DIM_OPACITY),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},l.prototype._clipRow=function(e){this._ctx.beginPath(),this._ctx.rect(0,e*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},l.prototype._getFont=function(e,t){return(t?"italic":"")+" "+(e?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},l.prototype._getContrastColor=function(e){if(1!==this._optionsService.options.minimumContrastRatio){var t=this._colors.contrastCache.getColor(e.bg,e.fg);if(void 0!==t)return t||void 0;var i=e.getFgColor(),r=e.getFgColorMode(),n=e.getBgColor(),o=e.getBgColorMode(),s=!!e.isInverse(),a=!!e.isInverse();if(s){var c=i;i=n,n=c;var l=r;r=o,o=l}var h=this._resolveBackgroundRgba(o,n,s),u=this._resolveForegroundRgba(r,i,s,a),f=d.rgba.ensureContrastRatio(h,u,this._optionsService.options.minimumContrastRatio);if(f){var _={css:d.channels.toCss(f>>24&255,f>>16&255,f>>8&255),rgba:f};return this._colors.contrastCache.setColor(e.bg,e.fg,_),_}this._colors.contrastCache.setColor(e.bg,e.fg,null)}},l.prototype._resolveBackgroundRgba=function(e,t,i){switch(e){case 16777216:case 33554432:return this._colors.ansi[t].rgba;case 50331648:return t<<8;case 0:default:return i?this._colors.foreground.rgba:this._colors.background.rgba}},l.prototype._resolveForegroundRgba=function(e,t,i,r){switch(e){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&r&&t<8&&(t+=8),this._colors.ansi[t].rgba;case 50331648:return t<<8;case 0:default:return i?this._colors.background.rgba:this._colors.foreground.rgba}},l);function l(e,t,i,r,n,o,s,a){this._container=e,this._alpha=r,this._colors=n,this._rendererId=o,this._bufferService=s,this._optionsService=a,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=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-"+t+"-layer"),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}t.BaseRenderLayer=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="di$target",o="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[o]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);var r=function(e,t,i){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,i){t[n]===t?t[o].push({id:e,index:i}):(t[o]=[{id:e,index:i}],t[n]=t)}(r,e,i)};return r.toString=function(){return e},t.serviceRegistry.set(e,r),r}},function(e,t,i){"use strict";function n(e,t,i,r){if(void 0===i&&(i=0),void 0===r&&(r=e.length),i>=e.length)return e;i=(e.length+i)%e.length,r=r>=e.length?e.length:(e.length+r)%e.length;for(var n=i;n>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]},o.prototype.set=function(e,t){this._data[3*e+1]=t[a.CHAR_DATA_ATTR_INDEX],1>22},o.prototype.hasWidth=function(e){return 12582912&this._data[3*e+0]},o.prototype.getFg=function(e){return this._data[3*e+1]},o.prototype.getBg=function(e){return this._data[3*e+2]},o.prototype.hasContent=function(e){return 4194303&this._data[3*e+0]},o.prototype.getCodePoint=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t},o.prototype.isCombined=function(e){return 2097152&this._data[3*e+0]},o.prototype.getString=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?s.stringFromCodePoint(2097151&t):""},o.prototype.loadCell=function(e,t){var i=3*e;return t.content=this._data[0+i],t.fg=this._data[1+i],t.bg=this._data[2+i],2097152&t.content&&(t.combinedData=this._combined[e]),t},o.prototype.setCell=function(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg},o.prototype.setCellFromCodePoint=function(e,t,i,r,n){this._data[3*e+0]=t|i<<22,this._data[3*e+1]=r,this._data[3*e+2]=n},o.prototype.addCodepointToCell=function(e,t){var i=this._data[3*e+0];2097152&i?this._combined[e]+=s.stringFromCodePoint(t):(2097151&i?(this._combined[e]=s.stringFromCodePoint(2097151&i)+s.stringFromCodePoint(t),i&=-2097152,i|=2097152):i=t|1<<22,this._data[3*e+0]=i)},o.prototype.insertCells=function(e,t,i,r){var n,o,s,a;if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null===(n=r)||void 0===n?void 0:n.fg)||0,(null===(o=r)||void 0===o?void 0:o.bg)||0),tthis.length){var i=new Uint32Array(3*e);this.length&&(3*e>22);return 0},o.prototype.copyCellsFrom=function(e,t,i,r,n){var o=e._data;if(n)for(var s=r-1;0<=s;s--)for(var a=0;a<3;a++)this._data[3*(i+s)+a]=o[3*(t+s)+a];else for(s=0;s>22||1}return r},o);function o(e,t,i){void 0===i&&(i=!1),this.isWrapped=i,this._combined={},this._data=new Uint32Array(3*e);for(var r=t||h.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),n=0;n>8,r=255&this._subParamsIdx[t];0=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new 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(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=2147483647>8)},o.prototype.getSubParams=function(e){var t=this._subParamsIdx[e]>>8,i=255&this._subParamsIdx[e];return 0>8,r=255&this._subParamsIdx[t];0r.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},c.prototype.end=function(e){var t;return this._hitLimit?t=!1:e&&(t=this._handler(this._data)),this._data="",this._hitLimit=!1,t},c);function c(e){this._handler=e,this._data="",this._hitLimit=!1}t.OscHandler=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=1e7},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(7),r=i(19),o=i(21),s=[],a=(c.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},c.prototype.addHandler=function(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);var i=this._handlers[e];return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},c.prototype.setHandler=function(e,t){this._handlers[e]=[t]},c.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},c.prototype.setHandlerFallback=function(e){this._handlerFb=e},c.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=s,this._ident=0},c.prototype.hook=function(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||s,this._active.length)for(var i=this._active.length-1;0<=i;i--)this._active[i].hook(t);else this._handlerFb(this._ident,"HOOK",t)},c.prototype.put=function(e,t,i){if(this._active.length)for(var r=this._active.length-1;0<=r;r--)this._active[r].put(e,t,i);else this._handlerFb(this._ident,"PUT",n.utf32ToString(e,t,i))},c.prototype.unhook=function(e){if(this._active.length){for(var t=this._active.length-1;0<=t&&!1===this._active[t].unhook(e);t--);for(t--;0<=t;t--)this._active[t].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",e);this._active=s,this._ident=0},c);function c(){this._handlers=Object.create(null),this._active=s,this._ident=0,this._handlerFb=function(){}}t.DcsParser=a;var l=(h.prototype.hook=function(e){this._params=e.clone(),this._data="",this._hitLimit=!1},h.prototype.put=function(e,t,i){this._hitLimit||(this._data+=n.utf32ToString(e,t,i),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},h.prototype.unhook=function(e){var t;return this._hitLimit?t=!1:e&&(t=this._handler(this._data,this._params?this._params:new r.Params)),this._params=void 0,this._data="",this._hitLimit=!1,t},h);function h(e){this._handler=e,this._data="",this._hitLimit=!1}t.DcsHandler=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var h=i(24),u=i(42),f=[];t.acquireCharAtlas=function(e,t,i,r,n){for(var o=h.generateConfig(r,n,e,i),s=0;s=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new r.CellData)},p.prototype.translateToString=function(e,t,i){return this._line.translateToString(e,t,i)},p),u=(d.prototype.registerCsiHandler=function(e,t){return this._core.addCsiHandler(e,function(e){return t(e.toArray())})},d.prototype.addCsiHandler=function(e,t){return this.registerCsiHandler(e,t)},d.prototype.registerDcsHandler=function(e,i){return this._core.addDcsHandler(e,function(e,t){return i(e,t.toArray())})},d.prototype.addDcsHandler=function(e,t){return this.registerDcsHandler(e,t)},d.prototype.registerEscHandler=function(e,t){return this._core.addEscHandler(e,t)},d.prototype.addEscHandler=function(e,t){return this.registerEscHandler(e,t)},d.prototype.registerOscHandler=function(e,t){return this._core.addOscHandler(e,t)},d.prototype.addOscHandler=function(e,t){return this.registerOscHandler(e,t)},d),f=(_.prototype.register=function(e){this._core.unicodeService.register(e)},Object.defineProperty(_.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(e){this._core.unicodeService.activeVersion=e},enumerable:!0,configurable:!0}),_);function _(e){this._core=e}function d(e){this._core=e}function p(e){this._line=e}function v(e){this._buffer=e}},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o,s=i(34),a=i(35),c=i(36),h=i(12),l=i(37),u=i(39),f=i(49),_=i(50),d=i(11),p=i(8),v=i(17),g=i(53),y=i(54),b=i(55),m=i(56),S=i(58),C=i(1),w=i(16),E=i(59),L=i(25),A=i(60),R=i(0),x=i(61),k=i(4),D=i(62),T=i(63),O=i(2),M=i(69),P=i(70),H=i(71),I=i(72),B=i(73),F=i(74),j=i(75),W=i(76),q=i(77),U=i(79),N="undefined"!=typeof window?window.document:null,z=(o=O.Disposable,n(K,o),Object.defineProperty(K.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onA11yChar",{get:function(){return this.onA11yCharEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onA11yTab",{get:function(){return this.onA11yTabEmitter.event},enumerable:!0,configurable:!0}),K.prototype.dispose=function(){var e,t,i,r;this._isDisposed||(o.prototype.dispose.call(this),null===(e=this._windowsMode)||void 0===e||e.dispose(),this._windowsMode=void 0,null===(t=this._renderService)||void 0===t||t.dispose(),this._customKeyEventHandler=null,this.write=function(){},null===(r=null===(i=this.element)||void 0===i?void 0:i.parentNode)||void 0===r||r.removeChild(this.element))},K.prototype._setup=function(){var i=this;this._customKeyEventHandler=null,this.insertMode=!1,this.bracketedPasteMode=!1,this._userScrolling=!1,this._inputHandler?this._inputHandler.reset():(this._inputHandler=new l.InputHandler(this,this._bufferService,this._charsetService,this._coreService,this._dirtyRowService,this._logService,this.optionsService,this._coreMouseService,this.unicodeService,this._instantiationService),this._inputHandler.onRequestBell(function(){return i.bell()}),this._inputHandler.onRequestRefreshRows(function(e,t){return i.refresh(e,t)}),this._inputHandler.onRequestReset(function(){return i.reset()}),this._inputHandler.onCursorMove(function(){return i._onCursorMove.fire()}),this._inputHandler.onLineFeed(function(){return i._onLineFeed.fire()}),this.register(this._inputHandler)),this.linkifier||(this.linkifier=new f.Linkifier(this._bufferService,this._logService,this.optionsService,this.unicodeService)),this.options.windowsMode&&this._enableWindowsMode()},K.prototype._enableWindowsMode=function(){var e=this;if(!this._windowsMode){var t=[];t.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),t.push(this.addCsiHandler({final:"H"},function(){return E.updateWindowsModeWrappedState(e._bufferService),!1})),this._windowsMode={dispose:function(){t.forEach(function(e){return e.dispose()})}}}},Object.defineProperty(K.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!0,configurable:!0}),K.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},K.prototype._setupOptionsListeners=function(){var s=this;this.optionsService.onOptionChange(function(e){var t,i,r,n,o;switch(e){case"fontFamily":case"fontSize":null===(t=s._renderService)||void 0===t||t.clear(),null===(i=s._charSizeService)||void 0===i||i.measure();break;case"cursorBlink":case"cursorStyle":s.refresh(s.buffer.y,s.buffer.y);break;case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":s._renderService&&(s._renderService.clear(),s._renderService.onResize(s.cols,s.rows),s.refresh(0,s.rows-1));break;case"rendererType":s._renderService&&(s._renderService.setRenderer(s._createRenderer()),s._renderService.onResize(s.cols,s.rows));break;case"scrollback":s.buffers.resize(s.cols,s.rows),null===(r=s.viewport)||void 0===r||r.syncScrollArea();break;case"screenReaderMode":s.optionsService.options.screenReaderMode?!s._accessibilityManager&&s._renderService&&(s._accessibilityManager=new b.AccessibilityManager(s,s._renderService)):(null===(n=s._accessibilityManager)||void 0===n||n.dispose(),s._accessibilityManager=null);break;case"tabStopWidth":s.buffers.setupTabStops();break;case"theme":s._setTheme(s.optionsService.options.theme);break;case"windowsMode":s.optionsService.options.windowsMode?s._enableWindowsMode():(null===(o=s._windowsMode)||void 0===o||o.dispose(),s._windowsMode=void 0)}})},K.prototype._onTextAreaFocus=function(e){this.sendFocus&&this._coreService.triggerDataEvent(h.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this.showCursor(),this._onFocus.fire()},K.prototype.blur=function(){return this.textarea.blur()},K.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.sendFocus&&this._coreService.triggerDataEvent(h.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},K.prototype._initGlobal=function(){var t=this;function e(e){return c.handlePasteEvent(e,t.textarea,t.bracketedPasteMode,t._coreService)}this._bindKeys(),this.register(p.addDisposableDomListener(this.element,"copy",function(e){t.hasSelection()&&c.copyHandler(e,t._selectionService)})),this.register(p.addDisposableDomListener(this.textarea,"paste",e)),this.register(p.addDisposableDomListener(this.element,"paste",e)),d.isFirefox?this.register(p.addDisposableDomListener(this.element,"mousedown",function(e){2===e.button&&c.rightClickHandler(e,t.textarea,t.screenElement,t._selectionService,t.options.rightClickSelectsWord)})):this.register(p.addDisposableDomListener(this.element,"contextmenu",function(e){c.rightClickHandler(e,t.textarea,t.screenElement,t._selectionService,t.options.rightClickSelectsWord)})),d.isLinux&&this.register(p.addDisposableDomListener(this.element,"auxclick",function(e){1===e.button&&c.moveTextAreaUnderMouseCursor(e,t.textarea,t.screenElement)}))},K.prototype._bindKeys=function(){var t=this;this.register(p.addDisposableDomListener(this.textarea,"keyup",function(e){return t._keyUp(e)},!0)),this.register(p.addDisposableDomListener(this.textarea,"keydown",function(e){return t._keyDown(e)},!0)),this.register(p.addDisposableDomListener(this.textarea,"keypress",function(e){return t._keyPress(e)},!0)),this.register(p.addDisposableDomListener(this.textarea,"compositionstart",function(){return t._compositionHelper.compositionstart()})),this.register(p.addDisposableDomListener(this.textarea,"compositionupdate",function(e){return t._compositionHelper.compositionupdate(e)})),this.register(p.addDisposableDomListener(this.textarea,"compositionend",function(){return t._compositionHelper.compositionend()})),this.register(this.onRender(function(){return t._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(e){return t._queueLinkification(e.start,e.end)}))},K.prototype.open=function(e){var i=this;if(!e)throw new Error("Terminal requires a parent element.");N.body.contains(e)||this._logService.warn("Terminal.open was called on an element that was not attached to the DOM"),this._document=e.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"),e.appendChild(this.element);var t=N.createDocumentFragment();this._viewportElement=N.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this._viewportScrollArea=N.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=N.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=N.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement),this.textarea=N.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.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(p.addDisposableDomListener(this.textarea,"focus",function(e){return i._onTextAreaFocus(e)})),this.register(p.addDisposableDomListener(this.textarea,"blur",function(){return i._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var r=this._instantiationService.createInstance(W.CoreBrowserService,this.textarea);this._instantiationService.setService(k.ICoreBrowserService,r),this._charSizeService=this._instantiationService.createInstance(D.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._compositionView=N.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(t),this._theme=this.options.theme||this._theme,this.options.theme=void 0,this._colorManager=new L.ColorManager(N,this.options.allowTransparency),this.optionsService.onOptionChange(function(e){return i._colorManager.onOptionsChange(e)}),this._colorManager.setTheme(this._theme);var n=this._createRenderer();this._renderService=this._instantiationService.createInstance(A.RenderService,n,this.rows,this.screenElement),this._instantiationService.setService(k.IRenderService,this._renderService),this._renderService.onRender(function(e){return i._onRender.fire(e)}),this.onResize(function(e){return i._renderService.resize(e.cols,e.rows)}),this._soundService=this._instantiationService.createInstance(g.SoundService),this._instantiationService.setService(k.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(M.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(a.Viewport,function(e,t){return i.scrollLines(e,t)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this.viewport),this.register(this.onCursorMove(function(){return i._renderService.onCursorMove()})),this.register(this.onResize(function(){return i._renderService.onResize(i.cols,i.rows)})),this.register(this.onBlur(function(){return i._renderService.onBlur()})),this.register(this.onFocus(function(){return i._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return i.viewport.syncScrollArea()})),this._selectionService=this._instantiationService.createInstance(_.SelectionService,function(e,t){return i.scrollLines(e,t)},this.element,this.screenElement),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onSelectionChange(function(){return i._onSelectionChange.fire()})),this.register(this._selectionService.onRedrawRequest(function(e){return i._renderService.onSelectionChanged(e.start,e.end,e.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(e){i.textarea.value=e,i.textarea.focus(),i.textarea.select()})),this.register(this.onScroll(function(){i.viewport.syncScrollArea(),i._selectionService.refresh()})),this.register(p.addDisposableDomListener(this._viewportElement,"scroll",function(){return i._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(y.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return i._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.register(p.addDisposableDomListener(this.element,"mousedown",function(e){return i._selectionService.onMouseDown(e)})),this.mouseEvents?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new b.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},K.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(u.Renderer,this._colorManager.colors,this.screenElement,this.linkifier);case"dom":return this._instantiationService.createInstance(m.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},K.prototype._setTheme=function(e){var t,i,r;this._theme=e,null===(t=this._colorManager)||void 0===t||t.setTheme(e),null===(i=this._renderService)||void 0===i||i.setColors(this._colorManager.colors),null===(r=this.viewport)||void 0===r||r.onThemeChange(this._colorManager.colors)},K.prototype.bindMouse=function(){var o=this,n=this,t=this.element;function i(e){var t,i,r;if(!(t=n._mouseService.getRawByteCoords(e,n.screenElement,n.cols,n.rows)))return!1;switch(e.overrideType||e.type){case"mousemove":r=32,void 0===e.buttons?(i=3,void 0!==e.button&&(i=e.button<3?e.button:3)):i=1&e.buttons?0:4&e.buttons?1:2&e.buttons?2:3;break;case"mouseup":r=0,i=e.button<3?e.button:3;break;case"mousedown":r=1,i=e.button<3?e.button:3;break;case"wheel":0!==e.deltaY&&(r=e.deltaY<0?0:1),i=4;break;default:return!1}return!(void 0===r||void 0===i||4=this.buffer.ybase&&(this._userScrolling=!1);var i=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+e,this.buffer.ybase),0),i!==this.buffer.ydisp&&(t||this._onScroll.fire(this.buffer.ydisp),this.refresh(0,this.rows-1))},K.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},K.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},K.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},K.prototype.scrollToLine=function(e){var t=e-this.buffer.ydisp;0!=t&&this.scrollLines(t)},K.prototype.paste=function(e){c.paste(e,this.textarea,this.bracketedPasteMode,this._coreService)},K.prototype.attachCustomKeyEventHandler=function(e){this._customKeyEventHandler=e},K.prototype.addEscHandler=function(e,t){return this._inputHandler.addEscHandler(e,t)},K.prototype.addDcsHandler=function(e,t){return this._inputHandler.addDcsHandler(e,t)},K.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},K.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},K.prototype.registerLinkMatcher=function(e,t,i){var r=this.linkifier.registerLinkMatcher(e,t,i);return this.refresh(0,this.rows-1),r},K.prototype.deregisterLinkMatcher=function(e){this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},K.prototype.registerCharacterJoiner=function(e){var t=this._renderService.registerCharacterJoiner(e);return this.refresh(0,this.rows-1),t},K.prototype.deregisterCharacterJoiner=function(e){this._renderService.deregisterCharacterJoiner(e)&&this.refresh(0,this.rows-1)},Object.defineProperty(K.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!0,configurable:!0}),K.prototype.addMarker=function(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)},K.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},K.prototype.select=function(e,t,i){this._selectionService.setSelection(e,t,i)},K.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},K.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]}},K.prototype.clearSelection=function(){var e;null===(e=this._selectionService)||void 0===e||e.clearSelection()},K.prototype.selectAll=function(){var e;null===(e=this._selectionService)||void 0===e||e.selectAll()},K.prototype.selectLines=function(e,t){var i;null===(i=this._selectionService)||void 0===i||i.selectLines(e,t)},K.prototype._keyDown=function(e){if(this._keyDownHandled=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var t=S.evaluateKeyboardEvent(e,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3!==t.type&&2!==t.type)return 1===t.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(t.cancel&&this.cancel(e,!0),!t.key||(t.key!==h.C0.ETX&&t.key!==h.C0.CR||(this.textarea.value=""),this._onKey.fire({key:t.key,domEvent:e}),this.showCursor(),this._coreService.triggerDataEvent(t.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(e,!0)));var i=this.rows-1;return this.scrollLines(2===t.type?-i:i),this.cancel(e,!0)},K.prototype._isThirdLevelShift=function(e,t){var i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"===t.type?i:i&&(!t.keyCode||47=c)if(l)o.x=0,o.y++,o.y===o.scrollBottom+1?(o.y--,this._terminal.scroll(this._eraseAttrData(),!0)):(o.y>=this._bufferService.rows&&(o.y=this._bufferService.rows-1),o.lines.get(o.y).isWrapped=!0),f=o.lines.get(o.y+o.ybase);else if(o.x=c-1,2===n)continue;if(h&&(f.insertCells(o.x,n,o.getNullCell(u),u),2===f.getWidth(c-1)&&f.setCellFromCodePoint(c-1,S.NULL_CELL_CODE,S.NULL_CELL_WIDTH,u.fg,u.bg)),f.setCellFromCodePoint(o.x++,r,n,u.fg,u.bg),0=this._bufferService.rows&&(e.y=this._bufferService.rows-1),e.x>=this._bufferService.cols&&e.x--,this._dirtyRowService.markDirty(e.y),this._onLineFeed.fire()},_.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},_.prototype.backspace=function(){this._restrictCursor(),0=this._bufferService.cols)){var e=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._terminal.onA11yTabEmitter.fire(this._bufferService.buffer.x-e)}},_.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},_.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},_.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._coreService.decPrivateModes.origin?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)},_.prototype._setCursor=function(e,t){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=e,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+t):(this._bufferService.buffer.x=e,this._bufferService.buffer.y=t),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},_.prototype._moveCursor=function(e,t){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+e,this._bufferService.buffer.y+t)},_.prototype.cursorUp=function(e){var t=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;0<=t?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1))},_.prototype.cursorDown=function(e){var t=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;0<=t?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1)},_.prototype.cursorForward=function(e){this._moveCursor(e.params[0]||1,0)},_.prototype.cursorBackward=function(e){this._moveCursor(-(e.params[0]||1),0)},_.prototype.cursorNextLine=function(e){this.cursorDown(e),this._bufferService.buffer.x=0},_.prototype.cursorPrecedingLine=function(e){this.cursorUp(e),this._bufferService.buffer.x=0},_.prototype.cursorCharAbsolute=function(e){this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y)},_.prototype.cursorPosition=function(e){this._setCursor(2<=e.length?(e.params[1]||1)-1:0,(e.params[0]||1)-1)},_.prototype.charPosAbsolute=function(e){this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y)},_.prototype.hPositionRelative=function(e){this._moveCursor(e.params[0]||1,0)},_.prototype.linePosAbsolute=function(e){this._setCursor(this._bufferService.buffer.x,(e.params[0]||1)-1)},_.prototype.vPositionRelative=function(e){this._moveCursor(0,e.params[0]||1)},_.prototype.hVPosition=function(e){this.cursorPosition(e)},_.prototype.tabClear=function(e){var t=e.params[0];0===t?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:3===t&&(this._bufferService.buffer.tabs={})},_.prototype.cursorForwardTab=function(e){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var t=e.params[0]||1;t--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},_.prototype.cursorBackwardTab=function(e){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var t=e.params[0]||1,i=this._bufferService.buffer;t--;)i.x=i.prevStop()},_.prototype._eraseInBufferLine=function(e,t,i,r){void 0===r&&(r=!1);var n=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);n.replaceCells(t,i,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),r&&(n.isWrapped=!1)},_.prototype._resetBufferLine=function(e){var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);t.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),t.isWrapped=!1},_.prototype.eraseInDisplay=function(e){var t;switch(this._restrictCursor(),e.params[0]){case 0:for(t=this._bufferService.buffer.y,this._dirtyRowService.markDirty(t),this._eraseInBufferLine(t++,this._bufferService.buffer.x,this._bufferService.cols,0===this._bufferService.buffer.x);t=this._bufferService.cols&&(this._bufferService.buffer.lines.get(t+1).isWrapped=!1);t--;)this._resetBufferLine(t);this._dirtyRowService.markDirty(0);break;case 2:for(t=this._bufferService.rows,this._dirtyRowService.markDirty(t-1);t--;)this._resetBufferLine(t);this._dirtyRowService.markDirty(0);break;case 3:var i=this._bufferService.buffer.lines.length-this._bufferService.rows;0i.scrollBottom||i.yi.scrollBottom||i.yt.scrollBottom||t.yt.scrollBottom||t.yt.scrollBottom||t.yt.scrollBottom||t.y0;276;0c"):this._terminal.is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._terminal.is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c"))},_.prototype.setMode=function(e){for(var t=0;tthis._bufferService.rows||0===t)&&(t=this._bufferService.rows),i=this._bufferService.rows&&(e.y=this._bufferService.rows-1),this._restrictCursor()},_.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},_.prototype.reverseIndex=function(){this._restrictCursor();var e=this._bufferService.buffer;if(e.y===e.scrollTop){var t=e.scrollBottom-e.scrollTop;e.lines.shiftElements(e.y+e.ybase,t,1),e.lines.set(e.y+e.ybase,e.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(e.scrollTop,e.scrollBottom)}else e.y--,this._restrictCursor()},_.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},_.prototype.reset=function(){this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()},_.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},_.prototype.setgLevel=function(e){this._charsetService.setgLevel(e)},_.prototype.screenAlignmentPattern=function(){var e=new C.CellData;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg;var t=this._bufferService.buffer;this._setCursor(0,0);for(var i=0;i",final:"c"},function(e){return u.sendDeviceAttributesSecondary(e)}),u._parser.setCsiHandler({final:"d"},function(e){return u.linePosAbsolute(e)}),u._parser.setCsiHandler({final:"e"},function(e){return u.vPositionRelative(e)}),u._parser.setCsiHandler({final:"f"},function(e){return u.hVPosition(e)}),u._parser.setCsiHandler({final:"g"},function(e){return u.tabClear(e)}),u._parser.setCsiHandler({final:"h"},function(e){return u.setMode(e)}),u._parser.setCsiHandler({prefix:"?",final:"h"},function(e){return u.setModePrivate(e)}),u._parser.setCsiHandler({final:"l"},function(e){return u.resetMode(e)}),u._parser.setCsiHandler({prefix:"?",final:"l"},function(e){return u.resetModePrivate(e)}),u._parser.setCsiHandler({final:"m"},function(e){return u.charAttributes(e)}),u._parser.setCsiHandler({final:"n"},function(e){return u.deviceStatus(e)}),u._parser.setCsiHandler({prefix:"?",final:"n"},function(e){return u.deviceStatusPrivate(e)}),u._parser.setCsiHandler({intermediates:"!",final:"p"},function(e){return u.softReset(e)}),u._parser.setCsiHandler({intermediates:" ",final:"q"},function(e){return u.setCursorStyle(e)}),u._parser.setCsiHandler({final:"r"},function(e){return u.setScrollRegion(e)}),u._parser.setCsiHandler({final:"s"},function(e){return u.saveCursor(e)}),u._parser.setCsiHandler({final:"t"},function(e){return u.windowOptions(e)}),u._parser.setCsiHandler({final:"u"},function(e){return u.restoreCursor(e)}),u._parser.setCsiHandler({intermediates:"'",final:"}"},function(e){return u.insertColumns(e)}),u._parser.setCsiHandler({intermediates:"'",final:"~"},function(e){return u.deleteColumns(e)}),u._parser.setExecuteHandler(p.C0.BEL,function(){return u.bell()}),u._parser.setExecuteHandler(p.C0.LF,function(){return u.lineFeed()}),u._parser.setExecuteHandler(p.C0.VT,function(){return u.lineFeed()}),u._parser.setExecuteHandler(p.C0.FF,function(){return u.lineFeed()}),u._parser.setExecuteHandler(p.C0.CR,function(){return u.carriageReturn()}),u._parser.setExecuteHandler(p.C0.BS,function(){return u.backspace()}),u._parser.setExecuteHandler(p.C0.HT,function(){return u.tab()}),u._parser.setExecuteHandler(p.C0.SO,function(){return u.shiftOut()}),u._parser.setExecuteHandler(p.C0.SI,function(){return u.shiftIn()}),u._parser.setExecuteHandler(p.C1.IND,function(){return u.index()}),u._parser.setExecuteHandler(p.C1.NEL,function(){return u.nextLine()}),u._parser.setExecuteHandler(p.C1.HTS,function(){return u.tabSet()}),u._parser.setOscHandler(0,new w.OscHandler(function(e){u.setTitle(e),u.setIconName(e)})),u._parser.setOscHandler(1,new w.OscHandler(function(e){return u.setIconName(e)})),u._parser.setOscHandler(2,new w.OscHandler(function(e){return u.setTitle(e)})),u._parser.setEscHandler({final:"7"},function(){return u.saveCursor()}),u._parser.setEscHandler({final:"8"},function(){return u.restoreCursor()}),u._parser.setEscHandler({final:"D"},function(){return u.index()}),u._parser.setEscHandler({final:"E"},function(){return u.nextLine()}),u._parser.setEscHandler({final:"H"},function(){return u.tabSet()}),u._parser.setEscHandler({final:"M"},function(){return u.reverseIndex()}),u._parser.setEscHandler({final:"="},function(){return u.keypadApplicationMode()}),u._parser.setEscHandler({final:">"},function(){return u.keypadNumericMode()}),u._parser.setEscHandler({final:"c"},function(){return u.fullReset()}),u._parser.setEscHandler({final:"n"},function(){return u.setgLevel(2)}),u._parser.setEscHandler({final:"o"},function(){return u.setgLevel(3)}),u._parser.setEscHandler({final:"|"},function(){return u.setgLevel(3)}),u._parser.setEscHandler({final:"}"},function(){return u.setgLevel(2)}),u._parser.setEscHandler({final:"~"},function(){return u.setgLevel(1)}),u._parser.setEscHandler({intermediates:"%",final:"@"},function(){return u.selectDefaultCharset()}),u._parser.setEscHandler({intermediates:"%",final:"G"},function(){return u.selectDefaultCharset()});function f(e){_._parser.setEscHandler({intermediates:"(",final:e},function(){return u.selectCharset("("+e)}),_._parser.setEscHandler({intermediates:")",final:e},function(){return u.selectCharset(")"+e)}),_._parser.setEscHandler({intermediates:"*",final:e},function(){return u.selectCharset("*"+e)}),_._parser.setEscHandler({intermediates:"+",final:e},function(){return u.selectCharset("+"+e)}),_._parser.setEscHandler({intermediates:"-",final:e},function(){return u.selectCharset("-"+e)}),_._parser.setEscHandler({intermediates:".",final:e},function(){return u.selectCharset("."+e)}),_._parser.setEscHandler({intermediates:"/",final:e},function(){return u.selectCharset("/"+e)})}var _=this;for(var d in v.CHARSETS)f(d);return u._parser.setEscHandler({intermediates:"#",final:"8"},function(){return u.screenAlignmentPattern()}),u._parser.setErrorHandler(function(e){return u._logService.error("Parsing error: ",e),e}),u._parser.setDcsHandler({intermediates:"$",final:"q"},new L(u._bufferService,u._coreService,u._logService,u._optionsService)),u}function d(e,t,i,r){this._bufferService=e,this._coreService=t,this._logService=i,this._optionsService=r,this._data=new Uint32Array(0)}t.InputHandler=f},function(e,i,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var o=t(2),s=t(15),a=t(19),c=t(20),l=t(22),h=(u.prototype.setDefault=function(e,t){s.fill(this.table,e<<4|t)},u.prototype.add=function(e,t,i,r){this.table[t<<8|e]=i<<4|r},u.prototype.addMany=function(e,t,i,r){for(var n=0;no||o>t[1])throw new Error("final must be in range "+t[0]+" .. "+t[1]);return(i<<=8)|o},d.prototype.identToString=function(e){for(var t=[];e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")},d.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},d.prototype.setPrintHandler=function(e){this._printHandler=e},d.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},d.prototype.addEscHandler=function(e,t){var i=this._identifier(e,[48,126]);void 0===this._escHandlers[i]&&(this._escHandlers[i]=[]);var r=this._escHandlers[i];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},d.prototype.setEscHandler=function(e,t){this._escHandlers[this._identifier(e,[48,126])]=[t]},d.prototype.clearEscHandler=function(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]},d.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},d.prototype.setExecuteHandler=function(e,t){this._executeHandlers[e.charCodeAt(0)]=t},d.prototype.clearExecuteHandler=function(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]},d.prototype.setExecuteHandlerFallback=function(e){this._executeHandlerFb=e},d.prototype.addCsiHandler=function(e,t){var i=this._identifier(e);void 0===this._csiHandlers[i]&&(this._csiHandlers[i]=[]);var r=this._csiHandlers[i];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},d.prototype.setCsiHandler=function(e,t){this._csiHandlers[this._identifier(e)]=[t]},d.prototype.clearCsiHandler=function(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]},d.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},d.prototype.addDcsHandler=function(e,t){return this._dcsParser.addHandler(this._identifier(e),t)},d.prototype.setDcsHandler=function(e,t){this._dcsParser.setHandler(this._identifier(e),t)},d.prototype.clearDcsHandler=function(e){this._dcsParser.clearHandler(this._identifier(e))},d.prototype.setDcsHandlerFallback=function(e){this._dcsParser.setHandlerFallback(e)},d.prototype.addOscHandler=function(e,t){return this._oscParser.addHandler(e,t)},d.prototype.setOscHandler=function(e,t){this._oscParser.setHandler(e,t)},d.prototype.clearOscHandler=function(e){this._oscParser.clearHandler(e)},d.prototype.setOscHandlerFallback=function(e){this._oscParser.setHandlerFallback(e)},d.prototype.setErrorHandler=function(e){this._errorHandler=e},d.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},d.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0},d.prototype.parse=function(e,t){for(var i=0,r=0,n=this.currentState,o=this._oscParser,s=this._dcsParser,a=this._collect,c=this._params,l=this.TRANSITIONS.table,h=0;h>4){case 2:for(var u=h+1;;++u){if(t<=u||(i=e[u])<32||126=t||(i=e[u])<32||126=t||(i=e[u])<32||126=t||(i=e[u])<32||126this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i},a);function a(e,t,i,r,n,o,s,a){var c=l.call(this,e,"text",t,n,i,o,s,a)||this;return c.bufferService=s,c.optionsService=a,c._characterWidth=0,c._characterFont="",c._characterOverlapCache={},c._workCell=new f.CellData,c._state=new h.GridCache,c._characterJoinerRegistry=r,c}t.TextRenderLayer=s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype.resize=function(e,t){for(var i=0;i>>24,n=t.rgba>>>16&255,o=t.rgba>>>8&255,s=0;s=this.capacity)i=this._head,this._unlinkNode(i),delete this._map[i.key],i.key=e,i.value=t,this._map[e]=i;else{var r=this._nodePool;0=this._bufferService.rows||s<0)){if(this._ctx.fillStyle=this._colors.selection.css,i){var a=e[0],c=t[0]-a,l=s-o+1;this._fillCells(a,o,c,l)}else{a=r===o?e[0]:0;var h=o===s?t[0]:this._bufferService.cols;this._fillCells(a,o,h-a,1);var u=Math.max(s-o-1,0);if(this._fillCells(0,o+1,this._bufferService.cols,u),o!==s){var f=n===s?t[0]:this._bufferService.cols;this._fillCells(0,s,f,1)}}this._state.start=[e[0],e[1]],this._state.end=[t[0],t[1]],this._state.columnSelectMode=i,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},s.prototype._didStateChange=function(e,t,i,r){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||i!==this._state.columnSelectMode||r!==this._state.ydisp},s.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]},s);function s(e,t,i,r,n,o){var s=a.call(this,e,"selection",t,!0,i,r,n,o)||this;return s.bufferService=n,s.optionsService=o,s._clearState(),s}t.SelectionRenderLayer=o},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var h,o=i(13),u=i(5),s=(h=o.BaseRenderLayer,n(a,h),a.prototype.resize=function(e){h.prototype.resize.call(this,e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},a.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},a.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRefreshRowsEvent.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},a.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRefreshRowsEvent.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},a.prototype.onOptionsChanged=function(){var e,t=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new c(this._coreBrowserService.isFocused,function(){t._render(!0)})):(null===(e=this._cursorBlinkStateManager)||void 0===e||e.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRefreshRowsEvent.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},a.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},a.prototype.onGridChanged=function(e,t){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},a.prototype._render=function(e){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var t=this._bufferService.buffer.ybase+this._bufferService.buffer.y,i=t-this._bufferService.buffer.ydisp;if(i<0||i>=this._bufferService.rows)this._clearCursor();else if(this._bufferService.buffer.lines.get(t).loadCell(this._bufferService.buffer.x,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var r=this._optionsService.options.cursorStyle;return r&&"block"!==r?this._cursorRenderers[r](this._bufferService.buffer.x,i,this._cell):this._renderBlurCursor(this._bufferService.buffer.x,i,this._cell),this._ctx.restore(),this._state.x=this._bufferService.buffer.x,this._state.y=i,this._state.isFocused=!1,this._state.style=r,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===i&&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,i,this._cell),this._ctx.restore(),this._state.x=this._bufferService.buffer.x,this._state.y=i,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}else this._clearCursor()},a.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})},a.prototype._renderBarCursor=function(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(e,t,this._optionsService.options.cursorWidth),this._ctx.restore()},a.prototype._renderBlockCursor=function(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(e,t,i.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(i,e,t),this._ctx.restore()},a.prototype._renderUnderlineCursor=function(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(e,t),this._ctx.restore()},a.prototype._renderBlurCursor=function(e,t,i){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(e,t,i.getWidth(),1),this._ctx.restore()},a);function a(e,t,i,r,n,o,s,a,c){var l=h.call(this,e,"cursor",t,!0,i,r,o,s)||this;return l._onRequestRefreshRowsEvent=n,l.bufferService=o,l.optionsService=s,l._coreService=a,l._coreBrowserService=c,l._cell=new u.CellData,l._state={x:0,y:0,isFocused:!1,style:"",width:0},l._cursorRenderers={bar:l._renderBarCursor.bind(l),block:l._renderBlockCursor.bind(l),underline:l._renderUnderlineCursor.bind(l)},l}t.CursorRenderLayer=s;var c=(Object.defineProperty(l.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),l.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)},l.prototype.restartBlinkAnimation=function(){var e=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){e._renderCallback(),e._animationFrame=void 0})))},l.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=setTimeout(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=void 0,0=e.lines.length)){for(var i=e.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,r=Math.ceil(2e3/this._bufferService.cols),n=this._bufferService.buffer.iterator(!1,t,i,r,r);n.hasNext();)for(var o=n.next(),s=0;s>9&511:void 0;a.validationCallback?a.validationCallback(t,function(e){l._rowsTimeoutId||e&&l._addLink(i[1],i[0]-l._bufferService.buffer.ydisp,t,a,n)}):f._addLink(i[1],i[0]-f._bufferService.buffer.ydisp,t,a,n)},f=this;null!==(c=h.exec(s))&&"break"!==e(););},o.prototype._addLink=function(e,t,i,r,n){var o=this;if(this._mouseZoneManager&&this._element){var s=this._unicodeService.getStringCellWidth(i),a=e%this._bufferService.cols,c=t+Math.floor(e/this._bufferService.cols),l=(a+s)%this._bufferService.cols,h=c+Math.floor((a+s)/this._bufferService.cols);0===l&&(l=this._bufferService.cols,h--),this._mouseZoneManager.add(new u(1+a,c+1,l+1,h+1,function(e){if(r.handler)return r.handler(e,i);var t=window.open();t?(t.opener=null,t.location.href=i):console.warn("Opening link blocked as opener could not be cleared")},function(){o._onLinkHover.fire(o._createLinkHoverEvent(a,c,l,h,n)),o._element.classList.add("xterm-cursor-pointer")},function(e){o._onLinkTooltip.fire(o._createLinkHoverEvent(a,c,l,h,n)),r.hoverTooltipCallback&&r.hoverTooltipCallback(e,i,{start:{x:a,y:c},end:{x:l,y:h}})},function(){o._onLinkLeave.fire(o._createLinkHoverEvent(a,c,l,h,n)),o._element.classList.remove("xterm-cursor-pointer"),r.hoverLeaveCallback&&r.hoverLeaveCallback()},function(e){return!r.willLinkActivate||r.willLinkActivate(e,i)}))}},o.prototype._createLinkHoverEvent=function(e,t,i,r,n){return{x1:e,y1:t,x2:i,y2:r,cols:this._bufferService.cols,fg:n}},o._timeBeforeLatency=200,o);function o(e,t,i,r){this._bufferService=e,this._logService=t,this._optionsService=i,this._unicodeService=r,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onLinkHover=new n.EventEmitter,this._onLinkLeave=new n.EventEmitter,this._onLinkTooltip=new n.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}t.Linkifier=r;var u=function(e,t,i,r,n,o,s,a,c){this.x1=e,this.y1=t,this.x2=i,this.y2=r,this.clickCallback=n,this.hoverCallback=o,this.tooltipCallback=s,this.leaveCallback=a,this.willLinkActivate=c};t.MouseZone=u},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(s=(o<3?n(s):3t[1]&&e[1]=t[0]&&e[0]=t[0]},v.prototype.selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=void 0,this.refresh(!0))},v.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},v.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()},v.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},v.prototype._getMouseBufferCoords=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t},v.prototype._getMouseEventScrollAmount=function(e){var t=a.getCoordsRelativeToElement(e,this._screenElement)[1],i=this._bufferService.rows*Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight);return 0<=t&&t<=i?0:(i=r;r++){var n=e.loadCell(r,this._workCell).getChars().length;0===this._workCell.getWidth()?i--:1=this._bufferService.cols)){var n=this._bufferService.buffer,o=n.lines.get(e[1]);if(o){var s=n.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(o,e),c=a,l=e[0]-a,h=0,u=0,f=0,_=0;if(" "===s.charAt(a)){for(;0this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}},v.prototype._isCharWordSeparator=function(e){return 0!==e.getWidth()&&0<=this._optionsService.options.wordSeparator.indexOf(e.getChars())},v.prototype._selectLineAt=function(e){var t=this._bufferService.buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._bufferService.cols,t.last],this._model.selectionStartLength=0},r([n(3,o.ICharSizeService),n(4,s.IBufferService),n(5,s.ICoreService),n(6,o.IMouseService),n(7,s.IOptionsService)],v));function v(e,t,i,r,n,o,s,a){var c=this;this._scrollLines=e,this._element=t,this._screenElement=i,this._charSizeService=r,this._bufferService=n,this._coreService=o,this._mouseService=s,this._optionsService=a,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new h.CellData,this._mouseDownTimeStamp=0,this._onLinuxMouseSelection=new u.EventEmitter,this._onRedrawRequest=new u.EventEmitter,this._onSelectionChange=new u.EventEmitter,this._mouseMoveListener=function(e){return c._onMouseMove(e)},this._mouseUpListener=function(e){return c._onMouseUp(e)},this._coreService.onUserInput(function(){c.hasSelection&&c.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(function(e){return c._onTrim(e)}),this._bufferService.buffers.onBufferActivate(function(e){return c._onBufferActivate(e)}),this.enable(),this._model=new l.SelectionModel(this._bufferService),this._activeSelectionMode=0}t.SelectionService=p},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(n.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(n.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())return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd;var e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}},enumerable:!0,configurable:!0}),n.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},n.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},n);function n(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}t.SelectionModel=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(12);function _(e,t,i,r){var n=e-d(i,e),o=t-d(i,t);return g(Math.abs(n-o)-function(e,t,i){for(var r=0,n=e-d(i,e),o=t-d(i,t),s=0;so.cols-1?(c+=o.buffer.translateBufferLineToString(a,!1,e,s),e=s=0,a++):!n&&s<0&&(c+=o.buffer.translateBufferLineToString(a,!1,0,e+1),e=s=o.cols-1,a--);return c+o.buffer.translateBufferLineToString(a,!1,e,s)}function v(e,t){var i=t?"O":"[";return r.C0.ESC+i+e}function g(e,t){e=Math.floor(e);for(var i="",r=0;re&&r.y1<=t+1||r.y2>e&&r.y2<=t+1||r.y1t+1)&&(this._currentZone&&this._currentZone===r&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(i--,1))}0===this._zones.length&&this._deactivate()}},_.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))},_.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))},_.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},_.prototype._onHover=function(e){var t=this,i=this._findZoneEventAt(e);i!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),i&&((this._currentZone=i).hoverCallback&&i.hoverCallback(e),this._tooltipTimeout=setTimeout(function(){return t._onTooltip(e)},500)))},_.prototype._onTooltip=function(e){this._tooltipTimeout=void 0;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},_.prototype._onMouseDown=function(e){var t;this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive&&(null===(t=this._findZoneEventAt(e))||void 0===t?void 0:t.willLinkActivate(e))&&(e.preventDefault(),e.stopImmediatePropagation())},_.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},_.prototype._onClick=function(e){var t=this._findZoneEventAt(e),i=this._getSelectionLength();t&&i===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},_.prototype._getSelectionLength=function(){var e=this._selectionService.selectionText;return e?e.length:0},_.prototype._findZoneEventAt=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(t)for(var i=t[0],r=t[1],n=0;n=o.x1&&i=o.x1||r===o.y2&&io.y1&&re;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},_.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},_.prototype._onTab=function(e){for(var t=0;tt;)this._rowContainer.removeChild(this._rowElements.pop())},m.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},m.prototype.onCharSizeChanged=function(){this._updateDimensions()},m.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},m.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},m.prototype.onSelectionChanged=function(e,t,i){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var r=e[1]-this._bufferService.buffer.ydisp,n=t[1]-this._bufferService.buffer.ydisp,o=Math.max(r,0),s=Math.min(n,this._bufferService.rows-1);if(!(o>=this._bufferService.rows||s<0)){var a=document.createDocumentFragment();if(i)a.appendChild(this._createSelectionElement(o,e[0],t[0],s-o+1));else{var c=r===o?e[0]:0,l=o===s?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,c,l));var h=s-o-1;if(a.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,h)),o!==s){var u=n===s?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(s,0,u))}}this._selectionContainer.appendChild(a)}}},m.prototype._createSelectionElement=function(e,t,i,r){void 0===r&&(r=1);var n=document.createElement("div");return n.style.height=r*this.dimensions.actualCellHeight+"px",n.style.top=e*this.dimensions.actualCellHeight+"px",n.style.left=t*this.dimensions.actualCellWidth+"px",n.style.width=this.dimensions.actualCellWidth*(i-t)+"px",n},m.prototype.onCursorMove=function(){},m.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},m.prototype.clear=function(){this._rowElements.forEach(function(e){return e.innerHTML=""})},m.prototype.renderRows=function(e,t){for(var i=this._bufferService.buffer.ybase+this._bufferService.buffer.y,r=this._bufferService.buffer.x,n=this._optionsService.options.cursorBlink,o=e;o<=t;o++){var s=this._rowElements[o];s.innerHTML="";var a=o+this._bufferService.buffer.ydisp,c=this._bufferService.buffer.lines.get(a),l=this._optionsService.options.cursorStyle;s.appendChild(this._rowFactory.createRow(c,a===i,l,r,n,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(m.prototype,"_terminalSelector",{get:function(){return"."+p+this._terminalClass},enumerable:!0,configurable:!0}),m.prototype.registerCharacterJoiner=function(e){return-1},m.prototype.deregisterCharacterJoiner=function(e){return!1},m.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},m.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},m.prototype._setCellUnderline=function(e,t,i,r,n,o){for(;e!==t||i!==r;){var s=this._rowElements[i];if(!s)return;var a=s.children[e];a&&(a.style.textDecoration=o?"underline":"none"),++e>=n&&(e=0,i++)}},o([s(5,u.ICharSizeService),s(6,f.IOptionsService),s(7,f.IBufferService)],m));function m(e,t,i,r,n,o,s,a){var c=l.call(this)||this;return c._colors=e,c._element=t,c._screenElement=i,c._viewportElement=r,c._linkifier=n,c._charSizeService=o,c._optionsService=s,c._bufferService=a,c._terminalClass=y++,c._rowElements=[],c._onRequestRefreshRows=new _.EventEmitter,c._rowContainer=document.createElement("div"),c._rowContainer.classList.add(v),c._rowContainer.style.lineHeight="normal",c._rowContainer.setAttribute("aria-hidden","true"),c._refreshRowElements(c._bufferService.cols,c._bufferService.rows),c._selectionContainer=document.createElement("div"),c._selectionContainer.classList.add(g),c._selectionContainer.setAttribute("aria-hidden","true"),c.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},c._updateDimensions(),c._injectCss(),c._rowFactory=new h.DomRendererRowFactory(document,c._optionsService,c._colors),c._element.classList.add(p+c._terminalClass),c._screenElement.appendChild(c._rowContainer),c._screenElement.appendChild(c._selectionContainer),c._linkifier.onLinkHover(function(e){return c._onLinkHover(e)}),c._linkifier.onLinkLeave(function(e){return c._onLinkLeave(e)}),c}t.DomRenderer=b},function(e,m,t){"use strict";Object.defineProperty(m,"__esModule",{value:!0});var S=t(9),C=t(3),r=t(5),w=t(10);m.BOLD_CLASS="xterm-bold",m.DIM_CLASS="xterm-dim",m.ITALIC_CLASS="xterm-italic",m.UNDERLINE_CLASS="xterm-underline",m.CURSOR_CLASS="xterm-cursor",m.CURSOR_BLINK_CLASS="xterm-cursor-blink",m.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",m.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",m.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var i=(n.prototype.setColors=function(e){this._colors=e},n.prototype.createRow=function(e,t,i,r,n,o,s){for(var a=this._document.createDocumentFragment(),c=0,l=Math.min(e.length,s)-1;0<=l;l--)if(e.loadCell(l,this._workCell).getCode()!==C.NULL_CELL_CODE||t&&l===r){c=l+1;break}for(l=0;l>16&255,f>>8&255,255&f);this._applyMinimumContrast(u,this._colors.background,b)||this._addStyle(u,"color:#"+E(f.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(u,this._colors.background,this._colors.foreground)||v&&u.classList.add("xterm-fg-"+S.INVERTED_DEFAULT_COLOR)}switch(p){case 16777216:case 33554432:u.classList.add("xterm-bg-"+d);break;case 50331648:this._addStyle(u,"background-color:#"+E(d.toString(16),"0",6));break;case 0:default:v&&u.classList.add("xterm-bg-"+S.INVERTED_DEFAULT_COLOR)}a.appendChild(u)}}return a},n.prototype._applyMinimumContrast=function(e,t,i){if(1===this._optionsService.options.minimumContrastRatio)return!1;var r=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return void 0===r&&(r=w.color.ensureContrastRatio(t,i,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,null!=r?r:null)),!!r&&(this._addStyle(e,"color:"+r.css),!0)},n.prototype._addStyle=function(e,t){e.setAttribute("style",""+(e.getAttribute("style")||"")+t+";")},n);function n(e,t,i){this._document=e,this._optionsService=t,this._colors=i,this._workCell=new r.CellData}function E(e,t,i){for(;e.length"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(e,t,i,r){var n={type:0,cancel:!1,key:void 0},o=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?n.key=t?l.C0.ESC+"OA":l.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?n.key=t?l.C0.ESC+"OD":l.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?n.key=t?l.C0.ESC+"OC":l.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(n.key=t?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:if(e.shiftKey){n.key=l.C0.BS;break}if(e.altKey){n.key=l.C0.ESC+l.C0.DEL;break}n.key=l.C0.DEL;break;case 9:if(e.shiftKey){n.key=l.C0.ESC+"[Z";break}n.key=l.C0.HT,n.cancel=!0;break;case 13:n.key=l.C0.CR,n.cancel=!0;break;case 27:n.key=l.C0.ESC,n.cancel=!0;break;case 37:if(e.metaKey)break;o?(n.key=l.C0.ESC+"[1;"+(1+o)+"D",n.key===l.C0.ESC+"[1;3D"&&(n.key=l.C0.ESC+(i?"b":"[1;5D"))):n.key=t?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(e.metaKey)break;o?(n.key=l.C0.ESC+"[1;"+(1+o)+"C",n.key===l.C0.ESC+"[1;3C"&&(n.key=l.C0.ESC+(i?"f":"[1;5C"))):n.key=t?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(e.metaKey)break;o?(n.key=l.C0.ESC+"[1;"+(1+o)+"A",i||n.key!==l.C0.ESC+"[1;3A"||(n.key=l.C0.ESC+"[1;5A")):n.key=t?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(e.metaKey)break;o?(n.key=l.C0.ESC+"[1;"+(1+o)+"B",i||n.key!==l.C0.ESC+"[1;3B"||(n.key=l.C0.ESC+"[1;5B")):n.key=t?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(n.key=l.C0.ESC+"[2~");break;case 46:n.key=o?l.C0.ESC+"[3;"+(1+o)+"~":l.C0.ESC+"[3~";break;case 36:n.key=o?l.C0.ESC+"[1;"+(1+o)+"H":t?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:n.key=o?l.C0.ESC+"[1;"+(1+o)+"F":t?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:e.shiftKey?n.type=2:n.key=l.C0.ESC+"[5~";break;case 34:e.shiftKey?n.type=3:n.key=l.C0.ESC+"[6~";break;case 112:n.key=o?l.C0.ESC+"[1;"+(1+o)+"P":l.C0.ESC+"OP";break;case 113:n.key=o?l.C0.ESC+"[1;"+(1+o)+"Q":l.C0.ESC+"OQ";break;case 114:n.key=o?l.C0.ESC+"[1;"+(1+o)+"R":l.C0.ESC+"OR";break;case 115:n.key=o?l.C0.ESC+"[1;"+(1+o)+"S":l.C0.ESC+"OS";break;case 116:n.key=o?l.C0.ESC+"[15;"+(1+o)+"~":l.C0.ESC+"[15~";break;case 117:n.key=o?l.C0.ESC+"[17;"+(1+o)+"~":l.C0.ESC+"[17~";break;case 118:n.key=o?l.C0.ESC+"[18;"+(1+o)+"~":l.C0.ESC+"[18~";break;case 119:n.key=o?l.C0.ESC+"[19;"+(1+o)+"~":l.C0.ESC+"[19~";break;case 120:n.key=o?l.C0.ESC+"[20;"+(1+o)+"~":l.C0.ESC+"[20~";break;case 121:n.key=o?l.C0.ESC+"[21;"+(1+o)+"~":l.C0.ESC+"[21~";break;case 122:n.key=o?l.C0.ESC+"[23;"+(1+o)+"~":l.C0.ESC+"[23~";break;case 123:n.key=o?l.C0.ESC+"[24;"+(1+o)+"~":l.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(i&&!r||!e.altKey||e.metaKey)i&&!e.altKey&&!e.ctrlKey&&e.metaKey?65===e.keyCode&&(n.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&48<=e.keyCode&&1===e.key.length?n.key=e.key:e.key&&e.ctrlKey&&"_"===e.key&&(n.key=l.C0.US);else{var s=h[e.keyCode],a=s&&s[e.shiftKey?1:0];if(a)n.key=l.C0.ESC+a;else if(65<=e.keyCode&&e.keyCode<=90){var c=e.ctrlKey?e.keyCode-64:e.keyCode+32;n.key=l.C0.ESC+String.fromCharCode(c)}}else 65<=e.keyCode&&e.keyCode<=90?n.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?n.key=l.C0.NUL:51<=e.keyCode&&e.keyCode<=55?n.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?n.key=l.C0.DEL:219===e.keyCode?n.key=l.C0.ESC:220===e.keyCode?n.key=l.C0.FS:221===e.keyCode&&(n.key=l.C0.GS)}return n}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(3);t.updateWindowsModeWrappedState=function(e){var t,i=null===(t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))||void 0===t?void 0:t.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&i&&(r.isWrapped=i[n.CHAR_DATA_CODE_INDEX]!==n.NULL_CELL_CODE&&i[n.CHAR_DATA_CODE_INDEX]!==n.WHITESPACE_CELL_CODE)}},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__decorate||function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(s=(o<3?n(s):3this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return 0<=e&&ei.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:t},l.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=M.DEFAULT_ATTR_DATA);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},l.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},l.prototype.resize=function(e,t){var i=this.getNullCell(M.DEFAULT_ATTR_DATA),r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),0t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(re))for(n=0;nthis._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},l.prototype._reflowLarger=function(e,t){var i=P.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(M.DEFAULT_ATTR_DATA));if(0A+k){for(var D=x.newLines.length-1;0<=D;D--)this.lines.set(d--,x.newLines[D]);d++,w.push({index:A+1,amount:x.newLines.length}),k+=x.newLines.length,x=r[++R]}else this.lines.set(d,E[A--]);var T=0;for(d=w.length-1;0<=d;d--)w[d].index+=T,this.lines.onInsertEmitter.fire(w[d]),T+=w[d].amount;var O=Math.max(0,L+n-this.lines.maxLength);0=this._cols?this._cols-1:e<0?0:e},l.prototype.nextStop=function(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e},l.prototype.addMarker=function(e){var t=this,i=new o.Marker(e);return this.markers.push(i),i.register(this.lines.onTrim(function(e){i.line-=e,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(function(e){i.line>=e.index&&(i.line+=e.amount)})),i.register(this.lines.onDelete(function(e){i.line>=e.index&&i.linee.index&&(i.line-=e.amount)})),i.register(i.onDispose(function(){return t._removeMarker(i)})),i},l.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},l.prototype.iterator=function(e,t,i,r,n){return new h(this,e,t,i,r,n)},l);function l(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=M.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=n.CellData.fromCharData([0,s.NULL_CELL_CHAR,s.NULL_CELL_WIDTH,s.NULL_CELL_CODE]),this._whitespaceCell=n.CellData.fromCharData([0,s.WHITESPACE_CELL_CHAR,s.WHITESPACE_CELL_WIDTH,s.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}i.Buffer=c;var h=(u.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);for(var t="",i=e.first;i<=e.last;++i)t+=this._buffer.translateBufferLineToString(i,this._trimRight);return this._current=e.last+1,{range:e,content:t}},u);function u(e,t,i,r,n,o){void 0===i&&(i=0),void 0===r&&(r=e.lines.length),void 0===n&&(n=0),void 0===o&&(o=0),this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=r,this._startOverscan=n,this._endOverscan=o,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}i.BufferStringIterator=h},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(1),n=(Object.defineProperty(o.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"maxLength",{get:function(){return this._maxLength},set:function(e){if(this._maxLength!==e){for(var t=new Array(e),i=0;ithis._length)for(var t=this._length;tthis._maxLength){var o=this._length+i.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=i.length},o.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)},o.prototype.shiftElements=function(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(0this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(r=0;rthis._end&&(this._end=e)},a.prototype.markRangeDirty=function(e,t){if(tthis._end&&(this._end=t)},a.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},r([n(0,o.IBufferService)],a));function a(e){this._bufferService=e,this.clearRange()}t.DirtyRowService=s},function(e,t,i){"use strict";var h=this&&this.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._compareEvents(this._lastEvent,e))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;var t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0},f.prototype.explainEvents=function(e){return{DOWN:!!(1&e),UP:!!(2&e),DRAG:!!(4&e),MOVE:!!(8&e),WHEEL:!!(16&e)}},f.prototype._compareEvents=function(e,t){return e.col===t.col&&e.row===t.row&&e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift},r([n(0,o.IBufferService),n(1,o.ICoreService)],f));function f(e,t){var i=this;this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new s.EventEmitter,this._lastEvent=null,Object.keys(a).forEach(function(e){return i.addProtocol(e,a[e])}),Object.keys(h).forEach(function(e){return i.addEncoding(e,h[e])}),this.reset()}t.CoreMouseService=u},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype.writeSync=function(e){if(this._writeBuffer.length){for(var t=this._bufferOffset;tthis._bufferOffset;){var i=this._writeBuffer[this._bufferOffset],r=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(i),this._pendingData-=i.length,r&&r(),12<=Date.now()-t)break}this._writeBuffer.length>this._bufferOffset?(50=i)return t+this.wcwidth(n);var o=e.charCodeAt(r);56320<=o&&o<=57343?n=1024*(n-55296)+o-56320+65536:t+=this.wcwidth(o)}t+=this.wcwidth(n)}return t},s);function s(){this._providers=Object.create(null),this._active="",this._onChange=new r.EventEmitter;var e=new n.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}t.UnicodeService=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,n=i(15),o=[[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]],s=[[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]],a=(c.prototype.wcwidth=function(e){return e<32?0:e<127?1:e<65536?r[e]:function(e,t){var i,r=0,n=t.length-1;if(et[n][1])return 0;for(;r<=n;)if(e>t[i=r+n>>1][1])r=1+i;else{if(!(e