You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Editor.p__Terminal__.e92...

10 lines
297 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{"/POA":function(G,J,q){!function(H,c){if(!0)G.exports=c();else var L,f}(window,function(){return function(H){var c={};function L(f){if(c[f])return c[f].exports;var S=c[f]={i:f,l:!1,exports:{}};return H[f].call(S.exports,S,S.exports,L),S.l=!0,S.exports}return L.m=H,L.c=c,L.d=function(f,S,h){L.o(f,S)||Object.defineProperty(f,S,{enumerable:!0,get:h})},L.r=function(f){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(f,"__esModule",{value:!0})},L.t=function(f,S){if(1&S&&(f=L(f)),8&S)return f;if(4&S&&typeof f=="object"&&f&&f.__esModule)return f;var h=Object.create(null);if(L.r(h),Object.defineProperty(h,"default",{enumerable:!0,value:f}),2&S&&typeof f!="string")for(var u in f)L.d(h,u,function(_){return f[_]}.bind(null,u));return h},L.n=function(f){var S=f&&f.__esModule?function(){return f.default}:function(){return f};return L.d(S,"a",S),S},L.o=function(f,S){return Object.prototype.hasOwnProperty.call(f,S)},L.p="",L(L.s=34)}([function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.forwardEvent=c.EventEmitter=void 0;var f=function(){function S(){this._listeners=[],this._disposed=!1}return Object.defineProperty(S.prototype,"event",{get:function(){var h=this;return this._event||(this._event=function(u){return h._listeners.push(u),{dispose:function(){if(!h._disposed){for(var _=0;_<h._listeners.length;_++)if(h._listeners[_]===u)return void h._listeners.splice(_,1)}}}}),this._event},enumerable:!1,configurable:!0}),S.prototype.fire=function(h,u){for(var _=[],d=0;d<this._listeners.length;d++)_.push(this._listeners[d]);for(d=0;d<_.length;d++)_[d].call(void 0,h,u)},S.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},S}();c.EventEmitter=f,c.forwardEvent=function(S,h){return S(function(u){return h.fire(u)})}},function(H,c,L){"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=L(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(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.getDisposeArrayDisposable=c.disposeArray=c.Disposable=void 0;var f=function(){function h(){this._disposables=[],this._isDisposed=!1}return h.prototype.dispose=function(){this._isDisposed=!0;for(var u=0,_=this._disposables;u<_.length;u++)_[u].dispose();this._disposables.length=0},h.prototype.register=function(u){return this._disposables.push(u),u},h.prototype.unregister=function(u){var _=this._disposables.indexOf(u);_!==-1&&this._disposables.splice(_,1)},h}();function S(h){for(var u=0,_=h;u<_.length;u++)_[u].dispose();h.length=0}c.Disposable=f,c.disposeArray=S,c.getDisposeArrayDisposable=function(h){return{dispose:function(){return S(h)}}}},function(H,c,L){"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(H,c,L){"use strict";var f,S=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 h=L(8),u=L(3),_=L(6),d=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 _.ExtendedAttrs,a.combinedData="",a}return S(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?h.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[u.CHAR_DATA_ATTR_INDEX],this.bg=0;var t=!1;if(a[u.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(a[u.CHAR_DATA_CHAR_INDEX].length===2){var i=a[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){var e=a[u.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=e&&e<=57343?this.content=1024*(i-55296)+e-56320+65536|a[u.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=a[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[u.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=a[u.CHAR_DATA_CHAR_INDEX],this.content=2097152|a[u.CHAR_DATA_WIDTH_INDEX]<<22)},n.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},n}(_.AttributeData);c.CellData=d},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.ISoundService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;var f=L(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(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;var f=function(){function h(){this.fg=0,this.bg=0,this.extended=new S}return h.toColorRGB=function(u){return[u>>>16&255,u>>>8&255,255&u]},h.fromColorRGB=function(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]},h.prototype.clone=function(){var u=new h;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u},h.prototype.isInverse=function(){return 67108864&this.fg},h.prototype.isBold=function(){return 134217728&this.fg},h.prototype.isUnderline=function(){return 268435456&this.fg},h.prototype.isBlink=function(){return 536870912&this.fg},h.prototype.isInvisible=function(){return 1073741824&this.fg},h.prototype.isItalic=function(){return 67108864&this.bg},h.prototype.isDim=function(){return 134217728&this.bg},h.prototype.getFgColorMode=function(){return 50331648&this.fg},h.prototype.getBgColorMode=function(){return 50331648&this.bg},h.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},h.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},h.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},h.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},h.prototype.isFgDefault=function(){return(50331648&this.fg)==0},h.prototype.isBgDefault=function(){return(50331648&this.bg)==0},h.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},h.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},h.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},h.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},h.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},h.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()},h.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},h.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},h.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},h.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},h.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},h}();c.AttributeData=f;var S=function(){function h(u,_){u===void 0&&(u=0),_===void 0&&(_=-1),this.underlineStyle=u,this.underlineColor=_}return h.prototype.clone=function(){return new h(this.underlineStyle,this.underlineColor)},h.prototype.isEmpty=function(){return this.underlineStyle===0},h}();c.ExtendedAttrs=S},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(f,S,h,u){f.addEventListener(S,h,u);var _=!1;return{dispose:function(){_||(_=!0,f.removeEventListener(S,h,u))}}}},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},c.utf32ToString=function(h,u,_){u===void 0&&(u=0),_===void 0&&(_=h.length);for(var d="",o=u;o<_;++o){var n=h[o];n>65535?(n-=65536,d+=String.fromCharCode(55296+(n>>10))+String.fromCharCode(n%1024+56320)):d+=String.fromCharCode(n)}return d};var f=function(){function h(){this._interim=0}return h.prototype.clear=function(){this._interim=0},h.prototype.decode=function(u,_){var d=u.length;if(!d)return 0;var o=0,n=0;this._interim&&(56320<=(i=u.charCodeAt(n++))&&i<=57343?_[o++]=1024*(this._interim-55296)+i-56320+65536:(_[o++]=this._interim,_[o++]=i),this._interim=0);for(var a=n;a<d;++a){var t=u.charCodeAt(a);if(55296<=t&&t<=56319){if(++a>=d)return this._interim=t,o;var i;56320<=(i=u.charCodeAt(a))&&i<=57343?_[o++]=1024*(t-55296)+i-56320+65536:(_[o++]=t,_[o++]=i)}else _[o++]=t}return o},h}();c.StringToUtf32=f;var S=function(){function h(){this.interim=new Uint8Array(3)}return h.prototype.clear=function(){this.interim.fill(0)},h.prototype.decode=function(u,_){var d=u.length;if(!d)return 0;var o,n,a,t,i=0,e=0,r=0;if(this.interim[0]){var s=!1,l=this.interim[0];l&=(224&l)==192?31:(240&l)==224?15:7;for(var g=0,m=void 0;(m=63&this.interim[++g])&&g<4;)l<<=6,l|=m;for(var v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,p=v-g;r<p;){if(r>=d)return 0;if((192&(m=u[r++]))!=128){r--,s=!0;break}this.interim[g++]=m,l<<=6,l|=63&m}s||(v===2?l<128?r--:_[i++]=l:v===3?l<2048||l>=55296&&l<=57343||(_[i++]=l):l<65536||l>1114111||(_[i++]=l)),this.interim.fill(0)}for(var w=d-4,E=r;E<d;){for(;!(!(E<w)||128&(o=u[E])||128&(n=u[E+1])||128&(a=u[E+2])||128&(t=u[E+3]));)_[i++]=o,_[i++]=n,_[i++]=a,_[i++]=t,E+=4;if((o=u[E++])<128)_[i++]=o;else if((224&o)==192){if(E>=d)return this.interim[0]=o,i;if((192&(n=u[E++]))!=128){E--;continue}if((e=(31&o)<<6|63&n)<128){E--;continue}_[i++]=e}else if((240&o)==224){if(E>=d)return this.interim[0]=o,i;if((192&(n=u[E++]))!=128){E--;continue}if(E>=d)return this.interim[0]=o,this.interim[1]=n,i;if((192&(a=u[E++]))!=128){E--;continue}if((e=(15&o)<<12|(63&n)<<6|63&a)<2048||e>=55296&&e<=57343)continue;_[i++]=e}else if((248&o)==240){if(E>=d)return this.interim[0]=o,i;if((192&(n=u[E++]))!=128){E--;continue}if(E>=d)return this.interim[0]=o,this.interim[1]=n,i;if((192&(a=u[E++]))!=128){E--;continue}if(E>=d)return this.interim[0]=o,this.interim[1]=n,this.interim[2]=a,i;if((192&(t=u[E++]))!=128){E--;continue}if((e=(7&o)<<18|(63&n)<<12|(63&a)<<6|63&t)<65536||e>1114111)continue;_[i++]=e}}return i},h}();c.Utf8ToUtf32=S},function(H,c,L){"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(H,c,L){"use strict";var f,S,h,u;function _(o){var n=o.toString(16);return n.length<2?"0"+n:n}function d(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?"#"+_(n)+_(a)+_(t)+_(i):"#"+_(n)+_(a)+_(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={})),(S=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,l=o.rgba>>8&255,g=r+Math.round((t-r)*a),m=s+Math.round((i-s)*a),v=l+Math.round((e-l)*a);return{css:f.toCss(g,m,v),rgba:f.toRgba(g,m,v)}},S.isOpaque=function(o){return(255&o.rgba)==255},S.ensureContrastRatio=function(o,n,a){var t=u.ensureContrastRatio(o.rgba,n.rgba,a);if(t)return u.toColor(t>>24&255,t>>16&255,t>>8&255)},S.opaque=function(o){var n=(255|o.rgba)>>>0,a=u.toChannels(n),t=a[0],i=a[1],e=a[2];return{css:f.toCss(t,i,e),rgba:n}},S.opacity=function(o,n){var a=Math.round(255*n),t=u.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}(h=c.rgb||(c.rgb={})),function(o){function n(t,i,e){for(var r=t>>24&255,s=t>>16&255,l=t>>8&255,g=i>>24&255,m=i>>16&255,v=i>>8&255,p=d(h.relativeLuminance2(g,v,m),h.relativeLuminance2(r,s,l));p<e&&(g>0||m>0||v>0);)g-=Math.max(0,Math.ceil(.1*g)),m-=Math.max(0,Math.ceil(.1*m)),v-=Math.max(0,Math.ceil(.1*v)),p=d(h.relativeLuminance2(g,v,m),h.relativeLuminance2(r,s,l));return(g<<24|m<<16|v<<8|255)>>>0}function a(t,i,e){for(var r=t>>24&255,s=t>>16&255,l=t>>8&255,g=i>>24&255,m=i>>16&255,v=i>>8&255,p=d(h.relativeLuminance2(g,v,m),h.relativeLuminance2(r,s,l));p<e&&(g<255||m<255||v<255);)g=Math.min(255,g+Math.ceil(.1*(255-g))),m=Math.min(255,m+Math.ceil(.1*(255-m))),v=Math.min(255,v+Math.ceil(.1*(255-v))),p=d(h.relativeLuminance2(g,v,m),h.relativeLuminance2(r,s,l));return(g<<24|m<<16|v<<8|255)>>>0}o.ensureContrastRatio=function(t,i,e){var r=h.relativeLuminance(t>>8),s=h.relativeLuminance(i>>8);if(d(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)}}}(u=c.rgba||(c.rgba={})),c.toPaddedHex=_,c.contrastRatio=d},function(H,c,L){"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",S=f?"node":navigator.userAgent,h=f?"node":navigator.platform;function u(_,d){return _.indexOf(d)>=0}c.isFirefox=!!~S.indexOf("Firefox"),c.isSafari=/^((?!chrome|android).)*safari/i.test(S),c.isMac=u(["Macintosh","MacIntel","MacPPC","Mac68K"],h),c.isIpad=h==="iPad",c.isIphone=h==="iPhone",c.isWindows=u(["Windows","Win16","Win32","WinCE"],h),c.isLinux=h.indexOf("Linux")>=0},function(H,c,L){"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(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.BaseRenderLayer=void 0;var f=L(3),S=L(9),h=L(25),u=L(6),_=L(28),d=L(10),o=L(17),n=function(){function a(t,i,e,r,s,l,g,m){this._container=t,this._alpha=r,this._colors=s,this._rendererId=l,this._bufferService=g,this._optionsService=m,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=_.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=h.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,l=this._getContrastColor(t);l||t.isFgRGB()||t.isBgRGB()?this._drawUncachedChars(t,i,e,l):(t.isInverse()?(r=t.isBgDefault()?S.INVERTED_DEFAULT_COLOR:t.getBgColor(),s=t.isFgDefault()?S.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=d.color.opaque(this._colors.background).css;else if(t.isBgRGB())this._ctx.fillStyle="rgb("+u.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("+u.AttributeData.toColorRGB(t.getFgColor()).join(",")+")";else{var l=t.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&t.isBold()&&l<8&&(l+=8),this._ctx.fillStyle=this._colors.ansi[l].css}this._clipRow(e),t.isDim()&&(this._ctx.globalAlpha=S.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(),l=t.getBgColorMode(),g=!!t.isInverse(),m=!!t.isInverse();if(g){var v=e;e=s,s=v;var p=r;r=l,l=p}var w=this._resolveBackgroundRgba(l,s,g),E=this._resolveForegroundRgba(r,e,g,m),b=d.rgba.ensureContrastRatio(w,E,this._optionsService.options.minimumContrastRatio);if(b){var y={css:d.channels.toCss(b>>24&255,b>>16&255,b>>8&255),rgba:b};return this._colors.contrastCache.setColor(t.bg,t.fg,y),y}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(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;function f(S,h,u){h.di$target===h?h.di$dependencies.push({id:S,index:u}):(h.di$dependencies=[{id:S,index:u}],h.di$target=h)}c.serviceRegistry=new Map,c.getServiceDependencies=function(S){return S.di$dependencies||[]},c.createDecorator=function(S){if(c.serviceRegistry.has(S))return c.serviceRegistry.get(S);var h=function(u,_,d){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");f(h,u,d)};return h.toString=function(){return S},c.serviceRegistry.set(S,h),h}},function(H,c,L){"use strict";function f(S,h,u,_){if(u===void 0&&(u=0),_===void 0&&(_=S.length),u>=S.length)return S;u=(S.length+u)%S.length,_=_>=S.length?S.length:(S.length+_)%S.length;for(var d=u;d<_;++d)S[d]=h;return S}Object.defineProperty(c,"__esModule",{value:!0}),c.concat=c.fillFallback=c.fill=void 0,c.fill=function(S,h,u,_){return S.fill?S.fill(h,u,_):f(S,h,u,_)},c.fillFallback=f,c.concat=function(S,h){var u=new S.constructor(S.length+h.length);return u.set(S),u.set(h,S.length),u}},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;var f=L(8),S=L(3),h=L(4),u=L(6);c.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);var _=function(){function d(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||h.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),i=0;i<o;++i)this.setCell(i,t);this.length=o}return d.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]},d.prototype.set=function(o,n){this._data[3*o+1]=n[S.CHAR_DATA_ATTR_INDEX],n[S.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=n[1],this._data[3*o+0]=2097152|o|n[S.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=n[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|n[S.CHAR_DATA_WIDTH_INDEX]<<22},d.prototype.getWidth=function(o){return this._data[3*o+0]>>22},d.prototype.hasWidth=function(o){return 12582912&this._data[3*o+0]},d.prototype.getFg=function(o){return this._data[3*o+1]},d.prototype.getBg=function(o){return this._data[3*o+2]},d.prototype.hasContent=function(o){return 4194303&this._data[3*o+0]},d.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},d.prototype.isCombined=function(o){return 2097152&this._data[3*o+0]},d.prototype.getString=function(o){var n=this._data[3*o+0];return 2097152&n?this._combined[o]:2097151&n?f.stringFromCodePoint(2097151&n):""},d.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},d.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},d.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},d.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)},d.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 u.ExtendedAttrs),n<this.length-o){for(var i=new h.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 u.ExtendedAttrs)},d.prototype.deleteCells=function(o,n,a,t){if(o%=this.length,n<this.length-o){for(var i=new h.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 u.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 u.ExtendedAttrs)},d.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 u.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 u.ExtendedAttrs);o<n&&o<this.length;)this.setCell(o++,a)},d.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}},d.prototype.fill=function(o){this._combined={},this._extendedAttrs={};for(var n=0;n<this.length;++n)this.setCell(n,o)},d.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},d.prototype.clone=function(){var o=new d(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},d.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},d.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 l=Object.keys(o._combined);for(s=0;s<l.length;s++){var g=parseInt(l[s],10);g>=n&&(this._combined[g-n+a]=o._combined[g])}},d.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):S.WHITESPACE_CELL_CHAR,n+=i>>22||1}return t},d}();c.BufferLine=_},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.removeElementFromParent=void 0,c.removeElementFromParent=function(){for(var f,S=[],h=0;h<arguments.length;h++)S[h]=arguments[h];for(var u=0,_=S;u<_.length;u++){var d=_[u];(f=d==null?void 0:d.parentElement)===null||f===void 0||f.removeChild(d)}}},function(H,c,L){"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(H,c,L){"use strict";var f,S=this&&this.__extends||(f=function(E,b){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,C){y.__proto__=C}||function(y,C){for(var T in C)C.hasOwnProperty(T)&&(y[T]=C[T])})(E,b)},function(E,b){function y(){this.constructor=E}f(E,b),E.prototype=b===null?Object.create(b):(y.prototype=b.prototype,new y)});Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;var h,u=L(12),_=L(20),d=L(39),o=L(2),n=L(15),a=L(8),t=L(16),i=L(0),e=L(3),r=L(4),s=L(6),l=L(22),g=L(24),m={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function v(E,b){if(E>24)return b.setWinLines||!1;switch(E){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(E){E[E.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",E[E.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(h=c.WindowsOptionsReportType||(c.WindowsOptionsReportType={}));var p=function(){function E(b,y,C,T){this._bufferService=b,this._coreService=y,this._logService=C,this._optionsService=T,this._data=new Uint32Array(0)}return E.prototype.hook=function(b){this._data=new Uint32Array(0)},E.prototype.put=function(b,y,C){this._data=n.concat(this._data,b.subarray(y,C))},E.prototype.unhook=function(b){if(b){var y=a.utf32ToString(this._data);switch(this._data=new Uint32Array(0),y){case'"q':return this._coreService.triggerDataEvent(u.C0.ESC+'P1$r0"q'+u.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(u.C0.ESC+'P1$r61;1"p'+u.C0.ESC+"\\");case"r":var C=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(u.C0.ESC+"P1$r"+C+u.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(u.C0.ESC+"P1$r0m"+u.C0.ESC+"\\");case" q":var T={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return T-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(u.C0.ESC+"P1$r"+T+" q"+u.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",y),this._coreService.triggerDataEvent(u.C0.ESC+"P0$r"+u.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},E}(),w=function(E){function b(y,C,T,x,O,P,M,B,W){W===void 0&&(W=new d.EscapeSequenceParser);var A=E.call(this)||this;A._bufferService=y,A._charsetService=C,A._coreService=T,A._dirtyRowService=x,A._logService=O,A._optionsService=P,A._coreMouseService=M,A._unicodeService=B,A._parser=W,A._parseBuffer=new Uint32Array(4096),A._stringDecoder=new a.StringToUtf32,A._utf8Decoder=new a.Utf8ToUtf32,A._workCell=new r.CellData,A._windowTitle="",A._iconName="",A._windowTitleStack=[],A._iconNameStack=[],A._curAttrData=t.DEFAULT_ATTR_DATA.clone(),A._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone(),A._onRequestBell=new i.EventEmitter,A._onRequestRefreshRows=new i.EventEmitter,A._onRequestReset=new i.EventEmitter,A._onRequestScroll=new i.EventEmitter,A._onRequestSyncScrollBar=new i.EventEmitter,A._onRequestWindowsOptionsReport=new i.EventEmitter,A._onA11yChar=new i.EventEmitter,A._onA11yTab=new i.EventEmitter,A._onCursorMove=new i.EventEmitter,A._onLineFeed=new i.EventEmitter,A._onScroll=new i.EventEmitter,A._onTitleChange=new i.EventEmitter,A.register(A._parser),A._parser.setCsiHandlerFallback(function(D,F){A._logService.debug("Unknown CSI code: ",{identifier:A._parser.identToString(D),params:F.toArray()})}),A._parser.setEscHandlerFallback(function(D){A._logService.debug("Unknown ESC code: ",{identifier:A._parser.identToString(D)})}),A._parser.setExecuteHandlerFallback(function(D){A._logService.debug("Unknown EXECUTE code: ",{code:D})}),A._parser.setOscHandlerFallback(function(D,F,U){A._logService.debug("Unknown OSC code: ",{identifier:D,action:F,data:U})}),A._parser.setDcsHandlerFallback(function(D,F,U){F==="HOOK"&&(U=U.toArray()),A._logService.debug("Unknown DCS code: ",{identifier:A._parser.identToString(D),action:F,payload:U})}),A._parser.setPrintHandler(function(D,F,U){return A.print(D,F,U)}),A._parser.setCsiHandler({final:"@"},function(D){return A.insertChars(D)}),A._parser.setCsiHandler({intermediates:" ",final:"@"},function(D){return A.scrollLeft(D)}),A._parser.setCsiHandler({final:"A"},function(D){return A.cursorUp(D)}),A._parser.setCsiHandler({intermediates:" ",final:"A"},function(D){return A.scrollRight(D)}),A._parser.setCsiHandler({final:"B"},function(D){return A.cursorDown(D)}),A._parser.setCsiHandler({final:"C"},function(D){return A.cursorForward(D)}),A._parser.setCsiHandler({final:"D"},function(D){return A.cursorBackward(D)}),A._parser.setCsiHandler({final:"E"},function(D){return A.cursorNextLine(D)}),A._parser.setCsiHandler({final:"F"},function(D){return A.cursorPrecedingLine(D)}),A._parser.setCsiHandler({final:"G"},function(D){return A.cursorCharAbsolute(D)}),A._parser.setCsiHandler({final:"H"},function(D){return A.cursorPosition(D)}),A._parser.setCsiHandler({final:"I"},function(D){return A.cursorForwardTab(D)}),A._parser.setCsiHandler({final:"J"},function(D){return A.eraseInDisplay(D)}),A._parser.setCsiHandler({prefix:"?",final:"J"},function(D){return A.eraseInDisplay(D)}),A._parser.setCsiHandler({final:"K"},function(D){return A.eraseInLine(D)}),A._parser.setCsiHandler({prefix:"?",final:"K"},function(D){return A.eraseInLine(D)}),A._parser.setCsiHandler({final:"L"},function(D){return A.insertLines(D)}),A._parser.setCsiHandler({final:"M"},function(D){return A.deleteLines(D)}),A._parser.setCsiHandler({final:"P"},function(D){return A.deleteChars(D)}),A._parser.setCsiHandler({final:"S"},function(D){return A.scrollUp(D)}),A._parser.setCsiHandler({final:"T"},function(D){return A.scrollDown(D)}),A._parser.setCsiHandler({final:"X"},function(D){return A.eraseChars(D)}),A._parser.setCsiHandler({final:"Z"},function(D){return A.cursorBackwardTab(D)}),A._parser.setCsiHandler({final:"`"},function(D){return A.charPosAbsolute(D)}),A._parser.setCsiHandler({final:"a"},function(D){return A.hPositionRelative(D)}),A._parser.setCsiHandler({final:"b"},function(D){return A.repeatPrecedingCharacter(D)}),A._parser.setCsiHandler({final:"c"},function(D){return A.sendDeviceAttributesPrimary(D)}),A._parser.setCsiHandler({prefix:">",final:"c"},function(D){return A.sendDeviceAttributesSecondary(D)}),A._parser.setCsiHandler({final:"d"},function(D){return A.linePosAbsolute(D)}),A._parser.setCsiHandler({final:"e"},function(D){return A.vPositionRelative(D)}),A._parser.setCsiHandler({final:"f"},function(D){return A.hVPosition(D)}),A._parser.setCsiHandler({final:"g"},function(D){return A.tabClear(D)}),A._parser.setCsiHandler({final:"h"},function(D){return A.setMode(D)}),A._parser.setCsiHandler({prefix:"?",final:"h"},function(D){return A.setModePrivate(D)}),A._parser.setCsiHandler({final:"l"},function(D){return A.resetMode(D)}),A._parser.setCsiHandler({prefix:"?",final:"l"},function(D){return A.resetModePrivate(D)}),A._parser.setCsiHandler({final:"m"},function(D){return A.charAttributes(D)}),A._parser.setCsiHandler({final:"n"},function(D){return A.deviceStatus(D)}),A._parser.setCsiHandler({prefix:"?",final:"n"},function(D){return A.deviceStatusPrivate(D)}),A._parser.setCsiHandler({intermediates:"!",final:"p"},function(D){return A.softReset(D)}),A._parser.setCsiHandler({intermediates:" ",final:"q"},function(D){return A.setCursorStyle(D)}),A._parser.setCsiHandler({final:"r"},function(D){return A.setScrollRegion(D)}),A._parser.setCsiHandler({final:"s"},function(D){return A.saveCursor(D)}),A._parser.setCsiHandler({final:"t"},function(D){return A.windowOptions(D)}),A._parser.setCsiHandler({final:"u"},function(D){return A.restoreCursor(D)}),A._parser.setCsiHandler({intermediates:"'",final:"}"},function(D){return A.insertColumns(D)}),A._parser.setCsiHandler({intermediates:"'",final:"~"},function(D){return A.deleteColumns(D)}),A._parser.setExecuteHandler(u.C0.BEL,function(){return A.bell()}),A._parser.setExecuteHandler(u.C0.LF,function(){return A.lineFeed()}),A._parser.setExecuteHandler(u.C0.VT,function(){return A.lineFeed()}),A._parser.setExecuteHandler(u.C0.FF,function(){return A.lineFeed()}),A._parser.setExecuteHandler(u.C0.CR,function(){return A.carriageReturn()}),A._parser.setExecuteHandler(u.C0.BS,function(){return A.backspace()}),A._parser.setExecuteHandler(u.C0.HT,function(){return A.tab()}),A._parser.setExecuteHandler(u.C0.SO,function(){return A.shiftOut()}),A._parser.setExecuteHandler(u.C0.SI,function(){return A.shiftIn()}),A._parser.setExecuteHandler(u.C1.IND,function(){return A.index()}),A._parser.setExecuteHandler(u.C1.NEL,function(){return A.nextLine()}),A._parser.setExecuteHandler(u.C1.HTS,function(){return A.tabSet()}),A._parser.setOscHandler(0,new l.OscHandler(function(D){A.setTitle(D),A.setIconName(D)})),A._parser.setOscHandler(1,new l.OscHandler(function(D){return A.setIconName(D)})),A._parser.setOscHandler(2,new l.OscHandler(function(D){return A.setTitle(D)})),A._parser.setEscHandler({final:"7"},function(){return A.saveCursor()}),A._parser.setEscHandler({final:"8"},function(){return A.restoreCursor()}),A._parser.setEscHandler({final:"D"},function(){return A.index()}),A._parser.setEscHandler({final:"E"},function(){return A.nextLine()}),A._parser.setEscHandler({final:"H"},function(){return A.tabSet()}),A._parser.setEscHandler({final:"M"},function(){return A.reverseIndex()}),A._parser.setEscHandler({final:"="},function(){return A.keypadApplicationMode()}),A._parser.setEscHandler({final:">"},function(){return A.keypadNumericMode()}),A._parser.setEscHandler({final:"c"},function(){return A.fullReset()}),A._parser.setEscHandler({final:"n"},function(){return A.setgLevel(2)}),A._parser.setEscHandler({final:"o"},function(){return A.setgLevel(3)}),A._parser.setEscHandler({final:"|"},function(){return A.setgLevel(3)}),A._parser.setEscHandler({final:"}"},function(){return A.setgLevel(2)}),A._parser.setEscHandler({final:"~"},function(){return A.setgLevel(1)}),A._parser.setEscHandler({intermediates:"%",final:"@"},function(){return A.selectDefaultCharset()}),A._parser.setEscHandler({intermediates:"%",final:"G"},function(){return A.selectDefaultCharset()});var k=function(D){R._parser.setEscHandler({intermediates:"(",final:D},function(){return A.selectCharset("("+D)}),R._parser.setEscHandler({intermediates:")",final:D},function(){return A.selectCharset(")"+D)}),R._parser.setEscHandler({intermediates:"*",final:D},function(){return A.selectCharset("*"+D)}),R._parser.setEscHandler({intermediates:"+",final:D},function(){return A.selectCharset("+"+D)}),R._parser.setEscHandler({intermediates:"-",final:D},function(){return A.selectCharset("-"+D)}),R._parser.setEscHandler({intermediates:".",final:D},function(){return A.selectCharset("."+D)}),R._parser.setEscHandler({intermediates:"/",final:D},function(){return A.selectCharset("/"+D)})},R=this;for(var I in _.CHARSETS)k(I);return A._parser.setEscHandler({intermediates:"#",final:"8"},function(){return A.screenAlignmentPattern()}),A._parser.setErrorHandler(function(D){return A._logService.error("Parsing error: ",D),D}),A._parser.setDcsHandler({intermediates:"$",final:"q"},new p(A._bufferService,A._coreService,A._logService,A._optionsService)),A}return S(b,E),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(){E.prototype.dispose.call(this)},b.prototype.parse=function(y){var C=this._bufferService.buffer,T=C.x,x=C.y;if(this._logService.debug("parsing data",y),this._parseBuffer.length<y.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(y.length,131072))),this._dirtyRowService.clearRange(),y.length>131072)for(var O=0;O<y.length;O+=131072){var P=O+131072<y.length?O+131072:y.length,M=typeof y=="string"?this._stringDecoder.decode(y.substring(O,P),this._parseBuffer):this._utf8Decoder.decode(y.subarray(O,P),this._parseBuffer);this._parser.parse(this._parseBuffer,M)}else M=typeof y=="string"?this._stringDecoder.decode(y,this._parseBuffer):this._utf8Decoder.decode(y,this._parseBuffer),this._parser.parse(this._parseBuffer,M);(C=this._bufferService.buffer).x===T&&C.y===x||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},b.prototype.print=function(y,C,T){var x,O,P=this._bufferService.buffer,M=this._charsetService.charset,B=this._optionsService.options.screenReaderMode,W=this._bufferService.cols,A=this._coreService.decPrivateModes.wraparound,k=this._coreService.modes.insertMode,R=this._curAttrData,I=P.lines.get(P.ybase+P.y);this._dirtyRowService.markDirty(P.y),P.x&&T-C>0&&I.getWidth(P.x-1)===2&&I.setCellFromCodePoint(P.x-1,0,1,R.fg,R.bg,R.extended);for(var D=C;D<T;++D){if(x=y[D],O=this._unicodeService.wcwidth(x),x<127&&M){var F=M[String.fromCharCode(x)];F&&(x=F.charCodeAt(0))}if(B&&this._onA11yChar.fire(a.stringFromCodePoint(x)),O||!P.x){if(P.x+O-1>=W){if(A){for(;P.x<W;)I.setCellFromCodePoint(P.x++,0,1,R.fg,R.bg,R.extended);P.x=0,P.y++,P.y===P.scrollBottom+1?(P.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(P.y>=this._bufferService.rows&&(P.y=this._bufferService.rows-1),P.lines.get(P.ybase+P.y).isWrapped=!0),I=P.lines.get(P.ybase+P.y)}else if(P.x=W-1,O===2)continue}if(k&&(I.insertCells(P.x,O,P.getNullCell(R),R),I.getWidth(W-1)===2&&I.setCellFromCodePoint(W-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,R.fg,R.bg,R.extended)),I.setCellFromCodePoint(P.x++,x,O,R.fg,R.bg,R.extended),O>0)for(;--O;)I.setCellFromCodePoint(P.x++,0,0,R.fg,R.bg,R.extended)}else I.getWidth(P.x-1)?I.addCodepointToCell(P.x-1,x):I.addCodepointToCell(P.x-2,x)}T-C>0&&(I.loadCell(P.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),P.x<W&&T-C>0&&I.getWidth(P.x)===0&&!I.hasContent(P.x)&&I.setCellFromCodePoint(P.x,0,1,R.fg,R.bg,R.extended),this._dirtyRowService.markDirty(P.y)},b.prototype.addCsiHandler=function(y,C){var T=this;return y.final!=="t"||y.prefix||y.intermediates?this._parser.addCsiHandler(y,C):this._parser.addCsiHandler(y,function(x){return!v(x.params[0],T._optionsService.options.windowOptions)||C(x)})},b.prototype.addDcsHandler=function(y,C){return this._parser.addDcsHandler(y,new g.DcsHandler(C))},b.prototype.addEscHandler=function(y,C){return this._parser.addEscHandler(y,C)},b.prototype.addOscHandler=function(y,C){return this._parser.addOscHandler(y,new l.OscHandler(C))},b.prototype.bell=function(){this._onRequestBell.fire()},b.prototype.lineFeed=function(){var y=this._bufferService.buffer;this._dirtyRowService.markDirty(y.y),this._optionsService.options.convertEol&&(y.x=0),y.y++,y.y===y.scrollBottom+1?(y.y--,this._onRequestScroll.fire(this._eraseAttrData())):y.y>=this._bufferService.rows&&(y.y=this._bufferService.rows-1),y.x>=this._bufferService.cols&&y.x--,this._dirtyRowService.markDirty(y.y),this._onLineFeed.fire()},b.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},b.prototype.backspace=function(){var y,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&&((y=C.lines.get(C.ybase+C.y))===null||y===void 0?void 0:y.isWrapped)){C.lines.get(C.ybase+C.y).isWrapped=!1,C.y--,C.x=this._bufferService.cols-1;var T=C.lines.get(C.ybase+C.y);T.hasWidth(C.x)&&!T.hasContent(C.x)&&C.x--}this._restrictCursor()},b.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var y=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-y)}},b.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},b.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},b.prototype._restrictCursor=function(y){y===void 0&&(y=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(y,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(y,C){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=y,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+C):(this._bufferService.buffer.x=y,this._bufferService.buffer.y=C),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},b.prototype._moveCursor=function(y,C){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+y,this._bufferService.buffer.y+C)},b.prototype.cursorUp=function(y){var C=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;C>=0?this._moveCursor(0,-Math.min(C,y.params[0]||1)):this._moveCursor(0,-(y.params[0]||1))},b.prototype.cursorDown=function(y){var C=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;C>=0?this._moveCursor(0,Math.min(C,y.params[0]||1)):this._moveCursor(0,y.params[0]||1)},b.prototype.cursorForward=function(y){this._moveCursor(y.params[0]||1,0)},b.prototype.cursorBackward=function(y){this._moveCursor(-(y.params[0]||1),0)},b.prototype.cursorNextLine=function(y){this.cursorDown(y),this._bufferService.buffer.x=0},b.prototype.cursorPrecedingLine=function(y){this.cursorUp(y),this._bufferService.buffer.x=0},b.prototype.cursorCharAbsolute=function(y){this._setCursor((y.params[0]||1)-1,this._bufferService.buffer.y)},b.prototype.cursorPosition=function(y){this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1)},b.prototype.charPosAbsolute=function(y){this._setCursor((y.params[0]||1)-1,this._bufferService.buffer.y)},b.prototype.hPositionRelative=function(y){this._moveCursor(y.params[0]||1,0)},b.prototype.linePosAbsolute=function(y){this._setCursor(this._bufferService.buffer.x,(y.params[0]||1)-1)},b.prototype.vPositionRelative=function(y){this._moveCursor(0,y.params[0]||1)},b.prototype.hVPosition=function(y){this.cursorPosition(y)},b.prototype.tabClear=function(y){var C=y.params[0];C===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:C===3&&(this._bufferService.buffer.tabs={})},b.prototype.cursorForwardTab=function(y){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var C=y.params[0]||1;C--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},b.prototype.cursorBackwardTab=function(y){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var C=y.params[0]||1,T=this._bufferService.buffer;C--;)T.x=T.prevStop()},b.prototype._eraseInBufferLine=function(y,C,T,x){x===void 0&&(x=!1);var O=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+y);O.replaceCells(C,T,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),x&&(O.isWrapped=!1)},b.prototype._resetBufferLine=function(y){var C=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+y);C.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),C.isWrapped=!1},b.prototype.eraseInDisplay=function(y){var C;switch(this._restrictCursor(),y.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 T=this._bufferService.buffer.lines.length-this._bufferService.rows;T>0&&(this._bufferService.buffer.lines.trimStart(T),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-T,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-T,0),this._onScroll.fire(0))}},b.prototype.eraseInLine=function(y){switch(this._restrictCursor(),y.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(y){this._restrictCursor();var C=y.params[0]||1,T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){for(var x=T.ybase+T.y,O=this._bufferService.rows-1-T.scrollBottom,P=this._bufferService.rows-1+T.ybase-O+1;C--;)T.lines.splice(P-1,1),T.lines.splice(x,0,T.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(T.y,T.scrollBottom),T.x=0}},b.prototype.deleteLines=function(y){this._restrictCursor();var C=y.params[0]||1,T=this._bufferService.buffer;if(!(T.y>T.scrollBottom||T.y<T.scrollTop)){var x,O=T.ybase+T.y;for(x=this._bufferService.rows-1-T.scrollBottom,x=this._bufferService.rows-1+T.ybase-x;C--;)T.lines.splice(O,1),T.lines.splice(x,0,T.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(T.y,T.scrollBottom),T.x=0}},b.prototype.insertChars=function(y){this._restrictCursor();var C=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);C&&(C.insertCells(this._bufferService.buffer.x,y.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},b.prototype.deleteChars=function(y){this._restrictCursor();var C=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);C&&(C.deleteCells(this._bufferService.buffer.x,y.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},b.prototype.scrollUp=function(y){for(var C=y.params[0]||1,T=this._bufferService.buffer;C--;)T.lines.splice(T.ybase+T.scrollTop,1),T.lines.splice(T.ybase+T.scrollBottom,0,T.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)},b.prototype.scrollDown=function(y){for(var C=y.params[0]||1,T=this._bufferService.buffer;C--;)T.lines.splice(T.ybase+T.scrollBottom,1),T.lines.splice(T.ybase+T.scrollTop,0,T.getBlankLine(t.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(T.scrollTop,T.scrollBottom)},b.prototype.scrollLeft=function(y){var C=this._bufferService.buffer;if(!(C.y>C.scrollBottom||C.y<C.scrollTop)){for(var T=y.params[0]||1,x=C.scrollTop;x<=C.scrollBottom;++x){var O=C.lines.get(C.ybase+x);O.deleteCells(0,T,C.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom)}},b.prototype.scrollRight=function(y){var C=this._bufferService.buffer;if(!(C.y>C.scrollBottom||C.y<C.scrollTop)){for(var T=y.params[0]||1,x=C.scrollTop;x<=C.scrollBottom;++x){var O=C.lines.get(C.ybase+x);O.insertCells(0,T,C.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom)}},b.prototype.insertColumns=function(y){var C=this._bufferService.buffer;if(!(C.y>C.scrollBottom||C.y<C.scrollTop)){for(var T=y.params[0]||1,x=C.scrollTop;x<=C.scrollBottom;++x){var O=this._bufferService.buffer.lines.get(C.ybase+x);O.insertCells(C.x,T,C.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom)}},b.prototype.deleteColumns=function(y){var C=this._bufferService.buffer;if(!(C.y>C.scrollBottom||C.y<C.scrollTop)){for(var T=y.params[0]||1,x=C.scrollTop;x<=C.scrollBottom;++x){var O=C.lines.get(C.ybase+x);O.deleteCells(C.x,T,C.getNullCell(this._eraseAttrData()),this._eraseAttrData()),O.isWrapped=!1}this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom)}},b.prototype.eraseChars=function(y){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+(y.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},b.prototype.repeatPrecedingCharacter=function(y){if(this._parser.precedingCodepoint){for(var C=y.params[0]||1,T=new Uint32Array(C),x=0;x<C;++x)T[x]=this._parser.precedingCodepoint;this.print(T,0,T.length)}},b.prototype.sendDeviceAttributesPrimary=function(y){y.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c"))},b.prototype.sendDeviceAttributesSecondary=function(y){y.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(y.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c"))},b.prototype._is=function(y){return(this._optionsService.options.termName+"").indexOf(y)===0},b.prototype.setMode=function(y){for(var C=0;C<y.length;C++)switch(y.params[C]){case 4:this._coreService.modes.insertMode=!0}},b.prototype.setModePrivate=function(y){for(var C=0;C<y.length;C++)switch(y.params[C]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(y){for(var C=0;C<y.length;C++)switch(y.params[C]){case 4:this._coreService.modes.insertMode=!1}},b.prototype.resetModePrivate=function(y){for(var C=0;C<y.length;C++)switch(y.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(),y.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(y,C,T,x,O){return C===2?(y|=50331648,y&=-16777216,y|=s.AttributeData.fromColorRGB([T,x,O])):C===5&&(y&=-50331904,y|=33554432|255&T),y},b.prototype._extractColor=function(y,C,T){var x=[0,0,-1,0,0,0],O=0,P=0;do{if(x[P+O]=y.params[C+P],y.hasSubParams(C+P)){var M=y.getSubParams(C+P),B=0;do x[1]===5&&(O=1),x[P+B+1+O]=M[B];while(++B<M.length&&B+P+1+O<x.length);break}if(x[1]===5&&P+O>=2||x[1]===2&&P+O>=5)break;x[1]&&(O=1)}while(++P+C<y.length&&P+O<x.length);for(B=2;B<x.length;++B)x[B]===-1&&(x[B]=0);switch(x[0]){case 38:T.fg=this._updateAttrColor(T.fg,x[1],x[3],x[4],x[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,x[1],x[3],x[4],x[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,x[1],x[3],x[4],x[5])}return P},b.prototype._processUnderline=function(y,C){C.extended=C.extended.clone(),(!~y||y>5)&&(y=1),C.extended.underlineStyle=y,C.fg|=268435456,y===0&&(C.fg&=-268435457),C.updateExtended()},b.prototype.charAttributes=function(y){if(y.length===1&&y.params[0]===0)return this._curAttrData.fg=t.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=t.DEFAULT_ATTR_DATA.bg);for(var C,T=y.length,x=this._curAttrData,O=0;O<T;O++)(C=y.params[O])>=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(y.hasSubParams(O)?y.getSubParams(O)[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?O+=this._extractColor(y,O,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(y){switch(y.params[0]){case 5:this._coreService.triggerDataEvent(u.C0.ESC+"[0n");break;case 6:var C=this._bufferService.buffer.y+1,T=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(u.C0.ESC+"["+C+";"+T+"R")}},b.prototype.deviceStatusPrivate=function(y){switch(y.params[0]){case 6:var C=this._bufferService.buffer.y+1,T=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(u.C0.ESC+"[?"+C+";"+T+"R")}},b.prototype.softReset=function(y){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(y){var C=y.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 T=C%2==1;this._optionsService.options.cursorBlink=T},b.prototype.setScrollRegion=function(y){var C,T=y.params[0]||1;(y.length<2||(C=y.params[1])>this._bufferService.rows||C===0)&&(C=this._bufferService.rows),C>T&&(this._bufferService.buffer.scrollTop=T-1,this._bufferService.buffer.scrollBottom=C-1,this._setCursor(0,0))},b.prototype.windowOptions=function(y){if(v(y.params[0],this._optionsService.options.windowOptions)){var C=y.length>1?y.params[1]:0;switch(y.params[0]){case 14:C!==2&&this._onRequestWindowsOptionsReport.fire(h.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(h.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(u.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(y){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(y){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(y){this._windowTitle=y,this._onTitleChange.fire(y)},b.prototype.setIconName=function(y){this._iconName=y},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,_.DEFAULT_CHARSET)},b.prototype.selectCharset=function(y){y.length===2?y[0]!=="/"&&this._charsetService.setgCharset(m[y[0]],_.CHARSETS[y[1]]||_.DEFAULT_CHARSET):this.selectDefaultCharset()},b.prototype.index=function(){this._restrictCursor();var y=this._bufferService.buffer;this._bufferService.buffer.y++,y.y===y.scrollBottom+1?(y.y--,this._onRequestScroll.fire(this._eraseAttrData())):y.y>=this._bufferService.rows&&(y.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 y=this._bufferService.buffer;if(y.y===y.scrollTop){var C=y.scrollBottom-y.scrollTop;y.lines.shiftElements(y.ybase+y.y,C,1),y.lines.set(y.ybase+y.y,y.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(y.scrollTop,y.scrollBottom)}else y.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(y){this._charsetService.setgLevel(y)},b.prototype.screenAlignmentPattern=function(){var y=new r.CellData;y.content=1<<22|"E".charCodeAt(0),y.fg=this._curAttrData.fg,y.bg=this._curAttrData.bg;var C=this._bufferService.buffer;this._setCursor(0,0);for(var T=0;T<this._bufferService.rows;++T){var x=C.ybase+C.y+T,O=C.lines.get(x);O&&(O.fill(y),O.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},b}(o.Disposable);c.InputHandler=w},function(H,c,L){"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(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;var f=function(){function S(h,u){if(h===void 0&&(h=32),u===void 0&&(u=32),this.maxLength=h,this.maxSubParamsLength=u,u>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(u),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return S.fromArray=function(h){var u=new S;if(!h.length)return u;for(var _=h[0]instanceof Array?1:0;_<h.length;++_){var d=h[_];if(d instanceof Array)for(var o=0;o<d.length;++o)u.addSubParam(d[o]);else u.addParam(d)}return u},S.prototype.clone=function(){var h=new S(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h},S.prototype.toArray=function(){for(var h=[],u=0;u<this.length;++u){h.push(this.params[u]);var _=this._subParamsIdx[u]>>8,d=255&this._subParamsIdx[u];d-_>0&&h.push(Array.prototype.slice.call(this._subParams,_,d))}return h},S.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},S.prototype.addParam=function(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>2147483647?2147483647:h}},S.prototype.addSubParam=function(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>2147483647?2147483647:h,this._subParamsIdx[this.length-1]++}},S.prototype.hasSubParams=function(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0},S.prototype.getSubParams=function(h){var u=this._subParamsIdx[h]>>8,_=255&this._subParamsIdx[h];return _-u>0?this._subParams.subarray(u,_):null},S.prototype.getSubParamsAll=function(){for(var h={},u=0;u<this.length;++u){var _=this._subParamsIdx[u]>>8,d=255&this._subParamsIdx[u];d-_>0&&(h[u]=this._subParams.slice(_,d))}return h},S.prototype.addDigit=function(h){var u;if(!(this._rejectDigits||!(u=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var _=this._digitIsSub?this._subParams:this.params,d=_[u-1];_[u-1]=~d?Math.min(10*d+h,2147483647):h}},S}();c.Params=f},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;var f=L(23),S=L(8),h=function(){function _(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return _.prototype.addHandler=function(d,o){this._handlers[d]===void 0&&(this._handlers[d]=[]);var n=this._handlers[d];return n.push(o),{dispose:function(){var a=n.indexOf(o);a!==-1&&n.splice(a,1)}}},_.prototype.setHandler=function(d,o){this._handlers[d]=[o]},_.prototype.clearHandler=function(d){this._handlers[d]&&delete this._handlers[d]},_.prototype.setHandlerFallback=function(d){this._handlerFb=d},_.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},_.prototype.reset=function(){this._state===2&&this.end(!1),this._id=-1,this._state=0},_.prototype._start=function(){var d=this._handlers[this._id];if(d)for(var o=d.length-1;o>=0;o--)d[o].start();else this._handlerFb(this._id,"START")},_.prototype._put=function(d,o,n){var a=this._handlers[this._id];if(a)for(var t=a.length-1;t>=0;t--)a[t].put(d,o,n);else this._handlerFb(this._id,"PUT",S.utf32ToString(d,o,n))},_.prototype._end=function(d){var o=this._handlers[this._id];if(o){for(var n=o.length-1;n>=0&&o[n].end(d)===!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},_.prototype.put=function(d,o,n){if(this._state!==3){if(this._state===1)for(;o<n;){var a=d[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(d,o,n)}},_.prototype.end=function(d){this._state!==0&&(this._state!==3&&(this._state===1&&this._start(),this._end(d)),this._id=-1,this._state=0)},_}();c.OscParser=h;var u=function(){function _(d){this._handler=d,this._data="",this._hitLimit=!1}return _.prototype.start=function(){this._data="",this._hitLimit=!1},_.prototype.put=function(d,o,n){this._hitLimit||(this._data+=S.utf32ToString(d,o,n),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},_.prototype.end=function(d){var o;return this._hitLimit?o=!1:d&&(o=this._handler(this._data)),this._data="",this._hitLimit=!1,o},_}();c.OscHandler=u},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;var f=L(8),S=L(21),h=L(23),u=[],_=function(){function o(){this._handlers=Object.create(null),this._active=u,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=u,this._ident=0},o.prototype.hook=function(n,a){if(this.reset(),this._ident=n,this._active=this._handlers[n]||u,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=u,this._ident=0},o}();c.DcsParser=_;var d=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>h.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 S.Params)),this._params=void 0,this._data="",this._hitLimit=!1,a},o}();c.DcsHandler=d},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.removeTerminalFromCache=c.acquireCharAtlas=void 0;var f=L(26),S=L(43),h=[];c.acquireCharAtlas=function(u,_,d,o,n){for(var a=f.generateConfig(o,n,u,d),t=0;t<h.length;t++){var i=(e=h[t]).ownedBy.indexOf(_);if(i>=0){if(f.configEquals(e.config,a))return e.atlas;e.ownedBy.length===1?(e.atlas.dispose(),h.splice(t,1)):e.ownedBy.splice(i,1);break}}for(t=0;t<h.length;t++){var e=h[t];if(f.configEquals(e.config,a))return e.ownedBy.push(_),e.atlas}var r={atlas:new S.DynamicCharAtlas(document,a),config:a,ownedBy:[_]};return h.push(r),r.atlas},c.removeTerminalFromCache=function(u){for(var _=0;_<h.length;_++){var d=h[_].ownedBy.indexOf(u);if(d!==-1){h[_].ownedBy.length===1?(h[_].atlas.dispose(),h.splice(_,1)):h[_].ownedBy.splice(d,1);break}}}},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.is256Color=c.configEquals=c.generateConfig=void 0;var f=L(3);c.generateConfig=function(S,h,u,_){var d={foreground:_.foreground,background:_.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:_.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:S,scaledCharHeight:h,fontFamily:u.fontFamily,fontSize:u.fontSize,fontWeight:u.fontWeight,fontWeightBold:u.fontWeightBold,allowTransparency:u.allowTransparency,colors:d}},c.configEquals=function(S,h){for(var u=0;u<S.colors.ansi.length;u++)if(S.colors.ansi[u].rgba!==h.colors.ansi[u].rgba)return!1;return S.devicePixelRatio===h.devicePixelRatio&&S.fontFamily===h.fontFamily&&S.fontSize===h.fontSize&&S.fontWeight===h.fontWeight&&S.fontWeightBold===h.fontWeightBold&&S.allowTransparency===h.allowTransparency&&S.scaledCharWidth===h.scaledCharWidth&&S.scaledCharHeight===h.scaledCharHeight&&S.colors.foreground===h.colors.foreground&&S.colors.background===h.colors.background},c.is256Color=function(S){return S<f.DEFAULT_COLOR}},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.ColorManager=c.DEFAULT_ANSI_COLORS=void 0;var f=L(10),S=L(45),h=f.css.toColor("#ffffff"),u=f.css.toColor("#000000"),_=f.css.toColor("#ffffff"),d=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 l=8+10*i;a.push({css:f.channels.toCss(l,l,l),rgba:f.channels.toRgba(l,l,l)})}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 S.ColorContrastCache,this.colors={foreground:h,background:u,cursor:_,cursorAccent:d,selectionTransparent:o,selectionOpaque:f.color.blend(u,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,h),this.colors.background=this._parseColor(t.background,u),this.colors.cursor=this._parseColor(t.cursor,_,!0),this.colors.cursorAccent=this._parseColor(t.cursorAccent,d,!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(w){return Number(w)}),l=s[0],g=s[1],m=s[2],v=s[3],p=Math.round(255*v);return{rgba:f.channels.toRgba(l,g,m,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(H,c,L){"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(H,c,L){"use strict";var f,S=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 h=L(6),u=L(3),_=L(4),d=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 S(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}(h.AttributeData);c.JoinedCellData=d;var o=function(){function n(a){this._bufferService=a,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.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,l=0,g=t.getFg(0),m=t.getBg(0),v=0;v<t.getTrimmedLength();v++)if(t.loadCell(v,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==g||this._workCell.bg!==m){if(v-r>1)for(var p=this._getJoinedRanges(e,l,s,t,r),w=0;w<p.length;w++)i.push(p[w]);r=v,l=s,g=this._workCell.fg,m=this._workCell.bg}s+=this._workCell.getChars().length||u.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-r>1)for(p=this._getJoinedRanges(e,l,s,t,r),w=0;w<p.length;w++)i.push(p[w]);return i},n.prototype._getJoinedRanges=function(a,t,i,e,r){for(var s=a.substring(t,i),l=this._characterJoiners[0].handler(s),g=1;g<this._characterJoiners.length;g++)for(var m=this._characterJoiners[g].handler(s),v=0;v<m.length;v++)n._mergeRanges(l,m[v]);return this._stringRangesToCellRanges(l,e,r),l},n.prototype._stringRangesToCellRanges=function(a,t,i){var e=0,r=!1,s=0,l=a[e];if(l){for(var g=i;g<this._bufferService.cols;g++){var m=t.getWidth(g),v=t.getString(g).length||u.WHITESPACE_CELL_CHAR.length;if(m!==0){if(!r&&l[0]<=s&&(l[0]=g,r=!0),l[1]<=s){if(l[1]=g,!(l=a[++e]))break;l[0]<=s?(l[0]=g,r=!0):r=!1}s+=v}}l&&(l[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(H,c,L){"use strict";function f(S,h){var u=h.getBoundingClientRect();return[S.clientX-u.left,S.clientY-u.top]}Object.defineProperty(c,"__esModule",{value:!0}),c.getRawByteCoords=c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=f,c.getCoords=function(S,h,u,_,d,o,n,a){if(d){var t=f(S,h);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),u+(a?1:0)),t[1]=Math.min(Math.max(t[1],1),_),t}},c.getRawByteCoords=function(S){if(S)return{x:S[0]+32,y:S[1]+32}}},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0;var f=function(){function S(h){this._renderCallback=h}return S.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},S.prototype.refresh=function(h,u,_){var d=this;this._rowCount=_,h=h!==void 0?h:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return d._innerRefresh()}))},S.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var h=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(h,u)}},S}();c.RenderDebouncer=f},function(H,c,L){"use strict";var f,S=this&&this.__extends||(f=function(u,_){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,o){d.__proto__=o}||function(d,o){for(var n in o)o.hasOwnProperty(n)&&(d[n]=o[n])})(u,_)},function(u,_){function d(){this.constructor=u}f(u,_),u.prototype=_===null?Object.create(_):(d.prototype=_.prototype,new d)});Object.defineProperty(c,"__esModule",{value:!0}),c.ScreenDprMonitor=void 0;var h=function(u){function _(){var d=u!==null&&u.apply(this,arguments)||this;return d._currentDevicePixelRatio=window.devicePixelRatio,d}return S(_,u),_.prototype.setListener=function(d){var o=this;this._listener&&this.clearListener(),this._listener=d,this._outerListener=function(){o._listener&&(o._listener(window.devicePixelRatio,o._currentDevicePixelRatio),o._updateDpr())},this._updateDpr()},_.prototype.dispose=function(){u.prototype.dispose.call(this),this.clearListener()},_.prototype._updateDpr=function(){var d;this._outerListener&&((d=this._resolutionMediaMatchList)===null||d===void 0||d.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},_.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)},_}(L(2).Disposable);c.ScreenDprMonitor=h},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function f(S,h){if(h===void 0&&(h=5),typeof S!="object")return S;var u=Array.isArray(S)?[]:{};for(var _ in S)u[_]=h<=1?S[_]:S[_]?f(S[_],h-1):S[_];return u}},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;var f=L(4),S=L(35),h=L(18),u=L(0),_=L(83),d=function(){function e(r){this._core=new S.Terminal(r),this._addonManager=new _.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,l){return this._checkProposedApi(),this._core.registerLinkMatcher(r,s,l)},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,l){this._verifyIntegers(r,s,l),this._core.select(r,s,l)},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 h},enumerable:!1,configurable:!0}),e.prototype._verifyIntegers=function(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];for(var l=0,g=r;l<g.length;l++){var m=g[l];if(m===1/0||isNaN(m)||m%1!=0)throw new Error("This API only accepts integers")}},e}();c.Terminal=d;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 u.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,l){return this._line.translateToString(r,s,l)},e}(),t=function(){function e(r){this._core=r}return e.prototype.registerCsiHandler=function(r,s){return this._core.addCsiHandler(r,function(l){return s(l.toArray())})},e.prototype.addCsiHandler=function(r,s){return this.registerCsiHandler(r,s)},e.prototype.registerDcsHandler=function(r,s){return this._core.addDcsHandler(r,function(l,g){return s(l,g.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(H,c,L){"use strict";var f,S=this&&this.__extends||(f=function(W,A){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,R){k.__proto__=R}||function(k,R){for(var I in R)R.hasOwnProperty(I)&&(k[I]=R[I])})(W,A)},function(W,A){function k(){this.constructor=W}f(W,A),W.prototype=A===null?Object.create(A):(k.prototype=A.prototype,new k)});Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;var h=L(36),u=L(37),_=L(38),d=L(12),o=L(19),n=L(40),a=L(50),t=L(51),i=L(11),e=L(7),r=L(18),s=L(54),l=L(55),g=L(56),m=L(57),v=L(59),p=L(0),w=L(16),E=L(27),b=L(60),y=L(5),C=L(61),T=L(62),x=L(63),O=L(64),P=L(65),M=typeof window!="undefined"?window.document:null,B=function(W){function A(k){k===void 0&&(k={});var R=W.call(this,k)||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,D){return R.refresh(I,D)})),R.register(R._inputHandler.onRequestReset(function(){return R.reset()})),R.register(R._inputHandler.onRequestScroll(function(I,D){return R.scroll(I,D||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 S(A,W),Object.defineProperty(A.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),A.prototype.dispose=function(){var k,R,I;this._isDisposed||(W.prototype.dispose.call(this),(k=this._renderService)===null||k===void 0||k.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))},A.prototype._setup=function(){W.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(A.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),A.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},A.prototype._updateOptions=function(k){var R,I,D,F;switch(W.prototype._updateOptions.call(this,k),k){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":(D=this.viewport)===null||D===void 0||D.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new g.AccessibilityManager(this,this._renderService)):((F=this._accessibilityManager)===null||F===void 0||F.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},A.prototype._onTextAreaFocus=function(k){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(d.C0.ESC+"[I"),this.updateCursorStyle(k),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},A.prototype.blur=function(){var k;return(k=this.textarea)===null||k===void 0?void 0:k.blur()},A.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(d.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},A.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var k=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),R=this._bufferService.buffer.y*k,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=k+"px",this.textarea.style.lineHeight=k+"px",this.textarea.style.zIndex="-5"}},A.prototype._initGlobal=function(){var k=this;this._bindKeys(),this.register(e.addDisposableDomListener(this.element,"copy",function(I){k.hasSelection()&&_.copyHandler(I,k._selectionService)}));var R=function(I){return _.handlePasteEvent(I,k.textarea,k._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&&_.rightClickHandler(I,k.textarea,k.screenElement,k._selectionService,k.options.rightClickSelectsWord)})):this.register(e.addDisposableDomListener(this.element,"contextmenu",function(I){_.rightClickHandler(I,k.textarea,k.screenElement,k._selectionService,k.options.rightClickSelectsWord)})),i.isLinux&&this.register(e.addDisposableDomListener(this.element,"auxclick",function(I){I.button===1&&_.moveTextAreaUnderMouseCursor(I,k.textarea,k.screenElement)}))},A.prototype._bindKeys=function(){var k=this;this.register(e.addDisposableDomListener(this.textarea,"keyup",function(R){return k._keyUp(R)},!0)),this.register(e.addDisposableDomListener(this.textarea,"keydown",function(R){return k._keyDown(R)},!0)),this.register(e.addDisposableDomListener(this.textarea,"keypress",function(R){return k._keyPress(R)},!0)),this.register(e.addDisposableDomListener(this.textarea,"compositionstart",function(){return k._compositionHelper.compositionstart()})),this.register(e.addDisposableDomListener(this.textarea,"compositionupdate",function(R){return k._compositionHelper.compositionupdate(R)})),this.register(e.addDisposableDomListener(this.textarea,"compositionend",function(){return k._compositionHelper.compositionend()})),this.register(this.onRender(function(){return k._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(R){return k._queueLinkification(R.start,R.end)}))},A.prototype.open=function(k){var R=this;if(!k)throw new Error("Terminal requires a parent element.");M.body.contains(k)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=k.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"),k.appendChild(this.element);var I=M.createDocumentFragment();this._viewportElement=M.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),I.appendChild(this._viewportElement),this._viewportScrollArea=M.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=M.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=M.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),I.appendChild(this.screenElement),this.textarea=M.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(U){return R._onTextAreaFocus(U)})),this.register(e.addDisposableDomListener(this.textarea,"blur",function(){return R._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var D=this._instantiationService.createInstance(O.CoreBrowserService,this.textarea);this._instantiationService.setService(y.ICoreBrowserService,D),this._charSizeService=this._instantiationService.createInstance(C.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(y.ICharSizeService,this._charSizeService),this._compositionView=M.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(I),this._theme=this.options.theme||this._theme,this._colorManager=new E.ColorManager(M,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(U){return R._colorManager.onOptionsChange(U)})),this._colorManager.setTheme(this._theme);var F=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(b.RenderService,F,this.rows,this.screenElement)),this._instantiationService.setService(y.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(U){return R._onRender.fire(U)})),this.onResize(function(U){return R._renderService.resize(U.cols,U.rows)}),this._soundService=this._instantiationService.createInstance(s.SoundService),this._instantiationService.setService(y.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(T.MouseService),this._instantiationService.setService(y.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(u.Viewport,function(U,K){return R.scrollLines(U,K)},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(y.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(function(U){return R.scrollLines(U.amount,U.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return R._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(U){return R._renderService.onSelectionChanged(U.start,U.end,U.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(U){R.textarea.value=U,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(l.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(U){return R._selectionService.onMouseDown(U)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new g.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},A.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(m.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},A.prototype._setTheme=function(k){var R,I,D;this._theme=k,(R=this._colorManager)===null||R===void 0||R.setTheme(k),(I=this._renderService)===null||I===void 0||I.setColors(this._colorManager.colors),(D=this.viewport)===null||D===void 0||D.onThemeChange(this._colorManager.colors)},A.prototype.bindMouse=function(){var k=this,R=this,I=this.element;function D(j){var N,z,Y=R._mouseService.getRawByteCoords(j,R.screenElement,R.cols,R.rows);if(!Y)return!1;switch(j.overrideType||j.type){case"mousemove":z=32,j.buttons===void 0?(N=3,j.button!==void 0&&(N=j.button<3?j.button:3)):N=1&j.buttons?0:4&j.buttons?1:2&j.buttons?2:3;break;case"mouseup":z=0,N=j.button<3?j.button:3;break;case"mousedown":z=1,N=j.button<3?j.button:3;break;case"wheel":j.deltaY!==0&&(z=j.deltaY<0?0:1),N=4;break;default:return!1}return!(z===void 0||N===void 0||N>4)&&R._coreMouseService.triggerMouseEvent({col:Y.x-33,row:Y.y-33,button:N,action:z,ctrl:j.ctrlKey,alt:j.altKey,shift:j.shiftKey})}var F={mouseup:null,wheel:null,mousedrag:null,mousemove:null},U=function(j){return D(j),j.buttons||(k._document.removeEventListener("mouseup",F.mouseup),F.mousedrag&&k._document.removeEventListener("mousemove",F.mousedrag)),k.cancel(j)},K=function(j){return D(j),j.preventDefault(),k.cancel(j)},V=function(j){j.buttons&&D(j)},X=function(j){j.buttons||D(j)};this.register(this._coreMouseService.onProtocolChange(function(j){j?(k.optionsService.options.logLevel==="debug"&&k._logService.debug("Binding to mouse events:",k._coreMouseService.explainEvents(j)),k.element.classList.add("enable-mouse-events"),k._selectionService.disable()):(k._logService.debug("Unbinding from mouse events."),k.element.classList.remove("enable-mouse-events"),k._selectionService.enable()),8&j?F.mousemove||(I.addEventListener("mousemove",X),F.mousemove=X):(I.removeEventListener("mousemove",F.mousemove),F.mousemove=null),16&j?F.wheel||(I.addEventListener("wheel",K,{passive:!1}),F.wheel=K):(I.removeEventListener("wheel",F.wheel),F.wheel=null),2&j?F.mouseup||(F.mouseup=U):(k._document.removeEventListener("mouseup",F.mouseup),F.mouseup=null),4&j?F.mousedrag||(F.mousedrag=V):(k._document.removeEventListener("mousemove",F.mousedrag),F.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(e.addDisposableDomListener(I,"mousedown",function(j){if(j.preventDefault(),k.focus(),k._coreMouseService.areMouseEventsActive&&!k._selectionService.shouldForceSelection(j))return D(j),F.mouseup&&k._document.addEventListener("mouseup",F.mouseup),F.mousedrag&&k._document.addEventListener("mousemove",F.mousedrag),k.cancel(j)})),this.register(e.addDisposableDomListener(I,"wheel",function(j){if(!F.wheel){if(!k.buffer.hasScrollback){var N=k.viewport.getLinesScrolled(j);if(N===0)return;for(var z=d.C0.ESC+(k._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(j.deltaY<0?"A":"B"),Y="",Z=0;Z<Math.abs(N);Z++)Y+=z;k._coreService.triggerDataEvent(Y,!0)}}},{passive:!0})),this.register(e.addDisposableDomListener(I,"wheel",function(j){if(!F.wheel)return k.viewport.onWheel(j)?void 0:k.cancel(j)},{passive:!1})),this.register(e.addDisposableDomListener(I,"touchstart",function(j){if(!k._coreMouseService.areMouseEventsActive)return k.viewport.onTouchStart(j),k.cancel(j)},{passive:!0})),this.register(e.addDisposableDomListener(I,"touchmove",function(j){if(!k._coreMouseService.areMouseEventsActive)return k.viewport.onTouchMove(j)?void 0:k.cancel(j)},{passive:!1}))},A.prototype.refresh=function(k,R){var I;(I=this._renderService)===null||I===void 0||I.refreshRows(k,R)},A.prototype._queueLinkification=function(k,R){var I;(I=this.linkifier)===null||I===void 0||I.linkifyRows(k,R)},A.prototype.updateCursorStyle=function(k){this._selectionService&&this._selectionService.shouldColumnSelect(k)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},A.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},A.prototype.scrollLines=function(k,R){W.prototype.scrollLines.call(this,k,R),this.refresh(0,this.rows-1)},A.prototype.paste=function(k){_.paste(k,this.textarea,this._coreService)},A.prototype.attachCustomKeyEventHandler=function(k){this._customKeyEventHandler=k},A.prototype.registerLinkMatcher=function(k,R,I){var D=this.linkifier.registerLinkMatcher(k,R,I);return this.refresh(0,this.rows-1),D},A.prototype.deregisterLinkMatcher=function(k){this.linkifier.deregisterLinkMatcher(k)&&this.refresh(0,this.rows-1)},A.prototype.registerLinkProvider=function(k){return this.linkifier2.registerLinkProvider(k)},A.prototype.registerCharacterJoiner=function(k){var R=this._renderService.registerCharacterJoiner(k);return this.refresh(0,this.rows-1),R},A.prototype.deregisterCharacterJoiner=function(k){this._renderService.deregisterCharacterJoiner(k)&&this.refresh(0,this.rows-1)},Object.defineProperty(A.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),A.prototype.addMarker=function(k){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+k)},A.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},A.prototype.select=function(k,R,I){this._selectionService.setSelection(k,R,I)},A.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},A.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]}},A.prototype.clearSelection=function(){var k;(k=this._selectionService)===null||k===void 0||k.clearSelection()},A.prototype.selectAll=function(){var k;(k=this._selectionService)===null||k===void 0||k.selectAll()},A.prototype.selectLines=function(k,R){var I;(I=this._selectionService)===null||I===void 0||I.selectLines(k,R)},A.prototype._keyDown=function(k){if(this._keyDownHandled=!1,this._customKeyEventHandler&&this._customKeyEventHandler(k)===!1)return!1;if(!this._compositionHelper.keydown(k))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var R=v.evaluateKeyboardEvent(k,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(k),R.type===3||R.type===2){var I=this.rows-1;return this.scrollLines(R.type===2?-I:I),this.cancel(k,!0)}return R.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,k)||(R.cancel&&this.cancel(k,!0),!R.key||(R.key!==d.C0.ETX&&R.key!==d.C0.CR||(this.textarea.value=""),this._onKey.fire({key:R.key,domEvent:k}),this._showCursor(),this._coreService.triggerDataEvent(R.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(k,!0)))},A.prototype._isThirdLevelShift=function(k,R){var I=k.isMac&&!this.options.macOptionIsMeta&&R.altKey&&!R.ctrlKey&&!R.metaKey||k.isWindows&&R.altKey&&R.ctrlKey&&!R.metaKey;return R.type==="keypress"?I:I&&(!R.keyCode||R.keyCode>47)},A.prototype._keyUp=function(k){this._customKeyEventHandler&&this._customKeyEventHandler(k)===!1||(function(R){return R.keyCode===16||R.keyCode===17||R.keyCode===18}(k)||this.focus(),this.updateCursorStyle(k))},A.prototype._keyPress=function(k){var R;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&this._customKeyEventHandler(k)===!1)return!1;if(this.cancel(k),k.charCode)R=k.charCode;else if(k.which===null||k.which===void 0)R=k.keyCode;else{if(k.which===0||k.charCode===0)return!1;R=k.which}return!(!R||(k.altKey||k.ctrlKey||k.metaKey)&&!this._isThirdLevelShift(this.browser,k))&&(R=String.fromCharCode(R),this._onKey.fire({key:R,domEvent:k}),this._showCursor(),this._coreService.triggerDataEvent(R,!0),!0)},A.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},A.prototype.resize=function(k,R){k!==this.cols||R!==this.rows?W.prototype.resize.call(this,k,R):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},A.prototype._afterResize=function(k,R){var I,D;(I=this._charSizeService)===null||I===void 0||I.measure(),(D=this.viewport)===null||D===void 0||D.syncScrollArea(!0)},A.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 k=1;k<this.rows;k++)this.buffer.lines.push(this.buffer.getBlankLine(w.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},A.prototype.reset=function(){var k,R;this.options.rows=this.rows,this.options.cols=this.cols;var I=this._customKeyEventHandler;this._setup(),W.prototype.reset.call(this),(k=this._selectionService)===null||k===void 0||k.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1),(R=this.viewport)===null||R===void 0||R.syncScrollArea()},A.prototype._reportWindowsOptions=function(k){if(this._renderService)switch(k){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(d.C0.ESC+"[4;"+I+";"+R+"t");break;case o.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var D=this._renderService.dimensions.scaledCellWidth.toFixed(0),F=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(d.C0.ESC+"[6;"+F+";"+D+"t")}},A.prototype.cancel=function(k,R){if(this.options.cancelEvents||R)return k.preventDefault(),k.stopPropagation(),!1},A.prototype._visualBell=function(){return!1},A.prototype._soundBell=function(){return this.options.bellStyle==="sound"},A}(P.CoreTerminal);c.Terminal=B},function(H,c,L){"use strict";var f=this&&this.__decorate||function(d,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(d,o,n,a);else for(var r=d.length-1;r>=0;r--)(t=d[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},S=this&&this.__param||function(d,o){return function(n,a){o(n,a,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;var h=L(5),u=L(1),_=function(){function d(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(d.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),d.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},d.prototype.compositionupdate=function(o){var n=this;this._compositionView.textContent=o.data,this.updateCompositionElements(),setTimeout(function(){n._compositionPosition.end=n._textarea.value.length},0)},d.prototype.compositionend=function(){this._finalizeComposition(!0)},d.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)},d.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)}},d.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)},d.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)}},d=f([S(2,u.IBufferService),S(3,u.IOptionsService),S(4,h.ICharSizeService),S(5,u.ICoreService)],d)}();c.CompositionHelper=_},function(H,c,L){"use strict";var f,S=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)}),h=this&&this.__decorate||function(t,i,e,r){var s,l=arguments.length,g=l<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(t,i,e,r);else for(var m=t.length-1;m>=0;m--)(s=t[m])&&(g=(l<3?s(g):l>3?s(i,e,g):s(i,e))||g);return l>3&&g&&Object.defineProperty(i,e,g),g},u=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 _=L(2),d=L(7),o=L(5),n=L(1),a=function(t){function i(e,r,s,l,g,m,v){var p=t.call(this)||this;return p._scrollLines=e,p._viewportElement=r,p._scrollArea=s,p._bufferService=l,p._optionsService=g,p._charSizeService=m,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(d.addDisposableDomListener(p._viewportElement,"scroll",p._onScroll.bind(p))),setTimeout(function(){return p.syncScrollArea()},0),p}return S(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=h([u(3,n.IBufferService),u(4,n.IOptionsService),u(5,o.ICharSizeService),u(6,o.IRenderService)],i)}(_.Disposable);c.Viewport=a},function(H,c,L){"use strict";function f(_){return _.replace(/\r?\n/g,"\r")}function S(_,d){return d?"[200~"+_+"[201~":_}function h(_,d,o){_=S(_=f(_),o.decPrivateModes.bracketedPasteMode),o.triggerDataEvent(_,!0),d.value=""}function u(_,d,o){var n=o.getBoundingClientRect(),a=_.clientX-n.left-10,t=_.clientY-n.top-10;d.style.width="20px",d.style.height="20px",d.style.left=a+"px",d.style.top=t+"px",d.style.zIndex="1000",d.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=S,c.copyHandler=function(_,d){_.clipboardData&&_.clipboardData.setData("text/plain",d.selectionText),_.preventDefault()},c.handlePasteEvent=function(_,d,o){_.stopPropagation(),_.clipboardData&&h(_.clipboardData.getData("text/plain"),d,o)},c.paste=h,c.moveTextAreaUnderMouseCursor=u,c.rightClickHandler=function(_,d,o,n,a){u(_,d,o),a&&!n.isClickInSelection(_)&&n.selectWordAtCursor(_),d.value=n.selectionText,d.select()}},function(H,c,L){"use strict";var f,S=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 h=L(2),u=L(15),_=L(21),d=L(22),o=L(24),n=function(){function t(i){this.table=new Uint8Array(i)}return t.prototype.setDefault=function(i,e){u.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 l=0;l<i.length;l++)this.table[e<<8|i[l]]=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(m,v){return v}),e=function(m,v){return i.slice(m,v)},r=e(32,127),s=e(0,24);s.push(25),s.push.apply(s,e(28,32));var l,g=e(0,14);for(l in t.setDefault(1,0),t.addMany(r,0,2,0),g)t.addMany([24,26,153,154],l,3,0),t.addMany(e(128,144),l,3,0),t.addMany(e(144,152),l,3,0),t.add(156,l,0,0),t.add(27,l,11,1),t.add(157,l,4,8),t.addMany([152,158,159],l,0,7),t.add(155,l,11,3),t.add(144,l,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 _.Params,r._params.addParam(0),r._collect=0,r.precedingCodepoint=0,r._printHandlerFb=function(s,l,g){},r._executeHandlerFb=function(s){},r._csiHandlerFb=function(s,l){},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 d.OscParser,r._dcsParser=new o.DcsParser,r._errorHandler=r._errorHandlerFb,r.setEscHandler({final:"\\"},function(){}),r}return S(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 l=0;l<e.intermediates.length;++l){var g=e.intermediates.charCodeAt(l);if(32>g||g>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=g}}if(e.final.length!==1)throw new Error("final must be a single byte");var m=e.final.charCodeAt(0);if(r[0]>m||m>r[1])throw new Error("final must be in range "+r[0]+" .. "+r[1]);return s<<=8,s|=m},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 l=this._escHandlers[s];return l.push(r),{dispose:function(){var g=l.indexOf(r);g!==-1&&l.splice(g,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 l=this._csiHandlers[s];return l.push(r),{dispose:function(){var g=l.indexOf(r);g!==-1&&l.splice(g,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,l=0,g=this.currentState,m=this._oscParser,v=this._dcsParser,p=this._collect,w=this._params,E=this._transitions.table,b=0;b<r;++b){switch((l=E[g<<8|((s=e[b])<160?s:160)])>>4){case 2:for(var y=b+1;;++y){if(y>=r||(s=e[y])<32||s>126&&s<160){this._printHandler(e,b,y),b=y-1;break}if(++y>=r||(s=e[y])<32||s>126&&s<160){this._printHandler(e,b,y),b=y-1;break}if(++y>=r||(s=e[y])<32||s>126&&s<160){this._printHandler(e,b,y),b=y-1;break}if(++y>=r||(s=e[y])<32||s>126&&s<160){this._printHandler(e,b,y),b=y-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:g,collect:p,params:w,abort:!1}).abort)return;break;case 7:for(var C=this._csiHandlers[p<<8|s],T=C?C.length-1:-1;T>=0&&C[T](w)===!1;T--);T<0&&this._csiHandlerFb(p<<8|s,w),this.precedingCodepoint=0;break;case 8:do switch(s){case 59:w.addParam(0);break;case 58:w.addSubParam(-1);break;default:w.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],O=x?x.length-1:-1;O>=0&&x[O]()===!1;O--);O<0&&this._escHandlerFb(p<<8|s),this.precedingCodepoint=0;break;case 11:w.reset(),w.addParam(0),p=0;break;case 12:v.hook(p<<8|s,w);break;case 13:for(var P=b+1;;++P)if(P>=r||(s=e[P])===24||s===26||s===27||s>127&&s<160){v.put(e,b,P),b=P-1;break}break;case 14:v.unhook(s!==24&&s!==26),s===27&&(l|=1),w.reset(),w.addParam(0),p=0,this.precedingCodepoint=0;break;case 4:m.start();break;case 5:for(var M=b+1;;M++)if(M>=r||(s=e[M])<32||s>127&&s<=159){m.put(e,b,M),b=M-1;break}break;case 6:m.end(s!==24&&s!==26),s===27&&(l|=1),w.reset(),w.addParam(0),p=0,this.precedingCodepoint=0}g=15&l}this._collect=p,this.currentState=g},i}(h.Disposable);c.EscapeSequenceParser=a},function(H,c,L){"use strict";var f,S=this&&this.__extends||(f=function(m,v){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,w){p.__proto__=w}||function(p,w){for(var E in w)w.hasOwnProperty(E)&&(p[E]=w[E])})(m,v)},function(m,v){function p(){this.constructor=m}f(m,v),m.prototype=v===null?Object.create(v):(p.prototype=v.prototype,new p)}),h=this&&this.__decorate||function(m,v,p,w){var E,b=arguments.length,y=b<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,v,p,w);else for(var C=m.length-1;C>=0;C--)(E=m[C])&&(y=(b<3?E(y):b>3?E(v,p,y):E(v,p))||y);return b>3&&y&&Object.defineProperty(v,p,y),y},u=this&&this.__param||function(m,v){return function(p,w){v(p,w,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Renderer=void 0;var _=L(41),d=L(47),o=L(48),n=L(49),a=L(29),t=L(2),i=L(5),e=L(1),r=L(25),s=L(0),l=1,g=function(m){function v(p,w,E,b,y,C,T,x,O){var P=m.call(this)||this;P._colors=p,P._screenElement=w,P._bufferService=y,P._charSizeService=C,P._optionsService=T,P._id=l++,P._onRequestRedraw=new s.EventEmitter;var M=P._optionsService.options.allowTransparency;return P._characterJoinerRegistry=new a.CharacterJoinerRegistry(P._bufferService),P._renderLayers=[new _.TextRenderLayer(P._screenElement,0,P._colors,P._characterJoinerRegistry,M,P._id,P._bufferService,T),new d.SelectionRenderLayer(P._screenElement,1,P._colors,P._id,P._bufferService,T),new n.LinkRenderLayer(P._screenElement,2,P._colors,P._id,E,b,P._bufferService,T),new o.CursorRenderLayer(P._screenElement,3,P._colors,P._id,P._onRequestRedraw,P._bufferService,T,x,O)],P.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},P._devicePixelRatio=window.devicePixelRatio,P._updateDimensions(),P.onOptionsChanged(),P}return S(v,m),Object.defineProperty(v.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),v.prototype.dispose=function(){for(var p=0,w=this._renderLayers;p<w.length;p++)w[p].dispose();m.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 w=0,E=this._renderLayers;w<E.length;w++){var b=E[w];b.setColors(this._colors),b.reset()}},v.prototype.onResize=function(p,w){this._updateDimensions();for(var E=0,b=this._renderLayers;E<b.length;E++)b[E].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,w,E){E===void 0&&(E=!1),this._runOperation(function(b){return b.onSelectionChanged(p,w,E)})},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 w=0,E=this._renderLayers;w<E.length;w++)p(E[w])},v.prototype.renderRows=function(p,w){for(var E=0,b=this._renderLayers;E<b.length;E++)b[E].onGridChanged(p,w)},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=h([u(4,e.IBufferService),u(5,i.ICharSizeService),u(6,e.IOptionsService),u(7,e.ICoreService),u(8,i.ICoreBrowserService)],v)}(t.Disposable);c.Renderer=g},function(H,c,L){"use strict";var f,S=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 h=L(42),u=L(13),_=L(6),d=L(3),o=L(29),n=L(4),a=function(t){function i(e,r,s,l,g,m,v,p){var w=t.call(this,e,"text",r,g,s,m,v,p)||this;return w._characterWidth=0,w._characterFont="",w._characterOverlapCache={},w._workCell=new n.CellData,w._state=new h.GridCache,w._characterJoinerRegistry=l,w}return S(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,l){for(var g=e;g<=r;g++)for(var m=g+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.lines.get(m),p=s?s.getJoinedCharacters(m):[],w=0;w<this._bufferService.cols;w++){v.loadCell(w,this._workCell);var E=this._workCell,b=!1,y=w;if(E.getWidth()!==0){if(p.length>0&&w===p[0][0]){b=!0;var C=p.shift();E=new o.JoinedCellData(this._workCell,v.translateToString(!0,C[0],C[1]),C[1]-C[0]),y=C[1]-1}!b&&this._isOverlapping(E)&&y<v.length-1&&v.getCodePoint(y+1)===d.NULL_CELL_CODE&&(E.content&=-12582913,E.content|=2<<22),l(E,w,g),w=y}}},i.prototype._drawBackground=function(e,r){var s=this,l=this._ctx,g=this._bufferService.cols,m=0,v=0,p=null;l.save(),this._forEachCell(e,r,null,function(w,E,b){var y=null;w.isInverse()?y=w.isFgDefault()?s._colors.foreground.css:w.isFgRGB()?"rgb("+_.AttributeData.toColorRGB(w.getFgColor()).join(",")+")":s._colors.ansi[w.getFgColor()].css:w.isBgRGB()?y="rgb("+_.AttributeData.toColorRGB(w.getBgColor()).join(",")+")":w.isBgPalette()&&(y=s._colors.ansi[w.getBgColor()].css),p===null&&(m=E,v=b),b!==v?(l.fillStyle=p||"",s._fillCells(m,v,g-m,1),m=E,v=b):p!==y&&(l.fillStyle=p||"",s._fillCells(m,v,E-m,1),m=E,v=b),p=y}),p!==null&&(l.fillStyle=p,this._fillCells(m,v,g-m,1)),l.restore()},i.prototype._drawForeground=function(e,r){var s=this;this._forEachCell(e,r,this._characterJoinerRegistry,function(l,g,m){if(!l.isInvisible()&&(s._drawChars(l,g,m),l.isUnderline())){if(s._ctx.save(),l.isInverse())if(l.isBgDefault())s._ctx.fillStyle=s._colors.background.css;else if(l.isBgRGB())s._ctx.fillStyle="rgb("+_.AttributeData.toColorRGB(l.getBgColor()).join(",")+")";else{var v=l.getBgColor();s._optionsService.options.drawBoldTextInBrightColors&&l.isBold()&&v<8&&(v+=8),s._ctx.fillStyle=s._colors.ansi[v].css}else if(l.isFgDefault())s._ctx.fillStyle=s._colors.foreground.css;else if(l.isFgRGB())s._ctx.fillStyle="rgb("+_.AttributeData.toColorRGB(l.getFgColor()).join(",")+")";else{var p=l.getFgColor();s._optionsService.options.drawBoldTextInBrightColors&&l.isBold()&&p<8&&(p+=8),s._ctx.fillStyle=s._colors.ansi[p].css}s._fillBottomLineAtCells(g,m,l.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}(u.BaseRenderLayer);c.TextRenderLayer=a},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.GridCache=void 0;var f=function(){function S(){this.cache=[]}return S.prototype.resize=function(h,u){for(var _=0;_<h;_++){this.cache.length<=_&&this.cache.push([]);for(var d=this.cache[_].length;d<u;d++)this.cache[_].push(void 0);this.cache[_].length=u}this.cache.length=h},S.prototype.clear=function(){for(var h=0;h<this.cache.length;h++)for(var u=0;u<this.cache[h].length;u++)this.cache[h][u]=void 0},S}();c.GridCache=f},function(H,c,L){"use strict";var f,S=this&&this.__extends||(f=function(s,l){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,m){g.__proto__=m}||function(g,m){for(var v in m)m.hasOwnProperty(v)&&(g[v]=m[v])})(s,l)},function(s,l){function g(){this.constructor=s}f(s,l),s.prototype=l===null?Object.create(l):(g.prototype=l.prototype,new g)});Object.defineProperty(c,"__esModule",{value:!0}),c.NoneCharAtlas=c.DynamicCharAtlas=c.getGlyphCacheKey=void 0;var h=L(9),u=L(44),_=L(27),d=L(46),o=L(11),n=L(28),a=L(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 l(g,m){var v=s.call(this)||this;v._config=m,v._drawToCacheCount=0,v._glyphsWaitingOnBitmap=[],v._bitmapCommitTimeout=null,v._bitmap=null,v._cacheCanvas=g.createElement("canvas"),v._cacheCanvas.width=1024,v._cacheCanvas.height=1024,v._cacheCtx=n.throwIfFalsy(v._cacheCanvas.getContext("2d",{alpha:!0}));var p=g.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 w=v._width*v._height;return v._cacheMap=new d.LRUMap(w),v._cacheMap.prealloc(w),v}return S(l,s),l.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},l.prototype.beginFrame=function(){this._drawToCacheCount=0},l.prototype.draw=function(g,m,v,p){if(m.code===32)return!0;if(!this._canCache(m))return!1;var w=i(m),E=this._cacheMap.get(w);if(E!=null)return this._drawFromCache(g,E,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 y=this._drawToCache(m,b);return this._cacheMap.set(w,y),this._drawFromCache(g,y,v,p),!0}return!1},l.prototype._canCache=function(g){return g.code<256},l.prototype._toCoordinateX=function(g){return g%this._width*this._config.scaledCharWidth},l.prototype._toCoordinateY=function(g){return Math.floor(g/this._width)*this._config.scaledCharHeight},l.prototype._drawFromCache=function(g,m,v,p){if(!m.isEmpty){var w=this._toCoordinateX(m.index),E=this._toCoordinateY(m.index);g.drawImage(m.inBitmap?this._bitmap:this._cacheCanvas,w,E,this._config.scaledCharWidth,this._config.scaledCharHeight,v,p,this._config.scaledCharWidth,this._config.scaledCharHeight)}},l.prototype._getColorFromAnsiIndex=function(g){return g<this._config.colors.ansi.length?this._config.colors.ansi[g]:_.DEFAULT_ANSI_COLORS[g]},l.prototype._getBackgroundColor=function(g){return this._config.allowTransparency?t:g.bg===h.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:g.bg<256?this._getColorFromAnsiIndex(g.bg):this._config.colors.background},l.prototype._getForegroundColor=function(g){return g.fg===h.INVERTED_DEFAULT_COLOR?a.color.opaque(this._config.colors.background):g.fg<256?this._getColorFromAnsiIndex(g.fg):this._config.colors.foreground},l.prototype._drawToCache=function(g,m){this._drawToCacheCount++,this._tmpCtx.save();var v=this._getBackgroundColor(g);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=g.bold?this._config.fontWeightBold:this._config.fontWeight,w=g.italic?"italic":"";this._tmpCtx.font=w+" "+p+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(g).css,g.dim&&(this._tmpCtx.globalAlpha=h.DIM_OPACITY),this._tmpCtx.fillText(g.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var E=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),b=!1;this._config.allowTransparency||(b=function(x,O){for(var P=!0,M=O.rgba>>>24,B=O.rgba>>>16&255,W=O.rgba>>>8&255,A=0;A<x.data.length;A+=4)x.data[A]===M&&x.data[A+1]===B&&x.data[A+2]===W?x.data[A+3]=0:P=!1;return P}(E,v));var y=this._toCoordinateX(m),C=this._toCoordinateY(m);this._cacheCtx.putImageData(E,y,C);var T={index:m,isEmpty:b,inBitmap:!1};return this._addGlyphToBitmap(T),T},l.prototype._addGlyphToBitmap=function(g){var m=this;!("createImageBitmap"in window)||o.isFirefox||o.isSafari||(this._glyphsWaitingOnBitmap.push(g),this._bitmapCommitTimeout===null&&(this._bitmapCommitTimeout=window.setTimeout(function(){return m._generateBitmap()},100)))},l.prototype._generateBitmap=function(){var g=this,m=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(v){g._bitmap=v;for(var p=0;p<m.length;p++)m[p].inBitmap=!0}),this._bitmapCommitTimeout=null},l}(u.BaseCharAtlas);c.DynamicCharAtlas=e;var r=function(s){function l(g,m){return s.call(this)||this}return S(l,s),l.prototype.draw=function(g,m,v,p){return!1},l}(u.BaseCharAtlas);c.NoneCharAtlas=r},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.BaseCharAtlas=void 0;var f=function(){function S(){this._didWarmUp=!1}return S.prototype.dispose=function(){},S.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},S.prototype._doWarmUp=function(){},S.prototype.beginFrame=function(){},S}();c.BaseCharAtlas=f},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;var f=function(){function S(){this._color={},this._rgba={}}return S.prototype.clear=function(){this._color={},this._rgba={}},S.prototype.setCss=function(h,u,_){this._rgba[h]||(this._rgba[h]={}),this._rgba[h][u]=_},S.prototype.getCss=function(h,u){return this._rgba[h]?this._rgba[h][u]:void 0},S.prototype.setColor=function(h,u,_){this._color[h]||(this._color[h]={}),this._color[h][u]=_},S.prototype.getColor=function(h,u){return this._color[h]?this._color[h][u]:void 0},S}();c.ColorContrastCache=f},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.LRUMap=void 0;var f=function(){function S(h){this.capacity=h,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return S.prototype._unlinkNode=function(h){var u=h.prev,_=h.next;h===this._head&&(this._head=_),h===this._tail&&(this._tail=u),u!==null&&(u.next=_),_!==null&&(_.prev=u)},S.prototype._appendNode=function(h){var u=this._tail;u!==null&&(u.next=h),h.prev=u,h.next=null,this._tail=h,this._head===null&&(this._head=h)},S.prototype.prealloc=function(h){for(var u=this._nodePool,_=0;_<h;_++)u.push({prev:null,next:null,key:null,value:null})},S.prototype.get=function(h){var u=this._map[h];return u!==void 0?(this._unlinkNode(u),this._appendNode(u),u.value):null},S.prototype.peekValue=function(h){var u=this._map[h];return u!==void 0?u.value:null},S.prototype.peek=function(){var h=this._head;return h===null?null:h.value},S.prototype.set=function(h,u){var _=this._map[h];if(_!==void 0)_=this._map[h],this._unlinkNode(_),_.value=u;else if(this.size>=this.capacity)_=this._head,this._unlinkNode(_),delete this._map[_.key],_.key=h,_.value=u,this._map[h]=_;else{var d=this._nodePool;d.length>0?((_=d.pop()).key=h,_.value=u):_={prev:null,next:null,key:h,value:u},this._map[h]=_,this.size++}this._appendNode(_)},S}();c.LRUMap=f},function(H,c,L){"use strict";var f,S=this&&this.__extends||(f=function(u,_){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,o){d.__proto__=o}||function(d,o){for(var n in o)o.hasOwnProperty(n)&&(d[n]=o[n])})(u,_)},function(u,_){function d(){this.constructor=u}f(u,_),u.prototype=_===null?Object.create(_):(d.prototype=_.prototype,new d)});Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionRenderLayer=void 0;var h=function(u){function _(d,o,n,a,t,i){var e=u.call(this,d,"selection",o,!0,n,a,t,i)||this;return e._clearState(),e}return S(_,u),_.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},_.prototype.resize=function(d){u.prototype.resize.call(this,d),this._clearState()},_.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},_.prototype.onSelectionChanged=function(d,o,n){if(this._didStateChange(d,o,n,this._bufferService.buffer.ydisp))if(this._clearAll(),d&&o){var a=d[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=d[0],s=o[0]-r,l=e-i+1;this._fillCells(r,i,s,l)}else{r=a===i?d[0]:0;var g=i===e?o[0]:this._bufferService.cols;this._fillCells(r,i,g-r,1);var m=Math.max(e-i-1,0);if(this._fillCells(0,i+1,this._bufferService.cols,m),i!==e){var v=t===e?o[0]:this._bufferService.cols;this._fillCells(0,e,v,1)}}this._state.start=[d[0],d[1]],this._state.end=[o[0],o[1]],this._state.columnSelectMode=n,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},_.prototype._didStateChange=function(d,o,n,a){return!this._areCoordinatesEqual(d,this._state.start)||!this._areCoordinatesEqual(o,this._state.end)||n!==this._state.columnSelectMode||a!==this._state.ydisp},_.prototype._areCoordinatesEqual=function(d,o){return!(!d||!o)&&d[0]===o[0]&&d[1]===o[1]},_}(L(13).BaseRenderLayer);c.SelectionRenderLayer=h},function(H,c,L){"use strict";var f,S=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 h=L(13),u=L(4),_=function(o){function n(a,t,i,e,r,s,l,g,m){var v=o.call(this,a,"cursor",t,!0,i,e,s,l)||this;return v._onRequestRedraw=r,v._coreService=g,v._coreBrowserService=m,v._cell=new u.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 S(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 d(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}(h.BaseRenderLayer);c.CursorRenderLayer=_;var d=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(H,c,L){"use strict";var f,S=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 h=L(13),u=L(9),_=L(26),d=function(o){function n(a,t,i,e,r,s,l,g){var m=o.call(this,a,"link",t,!0,i,e,l,g)||this;return r.onShowLinkUnderline(function(v){return m._onShowLinkUnderline(v)}),r.onHideLinkUnderline(function(v){return m._onHideLinkUnderline(v)}),s.onShowLinkUnderline(function(v){return m._onShowLinkUnderline(v)}),s.onHideLinkUnderline(function(v){return m._onHideLinkUnderline(v)}),m}return S(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===u.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:a.fg&&_.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}(h.BaseRenderLayer);c.LinkRenderLayer=d},function(H,c,L){"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},S=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 h=L(0),u=L(1),_=function(){function o(n,a,t){this._bufferService=n,this._logService=a,this._unicodeService=t,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new h.EventEmitter,this._onHideLinkUnderline=new h.EventEmitter,this._onLinkTooltip=new h.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,l=function(){var m=i[typeof t.matchIndex!="number"?0:t.matchIndex];if(!m)return g._logService.debug("match found without corresponding matchIndex",i,t),"break";if(s=a.indexOf(m,s+1),r.lastIndex=s+m.length,s<0)return"break";var v=g._bufferService.buffer.stringIndexToBufferIndex(n,s);if(v[0]<0)return"break";var p=g._bufferService.buffer.lines.get(v[0]);if(!p)return"break";var w=p.getFg(v[1]),E=w?w>>9&511:void 0;t.validationCallback?t.validationCallback(m,function(b){e._rowsTimeoutId||b&&e._addLink(v[1],v[0]-e._bufferService.buffer.ydisp,m,t,E)}):g._addLink(v[1],v[0]-g._bufferService.buffer.ydisp,m,t,E)},g=this;(i=r.exec(a))!==null&&!(l()==="break"););},o.prototype._addLink=function(n,a,t,i,e){var r=this;if(this._mouseZoneManager&&this._element){var s=this._unicodeService.getStringCellWidth(t),l=n%this._bufferService.cols,g=a+Math.floor(n/this._bufferService.cols),m=(l+s)%this._bufferService.cols,v=g+Math.floor((l+s)/this._bufferService.cols);m===0&&(m=this._bufferService.cols,v--),this._mouseZoneManager.add(new d(l+1,g+1,m+1,v+1,function(p){if(i.handler)return i.handler(p,t);var w=window.open();w?(w.opener=null,w.location.href=t):console.warn("Opening link blocked as opener could not be cleared")},function(){r._onShowLinkUnderline.fire(r._createLinkHoverEvent(l,g,m,v,e)),r._element.classList.add("xterm-cursor-pointer")},function(p){r._onLinkTooltip.fire(r._createLinkHoverEvent(l,g,m,v,e)),i.hoverTooltipCallback&&i.hoverTooltipCallback(p,t,{start:{x:l,y:g},end:{x:m,y:v}})},function(){r._onHideLinkUnderline.fire(r._createLinkHoverEvent(l,g,m,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([S(0,u.IBufferService),S(1,u.ILogService),S(2,u.IUnicodeService)],o)}();c.Linkifier=_;var d=function(o,n,a,t,i,e,r,s,l){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=l};c.MouseZone=d},function(H,c,L){"use strict";var f,S=this&&this.__extends||(f=function(m,v){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,w){p.__proto__=w}||function(p,w){for(var E in w)w.hasOwnProperty(E)&&(p[E]=w[E])})(m,v)},function(m,v){function p(){this.constructor=m}f(m,v),m.prototype=v===null?Object.create(v):(p.prototype=v.prototype,new p)}),h=this&&this.__decorate||function(m,v,p,w){var E,b=arguments.length,y=b<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(m,v,p,w);else for(var C=m.length-1;C>=0;C--)(E=m[C])&&(y=(b<3?E(y):b>3?E(v,p,y):E(v,p))||y);return b>3&&y&&Object.defineProperty(v,p,y),y},u=this&&this.__param||function(m,v){return function(p,w){v(p,w,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;var _=L(11),d=L(52),o=L(4),n=L(0),a=L(5),t=L(1),i=L(30),e=L(53),r=L(2),s=String.fromCharCode(160),l=new RegExp(s,"g"),g=function(m){function v(p,w,E,b,y,C,T){var x=m.call(this)||this;return x._element=p,x._screenElement=w,x._bufferService=E,x._coreService=b,x._mouseService=y,x._optionsService=C,x._renderService=T,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(O){return x._onMouseMove(O)},x._mouseUpListener=function(O){return x._onMouseUp(O)},x._coreService.onUserInput(function(){x.hasSelection&&x.clearSelection()}),x._trimListener=x._bufferService.buffer.lines.onTrim(function(O){return x._onTrim(O)}),x.register(x._bufferService.buffers.onBufferActivate(function(O){return x._onBufferActivate(O)})),x.enable(),x._model=new d.SelectionModel(x._bufferService),x._activeSelectionMode=0,x}return S(v,m),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,w=this._model.finalSelectionEnd;return!(!p||!w)&&(p[0]!==w[0]||p[1]!==w[1])},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"selectionText",{get:function(){var p=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;if(!p||!w)return"";var E=this._bufferService.buffer,b=[];if(this._activeSelectionMode===3){if(p[0]===w[0])return"";for(var y=p[1];y<=w[1];y++){var C=E.translateBufferLineToString(y,!0,p[0],w[0]);b.push(C)}}else{var T=p[1]===w[1]?w[0]:void 0;for(b.push(E.translateBufferLineToString(p[1],!0,p[0],T)),y=p[1]+1;y<=w[1]-1;y++){var x=E.lines.get(y);C=E.translateBufferLineToString(y,!0),x&&x.isWrapped?b[b.length-1]+=C:b.push(C)}p[1]!==w[1]&&(x=E.lines.get(w[1]),C=E.translateBufferLineToString(w[1],!0,0,w[0]),x&&x.isWrapped?b[b.length-1]+=C:b.push(C))}return b.map(function(O){return O.replace(l," ")}).join(_.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 w=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return w._refresh()})),_.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 w=this._getMouseBufferCoords(p),E=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!!(E&&b&&w)&&this._areCoordsInSelection(w,E,b)},v.prototype._areCoordsInSelection=function(p,w,E){return p[1]>w[1]&&p[1]<E[1]||w[1]===E[1]&&p[1]===w[1]&&p[0]>=w[0]&&p[0]<E[0]||w[1]<E[1]&&p[1]===E[1]&&p[0]<E[0]||w[1]<E[1]&&p[1]===w[1]&&p[0]>=w[0]},v.prototype.selectWordAtCursor=function(p){var w=this._getMouseBufferCoords(p);w&&(this._selectWordAt(w,!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,w){this._model.clearSelection(),p=Math.max(p,0),w=Math.min(w,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,p],this._model.selectionEnd=[this._bufferService.cols,w],this.refresh(),this._onSelectionChange.fire()},v.prototype._onTrim=function(p){this._model.onTrim(p)&&this.refresh()},v.prototype._getMouseBufferCoords=function(p){var w=this._mouseService.getCoords(p,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(w)return w[0]--,w[1]--,w[1]+=this._bufferService.buffer.ydisp,w},v.prototype._getMouseEventScrollAmount=function(p){var w=i.getCoordsRelativeToElement(p,this._screenElement)[1],E=this._renderService.dimensions.canvasHeight;return w>=0&&w<=E?0:(w>E&&(w-=E),w=Math.min(Math.max(w,-50),50),(w/=50)/Math.abs(w)+Math.round(14*w))},v.prototype.shouldForceSelection=function(p){return _.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 w=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);w&&w.length!==this._model.selectionStart[0]&&w.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},v.prototype._onDoubleClick=function(p){var w=this._getMouseBufferCoords(p);w&&(this._activeSelectionMode=1,this._selectWordAt(w,!0))},v.prototype._onTripleClick=function(p){var w=this._getMouseBufferCoords(p);w&&(this._activeSelectionMode=2,this._selectLineAt(w[1]))},v.prototype.shouldColumnSelect=function(p){return p.altKey&&!(_.isMac&&this._optionsService.options.macOptionClickForcesSelection)},v.prototype._onMouseMove=function(p){if(p.stopImmediatePropagation(),this._model.selectionStart){var w=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 E=this._bufferService.buffer;if(this._model.selectionEnd[1]<E.lines.length){var b=E.lines.get(this._model.selectionEnd[1]);b&&b.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}w&&w[0]===this._model.selectionEnd[0]&&w[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 w=p.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&w<500&&p.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var E=this._mouseService.getCoords(p,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(E&&E[0]!==void 0&&E[1]!==void 0){var b=e.moveToCellSequence(E[0]-1,E[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 w=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=p.activeBuffer.lines.onTrim(function(E){return w._onTrim(E)})},v.prototype._convertViewportColToCharacterIndex=function(p,w){for(var E=w[0],b=0;w[0]>=b;b++){var y=p.loadCell(b,this._workCell).getChars().length;this._workCell.getWidth()===0?E--:y>1&&w[0]!==b&&(E+=y-1)}return E},v.prototype.setSelection=function(p,w,E){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[p,w],this._model.selectionStartLength=E,this.refresh()},v.prototype._getWordAt=function(p,w,E,b){if(E===void 0&&(E=!0),b===void 0&&(b=!0),!(p[0]>=this._bufferService.cols)){var y=this._bufferService.buffer,C=y.lines.get(p[1]);if(C){var T=y.translateBufferLineToString(p[1],!1),x=this._convertViewportColToCharacterIndex(C,p),O=x,P=p[0]-x,M=0,B=0,W=0,A=0;if(T.charAt(x)===" "){for(;x>0&&T.charAt(x-1)===" ";)x--;for(;O<T.length&&T.charAt(O+1)===" ";)O++}else{var k=p[0],R=p[0];C.getWidth(k)===0&&(M++,k--),C.getWidth(R)===2&&(B++,R++);var I=C.getString(R).length;for(I>1&&(A+=I-1,O+=I-1);k>0&&x>0&&!this._isCharWordSeparator(C.loadCell(k-1,this._workCell));){C.loadCell(k-1,this._workCell);var D=this._workCell.getChars().length;this._workCell.getWidth()===0?(M++,k--):D>1&&(W+=D-1,x-=D-1),x--,k--}for(;R<C.length&&O+1<T.length&&!this._isCharWordSeparator(C.loadCell(R+1,this._workCell));){C.loadCell(R+1,this._workCell);var F=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,R++):F>1&&(A+=F-1,O+=F-1),O++,R++}}O++;var U=x+P-M+W,K=Math.min(this._bufferService.cols,O-x+M+B-W-A);if(w||T.slice(x,O).trim()!==""){if(E&&U===0&&C.getCodePoint(0)!==32){var V=y.lines.get(p[1]-1);if(V&&C.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){var X=this._getWordAt([this._bufferService.cols-1,p[1]-1],!1,!0,!1);if(X){var j=this._bufferService.cols-X.start;U-=j,K+=j}}}if(b&&U+K===this._bufferService.cols&&C.getCodePoint(this._bufferService.cols-1)!==32){var N=y.lines.get(p[1]+1);if(N&&N.isWrapped&&N.getCodePoint(0)!==32){var z=this._getWordAt([0,p[1]+1],!1,!1,!0);z&&(K+=z.length)}}return{start:U,length:K}}}}},v.prototype._selectWordAt=function(p,w){var E=this._getWordAt(p,w);if(E){for(;E.start<0;)E.start+=this._bufferService.cols,p[1]--;this._model.selectionStart=[E.start,p[1]],this._model.selectionStartLength=E.length}},v.prototype._selectToWordAt=function(p){var w=this._getWordAt(p,!0);if(w){for(var E=p[1];w.start<0;)w.start+=this._bufferService.cols,E--;if(!this._model.areSelectionValuesReversed())for(;w.start+w.length>this._bufferService.cols;)w.length-=this._bufferService.cols,E++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?w.start:w.start+w.length,E]}},v.prototype._isCharWordSeparator=function(p){return p.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(p.getChars())>=0},v.prototype._selectLineAt=function(p){var w=this._bufferService.buffer.getWrappedRangeForLine(p);this._model.selectionStart=[0,w.first],this._model.selectionEnd=[this._bufferService.cols,w.last],this._model.selectionStartLength=0},v=h([u(2,t.IBufferService),u(3,t.ICoreService),u(4,a.IMouseService),u(5,t.IOptionsService),u(6,a.IRenderService)],v)}(r.Disposable);c.SelectionService=g},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0;var f=function(){function S(h){this._bufferService=h,this.isSelectAllActive=!1,this.selectionStartLength=0}return S.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(S.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(S.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 h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[h,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}),S.prototype.areSelectionValuesReversed=function(){var h=this.selectionStart,u=this.selectionEnd;return!(!h||!u)&&(h[1]>u[1]||h[1]===u[1]&&h[0]>u[0])},S.prototype.onTrim=function(h){return this.selectionStart&&(this.selectionStart[1]-=h),this.selectionEnd&&(this.selectionEnd[1]-=h),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},S}();c.SelectionModel=f},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;var f=L(12);function S(n,a,t,i){var e=n-h(t,n),r=a-h(t,a);return o(Math.abs(e-r)-function(s,l,g){for(var m=0,v=s-h(g,s),p=l-h(g,l),w=0;w<Math.abs(v-p);w++){var E=u(s,l)==="A"?-1:1,b=g.buffer.lines.get(v+E*w);b&&b.isWrapped&&m++}return m}(n,a,t),d(u(n,a),i))}function h(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 u(n,a){return n>a?"A":"B"}function _(n,a,t,i,e,r){for(var s=n,l=a,g="";s!==t||l!==i;)s+=e?1:-1,e&&s>r.cols-1?(g+=r.buffer.translateBufferLineToString(l,!1,n,s),s=0,n=0,l++):!e&&s<0&&(g+=r.buffer.translateBufferLineToString(l,!1,0,n+1),n=s=r.cols-1,l--);return g+r.buffer.translateBufferLineToString(l,!1,n,s)}function d(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(g,m,v,p,w,E){return S(m,p,w,E).length===0?"":o(_(g,m,g,m-h(w,m),!1,w).length,d("D",E))}(r,s,0,a,t,i)+S(s,a,t,i)+function(g,m,v,p,w,E){var b;b=S(m,p,w,E).length>0?p-h(w,p):m;var y=p,C=function(T,x,O,P,M,B){var W;return W=S(O,P,M,B).length>0?P-h(M,P):x,T<O&&W<=P||T>=O&&W<P?"C":"D"}(g,m,v,p,w,E);return o(_(g,b,v,y,C==="C",w).length,d(C,E))}(r,s,n,a,t,i);if(s===a)return e=r>n?"D":"C",o(Math.abs(r-n),d(e,i));e=s>a?"D":"C";var l=Math.abs(s-a);return o(function(g,m){return m.cols-g}(s>a?n:r,t)+(l-1)*t.cols+1+((s>a?r:n)-1),d(e,i))}},function(H,c,L){"use strict";var f=this&&this.__decorate||function(_,d,o,n){var a,t=arguments.length,i=t<3?d:n===null?n=Object.getOwnPropertyDescriptor(d,o):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(_,d,o,n);else for(var e=_.length-1;e>=0;e--)(a=_[e])&&(i=(t<3?a(i):t>3?a(d,o,i):a(d,o))||i);return t>3&&i&&Object.defineProperty(d,o,i),i},S=this&&this.__param||function(_,d){return function(o,n){d(o,n,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SoundService=void 0;var h=L(1),u=function(){function _(d){this._optionsService=d}return Object.defineProperty(_,"audioContext",{get:function(){if(!_._audioContext){var d=window.AudioContext||window.webkitAudioContext;if(!d)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;_._audioContext=new d}return _._audioContext},enumerable:!1,configurable:!0}),_.prototype.playBellSound=function(){var d=_.audioContext;if(d){var o=d.createBufferSource();d.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(n){o.buffer=n,o.connect(d.destination),o.start(0)})}},_.prototype._base64ToArrayBuffer=function(d){for(var o=window.atob(d),n=o.length,a=new Uint8Array(n),t=0;t<n;t++)a[t]=o.charCodeAt(t);return a.buffer},_.prototype._removeMimeType=function(d){return d.split(",")[1]},_=f([S(0,h.IOptionsService)],_)}();c.SoundService=u},function(H,c,L){"use strict";var f,S=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)}),h=this&&this.__decorate||function(t,i,e,r){var s,l=arguments.length,g=l<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(t,i,e,r);else for(var m=t.length-1;m>=0;m--)(s=t[m])&&(g=(l<3?s(g):l>3?s(i,e,g):s(i,e))||g);return l>3&&g&&Object.defineProperty(i,e,g),g},u=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 _=L(2),d=L(7),o=L(5),n=L(1),a=function(t){function i(e,r,s,l,g,m){var v=t.call(this)||this;return v._element=e,v._screenElement=r,v._bufferService=s,v._mouseService=l,v._selectionService=g,v._optionsService=m,v._zones=[],v._areZonesActive=!1,v._lastHoverCoords=[void 0,void 0],v._initialSelectionLength=0,v.register(d.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 S(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 l=this._zones[s];(l.y1>e&&l.y1<=r+1||l.y2>e&&l.y2<=r+1||l.y1<e&&l.y2>r+1)&&(this._currentZone&&this._currentZone===l&&(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],l=r[1],g=0;g<this._zones.length;g++){var m=this._zones[g];if(m.y1===m.y2){if(l===m.y1&&s>=m.x1&&s<m.x2)return m}else if(l===m.y1&&s>=m.x1||l===m.y2&&s<m.x2||l>m.y1&&l<m.y2)return m}},i=h([u(2,n.IBufferService),u(3,o.IMouseService),u(4,o.ISelectionService),u(5,n.IOptionsService)],i)}(_.Disposable);c.MouseZoneManager=a},function(H,c,L){"use strict";var f,S=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 l in s)s.hasOwnProperty(l)&&(r[l]=s[l])})(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 h=L(18),u=L(11),_=L(31),d=L(7),o=L(2),n=L(32),a=L(17),t=function(i){function e(r,s){var l=i.call(this)||this;l._terminal=r,l._renderService=s,l._liveRegionLineCount=0,l._charsToConsume=[],l._charsToAnnounce="",l._accessibilityTreeRoot=document.createElement("div"),l._accessibilityTreeRoot.classList.add("xterm-accessibility"),l._rowContainer=document.createElement("div"),l._rowContainer.classList.add("xterm-accessibility-tree"),l._rowContainer.setAttribute("role","list"),l._rowElements=[];for(var g=0;g<l._terminal.rows;g++)l._rowElements[g]=l._createAccessibilityTreeNode(),l._rowContainer.appendChild(l._rowElements[g]);if(l._topBoundaryFocusListener=function(m){return l._onBoundaryFocus(m,0)},l._bottomBoundaryFocusListener=function(m){return l._onBoundaryFocus(m,1)},l._rowElements[0].addEventListener("focus",l._topBoundaryFocusListener),l._rowElements[l._rowElements.length-1].addEventListener("focus",l._bottomBoundaryFocusListener),l._refreshRowsDimensions(),l._accessibilityTreeRoot.appendChild(l._rowContainer),l._renderRowsDebouncer=new _.RenderDebouncer(l._renderRows.bind(l)),l._refreshRows(),l._liveRegion=document.createElement("div"),l._liveRegion.classList.add("live-region"),l._liveRegion.setAttribute("aria-live","assertive"),l._accessibilityTreeRoot.appendChild(l._liveRegion),!l._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return l._terminal.element.insertAdjacentElement("afterbegin",l._accessibilityTreeRoot),l.register(l._renderRowsDebouncer),l.register(l._terminal.onResize(function(m){return l._onResize(m.rows)})),l.register(l._terminal.onRender(function(m){return l._refreshRows(m.start,m.end)})),l.register(l._terminal.onScroll(function(){return l._refreshRows()})),l.register(l._terminal.onA11yChar(function(m){return l._onChar(m)})),l.register(l._terminal.onLineFeed(function(){return l._onChar(`
`)})),l.register(l._terminal.onA11yTab(function(m){return l._onTab(m)})),l.register(l._terminal.onKey(function(m){return l._onKey(m.key)})),l.register(l._terminal.onBlur(function(){return l._clearLiveRegion()})),l.register(l._renderService.onDimensionsChange(function(){return l._refreshRowsDimensions()})),l._screenDprMonitor=new n.ScreenDprMonitor,l.register(l._screenDprMonitor),l._screenDprMonitor.setListener(function(){return l._refreshRowsDimensions()}),l.register(d.addDisposableDomListener(window,"resize",function(){return l._refreshRowsDimensions()})),l}return S(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 l=r.target,g=this._rowElements[s===0?1:this._rowElements.length-2];if(l.getAttribute("aria-posinset")!==(s===0?"1":""+this._terminal.buffer.lines.length)&&r.relatedTarget===g){var m,v;if(s===0?(m=l,v=this._rowElements.pop(),this._rowContainer.removeChild(v)):(m=this._rowElements.shift(),v=l,this._rowContainer.removeChild(m)),m.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+=h.tooMuchOutput)),u.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,u.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 l=this._terminal.buffer,g=l.lines.length.toString(),m=r;m<=s;m++){var v=l.translateBufferLineToString(l.ydisp+m,!0),p=(l.ydisp+m+1).toString(),w=this._rowElements[m];w&&(v.length===0?w.innerHTML="&nbsp;":w.textContent=v,w.setAttribute("aria-posinset",p),w.setAttribute("aria-setsize",g))}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(H,c,L){"use strict";var f,S=this&&this.__extends||(f=function(l,g){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,v){m.__proto__=v}||function(m,v){for(var p in v)v.hasOwnProperty(p)&&(m[p]=v[p])})(l,g)},function(l,g){function m(){this.constructor=l}f(l,g),l.prototype=g===null?Object.create(g):(m.prototype=g.prototype,new m)}),h=this&&this.__decorate||function(l,g,m,v){var p,w=arguments.length,E=w<3?g:v===null?v=Object.getOwnPropertyDescriptor(g,m):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,g,m,v);else for(var b=l.length-1;b>=0;b--)(p=l[b])&&(E=(w<3?p(E):w>3?p(g,m,E):p(g,m))||E);return w>3&&E&&Object.defineProperty(g,m,E),E},u=this&&this.__param||function(l,g){return function(m,v){g(m,v,l)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;var _=L(58),d=L(9),o=L(2),n=L(5),a=L(1),t=L(0),i=L(10),e=L(17),r=1,s=function(l){function g(m,v,p,w,E,b,y,C,T){var x=l.call(this)||this;return x._colors=m,x._element=v,x._screenElement=p,x._viewportElement=w,x._linkifier=E,x._linkifier2=b,x._charSizeService=y,x._optionsService=C,x._bufferService=T,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 _.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(O){return x._onLinkHover(O)}),x._linkifier.onHideLinkUnderline(function(O){return x._onLinkLeave(O)}),x._linkifier2.onShowLinkUnderline(function(O){return x._onLinkHover(O)}),x._linkifier2.onHideLinkUnderline(function(O){return x._onLinkLeave(O)}),x}return S(g,l),Object.defineProperty(g.prototype,"onRequestRedraw",{get:function(){return new t.EventEmitter().event},enumerable:!1,configurable:!0}),g.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),e.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),l.prototype.dispose.call(this)},g.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 m=0,v=this._rowElements;m<v.length;m++){var p=v[m];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 w=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=w,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},g.prototype.setColors=function(m){this._colors=m,this._injectCss()},g.prototype._injectCss=function(){var m=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(."+_.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+_.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+_.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) ."+_.CURSOR_CLASS+"."+_.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+_.CURSOR_CLASS+"."+_.CURSOR_BLINK_CLASS+":not(."+_.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+_.CURSOR_CLASS+"."+_.CURSOR_BLINK_CLASS+"."+_.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+_.CURSOR_CLASS+"."+_.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+_.CURSOR_CLASS+"."+_.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+_.CURSOR_CLASS+"."+_.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,w){v+=m._terminalSelector+" .xterm-fg-"+w+" { color: "+p.css+"; }"+m._terminalSelector+" .xterm-bg-"+w+" { background-color: "+p.css+"; }"}),v+=this._terminalSelector+" .xterm-fg-"+d.INVERTED_DEFAULT_COLOR+" { color: "+i.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+d.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=v},g.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},g.prototype._refreshRowElements=function(m,v){for(var p=this._rowElements.length;p<=v;p++){var w=document.createElement("div");this._rowContainer.appendChild(w),this._rowElements.push(w)}for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop())},g.prototype.onResize=function(m,v){this._refreshRowElements(m,v),this._updateDimensions()},g.prototype.onCharSizeChanged=function(){this._updateDimensions()},g.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},g.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},g.prototype.onSelectionChanged=function(m,v,p){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(m&&v){var w=m[1]-this._bufferService.buffer.ydisp,E=v[1]-this._bufferService.buffer.ydisp,b=Math.max(w,0),y=Math.min(E,this._bufferService.rows-1);if(!(b>=this._bufferService.rows||y<0)){var C=document.createDocumentFragment();if(p)C.appendChild(this._createSelectionElement(b,m[0],v[0],y-b+1));else{var T=w===b?m[0]:0,x=b===y?v[0]:this._bufferService.cols;C.appendChild(this._createSelectionElement(b,T,x));var O=y-b-1;if(C.appendChild(this._createSelectionElement(b+1,0,this._bufferService.cols,O)),b!==y){var P=E===y?v[0]:this._bufferService.cols;C.appendChild(this._createSelectionElement(y,0,P))}}this._selectionContainer.appendChild(C)}}},g.prototype._createSelectionElement=function(m,v,p,w){w===void 0&&(w=1);var E=document.createElement("div");return E.style.height=w*this.dimensions.actualCellHeight+"px",E.style.top=m*this.dimensions.actualCellHeight+"px",E.style.left=v*this.dimensions.actualCellWidth+"px",E.style.width=this.dimensions.actualCellWidth*(p-v)+"px",E},g.prototype.onCursorMove=function(){},g.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},g.prototype.clear=function(){for(var m=0,v=this._rowElements;m<v.length;m++)v[m].innerHTML=""},g.prototype.renderRows=function(m,v){for(var p=this._bufferService.buffer.ybase+this._bufferService.buffer.y,w=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),E=this._optionsService.options.cursorBlink,b=m;b<=v;b++){var y=this._rowElements[b];y.innerHTML="";var C=b+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.lines.get(C),x=this._optionsService.options.cursorStyle;y.appendChild(this._rowFactory.createRow(T,C===p,x,w,E,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(g.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),g.prototype.registerCharacterJoiner=function(m){return-1},g.prototype.deregisterCharacterJoiner=function(m){return!1},g.prototype._onLinkHover=function(m){this._setCellUnderline(m.x1,m.x2,m.y1,m.y2,m.cols,!0)},g.prototype._onLinkLeave=function(m){this._setCellUnderline(m.x1,m.x2,m.y1,m.y2,m.cols,!1)},g.prototype._setCellUnderline=function(m,v,p,w,E,b){for(;m!==v||p!==w;){var y=this._rowElements[p];if(!y)return;var C=y.children[m];C&&(C.style.textDecoration=b?"underline":"none"),++m>=E&&(m=0,p++)}},g=h([u(6,n.ICharSizeService),u(7,a.IOptionsService),u(8,a.IBufferService)],g)}(o.Disposable);c.DomRenderer=s},function(H,c,L){"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=L(9),S=L(3),h=L(4),u=L(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 _=function(){function o(n,a,t){this._document=n,this._optionsService=a,this._colors=t,this._workCell=new h.CellData}return o.prototype.setColors=function(n){this._colors=n},o.prototype.createRow=function(n,a,t,i,e,r,s){for(var l=this._document.createDocumentFragment(),g=0,m=Math.min(n.length,s)-1;m>=0;m--)if(n.loadCell(m,this._workCell).getCode()!==S.NULL_CELL_CODE||a&&m===i){g=m+1;break}for(m=0;m<g;m++){n.loadCell(m,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&&m===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=S.WHITESPACE_CELL_CHAR:p.textContent=this._workCell.getChars()||S.WHITESPACE_CELL_CHAR;var w=this._workCell.getFgColor(),E=this._workCell.getFgColorMode(),b=this._workCell.getBgColor(),y=this._workCell.getBgColorMode(),C=!!this._workCell.isInverse();if(C){var T=w;w=b,b=T;var x=E;E=y,y=x}switch(E){case 16777216:case 33554432:this._workCell.isBold()&&w<8&&this._optionsService.options.drawBoldTextInBrightColors&&(w+=8),this._applyMinimumContrast(p,this._colors.background,this._colors.ansi[w])||p.classList.add("xterm-fg-"+w);break;case 50331648:var O=u.rgba.toColor(w>>16&255,w>>8&255,255&w);this._applyMinimumContrast(p,this._colors.background,O)||this._addStyle(p,"color:#"+d(w.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(y){case 16777216:case 33554432:p.classList.add("xterm-bg-"+b);break;case 50331648:this._addStyle(p,"background-color:#"+d(b.toString(16),"0",6));break;case 0:default:C&&p.classList.add("xterm-bg-"+f.INVERTED_DEFAULT_COLOR)}l.appendChild(p)}}return l},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=u.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 d(o,n,a){for(;o.length<a;)o=n+o;return o}c.DomRendererRowFactory=_},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;var f=L(12),S={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(h,u,_,d){var o={type:0,cancel:!1,key:void 0},n=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?o.key=u?f.C0.ESC+"OA":f.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?o.key=u?f.C0.ESC+"OD":f.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?o.key=u?f.C0.ESC+"OC":f.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(o.key=u?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:if(h.shiftKey){o.key=f.C0.BS;break}if(h.altKey){o.key=f.C0.ESC+f.C0.DEL;break}o.key=f.C0.DEL;break;case 9:if(h.shiftKey){o.key=f.C0.ESC+"[Z";break}o.key=f.C0.HT,o.cancel=!0;break;case 13:o.key=h.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,o.cancel=!0;break;case 27:o.key=f.C0.ESC,h.altKey&&(o.key=f.C0.ESC+f.C0.ESC),o.cancel=!0;break;case 37:if(h.metaKey)break;n?(o.key=f.C0.ESC+"[1;"+(n+1)+"D",o.key===f.C0.ESC+"[1;3D"&&(o.key=f.C0.ESC+(_?"b":"[1;5D"))):o.key=u?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(h.metaKey)break;n?(o.key=f.C0.ESC+"[1;"+(n+1)+"C",o.key===f.C0.ESC+"[1;3C"&&(o.key=f.C0.ESC+(_?"f":"[1;5C"))):o.key=u?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(h.metaKey)break;n?(o.key=f.C0.ESC+"[1;"+(n+1)+"A",_||o.key!==f.C0.ESC+"[1;3A"||(o.key=f.C0.ESC+"[1;5A")):o.key=u?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(h.metaKey)break;n?(o.key=f.C0.ESC+"[1;"+(n+1)+"B",_||o.key!==f.C0.ESC+"[1;3B"||(o.key=f.C0.ESC+"[1;5B")):o.key=u?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:h.shiftKey||h.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":u?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:o.key=n?f.C0.ESC+"[1;"+(n+1)+"F":u?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:h.shiftKey?o.type=2:o.key=f.C0.ESC+"[5~";break;case 34:h.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(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(_&&!d||!h.altKey||h.metaKey)_&&!h.altKey&&!h.ctrlKey&&h.metaKey?h.keyCode===65&&(o.type=1):h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?o.key=h.key:h.key&&h.ctrlKey&&h.key==="_"&&(o.key=f.C0.US);else{var a=S[h.keyCode],t=a&&a[h.shiftKey?1:0];if(t)o.key=f.C0.ESC+t;else if(h.keyCode>=65&&h.keyCode<=90){var i=h.ctrlKey?h.keyCode-64:h.keyCode+32;o.key=f.C0.ESC+String.fromCharCode(i)}}else h.keyCode>=65&&h.keyCode<=90?o.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?o.key=f.C0.NUL:h.keyCode>=51&&h.keyCode<=55?o.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?o.key=f.C0.DEL:h.keyCode===219?o.key=f.C0.ESC:h.keyCode===220?o.key=f.C0.FS:h.keyCode===221&&(o.key=f.C0.GS)}return o}},function(H,c,L){"use strict";var f,S=this&&this.__extends||(f=function(r,s){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,g){l.__proto__=g}||function(l,g){for(var m in g)g.hasOwnProperty(m)&&(l[m]=g[m])})(r,s)},function(r,s){function l(){this.constructor=r}f(r,s),r.prototype=s===null?Object.create(s):(l.prototype=s.prototype,new l)}),h=this&&this.__decorate||function(r,s,l,g){var m,v=arguments.length,p=v<3?s:g===null?g=Object.getOwnPropertyDescriptor(s,l):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(r,s,l,g);else for(var w=r.length-1;w>=0;w--)(m=r[w])&&(p=(v<3?m(p):v>3?m(s,l,p):m(s,l))||p);return v>3&&p&&Object.defineProperty(s,l,p),p},u=this&&this.__param||function(r,s){return function(l,g){s(l,g,r)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;var _=L(31),d=L(0),o=L(2),n=L(32),a=L(7),t=L(1),i=L(5),e=function(r){function s(l,g,m,v,p,w){var E=r.call(this)||this;if(E._renderer=l,E._rowCount=g,E._isPaused=!1,E._needsFullRefresh=!1,E._isNextRenderRedrawOnly=!0,E._needsSelectionRefresh=!1,E._canvasWidth=0,E._canvasHeight=0,E._selectionState={start:void 0,end:void 0,columnSelectMode:!1},E._onDimensionsChange=new d.EventEmitter,E._onRender=new d.EventEmitter,E._onRefreshRequest=new d.EventEmitter,E.register({dispose:function(){return E._renderer.dispose()}}),E._renderDebouncer=new _.RenderDebouncer(function(y,C){return E._renderRows(y,C)}),E.register(E._renderDebouncer),E._screenDprMonitor=new n.ScreenDprMonitor,E._screenDprMonitor.setListener(function(){return E.onDevicePixelRatioChange()}),E.register(E._screenDprMonitor),E.register(w.onResize(function(y){return E._fullRefresh()})),E.register(v.onOptionChange(function(){return E._renderer.onOptionsChanged()})),E.register(p.onCharSizeChange(function(){return E.onCharSizeChanged()})),E._renderer.onRequestRedraw(function(y){return E.refreshRows(y.start,y.end,!0)}),E.register(a.addDisposableDomListener(window,"resize",function(){return E.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var b=new IntersectionObserver(function(y){return E._onIntersectionChange(y[y.length-1])},{threshold:0});b.observe(m),E.register({dispose:function(){return b.disconnect()}})}return E}return S(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(l){this._isPaused=l.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},s.prototype.refreshRows=function(l,g,m){m===void 0&&(m=!1),this._isPaused?this._needsFullRefresh=!0:(m||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(l,g,this._rowCount))},s.prototype._renderRows=function(l,g){this._renderer.renderRows(l,g),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:l,end:g}),this._isNextRenderRedrawOnly=!0},s.prototype.resize=function(l,g){this._rowCount=g,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(l){var g=this;this._renderer.dispose(),this._renderer=l,this._renderer.onRequestRedraw(function(m){return g.refreshRows(m.start,m.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(l){this._renderer.setColors(l),this._fullRefresh()},s.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},s.prototype.onResize=function(l,g){this._renderer.onResize(l,g),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(l,g,m){this._selectionState.start=l,this._selectionState.end=g,this._selectionState.columnSelectMode=m,this._renderer.onSelectionChanged(l,g,m)},s.prototype.onCursorMove=function(){this._renderer.onCursorMove()},s.prototype.clear=function(){this._renderer.clear()},s.prototype.registerCharacterJoiner=function(l){return this._renderer.registerCharacterJoiner(l)},s.prototype.deregisterCharacterJoiner=function(l){return this._renderer.deregisterCharacterJoiner(l)},s=h([u(3,t.IOptionsService),u(4,i.ICharSizeService),u(5,t.IBufferService)],s)}(o.Disposable);c.RenderService=e},function(H,c,L){"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},S=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 h=L(1),u=L(0),_=function(){function o(n,a,t){this._optionsService=t,this.width=0,this.height=0,this._onCharSizeChange=new u.EventEmitter,this._measureStrategy=new d(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([S(2,h.IOptionsService)],o)}();c.CharSizeService=_;var d=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(H,c,L){"use strict";var f=this&&this.__decorate||function(d,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(d,o,n,a);else for(var r=d.length-1;r>=0;r--)(t=d[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},S=this&&this.__param||function(d,o){return function(n,a){o(n,a,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;var h=L(5),u=L(30),_=function(){function d(o,n){this._renderService=o,this._charSizeService=n}return d.prototype.getCoords=function(o,n,a,t,i){return u.getCoords(o,n,a,t,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,i)},d.prototype.getRawByteCoords=function(o,n,a,t){var i=this.getCoords(o,n,a,t);return u.getRawByteCoords(i)},d=f([S(0,h.IRenderService),S(1,h.ICharSizeService)],d)}();c.MouseService=_},function(H,c,L){"use strict";var f,S=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)}),h=this&&this.__decorate||function(t,i,e,r){var s,l=arguments.length,g=l<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(t,i,e,r);else for(var m=t.length-1;m>=0;m--)(s=t[m])&&(g=(l<3?s(g):l>3?s(i,e,g):s(i,e))||g);return l>3&&g&&Object.defineProperty(i,e,g),g},u=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 _=L(1),d=L(0),o=L(2),n=L(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 d.EventEmitter),r._onHideLinkUnderline=r.register(new d.EventEmitter),r.register(o.getDisposeArrayDisposable(r._linkCacheDisposables)),r}return S(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 l=this;this._element=e,this._mouseService=r,this._renderService=s,this.register(n.addDisposableDomListener(this._element,"mouseleave",function(){l._isMouseOut=!0,l._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(),l=0;l<s.length;l++){var g=s[l];if(g.classList.contains("xterm"))break;if(g.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 l=!1;this._linkProviders.forEach(function(g,m){var v;r?((v=s._activeProviderReplies)===null||v===void 0?void 0:v.get(m))&&(l=s._checkLinkProviderResult(m,e,l)):g.provideLinks(e.y,function(p){var w,E;if(!s._isMouseOut){var b=p==null?void 0:p.map(function(y){return{link:y}});(w=s._activeProviderReplies)===null||w===void 0||w.set(m,b),l=s._checkLinkProviderResult(m,e,l),((E=s._activeProviderReplies)===null||E===void 0?void 0:E.size)===s._linkProviders.length&&s._removeIntersectingLinks(e.y,s._activeProviderReplies)}})})},i.prototype._removeIntersectingLinks=function(e,r){for(var s=new Set,l=0;l<r.size;l++){var g=r.get(l);if(g)for(var m=0;m<g.length;m++)for(var v=g[m],p=v.link.range.start.y<e?0:v.link.range.start.x,w=v.link.range.end.y>e?this._bufferService.cols:v.link.range.end.x,E=p;E<=w;E++){if(s.has(E)){g.splice(m--,1);break}s.add(E)}}},i.prototype._checkLinkProviderResult=function(e,r,s){var l,g=this;if(!this._activeProviderReplies)return s;for(var m=this._activeProviderReplies.get(e),v=!1,p=0;p<e;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(v=!0);if(!v&&m){var w=m.find(function(b){return g._linkAtPosition(b.link,r)});w&&(s=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviders.length&&!s)for(p=0;p<this._activeProviderReplies.size;p++){var E=(l=this._activeProviderReplies.get(p))===null||l===void 0?void 0:l.find(function(b){return g._linkAtPosition(b.link,r)});if(E){s=!0,this._handleNewLink(E);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 l,g;return(g=(l=r._currentLink)===null||l===void 0?void 0:l.state)===null||g===void 0?void 0:g.decorations.pointerCursor},set:function(l){var g,m;((g=r._currentLink)===null||g===void 0?void 0:g.state)&&r._currentLink.state.decorations.pointerCursor!==l&&(r._currentLink.state.decorations.pointerCursor=l,r._currentLink.state.isHovered&&((m=r._element)===null||m===void 0||m.classList.toggle("xterm-cursor-pointer",l)))}},underline:{get:function(){var l,g;return(g=(l=r._currentLink)===null||l===void 0?void 0:l.state)===null||g===void 0?void 0:g.decorations.underline},set:function(l){var g,m,v;((g=r._currentLink)===null||g===void 0?void 0:g.state)&&((v=(m=r._currentLink)===null||m===void 0?void 0:m.state)===null||v===void 0?void 0:v.decorations.underline)!==l&&(r._currentLink.state.decorations.underline=l,r._currentLink.state.isHovered&&r._fireUnderlineEvent(e.link,l))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(l){var g=l.start===0?0:l.start+1+r._bufferService.buffer.ydisp;r._clearCurrentLink(g,l.end+1+r._bufferService.buffer.ydisp)})))}},i.prototype._linkHover=function(e,r,s){var l;((l=this._currentLink)===null||l===void 0?void 0:l.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,l=this._bufferService.buffer.ydisp,g=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-l-1,s.end.x,s.end.y-l-1,void 0);(r?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(g)},i.prototype._linkLeave=function(e,r,s){var l;((l=this._currentLink)===null||l===void 0?void 0:l.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,l=e.range.start.y<r.y,g=e.range.end.y>r.y;return(s&&e.range.start.x<=r.x&&e.range.end.x>=r.x||l&&e.range.end.x>=r.x||g&&e.range.start.x<=r.x||l&&g)&&e.range.start.y<=r.y&&e.range.end.y>=r.y},i.prototype._positionFromMouseEvent=function(e,r,s){var l=s.getCoords(e,r,this._bufferService.cols,this._bufferService.rows);if(l)return{x:l[0],y:l[1]+this._bufferService.buffer.ydisp}},i.prototype._createLinkUnderlineEvent=function(e,r,s,l,g){return{x1:e,y1:r,x2:s,y2:l,cols:this._bufferService.cols,fg:g}},i=h([u(0,_.IBufferService)],i)}(o.Disposable);c.Linkifier2=a},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;var f=function(){function S(h){this._textarea=h}return Object.defineProperty(S.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),S}();c.CoreBrowserService=f},function(H,c,L){"use strict";var f,S=this&&this.__extends||(f=function(p,w){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,b){E.__proto__=b}||function(E,b){for(var y in b)b.hasOwnProperty(y)&&(E[y]=b[y])})(p,w)},function(p,w){function E(){this.constructor=p}f(p,w),p.prototype=w===null?Object.create(w):(E.prototype=w.prototype,new E)});Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;var h=L(2),u=L(1),_=L(66),d=L(67),o=L(68),n=L(74),a=L(75),t=L(0),i=L(76),e=L(77),r=L(78),s=L(80),l=L(81),g=L(19),m=L(82),v=function(p){function w(E){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 _.InstantiationService,b.optionsService=new n.OptionsService(E),b._instantiationService.setService(u.IOptionsService,b.optionsService),b._bufferService=b.register(b._instantiationService.createInstance(o.BufferService)),b._instantiationService.setService(u.IBufferService,b._bufferService),b._logService=b._instantiationService.createInstance(d.LogService),b._instantiationService.setService(u.ILogService,b._logService),b._coreService=b.register(b._instantiationService.createInstance(a.CoreService,function(){return b.scrollToBottom()})),b._instantiationService.setService(u.ICoreService,b._coreService),b._coreMouseService=b._instantiationService.createInstance(i.CoreMouseService),b._instantiationService.setService(u.ICoreMouseService,b._coreMouseService),b._dirtyRowService=b._instantiationService.createInstance(e.DirtyRowService),b._instantiationService.setService(u.IDirtyRowService,b._dirtyRowService),b.unicodeService=b._instantiationService.createInstance(r.UnicodeService),b._instantiationService.setService(u.IUnicodeService,b.unicodeService),b._charsetService=b._instantiationService.createInstance(s.CharsetService),b._instantiationService.setService(u.ICharsetService,b._charsetService),b._inputHandler=new g.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(y){return b._updateOptions(y)})),b._writeBuffer=new m.WriteBuffer(function(y){return b._inputHandler.parse(y)}),b}return S(w,p),Object.defineProperty(w.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),w.prototype.dispose=function(){var E;this._isDisposed||(p.prototype.dispose.call(this),(E=this._windowsMode)===null||E===void 0||E.dispose(),this._windowsMode=void 0)},w.prototype.write=function(E,b){this._writeBuffer.write(E,b)},w.prototype.writeSync=function(E){this._writeBuffer.writeSync(E)},w.prototype.resize=function(E,b){isNaN(E)||isNaN(b)||(E=Math.max(E,o.MINIMUM_COLS),b=Math.max(b,o.MINIMUM_ROWS),this._bufferService.resize(E,b))},w.prototype.scroll=function(E,b){b===void 0&&(b=!1);var y,C=this._bufferService.buffer;(y=this._cachedBlankLine)&&y.length===this.cols&&y.getFg(0)===E.fg&&y.getBg(0)===E.bg||(y=C.getBlankLine(E,b),this._cachedBlankLine=y),y.isWrapped=b;var T=C.ybase+C.scrollTop,x=C.ybase+C.scrollBottom;if(C.scrollTop===0){var O=C.lines.isFull;x===C.lines.length-1?O?C.lines.recycle().copyFrom(y):C.lines.push(y.clone()):C.lines.splice(x+1,0,y.clone()),O?this._bufferService.isUserScrolling&&(C.ydisp=Math.max(C.ydisp-1,0)):(C.ybase++,this._bufferService.isUserScrolling||C.ydisp++)}else{var P=x-T+1;C.lines.shiftElements(T+1,P-1,-1),C.lines.set(x,y.clone())}this._bufferService.isUserScrolling||(C.ydisp=C.ybase),this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom),this._onScroll.fire(C.ydisp)},w.prototype.scrollLines=function(E,b){var y=this._bufferService.buffer;if(E<0){if(y.ydisp===0)return;this._bufferService.isUserScrolling=!0}else E+y.ydisp>=y.ybase&&(this._bufferService.isUserScrolling=!1);var C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+E,y.ybase),0),C!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))},w.prototype.scrollPages=function(E){this.scrollLines(E*(this.rows-1))},w.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},w.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},w.prototype.scrollToLine=function(E){var b=E-this._bufferService.buffer.ydisp;b!==0&&this.scrollLines(b)},w.prototype.addEscHandler=function(E,b){return this._inputHandler.addEscHandler(E,b)},w.prototype.addDcsHandler=function(E,b){return this._inputHandler.addDcsHandler(E,b)},w.prototype.addCsiHandler=function(E,b){return this._inputHandler.addCsiHandler(E,b)},w.prototype.addOscHandler=function(E,b){return this._inputHandler.addOscHandler(E,b)},w.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},w.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},w.prototype._updateOptions=function(E){var b;switch(E){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)}},w.prototype._enableWindowsMode=function(){var E=this;if(!this._windowsMode){var b=[];b.push(this.onLineFeed(l.updateWindowsModeWrappedState.bind(null,this._bufferService))),b.push(this.addCsiHandler({final:"H"},function(){return l.updateWindowsModeWrappedState(E._bufferService),!1})),this._windowsMode={dispose:function(){for(var y=0,C=b;y<C.length;y++)C[y].dispose()}}}},w}(h.Disposable);c.CoreTerminal=v},function(H,c,L){"use strict";var f=this&&this.__spreadArrays||function(){for(var d=0,o=0,n=arguments.length;o<n;o++)d+=arguments[o].length;var a=Array(d),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 S=L(1),h=L(14),u=function(){function d(){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 d.prototype.set=function(o,n){var a=this._entries.get(o);return this._entries.set(o,n),a},d.prototype.forEach=function(o){this._entries.forEach(function(n,a){return o(a,n)})},d.prototype.has=function(o){return this._entries.has(o)},d.prototype.get=function(o){return this._entries.get(o)},d}();c.ServiceCollection=u;var _=function(){function d(){this._services=new u,this._services.set(S.IInstantiationService,this)}return d.prototype.setService=function(o,n){this._services.set(o,n)},d.prototype.getService=function(o){return this._services.get(o)},d.prototype.createInstance=function(o){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];for(var t=h.getServiceDependencies(o).sort(function(m,v){return m.index-v.index}),i=[],e=0,r=t;e<r.length;e++){var s=r[e],l=this._services.get(s.id);if(!l)throw new Error("[createInstance] "+o.name+" depends on UNKNOWN service "+s.id+".");i.push(l)}var g=t.length>0?t[0].index:n.length;if(n.length!==g)throw new Error("[createInstance] First service dependency of "+o.name+" at position "+(g+1)+" conflicts with "+n.length+" static arguments");return new(o.bind.apply(o,f([void 0],f(n,i))))},d}();c.InstantiationService=_},function(H,c,L){"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 l=n.length-1;l>=0;l--)(e=n[l])&&(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},S=this&&this.__param||function(n,a){return function(t,i){a(t,i,n)}},h=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,l=r.length;s<l;s++,e++)i[e]=r[s];return i};Object.defineProperty(c,"__esModule",{value:!0}),c.LogService=c.LogLevel=void 0;var u,_=L(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"}(u=c.LogLevel||(c.LogLevel={}));var d={debug:u.DEBUG,info:u.INFO,warn:u.WARN,error:u.ERROR,off:u.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=d[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,h([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<=u.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<=u.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<=u.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<=u.ERROR&&this._log(console.error,a,t)},n=f([S(0,_.IOptionsService)],n)}();c.LogService=o},function(H,c,L){"use strict";var f,S=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)}),h=this&&this.__decorate||function(t,i,e,r){var s,l=arguments.length,g=l<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(t,i,e,r);else for(var m=t.length-1;m>=0;m--)(s=t[m])&&(g=(l<3?s(g):l>3?s(i,e,g):s(i,e))||g);return l>3&&g&&Object.defineProperty(i,e,g),g},u=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 _=L(1),d=L(69),o=L(0),n=L(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 d.BufferSet(e,r),r}return S(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 d.BufferSet(this._optionsService,this),this.isUserScrolling=!1},i=h([u(0,_.IOptionsService)],i)}(n.Disposable);c.BufferService=a},function(H,c,L){"use strict";var f,S=this&&this.__extends||(f=function(d,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])})(d,o)},function(d,o){function n(){this.constructor=d}f(d,o),d.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)});Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;var h=L(70),u=L(0),_=function(d){function o(n,a){var t=d.call(this)||this;return t._onBufferActivate=t.register(new u.EventEmitter),t._normal=new h.Buffer(!0,n,a),t._normal.fillViewportRows(),t._alt=new h.Buffer(!1,n,a),t._activeBuffer=t._normal,t.setupTabStops(),t}return S(o,d),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}(L(2).Disposable);c.BufferSet=_},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.BufferStringIterator=c.Buffer=c.MAX_BUFFER_SIZE=void 0;var f=L(71),S=L(16),h=L(4),u=L(3),_=L(72),d=L(73),o=L(20),n=L(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=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=h.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]),this._whitespaceCell=h.CellData.fromCharData([0,u.WHITESPACE_CELL_CHAR,u.WHITESPACE_CELL_WIDTH,u.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 S.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=S.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(S.DEFAULT_ATTR_DATA),l=this._getCorrectBufferLength(r);if(l>this.lines.maxLength&&(this.lines.maxLength=l),this.lines.length>0){if(this._cols<e)for(var g=0;g<this.lines.length;g++)this.lines.get(g).resize(e,s);var m=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 S.BufferLine(e,s)):this.ybase>0&&this.lines.length<=this.ybase+this.y+m+1?(this.ybase--,m++,this.ydisp>0&&this.ydisp--):this.lines.push(new S.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(l<this.lines.maxLength){var p=this.lines.length-l;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=l}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,r-1),m&&(this.y+=m),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(g=0;g<this.lines.length;g++)this.lines.get(g).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=_.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));if(s.length>0){var l=_.reflowLargerCreateNewLayout(this.lines,s);_.reflowLargerApplyNewLayout(this.lines,l.layout),this._reflowLargerAdjustViewport(e,r,l.countRemoved)}},i.prototype._reflowLargerAdjustViewport=function(e,r,s){for(var l=this.getNullCell(S.DEFAULT_ATTR_DATA),g=s;g-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<r&&this.lines.push(new S.BufferLine(e,l))):(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(S.DEFAULT_ATTR_DATA),l=[],g=0,m=this.lines.length-1;m>=0;m--){var v=this.lines.get(m);if(!(!v||!v.isWrapped&&v.getTrimmedLength()<=e)){for(var p=[v];v.isWrapped&&m>0;)v=this.lines.get(--m),p.unshift(v);var w=this.ybase+this.y;if(!(w>=m&&w<m+p.length)){var E=p[p.length-1].getTrimmedLength(),b=_.reflowSmallerGetNewLineLengths(p,this._cols,e),y=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+y):Math.max(0,this.lines.length-this.lines.maxLength+y);for(var T=[],x=0;x<y;x++){var O=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);T.push(O)}T.length>0&&(l.push({start:m+p.length+g,newLines:T}),g+=T.length),p.push.apply(p,T);var P=b.length-1,M=b[P];M===0&&(M=b[--P]);for(var B=p.length-y-1,W=E;B>=0;){var A=Math.min(W,M);if(p[P].copyCellsFrom(p[B],W-A,M-A,A,!0),(M-=A)===0&&(M=b[--P]),(W-=A)===0){B--;var k=Math.max(B,0);W=_.getWrappedLineTrimmedLength(p,k,this._cols)}}for(x=0;x<p.length;x++)b[x]<e&&p[x].setCell(b[x],s);for(var R=y-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+g)-r&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+y,this.ybase+r-1)}}}if(l.length>0){var I=[],D=[];for(x=0;x<this.lines.length;x++)D.push(this.lines.get(x));var F=this.lines.length,U=F-1,K=0,V=l[K];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+g);var X=0;for(x=Math.min(this.lines.maxLength-1,F+g-1);x>=0;x--)if(V&&V.start>U+X){for(var j=V.newLines.length-1;j>=0;j--)this.lines.set(x--,V.newLines[j]);x++,I.push({index:U+1,amount:V.newLines.length}),X+=V.newLines.length,V=l[++K]}else this.lines.set(x,D[U--]);var N=0;for(x=I.length-1;x>=0;x--)I[x].index+=N,this.lines.onInsertEmitter.fire(I[x]),N+=I[x].amount;var z=Math.max(0,F+g-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 l=this.lines.get(e);if(!l)return[-1,-1];for(var g=s?l.getTrimmedLength():l.length,m=0;m<g;++m)if(l.get(m)[u.CHAR_DATA_WIDTH_INDEX]&&(r-=l.get(m)[u.CHAR_DATA_CHAR_INDEX].length||1),r<0)return[e,m];e++}return[e,0]},i.prototype.translateBufferLineToString=function(e,r,s,l){s===void 0&&(s=0);var g=this.lines.get(e);return g?g.translateToString(r,s,l):""},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 d.Marker(e);return this.markers.push(s),s.register(this.lines.onTrim(function(l){s.line-=l,s.line<0&&s.dispose()})),s.register(this.lines.onInsert(function(l){s.line>=l.index&&(s.line+=l.amount)})),s.register(this.lines.onDelete(function(l){s.line>=l.index&&s.line<l.index+l.amount&&s.dispose(),s.line>l.index&&(s.line-=l.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,l,g){return new t(this,e,r,s,l,g)},i}();c.Buffer=a;var t=function(){function i(e,r,s,l,g,m){s===void 0&&(s=0),l===void 0&&(l=e.lines.length),g===void 0&&(g=0),m===void 0&&(m=0),this._buffer=e,this._trimRight=r,this._startIndex=s,this._endIndex=l,this._startOverscan=g,this._endOverscan=m,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(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;var f=L(0),S=function(){function h(u){this._maxLength=u,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(h.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"maxLength",{get:function(){return this._maxLength},set:function(u){if(this._maxLength!==u){for(var _=new Array(u),d=0;d<Math.min(u,this.length);d++)_[d]=this._array[this._getCyclicIndex(d)];this._array=_,this._maxLength=u,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"length",{get:function(){return this._length},set:function(u){if(u>this._length)for(var _=this._length;_<u;_++)this._array[_]=void 0;this._length=u},enumerable:!1,configurable:!0}),h.prototype.get=function(u){return this._array[this._getCyclicIndex(u)]},h.prototype.set=function(u,_){this._array[this._getCyclicIndex(u)]=_},h.prototype.push=function(u){this._array[this._getCyclicIndex(this._length)]=u,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},h.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(h.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),h.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},h.prototype.splice=function(u,_){for(var d=[],o=2;o<arguments.length;o++)d[o-2]=arguments[o];if(_){for(var n=u;n<this._length-_;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+_)];this._length-=_}for(n=this._length-1;n>=u;n--)this._array[this._getCyclicIndex(n+d.length)]=this._array[this._getCyclicIndex(n)];for(n=0;n<d.length;n++)this._array[this._getCyclicIndex(u+n)]=d[n];if(this._length+d.length>this._maxLength){var a=this._length+d.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=d.length},h.prototype.trimStart=function(u){u>this._length&&(u=this._length),this._startIndex+=u,this._length-=u,this.onTrimEmitter.fire(u)},h.prototype.shiftElements=function(u,_,d){if(!(_<=0)){if(u<0||u>=this._length)throw new Error("start argument out of range");if(u+d<0)throw new Error("Cannot shift elements in list beyond index 0");if(d>0){for(var o=_-1;o>=0;o--)this.set(u+o+d,this.get(u+o));var n=u+_+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<_;o++)this.set(u+o+d,this.get(u+o))}},h.prototype._getCyclicIndex=function(u){return(this._startIndex+u)%this._maxLength},h}();c.CircularList=S},function(H,c,L){"use strict";function f(S,h,u){if(h===S.length-1)return S[h].getTrimmedLength();var _=!S[h].hasContent(u-1)&&S[h].getWidth(u-1)===1,d=S[h+1].getWidth(0)===2;return _&&d?u-1:u}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(S,h,u,_,d){for(var o=[],n=0;n<S.length-1;n++){var a=n,t=S.get(++a);if(t.isWrapped){for(var i=[S.get(n)];a<S.length&&t.isWrapped;)i.push(t),t=S.get(++a);if(_>=n&&_<a)n+=i.length-1;else{for(var e=0,r=f(i,e,h),s=1,l=0;s<i.length;){var g=f(i,s,h),m=g-l,v=u-r,p=Math.min(m,v);i[e].copyCellsFrom(i[s],l,r,p,!1),(r+=p)===u&&(e++,r=0),(l+=p)===g&&(s++,l=0),r===0&&e!==0&&i[e-1].getWidth(u-1)===2&&(i[e].copyCellsFrom(i[e-1],u-1,r++,1,!1),i[e-1].setCell(u-1,d))}i[e].replaceCells(r,u,d);for(var w=0,E=i.length-1;E>0&&(E>e||i[E].getTrimmedLength()===0);E--)w++;w>0&&(o.push(n+i.length-w),o.push(w)),n+=i.length-1}}}return o},c.reflowLargerCreateNewLayout=function(S,h){for(var u=[],_=0,d=h[_],o=0,n=0;n<S.length;n++)if(d===n){var a=h[++_];S.onDeleteEmitter.fire({index:n-o,amount:a}),n+=a-1,o+=a,d=h[++_]}else u.push(n);return{layout:u,countRemoved:o}},c.reflowLargerApplyNewLayout=function(S,h){for(var u=[],_=0;_<h.length;_++)u.push(S.get(h[_]));for(_=0;_<u.length;_++)S.set(_,u[_]);S.length=h.length},c.reflowSmallerGetNewLineLengths=function(S,h,u){for(var _=[],d=S.map(function(r,s){return f(S,s,h)}).reduce(function(r,s){return r+s}),o=0,n=0,a=0;a<d;){if(d-a<u){_.push(d-a);break}o+=u;var t=f(S,n,h);o>t&&(o-=t,n++);var i=S[n].getWidth(o-1)===2;i&&o--;var e=i?u-1:u;_.push(e),a+=e}return _},c.getWrappedLineTrimmedLength=f},function(H,c,L){"use strict";var f,S=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=_}f(_,d),_.prototype=d===null?Object.create(d):(o.prototype=d.prototype,new o)});Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;var h=L(0),u=function(_){function d(o){var n=_.call(this)||this;return n.line=o,n._id=d._nextId++,n.isDisposed=!1,n._onDispose=new h.EventEmitter,n}return S(d,_),Object.defineProperty(d.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),d.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},d._nextId=1,d}(L(2).Disposable);c.Marker=u},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=c.DEFAULT_BELL_SOUND=void 0;var f=L(0),S=L(11),h=L(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:S.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var u=["cols","rows"],_=function(){function d(o){this._onOptionChange=new f.EventEmitter,this.options=h.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(d.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),d.prototype.setOption=function(o,n){if(!(o in c.DEFAULT_OPTIONS))throw new Error('No option with key "'+o+'"');if(u.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)))},d.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},d.prototype.getOption=function(o){if(!(o in c.DEFAULT_OPTIONS))throw new Error('No option with key "'+o+'"');return this.options[o]},d}();c.OptionsService=_},function(H,c,L){"use strict";var f,S=this&&this.__extends||(f=function(e,r){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,l){s.__proto__=l}||function(s,l){for(var g in l)l.hasOwnProperty(g)&&(s[g]=l[g])})(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)}),h=this&&this.__decorate||function(e,r,s,l){var g,m=arguments.length,v=m<3?r:l===null?l=Object.getOwnPropertyDescriptor(r,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,s,l);else for(var p=e.length-1;p>=0;p--)(g=e[p])&&(v=(m<3?g(v):m>3?g(r,s,v):g(r,s))||v);return m>3&&v&&Object.defineProperty(r,s,v),v},u=this&&this.__param||function(e,r){return function(s,l){r(s,l,e)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;var _=L(1),d=L(0),o=L(33),n=L(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,l,g,m){var v=e.call(this)||this;return v._bufferService=l,v._logService=g,v._optionsService=m,v.isCursorInitialized=!1,v.isCursorHidden=!1,v._onData=v.register(new d.EventEmitter),v._onUserInput=v.register(new d.EventEmitter),v._onBinary=v.register(new d.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 S(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,l){if(l===void 0&&(l=!1),!this._optionsService.options.disableStdin){var g=this._bufferService.buffer;g.ybase!==g.ydisp&&this._scrollToBottom(),l&&this._onUserInput.fire(),this._logService.debug('sending data "'+s+'"',function(){return s.split("").map(function(m){return m.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(l){return l.charCodeAt(0)})}),this._onBinary.fire(s))},r=h([u(1,_.IBufferService),u(2,_.ILogService),u(3,_.IOptionsService)],r)}(n.Disposable);c.CoreService=i},function(H,c,L){"use strict";var f=this&&this.__decorate||function(t,i,e,r){var s,l=arguments.length,g=l<3?i:r===null?r=Object.getOwnPropertyDescriptor(i,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(t,i,e,r);else for(var m=t.length-1;m>=0;m--)(s=t[m])&&(g=(l<3?s(g):l>3?s(i,e,g):s(i,e))||g);return l>3&&g&&Object.defineProperty(i,e,g),g},S=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 h=L(1),u=L(0),_={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 d(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=[d(t,!1)+32,t.col+32,t.row+32];return i[0]>255||i[1]>255||i[2]>255?"":""+o(i[0])+o(i[1])+o(i[2])},SGR:function(t){var i=t.action===0&&t.button!==4?"m":"M";return"[<"+d(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 u.EventEmitter,this._lastEvent=null;for(var r=0,s=Object.keys(_);r<s.length;r++){var l=s[r];this.addProtocol(l,_[l])}for(var g=0,m=Object.keys(n);g<m.length;g++){var v=m[g];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([S(0,h.IBufferService),S(1,h.ICoreService)],t)}();c.CoreMouseService=a},function(H,c,L){"use strict";var f=this&&this.__decorate||function(_,d,o,n){var a,t=arguments.length,i=t<3?d:n===null?n=Object.getOwnPropertyDescriptor(d,o):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(_,d,o,n);else for(var e=_.length-1;e>=0;e--)(a=_[e])&&(i=(t<3?a(i):t>3?a(d,o,i):a(d,o))||i);return t>3&&i&&Object.defineProperty(d,o,i),i},S=this&&this.__param||function(_,d){return function(o,n){d(o,n,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DirtyRowService=void 0;var h=L(1),u=function(){function _(d){this._bufferService=d,this.clearRange()}return Object.defineProperty(_.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),_.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},_.prototype.markDirty=function(d){d<this._start?this._start=d:d>this._end&&(this._end=d)},_.prototype.markRangeDirty=function(d,o){if(d>o){var n=d;d=o,o=n}d<this._start&&(this._start=d),o>this._end&&(this._end=o)},_.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},_=f([S(0,h.IBufferService)],_)}();c.DirtyRowService=u},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;var f=L(0),S=L(79),h=function(){function u(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter;var _=new S.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}return Object.defineProperty(u.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"activeVersion",{get:function(){return this._active},set:function(_){if(!this._providers[_])throw new Error('unknown Unicode version "'+_+'"');this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)},enumerable:!1,configurable:!0}),u.prototype.register=function(_){this._providers[_.version]=_},u.prototype.wcwidth=function(_){return this._activeProvider.wcwidth(_)},u.prototype.getStringCellWidth=function(_){for(var d=0,o=_.length,n=0;n<o;++n){var a=_.charCodeAt(n);if(55296<=a&&a<=56319){if(++n>=o)return d+this.wcwidth(a);var t=_.charCodeAt(n);56320<=t&&t<=57343?a=1024*(a-55296)+t-56320+65536:d+=this.wcwidth(t)}d+=this.wcwidth(a)}return d},u}();c.UnicodeService=h},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;var f,S=L(15),h=[[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]],u=[[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]],_=function(){function d(){if(this.version="6",!f){f=new Uint8Array(65536),S.fill(f,1),f[0]=0,S.fill(f,0,1,32),S.fill(f,0,127,160),S.fill(f,2,4352,4448),f[9001]=2,f[9002]=2,S.fill(f,2,11904,42192),f[12351]=1,S.fill(f,2,44032,55204),S.fill(f,2,63744,64256),S.fill(f,2,65040,65050),S.fill(f,2,65072,65136),S.fill(f,2,65280,65377),S.fill(f,2,65504,65511);for(var o=0;o<h.length;++o)S.fill(f,0,h[o][0],h[o][1]+1)}}return d.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,u)?0:o>=131072&&o<=196605||o>=196608&&o<=262141?2:1},d}();c.UnicodeV6=_},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0;var f=function(){function S(){this.glevel=0,this._charsets=[]}return S.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},S.prototype.setgLevel=function(h){this.glevel=h,this.charset=this._charsets[h]},S.prototype.setgCharset=function(h,u){this._charsets[h]=u,this.glevel===h&&(this.charset=u)},S}();c.CharsetService=f},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;var f=L(3);c.updateWindowsModeWrappedState=function(S){var h=S.buffer.lines.get(S.buffer.ybase+S.buffer.y-1),u=h==null?void 0:h.get(S.cols-1),_=S.buffer.lines.get(S.buffer.ybase+S.buffer.y);_&&u&&(_.isWrapped=u[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&u[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;var f=function(){function S(h){this._action=h,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return S.prototype.writeSync=function(h){if(this._writeBuffer.length){for(var u=this._bufferOffset;u<this._writeBuffer.length;++u){var _=this._writeBuffer[u],d=this._callbacks[u];this._action(_),d&&d()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(h)},S.prototype.write=function(h,u){var _=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 _._innerWrite()})),this._pendingData+=h.length,this._writeBuffer.push(h),this._callbacks.push(u)},S.prototype._innerWrite=function(){for(var h=this,u=Date.now();this._writeBuffer.length>this._bufferOffset;){var _=this._writeBuffer[this._bufferOffset],d=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(_),this._pendingData-=_.length,d&&d(),Date.now()-u>=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 h._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},S}();c.WriteBuffer=f},function(H,c,L){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0;var f=function(){function S(){this._addons=[]}return S.prototype.dispose=function(){for(var h=this._addons.length-1;h>=0;h--)this._addons[h].instance.dispose()},S.prototype.loadAddon=function(h,u){var _=this,d={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(d),u.dispose=function(){return _._wrappedAddonDispose(d)},u.activate(h)},S.prototype._wrappedAddonDispose=function(h){if(!h.isDisposed){for(var u=-1,_=0;_<this._addons.length;_++)if(this._addons[_]===h){u=_;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");h.isDisposed=!0,h.dispose.apply(h.instance),this._addons.splice(u,1)}},S}();c.AddonManager=f}])})},Dqnf:function(G,J,q){"use strict";var H=q("k1fw"),c=q("tJVT"),L=q("rAM+"),f=q("q1tI"),S=q.n(f),h=q("J66h"),u=q.n(h),_=q("/POA"),d=q.n(_),o=q("q7KB"),n=q.n(o),a=q("ER/M"),t=q.n(a),i=q("dhSg"),e=q("bdgK");function r(g,m,v){var p=v._core._renderService.dimensions.actualCellWidth||9.5,w=v._core._renderService.dimensions.actualCellHeight||18,E=Math.floor(m/w),b=Math.floor(g/p);return[b,E]}function s(g,m){var v=new e.default(function(p){var w=Object(L.a)(p),E;try{for(w.s();!(E=w.n()).done;){var b=E.value;if(b.target.offsetHeight>0||b.target.offsetWidth>0){var y=r(b.target.offsetWidth,b.target.offsetHeight,g),C=Object(c.a)(y,2),T=C[0],x=C[1];console.log("cols, rows",T,x),i.a.publish("ssh-xterm-resize",{columns:T,rows:x,width:b.target.offsetWidth,height:b.target.offsetHeight}),g.resize(T,x);var O=h.Base64.decode("IA=="),P=h.Base64.decode("CBtbSw==");g.write(O),g.write(P)}}}catch(M){w.e(M)}finally{w.f()}});return v.observe(m),v}var l=3e4;J.a=function(g){var m=g.sshConfigData,v=g.sid,p=Object(f.useState)(null),w=Object(c.a)(p,2),E=w[0],b=w[1],y=m.link_url,C=m.password,T=m.port,x=Object(f.useRef)(),O=Object(f.useRef)(),P=Object(f.useRef)(!1);return Object(f.useEffect)(function(){if(x.current&&y){var M=new _.Terminal({fontSize:16,rendererType:"dom"});M.open(x.current),M.onData(function(W){O.current&&(O.current.readyState===1&&(O.current.send(JSON.stringify({tp:"client",data:W})),i.a.publish("on-operating-ssh")))}),M.write("Connecting..."),b(M);var B=s(M,x.current);return function(){M.dispose(),B.unobserve(x.current)}}},[y,x.current]),Object(f.useEffect)(function(){if(E&&y){function M(){var I=new WebSocket(y);O.current=I,I.onopen=function(){var D=E.element.parentElement;if(D){var F=D.offsetWidth,U=D.offsetHeight;console.log("init",{tp:"init",data:Object(H.a)(Object(H.a)({},m),{},{secret:C,width:F,height:U,rows:E.rows,columns:E.cols})}),I.send(JSON.stringify({tp:"init",data:Object(H.a)(Object(H.a)({},m),{},{secret:C,width:F,height:U,rows:E.rows,columns:E.cols})}))}E.focus()},I.onerror=function(D){console.log("------in socket error----",D,I,y)},I.onmessage=function(D){P.current||(E.write("\r"),setTimeout(function(){},1e3)),P.current=!0,console.log("event:",D);var F=h.Base64.decode(D.data.toString()),U=E._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",F,U,E),E.write(F)},I.onclose=function(D){B&&clearInterval(B),E.write(`\r
connection closed`)}}var B=setInterval(function(){O.current&&O.current.send(JSON.stringify({tp:"h"}))},l),W=i.a.subscribe("create-socket",function(I){v==I&&(O.current&&O.current.readyState===1?E.focus():M(),E.focus())}),A=i.a.subscribe("close-socket",function(I){v===I&&(O.current&&(O.current.close(),P.current=!1,E.clear()),O.current=null)}),k=i.a.subscribe("ssh-xterm-resize",function(I){O.current&&O.current.readyState===1&&O.current.send(JSON.stringify({tp:"resize",data:Object(H.a)({},I)}))}),R=i.a.subscribe("ssh-add-connect-time",function(){O.current&&O.current.readyState===1&&O.current.send(JSON.stringify({tp:"overtime"}))});return function(){A(),W(),k(),R(),O.current&&(O.current.close(),P.current=!1)}}},[E,y,T]),S.a.createElement("div",{ref:x,className:t.a["xterm-panel"]},y?null:S.a.createElement("p",{style:{color:"#fff"}},"\u6B63\u5728\u8FDE\u63A5\u547D\u4EE4\u884C\u670D\u52A1..."))}},"ER/M":function(G,J,q){G.exports={"xterm-panel":"xterm-panel___2r2xx"}},J66h:function(G,J,q){(function(H){var c,L;(function(f,S){G.exports=S(f)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof H!="undefined"?H:this,function(f){"use strict";f=f||{};var S=f.Base64,h="2.6.4",u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=function(M){for(var B={},W=0,A=M.length;W<A;W++)B[M.charAt(W)]=W;return B}(u),d=String.fromCharCode,o=function(M){if(M.length<2){var B=M.charCodeAt(0);return B<128?M:B<2048?d(192|B>>>6)+d(128|B&63):d(224|B>>>12&15)+d(128|B>>>6&63)+d(128|B&63)}else{var B=65536+(M.charCodeAt(0)-55296)*1024+(M.charCodeAt(1)-56320);return d(240|B>>>18&7)+d(128|B>>>12&63)+d(128|B>>>6&63)+d(128|B&63)}},n=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,a=function(M){return M.replace(n,o)},t=function(M){var B=[0,2,1][M.length%3],W=M.charCodeAt(0)<<16|(M.length>1?M.charCodeAt(1):0)<<8|(M.length>2?M.charCodeAt(2):0),A=[u.charAt(W>>>18),u.charAt(W>>>12&63),B>=2?"=":u.charAt(W>>>6&63),B>=1?"=":u.charAt(W&63)];return A.join("")},i=f.btoa&&typeof f.btoa=="function"?function(M){return f.btoa(M)}:function(M){if(M.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return M.replace(/[\s\S]{1,3}/g,t)},e=function(M){return i(a(String(M)))},r=function(M){return M.replace(/[+\/]/g,function(B){return B=="+"?"-":"_"}).replace(/=/g,"")},s=function(M,B){return B?r(e(M)):e(M)},l=function(M){return s(M,!0)},g;f.Uint8Array&&(g=function(M,B){for(var W="",A=0,k=M.length;A<k;A+=3){var R=M[A],I=M[A+1],D=M[A+2],F=R<<16|I<<8|D;W+=u.charAt(F>>>18)+u.charAt(F>>>12&63)+(typeof I!="undefined"?u.charAt(F>>>6&63):"=")+(typeof D!="undefined"?u.charAt(F&63):"=")}return B?r(W):W});var m=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(M){switch(M.length){case 4:var B=(7&M.charCodeAt(0))<<18|(63&M.charCodeAt(1))<<12|(63&M.charCodeAt(2))<<6|63&M.charCodeAt(3),W=B-65536;return d((W>>>10)+55296)+d((W&1023)+56320);case 3:return d((15&M.charCodeAt(0))<<12|(63&M.charCodeAt(1))<<6|63&M.charCodeAt(2));default:return d((31&M.charCodeAt(0))<<6|63&M.charCodeAt(1))}},p=function(M){return M.replace(m,v)},w=function(M){var B=M.length,W=B%4,A=(B>0?_[M.charAt(0)]<<18:0)|(B>1?_[M.charAt(1)]<<12:0)|(B>2?_[M.charAt(2)]<<6:0)|(B>3?_[M.charAt(3)]:0),k=[d(A>>>16),d(A>>>8&255),d(A&255)];return k.length-=[0,0,2,1][W],k.join("")},E=f.atob&&typeof f.atob=="function"?function(M){return f.atob(M)}:function(M){return M.replace(/\S{1,4}/g,w)},b=function(M){return E(String(M).replace(/[^A-Za-z0-9\+\/]/g,""))},y=function(M){return p(E(M))},C=function(M){return String(M).replace(/[-_]/g,function(B){return B=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},T=function(M){return y(C(M))},x;f.Uint8Array&&(x=function(M){return Uint8Array.from(b(C(M)),function(B){return B.charCodeAt(0)})});var O=function(){var M=f.Base64;return f.Base64=S,M};if(f.Base64={VERSION:h,atob:b,btoa:i,fromBase64:T,toBase64:s,utob:a,encode:s,encodeURI:l,btou:p,decode:T,noConflict:O,fromUint8Array:g,toUint8Array:x},typeof Object.defineProperty=="function"){var P=function(M){return{value:M,enumerable:!1,writable:!0,configurable:!0}};f.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",P(function(){return T(this)})),Object.defineProperty(String.prototype,"toBase64",P(function(M){return s(this,M)})),Object.defineProperty(String.prototype,"toBase64URI",P(function(){return s(this,!0)}))}}return f.Meteor&&(Base64=f.Base64),G.exports?G.exports.Base64=f.Base64:!(c=[],L=function(){return f.Base64}.apply(J,c),L!==void 0&&(G.exports=L)),{Base64:f.Base64}})}).call(this,q("IyRk"))},q7KB:function(G,J,q){},"rAM+":function(G,J,q){"use strict";q.d(J,"a",function(){return c});var H=q("Qw5x");function c(L,f){var S;if(typeof Symbol=="undefined"||L[Symbol.iterator]==null){if(Array.isArray(L)||(S=Object(H.a)(L))||f&&L&&typeof L.length=="number"){S&&(L=S);var h=0,u=function(){};return{s:u,n:function(){return h>=L.length?{done:!0}:{done:!1,value:L[h++]}},e:function(a){throw a},f:u}}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 _=!0,d=!1,o;return{s:function(){S=L[Symbol.iterator]()},n:function(){var a=S.next();return _=a.done,a},e:function(a){d=!0,o=a},f:function(){try{!_&&S.return!=null&&S.return()}finally{if(d)throw o}}}}}}]);