|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{"/POA":function(ne,K,W){!function(B,c){if(!0)ne.exports=c();else var w,f}(window,function(){return function(B){var c={};function w(f){if(c[f])return c[f].exports;var g=c[f]={i:f,l:!1,exports:{}};return B[f].call(g.exports,g,g.exports,w),g.l=!0,g.exports}return w.m=B,w.c=c,w.d=function(f,g,u){w.o(f,g)||Object.defineProperty(f,g,{enumerable:!0,get:u})},w.r=function(f){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(f,"__esModule",{value:!0})},w.t=function(f,g){if(1&g&&(f=w(f)),8&g)return f;if(4&g&&typeof f=="object"&&f&&f.__esModule)return f;var u=Object.create(null);if(w.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:f}),2&g&&typeof f!="string")for(var l in f)w.d(u,l,function(d){return f[d]}.bind(null,l));return u},w.n=function(f){var g=f&&f.__esModule?function(){return f.default}:function(){return f};return w.d(g,"a",g),g},w.o=function(f,g){return Object.prototype.hasOwnProperty.call(f,g)},w.p="",w(w.s=34)}([function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.forwardEvent=c.EventEmitter=void 0;var f=function(){function g(){this._listeners=[],this._disposed=!1}return Object.defineProperty(g.prototype,"event",{get:function(){var u=this;return this._event||(this._event=function(l){return u._listeners.push(l),{dispose:function(){if(!u._disposed){for(var d=0;d<u._listeners.length;d++)if(u._listeners[d]===l)return void u._listeners.splice(d,1)}}}}),this._event},enumerable:!1,configurable:!0}),g.prototype.fire=function(u,l){for(var d=[],_=0;_<this._listeners.length;_++)d.push(this._listeners[_]);for(_=0;_<d.length;_++)d[_].call(void 0,u,l)},g.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},g}();c.EventEmitter=f,c.forwardEvent=function(g,u){return g(function(l){return u.fire(l)})}},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.IUnicodeService=c.IOptionsService=c.ILogService=c.IInstantiationService=c.IDirtyRowService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;var f=w(14);c.IBufferService=f.createDecorator("BufferService"),c.ICoreMouseService=f.createDecorator("CoreMouseService"),c.ICoreService=f.createDecorator("CoreService"),c.ICharsetService=f.createDecorator("CharsetService"),c.IDirtyRowService=f.createDecorator("DirtyRowService"),c.IInstantiationService=f.createDecorator("InstantiationService"),c.ILogService=f.createDecorator("LogService"),c.IOptionsService=f.createDecorator("OptionsService"),c.IUnicodeService=f.createDecorator("UnicodeService")},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.getDisposeArrayDisposable=c.disposeArray=c.Disposable=void 0;var f=function(){function u(){this._disposables=[],this._isDisposed=!1}return u.prototype.dispose=function(){this._isDisposed=!0;for(var l=0,d=this._disposables;l<d.length;l++)d[l].dispose();this._disposables.length=0},u.prototype.register=function(l){return this._disposables.push(l),l},u.prototype.unregister=function(l){var d=this._disposables.indexOf(l);d!==-1&&this._disposables.splice(d,1)},u}();function g(u){for(var l=0,d=u;l<d.length;l++)d[l].dispose();u.length=0}c.Disposable=f,c.disposeArray=g,c.getDisposeArrayDisposable=function(u){return{dispose:function(){return g(u)}}}},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.WHITESPACE_CELL_CODE=c.WHITESPACE_CELL_WIDTH=c.WHITESPACE_CELL_CHAR=c.NULL_CELL_CODE=c.NULL_CELL_WIDTH=c.NULL_CELL_CHAR=c.CHAR_DATA_CODE_INDEX=c.CHAR_DATA_WIDTH_INDEX=c.CHAR_DATA_CHAR_INDEX=c.CHAR_DATA_ATTR_INDEX=c.DEFAULT_ATTR=c.DEFAULT_COLOR=void 0,c.DEFAULT_COLOR=256,c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,c.CHAR_DATA_ATTR_INDEX=0,c.CHAR_DATA_CHAR_INDEX=1,c.CHAR_DATA_WIDTH_INDEX=2,c.CHAR_DATA_CODE_INDEX=3,c.NULL_CELL_CHAR="",c.NULL_CELL_WIDTH=1,c.NULL_CELL_CODE=0,c.WHITESPACE_CELL_CHAR=" ",c.WHITESPACE_CELL_WIDTH=1,c.WHITESPACE_CELL_CODE=32},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(o,n){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,t){a.__proto__=t}||function(a,t){for(var i in t)t.hasOwnProperty(i)&&(a[i]=t[i])})(o,n)},function(o,n){function a(){this.constructor=o}f(o,n),o.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)});Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;var u=w(8),l=w(3),d=w(6),_=function(o){function n(){var a=o!==null&&o.apply(this,arguments)||this;return a.content=0,a.fg=0,a.bg=0,a.extended=new d.ExtendedAttrs,a.combinedData="",a}return g(n,o),n.fromCharData=function(a){var t=new n;return t.setFromCharData(a),t},n.prototype.isCombined=function(){return 2097152&this.content},n.prototype.getWidth=function(){return this.content>>22},n.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?u.stringFromCodePoint(2097151&this.content):""},n.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},n.prototype.setFromCharData=function(a){this.fg=a[l.CHAR_DATA_ATTR_INDEX],this.bg=0;var t=!1;if(a[l.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(a[l.CHAR_DATA_CHAR_INDEX].length===2){var i=a[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){var e=a[l.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=e&&e<=57343?this.content=1024*(i-55296)+e-56320+65536|a[l.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=a[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[l.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=a[l.CHAR_DATA_CHAR_INDEX],this.content=2097152|a[l.CHAR_DATA_WIDTH_INDEX]<<22)},n.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},n}(d.AttributeData);c.CellData=_},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.ISoundService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;var f=w(14);c.ICharSizeService=f.createDecorator("CharSizeService"),c.ICoreBrowserService=f.createDecorator("CoreBrowserService"),c.IMouseService=f.createDecorator("MouseService"),c.IRenderService=f.createDecorator("RenderService"),c.ISelectionService=f.createDecorator("SelectionService"),c.ISoundService=f.createDecorator("SoundService")},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;var f=function(){function u(){this.fg=0,this.bg=0,this.extended=new g}return u.toColorRGB=function(l){return[l>>>16&255,l>>>8&255,255&l]},u.fromColorRGB=function(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]},u.prototype.clone=function(){var l=new u;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l},u.prototype.isInverse=function(){return 67108864&this.fg},u.prototype.isBold=function(){return 134217728&this.fg},u.prototype.isUnderline=function(){return 268435456&this.fg},u.prototype.isBlink=function(){return 536870912&this.fg},u.prototype.isInvisible=function(){return 1073741824&this.fg},u.prototype.isItalic=function(){return 67108864&this.bg},u.prototype.isDim=function(){return 134217728&this.bg},u.prototype.getFgColorMode=function(){return 50331648&this.fg},u.prototype.getBgColorMode=function(){return 50331648&this.bg},u.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},u.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},u.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},u.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},u.prototype.isFgDefault=function(){return(50331648&this.fg)==0},u.prototype.isBgDefault=function(){return(50331648&this.bg)==0},u.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},u.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},u.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},u.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},u.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},u.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},u.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},u.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},u.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},u.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},u.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},u}();c.AttributeData=f;var g=function(){function u(l,d){l===void 0&&(l=0),d===void 0&&(d=-1),this.underlineStyle=l,this.underlineColor=d}return u.prototype.clone=function(){return new u(this.underlineStyle,this.underlineColor)},u.prototype.isEmpty=function(){return this.underlineStyle===0},u}();c.ExtendedAttrs=g},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(f,g,u,l){f.addEventListener(g,u,l);var d=!1;return{dispose:function(){d||(d=!0,f.removeEventListener(g,u,l))}}}},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},c.utf32ToString=function(u,l,d){l===void 0&&(l=0),d===void 0&&(d=u.length);for(var _="",o=l;o<d;++o){var n=u[o];n>65535?(n-=65536,_+=String.fromCharCode(55296+(n>>10))+String.fromCharCode(n%1024+56320)):_+=String.fromCharCode(n)}return _};var f=function(){function u(){this._interim=0}return u.prototype.clear=function(){this._interim=0},u.prototype.decode=function(l,d){var _=l.length;if(!_)return 0;var o=0,n=0;this._interim&&(56320<=(i=l.charCodeAt(n++))&&i<=57343?d[o++]=1024*(this._interim-55296)+i-56320+65536:(d[o++]=this._interim,d[o++]=i),this._interim=0);for(var a=n;a<_;++a){var t=l.charCodeAt(a);if(55296<=t&&t<=56319){if(++a>=_)return this._interim=t,o;var i;56320<=(i=l.charCodeAt(a))&&i<=57343?d[o++]=1024*(t-55296)+i-56320+65536:(d[o++]=t,d[o++]=i)}else d[o++]=t}return o},u}();c.StringToUtf32=f;var g=function(){function u(){this.interim=new Uint8Array(3)}return u.prototype.clear=function(){this.interim.fill(0)},u.prototype.decode=function(l,d){var _=l.length;if(!_)return 0;var o,n,a,t,i=0,e=0,r=0;if(this.interim[0]){var s=!1,h=this.interim[0];h&=(224&h)==192?31:(240&h)==224?15:7;for(var y=0,S=void 0;(S=63&this.interim[++y])&&y<4;)h<<=6,h|=S;for(var v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,p=v-y;r<p;){if(r>=_)return 0;if((192&(S=l[r++]))!=128){r--,s=!0;break}this.interim[y++]=S,h<<=6,h|=63&S}s||(v===2?h<128?r--:d[i++]=h:v===3?h<2048||h>=55296&&h<=57343||(d[i++]=h):h<65536||h>1114111||(d[i++]=h)),this.interim.fill(0)}for(var E=_-4,A=r;A<_;){for(;!(!(A<E)||128&(o=l[A])||128&(n=l[A+1])||128&(a=l[A+2])||128&(t=l[A+3]));)d[i++]=o,d[i++]=n,d[i++]=a,d[i++]=t,A+=4;if((o=l[A++])<128)d[i++]=o;else if((224&o)==192){if(A>=_)return this.interim[0]=o,i;if((192&(n=l[A++]))!=128){A--;continue}if((e=(31&o)<<6|63&n)<128){A--;continue}d[i++]=e}else if((240&o)==224){if(A>=_)return this.interim[0]=o,i;if((192&(n=l[A++]))!=128){A--;continue}if(A>=_)return this.interim[0]=o,this.interim[1]=n,i;if((192&(a=l[A++]))!=128){A--;continue}if((e=(15&o)<<12|(63&n)<<6|63&a)<2048||e>=55296&&e<=57343)continue;d[i++]=e}else if((248&o)==240){if(A>=_)return this.interim[0]=o,i;if((192&(n=l[A++]))!=128){A--;continue}if(A>=_)return this.interim[0]=o,this.interim[1]=n,i;if((192&(a=l[A++]))!=128){A--;continue}if(A>=_)return this.interim[0]=o,this.interim[1]=n,this.interim[2]=a,i;if((192&(t=l[A++]))!=128){A--;continue}if((e=(7&o)<<18|(63&n)<<12|(63&a)<<6|63&t)<65536||e>1114111)continue;d[i++]=e}}return i},u}();c.Utf8ToUtf32=g},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.CHAR_ATLAS_CELL_SPACING=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0,c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.CHAR_ATLAS_CELL_SPACING=1},function(B,c,w){"use strict";var f,g,u,l;function d(o){var n=o.toString(16);return n.length<2?"0"+n:n}function _(o,n){return o<n?(n+.05)/(o+.05):(o+.05)/(n+.05)}Object.defineProperty(c,"__esModule",{value:!0}),c.contrastRatio=c.toPaddedHex=c.rgba=c.rgb=c.css=c.color=c.channels=void 0,function(o){o.toCss=function(n,a,t,i){return i!==void 0?"#"+d(n)+d(a)+d(t)+d(i):"#"+d(n)+d(a)+d(t)},o.toRgba=function(n,a,t,i){return i===void 0&&(i=255),(n<<24|a<<16|t<<8|i)>>>0}}(f=c.channels||(c.channels={})),(g=c.color||(c.color={})).blend=function(o,n){var a=(255&n.rgba)/255;if(a===1)return{css:n.css,rgba:n.rgba};var t=n.rgba>>24&255,i=n.rgba>>16&255,e=n.rgba>>8&255,r=o.rgba>>24&255,s=o.rgba>>16&255,h=o.rgba>>8&255,y=r+Math.round((t-r)*a),S=s+Math.round((i-s)*a),v=h+Math.round((e-h)*a);return{css:f.toCss(y,S,v),rgba:f.toRgba(y,S,v)}},g.isOpaque=function(o){return(255&o.rgba)==255},g.ensureContrastRatio=function(o,n,a){var t=l.ensureContrastRatio(o.rgba,n.rgba,a);if(t)return l.toColor(t>>24&255,t>>16&255,t>>8&255)},g.opaque=function(o){var n=(255|o.rgba)>>>0,a=l.toChannels(n),t=a[0],i=a[1],e=a[2];return{css:f.toCss(t,i,e),rgba:n}},g.opacity=function(o,n){var a=Math.round(255*n),t=l.toChannels(o.rgba),i=t[0],e=t[1],r=t[2];return{css:f.toCss(i,e,r,a),rgba:f.toRgba(i,e,r,a)}},(c.css||(c.css={})).toColor=function(o){switch(o.length){case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(o){function n(a,t,i){var e=a/255,r=t/255,s=i/255;return .2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))}o.relativeLuminance=function(a){return n(a>>16&255,a>>8&255,255&a)},o.relativeLuminance2=n}(u=c.rgb||(c.rgb={})),function(o){function n(t,i,e){for(var r=t>>24&255,s=t>>16&255,h=t>>8&255,y=i>>24&255,S=i>>16&255,v=i>>8&255,p=_(u.relativeLuminance2(y,v,S),u.relativeLuminance2(r,s,h));p<e&&(y>0||S>0||v>0);)y-=Math.max(0,Math.ceil(.1*y)),S-=Math.max(0,Math.ceil(.1*S)),v-=Math.max(0,Math.ceil(.1*v)),p=_(u.relativeLuminance2(y,v,S),u.relativeLuminance2(r,s,h));return(y<<24|S<<16|v<<8|255)>>>0}function a(t,i,e){for(var r=t>>24&255,s=t>>16&255,h=t>>8&255,y=i>>24&255,S=i>>16&255,v=i>>8&255,p=_(u.relativeLuminance2(y,v,S),u.relativeLuminance2(r,s,h));p<e&&(y<255||S<255||v<255);)y=Math.min(255,y+Math.ceil(.1*(255-y))),S=Math.min(255,S+Math.ceil(.1*(255-S))),v=Math.min(255,v+Math.ceil(.1*(255-v))),p=_(u.relativeLuminance2(y,v,S),u.relativeLuminance2(r,s,h));return(y<<24|S<<16|v<<8|255)>>>0}o.ensureContrastRatio=function(t,i,e){var r=u.relativeLuminance(t>>8),s=u.relativeLuminance(i>>8);if(_(r,s)<e)return s<r?n(t,i,e):a(t,i,e)},o.reduceLuminance=n,o.increaseLuminance=a,o.toChannels=function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]},o.toColor=function(t,i,e){return{css:f.toCss(t,i,e),rgba:f.toRgba(t,i,e)}}}(l=c.rgba||(c.rgba={})),c.toPaddedHex=d,c.contrastRatio=_},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.isLinux=c.isWindows=c.isIphone=c.isIpad=c.isMac=c.isSafari=c.isFirefox=void 0;var f=typeof navigator=="undefined",g=f?"node":navigator.userAgent,u=f?"node":navigator.platform;function l(d,_){return d.indexOf(_)>=0}c.isFirefox=!!~g.indexOf("Firefox"),c.isSafari=/^((?!chrome|android).)*safari/i.test(g),c.isMac=l(["Macintosh","MacIntel","MacPPC","Mac68K"],u),c.isIpad=u==="iPad",c.isIphone=u==="iPhone",c.isWindows=l(["Windows","Win16","Win32","WinCE"],u),c.isLinux=u.indexOf("Linux")>=0},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.C1=c.C0=void 0,function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
|
|
|
`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL="\x7F"}(c.C0||(c.C0={})),function(f){f.PAD="\x80",f.HOP="\x81",f.BPH="\x82",f.NBH="\x83",f.IND="\x84",f.NEL="\x85",f.SSA="\x86",f.ESA="\x87",f.HTS="\x88",f.HTJ="\x89",f.VTS="\x8A",f.PLD="\x8B",f.PLU="\x8C",f.RI="\x8D",f.SS2="\x8E",f.SS3="\x8F",f.DCS="\x90",f.PU1="\x91",f.PU2="\x92",f.STS="\x93",f.CCH="\x94",f.MW="\x95",f.SPA="\x96",f.EPA="\x97",f.SOS="\x98",f.SGCI="\x99",f.SCI="\x9A",f.CSI="\x9B",f.ST="\x9C",f.OSC="\x9D",f.PM="\x9E",f.APC="\x9F"}(c.C1||(c.C1={}))},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.BaseRenderLayer=void 0;var f=w(3),g=w(9),u=w(25),l=w(6),d=w(28),_=w(10),o=w(17),n=function(){function a(t,i,e,r,s,h,y,S){this._container=t,this._alpha=r,this._colors=s,this._rendererId=h,this._bufferService=y,this._optionsService=S,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-"+i+"-layer"),this._canvas.style.zIndex=e.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return a.prototype.dispose=function(){var t;o.removeElementFromParent(this._canvas),(t=this._charAtlas)===null||t===void 0||t.dispose()},a.prototype._initCanvas=function(){this._ctx=d.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},a.prototype.onOptionsChanged=function(){},a.prototype.onBlur=function(){},a.prototype.onFocus=function(){},a.prototype.onCursorMove=function(){},a.prototype.onGridChanged=function(t,i){},a.prototype.onSelectionChanged=function(t,i,e){e===void 0&&(e=!1)},a.prototype.setColors=function(t){this._refreshCharAtlas(t)},a.prototype._setTransparency=function(t){if(t!==this._alpha){var i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},a.prototype._refreshCharAtlas=function(t){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=u.acquireCharAtlas(this._optionsService.options,this._rendererId,t,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},a.prototype.resize=function(t){this._scaledCellWidth=t.scaledCellWidth,this._scaledCellHeight=t.scaledCellHeight,this._scaledCharWidth=t.scaledCharWidth,this._scaledCharHeight=t.scaledCharHeight,this._scaledCharLeft=t.scaledCharLeft,this._scaledCharTop=t.scaledCharTop,this._canvas.width=t.scaledCanvasWidth,this._canvas.height=t.scaledCanvasHeight,this._canvas.style.width=t.canvasWidth+"px",this._canvas.style.height=t.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},a.prototype._fillCells=function(t,i,e,r){this._ctx.fillRect(t*this._scaledCellWidth,i*this._scaledCellHeight,e*this._scaledCellWidth,r*this._scaledCellHeight)},a.prototype._fillBottomLineAtCells=function(t,i,e){e===void 0&&(e=1),this._ctx.fillRect(t*this._scaledCellWidth,(i+1)*this._scaledCellHeight-window.devicePixelRatio-1,e*this._scaledCellWidth,window.devicePixelRatio)},a.prototype._fillLeftLineAtCell=function(t,i,e){this._ctx.fillRect(t*this._scaledCellWidth,i*this._scaledCellHeight,window.devicePixelRatio*e,this._scaledCellHeight)},a.prototype._strokeRectAtCell=function(t,i,e,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(t*this._scaledCellWidth+window.devicePixelRatio/2,i*this._scaledCellHeight+window.devicePixelRatio/2,e*this._scaledCellWidth-window.devicePixelRatio,r*this._scaledCellHeight-window.devicePixelRatio)},a.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},a.prototype._clearCells=function(t,i,e,r){this._alpha?this._ctx.clearRect(t*this._scaledCellWidth,i*this._scaledCellHeight,e*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(t*this._scaledCellWidth,i*this._scaledCellHeight,e*this._scaledCellWidth,r*this._scaledCellHeight))},a.prototype._fillCharTrueColor=function(t,i,e){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(e),this._ctx.fillText(t.getChars(),i*this._scaledCellWidth+this._scaledCharLeft,e*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},a.prototype._drawChars=function(t,i,e){var r,s,h=this._getContrastColor(t);h||t.isFgRGB()||t.isBgRGB()?this._drawUncachedChars(t,i,e,h):(t.isInverse()?(r=t.isBgDefault()?g.INVERTED_DEFAULT_COLOR:t.getBgColor(),s=t.isFgDefault()?g.INVERTED_DEFAULT_COLOR:t.getFgColor()):(s=t.isBgDefault()?f.DEFAULT_COLOR:t.getBgColor(),r=t.isFgDefault()?f.DEFAULT_COLOR:t.getFgColor()),r+=this._optionsService.options.drawBoldTextInBrightColors&&t.isBold()&&r<8?8:0,this._currentGlyphIdentifier.chars=t.getChars()||f.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=t.getCode()||f.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=s,this._currentGlyphIdentifier.fg=r,this._currentGlyphIdentifier.bold=!!t.isBold(),this._currentGlyphIdentifier.dim=!!t.isDim(),this._currentGlyphIdentifier.italic=!!t.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,i*this._scaledCellWidth+this._scaledCharLeft,e*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(t,i,e))},a.prototype._drawUncachedChars=function(t,i,e,r){if(this._ctx.save(),this._ctx.font=this._getFont(!!t.isBold(),!!t.isItalic()),this._ctx.textBaseline="middle",t.isInverse())if(r)this._ctx.fillStyle=r.css;else if(t.isBgDefault())this._ctx.fillStyle=_.color.opaque(this._colors.background).css;else if(t.isBgRGB())this._ctx.fillStyle="rgb("+l.AttributeData.toColorRGB(t.getBgColor()).join(",")+")";else{var s=t.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&t.isBold()&&s<8&&(s+=8),this._ctx.fillStyle=this._colors.ansi[s].css}else if(r)this._ctx.fillStyle=r.css;else if(t.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(t.isFgRGB())this._ctx.fillStyle="rgb("+l.AttributeData.toColorRGB(t.getFgColor()).join(",")+")";else{var h=t.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&t.isBold()&&h<8&&(h+=8),this._ctx.fillStyle=this._colors.ansi[h].css}this._clipRow(e),t.isDim()&&(this._ctx.globalAlpha=g.DIM_OPACITY),this._ctx.fillText(t.getChars(),i*this._scaledCellWidth+this._scaledCharLeft,e*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},a.prototype._clipRow=function(t){this._ctx.beginPath(),this._ctx.rect(0,t*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},a.prototype._getFont=function(t,i){return(i?"italic":"")+" "+(t?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},a.prototype._getContrastColor=function(t){if(this._optionsService.options.minimumContrastRatio!==1){var i=this._colors.contrastCache.getColor(t.bg,t.fg);if(i!==void 0)return i||void 0;var e=t.getFgColor(),r=t.getFgColorMode(),s=t.getBgColor(),h=t.getBgColorMode(),y=!!t.isInverse(),S=!!t.isInverse();if(y){var v=e;e=s,s=v;var p=r;r=h,h=p}var E=this._resolveBackgroundRgba(h,s,y),A=this._resolveForegroundRgba(r,e,y,S),b=_.rgba.ensureContrastRatio(E,A,this._optionsService.options.minimumContrastRatio);if(b){var m={css:_.channels.toCss(b>>24&255,b>>16&255,b>>8&255),rgba:b};return this._colors.contrastCache.setColor(t.bg,t.fg,m),m}this._colors.contrastCache.setColor(t.bg,t.fg,null)}},a.prototype._resolveBackgroundRgba=function(t,i,e){switch(t){case 16777216:case 33554432:return this._colors.ansi[i].rgba;case 50331648:return i<<8;case 0:default:return e?this._colors.foreground.rgba:this._colors.background.rgba}},a.prototype._resolveForegroundRgba=function(t,i,e,r){switch(t){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&r&&i<8&&(i+=8),this._colors.ansi[i].rgba;case 50331648:return i<<8;case 0:default:return e?this._colors.background.rgba:this._colors.foreground.rgba}},a}();c.BaseRenderLayer=n},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;function f(g,u,l){u.di$target===u?u.di$dependencies.push({id:g,index:l}):(u.di$dependencies=[{id:g,index:l}],u.di$target=u)}c.serviceRegistry=new Map,c.getServiceDependencies=function(g){return g.di$dependencies||[]},c.createDecorator=function(g){if(c.serviceRegistry.has(g))return c.serviceRegistry.get(g);var u=function(l,d,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");f(u,l,_)};return u.toString=function(){return g},c.serviceRegistry.set(g,u),u}},function(B,c,w){"use strict";function f(g,u,l,d){if(l===void 0&&(l=0),d===void 0&&(d=g.length),l>=g.length)return g;l=(g.length+l)%g.length,d=d>=g.length?g.length:(g.length+d)%g.length;for(var _=l;_<d;++_)g[_]=u;return g}Object.defineProperty(c,"__esModule",{value:!0}),c.concat=c.fillFallback=c.fill=void 0,c.fill=function(g,u,l,d){return g.fill?g.fill(u,l,d):f(g,u,l,d)},c.fillFallback=f,c.concat=function(g,u){var l=new g.constructor(g.length+u.length);return l.set(g),l.set(u,g.length),l}},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;var f=w(8),g=w(3),u=w(4),l=w(6);c.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);var d=function(){function _(o,n,a){a===void 0&&(a=!1),this.isWrapped=a,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);for(var t=n||u.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]),i=0;i<o;++i)this.setCell(i,t);this.length=o}return _.prototype.get=function(o){var n=this._data[3*o+0],a=2097151&n;return[this._data[3*o+1],2097152&n?this._combined[o]:a?f.stringFromCodePoint(a):"",n>>22,2097152&n?this._combined[o].charCodeAt(this._combined[o].length-1):a]},_.prototype.set=function(o,n){this._data[3*o+1]=n[g.CHAR_DATA_ATTR_INDEX],n[g.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=n[1],this._data[3*o+0]=2097152|o|n[g.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=n[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|n[g.CHAR_DATA_WIDTH_INDEX]<<22},_.prototype.getWidth=function(o){return this._data[3*o+0]>>22},_.prototype.hasWidth=function(o){return 12582912&this._data[3*o+0]},_.prototype.getFg=function(o){return this._data[3*o+1]},_.prototype.getBg=function(o){return this._data[3*o+2]},_.prototype.hasContent=function(o){return 4194303&this._data[3*o+0]},_.prototype.getCodePoint=function(o){var n=this._data[3*o+0];return 2097152&n?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&n},_.prototype.isCombined=function(o){return 2097152&this._data[3*o+0]},_.prototype.getString=function(o){var n=this._data[3*o+0];return 2097152&n?this._combined[o]:2097151&n?f.stringFromCodePoint(2097151&n):""},_.prototype.loadCell=function(o,n){var a=3*o;return n.content=this._data[a+0],n.fg=this._data[a+1],n.bg=this._data[a+2],2097152&n.content&&(n.combinedData=this._combined[o]),268435456&n.bg&&(n.extended=this._extendedAttrs[o]),n},_.prototype.setCell=function(o,n){2097152&n.content&&(this._combined[o]=n.combinedData),268435456&n.bg&&(this._extendedAttrs[o]=n.extended),this._data[3*o+0]=n.content,this._data[3*o+1]=n.fg,this._data[3*o+2]=n.bg},_.prototype.setCellFromCodePoint=function(o,n,a,t,i,e){268435456&i&&(this._extendedAttrs[o]=e),this._data[3*o+0]=n|a<<22,this._data[3*o+1]=t,this._data[3*o+2]=i},_.prototype.addCodepointToCell=function(o,n){var a=this._data[3*o+0];2097152&a?this._combined[o]+=f.stringFromCodePoint(n):(2097151&a?(this._combined[o]=f.stringFromCodePoint(2097151&a)+f.stringFromCodePoint(n),a&=-2097152,a|=2097152):a=n|1<<22,this._data[3*o+0]=a)},_.prototype.insertCells=function(o,n,a,t){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new l.ExtendedAttrs),n<this.length-o){for(var i=new u.CellData,e=this.length-o-n-1;e>=0;--e)this.setCell(o+n+e,this.loadCell(o+e,i));for(e=0;e<n;++e)this.setCell(o+e,a)}else for(e=o;e<this.length;++e)this.setCell(e,a);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new l.ExtendedAttrs)},_.prototype.deleteCells=function(o,n,a,t){if(o%=this.length,n<this.length-o){for(var i=new u.CellData,e=0;e<this.length-o-n;++e)this.setCell(o+e,this.loadCell(o+n+e,i));for(e=this.length-n;e<this.length;++e)this.setCell(e,a)}else for(e=o;e<this.length;++e)this.setCell(e,a);o&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new l.ExtendedAttrs),this.getWidth(o)!==0||this.hasContent(o)||this.setCellFromCodePoint(o,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new l.ExtendedAttrs)},_.prototype.replaceCells=function(o,n,a,t){for(o&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o-1,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new l.ExtendedAttrs),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodePoint(n,0,1,(t==null?void 0:t.fg)||0,(t==null?void 0:t.bg)||0,(t==null?void 0:t.extended)||new l.ExtendedAttrs);o<n&&o<this.length;)this.setCell(o++,a)},_.prototype.resize=function(o,n){if(o!==this.length){if(o>this.length){var a=new Uint32Array(3*o);this.length&&(3*o<this._data.length?a.set(this._data.subarray(0,3*o)):a.set(this._data)),this._data=a;for(var t=this.length;t<o;++t)this.setCell(t,n)}else if(o){(a=new Uint32Array(3*o)).set(this._data.subarray(0,3*o)),this._data=a;var i=Object.keys(this._combined);for(t=0;t<i.length;t++){var e=parseInt(i[t],10);e>=o&&delete this._combined[e]}}else this._data=new Uint32Array(0),this._combined={};this.length=o}},_.prototype.fill=function(o){this._combined={},this._extendedAttrs={};for(var n=0;n<this.length;++n)this.setCell(n,o)},_.prototype.copyFrom=function(o){for(var n in this.length!==o.length?this._data=new Uint32Array(o._data):this._data.set(o._data),this.length=o.length,this._combined={},o._combined)this._combined[n]=o._combined[n];for(var n in this._extendedAttrs={},o._extendedAttrs)this._extendedAttrs[n]=o._extendedAttrs[n];this.isWrapped=o.isWrapped},_.prototype.clone=function(){var o=new _(0);for(var n in o._data=new Uint32Array(this._data),o.length=this.length,this._combined)o._combined[n]=this._combined[n];for(var n in this._extendedAttrs)o._extendedAttrs[n]=this._extendedAttrs[n];return o.isWrapped=this.isWrapped,o},_.prototype.getTrimmedLength=function(){for(var o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0])return o+(this._data[3*o+0]>>22);return 0},_.prototype.copyCellsFrom=function(o,n,a,t,i){var e=o._data;if(i)for(var r=t-1;r>=0;r--)for(var s=0;s<3;s++)this._data[3*(a+r)+s]=e[3*(n+r)+s];else for(r=0;r<t;r++)for(s=0;s<3;s++)this._data[3*(a+r)+s]=e[3*(n+r)+s];var h=Object.keys(o._combined);for(s=0;s<h.length;s++){var y=parseInt(h[s],10);y>=n&&(this._combined[y-n+a]=o._combined[y])}},_.prototype.translateToString=function(o,n,a){o===void 0&&(o=!1),n===void 0&&(n=0),a===void 0&&(a=this.length),o&&(a=Math.min(a,this.getTrimmedLength()));for(var t="";n<a;){var i=this._data[3*n+0],e=2097151&i;t+=2097152&i?this._combined[n]:e?f.stringFromCodePoint(e):g.WHITESPACE_CELL_CHAR,n+=i>>22||1}return t},_}();c.BufferLine=d},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.removeElementFromParent=void 0,c.removeElementFromParent=function(){for(var f,g=[],u=0;u<arguments.length;u++)g[u]=arguments[u];for(var l=0,d=g;l<d.length;l++){var _=d[l];(f=_==null?void 0:_.parentElement)===null||f===void 0||f.removeChild(_)}}},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.tooMuchOutput=c.promptLabel=void 0,c.promptLabel="Terminal input",c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(A,b){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,C){m.__proto__=C}||function(m,C){for(var D in C)C.hasOwnProperty(D)&&(m[D]=C[D])})(A,b)},function(A,b){function m(){this.constructor=A}f(A,b),A.prototype=b===null?Object.create(b):(m.prototype=b.prototype,new m)});Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;var u,l=w(12),d=w(20),_=w(39),o=w(2),n=w(15),a=w(8),t=w(16),i=w(0),e=w(3),r=w(4),s=w(6),h=w(22),y=w(24),S={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function v(A,b){if(A>24)return b.setWinLines||!1;switch(A){case 1:return!!b.restoreWin;case 2:return!!b.minimizeWin;case 3:return!!b.setWinPosition;case 4:return!!b.setWinSizePixels;case 5:return!!b.raiseWin;case 6:return!!b.lowerWin;case 7:return!!b.refreshWin;case 8:return!!b.setWinSizeChars;case 9:return!!b.maximizeWin;case 10:return!!b.fullscreenWin;case 11:return!!b.getWinState;case 13:return!!b.getWinPosition;case 14:return!!b.getWinSizePixels;case 15:return!!b.getScreenSizePixels;case 16:return!!b.getCellSizePixels;case 18:return!!b.getWinSizeChars;case 19:return!!b.getScreenSizeChars;case 20:return!!b.getIconTitle;case 21:return!!b.getWinTitle;case 22:return!!b.pushTitle;case 23:return!!b.popTitle;case 24:return!!b.setWinLines}return!1}!function(A){A[A.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",A[A.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(u=c.WindowsOptionsReportType||(c.WindowsOptionsReportType={}));var p=function(){function A(b,m,C,D){this._bufferService=b,this._coreService=m,this._logService=C,this._optionsService=D,this._data=new Uint32Array(0)}return A.prototype.hook=function(b){this._data=new Uint32Array(0)},A.prototype.put=function(b,m,C){this._data=n.concat(this._data,b.subarray(m,C))},A.prototype.unhook=function(b){if(b){var m=a.utf32ToString(this._data);switch(this._data=new Uint32Array(0),m){case'"q':return this._coreService.triggerDataEvent(l.C0.ESC+'P1$r0"q'+l.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(l.C0.ESC+'P1$r61;1"p'+l.C0.ESC+"\\");case"r":var C=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(l.C0.ESC+"P1$r"+C+l.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(l.C0.ESC+"P1$r0m"+l.C0.ESC+"\\");case" q":var D={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return D-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(l.C0.ESC+"P1$r"+D+" q"+l.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",m),this._coreService.triggerDataEvent(l.C0.ESC+"P0$r"+l.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},A}(),E=function(A){function b(m,C,D,x,T,M,P,q,N){N===void 0&&(N=new _.EscapeSequenceParser);var L=A.call(this)||this;L._bufferService=m,L._charsetService=C,L._coreService=D,L._dirtyRowService=x,L._logService=T,L._optionsService=M,L._coreMouseService=P,L._unicodeService=q,L._parser=N,L._parseBuffer=new Uint32Array(4096),L._stringDecoder=new a.StringToUtf32,L._utf8Decoder=new a.Utf8ToUtf32,L._workCell=new r.CellData,L._windowTitle="",L._iconName="",L._windowTitleStack=[],L._iconNameStack=[],L._curAttrData=t.DEFAULT_ATTR_DATA.clone(),L._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone(),L._onRequestBell=new i.EventEmitter,L._onRequestRefreshRows=new i.EventEmitter,L._onRequestReset=new i.EventEmitter,L._onRequestScroll=new i.EventEmitter,L._onRequestSyncScrollBar=new i.EventEmitter,L._onRequestWindowsOptionsReport=new i.EventEmitter,L._onA11yChar=new i.EventEmitter,L._onA11yTab=new i.EventEmitter,L._onCursorMove=new i.EventEmitter,L._onLineFeed=new i.EventEmitter,L._onScroll=new i.EventEmitter,L._onTitleChange=new i.EventEmitter,L.register(L._parser),L._parser.setCsiHandlerFallback(function(k,U){L._logService.debug("Unknown CSI code: ",{identifier:L._parser.identToString(k),params:U.toArray()})}),L._parser.setEscHandlerFallback(function(k){L._logService.debug("Unknown ESC code: ",{identifier:L._parser.identToString(k)})}),L._parser.setExecuteHandlerFallback(function(k){L._logService.debug("Unknown EXECUTE code: ",{code:k})}),L._parser.setOscHandlerFallback(function(k,U,z){L._logService.debug("Unknown OSC code: ",{identifier:k,action:U,data:z})}),L._parser.setDcsHandlerFallback(function(k,U,z){U==="HOOK"&&(z=z.toArray()),L._logService.debug("Unknown DCS code: ",{identifier:L._parser.identToString(k),action:U,payload:z})}),L._parser.setPrintHandler(function(k,U,z){return L.print(k,U,z)}),L._parser.setCsiHandler({final:"@"},function(k){return L.insertChars(k)}),L._parser.setCsiHandler({intermediates:" ",final:"@"},function(k){return L.scrollLeft(k)}),L._parser.setCsiHandler({final:"A"},function(k){return L.cursorUp(k)}),L._parser.setCsiHandler({intermediates:" ",final:"A"},function(k){return L.scrollRight(k)}),L._parser.setCsiHandler({final:"B"},function(k){return L.cursorDown(k)}),L._parser.setCsiHandler({final:"C"},function(k){return L.cursorForward(k)}),L._parser.setCsiHandler({final:"D"},function(k){return L.cursorBackward(k)}),L._parser.setCsiHandler({final:"E"},function(k){return L.cursorNextLine(k)}),L._parser.setCsiHandler({final:"F"},function(k){return L.cursorPrecedingLine(k)}),L._parser.setCsiHandler({final:"G"},function(k){return L.cursorCharAbsolute(k)}),L._parser.setCsiHandler({final:"H"},function(k){return L.cursorPosition(k)}),L._parser.setCsiHandler({final:"I"},function(k){return L.cursorForwardTab(k)}),L._parser.setCsiHandler({final:"J"},function(k){return L.eraseInDisplay(k)}),L._parser.setCsiHandler({prefix:"?",final:"J"},function(k){return L.eraseInDisplay(k)}),L._parser.setCsiHandler({final:"K"},function(k){return L.eraseInLine(k)}),L._parser.setCsiHandler({prefix:"?",final:"K"},function(k){return L.eraseInLine(k)}),L._parser.setCsiHandler({final:"L"},function(k){return L.insertLines(k)}),L._parser.setCsiHandler({final:"M"},function(k){return L.deleteLines(k)}),L._parser.setCsiHandler({final:"P"},function(k){return L.deleteChars(k)}),L._parser.setCsiHandler({final:"S"},function(k){return L.scrollUp(k)}),L._parser.setCsiHandler({final:"T"},function(k){return L.scrollDown(k)}),L._parser.setCsiHandler({final:"X"},function(k){return L.eraseChars(k)}),L._parser.setCsiHandler({final:"Z"},function(k){return L.cursorBackwardTab(k)}),L._parser.setCsiHandler({final:"`"},function(k){return L.charPosAbsolute(k)}),L._parser.setCsiHandler({final:"a"},function(k){return L.hPositionRelative(k)}),L._parser.setCsiHandler({final:"b"},function(k){return L.repeatPrecedingCharacter(k)}),L._parser.setCsiHandler({final:"c"},function(k){return L.sendDeviceAttributesPrimary(k)}),L._parser.setCsiHandler({prefix:">",final:"c"},function(k){return L.sendDeviceAttributesSecondary(k)}),L._parser.setCsiHandler({final:"d"},function(k){return L.linePosAbsolute(k)}),L._parser.setCsiHandler({final:"e"},function(k){return L.vPositionRelative(k)}),L._parser.setCsiHandler({final:"f"},function(k){return L.hVPosition(k)}),L._parser.setCsiHandler({final:"g"},function(k){return L.tabClear(k)}),L._parser.setCsiHandler({final:"h"},function(k){return L.setMode(k)}),L._parser.setCsiHandler({prefix:"?",final:"h"},function(k){return L.setModePrivate(k)}),L._parser.setCsiHandler({final:"l"},function(k){return L.resetMode(k)}),L._parser.setCsiHandler({prefix:"?",final:"l"},function(k){return L.resetModePrivate(k)}),L._parser.setCsiHandler({final:"m"},function(k){return L.charAttributes(k)}),L._parser.setCsiHandler({final:"n"},function(k){return L.deviceStatus(k)}),L._parser.setCsiHandler({prefix:"?",final:"n"},function(k){return L.deviceStatusPrivate(k)}),L._parser.setCsiHandler({intermediates:"!",final:"p"},function(k){return L.softReset(k)}),L._parser.setCsiHandler({intermediates:" ",final:"q"},function(k){return L.setCursorStyle(k)}),L._parser.setCsiHandler({final:"r"},function(k){return L.setScrollRegion(k)}),L._parser.setCsiHandler({final:"s"},function(k){return L.saveCursor(k)}),L._parser.setCsiHandler({final:"t"},function(k){return L.windowOptions(k)}),L._parser.setCsiHandler({final:"u"},function(k){return L.restoreCursor(k)}),L._parser.setCsiHandler({intermediates:"'",final:"}"},function(k){return L.insertColumns(k)}),L._parser.setCsiHandler({intermediates:"'",final:"~"},function(k){return L.deleteColumns(k)}),L._parser.setExecuteHandler(l.C0.BEL,function(){return L.bell()}),L._parser.setExecuteHandler(l.C0.LF,function(){return L.lineFeed()}),L._parser.setExecuteHandler(l.C0.VT,function(){return L.lineFeed()}),L._parser.setExecuteHandler(l.C0.FF,function(){return L.lineFeed()}),L._parser.setExecuteHandler(l.C0.CR,function(){return L.carriageReturn()}),L._parser.setExecuteHandler(l.C0.BS,function(){return L.backspace()}),L._parser.setExecuteHandler(l.C0.HT,function(){return L.tab()}),L._parser.setExecuteHandler(l.C0.SO,function(){return L.shiftOut()}),L._parser.setExecuteHandler(l.C0.SI,function(){return L.shiftIn()}),L._parser.setExecuteHandler(l.C1.IND,function(){return L.index()}),L._parser.setExecuteHandler(l.C1.NEL,function(){return L.nextLine()}),L._parser.setExecuteHandler(l.C1.HTS,function(){return L.tabSet()}),L._parser.setOscHandler(0,new h.OscHandler(function(k){L.setTitle(k),L.setIconName(k)})),L._parser.setOscHandler(1,new h.OscHandler(function(k){return L.setIconName(k)})),L._parser.setOscHandler(2,new h.OscHandler(function(k){return L.setTitle(k)})),L._parser.setEscHandler({final:"7"},function(){return L.saveCursor()}),L._parser.setEscHandler({final:"8"},function(){return L.restoreCursor()}),L._parser.setEscHandler({final:"D"},function(){return L.index()}),L._parser.setEscHandler({final:"E"},function(){return L.nextLine()}),L._parser.setEscHandler({final:"H"},function(){return L.tabSet()}),L._parser.setEscHandler({final:"M"},function(){return L.reverseIndex()}),L._parser.setEscHandler({final:"="},function(){return L.keypadApplicationMode()}),L._parser.setEscHandler({final:">"},function(){return L.keypadNumericMode()}),L._parser.setEscHandler({final:"c"},function(){return L.fullReset()}),L._parser.setEscHandler({final:"n"},function(){return L.setgLevel(2)}),L._parser.setEscHandler({final:"o"},function(){return L.setgLevel(3)}),L._parser.setEscHandler({final:"|"},function(){return L.setgLevel(3)}),L._parser.setEscHandler({final:"}"},function(){return L.setgLevel(2)}),L._parser.setEscHandler({final:"~"},function(){return L.setgLevel(1)}),L._parser.setEscHandler({intermediates:"%",final:"@"},function(){return L.selectDefaultCharset()}),L._parser.setEscHandler({intermediates:"%",final:"G"},function(){return L.selectDefaultCharset()});var O=function(k){R._parser.setEscHandler({intermediates:"(",final:k},function(){return L.selectCharset("("+k)}),R._parser.setEscHandler({intermediates:")",final:k},function(){return L.selectCharset(")"+k)}),R._parser.setEscHandler({intermediates:"*",final:k},function(){return L.selectCharset("*"+k)}),R._parser.setEscHandler({intermediates:"+",final:k},function(){return L.selectCharset("+"+k)}),R._parser.setEscHandler({intermediates:"-",final:k},function(){return L.selectCharset("-"+k)}),R._parser.setEscHandler({intermediates:".",final:k},function(){return L.selectCharset("."+k)}),R._parser.setEscHandler({intermediates:"/",final:k},function(){return L.selectCharset("/"+k)})},R=this;for(var I in d.CHARSETS)O(I);return L._parser.setEscHandler({intermediates:"#",final:"8"},function(){return L.screenAlignmentPattern()}),L._parser.setErrorHandler(function(k){return L._logService.error("Parsing error: ",k),k}),L._parser.setDcsHandler({intermediates:"$",final:"q"},new p(L._bufferService,L._coreService,L._logService,L._optionsService)),L}return g(b,A),Object.defineProperty(b.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),b.prototype.dispose=function(){A.prototype.dispose.call(this)},b.prototype.parse=function(m){var C=this._bufferService.buffer,D=C.x,x=C.y;if(this._logService.debug("parsing data",m),this._parseBuffer.length<m.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(m.length,131072))),this._dirtyRowService.clearRange(),m.length>131072)for(var T=0;T<m.length;T+=131072){var M=T+131072<m.length?T+131072:m.length,P=typeof m=="string"?this._stringDecoder.decode(m.substring(T,M),this._parseBuffer):this._utf8Decoder.decode(m.subarray(T,M),this._parseBuffer);this._parser.parse(this._parseBuffer,P)}else P=typeof m=="string"?this._stringDecoder.decode(m,this._parseBuffer):this._utf8Decoder.decode(m,this._parseBuffer),this._parser.parse(this._parseBuffer,P);(C=this._bufferService.buffer).x===D&&C.y===x||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},b.prototype.print=function(m,C,D){var x,T,M=this._bufferService.buffer,P=this._charsetService.charset,q=this._optionsService.options.screenReaderMode,N=this._bufferService.cols,L=this._coreService.decPrivateModes.wraparound,O=this._coreService.modes.insertMode,R=this._curAttrData,I=M.lines.get(M.ybase+M.y);this._dirtyRowService.markDirty(M.y),M.x&&D-C>0&&I.getWidth(M.x-1)===2&&I.setCellFromCodePoint(M.x-1,0,1,R.fg,R.bg,R.extended);for(var k=C;k<D;++k){if(x=m[k],T=this._unicodeService.wcwidth(x),x<127&&P){var U=P[String.fromCharCode(x)];U&&(x=U.charCodeAt(0))}if(q&&this._onA11yChar.fire(a.stringFromCodePoint(x)),T||!M.x){if(M.x+T-1>=N){if(L){for(;M.x<N;)I.setCellFromCodePoint(M.x++,0,1,R.fg,R.bg,R.extended);M.x=0,M.y++,M.y===M.scrollBottom+1?(M.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(M.y>=this._bufferService.rows&&(M.y=this._bufferService.rows-1),M.lines.get(M.ybase+M.y).isWrapped=!0),I=M.lines.get(M.ybase+M.y)}else if(M.x=N-1,T===2)continue}if(O&&(I.insertCells(M.x,T,M.getNullCell(R),R),I.getWidth(N-1)===2&&I.setCellFromCodePoint(N-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,R.fg,R.bg,R.extended)),I.setCellFromCodePoint(M.x++,x,T,R.fg,R.bg,R.extended),T>0)for(;--T;)I.setCellFromCodePoint(M.x++,0,0,R.fg,R.bg,R.extended)}else I.getWidth(M.x-1)?I.addCodepointToCell(M.x-1,x):I.addCodepointToCell(M.x-2,x)}D-C>0&&(I.loadCell(M.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),M.x<N&&D-C>0&&I.getWidth(M.x)===0&&!I.hasContent(M.x)&&I.setCellFromCodePoint(M.x,0,1,R.fg,R.bg,R.extended),this._dirtyRowService.markDirty(M.y)},b.prototype.addCsiHandler=function(m,C){var D=this;return m.final!=="t"||m.prefix||m.intermediates?this._parser.addCsiHandler(m,C):this._parser.addCsiHandler(m,function(x){return!v(x.params[0],D._optionsService.options.windowOptions)||C(x)})},b.prototype.addDcsHandler=function(m,C){return this._parser.addDcsHandler(m,new y.DcsHandler(C))},b.prototype.addEscHandler=function(m,C){return this._parser.addEscHandler(m,C)},b.prototype.addOscHandler=function(m,C){return this._parser.addOscHandler(m,new h.OscHandler(C))},b.prototype.bell=function(){this._onRequestBell.fire()},b.prototype.lineFeed=function(){var m=this._bufferService.buffer;this._dirtyRowService.markDirty(m.y),this._optionsService.options.convertEol&&(m.x=0),m.y++,m.y===m.scrollBottom+1?(m.y--,this._onRequestScroll.fire(this._eraseAttrData())):m.y>=this._bufferService.rows&&(m.y=this._bufferService.rows-1),m.x>=this._bufferService.cols&&m.x--,this._dirtyRowService.markDirty(m.y),this._onLineFeed.fire()},b.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},b.prototype.backspace=function(){var m,C=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),void(C.x>0&&C.x--);if(this._restrictCursor(this._bufferService.cols),C.x>0)C.x--;else if(C.x===0&&C.y>C.scrollTop&&C.y<=C.scrollBottom&&((m=C.lines.get(C.ybase+C.y))===null||m===void 0?void 0:m.isWrapped)){C.lines.get(C.ybase+C.y).isWrapped=!1,C.y--,C.x=this._bufferService.cols-1;var D=C.lines.get(C.ybase+C.y);D.hasWidth(C.x)&&!D.hasContent(C.x)&&C.x--}this._restrictCursor()},b.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var m=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-m)}},b.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},b.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},b.prototype._restrictCursor=function(m){m===void 0&&(m=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(m,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)},b.prototype._setCursor=function(m,C){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=m,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+C):(this._bufferService.buffer.x=m,this._bufferService.buffer.y=C),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},b.prototype._moveCursor=function(m,C){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+m,this._bufferService.buffer.y+C)},b.prototype.cursorUp=function(m){var C=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;C>=0?this._moveCursor(0,-Math.min(C,m.params[0]||1)):this._moveCursor(0,-(m.params[0]||1))},b.prototype.cursorDown=function(m){var C=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;C>=0?this._moveCursor(0,Math.min(C,m.params[0]||1)):this._moveCursor(0,m.params[0]||1)},b.prototype.cursorForward=function(m){this._moveCursor(m.params[0]||1,0)},b.prototype.cursorBackward=function(m){this._moveCursor(-(m.params[0]||1),0)},b.prototype.cursorNextLine=function(m){this.cursorDown(m),this._bufferService.buffer.x=0},b.prototype.cursorPrecedingLine=function(m){this.cursorUp(m),this._bufferService.buffer.x=0},b.prototype.cursorCharAbsolute=function(m){this._setCursor((m.params[0]||1)-1,this._bufferService.buffer.y)},b.prototype.cursorPosition=function(m){this._setCursor(m.length>=2?(m.params[1]||1)-1:0,(m.params[0]||1)-1)},b.prototype.charPosAbsolute=function(m){this._setCursor((m.params[0]||1)-1,this._bufferService.buffer.y)},b.prototype.hPositionRelative=function(m){this._moveCursor(m.params[0]||1,0)},b.prototype.linePosAbsolute=function(m){this._setCursor(this._bufferService.buffer.x,(m.params[0]||1)-1)},b.prototype.vPositionRelative=function(m){this._moveCursor(0,m.params[0]||1)},b.prototype.hVPosition=function(m){this.cursorPosition(m)},b.prototype.tabClear=function(m){var C=m.params[0];C===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:C===3&&(this._bufferService.buffer.tabs={})},b.prototype.cursorForwardTab=function(m){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var C=m.params[0]||1;C--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},b.prototype.cursorBackwardTab=function(m){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var C=m.params[0]||1,D=this._bufferService.buffer;C--;)D.x=D.prevStop()},b.prototype._eraseInBufferLine=function(m,C,D,x){x===void 0&&(x=!1);var T=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+m);T.replaceCells(C,D,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),x&&(T.isWrapped=!1)},b.prototype._resetBufferLine=function(m){var C=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+m);C.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),C.isWrapped=!1},b.prototype.eraseInDisplay=function(m){var C;switch(this._restrictCursor(),m.params[0]){case 0:for(C=this._bufferService.buffer.y,this._dirtyRowService.markDirty(C),this._eraseInBufferLine(C++,this._bufferService.buffer.x,this._bufferService.cols,this._bufferService.buffer.x===0);C<this._bufferService.rows;C++)this._resetBufferLine(C);this._dirtyRowService.markDirty(C);break;case 1:for(C=this._bufferService.buffer.y,this._dirtyRowService.markDirty(C),this._eraseInBufferLine(C,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=this._bufferService.cols&&(this._bufferService.buffer.lines.get(C+1).isWrapped=!1);C--;)this._resetBufferLine(C);this._dirtyRowService.markDirty(0);break;case 2:for(C=this._bufferService.rows,this._dirtyRowService.markDirty(C-1);C--;)this._resetBufferLine(C);this._dirtyRowService.markDirty(0);break;case 3:var D=this._bufferService.buffer.lines.length-this._bufferService.rows;D>0&&(this._bufferService.buffer.lines.trimStart(D),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-D,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-D,0),this._onScroll.fire(0))}},b.prototype.eraseInLine=function(m){switch(this._restrictCursor(),m.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}this._dirtyRowService.markDirty(this._bufferService.buffer.y)},b.prototype.insertLines=function(m){this._restrictCursor();var C=m.params[0]||1,D=this._bufferService.buffer;if(!(D.y>D.scrollBottom||D.y<D.scrollTop)){for(var x=D.ybase+D.y,T=this._bufferService.rows-1-D.scrollBottom,M=this._bufferService.rows-1+D.ybase-T+1;C--;)D.lines.splice(M-1,1),D.lines.splice(x,0,D.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(D.y,D.scrollBottom),D.x=0}},b.prototype.deleteLines=function(m){this._restrictCursor();var C=m.params[0]||1,D=this._bufferService.buffer;if(!(D.y>D.scrollBottom||D.y<D.scrollTop)){var x,T=D.ybase+D.y;for(x=this._bufferService.rows-1-D.scrollBottom,x=this._bufferService.rows-1+D.ybase-x;C--;)D.lines.splice(T,1),D.lines.splice(x,0,D.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(D.y,D.scrollBottom),D.x=0}},b.prototype.insertChars=function(m){this._restrictCursor();var C=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);C&&(C.insertCells(this._bufferService.buffer.x,m.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},b.prototype.deleteChars=function(m){this._restrictCursor();var C=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);C&&(C.deleteCells(this._bufferService.buffer.x,m.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},b.prototype.scrollUp=function(m){for(var C=m.params[0]||1,D=this._bufferService.buffer;C--;)D.lines.splice(D.ybase+D.scrollTop,1),D.lines.splice(D.ybase+D.scrollBottom,0,D.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(D.scrollTop,D.scrollBottom)},b.prototype.scrollDown=function(m){for(var C=m.params[0]||1,D=this._bufferService.buffer;C--;)D.lines.splice(D.ybase+D.scrollBottom,1),D.lines.splice(D.ybase+D.scrollTop,0,D.getBlankLine(t.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(D.scrollTop,D.scrollBottom)},b.prototype.scrollLeft=function(m){var C=this._bufferService.buffer;if(!(C.y>C.scrollBottom||C.y<C.scrollTop)){for(var D=m.params[0]||1,x=C.scrollTop;x<=C.scrollBottom;++x){var T=C.lines.get(C.ybase+x);T.deleteCells(0,D,C.getNullCell(this._eraseAttrData()),this._eraseAttrData()),T.isWrapped=!1}this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom)}},b.prototype.scrollRight=function(m){var C=this._bufferService.buffer;if(!(C.y>C.scrollBottom||C.y<C.scrollTop)){for(var D=m.params[0]||1,x=C.scrollTop;x<=C.scrollBottom;++x){var T=C.lines.get(C.ybase+x);T.insertCells(0,D,C.getNullCell(this._eraseAttrData()),this._eraseAttrData()),T.isWrapped=!1}this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom)}},b.prototype.insertColumns=function(m){var C=this._bufferService.buffer;if(!(C.y>C.scrollBottom||C.y<C.scrollTop)){for(var D=m.params[0]||1,x=C.scrollTop;x<=C.scrollBottom;++x){var T=this._bufferService.buffer.lines.get(C.ybase+x);T.insertCells(C.x,D,C.getNullCell(this._eraseAttrData()),this._eraseAttrData()),T.isWrapped=!1}this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom)}},b.prototype.deleteColumns=function(m){var C=this._bufferService.buffer;if(!(C.y>C.scrollBottom||C.y<C.scrollTop)){for(var D=m.params[0]||1,x=C.scrollTop;x<=C.scrollBottom;++x){var T=C.lines.get(C.ybase+x);T.deleteCells(C.x,D,C.getNullCell(this._eraseAttrData()),this._eraseAttrData()),T.isWrapped=!1}this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom)}},b.prototype.eraseChars=function(m){this._restrictCursor();var C=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);C&&(C.replaceCells(this._bufferService.buffer.x,this._bufferService.buffer.x+(m.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},b.prototype.repeatPrecedingCharacter=function(m){if(this._parser.precedingCodepoint){for(var C=m.params[0]||1,D=new Uint32Array(C),x=0;x<C;++x)D[x]=this._parser.precedingCodepoint;this.print(D,0,D.length)}},b.prototype.sendDeviceAttributesPrimary=function(m){m.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c"))},b.prototype.sendDeviceAttributesSecondary=function(m){m.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(m.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c"))},b.prototype._is=function(m){return(this._optionsService.options.termName+"").indexOf(m)===0},b.prototype.setMode=function(m){for(var C=0;C<m.length;C++)switch(m.params[C]){case 4:this._coreService.modes.insertMode=!0}},b.prototype.setModePrivate=function(m){for(var C=0;C<m.length;C++)switch(m.params[C]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),this._charsetService.setgCharset(1,d.DEFAULT_CHARSET),this._charsetService.setgCharset(2,d.DEFAULT_CHARSET),this._charsetService.setgCharset(3,d.DEFAULT_CHARSET);break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0;break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}},b.prototype.resetMode=function(m){for(var C=0;C<m.length;C++)switch(m.params[C]){case 4:this._coreService.modes.insertMode=!1}},b.prototype.resetModePrivate=function(m){for(var C=0;C<m.length;C++)switch(m.params[C]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),m.params[C]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}},b.prototype._updateAttrColor=function(m,C,D,x,T){return C===2?(m|=50331648,m&=-16777216,m|=s.AttributeData.fromColorRGB([D,x,T])):C===5&&(m&=-50331904,m|=33554432|255&D),m},b.prototype._extractColor=function(m,C,D){var x=[0,0,-1,0,0,0],T=0,M=0;do{if(x[M+T]=m.params[C+M],m.hasSubParams(C+M)){var P=m.getSubParams(C+M),q=0;do x[1]===5&&(T=1),x[M+q+1+T]=P[q];while(++q<P.length&&q+M+1+T<x.length);break}if(x[1]===5&&M+T>=2||x[1]===2&&M+T>=5)break;x[1]&&(T=1)}while(++M+C<m.length&&M+T<x.length);for(q=2;q<x.length;++q)x[q]===-1&&(x[q]=0);switch(x[0]){case 38:D.fg=this._updateAttrColor(D.fg,x[1],x[3],x[4],x[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,x[1],x[3],x[4],x[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,x[1],x[3],x[4],x[5])}return M},b.prototype._processUnderline=function(m,C){C.extended=C.extended.clone(),(!~m||m>5)&&(m=1),C.extended.underlineStyle=m,C.fg|=268435456,m===0&&(C.fg&=-268435457),C.updateExtended()},b.prototype.charAttributes=function(m){if(m.length===1&&m.params[0]===0)return this._curAttrData.fg=t.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=t.DEFAULT_ATTR_DATA.bg);for(var C,D=m.length,x=this._curAttrData,T=0;T<D;T++)(C=m.params[T])>=30&&C<=37?(x.fg&=-50331904,x.fg|=16777216|C-30):C>=40&&C<=47?(x.bg&=-50331904,x.bg|=16777216|C-40):C>=90&&C<=97?(x.fg&=-50331904,x.fg|=16777224|C-90):C>=100&&C<=107?(x.bg&=-50331904,x.bg|=16777224|C-100):C===0?(x.fg=t.DEFAULT_ATTR_DATA.fg,x.bg=t.DEFAULT_ATTR_DATA.bg):C===1?x.fg|=134217728:C===3?x.bg|=67108864:C===4?(x.fg|=268435456,this._processUnderline(m.hasSubParams(T)?m.getSubParams(T)[0]:1,x)):C===5?x.fg|=536870912:C===7?x.fg|=67108864:C===8?x.fg|=1073741824:C===2?x.bg|=134217728:C===21?this._processUnderline(2,x):C===22?(x.fg&=-134217729,x.bg&=-134217729):C===23?x.bg&=-67108865:C===24?x.fg&=-268435457:C===25?x.fg&=-536870913:C===27?x.fg&=-67108865:C===28?x.fg&=-1073741825:C===39?(x.fg&=-67108864,x.fg|=16777215&t.DEFAULT_ATTR_DATA.fg):C===49?(x.bg&=-67108864,x.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):C===38||C===48||C===58?T+=this._extractColor(m,T,x):C===59?(x.extended=x.extended.clone(),x.extended.underlineColor=-1,x.updateExtended()):C===100?(x.fg&=-67108864,x.fg|=16777215&t.DEFAULT_ATTR_DATA.fg,x.bg&=-67108864,x.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",C)},b.prototype.deviceStatus=function(m){switch(m.params[0]){case 5:this._coreService.triggerDataEvent(l.C0.ESC+"[0n");break;case 6:var C=this._bufferService.buffer.y+1,D=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(l.C0.ESC+"["+C+";"+D+"R")}},b.prototype.deviceStatusPrivate=function(m){switch(m.params[0]){case 6:var C=this._bufferService.buffer.y+1,D=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(l.C0.ESC+"[?"+C+";"+D+"R")}},b.prototype.softReset=function(m){this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._bufferService.buffer.savedX=0,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1},b.prototype.setCursorStyle=function(m){var C=m.params[0]||1;switch(C){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var D=C%2==1;this._optionsService.options.cursorBlink=D},b.prototype.setScrollRegion=function(m){var C,D=m.params[0]||1;(m.length<2||(C=m.params[1])>this._bufferService.rows||C===0)&&(C=this._bufferService.rows),C>D&&(this._bufferService.buffer.scrollTop=D-1,this._bufferService.buffer.scrollBottom=C-1,this._setCursor(0,0))},b.prototype.windowOptions=function(m){if(v(m.params[0],this._optionsService.options.windowOptions)){var C=m.length>1?m.params[1]:0;switch(m.params[0]){case 14:C!==2&&this._onRequestWindowsOptionsReport.fire(u.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(u.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(l.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:C!==0&&C!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),C!==0&&C!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:C!==0&&C!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),C!==0&&C!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},b.prototype.saveCursor=function(m){this._bufferService.buffer.savedX=this._bufferService.buffer.x,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase+this._bufferService.buffer.y,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset},b.prototype.restoreCursor=function(m){this._bufferService.buffer.x=this._bufferService.buffer.savedX||0,this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0),this._curAttrData.fg=this._bufferService.buffer.savedCurAttrData.fg,this._curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._bufferService.buffer.savedCharset&&(this._charsetService.charset=this._bufferService.buffer.savedCharset),this._restrictCursor()},b.prototype.setTitle=function(m){this._windowTitle=m,this._onTitleChange.fire(m)},b.prototype.setIconName=function(m){this._iconName=m},b.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},b.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},b.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},b.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,d.DEFAULT_CHARSET)},b.prototype.selectCharset=function(m){m.length===2?m[0]!=="/"&&this._charsetService.setgCharset(S[m[0]],d.CHARSETS[m[1]]||d.DEFAULT_CHARSET):this.selectDefaultCharset()},b.prototype.index=function(){this._restrictCursor();var m=this._bufferService.buffer;this._bufferService.buffer.y++,m.y===m.scrollBottom+1?(m.y--,this._onRequestScroll.fire(this._eraseAttrData())):m.y>=this._bufferService.rows&&(m.y=this._bufferService.rows-1),this._restrictCursor()},b.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},b.prototype.reverseIndex=function(){this._restrictCursor();var m=this._bufferService.buffer;if(m.y===m.scrollTop){var C=m.scrollBottom-m.scrollTop;m.lines.shiftElements(m.ybase+m.y,C,1),m.lines.set(m.ybase+m.y,m.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(m.scrollTop,m.scrollBottom)}else m.y--,this._restrictCursor()},b.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},b.prototype.reset=function(){this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone()},b.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},b.prototype.setgLevel=function(m){this._charsetService.setgLevel(m)},b.prototype.screenAlignmentPattern=function(){var m=new r.CellData;m.content=1<<22|"E".charCodeAt(0),m.fg=this._curAttrData.fg,m.bg=this._curAttrData.bg;var C=this._bufferService.buffer;this._setCursor(0,0);for(var D=0;D<this._bufferService.rows;++D){var x=C.ybase+C.y+D,T=C.lines.get(x);T&&(T.fill(m),T.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},b}(o.Disposable);c.InputHandler=E},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.DEFAULT_CHARSET=c.CHARSETS=void 0,c.CHARSETS={},c.DEFAULT_CHARSET=c.CHARSETS.B,c.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},c.CHARSETS.A={"#":"\xA3"},c.CHARSETS.B=void 0,c.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},c.CHARSETS.C=c.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},c.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},c.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},c.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},c.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},c.CHARSETS.E=c.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},c.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},c.CHARSETS.H=c.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},c.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;var f=function(){function g(u,l){if(u===void 0&&(u=32),l===void 0&&(l=32),this.maxLength=u,this.maxSubParamsLength=l,l>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(l),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return g.fromArray=function(u){var l=new g;if(!u.length)return l;for(var d=u[0]instanceof Array?1:0;d<u.length;++d){var _=u[d];if(_ instanceof Array)for(var o=0;o<_.length;++o)l.addSubParam(_[o]);else l.addParam(_)}return l},g.prototype.clone=function(){var u=new g(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u},g.prototype.toArray=function(){for(var u=[],l=0;l<this.length;++l){u.push(this.params[l]);var d=this._subParamsIdx[l]>>8,_=255&this._subParamsIdx[l];_-d>0&&u.push(Array.prototype.slice.call(this._subParams,d,_))}return u},g.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},g.prototype.addParam=function(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>2147483647?2147483647:u}},g.prototype.addSubParam=function(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>2147483647?2147483647:u,this._subParamsIdx[this.length-1]++}},g.prototype.hasSubParams=function(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0},g.prototype.getSubParams=function(u){var l=this._subParamsIdx[u]>>8,d=255&this._subParamsIdx[u];return d-l>0?this._subParams.subarray(l,d):null},g.prototype.getSubParamsAll=function(){for(var u={},l=0;l<this.length;++l){var d=this._subParamsIdx[l]>>8,_=255&this._subParamsIdx[l];_-d>0&&(u[l]=this._subParams.slice(d,_))}return u},g.prototype.addDigit=function(u){var l;if(!(this._rejectDigits||!(l=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var d=this._digitIsSub?this._subParams:this.params,_=d[l-1];d[l-1]=~_?Math.min(10*_+u,2147483647):u}},g}();c.Params=f},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;var f=w(23),g=w(8),u=function(){function d(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return d.prototype.addHandler=function(_,o){this._handlers[_]===void 0&&(this._handlers[_]=[]);var n=this._handlers[_];return n.push(o),{dispose:function(){var a=n.indexOf(o);a!==-1&&n.splice(a,1)}}},d.prototype.setHandler=function(_,o){this._handlers[_]=[o]},d.prototype.clearHandler=function(_){this._handlers[_]&&delete this._handlers[_]},d.prototype.setHandlerFallback=function(_){this._handlerFb=_},d.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},d.prototype.reset=function(){this._state===2&&this.end(!1),this._id=-1,this._state=0},d.prototype._start=function(){var _=this._handlers[this._id];if(_)for(var o=_.length-1;o>=0;o--)_[o].start();else this._handlerFb(this._id,"START")},d.prototype._put=function(_,o,n){var a=this._handlers[this._id];if(a)for(var t=a.length-1;t>=0;t--)a[t].put(_,o,n);else this._handlerFb(this._id,"PUT",g.utf32ToString(_,o,n))},d.prototype._end=function(_){var o=this._handlers[this._id];if(o){for(var n=o.length-1;n>=0&&o[n].end(_)===!1;n--);for(n--;n>=0;n--)o[n].end(!1)}else this._handlerFb(this._id,"END",_)},d.prototype.start=function(){this.reset(),this._id=-1,this._state=1},d.prototype.put=function(_,o,n){if(this._state!==3){if(this._state===1)for(;o<n;){var a=_[o++];if(a===59){this._state=2,this._start();break}if(a<48||57<a)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+a-48}this._state===2&&n-o>0&&this._put(_,o,n)}},d.prototype.end=function(_){this._state!==0&&(this._state!==3&&(this._state===1&&this._start(),this._end(_)),this._id=-1,this._state=0)},d}();c.OscParser=u;var l=function(){function d(_){this._handler=_,this._data="",this._hitLimit=!1}return d.prototype.start=function(){this._data="",this._hitLimit=!1},d.prototype.put=function(_,o,n){this._hitLimit||(this._data+=g.utf32ToString(_,o,n),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},d.prototype.end=function(_){var o;return this._hitLimit?o=!1:_&&(o=this._handler(this._data)),this._data="",this._hitLimit=!1,o},d}();c.OscHandler=l},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;var f=w(8),g=w(21),u=w(23),l=[],d=function(){function o(){this._handlers=Object.create(null),this._active=l,this._ident=0,this._handlerFb=function(){}}return o.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},o.prototype.addHandler=function(n,a){this._handlers[n]===void 0&&(this._handlers[n]=[]);var t=this._handlers[n];return t.push(a),{dispose:function(){var i=t.indexOf(a);i!==-1&&t.splice(i,1)}}},o.prototype.setHandler=function(n,a){this._handlers[n]=[a]},o.prototype.clearHandler=function(n){this._handlers[n]&&delete this._handlers[n]},o.prototype.setHandlerFallback=function(n){this._handlerFb=n},o.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=l,this._ident=0},o.prototype.hook=function(n,a){if(this.reset(),this._ident=n,this._active=this._handlers[n]||l,this._active.length)for(var t=this._active.length-1;t>=0;t--)this._active[t].hook(a);else this._handlerFb(this._ident,"HOOK",a)},o.prototype.put=function(n,a,t){if(this._active.length)for(var i=this._active.length-1;i>=0;i--)this._active[i].put(n,a,t);else this._handlerFb(this._ident,"PUT",f.utf32ToString(n,a,t))},o.prototype.unhook=function(n){if(this._active.length){for(var a=this._active.length-1;a>=0&&this._active[a].unhook(n)===!1;a--);for(a--;a>=0;a--)this._active[a].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",n);this._active=l,this._ident=0},o}();c.DcsParser=d;var _=function(){function o(n){this._handler=n,this._data="",this._hitLimit=!1}return o.prototype.hook=function(n){this._params=n.clone(),this._data="",this._hitLimit=!1},o.prototype.put=function(n,a,t){this._hitLimit||(this._data+=f.utf32ToString(n,a,t),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},o.prototype.unhook=function(n){var a;return this._hitLimit?a=!1:n&&(a=this._handler(this._data,this._params||new g.Params)),this._params=void 0,this._data="",this._hitLimit=!1,a},o}();c.DcsHandler=_},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.removeTerminalFromCache=c.acquireCharAtlas=void 0;var f=w(26),g=w(43),u=[];c.acquireCharAtlas=function(l,d,_,o,n){for(var a=f.generateConfig(o,n,l,_),t=0;t<u.length;t++){var i=(e=u[t]).ownedBy.indexOf(d);if(i>=0){if(f.configEquals(e.config,a))return e.atlas;e.ownedBy.length===1?(e.atlas.dispose(),u.splice(t,1)):e.ownedBy.splice(i,1);break}}for(t=0;t<u.length;t++){var e=u[t];if(f.configEquals(e.config,a))return e.ownedBy.push(d),e.atlas}var r={atlas:new g.DynamicCharAtlas(document,a),config:a,ownedBy:[d]};return u.push(r),r.atlas},c.removeTerminalFromCache=function(l){for(var d=0;d<u.length;d++){var _=u[d].ownedBy.indexOf(l);if(_!==-1){u[d].ownedBy.length===1?(u[d].atlas.dispose(),u.splice(d,1)):u[d].ownedBy.splice(_,1);break}}}},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.is256Color=c.configEquals=c.generateConfig=void 0;var f=w(3);c.generateConfig=function(g,u,l,d){var _={foreground:d.foreground,background:d.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:d.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:g,scaledCharHeight:u,fontFamily:l.fontFamily,fontSize:l.fontSize,fontWeight:l.fontWeight,fontWeightBold:l.fontWeightBold,allowTransparency:l.allowTransparency,colors:_}},c.configEquals=function(g,u){for(var l=0;l<g.colors.ansi.length;l++)if(g.colors.ansi[l].rgba!==u.colors.ansi[l].rgba)return!1;return g.devicePixelRatio===u.devicePixelRatio&&g.fontFamily===u.fontFamily&&g.fontSize===u.fontSize&&g.fontWeight===u.fontWeight&&g.fontWeightBold===u.fontWeightBold&&g.allowTransparency===u.allowTransparency&&g.scaledCharWidth===u.scaledCharWidth&&g.scaledCharHeight===u.scaledCharHeight&&g.colors.foreground===u.colors.foreground&&g.colors.background===u.colors.background},c.is256Color=function(g){return g<f.DEFAULT_COLOR}},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.ColorManager=c.DEFAULT_ANSI_COLORS=void 0;var f=w(10),g=w(45),u=f.css.toColor("#ffffff"),l=f.css.toColor("#000000"),d=f.css.toColor("#ffffff"),_=f.css.toColor("#000000"),o={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=function(){for(var a=[f.css.toColor("#2e3436"),f.css.toColor("#cc0000"),f.css.toColor("#4e9a06"),f.css.toColor("#c4a000"),f.css.toColor("#3465a4"),f.css.toColor("#75507b"),f.css.toColor("#06989a"),f.css.toColor("#d3d7cf"),f.css.toColor("#555753"),f.css.toColor("#ef2929"),f.css.toColor("#8ae234"),f.css.toColor("#fce94f"),f.css.toColor("#729fcf"),f.css.toColor("#ad7fa8"),f.css.toColor("#34e2e2"),f.css.toColor("#eeeeec")],t=[0,95,135,175,215,255],i=0;i<216;i++){var e=t[i/36%6|0],r=t[i/6%6|0],s=t[i%6];a.push({css:f.channels.toCss(e,r,s),rgba:f.channels.toRgba(e,r,s)})}for(i=0;i<24;i++){var h=8+10*i;a.push({css:f.channels.toCss(h,h,h),rgba:f.channels.toRgba(h,h,h)})}return a}();var n=function(){function a(t,i){this.allowTransparency=i;var e=t.createElement("canvas");e.width=1,e.height=1;var r=e.getContext("2d");if(!r)throw new Error("Could not get rendering context");this._ctx=r,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new g.ColorContrastCache,this.colors={foreground:u,background:l,cursor:d,cursorAccent:_,selectionTransparent:o,selectionOpaque:f.color.blend(l,o),ansi:c.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return a.prototype.onOptionsChange=function(t){t==="minimumContrastRatio"&&this._contrastCache.clear()},a.prototype.setTheme=function(t){(t===void 0&&(t={}),this.colors.foreground=this._parseColor(t.foreground,u),this.colors.background=this._parseColor(t.background,l),this.colors.cursor=this._parseColor(t.cursor,d,!0),this.colors.cursorAccent=this._parseColor(t.cursorAccent,_,!0),this.colors.selectionTransparent=this._parseColor(t.selection,o,!0),this.colors.selectionOpaque=f.color.blend(this.colors.background,this.colors.selectionTransparent),f.color.isOpaque(this.colors.selectionTransparent))&&(this.colors.selectionTransparent=f.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(t.black,c.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(t.red,c.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(t.green,c.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(t.yellow,c.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(t.blue,c.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(t.magenta,c.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(t.cyan,c.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(t.white,c.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(t.brightBlack,c.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(t.brightRed,c.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(t.brightGreen,c.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(t.brightYellow,c.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(t.brightBlue,c.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(t.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(t.brightCyan,c.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(t.brightWhite,c.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},a.prototype._parseColor=function(t,i,e){if(e===void 0&&(e=this.allowTransparency),t===void 0)return i;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=t,typeof this._ctx.fillStyle!="string")return console.warn("Color: "+t+" is invalid using fallback "+i.css),i;this._ctx.fillRect(0,0,1,1);var r=this._ctx.getImageData(0,0,1,1).data;if(r[3]!==255){if(!e)return console.warn("Color: "+t+" is using transparency, but allowTransparency is false. Using fallback "+i.css+"."),i;var s=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(E){return Number(E)}),h=s[0],y=s[1],S=s[2],v=s[3],p=Math.round(255*v);return{rgba:f.channels.toRgba(h,y,S,p),css:t}}return{css:this._ctx.fillStyle,rgba:f.channels.toRgba(r[0],r[1],r[2],r[3])}},a}();c.ColorManager=n},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.throwIfFalsy=void 0,c.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f}},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(n,a){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(n,a)},function(n,a){function t(){this.constructor=n}f(n,a),n.prototype=a===null?Object.create(a):(t.prototype=a.prototype,new t)});Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerRegistry=c.JoinedCellData=void 0;var u=w(6),l=w(3),d=w(4),_=function(n){function a(t,i,e){var r=n.call(this)||this;return r.content=0,r.combinedData="",r.fg=t.fg,r.bg=t.bg,r.combinedData=i,r._width=e,r}return g(a,n),a.prototype.isCombined=function(){return 2097152},a.prototype.getWidth=function(){return this._width},a.prototype.getChars=function(){return this.combinedData},a.prototype.getCode=function(){return 2097151},a.prototype.setFromCharData=function(t){throw new Error("not implemented")},a.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},a}(u.AttributeData);c.JoinedCellData=_;var o=function(){function n(a){this._bufferService=a,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new d.CellData}return n.prototype.registerCharacterJoiner=function(a){var t={id:this._nextCharacterJoinerId++,handler:a};return this._characterJoiners.push(t),t.id},n.prototype.deregisterCharacterJoiner=function(a){for(var t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===a)return this._characterJoiners.splice(t,1),!0;return!1},n.prototype.getJoinedCharacters=function(a){if(this._characterJoiners.length===0)return[];var t=this._bufferService.buffer.lines.get(a);if(!t||t.length===0)return[];for(var i=[],e=t.translateToString(!0),r=0,s=0,h=0,y=t.getFg(0),S=t.getBg(0),v=0;v<t.getTrimmedLength();v++)if(t.loadCell(v,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==y||this._workCell.bg!==S){if(v-r>1)for(var p=this._getJoinedRanges(e,h,s,t,r),E=0;E<p.length;E++)i.push(p[E]);r=v,h=s,y=this._workCell.fg,S=this._workCell.bg}s+=this._workCell.getChars().length||l.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-r>1)for(p=this._getJoinedRanges(e,h,s,t,r),E=0;E<p.length;E++)i.push(p[E]);return i},n.prototype._getJoinedRanges=function(a,t,i,e,r){for(var s=a.substring(t,i),h=this._characterJoiners[0].handler(s),y=1;y<this._characterJoiners.length;y++)for(var S=this._characterJoiners[y].handler(s),v=0;v<S.length;v++)n._mergeRanges(h,S[v]);return this._stringRangesToCellRanges(h,e,r),h},n.prototype._stringRangesToCellRanges=function(a,t,i){var e=0,r=!1,s=0,h=a[e];if(h){for(var y=i;y<this._bufferService.cols;y++){var S=t.getWidth(y),v=t.getString(y).length||l.WHITESPACE_CELL_CHAR.length;if(S!==0){if(!r&&h[0]<=s&&(h[0]=y,r=!0),h[1]<=s){if(h[1]=y,!(h=a[++e]))break;h[0]<=s?(h[0]=y,r=!0):r=!1}s+=v}}h&&(h[1]=this._bufferService.cols)}},n._mergeRanges=function(a,t){for(var i=!1,e=0;e<a.length;e++){var r=a[e];if(i){if(t[1]<=r[0])return a[e-1][1]=t[1],a;if(t[1]<=r[1])return a[e-1][1]=Math.max(t[1],r[1]),a.splice(e,1),a;a.splice(e,1),e--}else{if(t[1]<=r[0])return a.splice(e,0,t),a;if(t[1]<=r[1])return r[0]=Math.min(t[0],r[0]),a;t[0]<r[1]&&(r[0]=Math.min(t[0],r[0]),i=!0)}}return i?a[a.length-1][1]=t[1]:a.push(t),a},n}();c.CharacterJoinerRegistry=o},function(B,c,w){"use strict";function f(g,u){var l=u.getBoundingClientRect();return[g.clientX-l.left,g.clientY-l.top]}Object.defineProperty(c,"__esModule",{value:!0}),c.getRawByteCoords=c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=f,c.getCoords=function(g,u,l,d,_,o,n,a){if(_){var t=f(g,u);if(t)return t[0]=Math.ceil((t[0]+(a?o/2:0))/o),t[1]=Math.ceil(t[1]/n),t[0]=Math.min(Math.max(t[0],1),l+(a?1:0)),t[1]=Math.min(Math.max(t[1],1),d),t}},c.getRawByteCoords=function(g){if(g)return{x:g[0]+32,y:g[1]+32}}},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0;var f=function(){function g(u){this._renderCallback=u}return g.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},g.prototype.refresh=function(u,l,d){var _=this;this._rowCount=d,u=u!==void 0?u:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return _._innerRefresh()}))},g.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var u=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(u,l)}},g}();c.RenderDebouncer=f},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(l,d){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,o){_.__proto__=o}||function(_,o){for(var n in o)o.hasOwnProperty(n)&&(_[n]=o[n])})(l,d)},function(l,d){function _(){this.constructor=l}f(l,d),l.prototype=d===null?Object.create(d):(_.prototype=d.prototype,new _)});Object.defineProperty(c,"__esModule",{value:!0}),c.ScreenDprMonitor=void 0;var u=function(l){function d(){var _=l!==null&&l.apply(this,arguments)||this;return _._currentDevicePixelRatio=window.devicePixelRatio,_}return g(d,l),d.prototype.setListener=function(_){var o=this;this._listener&&this.clearListener(),this._listener=_,this._outerListener=function(){o._listener&&(o._listener(window.devicePixelRatio,o._currentDevicePixelRatio),o._updateDpr())},this._updateDpr()},d.prototype.dispose=function(){l.prototype.dispose.call(this),this.clearListener()},d.prototype._updateDpr=function(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)===null||_===void 0||_.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},d.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},d}(w(2).Disposable);c.ScreenDprMonitor=u},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function f(g,u){if(u===void 0&&(u=5),typeof g!="object")return g;var l=Array.isArray(g)?[]:{};for(var d in g)l[d]=u<=1?g[d]:g[d]?f(g[d],u-1):g[d];return l}},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;var f=w(4),g=w(35),u=w(18),l=w(0),d=w(83),_=function(){function e(r){this._core=new g.Terminal(r),this._addonManager=new d.AddonManager}return e.prototype._checkProposedApi=function(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(e.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new t(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unicode",{get:function(){return this._checkProposedApi(),new i(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._checkProposedApi(),new n(this._core.buffers)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),e.prototype.blur=function(){this._core.blur()},e.prototype.focus=function(){this._core.focus()},e.prototype.resize=function(r,s){this._verifyIntegers(r,s),this._core.resize(r,s)},e.prototype.open=function(r){this._core.open(r)},e.prototype.attachCustomKeyEventHandler=function(r){this._core.attachCustomKeyEventHandler(r)},e.prototype.registerLinkMatcher=function(r,s,h){return this._checkProposedApi(),this._core.registerLinkMatcher(r,s,h)},e.prototype.deregisterLinkMatcher=function(r){this._checkProposedApi(),this._core.deregisterLinkMatcher(r)},e.prototype.registerLinkProvider=function(r){return this._checkProposedApi(),this._core.registerLinkProvider(r)},e.prototype.registerCharacterJoiner=function(r){return this._checkProposedApi(),this._core.registerCharacterJoiner(r)},e.prototype.deregisterCharacterJoiner=function(r){this._checkProposedApi(),this._core.deregisterCharacterJoiner(r)},e.prototype.registerMarker=function(r){return this._checkProposedApi(),this._verifyIntegers(r),this._core.addMarker(r)},e.prototype.addMarker=function(r){return this.registerMarker(r)},e.prototype.hasSelection=function(){return this._core.hasSelection()},e.prototype.select=function(r,s,h){this._verifyIntegers(r,s,h),this._core.select(r,s,h)},e.prototype.getSelection=function(){return this._core.getSelection()},e.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},e.prototype.clearSelection=function(){this._core.clearSelection()},e.prototype.selectAll=function(){this._core.selectAll()},e.prototype.selectLines=function(r,s){this._verifyIntegers(r,s),this._core.selectLines(r,s)},e.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},e.prototype.scrollLines=function(r){this._verifyIntegers(r),this._core.scrollLines(r)},e.prototype.scrollPages=function(r){this._verifyIntegers(r),this._core.scrollPages(r)},e.prototype.scrollToTop=function(){this._core.scrollToTop()},e.prototype.scrollToBottom=function(){this._core.scrollToBottom()},e.prototype.scrollToLine=function(r){this._verifyIntegers(r),this._core.scrollToLine(r)},e.prototype.clear=function(){this._core.clear()},e.prototype.write=function(r,s){this._core.write(r,s)},e.prototype.writeUtf8=function(r,s){this._core.write(r,s)},e.prototype.writeln=function(r,s){this._core.write(r),this._core.write(`\r
|
|
|
`,s)},e.prototype.paste=function(r){this._core.paste(r)},e.prototype.getOption=function(r){return this._core.optionsService.getOption(r)},e.prototype.setOption=function(r,s){this._core.optionsService.setOption(r,s)},e.prototype.refresh=function(r,s){this._verifyIntegers(r,s),this._core.refresh(r,s)},e.prototype.reset=function(){this._core.reset()},e.prototype.loadAddon=function(r){return this._addonManager.loadAddon(this,r)},Object.defineProperty(e,"strings",{get:function(){return u},enumerable:!1,configurable:!0}),e.prototype._verifyIntegers=function(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];for(var h=0,y=r;h<y.length;h++){var S=y[h];if(S===1/0||isNaN(S)||S%1!=0)throw new Error("This API only accepts integers")}},e}();c.Terminal=_;var o=function(){function e(r,s){this._buffer=r,this.type=s}return e.prototype.init=function(r){return this._buffer=r,this},Object.defineProperty(e.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),e.prototype.getLine=function(r){var s=this._buffer.lines.get(r);if(s)return new a(s)},e.prototype.getNullCell=function(){return new f.CellData},e}(),n=function(){function e(r){var s=this;this._buffers=r,this._onBufferChange=new l.EventEmitter,this._normal=new o(this._buffers.normal,"normal"),this._alternate=new o(this._buffers.alt,"alternate"),this._buffers.onBufferActivate(function(){return s._onBufferChange.fire(s.active)})}return Object.defineProperty(e.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){if(this._buffers.active===this._buffers.normal)return this.normal;if(this._buffers.active===this._buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"normal",{get:function(){return this._normal.init(this._buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alternate",{get:function(){return this._alternate.init(this._buffers.alt)},enumerable:!1,configurable:!0}),e}(),a=function(){function e(r){this._line=r}return Object.defineProperty(e.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),e.prototype.getCell=function(r,s){if(!(r<0||r>=this._line.length))return s?(this._line.loadCell(r,s),s):this._line.loadCell(r,new f.CellData)},e.prototype.translateToString=function(r,s,h){return this._line.translateToString(r,s,h)},e}(),t=function(){function e(r){this._core=r}return e.prototype.registerCsiHandler=function(r,s){return this._core.addCsiHandler(r,function(h){return s(h.toArray())})},e.prototype.addCsiHandler=function(r,s){return this.registerCsiHandler(r,s)},e.prototype.registerDcsHandler=function(r,s){return this._core.addDcsHandler(r,function(h,y){return s(h,y.toArray())})},e.prototype.addDcsHandler=function(r,s){return this.registerDcsHandler(r,s)},e.prototype.registerEscHandler=function(r,s){return this._core.addEscHandler(r,s)},e.prototype.addEscHandler=function(r,s){return this.registerEscHandler(r,s)},e.prototype.registerOscHandler=function(r,s){return this._core.addOscHandler(r,s)},e.prototype.addOscHandler=function(r,s){return this.registerOscHandler(r,s)},e}(),i=function(){function e(r){this._core=r}return e.prototype.register=function(r){this._core.unicodeService.register(r)},Object.defineProperty(e.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(r){this._core.unicodeService.activeVersion=r},enumerable:!1,configurable:!0}),e}()},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(N,L){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,R){O.__proto__=R}||function(O,R){for(var I in R)R.hasOwnProperty(I)&&(O[I]=R[I])})(N,L)},function(N,L){function O(){this.constructor=N}f(N,L),N.prototype=L===null?Object.create(L):(O.prototype=L.prototype,new O)});Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;var u=w(36),l=w(37),d=w(38),_=w(12),o=w(19),n=w(40),a=w(50),t=w(51),i=w(11),e=w(7),r=w(18),s=w(54),h=w(55),y=w(56),S=w(57),v=w(59),p=w(0),E=w(16),A=w(27),b=w(60),m=w(5),C=w(61),D=w(62),x=w(63),T=w(64),M=w(65),P=typeof window!="undefined"?window.document:null,q=function(N){function L(O){O===void 0&&(O={});var R=N.call(this,O)||this;return R.browser=i,R._keyDownHandled=!1,R._onCursorMove=new p.EventEmitter,R._onKey=new p.EventEmitter,R._onRender=new p.EventEmitter,R._onSelectionChange=new p.EventEmitter,R._onTitleChange=new p.EventEmitter,R._onFocus=new p.EventEmitter,R._onBlur=new p.EventEmitter,R._onA11yCharEmitter=new p.EventEmitter,R._onA11yTabEmitter=new p.EventEmitter,R._setup(),R.linkifier=R._instantiationService.createInstance(a.Linkifier),R.linkifier2=R.register(R._instantiationService.createInstance(x.Linkifier2)),R.register(R._inputHandler.onRequestBell(function(){return R.bell()})),R.register(R._inputHandler.onRequestRefreshRows(function(I,k){return R.refresh(I,k)})),R.register(R._inputHandler.onRequestReset(function(){return R.reset()})),R.register(R._inputHandler.onRequestScroll(function(I,k){return R.scroll(I,k||void 0)})),R.register(R._inputHandler.onRequestWindowsOptionsReport(function(I){return R._reportWindowsOptions(I)})),R.register(p.forwardEvent(R._inputHandler.onCursorMove,R._onCursorMove)),R.register(p.forwardEvent(R._inputHandler.onTitleChange,R._onTitleChange)),R.register(p.forwardEvent(R._inputHandler.onA11yChar,R._onA11yCharEmitter)),R.register(p.forwardEvent(R._inputHandler.onA11yTab,R._onA11yTabEmitter)),R.register(R._bufferService.onResize(function(I){return R._afterResize(I.cols,I.rows)})),R}return g(L,N),Object.defineProperty(L.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),L.prototype.dispose=function(){var O,R,I;this._isDisposed||(N.prototype.dispose.call(this),(O=this._renderService)===null||O===void 0||O.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},(I=(R=this.element)===null||R===void 0?void 0:R.parentNode)===null||I===void 0||I.removeChild(this.element))},L.prototype._setup=function(){N.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(L.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),L.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},L.prototype._updateOptions=function(O){var R,I,k,U;switch(N.prototype._updateOptions.call(this,O),O){case"fontFamily":case"fontSize":(R=this._renderService)===null||R===void 0||R.clear(),(I=this._charSizeService)===null||I===void 0||I.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this._renderService&&(this._renderService.setRenderer(this._createRenderer()),this._renderService.onResize(this.cols,this.rows));break;case"scrollback":(k=this.viewport)===null||k===void 0||k.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new y.AccessibilityManager(this,this._renderService)):((U=this._accessibilityManager)===null||U===void 0||U.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},L.prototype._onTextAreaFocus=function(O){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(_.C0.ESC+"[I"),this.updateCursorStyle(O),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},L.prototype.blur=function(){var O;return(O=this.textarea)===null||O===void 0?void 0:O.blur()},L.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(_.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},L.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var O=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),R=this._bufferService.buffer.y*O,I=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=I+"px",this.textarea.style.top=R+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=O+"px",this.textarea.style.lineHeight=O+"px",this.textarea.style.zIndex="-5"}},L.prototype._initGlobal=function(){var O=this;this._bindKeys(),this.register(e.addDisposableDomListener(this.element,"copy",function(I){O.hasSelection()&&d.copyHandler(I,O._selectionService)}));var R=function(I){return d.handlePasteEvent(I,O.textarea,O._coreService)};this.register(e.addDisposableDomListener(this.textarea,"paste",R)),this.register(e.addDisposableDomListener(this.element,"paste",R)),i.isFirefox?this.register(e.addDisposableDomListener(this.element,"mousedown",function(I){I.button===2&&d.rightClickHandler(I,O.textarea,O.screenElement,O._selectionService,O.options.rightClickSelectsWord)})):this.register(e.addDisposableDomListener(this.element,"contextmenu",function(I){d.rightClickHandler(I,O.textarea,O.screenElement,O._selectionService,O.options.rightClickSelectsWord)})),i.isLinux&&this.register(e.addDisposableDomListener(this.element,"auxclick",function(I){I.button===1&&d.moveTextAreaUnderMouseCursor(I,O.textarea,O.screenElement)}))},L.prototype._bindKeys=function(){var O=this;this.register(e.addDisposableDomListener(this.textarea,"keyup",function(R){return O._keyUp(R)},!0)),this.register(e.addDisposableDomListener(this.textarea,"keydown",function(R){return O._keyDown(R)},!0)),this.register(e.addDisposableDomListener(this.textarea,"keypress",function(R){return O._keyPress(R)},!0)),this.register(e.addDisposableDomListener(this.textarea,"compositionstart",function(){return O._compositionHelper.compositionstart()})),this.register(e.addDisposableDomListener(this.textarea,"compositionupdate",function(R){return O._compositionHelper.compositionupdate(R)})),this.register(e.addDisposableDomListener(this.textarea,"compositionend",function(){return O._compositionHelper.compositionend()})),this.register(this.onRender(function(){return O._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(R){return O._queueLinkification(R.start,R.end)}))},L.prototype.open=function(O){var R=this;if(!O)throw new Error("Terminal requires a parent element.");P.body.contains(O)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=O.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"),O.appendChild(this.element);var I=P.createDocumentFragment();this._viewportElement=P.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),I.appendChild(this._viewportElement),this._viewportScrollArea=P.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=P.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=P.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),I.appendChild(this.screenElement),this.textarea=P.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",r.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(e.addDisposableDomListener(this.textarea,"focus",function(z){return R._onTextAreaFocus(z)})),this.register(e.addDisposableDomListener(this.textarea,"blur",function(){return R._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var k=this._instantiationService.createInstance(T.CoreBrowserService,this.textarea);this._instantiationService.setService(m.ICoreBrowserService,k),this._charSizeService=this._instantiationService.createInstance(C.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(m.ICharSizeService,this._charSizeService),this._compositionView=P.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(I),this._theme=this.options.theme||this._theme,this._colorManager=new A.ColorManager(P,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(z){return R._colorManager.onOptionsChange(z)})),this._colorManager.setTheme(this._theme);var U=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(b.RenderService,U,this.rows,this.screenElement)),this._instantiationService.setService(m.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(z){return R._onRender.fire(z)})),this.onResize(function(z){return R._renderService.resize(z.cols,z.rows)}),this._soundService=this._instantiationService.createInstance(s.SoundService),this._instantiationService.setService(m.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(D.MouseService),this._instantiationService.setService(m.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(l.Viewport,function(z,$){return R.scrollLines(z,$)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(function(){return R.viewport.syncScrollArea()})),this.register(this.viewport),this.register(this.onCursorMove(function(){R._renderService.onCursorMove(),R._syncTextArea()})),this.register(this.onResize(function(){return R._renderService.onResize(R.cols,R.rows)})),this.register(this.onBlur(function(){return R._renderService.onBlur()})),this.register(this.onFocus(function(){return R._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return R.viewport.syncScrollArea()})),this._selectionService=this.register(this._instantiationService.createInstance(t.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(m.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(function(z){return R.scrollLines(z.amount,z.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return R._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(z){return R._renderService.onSelectionChanged(z.start,z.end,z.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(z){R.textarea.value=z,R.textarea.focus(),R.textarea.select()})),this.register(this.onScroll(function(){R.viewport.syncScrollArea(),R._selectionService.refresh()})),this.register(e.addDisposableDomListener(this._viewportElement,"scroll",function(){return R._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(h.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return R._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.linkifier2.attachToDom(this.element,this._mouseService,this._renderService),this.register(e.addDisposableDomListener(this.element,"mousedown",function(z){return R._selectionService.onMouseDown(z)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new y.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},L.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(n.Renderer,this._colorManager.colors,this.screenElement,this.linkifier,this.linkifier2);case"dom":return this._instantiationService.createInstance(S.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},L.prototype._setTheme=function(O){var R,I,k;this._theme=O,(R=this._colorManager)===null||R===void 0||R.setTheme(O),(I=this._renderService)===null||I===void 0||I.setColors(this._colorManager.colors),(k=this.viewport)===null||k===void 0||k.onThemeChange(this._colorManager.colors)},L.prototype.bindMouse=function(){var O=this,R=this,I=this.element;function k(F){var J,Z,oe=R._mouseService.getRawByteCoords(F,R.screenElement,R.cols,R.rows);if(!oe)return!1;switch(F.overrideType||F.type){case"mousemove":Z=32,F.buttons===void 0?(J=3,F.button!==void 0&&(J=F.button<3?F.button:3)):J=1&F.buttons?0:4&F.buttons?1:2&F.buttons?2:3;break;case"mouseup":Z=0,J=F.button<3?F.button:3;break;case"mousedown":Z=1,J=F.button<3?F.button:3;break;case"wheel":F.deltaY!==0&&(Z=F.deltaY<0?0:1),J=4;break;default:return!1}return!(Z===void 0||J===void 0||J>4)&&R._coreMouseService.triggerMouseEvent({col:oe.x-33,row:oe.y-33,button:J,action:Z,ctrl:F.ctrlKey,alt:F.altKey,shift:F.shiftKey})}var U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},z=function(F){return k(F),F.buttons||(O._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&O._document.removeEventListener("mousemove",U.mousedrag)),O.cancel(F)},$=function(F){return k(F),F.preventDefault(),O.cancel(F)},ee=function(F){F.buttons&&k(F)},re=function(F){F.buttons||k(F)};this.register(this._coreMouseService.onProtocolChange(function(F){F?(O.optionsService.options.logLevel==="debug"&&O._logService.debug("Binding to mouse events:",O._coreMouseService.explainEvents(F)),O.element.classList.add("enable-mouse-events"),O._selectionService.disable()):(O._logService.debug("Unbinding from mouse events."),O.element.classList.remove("enable-mouse-events"),O._selectionService.enable()),8&F?U.mousemove||(I.addEventListener("mousemove",re),U.mousemove=re):(I.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&F?U.wheel||(I.addEventListener("wheel",$,{passive:!1}),U.wheel=$):(I.removeEventListener("wheel",U.wheel),U.wheel=null),2&F?U.mouseup||(U.mouseup=z):(O._document.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&F?U.mousedrag||(U.mousedrag=ee):(O._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(e.addDisposableDomListener(I,"mousedown",function(F){if(F.preventDefault(),O.focus(),O._coreMouseService.areMouseEventsActive&&!O._selectionService.shouldForceSelection(F))return k(F),U.mouseup&&O._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&O._document.addEventListener("mousemove",U.mousedrag),O.cancel(F)})),this.register(e.addDisposableDomListener(I,"wheel",function(F){if(!U.wheel){if(!O.buffer.hasScrollback){var J=O.viewport.getLinesScrolled(F);if(J===0)return;for(var Z=_.C0.ESC+(O._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(F.deltaY<0?"A":"B"),oe="",ae=0;ae<Math.abs(J);ae++)oe+=Z;O._coreService.triggerDataEvent(oe,!0)}}},{passive:!0})),this.register(e.addDisposableDomListener(I,"wheel",function(F){if(!U.wheel)return O.viewport.onWheel(F)?void 0:O.cancel(F)},{passive:!1})),this.register(e.addDisposableDomListener(I,"touchstart",function(F){if(!O._coreMouseService.areMouseEventsActive)return O.viewport.onTouchStart(F),O.cancel(F)},{passive:!0})),this.register(e.addDisposableDomListener(I,"touchmove",function(F){if(!O._coreMouseService.areMouseEventsActive)return O.viewport.onTouchMove(F)?void 0:O.cancel(F)},{passive:!1}))},L.prototype.refresh=function(O,R){var I;(I=this._renderService)===null||I===void 0||I.refreshRows(O,R)},L.prototype._queueLinkification=function(O,R){var I;(I=this.linkifier)===null||I===void 0||I.linkifyRows(O,R)},L.prototype.updateCursorStyle=function(O){this._selectionService&&this._selectionService.shouldColumnSelect(O)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},L.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},L.prototype.scrollLines=function(O,R){N.prototype.scrollLines.call(this,O,R),this.refresh(0,this.rows-1)},L.prototype.paste=function(O){d.paste(O,this.textarea,this._coreService)},L.prototype.attachCustomKeyEventHandler=function(O){this._customKeyEventHandler=O},L.prototype.registerLinkMatcher=function(O,R,I){var k=this.linkifier.registerLinkMatcher(O,R,I);return this.refresh(0,this.rows-1),k},L.prototype.deregisterLinkMatcher=function(O){this.linkifier.deregisterLinkMatcher(O)&&this.refresh(0,this.rows-1)},L.prototype.registerLinkProvider=function(O){return this.linkifier2.registerLinkProvider(O)},L.prototype.registerCharacterJoiner=function(O){var R=this._renderService.registerCharacterJoiner(O);return this.refresh(0,this.rows-1),R},L.prototype.deregisterCharacterJoiner=function(O){this._renderService.deregisterCharacterJoiner(O)&&this.refresh(0,this.rows-1)},Object.defineProperty(L.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),L.prototype.addMarker=function(O){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+O)},L.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},L.prototype.select=function(O,R,I){this._selectionService.setSelection(O,R,I)},L.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},L.prototype.getSelectionPosition=function(){if(this._selectionService&&this._selectionService.hasSelection)return{startColumn:this._selectionService.selectionStart[0],startRow:this._selectionService.selectionStart[1],endColumn:this._selectionService.selectionEnd[0],endRow:this._selectionService.selectionEnd[1]}},L.prototype.clearSelection=function(){var O;(O=this._selectionService)===null||O===void 0||O.clearSelection()},L.prototype.selectAll=function(){var O;(O=this._selectionService)===null||O===void 0||O.selectAll()},L.prototype.selectLines=function(O,R){var I;(I=this._selectionService)===null||I===void 0||I.selectLines(O,R)},L.prototype._keyDown=function(O){if(this._keyDownHandled=!1,this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1)return!1;if(!this._compositionHelper.keydown(O))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var R=v.evaluateKeyboardEvent(O,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(O),R.type===3||R.type===2){var I=this.rows-1;return this.scrollLines(R.type===2?-I:I),this.cancel(O,!0)}return R.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,O)||(R.cancel&&this.cancel(O,!0),!R.key||(R.key!==_.C0.ETX&&R.key!==_.C0.CR||(this.textarea.value=""),this._onKey.fire({key:R.key,domEvent:O}),this._showCursor(),this._coreService.triggerDataEvent(R.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(O,!0)))},L.prototype._isThirdLevelShift=function(O,R){var I=O.isMac&&!this.options.macOptionIsMeta&&R.altKey&&!R.ctrlKey&&!R.metaKey||O.isWindows&&R.altKey&&R.ctrlKey&&!R.metaKey;return R.type==="keypress"?I:I&&(!R.keyCode||R.keyCode>47)},L.prototype._keyUp=function(O){this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1||(function(R){return R.keyCode===16||R.keyCode===17||R.keyCode===18}(O)||this.focus(),this.updateCursorStyle(O))},L.prototype._keyPress=function(O){var R;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&this._customKeyEventHandler(O)===!1)return!1;if(this.cancel(O),O.charCode)R=O.charCode;else if(O.which===null||O.which===void 0)R=O.keyCode;else{if(O.which===0||O.charCode===0)return!1;R=O.which}return!(!R||(O.altKey||O.ctrlKey||O.metaKey)&&!this._isThirdLevelShift(this.browser,O))&&(R=String.fromCharCode(R),this._onKey.fire({key:R,domEvent:O}),this._showCursor(),this._coreService.triggerDataEvent(R,!0),!0)},L.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},L.prototype.resize=function(O,R){O!==this.cols||R!==this.rows?N.prototype.resize.call(this,O,R):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},L.prototype._afterResize=function(O,R){var I,k;(I=this._charSizeService)===null||I===void 0||I.measure(),(k=this.viewport)===null||k===void 0||k.syncScrollArea(!0)},L.prototype.clear=function(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var O=1;O<this.rows;O++)this.buffer.lines.push(this.buffer.getBlankLine(E.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},L.prototype.reset=function(){var O,R;this.options.rows=this.rows,this.options.cols=this.cols;var I=this._customKeyEventHandler;this._setup(),N.prototype.reset.call(this),(O=this._selectionService)===null||O===void 0||O.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1),(R=this.viewport)===null||R===void 0||R.syncScrollArea()},L.prototype._reportWindowsOptions=function(O){if(this._renderService)switch(O){case o.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var R=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),I=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(_.C0.ESC+"[4;"+I+";"+R+"t");break;case o.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var k=this._renderService.dimensions.scaledCellWidth.toFixed(0),U=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(_.C0.ESC+"[6;"+U+";"+k+"t")}},L.prototype.cancel=function(O,R){if(this.options.cancelEvents||R)return O.preventDefault(),O.stopPropagation(),!1},L.prototype._visualBell=function(){return!1},L.prototype._soundBell=function(){return this.options.bellStyle==="sound"},L}(M.CoreTerminal);c.Terminal=q},function(B,c,w){"use strict";var f=this&&this.__decorate||function(_,o,n,a){var t,i=arguments.length,e=i<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(_,o,n,a);else for(var r=_.length-1;r>=0;r--)(t=_[r])&&(e=(i<3?t(e):i>3?t(o,n,e):t(o,n))||e);return i>3&&e&&Object.defineProperty(o,n,e),e},g=this&&this.__param||function(_,o){return function(n,a){o(n,a,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;var u=w(5),l=w(1),d=function(){function _(o,n,a,t,i,e){this._textarea=o,this._compositionView=n,this._bufferService=a,this._optionsService=t,this._charSizeService=i,this._coreService=e,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(_.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),_.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},_.prototype.compositionupdate=function(o){var n=this;this._compositionView.textContent=o.data,this.updateCompositionElements(),setTimeout(function(){n._compositionPosition.end=n._textarea.value.length},0)},_.prototype.compositionend=function(){this._finalizeComposition(!0)},_.prototype.keydown=function(o){if(this._isComposing||this._isSendingComposition){if(o.keyCode===229)return!1;if(o.keyCode===16||o.keyCode===17||o.keyCode===18)return!1;this._finalizeComposition(!1)}return o.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},_.prototype._finalizeComposition=function(o){var n=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,o){var a={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(n._isSendingComposition){n._isSendingComposition=!1;var i=void 0;i=n._isComposing?n._textarea.value.substring(a.start,a.end):n._textarea.value.substring(a.start),n._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;var t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}},_.prototype._handleAnyTextareaChanges=function(){var o=this,n=this._textarea.value;setTimeout(function(){if(!o._isComposing){var a=o._textarea.value.replace(n,"");a.length>0&&o._coreService.triggerDataEvent(a,!0)}},0)},_.prototype.updateCompositionElements=function(o){var n=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var a=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),t=this._bufferService.buffer.y*a,i=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=t+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var e=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=t+"px",this._textarea.style.width=e.width+"px",this._textarea.style.height=e.height+"px",this._textarea.style.lineHeight=e.height+"px"}o||setTimeout(function(){return n.updateCompositionElements(!0)},0)}},_=f([g(2,l.IBufferService),g(3,l.IOptionsService),g(4,u.ICharSizeService),g(5,l.ICoreService)],_)}();c.CompositionHelper=d},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(t,i){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var s in r)r.hasOwnProperty(s)&&(e[s]=r[s])})(t,i)},function(t,i){function e(){this.constructor=t}f(t,i),t.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}),u=this&&this.__decorate||function(t,i,e,r){var s,h=arguments.length,y=h<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(t,i,e,r);else for(var S=t.length-1;S>=0;S--)(s=t[S])&&(y=(h<3?s(y):h>3?s(i,e,y):s(i,e))||y);return h>3&&y&&Object.defineProperty(i,e,y),y},l=this&&this.__param||function(t,i){return function(e,r){i(e,r,t)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;var d=w(2),_=w(7),o=w(5),n=w(1),a=function(t){function i(e,r,s,h,y,S,v){var p=t.call(this)||this;return p._scrollLines=e,p._viewportElement=r,p._scrollArea=s,p._bufferService=h,p._optionsService=y,p._charSizeService=S,p._renderService=v,p.scrollBarWidth=0,p._currentRowHeight=0,p._lastRecordedBufferLength=0,p._lastRecordedViewportHeight=0,p._lastRecordedBufferHeight=0,p._lastTouchY=0,p._lastScrollTop=0,p._wheelPartialScroll=0,p._refreshAnimationFrame=null,p._ignoreNextScrollEvent=!1,p.scrollBarWidth=p._viewportElement.offsetWidth-p._scrollArea.offsetWidth||15,p.register(_.addDisposableDomListener(p._viewportElement,"scroll",p._onScroll.bind(p))),setTimeout(function(){return p.syncScrollArea()},0),p}return g(i,t),i.prototype.onThemeChange=function(e){this._viewportElement.style.backgroundColor=e.background.css},i.prototype._refresh=function(e){var r=this;if(e)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return r._innerRefresh()}))},i.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var r=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==r&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=r),this._refreshAnimationFrame=null},i.prototype.syncScrollArea=function(e){if(e===void 0&&(e=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var r=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===r&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(e)}else this._refresh(e)},i.prototype._onScroll=function(e){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var r=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(r,!0)}},i.prototype._bubbleScroll=function(e,r){var s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(r<0&&this._viewportElement.scrollTop!==0||r>0&&s<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)},i.prototype.onWheel=function(e){var r=this._getPixelsScrolled(e);return r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(e,r))},i.prototype._getPixelsScrolled=function(e){if(e.deltaY===0)return 0;var r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?r*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._currentRowHeight*this._bufferService.rows),r},i.prototype.getLinesScrolled=function(e){if(e.deltaY===0)return 0;var r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=this._currentRowHeight+0,this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r},i.prototype._applyScrollModifier=function(e,r){var s=this._optionsService.options.fastScrollModifier;return s==="alt"&&r.altKey||s==="ctrl"&&r.ctrlKey||s==="shift"&&r.shiftKey?e*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:e*this._optionsService.options.scrollSensitivity},i.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},i.prototype.onTouchMove=function(e){var r=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(e,r))},i=u([l(3,n.IBufferService),l(4,n.IOptionsService),l(5,o.ICharSizeService),l(6,o.IRenderService)],i)}(d.Disposable);c.Viewport=a},function(B,c,w){"use strict";function f(d){return d.replace(/\r?\n/g,"\r")}function g(d,_){return _?"[200~"+d+"[201~":d}function u(d,_,o){d=g(d=f(d),o.decPrivateModes.bracketedPasteMode),o.triggerDataEvent(d,!0),_.value=""}function l(d,_,o){var n=o.getBoundingClientRect(),a=d.clientX-n.left-10,t=d.clientY-n.top-10;_.style.width="20px",_.style.height="20px",_.style.left=a+"px",_.style.top=t+"px",_.style.zIndex="1000",_.focus()}Object.defineProperty(c,"__esModule",{value:!0}),c.rightClickHandler=c.moveTextAreaUnderMouseCursor=c.paste=c.handlePasteEvent=c.copyHandler=c.bracketTextForPaste=c.prepareTextForTerminal=void 0,c.prepareTextForTerminal=f,c.bracketTextForPaste=g,c.copyHandler=function(d,_){d.clipboardData&&d.clipboardData.setData("text/plain",_.selectionText),d.preventDefault()},c.handlePasteEvent=function(d,_,o){d.stopPropagation(),d.clipboardData&&u(d.clipboardData.getData("text/plain"),_,o)},c.paste=u,c.moveTextAreaUnderMouseCursor=l,c.rightClickHandler=function(d,_,o,n,a){l(d,_,o),a&&!n.isClickInSelection(d)&&n.selectWordAtCursor(d),_.value=n.selectionText,_.select()}},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(t,i){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var s in r)r.hasOwnProperty(s)&&(e[s]=r[s])})(t,i)},function(t,i){function e(){this.constructor=t}f(t,i),t.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)});Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;var u=w(2),l=w(15),d=w(21),_=w(22),o=w(24),n=function(){function t(i){this.table=new Uint8Array(i)}return t.prototype.setDefault=function(i,e){l.fill(this.table,i<<4|e)},t.prototype.add=function(i,e,r,s){this.table[e<<8|i]=r<<4|s},t.prototype.addMany=function(i,e,r,s){for(var h=0;h<i.length;h++)this.table[e<<8|i[h]]=r<<4|s},t}();c.TransitionTable=n,c.VT500_TRANSITION_TABLE=function(){var t=new n(4095),i=Array.apply(null,Array(256)).map(function(S,v){return v}),e=function(S,v){return i.slice(S,v)},r=e(32,127),s=e(0,24);s.push(25),s.push.apply(s,e(28,32));var h,y=e(0,14);for(h in t.setDefault(1,0),t.addMany(r,0,2,0),y)t.addMany([24,26,153,154],h,3,0),t.addMany(e(128,144),h,3,0),t.addMany(e(144,152),h,3,0),t.add(156,h,0,0),t.add(27,h,11,1),t.add(157,h,4,8),t.addMany([152,158,159],h,0,7),t.add(155,h,11,3),t.add(144,h,11,9);return t.addMany(s,0,3,0),t.addMany(s,1,3,1),t.add(127,1,0,1),t.addMany(s,8,0,8),t.addMany(s,3,3,3),t.add(127,3,0,3),t.addMany(s,4,3,4),t.add(127,4,0,4),t.addMany(s,6,3,6),t.addMany(s,5,3,5),t.add(127,5,0,5),t.addMany(s,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(r,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(e(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(r,7,0,7),t.addMany(s,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(e(64,127),3,7,0),t.addMany(e(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(e(48,60),4,8,4),t.addMany(e(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(e(32,64),6,0,6),t.add(127,6,0,6),t.addMany(e(64,127),6,0,0),t.addMany(e(32,48),3,9,5),t.addMany(e(32,48),5,9,5),t.addMany(e(48,64),5,0,6),t.addMany(e(64,127),5,7,0),t.addMany(e(32,48),4,9,5),t.addMany(e(32,48),1,9,2),t.addMany(e(32,48),2,9,2),t.addMany(e(48,127),2,10,0),t.addMany(e(48,80),1,10,0),t.addMany(e(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(e(96,127),1,10,0),t.add(80,1,11,9),t.addMany(s,9,0,9),t.add(127,9,0,9),t.addMany(e(28,32),9,0,9),t.addMany(e(32,48),9,9,12),t.addMany(e(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(s,11,0,11),t.addMany(e(32,128),11,0,11),t.addMany(e(28,32),11,0,11),t.addMany(s,10,0,10),t.add(127,10,0,10),t.addMany(e(28,32),10,0,10),t.addMany(e(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(e(32,48),10,9,12),t.addMany(s,12,0,12),t.add(127,12,0,12),t.addMany(e(28,32),12,0,12),t.addMany(e(32,48),12,9,12),t.addMany(e(48,64),12,0,11),t.addMany(e(64,127),12,12,13),t.addMany(e(64,127),10,12,13),t.addMany(e(64,127),9,12,13),t.addMany(s,13,13,13),t.addMany(r,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(160,0,2,0),t.add(160,8,5,8),t.add(160,6,0,6),t.add(160,11,0,11),t.add(160,13,13,13),t}();var a=function(t){function i(e){e===void 0&&(e=c.VT500_TRANSITION_TABLE);var r=t.call(this)||this;return r._transitions=e,r.initialState=0,r.currentState=r.initialState,r._params=new d.Params,r._params.addParam(0),r._collect=0,r.precedingCodepoint=0,r._printHandlerFb=function(s,h,y){},r._executeHandlerFb=function(s){},r._csiHandlerFb=function(s,h){},r._escHandlerFb=function(s){},r._errorHandlerFb=function(s){return s},r._printHandler=r._printHandlerFb,r._executeHandlers=Object.create(null),r._csiHandlers=Object.create(null),r._escHandlers=Object.create(null),r._oscParser=new _.OscParser,r._dcsParser=new o.DcsParser,r._errorHandler=r._errorHandlerFb,r.setEscHandler({final:"\\"},function(){}),r}return g(i,t),i.prototype._identifier=function(e,r){r===void 0&&(r=[64,126]);var s=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if((s=e.prefix.charCodeAt(0))&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var h=0;h<e.intermediates.length;++h){var y=e.intermediates.charCodeAt(h);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=y}}if(e.final.length!==1)throw new Error("final must be a single byte");var S=e.final.charCodeAt(0);if(r[0]>S||S>r[1])throw new Error("final must be in range "+r[0]+" .. "+r[1]);return s<<=8,s|=S},i.prototype.identToString=function(e){for(var r=[];e;)r.push(String.fromCharCode(255&e)),e>>=8;return r.reverse().join("")},i.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},i.prototype.setPrintHandler=function(e){this._printHandler=e},i.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},i.prototype.addEscHandler=function(e,r){var s=this._identifier(e,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);var h=this._escHandlers[s];return h.push(r),{dispose:function(){var y=h.indexOf(r);y!==-1&&h.splice(y,1)}}},i.prototype.setEscHandler=function(e,r){this._escHandlers[this._identifier(e,[48,126])]=[r]},i.prototype.clearEscHandler=function(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]},i.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},i.prototype.setExecuteHandler=function(e,r){this._executeHandlers[e.charCodeAt(0)]=r},i.prototype.clearExecuteHandler=function(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]},i.prototype.setExecuteHandlerFallback=function(e){this._executeHandlerFb=e},i.prototype.addCsiHandler=function(e,r){var s=this._identifier(e);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);var h=this._csiHandlers[s];return h.push(r),{dispose:function(){var y=h.indexOf(r);y!==-1&&h.splice(y,1)}}},i.prototype.setCsiHandler=function(e,r){this._csiHandlers[this._identifier(e)]=[r]},i.prototype.clearCsiHandler=function(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]},i.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},i.prototype.addDcsHandler=function(e,r){return this._dcsParser.addHandler(this._identifier(e),r)},i.prototype.setDcsHandler=function(e,r){this._dcsParser.setHandler(this._identifier(e),r)},i.prototype.clearDcsHandler=function(e){this._dcsParser.clearHandler(this._identifier(e))},i.prototype.setDcsHandlerFallback=function(e){this._dcsParser.setHandlerFallback(e)},i.prototype.addOscHandler=function(e,r){return this._oscParser.addHandler(e,r)},i.prototype.setOscHandler=function(e,r){this._oscParser.setHandler(e,r)},i.prototype.clearOscHandler=function(e){this._oscParser.clearHandler(e)},i.prototype.setOscHandlerFallback=function(e){this._oscParser.setHandlerFallback(e)},i.prototype.setErrorHandler=function(e){this._errorHandler=e},i.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},i.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},i.prototype.parse=function(e,r){for(var s=0,h=0,y=this.currentState,S=this._oscParser,v=this._dcsParser,p=this._collect,E=this._params,A=this._transitions.table,b=0;b<r;++b){switch((h=A[y<<8|((s=e[b])<160?s:160)])>>4){case 2:for(var m=b+1;;++m){if(m>=r||(s=e[m])<32||s>126&&s<160){this._printHandler(e,b,m),b=m-1;break}if(++m>=r||(s=e[m])<32||s>126&&s<160){this._printHandler(e,b,m),b=m-1;break}if(++m>=r||(s=e[m])<32||s>126&&s<160){this._printHandler(e,b,m),b=m-1;break}if(++m>=r||(s=e[m])<32||s>126&&s<160){this._printHandler(e,b,m),b=m-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:b,code:s,currentState:y,collect:p,params:E,abort:!1}).abort)return;break;case 7:for(var C=this._csiHandlers[p<<8|s],D=C?C.length-1:-1;D>=0&&C[D](E)===!1;D--);D<0&&this._csiHandlerFb(p<<8|s,E),this.precedingCodepoint=0;break;case 8:do switch(s){case 59:E.addParam(0);break;case 58:E.addSubParam(-1);break;default:E.addDigit(s-48)}while(++b<r&&(s=e[b])>47&&s<60);b--;break;case 9:p<<=8,p|=s;break;case 10:for(var x=this._escHandlers[p<<8|s],T=x?x.length-1:-1;T>=0&&x[T]()===!1;T--);T<0&&this._escHandlerFb(p<<8|s),this.precedingCodepoint=0;break;case 11:E.reset(),E.addParam(0),p=0;break;case 12:v.hook(p<<8|s,E);break;case 13:for(var M=b+1;;++M)if(M>=r||(s=e[M])===24||s===26||s===27||s>127&&s<160){v.put(e,b,M),b=M-1;break}break;case 14:v.unhook(s!==24&&s!==26),s===27&&(h|=1),E.reset(),E.addParam(0),p=0,this.precedingCodepoint=0;break;case 4:S.start();break;case 5:for(var P=b+1;;P++)if(P>=r||(s=e[P])<32||s>127&&s<=159){S.put(e,b,P),b=P-1;break}break;case 6:S.end(s!==24&&s!==26),s===27&&(h|=1),E.reset(),E.addParam(0),p=0,this.precedingCodepoint=0}y=15&h}this._collect=p,this.currentState=y},i}(u.Disposable);c.EscapeSequenceParser=a},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(S,v){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,E){p.__proto__=E}||function(p,E){for(var A in E)E.hasOwnProperty(A)&&(p[A]=E[A])})(S,v)},function(S,v){function p(){this.constructor=S}f(S,v),S.prototype=v===null?Object.create(v):(p.prototype=v.prototype,new p)}),u=this&&this.__decorate||function(S,v,p,E){var A,b=arguments.length,m=b<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,p):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(S,v,p,E);else for(var C=S.length-1;C>=0;C--)(A=S[C])&&(m=(b<3?A(m):b>3?A(v,p,m):A(v,p))||m);return b>3&&m&&Object.defineProperty(v,p,m),m},l=this&&this.__param||function(S,v){return function(p,E){v(p,E,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Renderer=void 0;var d=w(41),_=w(47),o=w(48),n=w(49),a=w(29),t=w(2),i=w(5),e=w(1),r=w(25),s=w(0),h=1,y=function(S){function v(p,E,A,b,m,C,D,x,T){var M=S.call(this)||this;M._colors=p,M._screenElement=E,M._bufferService=m,M._charSizeService=C,M._optionsService=D,M._id=h++,M._onRequestRedraw=new s.EventEmitter;var P=M._optionsService.options.allowTransparency;return M._characterJoinerRegistry=new a.CharacterJoinerRegistry(M._bufferService),M._renderLayers=[new d.TextRenderLayer(M._screenElement,0,M._colors,M._characterJoinerRegistry,P,M._id,M._bufferService,D),new _.SelectionRenderLayer(M._screenElement,1,M._colors,M._id,M._bufferService,D),new n.LinkRenderLayer(M._screenElement,2,M._colors,M._id,A,b,M._bufferService,D),new o.CursorRenderLayer(M._screenElement,3,M._colors,M._id,M._onRequestRedraw,M._bufferService,D,x,T)],M.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},M._devicePixelRatio=window.devicePixelRatio,M._updateDimensions(),M.onOptionsChanged(),M}return g(v,S),Object.defineProperty(v.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),v.prototype.dispose=function(){for(var p=0,E=this._renderLayers;p<E.length;p++)E[p].dispose();S.prototype.dispose.call(this),r.removeTerminalFromCache(this._id)},v.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},v.prototype.setColors=function(p){this._colors=p;for(var E=0,A=this._renderLayers;E<A.length;E++){var b=A[E];b.setColors(this._colors),b.reset()}},v.prototype.onResize=function(p,E){this._updateDimensions();for(var A=0,b=this._renderLayers;A<b.length;A++)b[A].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},v.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},v.prototype.onBlur=function(){this._runOperation(function(p){return p.onBlur()})},v.prototype.onFocus=function(){this._runOperation(function(p){return p.onFocus()})},v.prototype.onSelectionChanged=function(p,E,A){A===void 0&&(A=!1),this._runOperation(function(b){return b.onSelectionChanged(p,E,A)})},v.prototype.onCursorMove=function(){this._runOperation(function(p){return p.onCursorMove()})},v.prototype.onOptionsChanged=function(){this._runOperation(function(p){return p.onOptionsChanged()})},v.prototype.clear=function(){this._runOperation(function(p){return p.reset()})},v.prototype._runOperation=function(p){for(var E=0,A=this._renderLayers;E<A.length;E++)p(A[E])},v.prototype.renderRows=function(p,E){for(var A=0,b=this._renderLayers;A<b.length;A++)b[A].onGridChanged(p,E)},v.prototype._updateDimensions=function(){this._charSizeService.hasValidSize&&(this.dimensions.scaledCharWidth=Math.floor(this._charSizeService.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharTop=this._optionsService.options.lineHeight===1?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._optionsService.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._bufferService.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._bufferService.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols)},v.prototype.registerCharacterJoiner=function(p){return this._characterJoinerRegistry.registerCharacterJoiner(p)},v.prototype.deregisterCharacterJoiner=function(p){return this._characterJoinerRegistry.deregisterCharacterJoiner(p)},v=u([l(4,e.IBufferService),l(5,i.ICharSizeService),l(6,e.IOptionsService),l(7,e.ICoreService),l(8,i.ICoreBrowserService)],v)}(t.Disposable);c.Renderer=y},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(t,i){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var s in r)r.hasOwnProperty(s)&&(e[s]=r[s])})(t,i)},function(t,i){function e(){this.constructor=t}f(t,i),t.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)});Object.defineProperty(c,"__esModule",{value:!0}),c.TextRenderLayer=void 0;var u=w(42),l=w(13),d=w(6),_=w(3),o=w(29),n=w(4),a=function(t){function i(e,r,s,h,y,S,v,p){var E=t.call(this,e,"text",r,y,s,S,v,p)||this;return E._characterWidth=0,E._characterFont="",E._characterOverlapCache={},E._workCell=new n.CellData,E._state=new u.GridCache,E._characterJoinerRegistry=h,E}return g(i,t),i.prototype.resize=function(e){t.prototype.resize.call(this,e);var r=this._getFont(!1,!1);this._characterWidth===e.scaledCharWidth&&this._characterFont===r||(this._characterWidth=e.scaledCharWidth,this._characterFont=r,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},i.prototype.reset=function(){this._state.clear(),this._clearAll()},i.prototype._forEachCell=function(e,r,s,h){for(var y=e;y<=r;y++)for(var S=y+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.lines.get(S),p=s?s.getJoinedCharacters(S):[],E=0;E<this._bufferService.cols;E++){v.loadCell(E,this._workCell);var A=this._workCell,b=!1,m=E;if(A.getWidth()!==0){if(p.length>0&&E===p[0][0]){b=!0;var C=p.shift();A=new o.JoinedCellData(this._workCell,v.translateToString(!0,C[0],C[1]),C[1]-C[0]),m=C[1]-1}!b&&this._isOverlapping(A)&&m<v.length-1&&v.getCodePoint(m+1)===_.NULL_CELL_CODE&&(A.content&=-12582913,A.content|=2<<22),h(A,E,y),E=m}}},i.prototype._drawBackground=function(e,r){var s=this,h=this._ctx,y=this._bufferService.cols,S=0,v=0,p=null;h.save(),this._forEachCell(e,r,null,function(E,A,b){var m=null;E.isInverse()?m=E.isFgDefault()?s._colors.foreground.css:E.isFgRGB()?"rgb("+d.AttributeData.toColorRGB(E.getFgColor()).join(",")+")":s._colors.ansi[E.getFgColor()].css:E.isBgRGB()?m="rgb("+d.AttributeData.toColorRGB(E.getBgColor()).join(",")+")":E.isBgPalette()&&(m=s._colors.ansi[E.getBgColor()].css),p===null&&(S=A,v=b),b!==v?(h.fillStyle=p||"",s._fillCells(S,v,y-S,1),S=A,v=b):p!==m&&(h.fillStyle=p||"",s._fillCells(S,v,A-S,1),S=A,v=b),p=m}),p!==null&&(h.fillStyle=p,this._fillCells(S,v,y-S,1)),h.restore()},i.prototype._drawForeground=function(e,r){var s=this;this._forEachCell(e,r,this._characterJoinerRegistry,function(h,y,S){if(!h.isInvisible()&&(s._drawChars(h,y,S),h.isUnderline())){if(s._ctx.save(),h.isInverse())if(h.isBgDefault())s._ctx.fillStyle=s._colors.background.css;else if(h.isBgRGB())s._ctx.fillStyle="rgb("+d.AttributeData.toColorRGB(h.getBgColor()).join(",")+")";else{var v=h.getBgColor();s._optionsService.options.drawBoldTextInBrightColors&&h.isBold()&&v<8&&(v+=8),s._ctx.fillStyle=s._colors.ansi[v].css}else if(h.isFgDefault())s._ctx.fillStyle=s._colors.foreground.css;else if(h.isFgRGB())s._ctx.fillStyle="rgb("+d.AttributeData.toColorRGB(h.getFgColor()).join(",")+")";else{var p=h.getFgColor();s._optionsService.options.drawBoldTextInBrightColors&&h.isBold()&&p<8&&(p+=8),s._ctx.fillStyle=s._colors.ansi[p].css}s._fillBottomLineAtCells(y,S,h.getWidth()),s._ctx.restore()}})},i.prototype.onGridChanged=function(e,r){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,e,this._bufferService.cols,r-e+1),this._drawBackground(e,r),this._drawForeground(e,r))},i.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},i.prototype._isOverlapping=function(e){if(e.getWidth()!==1)return!1;if(e.getCode()<256)return!1;var r=e.getChars();if(this._characterOverlapCache.hasOwnProperty(r))return this._characterOverlapCache[r];this._ctx.save(),this._ctx.font=this._characterFont;var s=Math.floor(this._ctx.measureText(r).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[r]=s,s},i}(l.BaseRenderLayer);c.TextRenderLayer=a},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.GridCache=void 0;var f=function(){function g(){this.cache=[]}return g.prototype.resize=function(u,l){for(var d=0;d<u;d++){this.cache.length<=d&&this.cache.push([]);for(var _=this.cache[d].length;_<l;_++)this.cache[d].push(void 0);this.cache[d].length=l}this.cache.length=u},g.prototype.clear=function(){for(var u=0;u<this.cache.length;u++)for(var l=0;l<this.cache[u].length;l++)this.cache[u][l]=void 0},g}();c.GridCache=f},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(s,h){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,S){y.__proto__=S}||function(y,S){for(var v in S)S.hasOwnProperty(v)&&(y[v]=S[v])})(s,h)},function(s,h){function y(){this.constructor=s}f(s,h),s.prototype=h===null?Object.create(h):(y.prototype=h.prototype,new y)});Object.defineProperty(c,"__esModule",{value:!0}),c.NoneCharAtlas=c.DynamicCharAtlas=c.getGlyphCacheKey=void 0;var u=w(9),l=w(44),d=w(27),_=w(46),o=w(11),n=w(28),a=w(10),t={css:"rgba(0, 0, 0, 0)",rgba:0};function i(s){return s.code<<21|s.bg<<12|s.fg<<3|(s.bold?0:4)+(s.dim?0:2)+(s.italic?0:1)}c.getGlyphCacheKey=i;var e=function(s){function h(y,S){var v=s.call(this)||this;v._config=S,v._drawToCacheCount=0,v._glyphsWaitingOnBitmap=[],v._bitmapCommitTimeout=null,v._bitmap=null,v._cacheCanvas=y.createElement("canvas"),v._cacheCanvas.width=1024,v._cacheCanvas.height=1024,v._cacheCtx=n.throwIfFalsy(v._cacheCanvas.getContext("2d",{alpha:!0}));var p=y.createElement("canvas");p.width=v._config.scaledCharWidth,p.height=v._config.scaledCharHeight,v._tmpCtx=n.throwIfFalsy(p.getContext("2d",{alpha:v._config.allowTransparency})),v._width=Math.floor(1024/v._config.scaledCharWidth),v._height=Math.floor(1024/v._config.scaledCharHeight);var E=v._width*v._height;return v._cacheMap=new _.LRUMap(E),v._cacheMap.prealloc(E),v}return g(h,s),h.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},h.prototype.beginFrame=function(){this._drawToCacheCount=0},h.prototype.draw=function(y,S,v,p){if(S.code===32)return!0;if(!this._canCache(S))return!1;var E=i(S),A=this._cacheMap.get(E);if(A!=null)return this._drawFromCache(y,A,v,p),!0;if(this._drawToCacheCount<100){var b=void 0;b=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var m=this._drawToCache(S,b);return this._cacheMap.set(E,m),this._drawFromCache(y,m,v,p),!0}return!1},h.prototype._canCache=function(y){return y.code<256},h.prototype._toCoordinateX=function(y){return y%this._width*this._config.scaledCharWidth},h.prototype._toCoordinateY=function(y){return Math.floor(y/this._width)*this._config.scaledCharHeight},h.prototype._drawFromCache=function(y,S,v,p){if(!S.isEmpty){var E=this._toCoordinateX(S.index),A=this._toCoordinateY(S.index);y.drawImage(S.inBitmap?this._bitmap:this._cacheCanvas,E,A,this._config.scaledCharWidth,this._config.scaledCharHeight,v,p,this._config.scaledCharWidth,this._config.scaledCharHeight)}},h.prototype._getColorFromAnsiIndex=function(y){return y<this._config.colors.ansi.length?this._config.colors.ansi[y]:d.DEFAULT_ANSI_COLORS[y]},h.prototype._getBackgroundColor=function(y){return this._config.allowTransparency?t:y.bg===u.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:y.bg<256?this._getColorFromAnsiIndex(y.bg):this._config.colors.background},h.prototype._getForegroundColor=function(y){return y.fg===u.INVERTED_DEFAULT_COLOR?a.color.opaque(this._config.colors.background):y.fg<256?this._getColorFromAnsiIndex(y.fg):this._config.colors.foreground},h.prototype._drawToCache=function(y,S){this._drawToCacheCount++,this._tmpCtx.save();var v=this._getBackgroundColor(y);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=v.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var p=y.bold?this._config.fontWeightBold:this._config.fontWeight,E=y.italic?"italic":"";this._tmpCtx.font=E+" "+p+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(y).css,y.dim&&(this._tmpCtx.globalAlpha=u.DIM_OPACITY),this._tmpCtx.fillText(y.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var A=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),b=!1;this._config.allowTransparency||(b=function(x,T){for(var M=!0,P=T.rgba>>>24,q=T.rgba>>>16&255,N=T.rgba>>>8&255,L=0;L<x.data.length;L+=4)x.data[L]===P&&x.data[L+1]===q&&x.data[L+2]===N?x.data[L+3]=0:M=!1;return M}(A,v));var m=this._toCoordinateX(S),C=this._toCoordinateY(S);this._cacheCtx.putImageData(A,m,C);var D={index:S,isEmpty:b,inBitmap:!1};return this._addGlyphToBitmap(D),D},h.prototype._addGlyphToBitmap=function(y){var S=this;!("createImageBitmap"in window)||o.isFirefox||o.isSafari||(this._glyphsWaitingOnBitmap.push(y),this._bitmapCommitTimeout===null&&(this._bitmapCommitTimeout=window.setTimeout(function(){return S._generateBitmap()},100)))},h.prototype._generateBitmap=function(){var y=this,S=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(v){y._bitmap=v;for(var p=0;p<S.length;p++)S[p].inBitmap=!0}),this._bitmapCommitTimeout=null},h}(l.BaseCharAtlas);c.DynamicCharAtlas=e;var r=function(s){function h(y,S){return s.call(this)||this}return g(h,s),h.prototype.draw=function(y,S,v,p){return!1},h}(l.BaseCharAtlas);c.NoneCharAtlas=r},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.BaseCharAtlas=void 0;var f=function(){function g(){this._didWarmUp=!1}return g.prototype.dispose=function(){},g.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},g.prototype._doWarmUp=function(){},g.prototype.beginFrame=function(){},g}();c.BaseCharAtlas=f},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;var f=function(){function g(){this._color={},this._rgba={}}return g.prototype.clear=function(){this._color={},this._rgba={}},g.prototype.setCss=function(u,l,d){this._rgba[u]||(this._rgba[u]={}),this._rgba[u][l]=d},g.prototype.getCss=function(u,l){return this._rgba[u]?this._rgba[u][l]:void 0},g.prototype.setColor=function(u,l,d){this._color[u]||(this._color[u]={}),this._color[u][l]=d},g.prototype.getColor=function(u,l){return this._color[u]?this._color[u][l]:void 0},g}();c.ColorContrastCache=f},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.LRUMap=void 0;var f=function(){function g(u){this.capacity=u,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return g.prototype._unlinkNode=function(u){var l=u.prev,d=u.next;u===this._head&&(this._head=d),u===this._tail&&(this._tail=l),l!==null&&(l.next=d),d!==null&&(d.prev=l)},g.prototype._appendNode=function(u){var l=this._tail;l!==null&&(l.next=u),u.prev=l,u.next=null,this._tail=u,this._head===null&&(this._head=u)},g.prototype.prealloc=function(u){for(var l=this._nodePool,d=0;d<u;d++)l.push({prev:null,next:null,key:null,value:null})},g.prototype.get=function(u){var l=this._map[u];return l!==void 0?(this._unlinkNode(l),this._appendNode(l),l.value):null},g.prototype.peekValue=function(u){var l=this._map[u];return l!==void 0?l.value:null},g.prototype.peek=function(){var u=this._head;return u===null?null:u.value},g.prototype.set=function(u,l){var d=this._map[u];if(d!==void 0)d=this._map[u],this._unlinkNode(d),d.value=l;else if(this.size>=this.capacity)d=this._head,this._unlinkNode(d),delete this._map[d.key],d.key=u,d.value=l,this._map[u]=d;else{var _=this._nodePool;_.length>0?((d=_.pop()).key=u,d.value=l):d={prev:null,next:null,key:u,value:l},this._map[u]=d,this.size++}this._appendNode(d)},g}();c.LRUMap=f},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(l,d){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,o){_.__proto__=o}||function(_,o){for(var n in o)o.hasOwnProperty(n)&&(_[n]=o[n])})(l,d)},function(l,d){function _(){this.constructor=l}f(l,d),l.prototype=d===null?Object.create(d):(_.prototype=d.prototype,new _)});Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionRenderLayer=void 0;var u=function(l){function d(_,o,n,a,t,i){var e=l.call(this,_,"selection",o,!0,n,a,t,i)||this;return e._clearState(),e}return g(d,l),d.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},d.prototype.resize=function(_){l.prototype.resize.call(this,_),this._clearState()},d.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},d.prototype.onSelectionChanged=function(_,o,n){if(this._didStateChange(_,o,n,this._bufferService.buffer.ydisp))if(this._clearAll(),_&&o){var a=_[1]-this._bufferService.buffer.ydisp,t=o[1]-this._bufferService.buffer.ydisp,i=Math.max(a,0),e=Math.min(t,this._bufferService.rows-1);if(!(i>=this._bufferService.rows||e<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,n){var r=_[0],s=o[0]-r,h=e-i+1;this._fillCells(r,i,s,h)}else{r=a===i?_[0]:0;var y=i===e?o[0]:this._bufferService.cols;this._fillCells(r,i,y-r,1);var S=Math.max(e-i-1,0);if(this._fillCells(0,i+1,this._bufferService.cols,S),i!==e){var v=t===e?o[0]:this._bufferService.cols;this._fillCells(0,e,v,1)}}this._state.start=[_[0],_[1]],this._state.end=[o[0],o[1]],this._state.columnSelectMode=n,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},d.prototype._didStateChange=function(_,o,n,a){return!this._areCoordinatesEqual(_,this._state.start)||!this._areCoordinatesEqual(o,this._state.end)||n!==this._state.columnSelectMode||a!==this._state.ydisp},d.prototype._areCoordinatesEqual=function(_,o){return!(!_||!o)&&_[0]===o[0]&&_[1]===o[1]},d}(w(13).BaseRenderLayer);c.SelectionRenderLayer=u},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(o,n){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,t){a.__proto__=t}||function(a,t){for(var i in t)t.hasOwnProperty(i)&&(a[i]=t[i])})(o,n)},function(o,n){function a(){this.constructor=o}f(o,n),o.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)});Object.defineProperty(c,"__esModule",{value:!0}),c.CursorRenderLayer=void 0;var u=w(13),l=w(4),d=function(o){function n(a,t,i,e,r,s,h,y,S){var v=o.call(this,a,"cursor",t,!0,i,e,s,h)||this;return v._onRequestRedraw=r,v._coreService=y,v._coreBrowserService=S,v._cell=new l.CellData,v._state={x:0,y:0,isFocused:!1,style:"",width:0},v._cursorRenderers={bar:v._renderBarCursor.bind(v),block:v._renderBlockCursor.bind(v),underline:v._renderUnderlineCursor.bind(v)},v}return g(n,o),n.prototype.resize=function(a){o.prototype.resize.call(this,a),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},n.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},n.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},n.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},n.prototype.onOptionsChanged=function(){var a,t=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new _(this._coreBrowserService.isFocused,function(){t._render(!0)})):((a=this._cursorBlinkStateManager)===null||a===void 0||a.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},n.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},n.prototype.onGridChanged=function(a,t){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},n.prototype._render=function(a){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{var e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(t).loadCell(e,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var r=this._optionsService.options.cursorStyle;return r&&r!=="block"?this._cursorRenderers[r](e,i,this._cell):this._renderBlurCursor(e,i,this._cell),this._ctx.restore(),this._state.x=e,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===e&&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"](e,i,this._cell),this._ctx.restore(),this._state.x=e,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()},n.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})},n.prototype._renderBarCursor=function(a,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(a,t,this._optionsService.options.cursorWidth),this._ctx.restore()},n.prototype._renderBlockCursor=function(a,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(a,t,i.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(i,a,t),this._ctx.restore()},n.prototype._renderUnderlineCursor=function(a,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(a,t),this._ctx.restore()},n.prototype._renderBlurCursor=function(a,t,i){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(a,t,i.getWidth(),1),this._ctx.restore()},n}(u.BaseRenderLayer);c.CursorRenderLayer=d;var _=function(){function o(n,a){this._renderCallback=a,this.isCursorVisible=!0,n&&this._restartInterval()}return Object.defineProperty(o.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),o.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)},o.prototype.restartBlinkAnimation=function(){var n=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){n._renderCallback(),n._animationFrame=void 0})))},o.prototype._restartInterval=function(n){var a=this;n===void 0&&(n=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(a._animationTimeRestarted){var t=600-(Date.now()-a._animationTimeRestarted);if(a._animationTimeRestarted=void 0,t>0)return void a._restartInterval(t)}a.isCursorVisible=!1,a._animationFrame=window.requestAnimationFrame(function(){a._renderCallback(),a._animationFrame=void 0}),a._blinkInterval=window.setInterval(function(){if(a._animationTimeRestarted){var i=600-(Date.now()-a._animationTimeRestarted);return a._animationTimeRestarted=void 0,void a._restartInterval(i)}a.isCursorVisible=!a.isCursorVisible,a._animationFrame=window.requestAnimationFrame(function(){a._renderCallback(),a._animationFrame=void 0})},600)},n)},o.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},o.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},o}()},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(o,n){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,t){a.__proto__=t}||function(a,t){for(var i in t)t.hasOwnProperty(i)&&(a[i]=t[i])})(o,n)},function(o,n){function a(){this.constructor=o}f(o,n),o.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)});Object.defineProperty(c,"__esModule",{value:!0}),c.LinkRenderLayer=void 0;var u=w(13),l=w(9),d=w(26),_=function(o){function n(a,t,i,e,r,s,h,y){var S=o.call(this,a,"link",t,!0,i,e,h,y)||this;return r.onShowLinkUnderline(function(v){return S._onShowLinkUnderline(v)}),r.onHideLinkUnderline(function(v){return S._onHideLinkUnderline(v)}),s.onShowLinkUnderline(function(v){return S._onShowLinkUnderline(v)}),s.onHideLinkUnderline(function(v){return S._onHideLinkUnderline(v)}),S}return g(n,o),n.prototype.resize=function(a){o.prototype.resize.call(this,a),this._state=void 0},n.prototype.reset=function(){this._clearCurrentLink()},n.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var a=this._state.y2-this._state.y1-1;a>0&&this._clearCells(0,this._state.y1+1,this._state.cols,a),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},n.prototype._onShowLinkUnderline=function(a){if(a.fg===l.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:a.fg&&d.is256Color(a.fg)?this._ctx.fillStyle=this._colors.ansi[a.fg].css:this._ctx.fillStyle=this._colors.foreground.css,a.y1===a.y2)this._fillBottomLineAtCells(a.x1,a.y1,a.x2-a.x1);else{this._fillBottomLineAtCells(a.x1,a.y1,a.cols-a.x1);for(var t=a.y1+1;t<a.y2;t++)this._fillBottomLineAtCells(0,t,a.cols);this._fillBottomLineAtCells(0,a.y2,a.x2)}this._state=a},n.prototype._onHideLinkUnderline=function(a){this._clearCurrentLink()},n}(u.BaseRenderLayer);c.LinkRenderLayer=_},function(B,c,w){"use strict";var f=this&&this.__decorate||function(o,n,a,t){var i,e=arguments.length,r=e<3?n:t===null?t=Object.getOwnPropertyDescriptor(n,a):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(o,n,a,t);else for(var s=o.length-1;s>=0;s--)(i=o[s])&&(r=(e<3?i(r):e>3?i(n,a,r):i(n,a))||r);return e>3&&r&&Object.defineProperty(n,a,r),r},g=this&&this.__param||function(o,n){return function(a,t){n(a,t,o)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseZone=c.Linkifier=void 0;var u=w(0),l=w(1),d=function(){function o(n,a,t){this._bufferService=n,this._logService=a,this._unicodeService=t,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new u.EventEmitter,this._onHideLinkUnderline=new u.EventEmitter,this._onLinkTooltip=new u.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(o.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),o.prototype.attachToDom=function(n,a){this._element=n,this._mouseZoneManager=a},o.prototype.linkifyRows=function(n,a){var t=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=n,this._rowsToLinkify.end=a):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,n),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,a)),this._mouseZoneManager.clearAll(n,a),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return t._linkifyRows()},o._timeBeforeLatency))},o.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var n=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var a=n.ydisp+this._rowsToLinkify.start;if(!(a>=n.lines.length)){for(var t=n.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,i=Math.ceil(2e3/this._bufferService.cols),e=this._bufferService.buffer.iterator(!1,a,t,i,i);e.hasNext();)for(var r=e.next(),s=0;s<this._linkMatchers.length;s++)this._doLinkifyRow(r.range.first,r.content,this._linkMatchers[s]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},o.prototype.registerLinkMatcher=function(n,a,t){if(t===void 0&&(t={}),!a)throw new Error("handler must be defined");var i={id:this._nextLinkMatcherId++,regex:n,handler:a,matchIndex:t.matchIndex,validationCallback:t.validationCallback,hoverTooltipCallback:t.tooltipCallback,hoverLeaveCallback:t.leaveCallback,willLinkActivate:t.willLinkActivate,priority:t.priority||0};return this._addLinkMatcherToList(i),i.id},o.prototype._addLinkMatcherToList=function(n){if(this._linkMatchers.length!==0){for(var a=this._linkMatchers.length-1;a>=0;a--)if(n.priority<=this._linkMatchers[a].priority)return void this._linkMatchers.splice(a+1,0,n);this._linkMatchers.splice(0,0,n)}else this._linkMatchers.push(n)},o.prototype.deregisterLinkMatcher=function(n){for(var a=0;a<this._linkMatchers.length;a++)if(this._linkMatchers[a].id===n)return this._linkMatchers.splice(a,1),!0;return!1},o.prototype._doLinkifyRow=function(n,a,t){for(var i,e=this,r=new RegExp(t.regex.source,(t.regex.flags||"")+"g"),s=-1,h=function(){var S=i[typeof t.matchIndex!="number"?0:t.matchIndex];if(!S)return y._logService.debug("match found without corresponding matchIndex",i,t),"break";if(s=a.indexOf(S,s+1),r.lastIndex=s+S.length,s<0)return"break";var v=y._bufferService.buffer.stringIndexToBufferIndex(n,s);if(v[0]<0)return"break";var p=y._bufferService.buffer.lines.get(v[0]);if(!p)return"break";var E=p.getFg(v[1]),A=E?E>>9&511:void 0;t.validationCallback?t.validationCallback(S,function(b){e._rowsTimeoutId||b&&e._addLink(v[1],v[0]-e._bufferService.buffer.ydisp,S,t,A)}):y._addLink(v[1],v[0]-y._bufferService.buffer.ydisp,S,t,A)},y=this;(i=r.exec(a))!==null&&!(h()==="break"););},o.prototype._addLink=function(n,a,t,i,e){var r=this;if(this._mouseZoneManager&&this._element){var s=this._unicodeService.getStringCellWidth(t),h=n%this._bufferService.cols,y=a+Math.floor(n/this._bufferService.cols),S=(h+s)%this._bufferService.cols,v=y+Math.floor((h+s)/this._bufferService.cols);S===0&&(S=this._bufferService.cols,v--),this._mouseZoneManager.add(new _(h+1,y+1,S+1,v+1,function(p){if(i.handler)return i.handler(p,t);var E=window.open();E?(E.opener=null,E.location.href=t):console.warn("Opening link blocked as opener could not be cleared")},function(){r._onShowLinkUnderline.fire(r._createLinkHoverEvent(h,y,S,v,e)),r._element.classList.add("xterm-cursor-pointer")},function(p){r._onLinkTooltip.fire(r._createLinkHoverEvent(h,y,S,v,e)),i.hoverTooltipCallback&&i.hoverTooltipCallback(p,t,{start:{x:h,y},end:{x:S,y:v}})},function(){r._onHideLinkUnderline.fire(r._createLinkHoverEvent(h,y,S,v,e)),r._element.classList.remove("xterm-cursor-pointer"),i.hoverLeaveCallback&&i.hoverLeaveCallback()},function(p){return!i.willLinkActivate||i.willLinkActivate(p,t)}))}},o.prototype._createLinkHoverEvent=function(n,a,t,i,e){return{x1:n,y1:a,x2:t,y2:i,cols:this._bufferService.cols,fg:e}},o._timeBeforeLatency=200,o=f([g(0,l.IBufferService),g(1,l.ILogService),g(2,l.IUnicodeService)],o)}();c.Linkifier=d;var _=function(o,n,a,t,i,e,r,s,h){this.x1=o,this.y1=n,this.x2=a,this.y2=t,this.clickCallback=i,this.hoverCallback=e,this.tooltipCallback=r,this.leaveCallback=s,this.willLinkActivate=h};c.MouseZone=_},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(S,v){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,E){p.__proto__=E}||function(p,E){for(var A in E)E.hasOwnProperty(A)&&(p[A]=E[A])})(S,v)},function(S,v){function p(){this.constructor=S}f(S,v),S.prototype=v===null?Object.create(v):(p.prototype=v.prototype,new p)}),u=this&&this.__decorate||function(S,v,p,E){var A,b=arguments.length,m=b<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,p):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(S,v,p,E);else for(var C=S.length-1;C>=0;C--)(A=S[C])&&(m=(b<3?A(m):b>3?A(v,p,m):A(v,p))||m);return b>3&&m&&Object.defineProperty(v,p,m),m},l=this&&this.__param||function(S,v){return function(p,E){v(p,E,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;var d=w(11),_=w(52),o=w(4),n=w(0),a=w(5),t=w(1),i=w(30),e=w(53),r=w(2),s=String.fromCharCode(160),h=new RegExp(s,"g"),y=function(S){function v(p,E,A,b,m,C,D){var x=S.call(this)||this;return x._element=p,x._screenElement=E,x._bufferService=A,x._coreService=b,x._mouseService=m,x._optionsService=C,x._renderService=D,x._dragScrollAmount=0,x._enabled=!0,x._workCell=new o.CellData,x._mouseDownTimeStamp=0,x._onLinuxMouseSelection=x.register(new n.EventEmitter),x._onRedrawRequest=x.register(new n.EventEmitter),x._onSelectionChange=x.register(new n.EventEmitter),x._onRequestScrollLines=x.register(new n.EventEmitter),x._mouseMoveListener=function(T){return x._onMouseMove(T)},x._mouseUpListener=function(T){return x._onMouseUp(T)},x._coreService.onUserInput(function(){x.hasSelection&&x.clearSelection()}),x._trimListener=x._bufferService.buffer.lines.onTrim(function(T){return x._onTrim(T)}),x.register(x._bufferService.buffers.onBufferActivate(function(T){return x._onBufferActivate(T)})),x.enable(),x._model=new _.SelectionModel(x._bufferService),x._activeSelectionMode=0,x}return g(v,S),Object.defineProperty(v.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),v.prototype.dispose=function(){this._removeMouseDownListeners()},v.prototype.reset=function(){this.clearSelection()},v.prototype.disable=function(){this.clearSelection(),this._enabled=!1},v.prototype.enable=function(){this._enabled=!0},Object.defineProperty(v.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"hasSelection",{get:function(){var p=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!p||!E)&&(p[0]!==E[0]||p[1]!==E[1])},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"selectionText",{get:function(){var p=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!p||!E)return"";var A=this._bufferService.buffer,b=[];if(this._activeSelectionMode===3){if(p[0]===E[0])return"";for(var m=p[1];m<=E[1];m++){var C=A.translateBufferLineToString(m,!0,p[0],E[0]);b.push(C)}}else{var D=p[1]===E[1]?E[0]:void 0;for(b.push(A.translateBufferLineToString(p[1],!0,p[0],D)),m=p[1]+1;m<=E[1]-1;m++){var x=A.lines.get(m);C=A.translateBufferLineToString(m,!0),x&&x.isWrapped?b[b.length-1]+=C:b.push(C)}p[1]!==E[1]&&(x=A.lines.get(E[1]),C=A.translateBufferLineToString(E[1],!0,0,E[0]),x&&x.isWrapped?b[b.length-1]+=C:b.push(C))}return b.map(function(T){return T.replace(h," ")}).join(d.isWindows?`\r
|
|
|
`:`
|
|
|
`)},enumerable:!1,configurable:!0}),v.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},v.prototype.refresh=function(p){var E=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return E._refresh()})),d.isLinux&&p)&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},v.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},v.prototype.isClickInSelection=function(p){var E=this._getMouseBufferCoords(p),A=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!!(A&&b&&E)&&this._areCoordsInSelection(E,A,b)},v.prototype._areCoordsInSelection=function(p,E,A){return p[1]>E[1]&&p[1]<A[1]||E[1]===A[1]&&p[1]===E[1]&&p[0]>=E[0]&&p[0]<A[0]||E[1]<A[1]&&p[1]===A[1]&&p[0]<A[0]||E[1]<A[1]&&p[1]===E[1]&&p[0]>=E[0]},v.prototype.selectWordAtCursor=function(p){var E=this._getMouseBufferCoords(p);E&&(this._selectWordAt(E,!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(p,E){this._model.clearSelection(),p=Math.max(p,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,p],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()},v.prototype._onTrim=function(p){this._model.onTrim(p)&&this.refresh()},v.prototype._getMouseBufferCoords=function(p){var E=this._mouseService.getCoords(p,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E},v.prototype._getMouseEventScrollAmount=function(p){var E=i.getCoordsRelativeToElement(p,this._screenElement)[1],A=this._renderService.dimensions.canvasHeight;return E>=0&&E<=A?0:(E>A&&(E-=A),E=Math.min(Math.max(E,-50),50),(E/=50)/Math.abs(E)+Math.round(14*E))},v.prototype.shouldForceSelection=function(p){return d.isMac?p.altKey&&this._optionsService.options.macOptionClickForcesSelection:p.shiftKey},v.prototype.onMouseDown=function(p){if(this._mouseDownTimeStamp=p.timeStamp,(p.button!==2||!this.hasSelection)&&p.button===0){if(!this._enabled){if(!this.shouldForceSelection(p))return;p.stopPropagation()}p.preventDefault(),this._dragScrollAmount=0,this._enabled&&p.shiftKey?this._onIncrementalClick(p):p.detail===1?this._onSingleClick(p):p.detail===2?this._onDoubleClick(p):p.detail===3&&this._onTripleClick(p),this._addMouseDownListeners(),this.refresh(!0)}},v.prototype._addMouseDownListeners=function(){var p=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return p._dragScroll()},50)},v.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},v.prototype._onIncrementalClick=function(p){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(p))},v.prototype._onSingleClick=function(p){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(p)?3:0,this._model.selectionStart=this._getMouseBufferCoords(p),this._model.selectionStart){this._model.selectionEnd=void 0;var E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},v.prototype._onDoubleClick=function(p){var E=this._getMouseBufferCoords(p);E&&(this._activeSelectionMode=1,this._selectWordAt(E,!0))},v.prototype._onTripleClick=function(p){var E=this._getMouseBufferCoords(p);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))},v.prototype.shouldColumnSelect=function(p){return p.altKey&&!(d.isMac&&this._optionsService.options.macOptionClickForcesSelection)},v.prototype._onMouseMove=function(p){if(p.stopImmediatePropagation(),this._model.selectionStart){var E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(p),this._model.selectionEnd){this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(p),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var A=this._bufferService.buffer;if(this._model.selectionEnd[1]<A.lines.length){var b=A.lines.get(this._model.selectionEnd[1]);b&&b.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}},v.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var p=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(p.ydisp+this._bufferService.rows,p.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=p.ydisp),this.refresh()}},v.prototype._onMouseUp=function(p){var E=p.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&p.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var A=this._mouseService.getCoords(p,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(A&&A[0]!==void 0&&A[1]!==void 0){var b=e.moveToCellSequence(A[0]-1,A[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(b,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},v.prototype._onBufferActivate=function(p){var E=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=p.activeBuffer.lines.onTrim(function(A){return E._onTrim(A)})},v.prototype._convertViewportColToCharacterIndex=function(p,E){for(var A=E[0],b=0;E[0]>=b;b++){var m=p.loadCell(b,this._workCell).getChars().length;this._workCell.getWidth()===0?A--:m>1&&E[0]!==b&&(A+=m-1)}return A},v.prototype.setSelection=function(p,E,A){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[p,E],this._model.selectionStartLength=A,this.refresh()},v.prototype._getWordAt=function(p,E,A,b){if(A===void 0&&(A=!0),b===void 0&&(b=!0),!(p[0]>=this._bufferService.cols)){var m=this._bufferService.buffer,C=m.lines.get(p[1]);if(C){var D=m.translateBufferLineToString(p[1],!1),x=this._convertViewportColToCharacterIndex(C,p),T=x,M=p[0]-x,P=0,q=0,N=0,L=0;if(D.charAt(x)===" "){for(;x>0&&D.charAt(x-1)===" ";)x--;for(;T<D.length&&D.charAt(T+1)===" ";)T++}else{var O=p[0],R=p[0];C.getWidth(O)===0&&(P++,O--),C.getWidth(R)===2&&(q++,R++);var I=C.getString(R).length;for(I>1&&(L+=I-1,T+=I-1);O>0&&x>0&&!this._isCharWordSeparator(C.loadCell(O-1,this._workCell));){C.loadCell(O-1,this._workCell);var k=this._workCell.getChars().length;this._workCell.getWidth()===0?(P++,O--):k>1&&(N+=k-1,x-=k-1),x--,O--}for(;R<C.length&&T+1<D.length&&!this._isCharWordSeparator(C.loadCell(R+1,this._workCell));){C.loadCell(R+1,this._workCell);var U=this._workCell.getChars().length;this._workCell.getWidth()===2?(q++,R++):U>1&&(L+=U-1,T+=U-1),T++,R++}}T++;var z=x+M-P+N,$=Math.min(this._bufferService.cols,T-x+P+q-N-L);if(E||D.slice(x,T).trim()!==""){if(A&&z===0&&C.getCodePoint(0)!==32){var ee=m.lines.get(p[1]-1);if(ee&&C.isWrapped&&ee.getCodePoint(this._bufferService.cols-1)!==32){var re=this._getWordAt([this._bufferService.cols-1,p[1]-1],!1,!0,!1);if(re){var F=this._bufferService.cols-re.start;z-=F,$+=F}}}if(b&&z+$===this._bufferService.cols&&C.getCodePoint(this._bufferService.cols-1)!==32){var J=m.lines.get(p[1]+1);if(J&&J.isWrapped&&J.getCodePoint(0)!==32){var Z=this._getWordAt([0,p[1]+1],!1,!1,!0);Z&&($+=Z.length)}}return{start:z,length:$}}}}},v.prototype._selectWordAt=function(p,E){var A=this._getWordAt(p,E);if(A){for(;A.start<0;)A.start+=this._bufferService.cols,p[1]--;this._model.selectionStart=[A.start,p[1]],this._model.selectionStartLength=A.length}},v.prototype._selectToWordAt=function(p){var E=this._getWordAt(p,!0);if(E){for(var A=p[1];E.start<0;)E.start+=this._bufferService.cols,A--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,A++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,A]}},v.prototype._isCharWordSeparator=function(p){return p.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(p.getChars())>=0},v.prototype._selectLineAt=function(p){var E=this._bufferService.buffer.getWrappedRangeForLine(p);this._model.selectionStart=[0,E.first],this._model.selectionEnd=[this._bufferService.cols,E.last],this._model.selectionStartLength=0},v=u([l(2,t.IBufferService),l(3,t.ICoreService),l(4,a.IMouseService),l(5,t.IOptionsService),l(6,a.IRenderService)],v)}(r.Disposable);c.SelectionService=y},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0;var f=function(){function g(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}return g.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(g.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),g.prototype.areSelectionValuesReversed=function(){var u=this.selectionStart,l=this.selectionEnd;return!(!u||!l)&&(u[1]>l[1]||u[1]===l[1]&&u[0]>l[0])},g.prototype.onTrim=function(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},g}();c.SelectionModel=f},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;var f=w(12);function g(n,a,t,i){var e=n-u(t,n),r=a-u(t,a);return o(Math.abs(e-r)-function(s,h,y){for(var S=0,v=s-u(y,s),p=h-u(y,h),E=0;E<Math.abs(v-p);E++){var A=l(s,h)==="A"?-1:1,b=y.buffer.lines.get(v+A*E);b&&b.isWrapped&&S++}return S}(n,a,t),_(l(n,a),i))}function u(n,a){for(var t=0,i=n.buffer.lines.get(a),e=i&&i.isWrapped;e&&a>=0&&a<n.rows;)t++,e=(i=n.buffer.lines.get(--a))&&i.isWrapped;return t}function l(n,a){return n>a?"A":"B"}function d(n,a,t,i,e,r){for(var s=n,h=a,y="";s!==t||h!==i;)s+=e?1:-1,e&&s>r.cols-1?(y+=r.buffer.translateBufferLineToString(h,!1,n,s),s=0,n=0,h++):!e&&s<0&&(y+=r.buffer.translateBufferLineToString(h,!1,0,n+1),n=s=r.cols-1,h--);return y+r.buffer.translateBufferLineToString(h,!1,n,s)}function _(n,a){var t=a?"O":"[";return f.C0.ESC+t+n}function o(n,a){n=Math.floor(n);for(var t="",i=0;i<n;i++)t+=a;return t}c.moveToCellSequence=function(n,a,t,i){var e,r=t.buffer.x,s=t.buffer.y;if(!t.buffer.hasScrollback)return function(y,S,v,p,E,A){return g(S,p,E,A).length===0?"":o(d(y,S,y,S-u(E,S),!1,E).length,_("D",A))}(r,s,0,a,t,i)+g(s,a,t,i)+function(y,S,v,p,E,A){var b;b=g(S,p,E,A).length>0?p-u(E,p):S;var m=p,C=function(D,x,T,M,P,q){var N;return N=g(T,M,P,q).length>0?M-u(P,M):x,D<T&&N<=M||D>=T&&N<M?"C":"D"}(y,S,v,p,E,A);return o(d(y,b,v,m,C==="C",E).length,_(C,A))}(r,s,n,a,t,i);if(s===a)return e=r>n?"D":"C",o(Math.abs(r-n),_(e,i));e=s>a?"D":"C";var h=Math.abs(s-a);return o(function(y,S){return S.cols-y}(s>a?n:r,t)+(h-1)*t.cols+1+((s>a?r:n)-1),_(e,i))}},function(B,c,w){"use strict";var f=this&&this.__decorate||function(d,_,o,n){var a,t=arguments.length,i=t<3?_:n===null?n=Object.getOwnPropertyDescriptor(_,o):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(d,_,o,n);else for(var e=d.length-1;e>=0;e--)(a=d[e])&&(i=(t<3?a(i):t>3?a(_,o,i):a(_,o))||i);return t>3&&i&&Object.defineProperty(_,o,i),i},g=this&&this.__param||function(d,_){return function(o,n){_(o,n,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SoundService=void 0;var u=w(1),l=function(){function d(_){this._optionsService=_}return Object.defineProperty(d,"audioContext",{get:function(){if(!d._audioContext){var _=window.AudioContext||window.webkitAudioContext;if(!_)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;d._audioContext=new _}return d._audioContext},enumerable:!1,configurable:!0}),d.prototype.playBellSound=function(){var _=d.audioContext;if(_){var o=_.createBufferSource();_.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(n){o.buffer=n,o.connect(_.destination),o.start(0)})}},d.prototype._base64ToArrayBuffer=function(_){for(var o=window.atob(_),n=o.length,a=new Uint8Array(n),t=0;t<n;t++)a[t]=o.charCodeAt(t);return a.buffer},d.prototype._removeMimeType=function(_){return _.split(",")[1]},d=f([g(0,u.IOptionsService)],d)}();c.SoundService=l},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(t,i){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var s in r)r.hasOwnProperty(s)&&(e[s]=r[s])})(t,i)},function(t,i){function e(){this.constructor=t}f(t,i),t.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}),u=this&&this.__decorate||function(t,i,e,r){var s,h=arguments.length,y=h<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(t,i,e,r);else for(var S=t.length-1;S>=0;S--)(s=t[S])&&(y=(h<3?s(y):h>3?s(i,e,y):s(i,e))||y);return h>3&&y&&Object.defineProperty(i,e,y),y},l=this&&this.__param||function(t,i){return function(e,r){i(e,r,t)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseZoneManager=void 0;var d=w(2),_=w(7),o=w(5),n=w(1),a=function(t){function i(e,r,s,h,y,S){var v=t.call(this)||this;return v._element=e,v._screenElement=r,v._bufferService=s,v._mouseService=h,v._selectionService=y,v._optionsService=S,v._zones=[],v._areZonesActive=!1,v._lastHoverCoords=[void 0,void 0],v._initialSelectionLength=0,v.register(_.addDisposableDomListener(v._element,"mousedown",function(p){return v._onMouseDown(p)})),v._mouseMoveListener=function(p){return v._onMouseMove(p)},v._mouseLeaveListener=function(p){return v._onMouseLeave(p)},v._clickListener=function(p){return v._onClick(p)},v}return g(i,t),i.prototype.dispose=function(){t.prototype.dispose.call(this),this._deactivate()},i.prototype.add=function(e){this._zones.push(e),this._zones.length===1&&this._activate()},i.prototype.clearAll=function(e,r){if(this._zones.length!==0){e&&r||(e=0,r=this._bufferService.rows-1);for(var s=0;s<this._zones.length;s++){var h=this._zones[s];(h.y1>e&&h.y1<=r+1||h.y2>e&&h.y2<=r+1||h.y1<e&&h.y2>r+1)&&(this._currentZone&&this._currentZone===h&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(s--,1))}this._zones.length===0&&this._deactivate()}},i.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))},i.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))},i.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},i.prototype._onHover=function(e){var r=this,s=this._findZoneEventAt(e);s!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),s&&(this._currentZone=s,s.hoverCallback&&s.hoverCallback(e),this._tooltipTimeout=window.setTimeout(function(){return r._onTooltip(e)},this._optionsService.options.linkTooltipHoverDuration)))},i.prototype._onTooltip=function(e){this._tooltipTimeout=void 0;var r=this._findZoneEventAt(e);r&&r.tooltipCallback&&r.tooltipCallback(e)},i.prototype._onMouseDown=function(e){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var r=this._findZoneEventAt(e);(r==null?void 0:r.willLinkActivate(e))&&(e.preventDefault(),e.stopImmediatePropagation())}},i.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},i.prototype._onClick=function(e){var r=this._findZoneEventAt(e),s=this._getSelectionLength();r&&s===this._initialSelectionLength&&(r.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},i.prototype._getSelectionLength=function(){var e=this._selectionService.selectionText;return e?e.length:0},i.prototype._findZoneEventAt=function(e){var r=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(r)for(var s=r[0],h=r[1],y=0;y<this._zones.length;y++){var S=this._zones[y];if(S.y1===S.y2){if(h===S.y1&&s>=S.x1&&s<S.x2)return S}else if(h===S.y1&&s>=S.x1||h===S.y2&&s<S.x2||h>S.y1&&h<S.y2)return S}},i=u([l(2,n.IBufferService),l(3,o.IMouseService),l(4,o.ISelectionService),l(5,n.IOptionsService)],i)}(d.Disposable);c.MouseZoneManager=a},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(i,e){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var h in s)s.hasOwnProperty(h)&&(r[h]=s[h])})(i,e)},function(i,e){function r(){this.constructor=i}f(i,e),i.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;var u=w(18),l=w(11),d=w(31),_=w(7),o=w(2),n=w(32),a=w(17),t=function(i){function e(r,s){var h=i.call(this)||this;h._terminal=r,h._renderService=s,h._liveRegionLineCount=0,h._charsToConsume=[],h._charsToAnnounce="",h._accessibilityTreeRoot=document.createElement("div"),h._accessibilityTreeRoot.classList.add("xterm-accessibility"),h._rowContainer=document.createElement("div"),h._rowContainer.classList.add("xterm-accessibility-tree"),h._rowContainer.setAttribute("role","list"),h._rowElements=[];for(var y=0;y<h._terminal.rows;y++)h._rowElements[y]=h._createAccessibilityTreeNode(),h._rowContainer.appendChild(h._rowElements[y]);if(h._topBoundaryFocusListener=function(S){return h._onBoundaryFocus(S,0)},h._bottomBoundaryFocusListener=function(S){return h._onBoundaryFocus(S,1)},h._rowElements[0].addEventListener("focus",h._topBoundaryFocusListener),h._rowElements[h._rowElements.length-1].addEventListener("focus",h._bottomBoundaryFocusListener),h._refreshRowsDimensions(),h._accessibilityTreeRoot.appendChild(h._rowContainer),h._renderRowsDebouncer=new d.RenderDebouncer(h._renderRows.bind(h)),h._refreshRows(),h._liveRegion=document.createElement("div"),h._liveRegion.classList.add("live-region"),h._liveRegion.setAttribute("aria-live","assertive"),h._accessibilityTreeRoot.appendChild(h._liveRegion),!h._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return h._terminal.element.insertAdjacentElement("afterbegin",h._accessibilityTreeRoot),h.register(h._renderRowsDebouncer),h.register(h._terminal.onResize(function(S){return h._onResize(S.rows)})),h.register(h._terminal.onRender(function(S){return h._refreshRows(S.start,S.end)})),h.register(h._terminal.onScroll(function(){return h._refreshRows()})),h.register(h._terminal.onA11yChar(function(S){return h._onChar(S)})),h.register(h._terminal.onLineFeed(function(){return h._onChar(`
|
|
|
`)})),h.register(h._terminal.onA11yTab(function(S){return h._onTab(S)})),h.register(h._terminal.onKey(function(S){return h._onKey(S.key)})),h.register(h._terminal.onBlur(function(){return h._clearLiveRegion()})),h.register(h._renderService.onDimensionsChange(function(){return h._refreshRowsDimensions()})),h._screenDprMonitor=new n.ScreenDprMonitor,h.register(h._screenDprMonitor),h._screenDprMonitor.setListener(function(){return h._refreshRowsDimensions()}),h.register(_.addDisposableDomListener(window,"resize",function(){return h._refreshRowsDimensions()})),h}return g(e,i),e.prototype.dispose=function(){i.prototype.dispose.call(this),a.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},e.prototype._onBoundaryFocus=function(r,s){var h=r.target,y=this._rowElements[s===0?1:this._rowElements.length-2];if(h.getAttribute("aria-posinset")!==(s===0?"1":""+this._terminal.buffer.lines.length)&&r.relatedTarget===y){var S,v;if(s===0?(S=h,v=this._rowElements.pop(),this._rowContainer.removeChild(v)):(S=this._rowElements.shift(),v=h,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),v.removeEventListener("focus",this._bottomBoundaryFocusListener),s===0){var p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else p=this._createAccessibilityTreeNode(),this._rowElements.push(p),this._rowContainer.appendChild(p);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),r.preventDefault(),r.stopImmediatePropagation()}},e.prototype._onResize=function(r){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var s=this._rowContainer.children.length;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);for(;this._rowElements.length>r;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},e.prototype._createAccessibilityTreeNode=function(){var r=document.createElement("div");return r.setAttribute("role","listitem"),r.tabIndex=-1,this._refreshRowDimensions(r),r},e.prototype._onTab=function(r){for(var s=0;s<r;s++)this._onChar(" ")},e.prototype._onChar=function(r){var s=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==r&&(this._charsToAnnounce+=r):this._charsToAnnounce+=r,r===`
|
|
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)),l.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){s._accessibilityTreeRoot.appendChild(s._liveRegion)},0))},e.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,l.isMac&&a.removeElementFromParent(this._liveRegion)},e.prototype._onKey=function(r){this._clearLiveRegion(),this._charsToConsume.push(r)},e.prototype._refreshRows=function(r,s){this._renderRowsDebouncer.refresh(r,s,this._terminal.rows)},e.prototype._renderRows=function(r,s){for(var h=this._terminal.buffer,y=h.lines.length.toString(),S=r;S<=s;S++){var v=h.translateBufferLineToString(h.ydisp+S,!0),p=(h.ydisp+S+1).toString(),E=this._rowElements[S];E&&(v.length===0?E.innerHTML=" ":E.textContent=v,E.setAttribute("aria-posinset",p),E.setAttribute("aria-setsize",y))}this._announceCharacters()},e.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var r=0;r<this._terminal.rows;r++)this._refreshRowDimensions(this._rowElements[r])}},e.prototype._refreshRowDimensions=function(r){r.style.height=this._renderService.dimensions.actualCellHeight+"px"},e.prototype._announceCharacters=function(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},e}(o.Disposable);c.AccessibilityManager=t},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(h,y){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,v){S.__proto__=v}||function(S,v){for(var p in v)v.hasOwnProperty(p)&&(S[p]=v[p])})(h,y)},function(h,y){function S(){this.constructor=h}f(h,y),h.prototype=y===null?Object.create(y):(S.prototype=y.prototype,new S)}),u=this&&this.__decorate||function(h,y,S,v){var p,E=arguments.length,A=E<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(h,y,S,v);else for(var b=h.length-1;b>=0;b--)(p=h[b])&&(A=(E<3?p(A):E>3?p(y,S,A):p(y,S))||A);return E>3&&A&&Object.defineProperty(y,S,A),A},l=this&&this.__param||function(h,y){return function(S,v){y(S,v,h)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;var d=w(58),_=w(9),o=w(2),n=w(5),a=w(1),t=w(0),i=w(10),e=w(17),r=1,s=function(h){function y(S,v,p,E,A,b,m,C,D){var x=h.call(this)||this;return x._colors=S,x._element=v,x._screenElement=p,x._viewportElement=E,x._linkifier=A,x._linkifier2=b,x._charSizeService=m,x._optionsService=C,x._bufferService=D,x._terminalClass=r++,x._rowElements=[],x._rowContainer=document.createElement("div"),x._rowContainer.classList.add("xterm-rows"),x._rowContainer.style.lineHeight="normal",x._rowContainer.setAttribute("aria-hidden","true"),x._refreshRowElements(x._bufferService.cols,x._bufferService.rows),x._selectionContainer=document.createElement("div"),x._selectionContainer.classList.add("xterm-selection"),x._selectionContainer.setAttribute("aria-hidden","true"),x.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},x._updateDimensions(),x._injectCss(),x._rowFactory=new d.DomRendererRowFactory(document,x._optionsService,x._colors),x._element.classList.add("xterm-dom-renderer-owner-"+x._terminalClass),x._screenElement.appendChild(x._rowContainer),x._screenElement.appendChild(x._selectionContainer),x._linkifier.onShowLinkUnderline(function(T){return x._onLinkHover(T)}),x._linkifier.onHideLinkUnderline(function(T){return x._onLinkLeave(T)}),x._linkifier2.onShowLinkUnderline(function(T){return x._onLinkHover(T)}),x._linkifier2.onHideLinkUnderline(function(T){return x._onLinkLeave(T)}),x}return g(y,h),Object.defineProperty(y.prototype,"onRequestRedraw",{get:function(){return new t.EventEmitter().event},enumerable:!1,configurable:!0}),y.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),e.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),h.prototype.dispose.call(this)},y.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var S=0,v=this._rowElements;S<v.length;S++){var p=v[S];p.style.width=this.dimensions.canvasWidth+"px",p.style.height=this.dimensions.actualCellHeight+"px",p.style.lineHeight=this.dimensions.actualCellHeight+"px",p.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var E=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=E,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},y.prototype.setColors=function(S){this._colors=S,this._injectCss()},y.prototype._injectCss=function(){var S=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var v=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";v+=this._terminalSelector+" span:not(."+d.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+d.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+d.ITALIC_CLASS+" { font-style: italic;}",v+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",v+="@keyframes blink_block_"+this._terminalClass+" { 0% { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+"; } 50% { background-color: "+this._colors.cursorAccent.css+"; color: "+this._colors.cursor.css+"; }}",v+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+d.CURSOR_CLASS+"."+d.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+d.CURSOR_CLASS+"."+d.CURSOR_BLINK_CLASS+":not(."+d.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+d.CURSOR_CLASS+"."+d.CURSOR_BLINK_CLASS+"."+d.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+d.CURSOR_CLASS+"."+d.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+d.CURSOR_CLASS+"."+d.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+d.CURSOR_CLASS+"."+d.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",v+=this._terminalSelector+" .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" .xterm-selection div { position: absolute; background-color: "+this._colors.selectionTransparent.css+";}",this._colors.ansi.forEach(function(p,E){v+=S._terminalSelector+" .xterm-fg-"+E+" { color: "+p.css+"; }"+S._terminalSelector+" .xterm-bg-"+E+" { background-color: "+p.css+"; }"}),v+=this._terminalSelector+" .xterm-fg-"+_.INVERTED_DEFAULT_COLOR+" { color: "+i.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+_.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=v},y.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},y.prototype._refreshRowElements=function(S,v){for(var p=this._rowElements.length;p<=v;p++){var E=document.createElement("div");this._rowContainer.appendChild(E),this._rowElements.push(E)}for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop())},y.prototype.onResize=function(S,v){this._refreshRowElements(S,v),this._updateDimensions()},y.prototype.onCharSizeChanged=function(){this._updateDimensions()},y.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},y.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},y.prototype.onSelectionChanged=function(S,v,p){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(S&&v){var E=S[1]-this._bufferService.buffer.ydisp,A=v[1]-this._bufferService.buffer.ydisp,b=Math.max(E,0),m=Math.min(A,this._bufferService.rows-1);if(!(b>=this._bufferService.rows||m<0)){var C=document.createDocumentFragment();if(p)C.appendChild(this._createSelectionElement(b,S[0],v[0],m-b+1));else{var D=E===b?S[0]:0,x=b===m?v[0]:this._bufferService.cols;C.appendChild(this._createSelectionElement(b,D,x));var T=m-b-1;if(C.appendChild(this._createSelectionElement(b+1,0,this._bufferService.cols,T)),b!==m){var M=A===m?v[0]:this._bufferService.cols;C.appendChild(this._createSelectionElement(m,0,M))}}this._selectionContainer.appendChild(C)}}},y.prototype._createSelectionElement=function(S,v,p,E){E===void 0&&(E=1);var A=document.createElement("div");return A.style.height=E*this.dimensions.actualCellHeight+"px",A.style.top=S*this.dimensions.actualCellHeight+"px",A.style.left=v*this.dimensions.actualCellWidth+"px",A.style.width=this.dimensions.actualCellWidth*(p-v)+"px",A},y.prototype.onCursorMove=function(){},y.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},y.prototype.clear=function(){for(var S=0,v=this._rowElements;S<v.length;S++)v[S].innerHTML=""},y.prototype.renderRows=function(S,v){for(var p=this._bufferService.buffer.ybase+this._bufferService.buffer.y,E=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),A=this._optionsService.options.cursorBlink,b=S;b<=v;b++){var m=this._rowElements[b];m.innerHTML="";var C=b+this._bufferService.buffer.ydisp,D=this._bufferService.buffer.lines.get(C),x=this._optionsService.options.cursorStyle;m.appendChild(this._rowFactory.createRow(D,C===p,x,E,A,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(y.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),y.prototype.registerCharacterJoiner=function(S){return-1},y.prototype.deregisterCharacterJoiner=function(S){return!1},y.prototype._onLinkHover=function(S){this._setCellUnderline(S.x1,S.x2,S.y1,S.y2,S.cols,!0)},y.prototype._onLinkLeave=function(S){this._setCellUnderline(S.x1,S.x2,S.y1,S.y2,S.cols,!1)},y.prototype._setCellUnderline=function(S,v,p,E,A,b){for(;S!==v||p!==E;){var m=this._rowElements[p];if(!m)return;var C=m.children[S];C&&(C.style.textDecoration=b?"underline":"none"),++S>=A&&(S=0,p++)}},y=u([l(6,n.ICharSizeService),l(7,a.IOptionsService),l(8,a.IBufferService)],y)}(o.Disposable);c.DomRenderer=s},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=c.CURSOR_STYLE_UNDERLINE_CLASS=c.CURSOR_STYLE_BAR_CLASS=c.CURSOR_STYLE_BLOCK_CLASS=c.CURSOR_BLINK_CLASS=c.CURSOR_CLASS=c.UNDERLINE_CLASS=c.ITALIC_CLASS=c.DIM_CLASS=c.BOLD_CLASS=void 0;var f=w(9),g=w(3),u=w(4),l=w(10);c.BOLD_CLASS="xterm-bold",c.DIM_CLASS="xterm-dim",c.ITALIC_CLASS="xterm-italic",c.UNDERLINE_CLASS="xterm-underline",c.CURSOR_CLASS="xterm-cursor",c.CURSOR_BLINK_CLASS="xterm-cursor-blink",c.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",c.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",c.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var d=function(){function o(n,a,t){this._document=n,this._optionsService=a,this._colors=t,this._workCell=new u.CellData}return o.prototype.setColors=function(n){this._colors=n},o.prototype.createRow=function(n,a,t,i,e,r,s){for(var h=this._document.createDocumentFragment(),y=0,S=Math.min(n.length,s)-1;S>=0;S--)if(n.loadCell(S,this._workCell).getCode()!==g.NULL_CELL_CODE||a&&S===i){y=S+1;break}for(S=0;S<y;S++){n.loadCell(S,this._workCell);var v=this._workCell.getWidth();if(v!==0){var p=this._document.createElement("span");if(v>1&&(p.style.width=r*v+"px"),a&&S===i)switch(p.classList.add(c.CURSOR_CLASS),e&&p.classList.add(c.CURSOR_BLINK_CLASS),t){case"bar":p.classList.add(c.CURSOR_STYLE_BAR_CLASS);break;case"underline":p.classList.add(c.CURSOR_STYLE_UNDERLINE_CLASS);break;default:p.classList.add(c.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&p.classList.add(c.BOLD_CLASS),this._workCell.isItalic()&&p.classList.add(c.ITALIC_CLASS),this._workCell.isDim()&&p.classList.add(c.DIM_CLASS),this._workCell.isUnderline()&&p.classList.add(c.UNDERLINE_CLASS),this._workCell.isInvisible()?p.textContent=g.WHITESPACE_CELL_CHAR:p.textContent=this._workCell.getChars()||g.WHITESPACE_CELL_CHAR;var E=this._workCell.getFgColor(),A=this._workCell.getFgColorMode(),b=this._workCell.getBgColor(),m=this._workCell.getBgColorMode(),C=!!this._workCell.isInverse();if(C){var D=E;E=b,b=D;var x=A;A=m,m=x}switch(A){case 16777216:case 33554432:this._workCell.isBold()&&E<8&&this._optionsService.options.drawBoldTextInBrightColors&&(E+=8),this._applyMinimumContrast(p,this._colors.background,this._colors.ansi[E])||p.classList.add("xterm-fg-"+E);break;case 50331648:var T=l.rgba.toColor(E>>16&255,E>>8&255,255&E);this._applyMinimumContrast(p,this._colors.background,T)||this._addStyle(p,"color:#"+_(E.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(p,this._colors.background,this._colors.foreground)||C&&p.classList.add("xterm-fg-"+f.INVERTED_DEFAULT_COLOR)}switch(m){case 16777216:case 33554432:p.classList.add("xterm-bg-"+b);break;case 50331648:this._addStyle(p,"background-color:#"+_(b.toString(16),"0",6));break;case 0:default:C&&p.classList.add("xterm-bg-"+f.INVERTED_DEFAULT_COLOR)}h.appendChild(p)}}return h},o.prototype._applyMinimumContrast=function(n,a,t){if(this._optionsService.options.minimumContrastRatio===1)return!1;var i=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return i===void 0&&(i=l.color.ensureContrastRatio(a,t,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,i!=null?i:null)),!!i&&(this._addStyle(n,"color:"+i.css),!0)},o.prototype._addStyle=function(n,a){n.setAttribute("style",""+(n.getAttribute("style")||"")+a+";")},o}();function _(o,n,a){for(;o.length<a;)o=n+o;return o}c.DomRendererRowFactory=d},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;var f=w(12),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};c.evaluateKeyboardEvent=function(u,l,d,_){var o={type:0,cancel:!1,key:void 0},n=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?o.key=l?f.C0.ESC+"OA":f.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?o.key=l?f.C0.ESC+"OD":f.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?o.key=l?f.C0.ESC+"OC":f.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(o.key=l?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:if(u.shiftKey){o.key=f.C0.BS;break}if(u.altKey){o.key=f.C0.ESC+f.C0.DEL;break}o.key=f.C0.DEL;break;case 9:if(u.shiftKey){o.key=f.C0.ESC+"[Z";break}o.key=f.C0.HT,o.cancel=!0;break;case 13:o.key=u.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,o.cancel=!0;break;case 27:o.key=f.C0.ESC,u.altKey&&(o.key=f.C0.ESC+f.C0.ESC),o.cancel=!0;break;case 37:if(u.metaKey)break;n?(o.key=f.C0.ESC+"[1;"+(n+1)+"D",o.key===f.C0.ESC+"[1;3D"&&(o.key=f.C0.ESC+(d?"b":"[1;5D"))):o.key=l?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(u.metaKey)break;n?(o.key=f.C0.ESC+"[1;"+(n+1)+"C",o.key===f.C0.ESC+"[1;3C"&&(o.key=f.C0.ESC+(d?"f":"[1;5C"))):o.key=l?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(u.metaKey)break;n?(o.key=f.C0.ESC+"[1;"+(n+1)+"A",d||o.key!==f.C0.ESC+"[1;3A"||(o.key=f.C0.ESC+"[1;5A")):o.key=l?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(u.metaKey)break;n?(o.key=f.C0.ESC+"[1;"+(n+1)+"B",d||o.key!==f.C0.ESC+"[1;3B"||(o.key=f.C0.ESC+"[1;5B")):o.key=l?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(o.key=f.C0.ESC+"[2~");break;case 46:o.key=n?f.C0.ESC+"[3;"+(n+1)+"~":f.C0.ESC+"[3~";break;case 36:o.key=n?f.C0.ESC+"[1;"+(n+1)+"H":l?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:o.key=n?f.C0.ESC+"[1;"+(n+1)+"F":l?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:u.shiftKey?o.type=2:o.key=f.C0.ESC+"[5~";break;case 34:u.shiftKey?o.type=3:o.key=f.C0.ESC+"[6~";break;case 112:o.key=n?f.C0.ESC+"[1;"+(n+1)+"P":f.C0.ESC+"OP";break;case 113:o.key=n?f.C0.ESC+"[1;"+(n+1)+"Q":f.C0.ESC+"OQ";break;case 114:o.key=n?f.C0.ESC+"[1;"+(n+1)+"R":f.C0.ESC+"OR";break;case 115:o.key=n?f.C0.ESC+"[1;"+(n+1)+"S":f.C0.ESC+"OS";break;case 116:o.key=n?f.C0.ESC+"[15;"+(n+1)+"~":f.C0.ESC+"[15~";break;case 117:o.key=n?f.C0.ESC+"[17;"+(n+1)+"~":f.C0.ESC+"[17~";break;case 118:o.key=n?f.C0.ESC+"[18;"+(n+1)+"~":f.C0.ESC+"[18~";break;case 119:o.key=n?f.C0.ESC+"[19;"+(n+1)+"~":f.C0.ESC+"[19~";break;case 120:o.key=n?f.C0.ESC+"[20;"+(n+1)+"~":f.C0.ESC+"[20~";break;case 121:o.key=n?f.C0.ESC+"[21;"+(n+1)+"~":f.C0.ESC+"[21~";break;case 122:o.key=n?f.C0.ESC+"[23;"+(n+1)+"~":f.C0.ESC+"[23~";break;case 123:o.key=n?f.C0.ESC+"[24;"+(n+1)+"~":f.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(d&&!_||!u.altKey||u.metaKey)d&&!u.altKey&&!u.ctrlKey&&u.metaKey?u.keyCode===65&&(o.type=1):u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?o.key=u.key:u.key&&u.ctrlKey&&u.key==="_"&&(o.key=f.C0.US);else{var a=g[u.keyCode],t=a&&a[u.shiftKey?1:0];if(t)o.key=f.C0.ESC+t;else if(u.keyCode>=65&&u.keyCode<=90){var i=u.ctrlKey?u.keyCode-64:u.keyCode+32;o.key=f.C0.ESC+String.fromCharCode(i)}}else u.keyCode>=65&&u.keyCode<=90?o.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?o.key=f.C0.NUL:u.keyCode>=51&&u.keyCode<=55?o.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?o.key=f.C0.DEL:u.keyCode===219?o.key=f.C0.ESC:u.keyCode===220?o.key=f.C0.FS:u.keyCode===221&&(o.key=f.C0.GS)}return o}},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(r,s){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var S in y)y.hasOwnProperty(S)&&(h[S]=y[S])})(r,s)},function(r,s){function h(){this.constructor=r}f(r,s),r.prototype=s===null?Object.create(s):(h.prototype=s.prototype,new h)}),u=this&&this.__decorate||function(r,s,h,y){var S,v=arguments.length,p=v<3?s:y===null?y=Object.getOwnPropertyDescriptor(s,h):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(r,s,h,y);else for(var E=r.length-1;E>=0;E--)(S=r[E])&&(p=(v<3?S(p):v>3?S(s,h,p):S(s,h))||p);return v>3&&p&&Object.defineProperty(s,h,p),p},l=this&&this.__param||function(r,s){return function(h,y){s(h,y,r)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;var d=w(31),_=w(0),o=w(2),n=w(32),a=w(7),t=w(1),i=w(5),e=function(r){function s(h,y,S,v,p,E){var A=r.call(this)||this;if(A._renderer=h,A._rowCount=y,A._isPaused=!1,A._needsFullRefresh=!1,A._isNextRenderRedrawOnly=!0,A._needsSelectionRefresh=!1,A._canvasWidth=0,A._canvasHeight=0,A._selectionState={start:void 0,end:void 0,columnSelectMode:!1},A._onDimensionsChange=new _.EventEmitter,A._onRender=new _.EventEmitter,A._onRefreshRequest=new _.EventEmitter,A.register({dispose:function(){return A._renderer.dispose()}}),A._renderDebouncer=new d.RenderDebouncer(function(m,C){return A._renderRows(m,C)}),A.register(A._renderDebouncer),A._screenDprMonitor=new n.ScreenDprMonitor,A._screenDprMonitor.setListener(function(){return A.onDevicePixelRatioChange()}),A.register(A._screenDprMonitor),A.register(E.onResize(function(m){return A._fullRefresh()})),A.register(v.onOptionChange(function(){return A._renderer.onOptionsChanged()})),A.register(p.onCharSizeChange(function(){return A.onCharSizeChanged()})),A._renderer.onRequestRedraw(function(m){return A.refreshRows(m.start,m.end,!0)}),A.register(a.addDisposableDomListener(window,"resize",function(){return A.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var b=new IntersectionObserver(function(m){return A._onIntersectionChange(m[m.length-1])},{threshold:0});b.observe(S),A.register({dispose:function(){return b.disconnect()}})}return A}return g(s,r),Object.defineProperty(s.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),s.prototype._onIntersectionChange=function(h){this._isPaused=h.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},s.prototype.refreshRows=function(h,y,S){S===void 0&&(S=!1),this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(h,y,this._rowCount))},s.prototype._renderRows=function(h,y){this._renderer.renderRows(h,y),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:h,end:y}),this._isNextRenderRedrawOnly=!0},s.prototype.resize=function(h,y){this._rowCount=y,this._fireOnCanvasResize()},s.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},s.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},s.prototype.dispose=function(){r.prototype.dispose.call(this)},s.prototype.setRenderer=function(h){var y=this;this._renderer.dispose(),this._renderer=h,this._renderer.onRequestRedraw(function(S){return y.refreshRows(S.start,S.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},s.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},s.prototype.setColors=function(h){this._renderer.setColors(h),this._fullRefresh()},s.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},s.prototype.onResize=function(h,y){this._renderer.onResize(h,y),this._fullRefresh()},s.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},s.prototype.onBlur=function(){this._renderer.onBlur()},s.prototype.onFocus=function(){this._renderer.onFocus()},s.prototype.onSelectionChanged=function(h,y,S){this._selectionState.start=h,this._selectionState.end=y,this._selectionState.columnSelectMode=S,this._renderer.onSelectionChanged(h,y,S)},s.prototype.onCursorMove=function(){this._renderer.onCursorMove()},s.prototype.clear=function(){this._renderer.clear()},s.prototype.registerCharacterJoiner=function(h){return this._renderer.registerCharacterJoiner(h)},s.prototype.deregisterCharacterJoiner=function(h){return this._renderer.deregisterCharacterJoiner(h)},s=u([l(3,t.IOptionsService),l(4,i.ICharSizeService),l(5,t.IBufferService)],s)}(o.Disposable);c.RenderService=e},function(B,c,w){"use strict";var f=this&&this.__decorate||function(o,n,a,t){var i,e=arguments.length,r=e<3?n:t===null?t=Object.getOwnPropertyDescriptor(n,a):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(o,n,a,t);else for(var s=o.length-1;s>=0;s--)(i=o[s])&&(r=(e<3?i(r):e>3?i(n,a,r):i(n,a))||r);return e>3&&r&&Object.defineProperty(n,a,r),r},g=this&&this.__param||function(o,n){return function(a,t){n(a,t,o)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;var u=w(1),l=w(0),d=function(){function o(n,a,t){this._optionsService=t,this.width=0,this.height=0,this._onCharSizeChange=new l.EventEmitter,this._measureStrategy=new _(n,a,this._optionsService)}return Object.defineProperty(o.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),o.prototype.measure=function(){var n=this._measureStrategy.measure();n.width===this.width&&n.height===this.height||(this.width=n.width,this.height=n.height,this._onCharSizeChange.fire())},o=f([g(2,u.IOptionsService)],o)}();c.CharSizeService=d;var _=function(){function o(n,a,t){this._document=n,this._parentElement=a,this._optionsService=t,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return o.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var n=this._measureElement.getBoundingClientRect();return n.width!==0&&n.height!==0&&(this._result.width=n.width,this._result.height=Math.ceil(n.height)),this._result},o}()},function(B,c,w){"use strict";var f=this&&this.__decorate||function(_,o,n,a){var t,i=arguments.length,e=i<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(_,o,n,a);else for(var r=_.length-1;r>=0;r--)(t=_[r])&&(e=(i<3?t(e):i>3?t(o,n,e):t(o,n))||e);return i>3&&e&&Object.defineProperty(o,n,e),e},g=this&&this.__param||function(_,o){return function(n,a){o(n,a,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;var u=w(5),l=w(30),d=function(){function _(o,n){this._renderService=o,this._charSizeService=n}return _.prototype.getCoords=function(o,n,a,t,i){return l.getCoords(o,n,a,t,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,i)},_.prototype.getRawByteCoords=function(o,n,a,t){var i=this.getCoords(o,n,a,t);return l.getRawByteCoords(i)},_=f([g(0,u.IRenderService),g(1,u.ICharSizeService)],_)}();c.MouseService=d},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(t,i){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var s in r)r.hasOwnProperty(s)&&(e[s]=r[s])})(t,i)},function(t,i){function e(){this.constructor=t}f(t,i),t.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}),u=this&&this.__decorate||function(t,i,e,r){var s,h=arguments.length,y=h<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(t,i,e,r);else for(var S=t.length-1;S>=0;S--)(s=t[S])&&(y=(h<3?s(y):h>3?s(i,e,y):s(i,e))||y);return h>3&&y&&Object.defineProperty(i,e,y),y},l=this&&this.__param||function(t,i){return function(e,r){i(e,r,t)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier2=void 0;var d=w(1),_=w(0),o=w(2),n=w(7),a=function(t){function i(e){var r=t.call(this)||this;return r._bufferService=e,r._linkProviders=[],r._linkCacheDisposables=[],r._isMouseOut=!0,r._activeLine=-1,r._onShowLinkUnderline=r.register(new _.EventEmitter),r._onHideLinkUnderline=r.register(new _.EventEmitter),r.register(o.getDisposeArrayDisposable(r._linkCacheDisposables)),r}return g(i,t),Object.defineProperty(i.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),i.prototype.registerLinkProvider=function(e){var r=this;return this._linkProviders.push(e),{dispose:function(){var s=r._linkProviders.indexOf(e);s!==-1&&r._linkProviders.splice(s,1)}}},i.prototype.attachToDom=function(e,r,s){var h=this;this._element=e,this._mouseService=r,this._renderService=s,this.register(n.addDisposableDomListener(this._element,"mouseleave",function(){h._isMouseOut=!0,h._clearCurrentLink()})),this.register(n.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(n.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},i.prototype._onMouseMove=function(e){if(this._lastMouseEvent=e,this._element&&this._mouseService){var r=this._positionFromMouseEvent(e,this._element,this._mouseService);if(r){this._isMouseOut=!1;for(var s=e.composedPath(),h=0;h<s.length;h++){var y=s[h];if(y.classList.contains("xterm"))break;if(y.classList.contains("xterm-hover"))return}this._lastBufferCell&&r.x===this._lastBufferCell.x&&r.y===this._lastBufferCell.y||(this._onHover(r),this._lastBufferCell=r)}}},i.prototype._onHover=function(e){if(this._activeLine!==e.y)return this._clearCurrentLink(),void this._askForLink(e,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))},i.prototype._askForLink=function(e,r){var s=this;this._activeProviderReplies&&r||(this._activeProviderReplies=new Map,this._activeLine=e.y);var h=!1;this._linkProviders.forEach(function(y,S){var v;r?((v=s._activeProviderReplies)===null||v===void 0?void 0:v.get(S))&&(h=s._checkLinkProviderResult(S,e,h)):y.provideLinks(e.y,function(p){var E,A;if(!s._isMouseOut){var b=p==null?void 0:p.map(function(m){return{link:m}});(E=s._activeProviderReplies)===null||E===void 0||E.set(S,b),h=s._checkLinkProviderResult(S,e,h),((A=s._activeProviderReplies)===null||A===void 0?void 0:A.size)===s._linkProviders.length&&s._removeIntersectingLinks(e.y,s._activeProviderReplies)}})})},i.prototype._removeIntersectingLinks=function(e,r){for(var s=new Set,h=0;h<r.size;h++){var y=r.get(h);if(y)for(var S=0;S<y.length;S++)for(var v=y[S],p=v.link.range.start.y<e?0:v.link.range.start.x,E=v.link.range.end.y>e?this._bufferService.cols:v.link.range.end.x,A=p;A<=E;A++){if(s.has(A)){y.splice(S--,1);break}s.add(A)}}},i.prototype._checkLinkProviderResult=function(e,r,s){var h,y=this;if(!this._activeProviderReplies)return s;for(var S=this._activeProviderReplies.get(e),v=!1,p=0;p<e;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(v=!0);if(!v&&S){var E=S.find(function(b){return y._linkAtPosition(b.link,r)});E&&(s=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviders.length&&!s)for(p=0;p<this._activeProviderReplies.size;p++){var A=(h=this._activeProviderReplies.get(p))===null||h===void 0?void 0:h.find(function(b){return y._linkAtPosition(b.link,r)});if(A){s=!0,this._handleNewLink(A);break}}return s},i.prototype._onClick=function(e){if(this._element&&this._mouseService&&this._currentLink){var r=this._positionFromMouseEvent(e,this._element,this._mouseService);r&&this._linkAtPosition(this._currentLink.link,r)&&this._currentLink.link.activate(e,this._currentLink.link.text)}},i.prototype._clearCurrentLink=function(e,r){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!r||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=r)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,o.disposeArray(this._linkCacheDisposables))},i.prototype._handleNewLink=function(e){var r=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(e.link,s)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:function(){var h,y;return(y=(h=r._currentLink)===null||h===void 0?void 0:h.state)===null||y===void 0?void 0:y.decorations.pointerCursor},set:function(h){var y,S;((y=r._currentLink)===null||y===void 0?void 0:y.state)&&r._currentLink.state.decorations.pointerCursor!==h&&(r._currentLink.state.decorations.pointerCursor=h,r._currentLink.state.isHovered&&((S=r._element)===null||S===void 0||S.classList.toggle("xterm-cursor-pointer",h)))}},underline:{get:function(){var h,y;return(y=(h=r._currentLink)===null||h===void 0?void 0:h.state)===null||y===void 0?void 0:y.decorations.underline},set:function(h){var y,S,v;((y=r._currentLink)===null||y===void 0?void 0:y.state)&&((v=(S=r._currentLink)===null||S===void 0?void 0:S.state)===null||v===void 0?void 0:v.decorations.underline)!==h&&(r._currentLink.state.decorations.underline=h,r._currentLink.state.isHovered&&r._fireUnderlineEvent(e.link,h))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(h){var y=h.start===0?0:h.start+1+r._bufferService.buffer.ydisp;r._clearCurrentLink(y,h.end+1+r._bufferService.buffer.ydisp)})))}},i.prototype._linkHover=function(e,r,s){var h;((h=this._currentLink)===null||h===void 0?void 0:h.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),r.hover&&r.hover(s,r.text)},i.prototype._fireUnderlineEvent=function(e,r){var s=e.range,h=this._bufferService.buffer.ydisp,y=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-h-1,s.end.x,s.end.y-h-1,void 0);(r?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(y)},i.prototype._linkLeave=function(e,r,s){var h;((h=this._currentLink)===null||h===void 0?void 0:h.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),r.leave&&r.leave(s,r.text)},i.prototype._linkAtPosition=function(e,r){var s=e.range.start.y===e.range.end.y,h=e.range.start.y<r.y,y=e.range.end.y>r.y;return(s&&e.range.start.x<=r.x&&e.range.end.x>=r.x||h&&e.range.end.x>=r.x||y&&e.range.start.x<=r.x||h&&y)&&e.range.start.y<=r.y&&e.range.end.y>=r.y},i.prototype._positionFromMouseEvent=function(e,r,s){var h=s.getCoords(e,r,this._bufferService.cols,this._bufferService.rows);if(h)return{x:h[0],y:h[1]+this._bufferService.buffer.ydisp}},i.prototype._createLinkUnderlineEvent=function(e,r,s,h,y){return{x1:e,y1:r,x2:s,y2:h,cols:this._bufferService.cols,fg:y}},i=u([l(0,d.IBufferService)],i)}(o.Disposable);c.Linkifier2=a},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;var f=function(){function g(u){this._textarea=u}return Object.defineProperty(g.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),g}();c.CoreBrowserService=f},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(p,E){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,b){A.__proto__=b}||function(A,b){for(var m in b)b.hasOwnProperty(m)&&(A[m]=b[m])})(p,E)},function(p,E){function A(){this.constructor=p}f(p,E),p.prototype=E===null?Object.create(E):(A.prototype=E.prototype,new A)});Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;var u=w(2),l=w(1),d=w(66),_=w(67),o=w(68),n=w(74),a=w(75),t=w(0),i=w(76),e=w(77),r=w(78),s=w(80),h=w(81),y=w(19),S=w(82),v=function(p){function E(A){var b=p.call(this)||this;return b._onBinary=new t.EventEmitter,b._onData=new t.EventEmitter,b._onLineFeed=new t.EventEmitter,b._onResize=new t.EventEmitter,b._onScroll=new t.EventEmitter,b._instantiationService=new d.InstantiationService,b.optionsService=new n.OptionsService(A),b._instantiationService.setService(l.IOptionsService,b.optionsService),b._bufferService=b.register(b._instantiationService.createInstance(o.BufferService)),b._instantiationService.setService(l.IBufferService,b._bufferService),b._logService=b._instantiationService.createInstance(_.LogService),b._instantiationService.setService(l.ILogService,b._logService),b._coreService=b.register(b._instantiationService.createInstance(a.CoreService,function(){return b.scrollToBottom()})),b._instantiationService.setService(l.ICoreService,b._coreService),b._coreMouseService=b._instantiationService.createInstance(i.CoreMouseService),b._instantiationService.setService(l.ICoreMouseService,b._coreMouseService),b._dirtyRowService=b._instantiationService.createInstance(e.DirtyRowService),b._instantiationService.setService(l.IDirtyRowService,b._dirtyRowService),b.unicodeService=b._instantiationService.createInstance(r.UnicodeService),b._instantiationService.setService(l.IUnicodeService,b.unicodeService),b._charsetService=b._instantiationService.createInstance(s.CharsetService),b._instantiationService.setService(l.ICharsetService,b._charsetService),b._inputHandler=new y.InputHandler(b._bufferService,b._charsetService,b._coreService,b._dirtyRowService,b._logService,b.optionsService,b._coreMouseService,b.unicodeService),b.register(t.forwardEvent(b._inputHandler.onLineFeed,b._onLineFeed)),b.register(b._inputHandler),b.register(t.forwardEvent(b._bufferService.onResize,b._onResize)),b.register(t.forwardEvent(b._coreService.onData,b._onData)),b.register(t.forwardEvent(b._coreService.onBinary,b._onBinary)),b.register(b.optionsService.onOptionChange(function(m){return b._updateOptions(m)})),b._writeBuffer=new S.WriteBuffer(function(m){return b._inputHandler.parse(m)}),b}return g(E,p),Object.defineProperty(E.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),E.prototype.dispose=function(){var A;this._isDisposed||(p.prototype.dispose.call(this),(A=this._windowsMode)===null||A===void 0||A.dispose(),this._windowsMode=void 0)},E.prototype.write=function(A,b){this._writeBuffer.write(A,b)},E.prototype.writeSync=function(A){this._writeBuffer.writeSync(A)},E.prototype.resize=function(A,b){isNaN(A)||isNaN(b)||(A=Math.max(A,o.MINIMUM_COLS),b=Math.max(b,o.MINIMUM_ROWS),this._bufferService.resize(A,b))},E.prototype.scroll=function(A,b){b===void 0&&(b=!1);var m,C=this._bufferService.buffer;(m=this._cachedBlankLine)&&m.length===this.cols&&m.getFg(0)===A.fg&&m.getBg(0)===A.bg||(m=C.getBlankLine(A,b),this._cachedBlankLine=m),m.isWrapped=b;var D=C.ybase+C.scrollTop,x=C.ybase+C.scrollBottom;if(C.scrollTop===0){var T=C.lines.isFull;x===C.lines.length-1?T?C.lines.recycle().copyFrom(m):C.lines.push(m.clone()):C.lines.splice(x+1,0,m.clone()),T?this._bufferService.isUserScrolling&&(C.ydisp=Math.max(C.ydisp-1,0)):(C.ybase++,this._bufferService.isUserScrolling||C.ydisp++)}else{var M=x-D+1;C.lines.shiftElements(D+1,M-1,-1),C.lines.set(x,m.clone())}this._bufferService.isUserScrolling||(C.ydisp=C.ybase),this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom),this._onScroll.fire(C.ydisp)},E.prototype.scrollLines=function(A,b){var m=this._bufferService.buffer;if(A<0){if(m.ydisp===0)return;this._bufferService.isUserScrolling=!0}else A+m.ydisp>=m.ybase&&(this._bufferService.isUserScrolling=!1);var C=m.ydisp;m.ydisp=Math.max(Math.min(m.ydisp+A,m.ybase),0),C!==m.ydisp&&(b||this._onScroll.fire(m.ydisp))},E.prototype.scrollPages=function(A){this.scrollLines(A*(this.rows-1))},E.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},E.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},E.prototype.scrollToLine=function(A){var b=A-this._bufferService.buffer.ydisp;b!==0&&this.scrollLines(b)},E.prototype.addEscHandler=function(A,b){return this._inputHandler.addEscHandler(A,b)},E.prototype.addDcsHandler=function(A,b){return this._inputHandler.addDcsHandler(A,b)},E.prototype.addCsiHandler=function(A,b){return this._inputHandler.addCsiHandler(A,b)},E.prototype.addOscHandler=function(A,b){return this._inputHandler.addOscHandler(A,b)},E.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},E.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},E.prototype._updateOptions=function(A){var b;switch(A){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((b=this._windowsMode)===null||b===void 0||b.dispose(),this._windowsMode=void 0)}},E.prototype._enableWindowsMode=function(){var A=this;if(!this._windowsMode){var b=[];b.push(this.onLineFeed(h.updateWindowsModeWrappedState.bind(null,this._bufferService))),b.push(this.addCsiHandler({final:"H"},function(){return h.updateWindowsModeWrappedState(A._bufferService),!1})),this._windowsMode={dispose:function(){for(var m=0,C=b;m<C.length;m++)C[m].dispose()}}}},E}(u.Disposable);c.CoreTerminal=v},function(B,c,w){"use strict";var f=this&&this.__spreadArrays||function(){for(var _=0,o=0,n=arguments.length;o<n;o++)_+=arguments[o].length;var a=Array(_),t=0;for(o=0;o<n;o++)for(var i=arguments[o],e=0,r=i.length;e<r;e++,t++)a[t]=i[e];return a};Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;var g=w(1),u=w(14),l=function(){function _(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];this._entries=new Map;for(var a=0,t=o;a<t.length;a++){var i=t[a],e=i[0],r=i[1];this.set(e,r)}}return _.prototype.set=function(o,n){var a=this._entries.get(o);return this._entries.set(o,n),a},_.prototype.forEach=function(o){this._entries.forEach(function(n,a){return o(a,n)})},_.prototype.has=function(o){return this._entries.has(o)},_.prototype.get=function(o){return this._entries.get(o)},_}();c.ServiceCollection=l;var d=function(){function _(){this._services=new l,this._services.set(g.IInstantiationService,this)}return _.prototype.setService=function(o,n){this._services.set(o,n)},_.prototype.getService=function(o){return this._services.get(o)},_.prototype.createInstance=function(o){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];for(var t=u.getServiceDependencies(o).sort(function(S,v){return S.index-v.index}),i=[],e=0,r=t;e<r.length;e++){var s=r[e],h=this._services.get(s.id);if(!h)throw new Error("[createInstance] "+o.name+" depends on UNKNOWN service "+s.id+".");i.push(h)}var y=t.length>0?t[0].index:n.length;if(n.length!==y)throw new Error("[createInstance] First service dependency of "+o.name+" at position "+(y+1)+" conflicts with "+n.length+" static arguments");return new(o.bind.apply(o,f([void 0],f(n,i))))},_}();c.InstantiationService=d},function(B,c,w){"use strict";var f=this&&this.__decorate||function(n,a,t,i){var e,r=arguments.length,s=r<3?a:i===null?i=Object.getOwnPropertyDescriptor(a,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,a,t,i);else for(var h=n.length-1;h>=0;h--)(e=n[h])&&(s=(r<3?e(s):r>3?e(a,t,s):e(a,t))||s);return r>3&&s&&Object.defineProperty(a,t,s),s},g=this&&this.__param||function(n,a){return function(t,i){a(t,i,n)}},u=this&&this.__spreadArrays||function(){for(var n=0,a=0,t=arguments.length;a<t;a++)n+=arguments[a].length;var i=Array(n),e=0;for(a=0;a<t;a++)for(var r=arguments[a],s=0,h=r.length;s<h;s++,e++)i[e]=r[s];return i};Object.defineProperty(c,"__esModule",{value:!0}),c.LogService=c.LogLevel=void 0;var l,d=w(1);!function(n){n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR",n[n.OFF=4]="OFF"}(l=c.LogLevel||(c.LogLevel={}));var _={debug:l.DEBUG,info:l.INFO,warn:l.WARN,error:l.ERROR,off:l.OFF},o=function(){function n(a){var t=this;this._optionsService=a,this._updateLogLevel(),this._optionsService.onOptionChange(function(i){i==="logLevel"&&t._updateLogLevel()})}return n.prototype._updateLogLevel=function(){this._logLevel=_[this._optionsService.options.logLevel]},n.prototype._evalLazyOptionalParams=function(a){for(var t=0;t<a.length;t++)typeof a[t]=="function"&&(a[t]=a[t]())},n.prototype._log=function(a,t,i){this._evalLazyOptionalParams(i),a.call.apply(a,u([console,"xterm.js: "+t],i))},n.prototype.debug=function(a){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this._logLevel<=l.DEBUG&&this._log(console.log,a,t)},n.prototype.info=function(a){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this._logLevel<=l.INFO&&this._log(console.info,a,t)},n.prototype.warn=function(a){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this._logLevel<=l.WARN&&this._log(console.warn,a,t)},n.prototype.error=function(a){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this._logLevel<=l.ERROR&&this._log(console.error,a,t)},n=f([g(0,d.IOptionsService)],n)}();c.LogService=o},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(t,i){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var s in r)r.hasOwnProperty(s)&&(e[s]=r[s])})(t,i)},function(t,i){function e(){this.constructor=t}f(t,i),t.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}),u=this&&this.__decorate||function(t,i,e,r){var s,h=arguments.length,y=h<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(t,i,e,r);else for(var S=t.length-1;S>=0;S--)(s=t[S])&&(y=(h<3?s(y):h>3?s(i,e,y):s(i,e))||y);return h>3&&y&&Object.defineProperty(i,e,y),y},l=this&&this.__param||function(t,i){return function(e,r){i(e,r,t)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;var d=w(1),_=w(69),o=w(0),n=w(2);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;var a=function(t){function i(e){var r=t.call(this)||this;return r._optionsService=e,r.isUserScrolling=!1,r._onResize=new o.EventEmitter,r.cols=Math.max(e.options.cols,c.MINIMUM_COLS),r.rows=Math.max(e.options.rows,c.MINIMUM_ROWS),r.buffers=new _.BufferSet(e,r),r}return g(i,t),Object.defineProperty(i.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),i.prototype.dispose=function(){t.prototype.dispose.call(this),this.buffers.dispose()},i.prototype.resize=function(e,r){this.cols=e,this.rows=r,this.buffers.resize(e,r),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:r})},i.prototype.reset=function(){this.buffers.dispose(),this.buffers=new _.BufferSet(this._optionsService,this),this.isUserScrolling=!1},i=u([l(0,d.IOptionsService)],i)}(n.Disposable);c.BufferService=a},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(_,o){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var t in a)a.hasOwnProperty(t)&&(n[t]=a[t])})(_,o)},function(_,o){function n(){this.constructor=_}f(_,o),_.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)});Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;var u=w(70),l=w(0),d=function(_){function o(n,a){var t=_.call(this)||this;return t._onBufferActivate=t.register(new l.EventEmitter),t._normal=new u.Buffer(!0,n,a),t._normal.fillViewportRows(),t._alt=new u.Buffer(!1,n,a),t._activeBuffer=t._normal,t.setupTabStops(),t}return g(o,_),Object.defineProperty(o.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),o.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},o.prototype.activateAltBuffer=function(n){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(n),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},o.prototype.resize=function(n,a){this._normal.resize(n,a),this._alt.resize(n,a)},o.prototype.setupTabStops=function(n){this._normal.setupTabStops(n),this._alt.setupTabStops(n)},o}(w(2).Disposable);c.BufferSet=d},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.BufferStringIterator=c.Buffer=c.MAX_BUFFER_SIZE=void 0;var f=w(71),g=w(16),u=w(4),l=w(3),d=w(72),_=w(73),o=w(20),n=w(6);c.MAX_BUFFER_SIZE=4294967295;var a=function(){function i(e,r,s){this._hasScrollback=e,this._optionsService=r,this._bufferService=s,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=u.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]),this._whitespaceCell=u.CellData.fromCharData([0,l.WHITESPACE_CELL_CHAR,l.WHITESPACE_CELL_WIDTH,l.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return i.prototype.getNullCell=function(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell},i.prototype.getWhitespaceCell=function(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell},i.prototype.getBlankLine=function(e,r){return new g.BufferLine(this._bufferService.cols,this.getNullCell(e),r)},Object.defineProperty(i.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows},enumerable:!1,configurable:!0}),i.prototype._getCorrectBufferLength=function(e){if(!this._hasScrollback)return e;var r=e+this._optionsService.options.scrollback;return r>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:r},i.prototype.fillViewportRows=function(e){if(this.lines.length===0){e===void 0&&(e=g.DEFAULT_ATTR_DATA);for(var r=this._rows;r--;)this.lines.push(this.getBlankLine(e))}},i.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},i.prototype.resize=function(e,r){var s=this.getNullCell(g.DEFAULT_ATTR_DATA),h=this._getCorrectBufferLength(r);if(h>this.lines.maxLength&&(this.lines.maxLength=h),this.lines.length>0){if(this._cols<e)for(var y=0;y<this.lines.length;y++)this.lines.get(y).resize(e,s);var S=0;if(this._rows<r)for(var v=this._rows;v<r;v++)this.lines.length<r+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new g.BufferLine(e,s)):this.ybase>0&&this.lines.length<=this.ybase+this.y+S+1?(this.ybase--,S++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(e,s)));else for(v=this._rows;v>r;v--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(h<this.lines.maxLength){var p=this.lines.length-h;p>0&&(this.lines.trimStart(p),this.ybase=Math.max(this.ybase-p,0),this.ydisp=Math.max(this.ydisp-p,0),this.savedY=Math.max(this.savedY-p,0)),this.lines.maxLength=h}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,r-1),S&&(this.y+=S),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(e,r),this._cols>e))for(y=0;y<this.lines.length;y++)this.lines.get(y).resize(e,s);this._cols=e,this._rows=r},Object.defineProperty(i.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),i.prototype._reflow=function(e,r){this._cols!==e&&(e>this._cols?this._reflowLarger(e,r):this._reflowSmaller(e,r))},i.prototype._reflowLarger=function(e,r){var s=d.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(s.length>0){var h=d.reflowLargerCreateNewLayout(this.lines,s);d.reflowLargerApplyNewLayout(this.lines,h.layout),this._reflowLargerAdjustViewport(e,r,h.countRemoved)}},i.prototype._reflowLargerAdjustViewport=function(e,r,s){for(var h=this.getNullCell(g.DEFAULT_ATTR_DATA),y=s;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<r&&this.lines.push(new g.BufferLine(e,h))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-s,0)},i.prototype._reflowSmaller=function(e,r){for(var s=this.getNullCell(g.DEFAULT_ATTR_DATA),h=[],y=0,S=this.lines.length-1;S>=0;S--){var v=this.lines.get(S);if(!(!v||!v.isWrapped&&v.getTrimmedLength()<=e)){for(var p=[v];v.isWrapped&&S>0;)v=this.lines.get(--S),p.unshift(v);var E=this.ybase+this.y;if(!(E>=S&&E<S+p.length)){var A=p[p.length-1].getTrimmedLength(),b=d.reflowSmallerGetNewLineLengths(p,this._cols,e),m=b.length-p.length,C=void 0;C=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+m):Math.max(0,this.lines.length-this.lines.maxLength+m);for(var D=[],x=0;x<m;x++){var T=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);D.push(T)}D.length>0&&(h.push({start:S+p.length+y,newLines:D}),y+=D.length),p.push.apply(p,D);var M=b.length-1,P=b[M];P===0&&(P=b[--M]);for(var q=p.length-m-1,N=A;q>=0;){var L=Math.min(N,P);if(p[M].copyCellsFrom(p[q],N-L,P-L,L,!0),(P-=L)===0&&(P=b[--M]),(N-=L)===0){q--;var O=Math.max(q,0);N=d.getWrappedLineTrimmedLength(p,O,this._cols)}}for(x=0;x<p.length;x++)b[x]<e&&p[x].setCell(b[x],s);for(var R=m-C;R-- >0;)this.ybase===0?this.y<r-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-r&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+m,this.ybase+r-1)}}}if(h.length>0){var I=[],k=[];for(x=0;x<this.lines.length;x++)k.push(this.lines.get(x));var U=this.lines.length,z=U-1,$=0,ee=h[$];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);var re=0;for(x=Math.min(this.lines.maxLength-1,U+y-1);x>=0;x--)if(ee&&ee.start>z+re){for(var F=ee.newLines.length-1;F>=0;F--)this.lines.set(x--,ee.newLines[F]);x++,I.push({index:z+1,amount:ee.newLines.length}),re+=ee.newLines.length,ee=h[++$]}else this.lines.set(x,k[z--]);var J=0;for(x=I.length-1;x>=0;x--)I[x].index+=J,this.lines.onInsertEmitter.fire(I[x]),J+=I[x].amount;var Z=Math.max(0,U+y-this.lines.maxLength);Z>0&&this.lines.onTrimEmitter.fire(Z)}},i.prototype.stringIndexToBufferIndex=function(e,r,s){for(s===void 0&&(s=!1);r;){var h=this.lines.get(e);if(!h)return[-1,-1];for(var y=s?h.getTrimmedLength():h.length,S=0;S<y;++S)if(h.get(S)[l.CHAR_DATA_WIDTH_INDEX]&&(r-=h.get(S)[l.CHAR_DATA_CHAR_INDEX].length||1),r<0)return[e,S];e++}return[e,0]},i.prototype.translateBufferLineToString=function(e,r,s,h){s===void 0&&(s=0);var y=this.lines.get(e);return y?y.translateToString(r,s,h):""},i.prototype.getWrappedRangeForLine=function(e){for(var r=e,s=e;r>0&&this.lines.get(r).isWrapped;)r--;for(;s+1<this.lines.length&&this.lines.get(s+1).isWrapped;)s++;return{first:r,last:s}},i.prototype.setupTabStops=function(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.options.tabStopWidth)this.tabs[e]=!0},i.prototype.prevStop=function(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e},i.prototype.nextStop=function(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e},i.prototype.addMarker=function(e){var r=this,s=new _.Marker(e);return this.markers.push(s),s.register(this.lines.onTrim(function(h){s.line-=h,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(function(h){s.line>=h.index&&(s.line+=h.amount)})),s.register(this.lines.onDelete(function(h){s.line>=h.index&&s.line<h.index+h.amount&&s.dispose(),s.line>h.index&&(s.line-=h.amount)})),s.register(s.onDispose(function(){return r._removeMarker(s)})),s},i.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},i.prototype.iterator=function(e,r,s,h,y){return new t(this,e,r,s,h,y)},i}();c.Buffer=a;var t=function(){function i(e,r,s,h,y,S){s===void 0&&(s=0),h===void 0&&(h=e.lines.length),y===void 0&&(y=0),S===void 0&&(S=0),this._buffer=e,this._trimRight=r,this._startIndex=s,this._endIndex=h,this._startOverscan=y,this._endOverscan=S,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return i.prototype.hasNext=function(){return this._current<this._endIndex},i.prototype.next=function(){var e=this._buffer.getWrappedRangeForLine(this._current);e.first<this._startIndex-this._startOverscan&&(e.first=this._startIndex-this._startOverscan),e.last>this._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 r="",s=e.first;s<=e.last;++s)r+=this._buffer.translateBufferLineToString(s,this._trimRight);return this._current=e.last+1,{range:e,content:r}},i}();c.BufferStringIterator=t},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;var f=w(0),g=function(){function u(l){this._maxLength=l,this.onDeleteEmitter=new f.EventEmitter,this.onInsertEmitter=new f.EventEmitter,this.onTrimEmitter=new f.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(u.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"maxLength",{get:function(){return this._maxLength},set:function(l){if(this._maxLength!==l){for(var d=new Array(l),_=0;_<Math.min(l,this.length);_++)d[_]=this._array[this._getCyclicIndex(_)];this._array=d,this._maxLength=l,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"length",{get:function(){return this._length},set:function(l){if(l>this._length)for(var d=this._length;d<l;d++)this._array[d]=void 0;this._length=l},enumerable:!1,configurable:!0}),u.prototype.get=function(l){return this._array[this._getCyclicIndex(l)]},u.prototype.set=function(l,d){this._array[this._getCyclicIndex(l)]=d},u.prototype.push=function(l){this._array[this._getCyclicIndex(this._length)]=l,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},u.prototype.recycle=function(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]},Object.defineProperty(u.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),u.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},u.prototype.splice=function(l,d){for(var _=[],o=2;o<arguments.length;o++)_[o-2]=arguments[o];if(d){for(var n=l;n<this._length-d;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+d)];this._length-=d}for(n=this._length-1;n>=l;n--)this._array[this._getCyclicIndex(n+_.length)]=this._array[this._getCyclicIndex(n)];for(n=0;n<_.length;n++)this._array[this._getCyclicIndex(l+n)]=_[n];if(this._length+_.length>this._maxLength){var a=this._length+_.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=_.length},u.prototype.trimStart=function(l){l>this._length&&(l=this._length),this._startIndex+=l,this._length-=l,this.onTrimEmitter.fire(l)},u.prototype.shiftElements=function(l,d,_){if(!(d<=0)){if(l<0||l>=this._length)throw new Error("start argument out of range");if(l+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(var o=d-1;o>=0;o--)this.set(l+o+_,this.get(l+o));var n=l+d+_-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(o=0;o<d;o++)this.set(l+o+_,this.get(l+o))}},u.prototype._getCyclicIndex=function(l){return(this._startIndex+l)%this._maxLength},u}();c.CircularList=g},function(B,c,w){"use strict";function f(g,u,l){if(u===g.length-1)return g[u].getTrimmedLength();var d=!g[u].hasContent(l-1)&&g[u].getWidth(l-1)===1,_=g[u+1].getWidth(0)===2;return d&&_?l-1:l}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(g,u,l,d,_){for(var o=[],n=0;n<g.length-1;n++){var a=n,t=g.get(++a);if(t.isWrapped){for(var i=[g.get(n)];a<g.length&&t.isWrapped;)i.push(t),t=g.get(++a);if(d>=n&&d<a)n+=i.length-1;else{for(var e=0,r=f(i,e,u),s=1,h=0;s<i.length;){var y=f(i,s,u),S=y-h,v=l-r,p=Math.min(S,v);i[e].copyCellsFrom(i[s],h,r,p,!1),(r+=p)===l&&(e++,r=0),(h+=p)===y&&(s++,h=0),r===0&&e!==0&&i[e-1].getWidth(l-1)===2&&(i[e].copyCellsFrom(i[e-1],l-1,r++,1,!1),i[e-1].setCell(l-1,_))}i[e].replaceCells(r,l,_);for(var E=0,A=i.length-1;A>0&&(A>e||i[A].getTrimmedLength()===0);A--)E++;E>0&&(o.push(n+i.length-E),o.push(E)),n+=i.length-1}}}return o},c.reflowLargerCreateNewLayout=function(g,u){for(var l=[],d=0,_=u[d],o=0,n=0;n<g.length;n++)if(_===n){var a=u[++d];g.onDeleteEmitter.fire({index:n-o,amount:a}),n+=a-1,o+=a,_=u[++d]}else l.push(n);return{layout:l,countRemoved:o}},c.reflowLargerApplyNewLayout=function(g,u){for(var l=[],d=0;d<u.length;d++)l.push(g.get(u[d]));for(d=0;d<l.length;d++)g.set(d,l[d]);g.length=u.length},c.reflowSmallerGetNewLineLengths=function(g,u,l){for(var d=[],_=g.map(function(r,s){return f(g,s,u)}).reduce(function(r,s){return r+s}),o=0,n=0,a=0;a<_;){if(_-a<l){d.push(_-a);break}o+=l;var t=f(g,n,u);o>t&&(o-=t,n++);var i=g[n].getWidth(o-1)===2;i&&o--;var e=i?l-1:l;d.push(e),a+=e}return d},c.getWrappedLineTrimmedLength=f},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(d,_){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,n){o.__proto__=n}||function(o,n){for(var a in n)n.hasOwnProperty(a)&&(o[a]=n[a])})(d,_)},function(d,_){function o(){this.constructor=d}f(d,_),d.prototype=_===null?Object.create(_):(o.prototype=_.prototype,new o)});Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;var u=w(0),l=function(d){function _(o){var n=d.call(this)||this;return n.line=o,n._id=_._nextId++,n.isDisposed=!1,n._onDispose=new u.EventEmitter,n}return g(_,d),Object.defineProperty(_.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),_.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},_._nextId=1,_}(w(2).Disposable);c.Marker=l},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=c.DEFAULT_BELL_SOUND=void 0;var f=w(0),g=w(11),u=w(33);c.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",c.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:c.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,linkTooltipHoverDuration:500,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!0,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:g.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var l=["cols","rows"],d=function(){function _(o){this._onOptionChange=new f.EventEmitter,this.options=u.clone(c.DEFAULT_OPTIONS);for(var n=0,a=Object.keys(o);n<a.length;n++){var t=a[n];if(t in this.options){var i=o[t];this.options[t]=i}}}return Object.defineProperty(_.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),_.prototype.setOption=function(o,n){if(!(o in c.DEFAULT_OPTIONS))throw new Error('No option with key "'+o+'"');if(l.indexOf(o)!==-1)throw new Error('Option "'+o+'" can only be set in the constructor');this.options[o]!==n&&(n=this._sanitizeAndValidateOption(o,n),this.options[o]!==n&&(this.options[o]=n,this._onOptionChange.fire(o)))},_.prototype._sanitizeAndValidateOption=function(o,n){switch(o){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":n||(n=c.DEFAULT_OPTIONS[o]);break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(o+" cannot be less than 1, value: "+n);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(o+" cannot be less than 0, value: "+n);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(o+" cannot be less than or equal to 0, value: "+n)}return n},_.prototype.getOption=function(o){if(!(o in c.DEFAULT_OPTIONS))throw new Error('No option with key "'+o+'"');return this.options[o]},_}();c.OptionsService=d},function(B,c,w){"use strict";var f,g=this&&this.__extends||(f=function(e,r){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,h){s.__proto__=h}||function(s,h){for(var y in h)h.hasOwnProperty(y)&&(s[y]=h[y])})(e,r)},function(e,r){function s(){this.constructor=e}f(e,r),e.prototype=r===null?Object.create(r):(s.prototype=r.prototype,new s)}),u=this&&this.__decorate||function(e,r,s,h){var y,S=arguments.length,v=S<3?r:h===null?h=Object.getOwnPropertyDescriptor(r,s):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,s,h);else for(var p=e.length-1;p>=0;p--)(y=e[p])&&(v=(S<3?y(v):S>3?y(r,s,v):y(r,s))||v);return S>3&&v&&Object.defineProperty(r,s,v),v},l=this&&this.__param||function(e,r){return function(s,h){r(s,h,e)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;var d=w(1),_=w(0),o=w(33),n=w(2),a=Object.freeze({insertMode:!1}),t=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),i=function(e){function r(s,h,y,S){var v=e.call(this)||this;return v._bufferService=h,v._logService=y,v._optionsService=S,v.isCursorInitialized=!1,v.isCursorHidden=!1,v._onData=v.register(new _.EventEmitter),v._onUserInput=v.register(new _.EventEmitter),v._onBinary=v.register(new _.EventEmitter),v._scrollToBottom=s,v.register({dispose:function(){return v._scrollToBottom=void 0}}),v.modes=o.clone(a),v.decPrivateModes=o.clone(t),v}return g(r,e),Object.defineProperty(r.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),r.prototype.reset=function(){this.modes=o.clone(a),this.decPrivateModes=o.clone(t)},r.prototype.triggerDataEvent=function(s,h){if(h===void 0&&(h=!1),!this._optionsService.options.disableStdin){var y=this._bufferService.buffer;y.ybase!==y.ydisp&&this._scrollToBottom(),h&&this._onUserInput.fire(),this._logService.debug('sending data "'+s+'"',function(){return s.split("").map(function(S){return S.charCodeAt(0)})}),this._onData.fire(s)}},r.prototype.triggerBinaryEvent=function(s){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+s+'"',function(){return s.split("").map(function(h){return h.charCodeAt(0)})}),this._onBinary.fire(s))},r=u([l(1,d.IBufferService),l(2,d.ILogService),l(3,d.IOptionsService)],r)}(n.Disposable);c.CoreService=i},function(B,c,w){"use strict";var f=this&&this.__decorate||function(t,i,e,r){var s,h=arguments.length,y=h<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(t,i,e,r);else for(var S=t.length-1;S>=0;S--)(s=t[S])&&(y=(h<3?s(y):h>3?s(i,e,y):s(i,e))||y);return h>3&&y&&Object.defineProperty(i,e,y),y},g=this&&this.__param||function(t,i){return function(e,r){i(e,r,t)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;var u=w(1),l=w(0),d={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(t){return t.button!==4&&t.action===1&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)}},VT200:{events:19,restrict:function(t){return t.action!==32}},DRAG:{events:23,restrict:function(t){return t.action!==32||t.button!==3}},ANY:{events:31,restrict:function(t){return!0}}};function _(t,i){var e=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(e|=64,e|=t.action):(e|=3&t.button,4&t.button&&(e|=64),8&t.button&&(e|=128),t.action===32?e|=32:t.action!==0||i||(e|=3)),e}var o=String.fromCharCode,n={DEFAULT:function(t){var i=[_(t,!1)+32,t.col+32,t.row+32];return i[0]>255||i[1]>255||i[2]>255?"":"[M"+o(i[0])+o(i[1])+o(i[2])},SGR:function(t){var i=t.action===0&&t.button!==4?"m":"M";return"[<"+_(t,!0)+";"+t.col+";"+t.row+i}},a=function(){function t(i,e){this._bufferService=i,this._coreService=e,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new l.EventEmitter,this._lastEvent=null;for(var r=0,s=Object.keys(d);r<s.length;r++){var h=s[r];this.addProtocol(h,d[h])}for(var y=0,S=Object.keys(n);y<S.length;y++){var v=S[y];this.addEncoding(v,n[v])}this.reset()}return t.prototype.addProtocol=function(i,e){this._protocols[i]=e},t.prototype.addEncoding=function(i,e){this._encodings[i]=e},Object.defineProperty(t.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(i){if(!this._protocols[i])throw new Error('unknown protocol "'+i+'"');this._activeProtocol=i,this._onProtocolChange.fire(this._protocols[i].events)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"areMouseEventsActive",{get:function(){return this._protocols[this._activeProtocol].events!==0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(i){if(!this._encodings[i])throw new Error('unknown encoding "'+i+'"');this._activeEncoding=i},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(t.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),t.prototype.triggerMouseEvent=function(i){if(i.col<0||i.col>=this._bufferService.cols||i.row<0||i.row>=this._bufferService.rows)return!1;if(i.button===4&&i.action===32)return!1;if(i.button===3&&i.action!==32)return!1;if(i.button!==4&&(i.action===2||i.action===3))return!1;if(i.col++,i.row++,i.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,i))return!1;if(!this._protocols[this._activeProtocol].restrict(i))return!1;var e=this._encodings[this._activeEncoding](i);return e&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(e):this._coreService.triggerDataEvent(e,!0)),this._lastEvent=i,!0},t.prototype.explainEvents=function(i){return{down:!!(1&i),up:!!(2&i),drag:!!(4&i),move:!!(8&i),wheel:!!(16&i)}},t.prototype._compareEvents=function(i,e){return i.col===e.col&&(i.row===e.row&&(i.button===e.button&&(i.action===e.action&&(i.ctrl===e.ctrl&&i.alt===e.alt))))&&i.shift===e.shift},t=f([g(0,u.IBufferService),g(1,u.ICoreService)],t)}();c.CoreMouseService=a},function(B,c,w){"use strict";var f=this&&this.__decorate||function(d,_,o,n){var a,t=arguments.length,i=t<3?_:n===null?n=Object.getOwnPropertyDescriptor(_,o):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(d,_,o,n);else for(var e=d.length-1;e>=0;e--)(a=d[e])&&(i=(t<3?a(i):t>3?a(_,o,i):a(_,o))||i);return t>3&&i&&Object.defineProperty(_,o,i),i},g=this&&this.__param||function(d,_){return function(o,n){_(o,n,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DirtyRowService=void 0;var u=w(1),l=function(){function d(_){this._bufferService=_,this.clearRange()}return Object.defineProperty(d.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),d.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},d.prototype.markDirty=function(_){_<this._start?this._start=_:_>this._end&&(this._end=_)},d.prototype.markRangeDirty=function(_,o){if(_>o){var n=_;_=o,o=n}_<this._start&&(this._start=_),o>this._end&&(this._end=o)},d.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},d=f([g(0,u.IBufferService)],d)}();c.DirtyRowService=l},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;var f=w(0),g=w(79),u=function(){function l(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter;var d=new g.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}return Object.defineProperty(l.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"activeVersion",{get:function(){return this._active},set:function(d){if(!this._providers[d])throw new Error('unknown Unicode version "'+d+'"');this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)},enumerable:!1,configurable:!0}),l.prototype.register=function(d){this._providers[d.version]=d},l.prototype.wcwidth=function(d){return this._activeProvider.wcwidth(d)},l.prototype.getStringCellWidth=function(d){for(var _=0,o=d.length,n=0;n<o;++n){var a=d.charCodeAt(n);if(55296<=a&&a<=56319){if(++n>=o)return _+this.wcwidth(a);var t=d.charCodeAt(n);56320<=t&&t<=57343?a=1024*(a-55296)+t-56320+65536:_+=this.wcwidth(t)}_+=this.wcwidth(a)}return _},l}();c.UnicodeService=u},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;var f,g=w(15),u=[[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]],l=[[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]],d=function(){function _(){if(this.version="6",!f){f=new Uint8Array(65536),g.fill(f,1),f[0]=0,g.fill(f,0,1,32),g.fill(f,0,127,160),g.fill(f,2,4352,4448),f[9001]=2,f[9002]=2,g.fill(f,2,11904,42192),f[12351]=1,g.fill(f,2,44032,55204),g.fill(f,2,63744,64256),g.fill(f,2,65040,65050),g.fill(f,2,65072,65136),g.fill(f,2,65280,65377),g.fill(f,2,65504,65511);for(var o=0;o<u.length;++o)g.fill(f,0,u[o][0],u[o][1]+1)}}return _.prototype.wcwidth=function(o){return o<32?0:o<127?1:o<65536?f[o]:function(n,a){var t,i=0,e=a.length-1;if(n<a[0][0]||n>a[e][1])return!1;for(;e>=i;)if(n>a[t=i+e>>1][1])i=t+1;else{if(!(n<a[t][0]))return!0;e=t-1}return!1}(o,l)?0:o>=131072&&o<=196605||o>=196608&&o<=262141?2:1},_}();c.UnicodeV6=d},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0;var f=function(){function g(){this.glevel=0,this._charsets=[]}return g.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},g.prototype.setgLevel=function(u){this.glevel=u,this.charset=this._charsets[u]},g.prototype.setgCharset=function(u,l){this._charsets[u]=l,this.glevel===u&&(this.charset=l)},g}();c.CharsetService=f},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;var f=w(3);c.updateWindowsModeWrappedState=function(g){var u=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),l=u==null?void 0:u.get(g.cols-1),d=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);d&&l&&(d.isWrapped=l[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&l[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;var f=function(){function g(u){this._action=u,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return g.prototype.writeSync=function(u){if(this._writeBuffer.length){for(var l=this._bufferOffset;l<this._writeBuffer.length;++l){var d=this._writeBuffer[l],_=this._callbacks[l];this._action(d),_&&_()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(u)},g.prototype.write=function(u,l){var d=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return d._innerWrite()})),this._pendingData+=u.length,this._writeBuffer.push(u),this._callbacks.push(l)},g.prototype._innerWrite=function(){for(var u=this,l=Date.now();this._writeBuffer.length>this._bufferOffset;){var d=this._writeBuffer[this._bufferOffset],_=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(d),this._pendingData-=d.length,_&&_(),Date.now()-l>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return u._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},g}();c.WriteBuffer=f},function(B,c,w){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0;var f=function(){function g(){this._addons=[]}return g.prototype.dispose=function(){for(var u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()},g.prototype.loadAddon=function(u,l){var d=this,_={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(_),l.dispose=function(){return d._wrappedAddonDispose(_)},l.activate(u)},g.prototype._wrappedAddonDispose=function(u){if(!u.isDisposed){for(var l=-1,d=0;d<this._addons.length;d++)if(this._addons[d]===u){l=d;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(l,1)}},g}();c.AddonManager=f}])})},Dqnf:function(ne,K,W){"use strict";var B=W("k1fw"),c=W("9og8"),w=W("rAM+"),f=W("tJVT"),g=W("WmNS"),u=W.n(g),l=W("q1tI"),d=W.n(l),_=W("J66h"),o=W.n(_),n=W("/POA"),a=W.n(n),t=W("q7KB"),i=W.n(t),e=W("ER/M"),r=W.n(e),s=W("dhSg"),h=W("bdgK"),y=W("IZBM"),S=W("Ty5D"),v=3e4;K.a=function(p){var E=p.itemData,A=E===void 0?{}:E,b=p.game,m=p.myshixun,C=Object(S.i)(),D=Object(l.useState)(null),x=Object(f.a)(D,2),T=x[0],M=x[1],P=Object(l.useState)({}),q=Object(f.a)(P,2),N=q[0],L=q[1],O=N.link_url,R=N.password,I=N.port,k=Object(l.useRef)(),U=Object(l.useRef)(),z=Object(l.useRef)(!1),$=A.shixun_environment_id,ee=A.position,re=A.tab_type,F=A.index_tab,J=A.device_id,Z=A.device_children_id;Object(l.useEffect)(function(){ce()},[]);function oe(j,Y,V){var G=V._core._renderService.dimensions.actualCellWidth||9.5,ie=V._core._renderService.dimensions.actualCellHeight||18,X=Math.floor(Y/ie),te=Math.floor(j/G);return[te,X]}function ae(j,Y){var V=new h.default(function(G){var ie=Object(w.a)(G),X;try{for(ie.s();!(X=ie.n()).done;){var te=X.value;if(te.target.offsetHeight>0||te.target.offsetWidth>0){var Q=oe(te.target.offsetWidth,te.target.offsetHeight,j),fe=Object(f.a)(Q,2),se=fe[0],le=fe[1];console.log("cols, rows",se,le),s.a.publish("ssh-xterm-resize-".concat(F),{columns:se,rows:le,width:te.target.offsetWidth,height:te.target.offsetHeight}),j.resize(se,le);var de=_.Base64.decode("IA=="),_e=_.Base64.decode("CBtbSw==");j.write(de),j.write(_e)}}}catch(he){ie.e(he)}finally{ie.f()}});return V.observe(Y),V}function ce(){return H.apply(this,arguments)}function H(){return H=Object(c.a)(u.a.mark(function j(){var Y,V,G,ie,X;return u.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(y.F)(m==null?void 0:m.identifier,{shixun_environment_id:$,tab_type:re,game_id:b.id,device_id:J,device_children_id:Z});case 2:if(G=Q.sent,!(G!=null&&(Y=G.data)!==null&&Y!==void 0&&(V=Y.data_list)!==null&&V!==void 0&&V.length)){Q.next=6;break}return s.a.publish("pod-restrict-data",{identifier:G==null||((ie=G.data)===null||ie===void 0)?void 0:ie.identifier,data_list:G==null||((X=G.data)===null||X===void 0)?void 0:X.data_list}),Q.abrupt("return");case 6:if(!((G==null?void 0:G.status)===-3)){Q.next=8;break}return Q.abrupt("return",new Promise(function(){var fe=Object(c.a)(u.a.mark(function se(le,de){return u.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:Modal.confirm({content:"\u68C0\u6D4B\u5230\u60A8\u5DF2\u7ECF\u5F00\u542F\u4E86\u5176\u4ED6\u5B9E\u9A8C\u73AF\u5883\uFF0C\u8BF7\u5148\u5173\u95ED\u73AF\u5883\u540E\uFF0C\u518D\u8FDE\u63A5",okText:"\u7ACB\u5373\u5173\u95ED",cancelText:"\u7A0D\u540E\u5173\u95ED",onOk:function(){var pe=Object(c.a)(u.a.mark(function ge(){return u.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,closeWindowsVnc(C.taskId,G==null?void 0:G.message);case 2:return init(),ue.abrupt("return");case 4:case"end":return ue.stop()}},ge)}));function ve(){return pe.apply(this,arguments)}return ve}()});case 1:case"end":return he.stop()}},se)}));return function(se,le){return fe.apply(this,arguments)}}()));case 8:(G==null?void 0:G.status)===0&&(s.a.publish("update-windows-time",G==null?void 0:G.data),s.a.publish("send-tabs-result-data",Object(B.a)(Object(B.a)({},G==null?void 0:G.data),{},{index_tab:F})),L(G.data),setTimeout(function(){return s.a.publish("create-socket-".concat(F))},300));case 9:case"end":return Q.stop()}},j)})),H.apply(this,arguments)}return Object(l.useEffect)(function(){if(k.current&&O){var j=new n.Terminal({fontSize:16,rendererType:"dom"});j.open(k.current),j.onData(function(V){U.current&&(U.current.readyState===1&&U.current.send(JSON.stringify({tp:"client",data:V})))}),j.write("Connecting..."),M(j);var Y=ae(j,k.current);return function(){j.dispose(),k.current&&(Y==null||Y.unobserve(k.current))}}},[O,k.current]),Object(l.useEffect)(function(){if(T&&O){function j(){var G=new WebSocket(O);U.current=G,G.onopen=function(){var X=T.element.parentElement;if(X){var te=X.offsetWidth,Q=X.offsetHeight;console.log("init",{tp:"init",data:Object(B.a)(Object(B.a)({},N),{},{secret:R,width:te,height:Q,rows:T.rows,columns:T.cols})}),G.send(JSON.stringify({tp:"init",data:Object(B.a)(Object(B.a)({},N),{},{secret:R,width:te,height:Q,rows:T.rows,columns:T.cols})}))}T.focus()},G.onerror=function(X){console.log("------in socket error----",X,G,O)},G.onmessage=function(X){z.current||(T.write("\r"),setTimeout(function(){},1e3)),z.current=!0,console.log("event:",X);var te=_.Base64.decode(X.data.toString()),Q=T._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",te,Q,T),T.write(te)};var ie=setInterval(function(){if(U.current){var X;(X=U.current)===null||X===void 0||X.send(JSON.stringify({tp:"h"}))}},v);G.onclose=function(X){ie&&clearInterval(ie),console.log(ie,"tid",F),T.write(`\r
|
|
|
connection closed`)}}var Y=s.a.subscribe("create-socket-".concat(F),function(){j()}),V=s.a.subscribe("ssh-xterm-resize-".concat(F),function(G){U.current&&U.current.readyState===1&&U.current.send(JSON.stringify({tp:"resize",data:Object(B.a)({},G)}))});return function(){Y(),V(),U.current&&(U.current.close(),z.current=!1)}}},[T,O,I]),d.a.createElement("div",{ref:k,className:r.a["xterm-panel"]},O?null:d.a.createElement("p",{style:{color:"#fff"}},"\u6B63\u5728\u8FDE\u63A5\u547D\u4EE4\u884C\u670D\u52A1..."))}},"ER/M":function(ne,K,W){ne.exports={"xterm-panel":"xterm-panel___2r2xx"}},IZBM:function(ne,K,W){"use strict";W.d(K,"l",function(){return _}),W.d(K,"m",function(){return o}),W.d(K,"i",function(){return n}),W.d(K,"D",function(){return a}),W.d(K,"h",function(){return t}),W.d(K,"I",function(){return i}),W.d(K,"C",function(){return e}),W.d(K,"A",function(){return r}),W.d(K,"B",function(){return s}),W.d(K,"d",function(){return h}),W.d(K,"q",function(){return y}),W.d(K,"g",function(){return S}),W.d(K,"s",function(){return v}),W.d(K,"j",function(){return p}),W.d(K,"w",function(){return A}),W.d(K,"k",function(){return b}),W.d(K,"F",function(){return m}),W.d(K,"z",function(){return D}),W.d(K,"y",function(){return x}),W.d(K,"H",function(){return T}),W.d(K,"n",function(){return M}),W.d(K,"o",function(){return P}),W.d(K,"p",function(){return q}),W.d(K,"t",function(){return N}),W.d(K,"E",function(){return L}),W.d(K,"b",function(){return O}),W.d(K,"r",function(){return R}),W.d(K,"c",function(){return I}),W.d(K,"e",function(){return k}),W.d(K,"x",function(){return U}),W.d(K,"u",function(){return z}),W.d(K,"G",function(){return $}),W.d(K,"a",function(){return ee}),W.d(K,"f",function(){return F}),W.d(K,"v",function(){return Z});var B=W("9og8"),c=W("k1fw"),w=W("WmNS"),f=W.n(w),g=W("ErOA"),u=W("1vsH"),l=Object(u.J)(),d={};l!=null&&l.homework_common_id&&(d.homework_common_id=l==null?void 0:l.homework_common_id),l!=null&&l.exercisesId&&(d.exercise_id=l==null?void 0:l.exercisesId);function _(H){return Object(g.c)("tasks/".concat(H,".json"),d)}function o(H){return Object(g.c)("myshixuns/".concat(H,"/challenges.json"))}function n(H,j){return Object(g.c)("myshixuns/".concat(H,"/subject_challenges.json"),j)}function a(H,j,Y){return Object(g.c)("tasks/".concat(H,"/star.json"),{shixun_id:j,star:Y})}function t(H,j){return Object(g.c)("tasks/".concat(H,"/rep_content.json"),Object(c.a)(Object(c.a)({},j),d))}function i(H,j){return Object(g.f)("myshixuns/".concat(H,"/update_file.json"),j)}function e(H,j){return Object(g.c)("tasks/".concat(H,"/reset_original_code.json"),Object(c.a)(Object(c.a)({},j),d))}function r(H,j){return Object(g.f)("myshixuns/".concat(H,"/reset_repository.json"),j)}function s(H,j){return Object(g.c)("tasks/".concat(H,"/reset_passed_code.json"),Object(c.a)(Object(c.a)({},j),d))}function h(H,j){return Object(g.f)("tasks/".concat(H,"/game_build.json"),Object(c.a)(Object(c.a)({},j),d))}function y(H,j){return Object(g.c)("tasks/".concat(H,"/game_status.json"),Object(c.a)(Object(c.a)({},j),d))}function S(H,j){return Object(g.f)("tasks/".concat(H,"/choose_build.json"),Object(c.a)(Object(c.a)({},j),d))}function v(H){return Object(g.c)("myshixuns/".concat(H,"/get_remaining_time.json"))}function p(H){return Object(g.c)("tasks/".concat(H,"/picture_display.json"),d)}function E(H,j){return Object(g.c)("courses/".concat(H,"/inform_detail.json"),j)}function A(H){return Object(g.f)("tasks/".concat(H,"/plus_or_cancel_praise.json"))}function b(H){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object(g.f)("myshixuns/".concat(H,"/repository.json"),j)}function m(H,j){return Object(g.c)("myshixuns/".concat(H,"/start.json"),j||{})}function C(H){return Object(g.c)("myshixuns/".concat(H,"/reset_pod.json"))}function D(H,j){return Object(g.c)("myshixuns/".concat(H,"/reset_pod.json"),j)}function x(H,j){return Object(g.a)("/api/tasks/".concat(H,"/reboot_esc.json"),{method:"post",body:j})}function T(H){return Object(g.c)("tasks/".concat(H,"/check_test_sets.json"))}function M(H){return Object(g.c)("tasks/".concat(H,"/get_answer_info.json"))}function P(H){return Object(g.c)("tasks/".concat(H,"/get_choose_answer.json"))}function q(H){return Object(g.c)("tasks/".concat(H,"/unlock_choose_answer.json"))}function N(H,j){return Object(g.c)("tasks/".concat(H,"/unlock_answer.json"),{answer_id:j})}function L(H,j,Y){return Object(g.f)("tasks/".concat(H,"/set_games_status.json"),{result:j,data:Y})}function O(H,j){return Object(g.c)("myshixuns/".concat(H,"/active_pod.json"),j)}function R(H,j){return Object(g.c)("tasks/".concat(H,"/rank_list.json"),j)}function I(H,j){return Object(g.f)("tasks/".concat(H,"/close_windows_vnc.json"),{tpi_id:j})}function k(H,j){return Object(g.c)("tasks/".concat(H,"/commit_files.json"),j)}function U(H,j){return Object(g.c)("tasks/".concat(H,"/pull_files.json"),j)}function z(H,j){return Object(g.f)("tasks/".concat(H,"/log_output"),j)}function $(H,j){return Object(g.c)("tasks/".concat(H,"/stop_log_output.json"),j)}function ee(H){return re.apply(this,arguments)}function re(){return re=Object(B.a)(f.a.mark(function H(j){return f.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.abrupt("return",Object(g.a)("/api/myshixuns/".concat(j.id,"/add_file.json"),{method:"post",body:j}));case 1:case"end":return V.stop()}},H)})),re.apply(this,arguments)}function F(H){return J.apply(this,arguments)}function J(){return J=Object(B.a)(f.a.mark(function H(j){return f.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.abrupt("return",Object(g.a)("/api/myshixuns/".concat(j.id,"/delete_git_file.json"),{method:"Delete",body:j}));case 1:case"end":return V.stop()}},H)})),J.apply(this,arguments)}function Z(H){return oe.apply(this,arguments)}function oe(){return oe=Object(B.a)(f.a.mark(function H(j){return f.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.abrupt("return",Object(g.a)("/api/myshixuns/".concat(j.id,"/mv_file.json"),{method:"post",body:j}));case 1:case"end":return V.stop()}},H)})),oe.apply(this,arguments)}function ae(H){return ce.apply(this,arguments)}function ce(){return ce=Object(B.a)(f.a.mark(function H(j){return f.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.abrupt("return",Object(g.a)("/api/tasks/".concat(j.id,"/rep_content.json"),{method:"get",params:j}));case 1:case"end":return V.stop()}},H)})),ce.apply(this,arguments)}},J66h:function(ne,K,W){(function(B){var c,w;(function(f,g){ne.exports=g(f)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof B!="undefined"?B:this,function(f){"use strict";f=f||{};var g=f.Base64,u="2.6.4",l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=function(P){for(var q={},N=0,L=P.length;N<L;N++)q[P.charAt(N)]=N;return q}(l),_=String.fromCharCode,o=function(P){if(P.length<2){var q=P.charCodeAt(0);return q<128?P:q<2048?_(192|q>>>6)+_(128|q&63):_(224|q>>>12&15)+_(128|q>>>6&63)+_(128|q&63)}else{var q=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return _(240|q>>>18&7)+_(128|q>>>12&63)+_(128|q>>>6&63)+_(128|q&63)}},n=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,a=function(P){return P.replace(n,o)},t=function(P){var q=[0,2,1][P.length%3],N=P.charCodeAt(0)<<16|(P.length>1?P.charCodeAt(1):0)<<8|(P.length>2?P.charCodeAt(2):0),L=[l.charAt(N>>>18),l.charAt(N>>>12&63),q>=2?"=":l.charAt(N>>>6&63),q>=1?"=":l.charAt(N&63)];return L.join("")},i=f.btoa&&typeof f.btoa=="function"?function(P){return f.btoa(P)}:function(P){if(P.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return P.replace(/[\s\S]{1,3}/g,t)},e=function(P){return i(a(String(P)))},r=function(P){return P.replace(/[+\/]/g,function(q){return q=="+"?"-":"_"}).replace(/=/g,"")},s=function(P,q){return q?r(e(P)):e(P)},h=function(P){return s(P,!0)},y;f.Uint8Array&&(y=function(P,q){for(var N="",L=0,O=P.length;L<O;L+=3){var R=P[L],I=P[L+1],k=P[L+2],U=R<<16|I<<8|k;N+=l.charAt(U>>>18)+l.charAt(U>>>12&63)+(typeof I!="undefined"?l.charAt(U>>>6&63):"=")+(typeof k!="undefined"?l.charAt(U&63):"=")}return q?r(N):N});var S=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(P){switch(P.length){case 4:var q=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),N=q-65536;return _((N>>>10)+55296)+_((N&1023)+56320);case 3:return _((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return _((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},p=function(P){return P.replace(S,v)},E=function(P){var q=P.length,N=q%4,L=(q>0?d[P.charAt(0)]<<18:0)|(q>1?d[P.charAt(1)]<<12:0)|(q>2?d[P.charAt(2)]<<6:0)|(q>3?d[P.charAt(3)]:0),O=[_(L>>>16),_(L>>>8&255),_(L&255)];return O.length-=[0,0,2,1][N],O.join("")},A=f.atob&&typeof f.atob=="function"?function(P){return f.atob(P)}:function(P){return P.replace(/\S{1,4}/g,E)},b=function(P){return A(String(P).replace(/[^A-Za-z0-9\+\/]/g,""))},m=function(P){return p(A(P))},C=function(P){return String(P).replace(/[-_]/g,function(q){return q=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},D=function(P){return m(C(P))},x;f.Uint8Array&&(x=function(P){return Uint8Array.from(b(C(P)),function(q){return q.charCodeAt(0)})});var T=function(){var P=f.Base64;return f.Base64=g,P};if(f.Base64={VERSION:u,atob:b,btoa:i,fromBase64:D,toBase64:s,utob:a,encode:s,encodeURI:h,btou:p,decode:D,noConflict:T,fromUint8Array:y,toUint8Array:x},typeof Object.defineProperty=="function"){var M=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}};f.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",M(function(){return D(this)})),Object.defineProperty(String.prototype,"toBase64",M(function(P){return s(this,P)})),Object.defineProperty(String.prototype,"toBase64URI",M(function(){return s(this,!0)}))}}return f.Meteor&&(Base64=f.Base64),ne.exports?ne.exports.Base64=f.Base64:!(c=[],w=function(){return f.Base64}.apply(K,c),w!==void 0&&(ne.exports=w)),{Base64:f.Base64}})}).call(this,W("IyRk"))},q7KB:function(ne,K,W){},"rAM+":function(ne,K,W){"use strict";W.d(K,"a",function(){return c});var B=W("Qw5x");function c(w,f){var g;if(typeof Symbol=="undefined"||w[Symbol.iterator]==null){if(Array.isArray(w)||(g=Object(B.a)(w))||f&&w&&typeof w.length=="number"){g&&(w=g);var u=0,l=function(){};return{s:l,n:function(){return u>=w.length?{done:!0}:{done:!1,value:w[u++]}},e:function(a){throw a},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var d=!0,_=!1,o;return{s:function(){g=w[Symbol.iterator]()},n:function(){var a=g.next();return d=a.done,a},e:function(a){_=!0,o=a},f:function(){try{!d&&g.return!=null&&g.return()}finally{if(_)throw o}}}}}}]);
|